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