@springtree/eva-sdk-core-settings 2.0.2 → 2.0.4

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.
@@ -1,136 +1,2624 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('pubsub-js')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'pubsub-js'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.evaSdkCoreSettings = {}, global.pubsubJs));
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('pubsub-js')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'pubsub-js'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.evaSdkCoreSettings = {}, global.pubsubJs));
5
5
  })(this, (function (exports, pubsubJs) { 'use strict';
6
6
 
7
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
-
9
- var pubsubJs__default = /*#__PURE__*/_interopDefaultLegacy(pubsubJs);
10
-
11
- /**
12
- * The settings manager wraps a collection of settings and provides
13
- * methods to register and retrieve groups of settings
14
- * It also helps track changes to the settings
15
- *
16
- * @export
17
- * @class SettingsManager
18
- */
19
- class SettingsManager {
20
- constructor() {
21
- /**
22
- * The actual settings data
23
- *
24
- * @private
25
- * @type {({[groupName: string]: any})}
26
- */
27
- this.settings = {};
28
- }
29
- /**
30
- * Register a new settings group
31
- *
32
- * @param {string} groupName The name of the group to register
33
- * @param {*} [defaultSetting={}] The default settings for the group
34
- */
35
- register(groupName, defaultSetting = {}) {
36
- if (this.settings[groupName]) {
37
- throw new Error(`SETTINGS: Duplicate registration for ${groupName}`);
38
- }
39
- // Make a copy of the default settings
40
- //
41
- this.settings[groupName] = JSON.parse(JSON.stringify(defaultSetting));
42
- }
43
- /**
44
- * Retrieves a setting group
45
- *
46
- * @param {string} groupName The name of the group to fetch
47
- */
48
- getGroup(groupName) {
49
- return this.settings[groupName];
7
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
+
9
+ var pubsubJs__default = /*#__PURE__*/_interopDefaultLegacy(pubsubJs);
10
+
11
+ /**
12
+ * Removes all key-value entries from the list cache.
13
+ *
14
+ * @private
15
+ * @name clear
16
+ * @memberOf ListCache
17
+ */
18
+ function listCacheClear() {
19
+ this.__data__ = [];
20
+ this.size = 0;
21
+ }
22
+
23
+ var _listCacheClear = listCacheClear;
24
+
25
+ /**
26
+ * Performs a
27
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
28
+ * comparison between two values to determine if they are equivalent.
29
+ *
30
+ * @static
31
+ * @memberOf _
32
+ * @since 4.0.0
33
+ * @category Lang
34
+ * @param {*} value The value to compare.
35
+ * @param {*} other The other value to compare.
36
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
37
+ * @example
38
+ *
39
+ * var object = { 'a': 1 };
40
+ * var other = { 'a': 1 };
41
+ *
42
+ * _.eq(object, object);
43
+ * // => true
44
+ *
45
+ * _.eq(object, other);
46
+ * // => false
47
+ *
48
+ * _.eq('a', 'a');
49
+ * // => true
50
+ *
51
+ * _.eq('a', Object('a'));
52
+ * // => false
53
+ *
54
+ * _.eq(NaN, NaN);
55
+ * // => true
56
+ */
57
+ function eq(value, other) {
58
+ return value === other || (value !== value && other !== other);
59
+ }
60
+
61
+ var eq_1 = eq;
62
+
63
+ /**
64
+ * Gets the index at which the `key` is found in `array` of key-value pairs.
65
+ *
66
+ * @private
67
+ * @param {Array} array The array to inspect.
68
+ * @param {*} key The key to search for.
69
+ * @returns {number} Returns the index of the matched value, else `-1`.
70
+ */
71
+ function assocIndexOf(array, key) {
72
+ var length = array.length;
73
+ while (length--) {
74
+ if (eq_1(array[length][0], key)) {
75
+ return length;
76
+ }
77
+ }
78
+ return -1;
79
+ }
80
+
81
+ var _assocIndexOf = assocIndexOf;
82
+
83
+ /** Used for built-in method references. */
84
+ var arrayProto = Array.prototype;
85
+
86
+ /** Built-in value references. */
87
+ var splice = arrayProto.splice;
88
+
89
+ /**
90
+ * Removes `key` and its value from the list cache.
91
+ *
92
+ * @private
93
+ * @name delete
94
+ * @memberOf ListCache
95
+ * @param {string} key The key of the value to remove.
96
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
97
+ */
98
+ function listCacheDelete(key) {
99
+ var data = this.__data__,
100
+ index = _assocIndexOf(data, key);
101
+
102
+ if (index < 0) {
103
+ return false;
104
+ }
105
+ var lastIndex = data.length - 1;
106
+ if (index == lastIndex) {
107
+ data.pop();
108
+ } else {
109
+ splice.call(data, index, 1);
110
+ }
111
+ --this.size;
112
+ return true;
113
+ }
114
+
115
+ var _listCacheDelete = listCacheDelete;
116
+
117
+ /**
118
+ * Gets the list cache value for `key`.
119
+ *
120
+ * @private
121
+ * @name get
122
+ * @memberOf ListCache
123
+ * @param {string} key The key of the value to get.
124
+ * @returns {*} Returns the entry value.
125
+ */
126
+ function listCacheGet(key) {
127
+ var data = this.__data__,
128
+ index = _assocIndexOf(data, key);
129
+
130
+ return index < 0 ? undefined : data[index][1];
131
+ }
132
+
133
+ var _listCacheGet = listCacheGet;
134
+
135
+ /**
136
+ * Checks if a list cache value for `key` exists.
137
+ *
138
+ * @private
139
+ * @name has
140
+ * @memberOf ListCache
141
+ * @param {string} key The key of the entry to check.
142
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
143
+ */
144
+ function listCacheHas(key) {
145
+ return _assocIndexOf(this.__data__, key) > -1;
146
+ }
147
+
148
+ var _listCacheHas = listCacheHas;
149
+
150
+ /**
151
+ * Sets the list cache `key` to `value`.
152
+ *
153
+ * @private
154
+ * @name set
155
+ * @memberOf ListCache
156
+ * @param {string} key The key of the value to set.
157
+ * @param {*} value The value to set.
158
+ * @returns {Object} Returns the list cache instance.
159
+ */
160
+ function listCacheSet(key, value) {
161
+ var data = this.__data__,
162
+ index = _assocIndexOf(data, key);
163
+
164
+ if (index < 0) {
165
+ ++this.size;
166
+ data.push([key, value]);
167
+ } else {
168
+ data[index][1] = value;
169
+ }
170
+ return this;
171
+ }
172
+
173
+ var _listCacheSet = listCacheSet;
174
+
175
+ /**
176
+ * Creates an list cache object.
177
+ *
178
+ * @private
179
+ * @constructor
180
+ * @param {Array} [entries] The key-value pairs to cache.
181
+ */
182
+ function ListCache(entries) {
183
+ var index = -1,
184
+ length = entries == null ? 0 : entries.length;
185
+
186
+ this.clear();
187
+ while (++index < length) {
188
+ var entry = entries[index];
189
+ this.set(entry[0], entry[1]);
190
+ }
191
+ }
192
+
193
+ // Add methods to `ListCache`.
194
+ ListCache.prototype.clear = _listCacheClear;
195
+ ListCache.prototype['delete'] = _listCacheDelete;
196
+ ListCache.prototype.get = _listCacheGet;
197
+ ListCache.prototype.has = _listCacheHas;
198
+ ListCache.prototype.set = _listCacheSet;
199
+
200
+ var _ListCache = ListCache;
201
+
202
+ /**
203
+ * Removes all key-value entries from the stack.
204
+ *
205
+ * @private
206
+ * @name clear
207
+ * @memberOf Stack
208
+ */
209
+ function stackClear() {
210
+ this.__data__ = new _ListCache;
211
+ this.size = 0;
212
+ }
213
+
214
+ var _stackClear = stackClear;
215
+
216
+ /**
217
+ * Removes `key` and its value from the stack.
218
+ *
219
+ * @private
220
+ * @name delete
221
+ * @memberOf Stack
222
+ * @param {string} key The key of the value to remove.
223
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
224
+ */
225
+ function stackDelete(key) {
226
+ var data = this.__data__,
227
+ result = data['delete'](key);
228
+
229
+ this.size = data.size;
230
+ return result;
231
+ }
232
+
233
+ var _stackDelete = stackDelete;
234
+
235
+ /**
236
+ * Gets the stack value for `key`.
237
+ *
238
+ * @private
239
+ * @name get
240
+ * @memberOf Stack
241
+ * @param {string} key The key of the value to get.
242
+ * @returns {*} Returns the entry value.
243
+ */
244
+ function stackGet(key) {
245
+ return this.__data__.get(key);
246
+ }
247
+
248
+ var _stackGet = stackGet;
249
+
250
+ /**
251
+ * Checks if a stack value for `key` exists.
252
+ *
253
+ * @private
254
+ * @name has
255
+ * @memberOf Stack
256
+ * @param {string} key The key of the entry to check.
257
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
258
+ */
259
+ function stackHas(key) {
260
+ return this.__data__.has(key);
261
+ }
262
+
263
+ var _stackHas = stackHas;
264
+
265
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
266
+
267
+ function createCommonjsModule(fn, module) {
268
+ return module = { exports: {} }, fn(module, module.exports), module.exports;
269
+ }
270
+
271
+ /** Detect free variable `global` from Node.js. */
272
+ var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
273
+
274
+ var _freeGlobal = freeGlobal;
275
+
276
+ /** Detect free variable `self`. */
277
+ var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
278
+
279
+ /** Used as a reference to the global object. */
280
+ var root = _freeGlobal || freeSelf || Function('return this')();
281
+
282
+ var _root = root;
283
+
284
+ /** Built-in value references. */
285
+ var Symbol = _root.Symbol;
286
+
287
+ var _Symbol = Symbol;
288
+
289
+ /** Used for built-in method references. */
290
+ var objectProto$c = Object.prototype;
291
+
292
+ /** Used to check objects for own properties. */
293
+ var hasOwnProperty$9 = objectProto$c.hasOwnProperty;
294
+
295
+ /**
296
+ * Used to resolve the
297
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
298
+ * of values.
299
+ */
300
+ var nativeObjectToString$1 = objectProto$c.toString;
301
+
302
+ /** Built-in value references. */
303
+ var symToStringTag$1 = _Symbol ? _Symbol.toStringTag : undefined;
304
+
305
+ /**
306
+ * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
307
+ *
308
+ * @private
309
+ * @param {*} value The value to query.
310
+ * @returns {string} Returns the raw `toStringTag`.
311
+ */
312
+ function getRawTag(value) {
313
+ var isOwn = hasOwnProperty$9.call(value, symToStringTag$1),
314
+ tag = value[symToStringTag$1];
315
+
316
+ try {
317
+ value[symToStringTag$1] = undefined;
318
+ var unmasked = true;
319
+ } catch (e) {}
320
+
321
+ var result = nativeObjectToString$1.call(value);
322
+ if (unmasked) {
323
+ if (isOwn) {
324
+ value[symToStringTag$1] = tag;
325
+ } else {
326
+ delete value[symToStringTag$1];
327
+ }
328
+ }
329
+ return result;
330
+ }
331
+
332
+ var _getRawTag = getRawTag;
333
+
334
+ /** Used for built-in method references. */
335
+ var objectProto$b = Object.prototype;
336
+
337
+ /**
338
+ * Used to resolve the
339
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
340
+ * of values.
341
+ */
342
+ var nativeObjectToString = objectProto$b.toString;
343
+
344
+ /**
345
+ * Converts `value` to a string using `Object.prototype.toString`.
346
+ *
347
+ * @private
348
+ * @param {*} value The value to convert.
349
+ * @returns {string} Returns the converted string.
350
+ */
351
+ function objectToString(value) {
352
+ return nativeObjectToString.call(value);
353
+ }
354
+
355
+ var _objectToString = objectToString;
356
+
357
+ /** `Object#toString` result references. */
358
+ var nullTag = '[object Null]',
359
+ undefinedTag = '[object Undefined]';
360
+
361
+ /** Built-in value references. */
362
+ var symToStringTag = _Symbol ? _Symbol.toStringTag : undefined;
363
+
364
+ /**
365
+ * The base implementation of `getTag` without fallbacks for buggy environments.
366
+ *
367
+ * @private
368
+ * @param {*} value The value to query.
369
+ * @returns {string} Returns the `toStringTag`.
370
+ */
371
+ function baseGetTag(value) {
372
+ if (value == null) {
373
+ return value === undefined ? undefinedTag : nullTag;
374
+ }
375
+ return (symToStringTag && symToStringTag in Object(value))
376
+ ? _getRawTag(value)
377
+ : _objectToString(value);
378
+ }
379
+
380
+ var _baseGetTag = baseGetTag;
381
+
382
+ /**
383
+ * Checks if `value` is the
384
+ * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
385
+ * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
386
+ *
387
+ * @static
388
+ * @memberOf _
389
+ * @since 0.1.0
390
+ * @category Lang
391
+ * @param {*} value The value to check.
392
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
393
+ * @example
394
+ *
395
+ * _.isObject({});
396
+ * // => true
397
+ *
398
+ * _.isObject([1, 2, 3]);
399
+ * // => true
400
+ *
401
+ * _.isObject(_.noop);
402
+ * // => true
403
+ *
404
+ * _.isObject(null);
405
+ * // => false
406
+ */
407
+ function isObject(value) {
408
+ var type = typeof value;
409
+ return value != null && (type == 'object' || type == 'function');
410
+ }
411
+
412
+ var isObject_1 = isObject;
413
+
414
+ /** `Object#toString` result references. */
415
+ var asyncTag = '[object AsyncFunction]',
416
+ funcTag$2 = '[object Function]',
417
+ genTag$1 = '[object GeneratorFunction]',
418
+ proxyTag = '[object Proxy]';
419
+
420
+ /**
421
+ * Checks if `value` is classified as a `Function` object.
422
+ *
423
+ * @static
424
+ * @memberOf _
425
+ * @since 0.1.0
426
+ * @category Lang
427
+ * @param {*} value The value to check.
428
+ * @returns {boolean} Returns `true` if `value` is a function, else `false`.
429
+ * @example
430
+ *
431
+ * _.isFunction(_);
432
+ * // => true
433
+ *
434
+ * _.isFunction(/abc/);
435
+ * // => false
436
+ */
437
+ function isFunction(value) {
438
+ if (!isObject_1(value)) {
439
+ return false;
440
+ }
441
+ // The use of `Object#toString` avoids issues with the `typeof` operator
442
+ // in Safari 9 which returns 'object' for typed arrays and other constructors.
443
+ var tag = _baseGetTag(value);
444
+ return tag == funcTag$2 || tag == genTag$1 || tag == asyncTag || tag == proxyTag;
445
+ }
446
+
447
+ var isFunction_1 = isFunction;
448
+
449
+ /** Used to detect overreaching core-js shims. */
450
+ var coreJsData = _root['__core-js_shared__'];
451
+
452
+ var _coreJsData = coreJsData;
453
+
454
+ /** Used to detect methods masquerading as native. */
455
+ var maskSrcKey = (function() {
456
+ var uid = /[^.]+$/.exec(_coreJsData && _coreJsData.keys && _coreJsData.keys.IE_PROTO || '');
457
+ return uid ? ('Symbol(src)_1.' + uid) : '';
458
+ }());
459
+
460
+ /**
461
+ * Checks if `func` has its source masked.
462
+ *
463
+ * @private
464
+ * @param {Function} func The function to check.
465
+ * @returns {boolean} Returns `true` if `func` is masked, else `false`.
466
+ */
467
+ function isMasked(func) {
468
+ return !!maskSrcKey && (maskSrcKey in func);
469
+ }
470
+
471
+ var _isMasked = isMasked;
472
+
473
+ /** Used for built-in method references. */
474
+ var funcProto$1 = Function.prototype;
475
+
476
+ /** Used to resolve the decompiled source of functions. */
477
+ var funcToString$1 = funcProto$1.toString;
478
+
479
+ /**
480
+ * Converts `func` to its source code.
481
+ *
482
+ * @private
483
+ * @param {Function} func The function to convert.
484
+ * @returns {string} Returns the source code.
485
+ */
486
+ function toSource(func) {
487
+ if (func != null) {
488
+ try {
489
+ return funcToString$1.call(func);
490
+ } catch (e) {}
491
+ try {
492
+ return (func + '');
493
+ } catch (e) {}
494
+ }
495
+ return '';
496
+ }
497
+
498
+ var _toSource = toSource;
499
+
500
+ /**
501
+ * Used to match `RegExp`
502
+ * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
503
+ */
504
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
505
+
506
+ /** Used to detect host constructors (Safari). */
507
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
508
+
509
+ /** Used for built-in method references. */
510
+ var funcProto = Function.prototype,
511
+ objectProto$a = Object.prototype;
512
+
513
+ /** Used to resolve the decompiled source of functions. */
514
+ var funcToString = funcProto.toString;
515
+
516
+ /** Used to check objects for own properties. */
517
+ var hasOwnProperty$8 = objectProto$a.hasOwnProperty;
518
+
519
+ /** Used to detect if a method is native. */
520
+ var reIsNative = RegExp('^' +
521
+ funcToString.call(hasOwnProperty$8).replace(reRegExpChar, '\\$&')
522
+ .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
523
+ );
524
+
525
+ /**
526
+ * The base implementation of `_.isNative` without bad shim checks.
527
+ *
528
+ * @private
529
+ * @param {*} value The value to check.
530
+ * @returns {boolean} Returns `true` if `value` is a native function,
531
+ * else `false`.
532
+ */
533
+ function baseIsNative(value) {
534
+ if (!isObject_1(value) || _isMasked(value)) {
535
+ return false;
536
+ }
537
+ var pattern = isFunction_1(value) ? reIsNative : reIsHostCtor;
538
+ return pattern.test(_toSource(value));
539
+ }
540
+
541
+ var _baseIsNative = baseIsNative;
542
+
543
+ /**
544
+ * Gets the value at `key` of `object`.
545
+ *
546
+ * @private
547
+ * @param {Object} [object] The object to query.
548
+ * @param {string} key The key of the property to get.
549
+ * @returns {*} Returns the property value.
550
+ */
551
+ function getValue(object, key) {
552
+ return object == null ? undefined : object[key];
553
+ }
554
+
555
+ var _getValue = getValue;
556
+
557
+ /**
558
+ * Gets the native function at `key` of `object`.
559
+ *
560
+ * @private
561
+ * @param {Object} object The object to query.
562
+ * @param {string} key The key of the method to get.
563
+ * @returns {*} Returns the function if it's native, else `undefined`.
564
+ */
565
+ function getNative(object, key) {
566
+ var value = _getValue(object, key);
567
+ return _baseIsNative(value) ? value : undefined;
568
+ }
569
+
570
+ var _getNative = getNative;
571
+
572
+ /* Built-in method references that are verified to be native. */
573
+ var Map = _getNative(_root, 'Map');
574
+
575
+ var _Map = Map;
576
+
577
+ /* Built-in method references that are verified to be native. */
578
+ var nativeCreate = _getNative(Object, 'create');
579
+
580
+ var _nativeCreate = nativeCreate;
581
+
582
+ /**
583
+ * Removes all key-value entries from the hash.
584
+ *
585
+ * @private
586
+ * @name clear
587
+ * @memberOf Hash
588
+ */
589
+ function hashClear() {
590
+ this.__data__ = _nativeCreate ? _nativeCreate(null) : {};
591
+ this.size = 0;
592
+ }
593
+
594
+ var _hashClear = hashClear;
595
+
596
+ /**
597
+ * Removes `key` and its value from the hash.
598
+ *
599
+ * @private
600
+ * @name delete
601
+ * @memberOf Hash
602
+ * @param {Object} hash The hash to modify.
603
+ * @param {string} key The key of the value to remove.
604
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
605
+ */
606
+ function hashDelete(key) {
607
+ var result = this.has(key) && delete this.__data__[key];
608
+ this.size -= result ? 1 : 0;
609
+ return result;
610
+ }
611
+
612
+ var _hashDelete = hashDelete;
613
+
614
+ /** Used to stand-in for `undefined` hash values. */
615
+ var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
616
+
617
+ /** Used for built-in method references. */
618
+ var objectProto$9 = Object.prototype;
619
+
620
+ /** Used to check objects for own properties. */
621
+ var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
622
+
623
+ /**
624
+ * Gets the hash value for `key`.
625
+ *
626
+ * @private
627
+ * @name get
628
+ * @memberOf Hash
629
+ * @param {string} key The key of the value to get.
630
+ * @returns {*} Returns the entry value.
631
+ */
632
+ function hashGet(key) {
633
+ var data = this.__data__;
634
+ if (_nativeCreate) {
635
+ var result = data[key];
636
+ return result === HASH_UNDEFINED$1 ? undefined : result;
637
+ }
638
+ return hasOwnProperty$7.call(data, key) ? data[key] : undefined;
639
+ }
640
+
641
+ var _hashGet = hashGet;
642
+
643
+ /** Used for built-in method references. */
644
+ var objectProto$8 = Object.prototype;
645
+
646
+ /** Used to check objects for own properties. */
647
+ var hasOwnProperty$6 = objectProto$8.hasOwnProperty;
648
+
649
+ /**
650
+ * Checks if a hash value for `key` exists.
651
+ *
652
+ * @private
653
+ * @name has
654
+ * @memberOf Hash
655
+ * @param {string} key The key of the entry to check.
656
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
657
+ */
658
+ function hashHas(key) {
659
+ var data = this.__data__;
660
+ return _nativeCreate ? (data[key] !== undefined) : hasOwnProperty$6.call(data, key);
661
+ }
662
+
663
+ var _hashHas = hashHas;
664
+
665
+ /** Used to stand-in for `undefined` hash values. */
666
+ var HASH_UNDEFINED = '__lodash_hash_undefined__';
667
+
668
+ /**
669
+ * Sets the hash `key` to `value`.
670
+ *
671
+ * @private
672
+ * @name set
673
+ * @memberOf Hash
674
+ * @param {string} key The key of the value to set.
675
+ * @param {*} value The value to set.
676
+ * @returns {Object} Returns the hash instance.
677
+ */
678
+ function hashSet(key, value) {
679
+ var data = this.__data__;
680
+ this.size += this.has(key) ? 0 : 1;
681
+ data[key] = (_nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
682
+ return this;
683
+ }
684
+
685
+ var _hashSet = hashSet;
686
+
687
+ /**
688
+ * Creates a hash object.
689
+ *
690
+ * @private
691
+ * @constructor
692
+ * @param {Array} [entries] The key-value pairs to cache.
693
+ */
694
+ function Hash(entries) {
695
+ var index = -1,
696
+ length = entries == null ? 0 : entries.length;
697
+
698
+ this.clear();
699
+ while (++index < length) {
700
+ var entry = entries[index];
701
+ this.set(entry[0], entry[1]);
702
+ }
703
+ }
704
+
705
+ // Add methods to `Hash`.
706
+ Hash.prototype.clear = _hashClear;
707
+ Hash.prototype['delete'] = _hashDelete;
708
+ Hash.prototype.get = _hashGet;
709
+ Hash.prototype.has = _hashHas;
710
+ Hash.prototype.set = _hashSet;
711
+
712
+ var _Hash = Hash;
713
+
714
+ /**
715
+ * Removes all key-value entries from the map.
716
+ *
717
+ * @private
718
+ * @name clear
719
+ * @memberOf MapCache
720
+ */
721
+ function mapCacheClear() {
722
+ this.size = 0;
723
+ this.__data__ = {
724
+ 'hash': new _Hash,
725
+ 'map': new (_Map || _ListCache),
726
+ 'string': new _Hash
727
+ };
728
+ }
729
+
730
+ var _mapCacheClear = mapCacheClear;
731
+
732
+ /**
733
+ * Checks if `value` is suitable for use as unique object key.
734
+ *
735
+ * @private
736
+ * @param {*} value The value to check.
737
+ * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
738
+ */
739
+ function isKeyable(value) {
740
+ var type = typeof value;
741
+ return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
742
+ ? (value !== '__proto__')
743
+ : (value === null);
744
+ }
745
+
746
+ var _isKeyable = isKeyable;
747
+
748
+ /**
749
+ * Gets the data for `map`.
750
+ *
751
+ * @private
752
+ * @param {Object} map The map to query.
753
+ * @param {string} key The reference key.
754
+ * @returns {*} Returns the map data.
755
+ */
756
+ function getMapData(map, key) {
757
+ var data = map.__data__;
758
+ return _isKeyable(key)
759
+ ? data[typeof key == 'string' ? 'string' : 'hash']
760
+ : data.map;
761
+ }
762
+
763
+ var _getMapData = getMapData;
764
+
765
+ /**
766
+ * Removes `key` and its value from the map.
767
+ *
768
+ * @private
769
+ * @name delete
770
+ * @memberOf MapCache
771
+ * @param {string} key The key of the value to remove.
772
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
773
+ */
774
+ function mapCacheDelete(key) {
775
+ var result = _getMapData(this, key)['delete'](key);
776
+ this.size -= result ? 1 : 0;
777
+ return result;
778
+ }
779
+
780
+ var _mapCacheDelete = mapCacheDelete;
781
+
782
+ /**
783
+ * Gets the map value for `key`.
784
+ *
785
+ * @private
786
+ * @name get
787
+ * @memberOf MapCache
788
+ * @param {string} key The key of the value to get.
789
+ * @returns {*} Returns the entry value.
790
+ */
791
+ function mapCacheGet(key) {
792
+ return _getMapData(this, key).get(key);
793
+ }
794
+
795
+ var _mapCacheGet = mapCacheGet;
796
+
797
+ /**
798
+ * Checks if a map value for `key` exists.
799
+ *
800
+ * @private
801
+ * @name has
802
+ * @memberOf MapCache
803
+ * @param {string} key The key of the entry to check.
804
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
805
+ */
806
+ function mapCacheHas(key) {
807
+ return _getMapData(this, key).has(key);
808
+ }
809
+
810
+ var _mapCacheHas = mapCacheHas;
811
+
812
+ /**
813
+ * Sets the map `key` to `value`.
814
+ *
815
+ * @private
816
+ * @name set
817
+ * @memberOf MapCache
818
+ * @param {string} key The key of the value to set.
819
+ * @param {*} value The value to set.
820
+ * @returns {Object} Returns the map cache instance.
821
+ */
822
+ function mapCacheSet(key, value) {
823
+ var data = _getMapData(this, key),
824
+ size = data.size;
825
+
826
+ data.set(key, value);
827
+ this.size += data.size == size ? 0 : 1;
828
+ return this;
829
+ }
830
+
831
+ var _mapCacheSet = mapCacheSet;
832
+
833
+ /**
834
+ * Creates a map cache object to store key-value pairs.
835
+ *
836
+ * @private
837
+ * @constructor
838
+ * @param {Array} [entries] The key-value pairs to cache.
839
+ */
840
+ function MapCache(entries) {
841
+ var index = -1,
842
+ length = entries == null ? 0 : entries.length;
843
+
844
+ this.clear();
845
+ while (++index < length) {
846
+ var entry = entries[index];
847
+ this.set(entry[0], entry[1]);
848
+ }
849
+ }
850
+
851
+ // Add methods to `MapCache`.
852
+ MapCache.prototype.clear = _mapCacheClear;
853
+ MapCache.prototype['delete'] = _mapCacheDelete;
854
+ MapCache.prototype.get = _mapCacheGet;
855
+ MapCache.prototype.has = _mapCacheHas;
856
+ MapCache.prototype.set = _mapCacheSet;
857
+
858
+ var _MapCache = MapCache;
859
+
860
+ /** Used as the size to enable large array optimizations. */
861
+ var LARGE_ARRAY_SIZE = 200;
862
+
863
+ /**
864
+ * Sets the stack `key` to `value`.
865
+ *
866
+ * @private
867
+ * @name set
868
+ * @memberOf Stack
869
+ * @param {string} key The key of the value to set.
870
+ * @param {*} value The value to set.
871
+ * @returns {Object} Returns the stack cache instance.
872
+ */
873
+ function stackSet(key, value) {
874
+ var data = this.__data__;
875
+ if (data instanceof _ListCache) {
876
+ var pairs = data.__data__;
877
+ if (!_Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
878
+ pairs.push([key, value]);
879
+ this.size = ++data.size;
880
+ return this;
881
+ }
882
+ data = this.__data__ = new _MapCache(pairs);
883
+ }
884
+ data.set(key, value);
885
+ this.size = data.size;
886
+ return this;
887
+ }
888
+
889
+ var _stackSet = stackSet;
890
+
891
+ /**
892
+ * Creates a stack cache object to store key-value pairs.
893
+ *
894
+ * @private
895
+ * @constructor
896
+ * @param {Array} [entries] The key-value pairs to cache.
897
+ */
898
+ function Stack(entries) {
899
+ var data = this.__data__ = new _ListCache(entries);
900
+ this.size = data.size;
901
+ }
902
+
903
+ // Add methods to `Stack`.
904
+ Stack.prototype.clear = _stackClear;
905
+ Stack.prototype['delete'] = _stackDelete;
906
+ Stack.prototype.get = _stackGet;
907
+ Stack.prototype.has = _stackHas;
908
+ Stack.prototype.set = _stackSet;
909
+
910
+ var _Stack = Stack;
911
+
912
+ /**
913
+ * A specialized version of `_.forEach` for arrays without support for
914
+ * iteratee shorthands.
915
+ *
916
+ * @private
917
+ * @param {Array} [array] The array to iterate over.
918
+ * @param {Function} iteratee The function invoked per iteration.
919
+ * @returns {Array} Returns `array`.
920
+ */
921
+ function arrayEach(array, iteratee) {
922
+ var index = -1,
923
+ length = array == null ? 0 : array.length;
924
+
925
+ while (++index < length) {
926
+ if (iteratee(array[index], index, array) === false) {
927
+ break;
928
+ }
929
+ }
930
+ return array;
931
+ }
932
+
933
+ var _arrayEach = arrayEach;
934
+
935
+ var defineProperty = (function() {
936
+ try {
937
+ var func = _getNative(Object, 'defineProperty');
938
+ func({}, '', {});
939
+ return func;
940
+ } catch (e) {}
941
+ }());
942
+
943
+ var _defineProperty = defineProperty;
944
+
945
+ /**
946
+ * The base implementation of `assignValue` and `assignMergeValue` without
947
+ * value checks.
948
+ *
949
+ * @private
950
+ * @param {Object} object The object to modify.
951
+ * @param {string} key The key of the property to assign.
952
+ * @param {*} value The value to assign.
953
+ */
954
+ function baseAssignValue(object, key, value) {
955
+ if (key == '__proto__' && _defineProperty) {
956
+ _defineProperty(object, key, {
957
+ 'configurable': true,
958
+ 'enumerable': true,
959
+ 'value': value,
960
+ 'writable': true
961
+ });
962
+ } else {
963
+ object[key] = value;
964
+ }
965
+ }
966
+
967
+ var _baseAssignValue = baseAssignValue;
968
+
969
+ /** Used for built-in method references. */
970
+ var objectProto$7 = Object.prototype;
971
+
972
+ /** Used to check objects for own properties. */
973
+ var hasOwnProperty$5 = objectProto$7.hasOwnProperty;
974
+
975
+ /**
976
+ * Assigns `value` to `key` of `object` if the existing value is not equivalent
977
+ * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
978
+ * for equality comparisons.
979
+ *
980
+ * @private
981
+ * @param {Object} object The object to modify.
982
+ * @param {string} key The key of the property to assign.
983
+ * @param {*} value The value to assign.
984
+ */
985
+ function assignValue(object, key, value) {
986
+ var objValue = object[key];
987
+ if (!(hasOwnProperty$5.call(object, key) && eq_1(objValue, value)) ||
988
+ (value === undefined && !(key in object))) {
989
+ _baseAssignValue(object, key, value);
990
+ }
991
+ }
992
+
993
+ var _assignValue = assignValue;
994
+
995
+ /**
996
+ * Copies properties of `source` to `object`.
997
+ *
998
+ * @private
999
+ * @param {Object} source The object to copy properties from.
1000
+ * @param {Array} props The property identifiers to copy.
1001
+ * @param {Object} [object={}] The object to copy properties to.
1002
+ * @param {Function} [customizer] The function to customize copied values.
1003
+ * @returns {Object} Returns `object`.
1004
+ */
1005
+ function copyObject(source, props, object, customizer) {
1006
+ var isNew = !object;
1007
+ object || (object = {});
1008
+
1009
+ var index = -1,
1010
+ length = props.length;
1011
+
1012
+ while (++index < length) {
1013
+ var key = props[index];
1014
+
1015
+ var newValue = customizer
1016
+ ? customizer(object[key], source[key], key, object, source)
1017
+ : undefined;
1018
+
1019
+ if (newValue === undefined) {
1020
+ newValue = source[key];
1021
+ }
1022
+ if (isNew) {
1023
+ _baseAssignValue(object, key, newValue);
1024
+ } else {
1025
+ _assignValue(object, key, newValue);
1026
+ }
1027
+ }
1028
+ return object;
1029
+ }
1030
+
1031
+ var _copyObject = copyObject;
1032
+
1033
+ /**
1034
+ * The base implementation of `_.times` without support for iteratee shorthands
1035
+ * or max array length checks.
1036
+ *
1037
+ * @private
1038
+ * @param {number} n The number of times to invoke `iteratee`.
1039
+ * @param {Function} iteratee The function invoked per iteration.
1040
+ * @returns {Array} Returns the array of results.
1041
+ */
1042
+ function baseTimes(n, iteratee) {
1043
+ var index = -1,
1044
+ result = Array(n);
1045
+
1046
+ while (++index < n) {
1047
+ result[index] = iteratee(index);
1048
+ }
1049
+ return result;
1050
+ }
1051
+
1052
+ var _baseTimes = baseTimes;
1053
+
1054
+ /**
1055
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
1056
+ * and has a `typeof` result of "object".
1057
+ *
1058
+ * @static
1059
+ * @memberOf _
1060
+ * @since 4.0.0
1061
+ * @category Lang
1062
+ * @param {*} value The value to check.
1063
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
1064
+ * @example
1065
+ *
1066
+ * _.isObjectLike({});
1067
+ * // => true
1068
+ *
1069
+ * _.isObjectLike([1, 2, 3]);
1070
+ * // => true
1071
+ *
1072
+ * _.isObjectLike(_.noop);
1073
+ * // => false
1074
+ *
1075
+ * _.isObjectLike(null);
1076
+ * // => false
1077
+ */
1078
+ function isObjectLike(value) {
1079
+ return value != null && typeof value == 'object';
1080
+ }
1081
+
1082
+ var isObjectLike_1 = isObjectLike;
1083
+
1084
+ /** `Object#toString` result references. */
1085
+ var argsTag$2 = '[object Arguments]';
1086
+
1087
+ /**
1088
+ * The base implementation of `_.isArguments`.
1089
+ *
1090
+ * @private
1091
+ * @param {*} value The value to check.
1092
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
1093
+ */
1094
+ function baseIsArguments(value) {
1095
+ return isObjectLike_1(value) && _baseGetTag(value) == argsTag$2;
1096
+ }
1097
+
1098
+ var _baseIsArguments = baseIsArguments;
1099
+
1100
+ /** Used for built-in method references. */
1101
+ var objectProto$6 = Object.prototype;
1102
+
1103
+ /** Used to check objects for own properties. */
1104
+ var hasOwnProperty$4 = objectProto$6.hasOwnProperty;
1105
+
1106
+ /** Built-in value references. */
1107
+ var propertyIsEnumerable$1 = objectProto$6.propertyIsEnumerable;
1108
+
1109
+ /**
1110
+ * Checks if `value` is likely an `arguments` object.
1111
+ *
1112
+ * @static
1113
+ * @memberOf _
1114
+ * @since 0.1.0
1115
+ * @category Lang
1116
+ * @param {*} value The value to check.
1117
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
1118
+ * else `false`.
1119
+ * @example
1120
+ *
1121
+ * _.isArguments(function() { return arguments; }());
1122
+ * // => true
1123
+ *
1124
+ * _.isArguments([1, 2, 3]);
1125
+ * // => false
1126
+ */
1127
+ var isArguments = _baseIsArguments(function() { return arguments; }()) ? _baseIsArguments : function(value) {
1128
+ return isObjectLike_1(value) && hasOwnProperty$4.call(value, 'callee') &&
1129
+ !propertyIsEnumerable$1.call(value, 'callee');
1130
+ };
1131
+
1132
+ var isArguments_1 = isArguments;
1133
+
1134
+ /**
1135
+ * Checks if `value` is classified as an `Array` object.
1136
+ *
1137
+ * @static
1138
+ * @memberOf _
1139
+ * @since 0.1.0
1140
+ * @category Lang
1141
+ * @param {*} value The value to check.
1142
+ * @returns {boolean} Returns `true` if `value` is an array, else `false`.
1143
+ * @example
1144
+ *
1145
+ * _.isArray([1, 2, 3]);
1146
+ * // => true
1147
+ *
1148
+ * _.isArray(document.body.children);
1149
+ * // => false
1150
+ *
1151
+ * _.isArray('abc');
1152
+ * // => false
1153
+ *
1154
+ * _.isArray(_.noop);
1155
+ * // => false
1156
+ */
1157
+ var isArray = Array.isArray;
1158
+
1159
+ var isArray_1 = isArray;
1160
+
1161
+ /**
1162
+ * This method returns `false`.
1163
+ *
1164
+ * @static
1165
+ * @memberOf _
1166
+ * @since 4.13.0
1167
+ * @category Util
1168
+ * @returns {boolean} Returns `false`.
1169
+ * @example
1170
+ *
1171
+ * _.times(2, _.stubFalse);
1172
+ * // => [false, false]
1173
+ */
1174
+ function stubFalse() {
1175
+ return false;
1176
+ }
1177
+
1178
+ var stubFalse_1 = stubFalse;
1179
+
1180
+ var isBuffer_1 = createCommonjsModule(function (module, exports) {
1181
+ /** Detect free variable `exports`. */
1182
+ var freeExports = exports && !exports.nodeType && exports;
1183
+
1184
+ /** Detect free variable `module`. */
1185
+ var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
1186
+
1187
+ /** Detect the popular CommonJS extension `module.exports`. */
1188
+ var moduleExports = freeModule && freeModule.exports === freeExports;
1189
+
1190
+ /** Built-in value references. */
1191
+ var Buffer = moduleExports ? _root.Buffer : undefined;
1192
+
1193
+ /* Built-in method references for those with the same name as other `lodash` methods. */
1194
+ var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
1195
+
1196
+ /**
1197
+ * Checks if `value` is a buffer.
1198
+ *
1199
+ * @static
1200
+ * @memberOf _
1201
+ * @since 4.3.0
1202
+ * @category Lang
1203
+ * @param {*} value The value to check.
1204
+ * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
1205
+ * @example
1206
+ *
1207
+ * _.isBuffer(new Buffer(2));
1208
+ * // => true
1209
+ *
1210
+ * _.isBuffer(new Uint8Array(2));
1211
+ * // => false
1212
+ */
1213
+ var isBuffer = nativeIsBuffer || stubFalse_1;
1214
+
1215
+ module.exports = isBuffer;
1216
+ });
1217
+
1218
+ /** Used as references for various `Number` constants. */
1219
+ var MAX_SAFE_INTEGER$1 = 9007199254740991;
1220
+
1221
+ /** Used to detect unsigned integer values. */
1222
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
1223
+
1224
+ /**
1225
+ * Checks if `value` is a valid array-like index.
1226
+ *
1227
+ * @private
1228
+ * @param {*} value The value to check.
1229
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
1230
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
1231
+ */
1232
+ function isIndex(value, length) {
1233
+ var type = typeof value;
1234
+ length = length == null ? MAX_SAFE_INTEGER$1 : length;
1235
+
1236
+ return !!length &&
1237
+ (type == 'number' ||
1238
+ (type != 'symbol' && reIsUint.test(value))) &&
1239
+ (value > -1 && value % 1 == 0 && value < length);
1240
+ }
1241
+
1242
+ var _isIndex = isIndex;
1243
+
1244
+ /** Used as references for various `Number` constants. */
1245
+ var MAX_SAFE_INTEGER = 9007199254740991;
1246
+
1247
+ /**
1248
+ * Checks if `value` is a valid array-like length.
1249
+ *
1250
+ * **Note:** This method is loosely based on
1251
+ * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
1252
+ *
1253
+ * @static
1254
+ * @memberOf _
1255
+ * @since 4.0.0
1256
+ * @category Lang
1257
+ * @param {*} value The value to check.
1258
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
1259
+ * @example
1260
+ *
1261
+ * _.isLength(3);
1262
+ * // => true
1263
+ *
1264
+ * _.isLength(Number.MIN_VALUE);
1265
+ * // => false
1266
+ *
1267
+ * _.isLength(Infinity);
1268
+ * // => false
1269
+ *
1270
+ * _.isLength('3');
1271
+ * // => false
1272
+ */
1273
+ function isLength(value) {
1274
+ return typeof value == 'number' &&
1275
+ value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
1276
+ }
1277
+
1278
+ var isLength_1 = isLength;
1279
+
1280
+ /** `Object#toString` result references. */
1281
+ var argsTag$1 = '[object Arguments]',
1282
+ arrayTag$1 = '[object Array]',
1283
+ boolTag$2 = '[object Boolean]',
1284
+ dateTag$2 = '[object Date]',
1285
+ errorTag$1 = '[object Error]',
1286
+ funcTag$1 = '[object Function]',
1287
+ mapTag$4 = '[object Map]',
1288
+ numberTag$2 = '[object Number]',
1289
+ objectTag$2 = '[object Object]',
1290
+ regexpTag$2 = '[object RegExp]',
1291
+ setTag$4 = '[object Set]',
1292
+ stringTag$2 = '[object String]',
1293
+ weakMapTag$2 = '[object WeakMap]';
1294
+
1295
+ var arrayBufferTag$2 = '[object ArrayBuffer]',
1296
+ dataViewTag$3 = '[object DataView]',
1297
+ float32Tag$2 = '[object Float32Array]',
1298
+ float64Tag$2 = '[object Float64Array]',
1299
+ int8Tag$2 = '[object Int8Array]',
1300
+ int16Tag$2 = '[object Int16Array]',
1301
+ int32Tag$2 = '[object Int32Array]',
1302
+ uint8Tag$2 = '[object Uint8Array]',
1303
+ uint8ClampedTag$2 = '[object Uint8ClampedArray]',
1304
+ uint16Tag$2 = '[object Uint16Array]',
1305
+ uint32Tag$2 = '[object Uint32Array]';
1306
+
1307
+ /** Used to identify `toStringTag` values of typed arrays. */
1308
+ var typedArrayTags = {};
1309
+ typedArrayTags[float32Tag$2] = typedArrayTags[float64Tag$2] =
1310
+ typedArrayTags[int8Tag$2] = typedArrayTags[int16Tag$2] =
1311
+ typedArrayTags[int32Tag$2] = typedArrayTags[uint8Tag$2] =
1312
+ typedArrayTags[uint8ClampedTag$2] = typedArrayTags[uint16Tag$2] =
1313
+ typedArrayTags[uint32Tag$2] = true;
1314
+ typedArrayTags[argsTag$1] = typedArrayTags[arrayTag$1] =
1315
+ typedArrayTags[arrayBufferTag$2] = typedArrayTags[boolTag$2] =
1316
+ typedArrayTags[dataViewTag$3] = typedArrayTags[dateTag$2] =
1317
+ typedArrayTags[errorTag$1] = typedArrayTags[funcTag$1] =
1318
+ typedArrayTags[mapTag$4] = typedArrayTags[numberTag$2] =
1319
+ typedArrayTags[objectTag$2] = typedArrayTags[regexpTag$2] =
1320
+ typedArrayTags[setTag$4] = typedArrayTags[stringTag$2] =
1321
+ typedArrayTags[weakMapTag$2] = false;
1322
+
1323
+ /**
1324
+ * The base implementation of `_.isTypedArray` without Node.js optimizations.
1325
+ *
1326
+ * @private
1327
+ * @param {*} value The value to check.
1328
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
1329
+ */
1330
+ function baseIsTypedArray(value) {
1331
+ return isObjectLike_1(value) &&
1332
+ isLength_1(value.length) && !!typedArrayTags[_baseGetTag(value)];
1333
+ }
1334
+
1335
+ var _baseIsTypedArray = baseIsTypedArray;
1336
+
1337
+ /**
1338
+ * The base implementation of `_.unary` without support for storing metadata.
1339
+ *
1340
+ * @private
1341
+ * @param {Function} func The function to cap arguments for.
1342
+ * @returns {Function} Returns the new capped function.
1343
+ */
1344
+ function baseUnary(func) {
1345
+ return function(value) {
1346
+ return func(value);
1347
+ };
1348
+ }
1349
+
1350
+ var _baseUnary = baseUnary;
1351
+
1352
+ var _nodeUtil = createCommonjsModule(function (module, exports) {
1353
+ /** Detect free variable `exports`. */
1354
+ var freeExports = exports && !exports.nodeType && exports;
1355
+
1356
+ /** Detect free variable `module`. */
1357
+ var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
1358
+
1359
+ /** Detect the popular CommonJS extension `module.exports`. */
1360
+ var moduleExports = freeModule && freeModule.exports === freeExports;
1361
+
1362
+ /** Detect free variable `process` from Node.js. */
1363
+ var freeProcess = moduleExports && _freeGlobal.process;
1364
+
1365
+ /** Used to access faster Node.js helpers. */
1366
+ var nodeUtil = (function() {
1367
+ try {
1368
+ // Use `util.types` for Node.js 10+.
1369
+ var types = freeModule && freeModule.require && freeModule.require('util').types;
1370
+
1371
+ if (types) {
1372
+ return types;
1373
+ }
1374
+
1375
+ // Legacy `process.binding('util')` for Node.js < 10.
1376
+ return freeProcess && freeProcess.binding && freeProcess.binding('util');
1377
+ } catch (e) {}
1378
+ }());
1379
+
1380
+ module.exports = nodeUtil;
1381
+ });
1382
+
1383
+ /* Node.js helper references. */
1384
+ var nodeIsTypedArray = _nodeUtil && _nodeUtil.isTypedArray;
1385
+
1386
+ /**
1387
+ * Checks if `value` is classified as a typed array.
1388
+ *
1389
+ * @static
1390
+ * @memberOf _
1391
+ * @since 3.0.0
1392
+ * @category Lang
1393
+ * @param {*} value The value to check.
1394
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
1395
+ * @example
1396
+ *
1397
+ * _.isTypedArray(new Uint8Array);
1398
+ * // => true
1399
+ *
1400
+ * _.isTypedArray([]);
1401
+ * // => false
1402
+ */
1403
+ var isTypedArray = nodeIsTypedArray ? _baseUnary(nodeIsTypedArray) : _baseIsTypedArray;
1404
+
1405
+ var isTypedArray_1 = isTypedArray;
1406
+
1407
+ /** Used for built-in method references. */
1408
+ var objectProto$5 = Object.prototype;
1409
+
1410
+ /** Used to check objects for own properties. */
1411
+ var hasOwnProperty$3 = objectProto$5.hasOwnProperty;
1412
+
1413
+ /**
1414
+ * Creates an array of the enumerable property names of the array-like `value`.
1415
+ *
1416
+ * @private
1417
+ * @param {*} value The value to query.
1418
+ * @param {boolean} inherited Specify returning inherited property names.
1419
+ * @returns {Array} Returns the array of property names.
1420
+ */
1421
+ function arrayLikeKeys(value, inherited) {
1422
+ var isArr = isArray_1(value),
1423
+ isArg = !isArr && isArguments_1(value),
1424
+ isBuff = !isArr && !isArg && isBuffer_1(value),
1425
+ isType = !isArr && !isArg && !isBuff && isTypedArray_1(value),
1426
+ skipIndexes = isArr || isArg || isBuff || isType,
1427
+ result = skipIndexes ? _baseTimes(value.length, String) : [],
1428
+ length = result.length;
1429
+
1430
+ for (var key in value) {
1431
+ if ((inherited || hasOwnProperty$3.call(value, key)) &&
1432
+ !(skipIndexes && (
1433
+ // Safari 9 has enumerable `arguments.length` in strict mode.
1434
+ key == 'length' ||
1435
+ // Node.js 0.10 has enumerable non-index properties on buffers.
1436
+ (isBuff && (key == 'offset' || key == 'parent')) ||
1437
+ // PhantomJS 2 has enumerable non-index properties on typed arrays.
1438
+ (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
1439
+ // Skip index properties.
1440
+ _isIndex(key, length)
1441
+ ))) {
1442
+ result.push(key);
1443
+ }
1444
+ }
1445
+ return result;
1446
+ }
1447
+
1448
+ var _arrayLikeKeys = arrayLikeKeys;
1449
+
1450
+ /** Used for built-in method references. */
1451
+ var objectProto$4 = Object.prototype;
1452
+
1453
+ /**
1454
+ * Checks if `value` is likely a prototype object.
1455
+ *
1456
+ * @private
1457
+ * @param {*} value The value to check.
1458
+ * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
1459
+ */
1460
+ function isPrototype(value) {
1461
+ var Ctor = value && value.constructor,
1462
+ proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$4;
1463
+
1464
+ return value === proto;
1465
+ }
1466
+
1467
+ var _isPrototype = isPrototype;
1468
+
1469
+ /**
1470
+ * Creates a unary function that invokes `func` with its argument transformed.
1471
+ *
1472
+ * @private
1473
+ * @param {Function} func The function to wrap.
1474
+ * @param {Function} transform The argument transform.
1475
+ * @returns {Function} Returns the new function.
1476
+ */
1477
+ function overArg(func, transform) {
1478
+ return function(arg) {
1479
+ return func(transform(arg));
1480
+ };
1481
+ }
1482
+
1483
+ var _overArg = overArg;
1484
+
1485
+ /* Built-in method references for those with the same name as other `lodash` methods. */
1486
+ var nativeKeys = _overArg(Object.keys, Object);
1487
+
1488
+ var _nativeKeys = nativeKeys;
1489
+
1490
+ /** Used for built-in method references. */
1491
+ var objectProto$3 = Object.prototype;
1492
+
1493
+ /** Used to check objects for own properties. */
1494
+ var hasOwnProperty$2 = objectProto$3.hasOwnProperty;
1495
+
1496
+ /**
1497
+ * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
1498
+ *
1499
+ * @private
1500
+ * @param {Object} object The object to query.
1501
+ * @returns {Array} Returns the array of property names.
1502
+ */
1503
+ function baseKeys(object) {
1504
+ if (!_isPrototype(object)) {
1505
+ return _nativeKeys(object);
1506
+ }
1507
+ var result = [];
1508
+ for (var key in Object(object)) {
1509
+ if (hasOwnProperty$2.call(object, key) && key != 'constructor') {
1510
+ result.push(key);
1511
+ }
1512
+ }
1513
+ return result;
1514
+ }
1515
+
1516
+ var _baseKeys = baseKeys;
1517
+
1518
+ /**
1519
+ * Checks if `value` is array-like. A value is considered array-like if it's
1520
+ * not a function and has a `value.length` that's an integer greater than or
1521
+ * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
1522
+ *
1523
+ * @static
1524
+ * @memberOf _
1525
+ * @since 4.0.0
1526
+ * @category Lang
1527
+ * @param {*} value The value to check.
1528
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
1529
+ * @example
1530
+ *
1531
+ * _.isArrayLike([1, 2, 3]);
1532
+ * // => true
1533
+ *
1534
+ * _.isArrayLike(document.body.children);
1535
+ * // => true
1536
+ *
1537
+ * _.isArrayLike('abc');
1538
+ * // => true
1539
+ *
1540
+ * _.isArrayLike(_.noop);
1541
+ * // => false
1542
+ */
1543
+ function isArrayLike(value) {
1544
+ return value != null && isLength_1(value.length) && !isFunction_1(value);
1545
+ }
1546
+
1547
+ var isArrayLike_1 = isArrayLike;
1548
+
1549
+ /**
1550
+ * Creates an array of the own enumerable property names of `object`.
1551
+ *
1552
+ * **Note:** Non-object values are coerced to objects. See the
1553
+ * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
1554
+ * for more details.
1555
+ *
1556
+ * @static
1557
+ * @since 0.1.0
1558
+ * @memberOf _
1559
+ * @category Object
1560
+ * @param {Object} object The object to query.
1561
+ * @returns {Array} Returns the array of property names.
1562
+ * @example
1563
+ *
1564
+ * function Foo() {
1565
+ * this.a = 1;
1566
+ * this.b = 2;
1567
+ * }
1568
+ *
1569
+ * Foo.prototype.c = 3;
1570
+ *
1571
+ * _.keys(new Foo);
1572
+ * // => ['a', 'b'] (iteration order is not guaranteed)
1573
+ *
1574
+ * _.keys('hi');
1575
+ * // => ['0', '1']
1576
+ */
1577
+ function keys(object) {
1578
+ return isArrayLike_1(object) ? _arrayLikeKeys(object) : _baseKeys(object);
1579
+ }
1580
+
1581
+ var keys_1 = keys;
1582
+
1583
+ /**
1584
+ * The base implementation of `_.assign` without support for multiple sources
1585
+ * or `customizer` functions.
1586
+ *
1587
+ * @private
1588
+ * @param {Object} object The destination object.
1589
+ * @param {Object} source The source object.
1590
+ * @returns {Object} Returns `object`.
1591
+ */
1592
+ function baseAssign(object, source) {
1593
+ return object && _copyObject(source, keys_1(source), object);
1594
+ }
1595
+
1596
+ var _baseAssign = baseAssign;
1597
+
1598
+ /**
1599
+ * This function is like
1600
+ * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
1601
+ * except that it includes inherited enumerable properties.
1602
+ *
1603
+ * @private
1604
+ * @param {Object} object The object to query.
1605
+ * @returns {Array} Returns the array of property names.
1606
+ */
1607
+ function nativeKeysIn(object) {
1608
+ var result = [];
1609
+ if (object != null) {
1610
+ for (var key in Object(object)) {
1611
+ result.push(key);
1612
+ }
1613
+ }
1614
+ return result;
1615
+ }
1616
+
1617
+ var _nativeKeysIn = nativeKeysIn;
1618
+
1619
+ /** Used for built-in method references. */
1620
+ var objectProto$2 = Object.prototype;
1621
+
1622
+ /** Used to check objects for own properties. */
1623
+ var hasOwnProperty$1 = objectProto$2.hasOwnProperty;
1624
+
1625
+ /**
1626
+ * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
1627
+ *
1628
+ * @private
1629
+ * @param {Object} object The object to query.
1630
+ * @returns {Array} Returns the array of property names.
1631
+ */
1632
+ function baseKeysIn(object) {
1633
+ if (!isObject_1(object)) {
1634
+ return _nativeKeysIn(object);
1635
+ }
1636
+ var isProto = _isPrototype(object),
1637
+ result = [];
1638
+
1639
+ for (var key in object) {
1640
+ if (!(key == 'constructor' && (isProto || !hasOwnProperty$1.call(object, key)))) {
1641
+ result.push(key);
1642
+ }
1643
+ }
1644
+ return result;
1645
+ }
1646
+
1647
+ var _baseKeysIn = baseKeysIn;
1648
+
1649
+ /**
1650
+ * Creates an array of the own and inherited enumerable property names of `object`.
1651
+ *
1652
+ * **Note:** Non-object values are coerced to objects.
1653
+ *
1654
+ * @static
1655
+ * @memberOf _
1656
+ * @since 3.0.0
1657
+ * @category Object
1658
+ * @param {Object} object The object to query.
1659
+ * @returns {Array} Returns the array of property names.
1660
+ * @example
1661
+ *
1662
+ * function Foo() {
1663
+ * this.a = 1;
1664
+ * this.b = 2;
1665
+ * }
1666
+ *
1667
+ * Foo.prototype.c = 3;
1668
+ *
1669
+ * _.keysIn(new Foo);
1670
+ * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
1671
+ */
1672
+ function keysIn(object) {
1673
+ return isArrayLike_1(object) ? _arrayLikeKeys(object, true) : _baseKeysIn(object);
1674
+ }
1675
+
1676
+ var keysIn_1 = keysIn;
1677
+
1678
+ /**
1679
+ * The base implementation of `_.assignIn` without support for multiple sources
1680
+ * or `customizer` functions.
1681
+ *
1682
+ * @private
1683
+ * @param {Object} object The destination object.
1684
+ * @param {Object} source The source object.
1685
+ * @returns {Object} Returns `object`.
1686
+ */
1687
+ function baseAssignIn(object, source) {
1688
+ return object && _copyObject(source, keysIn_1(source), object);
1689
+ }
1690
+
1691
+ var _baseAssignIn = baseAssignIn;
1692
+
1693
+ var _cloneBuffer = createCommonjsModule(function (module, exports) {
1694
+ /** Detect free variable `exports`. */
1695
+ var freeExports = exports && !exports.nodeType && exports;
1696
+
1697
+ /** Detect free variable `module`. */
1698
+ var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
1699
+
1700
+ /** Detect the popular CommonJS extension `module.exports`. */
1701
+ var moduleExports = freeModule && freeModule.exports === freeExports;
1702
+
1703
+ /** Built-in value references. */
1704
+ var Buffer = moduleExports ? _root.Buffer : undefined,
1705
+ allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
1706
+
1707
+ /**
1708
+ * Creates a clone of `buffer`.
1709
+ *
1710
+ * @private
1711
+ * @param {Buffer} buffer The buffer to clone.
1712
+ * @param {boolean} [isDeep] Specify a deep clone.
1713
+ * @returns {Buffer} Returns the cloned buffer.
1714
+ */
1715
+ function cloneBuffer(buffer, isDeep) {
1716
+ if (isDeep) {
1717
+ return buffer.slice();
1718
+ }
1719
+ var length = buffer.length,
1720
+ result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
1721
+
1722
+ buffer.copy(result);
1723
+ return result;
1724
+ }
1725
+
1726
+ module.exports = cloneBuffer;
1727
+ });
1728
+
1729
+ /**
1730
+ * Copies the values of `source` to `array`.
1731
+ *
1732
+ * @private
1733
+ * @param {Array} source The array to copy values from.
1734
+ * @param {Array} [array=[]] The array to copy values to.
1735
+ * @returns {Array} Returns `array`.
1736
+ */
1737
+ function copyArray(source, array) {
1738
+ var index = -1,
1739
+ length = source.length;
1740
+
1741
+ array || (array = Array(length));
1742
+ while (++index < length) {
1743
+ array[index] = source[index];
1744
+ }
1745
+ return array;
1746
+ }
1747
+
1748
+ var _copyArray = copyArray;
1749
+
1750
+ /**
1751
+ * A specialized version of `_.filter` for arrays without support for
1752
+ * iteratee shorthands.
1753
+ *
1754
+ * @private
1755
+ * @param {Array} [array] The array to iterate over.
1756
+ * @param {Function} predicate The function invoked per iteration.
1757
+ * @returns {Array} Returns the new filtered array.
1758
+ */
1759
+ function arrayFilter(array, predicate) {
1760
+ var index = -1,
1761
+ length = array == null ? 0 : array.length,
1762
+ resIndex = 0,
1763
+ result = [];
1764
+
1765
+ while (++index < length) {
1766
+ var value = array[index];
1767
+ if (predicate(value, index, array)) {
1768
+ result[resIndex++] = value;
1769
+ }
1770
+ }
1771
+ return result;
1772
+ }
1773
+
1774
+ var _arrayFilter = arrayFilter;
1775
+
1776
+ /**
1777
+ * This method returns a new empty array.
1778
+ *
1779
+ * @static
1780
+ * @memberOf _
1781
+ * @since 4.13.0
1782
+ * @category Util
1783
+ * @returns {Array} Returns the new empty array.
1784
+ * @example
1785
+ *
1786
+ * var arrays = _.times(2, _.stubArray);
1787
+ *
1788
+ * console.log(arrays);
1789
+ * // => [[], []]
1790
+ *
1791
+ * console.log(arrays[0] === arrays[1]);
1792
+ * // => false
1793
+ */
1794
+ function stubArray() {
1795
+ return [];
1796
+ }
1797
+
1798
+ var stubArray_1 = stubArray;
1799
+
1800
+ /** Used for built-in method references. */
1801
+ var objectProto$1 = Object.prototype;
1802
+
1803
+ /** Built-in value references. */
1804
+ var propertyIsEnumerable = objectProto$1.propertyIsEnumerable;
1805
+
1806
+ /* Built-in method references for those with the same name as other `lodash` methods. */
1807
+ var nativeGetSymbols$1 = Object.getOwnPropertySymbols;
1808
+
1809
+ /**
1810
+ * Creates an array of the own enumerable symbols of `object`.
1811
+ *
1812
+ * @private
1813
+ * @param {Object} object The object to query.
1814
+ * @returns {Array} Returns the array of symbols.
1815
+ */
1816
+ var getSymbols = !nativeGetSymbols$1 ? stubArray_1 : function(object) {
1817
+ if (object == null) {
1818
+ return [];
1819
+ }
1820
+ object = Object(object);
1821
+ return _arrayFilter(nativeGetSymbols$1(object), function(symbol) {
1822
+ return propertyIsEnumerable.call(object, symbol);
1823
+ });
1824
+ };
1825
+
1826
+ var _getSymbols = getSymbols;
1827
+
1828
+ /**
1829
+ * Copies own symbols of `source` to `object`.
1830
+ *
1831
+ * @private
1832
+ * @param {Object} source The object to copy symbols from.
1833
+ * @param {Object} [object={}] The object to copy symbols to.
1834
+ * @returns {Object} Returns `object`.
1835
+ */
1836
+ function copySymbols(source, object) {
1837
+ return _copyObject(source, _getSymbols(source), object);
1838
+ }
1839
+
1840
+ var _copySymbols = copySymbols;
1841
+
1842
+ /**
1843
+ * Appends the elements of `values` to `array`.
1844
+ *
1845
+ * @private
1846
+ * @param {Array} array The array to modify.
1847
+ * @param {Array} values The values to append.
1848
+ * @returns {Array} Returns `array`.
1849
+ */
1850
+ function arrayPush(array, values) {
1851
+ var index = -1,
1852
+ length = values.length,
1853
+ offset = array.length;
1854
+
1855
+ while (++index < length) {
1856
+ array[offset + index] = values[index];
1857
+ }
1858
+ return array;
1859
+ }
1860
+
1861
+ var _arrayPush = arrayPush;
1862
+
1863
+ /** Built-in value references. */
1864
+ var getPrototype = _overArg(Object.getPrototypeOf, Object);
1865
+
1866
+ var _getPrototype = getPrototype;
1867
+
1868
+ /* Built-in method references for those with the same name as other `lodash` methods. */
1869
+ var nativeGetSymbols = Object.getOwnPropertySymbols;
1870
+
1871
+ /**
1872
+ * Creates an array of the own and inherited enumerable symbols of `object`.
1873
+ *
1874
+ * @private
1875
+ * @param {Object} object The object to query.
1876
+ * @returns {Array} Returns the array of symbols.
1877
+ */
1878
+ var getSymbolsIn = !nativeGetSymbols ? stubArray_1 : function(object) {
1879
+ var result = [];
1880
+ while (object) {
1881
+ _arrayPush(result, _getSymbols(object));
1882
+ object = _getPrototype(object);
1883
+ }
1884
+ return result;
1885
+ };
1886
+
1887
+ var _getSymbolsIn = getSymbolsIn;
1888
+
1889
+ /**
1890
+ * Copies own and inherited symbols of `source` to `object`.
1891
+ *
1892
+ * @private
1893
+ * @param {Object} source The object to copy symbols from.
1894
+ * @param {Object} [object={}] The object to copy symbols to.
1895
+ * @returns {Object} Returns `object`.
1896
+ */
1897
+ function copySymbolsIn(source, object) {
1898
+ return _copyObject(source, _getSymbolsIn(source), object);
1899
+ }
1900
+
1901
+ var _copySymbolsIn = copySymbolsIn;
1902
+
1903
+ /**
1904
+ * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
1905
+ * `keysFunc` and `symbolsFunc` to get the enumerable property names and
1906
+ * symbols of `object`.
1907
+ *
1908
+ * @private
1909
+ * @param {Object} object The object to query.
1910
+ * @param {Function} keysFunc The function to get the keys of `object`.
1911
+ * @param {Function} symbolsFunc The function to get the symbols of `object`.
1912
+ * @returns {Array} Returns the array of property names and symbols.
1913
+ */
1914
+ function baseGetAllKeys(object, keysFunc, symbolsFunc) {
1915
+ var result = keysFunc(object);
1916
+ return isArray_1(object) ? result : _arrayPush(result, symbolsFunc(object));
1917
+ }
1918
+
1919
+ var _baseGetAllKeys = baseGetAllKeys;
1920
+
1921
+ /**
1922
+ * Creates an array of own enumerable property names and symbols of `object`.
1923
+ *
1924
+ * @private
1925
+ * @param {Object} object The object to query.
1926
+ * @returns {Array} Returns the array of property names and symbols.
1927
+ */
1928
+ function getAllKeys(object) {
1929
+ return _baseGetAllKeys(object, keys_1, _getSymbols);
1930
+ }
1931
+
1932
+ var _getAllKeys = getAllKeys;
1933
+
1934
+ /**
1935
+ * Creates an array of own and inherited enumerable property names and
1936
+ * symbols of `object`.
1937
+ *
1938
+ * @private
1939
+ * @param {Object} object The object to query.
1940
+ * @returns {Array} Returns the array of property names and symbols.
1941
+ */
1942
+ function getAllKeysIn(object) {
1943
+ return _baseGetAllKeys(object, keysIn_1, _getSymbolsIn);
1944
+ }
1945
+
1946
+ var _getAllKeysIn = getAllKeysIn;
1947
+
1948
+ /* Built-in method references that are verified to be native. */
1949
+ var DataView = _getNative(_root, 'DataView');
1950
+
1951
+ var _DataView = DataView;
1952
+
1953
+ /* Built-in method references that are verified to be native. */
1954
+ var Promise$1 = _getNative(_root, 'Promise');
1955
+
1956
+ var _Promise = Promise$1;
1957
+
1958
+ /* Built-in method references that are verified to be native. */
1959
+ var Set = _getNative(_root, 'Set');
1960
+
1961
+ var _Set = Set;
1962
+
1963
+ /* Built-in method references that are verified to be native. */
1964
+ var WeakMap = _getNative(_root, 'WeakMap');
1965
+
1966
+ var _WeakMap = WeakMap;
1967
+
1968
+ /** `Object#toString` result references. */
1969
+ var mapTag$3 = '[object Map]',
1970
+ objectTag$1 = '[object Object]',
1971
+ promiseTag = '[object Promise]',
1972
+ setTag$3 = '[object Set]',
1973
+ weakMapTag$1 = '[object WeakMap]';
1974
+
1975
+ var dataViewTag$2 = '[object DataView]';
1976
+
1977
+ /** Used to detect maps, sets, and weakmaps. */
1978
+ var dataViewCtorString = _toSource(_DataView),
1979
+ mapCtorString = _toSource(_Map),
1980
+ promiseCtorString = _toSource(_Promise),
1981
+ setCtorString = _toSource(_Set),
1982
+ weakMapCtorString = _toSource(_WeakMap);
1983
+
1984
+ /**
1985
+ * Gets the `toStringTag` of `value`.
1986
+ *
1987
+ * @private
1988
+ * @param {*} value The value to query.
1989
+ * @returns {string} Returns the `toStringTag`.
1990
+ */
1991
+ var getTag = _baseGetTag;
1992
+
1993
+ // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
1994
+ if ((_DataView && getTag(new _DataView(new ArrayBuffer(1))) != dataViewTag$2) ||
1995
+ (_Map && getTag(new _Map) != mapTag$3) ||
1996
+ (_Promise && getTag(_Promise.resolve()) != promiseTag) ||
1997
+ (_Set && getTag(new _Set) != setTag$3) ||
1998
+ (_WeakMap && getTag(new _WeakMap) != weakMapTag$1)) {
1999
+ getTag = function(value) {
2000
+ var result = _baseGetTag(value),
2001
+ Ctor = result == objectTag$1 ? value.constructor : undefined,
2002
+ ctorString = Ctor ? _toSource(Ctor) : '';
2003
+
2004
+ if (ctorString) {
2005
+ switch (ctorString) {
2006
+ case dataViewCtorString: return dataViewTag$2;
2007
+ case mapCtorString: return mapTag$3;
2008
+ case promiseCtorString: return promiseTag;
2009
+ case setCtorString: return setTag$3;
2010
+ case weakMapCtorString: return weakMapTag$1;
50
2011
  }
51
- /**
52
- * Retrieves a specific setting
53
- *
54
- * @param {string} groupName
55
- * @param {*} setting
56
- */
57
- get(groupName, settingName) {
58
- const group = this.getGroup(groupName) || {};
59
- return group[settingName];
2012
+ }
2013
+ return result;
2014
+ };
2015
+ }
2016
+
2017
+ var _getTag = getTag;
2018
+
2019
+ /** Used for built-in method references. */
2020
+ var objectProto = Object.prototype;
2021
+
2022
+ /** Used to check objects for own properties. */
2023
+ var hasOwnProperty = objectProto.hasOwnProperty;
2024
+
2025
+ /**
2026
+ * Initializes an array clone.
2027
+ *
2028
+ * @private
2029
+ * @param {Array} array The array to clone.
2030
+ * @returns {Array} Returns the initialized clone.
2031
+ */
2032
+ function initCloneArray(array) {
2033
+ var length = array.length,
2034
+ result = new array.constructor(length);
2035
+
2036
+ // Add properties assigned by `RegExp#exec`.
2037
+ if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
2038
+ result.index = array.index;
2039
+ result.input = array.input;
2040
+ }
2041
+ return result;
2042
+ }
2043
+
2044
+ var _initCloneArray = initCloneArray;
2045
+
2046
+ /** Built-in value references. */
2047
+ var Uint8Array = _root.Uint8Array;
2048
+
2049
+ var _Uint8Array = Uint8Array;
2050
+
2051
+ /**
2052
+ * Creates a clone of `arrayBuffer`.
2053
+ *
2054
+ * @private
2055
+ * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
2056
+ * @returns {ArrayBuffer} Returns the cloned array buffer.
2057
+ */
2058
+ function cloneArrayBuffer(arrayBuffer) {
2059
+ var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
2060
+ new _Uint8Array(result).set(new _Uint8Array(arrayBuffer));
2061
+ return result;
2062
+ }
2063
+
2064
+ var _cloneArrayBuffer = cloneArrayBuffer;
2065
+
2066
+ /**
2067
+ * Creates a clone of `dataView`.
2068
+ *
2069
+ * @private
2070
+ * @param {Object} dataView The data view to clone.
2071
+ * @param {boolean} [isDeep] Specify a deep clone.
2072
+ * @returns {Object} Returns the cloned data view.
2073
+ */
2074
+ function cloneDataView(dataView, isDeep) {
2075
+ var buffer = isDeep ? _cloneArrayBuffer(dataView.buffer) : dataView.buffer;
2076
+ return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
2077
+ }
2078
+
2079
+ var _cloneDataView = cloneDataView;
2080
+
2081
+ /** Used to match `RegExp` flags from their coerced string values. */
2082
+ var reFlags = /\w*$/;
2083
+
2084
+ /**
2085
+ * Creates a clone of `regexp`.
2086
+ *
2087
+ * @private
2088
+ * @param {Object} regexp The regexp to clone.
2089
+ * @returns {Object} Returns the cloned regexp.
2090
+ */
2091
+ function cloneRegExp(regexp) {
2092
+ var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
2093
+ result.lastIndex = regexp.lastIndex;
2094
+ return result;
2095
+ }
2096
+
2097
+ var _cloneRegExp = cloneRegExp;
2098
+
2099
+ /** Used to convert symbols to primitives and strings. */
2100
+ var symbolProto = _Symbol ? _Symbol.prototype : undefined,
2101
+ symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
2102
+
2103
+ /**
2104
+ * Creates a clone of the `symbol` object.
2105
+ *
2106
+ * @private
2107
+ * @param {Object} symbol The symbol object to clone.
2108
+ * @returns {Object} Returns the cloned symbol object.
2109
+ */
2110
+ function cloneSymbol(symbol) {
2111
+ return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
2112
+ }
2113
+
2114
+ var _cloneSymbol = cloneSymbol;
2115
+
2116
+ /**
2117
+ * Creates a clone of `typedArray`.
2118
+ *
2119
+ * @private
2120
+ * @param {Object} typedArray The typed array to clone.
2121
+ * @param {boolean} [isDeep] Specify a deep clone.
2122
+ * @returns {Object} Returns the cloned typed array.
2123
+ */
2124
+ function cloneTypedArray(typedArray, isDeep) {
2125
+ var buffer = isDeep ? _cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
2126
+ return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
2127
+ }
2128
+
2129
+ var _cloneTypedArray = cloneTypedArray;
2130
+
2131
+ /** `Object#toString` result references. */
2132
+ var boolTag$1 = '[object Boolean]',
2133
+ dateTag$1 = '[object Date]',
2134
+ mapTag$2 = '[object Map]',
2135
+ numberTag$1 = '[object Number]',
2136
+ regexpTag$1 = '[object RegExp]',
2137
+ setTag$2 = '[object Set]',
2138
+ stringTag$1 = '[object String]',
2139
+ symbolTag$1 = '[object Symbol]';
2140
+
2141
+ var arrayBufferTag$1 = '[object ArrayBuffer]',
2142
+ dataViewTag$1 = '[object DataView]',
2143
+ float32Tag$1 = '[object Float32Array]',
2144
+ float64Tag$1 = '[object Float64Array]',
2145
+ int8Tag$1 = '[object Int8Array]',
2146
+ int16Tag$1 = '[object Int16Array]',
2147
+ int32Tag$1 = '[object Int32Array]',
2148
+ uint8Tag$1 = '[object Uint8Array]',
2149
+ uint8ClampedTag$1 = '[object Uint8ClampedArray]',
2150
+ uint16Tag$1 = '[object Uint16Array]',
2151
+ uint32Tag$1 = '[object Uint32Array]';
2152
+
2153
+ /**
2154
+ * Initializes an object clone based on its `toStringTag`.
2155
+ *
2156
+ * **Note:** This function only supports cloning values with tags of
2157
+ * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
2158
+ *
2159
+ * @private
2160
+ * @param {Object} object The object to clone.
2161
+ * @param {string} tag The `toStringTag` of the object to clone.
2162
+ * @param {boolean} [isDeep] Specify a deep clone.
2163
+ * @returns {Object} Returns the initialized clone.
2164
+ */
2165
+ function initCloneByTag(object, tag, isDeep) {
2166
+ var Ctor = object.constructor;
2167
+ switch (tag) {
2168
+ case arrayBufferTag$1:
2169
+ return _cloneArrayBuffer(object);
2170
+
2171
+ case boolTag$1:
2172
+ case dateTag$1:
2173
+ return new Ctor(+object);
2174
+
2175
+ case dataViewTag$1:
2176
+ return _cloneDataView(object, isDeep);
2177
+
2178
+ case float32Tag$1: case float64Tag$1:
2179
+ case int8Tag$1: case int16Tag$1: case int32Tag$1:
2180
+ case uint8Tag$1: case uint8ClampedTag$1: case uint16Tag$1: case uint32Tag$1:
2181
+ return _cloneTypedArray(object, isDeep);
2182
+
2183
+ case mapTag$2:
2184
+ return new Ctor;
2185
+
2186
+ case numberTag$1:
2187
+ case stringTag$1:
2188
+ return new Ctor(object);
2189
+
2190
+ case regexpTag$1:
2191
+ return _cloneRegExp(object);
2192
+
2193
+ case setTag$2:
2194
+ return new Ctor;
2195
+
2196
+ case symbolTag$1:
2197
+ return _cloneSymbol(object);
2198
+ }
2199
+ }
2200
+
2201
+ var _initCloneByTag = initCloneByTag;
2202
+
2203
+ /** Built-in value references. */
2204
+ var objectCreate = Object.create;
2205
+
2206
+ /**
2207
+ * The base implementation of `_.create` without support for assigning
2208
+ * properties to the created object.
2209
+ *
2210
+ * @private
2211
+ * @param {Object} proto The object to inherit from.
2212
+ * @returns {Object} Returns the new object.
2213
+ */
2214
+ var baseCreate = (function() {
2215
+ function object() {}
2216
+ return function(proto) {
2217
+ if (!isObject_1(proto)) {
2218
+ return {};
2219
+ }
2220
+ if (objectCreate) {
2221
+ return objectCreate(proto);
2222
+ }
2223
+ object.prototype = proto;
2224
+ var result = new object;
2225
+ object.prototype = undefined;
2226
+ return result;
2227
+ };
2228
+ }());
2229
+
2230
+ var _baseCreate = baseCreate;
2231
+
2232
+ /**
2233
+ * Initializes an object clone.
2234
+ *
2235
+ * @private
2236
+ * @param {Object} object The object to clone.
2237
+ * @returns {Object} Returns the initialized clone.
2238
+ */
2239
+ function initCloneObject(object) {
2240
+ return (typeof object.constructor == 'function' && !_isPrototype(object))
2241
+ ? _baseCreate(_getPrototype(object))
2242
+ : {};
2243
+ }
2244
+
2245
+ var _initCloneObject = initCloneObject;
2246
+
2247
+ /** `Object#toString` result references. */
2248
+ var mapTag$1 = '[object Map]';
2249
+
2250
+ /**
2251
+ * The base implementation of `_.isMap` without Node.js optimizations.
2252
+ *
2253
+ * @private
2254
+ * @param {*} value The value to check.
2255
+ * @returns {boolean} Returns `true` if `value` is a map, else `false`.
2256
+ */
2257
+ function baseIsMap(value) {
2258
+ return isObjectLike_1(value) && _getTag(value) == mapTag$1;
2259
+ }
2260
+
2261
+ var _baseIsMap = baseIsMap;
2262
+
2263
+ /* Node.js helper references. */
2264
+ var nodeIsMap = _nodeUtil && _nodeUtil.isMap;
2265
+
2266
+ /**
2267
+ * Checks if `value` is classified as a `Map` object.
2268
+ *
2269
+ * @static
2270
+ * @memberOf _
2271
+ * @since 4.3.0
2272
+ * @category Lang
2273
+ * @param {*} value The value to check.
2274
+ * @returns {boolean} Returns `true` if `value` is a map, else `false`.
2275
+ * @example
2276
+ *
2277
+ * _.isMap(new Map);
2278
+ * // => true
2279
+ *
2280
+ * _.isMap(new WeakMap);
2281
+ * // => false
2282
+ */
2283
+ var isMap = nodeIsMap ? _baseUnary(nodeIsMap) : _baseIsMap;
2284
+
2285
+ var isMap_1 = isMap;
2286
+
2287
+ /** `Object#toString` result references. */
2288
+ var setTag$1 = '[object Set]';
2289
+
2290
+ /**
2291
+ * The base implementation of `_.isSet` without Node.js optimizations.
2292
+ *
2293
+ * @private
2294
+ * @param {*} value The value to check.
2295
+ * @returns {boolean} Returns `true` if `value` is a set, else `false`.
2296
+ */
2297
+ function baseIsSet(value) {
2298
+ return isObjectLike_1(value) && _getTag(value) == setTag$1;
2299
+ }
2300
+
2301
+ var _baseIsSet = baseIsSet;
2302
+
2303
+ /* Node.js helper references. */
2304
+ var nodeIsSet = _nodeUtil && _nodeUtil.isSet;
2305
+
2306
+ /**
2307
+ * Checks if `value` is classified as a `Set` object.
2308
+ *
2309
+ * @static
2310
+ * @memberOf _
2311
+ * @since 4.3.0
2312
+ * @category Lang
2313
+ * @param {*} value The value to check.
2314
+ * @returns {boolean} Returns `true` if `value` is a set, else `false`.
2315
+ * @example
2316
+ *
2317
+ * _.isSet(new Set);
2318
+ * // => true
2319
+ *
2320
+ * _.isSet(new WeakSet);
2321
+ * // => false
2322
+ */
2323
+ var isSet = nodeIsSet ? _baseUnary(nodeIsSet) : _baseIsSet;
2324
+
2325
+ var isSet_1 = isSet;
2326
+
2327
+ /** Used to compose bitmasks for cloning. */
2328
+ var CLONE_DEEP_FLAG$1 = 1,
2329
+ CLONE_FLAT_FLAG = 2,
2330
+ CLONE_SYMBOLS_FLAG$1 = 4;
2331
+
2332
+ /** `Object#toString` result references. */
2333
+ var argsTag = '[object Arguments]',
2334
+ arrayTag = '[object Array]',
2335
+ boolTag = '[object Boolean]',
2336
+ dateTag = '[object Date]',
2337
+ errorTag = '[object Error]',
2338
+ funcTag = '[object Function]',
2339
+ genTag = '[object GeneratorFunction]',
2340
+ mapTag = '[object Map]',
2341
+ numberTag = '[object Number]',
2342
+ objectTag = '[object Object]',
2343
+ regexpTag = '[object RegExp]',
2344
+ setTag = '[object Set]',
2345
+ stringTag = '[object String]',
2346
+ symbolTag = '[object Symbol]',
2347
+ weakMapTag = '[object WeakMap]';
2348
+
2349
+ var arrayBufferTag = '[object ArrayBuffer]',
2350
+ dataViewTag = '[object DataView]',
2351
+ float32Tag = '[object Float32Array]',
2352
+ float64Tag = '[object Float64Array]',
2353
+ int8Tag = '[object Int8Array]',
2354
+ int16Tag = '[object Int16Array]',
2355
+ int32Tag = '[object Int32Array]',
2356
+ uint8Tag = '[object Uint8Array]',
2357
+ uint8ClampedTag = '[object Uint8ClampedArray]',
2358
+ uint16Tag = '[object Uint16Array]',
2359
+ uint32Tag = '[object Uint32Array]';
2360
+
2361
+ /** Used to identify `toStringTag` values supported by `_.clone`. */
2362
+ var cloneableTags = {};
2363
+ cloneableTags[argsTag] = cloneableTags[arrayTag] =
2364
+ cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
2365
+ cloneableTags[boolTag] = cloneableTags[dateTag] =
2366
+ cloneableTags[float32Tag] = cloneableTags[float64Tag] =
2367
+ cloneableTags[int8Tag] = cloneableTags[int16Tag] =
2368
+ cloneableTags[int32Tag] = cloneableTags[mapTag] =
2369
+ cloneableTags[numberTag] = cloneableTags[objectTag] =
2370
+ cloneableTags[regexpTag] = cloneableTags[setTag] =
2371
+ cloneableTags[stringTag] = cloneableTags[symbolTag] =
2372
+ cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
2373
+ cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
2374
+ cloneableTags[errorTag] = cloneableTags[funcTag] =
2375
+ cloneableTags[weakMapTag] = false;
2376
+
2377
+ /**
2378
+ * The base implementation of `_.clone` and `_.cloneDeep` which tracks
2379
+ * traversed objects.
2380
+ *
2381
+ * @private
2382
+ * @param {*} value The value to clone.
2383
+ * @param {boolean} bitmask The bitmask flags.
2384
+ * 1 - Deep clone
2385
+ * 2 - Flatten inherited properties
2386
+ * 4 - Clone symbols
2387
+ * @param {Function} [customizer] The function to customize cloning.
2388
+ * @param {string} [key] The key of `value`.
2389
+ * @param {Object} [object] The parent object of `value`.
2390
+ * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
2391
+ * @returns {*} Returns the cloned value.
2392
+ */
2393
+ function baseClone(value, bitmask, customizer, key, object, stack) {
2394
+ var result,
2395
+ isDeep = bitmask & CLONE_DEEP_FLAG$1,
2396
+ isFlat = bitmask & CLONE_FLAT_FLAG,
2397
+ isFull = bitmask & CLONE_SYMBOLS_FLAG$1;
2398
+
2399
+ if (customizer) {
2400
+ result = object ? customizer(value, key, object, stack) : customizer(value);
2401
+ }
2402
+ if (result !== undefined) {
2403
+ return result;
2404
+ }
2405
+ if (!isObject_1(value)) {
2406
+ return value;
2407
+ }
2408
+ var isArr = isArray_1(value);
2409
+ if (isArr) {
2410
+ result = _initCloneArray(value);
2411
+ if (!isDeep) {
2412
+ return _copyArray(value, result);
2413
+ }
2414
+ } else {
2415
+ var tag = _getTag(value),
2416
+ isFunc = tag == funcTag || tag == genTag;
2417
+
2418
+ if (isBuffer_1(value)) {
2419
+ return _cloneBuffer(value, isDeep);
2420
+ }
2421
+ if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
2422
+ result = (isFlat || isFunc) ? {} : _initCloneObject(value);
2423
+ if (!isDeep) {
2424
+ return isFlat
2425
+ ? _copySymbolsIn(value, _baseAssignIn(result, value))
2426
+ : _copySymbols(value, _baseAssign(result, value));
60
2427
  }
61
- /**
62
- * Updates a specific setting and returns the change details
63
- *
64
- * @param {string} groupName
65
- * @param {*} setting
66
- */
67
- set(groupName, settingName, setting) {
68
- const currentValue = this.get(groupName, settingName);
69
- this.settings[groupName][settingName] = setting;
70
- const change = {
71
- group: groupName,
72
- name: settingName,
73
- old: currentValue,
74
- new: setting,
75
- };
76
- // Only emit the setting change when it has actually changed
77
- // We will emit the setting change using the group and name scope
78
- // so subscribers can focus on a certain group of settings
79
- //
80
- if (currentValue !== setting) {
81
- pubsubJs__default["default"].publish(`eva.setting.${change.group}.${change.name}`, change);
82
- }
83
- return change;
2428
+ } else {
2429
+ if (!cloneableTags[tag]) {
2430
+ return object ? value : {};
84
2431
  }
2432
+ result = _initCloneByTag(value, tag, isDeep);
2433
+ }
85
2434
  }
86
- const settings = new SettingsManager();
87
- // This is more of an SDK family version.
88
- // Because this new SDK is modular it makes no sense to emit a single package
89
- // version here
90
- //
91
- const SDK_CLIENT_VERSION = '2.0.0';
92
- // Register the default settings
93
- //
94
- const SETTINGS_GROUP_NAME = 'evaCore';
95
- // Setup the core settings
96
- //
97
- const defaultSettings = {
98
- language: 'en-EN',
99
- clientName: 'eva-sdk-core',
100
- clientVersion: SDK_CLIENT_VERSION,
101
- appName: 'UNKNOWN',
102
- appVersion: '0.0.0',
103
- };
104
- settings.register(SETTINGS_GROUP_NAME, defaultSettings);
105
- /**
106
- * Retrieves the core SDK setting
107
- *
108
- * @export
109
- * @returns {IEvaCoreSettings}
110
- */
111
- function getCoreSettings() {
112
- return settings.getGroup(SETTINGS_GROUP_NAME);
113
- }
114
- /**
115
- * Changes a setting for the core SDK settings
116
- *
117
- * @export
118
- * @param {string} settingName
119
- * @param {*} setting
120
- * @returns {ISettingsChange}
121
- */
122
- function setCoreSetting(settingName, setting) {
123
- return settings.set(SETTINGS_GROUP_NAME, settingName, setting);
124
- }
125
-
126
- exports.SDK_CLIENT_VERSION = SDK_CLIENT_VERSION;
127
- exports.SETTINGS_GROUP_NAME = SETTINGS_GROUP_NAME;
128
- exports.SettingsManager = SettingsManager;
129
- exports.getCoreSettings = getCoreSettings;
130
- exports.setCoreSetting = setCoreSetting;
131
- exports.settings = settings;
132
-
133
- Object.defineProperty(exports, '__esModule', { value: true });
2435
+ // Check for circular references and return its corresponding clone.
2436
+ stack || (stack = new _Stack);
2437
+ var stacked = stack.get(value);
2438
+ if (stacked) {
2439
+ return stacked;
2440
+ }
2441
+ stack.set(value, result);
2442
+
2443
+ if (isSet_1(value)) {
2444
+ value.forEach(function(subValue) {
2445
+ result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
2446
+ });
2447
+ } else if (isMap_1(value)) {
2448
+ value.forEach(function(subValue, key) {
2449
+ result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
2450
+ });
2451
+ }
2452
+
2453
+ var keysFunc = isFull
2454
+ ? (isFlat ? _getAllKeysIn : _getAllKeys)
2455
+ : (isFlat ? keysIn_1 : keys_1);
2456
+
2457
+ var props = isArr ? undefined : keysFunc(value);
2458
+ _arrayEach(props || value, function(subValue, key) {
2459
+ if (props) {
2460
+ key = subValue;
2461
+ subValue = value[key];
2462
+ }
2463
+ // Recursively populate clone (susceptible to call stack limits).
2464
+ _assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
2465
+ });
2466
+ return result;
2467
+ }
2468
+
2469
+ var _baseClone = baseClone;
2470
+
2471
+ /** Used to compose bitmasks for cloning. */
2472
+ var CLONE_DEEP_FLAG = 1,
2473
+ CLONE_SYMBOLS_FLAG = 4;
2474
+
2475
+ /**
2476
+ * This method is like `_.clone` except that it recursively clones `value`.
2477
+ *
2478
+ * @static
2479
+ * @memberOf _
2480
+ * @since 1.0.0
2481
+ * @category Lang
2482
+ * @param {*} value The value to recursively clone.
2483
+ * @returns {*} Returns the deep cloned value.
2484
+ * @see _.clone
2485
+ * @example
2486
+ *
2487
+ * var objects = [{ 'a': 1 }, { 'b': 2 }];
2488
+ *
2489
+ * var deep = _.cloneDeep(objects);
2490
+ * console.log(deep[0] === objects[0]);
2491
+ * // => false
2492
+ */
2493
+ function cloneDeep(value) {
2494
+ return _baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
2495
+ }
2496
+
2497
+ var cloneDeep_1 = cloneDeep;
2498
+
2499
+ /**
2500
+ * The settings manager wraps a collection of settings and provides
2501
+ * methods to register and retrieve groups of settings
2502
+ * It also helps track changes to the settings
2503
+ *
2504
+ * @export
2505
+ * @class SettingsManager
2506
+ */
2507
+ class SettingsManager {
2508
+ constructor() {
2509
+ /**
2510
+ * The actual settings data
2511
+ *
2512
+ * @private
2513
+ * @type {({[groupName: string]: any})}
2514
+ */
2515
+ this.settings = {};
2516
+ }
2517
+ /**
2518
+ * Register a new settings group
2519
+ *
2520
+ * @param {string} groupName The name of the group to register
2521
+ * @param {*} [defaultSetting={}] The default settings for the group
2522
+ */
2523
+ register(groupName, defaultSetting = {}) {
2524
+ if (this.settings[groupName]) {
2525
+ throw new Error(`SETTINGS: Duplicate registration for ${groupName}`);
2526
+ }
2527
+ // Make a copy of the default settings
2528
+ //
2529
+ this.settings[groupName] = cloneDeep_1(defaultSetting);
2530
+ }
2531
+ /**
2532
+ * Retrieves a setting group
2533
+ *
2534
+ * @param {string} groupName The name of the group to fetch
2535
+ */
2536
+ getGroup(groupName) {
2537
+ return this.settings[groupName];
2538
+ }
2539
+ /**
2540
+ * Retrieves a specific setting
2541
+ *
2542
+ * @param {string} groupName
2543
+ * @param {*} setting
2544
+ */
2545
+ get(groupName, settingName) {
2546
+ const group = this.getGroup(groupName) || {};
2547
+ return group[settingName];
2548
+ }
2549
+ /**
2550
+ * Updates a specific setting and returns the change details
2551
+ *
2552
+ * @param {string} groupName
2553
+ * @param {*} setting
2554
+ */
2555
+ set(groupName, settingName, setting) {
2556
+ const oldValue = cloneDeep_1(this.get(groupName, settingName));
2557
+ this.settings[groupName][settingName] = setting;
2558
+ const change = {
2559
+ group: groupName,
2560
+ name: settingName,
2561
+ old: oldValue,
2562
+ new: setting,
2563
+ };
2564
+ // Only emit the setting change when it has actually changed
2565
+ // We will emit the setting change using the group and name scope
2566
+ // so subscribers can focus on a certain group of settings
2567
+ //
2568
+ if (oldValue !== setting) {
2569
+ pubsubJs__default["default"].publish(`eva.setting.${change.group}.${change.name}`, change);
2570
+ }
2571
+ return change;
2572
+ }
2573
+ }
2574
+ const settings = new SettingsManager();
2575
+ // This is more of an SDK family version.
2576
+ // Because this new SDK is modular it makes no sense to emit a single package
2577
+ // version here
2578
+ //
2579
+ const SDK_CLIENT_VERSION = '2.0.0';
2580
+ // Register the default settings
2581
+ //
2582
+ const SETTINGS_GROUP_NAME = 'evaCore';
2583
+ // Setup the core settings
2584
+ //
2585
+ const defaultSettings = {
2586
+ language: 'en-EN',
2587
+ clientName: 'eva-sdk-core',
2588
+ clientVersion: SDK_CLIENT_VERSION,
2589
+ appName: 'UNKNOWN',
2590
+ appVersion: '0.0.0',
2591
+ };
2592
+ settings.register(SETTINGS_GROUP_NAME, defaultSettings);
2593
+ /**
2594
+ * Retrieves the core SDK setting
2595
+ *
2596
+ * @export
2597
+ * @returns {IEvaCoreSettings}
2598
+ */
2599
+ function getCoreSettings() {
2600
+ return settings.getGroup(SETTINGS_GROUP_NAME);
2601
+ }
2602
+ /**
2603
+ * Changes a setting for the core SDK settings
2604
+ *
2605
+ * @export
2606
+ * @param {string} settingName
2607
+ * @param {*} setting
2608
+ * @returns {ISettingsChange}
2609
+ */
2610
+ function setCoreSetting(settingName, setting) {
2611
+ return settings.set(SETTINGS_GROUP_NAME, settingName, setting);
2612
+ }
2613
+
2614
+ exports.SDK_CLIENT_VERSION = SDK_CLIENT_VERSION;
2615
+ exports.SETTINGS_GROUP_NAME = SETTINGS_GROUP_NAME;
2616
+ exports.SettingsManager = SettingsManager;
2617
+ exports.getCoreSettings = getCoreSettings;
2618
+ exports.setCoreSetting = setCoreSetting;
2619
+ exports.settings = settings;
2620
+
2621
+ Object.defineProperty(exports, '__esModule', { value: true });
134
2622
 
135
2623
  }));
136
2624
  //# sourceMappingURL=eva-sdk-core-settings.umd.js.map