@sebgroup/green-react 1.0.0-beta.4 → 1.0.0-beta.7

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