@sebgroup/green-react 1.0.0-beta.5 → 1.0.0-beta.8

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/index.esm.js CHANGED
@@ -1,6 +1,6 @@
1
- import { jsx, jsxs } from 'react/jsx-runtime';
2
- import React, { useState, useEffect, useMemo, useRef } from 'react';
3
- import { randomId } from '@sebgroup/extract';
1
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
+ import React, { useState, useLayoutEffect, useEffect, useMemo, useRef } from 'react';
3
+ import { randomId, validateClassName } from '@sebgroup/extract';
4
4
 
5
5
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
6
6
 
@@ -21,7 +21,7 @@ var global$r =
21
21
 
22
22
  var objectGetOwnPropertyDescriptor = {};
23
23
 
24
- var fails$9 = function (exec) {
24
+ var fails$a = function (exec) {
25
25
  try {
26
26
  return !!exec();
27
27
  } catch (error) {
@@ -29,17 +29,27 @@ var fails$9 = function (exec) {
29
29
  }
30
30
  };
31
31
 
32
- var fails$8 = fails$9;
32
+ var fails$9 = fails$a;
33
33
 
34
34
  // Detect IE8's incomplete defineProperty implementation
35
- var descriptors = !fails$8(function () {
35
+ var descriptors = !fails$9(function () {
36
36
  // eslint-disable-next-line es/no-object-defineproperty -- required for testing
37
37
  return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
38
38
  });
39
39
 
40
+ var fails$8 = fails$a;
41
+
42
+ var functionBindNative = !fails$8(function () {
43
+ var test = (function () { /* empty */ }).bind();
44
+ // eslint-disable-next-line no-prototype-builtins -- safe
45
+ return typeof test != 'function' || test.hasOwnProperty('prototype');
46
+ });
47
+
48
+ var NATIVE_BIND$1 = functionBindNative;
49
+
40
50
  var call$6 = Function.prototype.call;
41
51
 
42
- var functionCall = call$6.bind ? call$6.bind(call$6) : function () {
52
+ var functionCall = NATIVE_BIND$1 ? call$6.bind(call$6) : function () {
43
53
  return call$6.apply(call$6, arguments);
44
54
  };
45
55
 
@@ -68,35 +78,37 @@ var createPropertyDescriptor$3 = function (bitmap, value) {
68
78
  };
69
79
  };
70
80
 
81
+ var NATIVE_BIND = functionBindNative;
82
+
71
83
  var FunctionPrototype$1 = Function.prototype;
72
84
  var bind = FunctionPrototype$1.bind;
73
85
  var call$5 = FunctionPrototype$1.call;
74
- var callBind = bind && bind.bind(call$5);
86
+ var uncurryThis$c = NATIVE_BIND && bind.bind(call$5, call$5);
75
87
 
76
- var functionUncurryThis = bind ? function (fn) {
77
- return fn && callBind(call$5, fn);
88
+ var functionUncurryThis = NATIVE_BIND ? function (fn) {
89
+ return fn && uncurryThis$c(fn);
78
90
  } : function (fn) {
79
91
  return fn && function () {
80
92
  return call$5.apply(fn, arguments);
81
93
  };
82
94
  };
83
95
 
84
- var uncurryThis$c = functionUncurryThis;
96
+ var uncurryThis$b = functionUncurryThis;
85
97
 
86
- var toString$4 = uncurryThis$c({}.toString);
87
- var stringSlice = uncurryThis$c(''.slice);
98
+ var toString$3 = uncurryThis$b({}.toString);
99
+ var stringSlice$1 = uncurryThis$b(''.slice);
88
100
 
89
101
  var classofRaw$1 = function (it) {
90
- return stringSlice(toString$4(it), 8, -1);
102
+ return stringSlice$1(toString$3(it), 8, -1);
91
103
  };
92
104
 
93
105
  var global$q = global$r;
94
- var uncurryThis$b = functionUncurryThis;
95
- var fails$7 = fails$9;
106
+ var uncurryThis$a = functionUncurryThis;
107
+ var fails$7 = fails$a;
96
108
  var classof$2 = classofRaw$1;
97
109
 
98
110
  var Object$5 = global$q.Object;
99
- var split = uncurryThis$b(''.split);
111
+ var split = uncurryThis$a(''.split);
100
112
 
101
113
  // fallback for non-array-like ES3 and non-enumerable old V8 strings
102
114
  var indexedObject = fails$7(function () {
@@ -113,45 +125,45 @@ var TypeError$8 = global$p.TypeError;
113
125
 
114
126
  // `RequireObjectCoercible` abstract operation
115
127
  // https://tc39.es/ecma262/#sec-requireobjectcoercible
116
- var requireObjectCoercible$3 = function (it) {
128
+ var requireObjectCoercible$2 = function (it) {
117
129
  if (it == undefined) throw TypeError$8("Can't call method on " + it);
118
130
  return it;
119
131
  };
120
132
 
121
133
  // toObject with fallback for non-array-like ES3 strings
122
134
  var IndexedObject$1 = indexedObject;
123
- var requireObjectCoercible$2 = requireObjectCoercible$3;
135
+ var requireObjectCoercible$1 = requireObjectCoercible$2;
124
136
 
125
137
  var toIndexedObject$5 = function (it) {
126
- return IndexedObject$1(requireObjectCoercible$2(it));
138
+ return IndexedObject$1(requireObjectCoercible$1(it));
127
139
  };
128
140
 
129
141
  // `IsCallable` abstract operation
130
142
  // https://tc39.es/ecma262/#sec-iscallable
131
- var isCallable$e = function (argument) {
143
+ var isCallable$f = function (argument) {
132
144
  return typeof argument == 'function';
133
145
  };
134
146
 
135
- var isCallable$d = isCallable$e;
147
+ var isCallable$e = isCallable$f;
136
148
 
137
149
  var isObject$5 = function (it) {
138
- return typeof it == 'object' ? it !== null : isCallable$d(it);
150
+ return typeof it == 'object' ? it !== null : isCallable$e(it);
139
151
  };
140
152
 
141
153
  var global$o = global$r;
142
- var isCallable$c = isCallable$e;
154
+ var isCallable$d = isCallable$f;
143
155
 
144
156
  var aFunction = function (argument) {
145
- return isCallable$c(argument) ? argument : undefined;
157
+ return isCallable$d(argument) ? argument : undefined;
146
158
  };
147
159
 
148
160
  var getBuiltIn$4 = function (namespace, method) {
149
161
  return arguments.length < 2 ? aFunction(global$o[namespace]) : global$o[namespace] && global$o[namespace][method];
150
162
  };
151
163
 
152
- var uncurryThis$a = functionUncurryThis;
164
+ var uncurryThis$9 = functionUncurryThis;
153
165
 
154
- var objectIsPrototypeOf = uncurryThis$a({}.isPrototypeOf);
166
+ var objectIsPrototypeOf = uncurryThis$9({}.isPrototypeOf);
155
167
 
156
168
  var getBuiltIn$3 = getBuiltIn$4;
157
169
 
@@ -188,7 +200,7 @@ var engineV8Version = version;
188
200
  /* eslint-disable es/no-symbol -- required for testing */
189
201
 
190
202
  var V8_VERSION = engineV8Version;
191
- var fails$6 = fails$9;
203
+ var fails$6 = fails$a;
192
204
 
193
205
  // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
194
206
  var nativeSymbol = !!Object.getOwnPropertySymbols && !fails$6(function () {
@@ -202,16 +214,16 @@ var nativeSymbol = !!Object.getOwnPropertySymbols && !fails$6(function () {
202
214
 
203
215
  /* eslint-disable es/no-symbol -- required for testing */
204
216
 
205
- var NATIVE_SYMBOL$1 = nativeSymbol;
217
+ var NATIVE_SYMBOL$2 = nativeSymbol;
206
218
 
207
- var useSymbolAsUid = NATIVE_SYMBOL$1
219
+ var useSymbolAsUid = NATIVE_SYMBOL$2
208
220
  && !Symbol.sham
209
221
  && typeof Symbol.iterator == 'symbol';
210
222
 
211
223
  var global$m = global$r;
212
224
  var getBuiltIn$2 = getBuiltIn$4;
213
- var isCallable$b = isCallable$e;
214
- var isPrototypeOf = objectIsPrototypeOf;
225
+ var isCallable$c = isCallable$f;
226
+ var isPrototypeOf$1 = objectIsPrototypeOf;
215
227
  var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
216
228
 
217
229
  var Object$4 = global$m.Object;
@@ -220,7 +232,7 @@ var isSymbol$2 = USE_SYMBOL_AS_UID$1 ? function (it) {
220
232
  return typeof it == 'symbol';
221
233
  } : function (it) {
222
234
  var $Symbol = getBuiltIn$2('Symbol');
223
- return isCallable$b($Symbol) && isPrototypeOf($Symbol.prototype, Object$4(it));
235
+ return isCallable$c($Symbol) && isPrototypeOf$1($Symbol.prototype, Object$4(it));
224
236
  };
225
237
 
226
238
  var global$l = global$r;
@@ -236,14 +248,14 @@ var tryToString$1 = function (argument) {
236
248
  };
237
249
 
238
250
  var global$k = global$r;
239
- var isCallable$a = isCallable$e;
251
+ var isCallable$b = isCallable$f;
240
252
  var tryToString = tryToString$1;
241
253
 
242
254
  var TypeError$7 = global$k.TypeError;
243
255
 
244
256
  // `Assert: IsCallable(argument) is true`
245
257
  var aCallable$1 = function (argument) {
246
- if (isCallable$a(argument)) return argument;
258
+ if (isCallable$b(argument)) return argument;
247
259
  throw TypeError$7(tryToString(argument) + ' is not a function');
248
260
  };
249
261
 
@@ -258,7 +270,7 @@ var getMethod$1 = function (V, P) {
258
270
 
259
271
  var global$j = global$r;
260
272
  var call$4 = functionCall;
261
- var isCallable$9 = isCallable$e;
273
+ var isCallable$a = isCallable$f;
262
274
  var isObject$4 = isObject$5;
263
275
 
264
276
  var TypeError$6 = global$j.TypeError;
@@ -267,9 +279,9 @@ var TypeError$6 = global$j.TypeError;
267
279
  // https://tc39.es/ecma262/#sec-ordinarytoprimitive
268
280
  var ordinaryToPrimitive$1 = function (input, pref) {
269
281
  var fn, val;
270
- if (pref === 'string' && isCallable$9(fn = input.toString) && !isObject$4(val = call$4(fn, input))) return val;
271
- if (isCallable$9(fn = input.valueOf) && !isObject$4(val = call$4(fn, input))) return val;
272
- if (pref !== 'string' && isCallable$9(fn = input.toString) && !isObject$4(val = call$4(fn, input))) return val;
282
+ if (pref === 'string' && isCallable$a(fn = input.toString) && !isObject$4(val = call$4(fn, input))) return val;
283
+ if (isCallable$a(fn = input.valueOf) && !isObject$4(val = call$4(fn, input))) return val;
284
+ if (pref !== 'string' && isCallable$a(fn = input.toString) && !isObject$4(val = call$4(fn, input))) return val;
273
285
  throw TypeError$6("Can't convert object to primitive value");
274
286
  };
275
287
 
@@ -278,11 +290,11 @@ var shared$3 = {exports: {}};
278
290
  var global$i = global$r;
279
291
 
280
292
  // eslint-disable-next-line es/no-object-defineproperty -- safe
281
- var defineProperty$2 = Object.defineProperty;
293
+ var defineProperty$4 = Object.defineProperty;
282
294
 
283
295
  var setGlobal$3 = function (key, value) {
284
296
  try {
285
- defineProperty$2(global$i, key, { value: value, configurable: true, writable: true });
297
+ defineProperty$4(global$i, key, { value: value, configurable: true, writable: true });
286
298
  } catch (error) {
287
299
  global$i[key] = value;
288
300
  } return value;
@@ -301,26 +313,28 @@ var store$2 = sharedStore;
301
313
  (shared$3.exports = function (key, value) {
302
314
  return store$2[key] || (store$2[key] = value !== undefined ? value : {});
303
315
  })('versions', []).push({
304
- version: '3.19.3',
316
+ version: '3.21.1',
305
317
  mode: 'global',
306
- copyright: '© 2021 Denis Pushkarev (zloirock.ru)'
318
+ copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
319
+ license: 'https://github.com/zloirock/core-js/blob/v3.21.1/LICENSE',
320
+ source: 'https://github.com/zloirock/core-js'
307
321
  });
308
322
 
309
323
  var global$g = global$r;
310
- var requireObjectCoercible$1 = requireObjectCoercible$3;
324
+ var requireObjectCoercible = requireObjectCoercible$2;
311
325
 
312
326
  var Object$3 = global$g.Object;
313
327
 
314
328
  // `ToObject` abstract operation
315
329
  // https://tc39.es/ecma262/#sec-toobject
316
330
  var toObject$3 = function (argument) {
317
- return Object$3(requireObjectCoercible$1(argument));
331
+ return Object$3(requireObjectCoercible(argument));
318
332
  };
319
333
 
320
- var uncurryThis$9 = functionUncurryThis;
334
+ var uncurryThis$8 = functionUncurryThis;
321
335
  var toObject$2 = toObject$3;
322
336
 
323
- var hasOwnProperty = uncurryThis$9({}.hasOwnProperty);
337
+ var hasOwnProperty = uncurryThis$8({}.hasOwnProperty);
324
338
 
325
339
  // `HasOwnProperty` abstract operation
326
340
  // https://tc39.es/ecma262/#sec-hasownproperty
@@ -328,33 +342,33 @@ var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
328
342
  return hasOwnProperty(toObject$2(it), key);
329
343
  };
330
344
 
331
- var uncurryThis$8 = functionUncurryThis;
345
+ var uncurryThis$7 = functionUncurryThis;
332
346
 
333
347
  var id = 0;
334
348
  var postfix = Math.random();
335
- var toString$3 = uncurryThis$8(1.0.toString);
349
+ var toString$2 = uncurryThis$7(1.0.toString);
336
350
 
337
351
  var uid$2 = function (key) {
338
- return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$3(++id + postfix, 36);
352
+ return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$2(++id + postfix, 36);
339
353
  };
340
354
 
341
355
  var global$f = global$r;
342
356
  var shared$2 = shared$3.exports;
343
- var hasOwn$8 = hasOwnProperty_1;
357
+ var hasOwn$9 = hasOwnProperty_1;
344
358
  var uid$1 = uid$2;
345
- var NATIVE_SYMBOL = nativeSymbol;
359
+ var NATIVE_SYMBOL$1 = nativeSymbol;
346
360
  var USE_SYMBOL_AS_UID = useSymbolAsUid;
347
361
 
348
362
  var WellKnownSymbolsStore = shared$2('wks');
349
- var Symbol$2 = global$f.Symbol;
350
- var symbolFor = Symbol$2 && Symbol$2['for'];
351
- var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$2 : Symbol$2 && Symbol$2.withoutSetter || uid$1;
363
+ var Symbol$1 = global$f.Symbol;
364
+ var symbolFor = Symbol$1 && Symbol$1['for'];
365
+ var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
352
366
 
353
367
  var wellKnownSymbol$8 = function (name) {
354
- if (!hasOwn$8(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {
368
+ if (!hasOwn$9(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL$1 || typeof WellKnownSymbolsStore[name] == 'string')) {
355
369
  var description = 'Symbol.' + name;
356
- if (NATIVE_SYMBOL && hasOwn$8(Symbol$2, name)) {
357
- WellKnownSymbolsStore[name] = Symbol$2[name];
370
+ if (NATIVE_SYMBOL$1 && hasOwn$9(Symbol$1, name)) {
371
+ WellKnownSymbolsStore[name] = Symbol$1[name];
358
372
  } else if (USE_SYMBOL_AS_UID && symbolFor) {
359
373
  WellKnownSymbolsStore[name] = symbolFor(description);
360
374
  } else {
@@ -411,43 +425,56 @@ var documentCreateElement$2 = function (it) {
411
425
  return EXISTS$1 ? document$1.createElement(it) : {};
412
426
  };
413
427
 
414
- var DESCRIPTORS$6 = descriptors;
415
- var fails$5 = fails$9;
428
+ var DESCRIPTORS$9 = descriptors;
429
+ var fails$5 = fails$a;
416
430
  var createElement = documentCreateElement$2;
417
431
 
418
- // Thank's IE8 for his funny defineProperty
419
- var ie8DomDefine = !DESCRIPTORS$6 && !fails$5(function () {
420
- // eslint-disable-next-line es/no-object-defineproperty -- requied for testing
432
+ // Thanks to IE8 for its funny defineProperty
433
+ var ie8DomDefine = !DESCRIPTORS$9 && !fails$5(function () {
434
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
421
435
  return Object.defineProperty(createElement('div'), 'a', {
422
436
  get: function () { return 7; }
423
437
  }).a != 7;
424
438
  });
425
439
 
426
- var DESCRIPTORS$5 = descriptors;
440
+ var DESCRIPTORS$8 = descriptors;
427
441
  var call$2 = functionCall;
428
442
  var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
429
443
  var createPropertyDescriptor$2 = createPropertyDescriptor$3;
430
444
  var toIndexedObject$4 = toIndexedObject$5;
431
445
  var toPropertyKey$1 = toPropertyKey$2;
432
- var hasOwn$7 = hasOwnProperty_1;
446
+ var hasOwn$8 = hasOwnProperty_1;
433
447
  var IE8_DOM_DEFINE$1 = ie8DomDefine;
434
448
 
435
449
  // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
436
- var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
450
+ var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
437
451
 
438
452
  // `Object.getOwnPropertyDescriptor` method
439
453
  // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
440
- objectGetOwnPropertyDescriptor.f = DESCRIPTORS$5 ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
454
+ objectGetOwnPropertyDescriptor.f = DESCRIPTORS$8 ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
441
455
  O = toIndexedObject$4(O);
442
456
  P = toPropertyKey$1(P);
443
457
  if (IE8_DOM_DEFINE$1) try {
444
- return $getOwnPropertyDescriptor(O, P);
458
+ return $getOwnPropertyDescriptor$1(O, P);
445
459
  } catch (error) { /* empty */ }
446
- if (hasOwn$7(O, P)) return createPropertyDescriptor$2(!call$2(propertyIsEnumerableModule$1.f, O, P), O[P]);
460
+ if (hasOwn$8(O, P)) return createPropertyDescriptor$2(!call$2(propertyIsEnumerableModule$1.f, O, P), O[P]);
447
461
  };
448
462
 
449
463
  var objectDefineProperty = {};
450
464
 
465
+ var DESCRIPTORS$7 = descriptors;
466
+ var fails$4 = fails$a;
467
+
468
+ // V8 ~ Chrome 36-
469
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3334
470
+ var v8PrototypeDefineBug = DESCRIPTORS$7 && fails$4(function () {
471
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
472
+ return Object.defineProperty(function () { /* empty */ }, 'prototype', {
473
+ value: 42,
474
+ writable: false
475
+ }).prototype != 42;
476
+ });
477
+
451
478
  var global$c = global$r;
452
479
  var isObject$1 = isObject$5;
453
480
 
@@ -461,18 +488,39 @@ var anObject$5 = function (argument) {
461
488
  };
462
489
 
463
490
  var global$b = global$r;
464
- var DESCRIPTORS$4 = descriptors;
491
+ var DESCRIPTORS$6 = descriptors;
465
492
  var IE8_DOM_DEFINE = ie8DomDefine;
493
+ var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
466
494
  var anObject$4 = anObject$5;
467
495
  var toPropertyKey = toPropertyKey$2;
468
496
 
469
497
  var TypeError$3 = global$b.TypeError;
470
498
  // eslint-disable-next-line es/no-object-defineproperty -- safe
471
499
  var $defineProperty = Object.defineProperty;
500
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
501
+ var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
502
+ var ENUMERABLE = 'enumerable';
503
+ var CONFIGURABLE$1 = 'configurable';
504
+ var WRITABLE = 'writable';
472
505
 
473
506
  // `Object.defineProperty` method
474
507
  // https://tc39.es/ecma262/#sec-object.defineproperty
475
- objectDefineProperty.f = DESCRIPTORS$4 ? $defineProperty : function defineProperty(O, P, Attributes) {
508
+ objectDefineProperty.f = DESCRIPTORS$6 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
509
+ anObject$4(O);
510
+ P = toPropertyKey(P);
511
+ anObject$4(Attributes);
512
+ if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
513
+ var current = $getOwnPropertyDescriptor(O, P);
514
+ if (current && current[WRITABLE]) {
515
+ O[P] = Attributes.value;
516
+ Attributes = {
517
+ configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
518
+ enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
519
+ writable: false
520
+ };
521
+ }
522
+ } return $defineProperty(O, P, Attributes);
523
+ } : $defineProperty : function defineProperty(O, P, Attributes) {
476
524
  anObject$4(O);
477
525
  P = toPropertyKey(P);
478
526
  anObject$4(Attributes);
@@ -484,11 +532,11 @@ objectDefineProperty.f = DESCRIPTORS$4 ? $defineProperty : function defineProper
484
532
  return O;
485
533
  };
486
534
 
487
- var DESCRIPTORS$3 = descriptors;
535
+ var DESCRIPTORS$5 = descriptors;
488
536
  var definePropertyModule$3 = objectDefineProperty;
489
537
  var createPropertyDescriptor$1 = createPropertyDescriptor$3;
490
538
 
491
- var createNonEnumerableProperty$5 = DESCRIPTORS$3 ? function (object, key, value) {
539
+ var createNonEnumerableProperty$5 = DESCRIPTORS$5 ? function (object, key, value) {
492
540
  return definePropertyModule$3.f(object, key, createPropertyDescriptor$1(1, value));
493
541
  } : function (object, key, value) {
494
542
  object[key] = value;
@@ -497,14 +545,14 @@ var createNonEnumerableProperty$5 = DESCRIPTORS$3 ? function (object, key, value
497
545
 
498
546
  var redefine$3 = {exports: {}};
499
547
 
500
- var uncurryThis$7 = functionUncurryThis;
501
- var isCallable$8 = isCallable$e;
548
+ var uncurryThis$6 = functionUncurryThis;
549
+ var isCallable$9 = isCallable$f;
502
550
  var store$1 = sharedStore;
503
551
 
504
- var functionToString = uncurryThis$7(Function.toString);
552
+ var functionToString = uncurryThis$6(Function.toString);
505
553
 
506
554
  // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
507
- if (!isCallable$8(store$1.inspectSource)) {
555
+ if (!isCallable$9(store$1.inspectSource)) {
508
556
  store$1.inspectSource = function (it) {
509
557
  return functionToString(it);
510
558
  };
@@ -513,12 +561,12 @@ if (!isCallable$8(store$1.inspectSource)) {
513
561
  var inspectSource$2 = store$1.inspectSource;
514
562
 
515
563
  var global$a = global$r;
516
- var isCallable$7 = isCallable$e;
564
+ var isCallable$8 = isCallable$f;
517
565
  var inspectSource$1 = inspectSource$2;
518
566
 
519
567
  var WeakMap$1 = global$a.WeakMap;
520
568
 
521
- var nativeWeakMap = isCallable$7(WeakMap$1) && /native code/.test(inspectSource$1(WeakMap$1));
569
+ var nativeWeakMap = isCallable$8(WeakMap$1) && /native code/.test(inspectSource$1(WeakMap$1));
522
570
 
523
571
  var shared$1 = shared$3.exports;
524
572
  var uid = uid$2;
@@ -533,10 +581,10 @@ var hiddenKeys$4 = {};
533
581
 
534
582
  var NATIVE_WEAK_MAP = nativeWeakMap;
535
583
  var global$9 = global$r;
536
- var uncurryThis$6 = functionUncurryThis;
584
+ var uncurryThis$5 = functionUncurryThis;
537
585
  var isObject = isObject$5;
538
586
  var createNonEnumerableProperty$4 = createNonEnumerableProperty$5;
539
- var hasOwn$6 = hasOwnProperty_1;
587
+ var hasOwn$7 = hasOwnProperty_1;
540
588
  var shared = sharedStore;
541
589
  var sharedKey$2 = sharedKey$3;
542
590
  var hiddenKeys$3 = hiddenKeys$4;
@@ -561,9 +609,9 @@ var getterFor = function (TYPE) {
561
609
 
562
610
  if (NATIVE_WEAK_MAP || shared.state) {
563
611
  var store = shared.state || (shared.state = new WeakMap());
564
- var wmget = uncurryThis$6(store.get);
565
- var wmhas = uncurryThis$6(store.has);
566
- var wmset = uncurryThis$6(store.set);
612
+ var wmget = uncurryThis$5(store.get);
613
+ var wmhas = uncurryThis$5(store.has);
614
+ var wmset = uncurryThis$5(store.set);
567
615
  set = function (it, metadata) {
568
616
  if (wmhas(store, it)) throw new TypeError$2(OBJECT_ALREADY_INITIALIZED);
569
617
  metadata.facade = it;
@@ -580,16 +628,16 @@ if (NATIVE_WEAK_MAP || shared.state) {
580
628
  var STATE = sharedKey$2('state');
581
629
  hiddenKeys$3[STATE] = true;
582
630
  set = function (it, metadata) {
583
- if (hasOwn$6(it, STATE)) throw new TypeError$2(OBJECT_ALREADY_INITIALIZED);
631
+ if (hasOwn$7(it, STATE)) throw new TypeError$2(OBJECT_ALREADY_INITIALIZED);
584
632
  metadata.facade = it;
585
633
  createNonEnumerableProperty$4(it, STATE, metadata);
586
634
  return metadata;
587
635
  };
588
636
  get = function (it) {
589
- return hasOwn$6(it, STATE) ? it[STATE] : {};
637
+ return hasOwn$7(it, STATE) ? it[STATE] : {};
590
638
  };
591
639
  has = function (it) {
592
- return hasOwn$6(it, STATE);
640
+ return hasOwn$7(it, STATE);
593
641
  };
594
642
  }
595
643
 
@@ -601,17 +649,17 @@ var internalState = {
601
649
  getterFor: getterFor
602
650
  };
603
651
 
604
- var DESCRIPTORS$2 = descriptors;
605
- var hasOwn$5 = hasOwnProperty_1;
652
+ var DESCRIPTORS$4 = descriptors;
653
+ var hasOwn$6 = hasOwnProperty_1;
606
654
 
607
655
  var FunctionPrototype = Function.prototype;
608
656
  // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
609
- var getDescriptor = DESCRIPTORS$2 && Object.getOwnPropertyDescriptor;
657
+ var getDescriptor = DESCRIPTORS$4 && Object.getOwnPropertyDescriptor;
610
658
 
611
- var EXISTS = hasOwn$5(FunctionPrototype, 'name');
659
+ var EXISTS = hasOwn$6(FunctionPrototype, 'name');
612
660
  // additional protection from minified / mangled / dropped function names
613
661
  var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
614
- var CONFIGURABLE = EXISTS && (!DESCRIPTORS$2 || (DESCRIPTORS$2 && getDescriptor(FunctionPrototype, 'name').configurable));
662
+ var CONFIGURABLE = EXISTS && (!DESCRIPTORS$4 || (DESCRIPTORS$4 && getDescriptor(FunctionPrototype, 'name').configurable));
615
663
 
616
664
  var functionName = {
617
665
  EXISTS: EXISTS,
@@ -620,8 +668,8 @@ var functionName = {
620
668
  };
621
669
 
622
670
  var global$8 = global$r;
623
- var isCallable$6 = isCallable$e;
624
- var hasOwn$4 = hasOwnProperty_1;
671
+ var isCallable$7 = isCallable$f;
672
+ var hasOwn$5 = hasOwnProperty_1;
625
673
  var createNonEnumerableProperty$3 = createNonEnumerableProperty$5;
626
674
  var setGlobal$1 = setGlobal$3;
627
675
  var inspectSource = inspectSource$2;
@@ -638,11 +686,11 @@ var TEMPLATE = String(String).split('String');
638
686
  var noTargetGet = options ? !!options.noTargetGet : false;
639
687
  var name = options && options.name !== undefined ? options.name : key;
640
688
  var state;
641
- if (isCallable$6(value)) {
689
+ if (isCallable$7(value)) {
642
690
  if (String(name).slice(0, 7) === 'Symbol(') {
643
691
  name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
644
692
  }
645
- if (!hasOwn$4(value, 'name') || (CONFIGURABLE_FUNCTION_NAME$1 && value.name !== name)) {
693
+ if (!hasOwn$5(value, 'name') || (CONFIGURABLE_FUNCTION_NAME$1 && value.name !== name)) {
646
694
  createNonEnumerableProperty$3(value, 'name', name);
647
695
  }
648
696
  state = enforceInternalState(value);
@@ -663,7 +711,7 @@ var TEMPLATE = String(String).split('String');
663
711
  else createNonEnumerableProperty$3(O, key, value);
664
712
  // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
665
713
  })(Function.prototype, 'toString', function toString() {
666
- return isCallable$6(this) && getInternalState$1(this).source || inspectSource(this);
714
+ return isCallable$7(this) && getInternalState$1(this).source || inspectSource(this);
667
715
  });
668
716
 
669
717
  var objectGetOwnPropertyNames = {};
@@ -715,7 +763,7 @@ var toAbsoluteIndex = toAbsoluteIndex$1;
715
763
  var lengthOfArrayLike = lengthOfArrayLike$1;
716
764
 
717
765
  // `Array.prototype.{ indexOf, includes }` methods implementation
718
- var createMethod$1 = function (IS_INCLUDES) {
766
+ var createMethod = function (IS_INCLUDES) {
719
767
  return function ($this, el, fromIndex) {
720
768
  var O = toIndexedObject$3($this);
721
769
  var length = lengthOfArrayLike(O);
@@ -737,28 +785,28 @@ var createMethod$1 = function (IS_INCLUDES) {
737
785
  var arrayIncludes = {
738
786
  // `Array.prototype.includes` method
739
787
  // https://tc39.es/ecma262/#sec-array.prototype.includes
740
- includes: createMethod$1(true),
788
+ includes: createMethod(true),
741
789
  // `Array.prototype.indexOf` method
742
790
  // https://tc39.es/ecma262/#sec-array.prototype.indexof
743
- indexOf: createMethod$1(false)
791
+ indexOf: createMethod(false)
744
792
  };
745
793
 
746
- var uncurryThis$5 = functionUncurryThis;
747
- var hasOwn$3 = hasOwnProperty_1;
794
+ var uncurryThis$4 = functionUncurryThis;
795
+ var hasOwn$4 = hasOwnProperty_1;
748
796
  var toIndexedObject$2 = toIndexedObject$5;
749
797
  var indexOf = arrayIncludes.indexOf;
750
798
  var hiddenKeys$2 = hiddenKeys$4;
751
799
 
752
- var push = uncurryThis$5([].push);
800
+ var push = uncurryThis$4([].push);
753
801
 
754
802
  var objectKeysInternal = function (object, names) {
755
803
  var O = toIndexedObject$2(object);
756
804
  var i = 0;
757
805
  var result = [];
758
806
  var key;
759
- for (key in O) !hasOwn$3(hiddenKeys$2, key) && hasOwn$3(O, key) && push(result, key);
807
+ for (key in O) !hasOwn$4(hiddenKeys$2, key) && hasOwn$4(O, key) && push(result, key);
760
808
  // Don't enum bug & hidden keys
761
- while (names.length > i) if (hasOwn$3(O, key = names[i++])) {
809
+ while (names.length > i) if (hasOwn$4(O, key = names[i++])) {
762
810
  ~indexOf(result, key) || push(result, key);
763
811
  }
764
812
  return result;
@@ -793,12 +841,12 @@ var objectGetOwnPropertySymbols = {};
793
841
  objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
794
842
 
795
843
  var getBuiltIn$1 = getBuiltIn$4;
796
- var uncurryThis$4 = functionUncurryThis;
844
+ var uncurryThis$3 = functionUncurryThis;
797
845
  var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
798
846
  var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
799
847
  var anObject$3 = anObject$5;
800
848
 
801
- var concat$1 = uncurryThis$4([].concat);
849
+ var concat$1 = uncurryThis$3([].concat);
802
850
 
803
851
  // all object keys, includes non-enumerable and symbols
804
852
  var ownKeys$1 = getBuiltIn$1('Reflect', 'ownKeys') || function ownKeys(it) {
@@ -807,23 +855,25 @@ var ownKeys$1 = getBuiltIn$1('Reflect', 'ownKeys') || function ownKeys(it) {
807
855
  return getOwnPropertySymbols ? concat$1(keys, getOwnPropertySymbols(it)) : keys;
808
856
  };
809
857
 
810
- var hasOwn$2 = hasOwnProperty_1;
858
+ var hasOwn$3 = hasOwnProperty_1;
811
859
  var ownKeys = ownKeys$1;
812
860
  var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
813
861
  var definePropertyModule$2 = objectDefineProperty;
814
862
 
815
- var copyConstructorProperties$1 = function (target, source) {
863
+ var copyConstructorProperties$2 = function (target, source, exceptions) {
816
864
  var keys = ownKeys(source);
817
865
  var defineProperty = definePropertyModule$2.f;
818
866
  var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
819
867
  for (var i = 0; i < keys.length; i++) {
820
868
  var key = keys[i];
821
- if (!hasOwn$2(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
869
+ if (!hasOwn$3(target, key) && !(exceptions && hasOwn$3(exceptions, key))) {
870
+ defineProperty(target, key, getOwnPropertyDescriptor(source, key));
871
+ }
822
872
  }
823
873
  };
824
874
 
825
- var fails$4 = fails$9;
826
- var isCallable$5 = isCallable$e;
875
+ var fails$3 = fails$a;
876
+ var isCallable$6 = isCallable$f;
827
877
 
828
878
  var replacement = /#|\.prototype\./;
829
879
 
@@ -831,7 +881,7 @@ var isForced$1 = function (feature, detection) {
831
881
  var value = data[normalize(feature)];
832
882
  return value == POLYFILL ? true
833
883
  : value == NATIVE ? false
834
- : isCallable$5(detection) ? fails$4(detection)
884
+ : isCallable$6(detection) ? fails$3(detection)
835
885
  : !!detection;
836
886
  };
837
887
 
@@ -850,7 +900,7 @@ var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
850
900
  var createNonEnumerableProperty$2 = createNonEnumerableProperty$5;
851
901
  var redefine$2 = redefine$3.exports;
852
902
  var setGlobal = setGlobal$3;
853
- var copyConstructorProperties = copyConstructorProperties$1;
903
+ var copyConstructorProperties$1 = copyConstructorProperties$2;
854
904
  var isForced = isForced_1;
855
905
 
856
906
  /*
@@ -890,7 +940,7 @@ var _export = function (options, source) {
890
940
  // contained in target
891
941
  if (!FORCED && targetProperty !== undefined) {
892
942
  if (typeof sourceProperty == typeof targetProperty) continue;
893
- copyConstructorProperties(sourceProperty, targetProperty);
943
+ copyConstructorProperties$1(sourceProperty, targetProperty);
894
944
  }
895
945
  // add a flag to not completely full polyfills
896
946
  if (options.sham || (targetProperty && targetProperty.sham)) {
@@ -911,10 +961,10 @@ var objectKeys$2 = Object.keys || function keys(O) {
911
961
  return internalObjectKeys(O, enumBugKeys$1);
912
962
  };
913
963
 
914
- var DESCRIPTORS$1 = descriptors;
915
- var uncurryThis$3 = functionUncurryThis;
964
+ var DESCRIPTORS$3 = descriptors;
965
+ var uncurryThis$2 = functionUncurryThis;
916
966
  var call$1 = functionCall;
917
- var fails$3 = fails$9;
967
+ var fails$2 = fails$a;
918
968
  var objectKeys$1 = objectKeys$2;
919
969
  var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
920
970
  var propertyIsEnumerableModule = objectPropertyIsEnumerable;
@@ -924,17 +974,17 @@ var IndexedObject = indexedObject;
924
974
  // eslint-disable-next-line es/no-object-assign -- safe
925
975
  var $assign = Object.assign;
926
976
  // eslint-disable-next-line es/no-object-defineproperty -- required for testing
927
- var defineProperty$1 = Object.defineProperty;
928
- var concat = uncurryThis$3([].concat);
977
+ var defineProperty$3 = Object.defineProperty;
978
+ var concat = uncurryThis$2([].concat);
929
979
 
930
980
  // `Object.assign` method
931
981
  // https://tc39.es/ecma262/#sec-object.assign
932
- var objectAssign = !$assign || fails$3(function () {
982
+ var objectAssign = !$assign || fails$2(function () {
933
983
  // should have correct order of operations (Edge bug)
934
- if (DESCRIPTORS$1 && $assign({ b: 1 }, $assign(defineProperty$1({}, 'a', {
984
+ if (DESCRIPTORS$3 && $assign({ b: 1 }, $assign(defineProperty$3({}, 'a', {
935
985
  enumerable: true,
936
986
  get: function () {
937
- defineProperty$1(this, 'b', {
987
+ defineProperty$3(this, 'b', {
938
988
  value: 3,
939
989
  enumerable: false
940
990
  });
@@ -963,7 +1013,7 @@ var objectAssign = !$assign || fails$3(function () {
963
1013
  var key;
964
1014
  while (length > j) {
965
1015
  key = keys[j++];
966
- if (!DESCRIPTORS$1 || call$1(propertyIsEnumerable, S, key)) T[key] = S[key];
1016
+ if (!DESCRIPTORS$3 || call$1(propertyIsEnumerable, S, key)) T[key] = S[key];
967
1017
  }
968
1018
  } return T;
969
1019
  } : $assign;
@@ -1136,7 +1186,10 @@ const Modal = _a => {
1136
1186
  return isOpen ? modalContent() : null;
1137
1187
  };
1138
1188
 
1139
- var DESCRIPTORS = descriptors;
1189
+ var objectDefineProperties = {};
1190
+
1191
+ var DESCRIPTORS$2 = descriptors;
1192
+ var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
1140
1193
  var definePropertyModule$1 = objectDefineProperty;
1141
1194
  var anObject$2 = anObject$5;
1142
1195
  var toIndexedObject$1 = toIndexedObject$5;
@@ -1145,7 +1198,7 @@ var objectKeys = objectKeys$2;
1145
1198
  // `Object.defineProperties` method
1146
1199
  // https://tc39.es/ecma262/#sec-object.defineproperties
1147
1200
  // eslint-disable-next-line es/no-object-defineproperties -- safe
1148
- var objectDefineProperties = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) {
1201
+ objectDefineProperties.f = DESCRIPTORS$2 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
1149
1202
  anObject$2(O);
1150
1203
  var props = toIndexedObject$1(Properties);
1151
1204
  var keys = objectKeys(Properties);
@@ -1163,7 +1216,7 @@ var html$1 = getBuiltIn('document', 'documentElement');
1163
1216
  /* global ActiveXObject -- old IE, WSH */
1164
1217
 
1165
1218
  var anObject$1 = anObject$5;
1166
- var defineProperties = objectDefineProperties;
1219
+ var definePropertiesModule = objectDefineProperties;
1167
1220
  var enumBugKeys = enumBugKeys$3;
1168
1221
  var hiddenKeys = hiddenKeys$4;
1169
1222
  var html = html$1;
@@ -1241,7 +1294,7 @@ var objectCreate = Object.create || function create(O, Properties) {
1241
1294
  // add "__proto__" for Object.getPrototypeOf polyfill
1242
1295
  result[IE_PROTO$1] = O;
1243
1296
  } else result = NullProtoObject();
1244
- return Properties === undefined ? result : defineProperties(result, Properties);
1297
+ return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
1245
1298
  };
1246
1299
 
1247
1300
  var wellKnownSymbol$6 = wellKnownSymbol$8;
@@ -1267,9 +1320,9 @@ var addToUnscopables$1 = function (key) {
1267
1320
 
1268
1321
  var iterators = {};
1269
1322
 
1270
- var fails$2 = fails$9;
1323
+ var fails$1 = fails$a;
1271
1324
 
1272
- var correctPrototypeGetter = !fails$2(function () {
1325
+ var correctPrototypeGetter = !fails$1(function () {
1273
1326
  function F() { /* empty */ }
1274
1327
  F.prototype.constructor = null;
1275
1328
  // eslint-disable-next-line es/no-object-getprototypeof -- required for testing
@@ -1277,8 +1330,8 @@ var correctPrototypeGetter = !fails$2(function () {
1277
1330
  });
1278
1331
 
1279
1332
  var global$6 = global$r;
1280
- var hasOwn$1 = hasOwnProperty_1;
1281
- var isCallable$4 = isCallable$e;
1333
+ var hasOwn$2 = hasOwnProperty_1;
1334
+ var isCallable$5 = isCallable$f;
1282
1335
  var toObject = toObject$3;
1283
1336
  var sharedKey = sharedKey$3;
1284
1337
  var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
@@ -1291,20 +1344,20 @@ var ObjectPrototype = Object$2.prototype;
1291
1344
  // https://tc39.es/ecma262/#sec-object.getprototypeof
1292
1345
  var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? Object$2.getPrototypeOf : function (O) {
1293
1346
  var object = toObject(O);
1294
- if (hasOwn$1(object, IE_PROTO)) return object[IE_PROTO];
1347
+ if (hasOwn$2(object, IE_PROTO)) return object[IE_PROTO];
1295
1348
  var constructor = object.constructor;
1296
- if (isCallable$4(constructor) && object instanceof constructor) {
1349
+ if (isCallable$5(constructor) && object instanceof constructor) {
1297
1350
  return constructor.prototype;
1298
1351
  } return object instanceof Object$2 ? ObjectPrototype : null;
1299
1352
  };
1300
1353
 
1301
- var fails$1 = fails$9;
1302
- var isCallable$3 = isCallable$e;
1354
+ var fails = fails$a;
1355
+ var isCallable$4 = isCallable$f;
1303
1356
  var getPrototypeOf$1 = objectGetPrototypeOf;
1304
1357
  var redefine$1 = redefine$3.exports;
1305
1358
  var wellKnownSymbol$5 = wellKnownSymbol$8;
1306
1359
 
1307
- var ITERATOR$3 = wellKnownSymbol$5('iterator');
1360
+ var ITERATOR$2 = wellKnownSymbol$5('iterator');
1308
1361
  var BUGGY_SAFARI_ITERATORS$1 = false;
1309
1362
 
1310
1363
  // `%IteratorPrototype%` object
@@ -1322,18 +1375,18 @@ if ([].keys) {
1322
1375
  }
1323
1376
  }
1324
1377
 
1325
- var NEW_ITERATOR_PROTOTYPE = IteratorPrototype$2 == undefined || fails$1(function () {
1378
+ var NEW_ITERATOR_PROTOTYPE = IteratorPrototype$2 == undefined || fails(function () {
1326
1379
  var test = {};
1327
1380
  // FF44- legacy iterators case
1328
- return IteratorPrototype$2[ITERATOR$3].call(test) !== test;
1381
+ return IteratorPrototype$2[ITERATOR$2].call(test) !== test;
1329
1382
  });
1330
1383
 
1331
1384
  if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
1332
1385
 
1333
1386
  // `%IteratorPrototype%[@@iterator]()` method
1334
1387
  // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
1335
- if (!isCallable$3(IteratorPrototype$2[ITERATOR$3])) {
1336
- redefine$1(IteratorPrototype$2, ITERATOR$3, function () {
1388
+ if (!isCallable$4(IteratorPrototype$2[ITERATOR$2])) {
1389
+ redefine$1(IteratorPrototype$2, ITERATOR$2, function () {
1337
1390
  return this;
1338
1391
  });
1339
1392
  }
@@ -1343,15 +1396,16 @@ var iteratorsCore = {
1343
1396
  BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
1344
1397
  };
1345
1398
 
1346
- var defineProperty = objectDefineProperty.f;
1347
- var hasOwn = hasOwnProperty_1;
1399
+ var defineProperty$2 = objectDefineProperty.f;
1400
+ var hasOwn$1 = hasOwnProperty_1;
1348
1401
  var wellKnownSymbol$4 = wellKnownSymbol$8;
1349
1402
 
1350
1403
  var TO_STRING_TAG$3 = wellKnownSymbol$4('toStringTag');
1351
1404
 
1352
- var setToStringTag$2 = function (it, TAG, STATIC) {
1353
- if (it && !hasOwn(it = STATIC ? it : it.prototype, TO_STRING_TAG$3)) {
1354
- defineProperty(it, TO_STRING_TAG$3, { configurable: true, value: TAG });
1405
+ var setToStringTag$2 = function (target, TAG, STATIC) {
1406
+ if (target && !STATIC) target = target.prototype;
1407
+ if (target && !hasOwn$1(target, TO_STRING_TAG$3)) {
1408
+ defineProperty$2(target, TO_STRING_TAG$3, { configurable: true, value: TAG });
1355
1409
  }
1356
1410
  };
1357
1411
 
@@ -1372,19 +1426,19 @@ var createIteratorConstructor$1 = function (IteratorConstructor, NAME, next, ENU
1372
1426
  };
1373
1427
 
1374
1428
  var global$5 = global$r;
1375
- var isCallable$2 = isCallable$e;
1429
+ var isCallable$3 = isCallable$f;
1376
1430
 
1377
1431
  var String$2 = global$5.String;
1378
1432
  var TypeError$1 = global$5.TypeError;
1379
1433
 
1380
1434
  var aPossiblePrototype$1 = function (argument) {
1381
- if (typeof argument == 'object' || isCallable$2(argument)) return argument;
1435
+ if (typeof argument == 'object' || isCallable$3(argument)) return argument;
1382
1436
  throw TypeError$1("Can't set " + String$2(argument) + ' as a prototype');
1383
1437
  };
1384
1438
 
1385
1439
  /* eslint-disable no-proto -- safe */
1386
1440
 
1387
- var uncurryThis$2 = functionUncurryThis;
1441
+ var uncurryThis$1 = functionUncurryThis;
1388
1442
  var anObject = anObject$5;
1389
1443
  var aPossiblePrototype = aPossiblePrototype$1;
1390
1444
 
@@ -1398,7 +1452,7 @@ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? functio
1398
1452
  var setter;
1399
1453
  try {
1400
1454
  // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1401
- setter = uncurryThis$2(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
1455
+ setter = uncurryThis$1(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
1402
1456
  setter(test, []);
1403
1457
  CORRECT_SETTER = test instanceof Array;
1404
1458
  } catch (error) { /* empty */ }
@@ -1414,7 +1468,7 @@ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? functio
1414
1468
  var $$1 = _export;
1415
1469
  var call = functionCall;
1416
1470
  var FunctionName = functionName;
1417
- var isCallable$1 = isCallable$e;
1471
+ var isCallable$2 = isCallable$f;
1418
1472
  var createIteratorConstructor = createIteratorConstructor$1;
1419
1473
  var getPrototypeOf = objectGetPrototypeOf;
1420
1474
  var setPrototypeOf = objectSetPrototypeOf;
@@ -1429,7 +1483,7 @@ var PROPER_FUNCTION_NAME = FunctionName.PROPER;
1429
1483
  var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
1430
1484
  var IteratorPrototype = IteratorsCore.IteratorPrototype;
1431
1485
  var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
1432
- var ITERATOR$2 = wellKnownSymbol$3('iterator');
1486
+ var ITERATOR$1 = wellKnownSymbol$3('iterator');
1433
1487
  var KEYS = 'keys';
1434
1488
  var VALUES = 'values';
1435
1489
  var ENTRIES = 'entries';
@@ -1452,7 +1506,7 @@ var defineIterator$1 = function (Iterable, NAME, IteratorConstructor, next, DEFA
1452
1506
  var TO_STRING_TAG = NAME + ' Iterator';
1453
1507
  var INCORRECT_VALUES_NAME = false;
1454
1508
  var IterablePrototype = Iterable.prototype;
1455
- var nativeIterator = IterablePrototype[ITERATOR$2]
1509
+ var nativeIterator = IterablePrototype[ITERATOR$1]
1456
1510
  || IterablePrototype['@@iterator']
1457
1511
  || DEFAULT && IterablePrototype[DEFAULT];
1458
1512
  var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
@@ -1466,8 +1520,8 @@ var defineIterator$1 = function (Iterable, NAME, IteratorConstructor, next, DEFA
1466
1520
  if (getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
1467
1521
  if (setPrototypeOf) {
1468
1522
  setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
1469
- } else if (!isCallable$1(CurrentIteratorPrototype[ITERATOR$2])) {
1470
- redefine(CurrentIteratorPrototype, ITERATOR$2, returnThis);
1523
+ } else if (!isCallable$2(CurrentIteratorPrototype[ITERATOR$1])) {
1524
+ redefine(CurrentIteratorPrototype, ITERATOR$1, returnThis);
1471
1525
  }
1472
1526
  }
1473
1527
  // Set @@toStringTag to native iterators
@@ -1500,8 +1554,8 @@ var defineIterator$1 = function (Iterable, NAME, IteratorConstructor, next, DEFA
1500
1554
  }
1501
1555
 
1502
1556
  // define iterator
1503
- if (IterablePrototype[ITERATOR$2] !== defaultIterator) {
1504
- redefine(IterablePrototype, ITERATOR$2, defaultIterator, { name: DEFAULT });
1557
+ if (IterablePrototype[ITERATOR$1] !== defaultIterator) {
1558
+ redefine(IterablePrototype, ITERATOR$1, defaultIterator, { name: DEFAULT });
1505
1559
  }
1506
1560
  Iterators$1[NAME] = defaultIterator;
1507
1561
 
@@ -1512,7 +1566,9 @@ var toIndexedObject = toIndexedObject$5;
1512
1566
  var addToUnscopables = addToUnscopables$1;
1513
1567
  var Iterators = iterators;
1514
1568
  var InternalStateModule = internalState;
1569
+ var defineProperty$1 = objectDefineProperty.f;
1515
1570
  var defineIterator = defineIterator$1;
1571
+ var DESCRIPTORS$1 = descriptors;
1516
1572
 
1517
1573
  var ARRAY_ITERATOR = 'Array Iterator';
1518
1574
  var setInternalState = InternalStateModule.set;
@@ -1554,13 +1610,18 @@ var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind)
1554
1610
  // argumentsList[@@iterator] is %ArrayProto_values%
1555
1611
  // https://tc39.es/ecma262/#sec-createunmappedargumentsobject
1556
1612
  // https://tc39.es/ecma262/#sec-createmappedargumentsobject
1557
- Iterators.Arguments = Iterators.Array;
1613
+ var values = Iterators.Arguments = Iterators.Array;
1558
1614
 
1559
1615
  // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1560
1616
  addToUnscopables('keys');
1561
1617
  addToUnscopables('values');
1562
1618
  addToUnscopables('entries');
1563
1619
 
1620
+ // V8 ~ Chrome 45- bug
1621
+ if (DESCRIPTORS$1 && values.name !== 'values') try {
1622
+ defineProperty$1(values, 'name', { value: 'values' });
1623
+ } catch (error) { /* empty */ }
1624
+
1564
1625
  // iterable DOM collections
1565
1626
  // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
1566
1627
  var domIterables = {
@@ -1612,17 +1673,17 @@ var ArrayIteratorMethods = es_array_iterator;
1612
1673
  var createNonEnumerableProperty = createNonEnumerableProperty$5;
1613
1674
  var wellKnownSymbol$2 = wellKnownSymbol$8;
1614
1675
 
1615
- var ITERATOR$1 = wellKnownSymbol$2('iterator');
1676
+ var ITERATOR = wellKnownSymbol$2('iterator');
1616
1677
  var TO_STRING_TAG$2 = wellKnownSymbol$2('toStringTag');
1617
1678
  var ArrayValues = ArrayIteratorMethods.values;
1618
1679
 
1619
1680
  var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
1620
1681
  if (CollectionPrototype) {
1621
1682
  // some Chrome versions have non-configurable methods on DOMTokenList
1622
- if (CollectionPrototype[ITERATOR$1] !== ArrayValues) try {
1623
- createNonEnumerableProperty(CollectionPrototype, ITERATOR$1, ArrayValues);
1683
+ if (CollectionPrototype[ITERATOR] !== ArrayValues) try {
1684
+ createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues);
1624
1685
  } catch (error) {
1625
- CollectionPrototype[ITERATOR$1] = ArrayValues;
1686
+ CollectionPrototype[ITERATOR] = ArrayValues;
1626
1687
  }
1627
1688
  if (!CollectionPrototype[TO_STRING_TAG$2]) {
1628
1689
  createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG$2, COLLECTION_NAME);
@@ -1644,46 +1705,45 @@ for (var COLLECTION_NAME in DOMIterables) {
1644
1705
 
1645
1706
  handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
1646
1707
 
1647
- const Flexbox = ({
1648
- alignContent,
1649
- alignItems,
1650
- alignSelf,
1651
- children,
1652
- justifyContent
1653
- }) => {
1708
+ const Flexbox = _a => {
1709
+ var {
1710
+ alignContent,
1711
+ alignItems,
1712
+ alignSelf,
1713
+ children,
1714
+ justifyContent,
1715
+ flexDirection,
1716
+ flexWrap,
1717
+ className
1718
+ } = _a,
1719
+ props = __rest(_a, ["alignContent", "alignItems", "alignSelf", "children", "justifyContent", "flexDirection", "flexWrap", "className"]);
1720
+
1654
1721
  const [classes, setClasses] = useState(['d-flex']);
1655
- const [className, setClassName] = useState('d-flex'); // update className when classes change
1722
+ const [flexClassName, setFlexClassName] = useState('d-flex'); // // update className when classes change
1656
1723
 
1657
- useEffect(() => {
1724
+ useLayoutEffect(() => {
1658
1725
  const newClassName = classes.join(' ');
1659
- if (newClassName !== className) setClassName(newClassName);
1660
- }, [classes, className]); // update classes when props change
1726
+ if (newClassName !== flexClassName) setFlexClassName(newClassName);
1727
+ }, [classes, flexClassName]); // // update classes when props change
1661
1728
 
1662
- useEffect(() => {
1729
+ useLayoutEffect(() => {
1663
1730
  const newClasses = ['d-flex'];
1664
- if (alignItems) newClasses.push(`align-items-${alignItems}`);
1665
- if (alignContent) newClasses.push(`align-content-${alignContent}`);
1666
- if (alignSelf) newClasses.push(`align-content-${alignSelf}`);
1667
- if (justifyContent) newClasses.push(`justify-content-${justifyContent}`);
1731
+ alignItems && newClasses.push(`align-items-${alignItems}`);
1732
+ alignContent && newClasses.push(`align-content-${alignContent}`);
1733
+ alignSelf && newClasses.push(`align-self-${alignSelf}`);
1734
+ justifyContent && newClasses.push(`justify-content-${justifyContent}`);
1735
+ flexDirection && newClasses.push(`flex-${flexDirection}`);
1736
+ flexWrap && newClasses.push(`flex-${flexWrap}`);
1737
+ className && newClasses.push(className);
1668
1738
  setClasses(newClasses);
1669
- }, [alignContent, alignItems, alignSelf, justifyContent]);
1739
+ }, [alignContent, alignItems, alignSelf, justifyContent, flexDirection, flexWrap, className]);
1670
1740
  return jsx("div", Object.assign({
1671
- className: className
1672
- }, {
1741
+ className: flexClassName
1742
+ }, props, {
1673
1743
  children: children
1674
1744
  }), void 0);
1675
1745
  };
1676
1746
 
1677
- function Group({
1678
- children
1679
- }) {
1680
- return jsx("div", Object.assign({
1681
- className: "group"
1682
- }, {
1683
- children: children
1684
- }), void 0);
1685
- }
1686
-
1687
1747
  function Card({
1688
1748
  children,
1689
1749
  header,
@@ -1772,146 +1832,216 @@ const ButtonGroup = ({
1772
1832
  }, void 0);
1773
1833
  };
1774
1834
 
1775
- function Form({
1776
- children,
1777
- direction = 'vertical',
1778
- formSize = 'md'
1779
- }) {
1780
- return jsx("form", Object.assign({
1781
- className: [direction, `size-${formSize}`].join(' ')
1782
- }, {
1783
- children: children
1784
- }), void 0);
1785
- }
1786
-
1787
- var wellKnownSymbol$1 = wellKnownSymbol$8;
1788
-
1789
- var TO_STRING_TAG$1 = wellKnownSymbol$1('toStringTag');
1790
- var test = {};
1791
-
1792
- test[TO_STRING_TAG$1] = 'z';
1793
-
1794
- var toStringTagSupport = String(test) === '[object z]';
1835
+ const validateInputValue = (target, rules, setError) => {
1836
+ const errorMessage = validateInputValueErrors(rules, target);
1837
+ errorMessage ? setErrorInsert(setError, target.name) : setErrorRemove(setError, target.name);
1838
+ return errorMessage;
1839
+ };
1795
1840
 
1796
- var global$3 = global$r;
1797
- var TO_STRING_TAG_SUPPORT = toStringTagSupport;
1798
- var isCallable = isCallable$e;
1799
- var classofRaw = classofRaw$1;
1800
- var wellKnownSymbol = wellKnownSymbol$8;
1841
+ const validateInputValueErrors = (rules, target) => {
1842
+ const {
1843
+ value
1844
+ } = target;
1801
1845
 
1802
- var TO_STRING_TAG = wellKnownSymbol('toStringTag');
1803
- var Object$1 = global$3.Object;
1846
+ if ((rules === null || rules === void 0 ? void 0 : rules.custom) instanceof Function) {
1847
+ return rules === null || rules === void 0 ? void 0 : rules.custom();
1848
+ }
1804
1849
 
1805
- // ES3 wrong here
1806
- var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
1850
+ return validateTextInputValues(value, rules);
1851
+ };
1807
1852
 
1808
- // fallback for IE11 Script Access Denied error
1809
- var tryGet = function (it, key) {
1810
- try {
1811
- return it[key];
1812
- } catch (error) { /* empty */ }
1853
+ const setErrorInsert = (setError, name) => {
1854
+ setError(errors => {
1855
+ return Object.assign(Object.assign({}, errors), {
1856
+ [name]: true
1857
+ });
1858
+ });
1813
1859
  };
1814
1860
 
1815
- // getting tag from ES6+ `Object.prototype.toString`
1816
- var classof$1 = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
1817
- var O, tag, result;
1818
- return it === undefined ? 'Undefined' : it === null ? 'Null'
1819
- // @@toStringTag case
1820
- : typeof (tag = tryGet(O = Object$1(it), TO_STRING_TAG)) == 'string' ? tag
1821
- // builtinTag case
1822
- : CORRECT_ARGUMENTS ? classofRaw(O)
1823
- // ES3 arguments fallback
1824
- : (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;
1861
+ const setErrorRemove = (setError, name) => {
1862
+ setError(errors => {
1863
+ const newError = Object.assign({}, errors);
1864
+ delete newError[name];
1865
+ return newError;
1866
+ });
1825
1867
  };
1826
1868
 
1827
- var global$2 = global$r;
1828
- var classof = classof$1;
1869
+ const validateTextInputValues = (value, rules) => {
1870
+ switch (rules === null || rules === void 0 ? void 0 : rules.type) {
1871
+ case 'Required':
1872
+ {
1873
+ return value === '' || value === undefined || value === null ? 'error' : null;
1874
+ }
1829
1875
 
1830
- var String$1 = global$2.String;
1876
+ default:
1877
+ {
1878
+ return;
1879
+ }
1880
+ }
1881
+ };
1831
1882
 
1832
- var toString$2 = function (argument) {
1833
- if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
1834
- return String$1(argument);
1883
+ const FormContext = /*#__PURE__*/React.createContext({});
1884
+ const useFormContext = () => {
1885
+ return React.useContext(FormContext);
1835
1886
  };
1887
+ const FormProvider = _a => {
1888
+ var {
1889
+ children,
1890
+ direction = 'vertical',
1891
+ formSize = 'md',
1892
+ onSubmit,
1893
+ onFormSubmit
1894
+ } = _a,
1895
+ props = __rest(_a, ["children", "direction", "formSize", "onSubmit", "onFormSubmit"]);
1896
+
1897
+ const [values, setValues] = React.useState();
1898
+ const [errors, setErrors] = React.useState();
1899
+ const [fields, setFields] = React.useState({});
1900
+
1901
+ const formSubmit = event => {
1902
+ let hasError = false;
1903
+ event.preventDefault();
1904
+ Object.keys(fields).forEach(key => {
1905
+ const errorMessage = validateInputValue({
1906
+ name: key,
1907
+ value: values === null || values === void 0 ? void 0 : values[key]
1908
+ }, fields[key], setErrors);
1909
+ hasError = hasError || !!errorMessage;
1910
+ });
1836
1911
 
1837
- // a string of all valid unicode whitespaces
1838
- var whitespaces$2 = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
1839
- '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
1912
+ if (!hasError) {
1913
+ onFormSubmit && onFormSubmit(values);
1914
+ }
1915
+ };
1840
1916
 
1841
- var uncurryThis$1 = functionUncurryThis;
1842
- var requireObjectCoercible = requireObjectCoercible$3;
1843
- var toString$1 = toString$2;
1844
- var whitespaces$1 = whitespaces$2;
1845
-
1846
- var replace = uncurryThis$1(''.replace);
1847
- var whitespace = '[' + whitespaces$1 + ']';
1848
- var ltrim = RegExp('^' + whitespace + whitespace + '*');
1849
- var rtrim = RegExp(whitespace + whitespace + '*$');
1850
-
1851
- // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
1852
- var createMethod = function (TYPE) {
1853
- return function ($this) {
1854
- var string = toString$1(requireObjectCoercible($this));
1855
- if (TYPE & 1) string = replace(string, ltrim, '');
1856
- if (TYPE & 2) string = replace(string, rtrim, '');
1857
- return string;
1917
+ const resetForm = () => {
1918
+ setValues({});
1919
+ setErrors({});
1858
1920
  };
1921
+
1922
+ return jsx(FormContext.Provider, Object.assign({
1923
+ value: {
1924
+ setValues,
1925
+ setErrors,
1926
+ setFields,
1927
+ errors,
1928
+ values
1929
+ }
1930
+ }, {
1931
+ children: jsx("form", Object.assign({
1932
+ className: [direction, `size-${formSize}`].join(' '),
1933
+ onSubmit: formSubmit
1934
+ }, props, {
1935
+ onReset: resetForm
1936
+ }, {
1937
+ children: children
1938
+ }), void 0)
1939
+ }), void 0);
1859
1940
  };
1860
1941
 
1861
- var stringTrim = {
1862
- // `String.prototype.{ trimLeft, trimStart }` methods
1863
- // https://tc39.es/ecma262/#sec-string.prototype.trimstart
1864
- start: createMethod(1),
1865
- // `String.prototype.{ trimRight, trimEnd }` methods
1866
- // https://tc39.es/ecma262/#sec-string.prototype.trimend
1867
- end: createMethod(2),
1868
- // `String.prototype.trim` method
1869
- // https://tc39.es/ecma262/#sec-string.prototype.trim
1870
- trim: createMethod(3)
1942
+ const Form = props => {
1943
+ return jsx(FormProvider, Object.assign({}, props), void 0);
1871
1944
  };
1872
1945
 
1873
- var global$1 = global$r;
1874
- var fails = fails$9;
1875
- var uncurryThis = functionUncurryThis;
1876
- var toString = toString$2;
1877
- var trim = stringTrim.trim;
1878
- var whitespaces = whitespaces$2;
1879
-
1880
- var $parseInt$1 = global$1.parseInt;
1881
- var Symbol$1 = global$1.Symbol;
1882
- var ITERATOR = Symbol$1 && Symbol$1.iterator;
1883
- var hex = /^[+-]?0x/i;
1884
- var exec = uncurryThis(hex.exec);
1885
- var FORCED = $parseInt$1(whitespaces + '08') !== 8 || $parseInt$1(whitespaces + '0x16') !== 22
1886
- // MS Edge 18- broken with boxed symbols
1887
- || (ITERATOR && !fails(function () { $parseInt$1(Object(ITERATOR)); }));
1888
-
1889
- // `parseInt` method
1890
- // https://tc39.es/ecma262/#sec-parseint-string-radix
1891
- var numberParseInt = FORCED ? function parseInt(string, radix) {
1892
- var S = trim(toString(string));
1893
- return $parseInt$1(S, (radix >>> 0) || (exec(hex, S) ? 16 : 10));
1894
- } : $parseInt$1;
1946
+ const FormItems = ({
1947
+ children,
1948
+ validate,
1949
+ name
1950
+ }) => {
1951
+ const {
1952
+ setValues,
1953
+ setErrors,
1954
+ setFields,
1955
+ errors
1956
+ } = useFormContext();
1957
+ React.useEffect(() => {
1958
+ setFields(fields => Object.assign(Object.assign({}, fields), {
1959
+ [name]: validate === null || validate === void 0 ? void 0 : validate.rules
1960
+ }));
1961
+
1962
+ const removeValues = values => {
1963
+ const newValues = Object.assign({}, values);
1964
+ delete newValues[name];
1965
+ return newValues;
1966
+ };
1895
1967
 
1896
- var $ = _export;
1897
- var $parseInt = numberParseInt;
1968
+ return () => {
1969
+ setFields(fields => removeValues(fields));
1970
+ setValues(values => removeValues(values));
1971
+ setErrors(errors => removeValues(errors));
1972
+ };
1973
+ }, []);
1898
1974
 
1899
- // `parseInt` method
1900
- // https://tc39.es/ecma262/#sec-parseint-string-radix
1901
- $({ global: true, forced: parseInt != $parseInt }, {
1902
- parseInt: $parseInt
1903
- });
1975
+ const onChange = event => {
1976
+ const {
1977
+ value,
1978
+ name,
1979
+ type,
1980
+ checked
1981
+ } = event.target;
1982
+ let inputValue;
1983
+
1984
+ if (type === 'checkbox') {
1985
+ inputValue = checked ? value : null;
1986
+ checked ? setValues(values => Object.assign(Object.assign({}, values), {
1987
+ [name]: value
1988
+ })) : setValues(values => Object.assign(Object.assign({}, values), {
1989
+ [name]: null
1990
+ }));
1991
+ } else {
1992
+ inputValue = value;
1993
+ setValues(values => Object.assign(Object.assign({}, values), {
1994
+ [name]: value
1995
+ }));
1996
+ }
1997
+
1998
+ validateInputValue({
1999
+ value: inputValue,
2000
+ name,
2001
+ type,
2002
+ checked
2003
+ }, validate === null || validate === void 0 ? void 0 : validate.rules, setErrors);
2004
+ };
2005
+
2006
+ return /*#__PURE__*/React.cloneElement(children, {
2007
+ validator: (errors === null || errors === void 0 ? void 0 : errors[name]) && validate,
2008
+ name,
2009
+ onChange
2010
+ });
2011
+ };
1904
2012
 
1905
- const useInput = (props, evaluator, notify) => {
2013
+ function Group({
2014
+ children,
2015
+ error,
2016
+ groupBorder = false
2017
+ }) {
2018
+ const groupClassName = `group ${groupBorder ? 'group-border' : ''} ${error ? 'is-invalid' : ''}`;
2019
+ const errorMessage = error ? error.message || error : '';
2020
+ return jsxs("div", Object.assign({
2021
+ className: "form-group"
2022
+ }, {
2023
+ children: [jsx("div", Object.assign({
2024
+ className: groupClassName
2025
+ }, {
2026
+ children: children
2027
+ }), void 0), error && jsx("span", Object.assign({
2028
+ className: "form-info"
2029
+ }, {
2030
+ children: errorMessage
2031
+ }), void 0)]
2032
+ }), void 0);
2033
+ }
2034
+
2035
+ const useInput = (props, onChanges, onChangeInput) => {
1906
2036
  const id = useMemo(() => props.id || randomId(), [props.id]);
1907
2037
  const ref = useRef(null);
1908
- const [value, setValue] = useState(props.value);
1909
- const [checked, setChecked] = useState(props.checked);
2038
+ const [value, setValue] = useState(props.value ? props.value : '');
2039
+ const [checked, setChecked] = useState(props.checked ? props.checked : false);
1910
2040
  useEffect(() => {
1911
2041
  if (ref.current && ref.current.form) {
1912
2042
  const resetListener = () => {
1913
- setValue(props.value);
1914
- setChecked(props.checked);
2043
+ setValue(props.value ? props.value : '');
2044
+ setChecked(props.checked ? props.checked : false);
1915
2045
  };
1916
2046
 
1917
2047
  const form = ref.current.form;
@@ -1925,8 +2055,9 @@ const useInput = (props, evaluator, notify) => {
1925
2055
 
1926
2056
  const onChange = event => {
1927
2057
  setValue(event.target.value);
1928
- setChecked(event.target.checked);
1929
- if (notify) notify(evaluator(event.target));
2058
+ setChecked(event.currentTarget.checked);
2059
+ onChanges && onChanges(event);
2060
+ onChangeInput && onChangeInput(event.target.value);
1930
2061
  };
1931
2062
 
1932
2063
  return Object.assign(Object.assign({}, props), {
@@ -1938,8 +2069,8 @@ const useInput = (props, evaluator, notify) => {
1938
2069
  });
1939
2070
  };
1940
2071
 
1941
- const RenderInput = (type, props, evaluator, label, info, listener) => {
1942
- const _a = useInput(props, evaluator, listener),
2072
+ const RenderInput = (type, props, onChange, onChangeInput, label, info, validator) => {
2073
+ const _a = useInput(props, onChange, onChangeInput),
1943
2074
  {
1944
2075
  value
1945
2076
  } = _a,
@@ -1947,9 +2078,14 @@ const RenderInput = (type, props, evaluator, label, info, listener) => {
1947
2078
 
1948
2079
  const propsWithDescription = info ? Object.assign(Object.assign({}, inputProps), {
1949
2080
  'aria-describedby': `${inputProps.id}_info`
1950
- }) : inputProps;
2081
+ }) : inputProps; // Render naked
2082
+
2083
+ if (!label && !info) return jsx("input", Object.assign({
2084
+ type: type,
2085
+ value: value
2086
+ }, propsWithDescription), void 0);
1951
2087
  return jsxs("div", Object.assign({
1952
- className: "form-field"
2088
+ className: "form-group"
1953
2089
  }, {
1954
2090
  children: [label && jsx("label", Object.assign({
1955
2091
  htmlFor: inputProps.id
@@ -1957,63 +2093,107 @@ const RenderInput = (type, props, evaluator, label, info, listener) => {
1957
2093
  children: label
1958
2094
  }), void 0), info && jsx("span", Object.assign({
1959
2095
  className: "form-info",
1960
- id: "{inputProps.id}_info"
2096
+ id: `${inputProps.id}_info`
1961
2097
  }, {
1962
2098
  children: info
1963
2099
  }), void 0), jsx("input", Object.assign({
1964
2100
  type: type,
1965
2101
  value: value
1966
- }, propsWithDescription), void 0)]
2102
+ }, propsWithDescription, {
2103
+ className: validator && validateClassName(validator === null || validator === void 0 ? void 0 : validator.indicator)
2104
+ }), void 0), validator && jsx("span", Object.assign({
2105
+ className: "form-info"
2106
+ }, {
2107
+ children: validator.message
2108
+ }), void 0)]
1967
2109
  }), void 0);
1968
2110
  };
1969
-
1970
2111
  const TextInput = _a => {
1971
2112
  var {
1972
2113
  label,
1973
2114
  info,
1974
- onChangeText
2115
+ onChange,
2116
+ onChangeInput,
2117
+ validator
1975
2118
  } = _a,
1976
- props = __rest(_a, ["label", "info", "onChangeText"]);
2119
+ props = __rest(_a, ["label", "info", "onChange", "onChangeInput", "validator"]);
1977
2120
 
1978
- return RenderInput('text', props, e => e.value, label, info, onChangeText);
2121
+ return RenderInput('text', props, onChange, onChangeInput, label, info, validator);
1979
2122
  };
1980
2123
  const EmailInput = _a => {
1981
2124
  var {
1982
2125
  label,
1983
2126
  info,
1984
- onChangeText
2127
+ onChange,
2128
+ onChangeInput,
2129
+ validator
1985
2130
  } = _a,
1986
- props = __rest(_a, ["label", "info", "onChangeText"]);
2131
+ props = __rest(_a, ["label", "info", "onChange", "onChangeInput", "validator"]);
1987
2132
 
1988
- return RenderInput('email', props, e => e.value, label, info, onChangeText);
2133
+ return RenderInput('email', props, onChange, onChangeInput, label, info, validator);
1989
2134
  };
1990
2135
  const NumberInput = _a => {
1991
2136
  var {
1992
2137
  label,
1993
2138
  info,
1994
- onChangeText
2139
+ onChange,
2140
+ onChangeInput,
2141
+ validator
1995
2142
  } = _a,
1996
- props = __rest(_a, ["label", "info", "onChangeText"]);
2143
+ props = __rest(_a, ["label", "info", "onChange", "onChangeInput", "validator"]);
1997
2144
 
1998
- return RenderInput('number', props, e => e.value.length ? parseInt(e.value, 10) : undefined, label, info, onChangeText);
2145
+ return RenderInput('number', props, onChange, onChangeInput, label, info, validator);
1999
2146
  };
2000
2147
  const Checkbox = _a => {
2001
2148
  var {
2002
2149
  label,
2003
- onChecked
2150
+ onChange,
2151
+ validator
2152
+ } = _a,
2153
+ props = __rest(_a, ["label", "onChange", "validator"]);
2154
+
2155
+ const inputProps = useInput(props, onChange);
2156
+ const validatorClassName = validateClassName(validator === null || validator === void 0 ? void 0 : validator.indicator);
2157
+ return jsxs(Fragment, {
2158
+ children: [jsxs("label", Object.assign({
2159
+ htmlFor: inputProps.id,
2160
+ className: `form-control ${validatorClassName}`
2161
+ }, {
2162
+ children: [label, jsx("input", Object.assign({
2163
+ type: "checkbox"
2164
+ }, inputProps), void 0), jsx("span", {}, void 0), jsx("i", {}, void 0)]
2165
+ }), void 0), validator && jsx("span", Object.assign({
2166
+ className: "form-info"
2167
+ }, {
2168
+ children: validator.message
2169
+ }), void 0)]
2170
+ }, void 0);
2171
+ };
2172
+ const RadioButton = /*#__PURE__*/React.forwardRef((_a, ref) => {
2173
+ var {
2174
+ label,
2175
+ validator
2004
2176
  } = _a,
2005
- props = __rest(_a, ["label", "onChecked"]);
2177
+ props = __rest(_a, ["label", "validator"]);
2006
2178
 
2007
- const inputProps = useInput(props, e => e.checked, onChecked);
2179
+ const {
2180
+ id
2181
+ } = useInput(props);
2008
2182
  return jsxs("label", Object.assign({
2009
- htmlFor: inputProps.id,
2183
+ htmlFor: id,
2010
2184
  className: "form-control"
2011
2185
  }, {
2012
- children: [label, jsx("input", Object.assign({
2013
- type: "checkbox"
2014
- }, inputProps), void 0), jsx("span", {}, void 0)]
2186
+ children: [jsx("input", Object.assign({
2187
+ id: id,
2188
+ type: "radio"
2189
+ }, props, {
2190
+ className: validator,
2191
+ ref: ref
2192
+ }), void 0), jsx("span", {
2193
+ children: label
2194
+ }, void 0), jsx("i", {}, void 0)]
2015
2195
  }), void 0);
2016
- };
2196
+ });
2017
2197
 
2018
2198
  const Text = ({
2019
2199
  children
@@ -2023,6 +2203,178 @@ const Text = ({
2023
2203
  children: children
2024
2204
  }), void 0);
2025
2205
 
2206
+ var wellKnownSymbol$1 = wellKnownSymbol$8;
2207
+
2208
+ var TO_STRING_TAG$1 = wellKnownSymbol$1('toStringTag');
2209
+ var test = {};
2210
+
2211
+ test[TO_STRING_TAG$1] = 'z';
2212
+
2213
+ var toStringTagSupport = String(test) === '[object z]';
2214
+
2215
+ var global$3 = global$r;
2216
+ var TO_STRING_TAG_SUPPORT = toStringTagSupport;
2217
+ var isCallable$1 = isCallable$f;
2218
+ var classofRaw = classofRaw$1;
2219
+ var wellKnownSymbol = wellKnownSymbol$8;
2220
+
2221
+ var TO_STRING_TAG = wellKnownSymbol('toStringTag');
2222
+ var Object$1 = global$3.Object;
2223
+
2224
+ // ES3 wrong here
2225
+ var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
2226
+
2227
+ // fallback for IE11 Script Access Denied error
2228
+ var tryGet = function (it, key) {
2229
+ try {
2230
+ return it[key];
2231
+ } catch (error) { /* empty */ }
2232
+ };
2233
+
2234
+ // getting tag from ES6+ `Object.prototype.toString`
2235
+ var classof$1 = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
2236
+ var O, tag, result;
2237
+ return it === undefined ? 'Undefined' : it === null ? 'Null'
2238
+ // @@toStringTag case
2239
+ : typeof (tag = tryGet(O = Object$1(it), TO_STRING_TAG)) == 'string' ? tag
2240
+ // builtinTag case
2241
+ : CORRECT_ARGUMENTS ? classofRaw(O)
2242
+ // ES3 arguments fallback
2243
+ : (result = classofRaw(O)) == 'Object' && isCallable$1(O.callee) ? 'Arguments' : result;
2244
+ };
2245
+
2246
+ var global$2 = global$r;
2247
+ var classof = classof$1;
2248
+
2249
+ var String$1 = global$2.String;
2250
+
2251
+ var toString$1 = function (argument) {
2252
+ if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
2253
+ return String$1(argument);
2254
+ };
2255
+
2256
+ var $ = _export;
2257
+ var DESCRIPTORS = descriptors;
2258
+ var global$1 = global$r;
2259
+ var uncurryThis = functionUncurryThis;
2260
+ var hasOwn = hasOwnProperty_1;
2261
+ var isCallable = isCallable$f;
2262
+ var isPrototypeOf = objectIsPrototypeOf;
2263
+ var toString = toString$1;
2264
+ var defineProperty = objectDefineProperty.f;
2265
+ var copyConstructorProperties = copyConstructorProperties$2;
2266
+
2267
+ var NativeSymbol = global$1.Symbol;
2268
+ var SymbolPrototype = NativeSymbol && NativeSymbol.prototype;
2269
+
2270
+ if (DESCRIPTORS && isCallable(NativeSymbol) && (!('description' in SymbolPrototype) ||
2271
+ // Safari 12 bug
2272
+ NativeSymbol().description !== undefined
2273
+ )) {
2274
+ var EmptyStringDescriptionStore = {};
2275
+ // wrap Symbol constructor for correct work with undefined description
2276
+ var SymbolWrapper = function Symbol() {
2277
+ var description = arguments.length < 1 || arguments[0] === undefined ? undefined : toString(arguments[0]);
2278
+ var result = isPrototypeOf(SymbolPrototype, this)
2279
+ ? new NativeSymbol(description)
2280
+ // in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)'
2281
+ : description === undefined ? NativeSymbol() : NativeSymbol(description);
2282
+ if (description === '') EmptyStringDescriptionStore[result] = true;
2283
+ return result;
2284
+ };
2285
+
2286
+ copyConstructorProperties(SymbolWrapper, NativeSymbol);
2287
+ SymbolWrapper.prototype = SymbolPrototype;
2288
+ SymbolPrototype.constructor = SymbolWrapper;
2289
+
2290
+ var NATIVE_SYMBOL = String(NativeSymbol('test')) == 'Symbol(test)';
2291
+ var symbolToString = uncurryThis(SymbolPrototype.toString);
2292
+ var symbolValueOf = uncurryThis(SymbolPrototype.valueOf);
2293
+ var regexp = /^Symbol\((.*)\)[^)]+$/;
2294
+ var replace = uncurryThis(''.replace);
2295
+ var stringSlice = uncurryThis(''.slice);
2296
+
2297
+ defineProperty(SymbolPrototype, 'description', {
2298
+ configurable: true,
2299
+ get: function description() {
2300
+ var symbol = symbolValueOf(this);
2301
+ var string = symbolToString(symbol);
2302
+ if (hasOwn(EmptyStringDescriptionStore, symbol)) return '';
2303
+ var desc = NATIVE_SYMBOL ? stringSlice(string, 7, -1) : replace(string, regexp, '$1');
2304
+ return desc === '' ? undefined : desc;
2305
+ }
2306
+ });
2307
+
2308
+ $({ global: true, forced: true }, {
2309
+ Symbol: SymbolWrapper
2310
+ });
2311
+ }
2312
+
2313
+ const RadioGroup = ({
2314
+ description,
2315
+ title,
2316
+ validator,
2317
+ onChangeRadio,
2318
+ onChange,
2319
+ name,
2320
+ children
2321
+ }) => {
2322
+ const [checked, setChecked] = React.useState();
2323
+ const validatorClassName = validateClassName(validator === null || validator === void 0 ? void 0 : validator.indicator);
2324
+
2325
+ const onChanges = event => {
2326
+ setChecked(event.target.value);
2327
+ onChangeRadio && onChangeRadio(event.target.value);
2328
+ onChange && onChange(event);
2329
+ };
2330
+
2331
+ const radioBtnRef = React.useRef(null);
2332
+ React.useEffect(() => {
2333
+ var _a;
2334
+
2335
+ if (radioBtnRef && radioBtnRef.current) {
2336
+ const form = (_a = radioBtnRef === null || radioBtnRef === void 0 ? void 0 : radioBtnRef.current) === null || _a === void 0 ? void 0 : _a.form;
2337
+
2338
+ const resetListner = () => {
2339
+ setChecked(undefined);
2340
+ };
2341
+
2342
+ form === null || form === void 0 ? void 0 : form.addEventListener('reset', resetListner);
2343
+ return () => form === null || form === void 0 ? void 0 : form.removeEventListener('reset', resetListner);
2344
+ } else {
2345
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
2346
+ return () => {};
2347
+ }
2348
+ }, []);
2349
+ return jsxs("div", Object.assign({
2350
+ className: "form-group"
2351
+ }, {
2352
+ children: [jsxs("fieldset", Object.assign({
2353
+ className: validatorClassName
2354
+ }, {
2355
+ children: [jsx("legend", {
2356
+ children: title
2357
+ }, void 0), jsx("span", Object.assign({
2358
+ className: "form-info"
2359
+ }, {
2360
+ children: description
2361
+ }), void 0), React.Children.map(children, Child => {
2362
+ return /*#__PURE__*/React.isValidElement(Child) ? /*#__PURE__*/React.cloneElement(Child, {
2363
+ validator: validatorClassName,
2364
+ onChange: onChanges,
2365
+ checked: checked === Child.props.value,
2366
+ name,
2367
+ ref: radioBtnRef
2368
+ }) : Child;
2369
+ })]
2370
+ }), void 0), (validator === null || validator === void 0 ? void 0 : validator.message) && jsx("span", Object.assign({
2371
+ className: "form-info"
2372
+ }, {
2373
+ children: validator === null || validator === void 0 ? void 0 : validator.message
2374
+ }), void 0)]
2375
+ }), void 0);
2376
+ };
2377
+
2026
2378
  const ListItem = _a => {
2027
2379
  var {
2028
2380
  listType,
@@ -2165,4 +2517,4 @@ const Navbar = ({
2165
2517
  }), void 0);
2166
2518
  };
2167
2519
 
2168
- export { Alert, Button, ButtonGroup, Card, Checkbox, EmailInput, Flexbox, Form, Group, Link, List, Modal, Navbar, NumberInput, Text, TextInput };
2520
+ export { Alert, Button, ButtonGroup, Card, Checkbox, EmailInput, Flexbox, Form, FormItems, Group, Link, List, Modal, Navbar, NumberInput, RadioButton, RadioGroup, RenderInput, Text, TextInput };