@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.umd.js CHANGED
@@ -182,46 +182,44 @@
182
182
  alignItems = _a.alignItems,
183
183
  alignSelf = _a.alignSelf,
184
184
  children = _a.children,
185
- justifyContent = _a.justifyContent;
185
+ justifyContent = _a.justifyContent,
186
+ flexDirection = _a.flexDirection,
187
+ flexWrap = _a.flexWrap,
188
+ className = _a.className,
189
+ props = __rest(_a, ["alignContent", "alignItems", "alignSelf", "children", "justifyContent", "flexDirection", "flexWrap", "className"]);
186
190
 
187
191
  var _b = React.useState(['d-flex']),
188
192
  classes = _b[0],
189
193
  setClasses = _b[1];
190
194
 
191
195
  var _c = React.useState('d-flex'),
192
- className = _c[0],
193
- setClassName = _c[1]; // update className when classes change
196
+ flexClassName = _c[0],
197
+ setFlexClassName = _c[1]; // // update className when classes change
194
198
 
195
199
 
196
- React.useEffect(function () {
200
+ React.useLayoutEffect(function () {
197
201
  var newClassName = classes.join(' ');
198
- if (newClassName !== className) setClassName(newClassName);
199
- }, [classes, className]); // update classes when props change
202
+ if (newClassName !== flexClassName) setFlexClassName(newClassName);
203
+ }, [classes, flexClassName]); // // update classes when props change
200
204
 
201
- React.useEffect(function () {
205
+ React.useLayoutEffect(function () {
202
206
  var newClasses = ['d-flex'];
203
- if (alignItems) newClasses.push("align-items-".concat(alignItems));
204
- if (alignContent) newClasses.push("align-content-".concat(alignContent));
205
- if (alignSelf) newClasses.push("align-content-".concat(alignSelf));
206
- if (justifyContent) newClasses.push("justify-content-".concat(justifyContent));
207
+ alignItems && newClasses.push("align-items-".concat(alignItems));
208
+ alignContent && newClasses.push("align-content-".concat(alignContent));
209
+ alignSelf && newClasses.push("align-self-".concat(alignSelf));
210
+ justifyContent && newClasses.push("justify-content-".concat(justifyContent));
211
+ flexDirection && newClasses.push("flex-".concat(flexDirection));
212
+ flexWrap && newClasses.push("flex-".concat(flexWrap));
213
+ className && newClasses.push(className);
207
214
  setClasses(newClasses);
208
- }, [alignContent, alignItems, alignSelf, justifyContent]);
215
+ }, [alignContent, alignItems, alignSelf, justifyContent, flexDirection, flexWrap, className]);
209
216
  return jsxRuntime.jsx("div", __assign({
210
- className: className
211
- }, {
217
+ className: flexClassName
218
+ }, props, {
212
219
  children: children
213
220
  }), void 0);
214
221
  };
215
222
 
216
- function Group(_a) {
217
- var children = _a.children;
218
- return jsxRuntime.jsx("div", __assign({
219
- className: "group"
220
- }, {
221
- children: children
222
- }), void 0);
223
- }
224
-
225
223
  function Card(_a) {
226
224
  var children = _a.children,
227
225
  header = _a.header,
@@ -325,19 +323,396 @@
325
323
  }, void 0);
326
324
  };
327
325
 
328
- function Form(_a) {
326
+ var validateInputValue = function validateInputValue(target, rules, setError) {
327
+ var errorMessage = validateInputValueErrors(rules, target);
328
+ errorMessage ? setErrorInsert(setError, target.name) : setErrorRemove(setError, target.name);
329
+ return errorMessage;
330
+ };
331
+
332
+ var validateInputValueErrors = function validateInputValueErrors(rules, target) {
333
+ var value = target.value;
334
+
335
+ if ((rules === null || rules === void 0 ? void 0 : rules.custom) instanceof Function) {
336
+ return rules === null || rules === void 0 ? void 0 : rules.custom();
337
+ }
338
+
339
+ return validateTextInputValues(value, rules);
340
+ };
341
+
342
+ var setErrorInsert = function setErrorInsert(setError, name) {
343
+ setError(function (errors) {
344
+ var _a;
345
+
346
+ return __assign(__assign({}, errors), (_a = {}, _a[name] = true, _a));
347
+ });
348
+ };
349
+
350
+ var setErrorRemove = function setErrorRemove(setError, name) {
351
+ setError(function (errors) {
352
+ var newError = __assign({}, errors);
353
+
354
+ delete newError[name];
355
+ return newError;
356
+ });
357
+ };
358
+
359
+ var validateTextInputValues = function validateTextInputValues(value, rules) {
360
+ switch (rules === null || rules === void 0 ? void 0 : rules.type) {
361
+ case 'Required':
362
+ {
363
+ return value === '' || value === undefined || value === null ? 'error' : null;
364
+ }
365
+
366
+ default:
367
+ {
368
+ return;
369
+ }
370
+ }
371
+ };
372
+
373
+ var FormContext = /*#__PURE__*/React__default["default"].createContext({});
374
+ var useFormContext = function useFormContext() {
375
+ return React__default["default"].useContext(FormContext);
376
+ };
377
+ var FormProvider = function FormProvider(_a) {
329
378
  var children = _a.children,
330
379
  _b = _a.direction,
331
380
  direction = _b === void 0 ? 'vertical' : _b,
332
381
  _c = _a.formSize,
333
382
  formSize = _c === void 0 ? 'md' : _c;
334
- return jsxRuntime.jsx("form", __assign({
335
- className: [direction, "size-".concat(formSize)].join(' ')
383
+ _a.onSubmit;
384
+ var onFormSubmit = _a.onFormSubmit,
385
+ props = __rest(_a, ["children", "direction", "formSize", "onSubmit", "onFormSubmit"]);
386
+
387
+ var _d = React__default["default"].useState(),
388
+ values = _d[0],
389
+ setValues = _d[1];
390
+
391
+ var _e = React__default["default"].useState(),
392
+ errors = _e[0],
393
+ setErrors = _e[1];
394
+
395
+ var _f = React__default["default"].useState({}),
396
+ fields = _f[0],
397
+ setFields = _f[1];
398
+
399
+ var formSubmit = function formSubmit(event) {
400
+ var hasError = false;
401
+ event.preventDefault();
402
+ Object.keys(fields).forEach(function (key) {
403
+ var errorMessage = validateInputValue({
404
+ name: key,
405
+ value: values === null || values === void 0 ? void 0 : values[key]
406
+ }, fields[key], setErrors);
407
+ hasError = hasError || !!errorMessage;
408
+ });
409
+
410
+ if (!hasError) {
411
+ onFormSubmit && onFormSubmit(values);
412
+ }
413
+ };
414
+
415
+ var resetForm = function resetForm() {
416
+ setValues({});
417
+ setErrors({});
418
+ };
419
+
420
+ return jsxRuntime.jsx(FormContext.Provider, __assign({
421
+ value: {
422
+ setValues: setValues,
423
+ setErrors: setErrors,
424
+ setFields: setFields,
425
+ errors: errors,
426
+ values: values
427
+ }
336
428
  }, {
337
- children: children
429
+ children: jsxRuntime.jsx("form", __assign({
430
+ className: [direction, "size-".concat(formSize)].join(' '),
431
+ onSubmit: formSubmit
432
+ }, props, {
433
+ onReset: resetForm
434
+ }, {
435
+ children: children
436
+ }), void 0)
437
+ }), void 0);
438
+ };
439
+
440
+ var Form = function Form(props) {
441
+ return jsxRuntime.jsx(FormProvider, __assign({}, props), void 0);
442
+ };
443
+
444
+ var FormItems = function FormItems(_a) {
445
+ var children = _a.children,
446
+ validate = _a.validate,
447
+ name = _a.name;
448
+
449
+ var _b = useFormContext(),
450
+ setValues = _b.setValues,
451
+ setErrors = _b.setErrors,
452
+ setFields = _b.setFields,
453
+ errors = _b.errors;
454
+
455
+ React__default["default"].useEffect(function () {
456
+ setFields(function (fields) {
457
+ var _a;
458
+
459
+ return __assign(__assign({}, fields), (_a = {}, _a[name] = validate === null || validate === void 0 ? void 0 : validate.rules, _a));
460
+ });
461
+
462
+ var removeValues = function removeValues(values) {
463
+ var newValues = __assign({}, values);
464
+
465
+ delete newValues[name];
466
+ return newValues;
467
+ };
468
+
469
+ return function () {
470
+ setFields(function (fields) {
471
+ return removeValues(fields);
472
+ });
473
+ setValues(function (values) {
474
+ return removeValues(values);
475
+ });
476
+ setErrors(function (errors) {
477
+ return removeValues(errors);
478
+ });
479
+ };
480
+ }, []);
481
+
482
+ var onChange = function onChange(event) {
483
+ var _a = event.target,
484
+ value = _a.value,
485
+ name = _a.name,
486
+ type = _a.type,
487
+ checked = _a.checked;
488
+ var inputValue;
489
+
490
+ if (type === 'checkbox') {
491
+ inputValue = checked ? value : null;
492
+ checked ? setValues(function (values) {
493
+ var _a;
494
+
495
+ return __assign(__assign({}, values), (_a = {}, _a[name] = value, _a));
496
+ }) : setValues(function (values) {
497
+ var _a;
498
+
499
+ return __assign(__assign({}, values), (_a = {}, _a[name] = null, _a));
500
+ });
501
+ } else {
502
+ inputValue = value;
503
+ setValues(function (values) {
504
+ var _a;
505
+
506
+ return __assign(__assign({}, values), (_a = {}, _a[name] = value, _a));
507
+ });
508
+ }
509
+
510
+ validateInputValue({
511
+ value: inputValue,
512
+ name: name,
513
+ type: type,
514
+ checked: checked
515
+ }, validate === null || validate === void 0 ? void 0 : validate.rules, setErrors);
516
+ };
517
+
518
+ return /*#__PURE__*/React__default["default"].cloneElement(children, {
519
+ validator: (errors === null || errors === void 0 ? void 0 : errors[name]) && validate,
520
+ name: name,
521
+ onChange: onChange
522
+ });
523
+ };
524
+
525
+ function Group(_a) {
526
+ var children = _a.children,
527
+ error = _a.error,
528
+ _b = _a.groupBorder,
529
+ groupBorder = _b === void 0 ? false : _b;
530
+ var groupClassName = "group ".concat(groupBorder ? 'group-border' : '', " ").concat(error ? 'is-invalid' : '');
531
+ var errorMessage = error ? error.message || error : '';
532
+ return jsxRuntime.jsxs("div", __assign({
533
+ className: "form-group"
534
+ }, {
535
+ children: [jsxRuntime.jsx("div", __assign({
536
+ className: groupClassName
537
+ }, {
538
+ children: children
539
+ }), void 0), error && jsxRuntime.jsx("span", __assign({
540
+ className: "form-info"
541
+ }, {
542
+ children: errorMessage
543
+ }), void 0)]
338
544
  }), void 0);
339
545
  }
340
546
 
547
+ var useInput = function useInput(props, onChanges, onChangeInput) {
548
+ var id = React.useMemo(function () {
549
+ return props.id || extract.randomId();
550
+ }, [props.id]);
551
+ var ref = React.useRef(null);
552
+
553
+ var _a = React.useState(props.value ? props.value : ''),
554
+ value = _a[0],
555
+ setValue = _a[1];
556
+
557
+ var _b = React.useState(props.checked ? props.checked : false),
558
+ checked = _b[0],
559
+ setChecked = _b[1];
560
+
561
+ React.useEffect(function () {
562
+ if (ref.current && ref.current.form) {
563
+ var resetListener_1 = function resetListener_1() {
564
+ setValue(props.value ? props.value : '');
565
+ setChecked(props.checked ? props.checked : false);
566
+ };
567
+
568
+ var form_1 = ref.current.form;
569
+ form_1.addEventListener('reset', resetListener_1);
570
+ return function () {
571
+ return form_1.removeEventListener('reset', resetListener_1);
572
+ };
573
+ } else {
574
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
575
+ return function () {};
576
+ }
577
+ }, [props]);
578
+
579
+ var onChange = function onChange(event) {
580
+ setValue(event.target.value);
581
+ setChecked(event.currentTarget.checked);
582
+ onChanges && onChanges(event);
583
+ onChangeInput && onChangeInput(event.target.value);
584
+ };
585
+
586
+ return __assign(__assign({}, props), {
587
+ id: id,
588
+ ref: ref,
589
+ value: value,
590
+ checked: checked,
591
+ onChange: onChange
592
+ });
593
+ };
594
+
595
+ var RenderInput = function RenderInput(type, props, onChange, onChangeInput, label, info, validator) {
596
+ var _a = useInput(props, onChange, onChangeInput),
597
+ value = _a.value,
598
+ inputProps = __rest(_a, ["value"]);
599
+
600
+ var propsWithDescription = info ? __assign(__assign({}, inputProps), {
601
+ 'aria-describedby': "".concat(inputProps.id, "_info")
602
+ }) : inputProps; // Render naked
603
+
604
+ if (!label && !info) return jsxRuntime.jsx("input", __assign({
605
+ type: type,
606
+ value: value
607
+ }, propsWithDescription), void 0);
608
+ return jsxRuntime.jsxs("div", __assign({
609
+ className: "form-group"
610
+ }, {
611
+ children: [label && jsxRuntime.jsx("label", __assign({
612
+ htmlFor: inputProps.id
613
+ }, {
614
+ children: label
615
+ }), void 0), info && jsxRuntime.jsx("span", __assign({
616
+ className: "form-info",
617
+ id: "".concat(inputProps.id, "_info")
618
+ }, {
619
+ children: info
620
+ }), void 0), jsxRuntime.jsx("input", __assign({
621
+ type: type,
622
+ value: value
623
+ }, propsWithDescription, {
624
+ className: validator && extract.validateClassName(validator === null || validator === void 0 ? void 0 : validator.indicator)
625
+ }), void 0), validator && jsxRuntime.jsx("span", __assign({
626
+ className: "form-info"
627
+ }, {
628
+ children: validator.message
629
+ }), void 0)]
630
+ }), void 0);
631
+ };
632
+ var TextInput = function TextInput(_a) {
633
+ var label = _a.label,
634
+ info = _a.info,
635
+ onChange = _a.onChange,
636
+ onChangeInput = _a.onChangeInput,
637
+ validator = _a.validator,
638
+ props = __rest(_a, ["label", "info", "onChange", "onChangeInput", "validator"]);
639
+
640
+ return RenderInput('text', props, onChange, onChangeInput, label, info, validator);
641
+ };
642
+ var EmailInput = function EmailInput(_a) {
643
+ var label = _a.label,
644
+ info = _a.info,
645
+ onChange = _a.onChange,
646
+ onChangeInput = _a.onChangeInput,
647
+ validator = _a.validator,
648
+ props = __rest(_a, ["label", "info", "onChange", "onChangeInput", "validator"]);
649
+
650
+ return RenderInput('email', props, onChange, onChangeInput, label, info, validator);
651
+ };
652
+ var NumberInput = function NumberInput(_a) {
653
+ var label = _a.label,
654
+ info = _a.info,
655
+ onChange = _a.onChange,
656
+ onChangeInput = _a.onChangeInput,
657
+ validator = _a.validator,
658
+ props = __rest(_a, ["label", "info", "onChange", "onChangeInput", "validator"]);
659
+
660
+ return RenderInput('number', props, onChange, onChangeInput, label, info, validator);
661
+ };
662
+ var Checkbox = function Checkbox(_a) {
663
+ var label = _a.label,
664
+ onChange = _a.onChange,
665
+ validator = _a.validator,
666
+ props = __rest(_a, ["label", "onChange", "validator"]);
667
+
668
+ var inputProps = useInput(props, onChange);
669
+ var validatorClassName = extract.validateClassName(validator === null || validator === void 0 ? void 0 : validator.indicator);
670
+ return jsxRuntime.jsxs(jsxRuntime.Fragment, {
671
+ children: [jsxRuntime.jsxs("label", __assign({
672
+ htmlFor: inputProps.id,
673
+ className: "form-control ".concat(validatorClassName)
674
+ }, {
675
+ children: [label, jsxRuntime.jsx("input", __assign({
676
+ type: "checkbox"
677
+ }, inputProps), void 0), jsxRuntime.jsx("span", {}, void 0), jsxRuntime.jsx("i", {}, void 0)]
678
+ }), void 0), validator && jsxRuntime.jsx("span", __assign({
679
+ className: "form-info"
680
+ }, {
681
+ children: validator.message
682
+ }), void 0)]
683
+ }, void 0);
684
+ };
685
+ var RadioButton = /*#__PURE__*/React__default["default"].forwardRef(function (_a, ref) {
686
+ var label = _a.label,
687
+ validator = _a.validator,
688
+ props = __rest(_a, ["label", "validator"]);
689
+
690
+ var id = useInput(props).id;
691
+ return jsxRuntime.jsxs("label", __assign({
692
+ htmlFor: id,
693
+ className: "form-control"
694
+ }, {
695
+ children: [jsxRuntime.jsx("input", __assign({
696
+ id: id,
697
+ type: "radio"
698
+ }, props, {
699
+ className: validator,
700
+ ref: ref
701
+ }), void 0), jsxRuntime.jsx("span", {
702
+ children: label
703
+ }, void 0), jsxRuntime.jsx("i", {}, void 0)]
704
+ }), void 0);
705
+ });
706
+
707
+ var Text = function Text(_a) {
708
+ var children = _a.children;
709
+ return jsxRuntime.jsx("span", __assign({
710
+ className: "form-text"
711
+ }, {
712
+ children: children
713
+ }), void 0);
714
+ };
715
+
341
716
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
342
717
 
343
718
  var check = function (it) {
@@ -357,7 +732,7 @@
357
732
 
358
733
  var objectGetOwnPropertyDescriptor = {};
359
734
 
360
- var fails$6 = function (exec) {
735
+ var fails$7 = function (exec) {
361
736
  try {
362
737
  return !!exec();
363
738
  } catch (error) {
@@ -365,17 +740,27 @@
365
740
  }
366
741
  };
367
742
 
368
- var fails$5 = fails$6;
743
+ var fails$6 = fails$7;
369
744
 
370
745
  // Detect IE8's incomplete defineProperty implementation
371
- var descriptors = !fails$5(function () {
746
+ var descriptors = !fails$6(function () {
372
747
  // eslint-disable-next-line es/no-object-defineproperty -- required for testing
373
748
  return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
374
749
  });
375
750
 
751
+ var fails$5 = fails$7;
752
+
753
+ var functionBindNative = !fails$5(function () {
754
+ var test = (function () { /* empty */ }).bind();
755
+ // eslint-disable-next-line no-prototype-builtins -- safe
756
+ return typeof test != 'function' || test.hasOwnProperty('prototype');
757
+ });
758
+
759
+ var NATIVE_BIND$1 = functionBindNative;
760
+
376
761
  var call$4 = Function.prototype.call;
377
762
 
378
- var functionCall = call$4.bind ? call$4.bind(call$4) : function () {
763
+ var functionCall = NATIVE_BIND$1 ? call$4.bind(call$4) : function () {
379
764
  return call$4.apply(call$4, arguments);
380
765
  };
381
766
 
@@ -404,35 +789,37 @@
404
789
  };
405
790
  };
406
791
 
792
+ var NATIVE_BIND = functionBindNative;
793
+
407
794
  var FunctionPrototype$1 = Function.prototype;
408
795
  var bind = FunctionPrototype$1.bind;
409
796
  var call$3 = FunctionPrototype$1.call;
410
- var callBind = bind && bind.bind(call$3);
797
+ var uncurryThis$a = NATIVE_BIND && bind.bind(call$3, call$3);
411
798
 
412
- var functionUncurryThis = bind ? function (fn) {
413
- return fn && callBind(call$3, fn);
799
+ var functionUncurryThis = NATIVE_BIND ? function (fn) {
800
+ return fn && uncurryThis$a(fn);
414
801
  } : function (fn) {
415
802
  return fn && function () {
416
803
  return call$3.apply(fn, arguments);
417
804
  };
418
805
  };
419
806
 
420
- var uncurryThis$a = functionUncurryThis;
807
+ var uncurryThis$9 = functionUncurryThis;
421
808
 
422
- var toString$4 = uncurryThis$a({}.toString);
423
- var stringSlice = uncurryThis$a(''.slice);
809
+ var toString$3 = uncurryThis$9({}.toString);
810
+ var stringSlice$1 = uncurryThis$9(''.slice);
424
811
 
425
812
  var classofRaw$1 = function (it) {
426
- return stringSlice(toString$4(it), 8, -1);
813
+ return stringSlice$1(toString$3(it), 8, -1);
427
814
  };
428
815
 
429
816
  var global$n = global$o;
430
- var uncurryThis$9 = functionUncurryThis;
431
- var fails$4 = fails$6;
817
+ var uncurryThis$8 = functionUncurryThis;
818
+ var fails$4 = fails$7;
432
819
  var classof$2 = classofRaw$1;
433
820
 
434
821
  var Object$4 = global$n.Object;
435
- var split = uncurryThis$9(''.split);
822
+ var split = uncurryThis$8(''.split);
436
823
 
437
824
  // fallback for non-array-like ES3 and non-enumerable old V8 strings
438
825
  var indexedObject = fails$4(function () {
@@ -449,45 +836,45 @@
449
836
 
450
837
  // `RequireObjectCoercible` abstract operation
451
838
  // https://tc39.es/ecma262/#sec-requireobjectcoercible
452
- var requireObjectCoercible$3 = function (it) {
839
+ var requireObjectCoercible$2 = function (it) {
453
840
  if (it == undefined) throw TypeError$7("Can't call method on " + it);
454
841
  return it;
455
842
  };
456
843
 
457
844
  // toObject with fallback for non-array-like ES3 strings
458
845
  var IndexedObject = indexedObject;
459
- var requireObjectCoercible$2 = requireObjectCoercible$3;
846
+ var requireObjectCoercible$1 = requireObjectCoercible$2;
460
847
 
461
848
  var toIndexedObject$3 = function (it) {
462
- return IndexedObject(requireObjectCoercible$2(it));
849
+ return IndexedObject(requireObjectCoercible$1(it));
463
850
  };
464
851
 
465
852
  // `IsCallable` abstract operation
466
853
  // https://tc39.es/ecma262/#sec-iscallable
467
- var isCallable$a = function (argument) {
854
+ var isCallable$b = function (argument) {
468
855
  return typeof argument == 'function';
469
856
  };
470
857
 
471
- var isCallable$9 = isCallable$a;
858
+ var isCallable$a = isCallable$b;
472
859
 
473
860
  var isObject$5 = function (it) {
474
- return typeof it == 'object' ? it !== null : isCallable$9(it);
861
+ return typeof it == 'object' ? it !== null : isCallable$a(it);
475
862
  };
476
863
 
477
864
  var global$l = global$o;
478
- var isCallable$8 = isCallable$a;
865
+ var isCallable$9 = isCallable$b;
479
866
 
480
867
  var aFunction = function (argument) {
481
- return isCallable$8(argument) ? argument : undefined;
868
+ return isCallable$9(argument) ? argument : undefined;
482
869
  };
483
870
 
484
871
  var getBuiltIn$3 = function (namespace, method) {
485
872
  return arguments.length < 2 ? aFunction(global$l[namespace]) : global$l[namespace] && global$l[namespace][method];
486
873
  };
487
874
 
488
- var uncurryThis$8 = functionUncurryThis;
875
+ var uncurryThis$7 = functionUncurryThis;
489
876
 
490
- var objectIsPrototypeOf = uncurryThis$8({}.isPrototypeOf);
877
+ var objectIsPrototypeOf = uncurryThis$7({}.isPrototypeOf);
491
878
 
492
879
  var getBuiltIn$2 = getBuiltIn$3;
493
880
 
@@ -524,7 +911,7 @@
524
911
  /* eslint-disable es/no-symbol -- required for testing */
525
912
 
526
913
  var V8_VERSION = engineV8Version;
527
- var fails$3 = fails$6;
914
+ var fails$3 = fails$7;
528
915
 
529
916
  // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
530
917
  var nativeSymbol = !!Object.getOwnPropertySymbols && !fails$3(function () {
@@ -538,16 +925,16 @@
538
925
 
539
926
  /* eslint-disable es/no-symbol -- required for testing */
540
927
 
541
- var NATIVE_SYMBOL$1 = nativeSymbol;
928
+ var NATIVE_SYMBOL$2 = nativeSymbol;
542
929
 
543
- var useSymbolAsUid = NATIVE_SYMBOL$1
930
+ var useSymbolAsUid = NATIVE_SYMBOL$2
544
931
  && !Symbol.sham
545
932
  && typeof Symbol.iterator == 'symbol';
546
933
 
547
934
  var global$j = global$o;
548
935
  var getBuiltIn$1 = getBuiltIn$3;
549
- var isCallable$7 = isCallable$a;
550
- var isPrototypeOf = objectIsPrototypeOf;
936
+ var isCallable$8 = isCallable$b;
937
+ var isPrototypeOf$1 = objectIsPrototypeOf;
551
938
  var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
552
939
 
553
940
  var Object$3 = global$j.Object;
@@ -556,7 +943,7 @@
556
943
  return typeof it == 'symbol';
557
944
  } : function (it) {
558
945
  var $Symbol = getBuiltIn$1('Symbol');
559
- return isCallable$7($Symbol) && isPrototypeOf($Symbol.prototype, Object$3(it));
946
+ return isCallable$8($Symbol) && isPrototypeOf$1($Symbol.prototype, Object$3(it));
560
947
  };
561
948
 
562
949
  var global$i = global$o;
@@ -572,14 +959,14 @@
572
959
  };
573
960
 
574
961
  var global$h = global$o;
575
- var isCallable$6 = isCallable$a;
962
+ var isCallable$7 = isCallable$b;
576
963
  var tryToString = tryToString$1;
577
964
 
578
965
  var TypeError$6 = global$h.TypeError;
579
966
 
580
967
  // `Assert: IsCallable(argument) is true`
581
968
  var aCallable$1 = function (argument) {
582
- if (isCallable$6(argument)) return argument;
969
+ if (isCallable$7(argument)) return argument;
583
970
  throw TypeError$6(tryToString(argument) + ' is not a function');
584
971
  };
585
972
 
@@ -594,7 +981,7 @@
594
981
 
595
982
  var global$g = global$o;
596
983
  var call$2 = functionCall;
597
- var isCallable$5 = isCallable$a;
984
+ var isCallable$6 = isCallable$b;
598
985
  var isObject$4 = isObject$5;
599
986
 
600
987
  var TypeError$5 = global$g.TypeError;
@@ -603,9 +990,9 @@
603
990
  // https://tc39.es/ecma262/#sec-ordinarytoprimitive
604
991
  var ordinaryToPrimitive$1 = function (input, pref) {
605
992
  var fn, val;
606
- if (pref === 'string' && isCallable$5(fn = input.toString) && !isObject$4(val = call$2(fn, input))) return val;
607
- if (isCallable$5(fn = input.valueOf) && !isObject$4(val = call$2(fn, input))) return val;
608
- if (pref !== 'string' && isCallable$5(fn = input.toString) && !isObject$4(val = call$2(fn, input))) return val;
993
+ if (pref === 'string' && isCallable$6(fn = input.toString) && !isObject$4(val = call$2(fn, input))) return val;
994
+ if (isCallable$6(fn = input.valueOf) && !isObject$4(val = call$2(fn, input))) return val;
995
+ if (pref !== 'string' && isCallable$6(fn = input.toString) && !isObject$4(val = call$2(fn, input))) return val;
609
996
  throw TypeError$5("Can't convert object to primitive value");
610
997
  };
611
998
 
@@ -614,11 +1001,11 @@
614
1001
  var global$f = global$o;
615
1002
 
616
1003
  // eslint-disable-next-line es/no-object-defineproperty -- safe
617
- var defineProperty = Object.defineProperty;
1004
+ var defineProperty$1 = Object.defineProperty;
618
1005
 
619
1006
  var setGlobal$3 = function (key, value) {
620
1007
  try {
621
- defineProperty(global$f, key, { value: value, configurable: true, writable: true });
1008
+ defineProperty$1(global$f, key, { value: value, configurable: true, writable: true });
622
1009
  } catch (error) {
623
1010
  global$f[key] = value;
624
1011
  } return value;
@@ -637,26 +1024,28 @@
637
1024
  (shared$3.exports = function (key, value) {
638
1025
  return store$2[key] || (store$2[key] = value !== undefined ? value : {});
639
1026
  })('versions', []).push({
640
- version: '3.19.3',
1027
+ version: '3.21.1',
641
1028
  mode: 'global',
642
- copyright: '© 2021 Denis Pushkarev (zloirock.ru)'
1029
+ copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
1030
+ license: 'https://github.com/zloirock/core-js/blob/v3.21.1/LICENSE',
1031
+ source: 'https://github.com/zloirock/core-js'
643
1032
  });
644
1033
 
645
1034
  var global$d = global$o;
646
- var requireObjectCoercible$1 = requireObjectCoercible$3;
1035
+ var requireObjectCoercible = requireObjectCoercible$2;
647
1036
 
648
1037
  var Object$2 = global$d.Object;
649
1038
 
650
1039
  // `ToObject` abstract operation
651
1040
  // https://tc39.es/ecma262/#sec-toobject
652
1041
  var toObject$1 = function (argument) {
653
- return Object$2(requireObjectCoercible$1(argument));
1042
+ return Object$2(requireObjectCoercible(argument));
654
1043
  };
655
1044
 
656
- var uncurryThis$7 = functionUncurryThis;
1045
+ var uncurryThis$6 = functionUncurryThis;
657
1046
  var toObject = toObject$1;
658
1047
 
659
- var hasOwnProperty = uncurryThis$7({}.hasOwnProperty);
1048
+ var hasOwnProperty = uncurryThis$6({}.hasOwnProperty);
660
1049
 
661
1050
  // `HasOwnProperty` abstract operation
662
1051
  // https://tc39.es/ecma262/#sec-hasownproperty
@@ -664,33 +1053,33 @@
664
1053
  return hasOwnProperty(toObject(it), key);
665
1054
  };
666
1055
 
667
- var uncurryThis$6 = functionUncurryThis;
1056
+ var uncurryThis$5 = functionUncurryThis;
668
1057
 
669
1058
  var id = 0;
670
1059
  var postfix = Math.random();
671
- var toString$3 = uncurryThis$6(1.0.toString);
1060
+ var toString$2 = uncurryThis$5(1.0.toString);
672
1061
 
673
1062
  var uid$2 = function (key) {
674
- return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$3(++id + postfix, 36);
1063
+ return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$2(++id + postfix, 36);
675
1064
  };
676
1065
 
677
1066
  var global$c = global$o;
678
1067
  var shared$2 = shared$3.exports;
679
- var hasOwn$6 = hasOwnProperty_1;
1068
+ var hasOwn$7 = hasOwnProperty_1;
680
1069
  var uid$1 = uid$2;
681
- var NATIVE_SYMBOL = nativeSymbol;
1070
+ var NATIVE_SYMBOL$1 = nativeSymbol;
682
1071
  var USE_SYMBOL_AS_UID = useSymbolAsUid;
683
1072
 
684
1073
  var WellKnownSymbolsStore = shared$2('wks');
685
- var Symbol$2 = global$c.Symbol;
686
- var symbolFor = Symbol$2 && Symbol$2['for'];
687
- var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$2 : Symbol$2 && Symbol$2.withoutSetter || uid$1;
1074
+ var Symbol$1 = global$c.Symbol;
1075
+ var symbolFor = Symbol$1 && Symbol$1['for'];
1076
+ var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
688
1077
 
689
1078
  var wellKnownSymbol$3 = function (name) {
690
- if (!hasOwn$6(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {
1079
+ if (!hasOwn$7(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL$1 || typeof WellKnownSymbolsStore[name] == 'string')) {
691
1080
  var description = 'Symbol.' + name;
692
- if (NATIVE_SYMBOL && hasOwn$6(Symbol$2, name)) {
693
- WellKnownSymbolsStore[name] = Symbol$2[name];
1081
+ if (NATIVE_SYMBOL$1 && hasOwn$7(Symbol$1, name)) {
1082
+ WellKnownSymbolsStore[name] = Symbol$1[name];
694
1083
  } else if (USE_SYMBOL_AS_UID && symbolFor) {
695
1084
  WellKnownSymbolsStore[name] = symbolFor(description);
696
1085
  } else {
@@ -747,43 +1136,56 @@
747
1136
  return EXISTS$1 ? document.createElement(it) : {};
748
1137
  };
749
1138
 
750
- var DESCRIPTORS$4 = descriptors;
751
- var fails$2 = fails$6;
1139
+ var DESCRIPTORS$6 = descriptors;
1140
+ var fails$2 = fails$7;
752
1141
  var createElement = documentCreateElement;
753
1142
 
754
- // Thank's IE8 for his funny defineProperty
755
- var ie8DomDefine = !DESCRIPTORS$4 && !fails$2(function () {
756
- // eslint-disable-next-line es/no-object-defineproperty -- requied for testing
1143
+ // Thanks to IE8 for its funny defineProperty
1144
+ var ie8DomDefine = !DESCRIPTORS$6 && !fails$2(function () {
1145
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
757
1146
  return Object.defineProperty(createElement('div'), 'a', {
758
1147
  get: function () { return 7; }
759
1148
  }).a != 7;
760
1149
  });
761
1150
 
762
- var DESCRIPTORS$3 = descriptors;
1151
+ var DESCRIPTORS$5 = descriptors;
763
1152
  var call = functionCall;
764
1153
  var propertyIsEnumerableModule = objectPropertyIsEnumerable;
765
1154
  var createPropertyDescriptor$1 = createPropertyDescriptor$2;
766
1155
  var toIndexedObject$2 = toIndexedObject$3;
767
1156
  var toPropertyKey$1 = toPropertyKey$2;
768
- var hasOwn$5 = hasOwnProperty_1;
1157
+ var hasOwn$6 = hasOwnProperty_1;
769
1158
  var IE8_DOM_DEFINE$1 = ie8DomDefine;
770
1159
 
771
1160
  // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
772
- var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
1161
+ var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
773
1162
 
774
1163
  // `Object.getOwnPropertyDescriptor` method
775
1164
  // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
776
- objectGetOwnPropertyDescriptor.f = DESCRIPTORS$3 ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
1165
+ objectGetOwnPropertyDescriptor.f = DESCRIPTORS$5 ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
777
1166
  O = toIndexedObject$2(O);
778
1167
  P = toPropertyKey$1(P);
779
1168
  if (IE8_DOM_DEFINE$1) try {
780
- return $getOwnPropertyDescriptor(O, P);
1169
+ return $getOwnPropertyDescriptor$1(O, P);
781
1170
  } catch (error) { /* empty */ }
782
- if (hasOwn$5(O, P)) return createPropertyDescriptor$1(!call(propertyIsEnumerableModule.f, O, P), O[P]);
1171
+ if (hasOwn$6(O, P)) return createPropertyDescriptor$1(!call(propertyIsEnumerableModule.f, O, P), O[P]);
783
1172
  };
784
1173
 
785
1174
  var objectDefineProperty = {};
786
1175
 
1176
+ var DESCRIPTORS$4 = descriptors;
1177
+ var fails$1 = fails$7;
1178
+
1179
+ // V8 ~ Chrome 36-
1180
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3334
1181
+ var v8PrototypeDefineBug = DESCRIPTORS$4 && fails$1(function () {
1182
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
1183
+ return Object.defineProperty(function () { /* empty */ }, 'prototype', {
1184
+ value: 42,
1185
+ writable: false
1186
+ }).prototype != 42;
1187
+ });
1188
+
787
1189
  var global$9 = global$o;
788
1190
  var isObject$1 = isObject$5;
789
1191
 
@@ -797,18 +1199,39 @@
797
1199
  };
798
1200
 
799
1201
  var global$8 = global$o;
800
- var DESCRIPTORS$2 = descriptors;
1202
+ var DESCRIPTORS$3 = descriptors;
801
1203
  var IE8_DOM_DEFINE = ie8DomDefine;
1204
+ var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
802
1205
  var anObject$1 = anObject$2;
803
1206
  var toPropertyKey = toPropertyKey$2;
804
1207
 
805
1208
  var TypeError$2 = global$8.TypeError;
806
1209
  // eslint-disable-next-line es/no-object-defineproperty -- safe
807
1210
  var $defineProperty = Object.defineProperty;
1211
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1212
+ var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
1213
+ var ENUMERABLE = 'enumerable';
1214
+ var CONFIGURABLE$1 = 'configurable';
1215
+ var WRITABLE = 'writable';
808
1216
 
809
1217
  // `Object.defineProperty` method
810
1218
  // https://tc39.es/ecma262/#sec-object.defineproperty
811
- objectDefineProperty.f = DESCRIPTORS$2 ? $defineProperty : function defineProperty(O, P, Attributes) {
1219
+ objectDefineProperty.f = DESCRIPTORS$3 ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {
1220
+ anObject$1(O);
1221
+ P = toPropertyKey(P);
1222
+ anObject$1(Attributes);
1223
+ if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
1224
+ var current = $getOwnPropertyDescriptor(O, P);
1225
+ if (current && current[WRITABLE]) {
1226
+ O[P] = Attributes.value;
1227
+ Attributes = {
1228
+ configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
1229
+ enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
1230
+ writable: false
1231
+ };
1232
+ }
1233
+ } return $defineProperty(O, P, Attributes);
1234
+ } : $defineProperty : function defineProperty(O, P, Attributes) {
812
1235
  anObject$1(O);
813
1236
  P = toPropertyKey(P);
814
1237
  anObject$1(Attributes);
@@ -820,11 +1243,11 @@
820
1243
  return O;
821
1244
  };
822
1245
 
823
- var DESCRIPTORS$1 = descriptors;
1246
+ var DESCRIPTORS$2 = descriptors;
824
1247
  var definePropertyModule$1 = objectDefineProperty;
825
1248
  var createPropertyDescriptor = createPropertyDescriptor$2;
826
1249
 
827
- var createNonEnumerableProperty$3 = DESCRIPTORS$1 ? function (object, key, value) {
1250
+ var createNonEnumerableProperty$3 = DESCRIPTORS$2 ? function (object, key, value) {
828
1251
  return definePropertyModule$1.f(object, key, createPropertyDescriptor(1, value));
829
1252
  } : function (object, key, value) {
830
1253
  object[key] = value;
@@ -833,14 +1256,14 @@
833
1256
 
834
1257
  var redefine$1 = {exports: {}};
835
1258
 
836
- var uncurryThis$5 = functionUncurryThis;
837
- var isCallable$4 = isCallable$a;
1259
+ var uncurryThis$4 = functionUncurryThis;
1260
+ var isCallable$5 = isCallable$b;
838
1261
  var store$1 = sharedStore;
839
1262
 
840
- var functionToString = uncurryThis$5(Function.toString);
1263
+ var functionToString = uncurryThis$4(Function.toString);
841
1264
 
842
1265
  // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
843
- if (!isCallable$4(store$1.inspectSource)) {
1266
+ if (!isCallable$5(store$1.inspectSource)) {
844
1267
  store$1.inspectSource = function (it) {
845
1268
  return functionToString(it);
846
1269
  };
@@ -849,12 +1272,12 @@
849
1272
  var inspectSource$2 = store$1.inspectSource;
850
1273
 
851
1274
  var global$7 = global$o;
852
- var isCallable$3 = isCallable$a;
1275
+ var isCallable$4 = isCallable$b;
853
1276
  var inspectSource$1 = inspectSource$2;
854
1277
 
855
1278
  var WeakMap$1 = global$7.WeakMap;
856
1279
 
857
- var nativeWeakMap = isCallable$3(WeakMap$1) && /native code/.test(inspectSource$1(WeakMap$1));
1280
+ var nativeWeakMap = isCallable$4(WeakMap$1) && /native code/.test(inspectSource$1(WeakMap$1));
858
1281
 
859
1282
  var shared$1 = shared$3.exports;
860
1283
  var uid = uid$2;
@@ -869,10 +1292,10 @@
869
1292
 
870
1293
  var NATIVE_WEAK_MAP = nativeWeakMap;
871
1294
  var global$6 = global$o;
872
- var uncurryThis$4 = functionUncurryThis;
1295
+ var uncurryThis$3 = functionUncurryThis;
873
1296
  var isObject = isObject$5;
874
1297
  var createNonEnumerableProperty$2 = createNonEnumerableProperty$3;
875
- var hasOwn$4 = hasOwnProperty_1;
1298
+ var hasOwn$5 = hasOwnProperty_1;
876
1299
  var shared = sharedStore;
877
1300
  var sharedKey = sharedKey$1;
878
1301
  var hiddenKeys$2 = hiddenKeys$3;
@@ -897,9 +1320,9 @@
897
1320
 
898
1321
  if (NATIVE_WEAK_MAP || shared.state) {
899
1322
  var store = shared.state || (shared.state = new WeakMap());
900
- var wmget = uncurryThis$4(store.get);
901
- var wmhas = uncurryThis$4(store.has);
902
- var wmset = uncurryThis$4(store.set);
1323
+ var wmget = uncurryThis$3(store.get);
1324
+ var wmhas = uncurryThis$3(store.has);
1325
+ var wmset = uncurryThis$3(store.set);
903
1326
  set = function (it, metadata) {
904
1327
  if (wmhas(store, it)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);
905
1328
  metadata.facade = it;
@@ -916,16 +1339,16 @@
916
1339
  var STATE = sharedKey('state');
917
1340
  hiddenKeys$2[STATE] = true;
918
1341
  set = function (it, metadata) {
919
- if (hasOwn$4(it, STATE)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);
1342
+ if (hasOwn$5(it, STATE)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);
920
1343
  metadata.facade = it;
921
1344
  createNonEnumerableProperty$2(it, STATE, metadata);
922
1345
  return metadata;
923
1346
  };
924
1347
  get = function (it) {
925
- return hasOwn$4(it, STATE) ? it[STATE] : {};
1348
+ return hasOwn$5(it, STATE) ? it[STATE] : {};
926
1349
  };
927
1350
  has = function (it) {
928
- return hasOwn$4(it, STATE);
1351
+ return hasOwn$5(it, STATE);
929
1352
  };
930
1353
  }
931
1354
 
@@ -937,17 +1360,17 @@
937
1360
  getterFor: getterFor
938
1361
  };
939
1362
 
940
- var DESCRIPTORS = descriptors;
941
- var hasOwn$3 = hasOwnProperty_1;
1363
+ var DESCRIPTORS$1 = descriptors;
1364
+ var hasOwn$4 = hasOwnProperty_1;
942
1365
 
943
1366
  var FunctionPrototype = Function.prototype;
944
1367
  // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
945
- var getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor;
1368
+ var getDescriptor = DESCRIPTORS$1 && Object.getOwnPropertyDescriptor;
946
1369
 
947
- var EXISTS = hasOwn$3(FunctionPrototype, 'name');
1370
+ var EXISTS = hasOwn$4(FunctionPrototype, 'name');
948
1371
  // additional protection from minified / mangled / dropped function names
949
1372
  var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
950
- var CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable));
1373
+ var CONFIGURABLE = EXISTS && (!DESCRIPTORS$1 || (DESCRIPTORS$1 && getDescriptor(FunctionPrototype, 'name').configurable));
951
1374
 
952
1375
  var functionName = {
953
1376
  EXISTS: EXISTS,
@@ -956,8 +1379,8 @@
956
1379
  };
957
1380
 
958
1381
  var global$5 = global$o;
959
- var isCallable$2 = isCallable$a;
960
- var hasOwn$2 = hasOwnProperty_1;
1382
+ var isCallable$3 = isCallable$b;
1383
+ var hasOwn$3 = hasOwnProperty_1;
961
1384
  var createNonEnumerableProperty$1 = createNonEnumerableProperty$3;
962
1385
  var setGlobal$1 = setGlobal$3;
963
1386
  var inspectSource = inspectSource$2;
@@ -974,11 +1397,11 @@
974
1397
  var noTargetGet = options ? !!options.noTargetGet : false;
975
1398
  var name = options && options.name !== undefined ? options.name : key;
976
1399
  var state;
977
- if (isCallable$2(value)) {
1400
+ if (isCallable$3(value)) {
978
1401
  if (String(name).slice(0, 7) === 'Symbol(') {
979
1402
  name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
980
1403
  }
981
- if (!hasOwn$2(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
1404
+ if (!hasOwn$3(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
982
1405
  createNonEnumerableProperty$1(value, 'name', name);
983
1406
  }
984
1407
  state = enforceInternalState(value);
@@ -999,7 +1422,7 @@
999
1422
  else createNonEnumerableProperty$1(O, key, value);
1000
1423
  // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
1001
1424
  })(Function.prototype, 'toString', function toString() {
1002
- return isCallable$2(this) && getInternalState(this).source || inspectSource(this);
1425
+ return isCallable$3(this) && getInternalState(this).source || inspectSource(this);
1003
1426
  });
1004
1427
 
1005
1428
  var objectGetOwnPropertyNames = {};
@@ -1051,7 +1474,7 @@
1051
1474
  var lengthOfArrayLike = lengthOfArrayLike$1;
1052
1475
 
1053
1476
  // `Array.prototype.{ indexOf, includes }` methods implementation
1054
- var createMethod$1 = function (IS_INCLUDES) {
1477
+ var createMethod = function (IS_INCLUDES) {
1055
1478
  return function ($this, el, fromIndex) {
1056
1479
  var O = toIndexedObject$1($this);
1057
1480
  var length = lengthOfArrayLike(O);
@@ -1073,28 +1496,28 @@
1073
1496
  var arrayIncludes = {
1074
1497
  // `Array.prototype.includes` method
1075
1498
  // https://tc39.es/ecma262/#sec-array.prototype.includes
1076
- includes: createMethod$1(true),
1499
+ includes: createMethod(true),
1077
1500
  // `Array.prototype.indexOf` method
1078
1501
  // https://tc39.es/ecma262/#sec-array.prototype.indexof
1079
- indexOf: createMethod$1(false)
1502
+ indexOf: createMethod(false)
1080
1503
  };
1081
1504
 
1082
- var uncurryThis$3 = functionUncurryThis;
1083
- var hasOwn$1 = hasOwnProperty_1;
1505
+ var uncurryThis$2 = functionUncurryThis;
1506
+ var hasOwn$2 = hasOwnProperty_1;
1084
1507
  var toIndexedObject = toIndexedObject$3;
1085
1508
  var indexOf = arrayIncludes.indexOf;
1086
1509
  var hiddenKeys$1 = hiddenKeys$3;
1087
1510
 
1088
- var push = uncurryThis$3([].push);
1511
+ var push = uncurryThis$2([].push);
1089
1512
 
1090
1513
  var objectKeysInternal = function (object, names) {
1091
1514
  var O = toIndexedObject(object);
1092
1515
  var i = 0;
1093
1516
  var result = [];
1094
1517
  var key;
1095
- for (key in O) !hasOwn$1(hiddenKeys$1, key) && hasOwn$1(O, key) && push(result, key);
1518
+ for (key in O) !hasOwn$2(hiddenKeys$1, key) && hasOwn$2(O, key) && push(result, key);
1096
1519
  // Don't enum bug & hidden keys
1097
- while (names.length > i) if (hasOwn$1(O, key = names[i++])) {
1520
+ while (names.length > i) if (hasOwn$2(O, key = names[i++])) {
1098
1521
  ~indexOf(result, key) || push(result, key);
1099
1522
  }
1100
1523
  return result;
@@ -1129,12 +1552,12 @@
1129
1552
  objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
1130
1553
 
1131
1554
  var getBuiltIn = getBuiltIn$3;
1132
- var uncurryThis$2 = functionUncurryThis;
1555
+ var uncurryThis$1 = functionUncurryThis;
1133
1556
  var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
1134
1557
  var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
1135
1558
  var anObject = anObject$2;
1136
1559
 
1137
- var concat = uncurryThis$2([].concat);
1560
+ var concat = uncurryThis$1([].concat);
1138
1561
 
1139
1562
  // all object keys, includes non-enumerable and symbols
1140
1563
  var ownKeys$1 = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
@@ -1143,23 +1566,25 @@
1143
1566
  return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
1144
1567
  };
1145
1568
 
1146
- var hasOwn = hasOwnProperty_1;
1569
+ var hasOwn$1 = hasOwnProperty_1;
1147
1570
  var ownKeys = ownKeys$1;
1148
1571
  var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
1149
1572
  var definePropertyModule = objectDefineProperty;
1150
1573
 
1151
- var copyConstructorProperties$1 = function (target, source) {
1574
+ var copyConstructorProperties$2 = function (target, source, exceptions) {
1152
1575
  var keys = ownKeys(source);
1153
1576
  var defineProperty = definePropertyModule.f;
1154
1577
  var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
1155
1578
  for (var i = 0; i < keys.length; i++) {
1156
1579
  var key = keys[i];
1157
- if (!hasOwn(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
1580
+ if (!hasOwn$1(target, key) && !(exceptions && hasOwn$1(exceptions, key))) {
1581
+ defineProperty(target, key, getOwnPropertyDescriptor(source, key));
1582
+ }
1158
1583
  }
1159
1584
  };
1160
1585
 
1161
- var fails$1 = fails$6;
1162
- var isCallable$1 = isCallable$a;
1586
+ var fails = fails$7;
1587
+ var isCallable$2 = isCallable$b;
1163
1588
 
1164
1589
  var replacement = /#|\.prototype\./;
1165
1590
 
@@ -1167,7 +1592,7 @@
1167
1592
  var value = data[normalize(feature)];
1168
1593
  return value == POLYFILL ? true
1169
1594
  : value == NATIVE ? false
1170
- : isCallable$1(detection) ? fails$1(detection)
1595
+ : isCallable$2(detection) ? fails(detection)
1171
1596
  : !!detection;
1172
1597
  };
1173
1598
 
@@ -1186,7 +1611,7 @@
1186
1611
  var createNonEnumerableProperty = createNonEnumerableProperty$3;
1187
1612
  var redefine = redefine$1.exports;
1188
1613
  var setGlobal = setGlobal$3;
1189
- var copyConstructorProperties = copyConstructorProperties$1;
1614
+ var copyConstructorProperties$1 = copyConstructorProperties$2;
1190
1615
  var isForced = isForced_1;
1191
1616
 
1192
1617
  /*
@@ -1226,7 +1651,7 @@
1226
1651
  // contained in target
1227
1652
  if (!FORCED && targetProperty !== undefined) {
1228
1653
  if (typeof sourceProperty == typeof targetProperty) continue;
1229
- copyConstructorProperties(sourceProperty, targetProperty);
1654
+ copyConstructorProperties$1(sourceProperty, targetProperty);
1230
1655
  }
1231
1656
  // add a flag to not completely full polyfills
1232
1657
  if (options.sham || (targetProperty && targetProperty.sham)) {
@@ -1248,7 +1673,7 @@
1248
1673
 
1249
1674
  var global$3 = global$o;
1250
1675
  var TO_STRING_TAG_SUPPORT = toStringTagSupport;
1251
- var isCallable = isCallable$a;
1676
+ var isCallable$1 = isCallable$b;
1252
1677
  var classofRaw = classofRaw$1;
1253
1678
  var wellKnownSymbol = wellKnownSymbol$3;
1254
1679
 
@@ -1274,7 +1699,7 @@
1274
1699
  // builtinTag case
1275
1700
  : CORRECT_ARGUMENTS ? classofRaw(O)
1276
1701
  // ES3 arguments fallback
1277
- : (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;
1702
+ : (result = classofRaw(O)) == 'Object' && isCallable$1(O.callee) ? 'Arguments' : result;
1278
1703
  };
1279
1704
 
1280
1705
  var global$2 = global$o;
@@ -1282,207 +1707,135 @@
1282
1707
 
1283
1708
  var String$1 = global$2.String;
1284
1709
 
1285
- var toString$2 = function (argument) {
1710
+ var toString$1 = function (argument) {
1286
1711
  if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
1287
1712
  return String$1(argument);
1288
1713
  };
1289
1714
 
1290
- // a string of all valid unicode whitespaces
1291
- var whitespaces$2 = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
1292
- '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
1293
-
1294
- var uncurryThis$1 = functionUncurryThis;
1295
- var requireObjectCoercible = requireObjectCoercible$3;
1296
- var toString$1 = toString$2;
1297
- var whitespaces$1 = whitespaces$2;
1298
-
1299
- var replace = uncurryThis$1(''.replace);
1300
- var whitespace = '[' + whitespaces$1 + ']';
1301
- var ltrim = RegExp('^' + whitespace + whitespace + '*');
1302
- var rtrim = RegExp(whitespace + whitespace + '*$');
1303
-
1304
- // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
1305
- var createMethod = function (TYPE) {
1306
- return function ($this) {
1307
- var string = toString$1(requireObjectCoercible($this));
1308
- if (TYPE & 1) string = replace(string, ltrim, '');
1309
- if (TYPE & 2) string = replace(string, rtrim, '');
1310
- return string;
1311
- };
1312
- };
1313
-
1314
- var stringTrim = {
1315
- // `String.prototype.{ trimLeft, trimStart }` methods
1316
- // https://tc39.es/ecma262/#sec-string.prototype.trimstart
1317
- start: createMethod(1),
1318
- // `String.prototype.{ trimRight, trimEnd }` methods
1319
- // https://tc39.es/ecma262/#sec-string.prototype.trimend
1320
- end: createMethod(2),
1321
- // `String.prototype.trim` method
1322
- // https://tc39.es/ecma262/#sec-string.prototype.trim
1323
- trim: createMethod(3)
1324
- };
1325
-
1715
+ var $ = _export;
1716
+ var DESCRIPTORS = descriptors;
1326
1717
  var global$1 = global$o;
1327
- var fails = fails$6;
1328
1718
  var uncurryThis = functionUncurryThis;
1329
- var toString = toString$2;
1330
- var trim = stringTrim.trim;
1331
- var whitespaces = whitespaces$2;
1332
-
1333
- var $parseInt$1 = global$1.parseInt;
1334
- var Symbol$1 = global$1.Symbol;
1335
- var ITERATOR = Symbol$1 && Symbol$1.iterator;
1336
- var hex = /^[+-]?0x/i;
1337
- var exec = uncurryThis(hex.exec);
1338
- var FORCED = $parseInt$1(whitespaces + '08') !== 8 || $parseInt$1(whitespaces + '0x16') !== 22
1339
- // MS Edge 18- broken with boxed symbols
1340
- || (ITERATOR && !fails(function () { $parseInt$1(Object(ITERATOR)); }));
1341
-
1342
- // `parseInt` method
1343
- // https://tc39.es/ecma262/#sec-parseint-string-radix
1344
- var numberParseInt = FORCED ? function parseInt(string, radix) {
1345
- var S = trim(toString(string));
1346
- return $parseInt$1(S, (radix >>> 0) || (exec(hex, S) ? 16 : 10));
1347
- } : $parseInt$1;
1348
-
1349
- var $ = _export;
1350
- var $parseInt = numberParseInt;
1719
+ var hasOwn = hasOwnProperty_1;
1720
+ var isCallable = isCallable$b;
1721
+ var isPrototypeOf = objectIsPrototypeOf;
1722
+ var toString = toString$1;
1723
+ var defineProperty = objectDefineProperty.f;
1724
+ var copyConstructorProperties = copyConstructorProperties$2;
1725
+
1726
+ var NativeSymbol = global$1.Symbol;
1727
+ var SymbolPrototype = NativeSymbol && NativeSymbol.prototype;
1728
+
1729
+ if (DESCRIPTORS && isCallable(NativeSymbol) && (!('description' in SymbolPrototype) ||
1730
+ // Safari 12 bug
1731
+ NativeSymbol().description !== undefined
1732
+ )) {
1733
+ var EmptyStringDescriptionStore = {};
1734
+ // wrap Symbol constructor for correct work with undefined description
1735
+ var SymbolWrapper = function Symbol() {
1736
+ var description = arguments.length < 1 || arguments[0] === undefined ? undefined : toString(arguments[0]);
1737
+ var result = isPrototypeOf(SymbolPrototype, this)
1738
+ ? new NativeSymbol(description)
1739
+ // in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)'
1740
+ : description === undefined ? NativeSymbol() : NativeSymbol(description);
1741
+ if (description === '') EmptyStringDescriptionStore[result] = true;
1742
+ return result;
1743
+ };
1351
1744
 
1352
- // `parseInt` method
1353
- // https://tc39.es/ecma262/#sec-parseint-string-radix
1354
- $({ global: true, forced: parseInt != $parseInt }, {
1355
- parseInt: $parseInt
1356
- });
1745
+ copyConstructorProperties(SymbolWrapper, NativeSymbol);
1746
+ SymbolWrapper.prototype = SymbolPrototype;
1747
+ SymbolPrototype.constructor = SymbolWrapper;
1748
+
1749
+ var NATIVE_SYMBOL = String(NativeSymbol('test')) == 'Symbol(test)';
1750
+ var symbolToString = uncurryThis(SymbolPrototype.toString);
1751
+ var symbolValueOf = uncurryThis(SymbolPrototype.valueOf);
1752
+ var regexp = /^Symbol\((.*)\)[^)]+$/;
1753
+ var replace = uncurryThis(''.replace);
1754
+ var stringSlice = uncurryThis(''.slice);
1755
+
1756
+ defineProperty(SymbolPrototype, 'description', {
1757
+ configurable: true,
1758
+ get: function description() {
1759
+ var symbol = symbolValueOf(this);
1760
+ var string = symbolToString(symbol);
1761
+ if (hasOwn(EmptyStringDescriptionStore, symbol)) return '';
1762
+ var desc = NATIVE_SYMBOL ? stringSlice(string, 7, -1) : replace(string, regexp, '$1');
1763
+ return desc === '' ? undefined : desc;
1764
+ }
1765
+ });
1357
1766
 
1358
- var useInput = function useInput(props, evaluator, notify) {
1359
- var id = React.useMemo(function () {
1360
- return props.id || extract.randomId();
1361
- }, [props.id]);
1362
- var ref = React.useRef(null);
1767
+ $({ global: true, forced: true }, {
1768
+ Symbol: SymbolWrapper
1769
+ });
1770
+ }
1363
1771
 
1364
- var _a = React.useState(props.value),
1365
- value = _a[0],
1366
- setValue = _a[1];
1772
+ var RadioGroup = function RadioGroup(_a) {
1773
+ var description = _a.description,
1774
+ title = _a.title,
1775
+ validator = _a.validator,
1776
+ onChangeRadio = _a.onChangeRadio,
1777
+ onChange = _a.onChange,
1778
+ name = _a.name,
1779
+ children = _a.children;
1367
1780
 
1368
- var _b = React.useState(props.checked),
1781
+ var _b = React__default["default"].useState(),
1369
1782
  checked = _b[0],
1370
1783
  setChecked = _b[1];
1371
1784
 
1372
- React.useEffect(function () {
1373
- if (ref.current && ref.current.form) {
1374
- var resetListener_1 = function resetListener_1() {
1375
- setValue(props.value);
1376
- setChecked(props.checked);
1785
+ var validatorClassName = extract.validateClassName(validator === null || validator === void 0 ? void 0 : validator.indicator);
1786
+
1787
+ var onChanges = function onChanges(event) {
1788
+ setChecked(event.target.value);
1789
+ onChangeRadio && onChangeRadio(event.target.value);
1790
+ onChange && onChange(event);
1791
+ };
1792
+
1793
+ var radioBtnRef = React__default["default"].useRef(null);
1794
+ React__default["default"].useEffect(function () {
1795
+ var _a;
1796
+
1797
+ if (radioBtnRef && radioBtnRef.current) {
1798
+ var form_1 = (_a = radioBtnRef === null || radioBtnRef === void 0 ? void 0 : radioBtnRef.current) === null || _a === void 0 ? void 0 : _a.form;
1799
+
1800
+ var resetListner_1 = function resetListner_1() {
1801
+ setChecked(undefined);
1377
1802
  };
1378
1803
 
1379
- var form_1 = ref.current.form;
1380
- form_1.addEventListener('reset', resetListener_1);
1804
+ form_1 === null || form_1 === void 0 ? void 0 : form_1.addEventListener('reset', resetListner_1);
1381
1805
  return function () {
1382
- return form_1.removeEventListener('reset', resetListener_1);
1806
+ return form_1 === null || form_1 === void 0 ? void 0 : form_1.removeEventListener('reset', resetListner_1);
1383
1807
  };
1384
1808
  } else {
1385
1809
  // eslint-disable-next-line @typescript-eslint/no-empty-function
1386
1810
  return function () {};
1387
1811
  }
1388
- }, [props]);
1389
-
1390
- var onChange = function onChange(event) {
1391
- setValue(event.target.value);
1392
- setChecked(event.target.checked);
1393
- if (notify) notify(evaluator(event.target));
1394
- };
1395
-
1396
- return __assign(__assign({}, props), {
1397
- id: id,
1398
- ref: ref,
1399
- value: value,
1400
- checked: checked,
1401
- onChange: onChange
1402
- });
1403
- };
1404
-
1405
- var RenderInput = function RenderInput(type, props, evaluator, label, info, listener) {
1406
- var _a = useInput(props, evaluator, listener),
1407
- value = _a.value,
1408
- inputProps = __rest(_a, ["value"]);
1409
-
1410
- var propsWithDescription = info ? __assign(__assign({}, inputProps), {
1411
- 'aria-describedby': "".concat(inputProps.id, "_info")
1412
- }) : inputProps;
1812
+ }, []);
1413
1813
  return jsxRuntime.jsxs("div", __assign({
1414
- className: "form-field"
1814
+ className: "form-group"
1415
1815
  }, {
1416
- children: [label && jsxRuntime.jsx("label", __assign({
1417
- htmlFor: inputProps.id
1816
+ children: [jsxRuntime.jsxs("fieldset", __assign({
1817
+ className: validatorClassName
1418
1818
  }, {
1419
- children: label
1420
- }), void 0), info && jsxRuntime.jsx("span", __assign({
1421
- className: "form-info",
1422
- id: "{inputProps.id}_info"
1819
+ children: [jsxRuntime.jsx("legend", {
1820
+ children: title
1821
+ }, void 0), jsxRuntime.jsx("span", __assign({
1822
+ className: "form-info"
1823
+ }, {
1824
+ children: description
1825
+ }), void 0), React__default["default"].Children.map(children, function (Child) {
1826
+ return /*#__PURE__*/React__default["default"].isValidElement(Child) ? /*#__PURE__*/React__default["default"].cloneElement(Child, {
1827
+ validator: validatorClassName,
1828
+ onChange: onChanges,
1829
+ checked: checked === Child.props.value,
1830
+ name: name,
1831
+ ref: radioBtnRef
1832
+ }) : Child;
1833
+ })]
1834
+ }), void 0), (validator === null || validator === void 0 ? void 0 : validator.message) && jsxRuntime.jsx("span", __assign({
1835
+ className: "form-info"
1423
1836
  }, {
1424
- children: info
1425
- }), void 0), jsxRuntime.jsx("input", __assign({
1426
- type: type,
1427
- value: value
1428
- }, propsWithDescription), void 0)]
1429
- }), void 0);
1430
- };
1431
-
1432
- var TextInput = function TextInput(_a) {
1433
- var label = _a.label,
1434
- info = _a.info,
1435
- onChangeText = _a.onChangeText,
1436
- props = __rest(_a, ["label", "info", "onChangeText"]);
1437
-
1438
- return RenderInput('text', props, function (e) {
1439
- return e.value;
1440
- }, label, info, onChangeText);
1441
- };
1442
- var EmailInput = function EmailInput(_a) {
1443
- var label = _a.label,
1444
- info = _a.info,
1445
- onChangeText = _a.onChangeText,
1446
- props = __rest(_a, ["label", "info", "onChangeText"]);
1447
-
1448
- return RenderInput('email', props, function (e) {
1449
- return e.value;
1450
- }, label, info, onChangeText);
1451
- };
1452
- var NumberInput = function NumberInput(_a) {
1453
- var label = _a.label,
1454
- info = _a.info,
1455
- onChangeText = _a.onChangeText,
1456
- props = __rest(_a, ["label", "info", "onChangeText"]);
1457
-
1458
- return RenderInput('number', props, function (e) {
1459
- return e.value.length ? parseInt(e.value, 10) : undefined;
1460
- }, label, info, onChangeText);
1461
- };
1462
- var Checkbox = function Checkbox(_a) {
1463
- var label = _a.label,
1464
- onChecked = _a.onChecked,
1465
- props = __rest(_a, ["label", "onChecked"]);
1466
-
1467
- var inputProps = useInput(props, function (e) {
1468
- return e.checked;
1469
- }, onChecked);
1470
- return jsxRuntime.jsxs("label", __assign({
1471
- htmlFor: inputProps.id,
1472
- className: "form-control"
1473
- }, {
1474
- children: [label, jsxRuntime.jsx("input", __assign({
1475
- type: "checkbox"
1476
- }, inputProps), void 0), jsxRuntime.jsx("span", {}, void 0)]
1477
- }), void 0);
1478
- };
1479
-
1480
- var Text = function Text(_a) {
1481
- var children = _a.children;
1482
- return jsxRuntime.jsx("span", __assign({
1483
- className: "form-text"
1484
- }, {
1485
- children: children
1837
+ children: validator === null || validator === void 0 ? void 0 : validator.message
1838
+ }), void 0)]
1486
1839
  }), void 0);
1487
1840
  };
1488
1841
 
@@ -1648,12 +2001,16 @@
1648
2001
  exports.EmailInput = EmailInput;
1649
2002
  exports.Flexbox = Flexbox;
1650
2003
  exports.Form = Form;
2004
+ exports.FormItems = FormItems;
1651
2005
  exports.Group = Group;
1652
2006
  exports.Link = Link;
1653
2007
  exports.List = List;
1654
2008
  exports.Modal = Modal;
1655
2009
  exports.Navbar = Navbar;
1656
2010
  exports.NumberInput = NumberInput;
2011
+ exports.RadioButton = RadioButton;
2012
+ exports.RadioGroup = RadioGroup;
2013
+ exports.RenderInput = RenderInput;
1657
2014
  exports.Text = Text;
1658
2015
  exports.TextInput = TextInput;
1659
2016