@thecb/components 8.4.8-beta.0 → 8.4.8-beta.1
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 +543 -1430
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +543 -1430
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/molecules/radio-section/RadioSection.js +2 -2
package/dist/index.cjs.js
CHANGED
|
@@ -203,63 +203,6 @@ function _nonIterableRest() {
|
|
|
203
203
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
204
204
|
}
|
|
205
205
|
|
|
206
|
-
function _createForOfIteratorHelper(o, allowArrayLike) {
|
|
207
|
-
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
|
208
|
-
|
|
209
|
-
if (!it) {
|
|
210
|
-
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
211
|
-
if (it) o = it;
|
|
212
|
-
var i = 0;
|
|
213
|
-
|
|
214
|
-
var F = function () {};
|
|
215
|
-
|
|
216
|
-
return {
|
|
217
|
-
s: F,
|
|
218
|
-
n: function () {
|
|
219
|
-
if (i >= o.length) return {
|
|
220
|
-
done: true
|
|
221
|
-
};
|
|
222
|
-
return {
|
|
223
|
-
done: false,
|
|
224
|
-
value: o[i++]
|
|
225
|
-
};
|
|
226
|
-
},
|
|
227
|
-
e: function (e) {
|
|
228
|
-
throw e;
|
|
229
|
-
},
|
|
230
|
-
f: F
|
|
231
|
-
};
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
var normalCompletion = true,
|
|
238
|
-
didErr = false,
|
|
239
|
-
err;
|
|
240
|
-
return {
|
|
241
|
-
s: function () {
|
|
242
|
-
it = it.call(o);
|
|
243
|
-
},
|
|
244
|
-
n: function () {
|
|
245
|
-
var step = it.next();
|
|
246
|
-
normalCompletion = step.done;
|
|
247
|
-
return step;
|
|
248
|
-
},
|
|
249
|
-
e: function (e) {
|
|
250
|
-
didErr = true;
|
|
251
|
-
err = e;
|
|
252
|
-
},
|
|
253
|
-
f: function () {
|
|
254
|
-
try {
|
|
255
|
-
if (!normalCompletion && it.return != null) it.return();
|
|
256
|
-
} finally {
|
|
257
|
-
if (didErr) throw err;
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
};
|
|
261
|
-
}
|
|
262
|
-
|
|
263
206
|
/*! *****************************************************************************
|
|
264
207
|
Copyright (c) Microsoft Corporation.
|
|
265
208
|
|
|
@@ -19073,14 +19016,12 @@ function _extends$1() {
|
|
|
19073
19016
|
_extends$1 = Object.assign ? Object.assign.bind() : function (target) {
|
|
19074
19017
|
for (var i = 1; i < arguments.length; i++) {
|
|
19075
19018
|
var source = arguments[i];
|
|
19076
|
-
|
|
19077
19019
|
for (var key in source) {
|
|
19078
19020
|
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
19079
19021
|
target[key] = source[key];
|
|
19080
19022
|
}
|
|
19081
19023
|
}
|
|
19082
19024
|
}
|
|
19083
|
-
|
|
19084
19025
|
return target;
|
|
19085
19026
|
};
|
|
19086
19027
|
return _extends$1.apply(this, arguments);
|
|
@@ -19090,7 +19031,6 @@ function _assertThisInitialized(self) {
|
|
|
19090
19031
|
if (self === void 0) {
|
|
19091
19032
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
19092
19033
|
}
|
|
19093
|
-
|
|
19094
19034
|
return self;
|
|
19095
19035
|
}
|
|
19096
19036
|
|
|
@@ -19123,7 +19063,6 @@ function _isNativeReflectConstruct() {
|
|
|
19123
19063
|
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
19124
19064
|
if (Reflect.construct.sham) return false;
|
|
19125
19065
|
if (typeof Proxy === "function") return true;
|
|
19126
|
-
|
|
19127
19066
|
try {
|
|
19128
19067
|
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
19129
19068
|
return true;
|
|
@@ -19145,30 +19084,23 @@ function _construct(Parent, args, Class) {
|
|
|
19145
19084
|
return instance;
|
|
19146
19085
|
};
|
|
19147
19086
|
}
|
|
19148
|
-
|
|
19149
19087
|
return _construct.apply(null, arguments);
|
|
19150
19088
|
}
|
|
19151
19089
|
|
|
19152
19090
|
function _wrapNativeSuper(Class) {
|
|
19153
19091
|
var _cache = typeof Map === "function" ? new Map() : undefined;
|
|
19154
|
-
|
|
19155
19092
|
_wrapNativeSuper = function _wrapNativeSuper(Class) {
|
|
19156
19093
|
if (Class === null || !_isNativeFunction(Class)) return Class;
|
|
19157
|
-
|
|
19158
19094
|
if (typeof Class !== "function") {
|
|
19159
19095
|
throw new TypeError("Super expression must either be null or a function");
|
|
19160
19096
|
}
|
|
19161
|
-
|
|
19162
19097
|
if (typeof _cache !== "undefined") {
|
|
19163
19098
|
if (_cache.has(Class)) return _cache.get(Class);
|
|
19164
|
-
|
|
19165
19099
|
_cache.set(Class, Wrapper);
|
|
19166
19100
|
}
|
|
19167
|
-
|
|
19168
19101
|
function Wrapper() {
|
|
19169
19102
|
return _construct(Class, arguments, _getPrototypeOf(this).constructor);
|
|
19170
19103
|
}
|
|
19171
|
-
|
|
19172
19104
|
Wrapper.prototype = Object.create(Class.prototype, {
|
|
19173
19105
|
constructor: {
|
|
19174
19106
|
value: Wrapper,
|
|
@@ -19179,7 +19111,6 @@ function _wrapNativeSuper(Class) {
|
|
|
19179
19111
|
});
|
|
19180
19112
|
return _setPrototypeOf(Wrapper, Class);
|
|
19181
19113
|
};
|
|
19182
|
-
|
|
19183
19114
|
return _wrapNativeSuper(Class);
|
|
19184
19115
|
}
|
|
19185
19116
|
|
|
@@ -22529,26 +22460,19 @@ var FunctionPrototype = Function.prototype;
|
|
|
22529
22460
|
var call$1 = FunctionPrototype.call;
|
|
22530
22461
|
var uncurryThisWithBind = functionBindNative && FunctionPrototype.bind.bind(call$1, call$1);
|
|
22531
22462
|
|
|
22532
|
-
var
|
|
22533
|
-
return
|
|
22463
|
+
var functionUncurryThis = functionBindNative ? uncurryThisWithBind : function (fn) {
|
|
22464
|
+
return function () {
|
|
22534
22465
|
return call$1.apply(fn, arguments);
|
|
22535
22466
|
};
|
|
22536
22467
|
};
|
|
22537
22468
|
|
|
22538
|
-
var toString$2 =
|
|
22539
|
-
var stringSlice =
|
|
22469
|
+
var toString$2 = functionUncurryThis({}.toString);
|
|
22470
|
+
var stringSlice = functionUncurryThis(''.slice);
|
|
22540
22471
|
|
|
22541
22472
|
var classofRaw = function (it) {
|
|
22542
22473
|
return stringSlice(toString$2(it), 8, -1);
|
|
22543
22474
|
};
|
|
22544
22475
|
|
|
22545
|
-
var functionUncurryThis = function (fn) {
|
|
22546
|
-
// Nashorn bug:
|
|
22547
|
-
// https://github.com/zloirock/core-js/issues/1128
|
|
22548
|
-
// https://github.com/zloirock/core-js/issues/1130
|
|
22549
|
-
if (classofRaw(fn) === 'Function') return functionUncurryThisRaw(fn);
|
|
22550
|
-
};
|
|
22551
|
-
|
|
22552
22476
|
var $Object = Object;
|
|
22553
22477
|
var split = functionUncurryThis(''.split);
|
|
22554
22478
|
|
|
@@ -22587,6 +22511,7 @@ var toIndexedObject = function (it) {
|
|
|
22587
22511
|
var documentAll = typeof document == 'object' && document.all;
|
|
22588
22512
|
|
|
22589
22513
|
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
|
|
22514
|
+
// eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
|
|
22590
22515
|
var IS_HTMLDDA = typeof documentAll == 'undefined' && documentAll !== undefined;
|
|
22591
22516
|
|
|
22592
22517
|
var documentAll_1 = {
|
|
@@ -22622,7 +22547,7 @@ var getBuiltIn = function (namespace, method) {
|
|
|
22622
22547
|
|
|
22623
22548
|
var objectIsPrototypeOf = functionUncurryThis({}.isPrototypeOf);
|
|
22624
22549
|
|
|
22625
|
-
var engineUserAgent =
|
|
22550
|
+
var engineUserAgent = typeof navigator != 'undefined' && String(navigator.userAgent) || '';
|
|
22626
22551
|
|
|
22627
22552
|
var process$1 = global_1.process;
|
|
22628
22553
|
var Deno = global_1.Deno;
|
|
@@ -22736,10 +22661,10 @@ var shared = createCommonjsModule(function (module) {
|
|
|
22736
22661
|
(module.exports = function (key, value) {
|
|
22737
22662
|
return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
|
|
22738
22663
|
})('versions', []).push({
|
|
22739
|
-
version: '3.
|
|
22664
|
+
version: '3.29.0',
|
|
22740
22665
|
mode: 'global',
|
|
22741
|
-
copyright: '© 2014-
|
|
22742
|
-
license: 'https://github.com/zloirock/core-js/blob/v3.
|
|
22666
|
+
copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)',
|
|
22667
|
+
license: 'https://github.com/zloirock/core-js/blob/v3.29.0/LICENSE',
|
|
22743
22668
|
source: 'https://github.com/zloirock/core-js'
|
|
22744
22669
|
});
|
|
22745
22670
|
});
|
|
@@ -22769,21 +22694,15 @@ var uid = function (key) {
|
|
|
22769
22694
|
return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$3(++id + postfix, 36);
|
|
22770
22695
|
};
|
|
22771
22696
|
|
|
22772
|
-
var WellKnownSymbolsStore = shared('wks');
|
|
22773
22697
|
var Symbol$1 = global_1.Symbol;
|
|
22774
|
-
var
|
|
22775
|
-
var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
|
|
22698
|
+
var WellKnownSymbolsStore = shared('wks');
|
|
22699
|
+
var createWellKnownSymbol = useSymbolAsUid ? Symbol$1['for'] || Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
|
|
22776
22700
|
|
|
22777
22701
|
var wellKnownSymbol = function (name) {
|
|
22778
|
-
if (!hasOwnProperty_1(WellKnownSymbolsStore, name)
|
|
22779
|
-
|
|
22780
|
-
|
|
22781
|
-
|
|
22782
|
-
} else if (useSymbolAsUid && symbolFor) {
|
|
22783
|
-
WellKnownSymbolsStore[name] = symbolFor(description);
|
|
22784
|
-
} else {
|
|
22785
|
-
WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
|
|
22786
|
-
}
|
|
22702
|
+
if (!hasOwnProperty_1(WellKnownSymbolsStore, name)) {
|
|
22703
|
+
WellKnownSymbolsStore[name] = symbolConstructorDetection && hasOwnProperty_1(Symbol$1, name)
|
|
22704
|
+
? Symbol$1[name]
|
|
22705
|
+
: createWellKnownSymbol('Symbol.' + name);
|
|
22787
22706
|
} return WellKnownSymbolsStore[name];
|
|
22788
22707
|
};
|
|
22789
22708
|
|
|
@@ -23022,8 +22941,12 @@ var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
|
|
|
23022
22941
|
|
|
23023
22942
|
var enforceInternalState = internalState.enforce;
|
|
23024
22943
|
var getInternalState = internalState.get;
|
|
22944
|
+
var $String = String;
|
|
23025
22945
|
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
23026
22946
|
var defineProperty = Object.defineProperty;
|
|
22947
|
+
var stringSlice = functionUncurryThis(''.slice);
|
|
22948
|
+
var replace = functionUncurryThis(''.replace);
|
|
22949
|
+
var join = functionUncurryThis([].join);
|
|
23027
22950
|
|
|
23028
22951
|
var CONFIGURABLE_LENGTH = descriptors && !fails(function () {
|
|
23029
22952
|
return defineProperty(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
|
|
@@ -23032,8 +22955,8 @@ var CONFIGURABLE_LENGTH = descriptors && !fails(function () {
|
|
|
23032
22955
|
var TEMPLATE = String(String).split('String');
|
|
23033
22956
|
|
|
23034
22957
|
var makeBuiltIn = module.exports = function (value, name, options) {
|
|
23035
|
-
if (String(name)
|
|
23036
|
-
name = '[' + String(name)
|
|
22958
|
+
if (stringSlice($String(name), 0, 7) === 'Symbol(') {
|
|
22959
|
+
name = '[' + replace($String(name), /^Symbol\(([^)]*)\)/, '$1') + ']';
|
|
23037
22960
|
}
|
|
23038
22961
|
if (options && options.getter) name = 'get ' + name;
|
|
23039
22962
|
if (options && options.setter) name = 'set ' + name;
|
|
@@ -23052,7 +22975,7 @@ var makeBuiltIn = module.exports = function (value, name, options) {
|
|
|
23052
22975
|
} catch (error) { /* empty */ }
|
|
23053
22976
|
var state = enforceInternalState(value);
|
|
23054
22977
|
if (!hasOwnProperty_1(state, 'source')) {
|
|
23055
|
-
state.source =
|
|
22978
|
+
state.source = join(TEMPLATE, typeof name == 'string' ? name : '');
|
|
23056
22979
|
} return value;
|
|
23057
22980
|
};
|
|
23058
22981
|
|
|
@@ -23508,6 +23431,12 @@ addToUnscopables('at');
|
|
|
23508
23431
|
// eslint-disable-next-line es/no-typed-arrays -- safe
|
|
23509
23432
|
var arrayBufferBasicDetection = typeof ArrayBuffer != 'undefined' && typeof DataView != 'undefined';
|
|
23510
23433
|
|
|
23434
|
+
var defineBuiltInAccessor = function (target, name, descriptor) {
|
|
23435
|
+
if (descriptor.get) makeBuiltIn_1(descriptor.get, name, { getter: true });
|
|
23436
|
+
if (descriptor.set) makeBuiltIn_1(descriptor.set, name, { setter: true });
|
|
23437
|
+
return objectDefineProperty.f(target, name, descriptor);
|
|
23438
|
+
};
|
|
23439
|
+
|
|
23511
23440
|
var correctPrototypeGetter = !fails(function () {
|
|
23512
23441
|
function F() { /* empty */ }
|
|
23513
23442
|
F.prototype.constructor = null;
|
|
@@ -23531,6 +23460,13 @@ var objectGetPrototypeOf = correctPrototypeGetter ? $Object$4.getPrototypeOf : f
|
|
|
23531
23460
|
} return object instanceof $Object$4 ? ObjectPrototype : null;
|
|
23532
23461
|
};
|
|
23533
23462
|
|
|
23463
|
+
var functionUncurryThisAccessor = function (object, key, method) {
|
|
23464
|
+
try {
|
|
23465
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
23466
|
+
return functionUncurryThis(aCallable(Object.getOwnPropertyDescriptor(object, key)[method]));
|
|
23467
|
+
} catch (error) { /* empty */ }
|
|
23468
|
+
};
|
|
23469
|
+
|
|
23534
23470
|
var $String$3 = String;
|
|
23535
23471
|
var $TypeError$6 = TypeError;
|
|
23536
23472
|
|
|
@@ -23553,8 +23489,7 @@ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? functio
|
|
|
23553
23489
|
var test = {};
|
|
23554
23490
|
var setter;
|
|
23555
23491
|
try {
|
|
23556
|
-
|
|
23557
|
-
setter = functionUncurryThis(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
|
|
23492
|
+
setter = functionUncurryThisAccessor(Object.prototype, '__proto__', 'set');
|
|
23558
23493
|
setter(test, []);
|
|
23559
23494
|
CORRECT_SETTER = test instanceof Array;
|
|
23560
23495
|
} catch (error) { /* empty */ }
|
|
@@ -23567,14 +23502,6 @@ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? functio
|
|
|
23567
23502
|
};
|
|
23568
23503
|
}() : undefined);
|
|
23569
23504
|
|
|
23570
|
-
var defineProperty$2 = objectDefineProperty.f;
|
|
23571
|
-
|
|
23572
|
-
|
|
23573
|
-
|
|
23574
|
-
|
|
23575
|
-
|
|
23576
|
-
|
|
23577
|
-
|
|
23578
23505
|
var enforceInternalState = internalState.enforce;
|
|
23579
23506
|
var getInternalState = internalState.get;
|
|
23580
23507
|
var Int8Array = global_1.Int8Array;
|
|
@@ -23725,9 +23652,12 @@ if (NATIVE_ARRAY_BUFFER_VIEWS && objectGetPrototypeOf(Uint8ClampedArrayPrototype
|
|
|
23725
23652
|
|
|
23726
23653
|
if (descriptors && !hasOwnProperty_1(TypedArrayPrototype, TO_STRING_TAG$2)) {
|
|
23727
23654
|
TYPED_ARRAY_TAG_REQUIRED = true;
|
|
23728
|
-
|
|
23729
|
-
|
|
23730
|
-
|
|
23655
|
+
defineBuiltInAccessor(TypedArrayPrototype, TO_STRING_TAG$2, {
|
|
23656
|
+
configurable: true,
|
|
23657
|
+
get: function () {
|
|
23658
|
+
return isObject(this) ? this[TYPED_ARRAY_TAG] : undefined;
|
|
23659
|
+
}
|
|
23660
|
+
});
|
|
23731
23661
|
for (NAME in TypedArrayConstructorsList) if (global_1[NAME]) {
|
|
23732
23662
|
createNonEnumerableProperty(global_1[NAME], TYPED_ARRAY_TAG, NAME);
|
|
23733
23663
|
}
|
|
@@ -38628,624 +38558,49 @@ var TableHeading_styled = styled__default.th.withConfig({
|
|
|
38628
38558
|
return extraStyles;
|
|
38629
38559
|
});
|
|
38630
38560
|
|
|
38631
|
-
|
|
38632
|
-
|
|
38633
|
-
|
|
38634
|
-
|
|
38635
|
-
}
|
|
38636
|
-
|
|
38637
|
-
return value === "" ? emptyCase : validatorFn.apply(void 0, [value].concat(rest));
|
|
38638
|
-
};
|
|
38639
|
-
};
|
|
38561
|
+
const validatorToPredicate = (validatorFn, emptyCase) => (
|
|
38562
|
+
value,
|
|
38563
|
+
...rest
|
|
38564
|
+
) => (value === "" ? emptyCase : validatorFn(value, ...rest));
|
|
38640
38565
|
|
|
38641
38566
|
var commonjsGlobal$1 = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
38642
38567
|
|
|
38643
|
-
|
|
38644
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
38645
|
-
}
|
|
38646
|
-
|
|
38647
|
-
var dayjs_min = {
|
|
38648
|
-
exports: {}
|
|
38649
|
-
};
|
|
38568
|
+
var dayjs_min = {exports: {}};
|
|
38650
38569
|
|
|
38651
38570
|
(function (module, exports) {
|
|
38652
|
-
|
|
38653
|
-
|
|
38654
|
-
}(commonjsGlobal$1, function () {
|
|
38655
|
-
var t = 1e3,
|
|
38656
|
-
e = 6e4,
|
|
38657
|
-
n = 36e5,
|
|
38658
|
-
r = "millisecond",
|
|
38659
|
-
i = "second",
|
|
38660
|
-
s = "minute",
|
|
38661
|
-
u = "hour",
|
|
38662
|
-
a = "day",
|
|
38663
|
-
o = "week",
|
|
38664
|
-
f = "month",
|
|
38665
|
-
h = "quarter",
|
|
38666
|
-
c = "year",
|
|
38667
|
-
d = "date",
|
|
38668
|
-
$ = "Invalid Date",
|
|
38669
|
-
l = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,
|
|
38670
|
-
y = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,
|
|
38671
|
-
M = {
|
|
38672
|
-
name: "en",
|
|
38673
|
-
weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),
|
|
38674
|
-
months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_")
|
|
38675
|
-
},
|
|
38676
|
-
m = function m(t, e, n) {
|
|
38677
|
-
var r = String(t);
|
|
38678
|
-
return !r || r.length >= e ? t : "" + Array(e + 1 - r.length).join(n) + t;
|
|
38679
|
-
},
|
|
38680
|
-
g = {
|
|
38681
|
-
s: m,
|
|
38682
|
-
z: function z(t) {
|
|
38683
|
-
var e = -t.utcOffset(),
|
|
38684
|
-
n = Math.abs(e),
|
|
38685
|
-
r = Math.floor(n / 60),
|
|
38686
|
-
i = n % 60;
|
|
38687
|
-
return (e <= 0 ? "+" : "-") + m(r, 2, "0") + ":" + m(i, 2, "0");
|
|
38688
|
-
},
|
|
38689
|
-
m: function t(e, n) {
|
|
38690
|
-
if (e.date() < n.date()) return -t(n, e);
|
|
38691
|
-
var r = 12 * (n.year() - e.year()) + (n.month() - e.month()),
|
|
38692
|
-
i = e.clone().add(r, f),
|
|
38693
|
-
s = n - i < 0,
|
|
38694
|
-
u = e.clone().add(r + (s ? -1 : 1), f);
|
|
38695
|
-
return +(-(r + (n - i) / (s ? i - u : u - i)) || 0);
|
|
38696
|
-
},
|
|
38697
|
-
a: function a(t) {
|
|
38698
|
-
return t < 0 ? Math.ceil(t) || 0 : Math.floor(t);
|
|
38699
|
-
},
|
|
38700
|
-
p: function p(t) {
|
|
38701
|
-
return {
|
|
38702
|
-
M: f,
|
|
38703
|
-
y: c,
|
|
38704
|
-
w: o,
|
|
38705
|
-
d: a,
|
|
38706
|
-
D: d,
|
|
38707
|
-
h: u,
|
|
38708
|
-
m: s,
|
|
38709
|
-
s: i,
|
|
38710
|
-
ms: r,
|
|
38711
|
-
Q: h
|
|
38712
|
-
}[t] || String(t || "").toLowerCase().replace(/s$/, "");
|
|
38713
|
-
},
|
|
38714
|
-
u: function u(t) {
|
|
38715
|
-
return void 0 === t;
|
|
38716
|
-
}
|
|
38717
|
-
},
|
|
38718
|
-
D = "en",
|
|
38719
|
-
v = {};
|
|
38720
|
-
|
|
38721
|
-
v[D] = M;
|
|
38722
|
-
|
|
38723
|
-
var p = function p(t) {
|
|
38724
|
-
return t instanceof _;
|
|
38725
|
-
},
|
|
38726
|
-
S = function S(t, e, n) {
|
|
38727
|
-
var r;
|
|
38728
|
-
if (!t) return D;
|
|
38729
|
-
if ("string" == typeof t) v[t] && (r = t), e && (v[t] = e, r = t);else {
|
|
38730
|
-
var i = t.name;
|
|
38731
|
-
v[i] = t, r = i;
|
|
38732
|
-
}
|
|
38733
|
-
return !n && r && (D = r), r || !n && D;
|
|
38734
|
-
},
|
|
38735
|
-
w = function w(t, e) {
|
|
38736
|
-
if (p(t)) return t.clone();
|
|
38737
|
-
var n = "object" == _typeof(e) ? e : {};
|
|
38738
|
-
return n.date = t, n.args = arguments, new _(n);
|
|
38739
|
-
},
|
|
38740
|
-
O = g;
|
|
38741
|
-
|
|
38742
|
-
O.l = S, O.i = p, O.w = function (t, e) {
|
|
38743
|
-
return w(t, {
|
|
38744
|
-
locale: e.$L,
|
|
38745
|
-
utc: e.$u,
|
|
38746
|
-
x: e.$x,
|
|
38747
|
-
$offset: e.$offset
|
|
38748
|
-
});
|
|
38749
|
-
};
|
|
38750
|
-
|
|
38751
|
-
var _ = function () {
|
|
38752
|
-
function M(t) {
|
|
38753
|
-
this.$L = S(t.locale, null, !0), this.parse(t);
|
|
38754
|
-
}
|
|
38755
|
-
|
|
38756
|
-
var m = M.prototype;
|
|
38757
|
-
return m.parse = function (t) {
|
|
38758
|
-
this.$d = function (t) {
|
|
38759
|
-
var e = t.date,
|
|
38760
|
-
n = t.utc;
|
|
38761
|
-
if (null === e) return new Date(NaN);
|
|
38762
|
-
if (O.u(e)) return new Date();
|
|
38763
|
-
if (e instanceof Date) return new Date(e);
|
|
38764
|
-
|
|
38765
|
-
if ("string" == typeof e && !/Z$/i.test(e)) {
|
|
38766
|
-
var r = e.match(l);
|
|
38767
|
-
|
|
38768
|
-
if (r) {
|
|
38769
|
-
var i = r[2] - 1 || 0,
|
|
38770
|
-
s = (r[7] || "0").substring(0, 3);
|
|
38771
|
-
return n ? new Date(Date.UTC(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, s)) : new Date(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, s);
|
|
38772
|
-
}
|
|
38773
|
-
}
|
|
38774
|
-
|
|
38775
|
-
return new Date(e);
|
|
38776
|
-
}(t), this.$x = t.x || {}, this.init();
|
|
38777
|
-
}, m.init = function () {
|
|
38778
|
-
var t = this.$d;
|
|
38779
|
-
this.$y = t.getFullYear(), this.$M = t.getMonth(), this.$D = t.getDate(), this.$W = t.getDay(), this.$H = t.getHours(), this.$m = t.getMinutes(), this.$s = t.getSeconds(), this.$ms = t.getMilliseconds();
|
|
38780
|
-
}, m.$utils = function () {
|
|
38781
|
-
return O;
|
|
38782
|
-
}, m.isValid = function () {
|
|
38783
|
-
return !(this.$d.toString() === $);
|
|
38784
|
-
}, m.isSame = function (t, e) {
|
|
38785
|
-
var n = w(t);
|
|
38786
|
-
return this.startOf(e) <= n && n <= this.endOf(e);
|
|
38787
|
-
}, m.isAfter = function (t, e) {
|
|
38788
|
-
return w(t) < this.startOf(e);
|
|
38789
|
-
}, m.isBefore = function (t, e) {
|
|
38790
|
-
return this.endOf(e) < w(t);
|
|
38791
|
-
}, m.$g = function (t, e, n) {
|
|
38792
|
-
return O.u(t) ? this[e] : this.set(n, t);
|
|
38793
|
-
}, m.unix = function () {
|
|
38794
|
-
return Math.floor(this.valueOf() / 1e3);
|
|
38795
|
-
}, m.valueOf = function () {
|
|
38796
|
-
return this.$d.getTime();
|
|
38797
|
-
}, m.startOf = function (t, e) {
|
|
38798
|
-
var n = this,
|
|
38799
|
-
r = !!O.u(e) || e,
|
|
38800
|
-
h = O.p(t),
|
|
38801
|
-
$ = function $(t, e) {
|
|
38802
|
-
var i = O.w(n.$u ? Date.UTC(n.$y, e, t) : new Date(n.$y, e, t), n);
|
|
38803
|
-
return r ? i : i.endOf(a);
|
|
38804
|
-
},
|
|
38805
|
-
l = function l(t, e) {
|
|
38806
|
-
return O.w(n.toDate()[t].apply(n.toDate("s"), (r ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e)), n);
|
|
38807
|
-
},
|
|
38808
|
-
y = this.$W,
|
|
38809
|
-
M = this.$M,
|
|
38810
|
-
m = this.$D,
|
|
38811
|
-
g = "set" + (this.$u ? "UTC" : "");
|
|
38812
|
-
|
|
38813
|
-
switch (h) {
|
|
38814
|
-
case c:
|
|
38815
|
-
return r ? $(1, 0) : $(31, 11);
|
|
38816
|
-
|
|
38817
|
-
case f:
|
|
38818
|
-
return r ? $(1, M) : $(0, M + 1);
|
|
38819
|
-
|
|
38820
|
-
case o:
|
|
38821
|
-
var D = this.$locale().weekStart || 0,
|
|
38822
|
-
v = (y < D ? y + 7 : y) - D;
|
|
38823
|
-
return $(r ? m - v : m + (6 - v), M);
|
|
38824
|
-
|
|
38825
|
-
case a:
|
|
38826
|
-
case d:
|
|
38827
|
-
return l(g + "Hours", 0);
|
|
38571
|
+
!function(t,e){module.exports=e();}(commonjsGlobal$1,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",f="month",h="quarter",c="year",d="date",$="Invalid Date",l=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,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,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},g={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,f),s=n-i<0,u=e.clone().add(r+(s?-1:1),f);return +(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return {M:f,y:c,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:h}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},D="en",v={};v[D]=M;var p=function(t){return t instanceof _},S=function(t,e,n){var r;if(!t)return D;if("string"==typeof t)v[t]&&(r=t),e&&(v[t]=e,r=t);else {var i=t.name;v[i]=t,r=i;}return !n&&r&&(D=r),r||!n&&D},w=function(t,e){if(p(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},O=g;O.l=S,O.i=p,O.w=function(t,e){return w(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=S(t.locale,null,!0),this.parse(t);}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(O.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(l);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);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)}}return new Date(e)}(t),this.$x=t.x||{},this.init();},m.init=function(){var t=this.$d;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();},m.$utils=function(){return O},m.isValid=function(){return !(this.$d.toString()===$)},m.isSame=function(t,e){var n=w(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return w(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<w(t)},m.$g=function(t,e,n){return O.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!O.u(e)||e,h=O.p(t),$=function(t,e){var i=O.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},l=function(t,e){return O.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,g="set"+(this.$u?"UTC":"");switch(h){case c:return r?$(1,0):$(31,11);case f:return r?$(1,M):$(0,M+1);case o:var D=this.$locale().weekStart||0,v=(y<D?y+7:y)-D;return $(r?m-v:m+(6-v),M);case a:case d:return l(g+"Hours",0);case u:return l(g+"Minutes",1);case s:return l(g+"Seconds",2);case i:return l(g+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=O.p(t),h="set"+(this.$u?"UTC":""),$=(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],l=o===a?this.$D+(e-this.$W):e;if(o===f||o===c){var y=this.clone().set(d,1);y.$d[$](l),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else $&&this.$d[$](l);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[O.p(t)]()},m.add=function(r,h){var d,$=this;r=Number(r);var l=O.p(h),y=function(t){var e=w($);return O.w(e.date(e.date()+Math.round(t*r)),$)};if(l===f)return this.set(f,this.$M+r);if(l===c)return this.set(c,this.$y+r);if(l===a)return y(1);if(l===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[l]||1,m=this.$d.getTime()+r*M;return O.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||$;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=O.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,f=n.months,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].substr(0,s)},c=function(t){return O.s(s%12||12,t,"0")},d=n.meridiem||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r},l={YY:String(this.$y).slice(-2),YYYY:this.$y,M:a+1,MM:O.s(a+1,2,"0"),MMM:h(n.monthsShort,a,f,3),MMMM:h(f,a),D:this.$D,DD:O.s(this.$D,2,"0"),d:String(this.$W),dd:h(n.weekdaysMin,this.$W,o,2),ddd:h(n.weekdaysShort,this.$W,o,3),dddd:o[this.$W],H:String(s),HH:O.s(s,2,"0"),h:c(1),hh:c(2),a:d(s,u,!0),A:d(s,u,!1),m:String(u),mm:O.s(u,2,"0"),s:String(this.$s),ss:O.s(this.$s,2,"0"),SSS:O.s(this.$ms,3,"0"),Z:i};return r.replace(y,(function(t,e){return e||l[t]||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,$){var l,y=O.p(d),M=w(r),m=(M.utcOffset()-this.utcOffset())*e,g=this-M,D=O.m(this,M);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)},m.daysInMonth=function(){return this.endOf(f).$D},m.$locale=function(){return v[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=S(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return O.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),b=_.prototype;return w.prototype=b,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",f],["$y",c],["$D",d]].forEach((function(t){b[t[1]]=function(e){return this.$g(e,t[0],t[1])};})),w.extend=function(t,e){return t.$i||(t(e,_,w),t.$i=!0),w},w.locale=S,w.isDayjs=p,w.unix=function(t){return w(1e3*t)},w.en=v[D],w.Ls=v,w.p={},w}));
|
|
38572
|
+
}(dayjs_min));
|
|
38828
38573
|
|
|
38829
|
-
|
|
38830
|
-
return l(g + "Minutes", 1);
|
|
38574
|
+
var dayjs = dayjs_min.exports;
|
|
38831
38575
|
|
|
38832
|
-
|
|
38833
|
-
return l(g + "Seconds", 2);
|
|
38834
|
-
|
|
38835
|
-
case i:
|
|
38836
|
-
return l(g + "Milliseconds", 3);
|
|
38837
|
-
|
|
38838
|
-
default:
|
|
38839
|
-
return this.clone();
|
|
38840
|
-
}
|
|
38841
|
-
}, m.endOf = function (t) {
|
|
38842
|
-
return this.startOf(t, !1);
|
|
38843
|
-
}, m.$set = function (t, e) {
|
|
38844
|
-
var n,
|
|
38845
|
-
o = O.p(t),
|
|
38846
|
-
h = "set" + (this.$u ? "UTC" : ""),
|
|
38847
|
-
$ = (n = {}, n[a] = h + "Date", n[d] = h + "Date", n[f] = h + "Month", n[c] = h + "FullYear", n[u] = h + "Hours", n[s] = h + "Minutes", n[i] = h + "Seconds", n[r] = h + "Milliseconds", n)[o],
|
|
38848
|
-
l = o === a ? this.$D + (e - this.$W) : e;
|
|
38849
|
-
|
|
38850
|
-
if (o === f || o === c) {
|
|
38851
|
-
var y = this.clone().set(d, 1);
|
|
38852
|
-
y.$d[$](l), y.init(), this.$d = y.set(d, Math.min(this.$D, y.daysInMonth())).$d;
|
|
38853
|
-
} else $ && this.$d[$](l);
|
|
38854
|
-
|
|
38855
|
-
return this.init(), this;
|
|
38856
|
-
}, m.set = function (t, e) {
|
|
38857
|
-
return this.clone().$set(t, e);
|
|
38858
|
-
}, m.get = function (t) {
|
|
38859
|
-
return this[O.p(t)]();
|
|
38860
|
-
}, m.add = function (r, h) {
|
|
38861
|
-
var d,
|
|
38862
|
-
$ = this;
|
|
38863
|
-
r = Number(r);
|
|
38864
|
-
|
|
38865
|
-
var l = O.p(h),
|
|
38866
|
-
y = function y(t) {
|
|
38867
|
-
var e = w($);
|
|
38868
|
-
return O.w(e.date(e.date() + Math.round(t * r)), $);
|
|
38869
|
-
};
|
|
38870
|
-
|
|
38871
|
-
if (l === f) return this.set(f, this.$M + r);
|
|
38872
|
-
if (l === c) return this.set(c, this.$y + r);
|
|
38873
|
-
if (l === a) return y(1);
|
|
38874
|
-
if (l === o) return y(7);
|
|
38875
|
-
var M = (d = {}, d[s] = e, d[u] = n, d[i] = t, d)[l] || 1,
|
|
38876
|
-
m = this.$d.getTime() + r * M;
|
|
38877
|
-
return O.w(m, this);
|
|
38878
|
-
}, m.subtract = function (t, e) {
|
|
38879
|
-
return this.add(-1 * t, e);
|
|
38880
|
-
}, m.format = function (t) {
|
|
38881
|
-
var e = this,
|
|
38882
|
-
n = this.$locale();
|
|
38883
|
-
if (!this.isValid()) return n.invalidDate || $;
|
|
38884
|
-
|
|
38885
|
-
var r = t || "YYYY-MM-DDTHH:mm:ssZ",
|
|
38886
|
-
i = O.z(this),
|
|
38887
|
-
s = this.$H,
|
|
38888
|
-
u = this.$m,
|
|
38889
|
-
a = this.$M,
|
|
38890
|
-
o = n.weekdays,
|
|
38891
|
-
f = n.months,
|
|
38892
|
-
h = function h(t, n, i, s) {
|
|
38893
|
-
return t && (t[n] || t(e, r)) || i[n].substr(0, s);
|
|
38894
|
-
},
|
|
38895
|
-
c = function c(t) {
|
|
38896
|
-
return O.s(s % 12 || 12, t, "0");
|
|
38897
|
-
},
|
|
38898
|
-
d = n.meridiem || function (t, e, n) {
|
|
38899
|
-
var r = t < 12 ? "AM" : "PM";
|
|
38900
|
-
return n ? r.toLowerCase() : r;
|
|
38901
|
-
},
|
|
38902
|
-
l = {
|
|
38903
|
-
YY: String(this.$y).slice(-2),
|
|
38904
|
-
YYYY: this.$y,
|
|
38905
|
-
M: a + 1,
|
|
38906
|
-
MM: O.s(a + 1, 2, "0"),
|
|
38907
|
-
MMM: h(n.monthsShort, a, f, 3),
|
|
38908
|
-
MMMM: h(f, a),
|
|
38909
|
-
D: this.$D,
|
|
38910
|
-
DD: O.s(this.$D, 2, "0"),
|
|
38911
|
-
d: String(this.$W),
|
|
38912
|
-
dd: h(n.weekdaysMin, this.$W, o, 2),
|
|
38913
|
-
ddd: h(n.weekdaysShort, this.$W, o, 3),
|
|
38914
|
-
dddd: o[this.$W],
|
|
38915
|
-
H: String(s),
|
|
38916
|
-
HH: O.s(s, 2, "0"),
|
|
38917
|
-
h: c(1),
|
|
38918
|
-
hh: c(2),
|
|
38919
|
-
a: d(s, u, !0),
|
|
38920
|
-
A: d(s, u, !1),
|
|
38921
|
-
m: String(u),
|
|
38922
|
-
mm: O.s(u, 2, "0"),
|
|
38923
|
-
s: String(this.$s),
|
|
38924
|
-
ss: O.s(this.$s, 2, "0"),
|
|
38925
|
-
SSS: O.s(this.$ms, 3, "0"),
|
|
38926
|
-
Z: i
|
|
38927
|
-
};
|
|
38928
|
-
|
|
38929
|
-
return r.replace(y, function (t, e) {
|
|
38930
|
-
return e || l[t] || i.replace(":", "");
|
|
38931
|
-
});
|
|
38932
|
-
}, m.utcOffset = function () {
|
|
38933
|
-
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
38934
|
-
}, m.diff = function (r, d, $) {
|
|
38935
|
-
var l,
|
|
38936
|
-
y = O.p(d),
|
|
38937
|
-
M = w(r),
|
|
38938
|
-
m = (M.utcOffset() - this.utcOffset()) * e,
|
|
38939
|
-
g = this - M,
|
|
38940
|
-
D = O.m(this, M);
|
|
38941
|
-
return D = (l = {}, l[c] = D / 12, l[f] = D, l[h] = D / 3, l[o] = (g - m) / 6048e5, l[a] = (g - m) / 864e5, l[u] = g / n, l[s] = g / e, l[i] = g / t, l)[y] || g, $ ? D : O.a(D);
|
|
38942
|
-
}, m.daysInMonth = function () {
|
|
38943
|
-
return this.endOf(f).$D;
|
|
38944
|
-
}, m.$locale = function () {
|
|
38945
|
-
return v[this.$L];
|
|
38946
|
-
}, m.locale = function (t, e) {
|
|
38947
|
-
if (!t) return this.$L;
|
|
38948
|
-
var n = this.clone(),
|
|
38949
|
-
r = S(t, e, !0);
|
|
38950
|
-
return r && (n.$L = r), n;
|
|
38951
|
-
}, m.clone = function () {
|
|
38952
|
-
return O.w(this.$d, this);
|
|
38953
|
-
}, m.toDate = function () {
|
|
38954
|
-
return new Date(this.valueOf());
|
|
38955
|
-
}, m.toJSON = function () {
|
|
38956
|
-
return this.isValid() ? this.toISOString() : null;
|
|
38957
|
-
}, m.toISOString = function () {
|
|
38958
|
-
return this.$d.toISOString();
|
|
38959
|
-
}, m.toString = function () {
|
|
38960
|
-
return this.$d.toUTCString();
|
|
38961
|
-
}, M;
|
|
38962
|
-
}(),
|
|
38963
|
-
b = _.prototype;
|
|
38964
|
-
|
|
38965
|
-
return w.prototype = b, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", f], ["$y", c], ["$D", d]].forEach(function (t) {
|
|
38966
|
-
b[t[1]] = function (e) {
|
|
38967
|
-
return this.$g(e, t[0], t[1]);
|
|
38968
|
-
};
|
|
38969
|
-
}), w.extend = function (t, e) {
|
|
38970
|
-
return t.$i || (t(e, _, w), t.$i = !0), w;
|
|
38971
|
-
}, w.locale = S, w.isDayjs = p, w.unix = function (t) {
|
|
38972
|
-
return w(1e3 * t);
|
|
38973
|
-
}, w.en = v[D], w.Ls = v, w.p = {}, w;
|
|
38974
|
-
});
|
|
38975
|
-
})(dayjs_min);
|
|
38976
|
-
|
|
38977
|
-
var dayjs_minExports = dayjs_min.exports;
|
|
38978
|
-
var dayjs = /*@__PURE__*/getDefaultExportFromCjs(dayjs_minExports);
|
|
38979
|
-
var customParseFormat$1 = {
|
|
38980
|
-
exports: {}
|
|
38981
|
-
};
|
|
38576
|
+
var customParseFormat$1 = {exports: {}};
|
|
38982
38577
|
|
|
38983
38578
|
(function (module, exports) {
|
|
38984
|
-
|
|
38985
|
-
|
|
38986
|
-
}(commonjsGlobal$1, function () {
|
|
38987
|
-
var t = {
|
|
38988
|
-
LTS: "h:mm:ss A",
|
|
38989
|
-
LT: "h:mm A",
|
|
38990
|
-
L: "MM/DD/YYYY",
|
|
38991
|
-
LL: "MMMM D, YYYY",
|
|
38992
|
-
LLL: "MMMM D, YYYY h:mm A",
|
|
38993
|
-
LLLL: "dddd, MMMM D, YYYY h:mm A"
|
|
38994
|
-
},
|
|
38995
|
-
e = /(\[[^[]*\])|([-:/.()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,
|
|
38996
|
-
n = /\d\d/,
|
|
38997
|
-
r = /\d\d?/,
|
|
38998
|
-
i = /\d*[^\s\d-_:/()]+/,
|
|
38999
|
-
o = {},
|
|
39000
|
-
s = function s(t) {
|
|
39001
|
-
return (t = +t) + (t > 68 ? 1900 : 2e3);
|
|
39002
|
-
};
|
|
38579
|
+
!function(t,e){module.exports=e();}(commonjsGlobal$1,(function(){var t={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},e=/(\[[^[]*\])|([-:/.()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d\d/,r=/\d\d?/,i=/\d*[^\s\d-_:/()]+/,o={},s=function(t){return (t=+t)+(t>68?1900:2e3)};var a=function(t){return function(e){this[t]=+e;}},f=[/[+-]\d\d:?(\d\d)?|Z/,function(t){(this.zone||(this.zone={})).offset=function(t){if(!t)return 0;if("Z"===t)return 0;var e=t.match(/([+-]|\d\d)/g),n=60*e[1]+(+e[2]||0);return 0===n?0:"+"===e[0]?-n:n}(t);}],u=function(t){var e=o[t];return e&&(e.indexOf?e:e.s.concat(e.f))},h=function(t,e){var n,r=o.meridiem;if(r){for(var i=1;i<=24;i+=1)if(t.indexOf(r(i,0,e))>-1){n=i>12;break}}else n=t===(e?"pm":"PM");return n},d={A:[i,function(t){this.afternoon=h(t,!1);}],a:[i,function(t){this.afternoon=h(t,!0);}],S:[/\d/,function(t){this.milliseconds=100*+t;}],SS:[n,function(t){this.milliseconds=10*+t;}],SSS:[/\d{3}/,function(t){this.milliseconds=+t;}],s:[r,a("seconds")],ss:[r,a("seconds")],m:[r,a("minutes")],mm:[r,a("minutes")],H:[r,a("hours")],h:[r,a("hours")],HH:[r,a("hours")],hh:[r,a("hours")],D:[r,a("day")],DD:[n,a("day")],Do:[i,function(t){var e=o.ordinal,n=t.match(/\d+/);if(this.day=n[0],e)for(var r=1;r<=31;r+=1)e(r).replace(/\[|\]/g,"")===t&&(this.day=r);}],M:[r,a("month")],MM:[n,a("month")],MMM:[i,function(t){var e=u("months"),n=(u("monthsShort")||e.map((function(t){return t.substr(0,3)}))).indexOf(t)+1;if(n<1)throw new Error;this.month=n%12||n;}],MMMM:[i,function(t){var e=u("months").indexOf(t)+1;if(e<1)throw new Error;this.month=e%12||e;}],Y:[/[+-]?\d+/,a("year")],YY:[n,function(t){this.year=s(t);}],YYYY:[/\d{4}/,a("year")],Z:f,ZZ:f};function c(n){var r,i;r=n,i=o&&o.formats;for(var s=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(e,n,r){var o=r&&r.toUpperCase();return n||i[r]||t[r]||i[o].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(t,e,n){return e||n.slice(1)}))}))).match(e),a=s.length,f=0;f<a;f+=1){var u=s[f],h=d[u],c=h&&h[0],l=h&&h[1];s[f]=l?{regex:c,parser:l}:u.replace(/^\[|\]$/g,"");}return function(t){for(var e={},n=0,r=0;n<a;n+=1){var i=s[n];if("string"==typeof i)r+=i.length;else {var o=i.regex,f=i.parser,u=t.substr(r),h=o.exec(u)[0];f.call(e,h),t=t.replace(h,"");}}return function(t){var e=t.afternoon;if(void 0!==e){var n=t.hours;e?n<12&&(t.hours+=12):12===n&&(t.hours=0),delete t.afternoon;}}(e),e}}return function(t,e,n){n.p.customParseFormat=!0,t&&t.parseTwoDigitYear&&(s=t.parseTwoDigitYear);var r=e.prototype,i=r.parse;r.parse=function(t){var e=t.date,r=t.utc,s=t.args;this.$u=r;var a=s[1];if("string"==typeof a){var f=!0===s[2],u=!0===s[3],h=f||u,d=s[2];u&&(d=s[2]),o=this.$locale(),!f&&d&&(o=n.Ls[d]),this.$d=function(t,e,n){try{if(["x","X"].indexOf(e)>-1)return new Date(("X"===e?1e3:1)*t);var r=c(e)(t),i=r.year,o=r.month,s=r.day,a=r.hours,f=r.minutes,u=r.seconds,h=r.milliseconds,d=r.zone,l=new Date,m=s||(i||o?1:l.getDate()),M=i||l.getFullYear(),Y=0;i&&!o||(Y=o>0?o-1:l.getMonth());var p=a||0,v=f||0,D=u||0,g=h||0;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)}catch(t){return new Date("")}}(e,a,r),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),h&&e!=this.format(a)&&(this.$d=new Date("")),o={};}else if(a instanceof Array)for(var l=a.length,m=1;m<=l;m+=1){s[1]=a[m-1];var M=n.apply(this,s);if(M.isValid()){this.$d=M.$d,this.$L=M.$L,this.init();break}m===l&&(this.$d=new Date(""));}else i.call(this,t);};}}));
|
|
38580
|
+
}(customParseFormat$1));
|
|
39003
38581
|
|
|
39004
|
-
|
|
39005
|
-
return function (e) {
|
|
39006
|
-
this[t] = +e;
|
|
39007
|
-
};
|
|
39008
|
-
},
|
|
39009
|
-
f = [/[+-]\d\d:?(\d\d)?|Z/, function (t) {
|
|
39010
|
-
(this.zone || (this.zone = {})).offset = function (t) {
|
|
39011
|
-
if (!t) return 0;
|
|
39012
|
-
if ("Z" === t) return 0;
|
|
39013
|
-
var e = t.match(/([+-]|\d\d)/g),
|
|
39014
|
-
n = 60 * e[1] + (+e[2] || 0);
|
|
39015
|
-
return 0 === n ? 0 : "+" === e[0] ? -n : n;
|
|
39016
|
-
}(t);
|
|
39017
|
-
}],
|
|
39018
|
-
u = function u(t) {
|
|
39019
|
-
var e = o[t];
|
|
39020
|
-
return e && (e.indexOf ? e : e.s.concat(e.f));
|
|
39021
|
-
},
|
|
39022
|
-
h = function h(t, e) {
|
|
39023
|
-
var n,
|
|
39024
|
-
r = o.meridiem;
|
|
39025
|
-
|
|
39026
|
-
if (r) {
|
|
39027
|
-
for (var i = 1; i <= 24; i += 1) {
|
|
39028
|
-
if (t.indexOf(r(i, 0, e)) > -1) {
|
|
39029
|
-
n = i > 12;
|
|
39030
|
-
break;
|
|
39031
|
-
}
|
|
39032
|
-
}
|
|
39033
|
-
} else n = t === (e ? "pm" : "PM");
|
|
38582
|
+
var customParseFormat = customParseFormat$1.exports;
|
|
39034
38583
|
|
|
39035
|
-
|
|
39036
|
-
},
|
|
39037
|
-
d = {
|
|
39038
|
-
A: [i, function (t) {
|
|
39039
|
-
this.afternoon = h(t, !1);
|
|
39040
|
-
}],
|
|
39041
|
-
a: [i, function (t) {
|
|
39042
|
-
this.afternoon = h(t, !0);
|
|
39043
|
-
}],
|
|
39044
|
-
S: [/\d/, function (t) {
|
|
39045
|
-
this.milliseconds = 100 * +t;
|
|
39046
|
-
}],
|
|
39047
|
-
SS: [n, function (t) {
|
|
39048
|
-
this.milliseconds = 10 * +t;
|
|
39049
|
-
}],
|
|
39050
|
-
SSS: [/\d{3}/, function (t) {
|
|
39051
|
-
this.milliseconds = +t;
|
|
39052
|
-
}],
|
|
39053
|
-
s: [r, a("seconds")],
|
|
39054
|
-
ss: [r, a("seconds")],
|
|
39055
|
-
m: [r, a("minutes")],
|
|
39056
|
-
mm: [r, a("minutes")],
|
|
39057
|
-
H: [r, a("hours")],
|
|
39058
|
-
h: [r, a("hours")],
|
|
39059
|
-
HH: [r, a("hours")],
|
|
39060
|
-
hh: [r, a("hours")],
|
|
39061
|
-
D: [r, a("day")],
|
|
39062
|
-
DD: [n, a("day")],
|
|
39063
|
-
Do: [i, function (t) {
|
|
39064
|
-
var e = o.ordinal,
|
|
39065
|
-
n = t.match(/\d+/);
|
|
39066
|
-
if (this.day = n[0], e) for (var r = 1; r <= 31; r += 1) {
|
|
39067
|
-
e(r).replace(/\[|\]/g, "") === t && (this.day = r);
|
|
39068
|
-
}
|
|
39069
|
-
}],
|
|
39070
|
-
M: [r, a("month")],
|
|
39071
|
-
MM: [n, a("month")],
|
|
39072
|
-
MMM: [i, function (t) {
|
|
39073
|
-
var e = u("months"),
|
|
39074
|
-
n = (u("monthsShort") || e.map(function (t) {
|
|
39075
|
-
return t.substr(0, 3);
|
|
39076
|
-
})).indexOf(t) + 1;
|
|
39077
|
-
if (n < 1) throw new Error();
|
|
39078
|
-
this.month = n % 12 || n;
|
|
39079
|
-
}],
|
|
39080
|
-
MMMM: [i, function (t) {
|
|
39081
|
-
var e = u("months").indexOf(t) + 1;
|
|
39082
|
-
if (e < 1) throw new Error();
|
|
39083
|
-
this.month = e % 12 || e;
|
|
39084
|
-
}],
|
|
39085
|
-
Y: [/[+-]?\d+/, a("year")],
|
|
39086
|
-
YY: [n, function (t) {
|
|
39087
|
-
this.year = s(t);
|
|
39088
|
-
}],
|
|
39089
|
-
YYYY: [/\d{4}/, a("year")],
|
|
39090
|
-
Z: f,
|
|
39091
|
-
ZZ: f
|
|
39092
|
-
};
|
|
38584
|
+
var isSameOrBefore$1 = {exports: {}};
|
|
39093
38585
|
|
|
39094
|
-
|
|
39095
|
-
|
|
39096
|
-
|
|
39097
|
-
|
|
39098
|
-
for (var s = (n = r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function (e, n, r) {
|
|
39099
|
-
var o = r && r.toUpperCase();
|
|
39100
|
-
return n || i[r] || t[r] || i[o].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function (t, e, n) {
|
|
39101
|
-
return e || n.slice(1);
|
|
39102
|
-
});
|
|
39103
|
-
})).match(e), a = s.length, f = 0; f < a; f += 1) {
|
|
39104
|
-
var u = s[f],
|
|
39105
|
-
h = d[u],
|
|
39106
|
-
c = h && h[0],
|
|
39107
|
-
l = h && h[1];
|
|
39108
|
-
s[f] = l ? {
|
|
39109
|
-
regex: c,
|
|
39110
|
-
parser: l
|
|
39111
|
-
} : u.replace(/^\[|\]$/g, "");
|
|
39112
|
-
}
|
|
39113
|
-
|
|
39114
|
-
return function (t) {
|
|
39115
|
-
for (var e = {}, n = 0, r = 0; n < a; n += 1) {
|
|
39116
|
-
var i = s[n];
|
|
39117
|
-
if ("string" == typeof i) r += i.length;else {
|
|
39118
|
-
var o = i.regex,
|
|
39119
|
-
f = i.parser,
|
|
39120
|
-
u = t.substr(r),
|
|
39121
|
-
h = o.exec(u)[0];
|
|
39122
|
-
f.call(e, h), t = t.replace(h, "");
|
|
39123
|
-
}
|
|
39124
|
-
}
|
|
39125
|
-
|
|
39126
|
-
return function (t) {
|
|
39127
|
-
var e = t.afternoon;
|
|
39128
|
-
|
|
39129
|
-
if (void 0 !== e) {
|
|
39130
|
-
var n = t.hours;
|
|
39131
|
-
e ? n < 12 && (t.hours += 12) : 12 === n && (t.hours = 0), delete t.afternoon;
|
|
39132
|
-
}
|
|
39133
|
-
}(e), e;
|
|
39134
|
-
};
|
|
39135
|
-
}
|
|
39136
|
-
|
|
39137
|
-
return function (t, e, n) {
|
|
39138
|
-
n.p.customParseFormat = !0, t && t.parseTwoDigitYear && (s = t.parseTwoDigitYear);
|
|
39139
|
-
var r = e.prototype,
|
|
39140
|
-
i = r.parse;
|
|
39141
|
-
|
|
39142
|
-
r.parse = function (t) {
|
|
39143
|
-
var e = t.date,
|
|
39144
|
-
r = t.utc,
|
|
39145
|
-
s = t.args;
|
|
39146
|
-
this.$u = r;
|
|
39147
|
-
var a = s[1];
|
|
39148
|
-
|
|
39149
|
-
if ("string" == typeof a) {
|
|
39150
|
-
var f = !0 === s[2],
|
|
39151
|
-
u = !0 === s[3],
|
|
39152
|
-
h = f || u,
|
|
39153
|
-
d = s[2];
|
|
39154
|
-
u && (d = s[2]), o = this.$locale(), !f && d && (o = n.Ls[d]), this.$d = function (t, e, n) {
|
|
39155
|
-
try {
|
|
39156
|
-
if (["x", "X"].indexOf(e) > -1) return new Date(("X" === e ? 1e3 : 1) * t);
|
|
39157
|
-
var r = c(e)(t),
|
|
39158
|
-
i = r.year,
|
|
39159
|
-
o = r.month,
|
|
39160
|
-
s = r.day,
|
|
39161
|
-
a = r.hours,
|
|
39162
|
-
f = r.minutes,
|
|
39163
|
-
u = r.seconds,
|
|
39164
|
-
h = r.milliseconds,
|
|
39165
|
-
d = r.zone,
|
|
39166
|
-
l = new Date(),
|
|
39167
|
-
m = s || (i || o ? 1 : l.getDate()),
|
|
39168
|
-
M = i || l.getFullYear(),
|
|
39169
|
-
Y = 0;
|
|
39170
|
-
i && !o || (Y = o > 0 ? o - 1 : l.getMonth());
|
|
39171
|
-
var p = a || 0,
|
|
39172
|
-
v = f || 0,
|
|
39173
|
-
D = u || 0,
|
|
39174
|
-
g = h || 0;
|
|
39175
|
-
return d ? new Date(Date.UTC(M, Y, m, p, v, D, g + 60 * d.offset * 1e3)) : n ? new Date(Date.UTC(M, Y, m, p, v, D, g)) : new Date(M, Y, m, p, v, D, g);
|
|
39176
|
-
} catch (t) {
|
|
39177
|
-
return new Date("");
|
|
39178
|
-
}
|
|
39179
|
-
}(e, a, r), this.init(), d && !0 !== d && (this.$L = this.locale(d).$L), h && e != this.format(a) && (this.$d = new Date("")), o = {};
|
|
39180
|
-
} else if (a instanceof Array) for (var l = a.length, m = 1; m <= l; m += 1) {
|
|
39181
|
-
s[1] = a[m - 1];
|
|
39182
|
-
var M = n.apply(this, s);
|
|
39183
|
-
|
|
39184
|
-
if (M.isValid()) {
|
|
39185
|
-
this.$d = M.$d, this.$L = M.$L, this.init();
|
|
39186
|
-
break;
|
|
39187
|
-
}
|
|
38586
|
+
(function (module, exports) {
|
|
38587
|
+
!function(e,i){module.exports=i();}(commonjsGlobal$1,(function(){return function(e,i){i.prototype.isSameOrBefore=function(e,i){return this.isSame(e,i)||this.isBefore(e,i)};}}));
|
|
38588
|
+
}(isSameOrBefore$1));
|
|
39188
38589
|
|
|
39189
|
-
|
|
39190
|
-
} else i.call(this, t);
|
|
39191
|
-
};
|
|
39192
|
-
};
|
|
39193
|
-
});
|
|
39194
|
-
})(customParseFormat$1);
|
|
38590
|
+
var isSameOrBefore = isSameOrBefore$1.exports;
|
|
39195
38591
|
|
|
39196
|
-
var
|
|
39197
|
-
var customParseFormat = /*@__PURE__*/getDefaultExportFromCjs(customParseFormatExports);
|
|
39198
|
-
var isSameOrBefore$1 = {
|
|
39199
|
-
exports: {}
|
|
39200
|
-
};
|
|
38592
|
+
var isSameOrAfter$1 = {exports: {}};
|
|
39201
38593
|
|
|
39202
38594
|
(function (module, exports) {
|
|
39203
|
-
|
|
39204
|
-
|
|
39205
|
-
}(commonjsGlobal$1, function () {
|
|
39206
|
-
return function (e, i) {
|
|
39207
|
-
i.prototype.isSameOrBefore = function (e, i) {
|
|
39208
|
-
return this.isSame(e, i) || this.isBefore(e, i);
|
|
39209
|
-
};
|
|
39210
|
-
};
|
|
39211
|
-
});
|
|
39212
|
-
})(isSameOrBefore$1);
|
|
39213
|
-
|
|
39214
|
-
var isSameOrBeforeExports = isSameOrBefore$1.exports;
|
|
39215
|
-
var isSameOrBefore = /*@__PURE__*/getDefaultExportFromCjs(isSameOrBeforeExports);
|
|
39216
|
-
var isSameOrAfter$1 = {
|
|
39217
|
-
exports: {}
|
|
39218
|
-
};
|
|
38595
|
+
!function(e,t){module.exports=t();}(commonjsGlobal$1,(function(){return function(e,t){t.prototype.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)};}}));
|
|
38596
|
+
}(isSameOrAfter$1));
|
|
39219
38597
|
|
|
39220
|
-
|
|
39221
|
-
!function (e, t) {
|
|
39222
|
-
module.exports = t();
|
|
39223
|
-
}(commonjsGlobal$1, function () {
|
|
39224
|
-
return function (e, t) {
|
|
39225
|
-
t.prototype.isSameOrAfter = function (e, t) {
|
|
39226
|
-
return this.isSame(e, t) || this.isAfter(e, t);
|
|
39227
|
-
};
|
|
39228
|
-
};
|
|
39229
|
-
});
|
|
39230
|
-
})(isSameOrAfter$1);
|
|
38598
|
+
var isSameOrAfter = isSameOrAfter$1.exports;
|
|
39231
38599
|
|
|
39232
|
-
var isSameOrAfterExports = isSameOrAfter$1.exports;
|
|
39233
|
-
var isSameOrAfter = /*@__PURE__*/getDefaultExportFromCjs(isSameOrAfterExports);
|
|
39234
38600
|
/* eslint-disable no-unused-vars */
|
|
39235
38601
|
|
|
39236
|
-
|
|
39237
|
-
|
|
39238
|
-
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
39239
|
-
args[_key2] = arguments[_key2];
|
|
39240
|
-
}
|
|
39241
|
-
|
|
39242
|
-
return {
|
|
39243
|
-
type: type,
|
|
39244
|
-
args: args,
|
|
39245
|
-
error: error
|
|
39246
|
-
};
|
|
39247
|
-
};
|
|
39248
|
-
|
|
38602
|
+
const createValidator = (type, error) => {
|
|
38603
|
+
let validator = (...args) => ({ type, args, error });
|
|
39249
38604
|
validator.error = error;
|
|
39250
38605
|
return validator;
|
|
39251
38606
|
};
|
|
@@ -39253,38 +38608,30 @@ var createValidator = function createValidator(type, error) {
|
|
|
39253
38608
|
dayjs.extend(customParseFormat);
|
|
39254
38609
|
dayjs.extend(isSameOrBefore);
|
|
39255
38610
|
dayjs.extend(isSameOrAfter);
|
|
39256
|
-
var validatorFns = {};
|
|
39257
|
-
var INCLUDED_IN = "validator/INCLUDED_IN";
|
|
39258
|
-
var INCLUDED_IN_ERROR = "error/INCLUDED_IN";
|
|
39259
|
-
var includedIn = createValidator(INCLUDED_IN, INCLUDED_IN_ERROR);
|
|
39260
|
-
|
|
39261
|
-
validatorFns[INCLUDED_IN] = function (value, args, form) {
|
|
39262
|
-
return Array.isArray(args[0]) ? args[0].includes(value) : args[0] === value;
|
|
39263
|
-
};
|
|
39264
38611
|
|
|
39265
|
-
|
|
39266
|
-
var REQUIRED_ERROR = "error/REQUIRED";
|
|
39267
|
-
var required = createValidator(REQUIRED, REQUIRED_ERROR);
|
|
38612
|
+
let validatorFns = {};
|
|
39268
38613
|
|
|
39269
|
-
|
|
39270
|
-
|
|
39271
|
-
|
|
38614
|
+
const INCLUDED_IN = "validator/INCLUDED_IN";
|
|
38615
|
+
const INCLUDED_IN_ERROR = "error/INCLUDED_IN";
|
|
38616
|
+
const includedIn = createValidator(INCLUDED_IN, INCLUDED_IN_ERROR);
|
|
38617
|
+
validatorFns[INCLUDED_IN] = (value, args, form) =>
|
|
38618
|
+
Array.isArray(args[0]) ? args[0].includes(value) : args[0] === value;
|
|
39272
38619
|
|
|
39273
|
-
|
|
39274
|
-
|
|
39275
|
-
|
|
38620
|
+
const REQUIRED = "validator/REQUIRED";
|
|
38621
|
+
const REQUIRED_ERROR = "error/REQUIRED";
|
|
38622
|
+
const required = createValidator(REQUIRED, REQUIRED_ERROR);
|
|
38623
|
+
validatorFns[REQUIRED] = (value, args, form) => value !== "";
|
|
39276
38624
|
|
|
39277
|
-
|
|
39278
|
-
|
|
39279
|
-
|
|
38625
|
+
const ONLY_INTEGERS = "validator/ONLY_INTEGERS";
|
|
38626
|
+
const ONLY_INTEGERS_ERROR = "error/ONLY_INTEGERS";
|
|
38627
|
+
const onlyIntegers = createValidator(ONLY_INTEGERS, ONLY_INTEGERS_ERROR);
|
|
38628
|
+
validatorFns[ONLY_INTEGERS] = (value, args, form) => /^(-?\d+)?$/.test(value);
|
|
39280
38629
|
|
|
39281
|
-
|
|
39282
|
-
|
|
39283
|
-
|
|
38630
|
+
const ONLY_NATURALS = "validator/ONLY_NATURALS";
|
|
38631
|
+
const ONLY_NATURALS_ERROR = "error/ONLY_NATURALS";
|
|
38632
|
+
const onlyNaturals = createValidator(ONLY_NATURALS, ONLY_NATURALS_ERROR);
|
|
38633
|
+
validatorFns[ONLY_NATURALS] = (value, args, form) => /^(\d+)?$/.test(value);
|
|
39284
38634
|
|
|
39285
|
-
validatorFns[ONLY_NATURALS] = function (value, args, form) {
|
|
39286
|
-
return /^(\d+)?$/.test(value);
|
|
39287
|
-
};
|
|
39288
38635
|
/*
|
|
39289
38636
|
07/22: experimental expiration date constraint
|
|
39290
38637
|
should allow entry of expiration date using "/" character
|
|
@@ -39294,464 +38641,439 @@ not tested as validation function
|
|
|
39294
38641
|
to validate exp date instead use combo of:
|
|
39295
38642
|
required(), hasLength(), isValidMonth(), dateAfterToday()
|
|
39296
38643
|
*/
|
|
39297
|
-
|
|
39298
|
-
|
|
39299
|
-
|
|
39300
|
-
|
|
39301
|
-
|
|
39302
|
-
|
|
39303
|
-
validatorFns[ONLY_EXPIRATION_DATE] =
|
|
39304
|
-
|
|
39305
|
-
|
|
39306
|
-
|
|
39307
|
-
|
|
39308
|
-
|
|
39309
|
-
|
|
39310
|
-
|
|
39311
|
-
|
|
38644
|
+
const ONLY_EXPIRATION_DATE = "validator/ONLY_EXPIRATION_DATE";
|
|
38645
|
+
const ONLY_EXPIRATION_DATE_ERROR = "error/ONLY_EXPIRATION_DATE";
|
|
38646
|
+
const onlyExpirationDate = createValidator(
|
|
38647
|
+
ONLY_EXPIRATION_DATE,
|
|
38648
|
+
ONLY_EXPIRATION_DATE_ERROR
|
|
38649
|
+
);
|
|
38650
|
+
validatorFns[ONLY_EXPIRATION_DATE] = (value, args, form) =>
|
|
38651
|
+
/^(\d?\d?\/?\d?\d?)?$/.test(value);
|
|
38652
|
+
|
|
38653
|
+
const NUMBER_LESS_THAN = "validator/NUMBER_LESS_THAN";
|
|
38654
|
+
const NUMBER_LESS_THAN_ERROR = "error/NUMBER_LESS_THAN";
|
|
38655
|
+
const numberLessThan = createValidator(
|
|
38656
|
+
NUMBER_LESS_THAN,
|
|
38657
|
+
NUMBER_LESS_THAN_ERROR
|
|
38658
|
+
);
|
|
38659
|
+
validatorFns[NUMBER_LESS_THAN] = (value, args, form) => {
|
|
39312
38660
|
if (value === "") {
|
|
39313
38661
|
return true;
|
|
39314
38662
|
}
|
|
39315
|
-
|
|
39316
38663
|
return Number(value) < args[0];
|
|
39317
38664
|
};
|
|
39318
38665
|
|
|
39319
|
-
|
|
39320
|
-
|
|
39321
|
-
|
|
39322
|
-
|
|
39323
|
-
|
|
38666
|
+
const NUMBER_LESS_THAN_OR_EQUAL_TO =
|
|
38667
|
+
"validator/NUMBER_LESS_THAN_OR_EQUAL_TO";
|
|
38668
|
+
const NUMBER_LESS_THAN_OR_EQUAL_TO_ERROR =
|
|
38669
|
+
"error/NUMBER_LESS_THAN_OR_EQUAL_TO";
|
|
38670
|
+
const numberLessThanOrEqualTo = createValidator(
|
|
38671
|
+
NUMBER_LESS_THAN_OR_EQUAL_TO,
|
|
38672
|
+
NUMBER_LESS_THAN_OR_EQUAL_TO_ERROR
|
|
38673
|
+
);
|
|
38674
|
+
validatorFns[NUMBER_LESS_THAN_OR_EQUAL_TO] = (value, args, form) => {
|
|
39324
38675
|
if (value === "") {
|
|
39325
38676
|
return true;
|
|
39326
38677
|
}
|
|
39327
|
-
|
|
39328
38678
|
return Number(value) <= args[0];
|
|
39329
38679
|
};
|
|
39330
38680
|
|
|
39331
|
-
|
|
39332
|
-
|
|
39333
|
-
|
|
39334
|
-
|
|
39335
|
-
|
|
38681
|
+
const NUMBER_GREATER_THAN = "validator/NUMBER_GREATER_THAN";
|
|
38682
|
+
const NUMBER_GREATER_THAN_ERROR = "error/NUMBER_GREATER_THAN";
|
|
38683
|
+
const numberGreaterThan = createValidator(
|
|
38684
|
+
NUMBER_GREATER_THAN,
|
|
38685
|
+
NUMBER_GREATER_THAN_ERROR
|
|
38686
|
+
);
|
|
38687
|
+
validatorFns[NUMBER_GREATER_THAN] = (value, args, form) => {
|
|
39336
38688
|
if (value === "") {
|
|
39337
38689
|
return true;
|
|
39338
38690
|
}
|
|
39339
|
-
|
|
39340
38691
|
return Number(value) > args[0];
|
|
39341
38692
|
};
|
|
39342
38693
|
|
|
39343
|
-
|
|
39344
|
-
|
|
39345
|
-
|
|
39346
|
-
|
|
39347
|
-
|
|
38694
|
+
const NUMBER_GREATER_THAN_OR_EQUAL_TO =
|
|
38695
|
+
"validator/NUMBER_GREATER_THAN_OR_EQUAL_TO";
|
|
38696
|
+
const NUMBER_GREATER_THAN_OR_EQUAL_TO_ERROR =
|
|
38697
|
+
"error/NUMBER_GREATER_THAN_OR_EQUAL_TO";
|
|
38698
|
+
const numberGreaterThanOrEqualTo = createValidator(
|
|
38699
|
+
NUMBER_GREATER_THAN_OR_EQUAL_TO,
|
|
38700
|
+
NUMBER_GREATER_THAN_OR_EQUAL_TO_ERROR
|
|
38701
|
+
);
|
|
38702
|
+
validatorFns[NUMBER_GREATER_THAN_OR_EQUAL_TO] = (value, args, form) => {
|
|
39348
38703
|
if (value === "") {
|
|
39349
38704
|
return true;
|
|
39350
38705
|
}
|
|
39351
|
-
|
|
39352
38706
|
return Number(value) >= args[0];
|
|
39353
38707
|
};
|
|
39354
38708
|
|
|
39355
|
-
|
|
39356
|
-
|
|
39357
|
-
|
|
39358
|
-
|
|
39359
|
-
|
|
39360
|
-
var dependentField = form[args[0]];
|
|
39361
|
-
|
|
38709
|
+
const MATCHES_FIELD = "validator/MATCHES_FIELD";
|
|
38710
|
+
const MATCHES_FIELD_ERROR$1 = "error/MATCHES_FIELD";
|
|
38711
|
+
const matchesField = createValidator(MATCHES_FIELD, MATCHES_FIELD_ERROR$1);
|
|
38712
|
+
validatorFns[MATCHES_FIELD] = (value, args, form) => {
|
|
38713
|
+
const dependentField = form[args[0]];
|
|
39362
38714
|
if (dependentField === undefined) {
|
|
39363
|
-
throw new Error(
|
|
38715
|
+
throw new Error(
|
|
38716
|
+
`${args[0]} was passed to matchesField, but that field does not exist in the form`
|
|
38717
|
+
);
|
|
39364
38718
|
}
|
|
39365
|
-
|
|
39366
|
-
var dependentFieldValue = dependentField.rawValue;
|
|
38719
|
+
const dependentFieldValue = dependentField.rawValue;
|
|
39367
38720
|
return value === dependentFieldValue;
|
|
39368
38721
|
};
|
|
39369
38722
|
|
|
39370
|
-
|
|
39371
|
-
|
|
39372
|
-
|
|
39373
|
-
|
|
39374
|
-
|
|
39375
|
-
|
|
39376
|
-
|
|
39377
|
-
|
|
39378
|
-
|
|
39379
|
-
|
|
39380
|
-
|
|
39381
|
-
|
|
39382
|
-
|
|
39383
|
-
|
|
39384
|
-
|
|
38723
|
+
const validateWhenErrorMessage = type =>
|
|
38724
|
+
`${type} was passed to validateWhen, but that validator type does not exist.
|
|
38725
|
+
Please check that you are only calling validator creator functions exported from
|
|
38726
|
+
redux-freeform in your form config and that you didn't forget to
|
|
38727
|
+
invoke the validator creator (you cannot pass the functions themselves to
|
|
38728
|
+
createFormState). Also make sure you aren't passing validateWhen() to validateWhen
|
|
38729
|
+
as the primary validator.`;
|
|
38730
|
+
|
|
38731
|
+
const VALIDATE_WHEN = "validator/VALIDATE_WHEN";
|
|
38732
|
+
const VALIDATE_WHEN_ERROR = "error/VALIDATE_WHEN";
|
|
38733
|
+
const validateWhen = (
|
|
38734
|
+
dependentValidator,
|
|
38735
|
+
primaryValidator,
|
|
38736
|
+
optionalFieldName
|
|
38737
|
+
) => ({
|
|
38738
|
+
type: VALIDATE_WHEN,
|
|
38739
|
+
args: [dependentValidator, primaryValidator, optionalFieldName],
|
|
38740
|
+
error: dependentValidator.error
|
|
38741
|
+
});
|
|
39385
38742
|
validateWhen.error = VALIDATE_WHEN_ERROR;
|
|
39386
|
-
|
|
39387
|
-
|
|
39388
|
-
|
|
39389
|
-
|
|
39390
|
-
|
|
39391
|
-
|
|
39392
|
-
|
|
39393
|
-
|
|
39394
|
-
|
|
39395
|
-
if (primaryValidator.type === undefined || typeof validatorFns[primaryValidator.type] !== "function") {
|
|
38743
|
+
validatorFns[VALIDATE_WHEN] = (value, args, form) => {
|
|
38744
|
+
const [dependentValidator, primaryValidator, optionalFieldName] = args;
|
|
38745
|
+
const dependsOnOtherField = typeof optionalFieldName === "string";
|
|
38746
|
+
|
|
38747
|
+
if (
|
|
38748
|
+
primaryValidator.type === undefined ||
|
|
38749
|
+
typeof validatorFns[primaryValidator.type] !== "function"
|
|
38750
|
+
) {
|
|
39396
38751
|
throw new Error(validateWhenErrorMessage(primaryValidator.type));
|
|
39397
38752
|
}
|
|
39398
|
-
|
|
39399
38753
|
if (dependsOnOtherField && form[optionalFieldName] === undefined) {
|
|
39400
|
-
throw new Error(
|
|
38754
|
+
throw new Error(
|
|
38755
|
+
`${args[2]} was passed to matchesField, but that field does not exist in the form`
|
|
38756
|
+
);
|
|
39401
38757
|
}
|
|
39402
38758
|
|
|
39403
|
-
|
|
39404
|
-
|
|
39405
|
-
|
|
39406
|
-
|
|
39407
|
-
|
|
39408
|
-
|
|
39409
|
-
|
|
39410
|
-
|
|
39411
|
-
|
|
39412
|
-
|
|
39413
|
-
|
|
39414
|
-
|
|
39415
|
-
|
|
39416
|
-
|
|
39417
|
-
|
|
39418
|
-
|
|
39419
|
-
|
|
39420
|
-
|
|
39421
|
-
|
|
39422
|
-
|
|
39423
|
-
|
|
38759
|
+
const primaryPredicate = validatorToPredicate(
|
|
38760
|
+
validatorFns[primaryValidator.type],
|
|
38761
|
+
false
|
|
38762
|
+
);
|
|
38763
|
+
const primaryValue = dependsOnOtherField
|
|
38764
|
+
? form[optionalFieldName].rawValue
|
|
38765
|
+
: value;
|
|
38766
|
+
const primaryPredicatePassed = primaryPredicate(
|
|
38767
|
+
primaryValue,
|
|
38768
|
+
primaryValidator.args,
|
|
38769
|
+
form
|
|
38770
|
+
);
|
|
38771
|
+
|
|
38772
|
+
return primaryPredicatePassed
|
|
38773
|
+
? validatorFns[dependentValidator.type](
|
|
38774
|
+
value,
|
|
38775
|
+
dependentValidator.args,
|
|
38776
|
+
form
|
|
38777
|
+
)
|
|
38778
|
+
: true;
|
|
38779
|
+
};
|
|
38780
|
+
|
|
38781
|
+
const validateSumErrorMessage = type =>
|
|
38782
|
+
`${type} was passed to validateSum, but that validator type does not exist.
|
|
38783
|
+
Please check that you are only calling validator creator functions exported from
|
|
38784
|
+
redux-freeform in your form config and that you didn't forget to
|
|
38785
|
+
invoke the validator creator (you cannot pass the functions themselves to
|
|
38786
|
+
createFormState).`;
|
|
38787
|
+
const VALIDATE_SUM = "validator/VALIDATE_SUM";
|
|
38788
|
+
const VALIDATE_SUM_ERROR = "error/VALIDATE_SUM";
|
|
38789
|
+
const validateSum = (validator, fieldNamesArray) => ({
|
|
38790
|
+
type: VALIDATE_SUM,
|
|
38791
|
+
args: [validator, fieldNamesArray],
|
|
38792
|
+
error: validator.error
|
|
38793
|
+
});
|
|
39424
38794
|
validateSum.error = VALIDATE_SUM_ERROR;
|
|
38795
|
+
validatorFns[VALIDATE_SUM] = (value, args, form) => {
|
|
38796
|
+
const [validator, fieldNamesArray] = args;
|
|
39425
38797
|
|
|
39426
|
-
|
|
39427
|
-
|
|
39428
|
-
|
|
39429
|
-
|
|
39430
|
-
|
|
39431
|
-
if (validator.type === undefined || typeof validatorFns[validator.type] !== "function") {
|
|
38798
|
+
if (
|
|
38799
|
+
validator.type === undefined ||
|
|
38800
|
+
typeof validatorFns[validator.type] !== "function"
|
|
38801
|
+
) {
|
|
39432
38802
|
throw new Error(validateSumErrorMessage(validator.type));
|
|
39433
38803
|
}
|
|
39434
38804
|
|
|
39435
|
-
|
|
39436
|
-
|
|
39437
|
-
|
|
39438
|
-
|
|
39439
|
-
|
|
39440
|
-
var fieldName = _step.value;
|
|
39441
|
-
|
|
39442
|
-
if (form[fieldName] === undefined) {
|
|
39443
|
-
throw new Error("".concat(fieldName, " was passed to matchesField, but that field does not exist in the form"));
|
|
39444
|
-
}
|
|
38805
|
+
for (const fieldName of fieldNamesArray) {
|
|
38806
|
+
if (form[fieldName] === undefined) {
|
|
38807
|
+
throw new Error(
|
|
38808
|
+
`${fieldName} was passed to matchesField, but that field does not exist in the form`
|
|
38809
|
+
);
|
|
39445
38810
|
}
|
|
39446
|
-
} catch (err) {
|
|
39447
|
-
_iterator.e(err);
|
|
39448
|
-
} finally {
|
|
39449
|
-
_iterator.f();
|
|
39450
38811
|
}
|
|
39451
38812
|
|
|
39452
|
-
|
|
39453
|
-
|
|
39454
|
-
|
|
38813
|
+
const sum = fieldNamesArray.reduce(
|
|
38814
|
+
(acc, curr) => acc + Number(form[curr].rawValue),
|
|
38815
|
+
Number(value)
|
|
38816
|
+
);
|
|
38817
|
+
|
|
39455
38818
|
return validatorFns[validator.type](sum, validator.args, form);
|
|
39456
38819
|
};
|
|
39457
38820
|
|
|
39458
|
-
|
|
39459
|
-
|
|
39460
|
-
|
|
39461
|
-
|
|
39462
|
-
validatorFns[HAS_LENGTH] = function (value, args, form) {
|
|
38821
|
+
const HAS_LENGTH = "validator/HAS_LENGTH";
|
|
38822
|
+
const HAS_LENGTH_ERROR = "error/HAS_LENGTH";
|
|
38823
|
+
const hasLength = createValidator(HAS_LENGTH, HAS_LENGTH_ERROR);
|
|
38824
|
+
validatorFns[HAS_LENGTH] = (value, args, form) => {
|
|
39463
38825
|
if (value === "") {
|
|
39464
38826
|
return true;
|
|
39465
38827
|
}
|
|
39466
|
-
|
|
39467
|
-
|
|
39468
|
-
var max = args[1];
|
|
39469
|
-
|
|
38828
|
+
const min = args[0];
|
|
38829
|
+
const max = args[1];
|
|
39470
38830
|
if (max == undefined || min == undefined) {
|
|
39471
|
-
throw new Error(
|
|
38831
|
+
throw new Error(
|
|
38832
|
+
"Max and min need to be defined for hasLength, both or one of them is undefined"
|
|
38833
|
+
);
|
|
39472
38834
|
}
|
|
39473
|
-
|
|
39474
38835
|
if (max < min) {
|
|
39475
|
-
throw new Error(
|
|
38836
|
+
throw new Error(
|
|
38837
|
+
"hasLength validator was passed a min greater than the max"
|
|
38838
|
+
);
|
|
39476
38839
|
}
|
|
39477
|
-
|
|
39478
|
-
var valueLength = value.length;
|
|
38840
|
+
const valueLength = value.length;
|
|
39479
38841
|
return max >= valueLength && valueLength >= min;
|
|
39480
38842
|
};
|
|
39481
38843
|
|
|
39482
|
-
|
|
39483
|
-
|
|
39484
|
-
|
|
39485
|
-
|
|
39486
|
-
|
|
38844
|
+
const DATE_BEFORE_TODAY = "validator/DATE_BEFORE_TODAY";
|
|
38845
|
+
const DATE_BEFORE_TODAY_ERROR = "error/DATE_BEFORE_TODAY";
|
|
38846
|
+
const dateBeforeToday = createValidator(
|
|
38847
|
+
DATE_BEFORE_TODAY,
|
|
38848
|
+
DATE_BEFORE_TODAY_ERROR
|
|
38849
|
+
);
|
|
38850
|
+
validatorFns[DATE_BEFORE_TODAY] = (value, args, form) => {
|
|
39487
38851
|
if (value === "") {
|
|
39488
38852
|
return true;
|
|
39489
38853
|
}
|
|
39490
|
-
|
|
39491
|
-
|
|
39492
|
-
|
|
39493
|
-
var inclusive = args[2] || false;
|
|
38854
|
+
const dateFormat = args[0];
|
|
38855
|
+
const unit = args[1];
|
|
38856
|
+
const inclusive = args[2] || false;
|
|
39494
38857
|
|
|
39495
38858
|
if (dateFormat == undefined || unit == undefined) {
|
|
39496
|
-
throw new Error(
|
|
38859
|
+
throw new Error(
|
|
38860
|
+
"Date format and unit need to be defined for dateBeforeToday, one or both are undefined"
|
|
38861
|
+
);
|
|
39497
38862
|
}
|
|
39498
|
-
|
|
39499
|
-
|
|
39500
|
-
var dateValue = dayjs(value, dateFormat);
|
|
38863
|
+
const now = dayjs();
|
|
38864
|
+
const dateValue = dayjs(value, dateFormat);
|
|
39501
38865
|
|
|
39502
38866
|
if (inclusive === true) {
|
|
39503
38867
|
return dateValue.isSameOrBefore(now, unit);
|
|
39504
38868
|
}
|
|
39505
|
-
|
|
39506
38869
|
return dateValue.isBefore(now, unit);
|
|
39507
38870
|
};
|
|
39508
38871
|
|
|
39509
|
-
|
|
39510
|
-
|
|
39511
|
-
|
|
39512
|
-
|
|
39513
|
-
|
|
38872
|
+
const DATE_AFTER_TODAY = "validator/DATE_AFTER_TODAY";
|
|
38873
|
+
const DATE_AFTER_TODAY_ERROR = "error/DATE_AFTER_TODAY";
|
|
38874
|
+
const dateAfterToday = createValidator(
|
|
38875
|
+
DATE_AFTER_TODAY,
|
|
38876
|
+
DATE_AFTER_TODAY_ERROR
|
|
38877
|
+
);
|
|
38878
|
+
validatorFns[DATE_AFTER_TODAY] = (value, args, form) => {
|
|
39514
38879
|
if (value === "") {
|
|
39515
38880
|
return true;
|
|
39516
38881
|
}
|
|
39517
|
-
|
|
39518
|
-
|
|
39519
|
-
|
|
39520
|
-
var inclusive = args[2] || false;
|
|
38882
|
+
const dateFormat = args[0];
|
|
38883
|
+
const unit = args[1];
|
|
38884
|
+
const inclusive = args[2] || false;
|
|
39521
38885
|
|
|
39522
38886
|
if (dateFormat == undefined || unit == undefined) {
|
|
39523
|
-
throw new Error(
|
|
38887
|
+
throw new Error(
|
|
38888
|
+
"Date format and unit need to be defined for dateAfterToday, one or both are undefined"
|
|
38889
|
+
);
|
|
39524
38890
|
}
|
|
39525
|
-
|
|
39526
|
-
|
|
39527
|
-
var dateValue = dayjs(value, dateFormat);
|
|
38891
|
+
const now = dayjs();
|
|
38892
|
+
const dateValue = dayjs(value, dateFormat);
|
|
39528
38893
|
|
|
39529
38894
|
if (inclusive === true) {
|
|
39530
38895
|
return dateValue.isSameOrAfter(now, unit);
|
|
39531
38896
|
}
|
|
39532
|
-
|
|
39533
38897
|
return dateValue.isAfter(now, unit);
|
|
39534
38898
|
};
|
|
39535
38899
|
|
|
39536
|
-
|
|
39537
|
-
|
|
39538
|
-
|
|
39539
|
-
|
|
39540
|
-
|
|
38900
|
+
const IS_VALID_MONTH = "validator/IS_VALID_MONTH";
|
|
38901
|
+
const IS_VALID_MONTH_ERROR = "error/IS_VALID_MONTH";
|
|
38902
|
+
const isValidMonth = createValidator(
|
|
38903
|
+
IS_VALID_MONTH,
|
|
38904
|
+
IS_VALID_MONTH_ERROR
|
|
38905
|
+
);
|
|
38906
|
+
validatorFns[IS_VALID_MONTH] = (value, args, form) => {
|
|
39541
38907
|
if (value === "") {
|
|
39542
38908
|
return true;
|
|
39543
|
-
}
|
|
38909
|
+
}
|
|
38910
|
+
// Function takes one argument representing the character position
|
|
39544
38911
|
// In a date string to identify where the month is
|
|
39545
38912
|
// Eg "10/21/2021" - start position is 0
|
|
39546
38913
|
// Or "18/03/1990" - start position is 3
|
|
39547
38914
|
// Only works with two digit months (01, 02, 03, etc)
|
|
39548
|
-
|
|
39549
|
-
|
|
39550
|
-
|
|
39551
|
-
var monthEndPosition = monthStartPosition + 2;
|
|
39552
|
-
|
|
39553
|
-
if (isNaN(monthStartPosition)) {
|
|
38915
|
+
const monthStartPosition = parseInt(args[0]);
|
|
38916
|
+
const monthEndPosition = monthStartPosition + 2;
|
|
38917
|
+
if (monthStartPosition === NaN) {
|
|
39554
38918
|
throw new Error("Month start position has to be a valid integer string");
|
|
39555
38919
|
}
|
|
39556
|
-
|
|
39557
|
-
|
|
39558
|
-
|
|
39559
|
-
if (isNaN(month)) {
|
|
38920
|
+
const month = parseInt(value.slice(monthStartPosition, monthEndPosition));
|
|
38921
|
+
if (month === NaN) {
|
|
39560
38922
|
return false;
|
|
39561
38923
|
}
|
|
39562
|
-
|
|
39563
38924
|
return month >= 1 && month <= 12;
|
|
39564
38925
|
};
|
|
39565
38926
|
|
|
39566
|
-
|
|
39567
|
-
|
|
39568
|
-
|
|
39569
|
-
|
|
39570
|
-
validatorFns[MATCHES_REGEX] = function (value, args, form) {
|
|
38927
|
+
const MATCHES_REGEX = "validator/MATCHES_REGEX";
|
|
38928
|
+
const MATCHES_REGEX_ERROR = "error/MATCHES_REGEX";
|
|
38929
|
+
const matchesRegex = createValidator(MATCHES_REGEX, MATCHES_REGEX_ERROR);
|
|
38930
|
+
validatorFns[MATCHES_REGEX] = (value, args, form) => {
|
|
39571
38931
|
if (value === "") {
|
|
39572
38932
|
return true;
|
|
39573
38933
|
}
|
|
39574
|
-
|
|
39575
38934
|
return new RegExp(args[0]).test(value); // new RexExp never throws an error, no matter the input
|
|
39576
|
-
};
|
|
39577
|
-
|
|
39578
|
-
|
|
39579
|
-
var IS_ROUTING_NUMBER = "validator/IS_ROUTING_NUMBER";
|
|
39580
|
-
var IS_ROUTING_NUMBER_ERROR = "error/IS_ROUTING_NUMBER";
|
|
39581
|
-
var isRoutingNumber = createValidator(IS_ROUTING_NUMBER, IS_ROUTING_NUMBER_ERROR);
|
|
38935
|
+
};
|
|
39582
38936
|
|
|
39583
|
-
|
|
38937
|
+
// based on http://www.brainjar.com/js/validation/
|
|
38938
|
+
const IS_ROUTING_NUMBER = "validator/IS_ROUTING_NUMBER";
|
|
38939
|
+
const IS_ROUTING_NUMBER_ERROR = "error/IS_ROUTING_NUMBER";
|
|
38940
|
+
const isRoutingNumber = createValidator(
|
|
38941
|
+
IS_ROUTING_NUMBER,
|
|
38942
|
+
IS_ROUTING_NUMBER_ERROR
|
|
38943
|
+
);
|
|
38944
|
+
validatorFns[IS_ROUTING_NUMBER] = (value, args, form) => {
|
|
39584
38945
|
if (value === "") {
|
|
39585
38946
|
return true;
|
|
39586
38947
|
}
|
|
39587
|
-
|
|
39588
38948
|
if (value.length != 9) {
|
|
39589
38949
|
return false;
|
|
39590
38950
|
}
|
|
39591
|
-
|
|
39592
|
-
|
|
39593
|
-
|
|
39594
|
-
|
|
39595
|
-
|
|
39596
|
-
|
|
39597
|
-
|
|
39598
|
-
|
|
39599
|
-
|
|
39600
|
-
|
|
39601
|
-
|
|
39602
|
-
|
|
39603
|
-
|
|
39604
|
-
}
|
|
39605
|
-
}, 0);
|
|
38951
|
+
const sum = value
|
|
38952
|
+
.split("")
|
|
38953
|
+
.map(ch => parseInt(ch))
|
|
38954
|
+
.reduce((acc, cur, idx) => {
|
|
38955
|
+
switch (idx % 3) {
|
|
38956
|
+
case 0:
|
|
38957
|
+
return acc + 3 * cur;
|
|
38958
|
+
case 1:
|
|
38959
|
+
return acc + 7 * cur;
|
|
38960
|
+
case 2:
|
|
38961
|
+
return acc + 1 * cur;
|
|
38962
|
+
}
|
|
38963
|
+
}, 0);
|
|
39606
38964
|
return sum != 0 && sum % 10 == 0;
|
|
39607
38965
|
};
|
|
39608
38966
|
|
|
39609
|
-
|
|
39610
|
-
|
|
39611
|
-
|
|
39612
|
-
|
|
39613
|
-
validatorFns[HAS_NUMBER] = function (value, args, form) {
|
|
38967
|
+
const HAS_NUMBER = "validator/HAS_NUMBER";
|
|
38968
|
+
const HAS_NUMBER_ERROR$1 = "error/HAS_NUMBER";
|
|
38969
|
+
const hasNumber = createValidator(HAS_NUMBER, HAS_NUMBER_ERROR$1);
|
|
38970
|
+
validatorFns[HAS_NUMBER] = (value, args, form) => {
|
|
39614
38971
|
if (value === "") {
|
|
39615
38972
|
return true;
|
|
39616
38973
|
}
|
|
39617
|
-
|
|
39618
38974
|
return new RegExp(/[0-9]/).test(value);
|
|
39619
38975
|
};
|
|
39620
38976
|
|
|
39621
|
-
|
|
39622
|
-
|
|
39623
|
-
|
|
39624
|
-
|
|
39625
|
-
|
|
38977
|
+
const HAS_LOWERCASE_LETTER = "validator/HAS_LOWERCASE_LETTER";
|
|
38978
|
+
const HAS_LOWERCASE_LETTER_ERROR$1 = "error/HAS_LOWERCASE_LETTER";
|
|
38979
|
+
const hasLowercaseLetter = createValidator(
|
|
38980
|
+
HAS_LOWERCASE_LETTER,
|
|
38981
|
+
HAS_LOWERCASE_LETTER_ERROR$1
|
|
38982
|
+
);
|
|
38983
|
+
validatorFns[HAS_LOWERCASE_LETTER] = (value, args, form) => {
|
|
39626
38984
|
if (value === "") {
|
|
39627
38985
|
return true;
|
|
39628
38986
|
}
|
|
39629
|
-
|
|
39630
38987
|
return new RegExp(/[a-z]/).test(value);
|
|
39631
38988
|
};
|
|
39632
38989
|
|
|
39633
|
-
|
|
39634
|
-
|
|
39635
|
-
|
|
39636
|
-
|
|
39637
|
-
|
|
38990
|
+
const HAS_UPPERCASE_LETTER = "validator/HAS_UPPERCASE_LETTER";
|
|
38991
|
+
const HAS_UPPERCASE_LETTER_ERROR$1 = "error/HAS_UPPERCASE_LETTER";
|
|
38992
|
+
const hasUppercaseLetter = createValidator(
|
|
38993
|
+
HAS_UPPERCASE_LETTER,
|
|
38994
|
+
HAS_UPPERCASE_LETTER_ERROR$1
|
|
38995
|
+
);
|
|
38996
|
+
validatorFns[HAS_UPPERCASE_LETTER] = (value, args, form) => {
|
|
39638
38997
|
if (value === "") {
|
|
39639
38998
|
return true;
|
|
39640
38999
|
}
|
|
39641
|
-
|
|
39642
39000
|
return new RegExp(/[A-Z]/).test(value);
|
|
39643
39001
|
};
|
|
39644
39002
|
|
|
39645
|
-
|
|
39646
|
-
|
|
39647
|
-
|
|
39648
|
-
|
|
39649
|
-
|
|
39003
|
+
const HAS_SPECIAL_CHARACTER = "validator/HAS_SPECIAL_CHARACTER";
|
|
39004
|
+
const HAS_SPECIAL_CHARACTER_ERROR$1 = "error/HAS_SPECIAL_CHARACTER";
|
|
39005
|
+
const hasSpecialCharacter = createValidator(
|
|
39006
|
+
HAS_SPECIAL_CHARACTER,
|
|
39007
|
+
HAS_SPECIAL_CHARACTER_ERROR$1
|
|
39008
|
+
);
|
|
39009
|
+
validatorFns[HAS_SPECIAL_CHARACTER] = (value, args, form) => {
|
|
39650
39010
|
if (value === "") {
|
|
39651
39011
|
return true;
|
|
39652
39012
|
}
|
|
39653
|
-
|
|
39654
39013
|
return new RegExp(/[!@#$%^&*.?]/).test(value);
|
|
39655
39014
|
};
|
|
39656
39015
|
|
|
39657
|
-
|
|
39658
|
-
|
|
39659
|
-
|
|
39660
|
-
|
|
39661
|
-
|
|
39016
|
+
const IS_PROBABLY_EMAIL = "validator/IS_PROBABLY_EMAIL";
|
|
39017
|
+
const IS_PROBABLY_EMAIL_ERROR = "error/IS_PROBABLY_EMAIL";
|
|
39018
|
+
const isProbablyEmail = createValidator(
|
|
39019
|
+
IS_PROBABLY_EMAIL,
|
|
39020
|
+
IS_PROBABLY_EMAIL_ERROR
|
|
39021
|
+
);
|
|
39022
|
+
validatorFns[IS_PROBABLY_EMAIL] = (value, args, form) => {
|
|
39662
39023
|
if (value === "") {
|
|
39663
39024
|
return true;
|
|
39664
39025
|
}
|
|
39665
|
-
|
|
39666
39026
|
return new RegExp(/^\S+@\S+\.\S+$/).test(value);
|
|
39667
39027
|
};
|
|
39668
39028
|
|
|
39669
|
-
|
|
39670
|
-
|
|
39671
|
-
|
|
39672
|
-
|
|
39673
|
-
|
|
39674
|
-
|
|
39029
|
+
const runValidatorErrorMessage = type =>
|
|
39030
|
+
`${type} was passed to runValidator, but that validator type does not exist.
|
|
39031
|
+
Please check that you are only calling validator creator functions exported from
|
|
39032
|
+
redux-freeform in your form config and that you didn't forget to
|
|
39033
|
+
invoke the validator creator (you cannot pass the functions themselves to
|
|
39034
|
+
createFormState)`;
|
|
39675
39035
|
|
|
39036
|
+
const runValidator = (validator, value, form) => {
|
|
39037
|
+
const validatorFn = validatorFns[validator.type];
|
|
39676
39038
|
if (validatorFn === undefined) {
|
|
39677
39039
|
throw new Error(runValidatorErrorMessage(validator.type));
|
|
39678
39040
|
}
|
|
39679
|
-
|
|
39680
39041
|
return validatorFn(value, validator.args, form) ? null : validator.error;
|
|
39681
39042
|
};
|
|
39682
39043
|
|
|
39683
|
-
|
|
39684
|
-
return validators
|
|
39685
|
-
|
|
39686
|
-
|
|
39687
|
-
return x !== null;
|
|
39688
|
-
});
|
|
39689
|
-
};
|
|
39690
|
-
|
|
39691
|
-
var computeConstraints = function computeConstraints(fieldName, form) {
|
|
39692
|
-
var constraints = form[fieldName].constraints;
|
|
39693
|
-
return runFormValidators(fieldName, form, constraints);
|
|
39044
|
+
const _computeErrors = (fieldName, form, validators) => {
|
|
39045
|
+
return validators
|
|
39046
|
+
.map(v => runValidator(v, form[fieldName].rawValue, form))
|
|
39047
|
+
.filter(x => x !== null);
|
|
39694
39048
|
};
|
|
39695
39049
|
|
|
39696
|
-
|
|
39697
|
-
|
|
39698
|
-
return
|
|
39050
|
+
const computeConstraints = (fieldName, form) => {
|
|
39051
|
+
const constraints = form[fieldName].constraints;
|
|
39052
|
+
return _computeErrors(fieldName, form, constraints);
|
|
39699
39053
|
};
|
|
39700
39054
|
|
|
39701
|
-
|
|
39702
|
-
|
|
39703
|
-
|
|
39704
|
-
for (var _i = 0, _fields = fields; _i < _fields.length; _i++) {
|
|
39705
|
-
var entry = _fields[_i];
|
|
39706
|
-
var fieldName = entry[0];
|
|
39707
|
-
var errors = computeErrors(fieldName, formState);
|
|
39708
|
-
formState[fieldName].errors = errors;
|
|
39709
|
-
formState[fieldName].hasErrors = errors.length > 0;
|
|
39710
|
-
}
|
|
39711
|
-
};
|
|
39712
|
-
|
|
39713
|
-
var computeDirtyEntries = function computeDirtyEntries(formState, changedFieldName) {
|
|
39714
|
-
var fields = Object.entries(formState);
|
|
39715
|
-
|
|
39716
|
-
for (var _i2 = 0, _fields2 = fields; _i2 < _fields2.length; _i2++) {
|
|
39717
|
-
var entry = _fields2[_i2];
|
|
39718
|
-
var fieldName = entry[0];
|
|
39719
|
-
var field = entry[1];
|
|
39720
|
-
var dirty = fieldName === changedFieldName ? true : field.dirty;
|
|
39721
|
-
formState[fieldName].dirty = dirty;
|
|
39722
|
-
}
|
|
39055
|
+
const computeErrors = (fieldName, form) => {
|
|
39056
|
+
const validators = form[fieldName].validators;
|
|
39057
|
+
return _computeErrors(fieldName, form, validators);
|
|
39723
39058
|
};
|
|
39724
39059
|
|
|
39725
39060
|
var obj;
|
|
39726
|
-
var NOTHING = typeof Symbol !== "undefined" ? Symbol("immer-nothing") : (obj = {}, obj["immer-nothing"] = true, obj);
|
|
39727
|
-
var DRAFTABLE = typeof Symbol !== "undefined" && Symbol
|
|
39728
|
-
var DRAFT_STATE = typeof Symbol !== "undefined" && Symbol
|
|
39729
|
-
|
|
39061
|
+
var NOTHING = typeof Symbol !== "undefined" ? Symbol("immer-nothing") : ( obj = {}, obj["immer-nothing"] = true, obj );
|
|
39062
|
+
var DRAFTABLE = typeof Symbol !== "undefined" && Symbol.for ? Symbol.for("immer-draftable") : "__$immer_draftable";
|
|
39063
|
+
var DRAFT_STATE = typeof Symbol !== "undefined" && Symbol.for ? Symbol.for("immer-state") : "__$immer_state";
|
|
39730
39064
|
function isDraft(value) {
|
|
39731
39065
|
return !!value && !!value[DRAFT_STATE];
|
|
39732
39066
|
}
|
|
39733
|
-
|
|
39734
39067
|
function isDraftable(value) {
|
|
39735
|
-
if (!value) {
|
|
39736
|
-
return false;
|
|
39737
|
-
}
|
|
39738
|
-
|
|
39068
|
+
if (!value) { return false; }
|
|
39739
39069
|
return isPlainObject(value) || !!value[DRAFTABLE] || !!value.constructor[DRAFTABLE];
|
|
39740
39070
|
}
|
|
39741
|
-
|
|
39742
39071
|
function isPlainObject(value) {
|
|
39743
|
-
if (!value ||
|
|
39744
|
-
|
|
39745
|
-
}
|
|
39746
|
-
|
|
39747
|
-
if (Array.isArray(value)) {
|
|
39748
|
-
return true;
|
|
39749
|
-
}
|
|
39750
|
-
|
|
39072
|
+
if (!value || typeof value !== "object") { return false; }
|
|
39073
|
+
if (Array.isArray(value)) { return true; }
|
|
39751
39074
|
var proto = Object.getPrototypeOf(value);
|
|
39752
39075
|
return !proto || proto === Object.prototype;
|
|
39753
39076
|
}
|
|
39754
|
-
|
|
39755
39077
|
var assign = Object.assign || function assign(target, value) {
|
|
39756
39078
|
for (var key in value) {
|
|
39757
39079
|
if (has$1(value, key)) {
|
|
@@ -39761,18 +39083,11 @@ var assign = Object.assign || function assign(target, value) {
|
|
|
39761
39083
|
|
|
39762
39084
|
return target;
|
|
39763
39085
|
};
|
|
39764
|
-
|
|
39765
|
-
var ownKeys$2 = typeof Reflect !== "undefined" && Reflect.ownKeys ? Reflect.ownKeys : typeof Object.getOwnPropertySymbols !== "undefined" ? function (obj) {
|
|
39766
|
-
return Object.getOwnPropertyNames(obj).concat(Object.getOwnPropertySymbols(obj));
|
|
39767
|
-
} : Object.getOwnPropertyNames;
|
|
39768
|
-
|
|
39086
|
+
var ownKeys$2 = typeof Reflect !== "undefined" && Reflect.ownKeys ? Reflect.ownKeys : typeof Object.getOwnPropertySymbols !== "undefined" ? function (obj) { return Object.getOwnPropertyNames(obj).concat(Object.getOwnPropertySymbols(obj)); } : Object.getOwnPropertyNames;
|
|
39769
39087
|
function shallowCopy(base, invokeGetters) {
|
|
39770
|
-
if (invokeGetters === void 0) invokeGetters = false;
|
|
39771
|
-
|
|
39772
|
-
if (Array.isArray(base)) {
|
|
39773
|
-
return base.slice();
|
|
39774
|
-
}
|
|
39088
|
+
if ( invokeGetters === void 0 ) invokeGetters = false;
|
|
39775
39089
|
|
|
39090
|
+
if (Array.isArray(base)) { return base.slice(); }
|
|
39776
39091
|
var clone = Object.create(Object.getPrototypeOf(base));
|
|
39777
39092
|
ownKeys$2(base).forEach(function (key) {
|
|
39778
39093
|
if (key === DRAFT_STATE) {
|
|
@@ -39802,28 +39117,20 @@ function shallowCopy(base, invokeGetters) {
|
|
|
39802
39117
|
});
|
|
39803
39118
|
return clone;
|
|
39804
39119
|
}
|
|
39805
|
-
|
|
39806
39120
|
function each(value, cb) {
|
|
39807
39121
|
if (Array.isArray(value)) {
|
|
39808
|
-
for (var i = 0; i < value.length; i++) {
|
|
39809
|
-
cb(i, value[i], value);
|
|
39810
|
-
}
|
|
39122
|
+
for (var i = 0; i < value.length; i++) { cb(i, value[i], value); }
|
|
39811
39123
|
} else {
|
|
39812
|
-
ownKeys$2(value).forEach(function (key) {
|
|
39813
|
-
return cb(key, value[key], value);
|
|
39814
|
-
});
|
|
39124
|
+
ownKeys$2(value).forEach(function (key) { return cb(key, value[key], value); });
|
|
39815
39125
|
}
|
|
39816
39126
|
}
|
|
39817
|
-
|
|
39818
39127
|
function isEnumerable(base, prop) {
|
|
39819
39128
|
var desc = Object.getOwnPropertyDescriptor(base, prop);
|
|
39820
39129
|
return !!desc && desc.enumerable;
|
|
39821
39130
|
}
|
|
39822
|
-
|
|
39823
39131
|
function has$1(thing, prop) {
|
|
39824
39132
|
return Object.prototype.hasOwnProperty.call(thing, prop);
|
|
39825
39133
|
}
|
|
39826
|
-
|
|
39827
39134
|
function is(x, y) {
|
|
39828
39135
|
// From: https://github.com/facebook/fbjs/blob/c69904a511b900266935168223063dd8772dfc40/packages/fbjs/src/core/shallowEqual.js
|
|
39829
39136
|
if (x === y) {
|
|
@@ -39832,26 +39139,17 @@ function is(x, y) {
|
|
|
39832
39139
|
return x !== x && y !== y;
|
|
39833
39140
|
}
|
|
39834
39141
|
}
|
|
39835
|
-
|
|
39836
39142
|
function clone(obj) {
|
|
39837
|
-
if (!isDraftable(obj)) {
|
|
39838
|
-
|
|
39839
|
-
}
|
|
39840
|
-
|
|
39841
|
-
if (Array.isArray(obj)) {
|
|
39842
|
-
return obj.map(clone);
|
|
39843
|
-
}
|
|
39844
|
-
|
|
39143
|
+
if (!isDraftable(obj)) { return obj; }
|
|
39144
|
+
if (Array.isArray(obj)) { return obj.map(clone); }
|
|
39845
39145
|
var cloned = Object.create(Object.getPrototypeOf(obj));
|
|
39846
39146
|
|
|
39847
|
-
for (var key in obj) {
|
|
39848
|
-
cloned[key] = clone(obj[key]);
|
|
39849
|
-
}
|
|
39147
|
+
for (var key in obj) { cloned[key] = clone(obj[key]); }
|
|
39850
39148
|
|
|
39851
39149
|
return cloned;
|
|
39852
39150
|
}
|
|
39853
|
-
/** Each scope represents a `produce` call. */
|
|
39854
39151
|
|
|
39152
|
+
/** Each scope represents a `produce` call. */
|
|
39855
39153
|
|
|
39856
39154
|
var ImmerScope = function ImmerScope(parent) {
|
|
39857
39155
|
this.drafts = [];
|
|
@@ -39863,7 +39161,7 @@ var ImmerScope = function ImmerScope(parent) {
|
|
|
39863
39161
|
this.patches = null;
|
|
39864
39162
|
};
|
|
39865
39163
|
|
|
39866
|
-
ImmerScope.prototype.usePatches = function usePatches(patchListener) {
|
|
39164
|
+
ImmerScope.prototype.usePatches = function usePatches (patchListener) {
|
|
39867
39165
|
if (patchListener) {
|
|
39868
39166
|
this.patches = [];
|
|
39869
39167
|
this.inversePatches = [];
|
|
@@ -39871,18 +39169,17 @@ ImmerScope.prototype.usePatches = function usePatches(patchListener) {
|
|
|
39871
39169
|
}
|
|
39872
39170
|
};
|
|
39873
39171
|
|
|
39874
|
-
ImmerScope.prototype.revoke = function revoke$1() {
|
|
39172
|
+
ImmerScope.prototype.revoke = function revoke$1 () {
|
|
39875
39173
|
this.leave();
|
|
39876
39174
|
this.drafts.forEach(revoke);
|
|
39877
39175
|
this.drafts = null; // Make draft-related methods throw.
|
|
39878
39176
|
};
|
|
39879
39177
|
|
|
39880
|
-
ImmerScope.prototype.leave = function leave() {
|
|
39178
|
+
ImmerScope.prototype.leave = function leave () {
|
|
39881
39179
|
if (this === ImmerScope.current) {
|
|
39882
39180
|
ImmerScope.current = this.parent;
|
|
39883
39181
|
}
|
|
39884
39182
|
};
|
|
39885
|
-
|
|
39886
39183
|
ImmerScope.current = null;
|
|
39887
39184
|
|
|
39888
39185
|
ImmerScope.enter = function () {
|
|
@@ -39891,11 +39188,11 @@ ImmerScope.enter = function () {
|
|
|
39891
39188
|
|
|
39892
39189
|
function revoke(draft) {
|
|
39893
39190
|
draft[DRAFT_STATE].revoke();
|
|
39894
|
-
}
|
|
39191
|
+
}
|
|
39895
39192
|
|
|
39193
|
+
// but share them all instead
|
|
39896
39194
|
|
|
39897
39195
|
var descriptors$1 = {};
|
|
39898
|
-
|
|
39899
39196
|
function willFinalize(scope, result, isReplaced) {
|
|
39900
39197
|
scope.drafts.forEach(function (draft) {
|
|
39901
39198
|
draft[DRAFT_STATE].finalizing = true;
|
|
@@ -39910,10 +39207,9 @@ function willFinalize(scope, result, isReplaced) {
|
|
|
39910
39207
|
markChangesSweep(scope.drafts);
|
|
39911
39208
|
} // When a child draft is returned, look for changes.
|
|
39912
39209
|
else if (isDraft(result) && result[DRAFT_STATE].scope === scope) {
|
|
39913
|
-
|
|
39914
|
-
|
|
39210
|
+
markChangesSweep(scope.drafts);
|
|
39211
|
+
}
|
|
39915
39212
|
}
|
|
39916
|
-
|
|
39917
39213
|
function createProxy(base, parent) {
|
|
39918
39214
|
var isArray = Array.isArray(base);
|
|
39919
39215
|
var draft = clonePotentialDraft(base);
|
|
@@ -39967,11 +39263,7 @@ function peek(draft, prop) {
|
|
|
39967
39263
|
function get$1(state, prop) {
|
|
39968
39264
|
assertUnrevoked(state);
|
|
39969
39265
|
var value = peek(source(state), prop);
|
|
39970
|
-
|
|
39971
|
-
if (state.finalizing) {
|
|
39972
|
-
return value;
|
|
39973
|
-
} // Create a draft if the value is unmodified.
|
|
39974
|
-
|
|
39266
|
+
if (state.finalizing) { return value; } // Create a draft if the value is unmodified.
|
|
39975
39267
|
|
|
39976
39268
|
if (value === peek(state.base, prop) && isDraftable(value)) {
|
|
39977
39269
|
prepareCopy(state);
|
|
@@ -39986,10 +39278,7 @@ function set$1(state, prop, value) {
|
|
|
39986
39278
|
state.assigned[prop] = true;
|
|
39987
39279
|
|
|
39988
39280
|
if (!state.modified) {
|
|
39989
|
-
if (is(value, peek(source(state), prop))) {
|
|
39990
|
-
return;
|
|
39991
|
-
}
|
|
39992
|
-
|
|
39281
|
+
if (is(value, peek(source(state), prop))) { return; }
|
|
39993
39282
|
markChanged(state);
|
|
39994
39283
|
prepareCopy(state);
|
|
39995
39284
|
}
|
|
@@ -40000,17 +39289,12 @@ function set$1(state, prop, value) {
|
|
|
40000
39289
|
function markChanged(state) {
|
|
40001
39290
|
if (!state.modified) {
|
|
40002
39291
|
state.modified = true;
|
|
40003
|
-
|
|
40004
|
-
if (state.parent) {
|
|
40005
|
-
markChanged(state.parent);
|
|
40006
|
-
}
|
|
39292
|
+
if (state.parent) { markChanged(state.parent); }
|
|
40007
39293
|
}
|
|
40008
39294
|
}
|
|
40009
39295
|
|
|
40010
39296
|
function prepareCopy(state) {
|
|
40011
|
-
if (!state.copy) {
|
|
40012
|
-
state.copy = clonePotentialDraft(state.base);
|
|
40013
|
-
}
|
|
39297
|
+
if (!state.copy) { state.copy = clonePotentialDraft(state.base); }
|
|
40014
39298
|
}
|
|
40015
39299
|
|
|
40016
39300
|
function clonePotentialDraft(base) {
|
|
@@ -40035,12 +39319,15 @@ function proxyProperty(draft, prop, enumerable) {
|
|
|
40035
39319
|
descriptors$1[prop] = desc = {
|
|
40036
39320
|
configurable: true,
|
|
40037
39321
|
enumerable: enumerable,
|
|
39322
|
+
|
|
40038
39323
|
get: function get$1$1() {
|
|
40039
39324
|
return get$1(this[DRAFT_STATE], prop);
|
|
40040
39325
|
},
|
|
39326
|
+
|
|
40041
39327
|
set: function set$1$1(value) {
|
|
40042
39328
|
set$1(this[DRAFT_STATE], prop, value);
|
|
40043
39329
|
}
|
|
39330
|
+
|
|
40044
39331
|
};
|
|
40045
39332
|
}
|
|
40046
39333
|
|
|
@@ -40048,9 +39335,7 @@ function proxyProperty(draft, prop, enumerable) {
|
|
|
40048
39335
|
}
|
|
40049
39336
|
|
|
40050
39337
|
function assertUnrevoked(state) {
|
|
40051
|
-
if (state.revoked === true) {
|
|
40052
|
-
throw new Error("Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? " + JSON.stringify(source(state)));
|
|
40053
|
-
}
|
|
39338
|
+
if (state.revoked === true) { 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))); }
|
|
40054
39339
|
} // This looks expensive, but only proxies are visited, and only objects without known changes are scanned.
|
|
40055
39340
|
|
|
40056
39341
|
|
|
@@ -40064,27 +39349,16 @@ function markChangesSweep(drafts) {
|
|
|
40064
39349
|
|
|
40065
39350
|
if (!state.modified) {
|
|
40066
39351
|
if (Array.isArray(state.base)) {
|
|
40067
|
-
if (hasArrayChanges(state)) {
|
|
40068
|
-
|
|
40069
|
-
}
|
|
40070
|
-
} else if (hasObjectChanges(state)) {
|
|
40071
|
-
markChanged(state);
|
|
40072
|
-
}
|
|
39352
|
+
if (hasArrayChanges(state)) { markChanged(state); }
|
|
39353
|
+
} else if (hasObjectChanges(state)) { markChanged(state); }
|
|
40073
39354
|
}
|
|
40074
39355
|
}
|
|
40075
39356
|
}
|
|
40076
39357
|
|
|
40077
39358
|
function markChangesRecursively(object) {
|
|
40078
|
-
if (!object ||
|
|
40079
|
-
return;
|
|
40080
|
-
}
|
|
40081
|
-
|
|
39359
|
+
if (!object || typeof object !== "object") { return; }
|
|
40082
39360
|
var state = object[DRAFT_STATE];
|
|
40083
|
-
|
|
40084
|
-
if (!state) {
|
|
40085
|
-
return;
|
|
40086
|
-
}
|
|
40087
|
-
|
|
39361
|
+
if (!state) { return; }
|
|
40088
39362
|
var base = state.base;
|
|
40089
39363
|
var draft = state.draft;
|
|
40090
39364
|
var assigned = state.assigned;
|
|
@@ -40114,20 +39388,14 @@ function markChangesRecursively(object) {
|
|
|
40114
39388
|
assigned.length = true;
|
|
40115
39389
|
|
|
40116
39390
|
if (draft.length < base.length) {
|
|
40117
|
-
for (var i = draft.length; i < base.length; i++) {
|
|
40118
|
-
assigned[i] = false;
|
|
40119
|
-
}
|
|
39391
|
+
for (var i = draft.length; i < base.length; i++) { assigned[i] = false; }
|
|
40120
39392
|
} else {
|
|
40121
|
-
for (var i$1 = base.length; i$1 < draft.length; i$1++) {
|
|
40122
|
-
assigned[i$1] = true;
|
|
40123
|
-
}
|
|
39393
|
+
for (var i$1 = base.length; i$1 < draft.length; i$1++) { assigned[i$1] = true; }
|
|
40124
39394
|
}
|
|
40125
39395
|
|
|
40126
39396
|
for (var i$2 = 0; i$2 < draft.length; i$2++) {
|
|
40127
39397
|
// Only untouched indices trigger recursion.
|
|
40128
|
-
if (assigned[i$2] === undefined) {
|
|
40129
|
-
markChangesRecursively(draft[i$2]);
|
|
40130
|
-
}
|
|
39398
|
+
if (assigned[i$2] === undefined) { markChangesRecursively(draft[i$2]); }
|
|
40131
39399
|
}
|
|
40132
39400
|
}
|
|
40133
39401
|
}
|
|
@@ -40148,13 +39416,13 @@ function hasObjectChanges(state) {
|
|
|
40148
39416
|
} // Once a base key is deleted, future changes go undetected, because its
|
|
40149
39417
|
// descriptor is erased. This branch detects any missed changes.
|
|
40150
39418
|
else {
|
|
40151
|
-
|
|
40152
|
-
|
|
39419
|
+
var value = draft[key];
|
|
39420
|
+
var state$1 = value && value[DRAFT_STATE];
|
|
40153
39421
|
|
|
40154
|
-
|
|
40155
|
-
|
|
39422
|
+
if (state$1 ? state$1.base !== baseValue : !is(value, baseValue)) {
|
|
39423
|
+
return true;
|
|
39424
|
+
}
|
|
40156
39425
|
}
|
|
40157
|
-
}
|
|
40158
39426
|
} // At this point, no keys were added or changed.
|
|
40159
39427
|
// Compare key count to determine if keys were deleted.
|
|
40160
39428
|
|
|
@@ -40164,10 +39432,7 @@ function hasObjectChanges(state) {
|
|
|
40164
39432
|
|
|
40165
39433
|
function hasArrayChanges(state) {
|
|
40166
39434
|
var draft = state.draft;
|
|
40167
|
-
|
|
40168
|
-
if (draft.length !== state.base.length) {
|
|
40169
|
-
return true;
|
|
40170
|
-
} // See #116
|
|
39435
|
+
if (draft.length !== state.base.length) { return true; } // See #116
|
|
40171
39436
|
// If we first shorten the length, our array interceptors will be removed.
|
|
40172
39437
|
// If after that new items are added, result in the same original length,
|
|
40173
39438
|
// those last items will have no intercepting property.
|
|
@@ -40175,13 +39440,9 @@ function hasArrayChanges(state) {
|
|
|
40175
39440
|
// N.B.: splice, unshift, etc only shift values around, but not prop descriptors, so we only have to check
|
|
40176
39441
|
// the last one
|
|
40177
39442
|
|
|
40178
|
-
|
|
40179
39443
|
var descriptor = Object.getOwnPropertyDescriptor(draft, draft.length - 1); // descriptor can be null, but only for newly created sparse arrays, eg. new Array(10)
|
|
40180
39444
|
|
|
40181
|
-
if (descriptor && !descriptor.get) {
|
|
40182
|
-
return true;
|
|
40183
|
-
} // For all other cases, we don't have to compare, as they would have been picked up by the index setters
|
|
40184
|
-
|
|
39445
|
+
if (descriptor && !descriptor.get) { return true; } // For all other cases, we don't have to compare, as they would have been picked up by the index setters
|
|
40185
39446
|
|
|
40186
39447
|
return false;
|
|
40187
39448
|
}
|
|
@@ -40195,12 +39456,11 @@ function createHiddenProperty(target, prop, value) {
|
|
|
40195
39456
|
}
|
|
40196
39457
|
|
|
40197
39458
|
var legacyProxy = /*#__PURE__*/Object.freeze({
|
|
40198
|
-
|
|
40199
|
-
|
|
39459
|
+
willFinalize: willFinalize,
|
|
39460
|
+
createProxy: createProxy
|
|
40200
39461
|
});
|
|
40201
39462
|
|
|
40202
39463
|
function willFinalize$1() {}
|
|
40203
|
-
|
|
40204
39464
|
function createProxy$1(base, parent) {
|
|
40205
39465
|
var scope = parent ? parent.scope : ImmerScope.current;
|
|
40206
39466
|
var state = {
|
|
@@ -40235,27 +39495,33 @@ function createProxy$1(base, parent) {
|
|
|
40235
39495
|
scope.drafts.push(proxy);
|
|
40236
39496
|
return proxy;
|
|
40237
39497
|
}
|
|
40238
|
-
|
|
40239
39498
|
var objectTraps = {
|
|
40240
39499
|
get: get$1$1,
|
|
39500
|
+
|
|
40241
39501
|
has: function has(target, prop) {
|
|
40242
39502
|
return prop in source$1(target);
|
|
40243
39503
|
},
|
|
39504
|
+
|
|
40244
39505
|
ownKeys: function ownKeys(target) {
|
|
40245
39506
|
return Reflect.ownKeys(source$1(target));
|
|
40246
39507
|
},
|
|
39508
|
+
|
|
40247
39509
|
set: set$1$1,
|
|
40248
39510
|
deleteProperty: deleteProperty,
|
|
40249
39511
|
getOwnPropertyDescriptor: getOwnPropertyDescriptor$2,
|
|
39512
|
+
|
|
40250
39513
|
defineProperty: function defineProperty() {
|
|
40251
39514
|
throw new Error("Object.defineProperty() cannot be used on an Immer draft"); // prettier-ignore
|
|
40252
39515
|
},
|
|
39516
|
+
|
|
40253
39517
|
getPrototypeOf: function getPrototypeOf(target) {
|
|
40254
39518
|
return Object.getPrototypeOf(target.base);
|
|
40255
39519
|
},
|
|
39520
|
+
|
|
40256
39521
|
setPrototypeOf: function setPrototypeOf() {
|
|
40257
39522
|
throw new Error("Object.setPrototypeOf() cannot be used on an Immer draft"); // prettier-ignore
|
|
40258
39523
|
}
|
|
39524
|
+
|
|
40259
39525
|
};
|
|
40260
39526
|
var arrayTraps = {};
|
|
40261
39527
|
each(objectTraps, function (key, fn) {
|
|
@@ -40294,10 +39560,7 @@ function peek$1(draft, prop) {
|
|
|
40294
39560
|
}
|
|
40295
39561
|
|
|
40296
39562
|
function get$1$1(state, prop) {
|
|
40297
|
-
if (prop === DRAFT_STATE) {
|
|
40298
|
-
return state;
|
|
40299
|
-
}
|
|
40300
|
-
|
|
39563
|
+
if (prop === DRAFT_STATE) { return state; }
|
|
40301
39564
|
var drafts = state.drafts; // Check for existing draft in unmodified state.
|
|
40302
39565
|
|
|
40303
39566
|
if (!state.modified && has$1(drafts, prop)) {
|
|
@@ -40313,10 +39576,7 @@ function get$1$1(state, prop) {
|
|
|
40313
39576
|
|
|
40314
39577
|
if (state.modified) {
|
|
40315
39578
|
// Assigned values are never drafted. This catches any drafts we created, too.
|
|
40316
|
-
if (value !== peek$1(state.base, prop)) {
|
|
40317
|
-
return value;
|
|
40318
|
-
} // Store drafts on the copy (when one exists).
|
|
40319
|
-
|
|
39579
|
+
if (value !== peek$1(state.base, prop)) { return value; } // Store drafts on the copy (when one exists).
|
|
40320
39580
|
|
|
40321
39581
|
drafts = state.copy;
|
|
40322
39582
|
}
|
|
@@ -40331,11 +39591,7 @@ function set$1$1(state, prop, value) {
|
|
|
40331
39591
|
// values may be drafts, but falsy values are never drafts.
|
|
40332
39592
|
|
|
40333
39593
|
var isUnchanged = value ? is(baseValue, value) || value === state.drafts[prop] : is(baseValue, value) && prop in state.base;
|
|
40334
|
-
|
|
40335
|
-
if (isUnchanged) {
|
|
40336
|
-
return true;
|
|
40337
|
-
}
|
|
40338
|
-
|
|
39594
|
+
if (isUnchanged) { return true; }
|
|
40339
39595
|
markChanged$1(state);
|
|
40340
39596
|
}
|
|
40341
39597
|
|
|
@@ -40354,10 +39610,7 @@ function deleteProperty(state, prop) {
|
|
|
40354
39610
|
delete state.assigned[prop];
|
|
40355
39611
|
}
|
|
40356
39612
|
|
|
40357
|
-
if (state.copy) {
|
|
40358
|
-
delete state.copy[prop];
|
|
40359
|
-
}
|
|
40360
|
-
|
|
39613
|
+
if (state.copy) { delete state.copy[prop]; }
|
|
40361
39614
|
return true;
|
|
40362
39615
|
} // Note: We never coerce `desc.value` into an Immer draft, because we can't make
|
|
40363
39616
|
// the same guarantee in ES5 mode.
|
|
@@ -40380,16 +39633,13 @@ function markChanged$1(state) {
|
|
|
40380
39633
|
state.modified = true;
|
|
40381
39634
|
state.copy = assign(shallowCopy(state.base), state.drafts);
|
|
40382
39635
|
state.drafts = null;
|
|
40383
|
-
|
|
40384
|
-
if (state.parent) {
|
|
40385
|
-
markChanged$1(state.parent);
|
|
40386
|
-
}
|
|
39636
|
+
if (state.parent) { markChanged$1(state.parent); }
|
|
40387
39637
|
}
|
|
40388
39638
|
}
|
|
40389
39639
|
|
|
40390
39640
|
var modernProxy = /*#__PURE__*/Object.freeze({
|
|
40391
|
-
|
|
40392
|
-
|
|
39641
|
+
willFinalize: willFinalize$1,
|
|
39642
|
+
createProxy: createProxy$1
|
|
40393
39643
|
});
|
|
40394
39644
|
|
|
40395
39645
|
function generatePatches(state, basePath, patches, inversePatches) {
|
|
@@ -40398,13 +39648,14 @@ function generatePatches(state, basePath, patches, inversePatches) {
|
|
|
40398
39648
|
|
|
40399
39649
|
function generateArrayPatches(state, basePath, patches, inversePatches) {
|
|
40400
39650
|
var assign, assign$1;
|
|
39651
|
+
|
|
40401
39652
|
var base = state.base;
|
|
40402
39653
|
var copy = state.copy;
|
|
40403
39654
|
var assigned = state.assigned; // Reduce complexity by ensuring `base` is never longer.
|
|
40404
39655
|
|
|
40405
39656
|
if (copy.length < base.length) {
|
|
40406
|
-
assign = [copy, base], base = assign[0], copy = assign[1];
|
|
40407
|
-
assign$1 = [inversePatches, patches], patches = assign$1[0], inversePatches = assign$1[1];
|
|
39657
|
+
(assign = [copy, base], base = assign[0], copy = assign[1]);
|
|
39658
|
+
(assign$1 = [inversePatches, patches], patches = assign$1[0], inversePatches = assign$1[1]);
|
|
40408
39659
|
}
|
|
40409
39660
|
|
|
40410
39661
|
var delta = copy.length - base.length; // Find the first replaced index.
|
|
@@ -40462,11 +39713,7 @@ function generateObjectPatches(state, basePath, patches, inversePatches) {
|
|
|
40462
39713
|
var origValue = base[key];
|
|
40463
39714
|
var value = copy[key];
|
|
40464
39715
|
var op = !assignedValue ? "remove" : key in base ? "replace" : "add";
|
|
40465
|
-
|
|
40466
|
-
if (origValue === value && op === "replace") {
|
|
40467
|
-
return;
|
|
40468
|
-
}
|
|
40469
|
-
|
|
39716
|
+
if (origValue === value && op === "replace") { return; }
|
|
40470
39717
|
var path = basePath.concat(key);
|
|
40471
39718
|
patches.push(op === "remove" ? {
|
|
40472
39719
|
op: op,
|
|
@@ -40491,26 +39738,20 @@ function generateObjectPatches(state, basePath, patches, inversePatches) {
|
|
|
40491
39738
|
});
|
|
40492
39739
|
}
|
|
40493
39740
|
|
|
40494
|
-
var applyPatches = function
|
|
39741
|
+
var applyPatches = function (draft, patches) {
|
|
40495
39742
|
for (var i$1 = 0, list = patches; i$1 < list.length; i$1 += 1) {
|
|
40496
39743
|
var patch = list[i$1];
|
|
39744
|
+
|
|
40497
39745
|
var path = patch.path;
|
|
40498
39746
|
var op = patch.op;
|
|
40499
39747
|
var value = clone(patch.value); // used to clone patch to ensure original patch is not modified, see #411
|
|
40500
39748
|
|
|
40501
|
-
if (!path.length) {
|
|
40502
|
-
throw new Error("Illegal state");
|
|
40503
|
-
}
|
|
40504
|
-
|
|
39749
|
+
if (!path.length) { throw new Error("Illegal state"); }
|
|
40505
39750
|
var base = draft;
|
|
40506
39751
|
|
|
40507
39752
|
for (var i = 0; i < path.length - 1; i++) {
|
|
40508
39753
|
base = base[path[i]];
|
|
40509
|
-
|
|
40510
|
-
if (!base || _typeof(base) !== "object") {
|
|
40511
|
-
throw new Error("Cannot apply patch, path doesn't resolve: " + path.join("/"));
|
|
40512
|
-
} // prettier-ignore
|
|
40513
|
-
|
|
39754
|
+
if (!base || typeof base !== "object") { throw new Error("Cannot apply patch, path doesn't resolve: " + path.join("/")); } // prettier-ignore
|
|
40514
39755
|
}
|
|
40515
39756
|
|
|
40516
39757
|
var key = path[path.length - 1];
|
|
@@ -40559,33 +39800,27 @@ var configDefaults = {
|
|
|
40559
39800
|
onDelete: null,
|
|
40560
39801
|
onCopy: null
|
|
40561
39802
|
};
|
|
40562
|
-
|
|
40563
39803
|
var Immer = function Immer(config) {
|
|
40564
39804
|
assign(this, configDefaults, config);
|
|
40565
39805
|
this.setUseProxies(this.useProxies);
|
|
40566
39806
|
this.produce = this.produce.bind(this);
|
|
40567
39807
|
};
|
|
40568
39808
|
|
|
40569
|
-
Immer.prototype.produce = function produce(base, recipe, patchListener) {
|
|
40570
|
-
|
|
39809
|
+
Immer.prototype.produce = function produce (base, recipe, patchListener) {
|
|
39810
|
+
var this$1$1 = this;
|
|
40571
39811
|
|
|
39812
|
+
// curried invocation
|
|
40572
39813
|
if (typeof base === "function" && typeof recipe !== "function") {
|
|
40573
39814
|
var defaultBase = recipe;
|
|
40574
39815
|
recipe = base;
|
|
40575
39816
|
var self = this;
|
|
40576
39817
|
return function curriedProduce(base) {
|
|
40577
|
-
|
|
40578
|
-
|
|
40579
|
-
|
|
40580
|
-
|
|
40581
|
-
|
|
40582
|
-
while (len-- > 0) {
|
|
40583
|
-
args[len] = arguments[len + 1];
|
|
40584
|
-
}
|
|
39818
|
+
var this$1$1 = this;
|
|
39819
|
+
if ( base === void 0 ) base = defaultBase;
|
|
39820
|
+
var args = [], len = arguments.length - 1;
|
|
39821
|
+
while ( len-- > 0 ) args[ len ] = arguments[ len + 1 ];
|
|
40585
39822
|
|
|
40586
|
-
return self.produce(base, function (draft) {
|
|
40587
|
-
return recipe.call.apply(recipe, [this$1$1, draft].concat(args));
|
|
40588
|
-
}); // prettier-ignore
|
|
39823
|
+
return self.produce(base, function (draft) { return recipe.call.apply(recipe, [ this$1$1, draft ].concat( args )); }); // prettier-ignore
|
|
40589
39824
|
};
|
|
40590
39825
|
} // prettier-ignore
|
|
40591
39826
|
|
|
@@ -40611,11 +39846,7 @@ Immer.prototype.produce = function produce(base, recipe, patchListener) {
|
|
|
40611
39846
|
hasError = false;
|
|
40612
39847
|
} finally {
|
|
40613
39848
|
// finally instead of catch + rethrow better preserves original stack
|
|
40614
|
-
if (hasError) {
|
|
40615
|
-
scope.revoke();
|
|
40616
|
-
} else {
|
|
40617
|
-
scope.leave();
|
|
40618
|
-
}
|
|
39849
|
+
if (hasError) { scope.revoke(); }else { scope.leave(); }
|
|
40619
39850
|
}
|
|
40620
39851
|
|
|
40621
39852
|
if (result instanceof Promise) {
|
|
@@ -40632,38 +39863,25 @@ Immer.prototype.produce = function produce(base, recipe, patchListener) {
|
|
|
40632
39863
|
return this.processResult(result, scope);
|
|
40633
39864
|
} else {
|
|
40634
39865
|
result = recipe(base);
|
|
40635
|
-
|
|
40636
|
-
if (result === undefined) {
|
|
40637
|
-
return base;
|
|
40638
|
-
}
|
|
40639
|
-
|
|
39866
|
+
if (result === undefined) { return base; }
|
|
40640
39867
|
return result !== NOTHING ? result : undefined;
|
|
40641
39868
|
}
|
|
40642
39869
|
};
|
|
40643
39870
|
|
|
40644
|
-
Immer.prototype.produceWithPatches = function produceWithPatches(arg1, arg2, arg3) {
|
|
40645
|
-
|
|
39871
|
+
Immer.prototype.produceWithPatches = function produceWithPatches (arg1, arg2, arg3) {
|
|
39872
|
+
var this$1$1 = this;
|
|
40646
39873
|
|
|
40647
39874
|
if (typeof arg1 === "function") {
|
|
40648
39875
|
return function (state) {
|
|
40649
|
-
|
|
40650
|
-
|
|
40651
|
-
|
|
40652
|
-
while (len-- > 0) {
|
|
40653
|
-
args[len] = arguments[len + 1];
|
|
40654
|
-
}
|
|
39876
|
+
var args = [], len = arguments.length - 1;
|
|
39877
|
+
while ( len-- > 0 ) args[ len ] = arguments[ len + 1 ];
|
|
40655
39878
|
|
|
40656
|
-
|
|
40657
|
-
|
|
40658
|
-
});
|
|
40659
|
-
};
|
|
39879
|
+
return this$1$1.produceWithPatches(state, function (draft) { return arg1.apply(void 0, [ draft ].concat( args )); });
|
|
39880
|
+
};
|
|
40660
39881
|
} // non-curried form
|
|
40661
39882
|
|
|
40662
39883
|
|
|
40663
|
-
if (arg3) {
|
|
40664
|
-
throw new Error("A patch listener cannot be passed to produceWithPatches");
|
|
40665
|
-
}
|
|
40666
|
-
|
|
39884
|
+
if (arg3) { throw new Error("A patch listener cannot be passed to produceWithPatches"); }
|
|
40667
39885
|
var patches, inversePatches;
|
|
40668
39886
|
var nextState = this.produce(arg1, arg2, function (p, ip) {
|
|
40669
39887
|
patches = p;
|
|
@@ -40672,7 +39890,7 @@ Immer.prototype.produceWithPatches = function produceWithPatches(arg1, arg2, arg
|
|
|
40672
39890
|
return [nextState, patches, inversePatches];
|
|
40673
39891
|
};
|
|
40674
39892
|
|
|
40675
|
-
Immer.prototype.createDraft = function createDraft(base) {
|
|
39893
|
+
Immer.prototype.createDraft = function createDraft (base) {
|
|
40676
39894
|
if (!isDraftable(base)) {
|
|
40677
39895
|
throw new Error("First argument to `createDraft` must be a plain object, an array, or an immerable object"); // prettier-ignore
|
|
40678
39896
|
}
|
|
@@ -40684,7 +39902,7 @@ Immer.prototype.createDraft = function createDraft(base) {
|
|
|
40684
39902
|
return proxy;
|
|
40685
39903
|
};
|
|
40686
39904
|
|
|
40687
|
-
Immer.prototype.finishDraft = function finishDraft(draft, patchListener) {
|
|
39905
|
+
Immer.prototype.finishDraft = function finishDraft (draft, patchListener) {
|
|
40688
39906
|
var state = draft && draft[DRAFT_STATE];
|
|
40689
39907
|
|
|
40690
39908
|
if (!state || !state.isManual) {
|
|
@@ -40700,16 +39918,16 @@ Immer.prototype.finishDraft = function finishDraft(draft, patchListener) {
|
|
|
40700
39918
|
return this.processResult(undefined, scope);
|
|
40701
39919
|
};
|
|
40702
39920
|
|
|
40703
|
-
Immer.prototype.setAutoFreeze = function setAutoFreeze(value) {
|
|
39921
|
+
Immer.prototype.setAutoFreeze = function setAutoFreeze (value) {
|
|
40704
39922
|
this.autoFreeze = value;
|
|
40705
39923
|
};
|
|
40706
39924
|
|
|
40707
|
-
Immer.prototype.setUseProxies = function setUseProxies(value) {
|
|
39925
|
+
Immer.prototype.setUseProxies = function setUseProxies (value) {
|
|
40708
39926
|
this.useProxies = value;
|
|
40709
39927
|
assign(this, value ? modernProxy : legacyProxy);
|
|
40710
39928
|
};
|
|
40711
39929
|
|
|
40712
|
-
Immer.prototype.applyPatches = function applyPatches$1(base, patches) {
|
|
39930
|
+
Immer.prototype.applyPatches = function applyPatches$1 (base, patches) {
|
|
40713
39931
|
// If a patch replaces the entire state, take that replacement as base
|
|
40714
39932
|
// before applying patches
|
|
40715
39933
|
var i;
|
|
@@ -40729,14 +39947,12 @@ Immer.prototype.applyPatches = function applyPatches$1(base, patches) {
|
|
|
40729
39947
|
} // Otherwise, produce a copy of the base state.
|
|
40730
39948
|
|
|
40731
39949
|
|
|
40732
|
-
return this.produce(base, function (draft) {
|
|
40733
|
-
return applyPatches(draft, patches.slice(i + 1));
|
|
40734
|
-
});
|
|
39950
|
+
return this.produce(base, function (draft) { return applyPatches(draft, patches.slice(i + 1)); });
|
|
40735
39951
|
};
|
|
40736
39952
|
/** @internal */
|
|
40737
39953
|
|
|
40738
39954
|
|
|
40739
|
-
Immer.prototype.processResult = function processResult(result, scope) {
|
|
39955
|
+
Immer.prototype.processResult = function processResult (result, scope) {
|
|
40740
39956
|
var baseDraft = scope.drafts[0];
|
|
40741
39957
|
var isReplaced = result !== undefined && result !== baseDraft;
|
|
40742
39958
|
this.willFinalize(scope, result, isReplaced);
|
|
@@ -40784,15 +40000,13 @@ Immer.prototype.processResult = function processResult(result, scope) {
|
|
|
40784
40000
|
*/
|
|
40785
40001
|
|
|
40786
40002
|
|
|
40787
|
-
Immer.prototype.finalize = function finalize(draft, path, scope) {
|
|
40788
|
-
|
|
40003
|
+
Immer.prototype.finalize = function finalize (draft, path, scope) {
|
|
40004
|
+
var this$1$1 = this;
|
|
40005
|
+
|
|
40789
40006
|
var state = draft[DRAFT_STATE];
|
|
40790
40007
|
|
|
40791
40008
|
if (!state) {
|
|
40792
|
-
if (Object.isFrozen(draft)) {
|
|
40793
|
-
return draft;
|
|
40794
|
-
}
|
|
40795
|
-
|
|
40009
|
+
if (Object.isFrozen(draft)) { return draft; }
|
|
40796
40010
|
return this.finalizeTree(draft, null, scope);
|
|
40797
40011
|
} // Never finalize drafts owned by another scope.
|
|
40798
40012
|
|
|
@@ -40815,17 +40029,13 @@ Immer.prototype.finalize = function finalize(draft, path, scope) {
|
|
|
40815
40029
|
var assigned = state.assigned;
|
|
40816
40030
|
|
|
40817
40031
|
for (var prop in assigned) {
|
|
40818
|
-
if (!assigned[prop]) {
|
|
40819
|
-
this.onDelete(state, prop);
|
|
40820
|
-
}
|
|
40032
|
+
if (!assigned[prop]) { this.onDelete(state, prop); }
|
|
40821
40033
|
}
|
|
40822
40034
|
} else {
|
|
40823
40035
|
var base = state.base;
|
|
40824
|
-
|
|
40036
|
+
var copy = state.copy;
|
|
40825
40037
|
each(base, function (prop) {
|
|
40826
|
-
if (!has$1(copy, prop)) {
|
|
40827
|
-
this$1$1.onDelete(state, prop);
|
|
40828
|
-
}
|
|
40038
|
+
if (!has$1(copy, prop)) { this$1$1.onDelete(state, prop); }
|
|
40829
40039
|
});
|
|
40830
40040
|
}
|
|
40831
40041
|
}
|
|
@@ -40853,8 +40063,9 @@ Immer.prototype.finalize = function finalize(draft, path, scope) {
|
|
|
40853
40063
|
*/
|
|
40854
40064
|
|
|
40855
40065
|
|
|
40856
|
-
Immer.prototype.finalizeTree = function finalizeTree(root, rootPath, scope) {
|
|
40857
|
-
|
|
40066
|
+
Immer.prototype.finalizeTree = function finalizeTree (root, rootPath, scope) {
|
|
40067
|
+
var this$1$1 = this;
|
|
40068
|
+
|
|
40858
40069
|
var state = root[DRAFT_STATE];
|
|
40859
40070
|
|
|
40860
40071
|
if (state) {
|
|
@@ -40868,7 +40079,7 @@ Immer.prototype.finalizeTree = function finalizeTree(root, rootPath, scope) {
|
|
|
40868
40079
|
|
|
40869
40080
|
var needPatches = !!rootPath && !!scope.patches;
|
|
40870
40081
|
|
|
40871
|
-
var finalizeProperty = function
|
|
40082
|
+
var finalizeProperty = function (prop, value, parent) {
|
|
40872
40083
|
if (value === parent) {
|
|
40873
40084
|
throw Error("Immer forbids circular references");
|
|
40874
40085
|
} // In the `finalizeTree` method, only the `root` object may be a draft.
|
|
@@ -40895,16 +40106,14 @@ Immer.prototype.finalizeTree = function finalizeTree(root, rootPath, scope) {
|
|
|
40895
40106
|
} // Unchanged drafts are never passed to the `onAssign` hook.
|
|
40896
40107
|
|
|
40897
40108
|
|
|
40898
|
-
if (isDraftProp && value === state.base[prop]) {
|
|
40899
|
-
return;
|
|
40900
|
-
}
|
|
40109
|
+
if (isDraftProp && value === state.base[prop]) { return; }
|
|
40901
40110
|
} // Unchanged draft properties are ignored.
|
|
40902
40111
|
else if (isDraftProp && is(value, state.base[prop])) {
|
|
40903
|
-
|
|
40904
|
-
|
|
40905
|
-
|
|
40906
|
-
|
|
40907
|
-
|
|
40112
|
+
return;
|
|
40113
|
+
} // Search new objects for unfinalized drafts. Frozen objects should never contain drafts.
|
|
40114
|
+
else if (isDraftable(value) && !Object.isFrozen(value)) {
|
|
40115
|
+
each(value, finalizeProperty);
|
|
40116
|
+
}
|
|
40908
40117
|
|
|
40909
40118
|
if (isDraftProp && this$1$1.onAssign) {
|
|
40910
40119
|
this$1$1.onAssign(state, prop, value);
|
|
@@ -40982,223 +40191,127 @@ immer.createDraft.bind(immer);
|
|
|
40982
40191
|
|
|
40983
40192
|
immer.finishDraft.bind(immer);
|
|
40984
40193
|
|
|
40985
|
-
|
|
40986
|
-
|
|
40987
|
-
|
|
40988
|
-
|
|
40989
|
-
for (var _i3 = 0, _formConfigKeys = formConfigKeys; _i3 < _formConfigKeys.length; _i3++) {
|
|
40990
|
-
var formKey = _formConfigKeys[_i3];
|
|
40194
|
+
const createInitialState = formConfig => {
|
|
40195
|
+
let initialForm = {};
|
|
40196
|
+
const formConfigKeys = Object.keys(formConfig);
|
|
40197
|
+
for (let formKey of formConfigKeys) {
|
|
40991
40198
|
initialForm[formKey] = {
|
|
40992
40199
|
dirty: false,
|
|
40993
40200
|
rawValue: formConfig[formKey].defaultValue || "",
|
|
40994
40201
|
validators: formConfig[formKey].validators || [],
|
|
40995
40202
|
constraints: formConfig[formKey].constraints || []
|
|
40996
40203
|
};
|
|
40997
|
-
}
|
|
40204
|
+
}
|
|
40205
|
+
// Because validators require the entire form we have to do a
|
|
40998
40206
|
// second pass to add errors once the initial form has been
|
|
40999
40207
|
// constructed
|
|
41000
|
-
|
|
41001
|
-
|
|
41002
|
-
|
|
41003
|
-
|
|
41004
|
-
var errors = computeErrors(_formKey, initialForm);
|
|
41005
|
-
initialForm[_formKey].errors = errors;
|
|
41006
|
-
initialForm[_formKey].hasErrors = errors.length > 0;
|
|
40208
|
+
for (let formKey of formConfigKeys) {
|
|
40209
|
+
let errors = computeErrors(formKey, initialForm);
|
|
40210
|
+
initialForm[formKey].errors = errors;
|
|
40211
|
+
initialForm[formKey].hasErrors = errors.length > 0;
|
|
41007
40212
|
}
|
|
41008
|
-
|
|
41009
40213
|
return initialForm;
|
|
41010
40214
|
};
|
|
41011
40215
|
|
|
41012
|
-
|
|
41013
|
-
|
|
41014
|
-
|
|
41015
|
-
|
|
41016
|
-
|
|
41017
|
-
type: SET,
|
|
41018
|
-
payload: {
|
|
41019
|
-
fieldName: fieldName,
|
|
41020
|
-
value: value
|
|
41021
|
-
}
|
|
41022
|
-
};
|
|
41023
|
-
};
|
|
41024
|
-
};
|
|
41025
|
-
|
|
41026
|
-
var CLEAR = "form/CLEAR";
|
|
41027
|
-
|
|
41028
|
-
var _clear = function clear() {
|
|
41029
|
-
return {
|
|
41030
|
-
type: CLEAR
|
|
41031
|
-
};
|
|
41032
|
-
};
|
|
41033
|
-
|
|
41034
|
-
var ADD_VALIDATOR = "field/ADD_VALIDATOR";
|
|
41035
|
-
|
|
41036
|
-
var _addValidator = function addValidator(fieldName) {
|
|
41037
|
-
return function (validator) {
|
|
41038
|
-
return {
|
|
41039
|
-
type: ADD_VALIDATOR,
|
|
41040
|
-
payload: {
|
|
41041
|
-
fieldName: fieldName,
|
|
41042
|
-
validator: validator
|
|
41043
|
-
}
|
|
41044
|
-
};
|
|
41045
|
-
};
|
|
41046
|
-
};
|
|
41047
|
-
|
|
41048
|
-
var REMOVE_VALIDATOR = "field/REMOVE_VALIDATOR";
|
|
41049
|
-
|
|
41050
|
-
var _removeValidator = function removeValidator(fieldName) {
|
|
41051
|
-
return function (validator) {
|
|
41052
|
-
return {
|
|
41053
|
-
type: REMOVE_VALIDATOR,
|
|
41054
|
-
payload: {
|
|
41055
|
-
fieldName: fieldName,
|
|
41056
|
-
validator: validator
|
|
41057
|
-
}
|
|
41058
|
-
};
|
|
41059
|
-
};
|
|
41060
|
-
};
|
|
41061
|
-
|
|
41062
|
-
var CLEAR_FIELD_VALIDATORS = "field/CLEAR_FIELD_VALIDATORS";
|
|
41063
|
-
|
|
41064
|
-
var clearFieldValidators = function clearFieldValidators(fieldName) {
|
|
41065
|
-
return function () {
|
|
41066
|
-
return {
|
|
41067
|
-
type: CLEAR_FIELD_VALIDATORS,
|
|
41068
|
-
payload: {
|
|
41069
|
-
fieldName: fieldName
|
|
41070
|
-
}
|
|
41071
|
-
};
|
|
41072
|
-
};
|
|
41073
|
-
};
|
|
40216
|
+
const SET = "field/SET";
|
|
40217
|
+
const set$2 = fieldName => value => ({
|
|
40218
|
+
type: SET,
|
|
40219
|
+
payload: { fieldName, value }
|
|
40220
|
+
});
|
|
41074
40221
|
|
|
41075
|
-
|
|
41076
|
-
|
|
41077
|
-
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : createInitialState(formConfig);
|
|
41078
|
-
var action = arguments.length > 1 ? arguments[1] : undefined;
|
|
40222
|
+
const CLEAR = "form/CLEAR";
|
|
40223
|
+
const clear = () => ({ type: CLEAR });
|
|
41079
40224
|
|
|
41080
|
-
|
|
41081
|
-
|
|
41082
|
-
|
|
41083
|
-
|
|
41084
|
-
|
|
41085
|
-
return produce(state, function (draftState) {
|
|
41086
|
-
var originalValue = draftState[changedFieldName].rawValue;
|
|
41087
|
-
draftState[changedFieldName].rawValue = newRawValue;
|
|
41088
|
-
|
|
41089
|
-
if (computeConstraints(changedFieldName, draftState).length > 0) {
|
|
41090
|
-
// If the change violates constraints, revert the change
|
|
41091
|
-
draftState[changedFieldName].rawValue = originalValue;
|
|
41092
|
-
return draftState;
|
|
41093
|
-
}
|
|
40225
|
+
const ADD_VALIDATOR = "field/ADD_VALIDATOR";
|
|
40226
|
+
const addValidator = fieldName => validator => ({
|
|
40227
|
+
type: ADD_VALIDATOR,
|
|
40228
|
+
payload: { fieldName, validator }
|
|
40229
|
+
});
|
|
41094
40230
|
|
|
41095
|
-
|
|
41096
|
-
|
|
41097
|
-
|
|
40231
|
+
const createFormReducer = formConfig => (
|
|
40232
|
+
state = createInitialState(formConfig),
|
|
40233
|
+
action
|
|
40234
|
+
) => {
|
|
40235
|
+
switch (action.type) {
|
|
40236
|
+
case SET:
|
|
40237
|
+
const changedFieldName = action.payload.fieldName;
|
|
40238
|
+
const newRawValue = action.payload.value;
|
|
40239
|
+
|
|
40240
|
+
return produce(state, draftState => {
|
|
40241
|
+
let originalValue = draftState[changedFieldName].rawValue;
|
|
40242
|
+
draftState[changedFieldName].rawValue = newRawValue;
|
|
40243
|
+
if (computeConstraints(changedFieldName, draftState).length > 0) {
|
|
40244
|
+
// If the change violates constraints, revert the change
|
|
40245
|
+
draftState[changedFieldName].rawValue = originalValue;
|
|
40246
|
+
return draftState;
|
|
41098
40247
|
}
|
|
41099
40248
|
|
|
41100
|
-
|
|
41101
|
-
|
|
41102
|
-
|
|
41103
|
-
|
|
41104
|
-
|
|
41105
|
-
|
|
41106
|
-
|
|
41107
|
-
|
|
41108
|
-
|
|
41109
|
-
computeErrorEntries(draftState);
|
|
41110
|
-
});
|
|
40249
|
+
const fields = Object.entries(draftState);
|
|
40250
|
+
for (let entry of fields) {
|
|
40251
|
+
let fieldName = entry[0];
|
|
40252
|
+
let field = entry[1];
|
|
40253
|
+
let errors = computeErrors(fieldName, draftState);
|
|
40254
|
+
let dirty = fieldName === changedFieldName ? true : field.dirty;
|
|
40255
|
+
draftState[fieldName].errors = errors;
|
|
40256
|
+
draftState[fieldName].dirty = dirty;
|
|
40257
|
+
draftState[fieldName].hasErrors = errors.length > 0;
|
|
41111
40258
|
}
|
|
41112
|
-
|
|
41113
|
-
|
|
41114
|
-
|
|
41115
|
-
|
|
41116
|
-
|
|
41117
|
-
|
|
41118
|
-
|
|
41119
|
-
|
|
41120
|
-
|
|
41121
|
-
|
|
41122
|
-
|
|
41123
|
-
|
|
41124
|
-
|
|
41125
|
-
|
|
41126
|
-
|
|
41127
|
-
|
|
41128
|
-
|
|
41129
|
-
|
|
41130
|
-
draftState[fieldToClear].validators = [];
|
|
41131
|
-
computeErrorEntries(draftState);
|
|
41132
|
-
});
|
|
40259
|
+
});
|
|
40260
|
+
case CLEAR:
|
|
40261
|
+
return createInitialState(formConfig);
|
|
40262
|
+
case ADD_VALIDATOR:
|
|
40263
|
+
const fieldWithOverride = action.payload.fieldName;
|
|
40264
|
+
const newValidator = action.payload.validator;
|
|
40265
|
+
|
|
40266
|
+
return produce(state, draftState => {
|
|
40267
|
+
draftState[fieldWithOverride].validators.push(newValidator);
|
|
40268
|
+
const fields = Object.entries(draftState);
|
|
40269
|
+
for (let entry of fields) {
|
|
40270
|
+
let fieldName = entry[0];
|
|
40271
|
+
let field = entry[1];
|
|
40272
|
+
let errors = computeErrors(fieldName, draftState);
|
|
40273
|
+
let dirty = field.dirty;
|
|
40274
|
+
draftState[fieldName].errors = errors;
|
|
40275
|
+
draftState[fieldName].dirty = dirty;
|
|
40276
|
+
draftState[fieldName].hasErrors = errors.length > 0;
|
|
41133
40277
|
}
|
|
41134
|
-
|
|
41135
|
-
|
|
41136
|
-
|
|
41137
|
-
|
|
41138
|
-
};
|
|
40278
|
+
});
|
|
40279
|
+
default:
|
|
40280
|
+
return state;
|
|
40281
|
+
}
|
|
41139
40282
|
};
|
|
41140
40283
|
|
|
41141
|
-
|
|
40284
|
+
const createMapDispatchToProps = formConfig => {
|
|
41142
40285
|
// Do memo-ization
|
|
41143
|
-
|
|
41144
|
-
|
|
41145
|
-
return
|
|
40286
|
+
let cachedDispatch;
|
|
40287
|
+
let cacheValue;
|
|
40288
|
+
return dispatch => {
|
|
41146
40289
|
if (dispatch == cachedDispatch) {
|
|
41147
40290
|
return cacheValue;
|
|
41148
40291
|
}
|
|
41149
|
-
|
|
41150
|
-
var dispatchObj = {};
|
|
40292
|
+
let dispatchObj = {};
|
|
41151
40293
|
dispatchObj.fields = {};
|
|
41152
|
-
|
|
41153
|
-
|
|
41154
|
-
var _loop = function _loop() {
|
|
41155
|
-
var fieldName = _keys[_i5];
|
|
40294
|
+
const keys = Object.keys(formConfig);
|
|
40295
|
+
for (let fieldName of keys) {
|
|
41156
40296
|
dispatchObj.fields[fieldName] = {
|
|
41157
|
-
set:
|
|
41158
|
-
|
|
41159
|
-
},
|
|
41160
|
-
addValidator: function addValidator(validator) {
|
|
41161
|
-
return dispatch(_addValidator(fieldName)(validator));
|
|
41162
|
-
},
|
|
41163
|
-
removeValidator: function removeValidator(validator) {
|
|
41164
|
-
return dispatch(_removeValidator(fieldName)(validator));
|
|
41165
|
-
},
|
|
41166
|
-
clear: function clear() {
|
|
41167
|
-
return dispatch(clearFieldValidators(fieldName)());
|
|
41168
|
-
}
|
|
40297
|
+
set: value => dispatch(set$2(fieldName)(value)),
|
|
40298
|
+
addValidator: validator => dispatch(addValidator(fieldName)(validator))
|
|
41169
40299
|
};
|
|
41170
|
-
};
|
|
41171
|
-
|
|
41172
|
-
for (var _i5 = 0, _keys = keys; _i5 < _keys.length; _i5++) {
|
|
41173
|
-
_loop();
|
|
41174
40300
|
}
|
|
41175
|
-
|
|
41176
|
-
dispatchObj.form = {
|
|
41177
|
-
clear: function clear() {
|
|
41178
|
-
return dispatch(_clear());
|
|
41179
|
-
}
|
|
41180
|
-
};
|
|
40301
|
+
dispatchObj.form = { clear: () => dispatch(clear()) };
|
|
41181
40302
|
cachedDispatch = dispatch;
|
|
41182
|
-
cacheValue = {
|
|
41183
|
-
actions: dispatchObj
|
|
41184
|
-
};
|
|
40303
|
+
cacheValue = { actions: dispatchObj };
|
|
41185
40304
|
return cacheValue;
|
|
41186
40305
|
};
|
|
41187
40306
|
};
|
|
41188
40307
|
|
|
41189
|
-
|
|
41190
|
-
return {
|
|
41191
|
-
fields: state
|
|
41192
|
-
};
|
|
41193
|
-
};
|
|
40308
|
+
const mapStateToProps = state => ({ fields: state });
|
|
41194
40309
|
|
|
41195
|
-
|
|
41196
|
-
|
|
41197
|
-
|
|
41198
|
-
|
|
41199
|
-
|
|
41200
|
-
};
|
|
41201
|
-
};
|
|
40310
|
+
const createFormState = formConfig => ({
|
|
40311
|
+
reducer: createFormReducer(formConfig),
|
|
40312
|
+
mapDispatchToProps: createMapDispatchToProps(formConfig),
|
|
40313
|
+
mapStateToProps: mapStateToProps
|
|
40314
|
+
});
|
|
41202
40315
|
|
|
41203
40316
|
var AddressForm = function AddressForm(_ref) {
|
|
41204
40317
|
var _zipErrorMessages;
|
|
@@ -50408,7 +49521,7 @@ var RadioSection = function RadioSection(_ref) {
|
|
|
50408
49521
|
}, sections.filter(function (section) {
|
|
50409
49522
|
return !section.hidden;
|
|
50410
49523
|
}).map(function (section) {
|
|
50411
|
-
return contentOverride ? contentOverride : /*#__PURE__*/React__default.createElement(Motion, {
|
|
49524
|
+
return section.contentOverride ? section.contentOverride : /*#__PURE__*/React__default.createElement(Motion, {
|
|
50412
49525
|
tabIndex: section.hideRadioButton || section.disabled ? "-1" : "0",
|
|
50413
49526
|
onKeyDown: function onKeyDown(e) {
|
|
50414
49527
|
return !section.disabled && handleKeyDown(section.id, e);
|