@vertexvis/ui 0.0.16-canary.0 → 0.1.0-testing.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/dist/cjs/{auto-resize-textarea-56a57fd3.js → auto-resize-textarea-deb05359.js} +2 -14
  2. package/dist/cjs/components.cjs.js +1 -1
  3. package/dist/cjs/{draggable-popover-ee0db70b.js → draggable-popover-edf23d3a.js} +4 -9
  4. package/dist/cjs/index.cjs.js +10 -8
  5. package/dist/cjs/loader.cjs.js +1 -1
  6. package/dist/cjs/{menu-0579351b.js → menu-d1ecf43b.js} +4 -3
  7. package/dist/cjs/popover-d9ec8e10.js +1684 -0
  8. package/dist/cjs/{result-list-77ba2fa9.js → result-list-1e592c3c.js} +1 -1
  9. package/dist/cjs/{search-bar-81ca45b3.js → search-bar-bb40cfa7.js} +1 -1
  10. package/dist/cjs/slots-fb5ac359.js +29 -0
  11. package/dist/cjs/{templates-4e22ccc0.js → templates-e7b3ffbb.js} +3 -32
  12. package/dist/cjs/tooltip-31b596f5.js +2152 -0
  13. package/dist/cjs/tslib.es6-838fd860.js +68 -0
  14. package/dist/cjs/vertex-auto-resize-textarea.cjs.entry.js +2 -1
  15. package/dist/cjs/vertex-draggable-popover.cjs.entry.js +1 -1
  16. package/dist/cjs/vertex-menu.cjs.entry.js +1 -1
  17. package/dist/cjs/vertex-popover.cjs.entry.js +1 -1
  18. package/dist/cjs/vertex-result-list.cjs.entry.js +3 -2
  19. package/dist/cjs/vertex-search-bar.cjs.entry.js +3 -2
  20. package/dist/cjs/vertex-tooltip.cjs.entry.js +3 -1
  21. package/dist/collection/components/draggable-popover/draggable-popover.js +4 -9
  22. package/dist/collection/components/dropdown-menu/dropdown-menu.js +1 -1
  23. package/dist/collection/components/help-tooltip/help-tooltip.js +1 -1
  24. package/dist/collection/components/menu/menu.js +28 -4
  25. package/dist/collection/components/popover/middleware.js +26 -0
  26. package/dist/collection/components/popover/popover.css +1 -1
  27. package/dist/collection/components/popover/popover.js +147 -115
  28. package/dist/collection/components/popover/util.js +9 -0
  29. package/dist/collection/components/result-list/result-list.js +1 -1
  30. package/dist/collection/components/search-bar/search-bar.js +1 -1
  31. package/dist/collection/components/tooltip/tooltip.css +4 -0
  32. package/dist/collection/components/tooltip/tooltip.js +60 -4
  33. package/dist/collection/util/components/dom.js +10 -0
  34. package/dist/collection/util/components/slots.js +12 -0
  35. package/dist/components/components.css +1 -1
  36. package/dist/components/components.esm.js +1 -1
  37. package/dist/components/index.esm.js +1 -1
  38. package/dist/components/p-0517ca62.entry.js +1 -0
  39. package/dist/components/p-1356f525.js +1 -0
  40. package/dist/components/p-19318fee.entry.js +1 -0
  41. package/dist/components/p-41a7564c.js +1 -0
  42. package/dist/components/{p-5a93c1b6.js → p-4224c2ad.js} +1 -1
  43. package/dist/components/p-45cfd66e.entry.js +1 -0
  44. package/dist/components/{p-60ca5d84.js → p-52739247.js} +1 -1
  45. package/dist/components/p-59032668.js +1 -0
  46. package/dist/components/p-6505cdb3.js +1 -0
  47. package/dist/components/p-7b75e004.js +1 -0
  48. package/dist/components/p-9c384f6c.entry.js +1 -0
  49. package/dist/components/p-ae6a3c46.entry.js +1 -0
  50. package/dist/components/p-b2c7b113.js +1 -0
  51. package/dist/components/p-bec53c3a.js +1 -0
  52. package/dist/components/p-da0a7b57.js +1 -0
  53. package/dist/components/p-e576818b.entry.js +1 -0
  54. package/dist/components/p-e7336466.entry.js +1 -0
  55. package/dist/esm/{auto-resize-textarea-ac4b5f3b.js → auto-resize-textarea-087fecdb.js} +1 -13
  56. package/dist/esm/components.js +1 -1
  57. package/dist/esm/{draggable-popover-5f14cca5.js → draggable-popover-8ef3aec6.js} +4 -9
  58. package/dist/esm/index.js +10 -8
  59. package/dist/esm/loader.js +1 -1
  60. package/dist/esm/{menu-f35637ca.js → menu-daa7f9c9.js} +4 -3
  61. package/dist/esm/popover-67c88e4b.js +1682 -0
  62. package/dist/esm/{result-list-9c83f22a.js → result-list-36cfb08a.js} +1 -1
  63. package/dist/esm/{search-bar-600fb8d9.js → search-bar-59cc151d.js} +1 -1
  64. package/dist/esm/slots-fbb5afb3.js +26 -0
  65. package/dist/esm/{templates-51212dae.js → templates-797420bf.js} +1 -30
  66. package/dist/esm/tooltip-14b65fb5.js +2150 -0
  67. package/dist/esm/tslib.es6-99cd0de8.js +65 -0
  68. package/dist/esm/vertex-auto-resize-textarea.entry.js +2 -1
  69. package/dist/esm/vertex-draggable-popover.entry.js +1 -1
  70. package/dist/esm/vertex-menu.entry.js +1 -1
  71. package/dist/esm/vertex-popover.entry.js +1 -1
  72. package/dist/esm/vertex-result-list.entry.js +3 -2
  73. package/dist/esm/vertex-search-bar.entry.js +3 -2
  74. package/dist/esm/vertex-tooltip.entry.js +3 -1
  75. package/dist/types/components/menu/menu.d.ts +2 -1
  76. package/dist/types/components/popover/middleware.d.ts +3 -0
  77. package/dist/types/components/popover/popover.d.ts +39 -23
  78. package/dist/types/components/popover/util.d.ts +2 -0
  79. package/dist/types/components/tooltip/tooltip.d.ts +10 -0
  80. package/dist/types/components.d.ts +31 -15
  81. package/dist/types/util/components/dom.d.ts +3 -0
  82. package/dist/types/util/components/slots.d.ts +1 -0
  83. package/package.json +5 -4
  84. package/dist/cjs/popover-34e1a386.js +0 -2029
  85. package/dist/cjs/tooltip-afebbca8.js +0 -46
  86. package/dist/components/p-0ec0a007.entry.js +0 -1
  87. package/dist/components/p-4226645b.js +0 -1
  88. package/dist/components/p-58f8a354.js +0 -1
  89. package/dist/components/p-7c31f30e.js +0 -1
  90. package/dist/components/p-852be06f.js +0 -1
  91. package/dist/components/p-8764954b.js +0 -1
  92. package/dist/components/p-939391df.entry.js +0 -1
  93. package/dist/components/p-990852f6.entry.js +0 -1
  94. package/dist/components/p-a1d160cc.entry.js +0 -1
  95. package/dist/components/p-c8df41df.entry.js +0 -1
  96. package/dist/components/p-e8e6ee3f.js +0 -1
  97. package/dist/components/p-eff16591.entry.js +0 -1
  98. package/dist/components/p-f98b2ecb.entry.js +0 -1
  99. package/dist/esm/popover-4375db1b.js +0 -2027
  100. package/dist/esm/tooltip-e78d2c7a.js +0 -44
@@ -0,0 +1,2152 @@
1
+ 'use strict';
2
+
3
+ const index = require('./index-6a92256c.js');
4
+ const tslib_es6 = require('./tslib.es6-838fd860.js');
5
+ const index$1 = require('./index-e1b40fa6.js');
6
+ const slots = require('./slots-fb5ac359.js');
7
+
8
+ /**
9
+ * A module for defining functional schemas to map between different types. This
10
+ * module is useful for parsing to or from JSON/protobufs to domain types.
11
+ *
12
+ * Mappers support greedy validation, so all validation errors are aggregated
13
+ * and reported vs failing on the first invalid input.
14
+ *
15
+ * @example
16
+ *
17
+ * ```ts
18
+ * import { Mapper as M } from '@vertexvis/utils';
19
+ *
20
+ * interface Address {
21
+ * address: string;
22
+ * city: string;
23
+ * state: string;
24
+ * zip: string;
25
+ * }
26
+ *
27
+ * interface Person {
28
+ * name: string;
29
+ * addresses: Address[];
30
+ * }
31
+ *
32
+ * type AddressJson = Partial<Address>;
33
+ * type PersonJson = {
34
+ * name?: string;
35
+ * addresses?: AddressJson[];
36
+ * }
37
+ *
38
+ * const mapAddress: M.Func<AddressJson, Address> = M.defineMapper(
39
+ * M.read(
40
+ * M.requireProp('address'),
41
+ * M.requireProp('city'),
42
+ * M.requireProp('state'),
43
+ * M.requireProp('zip')
44
+ * ),
45
+ * ([address, city, state, zip]) => ({
46
+ * address, city, state, zip
47
+ * })
48
+ * );
49
+ *
50
+ * const mapPerson: M.Func<PersonJson, Person> = M.defineMapper(
51
+ * M.read(
52
+ * M.requireProp('name'),
53
+ * M.mapProp(
54
+ * 'addresses',
55
+ * M.compose(M.required('addresses'), M.mapArray(mapAddress))
56
+ * )
57
+ * ),
58
+ * ([name, addresses]) => ({ name, addresses })
59
+ * );
60
+ *
61
+ * const person = mapPerson({
62
+ * name: 'John',
63
+ * addresses: [{ address: '123', city: 'Ames', state: 'IA', zip: '50010' }]
64
+ * });
65
+ *
66
+ * const invalidPerson = mapPerson({
67
+ * addresses: [{ city: 'Ames', state: 'IA', zip: '50010' }]
68
+ * });
69
+ * ```
70
+ * // {
71
+ * // errors: ["Name is required.", "Address is required."]
72
+ * // }
73
+ *
74
+ * @module
75
+ */
76
+ /**
77
+ * An error that is thrown when validation of a schema fails.
78
+ *
79
+ * @see {@link ifInvalidThrow} - for throwing errors on invalid input.
80
+ */
81
+ /** @class */ ((function (_super) {
82
+ tslib_es6.__extends(MapperValidationError, _super);
83
+ function MapperValidationError(errors) {
84
+ var _this = _super.call(this, 'Validation error mapping object.') || this;
85
+ _this.errors = errors;
86
+ Object.setPrototypeOf(_this, MapperValidationError.prototype);
87
+ return _this;
88
+ }
89
+ return MapperValidationError;
90
+ })(Error));
91
+
92
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
93
+
94
+ var lodash_isequal = {exports: {}};
95
+
96
+ /**
97
+ * Lodash (Custom Build) <https://lodash.com/>
98
+ * Build: `lodash modularize exports="npm" -o ./`
99
+ * Copyright JS Foundation and other contributors <https://js.foundation/>
100
+ * Released under MIT license <https://lodash.com/license>
101
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
102
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
103
+ */
104
+
105
+ (function (module, exports) {
106
+ /** Used as the size to enable large array optimizations. */
107
+ var LARGE_ARRAY_SIZE = 200;
108
+
109
+ /** Used to stand-in for `undefined` hash values. */
110
+ var HASH_UNDEFINED = '__lodash_hash_undefined__';
111
+
112
+ /** Used to compose bitmasks for value comparisons. */
113
+ var COMPARE_PARTIAL_FLAG = 1,
114
+ COMPARE_UNORDERED_FLAG = 2;
115
+
116
+ /** Used as references for various `Number` constants. */
117
+ var MAX_SAFE_INTEGER = 9007199254740991;
118
+
119
+ /** `Object#toString` result references. */
120
+ var argsTag = '[object Arguments]',
121
+ arrayTag = '[object Array]',
122
+ asyncTag = '[object AsyncFunction]',
123
+ boolTag = '[object Boolean]',
124
+ dateTag = '[object Date]',
125
+ errorTag = '[object Error]',
126
+ funcTag = '[object Function]',
127
+ genTag = '[object GeneratorFunction]',
128
+ mapTag = '[object Map]',
129
+ numberTag = '[object Number]',
130
+ nullTag = '[object Null]',
131
+ objectTag = '[object Object]',
132
+ promiseTag = '[object Promise]',
133
+ proxyTag = '[object Proxy]',
134
+ regexpTag = '[object RegExp]',
135
+ setTag = '[object Set]',
136
+ stringTag = '[object String]',
137
+ symbolTag = '[object Symbol]',
138
+ undefinedTag = '[object Undefined]',
139
+ weakMapTag = '[object WeakMap]';
140
+
141
+ var arrayBufferTag = '[object ArrayBuffer]',
142
+ dataViewTag = '[object DataView]',
143
+ float32Tag = '[object Float32Array]',
144
+ float64Tag = '[object Float64Array]',
145
+ int8Tag = '[object Int8Array]',
146
+ int16Tag = '[object Int16Array]',
147
+ int32Tag = '[object Int32Array]',
148
+ uint8Tag = '[object Uint8Array]',
149
+ uint8ClampedTag = '[object Uint8ClampedArray]',
150
+ uint16Tag = '[object Uint16Array]',
151
+ uint32Tag = '[object Uint32Array]';
152
+
153
+ /**
154
+ * Used to match `RegExp`
155
+ * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
156
+ */
157
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
158
+
159
+ /** Used to detect host constructors (Safari). */
160
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
161
+
162
+ /** Used to detect unsigned integer values. */
163
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
164
+
165
+ /** Used to identify `toStringTag` values of typed arrays. */
166
+ var typedArrayTags = {};
167
+ typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
168
+ typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
169
+ typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
170
+ typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
171
+ typedArrayTags[uint32Tag] = true;
172
+ typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
173
+ typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
174
+ typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
175
+ typedArrayTags[errorTag] = typedArrayTags[funcTag] =
176
+ typedArrayTags[mapTag] = typedArrayTags[numberTag] =
177
+ typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
178
+ typedArrayTags[setTag] = typedArrayTags[stringTag] =
179
+ typedArrayTags[weakMapTag] = false;
180
+
181
+ /** Detect free variable `global` from Node.js. */
182
+ var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
183
+
184
+ /** Detect free variable `self`. */
185
+ var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
186
+
187
+ /** Used as a reference to the global object. */
188
+ var root = freeGlobal || freeSelf || Function('return this')();
189
+
190
+ /** Detect free variable `exports`. */
191
+ var freeExports = exports && !exports.nodeType && exports;
192
+
193
+ /** Detect free variable `module`. */
194
+ var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
195
+
196
+ /** Detect the popular CommonJS extension `module.exports`. */
197
+ var moduleExports = freeModule && freeModule.exports === freeExports;
198
+
199
+ /** Detect free variable `process` from Node.js. */
200
+ var freeProcess = moduleExports && freeGlobal.process;
201
+
202
+ /** Used to access faster Node.js helpers. */
203
+ var nodeUtil = (function() {
204
+ try {
205
+ return freeProcess && freeProcess.binding && freeProcess.binding('util');
206
+ } catch (e) {}
207
+ }());
208
+
209
+ /* Node.js helper references. */
210
+ var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
211
+
212
+ /**
213
+ * A specialized version of `_.filter` for arrays without support for
214
+ * iteratee shorthands.
215
+ *
216
+ * @private
217
+ * @param {Array} [array] The array to iterate over.
218
+ * @param {Function} predicate The function invoked per iteration.
219
+ * @returns {Array} Returns the new filtered array.
220
+ */
221
+ function arrayFilter(array, predicate) {
222
+ var index = -1,
223
+ length = array == null ? 0 : array.length,
224
+ resIndex = 0,
225
+ result = [];
226
+
227
+ while (++index < length) {
228
+ var value = array[index];
229
+ if (predicate(value, index, array)) {
230
+ result[resIndex++] = value;
231
+ }
232
+ }
233
+ return result;
234
+ }
235
+
236
+ /**
237
+ * Appends the elements of `values` to `array`.
238
+ *
239
+ * @private
240
+ * @param {Array} array The array to modify.
241
+ * @param {Array} values The values to append.
242
+ * @returns {Array} Returns `array`.
243
+ */
244
+ function arrayPush(array, values) {
245
+ var index = -1,
246
+ length = values.length,
247
+ offset = array.length;
248
+
249
+ while (++index < length) {
250
+ array[offset + index] = values[index];
251
+ }
252
+ return array;
253
+ }
254
+
255
+ /**
256
+ * A specialized version of `_.some` for arrays without support for iteratee
257
+ * shorthands.
258
+ *
259
+ * @private
260
+ * @param {Array} [array] The array to iterate over.
261
+ * @param {Function} predicate The function invoked per iteration.
262
+ * @returns {boolean} Returns `true` if any element passes the predicate check,
263
+ * else `false`.
264
+ */
265
+ function arraySome(array, predicate) {
266
+ var index = -1,
267
+ length = array == null ? 0 : array.length;
268
+
269
+ while (++index < length) {
270
+ if (predicate(array[index], index, array)) {
271
+ return true;
272
+ }
273
+ }
274
+ return false;
275
+ }
276
+
277
+ /**
278
+ * The base implementation of `_.times` without support for iteratee shorthands
279
+ * or max array length checks.
280
+ *
281
+ * @private
282
+ * @param {number} n The number of times to invoke `iteratee`.
283
+ * @param {Function} iteratee The function invoked per iteration.
284
+ * @returns {Array} Returns the array of results.
285
+ */
286
+ function baseTimes(n, iteratee) {
287
+ var index = -1,
288
+ result = Array(n);
289
+
290
+ while (++index < n) {
291
+ result[index] = iteratee(index);
292
+ }
293
+ return result;
294
+ }
295
+
296
+ /**
297
+ * The base implementation of `_.unary` without support for storing metadata.
298
+ *
299
+ * @private
300
+ * @param {Function} func The function to cap arguments for.
301
+ * @returns {Function} Returns the new capped function.
302
+ */
303
+ function baseUnary(func) {
304
+ return function(value) {
305
+ return func(value);
306
+ };
307
+ }
308
+
309
+ /**
310
+ * Checks if a `cache` value for `key` exists.
311
+ *
312
+ * @private
313
+ * @param {Object} cache The cache to query.
314
+ * @param {string} key The key of the entry to check.
315
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
316
+ */
317
+ function cacheHas(cache, key) {
318
+ return cache.has(key);
319
+ }
320
+
321
+ /**
322
+ * Gets the value at `key` of `object`.
323
+ *
324
+ * @private
325
+ * @param {Object} [object] The object to query.
326
+ * @param {string} key The key of the property to get.
327
+ * @returns {*} Returns the property value.
328
+ */
329
+ function getValue(object, key) {
330
+ return object == null ? undefined : object[key];
331
+ }
332
+
333
+ /**
334
+ * Converts `map` to its key-value pairs.
335
+ *
336
+ * @private
337
+ * @param {Object} map The map to convert.
338
+ * @returns {Array} Returns the key-value pairs.
339
+ */
340
+ function mapToArray(map) {
341
+ var index = -1,
342
+ result = Array(map.size);
343
+
344
+ map.forEach(function(value, key) {
345
+ result[++index] = [key, value];
346
+ });
347
+ return result;
348
+ }
349
+
350
+ /**
351
+ * Creates a unary function that invokes `func` with its argument transformed.
352
+ *
353
+ * @private
354
+ * @param {Function} func The function to wrap.
355
+ * @param {Function} transform The argument transform.
356
+ * @returns {Function} Returns the new function.
357
+ */
358
+ function overArg(func, transform) {
359
+ return function(arg) {
360
+ return func(transform(arg));
361
+ };
362
+ }
363
+
364
+ /**
365
+ * Converts `set` to an array of its values.
366
+ *
367
+ * @private
368
+ * @param {Object} set The set to convert.
369
+ * @returns {Array} Returns the values.
370
+ */
371
+ function setToArray(set) {
372
+ var index = -1,
373
+ result = Array(set.size);
374
+
375
+ set.forEach(function(value) {
376
+ result[++index] = value;
377
+ });
378
+ return result;
379
+ }
380
+
381
+ /** Used for built-in method references. */
382
+ var arrayProto = Array.prototype,
383
+ funcProto = Function.prototype,
384
+ objectProto = Object.prototype;
385
+
386
+ /** Used to detect overreaching core-js shims. */
387
+ var coreJsData = root['__core-js_shared__'];
388
+
389
+ /** Used to resolve the decompiled source of functions. */
390
+ var funcToString = funcProto.toString;
391
+
392
+ /** Used to check objects for own properties. */
393
+ var hasOwnProperty = objectProto.hasOwnProperty;
394
+
395
+ /** Used to detect methods masquerading as native. */
396
+ var maskSrcKey = (function() {
397
+ var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
398
+ return uid ? ('Symbol(src)_1.' + uid) : '';
399
+ }());
400
+
401
+ /**
402
+ * Used to resolve the
403
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
404
+ * of values.
405
+ */
406
+ var nativeObjectToString = objectProto.toString;
407
+
408
+ /** Used to detect if a method is native. */
409
+ var reIsNative = RegExp('^' +
410
+ funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
411
+ .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
412
+ );
413
+
414
+ /** Built-in value references. */
415
+ var Buffer = moduleExports ? root.Buffer : undefined,
416
+ Symbol = root.Symbol,
417
+ Uint8Array = root.Uint8Array,
418
+ propertyIsEnumerable = objectProto.propertyIsEnumerable,
419
+ splice = arrayProto.splice,
420
+ symToStringTag = Symbol ? Symbol.toStringTag : undefined;
421
+
422
+ /* Built-in method references for those with the same name as other `lodash` methods. */
423
+ var nativeGetSymbols = Object.getOwnPropertySymbols,
424
+ nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
425
+ nativeKeys = overArg(Object.keys, Object);
426
+
427
+ /* Built-in method references that are verified to be native. */
428
+ var DataView = getNative(root, 'DataView'),
429
+ Map = getNative(root, 'Map'),
430
+ Promise = getNative(root, 'Promise'),
431
+ Set = getNative(root, 'Set'),
432
+ WeakMap = getNative(root, 'WeakMap'),
433
+ nativeCreate = getNative(Object, 'create');
434
+
435
+ /** Used to detect maps, sets, and weakmaps. */
436
+ var dataViewCtorString = toSource(DataView),
437
+ mapCtorString = toSource(Map),
438
+ promiseCtorString = toSource(Promise),
439
+ setCtorString = toSource(Set),
440
+ weakMapCtorString = toSource(WeakMap);
441
+
442
+ /** Used to convert symbols to primitives and strings. */
443
+ var symbolProto = Symbol ? Symbol.prototype : undefined,
444
+ symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
445
+
446
+ /**
447
+ * Creates a hash object.
448
+ *
449
+ * @private
450
+ * @constructor
451
+ * @param {Array} [entries] The key-value pairs to cache.
452
+ */
453
+ function Hash(entries) {
454
+ var index = -1,
455
+ length = entries == null ? 0 : entries.length;
456
+
457
+ this.clear();
458
+ while (++index < length) {
459
+ var entry = entries[index];
460
+ this.set(entry[0], entry[1]);
461
+ }
462
+ }
463
+
464
+ /**
465
+ * Removes all key-value entries from the hash.
466
+ *
467
+ * @private
468
+ * @name clear
469
+ * @memberOf Hash
470
+ */
471
+ function hashClear() {
472
+ this.__data__ = nativeCreate ? nativeCreate(null) : {};
473
+ this.size = 0;
474
+ }
475
+
476
+ /**
477
+ * Removes `key` and its value from the hash.
478
+ *
479
+ * @private
480
+ * @name delete
481
+ * @memberOf Hash
482
+ * @param {Object} hash The hash to modify.
483
+ * @param {string} key The key of the value to remove.
484
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
485
+ */
486
+ function hashDelete(key) {
487
+ var result = this.has(key) && delete this.__data__[key];
488
+ this.size -= result ? 1 : 0;
489
+ return result;
490
+ }
491
+
492
+ /**
493
+ * Gets the hash value for `key`.
494
+ *
495
+ * @private
496
+ * @name get
497
+ * @memberOf Hash
498
+ * @param {string} key The key of the value to get.
499
+ * @returns {*} Returns the entry value.
500
+ */
501
+ function hashGet(key) {
502
+ var data = this.__data__;
503
+ if (nativeCreate) {
504
+ var result = data[key];
505
+ return result === HASH_UNDEFINED ? undefined : result;
506
+ }
507
+ return hasOwnProperty.call(data, key) ? data[key] : undefined;
508
+ }
509
+
510
+ /**
511
+ * Checks if a hash value for `key` exists.
512
+ *
513
+ * @private
514
+ * @name has
515
+ * @memberOf Hash
516
+ * @param {string} key The key of the entry to check.
517
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
518
+ */
519
+ function hashHas(key) {
520
+ var data = this.__data__;
521
+ return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
522
+ }
523
+
524
+ /**
525
+ * Sets the hash `key` to `value`.
526
+ *
527
+ * @private
528
+ * @name set
529
+ * @memberOf Hash
530
+ * @param {string} key The key of the value to set.
531
+ * @param {*} value The value to set.
532
+ * @returns {Object} Returns the hash instance.
533
+ */
534
+ function hashSet(key, value) {
535
+ var data = this.__data__;
536
+ this.size += this.has(key) ? 0 : 1;
537
+ data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
538
+ return this;
539
+ }
540
+
541
+ // Add methods to `Hash`.
542
+ Hash.prototype.clear = hashClear;
543
+ Hash.prototype['delete'] = hashDelete;
544
+ Hash.prototype.get = hashGet;
545
+ Hash.prototype.has = hashHas;
546
+ Hash.prototype.set = hashSet;
547
+
548
+ /**
549
+ * Creates an list cache object.
550
+ *
551
+ * @private
552
+ * @constructor
553
+ * @param {Array} [entries] The key-value pairs to cache.
554
+ */
555
+ function ListCache(entries) {
556
+ var index = -1,
557
+ length = entries == null ? 0 : entries.length;
558
+
559
+ this.clear();
560
+ while (++index < length) {
561
+ var entry = entries[index];
562
+ this.set(entry[0], entry[1]);
563
+ }
564
+ }
565
+
566
+ /**
567
+ * Removes all key-value entries from the list cache.
568
+ *
569
+ * @private
570
+ * @name clear
571
+ * @memberOf ListCache
572
+ */
573
+ function listCacheClear() {
574
+ this.__data__ = [];
575
+ this.size = 0;
576
+ }
577
+
578
+ /**
579
+ * Removes `key` and its value from the list cache.
580
+ *
581
+ * @private
582
+ * @name delete
583
+ * @memberOf ListCache
584
+ * @param {string} key The key of the value to remove.
585
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
586
+ */
587
+ function listCacheDelete(key) {
588
+ var data = this.__data__,
589
+ index = assocIndexOf(data, key);
590
+
591
+ if (index < 0) {
592
+ return false;
593
+ }
594
+ var lastIndex = data.length - 1;
595
+ if (index == lastIndex) {
596
+ data.pop();
597
+ } else {
598
+ splice.call(data, index, 1);
599
+ }
600
+ --this.size;
601
+ return true;
602
+ }
603
+
604
+ /**
605
+ * Gets the list cache value for `key`.
606
+ *
607
+ * @private
608
+ * @name get
609
+ * @memberOf ListCache
610
+ * @param {string} key The key of the value to get.
611
+ * @returns {*} Returns the entry value.
612
+ */
613
+ function listCacheGet(key) {
614
+ var data = this.__data__,
615
+ index = assocIndexOf(data, key);
616
+
617
+ return index < 0 ? undefined : data[index][1];
618
+ }
619
+
620
+ /**
621
+ * Checks if a list cache value for `key` exists.
622
+ *
623
+ * @private
624
+ * @name has
625
+ * @memberOf ListCache
626
+ * @param {string} key The key of the entry to check.
627
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
628
+ */
629
+ function listCacheHas(key) {
630
+ return assocIndexOf(this.__data__, key) > -1;
631
+ }
632
+
633
+ /**
634
+ * Sets the list cache `key` to `value`.
635
+ *
636
+ * @private
637
+ * @name set
638
+ * @memberOf ListCache
639
+ * @param {string} key The key of the value to set.
640
+ * @param {*} value The value to set.
641
+ * @returns {Object} Returns the list cache instance.
642
+ */
643
+ function listCacheSet(key, value) {
644
+ var data = this.__data__,
645
+ index = assocIndexOf(data, key);
646
+
647
+ if (index < 0) {
648
+ ++this.size;
649
+ data.push([key, value]);
650
+ } else {
651
+ data[index][1] = value;
652
+ }
653
+ return this;
654
+ }
655
+
656
+ // Add methods to `ListCache`.
657
+ ListCache.prototype.clear = listCacheClear;
658
+ ListCache.prototype['delete'] = listCacheDelete;
659
+ ListCache.prototype.get = listCacheGet;
660
+ ListCache.prototype.has = listCacheHas;
661
+ ListCache.prototype.set = listCacheSet;
662
+
663
+ /**
664
+ * Creates a map cache object to store key-value pairs.
665
+ *
666
+ * @private
667
+ * @constructor
668
+ * @param {Array} [entries] The key-value pairs to cache.
669
+ */
670
+ function MapCache(entries) {
671
+ var index = -1,
672
+ length = entries == null ? 0 : entries.length;
673
+
674
+ this.clear();
675
+ while (++index < length) {
676
+ var entry = entries[index];
677
+ this.set(entry[0], entry[1]);
678
+ }
679
+ }
680
+
681
+ /**
682
+ * Removes all key-value entries from the map.
683
+ *
684
+ * @private
685
+ * @name clear
686
+ * @memberOf MapCache
687
+ */
688
+ function mapCacheClear() {
689
+ this.size = 0;
690
+ this.__data__ = {
691
+ 'hash': new Hash,
692
+ 'map': new (Map || ListCache),
693
+ 'string': new Hash
694
+ };
695
+ }
696
+
697
+ /**
698
+ * Removes `key` and its value from the map.
699
+ *
700
+ * @private
701
+ * @name delete
702
+ * @memberOf MapCache
703
+ * @param {string} key The key of the value to remove.
704
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
705
+ */
706
+ function mapCacheDelete(key) {
707
+ var result = getMapData(this, key)['delete'](key);
708
+ this.size -= result ? 1 : 0;
709
+ return result;
710
+ }
711
+
712
+ /**
713
+ * Gets the map value for `key`.
714
+ *
715
+ * @private
716
+ * @name get
717
+ * @memberOf MapCache
718
+ * @param {string} key The key of the value to get.
719
+ * @returns {*} Returns the entry value.
720
+ */
721
+ function mapCacheGet(key) {
722
+ return getMapData(this, key).get(key);
723
+ }
724
+
725
+ /**
726
+ * Checks if a map value for `key` exists.
727
+ *
728
+ * @private
729
+ * @name has
730
+ * @memberOf MapCache
731
+ * @param {string} key The key of the entry to check.
732
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
733
+ */
734
+ function mapCacheHas(key) {
735
+ return getMapData(this, key).has(key);
736
+ }
737
+
738
+ /**
739
+ * Sets the map `key` to `value`.
740
+ *
741
+ * @private
742
+ * @name set
743
+ * @memberOf MapCache
744
+ * @param {string} key The key of the value to set.
745
+ * @param {*} value The value to set.
746
+ * @returns {Object} Returns the map cache instance.
747
+ */
748
+ function mapCacheSet(key, value) {
749
+ var data = getMapData(this, key),
750
+ size = data.size;
751
+
752
+ data.set(key, value);
753
+ this.size += data.size == size ? 0 : 1;
754
+ return this;
755
+ }
756
+
757
+ // Add methods to `MapCache`.
758
+ MapCache.prototype.clear = mapCacheClear;
759
+ MapCache.prototype['delete'] = mapCacheDelete;
760
+ MapCache.prototype.get = mapCacheGet;
761
+ MapCache.prototype.has = mapCacheHas;
762
+ MapCache.prototype.set = mapCacheSet;
763
+
764
+ /**
765
+ *
766
+ * Creates an array cache object to store unique values.
767
+ *
768
+ * @private
769
+ * @constructor
770
+ * @param {Array} [values] The values to cache.
771
+ */
772
+ function SetCache(values) {
773
+ var index = -1,
774
+ length = values == null ? 0 : values.length;
775
+
776
+ this.__data__ = new MapCache;
777
+ while (++index < length) {
778
+ this.add(values[index]);
779
+ }
780
+ }
781
+
782
+ /**
783
+ * Adds `value` to the array cache.
784
+ *
785
+ * @private
786
+ * @name add
787
+ * @memberOf SetCache
788
+ * @alias push
789
+ * @param {*} value The value to cache.
790
+ * @returns {Object} Returns the cache instance.
791
+ */
792
+ function setCacheAdd(value) {
793
+ this.__data__.set(value, HASH_UNDEFINED);
794
+ return this;
795
+ }
796
+
797
+ /**
798
+ * Checks if `value` is in the array cache.
799
+ *
800
+ * @private
801
+ * @name has
802
+ * @memberOf SetCache
803
+ * @param {*} value The value to search for.
804
+ * @returns {number} Returns `true` if `value` is found, else `false`.
805
+ */
806
+ function setCacheHas(value) {
807
+ return this.__data__.has(value);
808
+ }
809
+
810
+ // Add methods to `SetCache`.
811
+ SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
812
+ SetCache.prototype.has = setCacheHas;
813
+
814
+ /**
815
+ * Creates a stack cache object to store key-value pairs.
816
+ *
817
+ * @private
818
+ * @constructor
819
+ * @param {Array} [entries] The key-value pairs to cache.
820
+ */
821
+ function Stack(entries) {
822
+ var data = this.__data__ = new ListCache(entries);
823
+ this.size = data.size;
824
+ }
825
+
826
+ /**
827
+ * Removes all key-value entries from the stack.
828
+ *
829
+ * @private
830
+ * @name clear
831
+ * @memberOf Stack
832
+ */
833
+ function stackClear() {
834
+ this.__data__ = new ListCache;
835
+ this.size = 0;
836
+ }
837
+
838
+ /**
839
+ * Removes `key` and its value from the stack.
840
+ *
841
+ * @private
842
+ * @name delete
843
+ * @memberOf Stack
844
+ * @param {string} key The key of the value to remove.
845
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
846
+ */
847
+ function stackDelete(key) {
848
+ var data = this.__data__,
849
+ result = data['delete'](key);
850
+
851
+ this.size = data.size;
852
+ return result;
853
+ }
854
+
855
+ /**
856
+ * Gets the stack value for `key`.
857
+ *
858
+ * @private
859
+ * @name get
860
+ * @memberOf Stack
861
+ * @param {string} key The key of the value to get.
862
+ * @returns {*} Returns the entry value.
863
+ */
864
+ function stackGet(key) {
865
+ return this.__data__.get(key);
866
+ }
867
+
868
+ /**
869
+ * Checks if a stack value for `key` exists.
870
+ *
871
+ * @private
872
+ * @name has
873
+ * @memberOf Stack
874
+ * @param {string} key The key of the entry to check.
875
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
876
+ */
877
+ function stackHas(key) {
878
+ return this.__data__.has(key);
879
+ }
880
+
881
+ /**
882
+ * Sets the stack `key` to `value`.
883
+ *
884
+ * @private
885
+ * @name set
886
+ * @memberOf Stack
887
+ * @param {string} key The key of the value to set.
888
+ * @param {*} value The value to set.
889
+ * @returns {Object} Returns the stack cache instance.
890
+ */
891
+ function stackSet(key, value) {
892
+ var data = this.__data__;
893
+ if (data instanceof ListCache) {
894
+ var pairs = data.__data__;
895
+ if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
896
+ pairs.push([key, value]);
897
+ this.size = ++data.size;
898
+ return this;
899
+ }
900
+ data = this.__data__ = new MapCache(pairs);
901
+ }
902
+ data.set(key, value);
903
+ this.size = data.size;
904
+ return this;
905
+ }
906
+
907
+ // Add methods to `Stack`.
908
+ Stack.prototype.clear = stackClear;
909
+ Stack.prototype['delete'] = stackDelete;
910
+ Stack.prototype.get = stackGet;
911
+ Stack.prototype.has = stackHas;
912
+ Stack.prototype.set = stackSet;
913
+
914
+ /**
915
+ * Creates an array of the enumerable property names of the array-like `value`.
916
+ *
917
+ * @private
918
+ * @param {*} value The value to query.
919
+ * @param {boolean} inherited Specify returning inherited property names.
920
+ * @returns {Array} Returns the array of property names.
921
+ */
922
+ function arrayLikeKeys(value, inherited) {
923
+ var isArr = isArray(value),
924
+ isArg = !isArr && isArguments(value),
925
+ isBuff = !isArr && !isArg && isBuffer(value),
926
+ isType = !isArr && !isArg && !isBuff && isTypedArray(value),
927
+ skipIndexes = isArr || isArg || isBuff || isType,
928
+ result = skipIndexes ? baseTimes(value.length, String) : [],
929
+ length = result.length;
930
+
931
+ for (var key in value) {
932
+ if ((inherited || hasOwnProperty.call(value, key)) &&
933
+ !(skipIndexes && (
934
+ // Safari 9 has enumerable `arguments.length` in strict mode.
935
+ key == 'length' ||
936
+ // Node.js 0.10 has enumerable non-index properties on buffers.
937
+ (isBuff && (key == 'offset' || key == 'parent')) ||
938
+ // PhantomJS 2 has enumerable non-index properties on typed arrays.
939
+ (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
940
+ // Skip index properties.
941
+ isIndex(key, length)
942
+ ))) {
943
+ result.push(key);
944
+ }
945
+ }
946
+ return result;
947
+ }
948
+
949
+ /**
950
+ * Gets the index at which the `key` is found in `array` of key-value pairs.
951
+ *
952
+ * @private
953
+ * @param {Array} array The array to inspect.
954
+ * @param {*} key The key to search for.
955
+ * @returns {number} Returns the index of the matched value, else `-1`.
956
+ */
957
+ function assocIndexOf(array, key) {
958
+ var length = array.length;
959
+ while (length--) {
960
+ if (eq(array[length][0], key)) {
961
+ return length;
962
+ }
963
+ }
964
+ return -1;
965
+ }
966
+
967
+ /**
968
+ * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
969
+ * `keysFunc` and `symbolsFunc` to get the enumerable property names and
970
+ * symbols of `object`.
971
+ *
972
+ * @private
973
+ * @param {Object} object The object to query.
974
+ * @param {Function} keysFunc The function to get the keys of `object`.
975
+ * @param {Function} symbolsFunc The function to get the symbols of `object`.
976
+ * @returns {Array} Returns the array of property names and symbols.
977
+ */
978
+ function baseGetAllKeys(object, keysFunc, symbolsFunc) {
979
+ var result = keysFunc(object);
980
+ return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
981
+ }
982
+
983
+ /**
984
+ * The base implementation of `getTag` without fallbacks for buggy environments.
985
+ *
986
+ * @private
987
+ * @param {*} value The value to query.
988
+ * @returns {string} Returns the `toStringTag`.
989
+ */
990
+ function baseGetTag(value) {
991
+ if (value == null) {
992
+ return value === undefined ? undefinedTag : nullTag;
993
+ }
994
+ return (symToStringTag && symToStringTag in Object(value))
995
+ ? getRawTag(value)
996
+ : objectToString(value);
997
+ }
998
+
999
+ /**
1000
+ * The base implementation of `_.isArguments`.
1001
+ *
1002
+ * @private
1003
+ * @param {*} value The value to check.
1004
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
1005
+ */
1006
+ function baseIsArguments(value) {
1007
+ return isObjectLike(value) && baseGetTag(value) == argsTag;
1008
+ }
1009
+
1010
+ /**
1011
+ * The base implementation of `_.isEqual` which supports partial comparisons
1012
+ * and tracks traversed objects.
1013
+ *
1014
+ * @private
1015
+ * @param {*} value The value to compare.
1016
+ * @param {*} other The other value to compare.
1017
+ * @param {boolean} bitmask The bitmask flags.
1018
+ * 1 - Unordered comparison
1019
+ * 2 - Partial comparison
1020
+ * @param {Function} [customizer] The function to customize comparisons.
1021
+ * @param {Object} [stack] Tracks traversed `value` and `other` objects.
1022
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
1023
+ */
1024
+ function baseIsEqual(value, other, bitmask, customizer, stack) {
1025
+ if (value === other) {
1026
+ return true;
1027
+ }
1028
+ if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
1029
+ return value !== value && other !== other;
1030
+ }
1031
+ return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
1032
+ }
1033
+
1034
+ /**
1035
+ * A specialized version of `baseIsEqual` for arrays and objects which performs
1036
+ * deep comparisons and tracks traversed objects enabling objects with circular
1037
+ * references to be compared.
1038
+ *
1039
+ * @private
1040
+ * @param {Object} object The object to compare.
1041
+ * @param {Object} other The other object to compare.
1042
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
1043
+ * @param {Function} customizer The function to customize comparisons.
1044
+ * @param {Function} equalFunc The function to determine equivalents of values.
1045
+ * @param {Object} [stack] Tracks traversed `object` and `other` objects.
1046
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
1047
+ */
1048
+ function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
1049
+ var objIsArr = isArray(object),
1050
+ othIsArr = isArray(other),
1051
+ objTag = objIsArr ? arrayTag : getTag(object),
1052
+ othTag = othIsArr ? arrayTag : getTag(other);
1053
+
1054
+ objTag = objTag == argsTag ? objectTag : objTag;
1055
+ othTag = othTag == argsTag ? objectTag : othTag;
1056
+
1057
+ var objIsObj = objTag == objectTag,
1058
+ othIsObj = othTag == objectTag,
1059
+ isSameTag = objTag == othTag;
1060
+
1061
+ if (isSameTag && isBuffer(object)) {
1062
+ if (!isBuffer(other)) {
1063
+ return false;
1064
+ }
1065
+ objIsArr = true;
1066
+ objIsObj = false;
1067
+ }
1068
+ if (isSameTag && !objIsObj) {
1069
+ stack || (stack = new Stack);
1070
+ return (objIsArr || isTypedArray(object))
1071
+ ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
1072
+ : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
1073
+ }
1074
+ if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
1075
+ var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
1076
+ othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
1077
+
1078
+ if (objIsWrapped || othIsWrapped) {
1079
+ var objUnwrapped = objIsWrapped ? object.value() : object,
1080
+ othUnwrapped = othIsWrapped ? other.value() : other;
1081
+
1082
+ stack || (stack = new Stack);
1083
+ return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
1084
+ }
1085
+ }
1086
+ if (!isSameTag) {
1087
+ return false;
1088
+ }
1089
+ stack || (stack = new Stack);
1090
+ return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
1091
+ }
1092
+
1093
+ /**
1094
+ * The base implementation of `_.isNative` without bad shim checks.
1095
+ *
1096
+ * @private
1097
+ * @param {*} value The value to check.
1098
+ * @returns {boolean} Returns `true` if `value` is a native function,
1099
+ * else `false`.
1100
+ */
1101
+ function baseIsNative(value) {
1102
+ if (!isObject(value) || isMasked(value)) {
1103
+ return false;
1104
+ }
1105
+ var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
1106
+ return pattern.test(toSource(value));
1107
+ }
1108
+
1109
+ /**
1110
+ * The base implementation of `_.isTypedArray` without Node.js optimizations.
1111
+ *
1112
+ * @private
1113
+ * @param {*} value The value to check.
1114
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
1115
+ */
1116
+ function baseIsTypedArray(value) {
1117
+ return isObjectLike(value) &&
1118
+ isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
1119
+ }
1120
+
1121
+ /**
1122
+ * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
1123
+ *
1124
+ * @private
1125
+ * @param {Object} object The object to query.
1126
+ * @returns {Array} Returns the array of property names.
1127
+ */
1128
+ function baseKeys(object) {
1129
+ if (!isPrototype(object)) {
1130
+ return nativeKeys(object);
1131
+ }
1132
+ var result = [];
1133
+ for (var key in Object(object)) {
1134
+ if (hasOwnProperty.call(object, key) && key != 'constructor') {
1135
+ result.push(key);
1136
+ }
1137
+ }
1138
+ return result;
1139
+ }
1140
+
1141
+ /**
1142
+ * A specialized version of `baseIsEqualDeep` for arrays with support for
1143
+ * partial deep comparisons.
1144
+ *
1145
+ * @private
1146
+ * @param {Array} array The array to compare.
1147
+ * @param {Array} other The other array to compare.
1148
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
1149
+ * @param {Function} customizer The function to customize comparisons.
1150
+ * @param {Function} equalFunc The function to determine equivalents of values.
1151
+ * @param {Object} stack Tracks traversed `array` and `other` objects.
1152
+ * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
1153
+ */
1154
+ function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
1155
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
1156
+ arrLength = array.length,
1157
+ othLength = other.length;
1158
+
1159
+ if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
1160
+ return false;
1161
+ }
1162
+ // Assume cyclic values are equal.
1163
+ var stacked = stack.get(array);
1164
+ if (stacked && stack.get(other)) {
1165
+ return stacked == other;
1166
+ }
1167
+ var index = -1,
1168
+ result = true,
1169
+ seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
1170
+
1171
+ stack.set(array, other);
1172
+ stack.set(other, array);
1173
+
1174
+ // Ignore non-index properties.
1175
+ while (++index < arrLength) {
1176
+ var arrValue = array[index],
1177
+ othValue = other[index];
1178
+
1179
+ if (customizer) {
1180
+ var compared = isPartial
1181
+ ? customizer(othValue, arrValue, index, other, array, stack)
1182
+ : customizer(arrValue, othValue, index, array, other, stack);
1183
+ }
1184
+ if (compared !== undefined) {
1185
+ if (compared) {
1186
+ continue;
1187
+ }
1188
+ result = false;
1189
+ break;
1190
+ }
1191
+ // Recursively compare arrays (susceptible to call stack limits).
1192
+ if (seen) {
1193
+ if (!arraySome(other, function(othValue, othIndex) {
1194
+ if (!cacheHas(seen, othIndex) &&
1195
+ (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
1196
+ return seen.push(othIndex);
1197
+ }
1198
+ })) {
1199
+ result = false;
1200
+ break;
1201
+ }
1202
+ } else if (!(
1203
+ arrValue === othValue ||
1204
+ equalFunc(arrValue, othValue, bitmask, customizer, stack)
1205
+ )) {
1206
+ result = false;
1207
+ break;
1208
+ }
1209
+ }
1210
+ stack['delete'](array);
1211
+ stack['delete'](other);
1212
+ return result;
1213
+ }
1214
+
1215
+ /**
1216
+ * A specialized version of `baseIsEqualDeep` for comparing objects of
1217
+ * the same `toStringTag`.
1218
+ *
1219
+ * **Note:** This function only supports comparing values with tags of
1220
+ * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
1221
+ *
1222
+ * @private
1223
+ * @param {Object} object The object to compare.
1224
+ * @param {Object} other The other object to compare.
1225
+ * @param {string} tag The `toStringTag` of the objects to compare.
1226
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
1227
+ * @param {Function} customizer The function to customize comparisons.
1228
+ * @param {Function} equalFunc The function to determine equivalents of values.
1229
+ * @param {Object} stack Tracks traversed `object` and `other` objects.
1230
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
1231
+ */
1232
+ function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
1233
+ switch (tag) {
1234
+ case dataViewTag:
1235
+ if ((object.byteLength != other.byteLength) ||
1236
+ (object.byteOffset != other.byteOffset)) {
1237
+ return false;
1238
+ }
1239
+ object = object.buffer;
1240
+ other = other.buffer;
1241
+
1242
+ case arrayBufferTag:
1243
+ if ((object.byteLength != other.byteLength) ||
1244
+ !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
1245
+ return false;
1246
+ }
1247
+ return true;
1248
+
1249
+ case boolTag:
1250
+ case dateTag:
1251
+ case numberTag:
1252
+ // Coerce booleans to `1` or `0` and dates to milliseconds.
1253
+ // Invalid dates are coerced to `NaN`.
1254
+ return eq(+object, +other);
1255
+
1256
+ case errorTag:
1257
+ return object.name == other.name && object.message == other.message;
1258
+
1259
+ case regexpTag:
1260
+ case stringTag:
1261
+ // Coerce regexes to strings and treat strings, primitives and objects,
1262
+ // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
1263
+ // for more details.
1264
+ return object == (other + '');
1265
+
1266
+ case mapTag:
1267
+ var convert = mapToArray;
1268
+
1269
+ case setTag:
1270
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
1271
+ convert || (convert = setToArray);
1272
+
1273
+ if (object.size != other.size && !isPartial) {
1274
+ return false;
1275
+ }
1276
+ // Assume cyclic values are equal.
1277
+ var stacked = stack.get(object);
1278
+ if (stacked) {
1279
+ return stacked == other;
1280
+ }
1281
+ bitmask |= COMPARE_UNORDERED_FLAG;
1282
+
1283
+ // Recursively compare objects (susceptible to call stack limits).
1284
+ stack.set(object, other);
1285
+ var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
1286
+ stack['delete'](object);
1287
+ return result;
1288
+
1289
+ case symbolTag:
1290
+ if (symbolValueOf) {
1291
+ return symbolValueOf.call(object) == symbolValueOf.call(other);
1292
+ }
1293
+ }
1294
+ return false;
1295
+ }
1296
+
1297
+ /**
1298
+ * A specialized version of `baseIsEqualDeep` for objects with support for
1299
+ * partial deep comparisons.
1300
+ *
1301
+ * @private
1302
+ * @param {Object} object The object to compare.
1303
+ * @param {Object} other The other object to compare.
1304
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
1305
+ * @param {Function} customizer The function to customize comparisons.
1306
+ * @param {Function} equalFunc The function to determine equivalents of values.
1307
+ * @param {Object} stack Tracks traversed `object` and `other` objects.
1308
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
1309
+ */
1310
+ function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
1311
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
1312
+ objProps = getAllKeys(object),
1313
+ objLength = objProps.length,
1314
+ othProps = getAllKeys(other),
1315
+ othLength = othProps.length;
1316
+
1317
+ if (objLength != othLength && !isPartial) {
1318
+ return false;
1319
+ }
1320
+ var index = objLength;
1321
+ while (index--) {
1322
+ var key = objProps[index];
1323
+ if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
1324
+ return false;
1325
+ }
1326
+ }
1327
+ // Assume cyclic values are equal.
1328
+ var stacked = stack.get(object);
1329
+ if (stacked && stack.get(other)) {
1330
+ return stacked == other;
1331
+ }
1332
+ var result = true;
1333
+ stack.set(object, other);
1334
+ stack.set(other, object);
1335
+
1336
+ var skipCtor = isPartial;
1337
+ while (++index < objLength) {
1338
+ key = objProps[index];
1339
+ var objValue = object[key],
1340
+ othValue = other[key];
1341
+
1342
+ if (customizer) {
1343
+ var compared = isPartial
1344
+ ? customizer(othValue, objValue, key, other, object, stack)
1345
+ : customizer(objValue, othValue, key, object, other, stack);
1346
+ }
1347
+ // Recursively compare objects (susceptible to call stack limits).
1348
+ if (!(compared === undefined
1349
+ ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
1350
+ : compared
1351
+ )) {
1352
+ result = false;
1353
+ break;
1354
+ }
1355
+ skipCtor || (skipCtor = key == 'constructor');
1356
+ }
1357
+ if (result && !skipCtor) {
1358
+ var objCtor = object.constructor,
1359
+ othCtor = other.constructor;
1360
+
1361
+ // Non `Object` object instances with different constructors are not equal.
1362
+ if (objCtor != othCtor &&
1363
+ ('constructor' in object && 'constructor' in other) &&
1364
+ !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
1365
+ typeof othCtor == 'function' && othCtor instanceof othCtor)) {
1366
+ result = false;
1367
+ }
1368
+ }
1369
+ stack['delete'](object);
1370
+ stack['delete'](other);
1371
+ return result;
1372
+ }
1373
+
1374
+ /**
1375
+ * Creates an array of own enumerable property names and symbols of `object`.
1376
+ *
1377
+ * @private
1378
+ * @param {Object} object The object to query.
1379
+ * @returns {Array} Returns the array of property names and symbols.
1380
+ */
1381
+ function getAllKeys(object) {
1382
+ return baseGetAllKeys(object, keys, getSymbols);
1383
+ }
1384
+
1385
+ /**
1386
+ * Gets the data for `map`.
1387
+ *
1388
+ * @private
1389
+ * @param {Object} map The map to query.
1390
+ * @param {string} key The reference key.
1391
+ * @returns {*} Returns the map data.
1392
+ */
1393
+ function getMapData(map, key) {
1394
+ var data = map.__data__;
1395
+ return isKeyable(key)
1396
+ ? data[typeof key == 'string' ? 'string' : 'hash']
1397
+ : data.map;
1398
+ }
1399
+
1400
+ /**
1401
+ * Gets the native function at `key` of `object`.
1402
+ *
1403
+ * @private
1404
+ * @param {Object} object The object to query.
1405
+ * @param {string} key The key of the method to get.
1406
+ * @returns {*} Returns the function if it's native, else `undefined`.
1407
+ */
1408
+ function getNative(object, key) {
1409
+ var value = getValue(object, key);
1410
+ return baseIsNative(value) ? value : undefined;
1411
+ }
1412
+
1413
+ /**
1414
+ * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
1415
+ *
1416
+ * @private
1417
+ * @param {*} value The value to query.
1418
+ * @returns {string} Returns the raw `toStringTag`.
1419
+ */
1420
+ function getRawTag(value) {
1421
+ var isOwn = hasOwnProperty.call(value, symToStringTag),
1422
+ tag = value[symToStringTag];
1423
+
1424
+ try {
1425
+ value[symToStringTag] = undefined;
1426
+ var unmasked = true;
1427
+ } catch (e) {}
1428
+
1429
+ var result = nativeObjectToString.call(value);
1430
+ if (unmasked) {
1431
+ if (isOwn) {
1432
+ value[symToStringTag] = tag;
1433
+ } else {
1434
+ delete value[symToStringTag];
1435
+ }
1436
+ }
1437
+ return result;
1438
+ }
1439
+
1440
+ /**
1441
+ * Creates an array of the own enumerable symbols of `object`.
1442
+ *
1443
+ * @private
1444
+ * @param {Object} object The object to query.
1445
+ * @returns {Array} Returns the array of symbols.
1446
+ */
1447
+ var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
1448
+ if (object == null) {
1449
+ return [];
1450
+ }
1451
+ object = Object(object);
1452
+ return arrayFilter(nativeGetSymbols(object), function(symbol) {
1453
+ return propertyIsEnumerable.call(object, symbol);
1454
+ });
1455
+ };
1456
+
1457
+ /**
1458
+ * Gets the `toStringTag` of `value`.
1459
+ *
1460
+ * @private
1461
+ * @param {*} value The value to query.
1462
+ * @returns {string} Returns the `toStringTag`.
1463
+ */
1464
+ var getTag = baseGetTag;
1465
+
1466
+ // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
1467
+ if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
1468
+ (Map && getTag(new Map) != mapTag) ||
1469
+ (Promise && getTag(Promise.resolve()) != promiseTag) ||
1470
+ (Set && getTag(new Set) != setTag) ||
1471
+ (WeakMap && getTag(new WeakMap) != weakMapTag)) {
1472
+ getTag = function(value) {
1473
+ var result = baseGetTag(value),
1474
+ Ctor = result == objectTag ? value.constructor : undefined,
1475
+ ctorString = Ctor ? toSource(Ctor) : '';
1476
+
1477
+ if (ctorString) {
1478
+ switch (ctorString) {
1479
+ case dataViewCtorString: return dataViewTag;
1480
+ case mapCtorString: return mapTag;
1481
+ case promiseCtorString: return promiseTag;
1482
+ case setCtorString: return setTag;
1483
+ case weakMapCtorString: return weakMapTag;
1484
+ }
1485
+ }
1486
+ return result;
1487
+ };
1488
+ }
1489
+
1490
+ /**
1491
+ * Checks if `value` is a valid array-like index.
1492
+ *
1493
+ * @private
1494
+ * @param {*} value The value to check.
1495
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
1496
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
1497
+ */
1498
+ function isIndex(value, length) {
1499
+ length = length == null ? MAX_SAFE_INTEGER : length;
1500
+ return !!length &&
1501
+ (typeof value == 'number' || reIsUint.test(value)) &&
1502
+ (value > -1 && value % 1 == 0 && value < length);
1503
+ }
1504
+
1505
+ /**
1506
+ * Checks if `value` is suitable for use as unique object key.
1507
+ *
1508
+ * @private
1509
+ * @param {*} value The value to check.
1510
+ * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
1511
+ */
1512
+ function isKeyable(value) {
1513
+ var type = typeof value;
1514
+ return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
1515
+ ? (value !== '__proto__')
1516
+ : (value === null);
1517
+ }
1518
+
1519
+ /**
1520
+ * Checks if `func` has its source masked.
1521
+ *
1522
+ * @private
1523
+ * @param {Function} func The function to check.
1524
+ * @returns {boolean} Returns `true` if `func` is masked, else `false`.
1525
+ */
1526
+ function isMasked(func) {
1527
+ return !!maskSrcKey && (maskSrcKey in func);
1528
+ }
1529
+
1530
+ /**
1531
+ * Checks if `value` is likely a prototype object.
1532
+ *
1533
+ * @private
1534
+ * @param {*} value The value to check.
1535
+ * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
1536
+ */
1537
+ function isPrototype(value) {
1538
+ var Ctor = value && value.constructor,
1539
+ proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
1540
+
1541
+ return value === proto;
1542
+ }
1543
+
1544
+ /**
1545
+ * Converts `value` to a string using `Object.prototype.toString`.
1546
+ *
1547
+ * @private
1548
+ * @param {*} value The value to convert.
1549
+ * @returns {string} Returns the converted string.
1550
+ */
1551
+ function objectToString(value) {
1552
+ return nativeObjectToString.call(value);
1553
+ }
1554
+
1555
+ /**
1556
+ * Converts `func` to its source code.
1557
+ *
1558
+ * @private
1559
+ * @param {Function} func The function to convert.
1560
+ * @returns {string} Returns the source code.
1561
+ */
1562
+ function toSource(func) {
1563
+ if (func != null) {
1564
+ try {
1565
+ return funcToString.call(func);
1566
+ } catch (e) {}
1567
+ try {
1568
+ return (func + '');
1569
+ } catch (e) {}
1570
+ }
1571
+ return '';
1572
+ }
1573
+
1574
+ /**
1575
+ * Performs a
1576
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
1577
+ * comparison between two values to determine if they are equivalent.
1578
+ *
1579
+ * @static
1580
+ * @memberOf _
1581
+ * @since 4.0.0
1582
+ * @category Lang
1583
+ * @param {*} value The value to compare.
1584
+ * @param {*} other The other value to compare.
1585
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
1586
+ * @example
1587
+ *
1588
+ * var object = { 'a': 1 };
1589
+ * var other = { 'a': 1 };
1590
+ *
1591
+ * _.eq(object, object);
1592
+ * // => true
1593
+ *
1594
+ * _.eq(object, other);
1595
+ * // => false
1596
+ *
1597
+ * _.eq('a', 'a');
1598
+ * // => true
1599
+ *
1600
+ * _.eq('a', Object('a'));
1601
+ * // => false
1602
+ *
1603
+ * _.eq(NaN, NaN);
1604
+ * // => true
1605
+ */
1606
+ function eq(value, other) {
1607
+ return value === other || (value !== value && other !== other);
1608
+ }
1609
+
1610
+ /**
1611
+ * Checks if `value` is likely an `arguments` object.
1612
+ *
1613
+ * @static
1614
+ * @memberOf _
1615
+ * @since 0.1.0
1616
+ * @category Lang
1617
+ * @param {*} value The value to check.
1618
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
1619
+ * else `false`.
1620
+ * @example
1621
+ *
1622
+ * _.isArguments(function() { return arguments; }());
1623
+ * // => true
1624
+ *
1625
+ * _.isArguments([1, 2, 3]);
1626
+ * // => false
1627
+ */
1628
+ var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
1629
+ return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
1630
+ !propertyIsEnumerable.call(value, 'callee');
1631
+ };
1632
+
1633
+ /**
1634
+ * Checks if `value` is classified as an `Array` object.
1635
+ *
1636
+ * @static
1637
+ * @memberOf _
1638
+ * @since 0.1.0
1639
+ * @category Lang
1640
+ * @param {*} value The value to check.
1641
+ * @returns {boolean} Returns `true` if `value` is an array, else `false`.
1642
+ * @example
1643
+ *
1644
+ * _.isArray([1, 2, 3]);
1645
+ * // => true
1646
+ *
1647
+ * _.isArray(document.body.children);
1648
+ * // => false
1649
+ *
1650
+ * _.isArray('abc');
1651
+ * // => false
1652
+ *
1653
+ * _.isArray(_.noop);
1654
+ * // => false
1655
+ */
1656
+ var isArray = Array.isArray;
1657
+
1658
+ /**
1659
+ * Checks if `value` is array-like. A value is considered array-like if it's
1660
+ * not a function and has a `value.length` that's an integer greater than or
1661
+ * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
1662
+ *
1663
+ * @static
1664
+ * @memberOf _
1665
+ * @since 4.0.0
1666
+ * @category Lang
1667
+ * @param {*} value The value to check.
1668
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
1669
+ * @example
1670
+ *
1671
+ * _.isArrayLike([1, 2, 3]);
1672
+ * // => true
1673
+ *
1674
+ * _.isArrayLike(document.body.children);
1675
+ * // => true
1676
+ *
1677
+ * _.isArrayLike('abc');
1678
+ * // => true
1679
+ *
1680
+ * _.isArrayLike(_.noop);
1681
+ * // => false
1682
+ */
1683
+ function isArrayLike(value) {
1684
+ return value != null && isLength(value.length) && !isFunction(value);
1685
+ }
1686
+
1687
+ /**
1688
+ * Checks if `value` is a buffer.
1689
+ *
1690
+ * @static
1691
+ * @memberOf _
1692
+ * @since 4.3.0
1693
+ * @category Lang
1694
+ * @param {*} value The value to check.
1695
+ * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
1696
+ * @example
1697
+ *
1698
+ * _.isBuffer(new Buffer(2));
1699
+ * // => true
1700
+ *
1701
+ * _.isBuffer(new Uint8Array(2));
1702
+ * // => false
1703
+ */
1704
+ var isBuffer = nativeIsBuffer || stubFalse;
1705
+
1706
+ /**
1707
+ * Performs a deep comparison between two values to determine if they are
1708
+ * equivalent.
1709
+ *
1710
+ * **Note:** This method supports comparing arrays, array buffers, booleans,
1711
+ * date objects, error objects, maps, numbers, `Object` objects, regexes,
1712
+ * sets, strings, symbols, and typed arrays. `Object` objects are compared
1713
+ * by their own, not inherited, enumerable properties. Functions and DOM
1714
+ * nodes are compared by strict equality, i.e. `===`.
1715
+ *
1716
+ * @static
1717
+ * @memberOf _
1718
+ * @since 0.1.0
1719
+ * @category Lang
1720
+ * @param {*} value The value to compare.
1721
+ * @param {*} other The other value to compare.
1722
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
1723
+ * @example
1724
+ *
1725
+ * var object = { 'a': 1 };
1726
+ * var other = { 'a': 1 };
1727
+ *
1728
+ * _.isEqual(object, other);
1729
+ * // => true
1730
+ *
1731
+ * object === other;
1732
+ * // => false
1733
+ */
1734
+ function isEqual(value, other) {
1735
+ return baseIsEqual(value, other);
1736
+ }
1737
+
1738
+ /**
1739
+ * Checks if `value` is classified as a `Function` object.
1740
+ *
1741
+ * @static
1742
+ * @memberOf _
1743
+ * @since 0.1.0
1744
+ * @category Lang
1745
+ * @param {*} value The value to check.
1746
+ * @returns {boolean} Returns `true` if `value` is a function, else `false`.
1747
+ * @example
1748
+ *
1749
+ * _.isFunction(_);
1750
+ * // => true
1751
+ *
1752
+ * _.isFunction(/abc/);
1753
+ * // => false
1754
+ */
1755
+ function isFunction(value) {
1756
+ if (!isObject(value)) {
1757
+ return false;
1758
+ }
1759
+ // The use of `Object#toString` avoids issues with the `typeof` operator
1760
+ // in Safari 9 which returns 'object' for typed arrays and other constructors.
1761
+ var tag = baseGetTag(value);
1762
+ return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
1763
+ }
1764
+
1765
+ /**
1766
+ * Checks if `value` is a valid array-like length.
1767
+ *
1768
+ * **Note:** This method is loosely based on
1769
+ * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
1770
+ *
1771
+ * @static
1772
+ * @memberOf _
1773
+ * @since 4.0.0
1774
+ * @category Lang
1775
+ * @param {*} value The value to check.
1776
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
1777
+ * @example
1778
+ *
1779
+ * _.isLength(3);
1780
+ * // => true
1781
+ *
1782
+ * _.isLength(Number.MIN_VALUE);
1783
+ * // => false
1784
+ *
1785
+ * _.isLength(Infinity);
1786
+ * // => false
1787
+ *
1788
+ * _.isLength('3');
1789
+ * // => false
1790
+ */
1791
+ function isLength(value) {
1792
+ return typeof value == 'number' &&
1793
+ value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
1794
+ }
1795
+
1796
+ /**
1797
+ * Checks if `value` is the
1798
+ * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
1799
+ * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
1800
+ *
1801
+ * @static
1802
+ * @memberOf _
1803
+ * @since 0.1.0
1804
+ * @category Lang
1805
+ * @param {*} value The value to check.
1806
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
1807
+ * @example
1808
+ *
1809
+ * _.isObject({});
1810
+ * // => true
1811
+ *
1812
+ * _.isObject([1, 2, 3]);
1813
+ * // => true
1814
+ *
1815
+ * _.isObject(_.noop);
1816
+ * // => true
1817
+ *
1818
+ * _.isObject(null);
1819
+ * // => false
1820
+ */
1821
+ function isObject(value) {
1822
+ var type = typeof value;
1823
+ return value != null && (type == 'object' || type == 'function');
1824
+ }
1825
+
1826
+ /**
1827
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
1828
+ * and has a `typeof` result of "object".
1829
+ *
1830
+ * @static
1831
+ * @memberOf _
1832
+ * @since 4.0.0
1833
+ * @category Lang
1834
+ * @param {*} value The value to check.
1835
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
1836
+ * @example
1837
+ *
1838
+ * _.isObjectLike({});
1839
+ * // => true
1840
+ *
1841
+ * _.isObjectLike([1, 2, 3]);
1842
+ * // => true
1843
+ *
1844
+ * _.isObjectLike(_.noop);
1845
+ * // => false
1846
+ *
1847
+ * _.isObjectLike(null);
1848
+ * // => false
1849
+ */
1850
+ function isObjectLike(value) {
1851
+ return value != null && typeof value == 'object';
1852
+ }
1853
+
1854
+ /**
1855
+ * Checks if `value` is classified as a typed array.
1856
+ *
1857
+ * @static
1858
+ * @memberOf _
1859
+ * @since 3.0.0
1860
+ * @category Lang
1861
+ * @param {*} value The value to check.
1862
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
1863
+ * @example
1864
+ *
1865
+ * _.isTypedArray(new Uint8Array);
1866
+ * // => true
1867
+ *
1868
+ * _.isTypedArray([]);
1869
+ * // => false
1870
+ */
1871
+ var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
1872
+
1873
+ /**
1874
+ * Creates an array of the own enumerable property names of `object`.
1875
+ *
1876
+ * **Note:** Non-object values are coerced to objects. See the
1877
+ * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
1878
+ * for more details.
1879
+ *
1880
+ * @static
1881
+ * @since 0.1.0
1882
+ * @memberOf _
1883
+ * @category Object
1884
+ * @param {Object} object The object to query.
1885
+ * @returns {Array} Returns the array of property names.
1886
+ * @example
1887
+ *
1888
+ * function Foo() {
1889
+ * this.a = 1;
1890
+ * this.b = 2;
1891
+ * }
1892
+ *
1893
+ * Foo.prototype.c = 3;
1894
+ *
1895
+ * _.keys(new Foo);
1896
+ * // => ['a', 'b'] (iteration order is not guaranteed)
1897
+ *
1898
+ * _.keys('hi');
1899
+ * // => ['0', '1']
1900
+ */
1901
+ function keys(object) {
1902
+ return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
1903
+ }
1904
+
1905
+ /**
1906
+ * This method returns a new empty array.
1907
+ *
1908
+ * @static
1909
+ * @memberOf _
1910
+ * @since 4.13.0
1911
+ * @category Util
1912
+ * @returns {Array} Returns the new empty array.
1913
+ * @example
1914
+ *
1915
+ * var arrays = _.times(2, _.stubArray);
1916
+ *
1917
+ * console.log(arrays);
1918
+ * // => [[], []]
1919
+ *
1920
+ * console.log(arrays[0] === arrays[1]);
1921
+ * // => false
1922
+ */
1923
+ function stubArray() {
1924
+ return [];
1925
+ }
1926
+
1927
+ /**
1928
+ * This method returns `false`.
1929
+ *
1930
+ * @static
1931
+ * @memberOf _
1932
+ * @since 4.13.0
1933
+ * @category Util
1934
+ * @returns {boolean} Returns `false`.
1935
+ * @example
1936
+ *
1937
+ * _.times(2, _.stubFalse);
1938
+ * // => [false, false]
1939
+ */
1940
+ function stubFalse() {
1941
+ return false;
1942
+ }
1943
+
1944
+ module.exports = isEqual;
1945
+ }(lodash_isequal, lodash_isequal.exports));
1946
+
1947
+ // Unique ID creation requires a high quality random # generator. In the browser we therefore
1948
+ // require the crypto API and do not support built-in fallback to lower quality random number
1949
+ // generators (like Math.random()).
1950
+ var getRandomValues;
1951
+ var rnds8 = new Uint8Array(16);
1952
+ function rng() {
1953
+ // lazy load so that environments that need to polyfill have a chance to do so
1954
+ if (!getRandomValues) {
1955
+ // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also,
1956
+ // find the complete implementation of crypto (msCrypto) on IE11.
1957
+ getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);
1958
+
1959
+ if (!getRandomValues) {
1960
+ throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
1961
+ }
1962
+ }
1963
+
1964
+ return getRandomValues(rnds8);
1965
+ }
1966
+
1967
+ var REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
1968
+
1969
+ function validate(uuid) {
1970
+ return typeof uuid === 'string' && REGEX.test(uuid);
1971
+ }
1972
+
1973
+ /**
1974
+ * Convert array of 16 byte values to UUID string format of the form:
1975
+ * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
1976
+ */
1977
+
1978
+ var byteToHex = [];
1979
+
1980
+ for (var i = 0; i < 256; ++i) {
1981
+ byteToHex.push((i + 0x100).toString(16).substr(1));
1982
+ }
1983
+
1984
+ function stringify(arr) {
1985
+ var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
1986
+ // Note: Be careful editing this code! It's been tuned for performance
1987
+ // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
1988
+ var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one
1989
+ // of the following:
1990
+ // - One or more input array values don't map to a hex octet (leading to
1991
+ // "undefined" in the uuid)
1992
+ // - Invalid input values for the RFC `version` or `variant` fields
1993
+
1994
+ if (!validate(uuid)) {
1995
+ throw TypeError('Stringified UUID is invalid');
1996
+ }
1997
+
1998
+ return uuid;
1999
+ }
2000
+
2001
+ function v4(options, buf, offset) {
2002
+ options = options || {};
2003
+ var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
2004
+
2005
+ rnds[6] = rnds[6] & 0x0f | 0x40;
2006
+ rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
2007
+
2008
+ if (buf) {
2009
+ offset = offset || 0;
2010
+
2011
+ for (var i = 0; i < 16; ++i) {
2012
+ buf[offset + i] = rnds[i];
2013
+ }
2014
+
2015
+ return buf;
2016
+ }
2017
+
2018
+ return stringify(rnds);
2019
+ }
2020
+
2021
+ function create() {
2022
+ return v4();
2023
+ }
2024
+ function fromMsbLsb(msb, lsb) {
2025
+ function digits(val, ds) {
2026
+ var hi = BigInt(1) << (ds * BigInt(4));
2027
+ return (hi | (val & (hi - BigInt(1)))).toString(16).substring(1);
2028
+ }
2029
+ var msbB = typeof msb === 'string' ? BigInt(msb) : msb;
2030
+ var lsbB = typeof lsb === 'string' ? BigInt(lsb) : lsb;
2031
+ var sec1 = digits(msbB >> BigInt(32), BigInt(8));
2032
+ var sec2 = digits(msbB >> BigInt(16), BigInt(4));
2033
+ var sec3 = digits(msbB, BigInt(4));
2034
+ var sec4 = digits(lsbB >> BigInt(48), BigInt(4));
2035
+ var sec5 = digits(lsbB, BigInt(12));
2036
+ return "".concat(sec1, "-").concat(sec2, "-").concat(sec3, "-").concat(sec4, "-").concat(sec5);
2037
+ }
2038
+ function toMsbLsb(id) {
2039
+ var _a = tslib_es6.__read(id.split('-'), 5), c1 = _a[0], c2 = _a[1], c3 = _a[2], c4 = _a[3], c5 = _a[4];
2040
+ if (c1 == null || c2 == null || c3 == null || c4 == null || c5 == null) {
2041
+ throw new Error("Invalid UUID string ".concat(id));
2042
+ }
2043
+ var msb = BigInt.asIntN(64, BigInt("0x".concat(c1 + c2 + c3)));
2044
+ var lsb = BigInt.asIntN(64, BigInt("0x".concat(c4 + c5)));
2045
+ return { msb: msb.toString(), lsb: lsb.toString() };
2046
+ }
2047
+
2048
+ var uuid = /*#__PURE__*/Object.freeze({
2049
+ __proto__: null,
2050
+ create: create,
2051
+ fromMsbLsb: fromMsbLsb,
2052
+ toMsbLsb: toMsbLsb
2053
+ });
2054
+
2055
+ function getBoundingClientRect(el) {
2056
+ return el.getBoundingClientRect();
2057
+ }
2058
+
2059
+ const tooltipCss = ":host{--tooltip-width:auto;--tooltip-white-space:normal;display:flex}.popover{width:100%;height:100%}.target{display:flex}.content-hidden{display:none}.tooltip{display:flex;justify-content:center;text-align:center;width:var(--tooltip-width);font-family:var(--vertex-ui-font-family);font-size:var(--vertex-ui-text-xxs);background-color:var(--vertex-ui-neutral-700);color:var(--vertex-ui-white);padding:0.25rem 0.5rem;border-radius:4px;pointer-events:none;white-space:var(--tooltip-white-space);user-select:none}.tooltip.hidden{display:none}";
2060
+
2061
+ const TOOLTIP_OPEN_DELAY = 500;
2062
+ const Tooltip = class {
2063
+ constructor(hostRef) {
2064
+ index.registerInstance(this, hostRef);
2065
+ this.content = undefined;
2066
+ this.disabled = undefined;
2067
+ this.placement = 'bottom';
2068
+ this.delay = TOOLTIP_OPEN_DELAY;
2069
+ this.animated = true;
2070
+ this.open = false;
2071
+ this.handlePointerEnter = this.handlePointerEnter.bind(this);
2072
+ this.handlePointerLeave = this.handlePointerLeave.bind(this);
2073
+ this.tooltipId = `vertex-tooltip-${uuid.create()}`;
2074
+ }
2075
+ disconnectedCallback() {
2076
+ this.removeElement();
2077
+ this.clearOpenTimeout();
2078
+ }
2079
+ render() {
2080
+ return (index.h(index.Host, null, index.h("div", { class: "target", ref: (el) => {
2081
+ this.targetElement = el;
2082
+ }, onPointerEnter: this.handlePointerEnter, onPointerLeave: this.handlePointerLeave }, index.h("slot", null)), index.h("div", { class: "content-hidden", ref: (el) => {
2083
+ this.contentElement = el;
2084
+ } }, index.h("slot", { name: "content" }))));
2085
+ }
2086
+ addElement() {
2087
+ var _a;
2088
+ if (this.targetElement != null) {
2089
+ const popover = this.createPopoverElement(this.targetElement);
2090
+ const content = this.createContentElement();
2091
+ this.displayedSlottedContent =
2092
+ (_a = slots.getSlottedContent(this.contentElement)) !== null && _a !== void 0 ? _a : this.displayedSlottedContent;
2093
+ if (this.content != null) {
2094
+ content.innerText = this.content;
2095
+ }
2096
+ else if (this.displayedSlottedContent != null) {
2097
+ content.appendChild(this.displayedSlottedContent);
2098
+ }
2099
+ popover.appendChild(content);
2100
+ this.hostElement.ownerDocument.body.appendChild(popover);
2101
+ }
2102
+ }
2103
+ removeElement() {
2104
+ const popover = this.hostElement.ownerDocument.getElementById(this.tooltipId);
2105
+ if (popover != null) {
2106
+ popover.remove();
2107
+ }
2108
+ }
2109
+ createPopoverElement(anchorElement) {
2110
+ const popover = this.hostElement.ownerDocument.createElement('vertex-popover');
2111
+ popover.id = this.tooltipId;
2112
+ popover.setAttribute('class', 'vertex-tooltip-popover');
2113
+ popover.open = this.open;
2114
+ popover.resizeBehavior = 'fixed';
2115
+ popover.backdrop = false;
2116
+ popover.placement = this.placement;
2117
+ popover.animated = this.animated;
2118
+ popover.anchorBounds = getBoundingClientRect(anchorElement);
2119
+ return popover;
2120
+ }
2121
+ createContentElement() {
2122
+ const content = this.hostElement.ownerDocument.createElement('div');
2123
+ content.setAttribute('class', index$1.classnames('vertex-tooltip-content', {
2124
+ hidden: !this.open || this.disabled,
2125
+ }));
2126
+ return content;
2127
+ }
2128
+ handlePointerEnter() {
2129
+ if (this.openTimeout == null && !this.disabled) {
2130
+ this.openTimeout = setTimeout(() => {
2131
+ this.open = true;
2132
+ this.openTimeout = undefined;
2133
+ this.addElement();
2134
+ }, this.delay);
2135
+ }
2136
+ }
2137
+ handlePointerLeave() {
2138
+ this.clearOpenTimeout();
2139
+ this.removeElement();
2140
+ this.open = false;
2141
+ }
2142
+ clearOpenTimeout() {
2143
+ if (this.openTimeout != null) {
2144
+ clearTimeout(this.openTimeout);
2145
+ this.openTimeout = undefined;
2146
+ }
2147
+ }
2148
+ get hostElement() { return index.getElement(this); }
2149
+ };
2150
+ Tooltip.style = tooltipCss;
2151
+
2152
+ exports.Tooltip = Tooltip;