@thecb/components 8.4.7-beta.5 → 8.4.8-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +1472 -560
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +2 -28
- package/dist/index.esm.js +1472 -560
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/index.d.ts +0 -1
- package/src/components/molecules/radio-group/index.d.ts +1 -1
- package/src/components/molecules/radio-section/RadioSection.js +123 -113
- package/src/constants/colors.js +2 -0
- package/src/types/common/index.ts +0 -1
- package/src/components/atoms/searchable-select/index.d.ts +0 -28
- package/src/types/common/SearchableSelectOption.ts +0 -4
package/dist/index.cjs.js
CHANGED
|
@@ -203,6 +203,63 @@ function _nonIterableRest() {
|
|
|
203
203
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
204
204
|
}
|
|
205
205
|
|
|
206
|
+
function _createForOfIteratorHelper(o, allowArrayLike) {
|
|
207
|
+
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
|
208
|
+
|
|
209
|
+
if (!it) {
|
|
210
|
+
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
211
|
+
if (it) o = it;
|
|
212
|
+
var i = 0;
|
|
213
|
+
|
|
214
|
+
var F = function () {};
|
|
215
|
+
|
|
216
|
+
return {
|
|
217
|
+
s: F,
|
|
218
|
+
n: function () {
|
|
219
|
+
if (i >= o.length) return {
|
|
220
|
+
done: true
|
|
221
|
+
};
|
|
222
|
+
return {
|
|
223
|
+
done: false,
|
|
224
|
+
value: o[i++]
|
|
225
|
+
};
|
|
226
|
+
},
|
|
227
|
+
e: function (e) {
|
|
228
|
+
throw e;
|
|
229
|
+
},
|
|
230
|
+
f: F
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
var normalCompletion = true,
|
|
238
|
+
didErr = false,
|
|
239
|
+
err;
|
|
240
|
+
return {
|
|
241
|
+
s: function () {
|
|
242
|
+
it = it.call(o);
|
|
243
|
+
},
|
|
244
|
+
n: function () {
|
|
245
|
+
var step = it.next();
|
|
246
|
+
normalCompletion = step.done;
|
|
247
|
+
return step;
|
|
248
|
+
},
|
|
249
|
+
e: function (e) {
|
|
250
|
+
didErr = true;
|
|
251
|
+
err = e;
|
|
252
|
+
},
|
|
253
|
+
f: function () {
|
|
254
|
+
try {
|
|
255
|
+
if (!normalCompletion && it.return != null) it.return();
|
|
256
|
+
} finally {
|
|
257
|
+
if (didErr) throw err;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
|
|
206
263
|
/*! *****************************************************************************
|
|
207
264
|
Copyright (c) Microsoft Corporation.
|
|
208
265
|
|
|
@@ -4997,6 +5054,8 @@ var BLACK_SQUEEZE = "#EAF2F7";
|
|
|
4997
5054
|
var GREY_CHATEAU = "#959CA8"; // CBS-500
|
|
4998
5055
|
|
|
4999
5056
|
var COOL_GREY_05 = "#fbfcfd"; // CBS-050
|
|
5057
|
+
|
|
5058
|
+
var MANATEE_GREY = "#878E9B"; // CB-60 (cool)
|
|
5000
5059
|
// BLUE
|
|
5001
5060
|
|
|
5002
5061
|
var CLOUDBURST_BLUE = "#26395c";
|
|
@@ -5131,6 +5190,7 @@ var colors = /*#__PURE__*/Object.freeze({
|
|
|
5131
5190
|
CHARADE_GREY: CHARADE_GREY,
|
|
5132
5191
|
GRECIAN_GREY: GRECIAN_GREY,
|
|
5133
5192
|
COOL_GREY_05: COOL_GREY_05,
|
|
5193
|
+
MANATEE_GREY: MANATEE_GREY,
|
|
5134
5194
|
BLACK_SQUEEZE: BLACK_SQUEEZE,
|
|
5135
5195
|
GREY_CHATEAU: GREY_CHATEAU,
|
|
5136
5196
|
CLOUDBURST_BLUE: CLOUDBURST_BLUE,
|
|
@@ -22402,7 +22462,7 @@ var check = function (it) {
|
|
|
22402
22462
|
|
|
22403
22463
|
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
|
|
22404
22464
|
var global_1 =
|
|
22405
|
-
// eslint-disable-next-line es
|
|
22465
|
+
// eslint-disable-next-line es/no-global-this -- safe
|
|
22406
22466
|
check(typeof globalThis == 'object' && globalThis) ||
|
|
22407
22467
|
check(typeof window == 'object' && window) ||
|
|
22408
22468
|
// eslint-disable-next-line no-restricted-globals -- safe
|
|
@@ -22421,12 +22481,12 @@ var fails = function (exec) {
|
|
|
22421
22481
|
|
|
22422
22482
|
// Detect IE8's incomplete defineProperty implementation
|
|
22423
22483
|
var descriptors = !fails(function () {
|
|
22424
|
-
// eslint-disable-next-line es
|
|
22484
|
+
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
22425
22485
|
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
|
|
22426
22486
|
});
|
|
22427
22487
|
|
|
22428
22488
|
var functionBindNative = !fails(function () {
|
|
22429
|
-
// eslint-disable-next-line es
|
|
22489
|
+
// eslint-disable-next-line es/no-function-prototype-bind -- safe
|
|
22430
22490
|
var test = (function () { /* empty */ }).bind();
|
|
22431
22491
|
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
22432
22492
|
return typeof test != 'function' || test.hasOwnProperty('prototype');
|
|
@@ -22439,7 +22499,7 @@ var functionCall = functionBindNative ? call.bind(call) : function () {
|
|
|
22439
22499
|
};
|
|
22440
22500
|
|
|
22441
22501
|
var $propertyIsEnumerable = {}.propertyIsEnumerable;
|
|
22442
|
-
// eslint-disable-next-line es
|
|
22502
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
22443
22503
|
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
22444
22504
|
|
|
22445
22505
|
// Nashorn ~ JDK8 bug
|
|
@@ -22466,25 +22526,29 @@ var createPropertyDescriptor = function (bitmap, value) {
|
|
|
22466
22526
|
};
|
|
22467
22527
|
|
|
22468
22528
|
var FunctionPrototype = Function.prototype;
|
|
22469
|
-
var bind$1 = FunctionPrototype.bind;
|
|
22470
22529
|
var call$1 = FunctionPrototype.call;
|
|
22471
|
-
var
|
|
22530
|
+
var uncurryThisWithBind = functionBindNative && FunctionPrototype.bind.bind(call$1, call$1);
|
|
22472
22531
|
|
|
22473
|
-
var
|
|
22474
|
-
return
|
|
22475
|
-
} : function (fn) {
|
|
22476
|
-
return fn && function () {
|
|
22532
|
+
var functionUncurryThisRaw = function (fn) {
|
|
22533
|
+
return functionBindNative ? uncurryThisWithBind(fn) : function () {
|
|
22477
22534
|
return call$1.apply(fn, arguments);
|
|
22478
22535
|
};
|
|
22479
22536
|
};
|
|
22480
22537
|
|
|
22481
|
-
var toString$2 =
|
|
22482
|
-
var stringSlice =
|
|
22538
|
+
var toString$2 = functionUncurryThisRaw({}.toString);
|
|
22539
|
+
var stringSlice = functionUncurryThisRaw(''.slice);
|
|
22483
22540
|
|
|
22484
22541
|
var classofRaw = function (it) {
|
|
22485
22542
|
return stringSlice(toString$2(it), 8, -1);
|
|
22486
22543
|
};
|
|
22487
22544
|
|
|
22545
|
+
var functionUncurryThis = function (fn) {
|
|
22546
|
+
// Nashorn bug:
|
|
22547
|
+
// https://github.com/zloirock/core-js/issues/1128
|
|
22548
|
+
// https://github.com/zloirock/core-js/issues/1130
|
|
22549
|
+
if (classofRaw(fn) === 'Function') return functionUncurryThisRaw(fn);
|
|
22550
|
+
};
|
|
22551
|
+
|
|
22488
22552
|
var $Object = Object;
|
|
22489
22553
|
var split = functionUncurryThis(''.split);
|
|
22490
22554
|
|
|
@@ -22497,12 +22561,18 @@ var indexedObject = fails(function () {
|
|
|
22497
22561
|
return classofRaw(it) == 'String' ? split(it, '') : $Object(it);
|
|
22498
22562
|
} : $Object;
|
|
22499
22563
|
|
|
22564
|
+
// we can't use just `it == null` since of `document.all` special case
|
|
22565
|
+
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
|
|
22566
|
+
var isNullOrUndefined = function (it) {
|
|
22567
|
+
return it === null || it === undefined;
|
|
22568
|
+
};
|
|
22569
|
+
|
|
22500
22570
|
var $TypeError = TypeError;
|
|
22501
22571
|
|
|
22502
22572
|
// `RequireObjectCoercible` abstract operation
|
|
22503
22573
|
// https://tc39.es/ecma262/#sec-requireobjectcoercible
|
|
22504
22574
|
var requireObjectCoercible = function (it) {
|
|
22505
|
-
if (it
|
|
22575
|
+
if (isNullOrUndefined(it)) throw $TypeError("Can't call method on " + it);
|
|
22506
22576
|
return it;
|
|
22507
22577
|
};
|
|
22508
22578
|
|
|
@@ -22514,13 +22584,31 @@ var toIndexedObject = function (it) {
|
|
|
22514
22584
|
return indexedObject(requireObjectCoercible(it));
|
|
22515
22585
|
};
|
|
22516
22586
|
|
|
22587
|
+
var documentAll = typeof document == 'object' && document.all;
|
|
22588
|
+
|
|
22589
|
+
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
|
|
22590
|
+
var IS_HTMLDDA = typeof documentAll == 'undefined' && documentAll !== undefined;
|
|
22591
|
+
|
|
22592
|
+
var documentAll_1 = {
|
|
22593
|
+
all: documentAll,
|
|
22594
|
+
IS_HTMLDDA: IS_HTMLDDA
|
|
22595
|
+
};
|
|
22596
|
+
|
|
22597
|
+
var documentAll$1 = documentAll_1.all;
|
|
22598
|
+
|
|
22517
22599
|
// `IsCallable` abstract operation
|
|
22518
22600
|
// https://tc39.es/ecma262/#sec-iscallable
|
|
22519
|
-
var isCallable = function (argument) {
|
|
22601
|
+
var isCallable = documentAll_1.IS_HTMLDDA ? function (argument) {
|
|
22602
|
+
return typeof argument == 'function' || argument === documentAll$1;
|
|
22603
|
+
} : function (argument) {
|
|
22520
22604
|
return typeof argument == 'function';
|
|
22521
22605
|
};
|
|
22522
22606
|
|
|
22523
|
-
var
|
|
22607
|
+
var documentAll$2 = documentAll_1.all;
|
|
22608
|
+
|
|
22609
|
+
var isObject = documentAll_1.IS_HTMLDDA ? function (it) {
|
|
22610
|
+
return typeof it == 'object' ? it !== null : isCallable(it) || it === documentAll$2;
|
|
22611
|
+
} : function (it) {
|
|
22524
22612
|
return typeof it == 'object' ? it !== null : isCallable(it);
|
|
22525
22613
|
};
|
|
22526
22614
|
|
|
@@ -22561,12 +22649,12 @@ if (!version && engineUserAgent) {
|
|
|
22561
22649
|
|
|
22562
22650
|
var engineV8Version = version;
|
|
22563
22651
|
|
|
22564
|
-
/* eslint-disable es
|
|
22652
|
+
/* eslint-disable es/no-symbol -- required for testing */
|
|
22565
22653
|
|
|
22566
22654
|
|
|
22567
22655
|
|
|
22568
|
-
// eslint-disable-next-line es
|
|
22569
|
-
var
|
|
22656
|
+
// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
|
|
22657
|
+
var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails(function () {
|
|
22570
22658
|
var symbol = Symbol();
|
|
22571
22659
|
// Chrome 38 Symbol has incorrect toString conversion
|
|
22572
22660
|
// `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
|
|
@@ -22575,10 +22663,10 @@ var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
|
|
|
22575
22663
|
!Symbol.sham && engineV8Version && engineV8Version < 41;
|
|
22576
22664
|
});
|
|
22577
22665
|
|
|
22578
|
-
/* eslint-disable es
|
|
22666
|
+
/* eslint-disable es/no-symbol -- required for testing */
|
|
22579
22667
|
|
|
22580
22668
|
|
|
22581
|
-
var useSymbolAsUid =
|
|
22669
|
+
var useSymbolAsUid = symbolConstructorDetection
|
|
22582
22670
|
&& !Symbol.sham
|
|
22583
22671
|
&& typeof Symbol.iterator == 'symbol';
|
|
22584
22672
|
|
|
@@ -22613,7 +22701,7 @@ var aCallable = function (argument) {
|
|
|
22613
22701
|
// https://tc39.es/ecma262/#sec-getmethod
|
|
22614
22702
|
var getMethod = function (V, P) {
|
|
22615
22703
|
var func = V[P];
|
|
22616
|
-
return func
|
|
22704
|
+
return isNullOrUndefined(func) ? undefined : aCallable(func);
|
|
22617
22705
|
};
|
|
22618
22706
|
|
|
22619
22707
|
var $TypeError$2 = TypeError;
|
|
@@ -22628,7 +22716,7 @@ var ordinaryToPrimitive = function (input, pref) {
|
|
|
22628
22716
|
throw $TypeError$2("Can't convert object to primitive value");
|
|
22629
22717
|
};
|
|
22630
22718
|
|
|
22631
|
-
// eslint-disable-next-line es
|
|
22719
|
+
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
22632
22720
|
var defineProperty = Object.defineProperty;
|
|
22633
22721
|
|
|
22634
22722
|
var defineGlobalProperty = function (key, value) {
|
|
@@ -22648,10 +22736,10 @@ var shared = createCommonjsModule(function (module) {
|
|
|
22648
22736
|
(module.exports = function (key, value) {
|
|
22649
22737
|
return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
|
|
22650
22738
|
})('versions', []).push({
|
|
22651
|
-
version: '3.
|
|
22739
|
+
version: '3.25.5',
|
|
22652
22740
|
mode: 'global',
|
|
22653
22741
|
copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
|
|
22654
|
-
license: 'https://github.com/zloirock/core-js/blob/v3.
|
|
22742
|
+
license: 'https://github.com/zloirock/core-js/blob/v3.25.5/LICENSE',
|
|
22655
22743
|
source: 'https://github.com/zloirock/core-js'
|
|
22656
22744
|
});
|
|
22657
22745
|
});
|
|
@@ -22668,7 +22756,7 @@ var hasOwnProperty = functionUncurryThis({}.hasOwnProperty);
|
|
|
22668
22756
|
|
|
22669
22757
|
// `HasOwnProperty` abstract operation
|
|
22670
22758
|
// https://tc39.es/ecma262/#sec-hasownproperty
|
|
22671
|
-
// eslint-disable-next-line es
|
|
22759
|
+
// eslint-disable-next-line es/no-object-hasown -- safe
|
|
22672
22760
|
var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
|
|
22673
22761
|
return hasOwnProperty(toObject(it), key);
|
|
22674
22762
|
};
|
|
@@ -22687,9 +22775,9 @@ var symbolFor = Symbol$1 && Symbol$1['for'];
|
|
|
22687
22775
|
var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
|
|
22688
22776
|
|
|
22689
22777
|
var wellKnownSymbol = function (name) {
|
|
22690
|
-
if (!hasOwnProperty_1(WellKnownSymbolsStore, name) || !(
|
|
22778
|
+
if (!hasOwnProperty_1(WellKnownSymbolsStore, name) || !(symbolConstructorDetection || typeof WellKnownSymbolsStore[name] == 'string')) {
|
|
22691
22779
|
var description = 'Symbol.' + name;
|
|
22692
|
-
if (
|
|
22780
|
+
if (symbolConstructorDetection && hasOwnProperty_1(Symbol$1, name)) {
|
|
22693
22781
|
WellKnownSymbolsStore[name] = Symbol$1[name];
|
|
22694
22782
|
} else if (useSymbolAsUid && symbolFor) {
|
|
22695
22783
|
WellKnownSymbolsStore[name] = symbolFor(description);
|
|
@@ -22735,13 +22823,13 @@ var documentCreateElement = function (it) {
|
|
|
22735
22823
|
|
|
22736
22824
|
// Thanks to IE8 for its funny defineProperty
|
|
22737
22825
|
var ie8DomDefine = !descriptors && !fails(function () {
|
|
22738
|
-
// eslint-disable-next-line es
|
|
22826
|
+
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
22739
22827
|
return Object.defineProperty(documentCreateElement('div'), 'a', {
|
|
22740
22828
|
get: function () { return 7; }
|
|
22741
22829
|
}).a != 7;
|
|
22742
22830
|
});
|
|
22743
22831
|
|
|
22744
|
-
// eslint-disable-next-line es
|
|
22832
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
22745
22833
|
var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
22746
22834
|
|
|
22747
22835
|
// `Object.getOwnPropertyDescriptor` method
|
|
@@ -22762,7 +22850,7 @@ var objectGetOwnPropertyDescriptor = {
|
|
|
22762
22850
|
// V8 ~ Chrome 36-
|
|
22763
22851
|
// https://bugs.chromium.org/p/v8/issues/detail?id=3334
|
|
22764
22852
|
var v8PrototypeDefineBug = descriptors && fails(function () {
|
|
22765
|
-
// eslint-disable-next-line es
|
|
22853
|
+
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
22766
22854
|
return Object.defineProperty(function () { /* empty */ }, 'prototype', {
|
|
22767
22855
|
value: 42,
|
|
22768
22856
|
writable: false
|
|
@@ -22779,9 +22867,9 @@ var anObject = function (argument) {
|
|
|
22779
22867
|
};
|
|
22780
22868
|
|
|
22781
22869
|
var $TypeError$5 = TypeError;
|
|
22782
|
-
// eslint-disable-next-line es
|
|
22870
|
+
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
22783
22871
|
var $defineProperty = Object.defineProperty;
|
|
22784
|
-
// eslint-disable-next-line es
|
|
22872
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
22785
22873
|
var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
|
|
22786
22874
|
var ENUMERABLE = 'enumerable';
|
|
22787
22875
|
var CONFIGURABLE = 'configurable';
|
|
@@ -22828,7 +22916,7 @@ var createNonEnumerableProperty = descriptors ? function (object, key, value) {
|
|
|
22828
22916
|
};
|
|
22829
22917
|
|
|
22830
22918
|
var FunctionPrototype$1 = Function.prototype;
|
|
22831
|
-
// eslint-disable-next-line es
|
|
22919
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
22832
22920
|
var getDescriptor = descriptors && Object.getOwnPropertyDescriptor;
|
|
22833
22921
|
|
|
22834
22922
|
var EXISTS$1 = hasOwnProperty_1(FunctionPrototype$1, 'name');
|
|
@@ -22855,7 +22943,7 @@ var inspectSource = sharedStore.inspectSource;
|
|
|
22855
22943
|
|
|
22856
22944
|
var WeakMap$1 = global_1.WeakMap;
|
|
22857
22945
|
|
|
22858
|
-
var
|
|
22946
|
+
var weakMapBasicDetection = isCallable(WeakMap$1) && /native code/.test(String(WeakMap$1));
|
|
22859
22947
|
|
|
22860
22948
|
var keys$1 = shared('keys');
|
|
22861
22949
|
|
|
@@ -22883,28 +22971,30 @@ var getterFor = function (TYPE) {
|
|
|
22883
22971
|
};
|
|
22884
22972
|
};
|
|
22885
22973
|
|
|
22886
|
-
if (
|
|
22974
|
+
if (weakMapBasicDetection || sharedStore.state) {
|
|
22887
22975
|
var store$1 = sharedStore.state || (sharedStore.state = new WeakMap$2());
|
|
22888
|
-
|
|
22889
|
-
|
|
22890
|
-
|
|
22976
|
+
/* eslint-disable no-self-assign -- prototype methods protection */
|
|
22977
|
+
store$1.get = store$1.get;
|
|
22978
|
+
store$1.has = store$1.has;
|
|
22979
|
+
store$1.set = store$1.set;
|
|
22980
|
+
/* eslint-enable no-self-assign -- prototype methods protection */
|
|
22891
22981
|
set = function (it, metadata) {
|
|
22892
|
-
if (
|
|
22982
|
+
if (store$1.has(it)) throw TypeError$1(OBJECT_ALREADY_INITIALIZED);
|
|
22893
22983
|
metadata.facade = it;
|
|
22894
|
-
|
|
22984
|
+
store$1.set(it, metadata);
|
|
22895
22985
|
return metadata;
|
|
22896
22986
|
};
|
|
22897
22987
|
get = function (it) {
|
|
22898
|
-
return
|
|
22988
|
+
return store$1.get(it) || {};
|
|
22899
22989
|
};
|
|
22900
22990
|
has = function (it) {
|
|
22901
|
-
return
|
|
22991
|
+
return store$1.has(it);
|
|
22902
22992
|
};
|
|
22903
22993
|
} else {
|
|
22904
22994
|
var STATE = sharedKey('state');
|
|
22905
22995
|
hiddenKeys[STATE] = true;
|
|
22906
22996
|
set = function (it, metadata) {
|
|
22907
|
-
if (hasOwnProperty_1(it, STATE)) throw
|
|
22997
|
+
if (hasOwnProperty_1(it, STATE)) throw TypeError$1(OBJECT_ALREADY_INITIALIZED);
|
|
22908
22998
|
metadata.facade = it;
|
|
22909
22999
|
createNonEnumerableProperty(it, STATE, metadata);
|
|
22910
23000
|
return metadata;
|
|
@@ -22932,7 +23022,7 @@ var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
|
|
|
22932
23022
|
|
|
22933
23023
|
var enforceInternalState = internalState.enforce;
|
|
22934
23024
|
var getInternalState = internalState.get;
|
|
22935
|
-
// eslint-disable-next-line es
|
|
23025
|
+
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
22936
23026
|
var defineProperty = Object.defineProperty;
|
|
22937
23027
|
|
|
22938
23028
|
var CONFIGURABLE_LENGTH = descriptors && !fails(function () {
|
|
@@ -23001,7 +23091,7 @@ var floor = Math.floor;
|
|
|
23001
23091
|
|
|
23002
23092
|
// `Math.trunc` method
|
|
23003
23093
|
// https://tc39.es/ecma262/#sec-math.trunc
|
|
23004
|
-
// eslint-disable-next-line es
|
|
23094
|
+
// eslint-disable-next-line es/no-math-trunc -- safe
|
|
23005
23095
|
var mathTrunc = Math.trunc || function trunc(x) {
|
|
23006
23096
|
var n = +x;
|
|
23007
23097
|
return (n > 0 ? floor : ceil)(n);
|
|
@@ -23102,7 +23192,7 @@ var hiddenKeys$1 = enumBugKeys.concat('length', 'prototype');
|
|
|
23102
23192
|
|
|
23103
23193
|
// `Object.getOwnPropertyNames` method
|
|
23104
23194
|
// https://tc39.es/ecma262/#sec-object.getownpropertynames
|
|
23105
|
-
// eslint-disable-next-line es
|
|
23195
|
+
// eslint-disable-next-line es/no-object-getownpropertynames -- safe
|
|
23106
23196
|
var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
|
23107
23197
|
return objectKeysInternal(O, hiddenKeys$1);
|
|
23108
23198
|
};
|
|
@@ -23111,7 +23201,7 @@ var objectGetOwnPropertyNames = {
|
|
|
23111
23201
|
f: f$3
|
|
23112
23202
|
};
|
|
23113
23203
|
|
|
23114
|
-
// eslint-disable-next-line es
|
|
23204
|
+
// eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
|
|
23115
23205
|
var f$4 = Object.getOwnPropertySymbols;
|
|
23116
23206
|
|
|
23117
23207
|
var objectGetOwnPropertySymbols = {
|
|
@@ -23255,7 +23345,7 @@ var toString_1 = function (argument) {
|
|
|
23255
23345
|
var charAt = functionUncurryThis(''.charAt);
|
|
23256
23346
|
|
|
23257
23347
|
var FORCED = fails(function () {
|
|
23258
|
-
// eslint-disable-next-line es
|
|
23348
|
+
// eslint-disable-next-line es/no-array-string-prototype-at -- safe
|
|
23259
23349
|
return '𠮷'.at(-2) !== '\uD842';
|
|
23260
23350
|
});
|
|
23261
23351
|
|
|
@@ -23273,14 +23363,14 @@ _export({ target: 'String', proto: true, forced: FORCED }, {
|
|
|
23273
23363
|
|
|
23274
23364
|
// `Object.keys` method
|
|
23275
23365
|
// https://tc39.es/ecma262/#sec-object.keys
|
|
23276
|
-
// eslint-disable-next-line es
|
|
23366
|
+
// eslint-disable-next-line es/no-object-keys -- safe
|
|
23277
23367
|
var objectKeys = Object.keys || function keys(O) {
|
|
23278
23368
|
return objectKeysInternal(O, enumBugKeys);
|
|
23279
23369
|
};
|
|
23280
23370
|
|
|
23281
23371
|
// `Object.defineProperties` method
|
|
23282
23372
|
// https://tc39.es/ecma262/#sec-object.defineproperties
|
|
23283
|
-
// eslint-disable-next-line es
|
|
23373
|
+
// eslint-disable-next-line es/no-object-defineproperties -- safe
|
|
23284
23374
|
var f$5 = descriptors && !v8PrototypeDefineBug ? Object.defineProperties : function defineProperties(O, Properties) {
|
|
23285
23375
|
anObject(O);
|
|
23286
23376
|
var props = toIndexedObject(Properties);
|
|
@@ -23369,7 +23459,7 @@ hiddenKeys[IE_PROTO] = true;
|
|
|
23369
23459
|
|
|
23370
23460
|
// `Object.create` method
|
|
23371
23461
|
// https://tc39.es/ecma262/#sec-object.create
|
|
23372
|
-
// eslint-disable-next-line es
|
|
23462
|
+
// eslint-disable-next-line es/no-object-create -- safe
|
|
23373
23463
|
var objectCreate = Object.create || function create(O, Properties) {
|
|
23374
23464
|
var result;
|
|
23375
23465
|
if (O !== null) {
|
|
@@ -23415,13 +23505,13 @@ _export({ target: 'Array', proto: true }, {
|
|
|
23415
23505
|
|
|
23416
23506
|
addToUnscopables('at');
|
|
23417
23507
|
|
|
23418
|
-
// eslint-disable-next-line es
|
|
23419
|
-
var
|
|
23508
|
+
// eslint-disable-next-line es/no-typed-arrays -- safe
|
|
23509
|
+
var arrayBufferBasicDetection = typeof ArrayBuffer != 'undefined' && typeof DataView != 'undefined';
|
|
23420
23510
|
|
|
23421
23511
|
var correctPrototypeGetter = !fails(function () {
|
|
23422
23512
|
function F() { /* empty */ }
|
|
23423
23513
|
F.prototype.constructor = null;
|
|
23424
|
-
// eslint-disable-next-line es
|
|
23514
|
+
// eslint-disable-next-line es/no-object-getprototypeof -- required for testing
|
|
23425
23515
|
return Object.getPrototypeOf(new F()) !== F.prototype;
|
|
23426
23516
|
});
|
|
23427
23517
|
|
|
@@ -23431,7 +23521,7 @@ var ObjectPrototype = $Object$4.prototype;
|
|
|
23431
23521
|
|
|
23432
23522
|
// `Object.getPrototypeOf` method
|
|
23433
23523
|
// https://tc39.es/ecma262/#sec-object.getprototypeof
|
|
23434
|
-
// eslint-disable-next-line es
|
|
23524
|
+
// eslint-disable-next-line es/no-object-getprototypeof -- safe
|
|
23435
23525
|
var objectGetPrototypeOf = correctPrototypeGetter ? $Object$4.getPrototypeOf : function (O) {
|
|
23436
23526
|
var object = toObject(O);
|
|
23437
23527
|
if (hasOwnProperty_1(object, IE_PROTO$1)) return object[IE_PROTO$1];
|
|
@@ -23457,13 +23547,13 @@ var aPossiblePrototype = function (argument) {
|
|
|
23457
23547
|
// `Object.setPrototypeOf` method
|
|
23458
23548
|
// https://tc39.es/ecma262/#sec-object.setprototypeof
|
|
23459
23549
|
// Works with __proto__ only. Old v8 can't work with null proto objects.
|
|
23460
|
-
// eslint-disable-next-line es
|
|
23550
|
+
// eslint-disable-next-line es/no-object-setprototypeof -- safe
|
|
23461
23551
|
var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
|
|
23462
23552
|
var CORRECT_SETTER = false;
|
|
23463
23553
|
var test = {};
|
|
23464
23554
|
var setter;
|
|
23465
23555
|
try {
|
|
23466
|
-
// eslint-disable-next-line es
|
|
23556
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
23467
23557
|
setter = functionUncurryThis(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
|
|
23468
23558
|
setter(test, []);
|
|
23469
23559
|
CORRECT_SETTER = test instanceof Array;
|
|
@@ -23500,7 +23590,7 @@ var TO_STRING_TAG$2 = wellKnownSymbol('toStringTag');
|
|
|
23500
23590
|
var TYPED_ARRAY_TAG = uid('TYPED_ARRAY_TAG');
|
|
23501
23591
|
var TYPED_ARRAY_CONSTRUCTOR = 'TypedArrayConstructor';
|
|
23502
23592
|
// Fixing native typed arrays in Opera Presto crashes the browser, see #595
|
|
23503
|
-
var NATIVE_ARRAY_BUFFER_VIEWS =
|
|
23593
|
+
var NATIVE_ARRAY_BUFFER_VIEWS = arrayBufferBasicDetection && !!objectSetPrototypeOf && classof(global_1.opera) !== 'Opera';
|
|
23504
23594
|
var TYPED_ARRAY_TAG_REQUIRED = false;
|
|
23505
23595
|
var NAME, Constructor, Prototype;
|
|
23506
23596
|
|
|
@@ -38538,49 +38628,624 @@ var TableHeading_styled = styled__default.th.withConfig({
|
|
|
38538
38628
|
return extraStyles;
|
|
38539
38629
|
});
|
|
38540
38630
|
|
|
38541
|
-
|
|
38542
|
-
value
|
|
38543
|
-
|
|
38544
|
-
|
|
38631
|
+
var validatorToPredicate = function validatorToPredicate(validatorFn, emptyCase) {
|
|
38632
|
+
return function (value) {
|
|
38633
|
+
for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
38634
|
+
rest[_key - 1] = arguments[_key];
|
|
38635
|
+
}
|
|
38636
|
+
|
|
38637
|
+
return value === "" ? emptyCase : validatorFn.apply(void 0, [value].concat(rest));
|
|
38638
|
+
};
|
|
38639
|
+
};
|
|
38545
38640
|
|
|
38546
38641
|
var commonjsGlobal$1 = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
38547
38642
|
|
|
38548
|
-
|
|
38643
|
+
function getDefaultExportFromCjs(x) {
|
|
38644
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
38645
|
+
}
|
|
38646
|
+
|
|
38647
|
+
var dayjs_min = {
|
|
38648
|
+
exports: {}
|
|
38649
|
+
};
|
|
38549
38650
|
|
|
38550
38651
|
(function (module, exports) {
|
|
38551
|
-
!function
|
|
38552
|
-
|
|
38652
|
+
!function (t, e) {
|
|
38653
|
+
module.exports = e();
|
|
38654
|
+
}(commonjsGlobal$1, function () {
|
|
38655
|
+
var t = 1e3,
|
|
38656
|
+
e = 6e4,
|
|
38657
|
+
n = 36e5,
|
|
38658
|
+
r = "millisecond",
|
|
38659
|
+
i = "second",
|
|
38660
|
+
s = "minute",
|
|
38661
|
+
u = "hour",
|
|
38662
|
+
a = "day",
|
|
38663
|
+
o = "week",
|
|
38664
|
+
f = "month",
|
|
38665
|
+
h = "quarter",
|
|
38666
|
+
c = "year",
|
|
38667
|
+
d = "date",
|
|
38668
|
+
$ = "Invalid Date",
|
|
38669
|
+
l = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,
|
|
38670
|
+
y = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,
|
|
38671
|
+
M = {
|
|
38672
|
+
name: "en",
|
|
38673
|
+
weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),
|
|
38674
|
+
months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_")
|
|
38675
|
+
},
|
|
38676
|
+
m = function m(t, e, n) {
|
|
38677
|
+
var r = String(t);
|
|
38678
|
+
return !r || r.length >= e ? t : "" + Array(e + 1 - r.length).join(n) + t;
|
|
38679
|
+
},
|
|
38680
|
+
g = {
|
|
38681
|
+
s: m,
|
|
38682
|
+
z: function z(t) {
|
|
38683
|
+
var e = -t.utcOffset(),
|
|
38684
|
+
n = Math.abs(e),
|
|
38685
|
+
r = Math.floor(n / 60),
|
|
38686
|
+
i = n % 60;
|
|
38687
|
+
return (e <= 0 ? "+" : "-") + m(r, 2, "0") + ":" + m(i, 2, "0");
|
|
38688
|
+
},
|
|
38689
|
+
m: function t(e, n) {
|
|
38690
|
+
if (e.date() < n.date()) return -t(n, e);
|
|
38691
|
+
var r = 12 * (n.year() - e.year()) + (n.month() - e.month()),
|
|
38692
|
+
i = e.clone().add(r, f),
|
|
38693
|
+
s = n - i < 0,
|
|
38694
|
+
u = e.clone().add(r + (s ? -1 : 1), f);
|
|
38695
|
+
return +(-(r + (n - i) / (s ? i - u : u - i)) || 0);
|
|
38696
|
+
},
|
|
38697
|
+
a: function a(t) {
|
|
38698
|
+
return t < 0 ? Math.ceil(t) || 0 : Math.floor(t);
|
|
38699
|
+
},
|
|
38700
|
+
p: function p(t) {
|
|
38701
|
+
return {
|
|
38702
|
+
M: f,
|
|
38703
|
+
y: c,
|
|
38704
|
+
w: o,
|
|
38705
|
+
d: a,
|
|
38706
|
+
D: d,
|
|
38707
|
+
h: u,
|
|
38708
|
+
m: s,
|
|
38709
|
+
s: i,
|
|
38710
|
+
ms: r,
|
|
38711
|
+
Q: h
|
|
38712
|
+
}[t] || String(t || "").toLowerCase().replace(/s$/, "");
|
|
38713
|
+
},
|
|
38714
|
+
u: function u(t) {
|
|
38715
|
+
return void 0 === t;
|
|
38716
|
+
}
|
|
38717
|
+
},
|
|
38718
|
+
D = "en",
|
|
38719
|
+
v = {};
|
|
38553
38720
|
|
|
38554
|
-
|
|
38721
|
+
v[D] = M;
|
|
38555
38722
|
|
|
38556
|
-
var
|
|
38723
|
+
var p = function p(t) {
|
|
38724
|
+
return t instanceof _;
|
|
38725
|
+
},
|
|
38726
|
+
S = function S(t, e, n) {
|
|
38727
|
+
var r;
|
|
38728
|
+
if (!t) return D;
|
|
38729
|
+
if ("string" == typeof t) v[t] && (r = t), e && (v[t] = e, r = t);else {
|
|
38730
|
+
var i = t.name;
|
|
38731
|
+
v[i] = t, r = i;
|
|
38732
|
+
}
|
|
38733
|
+
return !n && r && (D = r), r || !n && D;
|
|
38734
|
+
},
|
|
38735
|
+
w = function w(t, e) {
|
|
38736
|
+
if (p(t)) return t.clone();
|
|
38737
|
+
var n = "object" == _typeof(e) ? e : {};
|
|
38738
|
+
return n.date = t, n.args = arguments, new _(n);
|
|
38739
|
+
},
|
|
38740
|
+
O = g;
|
|
38741
|
+
|
|
38742
|
+
O.l = S, O.i = p, O.w = function (t, e) {
|
|
38743
|
+
return w(t, {
|
|
38744
|
+
locale: e.$L,
|
|
38745
|
+
utc: e.$u,
|
|
38746
|
+
x: e.$x,
|
|
38747
|
+
$offset: e.$offset
|
|
38748
|
+
});
|
|
38749
|
+
};
|
|
38557
38750
|
|
|
38558
|
-
|
|
38559
|
-
|
|
38560
|
-
|
|
38751
|
+
var _ = function () {
|
|
38752
|
+
function M(t) {
|
|
38753
|
+
this.$L = S(t.locale, null, !0), this.parse(t);
|
|
38754
|
+
}
|
|
38561
38755
|
|
|
38562
|
-
var
|
|
38756
|
+
var m = M.prototype;
|
|
38757
|
+
return m.parse = function (t) {
|
|
38758
|
+
this.$d = function (t) {
|
|
38759
|
+
var e = t.date,
|
|
38760
|
+
n = t.utc;
|
|
38761
|
+
if (null === e) return new Date(NaN);
|
|
38762
|
+
if (O.u(e)) return new Date();
|
|
38763
|
+
if (e instanceof Date) return new Date(e);
|
|
38764
|
+
|
|
38765
|
+
if ("string" == typeof e && !/Z$/i.test(e)) {
|
|
38766
|
+
var r = e.match(l);
|
|
38767
|
+
|
|
38768
|
+
if (r) {
|
|
38769
|
+
var i = r[2] - 1 || 0,
|
|
38770
|
+
s = (r[7] || "0").substring(0, 3);
|
|
38771
|
+
return n ? new Date(Date.UTC(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, s)) : new Date(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, s);
|
|
38772
|
+
}
|
|
38773
|
+
}
|
|
38563
38774
|
|
|
38564
|
-
|
|
38775
|
+
return new Date(e);
|
|
38776
|
+
}(t), this.$x = t.x || {}, this.init();
|
|
38777
|
+
}, m.init = function () {
|
|
38778
|
+
var t = this.$d;
|
|
38779
|
+
this.$y = t.getFullYear(), this.$M = t.getMonth(), this.$D = t.getDate(), this.$W = t.getDay(), this.$H = t.getHours(), this.$m = t.getMinutes(), this.$s = t.getSeconds(), this.$ms = t.getMilliseconds();
|
|
38780
|
+
}, m.$utils = function () {
|
|
38781
|
+
return O;
|
|
38782
|
+
}, m.isValid = function () {
|
|
38783
|
+
return !(this.$d.toString() === $);
|
|
38784
|
+
}, m.isSame = function (t, e) {
|
|
38785
|
+
var n = w(t);
|
|
38786
|
+
return this.startOf(e) <= n && n <= this.endOf(e);
|
|
38787
|
+
}, m.isAfter = function (t, e) {
|
|
38788
|
+
return w(t) < this.startOf(e);
|
|
38789
|
+
}, m.isBefore = function (t, e) {
|
|
38790
|
+
return this.endOf(e) < w(t);
|
|
38791
|
+
}, m.$g = function (t, e, n) {
|
|
38792
|
+
return O.u(t) ? this[e] : this.set(n, t);
|
|
38793
|
+
}, m.unix = function () {
|
|
38794
|
+
return Math.floor(this.valueOf() / 1e3);
|
|
38795
|
+
}, m.valueOf = function () {
|
|
38796
|
+
return this.$d.getTime();
|
|
38797
|
+
}, m.startOf = function (t, e) {
|
|
38798
|
+
var n = this,
|
|
38799
|
+
r = !!O.u(e) || e,
|
|
38800
|
+
h = O.p(t),
|
|
38801
|
+
$ = function $(t, e) {
|
|
38802
|
+
var i = O.w(n.$u ? Date.UTC(n.$y, e, t) : new Date(n.$y, e, t), n);
|
|
38803
|
+
return r ? i : i.endOf(a);
|
|
38804
|
+
},
|
|
38805
|
+
l = function l(t, e) {
|
|
38806
|
+
return O.w(n.toDate()[t].apply(n.toDate("s"), (r ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e)), n);
|
|
38807
|
+
},
|
|
38808
|
+
y = this.$W,
|
|
38809
|
+
M = this.$M,
|
|
38810
|
+
m = this.$D,
|
|
38811
|
+
g = "set" + (this.$u ? "UTC" : "");
|
|
38812
|
+
|
|
38813
|
+
switch (h) {
|
|
38814
|
+
case c:
|
|
38815
|
+
return r ? $(1, 0) : $(31, 11);
|
|
38816
|
+
|
|
38817
|
+
case f:
|
|
38818
|
+
return r ? $(1, M) : $(0, M + 1);
|
|
38819
|
+
|
|
38820
|
+
case o:
|
|
38821
|
+
var D = this.$locale().weekStart || 0,
|
|
38822
|
+
v = (y < D ? y + 7 : y) - D;
|
|
38823
|
+
return $(r ? m - v : m + (6 - v), M);
|
|
38824
|
+
|
|
38825
|
+
case a:
|
|
38826
|
+
case d:
|
|
38827
|
+
return l(g + "Hours", 0);
|
|
38828
|
+
|
|
38829
|
+
case u:
|
|
38830
|
+
return l(g + "Minutes", 1);
|
|
38831
|
+
|
|
38832
|
+
case s:
|
|
38833
|
+
return l(g + "Seconds", 2);
|
|
38834
|
+
|
|
38835
|
+
case i:
|
|
38836
|
+
return l(g + "Milliseconds", 3);
|
|
38837
|
+
|
|
38838
|
+
default:
|
|
38839
|
+
return this.clone();
|
|
38840
|
+
}
|
|
38841
|
+
}, m.endOf = function (t) {
|
|
38842
|
+
return this.startOf(t, !1);
|
|
38843
|
+
}, m.$set = function (t, e) {
|
|
38844
|
+
var n,
|
|
38845
|
+
o = O.p(t),
|
|
38846
|
+
h = "set" + (this.$u ? "UTC" : ""),
|
|
38847
|
+
$ = (n = {}, n[a] = h + "Date", n[d] = h + "Date", n[f] = h + "Month", n[c] = h + "FullYear", n[u] = h + "Hours", n[s] = h + "Minutes", n[i] = h + "Seconds", n[r] = h + "Milliseconds", n)[o],
|
|
38848
|
+
l = o === a ? this.$D + (e - this.$W) : e;
|
|
38849
|
+
|
|
38850
|
+
if (o === f || o === c) {
|
|
38851
|
+
var y = this.clone().set(d, 1);
|
|
38852
|
+
y.$d[$](l), y.init(), this.$d = y.set(d, Math.min(this.$D, y.daysInMonth())).$d;
|
|
38853
|
+
} else $ && this.$d[$](l);
|
|
38854
|
+
|
|
38855
|
+
return this.init(), this;
|
|
38856
|
+
}, m.set = function (t, e) {
|
|
38857
|
+
return this.clone().$set(t, e);
|
|
38858
|
+
}, m.get = function (t) {
|
|
38859
|
+
return this[O.p(t)]();
|
|
38860
|
+
}, m.add = function (r, h) {
|
|
38861
|
+
var d,
|
|
38862
|
+
$ = this;
|
|
38863
|
+
r = Number(r);
|
|
38864
|
+
|
|
38865
|
+
var l = O.p(h),
|
|
38866
|
+
y = function y(t) {
|
|
38867
|
+
var e = w($);
|
|
38868
|
+
return O.w(e.date(e.date() + Math.round(t * r)), $);
|
|
38869
|
+
};
|
|
38870
|
+
|
|
38871
|
+
if (l === f) return this.set(f, this.$M + r);
|
|
38872
|
+
if (l === c) return this.set(c, this.$y + r);
|
|
38873
|
+
if (l === a) return y(1);
|
|
38874
|
+
if (l === o) return y(7);
|
|
38875
|
+
var M = (d = {}, d[s] = e, d[u] = n, d[i] = t, d)[l] || 1,
|
|
38876
|
+
m = this.$d.getTime() + r * M;
|
|
38877
|
+
return O.w(m, this);
|
|
38878
|
+
}, m.subtract = function (t, e) {
|
|
38879
|
+
return this.add(-1 * t, e);
|
|
38880
|
+
}, m.format = function (t) {
|
|
38881
|
+
var e = this,
|
|
38882
|
+
n = this.$locale();
|
|
38883
|
+
if (!this.isValid()) return n.invalidDate || $;
|
|
38884
|
+
|
|
38885
|
+
var r = t || "YYYY-MM-DDTHH:mm:ssZ",
|
|
38886
|
+
i = O.z(this),
|
|
38887
|
+
s = this.$H,
|
|
38888
|
+
u = this.$m,
|
|
38889
|
+
a = this.$M,
|
|
38890
|
+
o = n.weekdays,
|
|
38891
|
+
f = n.months,
|
|
38892
|
+
h = function h(t, n, i, s) {
|
|
38893
|
+
return t && (t[n] || t(e, r)) || i[n].substr(0, s);
|
|
38894
|
+
},
|
|
38895
|
+
c = function c(t) {
|
|
38896
|
+
return O.s(s % 12 || 12, t, "0");
|
|
38897
|
+
},
|
|
38898
|
+
d = n.meridiem || function (t, e, n) {
|
|
38899
|
+
var r = t < 12 ? "AM" : "PM";
|
|
38900
|
+
return n ? r.toLowerCase() : r;
|
|
38901
|
+
},
|
|
38902
|
+
l = {
|
|
38903
|
+
YY: String(this.$y).slice(-2),
|
|
38904
|
+
YYYY: this.$y,
|
|
38905
|
+
M: a + 1,
|
|
38906
|
+
MM: O.s(a + 1, 2, "0"),
|
|
38907
|
+
MMM: h(n.monthsShort, a, f, 3),
|
|
38908
|
+
MMMM: h(f, a),
|
|
38909
|
+
D: this.$D,
|
|
38910
|
+
DD: O.s(this.$D, 2, "0"),
|
|
38911
|
+
d: String(this.$W),
|
|
38912
|
+
dd: h(n.weekdaysMin, this.$W, o, 2),
|
|
38913
|
+
ddd: h(n.weekdaysShort, this.$W, o, 3),
|
|
38914
|
+
dddd: o[this.$W],
|
|
38915
|
+
H: String(s),
|
|
38916
|
+
HH: O.s(s, 2, "0"),
|
|
38917
|
+
h: c(1),
|
|
38918
|
+
hh: c(2),
|
|
38919
|
+
a: d(s, u, !0),
|
|
38920
|
+
A: d(s, u, !1),
|
|
38921
|
+
m: String(u),
|
|
38922
|
+
mm: O.s(u, 2, "0"),
|
|
38923
|
+
s: String(this.$s),
|
|
38924
|
+
ss: O.s(this.$s, 2, "0"),
|
|
38925
|
+
SSS: O.s(this.$ms, 3, "0"),
|
|
38926
|
+
Z: i
|
|
38927
|
+
};
|
|
38928
|
+
|
|
38929
|
+
return r.replace(y, function (t, e) {
|
|
38930
|
+
return e || l[t] || i.replace(":", "");
|
|
38931
|
+
});
|
|
38932
|
+
}, m.utcOffset = function () {
|
|
38933
|
+
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
38934
|
+
}, m.diff = function (r, d, $) {
|
|
38935
|
+
var l,
|
|
38936
|
+
y = O.p(d),
|
|
38937
|
+
M = w(r),
|
|
38938
|
+
m = (M.utcOffset() - this.utcOffset()) * e,
|
|
38939
|
+
g = this - M,
|
|
38940
|
+
D = O.m(this, M);
|
|
38941
|
+
return D = (l = {}, l[c] = D / 12, l[f] = D, l[h] = D / 3, l[o] = (g - m) / 6048e5, l[a] = (g - m) / 864e5, l[u] = g / n, l[s] = g / e, l[i] = g / t, l)[y] || g, $ ? D : O.a(D);
|
|
38942
|
+
}, m.daysInMonth = function () {
|
|
38943
|
+
return this.endOf(f).$D;
|
|
38944
|
+
}, m.$locale = function () {
|
|
38945
|
+
return v[this.$L];
|
|
38946
|
+
}, m.locale = function (t, e) {
|
|
38947
|
+
if (!t) return this.$L;
|
|
38948
|
+
var n = this.clone(),
|
|
38949
|
+
r = S(t, e, !0);
|
|
38950
|
+
return r && (n.$L = r), n;
|
|
38951
|
+
}, m.clone = function () {
|
|
38952
|
+
return O.w(this.$d, this);
|
|
38953
|
+
}, m.toDate = function () {
|
|
38954
|
+
return new Date(this.valueOf());
|
|
38955
|
+
}, m.toJSON = function () {
|
|
38956
|
+
return this.isValid() ? this.toISOString() : null;
|
|
38957
|
+
}, m.toISOString = function () {
|
|
38958
|
+
return this.$d.toISOString();
|
|
38959
|
+
}, m.toString = function () {
|
|
38960
|
+
return this.$d.toUTCString();
|
|
38961
|
+
}, M;
|
|
38962
|
+
}(),
|
|
38963
|
+
b = _.prototype;
|
|
38964
|
+
|
|
38965
|
+
return w.prototype = b, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", f], ["$y", c], ["$D", d]].forEach(function (t) {
|
|
38966
|
+
b[t[1]] = function (e) {
|
|
38967
|
+
return this.$g(e, t[0], t[1]);
|
|
38968
|
+
};
|
|
38969
|
+
}), w.extend = function (t, e) {
|
|
38970
|
+
return t.$i || (t(e, _, w), t.$i = !0), w;
|
|
38971
|
+
}, w.locale = S, w.isDayjs = p, w.unix = function (t) {
|
|
38972
|
+
return w(1e3 * t);
|
|
38973
|
+
}, w.en = v[D], w.Ls = v, w.p = {}, w;
|
|
38974
|
+
});
|
|
38975
|
+
})(dayjs_min);
|
|
38976
|
+
|
|
38977
|
+
var dayjs_minExports = dayjs_min.exports;
|
|
38978
|
+
var dayjs = /*@__PURE__*/getDefaultExportFromCjs(dayjs_minExports);
|
|
38979
|
+
var customParseFormat$1 = {
|
|
38980
|
+
exports: {}
|
|
38981
|
+
};
|
|
38565
38982
|
|
|
38566
38983
|
(function (module, exports) {
|
|
38567
|
-
!function(
|
|
38568
|
-
|
|
38984
|
+
!function (t, e) {
|
|
38985
|
+
module.exports = e();
|
|
38986
|
+
}(commonjsGlobal$1, function () {
|
|
38987
|
+
var t = {
|
|
38988
|
+
LTS: "h:mm:ss A",
|
|
38989
|
+
LT: "h:mm A",
|
|
38990
|
+
L: "MM/DD/YYYY",
|
|
38991
|
+
LL: "MMMM D, YYYY",
|
|
38992
|
+
LLL: "MMMM D, YYYY h:mm A",
|
|
38993
|
+
LLLL: "dddd, MMMM D, YYYY h:mm A"
|
|
38994
|
+
},
|
|
38995
|
+
e = /(\[[^[]*\])|([-:/.()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,
|
|
38996
|
+
n = /\d\d/,
|
|
38997
|
+
r = /\d\d?/,
|
|
38998
|
+
i = /\d*[^\s\d-_:/()]+/,
|
|
38999
|
+
o = {},
|
|
39000
|
+
s = function s(t) {
|
|
39001
|
+
return (t = +t) + (t > 68 ? 1900 : 2e3);
|
|
39002
|
+
};
|
|
39003
|
+
|
|
39004
|
+
var a = function a(t) {
|
|
39005
|
+
return function (e) {
|
|
39006
|
+
this[t] = +e;
|
|
39007
|
+
};
|
|
39008
|
+
},
|
|
39009
|
+
f = [/[+-]\d\d:?(\d\d)?|Z/, function (t) {
|
|
39010
|
+
(this.zone || (this.zone = {})).offset = function (t) {
|
|
39011
|
+
if (!t) return 0;
|
|
39012
|
+
if ("Z" === t) return 0;
|
|
39013
|
+
var e = t.match(/([+-]|\d\d)/g),
|
|
39014
|
+
n = 60 * e[1] + (+e[2] || 0);
|
|
39015
|
+
return 0 === n ? 0 : "+" === e[0] ? -n : n;
|
|
39016
|
+
}(t);
|
|
39017
|
+
}],
|
|
39018
|
+
u = function u(t) {
|
|
39019
|
+
var e = o[t];
|
|
39020
|
+
return e && (e.indexOf ? e : e.s.concat(e.f));
|
|
39021
|
+
},
|
|
39022
|
+
h = function h(t, e) {
|
|
39023
|
+
var n,
|
|
39024
|
+
r = o.meridiem;
|
|
39025
|
+
|
|
39026
|
+
if (r) {
|
|
39027
|
+
for (var i = 1; i <= 24; i += 1) {
|
|
39028
|
+
if (t.indexOf(r(i, 0, e)) > -1) {
|
|
39029
|
+
n = i > 12;
|
|
39030
|
+
break;
|
|
39031
|
+
}
|
|
39032
|
+
}
|
|
39033
|
+
} else n = t === (e ? "pm" : "PM");
|
|
39034
|
+
|
|
39035
|
+
return n;
|
|
39036
|
+
},
|
|
39037
|
+
d = {
|
|
39038
|
+
A: [i, function (t) {
|
|
39039
|
+
this.afternoon = h(t, !1);
|
|
39040
|
+
}],
|
|
39041
|
+
a: [i, function (t) {
|
|
39042
|
+
this.afternoon = h(t, !0);
|
|
39043
|
+
}],
|
|
39044
|
+
S: [/\d/, function (t) {
|
|
39045
|
+
this.milliseconds = 100 * +t;
|
|
39046
|
+
}],
|
|
39047
|
+
SS: [n, function (t) {
|
|
39048
|
+
this.milliseconds = 10 * +t;
|
|
39049
|
+
}],
|
|
39050
|
+
SSS: [/\d{3}/, function (t) {
|
|
39051
|
+
this.milliseconds = +t;
|
|
39052
|
+
}],
|
|
39053
|
+
s: [r, a("seconds")],
|
|
39054
|
+
ss: [r, a("seconds")],
|
|
39055
|
+
m: [r, a("minutes")],
|
|
39056
|
+
mm: [r, a("minutes")],
|
|
39057
|
+
H: [r, a("hours")],
|
|
39058
|
+
h: [r, a("hours")],
|
|
39059
|
+
HH: [r, a("hours")],
|
|
39060
|
+
hh: [r, a("hours")],
|
|
39061
|
+
D: [r, a("day")],
|
|
39062
|
+
DD: [n, a("day")],
|
|
39063
|
+
Do: [i, function (t) {
|
|
39064
|
+
var e = o.ordinal,
|
|
39065
|
+
n = t.match(/\d+/);
|
|
39066
|
+
if (this.day = n[0], e) for (var r = 1; r <= 31; r += 1) {
|
|
39067
|
+
e(r).replace(/\[|\]/g, "") === t && (this.day = r);
|
|
39068
|
+
}
|
|
39069
|
+
}],
|
|
39070
|
+
M: [r, a("month")],
|
|
39071
|
+
MM: [n, a("month")],
|
|
39072
|
+
MMM: [i, function (t) {
|
|
39073
|
+
var e = u("months"),
|
|
39074
|
+
n = (u("monthsShort") || e.map(function (t) {
|
|
39075
|
+
return t.substr(0, 3);
|
|
39076
|
+
})).indexOf(t) + 1;
|
|
39077
|
+
if (n < 1) throw new Error();
|
|
39078
|
+
this.month = n % 12 || n;
|
|
39079
|
+
}],
|
|
39080
|
+
MMMM: [i, function (t) {
|
|
39081
|
+
var e = u("months").indexOf(t) + 1;
|
|
39082
|
+
if (e < 1) throw new Error();
|
|
39083
|
+
this.month = e % 12 || e;
|
|
39084
|
+
}],
|
|
39085
|
+
Y: [/[+-]?\d+/, a("year")],
|
|
39086
|
+
YY: [n, function (t) {
|
|
39087
|
+
this.year = s(t);
|
|
39088
|
+
}],
|
|
39089
|
+
YYYY: [/\d{4}/, a("year")],
|
|
39090
|
+
Z: f,
|
|
39091
|
+
ZZ: f
|
|
39092
|
+
};
|
|
39093
|
+
|
|
39094
|
+
function c(n) {
|
|
39095
|
+
var r, i;
|
|
39096
|
+
r = n, i = o && o.formats;
|
|
39097
|
+
|
|
39098
|
+
for (var s = (n = r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function (e, n, r) {
|
|
39099
|
+
var o = r && r.toUpperCase();
|
|
39100
|
+
return n || i[r] || t[r] || i[o].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function (t, e, n) {
|
|
39101
|
+
return e || n.slice(1);
|
|
39102
|
+
});
|
|
39103
|
+
})).match(e), a = s.length, f = 0; f < a; f += 1) {
|
|
39104
|
+
var u = s[f],
|
|
39105
|
+
h = d[u],
|
|
39106
|
+
c = h && h[0],
|
|
39107
|
+
l = h && h[1];
|
|
39108
|
+
s[f] = l ? {
|
|
39109
|
+
regex: c,
|
|
39110
|
+
parser: l
|
|
39111
|
+
} : u.replace(/^\[|\]$/g, "");
|
|
39112
|
+
}
|
|
39113
|
+
|
|
39114
|
+
return function (t) {
|
|
39115
|
+
for (var e = {}, n = 0, r = 0; n < a; n += 1) {
|
|
39116
|
+
var i = s[n];
|
|
39117
|
+
if ("string" == typeof i) r += i.length;else {
|
|
39118
|
+
var o = i.regex,
|
|
39119
|
+
f = i.parser,
|
|
39120
|
+
u = t.substr(r),
|
|
39121
|
+
h = o.exec(u)[0];
|
|
39122
|
+
f.call(e, h), t = t.replace(h, "");
|
|
39123
|
+
}
|
|
39124
|
+
}
|
|
39125
|
+
|
|
39126
|
+
return function (t) {
|
|
39127
|
+
var e = t.afternoon;
|
|
38569
39128
|
|
|
38570
|
-
|
|
39129
|
+
if (void 0 !== e) {
|
|
39130
|
+
var n = t.hours;
|
|
39131
|
+
e ? n < 12 && (t.hours += 12) : 12 === n && (t.hours = 0), delete t.afternoon;
|
|
39132
|
+
}
|
|
39133
|
+
}(e), e;
|
|
39134
|
+
};
|
|
39135
|
+
}
|
|
39136
|
+
|
|
39137
|
+
return function (t, e, n) {
|
|
39138
|
+
n.p.customParseFormat = !0, t && t.parseTwoDigitYear && (s = t.parseTwoDigitYear);
|
|
39139
|
+
var r = e.prototype,
|
|
39140
|
+
i = r.parse;
|
|
39141
|
+
|
|
39142
|
+
r.parse = function (t) {
|
|
39143
|
+
var e = t.date,
|
|
39144
|
+
r = t.utc,
|
|
39145
|
+
s = t.args;
|
|
39146
|
+
this.$u = r;
|
|
39147
|
+
var a = s[1];
|
|
39148
|
+
|
|
39149
|
+
if ("string" == typeof a) {
|
|
39150
|
+
var f = !0 === s[2],
|
|
39151
|
+
u = !0 === s[3],
|
|
39152
|
+
h = f || u,
|
|
39153
|
+
d = s[2];
|
|
39154
|
+
u && (d = s[2]), o = this.$locale(), !f && d && (o = n.Ls[d]), this.$d = function (t, e, n) {
|
|
39155
|
+
try {
|
|
39156
|
+
if (["x", "X"].indexOf(e) > -1) return new Date(("X" === e ? 1e3 : 1) * t);
|
|
39157
|
+
var r = c(e)(t),
|
|
39158
|
+
i = r.year,
|
|
39159
|
+
o = r.month,
|
|
39160
|
+
s = r.day,
|
|
39161
|
+
a = r.hours,
|
|
39162
|
+
f = r.minutes,
|
|
39163
|
+
u = r.seconds,
|
|
39164
|
+
h = r.milliseconds,
|
|
39165
|
+
d = r.zone,
|
|
39166
|
+
l = new Date(),
|
|
39167
|
+
m = s || (i || o ? 1 : l.getDate()),
|
|
39168
|
+
M = i || l.getFullYear(),
|
|
39169
|
+
Y = 0;
|
|
39170
|
+
i && !o || (Y = o > 0 ? o - 1 : l.getMonth());
|
|
39171
|
+
var p = a || 0,
|
|
39172
|
+
v = f || 0,
|
|
39173
|
+
D = u || 0,
|
|
39174
|
+
g = h || 0;
|
|
39175
|
+
return d ? new Date(Date.UTC(M, Y, m, p, v, D, g + 60 * d.offset * 1e3)) : n ? new Date(Date.UTC(M, Y, m, p, v, D, g)) : new Date(M, Y, m, p, v, D, g);
|
|
39176
|
+
} catch (t) {
|
|
39177
|
+
return new Date("");
|
|
39178
|
+
}
|
|
39179
|
+
}(e, a, r), this.init(), d && !0 !== d && (this.$L = this.locale(d).$L), h && e != this.format(a) && (this.$d = new Date("")), o = {};
|
|
39180
|
+
} else if (a instanceof Array) for (var l = a.length, m = 1; m <= l; m += 1) {
|
|
39181
|
+
s[1] = a[m - 1];
|
|
39182
|
+
var M = n.apply(this, s);
|
|
38571
39183
|
|
|
38572
|
-
|
|
39184
|
+
if (M.isValid()) {
|
|
39185
|
+
this.$d = M.$d, this.$L = M.$L, this.init();
|
|
39186
|
+
break;
|
|
39187
|
+
}
|
|
39188
|
+
|
|
39189
|
+
m === l && (this.$d = new Date(""));
|
|
39190
|
+
} else i.call(this, t);
|
|
39191
|
+
};
|
|
39192
|
+
};
|
|
39193
|
+
});
|
|
39194
|
+
})(customParseFormat$1);
|
|
39195
|
+
|
|
39196
|
+
var customParseFormatExports = customParseFormat$1.exports;
|
|
39197
|
+
var customParseFormat = /*@__PURE__*/getDefaultExportFromCjs(customParseFormatExports);
|
|
39198
|
+
var isSameOrBefore$1 = {
|
|
39199
|
+
exports: {}
|
|
39200
|
+
};
|
|
38573
39201
|
|
|
38574
39202
|
(function (module, exports) {
|
|
38575
|
-
!function(e,
|
|
38576
|
-
|
|
39203
|
+
!function (e, i) {
|
|
39204
|
+
module.exports = i();
|
|
39205
|
+
}(commonjsGlobal$1, function () {
|
|
39206
|
+
return function (e, i) {
|
|
39207
|
+
i.prototype.isSameOrBefore = function (e, i) {
|
|
39208
|
+
return this.isSame(e, i) || this.isBefore(e, i);
|
|
39209
|
+
};
|
|
39210
|
+
};
|
|
39211
|
+
});
|
|
39212
|
+
})(isSameOrBefore$1);
|
|
39213
|
+
|
|
39214
|
+
var isSameOrBeforeExports = isSameOrBefore$1.exports;
|
|
39215
|
+
var isSameOrBefore = /*@__PURE__*/getDefaultExportFromCjs(isSameOrBeforeExports);
|
|
39216
|
+
var isSameOrAfter$1 = {
|
|
39217
|
+
exports: {}
|
|
39218
|
+
};
|
|
38577
39219
|
|
|
38578
|
-
|
|
39220
|
+
(function (module, exports) {
|
|
39221
|
+
!function (e, t) {
|
|
39222
|
+
module.exports = t();
|
|
39223
|
+
}(commonjsGlobal$1, function () {
|
|
39224
|
+
return function (e, t) {
|
|
39225
|
+
t.prototype.isSameOrAfter = function (e, t) {
|
|
39226
|
+
return this.isSame(e, t) || this.isAfter(e, t);
|
|
39227
|
+
};
|
|
39228
|
+
};
|
|
39229
|
+
});
|
|
39230
|
+
})(isSameOrAfter$1);
|
|
38579
39231
|
|
|
39232
|
+
var isSameOrAfterExports = isSameOrAfter$1.exports;
|
|
39233
|
+
var isSameOrAfter = /*@__PURE__*/getDefaultExportFromCjs(isSameOrAfterExports);
|
|
38580
39234
|
/* eslint-disable no-unused-vars */
|
|
38581
39235
|
|
|
38582
|
-
|
|
38583
|
-
|
|
39236
|
+
var createValidator = function createValidator(type, error) {
|
|
39237
|
+
var validator = function validator() {
|
|
39238
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
39239
|
+
args[_key2] = arguments[_key2];
|
|
39240
|
+
}
|
|
39241
|
+
|
|
39242
|
+
return {
|
|
39243
|
+
type: type,
|
|
39244
|
+
args: args,
|
|
39245
|
+
error: error
|
|
39246
|
+
};
|
|
39247
|
+
};
|
|
39248
|
+
|
|
38584
39249
|
validator.error = error;
|
|
38585
39250
|
return validator;
|
|
38586
39251
|
};
|
|
@@ -38588,30 +39253,38 @@ const createValidator = (type, error) => {
|
|
|
38588
39253
|
dayjs.extend(customParseFormat);
|
|
38589
39254
|
dayjs.extend(isSameOrBefore);
|
|
38590
39255
|
dayjs.extend(isSameOrAfter);
|
|
39256
|
+
var validatorFns = {};
|
|
39257
|
+
var INCLUDED_IN = "validator/INCLUDED_IN";
|
|
39258
|
+
var INCLUDED_IN_ERROR = "error/INCLUDED_IN";
|
|
39259
|
+
var includedIn = createValidator(INCLUDED_IN, INCLUDED_IN_ERROR);
|
|
39260
|
+
|
|
39261
|
+
validatorFns[INCLUDED_IN] = function (value, args, form) {
|
|
39262
|
+
return Array.isArray(args[0]) ? args[0].includes(value) : args[0] === value;
|
|
39263
|
+
};
|
|
38591
39264
|
|
|
38592
|
-
|
|
39265
|
+
var REQUIRED = "validator/REQUIRED";
|
|
39266
|
+
var REQUIRED_ERROR = "error/REQUIRED";
|
|
39267
|
+
var required = createValidator(REQUIRED, REQUIRED_ERROR);
|
|
38593
39268
|
|
|
38594
|
-
|
|
38595
|
-
|
|
38596
|
-
|
|
38597
|
-
validatorFns[INCLUDED_IN] = (value, args, form) =>
|
|
38598
|
-
Array.isArray(args[0]) ? args[0].includes(value) : args[0] === value;
|
|
39269
|
+
validatorFns[REQUIRED] = function (value, args, form) {
|
|
39270
|
+
return value !== "";
|
|
39271
|
+
};
|
|
38599
39272
|
|
|
38600
|
-
|
|
38601
|
-
|
|
38602
|
-
|
|
38603
|
-
validatorFns[REQUIRED] = (value, args, form) => value !== "";
|
|
39273
|
+
var ONLY_INTEGERS = "validator/ONLY_INTEGERS";
|
|
39274
|
+
var ONLY_INTEGERS_ERROR = "error/ONLY_INTEGERS";
|
|
39275
|
+
var onlyIntegers = createValidator(ONLY_INTEGERS, ONLY_INTEGERS_ERROR);
|
|
38604
39276
|
|
|
38605
|
-
|
|
38606
|
-
|
|
38607
|
-
|
|
38608
|
-
validatorFns[ONLY_INTEGERS] = (value, args, form) => /^(-?\d+)?$/.test(value);
|
|
39277
|
+
validatorFns[ONLY_INTEGERS] = function (value, args, form) {
|
|
39278
|
+
return /^(-?\d+)?$/.test(value);
|
|
39279
|
+
};
|
|
38609
39280
|
|
|
38610
|
-
|
|
38611
|
-
|
|
38612
|
-
|
|
38613
|
-
validatorFns[ONLY_NATURALS] = (value, args, form) => /^(\d+)?$/.test(value);
|
|
39281
|
+
var ONLY_NATURALS = "validator/ONLY_NATURALS";
|
|
39282
|
+
var ONLY_NATURALS_ERROR = "error/ONLY_NATURALS";
|
|
39283
|
+
var onlyNaturals = createValidator(ONLY_NATURALS, ONLY_NATURALS_ERROR);
|
|
38614
39284
|
|
|
39285
|
+
validatorFns[ONLY_NATURALS] = function (value, args, form) {
|
|
39286
|
+
return /^(\d+)?$/.test(value);
|
|
39287
|
+
};
|
|
38615
39288
|
/*
|
|
38616
39289
|
07/22: experimental expiration date constraint
|
|
38617
39290
|
should allow entry of expiration date using "/" character
|
|
@@ -38621,439 +39294,464 @@ not tested as validation function
|
|
|
38621
39294
|
to validate exp date instead use combo of:
|
|
38622
39295
|
required(), hasLength(), isValidMonth(), dateAfterToday()
|
|
38623
39296
|
*/
|
|
38624
|
-
|
|
38625
|
-
|
|
38626
|
-
|
|
38627
|
-
|
|
38628
|
-
|
|
38629
|
-
|
|
38630
|
-
validatorFns[ONLY_EXPIRATION_DATE] = (value, args, form)
|
|
38631
|
-
/^(\d?\d?\/?\d?\d?)?$/.test(value);
|
|
38632
|
-
|
|
38633
|
-
|
|
38634
|
-
|
|
38635
|
-
|
|
38636
|
-
|
|
38637
|
-
|
|
38638
|
-
)
|
|
38639
|
-
validatorFns[NUMBER_LESS_THAN] = (value, args, form) => {
|
|
39297
|
+
|
|
39298
|
+
|
|
39299
|
+
var ONLY_EXPIRATION_DATE = "validator/ONLY_EXPIRATION_DATE";
|
|
39300
|
+
var ONLY_EXPIRATION_DATE_ERROR = "error/ONLY_EXPIRATION_DATE";
|
|
39301
|
+
var onlyExpirationDate = createValidator(ONLY_EXPIRATION_DATE, ONLY_EXPIRATION_DATE_ERROR);
|
|
39302
|
+
|
|
39303
|
+
validatorFns[ONLY_EXPIRATION_DATE] = function (value, args, form) {
|
|
39304
|
+
return /^(\d?\d?\/?\d?\d?)?$/.test(value);
|
|
39305
|
+
};
|
|
39306
|
+
|
|
39307
|
+
var NUMBER_LESS_THAN = "validator/NUMBER_LESS_THAN";
|
|
39308
|
+
var NUMBER_LESS_THAN_ERROR = "error/NUMBER_LESS_THAN";
|
|
39309
|
+
var numberLessThan = createValidator(NUMBER_LESS_THAN, NUMBER_LESS_THAN_ERROR);
|
|
39310
|
+
|
|
39311
|
+
validatorFns[NUMBER_LESS_THAN] = function (value, args, form) {
|
|
38640
39312
|
if (value === "") {
|
|
38641
39313
|
return true;
|
|
38642
39314
|
}
|
|
39315
|
+
|
|
38643
39316
|
return Number(value) < args[0];
|
|
38644
39317
|
};
|
|
38645
39318
|
|
|
38646
|
-
|
|
38647
|
-
|
|
38648
|
-
|
|
38649
|
-
|
|
38650
|
-
|
|
38651
|
-
NUMBER_LESS_THAN_OR_EQUAL_TO,
|
|
38652
|
-
NUMBER_LESS_THAN_OR_EQUAL_TO_ERROR
|
|
38653
|
-
);
|
|
38654
|
-
validatorFns[NUMBER_LESS_THAN_OR_EQUAL_TO] = (value, args, form) => {
|
|
39319
|
+
var NUMBER_LESS_THAN_OR_EQUAL_TO = "validator/NUMBER_LESS_THAN_OR_EQUAL_TO";
|
|
39320
|
+
var NUMBER_LESS_THAN_OR_EQUAL_TO_ERROR = "error/NUMBER_LESS_THAN_OR_EQUAL_TO";
|
|
39321
|
+
var numberLessThanOrEqualTo = createValidator(NUMBER_LESS_THAN_OR_EQUAL_TO, NUMBER_LESS_THAN_OR_EQUAL_TO_ERROR);
|
|
39322
|
+
|
|
39323
|
+
validatorFns[NUMBER_LESS_THAN_OR_EQUAL_TO] = function (value, args, form) {
|
|
38655
39324
|
if (value === "") {
|
|
38656
39325
|
return true;
|
|
38657
39326
|
}
|
|
39327
|
+
|
|
38658
39328
|
return Number(value) <= args[0];
|
|
38659
39329
|
};
|
|
38660
39330
|
|
|
38661
|
-
|
|
38662
|
-
|
|
38663
|
-
|
|
38664
|
-
|
|
38665
|
-
|
|
38666
|
-
);
|
|
38667
|
-
validatorFns[NUMBER_GREATER_THAN] = (value, args, form) => {
|
|
39331
|
+
var NUMBER_GREATER_THAN = "validator/NUMBER_GREATER_THAN";
|
|
39332
|
+
var NUMBER_GREATER_THAN_ERROR = "error/NUMBER_GREATER_THAN";
|
|
39333
|
+
var numberGreaterThan = createValidator(NUMBER_GREATER_THAN, NUMBER_GREATER_THAN_ERROR);
|
|
39334
|
+
|
|
39335
|
+
validatorFns[NUMBER_GREATER_THAN] = function (value, args, form) {
|
|
38668
39336
|
if (value === "") {
|
|
38669
39337
|
return true;
|
|
38670
39338
|
}
|
|
39339
|
+
|
|
38671
39340
|
return Number(value) > args[0];
|
|
38672
39341
|
};
|
|
38673
39342
|
|
|
38674
|
-
|
|
38675
|
-
|
|
38676
|
-
|
|
38677
|
-
|
|
38678
|
-
|
|
38679
|
-
NUMBER_GREATER_THAN_OR_EQUAL_TO,
|
|
38680
|
-
NUMBER_GREATER_THAN_OR_EQUAL_TO_ERROR
|
|
38681
|
-
);
|
|
38682
|
-
validatorFns[NUMBER_GREATER_THAN_OR_EQUAL_TO] = (value, args, form) => {
|
|
39343
|
+
var NUMBER_GREATER_THAN_OR_EQUAL_TO = "validator/NUMBER_GREATER_THAN_OR_EQUAL_TO";
|
|
39344
|
+
var NUMBER_GREATER_THAN_OR_EQUAL_TO_ERROR = "error/NUMBER_GREATER_THAN_OR_EQUAL_TO";
|
|
39345
|
+
var numberGreaterThanOrEqualTo = createValidator(NUMBER_GREATER_THAN_OR_EQUAL_TO, NUMBER_GREATER_THAN_OR_EQUAL_TO_ERROR);
|
|
39346
|
+
|
|
39347
|
+
validatorFns[NUMBER_GREATER_THAN_OR_EQUAL_TO] = function (value, args, form) {
|
|
38683
39348
|
if (value === "") {
|
|
38684
39349
|
return true;
|
|
38685
39350
|
}
|
|
39351
|
+
|
|
38686
39352
|
return Number(value) >= args[0];
|
|
38687
39353
|
};
|
|
38688
39354
|
|
|
38689
|
-
|
|
38690
|
-
|
|
38691
|
-
|
|
38692
|
-
|
|
38693
|
-
|
|
39355
|
+
var MATCHES_FIELD = "validator/MATCHES_FIELD";
|
|
39356
|
+
var MATCHES_FIELD_ERROR$1 = "error/MATCHES_FIELD";
|
|
39357
|
+
var matchesField = createValidator(MATCHES_FIELD, MATCHES_FIELD_ERROR$1);
|
|
39358
|
+
|
|
39359
|
+
validatorFns[MATCHES_FIELD] = function (value, args, form) {
|
|
39360
|
+
var dependentField = form[args[0]];
|
|
39361
|
+
|
|
38694
39362
|
if (dependentField === undefined) {
|
|
38695
|
-
throw new Error(
|
|
38696
|
-
`${args[0]} was passed to matchesField, but that field does not exist in the form`
|
|
38697
|
-
);
|
|
39363
|
+
throw new Error("".concat(args[0], " was passed to matchesField, but that field does not exist in the form"));
|
|
38698
39364
|
}
|
|
38699
|
-
|
|
39365
|
+
|
|
39366
|
+
var dependentFieldValue = dependentField.rawValue;
|
|
38700
39367
|
return value === dependentFieldValue;
|
|
38701
39368
|
};
|
|
38702
39369
|
|
|
38703
|
-
|
|
38704
|
-
|
|
38705
|
-
|
|
38706
|
-
|
|
38707
|
-
|
|
38708
|
-
|
|
38709
|
-
|
|
38710
|
-
|
|
38711
|
-
|
|
38712
|
-
|
|
38713
|
-
|
|
38714
|
-
|
|
38715
|
-
|
|
38716
|
-
|
|
38717
|
-
|
|
38718
|
-
type: VALIDATE_WHEN,
|
|
38719
|
-
args: [dependentValidator, primaryValidator, optionalFieldName],
|
|
38720
|
-
error: dependentValidator.error
|
|
38721
|
-
});
|
|
39370
|
+
var validateWhenErrorMessage = function validateWhenErrorMessage(type) {
|
|
39371
|
+
return "".concat(type, " was passed to validateWhen, but that validator type does not exist.\n Please check that you are only calling validator creator functions exported from\n redux-freeform in your form config and that you didn't forget to\n invoke the validator creator (you cannot pass the functions themselves to\n createFormState). Also make sure you aren't passing validateWhen() to validateWhen\n as the primary validator.");
|
|
39372
|
+
};
|
|
39373
|
+
|
|
39374
|
+
var VALIDATE_WHEN = "validator/VALIDATE_WHEN";
|
|
39375
|
+
var VALIDATE_WHEN_ERROR = "error/VALIDATE_WHEN";
|
|
39376
|
+
|
|
39377
|
+
var validateWhen = function validateWhen(dependentValidator, primaryValidator, optionalFieldName) {
|
|
39378
|
+
return {
|
|
39379
|
+
type: VALIDATE_WHEN,
|
|
39380
|
+
args: [dependentValidator, primaryValidator, optionalFieldName],
|
|
39381
|
+
error: dependentValidator.error
|
|
39382
|
+
};
|
|
39383
|
+
};
|
|
39384
|
+
|
|
38722
39385
|
validateWhen.error = VALIDATE_WHEN_ERROR;
|
|
38723
|
-
|
|
38724
|
-
|
|
38725
|
-
|
|
38726
|
-
|
|
38727
|
-
|
|
38728
|
-
|
|
38729
|
-
|
|
38730
|
-
|
|
39386
|
+
|
|
39387
|
+
validatorFns[VALIDATE_WHEN] = function (value, args, form) {
|
|
39388
|
+
var _args = _slicedToArray(args, 3),
|
|
39389
|
+
dependentValidator = _args[0],
|
|
39390
|
+
primaryValidator = _args[1],
|
|
39391
|
+
optionalFieldName = _args[2];
|
|
39392
|
+
|
|
39393
|
+
var dependsOnOtherField = typeof optionalFieldName === "string";
|
|
39394
|
+
|
|
39395
|
+
if (primaryValidator.type === undefined || typeof validatorFns[primaryValidator.type] !== "function") {
|
|
38731
39396
|
throw new Error(validateWhenErrorMessage(primaryValidator.type));
|
|
38732
39397
|
}
|
|
39398
|
+
|
|
38733
39399
|
if (dependsOnOtherField && form[optionalFieldName] === undefined) {
|
|
38734
|
-
throw new Error(
|
|
38735
|
-
`${args[2]} was passed to matchesField, but that field does not exist in the form`
|
|
38736
|
-
);
|
|
39400
|
+
throw new Error("".concat(args[2], " was passed to matchesField, but that field does not exist in the form"));
|
|
38737
39401
|
}
|
|
38738
39402
|
|
|
38739
|
-
|
|
38740
|
-
|
|
38741
|
-
|
|
38742
|
-
);
|
|
38743
|
-
|
|
38744
|
-
|
|
38745
|
-
|
|
38746
|
-
|
|
38747
|
-
|
|
38748
|
-
|
|
38749
|
-
|
|
38750
|
-
|
|
38751
|
-
|
|
38752
|
-
|
|
38753
|
-
|
|
38754
|
-
|
|
38755
|
-
|
|
38756
|
-
|
|
38757
|
-
|
|
38758
|
-
|
|
38759
|
-
|
|
38760
|
-
|
|
38761
|
-
const validateSumErrorMessage = type =>
|
|
38762
|
-
`${type} was passed to validateSum, but that validator type does not exist.
|
|
38763
|
-
Please check that you are only calling validator creator functions exported from
|
|
38764
|
-
redux-freeform in your form config and that you didn't forget to
|
|
38765
|
-
invoke the validator creator (you cannot pass the functions themselves to
|
|
38766
|
-
createFormState).`;
|
|
38767
|
-
const VALIDATE_SUM = "validator/VALIDATE_SUM";
|
|
38768
|
-
const VALIDATE_SUM_ERROR = "error/VALIDATE_SUM";
|
|
38769
|
-
const validateSum = (validator, fieldNamesArray) => ({
|
|
38770
|
-
type: VALIDATE_SUM,
|
|
38771
|
-
args: [validator, fieldNamesArray],
|
|
38772
|
-
error: validator.error
|
|
38773
|
-
});
|
|
39403
|
+
var primaryPredicate = validatorToPredicate(validatorFns[primaryValidator.type], false);
|
|
39404
|
+
var primaryValue = dependsOnOtherField ? form[optionalFieldName].rawValue : value;
|
|
39405
|
+
var primaryPredicatePassed = primaryPredicate(primaryValue, primaryValidator.args, form);
|
|
39406
|
+
return primaryPredicatePassed ? validatorFns[dependentValidator.type](value, dependentValidator.args, form) : true;
|
|
39407
|
+
};
|
|
39408
|
+
|
|
39409
|
+
var validateSumErrorMessage = function validateSumErrorMessage(type) {
|
|
39410
|
+
return "".concat(type, " was passed to validateSum, but that validator type does not exist.\n Please check that you are only calling validator creator functions exported from\n redux-freeform in your form config and that you didn't forget to\n invoke the validator creator (you cannot pass the functions themselves to\n createFormState).");
|
|
39411
|
+
};
|
|
39412
|
+
|
|
39413
|
+
var VALIDATE_SUM = "validator/VALIDATE_SUM";
|
|
39414
|
+
var VALIDATE_SUM_ERROR = "error/VALIDATE_SUM";
|
|
39415
|
+
|
|
39416
|
+
var validateSum = function validateSum(validator, fieldNamesArray) {
|
|
39417
|
+
return {
|
|
39418
|
+
type: VALIDATE_SUM,
|
|
39419
|
+
args: [validator, fieldNamesArray],
|
|
39420
|
+
error: validator.error
|
|
39421
|
+
};
|
|
39422
|
+
};
|
|
39423
|
+
|
|
38774
39424
|
validateSum.error = VALIDATE_SUM_ERROR;
|
|
38775
|
-
validatorFns[VALIDATE_SUM] = (value, args, form) => {
|
|
38776
|
-
const [validator, fieldNamesArray] = args;
|
|
38777
39425
|
|
|
38778
|
-
|
|
38779
|
-
|
|
38780
|
-
|
|
38781
|
-
|
|
39426
|
+
validatorFns[VALIDATE_SUM] = function (value, args, form) {
|
|
39427
|
+
var _args2 = _slicedToArray(args, 2),
|
|
39428
|
+
validator = _args2[0],
|
|
39429
|
+
fieldNamesArray = _args2[1];
|
|
39430
|
+
|
|
39431
|
+
if (validator.type === undefined || typeof validatorFns[validator.type] !== "function") {
|
|
38782
39432
|
throw new Error(validateSumErrorMessage(validator.type));
|
|
38783
39433
|
}
|
|
38784
39434
|
|
|
38785
|
-
|
|
38786
|
-
|
|
38787
|
-
|
|
38788
|
-
|
|
38789
|
-
|
|
39435
|
+
var _iterator = _createForOfIteratorHelper(fieldNamesArray),
|
|
39436
|
+
_step;
|
|
39437
|
+
|
|
39438
|
+
try {
|
|
39439
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
39440
|
+
var fieldName = _step.value;
|
|
39441
|
+
|
|
39442
|
+
if (form[fieldName] === undefined) {
|
|
39443
|
+
throw new Error("".concat(fieldName, " was passed to matchesField, but that field does not exist in the form"));
|
|
39444
|
+
}
|
|
38790
39445
|
}
|
|
39446
|
+
} catch (err) {
|
|
39447
|
+
_iterator.e(err);
|
|
39448
|
+
} finally {
|
|
39449
|
+
_iterator.f();
|
|
38791
39450
|
}
|
|
38792
39451
|
|
|
38793
|
-
|
|
38794
|
-
|
|
38795
|
-
|
|
38796
|
-
);
|
|
38797
|
-
|
|
39452
|
+
var sum = fieldNamesArray.reduce(function (acc, curr) {
|
|
39453
|
+
return acc + Number(form[curr].rawValue);
|
|
39454
|
+
}, Number(value));
|
|
38798
39455
|
return validatorFns[validator.type](sum, validator.args, form);
|
|
38799
39456
|
};
|
|
38800
39457
|
|
|
38801
|
-
|
|
38802
|
-
|
|
38803
|
-
|
|
38804
|
-
|
|
39458
|
+
var HAS_LENGTH = "validator/HAS_LENGTH";
|
|
39459
|
+
var HAS_LENGTH_ERROR = "error/HAS_LENGTH";
|
|
39460
|
+
var hasLength = createValidator(HAS_LENGTH, HAS_LENGTH_ERROR);
|
|
39461
|
+
|
|
39462
|
+
validatorFns[HAS_LENGTH] = function (value, args, form) {
|
|
38805
39463
|
if (value === "") {
|
|
38806
39464
|
return true;
|
|
38807
39465
|
}
|
|
38808
|
-
|
|
38809
|
-
|
|
39466
|
+
|
|
39467
|
+
var min = args[0];
|
|
39468
|
+
var max = args[1];
|
|
39469
|
+
|
|
38810
39470
|
if (max == undefined || min == undefined) {
|
|
38811
|
-
throw new Error(
|
|
38812
|
-
"Max and min need to be defined for hasLength, both or one of them is undefined"
|
|
38813
|
-
);
|
|
39471
|
+
throw new Error("Max and min need to be defined for hasLength, both or one of them is undefined");
|
|
38814
39472
|
}
|
|
39473
|
+
|
|
38815
39474
|
if (max < min) {
|
|
38816
|
-
throw new Error(
|
|
38817
|
-
"hasLength validator was passed a min greater than the max"
|
|
38818
|
-
);
|
|
39475
|
+
throw new Error("hasLength validator was passed a min greater than the max");
|
|
38819
39476
|
}
|
|
38820
|
-
|
|
39477
|
+
|
|
39478
|
+
var valueLength = value.length;
|
|
38821
39479
|
return max >= valueLength && valueLength >= min;
|
|
38822
39480
|
};
|
|
38823
39481
|
|
|
38824
|
-
|
|
38825
|
-
|
|
38826
|
-
|
|
38827
|
-
|
|
38828
|
-
|
|
38829
|
-
);
|
|
38830
|
-
validatorFns[DATE_BEFORE_TODAY] = (value, args, form) => {
|
|
39482
|
+
var DATE_BEFORE_TODAY = "validator/DATE_BEFORE_TODAY";
|
|
39483
|
+
var DATE_BEFORE_TODAY_ERROR = "error/DATE_BEFORE_TODAY";
|
|
39484
|
+
var dateBeforeToday = createValidator(DATE_BEFORE_TODAY, DATE_BEFORE_TODAY_ERROR);
|
|
39485
|
+
|
|
39486
|
+
validatorFns[DATE_BEFORE_TODAY] = function (value, args, form) {
|
|
38831
39487
|
if (value === "") {
|
|
38832
39488
|
return true;
|
|
38833
39489
|
}
|
|
38834
|
-
|
|
38835
|
-
|
|
38836
|
-
|
|
39490
|
+
|
|
39491
|
+
var dateFormat = args[0];
|
|
39492
|
+
var unit = args[1];
|
|
39493
|
+
var inclusive = args[2] || false;
|
|
38837
39494
|
|
|
38838
39495
|
if (dateFormat == undefined || unit == undefined) {
|
|
38839
|
-
throw new Error(
|
|
38840
|
-
"Date format and unit need to be defined for dateBeforeToday, one or both are undefined"
|
|
38841
|
-
);
|
|
39496
|
+
throw new Error("Date format and unit need to be defined for dateBeforeToday, one or both are undefined");
|
|
38842
39497
|
}
|
|
38843
|
-
|
|
38844
|
-
|
|
39498
|
+
|
|
39499
|
+
var now = dayjs();
|
|
39500
|
+
var dateValue = dayjs(value, dateFormat);
|
|
38845
39501
|
|
|
38846
39502
|
if (inclusive === true) {
|
|
38847
39503
|
return dateValue.isSameOrBefore(now, unit);
|
|
38848
39504
|
}
|
|
39505
|
+
|
|
38849
39506
|
return dateValue.isBefore(now, unit);
|
|
38850
39507
|
};
|
|
38851
39508
|
|
|
38852
|
-
|
|
38853
|
-
|
|
38854
|
-
|
|
38855
|
-
|
|
38856
|
-
|
|
38857
|
-
);
|
|
38858
|
-
validatorFns[DATE_AFTER_TODAY] = (value, args, form) => {
|
|
39509
|
+
var DATE_AFTER_TODAY = "validator/DATE_AFTER_TODAY";
|
|
39510
|
+
var DATE_AFTER_TODAY_ERROR = "error/DATE_AFTER_TODAY";
|
|
39511
|
+
var dateAfterToday = createValidator(DATE_AFTER_TODAY, DATE_AFTER_TODAY_ERROR);
|
|
39512
|
+
|
|
39513
|
+
validatorFns[DATE_AFTER_TODAY] = function (value, args, form) {
|
|
38859
39514
|
if (value === "") {
|
|
38860
39515
|
return true;
|
|
38861
39516
|
}
|
|
38862
|
-
|
|
38863
|
-
|
|
38864
|
-
|
|
39517
|
+
|
|
39518
|
+
var dateFormat = args[0];
|
|
39519
|
+
var unit = args[1];
|
|
39520
|
+
var inclusive = args[2] || false;
|
|
38865
39521
|
|
|
38866
39522
|
if (dateFormat == undefined || unit == undefined) {
|
|
38867
|
-
throw new Error(
|
|
38868
|
-
"Date format and unit need to be defined for dateAfterToday, one or both are undefined"
|
|
38869
|
-
);
|
|
39523
|
+
throw new Error("Date format and unit need to be defined for dateAfterToday, one or both are undefined");
|
|
38870
39524
|
}
|
|
38871
|
-
|
|
38872
|
-
|
|
39525
|
+
|
|
39526
|
+
var now = dayjs();
|
|
39527
|
+
var dateValue = dayjs(value, dateFormat);
|
|
38873
39528
|
|
|
38874
39529
|
if (inclusive === true) {
|
|
38875
39530
|
return dateValue.isSameOrAfter(now, unit);
|
|
38876
39531
|
}
|
|
39532
|
+
|
|
38877
39533
|
return dateValue.isAfter(now, unit);
|
|
38878
39534
|
};
|
|
38879
39535
|
|
|
38880
|
-
|
|
38881
|
-
|
|
38882
|
-
|
|
38883
|
-
|
|
38884
|
-
|
|
38885
|
-
);
|
|
38886
|
-
validatorFns[IS_VALID_MONTH] = (value, args, form) => {
|
|
39536
|
+
var IS_VALID_MONTH = "validator/IS_VALID_MONTH";
|
|
39537
|
+
var IS_VALID_MONTH_ERROR = "error/IS_VALID_MONTH";
|
|
39538
|
+
var isValidMonth = createValidator(IS_VALID_MONTH, IS_VALID_MONTH_ERROR);
|
|
39539
|
+
|
|
39540
|
+
validatorFns[IS_VALID_MONTH] = function (value, args, form) {
|
|
38887
39541
|
if (value === "") {
|
|
38888
39542
|
return true;
|
|
38889
|
-
}
|
|
38890
|
-
// Function takes one argument representing the character position
|
|
39543
|
+
} // Function takes one argument representing the character position
|
|
38891
39544
|
// In a date string to identify where the month is
|
|
38892
39545
|
// Eg "10/21/2021" - start position is 0
|
|
38893
39546
|
// Or "18/03/1990" - start position is 3
|
|
38894
39547
|
// Only works with two digit months (01, 02, 03, etc)
|
|
38895
|
-
|
|
38896
|
-
|
|
38897
|
-
|
|
39548
|
+
|
|
39549
|
+
|
|
39550
|
+
var monthStartPosition = parseInt(args[0]);
|
|
39551
|
+
var monthEndPosition = monthStartPosition + 2;
|
|
39552
|
+
|
|
39553
|
+
if (isNaN(monthStartPosition)) {
|
|
38898
39554
|
throw new Error("Month start position has to be a valid integer string");
|
|
38899
39555
|
}
|
|
38900
|
-
|
|
38901
|
-
|
|
39556
|
+
|
|
39557
|
+
var month = parseInt(value.slice(monthStartPosition, monthEndPosition));
|
|
39558
|
+
|
|
39559
|
+
if (isNaN(month)) {
|
|
38902
39560
|
return false;
|
|
38903
39561
|
}
|
|
39562
|
+
|
|
38904
39563
|
return month >= 1 && month <= 12;
|
|
38905
39564
|
};
|
|
38906
39565
|
|
|
38907
|
-
|
|
38908
|
-
|
|
38909
|
-
|
|
38910
|
-
|
|
39566
|
+
var MATCHES_REGEX = "validator/MATCHES_REGEX";
|
|
39567
|
+
var MATCHES_REGEX_ERROR = "error/MATCHES_REGEX";
|
|
39568
|
+
var matchesRegex = createValidator(MATCHES_REGEX, MATCHES_REGEX_ERROR);
|
|
39569
|
+
|
|
39570
|
+
validatorFns[MATCHES_REGEX] = function (value, args, form) {
|
|
38911
39571
|
if (value === "") {
|
|
38912
39572
|
return true;
|
|
38913
39573
|
}
|
|
39574
|
+
|
|
38914
39575
|
return new RegExp(args[0]).test(value); // new RexExp never throws an error, no matter the input
|
|
38915
|
-
};
|
|
39576
|
+
}; // based on http://www.brainjar.com/js/validation/
|
|
38916
39577
|
|
|
38917
|
-
|
|
38918
|
-
|
|
38919
|
-
|
|
38920
|
-
|
|
38921
|
-
|
|
38922
|
-
|
|
38923
|
-
);
|
|
38924
|
-
validatorFns[IS_ROUTING_NUMBER] = (value, args, form) => {
|
|
39578
|
+
|
|
39579
|
+
var IS_ROUTING_NUMBER = "validator/IS_ROUTING_NUMBER";
|
|
39580
|
+
var IS_ROUTING_NUMBER_ERROR = "error/IS_ROUTING_NUMBER";
|
|
39581
|
+
var isRoutingNumber = createValidator(IS_ROUTING_NUMBER, IS_ROUTING_NUMBER_ERROR);
|
|
39582
|
+
|
|
39583
|
+
validatorFns[IS_ROUTING_NUMBER] = function (value, args, form) {
|
|
38925
39584
|
if (value === "") {
|
|
38926
39585
|
return true;
|
|
38927
39586
|
}
|
|
39587
|
+
|
|
38928
39588
|
if (value.length != 9) {
|
|
38929
39589
|
return false;
|
|
38930
39590
|
}
|
|
38931
|
-
|
|
38932
|
-
|
|
38933
|
-
|
|
38934
|
-
|
|
38935
|
-
|
|
38936
|
-
|
|
38937
|
-
|
|
38938
|
-
|
|
38939
|
-
|
|
38940
|
-
|
|
38941
|
-
|
|
38942
|
-
|
|
38943
|
-
|
|
39591
|
+
|
|
39592
|
+
var sum = value.split("").map(function (ch) {
|
|
39593
|
+
return parseInt(ch);
|
|
39594
|
+
}).reduce(function (acc, cur, idx) {
|
|
39595
|
+
switch (idx % 3) {
|
|
39596
|
+
case 0:
|
|
39597
|
+
return acc + 3 * cur;
|
|
39598
|
+
|
|
39599
|
+
case 1:
|
|
39600
|
+
return acc + 7 * cur;
|
|
39601
|
+
|
|
39602
|
+
case 2:
|
|
39603
|
+
return acc + 1 * cur;
|
|
39604
|
+
}
|
|
39605
|
+
}, 0);
|
|
38944
39606
|
return sum != 0 && sum % 10 == 0;
|
|
38945
39607
|
};
|
|
38946
39608
|
|
|
38947
|
-
|
|
38948
|
-
|
|
38949
|
-
|
|
38950
|
-
|
|
39609
|
+
var HAS_NUMBER = "validator/HAS_NUMBER";
|
|
39610
|
+
var HAS_NUMBER_ERROR$1 = "error/HAS_NUMBER";
|
|
39611
|
+
var hasNumber = createValidator(HAS_NUMBER, HAS_NUMBER_ERROR$1);
|
|
39612
|
+
|
|
39613
|
+
validatorFns[HAS_NUMBER] = function (value, args, form) {
|
|
38951
39614
|
if (value === "") {
|
|
38952
39615
|
return true;
|
|
38953
39616
|
}
|
|
39617
|
+
|
|
38954
39618
|
return new RegExp(/[0-9]/).test(value);
|
|
38955
39619
|
};
|
|
38956
39620
|
|
|
38957
|
-
|
|
38958
|
-
|
|
38959
|
-
|
|
38960
|
-
|
|
38961
|
-
|
|
38962
|
-
);
|
|
38963
|
-
validatorFns[HAS_LOWERCASE_LETTER] = (value, args, form) => {
|
|
39621
|
+
var HAS_LOWERCASE_LETTER = "validator/HAS_LOWERCASE_LETTER";
|
|
39622
|
+
var HAS_LOWERCASE_LETTER_ERROR$1 = "error/HAS_LOWERCASE_LETTER";
|
|
39623
|
+
var hasLowercaseLetter = createValidator(HAS_LOWERCASE_LETTER, HAS_LOWERCASE_LETTER_ERROR$1);
|
|
39624
|
+
|
|
39625
|
+
validatorFns[HAS_LOWERCASE_LETTER] = function (value, args, form) {
|
|
38964
39626
|
if (value === "") {
|
|
38965
39627
|
return true;
|
|
38966
39628
|
}
|
|
39629
|
+
|
|
38967
39630
|
return new RegExp(/[a-z]/).test(value);
|
|
38968
39631
|
};
|
|
38969
39632
|
|
|
38970
|
-
|
|
38971
|
-
|
|
38972
|
-
|
|
38973
|
-
|
|
38974
|
-
|
|
38975
|
-
);
|
|
38976
|
-
validatorFns[HAS_UPPERCASE_LETTER] = (value, args, form) => {
|
|
39633
|
+
var HAS_UPPERCASE_LETTER = "validator/HAS_UPPERCASE_LETTER";
|
|
39634
|
+
var HAS_UPPERCASE_LETTER_ERROR$1 = "error/HAS_UPPERCASE_LETTER";
|
|
39635
|
+
var hasUppercaseLetter = createValidator(HAS_UPPERCASE_LETTER, HAS_UPPERCASE_LETTER_ERROR$1);
|
|
39636
|
+
|
|
39637
|
+
validatorFns[HAS_UPPERCASE_LETTER] = function (value, args, form) {
|
|
38977
39638
|
if (value === "") {
|
|
38978
39639
|
return true;
|
|
38979
39640
|
}
|
|
39641
|
+
|
|
38980
39642
|
return new RegExp(/[A-Z]/).test(value);
|
|
38981
39643
|
};
|
|
38982
39644
|
|
|
38983
|
-
|
|
38984
|
-
|
|
38985
|
-
|
|
38986
|
-
|
|
38987
|
-
|
|
38988
|
-
);
|
|
38989
|
-
validatorFns[HAS_SPECIAL_CHARACTER] = (value, args, form) => {
|
|
39645
|
+
var HAS_SPECIAL_CHARACTER = "validator/HAS_SPECIAL_CHARACTER";
|
|
39646
|
+
var HAS_SPECIAL_CHARACTER_ERROR$1 = "error/HAS_SPECIAL_CHARACTER";
|
|
39647
|
+
var hasSpecialCharacter = createValidator(HAS_SPECIAL_CHARACTER, HAS_SPECIAL_CHARACTER_ERROR$1);
|
|
39648
|
+
|
|
39649
|
+
validatorFns[HAS_SPECIAL_CHARACTER] = function (value, args, form) {
|
|
38990
39650
|
if (value === "") {
|
|
38991
39651
|
return true;
|
|
38992
39652
|
}
|
|
39653
|
+
|
|
38993
39654
|
return new RegExp(/[!@#$%^&*.?]/).test(value);
|
|
38994
39655
|
};
|
|
38995
39656
|
|
|
38996
|
-
|
|
38997
|
-
|
|
38998
|
-
|
|
38999
|
-
|
|
39000
|
-
|
|
39001
|
-
);
|
|
39002
|
-
validatorFns[IS_PROBABLY_EMAIL] = (value, args, form) => {
|
|
39657
|
+
var IS_PROBABLY_EMAIL = "validator/IS_PROBABLY_EMAIL";
|
|
39658
|
+
var IS_PROBABLY_EMAIL_ERROR = "error/IS_PROBABLY_EMAIL";
|
|
39659
|
+
var isProbablyEmail = createValidator(IS_PROBABLY_EMAIL, IS_PROBABLY_EMAIL_ERROR);
|
|
39660
|
+
|
|
39661
|
+
validatorFns[IS_PROBABLY_EMAIL] = function (value, args, form) {
|
|
39003
39662
|
if (value === "") {
|
|
39004
39663
|
return true;
|
|
39005
39664
|
}
|
|
39665
|
+
|
|
39006
39666
|
return new RegExp(/^\S+@\S+\.\S+$/).test(value);
|
|
39007
39667
|
};
|
|
39008
39668
|
|
|
39009
|
-
|
|
39010
|
-
|
|
39011
|
-
|
|
39012
|
-
|
|
39013
|
-
|
|
39014
|
-
|
|
39669
|
+
var runValidatorErrorMessage = function runValidatorErrorMessage(type) {
|
|
39670
|
+
return "".concat(type, " was passed to runValidator, but that validator type does not exist. \n Please check that you are only calling validator creator functions exported from \n redux-freeform in your form config and that you didn't forget to \n invoke the validator creator (you cannot pass the functions themselves to \n createFormState)");
|
|
39671
|
+
};
|
|
39672
|
+
|
|
39673
|
+
var runValidator = function runValidator(validator, value, form) {
|
|
39674
|
+
var validatorFn = validatorFns[validator.type];
|
|
39015
39675
|
|
|
39016
|
-
const runValidator = (validator, value, form) => {
|
|
39017
|
-
const validatorFn = validatorFns[validator.type];
|
|
39018
39676
|
if (validatorFn === undefined) {
|
|
39019
39677
|
throw new Error(runValidatorErrorMessage(validator.type));
|
|
39020
39678
|
}
|
|
39679
|
+
|
|
39021
39680
|
return validatorFn(value, validator.args, form) ? null : validator.error;
|
|
39022
39681
|
};
|
|
39023
39682
|
|
|
39024
|
-
|
|
39025
|
-
return validators
|
|
39026
|
-
|
|
39027
|
-
|
|
39683
|
+
var runFormValidators = function runFormValidators(fieldName, form, validators) {
|
|
39684
|
+
return validators.map(function (v) {
|
|
39685
|
+
return runValidator(v, form[fieldName].rawValue, form);
|
|
39686
|
+
}).filter(function (x) {
|
|
39687
|
+
return x !== null;
|
|
39688
|
+
});
|
|
39689
|
+
};
|
|
39690
|
+
|
|
39691
|
+
var computeConstraints = function computeConstraints(fieldName, form) {
|
|
39692
|
+
var constraints = form[fieldName].constraints;
|
|
39693
|
+
return runFormValidators(fieldName, form, constraints);
|
|
39694
|
+
};
|
|
39695
|
+
|
|
39696
|
+
var computeErrors = function computeErrors(fieldName, form) {
|
|
39697
|
+
var validators = form[fieldName].validators;
|
|
39698
|
+
return runFormValidators(fieldName, form, validators);
|
|
39028
39699
|
};
|
|
39029
39700
|
|
|
39030
|
-
|
|
39031
|
-
|
|
39032
|
-
|
|
39701
|
+
var computeErrorEntries = function computeErrorEntries(formState) {
|
|
39702
|
+
var fields = Object.entries(formState);
|
|
39703
|
+
|
|
39704
|
+
for (var _i = 0, _fields = fields; _i < _fields.length; _i++) {
|
|
39705
|
+
var entry = _fields[_i];
|
|
39706
|
+
var fieldName = entry[0];
|
|
39707
|
+
var errors = computeErrors(fieldName, formState);
|
|
39708
|
+
formState[fieldName].errors = errors;
|
|
39709
|
+
formState[fieldName].hasErrors = errors.length > 0;
|
|
39710
|
+
}
|
|
39033
39711
|
};
|
|
39034
39712
|
|
|
39035
|
-
|
|
39036
|
-
|
|
39037
|
-
|
|
39713
|
+
var computeDirtyEntries = function computeDirtyEntries(formState, changedFieldName) {
|
|
39714
|
+
var fields = Object.entries(formState);
|
|
39715
|
+
|
|
39716
|
+
for (var _i2 = 0, _fields2 = fields; _i2 < _fields2.length; _i2++) {
|
|
39717
|
+
var entry = _fields2[_i2];
|
|
39718
|
+
var fieldName = entry[0];
|
|
39719
|
+
var field = entry[1];
|
|
39720
|
+
var dirty = fieldName === changedFieldName ? true : field.dirty;
|
|
39721
|
+
formState[fieldName].dirty = dirty;
|
|
39722
|
+
}
|
|
39038
39723
|
};
|
|
39039
39724
|
|
|
39040
39725
|
var obj;
|
|
39041
|
-
var NOTHING = typeof Symbol !== "undefined" ? Symbol("immer-nothing") : (
|
|
39042
|
-
var DRAFTABLE = typeof Symbol !== "undefined" && Symbol
|
|
39043
|
-
var DRAFT_STATE = typeof Symbol !== "undefined" && Symbol
|
|
39726
|
+
var NOTHING = typeof Symbol !== "undefined" ? Symbol("immer-nothing") : (obj = {}, obj["immer-nothing"] = true, obj);
|
|
39727
|
+
var DRAFTABLE = typeof Symbol !== "undefined" && Symbol["for"] ? Symbol["for"]("immer-draftable") : "__$immer_draftable";
|
|
39728
|
+
var DRAFT_STATE = typeof Symbol !== "undefined" && Symbol["for"] ? Symbol["for"]("immer-state") : "__$immer_state";
|
|
39729
|
+
|
|
39044
39730
|
function isDraft(value) {
|
|
39045
39731
|
return !!value && !!value[DRAFT_STATE];
|
|
39046
39732
|
}
|
|
39733
|
+
|
|
39047
39734
|
function isDraftable(value) {
|
|
39048
|
-
if (!value) {
|
|
39735
|
+
if (!value) {
|
|
39736
|
+
return false;
|
|
39737
|
+
}
|
|
39738
|
+
|
|
39049
39739
|
return isPlainObject(value) || !!value[DRAFTABLE] || !!value.constructor[DRAFTABLE];
|
|
39050
39740
|
}
|
|
39741
|
+
|
|
39051
39742
|
function isPlainObject(value) {
|
|
39052
|
-
if (!value ||
|
|
39053
|
-
|
|
39743
|
+
if (!value || _typeof(value) !== "object") {
|
|
39744
|
+
return false;
|
|
39745
|
+
}
|
|
39746
|
+
|
|
39747
|
+
if (Array.isArray(value)) {
|
|
39748
|
+
return true;
|
|
39749
|
+
}
|
|
39750
|
+
|
|
39054
39751
|
var proto = Object.getPrototypeOf(value);
|
|
39055
39752
|
return !proto || proto === Object.prototype;
|
|
39056
39753
|
}
|
|
39754
|
+
|
|
39057
39755
|
var assign = Object.assign || function assign(target, value) {
|
|
39058
39756
|
for (var key in value) {
|
|
39059
39757
|
if (has$1(value, key)) {
|
|
@@ -39063,11 +39761,18 @@ var assign = Object.assign || function assign(target, value) {
|
|
|
39063
39761
|
|
|
39064
39762
|
return target;
|
|
39065
39763
|
};
|
|
39066
|
-
|
|
39764
|
+
|
|
39765
|
+
var ownKeys$2 = typeof Reflect !== "undefined" && Reflect.ownKeys ? Reflect.ownKeys : typeof Object.getOwnPropertySymbols !== "undefined" ? function (obj) {
|
|
39766
|
+
return Object.getOwnPropertyNames(obj).concat(Object.getOwnPropertySymbols(obj));
|
|
39767
|
+
} : Object.getOwnPropertyNames;
|
|
39768
|
+
|
|
39067
39769
|
function shallowCopy(base, invokeGetters) {
|
|
39068
|
-
if (
|
|
39770
|
+
if (invokeGetters === void 0) invokeGetters = false;
|
|
39771
|
+
|
|
39772
|
+
if (Array.isArray(base)) {
|
|
39773
|
+
return base.slice();
|
|
39774
|
+
}
|
|
39069
39775
|
|
|
39070
|
-
if (Array.isArray(base)) { return base.slice(); }
|
|
39071
39776
|
var clone = Object.create(Object.getPrototypeOf(base));
|
|
39072
39777
|
ownKeys$2(base).forEach(function (key) {
|
|
39073
39778
|
if (key === DRAFT_STATE) {
|
|
@@ -39097,20 +39802,28 @@ function shallowCopy(base, invokeGetters) {
|
|
|
39097
39802
|
});
|
|
39098
39803
|
return clone;
|
|
39099
39804
|
}
|
|
39805
|
+
|
|
39100
39806
|
function each(value, cb) {
|
|
39101
39807
|
if (Array.isArray(value)) {
|
|
39102
|
-
for (var i = 0; i < value.length; i++) {
|
|
39808
|
+
for (var i = 0; i < value.length; i++) {
|
|
39809
|
+
cb(i, value[i], value);
|
|
39810
|
+
}
|
|
39103
39811
|
} else {
|
|
39104
|
-
ownKeys$2(value).forEach(function (key) {
|
|
39812
|
+
ownKeys$2(value).forEach(function (key) {
|
|
39813
|
+
return cb(key, value[key], value);
|
|
39814
|
+
});
|
|
39105
39815
|
}
|
|
39106
39816
|
}
|
|
39817
|
+
|
|
39107
39818
|
function isEnumerable(base, prop) {
|
|
39108
39819
|
var desc = Object.getOwnPropertyDescriptor(base, prop);
|
|
39109
39820
|
return !!desc && desc.enumerable;
|
|
39110
39821
|
}
|
|
39822
|
+
|
|
39111
39823
|
function has$1(thing, prop) {
|
|
39112
39824
|
return Object.prototype.hasOwnProperty.call(thing, prop);
|
|
39113
39825
|
}
|
|
39826
|
+
|
|
39114
39827
|
function is(x, y) {
|
|
39115
39828
|
// From: https://github.com/facebook/fbjs/blob/c69904a511b900266935168223063dd8772dfc40/packages/fbjs/src/core/shallowEqual.js
|
|
39116
39829
|
if (x === y) {
|
|
@@ -39119,18 +39832,27 @@ function is(x, y) {
|
|
|
39119
39832
|
return x !== x && y !== y;
|
|
39120
39833
|
}
|
|
39121
39834
|
}
|
|
39835
|
+
|
|
39122
39836
|
function clone(obj) {
|
|
39123
|
-
if (!isDraftable(obj)) {
|
|
39124
|
-
|
|
39837
|
+
if (!isDraftable(obj)) {
|
|
39838
|
+
return obj;
|
|
39839
|
+
}
|
|
39840
|
+
|
|
39841
|
+
if (Array.isArray(obj)) {
|
|
39842
|
+
return obj.map(clone);
|
|
39843
|
+
}
|
|
39844
|
+
|
|
39125
39845
|
var cloned = Object.create(Object.getPrototypeOf(obj));
|
|
39126
39846
|
|
|
39127
|
-
for (var key in obj) {
|
|
39847
|
+
for (var key in obj) {
|
|
39848
|
+
cloned[key] = clone(obj[key]);
|
|
39849
|
+
}
|
|
39128
39850
|
|
|
39129
39851
|
return cloned;
|
|
39130
39852
|
}
|
|
39131
|
-
|
|
39132
39853
|
/** Each scope represents a `produce` call. */
|
|
39133
39854
|
|
|
39855
|
+
|
|
39134
39856
|
var ImmerScope = function ImmerScope(parent) {
|
|
39135
39857
|
this.drafts = [];
|
|
39136
39858
|
this.parent = parent; // Whenever the modified draft contains a draft from another scope, we
|
|
@@ -39141,7 +39863,7 @@ var ImmerScope = function ImmerScope(parent) {
|
|
|
39141
39863
|
this.patches = null;
|
|
39142
39864
|
};
|
|
39143
39865
|
|
|
39144
|
-
ImmerScope.prototype.usePatches = function usePatches
|
|
39866
|
+
ImmerScope.prototype.usePatches = function usePatches(patchListener) {
|
|
39145
39867
|
if (patchListener) {
|
|
39146
39868
|
this.patches = [];
|
|
39147
39869
|
this.inversePatches = [];
|
|
@@ -39149,17 +39871,18 @@ ImmerScope.prototype.usePatches = function usePatches (patchListener) {
|
|
|
39149
39871
|
}
|
|
39150
39872
|
};
|
|
39151
39873
|
|
|
39152
|
-
ImmerScope.prototype.revoke = function revoke$1
|
|
39874
|
+
ImmerScope.prototype.revoke = function revoke$1() {
|
|
39153
39875
|
this.leave();
|
|
39154
39876
|
this.drafts.forEach(revoke);
|
|
39155
39877
|
this.drafts = null; // Make draft-related methods throw.
|
|
39156
39878
|
};
|
|
39157
39879
|
|
|
39158
|
-
ImmerScope.prototype.leave = function leave
|
|
39880
|
+
ImmerScope.prototype.leave = function leave() {
|
|
39159
39881
|
if (this === ImmerScope.current) {
|
|
39160
39882
|
ImmerScope.current = this.parent;
|
|
39161
39883
|
}
|
|
39162
39884
|
};
|
|
39885
|
+
|
|
39163
39886
|
ImmerScope.current = null;
|
|
39164
39887
|
|
|
39165
39888
|
ImmerScope.enter = function () {
|
|
@@ -39168,11 +39891,11 @@ ImmerScope.enter = function () {
|
|
|
39168
39891
|
|
|
39169
39892
|
function revoke(draft) {
|
|
39170
39893
|
draft[DRAFT_STATE].revoke();
|
|
39171
|
-
}
|
|
39894
|
+
} // but share them all instead
|
|
39172
39895
|
|
|
39173
|
-
// but share them all instead
|
|
39174
39896
|
|
|
39175
39897
|
var descriptors$1 = {};
|
|
39898
|
+
|
|
39176
39899
|
function willFinalize(scope, result, isReplaced) {
|
|
39177
39900
|
scope.drafts.forEach(function (draft) {
|
|
39178
39901
|
draft[DRAFT_STATE].finalizing = true;
|
|
@@ -39187,9 +39910,10 @@ function willFinalize(scope, result, isReplaced) {
|
|
|
39187
39910
|
markChangesSweep(scope.drafts);
|
|
39188
39911
|
} // When a child draft is returned, look for changes.
|
|
39189
39912
|
else if (isDraft(result) && result[DRAFT_STATE].scope === scope) {
|
|
39190
|
-
|
|
39191
|
-
|
|
39913
|
+
markChangesSweep(scope.drafts);
|
|
39914
|
+
}
|
|
39192
39915
|
}
|
|
39916
|
+
|
|
39193
39917
|
function createProxy(base, parent) {
|
|
39194
39918
|
var isArray = Array.isArray(base);
|
|
39195
39919
|
var draft = clonePotentialDraft(base);
|
|
@@ -39243,7 +39967,11 @@ function peek(draft, prop) {
|
|
|
39243
39967
|
function get$1(state, prop) {
|
|
39244
39968
|
assertUnrevoked(state);
|
|
39245
39969
|
var value = peek(source(state), prop);
|
|
39246
|
-
|
|
39970
|
+
|
|
39971
|
+
if (state.finalizing) {
|
|
39972
|
+
return value;
|
|
39973
|
+
} // Create a draft if the value is unmodified.
|
|
39974
|
+
|
|
39247
39975
|
|
|
39248
39976
|
if (value === peek(state.base, prop) && isDraftable(value)) {
|
|
39249
39977
|
prepareCopy(state);
|
|
@@ -39258,7 +39986,10 @@ function set$1(state, prop, value) {
|
|
|
39258
39986
|
state.assigned[prop] = true;
|
|
39259
39987
|
|
|
39260
39988
|
if (!state.modified) {
|
|
39261
|
-
if (is(value, peek(source(state), prop))) {
|
|
39989
|
+
if (is(value, peek(source(state), prop))) {
|
|
39990
|
+
return;
|
|
39991
|
+
}
|
|
39992
|
+
|
|
39262
39993
|
markChanged(state);
|
|
39263
39994
|
prepareCopy(state);
|
|
39264
39995
|
}
|
|
@@ -39269,12 +40000,17 @@ function set$1(state, prop, value) {
|
|
|
39269
40000
|
function markChanged(state) {
|
|
39270
40001
|
if (!state.modified) {
|
|
39271
40002
|
state.modified = true;
|
|
39272
|
-
|
|
40003
|
+
|
|
40004
|
+
if (state.parent) {
|
|
40005
|
+
markChanged(state.parent);
|
|
40006
|
+
}
|
|
39273
40007
|
}
|
|
39274
40008
|
}
|
|
39275
40009
|
|
|
39276
40010
|
function prepareCopy(state) {
|
|
39277
|
-
if (!state.copy) {
|
|
40011
|
+
if (!state.copy) {
|
|
40012
|
+
state.copy = clonePotentialDraft(state.base);
|
|
40013
|
+
}
|
|
39278
40014
|
}
|
|
39279
40015
|
|
|
39280
40016
|
function clonePotentialDraft(base) {
|
|
@@ -39299,15 +40035,12 @@ function proxyProperty(draft, prop, enumerable) {
|
|
|
39299
40035
|
descriptors$1[prop] = desc = {
|
|
39300
40036
|
configurable: true,
|
|
39301
40037
|
enumerable: enumerable,
|
|
39302
|
-
|
|
39303
40038
|
get: function get$1$1() {
|
|
39304
40039
|
return get$1(this[DRAFT_STATE], prop);
|
|
39305
40040
|
},
|
|
39306
|
-
|
|
39307
40041
|
set: function set$1$1(value) {
|
|
39308
40042
|
set$1(this[DRAFT_STATE], prop, value);
|
|
39309
40043
|
}
|
|
39310
|
-
|
|
39311
40044
|
};
|
|
39312
40045
|
}
|
|
39313
40046
|
|
|
@@ -39315,7 +40048,9 @@ function proxyProperty(draft, prop, enumerable) {
|
|
|
39315
40048
|
}
|
|
39316
40049
|
|
|
39317
40050
|
function assertUnrevoked(state) {
|
|
39318
|
-
if (state.revoked === true) {
|
|
40051
|
+
if (state.revoked === true) {
|
|
40052
|
+
throw new Error("Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? " + JSON.stringify(source(state)));
|
|
40053
|
+
}
|
|
39319
40054
|
} // This looks expensive, but only proxies are visited, and only objects without known changes are scanned.
|
|
39320
40055
|
|
|
39321
40056
|
|
|
@@ -39329,16 +40064,27 @@ function markChangesSweep(drafts) {
|
|
|
39329
40064
|
|
|
39330
40065
|
if (!state.modified) {
|
|
39331
40066
|
if (Array.isArray(state.base)) {
|
|
39332
|
-
if (hasArrayChanges(state)) {
|
|
39333
|
-
|
|
40067
|
+
if (hasArrayChanges(state)) {
|
|
40068
|
+
markChanged(state);
|
|
40069
|
+
}
|
|
40070
|
+
} else if (hasObjectChanges(state)) {
|
|
40071
|
+
markChanged(state);
|
|
40072
|
+
}
|
|
39334
40073
|
}
|
|
39335
40074
|
}
|
|
39336
40075
|
}
|
|
39337
40076
|
|
|
39338
40077
|
function markChangesRecursively(object) {
|
|
39339
|
-
if (!object ||
|
|
40078
|
+
if (!object || _typeof(object) !== "object") {
|
|
40079
|
+
return;
|
|
40080
|
+
}
|
|
40081
|
+
|
|
39340
40082
|
var state = object[DRAFT_STATE];
|
|
39341
|
-
|
|
40083
|
+
|
|
40084
|
+
if (!state) {
|
|
40085
|
+
return;
|
|
40086
|
+
}
|
|
40087
|
+
|
|
39342
40088
|
var base = state.base;
|
|
39343
40089
|
var draft = state.draft;
|
|
39344
40090
|
var assigned = state.assigned;
|
|
@@ -39368,14 +40114,20 @@ function markChangesRecursively(object) {
|
|
|
39368
40114
|
assigned.length = true;
|
|
39369
40115
|
|
|
39370
40116
|
if (draft.length < base.length) {
|
|
39371
|
-
for (var i = draft.length; i < base.length; i++) {
|
|
40117
|
+
for (var i = draft.length; i < base.length; i++) {
|
|
40118
|
+
assigned[i] = false;
|
|
40119
|
+
}
|
|
39372
40120
|
} else {
|
|
39373
|
-
for (var i$1 = base.length; i$1 < draft.length; i$1++) {
|
|
40121
|
+
for (var i$1 = base.length; i$1 < draft.length; i$1++) {
|
|
40122
|
+
assigned[i$1] = true;
|
|
40123
|
+
}
|
|
39374
40124
|
}
|
|
39375
40125
|
|
|
39376
40126
|
for (var i$2 = 0; i$2 < draft.length; i$2++) {
|
|
39377
40127
|
// Only untouched indices trigger recursion.
|
|
39378
|
-
if (assigned[i$2] === undefined) {
|
|
40128
|
+
if (assigned[i$2] === undefined) {
|
|
40129
|
+
markChangesRecursively(draft[i$2]);
|
|
40130
|
+
}
|
|
39379
40131
|
}
|
|
39380
40132
|
}
|
|
39381
40133
|
}
|
|
@@ -39396,13 +40148,13 @@ function hasObjectChanges(state) {
|
|
|
39396
40148
|
} // Once a base key is deleted, future changes go undetected, because its
|
|
39397
40149
|
// descriptor is erased. This branch detects any missed changes.
|
|
39398
40150
|
else {
|
|
39399
|
-
|
|
39400
|
-
|
|
40151
|
+
var value = draft[key];
|
|
40152
|
+
var state$1 = value && value[DRAFT_STATE];
|
|
39401
40153
|
|
|
39402
|
-
|
|
39403
|
-
|
|
39404
|
-
}
|
|
40154
|
+
if (state$1 ? state$1.base !== baseValue : !is(value, baseValue)) {
|
|
40155
|
+
return true;
|
|
39405
40156
|
}
|
|
40157
|
+
}
|
|
39406
40158
|
} // At this point, no keys were added or changed.
|
|
39407
40159
|
// Compare key count to determine if keys were deleted.
|
|
39408
40160
|
|
|
@@ -39412,7 +40164,10 @@ function hasObjectChanges(state) {
|
|
|
39412
40164
|
|
|
39413
40165
|
function hasArrayChanges(state) {
|
|
39414
40166
|
var draft = state.draft;
|
|
39415
|
-
|
|
40167
|
+
|
|
40168
|
+
if (draft.length !== state.base.length) {
|
|
40169
|
+
return true;
|
|
40170
|
+
} // See #116
|
|
39416
40171
|
// If we first shorten the length, our array interceptors will be removed.
|
|
39417
40172
|
// If after that new items are added, result in the same original length,
|
|
39418
40173
|
// those last items will have no intercepting property.
|
|
@@ -39420,9 +40175,13 @@ function hasArrayChanges(state) {
|
|
|
39420
40175
|
// N.B.: splice, unshift, etc only shift values around, but not prop descriptors, so we only have to check
|
|
39421
40176
|
// the last one
|
|
39422
40177
|
|
|
40178
|
+
|
|
39423
40179
|
var descriptor = Object.getOwnPropertyDescriptor(draft, draft.length - 1); // descriptor can be null, but only for newly created sparse arrays, eg. new Array(10)
|
|
39424
40180
|
|
|
39425
|
-
if (descriptor && !descriptor.get) {
|
|
40181
|
+
if (descriptor && !descriptor.get) {
|
|
40182
|
+
return true;
|
|
40183
|
+
} // For all other cases, we don't have to compare, as they would have been picked up by the index setters
|
|
40184
|
+
|
|
39426
40185
|
|
|
39427
40186
|
return false;
|
|
39428
40187
|
}
|
|
@@ -39436,11 +40195,12 @@ function createHiddenProperty(target, prop, value) {
|
|
|
39436
40195
|
}
|
|
39437
40196
|
|
|
39438
40197
|
var legacyProxy = /*#__PURE__*/Object.freeze({
|
|
39439
|
-
|
|
39440
|
-
|
|
40198
|
+
willFinalize: willFinalize,
|
|
40199
|
+
createProxy: createProxy
|
|
39441
40200
|
});
|
|
39442
40201
|
|
|
39443
40202
|
function willFinalize$1() {}
|
|
40203
|
+
|
|
39444
40204
|
function createProxy$1(base, parent) {
|
|
39445
40205
|
var scope = parent ? parent.scope : ImmerScope.current;
|
|
39446
40206
|
var state = {
|
|
@@ -39475,33 +40235,27 @@ function createProxy$1(base, parent) {
|
|
|
39475
40235
|
scope.drafts.push(proxy);
|
|
39476
40236
|
return proxy;
|
|
39477
40237
|
}
|
|
40238
|
+
|
|
39478
40239
|
var objectTraps = {
|
|
39479
40240
|
get: get$1$1,
|
|
39480
|
-
|
|
39481
40241
|
has: function has(target, prop) {
|
|
39482
40242
|
return prop in source$1(target);
|
|
39483
40243
|
},
|
|
39484
|
-
|
|
39485
40244
|
ownKeys: function ownKeys(target) {
|
|
39486
40245
|
return Reflect.ownKeys(source$1(target));
|
|
39487
40246
|
},
|
|
39488
|
-
|
|
39489
40247
|
set: set$1$1,
|
|
39490
40248
|
deleteProperty: deleteProperty,
|
|
39491
40249
|
getOwnPropertyDescriptor: getOwnPropertyDescriptor$2,
|
|
39492
|
-
|
|
39493
40250
|
defineProperty: function defineProperty() {
|
|
39494
40251
|
throw new Error("Object.defineProperty() cannot be used on an Immer draft"); // prettier-ignore
|
|
39495
40252
|
},
|
|
39496
|
-
|
|
39497
40253
|
getPrototypeOf: function getPrototypeOf(target) {
|
|
39498
40254
|
return Object.getPrototypeOf(target.base);
|
|
39499
40255
|
},
|
|
39500
|
-
|
|
39501
40256
|
setPrototypeOf: function setPrototypeOf() {
|
|
39502
40257
|
throw new Error("Object.setPrototypeOf() cannot be used on an Immer draft"); // prettier-ignore
|
|
39503
40258
|
}
|
|
39504
|
-
|
|
39505
40259
|
};
|
|
39506
40260
|
var arrayTraps = {};
|
|
39507
40261
|
each(objectTraps, function (key, fn) {
|
|
@@ -39540,7 +40294,10 @@ function peek$1(draft, prop) {
|
|
|
39540
40294
|
}
|
|
39541
40295
|
|
|
39542
40296
|
function get$1$1(state, prop) {
|
|
39543
|
-
if (prop === DRAFT_STATE) {
|
|
40297
|
+
if (prop === DRAFT_STATE) {
|
|
40298
|
+
return state;
|
|
40299
|
+
}
|
|
40300
|
+
|
|
39544
40301
|
var drafts = state.drafts; // Check for existing draft in unmodified state.
|
|
39545
40302
|
|
|
39546
40303
|
if (!state.modified && has$1(drafts, prop)) {
|
|
@@ -39556,7 +40313,10 @@ function get$1$1(state, prop) {
|
|
|
39556
40313
|
|
|
39557
40314
|
if (state.modified) {
|
|
39558
40315
|
// Assigned values are never drafted. This catches any drafts we created, too.
|
|
39559
|
-
if (value !== peek$1(state.base, prop)) {
|
|
40316
|
+
if (value !== peek$1(state.base, prop)) {
|
|
40317
|
+
return value;
|
|
40318
|
+
} // Store drafts on the copy (when one exists).
|
|
40319
|
+
|
|
39560
40320
|
|
|
39561
40321
|
drafts = state.copy;
|
|
39562
40322
|
}
|
|
@@ -39571,7 +40331,11 @@ function set$1$1(state, prop, value) {
|
|
|
39571
40331
|
// values may be drafts, but falsy values are never drafts.
|
|
39572
40332
|
|
|
39573
40333
|
var isUnchanged = value ? is(baseValue, value) || value === state.drafts[prop] : is(baseValue, value) && prop in state.base;
|
|
39574
|
-
|
|
40334
|
+
|
|
40335
|
+
if (isUnchanged) {
|
|
40336
|
+
return true;
|
|
40337
|
+
}
|
|
40338
|
+
|
|
39575
40339
|
markChanged$1(state);
|
|
39576
40340
|
}
|
|
39577
40341
|
|
|
@@ -39590,7 +40354,10 @@ function deleteProperty(state, prop) {
|
|
|
39590
40354
|
delete state.assigned[prop];
|
|
39591
40355
|
}
|
|
39592
40356
|
|
|
39593
|
-
if (state.copy) {
|
|
40357
|
+
if (state.copy) {
|
|
40358
|
+
delete state.copy[prop];
|
|
40359
|
+
}
|
|
40360
|
+
|
|
39594
40361
|
return true;
|
|
39595
40362
|
} // Note: We never coerce `desc.value` into an Immer draft, because we can't make
|
|
39596
40363
|
// the same guarantee in ES5 mode.
|
|
@@ -39613,13 +40380,16 @@ function markChanged$1(state) {
|
|
|
39613
40380
|
state.modified = true;
|
|
39614
40381
|
state.copy = assign(shallowCopy(state.base), state.drafts);
|
|
39615
40382
|
state.drafts = null;
|
|
39616
|
-
|
|
40383
|
+
|
|
40384
|
+
if (state.parent) {
|
|
40385
|
+
markChanged$1(state.parent);
|
|
40386
|
+
}
|
|
39617
40387
|
}
|
|
39618
40388
|
}
|
|
39619
40389
|
|
|
39620
40390
|
var modernProxy = /*#__PURE__*/Object.freeze({
|
|
39621
|
-
|
|
39622
|
-
|
|
40391
|
+
willFinalize: willFinalize$1,
|
|
40392
|
+
createProxy: createProxy$1
|
|
39623
40393
|
});
|
|
39624
40394
|
|
|
39625
40395
|
function generatePatches(state, basePath, patches, inversePatches) {
|
|
@@ -39628,14 +40398,13 @@ function generatePatches(state, basePath, patches, inversePatches) {
|
|
|
39628
40398
|
|
|
39629
40399
|
function generateArrayPatches(state, basePath, patches, inversePatches) {
|
|
39630
40400
|
var assign, assign$1;
|
|
39631
|
-
|
|
39632
40401
|
var base = state.base;
|
|
39633
40402
|
var copy = state.copy;
|
|
39634
40403
|
var assigned = state.assigned; // Reduce complexity by ensuring `base` is never longer.
|
|
39635
40404
|
|
|
39636
40405
|
if (copy.length < base.length) {
|
|
39637
|
-
|
|
39638
|
-
|
|
40406
|
+
assign = [copy, base], base = assign[0], copy = assign[1];
|
|
40407
|
+
assign$1 = [inversePatches, patches], patches = assign$1[0], inversePatches = assign$1[1];
|
|
39639
40408
|
}
|
|
39640
40409
|
|
|
39641
40410
|
var delta = copy.length - base.length; // Find the first replaced index.
|
|
@@ -39693,7 +40462,11 @@ function generateObjectPatches(state, basePath, patches, inversePatches) {
|
|
|
39693
40462
|
var origValue = base[key];
|
|
39694
40463
|
var value = copy[key];
|
|
39695
40464
|
var op = !assignedValue ? "remove" : key in base ? "replace" : "add";
|
|
39696
|
-
|
|
40465
|
+
|
|
40466
|
+
if (origValue === value && op === "replace") {
|
|
40467
|
+
return;
|
|
40468
|
+
}
|
|
40469
|
+
|
|
39697
40470
|
var path = basePath.concat(key);
|
|
39698
40471
|
patches.push(op === "remove" ? {
|
|
39699
40472
|
op: op,
|
|
@@ -39718,20 +40491,26 @@ function generateObjectPatches(state, basePath, patches, inversePatches) {
|
|
|
39718
40491
|
});
|
|
39719
40492
|
}
|
|
39720
40493
|
|
|
39721
|
-
var applyPatches = function (draft, patches) {
|
|
40494
|
+
var applyPatches = function applyPatches(draft, patches) {
|
|
39722
40495
|
for (var i$1 = 0, list = patches; i$1 < list.length; i$1 += 1) {
|
|
39723
40496
|
var patch = list[i$1];
|
|
39724
|
-
|
|
39725
40497
|
var path = patch.path;
|
|
39726
40498
|
var op = patch.op;
|
|
39727
40499
|
var value = clone(patch.value); // used to clone patch to ensure original patch is not modified, see #411
|
|
39728
40500
|
|
|
39729
|
-
if (!path.length) {
|
|
40501
|
+
if (!path.length) {
|
|
40502
|
+
throw new Error("Illegal state");
|
|
40503
|
+
}
|
|
40504
|
+
|
|
39730
40505
|
var base = draft;
|
|
39731
40506
|
|
|
39732
40507
|
for (var i = 0; i < path.length - 1; i++) {
|
|
39733
40508
|
base = base[path[i]];
|
|
39734
|
-
|
|
40509
|
+
|
|
40510
|
+
if (!base || _typeof(base) !== "object") {
|
|
40511
|
+
throw new Error("Cannot apply patch, path doesn't resolve: " + path.join("/"));
|
|
40512
|
+
} // prettier-ignore
|
|
40513
|
+
|
|
39735
40514
|
}
|
|
39736
40515
|
|
|
39737
40516
|
var key = path[path.length - 1];
|
|
@@ -39780,27 +40559,33 @@ var configDefaults = {
|
|
|
39780
40559
|
onDelete: null,
|
|
39781
40560
|
onCopy: null
|
|
39782
40561
|
};
|
|
40562
|
+
|
|
39783
40563
|
var Immer = function Immer(config) {
|
|
39784
40564
|
assign(this, configDefaults, config);
|
|
39785
40565
|
this.setUseProxies(this.useProxies);
|
|
39786
40566
|
this.produce = this.produce.bind(this);
|
|
39787
40567
|
};
|
|
39788
40568
|
|
|
39789
|
-
Immer.prototype.produce = function produce
|
|
39790
|
-
|
|
40569
|
+
Immer.prototype.produce = function produce(base, recipe, patchListener) {
|
|
40570
|
+
var this$1$1 = this; // curried invocation
|
|
39791
40571
|
|
|
39792
|
-
// curried invocation
|
|
39793
40572
|
if (typeof base === "function" && typeof recipe !== "function") {
|
|
39794
40573
|
var defaultBase = recipe;
|
|
39795
40574
|
recipe = base;
|
|
39796
40575
|
var self = this;
|
|
39797
40576
|
return function curriedProduce(base) {
|
|
39798
|
-
|
|
39799
|
-
|
|
39800
|
-
|
|
39801
|
-
|
|
40577
|
+
var this$1$1 = this;
|
|
40578
|
+
if (base === void 0) base = defaultBase;
|
|
40579
|
+
var args = [],
|
|
40580
|
+
len = arguments.length - 1;
|
|
39802
40581
|
|
|
39803
|
-
|
|
40582
|
+
while (len-- > 0) {
|
|
40583
|
+
args[len] = arguments[len + 1];
|
|
40584
|
+
}
|
|
40585
|
+
|
|
40586
|
+
return self.produce(base, function (draft) {
|
|
40587
|
+
return recipe.call.apply(recipe, [this$1$1, draft].concat(args));
|
|
40588
|
+
}); // prettier-ignore
|
|
39804
40589
|
};
|
|
39805
40590
|
} // prettier-ignore
|
|
39806
40591
|
|
|
@@ -39826,7 +40611,11 @@ Immer.prototype.produce = function produce (base, recipe, patchListener) {
|
|
|
39826
40611
|
hasError = false;
|
|
39827
40612
|
} finally {
|
|
39828
40613
|
// finally instead of catch + rethrow better preserves original stack
|
|
39829
|
-
if (hasError) {
|
|
40614
|
+
if (hasError) {
|
|
40615
|
+
scope.revoke();
|
|
40616
|
+
} else {
|
|
40617
|
+
scope.leave();
|
|
40618
|
+
}
|
|
39830
40619
|
}
|
|
39831
40620
|
|
|
39832
40621
|
if (result instanceof Promise) {
|
|
@@ -39843,25 +40632,38 @@ Immer.prototype.produce = function produce (base, recipe, patchListener) {
|
|
|
39843
40632
|
return this.processResult(result, scope);
|
|
39844
40633
|
} else {
|
|
39845
40634
|
result = recipe(base);
|
|
39846
|
-
|
|
40635
|
+
|
|
40636
|
+
if (result === undefined) {
|
|
40637
|
+
return base;
|
|
40638
|
+
}
|
|
40639
|
+
|
|
39847
40640
|
return result !== NOTHING ? result : undefined;
|
|
39848
40641
|
}
|
|
39849
40642
|
};
|
|
39850
40643
|
|
|
39851
|
-
Immer.prototype.produceWithPatches = function produceWithPatches
|
|
39852
|
-
|
|
40644
|
+
Immer.prototype.produceWithPatches = function produceWithPatches(arg1, arg2, arg3) {
|
|
40645
|
+
var this$1$1 = this;
|
|
39853
40646
|
|
|
39854
40647
|
if (typeof arg1 === "function") {
|
|
39855
40648
|
return function (state) {
|
|
39856
|
-
|
|
39857
|
-
|
|
40649
|
+
var args = [],
|
|
40650
|
+
len = arguments.length - 1;
|
|
39858
40651
|
|
|
39859
|
-
|
|
39860
|
-
|
|
40652
|
+
while (len-- > 0) {
|
|
40653
|
+
args[len] = arguments[len + 1];
|
|
40654
|
+
}
|
|
40655
|
+
|
|
40656
|
+
return this$1$1.produceWithPatches(state, function (draft) {
|
|
40657
|
+
return arg1.apply(void 0, [draft].concat(args));
|
|
40658
|
+
});
|
|
40659
|
+
};
|
|
39861
40660
|
} // non-curried form
|
|
39862
40661
|
|
|
39863
40662
|
|
|
39864
|
-
if (arg3) {
|
|
40663
|
+
if (arg3) {
|
|
40664
|
+
throw new Error("A patch listener cannot be passed to produceWithPatches");
|
|
40665
|
+
}
|
|
40666
|
+
|
|
39865
40667
|
var patches, inversePatches;
|
|
39866
40668
|
var nextState = this.produce(arg1, arg2, function (p, ip) {
|
|
39867
40669
|
patches = p;
|
|
@@ -39870,7 +40672,7 @@ Immer.prototype.produceWithPatches = function produceWithPatches (arg1, arg2, ar
|
|
|
39870
40672
|
return [nextState, patches, inversePatches];
|
|
39871
40673
|
};
|
|
39872
40674
|
|
|
39873
|
-
Immer.prototype.createDraft = function createDraft
|
|
40675
|
+
Immer.prototype.createDraft = function createDraft(base) {
|
|
39874
40676
|
if (!isDraftable(base)) {
|
|
39875
40677
|
throw new Error("First argument to `createDraft` must be a plain object, an array, or an immerable object"); // prettier-ignore
|
|
39876
40678
|
}
|
|
@@ -39882,7 +40684,7 @@ Immer.prototype.createDraft = function createDraft (base) {
|
|
|
39882
40684
|
return proxy;
|
|
39883
40685
|
};
|
|
39884
40686
|
|
|
39885
|
-
Immer.prototype.finishDraft = function finishDraft
|
|
40687
|
+
Immer.prototype.finishDraft = function finishDraft(draft, patchListener) {
|
|
39886
40688
|
var state = draft && draft[DRAFT_STATE];
|
|
39887
40689
|
|
|
39888
40690
|
if (!state || !state.isManual) {
|
|
@@ -39898,16 +40700,16 @@ Immer.prototype.finishDraft = function finishDraft (draft, patchListener) {
|
|
|
39898
40700
|
return this.processResult(undefined, scope);
|
|
39899
40701
|
};
|
|
39900
40702
|
|
|
39901
|
-
Immer.prototype.setAutoFreeze = function setAutoFreeze
|
|
40703
|
+
Immer.prototype.setAutoFreeze = function setAutoFreeze(value) {
|
|
39902
40704
|
this.autoFreeze = value;
|
|
39903
40705
|
};
|
|
39904
40706
|
|
|
39905
|
-
Immer.prototype.setUseProxies = function setUseProxies
|
|
40707
|
+
Immer.prototype.setUseProxies = function setUseProxies(value) {
|
|
39906
40708
|
this.useProxies = value;
|
|
39907
40709
|
assign(this, value ? modernProxy : legacyProxy);
|
|
39908
40710
|
};
|
|
39909
40711
|
|
|
39910
|
-
Immer.prototype.applyPatches = function applyPatches$1
|
|
40712
|
+
Immer.prototype.applyPatches = function applyPatches$1(base, patches) {
|
|
39911
40713
|
// If a patch replaces the entire state, take that replacement as base
|
|
39912
40714
|
// before applying patches
|
|
39913
40715
|
var i;
|
|
@@ -39927,12 +40729,14 @@ Immer.prototype.applyPatches = function applyPatches$1 (base, patches) {
|
|
|
39927
40729
|
} // Otherwise, produce a copy of the base state.
|
|
39928
40730
|
|
|
39929
40731
|
|
|
39930
|
-
return this.produce(base, function (draft) {
|
|
40732
|
+
return this.produce(base, function (draft) {
|
|
40733
|
+
return applyPatches(draft, patches.slice(i + 1));
|
|
40734
|
+
});
|
|
39931
40735
|
};
|
|
39932
40736
|
/** @internal */
|
|
39933
40737
|
|
|
39934
40738
|
|
|
39935
|
-
Immer.prototype.processResult = function processResult
|
|
40739
|
+
Immer.prototype.processResult = function processResult(result, scope) {
|
|
39936
40740
|
var baseDraft = scope.drafts[0];
|
|
39937
40741
|
var isReplaced = result !== undefined && result !== baseDraft;
|
|
39938
40742
|
this.willFinalize(scope, result, isReplaced);
|
|
@@ -39980,13 +40784,15 @@ Immer.prototype.processResult = function processResult (result, scope) {
|
|
|
39980
40784
|
*/
|
|
39981
40785
|
|
|
39982
40786
|
|
|
39983
|
-
Immer.prototype.finalize = function finalize
|
|
39984
|
-
|
|
39985
|
-
|
|
40787
|
+
Immer.prototype.finalize = function finalize(draft, path, scope) {
|
|
40788
|
+
var this$1$1 = this;
|
|
39986
40789
|
var state = draft[DRAFT_STATE];
|
|
39987
40790
|
|
|
39988
40791
|
if (!state) {
|
|
39989
|
-
if (Object.isFrozen(draft)) {
|
|
40792
|
+
if (Object.isFrozen(draft)) {
|
|
40793
|
+
return draft;
|
|
40794
|
+
}
|
|
40795
|
+
|
|
39990
40796
|
return this.finalizeTree(draft, null, scope);
|
|
39991
40797
|
} // Never finalize drafts owned by another scope.
|
|
39992
40798
|
|
|
@@ -40009,13 +40815,17 @@ Immer.prototype.finalize = function finalize (draft, path, scope) {
|
|
|
40009
40815
|
var assigned = state.assigned;
|
|
40010
40816
|
|
|
40011
40817
|
for (var prop in assigned) {
|
|
40012
|
-
if (!assigned[prop]) {
|
|
40818
|
+
if (!assigned[prop]) {
|
|
40819
|
+
this.onDelete(state, prop);
|
|
40820
|
+
}
|
|
40013
40821
|
}
|
|
40014
40822
|
} else {
|
|
40015
40823
|
var base = state.base;
|
|
40016
|
-
|
|
40824
|
+
var copy = state.copy;
|
|
40017
40825
|
each(base, function (prop) {
|
|
40018
|
-
if (!has$1(copy, prop)) {
|
|
40826
|
+
if (!has$1(copy, prop)) {
|
|
40827
|
+
this$1$1.onDelete(state, prop);
|
|
40828
|
+
}
|
|
40019
40829
|
});
|
|
40020
40830
|
}
|
|
40021
40831
|
}
|
|
@@ -40043,9 +40853,8 @@ Immer.prototype.finalize = function finalize (draft, path, scope) {
|
|
|
40043
40853
|
*/
|
|
40044
40854
|
|
|
40045
40855
|
|
|
40046
|
-
Immer.prototype.finalizeTree = function finalizeTree
|
|
40047
|
-
|
|
40048
|
-
|
|
40856
|
+
Immer.prototype.finalizeTree = function finalizeTree(root, rootPath, scope) {
|
|
40857
|
+
var this$1$1 = this;
|
|
40049
40858
|
var state = root[DRAFT_STATE];
|
|
40050
40859
|
|
|
40051
40860
|
if (state) {
|
|
@@ -40059,7 +40868,7 @@ Immer.prototype.finalizeTree = function finalizeTree (root, rootPath, scope) {
|
|
|
40059
40868
|
|
|
40060
40869
|
var needPatches = !!rootPath && !!scope.patches;
|
|
40061
40870
|
|
|
40062
|
-
var finalizeProperty = function (prop, value, parent) {
|
|
40871
|
+
var finalizeProperty = function finalizeProperty(prop, value, parent) {
|
|
40063
40872
|
if (value === parent) {
|
|
40064
40873
|
throw Error("Immer forbids circular references");
|
|
40065
40874
|
} // In the `finalizeTree` method, only the `root` object may be a draft.
|
|
@@ -40086,14 +40895,16 @@ Immer.prototype.finalizeTree = function finalizeTree (root, rootPath, scope) {
|
|
|
40086
40895
|
} // Unchanged drafts are never passed to the `onAssign` hook.
|
|
40087
40896
|
|
|
40088
40897
|
|
|
40089
|
-
if (isDraftProp && value === state.base[prop]) {
|
|
40898
|
+
if (isDraftProp && value === state.base[prop]) {
|
|
40899
|
+
return;
|
|
40900
|
+
}
|
|
40090
40901
|
} // Unchanged draft properties are ignored.
|
|
40091
40902
|
else if (isDraftProp && is(value, state.base[prop])) {
|
|
40092
|
-
|
|
40093
|
-
|
|
40094
|
-
|
|
40095
|
-
|
|
40096
|
-
|
|
40903
|
+
return;
|
|
40904
|
+
} // Search new objects for unfinalized drafts. Frozen objects should never contain drafts.
|
|
40905
|
+
else if (isDraftable(value) && !Object.isFrozen(value)) {
|
|
40906
|
+
each(value, finalizeProperty);
|
|
40907
|
+
}
|
|
40097
40908
|
|
|
40098
40909
|
if (isDraftProp && this$1$1.onAssign) {
|
|
40099
40910
|
this$1$1.onAssign(state, prop, value);
|
|
@@ -40171,127 +40982,223 @@ immer.createDraft.bind(immer);
|
|
|
40171
40982
|
|
|
40172
40983
|
immer.finishDraft.bind(immer);
|
|
40173
40984
|
|
|
40174
|
-
|
|
40175
|
-
|
|
40176
|
-
|
|
40177
|
-
|
|
40985
|
+
var createInitialState = function createInitialState(formConfig) {
|
|
40986
|
+
var initialForm = {};
|
|
40987
|
+
var formConfigKeys = Object.keys(formConfig);
|
|
40988
|
+
|
|
40989
|
+
for (var _i3 = 0, _formConfigKeys = formConfigKeys; _i3 < _formConfigKeys.length; _i3++) {
|
|
40990
|
+
var formKey = _formConfigKeys[_i3];
|
|
40178
40991
|
initialForm[formKey] = {
|
|
40179
40992
|
dirty: false,
|
|
40180
40993
|
rawValue: formConfig[formKey].defaultValue || "",
|
|
40181
40994
|
validators: formConfig[formKey].validators || [],
|
|
40182
40995
|
constraints: formConfig[formKey].constraints || []
|
|
40183
40996
|
};
|
|
40184
|
-
}
|
|
40185
|
-
// Because validators require the entire form we have to do a
|
|
40997
|
+
} // Because validators require the entire form we have to do a
|
|
40186
40998
|
// second pass to add errors once the initial form has been
|
|
40187
40999
|
// constructed
|
|
40188
|
-
|
|
40189
|
-
|
|
40190
|
-
|
|
40191
|
-
|
|
41000
|
+
|
|
41001
|
+
|
|
41002
|
+
for (var _i4 = 0, _formConfigKeys2 = formConfigKeys; _i4 < _formConfigKeys2.length; _i4++) {
|
|
41003
|
+
var _formKey = _formConfigKeys2[_i4];
|
|
41004
|
+
var errors = computeErrors(_formKey, initialForm);
|
|
41005
|
+
initialForm[_formKey].errors = errors;
|
|
41006
|
+
initialForm[_formKey].hasErrors = errors.length > 0;
|
|
40192
41007
|
}
|
|
41008
|
+
|
|
40193
41009
|
return initialForm;
|
|
40194
41010
|
};
|
|
40195
41011
|
|
|
40196
|
-
|
|
40197
|
-
|
|
40198
|
-
|
|
40199
|
-
|
|
40200
|
-
|
|
41012
|
+
var SET = "field/SET";
|
|
41013
|
+
|
|
41014
|
+
var _set = function set(fieldName) {
|
|
41015
|
+
return function (value) {
|
|
41016
|
+
return {
|
|
41017
|
+
type: SET,
|
|
41018
|
+
payload: {
|
|
41019
|
+
fieldName: fieldName,
|
|
41020
|
+
value: value
|
|
41021
|
+
}
|
|
41022
|
+
};
|
|
41023
|
+
};
|
|
41024
|
+
};
|
|
40201
41025
|
|
|
40202
|
-
|
|
40203
|
-
const clear = () => ({ type: CLEAR });
|
|
41026
|
+
var CLEAR = "form/CLEAR";
|
|
40204
41027
|
|
|
40205
|
-
|
|
40206
|
-
|
|
40207
|
-
|
|
40208
|
-
|
|
40209
|
-
}
|
|
41028
|
+
var _clear = function clear() {
|
|
41029
|
+
return {
|
|
41030
|
+
type: CLEAR
|
|
41031
|
+
};
|
|
41032
|
+
};
|
|
41033
|
+
|
|
41034
|
+
var ADD_VALIDATOR = "field/ADD_VALIDATOR";
|
|
41035
|
+
|
|
41036
|
+
var _addValidator = function addValidator(fieldName) {
|
|
41037
|
+
return function (validator) {
|
|
41038
|
+
return {
|
|
41039
|
+
type: ADD_VALIDATOR,
|
|
41040
|
+
payload: {
|
|
41041
|
+
fieldName: fieldName,
|
|
41042
|
+
validator: validator
|
|
41043
|
+
}
|
|
41044
|
+
};
|
|
41045
|
+
};
|
|
41046
|
+
};
|
|
41047
|
+
|
|
41048
|
+
var REMOVE_VALIDATOR = "field/REMOVE_VALIDATOR";
|
|
40210
41049
|
|
|
40211
|
-
|
|
40212
|
-
|
|
40213
|
-
|
|
40214
|
-
|
|
40215
|
-
|
|
40216
|
-
|
|
40217
|
-
|
|
40218
|
-
|
|
40219
|
-
|
|
40220
|
-
|
|
40221
|
-
|
|
40222
|
-
|
|
40223
|
-
|
|
40224
|
-
|
|
40225
|
-
|
|
40226
|
-
|
|
41050
|
+
var _removeValidator = function removeValidator(fieldName) {
|
|
41051
|
+
return function (validator) {
|
|
41052
|
+
return {
|
|
41053
|
+
type: REMOVE_VALIDATOR,
|
|
41054
|
+
payload: {
|
|
41055
|
+
fieldName: fieldName,
|
|
41056
|
+
validator: validator
|
|
41057
|
+
}
|
|
41058
|
+
};
|
|
41059
|
+
};
|
|
41060
|
+
};
|
|
41061
|
+
|
|
41062
|
+
var CLEAR_FIELD_VALIDATORS = "field/CLEAR_FIELD_VALIDATORS";
|
|
41063
|
+
|
|
41064
|
+
var clearFieldValidators = function clearFieldValidators(fieldName) {
|
|
41065
|
+
return function () {
|
|
41066
|
+
return {
|
|
41067
|
+
type: CLEAR_FIELD_VALIDATORS,
|
|
41068
|
+
payload: {
|
|
41069
|
+
fieldName: fieldName
|
|
41070
|
+
}
|
|
41071
|
+
};
|
|
41072
|
+
};
|
|
41073
|
+
};
|
|
41074
|
+
|
|
41075
|
+
var createFormReducer = function createFormReducer(formConfig) {
|
|
41076
|
+
return function () {
|
|
41077
|
+
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : createInitialState(formConfig);
|
|
41078
|
+
var action = arguments.length > 1 ? arguments[1] : undefined;
|
|
41079
|
+
|
|
41080
|
+
switch (action.type) {
|
|
41081
|
+
case SET:
|
|
41082
|
+
{
|
|
41083
|
+
var changedFieldName = action.payload.fieldName;
|
|
41084
|
+
var newRawValue = action.payload.value;
|
|
41085
|
+
return produce(state, function (draftState) {
|
|
41086
|
+
var originalValue = draftState[changedFieldName].rawValue;
|
|
41087
|
+
draftState[changedFieldName].rawValue = newRawValue;
|
|
41088
|
+
|
|
41089
|
+
if (computeConstraints(changedFieldName, draftState).length > 0) {
|
|
41090
|
+
// If the change violates constraints, revert the change
|
|
41091
|
+
draftState[changedFieldName].rawValue = originalValue;
|
|
41092
|
+
return draftState;
|
|
41093
|
+
}
|
|
41094
|
+
|
|
41095
|
+
computeDirtyEntries(draftState, changedFieldName);
|
|
41096
|
+
computeErrorEntries(draftState);
|
|
41097
|
+
});
|
|
40227
41098
|
}
|
|
40228
41099
|
|
|
40229
|
-
|
|
40230
|
-
|
|
40231
|
-
|
|
40232
|
-
|
|
40233
|
-
|
|
40234
|
-
|
|
40235
|
-
|
|
40236
|
-
draftState
|
|
40237
|
-
|
|
41100
|
+
case CLEAR:
|
|
41101
|
+
return createInitialState(formConfig);
|
|
41102
|
+
|
|
41103
|
+
case ADD_VALIDATOR:
|
|
41104
|
+
{
|
|
41105
|
+
var fieldWithOverride = action.payload.fieldName;
|
|
41106
|
+
var newValidator = action.payload.validator;
|
|
41107
|
+
return produce(state, function (draftState) {
|
|
41108
|
+
draftState[fieldWithOverride].validators.push(newValidator);
|
|
41109
|
+
computeErrorEntries(draftState);
|
|
41110
|
+
});
|
|
40238
41111
|
}
|
|
40239
|
-
|
|
40240
|
-
|
|
40241
|
-
|
|
40242
|
-
|
|
40243
|
-
|
|
40244
|
-
|
|
40245
|
-
|
|
40246
|
-
|
|
40247
|
-
|
|
40248
|
-
|
|
40249
|
-
|
|
40250
|
-
|
|
40251
|
-
let field = entry[1];
|
|
40252
|
-
let errors = computeErrors(fieldName, draftState);
|
|
40253
|
-
let dirty = field.dirty;
|
|
40254
|
-
draftState[fieldName].errors = errors;
|
|
40255
|
-
draftState[fieldName].dirty = dirty;
|
|
40256
|
-
draftState[fieldName].hasErrors = errors.length > 0;
|
|
41112
|
+
|
|
41113
|
+
case REMOVE_VALIDATOR:
|
|
41114
|
+
{
|
|
41115
|
+
var fieldToOverride = action.payload.fieldName;
|
|
41116
|
+
var targetValidator = action.payload.validator;
|
|
41117
|
+
return produce(state, function (draftState) {
|
|
41118
|
+
var fieldValidators = draftState[fieldToOverride].validators;
|
|
41119
|
+
draftState[fieldToOverride].validators = fieldValidators.filter(function (validator) {
|
|
41120
|
+
return validator.type !== targetValidator.type;
|
|
41121
|
+
});
|
|
41122
|
+
computeErrorEntries(draftState);
|
|
41123
|
+
});
|
|
40257
41124
|
}
|
|
40258
|
-
|
|
40259
|
-
|
|
40260
|
-
|
|
40261
|
-
|
|
41125
|
+
|
|
41126
|
+
case CLEAR_FIELD_VALIDATORS:
|
|
41127
|
+
{
|
|
41128
|
+
var fieldToClear = action.payload.fieldName;
|
|
41129
|
+
return produce(state, function (draftState) {
|
|
41130
|
+
draftState[fieldToClear].validators = [];
|
|
41131
|
+
computeErrorEntries(draftState);
|
|
41132
|
+
});
|
|
41133
|
+
}
|
|
41134
|
+
|
|
41135
|
+
default:
|
|
41136
|
+
return state;
|
|
41137
|
+
}
|
|
41138
|
+
};
|
|
40262
41139
|
};
|
|
40263
41140
|
|
|
40264
|
-
|
|
41141
|
+
var createMapDispatchToProps = function createMapDispatchToProps(formConfig) {
|
|
40265
41142
|
// Do memo-ization
|
|
40266
|
-
|
|
40267
|
-
|
|
40268
|
-
return dispatch
|
|
41143
|
+
var cachedDispatch;
|
|
41144
|
+
var cacheValue;
|
|
41145
|
+
return function (dispatch) {
|
|
40269
41146
|
if (dispatch == cachedDispatch) {
|
|
40270
41147
|
return cacheValue;
|
|
40271
41148
|
}
|
|
40272
|
-
|
|
41149
|
+
|
|
41150
|
+
var dispatchObj = {};
|
|
40273
41151
|
dispatchObj.fields = {};
|
|
40274
|
-
|
|
40275
|
-
|
|
41152
|
+
var keys = Object.keys(formConfig);
|
|
41153
|
+
|
|
41154
|
+
var _loop = function _loop() {
|
|
41155
|
+
var fieldName = _keys[_i5];
|
|
40276
41156
|
dispatchObj.fields[fieldName] = {
|
|
40277
|
-
set:
|
|
40278
|
-
|
|
41157
|
+
set: function set(value) {
|
|
41158
|
+
return dispatch(_set(fieldName)(value));
|
|
41159
|
+
},
|
|
41160
|
+
addValidator: function addValidator(validator) {
|
|
41161
|
+
return dispatch(_addValidator(fieldName)(validator));
|
|
41162
|
+
},
|
|
41163
|
+
removeValidator: function removeValidator(validator) {
|
|
41164
|
+
return dispatch(_removeValidator(fieldName)(validator));
|
|
41165
|
+
},
|
|
41166
|
+
clear: function clear() {
|
|
41167
|
+
return dispatch(clearFieldValidators(fieldName)());
|
|
41168
|
+
}
|
|
40279
41169
|
};
|
|
41170
|
+
};
|
|
41171
|
+
|
|
41172
|
+
for (var _i5 = 0, _keys = keys; _i5 < _keys.length; _i5++) {
|
|
41173
|
+
_loop();
|
|
40280
41174
|
}
|
|
40281
|
-
|
|
41175
|
+
|
|
41176
|
+
dispatchObj.form = {
|
|
41177
|
+
clear: function clear() {
|
|
41178
|
+
return dispatch(_clear());
|
|
41179
|
+
}
|
|
41180
|
+
};
|
|
40282
41181
|
cachedDispatch = dispatch;
|
|
40283
|
-
cacheValue = {
|
|
41182
|
+
cacheValue = {
|
|
41183
|
+
actions: dispatchObj
|
|
41184
|
+
};
|
|
40284
41185
|
return cacheValue;
|
|
40285
41186
|
};
|
|
40286
41187
|
};
|
|
40287
41188
|
|
|
40288
|
-
|
|
41189
|
+
var mapStateToProps = function mapStateToProps(state) {
|
|
41190
|
+
return {
|
|
41191
|
+
fields: state
|
|
41192
|
+
};
|
|
41193
|
+
};
|
|
40289
41194
|
|
|
40290
|
-
|
|
40291
|
-
|
|
40292
|
-
|
|
40293
|
-
|
|
40294
|
-
|
|
41195
|
+
var createFormState = function createFormState(formConfig) {
|
|
41196
|
+
return {
|
|
41197
|
+
reducer: createFormReducer(formConfig),
|
|
41198
|
+
mapDispatchToProps: createMapDispatchToProps(formConfig),
|
|
41199
|
+
mapStateToProps: mapStateToProps
|
|
41200
|
+
};
|
|
41201
|
+
};
|
|
40295
41202
|
|
|
40296
41203
|
var AddressForm = function AddressForm(_ref) {
|
|
40297
41204
|
var _zipErrorMessages;
|
|
@@ -49411,6 +50318,8 @@ var fallbackValues$Q = {
|
|
|
49411
50318
|
dataQa: string,
|
|
49412
50319
|
content: <React Component(s)> e.g.: <Box><Stack>cool content stuff</Stack></Box> (any collection of components will work),
|
|
49413
50320
|
rightTitleContent: <React Component(s)> (rendered on the very right of the title section, use to supplement "rightIcons" with text, as in expired CC status, or render other custom content)
|
|
50321
|
+
contentOverride: <React Component(s)> (Replace the radio section and the containers with different content,
|
|
50322
|
+
intended for inserting a divider bar or other non-interactive css)
|
|
49414
50323
|
}
|
|
49415
50324
|
|
|
49416
50325
|
Also takes an "openSection" which should equal the id of the section that should be open
|
|
@@ -49438,6 +50347,8 @@ var RadioSection = function RadioSection(_ref) {
|
|
|
49438
50347
|
initiallyOpen = _ref$initiallyOpen === void 0 ? true : _ref$initiallyOpen,
|
|
49439
50348
|
_ref$openHeight = _ref.openHeight,
|
|
49440
50349
|
openHeight = _ref$openHeight === void 0 ? "auto" : _ref$openHeight,
|
|
50350
|
+
_ref$containerStyles = _ref.containerStyles,
|
|
50351
|
+
containerStyles = _ref$containerStyles === void 0 ? "" : _ref$containerStyles,
|
|
49441
50352
|
ariaDescribedBy = _ref.ariaDescribedBy;
|
|
49442
50353
|
|
|
49443
50354
|
var handleKeyDown = function handleKeyDown(id, e) {
|
|
@@ -49490,13 +50401,14 @@ var RadioSection = function RadioSection(_ref) {
|
|
|
49490
50401
|
return /*#__PURE__*/React__default.createElement(Box, {
|
|
49491
50402
|
padding: "1px",
|
|
49492
50403
|
border: "1px solid ".concat(themeValues.borderColor),
|
|
49493
|
-
borderRadius: "4px"
|
|
50404
|
+
borderRadius: "4px",
|
|
50405
|
+
extraStyles: containerStyles
|
|
49494
50406
|
}, /*#__PURE__*/React__default.createElement(Stack, {
|
|
49495
50407
|
childGap: "0"
|
|
49496
50408
|
}, sections.filter(function (section) {
|
|
49497
50409
|
return !section.hidden;
|
|
49498
50410
|
}).map(function (section) {
|
|
49499
|
-
return /*#__PURE__*/React__default.createElement(Motion, {
|
|
50411
|
+
return contentOverride ? contentOverride : /*#__PURE__*/React__default.createElement(Motion, {
|
|
49500
50412
|
tabIndex: section.hideRadioButton || section.disabled ? "-1" : "0",
|
|
49501
50413
|
onKeyDown: function onKeyDown(e) {
|
|
49502
50414
|
return !section.disabled && handleKeyDown(section.id, e);
|