@audius/sdk 1.0.34 → 1.0.36

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/legacy.js CHANGED
@@ -599,6 +599,8 @@ function _createForOfIteratorHelper(o, allowArrayLike) {
599
599
  };
600
600
  }
601
601
 
602
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
603
+
602
604
  var Web3;
603
605
 
604
606
  if (typeof window !== 'undefined' && window && window.Web3) {
@@ -36979,9 +36981,9 @@ exports.ChatPermission = void 0;
36979
36981
  })(exports.ChatPermission || (exports.ChatPermission = {}));
36980
36982
 
36981
36983
  var name = "@audius/sdk";
36982
- var version = "1.0.34";
36984
+ var version = "1.0.36";
36983
36985
  var audius = {
36984
- releaseSHA: "8f0ae0d181bf1ee2dcf5ccc26987aaf1d0861903"
36986
+ releaseSHA: "f5d39ff9c22d1fe9b5ca9c14261a1690575af34d"
36985
36987
  };
36986
36988
  var description = "";
36987
36989
  var main = "dist/index.cjs.js";
@@ -50417,12 +50419,27 @@ var definitions$2 = {
50417
50419
  "ERC721",
50418
50420
  "ERC1155"
50419
50421
  ]
50422
+ },
50423
+ name: {
50424
+ type: "string"
50425
+ },
50426
+ slug: {
50427
+ type: "string"
50428
+ },
50429
+ externalLink: {
50430
+ type: [
50431
+ "string",
50432
+ "null"
50433
+ ],
50434
+ "default": null
50420
50435
  }
50421
50436
  },
50422
50437
  required: [
50423
50438
  "chain",
50424
50439
  "address",
50425
- "standard"
50440
+ "standard",
50441
+ "name",
50442
+ "slug"
50426
50443
  ],
50427
50444
  title: "PremiumConditionsEthNFTCollection"
50428
50445
  },
@@ -50436,11 +50453,22 @@ var definitions$2 = {
50436
50453
  },
50437
50454
  address: {
50438
50455
  type: "string"
50456
+ },
50457
+ name: {
50458
+ type: "string"
50459
+ },
50460
+ externalLink: {
50461
+ type: [
50462
+ "string",
50463
+ "null"
50464
+ ],
50465
+ "default": null
50439
50466
  }
50440
50467
  },
50441
50468
  required: [
50442
50469
  "chain",
50443
- "address"
50470
+ "address",
50471
+ "name"
50444
50472
  ],
50445
50473
  title: "PremiumConditionsSolNFTCollection"
50446
50474
  },
@@ -62691,247 +62719,3431 @@ var syncNodes = /*#__PURE__*/function () {
62691
62719
  };
62692
62720
  }();
62693
62721
 
62694
- var THREE_SECONDS = 3000;
62695
- var MAX_TRIES = 3;
62696
- /** Check if the user's primary creator node is healthy */
62722
+ var freeGlobal$1 = _typeof(commonjsGlobal) == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
62723
+ var _freeGlobal = freeGlobal$1;
62697
62724
 
62698
- var checkPrimaryHealthy = /*#__PURE__*/function () {
62699
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(libs, primary, tries) {
62700
- var healthy;
62701
- return regeneratorRuntime.wrap(function _callee$(_context) {
62702
- while (1) {
62703
- switch (_context.prev = _context.next) {
62704
- case 0:
62705
- _context.next = 2;
62706
- return Utils.isHealthy(primary);
62725
+ var freeGlobal = _freeGlobal;
62726
+ /** Detect free variable `self`. */
62707
62727
 
62708
- case 2:
62709
- healthy = _context.sent;
62728
+ var freeSelf = (typeof self === "undefined" ? "undefined" : _typeof(self)) == 'object' && self && self.Object === Object && self;
62729
+ /** Used as a reference to the global object. */
62710
62730
 
62711
- if (!healthy) {
62712
- _context.next = 7;
62713
- break;
62714
- }
62731
+ var root$8 = freeGlobal || freeSelf || Function('return this')();
62732
+ var _root = root$8;
62715
62733
 
62716
- return _context.abrupt("return", healthy);
62734
+ var root$7 = _root;
62735
+ /** Built-in value references. */
62717
62736
 
62718
- case 7:
62719
- if (!(tries === 0)) {
62720
- _context.next = 9;
62721
- break;
62722
- }
62737
+ var _Symbol2 = root$7.Symbol;
62738
+ var _Symbol$4 = _Symbol2;
62723
62739
 
62724
- return _context.abrupt("return", false);
62740
+ var _Symbol$3 = _Symbol$4;
62741
+ /** Used for built-in method references. */
62725
62742
 
62726
- case 9:
62727
- _context.next = 11;
62728
- return Utils.wait(THREE_SECONDS);
62743
+ var objectProto$b = Object.prototype;
62744
+ /** Used to check objects for own properties. */
62729
62745
 
62730
- case 11:
62731
- _context.next = 13;
62732
- return checkPrimaryHealthy(libs, primary, tries - 1);
62746
+ var hasOwnProperty$8 = objectProto$b.hasOwnProperty;
62747
+ /**
62748
+ * Used to resolve the
62749
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
62750
+ * of values.
62751
+ */
62733
62752
 
62734
- case 13:
62735
- return _context.abrupt("return", _context.sent);
62753
+ var nativeObjectToString$1 = objectProto$b.toString;
62754
+ /** Built-in value references. */
62736
62755
 
62737
- case 14:
62738
- case "end":
62739
- return _context.stop();
62740
- }
62741
- }
62742
- }, _callee);
62743
- }));
62756
+ var symToStringTag$1 = _Symbol$3 ? _Symbol$3.toStringTag : undefined;
62757
+ /**
62758
+ * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
62759
+ *
62760
+ * @private
62761
+ * @param {*} value The value to query.
62762
+ * @returns {string} Returns the raw `toStringTag`.
62763
+ */
62744
62764
 
62745
- return function checkPrimaryHealthy(_x, _x2, _x3) {
62746
- return _ref.apply(this, arguments);
62747
- };
62765
+ function getRawTag$1(value) {
62766
+ var isOwn = hasOwnProperty$8.call(value, symToStringTag$1),
62767
+ tag = value[symToStringTag$1];
62768
+
62769
+ try {
62770
+ value[symToStringTag$1] = undefined;
62771
+ var unmasked = true;
62772
+ } catch (e) {}
62773
+
62774
+ var result = nativeObjectToString$1.call(value);
62775
+
62776
+ if (unmasked) {
62777
+ if (isOwn) {
62778
+ value[symToStringTag$1] = tag;
62779
+ } else {
62780
+ delete value[symToStringTag$1];
62781
+ }
62782
+ }
62783
+
62784
+ return result;
62785
+ }
62786
+
62787
+ var _getRawTag = getRawTag$1;
62788
+
62789
+ /** Used for built-in method references. */
62790
+ var objectProto$a = Object.prototype;
62791
+ /**
62792
+ * Used to resolve the
62793
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
62794
+ * of values.
62795
+ */
62796
+
62797
+ var nativeObjectToString = objectProto$a.toString;
62798
+ /**
62799
+ * Converts `value` to a string using `Object.prototype.toString`.
62800
+ *
62801
+ * @private
62802
+ * @param {*} value The value to convert.
62803
+ * @returns {string} Returns the converted string.
62804
+ */
62805
+
62806
+ function objectToString$1(value) {
62807
+ return nativeObjectToString.call(value);
62808
+ }
62809
+
62810
+ var _objectToString = objectToString$1;
62811
+
62812
+ var _Symbol$2 = _Symbol$4,
62813
+ getRawTag = _getRawTag,
62814
+ objectToString = _objectToString;
62815
+ /** `Object#toString` result references. */
62816
+
62817
+ var nullTag = '[object Null]',
62818
+ undefinedTag = '[object Undefined]';
62819
+ /** Built-in value references. */
62820
+
62821
+ var symToStringTag = _Symbol$2 ? _Symbol$2.toStringTag : undefined;
62822
+ /**
62823
+ * The base implementation of `getTag` without fallbacks for buggy environments.
62824
+ *
62825
+ * @private
62826
+ * @param {*} value The value to query.
62827
+ * @returns {string} Returns the `toStringTag`.
62828
+ */
62829
+
62830
+ function baseGetTag$5(value) {
62831
+ if (value == null) {
62832
+ return value === undefined ? undefinedTag : nullTag;
62833
+ }
62834
+
62835
+ return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
62836
+ }
62837
+
62838
+ var _baseGetTag = baseGetTag$5;
62839
+
62840
+ function isObjectLike$5(value) {
62841
+ return value != null && _typeof(value) == 'object';
62842
+ }
62843
+
62844
+ var isObjectLike_1 = isObjectLike$5;
62845
+
62846
+ var baseGetTag$4 = _baseGetTag,
62847
+ isObjectLike$4 = isObjectLike_1;
62848
+ /** `Object#toString` result references. */
62849
+
62850
+ var symbolTag$1 = '[object Symbol]';
62851
+ /**
62852
+ * Checks if `value` is classified as a `Symbol` primitive or object.
62853
+ *
62854
+ * @static
62855
+ * @memberOf _
62856
+ * @since 4.0.0
62857
+ * @category Lang
62858
+ * @param {*} value The value to check.
62859
+ * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
62860
+ * @example
62861
+ *
62862
+ * _.isSymbol(Symbol.iterator);
62863
+ * // => true
62864
+ *
62865
+ * _.isSymbol('abc');
62866
+ * // => false
62867
+ */
62868
+
62869
+ function isSymbol$4(value) {
62870
+ return _typeof(value) == 'symbol' || isObjectLike$4(value) && baseGetTag$4(value) == symbolTag$1;
62871
+ }
62872
+
62873
+ var isSymbol_1 = isSymbol$4;
62874
+
62875
+ var isSymbol$3 = isSymbol_1;
62876
+ /**
62877
+ * The base implementation of methods like `_.max` and `_.min` which accepts a
62878
+ * `comparator` to determine the extremum value.
62879
+ *
62880
+ * @private
62881
+ * @param {Array} array The array to iterate over.
62882
+ * @param {Function} iteratee The iteratee invoked per iteration.
62883
+ * @param {Function} comparator The comparator used to compare values.
62884
+ * @returns {*} Returns the extremum value.
62885
+ */
62886
+
62887
+ function baseExtremum$1(array, iteratee, comparator) {
62888
+ var index = -1,
62889
+ length = array.length;
62890
+
62891
+ while (++index < length) {
62892
+ var value = array[index],
62893
+ current = iteratee(value);
62894
+
62895
+ if (current != null && (computed === undefined ? current === current && !isSymbol$3(current) : comparator(current, computed))) {
62896
+ var computed = current,
62897
+ result = value;
62898
+ }
62899
+ }
62900
+
62901
+ return result;
62902
+ }
62903
+
62904
+ var _baseExtremum = baseExtremum$1;
62905
+
62906
+ /**
62907
+ * The base implementation of `_.gt` which doesn't coerce arguments.
62908
+ *
62909
+ * @private
62910
+ * @param {*} value The value to compare.
62911
+ * @param {*} other The other value to compare.
62912
+ * @returns {boolean} Returns `true` if `value` is greater than `other`,
62913
+ * else `false`.
62914
+ */
62915
+
62916
+ function baseGt$1(value, other) {
62917
+ return value > other;
62918
+ }
62919
+
62920
+ var _baseGt = baseGt$1;
62921
+
62922
+ /**
62923
+ * Removes all key-value entries from the list cache.
62924
+ *
62925
+ * @private
62926
+ * @name clear
62927
+ * @memberOf ListCache
62928
+ */
62929
+
62930
+ function listCacheClear$1() {
62931
+ this.__data__ = [];
62932
+ this.size = 0;
62933
+ }
62934
+
62935
+ var _listCacheClear = listCacheClear$1;
62936
+
62937
+ /**
62938
+ * Performs a
62939
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
62940
+ * comparison between two values to determine if they are equivalent.
62941
+ *
62942
+ * @static
62943
+ * @memberOf _
62944
+ * @since 4.0.0
62945
+ * @category Lang
62946
+ * @param {*} value The value to compare.
62947
+ * @param {*} other The other value to compare.
62948
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
62949
+ * @example
62950
+ *
62951
+ * var object = { 'a': 1 };
62952
+ * var other = { 'a': 1 };
62953
+ *
62954
+ * _.eq(object, object);
62955
+ * // => true
62956
+ *
62957
+ * _.eq(object, other);
62958
+ * // => false
62959
+ *
62960
+ * _.eq('a', 'a');
62961
+ * // => true
62962
+ *
62963
+ * _.eq('a', Object('a'));
62964
+ * // => false
62965
+ *
62966
+ * _.eq(NaN, NaN);
62967
+ * // => true
62968
+ */
62969
+
62970
+ function eq$2(value, other) {
62971
+ return value === other || value !== value && other !== other;
62972
+ }
62973
+
62974
+ var eq_1 = eq$2;
62975
+
62976
+ var eq$1 = eq_1;
62977
+ /**
62978
+ * Gets the index at which the `key` is found in `array` of key-value pairs.
62979
+ *
62980
+ * @private
62981
+ * @param {Array} array The array to inspect.
62982
+ * @param {*} key The key to search for.
62983
+ * @returns {number} Returns the index of the matched value, else `-1`.
62984
+ */
62985
+
62986
+ function assocIndexOf$4(array, key) {
62987
+ var length = array.length;
62988
+
62989
+ while (length--) {
62990
+ if (eq$1(array[length][0], key)) {
62991
+ return length;
62992
+ }
62993
+ }
62994
+
62995
+ return -1;
62996
+ }
62997
+
62998
+ var _assocIndexOf = assocIndexOf$4;
62999
+
63000
+ var assocIndexOf$3 = _assocIndexOf;
63001
+ /** Used for built-in method references. */
63002
+
63003
+ var arrayProto = Array.prototype;
63004
+ /** Built-in value references. */
63005
+
63006
+ var splice = arrayProto.splice;
63007
+ /**
63008
+ * Removes `key` and its value from the list cache.
63009
+ *
63010
+ * @private
63011
+ * @name delete
63012
+ * @memberOf ListCache
63013
+ * @param {string} key The key of the value to remove.
63014
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
63015
+ */
63016
+
63017
+ function listCacheDelete$1(key) {
63018
+ var data = this.__data__,
63019
+ index = assocIndexOf$3(data, key);
63020
+
63021
+ if (index < 0) {
63022
+ return false;
63023
+ }
63024
+
63025
+ var lastIndex = data.length - 1;
63026
+
63027
+ if (index == lastIndex) {
63028
+ data.pop();
63029
+ } else {
63030
+ splice.call(data, index, 1);
63031
+ }
63032
+
63033
+ --this.size;
63034
+ return true;
63035
+ }
63036
+
63037
+ var _listCacheDelete = listCacheDelete$1;
63038
+
63039
+ var assocIndexOf$2 = _assocIndexOf;
63040
+ /**
63041
+ * Gets the list cache value for `key`.
63042
+ *
63043
+ * @private
63044
+ * @name get
63045
+ * @memberOf ListCache
63046
+ * @param {string} key The key of the value to get.
63047
+ * @returns {*} Returns the entry value.
63048
+ */
63049
+
63050
+ function listCacheGet$1(key) {
63051
+ var data = this.__data__,
63052
+ index = assocIndexOf$2(data, key);
63053
+ return index < 0 ? undefined : data[index][1];
63054
+ }
63055
+
63056
+ var _listCacheGet = listCacheGet$1;
63057
+
63058
+ var assocIndexOf$1 = _assocIndexOf;
63059
+ /**
63060
+ * Checks if a list cache value for `key` exists.
63061
+ *
63062
+ * @private
63063
+ * @name has
63064
+ * @memberOf ListCache
63065
+ * @param {string} key The key of the entry to check.
63066
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
63067
+ */
63068
+
63069
+ function listCacheHas$1(key) {
63070
+ return assocIndexOf$1(this.__data__, key) > -1;
63071
+ }
63072
+
63073
+ var _listCacheHas = listCacheHas$1;
63074
+
63075
+ var assocIndexOf = _assocIndexOf;
63076
+ /**
63077
+ * Sets the list cache `key` to `value`.
63078
+ *
63079
+ * @private
63080
+ * @name set
63081
+ * @memberOf ListCache
63082
+ * @param {string} key The key of the value to set.
63083
+ * @param {*} value The value to set.
63084
+ * @returns {Object} Returns the list cache instance.
63085
+ */
63086
+
63087
+ function listCacheSet$1(key, value) {
63088
+ var data = this.__data__,
63089
+ index = assocIndexOf(data, key);
63090
+
63091
+ if (index < 0) {
63092
+ ++this.size;
63093
+ data.push([key, value]);
63094
+ } else {
63095
+ data[index][1] = value;
63096
+ }
63097
+
63098
+ return this;
63099
+ }
63100
+
63101
+ var _listCacheSet = listCacheSet$1;
63102
+
63103
+ var listCacheClear = _listCacheClear,
63104
+ listCacheDelete = _listCacheDelete,
63105
+ listCacheGet = _listCacheGet,
63106
+ listCacheHas = _listCacheHas,
63107
+ listCacheSet = _listCacheSet;
63108
+ /**
63109
+ * Creates an list cache object.
63110
+ *
63111
+ * @private
63112
+ * @constructor
63113
+ * @param {Array} [entries] The key-value pairs to cache.
63114
+ */
63115
+
63116
+ function ListCache$4(entries) {
63117
+ var index = -1,
63118
+ length = entries == null ? 0 : entries.length;
63119
+ this.clear();
63120
+
63121
+ while (++index < length) {
63122
+ var entry = entries[index];
63123
+ this.set(entry[0], entry[1]);
63124
+ }
63125
+ } // Add methods to `ListCache`.
63126
+
63127
+
63128
+ ListCache$4.prototype.clear = listCacheClear;
63129
+ ListCache$4.prototype['delete'] = listCacheDelete;
63130
+ ListCache$4.prototype.get = listCacheGet;
63131
+ ListCache$4.prototype.has = listCacheHas;
63132
+ ListCache$4.prototype.set = listCacheSet;
63133
+ var _ListCache = ListCache$4;
63134
+
63135
+ var ListCache$3 = _ListCache;
63136
+ /**
63137
+ * Removes all key-value entries from the stack.
63138
+ *
63139
+ * @private
63140
+ * @name clear
63141
+ * @memberOf Stack
63142
+ */
63143
+
63144
+ function stackClear$1() {
63145
+ this.__data__ = new ListCache$3();
63146
+ this.size = 0;
63147
+ }
63148
+
63149
+ var _stackClear = stackClear$1;
63150
+
63151
+ /**
63152
+ * Removes `key` and its value from the stack.
63153
+ *
63154
+ * @private
63155
+ * @name delete
63156
+ * @memberOf Stack
63157
+ * @param {string} key The key of the value to remove.
63158
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
63159
+ */
63160
+
63161
+ function stackDelete$1(key) {
63162
+ var data = this.__data__,
63163
+ result = data['delete'](key);
63164
+ this.size = data.size;
63165
+ return result;
63166
+ }
63167
+
63168
+ var _stackDelete = stackDelete$1;
63169
+
63170
+ /**
63171
+ * Gets the stack value for `key`.
63172
+ *
63173
+ * @private
63174
+ * @name get
63175
+ * @memberOf Stack
63176
+ * @param {string} key The key of the value to get.
63177
+ * @returns {*} Returns the entry value.
63178
+ */
63179
+
63180
+ function stackGet$1(key) {
63181
+ return this.__data__.get(key);
63182
+ }
63183
+
63184
+ var _stackGet = stackGet$1;
63185
+
63186
+ /**
63187
+ * Checks if a stack value for `key` exists.
63188
+ *
63189
+ * @private
63190
+ * @name has
63191
+ * @memberOf Stack
63192
+ * @param {string} key The key of the entry to check.
63193
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
63194
+ */
63195
+
63196
+ function stackHas$1(key) {
63197
+ return this.__data__.has(key);
63198
+ }
63199
+
63200
+ var _stackHas = stackHas$1;
63201
+
63202
+ function isObject$3(value) {
63203
+ var type = _typeof(value);
63204
+
63205
+ return value != null && (type == 'object' || type == 'function');
63206
+ }
63207
+
63208
+ var isObject_1 = isObject$3;
63209
+
63210
+ var baseGetTag$3 = _baseGetTag,
63211
+ isObject$2 = isObject_1;
63212
+ /** `Object#toString` result references. */
63213
+
63214
+ var asyncTag = '[object AsyncFunction]',
63215
+ funcTag$1 = '[object Function]',
63216
+ genTag = '[object GeneratorFunction]',
63217
+ proxyTag = '[object Proxy]';
63218
+ /**
63219
+ * Checks if `value` is classified as a `Function` object.
63220
+ *
63221
+ * @static
63222
+ * @memberOf _
63223
+ * @since 0.1.0
63224
+ * @category Lang
63225
+ * @param {*} value The value to check.
63226
+ * @returns {boolean} Returns `true` if `value` is a function, else `false`.
63227
+ * @example
63228
+ *
63229
+ * _.isFunction(_);
63230
+ * // => true
63231
+ *
63232
+ * _.isFunction(/abc/);
63233
+ * // => false
63234
+ */
63235
+
63236
+ function isFunction$2(value) {
63237
+ if (!isObject$2(value)) {
63238
+ return false;
63239
+ } // The use of `Object#toString` avoids issues with the `typeof` operator
63240
+ // in Safari 9 which returns 'object' for typed arrays and other constructors.
63241
+
63242
+
63243
+ var tag = baseGetTag$3(value);
63244
+ return tag == funcTag$1 || tag == genTag || tag == asyncTag || tag == proxyTag;
63245
+ }
63246
+
63247
+ var isFunction_1 = isFunction$2;
63248
+
63249
+ var root$6 = _root;
63250
+ /** Used to detect overreaching core-js shims. */
63251
+
63252
+ var coreJsData$1 = root$6['__core-js_shared__'];
63253
+ var _coreJsData = coreJsData$1;
63254
+
63255
+ var coreJsData = _coreJsData;
63256
+ /** Used to detect methods masquerading as native. */
63257
+
63258
+ var maskSrcKey = function () {
63259
+ var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
63260
+ return uid ? 'Symbol(src)_1.' + uid : '';
62748
63261
  }();
62749
- /** Gets new endpoints from a user's secondaries */
63262
+ /**
63263
+ * Checks if `func` has its source masked.
63264
+ *
63265
+ * @private
63266
+ * @param {Function} func The function to check.
63267
+ * @returns {boolean} Returns `true` if `func` is masked, else `false`.
63268
+ */
62750
63269
 
62751
63270
 
62752
- var getNewPrimary = /*#__PURE__*/function () {
62753
- var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(libs, secondaries) {
62754
- var _iterator, _step, _libs$creatorNode, secondary, syncStatus;
63271
+ function isMasked$1(func) {
63272
+ return !!maskSrcKey && maskSrcKey in func;
63273
+ }
62755
63274
 
62756
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
62757
- while (1) {
62758
- switch (_context2.prev = _context2.next) {
62759
- case 0:
62760
- _iterator = _createForOfIteratorHelper(secondaries);
62761
- _context2.prev = 1;
63275
+ var _isMasked = isMasked$1;
62762
63276
 
62763
- _iterator.s();
63277
+ /** Used for built-in method references. */
63278
+ var funcProto$1 = Function.prototype;
63279
+ /** Used to resolve the decompiled source of functions. */
62764
63280
 
62765
- case 3:
62766
- if ((_step = _iterator.n()).done) {
62767
- _context2.next = 14;
62768
- break;
62769
- }
63281
+ var funcToString$1 = funcProto$1.toString;
63282
+ /**
63283
+ * Converts `func` to its source code.
63284
+ *
63285
+ * @private
63286
+ * @param {Function} func The function to convert.
63287
+ * @returns {string} Returns the source code.
63288
+ */
62770
63289
 
62771
- secondary = _step.value;
62772
- _context2.next = 7;
62773
- return (_libs$creatorNode = libs.creatorNode) === null || _libs$creatorNode === void 0 ? void 0 : _libs$creatorNode.getSyncStatus(secondary);
63290
+ function toSource$2(func) {
63291
+ if (func != null) {
63292
+ try {
63293
+ return funcToString$1.call(func);
63294
+ } catch (e) {}
62774
63295
 
62775
- case 7:
62776
- syncStatus = _context2.sent;
63296
+ try {
63297
+ return func + '';
63298
+ } catch (e) {}
63299
+ }
62777
63300
 
62778
- if (syncStatus) {
62779
- _context2.next = 10;
62780
- break;
62781
- }
63301
+ return '';
63302
+ }
62782
63303
 
62783
- return _context2.abrupt("continue", 12);
63304
+ var _toSource = toSource$2;
62784
63305
 
62785
- case 10:
62786
- if (syncStatus.isBehind) {
62787
- _context2.next = 12;
62788
- break;
62789
- }
63306
+ var isFunction$1 = isFunction_1,
63307
+ isMasked = _isMasked,
63308
+ isObject$1 = isObject_1,
63309
+ toSource$1 = _toSource;
63310
+ /**
63311
+ * Used to match `RegExp`
63312
+ * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
63313
+ */
62790
63314
 
62791
- return _context2.abrupt("return", secondary);
63315
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
63316
+ /** Used to detect host constructors (Safari). */
62792
63317
 
62793
- case 12:
62794
- _context2.next = 3;
62795
- break;
63318
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
63319
+ /** Used for built-in method references. */
62796
63320
 
62797
- case 14:
62798
- _context2.next = 19;
62799
- break;
63321
+ var funcProto = Function.prototype,
63322
+ objectProto$9 = Object.prototype;
63323
+ /** Used to resolve the decompiled source of functions. */
62800
63324
 
62801
- case 16:
62802
- _context2.prev = 16;
62803
- _context2.t0 = _context2["catch"](1);
63325
+ var funcToString = funcProto.toString;
63326
+ /** Used to check objects for own properties. */
62804
63327
 
62805
- _iterator.e(_context2.t0);
63328
+ var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
63329
+ /** Used to detect if a method is native. */
62806
63330
 
62807
- case 19:
62808
- _context2.prev = 19;
63331
+ var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty$7).replace(reRegExpChar, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
63332
+ /**
63333
+ * The base implementation of `_.isNative` without bad shim checks.
63334
+ *
63335
+ * @private
63336
+ * @param {*} value The value to check.
63337
+ * @returns {boolean} Returns `true` if `value` is a native function,
63338
+ * else `false`.
63339
+ */
62809
63340
 
62810
- _iterator.f();
63341
+ function baseIsNative$1(value) {
63342
+ if (!isObject$1(value) || isMasked(value)) {
63343
+ return false;
63344
+ }
62811
63345
 
62812
- return _context2.finish(19);
63346
+ var pattern = isFunction$1(value) ? reIsNative : reIsHostCtor;
63347
+ return pattern.test(toSource$1(value));
63348
+ }
62813
63349
 
62814
- case 22:
62815
- throw new Error("Could not find valid secondaries for user ".concat(secondaries));
63350
+ var _baseIsNative = baseIsNative$1;
62816
63351
 
62817
- case 23:
62818
- case "end":
62819
- return _context2.stop();
62820
- }
62821
- }
62822
- }, _callee2, null, [[1, 16, 19, 22]]);
62823
- }));
63352
+ /**
63353
+ * Gets the value at `key` of `object`.
63354
+ *
63355
+ * @private
63356
+ * @param {Object} [object] The object to query.
63357
+ * @param {string} key The key of the property to get.
63358
+ * @returns {*} Returns the property value.
63359
+ */
62824
63360
 
62825
- return function getNewPrimary(_x4, _x5) {
62826
- return _ref2.apply(this, arguments);
63361
+ function getValue$1(object, key) {
63362
+ return object == null ? undefined : object[key];
63363
+ }
63364
+
63365
+ var _getValue = getValue$1;
63366
+
63367
+ var baseIsNative = _baseIsNative,
63368
+ getValue = _getValue;
63369
+ /**
63370
+ * Gets the native function at `key` of `object`.
63371
+ *
63372
+ * @private
63373
+ * @param {Object} object The object to query.
63374
+ * @param {string} key The key of the method to get.
63375
+ * @returns {*} Returns the function if it's native, else `undefined`.
63376
+ */
63377
+
63378
+ function getNative$6(object, key) {
63379
+ var value = getValue(object, key);
63380
+ return baseIsNative(value) ? value : undefined;
63381
+ }
63382
+
63383
+ var _getNative = getNative$6;
63384
+
63385
+ var getNative$5 = _getNative,
63386
+ root$5 = _root;
63387
+ /* Built-in method references that are verified to be native. */
63388
+
63389
+ var Map$4 = getNative$5(root$5, 'Map');
63390
+ var _Map = Map$4;
63391
+
63392
+ var getNative$4 = _getNative;
63393
+ /* Built-in method references that are verified to be native. */
63394
+
63395
+ var nativeCreate$4 = getNative$4(Object, 'create');
63396
+ var _nativeCreate = nativeCreate$4;
63397
+
63398
+ var nativeCreate$3 = _nativeCreate;
63399
+ /**
63400
+ * Removes all key-value entries from the hash.
63401
+ *
63402
+ * @private
63403
+ * @name clear
63404
+ * @memberOf Hash
63405
+ */
63406
+
63407
+ function hashClear$1() {
63408
+ this.__data__ = nativeCreate$3 ? nativeCreate$3(null) : {};
63409
+ this.size = 0;
63410
+ }
63411
+
63412
+ var _hashClear = hashClear$1;
63413
+
63414
+ /**
63415
+ * Removes `key` and its value from the hash.
63416
+ *
63417
+ * @private
63418
+ * @name delete
63419
+ * @memberOf Hash
63420
+ * @param {Object} hash The hash to modify.
63421
+ * @param {string} key The key of the value to remove.
63422
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
63423
+ */
63424
+
63425
+ function hashDelete$1(key) {
63426
+ var result = this.has(key) && delete this.__data__[key];
63427
+ this.size -= result ? 1 : 0;
63428
+ return result;
63429
+ }
63430
+
63431
+ var _hashDelete = hashDelete$1;
63432
+
63433
+ var nativeCreate$2 = _nativeCreate;
63434
+ /** Used to stand-in for `undefined` hash values. */
63435
+
63436
+ var HASH_UNDEFINED$2 = '__lodash_hash_undefined__';
63437
+ /** Used for built-in method references. */
63438
+
63439
+ var objectProto$8 = Object.prototype;
63440
+ /** Used to check objects for own properties. */
63441
+
63442
+ var hasOwnProperty$6 = objectProto$8.hasOwnProperty;
63443
+ /**
63444
+ * Gets the hash value for `key`.
63445
+ *
63446
+ * @private
63447
+ * @name get
63448
+ * @memberOf Hash
63449
+ * @param {string} key The key of the value to get.
63450
+ * @returns {*} Returns the entry value.
63451
+ */
63452
+
63453
+ function hashGet$1(key) {
63454
+ var data = this.__data__;
63455
+
63456
+ if (nativeCreate$2) {
63457
+ var result = data[key];
63458
+ return result === HASH_UNDEFINED$2 ? undefined : result;
63459
+ }
63460
+
63461
+ return hasOwnProperty$6.call(data, key) ? data[key] : undefined;
63462
+ }
63463
+
63464
+ var _hashGet = hashGet$1;
63465
+
63466
+ var nativeCreate$1 = _nativeCreate;
63467
+ /** Used for built-in method references. */
63468
+
63469
+ var objectProto$7 = Object.prototype;
63470
+ /** Used to check objects for own properties. */
63471
+
63472
+ var hasOwnProperty$5 = objectProto$7.hasOwnProperty;
63473
+ /**
63474
+ * Checks if a hash value for `key` exists.
63475
+ *
63476
+ * @private
63477
+ * @name has
63478
+ * @memberOf Hash
63479
+ * @param {string} key The key of the entry to check.
63480
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
63481
+ */
63482
+
63483
+ function hashHas$1(key) {
63484
+ var data = this.__data__;
63485
+ return nativeCreate$1 ? data[key] !== undefined : hasOwnProperty$5.call(data, key);
63486
+ }
63487
+
63488
+ var _hashHas = hashHas$1;
63489
+
63490
+ var nativeCreate = _nativeCreate;
63491
+ /** Used to stand-in for `undefined` hash values. */
63492
+
63493
+ var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
63494
+ /**
63495
+ * Sets the hash `key` to `value`.
63496
+ *
63497
+ * @private
63498
+ * @name set
63499
+ * @memberOf Hash
63500
+ * @param {string} key The key of the value to set.
63501
+ * @param {*} value The value to set.
63502
+ * @returns {Object} Returns the hash instance.
63503
+ */
63504
+
63505
+ function hashSet$1(key, value) {
63506
+ var data = this.__data__;
63507
+ this.size += this.has(key) ? 0 : 1;
63508
+ data[key] = nativeCreate && value === undefined ? HASH_UNDEFINED$1 : value;
63509
+ return this;
63510
+ }
63511
+
63512
+ var _hashSet = hashSet$1;
63513
+
63514
+ var hashClear = _hashClear,
63515
+ hashDelete = _hashDelete,
63516
+ hashGet = _hashGet,
63517
+ hashHas = _hashHas,
63518
+ hashSet = _hashSet;
63519
+ /**
63520
+ * Creates a hash object.
63521
+ *
63522
+ * @private
63523
+ * @constructor
63524
+ * @param {Array} [entries] The key-value pairs to cache.
63525
+ */
63526
+
63527
+ function Hash$1(entries) {
63528
+ var index = -1,
63529
+ length = entries == null ? 0 : entries.length;
63530
+ this.clear();
63531
+
63532
+ while (++index < length) {
63533
+ var entry = entries[index];
63534
+ this.set(entry[0], entry[1]);
63535
+ }
63536
+ } // Add methods to `Hash`.
63537
+
63538
+
63539
+ Hash$1.prototype.clear = hashClear;
63540
+ Hash$1.prototype['delete'] = hashDelete;
63541
+ Hash$1.prototype.get = hashGet;
63542
+ Hash$1.prototype.has = hashHas;
63543
+ Hash$1.prototype.set = hashSet;
63544
+ var _Hash = Hash$1;
63545
+
63546
+ var Hash = _Hash,
63547
+ ListCache$2 = _ListCache,
63548
+ Map$3 = _Map;
63549
+ /**
63550
+ * Removes all key-value entries from the map.
63551
+ *
63552
+ * @private
63553
+ * @name clear
63554
+ * @memberOf MapCache
63555
+ */
63556
+
63557
+ function mapCacheClear$1() {
63558
+ this.size = 0;
63559
+ this.__data__ = {
63560
+ 'hash': new Hash(),
63561
+ 'map': new (Map$3 || ListCache$2)(),
63562
+ 'string': new Hash()
62827
63563
  };
62828
- }();
63564
+ }
62829
63565
 
62830
- var rolloverNodes = /*#__PURE__*/function () {
62831
- var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(libs, creatorNodeWhitelist, creatorNodeBlacklist) {
62832
- var _libs$userStateManage;
63566
+ var _mapCacheClear = mapCacheClear$1;
62833
63567
 
62834
- var user, primary, healthy, secondaries, _libs$ServiceProvider, _libs$User, _libs$User2, _libs$creatorNode2, _libs$User3, newPrimary, index, newSecondaries, autoselect, newEndpoints, newMetadata;
63568
+ function isKeyable$1(value) {
63569
+ var type = _typeof(value);
62835
63570
 
62836
- return regeneratorRuntime.wrap(function _callee3$(_context3) {
62837
- while (1) {
62838
- switch (_context3.prev = _context3.next) {
62839
- case 0:
62840
- console.debug('Sanity Check - rolloverNodes');
62841
- user = (_libs$userStateManage = libs.userStateManager) === null || _libs$userStateManage === void 0 ? void 0 : _libs$userStateManage.getCurrentUser();
63571
+ return type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean' ? value !== '__proto__' : value === null;
63572
+ }
62842
63573
 
62843
- if (user) {
62844
- _context3.next = 4;
62845
- break;
62846
- }
63574
+ var _isKeyable = isKeyable$1;
62847
63575
 
62848
- return _context3.abrupt("return");
63576
+ var isKeyable = _isKeyable;
63577
+ /**
63578
+ * Gets the data for `map`.
63579
+ *
63580
+ * @private
63581
+ * @param {Object} map The map to query.
63582
+ * @param {string} key The reference key.
63583
+ * @returns {*} Returns the map data.
63584
+ */
62849
63585
 
62850
- case 4:
62851
- primary = CreatorNode.getPrimary(user.creator_node_endpoint);
63586
+ function getMapData$4(map, key) {
63587
+ var data = map.__data__;
63588
+ return isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map;
63589
+ }
62852
63590
 
62853
- if (primary) {
62854
- _context3.next = 7;
62855
- break;
62856
- }
63591
+ var _getMapData = getMapData$4;
62857
63592
 
62858
- return _context3.abrupt("return");
63593
+ var getMapData$3 = _getMapData;
63594
+ /**
63595
+ * Removes `key` and its value from the map.
63596
+ *
63597
+ * @private
63598
+ * @name delete
63599
+ * @memberOf MapCache
63600
+ * @param {string} key The key of the value to remove.
63601
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
63602
+ */
62859
63603
 
62860
- case 7:
62861
- _context3.next = 9;
62862
- return checkPrimaryHealthy(libs, primary, MAX_TRIES);
63604
+ function mapCacheDelete$1(key) {
63605
+ var result = getMapData$3(this, key)['delete'](key);
63606
+ this.size -= result ? 1 : 0;
63607
+ return result;
63608
+ }
62863
63609
 
62864
- case 9:
62865
- healthy = _context3.sent;
63610
+ var _mapCacheDelete = mapCacheDelete$1;
62866
63611
 
62867
- if (!(healthy && !(creatorNodeBlacklist !== null && creatorNodeBlacklist !== void 0 && creatorNodeBlacklist.has(primary)))) {
62868
- _context3.next = 12;
62869
- break;
62870
- }
63612
+ var getMapData$2 = _getMapData;
63613
+ /**
63614
+ * Gets the map value for `key`.
63615
+ *
63616
+ * @private
63617
+ * @name get
63618
+ * @memberOf MapCache
63619
+ * @param {string} key The key of the value to get.
63620
+ * @returns {*} Returns the entry value.
63621
+ */
62871
63622
 
62872
- return _context3.abrupt("return");
63623
+ function mapCacheGet$1(key) {
63624
+ return getMapData$2(this, key).get(key);
63625
+ }
62873
63626
 
62874
- case 12:
62875
- secondaries = CreatorNode.getSecondaries(user.creator_node_endpoint);
62876
- _context3.prev = 13;
62877
- _context3.next = 16;
62878
- return getNewPrimary(libs, secondaries);
63627
+ var _mapCacheGet = mapCacheGet$1;
62879
63628
 
62880
- case 16:
62881
- newPrimary = _context3.sent;
62882
- index = secondaries.indexOf(newPrimary); // Get new secondaries and backfill up to 2
63629
+ var getMapData$1 = _getMapData;
63630
+ /**
63631
+ * Checks if a map value for `key` exists.
63632
+ *
63633
+ * @private
63634
+ * @name has
63635
+ * @memberOf MapCache
63636
+ * @param {string} key The key of the entry to check.
63637
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
63638
+ */
62883
63639
 
62884
- newSecondaries = _toConsumableArray(secondaries);
62885
- newSecondaries.splice(index, 1);
62886
- _context3.next = 22;
62887
- return (_libs$ServiceProvider = libs.ServiceProvider) === null || _libs$ServiceProvider === void 0 ? void 0 : _libs$ServiceProvider.autoSelectCreatorNodes({
62888
- numberOfNodes: 2 - newSecondaries.length,
62889
- whitelist: creatorNodeWhitelist,
62890
- // Exclude ones we currently have
62891
- blacklist: new Set([newPrimary].concat(_toConsumableArray(newSecondaries))),
62892
- preferHigherPatchForPrimary: (_libs$User = libs.User) === null || _libs$User === void 0 ? void 0 : _libs$User.preferHigherPatchForPrimary,
62893
- preferHigherPatchForSecondaries: (_libs$User2 = libs.User) === null || _libs$User2 === void 0 ? void 0 : _libs$User2.preferHigherPatchForSecondaries
62894
- });
63640
+ function mapCacheHas$1(key) {
63641
+ return getMapData$1(this, key).has(key);
63642
+ }
62895
63643
 
62896
- case 22:
62897
- autoselect = _context3.sent;
63644
+ var _mapCacheHas = mapCacheHas$1;
62898
63645
 
62899
- if (autoselect) {
62900
- newSecondaries = newSecondaries.concat([autoselect.primary].concat(_toConsumableArray(autoselect.secondaries)));
62901
- } // Set the new endpoint and connect to it
63646
+ var getMapData = _getMapData;
63647
+ /**
63648
+ * Sets the map `key` to `value`.
63649
+ *
63650
+ * @private
63651
+ * @name set
63652
+ * @memberOf MapCache
63653
+ * @param {string} key The key of the value to set.
63654
+ * @param {*} value The value to set.
63655
+ * @returns {Object} Returns the map cache instance.
63656
+ */
62902
63657
 
63658
+ function mapCacheSet$1(key, value) {
63659
+ var data = getMapData(this, key),
63660
+ size = data.size;
63661
+ data.set(key, value);
63662
+ this.size += data.size == size ? 0 : 1;
63663
+ return this;
63664
+ }
62903
63665
 
62904
- newEndpoints = [newPrimary].concat(_toConsumableArray(newSecondaries));
62905
- _context3.next = 27;
62906
- return (_libs$creatorNode2 = libs.creatorNode) === null || _libs$creatorNode2 === void 0 ? void 0 : _libs$creatorNode2.setEndpoint(newEndpoints[0]);
63666
+ var _mapCacheSet = mapCacheSet$1;
62907
63667
 
62908
- case 27:
62909
- // Update the user
62910
- newMetadata = _objectSpread2({}, user);
62911
- newMetadata.creator_node_endpoint = newEndpoints.join(',');
62912
- console.debug("Sanity Check - rolloverNodes - new nodes ".concat(newMetadata.creator_node_endpoint));
62913
- _context3.next = 32;
62914
- return (_libs$User3 = libs.User) === null || _libs$User3 === void 0 ? void 0 : _libs$User3.updateCreator(user.user_id, newMetadata);
63668
+ var mapCacheClear = _mapCacheClear,
63669
+ mapCacheDelete = _mapCacheDelete,
63670
+ mapCacheGet = _mapCacheGet,
63671
+ mapCacheHas = _mapCacheHas,
63672
+ mapCacheSet = _mapCacheSet;
63673
+ /**
63674
+ * Creates a map cache object to store key-value pairs.
63675
+ *
63676
+ * @private
63677
+ * @constructor
63678
+ * @param {Array} [entries] The key-value pairs to cache.
63679
+ */
62915
63680
 
62916
- case 32:
62917
- _context3.next = 37;
62918
- break;
63681
+ function MapCache$3(entries) {
63682
+ var index = -1,
63683
+ length = entries == null ? 0 : entries.length;
63684
+ this.clear();
62919
63685
 
62920
- case 34:
62921
- _context3.prev = 34;
62922
- _context3.t0 = _context3["catch"](13);
62923
- console.error(_context3.t0);
63686
+ while (++index < length) {
63687
+ var entry = entries[index];
63688
+ this.set(entry[0], entry[1]);
63689
+ }
63690
+ } // Add methods to `MapCache`.
62924
63691
 
62925
- case 37:
62926
- case "end":
62927
- return _context3.stop();
62928
- }
62929
- }
62930
- }, _callee3, null, [[13, 34]]);
62931
- }));
62932
63692
 
62933
- return function rolloverNodes(_x6, _x7, _x8) {
62934
- return _ref3.apply(this, arguments);
63693
+ MapCache$3.prototype.clear = mapCacheClear;
63694
+ MapCache$3.prototype['delete'] = mapCacheDelete;
63695
+ MapCache$3.prototype.get = mapCacheGet;
63696
+ MapCache$3.prototype.has = mapCacheHas;
63697
+ MapCache$3.prototype.set = mapCacheSet;
63698
+ var _MapCache = MapCache$3;
63699
+
63700
+ var ListCache$1 = _ListCache,
63701
+ Map$2 = _Map,
63702
+ MapCache$2 = _MapCache;
63703
+ /** Used as the size to enable large array optimizations. */
63704
+
63705
+ var LARGE_ARRAY_SIZE = 200;
63706
+ /**
63707
+ * Sets the stack `key` to `value`.
63708
+ *
63709
+ * @private
63710
+ * @name set
63711
+ * @memberOf Stack
63712
+ * @param {string} key The key of the value to set.
63713
+ * @param {*} value The value to set.
63714
+ * @returns {Object} Returns the stack cache instance.
63715
+ */
63716
+
63717
+ function stackSet$1(key, value) {
63718
+ var data = this.__data__;
63719
+
63720
+ if (data instanceof ListCache$1) {
63721
+ var pairs = data.__data__;
63722
+
63723
+ if (!Map$2 || pairs.length < LARGE_ARRAY_SIZE - 1) {
63724
+ pairs.push([key, value]);
63725
+ this.size = ++data.size;
63726
+ return this;
63727
+ }
63728
+
63729
+ data = this.__data__ = new MapCache$2(pairs);
63730
+ }
63731
+
63732
+ data.set(key, value);
63733
+ this.size = data.size;
63734
+ return this;
63735
+ }
63736
+
63737
+ var _stackSet = stackSet$1;
63738
+
63739
+ var ListCache = _ListCache,
63740
+ stackClear = _stackClear,
63741
+ stackDelete = _stackDelete,
63742
+ stackGet = _stackGet,
63743
+ stackHas = _stackHas,
63744
+ stackSet = _stackSet;
63745
+ /**
63746
+ * Creates a stack cache object to store key-value pairs.
63747
+ *
63748
+ * @private
63749
+ * @constructor
63750
+ * @param {Array} [entries] The key-value pairs to cache.
63751
+ */
63752
+
63753
+ function Stack$2(entries) {
63754
+ var data = this.__data__ = new ListCache(entries);
63755
+ this.size = data.size;
63756
+ } // Add methods to `Stack`.
63757
+
63758
+
63759
+ Stack$2.prototype.clear = stackClear;
63760
+ Stack$2.prototype['delete'] = stackDelete;
63761
+ Stack$2.prototype.get = stackGet;
63762
+ Stack$2.prototype.has = stackHas;
63763
+ Stack$2.prototype.set = stackSet;
63764
+ var _Stack = Stack$2;
63765
+
63766
+ /** Used to stand-in for `undefined` hash values. */
63767
+ var HASH_UNDEFINED = '__lodash_hash_undefined__';
63768
+ /**
63769
+ * Adds `value` to the array cache.
63770
+ *
63771
+ * @private
63772
+ * @name add
63773
+ * @memberOf SetCache
63774
+ * @alias push
63775
+ * @param {*} value The value to cache.
63776
+ * @returns {Object} Returns the cache instance.
63777
+ */
63778
+
63779
+ function setCacheAdd$1(value) {
63780
+ this.__data__.set(value, HASH_UNDEFINED);
63781
+
63782
+ return this;
63783
+ }
63784
+
63785
+ var _setCacheAdd = setCacheAdd$1;
63786
+
63787
+ /**
63788
+ * Checks if `value` is in the array cache.
63789
+ *
63790
+ * @private
63791
+ * @name has
63792
+ * @memberOf SetCache
63793
+ * @param {*} value The value to search for.
63794
+ * @returns {number} Returns `true` if `value` is found, else `false`.
63795
+ */
63796
+
63797
+ function setCacheHas$1(value) {
63798
+ return this.__data__.has(value);
63799
+ }
63800
+
63801
+ var _setCacheHas = setCacheHas$1;
63802
+
63803
+ var MapCache$1 = _MapCache,
63804
+ setCacheAdd = _setCacheAdd,
63805
+ setCacheHas = _setCacheHas;
63806
+ /**
63807
+ *
63808
+ * Creates an array cache object to store unique values.
63809
+ *
63810
+ * @private
63811
+ * @constructor
63812
+ * @param {Array} [values] The values to cache.
63813
+ */
63814
+
63815
+ function SetCache$1(values) {
63816
+ var index = -1,
63817
+ length = values == null ? 0 : values.length;
63818
+ this.__data__ = new MapCache$1();
63819
+
63820
+ while (++index < length) {
63821
+ this.add(values[index]);
63822
+ }
63823
+ } // Add methods to `SetCache`.
63824
+
63825
+
63826
+ SetCache$1.prototype.add = SetCache$1.prototype.push = setCacheAdd;
63827
+ SetCache$1.prototype.has = setCacheHas;
63828
+ var _SetCache = SetCache$1;
63829
+
63830
+ /**
63831
+ * A specialized version of `_.some` for arrays without support for iteratee
63832
+ * shorthands.
63833
+ *
63834
+ * @private
63835
+ * @param {Array} [array] The array to iterate over.
63836
+ * @param {Function} predicate The function invoked per iteration.
63837
+ * @returns {boolean} Returns `true` if any element passes the predicate check,
63838
+ * else `false`.
63839
+ */
63840
+
63841
+ function arraySome$1(array, predicate) {
63842
+ var index = -1,
63843
+ length = array == null ? 0 : array.length;
63844
+
63845
+ while (++index < length) {
63846
+ if (predicate(array[index], index, array)) {
63847
+ return true;
63848
+ }
63849
+ }
63850
+
63851
+ return false;
63852
+ }
63853
+
63854
+ var _arraySome = arraySome$1;
63855
+
63856
+ /**
63857
+ * Checks if a `cache` value for `key` exists.
63858
+ *
63859
+ * @private
63860
+ * @param {Object} cache The cache to query.
63861
+ * @param {string} key The key of the entry to check.
63862
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
63863
+ */
63864
+
63865
+ function cacheHas$1(cache, key) {
63866
+ return cache.has(key);
63867
+ }
63868
+
63869
+ var _cacheHas = cacheHas$1;
63870
+
63871
+ var SetCache = _SetCache,
63872
+ arraySome = _arraySome,
63873
+ cacheHas = _cacheHas;
63874
+ /** Used to compose bitmasks for value comparisons. */
63875
+
63876
+ var COMPARE_PARTIAL_FLAG$5 = 1,
63877
+ COMPARE_UNORDERED_FLAG$3 = 2;
63878
+ /**
63879
+ * A specialized version of `baseIsEqualDeep` for arrays with support for
63880
+ * partial deep comparisons.
63881
+ *
63882
+ * @private
63883
+ * @param {Array} array The array to compare.
63884
+ * @param {Array} other The other array to compare.
63885
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
63886
+ * @param {Function} customizer The function to customize comparisons.
63887
+ * @param {Function} equalFunc The function to determine equivalents of values.
63888
+ * @param {Object} stack Tracks traversed `array` and `other` objects.
63889
+ * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
63890
+ */
63891
+
63892
+ function equalArrays$2(array, other, bitmask, customizer, equalFunc, stack) {
63893
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG$5,
63894
+ arrLength = array.length,
63895
+ othLength = other.length;
63896
+
63897
+ if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
63898
+ return false;
63899
+ } // Check that cyclic values are equal.
63900
+
63901
+
63902
+ var arrStacked = stack.get(array);
63903
+ var othStacked = stack.get(other);
63904
+
63905
+ if (arrStacked && othStacked) {
63906
+ return arrStacked == other && othStacked == array;
63907
+ }
63908
+
63909
+ var index = -1,
63910
+ result = true,
63911
+ seen = bitmask & COMPARE_UNORDERED_FLAG$3 ? new SetCache() : undefined;
63912
+ stack.set(array, other);
63913
+ stack.set(other, array); // Ignore non-index properties.
63914
+
63915
+ while (++index < arrLength) {
63916
+ var arrValue = array[index],
63917
+ othValue = other[index];
63918
+
63919
+ if (customizer) {
63920
+ var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
63921
+ }
63922
+
63923
+ if (compared !== undefined) {
63924
+ if (compared) {
63925
+ continue;
63926
+ }
63927
+
63928
+ result = false;
63929
+ break;
63930
+ } // Recursively compare arrays (susceptible to call stack limits).
63931
+
63932
+
63933
+ if (seen) {
63934
+ if (!arraySome(other, function (othValue, othIndex) {
63935
+ if (!cacheHas(seen, othIndex) && (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
63936
+ return seen.push(othIndex);
63937
+ }
63938
+ })) {
63939
+ result = false;
63940
+ break;
63941
+ }
63942
+ } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
63943
+ result = false;
63944
+ break;
63945
+ }
63946
+ }
63947
+
63948
+ stack['delete'](array);
63949
+ stack['delete'](other);
63950
+ return result;
63951
+ }
63952
+
63953
+ var _equalArrays = equalArrays$2;
63954
+
63955
+ var root$4 = _root;
63956
+ /** Built-in value references. */
63957
+
63958
+ var Uint8Array$2 = root$4.Uint8Array;
63959
+ var _Uint8Array = Uint8Array$2;
63960
+
63961
+ /**
63962
+ * Converts `map` to its key-value pairs.
63963
+ *
63964
+ * @private
63965
+ * @param {Object} map The map to convert.
63966
+ * @returns {Array} Returns the key-value pairs.
63967
+ */
63968
+
63969
+ function mapToArray$1(map) {
63970
+ var index = -1,
63971
+ result = Array(map.size);
63972
+ map.forEach(function (value, key) {
63973
+ result[++index] = [key, value];
63974
+ });
63975
+ return result;
63976
+ }
63977
+
63978
+ var _mapToArray = mapToArray$1;
63979
+
63980
+ /**
63981
+ * Converts `set` to an array of its values.
63982
+ *
63983
+ * @private
63984
+ * @param {Object} set The set to convert.
63985
+ * @returns {Array} Returns the values.
63986
+ */
63987
+
63988
+ function setToArray$1(set) {
63989
+ var index = -1,
63990
+ result = Array(set.size);
63991
+ set.forEach(function (value) {
63992
+ result[++index] = value;
63993
+ });
63994
+ return result;
63995
+ }
63996
+
63997
+ var _setToArray = setToArray$1;
63998
+
63999
+ var _Symbol$1 = _Symbol$4,
64000
+ Uint8Array$1 = _Uint8Array,
64001
+ eq = eq_1,
64002
+ equalArrays$1 = _equalArrays,
64003
+ mapToArray = _mapToArray,
64004
+ setToArray = _setToArray;
64005
+ /** Used to compose bitmasks for value comparisons. */
64006
+
64007
+ var COMPARE_PARTIAL_FLAG$4 = 1,
64008
+ COMPARE_UNORDERED_FLAG$2 = 2;
64009
+ /** `Object#toString` result references. */
64010
+
64011
+ var boolTag$1 = '[object Boolean]',
64012
+ dateTag$1 = '[object Date]',
64013
+ errorTag$1 = '[object Error]',
64014
+ mapTag$2 = '[object Map]',
64015
+ numberTag$1 = '[object Number]',
64016
+ regexpTag$1 = '[object RegExp]',
64017
+ setTag$2 = '[object Set]',
64018
+ stringTag$1 = '[object String]',
64019
+ symbolTag = '[object Symbol]';
64020
+ var arrayBufferTag$1 = '[object ArrayBuffer]',
64021
+ dataViewTag$2 = '[object DataView]';
64022
+ /** Used to convert symbols to primitives and strings. */
64023
+
64024
+ var symbolProto$1 = _Symbol$1 ? _Symbol$1.prototype : undefined,
64025
+ symbolValueOf = symbolProto$1 ? symbolProto$1.valueOf : undefined;
64026
+ /**
64027
+ * A specialized version of `baseIsEqualDeep` for comparing objects of
64028
+ * the same `toStringTag`.
64029
+ *
64030
+ * **Note:** This function only supports comparing values with tags of
64031
+ * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
64032
+ *
64033
+ * @private
64034
+ * @param {Object} object The object to compare.
64035
+ * @param {Object} other The other object to compare.
64036
+ * @param {string} tag The `toStringTag` of the objects to compare.
64037
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
64038
+ * @param {Function} customizer The function to customize comparisons.
64039
+ * @param {Function} equalFunc The function to determine equivalents of values.
64040
+ * @param {Object} stack Tracks traversed `object` and `other` objects.
64041
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
64042
+ */
64043
+
64044
+ function equalByTag$1(object, other, tag, bitmask, customizer, equalFunc, stack) {
64045
+ switch (tag) {
64046
+ case dataViewTag$2:
64047
+ if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
64048
+ return false;
64049
+ }
64050
+
64051
+ object = object.buffer;
64052
+ other = other.buffer;
64053
+
64054
+ case arrayBufferTag$1:
64055
+ if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array$1(object), new Uint8Array$1(other))) {
64056
+ return false;
64057
+ }
64058
+
64059
+ return true;
64060
+
64061
+ case boolTag$1:
64062
+ case dateTag$1:
64063
+ case numberTag$1:
64064
+ // Coerce booleans to `1` or `0` and dates to milliseconds.
64065
+ // Invalid dates are coerced to `NaN`.
64066
+ return eq(+object, +other);
64067
+
64068
+ case errorTag$1:
64069
+ return object.name == other.name && object.message == other.message;
64070
+
64071
+ case regexpTag$1:
64072
+ case stringTag$1:
64073
+ // Coerce regexes to strings and treat strings, primitives and objects,
64074
+ // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
64075
+ // for more details.
64076
+ return object == other + '';
64077
+
64078
+ case mapTag$2:
64079
+ var convert = mapToArray;
64080
+
64081
+ case setTag$2:
64082
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG$4;
64083
+ convert || (convert = setToArray);
64084
+
64085
+ if (object.size != other.size && !isPartial) {
64086
+ return false;
64087
+ } // Assume cyclic values are equal.
64088
+
64089
+
64090
+ var stacked = stack.get(object);
64091
+
64092
+ if (stacked) {
64093
+ return stacked == other;
64094
+ }
64095
+
64096
+ bitmask |= COMPARE_UNORDERED_FLAG$2; // Recursively compare objects (susceptible to call stack limits).
64097
+
64098
+ stack.set(object, other);
64099
+ var result = equalArrays$1(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
64100
+ stack['delete'](object);
64101
+ return result;
64102
+
64103
+ case symbolTag:
64104
+ if (symbolValueOf) {
64105
+ return symbolValueOf.call(object) == symbolValueOf.call(other);
64106
+ }
64107
+
64108
+ }
64109
+
64110
+ return false;
64111
+ }
64112
+
64113
+ var _equalByTag = equalByTag$1;
64114
+
64115
+ /**
64116
+ * Appends the elements of `values` to `array`.
64117
+ *
64118
+ * @private
64119
+ * @param {Array} array The array to modify.
64120
+ * @param {Array} values The values to append.
64121
+ * @returns {Array} Returns `array`.
64122
+ */
64123
+
64124
+ function arrayPush$1(array, values) {
64125
+ var index = -1,
64126
+ length = values.length,
64127
+ offset = array.length;
64128
+
64129
+ while (++index < length) {
64130
+ array[offset + index] = values[index];
64131
+ }
64132
+
64133
+ return array;
64134
+ }
64135
+
64136
+ var _arrayPush = arrayPush$1;
64137
+
64138
+ /**
64139
+ * Checks if `value` is classified as an `Array` object.
64140
+ *
64141
+ * @static
64142
+ * @memberOf _
64143
+ * @since 0.1.0
64144
+ * @category Lang
64145
+ * @param {*} value The value to check.
64146
+ * @returns {boolean} Returns `true` if `value` is an array, else `false`.
64147
+ * @example
64148
+ *
64149
+ * _.isArray([1, 2, 3]);
64150
+ * // => true
64151
+ *
64152
+ * _.isArray(document.body.children);
64153
+ * // => false
64154
+ *
64155
+ * _.isArray('abc');
64156
+ * // => false
64157
+ *
64158
+ * _.isArray(_.noop);
64159
+ * // => false
64160
+ */
64161
+ var isArray$8 = Array.isArray;
64162
+ var isArray_1 = isArray$8;
64163
+
64164
+ var arrayPush = _arrayPush,
64165
+ isArray$7 = isArray_1;
64166
+ /**
64167
+ * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
64168
+ * `keysFunc` and `symbolsFunc` to get the enumerable property names and
64169
+ * symbols of `object`.
64170
+ *
64171
+ * @private
64172
+ * @param {Object} object The object to query.
64173
+ * @param {Function} keysFunc The function to get the keys of `object`.
64174
+ * @param {Function} symbolsFunc The function to get the symbols of `object`.
64175
+ * @returns {Array} Returns the array of property names and symbols.
64176
+ */
64177
+
64178
+ function baseGetAllKeys$1(object, keysFunc, symbolsFunc) {
64179
+ var result = keysFunc(object);
64180
+ return isArray$7(object) ? result : arrayPush(result, symbolsFunc(object));
64181
+ }
64182
+
64183
+ var _baseGetAllKeys = baseGetAllKeys$1;
64184
+
64185
+ /**
64186
+ * A specialized version of `_.filter` for arrays without support for
64187
+ * iteratee shorthands.
64188
+ *
64189
+ * @private
64190
+ * @param {Array} [array] The array to iterate over.
64191
+ * @param {Function} predicate The function invoked per iteration.
64192
+ * @returns {Array} Returns the new filtered array.
64193
+ */
64194
+
64195
+ function arrayFilter$1(array, predicate) {
64196
+ var index = -1,
64197
+ length = array == null ? 0 : array.length,
64198
+ resIndex = 0,
64199
+ result = [];
64200
+
64201
+ while (++index < length) {
64202
+ var value = array[index];
64203
+
64204
+ if (predicate(value, index, array)) {
64205
+ result[resIndex++] = value;
64206
+ }
64207
+ }
64208
+
64209
+ return result;
64210
+ }
64211
+
64212
+ var _arrayFilter = arrayFilter$1;
64213
+
64214
+ /**
64215
+ * This method returns a new empty array.
64216
+ *
64217
+ * @static
64218
+ * @memberOf _
64219
+ * @since 4.13.0
64220
+ * @category Util
64221
+ * @returns {Array} Returns the new empty array.
64222
+ * @example
64223
+ *
64224
+ * var arrays = _.times(2, _.stubArray);
64225
+ *
64226
+ * console.log(arrays);
64227
+ * // => [[], []]
64228
+ *
64229
+ * console.log(arrays[0] === arrays[1]);
64230
+ * // => false
64231
+ */
64232
+
64233
+ function stubArray$1() {
64234
+ return [];
64235
+ }
64236
+
64237
+ var stubArray_1 = stubArray$1;
64238
+
64239
+ var arrayFilter = _arrayFilter,
64240
+ stubArray = stubArray_1;
64241
+ /** Used for built-in method references. */
64242
+
64243
+ var objectProto$6 = Object.prototype;
64244
+ /** Built-in value references. */
64245
+
64246
+ var propertyIsEnumerable$1 = objectProto$6.propertyIsEnumerable;
64247
+ /* Built-in method references for those with the same name as other `lodash` methods. */
64248
+
64249
+ var nativeGetSymbols = Object.getOwnPropertySymbols;
64250
+ /**
64251
+ * Creates an array of the own enumerable symbols of `object`.
64252
+ *
64253
+ * @private
64254
+ * @param {Object} object The object to query.
64255
+ * @returns {Array} Returns the array of symbols.
64256
+ */
64257
+
64258
+ var getSymbols$1 = !nativeGetSymbols ? stubArray : function (object) {
64259
+ if (object == null) {
64260
+ return [];
64261
+ }
64262
+
64263
+ object = Object(object);
64264
+ return arrayFilter(nativeGetSymbols(object), function (symbol) {
64265
+ return propertyIsEnumerable$1.call(object, symbol);
64266
+ });
64267
+ };
64268
+ var _getSymbols = getSymbols$1;
64269
+
64270
+ /**
64271
+ * The base implementation of `_.times` without support for iteratee shorthands
64272
+ * or max array length checks.
64273
+ *
64274
+ * @private
64275
+ * @param {number} n The number of times to invoke `iteratee`.
64276
+ * @param {Function} iteratee The function invoked per iteration.
64277
+ * @returns {Array} Returns the array of results.
64278
+ */
64279
+
64280
+ function baseTimes$1(n, iteratee) {
64281
+ var index = -1,
64282
+ result = Array(n);
64283
+
64284
+ while (++index < n) {
64285
+ result[index] = iteratee(index);
64286
+ }
64287
+
64288
+ return result;
64289
+ }
64290
+
64291
+ var _baseTimes = baseTimes$1;
64292
+
64293
+ var baseGetTag$2 = _baseGetTag,
64294
+ isObjectLike$3 = isObjectLike_1;
64295
+ /** `Object#toString` result references. */
64296
+
64297
+ var argsTag$2 = '[object Arguments]';
64298
+ /**
64299
+ * The base implementation of `_.isArguments`.
64300
+ *
64301
+ * @private
64302
+ * @param {*} value The value to check.
64303
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
64304
+ */
64305
+
64306
+ function baseIsArguments$1(value) {
64307
+ return isObjectLike$3(value) && baseGetTag$2(value) == argsTag$2;
64308
+ }
64309
+
64310
+ var _baseIsArguments = baseIsArguments$1;
64311
+
64312
+ var baseIsArguments = _baseIsArguments,
64313
+ isObjectLike$2 = isObjectLike_1;
64314
+ /** Used for built-in method references. */
64315
+
64316
+ var objectProto$5 = Object.prototype;
64317
+ /** Used to check objects for own properties. */
64318
+
64319
+ var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
64320
+ /** Built-in value references. */
64321
+
64322
+ var propertyIsEnumerable = objectProto$5.propertyIsEnumerable;
64323
+ /**
64324
+ * Checks if `value` is likely an `arguments` object.
64325
+ *
64326
+ * @static
64327
+ * @memberOf _
64328
+ * @since 0.1.0
64329
+ * @category Lang
64330
+ * @param {*} value The value to check.
64331
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
64332
+ * else `false`.
64333
+ * @example
64334
+ *
64335
+ * _.isArguments(function() { return arguments; }());
64336
+ * // => true
64337
+ *
64338
+ * _.isArguments([1, 2, 3]);
64339
+ * // => false
64340
+ */
64341
+
64342
+ var isArguments$2 = baseIsArguments(function () {
64343
+ return arguments;
64344
+ }()) ? baseIsArguments : function (value) {
64345
+ return isObjectLike$2(value) && hasOwnProperty$4.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee');
64346
+ };
64347
+ var isArguments_1 = isArguments$2;
64348
+
64349
+ var isBuffer$2 = {exports: {}};
64350
+
64351
+ /**
64352
+ * This method returns `false`.
64353
+ *
64354
+ * @static
64355
+ * @memberOf _
64356
+ * @since 4.13.0
64357
+ * @category Util
64358
+ * @returns {boolean} Returns `false`.
64359
+ * @example
64360
+ *
64361
+ * _.times(2, _.stubFalse);
64362
+ * // => [false, false]
64363
+ */
64364
+
64365
+ function stubFalse() {
64366
+ return false;
64367
+ }
64368
+
64369
+ var stubFalse_1 = stubFalse;
64370
+
64371
+ (function (module, exports) {
64372
+ var root = _root,
64373
+ stubFalse = stubFalse_1;
64374
+ /** Detect free variable `exports`. */
64375
+
64376
+ var freeExports = exports && !exports.nodeType && exports;
64377
+ /** Detect free variable `module`. */
64378
+
64379
+ var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
64380
+ /** Detect the popular CommonJS extension `module.exports`. */
64381
+
64382
+ var moduleExports = freeModule && freeModule.exports === freeExports;
64383
+ /** Built-in value references. */
64384
+
64385
+ var Buffer = moduleExports ? root.Buffer : undefined;
64386
+ /* Built-in method references for those with the same name as other `lodash` methods. */
64387
+
64388
+ var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
64389
+ /**
64390
+ * Checks if `value` is a buffer.
64391
+ *
64392
+ * @static
64393
+ * @memberOf _
64394
+ * @since 4.3.0
64395
+ * @category Lang
64396
+ * @param {*} value The value to check.
64397
+ * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
64398
+ * @example
64399
+ *
64400
+ * _.isBuffer(new Buffer(2));
64401
+ * // => true
64402
+ *
64403
+ * _.isBuffer(new Uint8Array(2));
64404
+ * // => false
64405
+ */
64406
+
64407
+ var isBuffer = nativeIsBuffer || stubFalse;
64408
+ module.exports = isBuffer;
64409
+ })(isBuffer$2, isBuffer$2.exports);
64410
+
64411
+ var MAX_SAFE_INTEGER$1 = 9007199254740991;
64412
+ /** Used to detect unsigned integer values. */
64413
+
64414
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
64415
+ /**
64416
+ * Checks if `value` is a valid array-like index.
64417
+ *
64418
+ * @private
64419
+ * @param {*} value The value to check.
64420
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
64421
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
64422
+ */
64423
+
64424
+ function isIndex$2(value, length) {
64425
+ var type = _typeof(value);
64426
+
64427
+ length = length == null ? MAX_SAFE_INTEGER$1 : length;
64428
+ return !!length && (type == 'number' || type != 'symbol' && reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
64429
+ }
64430
+
64431
+ var _isIndex = isIndex$2;
64432
+
64433
+ /** Used as references for various `Number` constants. */
64434
+ var MAX_SAFE_INTEGER = 9007199254740991;
64435
+ /**
64436
+ * Checks if `value` is a valid array-like length.
64437
+ *
64438
+ * **Note:** This method is loosely based on
64439
+ * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
64440
+ *
64441
+ * @static
64442
+ * @memberOf _
64443
+ * @since 4.0.0
64444
+ * @category Lang
64445
+ * @param {*} value The value to check.
64446
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
64447
+ * @example
64448
+ *
64449
+ * _.isLength(3);
64450
+ * // => true
64451
+ *
64452
+ * _.isLength(Number.MIN_VALUE);
64453
+ * // => false
64454
+ *
64455
+ * _.isLength(Infinity);
64456
+ * // => false
64457
+ *
64458
+ * _.isLength('3');
64459
+ * // => false
64460
+ */
64461
+
64462
+ function isLength$3(value) {
64463
+ return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
64464
+ }
64465
+
64466
+ var isLength_1 = isLength$3;
64467
+
64468
+ var baseGetTag$1 = _baseGetTag,
64469
+ isLength$2 = isLength_1,
64470
+ isObjectLike$1 = isObjectLike_1;
64471
+ /** `Object#toString` result references. */
64472
+
64473
+ var argsTag$1 = '[object Arguments]',
64474
+ arrayTag$1 = '[object Array]',
64475
+ boolTag = '[object Boolean]',
64476
+ dateTag = '[object Date]',
64477
+ errorTag = '[object Error]',
64478
+ funcTag = '[object Function]',
64479
+ mapTag$1 = '[object Map]',
64480
+ numberTag = '[object Number]',
64481
+ objectTag$2 = '[object Object]',
64482
+ regexpTag = '[object RegExp]',
64483
+ setTag$1 = '[object Set]',
64484
+ stringTag = '[object String]',
64485
+ weakMapTag$1 = '[object WeakMap]';
64486
+ var arrayBufferTag = '[object ArrayBuffer]',
64487
+ dataViewTag$1 = '[object DataView]',
64488
+ float32Tag = '[object Float32Array]',
64489
+ float64Tag = '[object Float64Array]',
64490
+ int8Tag = '[object Int8Array]',
64491
+ int16Tag = '[object Int16Array]',
64492
+ int32Tag = '[object Int32Array]',
64493
+ uint8Tag = '[object Uint8Array]',
64494
+ uint8ClampedTag = '[object Uint8ClampedArray]',
64495
+ uint16Tag = '[object Uint16Array]',
64496
+ uint32Tag = '[object Uint32Array]';
64497
+ /** Used to identify `toStringTag` values of typed arrays. */
64498
+
64499
+ var typedArrayTags = {};
64500
+ typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
64501
+ typedArrayTags[argsTag$1] = typedArrayTags[arrayTag$1] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag$1] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag$1] = typedArrayTags[numberTag] = typedArrayTags[objectTag$2] = typedArrayTags[regexpTag] = typedArrayTags[setTag$1] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag$1] = false;
64502
+ /**
64503
+ * The base implementation of `_.isTypedArray` without Node.js optimizations.
64504
+ *
64505
+ * @private
64506
+ * @param {*} value The value to check.
64507
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
64508
+ */
64509
+
64510
+ function baseIsTypedArray$1(value) {
64511
+ return isObjectLike$1(value) && isLength$2(value.length) && !!typedArrayTags[baseGetTag$1(value)];
64512
+ }
64513
+
64514
+ var _baseIsTypedArray = baseIsTypedArray$1;
64515
+
64516
+ /**
64517
+ * The base implementation of `_.unary` without support for storing metadata.
64518
+ *
64519
+ * @private
64520
+ * @param {Function} func The function to cap arguments for.
64521
+ * @returns {Function} Returns the new capped function.
64522
+ */
64523
+
64524
+ function baseUnary$1(func) {
64525
+ return function (value) {
64526
+ return func(value);
64527
+ };
64528
+ }
64529
+
64530
+ var _baseUnary = baseUnary$1;
64531
+
64532
+ var _nodeUtil = {exports: {}};
64533
+
64534
+ (function (module, exports) {
64535
+ var freeGlobal = _freeGlobal;
64536
+ /** Detect free variable `exports`. */
64537
+
64538
+ var freeExports = exports && !exports.nodeType && exports;
64539
+ /** Detect free variable `module`. */
64540
+
64541
+ var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
64542
+ /** Detect the popular CommonJS extension `module.exports`. */
64543
+
64544
+ var moduleExports = freeModule && freeModule.exports === freeExports;
64545
+ /** Detect free variable `process` from Node.js. */
64546
+
64547
+ var freeProcess = moduleExports && freeGlobal.process;
64548
+ /** Used to access faster Node.js helpers. */
64549
+
64550
+ var nodeUtil = function () {
64551
+ try {
64552
+ // Use `util.types` for Node.js 10+.
64553
+ var types = freeModule && freeModule.require && freeModule.require('util').types;
64554
+
64555
+ if (types) {
64556
+ return types;
64557
+ } // Legacy `process.binding('util')` for Node.js < 10.
64558
+
64559
+
64560
+ return freeProcess && freeProcess.binding && freeProcess.binding('util');
64561
+ } catch (e) {}
64562
+ }();
64563
+
64564
+ module.exports = nodeUtil;
64565
+ })(_nodeUtil, _nodeUtil.exports);
64566
+
64567
+ var baseIsTypedArray = _baseIsTypedArray,
64568
+ baseUnary = _baseUnary,
64569
+ nodeUtil = _nodeUtil.exports;
64570
+ /* Node.js helper references. */
64571
+
64572
+ var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
64573
+ /**
64574
+ * Checks if `value` is classified as a typed array.
64575
+ *
64576
+ * @static
64577
+ * @memberOf _
64578
+ * @since 3.0.0
64579
+ * @category Lang
64580
+ * @param {*} value The value to check.
64581
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
64582
+ * @example
64583
+ *
64584
+ * _.isTypedArray(new Uint8Array);
64585
+ * // => true
64586
+ *
64587
+ * _.isTypedArray([]);
64588
+ * // => false
64589
+ */
64590
+
64591
+ var isTypedArray$2 = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
64592
+ var isTypedArray_1 = isTypedArray$2;
64593
+
64594
+ var baseTimes = _baseTimes,
64595
+ isArguments$1 = isArguments_1,
64596
+ isArray$6 = isArray_1,
64597
+ isBuffer$1 = isBuffer$2.exports,
64598
+ isIndex$1 = _isIndex,
64599
+ isTypedArray$1 = isTypedArray_1;
64600
+ /** Used for built-in method references. */
64601
+
64602
+ var objectProto$4 = Object.prototype;
64603
+ /** Used to check objects for own properties. */
64604
+
64605
+ var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
64606
+ /**
64607
+ * Creates an array of the enumerable property names of the array-like `value`.
64608
+ *
64609
+ * @private
64610
+ * @param {*} value The value to query.
64611
+ * @param {boolean} inherited Specify returning inherited property names.
64612
+ * @returns {Array} Returns the array of property names.
64613
+ */
64614
+
64615
+ function arrayLikeKeys$1(value, inherited) {
64616
+ var isArr = isArray$6(value),
64617
+ isArg = !isArr && isArguments$1(value),
64618
+ isBuff = !isArr && !isArg && isBuffer$1(value),
64619
+ isType = !isArr && !isArg && !isBuff && isTypedArray$1(value),
64620
+ skipIndexes = isArr || isArg || isBuff || isType,
64621
+ result = skipIndexes ? baseTimes(value.length, String) : [],
64622
+ length = result.length;
64623
+
64624
+ for (var key in value) {
64625
+ if ((inherited || hasOwnProperty$3.call(value, key)) && !(skipIndexes && ( // Safari 9 has enumerable `arguments.length` in strict mode.
64626
+ key == 'length' || // Node.js 0.10 has enumerable non-index properties on buffers.
64627
+ isBuff && (key == 'offset' || key == 'parent') || // PhantomJS 2 has enumerable non-index properties on typed arrays.
64628
+ isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset') || // Skip index properties.
64629
+ isIndex$1(key, length)))) {
64630
+ result.push(key);
64631
+ }
64632
+ }
64633
+
64634
+ return result;
64635
+ }
64636
+
64637
+ var _arrayLikeKeys = arrayLikeKeys$1;
64638
+
64639
+ /** Used for built-in method references. */
64640
+ var objectProto$3 = Object.prototype;
64641
+ /**
64642
+ * Checks if `value` is likely a prototype object.
64643
+ *
64644
+ * @private
64645
+ * @param {*} value The value to check.
64646
+ * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
64647
+ */
64648
+
64649
+ function isPrototype$1(value) {
64650
+ var Ctor = value && value.constructor,
64651
+ proto = typeof Ctor == 'function' && Ctor.prototype || objectProto$3;
64652
+ return value === proto;
64653
+ }
64654
+
64655
+ var _isPrototype = isPrototype$1;
64656
+
64657
+ /**
64658
+ * Creates a unary function that invokes `func` with its argument transformed.
64659
+ *
64660
+ * @private
64661
+ * @param {Function} func The function to wrap.
64662
+ * @param {Function} transform The argument transform.
64663
+ * @returns {Function} Returns the new function.
64664
+ */
64665
+
64666
+ function overArg$1(func, transform) {
64667
+ return function (arg) {
64668
+ return func(transform(arg));
64669
+ };
64670
+ }
64671
+
64672
+ var _overArg = overArg$1;
64673
+
64674
+ var overArg = _overArg;
64675
+ /* Built-in method references for those with the same name as other `lodash` methods. */
64676
+
64677
+ var nativeKeys$1 = overArg(Object.keys, Object);
64678
+ var _nativeKeys = nativeKeys$1;
64679
+
64680
+ var isPrototype = _isPrototype,
64681
+ nativeKeys = _nativeKeys;
64682
+ /** Used for built-in method references. */
64683
+
64684
+ var objectProto$2 = Object.prototype;
64685
+ /** Used to check objects for own properties. */
64686
+
64687
+ var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
64688
+ /**
64689
+ * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
64690
+ *
64691
+ * @private
64692
+ * @param {Object} object The object to query.
64693
+ * @returns {Array} Returns the array of property names.
64694
+ */
64695
+
64696
+ function baseKeys$1(object) {
64697
+ if (!isPrototype(object)) {
64698
+ return nativeKeys(object);
64699
+ }
64700
+
64701
+ var result = [];
64702
+
64703
+ for (var key in Object(object)) {
64704
+ if (hasOwnProperty$2.call(object, key) && key != 'constructor') {
64705
+ result.push(key);
64706
+ }
64707
+ }
64708
+
64709
+ return result;
64710
+ }
64711
+
64712
+ var _baseKeys = baseKeys$1;
64713
+
64714
+ var isFunction = isFunction_1,
64715
+ isLength$1 = isLength_1;
64716
+ /**
64717
+ * Checks if `value` is array-like. A value is considered array-like if it's
64718
+ * not a function and has a `value.length` that's an integer greater than or
64719
+ * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
64720
+ *
64721
+ * @static
64722
+ * @memberOf _
64723
+ * @since 4.0.0
64724
+ * @category Lang
64725
+ * @param {*} value The value to check.
64726
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
64727
+ * @example
64728
+ *
64729
+ * _.isArrayLike([1, 2, 3]);
64730
+ * // => true
64731
+ *
64732
+ * _.isArrayLike(document.body.children);
64733
+ * // => true
64734
+ *
64735
+ * _.isArrayLike('abc');
64736
+ * // => true
64737
+ *
64738
+ * _.isArrayLike(_.noop);
64739
+ * // => false
64740
+ */
64741
+
64742
+ function isArrayLike$1(value) {
64743
+ return value != null && isLength$1(value.length) && !isFunction(value);
64744
+ }
64745
+
64746
+ var isArrayLike_1 = isArrayLike$1;
64747
+
64748
+ var arrayLikeKeys = _arrayLikeKeys,
64749
+ baseKeys = _baseKeys,
64750
+ isArrayLike = isArrayLike_1;
64751
+ /**
64752
+ * Creates an array of the own enumerable property names of `object`.
64753
+ *
64754
+ * **Note:** Non-object values are coerced to objects. See the
64755
+ * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
64756
+ * for more details.
64757
+ *
64758
+ * @static
64759
+ * @since 0.1.0
64760
+ * @memberOf _
64761
+ * @category Object
64762
+ * @param {Object} object The object to query.
64763
+ * @returns {Array} Returns the array of property names.
64764
+ * @example
64765
+ *
64766
+ * function Foo() {
64767
+ * this.a = 1;
64768
+ * this.b = 2;
64769
+ * }
64770
+ *
64771
+ * Foo.prototype.c = 3;
64772
+ *
64773
+ * _.keys(new Foo);
64774
+ * // => ['a', 'b'] (iteration order is not guaranteed)
64775
+ *
64776
+ * _.keys('hi');
64777
+ * // => ['0', '1']
64778
+ */
64779
+
64780
+ function keys$2(object) {
64781
+ return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
64782
+ }
64783
+
64784
+ var keys_1 = keys$2;
64785
+
64786
+ var baseGetAllKeys = _baseGetAllKeys,
64787
+ getSymbols = _getSymbols,
64788
+ keys$1 = keys_1;
64789
+ /**
64790
+ * Creates an array of own enumerable property names and symbols of `object`.
64791
+ *
64792
+ * @private
64793
+ * @param {Object} object The object to query.
64794
+ * @returns {Array} Returns the array of property names and symbols.
64795
+ */
64796
+
64797
+ function getAllKeys$1(object) {
64798
+ return baseGetAllKeys(object, keys$1, getSymbols);
64799
+ }
64800
+
64801
+ var _getAllKeys = getAllKeys$1;
64802
+
64803
+ var getAllKeys = _getAllKeys;
64804
+ /** Used to compose bitmasks for value comparisons. */
64805
+
64806
+ var COMPARE_PARTIAL_FLAG$3 = 1;
64807
+ /** Used for built-in method references. */
64808
+
64809
+ var objectProto$1 = Object.prototype;
64810
+ /** Used to check objects for own properties. */
64811
+
64812
+ var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
64813
+ /**
64814
+ * A specialized version of `baseIsEqualDeep` for objects with support for
64815
+ * partial deep comparisons.
64816
+ *
64817
+ * @private
64818
+ * @param {Object} object The object to compare.
64819
+ * @param {Object} other The other object to compare.
64820
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
64821
+ * @param {Function} customizer The function to customize comparisons.
64822
+ * @param {Function} equalFunc The function to determine equivalents of values.
64823
+ * @param {Object} stack Tracks traversed `object` and `other` objects.
64824
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
64825
+ */
64826
+
64827
+ function equalObjects$1(object, other, bitmask, customizer, equalFunc, stack) {
64828
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3,
64829
+ objProps = getAllKeys(object),
64830
+ objLength = objProps.length,
64831
+ othProps = getAllKeys(other),
64832
+ othLength = othProps.length;
64833
+
64834
+ if (objLength != othLength && !isPartial) {
64835
+ return false;
64836
+ }
64837
+
64838
+ var index = objLength;
64839
+
64840
+ while (index--) {
64841
+ var key = objProps[index];
64842
+
64843
+ if (!(isPartial ? key in other : hasOwnProperty$1.call(other, key))) {
64844
+ return false;
64845
+ }
64846
+ } // Check that cyclic values are equal.
64847
+
64848
+
64849
+ var objStacked = stack.get(object);
64850
+ var othStacked = stack.get(other);
64851
+
64852
+ if (objStacked && othStacked) {
64853
+ return objStacked == other && othStacked == object;
64854
+ }
64855
+
64856
+ var result = true;
64857
+ stack.set(object, other);
64858
+ stack.set(other, object);
64859
+ var skipCtor = isPartial;
64860
+
64861
+ while (++index < objLength) {
64862
+ key = objProps[index];
64863
+ var objValue = object[key],
64864
+ othValue = other[key];
64865
+
64866
+ if (customizer) {
64867
+ var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
64868
+ } // Recursively compare objects (susceptible to call stack limits).
64869
+
64870
+
64871
+ if (!(compared === undefined ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
64872
+ result = false;
64873
+ break;
64874
+ }
64875
+
64876
+ skipCtor || (skipCtor = key == 'constructor');
64877
+ }
64878
+
64879
+ if (result && !skipCtor) {
64880
+ var objCtor = object.constructor,
64881
+ othCtor = other.constructor; // Non `Object` object instances with different constructors are not equal.
64882
+
64883
+ if (objCtor != othCtor && 'constructor' in object && 'constructor' in other && !(typeof objCtor == 'function' && objCtor instanceof objCtor && typeof othCtor == 'function' && othCtor instanceof othCtor)) {
64884
+ result = false;
64885
+ }
64886
+ }
64887
+
64888
+ stack['delete'](object);
64889
+ stack['delete'](other);
64890
+ return result;
64891
+ }
64892
+
64893
+ var _equalObjects = equalObjects$1;
64894
+
64895
+ var getNative$3 = _getNative,
64896
+ root$3 = _root;
64897
+ /* Built-in method references that are verified to be native. */
64898
+
64899
+ var DataView$1 = getNative$3(root$3, 'DataView');
64900
+ var _DataView = DataView$1;
64901
+
64902
+ var getNative$2 = _getNative,
64903
+ root$2 = _root;
64904
+ /* Built-in method references that are verified to be native. */
64905
+
64906
+ var Promise$2 = getNative$2(root$2, 'Promise');
64907
+ var _Promise = Promise$2;
64908
+
64909
+ var getNative$1 = _getNative,
64910
+ root$1 = _root;
64911
+ /* Built-in method references that are verified to be native. */
64912
+
64913
+ var Set$2 = getNative$1(root$1, 'Set');
64914
+ var _Set = Set$2;
64915
+
64916
+ var getNative = _getNative,
64917
+ root = _root;
64918
+ /* Built-in method references that are verified to be native. */
64919
+
64920
+ var WeakMap$2 = getNative(root, 'WeakMap');
64921
+ var _WeakMap = WeakMap$2;
64922
+
64923
+ var DataView = _DataView,
64924
+ Map$1 = _Map,
64925
+ Promise$1 = _Promise,
64926
+ Set$1 = _Set,
64927
+ WeakMap$1 = _WeakMap,
64928
+ baseGetTag = _baseGetTag,
64929
+ toSource = _toSource;
64930
+ /** `Object#toString` result references. */
64931
+
64932
+ var mapTag = '[object Map]',
64933
+ objectTag$1 = '[object Object]',
64934
+ promiseTag = '[object Promise]',
64935
+ setTag = '[object Set]',
64936
+ weakMapTag = '[object WeakMap]';
64937
+ var dataViewTag = '[object DataView]';
64938
+ /** Used to detect maps, sets, and weakmaps. */
64939
+
64940
+ var dataViewCtorString = toSource(DataView),
64941
+ mapCtorString = toSource(Map$1),
64942
+ promiseCtorString = toSource(Promise$1),
64943
+ setCtorString = toSource(Set$1),
64944
+ weakMapCtorString = toSource(WeakMap$1);
64945
+ /**
64946
+ * Gets the `toStringTag` of `value`.
64947
+ *
64948
+ * @private
64949
+ * @param {*} value The value to query.
64950
+ * @returns {string} Returns the `toStringTag`.
64951
+ */
64952
+
64953
+ var getTag$1 = baseGetTag; // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
64954
+
64955
+ if (DataView && getTag$1(new DataView(new ArrayBuffer(1))) != dataViewTag || Map$1 && getTag$1(new Map$1()) != mapTag || Promise$1 && getTag$1(Promise$1.resolve()) != promiseTag || Set$1 && getTag$1(new Set$1()) != setTag || WeakMap$1 && getTag$1(new WeakMap$1()) != weakMapTag) {
64956
+ getTag$1 = function getTag(value) {
64957
+ var result = baseGetTag(value),
64958
+ Ctor = result == objectTag$1 ? value.constructor : undefined,
64959
+ ctorString = Ctor ? toSource(Ctor) : '';
64960
+
64961
+ if (ctorString) {
64962
+ switch (ctorString) {
64963
+ case dataViewCtorString:
64964
+ return dataViewTag;
64965
+
64966
+ case mapCtorString:
64967
+ return mapTag;
64968
+
64969
+ case promiseCtorString:
64970
+ return promiseTag;
64971
+
64972
+ case setCtorString:
64973
+ return setTag;
64974
+
64975
+ case weakMapCtorString:
64976
+ return weakMapTag;
64977
+ }
64978
+ }
64979
+
64980
+ return result;
64981
+ };
64982
+ }
64983
+
64984
+ var _getTag = getTag$1;
64985
+
64986
+ var Stack$1 = _Stack,
64987
+ equalArrays = _equalArrays,
64988
+ equalByTag = _equalByTag,
64989
+ equalObjects = _equalObjects,
64990
+ getTag = _getTag,
64991
+ isArray$5 = isArray_1,
64992
+ isBuffer = isBuffer$2.exports,
64993
+ isTypedArray = isTypedArray_1;
64994
+ /** Used to compose bitmasks for value comparisons. */
64995
+
64996
+ var COMPARE_PARTIAL_FLAG$2 = 1;
64997
+ /** `Object#toString` result references. */
64998
+
64999
+ var argsTag = '[object Arguments]',
65000
+ arrayTag = '[object Array]',
65001
+ objectTag = '[object Object]';
65002
+ /** Used for built-in method references. */
65003
+
65004
+ var objectProto = Object.prototype;
65005
+ /** Used to check objects for own properties. */
65006
+
65007
+ var hasOwnProperty = objectProto.hasOwnProperty;
65008
+ /**
65009
+ * A specialized version of `baseIsEqual` for arrays and objects which performs
65010
+ * deep comparisons and tracks traversed objects enabling objects with circular
65011
+ * references to be compared.
65012
+ *
65013
+ * @private
65014
+ * @param {Object} object The object to compare.
65015
+ * @param {Object} other The other object to compare.
65016
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
65017
+ * @param {Function} customizer The function to customize comparisons.
65018
+ * @param {Function} equalFunc The function to determine equivalents of values.
65019
+ * @param {Object} [stack] Tracks traversed `object` and `other` objects.
65020
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
65021
+ */
65022
+
65023
+ function baseIsEqualDeep$1(object, other, bitmask, customizer, equalFunc, stack) {
65024
+ var objIsArr = isArray$5(object),
65025
+ othIsArr = isArray$5(other),
65026
+ objTag = objIsArr ? arrayTag : getTag(object),
65027
+ othTag = othIsArr ? arrayTag : getTag(other);
65028
+ objTag = objTag == argsTag ? objectTag : objTag;
65029
+ othTag = othTag == argsTag ? objectTag : othTag;
65030
+ var objIsObj = objTag == objectTag,
65031
+ othIsObj = othTag == objectTag,
65032
+ isSameTag = objTag == othTag;
65033
+
65034
+ if (isSameTag && isBuffer(object)) {
65035
+ if (!isBuffer(other)) {
65036
+ return false;
65037
+ }
65038
+
65039
+ objIsArr = true;
65040
+ objIsObj = false;
65041
+ }
65042
+
65043
+ if (isSameTag && !objIsObj) {
65044
+ stack || (stack = new Stack$1());
65045
+ return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
65046
+ }
65047
+
65048
+ if (!(bitmask & COMPARE_PARTIAL_FLAG$2)) {
65049
+ var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
65050
+ othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
65051
+
65052
+ if (objIsWrapped || othIsWrapped) {
65053
+ var objUnwrapped = objIsWrapped ? object.value() : object,
65054
+ othUnwrapped = othIsWrapped ? other.value() : other;
65055
+ stack || (stack = new Stack$1());
65056
+ return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
65057
+ }
65058
+ }
65059
+
65060
+ if (!isSameTag) {
65061
+ return false;
65062
+ }
65063
+
65064
+ stack || (stack = new Stack$1());
65065
+ return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
65066
+ }
65067
+
65068
+ var _baseIsEqualDeep = baseIsEqualDeep$1;
65069
+
65070
+ var baseIsEqualDeep = _baseIsEqualDeep,
65071
+ isObjectLike = isObjectLike_1;
65072
+ /**
65073
+ * The base implementation of `_.isEqual` which supports partial comparisons
65074
+ * and tracks traversed objects.
65075
+ *
65076
+ * @private
65077
+ * @param {*} value The value to compare.
65078
+ * @param {*} other The other value to compare.
65079
+ * @param {boolean} bitmask The bitmask flags.
65080
+ * 1 - Unordered comparison
65081
+ * 2 - Partial comparison
65082
+ * @param {Function} [customizer] The function to customize comparisons.
65083
+ * @param {Object} [stack] Tracks traversed `value` and `other` objects.
65084
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
65085
+ */
65086
+
65087
+ function baseIsEqual$2(value, other, bitmask, customizer, stack) {
65088
+ if (value === other) {
65089
+ return true;
65090
+ }
65091
+
65092
+ if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) {
65093
+ return value !== value && other !== other;
65094
+ }
65095
+
65096
+ return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual$2, stack);
65097
+ }
65098
+
65099
+ var _baseIsEqual = baseIsEqual$2;
65100
+
65101
+ var Stack = _Stack,
65102
+ baseIsEqual$1 = _baseIsEqual;
65103
+ /** Used to compose bitmasks for value comparisons. */
65104
+
65105
+ var COMPARE_PARTIAL_FLAG$1 = 1,
65106
+ COMPARE_UNORDERED_FLAG$1 = 2;
65107
+ /**
65108
+ * The base implementation of `_.isMatch` without support for iteratee shorthands.
65109
+ *
65110
+ * @private
65111
+ * @param {Object} object The object to inspect.
65112
+ * @param {Object} source The object of property values to match.
65113
+ * @param {Array} matchData The property names, values, and compare flags to match.
65114
+ * @param {Function} [customizer] The function to customize comparisons.
65115
+ * @returns {boolean} Returns `true` if `object` is a match, else `false`.
65116
+ */
65117
+
65118
+ function baseIsMatch$1(object, source, matchData, customizer) {
65119
+ var index = matchData.length,
65120
+ length = index,
65121
+ noCustomizer = !customizer;
65122
+
65123
+ if (object == null) {
65124
+ return !length;
65125
+ }
65126
+
65127
+ object = Object(object);
65128
+
65129
+ while (index--) {
65130
+ var data = matchData[index];
65131
+
65132
+ if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) {
65133
+ return false;
65134
+ }
65135
+ }
65136
+
65137
+ while (++index < length) {
65138
+ data = matchData[index];
65139
+ var key = data[0],
65140
+ objValue = object[key],
65141
+ srcValue = data[1];
65142
+
65143
+ if (noCustomizer && data[2]) {
65144
+ if (objValue === undefined && !(key in object)) {
65145
+ return false;
65146
+ }
65147
+ } else {
65148
+ var stack = new Stack();
65149
+
65150
+ if (customizer) {
65151
+ var result = customizer(objValue, srcValue, key, object, source, stack);
65152
+ }
65153
+
65154
+ if (!(result === undefined ? baseIsEqual$1(srcValue, objValue, COMPARE_PARTIAL_FLAG$1 | COMPARE_UNORDERED_FLAG$1, customizer, stack) : result)) {
65155
+ return false;
65156
+ }
65157
+ }
65158
+ }
65159
+
65160
+ return true;
65161
+ }
65162
+
65163
+ var _baseIsMatch = baseIsMatch$1;
65164
+
65165
+ var isObject = isObject_1;
65166
+ /**
65167
+ * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
65168
+ *
65169
+ * @private
65170
+ * @param {*} value The value to check.
65171
+ * @returns {boolean} Returns `true` if `value` if suitable for strict
65172
+ * equality comparisons, else `false`.
65173
+ */
65174
+
65175
+ function isStrictComparable$2(value) {
65176
+ return value === value && !isObject(value);
65177
+ }
65178
+
65179
+ var _isStrictComparable = isStrictComparable$2;
65180
+
65181
+ var isStrictComparable$1 = _isStrictComparable,
65182
+ keys = keys_1;
65183
+ /**
65184
+ * Gets the property names, values, and compare flags of `object`.
65185
+ *
65186
+ * @private
65187
+ * @param {Object} object The object to query.
65188
+ * @returns {Array} Returns the match data of `object`.
65189
+ */
65190
+
65191
+ function getMatchData$1(object) {
65192
+ var result = keys(object),
65193
+ length = result.length;
65194
+
65195
+ while (length--) {
65196
+ var key = result[length],
65197
+ value = object[key];
65198
+ result[length] = [key, value, isStrictComparable$1(value)];
65199
+ }
65200
+
65201
+ return result;
65202
+ }
65203
+
65204
+ var _getMatchData = getMatchData$1;
65205
+
65206
+ /**
65207
+ * A specialized version of `matchesProperty` for source values suitable
65208
+ * for strict equality comparisons, i.e. `===`.
65209
+ *
65210
+ * @private
65211
+ * @param {string} key The key of the property to get.
65212
+ * @param {*} srcValue The value to match.
65213
+ * @returns {Function} Returns the new spec function.
65214
+ */
65215
+
65216
+ function matchesStrictComparable$2(key, srcValue) {
65217
+ return function (object) {
65218
+ if (object == null) {
65219
+ return false;
65220
+ }
65221
+
65222
+ return object[key] === srcValue && (srcValue !== undefined || key in Object(object));
65223
+ };
65224
+ }
65225
+
65226
+ var _matchesStrictComparable = matchesStrictComparable$2;
65227
+
65228
+ var baseIsMatch = _baseIsMatch,
65229
+ getMatchData = _getMatchData,
65230
+ matchesStrictComparable$1 = _matchesStrictComparable;
65231
+ /**
65232
+ * The base implementation of `_.matches` which doesn't clone `source`.
65233
+ *
65234
+ * @private
65235
+ * @param {Object} source The object of property values to match.
65236
+ * @returns {Function} Returns the new spec function.
65237
+ */
65238
+
65239
+ function baseMatches$1(source) {
65240
+ var matchData = getMatchData(source);
65241
+
65242
+ if (matchData.length == 1 && matchData[0][2]) {
65243
+ return matchesStrictComparable$1(matchData[0][0], matchData[0][1]);
65244
+ }
65245
+
65246
+ return function (object) {
65247
+ return object === source || baseIsMatch(object, source, matchData);
65248
+ };
65249
+ }
65250
+
65251
+ var _baseMatches = baseMatches$1;
65252
+
65253
+ var isArray$4 = isArray_1,
65254
+ isSymbol$2 = isSymbol_1;
65255
+ /** Used to match property names within property paths. */
65256
+
65257
+ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
65258
+ reIsPlainProp = /^\w*$/;
65259
+ /**
65260
+ * Checks if `value` is a property name and not a property path.
65261
+ *
65262
+ * @private
65263
+ * @param {*} value The value to check.
65264
+ * @param {Object} [object] The object to query keys on.
65265
+ * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
65266
+ */
65267
+
65268
+ function isKey$3(value, object) {
65269
+ if (isArray$4(value)) {
65270
+ return false;
65271
+ }
65272
+
65273
+ var type = _typeof(value);
65274
+
65275
+ if (type == 'number' || type == 'symbol' || type == 'boolean' || value == null || isSymbol$2(value)) {
65276
+ return true;
65277
+ }
65278
+
65279
+ return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
65280
+ }
65281
+
65282
+ var _isKey = isKey$3;
65283
+
65284
+ var MapCache = _MapCache;
65285
+ /** Error message constants. */
65286
+
65287
+ var FUNC_ERROR_TEXT = 'Expected a function';
65288
+ /**
65289
+ * Creates a function that memoizes the result of `func`. If `resolver` is
65290
+ * provided, it determines the cache key for storing the result based on the
65291
+ * arguments provided to the memoized function. By default, the first argument
65292
+ * provided to the memoized function is used as the map cache key. The `func`
65293
+ * is invoked with the `this` binding of the memoized function.
65294
+ *
65295
+ * **Note:** The cache is exposed as the `cache` property on the memoized
65296
+ * function. Its creation may be customized by replacing the `_.memoize.Cache`
65297
+ * constructor with one whose instances implement the
65298
+ * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
65299
+ * method interface of `clear`, `delete`, `get`, `has`, and `set`.
65300
+ *
65301
+ * @static
65302
+ * @memberOf _
65303
+ * @since 0.1.0
65304
+ * @category Function
65305
+ * @param {Function} func The function to have its output memoized.
65306
+ * @param {Function} [resolver] The function to resolve the cache key.
65307
+ * @returns {Function} Returns the new memoized function.
65308
+ * @example
65309
+ *
65310
+ * var object = { 'a': 1, 'b': 2 };
65311
+ * var other = { 'c': 3, 'd': 4 };
65312
+ *
65313
+ * var values = _.memoize(_.values);
65314
+ * values(object);
65315
+ * // => [1, 2]
65316
+ *
65317
+ * values(other);
65318
+ * // => [3, 4]
65319
+ *
65320
+ * object.a = 2;
65321
+ * values(object);
65322
+ * // => [1, 2]
65323
+ *
65324
+ * // Modify the result cache.
65325
+ * values.cache.set(object, ['a', 'b']);
65326
+ * values(object);
65327
+ * // => ['a', 'b']
65328
+ *
65329
+ * // Replace `_.memoize.Cache`.
65330
+ * _.memoize.Cache = WeakMap;
65331
+ */
65332
+
65333
+ function memoize$1(func, resolver) {
65334
+ if (typeof func != 'function' || resolver != null && typeof resolver != 'function') {
65335
+ throw new TypeError(FUNC_ERROR_TEXT);
65336
+ }
65337
+
65338
+ var memoized = function memoized() {
65339
+ var args = arguments,
65340
+ key = resolver ? resolver.apply(this, args) : args[0],
65341
+ cache = memoized.cache;
65342
+
65343
+ if (cache.has(key)) {
65344
+ return cache.get(key);
65345
+ }
65346
+
65347
+ var result = func.apply(this, args);
65348
+ memoized.cache = cache.set(key, result) || cache;
65349
+ return result;
65350
+ };
65351
+
65352
+ memoized.cache = new (memoize$1.Cache || MapCache)();
65353
+ return memoized;
65354
+ } // Expose `MapCache`.
65355
+
65356
+
65357
+ memoize$1.Cache = MapCache;
65358
+ var memoize_1 = memoize$1;
65359
+
65360
+ var memoize = memoize_1;
65361
+ /** Used as the maximum memoize cache size. */
65362
+
65363
+ var MAX_MEMOIZE_SIZE = 500;
65364
+ /**
65365
+ * A specialized version of `_.memoize` which clears the memoized function's
65366
+ * cache when it exceeds `MAX_MEMOIZE_SIZE`.
65367
+ *
65368
+ * @private
65369
+ * @param {Function} func The function to have its output memoized.
65370
+ * @returns {Function} Returns the new memoized function.
65371
+ */
65372
+
65373
+ function memoizeCapped$1(func) {
65374
+ var result = memoize(func, function (key) {
65375
+ if (cache.size === MAX_MEMOIZE_SIZE) {
65376
+ cache.clear();
65377
+ }
65378
+
65379
+ return key;
65380
+ });
65381
+ var cache = result.cache;
65382
+ return result;
65383
+ }
65384
+
65385
+ var _memoizeCapped = memoizeCapped$1;
65386
+
65387
+ var memoizeCapped = _memoizeCapped;
65388
+ /** Used to match property names within property paths. */
65389
+
65390
+ var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
65391
+ /** Used to match backslashes in property paths. */
65392
+
65393
+ var reEscapeChar = /\\(\\)?/g;
65394
+ /**
65395
+ * Converts `string` to a property path array.
65396
+ *
65397
+ * @private
65398
+ * @param {string} string The string to convert.
65399
+ * @returns {Array} Returns the property path array.
65400
+ */
65401
+
65402
+ var stringToPath$1 = memoizeCapped(function (string) {
65403
+ var result = [];
65404
+
65405
+ if (string.charCodeAt(0) === 46
65406
+ /* . */
65407
+ ) {
65408
+ result.push('');
65409
+ }
65410
+
65411
+ string.replace(rePropName, function (match, number, quote, subString) {
65412
+ result.push(quote ? subString.replace(reEscapeChar, '$1') : number || match);
65413
+ });
65414
+ return result;
65415
+ });
65416
+ var _stringToPath = stringToPath$1;
65417
+
65418
+ /**
65419
+ * A specialized version of `_.map` for arrays without support for iteratee
65420
+ * shorthands.
65421
+ *
65422
+ * @private
65423
+ * @param {Array} [array] The array to iterate over.
65424
+ * @param {Function} iteratee The function invoked per iteration.
65425
+ * @returns {Array} Returns the new mapped array.
65426
+ */
65427
+
65428
+ function arrayMap$1(array, iteratee) {
65429
+ var index = -1,
65430
+ length = array == null ? 0 : array.length,
65431
+ result = Array(length);
65432
+
65433
+ while (++index < length) {
65434
+ result[index] = iteratee(array[index], index, array);
65435
+ }
65436
+
65437
+ return result;
65438
+ }
65439
+
65440
+ var _arrayMap = arrayMap$1;
65441
+
65442
+ var _Symbol = _Symbol$4,
65443
+ arrayMap = _arrayMap,
65444
+ isArray$3 = isArray_1,
65445
+ isSymbol$1 = isSymbol_1;
65446
+ /** Used as references for various `Number` constants. */
65447
+
65448
+ var INFINITY$1 = 1 / 0;
65449
+ /** Used to convert symbols to primitives and strings. */
65450
+
65451
+ var symbolProto = _Symbol ? _Symbol.prototype : undefined,
65452
+ symbolToString = symbolProto ? symbolProto.toString : undefined;
65453
+ /**
65454
+ * The base implementation of `_.toString` which doesn't convert nullish
65455
+ * values to empty strings.
65456
+ *
65457
+ * @private
65458
+ * @param {*} value The value to process.
65459
+ * @returns {string} Returns the string.
65460
+ */
65461
+
65462
+ function baseToString$1(value) {
65463
+ // Exit early for strings to avoid a performance hit in some environments.
65464
+ if (typeof value == 'string') {
65465
+ return value;
65466
+ }
65467
+
65468
+ if (isArray$3(value)) {
65469
+ // Recursively convert values (susceptible to call stack limits).
65470
+ return arrayMap(value, baseToString$1) + '';
65471
+ }
65472
+
65473
+ if (isSymbol$1(value)) {
65474
+ return symbolToString ? symbolToString.call(value) : '';
65475
+ }
65476
+
65477
+ var result = value + '';
65478
+ return result == '0' && 1 / value == -INFINITY$1 ? '-0' : result;
65479
+ }
65480
+
65481
+ var _baseToString = baseToString$1;
65482
+
65483
+ var baseToString = _baseToString;
65484
+ /**
65485
+ * Converts `value` to a string. An empty string is returned for `null`
65486
+ * and `undefined` values. The sign of `-0` is preserved.
65487
+ *
65488
+ * @static
65489
+ * @memberOf _
65490
+ * @since 4.0.0
65491
+ * @category Lang
65492
+ * @param {*} value The value to convert.
65493
+ * @returns {string} Returns the converted string.
65494
+ * @example
65495
+ *
65496
+ * _.toString(null);
65497
+ * // => ''
65498
+ *
65499
+ * _.toString(-0);
65500
+ * // => '-0'
65501
+ *
65502
+ * _.toString([1, 2, 3]);
65503
+ * // => '1,2,3'
65504
+ */
65505
+
65506
+ function toString$1(value) {
65507
+ return value == null ? '' : baseToString(value);
65508
+ }
65509
+
65510
+ var toString_1 = toString$1;
65511
+
65512
+ var isArray$2 = isArray_1,
65513
+ isKey$2 = _isKey,
65514
+ stringToPath = _stringToPath,
65515
+ toString = toString_1;
65516
+ /**
65517
+ * Casts `value` to a path array if it's not one.
65518
+ *
65519
+ * @private
65520
+ * @param {*} value The value to inspect.
65521
+ * @param {Object} [object] The object to query keys on.
65522
+ * @returns {Array} Returns the cast property path array.
65523
+ */
65524
+
65525
+ function castPath$2(value, object) {
65526
+ if (isArray$2(value)) {
65527
+ return value;
65528
+ }
65529
+
65530
+ return isKey$2(value, object) ? [value] : stringToPath(toString(value));
65531
+ }
65532
+
65533
+ var _castPath = castPath$2;
65534
+
65535
+ var isSymbol = isSymbol_1;
65536
+ /** Used as references for various `Number` constants. */
65537
+
65538
+ var INFINITY = 1 / 0;
65539
+ /**
65540
+ * Converts `value` to a string key if it's not a string or symbol.
65541
+ *
65542
+ * @private
65543
+ * @param {*} value The value to inspect.
65544
+ * @returns {string|symbol} Returns the key.
65545
+ */
65546
+
65547
+ function toKey$4(value) {
65548
+ if (typeof value == 'string' || isSymbol(value)) {
65549
+ return value;
65550
+ }
65551
+
65552
+ var result = value + '';
65553
+ return result == '0' && 1 / value == -INFINITY ? '-0' : result;
65554
+ }
65555
+
65556
+ var _toKey = toKey$4;
65557
+
65558
+ var castPath$1 = _castPath,
65559
+ toKey$3 = _toKey;
65560
+ /**
65561
+ * The base implementation of `_.get` without support for default values.
65562
+ *
65563
+ * @private
65564
+ * @param {Object} object The object to query.
65565
+ * @param {Array|string} path The path of the property to get.
65566
+ * @returns {*} Returns the resolved value.
65567
+ */
65568
+
65569
+ function baseGet$2(object, path) {
65570
+ path = castPath$1(path, object);
65571
+ var index = 0,
65572
+ length = path.length;
65573
+
65574
+ while (object != null && index < length) {
65575
+ object = object[toKey$3(path[index++])];
65576
+ }
65577
+
65578
+ return index && index == length ? object : undefined;
65579
+ }
65580
+
65581
+ var _baseGet = baseGet$2;
65582
+
65583
+ var baseGet$1 = _baseGet;
65584
+ /**
65585
+ * Gets the value at `path` of `object`. If the resolved value is
65586
+ * `undefined`, the `defaultValue` is returned in its place.
65587
+ *
65588
+ * @static
65589
+ * @memberOf _
65590
+ * @since 3.7.0
65591
+ * @category Object
65592
+ * @param {Object} object The object to query.
65593
+ * @param {Array|string} path The path of the property to get.
65594
+ * @param {*} [defaultValue] The value returned for `undefined` resolved values.
65595
+ * @returns {*} Returns the resolved value.
65596
+ * @example
65597
+ *
65598
+ * var object = { 'a': [{ 'b': { 'c': 3 } }] };
65599
+ *
65600
+ * _.get(object, 'a[0].b.c');
65601
+ * // => 3
65602
+ *
65603
+ * _.get(object, ['a', '0', 'b', 'c']);
65604
+ * // => 3
65605
+ *
65606
+ * _.get(object, 'a.b.c', 'default');
65607
+ * // => 'default'
65608
+ */
65609
+
65610
+ function get$1(object, path, defaultValue) {
65611
+ var result = object == null ? undefined : baseGet$1(object, path);
65612
+ return result === undefined ? defaultValue : result;
65613
+ }
65614
+
65615
+ var get_1 = get$1;
65616
+
65617
+ /**
65618
+ * The base implementation of `_.hasIn` without support for deep paths.
65619
+ *
65620
+ * @private
65621
+ * @param {Object} [object] The object to query.
65622
+ * @param {Array|string} key The key to check.
65623
+ * @returns {boolean} Returns `true` if `key` exists, else `false`.
65624
+ */
65625
+
65626
+ function baseHasIn$1(object, key) {
65627
+ return object != null && key in Object(object);
65628
+ }
65629
+
65630
+ var _baseHasIn = baseHasIn$1;
65631
+
65632
+ var castPath = _castPath,
65633
+ isArguments = isArguments_1,
65634
+ isArray$1 = isArray_1,
65635
+ isIndex = _isIndex,
65636
+ isLength = isLength_1,
65637
+ toKey$2 = _toKey;
65638
+ /**
65639
+ * Checks if `path` exists on `object`.
65640
+ *
65641
+ * @private
65642
+ * @param {Object} object The object to query.
65643
+ * @param {Array|string} path The path to check.
65644
+ * @param {Function} hasFunc The function to check properties.
65645
+ * @returns {boolean} Returns `true` if `path` exists, else `false`.
65646
+ */
65647
+
65648
+ function hasPath$1(object, path, hasFunc) {
65649
+ path = castPath(path, object);
65650
+ var index = -1,
65651
+ length = path.length,
65652
+ result = false;
65653
+
65654
+ while (++index < length) {
65655
+ var key = toKey$2(path[index]);
65656
+
65657
+ if (!(result = object != null && hasFunc(object, key))) {
65658
+ break;
65659
+ }
65660
+
65661
+ object = object[key];
65662
+ }
65663
+
65664
+ if (result || ++index != length) {
65665
+ return result;
65666
+ }
65667
+
65668
+ length = object == null ? 0 : object.length;
65669
+ return !!length && isLength(length) && isIndex(key, length) && (isArray$1(object) || isArguments(object));
65670
+ }
65671
+
65672
+ var _hasPath = hasPath$1;
65673
+
65674
+ var baseHasIn = _baseHasIn,
65675
+ hasPath = _hasPath;
65676
+ /**
65677
+ * Checks if `path` is a direct or inherited property of `object`.
65678
+ *
65679
+ * @static
65680
+ * @memberOf _
65681
+ * @since 4.0.0
65682
+ * @category Object
65683
+ * @param {Object} object The object to query.
65684
+ * @param {Array|string} path The path to check.
65685
+ * @returns {boolean} Returns `true` if `path` exists, else `false`.
65686
+ * @example
65687
+ *
65688
+ * var object = _.create({ 'a': _.create({ 'b': 2 }) });
65689
+ *
65690
+ * _.hasIn(object, 'a');
65691
+ * // => true
65692
+ *
65693
+ * _.hasIn(object, 'a.b');
65694
+ * // => true
65695
+ *
65696
+ * _.hasIn(object, ['a', 'b']);
65697
+ * // => true
65698
+ *
65699
+ * _.hasIn(object, 'b');
65700
+ * // => false
65701
+ */
65702
+
65703
+ function hasIn$1(object, path) {
65704
+ return object != null && hasPath(object, path, baseHasIn);
65705
+ }
65706
+
65707
+ var hasIn_1 = hasIn$1;
65708
+
65709
+ var baseIsEqual = _baseIsEqual,
65710
+ get = get_1,
65711
+ hasIn = hasIn_1,
65712
+ isKey$1 = _isKey,
65713
+ isStrictComparable = _isStrictComparable,
65714
+ matchesStrictComparable = _matchesStrictComparable,
65715
+ toKey$1 = _toKey;
65716
+ /** Used to compose bitmasks for value comparisons. */
65717
+
65718
+ var COMPARE_PARTIAL_FLAG = 1,
65719
+ COMPARE_UNORDERED_FLAG = 2;
65720
+ /**
65721
+ * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
65722
+ *
65723
+ * @private
65724
+ * @param {string} path The path of the property to get.
65725
+ * @param {*} srcValue The value to match.
65726
+ * @returns {Function} Returns the new spec function.
65727
+ */
65728
+
65729
+ function baseMatchesProperty$1(path, srcValue) {
65730
+ if (isKey$1(path) && isStrictComparable(srcValue)) {
65731
+ return matchesStrictComparable(toKey$1(path), srcValue);
65732
+ }
65733
+
65734
+ return function (object) {
65735
+ var objValue = get(object, path);
65736
+ return objValue === undefined && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
65737
+ };
65738
+ }
65739
+
65740
+ var _baseMatchesProperty = baseMatchesProperty$1;
65741
+
65742
+ /**
65743
+ * This method returns the first argument it receives.
65744
+ *
65745
+ * @static
65746
+ * @since 0.1.0
65747
+ * @memberOf _
65748
+ * @category Util
65749
+ * @param {*} value Any value.
65750
+ * @returns {*} Returns `value`.
65751
+ * @example
65752
+ *
65753
+ * var object = { 'a': 1 };
65754
+ *
65755
+ * console.log(_.identity(object) === object);
65756
+ * // => true
65757
+ */
65758
+
65759
+ function identity$1(value) {
65760
+ return value;
65761
+ }
65762
+
65763
+ var identity_1 = identity$1;
65764
+
65765
+ /**
65766
+ * The base implementation of `_.property` without support for deep paths.
65767
+ *
65768
+ * @private
65769
+ * @param {string} key The key of the property to get.
65770
+ * @returns {Function} Returns the new accessor function.
65771
+ */
65772
+
65773
+ function baseProperty$1(key) {
65774
+ return function (object) {
65775
+ return object == null ? undefined : object[key];
65776
+ };
65777
+ }
65778
+
65779
+ var _baseProperty = baseProperty$1;
65780
+
65781
+ var baseGet = _baseGet;
65782
+ /**
65783
+ * A specialized version of `baseProperty` which supports deep paths.
65784
+ *
65785
+ * @private
65786
+ * @param {Array|string} path The path of the property to get.
65787
+ * @returns {Function} Returns the new accessor function.
65788
+ */
65789
+
65790
+ function basePropertyDeep$1(path) {
65791
+ return function (object) {
65792
+ return baseGet(object, path);
65793
+ };
65794
+ }
65795
+
65796
+ var _basePropertyDeep = basePropertyDeep$1;
65797
+
65798
+ var baseProperty = _baseProperty,
65799
+ basePropertyDeep = _basePropertyDeep,
65800
+ isKey = _isKey,
65801
+ toKey = _toKey;
65802
+ /**
65803
+ * Creates a function that returns the value at `path` of a given object.
65804
+ *
65805
+ * @static
65806
+ * @memberOf _
65807
+ * @since 2.4.0
65808
+ * @category Util
65809
+ * @param {Array|string} path The path of the property to get.
65810
+ * @returns {Function} Returns the new accessor function.
65811
+ * @example
65812
+ *
65813
+ * var objects = [
65814
+ * { 'a': { 'b': 2 } },
65815
+ * { 'a': { 'b': 1 } }
65816
+ * ];
65817
+ *
65818
+ * _.map(objects, _.property('a.b'));
65819
+ * // => [2, 1]
65820
+ *
65821
+ * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
65822
+ * // => [1, 2]
65823
+ */
65824
+
65825
+ function property$1(path) {
65826
+ return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
65827
+ }
65828
+
65829
+ var property_1 = property$1;
65830
+
65831
+ var baseMatches = _baseMatches,
65832
+ baseMatchesProperty = _baseMatchesProperty,
65833
+ identity = identity_1,
65834
+ isArray = isArray_1,
65835
+ property = property_1;
65836
+ /**
65837
+ * The base implementation of `_.iteratee`.
65838
+ *
65839
+ * @private
65840
+ * @param {*} [value=_.identity] The value to convert to an iteratee.
65841
+ * @returns {Function} Returns the iteratee.
65842
+ */
65843
+
65844
+ function baseIteratee$1(value) {
65845
+ // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
65846
+ // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
65847
+ if (typeof value == 'function') {
65848
+ return value;
65849
+ }
65850
+
65851
+ if (value == null) {
65852
+ return identity;
65853
+ }
65854
+
65855
+ if (_typeof(value) == 'object') {
65856
+ return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
65857
+ }
65858
+
65859
+ return property(value);
65860
+ }
65861
+
65862
+ var _baseIteratee = baseIteratee$1;
65863
+
65864
+ var baseExtremum = _baseExtremum,
65865
+ baseGt = _baseGt,
65866
+ baseIteratee = _baseIteratee;
65867
+ /**
65868
+ * This method is like `_.max` except that it accepts `iteratee` which is
65869
+ * invoked for each element in `array` to generate the criterion by which
65870
+ * the value is ranked. The iteratee is invoked with one argument: (value).
65871
+ *
65872
+ * @static
65873
+ * @memberOf _
65874
+ * @since 4.0.0
65875
+ * @category Math
65876
+ * @param {Array} array The array to iterate over.
65877
+ * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
65878
+ * @returns {*} Returns the maximum value.
65879
+ * @example
65880
+ *
65881
+ * var objects = [{ 'n': 1 }, { 'n': 2 }];
65882
+ *
65883
+ * _.maxBy(objects, function(o) { return o.n; });
65884
+ * // => { 'n': 2 }
65885
+ *
65886
+ * // The `_.property` iteratee shorthand.
65887
+ * _.maxBy(objects, 'n');
65888
+ * // => { 'n': 2 }
65889
+ */
65890
+
65891
+ function maxBy(array, iteratee) {
65892
+ return array && array.length ? baseExtremum(array, baseIteratee(iteratee), baseGt) : undefined;
65893
+ }
65894
+
65895
+ var maxBy_1 = maxBy;
65896
+
65897
+ var THREE_SECONDS = 3000;
65898
+ var MAX_TRIES = 3;
65899
+ /** Check if the user's primary creator node is healthy */
65900
+
65901
+ var checkPrimaryHealthy = /*#__PURE__*/function () {
65902
+ var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(libs, primary, tries) {
65903
+ var healthy;
65904
+ return regeneratorRuntime.wrap(function _callee$(_context) {
65905
+ while (1) {
65906
+ switch (_context.prev = _context.next) {
65907
+ case 0:
65908
+ _context.next = 2;
65909
+ return Utils.isHealthy(primary);
65910
+
65911
+ case 2:
65912
+ healthy = _context.sent;
65913
+
65914
+ if (!healthy) {
65915
+ _context.next = 7;
65916
+ break;
65917
+ }
65918
+
65919
+ return _context.abrupt("return", healthy);
65920
+
65921
+ case 7:
65922
+ if (!(tries === 0)) {
65923
+ _context.next = 9;
65924
+ break;
65925
+ }
65926
+
65927
+ return _context.abrupt("return", false);
65928
+
65929
+ case 9:
65930
+ _context.next = 11;
65931
+ return Utils.wait(THREE_SECONDS);
65932
+
65933
+ case 11:
65934
+ _context.next = 13;
65935
+ return checkPrimaryHealthy(libs, primary, tries - 1);
65936
+
65937
+ case 13:
65938
+ return _context.abrupt("return", _context.sent);
65939
+
65940
+ case 14:
65941
+ case "end":
65942
+ return _context.stop();
65943
+ }
65944
+ }
65945
+ }, _callee);
65946
+ }));
65947
+
65948
+ return function checkPrimaryHealthy(_x, _x2, _x3) {
65949
+ return _ref.apply(this, arguments);
65950
+ };
65951
+ }();
65952
+ /** Gets new endpoints from a user's secondaries */
65953
+
65954
+
65955
+ var getNewPrimary = /*#__PURE__*/function () {
65956
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(secondaries, wallet) {
65957
+ var _maxBy;
65958
+
65959
+ var secondaryStatuses, max;
65960
+ return regeneratorRuntime.wrap(function _callee3$(_context3) {
65961
+ while (1) {
65962
+ switch (_context3.prev = _context3.next) {
65963
+ case 0:
65964
+ _context3.next = 2;
65965
+ return Promise.all(secondaries.map( /*#__PURE__*/function () {
65966
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(secondary) {
65967
+ var clockValue;
65968
+ return regeneratorRuntime.wrap(function _callee2$(_context2) {
65969
+ while (1) {
65970
+ switch (_context2.prev = _context2.next) {
65971
+ case 0:
65972
+ _context2.prev = 0;
65973
+ _context2.next = 3;
65974
+ return CreatorNode.getClockValue(secondary, wallet);
65975
+
65976
+ case 3:
65977
+ clockValue = _context2.sent;
65978
+
65979
+ if (!clockValue) {
65980
+ _context2.next = 6;
65981
+ break;
65982
+ }
65983
+
65984
+ return _context2.abrupt("return", {
65985
+ secondary: secondary,
65986
+ clockValue: clockValue
65987
+ });
65988
+
65989
+ case 6:
65990
+ return _context2.abrupt("return", undefined);
65991
+
65992
+ case 9:
65993
+ _context2.prev = 9;
65994
+ _context2.t0 = _context2["catch"](0);
65995
+ console.warn(_context2.t0);
65996
+ return _context2.abrupt("return", undefined);
65997
+
65998
+ case 13:
65999
+ case "end":
66000
+ return _context2.stop();
66001
+ }
66002
+ }
66003
+ }, _callee2, null, [[0, 9]]);
66004
+ }));
66005
+
66006
+ return function (_x6) {
66007
+ return _ref3.apply(this, arguments);
66008
+ };
66009
+ }()));
66010
+
66011
+ case 2:
66012
+ secondaryStatuses = _context3.sent.filter(Boolean);
66013
+ max = (_maxBy = maxBy_1(secondaryStatuses, function (s) {
66014
+ return s === null || s === void 0 ? void 0 : s.clockValue;
66015
+ })) === null || _maxBy === void 0 ? void 0 : _maxBy.secondary;
66016
+
66017
+ if (max) {
66018
+ _context3.next = 6;
66019
+ break;
66020
+ }
66021
+
66022
+ throw new Error("Could not find valid secondaries for user ".concat(secondaries));
66023
+
66024
+ case 6:
66025
+ return _context3.abrupt("return", max);
66026
+
66027
+ case 7:
66028
+ case "end":
66029
+ return _context3.stop();
66030
+ }
66031
+ }
66032
+ }, _callee3);
66033
+ }));
66034
+
66035
+ return function getNewPrimary(_x4, _x5) {
66036
+ return _ref2.apply(this, arguments);
66037
+ };
66038
+ }();
66039
+
66040
+ var rolloverNodes = /*#__PURE__*/function () {
66041
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(libs, creatorNodeWhitelist, creatorNodeBlacklist) {
66042
+ var _libs$userStateManage;
66043
+
66044
+ var user, primary, healthy, secondaries, _libs$ServiceProvider, _libs$User, _libs$User2, _libs$creatorNode, _libs$User3, newPrimary, index, newSecondaries, autoselect, newEndpoints, newMetadata;
66045
+
66046
+ return regeneratorRuntime.wrap(function _callee4$(_context4) {
66047
+ while (1) {
66048
+ switch (_context4.prev = _context4.next) {
66049
+ case 0:
66050
+ console.debug('Sanity Check - rolloverNodes');
66051
+ user = (_libs$userStateManage = libs.userStateManager) === null || _libs$userStateManage === void 0 ? void 0 : _libs$userStateManage.getCurrentUser();
66052
+
66053
+ if (user) {
66054
+ _context4.next = 4;
66055
+ break;
66056
+ }
66057
+
66058
+ return _context4.abrupt("return");
66059
+
66060
+ case 4:
66061
+ primary = CreatorNode.getPrimary(user.creator_node_endpoint);
66062
+
66063
+ if (primary) {
66064
+ _context4.next = 7;
66065
+ break;
66066
+ }
66067
+
66068
+ return _context4.abrupt("return");
66069
+
66070
+ case 7:
66071
+ _context4.next = 9;
66072
+ return checkPrimaryHealthy(libs, primary, MAX_TRIES);
66073
+
66074
+ case 9:
66075
+ healthy = _context4.sent;
66076
+
66077
+ if (!(healthy && !(creatorNodeBlacklist !== null && creatorNodeBlacklist !== void 0 && creatorNodeBlacklist.has(primary)))) {
66078
+ _context4.next = 12;
66079
+ break;
66080
+ }
66081
+
66082
+ return _context4.abrupt("return");
66083
+
66084
+ case 12:
66085
+ secondaries = CreatorNode.getSecondaries(user.creator_node_endpoint);
66086
+ _context4.prev = 13;
66087
+ _context4.next = 16;
66088
+ return getNewPrimary(secondaries, user.wallet);
66089
+
66090
+ case 16:
66091
+ newPrimary = _context4.sent;
66092
+ index = secondaries.indexOf(newPrimary); // Get new secondaries and backfill up to 2
66093
+
66094
+ newSecondaries = _toConsumableArray(secondaries);
66095
+ newSecondaries.splice(index, 1);
66096
+ _context4.next = 22;
66097
+ return (_libs$ServiceProvider = libs.ServiceProvider) === null || _libs$ServiceProvider === void 0 ? void 0 : _libs$ServiceProvider.autoSelectCreatorNodes({
66098
+ numberOfNodes: 2 - newSecondaries.length,
66099
+ whitelist: creatorNodeWhitelist,
66100
+ // Exclude ones we currently have
66101
+ blacklist: new Set([newPrimary].concat(_toConsumableArray(newSecondaries))),
66102
+ preferHigherPatchForPrimary: (_libs$User = libs.User) === null || _libs$User === void 0 ? void 0 : _libs$User.preferHigherPatchForPrimary,
66103
+ preferHigherPatchForSecondaries: (_libs$User2 = libs.User) === null || _libs$User2 === void 0 ? void 0 : _libs$User2.preferHigherPatchForSecondaries
66104
+ });
66105
+
66106
+ case 22:
66107
+ autoselect = _context4.sent;
66108
+
66109
+ if (autoselect) {
66110
+ newSecondaries = newSecondaries.concat([autoselect.primary].concat(_toConsumableArray(autoselect.secondaries)));
66111
+ } // Set the new endpoint and connect to it
66112
+
66113
+
66114
+ newEndpoints = [newPrimary].concat(_toConsumableArray(newSecondaries));
66115
+ _context4.next = 27;
66116
+ return (_libs$creatorNode = libs.creatorNode) === null || _libs$creatorNode === void 0 ? void 0 : _libs$creatorNode.setEndpoint(newEndpoints[0]);
66117
+
66118
+ case 27:
66119
+ // Update the user
66120
+ newMetadata = _objectSpread2({}, user);
66121
+ newMetadata.creator_node_endpoint = newEndpoints.join(',');
66122
+ console.debug("Sanity Check - rolloverNodes - new nodes ".concat(newMetadata.creator_node_endpoint));
66123
+ _context4.next = 32;
66124
+ return (_libs$User3 = libs.User) === null || _libs$User3 === void 0 ? void 0 : _libs$User3.updateCreator(user.user_id, newMetadata, true
66125
+ /* useEntityManager */
66126
+ );
66127
+
66128
+ case 32:
66129
+ _context4.next = 37;
66130
+ break;
66131
+
66132
+ case 34:
66133
+ _context4.prev = 34;
66134
+ _context4.t0 = _context4["catch"](13);
66135
+ console.error(_context4.t0);
66136
+
66137
+ case 37:
66138
+ case "end":
66139
+ return _context4.stop();
66140
+ }
66141
+ }
66142
+ }, _callee4, null, [[13, 34]]);
66143
+ }));
66144
+
66145
+ return function rolloverNodes(_x7, _x8, _x9) {
66146
+ return _ref4.apply(this, arguments);
62935
66147
  };
62936
66148
  }();
62937
66149