@thecb/components 7.12.3-beta.0 → 7.12.3
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 +1466 -560
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1466 -560
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/icons/AutopayOnIcon.js +2 -2
- /package/src/components/atoms/icons/{ExternalLinkicon.js → ExternalLinkIcon.js} +0 -0
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
|
|
|
@@ -14118,7 +14175,9 @@ var TimeoutImage = function TimeoutImage() {
|
|
|
14118
14175
|
})))));
|
|
14119
14176
|
};
|
|
14120
14177
|
|
|
14121
|
-
var AutopayOnIcon = function AutopayOnIcon() {
|
|
14178
|
+
var AutopayOnIcon = function AutopayOnIcon(_ref) {
|
|
14179
|
+
var _ref$color = _ref.color,
|
|
14180
|
+
color = _ref$color === void 0 ? SEA_GREEN : _ref$color;
|
|
14122
14181
|
return /*#__PURE__*/React__default.createElement("svg", {
|
|
14123
14182
|
xmlns: "http://www.w3.org/2000/svg",
|
|
14124
14183
|
width: "12",
|
|
@@ -14131,7 +14190,7 @@ var AutopayOnIcon = function AutopayOnIcon() {
|
|
|
14131
14190
|
strokeWidth: "1"
|
|
14132
14191
|
}, /*#__PURE__*/React__default.createElement("path", {
|
|
14133
14192
|
className: "autopayIcon",
|
|
14134
|
-
fill:
|
|
14193
|
+
fill: color,
|
|
14135
14194
|
fillRule: "nonzero",
|
|
14136
14195
|
d: "M1.898 5.75c.079 0 .141-.02.188-.059a.281.281 0 00.094-.152 3.825 3.825 0 011.394-2.144A3.838 3.838 0 016 2.563c.5 0 .98.09 1.441.27.461.179.88.44 1.254.784l-.984.985A.542.542 0 007.547 5c0 .156.055.29.164.398.11.11.242.165.398.165h3.141c.156 0 .289-.055.398-.165A.542.542 0 0011.812 5V1.86a.542.542 0 00-.164-.399.542.542 0 00-.398-.164.542.542 0 00-.398.164l-.844.844A5.699 5.699 0 006 .688c-.938 0-1.809.207-2.613.62-.805.415-1.48.981-2.028 1.7A5.726 5.726 0 00.281 5.422a.265.265 0 00.059.223c.055.07.129.105.222.105h1.336zM6 12.312c.937 0 1.809-.207 2.613-.62a5.919 5.919 0 002.028-1.7 5.726 5.726 0 001.078-2.414.265.265 0 00-.059-.223.267.267 0 00-.223-.105h-1.335c-.079 0-.141.02-.188.059a.281.281 0 00-.094.152 3.825 3.825 0 01-1.394 2.144c-.711.555-1.52.833-2.426.833-.5 0-.98-.09-1.441-.27a3.985 3.985 0 01-1.254-.785l.984-.985A.542.542 0 004.453 8a.542.542 0 00-.164-.398.542.542 0 00-.398-.164H.75a.542.542 0 00-.398.164A.542.542 0 00.187 8v3.14c0 .157.055.29.165.4.109.108.242.163.398.163.156 0 .29-.055.398-.164l.844-.844A5.699 5.699 0 006 12.312z"
|
|
14137
14196
|
})));
|
|
@@ -21379,7 +21438,7 @@ var check = function (it) {
|
|
|
21379
21438
|
|
|
21380
21439
|
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
|
|
21381
21440
|
var global_1 =
|
|
21382
|
-
// eslint-disable-next-line es
|
|
21441
|
+
// eslint-disable-next-line es/no-global-this -- safe
|
|
21383
21442
|
check(typeof globalThis == 'object' && globalThis) ||
|
|
21384
21443
|
check(typeof window == 'object' && window) ||
|
|
21385
21444
|
// eslint-disable-next-line no-restricted-globals -- safe
|
|
@@ -21398,12 +21457,12 @@ var fails = function (exec) {
|
|
|
21398
21457
|
|
|
21399
21458
|
// Detect IE8's incomplete defineProperty implementation
|
|
21400
21459
|
var descriptors = !fails(function () {
|
|
21401
|
-
// eslint-disable-next-line es
|
|
21460
|
+
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
21402
21461
|
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
|
|
21403
21462
|
});
|
|
21404
21463
|
|
|
21405
21464
|
var functionBindNative = !fails(function () {
|
|
21406
|
-
// eslint-disable-next-line es
|
|
21465
|
+
// eslint-disable-next-line es/no-function-prototype-bind -- safe
|
|
21407
21466
|
var test = (function () { /* empty */ }).bind();
|
|
21408
21467
|
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
21409
21468
|
return typeof test != 'function' || test.hasOwnProperty('prototype');
|
|
@@ -21416,7 +21475,7 @@ var functionCall = functionBindNative ? call.bind(call) : function () {
|
|
|
21416
21475
|
};
|
|
21417
21476
|
|
|
21418
21477
|
var $propertyIsEnumerable = {}.propertyIsEnumerable;
|
|
21419
|
-
// eslint-disable-next-line es
|
|
21478
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
21420
21479
|
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
21421
21480
|
|
|
21422
21481
|
// Nashorn ~ JDK8 bug
|
|
@@ -21443,25 +21502,29 @@ var createPropertyDescriptor = function (bitmap, value) {
|
|
|
21443
21502
|
};
|
|
21444
21503
|
|
|
21445
21504
|
var FunctionPrototype = Function.prototype;
|
|
21446
|
-
var bind$1 = FunctionPrototype.bind;
|
|
21447
21505
|
var call$1 = FunctionPrototype.call;
|
|
21448
|
-
var
|
|
21506
|
+
var uncurryThisWithBind = functionBindNative && FunctionPrototype.bind.bind(call$1, call$1);
|
|
21449
21507
|
|
|
21450
|
-
var
|
|
21451
|
-
return
|
|
21452
|
-
} : function (fn) {
|
|
21453
|
-
return fn && function () {
|
|
21508
|
+
var functionUncurryThisRaw = function (fn) {
|
|
21509
|
+
return functionBindNative ? uncurryThisWithBind(fn) : function () {
|
|
21454
21510
|
return call$1.apply(fn, arguments);
|
|
21455
21511
|
};
|
|
21456
21512
|
};
|
|
21457
21513
|
|
|
21458
|
-
var toString$2 =
|
|
21459
|
-
var stringSlice =
|
|
21514
|
+
var toString$2 = functionUncurryThisRaw({}.toString);
|
|
21515
|
+
var stringSlice = functionUncurryThisRaw(''.slice);
|
|
21460
21516
|
|
|
21461
21517
|
var classofRaw = function (it) {
|
|
21462
21518
|
return stringSlice(toString$2(it), 8, -1);
|
|
21463
21519
|
};
|
|
21464
21520
|
|
|
21521
|
+
var functionUncurryThis = function (fn) {
|
|
21522
|
+
// Nashorn bug:
|
|
21523
|
+
// https://github.com/zloirock/core-js/issues/1128
|
|
21524
|
+
// https://github.com/zloirock/core-js/issues/1130
|
|
21525
|
+
if (classofRaw(fn) === 'Function') return functionUncurryThisRaw(fn);
|
|
21526
|
+
};
|
|
21527
|
+
|
|
21465
21528
|
var $Object = Object;
|
|
21466
21529
|
var split = functionUncurryThis(''.split);
|
|
21467
21530
|
|
|
@@ -21474,12 +21537,18 @@ var indexedObject = fails(function () {
|
|
|
21474
21537
|
return classofRaw(it) == 'String' ? split(it, '') : $Object(it);
|
|
21475
21538
|
} : $Object;
|
|
21476
21539
|
|
|
21540
|
+
// we can't use just `it == null` since of `document.all` special case
|
|
21541
|
+
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
|
|
21542
|
+
var isNullOrUndefined = function (it) {
|
|
21543
|
+
return it === null || it === undefined;
|
|
21544
|
+
};
|
|
21545
|
+
|
|
21477
21546
|
var $TypeError = TypeError;
|
|
21478
21547
|
|
|
21479
21548
|
// `RequireObjectCoercible` abstract operation
|
|
21480
21549
|
// https://tc39.es/ecma262/#sec-requireobjectcoercible
|
|
21481
21550
|
var requireObjectCoercible = function (it) {
|
|
21482
|
-
if (it
|
|
21551
|
+
if (isNullOrUndefined(it)) throw $TypeError("Can't call method on " + it);
|
|
21483
21552
|
return it;
|
|
21484
21553
|
};
|
|
21485
21554
|
|
|
@@ -21491,13 +21560,31 @@ var toIndexedObject = function (it) {
|
|
|
21491
21560
|
return indexedObject(requireObjectCoercible(it));
|
|
21492
21561
|
};
|
|
21493
21562
|
|
|
21563
|
+
var documentAll = typeof document == 'object' && document.all;
|
|
21564
|
+
|
|
21565
|
+
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
|
|
21566
|
+
var IS_HTMLDDA = typeof documentAll == 'undefined' && documentAll !== undefined;
|
|
21567
|
+
|
|
21568
|
+
var documentAll_1 = {
|
|
21569
|
+
all: documentAll,
|
|
21570
|
+
IS_HTMLDDA: IS_HTMLDDA
|
|
21571
|
+
};
|
|
21572
|
+
|
|
21573
|
+
var documentAll$1 = documentAll_1.all;
|
|
21574
|
+
|
|
21494
21575
|
// `IsCallable` abstract operation
|
|
21495
21576
|
// https://tc39.es/ecma262/#sec-iscallable
|
|
21496
|
-
var isCallable = function (argument) {
|
|
21577
|
+
var isCallable = documentAll_1.IS_HTMLDDA ? function (argument) {
|
|
21578
|
+
return typeof argument == 'function' || argument === documentAll$1;
|
|
21579
|
+
} : function (argument) {
|
|
21497
21580
|
return typeof argument == 'function';
|
|
21498
21581
|
};
|
|
21499
21582
|
|
|
21500
|
-
var
|
|
21583
|
+
var documentAll$2 = documentAll_1.all;
|
|
21584
|
+
|
|
21585
|
+
var isObject = documentAll_1.IS_HTMLDDA ? function (it) {
|
|
21586
|
+
return typeof it == 'object' ? it !== null : isCallable(it) || it === documentAll$2;
|
|
21587
|
+
} : function (it) {
|
|
21501
21588
|
return typeof it == 'object' ? it !== null : isCallable(it);
|
|
21502
21589
|
};
|
|
21503
21590
|
|
|
@@ -21538,12 +21625,12 @@ if (!version && engineUserAgent) {
|
|
|
21538
21625
|
|
|
21539
21626
|
var engineV8Version = version;
|
|
21540
21627
|
|
|
21541
|
-
/* eslint-disable es
|
|
21628
|
+
/* eslint-disable es/no-symbol -- required for testing */
|
|
21542
21629
|
|
|
21543
21630
|
|
|
21544
21631
|
|
|
21545
|
-
// eslint-disable-next-line es
|
|
21546
|
-
var
|
|
21632
|
+
// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
|
|
21633
|
+
var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails(function () {
|
|
21547
21634
|
var symbol = Symbol();
|
|
21548
21635
|
// Chrome 38 Symbol has incorrect toString conversion
|
|
21549
21636
|
// `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
|
|
@@ -21552,10 +21639,10 @@ var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
|
|
|
21552
21639
|
!Symbol.sham && engineV8Version && engineV8Version < 41;
|
|
21553
21640
|
});
|
|
21554
21641
|
|
|
21555
|
-
/* eslint-disable es
|
|
21642
|
+
/* eslint-disable es/no-symbol -- required for testing */
|
|
21556
21643
|
|
|
21557
21644
|
|
|
21558
|
-
var useSymbolAsUid =
|
|
21645
|
+
var useSymbolAsUid = symbolConstructorDetection
|
|
21559
21646
|
&& !Symbol.sham
|
|
21560
21647
|
&& typeof Symbol.iterator == 'symbol';
|
|
21561
21648
|
|
|
@@ -21590,7 +21677,7 @@ var aCallable = function (argument) {
|
|
|
21590
21677
|
// https://tc39.es/ecma262/#sec-getmethod
|
|
21591
21678
|
var getMethod = function (V, P) {
|
|
21592
21679
|
var func = V[P];
|
|
21593
|
-
return func
|
|
21680
|
+
return isNullOrUndefined(func) ? undefined : aCallable(func);
|
|
21594
21681
|
};
|
|
21595
21682
|
|
|
21596
21683
|
var $TypeError$2 = TypeError;
|
|
@@ -21605,7 +21692,7 @@ var ordinaryToPrimitive = function (input, pref) {
|
|
|
21605
21692
|
throw $TypeError$2("Can't convert object to primitive value");
|
|
21606
21693
|
};
|
|
21607
21694
|
|
|
21608
|
-
// eslint-disable-next-line es
|
|
21695
|
+
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
21609
21696
|
var defineProperty = Object.defineProperty;
|
|
21610
21697
|
|
|
21611
21698
|
var defineGlobalProperty = function (key, value) {
|
|
@@ -21625,10 +21712,10 @@ var shared = createCommonjsModule(function (module) {
|
|
|
21625
21712
|
(module.exports = function (key, value) {
|
|
21626
21713
|
return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
|
|
21627
21714
|
})('versions', []).push({
|
|
21628
|
-
version: '3.
|
|
21715
|
+
version: '3.25.5',
|
|
21629
21716
|
mode: 'global',
|
|
21630
21717
|
copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
|
|
21631
|
-
license: 'https://github.com/zloirock/core-js/blob/v3.
|
|
21718
|
+
license: 'https://github.com/zloirock/core-js/blob/v3.25.5/LICENSE',
|
|
21632
21719
|
source: 'https://github.com/zloirock/core-js'
|
|
21633
21720
|
});
|
|
21634
21721
|
});
|
|
@@ -21645,7 +21732,7 @@ var hasOwnProperty = functionUncurryThis({}.hasOwnProperty);
|
|
|
21645
21732
|
|
|
21646
21733
|
// `HasOwnProperty` abstract operation
|
|
21647
21734
|
// https://tc39.es/ecma262/#sec-hasownproperty
|
|
21648
|
-
// eslint-disable-next-line es
|
|
21735
|
+
// eslint-disable-next-line es/no-object-hasown -- safe
|
|
21649
21736
|
var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
|
|
21650
21737
|
return hasOwnProperty(toObject(it), key);
|
|
21651
21738
|
};
|
|
@@ -21664,9 +21751,9 @@ var symbolFor = Symbol$1 && Symbol$1['for'];
|
|
|
21664
21751
|
var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
|
|
21665
21752
|
|
|
21666
21753
|
var wellKnownSymbol = function (name) {
|
|
21667
|
-
if (!hasOwnProperty_1(WellKnownSymbolsStore, name) || !(
|
|
21754
|
+
if (!hasOwnProperty_1(WellKnownSymbolsStore, name) || !(symbolConstructorDetection || typeof WellKnownSymbolsStore[name] == 'string')) {
|
|
21668
21755
|
var description = 'Symbol.' + name;
|
|
21669
|
-
if (
|
|
21756
|
+
if (symbolConstructorDetection && hasOwnProperty_1(Symbol$1, name)) {
|
|
21670
21757
|
WellKnownSymbolsStore[name] = Symbol$1[name];
|
|
21671
21758
|
} else if (useSymbolAsUid && symbolFor) {
|
|
21672
21759
|
WellKnownSymbolsStore[name] = symbolFor(description);
|
|
@@ -21712,13 +21799,13 @@ var documentCreateElement = function (it) {
|
|
|
21712
21799
|
|
|
21713
21800
|
// Thanks to IE8 for its funny defineProperty
|
|
21714
21801
|
var ie8DomDefine = !descriptors && !fails(function () {
|
|
21715
|
-
// eslint-disable-next-line es
|
|
21802
|
+
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
21716
21803
|
return Object.defineProperty(documentCreateElement('div'), 'a', {
|
|
21717
21804
|
get: function () { return 7; }
|
|
21718
21805
|
}).a != 7;
|
|
21719
21806
|
});
|
|
21720
21807
|
|
|
21721
|
-
// eslint-disable-next-line es
|
|
21808
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
21722
21809
|
var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
21723
21810
|
|
|
21724
21811
|
// `Object.getOwnPropertyDescriptor` method
|
|
@@ -21739,7 +21826,7 @@ var objectGetOwnPropertyDescriptor = {
|
|
|
21739
21826
|
// V8 ~ Chrome 36-
|
|
21740
21827
|
// https://bugs.chromium.org/p/v8/issues/detail?id=3334
|
|
21741
21828
|
var v8PrototypeDefineBug = descriptors && fails(function () {
|
|
21742
|
-
// eslint-disable-next-line es
|
|
21829
|
+
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
21743
21830
|
return Object.defineProperty(function () { /* empty */ }, 'prototype', {
|
|
21744
21831
|
value: 42,
|
|
21745
21832
|
writable: false
|
|
@@ -21756,9 +21843,9 @@ var anObject = function (argument) {
|
|
|
21756
21843
|
};
|
|
21757
21844
|
|
|
21758
21845
|
var $TypeError$5 = TypeError;
|
|
21759
|
-
// eslint-disable-next-line es
|
|
21846
|
+
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
21760
21847
|
var $defineProperty = Object.defineProperty;
|
|
21761
|
-
// eslint-disable-next-line es
|
|
21848
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
21762
21849
|
var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
|
|
21763
21850
|
var ENUMERABLE = 'enumerable';
|
|
21764
21851
|
var CONFIGURABLE = 'configurable';
|
|
@@ -21805,7 +21892,7 @@ var createNonEnumerableProperty = descriptors ? function (object, key, value) {
|
|
|
21805
21892
|
};
|
|
21806
21893
|
|
|
21807
21894
|
var FunctionPrototype$1 = Function.prototype;
|
|
21808
|
-
// eslint-disable-next-line es
|
|
21895
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
21809
21896
|
var getDescriptor = descriptors && Object.getOwnPropertyDescriptor;
|
|
21810
21897
|
|
|
21811
21898
|
var EXISTS$1 = hasOwnProperty_1(FunctionPrototype$1, 'name');
|
|
@@ -21832,7 +21919,7 @@ var inspectSource = sharedStore.inspectSource;
|
|
|
21832
21919
|
|
|
21833
21920
|
var WeakMap$1 = global_1.WeakMap;
|
|
21834
21921
|
|
|
21835
|
-
var
|
|
21922
|
+
var weakMapBasicDetection = isCallable(WeakMap$1) && /native code/.test(String(WeakMap$1));
|
|
21836
21923
|
|
|
21837
21924
|
var keys$1 = shared('keys');
|
|
21838
21925
|
|
|
@@ -21860,28 +21947,30 @@ var getterFor = function (TYPE) {
|
|
|
21860
21947
|
};
|
|
21861
21948
|
};
|
|
21862
21949
|
|
|
21863
|
-
if (
|
|
21950
|
+
if (weakMapBasicDetection || sharedStore.state) {
|
|
21864
21951
|
var store$1 = sharedStore.state || (sharedStore.state = new WeakMap$2());
|
|
21865
|
-
|
|
21866
|
-
|
|
21867
|
-
|
|
21952
|
+
/* eslint-disable no-self-assign -- prototype methods protection */
|
|
21953
|
+
store$1.get = store$1.get;
|
|
21954
|
+
store$1.has = store$1.has;
|
|
21955
|
+
store$1.set = store$1.set;
|
|
21956
|
+
/* eslint-enable no-self-assign -- prototype methods protection */
|
|
21868
21957
|
set = function (it, metadata) {
|
|
21869
|
-
if (
|
|
21958
|
+
if (store$1.has(it)) throw TypeError$1(OBJECT_ALREADY_INITIALIZED);
|
|
21870
21959
|
metadata.facade = it;
|
|
21871
|
-
|
|
21960
|
+
store$1.set(it, metadata);
|
|
21872
21961
|
return metadata;
|
|
21873
21962
|
};
|
|
21874
21963
|
get = function (it) {
|
|
21875
|
-
return
|
|
21964
|
+
return store$1.get(it) || {};
|
|
21876
21965
|
};
|
|
21877
21966
|
has = function (it) {
|
|
21878
|
-
return
|
|
21967
|
+
return store$1.has(it);
|
|
21879
21968
|
};
|
|
21880
21969
|
} else {
|
|
21881
21970
|
var STATE = sharedKey('state');
|
|
21882
21971
|
hiddenKeys[STATE] = true;
|
|
21883
21972
|
set = function (it, metadata) {
|
|
21884
|
-
if (hasOwnProperty_1(it, STATE)) throw
|
|
21973
|
+
if (hasOwnProperty_1(it, STATE)) throw TypeError$1(OBJECT_ALREADY_INITIALIZED);
|
|
21885
21974
|
metadata.facade = it;
|
|
21886
21975
|
createNonEnumerableProperty(it, STATE, metadata);
|
|
21887
21976
|
return metadata;
|
|
@@ -21909,7 +21998,7 @@ var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
|
|
|
21909
21998
|
|
|
21910
21999
|
var enforceInternalState = internalState.enforce;
|
|
21911
22000
|
var getInternalState = internalState.get;
|
|
21912
|
-
// eslint-disable-next-line es
|
|
22001
|
+
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
21913
22002
|
var defineProperty = Object.defineProperty;
|
|
21914
22003
|
|
|
21915
22004
|
var CONFIGURABLE_LENGTH = descriptors && !fails(function () {
|
|
@@ -21978,7 +22067,7 @@ var floor = Math.floor;
|
|
|
21978
22067
|
|
|
21979
22068
|
// `Math.trunc` method
|
|
21980
22069
|
// https://tc39.es/ecma262/#sec-math.trunc
|
|
21981
|
-
// eslint-disable-next-line es
|
|
22070
|
+
// eslint-disable-next-line es/no-math-trunc -- safe
|
|
21982
22071
|
var mathTrunc = Math.trunc || function trunc(x) {
|
|
21983
22072
|
var n = +x;
|
|
21984
22073
|
return (n > 0 ? floor : ceil)(n);
|
|
@@ -22079,7 +22168,7 @@ var hiddenKeys$1 = enumBugKeys.concat('length', 'prototype');
|
|
|
22079
22168
|
|
|
22080
22169
|
// `Object.getOwnPropertyNames` method
|
|
22081
22170
|
// https://tc39.es/ecma262/#sec-object.getownpropertynames
|
|
22082
|
-
// eslint-disable-next-line es
|
|
22171
|
+
// eslint-disable-next-line es/no-object-getownpropertynames -- safe
|
|
22083
22172
|
var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
|
22084
22173
|
return objectKeysInternal(O, hiddenKeys$1);
|
|
22085
22174
|
};
|
|
@@ -22088,7 +22177,7 @@ var objectGetOwnPropertyNames = {
|
|
|
22088
22177
|
f: f$3
|
|
22089
22178
|
};
|
|
22090
22179
|
|
|
22091
|
-
// eslint-disable-next-line es
|
|
22180
|
+
// eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
|
|
22092
22181
|
var f$4 = Object.getOwnPropertySymbols;
|
|
22093
22182
|
|
|
22094
22183
|
var objectGetOwnPropertySymbols = {
|
|
@@ -22232,7 +22321,7 @@ var toString_1 = function (argument) {
|
|
|
22232
22321
|
var charAt = functionUncurryThis(''.charAt);
|
|
22233
22322
|
|
|
22234
22323
|
var FORCED = fails(function () {
|
|
22235
|
-
// eslint-disable-next-line es
|
|
22324
|
+
// eslint-disable-next-line es/no-array-string-prototype-at -- safe
|
|
22236
22325
|
return '𠮷'.at(-2) !== '\uD842';
|
|
22237
22326
|
});
|
|
22238
22327
|
|
|
@@ -22250,14 +22339,14 @@ _export({ target: 'String', proto: true, forced: FORCED }, {
|
|
|
22250
22339
|
|
|
22251
22340
|
// `Object.keys` method
|
|
22252
22341
|
// https://tc39.es/ecma262/#sec-object.keys
|
|
22253
|
-
// eslint-disable-next-line es
|
|
22342
|
+
// eslint-disable-next-line es/no-object-keys -- safe
|
|
22254
22343
|
var objectKeys = Object.keys || function keys(O) {
|
|
22255
22344
|
return objectKeysInternal(O, enumBugKeys);
|
|
22256
22345
|
};
|
|
22257
22346
|
|
|
22258
22347
|
// `Object.defineProperties` method
|
|
22259
22348
|
// https://tc39.es/ecma262/#sec-object.defineproperties
|
|
22260
|
-
// eslint-disable-next-line es
|
|
22349
|
+
// eslint-disable-next-line es/no-object-defineproperties -- safe
|
|
22261
22350
|
var f$5 = descriptors && !v8PrototypeDefineBug ? Object.defineProperties : function defineProperties(O, Properties) {
|
|
22262
22351
|
anObject(O);
|
|
22263
22352
|
var props = toIndexedObject(Properties);
|
|
@@ -22346,7 +22435,7 @@ hiddenKeys[IE_PROTO] = true;
|
|
|
22346
22435
|
|
|
22347
22436
|
// `Object.create` method
|
|
22348
22437
|
// https://tc39.es/ecma262/#sec-object.create
|
|
22349
|
-
// eslint-disable-next-line es
|
|
22438
|
+
// eslint-disable-next-line es/no-object-create -- safe
|
|
22350
22439
|
var objectCreate = Object.create || function create(O, Properties) {
|
|
22351
22440
|
var result;
|
|
22352
22441
|
if (O !== null) {
|
|
@@ -22392,13 +22481,13 @@ _export({ target: 'Array', proto: true }, {
|
|
|
22392
22481
|
|
|
22393
22482
|
addToUnscopables('at');
|
|
22394
22483
|
|
|
22395
|
-
// eslint-disable-next-line es
|
|
22396
|
-
var
|
|
22484
|
+
// eslint-disable-next-line es/no-typed-arrays -- safe
|
|
22485
|
+
var arrayBufferBasicDetection = typeof ArrayBuffer != 'undefined' && typeof DataView != 'undefined';
|
|
22397
22486
|
|
|
22398
22487
|
var correctPrototypeGetter = !fails(function () {
|
|
22399
22488
|
function F() { /* empty */ }
|
|
22400
22489
|
F.prototype.constructor = null;
|
|
22401
|
-
// eslint-disable-next-line es
|
|
22490
|
+
// eslint-disable-next-line es/no-object-getprototypeof -- required for testing
|
|
22402
22491
|
return Object.getPrototypeOf(new F()) !== F.prototype;
|
|
22403
22492
|
});
|
|
22404
22493
|
|
|
@@ -22408,7 +22497,7 @@ var ObjectPrototype = $Object$4.prototype;
|
|
|
22408
22497
|
|
|
22409
22498
|
// `Object.getPrototypeOf` method
|
|
22410
22499
|
// https://tc39.es/ecma262/#sec-object.getprototypeof
|
|
22411
|
-
// eslint-disable-next-line es
|
|
22500
|
+
// eslint-disable-next-line es/no-object-getprototypeof -- safe
|
|
22412
22501
|
var objectGetPrototypeOf = correctPrototypeGetter ? $Object$4.getPrototypeOf : function (O) {
|
|
22413
22502
|
var object = toObject(O);
|
|
22414
22503
|
if (hasOwnProperty_1(object, IE_PROTO$1)) return object[IE_PROTO$1];
|
|
@@ -22434,13 +22523,13 @@ var aPossiblePrototype = function (argument) {
|
|
|
22434
22523
|
// `Object.setPrototypeOf` method
|
|
22435
22524
|
// https://tc39.es/ecma262/#sec-object.setprototypeof
|
|
22436
22525
|
// Works with __proto__ only. Old v8 can't work with null proto objects.
|
|
22437
|
-
// eslint-disable-next-line es
|
|
22526
|
+
// eslint-disable-next-line es/no-object-setprototypeof -- safe
|
|
22438
22527
|
var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
|
|
22439
22528
|
var CORRECT_SETTER = false;
|
|
22440
22529
|
var test = {};
|
|
22441
22530
|
var setter;
|
|
22442
22531
|
try {
|
|
22443
|
-
// eslint-disable-next-line es
|
|
22532
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
22444
22533
|
setter = functionUncurryThis(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
|
|
22445
22534
|
setter(test, []);
|
|
22446
22535
|
CORRECT_SETTER = test instanceof Array;
|
|
@@ -22477,7 +22566,7 @@ var TO_STRING_TAG$2 = wellKnownSymbol('toStringTag');
|
|
|
22477
22566
|
var TYPED_ARRAY_TAG = uid('TYPED_ARRAY_TAG');
|
|
22478
22567
|
var TYPED_ARRAY_CONSTRUCTOR = 'TypedArrayConstructor';
|
|
22479
22568
|
// Fixing native typed arrays in Opera Presto crashes the browser, see #595
|
|
22480
|
-
var NATIVE_ARRAY_BUFFER_VIEWS =
|
|
22569
|
+
var NATIVE_ARRAY_BUFFER_VIEWS = arrayBufferBasicDetection && !!objectSetPrototypeOf && classof(global_1.opera) !== 'Opera';
|
|
22481
22570
|
var TYPED_ARRAY_TAG_REQUIRED = false;
|
|
22482
22571
|
var NAME, Constructor, Prototype;
|
|
22483
22572
|
|
|
@@ -37466,49 +37555,624 @@ var TableHeading_styled = styled__default.th.withConfig({
|
|
|
37466
37555
|
return extraStyles;
|
|
37467
37556
|
});
|
|
37468
37557
|
|
|
37469
|
-
|
|
37470
|
-
value
|
|
37471
|
-
|
|
37472
|
-
|
|
37558
|
+
var validatorToPredicate = function validatorToPredicate(validatorFn, emptyCase) {
|
|
37559
|
+
return function (value) {
|
|
37560
|
+
for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
37561
|
+
rest[_key - 1] = arguments[_key];
|
|
37562
|
+
}
|
|
37563
|
+
|
|
37564
|
+
return value === "" ? emptyCase : validatorFn.apply(void 0, [value].concat(rest));
|
|
37565
|
+
};
|
|
37566
|
+
};
|
|
37473
37567
|
|
|
37474
37568
|
var commonjsGlobal$1 = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
37475
37569
|
|
|
37476
|
-
|
|
37570
|
+
function getDefaultExportFromCjs(x) {
|
|
37571
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
37572
|
+
}
|
|
37573
|
+
|
|
37574
|
+
var dayjs_min = {
|
|
37575
|
+
exports: {}
|
|
37576
|
+
};
|
|
37477
37577
|
|
|
37478
37578
|
(function (module, exports) {
|
|
37479
|
-
!function
|
|
37480
|
-
|
|
37579
|
+
!function (t, e) {
|
|
37580
|
+
module.exports = e();
|
|
37581
|
+
}(commonjsGlobal$1, function () {
|
|
37582
|
+
var t = 1e3,
|
|
37583
|
+
e = 6e4,
|
|
37584
|
+
n = 36e5,
|
|
37585
|
+
r = "millisecond",
|
|
37586
|
+
i = "second",
|
|
37587
|
+
s = "minute",
|
|
37588
|
+
u = "hour",
|
|
37589
|
+
a = "day",
|
|
37590
|
+
o = "week",
|
|
37591
|
+
f = "month",
|
|
37592
|
+
h = "quarter",
|
|
37593
|
+
c = "year",
|
|
37594
|
+
d = "date",
|
|
37595
|
+
$ = "Invalid Date",
|
|
37596
|
+
l = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,
|
|
37597
|
+
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,
|
|
37598
|
+
M = {
|
|
37599
|
+
name: "en",
|
|
37600
|
+
weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),
|
|
37601
|
+
months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_")
|
|
37602
|
+
},
|
|
37603
|
+
m = function m(t, e, n) {
|
|
37604
|
+
var r = String(t);
|
|
37605
|
+
return !r || r.length >= e ? t : "" + Array(e + 1 - r.length).join(n) + t;
|
|
37606
|
+
},
|
|
37607
|
+
g = {
|
|
37608
|
+
s: m,
|
|
37609
|
+
z: function z(t) {
|
|
37610
|
+
var e = -t.utcOffset(),
|
|
37611
|
+
n = Math.abs(e),
|
|
37612
|
+
r = Math.floor(n / 60),
|
|
37613
|
+
i = n % 60;
|
|
37614
|
+
return (e <= 0 ? "+" : "-") + m(r, 2, "0") + ":" + m(i, 2, "0");
|
|
37615
|
+
},
|
|
37616
|
+
m: function t(e, n) {
|
|
37617
|
+
if (e.date() < n.date()) return -t(n, e);
|
|
37618
|
+
var r = 12 * (n.year() - e.year()) + (n.month() - e.month()),
|
|
37619
|
+
i = e.clone().add(r, f),
|
|
37620
|
+
s = n - i < 0,
|
|
37621
|
+
u = e.clone().add(r + (s ? -1 : 1), f);
|
|
37622
|
+
return +(-(r + (n - i) / (s ? i - u : u - i)) || 0);
|
|
37623
|
+
},
|
|
37624
|
+
a: function a(t) {
|
|
37625
|
+
return t < 0 ? Math.ceil(t) || 0 : Math.floor(t);
|
|
37626
|
+
},
|
|
37627
|
+
p: function p(t) {
|
|
37628
|
+
return {
|
|
37629
|
+
M: f,
|
|
37630
|
+
y: c,
|
|
37631
|
+
w: o,
|
|
37632
|
+
d: a,
|
|
37633
|
+
D: d,
|
|
37634
|
+
h: u,
|
|
37635
|
+
m: s,
|
|
37636
|
+
s: i,
|
|
37637
|
+
ms: r,
|
|
37638
|
+
Q: h
|
|
37639
|
+
}[t] || String(t || "").toLowerCase().replace(/s$/, "");
|
|
37640
|
+
},
|
|
37641
|
+
u: function u(t) {
|
|
37642
|
+
return void 0 === t;
|
|
37643
|
+
}
|
|
37644
|
+
},
|
|
37645
|
+
D = "en",
|
|
37646
|
+
v = {};
|
|
37481
37647
|
|
|
37482
|
-
|
|
37648
|
+
v[D] = M;
|
|
37483
37649
|
|
|
37484
|
-
var
|
|
37650
|
+
var p = function p(t) {
|
|
37651
|
+
return t instanceof _;
|
|
37652
|
+
},
|
|
37653
|
+
S = function S(t, e, n) {
|
|
37654
|
+
var r;
|
|
37655
|
+
if (!t) return D;
|
|
37656
|
+
if ("string" == typeof t) v[t] && (r = t), e && (v[t] = e, r = t);else {
|
|
37657
|
+
var i = t.name;
|
|
37658
|
+
v[i] = t, r = i;
|
|
37659
|
+
}
|
|
37660
|
+
return !n && r && (D = r), r || !n && D;
|
|
37661
|
+
},
|
|
37662
|
+
w = function w(t, e) {
|
|
37663
|
+
if (p(t)) return t.clone();
|
|
37664
|
+
var n = "object" == _typeof(e) ? e : {};
|
|
37665
|
+
return n.date = t, n.args = arguments, new _(n);
|
|
37666
|
+
},
|
|
37667
|
+
O = g;
|
|
37668
|
+
|
|
37669
|
+
O.l = S, O.i = p, O.w = function (t, e) {
|
|
37670
|
+
return w(t, {
|
|
37671
|
+
locale: e.$L,
|
|
37672
|
+
utc: e.$u,
|
|
37673
|
+
x: e.$x,
|
|
37674
|
+
$offset: e.$offset
|
|
37675
|
+
});
|
|
37676
|
+
};
|
|
37485
37677
|
|
|
37486
|
-
|
|
37487
|
-
|
|
37488
|
-
|
|
37678
|
+
var _ = function () {
|
|
37679
|
+
function M(t) {
|
|
37680
|
+
this.$L = S(t.locale, null, !0), this.parse(t);
|
|
37681
|
+
}
|
|
37682
|
+
|
|
37683
|
+
var m = M.prototype;
|
|
37684
|
+
return m.parse = function (t) {
|
|
37685
|
+
this.$d = function (t) {
|
|
37686
|
+
var e = t.date,
|
|
37687
|
+
n = t.utc;
|
|
37688
|
+
if (null === e) return new Date(NaN);
|
|
37689
|
+
if (O.u(e)) return new Date();
|
|
37690
|
+
if (e instanceof Date) return new Date(e);
|
|
37691
|
+
|
|
37692
|
+
if ("string" == typeof e && !/Z$/i.test(e)) {
|
|
37693
|
+
var r = e.match(l);
|
|
37694
|
+
|
|
37695
|
+
if (r) {
|
|
37696
|
+
var i = r[2] - 1 || 0,
|
|
37697
|
+
s = (r[7] || "0").substring(0, 3);
|
|
37698
|
+
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);
|
|
37699
|
+
}
|
|
37700
|
+
}
|
|
37701
|
+
|
|
37702
|
+
return new Date(e);
|
|
37703
|
+
}(t), this.$x = t.x || {}, this.init();
|
|
37704
|
+
}, m.init = function () {
|
|
37705
|
+
var t = this.$d;
|
|
37706
|
+
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();
|
|
37707
|
+
}, m.$utils = function () {
|
|
37708
|
+
return O;
|
|
37709
|
+
}, m.isValid = function () {
|
|
37710
|
+
return !(this.$d.toString() === $);
|
|
37711
|
+
}, m.isSame = function (t, e) {
|
|
37712
|
+
var n = w(t);
|
|
37713
|
+
return this.startOf(e) <= n && n <= this.endOf(e);
|
|
37714
|
+
}, m.isAfter = function (t, e) {
|
|
37715
|
+
return w(t) < this.startOf(e);
|
|
37716
|
+
}, m.isBefore = function (t, e) {
|
|
37717
|
+
return this.endOf(e) < w(t);
|
|
37718
|
+
}, m.$g = function (t, e, n) {
|
|
37719
|
+
return O.u(t) ? this[e] : this.set(n, t);
|
|
37720
|
+
}, m.unix = function () {
|
|
37721
|
+
return Math.floor(this.valueOf() / 1e3);
|
|
37722
|
+
}, m.valueOf = function () {
|
|
37723
|
+
return this.$d.getTime();
|
|
37724
|
+
}, m.startOf = function (t, e) {
|
|
37725
|
+
var n = this,
|
|
37726
|
+
r = !!O.u(e) || e,
|
|
37727
|
+
h = O.p(t),
|
|
37728
|
+
$ = function $(t, e) {
|
|
37729
|
+
var i = O.w(n.$u ? Date.UTC(n.$y, e, t) : new Date(n.$y, e, t), n);
|
|
37730
|
+
return r ? i : i.endOf(a);
|
|
37731
|
+
},
|
|
37732
|
+
l = function l(t, e) {
|
|
37733
|
+
return O.w(n.toDate()[t].apply(n.toDate("s"), (r ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e)), n);
|
|
37734
|
+
},
|
|
37735
|
+
y = this.$W,
|
|
37736
|
+
M = this.$M,
|
|
37737
|
+
m = this.$D,
|
|
37738
|
+
g = "set" + (this.$u ? "UTC" : "");
|
|
37739
|
+
|
|
37740
|
+
switch (h) {
|
|
37741
|
+
case c:
|
|
37742
|
+
return r ? $(1, 0) : $(31, 11);
|
|
37743
|
+
|
|
37744
|
+
case f:
|
|
37745
|
+
return r ? $(1, M) : $(0, M + 1);
|
|
37746
|
+
|
|
37747
|
+
case o:
|
|
37748
|
+
var D = this.$locale().weekStart || 0,
|
|
37749
|
+
v = (y < D ? y + 7 : y) - D;
|
|
37750
|
+
return $(r ? m - v : m + (6 - v), M);
|
|
37751
|
+
|
|
37752
|
+
case a:
|
|
37753
|
+
case d:
|
|
37754
|
+
return l(g + "Hours", 0);
|
|
37755
|
+
|
|
37756
|
+
case u:
|
|
37757
|
+
return l(g + "Minutes", 1);
|
|
37758
|
+
|
|
37759
|
+
case s:
|
|
37760
|
+
return l(g + "Seconds", 2);
|
|
37761
|
+
|
|
37762
|
+
case i:
|
|
37763
|
+
return l(g + "Milliseconds", 3);
|
|
37764
|
+
|
|
37765
|
+
default:
|
|
37766
|
+
return this.clone();
|
|
37767
|
+
}
|
|
37768
|
+
}, m.endOf = function (t) {
|
|
37769
|
+
return this.startOf(t, !1);
|
|
37770
|
+
}, m.$set = function (t, e) {
|
|
37771
|
+
var n,
|
|
37772
|
+
o = O.p(t),
|
|
37773
|
+
h = "set" + (this.$u ? "UTC" : ""),
|
|
37774
|
+
$ = (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],
|
|
37775
|
+
l = o === a ? this.$D + (e - this.$W) : e;
|
|
37776
|
+
|
|
37777
|
+
if (o === f || o === c) {
|
|
37778
|
+
var y = this.clone().set(d, 1);
|
|
37779
|
+
y.$d[$](l), y.init(), this.$d = y.set(d, Math.min(this.$D, y.daysInMonth())).$d;
|
|
37780
|
+
} else $ && this.$d[$](l);
|
|
37781
|
+
|
|
37782
|
+
return this.init(), this;
|
|
37783
|
+
}, m.set = function (t, e) {
|
|
37784
|
+
return this.clone().$set(t, e);
|
|
37785
|
+
}, m.get = function (t) {
|
|
37786
|
+
return this[O.p(t)]();
|
|
37787
|
+
}, m.add = function (r, h) {
|
|
37788
|
+
var d,
|
|
37789
|
+
$ = this;
|
|
37790
|
+
r = Number(r);
|
|
37791
|
+
|
|
37792
|
+
var l = O.p(h),
|
|
37793
|
+
y = function y(t) {
|
|
37794
|
+
var e = w($);
|
|
37795
|
+
return O.w(e.date(e.date() + Math.round(t * r)), $);
|
|
37796
|
+
};
|
|
37489
37797
|
|
|
37490
|
-
|
|
37798
|
+
if (l === f) return this.set(f, this.$M + r);
|
|
37799
|
+
if (l === c) return this.set(c, this.$y + r);
|
|
37800
|
+
if (l === a) return y(1);
|
|
37801
|
+
if (l === o) return y(7);
|
|
37802
|
+
var M = (d = {}, d[s] = e, d[u] = n, d[i] = t, d)[l] || 1,
|
|
37803
|
+
m = this.$d.getTime() + r * M;
|
|
37804
|
+
return O.w(m, this);
|
|
37805
|
+
}, m.subtract = function (t, e) {
|
|
37806
|
+
return this.add(-1 * t, e);
|
|
37807
|
+
}, m.format = function (t) {
|
|
37808
|
+
var e = this,
|
|
37809
|
+
n = this.$locale();
|
|
37810
|
+
if (!this.isValid()) return n.invalidDate || $;
|
|
37811
|
+
|
|
37812
|
+
var r = t || "YYYY-MM-DDTHH:mm:ssZ",
|
|
37813
|
+
i = O.z(this),
|
|
37814
|
+
s = this.$H,
|
|
37815
|
+
u = this.$m,
|
|
37816
|
+
a = this.$M,
|
|
37817
|
+
o = n.weekdays,
|
|
37818
|
+
f = n.months,
|
|
37819
|
+
h = function h(t, n, i, s) {
|
|
37820
|
+
return t && (t[n] || t(e, r)) || i[n].substr(0, s);
|
|
37821
|
+
},
|
|
37822
|
+
c = function c(t) {
|
|
37823
|
+
return O.s(s % 12 || 12, t, "0");
|
|
37824
|
+
},
|
|
37825
|
+
d = n.meridiem || function (t, e, n) {
|
|
37826
|
+
var r = t < 12 ? "AM" : "PM";
|
|
37827
|
+
return n ? r.toLowerCase() : r;
|
|
37828
|
+
},
|
|
37829
|
+
l = {
|
|
37830
|
+
YY: String(this.$y).slice(-2),
|
|
37831
|
+
YYYY: this.$y,
|
|
37832
|
+
M: a + 1,
|
|
37833
|
+
MM: O.s(a + 1, 2, "0"),
|
|
37834
|
+
MMM: h(n.monthsShort, a, f, 3),
|
|
37835
|
+
MMMM: h(f, a),
|
|
37836
|
+
D: this.$D,
|
|
37837
|
+
DD: O.s(this.$D, 2, "0"),
|
|
37838
|
+
d: String(this.$W),
|
|
37839
|
+
dd: h(n.weekdaysMin, this.$W, o, 2),
|
|
37840
|
+
ddd: h(n.weekdaysShort, this.$W, o, 3),
|
|
37841
|
+
dddd: o[this.$W],
|
|
37842
|
+
H: String(s),
|
|
37843
|
+
HH: O.s(s, 2, "0"),
|
|
37844
|
+
h: c(1),
|
|
37845
|
+
hh: c(2),
|
|
37846
|
+
a: d(s, u, !0),
|
|
37847
|
+
A: d(s, u, !1),
|
|
37848
|
+
m: String(u),
|
|
37849
|
+
mm: O.s(u, 2, "0"),
|
|
37850
|
+
s: String(this.$s),
|
|
37851
|
+
ss: O.s(this.$s, 2, "0"),
|
|
37852
|
+
SSS: O.s(this.$ms, 3, "0"),
|
|
37853
|
+
Z: i
|
|
37854
|
+
};
|
|
37491
37855
|
|
|
37492
|
-
|
|
37856
|
+
return r.replace(y, function (t, e) {
|
|
37857
|
+
return e || l[t] || i.replace(":", "");
|
|
37858
|
+
});
|
|
37859
|
+
}, m.utcOffset = function () {
|
|
37860
|
+
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
37861
|
+
}, m.diff = function (r, d, $) {
|
|
37862
|
+
var l,
|
|
37863
|
+
y = O.p(d),
|
|
37864
|
+
M = w(r),
|
|
37865
|
+
m = (M.utcOffset() - this.utcOffset()) * e,
|
|
37866
|
+
g = this - M,
|
|
37867
|
+
D = O.m(this, M);
|
|
37868
|
+
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);
|
|
37869
|
+
}, m.daysInMonth = function () {
|
|
37870
|
+
return this.endOf(f).$D;
|
|
37871
|
+
}, m.$locale = function () {
|
|
37872
|
+
return v[this.$L];
|
|
37873
|
+
}, m.locale = function (t, e) {
|
|
37874
|
+
if (!t) return this.$L;
|
|
37875
|
+
var n = this.clone(),
|
|
37876
|
+
r = S(t, e, !0);
|
|
37877
|
+
return r && (n.$L = r), n;
|
|
37878
|
+
}, m.clone = function () {
|
|
37879
|
+
return O.w(this.$d, this);
|
|
37880
|
+
}, m.toDate = function () {
|
|
37881
|
+
return new Date(this.valueOf());
|
|
37882
|
+
}, m.toJSON = function () {
|
|
37883
|
+
return this.isValid() ? this.toISOString() : null;
|
|
37884
|
+
}, m.toISOString = function () {
|
|
37885
|
+
return this.$d.toISOString();
|
|
37886
|
+
}, m.toString = function () {
|
|
37887
|
+
return this.$d.toUTCString();
|
|
37888
|
+
}, M;
|
|
37889
|
+
}(),
|
|
37890
|
+
b = _.prototype;
|
|
37891
|
+
|
|
37892
|
+
return w.prototype = b, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", f], ["$y", c], ["$D", d]].forEach(function (t) {
|
|
37893
|
+
b[t[1]] = function (e) {
|
|
37894
|
+
return this.$g(e, t[0], t[1]);
|
|
37895
|
+
};
|
|
37896
|
+
}), w.extend = function (t, e) {
|
|
37897
|
+
return t.$i || (t(e, _, w), t.$i = !0), w;
|
|
37898
|
+
}, w.locale = S, w.isDayjs = p, w.unix = function (t) {
|
|
37899
|
+
return w(1e3 * t);
|
|
37900
|
+
}, w.en = v[D], w.Ls = v, w.p = {}, w;
|
|
37901
|
+
});
|
|
37902
|
+
})(dayjs_min);
|
|
37903
|
+
|
|
37904
|
+
var dayjs_minExports = dayjs_min.exports;
|
|
37905
|
+
var dayjs = /*@__PURE__*/getDefaultExportFromCjs(dayjs_minExports);
|
|
37906
|
+
var customParseFormat$1 = {
|
|
37907
|
+
exports: {}
|
|
37908
|
+
};
|
|
37493
37909
|
|
|
37494
37910
|
(function (module, exports) {
|
|
37495
|
-
!function(
|
|
37496
|
-
|
|
37911
|
+
!function (t, e) {
|
|
37912
|
+
module.exports = e();
|
|
37913
|
+
}(commonjsGlobal$1, function () {
|
|
37914
|
+
var t = {
|
|
37915
|
+
LTS: "h:mm:ss A",
|
|
37916
|
+
LT: "h:mm A",
|
|
37917
|
+
L: "MM/DD/YYYY",
|
|
37918
|
+
LL: "MMMM D, YYYY",
|
|
37919
|
+
LLL: "MMMM D, YYYY h:mm A",
|
|
37920
|
+
LLLL: "dddd, MMMM D, YYYY h:mm A"
|
|
37921
|
+
},
|
|
37922
|
+
e = /(\[[^[]*\])|([-:/.()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,
|
|
37923
|
+
n = /\d\d/,
|
|
37924
|
+
r = /\d\d?/,
|
|
37925
|
+
i = /\d*[^\s\d-_:/()]+/,
|
|
37926
|
+
o = {},
|
|
37927
|
+
s = function s(t) {
|
|
37928
|
+
return (t = +t) + (t > 68 ? 1900 : 2e3);
|
|
37929
|
+
};
|
|
37930
|
+
|
|
37931
|
+
var a = function a(t) {
|
|
37932
|
+
return function (e) {
|
|
37933
|
+
this[t] = +e;
|
|
37934
|
+
};
|
|
37935
|
+
},
|
|
37936
|
+
f = [/[+-]\d\d:?(\d\d)?|Z/, function (t) {
|
|
37937
|
+
(this.zone || (this.zone = {})).offset = function (t) {
|
|
37938
|
+
if (!t) return 0;
|
|
37939
|
+
if ("Z" === t) return 0;
|
|
37940
|
+
var e = t.match(/([+-]|\d\d)/g),
|
|
37941
|
+
n = 60 * e[1] + (+e[2] || 0);
|
|
37942
|
+
return 0 === n ? 0 : "+" === e[0] ? -n : n;
|
|
37943
|
+
}(t);
|
|
37944
|
+
}],
|
|
37945
|
+
u = function u(t) {
|
|
37946
|
+
var e = o[t];
|
|
37947
|
+
return e && (e.indexOf ? e : e.s.concat(e.f));
|
|
37948
|
+
},
|
|
37949
|
+
h = function h(t, e) {
|
|
37950
|
+
var n,
|
|
37951
|
+
r = o.meridiem;
|
|
37952
|
+
|
|
37953
|
+
if (r) {
|
|
37954
|
+
for (var i = 1; i <= 24; i += 1) {
|
|
37955
|
+
if (t.indexOf(r(i, 0, e)) > -1) {
|
|
37956
|
+
n = i > 12;
|
|
37957
|
+
break;
|
|
37958
|
+
}
|
|
37959
|
+
}
|
|
37960
|
+
} else n = t === (e ? "pm" : "PM");
|
|
37961
|
+
|
|
37962
|
+
return n;
|
|
37963
|
+
},
|
|
37964
|
+
d = {
|
|
37965
|
+
A: [i, function (t) {
|
|
37966
|
+
this.afternoon = h(t, !1);
|
|
37967
|
+
}],
|
|
37968
|
+
a: [i, function (t) {
|
|
37969
|
+
this.afternoon = h(t, !0);
|
|
37970
|
+
}],
|
|
37971
|
+
S: [/\d/, function (t) {
|
|
37972
|
+
this.milliseconds = 100 * +t;
|
|
37973
|
+
}],
|
|
37974
|
+
SS: [n, function (t) {
|
|
37975
|
+
this.milliseconds = 10 * +t;
|
|
37976
|
+
}],
|
|
37977
|
+
SSS: [/\d{3}/, function (t) {
|
|
37978
|
+
this.milliseconds = +t;
|
|
37979
|
+
}],
|
|
37980
|
+
s: [r, a("seconds")],
|
|
37981
|
+
ss: [r, a("seconds")],
|
|
37982
|
+
m: [r, a("minutes")],
|
|
37983
|
+
mm: [r, a("minutes")],
|
|
37984
|
+
H: [r, a("hours")],
|
|
37985
|
+
h: [r, a("hours")],
|
|
37986
|
+
HH: [r, a("hours")],
|
|
37987
|
+
hh: [r, a("hours")],
|
|
37988
|
+
D: [r, a("day")],
|
|
37989
|
+
DD: [n, a("day")],
|
|
37990
|
+
Do: [i, function (t) {
|
|
37991
|
+
var e = o.ordinal,
|
|
37992
|
+
n = t.match(/\d+/);
|
|
37993
|
+
if (this.day = n[0], e) for (var r = 1; r <= 31; r += 1) {
|
|
37994
|
+
e(r).replace(/\[|\]/g, "") === t && (this.day = r);
|
|
37995
|
+
}
|
|
37996
|
+
}],
|
|
37997
|
+
M: [r, a("month")],
|
|
37998
|
+
MM: [n, a("month")],
|
|
37999
|
+
MMM: [i, function (t) {
|
|
38000
|
+
var e = u("months"),
|
|
38001
|
+
n = (u("monthsShort") || e.map(function (t) {
|
|
38002
|
+
return t.substr(0, 3);
|
|
38003
|
+
})).indexOf(t) + 1;
|
|
38004
|
+
if (n < 1) throw new Error();
|
|
38005
|
+
this.month = n % 12 || n;
|
|
38006
|
+
}],
|
|
38007
|
+
MMMM: [i, function (t) {
|
|
38008
|
+
var e = u("months").indexOf(t) + 1;
|
|
38009
|
+
if (e < 1) throw new Error();
|
|
38010
|
+
this.month = e % 12 || e;
|
|
38011
|
+
}],
|
|
38012
|
+
Y: [/[+-]?\d+/, a("year")],
|
|
38013
|
+
YY: [n, function (t) {
|
|
38014
|
+
this.year = s(t);
|
|
38015
|
+
}],
|
|
38016
|
+
YYYY: [/\d{4}/, a("year")],
|
|
38017
|
+
Z: f,
|
|
38018
|
+
ZZ: f
|
|
38019
|
+
};
|
|
38020
|
+
|
|
38021
|
+
function c(n) {
|
|
38022
|
+
var r, i;
|
|
38023
|
+
r = n, i = o && o.formats;
|
|
38024
|
+
|
|
38025
|
+
for (var s = (n = r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function (e, n, r) {
|
|
38026
|
+
var o = r && r.toUpperCase();
|
|
38027
|
+
return n || i[r] || t[r] || i[o].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function (t, e, n) {
|
|
38028
|
+
return e || n.slice(1);
|
|
38029
|
+
});
|
|
38030
|
+
})).match(e), a = s.length, f = 0; f < a; f += 1) {
|
|
38031
|
+
var u = s[f],
|
|
38032
|
+
h = d[u],
|
|
38033
|
+
c = h && h[0],
|
|
38034
|
+
l = h && h[1];
|
|
38035
|
+
s[f] = l ? {
|
|
38036
|
+
regex: c,
|
|
38037
|
+
parser: l
|
|
38038
|
+
} : u.replace(/^\[|\]$/g, "");
|
|
38039
|
+
}
|
|
38040
|
+
|
|
38041
|
+
return function (t) {
|
|
38042
|
+
for (var e = {}, n = 0, r = 0; n < a; n += 1) {
|
|
38043
|
+
var i = s[n];
|
|
38044
|
+
if ("string" == typeof i) r += i.length;else {
|
|
38045
|
+
var o = i.regex,
|
|
38046
|
+
f = i.parser,
|
|
38047
|
+
u = t.substr(r),
|
|
38048
|
+
h = o.exec(u)[0];
|
|
38049
|
+
f.call(e, h), t = t.replace(h, "");
|
|
38050
|
+
}
|
|
38051
|
+
}
|
|
38052
|
+
|
|
38053
|
+
return function (t) {
|
|
38054
|
+
var e = t.afternoon;
|
|
38055
|
+
|
|
38056
|
+
if (void 0 !== e) {
|
|
38057
|
+
var n = t.hours;
|
|
38058
|
+
e ? n < 12 && (t.hours += 12) : 12 === n && (t.hours = 0), delete t.afternoon;
|
|
38059
|
+
}
|
|
38060
|
+
}(e), e;
|
|
38061
|
+
};
|
|
38062
|
+
}
|
|
37497
38063
|
|
|
37498
|
-
|
|
38064
|
+
return function (t, e, n) {
|
|
38065
|
+
n.p.customParseFormat = !0, t && t.parseTwoDigitYear && (s = t.parseTwoDigitYear);
|
|
38066
|
+
var r = e.prototype,
|
|
38067
|
+
i = r.parse;
|
|
38068
|
+
|
|
38069
|
+
r.parse = function (t) {
|
|
38070
|
+
var e = t.date,
|
|
38071
|
+
r = t.utc,
|
|
38072
|
+
s = t.args;
|
|
38073
|
+
this.$u = r;
|
|
38074
|
+
var a = s[1];
|
|
38075
|
+
|
|
38076
|
+
if ("string" == typeof a) {
|
|
38077
|
+
var f = !0 === s[2],
|
|
38078
|
+
u = !0 === s[3],
|
|
38079
|
+
h = f || u,
|
|
38080
|
+
d = s[2];
|
|
38081
|
+
u && (d = s[2]), o = this.$locale(), !f && d && (o = n.Ls[d]), this.$d = function (t, e, n) {
|
|
38082
|
+
try {
|
|
38083
|
+
if (["x", "X"].indexOf(e) > -1) return new Date(("X" === e ? 1e3 : 1) * t);
|
|
38084
|
+
var r = c(e)(t),
|
|
38085
|
+
i = r.year,
|
|
38086
|
+
o = r.month,
|
|
38087
|
+
s = r.day,
|
|
38088
|
+
a = r.hours,
|
|
38089
|
+
f = r.minutes,
|
|
38090
|
+
u = r.seconds,
|
|
38091
|
+
h = r.milliseconds,
|
|
38092
|
+
d = r.zone,
|
|
38093
|
+
l = new Date(),
|
|
38094
|
+
m = s || (i || o ? 1 : l.getDate()),
|
|
38095
|
+
M = i || l.getFullYear(),
|
|
38096
|
+
Y = 0;
|
|
38097
|
+
i && !o || (Y = o > 0 ? o - 1 : l.getMonth());
|
|
38098
|
+
var p = a || 0,
|
|
38099
|
+
v = f || 0,
|
|
38100
|
+
D = u || 0,
|
|
38101
|
+
g = h || 0;
|
|
38102
|
+
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);
|
|
38103
|
+
} catch (t) {
|
|
38104
|
+
return new Date("");
|
|
38105
|
+
}
|
|
38106
|
+
}(e, a, r), this.init(), d && !0 !== d && (this.$L = this.locale(d).$L), h && e != this.format(a) && (this.$d = new Date("")), o = {};
|
|
38107
|
+
} else if (a instanceof Array) for (var l = a.length, m = 1; m <= l; m += 1) {
|
|
38108
|
+
s[1] = a[m - 1];
|
|
38109
|
+
var M = n.apply(this, s);
|
|
37499
38110
|
|
|
37500
|
-
|
|
38111
|
+
if (M.isValid()) {
|
|
38112
|
+
this.$d = M.$d, this.$L = M.$L, this.init();
|
|
38113
|
+
break;
|
|
38114
|
+
}
|
|
38115
|
+
|
|
38116
|
+
m === l && (this.$d = new Date(""));
|
|
38117
|
+
} else i.call(this, t);
|
|
38118
|
+
};
|
|
38119
|
+
};
|
|
38120
|
+
});
|
|
38121
|
+
})(customParseFormat$1);
|
|
38122
|
+
|
|
38123
|
+
var customParseFormatExports = customParseFormat$1.exports;
|
|
38124
|
+
var customParseFormat = /*@__PURE__*/getDefaultExportFromCjs(customParseFormatExports);
|
|
38125
|
+
var isSameOrBefore$1 = {
|
|
38126
|
+
exports: {}
|
|
38127
|
+
};
|
|
37501
38128
|
|
|
37502
38129
|
(function (module, exports) {
|
|
37503
|
-
!function(e,
|
|
37504
|
-
|
|
38130
|
+
!function (e, i) {
|
|
38131
|
+
module.exports = i();
|
|
38132
|
+
}(commonjsGlobal$1, function () {
|
|
38133
|
+
return function (e, i) {
|
|
38134
|
+
i.prototype.isSameOrBefore = function (e, i) {
|
|
38135
|
+
return this.isSame(e, i) || this.isBefore(e, i);
|
|
38136
|
+
};
|
|
38137
|
+
};
|
|
38138
|
+
});
|
|
38139
|
+
})(isSameOrBefore$1);
|
|
37505
38140
|
|
|
37506
|
-
var
|
|
38141
|
+
var isSameOrBeforeExports = isSameOrBefore$1.exports;
|
|
38142
|
+
var isSameOrBefore = /*@__PURE__*/getDefaultExportFromCjs(isSameOrBeforeExports);
|
|
38143
|
+
var isSameOrAfter$1 = {
|
|
38144
|
+
exports: {}
|
|
38145
|
+
};
|
|
37507
38146
|
|
|
38147
|
+
(function (module, exports) {
|
|
38148
|
+
!function (e, t) {
|
|
38149
|
+
module.exports = t();
|
|
38150
|
+
}(commonjsGlobal$1, function () {
|
|
38151
|
+
return function (e, t) {
|
|
38152
|
+
t.prototype.isSameOrAfter = function (e, t) {
|
|
38153
|
+
return this.isSame(e, t) || this.isAfter(e, t);
|
|
38154
|
+
};
|
|
38155
|
+
};
|
|
38156
|
+
});
|
|
38157
|
+
})(isSameOrAfter$1);
|
|
38158
|
+
|
|
38159
|
+
var isSameOrAfterExports = isSameOrAfter$1.exports;
|
|
38160
|
+
var isSameOrAfter = /*@__PURE__*/getDefaultExportFromCjs(isSameOrAfterExports);
|
|
37508
38161
|
/* eslint-disable no-unused-vars */
|
|
37509
38162
|
|
|
37510
|
-
|
|
37511
|
-
|
|
38163
|
+
var createValidator = function createValidator(type, error) {
|
|
38164
|
+
var validator = function validator() {
|
|
38165
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
38166
|
+
args[_key2] = arguments[_key2];
|
|
38167
|
+
}
|
|
38168
|
+
|
|
38169
|
+
return {
|
|
38170
|
+
type: type,
|
|
38171
|
+
args: args,
|
|
38172
|
+
error: error
|
|
38173
|
+
};
|
|
38174
|
+
};
|
|
38175
|
+
|
|
37512
38176
|
validator.error = error;
|
|
37513
38177
|
return validator;
|
|
37514
38178
|
};
|
|
@@ -37516,30 +38180,38 @@ const createValidator = (type, error) => {
|
|
|
37516
38180
|
dayjs.extend(customParseFormat);
|
|
37517
38181
|
dayjs.extend(isSameOrBefore);
|
|
37518
38182
|
dayjs.extend(isSameOrAfter);
|
|
38183
|
+
var validatorFns = {};
|
|
38184
|
+
var INCLUDED_IN = "validator/INCLUDED_IN";
|
|
38185
|
+
var INCLUDED_IN_ERROR = "error/INCLUDED_IN";
|
|
38186
|
+
var includedIn = createValidator(INCLUDED_IN, INCLUDED_IN_ERROR);
|
|
37519
38187
|
|
|
37520
|
-
|
|
38188
|
+
validatorFns[INCLUDED_IN] = function (value, args, form) {
|
|
38189
|
+
return Array.isArray(args[0]) ? args[0].includes(value) : args[0] === value;
|
|
38190
|
+
};
|
|
38191
|
+
|
|
38192
|
+
var REQUIRED = "validator/REQUIRED";
|
|
38193
|
+
var REQUIRED_ERROR = "error/REQUIRED";
|
|
38194
|
+
var required = createValidator(REQUIRED, REQUIRED_ERROR);
|
|
37521
38195
|
|
|
37522
|
-
|
|
37523
|
-
|
|
37524
|
-
|
|
37525
|
-
validatorFns[INCLUDED_IN] = (value, args, form) =>
|
|
37526
|
-
Array.isArray(args[0]) ? args[0].includes(value) : args[0] === value;
|
|
38196
|
+
validatorFns[REQUIRED] = function (value, args, form) {
|
|
38197
|
+
return value !== "";
|
|
38198
|
+
};
|
|
37527
38199
|
|
|
37528
|
-
|
|
37529
|
-
|
|
37530
|
-
|
|
37531
|
-
validatorFns[REQUIRED] = (value, args, form) => value !== "";
|
|
38200
|
+
var ONLY_INTEGERS = "validator/ONLY_INTEGERS";
|
|
38201
|
+
var ONLY_INTEGERS_ERROR = "error/ONLY_INTEGERS";
|
|
38202
|
+
var onlyIntegers = createValidator(ONLY_INTEGERS, ONLY_INTEGERS_ERROR);
|
|
37532
38203
|
|
|
37533
|
-
|
|
37534
|
-
|
|
37535
|
-
|
|
37536
|
-
validatorFns[ONLY_INTEGERS] = (value, args, form) => /^(-?\d+)?$/.test(value);
|
|
38204
|
+
validatorFns[ONLY_INTEGERS] = function (value, args, form) {
|
|
38205
|
+
return /^(-?\d+)?$/.test(value);
|
|
38206
|
+
};
|
|
37537
38207
|
|
|
37538
|
-
|
|
37539
|
-
|
|
37540
|
-
|
|
37541
|
-
validatorFns[ONLY_NATURALS] = (value, args, form) => /^(\d+)?$/.test(value);
|
|
38208
|
+
var ONLY_NATURALS = "validator/ONLY_NATURALS";
|
|
38209
|
+
var ONLY_NATURALS_ERROR = "error/ONLY_NATURALS";
|
|
38210
|
+
var onlyNaturals = createValidator(ONLY_NATURALS, ONLY_NATURALS_ERROR);
|
|
37542
38211
|
|
|
38212
|
+
validatorFns[ONLY_NATURALS] = function (value, args, form) {
|
|
38213
|
+
return /^(\d+)?$/.test(value);
|
|
38214
|
+
};
|
|
37543
38215
|
/*
|
|
37544
38216
|
07/22: experimental expiration date constraint
|
|
37545
38217
|
should allow entry of expiration date using "/" character
|
|
@@ -37549,439 +38221,464 @@ not tested as validation function
|
|
|
37549
38221
|
to validate exp date instead use combo of:
|
|
37550
38222
|
required(), hasLength(), isValidMonth(), dateAfterToday()
|
|
37551
38223
|
*/
|
|
37552
|
-
|
|
37553
|
-
|
|
37554
|
-
|
|
37555
|
-
|
|
37556
|
-
|
|
37557
|
-
|
|
37558
|
-
validatorFns[ONLY_EXPIRATION_DATE] = (value, args, form)
|
|
37559
|
-
/^(\d?\d?\/?\d?\d?)?$/.test(value);
|
|
37560
|
-
|
|
37561
|
-
|
|
37562
|
-
|
|
37563
|
-
|
|
37564
|
-
|
|
37565
|
-
|
|
37566
|
-
)
|
|
37567
|
-
validatorFns[NUMBER_LESS_THAN] = (value, args, form) => {
|
|
38224
|
+
|
|
38225
|
+
|
|
38226
|
+
var ONLY_EXPIRATION_DATE = "validator/ONLY_EXPIRATION_DATE";
|
|
38227
|
+
var ONLY_EXPIRATION_DATE_ERROR = "error/ONLY_EXPIRATION_DATE";
|
|
38228
|
+
var onlyExpirationDate = createValidator(ONLY_EXPIRATION_DATE, ONLY_EXPIRATION_DATE_ERROR);
|
|
38229
|
+
|
|
38230
|
+
validatorFns[ONLY_EXPIRATION_DATE] = function (value, args, form) {
|
|
38231
|
+
return /^(\d?\d?\/?\d?\d?)?$/.test(value);
|
|
38232
|
+
};
|
|
38233
|
+
|
|
38234
|
+
var NUMBER_LESS_THAN = "validator/NUMBER_LESS_THAN";
|
|
38235
|
+
var NUMBER_LESS_THAN_ERROR = "error/NUMBER_LESS_THAN";
|
|
38236
|
+
var numberLessThan = createValidator(NUMBER_LESS_THAN, NUMBER_LESS_THAN_ERROR);
|
|
38237
|
+
|
|
38238
|
+
validatorFns[NUMBER_LESS_THAN] = function (value, args, form) {
|
|
37568
38239
|
if (value === "") {
|
|
37569
38240
|
return true;
|
|
37570
38241
|
}
|
|
38242
|
+
|
|
37571
38243
|
return Number(value) < args[0];
|
|
37572
38244
|
};
|
|
37573
38245
|
|
|
37574
|
-
|
|
37575
|
-
|
|
37576
|
-
|
|
37577
|
-
|
|
37578
|
-
|
|
37579
|
-
NUMBER_LESS_THAN_OR_EQUAL_TO,
|
|
37580
|
-
NUMBER_LESS_THAN_OR_EQUAL_TO_ERROR
|
|
37581
|
-
);
|
|
37582
|
-
validatorFns[NUMBER_LESS_THAN_OR_EQUAL_TO] = (value, args, form) => {
|
|
38246
|
+
var NUMBER_LESS_THAN_OR_EQUAL_TO = "validator/NUMBER_LESS_THAN_OR_EQUAL_TO";
|
|
38247
|
+
var NUMBER_LESS_THAN_OR_EQUAL_TO_ERROR = "error/NUMBER_LESS_THAN_OR_EQUAL_TO";
|
|
38248
|
+
var numberLessThanOrEqualTo = createValidator(NUMBER_LESS_THAN_OR_EQUAL_TO, NUMBER_LESS_THAN_OR_EQUAL_TO_ERROR);
|
|
38249
|
+
|
|
38250
|
+
validatorFns[NUMBER_LESS_THAN_OR_EQUAL_TO] = function (value, args, form) {
|
|
37583
38251
|
if (value === "") {
|
|
37584
38252
|
return true;
|
|
37585
38253
|
}
|
|
38254
|
+
|
|
37586
38255
|
return Number(value) <= args[0];
|
|
37587
38256
|
};
|
|
37588
38257
|
|
|
37589
|
-
|
|
37590
|
-
|
|
37591
|
-
|
|
37592
|
-
|
|
37593
|
-
|
|
37594
|
-
);
|
|
37595
|
-
validatorFns[NUMBER_GREATER_THAN] = (value, args, form) => {
|
|
38258
|
+
var NUMBER_GREATER_THAN = "validator/NUMBER_GREATER_THAN";
|
|
38259
|
+
var NUMBER_GREATER_THAN_ERROR = "error/NUMBER_GREATER_THAN";
|
|
38260
|
+
var numberGreaterThan = createValidator(NUMBER_GREATER_THAN, NUMBER_GREATER_THAN_ERROR);
|
|
38261
|
+
|
|
38262
|
+
validatorFns[NUMBER_GREATER_THAN] = function (value, args, form) {
|
|
37596
38263
|
if (value === "") {
|
|
37597
38264
|
return true;
|
|
37598
38265
|
}
|
|
38266
|
+
|
|
37599
38267
|
return Number(value) > args[0];
|
|
37600
38268
|
};
|
|
37601
38269
|
|
|
37602
|
-
|
|
37603
|
-
|
|
37604
|
-
|
|
37605
|
-
|
|
37606
|
-
|
|
37607
|
-
NUMBER_GREATER_THAN_OR_EQUAL_TO,
|
|
37608
|
-
NUMBER_GREATER_THAN_OR_EQUAL_TO_ERROR
|
|
37609
|
-
);
|
|
37610
|
-
validatorFns[NUMBER_GREATER_THAN_OR_EQUAL_TO] = (value, args, form) => {
|
|
38270
|
+
var NUMBER_GREATER_THAN_OR_EQUAL_TO = "validator/NUMBER_GREATER_THAN_OR_EQUAL_TO";
|
|
38271
|
+
var NUMBER_GREATER_THAN_OR_EQUAL_TO_ERROR = "error/NUMBER_GREATER_THAN_OR_EQUAL_TO";
|
|
38272
|
+
var numberGreaterThanOrEqualTo = createValidator(NUMBER_GREATER_THAN_OR_EQUAL_TO, NUMBER_GREATER_THAN_OR_EQUAL_TO_ERROR);
|
|
38273
|
+
|
|
38274
|
+
validatorFns[NUMBER_GREATER_THAN_OR_EQUAL_TO] = function (value, args, form) {
|
|
37611
38275
|
if (value === "") {
|
|
37612
38276
|
return true;
|
|
37613
38277
|
}
|
|
38278
|
+
|
|
37614
38279
|
return Number(value) >= args[0];
|
|
37615
38280
|
};
|
|
37616
38281
|
|
|
37617
|
-
|
|
37618
|
-
|
|
37619
|
-
|
|
37620
|
-
|
|
37621
|
-
|
|
38282
|
+
var MATCHES_FIELD = "validator/MATCHES_FIELD";
|
|
38283
|
+
var MATCHES_FIELD_ERROR$1 = "error/MATCHES_FIELD";
|
|
38284
|
+
var matchesField = createValidator(MATCHES_FIELD, MATCHES_FIELD_ERROR$1);
|
|
38285
|
+
|
|
38286
|
+
validatorFns[MATCHES_FIELD] = function (value, args, form) {
|
|
38287
|
+
var dependentField = form[args[0]];
|
|
38288
|
+
|
|
37622
38289
|
if (dependentField === undefined) {
|
|
37623
|
-
throw new Error(
|
|
37624
|
-
`${args[0]} was passed to matchesField, but that field does not exist in the form`
|
|
37625
|
-
);
|
|
38290
|
+
throw new Error("".concat(args[0], " was passed to matchesField, but that field does not exist in the form"));
|
|
37626
38291
|
}
|
|
37627
|
-
|
|
38292
|
+
|
|
38293
|
+
var dependentFieldValue = dependentField.rawValue;
|
|
37628
38294
|
return value === dependentFieldValue;
|
|
37629
38295
|
};
|
|
37630
38296
|
|
|
37631
|
-
|
|
37632
|
-
|
|
37633
|
-
|
|
37634
|
-
|
|
37635
|
-
|
|
37636
|
-
|
|
37637
|
-
|
|
37638
|
-
|
|
37639
|
-
|
|
37640
|
-
|
|
37641
|
-
|
|
37642
|
-
|
|
37643
|
-
|
|
37644
|
-
|
|
37645
|
-
|
|
37646
|
-
type: VALIDATE_WHEN,
|
|
37647
|
-
args: [dependentValidator, primaryValidator, optionalFieldName],
|
|
37648
|
-
error: dependentValidator.error
|
|
37649
|
-
});
|
|
38297
|
+
var validateWhenErrorMessage = function validateWhenErrorMessage(type) {
|
|
38298
|
+
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.");
|
|
38299
|
+
};
|
|
38300
|
+
|
|
38301
|
+
var VALIDATE_WHEN = "validator/VALIDATE_WHEN";
|
|
38302
|
+
var VALIDATE_WHEN_ERROR = "error/VALIDATE_WHEN";
|
|
38303
|
+
|
|
38304
|
+
var validateWhen = function validateWhen(dependentValidator, primaryValidator, optionalFieldName) {
|
|
38305
|
+
return {
|
|
38306
|
+
type: VALIDATE_WHEN,
|
|
38307
|
+
args: [dependentValidator, primaryValidator, optionalFieldName],
|
|
38308
|
+
error: dependentValidator.error
|
|
38309
|
+
};
|
|
38310
|
+
};
|
|
38311
|
+
|
|
37650
38312
|
validateWhen.error = VALIDATE_WHEN_ERROR;
|
|
37651
|
-
|
|
37652
|
-
|
|
37653
|
-
|
|
37654
|
-
|
|
37655
|
-
|
|
37656
|
-
|
|
37657
|
-
|
|
37658
|
-
|
|
38313
|
+
|
|
38314
|
+
validatorFns[VALIDATE_WHEN] = function (value, args, form) {
|
|
38315
|
+
var _args = _slicedToArray(args, 3),
|
|
38316
|
+
dependentValidator = _args[0],
|
|
38317
|
+
primaryValidator = _args[1],
|
|
38318
|
+
optionalFieldName = _args[2];
|
|
38319
|
+
|
|
38320
|
+
var dependsOnOtherField = typeof optionalFieldName === "string";
|
|
38321
|
+
|
|
38322
|
+
if (primaryValidator.type === undefined || typeof validatorFns[primaryValidator.type] !== "function") {
|
|
37659
38323
|
throw new Error(validateWhenErrorMessage(primaryValidator.type));
|
|
37660
38324
|
}
|
|
38325
|
+
|
|
37661
38326
|
if (dependsOnOtherField && form[optionalFieldName] === undefined) {
|
|
37662
|
-
throw new Error(
|
|
37663
|
-
`${args[2]} was passed to matchesField, but that field does not exist in the form`
|
|
37664
|
-
);
|
|
38327
|
+
throw new Error("".concat(args[2], " was passed to matchesField, but that field does not exist in the form"));
|
|
37665
38328
|
}
|
|
37666
38329
|
|
|
37667
|
-
|
|
37668
|
-
|
|
37669
|
-
|
|
37670
|
-
);
|
|
37671
|
-
|
|
37672
|
-
|
|
37673
|
-
|
|
37674
|
-
|
|
37675
|
-
|
|
37676
|
-
|
|
37677
|
-
|
|
37678
|
-
|
|
37679
|
-
|
|
37680
|
-
|
|
37681
|
-
|
|
37682
|
-
|
|
37683
|
-
|
|
37684
|
-
|
|
37685
|
-
|
|
37686
|
-
|
|
37687
|
-
|
|
37688
|
-
|
|
37689
|
-
const validateSumErrorMessage = type =>
|
|
37690
|
-
`${type} was passed to validateSum, but that validator type does not exist.
|
|
37691
|
-
Please check that you are only calling validator creator functions exported from
|
|
37692
|
-
redux-freeform in your form config and that you didn't forget to
|
|
37693
|
-
invoke the validator creator (you cannot pass the functions themselves to
|
|
37694
|
-
createFormState).`;
|
|
37695
|
-
const VALIDATE_SUM = "validator/VALIDATE_SUM";
|
|
37696
|
-
const VALIDATE_SUM_ERROR = "error/VALIDATE_SUM";
|
|
37697
|
-
const validateSum = (validator, fieldNamesArray) => ({
|
|
37698
|
-
type: VALIDATE_SUM,
|
|
37699
|
-
args: [validator, fieldNamesArray],
|
|
37700
|
-
error: validator.error
|
|
37701
|
-
});
|
|
38330
|
+
var primaryPredicate = validatorToPredicate(validatorFns[primaryValidator.type], false);
|
|
38331
|
+
var primaryValue = dependsOnOtherField ? form[optionalFieldName].rawValue : value;
|
|
38332
|
+
var primaryPredicatePassed = primaryPredicate(primaryValue, primaryValidator.args, form);
|
|
38333
|
+
return primaryPredicatePassed ? validatorFns[dependentValidator.type](value, dependentValidator.args, form) : true;
|
|
38334
|
+
};
|
|
38335
|
+
|
|
38336
|
+
var validateSumErrorMessage = function validateSumErrorMessage(type) {
|
|
38337
|
+
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).");
|
|
38338
|
+
};
|
|
38339
|
+
|
|
38340
|
+
var VALIDATE_SUM = "validator/VALIDATE_SUM";
|
|
38341
|
+
var VALIDATE_SUM_ERROR = "error/VALIDATE_SUM";
|
|
38342
|
+
|
|
38343
|
+
var validateSum = function validateSum(validator, fieldNamesArray) {
|
|
38344
|
+
return {
|
|
38345
|
+
type: VALIDATE_SUM,
|
|
38346
|
+
args: [validator, fieldNamesArray],
|
|
38347
|
+
error: validator.error
|
|
38348
|
+
};
|
|
38349
|
+
};
|
|
38350
|
+
|
|
37702
38351
|
validateSum.error = VALIDATE_SUM_ERROR;
|
|
37703
|
-
validatorFns[VALIDATE_SUM] = (value, args, form) => {
|
|
37704
|
-
const [validator, fieldNamesArray] = args;
|
|
37705
38352
|
|
|
37706
|
-
|
|
37707
|
-
|
|
37708
|
-
|
|
37709
|
-
|
|
38353
|
+
validatorFns[VALIDATE_SUM] = function (value, args, form) {
|
|
38354
|
+
var _args2 = _slicedToArray(args, 2),
|
|
38355
|
+
validator = _args2[0],
|
|
38356
|
+
fieldNamesArray = _args2[1];
|
|
38357
|
+
|
|
38358
|
+
if (validator.type === undefined || typeof validatorFns[validator.type] !== "function") {
|
|
37710
38359
|
throw new Error(validateSumErrorMessage(validator.type));
|
|
37711
38360
|
}
|
|
37712
38361
|
|
|
37713
|
-
|
|
37714
|
-
|
|
37715
|
-
|
|
37716
|
-
|
|
37717
|
-
|
|
38362
|
+
var _iterator = _createForOfIteratorHelper(fieldNamesArray),
|
|
38363
|
+
_step;
|
|
38364
|
+
|
|
38365
|
+
try {
|
|
38366
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
38367
|
+
var fieldName = _step.value;
|
|
38368
|
+
|
|
38369
|
+
if (form[fieldName] === undefined) {
|
|
38370
|
+
throw new Error("".concat(fieldName, " was passed to matchesField, but that field does not exist in the form"));
|
|
38371
|
+
}
|
|
37718
38372
|
}
|
|
38373
|
+
} catch (err) {
|
|
38374
|
+
_iterator.e(err);
|
|
38375
|
+
} finally {
|
|
38376
|
+
_iterator.f();
|
|
37719
38377
|
}
|
|
37720
38378
|
|
|
37721
|
-
|
|
37722
|
-
|
|
37723
|
-
|
|
37724
|
-
);
|
|
37725
|
-
|
|
38379
|
+
var sum = fieldNamesArray.reduce(function (acc, curr) {
|
|
38380
|
+
return acc + Number(form[curr].rawValue);
|
|
38381
|
+
}, Number(value));
|
|
37726
38382
|
return validatorFns[validator.type](sum, validator.args, form);
|
|
37727
38383
|
};
|
|
37728
38384
|
|
|
37729
|
-
|
|
37730
|
-
|
|
37731
|
-
|
|
37732
|
-
|
|
38385
|
+
var HAS_LENGTH = "validator/HAS_LENGTH";
|
|
38386
|
+
var HAS_LENGTH_ERROR = "error/HAS_LENGTH";
|
|
38387
|
+
var hasLength = createValidator(HAS_LENGTH, HAS_LENGTH_ERROR);
|
|
38388
|
+
|
|
38389
|
+
validatorFns[HAS_LENGTH] = function (value, args, form) {
|
|
37733
38390
|
if (value === "") {
|
|
37734
38391
|
return true;
|
|
37735
38392
|
}
|
|
37736
|
-
|
|
37737
|
-
|
|
38393
|
+
|
|
38394
|
+
var min = args[0];
|
|
38395
|
+
var max = args[1];
|
|
38396
|
+
|
|
37738
38397
|
if (max == undefined || min == undefined) {
|
|
37739
|
-
throw new Error(
|
|
37740
|
-
"Max and min need to be defined for hasLength, both or one of them is undefined"
|
|
37741
|
-
);
|
|
38398
|
+
throw new Error("Max and min need to be defined for hasLength, both or one of them is undefined");
|
|
37742
38399
|
}
|
|
38400
|
+
|
|
37743
38401
|
if (max < min) {
|
|
37744
|
-
throw new Error(
|
|
37745
|
-
"hasLength validator was passed a min greater than the max"
|
|
37746
|
-
);
|
|
38402
|
+
throw new Error("hasLength validator was passed a min greater than the max");
|
|
37747
38403
|
}
|
|
37748
|
-
|
|
38404
|
+
|
|
38405
|
+
var valueLength = value.length;
|
|
37749
38406
|
return max >= valueLength && valueLength >= min;
|
|
37750
38407
|
};
|
|
37751
38408
|
|
|
37752
|
-
|
|
37753
|
-
|
|
37754
|
-
|
|
37755
|
-
|
|
37756
|
-
|
|
37757
|
-
);
|
|
37758
|
-
validatorFns[DATE_BEFORE_TODAY] = (value, args, form) => {
|
|
38409
|
+
var DATE_BEFORE_TODAY = "validator/DATE_BEFORE_TODAY";
|
|
38410
|
+
var DATE_BEFORE_TODAY_ERROR = "error/DATE_BEFORE_TODAY";
|
|
38411
|
+
var dateBeforeToday = createValidator(DATE_BEFORE_TODAY, DATE_BEFORE_TODAY_ERROR);
|
|
38412
|
+
|
|
38413
|
+
validatorFns[DATE_BEFORE_TODAY] = function (value, args, form) {
|
|
37759
38414
|
if (value === "") {
|
|
37760
38415
|
return true;
|
|
37761
38416
|
}
|
|
37762
|
-
|
|
37763
|
-
|
|
37764
|
-
|
|
38417
|
+
|
|
38418
|
+
var dateFormat = args[0];
|
|
38419
|
+
var unit = args[1];
|
|
38420
|
+
var inclusive = args[2] || false;
|
|
37765
38421
|
|
|
37766
38422
|
if (dateFormat == undefined || unit == undefined) {
|
|
37767
|
-
throw new Error(
|
|
37768
|
-
"Date format and unit need to be defined for dateBeforeToday, one or both are undefined"
|
|
37769
|
-
);
|
|
38423
|
+
throw new Error("Date format and unit need to be defined for dateBeforeToday, one or both are undefined");
|
|
37770
38424
|
}
|
|
37771
|
-
|
|
37772
|
-
|
|
38425
|
+
|
|
38426
|
+
var now = dayjs();
|
|
38427
|
+
var dateValue = dayjs(value, dateFormat);
|
|
37773
38428
|
|
|
37774
38429
|
if (inclusive === true) {
|
|
37775
38430
|
return dateValue.isSameOrBefore(now, unit);
|
|
37776
38431
|
}
|
|
38432
|
+
|
|
37777
38433
|
return dateValue.isBefore(now, unit);
|
|
37778
38434
|
};
|
|
37779
38435
|
|
|
37780
|
-
|
|
37781
|
-
|
|
37782
|
-
|
|
37783
|
-
|
|
37784
|
-
|
|
37785
|
-
);
|
|
37786
|
-
validatorFns[DATE_AFTER_TODAY] = (value, args, form) => {
|
|
38436
|
+
var DATE_AFTER_TODAY = "validator/DATE_AFTER_TODAY";
|
|
38437
|
+
var DATE_AFTER_TODAY_ERROR = "error/DATE_AFTER_TODAY";
|
|
38438
|
+
var dateAfterToday = createValidator(DATE_AFTER_TODAY, DATE_AFTER_TODAY_ERROR);
|
|
38439
|
+
|
|
38440
|
+
validatorFns[DATE_AFTER_TODAY] = function (value, args, form) {
|
|
37787
38441
|
if (value === "") {
|
|
37788
38442
|
return true;
|
|
37789
38443
|
}
|
|
37790
|
-
|
|
37791
|
-
|
|
37792
|
-
|
|
38444
|
+
|
|
38445
|
+
var dateFormat = args[0];
|
|
38446
|
+
var unit = args[1];
|
|
38447
|
+
var inclusive = args[2] || false;
|
|
37793
38448
|
|
|
37794
38449
|
if (dateFormat == undefined || unit == undefined) {
|
|
37795
|
-
throw new Error(
|
|
37796
|
-
"Date format and unit need to be defined for dateAfterToday, one or both are undefined"
|
|
37797
|
-
);
|
|
38450
|
+
throw new Error("Date format and unit need to be defined for dateAfterToday, one or both are undefined");
|
|
37798
38451
|
}
|
|
37799
|
-
|
|
37800
|
-
|
|
38452
|
+
|
|
38453
|
+
var now = dayjs();
|
|
38454
|
+
var dateValue = dayjs(value, dateFormat);
|
|
37801
38455
|
|
|
37802
38456
|
if (inclusive === true) {
|
|
37803
38457
|
return dateValue.isSameOrAfter(now, unit);
|
|
37804
38458
|
}
|
|
38459
|
+
|
|
37805
38460
|
return dateValue.isAfter(now, unit);
|
|
37806
38461
|
};
|
|
37807
38462
|
|
|
37808
|
-
|
|
37809
|
-
|
|
37810
|
-
|
|
37811
|
-
|
|
37812
|
-
|
|
37813
|
-
);
|
|
37814
|
-
validatorFns[IS_VALID_MONTH] = (value, args, form) => {
|
|
38463
|
+
var IS_VALID_MONTH = "validator/IS_VALID_MONTH";
|
|
38464
|
+
var IS_VALID_MONTH_ERROR = "error/IS_VALID_MONTH";
|
|
38465
|
+
var isValidMonth = createValidator(IS_VALID_MONTH, IS_VALID_MONTH_ERROR);
|
|
38466
|
+
|
|
38467
|
+
validatorFns[IS_VALID_MONTH] = function (value, args, form) {
|
|
37815
38468
|
if (value === "") {
|
|
37816
38469
|
return true;
|
|
37817
|
-
}
|
|
37818
|
-
// Function takes one argument representing the character position
|
|
38470
|
+
} // Function takes one argument representing the character position
|
|
37819
38471
|
// In a date string to identify where the month is
|
|
37820
38472
|
// Eg "10/21/2021" - start position is 0
|
|
37821
38473
|
// Or "18/03/1990" - start position is 3
|
|
37822
38474
|
// Only works with two digit months (01, 02, 03, etc)
|
|
37823
|
-
|
|
37824
|
-
|
|
37825
|
-
|
|
38475
|
+
|
|
38476
|
+
|
|
38477
|
+
var monthStartPosition = parseInt(args[0]);
|
|
38478
|
+
var monthEndPosition = monthStartPosition + 2;
|
|
38479
|
+
|
|
38480
|
+
if (isNaN(monthStartPosition)) {
|
|
37826
38481
|
throw new Error("Month start position has to be a valid integer string");
|
|
37827
38482
|
}
|
|
37828
|
-
|
|
37829
|
-
|
|
38483
|
+
|
|
38484
|
+
var month = parseInt(value.slice(monthStartPosition, monthEndPosition));
|
|
38485
|
+
|
|
38486
|
+
if (isNaN(month)) {
|
|
37830
38487
|
return false;
|
|
37831
38488
|
}
|
|
38489
|
+
|
|
37832
38490
|
return month >= 1 && month <= 12;
|
|
37833
38491
|
};
|
|
37834
38492
|
|
|
37835
|
-
|
|
37836
|
-
|
|
37837
|
-
|
|
37838
|
-
|
|
38493
|
+
var MATCHES_REGEX = "validator/MATCHES_REGEX";
|
|
38494
|
+
var MATCHES_REGEX_ERROR = "error/MATCHES_REGEX";
|
|
38495
|
+
var matchesRegex = createValidator(MATCHES_REGEX, MATCHES_REGEX_ERROR);
|
|
38496
|
+
|
|
38497
|
+
validatorFns[MATCHES_REGEX] = function (value, args, form) {
|
|
37839
38498
|
if (value === "") {
|
|
37840
38499
|
return true;
|
|
37841
38500
|
}
|
|
38501
|
+
|
|
37842
38502
|
return new RegExp(args[0]).test(value); // new RexExp never throws an error, no matter the input
|
|
37843
|
-
};
|
|
38503
|
+
}; // based on http://www.brainjar.com/js/validation/
|
|
37844
38504
|
|
|
37845
|
-
|
|
37846
|
-
|
|
37847
|
-
|
|
37848
|
-
|
|
37849
|
-
|
|
37850
|
-
|
|
37851
|
-
);
|
|
37852
|
-
validatorFns[IS_ROUTING_NUMBER] = (value, args, form) => {
|
|
38505
|
+
|
|
38506
|
+
var IS_ROUTING_NUMBER = "validator/IS_ROUTING_NUMBER";
|
|
38507
|
+
var IS_ROUTING_NUMBER_ERROR = "error/IS_ROUTING_NUMBER";
|
|
38508
|
+
var isRoutingNumber = createValidator(IS_ROUTING_NUMBER, IS_ROUTING_NUMBER_ERROR);
|
|
38509
|
+
|
|
38510
|
+
validatorFns[IS_ROUTING_NUMBER] = function (value, args, form) {
|
|
37853
38511
|
if (value === "") {
|
|
37854
38512
|
return true;
|
|
37855
38513
|
}
|
|
38514
|
+
|
|
37856
38515
|
if (value.length != 9) {
|
|
37857
38516
|
return false;
|
|
37858
38517
|
}
|
|
37859
|
-
|
|
37860
|
-
|
|
37861
|
-
|
|
37862
|
-
|
|
37863
|
-
|
|
37864
|
-
|
|
37865
|
-
|
|
37866
|
-
|
|
37867
|
-
|
|
37868
|
-
|
|
37869
|
-
|
|
37870
|
-
|
|
37871
|
-
|
|
38518
|
+
|
|
38519
|
+
var sum = value.split("").map(function (ch) {
|
|
38520
|
+
return parseInt(ch);
|
|
38521
|
+
}).reduce(function (acc, cur, idx) {
|
|
38522
|
+
switch (idx % 3) {
|
|
38523
|
+
case 0:
|
|
38524
|
+
return acc + 3 * cur;
|
|
38525
|
+
|
|
38526
|
+
case 1:
|
|
38527
|
+
return acc + 7 * cur;
|
|
38528
|
+
|
|
38529
|
+
case 2:
|
|
38530
|
+
return acc + 1 * cur;
|
|
38531
|
+
}
|
|
38532
|
+
}, 0);
|
|
37872
38533
|
return sum != 0 && sum % 10 == 0;
|
|
37873
38534
|
};
|
|
37874
38535
|
|
|
37875
|
-
|
|
37876
|
-
|
|
37877
|
-
|
|
37878
|
-
|
|
38536
|
+
var HAS_NUMBER = "validator/HAS_NUMBER";
|
|
38537
|
+
var HAS_NUMBER_ERROR$1 = "error/HAS_NUMBER";
|
|
38538
|
+
var hasNumber = createValidator(HAS_NUMBER, HAS_NUMBER_ERROR$1);
|
|
38539
|
+
|
|
38540
|
+
validatorFns[HAS_NUMBER] = function (value, args, form) {
|
|
37879
38541
|
if (value === "") {
|
|
37880
38542
|
return true;
|
|
37881
38543
|
}
|
|
38544
|
+
|
|
37882
38545
|
return new RegExp(/[0-9]/).test(value);
|
|
37883
38546
|
};
|
|
37884
38547
|
|
|
37885
|
-
|
|
37886
|
-
|
|
37887
|
-
|
|
37888
|
-
|
|
37889
|
-
|
|
37890
|
-
);
|
|
37891
|
-
validatorFns[HAS_LOWERCASE_LETTER] = (value, args, form) => {
|
|
38548
|
+
var HAS_LOWERCASE_LETTER = "validator/HAS_LOWERCASE_LETTER";
|
|
38549
|
+
var HAS_LOWERCASE_LETTER_ERROR$1 = "error/HAS_LOWERCASE_LETTER";
|
|
38550
|
+
var hasLowercaseLetter = createValidator(HAS_LOWERCASE_LETTER, HAS_LOWERCASE_LETTER_ERROR$1);
|
|
38551
|
+
|
|
38552
|
+
validatorFns[HAS_LOWERCASE_LETTER] = function (value, args, form) {
|
|
37892
38553
|
if (value === "") {
|
|
37893
38554
|
return true;
|
|
37894
38555
|
}
|
|
38556
|
+
|
|
37895
38557
|
return new RegExp(/[a-z]/).test(value);
|
|
37896
38558
|
};
|
|
37897
38559
|
|
|
37898
|
-
|
|
37899
|
-
|
|
37900
|
-
|
|
37901
|
-
|
|
37902
|
-
|
|
37903
|
-
);
|
|
37904
|
-
validatorFns[HAS_UPPERCASE_LETTER] = (value, args, form) => {
|
|
38560
|
+
var HAS_UPPERCASE_LETTER = "validator/HAS_UPPERCASE_LETTER";
|
|
38561
|
+
var HAS_UPPERCASE_LETTER_ERROR$1 = "error/HAS_UPPERCASE_LETTER";
|
|
38562
|
+
var hasUppercaseLetter = createValidator(HAS_UPPERCASE_LETTER, HAS_UPPERCASE_LETTER_ERROR$1);
|
|
38563
|
+
|
|
38564
|
+
validatorFns[HAS_UPPERCASE_LETTER] = function (value, args, form) {
|
|
37905
38565
|
if (value === "") {
|
|
37906
38566
|
return true;
|
|
37907
38567
|
}
|
|
38568
|
+
|
|
37908
38569
|
return new RegExp(/[A-Z]/).test(value);
|
|
37909
38570
|
};
|
|
37910
38571
|
|
|
37911
|
-
|
|
37912
|
-
|
|
37913
|
-
|
|
37914
|
-
|
|
37915
|
-
|
|
37916
|
-
);
|
|
37917
|
-
validatorFns[HAS_SPECIAL_CHARACTER] = (value, args, form) => {
|
|
38572
|
+
var HAS_SPECIAL_CHARACTER = "validator/HAS_SPECIAL_CHARACTER";
|
|
38573
|
+
var HAS_SPECIAL_CHARACTER_ERROR$1 = "error/HAS_SPECIAL_CHARACTER";
|
|
38574
|
+
var hasSpecialCharacter = createValidator(HAS_SPECIAL_CHARACTER, HAS_SPECIAL_CHARACTER_ERROR$1);
|
|
38575
|
+
|
|
38576
|
+
validatorFns[HAS_SPECIAL_CHARACTER] = function (value, args, form) {
|
|
37918
38577
|
if (value === "") {
|
|
37919
38578
|
return true;
|
|
37920
38579
|
}
|
|
38580
|
+
|
|
37921
38581
|
return new RegExp(/[!@#$%^&*.?]/).test(value);
|
|
37922
38582
|
};
|
|
37923
38583
|
|
|
37924
|
-
|
|
37925
|
-
|
|
37926
|
-
|
|
37927
|
-
|
|
37928
|
-
|
|
37929
|
-
);
|
|
37930
|
-
validatorFns[IS_PROBABLY_EMAIL] = (value, args, form) => {
|
|
38584
|
+
var IS_PROBABLY_EMAIL = "validator/IS_PROBABLY_EMAIL";
|
|
38585
|
+
var IS_PROBABLY_EMAIL_ERROR = "error/IS_PROBABLY_EMAIL";
|
|
38586
|
+
var isProbablyEmail = createValidator(IS_PROBABLY_EMAIL, IS_PROBABLY_EMAIL_ERROR);
|
|
38587
|
+
|
|
38588
|
+
validatorFns[IS_PROBABLY_EMAIL] = function (value, args, form) {
|
|
37931
38589
|
if (value === "") {
|
|
37932
38590
|
return true;
|
|
37933
38591
|
}
|
|
38592
|
+
|
|
37934
38593
|
return new RegExp(/^\S+@\S+\.\S+$/).test(value);
|
|
37935
38594
|
};
|
|
37936
38595
|
|
|
37937
|
-
|
|
37938
|
-
|
|
37939
|
-
|
|
37940
|
-
|
|
37941
|
-
|
|
37942
|
-
|
|
38596
|
+
var runValidatorErrorMessage = function runValidatorErrorMessage(type) {
|
|
38597
|
+
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)");
|
|
38598
|
+
};
|
|
38599
|
+
|
|
38600
|
+
var runValidator = function runValidator(validator, value, form) {
|
|
38601
|
+
var validatorFn = validatorFns[validator.type];
|
|
37943
38602
|
|
|
37944
|
-
const runValidator = (validator, value, form) => {
|
|
37945
|
-
const validatorFn = validatorFns[validator.type];
|
|
37946
38603
|
if (validatorFn === undefined) {
|
|
37947
38604
|
throw new Error(runValidatorErrorMessage(validator.type));
|
|
37948
38605
|
}
|
|
38606
|
+
|
|
37949
38607
|
return validatorFn(value, validator.args, form) ? null : validator.error;
|
|
37950
38608
|
};
|
|
37951
38609
|
|
|
37952
|
-
|
|
37953
|
-
return validators
|
|
37954
|
-
|
|
37955
|
-
|
|
38610
|
+
var runFormValidators = function runFormValidators(fieldName, form, validators) {
|
|
38611
|
+
return validators.map(function (v) {
|
|
38612
|
+
return runValidator(v, form[fieldName].rawValue, form);
|
|
38613
|
+
}).filter(function (x) {
|
|
38614
|
+
return x !== null;
|
|
38615
|
+
});
|
|
38616
|
+
};
|
|
38617
|
+
|
|
38618
|
+
var computeConstraints = function computeConstraints(fieldName, form) {
|
|
38619
|
+
var constraints = form[fieldName].constraints;
|
|
38620
|
+
return runFormValidators(fieldName, form, constraints);
|
|
38621
|
+
};
|
|
38622
|
+
|
|
38623
|
+
var computeErrors = function computeErrors(fieldName, form) {
|
|
38624
|
+
var validators = form[fieldName].validators;
|
|
38625
|
+
return runFormValidators(fieldName, form, validators);
|
|
37956
38626
|
};
|
|
37957
38627
|
|
|
37958
|
-
|
|
37959
|
-
|
|
37960
|
-
|
|
38628
|
+
var computeErrorEntries = function computeErrorEntries(formState) {
|
|
38629
|
+
var fields = Object.entries(formState);
|
|
38630
|
+
|
|
38631
|
+
for (var _i = 0, _fields = fields; _i < _fields.length; _i++) {
|
|
38632
|
+
var entry = _fields[_i];
|
|
38633
|
+
var fieldName = entry[0];
|
|
38634
|
+
var errors = computeErrors(fieldName, formState);
|
|
38635
|
+
formState[fieldName].errors = errors;
|
|
38636
|
+
formState[fieldName].hasErrors = errors.length > 0;
|
|
38637
|
+
}
|
|
37961
38638
|
};
|
|
37962
38639
|
|
|
37963
|
-
|
|
37964
|
-
|
|
37965
|
-
|
|
38640
|
+
var computeDirtyEntries = function computeDirtyEntries(formState, changedFieldName) {
|
|
38641
|
+
var fields = Object.entries(formState);
|
|
38642
|
+
|
|
38643
|
+
for (var _i2 = 0, _fields2 = fields; _i2 < _fields2.length; _i2++) {
|
|
38644
|
+
var entry = _fields2[_i2];
|
|
38645
|
+
var fieldName = entry[0];
|
|
38646
|
+
var field = entry[1];
|
|
38647
|
+
var dirty = fieldName === changedFieldName ? true : field.dirty;
|
|
38648
|
+
formState[fieldName].dirty = dirty;
|
|
38649
|
+
}
|
|
37966
38650
|
};
|
|
37967
38651
|
|
|
37968
38652
|
var obj;
|
|
37969
|
-
var NOTHING = typeof Symbol !== "undefined" ? Symbol("immer-nothing") : (
|
|
37970
|
-
var DRAFTABLE = typeof Symbol !== "undefined" && Symbol
|
|
37971
|
-
var DRAFT_STATE = typeof Symbol !== "undefined" && Symbol
|
|
38653
|
+
var NOTHING = typeof Symbol !== "undefined" ? Symbol("immer-nothing") : (obj = {}, obj["immer-nothing"] = true, obj);
|
|
38654
|
+
var DRAFTABLE = typeof Symbol !== "undefined" && Symbol["for"] ? Symbol["for"]("immer-draftable") : "__$immer_draftable";
|
|
38655
|
+
var DRAFT_STATE = typeof Symbol !== "undefined" && Symbol["for"] ? Symbol["for"]("immer-state") : "__$immer_state";
|
|
38656
|
+
|
|
37972
38657
|
function isDraft(value) {
|
|
37973
38658
|
return !!value && !!value[DRAFT_STATE];
|
|
37974
38659
|
}
|
|
38660
|
+
|
|
37975
38661
|
function isDraftable(value) {
|
|
37976
|
-
if (!value) {
|
|
38662
|
+
if (!value) {
|
|
38663
|
+
return false;
|
|
38664
|
+
}
|
|
38665
|
+
|
|
37977
38666
|
return isPlainObject(value) || !!value[DRAFTABLE] || !!value.constructor[DRAFTABLE];
|
|
37978
38667
|
}
|
|
38668
|
+
|
|
37979
38669
|
function isPlainObject(value) {
|
|
37980
|
-
if (!value ||
|
|
37981
|
-
|
|
38670
|
+
if (!value || _typeof(value) !== "object") {
|
|
38671
|
+
return false;
|
|
38672
|
+
}
|
|
38673
|
+
|
|
38674
|
+
if (Array.isArray(value)) {
|
|
38675
|
+
return true;
|
|
38676
|
+
}
|
|
38677
|
+
|
|
37982
38678
|
var proto = Object.getPrototypeOf(value);
|
|
37983
38679
|
return !proto || proto === Object.prototype;
|
|
37984
38680
|
}
|
|
38681
|
+
|
|
37985
38682
|
var assign = Object.assign || function assign(target, value) {
|
|
37986
38683
|
for (var key in value) {
|
|
37987
38684
|
if (has$1(value, key)) {
|
|
@@ -37991,11 +38688,18 @@ var assign = Object.assign || function assign(target, value) {
|
|
|
37991
38688
|
|
|
37992
38689
|
return target;
|
|
37993
38690
|
};
|
|
37994
|
-
|
|
38691
|
+
|
|
38692
|
+
var ownKeys$2 = typeof Reflect !== "undefined" && Reflect.ownKeys ? Reflect.ownKeys : typeof Object.getOwnPropertySymbols !== "undefined" ? function (obj) {
|
|
38693
|
+
return Object.getOwnPropertyNames(obj).concat(Object.getOwnPropertySymbols(obj));
|
|
38694
|
+
} : Object.getOwnPropertyNames;
|
|
38695
|
+
|
|
37995
38696
|
function shallowCopy(base, invokeGetters) {
|
|
37996
|
-
if (
|
|
38697
|
+
if (invokeGetters === void 0) invokeGetters = false;
|
|
38698
|
+
|
|
38699
|
+
if (Array.isArray(base)) {
|
|
38700
|
+
return base.slice();
|
|
38701
|
+
}
|
|
37997
38702
|
|
|
37998
|
-
if (Array.isArray(base)) { return base.slice(); }
|
|
37999
38703
|
var clone = Object.create(Object.getPrototypeOf(base));
|
|
38000
38704
|
ownKeys$2(base).forEach(function (key) {
|
|
38001
38705
|
if (key === DRAFT_STATE) {
|
|
@@ -38025,20 +38729,28 @@ function shallowCopy(base, invokeGetters) {
|
|
|
38025
38729
|
});
|
|
38026
38730
|
return clone;
|
|
38027
38731
|
}
|
|
38732
|
+
|
|
38028
38733
|
function each(value, cb) {
|
|
38029
38734
|
if (Array.isArray(value)) {
|
|
38030
|
-
for (var i = 0; i < value.length; i++) {
|
|
38735
|
+
for (var i = 0; i < value.length; i++) {
|
|
38736
|
+
cb(i, value[i], value);
|
|
38737
|
+
}
|
|
38031
38738
|
} else {
|
|
38032
|
-
ownKeys$2(value).forEach(function (key) {
|
|
38739
|
+
ownKeys$2(value).forEach(function (key) {
|
|
38740
|
+
return cb(key, value[key], value);
|
|
38741
|
+
});
|
|
38033
38742
|
}
|
|
38034
38743
|
}
|
|
38744
|
+
|
|
38035
38745
|
function isEnumerable(base, prop) {
|
|
38036
38746
|
var desc = Object.getOwnPropertyDescriptor(base, prop);
|
|
38037
38747
|
return !!desc && desc.enumerable;
|
|
38038
38748
|
}
|
|
38749
|
+
|
|
38039
38750
|
function has$1(thing, prop) {
|
|
38040
38751
|
return Object.prototype.hasOwnProperty.call(thing, prop);
|
|
38041
38752
|
}
|
|
38753
|
+
|
|
38042
38754
|
function is(x, y) {
|
|
38043
38755
|
// From: https://github.com/facebook/fbjs/blob/c69904a511b900266935168223063dd8772dfc40/packages/fbjs/src/core/shallowEqual.js
|
|
38044
38756
|
if (x === y) {
|
|
@@ -38047,18 +38759,27 @@ function is(x, y) {
|
|
|
38047
38759
|
return x !== x && y !== y;
|
|
38048
38760
|
}
|
|
38049
38761
|
}
|
|
38762
|
+
|
|
38050
38763
|
function clone(obj) {
|
|
38051
|
-
if (!isDraftable(obj)) {
|
|
38052
|
-
|
|
38764
|
+
if (!isDraftable(obj)) {
|
|
38765
|
+
return obj;
|
|
38766
|
+
}
|
|
38767
|
+
|
|
38768
|
+
if (Array.isArray(obj)) {
|
|
38769
|
+
return obj.map(clone);
|
|
38770
|
+
}
|
|
38771
|
+
|
|
38053
38772
|
var cloned = Object.create(Object.getPrototypeOf(obj));
|
|
38054
38773
|
|
|
38055
|
-
for (var key in obj) {
|
|
38774
|
+
for (var key in obj) {
|
|
38775
|
+
cloned[key] = clone(obj[key]);
|
|
38776
|
+
}
|
|
38056
38777
|
|
|
38057
38778
|
return cloned;
|
|
38058
38779
|
}
|
|
38059
|
-
|
|
38060
38780
|
/** Each scope represents a `produce` call. */
|
|
38061
38781
|
|
|
38782
|
+
|
|
38062
38783
|
var ImmerScope = function ImmerScope(parent) {
|
|
38063
38784
|
this.drafts = [];
|
|
38064
38785
|
this.parent = parent; // Whenever the modified draft contains a draft from another scope, we
|
|
@@ -38069,7 +38790,7 @@ var ImmerScope = function ImmerScope(parent) {
|
|
|
38069
38790
|
this.patches = null;
|
|
38070
38791
|
};
|
|
38071
38792
|
|
|
38072
|
-
ImmerScope.prototype.usePatches = function usePatches
|
|
38793
|
+
ImmerScope.prototype.usePatches = function usePatches(patchListener) {
|
|
38073
38794
|
if (patchListener) {
|
|
38074
38795
|
this.patches = [];
|
|
38075
38796
|
this.inversePatches = [];
|
|
@@ -38077,17 +38798,18 @@ ImmerScope.prototype.usePatches = function usePatches (patchListener) {
|
|
|
38077
38798
|
}
|
|
38078
38799
|
};
|
|
38079
38800
|
|
|
38080
|
-
ImmerScope.prototype.revoke = function revoke$1
|
|
38801
|
+
ImmerScope.prototype.revoke = function revoke$1() {
|
|
38081
38802
|
this.leave();
|
|
38082
38803
|
this.drafts.forEach(revoke);
|
|
38083
38804
|
this.drafts = null; // Make draft-related methods throw.
|
|
38084
38805
|
};
|
|
38085
38806
|
|
|
38086
|
-
ImmerScope.prototype.leave = function leave
|
|
38807
|
+
ImmerScope.prototype.leave = function leave() {
|
|
38087
38808
|
if (this === ImmerScope.current) {
|
|
38088
38809
|
ImmerScope.current = this.parent;
|
|
38089
38810
|
}
|
|
38090
38811
|
};
|
|
38812
|
+
|
|
38091
38813
|
ImmerScope.current = null;
|
|
38092
38814
|
|
|
38093
38815
|
ImmerScope.enter = function () {
|
|
@@ -38096,11 +38818,11 @@ ImmerScope.enter = function () {
|
|
|
38096
38818
|
|
|
38097
38819
|
function revoke(draft) {
|
|
38098
38820
|
draft[DRAFT_STATE].revoke();
|
|
38099
|
-
}
|
|
38821
|
+
} // but share them all instead
|
|
38100
38822
|
|
|
38101
|
-
// but share them all instead
|
|
38102
38823
|
|
|
38103
38824
|
var descriptors$1 = {};
|
|
38825
|
+
|
|
38104
38826
|
function willFinalize(scope, result, isReplaced) {
|
|
38105
38827
|
scope.drafts.forEach(function (draft) {
|
|
38106
38828
|
draft[DRAFT_STATE].finalizing = true;
|
|
@@ -38115,9 +38837,10 @@ function willFinalize(scope, result, isReplaced) {
|
|
|
38115
38837
|
markChangesSweep(scope.drafts);
|
|
38116
38838
|
} // When a child draft is returned, look for changes.
|
|
38117
38839
|
else if (isDraft(result) && result[DRAFT_STATE].scope === scope) {
|
|
38118
|
-
|
|
38119
|
-
|
|
38840
|
+
markChangesSweep(scope.drafts);
|
|
38841
|
+
}
|
|
38120
38842
|
}
|
|
38843
|
+
|
|
38121
38844
|
function createProxy(base, parent) {
|
|
38122
38845
|
var isArray = Array.isArray(base);
|
|
38123
38846
|
var draft = clonePotentialDraft(base);
|
|
@@ -38171,7 +38894,11 @@ function peek(draft, prop) {
|
|
|
38171
38894
|
function get$1(state, prop) {
|
|
38172
38895
|
assertUnrevoked(state);
|
|
38173
38896
|
var value = peek(source(state), prop);
|
|
38174
|
-
|
|
38897
|
+
|
|
38898
|
+
if (state.finalizing) {
|
|
38899
|
+
return value;
|
|
38900
|
+
} // Create a draft if the value is unmodified.
|
|
38901
|
+
|
|
38175
38902
|
|
|
38176
38903
|
if (value === peek(state.base, prop) && isDraftable(value)) {
|
|
38177
38904
|
prepareCopy(state);
|
|
@@ -38186,7 +38913,10 @@ function set$1(state, prop, value) {
|
|
|
38186
38913
|
state.assigned[prop] = true;
|
|
38187
38914
|
|
|
38188
38915
|
if (!state.modified) {
|
|
38189
|
-
if (is(value, peek(source(state), prop))) {
|
|
38916
|
+
if (is(value, peek(source(state), prop))) {
|
|
38917
|
+
return;
|
|
38918
|
+
}
|
|
38919
|
+
|
|
38190
38920
|
markChanged(state);
|
|
38191
38921
|
prepareCopy(state);
|
|
38192
38922
|
}
|
|
@@ -38197,12 +38927,17 @@ function set$1(state, prop, value) {
|
|
|
38197
38927
|
function markChanged(state) {
|
|
38198
38928
|
if (!state.modified) {
|
|
38199
38929
|
state.modified = true;
|
|
38200
|
-
|
|
38930
|
+
|
|
38931
|
+
if (state.parent) {
|
|
38932
|
+
markChanged(state.parent);
|
|
38933
|
+
}
|
|
38201
38934
|
}
|
|
38202
38935
|
}
|
|
38203
38936
|
|
|
38204
38937
|
function prepareCopy(state) {
|
|
38205
|
-
if (!state.copy) {
|
|
38938
|
+
if (!state.copy) {
|
|
38939
|
+
state.copy = clonePotentialDraft(state.base);
|
|
38940
|
+
}
|
|
38206
38941
|
}
|
|
38207
38942
|
|
|
38208
38943
|
function clonePotentialDraft(base) {
|
|
@@ -38227,15 +38962,12 @@ function proxyProperty(draft, prop, enumerable) {
|
|
|
38227
38962
|
descriptors$1[prop] = desc = {
|
|
38228
38963
|
configurable: true,
|
|
38229
38964
|
enumerable: enumerable,
|
|
38230
|
-
|
|
38231
38965
|
get: function get$1$1() {
|
|
38232
38966
|
return get$1(this[DRAFT_STATE], prop);
|
|
38233
38967
|
},
|
|
38234
|
-
|
|
38235
38968
|
set: function set$1$1(value) {
|
|
38236
38969
|
set$1(this[DRAFT_STATE], prop, value);
|
|
38237
38970
|
}
|
|
38238
|
-
|
|
38239
38971
|
};
|
|
38240
38972
|
}
|
|
38241
38973
|
|
|
@@ -38243,7 +38975,9 @@ function proxyProperty(draft, prop, enumerable) {
|
|
|
38243
38975
|
}
|
|
38244
38976
|
|
|
38245
38977
|
function assertUnrevoked(state) {
|
|
38246
|
-
if (state.revoked === true) {
|
|
38978
|
+
if (state.revoked === true) {
|
|
38979
|
+
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)));
|
|
38980
|
+
}
|
|
38247
38981
|
} // This looks expensive, but only proxies are visited, and only objects without known changes are scanned.
|
|
38248
38982
|
|
|
38249
38983
|
|
|
@@ -38257,16 +38991,27 @@ function markChangesSweep(drafts) {
|
|
|
38257
38991
|
|
|
38258
38992
|
if (!state.modified) {
|
|
38259
38993
|
if (Array.isArray(state.base)) {
|
|
38260
|
-
if (hasArrayChanges(state)) {
|
|
38261
|
-
|
|
38994
|
+
if (hasArrayChanges(state)) {
|
|
38995
|
+
markChanged(state);
|
|
38996
|
+
}
|
|
38997
|
+
} else if (hasObjectChanges(state)) {
|
|
38998
|
+
markChanged(state);
|
|
38999
|
+
}
|
|
38262
39000
|
}
|
|
38263
39001
|
}
|
|
38264
39002
|
}
|
|
38265
39003
|
|
|
38266
39004
|
function markChangesRecursively(object) {
|
|
38267
|
-
if (!object ||
|
|
39005
|
+
if (!object || _typeof(object) !== "object") {
|
|
39006
|
+
return;
|
|
39007
|
+
}
|
|
39008
|
+
|
|
38268
39009
|
var state = object[DRAFT_STATE];
|
|
38269
|
-
|
|
39010
|
+
|
|
39011
|
+
if (!state) {
|
|
39012
|
+
return;
|
|
39013
|
+
}
|
|
39014
|
+
|
|
38270
39015
|
var base = state.base;
|
|
38271
39016
|
var draft = state.draft;
|
|
38272
39017
|
var assigned = state.assigned;
|
|
@@ -38296,14 +39041,20 @@ function markChangesRecursively(object) {
|
|
|
38296
39041
|
assigned.length = true;
|
|
38297
39042
|
|
|
38298
39043
|
if (draft.length < base.length) {
|
|
38299
|
-
for (var i = draft.length; i < base.length; i++) {
|
|
39044
|
+
for (var i = draft.length; i < base.length; i++) {
|
|
39045
|
+
assigned[i] = false;
|
|
39046
|
+
}
|
|
38300
39047
|
} else {
|
|
38301
|
-
for (var i$1 = base.length; i$1 < draft.length; i$1++) {
|
|
39048
|
+
for (var i$1 = base.length; i$1 < draft.length; i$1++) {
|
|
39049
|
+
assigned[i$1] = true;
|
|
39050
|
+
}
|
|
38302
39051
|
}
|
|
38303
39052
|
|
|
38304
39053
|
for (var i$2 = 0; i$2 < draft.length; i$2++) {
|
|
38305
39054
|
// Only untouched indices trigger recursion.
|
|
38306
|
-
if (assigned[i$2] === undefined) {
|
|
39055
|
+
if (assigned[i$2] === undefined) {
|
|
39056
|
+
markChangesRecursively(draft[i$2]);
|
|
39057
|
+
}
|
|
38307
39058
|
}
|
|
38308
39059
|
}
|
|
38309
39060
|
}
|
|
@@ -38324,13 +39075,13 @@ function hasObjectChanges(state) {
|
|
|
38324
39075
|
} // Once a base key is deleted, future changes go undetected, because its
|
|
38325
39076
|
// descriptor is erased. This branch detects any missed changes.
|
|
38326
39077
|
else {
|
|
38327
|
-
|
|
38328
|
-
|
|
39078
|
+
var value = draft[key];
|
|
39079
|
+
var state$1 = value && value[DRAFT_STATE];
|
|
38329
39080
|
|
|
38330
|
-
|
|
38331
|
-
|
|
38332
|
-
}
|
|
39081
|
+
if (state$1 ? state$1.base !== baseValue : !is(value, baseValue)) {
|
|
39082
|
+
return true;
|
|
38333
39083
|
}
|
|
39084
|
+
}
|
|
38334
39085
|
} // At this point, no keys were added or changed.
|
|
38335
39086
|
// Compare key count to determine if keys were deleted.
|
|
38336
39087
|
|
|
@@ -38340,7 +39091,10 @@ function hasObjectChanges(state) {
|
|
|
38340
39091
|
|
|
38341
39092
|
function hasArrayChanges(state) {
|
|
38342
39093
|
var draft = state.draft;
|
|
38343
|
-
|
|
39094
|
+
|
|
39095
|
+
if (draft.length !== state.base.length) {
|
|
39096
|
+
return true;
|
|
39097
|
+
} // See #116
|
|
38344
39098
|
// If we first shorten the length, our array interceptors will be removed.
|
|
38345
39099
|
// If after that new items are added, result in the same original length,
|
|
38346
39100
|
// those last items will have no intercepting property.
|
|
@@ -38348,9 +39102,13 @@ function hasArrayChanges(state) {
|
|
|
38348
39102
|
// N.B.: splice, unshift, etc only shift values around, but not prop descriptors, so we only have to check
|
|
38349
39103
|
// the last one
|
|
38350
39104
|
|
|
39105
|
+
|
|
38351
39106
|
var descriptor = Object.getOwnPropertyDescriptor(draft, draft.length - 1); // descriptor can be null, but only for newly created sparse arrays, eg. new Array(10)
|
|
38352
39107
|
|
|
38353
|
-
if (descriptor && !descriptor.get) {
|
|
39108
|
+
if (descriptor && !descriptor.get) {
|
|
39109
|
+
return true;
|
|
39110
|
+
} // For all other cases, we don't have to compare, as they would have been picked up by the index setters
|
|
39111
|
+
|
|
38354
39112
|
|
|
38355
39113
|
return false;
|
|
38356
39114
|
}
|
|
@@ -38364,11 +39122,12 @@ function createHiddenProperty(target, prop, value) {
|
|
|
38364
39122
|
}
|
|
38365
39123
|
|
|
38366
39124
|
var legacyProxy = /*#__PURE__*/Object.freeze({
|
|
38367
|
-
|
|
38368
|
-
|
|
39125
|
+
willFinalize: willFinalize,
|
|
39126
|
+
createProxy: createProxy
|
|
38369
39127
|
});
|
|
38370
39128
|
|
|
38371
39129
|
function willFinalize$1() {}
|
|
39130
|
+
|
|
38372
39131
|
function createProxy$1(base, parent) {
|
|
38373
39132
|
var scope = parent ? parent.scope : ImmerScope.current;
|
|
38374
39133
|
var state = {
|
|
@@ -38403,33 +39162,27 @@ function createProxy$1(base, parent) {
|
|
|
38403
39162
|
scope.drafts.push(proxy);
|
|
38404
39163
|
return proxy;
|
|
38405
39164
|
}
|
|
39165
|
+
|
|
38406
39166
|
var objectTraps = {
|
|
38407
39167
|
get: get$1$1,
|
|
38408
|
-
|
|
38409
39168
|
has: function has(target, prop) {
|
|
38410
39169
|
return prop in source$1(target);
|
|
38411
39170
|
},
|
|
38412
|
-
|
|
38413
39171
|
ownKeys: function ownKeys(target) {
|
|
38414
39172
|
return Reflect.ownKeys(source$1(target));
|
|
38415
39173
|
},
|
|
38416
|
-
|
|
38417
39174
|
set: set$1$1,
|
|
38418
39175
|
deleteProperty: deleteProperty,
|
|
38419
39176
|
getOwnPropertyDescriptor: getOwnPropertyDescriptor$2,
|
|
38420
|
-
|
|
38421
39177
|
defineProperty: function defineProperty() {
|
|
38422
39178
|
throw new Error("Object.defineProperty() cannot be used on an Immer draft"); // prettier-ignore
|
|
38423
39179
|
},
|
|
38424
|
-
|
|
38425
39180
|
getPrototypeOf: function getPrototypeOf(target) {
|
|
38426
39181
|
return Object.getPrototypeOf(target.base);
|
|
38427
39182
|
},
|
|
38428
|
-
|
|
38429
39183
|
setPrototypeOf: function setPrototypeOf() {
|
|
38430
39184
|
throw new Error("Object.setPrototypeOf() cannot be used on an Immer draft"); // prettier-ignore
|
|
38431
39185
|
}
|
|
38432
|
-
|
|
38433
39186
|
};
|
|
38434
39187
|
var arrayTraps = {};
|
|
38435
39188
|
each(objectTraps, function (key, fn) {
|
|
@@ -38468,7 +39221,10 @@ function peek$1(draft, prop) {
|
|
|
38468
39221
|
}
|
|
38469
39222
|
|
|
38470
39223
|
function get$1$1(state, prop) {
|
|
38471
|
-
if (prop === DRAFT_STATE) {
|
|
39224
|
+
if (prop === DRAFT_STATE) {
|
|
39225
|
+
return state;
|
|
39226
|
+
}
|
|
39227
|
+
|
|
38472
39228
|
var drafts = state.drafts; // Check for existing draft in unmodified state.
|
|
38473
39229
|
|
|
38474
39230
|
if (!state.modified && has$1(drafts, prop)) {
|
|
@@ -38484,7 +39240,10 @@ function get$1$1(state, prop) {
|
|
|
38484
39240
|
|
|
38485
39241
|
if (state.modified) {
|
|
38486
39242
|
// Assigned values are never drafted. This catches any drafts we created, too.
|
|
38487
|
-
if (value !== peek$1(state.base, prop)) {
|
|
39243
|
+
if (value !== peek$1(state.base, prop)) {
|
|
39244
|
+
return value;
|
|
39245
|
+
} // Store drafts on the copy (when one exists).
|
|
39246
|
+
|
|
38488
39247
|
|
|
38489
39248
|
drafts = state.copy;
|
|
38490
39249
|
}
|
|
@@ -38499,7 +39258,11 @@ function set$1$1(state, prop, value) {
|
|
|
38499
39258
|
// values may be drafts, but falsy values are never drafts.
|
|
38500
39259
|
|
|
38501
39260
|
var isUnchanged = value ? is(baseValue, value) || value === state.drafts[prop] : is(baseValue, value) && prop in state.base;
|
|
38502
|
-
|
|
39261
|
+
|
|
39262
|
+
if (isUnchanged) {
|
|
39263
|
+
return true;
|
|
39264
|
+
}
|
|
39265
|
+
|
|
38503
39266
|
markChanged$1(state);
|
|
38504
39267
|
}
|
|
38505
39268
|
|
|
@@ -38518,7 +39281,10 @@ function deleteProperty(state, prop) {
|
|
|
38518
39281
|
delete state.assigned[prop];
|
|
38519
39282
|
}
|
|
38520
39283
|
|
|
38521
|
-
if (state.copy) {
|
|
39284
|
+
if (state.copy) {
|
|
39285
|
+
delete state.copy[prop];
|
|
39286
|
+
}
|
|
39287
|
+
|
|
38522
39288
|
return true;
|
|
38523
39289
|
} // Note: We never coerce `desc.value` into an Immer draft, because we can't make
|
|
38524
39290
|
// the same guarantee in ES5 mode.
|
|
@@ -38541,13 +39307,16 @@ function markChanged$1(state) {
|
|
|
38541
39307
|
state.modified = true;
|
|
38542
39308
|
state.copy = assign(shallowCopy(state.base), state.drafts);
|
|
38543
39309
|
state.drafts = null;
|
|
38544
|
-
|
|
39310
|
+
|
|
39311
|
+
if (state.parent) {
|
|
39312
|
+
markChanged$1(state.parent);
|
|
39313
|
+
}
|
|
38545
39314
|
}
|
|
38546
39315
|
}
|
|
38547
39316
|
|
|
38548
39317
|
var modernProxy = /*#__PURE__*/Object.freeze({
|
|
38549
|
-
|
|
38550
|
-
|
|
39318
|
+
willFinalize: willFinalize$1,
|
|
39319
|
+
createProxy: createProxy$1
|
|
38551
39320
|
});
|
|
38552
39321
|
|
|
38553
39322
|
function generatePatches(state, basePath, patches, inversePatches) {
|
|
@@ -38556,14 +39325,13 @@ function generatePatches(state, basePath, patches, inversePatches) {
|
|
|
38556
39325
|
|
|
38557
39326
|
function generateArrayPatches(state, basePath, patches, inversePatches) {
|
|
38558
39327
|
var assign, assign$1;
|
|
38559
|
-
|
|
38560
39328
|
var base = state.base;
|
|
38561
39329
|
var copy = state.copy;
|
|
38562
39330
|
var assigned = state.assigned; // Reduce complexity by ensuring `base` is never longer.
|
|
38563
39331
|
|
|
38564
39332
|
if (copy.length < base.length) {
|
|
38565
|
-
|
|
38566
|
-
|
|
39333
|
+
assign = [copy, base], base = assign[0], copy = assign[1];
|
|
39334
|
+
assign$1 = [inversePatches, patches], patches = assign$1[0], inversePatches = assign$1[1];
|
|
38567
39335
|
}
|
|
38568
39336
|
|
|
38569
39337
|
var delta = copy.length - base.length; // Find the first replaced index.
|
|
@@ -38621,7 +39389,11 @@ function generateObjectPatches(state, basePath, patches, inversePatches) {
|
|
|
38621
39389
|
var origValue = base[key];
|
|
38622
39390
|
var value = copy[key];
|
|
38623
39391
|
var op = !assignedValue ? "remove" : key in base ? "replace" : "add";
|
|
38624
|
-
|
|
39392
|
+
|
|
39393
|
+
if (origValue === value && op === "replace") {
|
|
39394
|
+
return;
|
|
39395
|
+
}
|
|
39396
|
+
|
|
38625
39397
|
var path = basePath.concat(key);
|
|
38626
39398
|
patches.push(op === "remove" ? {
|
|
38627
39399
|
op: op,
|
|
@@ -38646,20 +39418,26 @@ function generateObjectPatches(state, basePath, patches, inversePatches) {
|
|
|
38646
39418
|
});
|
|
38647
39419
|
}
|
|
38648
39420
|
|
|
38649
|
-
var applyPatches = function (draft, patches) {
|
|
39421
|
+
var applyPatches = function applyPatches(draft, patches) {
|
|
38650
39422
|
for (var i$1 = 0, list = patches; i$1 < list.length; i$1 += 1) {
|
|
38651
39423
|
var patch = list[i$1];
|
|
38652
|
-
|
|
38653
39424
|
var path = patch.path;
|
|
38654
39425
|
var op = patch.op;
|
|
38655
39426
|
var value = clone(patch.value); // used to clone patch to ensure original patch is not modified, see #411
|
|
38656
39427
|
|
|
38657
|
-
if (!path.length) {
|
|
39428
|
+
if (!path.length) {
|
|
39429
|
+
throw new Error("Illegal state");
|
|
39430
|
+
}
|
|
39431
|
+
|
|
38658
39432
|
var base = draft;
|
|
38659
39433
|
|
|
38660
39434
|
for (var i = 0; i < path.length - 1; i++) {
|
|
38661
39435
|
base = base[path[i]];
|
|
38662
|
-
|
|
39436
|
+
|
|
39437
|
+
if (!base || _typeof(base) !== "object") {
|
|
39438
|
+
throw new Error("Cannot apply patch, path doesn't resolve: " + path.join("/"));
|
|
39439
|
+
} // prettier-ignore
|
|
39440
|
+
|
|
38663
39441
|
}
|
|
38664
39442
|
|
|
38665
39443
|
var key = path[path.length - 1];
|
|
@@ -38708,27 +39486,33 @@ var configDefaults = {
|
|
|
38708
39486
|
onDelete: null,
|
|
38709
39487
|
onCopy: null
|
|
38710
39488
|
};
|
|
39489
|
+
|
|
38711
39490
|
var Immer = function Immer(config) {
|
|
38712
39491
|
assign(this, configDefaults, config);
|
|
38713
39492
|
this.setUseProxies(this.useProxies);
|
|
38714
39493
|
this.produce = this.produce.bind(this);
|
|
38715
39494
|
};
|
|
38716
39495
|
|
|
38717
|
-
Immer.prototype.produce = function produce
|
|
38718
|
-
|
|
39496
|
+
Immer.prototype.produce = function produce(base, recipe, patchListener) {
|
|
39497
|
+
var this$1$1 = this; // curried invocation
|
|
38719
39498
|
|
|
38720
|
-
// curried invocation
|
|
38721
39499
|
if (typeof base === "function" && typeof recipe !== "function") {
|
|
38722
39500
|
var defaultBase = recipe;
|
|
38723
39501
|
recipe = base;
|
|
38724
39502
|
var self = this;
|
|
38725
39503
|
return function curriedProduce(base) {
|
|
38726
|
-
|
|
38727
|
-
|
|
38728
|
-
|
|
38729
|
-
|
|
39504
|
+
var this$1$1 = this;
|
|
39505
|
+
if (base === void 0) base = defaultBase;
|
|
39506
|
+
var args = [],
|
|
39507
|
+
len = arguments.length - 1;
|
|
39508
|
+
|
|
39509
|
+
while (len-- > 0) {
|
|
39510
|
+
args[len] = arguments[len + 1];
|
|
39511
|
+
}
|
|
38730
39512
|
|
|
38731
|
-
return self.produce(base, function (draft) {
|
|
39513
|
+
return self.produce(base, function (draft) {
|
|
39514
|
+
return recipe.call.apply(recipe, [this$1$1, draft].concat(args));
|
|
39515
|
+
}); // prettier-ignore
|
|
38732
39516
|
};
|
|
38733
39517
|
} // prettier-ignore
|
|
38734
39518
|
|
|
@@ -38754,7 +39538,11 @@ Immer.prototype.produce = function produce (base, recipe, patchListener) {
|
|
|
38754
39538
|
hasError = false;
|
|
38755
39539
|
} finally {
|
|
38756
39540
|
// finally instead of catch + rethrow better preserves original stack
|
|
38757
|
-
if (hasError) {
|
|
39541
|
+
if (hasError) {
|
|
39542
|
+
scope.revoke();
|
|
39543
|
+
} else {
|
|
39544
|
+
scope.leave();
|
|
39545
|
+
}
|
|
38758
39546
|
}
|
|
38759
39547
|
|
|
38760
39548
|
if (result instanceof Promise) {
|
|
@@ -38771,25 +39559,38 @@ Immer.prototype.produce = function produce (base, recipe, patchListener) {
|
|
|
38771
39559
|
return this.processResult(result, scope);
|
|
38772
39560
|
} else {
|
|
38773
39561
|
result = recipe(base);
|
|
38774
|
-
|
|
39562
|
+
|
|
39563
|
+
if (result === undefined) {
|
|
39564
|
+
return base;
|
|
39565
|
+
}
|
|
39566
|
+
|
|
38775
39567
|
return result !== NOTHING ? result : undefined;
|
|
38776
39568
|
}
|
|
38777
39569
|
};
|
|
38778
39570
|
|
|
38779
|
-
Immer.prototype.produceWithPatches = function produceWithPatches
|
|
38780
|
-
|
|
39571
|
+
Immer.prototype.produceWithPatches = function produceWithPatches(arg1, arg2, arg3) {
|
|
39572
|
+
var this$1$1 = this;
|
|
38781
39573
|
|
|
38782
39574
|
if (typeof arg1 === "function") {
|
|
38783
39575
|
return function (state) {
|
|
38784
|
-
|
|
38785
|
-
|
|
39576
|
+
var args = [],
|
|
39577
|
+
len = arguments.length - 1;
|
|
38786
39578
|
|
|
38787
|
-
|
|
38788
|
-
|
|
39579
|
+
while (len-- > 0) {
|
|
39580
|
+
args[len] = arguments[len + 1];
|
|
39581
|
+
}
|
|
39582
|
+
|
|
39583
|
+
return this$1$1.produceWithPatches(state, function (draft) {
|
|
39584
|
+
return arg1.apply(void 0, [draft].concat(args));
|
|
39585
|
+
});
|
|
39586
|
+
};
|
|
38789
39587
|
} // non-curried form
|
|
38790
39588
|
|
|
38791
39589
|
|
|
38792
|
-
if (arg3) {
|
|
39590
|
+
if (arg3) {
|
|
39591
|
+
throw new Error("A patch listener cannot be passed to produceWithPatches");
|
|
39592
|
+
}
|
|
39593
|
+
|
|
38793
39594
|
var patches, inversePatches;
|
|
38794
39595
|
var nextState = this.produce(arg1, arg2, function (p, ip) {
|
|
38795
39596
|
patches = p;
|
|
@@ -38798,7 +39599,7 @@ Immer.prototype.produceWithPatches = function produceWithPatches (arg1, arg2, ar
|
|
|
38798
39599
|
return [nextState, patches, inversePatches];
|
|
38799
39600
|
};
|
|
38800
39601
|
|
|
38801
|
-
Immer.prototype.createDraft = function createDraft
|
|
39602
|
+
Immer.prototype.createDraft = function createDraft(base) {
|
|
38802
39603
|
if (!isDraftable(base)) {
|
|
38803
39604
|
throw new Error("First argument to `createDraft` must be a plain object, an array, or an immerable object"); // prettier-ignore
|
|
38804
39605
|
}
|
|
@@ -38810,7 +39611,7 @@ Immer.prototype.createDraft = function createDraft (base) {
|
|
|
38810
39611
|
return proxy;
|
|
38811
39612
|
};
|
|
38812
39613
|
|
|
38813
|
-
Immer.prototype.finishDraft = function finishDraft
|
|
39614
|
+
Immer.prototype.finishDraft = function finishDraft(draft, patchListener) {
|
|
38814
39615
|
var state = draft && draft[DRAFT_STATE];
|
|
38815
39616
|
|
|
38816
39617
|
if (!state || !state.isManual) {
|
|
@@ -38826,16 +39627,16 @@ Immer.prototype.finishDraft = function finishDraft (draft, patchListener) {
|
|
|
38826
39627
|
return this.processResult(undefined, scope);
|
|
38827
39628
|
};
|
|
38828
39629
|
|
|
38829
|
-
Immer.prototype.setAutoFreeze = function setAutoFreeze
|
|
39630
|
+
Immer.prototype.setAutoFreeze = function setAutoFreeze(value) {
|
|
38830
39631
|
this.autoFreeze = value;
|
|
38831
39632
|
};
|
|
38832
39633
|
|
|
38833
|
-
Immer.prototype.setUseProxies = function setUseProxies
|
|
39634
|
+
Immer.prototype.setUseProxies = function setUseProxies(value) {
|
|
38834
39635
|
this.useProxies = value;
|
|
38835
39636
|
assign(this, value ? modernProxy : legacyProxy);
|
|
38836
39637
|
};
|
|
38837
39638
|
|
|
38838
|
-
Immer.prototype.applyPatches = function applyPatches$1
|
|
39639
|
+
Immer.prototype.applyPatches = function applyPatches$1(base, patches) {
|
|
38839
39640
|
// If a patch replaces the entire state, take that replacement as base
|
|
38840
39641
|
// before applying patches
|
|
38841
39642
|
var i;
|
|
@@ -38855,12 +39656,14 @@ Immer.prototype.applyPatches = function applyPatches$1 (base, patches) {
|
|
|
38855
39656
|
} // Otherwise, produce a copy of the base state.
|
|
38856
39657
|
|
|
38857
39658
|
|
|
38858
|
-
return this.produce(base, function (draft) {
|
|
39659
|
+
return this.produce(base, function (draft) {
|
|
39660
|
+
return applyPatches(draft, patches.slice(i + 1));
|
|
39661
|
+
});
|
|
38859
39662
|
};
|
|
38860
39663
|
/** @internal */
|
|
38861
39664
|
|
|
38862
39665
|
|
|
38863
|
-
Immer.prototype.processResult = function processResult
|
|
39666
|
+
Immer.prototype.processResult = function processResult(result, scope) {
|
|
38864
39667
|
var baseDraft = scope.drafts[0];
|
|
38865
39668
|
var isReplaced = result !== undefined && result !== baseDraft;
|
|
38866
39669
|
this.willFinalize(scope, result, isReplaced);
|
|
@@ -38908,13 +39711,15 @@ Immer.prototype.processResult = function processResult (result, scope) {
|
|
|
38908
39711
|
*/
|
|
38909
39712
|
|
|
38910
39713
|
|
|
38911
|
-
Immer.prototype.finalize = function finalize
|
|
38912
|
-
|
|
38913
|
-
|
|
39714
|
+
Immer.prototype.finalize = function finalize(draft, path, scope) {
|
|
39715
|
+
var this$1$1 = this;
|
|
38914
39716
|
var state = draft[DRAFT_STATE];
|
|
38915
39717
|
|
|
38916
39718
|
if (!state) {
|
|
38917
|
-
if (Object.isFrozen(draft)) {
|
|
39719
|
+
if (Object.isFrozen(draft)) {
|
|
39720
|
+
return draft;
|
|
39721
|
+
}
|
|
39722
|
+
|
|
38918
39723
|
return this.finalizeTree(draft, null, scope);
|
|
38919
39724
|
} // Never finalize drafts owned by another scope.
|
|
38920
39725
|
|
|
@@ -38937,13 +39742,17 @@ Immer.prototype.finalize = function finalize (draft, path, scope) {
|
|
|
38937
39742
|
var assigned = state.assigned;
|
|
38938
39743
|
|
|
38939
39744
|
for (var prop in assigned) {
|
|
38940
|
-
if (!assigned[prop]) {
|
|
39745
|
+
if (!assigned[prop]) {
|
|
39746
|
+
this.onDelete(state, prop);
|
|
39747
|
+
}
|
|
38941
39748
|
}
|
|
38942
39749
|
} else {
|
|
38943
39750
|
var base = state.base;
|
|
38944
|
-
|
|
39751
|
+
var copy = state.copy;
|
|
38945
39752
|
each(base, function (prop) {
|
|
38946
|
-
if (!has$1(copy, prop)) {
|
|
39753
|
+
if (!has$1(copy, prop)) {
|
|
39754
|
+
this$1$1.onDelete(state, prop);
|
|
39755
|
+
}
|
|
38947
39756
|
});
|
|
38948
39757
|
}
|
|
38949
39758
|
}
|
|
@@ -38971,9 +39780,8 @@ Immer.prototype.finalize = function finalize (draft, path, scope) {
|
|
|
38971
39780
|
*/
|
|
38972
39781
|
|
|
38973
39782
|
|
|
38974
|
-
Immer.prototype.finalizeTree = function finalizeTree
|
|
38975
|
-
|
|
38976
|
-
|
|
39783
|
+
Immer.prototype.finalizeTree = function finalizeTree(root, rootPath, scope) {
|
|
39784
|
+
var this$1$1 = this;
|
|
38977
39785
|
var state = root[DRAFT_STATE];
|
|
38978
39786
|
|
|
38979
39787
|
if (state) {
|
|
@@ -38987,7 +39795,7 @@ Immer.prototype.finalizeTree = function finalizeTree (root, rootPath, scope) {
|
|
|
38987
39795
|
|
|
38988
39796
|
var needPatches = !!rootPath && !!scope.patches;
|
|
38989
39797
|
|
|
38990
|
-
var finalizeProperty = function (prop, value, parent) {
|
|
39798
|
+
var finalizeProperty = function finalizeProperty(prop, value, parent) {
|
|
38991
39799
|
if (value === parent) {
|
|
38992
39800
|
throw Error("Immer forbids circular references");
|
|
38993
39801
|
} // In the `finalizeTree` method, only the `root` object may be a draft.
|
|
@@ -39014,14 +39822,16 @@ Immer.prototype.finalizeTree = function finalizeTree (root, rootPath, scope) {
|
|
|
39014
39822
|
} // Unchanged drafts are never passed to the `onAssign` hook.
|
|
39015
39823
|
|
|
39016
39824
|
|
|
39017
|
-
if (isDraftProp && value === state.base[prop]) {
|
|
39825
|
+
if (isDraftProp && value === state.base[prop]) {
|
|
39826
|
+
return;
|
|
39827
|
+
}
|
|
39018
39828
|
} // Unchanged draft properties are ignored.
|
|
39019
39829
|
else if (isDraftProp && is(value, state.base[prop])) {
|
|
39020
|
-
|
|
39021
|
-
|
|
39022
|
-
|
|
39023
|
-
|
|
39024
|
-
|
|
39830
|
+
return;
|
|
39831
|
+
} // Search new objects for unfinalized drafts. Frozen objects should never contain drafts.
|
|
39832
|
+
else if (isDraftable(value) && !Object.isFrozen(value)) {
|
|
39833
|
+
each(value, finalizeProperty);
|
|
39834
|
+
}
|
|
39025
39835
|
|
|
39026
39836
|
if (isDraftProp && this$1$1.onAssign) {
|
|
39027
39837
|
this$1$1.onAssign(state, prop, value);
|
|
@@ -39099,127 +39909,223 @@ immer.createDraft.bind(immer);
|
|
|
39099
39909
|
|
|
39100
39910
|
immer.finishDraft.bind(immer);
|
|
39101
39911
|
|
|
39102
|
-
|
|
39103
|
-
|
|
39104
|
-
|
|
39105
|
-
|
|
39912
|
+
var createInitialState = function createInitialState(formConfig) {
|
|
39913
|
+
var initialForm = {};
|
|
39914
|
+
var formConfigKeys = Object.keys(formConfig);
|
|
39915
|
+
|
|
39916
|
+
for (var _i3 = 0, _formConfigKeys = formConfigKeys; _i3 < _formConfigKeys.length; _i3++) {
|
|
39917
|
+
var formKey = _formConfigKeys[_i3];
|
|
39106
39918
|
initialForm[formKey] = {
|
|
39107
39919
|
dirty: false,
|
|
39108
39920
|
rawValue: formConfig[formKey].defaultValue || "",
|
|
39109
39921
|
validators: formConfig[formKey].validators || [],
|
|
39110
39922
|
constraints: formConfig[formKey].constraints || []
|
|
39111
39923
|
};
|
|
39112
|
-
}
|
|
39113
|
-
// Because validators require the entire form we have to do a
|
|
39924
|
+
} // Because validators require the entire form we have to do a
|
|
39114
39925
|
// second pass to add errors once the initial form has been
|
|
39115
39926
|
// constructed
|
|
39116
|
-
|
|
39117
|
-
|
|
39118
|
-
|
|
39119
|
-
|
|
39927
|
+
|
|
39928
|
+
|
|
39929
|
+
for (var _i4 = 0, _formConfigKeys2 = formConfigKeys; _i4 < _formConfigKeys2.length; _i4++) {
|
|
39930
|
+
var _formKey = _formConfigKeys2[_i4];
|
|
39931
|
+
var errors = computeErrors(_formKey, initialForm);
|
|
39932
|
+
initialForm[_formKey].errors = errors;
|
|
39933
|
+
initialForm[_formKey].hasErrors = errors.length > 0;
|
|
39120
39934
|
}
|
|
39935
|
+
|
|
39121
39936
|
return initialForm;
|
|
39122
39937
|
};
|
|
39123
39938
|
|
|
39124
|
-
|
|
39125
|
-
|
|
39126
|
-
|
|
39127
|
-
|
|
39128
|
-
|
|
39939
|
+
var SET = "field/SET";
|
|
39940
|
+
|
|
39941
|
+
var _set = function set(fieldName) {
|
|
39942
|
+
return function (value) {
|
|
39943
|
+
return {
|
|
39944
|
+
type: SET,
|
|
39945
|
+
payload: {
|
|
39946
|
+
fieldName: fieldName,
|
|
39947
|
+
value: value
|
|
39948
|
+
}
|
|
39949
|
+
};
|
|
39950
|
+
};
|
|
39951
|
+
};
|
|
39129
39952
|
|
|
39130
|
-
|
|
39131
|
-
const clear = () => ({ type: CLEAR });
|
|
39953
|
+
var CLEAR = "form/CLEAR";
|
|
39132
39954
|
|
|
39133
|
-
|
|
39134
|
-
|
|
39135
|
-
|
|
39136
|
-
|
|
39137
|
-
}
|
|
39955
|
+
var _clear = function clear() {
|
|
39956
|
+
return {
|
|
39957
|
+
type: CLEAR
|
|
39958
|
+
};
|
|
39959
|
+
};
|
|
39960
|
+
|
|
39961
|
+
var ADD_VALIDATOR = "field/ADD_VALIDATOR";
|
|
39962
|
+
|
|
39963
|
+
var _addValidator = function addValidator(fieldName) {
|
|
39964
|
+
return function (validator) {
|
|
39965
|
+
return {
|
|
39966
|
+
type: ADD_VALIDATOR,
|
|
39967
|
+
payload: {
|
|
39968
|
+
fieldName: fieldName,
|
|
39969
|
+
validator: validator
|
|
39970
|
+
}
|
|
39971
|
+
};
|
|
39972
|
+
};
|
|
39973
|
+
};
|
|
39974
|
+
|
|
39975
|
+
var REMOVE_VALIDATOR = "field/REMOVE_VALIDATOR";
|
|
39976
|
+
|
|
39977
|
+
var _removeValidator = function removeValidator(fieldName) {
|
|
39978
|
+
return function (validator) {
|
|
39979
|
+
return {
|
|
39980
|
+
type: REMOVE_VALIDATOR,
|
|
39981
|
+
payload: {
|
|
39982
|
+
fieldName: fieldName,
|
|
39983
|
+
validator: validator
|
|
39984
|
+
}
|
|
39985
|
+
};
|
|
39986
|
+
};
|
|
39987
|
+
};
|
|
39988
|
+
|
|
39989
|
+
var CLEAR_FIELD_VALIDATORS = "field/CLEAR_FIELD_VALIDATORS";
|
|
39990
|
+
|
|
39991
|
+
var clearFieldValidators = function clearFieldValidators(fieldName) {
|
|
39992
|
+
return function () {
|
|
39993
|
+
return {
|
|
39994
|
+
type: CLEAR_FIELD_VALIDATORS,
|
|
39995
|
+
payload: {
|
|
39996
|
+
fieldName: fieldName
|
|
39997
|
+
}
|
|
39998
|
+
};
|
|
39999
|
+
};
|
|
40000
|
+
};
|
|
40001
|
+
|
|
40002
|
+
var createFormReducer = function createFormReducer(formConfig) {
|
|
40003
|
+
return function () {
|
|
40004
|
+
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : createInitialState(formConfig);
|
|
40005
|
+
var action = arguments.length > 1 ? arguments[1] : undefined;
|
|
40006
|
+
|
|
40007
|
+
switch (action.type) {
|
|
40008
|
+
case SET:
|
|
40009
|
+
{
|
|
40010
|
+
var changedFieldName = action.payload.fieldName;
|
|
40011
|
+
var newRawValue = action.payload.value;
|
|
40012
|
+
return produce(state, function (draftState) {
|
|
40013
|
+
var originalValue = draftState[changedFieldName].rawValue;
|
|
40014
|
+
draftState[changedFieldName].rawValue = newRawValue;
|
|
40015
|
+
|
|
40016
|
+
if (computeConstraints(changedFieldName, draftState).length > 0) {
|
|
40017
|
+
// If the change violates constraints, revert the change
|
|
40018
|
+
draftState[changedFieldName].rawValue = originalValue;
|
|
40019
|
+
return draftState;
|
|
40020
|
+
}
|
|
39138
40021
|
|
|
39139
|
-
|
|
39140
|
-
|
|
39141
|
-
|
|
39142
|
-
) => {
|
|
39143
|
-
switch (action.type) {
|
|
39144
|
-
case SET:
|
|
39145
|
-
const changedFieldName = action.payload.fieldName;
|
|
39146
|
-
const newRawValue = action.payload.value;
|
|
39147
|
-
|
|
39148
|
-
return produce(state, draftState => {
|
|
39149
|
-
let originalValue = draftState[changedFieldName].rawValue;
|
|
39150
|
-
draftState[changedFieldName].rawValue = newRawValue;
|
|
39151
|
-
if (computeConstraints(changedFieldName, draftState).length > 0) {
|
|
39152
|
-
// If the change violates constraints, revert the change
|
|
39153
|
-
draftState[changedFieldName].rawValue = originalValue;
|
|
39154
|
-
return draftState;
|
|
40022
|
+
computeDirtyEntries(draftState, changedFieldName);
|
|
40023
|
+
computeErrorEntries(draftState);
|
|
40024
|
+
});
|
|
39155
40025
|
}
|
|
39156
40026
|
|
|
39157
|
-
|
|
39158
|
-
|
|
39159
|
-
|
|
39160
|
-
|
|
39161
|
-
|
|
39162
|
-
|
|
39163
|
-
|
|
39164
|
-
draftState
|
|
39165
|
-
|
|
40027
|
+
case CLEAR:
|
|
40028
|
+
return createInitialState(formConfig);
|
|
40029
|
+
|
|
40030
|
+
case ADD_VALIDATOR:
|
|
40031
|
+
{
|
|
40032
|
+
var fieldWithOverride = action.payload.fieldName;
|
|
40033
|
+
var newValidator = action.payload.validator;
|
|
40034
|
+
return produce(state, function (draftState) {
|
|
40035
|
+
draftState[fieldWithOverride].validators.push(newValidator);
|
|
40036
|
+
computeErrorEntries(draftState);
|
|
40037
|
+
});
|
|
39166
40038
|
}
|
|
39167
|
-
|
|
39168
|
-
|
|
39169
|
-
|
|
39170
|
-
|
|
39171
|
-
|
|
39172
|
-
|
|
39173
|
-
|
|
39174
|
-
|
|
39175
|
-
|
|
39176
|
-
|
|
39177
|
-
|
|
39178
|
-
|
|
39179
|
-
let field = entry[1];
|
|
39180
|
-
let errors = computeErrors(fieldName, draftState);
|
|
39181
|
-
let dirty = field.dirty;
|
|
39182
|
-
draftState[fieldName].errors = errors;
|
|
39183
|
-
draftState[fieldName].dirty = dirty;
|
|
39184
|
-
draftState[fieldName].hasErrors = errors.length > 0;
|
|
40039
|
+
|
|
40040
|
+
case REMOVE_VALIDATOR:
|
|
40041
|
+
{
|
|
40042
|
+
var fieldToOverride = action.payload.fieldName;
|
|
40043
|
+
var targetValidator = action.payload.validator;
|
|
40044
|
+
return produce(state, function (draftState) {
|
|
40045
|
+
var fieldValidators = draftState[fieldToOverride].validators;
|
|
40046
|
+
draftState[fieldToOverride].validators = fieldValidators.filter(function (validator) {
|
|
40047
|
+
return validator.type !== targetValidator.type;
|
|
40048
|
+
});
|
|
40049
|
+
computeErrorEntries(draftState);
|
|
40050
|
+
});
|
|
39185
40051
|
}
|
|
39186
|
-
|
|
39187
|
-
|
|
39188
|
-
|
|
39189
|
-
|
|
40052
|
+
|
|
40053
|
+
case CLEAR_FIELD_VALIDATORS:
|
|
40054
|
+
{
|
|
40055
|
+
var fieldToClear = action.payload.fieldName;
|
|
40056
|
+
return produce(state, function (draftState) {
|
|
40057
|
+
draftState[fieldToClear].validators = [];
|
|
40058
|
+
computeErrorEntries(draftState);
|
|
40059
|
+
});
|
|
40060
|
+
}
|
|
40061
|
+
|
|
40062
|
+
default:
|
|
40063
|
+
return state;
|
|
40064
|
+
}
|
|
40065
|
+
};
|
|
39190
40066
|
};
|
|
39191
40067
|
|
|
39192
|
-
|
|
40068
|
+
var createMapDispatchToProps = function createMapDispatchToProps(formConfig) {
|
|
39193
40069
|
// Do memo-ization
|
|
39194
|
-
|
|
39195
|
-
|
|
39196
|
-
return dispatch
|
|
40070
|
+
var cachedDispatch;
|
|
40071
|
+
var cacheValue;
|
|
40072
|
+
return function (dispatch) {
|
|
39197
40073
|
if (dispatch == cachedDispatch) {
|
|
39198
40074
|
return cacheValue;
|
|
39199
40075
|
}
|
|
39200
|
-
|
|
40076
|
+
|
|
40077
|
+
var dispatchObj = {};
|
|
39201
40078
|
dispatchObj.fields = {};
|
|
39202
|
-
|
|
39203
|
-
|
|
40079
|
+
var keys = Object.keys(formConfig);
|
|
40080
|
+
|
|
40081
|
+
var _loop = function _loop() {
|
|
40082
|
+
var fieldName = _keys[_i5];
|
|
39204
40083
|
dispatchObj.fields[fieldName] = {
|
|
39205
|
-
set:
|
|
39206
|
-
|
|
40084
|
+
set: function set(value) {
|
|
40085
|
+
return dispatch(_set(fieldName)(value));
|
|
40086
|
+
},
|
|
40087
|
+
addValidator: function addValidator(validator) {
|
|
40088
|
+
return dispatch(_addValidator(fieldName)(validator));
|
|
40089
|
+
},
|
|
40090
|
+
removeValidator: function removeValidator(validator) {
|
|
40091
|
+
return dispatch(_removeValidator(fieldName)(validator));
|
|
40092
|
+
},
|
|
40093
|
+
clear: function clear() {
|
|
40094
|
+
return dispatch(clearFieldValidators(fieldName)());
|
|
40095
|
+
}
|
|
39207
40096
|
};
|
|
40097
|
+
};
|
|
40098
|
+
|
|
40099
|
+
for (var _i5 = 0, _keys = keys; _i5 < _keys.length; _i5++) {
|
|
40100
|
+
_loop();
|
|
39208
40101
|
}
|
|
39209
|
-
|
|
40102
|
+
|
|
40103
|
+
dispatchObj.form = {
|
|
40104
|
+
clear: function clear() {
|
|
40105
|
+
return dispatch(_clear());
|
|
40106
|
+
}
|
|
40107
|
+
};
|
|
39210
40108
|
cachedDispatch = dispatch;
|
|
39211
|
-
cacheValue = {
|
|
40109
|
+
cacheValue = {
|
|
40110
|
+
actions: dispatchObj
|
|
40111
|
+
};
|
|
39212
40112
|
return cacheValue;
|
|
39213
40113
|
};
|
|
39214
40114
|
};
|
|
39215
40115
|
|
|
39216
|
-
|
|
40116
|
+
var mapStateToProps = function mapStateToProps(state) {
|
|
40117
|
+
return {
|
|
40118
|
+
fields: state
|
|
40119
|
+
};
|
|
40120
|
+
};
|
|
39217
40121
|
|
|
39218
|
-
|
|
39219
|
-
|
|
39220
|
-
|
|
39221
|
-
|
|
39222
|
-
|
|
40122
|
+
var createFormState = function createFormState(formConfig) {
|
|
40123
|
+
return {
|
|
40124
|
+
reducer: createFormReducer(formConfig),
|
|
40125
|
+
mapDispatchToProps: createMapDispatchToProps(formConfig),
|
|
40126
|
+
mapStateToProps: mapStateToProps
|
|
40127
|
+
};
|
|
40128
|
+
};
|
|
39223
40129
|
|
|
39224
40130
|
var AddressForm = function AddressForm(_ref) {
|
|
39225
40131
|
var _zipErrorMessages;
|