@reactuses/core 2.2.6 → 2.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -3,12 +3,10 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
- var lodash = require('lodash');
7
6
 
8
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
9
8
 
10
9
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
11
- var lodash__default = /*#__PURE__*/_interopDefaultLegacy(lodash);
12
10
 
13
11
  function usePrevious(state) {
14
12
  const ref = React.useRef();
@@ -49,7 +47,8 @@ var useUpdateEffect = createUpdateEffect(React.useEffect);
49
47
  var index$4 = createUpdateEffect(React.useLayoutEffect);
50
48
 
51
49
  var _a;
52
- const isFunction = (val) => typeof val === "function";
50
+ const isFunction$1 = (val) => typeof val === "function";
51
+ const isString = (val) => typeof val === "string";
53
52
  const isDev = process.env.NODE_ENV === "development" || process.env.NODE_ENV === "test";
54
53
  const isBrowser = typeof window !== "undefined";
55
54
  const isNavigator = typeof navigator !== "undefined";
@@ -66,7 +65,7 @@ const useIsomorphicLayoutEffect = isBrowser ? React.useLayoutEffect : React.useE
66
65
 
67
66
  function useEvent(fn) {
68
67
  if (isDev) {
69
- if (!isFunction(fn)) {
68
+ if (!isFunction$1(fn)) {
70
69
  console.error(
71
70
  `useEvent expected parameter is a function, got ${typeof fn}`
72
71
  );
@@ -82,6 +81,2412 @@ function useEvent(fn) {
82
81
  }, []);
83
82
  }
84
83
 
84
+ /** Detect free variable `global` from Node.js. */
85
+ var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
86
+
87
+ /** Detect free variable `self`. */
88
+ var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
89
+
90
+ /** Used as a reference to the global object. */
91
+ var root = freeGlobal || freeSelf || Function('return this')();
92
+
93
+ /** Built-in value references. */
94
+ var Symbol = root.Symbol;
95
+
96
+ /** Used for built-in method references. */
97
+ var objectProto$b = Object.prototype;
98
+
99
+ /** Used to check objects for own properties. */
100
+ var hasOwnProperty$8 = objectProto$b.hasOwnProperty;
101
+
102
+ /**
103
+ * Used to resolve the
104
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
105
+ * of values.
106
+ */
107
+ var nativeObjectToString$1 = objectProto$b.toString;
108
+
109
+ /** Built-in value references. */
110
+ var symToStringTag$1 = Symbol ? Symbol.toStringTag : undefined;
111
+
112
+ /**
113
+ * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
114
+ *
115
+ * @private
116
+ * @param {*} value The value to query.
117
+ * @returns {string} Returns the raw `toStringTag`.
118
+ */
119
+ function getRawTag(value) {
120
+ var isOwn = hasOwnProperty$8.call(value, symToStringTag$1),
121
+ tag = value[symToStringTag$1];
122
+
123
+ try {
124
+ value[symToStringTag$1] = undefined;
125
+ var unmasked = true;
126
+ } catch (e) {}
127
+
128
+ var result = nativeObjectToString$1.call(value);
129
+ if (unmasked) {
130
+ if (isOwn) {
131
+ value[symToStringTag$1] = tag;
132
+ } else {
133
+ delete value[symToStringTag$1];
134
+ }
135
+ }
136
+ return result;
137
+ }
138
+
139
+ /** Used for built-in method references. */
140
+ var objectProto$a = Object.prototype;
141
+
142
+ /**
143
+ * Used to resolve the
144
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
145
+ * of values.
146
+ */
147
+ var nativeObjectToString = objectProto$a.toString;
148
+
149
+ /**
150
+ * Converts `value` to a string using `Object.prototype.toString`.
151
+ *
152
+ * @private
153
+ * @param {*} value The value to convert.
154
+ * @returns {string} Returns the converted string.
155
+ */
156
+ function objectToString(value) {
157
+ return nativeObjectToString.call(value);
158
+ }
159
+
160
+ /** `Object#toString` result references. */
161
+ var nullTag = '[object Null]',
162
+ undefinedTag = '[object Undefined]';
163
+
164
+ /** Built-in value references. */
165
+ var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
166
+
167
+ /**
168
+ * The base implementation of `getTag` without fallbacks for buggy environments.
169
+ *
170
+ * @private
171
+ * @param {*} value The value to query.
172
+ * @returns {string} Returns the `toStringTag`.
173
+ */
174
+ function baseGetTag(value) {
175
+ if (value == null) {
176
+ return value === undefined ? undefinedTag : nullTag;
177
+ }
178
+ return (symToStringTag && symToStringTag in Object(value))
179
+ ? getRawTag(value)
180
+ : objectToString(value);
181
+ }
182
+
183
+ /**
184
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
185
+ * and has a `typeof` result of "object".
186
+ *
187
+ * @static
188
+ * @memberOf _
189
+ * @since 4.0.0
190
+ * @category Lang
191
+ * @param {*} value The value to check.
192
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
193
+ * @example
194
+ *
195
+ * _.isObjectLike({});
196
+ * // => true
197
+ *
198
+ * _.isObjectLike([1, 2, 3]);
199
+ * // => true
200
+ *
201
+ * _.isObjectLike(_.noop);
202
+ * // => false
203
+ *
204
+ * _.isObjectLike(null);
205
+ * // => false
206
+ */
207
+ function isObjectLike(value) {
208
+ return value != null && typeof value == 'object';
209
+ }
210
+
211
+ /** `Object#toString` result references. */
212
+ var symbolTag$1 = '[object Symbol]';
213
+
214
+ /**
215
+ * Checks if `value` is classified as a `Symbol` primitive or object.
216
+ *
217
+ * @static
218
+ * @memberOf _
219
+ * @since 4.0.0
220
+ * @category Lang
221
+ * @param {*} value The value to check.
222
+ * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
223
+ * @example
224
+ *
225
+ * _.isSymbol(Symbol.iterator);
226
+ * // => true
227
+ *
228
+ * _.isSymbol('abc');
229
+ * // => false
230
+ */
231
+ function isSymbol(value) {
232
+ return typeof value == 'symbol' ||
233
+ (isObjectLike(value) && baseGetTag(value) == symbolTag$1);
234
+ }
235
+
236
+ /**
237
+ * Checks if `value` is classified as an `Array` object.
238
+ *
239
+ * @static
240
+ * @memberOf _
241
+ * @since 0.1.0
242
+ * @category Lang
243
+ * @param {*} value The value to check.
244
+ * @returns {boolean} Returns `true` if `value` is an array, else `false`.
245
+ * @example
246
+ *
247
+ * _.isArray([1, 2, 3]);
248
+ * // => true
249
+ *
250
+ * _.isArray(document.body.children);
251
+ * // => false
252
+ *
253
+ * _.isArray('abc');
254
+ * // => false
255
+ *
256
+ * _.isArray(_.noop);
257
+ * // => false
258
+ */
259
+ var isArray = Array.isArray;
260
+
261
+ /** Used to match a single whitespace character. */
262
+ var reWhitespace = /\s/;
263
+
264
+ /**
265
+ * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
266
+ * character of `string`.
267
+ *
268
+ * @private
269
+ * @param {string} string The string to inspect.
270
+ * @returns {number} Returns the index of the last non-whitespace character.
271
+ */
272
+ function trimmedEndIndex(string) {
273
+ var index = string.length;
274
+
275
+ while (index-- && reWhitespace.test(string.charAt(index))) {}
276
+ return index;
277
+ }
278
+
279
+ /** Used to match leading whitespace. */
280
+ var reTrimStart = /^\s+/;
281
+
282
+ /**
283
+ * The base implementation of `_.trim`.
284
+ *
285
+ * @private
286
+ * @param {string} string The string to trim.
287
+ * @returns {string} Returns the trimmed string.
288
+ */
289
+ function baseTrim(string) {
290
+ return string
291
+ ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
292
+ : string;
293
+ }
294
+
295
+ /**
296
+ * Checks if `value` is the
297
+ * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
298
+ * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
299
+ *
300
+ * @static
301
+ * @memberOf _
302
+ * @since 0.1.0
303
+ * @category Lang
304
+ * @param {*} value The value to check.
305
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
306
+ * @example
307
+ *
308
+ * _.isObject({});
309
+ * // => true
310
+ *
311
+ * _.isObject([1, 2, 3]);
312
+ * // => true
313
+ *
314
+ * _.isObject(_.noop);
315
+ * // => true
316
+ *
317
+ * _.isObject(null);
318
+ * // => false
319
+ */
320
+ function isObject(value) {
321
+ var type = typeof value;
322
+ return value != null && (type == 'object' || type == 'function');
323
+ }
324
+
325
+ /** Used as references for various `Number` constants. */
326
+ var NAN = 0 / 0;
327
+
328
+ /** Used to detect bad signed hexadecimal string values. */
329
+ var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
330
+
331
+ /** Used to detect binary string values. */
332
+ var reIsBinary = /^0b[01]+$/i;
333
+
334
+ /** Used to detect octal string values. */
335
+ var reIsOctal = /^0o[0-7]+$/i;
336
+
337
+ /** Built-in method references without a dependency on `root`. */
338
+ var freeParseInt = parseInt;
339
+
340
+ /**
341
+ * Converts `value` to a number.
342
+ *
343
+ * @static
344
+ * @memberOf _
345
+ * @since 4.0.0
346
+ * @category Lang
347
+ * @param {*} value The value to process.
348
+ * @returns {number} Returns the number.
349
+ * @example
350
+ *
351
+ * _.toNumber(3.2);
352
+ * // => 3.2
353
+ *
354
+ * _.toNumber(Number.MIN_VALUE);
355
+ * // => 5e-324
356
+ *
357
+ * _.toNumber(Infinity);
358
+ * // => Infinity
359
+ *
360
+ * _.toNumber('3.2');
361
+ * // => 3.2
362
+ */
363
+ function toNumber(value) {
364
+ if (typeof value == 'number') {
365
+ return value;
366
+ }
367
+ if (isSymbol(value)) {
368
+ return NAN;
369
+ }
370
+ if (isObject(value)) {
371
+ var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
372
+ value = isObject(other) ? (other + '') : other;
373
+ }
374
+ if (typeof value != 'string') {
375
+ return value === 0 ? value : +value;
376
+ }
377
+ value = baseTrim(value);
378
+ var isBinary = reIsBinary.test(value);
379
+ return (isBinary || reIsOctal.test(value))
380
+ ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
381
+ : (reIsBadHex.test(value) ? NAN : +value);
382
+ }
383
+
384
+ /** `Object#toString` result references. */
385
+ var asyncTag = '[object AsyncFunction]',
386
+ funcTag$1 = '[object Function]',
387
+ genTag = '[object GeneratorFunction]',
388
+ proxyTag = '[object Proxy]';
389
+
390
+ /**
391
+ * Checks if `value` is classified as a `Function` object.
392
+ *
393
+ * @static
394
+ * @memberOf _
395
+ * @since 0.1.0
396
+ * @category Lang
397
+ * @param {*} value The value to check.
398
+ * @returns {boolean} Returns `true` if `value` is a function, else `false`.
399
+ * @example
400
+ *
401
+ * _.isFunction(_);
402
+ * // => true
403
+ *
404
+ * _.isFunction(/abc/);
405
+ * // => false
406
+ */
407
+ function isFunction(value) {
408
+ if (!isObject(value)) {
409
+ return false;
410
+ }
411
+ // The use of `Object#toString` avoids issues with the `typeof` operator
412
+ // in Safari 9 which returns 'object' for typed arrays and other constructors.
413
+ var tag = baseGetTag(value);
414
+ return tag == funcTag$1 || tag == genTag || tag == asyncTag || tag == proxyTag;
415
+ }
416
+
417
+ /** Used to detect overreaching core-js shims. */
418
+ var coreJsData = root['__core-js_shared__'];
419
+
420
+ /** Used to detect methods masquerading as native. */
421
+ var maskSrcKey = (function() {
422
+ var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
423
+ return uid ? ('Symbol(src)_1.' + uid) : '';
424
+ }());
425
+
426
+ /**
427
+ * Checks if `func` has its source masked.
428
+ *
429
+ * @private
430
+ * @param {Function} func The function to check.
431
+ * @returns {boolean} Returns `true` if `func` is masked, else `false`.
432
+ */
433
+ function isMasked(func) {
434
+ return !!maskSrcKey && (maskSrcKey in func);
435
+ }
436
+
437
+ /** Used for built-in method references. */
438
+ var funcProto$1 = Function.prototype;
439
+
440
+ /** Used to resolve the decompiled source of functions. */
441
+ var funcToString$1 = funcProto$1.toString;
442
+
443
+ /**
444
+ * Converts `func` to its source code.
445
+ *
446
+ * @private
447
+ * @param {Function} func The function to convert.
448
+ * @returns {string} Returns the source code.
449
+ */
450
+ function toSource(func) {
451
+ if (func != null) {
452
+ try {
453
+ return funcToString$1.call(func);
454
+ } catch (e) {}
455
+ try {
456
+ return (func + '');
457
+ } catch (e) {}
458
+ }
459
+ return '';
460
+ }
461
+
462
+ /**
463
+ * Used to match `RegExp`
464
+ * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
465
+ */
466
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
467
+
468
+ /** Used to detect host constructors (Safari). */
469
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
470
+
471
+ /** Used for built-in method references. */
472
+ var funcProto = Function.prototype,
473
+ objectProto$9 = Object.prototype;
474
+
475
+ /** Used to resolve the decompiled source of functions. */
476
+ var funcToString = funcProto.toString;
477
+
478
+ /** Used to check objects for own properties. */
479
+ var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
480
+
481
+ /** Used to detect if a method is native. */
482
+ var reIsNative = RegExp('^' +
483
+ funcToString.call(hasOwnProperty$7).replace(reRegExpChar, '\\$&')
484
+ .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
485
+ );
486
+
487
+ /**
488
+ * The base implementation of `_.isNative` without bad shim checks.
489
+ *
490
+ * @private
491
+ * @param {*} value The value to check.
492
+ * @returns {boolean} Returns `true` if `value` is a native function,
493
+ * else `false`.
494
+ */
495
+ function baseIsNative(value) {
496
+ if (!isObject(value) || isMasked(value)) {
497
+ return false;
498
+ }
499
+ var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
500
+ return pattern.test(toSource(value));
501
+ }
502
+
503
+ /**
504
+ * Gets the value at `key` of `object`.
505
+ *
506
+ * @private
507
+ * @param {Object} [object] The object to query.
508
+ * @param {string} key The key of the property to get.
509
+ * @returns {*} Returns the property value.
510
+ */
511
+ function getValue(object, key) {
512
+ return object == null ? undefined : object[key];
513
+ }
514
+
515
+ /**
516
+ * Gets the native function at `key` of `object`.
517
+ *
518
+ * @private
519
+ * @param {Object} object The object to query.
520
+ * @param {string} key The key of the method to get.
521
+ * @returns {*} Returns the function if it's native, else `undefined`.
522
+ */
523
+ function getNative(object, key) {
524
+ var value = getValue(object, key);
525
+ return baseIsNative(value) ? value : undefined;
526
+ }
527
+
528
+ /* Built-in method references that are verified to be native. */
529
+ var WeakMap = getNative(root, 'WeakMap');
530
+
531
+ /** Used as references for various `Number` constants. */
532
+ var MAX_SAFE_INTEGER$1 = 9007199254740991;
533
+
534
+ /** Used to detect unsigned integer values. */
535
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
536
+
537
+ /**
538
+ * Checks if `value` is a valid array-like index.
539
+ *
540
+ * @private
541
+ * @param {*} value The value to check.
542
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
543
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
544
+ */
545
+ function isIndex(value, length) {
546
+ var type = typeof value;
547
+ length = length == null ? MAX_SAFE_INTEGER$1 : length;
548
+
549
+ return !!length &&
550
+ (type == 'number' ||
551
+ (type != 'symbol' && reIsUint.test(value))) &&
552
+ (value > -1 && value % 1 == 0 && value < length);
553
+ }
554
+
555
+ /**
556
+ * Performs a
557
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
558
+ * comparison between two values to determine if they are equivalent.
559
+ *
560
+ * @static
561
+ * @memberOf _
562
+ * @since 4.0.0
563
+ * @category Lang
564
+ * @param {*} value The value to compare.
565
+ * @param {*} other The other value to compare.
566
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
567
+ * @example
568
+ *
569
+ * var object = { 'a': 1 };
570
+ * var other = { 'a': 1 };
571
+ *
572
+ * _.eq(object, object);
573
+ * // => true
574
+ *
575
+ * _.eq(object, other);
576
+ * // => false
577
+ *
578
+ * _.eq('a', 'a');
579
+ * // => true
580
+ *
581
+ * _.eq('a', Object('a'));
582
+ * // => false
583
+ *
584
+ * _.eq(NaN, NaN);
585
+ * // => true
586
+ */
587
+ function eq(value, other) {
588
+ return value === other || (value !== value && other !== other);
589
+ }
590
+
591
+ /** Used as references for various `Number` constants. */
592
+ var MAX_SAFE_INTEGER = 9007199254740991;
593
+
594
+ /**
595
+ * Checks if `value` is a valid array-like length.
596
+ *
597
+ * **Note:** This method is loosely based on
598
+ * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
599
+ *
600
+ * @static
601
+ * @memberOf _
602
+ * @since 4.0.0
603
+ * @category Lang
604
+ * @param {*} value The value to check.
605
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
606
+ * @example
607
+ *
608
+ * _.isLength(3);
609
+ * // => true
610
+ *
611
+ * _.isLength(Number.MIN_VALUE);
612
+ * // => false
613
+ *
614
+ * _.isLength(Infinity);
615
+ * // => false
616
+ *
617
+ * _.isLength('3');
618
+ * // => false
619
+ */
620
+ function isLength(value) {
621
+ return typeof value == 'number' &&
622
+ value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
623
+ }
624
+
625
+ /**
626
+ * Checks if `value` is array-like. A value is considered array-like if it's
627
+ * not a function and has a `value.length` that's an integer greater than or
628
+ * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
629
+ *
630
+ * @static
631
+ * @memberOf _
632
+ * @since 4.0.0
633
+ * @category Lang
634
+ * @param {*} value The value to check.
635
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
636
+ * @example
637
+ *
638
+ * _.isArrayLike([1, 2, 3]);
639
+ * // => true
640
+ *
641
+ * _.isArrayLike(document.body.children);
642
+ * // => true
643
+ *
644
+ * _.isArrayLike('abc');
645
+ * // => true
646
+ *
647
+ * _.isArrayLike(_.noop);
648
+ * // => false
649
+ */
650
+ function isArrayLike(value) {
651
+ return value != null && isLength(value.length) && !isFunction(value);
652
+ }
653
+
654
+ /** Used for built-in method references. */
655
+ var objectProto$8 = Object.prototype;
656
+
657
+ /**
658
+ * Checks if `value` is likely a prototype object.
659
+ *
660
+ * @private
661
+ * @param {*} value The value to check.
662
+ * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
663
+ */
664
+ function isPrototype(value) {
665
+ var Ctor = value && value.constructor,
666
+ proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$8;
667
+
668
+ return value === proto;
669
+ }
670
+
671
+ /**
672
+ * The base implementation of `_.times` without support for iteratee shorthands
673
+ * or max array length checks.
674
+ *
675
+ * @private
676
+ * @param {number} n The number of times to invoke `iteratee`.
677
+ * @param {Function} iteratee The function invoked per iteration.
678
+ * @returns {Array} Returns the array of results.
679
+ */
680
+ function baseTimes(n, iteratee) {
681
+ var index = -1,
682
+ result = Array(n);
683
+
684
+ while (++index < n) {
685
+ result[index] = iteratee(index);
686
+ }
687
+ return result;
688
+ }
689
+
690
+ /** `Object#toString` result references. */
691
+ var argsTag$2 = '[object Arguments]';
692
+
693
+ /**
694
+ * The base implementation of `_.isArguments`.
695
+ *
696
+ * @private
697
+ * @param {*} value The value to check.
698
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
699
+ */
700
+ function baseIsArguments(value) {
701
+ return isObjectLike(value) && baseGetTag(value) == argsTag$2;
702
+ }
703
+
704
+ /** Used for built-in method references. */
705
+ var objectProto$7 = Object.prototype;
706
+
707
+ /** Used to check objects for own properties. */
708
+ var hasOwnProperty$6 = objectProto$7.hasOwnProperty;
709
+
710
+ /** Built-in value references. */
711
+ var propertyIsEnumerable$1 = objectProto$7.propertyIsEnumerable;
712
+
713
+ /**
714
+ * Checks if `value` is likely an `arguments` object.
715
+ *
716
+ * @static
717
+ * @memberOf _
718
+ * @since 0.1.0
719
+ * @category Lang
720
+ * @param {*} value The value to check.
721
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
722
+ * else `false`.
723
+ * @example
724
+ *
725
+ * _.isArguments(function() { return arguments; }());
726
+ * // => true
727
+ *
728
+ * _.isArguments([1, 2, 3]);
729
+ * // => false
730
+ */
731
+ var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
732
+ return isObjectLike(value) && hasOwnProperty$6.call(value, 'callee') &&
733
+ !propertyIsEnumerable$1.call(value, 'callee');
734
+ };
735
+
736
+ /**
737
+ * This method returns `false`.
738
+ *
739
+ * @static
740
+ * @memberOf _
741
+ * @since 4.13.0
742
+ * @category Util
743
+ * @returns {boolean} Returns `false`.
744
+ * @example
745
+ *
746
+ * _.times(2, _.stubFalse);
747
+ * // => [false, false]
748
+ */
749
+ function stubFalse() {
750
+ return false;
751
+ }
752
+
753
+ /** Detect free variable `exports`. */
754
+ var freeExports$1 = typeof exports == 'object' && exports && !exports.nodeType && exports;
755
+
756
+ /** Detect free variable `module`. */
757
+ var freeModule$1 = freeExports$1 && typeof module == 'object' && module && !module.nodeType && module;
758
+
759
+ /** Detect the popular CommonJS extension `module.exports`. */
760
+ var moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1;
761
+
762
+ /** Built-in value references. */
763
+ var Buffer = moduleExports$1 ? root.Buffer : undefined;
764
+
765
+ /* Built-in method references for those with the same name as other `lodash` methods. */
766
+ var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
767
+
768
+ /**
769
+ * Checks if `value` is a buffer.
770
+ *
771
+ * @static
772
+ * @memberOf _
773
+ * @since 4.3.0
774
+ * @category Lang
775
+ * @param {*} value The value to check.
776
+ * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
777
+ * @example
778
+ *
779
+ * _.isBuffer(new Buffer(2));
780
+ * // => true
781
+ *
782
+ * _.isBuffer(new Uint8Array(2));
783
+ * // => false
784
+ */
785
+ var isBuffer = nativeIsBuffer || stubFalse;
786
+
787
+ /** `Object#toString` result references. */
788
+ var argsTag$1 = '[object Arguments]',
789
+ arrayTag$1 = '[object Array]',
790
+ boolTag$1 = '[object Boolean]',
791
+ dateTag$1 = '[object Date]',
792
+ errorTag$1 = '[object Error]',
793
+ funcTag = '[object Function]',
794
+ mapTag$2 = '[object Map]',
795
+ numberTag$1 = '[object Number]',
796
+ objectTag$2 = '[object Object]',
797
+ regexpTag$1 = '[object RegExp]',
798
+ setTag$2 = '[object Set]',
799
+ stringTag$1 = '[object String]',
800
+ weakMapTag$1 = '[object WeakMap]';
801
+
802
+ var arrayBufferTag$1 = '[object ArrayBuffer]',
803
+ dataViewTag$2 = '[object DataView]',
804
+ float32Tag = '[object Float32Array]',
805
+ float64Tag = '[object Float64Array]',
806
+ int8Tag = '[object Int8Array]',
807
+ int16Tag = '[object Int16Array]',
808
+ int32Tag = '[object Int32Array]',
809
+ uint8Tag = '[object Uint8Array]',
810
+ uint8ClampedTag = '[object Uint8ClampedArray]',
811
+ uint16Tag = '[object Uint16Array]',
812
+ uint32Tag = '[object Uint32Array]';
813
+
814
+ /** Used to identify `toStringTag` values of typed arrays. */
815
+ var typedArrayTags = {};
816
+ typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
817
+ typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
818
+ typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
819
+ typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
820
+ typedArrayTags[uint32Tag] = true;
821
+ typedArrayTags[argsTag$1] = typedArrayTags[arrayTag$1] =
822
+ typedArrayTags[arrayBufferTag$1] = typedArrayTags[boolTag$1] =
823
+ typedArrayTags[dataViewTag$2] = typedArrayTags[dateTag$1] =
824
+ typedArrayTags[errorTag$1] = typedArrayTags[funcTag] =
825
+ typedArrayTags[mapTag$2] = typedArrayTags[numberTag$1] =
826
+ typedArrayTags[objectTag$2] = typedArrayTags[regexpTag$1] =
827
+ typedArrayTags[setTag$2] = typedArrayTags[stringTag$1] =
828
+ typedArrayTags[weakMapTag$1] = false;
829
+
830
+ /**
831
+ * The base implementation of `_.isTypedArray` without Node.js optimizations.
832
+ *
833
+ * @private
834
+ * @param {*} value The value to check.
835
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
836
+ */
837
+ function baseIsTypedArray(value) {
838
+ return isObjectLike(value) &&
839
+ isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
840
+ }
841
+
842
+ /**
843
+ * The base implementation of `_.unary` without support for storing metadata.
844
+ *
845
+ * @private
846
+ * @param {Function} func The function to cap arguments for.
847
+ * @returns {Function} Returns the new capped function.
848
+ */
849
+ function baseUnary(func) {
850
+ return function(value) {
851
+ return func(value);
852
+ };
853
+ }
854
+
855
+ /** Detect free variable `exports`. */
856
+ var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
857
+
858
+ /** Detect free variable `module`. */
859
+ var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
860
+
861
+ /** Detect the popular CommonJS extension `module.exports`. */
862
+ var moduleExports = freeModule && freeModule.exports === freeExports;
863
+
864
+ /** Detect free variable `process` from Node.js. */
865
+ var freeProcess = moduleExports && freeGlobal.process;
866
+
867
+ /** Used to access faster Node.js helpers. */
868
+ var nodeUtil = (function() {
869
+ try {
870
+ // Use `util.types` for Node.js 10+.
871
+ var types = freeModule && freeModule.require && freeModule.require('util').types;
872
+
873
+ if (types) {
874
+ return types;
875
+ }
876
+
877
+ // Legacy `process.binding('util')` for Node.js < 10.
878
+ return freeProcess && freeProcess.binding && freeProcess.binding('util');
879
+ } catch (e) {}
880
+ }());
881
+
882
+ /* Node.js helper references. */
883
+ var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
884
+
885
+ /**
886
+ * Checks if `value` is classified as a typed array.
887
+ *
888
+ * @static
889
+ * @memberOf _
890
+ * @since 3.0.0
891
+ * @category Lang
892
+ * @param {*} value The value to check.
893
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
894
+ * @example
895
+ *
896
+ * _.isTypedArray(new Uint8Array);
897
+ * // => true
898
+ *
899
+ * _.isTypedArray([]);
900
+ * // => false
901
+ */
902
+ var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
903
+
904
+ /** Used for built-in method references. */
905
+ var objectProto$6 = Object.prototype;
906
+
907
+ /** Used to check objects for own properties. */
908
+ var hasOwnProperty$5 = objectProto$6.hasOwnProperty;
909
+
910
+ /**
911
+ * Creates an array of the enumerable property names of the array-like `value`.
912
+ *
913
+ * @private
914
+ * @param {*} value The value to query.
915
+ * @param {boolean} inherited Specify returning inherited property names.
916
+ * @returns {Array} Returns the array of property names.
917
+ */
918
+ function arrayLikeKeys(value, inherited) {
919
+ var isArr = isArray(value),
920
+ isArg = !isArr && isArguments(value),
921
+ isBuff = !isArr && !isArg && isBuffer(value),
922
+ isType = !isArr && !isArg && !isBuff && isTypedArray(value),
923
+ skipIndexes = isArr || isArg || isBuff || isType,
924
+ result = skipIndexes ? baseTimes(value.length, String) : [],
925
+ length = result.length;
926
+
927
+ for (var key in value) {
928
+ if ((inherited || hasOwnProperty$5.call(value, key)) &&
929
+ !(skipIndexes && (
930
+ // Safari 9 has enumerable `arguments.length` in strict mode.
931
+ key == 'length' ||
932
+ // Node.js 0.10 has enumerable non-index properties on buffers.
933
+ (isBuff && (key == 'offset' || key == 'parent')) ||
934
+ // PhantomJS 2 has enumerable non-index properties on typed arrays.
935
+ (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
936
+ // Skip index properties.
937
+ isIndex(key, length)
938
+ ))) {
939
+ result.push(key);
940
+ }
941
+ }
942
+ return result;
943
+ }
944
+
945
+ /**
946
+ * Creates a unary function that invokes `func` with its argument transformed.
947
+ *
948
+ * @private
949
+ * @param {Function} func The function to wrap.
950
+ * @param {Function} transform The argument transform.
951
+ * @returns {Function} Returns the new function.
952
+ */
953
+ function overArg(func, transform) {
954
+ return function(arg) {
955
+ return func(transform(arg));
956
+ };
957
+ }
958
+
959
+ /* Built-in method references for those with the same name as other `lodash` methods. */
960
+ var nativeKeys = overArg(Object.keys, Object);
961
+
962
+ /** Used for built-in method references. */
963
+ var objectProto$5 = Object.prototype;
964
+
965
+ /** Used to check objects for own properties. */
966
+ var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
967
+
968
+ /**
969
+ * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
970
+ *
971
+ * @private
972
+ * @param {Object} object The object to query.
973
+ * @returns {Array} Returns the array of property names.
974
+ */
975
+ function baseKeys(object) {
976
+ if (!isPrototype(object)) {
977
+ return nativeKeys(object);
978
+ }
979
+ var result = [];
980
+ for (var key in Object(object)) {
981
+ if (hasOwnProperty$4.call(object, key) && key != 'constructor') {
982
+ result.push(key);
983
+ }
984
+ }
985
+ return result;
986
+ }
987
+
988
+ /**
989
+ * Creates an array of the own enumerable property names of `object`.
990
+ *
991
+ * **Note:** Non-object values are coerced to objects. See the
992
+ * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
993
+ * for more details.
994
+ *
995
+ * @static
996
+ * @since 0.1.0
997
+ * @memberOf _
998
+ * @category Object
999
+ * @param {Object} object The object to query.
1000
+ * @returns {Array} Returns the array of property names.
1001
+ * @example
1002
+ *
1003
+ * function Foo() {
1004
+ * this.a = 1;
1005
+ * this.b = 2;
1006
+ * }
1007
+ *
1008
+ * Foo.prototype.c = 3;
1009
+ *
1010
+ * _.keys(new Foo);
1011
+ * // => ['a', 'b'] (iteration order is not guaranteed)
1012
+ *
1013
+ * _.keys('hi');
1014
+ * // => ['0', '1']
1015
+ */
1016
+ function keys(object) {
1017
+ return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
1018
+ }
1019
+
1020
+ /* Built-in method references that are verified to be native. */
1021
+ var nativeCreate = getNative(Object, 'create');
1022
+
1023
+ /**
1024
+ * Removes all key-value entries from the hash.
1025
+ *
1026
+ * @private
1027
+ * @name clear
1028
+ * @memberOf Hash
1029
+ */
1030
+ function hashClear() {
1031
+ this.__data__ = nativeCreate ? nativeCreate(null) : {};
1032
+ this.size = 0;
1033
+ }
1034
+
1035
+ /**
1036
+ * Removes `key` and its value from the hash.
1037
+ *
1038
+ * @private
1039
+ * @name delete
1040
+ * @memberOf Hash
1041
+ * @param {Object} hash The hash to modify.
1042
+ * @param {string} key The key of the value to remove.
1043
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1044
+ */
1045
+ function hashDelete(key) {
1046
+ var result = this.has(key) && delete this.__data__[key];
1047
+ this.size -= result ? 1 : 0;
1048
+ return result;
1049
+ }
1050
+
1051
+ /** Used to stand-in for `undefined` hash values. */
1052
+ var HASH_UNDEFINED$2 = '__lodash_hash_undefined__';
1053
+
1054
+ /** Used for built-in method references. */
1055
+ var objectProto$4 = Object.prototype;
1056
+
1057
+ /** Used to check objects for own properties. */
1058
+ var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
1059
+
1060
+ /**
1061
+ * Gets the hash value for `key`.
1062
+ *
1063
+ * @private
1064
+ * @name get
1065
+ * @memberOf Hash
1066
+ * @param {string} key The key of the value to get.
1067
+ * @returns {*} Returns the entry value.
1068
+ */
1069
+ function hashGet(key) {
1070
+ var data = this.__data__;
1071
+ if (nativeCreate) {
1072
+ var result = data[key];
1073
+ return result === HASH_UNDEFINED$2 ? undefined : result;
1074
+ }
1075
+ return hasOwnProperty$3.call(data, key) ? data[key] : undefined;
1076
+ }
1077
+
1078
+ /** Used for built-in method references. */
1079
+ var objectProto$3 = Object.prototype;
1080
+
1081
+ /** Used to check objects for own properties. */
1082
+ var hasOwnProperty$2 = objectProto$3.hasOwnProperty;
1083
+
1084
+ /**
1085
+ * Checks if a hash value for `key` exists.
1086
+ *
1087
+ * @private
1088
+ * @name has
1089
+ * @memberOf Hash
1090
+ * @param {string} key The key of the entry to check.
1091
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1092
+ */
1093
+ function hashHas(key) {
1094
+ var data = this.__data__;
1095
+ return nativeCreate ? (data[key] !== undefined) : hasOwnProperty$2.call(data, key);
1096
+ }
1097
+
1098
+ /** Used to stand-in for `undefined` hash values. */
1099
+ var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
1100
+
1101
+ /**
1102
+ * Sets the hash `key` to `value`.
1103
+ *
1104
+ * @private
1105
+ * @name set
1106
+ * @memberOf Hash
1107
+ * @param {string} key The key of the value to set.
1108
+ * @param {*} value The value to set.
1109
+ * @returns {Object} Returns the hash instance.
1110
+ */
1111
+ function hashSet(key, value) {
1112
+ var data = this.__data__;
1113
+ this.size += this.has(key) ? 0 : 1;
1114
+ data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED$1 : value;
1115
+ return this;
1116
+ }
1117
+
1118
+ /**
1119
+ * Creates a hash object.
1120
+ *
1121
+ * @private
1122
+ * @constructor
1123
+ * @param {Array} [entries] The key-value pairs to cache.
1124
+ */
1125
+ function Hash(entries) {
1126
+ var index = -1,
1127
+ length = entries == null ? 0 : entries.length;
1128
+
1129
+ this.clear();
1130
+ while (++index < length) {
1131
+ var entry = entries[index];
1132
+ this.set(entry[0], entry[1]);
1133
+ }
1134
+ }
1135
+
1136
+ // Add methods to `Hash`.
1137
+ Hash.prototype.clear = hashClear;
1138
+ Hash.prototype['delete'] = hashDelete;
1139
+ Hash.prototype.get = hashGet;
1140
+ Hash.prototype.has = hashHas;
1141
+ Hash.prototype.set = hashSet;
1142
+
1143
+ /**
1144
+ * Removes all key-value entries from the list cache.
1145
+ *
1146
+ * @private
1147
+ * @name clear
1148
+ * @memberOf ListCache
1149
+ */
1150
+ function listCacheClear() {
1151
+ this.__data__ = [];
1152
+ this.size = 0;
1153
+ }
1154
+
1155
+ /**
1156
+ * Gets the index at which the `key` is found in `array` of key-value pairs.
1157
+ *
1158
+ * @private
1159
+ * @param {Array} array The array to inspect.
1160
+ * @param {*} key The key to search for.
1161
+ * @returns {number} Returns the index of the matched value, else `-1`.
1162
+ */
1163
+ function assocIndexOf(array, key) {
1164
+ var length = array.length;
1165
+ while (length--) {
1166
+ if (eq(array[length][0], key)) {
1167
+ return length;
1168
+ }
1169
+ }
1170
+ return -1;
1171
+ }
1172
+
1173
+ /** Used for built-in method references. */
1174
+ var arrayProto = Array.prototype;
1175
+
1176
+ /** Built-in value references. */
1177
+ var splice = arrayProto.splice;
1178
+
1179
+ /**
1180
+ * Removes `key` and its value from the list cache.
1181
+ *
1182
+ * @private
1183
+ * @name delete
1184
+ * @memberOf ListCache
1185
+ * @param {string} key The key of the value to remove.
1186
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1187
+ */
1188
+ function listCacheDelete(key) {
1189
+ var data = this.__data__,
1190
+ index = assocIndexOf(data, key);
1191
+
1192
+ if (index < 0) {
1193
+ return false;
1194
+ }
1195
+ var lastIndex = data.length - 1;
1196
+ if (index == lastIndex) {
1197
+ data.pop();
1198
+ } else {
1199
+ splice.call(data, index, 1);
1200
+ }
1201
+ --this.size;
1202
+ return true;
1203
+ }
1204
+
1205
+ /**
1206
+ * Gets the list cache value for `key`.
1207
+ *
1208
+ * @private
1209
+ * @name get
1210
+ * @memberOf ListCache
1211
+ * @param {string} key The key of the value to get.
1212
+ * @returns {*} Returns the entry value.
1213
+ */
1214
+ function listCacheGet(key) {
1215
+ var data = this.__data__,
1216
+ index = assocIndexOf(data, key);
1217
+
1218
+ return index < 0 ? undefined : data[index][1];
1219
+ }
1220
+
1221
+ /**
1222
+ * Checks if a list cache value for `key` exists.
1223
+ *
1224
+ * @private
1225
+ * @name has
1226
+ * @memberOf ListCache
1227
+ * @param {string} key The key of the entry to check.
1228
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1229
+ */
1230
+ function listCacheHas(key) {
1231
+ return assocIndexOf(this.__data__, key) > -1;
1232
+ }
1233
+
1234
+ /**
1235
+ * Sets the list cache `key` to `value`.
1236
+ *
1237
+ * @private
1238
+ * @name set
1239
+ * @memberOf ListCache
1240
+ * @param {string} key The key of the value to set.
1241
+ * @param {*} value The value to set.
1242
+ * @returns {Object} Returns the list cache instance.
1243
+ */
1244
+ function listCacheSet(key, value) {
1245
+ var data = this.__data__,
1246
+ index = assocIndexOf(data, key);
1247
+
1248
+ if (index < 0) {
1249
+ ++this.size;
1250
+ data.push([key, value]);
1251
+ } else {
1252
+ data[index][1] = value;
1253
+ }
1254
+ return this;
1255
+ }
1256
+
1257
+ /**
1258
+ * Creates an list cache object.
1259
+ *
1260
+ * @private
1261
+ * @constructor
1262
+ * @param {Array} [entries] The key-value pairs to cache.
1263
+ */
1264
+ function ListCache(entries) {
1265
+ var index = -1,
1266
+ length = entries == null ? 0 : entries.length;
1267
+
1268
+ this.clear();
1269
+ while (++index < length) {
1270
+ var entry = entries[index];
1271
+ this.set(entry[0], entry[1]);
1272
+ }
1273
+ }
1274
+
1275
+ // Add methods to `ListCache`.
1276
+ ListCache.prototype.clear = listCacheClear;
1277
+ ListCache.prototype['delete'] = listCacheDelete;
1278
+ ListCache.prototype.get = listCacheGet;
1279
+ ListCache.prototype.has = listCacheHas;
1280
+ ListCache.prototype.set = listCacheSet;
1281
+
1282
+ /* Built-in method references that are verified to be native. */
1283
+ var Map$1 = getNative(root, 'Map');
1284
+
1285
+ /**
1286
+ * Removes all key-value entries from the map.
1287
+ *
1288
+ * @private
1289
+ * @name clear
1290
+ * @memberOf MapCache
1291
+ */
1292
+ function mapCacheClear() {
1293
+ this.size = 0;
1294
+ this.__data__ = {
1295
+ 'hash': new Hash,
1296
+ 'map': new (Map$1 || ListCache),
1297
+ 'string': new Hash
1298
+ };
1299
+ }
1300
+
1301
+ /**
1302
+ * Checks if `value` is suitable for use as unique object key.
1303
+ *
1304
+ * @private
1305
+ * @param {*} value The value to check.
1306
+ * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
1307
+ */
1308
+ function isKeyable(value) {
1309
+ var type = typeof value;
1310
+ return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
1311
+ ? (value !== '__proto__')
1312
+ : (value === null);
1313
+ }
1314
+
1315
+ /**
1316
+ * Gets the data for `map`.
1317
+ *
1318
+ * @private
1319
+ * @param {Object} map The map to query.
1320
+ * @param {string} key The reference key.
1321
+ * @returns {*} Returns the map data.
1322
+ */
1323
+ function getMapData(map, key) {
1324
+ var data = map.__data__;
1325
+ return isKeyable(key)
1326
+ ? data[typeof key == 'string' ? 'string' : 'hash']
1327
+ : data.map;
1328
+ }
1329
+
1330
+ /**
1331
+ * Removes `key` and its value from the map.
1332
+ *
1333
+ * @private
1334
+ * @name delete
1335
+ * @memberOf MapCache
1336
+ * @param {string} key The key of the value to remove.
1337
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1338
+ */
1339
+ function mapCacheDelete(key) {
1340
+ var result = getMapData(this, key)['delete'](key);
1341
+ this.size -= result ? 1 : 0;
1342
+ return result;
1343
+ }
1344
+
1345
+ /**
1346
+ * Gets the map value for `key`.
1347
+ *
1348
+ * @private
1349
+ * @name get
1350
+ * @memberOf MapCache
1351
+ * @param {string} key The key of the value to get.
1352
+ * @returns {*} Returns the entry value.
1353
+ */
1354
+ function mapCacheGet(key) {
1355
+ return getMapData(this, key).get(key);
1356
+ }
1357
+
1358
+ /**
1359
+ * Checks if a map value for `key` exists.
1360
+ *
1361
+ * @private
1362
+ * @name has
1363
+ * @memberOf MapCache
1364
+ * @param {string} key The key of the entry to check.
1365
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1366
+ */
1367
+ function mapCacheHas(key) {
1368
+ return getMapData(this, key).has(key);
1369
+ }
1370
+
1371
+ /**
1372
+ * Sets the map `key` to `value`.
1373
+ *
1374
+ * @private
1375
+ * @name set
1376
+ * @memberOf MapCache
1377
+ * @param {string} key The key of the value to set.
1378
+ * @param {*} value The value to set.
1379
+ * @returns {Object} Returns the map cache instance.
1380
+ */
1381
+ function mapCacheSet(key, value) {
1382
+ var data = getMapData(this, key),
1383
+ size = data.size;
1384
+
1385
+ data.set(key, value);
1386
+ this.size += data.size == size ? 0 : 1;
1387
+ return this;
1388
+ }
1389
+
1390
+ /**
1391
+ * Creates a map cache object to store key-value pairs.
1392
+ *
1393
+ * @private
1394
+ * @constructor
1395
+ * @param {Array} [entries] The key-value pairs to cache.
1396
+ */
1397
+ function MapCache(entries) {
1398
+ var index = -1,
1399
+ length = entries == null ? 0 : entries.length;
1400
+
1401
+ this.clear();
1402
+ while (++index < length) {
1403
+ var entry = entries[index];
1404
+ this.set(entry[0], entry[1]);
1405
+ }
1406
+ }
1407
+
1408
+ // Add methods to `MapCache`.
1409
+ MapCache.prototype.clear = mapCacheClear;
1410
+ MapCache.prototype['delete'] = mapCacheDelete;
1411
+ MapCache.prototype.get = mapCacheGet;
1412
+ MapCache.prototype.has = mapCacheHas;
1413
+ MapCache.prototype.set = mapCacheSet;
1414
+
1415
+ /**
1416
+ * Appends the elements of `values` to `array`.
1417
+ *
1418
+ * @private
1419
+ * @param {Array} array The array to modify.
1420
+ * @param {Array} values The values to append.
1421
+ * @returns {Array} Returns `array`.
1422
+ */
1423
+ function arrayPush(array, values) {
1424
+ var index = -1,
1425
+ length = values.length,
1426
+ offset = array.length;
1427
+
1428
+ while (++index < length) {
1429
+ array[offset + index] = values[index];
1430
+ }
1431
+ return array;
1432
+ }
1433
+
1434
+ /**
1435
+ * Removes all key-value entries from the stack.
1436
+ *
1437
+ * @private
1438
+ * @name clear
1439
+ * @memberOf Stack
1440
+ */
1441
+ function stackClear() {
1442
+ this.__data__ = new ListCache;
1443
+ this.size = 0;
1444
+ }
1445
+
1446
+ /**
1447
+ * Removes `key` and its value from the stack.
1448
+ *
1449
+ * @private
1450
+ * @name delete
1451
+ * @memberOf Stack
1452
+ * @param {string} key The key of the value to remove.
1453
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1454
+ */
1455
+ function stackDelete(key) {
1456
+ var data = this.__data__,
1457
+ result = data['delete'](key);
1458
+
1459
+ this.size = data.size;
1460
+ return result;
1461
+ }
1462
+
1463
+ /**
1464
+ * Gets the stack value for `key`.
1465
+ *
1466
+ * @private
1467
+ * @name get
1468
+ * @memberOf Stack
1469
+ * @param {string} key The key of the value to get.
1470
+ * @returns {*} Returns the entry value.
1471
+ */
1472
+ function stackGet(key) {
1473
+ return this.__data__.get(key);
1474
+ }
1475
+
1476
+ /**
1477
+ * Checks if a stack value for `key` exists.
1478
+ *
1479
+ * @private
1480
+ * @name has
1481
+ * @memberOf Stack
1482
+ * @param {string} key The key of the entry to check.
1483
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1484
+ */
1485
+ function stackHas(key) {
1486
+ return this.__data__.has(key);
1487
+ }
1488
+
1489
+ /** Used as the size to enable large array optimizations. */
1490
+ var LARGE_ARRAY_SIZE = 200;
1491
+
1492
+ /**
1493
+ * Sets the stack `key` to `value`.
1494
+ *
1495
+ * @private
1496
+ * @name set
1497
+ * @memberOf Stack
1498
+ * @param {string} key The key of the value to set.
1499
+ * @param {*} value The value to set.
1500
+ * @returns {Object} Returns the stack cache instance.
1501
+ */
1502
+ function stackSet(key, value) {
1503
+ var data = this.__data__;
1504
+ if (data instanceof ListCache) {
1505
+ var pairs = data.__data__;
1506
+ if (!Map$1 || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
1507
+ pairs.push([key, value]);
1508
+ this.size = ++data.size;
1509
+ return this;
1510
+ }
1511
+ data = this.__data__ = new MapCache(pairs);
1512
+ }
1513
+ data.set(key, value);
1514
+ this.size = data.size;
1515
+ return this;
1516
+ }
1517
+
1518
+ /**
1519
+ * Creates a stack cache object to store key-value pairs.
1520
+ *
1521
+ * @private
1522
+ * @constructor
1523
+ * @param {Array} [entries] The key-value pairs to cache.
1524
+ */
1525
+ function Stack(entries) {
1526
+ var data = this.__data__ = new ListCache(entries);
1527
+ this.size = data.size;
1528
+ }
1529
+
1530
+ // Add methods to `Stack`.
1531
+ Stack.prototype.clear = stackClear;
1532
+ Stack.prototype['delete'] = stackDelete;
1533
+ Stack.prototype.get = stackGet;
1534
+ Stack.prototype.has = stackHas;
1535
+ Stack.prototype.set = stackSet;
1536
+
1537
+ /**
1538
+ * A specialized version of `_.filter` for arrays without support for
1539
+ * iteratee shorthands.
1540
+ *
1541
+ * @private
1542
+ * @param {Array} [array] The array to iterate over.
1543
+ * @param {Function} predicate The function invoked per iteration.
1544
+ * @returns {Array} Returns the new filtered array.
1545
+ */
1546
+ function arrayFilter(array, predicate) {
1547
+ var index = -1,
1548
+ length = array == null ? 0 : array.length,
1549
+ resIndex = 0,
1550
+ result = [];
1551
+
1552
+ while (++index < length) {
1553
+ var value = array[index];
1554
+ if (predicate(value, index, array)) {
1555
+ result[resIndex++] = value;
1556
+ }
1557
+ }
1558
+ return result;
1559
+ }
1560
+
1561
+ /**
1562
+ * This method returns a new empty array.
1563
+ *
1564
+ * @static
1565
+ * @memberOf _
1566
+ * @since 4.13.0
1567
+ * @category Util
1568
+ * @returns {Array} Returns the new empty array.
1569
+ * @example
1570
+ *
1571
+ * var arrays = _.times(2, _.stubArray);
1572
+ *
1573
+ * console.log(arrays);
1574
+ * // => [[], []]
1575
+ *
1576
+ * console.log(arrays[0] === arrays[1]);
1577
+ * // => false
1578
+ */
1579
+ function stubArray() {
1580
+ return [];
1581
+ }
1582
+
1583
+ /** Used for built-in method references. */
1584
+ var objectProto$2 = Object.prototype;
1585
+
1586
+ /** Built-in value references. */
1587
+ var propertyIsEnumerable = objectProto$2.propertyIsEnumerable;
1588
+
1589
+ /* Built-in method references for those with the same name as other `lodash` methods. */
1590
+ var nativeGetSymbols = Object.getOwnPropertySymbols;
1591
+
1592
+ /**
1593
+ * Creates an array of the own enumerable symbols of `object`.
1594
+ *
1595
+ * @private
1596
+ * @param {Object} object The object to query.
1597
+ * @returns {Array} Returns the array of symbols.
1598
+ */
1599
+ var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
1600
+ if (object == null) {
1601
+ return [];
1602
+ }
1603
+ object = Object(object);
1604
+ return arrayFilter(nativeGetSymbols(object), function(symbol) {
1605
+ return propertyIsEnumerable.call(object, symbol);
1606
+ });
1607
+ };
1608
+
1609
+ /**
1610
+ * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
1611
+ * `keysFunc` and `symbolsFunc` to get the enumerable property names and
1612
+ * symbols of `object`.
1613
+ *
1614
+ * @private
1615
+ * @param {Object} object The object to query.
1616
+ * @param {Function} keysFunc The function to get the keys of `object`.
1617
+ * @param {Function} symbolsFunc The function to get the symbols of `object`.
1618
+ * @returns {Array} Returns the array of property names and symbols.
1619
+ */
1620
+ function baseGetAllKeys(object, keysFunc, symbolsFunc) {
1621
+ var result = keysFunc(object);
1622
+ return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
1623
+ }
1624
+
1625
+ /**
1626
+ * Creates an array of own enumerable property names and symbols of `object`.
1627
+ *
1628
+ * @private
1629
+ * @param {Object} object The object to query.
1630
+ * @returns {Array} Returns the array of property names and symbols.
1631
+ */
1632
+ function getAllKeys(object) {
1633
+ return baseGetAllKeys(object, keys, getSymbols);
1634
+ }
1635
+
1636
+ /* Built-in method references that are verified to be native. */
1637
+ var DataView = getNative(root, 'DataView');
1638
+
1639
+ /* Built-in method references that are verified to be native. */
1640
+ var Promise$1 = getNative(root, 'Promise');
1641
+
1642
+ /* Built-in method references that are verified to be native. */
1643
+ var Set$1 = getNative(root, 'Set');
1644
+
1645
+ /** `Object#toString` result references. */
1646
+ var mapTag$1 = '[object Map]',
1647
+ objectTag$1 = '[object Object]',
1648
+ promiseTag = '[object Promise]',
1649
+ setTag$1 = '[object Set]',
1650
+ weakMapTag = '[object WeakMap]';
1651
+
1652
+ var dataViewTag$1 = '[object DataView]';
1653
+
1654
+ /** Used to detect maps, sets, and weakmaps. */
1655
+ var dataViewCtorString = toSource(DataView),
1656
+ mapCtorString = toSource(Map$1),
1657
+ promiseCtorString = toSource(Promise$1),
1658
+ setCtorString = toSource(Set$1),
1659
+ weakMapCtorString = toSource(WeakMap);
1660
+
1661
+ /**
1662
+ * Gets the `toStringTag` of `value`.
1663
+ *
1664
+ * @private
1665
+ * @param {*} value The value to query.
1666
+ * @returns {string} Returns the `toStringTag`.
1667
+ */
1668
+ var getTag = baseGetTag;
1669
+
1670
+ // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
1671
+ if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag$1) ||
1672
+ (Map$1 && getTag(new Map$1) != mapTag$1) ||
1673
+ (Promise$1 && getTag(Promise$1.resolve()) != promiseTag) ||
1674
+ (Set$1 && getTag(new Set$1) != setTag$1) ||
1675
+ (WeakMap && getTag(new WeakMap) != weakMapTag)) {
1676
+ getTag = function(value) {
1677
+ var result = baseGetTag(value),
1678
+ Ctor = result == objectTag$1 ? value.constructor : undefined,
1679
+ ctorString = Ctor ? toSource(Ctor) : '';
1680
+
1681
+ if (ctorString) {
1682
+ switch (ctorString) {
1683
+ case dataViewCtorString: return dataViewTag$1;
1684
+ case mapCtorString: return mapTag$1;
1685
+ case promiseCtorString: return promiseTag;
1686
+ case setCtorString: return setTag$1;
1687
+ case weakMapCtorString: return weakMapTag;
1688
+ }
1689
+ }
1690
+ return result;
1691
+ };
1692
+ }
1693
+
1694
+ var getTag$1 = getTag;
1695
+
1696
+ /** Built-in value references. */
1697
+ var Uint8Array = root.Uint8Array;
1698
+
1699
+ /** Used to stand-in for `undefined` hash values. */
1700
+ var HASH_UNDEFINED = '__lodash_hash_undefined__';
1701
+
1702
+ /**
1703
+ * Adds `value` to the array cache.
1704
+ *
1705
+ * @private
1706
+ * @name add
1707
+ * @memberOf SetCache
1708
+ * @alias push
1709
+ * @param {*} value The value to cache.
1710
+ * @returns {Object} Returns the cache instance.
1711
+ */
1712
+ function setCacheAdd(value) {
1713
+ this.__data__.set(value, HASH_UNDEFINED);
1714
+ return this;
1715
+ }
1716
+
1717
+ /**
1718
+ * Checks if `value` is in the array cache.
1719
+ *
1720
+ * @private
1721
+ * @name has
1722
+ * @memberOf SetCache
1723
+ * @param {*} value The value to search for.
1724
+ * @returns {number} Returns `true` if `value` is found, else `false`.
1725
+ */
1726
+ function setCacheHas(value) {
1727
+ return this.__data__.has(value);
1728
+ }
1729
+
1730
+ /**
1731
+ *
1732
+ * Creates an array cache object to store unique values.
1733
+ *
1734
+ * @private
1735
+ * @constructor
1736
+ * @param {Array} [values] The values to cache.
1737
+ */
1738
+ function SetCache(values) {
1739
+ var index = -1,
1740
+ length = values == null ? 0 : values.length;
1741
+
1742
+ this.__data__ = new MapCache;
1743
+ while (++index < length) {
1744
+ this.add(values[index]);
1745
+ }
1746
+ }
1747
+
1748
+ // Add methods to `SetCache`.
1749
+ SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
1750
+ SetCache.prototype.has = setCacheHas;
1751
+
1752
+ /**
1753
+ * A specialized version of `_.some` for arrays without support for iteratee
1754
+ * shorthands.
1755
+ *
1756
+ * @private
1757
+ * @param {Array} [array] The array to iterate over.
1758
+ * @param {Function} predicate The function invoked per iteration.
1759
+ * @returns {boolean} Returns `true` if any element passes the predicate check,
1760
+ * else `false`.
1761
+ */
1762
+ function arraySome(array, predicate) {
1763
+ var index = -1,
1764
+ length = array == null ? 0 : array.length;
1765
+
1766
+ while (++index < length) {
1767
+ if (predicate(array[index], index, array)) {
1768
+ return true;
1769
+ }
1770
+ }
1771
+ return false;
1772
+ }
1773
+
1774
+ /**
1775
+ * Checks if a `cache` value for `key` exists.
1776
+ *
1777
+ * @private
1778
+ * @param {Object} cache The cache to query.
1779
+ * @param {string} key The key of the entry to check.
1780
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1781
+ */
1782
+ function cacheHas(cache, key) {
1783
+ return cache.has(key);
1784
+ }
1785
+
1786
+ /** Used to compose bitmasks for value comparisons. */
1787
+ var COMPARE_PARTIAL_FLAG$3 = 1,
1788
+ COMPARE_UNORDERED_FLAG$1 = 2;
1789
+
1790
+ /**
1791
+ * A specialized version of `baseIsEqualDeep` for arrays with support for
1792
+ * partial deep comparisons.
1793
+ *
1794
+ * @private
1795
+ * @param {Array} array The array to compare.
1796
+ * @param {Array} other The other array to compare.
1797
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
1798
+ * @param {Function} customizer The function to customize comparisons.
1799
+ * @param {Function} equalFunc The function to determine equivalents of values.
1800
+ * @param {Object} stack Tracks traversed `array` and `other` objects.
1801
+ * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
1802
+ */
1803
+ function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
1804
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3,
1805
+ arrLength = array.length,
1806
+ othLength = other.length;
1807
+
1808
+ if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
1809
+ return false;
1810
+ }
1811
+ // Check that cyclic values are equal.
1812
+ var arrStacked = stack.get(array);
1813
+ var othStacked = stack.get(other);
1814
+ if (arrStacked && othStacked) {
1815
+ return arrStacked == other && othStacked == array;
1816
+ }
1817
+ var index = -1,
1818
+ result = true,
1819
+ seen = (bitmask & COMPARE_UNORDERED_FLAG$1) ? new SetCache : undefined;
1820
+
1821
+ stack.set(array, other);
1822
+ stack.set(other, array);
1823
+
1824
+ // Ignore non-index properties.
1825
+ while (++index < arrLength) {
1826
+ var arrValue = array[index],
1827
+ othValue = other[index];
1828
+
1829
+ if (customizer) {
1830
+ var compared = isPartial
1831
+ ? customizer(othValue, arrValue, index, other, array, stack)
1832
+ : customizer(arrValue, othValue, index, array, other, stack);
1833
+ }
1834
+ if (compared !== undefined) {
1835
+ if (compared) {
1836
+ continue;
1837
+ }
1838
+ result = false;
1839
+ break;
1840
+ }
1841
+ // Recursively compare arrays (susceptible to call stack limits).
1842
+ if (seen) {
1843
+ if (!arraySome(other, function(othValue, othIndex) {
1844
+ if (!cacheHas(seen, othIndex) &&
1845
+ (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
1846
+ return seen.push(othIndex);
1847
+ }
1848
+ })) {
1849
+ result = false;
1850
+ break;
1851
+ }
1852
+ } else if (!(
1853
+ arrValue === othValue ||
1854
+ equalFunc(arrValue, othValue, bitmask, customizer, stack)
1855
+ )) {
1856
+ result = false;
1857
+ break;
1858
+ }
1859
+ }
1860
+ stack['delete'](array);
1861
+ stack['delete'](other);
1862
+ return result;
1863
+ }
1864
+
1865
+ /**
1866
+ * Converts `map` to its key-value pairs.
1867
+ *
1868
+ * @private
1869
+ * @param {Object} map The map to convert.
1870
+ * @returns {Array} Returns the key-value pairs.
1871
+ */
1872
+ function mapToArray(map) {
1873
+ var index = -1,
1874
+ result = Array(map.size);
1875
+
1876
+ map.forEach(function(value, key) {
1877
+ result[++index] = [key, value];
1878
+ });
1879
+ return result;
1880
+ }
1881
+
1882
+ /**
1883
+ * Converts `set` to an array of its values.
1884
+ *
1885
+ * @private
1886
+ * @param {Object} set The set to convert.
1887
+ * @returns {Array} Returns the values.
1888
+ */
1889
+ function setToArray(set) {
1890
+ var index = -1,
1891
+ result = Array(set.size);
1892
+
1893
+ set.forEach(function(value) {
1894
+ result[++index] = value;
1895
+ });
1896
+ return result;
1897
+ }
1898
+
1899
+ /** Used to compose bitmasks for value comparisons. */
1900
+ var COMPARE_PARTIAL_FLAG$2 = 1,
1901
+ COMPARE_UNORDERED_FLAG = 2;
1902
+
1903
+ /** `Object#toString` result references. */
1904
+ var boolTag = '[object Boolean]',
1905
+ dateTag = '[object Date]',
1906
+ errorTag = '[object Error]',
1907
+ mapTag = '[object Map]',
1908
+ numberTag = '[object Number]',
1909
+ regexpTag = '[object RegExp]',
1910
+ setTag = '[object Set]',
1911
+ stringTag = '[object String]',
1912
+ symbolTag = '[object Symbol]';
1913
+
1914
+ var arrayBufferTag = '[object ArrayBuffer]',
1915
+ dataViewTag = '[object DataView]';
1916
+
1917
+ /** Used to convert symbols to primitives and strings. */
1918
+ var symbolProto = Symbol ? Symbol.prototype : undefined,
1919
+ symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
1920
+
1921
+ /**
1922
+ * A specialized version of `baseIsEqualDeep` for comparing objects of
1923
+ * the same `toStringTag`.
1924
+ *
1925
+ * **Note:** This function only supports comparing values with tags of
1926
+ * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
1927
+ *
1928
+ * @private
1929
+ * @param {Object} object The object to compare.
1930
+ * @param {Object} other The other object to compare.
1931
+ * @param {string} tag The `toStringTag` of the objects to compare.
1932
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
1933
+ * @param {Function} customizer The function to customize comparisons.
1934
+ * @param {Function} equalFunc The function to determine equivalents of values.
1935
+ * @param {Object} stack Tracks traversed `object` and `other` objects.
1936
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
1937
+ */
1938
+ function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
1939
+ switch (tag) {
1940
+ case dataViewTag:
1941
+ if ((object.byteLength != other.byteLength) ||
1942
+ (object.byteOffset != other.byteOffset)) {
1943
+ return false;
1944
+ }
1945
+ object = object.buffer;
1946
+ other = other.buffer;
1947
+
1948
+ case arrayBufferTag:
1949
+ if ((object.byteLength != other.byteLength) ||
1950
+ !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
1951
+ return false;
1952
+ }
1953
+ return true;
1954
+
1955
+ case boolTag:
1956
+ case dateTag:
1957
+ case numberTag:
1958
+ // Coerce booleans to `1` or `0` and dates to milliseconds.
1959
+ // Invalid dates are coerced to `NaN`.
1960
+ return eq(+object, +other);
1961
+
1962
+ case errorTag:
1963
+ return object.name == other.name && object.message == other.message;
1964
+
1965
+ case regexpTag:
1966
+ case stringTag:
1967
+ // Coerce regexes to strings and treat strings, primitives and objects,
1968
+ // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
1969
+ // for more details.
1970
+ return object == (other + '');
1971
+
1972
+ case mapTag:
1973
+ var convert = mapToArray;
1974
+
1975
+ case setTag:
1976
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG$2;
1977
+ convert || (convert = setToArray);
1978
+
1979
+ if (object.size != other.size && !isPartial) {
1980
+ return false;
1981
+ }
1982
+ // Assume cyclic values are equal.
1983
+ var stacked = stack.get(object);
1984
+ if (stacked) {
1985
+ return stacked == other;
1986
+ }
1987
+ bitmask |= COMPARE_UNORDERED_FLAG;
1988
+
1989
+ // Recursively compare objects (susceptible to call stack limits).
1990
+ stack.set(object, other);
1991
+ var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
1992
+ stack['delete'](object);
1993
+ return result;
1994
+
1995
+ case symbolTag:
1996
+ if (symbolValueOf) {
1997
+ return symbolValueOf.call(object) == symbolValueOf.call(other);
1998
+ }
1999
+ }
2000
+ return false;
2001
+ }
2002
+
2003
+ /** Used to compose bitmasks for value comparisons. */
2004
+ var COMPARE_PARTIAL_FLAG$1 = 1;
2005
+
2006
+ /** Used for built-in method references. */
2007
+ var objectProto$1 = Object.prototype;
2008
+
2009
+ /** Used to check objects for own properties. */
2010
+ var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
2011
+
2012
+ /**
2013
+ * A specialized version of `baseIsEqualDeep` for objects with support for
2014
+ * partial deep comparisons.
2015
+ *
2016
+ * @private
2017
+ * @param {Object} object The object to compare.
2018
+ * @param {Object} other The other object to compare.
2019
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
2020
+ * @param {Function} customizer The function to customize comparisons.
2021
+ * @param {Function} equalFunc The function to determine equivalents of values.
2022
+ * @param {Object} stack Tracks traversed `object` and `other` objects.
2023
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
2024
+ */
2025
+ function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
2026
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG$1,
2027
+ objProps = getAllKeys(object),
2028
+ objLength = objProps.length,
2029
+ othProps = getAllKeys(other),
2030
+ othLength = othProps.length;
2031
+
2032
+ if (objLength != othLength && !isPartial) {
2033
+ return false;
2034
+ }
2035
+ var index = objLength;
2036
+ while (index--) {
2037
+ var key = objProps[index];
2038
+ if (!(isPartial ? key in other : hasOwnProperty$1.call(other, key))) {
2039
+ return false;
2040
+ }
2041
+ }
2042
+ // Check that cyclic values are equal.
2043
+ var objStacked = stack.get(object);
2044
+ var othStacked = stack.get(other);
2045
+ if (objStacked && othStacked) {
2046
+ return objStacked == other && othStacked == object;
2047
+ }
2048
+ var result = true;
2049
+ stack.set(object, other);
2050
+ stack.set(other, object);
2051
+
2052
+ var skipCtor = isPartial;
2053
+ while (++index < objLength) {
2054
+ key = objProps[index];
2055
+ var objValue = object[key],
2056
+ othValue = other[key];
2057
+
2058
+ if (customizer) {
2059
+ var compared = isPartial
2060
+ ? customizer(othValue, objValue, key, other, object, stack)
2061
+ : customizer(objValue, othValue, key, object, other, stack);
2062
+ }
2063
+ // Recursively compare objects (susceptible to call stack limits).
2064
+ if (!(compared === undefined
2065
+ ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
2066
+ : compared
2067
+ )) {
2068
+ result = false;
2069
+ break;
2070
+ }
2071
+ skipCtor || (skipCtor = key == 'constructor');
2072
+ }
2073
+ if (result && !skipCtor) {
2074
+ var objCtor = object.constructor,
2075
+ othCtor = other.constructor;
2076
+
2077
+ // Non `Object` object instances with different constructors are not equal.
2078
+ if (objCtor != othCtor &&
2079
+ ('constructor' in object && 'constructor' in other) &&
2080
+ !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
2081
+ typeof othCtor == 'function' && othCtor instanceof othCtor)) {
2082
+ result = false;
2083
+ }
2084
+ }
2085
+ stack['delete'](object);
2086
+ stack['delete'](other);
2087
+ return result;
2088
+ }
2089
+
2090
+ /** Used to compose bitmasks for value comparisons. */
2091
+ var COMPARE_PARTIAL_FLAG = 1;
2092
+
2093
+ /** `Object#toString` result references. */
2094
+ var argsTag = '[object Arguments]',
2095
+ arrayTag = '[object Array]',
2096
+ objectTag = '[object Object]';
2097
+
2098
+ /** Used for built-in method references. */
2099
+ var objectProto = Object.prototype;
2100
+
2101
+ /** Used to check objects for own properties. */
2102
+ var hasOwnProperty = objectProto.hasOwnProperty;
2103
+
2104
+ /**
2105
+ * A specialized version of `baseIsEqual` for arrays and objects which performs
2106
+ * deep comparisons and tracks traversed objects enabling objects with circular
2107
+ * references to be compared.
2108
+ *
2109
+ * @private
2110
+ * @param {Object} object The object to compare.
2111
+ * @param {Object} other The other object to compare.
2112
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
2113
+ * @param {Function} customizer The function to customize comparisons.
2114
+ * @param {Function} equalFunc The function to determine equivalents of values.
2115
+ * @param {Object} [stack] Tracks traversed `object` and `other` objects.
2116
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
2117
+ */
2118
+ function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
2119
+ var objIsArr = isArray(object),
2120
+ othIsArr = isArray(other),
2121
+ objTag = objIsArr ? arrayTag : getTag$1(object),
2122
+ othTag = othIsArr ? arrayTag : getTag$1(other);
2123
+
2124
+ objTag = objTag == argsTag ? objectTag : objTag;
2125
+ othTag = othTag == argsTag ? objectTag : othTag;
2126
+
2127
+ var objIsObj = objTag == objectTag,
2128
+ othIsObj = othTag == objectTag,
2129
+ isSameTag = objTag == othTag;
2130
+
2131
+ if (isSameTag && isBuffer(object)) {
2132
+ if (!isBuffer(other)) {
2133
+ return false;
2134
+ }
2135
+ objIsArr = true;
2136
+ objIsObj = false;
2137
+ }
2138
+ if (isSameTag && !objIsObj) {
2139
+ stack || (stack = new Stack);
2140
+ return (objIsArr || isTypedArray(object))
2141
+ ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
2142
+ : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
2143
+ }
2144
+ if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
2145
+ var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
2146
+ othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
2147
+
2148
+ if (objIsWrapped || othIsWrapped) {
2149
+ var objUnwrapped = objIsWrapped ? object.value() : object,
2150
+ othUnwrapped = othIsWrapped ? other.value() : other;
2151
+
2152
+ stack || (stack = new Stack);
2153
+ return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
2154
+ }
2155
+ }
2156
+ if (!isSameTag) {
2157
+ return false;
2158
+ }
2159
+ stack || (stack = new Stack);
2160
+ return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
2161
+ }
2162
+
2163
+ /**
2164
+ * The base implementation of `_.isEqual` which supports partial comparisons
2165
+ * and tracks traversed objects.
2166
+ *
2167
+ * @private
2168
+ * @param {*} value The value to compare.
2169
+ * @param {*} other The other value to compare.
2170
+ * @param {boolean} bitmask The bitmask flags.
2171
+ * 1 - Unordered comparison
2172
+ * 2 - Partial comparison
2173
+ * @param {Function} [customizer] The function to customize comparisons.
2174
+ * @param {Object} [stack] Tracks traversed `value` and `other` objects.
2175
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
2176
+ */
2177
+ function baseIsEqual(value, other, bitmask, customizer, stack) {
2178
+ if (value === other) {
2179
+ return true;
2180
+ }
2181
+ if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
2182
+ return value !== value && other !== other;
2183
+ }
2184
+ return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
2185
+ }
2186
+
2187
+ /**
2188
+ * Gets the timestamp of the number of milliseconds that have elapsed since
2189
+ * the Unix epoch (1 January 1970 00:00:00 UTC).
2190
+ *
2191
+ * @static
2192
+ * @memberOf _
2193
+ * @since 2.4.0
2194
+ * @category Date
2195
+ * @returns {number} Returns the timestamp.
2196
+ * @example
2197
+ *
2198
+ * _.defer(function(stamp) {
2199
+ * console.log(_.now() - stamp);
2200
+ * }, _.now());
2201
+ * // => Logs the number of milliseconds it took for the deferred invocation.
2202
+ */
2203
+ var now = function() {
2204
+ return root.Date.now();
2205
+ };
2206
+
2207
+ /** Error message constants. */
2208
+ var FUNC_ERROR_TEXT$1 = 'Expected a function';
2209
+
2210
+ /* Built-in method references for those with the same name as other `lodash` methods. */
2211
+ var nativeMax = Math.max,
2212
+ nativeMin = Math.min;
2213
+
2214
+ /**
2215
+ * Creates a debounced function that delays invoking `func` until after `wait`
2216
+ * milliseconds have elapsed since the last time the debounced function was
2217
+ * invoked. The debounced function comes with a `cancel` method to cancel
2218
+ * delayed `func` invocations and a `flush` method to immediately invoke them.
2219
+ * Provide `options` to indicate whether `func` should be invoked on the
2220
+ * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
2221
+ * with the last arguments provided to the debounced function. Subsequent
2222
+ * calls to the debounced function return the result of the last `func`
2223
+ * invocation.
2224
+ *
2225
+ * **Note:** If `leading` and `trailing` options are `true`, `func` is
2226
+ * invoked on the trailing edge of the timeout only if the debounced function
2227
+ * is invoked more than once during the `wait` timeout.
2228
+ *
2229
+ * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
2230
+ * until to the next tick, similar to `setTimeout` with a timeout of `0`.
2231
+ *
2232
+ * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
2233
+ * for details over the differences between `_.debounce` and `_.throttle`.
2234
+ *
2235
+ * @static
2236
+ * @memberOf _
2237
+ * @since 0.1.0
2238
+ * @category Function
2239
+ * @param {Function} func The function to debounce.
2240
+ * @param {number} [wait=0] The number of milliseconds to delay.
2241
+ * @param {Object} [options={}] The options object.
2242
+ * @param {boolean} [options.leading=false]
2243
+ * Specify invoking on the leading edge of the timeout.
2244
+ * @param {number} [options.maxWait]
2245
+ * The maximum time `func` is allowed to be delayed before it's invoked.
2246
+ * @param {boolean} [options.trailing=true]
2247
+ * Specify invoking on the trailing edge of the timeout.
2248
+ * @returns {Function} Returns the new debounced function.
2249
+ * @example
2250
+ *
2251
+ * // Avoid costly calculations while the window size is in flux.
2252
+ * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
2253
+ *
2254
+ * // Invoke `sendMail` when clicked, debouncing subsequent calls.
2255
+ * jQuery(element).on('click', _.debounce(sendMail, 300, {
2256
+ * 'leading': true,
2257
+ * 'trailing': false
2258
+ * }));
2259
+ *
2260
+ * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
2261
+ * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
2262
+ * var source = new EventSource('/stream');
2263
+ * jQuery(source).on('message', debounced);
2264
+ *
2265
+ * // Cancel the trailing debounced invocation.
2266
+ * jQuery(window).on('popstate', debounced.cancel);
2267
+ */
2268
+ function debounce(func, wait, options) {
2269
+ var lastArgs,
2270
+ lastThis,
2271
+ maxWait,
2272
+ result,
2273
+ timerId,
2274
+ lastCallTime,
2275
+ lastInvokeTime = 0,
2276
+ leading = false,
2277
+ maxing = false,
2278
+ trailing = true;
2279
+
2280
+ if (typeof func != 'function') {
2281
+ throw new TypeError(FUNC_ERROR_TEXT$1);
2282
+ }
2283
+ wait = toNumber(wait) || 0;
2284
+ if (isObject(options)) {
2285
+ leading = !!options.leading;
2286
+ maxing = 'maxWait' in options;
2287
+ maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
2288
+ trailing = 'trailing' in options ? !!options.trailing : trailing;
2289
+ }
2290
+
2291
+ function invokeFunc(time) {
2292
+ var args = lastArgs,
2293
+ thisArg = lastThis;
2294
+
2295
+ lastArgs = lastThis = undefined;
2296
+ lastInvokeTime = time;
2297
+ result = func.apply(thisArg, args);
2298
+ return result;
2299
+ }
2300
+
2301
+ function leadingEdge(time) {
2302
+ // Reset any `maxWait` timer.
2303
+ lastInvokeTime = time;
2304
+ // Start the timer for the trailing edge.
2305
+ timerId = setTimeout(timerExpired, wait);
2306
+ // Invoke the leading edge.
2307
+ return leading ? invokeFunc(time) : result;
2308
+ }
2309
+
2310
+ function remainingWait(time) {
2311
+ var timeSinceLastCall = time - lastCallTime,
2312
+ timeSinceLastInvoke = time - lastInvokeTime,
2313
+ timeWaiting = wait - timeSinceLastCall;
2314
+
2315
+ return maxing
2316
+ ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
2317
+ : timeWaiting;
2318
+ }
2319
+
2320
+ function shouldInvoke(time) {
2321
+ var timeSinceLastCall = time - lastCallTime,
2322
+ timeSinceLastInvoke = time - lastInvokeTime;
2323
+
2324
+ // Either this is the first call, activity has stopped and we're at the
2325
+ // trailing edge, the system time has gone backwards and we're treating
2326
+ // it as the trailing edge, or we've hit the `maxWait` limit.
2327
+ return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
2328
+ (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
2329
+ }
2330
+
2331
+ function timerExpired() {
2332
+ var time = now();
2333
+ if (shouldInvoke(time)) {
2334
+ return trailingEdge(time);
2335
+ }
2336
+ // Restart the timer.
2337
+ timerId = setTimeout(timerExpired, remainingWait(time));
2338
+ }
2339
+
2340
+ function trailingEdge(time) {
2341
+ timerId = undefined;
2342
+
2343
+ // Only invoke if we have `lastArgs` which means `func` has been
2344
+ // debounced at least once.
2345
+ if (trailing && lastArgs) {
2346
+ return invokeFunc(time);
2347
+ }
2348
+ lastArgs = lastThis = undefined;
2349
+ return result;
2350
+ }
2351
+
2352
+ function cancel() {
2353
+ if (timerId !== undefined) {
2354
+ clearTimeout(timerId);
2355
+ }
2356
+ lastInvokeTime = 0;
2357
+ lastArgs = lastCallTime = lastThis = timerId = undefined;
2358
+ }
2359
+
2360
+ function flush() {
2361
+ return timerId === undefined ? result : trailingEdge(now());
2362
+ }
2363
+
2364
+ function debounced() {
2365
+ var time = now(),
2366
+ isInvoking = shouldInvoke(time);
2367
+
2368
+ lastArgs = arguments;
2369
+ lastThis = this;
2370
+ lastCallTime = time;
2371
+
2372
+ if (isInvoking) {
2373
+ if (timerId === undefined) {
2374
+ return leadingEdge(lastCallTime);
2375
+ }
2376
+ if (maxing) {
2377
+ // Handle invocations in a tight loop.
2378
+ clearTimeout(timerId);
2379
+ timerId = setTimeout(timerExpired, wait);
2380
+ return invokeFunc(lastCallTime);
2381
+ }
2382
+ }
2383
+ if (timerId === undefined) {
2384
+ timerId = setTimeout(timerExpired, wait);
2385
+ }
2386
+ return result;
2387
+ }
2388
+ debounced.cancel = cancel;
2389
+ debounced.flush = flush;
2390
+ return debounced;
2391
+ }
2392
+
2393
+ /**
2394
+ * Performs a deep comparison between two values to determine if they are
2395
+ * equivalent.
2396
+ *
2397
+ * **Note:** This method supports comparing arrays, array buffers, booleans,
2398
+ * date objects, error objects, maps, numbers, `Object` objects, regexes,
2399
+ * sets, strings, symbols, and typed arrays. `Object` objects are compared
2400
+ * by their own, not inherited, enumerable properties. Functions and DOM
2401
+ * nodes are compared by strict equality, i.e. `===`.
2402
+ *
2403
+ * @static
2404
+ * @memberOf _
2405
+ * @since 0.1.0
2406
+ * @category Lang
2407
+ * @param {*} value The value to compare.
2408
+ * @param {*} other The other value to compare.
2409
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
2410
+ * @example
2411
+ *
2412
+ * var object = { 'a': 1 };
2413
+ * var other = { 'a': 1 };
2414
+ *
2415
+ * _.isEqual(object, other);
2416
+ * // => true
2417
+ *
2418
+ * object === other;
2419
+ * // => false
2420
+ */
2421
+ function isEqual(value, other) {
2422
+ return baseIsEqual(value, other);
2423
+ }
2424
+
2425
+ /** Error message constants. */
2426
+ var FUNC_ERROR_TEXT = 'Expected a function';
2427
+
2428
+ /**
2429
+ * Creates a throttled function that only invokes `func` at most once per
2430
+ * every `wait` milliseconds. The throttled function comes with a `cancel`
2431
+ * method to cancel delayed `func` invocations and a `flush` method to
2432
+ * immediately invoke them. Provide `options` to indicate whether `func`
2433
+ * should be invoked on the leading and/or trailing edge of the `wait`
2434
+ * timeout. The `func` is invoked with the last arguments provided to the
2435
+ * throttled function. Subsequent calls to the throttled function return the
2436
+ * result of the last `func` invocation.
2437
+ *
2438
+ * **Note:** If `leading` and `trailing` options are `true`, `func` is
2439
+ * invoked on the trailing edge of the timeout only if the throttled function
2440
+ * is invoked more than once during the `wait` timeout.
2441
+ *
2442
+ * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
2443
+ * until to the next tick, similar to `setTimeout` with a timeout of `0`.
2444
+ *
2445
+ * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
2446
+ * for details over the differences between `_.throttle` and `_.debounce`.
2447
+ *
2448
+ * @static
2449
+ * @memberOf _
2450
+ * @since 0.1.0
2451
+ * @category Function
2452
+ * @param {Function} func The function to throttle.
2453
+ * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
2454
+ * @param {Object} [options={}] The options object.
2455
+ * @param {boolean} [options.leading=true]
2456
+ * Specify invoking on the leading edge of the timeout.
2457
+ * @param {boolean} [options.trailing=true]
2458
+ * Specify invoking on the trailing edge of the timeout.
2459
+ * @returns {Function} Returns the new throttled function.
2460
+ * @example
2461
+ *
2462
+ * // Avoid excessively updating the position while scrolling.
2463
+ * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
2464
+ *
2465
+ * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
2466
+ * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
2467
+ * jQuery(element).on('click', throttled);
2468
+ *
2469
+ * // Cancel the trailing throttled invocation.
2470
+ * jQuery(window).on('popstate', throttled.cancel);
2471
+ */
2472
+ function throttle(func, wait, options) {
2473
+ var leading = true,
2474
+ trailing = true;
2475
+
2476
+ if (typeof func != 'function') {
2477
+ throw new TypeError(FUNC_ERROR_TEXT);
2478
+ }
2479
+ if (isObject(options)) {
2480
+ leading = 'leading' in options ? !!options.leading : leading;
2481
+ trailing = 'trailing' in options ? !!options.trailing : trailing;
2482
+ }
2483
+ return debounce(func, wait, {
2484
+ 'leading': leading,
2485
+ 'maxWait': wait,
2486
+ 'trailing': trailing
2487
+ });
2488
+ }
2489
+
85
2490
  const isPrimitive$1 = (val) => val !== Object(val);
86
2491
  function useCustomCompareEffect(effect, deps, depsEqual) {
87
2492
  if (process.env.NODE_ENV !== "production") {
@@ -109,7 +2514,6 @@ function useCustomCompareEffect(effect, deps, depsEqual) {
109
2514
  }
110
2515
 
111
2516
  const isPrimitive = (val) => val !== Object(val);
112
- const { isEqual } = lodash__default["default"];
113
2517
  function useDeepCompareEffect(effect, deps) {
114
2518
  if (process.env.NODE_ENV !== "production") {
115
2519
  if (!Array.isArray(deps) || !deps.length) {
@@ -178,7 +2582,7 @@ function useStorage(key, defaults, getStorage, options = {}) {
178
2582
  }, [options.serializer, type]);
179
2583
  const [state, setState] = React.useState(defaults);
180
2584
  useDeepCompareEffect(() => {
181
- const data = csrData ? isFunction(csrData) ? csrData() : csrData : defaults;
2585
+ const data = csrData ? isFunction$1(csrData) ? csrData() : csrData : defaults;
182
2586
  const getStoredValue = () => {
183
2587
  try {
184
2588
  const raw = storage == null ? void 0 : storage.getItem(key);
@@ -196,7 +2600,7 @@ function useStorage(key, defaults, getStorage, options = {}) {
196
2600
  }, [key, defaults, serializer, storage, onError]);
197
2601
  const updateState = useEvent(
198
2602
  (valOrFunc) => {
199
- const currentState = isFunction(valOrFunc) ? valOrFunc(state) : valOrFunc;
2603
+ const currentState = isFunction$1(valOrFunc) ? valOrFunc(state) : valOrFunc;
200
2604
  setState(currentState);
201
2605
  if (currentState === null) {
202
2606
  storage == null ? void 0 : storage.removeItem(key);
@@ -350,7 +2754,7 @@ function usePreferredDark(defaultState) {
350
2754
 
351
2755
  function useMount(fn) {
352
2756
  if (isDev) {
353
- if (!isFunction(fn)) {
2757
+ if (!isFunction$1(fn)) {
354
2758
  console.error(
355
2759
  `useMount: parameter \`fn\` expected to be a function, but got "${typeof fn}".`
356
2760
  );
@@ -363,7 +2767,7 @@ function useMount(fn) {
363
2767
 
364
2768
  function useUnmount(fn) {
365
2769
  if (isDev) {
366
- if (!isFunction(fn)) {
2770
+ if (!isFunction$1(fn)) {
367
2771
  console.error(
368
2772
  `useUnmount expected parameter is a function, got ${typeof fn}`
369
2773
  );
@@ -378,10 +2782,9 @@ function useUnmount(fn) {
378
2782
  );
379
2783
  }
380
2784
 
381
- const { throttle: throttle$1 } = lodash__default["default"];
382
2785
  function useThrottleFn(fn, wait, options) {
383
2786
  if (isDev) {
384
- if (!isFunction(fn)) {
2787
+ if (!isFunction$1(fn)) {
385
2788
  console.error(
386
2789
  `useThrottleFn expected parameter is a function, got ${typeof fn}`
387
2790
  );
@@ -389,7 +2792,7 @@ function useThrottleFn(fn, wait, options) {
389
2792
  }
390
2793
  const fnRef = useLatest(fn);
391
2794
  const throttled = React.useMemo(
392
- () => throttle$1(
2795
+ () => throttle(
393
2796
  (...args) => {
394
2797
  return fnRef.current(...args);
395
2798
  },
@@ -424,10 +2827,9 @@ function useThrottle(value, wait, options) {
424
2827
  return throttled;
425
2828
  }
426
2829
 
427
- const { debounce } = lodash__default["default"];
428
2830
  function useDebounceFn(fn, wait, options) {
429
2831
  if (isDev) {
430
- if (!isFunction(fn)) {
2832
+ if (!isFunction$1(fn)) {
431
2833
  console.error(
432
2834
  `useDebounceFn expected parameter is a function, got ${typeof fn}`
433
2835
  );
@@ -562,7 +2964,7 @@ function getTargetElement(target, defaultElement) {
562
2964
  return defaultElement;
563
2965
  }
564
2966
  let targetElement;
565
- if (isFunction(target)) {
2967
+ if (isFunction$1(target)) {
566
2968
  targetElement = target();
567
2969
  } else if ("current" in target) {
568
2970
  targetElement = target.current;
@@ -969,7 +3371,6 @@ const defaultEvents$1 = [
969
3371
  "wheel"
970
3372
  ];
971
3373
  const oneMinute = 6e4;
972
- const { throttle } = lodash__default["default"];
973
3374
  function useIdle(ms = oneMinute, initialState = false, events = defaultEvents$1) {
974
3375
  const [state, setState] = React.useState(initialState);
975
3376
  React.useEffect(() => {
@@ -1650,17 +4051,17 @@ function useDropZone(target, onDrop) {
1650
4051
  }
1651
4052
 
1652
4053
  var __defProp$1 = Object.defineProperty;
1653
- var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
1654
- var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
1655
- var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
4054
+ var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
4055
+ var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
4056
+ var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
1656
4057
  var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1657
4058
  var __spreadValues$1 = (a, b) => {
1658
4059
  for (var prop in b || (b = {}))
1659
- if (__hasOwnProp$1.call(b, prop))
4060
+ if (__hasOwnProp$2.call(b, prop))
1660
4061
  __defNormalProp$1(a, prop, b[prop]);
1661
- if (__getOwnPropSymbols$1)
1662
- for (var prop of __getOwnPropSymbols$1(b)) {
1663
- if (__propIsEnum$1.call(b, prop))
4062
+ if (__getOwnPropSymbols$2)
4063
+ for (var prop of __getOwnPropSymbols$2(b)) {
4064
+ if (__propIsEnum$2.call(b, prop))
1664
4065
  __defNormalProp$1(a, prop, b[prop]);
1665
4066
  }
1666
4067
  return a;
@@ -1779,17 +4180,17 @@ function useScroll(target, options = {}) {
1779
4180
  var __defProp = Object.defineProperty;
1780
4181
  var __defProps = Object.defineProperties;
1781
4182
  var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
1782
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
1783
- var __hasOwnProp = Object.prototype.hasOwnProperty;
1784
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
4183
+ var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
4184
+ var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
4185
+ var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
1785
4186
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1786
4187
  var __spreadValues = (a, b) => {
1787
4188
  for (var prop in b || (b = {}))
1788
- if (__hasOwnProp.call(b, prop))
4189
+ if (__hasOwnProp$1.call(b, prop))
1789
4190
  __defNormalProp(a, prop, b[prop]);
1790
- if (__getOwnPropSymbols)
1791
- for (var prop of __getOwnPropSymbols(b)) {
1792
- if (__propIsEnum.call(b, prop))
4191
+ if (__getOwnPropSymbols$1)
4192
+ for (var prop of __getOwnPropSymbols$1(b)) {
4193
+ if (__propIsEnum$1.call(b, prop))
1793
4194
  __defNormalProp(a, prop, b[prop]);
1794
4195
  }
1795
4196
  return a;
@@ -2884,12 +5285,239 @@ function useEyeDropper() {
2884
5285
  return [isSupported, open];
2885
5286
  }
2886
5287
 
5288
+ /*! js-cookie v3.0.5 | MIT */
5289
+ /* eslint-disable no-var */
5290
+ function assign (target) {
5291
+ for (var i = 1; i < arguments.length; i++) {
5292
+ var source = arguments[i];
5293
+ for (var key in source) {
5294
+ target[key] = source[key];
5295
+ }
5296
+ }
5297
+ return target
5298
+ }
5299
+ /* eslint-enable no-var */
5300
+
5301
+ /* eslint-disable no-var */
5302
+ var defaultConverter = {
5303
+ read: function (value) {
5304
+ if (value[0] === '"') {
5305
+ value = value.slice(1, -1);
5306
+ }
5307
+ return value.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent)
5308
+ },
5309
+ write: function (value) {
5310
+ return encodeURIComponent(value).replace(
5311
+ /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,
5312
+ decodeURIComponent
5313
+ )
5314
+ }
5315
+ };
5316
+ /* eslint-enable no-var */
5317
+
5318
+ /* eslint-disable no-var */
5319
+
5320
+ function init (converter, defaultAttributes) {
5321
+ function set (name, value, attributes) {
5322
+ if (typeof document === 'undefined') {
5323
+ return
5324
+ }
5325
+
5326
+ attributes = assign({}, defaultAttributes, attributes);
5327
+
5328
+ if (typeof attributes.expires === 'number') {
5329
+ attributes.expires = new Date(Date.now() + attributes.expires * 864e5);
5330
+ }
5331
+ if (attributes.expires) {
5332
+ attributes.expires = attributes.expires.toUTCString();
5333
+ }
5334
+
5335
+ name = encodeURIComponent(name)
5336
+ .replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent)
5337
+ .replace(/[()]/g, escape);
5338
+
5339
+ var stringifiedAttributes = '';
5340
+ for (var attributeName in attributes) {
5341
+ if (!attributes[attributeName]) {
5342
+ continue
5343
+ }
5344
+
5345
+ stringifiedAttributes += '; ' + attributeName;
5346
+
5347
+ if (attributes[attributeName] === true) {
5348
+ continue
5349
+ }
5350
+
5351
+ // Considers RFC 6265 section 5.2:
5352
+ // ...
5353
+ // 3. If the remaining unparsed-attributes contains a %x3B (";")
5354
+ // character:
5355
+ // Consume the characters of the unparsed-attributes up to,
5356
+ // not including, the first %x3B (";") character.
5357
+ // ...
5358
+ stringifiedAttributes += '=' + attributes[attributeName].split(';')[0];
5359
+ }
5360
+
5361
+ return (document.cookie =
5362
+ name + '=' + converter.write(value, name) + stringifiedAttributes)
5363
+ }
5364
+
5365
+ function get (name) {
5366
+ if (typeof document === 'undefined' || (arguments.length && !name)) {
5367
+ return
5368
+ }
5369
+
5370
+ // To prevent the for loop in the first place assign an empty array
5371
+ // in case there are no cookies at all.
5372
+ var cookies = document.cookie ? document.cookie.split('; ') : [];
5373
+ var jar = {};
5374
+ for (var i = 0; i < cookies.length; i++) {
5375
+ var parts = cookies[i].split('=');
5376
+ var value = parts.slice(1).join('=');
5377
+
5378
+ try {
5379
+ var found = decodeURIComponent(parts[0]);
5380
+ jar[found] = converter.read(value, found);
5381
+
5382
+ if (name === found) {
5383
+ break
5384
+ }
5385
+ } catch (e) {}
5386
+ }
5387
+
5388
+ return name ? jar[name] : jar
5389
+ }
5390
+
5391
+ return Object.create(
5392
+ {
5393
+ set,
5394
+ get,
5395
+ remove: function (name, attributes) {
5396
+ set(
5397
+ name,
5398
+ '',
5399
+ assign({}, attributes, {
5400
+ expires: -1
5401
+ })
5402
+ );
5403
+ },
5404
+ withAttributes: function (attributes) {
5405
+ return init(this.converter, assign({}, this.attributes, attributes))
5406
+ },
5407
+ withConverter: function (converter) {
5408
+ return init(assign({}, this.converter, converter), this.attributes)
5409
+ }
5410
+ },
5411
+ {
5412
+ attributes: { value: Object.freeze(defaultAttributes) },
5413
+ converter: { value: Object.freeze(converter) }
5414
+ }
5415
+ )
5416
+ }
5417
+
5418
+ var api = init(defaultConverter, { path: '/' });
5419
+
5420
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5421
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5422
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
5423
+ var __objRest = (source, exclude) => {
5424
+ var target = {};
5425
+ for (var prop in source)
5426
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
5427
+ target[prop] = source[prop];
5428
+ if (source != null && __getOwnPropSymbols)
5429
+ for (var prop of __getOwnPropSymbols(source)) {
5430
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
5431
+ target[prop] = source[prop];
5432
+ }
5433
+ return target;
5434
+ };
5435
+ function useCookie(key, options = {
5436
+ defaultValue: ""
5437
+ }) {
5438
+ const _a = options, { defaultValue, csrData } = _a, cookieOptions = __objRest(_a, ["defaultValue", "csrData"]);
5439
+ const [cookieValue, setCookieValue] = React.useState(defaultValue);
5440
+ useDeepCompareEffect(() => {
5441
+ const data = csrData ? isFunction$1(csrData) ? csrData() : csrData : isFunction$1(defaultValue) ? defaultValue() : defaultValue;
5442
+ const getStoredValue = () => {
5443
+ const raw = api.get(key);
5444
+ if (raw !== void 0 && raw !== null) {
5445
+ return raw;
5446
+ } else {
5447
+ if (data === void 0) {
5448
+ api.remove(key);
5449
+ } else {
5450
+ api.set(key, data, cookieOptions);
5451
+ }
5452
+ return data;
5453
+ }
5454
+ };
5455
+ setCookieValue(getStoredValue());
5456
+ }, [csrData, defaultValue, key, cookieOptions]);
5457
+ const updateCookie = React.useCallback(
5458
+ (newValue) => {
5459
+ const value = isFunction$1(newValue) ? newValue(cookieValue) : newValue;
5460
+ if (value === void 0) {
5461
+ api.remove(key);
5462
+ } else {
5463
+ api.set(key, value, cookieOptions);
5464
+ }
5465
+ setCookieValue(value);
5466
+ },
5467
+ [key, cookieValue]
5468
+ );
5469
+ const refreshCookie = React.useCallback(() => {
5470
+ const cookieValue2 = api.get(key);
5471
+ if (isString(cookieValue2)) {
5472
+ setCookieValue(cookieValue2);
5473
+ }
5474
+ }, [key]);
5475
+ return Object.freeze([cookieValue, updateCookie, refreshCookie]);
5476
+ }
5477
+
5478
+ function useDoubleClick({
5479
+ target,
5480
+ latency = 300,
5481
+ onSingleClick = () => {
5482
+ },
5483
+ onDoubleClick = () => {
5484
+ }
5485
+ }) {
5486
+ const element = useLatestElement(target);
5487
+ const handle = React.useCallback(
5488
+ (onSingleClick2, onDoubleClick2) => {
5489
+ let count = 0;
5490
+ return (e) => {
5491
+ if (e.type === "touchend") {
5492
+ e.stopPropagation();
5493
+ e.preventDefault();
5494
+ }
5495
+ count += 1;
5496
+ setTimeout(() => {
5497
+ if (count === 1) {
5498
+ onSingleClick2(e);
5499
+ } else if (count === 2) {
5500
+ onDoubleClick2(e);
5501
+ }
5502
+ count = 0;
5503
+ }, latency);
5504
+ };
5505
+ },
5506
+ [latency]
5507
+ );
5508
+ const handleClick = handle(onSingleClick, onDoubleClick);
5509
+ const handleTouchEnd = handle(onSingleClick, onDoubleClick);
5510
+ useEventListener("click", handleClick, element);
5511
+ useEventListener("touchend", handleTouchEnd, element, { passive: false });
5512
+ }
5513
+
2887
5514
  exports.getHMSTime = getHMSTime;
2888
5515
  exports.useActiveElement = useActiveElement;
2889
5516
  exports.useAsyncEffect = useAsyncEffect;
2890
5517
  exports.useClickOutside = useClickOutSide;
2891
5518
  exports.useClipboard = useClipBorad;
2892
5519
  exports.useControlled = useControlled;
5520
+ exports.useCookie = useCookie;
2893
5521
  exports.useCountDown = useCountDown;
2894
5522
  exports.useCounter = useCounter;
2895
5523
  exports.useCustomCompareEffect = useCustomCompareEffect;
@@ -2899,6 +5527,7 @@ exports.useDebounce = useDebounce;
2899
5527
  exports.useDebounceFn = useDebounceFn;
2900
5528
  exports.useDeepCompareEffect = useDeepCompareEffect;
2901
5529
  exports.useDocumentVisibility = useDocumentVisibility;
5530
+ exports.useDoubleClick = useDoubleClick;
2902
5531
  exports.useDraggable = useDraggable;
2903
5532
  exports.useDropZone = useDropZone;
2904
5533
  exports.useElementBounding = useElementBounding;