@jsonui/core 0.4.4 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js CHANGED
@@ -1435,9 +1435,9 @@ var _arrayMap = arrayMap$3;/**
1435
1435
  * // => false
1436
1436
  */
1437
1437
 
1438
- var isArray$d = Array.isArray;
1438
+ var isArray$c = Array.isArray;
1439
1439
 
1440
- var isArray_1 = isArray$d;/** Detect free variable `global` from Node.js. */
1440
+ var isArray_1 = isArray$c;/** Detect free variable `global` from Node.js. */
1441
1441
 
1442
1442
  var freeGlobal$1 = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
1443
1443
 
@@ -1452,9 +1452,9 @@ var root$8 = freeGlobal || freeSelf || Function('return this')();
1452
1452
  var _root = root$8;var root$7 = _root;
1453
1453
 
1454
1454
  /** Built-in value references. */
1455
- var Symbol$7 = root$7.Symbol;
1455
+ var Symbol$6 = root$7.Symbol;
1456
1456
 
1457
- var _Symbol = Symbol$7;var Symbol$6 = _Symbol;
1457
+ var _Symbol = Symbol$6;var Symbol$5 = _Symbol;
1458
1458
 
1459
1459
  /** Used for built-in method references. */
1460
1460
  var objectProto$e = Object.prototype;
@@ -1470,7 +1470,7 @@ var hasOwnProperty$c = objectProto$e.hasOwnProperty;
1470
1470
  var nativeObjectToString$1 = objectProto$e.toString;
1471
1471
 
1472
1472
  /** Built-in value references. */
1473
- var symToStringTag$1 = Symbol$6 ? Symbol$6.toStringTag : undefined;
1473
+ var symToStringTag$1 = Symbol$5 ? Symbol$5.toStringTag : undefined;
1474
1474
 
1475
1475
  /**
1476
1476
  * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
@@ -1521,7 +1521,7 @@ function objectToString$1(value) {
1521
1521
  return nativeObjectToString.call(value);
1522
1522
  }
1523
1523
 
1524
- var _objectToString = objectToString$1;var Symbol$5 = _Symbol,
1524
+ var _objectToString = objectToString$1;var Symbol$4 = _Symbol,
1525
1525
  getRawTag = _getRawTag,
1526
1526
  objectToString = _objectToString;
1527
1527
 
@@ -1530,7 +1530,7 @@ var nullTag = '[object Null]',
1530
1530
  undefinedTag = '[object Undefined]';
1531
1531
 
1532
1532
  /** Built-in value references. */
1533
- var symToStringTag = Symbol$5 ? Symbol$5.toStringTag : undefined;
1533
+ var symToStringTag = Symbol$4 ? Symbol$4.toStringTag : undefined;
1534
1534
 
1535
1535
  /**
1536
1536
  * The base implementation of `getTag` without fallbacks for buggy environments.
@@ -1605,7 +1605,7 @@ function isSymbol$5(value) {
1605
1605
  (isObjectLike$6(value) && baseGetTag$4(value) == symbolTag$3);
1606
1606
  }
1607
1607
 
1608
- var isSymbol_1 = isSymbol$5;var isArray$c = isArray_1,
1608
+ var isSymbol_1 = isSymbol$5;var isArray$b = isArray_1,
1609
1609
  isSymbol$4 = isSymbol_1;
1610
1610
 
1611
1611
  /** Used to match property names within property paths. */
@@ -1621,7 +1621,7 @@ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
1621
1621
  * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
1622
1622
  */
1623
1623
  function isKey$3(value, object) {
1624
- if (isArray$c(value)) {
1624
+ if (isArray$b(value)) {
1625
1625
  return false;
1626
1626
  }
1627
1627
  var type = typeof value;
@@ -1659,13 +1659,13 @@ var _isKey = isKey$3;/**
1659
1659
  * // => false
1660
1660
  */
1661
1661
 
1662
- function isObject$8(value) {
1662
+ function isObject$7(value) {
1663
1663
  var type = typeof value;
1664
1664
  return value != null && (type == 'object' || type == 'function');
1665
1665
  }
1666
1666
 
1667
- var isObject_1 = isObject$8;var baseGetTag$3 = _baseGetTag,
1668
- isObject$7 = isObject_1;
1667
+ var isObject_1 = isObject$7;var baseGetTag$3 = _baseGetTag,
1668
+ isObject$6 = isObject_1;
1669
1669
 
1670
1670
  /** `Object#toString` result references. */
1671
1671
  var asyncTag = '[object AsyncFunction]',
@@ -1691,7 +1691,7 @@ var asyncTag = '[object AsyncFunction]',
1691
1691
  * // => false
1692
1692
  */
1693
1693
  function isFunction$2(value) {
1694
- if (!isObject$7(value)) {
1694
+ if (!isObject$6(value)) {
1695
1695
  return false;
1696
1696
  }
1697
1697
  // The use of `Object#toString` avoids issues with the `typeof` operator
@@ -1752,7 +1752,7 @@ function toSource$2(func) {
1752
1752
 
1753
1753
  var _toSource = toSource$2;var isFunction$1 = isFunction_1,
1754
1754
  isMasked = _isMasked,
1755
- isObject$6 = isObject_1,
1755
+ isObject$5 = isObject_1,
1756
1756
  toSource$1 = _toSource;
1757
1757
 
1758
1758
  /**
@@ -1789,7 +1789,7 @@ var reIsNative = RegExp('^' +
1789
1789
  * else `false`.
1790
1790
  */
1791
1791
  function baseIsNative$1(value) {
1792
- if (!isObject$6(value) || isMasked(value)) {
1792
+ if (!isObject$5(value) || isMasked(value)) {
1793
1793
  return false;
1794
1794
  }
1795
1795
  var pattern = isFunction$1(value) ? reIsNative : reIsHostCtor;
@@ -2438,16 +2438,16 @@ var stringToPath$1 = memoizeCapped(function(string) {
2438
2438
  return result;
2439
2439
  });
2440
2440
 
2441
- var _stringToPath = stringToPath$1;var Symbol$4 = _Symbol,
2441
+ var _stringToPath = stringToPath$1;var Symbol$3 = _Symbol,
2442
2442
  arrayMap$2 = _arrayMap,
2443
- isArray$b = isArray_1,
2443
+ isArray$a = isArray_1,
2444
2444
  isSymbol$3 = isSymbol_1;
2445
2445
 
2446
2446
  /** Used as references for various `Number` constants. */
2447
2447
  var INFINITY$2 = 1 / 0;
2448
2448
 
2449
2449
  /** Used to convert symbols to primitives and strings. */
2450
- var symbolProto$2 = Symbol$4 ? Symbol$4.prototype : undefined,
2450
+ var symbolProto$2 = Symbol$3 ? Symbol$3.prototype : undefined,
2451
2451
  symbolToString = symbolProto$2 ? symbolProto$2.toString : undefined;
2452
2452
 
2453
2453
  /**
@@ -2463,7 +2463,7 @@ function baseToString$1(value) {
2463
2463
  if (typeof value == 'string') {
2464
2464
  return value;
2465
2465
  }
2466
- if (isArray$b(value)) {
2466
+ if (isArray$a(value)) {
2467
2467
  // Recursively convert values (susceptible to call stack limits).
2468
2468
  return arrayMap$2(value, baseToString$1) + '';
2469
2469
  }
@@ -2501,7 +2501,7 @@ function toString$1(value) {
2501
2501
  return value == null ? '' : baseToString(value);
2502
2502
  }
2503
2503
 
2504
- var toString_1 = toString$1;var isArray$a = isArray_1,
2504
+ var toString_1 = toString$1;var isArray$9 = isArray_1,
2505
2505
  isKey$2 = _isKey,
2506
2506
  stringToPath = _stringToPath,
2507
2507
  toString = toString_1;
@@ -2514,14 +2514,14 @@ var toString_1 = toString$1;var isArray$a = isArray_1,
2514
2514
  * @param {Object} [object] The object to query keys on.
2515
2515
  * @returns {Array} Returns the cast property path array.
2516
2516
  */
2517
- function castPath$4(value, object) {
2518
- if (isArray$a(value)) {
2517
+ function castPath$2(value, object) {
2518
+ if (isArray$9(value)) {
2519
2519
  return value;
2520
2520
  }
2521
2521
  return isKey$2(value, object) ? [value] : stringToPath(toString(value));
2522
2522
  }
2523
2523
 
2524
- var _castPath = castPath$4;var isSymbol$2 = isSymbol_1;
2524
+ var _castPath = castPath$2;var isSymbol$2 = isSymbol_1;
2525
2525
 
2526
2526
  /** Used as references for various `Number` constants. */
2527
2527
  var INFINITY$1 = 1 / 0;
@@ -2533,7 +2533,7 @@ var INFINITY$1 = 1 / 0;
2533
2533
  * @param {*} value The value to inspect.
2534
2534
  * @returns {string|symbol} Returns the key.
2535
2535
  */
2536
- function toKey$5(value) {
2536
+ function toKey$4(value) {
2537
2537
  if (typeof value == 'string' || isSymbol$2(value)) {
2538
2538
  return value;
2539
2539
  }
@@ -2541,8 +2541,8 @@ function toKey$5(value) {
2541
2541
  return (result == '0' && (1 / value) == -INFINITY$1) ? '-0' : result;
2542
2542
  }
2543
2543
 
2544
- var _toKey = toKey$5;var castPath$3 = _castPath,
2545
- toKey$4 = _toKey;
2544
+ var _toKey = toKey$4;var castPath$1 = _castPath,
2545
+ toKey$3 = _toKey;
2546
2546
 
2547
2547
  /**
2548
2548
  * The base implementation of `_.get` without support for default values.
@@ -2552,19 +2552,19 @@ var _toKey = toKey$5;var castPath$3 = _castPath,
2552
2552
  * @param {Array|string} path The path of the property to get.
2553
2553
  * @returns {*} Returns the resolved value.
2554
2554
  */
2555
- function baseGet$4(object, path) {
2556
- path = castPath$3(path, object);
2555
+ function baseGet$3(object, path) {
2556
+ path = castPath$1(path, object);
2557
2557
 
2558
2558
  var index = 0,
2559
2559
  length = path.length;
2560
2560
 
2561
2561
  while (object != null && index < length) {
2562
- object = object[toKey$4(path[index++])];
2562
+ object = object[toKey$3(path[index++])];
2563
2563
  }
2564
2564
  return (index && index == length) ? object : undefined;
2565
2565
  }
2566
2566
 
2567
- var _baseGet = baseGet$4;var ListCache$2 = _ListCache;
2567
+ var _baseGet = baseGet$3;var ListCache$2 = _ListCache;
2568
2568
 
2569
2569
  /**
2570
2570
  * Removes all key-value entries from the stack.
@@ -2902,7 +2902,7 @@ function setToArray$1(set) {
2902
2902
  return result;
2903
2903
  }
2904
2904
 
2905
- var _setToArray = setToArray$1;var Symbol$3 = _Symbol,
2905
+ var _setToArray = setToArray$1;var Symbol$2 = _Symbol,
2906
2906
  Uint8Array$1 = _Uint8Array,
2907
2907
  eq$1 = eq_1,
2908
2908
  equalArrays$1 = _equalArrays,
@@ -2928,7 +2928,7 @@ var arrayBufferTag$3 = '[object ArrayBuffer]',
2928
2928
  dataViewTag$4 = '[object DataView]';
2929
2929
 
2930
2930
  /** Used to convert symbols to primitives and strings. */
2931
- var symbolProto$1 = Symbol$3 ? Symbol$3.prototype : undefined,
2931
+ var symbolProto$1 = Symbol$2 ? Symbol$2.prototype : undefined,
2932
2932
  symbolValueOf$1 = symbolProto$1 ? symbolProto$1.valueOf : undefined;
2933
2933
 
2934
2934
  /**
@@ -3022,7 +3022,7 @@ var _equalByTag = equalByTag$1;/**
3022
3022
  * @returns {Array} Returns `array`.
3023
3023
  */
3024
3024
 
3025
- function arrayPush$3(array, values) {
3025
+ function arrayPush$2(array, values) {
3026
3026
  var index = -1,
3027
3027
  length = values.length,
3028
3028
  offset = array.length;
@@ -3033,8 +3033,8 @@ function arrayPush$3(array, values) {
3033
3033
  return array;
3034
3034
  }
3035
3035
 
3036
- var _arrayPush = arrayPush$3;var arrayPush$2 = _arrayPush,
3037
- isArray$9 = isArray_1;
3036
+ var _arrayPush = arrayPush$2;var arrayPush$1 = _arrayPush,
3037
+ isArray$8 = isArray_1;
3038
3038
 
3039
3039
  /**
3040
3040
  * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
@@ -3049,7 +3049,7 @@ var _arrayPush = arrayPush$3;var arrayPush$2 = _arrayPush,
3049
3049
  */
3050
3050
  function baseGetAllKeys$2(object, keysFunc, symbolsFunc) {
3051
3051
  var result = keysFunc(object);
3052
- return isArray$9(object) ? result : arrayPush$2(result, symbolsFunc(object));
3052
+ return isArray$8(object) ? result : arrayPush$1(result, symbolsFunc(object));
3053
3053
  }
3054
3054
 
3055
3055
  var _baseGetAllKeys = baseGetAllKeys$2;/**
@@ -3196,12 +3196,12 @@ var propertyIsEnumerable = objectProto$8.propertyIsEnumerable;
3196
3196
  * _.isArguments([1, 2, 3]);
3197
3197
  * // => false
3198
3198
  */
3199
- var isArguments$3 = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
3199
+ var isArguments$2 = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
3200
3200
  return isObjectLike$4(value) && hasOwnProperty$8.call(value, 'callee') &&
3201
3201
  !propertyIsEnumerable.call(value, 'callee');
3202
3202
  };
3203
3203
 
3204
- var isArguments_1 = isArguments$3;var isBuffer$3 = {exports: {}};/**
3204
+ var isArguments_1 = isArguments$2;var isBuffer$3 = {exports: {}};/**
3205
3205
  * This method returns `false`.
3206
3206
  *
3207
3207
  * @static
@@ -3273,7 +3273,7 @@ var reIsUint = /^(?:0|[1-9]\d*)$/;
3273
3273
  * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
3274
3274
  * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
3275
3275
  */
3276
- function isIndex$3(value, length) {
3276
+ function isIndex$2(value, length) {
3277
3277
  var type = typeof value;
3278
3278
  length = length == null ? MAX_SAFE_INTEGER$1 : length;
3279
3279
 
@@ -3283,7 +3283,7 @@ function isIndex$3(value, length) {
3283
3283
  (value > -1 && value % 1 == 0 && value < length);
3284
3284
  }
3285
3285
 
3286
- var _isIndex = isIndex$3;/** Used as references for various `Number` constants. */
3286
+ var _isIndex = isIndex$2;/** Used as references for various `Number` constants. */
3287
3287
 
3288
3288
  var MAX_SAFE_INTEGER = 9007199254740991;
3289
3289
 
@@ -3449,10 +3449,10 @@ var nodeIsTypedArray = nodeUtil$2 && nodeUtil$2.isTypedArray;
3449
3449
  var isTypedArray$2 = nodeIsTypedArray ? baseUnary$4(nodeIsTypedArray) : baseIsTypedArray;
3450
3450
 
3451
3451
  var isTypedArray_1 = isTypedArray$2;var baseTimes = _baseTimes,
3452
- isArguments$2 = isArguments_1,
3453
- isArray$8 = isArray_1,
3452
+ isArguments$1 = isArguments_1,
3453
+ isArray$7 = isArray_1,
3454
3454
  isBuffer$2 = isBuffer$3.exports,
3455
- isIndex$2 = _isIndex,
3455
+ isIndex$1 = _isIndex,
3456
3456
  isTypedArray$1 = isTypedArray_1;
3457
3457
 
3458
3458
  /** Used for built-in method references. */
@@ -3470,8 +3470,8 @@ var hasOwnProperty$7 = objectProto$7.hasOwnProperty;
3470
3470
  * @returns {Array} Returns the array of property names.
3471
3471
  */
3472
3472
  function arrayLikeKeys$2(value, inherited) {
3473
- var isArr = isArray$8(value),
3474
- isArg = !isArr && isArguments$2(value),
3473
+ var isArr = isArray$7(value),
3474
+ isArg = !isArr && isArguments$1(value),
3475
3475
  isBuff = !isArr && !isArg && isBuffer$2(value),
3476
3476
  isType = !isArr && !isArg && !isBuff && isTypedArray$1(value),
3477
3477
  skipIndexes = isArr || isArg || isBuff || isType,
@@ -3488,7 +3488,7 @@ function arrayLikeKeys$2(value, inherited) {
3488
3488
  // PhantomJS 2 has enumerable non-index properties on typed arrays.
3489
3489
  (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
3490
3490
  // Skip index properties.
3491
- isIndex$2(key, length)
3491
+ isIndex$1(key, length)
3492
3492
  ))) {
3493
3493
  result.push(key);
3494
3494
  }
@@ -3821,7 +3821,7 @@ var _getTag = getTag$4;var Stack$2 = _Stack,
3821
3821
  equalByTag = _equalByTag,
3822
3822
  equalObjects = _equalObjects,
3823
3823
  getTag$3 = _getTag,
3824
- isArray$7 = isArray_1,
3824
+ isArray$6 = isArray_1,
3825
3825
  isBuffer$1 = isBuffer$3.exports,
3826
3826
  isTypedArray = isTypedArray_1;
3827
3827
 
@@ -3854,8 +3854,8 @@ var hasOwnProperty$4 = objectProto$3.hasOwnProperty;
3854
3854
  * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
3855
3855
  */
3856
3856
  function baseIsEqualDeep$1(object, other, bitmask, customizer, equalFunc, stack) {
3857
- var objIsArr = isArray$7(object),
3858
- othIsArr = isArray$7(other),
3857
+ var objIsArr = isArray$6(object),
3858
+ othIsArr = isArray$6(other),
3859
3859
  objTag = objIsArr ? arrayTag$1 : getTag$3(object),
3860
3860
  othTag = othIsArr ? arrayTag$1 : getTag$3(other);
3861
3861
 
@@ -3986,7 +3986,7 @@ function baseIsMatch$1(object, source, matchData, customizer) {
3986
3986
  return true;
3987
3987
  }
3988
3988
 
3989
- var _baseIsMatch = baseIsMatch$1;var isObject$5 = isObject_1;
3989
+ var _baseIsMatch = baseIsMatch$1;var isObject$4 = isObject_1;
3990
3990
 
3991
3991
  /**
3992
3992
  * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
@@ -3997,7 +3997,7 @@ var _baseIsMatch = baseIsMatch$1;var isObject$5 = isObject_1;
3997
3997
  * equality comparisons, else `false`.
3998
3998
  */
3999
3999
  function isStrictComparable$2(value) {
4000
- return value === value && !isObject$5(value);
4000
+ return value === value && !isObject$4(value);
4001
4001
  }
4002
4002
 
4003
4003
  var _isStrictComparable = isStrictComparable$2;var isStrictComparable$1 = _isStrictComparable,
@@ -4064,7 +4064,7 @@ function baseMatches$1(source) {
4064
4064
  };
4065
4065
  }
4066
4066
 
4067
- var _baseMatches = baseMatches$1;var baseGet$3 = _baseGet;
4067
+ var _baseMatches = baseMatches$1;var baseGet$2 = _baseGet;
4068
4068
 
4069
4069
  /**
4070
4070
  * Gets the value at `path` of `object`. If the resolved value is
@@ -4092,7 +4092,7 @@ var _baseMatches = baseMatches$1;var baseGet$3 = _baseGet;
4092
4092
  * // => 'default'
4093
4093
  */
4094
4094
  function get$3(object, path, defaultValue) {
4095
- var result = object == null ? undefined : baseGet$3(object, path);
4095
+ var result = object == null ? undefined : baseGet$2(object, path);
4096
4096
  return result === undefined ? defaultValue : result;
4097
4097
  }
4098
4098
 
@@ -4109,12 +4109,12 @@ function baseHasIn$1(object, key) {
4109
4109
  return object != null && key in Object(object);
4110
4110
  }
4111
4111
 
4112
- var _baseHasIn = baseHasIn$1;var castPath$2 = _castPath,
4113
- isArguments$1 = isArguments_1,
4114
- isArray$6 = isArray_1,
4115
- isIndex$1 = _isIndex,
4112
+ var _baseHasIn = baseHasIn$1;var castPath = _castPath,
4113
+ isArguments = isArguments_1,
4114
+ isArray$5 = isArray_1,
4115
+ isIndex = _isIndex,
4116
4116
  isLength = isLength_1,
4117
- toKey$3 = _toKey;
4117
+ toKey$2 = _toKey;
4118
4118
 
4119
4119
  /**
4120
4120
  * Checks if `path` exists on `object`.
@@ -4126,14 +4126,14 @@ var _baseHasIn = baseHasIn$1;var castPath$2 = _castPath,
4126
4126
  * @returns {boolean} Returns `true` if `path` exists, else `false`.
4127
4127
  */
4128
4128
  function hasPath$1(object, path, hasFunc) {
4129
- path = castPath$2(path, object);
4129
+ path = castPath(path, object);
4130
4130
 
4131
4131
  var index = -1,
4132
4132
  length = path.length,
4133
4133
  result = false;
4134
4134
 
4135
4135
  while (++index < length) {
4136
- var key = toKey$3(path[index]);
4136
+ var key = toKey$2(path[index]);
4137
4137
  if (!(result = object != null && hasFunc(object, key))) {
4138
4138
  break;
4139
4139
  }
@@ -4143,8 +4143,8 @@ function hasPath$1(object, path, hasFunc) {
4143
4143
  return result;
4144
4144
  }
4145
4145
  length = object == null ? 0 : object.length;
4146
- return !!length && isLength(length) && isIndex$1(key, length) &&
4147
- (isArray$6(object) || isArguments$1(object));
4146
+ return !!length && isLength(length) && isIndex(key, length) &&
4147
+ (isArray$5(object) || isArguments(object));
4148
4148
  }
4149
4149
 
4150
4150
  var _hasPath = hasPath$1;var baseHasIn = _baseHasIn,
@@ -4176,17 +4176,17 @@ var _hasPath = hasPath$1;var baseHasIn = _baseHasIn,
4176
4176
  * _.hasIn(object, 'b');
4177
4177
  * // => false
4178
4178
  */
4179
- function hasIn$2(object, path) {
4179
+ function hasIn$1(object, path) {
4180
4180
  return object != null && hasPath(object, path, baseHasIn);
4181
4181
  }
4182
4182
 
4183
- var hasIn_1 = hasIn$2;var baseIsEqual = _baseIsEqual,
4183
+ var hasIn_1 = hasIn$1;var baseIsEqual = _baseIsEqual,
4184
4184
  get$2 = get_1,
4185
- hasIn$1 = hasIn_1,
4185
+ hasIn = hasIn_1,
4186
4186
  isKey$1 = _isKey,
4187
4187
  isStrictComparable = _isStrictComparable,
4188
4188
  matchesStrictComparable = _matchesStrictComparable,
4189
- toKey$2 = _toKey;
4189
+ toKey$1 = _toKey;
4190
4190
 
4191
4191
  /** Used to compose bitmasks for value comparisons. */
4192
4192
  var COMPARE_PARTIAL_FLAG = 1,
@@ -4202,12 +4202,12 @@ var COMPARE_PARTIAL_FLAG = 1,
4202
4202
  */
4203
4203
  function baseMatchesProperty$1(path, srcValue) {
4204
4204
  if (isKey$1(path) && isStrictComparable(srcValue)) {
4205
- return matchesStrictComparable(toKey$2(path), srcValue);
4205
+ return matchesStrictComparable(toKey$1(path), srcValue);
4206
4206
  }
4207
4207
  return function(object) {
4208
4208
  var objValue = get$2(object, path);
4209
4209
  return (objValue === undefined && objValue === srcValue)
4210
- ? hasIn$1(object, path)
4210
+ ? hasIn(object, path)
4211
4211
  : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
4212
4212
  };
4213
4213
  }
@@ -4247,7 +4247,7 @@ function baseProperty$1(key) {
4247
4247
  };
4248
4248
  }
4249
4249
 
4250
- var _baseProperty = baseProperty$1;var baseGet$2 = _baseGet;
4250
+ var _baseProperty = baseProperty$1;var baseGet$1 = _baseGet;
4251
4251
 
4252
4252
  /**
4253
4253
  * A specialized version of `baseProperty` which supports deep paths.
@@ -4258,14 +4258,14 @@ var _baseProperty = baseProperty$1;var baseGet$2 = _baseGet;
4258
4258
  */
4259
4259
  function basePropertyDeep$1(path) {
4260
4260
  return function(object) {
4261
- return baseGet$2(object, path);
4261
+ return baseGet$1(object, path);
4262
4262
  };
4263
4263
  }
4264
4264
 
4265
4265
  var _basePropertyDeep = basePropertyDeep$1;var baseProperty = _baseProperty,
4266
4266
  basePropertyDeep = _basePropertyDeep,
4267
4267
  isKey = _isKey,
4268
- toKey$1 = _toKey;
4268
+ toKey = _toKey;
4269
4269
 
4270
4270
  /**
4271
4271
  * Creates a function that returns the value at `path` of a given object.
@@ -4290,13 +4290,13 @@ var _basePropertyDeep = basePropertyDeep$1;var baseProperty = _baseProperty,
4290
4290
  * // => [1, 2]
4291
4291
  */
4292
4292
  function property$1(path) {
4293
- return isKey(path) ? baseProperty(toKey$1(path)) : basePropertyDeep(path);
4293
+ return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
4294
4294
  }
4295
4295
 
4296
4296
  var property_1 = property$1;var baseMatches = _baseMatches,
4297
4297
  baseMatchesProperty = _baseMatchesProperty,
4298
4298
  identity$3 = identity_1,
4299
- isArray$5 = isArray_1,
4299
+ isArray$4 = isArray_1,
4300
4300
  property = property_1;
4301
4301
 
4302
4302
  /**
@@ -4316,7 +4316,7 @@ function baseIteratee$2(value) {
4316
4316
  return identity$3;
4317
4317
  }
4318
4318
  if (typeof value == 'object') {
4319
- return isArray$5(value)
4319
+ return isArray$4(value)
4320
4320
  ? baseMatchesProperty(value[0], value[1])
4321
4321
  : baseMatches(value);
4322
4322
  }
@@ -4548,14 +4548,14 @@ function compareMultiple$1(object, other, orders) {
4548
4548
  }
4549
4549
 
4550
4550
  var _compareMultiple = compareMultiple$1;var arrayMap$1 = _arrayMap,
4551
- baseGet$1 = _baseGet,
4551
+ baseGet = _baseGet,
4552
4552
  baseIteratee$1 = _baseIteratee,
4553
4553
  baseMap = _baseMap,
4554
4554
  baseSortBy = _baseSortBy,
4555
4555
  baseUnary$3 = _baseUnary,
4556
4556
  compareMultiple = _compareMultiple,
4557
4557
  identity$2 = identity_1,
4558
- isArray$4 = isArray_1;
4558
+ isArray$3 = isArray_1;
4559
4559
 
4560
4560
  /**
4561
4561
  * The base implementation of `_.orderBy` without param guards.
@@ -4569,9 +4569,9 @@ var _compareMultiple = compareMultiple$1;var arrayMap$1 = _arrayMap,
4569
4569
  function baseOrderBy$1(collection, iteratees, orders) {
4570
4570
  if (iteratees.length) {
4571
4571
  iteratees = arrayMap$1(iteratees, function(iteratee) {
4572
- if (isArray$4(iteratee)) {
4572
+ if (isArray$3(iteratee)) {
4573
4573
  return function(value) {
4574
- return baseGet$1(value, iteratee.length === 1 ? iteratee[0] : iteratee);
4574
+ return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
4575
4575
  }
4576
4576
  }
4577
4577
  return iteratee;
@@ -4596,7 +4596,7 @@ function baseOrderBy$1(collection, iteratees, orders) {
4596
4596
  }
4597
4597
 
4598
4598
  var _baseOrderBy = baseOrderBy$1;var baseOrderBy = _baseOrderBy,
4599
- isArray$3 = isArray_1;
4599
+ isArray$2 = isArray_1;
4600
4600
 
4601
4601
  /**
4602
4602
  * This method is like `_.sortBy` except that it allows specifying the sort
@@ -4631,11 +4631,11 @@ function orderBy(collection, iteratees, orders, guard) {
4631
4631
  if (collection == null) {
4632
4632
  return [];
4633
4633
  }
4634
- if (!isArray$3(iteratees)) {
4634
+ if (!isArray$2(iteratees)) {
4635
4635
  iteratees = iteratees == null ? [] : [iteratees];
4636
4636
  }
4637
4637
  orders = guard ? undefined : orders;
4638
- if (!isArray$3(orders)) {
4638
+ if (!isArray$2(orders)) {
4639
4639
  orders = orders == null ? [] : [orders];
4640
4640
  }
4641
4641
  return baseOrderBy(collection, iteratees, orders);
@@ -4784,7 +4784,7 @@ function walk (root, cb, immutable) {
4784
4784
  if (stopHere) keepGoing = false;
4785
4785
  },
4786
4786
  remove : function (stopHere) {
4787
- if (isArray$2(state.parent.node)) {
4787
+ if (isArray$1(state.parent.node)) {
4788
4788
  state.parent.node.splice(state.key, 1);
4789
4789
  }
4790
4790
  else {
@@ -4873,7 +4873,7 @@ function copy (src) {
4873
4873
  if (typeof src === 'object' && src !== null) {
4874
4874
  var dst;
4875
4875
 
4876
- if (isArray$2(src)) {
4876
+ if (isArray$1(src)) {
4877
4877
  dst = [];
4878
4878
  }
4879
4879
  else if (isDate$1(src)) {
@@ -4933,7 +4933,7 @@ function isBoolean (obj) { return toS(obj) === '[object Boolean]' }
4933
4933
  function isNumber$1 (obj) { return toS(obj) === '[object Number]' }
4934
4934
  function isString (obj) { return toS(obj) === '[object String]' }
4935
4935
 
4936
- var isArray$2 = Array.isArray || function isArray (xs) {
4936
+ var isArray$1 = Array.isArray || function isArray (xs) {
4937
4937
  return Object.prototype.toString.call(xs) === '[object Array]';
4938
4938
  };
4939
4939
 
@@ -4958,11 +4958,10 @@ var hasOwnProperty$3 = Object.hasOwnProperty || function (obj, key) {
4958
4958
 
4959
4959
  var traverse$3 = traverse$4.exports;const SEPARATOR = '/';
4960
4960
  const STORE_ERROR_POSTFIX = '.error';
4961
+ const STORE_TOUCH_POSTFIX = '.touch';
4961
4962
  const PATH_MODIFIERS_KEY = '$pathModifiers';
4962
4963
  const MODIFIER_KEY = '$modifier';
4963
4964
  const ACTION_KEY = '$action';
4964
- const PERSIST_STORAGE_KEY = '$persistStores';
4965
- const PERSIST_STORAGE_NAMES = ['data'];
4966
4965
  const REF_ASSETS = '$assetsRef';
4967
4966
  const REF_LOCALES = '$locales';
4968
4967
  const REF_VALIDATES = '$validations';
@@ -4985,10 +4984,11 @@ const REDUX_PATHS = '$$reduxPaths';
4985
4984
  const V_CHILDREN_PREFIX = '$child';
4986
4985
  const PARENT_PROP_NAME = '__parentprop';
4987
4986
  const CURRENT_PATH_NAME = '__currentPaths';
4987
+ const REDUX_GET_SUBSCRIBERS_NAME = '__subscriberPaths';
4988
4988
  const UNDEFINED_COMP_NAME = '_Undefined';
4989
4989
  const PRIMITIVE_COMP_NAME = '_PrimitiveProp'; // TODO check all literal and replace with this constant
4990
4990
  const FRAGMENT_COMP_NAME = 'Fragment'; // TODO check all literal and replace with this constant
4991
- var constants=/*#__PURE__*/Object.freeze({__proto__:null,SEPARATOR:SEPARATOR,STORE_ERROR_POSTFIX:STORE_ERROR_POSTFIX,PATH_MODIFIERS_KEY:PATH_MODIFIERS_KEY,MODIFIER_KEY:MODIFIER_KEY,ACTION_KEY:ACTION_KEY,PERSIST_STORAGE_KEY:PERSIST_STORAGE_KEY,PERSIST_STORAGE_NAMES:PERSIST_STORAGE_NAMES,REF_ASSETS:REF_ASSETS,REF_LOCALES:REF_LOCALES,REF_VALIDATES:REF_VALIDATES,STYLE_WEB_NAME:STYLE_WEB_NAME,STYLE_RN_NAME:STYLE_RN_NAME,REDUX_GET_FUNCTION:REDUX_GET_FUNCTION,REDUX_SET_FUNCTION:REDUX_SET_FUNCTION,REDUX_FUNCTIONS:REDUX_FUNCTIONS,PATHNAME:PATHNAME,SIMPLE_DATA_TYPES:SIMPLE_DATA_TYPES,V_CHILDREN_NAME:V_CHILDREN_NAME,V_COMP_NAME:V_COMP_NAME,LIST_SEMAPHORE:LIST_SEMAPHORE,LIST_ITEM:LIST_ITEM,LIST_PAGE:LIST_PAGE,LIST_ITEM_PER_PAGE:LIST_ITEM_PER_PAGE,LIST_LENGTH:LIST_LENGTH,LIST_ITEM_PER_PAGE_DEFAULT:LIST_ITEM_PER_PAGE_DEFAULT,REDUX_PATHS:REDUX_PATHS,V_CHILDREN_PREFIX:V_CHILDREN_PREFIX,PARENT_PROP_NAME:PARENT_PROP_NAME,CURRENT_PATH_NAME:CURRENT_PATH_NAME,UNDEFINED_COMP_NAME:UNDEFINED_COMP_NAME,PRIMITIVE_COMP_NAME:PRIMITIVE_COMP_NAME,FRAGMENT_COMP_NAME:FRAGMENT_COMP_NAME});var jsonpointer = {};var hasExcape = /~/;
4991
+ var constants=/*#__PURE__*/Object.freeze({__proto__:null,SEPARATOR:SEPARATOR,STORE_ERROR_POSTFIX:STORE_ERROR_POSTFIX,STORE_TOUCH_POSTFIX:STORE_TOUCH_POSTFIX,PATH_MODIFIERS_KEY:PATH_MODIFIERS_KEY,MODIFIER_KEY:MODIFIER_KEY,ACTION_KEY:ACTION_KEY,REF_ASSETS:REF_ASSETS,REF_LOCALES:REF_LOCALES,REF_VALIDATES:REF_VALIDATES,STYLE_WEB_NAME:STYLE_WEB_NAME,STYLE_RN_NAME:STYLE_RN_NAME,REDUX_GET_FUNCTION:REDUX_GET_FUNCTION,REDUX_SET_FUNCTION:REDUX_SET_FUNCTION,REDUX_FUNCTIONS:REDUX_FUNCTIONS,PATHNAME:PATHNAME,SIMPLE_DATA_TYPES:SIMPLE_DATA_TYPES,V_CHILDREN_NAME:V_CHILDREN_NAME,V_COMP_NAME:V_COMP_NAME,LIST_SEMAPHORE:LIST_SEMAPHORE,LIST_ITEM:LIST_ITEM,LIST_PAGE:LIST_PAGE,LIST_ITEM_PER_PAGE:LIST_ITEM_PER_PAGE,LIST_LENGTH:LIST_LENGTH,LIST_ITEM_PER_PAGE_DEFAULT:LIST_ITEM_PER_PAGE_DEFAULT,REDUX_PATHS:REDUX_PATHS,V_CHILDREN_PREFIX:V_CHILDREN_PREFIX,PARENT_PROP_NAME:PARENT_PROP_NAME,CURRENT_PATH_NAME:CURRENT_PATH_NAME,REDUX_GET_SUBSCRIBERS_NAME:REDUX_GET_SUBSCRIBERS_NAME,UNDEFINED_COMP_NAME:UNDEFINED_COMP_NAME,PRIMITIVE_COMP_NAME:PRIMITIVE_COMP_NAME,FRAGMENT_COMP_NAME:FRAGMENT_COMP_NAME});var jsonpointer = {};var hasExcape = /~/;
4992
4992
  var escapeMatcher = /~[01]/g;
4993
4993
  function escapeReplacer (m) {
4994
4994
  switch (m) {
@@ -5162,7 +5162,7 @@ var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
5162
5162
  * @param {string} key The key of the property to assign.
5163
5163
  * @param {*} value The value to assign.
5164
5164
  */
5165
- function assignValue$3(object, key, value) {
5165
+ function assignValue$2(object, key, value) {
5166
5166
  var objValue = object[key];
5167
5167
  if (!(hasOwnProperty$2.call(object, key) && eq(objValue, value)) ||
5168
5168
  (value === undefined && !(key in object))) {
@@ -5170,7 +5170,7 @@ function assignValue$3(object, key, value) {
5170
5170
  }
5171
5171
  }
5172
5172
 
5173
- var _assignValue = assignValue$3;var assignValue$2 = _assignValue,
5173
+ var _assignValue = assignValue$2;var assignValue$1 = _assignValue,
5174
5174
  baseAssignValue = _baseAssignValue;
5175
5175
 
5176
5176
  /**
@@ -5203,7 +5203,7 @@ function copyObject$4(source, props, object, customizer) {
5203
5203
  if (isNew) {
5204
5204
  baseAssignValue(object, key, newValue);
5205
5205
  } else {
5206
- assignValue$2(object, key, newValue);
5206
+ assignValue$1(object, key, newValue);
5207
5207
  }
5208
5208
  }
5209
5209
  return object;
@@ -5245,7 +5245,7 @@ function nativeKeysIn$1(object) {
5245
5245
  return result;
5246
5246
  }
5247
5247
 
5248
- var _nativeKeysIn = nativeKeysIn$1;var isObject$4 = isObject_1,
5248
+ var _nativeKeysIn = nativeKeysIn$1;var isObject$3 = isObject_1,
5249
5249
  isPrototype$1 = _isPrototype,
5250
5250
  nativeKeysIn = _nativeKeysIn;
5251
5251
 
@@ -5263,7 +5263,7 @@ var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
5263
5263
  * @returns {Array} Returns the array of property names.
5264
5264
  */
5265
5265
  function baseKeysIn$1(object) {
5266
- if (!isObject$4(object)) {
5266
+ if (!isObject$3(object)) {
5267
5267
  return nativeKeysIn(object);
5268
5268
  }
5269
5269
  var isProto = isPrototype$1(object),
@@ -5400,7 +5400,7 @@ var _copySymbols = copySymbols$1;var overArg = _overArg;
5400
5400
  /** Built-in value references. */
5401
5401
  var getPrototype$2 = overArg(Object.getPrototypeOf, Object);
5402
5402
 
5403
- var _getPrototype = getPrototype$2;var arrayPush$1 = _arrayPush,
5403
+ var _getPrototype = getPrototype$2;var arrayPush = _arrayPush,
5404
5404
  getPrototype$1 = _getPrototype,
5405
5405
  getSymbols = _getSymbols,
5406
5406
  stubArray = stubArray_1;
@@ -5418,7 +5418,7 @@ var nativeGetSymbols = Object.getOwnPropertySymbols;
5418
5418
  var getSymbolsIn$2 = !nativeGetSymbols ? stubArray : function(object) {
5419
5419
  var result = [];
5420
5420
  while (object) {
5421
- arrayPush$1(result, getSymbols(object));
5421
+ arrayPush(result, getSymbols(object));
5422
5422
  object = getPrototype$1(object);
5423
5423
  }
5424
5424
  return result;
@@ -5528,10 +5528,10 @@ function cloneRegExp$1(regexp) {
5528
5528
  return result;
5529
5529
  }
5530
5530
 
5531
- var _cloneRegExp = cloneRegExp$1;var Symbol$2 = _Symbol;
5531
+ var _cloneRegExp = cloneRegExp$1;var Symbol$1 = _Symbol;
5532
5532
 
5533
5533
  /** Used to convert symbols to primitives and strings. */
5534
- var symbolProto = Symbol$2 ? Symbol$2.prototype : undefined,
5534
+ var symbolProto = Symbol$1 ? Symbol$1.prototype : undefined,
5535
5535
  symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
5536
5536
 
5537
5537
  /**
@@ -5636,7 +5636,7 @@ function initCloneByTag$1(object, tag, isDeep) {
5636
5636
  }
5637
5637
  }
5638
5638
 
5639
- var _initCloneByTag = initCloneByTag$1;var isObject$3 = isObject_1;
5639
+ var _initCloneByTag = initCloneByTag$1;var isObject$2 = isObject_1;
5640
5640
 
5641
5641
  /** Built-in value references. */
5642
5642
  var objectCreate = Object.create;
@@ -5652,7 +5652,7 @@ var objectCreate = Object.create;
5652
5652
  var baseCreate$1 = (function() {
5653
5653
  function object() {}
5654
5654
  return function(proto) {
5655
- if (!isObject$3(proto)) {
5655
+ if (!isObject$2(proto)) {
5656
5656
  return {};
5657
5657
  }
5658
5658
  if (objectCreate) {
@@ -5770,7 +5770,7 @@ var isSet$1 = nodeIsSet ? baseUnary$1(nodeIsSet) : baseIsSet;
5770
5770
 
5771
5771
  var isSet_1 = isSet$1;var Stack = _Stack,
5772
5772
  arrayEach = _arrayEach,
5773
- assignValue$1 = _assignValue,
5773
+ assignValue = _assignValue,
5774
5774
  baseAssign = _baseAssign,
5775
5775
  baseAssignIn = _baseAssignIn,
5776
5776
  cloneBuffer = _cloneBuffer.exports,
@@ -5783,10 +5783,10 @@ var isSet_1 = isSet$1;var Stack = _Stack,
5783
5783
  initCloneArray = _initCloneArray,
5784
5784
  initCloneByTag = _initCloneByTag,
5785
5785
  initCloneObject = _initCloneObject,
5786
- isArray$1 = isArray_1,
5786
+ isArray = isArray_1,
5787
5787
  isBuffer = isBuffer$3.exports,
5788
5788
  isMap = isMap_1,
5789
- isObject$2 = isObject_1,
5789
+ isObject$1 = isObject_1,
5790
5790
  isSet = isSet_1,
5791
5791
  keys = keys_1,
5792
5792
  keysIn = keysIn_1;
@@ -5869,10 +5869,10 @@ function baseClone$1(value, bitmask, customizer, key, object, stack) {
5869
5869
  if (result !== undefined) {
5870
5870
  return result;
5871
5871
  }
5872
- if (!isObject$2(value)) {
5872
+ if (!isObject$1(value)) {
5873
5873
  return value;
5874
5874
  }
5875
- var isArr = isArray$1(value);
5875
+ var isArr = isArray(value);
5876
5876
  if (isArr) {
5877
5877
  result = initCloneArray(value);
5878
5878
  if (!isDeep) {
@@ -5928,7 +5928,7 @@ function baseClone$1(value, bitmask, customizer, key, object, stack) {
5928
5928
  subValue = value[key];
5929
5929
  }
5930
5930
  // Recursively populate clone (susceptible to call stack limits).
5931
- assignValue$1(result, key, baseClone$1(subValue, bitmask, customizer, key, value, stack));
5931
+ assignValue(result, key, baseClone$1(subValue, bitmask, customizer, key, value, stack));
5932
5932
  });
5933
5933
  return result;
5934
5934
  }
@@ -6023,7 +6023,7 @@ function baseTrim$1(string) {
6023
6023
  }
6024
6024
 
6025
6025
  var _baseTrim = baseTrim$1;var baseTrim = _baseTrim,
6026
- isObject$1 = isObject_1,
6026
+ isObject = isObject_1,
6027
6027
  isSymbol = isSymbol_1;
6028
6028
 
6029
6029
  /** Used as references for various `Number` constants. */
@@ -6071,9 +6071,9 @@ function toNumber$1(value) {
6071
6071
  if (isSymbol(value)) {
6072
6072
  return NAN;
6073
6073
  }
6074
- if (isObject$1(value)) {
6074
+ if (isObject(value)) {
6075
6075
  var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
6076
- value = isObject$1(other) ? (other + '') : other;
6076
+ value = isObject(other) ? (other + '') : other;
6077
6077
  }
6078
6078
  if (typeof value != 'string') {
6079
6079
  return value === 0 ? value : +value;
@@ -6250,7 +6250,7 @@ var nativeMax = Math.max;
6250
6250
  * @param {Function} transform The rest array transform.
6251
6251
  * @returns {Function} Returns the new function.
6252
6252
  */
6253
- function overRest$2(func, start, transform) {
6253
+ function overRest$1(func, start, transform) {
6254
6254
  start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
6255
6255
  return function() {
6256
6256
  var args = arguments,
@@ -6271,7 +6271,7 @@ function overRest$2(func, start, transform) {
6271
6271
  };
6272
6272
  }
6273
6273
 
6274
- var _overRest = overRest$2;/**
6274
+ var _overRest = overRest$1;/**
6275
6275
  * Creates a function that returns `value`.
6276
6276
  *
6277
6277
  * @static
@@ -6366,11 +6366,11 @@ var _shortOut = shortOut$1;var baseSetToString = _baseSetToString,
6366
6366
  * @param {Function} string The `toString` result.
6367
6367
  * @returns {Function} Returns `func`.
6368
6368
  */
6369
- var setToString$2 = shortOut(baseSetToString);
6369
+ var setToString$1 = shortOut(baseSetToString);
6370
6370
 
6371
- var _setToString = setToString$2;var identity = identity_1,
6372
- overRest$1 = _overRest,
6373
- setToString$1 = _setToString;
6371
+ var _setToString = setToString$1;var identity = identity_1,
6372
+ overRest = _overRest,
6373
+ setToString = _setToString;
6374
6374
 
6375
6375
  /**
6376
6376
  * The base implementation of `_.rest` which doesn't validate or coerce arguments.
@@ -6381,7 +6381,7 @@ var _setToString = setToString$2;var identity = identity_1,
6381
6381
  * @returns {Function} Returns the new function.
6382
6382
  */
6383
6383
  function baseRest$1(func, start) {
6384
- return setToString$1(overRest$1(func, start, identity), func + '');
6384
+ return setToString(overRest(func, start, identity), func + '');
6385
6385
  }
6386
6386
 
6387
6387
  var _baseRest = baseRest$1;/**
@@ -6573,13 +6573,22 @@ var pull_1 = pull;const findLastIndex = (arr, func) => {
6573
6573
  };
6574
6574
  const drop = (arr, n = 1) => arr.slice(n);
6575
6575
  const isNumber = (a) => typeof a === 'number';
6576
+ const jsonPointerFix = (path) => {
6577
+ if (path !== null && path !== undefined && typeof path === 'string') {
6578
+ let str = path;
6579
+ str = str.charAt(str.length - 1) === SEPARATOR ? str.slice(0, -1) : str;
6580
+ str = str.startsWith(SEPARATOR) ? str : `${SEPARATOR}${str}`;
6581
+ return str;
6582
+ }
6583
+ return SEPARATOR;
6584
+ };
6576
6585
  const jsonPointerGet = (json, path) => {
6577
6586
  if (json === undefined || path === null || path === undefined || typeof path !== 'string')
6578
6587
  return undefined;
6579
6588
  if (path === SEPARATOR /* || path === '' same effect */)
6580
6589
  return json;
6581
6590
  try {
6582
- return jsonpointer.get(json, path.startsWith(SEPARATOR) ? path : `${SEPARATOR}${path}`);
6591
+ return jsonpointer.get(json, jsonPointerFix(path));
6583
6592
  }
6584
6593
  catch (e) {
6585
6594
  return undefined;
@@ -6592,7 +6601,7 @@ const jsonPointerSet = (json, path, value) => {
6592
6601
  return value;
6593
6602
  }
6594
6603
  try {
6595
- jsonpointer.set(json, path.startsWith(SEPARATOR) ? path : `${SEPARATOR}${path}`, value);
6604
+ jsonpointer.set(json, jsonPointerFix(path), value);
6596
6605
  return json;
6597
6606
  // eslint-disable-next-line no-empty
6598
6607
  }
@@ -6682,7 +6691,7 @@ const collectObjMerge = (refConst, json) => {
6682
6691
  }
6683
6692
  return res;
6684
6693
  };
6685
- const collectObjToArray = (refConst, json) => {
6694
+ const collectObjToArray = (refConst, json, flatten = false) => {
6686
6695
  if (refConst && json && typeof json === 'object') {
6687
6696
  const refs = [];
6688
6697
  // eslint-disable-next-line func-names
@@ -6691,11 +6700,11 @@ const collectObjToArray = (refConst, json) => {
6691
6700
  refs.push(x[refConst]);
6692
6701
  }
6693
6702
  });
6694
- return refs;
6703
+ return flatten === true ? refs.flat() : refs;
6695
6704
  }
6696
6705
  return [];
6697
6706
  };
6698
- const isCircular = (d) => {
6707
+ const isValidJson = (d) => {
6699
6708
  try {
6700
6709
  JSON.stringify(d);
6701
6710
  }
@@ -6703,7 +6712,24 @@ const isCircular = (d) => {
6703
6712
  return true;
6704
6713
  }
6705
6714
  return false;
6706
- };var util$1=/*#__PURE__*/Object.freeze({__proto__:null,findLastIndex:findLastIndex,drop:drop,isNumber:isNumber,jsonPointerGet:jsonPointerGet,jsonPointerSet:jsonPointerSet,pathArrayToPathString:pathArrayToPathString,pathArrayToJsonPointer:pathArrayToJsonPointer,isOnlyObject:isOnlyObject,mergePath:mergePath,changeRelativePath:changeRelativePath,mergeDeep:mergeDeep,collectObjMerge:collectObjMerge,collectObjToArray:collectObjToArray,isCircular:isCircular});const getFilteredPath = (_a, func) => {
6715
+ };
6716
+ const isPrimitiveValue = (value, emptyStringAllowed = false) => value !== 'undefined' && value !== null && ['string', 'boolean', 'number', 'bigint'].includes(typeof value) && (value !== '' || emptyStringAllowed);
6717
+ const hasLeaf = (obj, emptyStringAllowed) => {
6718
+ if (typeof obj === 'object') {
6719
+ // eslint-disable-next-line no-restricted-syntax
6720
+ for (const key in obj) {
6721
+ // eslint-disable-next-line no-prototype-builtins
6722
+ if (obj.hasOwnProperty(key)) {
6723
+ const value = obj[key];
6724
+ if (typeof value === 'object') {
6725
+ return hasLeaf(value);
6726
+ }
6727
+ return isPrimitiveValue(value, emptyStringAllowed);
6728
+ }
6729
+ }
6730
+ }
6731
+ return isPrimitiveValue(obj, emptyStringAllowed);
6732
+ };var util$1=/*#__PURE__*/Object.freeze({__proto__:null,findLastIndex:findLastIndex,drop:drop,isNumber:isNumber,jsonPointerFix:jsonPointerFix,jsonPointerGet:jsonPointerGet,jsonPointerSet:jsonPointerSet,pathArrayToPathString:pathArrayToPathString,pathArrayToJsonPointer:pathArrayToJsonPointer,isOnlyObject:isOnlyObject,mergePath:mergePath,changeRelativePath:changeRelativePath,mergeDeep:mergeDeep,collectObjMerge:collectObjMerge,collectObjToArray:collectObjToArray,isValidJson:isValidJson,isPrimitiveValue:isPrimitiveValue,hasLeaf:hasLeaf});const getFilteredPath = (_a, func) => {
6707
6733
  var _b = PARENT_PROP_NAME; _a[_b]; var propsNew = __rest(_a, [_b + ""]);
6708
6734
  const paths = [];
6709
6735
  function* jsonTraverse(o) {
@@ -6762,9 +6788,7 @@ const calculatePropsFromModifier = (props, stock) => {
6762
6788
  }
6763
6789
  traverse$3(props).set(i.path, stock.callFunction(functionName, functionParams, props));
6764
6790
  }));
6765
- return reduxPaths.map((i) => {
6766
- return { store: i === null || i === void 0 ? void 0 : i.store, path: i === null || i === void 0 ? void 0 : i.path };
6767
- });
6791
+ return reduxPaths;
6768
6792
  };
6769
6793
  const getCurrentPaths = (props, pathModifier) => {
6770
6794
  const currentPaths = Object.assign({}, props[CURRENT_PATH_NAME]);
@@ -6812,7 +6836,7 @@ const genChildenFromListItem = (props, stock) => {
6812
6836
  const { path } = currentPaths[store];
6813
6837
  if (currentPaths && !listLength) {
6814
6838
  if (path) {
6815
- const list = stock.callFunction('get', { store, path });
6839
+ const list = stock.callFunction(REDUX_GET_FUNCTION, { store, path });
6816
6840
  listLength = !!list && Array.isArray(list) ? list.length : 0;
6817
6841
  }
6818
6842
  }
@@ -6835,14 +6859,14 @@ const genChildenFromListItem = (props, stock) => {
6835
6859
  return children.length > 0 ? children : undefined;
6836
6860
  };
6837
6861
  const getRootWrapperProps = (props, stock) => {
6838
- const newProps = Object.assign({}, props);
6839
- const subscriberPaths = calculatePropsFromModifier(newProps, stock);
6840
- actionBuilder(newProps, stock);
6841
- if (newProps[LIST_SEMAPHORE]) {
6842
- newProps[V_CHILDREN_NAME] = genChildenFromListItem(newProps, stock);
6862
+ const subscriberPaths = calculatePropsFromModifier(props, stock);
6863
+ actionBuilder(props, stock);
6864
+ if (props[LIST_SEMAPHORE]) {
6865
+ // eslint-disable-next-line no-param-reassign
6866
+ props[V_CHILDREN_NAME] = genChildenFromListItem(props, stock);
6843
6867
  }
6844
- newProps.subscriberPaths = subscriberPaths;
6845
- return newProps;
6868
+ // eslint-disable-next-line no-param-reassign
6869
+ props[REDUX_GET_SUBSCRIBERS_NAME] = subscriberPaths;
6846
6870
  };
6847
6871
  const isChildrenProp = (propName) => !!propName && typeof propName === 'string' && propName.startsWith(V_CHILDREN_PREFIX);
6848
6872
  const getParentProps = (props) => {
@@ -6905,10 +6929,10 @@ const isTechnicalProp = (propName) => [
6905
6929
  LIST_ITEM_PER_PAGE,
6906
6930
  LIST_LENGTH,
6907
6931
  'style',
6908
- 'subscriberPaths',
6932
+ REDUX_GET_SUBSCRIBERS_NAME,
6909
6933
  ].includes(propName);
6910
6934
  const removeTechnicalProps = (changeableProps) => {
6911
- const _a = changeableProps, _b = PARENT_PROP_NAME; _a[_b]; const _c = STYLE_WEB_NAME; _a[_c]; const _d = V_COMP_NAME; _a[_d]; const _e = PATH_MODIFIERS_KEY; _a[_e]; const _f = CURRENT_PATH_NAME; _a[_f]; const _g = PATH_MODIFIERS_KEY; _a[_g]; const _h = LIST_SEMAPHORE; _a[_h]; const _j = LIST_ITEM; _a[_j]; const _k = LIST_PAGE; _a[_k]; const _l = LIST_ITEM_PER_PAGE; _a[_l]; const _m = LIST_LENGTH; _a[_m]; const newProps = __rest(_a, [_b + "", "style", _c + "", _d + "", _e + "", _f + "", "subscriberPaths", _g + "", _h + "", _j + "", _k + "", _l + "", _m + ""]);
6935
+ const _a = changeableProps, _b = PARENT_PROP_NAME; _a[_b]; const _c = STYLE_WEB_NAME; _a[_c]; const _d = V_COMP_NAME; _a[_d]; const _e = PATH_MODIFIERS_KEY; _a[_e]; const _f = CURRENT_PATH_NAME; _a[_f]; const _g = REDUX_GET_SUBSCRIBERS_NAME; _a[_g]; const _h = PATH_MODIFIERS_KEY; _a[_h]; const _j = LIST_SEMAPHORE; _a[_j]; const _k = LIST_ITEM; _a[_k]; const _l = LIST_PAGE; _a[_l]; const _m = LIST_ITEM_PER_PAGE; _a[_m]; const _o = LIST_LENGTH; _a[_o]; const newProps = __rest(_a, [_b + "", "style", _c + "", _d + "", _e + "", _f + "", _g + "", _h + "", _j + "", _k + "", _l + "", _m + "", _o + ""]);
6912
6936
  return newProps;
6913
6937
  };var wrapperUtil=/*#__PURE__*/Object.freeze({__proto__:null,getFilteredPath:getFilteredPath,actionBuilder:actionBuilder,calculatePropsFromModifier:calculatePropsFromModifier,getCurrentPaths:getCurrentPaths,normalisePrimitives:normalisePrimitives,getRootWrapperProps:getRootWrapperProps,isChildrenProp:isChildrenProp,getParentProps:getParentProps,getPropsChildrenFilter:getPropsChildrenFilter,getChildrensForRoot:getChildrensForRoot,generateChildren:generateChildren,generateNewChildren:generateNewChildren,isTechnicalProp:isTechnicalProp,removeTechnicalProps:removeTechnicalProps});var ajv = {exports: {}};var core$2 = {};var validate = {};var boolSchema = {};var errors = {};var codegen = {};var code$1 = {};(function (exports) {
6914
6938
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -13902,48 +13926,88 @@ class I18n {
13902
13926
  }
13903
13927
  }
13904
13928
  }const StockContext = createContext(null);
13905
- const PathModifierContext = createContext({});const getState = (state) => state === null || state === void 0 ? void 0 : state.root;
13929
+ const PathModifierContext = createContext({});// eslint-disable-next-line no-shadow
13930
+ var ReduxPathTypeEnum;
13931
+ (function (ReduxPathTypeEnum) {
13932
+ ReduxPathTypeEnum["ERROR"] = "ERROR";
13933
+ ReduxPathTypeEnum["TOUCH"] = "TOUCH";
13934
+ ReduxPathTypeEnum["NORMAL"] = "NORMAL";
13935
+ })(ReduxPathTypeEnum || (ReduxPathTypeEnum = {}));const getState = (state) => state === null || state === void 0 ? void 0 : state.root;
13906
13936
  const getValue = (state, store, path) => jsonPointerGet(state[store], path) || null;
13907
- const getStateValue$1 = (globalState, { store, path, isError = false }, currentPaths) => {
13937
+ const getStoreNameFromType = (store, type) =>
13938
+ // eslint-disable-next-line no-nested-ternary
13939
+ type === ReduxPathTypeEnum.ERROR ? `${store}${STORE_ERROR_POSTFIX}` : type === ReduxPathTypeEnum.TOUCH ? `${store}${STORE_TOUCH_POSTFIX}` : `${store}`;
13940
+ const getStateValue = (globalState, { store, path, type, jsonataDef }, currentPaths) => {
13908
13941
  const state = getState(globalState);
13909
13942
  if (state && store && path) {
13910
13943
  const convertedPath = currentPaths && currentPaths[store] && currentPaths[store].path ? changeRelativePath(`${currentPaths[store].path}${SEPARATOR}${path}`) : path;
13911
- return getValue(state, `${store}${isError ? STORE_ERROR_POSTFIX : ''}`, convertedPath);
13944
+ const storeName = getStoreNameFromType(store, type);
13945
+ let value = getValue(state, storeName, convertedPath);
13946
+ if (jsonataDef) {
13947
+ try {
13948
+ // eslint-disable-next-line global-require, @typescript-eslint/no-var-requires
13949
+ const jsonata = require('jsonata');
13950
+ const expression = jsonata(jsonataDef);
13951
+ value = expression.evaluate(value);
13952
+ }
13953
+ catch (error) {
13954
+ // eslint-disable-next-line no-console
13955
+ console.error('jsonata error', error, jsonataDef);
13956
+ }
13957
+ }
13958
+ if (type === ReduxPathTypeEnum.ERROR) {
13959
+ // if we have error, need to show, the empty structure is not error, doesn't matter how deep is it
13960
+ return hasLeaf(value) ? value : null;
13961
+ }
13962
+ if (type === ReduxPathTypeEnum.TOUCH) {
13963
+ return hasLeaf(value); // return true if is touched.
13964
+ }
13965
+ return value;
13912
13966
  }
13913
13967
  return null;
13914
13968
  };
13915
13969
  const compSelectorHook = (currentPaths, subscriberPaths) => (state) => {
13916
13970
  if (typeof subscriberPaths === 'object' && Array.isArray(subscriberPaths) && (subscriberPaths === null || subscriberPaths === void 0 ? void 0 : subscriberPaths.length) > 0) {
13917
- return subscriberPaths.map((subscriberPath) => getStateValue$1(state, subscriberPath, currentPaths));
13971
+ return subscriberPaths.map((subscriberPath) => getStateValue(state, subscriberPath, currentPaths));
13918
13972
  }
13919
- // TODO isError, currentPaths, root need to solve propperly
13920
13973
  return undefined;
13921
13974
  };const DATA_UPDATE = 'DATA_UPDATE';
13922
- const PURGE = 'PURGE';
13923
13975
  const set$1 = (payload) => ({
13924
13976
  type: DATA_UPDATE,
13925
13977
  payload,
13926
- });
13927
- const purge = (payload) => ({
13928
- type: PURGE,
13929
- payload,
13930
- });const getStateValue = (attr, { [CURRENT_PATH_NAME]: currentPaths } = {}, callerArgs, stock) => {
13931
- const { store, path } = attr;
13978
+ });const get = (attr, { [CURRENT_PATH_NAME]: currentPaths } = {}, callerArgs, stock) => {
13979
+ const { store, path, type, jsonataDef } = attr;
13932
13980
  const state = stock.reduxStore.getState();
13933
- return getStateValue$1(state, { store, path }, currentPaths);
13934
- };
13935
- const get = (attr, { [CURRENT_PATH_NAME]: currentPaths } = {}, callerArgs, stock) => {
13936
- const { store, path } = attr;
13937
- const state = stock.reduxStore.getState();
13938
- return getStateValue$1(state, { store, path }, currentPaths);
13981
+ return getStateValue(state, { store, path, type, jsonataDef }, currentPaths);
13939
13982
  };
13940
13983
  const set = (attr, props, callerArgs, stock) => {
13941
13984
  stock.reduxStore.dispatch(set$1(Object.assign(Object.assign({}, attr), { value: attr && attr.value !== undefined ? attr.value : callerArgs[0], [CURRENT_PATH_NAME]: props[CURRENT_PATH_NAME], stock })));
13942
13985
  };
13986
+ const jsonata = (_a) => {
13987
+ var { jsonataDef } = _a, attr = __rest(_a, ["jsonataDef"]);
13988
+ if (jsonataDef) {
13989
+ // console.log(' ---- jsonata ---- ')
13990
+ // console.log('jsonataDef: ', jsonataDef)
13991
+ // console.log('attr: ', attr)
13992
+ try {
13993
+ // eslint-disable-next-line global-require, @typescript-eslint/no-var-requires
13994
+ const jsonataObj = require('jsonata');
13995
+ const expression = jsonataObj(jsonataDef);
13996
+ const evaluate = expression.evaluate(attr);
13997
+ // console.log('evaluate: ', evaluate)
13998
+ return evaluate;
13999
+ }
14000
+ catch (error) {
14001
+ // eslint-disable-next-line no-console
14002
+ console.error('jsonata error', error, jsonataDef);
14003
+ }
14004
+ }
14005
+ return null;
14006
+ };
13943
14007
  var functions = {
13944
- getStateValue,
13945
14008
  get,
13946
14009
  set,
14010
+ jsonata,
13947
14011
  };/**
13948
14012
  * Adapted from React: https://github.com/facebook/react/blob/master/packages/shared/formatProdErrorMessage.js
13949
14013
  *
@@ -14215,287 +14279,649 @@ function isCrushed() {}
14215
14279
 
14216
14280
  if (process.env.NODE_ENV !== 'production' && typeof isCrushed.name === 'string' && isCrushed.name !== 'isCrushed') {
14217
14281
  warning('You are currently using minified code outside of NODE_ENV === "production". ' + 'This means that you are running a slower development build of Redux. ' + 'You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify ' + 'or setting mode to production in webpack (https://webpack.js.org/concepts/mode/) ' + 'to ensure you have the correct code for your production build.');
14218
- }function createTransform( // @NOTE inbound: transform state coming from redux on its way to being serialized and stored
14219
- inbound, // @NOTE outbound: transform state coming from storage, on its way to be rehydrated into redux
14220
- outbound) {
14221
- var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
14222
- var whitelist = config.whitelist || null;
14223
- var blacklist = config.blacklist || null;
14224
-
14225
- function whitelistBlacklistCheck(key) {
14226
- if (whitelist && whitelist.indexOf(key) === -1) return true;
14227
- if (blacklist && blacklist.indexOf(key) !== -1) return true;
14228
- return false;
14229
- }
14230
-
14231
- return {
14232
- in: function _in(state, key, fullState) {
14233
- return !whitelistBlacklistCheck(key) && inbound ? inbound(state, key, fullState) : state;
14234
- },
14235
- out: function out(state, key, fullState) {
14236
- return !whitelistBlacklistCheck(key) && outbound ? outbound(state, key, fullState) : state;
14282
+ }function n(n){for(var r=arguments.length,t=Array(r>1?r-1:0),e=1;e<r;e++)t[e-1]=arguments[e];if("production"!==process.env.NODE_ENV){var i=Y[n],o=i?"function"==typeof i?i.apply(null,t):i:"unknown error nr: "+n;throw Error("[Immer] "+o)}throw Error("[Immer] minified error nr: "+n+(t.length?" "+t.map((function(n){return "'"+n+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function r(n){return !!n&&!!n[Q]}function t(n){return !!n&&(function(n){if(!n||"object"!=typeof n)return !1;var r=Object.getPrototypeOf(n);if(null===r)return !0;var t=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return t===Object||"function"==typeof t&&Function.toString.call(t)===Z}(n)||Array.isArray(n)||!!n[L]||!!n.constructor[L]||s(n)||v(n))}function i(n,r,t){void 0===t&&(t=!1),0===o(n)?(t?Object.keys:nn)(n).forEach((function(e){t&&"symbol"==typeof e||r(e,n[e],n);})):n.forEach((function(t,e){return r(e,t,n)}));}function o(n){var r=n[Q];return r?r.i>3?r.i-4:r.i:Array.isArray(n)?1:s(n)?2:v(n)?3:0}function u(n,r){return 2===o(n)?n.has(r):Object.prototype.hasOwnProperty.call(n,r)}function a(n,r){return 2===o(n)?n.get(r):n[r]}function f(n,r,t){var e=o(n);2===e?n.set(r,t):3===e?(n.delete(r),n.add(t)):n[r]=t;}function c(n,r){return n===r?0!==n||1/n==1/r:n!=n&&r!=r}function s(n){return X&&n instanceof Map}function v(n){return q&&n instanceof Set}function p(n){return n.o||n.t}function l(n){if(Array.isArray(n))return Array.prototype.slice.call(n);var r=rn(n);delete r[Q];for(var t=nn(r),e=0;e<t.length;e++){var i=t[e],o=r[i];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(r[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:n[i]});}return Object.create(Object.getPrototypeOf(n),r)}function d(n,e){return void 0===e&&(e=!1),y(n)||r(n)||!t(n)?n:(o(n)>1&&(n.set=n.add=n.clear=n.delete=h),Object.freeze(n),e&&i(n,(function(n,r){return d(r,!0)}),!0),n)}function h(){n(2);}function y(n){return null==n||"object"!=typeof n||Object.isFrozen(n)}function b(r){var t=tn[r];return t||n(18,r),t}function _(){return "production"===process.env.NODE_ENV||U||n(0),U}function j(n,r){r&&(b("Patches"),n.u=[],n.s=[],n.v=r);}function O(n){g(n),n.p.forEach(S),n.p=null;}function g(n){n===U&&(U=n.l);}function w(n){return U={p:[],l:U,h:n,m:!0,_:0}}function S(n){var r=n[Q];0===r.i||1===r.i?r.j():r.O=!0;}function P(r,e){e._=e.p.length;var i=e.p[0],o=void 0!==r&&r!==i;return e.h.g||b("ES5").S(e,r,o),o?(i[Q].P&&(O(e),n(4)),t(r)&&(r=M(e,r),e.l||x(e,r)),e.u&&b("Patches").M(i[Q].t,r,e.u,e.s)):r=M(e,i,[]),O(e),e.u&&e.v(e.u,e.s),r!==H?r:void 0}function M(n,r,t){if(y(r))return r;var e=r[Q];if(!e)return i(r,(function(i,o){return A(n,e,r,i,o,t)}),!0),r;if(e.A!==n)return r;if(!e.P)return x(n,e.t,!0),e.t;if(!e.I){e.I=!0,e.A._--;var o=4===e.i||5===e.i?e.o=l(e.k):e.o;i(3===e.i?new Set(o):o,(function(r,i){return A(n,e,o,r,i,t)})),x(n,o,!1),t&&n.u&&b("Patches").R(e,t,n.u,n.s);}return e.o}function A(e,i,o,a,c,s){if("production"!==process.env.NODE_ENV&&c===o&&n(5),r(c)){var v=M(e,c,s&&i&&3!==i.i&&!u(i.D,a)?s.concat(a):void 0);if(f(o,a,v),!r(v))return;e.m=!1;}if(t(c)&&!y(c)){if(!e.h.F&&e._<1)return;M(e,c),i&&i.A.l||x(e,c);}}function x(n,r,t){void 0===t&&(t=!1),n.h.F&&n.m&&d(r,t);}function z(n,r){var t=n[Q];return (t?p(t):n)[r]}function I(n,r){if(r in n)for(var t=Object.getPrototypeOf(n);t;){var e=Object.getOwnPropertyDescriptor(t,r);if(e)return e;t=Object.getPrototypeOf(t);}}function k(n){n.P||(n.P=!0,n.l&&k(n.l));}function E(n){n.o||(n.o=l(n.t));}function R(n,r,t){var e=s(r)?b("MapSet").N(r,t):v(r)?b("MapSet").T(r,t):n.g?function(n,r){var t=Array.isArray(n),e={i:t?1:0,A:r?r.A:_(),P:!1,I:!1,D:{},l:r,t:n,k:null,o:null,j:null,C:!1},i=e,o=en;t&&(i=[e],o=on);var u=Proxy.revocable(i,o),a=u.revoke,f=u.proxy;return e.k=f,e.j=a,f}(r,t):b("ES5").J(r,t);return (t?t.A:_()).p.push(e),e}function D(e){return r(e)||n(22,e),function n(r){if(!t(r))return r;var e,u=r[Q],c=o(r);if(u){if(!u.P&&(u.i<4||!b("ES5").K(u)))return u.t;u.I=!0,e=F(r,c),u.I=!1;}else e=F(r,c);return i(e,(function(r,t){u&&a(u.t,r)===t||f(e,r,n(t));})),3===c?new Set(e):e}(e)}function F(n,r){switch(r){case 2:return new Map(n);case 3:return Array.from(n)}return l(n)}var G,U,W="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),X="undefined"!=typeof Map,q="undefined"!=typeof Set,B="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,H=W?Symbol.for("immer-nothing"):((G={})["immer-nothing"]=!0,G),L=W?Symbol.for("immer-draftable"):"__$immer_draftable",Q=W?Symbol.for("immer-state"):"__$immer_state",Y={0:"Illegal state",1:"Immer drafts cannot have computed properties",2:"This object has been frozen and should not be mutated",3:function(n){return "Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+n},4:"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",5:"Immer forbids circular references",6:"The first or second argument to `produce` must be a function",7:"The third argument to `produce` must be a function or undefined",8:"First argument to `createDraft` must be a plain object, an array, or an immerable object",9:"First argument to `finishDraft` must be a draft returned by `createDraft`",10:"The given draft is already finalized",11:"Object.defineProperty() cannot be used on an Immer draft",12:"Object.setPrototypeOf() cannot be used on an Immer draft",13:"Immer only supports deleting array indices",14:"Immer only supports setting array indices and the 'length' property",15:function(n){return "Cannot apply patch, path doesn't resolve: "+n},16:'Sets cannot have "replace" patches.',17:function(n){return "Unsupported patch operation: "+n},18:function(n){return "The plugin for '"+n+"' has not been loaded into Immer. To enable the plugin, import and call `enable"+n+"()` when initializing your application."},20:"Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available",21:function(n){return "produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '"+n+"'"},22:function(n){return "'current' expects a draft, got: "+n},23:function(n){return "'original' expects a draft, got: "+n},24:"Patching reserved attributes like __proto__, prototype and constructor is not allowed"},Z=""+Object.prototype.constructor,nn="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:Object.getOwnPropertyNames,rn=Object.getOwnPropertyDescriptors||function(n){var r={};return nn(n).forEach((function(t){r[t]=Object.getOwnPropertyDescriptor(n,t);})),r},tn={},en={get:function(n,r){if(r===Q)return n;var e=p(n);if(!u(e,r))return function(n,r,t){var e,i=I(r,t);return i?"value"in i?i.value:null===(e=i.get)||void 0===e?void 0:e.call(n.k):void 0}(n,e,r);var i=e[r];return n.I||!t(i)?i:i===z(n.t,r)?(E(n),n.o[r]=R(n.A.h,i,n)):i},has:function(n,r){return r in p(n)},ownKeys:function(n){return Reflect.ownKeys(p(n))},set:function(n,r,t){var e=I(p(n),r);if(null==e?void 0:e.set)return e.set.call(n.k,t),!0;if(!n.P){var i=z(p(n),r),o=null==i?void 0:i[Q];if(o&&o.t===t)return n.o[r]=t,n.D[r]=!1,!0;if(c(t,i)&&(void 0!==t||u(n.t,r)))return !0;E(n),k(n);}return n.o[r]===t&&"number"!=typeof t&&(void 0!==t||r in n.o)||(n.o[r]=t,n.D[r]=!0,!0)},deleteProperty:function(n,r){return void 0!==z(n.t,r)||r in n.t?(n.D[r]=!1,E(n),k(n)):delete n.D[r],n.o&&delete n.o[r],!0},getOwnPropertyDescriptor:function(n,r){var t=p(n),e=Reflect.getOwnPropertyDescriptor(t,r);return e?{writable:!0,configurable:1!==n.i||"length"!==r,enumerable:e.enumerable,value:t[r]}:e},defineProperty:function(){n(11);},getPrototypeOf:function(n){return Object.getPrototypeOf(n.t)},setPrototypeOf:function(){n(12);}},on={};i(en,(function(n,r){on[n]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)};})),on.deleteProperty=function(r,t){return "production"!==process.env.NODE_ENV&&isNaN(parseInt(t))&&n(13),on.set.call(this,r,t,void 0)},on.set=function(r,t,e){return "production"!==process.env.NODE_ENV&&"length"!==t&&isNaN(parseInt(t))&&n(14),en.set.call(this,r[0],t,e,r[0])};var un=function(){function e(r){var e=this;this.g=B,this.F=!0,this.produce=function(r,i,o){if("function"==typeof r&&"function"!=typeof i){var u=i;i=r;var a=e;return function(n){var r=this;void 0===n&&(n=u);for(var t=arguments.length,e=Array(t>1?t-1:0),o=1;o<t;o++)e[o-1]=arguments[o];return a.produce(n,(function(n){var t;return (t=i).call.apply(t,[r,n].concat(e))}))}}var f;if("function"!=typeof i&&n(6),void 0!==o&&"function"!=typeof o&&n(7),t(r)){var c=w(e),s=R(e,r,void 0),v=!0;try{f=i(s),v=!1;}finally{v?O(c):g(c);}return "undefined"!=typeof Promise&&f instanceof Promise?f.then((function(n){return j(c,o),P(n,c)}),(function(n){throw O(c),n})):(j(c,o),P(f,c))}if(!r||"object"!=typeof r){if(void 0===(f=i(r))&&(f=r),f===H&&(f=void 0),e.F&&d(f,!0),o){var p=[],l=[];b("Patches").M(r,f,p,l),o(p,l);}return f}n(21,r);},this.produceWithPatches=function(n,r){if("function"==typeof n)return function(r){for(var t=arguments.length,i=Array(t>1?t-1:0),o=1;o<t;o++)i[o-1]=arguments[o];return e.produceWithPatches(r,(function(r){return n.apply(void 0,[r].concat(i))}))};var t,i,o=e.produce(n,r,(function(n,r){t=n,i=r;}));return "undefined"!=typeof Promise&&o instanceof Promise?o.then((function(n){return [n,t,i]})):[o,t,i]},"boolean"==typeof(null==r?void 0:r.useProxies)&&this.setUseProxies(r.useProxies),"boolean"==typeof(null==r?void 0:r.autoFreeze)&&this.setAutoFreeze(r.autoFreeze);}var i=e.prototype;return i.createDraft=function(e){t(e)||n(8),r(e)&&(e=D(e));var i=w(this),o=R(this,e,void 0);return o[Q].C=!0,g(i),o},i.finishDraft=function(r,t){var e=r&&r[Q];"production"!==process.env.NODE_ENV&&(e&&e.C||n(9),e.I&&n(10));var i=e.A;return j(i,t),P(void 0,i)},i.setAutoFreeze=function(n){this.F=n;},i.setUseProxies=function(r){r&&!B&&n(20),this.g=r;},i.applyPatches=function(n,t){var e;for(e=t.length-1;e>=0;e--){var i=t[e];if(0===i.path.length&&"replace"===i.op){n=i.value;break}}e>-1&&(t=t.slice(e+1));var o=b("Patches").$;return r(n)?o(n,t):this.produce(n,(function(n){return o(n,t)}))},e}(),an=new un,fn=an.produce;an.produceWithPatches.bind(an);an.setAutoFreeze.bind(an);an.setUseProxies.bind(an);an.applyPatches.bind(an);an.createDraft.bind(an);an.finishDraft.bind(an);var produce = fn;
14283
+ var dist$1 = {exports: {}};(function (module, exports) {
14284
+ Object.defineProperty(exports, "__esModule", { value: true });
14285
+ const ajv_1 = ajv.exports;
14286
+ const codegen_1 = codegen;
14287
+ const code_1 = code$1;
14288
+ const validate_1 = validate;
14289
+ const errors_1 = errors;
14290
+ const names_1 = names$1;
14291
+ const keyword = "errorMessage";
14292
+ const used = new ajv_1.Name("emUsed");
14293
+ const KEYWORD_PROPERTY_PARAMS = {
14294
+ required: "missingProperty",
14295
+ dependencies: "property",
14296
+ dependentRequired: "property",
14297
+ };
14298
+ const INTERPOLATION = /\$\{[^}]+\}/;
14299
+ const INTERPOLATION_REPLACE = /\$\{([^}]+)\}/g;
14300
+ const EMPTY_STR = /^""\s*\+\s*|\s*\+\s*""$/g;
14301
+ function errorMessage(options) {
14302
+ return {
14303
+ keyword,
14304
+ schemaType: ["string", "object"],
14305
+ post: true,
14306
+ code(cxt) {
14307
+ const { gen, data, schema, schemaValue, it } = cxt;
14308
+ if (it.createErrors === false)
14309
+ return;
14310
+ const sch = schema;
14311
+ const instancePath = codegen_1.strConcat(names_1.default.instancePath, it.errorPath);
14312
+ gen.if(ajv_1._ `${names_1.default.errors} > 0`, () => {
14313
+ if (typeof sch == "object") {
14314
+ const [kwdPropErrors, kwdErrors] = keywordErrorsConfig(sch);
14315
+ if (kwdErrors)
14316
+ processKeywordErrors(kwdErrors);
14317
+ if (kwdPropErrors)
14318
+ processKeywordPropErrors(kwdPropErrors);
14319
+ processChildErrors(childErrorsConfig(sch));
14320
+ }
14321
+ const schMessage = typeof sch == "string" ? sch : sch._;
14322
+ if (schMessage)
14323
+ processAllErrors(schMessage);
14324
+ if (!options.keepErrors)
14325
+ removeUsedErrors();
14326
+ });
14327
+ function childErrorsConfig({ properties, items }) {
14328
+ const errors = {};
14329
+ if (properties) {
14330
+ errors.props = {};
14331
+ for (const p in properties)
14332
+ errors.props[p] = [];
14333
+ }
14334
+ if (items) {
14335
+ errors.items = {};
14336
+ for (let i = 0; i < items.length; i++)
14337
+ errors.items[i] = [];
14338
+ }
14339
+ return errors;
14340
+ }
14341
+ function keywordErrorsConfig(emSchema) {
14342
+ let propErrors;
14343
+ let errors;
14344
+ for (const k in emSchema) {
14345
+ if (k === "properties" || k === "items")
14346
+ continue;
14347
+ const kwdSch = emSchema[k];
14348
+ if (typeof kwdSch == "object") {
14349
+ propErrors || (propErrors = {});
14350
+ const errMap = (propErrors[k] = {});
14351
+ for (const p in kwdSch)
14352
+ errMap[p] = [];
14353
+ }
14354
+ else {
14355
+ errors || (errors = {});
14356
+ errors[k] = [];
14357
+ }
14358
+ }
14359
+ return [propErrors, errors];
14360
+ }
14361
+ function processKeywordErrors(kwdErrors) {
14362
+ const kwdErrs = gen.const("emErrors", ajv_1.stringify(kwdErrors));
14363
+ const templates = gen.const("templates", getTemplatesCode(kwdErrors, schema));
14364
+ gen.forOf("err", names_1.default.vErrors, (err) => gen.if(matchKeywordError(err, kwdErrs), () => gen.code(ajv_1._ `${kwdErrs}[${err}.keyword].push(${err})`).assign(ajv_1._ `${err}.${used}`, true)));
14365
+ const { singleError } = options;
14366
+ if (singleError) {
14367
+ const message = gen.let("message", ajv_1._ `""`);
14368
+ const paramsErrors = gen.let("paramsErrors", ajv_1._ `[]`);
14369
+ loopErrors((key) => {
14370
+ gen.if(message, () => gen.code(ajv_1._ `${message} += ${typeof singleError == "string" ? singleError : ";"}`));
14371
+ gen.code(ajv_1._ `${message} += ${errMessage(key)}`);
14372
+ gen.assign(paramsErrors, ajv_1._ `${paramsErrors}.concat(${kwdErrs}[${key}])`);
14373
+ });
14374
+ errors_1.reportError(cxt, { message, params: ajv_1._ `{errors: ${paramsErrors}}` });
14375
+ }
14376
+ else {
14377
+ loopErrors((key) => errors_1.reportError(cxt, {
14378
+ message: errMessage(key),
14379
+ params: ajv_1._ `{errors: ${kwdErrs}[${key}]}`,
14380
+ }));
14381
+ }
14382
+ function loopErrors(body) {
14383
+ gen.forIn("key", kwdErrs, (key) => gen.if(ajv_1._ `${kwdErrs}[${key}].length`, () => body(key)));
14384
+ }
14385
+ function errMessage(key) {
14386
+ return ajv_1._ `${key} in ${templates} ? ${templates}[${key}]() : ${schemaValue}[${key}]`;
14387
+ }
14388
+ }
14389
+ function processKeywordPropErrors(kwdPropErrors) {
14390
+ const kwdErrs = gen.const("emErrors", ajv_1.stringify(kwdPropErrors));
14391
+ const templatesCode = [];
14392
+ for (const k in kwdPropErrors) {
14393
+ templatesCode.push([
14394
+ k,
14395
+ getTemplatesCode(kwdPropErrors[k], schema[k]),
14396
+ ]);
14397
+ }
14398
+ const templates = gen.const("templates", gen.object(...templatesCode));
14399
+ const kwdPropParams = gen.scopeValue("obj", {
14400
+ ref: KEYWORD_PROPERTY_PARAMS,
14401
+ code: ajv_1.stringify(KEYWORD_PROPERTY_PARAMS),
14402
+ });
14403
+ const propParam = gen.let("emPropParams");
14404
+ const paramsErrors = gen.let("emParamsErrors");
14405
+ gen.forOf("err", names_1.default.vErrors, (err) => gen.if(matchKeywordError(err, kwdErrs), () => {
14406
+ gen.assign(propParam, ajv_1._ `${kwdPropParams}[${err}.keyword]`);
14407
+ gen.assign(paramsErrors, ajv_1._ `${kwdErrs}[${err}.keyword][${err}.params[${propParam}]]`);
14408
+ gen.if(paramsErrors, () => gen.code(ajv_1._ `${paramsErrors}.push(${err})`).assign(ajv_1._ `${err}.${used}`, true));
14409
+ }));
14410
+ gen.forIn("key", kwdErrs, (key) => gen.forIn("keyProp", ajv_1._ `${kwdErrs}[${key}]`, (keyProp) => {
14411
+ gen.assign(paramsErrors, ajv_1._ `${kwdErrs}[${key}][${keyProp}]`);
14412
+ gen.if(ajv_1._ `${paramsErrors}.length`, () => {
14413
+ const tmpl = gen.const("tmpl", ajv_1._ `${templates}[${key}] && ${templates}[${key}][${keyProp}]`);
14414
+ errors_1.reportError(cxt, {
14415
+ message: ajv_1._ `${tmpl} ? ${tmpl}() : ${schemaValue}[${key}][${keyProp}]`,
14416
+ params: ajv_1._ `{errors: ${paramsErrors}}`,
14417
+ });
14418
+ });
14419
+ }));
14420
+ }
14421
+ function processChildErrors(childErrors) {
14422
+ const { props, items } = childErrors;
14423
+ if (!props && !items)
14424
+ return;
14425
+ const isObj = ajv_1._ `typeof ${data} == "object"`;
14426
+ const isArr = ajv_1._ `Array.isArray(${data})`;
14427
+ const childErrs = gen.let("emErrors");
14428
+ let childKwd;
14429
+ let childProp;
14430
+ const templates = gen.let("templates");
14431
+ if (props && items) {
14432
+ childKwd = gen.let("emChildKwd");
14433
+ gen.if(isObj);
14434
+ gen.if(isArr, () => {
14435
+ init(items, schema.items);
14436
+ gen.assign(childKwd, ajv_1.str `items`);
14437
+ }, () => {
14438
+ init(props, schema.properties);
14439
+ gen.assign(childKwd, ajv_1.str `properties`);
14440
+ });
14441
+ childProp = ajv_1._ `[${childKwd}]`;
14442
+ }
14443
+ else if (items) {
14444
+ gen.if(isArr);
14445
+ init(items, schema.items);
14446
+ childProp = ajv_1._ `.items`;
14447
+ }
14448
+ else if (props) {
14449
+ gen.if(codegen_1.and(isObj, codegen_1.not(isArr)));
14450
+ init(props, schema.properties);
14451
+ childProp = ajv_1._ `.properties`;
14452
+ }
14453
+ gen.forOf("err", names_1.default.vErrors, (err) => ifMatchesChildError(err, childErrs, (child) => gen.code(ajv_1._ `${childErrs}[${child}].push(${err})`).assign(ajv_1._ `${err}.${used}`, true)));
14454
+ gen.forIn("key", childErrs, (key) => gen.if(ajv_1._ `${childErrs}[${key}].length`, () => {
14455
+ errors_1.reportError(cxt, {
14456
+ message: ajv_1._ `${key} in ${templates} ? ${templates}[${key}]() : ${schemaValue}${childProp}[${key}]`,
14457
+ params: ajv_1._ `{errors: ${childErrs}[${key}]}`,
14458
+ });
14459
+ gen.assign(ajv_1._ `${names_1.default.vErrors}[${names_1.default.errors}-1].instancePath`, ajv_1._ `${instancePath} + "/" + ${key}.replace(/~/g, "~0").replace(/\\//g, "~1")`);
14460
+ }));
14461
+ gen.endIf();
14462
+ function init(children, msgs) {
14463
+ gen.assign(childErrs, ajv_1.stringify(children));
14464
+ gen.assign(templates, getTemplatesCode(children, msgs));
14465
+ }
14466
+ }
14467
+ function processAllErrors(schMessage) {
14468
+ const errs = gen.const("emErrs", ajv_1._ `[]`);
14469
+ gen.forOf("err", names_1.default.vErrors, (err) => gen.if(matchAnyError(err), () => gen.code(ajv_1._ `${errs}.push(${err})`).assign(ajv_1._ `${err}.${used}`, true)));
14470
+ gen.if(ajv_1._ `${errs}.length`, () => errors_1.reportError(cxt, {
14471
+ message: templateExpr(schMessage),
14472
+ params: ajv_1._ `{errors: ${errs}}`,
14473
+ }));
14474
+ }
14475
+ function removeUsedErrors() {
14476
+ const errs = gen.const("emErrs", ajv_1._ `[]`);
14477
+ gen.forOf("err", names_1.default.vErrors, (err) => gen.if(ajv_1._ `!${err}.${used}`, () => gen.code(ajv_1._ `${errs}.push(${err})`)));
14478
+ gen.assign(names_1.default.vErrors, errs).assign(names_1.default.errors, ajv_1._ `${errs}.length`);
14479
+ }
14480
+ function matchKeywordError(err, kwdErrs) {
14481
+ return codegen_1.and(ajv_1._ `${err}.keyword !== ${keyword}`, ajv_1._ `!${err}.${used}`, ajv_1._ `${err}.instancePath === ${instancePath}`, ajv_1._ `${err}.keyword in ${kwdErrs}`,
14482
+ // TODO match the end of the string?
14483
+ ajv_1._ `${err}.schemaPath.indexOf(${it.errSchemaPath}) === 0`, ajv_1._ `/^\\/[^\\/]*$/.test(${err}.schemaPath.slice(${it.errSchemaPath.length}))`);
14484
+ }
14485
+ function ifMatchesChildError(err, childErrs, thenBody) {
14486
+ gen.if(codegen_1.and(ajv_1._ `${err}.keyword !== ${keyword}`, ajv_1._ `!${err}.${used}`, ajv_1._ `${err}.instancePath.indexOf(${instancePath}) === 0`), () => {
14487
+ const childRegex = gen.scopeValue("pattern", {
14488
+ ref: /^\/([^/]*)(?:\/|$)/,
14489
+ code: ajv_1._ `new RegExp("^\\\/([^/]*)(?:\\\/|$)")`,
14490
+ });
14491
+ const matches = gen.const("emMatches", ajv_1._ `${childRegex}.exec(${err}.instancePath.slice(${instancePath}.length))`);
14492
+ const child = gen.const("emChild", ajv_1._ `${matches} && ${matches}[1].replace(/~1/g, "/").replace(/~0/g, "~")`);
14493
+ gen.if(ajv_1._ `${child} !== undefined && ${child} in ${childErrs}`, () => thenBody(child));
14494
+ });
14495
+ }
14496
+ function matchAnyError(err) {
14497
+ return codegen_1.and(ajv_1._ `${err}.keyword !== ${keyword}`, ajv_1._ `!${err}.${used}`, codegen_1.or(ajv_1._ `${err}.instancePath === ${instancePath}`, codegen_1.and(ajv_1._ `${err}.instancePath.indexOf(${instancePath}) === 0`, ajv_1._ `${err}.instancePath[${instancePath}.length] === "/"`)), ajv_1._ `${err}.schemaPath.indexOf(${it.errSchemaPath}) === 0`, ajv_1._ `${err}.schemaPath[${it.errSchemaPath}.length] === "/"`);
14498
+ }
14499
+ function getTemplatesCode(keys, msgs) {
14500
+ const templatesCode = [];
14501
+ for (const k in keys) {
14502
+ const msg = msgs[k];
14503
+ if (INTERPOLATION.test(msg))
14504
+ templatesCode.push([k, templateFunc(msg)]);
14505
+ }
14506
+ return gen.object(...templatesCode);
14507
+ }
14508
+ function templateExpr(msg) {
14509
+ if (!INTERPOLATION.test(msg))
14510
+ return ajv_1.stringify(msg);
14511
+ return new code_1._Code(code_1.safeStringify(msg)
14512
+ .replace(INTERPOLATION_REPLACE, (_s, ptr) => `" + JSON.stringify(${validate_1.getData(ptr, it)}) + "`)
14513
+ .replace(EMPTY_STR, ""));
14514
+ }
14515
+ function templateFunc(msg) {
14516
+ return ajv_1._ `function(){return ${templateExpr(msg)}}`;
14517
+ }
14518
+ },
14519
+ metaSchema: {
14520
+ anyOf: [
14521
+ { type: "string" },
14522
+ {
14523
+ type: "object",
14524
+ properties: {
14525
+ properties: { $ref: "#/$defs/stringMap" },
14526
+ items: { $ref: "#/$defs/stringList" },
14527
+ required: { $ref: "#/$defs/stringOrMap" },
14528
+ dependencies: { $ref: "#/$defs/stringOrMap" },
14529
+ },
14530
+ additionalProperties: { type: "string" },
14531
+ },
14532
+ ],
14533
+ $defs: {
14534
+ stringMap: {
14535
+ type: "object",
14536
+ additionalProperties: { type: "string" },
14537
+ },
14538
+ stringOrMap: {
14539
+ anyOf: [{ type: "string" }, { $ref: "#/$defs/stringMap" }],
14540
+ },
14541
+ stringList: { type: "array", items: { type: "string" } },
14542
+ },
14543
+ },
14544
+ };
14545
+ }
14546
+ const ajvErrors = (ajv, options = {}) => {
14547
+ if (!ajv.opts.allErrors)
14548
+ throw new Error("ajv-errors: Ajv option allErrors must be true");
14549
+ if (ajv.opts.jsPropertySyntax) {
14550
+ throw new Error("ajv-errors: ajv option jsPropertySyntax is not supported");
14237
14551
  }
14238
- };
14239
- }var assignValue = _assignValue,
14240
- castPath$1 = _castPath,
14241
- isIndex = _isIndex,
14242
- isObject = isObject_1,
14243
- toKey = _toKey;
14244
-
14245
- /**
14246
- * The base implementation of `_.set`.
14247
- *
14248
- * @private
14249
- * @param {Object} object The object to modify.
14250
- * @param {Array|string} path The path of the property to set.
14251
- * @param {*} value The value to set.
14252
- * @param {Function} [customizer] The function to customize path creation.
14253
- * @returns {Object} Returns `object`.
14254
- */
14255
- function baseSet$1(object, path, value, customizer) {
14256
- if (!isObject(object)) {
14257
- return object;
14258
- }
14259
- path = castPath$1(path, object);
14260
-
14261
- var index = -1,
14262
- length = path.length,
14263
- lastIndex = length - 1,
14264
- nested = object;
14265
-
14266
- while (nested != null && ++index < length) {
14267
- var key = toKey(path[index]),
14268
- newValue = value;
14552
+ return ajv.addKeyword(errorMessage(options));
14553
+ };
14554
+ exports.default = ajvErrors;
14555
+ module.exports = ajvErrors;
14556
+ module.exports.default = ajvErrors;
14269
14557
 
14270
- if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
14271
- return object;
14272
- }
14558
+ }(dist$1, dist$1.exports));
14273
14559
 
14274
- if (index != lastIndex) {
14275
- var objValue = nested[key];
14276
- newValue = customizer ? customizer(objValue, key, nested) : undefined;
14277
- if (newValue === undefined) {
14278
- newValue = isObject(objValue)
14279
- ? objValue
14280
- : (isIndex(path[index + 1]) ? [] : {});
14281
- }
14282
- }
14283
- assignValue(nested, key, newValue);
14284
- nested = nested[key];
14285
- }
14286
- return object;
14560
+ var ajvErrors = /*@__PURE__*/getDefaultExportFromCjs(dist$1.exports);var dist = {exports: {}};var formats = {};(function (exports) {
14561
+ Object.defineProperty(exports, "__esModule", { value: true });
14562
+ exports.formatNames = exports.fastFormats = exports.fullFormats = void 0;
14563
+ function fmtDef(validate, compare) {
14564
+ return { validate, compare };
14565
+ }
14566
+ exports.fullFormats = {
14567
+ // date: http://tools.ietf.org/html/rfc3339#section-5.6
14568
+ date: fmtDef(date, compareDate),
14569
+ // date-time: http://tools.ietf.org/html/rfc3339#section-5.6
14570
+ time: fmtDef(getTime(true), compareTime),
14571
+ "date-time": fmtDef(getDateTime(true), compareDateTime),
14572
+ "iso-time": fmtDef(getTime(), compareIsoTime),
14573
+ "iso-date-time": fmtDef(getDateTime(), compareIsoDateTime),
14574
+ // duration: https://tools.ietf.org/html/rfc3339#appendix-A
14575
+ duration: /^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,
14576
+ uri,
14577
+ "uri-reference": /^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,
14578
+ // uri-template: https://tools.ietf.org/html/rfc6570
14579
+ "uri-template": /^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,
14580
+ // For the source: https://gist.github.com/dperini/729294
14581
+ // For test cases: https://mathiasbynens.be/demo/url-regex
14582
+ url: /^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,
14583
+ email: /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,
14584
+ hostname: /^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,
14585
+ // optimized https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html
14586
+ ipv4: /^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,
14587
+ ipv6: /^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,
14588
+ regex,
14589
+ // uuid: http://tools.ietf.org/html/rfc4122
14590
+ uuid: /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,
14591
+ // JSON-pointer: https://tools.ietf.org/html/rfc6901
14592
+ // uri fragment: https://tools.ietf.org/html/rfc3986#appendix-A
14593
+ "json-pointer": /^(?:\/(?:[^~/]|~0|~1)*)*$/,
14594
+ "json-pointer-uri-fragment": /^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,
14595
+ // relative JSON-pointer: http://tools.ietf.org/html/draft-luff-relative-json-pointer-00
14596
+ "relative-json-pointer": /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,
14597
+ // the following formats are used by the openapi specification: https://spec.openapis.org/oas/v3.0.0#data-types
14598
+ // byte: https://github.com/miguelmota/is-base64
14599
+ byte,
14600
+ // signed 32 bit integer
14601
+ int32: { type: "number", validate: validateInt32 },
14602
+ // signed 64 bit integer
14603
+ int64: { type: "number", validate: validateInt64 },
14604
+ // C-type float
14605
+ float: { type: "number", validate: validateNumber },
14606
+ // C-type double
14607
+ double: { type: "number", validate: validateNumber },
14608
+ // hint to the UI to hide input strings
14609
+ password: true,
14610
+ // unchecked string payload
14611
+ binary: true,
14612
+ };
14613
+ exports.fastFormats = {
14614
+ ...exports.fullFormats,
14615
+ date: fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\d$/, compareDate),
14616
+ time: fmtDef(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i, compareTime),
14617
+ "date-time": fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i, compareDateTime),
14618
+ "iso-time": fmtDef(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i, compareIsoTime),
14619
+ "iso-date-time": fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i, compareIsoDateTime),
14620
+ // uri: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js
14621
+ uri: /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,
14622
+ "uri-reference": /^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,
14623
+ // email (sources from jsen validator):
14624
+ // http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363
14625
+ // http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'wilful violation')
14626
+ email: /^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,
14627
+ };
14628
+ exports.formatNames = Object.keys(exports.fullFormats);
14629
+ function isLeapYear(year) {
14630
+ // https://tools.ietf.org/html/rfc3339#appendix-C
14631
+ return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
14632
+ }
14633
+ const DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/;
14634
+ const DAYS = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
14635
+ function date(str) {
14636
+ // full-date from http://tools.ietf.org/html/rfc3339#section-5.6
14637
+ const matches = DATE.exec(str);
14638
+ if (!matches)
14639
+ return false;
14640
+ const year = +matches[1];
14641
+ const month = +matches[2];
14642
+ const day = +matches[3];
14643
+ return (month >= 1 &&
14644
+ month <= 12 &&
14645
+ day >= 1 &&
14646
+ day <= (month === 2 && isLeapYear(year) ? 29 : DAYS[month]));
14647
+ }
14648
+ function compareDate(d1, d2) {
14649
+ if (!(d1 && d2))
14650
+ return undefined;
14651
+ if (d1 > d2)
14652
+ return 1;
14653
+ if (d1 < d2)
14654
+ return -1;
14655
+ return 0;
14656
+ }
14657
+ const TIME = /^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;
14658
+ function getTime(strictTimeZone) {
14659
+ return function time(str) {
14660
+ const matches = TIME.exec(str);
14661
+ if (!matches)
14662
+ return false;
14663
+ const hr = +matches[1];
14664
+ const min = +matches[2];
14665
+ const sec = +matches[3];
14666
+ const tz = matches[4];
14667
+ const tzSign = matches[5] === "-" ? -1 : 1;
14668
+ const tzH = +(matches[6] || 0);
14669
+ const tzM = +(matches[7] || 0);
14670
+ if (tzH > 23 || tzM > 59 || (strictTimeZone && !tz))
14671
+ return false;
14672
+ if (hr <= 23 && min <= 59 && sec < 60)
14673
+ return true;
14674
+ // leap second
14675
+ const utcMin = min - tzM * tzSign;
14676
+ const utcHr = hr - tzH * tzSign - (utcMin < 0 ? 1 : 0);
14677
+ return (utcHr === 23 || utcHr === -1) && (utcMin === 59 || utcMin === -1) && sec < 61;
14678
+ };
14287
14679
  }
14288
-
14289
- var _baseSet = baseSet$1;var baseGet = _baseGet,
14290
- baseSet = _baseSet,
14291
- castPath = _castPath;
14292
-
14293
- /**
14294
- * The base implementation of `_.pickBy` without support for iteratee shorthands.
14295
- *
14296
- * @private
14297
- * @param {Object} object The source object.
14298
- * @param {string[]} paths The property paths to pick.
14299
- * @param {Function} predicate The function invoked per property.
14300
- * @returns {Object} Returns the new object.
14301
- */
14302
- function basePickBy$1(object, paths, predicate) {
14303
- var index = -1,
14304
- length = paths.length,
14305
- result = {};
14306
-
14307
- while (++index < length) {
14308
- var path = paths[index],
14309
- value = baseGet(object, path);
14310
-
14311
- if (predicate(value, path)) {
14312
- baseSet(result, castPath(path, object), value);
14313
- }
14314
- }
14315
- return result;
14680
+ function compareTime(s1, s2) {
14681
+ if (!(s1 && s2))
14682
+ return undefined;
14683
+ const t1 = new Date("2020-01-01T" + s1).valueOf();
14684
+ const t2 = new Date("2020-01-01T" + s2).valueOf();
14685
+ if (!(t1 && t2))
14686
+ return undefined;
14687
+ return t1 - t2;
14316
14688
  }
14317
-
14318
- var _basePickBy = basePickBy$1;var basePickBy = _basePickBy,
14319
- hasIn = hasIn_1;
14320
-
14321
- /**
14322
- * The base implementation of `_.pick` without support for individual
14323
- * property identifiers.
14324
- *
14325
- * @private
14326
- * @param {Object} object The source object.
14327
- * @param {string[]} paths The property paths to pick.
14328
- * @returns {Object} Returns the new object.
14329
- */
14330
- function basePick$1(object, paths) {
14331
- return basePickBy(object, paths, function(value, path) {
14332
- return hasIn(object, path);
14333
- });
14689
+ function compareIsoTime(t1, t2) {
14690
+ if (!(t1 && t2))
14691
+ return undefined;
14692
+ const a1 = TIME.exec(t1);
14693
+ const a2 = TIME.exec(t2);
14694
+ if (!(a1 && a2))
14695
+ return undefined;
14696
+ t1 = a1[1] + a1[2] + a1[3];
14697
+ t2 = a2[1] + a2[2] + a2[3];
14698
+ if (t1 > t2)
14699
+ return 1;
14700
+ if (t1 < t2)
14701
+ return -1;
14702
+ return 0;
14703
+ }
14704
+ const DATE_TIME_SEPARATOR = /t|\s/i;
14705
+ function getDateTime(strictTimeZone) {
14706
+ const time = getTime(strictTimeZone);
14707
+ return function date_time(str) {
14708
+ // http://tools.ietf.org/html/rfc3339#section-5.6
14709
+ const dateTime = str.split(DATE_TIME_SEPARATOR);
14710
+ return dateTime.length === 2 && date(dateTime[0]) && time(dateTime[1]);
14711
+ };
14334
14712
  }
14335
-
14336
- var _basePick = basePick$1;var Symbol$1 = _Symbol,
14337
- isArguments = isArguments_1,
14338
- isArray = isArray_1;
14339
-
14340
- /** Built-in value references. */
14341
- var spreadableSymbol = Symbol$1 ? Symbol$1.isConcatSpreadable : undefined;
14342
-
14343
- /**
14344
- * Checks if `value` is a flattenable `arguments` object or array.
14345
- *
14346
- * @private
14347
- * @param {*} value The value to check.
14348
- * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
14349
- */
14350
- function isFlattenable$1(value) {
14351
- return isArray(value) || isArguments(value) ||
14352
- !!(spreadableSymbol && value && value[spreadableSymbol]);
14713
+ function compareDateTime(dt1, dt2) {
14714
+ if (!(dt1 && dt2))
14715
+ return undefined;
14716
+ const d1 = new Date(dt1).valueOf();
14717
+ const d2 = new Date(dt2).valueOf();
14718
+ if (!(d1 && d2))
14719
+ return undefined;
14720
+ return d1 - d2;
14353
14721
  }
14354
-
14355
- var _isFlattenable = isFlattenable$1;var arrayPush = _arrayPush,
14356
- isFlattenable = _isFlattenable;
14357
-
14358
- /**
14359
- * The base implementation of `_.flatten` with support for restricting flattening.
14360
- *
14361
- * @private
14362
- * @param {Array} array The array to flatten.
14363
- * @param {number} depth The maximum recursion depth.
14364
- * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
14365
- * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
14366
- * @param {Array} [result=[]] The initial result value.
14367
- * @returns {Array} Returns the new flattened array.
14368
- */
14369
- function baseFlatten$1(array, depth, predicate, isStrict, result) {
14370
- var index = -1,
14371
- length = array.length;
14372
-
14373
- predicate || (predicate = isFlattenable);
14374
- result || (result = []);
14375
-
14376
- while (++index < length) {
14377
- var value = array[index];
14378
- if (depth > 0 && predicate(value)) {
14379
- if (depth > 1) {
14380
- // Recursively flatten arrays (susceptible to call stack limits).
14381
- baseFlatten$1(value, depth - 1, predicate, isStrict, result);
14382
- } else {
14383
- arrayPush(result, value);
14384
- }
14385
- } else if (!isStrict) {
14386
- result[result.length] = value;
14387
- }
14388
- }
14389
- return result;
14722
+ function compareIsoDateTime(dt1, dt2) {
14723
+ if (!(dt1 && dt2))
14724
+ return undefined;
14725
+ const [d1, t1] = dt1.split(DATE_TIME_SEPARATOR);
14726
+ const [d2, t2] = dt2.split(DATE_TIME_SEPARATOR);
14727
+ const res = compareDate(d1, d2);
14728
+ if (res === undefined)
14729
+ return undefined;
14730
+ return res || compareTime(t1, t2);
14390
14731
  }
14391
-
14392
- var _baseFlatten = baseFlatten$1;var baseFlatten = _baseFlatten;
14393
-
14394
- /**
14395
- * Flattens `array` a single level deep.
14396
- *
14397
- * @static
14398
- * @memberOf _
14399
- * @since 0.1.0
14400
- * @category Array
14401
- * @param {Array} array The array to flatten.
14402
- * @returns {Array} Returns the new flattened array.
14403
- * @example
14404
- *
14405
- * _.flatten([1, [2, [3, [4]], 5]]);
14406
- * // => [1, 2, [3, [4]], 5]
14407
- */
14408
- function flatten$1(array) {
14409
- var length = array == null ? 0 : array.length;
14410
- return length ? baseFlatten(array, 1) : [];
14732
+ const NOT_URI_FRAGMENT = /\/|:/;
14733
+ const URI = /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;
14734
+ function uri(str) {
14735
+ // http://jmrware.com/articles/2009/uri_regexp/URI_regex.html + optional protocol + required "."
14736
+ return NOT_URI_FRAGMENT.test(str) && URI.test(str);
14737
+ }
14738
+ const BYTE = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;
14739
+ function byte(str) {
14740
+ BYTE.lastIndex = 0;
14741
+ return BYTE.test(str);
14742
+ }
14743
+ const MIN_INT32 = -(2 ** 31);
14744
+ const MAX_INT32 = 2 ** 31 - 1;
14745
+ function validateInt32(value) {
14746
+ return Number.isInteger(value) && value <= MAX_INT32 && value >= MIN_INT32;
14747
+ }
14748
+ function validateInt64(value) {
14749
+ // JSON and javascript max Int is 2**53, so any int that passes isInteger is valid for Int64
14750
+ return Number.isInteger(value);
14751
+ }
14752
+ function validateNumber() {
14753
+ return true;
14754
+ }
14755
+ const Z_ANCHOR = /[^\\]\\Z/;
14756
+ function regex(str) {
14757
+ if (Z_ANCHOR.test(str))
14758
+ return false;
14759
+ try {
14760
+ new RegExp(str);
14761
+ return true;
14762
+ }
14763
+ catch (e) {
14764
+ return false;
14765
+ }
14411
14766
  }
14412
14767
 
14413
- var flatten_1 = flatten$1;var flatten = flatten_1,
14414
- overRest = _overRest,
14415
- setToString = _setToString;
14768
+ }(formats));var limit = {};(function (exports) {
14769
+ Object.defineProperty(exports, "__esModule", { value: true });
14770
+ exports.formatLimitDefinition = void 0;
14771
+ const ajv_1 = ajv.exports;
14772
+ const codegen_1 = codegen;
14773
+ const ops = codegen_1.operators;
14774
+ const KWDs = {
14775
+ formatMaximum: { okStr: "<=", ok: ops.LTE, fail: ops.GT },
14776
+ formatMinimum: { okStr: ">=", ok: ops.GTE, fail: ops.LT },
14777
+ formatExclusiveMaximum: { okStr: "<", ok: ops.LT, fail: ops.GTE },
14778
+ formatExclusiveMinimum: { okStr: ">", ok: ops.GT, fail: ops.LTE },
14779
+ };
14780
+ const error = {
14781
+ message: ({ keyword, schemaCode }) => (0, codegen_1.str) `should be ${KWDs[keyword].okStr} ${schemaCode}`,
14782
+ params: ({ keyword, schemaCode }) => (0, codegen_1._) `{comparison: ${KWDs[keyword].okStr}, limit: ${schemaCode}}`,
14783
+ };
14784
+ exports.formatLimitDefinition = {
14785
+ keyword: Object.keys(KWDs),
14786
+ type: "string",
14787
+ schemaType: "string",
14788
+ $data: true,
14789
+ error,
14790
+ code(cxt) {
14791
+ const { gen, data, schemaCode, keyword, it } = cxt;
14792
+ const { opts, self } = it;
14793
+ if (!opts.validateFormats)
14794
+ return;
14795
+ const fCxt = new ajv_1.KeywordCxt(it, self.RULES.all.format.definition, "format");
14796
+ if (fCxt.$data)
14797
+ validate$DataFormat();
14798
+ else
14799
+ validateFormat();
14800
+ function validate$DataFormat() {
14801
+ const fmts = gen.scopeValue("formats", {
14802
+ ref: self.formats,
14803
+ code: opts.code.formats,
14804
+ });
14805
+ const fmt = gen.const("fmt", (0, codegen_1._) `${fmts}[${fCxt.schemaCode}]`);
14806
+ cxt.fail$data((0, codegen_1.or)((0, codegen_1._) `typeof ${fmt} != "object"`, (0, codegen_1._) `${fmt} instanceof RegExp`, (0, codegen_1._) `typeof ${fmt}.compare != "function"`, compareCode(fmt)));
14807
+ }
14808
+ function validateFormat() {
14809
+ const format = fCxt.schema;
14810
+ const fmtDef = self.formats[format];
14811
+ if (!fmtDef || fmtDef === true)
14812
+ return;
14813
+ if (typeof fmtDef != "object" ||
14814
+ fmtDef instanceof RegExp ||
14815
+ typeof fmtDef.compare != "function") {
14816
+ throw new Error(`"${keyword}": format "${format}" does not define "compare" function`);
14817
+ }
14818
+ const fmt = gen.scopeValue("formats", {
14819
+ key: format,
14820
+ ref: fmtDef,
14821
+ code: opts.code.formats ? (0, codegen_1._) `${opts.code.formats}${(0, codegen_1.getProperty)(format)}` : undefined,
14822
+ });
14823
+ cxt.fail$data(compareCode(fmt));
14824
+ }
14825
+ function compareCode(fmt) {
14826
+ return (0, codegen_1._) `${fmt}.compare(${data}, ${schemaCode}) ${KWDs[keyword].fail} 0`;
14827
+ }
14828
+ },
14829
+ dependencies: ["format"],
14830
+ };
14831
+ const formatLimitPlugin = (ajv) => {
14832
+ ajv.addKeyword(exports.formatLimitDefinition);
14833
+ return ajv;
14834
+ };
14835
+ exports.default = formatLimitPlugin;
14416
14836
 
14417
- /**
14418
- * A specialized version of `baseRest` which flattens the rest array.
14419
- *
14420
- * @private
14421
- * @param {Function} func The function to apply a rest parameter to.
14422
- * @returns {Function} Returns the new function.
14423
- */
14424
- function flatRest$1(func) {
14425
- return setToString(overRest(func, undefined, flatten), func + '');
14837
+ }(limit));(function (module, exports) {
14838
+ Object.defineProperty(exports, "__esModule", { value: true });
14839
+ const formats_1 = formats;
14840
+ const limit_1 = limit;
14841
+ const codegen_1 = codegen;
14842
+ const fullName = new codegen_1.Name("fullFormats");
14843
+ const fastName = new codegen_1.Name("fastFormats");
14844
+ const formatsPlugin = (ajv, opts = { keywords: true }) => {
14845
+ if (Array.isArray(opts)) {
14846
+ addFormats(ajv, opts, formats_1.fullFormats, fullName);
14847
+ return ajv;
14848
+ }
14849
+ const [formats, exportName] = opts.mode === "fast" ? [formats_1.fastFormats, fastName] : [formats_1.fullFormats, fullName];
14850
+ const list = opts.formats || formats_1.formatNames;
14851
+ addFormats(ajv, list, formats, exportName);
14852
+ if (opts.keywords)
14853
+ (0, limit_1.default)(ajv);
14854
+ return ajv;
14855
+ };
14856
+ formatsPlugin.get = (name, mode = "full") => {
14857
+ const formats = mode === "fast" ? formats_1.fastFormats : formats_1.fullFormats;
14858
+ const f = formats[name];
14859
+ if (!f)
14860
+ throw new Error(`Unknown format "${name}"`);
14861
+ return f;
14862
+ };
14863
+ function addFormats(ajv, list, fs, exportName) {
14864
+ var _a;
14865
+ var _b;
14866
+ (_a = (_b = ajv.opts.code).formats) !== null && _a !== void 0 ? _a : (_b.formats = (0, codegen_1._) `require("ajv-formats/dist/formats").${exportName}`);
14867
+ for (const f of list)
14868
+ ajv.addFormat(f, fs[f]);
14426
14869
  }
14870
+ module.exports = exports = formatsPlugin;
14871
+ Object.defineProperty(exports, "__esModule", { value: true });
14872
+ exports.default = formatsPlugin;
14427
14873
 
14428
- var _flatRest = flatRest$1;var basePick = _basePick,
14429
- flatRest = _flatRest;
14430
-
14431
- /**
14432
- * Creates an object composed of the picked `object` properties.
14433
- *
14434
- * @static
14435
- * @since 0.1.0
14436
- * @memberOf _
14437
- * @category Object
14438
- * @param {Object} object The source object.
14439
- * @param {...(string|string[])} [paths] The property paths to pick.
14440
- * @returns {Object} Returns the new object.
14441
- * @example
14442
- *
14443
- * var object = { 'a': 1, 'b': '2', 'c': 3 };
14444
- *
14445
- * _.pick(object, ['a', 'c']);
14446
- * // => { 'a': 1, 'c': 3 }
14447
- */
14448
- var pick = flatRest(function(object, paths) {
14449
- return object == null ? {} : basePick(object, paths);
14450
- });
14874
+ }(dist, dist.exports));
14451
14875
 
14452
- var pick_1 = pick;const SetTransform = createTransform((inboundState, key) => {
14453
- if (key !== 'root')
14454
- return inboundState;
14455
- return pick_1(inboundState, PERSIST_STORAGE_NAMES);
14456
- }, (outboundState, key) => {
14457
- if (key !== 'root')
14458
- return outboundState;
14459
- return pick_1(outboundState, PERSIST_STORAGE_NAMES);
14460
- });
14461
- var persistConfig = {
14462
- key: 'main',
14463
- whitelist: ['root'],
14464
- transforms: [SetTransform],
14465
- };function n(n){for(var r=arguments.length,t=Array(r>1?r-1:0),e=1;e<r;e++)t[e-1]=arguments[e];if("production"!==process.env.NODE_ENV){var i=Y[n],o=i?"function"==typeof i?i.apply(null,t):i:"unknown error nr: "+n;throw Error("[Immer] "+o)}throw Error("[Immer] minified error nr: "+n+(t.length?" "+t.map((function(n){return "'"+n+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function r(n){return !!n&&!!n[Q]}function t(n){return !!n&&(function(n){if(!n||"object"!=typeof n)return !1;var r=Object.getPrototypeOf(n);if(null===r)return !0;var t=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return t===Object||"function"==typeof t&&Function.toString.call(t)===Z}(n)||Array.isArray(n)||!!n[L]||!!n.constructor[L]||s(n)||v(n))}function i(n,r,t){void 0===t&&(t=!1),0===o(n)?(t?Object.keys:nn)(n).forEach((function(e){t&&"symbol"==typeof e||r(e,n[e],n);})):n.forEach((function(t,e){return r(e,t,n)}));}function o(n){var r=n[Q];return r?r.i>3?r.i-4:r.i:Array.isArray(n)?1:s(n)?2:v(n)?3:0}function u(n,r){return 2===o(n)?n.has(r):Object.prototype.hasOwnProperty.call(n,r)}function a(n,r){return 2===o(n)?n.get(r):n[r]}function f(n,r,t){var e=o(n);2===e?n.set(r,t):3===e?(n.delete(r),n.add(t)):n[r]=t;}function c(n,r){return n===r?0!==n||1/n==1/r:n!=n&&r!=r}function s(n){return X&&n instanceof Map}function v(n){return q&&n instanceof Set}function p(n){return n.o||n.t}function l(n){if(Array.isArray(n))return Array.prototype.slice.call(n);var r=rn(n);delete r[Q];for(var t=nn(r),e=0;e<t.length;e++){var i=t[e],o=r[i];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(r[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:n[i]});}return Object.create(Object.getPrototypeOf(n),r)}function d(n,e){return void 0===e&&(e=!1),y(n)||r(n)||!t(n)?n:(o(n)>1&&(n.set=n.add=n.clear=n.delete=h),Object.freeze(n),e&&i(n,(function(n,r){return d(r,!0)}),!0),n)}function h(){n(2);}function y(n){return null==n||"object"!=typeof n||Object.isFrozen(n)}function b(r){var t=tn[r];return t||n(18,r),t}function _(){return "production"===process.env.NODE_ENV||U||n(0),U}function j(n,r){r&&(b("Patches"),n.u=[],n.s=[],n.v=r);}function O(n){g(n),n.p.forEach(S),n.p=null;}function g(n){n===U&&(U=n.l);}function w(n){return U={p:[],l:U,h:n,m:!0,_:0}}function S(n){var r=n[Q];0===r.i||1===r.i?r.j():r.O=!0;}function P(r,e){e._=e.p.length;var i=e.p[0],o=void 0!==r&&r!==i;return e.h.g||b("ES5").S(e,r,o),o?(i[Q].P&&(O(e),n(4)),t(r)&&(r=M(e,r),e.l||x(e,r)),e.u&&b("Patches").M(i[Q].t,r,e.u,e.s)):r=M(e,i,[]),O(e),e.u&&e.v(e.u,e.s),r!==H?r:void 0}function M(n,r,t){if(y(r))return r;var e=r[Q];if(!e)return i(r,(function(i,o){return A(n,e,r,i,o,t)}),!0),r;if(e.A!==n)return r;if(!e.P)return x(n,e.t,!0),e.t;if(!e.I){e.I=!0,e.A._--;var o=4===e.i||5===e.i?e.o=l(e.k):e.o;i(3===e.i?new Set(o):o,(function(r,i){return A(n,e,o,r,i,t)})),x(n,o,!1),t&&n.u&&b("Patches").R(e,t,n.u,n.s);}return e.o}function A(e,i,o,a,c,s){if("production"!==process.env.NODE_ENV&&c===o&&n(5),r(c)){var v=M(e,c,s&&i&&3!==i.i&&!u(i.D,a)?s.concat(a):void 0);if(f(o,a,v),!r(v))return;e.m=!1;}if(t(c)&&!y(c)){if(!e.h.F&&e._<1)return;M(e,c),i&&i.A.l||x(e,c);}}function x(n,r,t){void 0===t&&(t=!1),n.h.F&&n.m&&d(r,t);}function z(n,r){var t=n[Q];return (t?p(t):n)[r]}function I(n,r){if(r in n)for(var t=Object.getPrototypeOf(n);t;){var e=Object.getOwnPropertyDescriptor(t,r);if(e)return e;t=Object.getPrototypeOf(t);}}function k(n){n.P||(n.P=!0,n.l&&k(n.l));}function E(n){n.o||(n.o=l(n.t));}function R(n,r,t){var e=s(r)?b("MapSet").N(r,t):v(r)?b("MapSet").T(r,t):n.g?function(n,r){var t=Array.isArray(n),e={i:t?1:0,A:r?r.A:_(),P:!1,I:!1,D:{},l:r,t:n,k:null,o:null,j:null,C:!1},i=e,o=en;t&&(i=[e],o=on);var u=Proxy.revocable(i,o),a=u.revoke,f=u.proxy;return e.k=f,e.j=a,f}(r,t):b("ES5").J(r,t);return (t?t.A:_()).p.push(e),e}function D(e){return r(e)||n(22,e),function n(r){if(!t(r))return r;var e,u=r[Q],c=o(r);if(u){if(!u.P&&(u.i<4||!b("ES5").K(u)))return u.t;u.I=!0,e=F(r,c),u.I=!1;}else e=F(r,c);return i(e,(function(r,t){u&&a(u.t,r)===t||f(e,r,n(t));})),3===c?new Set(e):e}(e)}function F(n,r){switch(r){case 2:return new Map(n);case 3:return Array.from(n)}return l(n)}var G,U,W="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),X="undefined"!=typeof Map,q="undefined"!=typeof Set,B="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,H=W?Symbol.for("immer-nothing"):((G={})["immer-nothing"]=!0,G),L=W?Symbol.for("immer-draftable"):"__$immer_draftable",Q=W?Symbol.for("immer-state"):"__$immer_state",Y={0:"Illegal state",1:"Immer drafts cannot have computed properties",2:"This object has been frozen and should not be mutated",3:function(n){return "Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+n},4:"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",5:"Immer forbids circular references",6:"The first or second argument to `produce` must be a function",7:"The third argument to `produce` must be a function or undefined",8:"First argument to `createDraft` must be a plain object, an array, or an immerable object",9:"First argument to `finishDraft` must be a draft returned by `createDraft`",10:"The given draft is already finalized",11:"Object.defineProperty() cannot be used on an Immer draft",12:"Object.setPrototypeOf() cannot be used on an Immer draft",13:"Immer only supports deleting array indices",14:"Immer only supports setting array indices and the 'length' property",15:function(n){return "Cannot apply patch, path doesn't resolve: "+n},16:'Sets cannot have "replace" patches.',17:function(n){return "Unsupported patch operation: "+n},18:function(n){return "The plugin for '"+n+"' has not been loaded into Immer. To enable the plugin, import and call `enable"+n+"()` when initializing your application."},20:"Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available",21:function(n){return "produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '"+n+"'"},22:function(n){return "'current' expects a draft, got: "+n},23:function(n){return "'original' expects a draft, got: "+n},24:"Patching reserved attributes like __proto__, prototype and constructor is not allowed"},Z=""+Object.prototype.constructor,nn="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:Object.getOwnPropertyNames,rn=Object.getOwnPropertyDescriptors||function(n){var r={};return nn(n).forEach((function(t){r[t]=Object.getOwnPropertyDescriptor(n,t);})),r},tn={},en={get:function(n,r){if(r===Q)return n;var e=p(n);if(!u(e,r))return function(n,r,t){var e,i=I(r,t);return i?"value"in i?i.value:null===(e=i.get)||void 0===e?void 0:e.call(n.k):void 0}(n,e,r);var i=e[r];return n.I||!t(i)?i:i===z(n.t,r)?(E(n),n.o[r]=R(n.A.h,i,n)):i},has:function(n,r){return r in p(n)},ownKeys:function(n){return Reflect.ownKeys(p(n))},set:function(n,r,t){var e=I(p(n),r);if(null==e?void 0:e.set)return e.set.call(n.k,t),!0;if(!n.P){var i=z(p(n),r),o=null==i?void 0:i[Q];if(o&&o.t===t)return n.o[r]=t,n.D[r]=!1,!0;if(c(t,i)&&(void 0!==t||u(n.t,r)))return !0;E(n),k(n);}return n.o[r]===t&&"number"!=typeof t&&(void 0!==t||r in n.o)||(n.o[r]=t,n.D[r]=!0,!0)},deleteProperty:function(n,r){return void 0!==z(n.t,r)||r in n.t?(n.D[r]=!1,E(n),k(n)):delete n.D[r],n.o&&delete n.o[r],!0},getOwnPropertyDescriptor:function(n,r){var t=p(n),e=Reflect.getOwnPropertyDescriptor(t,r);return e?{writable:!0,configurable:1!==n.i||"length"!==r,enumerable:e.enumerable,value:t[r]}:e},defineProperty:function(){n(11);},getPrototypeOf:function(n){return Object.getPrototypeOf(n.t)},setPrototypeOf:function(){n(12);}},on={};i(en,(function(n,r){on[n]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)};})),on.deleteProperty=function(r,t){return "production"!==process.env.NODE_ENV&&isNaN(parseInt(t))&&n(13),on.set.call(this,r,t,void 0)},on.set=function(r,t,e){return "production"!==process.env.NODE_ENV&&"length"!==t&&isNaN(parseInt(t))&&n(14),en.set.call(this,r[0],t,e,r[0])};var un=function(){function e(r){var e=this;this.g=B,this.F=!0,this.produce=function(r,i,o){if("function"==typeof r&&"function"!=typeof i){var u=i;i=r;var a=e;return function(n){var r=this;void 0===n&&(n=u);for(var t=arguments.length,e=Array(t>1?t-1:0),o=1;o<t;o++)e[o-1]=arguments[o];return a.produce(n,(function(n){var t;return (t=i).call.apply(t,[r,n].concat(e))}))}}var f;if("function"!=typeof i&&n(6),void 0!==o&&"function"!=typeof o&&n(7),t(r)){var c=w(e),s=R(e,r,void 0),v=!0;try{f=i(s),v=!1;}finally{v?O(c):g(c);}return "undefined"!=typeof Promise&&f instanceof Promise?f.then((function(n){return j(c,o),P(n,c)}),(function(n){throw O(c),n})):(j(c,o),P(f,c))}if(!r||"object"!=typeof r){if(void 0===(f=i(r))&&(f=r),f===H&&(f=void 0),e.F&&d(f,!0),o){var p=[],l=[];b("Patches").M(r,f,p,l),o(p,l);}return f}n(21,r);},this.produceWithPatches=function(n,r){if("function"==typeof n)return function(r){for(var t=arguments.length,i=Array(t>1?t-1:0),o=1;o<t;o++)i[o-1]=arguments[o];return e.produceWithPatches(r,(function(r){return n.apply(void 0,[r].concat(i))}))};var t,i,o=e.produce(n,r,(function(n,r){t=n,i=r;}));return "undefined"!=typeof Promise&&o instanceof Promise?o.then((function(n){return [n,t,i]})):[o,t,i]},"boolean"==typeof(null==r?void 0:r.useProxies)&&this.setUseProxies(r.useProxies),"boolean"==typeof(null==r?void 0:r.autoFreeze)&&this.setAutoFreeze(r.autoFreeze);}var i=e.prototype;return i.createDraft=function(e){t(e)||n(8),r(e)&&(e=D(e));var i=w(this),o=R(this,e,void 0);return o[Q].C=!0,g(i),o},i.finishDraft=function(r,t){var e=r&&r[Q];"production"!==process.env.NODE_ENV&&(e&&e.C||n(9),e.I&&n(10));var i=e.A;return j(i,t),P(void 0,i)},i.setAutoFreeze=function(n){this.F=n;},i.setUseProxies=function(r){r&&!B&&n(20),this.g=r;},i.applyPatches=function(n,t){var e;for(e=t.length-1;e>=0;e--){var i=t[e];if(0===i.path.length&&"replace"===i.op){n=i.value;break}}e>-1&&(t=t.slice(e+1));var o=b("Patches").$;return r(n)?o(n,t):this.produce(n,(function(n){return o(n,t)}))},e}(),an=new un,fn=an.produce;an.produceWithPatches.bind(an);an.setAutoFreeze.bind(an);an.setUseProxies.bind(an);an.applyPatches.bind(an);an.createDraft.bind(an);an.finishDraft.bind(an);var produce = fn;
14466
- const pathConverter = (path) => path.replace(/\./g, SEPARATOR);
14876
+ var ajvFormats = /*@__PURE__*/getDefaultExportFromCjs(dist.exports);const pathConverter = (path) => path.replace(/\./g, SEPARATOR);
14467
14877
  const errorConverter = (errors) => {
14468
14878
  const res = {};
14879
+ // convert error and add as an array item to the particular property
14469
14880
  if (errors) {
14470
14881
  errors.forEach((i) => {
14882
+ var _a, _b, _c, _d, _e, _f;
14471
14883
  if (i.keyword === 'required') {
14884
+ // because it's not parent error, need to move that level
14472
14885
  jsonpointer.set(res, `${pathConverter(`${i.instancePath}.${i.params.missingProperty}`)}/-`, i.message);
14473
14886
  }
14887
+ else if (i.keyword === 'errorMessage' && ((_c = (_b = (_a = i === null || i === void 0 ? void 0 : i.params) === null || _a === void 0 ? void 0 : _a.errors) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.keyword) === 'required') {
14888
+ jsonpointer.set(res, `${pathConverter(`${i.instancePath}.${(_f = (_e = (_d = i === null || i === void 0 ? void 0 : i.params) === null || _d === void 0 ? void 0 : _d.errors) === null || _e === void 0 ? void 0 : _e[0]) === null || _f === void 0 ? void 0 : _f.params.missingProperty}`)}/-`, i.message);
14889
+ }
14474
14890
  else {
14475
14891
  jsonpointer.set(res, `${pathConverter(i.instancePath)}/-`, i.message);
14476
14892
  }
14477
14893
  });
14478
14894
  }
14479
- return res;
14895
+ // TODO: if it's a root level validation, looks like : {-: 'should be email'} should be converted
14896
+ return res && res['-'] ? res['-'] : res;
14480
14897
  };
14481
- const validateJSON = (schema, store, data) => {
14898
+ const validateJSON = (schema, data) => {
14482
14899
  const ajv = new Ajv({ allErrors: true });
14900
+ ajvErrors(ajv);
14901
+ ajvFormats(ajv);
14483
14902
  const validate = ajv.compile(schema);
14484
14903
  const valid = validate(data);
14904
+ return {
14905
+ valid: validate(data),
14906
+ error: valid ? null : errorConverter(validate.errors),
14907
+ };
14908
+ };
14909
+ const validateJSONAndStore = (schema, store, data) => {
14910
+ const { valid, error } = validateJSON(schema, data);
14485
14911
  return {
14486
14912
  store: `${store}${STORE_ERROR_POSTFIX}`,
14487
14913
  valid,
14488
- value: valid ? null : errorConverter(validate.errors),
14914
+ value: error,
14489
14915
  };
14490
14916
  };const initialState = {};
14491
- const validateNewState = (stock, newState, actionStore, actionPath) => {
14917
+ const globalValidateNewState = (stock, newState, actionStore, actionPath) => {
14492
14918
  if (stock === null || stock === void 0 ? void 0 : stock.validations) {
14493
14919
  stock.validations.forEach((validateItem) => {
14494
14920
  if (validateItem.store === actionStore && `${actionPath}`.startsWith(validateItem.path)) {
14495
14921
  if (validateItem.schema) {
14496
- const stateToBeValidated = jsonPointerGet(newState, `${SEPARATOR}${actionStore}${validateItem.path}`);
14497
- const errors = validateJSON(validateItem.schema, actionStore, stateToBeValidated);
14498
- // console.log('matched validator', `${c.SEPARATOR}${errors.store}${validateItem.path}`, errors)
14922
+ const state = D(newState);
14923
+ const stateToBeValidated = jsonPointerGet(state, `${SEPARATOR}${actionStore}${validateItem.path}`);
14924
+ const errors = validateJSONAndStore(validateItem.schema, actionStore, stateToBeValidated);
14499
14925
  // eslint-disable-next-line no-param-reassign
14500
14926
  newState = jsonPointerSet(newState, `${SEPARATOR}${errors.store}${validateItem.path}`, errors.value);
14501
14927
  }
@@ -14507,12 +14933,12 @@ const reducer = (state = initialState, action) => {
14507
14933
  switch (action === null || action === void 0 ? void 0 : action.type) {
14508
14934
  case DATA_UPDATE: {
14509
14935
  const { store = undefined, path = undefined, value = undefined, jsonataDef = undefined, [CURRENT_PATH_NAME]: currentPaths = undefined, stock = undefined, } = (action === null || action === void 0 ? void 0 : action.payload) || {};
14510
- if (store && path && !isCircular(value)) {
14936
+ if (store && path && !isValidJson(value)) {
14511
14937
  const storekey = `${store}`;
14512
14938
  let convertedPath = currentPaths && currentPaths[storekey] && currentPaths[storekey].path
14513
14939
  ? changeRelativePath(`${currentPaths[storekey].path}${SEPARATOR}${path}`)
14514
14940
  : changeRelativePath(path);
14515
- convertedPath = convertedPath.startsWith(SEPARATOR) ? convertedPath : `${SEPARATOR}${convertedPath}`;
14941
+ convertedPath = jsonPointerFix(convertedPath);
14516
14942
  const absolutePathWithStoreKey = `${SEPARATOR}${storekey}${convertedPath}`;
14517
14943
  const newState = produce(state, (draft) => {
14518
14944
  if (jsonataDef) {
@@ -14535,21 +14961,18 @@ const reducer = (state = initialState, action) => {
14535
14961
  // eslint-disable-next-line no-param-reassign
14536
14962
  draft = jsonPointerSet(draft, absolutePathWithStoreKey, value);
14537
14963
  }
14964
+ // set, if a leaf touched
14965
+ // TODO if array or object touched, can easily overwite the leaf touched
14966
+ // eslint-disable-next-line no-param-reassign
14967
+ draft = jsonPointerSet(draft, `${SEPARATOR}${storekey}${STORE_TOUCH_POSTFIX}${convertedPath}`, true);
14538
14968
  // if validatior has match, need to validate it synchronously
14539
- validateNewState(stock, draft, store, convertedPath);
14969
+ globalValidateNewState(stock, draft, store, convertedPath);
14540
14970
  });
14541
14971
  return newState;
14542
14972
  }
14543
14973
  return state;
14544
14974
  }
14545
- case PURGE: {
14546
- return initialState;
14547
- }
14548
14975
  default:
14549
14976
  return state;
14550
14977
  }
14551
- };const rootReducer = combineReducers({ root: reducer });const deletePersistDataStore = (attr, props, callerArgs, stock) => __awaiter(void 0, void 0, void 0, function* () {
14552
- stock.reduxStore.dispatch(purge(null));
14553
- yield stock.callFunction('reloadApp', {});
14554
- });
14555
- const appRootFunctions = { deletePersistDataStore };export{I18n,PathModifierContext,Stock,StockContext,appRootFunctions,compSelectorHook,constants,persistConfig,functions as stockFunctions,rootReducer as storeReducers,util$1 as util,wrapperUtil};//# sourceMappingURL=index.js.map
14978
+ };const rootReducer = combineReducers({ root: reducer });export{I18n,PathModifierContext,Stock,StockContext,compSelectorHook,constants,functions as stockFunctions,rootReducer as storeReducers,util$1 as util,wrapperUtil};//# sourceMappingURL=index.js.map