@pie-lib/controller-utils 0.22.3-next.0 → 0.22.3-next.163

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/esm/index.js ADDED
@@ -0,0 +1,2999 @@
1
+ const enabled = (config, env, defaultValue) => {
2
+ // if model.partialScoring = false
3
+ // - if env.partialScoring = false || env.partialScoring = true => use dichotomous scoring
4
+ // else if model.partialScoring = true || undefined
5
+ // - if env.partialScoring = false, use dichotomous scoring
6
+ // - else if env.partialScoring = true, use partial scoring
7
+ config = config || {};
8
+ env = env || {};
9
+ if (config.partialScoring === false) {
10
+ return false;
11
+ }
12
+ if (env.partialScoring === false) {
13
+ return false;
14
+ }
15
+ return typeof defaultValue === 'boolean' ? defaultValue : true;
16
+ };
17
+
18
+ var partialScoring = /*#__PURE__*/Object.freeze({
19
+ __proto__: null,
20
+ enabled: enabled
21
+ });
22
+
23
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
24
+
25
+ function getDefaultExportFromCjs (x) {
26
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
27
+ }
28
+
29
+ /**
30
+ * Checks if `value` is classified as an `Array` object.
31
+ *
32
+ * @static
33
+ * @memberOf _
34
+ * @since 0.1.0
35
+ * @category Lang
36
+ * @param {*} value The value to check.
37
+ * @returns {boolean} Returns `true` if `value` is an array, else `false`.
38
+ * @example
39
+ *
40
+ * _.isArray([1, 2, 3]);
41
+ * // => true
42
+ *
43
+ * _.isArray(document.body.children);
44
+ * // => false
45
+ *
46
+ * _.isArray('abc');
47
+ * // => false
48
+ *
49
+ * _.isArray(_.noop);
50
+ * // => false
51
+ */
52
+
53
+ var isArray_1;
54
+ var hasRequiredIsArray;
55
+
56
+ function requireIsArray () {
57
+ if (hasRequiredIsArray) return isArray_1;
58
+ hasRequiredIsArray = 1;
59
+ var isArray = Array.isArray;
60
+
61
+ isArray_1 = isArray;
62
+ return isArray_1;
63
+ }
64
+
65
+ /** Detect free variable `global` from Node.js. */
66
+
67
+ var _freeGlobal;
68
+ var hasRequired_freeGlobal;
69
+
70
+ function require_freeGlobal () {
71
+ if (hasRequired_freeGlobal) return _freeGlobal;
72
+ hasRequired_freeGlobal = 1;
73
+ var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
74
+
75
+ _freeGlobal = freeGlobal;
76
+ return _freeGlobal;
77
+ }
78
+
79
+ var _root;
80
+ var hasRequired_root;
81
+
82
+ function require_root () {
83
+ if (hasRequired_root) return _root;
84
+ hasRequired_root = 1;
85
+ var freeGlobal = require_freeGlobal();
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
+ _root = root;
94
+ return _root;
95
+ }
96
+
97
+ var _Symbol;
98
+ var hasRequired_Symbol;
99
+
100
+ function require_Symbol () {
101
+ if (hasRequired_Symbol) return _Symbol;
102
+ hasRequired_Symbol = 1;
103
+ var root = require_root();
104
+
105
+ /** Built-in value references. */
106
+ var Symbol = root.Symbol;
107
+
108
+ _Symbol = Symbol;
109
+ return _Symbol;
110
+ }
111
+
112
+ var _getRawTag;
113
+ var hasRequired_getRawTag;
114
+
115
+ function require_getRawTag () {
116
+ if (hasRequired_getRawTag) return _getRawTag;
117
+ hasRequired_getRawTag = 1;
118
+ var Symbol = require_Symbol();
119
+
120
+ /** Used for built-in method references. */
121
+ var objectProto = Object.prototype;
122
+
123
+ /** Used to check objects for own properties. */
124
+ var hasOwnProperty = objectProto.hasOwnProperty;
125
+
126
+ /**
127
+ * Used to resolve the
128
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
129
+ * of values.
130
+ */
131
+ var nativeObjectToString = objectProto.toString;
132
+
133
+ /** Built-in value references. */
134
+ var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
135
+
136
+ /**
137
+ * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
138
+ *
139
+ * @private
140
+ * @param {*} value The value to query.
141
+ * @returns {string} Returns the raw `toStringTag`.
142
+ */
143
+ function getRawTag(value) {
144
+ var isOwn = hasOwnProperty.call(value, symToStringTag),
145
+ tag = value[symToStringTag];
146
+
147
+ try {
148
+ value[symToStringTag] = undefined;
149
+ var unmasked = true;
150
+ } catch (e) {}
151
+
152
+ var result = nativeObjectToString.call(value);
153
+ if (unmasked) {
154
+ if (isOwn) {
155
+ value[symToStringTag] = tag;
156
+ } else {
157
+ delete value[symToStringTag];
158
+ }
159
+ }
160
+ return result;
161
+ }
162
+
163
+ _getRawTag = getRawTag;
164
+ return _getRawTag;
165
+ }
166
+
167
+ /** Used for built-in method references. */
168
+
169
+ var _objectToString;
170
+ var hasRequired_objectToString;
171
+
172
+ function require_objectToString () {
173
+ if (hasRequired_objectToString) return _objectToString;
174
+ hasRequired_objectToString = 1;
175
+ var objectProto = Object.prototype;
176
+
177
+ /**
178
+ * Used to resolve the
179
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
180
+ * of values.
181
+ */
182
+ var nativeObjectToString = objectProto.toString;
183
+
184
+ /**
185
+ * Converts `value` to a string using `Object.prototype.toString`.
186
+ *
187
+ * @private
188
+ * @param {*} value The value to convert.
189
+ * @returns {string} Returns the converted string.
190
+ */
191
+ function objectToString(value) {
192
+ return nativeObjectToString.call(value);
193
+ }
194
+
195
+ _objectToString = objectToString;
196
+ return _objectToString;
197
+ }
198
+
199
+ var _baseGetTag;
200
+ var hasRequired_baseGetTag;
201
+
202
+ function require_baseGetTag () {
203
+ if (hasRequired_baseGetTag) return _baseGetTag;
204
+ hasRequired_baseGetTag = 1;
205
+ var Symbol = require_Symbol(),
206
+ getRawTag = require_getRawTag(),
207
+ objectToString = require_objectToString();
208
+
209
+ /** `Object#toString` result references. */
210
+ var nullTag = '[object Null]',
211
+ undefinedTag = '[object Undefined]';
212
+
213
+ /** Built-in value references. */
214
+ var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
215
+
216
+ /**
217
+ * The base implementation of `getTag` without fallbacks for buggy environments.
218
+ *
219
+ * @private
220
+ * @param {*} value The value to query.
221
+ * @returns {string} Returns the `toStringTag`.
222
+ */
223
+ function baseGetTag(value) {
224
+ if (value == null) {
225
+ return value === undefined ? undefinedTag : nullTag;
226
+ }
227
+ return (symToStringTag && symToStringTag in Object(value))
228
+ ? getRawTag(value)
229
+ : objectToString(value);
230
+ }
231
+
232
+ _baseGetTag = baseGetTag;
233
+ return _baseGetTag;
234
+ }
235
+
236
+ /**
237
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
238
+ * and has a `typeof` result of "object".
239
+ *
240
+ * @static
241
+ * @memberOf _
242
+ * @since 4.0.0
243
+ * @category Lang
244
+ * @param {*} value The value to check.
245
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
246
+ * @example
247
+ *
248
+ * _.isObjectLike({});
249
+ * // => true
250
+ *
251
+ * _.isObjectLike([1, 2, 3]);
252
+ * // => true
253
+ *
254
+ * _.isObjectLike(_.noop);
255
+ * // => false
256
+ *
257
+ * _.isObjectLike(null);
258
+ * // => false
259
+ */
260
+
261
+ var isObjectLike_1;
262
+ var hasRequiredIsObjectLike;
263
+
264
+ function requireIsObjectLike () {
265
+ if (hasRequiredIsObjectLike) return isObjectLike_1;
266
+ hasRequiredIsObjectLike = 1;
267
+ function isObjectLike(value) {
268
+ return value != null && typeof value == 'object';
269
+ }
270
+
271
+ isObjectLike_1 = isObjectLike;
272
+ return isObjectLike_1;
273
+ }
274
+
275
+ var isSymbol_1;
276
+ var hasRequiredIsSymbol;
277
+
278
+ function requireIsSymbol () {
279
+ if (hasRequiredIsSymbol) return isSymbol_1;
280
+ hasRequiredIsSymbol = 1;
281
+ var baseGetTag = require_baseGetTag(),
282
+ isObjectLike = requireIsObjectLike();
283
+
284
+ /** `Object#toString` result references. */
285
+ var symbolTag = '[object Symbol]';
286
+
287
+ /**
288
+ * Checks if `value` is classified as a `Symbol` primitive or object.
289
+ *
290
+ * @static
291
+ * @memberOf _
292
+ * @since 4.0.0
293
+ * @category Lang
294
+ * @param {*} value The value to check.
295
+ * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
296
+ * @example
297
+ *
298
+ * _.isSymbol(Symbol.iterator);
299
+ * // => true
300
+ *
301
+ * _.isSymbol('abc');
302
+ * // => false
303
+ */
304
+ function isSymbol(value) {
305
+ return typeof value == 'symbol' ||
306
+ (isObjectLike(value) && baseGetTag(value) == symbolTag);
307
+ }
308
+
309
+ isSymbol_1 = isSymbol;
310
+ return isSymbol_1;
311
+ }
312
+
313
+ var _isKey;
314
+ var hasRequired_isKey;
315
+
316
+ function require_isKey () {
317
+ if (hasRequired_isKey) return _isKey;
318
+ hasRequired_isKey = 1;
319
+ var isArray = requireIsArray(),
320
+ isSymbol = requireIsSymbol();
321
+
322
+ /** Used to match property names within property paths. */
323
+ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
324
+ reIsPlainProp = /^\w*$/;
325
+
326
+ /**
327
+ * Checks if `value` is a property name and not a property path.
328
+ *
329
+ * @private
330
+ * @param {*} value The value to check.
331
+ * @param {Object} [object] The object to query keys on.
332
+ * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
333
+ */
334
+ function isKey(value, object) {
335
+ if (isArray(value)) {
336
+ return false;
337
+ }
338
+ var type = typeof value;
339
+ if (type == 'number' || type == 'symbol' || type == 'boolean' ||
340
+ value == null || isSymbol(value)) {
341
+ return true;
342
+ }
343
+ return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
344
+ (object != null && value in Object(object));
345
+ }
346
+
347
+ _isKey = isKey;
348
+ return _isKey;
349
+ }
350
+
351
+ /**
352
+ * Checks if `value` is the
353
+ * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
354
+ * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
355
+ *
356
+ * @static
357
+ * @memberOf _
358
+ * @since 0.1.0
359
+ * @category Lang
360
+ * @param {*} value The value to check.
361
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
362
+ * @example
363
+ *
364
+ * _.isObject({});
365
+ * // => true
366
+ *
367
+ * _.isObject([1, 2, 3]);
368
+ * // => true
369
+ *
370
+ * _.isObject(_.noop);
371
+ * // => true
372
+ *
373
+ * _.isObject(null);
374
+ * // => false
375
+ */
376
+
377
+ var isObject_1;
378
+ var hasRequiredIsObject;
379
+
380
+ function requireIsObject () {
381
+ if (hasRequiredIsObject) return isObject_1;
382
+ hasRequiredIsObject = 1;
383
+ function isObject(value) {
384
+ var type = typeof value;
385
+ return value != null && (type == 'object' || type == 'function');
386
+ }
387
+
388
+ isObject_1 = isObject;
389
+ return isObject_1;
390
+ }
391
+
392
+ var isFunction_1;
393
+ var hasRequiredIsFunction;
394
+
395
+ function requireIsFunction () {
396
+ if (hasRequiredIsFunction) return isFunction_1;
397
+ hasRequiredIsFunction = 1;
398
+ var baseGetTag = require_baseGetTag(),
399
+ isObject = requireIsObject();
400
+
401
+ /** `Object#toString` result references. */
402
+ var asyncTag = '[object AsyncFunction]',
403
+ funcTag = '[object Function]',
404
+ genTag = '[object GeneratorFunction]',
405
+ proxyTag = '[object Proxy]';
406
+
407
+ /**
408
+ * Checks if `value` is classified as a `Function` object.
409
+ *
410
+ * @static
411
+ * @memberOf _
412
+ * @since 0.1.0
413
+ * @category Lang
414
+ * @param {*} value The value to check.
415
+ * @returns {boolean} Returns `true` if `value` is a function, else `false`.
416
+ * @example
417
+ *
418
+ * _.isFunction(_);
419
+ * // => true
420
+ *
421
+ * _.isFunction(/abc/);
422
+ * // => false
423
+ */
424
+ function isFunction(value) {
425
+ if (!isObject(value)) {
426
+ return false;
427
+ }
428
+ // The use of `Object#toString` avoids issues with the `typeof` operator
429
+ // in Safari 9 which returns 'object' for typed arrays and other constructors.
430
+ var tag = baseGetTag(value);
431
+ return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
432
+ }
433
+
434
+ isFunction_1 = isFunction;
435
+ return isFunction_1;
436
+ }
437
+
438
+ var _coreJsData;
439
+ var hasRequired_coreJsData;
440
+
441
+ function require_coreJsData () {
442
+ if (hasRequired_coreJsData) return _coreJsData;
443
+ hasRequired_coreJsData = 1;
444
+ var root = require_root();
445
+
446
+ /** Used to detect overreaching core-js shims. */
447
+ var coreJsData = root['__core-js_shared__'];
448
+
449
+ _coreJsData = coreJsData;
450
+ return _coreJsData;
451
+ }
452
+
453
+ var _isMasked;
454
+ var hasRequired_isMasked;
455
+
456
+ function require_isMasked () {
457
+ if (hasRequired_isMasked) return _isMasked;
458
+ hasRequired_isMasked = 1;
459
+ var coreJsData = require_coreJsData();
460
+
461
+ /** Used to detect methods masquerading as native. */
462
+ var maskSrcKey = (function() {
463
+ var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
464
+ return uid ? ('Symbol(src)_1.' + uid) : '';
465
+ }());
466
+
467
+ /**
468
+ * Checks if `func` has its source masked.
469
+ *
470
+ * @private
471
+ * @param {Function} func The function to check.
472
+ * @returns {boolean} Returns `true` if `func` is masked, else `false`.
473
+ */
474
+ function isMasked(func) {
475
+ return !!maskSrcKey && (maskSrcKey in func);
476
+ }
477
+
478
+ _isMasked = isMasked;
479
+ return _isMasked;
480
+ }
481
+
482
+ /** Used for built-in method references. */
483
+
484
+ var _toSource;
485
+ var hasRequired_toSource;
486
+
487
+ function require_toSource () {
488
+ if (hasRequired_toSource) return _toSource;
489
+ hasRequired_toSource = 1;
490
+ var funcProto = Function.prototype;
491
+
492
+ /** Used to resolve the decompiled source of functions. */
493
+ var funcToString = funcProto.toString;
494
+
495
+ /**
496
+ * Converts `func` to its source code.
497
+ *
498
+ * @private
499
+ * @param {Function} func The function to convert.
500
+ * @returns {string} Returns the source code.
501
+ */
502
+ function toSource(func) {
503
+ if (func != null) {
504
+ try {
505
+ return funcToString.call(func);
506
+ } catch (e) {}
507
+ try {
508
+ return (func + '');
509
+ } catch (e) {}
510
+ }
511
+ return '';
512
+ }
513
+
514
+ _toSource = toSource;
515
+ return _toSource;
516
+ }
517
+
518
+ var _baseIsNative;
519
+ var hasRequired_baseIsNative;
520
+
521
+ function require_baseIsNative () {
522
+ if (hasRequired_baseIsNative) return _baseIsNative;
523
+ hasRequired_baseIsNative = 1;
524
+ var isFunction = requireIsFunction(),
525
+ isMasked = require_isMasked(),
526
+ isObject = requireIsObject(),
527
+ toSource = require_toSource();
528
+
529
+ /**
530
+ * Used to match `RegExp`
531
+ * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
532
+ */
533
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
534
+
535
+ /** Used to detect host constructors (Safari). */
536
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
537
+
538
+ /** Used for built-in method references. */
539
+ var funcProto = Function.prototype,
540
+ objectProto = Object.prototype;
541
+
542
+ /** Used to resolve the decompiled source of functions. */
543
+ var funcToString = funcProto.toString;
544
+
545
+ /** Used to check objects for own properties. */
546
+ var hasOwnProperty = objectProto.hasOwnProperty;
547
+
548
+ /** Used to detect if a method is native. */
549
+ var reIsNative = RegExp('^' +
550
+ funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
551
+ .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
552
+ );
553
+
554
+ /**
555
+ * The base implementation of `_.isNative` without bad shim checks.
556
+ *
557
+ * @private
558
+ * @param {*} value The value to check.
559
+ * @returns {boolean} Returns `true` if `value` is a native function,
560
+ * else `false`.
561
+ */
562
+ function baseIsNative(value) {
563
+ if (!isObject(value) || isMasked(value)) {
564
+ return false;
565
+ }
566
+ var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
567
+ return pattern.test(toSource(value));
568
+ }
569
+
570
+ _baseIsNative = baseIsNative;
571
+ return _baseIsNative;
572
+ }
573
+
574
+ /**
575
+ * Gets the value at `key` of `object`.
576
+ *
577
+ * @private
578
+ * @param {Object} [object] The object to query.
579
+ * @param {string} key The key of the property to get.
580
+ * @returns {*} Returns the property value.
581
+ */
582
+
583
+ var _getValue;
584
+ var hasRequired_getValue;
585
+
586
+ function require_getValue () {
587
+ if (hasRequired_getValue) return _getValue;
588
+ hasRequired_getValue = 1;
589
+ function getValue(object, key) {
590
+ return object == null ? undefined : object[key];
591
+ }
592
+
593
+ _getValue = getValue;
594
+ return _getValue;
595
+ }
596
+
597
+ var _getNative;
598
+ var hasRequired_getNative;
599
+
600
+ function require_getNative () {
601
+ if (hasRequired_getNative) return _getNative;
602
+ hasRequired_getNative = 1;
603
+ var baseIsNative = require_baseIsNative(),
604
+ getValue = require_getValue();
605
+
606
+ /**
607
+ * Gets the native function at `key` of `object`.
608
+ *
609
+ * @private
610
+ * @param {Object} object The object to query.
611
+ * @param {string} key The key of the method to get.
612
+ * @returns {*} Returns the function if it's native, else `undefined`.
613
+ */
614
+ function getNative(object, key) {
615
+ var value = getValue(object, key);
616
+ return baseIsNative(value) ? value : undefined;
617
+ }
618
+
619
+ _getNative = getNative;
620
+ return _getNative;
621
+ }
622
+
623
+ var _nativeCreate;
624
+ var hasRequired_nativeCreate;
625
+
626
+ function require_nativeCreate () {
627
+ if (hasRequired_nativeCreate) return _nativeCreate;
628
+ hasRequired_nativeCreate = 1;
629
+ var getNative = require_getNative();
630
+
631
+ /* Built-in method references that are verified to be native. */
632
+ var nativeCreate = getNative(Object, 'create');
633
+
634
+ _nativeCreate = nativeCreate;
635
+ return _nativeCreate;
636
+ }
637
+
638
+ var _hashClear;
639
+ var hasRequired_hashClear;
640
+
641
+ function require_hashClear () {
642
+ if (hasRequired_hashClear) return _hashClear;
643
+ hasRequired_hashClear = 1;
644
+ var nativeCreate = require_nativeCreate();
645
+
646
+ /**
647
+ * Removes all key-value entries from the hash.
648
+ *
649
+ * @private
650
+ * @name clear
651
+ * @memberOf Hash
652
+ */
653
+ function hashClear() {
654
+ this.__data__ = nativeCreate ? nativeCreate(null) : {};
655
+ this.size = 0;
656
+ }
657
+
658
+ _hashClear = hashClear;
659
+ return _hashClear;
660
+ }
661
+
662
+ /**
663
+ * Removes `key` and its value from the hash.
664
+ *
665
+ * @private
666
+ * @name delete
667
+ * @memberOf Hash
668
+ * @param {Object} hash The hash to modify.
669
+ * @param {string} key The key of the value to remove.
670
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
671
+ */
672
+
673
+ var _hashDelete;
674
+ var hasRequired_hashDelete;
675
+
676
+ function require_hashDelete () {
677
+ if (hasRequired_hashDelete) return _hashDelete;
678
+ hasRequired_hashDelete = 1;
679
+ function hashDelete(key) {
680
+ var result = this.has(key) && delete this.__data__[key];
681
+ this.size -= result ? 1 : 0;
682
+ return result;
683
+ }
684
+
685
+ _hashDelete = hashDelete;
686
+ return _hashDelete;
687
+ }
688
+
689
+ var _hashGet;
690
+ var hasRequired_hashGet;
691
+
692
+ function require_hashGet () {
693
+ if (hasRequired_hashGet) return _hashGet;
694
+ hasRequired_hashGet = 1;
695
+ var nativeCreate = require_nativeCreate();
696
+
697
+ /** Used to stand-in for `undefined` hash values. */
698
+ var HASH_UNDEFINED = '__lodash_hash_undefined__';
699
+
700
+ /** Used for built-in method references. */
701
+ var objectProto = Object.prototype;
702
+
703
+ /** Used to check objects for own properties. */
704
+ var hasOwnProperty = objectProto.hasOwnProperty;
705
+
706
+ /**
707
+ * Gets the hash value for `key`.
708
+ *
709
+ * @private
710
+ * @name get
711
+ * @memberOf Hash
712
+ * @param {string} key The key of the value to get.
713
+ * @returns {*} Returns the entry value.
714
+ */
715
+ function hashGet(key) {
716
+ var data = this.__data__;
717
+ if (nativeCreate) {
718
+ var result = data[key];
719
+ return result === HASH_UNDEFINED ? undefined : result;
720
+ }
721
+ return hasOwnProperty.call(data, key) ? data[key] : undefined;
722
+ }
723
+
724
+ _hashGet = hashGet;
725
+ return _hashGet;
726
+ }
727
+
728
+ var _hashHas;
729
+ var hasRequired_hashHas;
730
+
731
+ function require_hashHas () {
732
+ if (hasRequired_hashHas) return _hashHas;
733
+ hasRequired_hashHas = 1;
734
+ var nativeCreate = require_nativeCreate();
735
+
736
+ /** Used for built-in method references. */
737
+ var objectProto = Object.prototype;
738
+
739
+ /** Used to check objects for own properties. */
740
+ var hasOwnProperty = objectProto.hasOwnProperty;
741
+
742
+ /**
743
+ * Checks if a hash value for `key` exists.
744
+ *
745
+ * @private
746
+ * @name has
747
+ * @memberOf Hash
748
+ * @param {string} key The key of the entry to check.
749
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
750
+ */
751
+ function hashHas(key) {
752
+ var data = this.__data__;
753
+ return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
754
+ }
755
+
756
+ _hashHas = hashHas;
757
+ return _hashHas;
758
+ }
759
+
760
+ var _hashSet;
761
+ var hasRequired_hashSet;
762
+
763
+ function require_hashSet () {
764
+ if (hasRequired_hashSet) return _hashSet;
765
+ hasRequired_hashSet = 1;
766
+ var nativeCreate = require_nativeCreate();
767
+
768
+ /** Used to stand-in for `undefined` hash values. */
769
+ var HASH_UNDEFINED = '__lodash_hash_undefined__';
770
+
771
+ /**
772
+ * Sets the hash `key` to `value`.
773
+ *
774
+ * @private
775
+ * @name set
776
+ * @memberOf Hash
777
+ * @param {string} key The key of the value to set.
778
+ * @param {*} value The value to set.
779
+ * @returns {Object} Returns the hash instance.
780
+ */
781
+ function hashSet(key, value) {
782
+ var data = this.__data__;
783
+ this.size += this.has(key) ? 0 : 1;
784
+ data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
785
+ return this;
786
+ }
787
+
788
+ _hashSet = hashSet;
789
+ return _hashSet;
790
+ }
791
+
792
+ var _Hash;
793
+ var hasRequired_Hash;
794
+
795
+ function require_Hash () {
796
+ if (hasRequired_Hash) return _Hash;
797
+ hasRequired_Hash = 1;
798
+ var hashClear = require_hashClear(),
799
+ hashDelete = require_hashDelete(),
800
+ hashGet = require_hashGet(),
801
+ hashHas = require_hashHas(),
802
+ hashSet = require_hashSet();
803
+
804
+ /**
805
+ * Creates a hash object.
806
+ *
807
+ * @private
808
+ * @constructor
809
+ * @param {Array} [entries] The key-value pairs to cache.
810
+ */
811
+ function Hash(entries) {
812
+ var index = -1,
813
+ length = entries == null ? 0 : entries.length;
814
+
815
+ this.clear();
816
+ while (++index < length) {
817
+ var entry = entries[index];
818
+ this.set(entry[0], entry[1]);
819
+ }
820
+ }
821
+
822
+ // Add methods to `Hash`.
823
+ Hash.prototype.clear = hashClear;
824
+ Hash.prototype['delete'] = hashDelete;
825
+ Hash.prototype.get = hashGet;
826
+ Hash.prototype.has = hashHas;
827
+ Hash.prototype.set = hashSet;
828
+
829
+ _Hash = Hash;
830
+ return _Hash;
831
+ }
832
+
833
+ /**
834
+ * Removes all key-value entries from the list cache.
835
+ *
836
+ * @private
837
+ * @name clear
838
+ * @memberOf ListCache
839
+ */
840
+
841
+ var _listCacheClear;
842
+ var hasRequired_listCacheClear;
843
+
844
+ function require_listCacheClear () {
845
+ if (hasRequired_listCacheClear) return _listCacheClear;
846
+ hasRequired_listCacheClear = 1;
847
+ function listCacheClear() {
848
+ this.__data__ = [];
849
+ this.size = 0;
850
+ }
851
+
852
+ _listCacheClear = listCacheClear;
853
+ return _listCacheClear;
854
+ }
855
+
856
+ /**
857
+ * Performs a
858
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
859
+ * comparison between two values to determine if they are equivalent.
860
+ *
861
+ * @static
862
+ * @memberOf _
863
+ * @since 4.0.0
864
+ * @category Lang
865
+ * @param {*} value The value to compare.
866
+ * @param {*} other The other value to compare.
867
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
868
+ * @example
869
+ *
870
+ * var object = { 'a': 1 };
871
+ * var other = { 'a': 1 };
872
+ *
873
+ * _.eq(object, object);
874
+ * // => true
875
+ *
876
+ * _.eq(object, other);
877
+ * // => false
878
+ *
879
+ * _.eq('a', 'a');
880
+ * // => true
881
+ *
882
+ * _.eq('a', Object('a'));
883
+ * // => false
884
+ *
885
+ * _.eq(NaN, NaN);
886
+ * // => true
887
+ */
888
+
889
+ var eq_1;
890
+ var hasRequiredEq;
891
+
892
+ function requireEq () {
893
+ if (hasRequiredEq) return eq_1;
894
+ hasRequiredEq = 1;
895
+ function eq(value, other) {
896
+ return value === other || (value !== value && other !== other);
897
+ }
898
+
899
+ eq_1 = eq;
900
+ return eq_1;
901
+ }
902
+
903
+ var _assocIndexOf;
904
+ var hasRequired_assocIndexOf;
905
+
906
+ function require_assocIndexOf () {
907
+ if (hasRequired_assocIndexOf) return _assocIndexOf;
908
+ hasRequired_assocIndexOf = 1;
909
+ var eq = requireEq();
910
+
911
+ /**
912
+ * Gets the index at which the `key` is found in `array` of key-value pairs.
913
+ *
914
+ * @private
915
+ * @param {Array} array The array to inspect.
916
+ * @param {*} key The key to search for.
917
+ * @returns {number} Returns the index of the matched value, else `-1`.
918
+ */
919
+ function assocIndexOf(array, key) {
920
+ var length = array.length;
921
+ while (length--) {
922
+ if (eq(array[length][0], key)) {
923
+ return length;
924
+ }
925
+ }
926
+ return -1;
927
+ }
928
+
929
+ _assocIndexOf = assocIndexOf;
930
+ return _assocIndexOf;
931
+ }
932
+
933
+ var _listCacheDelete;
934
+ var hasRequired_listCacheDelete;
935
+
936
+ function require_listCacheDelete () {
937
+ if (hasRequired_listCacheDelete) return _listCacheDelete;
938
+ hasRequired_listCacheDelete = 1;
939
+ var assocIndexOf = require_assocIndexOf();
940
+
941
+ /** Used for built-in method references. */
942
+ var arrayProto = Array.prototype;
943
+
944
+ /** Built-in value references. */
945
+ var splice = arrayProto.splice;
946
+
947
+ /**
948
+ * Removes `key` and its value from the list cache.
949
+ *
950
+ * @private
951
+ * @name delete
952
+ * @memberOf ListCache
953
+ * @param {string} key The key of the value to remove.
954
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
955
+ */
956
+ function listCacheDelete(key) {
957
+ var data = this.__data__,
958
+ index = assocIndexOf(data, key);
959
+
960
+ if (index < 0) {
961
+ return false;
962
+ }
963
+ var lastIndex = data.length - 1;
964
+ if (index == lastIndex) {
965
+ data.pop();
966
+ } else {
967
+ splice.call(data, index, 1);
968
+ }
969
+ --this.size;
970
+ return true;
971
+ }
972
+
973
+ _listCacheDelete = listCacheDelete;
974
+ return _listCacheDelete;
975
+ }
976
+
977
+ var _listCacheGet;
978
+ var hasRequired_listCacheGet;
979
+
980
+ function require_listCacheGet () {
981
+ if (hasRequired_listCacheGet) return _listCacheGet;
982
+ hasRequired_listCacheGet = 1;
983
+ var assocIndexOf = require_assocIndexOf();
984
+
985
+ /**
986
+ * Gets the list cache value for `key`.
987
+ *
988
+ * @private
989
+ * @name get
990
+ * @memberOf ListCache
991
+ * @param {string} key The key of the value to get.
992
+ * @returns {*} Returns the entry value.
993
+ */
994
+ function listCacheGet(key) {
995
+ var data = this.__data__,
996
+ index = assocIndexOf(data, key);
997
+
998
+ return index < 0 ? undefined : data[index][1];
999
+ }
1000
+
1001
+ _listCacheGet = listCacheGet;
1002
+ return _listCacheGet;
1003
+ }
1004
+
1005
+ var _listCacheHas;
1006
+ var hasRequired_listCacheHas;
1007
+
1008
+ function require_listCacheHas () {
1009
+ if (hasRequired_listCacheHas) return _listCacheHas;
1010
+ hasRequired_listCacheHas = 1;
1011
+ var assocIndexOf = require_assocIndexOf();
1012
+
1013
+ /**
1014
+ * Checks if a list cache value for `key` exists.
1015
+ *
1016
+ * @private
1017
+ * @name has
1018
+ * @memberOf ListCache
1019
+ * @param {string} key The key of the entry to check.
1020
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1021
+ */
1022
+ function listCacheHas(key) {
1023
+ return assocIndexOf(this.__data__, key) > -1;
1024
+ }
1025
+
1026
+ _listCacheHas = listCacheHas;
1027
+ return _listCacheHas;
1028
+ }
1029
+
1030
+ var _listCacheSet;
1031
+ var hasRequired_listCacheSet;
1032
+
1033
+ function require_listCacheSet () {
1034
+ if (hasRequired_listCacheSet) return _listCacheSet;
1035
+ hasRequired_listCacheSet = 1;
1036
+ var assocIndexOf = require_assocIndexOf();
1037
+
1038
+ /**
1039
+ * Sets the list cache `key` to `value`.
1040
+ *
1041
+ * @private
1042
+ * @name set
1043
+ * @memberOf ListCache
1044
+ * @param {string} key The key of the value to set.
1045
+ * @param {*} value The value to set.
1046
+ * @returns {Object} Returns the list cache instance.
1047
+ */
1048
+ function listCacheSet(key, value) {
1049
+ var data = this.__data__,
1050
+ index = assocIndexOf(data, key);
1051
+
1052
+ if (index < 0) {
1053
+ ++this.size;
1054
+ data.push([key, value]);
1055
+ } else {
1056
+ data[index][1] = value;
1057
+ }
1058
+ return this;
1059
+ }
1060
+
1061
+ _listCacheSet = listCacheSet;
1062
+ return _listCacheSet;
1063
+ }
1064
+
1065
+ var _ListCache;
1066
+ var hasRequired_ListCache;
1067
+
1068
+ function require_ListCache () {
1069
+ if (hasRequired_ListCache) return _ListCache;
1070
+ hasRequired_ListCache = 1;
1071
+ var listCacheClear = require_listCacheClear(),
1072
+ listCacheDelete = require_listCacheDelete(),
1073
+ listCacheGet = require_listCacheGet(),
1074
+ listCacheHas = require_listCacheHas(),
1075
+ listCacheSet = require_listCacheSet();
1076
+
1077
+ /**
1078
+ * Creates an list cache object.
1079
+ *
1080
+ * @private
1081
+ * @constructor
1082
+ * @param {Array} [entries] The key-value pairs to cache.
1083
+ */
1084
+ function ListCache(entries) {
1085
+ var index = -1,
1086
+ length = entries == null ? 0 : entries.length;
1087
+
1088
+ this.clear();
1089
+ while (++index < length) {
1090
+ var entry = entries[index];
1091
+ this.set(entry[0], entry[1]);
1092
+ }
1093
+ }
1094
+
1095
+ // Add methods to `ListCache`.
1096
+ ListCache.prototype.clear = listCacheClear;
1097
+ ListCache.prototype['delete'] = listCacheDelete;
1098
+ ListCache.prototype.get = listCacheGet;
1099
+ ListCache.prototype.has = listCacheHas;
1100
+ ListCache.prototype.set = listCacheSet;
1101
+
1102
+ _ListCache = ListCache;
1103
+ return _ListCache;
1104
+ }
1105
+
1106
+ var _Map;
1107
+ var hasRequired_Map;
1108
+
1109
+ function require_Map () {
1110
+ if (hasRequired_Map) return _Map;
1111
+ hasRequired_Map = 1;
1112
+ var getNative = require_getNative(),
1113
+ root = require_root();
1114
+
1115
+ /* Built-in method references that are verified to be native. */
1116
+ var Map = getNative(root, 'Map');
1117
+
1118
+ _Map = Map;
1119
+ return _Map;
1120
+ }
1121
+
1122
+ var _mapCacheClear;
1123
+ var hasRequired_mapCacheClear;
1124
+
1125
+ function require_mapCacheClear () {
1126
+ if (hasRequired_mapCacheClear) return _mapCacheClear;
1127
+ hasRequired_mapCacheClear = 1;
1128
+ var Hash = require_Hash(),
1129
+ ListCache = require_ListCache(),
1130
+ Map = require_Map();
1131
+
1132
+ /**
1133
+ * Removes all key-value entries from the map.
1134
+ *
1135
+ * @private
1136
+ * @name clear
1137
+ * @memberOf MapCache
1138
+ */
1139
+ function mapCacheClear() {
1140
+ this.size = 0;
1141
+ this.__data__ = {
1142
+ 'hash': new Hash,
1143
+ 'map': new (Map || ListCache),
1144
+ 'string': new Hash
1145
+ };
1146
+ }
1147
+
1148
+ _mapCacheClear = mapCacheClear;
1149
+ return _mapCacheClear;
1150
+ }
1151
+
1152
+ /**
1153
+ * Checks if `value` is suitable for use as unique object key.
1154
+ *
1155
+ * @private
1156
+ * @param {*} value The value to check.
1157
+ * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
1158
+ */
1159
+
1160
+ var _isKeyable;
1161
+ var hasRequired_isKeyable;
1162
+
1163
+ function require_isKeyable () {
1164
+ if (hasRequired_isKeyable) return _isKeyable;
1165
+ hasRequired_isKeyable = 1;
1166
+ function isKeyable(value) {
1167
+ var type = typeof value;
1168
+ return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
1169
+ ? (value !== '__proto__')
1170
+ : (value === null);
1171
+ }
1172
+
1173
+ _isKeyable = isKeyable;
1174
+ return _isKeyable;
1175
+ }
1176
+
1177
+ var _getMapData;
1178
+ var hasRequired_getMapData;
1179
+
1180
+ function require_getMapData () {
1181
+ if (hasRequired_getMapData) return _getMapData;
1182
+ hasRequired_getMapData = 1;
1183
+ var isKeyable = require_isKeyable();
1184
+
1185
+ /**
1186
+ * Gets the data for `map`.
1187
+ *
1188
+ * @private
1189
+ * @param {Object} map The map to query.
1190
+ * @param {string} key The reference key.
1191
+ * @returns {*} Returns the map data.
1192
+ */
1193
+ function getMapData(map, key) {
1194
+ var data = map.__data__;
1195
+ return isKeyable(key)
1196
+ ? data[typeof key == 'string' ? 'string' : 'hash']
1197
+ : data.map;
1198
+ }
1199
+
1200
+ _getMapData = getMapData;
1201
+ return _getMapData;
1202
+ }
1203
+
1204
+ var _mapCacheDelete;
1205
+ var hasRequired_mapCacheDelete;
1206
+
1207
+ function require_mapCacheDelete () {
1208
+ if (hasRequired_mapCacheDelete) return _mapCacheDelete;
1209
+ hasRequired_mapCacheDelete = 1;
1210
+ var getMapData = require_getMapData();
1211
+
1212
+ /**
1213
+ * Removes `key` and its value from the map.
1214
+ *
1215
+ * @private
1216
+ * @name delete
1217
+ * @memberOf MapCache
1218
+ * @param {string} key The key of the value to remove.
1219
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1220
+ */
1221
+ function mapCacheDelete(key) {
1222
+ var result = getMapData(this, key)['delete'](key);
1223
+ this.size -= result ? 1 : 0;
1224
+ return result;
1225
+ }
1226
+
1227
+ _mapCacheDelete = mapCacheDelete;
1228
+ return _mapCacheDelete;
1229
+ }
1230
+
1231
+ var _mapCacheGet;
1232
+ var hasRequired_mapCacheGet;
1233
+
1234
+ function require_mapCacheGet () {
1235
+ if (hasRequired_mapCacheGet) return _mapCacheGet;
1236
+ hasRequired_mapCacheGet = 1;
1237
+ var getMapData = require_getMapData();
1238
+
1239
+ /**
1240
+ * Gets the map value for `key`.
1241
+ *
1242
+ * @private
1243
+ * @name get
1244
+ * @memberOf MapCache
1245
+ * @param {string} key The key of the value to get.
1246
+ * @returns {*} Returns the entry value.
1247
+ */
1248
+ function mapCacheGet(key) {
1249
+ return getMapData(this, key).get(key);
1250
+ }
1251
+
1252
+ _mapCacheGet = mapCacheGet;
1253
+ return _mapCacheGet;
1254
+ }
1255
+
1256
+ var _mapCacheHas;
1257
+ var hasRequired_mapCacheHas;
1258
+
1259
+ function require_mapCacheHas () {
1260
+ if (hasRequired_mapCacheHas) return _mapCacheHas;
1261
+ hasRequired_mapCacheHas = 1;
1262
+ var getMapData = require_getMapData();
1263
+
1264
+ /**
1265
+ * Checks if a map value for `key` exists.
1266
+ *
1267
+ * @private
1268
+ * @name has
1269
+ * @memberOf MapCache
1270
+ * @param {string} key The key of the entry to check.
1271
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1272
+ */
1273
+ function mapCacheHas(key) {
1274
+ return getMapData(this, key).has(key);
1275
+ }
1276
+
1277
+ _mapCacheHas = mapCacheHas;
1278
+ return _mapCacheHas;
1279
+ }
1280
+
1281
+ var _mapCacheSet;
1282
+ var hasRequired_mapCacheSet;
1283
+
1284
+ function require_mapCacheSet () {
1285
+ if (hasRequired_mapCacheSet) return _mapCacheSet;
1286
+ hasRequired_mapCacheSet = 1;
1287
+ var getMapData = require_getMapData();
1288
+
1289
+ /**
1290
+ * Sets the map `key` to `value`.
1291
+ *
1292
+ * @private
1293
+ * @name set
1294
+ * @memberOf MapCache
1295
+ * @param {string} key The key of the value to set.
1296
+ * @param {*} value The value to set.
1297
+ * @returns {Object} Returns the map cache instance.
1298
+ */
1299
+ function mapCacheSet(key, value) {
1300
+ var data = getMapData(this, key),
1301
+ size = data.size;
1302
+
1303
+ data.set(key, value);
1304
+ this.size += data.size == size ? 0 : 1;
1305
+ return this;
1306
+ }
1307
+
1308
+ _mapCacheSet = mapCacheSet;
1309
+ return _mapCacheSet;
1310
+ }
1311
+
1312
+ var _MapCache;
1313
+ var hasRequired_MapCache;
1314
+
1315
+ function require_MapCache () {
1316
+ if (hasRequired_MapCache) return _MapCache;
1317
+ hasRequired_MapCache = 1;
1318
+ var mapCacheClear = require_mapCacheClear(),
1319
+ mapCacheDelete = require_mapCacheDelete(),
1320
+ mapCacheGet = require_mapCacheGet(),
1321
+ mapCacheHas = require_mapCacheHas(),
1322
+ mapCacheSet = require_mapCacheSet();
1323
+
1324
+ /**
1325
+ * Creates a map cache object to store key-value pairs.
1326
+ *
1327
+ * @private
1328
+ * @constructor
1329
+ * @param {Array} [entries] The key-value pairs to cache.
1330
+ */
1331
+ function MapCache(entries) {
1332
+ var index = -1,
1333
+ length = entries == null ? 0 : entries.length;
1334
+
1335
+ this.clear();
1336
+ while (++index < length) {
1337
+ var entry = entries[index];
1338
+ this.set(entry[0], entry[1]);
1339
+ }
1340
+ }
1341
+
1342
+ // Add methods to `MapCache`.
1343
+ MapCache.prototype.clear = mapCacheClear;
1344
+ MapCache.prototype['delete'] = mapCacheDelete;
1345
+ MapCache.prototype.get = mapCacheGet;
1346
+ MapCache.prototype.has = mapCacheHas;
1347
+ MapCache.prototype.set = mapCacheSet;
1348
+
1349
+ _MapCache = MapCache;
1350
+ return _MapCache;
1351
+ }
1352
+
1353
+ var memoize_1;
1354
+ var hasRequiredMemoize;
1355
+
1356
+ function requireMemoize () {
1357
+ if (hasRequiredMemoize) return memoize_1;
1358
+ hasRequiredMemoize = 1;
1359
+ var MapCache = require_MapCache();
1360
+
1361
+ /** Error message constants. */
1362
+ var FUNC_ERROR_TEXT = 'Expected a function';
1363
+
1364
+ /**
1365
+ * Creates a function that memoizes the result of `func`. If `resolver` is
1366
+ * provided, it determines the cache key for storing the result based on the
1367
+ * arguments provided to the memoized function. By default, the first argument
1368
+ * provided to the memoized function is used as the map cache key. The `func`
1369
+ * is invoked with the `this` binding of the memoized function.
1370
+ *
1371
+ * **Note:** The cache is exposed as the `cache` property on the memoized
1372
+ * function. Its creation may be customized by replacing the `_.memoize.Cache`
1373
+ * constructor with one whose instances implement the
1374
+ * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
1375
+ * method interface of `clear`, `delete`, `get`, `has`, and `set`.
1376
+ *
1377
+ * @static
1378
+ * @memberOf _
1379
+ * @since 0.1.0
1380
+ * @category Function
1381
+ * @param {Function} func The function to have its output memoized.
1382
+ * @param {Function} [resolver] The function to resolve the cache key.
1383
+ * @returns {Function} Returns the new memoized function.
1384
+ * @example
1385
+ *
1386
+ * var object = { 'a': 1, 'b': 2 };
1387
+ * var other = { 'c': 3, 'd': 4 };
1388
+ *
1389
+ * var values = _.memoize(_.values);
1390
+ * values(object);
1391
+ * // => [1, 2]
1392
+ *
1393
+ * values(other);
1394
+ * // => [3, 4]
1395
+ *
1396
+ * object.a = 2;
1397
+ * values(object);
1398
+ * // => [1, 2]
1399
+ *
1400
+ * // Modify the result cache.
1401
+ * values.cache.set(object, ['a', 'b']);
1402
+ * values(object);
1403
+ * // => ['a', 'b']
1404
+ *
1405
+ * // Replace `_.memoize.Cache`.
1406
+ * _.memoize.Cache = WeakMap;
1407
+ */
1408
+ function memoize(func, resolver) {
1409
+ if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
1410
+ throw new TypeError(FUNC_ERROR_TEXT);
1411
+ }
1412
+ var memoized = function() {
1413
+ var args = arguments,
1414
+ key = resolver ? resolver.apply(this, args) : args[0],
1415
+ cache = memoized.cache;
1416
+
1417
+ if (cache.has(key)) {
1418
+ return cache.get(key);
1419
+ }
1420
+ var result = func.apply(this, args);
1421
+ memoized.cache = cache.set(key, result) || cache;
1422
+ return result;
1423
+ };
1424
+ memoized.cache = new (memoize.Cache || MapCache);
1425
+ return memoized;
1426
+ }
1427
+
1428
+ // Expose `MapCache`.
1429
+ memoize.Cache = MapCache;
1430
+
1431
+ memoize_1 = memoize;
1432
+ return memoize_1;
1433
+ }
1434
+
1435
+ var _memoizeCapped;
1436
+ var hasRequired_memoizeCapped;
1437
+
1438
+ function require_memoizeCapped () {
1439
+ if (hasRequired_memoizeCapped) return _memoizeCapped;
1440
+ hasRequired_memoizeCapped = 1;
1441
+ var memoize = requireMemoize();
1442
+
1443
+ /** Used as the maximum memoize cache size. */
1444
+ var MAX_MEMOIZE_SIZE = 500;
1445
+
1446
+ /**
1447
+ * A specialized version of `_.memoize` which clears the memoized function's
1448
+ * cache when it exceeds `MAX_MEMOIZE_SIZE`.
1449
+ *
1450
+ * @private
1451
+ * @param {Function} func The function to have its output memoized.
1452
+ * @returns {Function} Returns the new memoized function.
1453
+ */
1454
+ function memoizeCapped(func) {
1455
+ var result = memoize(func, function(key) {
1456
+ if (cache.size === MAX_MEMOIZE_SIZE) {
1457
+ cache.clear();
1458
+ }
1459
+ return key;
1460
+ });
1461
+
1462
+ var cache = result.cache;
1463
+ return result;
1464
+ }
1465
+
1466
+ _memoizeCapped = memoizeCapped;
1467
+ return _memoizeCapped;
1468
+ }
1469
+
1470
+ var _stringToPath;
1471
+ var hasRequired_stringToPath;
1472
+
1473
+ function require_stringToPath () {
1474
+ if (hasRequired_stringToPath) return _stringToPath;
1475
+ hasRequired_stringToPath = 1;
1476
+ var memoizeCapped = require_memoizeCapped();
1477
+
1478
+ /** Used to match property names within property paths. */
1479
+ var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
1480
+
1481
+ /** Used to match backslashes in property paths. */
1482
+ var reEscapeChar = /\\(\\)?/g;
1483
+
1484
+ /**
1485
+ * Converts `string` to a property path array.
1486
+ *
1487
+ * @private
1488
+ * @param {string} string The string to convert.
1489
+ * @returns {Array} Returns the property path array.
1490
+ */
1491
+ var stringToPath = memoizeCapped(function(string) {
1492
+ var result = [];
1493
+ if (string.charCodeAt(0) === 46 /* . */) {
1494
+ result.push('');
1495
+ }
1496
+ string.replace(rePropName, function(match, number, quote, subString) {
1497
+ result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
1498
+ });
1499
+ return result;
1500
+ });
1501
+
1502
+ _stringToPath = stringToPath;
1503
+ return _stringToPath;
1504
+ }
1505
+
1506
+ /**
1507
+ * A specialized version of `_.map` for arrays without support for iteratee
1508
+ * shorthands.
1509
+ *
1510
+ * @private
1511
+ * @param {Array} [array] The array to iterate over.
1512
+ * @param {Function} iteratee The function invoked per iteration.
1513
+ * @returns {Array} Returns the new mapped array.
1514
+ */
1515
+
1516
+ var _arrayMap;
1517
+ var hasRequired_arrayMap;
1518
+
1519
+ function require_arrayMap () {
1520
+ if (hasRequired_arrayMap) return _arrayMap;
1521
+ hasRequired_arrayMap = 1;
1522
+ function arrayMap(array, iteratee) {
1523
+ var index = -1,
1524
+ length = array == null ? 0 : array.length,
1525
+ result = Array(length);
1526
+
1527
+ while (++index < length) {
1528
+ result[index] = iteratee(array[index], index, array);
1529
+ }
1530
+ return result;
1531
+ }
1532
+
1533
+ _arrayMap = arrayMap;
1534
+ return _arrayMap;
1535
+ }
1536
+
1537
+ var _baseToString;
1538
+ var hasRequired_baseToString;
1539
+
1540
+ function require_baseToString () {
1541
+ if (hasRequired_baseToString) return _baseToString;
1542
+ hasRequired_baseToString = 1;
1543
+ var Symbol = require_Symbol(),
1544
+ arrayMap = require_arrayMap(),
1545
+ isArray = requireIsArray(),
1546
+ isSymbol = requireIsSymbol();
1547
+
1548
+ /** Used to convert symbols to primitives and strings. */
1549
+ var symbolProto = Symbol ? Symbol.prototype : undefined,
1550
+ symbolToString = symbolProto ? symbolProto.toString : undefined;
1551
+
1552
+ /**
1553
+ * The base implementation of `_.toString` which doesn't convert nullish
1554
+ * values to empty strings.
1555
+ *
1556
+ * @private
1557
+ * @param {*} value The value to process.
1558
+ * @returns {string} Returns the string.
1559
+ */
1560
+ function baseToString(value) {
1561
+ // Exit early for strings to avoid a performance hit in some environments.
1562
+ if (typeof value == 'string') {
1563
+ return value;
1564
+ }
1565
+ if (isArray(value)) {
1566
+ // Recursively convert values (susceptible to call stack limits).
1567
+ return arrayMap(value, baseToString) + '';
1568
+ }
1569
+ if (isSymbol(value)) {
1570
+ return symbolToString ? symbolToString.call(value) : '';
1571
+ }
1572
+ var result = (value + '');
1573
+ return (result == '0' && (1 / value) == -Infinity) ? '-0' : result;
1574
+ }
1575
+
1576
+ _baseToString = baseToString;
1577
+ return _baseToString;
1578
+ }
1579
+
1580
+ var toString_1;
1581
+ var hasRequiredToString;
1582
+
1583
+ function requireToString () {
1584
+ if (hasRequiredToString) return toString_1;
1585
+ hasRequiredToString = 1;
1586
+ var baseToString = require_baseToString();
1587
+
1588
+ /**
1589
+ * Converts `value` to a string. An empty string is returned for `null`
1590
+ * and `undefined` values. The sign of `-0` is preserved.
1591
+ *
1592
+ * @static
1593
+ * @memberOf _
1594
+ * @since 4.0.0
1595
+ * @category Lang
1596
+ * @param {*} value The value to convert.
1597
+ * @returns {string} Returns the converted string.
1598
+ * @example
1599
+ *
1600
+ * _.toString(null);
1601
+ * // => ''
1602
+ *
1603
+ * _.toString(-0);
1604
+ * // => '-0'
1605
+ *
1606
+ * _.toString([1, 2, 3]);
1607
+ * // => '1,2,3'
1608
+ */
1609
+ function toString(value) {
1610
+ return value == null ? '' : baseToString(value);
1611
+ }
1612
+
1613
+ toString_1 = toString;
1614
+ return toString_1;
1615
+ }
1616
+
1617
+ var _castPath;
1618
+ var hasRequired_castPath;
1619
+
1620
+ function require_castPath () {
1621
+ if (hasRequired_castPath) return _castPath;
1622
+ hasRequired_castPath = 1;
1623
+ var isArray = requireIsArray(),
1624
+ isKey = require_isKey(),
1625
+ stringToPath = require_stringToPath(),
1626
+ toString = requireToString();
1627
+
1628
+ /**
1629
+ * Casts `value` to a path array if it's not one.
1630
+ *
1631
+ * @private
1632
+ * @param {*} value The value to inspect.
1633
+ * @param {Object} [object] The object to query keys on.
1634
+ * @returns {Array} Returns the cast property path array.
1635
+ */
1636
+ function castPath(value, object) {
1637
+ if (isArray(value)) {
1638
+ return value;
1639
+ }
1640
+ return isKey(value, object) ? [value] : stringToPath(toString(value));
1641
+ }
1642
+
1643
+ _castPath = castPath;
1644
+ return _castPath;
1645
+ }
1646
+
1647
+ var _toKey;
1648
+ var hasRequired_toKey;
1649
+
1650
+ function require_toKey () {
1651
+ if (hasRequired_toKey) return _toKey;
1652
+ hasRequired_toKey = 1;
1653
+ var isSymbol = requireIsSymbol();
1654
+
1655
+ /**
1656
+ * Converts `value` to a string key if it's not a string or symbol.
1657
+ *
1658
+ * @private
1659
+ * @param {*} value The value to inspect.
1660
+ * @returns {string|symbol} Returns the key.
1661
+ */
1662
+ function toKey(value) {
1663
+ if (typeof value == 'string' || isSymbol(value)) {
1664
+ return value;
1665
+ }
1666
+ var result = (value + '');
1667
+ return (result == '0' && (1 / value) == -Infinity) ? '-0' : result;
1668
+ }
1669
+
1670
+ _toKey = toKey;
1671
+ return _toKey;
1672
+ }
1673
+
1674
+ var _baseGet;
1675
+ var hasRequired_baseGet;
1676
+
1677
+ function require_baseGet () {
1678
+ if (hasRequired_baseGet) return _baseGet;
1679
+ hasRequired_baseGet = 1;
1680
+ var castPath = require_castPath(),
1681
+ toKey = require_toKey();
1682
+
1683
+ /**
1684
+ * The base implementation of `_.get` without support for default values.
1685
+ *
1686
+ * @private
1687
+ * @param {Object} object The object to query.
1688
+ * @param {Array|string} path The path of the property to get.
1689
+ * @returns {*} Returns the resolved value.
1690
+ */
1691
+ function baseGet(object, path) {
1692
+ path = castPath(path, object);
1693
+
1694
+ var index = 0,
1695
+ length = path.length;
1696
+
1697
+ while (object != null && index < length) {
1698
+ object = object[toKey(path[index++])];
1699
+ }
1700
+ return (index && index == length) ? object : undefined;
1701
+ }
1702
+
1703
+ _baseGet = baseGet;
1704
+ return _baseGet;
1705
+ }
1706
+
1707
+ var get_1;
1708
+ var hasRequiredGet;
1709
+
1710
+ function requireGet () {
1711
+ if (hasRequiredGet) return get_1;
1712
+ hasRequiredGet = 1;
1713
+ var baseGet = require_baseGet();
1714
+
1715
+ /**
1716
+ * Gets the value at `path` of `object`. If the resolved value is
1717
+ * `undefined`, the `defaultValue` is returned in its place.
1718
+ *
1719
+ * @static
1720
+ * @memberOf _
1721
+ * @since 3.7.0
1722
+ * @category Object
1723
+ * @param {Object} object The object to query.
1724
+ * @param {Array|string} path The path of the property to get.
1725
+ * @param {*} [defaultValue] The value returned for `undefined` resolved values.
1726
+ * @returns {*} Returns the resolved value.
1727
+ * @example
1728
+ *
1729
+ * var object = { 'a': [{ 'b': { 'c': 3 } }] };
1730
+ *
1731
+ * _.get(object, 'a[0].b.c');
1732
+ * // => 3
1733
+ *
1734
+ * _.get(object, ['a', '0', 'b', 'c']);
1735
+ * // => 3
1736
+ *
1737
+ * _.get(object, 'a.b.c', 'default');
1738
+ * // => 'default'
1739
+ */
1740
+ function get(object, path, defaultValue) {
1741
+ var result = object == null ? undefined : baseGet(object, path);
1742
+ return result === undefined ? defaultValue : result;
1743
+ }
1744
+
1745
+ get_1 = get;
1746
+ return get_1;
1747
+ }
1748
+
1749
+ var getExports = requireGet();
1750
+ var get = /*@__PURE__*/getDefaultExportFromCjs(getExports);
1751
+
1752
+ /**
1753
+ * Copies the values of `source` to `array`.
1754
+ *
1755
+ * @private
1756
+ * @param {Array} source The array to copy values from.
1757
+ * @param {Array} [array=[]] The array to copy values to.
1758
+ * @returns {Array} Returns `array`.
1759
+ */
1760
+
1761
+ var _copyArray;
1762
+ var hasRequired_copyArray;
1763
+
1764
+ function require_copyArray () {
1765
+ if (hasRequired_copyArray) return _copyArray;
1766
+ hasRequired_copyArray = 1;
1767
+ function copyArray(source, array) {
1768
+ var index = -1,
1769
+ length = source.length;
1770
+
1771
+ array || (array = Array(length));
1772
+ while (++index < length) {
1773
+ array[index] = source[index];
1774
+ }
1775
+ return array;
1776
+ }
1777
+
1778
+ _copyArray = copyArray;
1779
+ return _copyArray;
1780
+ }
1781
+
1782
+ /* Built-in method references for those with the same name as other `lodash` methods. */
1783
+
1784
+ var _baseRandom;
1785
+ var hasRequired_baseRandom;
1786
+
1787
+ function require_baseRandom () {
1788
+ if (hasRequired_baseRandom) return _baseRandom;
1789
+ hasRequired_baseRandom = 1;
1790
+ var nativeFloor = Math.floor,
1791
+ nativeRandom = Math.random;
1792
+
1793
+ /**
1794
+ * The base implementation of `_.random` without support for returning
1795
+ * floating-point numbers.
1796
+ *
1797
+ * @private
1798
+ * @param {number} lower The lower bound.
1799
+ * @param {number} upper The upper bound.
1800
+ * @returns {number} Returns the random number.
1801
+ */
1802
+ function baseRandom(lower, upper) {
1803
+ return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
1804
+ }
1805
+
1806
+ _baseRandom = baseRandom;
1807
+ return _baseRandom;
1808
+ }
1809
+
1810
+ var _shuffleSelf;
1811
+ var hasRequired_shuffleSelf;
1812
+
1813
+ function require_shuffleSelf () {
1814
+ if (hasRequired_shuffleSelf) return _shuffleSelf;
1815
+ hasRequired_shuffleSelf = 1;
1816
+ var baseRandom = require_baseRandom();
1817
+
1818
+ /**
1819
+ * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
1820
+ *
1821
+ * @private
1822
+ * @param {Array} array The array to shuffle.
1823
+ * @param {number} [size=array.length] The size of `array`.
1824
+ * @returns {Array} Returns `array`.
1825
+ */
1826
+ function shuffleSelf(array, size) {
1827
+ var index = -1,
1828
+ length = array.length,
1829
+ lastIndex = length - 1;
1830
+
1831
+ size = size === undefined ? length : size;
1832
+ while (++index < size) {
1833
+ var rand = baseRandom(index, lastIndex),
1834
+ value = array[rand];
1835
+
1836
+ array[rand] = array[index];
1837
+ array[index] = value;
1838
+ }
1839
+ array.length = size;
1840
+ return array;
1841
+ }
1842
+
1843
+ _shuffleSelf = shuffleSelf;
1844
+ return _shuffleSelf;
1845
+ }
1846
+
1847
+ var _arrayShuffle;
1848
+ var hasRequired_arrayShuffle;
1849
+
1850
+ function require_arrayShuffle () {
1851
+ if (hasRequired_arrayShuffle) return _arrayShuffle;
1852
+ hasRequired_arrayShuffle = 1;
1853
+ var copyArray = require_copyArray(),
1854
+ shuffleSelf = require_shuffleSelf();
1855
+
1856
+ /**
1857
+ * A specialized version of `_.shuffle` for arrays.
1858
+ *
1859
+ * @private
1860
+ * @param {Array} array The array to shuffle.
1861
+ * @returns {Array} Returns the new shuffled array.
1862
+ */
1863
+ function arrayShuffle(array) {
1864
+ return shuffleSelf(copyArray(array));
1865
+ }
1866
+
1867
+ _arrayShuffle = arrayShuffle;
1868
+ return _arrayShuffle;
1869
+ }
1870
+
1871
+ var _baseValues;
1872
+ var hasRequired_baseValues;
1873
+
1874
+ function require_baseValues () {
1875
+ if (hasRequired_baseValues) return _baseValues;
1876
+ hasRequired_baseValues = 1;
1877
+ var arrayMap = require_arrayMap();
1878
+
1879
+ /**
1880
+ * The base implementation of `_.values` and `_.valuesIn` which creates an
1881
+ * array of `object` property values corresponding to the property names
1882
+ * of `props`.
1883
+ *
1884
+ * @private
1885
+ * @param {Object} object The object to query.
1886
+ * @param {Array} props The property names to get values for.
1887
+ * @returns {Object} Returns the array of property values.
1888
+ */
1889
+ function baseValues(object, props) {
1890
+ return arrayMap(props, function(key) {
1891
+ return object[key];
1892
+ });
1893
+ }
1894
+
1895
+ _baseValues = baseValues;
1896
+ return _baseValues;
1897
+ }
1898
+
1899
+ /**
1900
+ * The base implementation of `_.times` without support for iteratee shorthands
1901
+ * or max array length checks.
1902
+ *
1903
+ * @private
1904
+ * @param {number} n The number of times to invoke `iteratee`.
1905
+ * @param {Function} iteratee The function invoked per iteration.
1906
+ * @returns {Array} Returns the array of results.
1907
+ */
1908
+
1909
+ var _baseTimes;
1910
+ var hasRequired_baseTimes;
1911
+
1912
+ function require_baseTimes () {
1913
+ if (hasRequired_baseTimes) return _baseTimes;
1914
+ hasRequired_baseTimes = 1;
1915
+ function baseTimes(n, iteratee) {
1916
+ var index = -1,
1917
+ result = Array(n);
1918
+
1919
+ while (++index < n) {
1920
+ result[index] = iteratee(index);
1921
+ }
1922
+ return result;
1923
+ }
1924
+
1925
+ _baseTimes = baseTimes;
1926
+ return _baseTimes;
1927
+ }
1928
+
1929
+ var _baseIsArguments;
1930
+ var hasRequired_baseIsArguments;
1931
+
1932
+ function require_baseIsArguments () {
1933
+ if (hasRequired_baseIsArguments) return _baseIsArguments;
1934
+ hasRequired_baseIsArguments = 1;
1935
+ var baseGetTag = require_baseGetTag(),
1936
+ isObjectLike = requireIsObjectLike();
1937
+
1938
+ /** `Object#toString` result references. */
1939
+ var argsTag = '[object Arguments]';
1940
+
1941
+ /**
1942
+ * The base implementation of `_.isArguments`.
1943
+ *
1944
+ * @private
1945
+ * @param {*} value The value to check.
1946
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
1947
+ */
1948
+ function baseIsArguments(value) {
1949
+ return isObjectLike(value) && baseGetTag(value) == argsTag;
1950
+ }
1951
+
1952
+ _baseIsArguments = baseIsArguments;
1953
+ return _baseIsArguments;
1954
+ }
1955
+
1956
+ var isArguments_1;
1957
+ var hasRequiredIsArguments;
1958
+
1959
+ function requireIsArguments () {
1960
+ if (hasRequiredIsArguments) return isArguments_1;
1961
+ hasRequiredIsArguments = 1;
1962
+ var baseIsArguments = require_baseIsArguments(),
1963
+ isObjectLike = requireIsObjectLike();
1964
+
1965
+ /** Used for built-in method references. */
1966
+ var objectProto = Object.prototype;
1967
+
1968
+ /** Used to check objects for own properties. */
1969
+ var hasOwnProperty = objectProto.hasOwnProperty;
1970
+
1971
+ /** Built-in value references. */
1972
+ var propertyIsEnumerable = objectProto.propertyIsEnumerable;
1973
+
1974
+ /**
1975
+ * Checks if `value` is likely an `arguments` object.
1976
+ *
1977
+ * @static
1978
+ * @memberOf _
1979
+ * @since 0.1.0
1980
+ * @category Lang
1981
+ * @param {*} value The value to check.
1982
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
1983
+ * else `false`.
1984
+ * @example
1985
+ *
1986
+ * _.isArguments(function() { return arguments; }());
1987
+ * // => true
1988
+ *
1989
+ * _.isArguments([1, 2, 3]);
1990
+ * // => false
1991
+ */
1992
+ var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
1993
+ return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
1994
+ !propertyIsEnumerable.call(value, 'callee');
1995
+ };
1996
+
1997
+ isArguments_1 = isArguments;
1998
+ return isArguments_1;
1999
+ }
2000
+
2001
+ var isBuffer = {exports: {}};
2002
+
2003
+ /**
2004
+ * This method returns `false`.
2005
+ *
2006
+ * @static
2007
+ * @memberOf _
2008
+ * @since 4.13.0
2009
+ * @category Util
2010
+ * @returns {boolean} Returns `false`.
2011
+ * @example
2012
+ *
2013
+ * _.times(2, _.stubFalse);
2014
+ * // => [false, false]
2015
+ */
2016
+
2017
+ var stubFalse_1;
2018
+ var hasRequiredStubFalse;
2019
+
2020
+ function requireStubFalse () {
2021
+ if (hasRequiredStubFalse) return stubFalse_1;
2022
+ hasRequiredStubFalse = 1;
2023
+ function stubFalse() {
2024
+ return false;
2025
+ }
2026
+
2027
+ stubFalse_1 = stubFalse;
2028
+ return stubFalse_1;
2029
+ }
2030
+
2031
+ isBuffer.exports;
2032
+
2033
+ var hasRequiredIsBuffer;
2034
+
2035
+ function requireIsBuffer () {
2036
+ if (hasRequiredIsBuffer) return isBuffer.exports;
2037
+ hasRequiredIsBuffer = 1;
2038
+ (function (module, exports$1) {
2039
+ var root = require_root(),
2040
+ stubFalse = requireStubFalse();
2041
+
2042
+ /** Detect free variable `exports`. */
2043
+ var freeExports = exports$1 && !exports$1.nodeType && exports$1;
2044
+
2045
+ /** Detect free variable `module`. */
2046
+ var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
2047
+
2048
+ /** Detect the popular CommonJS extension `module.exports`. */
2049
+ var moduleExports = freeModule && freeModule.exports === freeExports;
2050
+
2051
+ /** Built-in value references. */
2052
+ var Buffer = moduleExports ? root.Buffer : undefined;
2053
+
2054
+ /* Built-in method references for those with the same name as other `lodash` methods. */
2055
+ var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
2056
+
2057
+ /**
2058
+ * Checks if `value` is a buffer.
2059
+ *
2060
+ * @static
2061
+ * @memberOf _
2062
+ * @since 4.3.0
2063
+ * @category Lang
2064
+ * @param {*} value The value to check.
2065
+ * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
2066
+ * @example
2067
+ *
2068
+ * _.isBuffer(new Buffer(2));
2069
+ * // => true
2070
+ *
2071
+ * _.isBuffer(new Uint8Array(2));
2072
+ * // => false
2073
+ */
2074
+ var isBuffer = nativeIsBuffer || stubFalse;
2075
+
2076
+ module.exports = isBuffer;
2077
+ } (isBuffer, isBuffer.exports));
2078
+ return isBuffer.exports;
2079
+ }
2080
+
2081
+ /** Used as references for various `Number` constants. */
2082
+
2083
+ var _isIndex;
2084
+ var hasRequired_isIndex;
2085
+
2086
+ function require_isIndex () {
2087
+ if (hasRequired_isIndex) return _isIndex;
2088
+ hasRequired_isIndex = 1;
2089
+ var MAX_SAFE_INTEGER = 9007199254740991;
2090
+
2091
+ /** Used to detect unsigned integer values. */
2092
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
2093
+
2094
+ /**
2095
+ * Checks if `value` is a valid array-like index.
2096
+ *
2097
+ * @private
2098
+ * @param {*} value The value to check.
2099
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
2100
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
2101
+ */
2102
+ function isIndex(value, length) {
2103
+ var type = typeof value;
2104
+ length = length == null ? MAX_SAFE_INTEGER : length;
2105
+
2106
+ return !!length &&
2107
+ (type == 'number' ||
2108
+ (type != 'symbol' && reIsUint.test(value))) &&
2109
+ (value > -1 && value % 1 == 0 && value < length);
2110
+ }
2111
+
2112
+ _isIndex = isIndex;
2113
+ return _isIndex;
2114
+ }
2115
+
2116
+ /** Used as references for various `Number` constants. */
2117
+
2118
+ var isLength_1;
2119
+ var hasRequiredIsLength;
2120
+
2121
+ function requireIsLength () {
2122
+ if (hasRequiredIsLength) return isLength_1;
2123
+ hasRequiredIsLength = 1;
2124
+ var MAX_SAFE_INTEGER = 9007199254740991;
2125
+
2126
+ /**
2127
+ * Checks if `value` is a valid array-like length.
2128
+ *
2129
+ * **Note:** This method is loosely based on
2130
+ * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
2131
+ *
2132
+ * @static
2133
+ * @memberOf _
2134
+ * @since 4.0.0
2135
+ * @category Lang
2136
+ * @param {*} value The value to check.
2137
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
2138
+ * @example
2139
+ *
2140
+ * _.isLength(3);
2141
+ * // => true
2142
+ *
2143
+ * _.isLength(Number.MIN_VALUE);
2144
+ * // => false
2145
+ *
2146
+ * _.isLength(Infinity);
2147
+ * // => false
2148
+ *
2149
+ * _.isLength('3');
2150
+ * // => false
2151
+ */
2152
+ function isLength(value) {
2153
+ return typeof value == 'number' &&
2154
+ value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
2155
+ }
2156
+
2157
+ isLength_1 = isLength;
2158
+ return isLength_1;
2159
+ }
2160
+
2161
+ var _baseIsTypedArray;
2162
+ var hasRequired_baseIsTypedArray;
2163
+
2164
+ function require_baseIsTypedArray () {
2165
+ if (hasRequired_baseIsTypedArray) return _baseIsTypedArray;
2166
+ hasRequired_baseIsTypedArray = 1;
2167
+ var baseGetTag = require_baseGetTag(),
2168
+ isLength = requireIsLength(),
2169
+ isObjectLike = requireIsObjectLike();
2170
+
2171
+ /** `Object#toString` result references. */
2172
+ var argsTag = '[object Arguments]',
2173
+ arrayTag = '[object Array]',
2174
+ boolTag = '[object Boolean]',
2175
+ dateTag = '[object Date]',
2176
+ errorTag = '[object Error]',
2177
+ funcTag = '[object Function]',
2178
+ mapTag = '[object Map]',
2179
+ numberTag = '[object Number]',
2180
+ objectTag = '[object Object]',
2181
+ regexpTag = '[object RegExp]',
2182
+ setTag = '[object Set]',
2183
+ stringTag = '[object String]',
2184
+ weakMapTag = '[object WeakMap]';
2185
+
2186
+ var arrayBufferTag = '[object ArrayBuffer]',
2187
+ dataViewTag = '[object DataView]',
2188
+ float32Tag = '[object Float32Array]',
2189
+ float64Tag = '[object Float64Array]',
2190
+ int8Tag = '[object Int8Array]',
2191
+ int16Tag = '[object Int16Array]',
2192
+ int32Tag = '[object Int32Array]',
2193
+ uint8Tag = '[object Uint8Array]',
2194
+ uint8ClampedTag = '[object Uint8ClampedArray]',
2195
+ uint16Tag = '[object Uint16Array]',
2196
+ uint32Tag = '[object Uint32Array]';
2197
+
2198
+ /** Used to identify `toStringTag` values of typed arrays. */
2199
+ var typedArrayTags = {};
2200
+ typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
2201
+ typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
2202
+ typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
2203
+ typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
2204
+ typedArrayTags[uint32Tag] = true;
2205
+ typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
2206
+ typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
2207
+ typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
2208
+ typedArrayTags[errorTag] = typedArrayTags[funcTag] =
2209
+ typedArrayTags[mapTag] = typedArrayTags[numberTag] =
2210
+ typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
2211
+ typedArrayTags[setTag] = typedArrayTags[stringTag] =
2212
+ typedArrayTags[weakMapTag] = false;
2213
+
2214
+ /**
2215
+ * The base implementation of `_.isTypedArray` without Node.js optimizations.
2216
+ *
2217
+ * @private
2218
+ * @param {*} value The value to check.
2219
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
2220
+ */
2221
+ function baseIsTypedArray(value) {
2222
+ return isObjectLike(value) &&
2223
+ isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
2224
+ }
2225
+
2226
+ _baseIsTypedArray = baseIsTypedArray;
2227
+ return _baseIsTypedArray;
2228
+ }
2229
+
2230
+ /**
2231
+ * The base implementation of `_.unary` without support for storing metadata.
2232
+ *
2233
+ * @private
2234
+ * @param {Function} func The function to cap arguments for.
2235
+ * @returns {Function} Returns the new capped function.
2236
+ */
2237
+
2238
+ var _baseUnary;
2239
+ var hasRequired_baseUnary;
2240
+
2241
+ function require_baseUnary () {
2242
+ if (hasRequired_baseUnary) return _baseUnary;
2243
+ hasRequired_baseUnary = 1;
2244
+ function baseUnary(func) {
2245
+ return function(value) {
2246
+ return func(value);
2247
+ };
2248
+ }
2249
+
2250
+ _baseUnary = baseUnary;
2251
+ return _baseUnary;
2252
+ }
2253
+
2254
+ var _nodeUtil = {exports: {}};
2255
+
2256
+ _nodeUtil.exports;
2257
+
2258
+ var hasRequired_nodeUtil;
2259
+
2260
+ function require_nodeUtil () {
2261
+ if (hasRequired_nodeUtil) return _nodeUtil.exports;
2262
+ hasRequired_nodeUtil = 1;
2263
+ (function (module, exports$1) {
2264
+ var freeGlobal = require_freeGlobal();
2265
+
2266
+ /** Detect free variable `exports`. */
2267
+ var freeExports = exports$1 && !exports$1.nodeType && exports$1;
2268
+
2269
+ /** Detect free variable `module`. */
2270
+ var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
2271
+
2272
+ /** Detect the popular CommonJS extension `module.exports`. */
2273
+ var moduleExports = freeModule && freeModule.exports === freeExports;
2274
+
2275
+ /** Detect free variable `process` from Node.js. */
2276
+ var freeProcess = moduleExports && freeGlobal.process;
2277
+
2278
+ /** Used to access faster Node.js helpers. */
2279
+ var nodeUtil = (function() {
2280
+ try {
2281
+ // Use `util.types` for Node.js 10+.
2282
+ var types = freeModule && freeModule.require && freeModule.require('util').types;
2283
+
2284
+ if (types) {
2285
+ return types;
2286
+ }
2287
+
2288
+ // Legacy `process.binding('util')` for Node.js < 10.
2289
+ return freeProcess && freeProcess.binding && freeProcess.binding('util');
2290
+ } catch (e) {}
2291
+ }());
2292
+
2293
+ module.exports = nodeUtil;
2294
+ } (_nodeUtil, _nodeUtil.exports));
2295
+ return _nodeUtil.exports;
2296
+ }
2297
+
2298
+ var isTypedArray_1;
2299
+ var hasRequiredIsTypedArray;
2300
+
2301
+ function requireIsTypedArray () {
2302
+ if (hasRequiredIsTypedArray) return isTypedArray_1;
2303
+ hasRequiredIsTypedArray = 1;
2304
+ var baseIsTypedArray = require_baseIsTypedArray(),
2305
+ baseUnary = require_baseUnary(),
2306
+ nodeUtil = require_nodeUtil();
2307
+
2308
+ /* Node.js helper references. */
2309
+ var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
2310
+
2311
+ /**
2312
+ * Checks if `value` is classified as a typed array.
2313
+ *
2314
+ * @static
2315
+ * @memberOf _
2316
+ * @since 3.0.0
2317
+ * @category Lang
2318
+ * @param {*} value The value to check.
2319
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
2320
+ * @example
2321
+ *
2322
+ * _.isTypedArray(new Uint8Array);
2323
+ * // => true
2324
+ *
2325
+ * _.isTypedArray([]);
2326
+ * // => false
2327
+ */
2328
+ var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
2329
+
2330
+ isTypedArray_1 = isTypedArray;
2331
+ return isTypedArray_1;
2332
+ }
2333
+
2334
+ var _arrayLikeKeys;
2335
+ var hasRequired_arrayLikeKeys;
2336
+
2337
+ function require_arrayLikeKeys () {
2338
+ if (hasRequired_arrayLikeKeys) return _arrayLikeKeys;
2339
+ hasRequired_arrayLikeKeys = 1;
2340
+ var baseTimes = require_baseTimes(),
2341
+ isArguments = requireIsArguments(),
2342
+ isArray = requireIsArray(),
2343
+ isBuffer = requireIsBuffer(),
2344
+ isIndex = require_isIndex(),
2345
+ isTypedArray = requireIsTypedArray();
2346
+
2347
+ /** Used for built-in method references. */
2348
+ var objectProto = Object.prototype;
2349
+
2350
+ /** Used to check objects for own properties. */
2351
+ var hasOwnProperty = objectProto.hasOwnProperty;
2352
+
2353
+ /**
2354
+ * Creates an array of the enumerable property names of the array-like `value`.
2355
+ *
2356
+ * @private
2357
+ * @param {*} value The value to query.
2358
+ * @param {boolean} inherited Specify returning inherited property names.
2359
+ * @returns {Array} Returns the array of property names.
2360
+ */
2361
+ function arrayLikeKeys(value, inherited) {
2362
+ var isArr = isArray(value),
2363
+ isArg = !isArr && isArguments(value),
2364
+ isBuff = !isArr && !isArg && isBuffer(value),
2365
+ isType = !isArr && !isArg && !isBuff && isTypedArray(value),
2366
+ skipIndexes = isArr || isArg || isBuff || isType,
2367
+ result = skipIndexes ? baseTimes(value.length, String) : [],
2368
+ length = result.length;
2369
+
2370
+ for (var key in value) {
2371
+ if ((inherited || hasOwnProperty.call(value, key)) &&
2372
+ !(skipIndexes && (
2373
+ // Safari 9 has enumerable `arguments.length` in strict mode.
2374
+ key == 'length' ||
2375
+ // Node.js 0.10 has enumerable non-index properties on buffers.
2376
+ (isBuff && (key == 'offset' || key == 'parent')) ||
2377
+ // PhantomJS 2 has enumerable non-index properties on typed arrays.
2378
+ (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
2379
+ // Skip index properties.
2380
+ isIndex(key, length)
2381
+ ))) {
2382
+ result.push(key);
2383
+ }
2384
+ }
2385
+ return result;
2386
+ }
2387
+
2388
+ _arrayLikeKeys = arrayLikeKeys;
2389
+ return _arrayLikeKeys;
2390
+ }
2391
+
2392
+ /** Used for built-in method references. */
2393
+
2394
+ var _isPrototype;
2395
+ var hasRequired_isPrototype;
2396
+
2397
+ function require_isPrototype () {
2398
+ if (hasRequired_isPrototype) return _isPrototype;
2399
+ hasRequired_isPrototype = 1;
2400
+ var objectProto = Object.prototype;
2401
+
2402
+ /**
2403
+ * Checks if `value` is likely a prototype object.
2404
+ *
2405
+ * @private
2406
+ * @param {*} value The value to check.
2407
+ * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
2408
+ */
2409
+ function isPrototype(value) {
2410
+ var Ctor = value && value.constructor,
2411
+ proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
2412
+
2413
+ return value === proto;
2414
+ }
2415
+
2416
+ _isPrototype = isPrototype;
2417
+ return _isPrototype;
2418
+ }
2419
+
2420
+ /**
2421
+ * Creates a unary function that invokes `func` with its argument transformed.
2422
+ *
2423
+ * @private
2424
+ * @param {Function} func The function to wrap.
2425
+ * @param {Function} transform The argument transform.
2426
+ * @returns {Function} Returns the new function.
2427
+ */
2428
+
2429
+ var _overArg;
2430
+ var hasRequired_overArg;
2431
+
2432
+ function require_overArg () {
2433
+ if (hasRequired_overArg) return _overArg;
2434
+ hasRequired_overArg = 1;
2435
+ function overArg(func, transform) {
2436
+ return function(arg) {
2437
+ return func(transform(arg));
2438
+ };
2439
+ }
2440
+
2441
+ _overArg = overArg;
2442
+ return _overArg;
2443
+ }
2444
+
2445
+ var _nativeKeys;
2446
+ var hasRequired_nativeKeys;
2447
+
2448
+ function require_nativeKeys () {
2449
+ if (hasRequired_nativeKeys) return _nativeKeys;
2450
+ hasRequired_nativeKeys = 1;
2451
+ var overArg = require_overArg();
2452
+
2453
+ /* Built-in method references for those with the same name as other `lodash` methods. */
2454
+ var nativeKeys = overArg(Object.keys, Object);
2455
+
2456
+ _nativeKeys = nativeKeys;
2457
+ return _nativeKeys;
2458
+ }
2459
+
2460
+ var _baseKeys;
2461
+ var hasRequired_baseKeys;
2462
+
2463
+ function require_baseKeys () {
2464
+ if (hasRequired_baseKeys) return _baseKeys;
2465
+ hasRequired_baseKeys = 1;
2466
+ var isPrototype = require_isPrototype(),
2467
+ nativeKeys = require_nativeKeys();
2468
+
2469
+ /** Used for built-in method references. */
2470
+ var objectProto = Object.prototype;
2471
+
2472
+ /** Used to check objects for own properties. */
2473
+ var hasOwnProperty = objectProto.hasOwnProperty;
2474
+
2475
+ /**
2476
+ * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
2477
+ *
2478
+ * @private
2479
+ * @param {Object} object The object to query.
2480
+ * @returns {Array} Returns the array of property names.
2481
+ */
2482
+ function baseKeys(object) {
2483
+ if (!isPrototype(object)) {
2484
+ return nativeKeys(object);
2485
+ }
2486
+ var result = [];
2487
+ for (var key in Object(object)) {
2488
+ if (hasOwnProperty.call(object, key) && key != 'constructor') {
2489
+ result.push(key);
2490
+ }
2491
+ }
2492
+ return result;
2493
+ }
2494
+
2495
+ _baseKeys = baseKeys;
2496
+ return _baseKeys;
2497
+ }
2498
+
2499
+ var isArrayLike_1;
2500
+ var hasRequiredIsArrayLike;
2501
+
2502
+ function requireIsArrayLike () {
2503
+ if (hasRequiredIsArrayLike) return isArrayLike_1;
2504
+ hasRequiredIsArrayLike = 1;
2505
+ var isFunction = requireIsFunction(),
2506
+ isLength = requireIsLength();
2507
+
2508
+ /**
2509
+ * Checks if `value` is array-like. A value is considered array-like if it's
2510
+ * not a function and has a `value.length` that's an integer greater than or
2511
+ * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
2512
+ *
2513
+ * @static
2514
+ * @memberOf _
2515
+ * @since 4.0.0
2516
+ * @category Lang
2517
+ * @param {*} value The value to check.
2518
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
2519
+ * @example
2520
+ *
2521
+ * _.isArrayLike([1, 2, 3]);
2522
+ * // => true
2523
+ *
2524
+ * _.isArrayLike(document.body.children);
2525
+ * // => true
2526
+ *
2527
+ * _.isArrayLike('abc');
2528
+ * // => true
2529
+ *
2530
+ * _.isArrayLike(_.noop);
2531
+ * // => false
2532
+ */
2533
+ function isArrayLike(value) {
2534
+ return value != null && isLength(value.length) && !isFunction(value);
2535
+ }
2536
+
2537
+ isArrayLike_1 = isArrayLike;
2538
+ return isArrayLike_1;
2539
+ }
2540
+
2541
+ var keys_1;
2542
+ var hasRequiredKeys;
2543
+
2544
+ function requireKeys () {
2545
+ if (hasRequiredKeys) return keys_1;
2546
+ hasRequiredKeys = 1;
2547
+ var arrayLikeKeys = require_arrayLikeKeys(),
2548
+ baseKeys = require_baseKeys(),
2549
+ isArrayLike = requireIsArrayLike();
2550
+
2551
+ /**
2552
+ * Creates an array of the own enumerable property names of `object`.
2553
+ *
2554
+ * **Note:** Non-object values are coerced to objects. See the
2555
+ * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
2556
+ * for more details.
2557
+ *
2558
+ * @static
2559
+ * @since 0.1.0
2560
+ * @memberOf _
2561
+ * @category Object
2562
+ * @param {Object} object The object to query.
2563
+ * @returns {Array} Returns the array of property names.
2564
+ * @example
2565
+ *
2566
+ * function Foo() {
2567
+ * this.a = 1;
2568
+ * this.b = 2;
2569
+ * }
2570
+ *
2571
+ * Foo.prototype.c = 3;
2572
+ *
2573
+ * _.keys(new Foo);
2574
+ * // => ['a', 'b'] (iteration order is not guaranteed)
2575
+ *
2576
+ * _.keys('hi');
2577
+ * // => ['0', '1']
2578
+ */
2579
+ function keys(object) {
2580
+ return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
2581
+ }
2582
+
2583
+ keys_1 = keys;
2584
+ return keys_1;
2585
+ }
2586
+
2587
+ var values_1;
2588
+ var hasRequiredValues;
2589
+
2590
+ function requireValues () {
2591
+ if (hasRequiredValues) return values_1;
2592
+ hasRequiredValues = 1;
2593
+ var baseValues = require_baseValues(),
2594
+ keys = requireKeys();
2595
+
2596
+ /**
2597
+ * Creates an array of the own enumerable string keyed property values of `object`.
2598
+ *
2599
+ * **Note:** Non-object values are coerced to objects.
2600
+ *
2601
+ * @static
2602
+ * @since 0.1.0
2603
+ * @memberOf _
2604
+ * @category Object
2605
+ * @param {Object} object The object to query.
2606
+ * @returns {Array} Returns the array of property values.
2607
+ * @example
2608
+ *
2609
+ * function Foo() {
2610
+ * this.a = 1;
2611
+ * this.b = 2;
2612
+ * }
2613
+ *
2614
+ * Foo.prototype.c = 3;
2615
+ *
2616
+ * _.values(new Foo);
2617
+ * // => [1, 2] (iteration order is not guaranteed)
2618
+ *
2619
+ * _.values('hi');
2620
+ * // => ['h', 'i']
2621
+ */
2622
+ function values(object) {
2623
+ return object == null ? [] : baseValues(object, keys(object));
2624
+ }
2625
+
2626
+ values_1 = values;
2627
+ return values_1;
2628
+ }
2629
+
2630
+ var _baseShuffle;
2631
+ var hasRequired_baseShuffle;
2632
+
2633
+ function require_baseShuffle () {
2634
+ if (hasRequired_baseShuffle) return _baseShuffle;
2635
+ hasRequired_baseShuffle = 1;
2636
+ var shuffleSelf = require_shuffleSelf(),
2637
+ values = requireValues();
2638
+
2639
+ /**
2640
+ * The base implementation of `_.shuffle`.
2641
+ *
2642
+ * @private
2643
+ * @param {Array|Object} collection The collection to shuffle.
2644
+ * @returns {Array} Returns the new shuffled array.
2645
+ */
2646
+ function baseShuffle(collection) {
2647
+ return shuffleSelf(values(collection));
2648
+ }
2649
+
2650
+ _baseShuffle = baseShuffle;
2651
+ return _baseShuffle;
2652
+ }
2653
+
2654
+ var shuffle_1;
2655
+ var hasRequiredShuffle;
2656
+
2657
+ function requireShuffle () {
2658
+ if (hasRequiredShuffle) return shuffle_1;
2659
+ hasRequiredShuffle = 1;
2660
+ var arrayShuffle = require_arrayShuffle(),
2661
+ baseShuffle = require_baseShuffle(),
2662
+ isArray = requireIsArray();
2663
+
2664
+ /**
2665
+ * Creates an array of shuffled values, using a version of the
2666
+ * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
2667
+ *
2668
+ * @static
2669
+ * @memberOf _
2670
+ * @since 0.1.0
2671
+ * @category Collection
2672
+ * @param {Array|Object} collection The collection to shuffle.
2673
+ * @returns {Array} Returns the new shuffled array.
2674
+ * @example
2675
+ *
2676
+ * _.shuffle([1, 2, 3, 4]);
2677
+ * // => [4, 1, 3, 2]
2678
+ */
2679
+ function shuffle(collection) {
2680
+ var func = isArray(collection) ? arrayShuffle : baseShuffle;
2681
+ return func(collection);
2682
+ }
2683
+
2684
+ shuffle_1 = shuffle;
2685
+ return shuffle_1;
2686
+ }
2687
+
2688
+ var shuffleExports = requireShuffle();
2689
+ var shuffle = /*@__PURE__*/getDefaultExportFromCjs(shuffleExports);
2690
+
2691
+ var _DataView;
2692
+ var hasRequired_DataView;
2693
+
2694
+ function require_DataView () {
2695
+ if (hasRequired_DataView) return _DataView;
2696
+ hasRequired_DataView = 1;
2697
+ var getNative = require_getNative(),
2698
+ root = require_root();
2699
+
2700
+ /* Built-in method references that are verified to be native. */
2701
+ var DataView = getNative(root, 'DataView');
2702
+
2703
+ _DataView = DataView;
2704
+ return _DataView;
2705
+ }
2706
+
2707
+ var _Promise;
2708
+ var hasRequired_Promise;
2709
+
2710
+ function require_Promise () {
2711
+ if (hasRequired_Promise) return _Promise;
2712
+ hasRequired_Promise = 1;
2713
+ var getNative = require_getNative(),
2714
+ root = require_root();
2715
+
2716
+ /* Built-in method references that are verified to be native. */
2717
+ var Promise = getNative(root, 'Promise');
2718
+
2719
+ _Promise = Promise;
2720
+ return _Promise;
2721
+ }
2722
+
2723
+ var _Set;
2724
+ var hasRequired_Set;
2725
+
2726
+ function require_Set () {
2727
+ if (hasRequired_Set) return _Set;
2728
+ hasRequired_Set = 1;
2729
+ var getNative = require_getNative(),
2730
+ root = require_root();
2731
+
2732
+ /* Built-in method references that are verified to be native. */
2733
+ var Set = getNative(root, 'Set');
2734
+
2735
+ _Set = Set;
2736
+ return _Set;
2737
+ }
2738
+
2739
+ var _WeakMap;
2740
+ var hasRequired_WeakMap;
2741
+
2742
+ function require_WeakMap () {
2743
+ if (hasRequired_WeakMap) return _WeakMap;
2744
+ hasRequired_WeakMap = 1;
2745
+ var getNative = require_getNative(),
2746
+ root = require_root();
2747
+
2748
+ /* Built-in method references that are verified to be native. */
2749
+ var WeakMap = getNative(root, 'WeakMap');
2750
+
2751
+ _WeakMap = WeakMap;
2752
+ return _WeakMap;
2753
+ }
2754
+
2755
+ var _getTag;
2756
+ var hasRequired_getTag;
2757
+
2758
+ function require_getTag () {
2759
+ if (hasRequired_getTag) return _getTag;
2760
+ hasRequired_getTag = 1;
2761
+ var DataView = require_DataView(),
2762
+ Map = require_Map(),
2763
+ Promise = require_Promise(),
2764
+ Set = require_Set(),
2765
+ WeakMap = require_WeakMap(),
2766
+ baseGetTag = require_baseGetTag(),
2767
+ toSource = require_toSource();
2768
+
2769
+ /** `Object#toString` result references. */
2770
+ var mapTag = '[object Map]',
2771
+ objectTag = '[object Object]',
2772
+ promiseTag = '[object Promise]',
2773
+ setTag = '[object Set]',
2774
+ weakMapTag = '[object WeakMap]';
2775
+
2776
+ var dataViewTag = '[object DataView]';
2777
+
2778
+ /** Used to detect maps, sets, and weakmaps. */
2779
+ var dataViewCtorString = toSource(DataView),
2780
+ mapCtorString = toSource(Map),
2781
+ promiseCtorString = toSource(Promise),
2782
+ setCtorString = toSource(Set),
2783
+ weakMapCtorString = toSource(WeakMap);
2784
+
2785
+ /**
2786
+ * Gets the `toStringTag` of `value`.
2787
+ *
2788
+ * @private
2789
+ * @param {*} value The value to query.
2790
+ * @returns {string} Returns the `toStringTag`.
2791
+ */
2792
+ var getTag = baseGetTag;
2793
+
2794
+ // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
2795
+ if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
2796
+ (Map && getTag(new Map) != mapTag) ||
2797
+ (Promise && getTag(Promise.resolve()) != promiseTag) ||
2798
+ (Set && getTag(new Set) != setTag) ||
2799
+ (WeakMap && getTag(new WeakMap) != weakMapTag)) {
2800
+ getTag = function(value) {
2801
+ var result = baseGetTag(value),
2802
+ Ctor = result == objectTag ? value.constructor : undefined,
2803
+ ctorString = Ctor ? toSource(Ctor) : '';
2804
+
2805
+ if (ctorString) {
2806
+ switch (ctorString) {
2807
+ case dataViewCtorString: return dataViewTag;
2808
+ case mapCtorString: return mapTag;
2809
+ case promiseCtorString: return promiseTag;
2810
+ case setCtorString: return setTag;
2811
+ case weakMapCtorString: return weakMapTag;
2812
+ }
2813
+ }
2814
+ return result;
2815
+ };
2816
+ }
2817
+
2818
+ _getTag = getTag;
2819
+ return _getTag;
2820
+ }
2821
+
2822
+ var isEmpty_1;
2823
+ var hasRequiredIsEmpty;
2824
+
2825
+ function requireIsEmpty () {
2826
+ if (hasRequiredIsEmpty) return isEmpty_1;
2827
+ hasRequiredIsEmpty = 1;
2828
+ var baseKeys = require_baseKeys(),
2829
+ getTag = require_getTag(),
2830
+ isArguments = requireIsArguments(),
2831
+ isArray = requireIsArray(),
2832
+ isArrayLike = requireIsArrayLike(),
2833
+ isBuffer = requireIsBuffer(),
2834
+ isPrototype = require_isPrototype(),
2835
+ isTypedArray = requireIsTypedArray();
2836
+
2837
+ /** `Object#toString` result references. */
2838
+ var mapTag = '[object Map]',
2839
+ setTag = '[object Set]';
2840
+
2841
+ /** Used for built-in method references. */
2842
+ var objectProto = Object.prototype;
2843
+
2844
+ /** Used to check objects for own properties. */
2845
+ var hasOwnProperty = objectProto.hasOwnProperty;
2846
+
2847
+ /**
2848
+ * Checks if `value` is an empty object, collection, map, or set.
2849
+ *
2850
+ * Objects are considered empty if they have no own enumerable string keyed
2851
+ * properties.
2852
+ *
2853
+ * Array-like values such as `arguments` objects, arrays, buffers, strings, or
2854
+ * jQuery-like collections are considered empty if they have a `length` of `0`.
2855
+ * Similarly, maps and sets are considered empty if they have a `size` of `0`.
2856
+ *
2857
+ * @static
2858
+ * @memberOf _
2859
+ * @since 0.1.0
2860
+ * @category Lang
2861
+ * @param {*} value The value to check.
2862
+ * @returns {boolean} Returns `true` if `value` is empty, else `false`.
2863
+ * @example
2864
+ *
2865
+ * _.isEmpty(null);
2866
+ * // => true
2867
+ *
2868
+ * _.isEmpty(true);
2869
+ * // => true
2870
+ *
2871
+ * _.isEmpty(1);
2872
+ * // => true
2873
+ *
2874
+ * _.isEmpty([1, 2, 3]);
2875
+ * // => false
2876
+ *
2877
+ * _.isEmpty({ 'a': 1 });
2878
+ * // => false
2879
+ */
2880
+ function isEmpty(value) {
2881
+ if (value == null) {
2882
+ return true;
2883
+ }
2884
+ if (isArrayLike(value) &&
2885
+ (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
2886
+ isBuffer(value) || isTypedArray(value) || isArguments(value))) {
2887
+ return !value.length;
2888
+ }
2889
+ var tag = getTag(value);
2890
+ if (tag == mapTag || tag == setTag) {
2891
+ return !value.size;
2892
+ }
2893
+ if (isPrototype(value)) {
2894
+ return !baseKeys(value).length;
2895
+ }
2896
+ for (var key in value) {
2897
+ if (hasOwnProperty.call(value, key)) {
2898
+ return false;
2899
+ }
2900
+ }
2901
+ return true;
2902
+ }
2903
+
2904
+ isEmpty_1 = isEmpty;
2905
+ return isEmpty_1;
2906
+ }
2907
+
2908
+ var isEmptyExports = requireIsEmpty();
2909
+ var isEmpty = /*@__PURE__*/getDefaultExportFromCjs(isEmptyExports);
2910
+
2911
+ // eslint-disable-next-line no-console
2912
+ const lg = n => console[n].bind(console, 'controller-utils:');
2913
+ const debug = lg('debug');
2914
+ const log = lg('log');
2915
+ const warn = lg('warn');
2916
+ const error = lg('error');
2917
+ const compact = arr => {
2918
+ if (Array.isArray(arr)) {
2919
+ return arr.filter(v => v !== null && v !== undefined);
2920
+ }
2921
+ return arr;
2922
+ };
2923
+ const getShuffledChoices = (choices, session, updateSession, choiceKey) => new Promise(resolve => {
2924
+ var _session$data;
2925
+ log('updateSession type: ', typeof updateSession);
2926
+ log('session: ', session);
2927
+ const currentShuffled = compact((session == null || (_session$data = session.data) == null ? void 0 : _session$data.shuffledValues) || (session == null ? void 0 : session.shuffledValues) || []);
2928
+ if (!session) {
2929
+ // eslint-disable-next-line quotes
2930
+ warn("unable to save shuffled choices because there's no session.");
2931
+ resolve(undefined);
2932
+ } else if (!isEmpty(currentShuffled)) {
2933
+ debug('use shuffledValues to sort the choices...', currentShuffled);
2934
+ resolve(compact(currentShuffled.map(v => choices.find(c => c[choiceKey] === v))));
2935
+ } else {
2936
+ const shuffledChoices = shuffle(choices);
2937
+ if (updateSession && typeof updateSession === 'function') {
2938
+ try {
2939
+ //Note: session.id refers to the id of the element within a session
2940
+ const shuffledValues = compact(shuffledChoices.map(c => c[choiceKey]));
2941
+ log('try to save shuffledValues to session...', shuffledValues);
2942
+ log('call updateSession... ', session.id, session.element);
2943
+ if (isEmpty(shuffledValues)) {
2944
+ error(`shuffledValues is an empty array? - refusing to call updateSession: shuffledChoices: ${JSON.stringify(shuffledChoices)}, key: ${choiceKey}`);
2945
+ } else {
2946
+ updateSession(session.id, session.element, {
2947
+ shuffledValues
2948
+ }).catch(e =>
2949
+ // eslint-disable-next-line no-console
2950
+ console.error('update session failed for: ', session.id, e));
2951
+ }
2952
+ } catch (e) {
2953
+ warn('unable to save shuffled order for choices');
2954
+ error(e);
2955
+ }
2956
+ } else {
2957
+ warn('unable to save shuffled choices, shuffle will happen every time.');
2958
+ }
2959
+
2960
+ //save this shuffle to the session for later retrieval
2961
+ resolve(shuffledChoices);
2962
+ }
2963
+ });
2964
+
2965
+ /**
2966
+ * If we return:
2967
+ * - true - that means that the order of the choices will be ordinal (as is created in the configure item)
2968
+ * - false - that means the getShuffledChoices above will be called and that in turn means that we either
2969
+ * return the shuffled values on the session (if any exists) or we shuffle the choices
2970
+ * @param model - model to check if we should lock order
2971
+ * @param session - session to check if we should lock order
2972
+ * @param env - env to check if we should lock order
2973
+ * @returns {boolean}
2974
+ */
2975
+ const lockChoices = (model, session, env) => {
2976
+ if (model.lockChoiceOrder) {
2977
+ return true;
2978
+ }
2979
+ log('lockChoiceOrder: ', get(env, ['@pie-element', 'lockChoiceOrder'], false));
2980
+ if (get(env, ['@pie-element', 'lockChoiceOrder'], false)) {
2981
+ return true;
2982
+ }
2983
+ const role = get(env, 'role', 'student');
2984
+ if (role === 'instructor') {
2985
+ // TODO: .. in the future the instructor can toggle between ordinal and shuffled here, so keeping this code until then
2986
+ /*const alreadyShuffled = hasShuffledValues(session);
2987
+ if (alreadyShuffled) {
2988
+ return false;
2989
+ }
2990
+ return true;*/
2991
+ return true;
2992
+ }
2993
+
2994
+ // here it's a student, so don't lock and it will shuffle if needs be
2995
+ return false;
2996
+ };
2997
+
2998
+ export { getShuffledChoices, lockChoices, partialScoring };
2999
+ //# sourceMappingURL=index.js.map