@thecb/components 7.12.2-beta.9 → 7.12.2
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 +1543 -730
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1543 -730
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/alert/Alert.js +4 -17
- package/src/components/atoms/icons/AutopayOnIcon.js +2 -2
- package/src/components/atoms/spinner/Spinner.js +4 -26
- package/src/components/molecules/payment-button-bar/PaymentButtonBar.js +3 -0
- package/src/components/molecules/payment-details/PaymentDetails.js +9 -84
- package/src/util/generateShadows.js +1 -1
- package/src/.DS_Store +0 -0
- package/src/components/atoms/.DS_Store +0 -0
- package/src/components/molecules/.DS_Store +0 -0
- /package/src/components/atoms/icons/{ExternalLinkicon.js → ExternalLinkIcon.js} +0 -0
package/dist/index.esm.js
CHANGED
|
@@ -195,6 +195,63 @@ function _nonIterableRest() {
|
|
|
195
195
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
196
196
|
}
|
|
197
197
|
|
|
198
|
+
function _createForOfIteratorHelper(o, allowArrayLike) {
|
|
199
|
+
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
|
200
|
+
|
|
201
|
+
if (!it) {
|
|
202
|
+
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
203
|
+
if (it) o = it;
|
|
204
|
+
var i = 0;
|
|
205
|
+
|
|
206
|
+
var F = function () {};
|
|
207
|
+
|
|
208
|
+
return {
|
|
209
|
+
s: F,
|
|
210
|
+
n: function () {
|
|
211
|
+
if (i >= o.length) return {
|
|
212
|
+
done: true
|
|
213
|
+
};
|
|
214
|
+
return {
|
|
215
|
+
done: false,
|
|
216
|
+
value: o[i++]
|
|
217
|
+
};
|
|
218
|
+
},
|
|
219
|
+
e: function (e) {
|
|
220
|
+
throw e;
|
|
221
|
+
},
|
|
222
|
+
f: F
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
var normalCompletion = true,
|
|
230
|
+
didErr = false,
|
|
231
|
+
err;
|
|
232
|
+
return {
|
|
233
|
+
s: function () {
|
|
234
|
+
it = it.call(o);
|
|
235
|
+
},
|
|
236
|
+
n: function () {
|
|
237
|
+
var step = it.next();
|
|
238
|
+
normalCompletion = step.done;
|
|
239
|
+
return step;
|
|
240
|
+
},
|
|
241
|
+
e: function (e) {
|
|
242
|
+
didErr = true;
|
|
243
|
+
err = e;
|
|
244
|
+
},
|
|
245
|
+
f: function () {
|
|
246
|
+
try {
|
|
247
|
+
if (!normalCompletion && it.return != null) it.return();
|
|
248
|
+
} finally {
|
|
249
|
+
if (didErr) throw err;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
|
|
198
255
|
/*! *****************************************************************************
|
|
199
256
|
Copyright (c) Microsoft Corporation.
|
|
200
257
|
|
|
@@ -14111,6 +14168,7 @@ var TimeoutImage = function TimeoutImage() {
|
|
|
14111
14168
|
};
|
|
14112
14169
|
|
|
14113
14170
|
var AutopayOnIcon = function AutopayOnIcon() {
|
|
14171
|
+
var color = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : SEA_GREEN;
|
|
14114
14172
|
return /*#__PURE__*/React.createElement("svg", {
|
|
14115
14173
|
xmlns: "http://www.w3.org/2000/svg",
|
|
14116
14174
|
width: "12",
|
|
@@ -14123,7 +14181,7 @@ var AutopayOnIcon = function AutopayOnIcon() {
|
|
|
14123
14181
|
strokeWidth: "1"
|
|
14124
14182
|
}, /*#__PURE__*/React.createElement("path", {
|
|
14125
14183
|
className: "autopayIcon",
|
|
14126
|
-
fill:
|
|
14184
|
+
fill: color,
|
|
14127
14185
|
fillRule: "nonzero",
|
|
14128
14186
|
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"
|
|
14129
14187
|
})));
|
|
@@ -17762,63 +17820,7 @@ var fallbackValues$4 = {
|
|
|
17762
17820
|
link: link
|
|
17763
17821
|
};
|
|
17764
17822
|
|
|
17765
|
-
/*
|
|
17766
|
-
|
|
17767
|
-
A utility function that can generate box-shadow values for components
|
|
17768
|
-
Takes a string representing an rgb color value and returns an object
|
|
17769
|
-
with values for standard, inset, and overlay shadows.
|
|
17770
|
-
|
|
17771
|
-
The objects for standard and inset shadows contain versions approiate
|
|
17772
|
-
for base, hover, and active interaction states.
|
|
17773
|
-
|
|
17774
|
-
*/
|
|
17775
|
-
|
|
17776
|
-
/*
|
|
17777
|
-
Function to convert string representing rgb color to rgba value with provided opacity
|
|
17778
|
-
("rgb(41, 42, 51)", "0.1") => "rgba(41, 42, 51, 0.1)"
|
|
17779
|
-
|
|
17780
|
-
*/
|
|
17781
|
-
var rgbToRgba = function rgbToRgba() {
|
|
17782
|
-
var rgbValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
|
|
17783
|
-
var opacity = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
17784
|
-
|
|
17785
|
-
if (typeof rgbValue !== "string" || typeof opacity !== "string" || rgbValue.charAt(0) === "#") {
|
|
17786
|
-
return "";
|
|
17787
|
-
}
|
|
17788
|
-
|
|
17789
|
-
return "".concat(rgbValue.slice(0, 3), "a").concat(rgbValue.slice(3, -1), ", ").concat(opacity).concat(rgbValue.slice(-1));
|
|
17790
|
-
};
|
|
17791
|
-
|
|
17792
|
-
var generateShadows = function generateShadows() {
|
|
17793
|
-
var baseColorRGB = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "rgb(41, 42, 51)";
|
|
17794
|
-
var colorTen = rgbToRgba(baseColorRGB, "0.1") || "rgba(41, 42, 51, 0.1)";
|
|
17795
|
-
var colorTwenty = rgbToRgba(baseColorRGB, "0.2") || "rgba(41, 42, 51, 0.2)";
|
|
17796
|
-
var colorTwentyFive = rgbToRgba(baseColorRGB, "0.25") || "rgba(41, 42, 51, 0.25)";
|
|
17797
|
-
var colorThirty = rgbToRgba(baseColorRGB, "0.3") || "rgba(41, 42, 51, 0.3)";
|
|
17798
|
-
var blackTwentyFive = "rgba(0, 0, 0, 0.25)";
|
|
17799
|
-
var standard = {
|
|
17800
|
-
base: "0px 1px 2px 0px ".concat(colorTen, ", 0px 2px 6px 0px ").concat(colorTwenty, ", inset 0px 1px 0px 0px ").concat(colorTen),
|
|
17801
|
-
hover: "0px 1px 2px 0px ".concat(colorTwenty, ", 0px 4px 8px 0px ").concat(blackTwentyFive, ", 0px 6px 12px 0px ").concat(colorTen),
|
|
17802
|
-
active: "0px 2px 8px 0px ".concat(colorTwenty, ", 0px 4px 8px 0px ").concat(colorThirty, ", 0px 6px 12px 0px ").concat(colorTwentyFive)
|
|
17803
|
-
};
|
|
17804
|
-
var inset = {
|
|
17805
|
-
base: "0px 1px 2px 0px ".concat(colorTen, ", 0px 2px 4px 0px ").concat(colorTwenty, ", inset 0px 1px 0px 0px ").concat(colorTen),
|
|
17806
|
-
hover: "0px 1px 2px 0px ".concat(colorTen, ", 0px 2px 4px 0px ").concat(colorTwentyFive, ", 0px 4px 8px 0px ").concat(colorTen),
|
|
17807
|
-
active: "0px 1px 2px 2px ".concat(colorTwenty, ", 0px 3px 6px 0px ").concat(colorThirty, ", 0px 4px 8px 0px ").concat(colorTwenty)
|
|
17808
|
-
};
|
|
17809
|
-
var overlay = {
|
|
17810
|
-
base: "0px 7px 32px 0px ".concat(colorTwenty, ", 0px 1px 4px 0px ").concat(colorTwenty, ", 0px 1px 8px -1px ").concat(colorThirty)
|
|
17811
|
-
};
|
|
17812
|
-
return {
|
|
17813
|
-
standard: standard,
|
|
17814
|
-
inset: inset,
|
|
17815
|
-
overlay: overlay
|
|
17816
|
-
};
|
|
17817
|
-
};
|
|
17818
|
-
|
|
17819
17823
|
var Alert = function Alert(_ref) {
|
|
17820
|
-
var _generateShadows, _generateShadows$inse;
|
|
17821
|
-
|
|
17822
17824
|
var heading = _ref.heading,
|
|
17823
17825
|
text = _ref.text,
|
|
17824
17826
|
textOverride = _ref.textOverride,
|
|
@@ -17832,17 +17834,8 @@ var Alert = function Alert(_ref) {
|
|
|
17832
17834
|
showQuitLink = _ref$showQuitLink === void 0 ? true : _ref$showQuitLink,
|
|
17833
17835
|
themeValues = _ref.themeValues,
|
|
17834
17836
|
extraStyles = _ref.extraStyles,
|
|
17835
|
-
maxContentWidth = _ref.maxContentWidth
|
|
17836
|
-
_ref$noBorder = _ref.noBorder,
|
|
17837
|
-
noBorder = _ref$noBorder === void 0 ? false : _ref$noBorder,
|
|
17838
|
-
_ref$enableBoxShadow = _ref.enableBoxShadow,
|
|
17839
|
-
enableBoxShadow = _ref$enableBoxShadow === void 0 ? false : _ref$enableBoxShadow,
|
|
17840
|
-
_ref$enableSmallText = _ref.enableSmallText,
|
|
17841
|
-
enableSmallText = _ref$enableSmallText === void 0 ? false : _ref$enableSmallText,
|
|
17842
|
-
_ref$innerContentPadd = _ref.innerContentPadding,
|
|
17843
|
-
innerContentPadding = _ref$innerContentPadd === void 0 ? "1rem" : _ref$innerContentPadd;
|
|
17837
|
+
maxContentWidth = _ref.maxContentWidth;
|
|
17844
17838
|
var Icon = AlertIcons[variant];
|
|
17845
|
-
var contentPadding = maxContentWidth ? "".concat(padding, " 1rem") : innerContentPadding;
|
|
17846
17839
|
var content = /*#__PURE__*/React.createElement(Sidebar, {
|
|
17847
17840
|
width: "24px",
|
|
17848
17841
|
childGap: "0rem"
|
|
@@ -17863,7 +17856,7 @@ var Alert = function Alert(_ref) {
|
|
|
17863
17856
|
width: "24px",
|
|
17864
17857
|
childGap: "0rem"
|
|
17865
17858
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
17866
|
-
padding:
|
|
17859
|
+
padding: maxContentWidth ? "".concat(padding, " 1rem") : "1rem"
|
|
17867
17860
|
}, /*#__PURE__*/React.createElement(Cluster, {
|
|
17868
17861
|
justify: "flex-start",
|
|
17869
17862
|
align: "center"
|
|
@@ -17871,7 +17864,7 @@ var Alert = function Alert(_ref) {
|
|
|
17871
17864
|
fullHeight: true,
|
|
17872
17865
|
childGap: "0.25rem"
|
|
17873
17866
|
}, /*#__PURE__*/React.createElement(Text$1, {
|
|
17874
|
-
variant:
|
|
17867
|
+
variant: "p",
|
|
17875
17868
|
color: themeValues.text,
|
|
17876
17869
|
weight: "600"
|
|
17877
17870
|
}, heading), /*#__PURE__*/React.createElement(Text$1, {
|
|
@@ -17893,8 +17886,7 @@ var Alert = function Alert(_ref) {
|
|
|
17893
17886
|
background: themeValues.background,
|
|
17894
17887
|
borderRadius: "4px",
|
|
17895
17888
|
borderColor: themeValues.border,
|
|
17896
|
-
borderSize:
|
|
17897
|
-
boxShadow: enableBoxShadow ? (_generateShadows = generateShadows()) === null || _generateShadows === void 0 ? void 0 : (_generateShadows$inse = _generateShadows.inset) === null || _generateShadows$inse === void 0 ? void 0 : _generateShadows$inse.base : "",
|
|
17889
|
+
borderSize: "1px",
|
|
17898
17890
|
extraStyles: extraStyles
|
|
17899
17891
|
}, maxContentWidth ? /*#__PURE__*/React.createElement(Center, {
|
|
17900
17892
|
maxWidth: maxContentWidth
|
|
@@ -21437,7 +21429,7 @@ var check = function (it) {
|
|
|
21437
21429
|
|
|
21438
21430
|
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
|
|
21439
21431
|
var global_1 =
|
|
21440
|
-
// eslint-disable-next-line es
|
|
21432
|
+
// eslint-disable-next-line es/no-global-this -- safe
|
|
21441
21433
|
check(typeof globalThis == 'object' && globalThis) ||
|
|
21442
21434
|
check(typeof window == 'object' && window) ||
|
|
21443
21435
|
// eslint-disable-next-line no-restricted-globals -- safe
|
|
@@ -21456,12 +21448,12 @@ var fails = function (exec) {
|
|
|
21456
21448
|
|
|
21457
21449
|
// Detect IE8's incomplete defineProperty implementation
|
|
21458
21450
|
var descriptors = !fails(function () {
|
|
21459
|
-
// eslint-disable-next-line es
|
|
21451
|
+
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
21460
21452
|
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
|
|
21461
21453
|
});
|
|
21462
21454
|
|
|
21463
21455
|
var functionBindNative = !fails(function () {
|
|
21464
|
-
// eslint-disable-next-line es
|
|
21456
|
+
// eslint-disable-next-line es/no-function-prototype-bind -- safe
|
|
21465
21457
|
var test = (function () { /* empty */ }).bind();
|
|
21466
21458
|
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
21467
21459
|
return typeof test != 'function' || test.hasOwnProperty('prototype');
|
|
@@ -21474,7 +21466,7 @@ var functionCall = functionBindNative ? call.bind(call) : function () {
|
|
|
21474
21466
|
};
|
|
21475
21467
|
|
|
21476
21468
|
var $propertyIsEnumerable = {}.propertyIsEnumerable;
|
|
21477
|
-
// eslint-disable-next-line es
|
|
21469
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
21478
21470
|
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
21479
21471
|
|
|
21480
21472
|
// Nashorn ~ JDK8 bug
|
|
@@ -21501,25 +21493,29 @@ var createPropertyDescriptor = function (bitmap, value) {
|
|
|
21501
21493
|
};
|
|
21502
21494
|
|
|
21503
21495
|
var FunctionPrototype = Function.prototype;
|
|
21504
|
-
var bind$1 = FunctionPrototype.bind;
|
|
21505
21496
|
var call$1 = FunctionPrototype.call;
|
|
21506
|
-
var
|
|
21497
|
+
var uncurryThisWithBind = functionBindNative && FunctionPrototype.bind.bind(call$1, call$1);
|
|
21507
21498
|
|
|
21508
|
-
var
|
|
21509
|
-
return
|
|
21510
|
-
} : function (fn) {
|
|
21511
|
-
return fn && function () {
|
|
21499
|
+
var functionUncurryThisRaw = function (fn) {
|
|
21500
|
+
return functionBindNative ? uncurryThisWithBind(fn) : function () {
|
|
21512
21501
|
return call$1.apply(fn, arguments);
|
|
21513
21502
|
};
|
|
21514
21503
|
};
|
|
21515
21504
|
|
|
21516
|
-
var toString$2 =
|
|
21517
|
-
var stringSlice =
|
|
21505
|
+
var toString$2 = functionUncurryThisRaw({}.toString);
|
|
21506
|
+
var stringSlice = functionUncurryThisRaw(''.slice);
|
|
21518
21507
|
|
|
21519
21508
|
var classofRaw = function (it) {
|
|
21520
21509
|
return stringSlice(toString$2(it), 8, -1);
|
|
21521
21510
|
};
|
|
21522
21511
|
|
|
21512
|
+
var functionUncurryThis = function (fn) {
|
|
21513
|
+
// Nashorn bug:
|
|
21514
|
+
// https://github.com/zloirock/core-js/issues/1128
|
|
21515
|
+
// https://github.com/zloirock/core-js/issues/1130
|
|
21516
|
+
if (classofRaw(fn) === 'Function') return functionUncurryThisRaw(fn);
|
|
21517
|
+
};
|
|
21518
|
+
|
|
21523
21519
|
var $Object = Object;
|
|
21524
21520
|
var split = functionUncurryThis(''.split);
|
|
21525
21521
|
|
|
@@ -21532,12 +21528,18 @@ var indexedObject = fails(function () {
|
|
|
21532
21528
|
return classofRaw(it) == 'String' ? split(it, '') : $Object(it);
|
|
21533
21529
|
} : $Object;
|
|
21534
21530
|
|
|
21531
|
+
// we can't use just `it == null` since of `document.all` special case
|
|
21532
|
+
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
|
|
21533
|
+
var isNullOrUndefined = function (it) {
|
|
21534
|
+
return it === null || it === undefined;
|
|
21535
|
+
};
|
|
21536
|
+
|
|
21535
21537
|
var $TypeError = TypeError;
|
|
21536
21538
|
|
|
21537
21539
|
// `RequireObjectCoercible` abstract operation
|
|
21538
21540
|
// https://tc39.es/ecma262/#sec-requireobjectcoercible
|
|
21539
21541
|
var requireObjectCoercible = function (it) {
|
|
21540
|
-
if (it
|
|
21542
|
+
if (isNullOrUndefined(it)) throw $TypeError("Can't call method on " + it);
|
|
21541
21543
|
return it;
|
|
21542
21544
|
};
|
|
21543
21545
|
|
|
@@ -21549,13 +21551,31 @@ var toIndexedObject = function (it) {
|
|
|
21549
21551
|
return indexedObject(requireObjectCoercible(it));
|
|
21550
21552
|
};
|
|
21551
21553
|
|
|
21554
|
+
var documentAll = typeof document == 'object' && document.all;
|
|
21555
|
+
|
|
21556
|
+
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
|
|
21557
|
+
var IS_HTMLDDA = typeof documentAll == 'undefined' && documentAll !== undefined;
|
|
21558
|
+
|
|
21559
|
+
var documentAll_1 = {
|
|
21560
|
+
all: documentAll,
|
|
21561
|
+
IS_HTMLDDA: IS_HTMLDDA
|
|
21562
|
+
};
|
|
21563
|
+
|
|
21564
|
+
var documentAll$1 = documentAll_1.all;
|
|
21565
|
+
|
|
21552
21566
|
// `IsCallable` abstract operation
|
|
21553
21567
|
// https://tc39.es/ecma262/#sec-iscallable
|
|
21554
|
-
var isCallable = function (argument) {
|
|
21568
|
+
var isCallable = documentAll_1.IS_HTMLDDA ? function (argument) {
|
|
21569
|
+
return typeof argument == 'function' || argument === documentAll$1;
|
|
21570
|
+
} : function (argument) {
|
|
21555
21571
|
return typeof argument == 'function';
|
|
21556
21572
|
};
|
|
21557
21573
|
|
|
21558
|
-
var
|
|
21574
|
+
var documentAll$2 = documentAll_1.all;
|
|
21575
|
+
|
|
21576
|
+
var isObject = documentAll_1.IS_HTMLDDA ? function (it) {
|
|
21577
|
+
return typeof it == 'object' ? it !== null : isCallable(it) || it === documentAll$2;
|
|
21578
|
+
} : function (it) {
|
|
21559
21579
|
return typeof it == 'object' ? it !== null : isCallable(it);
|
|
21560
21580
|
};
|
|
21561
21581
|
|
|
@@ -21596,12 +21616,12 @@ if (!version && engineUserAgent) {
|
|
|
21596
21616
|
|
|
21597
21617
|
var engineV8Version = version;
|
|
21598
21618
|
|
|
21599
|
-
/* eslint-disable es
|
|
21619
|
+
/* eslint-disable es/no-symbol -- required for testing */
|
|
21600
21620
|
|
|
21601
21621
|
|
|
21602
21622
|
|
|
21603
|
-
// eslint-disable-next-line es
|
|
21604
|
-
var
|
|
21623
|
+
// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
|
|
21624
|
+
var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails(function () {
|
|
21605
21625
|
var symbol = Symbol();
|
|
21606
21626
|
// Chrome 38 Symbol has incorrect toString conversion
|
|
21607
21627
|
// `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
|
|
@@ -21610,10 +21630,10 @@ var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
|
|
|
21610
21630
|
!Symbol.sham && engineV8Version && engineV8Version < 41;
|
|
21611
21631
|
});
|
|
21612
21632
|
|
|
21613
|
-
/* eslint-disable es
|
|
21633
|
+
/* eslint-disable es/no-symbol -- required for testing */
|
|
21614
21634
|
|
|
21615
21635
|
|
|
21616
|
-
var useSymbolAsUid =
|
|
21636
|
+
var useSymbolAsUid = symbolConstructorDetection
|
|
21617
21637
|
&& !Symbol.sham
|
|
21618
21638
|
&& typeof Symbol.iterator == 'symbol';
|
|
21619
21639
|
|
|
@@ -21648,7 +21668,7 @@ var aCallable = function (argument) {
|
|
|
21648
21668
|
// https://tc39.es/ecma262/#sec-getmethod
|
|
21649
21669
|
var getMethod = function (V, P) {
|
|
21650
21670
|
var func = V[P];
|
|
21651
|
-
return func
|
|
21671
|
+
return isNullOrUndefined(func) ? undefined : aCallable(func);
|
|
21652
21672
|
};
|
|
21653
21673
|
|
|
21654
21674
|
var $TypeError$2 = TypeError;
|
|
@@ -21663,7 +21683,7 @@ var ordinaryToPrimitive = function (input, pref) {
|
|
|
21663
21683
|
throw $TypeError$2("Can't convert object to primitive value");
|
|
21664
21684
|
};
|
|
21665
21685
|
|
|
21666
|
-
// eslint-disable-next-line es
|
|
21686
|
+
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
21667
21687
|
var defineProperty = Object.defineProperty;
|
|
21668
21688
|
|
|
21669
21689
|
var defineGlobalProperty = function (key, value) {
|
|
@@ -21683,10 +21703,10 @@ var shared = createCommonjsModule(function (module) {
|
|
|
21683
21703
|
(module.exports = function (key, value) {
|
|
21684
21704
|
return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
|
|
21685
21705
|
})('versions', []).push({
|
|
21686
|
-
version: '3.
|
|
21706
|
+
version: '3.25.5',
|
|
21687
21707
|
mode: 'global',
|
|
21688
21708
|
copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
|
|
21689
|
-
license: 'https://github.com/zloirock/core-js/blob/v3.
|
|
21709
|
+
license: 'https://github.com/zloirock/core-js/blob/v3.25.5/LICENSE',
|
|
21690
21710
|
source: 'https://github.com/zloirock/core-js'
|
|
21691
21711
|
});
|
|
21692
21712
|
});
|
|
@@ -21703,7 +21723,7 @@ var hasOwnProperty = functionUncurryThis({}.hasOwnProperty);
|
|
|
21703
21723
|
|
|
21704
21724
|
// `HasOwnProperty` abstract operation
|
|
21705
21725
|
// https://tc39.es/ecma262/#sec-hasownproperty
|
|
21706
|
-
// eslint-disable-next-line es
|
|
21726
|
+
// eslint-disable-next-line es/no-object-hasown -- safe
|
|
21707
21727
|
var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
|
|
21708
21728
|
return hasOwnProperty(toObject(it), key);
|
|
21709
21729
|
};
|
|
@@ -21722,9 +21742,9 @@ var symbolFor = Symbol$1 && Symbol$1['for'];
|
|
|
21722
21742
|
var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
|
|
21723
21743
|
|
|
21724
21744
|
var wellKnownSymbol = function (name) {
|
|
21725
|
-
if (!hasOwnProperty_1(WellKnownSymbolsStore, name) || !(
|
|
21745
|
+
if (!hasOwnProperty_1(WellKnownSymbolsStore, name) || !(symbolConstructorDetection || typeof WellKnownSymbolsStore[name] == 'string')) {
|
|
21726
21746
|
var description = 'Symbol.' + name;
|
|
21727
|
-
if (
|
|
21747
|
+
if (symbolConstructorDetection && hasOwnProperty_1(Symbol$1, name)) {
|
|
21728
21748
|
WellKnownSymbolsStore[name] = Symbol$1[name];
|
|
21729
21749
|
} else if (useSymbolAsUid && symbolFor) {
|
|
21730
21750
|
WellKnownSymbolsStore[name] = symbolFor(description);
|
|
@@ -21770,13 +21790,13 @@ var documentCreateElement = function (it) {
|
|
|
21770
21790
|
|
|
21771
21791
|
// Thanks to IE8 for its funny defineProperty
|
|
21772
21792
|
var ie8DomDefine = !descriptors && !fails(function () {
|
|
21773
|
-
// eslint-disable-next-line es
|
|
21793
|
+
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
21774
21794
|
return Object.defineProperty(documentCreateElement('div'), 'a', {
|
|
21775
21795
|
get: function () { return 7; }
|
|
21776
21796
|
}).a != 7;
|
|
21777
21797
|
});
|
|
21778
21798
|
|
|
21779
|
-
// eslint-disable-next-line es
|
|
21799
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
21780
21800
|
var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
21781
21801
|
|
|
21782
21802
|
// `Object.getOwnPropertyDescriptor` method
|
|
@@ -21797,7 +21817,7 @@ var objectGetOwnPropertyDescriptor = {
|
|
|
21797
21817
|
// V8 ~ Chrome 36-
|
|
21798
21818
|
// https://bugs.chromium.org/p/v8/issues/detail?id=3334
|
|
21799
21819
|
var v8PrototypeDefineBug = descriptors && fails(function () {
|
|
21800
|
-
// eslint-disable-next-line es
|
|
21820
|
+
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
21801
21821
|
return Object.defineProperty(function () { /* empty */ }, 'prototype', {
|
|
21802
21822
|
value: 42,
|
|
21803
21823
|
writable: false
|
|
@@ -21814,9 +21834,9 @@ var anObject = function (argument) {
|
|
|
21814
21834
|
};
|
|
21815
21835
|
|
|
21816
21836
|
var $TypeError$5 = TypeError;
|
|
21817
|
-
// eslint-disable-next-line es
|
|
21837
|
+
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
21818
21838
|
var $defineProperty = Object.defineProperty;
|
|
21819
|
-
// eslint-disable-next-line es
|
|
21839
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
21820
21840
|
var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
|
|
21821
21841
|
var ENUMERABLE = 'enumerable';
|
|
21822
21842
|
var CONFIGURABLE = 'configurable';
|
|
@@ -21863,7 +21883,7 @@ var createNonEnumerableProperty = descriptors ? function (object, key, value) {
|
|
|
21863
21883
|
};
|
|
21864
21884
|
|
|
21865
21885
|
var FunctionPrototype$1 = Function.prototype;
|
|
21866
|
-
// eslint-disable-next-line es
|
|
21886
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
21867
21887
|
var getDescriptor = descriptors && Object.getOwnPropertyDescriptor;
|
|
21868
21888
|
|
|
21869
21889
|
var EXISTS$1 = hasOwnProperty_1(FunctionPrototype$1, 'name');
|
|
@@ -21890,7 +21910,7 @@ var inspectSource = sharedStore.inspectSource;
|
|
|
21890
21910
|
|
|
21891
21911
|
var WeakMap$1 = global_1.WeakMap;
|
|
21892
21912
|
|
|
21893
|
-
var
|
|
21913
|
+
var weakMapBasicDetection = isCallable(WeakMap$1) && /native code/.test(String(WeakMap$1));
|
|
21894
21914
|
|
|
21895
21915
|
var keys$1 = shared('keys');
|
|
21896
21916
|
|
|
@@ -21918,28 +21938,30 @@ var getterFor = function (TYPE) {
|
|
|
21918
21938
|
};
|
|
21919
21939
|
};
|
|
21920
21940
|
|
|
21921
|
-
if (
|
|
21941
|
+
if (weakMapBasicDetection || sharedStore.state) {
|
|
21922
21942
|
var store$1 = sharedStore.state || (sharedStore.state = new WeakMap$2());
|
|
21923
|
-
|
|
21924
|
-
|
|
21925
|
-
|
|
21943
|
+
/* eslint-disable no-self-assign -- prototype methods protection */
|
|
21944
|
+
store$1.get = store$1.get;
|
|
21945
|
+
store$1.has = store$1.has;
|
|
21946
|
+
store$1.set = store$1.set;
|
|
21947
|
+
/* eslint-enable no-self-assign -- prototype methods protection */
|
|
21926
21948
|
set = function (it, metadata) {
|
|
21927
|
-
if (
|
|
21949
|
+
if (store$1.has(it)) throw TypeError$1(OBJECT_ALREADY_INITIALIZED);
|
|
21928
21950
|
metadata.facade = it;
|
|
21929
|
-
|
|
21951
|
+
store$1.set(it, metadata);
|
|
21930
21952
|
return metadata;
|
|
21931
21953
|
};
|
|
21932
21954
|
get = function (it) {
|
|
21933
|
-
return
|
|
21955
|
+
return store$1.get(it) || {};
|
|
21934
21956
|
};
|
|
21935
21957
|
has = function (it) {
|
|
21936
|
-
return
|
|
21958
|
+
return store$1.has(it);
|
|
21937
21959
|
};
|
|
21938
21960
|
} else {
|
|
21939
21961
|
var STATE = sharedKey('state');
|
|
21940
21962
|
hiddenKeys[STATE] = true;
|
|
21941
21963
|
set = function (it, metadata) {
|
|
21942
|
-
if (hasOwnProperty_1(it, STATE)) throw
|
|
21964
|
+
if (hasOwnProperty_1(it, STATE)) throw TypeError$1(OBJECT_ALREADY_INITIALIZED);
|
|
21943
21965
|
metadata.facade = it;
|
|
21944
21966
|
createNonEnumerableProperty(it, STATE, metadata);
|
|
21945
21967
|
return metadata;
|
|
@@ -21967,7 +21989,7 @@ var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
|
|
|
21967
21989
|
|
|
21968
21990
|
var enforceInternalState = internalState.enforce;
|
|
21969
21991
|
var getInternalState = internalState.get;
|
|
21970
|
-
// eslint-disable-next-line es
|
|
21992
|
+
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
21971
21993
|
var defineProperty = Object.defineProperty;
|
|
21972
21994
|
|
|
21973
21995
|
var CONFIGURABLE_LENGTH = descriptors && !fails(function () {
|
|
@@ -22036,7 +22058,7 @@ var floor = Math.floor;
|
|
|
22036
22058
|
|
|
22037
22059
|
// `Math.trunc` method
|
|
22038
22060
|
// https://tc39.es/ecma262/#sec-math.trunc
|
|
22039
|
-
// eslint-disable-next-line es
|
|
22061
|
+
// eslint-disable-next-line es/no-math-trunc -- safe
|
|
22040
22062
|
var mathTrunc = Math.trunc || function trunc(x) {
|
|
22041
22063
|
var n = +x;
|
|
22042
22064
|
return (n > 0 ? floor : ceil)(n);
|
|
@@ -22137,7 +22159,7 @@ var hiddenKeys$1 = enumBugKeys.concat('length', 'prototype');
|
|
|
22137
22159
|
|
|
22138
22160
|
// `Object.getOwnPropertyNames` method
|
|
22139
22161
|
// https://tc39.es/ecma262/#sec-object.getownpropertynames
|
|
22140
|
-
// eslint-disable-next-line es
|
|
22162
|
+
// eslint-disable-next-line es/no-object-getownpropertynames -- safe
|
|
22141
22163
|
var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
|
22142
22164
|
return objectKeysInternal(O, hiddenKeys$1);
|
|
22143
22165
|
};
|
|
@@ -22146,7 +22168,7 @@ var objectGetOwnPropertyNames = {
|
|
|
22146
22168
|
f: f$3
|
|
22147
22169
|
};
|
|
22148
22170
|
|
|
22149
|
-
// eslint-disable-next-line es
|
|
22171
|
+
// eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
|
|
22150
22172
|
var f$4 = Object.getOwnPropertySymbols;
|
|
22151
22173
|
|
|
22152
22174
|
var objectGetOwnPropertySymbols = {
|
|
@@ -22290,7 +22312,7 @@ var toString_1 = function (argument) {
|
|
|
22290
22312
|
var charAt = functionUncurryThis(''.charAt);
|
|
22291
22313
|
|
|
22292
22314
|
var FORCED = fails(function () {
|
|
22293
|
-
// eslint-disable-next-line es
|
|
22315
|
+
// eslint-disable-next-line es/no-array-string-prototype-at -- safe
|
|
22294
22316
|
return '𠮷'.at(-2) !== '\uD842';
|
|
22295
22317
|
});
|
|
22296
22318
|
|
|
@@ -22308,14 +22330,14 @@ _export({ target: 'String', proto: true, forced: FORCED }, {
|
|
|
22308
22330
|
|
|
22309
22331
|
// `Object.keys` method
|
|
22310
22332
|
// https://tc39.es/ecma262/#sec-object.keys
|
|
22311
|
-
// eslint-disable-next-line es
|
|
22333
|
+
// eslint-disable-next-line es/no-object-keys -- safe
|
|
22312
22334
|
var objectKeys = Object.keys || function keys(O) {
|
|
22313
22335
|
return objectKeysInternal(O, enumBugKeys);
|
|
22314
22336
|
};
|
|
22315
22337
|
|
|
22316
22338
|
// `Object.defineProperties` method
|
|
22317
22339
|
// https://tc39.es/ecma262/#sec-object.defineproperties
|
|
22318
|
-
// eslint-disable-next-line es
|
|
22340
|
+
// eslint-disable-next-line es/no-object-defineproperties -- safe
|
|
22319
22341
|
var f$5 = descriptors && !v8PrototypeDefineBug ? Object.defineProperties : function defineProperties(O, Properties) {
|
|
22320
22342
|
anObject(O);
|
|
22321
22343
|
var props = toIndexedObject(Properties);
|
|
@@ -22404,7 +22426,7 @@ hiddenKeys[IE_PROTO] = true;
|
|
|
22404
22426
|
|
|
22405
22427
|
// `Object.create` method
|
|
22406
22428
|
// https://tc39.es/ecma262/#sec-object.create
|
|
22407
|
-
// eslint-disable-next-line es
|
|
22429
|
+
// eslint-disable-next-line es/no-object-create -- safe
|
|
22408
22430
|
var objectCreate = Object.create || function create(O, Properties) {
|
|
22409
22431
|
var result;
|
|
22410
22432
|
if (O !== null) {
|
|
@@ -22450,13 +22472,13 @@ _export({ target: 'Array', proto: true }, {
|
|
|
22450
22472
|
|
|
22451
22473
|
addToUnscopables('at');
|
|
22452
22474
|
|
|
22453
|
-
// eslint-disable-next-line es
|
|
22454
|
-
var
|
|
22475
|
+
// eslint-disable-next-line es/no-typed-arrays -- safe
|
|
22476
|
+
var arrayBufferBasicDetection = typeof ArrayBuffer != 'undefined' && typeof DataView != 'undefined';
|
|
22455
22477
|
|
|
22456
22478
|
var correctPrototypeGetter = !fails(function () {
|
|
22457
22479
|
function F() { /* empty */ }
|
|
22458
22480
|
F.prototype.constructor = null;
|
|
22459
|
-
// eslint-disable-next-line es
|
|
22481
|
+
// eslint-disable-next-line es/no-object-getprototypeof -- required for testing
|
|
22460
22482
|
return Object.getPrototypeOf(new F()) !== F.prototype;
|
|
22461
22483
|
});
|
|
22462
22484
|
|
|
@@ -22466,7 +22488,7 @@ var ObjectPrototype = $Object$4.prototype;
|
|
|
22466
22488
|
|
|
22467
22489
|
// `Object.getPrototypeOf` method
|
|
22468
22490
|
// https://tc39.es/ecma262/#sec-object.getprototypeof
|
|
22469
|
-
// eslint-disable-next-line es
|
|
22491
|
+
// eslint-disable-next-line es/no-object-getprototypeof -- safe
|
|
22470
22492
|
var objectGetPrototypeOf = correctPrototypeGetter ? $Object$4.getPrototypeOf : function (O) {
|
|
22471
22493
|
var object = toObject(O);
|
|
22472
22494
|
if (hasOwnProperty_1(object, IE_PROTO$1)) return object[IE_PROTO$1];
|
|
@@ -22492,13 +22514,13 @@ var aPossiblePrototype = function (argument) {
|
|
|
22492
22514
|
// `Object.setPrototypeOf` method
|
|
22493
22515
|
// https://tc39.es/ecma262/#sec-object.setprototypeof
|
|
22494
22516
|
// Works with __proto__ only. Old v8 can't work with null proto objects.
|
|
22495
|
-
// eslint-disable-next-line es
|
|
22517
|
+
// eslint-disable-next-line es/no-object-setprototypeof -- safe
|
|
22496
22518
|
var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
|
|
22497
22519
|
var CORRECT_SETTER = false;
|
|
22498
22520
|
var test = {};
|
|
22499
22521
|
var setter;
|
|
22500
22522
|
try {
|
|
22501
|
-
// eslint-disable-next-line es
|
|
22523
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
22502
22524
|
setter = functionUncurryThis(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
|
|
22503
22525
|
setter(test, []);
|
|
22504
22526
|
CORRECT_SETTER = test instanceof Array;
|
|
@@ -22535,7 +22557,7 @@ var TO_STRING_TAG$2 = wellKnownSymbol('toStringTag');
|
|
|
22535
22557
|
var TYPED_ARRAY_TAG = uid('TYPED_ARRAY_TAG');
|
|
22536
22558
|
var TYPED_ARRAY_CONSTRUCTOR = 'TypedArrayConstructor';
|
|
22537
22559
|
// Fixing native typed arrays in Opera Presto crashes the browser, see #595
|
|
22538
|
-
var NATIVE_ARRAY_BUFFER_VIEWS =
|
|
22560
|
+
var NATIVE_ARRAY_BUFFER_VIEWS = arrayBufferBasicDetection && !!objectSetPrototypeOf && classof(global_1.opera) !== 'Opera';
|
|
22539
22561
|
var TYPED_ARRAY_TAG_REQUIRED = false;
|
|
22540
22562
|
var NAME, Constructor, Prototype;
|
|
22541
22563
|
|
|
@@ -25639,7 +25661,7 @@ var fallbackValues$q = {
|
|
|
25639
25661
|
var SpinnerSvgAnimation = styled.svg.withConfig({
|
|
25640
25662
|
displayName: "Spinner__SpinnerSvgAnimation",
|
|
25641
25663
|
componentId: "sc-vhupl9-0"
|
|
25642
|
-
})(["animation:rotate 2s linear infinite;margin:-25px 0 0 -25px;width:", "px;height:", "px;& .path{stroke:", ";stroke-linecap:round;animation:dash 1.5s ease-in-out infinite;}@keyframes rotate{100%{transform:rotate(360deg);}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0;}50%{stroke-dasharray:90,150;stroke-dashoffset:-35;}100%{stroke-dasharray:90,150;stroke-dashoffset:-124;}}"
|
|
25664
|
+
})(["animation:rotate 2s linear infinite;margin:-25px 0 0 -25px;width:", "px;height:", "px;& .path{stroke:", ";stroke-linecap:round;animation:dash 1.5s ease-in-out infinite;}@keyframes rotate{100%{transform:rotate(360deg);}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0;}50%{stroke-dasharray:90,150;stroke-dashoffset:-35;}100%{stroke-dasharray:90,150;stroke-dashoffset:-124;}}"], function (_ref) {
|
|
25643
25665
|
var size = _ref.size;
|
|
25644
25666
|
return size;
|
|
25645
25667
|
}, function (_ref2) {
|
|
@@ -25648,36 +25670,19 @@ var SpinnerSvgAnimation = styled.svg.withConfig({
|
|
|
25648
25670
|
}, function (_ref3) {
|
|
25649
25671
|
var color = _ref3.color;
|
|
25650
25672
|
return color;
|
|
25651
|
-
}, function (_ref4) {
|
|
25652
|
-
var centerSpinner = _ref4.centerSpinner;
|
|
25653
|
-
return centerSpinner ? css(["margin:0;"]) : "";
|
|
25654
25673
|
});
|
|
25655
25674
|
var SpinnerContainer$2 = styled.div.withConfig({
|
|
25656
25675
|
displayName: "Spinner__SpinnerContainer",
|
|
25657
25676
|
componentId: "sc-vhupl9-1"
|
|
25658
|
-
})(["width:100%;display:flex;flex-direction:row;align-items:center;justify-content:center;line-height:1;"
|
|
25659
|
-
var centerSpinner = _ref5.centerSpinner,
|
|
25660
|
-
size = _ref5.size;
|
|
25661
|
-
return centerSpinner ? css(["width:", "px;height:", "px;"], size, size) : "";
|
|
25662
|
-
});
|
|
25663
|
-
/*
|
|
25664
|
-
`centerSpinner` prop alters existing styling of spinner to allow it to properly center itself within
|
|
25665
|
-
containers. Default is false to preserve legacy behavior for past uses.
|
|
25666
|
-
*/
|
|
25677
|
+
})(["width:100%;display:flex;flex-direction:row;align-items:center;justify-content:center;line-height:1;"]);
|
|
25667
25678
|
|
|
25668
|
-
var Spinner$1 = function Spinner(
|
|
25669
|
-
var
|
|
25670
|
-
size =
|
|
25671
|
-
|
|
25672
|
-
|
|
25673
|
-
themeValues = _ref6.themeValues;
|
|
25674
|
-
return /*#__PURE__*/React.createElement(SpinnerContainer$2, {
|
|
25675
|
-
centerSpinner: centerSpinner,
|
|
25676
|
-
size: size
|
|
25677
|
-
}, /*#__PURE__*/React.createElement(SpinnerSvgAnimation, {
|
|
25679
|
+
var Spinner$1 = function Spinner(_ref4) {
|
|
25680
|
+
var _ref4$size = _ref4.size,
|
|
25681
|
+
size = _ref4$size === void 0 ? "24" : _ref4$size,
|
|
25682
|
+
themeValues = _ref4.themeValues;
|
|
25683
|
+
return /*#__PURE__*/React.createElement(SpinnerContainer$2, null, /*#__PURE__*/React.createElement(SpinnerSvgAnimation, {
|
|
25678
25684
|
size: size,
|
|
25679
|
-
color: themeValues.color
|
|
25680
|
-
centerSpinner: centerSpinner
|
|
25685
|
+
color: themeValues.color
|
|
25681
25686
|
}, /*#__PURE__*/React.createElement("circle", {
|
|
25682
25687
|
className: "path",
|
|
25683
25688
|
cx: "50",
|
|
@@ -37541,49 +37546,624 @@ var TableHeading_styled = styled.th.withConfig({
|
|
|
37541
37546
|
return extraStyles;
|
|
37542
37547
|
});
|
|
37543
37548
|
|
|
37544
|
-
|
|
37545
|
-
value
|
|
37546
|
-
|
|
37547
|
-
|
|
37549
|
+
var validatorToPredicate = function validatorToPredicate(validatorFn, emptyCase) {
|
|
37550
|
+
return function (value) {
|
|
37551
|
+
for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
37552
|
+
rest[_key - 1] = arguments[_key];
|
|
37553
|
+
}
|
|
37554
|
+
|
|
37555
|
+
return value === "" ? emptyCase : validatorFn.apply(void 0, [value].concat(rest));
|
|
37556
|
+
};
|
|
37557
|
+
};
|
|
37548
37558
|
|
|
37549
37559
|
var commonjsGlobal$1 = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
37550
37560
|
|
|
37551
|
-
|
|
37561
|
+
function getDefaultExportFromCjs(x) {
|
|
37562
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
37563
|
+
}
|
|
37564
|
+
|
|
37565
|
+
var dayjs_min = {
|
|
37566
|
+
exports: {}
|
|
37567
|
+
};
|
|
37552
37568
|
|
|
37553
37569
|
(function (module, exports) {
|
|
37554
|
-
!function
|
|
37555
|
-
|
|
37570
|
+
!function (t, e) {
|
|
37571
|
+
module.exports = e();
|
|
37572
|
+
}(commonjsGlobal$1, function () {
|
|
37573
|
+
var t = 1e3,
|
|
37574
|
+
e = 6e4,
|
|
37575
|
+
n = 36e5,
|
|
37576
|
+
r = "millisecond",
|
|
37577
|
+
i = "second",
|
|
37578
|
+
s = "minute",
|
|
37579
|
+
u = "hour",
|
|
37580
|
+
a = "day",
|
|
37581
|
+
o = "week",
|
|
37582
|
+
f = "month",
|
|
37583
|
+
h = "quarter",
|
|
37584
|
+
c = "year",
|
|
37585
|
+
d = "date",
|
|
37586
|
+
$ = "Invalid Date",
|
|
37587
|
+
l = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,
|
|
37588
|
+
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,
|
|
37589
|
+
M = {
|
|
37590
|
+
name: "en",
|
|
37591
|
+
weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),
|
|
37592
|
+
months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_")
|
|
37593
|
+
},
|
|
37594
|
+
m = function m(t, e, n) {
|
|
37595
|
+
var r = String(t);
|
|
37596
|
+
return !r || r.length >= e ? t : "" + Array(e + 1 - r.length).join(n) + t;
|
|
37597
|
+
},
|
|
37598
|
+
g = {
|
|
37599
|
+
s: m,
|
|
37600
|
+
z: function z(t) {
|
|
37601
|
+
var e = -t.utcOffset(),
|
|
37602
|
+
n = Math.abs(e),
|
|
37603
|
+
r = Math.floor(n / 60),
|
|
37604
|
+
i = n % 60;
|
|
37605
|
+
return (e <= 0 ? "+" : "-") + m(r, 2, "0") + ":" + m(i, 2, "0");
|
|
37606
|
+
},
|
|
37607
|
+
m: function t(e, n) {
|
|
37608
|
+
if (e.date() < n.date()) return -t(n, e);
|
|
37609
|
+
var r = 12 * (n.year() - e.year()) + (n.month() - e.month()),
|
|
37610
|
+
i = e.clone().add(r, f),
|
|
37611
|
+
s = n - i < 0,
|
|
37612
|
+
u = e.clone().add(r + (s ? -1 : 1), f);
|
|
37613
|
+
return +(-(r + (n - i) / (s ? i - u : u - i)) || 0);
|
|
37614
|
+
},
|
|
37615
|
+
a: function a(t) {
|
|
37616
|
+
return t < 0 ? Math.ceil(t) || 0 : Math.floor(t);
|
|
37617
|
+
},
|
|
37618
|
+
p: function p(t) {
|
|
37619
|
+
return {
|
|
37620
|
+
M: f,
|
|
37621
|
+
y: c,
|
|
37622
|
+
w: o,
|
|
37623
|
+
d: a,
|
|
37624
|
+
D: d,
|
|
37625
|
+
h: u,
|
|
37626
|
+
m: s,
|
|
37627
|
+
s: i,
|
|
37628
|
+
ms: r,
|
|
37629
|
+
Q: h
|
|
37630
|
+
}[t] || String(t || "").toLowerCase().replace(/s$/, "");
|
|
37631
|
+
},
|
|
37632
|
+
u: function u(t) {
|
|
37633
|
+
return void 0 === t;
|
|
37634
|
+
}
|
|
37635
|
+
},
|
|
37636
|
+
D = "en",
|
|
37637
|
+
v = {};
|
|
37556
37638
|
|
|
37557
|
-
|
|
37639
|
+
v[D] = M;
|
|
37558
37640
|
|
|
37559
|
-
var
|
|
37641
|
+
var p = function p(t) {
|
|
37642
|
+
return t instanceof _;
|
|
37643
|
+
},
|
|
37644
|
+
S = function S(t, e, n) {
|
|
37645
|
+
var r;
|
|
37646
|
+
if (!t) return D;
|
|
37647
|
+
if ("string" == typeof t) v[t] && (r = t), e && (v[t] = e, r = t);else {
|
|
37648
|
+
var i = t.name;
|
|
37649
|
+
v[i] = t, r = i;
|
|
37650
|
+
}
|
|
37651
|
+
return !n && r && (D = r), r || !n && D;
|
|
37652
|
+
},
|
|
37653
|
+
w = function w(t, e) {
|
|
37654
|
+
if (p(t)) return t.clone();
|
|
37655
|
+
var n = "object" == _typeof(e) ? e : {};
|
|
37656
|
+
return n.date = t, n.args = arguments, new _(n);
|
|
37657
|
+
},
|
|
37658
|
+
O = g;
|
|
37659
|
+
|
|
37660
|
+
O.l = S, O.i = p, O.w = function (t, e) {
|
|
37661
|
+
return w(t, {
|
|
37662
|
+
locale: e.$L,
|
|
37663
|
+
utc: e.$u,
|
|
37664
|
+
x: e.$x,
|
|
37665
|
+
$offset: e.$offset
|
|
37666
|
+
});
|
|
37667
|
+
};
|
|
37560
37668
|
|
|
37561
|
-
|
|
37562
|
-
|
|
37563
|
-
|
|
37669
|
+
var _ = function () {
|
|
37670
|
+
function M(t) {
|
|
37671
|
+
this.$L = S(t.locale, null, !0), this.parse(t);
|
|
37672
|
+
}
|
|
37673
|
+
|
|
37674
|
+
var m = M.prototype;
|
|
37675
|
+
return m.parse = function (t) {
|
|
37676
|
+
this.$d = function (t) {
|
|
37677
|
+
var e = t.date,
|
|
37678
|
+
n = t.utc;
|
|
37679
|
+
if (null === e) return new Date(NaN);
|
|
37680
|
+
if (O.u(e)) return new Date();
|
|
37681
|
+
if (e instanceof Date) return new Date(e);
|
|
37682
|
+
|
|
37683
|
+
if ("string" == typeof e && !/Z$/i.test(e)) {
|
|
37684
|
+
var r = e.match(l);
|
|
37685
|
+
|
|
37686
|
+
if (r) {
|
|
37687
|
+
var i = r[2] - 1 || 0,
|
|
37688
|
+
s = (r[7] || "0").substring(0, 3);
|
|
37689
|
+
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);
|
|
37690
|
+
}
|
|
37691
|
+
}
|
|
37692
|
+
|
|
37693
|
+
return new Date(e);
|
|
37694
|
+
}(t), this.$x = t.x || {}, this.init();
|
|
37695
|
+
}, m.init = function () {
|
|
37696
|
+
var t = this.$d;
|
|
37697
|
+
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();
|
|
37698
|
+
}, m.$utils = function () {
|
|
37699
|
+
return O;
|
|
37700
|
+
}, m.isValid = function () {
|
|
37701
|
+
return !(this.$d.toString() === $);
|
|
37702
|
+
}, m.isSame = function (t, e) {
|
|
37703
|
+
var n = w(t);
|
|
37704
|
+
return this.startOf(e) <= n && n <= this.endOf(e);
|
|
37705
|
+
}, m.isAfter = function (t, e) {
|
|
37706
|
+
return w(t) < this.startOf(e);
|
|
37707
|
+
}, m.isBefore = function (t, e) {
|
|
37708
|
+
return this.endOf(e) < w(t);
|
|
37709
|
+
}, m.$g = function (t, e, n) {
|
|
37710
|
+
return O.u(t) ? this[e] : this.set(n, t);
|
|
37711
|
+
}, m.unix = function () {
|
|
37712
|
+
return Math.floor(this.valueOf() / 1e3);
|
|
37713
|
+
}, m.valueOf = function () {
|
|
37714
|
+
return this.$d.getTime();
|
|
37715
|
+
}, m.startOf = function (t, e) {
|
|
37716
|
+
var n = this,
|
|
37717
|
+
r = !!O.u(e) || e,
|
|
37718
|
+
h = O.p(t),
|
|
37719
|
+
$ = function $(t, e) {
|
|
37720
|
+
var i = O.w(n.$u ? Date.UTC(n.$y, e, t) : new Date(n.$y, e, t), n);
|
|
37721
|
+
return r ? i : i.endOf(a);
|
|
37722
|
+
},
|
|
37723
|
+
l = function l(t, e) {
|
|
37724
|
+
return O.w(n.toDate()[t].apply(n.toDate("s"), (r ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e)), n);
|
|
37725
|
+
},
|
|
37726
|
+
y = this.$W,
|
|
37727
|
+
M = this.$M,
|
|
37728
|
+
m = this.$D,
|
|
37729
|
+
g = "set" + (this.$u ? "UTC" : "");
|
|
37730
|
+
|
|
37731
|
+
switch (h) {
|
|
37732
|
+
case c:
|
|
37733
|
+
return r ? $(1, 0) : $(31, 11);
|
|
37734
|
+
|
|
37735
|
+
case f:
|
|
37736
|
+
return r ? $(1, M) : $(0, M + 1);
|
|
37737
|
+
|
|
37738
|
+
case o:
|
|
37739
|
+
var D = this.$locale().weekStart || 0,
|
|
37740
|
+
v = (y < D ? y + 7 : y) - D;
|
|
37741
|
+
return $(r ? m - v : m + (6 - v), M);
|
|
37742
|
+
|
|
37743
|
+
case a:
|
|
37744
|
+
case d:
|
|
37745
|
+
return l(g + "Hours", 0);
|
|
37746
|
+
|
|
37747
|
+
case u:
|
|
37748
|
+
return l(g + "Minutes", 1);
|
|
37749
|
+
|
|
37750
|
+
case s:
|
|
37751
|
+
return l(g + "Seconds", 2);
|
|
37752
|
+
|
|
37753
|
+
case i:
|
|
37754
|
+
return l(g + "Milliseconds", 3);
|
|
37755
|
+
|
|
37756
|
+
default:
|
|
37757
|
+
return this.clone();
|
|
37758
|
+
}
|
|
37759
|
+
}, m.endOf = function (t) {
|
|
37760
|
+
return this.startOf(t, !1);
|
|
37761
|
+
}, m.$set = function (t, e) {
|
|
37762
|
+
var n,
|
|
37763
|
+
o = O.p(t),
|
|
37764
|
+
h = "set" + (this.$u ? "UTC" : ""),
|
|
37765
|
+
$ = (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],
|
|
37766
|
+
l = o === a ? this.$D + (e - this.$W) : e;
|
|
37767
|
+
|
|
37768
|
+
if (o === f || o === c) {
|
|
37769
|
+
var y = this.clone().set(d, 1);
|
|
37770
|
+
y.$d[$](l), y.init(), this.$d = y.set(d, Math.min(this.$D, y.daysInMonth())).$d;
|
|
37771
|
+
} else $ && this.$d[$](l);
|
|
37772
|
+
|
|
37773
|
+
return this.init(), this;
|
|
37774
|
+
}, m.set = function (t, e) {
|
|
37775
|
+
return this.clone().$set(t, e);
|
|
37776
|
+
}, m.get = function (t) {
|
|
37777
|
+
return this[O.p(t)]();
|
|
37778
|
+
}, m.add = function (r, h) {
|
|
37779
|
+
var d,
|
|
37780
|
+
$ = this;
|
|
37781
|
+
r = Number(r);
|
|
37782
|
+
|
|
37783
|
+
var l = O.p(h),
|
|
37784
|
+
y = function y(t) {
|
|
37785
|
+
var e = w($);
|
|
37786
|
+
return O.w(e.date(e.date() + Math.round(t * r)), $);
|
|
37787
|
+
};
|
|
37788
|
+
|
|
37789
|
+
if (l === f) return this.set(f, this.$M + r);
|
|
37790
|
+
if (l === c) return this.set(c, this.$y + r);
|
|
37791
|
+
if (l === a) return y(1);
|
|
37792
|
+
if (l === o) return y(7);
|
|
37793
|
+
var M = (d = {}, d[s] = e, d[u] = n, d[i] = t, d)[l] || 1,
|
|
37794
|
+
m = this.$d.getTime() + r * M;
|
|
37795
|
+
return O.w(m, this);
|
|
37796
|
+
}, m.subtract = function (t, e) {
|
|
37797
|
+
return this.add(-1 * t, e);
|
|
37798
|
+
}, m.format = function (t) {
|
|
37799
|
+
var e = this,
|
|
37800
|
+
n = this.$locale();
|
|
37801
|
+
if (!this.isValid()) return n.invalidDate || $;
|
|
37802
|
+
|
|
37803
|
+
var r = t || "YYYY-MM-DDTHH:mm:ssZ",
|
|
37804
|
+
i = O.z(this),
|
|
37805
|
+
s = this.$H,
|
|
37806
|
+
u = this.$m,
|
|
37807
|
+
a = this.$M,
|
|
37808
|
+
o = n.weekdays,
|
|
37809
|
+
f = n.months,
|
|
37810
|
+
h = function h(t, n, i, s) {
|
|
37811
|
+
return t && (t[n] || t(e, r)) || i[n].substr(0, s);
|
|
37812
|
+
},
|
|
37813
|
+
c = function c(t) {
|
|
37814
|
+
return O.s(s % 12 || 12, t, "0");
|
|
37815
|
+
},
|
|
37816
|
+
d = n.meridiem || function (t, e, n) {
|
|
37817
|
+
var r = t < 12 ? "AM" : "PM";
|
|
37818
|
+
return n ? r.toLowerCase() : r;
|
|
37819
|
+
},
|
|
37820
|
+
l = {
|
|
37821
|
+
YY: String(this.$y).slice(-2),
|
|
37822
|
+
YYYY: this.$y,
|
|
37823
|
+
M: a + 1,
|
|
37824
|
+
MM: O.s(a + 1, 2, "0"),
|
|
37825
|
+
MMM: h(n.monthsShort, a, f, 3),
|
|
37826
|
+
MMMM: h(f, a),
|
|
37827
|
+
D: this.$D,
|
|
37828
|
+
DD: O.s(this.$D, 2, "0"),
|
|
37829
|
+
d: String(this.$W),
|
|
37830
|
+
dd: h(n.weekdaysMin, this.$W, o, 2),
|
|
37831
|
+
ddd: h(n.weekdaysShort, this.$W, o, 3),
|
|
37832
|
+
dddd: o[this.$W],
|
|
37833
|
+
H: String(s),
|
|
37834
|
+
HH: O.s(s, 2, "0"),
|
|
37835
|
+
h: c(1),
|
|
37836
|
+
hh: c(2),
|
|
37837
|
+
a: d(s, u, !0),
|
|
37838
|
+
A: d(s, u, !1),
|
|
37839
|
+
m: String(u),
|
|
37840
|
+
mm: O.s(u, 2, "0"),
|
|
37841
|
+
s: String(this.$s),
|
|
37842
|
+
ss: O.s(this.$s, 2, "0"),
|
|
37843
|
+
SSS: O.s(this.$ms, 3, "0"),
|
|
37844
|
+
Z: i
|
|
37845
|
+
};
|
|
37564
37846
|
|
|
37565
|
-
|
|
37847
|
+
return r.replace(y, function (t, e) {
|
|
37848
|
+
return e || l[t] || i.replace(":", "");
|
|
37849
|
+
});
|
|
37850
|
+
}, m.utcOffset = function () {
|
|
37851
|
+
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
37852
|
+
}, m.diff = function (r, d, $) {
|
|
37853
|
+
var l,
|
|
37854
|
+
y = O.p(d),
|
|
37855
|
+
M = w(r),
|
|
37856
|
+
m = (M.utcOffset() - this.utcOffset()) * e,
|
|
37857
|
+
g = this - M,
|
|
37858
|
+
D = O.m(this, M);
|
|
37859
|
+
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);
|
|
37860
|
+
}, m.daysInMonth = function () {
|
|
37861
|
+
return this.endOf(f).$D;
|
|
37862
|
+
}, m.$locale = function () {
|
|
37863
|
+
return v[this.$L];
|
|
37864
|
+
}, m.locale = function (t, e) {
|
|
37865
|
+
if (!t) return this.$L;
|
|
37866
|
+
var n = this.clone(),
|
|
37867
|
+
r = S(t, e, !0);
|
|
37868
|
+
return r && (n.$L = r), n;
|
|
37869
|
+
}, m.clone = function () {
|
|
37870
|
+
return O.w(this.$d, this);
|
|
37871
|
+
}, m.toDate = function () {
|
|
37872
|
+
return new Date(this.valueOf());
|
|
37873
|
+
}, m.toJSON = function () {
|
|
37874
|
+
return this.isValid() ? this.toISOString() : null;
|
|
37875
|
+
}, m.toISOString = function () {
|
|
37876
|
+
return this.$d.toISOString();
|
|
37877
|
+
}, m.toString = function () {
|
|
37878
|
+
return this.$d.toUTCString();
|
|
37879
|
+
}, M;
|
|
37880
|
+
}(),
|
|
37881
|
+
b = _.prototype;
|
|
37882
|
+
|
|
37883
|
+
return w.prototype = b, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", f], ["$y", c], ["$D", d]].forEach(function (t) {
|
|
37884
|
+
b[t[1]] = function (e) {
|
|
37885
|
+
return this.$g(e, t[0], t[1]);
|
|
37886
|
+
};
|
|
37887
|
+
}), w.extend = function (t, e) {
|
|
37888
|
+
return t.$i || (t(e, _, w), t.$i = !0), w;
|
|
37889
|
+
}, w.locale = S, w.isDayjs = p, w.unix = function (t) {
|
|
37890
|
+
return w(1e3 * t);
|
|
37891
|
+
}, w.en = v[D], w.Ls = v, w.p = {}, w;
|
|
37892
|
+
});
|
|
37893
|
+
})(dayjs_min);
|
|
37566
37894
|
|
|
37567
|
-
var
|
|
37895
|
+
var dayjs_minExports = dayjs_min.exports;
|
|
37896
|
+
var dayjs = /*@__PURE__*/getDefaultExportFromCjs(dayjs_minExports);
|
|
37897
|
+
var customParseFormat$1 = {
|
|
37898
|
+
exports: {}
|
|
37899
|
+
};
|
|
37568
37900
|
|
|
37569
37901
|
(function (module, exports) {
|
|
37570
|
-
!function(
|
|
37571
|
-
|
|
37902
|
+
!function (t, e) {
|
|
37903
|
+
module.exports = e();
|
|
37904
|
+
}(commonjsGlobal$1, function () {
|
|
37905
|
+
var t = {
|
|
37906
|
+
LTS: "h:mm:ss A",
|
|
37907
|
+
LT: "h:mm A",
|
|
37908
|
+
L: "MM/DD/YYYY",
|
|
37909
|
+
LL: "MMMM D, YYYY",
|
|
37910
|
+
LLL: "MMMM D, YYYY h:mm A",
|
|
37911
|
+
LLLL: "dddd, MMMM D, YYYY h:mm A"
|
|
37912
|
+
},
|
|
37913
|
+
e = /(\[[^[]*\])|([-:/.()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,
|
|
37914
|
+
n = /\d\d/,
|
|
37915
|
+
r = /\d\d?/,
|
|
37916
|
+
i = /\d*[^\s\d-_:/()]+/,
|
|
37917
|
+
o = {},
|
|
37918
|
+
s = function s(t) {
|
|
37919
|
+
return (t = +t) + (t > 68 ? 1900 : 2e3);
|
|
37920
|
+
};
|
|
37572
37921
|
|
|
37573
|
-
var
|
|
37922
|
+
var a = function a(t) {
|
|
37923
|
+
return function (e) {
|
|
37924
|
+
this[t] = +e;
|
|
37925
|
+
};
|
|
37926
|
+
},
|
|
37927
|
+
f = [/[+-]\d\d:?(\d\d)?|Z/, function (t) {
|
|
37928
|
+
(this.zone || (this.zone = {})).offset = function (t) {
|
|
37929
|
+
if (!t) return 0;
|
|
37930
|
+
if ("Z" === t) return 0;
|
|
37931
|
+
var e = t.match(/([+-]|\d\d)/g),
|
|
37932
|
+
n = 60 * e[1] + (+e[2] || 0);
|
|
37933
|
+
return 0 === n ? 0 : "+" === e[0] ? -n : n;
|
|
37934
|
+
}(t);
|
|
37935
|
+
}],
|
|
37936
|
+
u = function u(t) {
|
|
37937
|
+
var e = o[t];
|
|
37938
|
+
return e && (e.indexOf ? e : e.s.concat(e.f));
|
|
37939
|
+
},
|
|
37940
|
+
h = function h(t, e) {
|
|
37941
|
+
var n,
|
|
37942
|
+
r = o.meridiem;
|
|
37943
|
+
|
|
37944
|
+
if (r) {
|
|
37945
|
+
for (var i = 1; i <= 24; i += 1) {
|
|
37946
|
+
if (t.indexOf(r(i, 0, e)) > -1) {
|
|
37947
|
+
n = i > 12;
|
|
37948
|
+
break;
|
|
37949
|
+
}
|
|
37950
|
+
}
|
|
37951
|
+
} else n = t === (e ? "pm" : "PM");
|
|
37952
|
+
|
|
37953
|
+
return n;
|
|
37954
|
+
},
|
|
37955
|
+
d = {
|
|
37956
|
+
A: [i, function (t) {
|
|
37957
|
+
this.afternoon = h(t, !1);
|
|
37958
|
+
}],
|
|
37959
|
+
a: [i, function (t) {
|
|
37960
|
+
this.afternoon = h(t, !0);
|
|
37961
|
+
}],
|
|
37962
|
+
S: [/\d/, function (t) {
|
|
37963
|
+
this.milliseconds = 100 * +t;
|
|
37964
|
+
}],
|
|
37965
|
+
SS: [n, function (t) {
|
|
37966
|
+
this.milliseconds = 10 * +t;
|
|
37967
|
+
}],
|
|
37968
|
+
SSS: [/\d{3}/, function (t) {
|
|
37969
|
+
this.milliseconds = +t;
|
|
37970
|
+
}],
|
|
37971
|
+
s: [r, a("seconds")],
|
|
37972
|
+
ss: [r, a("seconds")],
|
|
37973
|
+
m: [r, a("minutes")],
|
|
37974
|
+
mm: [r, a("minutes")],
|
|
37975
|
+
H: [r, a("hours")],
|
|
37976
|
+
h: [r, a("hours")],
|
|
37977
|
+
HH: [r, a("hours")],
|
|
37978
|
+
hh: [r, a("hours")],
|
|
37979
|
+
D: [r, a("day")],
|
|
37980
|
+
DD: [n, a("day")],
|
|
37981
|
+
Do: [i, function (t) {
|
|
37982
|
+
var e = o.ordinal,
|
|
37983
|
+
n = t.match(/\d+/);
|
|
37984
|
+
if (this.day = n[0], e) for (var r = 1; r <= 31; r += 1) {
|
|
37985
|
+
e(r).replace(/\[|\]/g, "") === t && (this.day = r);
|
|
37986
|
+
}
|
|
37987
|
+
}],
|
|
37988
|
+
M: [r, a("month")],
|
|
37989
|
+
MM: [n, a("month")],
|
|
37990
|
+
MMM: [i, function (t) {
|
|
37991
|
+
var e = u("months"),
|
|
37992
|
+
n = (u("monthsShort") || e.map(function (t) {
|
|
37993
|
+
return t.substr(0, 3);
|
|
37994
|
+
})).indexOf(t) + 1;
|
|
37995
|
+
if (n < 1) throw new Error();
|
|
37996
|
+
this.month = n % 12 || n;
|
|
37997
|
+
}],
|
|
37998
|
+
MMMM: [i, function (t) {
|
|
37999
|
+
var e = u("months").indexOf(t) + 1;
|
|
38000
|
+
if (e < 1) throw new Error();
|
|
38001
|
+
this.month = e % 12 || e;
|
|
38002
|
+
}],
|
|
38003
|
+
Y: [/[+-]?\d+/, a("year")],
|
|
38004
|
+
YY: [n, function (t) {
|
|
38005
|
+
this.year = s(t);
|
|
38006
|
+
}],
|
|
38007
|
+
YYYY: [/\d{4}/, a("year")],
|
|
38008
|
+
Z: f,
|
|
38009
|
+
ZZ: f
|
|
38010
|
+
};
|
|
37574
38011
|
|
|
37575
|
-
|
|
38012
|
+
function c(n) {
|
|
38013
|
+
var r, i;
|
|
38014
|
+
r = n, i = o && o.formats;
|
|
38015
|
+
|
|
38016
|
+
for (var s = (n = r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function (e, n, r) {
|
|
38017
|
+
var o = r && r.toUpperCase();
|
|
38018
|
+
return n || i[r] || t[r] || i[o].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function (t, e, n) {
|
|
38019
|
+
return e || n.slice(1);
|
|
38020
|
+
});
|
|
38021
|
+
})).match(e), a = s.length, f = 0; f < a; f += 1) {
|
|
38022
|
+
var u = s[f],
|
|
38023
|
+
h = d[u],
|
|
38024
|
+
c = h && h[0],
|
|
38025
|
+
l = h && h[1];
|
|
38026
|
+
s[f] = l ? {
|
|
38027
|
+
regex: c,
|
|
38028
|
+
parser: l
|
|
38029
|
+
} : u.replace(/^\[|\]$/g, "");
|
|
38030
|
+
}
|
|
38031
|
+
|
|
38032
|
+
return function (t) {
|
|
38033
|
+
for (var e = {}, n = 0, r = 0; n < a; n += 1) {
|
|
38034
|
+
var i = s[n];
|
|
38035
|
+
if ("string" == typeof i) r += i.length;else {
|
|
38036
|
+
var o = i.regex,
|
|
38037
|
+
f = i.parser,
|
|
38038
|
+
u = t.substr(r),
|
|
38039
|
+
h = o.exec(u)[0];
|
|
38040
|
+
f.call(e, h), t = t.replace(h, "");
|
|
38041
|
+
}
|
|
38042
|
+
}
|
|
38043
|
+
|
|
38044
|
+
return function (t) {
|
|
38045
|
+
var e = t.afternoon;
|
|
38046
|
+
|
|
38047
|
+
if (void 0 !== e) {
|
|
38048
|
+
var n = t.hours;
|
|
38049
|
+
e ? n < 12 && (t.hours += 12) : 12 === n && (t.hours = 0), delete t.afternoon;
|
|
38050
|
+
}
|
|
38051
|
+
}(e), e;
|
|
38052
|
+
};
|
|
38053
|
+
}
|
|
38054
|
+
|
|
38055
|
+
return function (t, e, n) {
|
|
38056
|
+
n.p.customParseFormat = !0, t && t.parseTwoDigitYear && (s = t.parseTwoDigitYear);
|
|
38057
|
+
var r = e.prototype,
|
|
38058
|
+
i = r.parse;
|
|
38059
|
+
|
|
38060
|
+
r.parse = function (t) {
|
|
38061
|
+
var e = t.date,
|
|
38062
|
+
r = t.utc,
|
|
38063
|
+
s = t.args;
|
|
38064
|
+
this.$u = r;
|
|
38065
|
+
var a = s[1];
|
|
38066
|
+
|
|
38067
|
+
if ("string" == typeof a) {
|
|
38068
|
+
var f = !0 === s[2],
|
|
38069
|
+
u = !0 === s[3],
|
|
38070
|
+
h = f || u,
|
|
38071
|
+
d = s[2];
|
|
38072
|
+
u && (d = s[2]), o = this.$locale(), !f && d && (o = n.Ls[d]), this.$d = function (t, e, n) {
|
|
38073
|
+
try {
|
|
38074
|
+
if (["x", "X"].indexOf(e) > -1) return new Date(("X" === e ? 1e3 : 1) * t);
|
|
38075
|
+
var r = c(e)(t),
|
|
38076
|
+
i = r.year,
|
|
38077
|
+
o = r.month,
|
|
38078
|
+
s = r.day,
|
|
38079
|
+
a = r.hours,
|
|
38080
|
+
f = r.minutes,
|
|
38081
|
+
u = r.seconds,
|
|
38082
|
+
h = r.milliseconds,
|
|
38083
|
+
d = r.zone,
|
|
38084
|
+
l = new Date(),
|
|
38085
|
+
m = s || (i || o ? 1 : l.getDate()),
|
|
38086
|
+
M = i || l.getFullYear(),
|
|
38087
|
+
Y = 0;
|
|
38088
|
+
i && !o || (Y = o > 0 ? o - 1 : l.getMonth());
|
|
38089
|
+
var p = a || 0,
|
|
38090
|
+
v = f || 0,
|
|
38091
|
+
D = u || 0,
|
|
38092
|
+
g = h || 0;
|
|
38093
|
+
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);
|
|
38094
|
+
} catch (t) {
|
|
38095
|
+
return new Date("");
|
|
38096
|
+
}
|
|
38097
|
+
}(e, a, r), this.init(), d && !0 !== d && (this.$L = this.locale(d).$L), h && e != this.format(a) && (this.$d = new Date("")), o = {};
|
|
38098
|
+
} else if (a instanceof Array) for (var l = a.length, m = 1; m <= l; m += 1) {
|
|
38099
|
+
s[1] = a[m - 1];
|
|
38100
|
+
var M = n.apply(this, s);
|
|
38101
|
+
|
|
38102
|
+
if (M.isValid()) {
|
|
38103
|
+
this.$d = M.$d, this.$L = M.$L, this.init();
|
|
38104
|
+
break;
|
|
38105
|
+
}
|
|
38106
|
+
|
|
38107
|
+
m === l && (this.$d = new Date(""));
|
|
38108
|
+
} else i.call(this, t);
|
|
38109
|
+
};
|
|
38110
|
+
};
|
|
38111
|
+
});
|
|
38112
|
+
})(customParseFormat$1);
|
|
38113
|
+
|
|
38114
|
+
var customParseFormatExports = customParseFormat$1.exports;
|
|
38115
|
+
var customParseFormat = /*@__PURE__*/getDefaultExportFromCjs(customParseFormatExports);
|
|
38116
|
+
var isSameOrBefore$1 = {
|
|
38117
|
+
exports: {}
|
|
38118
|
+
};
|
|
37576
38119
|
|
|
37577
38120
|
(function (module, exports) {
|
|
37578
|
-
!function(e,
|
|
37579
|
-
|
|
38121
|
+
!function (e, i) {
|
|
38122
|
+
module.exports = i();
|
|
38123
|
+
}(commonjsGlobal$1, function () {
|
|
38124
|
+
return function (e, i) {
|
|
38125
|
+
i.prototype.isSameOrBefore = function (e, i) {
|
|
38126
|
+
return this.isSame(e, i) || this.isBefore(e, i);
|
|
38127
|
+
};
|
|
38128
|
+
};
|
|
38129
|
+
});
|
|
38130
|
+
})(isSameOrBefore$1);
|
|
37580
38131
|
|
|
37581
|
-
var
|
|
38132
|
+
var isSameOrBeforeExports = isSameOrBefore$1.exports;
|
|
38133
|
+
var isSameOrBefore = /*@__PURE__*/getDefaultExportFromCjs(isSameOrBeforeExports);
|
|
38134
|
+
var isSameOrAfter$1 = {
|
|
38135
|
+
exports: {}
|
|
38136
|
+
};
|
|
38137
|
+
|
|
38138
|
+
(function (module, exports) {
|
|
38139
|
+
!function (e, t) {
|
|
38140
|
+
module.exports = t();
|
|
38141
|
+
}(commonjsGlobal$1, function () {
|
|
38142
|
+
return function (e, t) {
|
|
38143
|
+
t.prototype.isSameOrAfter = function (e, t) {
|
|
38144
|
+
return this.isSame(e, t) || this.isAfter(e, t);
|
|
38145
|
+
};
|
|
38146
|
+
};
|
|
38147
|
+
});
|
|
38148
|
+
})(isSameOrAfter$1);
|
|
37582
38149
|
|
|
38150
|
+
var isSameOrAfterExports = isSameOrAfter$1.exports;
|
|
38151
|
+
var isSameOrAfter = /*@__PURE__*/getDefaultExportFromCjs(isSameOrAfterExports);
|
|
37583
38152
|
/* eslint-disable no-unused-vars */
|
|
37584
38153
|
|
|
37585
|
-
|
|
37586
|
-
|
|
38154
|
+
var createValidator = function createValidator(type, error) {
|
|
38155
|
+
var validator = function validator() {
|
|
38156
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
38157
|
+
args[_key2] = arguments[_key2];
|
|
38158
|
+
}
|
|
38159
|
+
|
|
38160
|
+
return {
|
|
38161
|
+
type: type,
|
|
38162
|
+
args: args,
|
|
38163
|
+
error: error
|
|
38164
|
+
};
|
|
38165
|
+
};
|
|
38166
|
+
|
|
37587
38167
|
validator.error = error;
|
|
37588
38168
|
return validator;
|
|
37589
38169
|
};
|
|
@@ -37591,30 +38171,38 @@ const createValidator = (type, error) => {
|
|
|
37591
38171
|
dayjs.extend(customParseFormat);
|
|
37592
38172
|
dayjs.extend(isSameOrBefore);
|
|
37593
38173
|
dayjs.extend(isSameOrAfter);
|
|
38174
|
+
var validatorFns = {};
|
|
38175
|
+
var INCLUDED_IN = "validator/INCLUDED_IN";
|
|
38176
|
+
var INCLUDED_IN_ERROR = "error/INCLUDED_IN";
|
|
38177
|
+
var includedIn = createValidator(INCLUDED_IN, INCLUDED_IN_ERROR);
|
|
37594
38178
|
|
|
37595
|
-
|
|
38179
|
+
validatorFns[INCLUDED_IN] = function (value, args, form) {
|
|
38180
|
+
return Array.isArray(args[0]) ? args[0].includes(value) : args[0] === value;
|
|
38181
|
+
};
|
|
37596
38182
|
|
|
37597
|
-
|
|
37598
|
-
|
|
37599
|
-
|
|
37600
|
-
validatorFns[INCLUDED_IN] = (value, args, form) =>
|
|
37601
|
-
Array.isArray(args[0]) ? args[0].includes(value) : args[0] === value;
|
|
38183
|
+
var REQUIRED = "validator/REQUIRED";
|
|
38184
|
+
var REQUIRED_ERROR = "error/REQUIRED";
|
|
38185
|
+
var required = createValidator(REQUIRED, REQUIRED_ERROR);
|
|
37602
38186
|
|
|
37603
|
-
|
|
37604
|
-
|
|
37605
|
-
|
|
37606
|
-
validatorFns[REQUIRED] = (value, args, form) => value !== "";
|
|
38187
|
+
validatorFns[REQUIRED] = function (value, args, form) {
|
|
38188
|
+
return value !== "";
|
|
38189
|
+
};
|
|
37607
38190
|
|
|
37608
|
-
|
|
37609
|
-
|
|
37610
|
-
|
|
37611
|
-
validatorFns[ONLY_INTEGERS] = (value, args, form) => /^(-?\d+)?$/.test(value);
|
|
38191
|
+
var ONLY_INTEGERS = "validator/ONLY_INTEGERS";
|
|
38192
|
+
var ONLY_INTEGERS_ERROR = "error/ONLY_INTEGERS";
|
|
38193
|
+
var onlyIntegers = createValidator(ONLY_INTEGERS, ONLY_INTEGERS_ERROR);
|
|
37612
38194
|
|
|
37613
|
-
|
|
37614
|
-
|
|
37615
|
-
|
|
37616
|
-
validatorFns[ONLY_NATURALS] = (value, args, form) => /^(\d+)?$/.test(value);
|
|
38195
|
+
validatorFns[ONLY_INTEGERS] = function (value, args, form) {
|
|
38196
|
+
return /^(-?\d+)?$/.test(value);
|
|
38197
|
+
};
|
|
37617
38198
|
|
|
38199
|
+
var ONLY_NATURALS = "validator/ONLY_NATURALS";
|
|
38200
|
+
var ONLY_NATURALS_ERROR = "error/ONLY_NATURALS";
|
|
38201
|
+
var onlyNaturals = createValidator(ONLY_NATURALS, ONLY_NATURALS_ERROR);
|
|
38202
|
+
|
|
38203
|
+
validatorFns[ONLY_NATURALS] = function (value, args, form) {
|
|
38204
|
+
return /^(\d+)?$/.test(value);
|
|
38205
|
+
};
|
|
37618
38206
|
/*
|
|
37619
38207
|
07/22: experimental expiration date constraint
|
|
37620
38208
|
should allow entry of expiration date using "/" character
|
|
@@ -37624,439 +38212,464 @@ not tested as validation function
|
|
|
37624
38212
|
to validate exp date instead use combo of:
|
|
37625
38213
|
required(), hasLength(), isValidMonth(), dateAfterToday()
|
|
37626
38214
|
*/
|
|
37627
|
-
|
|
37628
|
-
|
|
37629
|
-
|
|
37630
|
-
|
|
37631
|
-
|
|
37632
|
-
|
|
37633
|
-
validatorFns[ONLY_EXPIRATION_DATE] = (value, args, form)
|
|
37634
|
-
/^(\d?\d?\/?\d?\d?)?$/.test(value);
|
|
37635
|
-
|
|
37636
|
-
|
|
37637
|
-
|
|
37638
|
-
|
|
37639
|
-
|
|
37640
|
-
|
|
37641
|
-
)
|
|
37642
|
-
validatorFns[NUMBER_LESS_THAN] = (value, args, form) => {
|
|
38215
|
+
|
|
38216
|
+
|
|
38217
|
+
var ONLY_EXPIRATION_DATE = "validator/ONLY_EXPIRATION_DATE";
|
|
38218
|
+
var ONLY_EXPIRATION_DATE_ERROR = "error/ONLY_EXPIRATION_DATE";
|
|
38219
|
+
var onlyExpirationDate = createValidator(ONLY_EXPIRATION_DATE, ONLY_EXPIRATION_DATE_ERROR);
|
|
38220
|
+
|
|
38221
|
+
validatorFns[ONLY_EXPIRATION_DATE] = function (value, args, form) {
|
|
38222
|
+
return /^(\d?\d?\/?\d?\d?)?$/.test(value);
|
|
38223
|
+
};
|
|
38224
|
+
|
|
38225
|
+
var NUMBER_LESS_THAN = "validator/NUMBER_LESS_THAN";
|
|
38226
|
+
var NUMBER_LESS_THAN_ERROR = "error/NUMBER_LESS_THAN";
|
|
38227
|
+
var numberLessThan = createValidator(NUMBER_LESS_THAN, NUMBER_LESS_THAN_ERROR);
|
|
38228
|
+
|
|
38229
|
+
validatorFns[NUMBER_LESS_THAN] = function (value, args, form) {
|
|
37643
38230
|
if (value === "") {
|
|
37644
38231
|
return true;
|
|
37645
38232
|
}
|
|
38233
|
+
|
|
37646
38234
|
return Number(value) < args[0];
|
|
37647
38235
|
};
|
|
37648
38236
|
|
|
37649
|
-
|
|
37650
|
-
|
|
37651
|
-
|
|
37652
|
-
|
|
37653
|
-
|
|
37654
|
-
NUMBER_LESS_THAN_OR_EQUAL_TO,
|
|
37655
|
-
NUMBER_LESS_THAN_OR_EQUAL_TO_ERROR
|
|
37656
|
-
);
|
|
37657
|
-
validatorFns[NUMBER_LESS_THAN_OR_EQUAL_TO] = (value, args, form) => {
|
|
38237
|
+
var NUMBER_LESS_THAN_OR_EQUAL_TO = "validator/NUMBER_LESS_THAN_OR_EQUAL_TO";
|
|
38238
|
+
var NUMBER_LESS_THAN_OR_EQUAL_TO_ERROR = "error/NUMBER_LESS_THAN_OR_EQUAL_TO";
|
|
38239
|
+
var numberLessThanOrEqualTo = createValidator(NUMBER_LESS_THAN_OR_EQUAL_TO, NUMBER_LESS_THAN_OR_EQUAL_TO_ERROR);
|
|
38240
|
+
|
|
38241
|
+
validatorFns[NUMBER_LESS_THAN_OR_EQUAL_TO] = function (value, args, form) {
|
|
37658
38242
|
if (value === "") {
|
|
37659
38243
|
return true;
|
|
37660
38244
|
}
|
|
38245
|
+
|
|
37661
38246
|
return Number(value) <= args[0];
|
|
37662
38247
|
};
|
|
37663
38248
|
|
|
37664
|
-
|
|
37665
|
-
|
|
37666
|
-
|
|
37667
|
-
|
|
37668
|
-
|
|
37669
|
-
);
|
|
37670
|
-
validatorFns[NUMBER_GREATER_THAN] = (value, args, form) => {
|
|
38249
|
+
var NUMBER_GREATER_THAN = "validator/NUMBER_GREATER_THAN";
|
|
38250
|
+
var NUMBER_GREATER_THAN_ERROR = "error/NUMBER_GREATER_THAN";
|
|
38251
|
+
var numberGreaterThan = createValidator(NUMBER_GREATER_THAN, NUMBER_GREATER_THAN_ERROR);
|
|
38252
|
+
|
|
38253
|
+
validatorFns[NUMBER_GREATER_THAN] = function (value, args, form) {
|
|
37671
38254
|
if (value === "") {
|
|
37672
38255
|
return true;
|
|
37673
38256
|
}
|
|
38257
|
+
|
|
37674
38258
|
return Number(value) > args[0];
|
|
37675
38259
|
};
|
|
37676
38260
|
|
|
37677
|
-
|
|
37678
|
-
|
|
37679
|
-
|
|
37680
|
-
|
|
37681
|
-
|
|
37682
|
-
NUMBER_GREATER_THAN_OR_EQUAL_TO,
|
|
37683
|
-
NUMBER_GREATER_THAN_OR_EQUAL_TO_ERROR
|
|
37684
|
-
);
|
|
37685
|
-
validatorFns[NUMBER_GREATER_THAN_OR_EQUAL_TO] = (value, args, form) => {
|
|
38261
|
+
var NUMBER_GREATER_THAN_OR_EQUAL_TO = "validator/NUMBER_GREATER_THAN_OR_EQUAL_TO";
|
|
38262
|
+
var NUMBER_GREATER_THAN_OR_EQUAL_TO_ERROR = "error/NUMBER_GREATER_THAN_OR_EQUAL_TO";
|
|
38263
|
+
var numberGreaterThanOrEqualTo = createValidator(NUMBER_GREATER_THAN_OR_EQUAL_TO, NUMBER_GREATER_THAN_OR_EQUAL_TO_ERROR);
|
|
38264
|
+
|
|
38265
|
+
validatorFns[NUMBER_GREATER_THAN_OR_EQUAL_TO] = function (value, args, form) {
|
|
37686
38266
|
if (value === "") {
|
|
37687
38267
|
return true;
|
|
37688
38268
|
}
|
|
38269
|
+
|
|
37689
38270
|
return Number(value) >= args[0];
|
|
37690
38271
|
};
|
|
37691
38272
|
|
|
37692
|
-
|
|
37693
|
-
|
|
37694
|
-
|
|
37695
|
-
|
|
37696
|
-
|
|
38273
|
+
var MATCHES_FIELD = "validator/MATCHES_FIELD";
|
|
38274
|
+
var MATCHES_FIELD_ERROR$1 = "error/MATCHES_FIELD";
|
|
38275
|
+
var matchesField = createValidator(MATCHES_FIELD, MATCHES_FIELD_ERROR$1);
|
|
38276
|
+
|
|
38277
|
+
validatorFns[MATCHES_FIELD] = function (value, args, form) {
|
|
38278
|
+
var dependentField = form[args[0]];
|
|
38279
|
+
|
|
37697
38280
|
if (dependentField === undefined) {
|
|
37698
|
-
throw new Error(
|
|
37699
|
-
`${args[0]} was passed to matchesField, but that field does not exist in the form`
|
|
37700
|
-
);
|
|
38281
|
+
throw new Error("".concat(args[0], " was passed to matchesField, but that field does not exist in the form"));
|
|
37701
38282
|
}
|
|
37702
|
-
|
|
38283
|
+
|
|
38284
|
+
var dependentFieldValue = dependentField.rawValue;
|
|
37703
38285
|
return value === dependentFieldValue;
|
|
37704
38286
|
};
|
|
37705
38287
|
|
|
37706
|
-
|
|
37707
|
-
|
|
37708
|
-
|
|
37709
|
-
|
|
37710
|
-
|
|
37711
|
-
|
|
37712
|
-
|
|
37713
|
-
|
|
37714
|
-
|
|
37715
|
-
|
|
37716
|
-
|
|
37717
|
-
|
|
37718
|
-
|
|
37719
|
-
|
|
37720
|
-
|
|
37721
|
-
type: VALIDATE_WHEN,
|
|
37722
|
-
args: [dependentValidator, primaryValidator, optionalFieldName],
|
|
37723
|
-
error: dependentValidator.error
|
|
37724
|
-
});
|
|
38288
|
+
var validateWhenErrorMessage = function validateWhenErrorMessage(type) {
|
|
38289
|
+
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.");
|
|
38290
|
+
};
|
|
38291
|
+
|
|
38292
|
+
var VALIDATE_WHEN = "validator/VALIDATE_WHEN";
|
|
38293
|
+
var VALIDATE_WHEN_ERROR = "error/VALIDATE_WHEN";
|
|
38294
|
+
|
|
38295
|
+
var validateWhen = function validateWhen(dependentValidator, primaryValidator, optionalFieldName) {
|
|
38296
|
+
return {
|
|
38297
|
+
type: VALIDATE_WHEN,
|
|
38298
|
+
args: [dependentValidator, primaryValidator, optionalFieldName],
|
|
38299
|
+
error: dependentValidator.error
|
|
38300
|
+
};
|
|
38301
|
+
};
|
|
38302
|
+
|
|
37725
38303
|
validateWhen.error = VALIDATE_WHEN_ERROR;
|
|
37726
|
-
|
|
37727
|
-
|
|
37728
|
-
|
|
37729
|
-
|
|
37730
|
-
|
|
37731
|
-
|
|
37732
|
-
|
|
37733
|
-
|
|
38304
|
+
|
|
38305
|
+
validatorFns[VALIDATE_WHEN] = function (value, args, form) {
|
|
38306
|
+
var _args = _slicedToArray(args, 3),
|
|
38307
|
+
dependentValidator = _args[0],
|
|
38308
|
+
primaryValidator = _args[1],
|
|
38309
|
+
optionalFieldName = _args[2];
|
|
38310
|
+
|
|
38311
|
+
var dependsOnOtherField = typeof optionalFieldName === "string";
|
|
38312
|
+
|
|
38313
|
+
if (primaryValidator.type === undefined || typeof validatorFns[primaryValidator.type] !== "function") {
|
|
37734
38314
|
throw new Error(validateWhenErrorMessage(primaryValidator.type));
|
|
37735
38315
|
}
|
|
38316
|
+
|
|
37736
38317
|
if (dependsOnOtherField && form[optionalFieldName] === undefined) {
|
|
37737
|
-
throw new Error(
|
|
37738
|
-
`${args[2]} was passed to matchesField, but that field does not exist in the form`
|
|
37739
|
-
);
|
|
38318
|
+
throw new Error("".concat(args[2], " was passed to matchesField, but that field does not exist in the form"));
|
|
37740
38319
|
}
|
|
37741
38320
|
|
|
37742
|
-
|
|
37743
|
-
|
|
37744
|
-
|
|
37745
|
-
);
|
|
37746
|
-
|
|
37747
|
-
|
|
37748
|
-
|
|
37749
|
-
|
|
37750
|
-
|
|
37751
|
-
|
|
37752
|
-
|
|
37753
|
-
|
|
37754
|
-
|
|
37755
|
-
|
|
37756
|
-
|
|
37757
|
-
|
|
37758
|
-
|
|
37759
|
-
|
|
37760
|
-
|
|
37761
|
-
|
|
37762
|
-
|
|
37763
|
-
|
|
37764
|
-
const validateSumErrorMessage = type =>
|
|
37765
|
-
`${type} was passed to validateSum, but that validator type does not exist.
|
|
37766
|
-
Please check that you are only calling validator creator functions exported from
|
|
37767
|
-
redux-freeform in your form config and that you didn't forget to
|
|
37768
|
-
invoke the validator creator (you cannot pass the functions themselves to
|
|
37769
|
-
createFormState).`;
|
|
37770
|
-
const VALIDATE_SUM = "validator/VALIDATE_SUM";
|
|
37771
|
-
const VALIDATE_SUM_ERROR = "error/VALIDATE_SUM";
|
|
37772
|
-
const validateSum = (validator, fieldNamesArray) => ({
|
|
37773
|
-
type: VALIDATE_SUM,
|
|
37774
|
-
args: [validator, fieldNamesArray],
|
|
37775
|
-
error: validator.error
|
|
37776
|
-
});
|
|
38321
|
+
var primaryPredicate = validatorToPredicate(validatorFns[primaryValidator.type], false);
|
|
38322
|
+
var primaryValue = dependsOnOtherField ? form[optionalFieldName].rawValue : value;
|
|
38323
|
+
var primaryPredicatePassed = primaryPredicate(primaryValue, primaryValidator.args, form);
|
|
38324
|
+
return primaryPredicatePassed ? validatorFns[dependentValidator.type](value, dependentValidator.args, form) : true;
|
|
38325
|
+
};
|
|
38326
|
+
|
|
38327
|
+
var validateSumErrorMessage = function validateSumErrorMessage(type) {
|
|
38328
|
+
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).");
|
|
38329
|
+
};
|
|
38330
|
+
|
|
38331
|
+
var VALIDATE_SUM = "validator/VALIDATE_SUM";
|
|
38332
|
+
var VALIDATE_SUM_ERROR = "error/VALIDATE_SUM";
|
|
38333
|
+
|
|
38334
|
+
var validateSum = function validateSum(validator, fieldNamesArray) {
|
|
38335
|
+
return {
|
|
38336
|
+
type: VALIDATE_SUM,
|
|
38337
|
+
args: [validator, fieldNamesArray],
|
|
38338
|
+
error: validator.error
|
|
38339
|
+
};
|
|
38340
|
+
};
|
|
38341
|
+
|
|
37777
38342
|
validateSum.error = VALIDATE_SUM_ERROR;
|
|
37778
|
-
validatorFns[VALIDATE_SUM] = (value, args, form) => {
|
|
37779
|
-
const [validator, fieldNamesArray] = args;
|
|
37780
38343
|
|
|
37781
|
-
|
|
37782
|
-
|
|
37783
|
-
|
|
37784
|
-
|
|
38344
|
+
validatorFns[VALIDATE_SUM] = function (value, args, form) {
|
|
38345
|
+
var _args2 = _slicedToArray(args, 2),
|
|
38346
|
+
validator = _args2[0],
|
|
38347
|
+
fieldNamesArray = _args2[1];
|
|
38348
|
+
|
|
38349
|
+
if (validator.type === undefined || typeof validatorFns[validator.type] !== "function") {
|
|
37785
38350
|
throw new Error(validateSumErrorMessage(validator.type));
|
|
37786
38351
|
}
|
|
37787
38352
|
|
|
37788
|
-
|
|
37789
|
-
|
|
37790
|
-
|
|
37791
|
-
|
|
37792
|
-
|
|
38353
|
+
var _iterator = _createForOfIteratorHelper(fieldNamesArray),
|
|
38354
|
+
_step;
|
|
38355
|
+
|
|
38356
|
+
try {
|
|
38357
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
38358
|
+
var fieldName = _step.value;
|
|
38359
|
+
|
|
38360
|
+
if (form[fieldName] === undefined) {
|
|
38361
|
+
throw new Error("".concat(fieldName, " was passed to matchesField, but that field does not exist in the form"));
|
|
38362
|
+
}
|
|
37793
38363
|
}
|
|
38364
|
+
} catch (err) {
|
|
38365
|
+
_iterator.e(err);
|
|
38366
|
+
} finally {
|
|
38367
|
+
_iterator.f();
|
|
37794
38368
|
}
|
|
37795
38369
|
|
|
37796
|
-
|
|
37797
|
-
|
|
37798
|
-
|
|
37799
|
-
);
|
|
37800
|
-
|
|
38370
|
+
var sum = fieldNamesArray.reduce(function (acc, curr) {
|
|
38371
|
+
return acc + Number(form[curr].rawValue);
|
|
38372
|
+
}, Number(value));
|
|
37801
38373
|
return validatorFns[validator.type](sum, validator.args, form);
|
|
37802
38374
|
};
|
|
37803
38375
|
|
|
37804
|
-
|
|
37805
|
-
|
|
37806
|
-
|
|
37807
|
-
|
|
38376
|
+
var HAS_LENGTH = "validator/HAS_LENGTH";
|
|
38377
|
+
var HAS_LENGTH_ERROR = "error/HAS_LENGTH";
|
|
38378
|
+
var hasLength = createValidator(HAS_LENGTH, HAS_LENGTH_ERROR);
|
|
38379
|
+
|
|
38380
|
+
validatorFns[HAS_LENGTH] = function (value, args, form) {
|
|
37808
38381
|
if (value === "") {
|
|
37809
38382
|
return true;
|
|
37810
38383
|
}
|
|
37811
|
-
|
|
37812
|
-
|
|
38384
|
+
|
|
38385
|
+
var min = args[0];
|
|
38386
|
+
var max = args[1];
|
|
38387
|
+
|
|
37813
38388
|
if (max == undefined || min == undefined) {
|
|
37814
|
-
throw new Error(
|
|
37815
|
-
"Max and min need to be defined for hasLength, both or one of them is undefined"
|
|
37816
|
-
);
|
|
38389
|
+
throw new Error("Max and min need to be defined for hasLength, both or one of them is undefined");
|
|
37817
38390
|
}
|
|
38391
|
+
|
|
37818
38392
|
if (max < min) {
|
|
37819
|
-
throw new Error(
|
|
37820
|
-
"hasLength validator was passed a min greater than the max"
|
|
37821
|
-
);
|
|
38393
|
+
throw new Error("hasLength validator was passed a min greater than the max");
|
|
37822
38394
|
}
|
|
37823
|
-
|
|
38395
|
+
|
|
38396
|
+
var valueLength = value.length;
|
|
37824
38397
|
return max >= valueLength && valueLength >= min;
|
|
37825
38398
|
};
|
|
37826
38399
|
|
|
37827
|
-
|
|
37828
|
-
|
|
37829
|
-
|
|
37830
|
-
|
|
37831
|
-
|
|
37832
|
-
);
|
|
37833
|
-
validatorFns[DATE_BEFORE_TODAY] = (value, args, form) => {
|
|
38400
|
+
var DATE_BEFORE_TODAY = "validator/DATE_BEFORE_TODAY";
|
|
38401
|
+
var DATE_BEFORE_TODAY_ERROR = "error/DATE_BEFORE_TODAY";
|
|
38402
|
+
var dateBeforeToday = createValidator(DATE_BEFORE_TODAY, DATE_BEFORE_TODAY_ERROR);
|
|
38403
|
+
|
|
38404
|
+
validatorFns[DATE_BEFORE_TODAY] = function (value, args, form) {
|
|
37834
38405
|
if (value === "") {
|
|
37835
38406
|
return true;
|
|
37836
38407
|
}
|
|
37837
|
-
|
|
37838
|
-
|
|
37839
|
-
|
|
38408
|
+
|
|
38409
|
+
var dateFormat = args[0];
|
|
38410
|
+
var unit = args[1];
|
|
38411
|
+
var inclusive = args[2] || false;
|
|
37840
38412
|
|
|
37841
38413
|
if (dateFormat == undefined || unit == undefined) {
|
|
37842
|
-
throw new Error(
|
|
37843
|
-
"Date format and unit need to be defined for dateBeforeToday, one or both are undefined"
|
|
37844
|
-
);
|
|
38414
|
+
throw new Error("Date format and unit need to be defined for dateBeforeToday, one or both are undefined");
|
|
37845
38415
|
}
|
|
37846
|
-
|
|
37847
|
-
|
|
38416
|
+
|
|
38417
|
+
var now = dayjs();
|
|
38418
|
+
var dateValue = dayjs(value, dateFormat);
|
|
37848
38419
|
|
|
37849
38420
|
if (inclusive === true) {
|
|
37850
38421
|
return dateValue.isSameOrBefore(now, unit);
|
|
37851
38422
|
}
|
|
38423
|
+
|
|
37852
38424
|
return dateValue.isBefore(now, unit);
|
|
37853
38425
|
};
|
|
37854
38426
|
|
|
37855
|
-
|
|
37856
|
-
|
|
37857
|
-
|
|
37858
|
-
|
|
37859
|
-
|
|
37860
|
-
);
|
|
37861
|
-
validatorFns[DATE_AFTER_TODAY] = (value, args, form) => {
|
|
38427
|
+
var DATE_AFTER_TODAY = "validator/DATE_AFTER_TODAY";
|
|
38428
|
+
var DATE_AFTER_TODAY_ERROR = "error/DATE_AFTER_TODAY";
|
|
38429
|
+
var dateAfterToday = createValidator(DATE_AFTER_TODAY, DATE_AFTER_TODAY_ERROR);
|
|
38430
|
+
|
|
38431
|
+
validatorFns[DATE_AFTER_TODAY] = function (value, args, form) {
|
|
37862
38432
|
if (value === "") {
|
|
37863
38433
|
return true;
|
|
37864
38434
|
}
|
|
37865
|
-
|
|
37866
|
-
|
|
37867
|
-
|
|
38435
|
+
|
|
38436
|
+
var dateFormat = args[0];
|
|
38437
|
+
var unit = args[1];
|
|
38438
|
+
var inclusive = args[2] || false;
|
|
37868
38439
|
|
|
37869
38440
|
if (dateFormat == undefined || unit == undefined) {
|
|
37870
|
-
throw new Error(
|
|
37871
|
-
"Date format and unit need to be defined for dateAfterToday, one or both are undefined"
|
|
37872
|
-
);
|
|
38441
|
+
throw new Error("Date format and unit need to be defined for dateAfterToday, one or both are undefined");
|
|
37873
38442
|
}
|
|
37874
|
-
|
|
37875
|
-
|
|
38443
|
+
|
|
38444
|
+
var now = dayjs();
|
|
38445
|
+
var dateValue = dayjs(value, dateFormat);
|
|
37876
38446
|
|
|
37877
38447
|
if (inclusive === true) {
|
|
37878
38448
|
return dateValue.isSameOrAfter(now, unit);
|
|
37879
38449
|
}
|
|
38450
|
+
|
|
37880
38451
|
return dateValue.isAfter(now, unit);
|
|
37881
38452
|
};
|
|
37882
38453
|
|
|
37883
|
-
|
|
37884
|
-
|
|
37885
|
-
|
|
37886
|
-
|
|
37887
|
-
|
|
37888
|
-
);
|
|
37889
|
-
validatorFns[IS_VALID_MONTH] = (value, args, form) => {
|
|
38454
|
+
var IS_VALID_MONTH = "validator/IS_VALID_MONTH";
|
|
38455
|
+
var IS_VALID_MONTH_ERROR = "error/IS_VALID_MONTH";
|
|
38456
|
+
var isValidMonth = createValidator(IS_VALID_MONTH, IS_VALID_MONTH_ERROR);
|
|
38457
|
+
|
|
38458
|
+
validatorFns[IS_VALID_MONTH] = function (value, args, form) {
|
|
37890
38459
|
if (value === "") {
|
|
37891
38460
|
return true;
|
|
37892
|
-
}
|
|
37893
|
-
// Function takes one argument representing the character position
|
|
38461
|
+
} // Function takes one argument representing the character position
|
|
37894
38462
|
// In a date string to identify where the month is
|
|
37895
38463
|
// Eg "10/21/2021" - start position is 0
|
|
37896
38464
|
// Or "18/03/1990" - start position is 3
|
|
37897
38465
|
// Only works with two digit months (01, 02, 03, etc)
|
|
37898
|
-
|
|
37899
|
-
|
|
37900
|
-
|
|
38466
|
+
|
|
38467
|
+
|
|
38468
|
+
var monthStartPosition = parseInt(args[0]);
|
|
38469
|
+
var monthEndPosition = monthStartPosition + 2;
|
|
38470
|
+
|
|
38471
|
+
if (isNaN(monthStartPosition)) {
|
|
37901
38472
|
throw new Error("Month start position has to be a valid integer string");
|
|
37902
38473
|
}
|
|
37903
|
-
|
|
37904
|
-
|
|
38474
|
+
|
|
38475
|
+
var month = parseInt(value.slice(monthStartPosition, monthEndPosition));
|
|
38476
|
+
|
|
38477
|
+
if (isNaN(month)) {
|
|
37905
38478
|
return false;
|
|
37906
38479
|
}
|
|
38480
|
+
|
|
37907
38481
|
return month >= 1 && month <= 12;
|
|
37908
38482
|
};
|
|
37909
38483
|
|
|
37910
|
-
|
|
37911
|
-
|
|
37912
|
-
|
|
37913
|
-
|
|
38484
|
+
var MATCHES_REGEX = "validator/MATCHES_REGEX";
|
|
38485
|
+
var MATCHES_REGEX_ERROR = "error/MATCHES_REGEX";
|
|
38486
|
+
var matchesRegex = createValidator(MATCHES_REGEX, MATCHES_REGEX_ERROR);
|
|
38487
|
+
|
|
38488
|
+
validatorFns[MATCHES_REGEX] = function (value, args, form) {
|
|
37914
38489
|
if (value === "") {
|
|
37915
38490
|
return true;
|
|
37916
38491
|
}
|
|
38492
|
+
|
|
37917
38493
|
return new RegExp(args[0]).test(value); // new RexExp never throws an error, no matter the input
|
|
37918
|
-
};
|
|
38494
|
+
}; // based on http://www.brainjar.com/js/validation/
|
|
37919
38495
|
|
|
37920
|
-
|
|
37921
|
-
|
|
37922
|
-
|
|
37923
|
-
|
|
37924
|
-
|
|
37925
|
-
|
|
37926
|
-
);
|
|
37927
|
-
validatorFns[IS_ROUTING_NUMBER] = (value, args, form) => {
|
|
38496
|
+
|
|
38497
|
+
var IS_ROUTING_NUMBER = "validator/IS_ROUTING_NUMBER";
|
|
38498
|
+
var IS_ROUTING_NUMBER_ERROR = "error/IS_ROUTING_NUMBER";
|
|
38499
|
+
var isRoutingNumber = createValidator(IS_ROUTING_NUMBER, IS_ROUTING_NUMBER_ERROR);
|
|
38500
|
+
|
|
38501
|
+
validatorFns[IS_ROUTING_NUMBER] = function (value, args, form) {
|
|
37928
38502
|
if (value === "") {
|
|
37929
38503
|
return true;
|
|
37930
38504
|
}
|
|
38505
|
+
|
|
37931
38506
|
if (value.length != 9) {
|
|
37932
38507
|
return false;
|
|
37933
38508
|
}
|
|
37934
|
-
|
|
37935
|
-
|
|
37936
|
-
|
|
37937
|
-
|
|
37938
|
-
|
|
37939
|
-
|
|
37940
|
-
|
|
37941
|
-
|
|
37942
|
-
|
|
37943
|
-
|
|
37944
|
-
|
|
37945
|
-
|
|
37946
|
-
|
|
38509
|
+
|
|
38510
|
+
var sum = value.split("").map(function (ch) {
|
|
38511
|
+
return parseInt(ch);
|
|
38512
|
+
}).reduce(function (acc, cur, idx) {
|
|
38513
|
+
switch (idx % 3) {
|
|
38514
|
+
case 0:
|
|
38515
|
+
return acc + 3 * cur;
|
|
38516
|
+
|
|
38517
|
+
case 1:
|
|
38518
|
+
return acc + 7 * cur;
|
|
38519
|
+
|
|
38520
|
+
case 2:
|
|
38521
|
+
return acc + 1 * cur;
|
|
38522
|
+
}
|
|
38523
|
+
}, 0);
|
|
37947
38524
|
return sum != 0 && sum % 10 == 0;
|
|
37948
38525
|
};
|
|
37949
38526
|
|
|
37950
|
-
|
|
37951
|
-
|
|
37952
|
-
|
|
37953
|
-
|
|
38527
|
+
var HAS_NUMBER = "validator/HAS_NUMBER";
|
|
38528
|
+
var HAS_NUMBER_ERROR$1 = "error/HAS_NUMBER";
|
|
38529
|
+
var hasNumber = createValidator(HAS_NUMBER, HAS_NUMBER_ERROR$1);
|
|
38530
|
+
|
|
38531
|
+
validatorFns[HAS_NUMBER] = function (value, args, form) {
|
|
37954
38532
|
if (value === "") {
|
|
37955
38533
|
return true;
|
|
37956
38534
|
}
|
|
38535
|
+
|
|
37957
38536
|
return new RegExp(/[0-9]/).test(value);
|
|
37958
38537
|
};
|
|
37959
38538
|
|
|
37960
|
-
|
|
37961
|
-
|
|
37962
|
-
|
|
37963
|
-
|
|
37964
|
-
|
|
37965
|
-
);
|
|
37966
|
-
validatorFns[HAS_LOWERCASE_LETTER] = (value, args, form) => {
|
|
38539
|
+
var HAS_LOWERCASE_LETTER = "validator/HAS_LOWERCASE_LETTER";
|
|
38540
|
+
var HAS_LOWERCASE_LETTER_ERROR$1 = "error/HAS_LOWERCASE_LETTER";
|
|
38541
|
+
var hasLowercaseLetter = createValidator(HAS_LOWERCASE_LETTER, HAS_LOWERCASE_LETTER_ERROR$1);
|
|
38542
|
+
|
|
38543
|
+
validatorFns[HAS_LOWERCASE_LETTER] = function (value, args, form) {
|
|
37967
38544
|
if (value === "") {
|
|
37968
38545
|
return true;
|
|
37969
38546
|
}
|
|
38547
|
+
|
|
37970
38548
|
return new RegExp(/[a-z]/).test(value);
|
|
37971
38549
|
};
|
|
37972
38550
|
|
|
37973
|
-
|
|
37974
|
-
|
|
37975
|
-
|
|
37976
|
-
|
|
37977
|
-
|
|
37978
|
-
);
|
|
37979
|
-
validatorFns[HAS_UPPERCASE_LETTER] = (value, args, form) => {
|
|
38551
|
+
var HAS_UPPERCASE_LETTER = "validator/HAS_UPPERCASE_LETTER";
|
|
38552
|
+
var HAS_UPPERCASE_LETTER_ERROR$1 = "error/HAS_UPPERCASE_LETTER";
|
|
38553
|
+
var hasUppercaseLetter = createValidator(HAS_UPPERCASE_LETTER, HAS_UPPERCASE_LETTER_ERROR$1);
|
|
38554
|
+
|
|
38555
|
+
validatorFns[HAS_UPPERCASE_LETTER] = function (value, args, form) {
|
|
37980
38556
|
if (value === "") {
|
|
37981
38557
|
return true;
|
|
37982
38558
|
}
|
|
38559
|
+
|
|
37983
38560
|
return new RegExp(/[A-Z]/).test(value);
|
|
37984
38561
|
};
|
|
37985
38562
|
|
|
37986
|
-
|
|
37987
|
-
|
|
37988
|
-
|
|
37989
|
-
|
|
37990
|
-
|
|
37991
|
-
);
|
|
37992
|
-
validatorFns[HAS_SPECIAL_CHARACTER] = (value, args, form) => {
|
|
38563
|
+
var HAS_SPECIAL_CHARACTER = "validator/HAS_SPECIAL_CHARACTER";
|
|
38564
|
+
var HAS_SPECIAL_CHARACTER_ERROR$1 = "error/HAS_SPECIAL_CHARACTER";
|
|
38565
|
+
var hasSpecialCharacter = createValidator(HAS_SPECIAL_CHARACTER, HAS_SPECIAL_CHARACTER_ERROR$1);
|
|
38566
|
+
|
|
38567
|
+
validatorFns[HAS_SPECIAL_CHARACTER] = function (value, args, form) {
|
|
37993
38568
|
if (value === "") {
|
|
37994
38569
|
return true;
|
|
37995
38570
|
}
|
|
38571
|
+
|
|
37996
38572
|
return new RegExp(/[!@#$%^&*.?]/).test(value);
|
|
37997
38573
|
};
|
|
37998
38574
|
|
|
37999
|
-
|
|
38000
|
-
|
|
38001
|
-
|
|
38002
|
-
|
|
38003
|
-
|
|
38004
|
-
);
|
|
38005
|
-
validatorFns[IS_PROBABLY_EMAIL] = (value, args, form) => {
|
|
38575
|
+
var IS_PROBABLY_EMAIL = "validator/IS_PROBABLY_EMAIL";
|
|
38576
|
+
var IS_PROBABLY_EMAIL_ERROR = "error/IS_PROBABLY_EMAIL";
|
|
38577
|
+
var isProbablyEmail = createValidator(IS_PROBABLY_EMAIL, IS_PROBABLY_EMAIL_ERROR);
|
|
38578
|
+
|
|
38579
|
+
validatorFns[IS_PROBABLY_EMAIL] = function (value, args, form) {
|
|
38006
38580
|
if (value === "") {
|
|
38007
38581
|
return true;
|
|
38008
38582
|
}
|
|
38583
|
+
|
|
38009
38584
|
return new RegExp(/^\S+@\S+\.\S+$/).test(value);
|
|
38010
38585
|
};
|
|
38011
38586
|
|
|
38012
|
-
|
|
38013
|
-
|
|
38014
|
-
|
|
38015
|
-
|
|
38016
|
-
|
|
38017
|
-
|
|
38587
|
+
var runValidatorErrorMessage = function runValidatorErrorMessage(type) {
|
|
38588
|
+
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)");
|
|
38589
|
+
};
|
|
38590
|
+
|
|
38591
|
+
var runValidator = function runValidator(validator, value, form) {
|
|
38592
|
+
var validatorFn = validatorFns[validator.type];
|
|
38018
38593
|
|
|
38019
|
-
const runValidator = (validator, value, form) => {
|
|
38020
|
-
const validatorFn = validatorFns[validator.type];
|
|
38021
38594
|
if (validatorFn === undefined) {
|
|
38022
38595
|
throw new Error(runValidatorErrorMessage(validator.type));
|
|
38023
38596
|
}
|
|
38597
|
+
|
|
38024
38598
|
return validatorFn(value, validator.args, form) ? null : validator.error;
|
|
38025
38599
|
};
|
|
38026
38600
|
|
|
38027
|
-
|
|
38028
|
-
return validators
|
|
38029
|
-
|
|
38030
|
-
|
|
38601
|
+
var runFormValidators = function runFormValidators(fieldName, form, validators) {
|
|
38602
|
+
return validators.map(function (v) {
|
|
38603
|
+
return runValidator(v, form[fieldName].rawValue, form);
|
|
38604
|
+
}).filter(function (x) {
|
|
38605
|
+
return x !== null;
|
|
38606
|
+
});
|
|
38607
|
+
};
|
|
38608
|
+
|
|
38609
|
+
var computeConstraints = function computeConstraints(fieldName, form) {
|
|
38610
|
+
var constraints = form[fieldName].constraints;
|
|
38611
|
+
return runFormValidators(fieldName, form, constraints);
|
|
38031
38612
|
};
|
|
38032
38613
|
|
|
38033
|
-
|
|
38034
|
-
|
|
38035
|
-
return
|
|
38614
|
+
var computeErrors = function computeErrors(fieldName, form) {
|
|
38615
|
+
var validators = form[fieldName].validators;
|
|
38616
|
+
return runFormValidators(fieldName, form, validators);
|
|
38036
38617
|
};
|
|
38037
38618
|
|
|
38038
|
-
|
|
38039
|
-
|
|
38040
|
-
|
|
38619
|
+
var computeErrorEntries = function computeErrorEntries(formState) {
|
|
38620
|
+
var fields = Object.entries(formState);
|
|
38621
|
+
|
|
38622
|
+
for (var _i = 0, _fields = fields; _i < _fields.length; _i++) {
|
|
38623
|
+
var entry = _fields[_i];
|
|
38624
|
+
var fieldName = entry[0];
|
|
38625
|
+
var errors = computeErrors(fieldName, formState);
|
|
38626
|
+
formState[fieldName].errors = errors;
|
|
38627
|
+
formState[fieldName].hasErrors = errors.length > 0;
|
|
38628
|
+
}
|
|
38629
|
+
};
|
|
38630
|
+
|
|
38631
|
+
var computeDirtyEntries = function computeDirtyEntries(formState, changedFieldName) {
|
|
38632
|
+
var fields = Object.entries(formState);
|
|
38633
|
+
|
|
38634
|
+
for (var _i2 = 0, _fields2 = fields; _i2 < _fields2.length; _i2++) {
|
|
38635
|
+
var entry = _fields2[_i2];
|
|
38636
|
+
var fieldName = entry[0];
|
|
38637
|
+
var field = entry[1];
|
|
38638
|
+
var dirty = fieldName === changedFieldName ? true : field.dirty;
|
|
38639
|
+
formState[fieldName].dirty = dirty;
|
|
38640
|
+
}
|
|
38041
38641
|
};
|
|
38042
38642
|
|
|
38043
38643
|
var obj;
|
|
38044
|
-
var NOTHING = typeof Symbol !== "undefined" ? Symbol("immer-nothing") : (
|
|
38045
|
-
var DRAFTABLE = typeof Symbol !== "undefined" && Symbol
|
|
38046
|
-
var DRAFT_STATE = typeof Symbol !== "undefined" && Symbol
|
|
38644
|
+
var NOTHING = typeof Symbol !== "undefined" ? Symbol("immer-nothing") : (obj = {}, obj["immer-nothing"] = true, obj);
|
|
38645
|
+
var DRAFTABLE = typeof Symbol !== "undefined" && Symbol["for"] ? Symbol["for"]("immer-draftable") : "__$immer_draftable";
|
|
38646
|
+
var DRAFT_STATE = typeof Symbol !== "undefined" && Symbol["for"] ? Symbol["for"]("immer-state") : "__$immer_state";
|
|
38647
|
+
|
|
38047
38648
|
function isDraft(value) {
|
|
38048
38649
|
return !!value && !!value[DRAFT_STATE];
|
|
38049
38650
|
}
|
|
38651
|
+
|
|
38050
38652
|
function isDraftable(value) {
|
|
38051
|
-
if (!value) {
|
|
38653
|
+
if (!value) {
|
|
38654
|
+
return false;
|
|
38655
|
+
}
|
|
38656
|
+
|
|
38052
38657
|
return isPlainObject(value) || !!value[DRAFTABLE] || !!value.constructor[DRAFTABLE];
|
|
38053
38658
|
}
|
|
38659
|
+
|
|
38054
38660
|
function isPlainObject(value) {
|
|
38055
|
-
if (!value ||
|
|
38056
|
-
|
|
38661
|
+
if (!value || _typeof(value) !== "object") {
|
|
38662
|
+
return false;
|
|
38663
|
+
}
|
|
38664
|
+
|
|
38665
|
+
if (Array.isArray(value)) {
|
|
38666
|
+
return true;
|
|
38667
|
+
}
|
|
38668
|
+
|
|
38057
38669
|
var proto = Object.getPrototypeOf(value);
|
|
38058
38670
|
return !proto || proto === Object.prototype;
|
|
38059
38671
|
}
|
|
38672
|
+
|
|
38060
38673
|
var assign = Object.assign || function assign(target, value) {
|
|
38061
38674
|
for (var key in value) {
|
|
38062
38675
|
if (has$1(value, key)) {
|
|
@@ -38066,11 +38679,18 @@ var assign = Object.assign || function assign(target, value) {
|
|
|
38066
38679
|
|
|
38067
38680
|
return target;
|
|
38068
38681
|
};
|
|
38069
|
-
|
|
38682
|
+
|
|
38683
|
+
var ownKeys$2 = typeof Reflect !== "undefined" && Reflect.ownKeys ? Reflect.ownKeys : typeof Object.getOwnPropertySymbols !== "undefined" ? function (obj) {
|
|
38684
|
+
return Object.getOwnPropertyNames(obj).concat(Object.getOwnPropertySymbols(obj));
|
|
38685
|
+
} : Object.getOwnPropertyNames;
|
|
38686
|
+
|
|
38070
38687
|
function shallowCopy(base, invokeGetters) {
|
|
38071
|
-
if (
|
|
38688
|
+
if (invokeGetters === void 0) invokeGetters = false;
|
|
38689
|
+
|
|
38690
|
+
if (Array.isArray(base)) {
|
|
38691
|
+
return base.slice();
|
|
38692
|
+
}
|
|
38072
38693
|
|
|
38073
|
-
if (Array.isArray(base)) { return base.slice(); }
|
|
38074
38694
|
var clone = Object.create(Object.getPrototypeOf(base));
|
|
38075
38695
|
ownKeys$2(base).forEach(function (key) {
|
|
38076
38696
|
if (key === DRAFT_STATE) {
|
|
@@ -38100,20 +38720,28 @@ function shallowCopy(base, invokeGetters) {
|
|
|
38100
38720
|
});
|
|
38101
38721
|
return clone;
|
|
38102
38722
|
}
|
|
38723
|
+
|
|
38103
38724
|
function each(value, cb) {
|
|
38104
38725
|
if (Array.isArray(value)) {
|
|
38105
|
-
for (var i = 0; i < value.length; i++) {
|
|
38726
|
+
for (var i = 0; i < value.length; i++) {
|
|
38727
|
+
cb(i, value[i], value);
|
|
38728
|
+
}
|
|
38106
38729
|
} else {
|
|
38107
|
-
ownKeys$2(value).forEach(function (key) {
|
|
38730
|
+
ownKeys$2(value).forEach(function (key) {
|
|
38731
|
+
return cb(key, value[key], value);
|
|
38732
|
+
});
|
|
38108
38733
|
}
|
|
38109
38734
|
}
|
|
38735
|
+
|
|
38110
38736
|
function isEnumerable(base, prop) {
|
|
38111
38737
|
var desc = Object.getOwnPropertyDescriptor(base, prop);
|
|
38112
38738
|
return !!desc && desc.enumerable;
|
|
38113
38739
|
}
|
|
38740
|
+
|
|
38114
38741
|
function has$1(thing, prop) {
|
|
38115
38742
|
return Object.prototype.hasOwnProperty.call(thing, prop);
|
|
38116
38743
|
}
|
|
38744
|
+
|
|
38117
38745
|
function is(x, y) {
|
|
38118
38746
|
// From: https://github.com/facebook/fbjs/blob/c69904a511b900266935168223063dd8772dfc40/packages/fbjs/src/core/shallowEqual.js
|
|
38119
38747
|
if (x === y) {
|
|
@@ -38122,18 +38750,27 @@ function is(x, y) {
|
|
|
38122
38750
|
return x !== x && y !== y;
|
|
38123
38751
|
}
|
|
38124
38752
|
}
|
|
38753
|
+
|
|
38125
38754
|
function clone(obj) {
|
|
38126
|
-
if (!isDraftable(obj)) {
|
|
38127
|
-
|
|
38755
|
+
if (!isDraftable(obj)) {
|
|
38756
|
+
return obj;
|
|
38757
|
+
}
|
|
38758
|
+
|
|
38759
|
+
if (Array.isArray(obj)) {
|
|
38760
|
+
return obj.map(clone);
|
|
38761
|
+
}
|
|
38762
|
+
|
|
38128
38763
|
var cloned = Object.create(Object.getPrototypeOf(obj));
|
|
38129
38764
|
|
|
38130
|
-
for (var key in obj) {
|
|
38765
|
+
for (var key in obj) {
|
|
38766
|
+
cloned[key] = clone(obj[key]);
|
|
38767
|
+
}
|
|
38131
38768
|
|
|
38132
38769
|
return cloned;
|
|
38133
38770
|
}
|
|
38134
|
-
|
|
38135
38771
|
/** Each scope represents a `produce` call. */
|
|
38136
38772
|
|
|
38773
|
+
|
|
38137
38774
|
var ImmerScope = function ImmerScope(parent) {
|
|
38138
38775
|
this.drafts = [];
|
|
38139
38776
|
this.parent = parent; // Whenever the modified draft contains a draft from another scope, we
|
|
@@ -38144,7 +38781,7 @@ var ImmerScope = function ImmerScope(parent) {
|
|
|
38144
38781
|
this.patches = null;
|
|
38145
38782
|
};
|
|
38146
38783
|
|
|
38147
|
-
ImmerScope.prototype.usePatches = function usePatches
|
|
38784
|
+
ImmerScope.prototype.usePatches = function usePatches(patchListener) {
|
|
38148
38785
|
if (patchListener) {
|
|
38149
38786
|
this.patches = [];
|
|
38150
38787
|
this.inversePatches = [];
|
|
@@ -38152,17 +38789,18 @@ ImmerScope.prototype.usePatches = function usePatches (patchListener) {
|
|
|
38152
38789
|
}
|
|
38153
38790
|
};
|
|
38154
38791
|
|
|
38155
|
-
ImmerScope.prototype.revoke = function revoke$1
|
|
38792
|
+
ImmerScope.prototype.revoke = function revoke$1() {
|
|
38156
38793
|
this.leave();
|
|
38157
38794
|
this.drafts.forEach(revoke);
|
|
38158
38795
|
this.drafts = null; // Make draft-related methods throw.
|
|
38159
38796
|
};
|
|
38160
38797
|
|
|
38161
|
-
ImmerScope.prototype.leave = function leave
|
|
38798
|
+
ImmerScope.prototype.leave = function leave() {
|
|
38162
38799
|
if (this === ImmerScope.current) {
|
|
38163
38800
|
ImmerScope.current = this.parent;
|
|
38164
38801
|
}
|
|
38165
38802
|
};
|
|
38803
|
+
|
|
38166
38804
|
ImmerScope.current = null;
|
|
38167
38805
|
|
|
38168
38806
|
ImmerScope.enter = function () {
|
|
@@ -38171,11 +38809,11 @@ ImmerScope.enter = function () {
|
|
|
38171
38809
|
|
|
38172
38810
|
function revoke(draft) {
|
|
38173
38811
|
draft[DRAFT_STATE].revoke();
|
|
38174
|
-
}
|
|
38812
|
+
} // but share them all instead
|
|
38175
38813
|
|
|
38176
|
-
// but share them all instead
|
|
38177
38814
|
|
|
38178
38815
|
var descriptors$1 = {};
|
|
38816
|
+
|
|
38179
38817
|
function willFinalize(scope, result, isReplaced) {
|
|
38180
38818
|
scope.drafts.forEach(function (draft) {
|
|
38181
38819
|
draft[DRAFT_STATE].finalizing = true;
|
|
@@ -38190,9 +38828,10 @@ function willFinalize(scope, result, isReplaced) {
|
|
|
38190
38828
|
markChangesSweep(scope.drafts);
|
|
38191
38829
|
} // When a child draft is returned, look for changes.
|
|
38192
38830
|
else if (isDraft(result) && result[DRAFT_STATE].scope === scope) {
|
|
38193
|
-
|
|
38194
|
-
|
|
38831
|
+
markChangesSweep(scope.drafts);
|
|
38832
|
+
}
|
|
38195
38833
|
}
|
|
38834
|
+
|
|
38196
38835
|
function createProxy(base, parent) {
|
|
38197
38836
|
var isArray = Array.isArray(base);
|
|
38198
38837
|
var draft = clonePotentialDraft(base);
|
|
@@ -38246,7 +38885,11 @@ function peek(draft, prop) {
|
|
|
38246
38885
|
function get$1(state, prop) {
|
|
38247
38886
|
assertUnrevoked(state);
|
|
38248
38887
|
var value = peek(source(state), prop);
|
|
38249
|
-
|
|
38888
|
+
|
|
38889
|
+
if (state.finalizing) {
|
|
38890
|
+
return value;
|
|
38891
|
+
} // Create a draft if the value is unmodified.
|
|
38892
|
+
|
|
38250
38893
|
|
|
38251
38894
|
if (value === peek(state.base, prop) && isDraftable(value)) {
|
|
38252
38895
|
prepareCopy(state);
|
|
@@ -38261,7 +38904,10 @@ function set$1(state, prop, value) {
|
|
|
38261
38904
|
state.assigned[prop] = true;
|
|
38262
38905
|
|
|
38263
38906
|
if (!state.modified) {
|
|
38264
|
-
if (is(value, peek(source(state), prop))) {
|
|
38907
|
+
if (is(value, peek(source(state), prop))) {
|
|
38908
|
+
return;
|
|
38909
|
+
}
|
|
38910
|
+
|
|
38265
38911
|
markChanged(state);
|
|
38266
38912
|
prepareCopy(state);
|
|
38267
38913
|
}
|
|
@@ -38272,12 +38918,17 @@ function set$1(state, prop, value) {
|
|
|
38272
38918
|
function markChanged(state) {
|
|
38273
38919
|
if (!state.modified) {
|
|
38274
38920
|
state.modified = true;
|
|
38275
|
-
|
|
38921
|
+
|
|
38922
|
+
if (state.parent) {
|
|
38923
|
+
markChanged(state.parent);
|
|
38924
|
+
}
|
|
38276
38925
|
}
|
|
38277
38926
|
}
|
|
38278
38927
|
|
|
38279
38928
|
function prepareCopy(state) {
|
|
38280
|
-
if (!state.copy) {
|
|
38929
|
+
if (!state.copy) {
|
|
38930
|
+
state.copy = clonePotentialDraft(state.base);
|
|
38931
|
+
}
|
|
38281
38932
|
}
|
|
38282
38933
|
|
|
38283
38934
|
function clonePotentialDraft(base) {
|
|
@@ -38302,15 +38953,12 @@ function proxyProperty(draft, prop, enumerable) {
|
|
|
38302
38953
|
descriptors$1[prop] = desc = {
|
|
38303
38954
|
configurable: true,
|
|
38304
38955
|
enumerable: enumerable,
|
|
38305
|
-
|
|
38306
38956
|
get: function get$1$1() {
|
|
38307
38957
|
return get$1(this[DRAFT_STATE], prop);
|
|
38308
38958
|
},
|
|
38309
|
-
|
|
38310
38959
|
set: function set$1$1(value) {
|
|
38311
38960
|
set$1(this[DRAFT_STATE], prop, value);
|
|
38312
38961
|
}
|
|
38313
|
-
|
|
38314
38962
|
};
|
|
38315
38963
|
}
|
|
38316
38964
|
|
|
@@ -38318,7 +38966,9 @@ function proxyProperty(draft, prop, enumerable) {
|
|
|
38318
38966
|
}
|
|
38319
38967
|
|
|
38320
38968
|
function assertUnrevoked(state) {
|
|
38321
|
-
if (state.revoked === true) {
|
|
38969
|
+
if (state.revoked === true) {
|
|
38970
|
+
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)));
|
|
38971
|
+
}
|
|
38322
38972
|
} // This looks expensive, but only proxies are visited, and only objects without known changes are scanned.
|
|
38323
38973
|
|
|
38324
38974
|
|
|
@@ -38332,16 +38982,27 @@ function markChangesSweep(drafts) {
|
|
|
38332
38982
|
|
|
38333
38983
|
if (!state.modified) {
|
|
38334
38984
|
if (Array.isArray(state.base)) {
|
|
38335
|
-
if (hasArrayChanges(state)) {
|
|
38336
|
-
|
|
38985
|
+
if (hasArrayChanges(state)) {
|
|
38986
|
+
markChanged(state);
|
|
38987
|
+
}
|
|
38988
|
+
} else if (hasObjectChanges(state)) {
|
|
38989
|
+
markChanged(state);
|
|
38990
|
+
}
|
|
38337
38991
|
}
|
|
38338
38992
|
}
|
|
38339
38993
|
}
|
|
38340
38994
|
|
|
38341
38995
|
function markChangesRecursively(object) {
|
|
38342
|
-
if (!object ||
|
|
38996
|
+
if (!object || _typeof(object) !== "object") {
|
|
38997
|
+
return;
|
|
38998
|
+
}
|
|
38999
|
+
|
|
38343
39000
|
var state = object[DRAFT_STATE];
|
|
38344
|
-
|
|
39001
|
+
|
|
39002
|
+
if (!state) {
|
|
39003
|
+
return;
|
|
39004
|
+
}
|
|
39005
|
+
|
|
38345
39006
|
var base = state.base;
|
|
38346
39007
|
var draft = state.draft;
|
|
38347
39008
|
var assigned = state.assigned;
|
|
@@ -38371,14 +39032,20 @@ function markChangesRecursively(object) {
|
|
|
38371
39032
|
assigned.length = true;
|
|
38372
39033
|
|
|
38373
39034
|
if (draft.length < base.length) {
|
|
38374
|
-
for (var i = draft.length; i < base.length; i++) {
|
|
39035
|
+
for (var i = draft.length; i < base.length; i++) {
|
|
39036
|
+
assigned[i] = false;
|
|
39037
|
+
}
|
|
38375
39038
|
} else {
|
|
38376
|
-
for (var i$1 = base.length; i$1 < draft.length; i$1++) {
|
|
39039
|
+
for (var i$1 = base.length; i$1 < draft.length; i$1++) {
|
|
39040
|
+
assigned[i$1] = true;
|
|
39041
|
+
}
|
|
38377
39042
|
}
|
|
38378
39043
|
|
|
38379
39044
|
for (var i$2 = 0; i$2 < draft.length; i$2++) {
|
|
38380
39045
|
// Only untouched indices trigger recursion.
|
|
38381
|
-
if (assigned[i$2] === undefined) {
|
|
39046
|
+
if (assigned[i$2] === undefined) {
|
|
39047
|
+
markChangesRecursively(draft[i$2]);
|
|
39048
|
+
}
|
|
38382
39049
|
}
|
|
38383
39050
|
}
|
|
38384
39051
|
}
|
|
@@ -38399,13 +39066,13 @@ function hasObjectChanges(state) {
|
|
|
38399
39066
|
} // Once a base key is deleted, future changes go undetected, because its
|
|
38400
39067
|
// descriptor is erased. This branch detects any missed changes.
|
|
38401
39068
|
else {
|
|
38402
|
-
|
|
38403
|
-
|
|
39069
|
+
var value = draft[key];
|
|
39070
|
+
var state$1 = value && value[DRAFT_STATE];
|
|
38404
39071
|
|
|
38405
|
-
|
|
38406
|
-
|
|
38407
|
-
}
|
|
39072
|
+
if (state$1 ? state$1.base !== baseValue : !is(value, baseValue)) {
|
|
39073
|
+
return true;
|
|
38408
39074
|
}
|
|
39075
|
+
}
|
|
38409
39076
|
} // At this point, no keys were added or changed.
|
|
38410
39077
|
// Compare key count to determine if keys were deleted.
|
|
38411
39078
|
|
|
@@ -38415,7 +39082,10 @@ function hasObjectChanges(state) {
|
|
|
38415
39082
|
|
|
38416
39083
|
function hasArrayChanges(state) {
|
|
38417
39084
|
var draft = state.draft;
|
|
38418
|
-
|
|
39085
|
+
|
|
39086
|
+
if (draft.length !== state.base.length) {
|
|
39087
|
+
return true;
|
|
39088
|
+
} // See #116
|
|
38419
39089
|
// If we first shorten the length, our array interceptors will be removed.
|
|
38420
39090
|
// If after that new items are added, result in the same original length,
|
|
38421
39091
|
// those last items will have no intercepting property.
|
|
@@ -38423,9 +39093,13 @@ function hasArrayChanges(state) {
|
|
|
38423
39093
|
// N.B.: splice, unshift, etc only shift values around, but not prop descriptors, so we only have to check
|
|
38424
39094
|
// the last one
|
|
38425
39095
|
|
|
39096
|
+
|
|
38426
39097
|
var descriptor = Object.getOwnPropertyDescriptor(draft, draft.length - 1); // descriptor can be null, but only for newly created sparse arrays, eg. new Array(10)
|
|
38427
39098
|
|
|
38428
|
-
if (descriptor && !descriptor.get) {
|
|
39099
|
+
if (descriptor && !descriptor.get) {
|
|
39100
|
+
return true;
|
|
39101
|
+
} // For all other cases, we don't have to compare, as they would have been picked up by the index setters
|
|
39102
|
+
|
|
38429
39103
|
|
|
38430
39104
|
return false;
|
|
38431
39105
|
}
|
|
@@ -38439,11 +39113,12 @@ function createHiddenProperty(target, prop, value) {
|
|
|
38439
39113
|
}
|
|
38440
39114
|
|
|
38441
39115
|
var legacyProxy = /*#__PURE__*/Object.freeze({
|
|
38442
|
-
|
|
38443
|
-
|
|
39116
|
+
willFinalize: willFinalize,
|
|
39117
|
+
createProxy: createProxy
|
|
38444
39118
|
});
|
|
38445
39119
|
|
|
38446
39120
|
function willFinalize$1() {}
|
|
39121
|
+
|
|
38447
39122
|
function createProxy$1(base, parent) {
|
|
38448
39123
|
var scope = parent ? parent.scope : ImmerScope.current;
|
|
38449
39124
|
var state = {
|
|
@@ -38478,33 +39153,27 @@ function createProxy$1(base, parent) {
|
|
|
38478
39153
|
scope.drafts.push(proxy);
|
|
38479
39154
|
return proxy;
|
|
38480
39155
|
}
|
|
39156
|
+
|
|
38481
39157
|
var objectTraps = {
|
|
38482
39158
|
get: get$1$1,
|
|
38483
|
-
|
|
38484
39159
|
has: function has(target, prop) {
|
|
38485
39160
|
return prop in source$1(target);
|
|
38486
39161
|
},
|
|
38487
|
-
|
|
38488
39162
|
ownKeys: function ownKeys(target) {
|
|
38489
39163
|
return Reflect.ownKeys(source$1(target));
|
|
38490
39164
|
},
|
|
38491
|
-
|
|
38492
39165
|
set: set$1$1,
|
|
38493
39166
|
deleteProperty: deleteProperty,
|
|
38494
39167
|
getOwnPropertyDescriptor: getOwnPropertyDescriptor$2,
|
|
38495
|
-
|
|
38496
39168
|
defineProperty: function defineProperty() {
|
|
38497
39169
|
throw new Error("Object.defineProperty() cannot be used on an Immer draft"); // prettier-ignore
|
|
38498
39170
|
},
|
|
38499
|
-
|
|
38500
39171
|
getPrototypeOf: function getPrototypeOf(target) {
|
|
38501
39172
|
return Object.getPrototypeOf(target.base);
|
|
38502
39173
|
},
|
|
38503
|
-
|
|
38504
39174
|
setPrototypeOf: function setPrototypeOf() {
|
|
38505
39175
|
throw new Error("Object.setPrototypeOf() cannot be used on an Immer draft"); // prettier-ignore
|
|
38506
39176
|
}
|
|
38507
|
-
|
|
38508
39177
|
};
|
|
38509
39178
|
var arrayTraps = {};
|
|
38510
39179
|
each(objectTraps, function (key, fn) {
|
|
@@ -38543,7 +39212,10 @@ function peek$1(draft, prop) {
|
|
|
38543
39212
|
}
|
|
38544
39213
|
|
|
38545
39214
|
function get$1$1(state, prop) {
|
|
38546
|
-
if (prop === DRAFT_STATE) {
|
|
39215
|
+
if (prop === DRAFT_STATE) {
|
|
39216
|
+
return state;
|
|
39217
|
+
}
|
|
39218
|
+
|
|
38547
39219
|
var drafts = state.drafts; // Check for existing draft in unmodified state.
|
|
38548
39220
|
|
|
38549
39221
|
if (!state.modified && has$1(drafts, prop)) {
|
|
@@ -38559,7 +39231,10 @@ function get$1$1(state, prop) {
|
|
|
38559
39231
|
|
|
38560
39232
|
if (state.modified) {
|
|
38561
39233
|
// Assigned values are never drafted. This catches any drafts we created, too.
|
|
38562
|
-
if (value !== peek$1(state.base, prop)) {
|
|
39234
|
+
if (value !== peek$1(state.base, prop)) {
|
|
39235
|
+
return value;
|
|
39236
|
+
} // Store drafts on the copy (when one exists).
|
|
39237
|
+
|
|
38563
39238
|
|
|
38564
39239
|
drafts = state.copy;
|
|
38565
39240
|
}
|
|
@@ -38574,7 +39249,11 @@ function set$1$1(state, prop, value) {
|
|
|
38574
39249
|
// values may be drafts, but falsy values are never drafts.
|
|
38575
39250
|
|
|
38576
39251
|
var isUnchanged = value ? is(baseValue, value) || value === state.drafts[prop] : is(baseValue, value) && prop in state.base;
|
|
38577
|
-
|
|
39252
|
+
|
|
39253
|
+
if (isUnchanged) {
|
|
39254
|
+
return true;
|
|
39255
|
+
}
|
|
39256
|
+
|
|
38578
39257
|
markChanged$1(state);
|
|
38579
39258
|
}
|
|
38580
39259
|
|
|
@@ -38593,7 +39272,10 @@ function deleteProperty(state, prop) {
|
|
|
38593
39272
|
delete state.assigned[prop];
|
|
38594
39273
|
}
|
|
38595
39274
|
|
|
38596
|
-
if (state.copy) {
|
|
39275
|
+
if (state.copy) {
|
|
39276
|
+
delete state.copy[prop];
|
|
39277
|
+
}
|
|
39278
|
+
|
|
38597
39279
|
return true;
|
|
38598
39280
|
} // Note: We never coerce `desc.value` into an Immer draft, because we can't make
|
|
38599
39281
|
// the same guarantee in ES5 mode.
|
|
@@ -38616,13 +39298,16 @@ function markChanged$1(state) {
|
|
|
38616
39298
|
state.modified = true;
|
|
38617
39299
|
state.copy = assign(shallowCopy(state.base), state.drafts);
|
|
38618
39300
|
state.drafts = null;
|
|
38619
|
-
|
|
39301
|
+
|
|
39302
|
+
if (state.parent) {
|
|
39303
|
+
markChanged$1(state.parent);
|
|
39304
|
+
}
|
|
38620
39305
|
}
|
|
38621
39306
|
}
|
|
38622
39307
|
|
|
38623
39308
|
var modernProxy = /*#__PURE__*/Object.freeze({
|
|
38624
|
-
|
|
38625
|
-
|
|
39309
|
+
willFinalize: willFinalize$1,
|
|
39310
|
+
createProxy: createProxy$1
|
|
38626
39311
|
});
|
|
38627
39312
|
|
|
38628
39313
|
function generatePatches(state, basePath, patches, inversePatches) {
|
|
@@ -38631,14 +39316,13 @@ function generatePatches(state, basePath, patches, inversePatches) {
|
|
|
38631
39316
|
|
|
38632
39317
|
function generateArrayPatches(state, basePath, patches, inversePatches) {
|
|
38633
39318
|
var assign, assign$1;
|
|
38634
|
-
|
|
38635
39319
|
var base = state.base;
|
|
38636
39320
|
var copy = state.copy;
|
|
38637
39321
|
var assigned = state.assigned; // Reduce complexity by ensuring `base` is never longer.
|
|
38638
39322
|
|
|
38639
39323
|
if (copy.length < base.length) {
|
|
38640
|
-
|
|
38641
|
-
|
|
39324
|
+
assign = [copy, base], base = assign[0], copy = assign[1];
|
|
39325
|
+
assign$1 = [inversePatches, patches], patches = assign$1[0], inversePatches = assign$1[1];
|
|
38642
39326
|
}
|
|
38643
39327
|
|
|
38644
39328
|
var delta = copy.length - base.length; // Find the first replaced index.
|
|
@@ -38696,7 +39380,11 @@ function generateObjectPatches(state, basePath, patches, inversePatches) {
|
|
|
38696
39380
|
var origValue = base[key];
|
|
38697
39381
|
var value = copy[key];
|
|
38698
39382
|
var op = !assignedValue ? "remove" : key in base ? "replace" : "add";
|
|
38699
|
-
|
|
39383
|
+
|
|
39384
|
+
if (origValue === value && op === "replace") {
|
|
39385
|
+
return;
|
|
39386
|
+
}
|
|
39387
|
+
|
|
38700
39388
|
var path = basePath.concat(key);
|
|
38701
39389
|
patches.push(op === "remove" ? {
|
|
38702
39390
|
op: op,
|
|
@@ -38721,20 +39409,26 @@ function generateObjectPatches(state, basePath, patches, inversePatches) {
|
|
|
38721
39409
|
});
|
|
38722
39410
|
}
|
|
38723
39411
|
|
|
38724
|
-
var applyPatches = function (draft, patches) {
|
|
39412
|
+
var applyPatches = function applyPatches(draft, patches) {
|
|
38725
39413
|
for (var i$1 = 0, list = patches; i$1 < list.length; i$1 += 1) {
|
|
38726
39414
|
var patch = list[i$1];
|
|
38727
|
-
|
|
38728
39415
|
var path = patch.path;
|
|
38729
39416
|
var op = patch.op;
|
|
38730
39417
|
var value = clone(patch.value); // used to clone patch to ensure original patch is not modified, see #411
|
|
38731
39418
|
|
|
38732
|
-
if (!path.length) {
|
|
39419
|
+
if (!path.length) {
|
|
39420
|
+
throw new Error("Illegal state");
|
|
39421
|
+
}
|
|
39422
|
+
|
|
38733
39423
|
var base = draft;
|
|
38734
39424
|
|
|
38735
39425
|
for (var i = 0; i < path.length - 1; i++) {
|
|
38736
39426
|
base = base[path[i]];
|
|
38737
|
-
|
|
39427
|
+
|
|
39428
|
+
if (!base || _typeof(base) !== "object") {
|
|
39429
|
+
throw new Error("Cannot apply patch, path doesn't resolve: " + path.join("/"));
|
|
39430
|
+
} // prettier-ignore
|
|
39431
|
+
|
|
38738
39432
|
}
|
|
38739
39433
|
|
|
38740
39434
|
var key = path[path.length - 1];
|
|
@@ -38783,27 +39477,33 @@ var configDefaults = {
|
|
|
38783
39477
|
onDelete: null,
|
|
38784
39478
|
onCopy: null
|
|
38785
39479
|
};
|
|
39480
|
+
|
|
38786
39481
|
var Immer = function Immer(config) {
|
|
38787
39482
|
assign(this, configDefaults, config);
|
|
38788
39483
|
this.setUseProxies(this.useProxies);
|
|
38789
39484
|
this.produce = this.produce.bind(this);
|
|
38790
39485
|
};
|
|
38791
39486
|
|
|
38792
|
-
Immer.prototype.produce = function produce
|
|
38793
|
-
|
|
39487
|
+
Immer.prototype.produce = function produce(base, recipe, patchListener) {
|
|
39488
|
+
var this$1$1 = this; // curried invocation
|
|
38794
39489
|
|
|
38795
|
-
// curried invocation
|
|
38796
39490
|
if (typeof base === "function" && typeof recipe !== "function") {
|
|
38797
39491
|
var defaultBase = recipe;
|
|
38798
39492
|
recipe = base;
|
|
38799
39493
|
var self = this;
|
|
38800
39494
|
return function curriedProduce(base) {
|
|
38801
|
-
|
|
38802
|
-
|
|
38803
|
-
|
|
38804
|
-
|
|
39495
|
+
var this$1$1 = this;
|
|
39496
|
+
if (base === void 0) base = defaultBase;
|
|
39497
|
+
var args = [],
|
|
39498
|
+
len = arguments.length - 1;
|
|
38805
39499
|
|
|
38806
|
-
|
|
39500
|
+
while (len-- > 0) {
|
|
39501
|
+
args[len] = arguments[len + 1];
|
|
39502
|
+
}
|
|
39503
|
+
|
|
39504
|
+
return self.produce(base, function (draft) {
|
|
39505
|
+
return recipe.call.apply(recipe, [this$1$1, draft].concat(args));
|
|
39506
|
+
}); // prettier-ignore
|
|
38807
39507
|
};
|
|
38808
39508
|
} // prettier-ignore
|
|
38809
39509
|
|
|
@@ -38829,7 +39529,11 @@ Immer.prototype.produce = function produce (base, recipe, patchListener) {
|
|
|
38829
39529
|
hasError = false;
|
|
38830
39530
|
} finally {
|
|
38831
39531
|
// finally instead of catch + rethrow better preserves original stack
|
|
38832
|
-
if (hasError) {
|
|
39532
|
+
if (hasError) {
|
|
39533
|
+
scope.revoke();
|
|
39534
|
+
} else {
|
|
39535
|
+
scope.leave();
|
|
39536
|
+
}
|
|
38833
39537
|
}
|
|
38834
39538
|
|
|
38835
39539
|
if (result instanceof Promise) {
|
|
@@ -38846,25 +39550,38 @@ Immer.prototype.produce = function produce (base, recipe, patchListener) {
|
|
|
38846
39550
|
return this.processResult(result, scope);
|
|
38847
39551
|
} else {
|
|
38848
39552
|
result = recipe(base);
|
|
38849
|
-
|
|
39553
|
+
|
|
39554
|
+
if (result === undefined) {
|
|
39555
|
+
return base;
|
|
39556
|
+
}
|
|
39557
|
+
|
|
38850
39558
|
return result !== NOTHING ? result : undefined;
|
|
38851
39559
|
}
|
|
38852
39560
|
};
|
|
38853
39561
|
|
|
38854
|
-
Immer.prototype.produceWithPatches = function produceWithPatches
|
|
38855
|
-
|
|
39562
|
+
Immer.prototype.produceWithPatches = function produceWithPatches(arg1, arg2, arg3) {
|
|
39563
|
+
var this$1$1 = this;
|
|
38856
39564
|
|
|
38857
39565
|
if (typeof arg1 === "function") {
|
|
38858
39566
|
return function (state) {
|
|
38859
|
-
|
|
38860
|
-
|
|
39567
|
+
var args = [],
|
|
39568
|
+
len = arguments.length - 1;
|
|
38861
39569
|
|
|
38862
|
-
|
|
38863
|
-
|
|
39570
|
+
while (len-- > 0) {
|
|
39571
|
+
args[len] = arguments[len + 1];
|
|
39572
|
+
}
|
|
39573
|
+
|
|
39574
|
+
return this$1$1.produceWithPatches(state, function (draft) {
|
|
39575
|
+
return arg1.apply(void 0, [draft].concat(args));
|
|
39576
|
+
});
|
|
39577
|
+
};
|
|
38864
39578
|
} // non-curried form
|
|
38865
39579
|
|
|
38866
39580
|
|
|
38867
|
-
if (arg3) {
|
|
39581
|
+
if (arg3) {
|
|
39582
|
+
throw new Error("A patch listener cannot be passed to produceWithPatches");
|
|
39583
|
+
}
|
|
39584
|
+
|
|
38868
39585
|
var patches, inversePatches;
|
|
38869
39586
|
var nextState = this.produce(arg1, arg2, function (p, ip) {
|
|
38870
39587
|
patches = p;
|
|
@@ -38873,7 +39590,7 @@ Immer.prototype.produceWithPatches = function produceWithPatches (arg1, arg2, ar
|
|
|
38873
39590
|
return [nextState, patches, inversePatches];
|
|
38874
39591
|
};
|
|
38875
39592
|
|
|
38876
|
-
Immer.prototype.createDraft = function createDraft
|
|
39593
|
+
Immer.prototype.createDraft = function createDraft(base) {
|
|
38877
39594
|
if (!isDraftable(base)) {
|
|
38878
39595
|
throw new Error("First argument to `createDraft` must be a plain object, an array, or an immerable object"); // prettier-ignore
|
|
38879
39596
|
}
|
|
@@ -38885,7 +39602,7 @@ Immer.prototype.createDraft = function createDraft (base) {
|
|
|
38885
39602
|
return proxy;
|
|
38886
39603
|
};
|
|
38887
39604
|
|
|
38888
|
-
Immer.prototype.finishDraft = function finishDraft
|
|
39605
|
+
Immer.prototype.finishDraft = function finishDraft(draft, patchListener) {
|
|
38889
39606
|
var state = draft && draft[DRAFT_STATE];
|
|
38890
39607
|
|
|
38891
39608
|
if (!state || !state.isManual) {
|
|
@@ -38901,16 +39618,16 @@ Immer.prototype.finishDraft = function finishDraft (draft, patchListener) {
|
|
|
38901
39618
|
return this.processResult(undefined, scope);
|
|
38902
39619
|
};
|
|
38903
39620
|
|
|
38904
|
-
Immer.prototype.setAutoFreeze = function setAutoFreeze
|
|
39621
|
+
Immer.prototype.setAutoFreeze = function setAutoFreeze(value) {
|
|
38905
39622
|
this.autoFreeze = value;
|
|
38906
39623
|
};
|
|
38907
39624
|
|
|
38908
|
-
Immer.prototype.setUseProxies = function setUseProxies
|
|
39625
|
+
Immer.prototype.setUseProxies = function setUseProxies(value) {
|
|
38909
39626
|
this.useProxies = value;
|
|
38910
39627
|
assign(this, value ? modernProxy : legacyProxy);
|
|
38911
39628
|
};
|
|
38912
39629
|
|
|
38913
|
-
Immer.prototype.applyPatches = function applyPatches$1
|
|
39630
|
+
Immer.prototype.applyPatches = function applyPatches$1(base, patches) {
|
|
38914
39631
|
// If a patch replaces the entire state, take that replacement as base
|
|
38915
39632
|
// before applying patches
|
|
38916
39633
|
var i;
|
|
@@ -38930,12 +39647,14 @@ Immer.prototype.applyPatches = function applyPatches$1 (base, patches) {
|
|
|
38930
39647
|
} // Otherwise, produce a copy of the base state.
|
|
38931
39648
|
|
|
38932
39649
|
|
|
38933
|
-
return this.produce(base, function (draft) {
|
|
39650
|
+
return this.produce(base, function (draft) {
|
|
39651
|
+
return applyPatches(draft, patches.slice(i + 1));
|
|
39652
|
+
});
|
|
38934
39653
|
};
|
|
38935
39654
|
/** @internal */
|
|
38936
39655
|
|
|
38937
39656
|
|
|
38938
|
-
Immer.prototype.processResult = function processResult
|
|
39657
|
+
Immer.prototype.processResult = function processResult(result, scope) {
|
|
38939
39658
|
var baseDraft = scope.drafts[0];
|
|
38940
39659
|
var isReplaced = result !== undefined && result !== baseDraft;
|
|
38941
39660
|
this.willFinalize(scope, result, isReplaced);
|
|
@@ -38983,13 +39702,15 @@ Immer.prototype.processResult = function processResult (result, scope) {
|
|
|
38983
39702
|
*/
|
|
38984
39703
|
|
|
38985
39704
|
|
|
38986
|
-
Immer.prototype.finalize = function finalize
|
|
38987
|
-
|
|
38988
|
-
|
|
39705
|
+
Immer.prototype.finalize = function finalize(draft, path, scope) {
|
|
39706
|
+
var this$1$1 = this;
|
|
38989
39707
|
var state = draft[DRAFT_STATE];
|
|
38990
39708
|
|
|
38991
39709
|
if (!state) {
|
|
38992
|
-
if (Object.isFrozen(draft)) {
|
|
39710
|
+
if (Object.isFrozen(draft)) {
|
|
39711
|
+
return draft;
|
|
39712
|
+
}
|
|
39713
|
+
|
|
38993
39714
|
return this.finalizeTree(draft, null, scope);
|
|
38994
39715
|
} // Never finalize drafts owned by another scope.
|
|
38995
39716
|
|
|
@@ -39012,13 +39733,17 @@ Immer.prototype.finalize = function finalize (draft, path, scope) {
|
|
|
39012
39733
|
var assigned = state.assigned;
|
|
39013
39734
|
|
|
39014
39735
|
for (var prop in assigned) {
|
|
39015
|
-
if (!assigned[prop]) {
|
|
39736
|
+
if (!assigned[prop]) {
|
|
39737
|
+
this.onDelete(state, prop);
|
|
39738
|
+
}
|
|
39016
39739
|
}
|
|
39017
39740
|
} else {
|
|
39018
39741
|
var base = state.base;
|
|
39019
|
-
|
|
39742
|
+
var copy = state.copy;
|
|
39020
39743
|
each(base, function (prop) {
|
|
39021
|
-
if (!has$1(copy, prop)) {
|
|
39744
|
+
if (!has$1(copy, prop)) {
|
|
39745
|
+
this$1$1.onDelete(state, prop);
|
|
39746
|
+
}
|
|
39022
39747
|
});
|
|
39023
39748
|
}
|
|
39024
39749
|
}
|
|
@@ -39046,9 +39771,8 @@ Immer.prototype.finalize = function finalize (draft, path, scope) {
|
|
|
39046
39771
|
*/
|
|
39047
39772
|
|
|
39048
39773
|
|
|
39049
|
-
Immer.prototype.finalizeTree = function finalizeTree
|
|
39050
|
-
|
|
39051
|
-
|
|
39774
|
+
Immer.prototype.finalizeTree = function finalizeTree(root, rootPath, scope) {
|
|
39775
|
+
var this$1$1 = this;
|
|
39052
39776
|
var state = root[DRAFT_STATE];
|
|
39053
39777
|
|
|
39054
39778
|
if (state) {
|
|
@@ -39062,7 +39786,7 @@ Immer.prototype.finalizeTree = function finalizeTree (root, rootPath, scope) {
|
|
|
39062
39786
|
|
|
39063
39787
|
var needPatches = !!rootPath && !!scope.patches;
|
|
39064
39788
|
|
|
39065
|
-
var finalizeProperty = function (prop, value, parent) {
|
|
39789
|
+
var finalizeProperty = function finalizeProperty(prop, value, parent) {
|
|
39066
39790
|
if (value === parent) {
|
|
39067
39791
|
throw Error("Immer forbids circular references");
|
|
39068
39792
|
} // In the `finalizeTree` method, only the `root` object may be a draft.
|
|
@@ -39089,14 +39813,16 @@ Immer.prototype.finalizeTree = function finalizeTree (root, rootPath, scope) {
|
|
|
39089
39813
|
} // Unchanged drafts are never passed to the `onAssign` hook.
|
|
39090
39814
|
|
|
39091
39815
|
|
|
39092
|
-
if (isDraftProp && value === state.base[prop]) {
|
|
39816
|
+
if (isDraftProp && value === state.base[prop]) {
|
|
39817
|
+
return;
|
|
39818
|
+
}
|
|
39093
39819
|
} // Unchanged draft properties are ignored.
|
|
39094
39820
|
else if (isDraftProp && is(value, state.base[prop])) {
|
|
39095
|
-
|
|
39096
|
-
|
|
39097
|
-
|
|
39098
|
-
|
|
39099
|
-
|
|
39821
|
+
return;
|
|
39822
|
+
} // Search new objects for unfinalized drafts. Frozen objects should never contain drafts.
|
|
39823
|
+
else if (isDraftable(value) && !Object.isFrozen(value)) {
|
|
39824
|
+
each(value, finalizeProperty);
|
|
39825
|
+
}
|
|
39100
39826
|
|
|
39101
39827
|
if (isDraftProp && this$1$1.onAssign) {
|
|
39102
39828
|
this$1$1.onAssign(state, prop, value);
|
|
@@ -39174,127 +39900,223 @@ immer.createDraft.bind(immer);
|
|
|
39174
39900
|
|
|
39175
39901
|
immer.finishDraft.bind(immer);
|
|
39176
39902
|
|
|
39177
|
-
|
|
39178
|
-
|
|
39179
|
-
|
|
39180
|
-
|
|
39903
|
+
var createInitialState = function createInitialState(formConfig) {
|
|
39904
|
+
var initialForm = {};
|
|
39905
|
+
var formConfigKeys = Object.keys(formConfig);
|
|
39906
|
+
|
|
39907
|
+
for (var _i3 = 0, _formConfigKeys = formConfigKeys; _i3 < _formConfigKeys.length; _i3++) {
|
|
39908
|
+
var formKey = _formConfigKeys[_i3];
|
|
39181
39909
|
initialForm[formKey] = {
|
|
39182
39910
|
dirty: false,
|
|
39183
39911
|
rawValue: formConfig[formKey].defaultValue || "",
|
|
39184
39912
|
validators: formConfig[formKey].validators || [],
|
|
39185
39913
|
constraints: formConfig[formKey].constraints || []
|
|
39186
39914
|
};
|
|
39187
|
-
}
|
|
39188
|
-
// Because validators require the entire form we have to do a
|
|
39915
|
+
} // Because validators require the entire form we have to do a
|
|
39189
39916
|
// second pass to add errors once the initial form has been
|
|
39190
39917
|
// constructed
|
|
39191
|
-
|
|
39192
|
-
|
|
39193
|
-
|
|
39194
|
-
|
|
39918
|
+
|
|
39919
|
+
|
|
39920
|
+
for (var _i4 = 0, _formConfigKeys2 = formConfigKeys; _i4 < _formConfigKeys2.length; _i4++) {
|
|
39921
|
+
var _formKey = _formConfigKeys2[_i4];
|
|
39922
|
+
var errors = computeErrors(_formKey, initialForm);
|
|
39923
|
+
initialForm[_formKey].errors = errors;
|
|
39924
|
+
initialForm[_formKey].hasErrors = errors.length > 0;
|
|
39195
39925
|
}
|
|
39926
|
+
|
|
39196
39927
|
return initialForm;
|
|
39197
39928
|
};
|
|
39198
39929
|
|
|
39199
|
-
|
|
39200
|
-
const set$2 = fieldName => value => ({
|
|
39201
|
-
type: SET,
|
|
39202
|
-
payload: { fieldName, value }
|
|
39203
|
-
});
|
|
39930
|
+
var SET = "field/SET";
|
|
39204
39931
|
|
|
39205
|
-
|
|
39206
|
-
|
|
39932
|
+
var _set = function set(fieldName) {
|
|
39933
|
+
return function (value) {
|
|
39934
|
+
return {
|
|
39935
|
+
type: SET,
|
|
39936
|
+
payload: {
|
|
39937
|
+
fieldName: fieldName,
|
|
39938
|
+
value: value
|
|
39939
|
+
}
|
|
39940
|
+
};
|
|
39941
|
+
};
|
|
39942
|
+
};
|
|
39207
39943
|
|
|
39208
|
-
|
|
39209
|
-
|
|
39210
|
-
|
|
39211
|
-
|
|
39212
|
-
|
|
39944
|
+
var CLEAR = "form/CLEAR";
|
|
39945
|
+
|
|
39946
|
+
var _clear = function clear() {
|
|
39947
|
+
return {
|
|
39948
|
+
type: CLEAR
|
|
39949
|
+
};
|
|
39950
|
+
};
|
|
39951
|
+
|
|
39952
|
+
var ADD_VALIDATOR = "field/ADD_VALIDATOR";
|
|
39213
39953
|
|
|
39214
|
-
|
|
39215
|
-
|
|
39216
|
-
|
|
39217
|
-
|
|
39218
|
-
|
|
39219
|
-
|
|
39220
|
-
|
|
39221
|
-
|
|
39222
|
-
|
|
39223
|
-
|
|
39224
|
-
|
|
39225
|
-
|
|
39226
|
-
|
|
39227
|
-
|
|
39228
|
-
|
|
39229
|
-
|
|
39954
|
+
var _addValidator = function addValidator(fieldName) {
|
|
39955
|
+
return function (validator) {
|
|
39956
|
+
return {
|
|
39957
|
+
type: ADD_VALIDATOR,
|
|
39958
|
+
payload: {
|
|
39959
|
+
fieldName: fieldName,
|
|
39960
|
+
validator: validator
|
|
39961
|
+
}
|
|
39962
|
+
};
|
|
39963
|
+
};
|
|
39964
|
+
};
|
|
39965
|
+
|
|
39966
|
+
var REMOVE_VALIDATOR = "field/REMOVE_VALIDATOR";
|
|
39967
|
+
|
|
39968
|
+
var _removeValidator = function removeValidator(fieldName) {
|
|
39969
|
+
return function (validator) {
|
|
39970
|
+
return {
|
|
39971
|
+
type: REMOVE_VALIDATOR,
|
|
39972
|
+
payload: {
|
|
39973
|
+
fieldName: fieldName,
|
|
39974
|
+
validator: validator
|
|
39975
|
+
}
|
|
39976
|
+
};
|
|
39977
|
+
};
|
|
39978
|
+
};
|
|
39979
|
+
|
|
39980
|
+
var CLEAR_FIELD_VALIDATORS = "field/CLEAR_FIELD_VALIDATORS";
|
|
39981
|
+
|
|
39982
|
+
var clearFieldValidators = function clearFieldValidators(fieldName) {
|
|
39983
|
+
return function () {
|
|
39984
|
+
return {
|
|
39985
|
+
type: CLEAR_FIELD_VALIDATORS,
|
|
39986
|
+
payload: {
|
|
39987
|
+
fieldName: fieldName
|
|
39988
|
+
}
|
|
39989
|
+
};
|
|
39990
|
+
};
|
|
39991
|
+
};
|
|
39992
|
+
|
|
39993
|
+
var createFormReducer = function createFormReducer(formConfig) {
|
|
39994
|
+
return function () {
|
|
39995
|
+
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : createInitialState(formConfig);
|
|
39996
|
+
var action = arguments.length > 1 ? arguments[1] : undefined;
|
|
39997
|
+
|
|
39998
|
+
switch (action.type) {
|
|
39999
|
+
case SET:
|
|
40000
|
+
{
|
|
40001
|
+
var changedFieldName = action.payload.fieldName;
|
|
40002
|
+
var newRawValue = action.payload.value;
|
|
40003
|
+
return produce(state, function (draftState) {
|
|
40004
|
+
var originalValue = draftState[changedFieldName].rawValue;
|
|
40005
|
+
draftState[changedFieldName].rawValue = newRawValue;
|
|
40006
|
+
|
|
40007
|
+
if (computeConstraints(changedFieldName, draftState).length > 0) {
|
|
40008
|
+
// If the change violates constraints, revert the change
|
|
40009
|
+
draftState[changedFieldName].rawValue = originalValue;
|
|
40010
|
+
return draftState;
|
|
40011
|
+
}
|
|
40012
|
+
|
|
40013
|
+
computeDirtyEntries(draftState, changedFieldName);
|
|
40014
|
+
computeErrorEntries(draftState);
|
|
40015
|
+
});
|
|
39230
40016
|
}
|
|
39231
40017
|
|
|
39232
|
-
|
|
39233
|
-
|
|
39234
|
-
|
|
39235
|
-
|
|
39236
|
-
|
|
39237
|
-
|
|
39238
|
-
|
|
39239
|
-
draftState
|
|
39240
|
-
|
|
40018
|
+
case CLEAR:
|
|
40019
|
+
return createInitialState(formConfig);
|
|
40020
|
+
|
|
40021
|
+
case ADD_VALIDATOR:
|
|
40022
|
+
{
|
|
40023
|
+
var fieldWithOverride = action.payload.fieldName;
|
|
40024
|
+
var newValidator = action.payload.validator;
|
|
40025
|
+
return produce(state, function (draftState) {
|
|
40026
|
+
draftState[fieldWithOverride].validators.push(newValidator);
|
|
40027
|
+
computeErrorEntries(draftState);
|
|
40028
|
+
});
|
|
39241
40029
|
}
|
|
39242
|
-
|
|
39243
|
-
|
|
39244
|
-
|
|
39245
|
-
|
|
39246
|
-
|
|
39247
|
-
|
|
39248
|
-
|
|
39249
|
-
|
|
39250
|
-
|
|
39251
|
-
|
|
39252
|
-
|
|
39253
|
-
|
|
39254
|
-
let field = entry[1];
|
|
39255
|
-
let errors = computeErrors(fieldName, draftState);
|
|
39256
|
-
let dirty = field.dirty;
|
|
39257
|
-
draftState[fieldName].errors = errors;
|
|
39258
|
-
draftState[fieldName].dirty = dirty;
|
|
39259
|
-
draftState[fieldName].hasErrors = errors.length > 0;
|
|
40030
|
+
|
|
40031
|
+
case REMOVE_VALIDATOR:
|
|
40032
|
+
{
|
|
40033
|
+
var fieldToOverride = action.payload.fieldName;
|
|
40034
|
+
var targetValidator = action.payload.validator;
|
|
40035
|
+
return produce(state, function (draftState) {
|
|
40036
|
+
var fieldValidators = draftState[fieldToOverride].validators;
|
|
40037
|
+
draftState[fieldToOverride].validators = fieldValidators.filter(function (validator) {
|
|
40038
|
+
return validator.type !== targetValidator.type;
|
|
40039
|
+
});
|
|
40040
|
+
computeErrorEntries(draftState);
|
|
40041
|
+
});
|
|
39260
40042
|
}
|
|
39261
|
-
|
|
39262
|
-
|
|
39263
|
-
|
|
39264
|
-
|
|
40043
|
+
|
|
40044
|
+
case CLEAR_FIELD_VALIDATORS:
|
|
40045
|
+
{
|
|
40046
|
+
var fieldToClear = action.payload.fieldName;
|
|
40047
|
+
return produce(state, function (draftState) {
|
|
40048
|
+
draftState[fieldToClear].validators = [];
|
|
40049
|
+
computeErrorEntries(draftState);
|
|
40050
|
+
});
|
|
40051
|
+
}
|
|
40052
|
+
|
|
40053
|
+
default:
|
|
40054
|
+
return state;
|
|
40055
|
+
}
|
|
40056
|
+
};
|
|
39265
40057
|
};
|
|
39266
40058
|
|
|
39267
|
-
|
|
40059
|
+
var createMapDispatchToProps = function createMapDispatchToProps(formConfig) {
|
|
39268
40060
|
// Do memo-ization
|
|
39269
|
-
|
|
39270
|
-
|
|
39271
|
-
return dispatch
|
|
40061
|
+
var cachedDispatch;
|
|
40062
|
+
var cacheValue;
|
|
40063
|
+
return function (dispatch) {
|
|
39272
40064
|
if (dispatch == cachedDispatch) {
|
|
39273
40065
|
return cacheValue;
|
|
39274
40066
|
}
|
|
39275
|
-
|
|
40067
|
+
|
|
40068
|
+
var dispatchObj = {};
|
|
39276
40069
|
dispatchObj.fields = {};
|
|
39277
|
-
|
|
39278
|
-
|
|
40070
|
+
var keys = Object.keys(formConfig);
|
|
40071
|
+
|
|
40072
|
+
var _loop = function _loop() {
|
|
40073
|
+
var fieldName = _keys[_i5];
|
|
39279
40074
|
dispatchObj.fields[fieldName] = {
|
|
39280
|
-
set:
|
|
39281
|
-
|
|
40075
|
+
set: function set(value) {
|
|
40076
|
+
return dispatch(_set(fieldName)(value));
|
|
40077
|
+
},
|
|
40078
|
+
addValidator: function addValidator(validator) {
|
|
40079
|
+
return dispatch(_addValidator(fieldName)(validator));
|
|
40080
|
+
},
|
|
40081
|
+
removeValidator: function removeValidator(validator) {
|
|
40082
|
+
return dispatch(_removeValidator(fieldName)(validator));
|
|
40083
|
+
},
|
|
40084
|
+
clear: function clear() {
|
|
40085
|
+
return dispatch(clearFieldValidators(fieldName)());
|
|
40086
|
+
}
|
|
39282
40087
|
};
|
|
40088
|
+
};
|
|
40089
|
+
|
|
40090
|
+
for (var _i5 = 0, _keys = keys; _i5 < _keys.length; _i5++) {
|
|
40091
|
+
_loop();
|
|
39283
40092
|
}
|
|
39284
|
-
|
|
40093
|
+
|
|
40094
|
+
dispatchObj.form = {
|
|
40095
|
+
clear: function clear() {
|
|
40096
|
+
return dispatch(_clear());
|
|
40097
|
+
}
|
|
40098
|
+
};
|
|
39285
40099
|
cachedDispatch = dispatch;
|
|
39286
|
-
cacheValue = {
|
|
40100
|
+
cacheValue = {
|
|
40101
|
+
actions: dispatchObj
|
|
40102
|
+
};
|
|
39287
40103
|
return cacheValue;
|
|
39288
40104
|
};
|
|
39289
40105
|
};
|
|
39290
40106
|
|
|
39291
|
-
|
|
40107
|
+
var mapStateToProps = function mapStateToProps(state) {
|
|
40108
|
+
return {
|
|
40109
|
+
fields: state
|
|
40110
|
+
};
|
|
40111
|
+
};
|
|
39292
40112
|
|
|
39293
|
-
|
|
39294
|
-
|
|
39295
|
-
|
|
39296
|
-
|
|
39297
|
-
|
|
40113
|
+
var createFormState = function createFormState(formConfig) {
|
|
40114
|
+
return {
|
|
40115
|
+
reducer: createFormReducer(formConfig),
|
|
40116
|
+
mapDispatchToProps: createMapDispatchToProps(formConfig),
|
|
40117
|
+
mapStateToProps: mapStateToProps
|
|
40118
|
+
};
|
|
40119
|
+
};
|
|
39298
40120
|
|
|
39299
40121
|
var AddressForm = function AddressForm(_ref) {
|
|
39300
40122
|
var _zipErrorMessages;
|
|
@@ -46905,7 +47727,9 @@ var Pagination = function Pagination(_ref3) {
|
|
|
46905
47727
|
var Pagination$1 = themeComponent(Pagination, "Pagination", fallbackValues$J);
|
|
46906
47728
|
|
|
46907
47729
|
var PaymentButtonBar = function PaymentButtonBar(_ref) {
|
|
46908
|
-
var _ref$
|
|
47730
|
+
var _ref$isForwardButtonD = _ref.isForwardButtonDisabled,
|
|
47731
|
+
isForwardButtonDisabled = _ref$isForwardButtonD === void 0 ? false : _ref$isForwardButtonD,
|
|
47732
|
+
_ref$forwardButtonTex = _ref.forwardButtonText,
|
|
46909
47733
|
forwardButtonText = _ref$forwardButtonTex === void 0 ? "Next" : _ref$forwardButtonTex,
|
|
46910
47734
|
forwardButtonAction = _ref.forwardButtonAction,
|
|
46911
47735
|
forwardButtonLoading = _ref.forwardButtonLoading,
|
|
@@ -46947,14 +47771,16 @@ var PaymentButtonBar = function PaymentButtonBar(_ref) {
|
|
|
46947
47771
|
text: redirectText,
|
|
46948
47772
|
variant: forwardButtonVariant,
|
|
46949
47773
|
extraStyles: isMobile && "flex-grow: 1",
|
|
46950
|
-
dataQa: redirectText
|
|
47774
|
+
dataQa: redirectText,
|
|
47775
|
+
disabled: isForwardButtonDisabled
|
|
46951
47776
|
}) : forwardButtonAction && /*#__PURE__*/React.createElement(ButtonWithAction, {
|
|
46952
47777
|
text: forwardButtonText,
|
|
46953
47778
|
variant: forwardButtonVariant,
|
|
46954
47779
|
action: forwardButtonAction,
|
|
46955
47780
|
isLoading: forwardButtonLoading,
|
|
46956
47781
|
extraStyles: isMobile && "flex-grow: 1",
|
|
46957
|
-
dataQa: forwardButtonText
|
|
47782
|
+
dataQa: forwardButtonText,
|
|
47783
|
+
disabled: isForwardButtonDisabled
|
|
46958
47784
|
});
|
|
46959
47785
|
return /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(Box, {
|
|
46960
47786
|
padding: "1.25rem 0"
|
|
@@ -47059,66 +47885,12 @@ var PaymentDetailsContent = function PaymentDetailsContent(_ref) {
|
|
|
47059
47885
|
}));
|
|
47060
47886
|
};
|
|
47061
47887
|
|
|
47062
|
-
var LoadingDetails = function LoadingDetails() {
|
|
47063
|
-
return /*#__PURE__*/React.createElement(Box, {
|
|
47064
|
-
padding: "0",
|
|
47065
|
-
background: GRECIAN_GREY,
|
|
47066
|
-
borderRadius: "4px",
|
|
47067
|
-
minHeight: "196px"
|
|
47068
|
-
}, /*#__PURE__*/React.createElement(Cover, {
|
|
47069
|
-
minHeight: "196px",
|
|
47070
|
-
singleChild: true,
|
|
47071
|
-
fillCenter: true
|
|
47072
|
-
}, /*#__PURE__*/React.createElement(Center, {
|
|
47073
|
-
intrinsic: true
|
|
47074
|
-
}, /*#__PURE__*/React.createElement(Box, {
|
|
47075
|
-
padding: "0",
|
|
47076
|
-
extraStyles: "flex-grow: 1; display: flex; justify-content: center; align-items: center;"
|
|
47077
|
-
}, /*#__PURE__*/React.createElement(Spinner$2, {
|
|
47078
|
-
size: "100",
|
|
47079
|
-
centerSpinner: true
|
|
47080
|
-
})))));
|
|
47081
|
-
};
|
|
47082
|
-
|
|
47083
|
-
var ErrorDetails = function ErrorDetails() {
|
|
47084
|
-
return /*#__PURE__*/React.createElement(Box, {
|
|
47085
|
-
padding: "0"
|
|
47086
|
-
}, /*#__PURE__*/React.createElement(Alert$1, {
|
|
47087
|
-
variant: "error",
|
|
47088
|
-
heading: "Error Loading Payment",
|
|
47089
|
-
text: "Please go back and try again.",
|
|
47090
|
-
showQuitLink: false,
|
|
47091
|
-
noBorder: true,
|
|
47092
|
-
enableBoxShadow: true,
|
|
47093
|
-
enableSmallText: true,
|
|
47094
|
-
innerContentPadding: "0 16px",
|
|
47095
|
-
extraStyles: "min-height: 67px; height: 67px;"
|
|
47096
|
-
}));
|
|
47097
|
-
};
|
|
47098
|
-
|
|
47099
|
-
var getLoadingOrErrorContent = function getLoadingOrErrorContent() {
|
|
47100
|
-
var isLoading = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
47101
|
-
var isError = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
47102
|
-
|
|
47103
|
-
if (isLoading) {
|
|
47104
|
-
return /*#__PURE__*/React.createElement(LoadingDetails, null);
|
|
47105
|
-
} else if (isError) {
|
|
47106
|
-
return /*#__PURE__*/React.createElement(ErrorDetails, null);
|
|
47107
|
-
}
|
|
47108
|
-
|
|
47109
|
-
return /*#__PURE__*/React.createElement(Fragment$1, null);
|
|
47110
|
-
};
|
|
47111
|
-
|
|
47112
47888
|
var Collapsible = function Collapsible(_ref2) {
|
|
47113
47889
|
var content = _ref2.content,
|
|
47114
47890
|
title = _ref2.title,
|
|
47115
47891
|
supportsTouch = _ref2.supportsTouch,
|
|
47116
47892
|
isOpen = _ref2.isOpen,
|
|
47117
|
-
setIsOpen = _ref2.setIsOpen
|
|
47118
|
-
_ref2$isLoading = _ref2.isLoading,
|
|
47119
|
-
isLoading = _ref2$isLoading === void 0 ? false : _ref2$isLoading,
|
|
47120
|
-
_ref2$isError = _ref2.isError,
|
|
47121
|
-
isError = _ref2$isError === void 0 ? false : _ref2$isError;
|
|
47893
|
+
setIsOpen = _ref2.setIsOpen;
|
|
47122
47894
|
return /*#__PURE__*/React.createElement(CollapsibleSection$1, {
|
|
47123
47895
|
isMobile: true,
|
|
47124
47896
|
supportsTouch: supportsTouch,
|
|
@@ -47141,17 +47913,13 @@ var Collapsible = function Collapsible(_ref2) {
|
|
|
47141
47913
|
},
|
|
47142
47914
|
positionTransition: true,
|
|
47143
47915
|
initial: "closed"
|
|
47144
|
-
},
|
|
47916
|
+
}, content));
|
|
47145
47917
|
};
|
|
47146
47918
|
|
|
47147
47919
|
var NonCollapsible = function NonCollapsible(_ref3) {
|
|
47148
47920
|
var title = _ref3.title,
|
|
47149
|
-
content = _ref3.content
|
|
47150
|
-
|
|
47151
|
-
isLoading = _ref3$isLoading === void 0 ? false : _ref3$isLoading,
|
|
47152
|
-
_ref3$isError = _ref3.isError,
|
|
47153
|
-
isError = _ref3$isError === void 0 ? false : _ref3$isError;
|
|
47154
|
-
return /*#__PURE__*/React.createElement(Stack, null, title, isLoading || isError ? getLoadingOrErrorContent(isLoading, isError) : content);
|
|
47921
|
+
content = _ref3.content;
|
|
47922
|
+
return /*#__PURE__*/React.createElement(Stack, null, title, content);
|
|
47155
47923
|
};
|
|
47156
47924
|
|
|
47157
47925
|
var PaymentDetails = function PaymentDetails(_ref4) {
|
|
@@ -47181,11 +47949,7 @@ var PaymentDetails = function PaymentDetails(_ref4) {
|
|
|
47181
47949
|
_ref4$voidableAmountP = _ref4.voidableAmountPaid,
|
|
47182
47950
|
voidableAmountPaid = _ref4$voidableAmountP === void 0 ? 0 : _ref4$voidableAmountP,
|
|
47183
47951
|
_ref4$remainingBalanc = _ref4.remainingBalance,
|
|
47184
|
-
remainingBalance = _ref4$remainingBalanc === void 0 ? false : _ref4$remainingBalanc
|
|
47185
|
-
_ref4$isLoading = _ref4.isLoading,
|
|
47186
|
-
isLoading = _ref4$isLoading === void 0 ? false : _ref4$isLoading,
|
|
47187
|
-
_ref4$isError = _ref4.isError,
|
|
47188
|
-
isError = _ref4$isError === void 0 ? false : _ref4$isError;
|
|
47952
|
+
remainingBalance = _ref4$remainingBalanc === void 0 ? false : _ref4$remainingBalanc;
|
|
47189
47953
|
|
|
47190
47954
|
var _useState = useState(initiallyOpen),
|
|
47191
47955
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -47288,14 +48052,10 @@ var PaymentDetails = function PaymentDetails(_ref4) {
|
|
|
47288
48052
|
isOpen: isOpen,
|
|
47289
48053
|
setIsOpen: setIsOpen,
|
|
47290
48054
|
isMobile: isMobile,
|
|
47291
|
-
supportsTouch: supportsTouch
|
|
47292
|
-
isLoading: isLoading,
|
|
47293
|
-
isError: isError
|
|
48055
|
+
supportsTouch: supportsTouch
|
|
47294
48056
|
}) : /*#__PURE__*/React.createElement(NonCollapsible, {
|
|
47295
48057
|
title: title,
|
|
47296
|
-
content: content
|
|
47297
|
-
isLoading: isLoading,
|
|
47298
|
-
isError: isError
|
|
48058
|
+
content: content
|
|
47299
48059
|
});
|
|
47300
48060
|
};
|
|
47301
48061
|
|
|
@@ -47506,6 +48266,59 @@ var TermsAndConditionsControlV1 = function TermsAndConditionsControlV1(_ref) {
|
|
|
47506
48266
|
})))));
|
|
47507
48267
|
};
|
|
47508
48268
|
|
|
48269
|
+
/*
|
|
48270
|
+
|
|
48271
|
+
A utility function that can generate box-shadow values for components
|
|
48272
|
+
Takes a string representing an rgb color value and returns an object
|
|
48273
|
+
with values for standard, inset, and overlay shadows.
|
|
48274
|
+
|
|
48275
|
+
The objects for standard and inset shadows contain versions approiate
|
|
48276
|
+
for base, hover, and active interaction states.
|
|
48277
|
+
|
|
48278
|
+
*/
|
|
48279
|
+
|
|
48280
|
+
/*
|
|
48281
|
+
Function to convert string representing rgb color to rgba value with provided opacity
|
|
48282
|
+
("rgb(41, 42, 51)", "0.1") => "rgba(41, 42, 51, 0.1)"
|
|
48283
|
+
|
|
48284
|
+
*/
|
|
48285
|
+
var rgbToRgba = function rgbToRgba() {
|
|
48286
|
+
var rgbValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
|
|
48287
|
+
var opacity = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
48288
|
+
|
|
48289
|
+
if (typeof rgbValue !== "string" || typeof opacity !== "string" || rgbValue.charAt(0) === "#") {
|
|
48290
|
+
return "";
|
|
48291
|
+
}
|
|
48292
|
+
|
|
48293
|
+
return "".concat(rgbValue.slice(0, 3), "a").concat(rgbValue.slice(3, -1), ", ").concat(opacity).concat(rgbValue.slice(-1));
|
|
48294
|
+
};
|
|
48295
|
+
|
|
48296
|
+
var generateShadows = function generateShadows(baseColorRGB) {
|
|
48297
|
+
var colorTen = rgbToRgba(baseColorRGB, "0.1") || "rgba(41, 42, 51, 0.1)";
|
|
48298
|
+
var colorTwenty = rgbToRgba(baseColorRGB, "0.2") || "rgba(41, 42, 51, 0.2)";
|
|
48299
|
+
var colorTwentyFive = rgbToRgba(baseColorRGB, "0.25") || "rgba(41, 42, 51, 0.25)";
|
|
48300
|
+
var colorThirty = rgbToRgba(baseColorRGB, "0.3") || "rgba(41, 42, 51, 0.3)";
|
|
48301
|
+
var blackTwentyFive = "rgba(0, 0, 0, 0.25)";
|
|
48302
|
+
var standard = {
|
|
48303
|
+
base: "0px 1px 2px 0px ".concat(colorTen, ", 0px 2px 6px 0px ").concat(colorTwenty, ", inset 0px 1px 0px 0px ").concat(colorTen),
|
|
48304
|
+
hover: "0px 1px 2px 0px ".concat(colorTwenty, ", 0px 4px 8px 0px ").concat(blackTwentyFive, ", 0px 6px 12px 0px ").concat(colorTen),
|
|
48305
|
+
active: "0px 2px 8px 0px ".concat(colorTwenty, ", 0px 4px 8px 0px ").concat(colorThirty, ", 0px 6px 12px 0px ").concat(colorTwentyFive)
|
|
48306
|
+
};
|
|
48307
|
+
var inset = {
|
|
48308
|
+
base: "0px 1px 2px 0px ".concat(colorTen, ", 0px 2px 4px 0px ").concat(colorTwenty, ", inset 0px 1px 0px 0px ").concat(colorTen),
|
|
48309
|
+
hover: "0px 1px 2px 0px ".concat(colorTen, ", 0px 2px 4px 0px ").concat(colorTwentyFive, ", 0px 4px 8px 0px ").concat(colorTen),
|
|
48310
|
+
active: "0px 1px 2px 2px ".concat(colorTwenty, ", 0px 3px 6px 0px ").concat(colorThirty, ", 0px 4px 8px 0px ").concat(colorTwenty)
|
|
48311
|
+
};
|
|
48312
|
+
var overlay = {
|
|
48313
|
+
base: "0px 7px 32px 0px ".concat(colorTwenty, ", 0px 1px 4px 0px ").concat(colorTwenty, ", 0px 1px 8px -1px ").concat(colorThirty)
|
|
48314
|
+
};
|
|
48315
|
+
return {
|
|
48316
|
+
standard: standard,
|
|
48317
|
+
inset: inset,
|
|
48318
|
+
overlay: overlay
|
|
48319
|
+
};
|
|
48320
|
+
};
|
|
48321
|
+
|
|
47509
48322
|
/*
|
|
47510
48323
|
Hook that takes an ID selector for an element on the screen
|
|
47511
48324
|
And optionally values for top position, left position, smooth behavior
|