@revolist/revogrid 4.4.0-next.2 → 4.4.0-next.21

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 (243) hide show
  1. package/custom-element/columnService.js +1 -1
  2. package/custom-element/consts.js +2 -1
  3. package/custom-element/consts.js.map +1 -1
  4. package/custom-element/localScrollService.js +1 -1
  5. package/custom-element/localScrollService.js.map +1 -1
  6. package/custom-element/revo-grid.js +163 -97
  7. package/custom-element/revo-grid.js.map +1 -1
  8. package/custom-element/revogr-clipboard.js +24 -5
  9. package/custom-element/revogr-clipboard.js.map +1 -1
  10. package/custom-element/revogr-edit2.js +12 -6
  11. package/custom-element/revogr-edit2.js.map +1 -1
  12. package/custom-element/revogr-focus2.js +1 -1
  13. package/custom-element/revogr-focus2.js.map +1 -1
  14. package/custom-element/revogr-header2.js +25 -11
  15. package/custom-element/revogr-header2.js.map +1 -1
  16. package/custom-element/revogr-overlay-selection2.js +99 -32
  17. package/custom-element/revogr-overlay-selection2.js.map +1 -1
  18. package/custom-element/revogr-row-headers2.js +1 -2
  19. package/custom-element/revogr-row-headers2.js.map +1 -1
  20. package/custom-element/revogr-viewport-scroll2.js +39 -6
  21. package/custom-element/revogr-viewport-scroll2.js.map +1 -1
  22. package/dist/cjs/{debounce-525dd66c.js → debounce-f50730b6.js} +1 -38
  23. package/dist/cjs/debounce-f50730b6.js.map +1 -0
  24. package/dist/cjs/dispatcher-20520c70.js +21 -0
  25. package/dist/cjs/dispatcher-20520c70.js.map +1 -0
  26. package/dist/cjs/events-030618fc.js +459 -0
  27. package/dist/cjs/events-030618fc.js.map +1 -0
  28. package/dist/cjs/filter.button-6badec7a.js +44 -0
  29. package/dist/cjs/filter.button-6badec7a.js.map +1 -0
  30. package/dist/cjs/{index-aad39b7b.js → index-ee2ef5ae.js} +96 -36
  31. package/dist/cjs/index-ee2ef5ae.js.map +1 -0
  32. package/dist/cjs/index-effc94b9.js +3944 -0
  33. package/dist/cjs/index-effc94b9.js.map +1 -0
  34. package/dist/cjs/isString-3dde8d95.js +38 -0
  35. package/dist/cjs/isString-3dde8d95.js.map +1 -0
  36. package/dist/cjs/keyCodes.utils-d665ebed.js +271 -0
  37. package/dist/cjs/keyCodes.utils-d665ebed.js.map +1 -0
  38. package/dist/cjs/loader.cjs.js +3 -3
  39. package/dist/cjs/loader.cjs.js.map +1 -1
  40. package/dist/cjs/localScrollService-a81823c5.js +403 -0
  41. package/dist/cjs/localScrollService-a81823c5.js.map +1 -0
  42. package/dist/cjs/revo-grid.cjs.entry.js +3858 -0
  43. package/dist/cjs/revo-grid.cjs.entry.js.map +1 -0
  44. package/dist/cjs/revo-grid.cjs.js +3 -3
  45. package/dist/cjs/revo-grid.cjs.js.map +1 -1
  46. package/dist/cjs/revogr-clipboard.cjs.entry.js +24 -6
  47. package/dist/cjs/revogr-clipboard.cjs.entry.js.map +1 -1
  48. package/dist/cjs/revogr-data_3.cjs.entry.js +1138 -0
  49. package/dist/cjs/revogr-data_3.cjs.entry.js.map +1 -0
  50. package/dist/cjs/revogr-edit_2.cjs.entry.js +325 -0
  51. package/dist/cjs/revogr-edit_2.cjs.entry.js.map +1 -0
  52. package/dist/cjs/revogr-filter-panel.cjs.entry.js +6 -5
  53. package/dist/cjs/revogr-filter-panel.cjs.entry.js.map +1 -1
  54. package/dist/cjs/revogr-focus_5.cjs.entry.js +1231 -0
  55. package/dist/cjs/revogr-focus_5.cjs.entry.js.map +1 -0
  56. package/dist/cjs/{revo-grid_11.cjs.entry.js → viewport.helpers-70ccec8f.js} +13978 -25269
  57. package/dist/cjs/viewport.helpers-70ccec8f.js.map +1 -0
  58. package/dist/collection/collection-manifest.json +1 -1
  59. package/dist/collection/components/clipboard/revogr-clipboard.d.ts +6 -2
  60. package/dist/collection/components/clipboard/revogr-clipboard.js +46 -5
  61. package/dist/collection/components/clipboard/revogr-clipboard.js.map +1 -1
  62. package/dist/collection/components/header/headerCellRenderer.d.ts +2 -1
  63. package/dist/collection/components/header/headerCellRenderer.js +1 -1
  64. package/dist/collection/components/header/headerCellRenderer.js.map +1 -1
  65. package/dist/collection/components/header/headerRenderer.d.ts +2 -2
  66. package/dist/collection/components/header/headerRenderer.js +1 -1
  67. package/dist/collection/components/header/headerRenderer.js.map +1 -1
  68. package/dist/collection/components/header/revogr-header.d.ts +15 -1
  69. package/dist/collection/components/header/revogr-header.js +34 -8
  70. package/dist/collection/components/header/revogr-header.js.map +1 -1
  71. package/dist/collection/components/overlay/autofill.service.d.ts +7 -3
  72. package/dist/collection/components/overlay/autofill.service.js +32 -12
  73. package/dist/collection/components/overlay/autofill.service.js.map +1 -1
  74. package/dist/collection/components/overlay/clipboard.service.d.ts +1 -1
  75. package/dist/collection/components/overlay/clipboard.service.js +2 -2
  76. package/dist/collection/components/overlay/clipboard.service.js.map +1 -1
  77. package/dist/collection/components/overlay/keyboard.service.js +2 -6
  78. package/dist/collection/components/overlay/keyboard.service.js.map +1 -1
  79. package/dist/collection/components/overlay/revogr-edit.d.ts +8 -0
  80. package/dist/collection/components/overlay/revogr-edit.js +34 -9
  81. package/dist/collection/components/overlay/revogr-edit.js.map +1 -1
  82. package/dist/collection/components/overlay/revogr-overlay-selection.d.ts +32 -10
  83. package/dist/collection/components/overlay/revogr-overlay-selection.js +80 -12
  84. package/dist/collection/components/overlay/revogr-overlay-selection.js.map +1 -1
  85. package/dist/collection/components/overlay/revogr-overlay-style.css +71 -4
  86. package/dist/collection/components/revoGrid/revo-grid.d.ts +15 -4
  87. package/dist/collection/components/revoGrid/revo-grid.js +60 -19
  88. package/dist/collection/components/revoGrid/revo-grid.js.map +1 -1
  89. package/dist/collection/components/revoGrid/viewport.scrolling.service.d.ts +6 -2
  90. package/dist/collection/components/revoGrid/viewport.scrolling.service.js +26 -4
  91. package/dist/collection/components/revoGrid/viewport.scrolling.service.js.map +1 -1
  92. package/dist/collection/components/revoGrid/viewport.section.d.ts +3 -2
  93. package/dist/collection/components/revoGrid/viewport.section.js +8 -4
  94. package/dist/collection/components/revoGrid/viewport.section.js.map +1 -1
  95. package/dist/collection/components/revoGrid/viewport.service.d.ts +4 -0
  96. package/dist/collection/components/revoGrid/viewport.service.js +15 -3
  97. package/dist/collection/components/revoGrid/viewport.service.js.map +1 -1
  98. package/dist/collection/components/rowHeaders/revogr-row-headers.js.map +1 -1
  99. package/dist/collection/components/scroll/revogr-viewport-scroll-style.css +3 -0
  100. package/dist/collection/components/scroll/revogr-viewport-scroll.d.ts +16 -5
  101. package/dist/collection/components/scroll/revogr-viewport-scroll.js +64 -9
  102. package/dist/collection/components/scroll/revogr-viewport-scroll.js.map +1 -1
  103. package/dist/collection/components/selectionFocus/revogr-focus-style.css +1 -1
  104. package/dist/collection/components.d.ts +110 -6
  105. package/dist/collection/interfaces.d.ts +4 -1
  106. package/dist/collection/plugins/groupingColumn/columnGroupsRenderer.d.ts +3 -2
  107. package/dist/collection/plugins/groupingColumn/columnGroupsRenderer.js +2 -2
  108. package/dist/collection/plugins/groupingColumn/columnGroupsRenderer.js.map +1 -1
  109. package/dist/collection/plugins/groupingColumn/headerGroupRenderer.d.ts +2 -2
  110. package/dist/collection/plugins/groupingColumn/headerGroupRenderer.js +1 -1
  111. package/dist/collection/plugins/groupingColumn/headerGroupRenderer.js.map +1 -1
  112. package/dist/collection/plugins/sorting/sorting.plugin.d.ts +21 -13
  113. package/dist/collection/plugins/sorting/sorting.plugin.js +77 -70
  114. package/dist/collection/plugins/sorting/sorting.plugin.js.map +1 -1
  115. package/dist/collection/serve/controller.js +183 -0
  116. package/dist/collection/services/localScrollService.js +1 -1
  117. package/dist/collection/services/localScrollService.js.map +1 -1
  118. package/dist/collection/services/resizable.directive.d.ts +8 -7
  119. package/dist/collection/services/resizable.directive.js +13 -36
  120. package/dist/collection/services/resizable.directive.js.map +1 -1
  121. package/dist/collection/services/resizable.element.d.ts +4 -0
  122. package/dist/collection/services/resizable.element.js +39 -0
  123. package/dist/collection/services/resizable.element.js.map +1 -0
  124. package/dist/collection/stencil-public-runtime.d.ts +1 -0
  125. package/dist/collection/store/viewPort/viewport.store.js +0 -1
  126. package/dist/collection/store/viewPort/viewport.store.js.map +1 -1
  127. package/dist/collection/utils/consts.d.ts +1 -0
  128. package/dist/collection/utils/consts.js +1 -0
  129. package/dist/collection/utils/consts.js.map +1 -1
  130. package/dist/collection/utils/events.d.ts +2 -1
  131. package/dist/collection/utils/events.js +18 -2
  132. package/dist/collection/utils/events.js.map +1 -1
  133. package/dist/collection/utils/mobile.d.ts +1 -0
  134. package/dist/collection/utils/mobile.js +7 -0
  135. package/dist/collection/utils/mobile.js.map +1 -0
  136. package/dist/esm/{debounce-301fd4d2.js → debounce-820b5a8b.js} +2 -34
  137. package/dist/esm/debounce-820b5a8b.js.map +1 -0
  138. package/dist/esm/dispatcher-9e9c0233.js +19 -0
  139. package/dist/esm/dispatcher-9e9c0233.js.map +1 -0
  140. package/dist/esm/events-31272e5e.js +454 -0
  141. package/dist/esm/events-31272e5e.js.map +1 -0
  142. package/dist/esm/filter.button-21ce90ef.js +38 -0
  143. package/dist/esm/filter.button-21ce90ef.js.map +1 -0
  144. package/dist/esm/{index-5e90b19b.js → index-05947c5f.js} +97 -37
  145. package/dist/esm/index-05947c5f.js.map +1 -0
  146. package/dist/esm/index-728bf6e3.js +3889 -0
  147. package/dist/esm/index-728bf6e3.js.map +1 -0
  148. package/dist/esm/isString-d539060a.js +36 -0
  149. package/dist/esm/isString-d539060a.js.map +1 -0
  150. package/dist/esm/keyCodes.utils-c0064460.js +265 -0
  151. package/dist/esm/keyCodes.utils-c0064460.js.map +1 -0
  152. package/dist/esm/loader.js +4 -4
  153. package/dist/esm/loader.js.map +1 -1
  154. package/dist/esm/localScrollService-884d8952.js +400 -0
  155. package/dist/esm/localScrollService-884d8952.js.map +1 -0
  156. package/dist/esm/revo-grid.entry.js +3854 -0
  157. package/dist/esm/revo-grid.entry.js.map +1 -0
  158. package/dist/esm/revo-grid.js +4 -4
  159. package/dist/esm/revo-grid.js.map +1 -1
  160. package/dist/esm/revogr-clipboard.entry.js +24 -6
  161. package/dist/esm/revogr-clipboard.entry.js.map +1 -1
  162. package/dist/esm/revogr-data_3.entry.js +1132 -0
  163. package/dist/esm/revogr-data_3.entry.js.map +1 -0
  164. package/dist/esm/revogr-edit_2.entry.js +320 -0
  165. package/dist/esm/revogr-edit_2.entry.js.map +1 -0
  166. package/dist/esm/revogr-filter-panel.entry.js +3 -2
  167. package/dist/esm/revogr-filter-panel.entry.js.map +1 -1
  168. package/dist/esm/revogr-focus_5.entry.js +1223 -0
  169. package/dist/esm/revogr-focus_5.entry.js.map +1 -0
  170. package/dist/esm/{revo-grid_11.entry.js → viewport.helpers-c08e729e.js} +13790 -25093
  171. package/dist/esm/viewport.helpers-c08e729e.js.map +1 -0
  172. package/dist/revo-grid/debounce-820b5a8b.js +5 -0
  173. package/dist/revo-grid/debounce-820b5a8b.js.map +1 -0
  174. package/dist/revo-grid/dispatcher-9e9c0233.js +5 -0
  175. package/dist/revo-grid/dispatcher-9e9c0233.js.map +1 -0
  176. package/dist/revo-grid/events-31272e5e.js +5 -0
  177. package/dist/revo-grid/events-31272e5e.js.map +1 -0
  178. package/dist/revo-grid/filter.button-21ce90ef.js +5 -0
  179. package/dist/revo-grid/filter.button-21ce90ef.js.map +1 -0
  180. package/dist/revo-grid/index-05947c5f.js +6 -0
  181. package/dist/revo-grid/index-05947c5f.js.map +1 -0
  182. package/dist/revo-grid/index-728bf6e3.js +5 -0
  183. package/dist/revo-grid/index-728bf6e3.js.map +1 -0
  184. package/dist/revo-grid/isString-d539060a.js +5 -0
  185. package/dist/revo-grid/isString-d539060a.js.map +1 -0
  186. package/dist/revo-grid/keyCodes.utils-c0064460.js +5 -0
  187. package/dist/revo-grid/keyCodes.utils-c0064460.js.map +1 -0
  188. package/dist/revo-grid/localScrollService-884d8952.js +5 -0
  189. package/dist/revo-grid/localScrollService-884d8952.js.map +1 -0
  190. package/dist/revo-grid/revo-grid.entry.js +5 -0
  191. package/dist/revo-grid/revo-grid.entry.js.map +1 -0
  192. package/dist/revo-grid/revo-grid.esm.js +1 -1
  193. package/dist/revo-grid/revo-grid.esm.js.map +1 -1
  194. package/dist/revo-grid/revogr-clipboard.entry.js +1 -1
  195. package/dist/revo-grid/revogr-clipboard.entry.js.map +1 -1
  196. package/dist/revo-grid/revogr-data_3.entry.js +5 -0
  197. package/dist/revo-grid/revogr-data_3.entry.js.map +1 -0
  198. package/dist/revo-grid/revogr-edit_2.entry.js +5 -0
  199. package/dist/revo-grid/revogr-edit_2.entry.js.map +1 -0
  200. package/dist/revo-grid/revogr-filter-panel.entry.js +1 -1
  201. package/dist/revo-grid/revogr-filter-panel.entry.js.map +1 -1
  202. package/dist/revo-grid/revogr-focus_5.entry.js +5 -0
  203. package/dist/revo-grid/revogr-focus_5.entry.js.map +1 -0
  204. package/dist/revo-grid/viewport.helpers-c08e729e.js +5 -0
  205. package/dist/revo-grid/viewport.helpers-c08e729e.js.map +1 -0
  206. package/dist/types/components/clipboard/revogr-clipboard.d.ts +6 -2
  207. package/dist/types/components/header/headerCellRenderer.d.ts +2 -1
  208. package/dist/types/components/header/headerRenderer.d.ts +2 -2
  209. package/dist/types/components/header/revogr-header.d.ts +15 -1
  210. package/dist/types/components/overlay/autofill.service.d.ts +7 -3
  211. package/dist/types/components/overlay/clipboard.service.d.ts +1 -1
  212. package/dist/types/components/overlay/revogr-edit.d.ts +8 -0
  213. package/dist/types/components/overlay/revogr-overlay-selection.d.ts +32 -10
  214. package/dist/types/components/revoGrid/revo-grid.d.ts +15 -4
  215. package/dist/types/components/revoGrid/viewport.scrolling.service.d.ts +6 -2
  216. package/dist/types/components/revoGrid/viewport.section.d.ts +3 -2
  217. package/dist/types/components/revoGrid/viewport.service.d.ts +4 -0
  218. package/dist/types/components/scroll/revogr-viewport-scroll.d.ts +16 -5
  219. package/dist/types/components.d.ts +110 -6
  220. package/dist/types/interfaces.d.ts +4 -1
  221. package/dist/types/plugins/groupingColumn/columnGroupsRenderer.d.ts +3 -2
  222. package/dist/types/plugins/groupingColumn/headerGroupRenderer.d.ts +2 -2
  223. package/dist/types/plugins/sorting/sorting.plugin.d.ts +21 -13
  224. package/dist/types/services/resizable.directive.d.ts +8 -7
  225. package/dist/types/services/resizable.element.d.ts +4 -0
  226. package/dist/types/stencil-public-runtime.d.ts +1 -0
  227. package/dist/types/utils/consts.d.ts +1 -0
  228. package/dist/types/utils/events.d.ts +2 -1
  229. package/dist/types/utils/mobile.d.ts +1 -0
  230. package/package.json +4 -3
  231. package/dist/cjs/debounce-525dd66c.js.map +0 -1
  232. package/dist/cjs/index-aad39b7b.js.map +0 -1
  233. package/dist/cjs/revo-grid_11.cjs.entry.js.map +0 -1
  234. package/dist/esm/debounce-301fd4d2.js.map +0 -1
  235. package/dist/esm/index-5e90b19b.js.map +0 -1
  236. package/dist/esm/revo-grid_11.entry.js.map +0 -1
  237. package/dist/revo-grid/debounce-301fd4d2.js +0 -5
  238. package/dist/revo-grid/debounce-301fd4d2.js.map +0 -1
  239. package/dist/revo-grid/index-5e90b19b.js +0 -6
  240. package/dist/revo-grid/index-5e90b19b.js.map +0 -1
  241. package/dist/revo-grid/revo-grid_11.entry.js +0 -5
  242. package/dist/revo-grid/revo-grid_11.entry.js.map +0 -1
  243. /package/dist/collection/{utilsExternal/generate-data.js → serve/data.js} +0 -0
@@ -0,0 +1,3944 @@
1
+ /*!
2
+ * Built by Revolist
3
+ */
4
+ 'use strict';
5
+
6
+ const index = require('./index-ee2ef5ae.js');
7
+ const debounce$1 = require('./debounce-f50730b6.js');
8
+
9
+ /**
10
+ * A specialized version of `_.forEach` for arrays without support for
11
+ * iteratee shorthands.
12
+ *
13
+ * @private
14
+ * @param {Array} [array] The array to iterate over.
15
+ * @param {Function} iteratee The function invoked per iteration.
16
+ * @returns {Array} Returns `array`.
17
+ */
18
+ function arrayEach(array, iteratee) {
19
+ var index = -1,
20
+ length = array == null ? 0 : array.length;
21
+
22
+ while (++index < length) {
23
+ if (iteratee(array[index], index, array) === false) {
24
+ break;
25
+ }
26
+ }
27
+ return array;
28
+ }
29
+
30
+ var _arrayEach = arrayEach;
31
+
32
+ /**
33
+ * Creates a base function for methods like `_.forIn` and `_.forOwn`.
34
+ *
35
+ * @private
36
+ * @param {boolean} [fromRight] Specify iterating from right to left.
37
+ * @returns {Function} Returns the new base function.
38
+ */
39
+ function createBaseFor(fromRight) {
40
+ return function(object, iteratee, keysFunc) {
41
+ var index = -1,
42
+ iterable = Object(object),
43
+ props = keysFunc(object),
44
+ length = props.length;
45
+
46
+ while (length--) {
47
+ var key = props[fromRight ? length : ++index];
48
+ if (iteratee(iterable[key], key, iterable) === false) {
49
+ break;
50
+ }
51
+ }
52
+ return object;
53
+ };
54
+ }
55
+
56
+ var _createBaseFor = createBaseFor;
57
+
58
+ /**
59
+ * The base implementation of `baseForOwn` which iterates over `object`
60
+ * properties returned by `keysFunc` and invokes `iteratee` for each property.
61
+ * Iteratee functions may exit iteration early by explicitly returning `false`.
62
+ *
63
+ * @private
64
+ * @param {Object} object The object to iterate over.
65
+ * @param {Function} iteratee The function invoked per iteration.
66
+ * @param {Function} keysFunc The function to get the keys of `object`.
67
+ * @returns {Object} Returns `object`.
68
+ */
69
+ var baseFor = _createBaseFor();
70
+
71
+ var _baseFor = baseFor;
72
+
73
+ /**
74
+ * The base implementation of `_.times` without support for iteratee shorthands
75
+ * or max array length checks.
76
+ *
77
+ * @private
78
+ * @param {number} n The number of times to invoke `iteratee`.
79
+ * @param {Function} iteratee The function invoked per iteration.
80
+ * @returns {Array} Returns the array of results.
81
+ */
82
+ function baseTimes(n, iteratee) {
83
+ var index = -1,
84
+ result = Array(n);
85
+
86
+ while (++index < n) {
87
+ result[index] = iteratee(index);
88
+ }
89
+ return result;
90
+ }
91
+
92
+ var _baseTimes = baseTimes;
93
+
94
+ /** `Object#toString` result references. */
95
+ var argsTag$2 = '[object Arguments]';
96
+
97
+ /**
98
+ * The base implementation of `_.isArguments`.
99
+ *
100
+ * @private
101
+ * @param {*} value The value to check.
102
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
103
+ */
104
+ function baseIsArguments(value) {
105
+ return debounce$1.isObjectLike_1(value) && debounce$1._baseGetTag(value) == argsTag$2;
106
+ }
107
+
108
+ var _baseIsArguments = baseIsArguments;
109
+
110
+ /** Used for built-in method references. */
111
+ var objectProto$9 = Object.prototype;
112
+
113
+ /** Used to check objects for own properties. */
114
+ var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
115
+
116
+ /** Built-in value references. */
117
+ var propertyIsEnumerable$1 = objectProto$9.propertyIsEnumerable;
118
+
119
+ /**
120
+ * Checks if `value` is likely an `arguments` object.
121
+ *
122
+ * @static
123
+ * @memberOf _
124
+ * @since 0.1.0
125
+ * @category Lang
126
+ * @param {*} value The value to check.
127
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
128
+ * else `false`.
129
+ * @example
130
+ *
131
+ * _.isArguments(function() { return arguments; }());
132
+ * // => true
133
+ *
134
+ * _.isArguments([1, 2, 3]);
135
+ * // => false
136
+ */
137
+ var isArguments = _baseIsArguments(function() { return arguments; }()) ? _baseIsArguments : function(value) {
138
+ return debounce$1.isObjectLike_1(value) && hasOwnProperty$7.call(value, 'callee') &&
139
+ !propertyIsEnumerable$1.call(value, 'callee');
140
+ };
141
+
142
+ var isArguments_1 = isArguments;
143
+
144
+ /**
145
+ * Checks if `value` is classified as an `Array` object.
146
+ *
147
+ * @static
148
+ * @memberOf _
149
+ * @since 0.1.0
150
+ * @category Lang
151
+ * @param {*} value The value to check.
152
+ * @returns {boolean} Returns `true` if `value` is an array, else `false`.
153
+ * @example
154
+ *
155
+ * _.isArray([1, 2, 3]);
156
+ * // => true
157
+ *
158
+ * _.isArray(document.body.children);
159
+ * // => false
160
+ *
161
+ * _.isArray('abc');
162
+ * // => false
163
+ *
164
+ * _.isArray(_.noop);
165
+ * // => false
166
+ */
167
+ var isArray = Array.isArray;
168
+
169
+ var isArray_1 = isArray;
170
+
171
+ /**
172
+ * This method returns `false`.
173
+ *
174
+ * @static
175
+ * @memberOf _
176
+ * @since 4.13.0
177
+ * @category Util
178
+ * @returns {boolean} Returns `false`.
179
+ * @example
180
+ *
181
+ * _.times(2, _.stubFalse);
182
+ * // => [false, false]
183
+ */
184
+ function stubFalse() {
185
+ return false;
186
+ }
187
+
188
+ var stubFalse_1 = stubFalse;
189
+
190
+ var isBuffer_1 = debounce$1.createCommonjsModule(function (module, exports) {
191
+ /** Detect free variable `exports`. */
192
+ var freeExports = exports && !exports.nodeType && exports;
193
+
194
+ /** Detect free variable `module`. */
195
+ var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
196
+
197
+ /** Detect the popular CommonJS extension `module.exports`. */
198
+ var moduleExports = freeModule && freeModule.exports === freeExports;
199
+
200
+ /** Built-in value references. */
201
+ var Buffer = moduleExports ? debounce$1._root.Buffer : undefined;
202
+
203
+ /* Built-in method references for those with the same name as other `lodash` methods. */
204
+ var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
205
+
206
+ /**
207
+ * Checks if `value` is a buffer.
208
+ *
209
+ * @static
210
+ * @memberOf _
211
+ * @since 4.3.0
212
+ * @category Lang
213
+ * @param {*} value The value to check.
214
+ * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
215
+ * @example
216
+ *
217
+ * _.isBuffer(new Buffer(2));
218
+ * // => true
219
+ *
220
+ * _.isBuffer(new Uint8Array(2));
221
+ * // => false
222
+ */
223
+ var isBuffer = nativeIsBuffer || stubFalse_1;
224
+
225
+ module.exports = isBuffer;
226
+ });
227
+
228
+ /** Used as references for various `Number` constants. */
229
+ var MAX_SAFE_INTEGER$1 = 9007199254740991;
230
+
231
+ /** Used to detect unsigned integer values. */
232
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
233
+
234
+ /**
235
+ * Checks if `value` is a valid array-like index.
236
+ *
237
+ * @private
238
+ * @param {*} value The value to check.
239
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
240
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
241
+ */
242
+ function isIndex(value, length) {
243
+ var type = typeof value;
244
+ length = length == null ? MAX_SAFE_INTEGER$1 : length;
245
+
246
+ return !!length &&
247
+ (type == 'number' ||
248
+ (type != 'symbol' && reIsUint.test(value))) &&
249
+ (value > -1 && value % 1 == 0 && value < length);
250
+ }
251
+
252
+ var _isIndex = isIndex;
253
+
254
+ /** Used as references for various `Number` constants. */
255
+ var MAX_SAFE_INTEGER = 9007199254740991;
256
+
257
+ /**
258
+ * Checks if `value` is a valid array-like length.
259
+ *
260
+ * **Note:** This method is loosely based on
261
+ * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
262
+ *
263
+ * @static
264
+ * @memberOf _
265
+ * @since 4.0.0
266
+ * @category Lang
267
+ * @param {*} value The value to check.
268
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
269
+ * @example
270
+ *
271
+ * _.isLength(3);
272
+ * // => true
273
+ *
274
+ * _.isLength(Number.MIN_VALUE);
275
+ * // => false
276
+ *
277
+ * _.isLength(Infinity);
278
+ * // => false
279
+ *
280
+ * _.isLength('3');
281
+ * // => false
282
+ */
283
+ function isLength(value) {
284
+ return typeof value == 'number' &&
285
+ value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
286
+ }
287
+
288
+ var isLength_1 = isLength;
289
+
290
+ /** `Object#toString` result references. */
291
+ var argsTag$1 = '[object Arguments]',
292
+ arrayTag$1 = '[object Array]',
293
+ boolTag$1 = '[object Boolean]',
294
+ dateTag$1 = '[object Date]',
295
+ errorTag$1 = '[object Error]',
296
+ funcTag$1 = '[object Function]',
297
+ mapTag$2 = '[object Map]',
298
+ numberTag$1 = '[object Number]',
299
+ objectTag$2 = '[object Object]',
300
+ regexpTag$1 = '[object RegExp]',
301
+ setTag$2 = '[object Set]',
302
+ stringTag$1 = '[object String]',
303
+ weakMapTag$1 = '[object WeakMap]';
304
+
305
+ var arrayBufferTag$1 = '[object ArrayBuffer]',
306
+ dataViewTag$2 = '[object DataView]',
307
+ float32Tag = '[object Float32Array]',
308
+ float64Tag = '[object Float64Array]',
309
+ int8Tag = '[object Int8Array]',
310
+ int16Tag = '[object Int16Array]',
311
+ int32Tag = '[object Int32Array]',
312
+ uint8Tag = '[object Uint8Array]',
313
+ uint8ClampedTag = '[object Uint8ClampedArray]',
314
+ uint16Tag = '[object Uint16Array]',
315
+ uint32Tag = '[object Uint32Array]';
316
+
317
+ /** Used to identify `toStringTag` values of typed arrays. */
318
+ var typedArrayTags = {};
319
+ typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
320
+ typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
321
+ typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
322
+ typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
323
+ typedArrayTags[uint32Tag] = true;
324
+ typedArrayTags[argsTag$1] = typedArrayTags[arrayTag$1] =
325
+ typedArrayTags[arrayBufferTag$1] = typedArrayTags[boolTag$1] =
326
+ typedArrayTags[dataViewTag$2] = typedArrayTags[dateTag$1] =
327
+ typedArrayTags[errorTag$1] = typedArrayTags[funcTag$1] =
328
+ typedArrayTags[mapTag$2] = typedArrayTags[numberTag$1] =
329
+ typedArrayTags[objectTag$2] = typedArrayTags[regexpTag$1] =
330
+ typedArrayTags[setTag$2] = typedArrayTags[stringTag$1] =
331
+ typedArrayTags[weakMapTag$1] = false;
332
+
333
+ /**
334
+ * The base implementation of `_.isTypedArray` without Node.js optimizations.
335
+ *
336
+ * @private
337
+ * @param {*} value The value to check.
338
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
339
+ */
340
+ function baseIsTypedArray(value) {
341
+ return debounce$1.isObjectLike_1(value) &&
342
+ isLength_1(value.length) && !!typedArrayTags[debounce$1._baseGetTag(value)];
343
+ }
344
+
345
+ var _baseIsTypedArray = baseIsTypedArray;
346
+
347
+ /**
348
+ * The base implementation of `_.unary` without support for storing metadata.
349
+ *
350
+ * @private
351
+ * @param {Function} func The function to cap arguments for.
352
+ * @returns {Function} Returns the new capped function.
353
+ */
354
+ function baseUnary(func) {
355
+ return function(value) {
356
+ return func(value);
357
+ };
358
+ }
359
+
360
+ var _baseUnary = baseUnary;
361
+
362
+ var _nodeUtil = debounce$1.createCommonjsModule(function (module, exports) {
363
+ /** Detect free variable `exports`. */
364
+ var freeExports = exports && !exports.nodeType && exports;
365
+
366
+ /** Detect free variable `module`. */
367
+ var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
368
+
369
+ /** Detect the popular CommonJS extension `module.exports`. */
370
+ var moduleExports = freeModule && freeModule.exports === freeExports;
371
+
372
+ /** Detect free variable `process` from Node.js. */
373
+ var freeProcess = moduleExports && debounce$1._freeGlobal.process;
374
+
375
+ /** Used to access faster Node.js helpers. */
376
+ var nodeUtil = (function() {
377
+ try {
378
+ // Use `util.types` for Node.js 10+.
379
+ var types = freeModule && freeModule.require && freeModule.require('util').types;
380
+
381
+ if (types) {
382
+ return types;
383
+ }
384
+
385
+ // Legacy `process.binding('util')` for Node.js < 10.
386
+ return freeProcess && freeProcess.binding && freeProcess.binding('util');
387
+ } catch (e) {}
388
+ }());
389
+
390
+ module.exports = nodeUtil;
391
+ });
392
+
393
+ /* Node.js helper references. */
394
+ var nodeIsTypedArray = _nodeUtil && _nodeUtil.isTypedArray;
395
+
396
+ /**
397
+ * Checks if `value` is classified as a typed array.
398
+ *
399
+ * @static
400
+ * @memberOf _
401
+ * @since 3.0.0
402
+ * @category Lang
403
+ * @param {*} value The value to check.
404
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
405
+ * @example
406
+ *
407
+ * _.isTypedArray(new Uint8Array);
408
+ * // => true
409
+ *
410
+ * _.isTypedArray([]);
411
+ * // => false
412
+ */
413
+ var isTypedArray = nodeIsTypedArray ? _baseUnary(nodeIsTypedArray) : _baseIsTypedArray;
414
+
415
+ var isTypedArray_1 = isTypedArray;
416
+
417
+ /** Used for built-in method references. */
418
+ var objectProto$8 = Object.prototype;
419
+
420
+ /** Used to check objects for own properties. */
421
+ var hasOwnProperty$6 = objectProto$8.hasOwnProperty;
422
+
423
+ /**
424
+ * Creates an array of the enumerable property names of the array-like `value`.
425
+ *
426
+ * @private
427
+ * @param {*} value The value to query.
428
+ * @param {boolean} inherited Specify returning inherited property names.
429
+ * @returns {Array} Returns the array of property names.
430
+ */
431
+ function arrayLikeKeys(value, inherited) {
432
+ var isArr = isArray_1(value),
433
+ isArg = !isArr && isArguments_1(value),
434
+ isBuff = !isArr && !isArg && isBuffer_1(value),
435
+ isType = !isArr && !isArg && !isBuff && isTypedArray_1(value),
436
+ skipIndexes = isArr || isArg || isBuff || isType,
437
+ result = skipIndexes ? _baseTimes(value.length, String) : [],
438
+ length = result.length;
439
+
440
+ for (var key in value) {
441
+ if ((inherited || hasOwnProperty$6.call(value, key)) &&
442
+ !(skipIndexes && (
443
+ // Safari 9 has enumerable `arguments.length` in strict mode.
444
+ key == 'length' ||
445
+ // Node.js 0.10 has enumerable non-index properties on buffers.
446
+ (isBuff && (key == 'offset' || key == 'parent')) ||
447
+ // PhantomJS 2 has enumerable non-index properties on typed arrays.
448
+ (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
449
+ // Skip index properties.
450
+ _isIndex(key, length)
451
+ ))) {
452
+ result.push(key);
453
+ }
454
+ }
455
+ return result;
456
+ }
457
+
458
+ var _arrayLikeKeys = arrayLikeKeys;
459
+
460
+ /** Used for built-in method references. */
461
+ var objectProto$7 = Object.prototype;
462
+
463
+ /**
464
+ * Checks if `value` is likely a prototype object.
465
+ *
466
+ * @private
467
+ * @param {*} value The value to check.
468
+ * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
469
+ */
470
+ function isPrototype(value) {
471
+ var Ctor = value && value.constructor,
472
+ proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$7;
473
+
474
+ return value === proto;
475
+ }
476
+
477
+ var _isPrototype = isPrototype;
478
+
479
+ /**
480
+ * Creates a unary function that invokes `func` with its argument transformed.
481
+ *
482
+ * @private
483
+ * @param {Function} func The function to wrap.
484
+ * @param {Function} transform The argument transform.
485
+ * @returns {Function} Returns the new function.
486
+ */
487
+ function overArg(func, transform) {
488
+ return function(arg) {
489
+ return func(transform(arg));
490
+ };
491
+ }
492
+
493
+ var _overArg = overArg;
494
+
495
+ /* Built-in method references for those with the same name as other `lodash` methods. */
496
+ var nativeKeys = _overArg(Object.keys, Object);
497
+
498
+ var _nativeKeys = nativeKeys;
499
+
500
+ /** Used for built-in method references. */
501
+ var objectProto$6 = Object.prototype;
502
+
503
+ /** Used to check objects for own properties. */
504
+ var hasOwnProperty$5 = objectProto$6.hasOwnProperty;
505
+
506
+ /**
507
+ * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
508
+ *
509
+ * @private
510
+ * @param {Object} object The object to query.
511
+ * @returns {Array} Returns the array of property names.
512
+ */
513
+ function baseKeys(object) {
514
+ if (!_isPrototype(object)) {
515
+ return _nativeKeys(object);
516
+ }
517
+ var result = [];
518
+ for (var key in Object(object)) {
519
+ if (hasOwnProperty$5.call(object, key) && key != 'constructor') {
520
+ result.push(key);
521
+ }
522
+ }
523
+ return result;
524
+ }
525
+
526
+ var _baseKeys = baseKeys;
527
+
528
+ /** `Object#toString` result references. */
529
+ var asyncTag = '[object AsyncFunction]',
530
+ funcTag = '[object Function]',
531
+ genTag = '[object GeneratorFunction]',
532
+ proxyTag = '[object Proxy]';
533
+
534
+ /**
535
+ * Checks if `value` is classified as a `Function` object.
536
+ *
537
+ * @static
538
+ * @memberOf _
539
+ * @since 0.1.0
540
+ * @category Lang
541
+ * @param {*} value The value to check.
542
+ * @returns {boolean} Returns `true` if `value` is a function, else `false`.
543
+ * @example
544
+ *
545
+ * _.isFunction(_);
546
+ * // => true
547
+ *
548
+ * _.isFunction(/abc/);
549
+ * // => false
550
+ */
551
+ function isFunction(value) {
552
+ if (!debounce$1.isObject_1(value)) {
553
+ return false;
554
+ }
555
+ // The use of `Object#toString` avoids issues with the `typeof` operator
556
+ // in Safari 9 which returns 'object' for typed arrays and other constructors.
557
+ var tag = debounce$1._baseGetTag(value);
558
+ return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
559
+ }
560
+
561
+ var isFunction_1 = isFunction;
562
+
563
+ /**
564
+ * Checks if `value` is array-like. A value is considered array-like if it's
565
+ * not a function and has a `value.length` that's an integer greater than or
566
+ * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
567
+ *
568
+ * @static
569
+ * @memberOf _
570
+ * @since 4.0.0
571
+ * @category Lang
572
+ * @param {*} value The value to check.
573
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
574
+ * @example
575
+ *
576
+ * _.isArrayLike([1, 2, 3]);
577
+ * // => true
578
+ *
579
+ * _.isArrayLike(document.body.children);
580
+ * // => true
581
+ *
582
+ * _.isArrayLike('abc');
583
+ * // => true
584
+ *
585
+ * _.isArrayLike(_.noop);
586
+ * // => false
587
+ */
588
+ function isArrayLike(value) {
589
+ return value != null && isLength_1(value.length) && !isFunction_1(value);
590
+ }
591
+
592
+ var isArrayLike_1 = isArrayLike;
593
+
594
+ /**
595
+ * Creates an array of the own enumerable property names of `object`.
596
+ *
597
+ * **Note:** Non-object values are coerced to objects. See the
598
+ * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
599
+ * for more details.
600
+ *
601
+ * @static
602
+ * @since 0.1.0
603
+ * @memberOf _
604
+ * @category Object
605
+ * @param {Object} object The object to query.
606
+ * @returns {Array} Returns the array of property names.
607
+ * @example
608
+ *
609
+ * function Foo() {
610
+ * this.a = 1;
611
+ * this.b = 2;
612
+ * }
613
+ *
614
+ * Foo.prototype.c = 3;
615
+ *
616
+ * _.keys(new Foo);
617
+ * // => ['a', 'b'] (iteration order is not guaranteed)
618
+ *
619
+ * _.keys('hi');
620
+ * // => ['0', '1']
621
+ */
622
+ function keys(object) {
623
+ return isArrayLike_1(object) ? _arrayLikeKeys(object) : _baseKeys(object);
624
+ }
625
+
626
+ var keys_1 = keys;
627
+
628
+ /**
629
+ * The base implementation of `_.forOwn` without support for iteratee shorthands.
630
+ *
631
+ * @private
632
+ * @param {Object} object The object to iterate over.
633
+ * @param {Function} iteratee The function invoked per iteration.
634
+ * @returns {Object} Returns `object`.
635
+ */
636
+ function baseForOwn(object, iteratee) {
637
+ return object && _baseFor(object, iteratee, keys_1);
638
+ }
639
+
640
+ var _baseForOwn = baseForOwn;
641
+
642
+ /**
643
+ * Creates a `baseEach` or `baseEachRight` function.
644
+ *
645
+ * @private
646
+ * @param {Function} eachFunc The function to iterate over a collection.
647
+ * @param {boolean} [fromRight] Specify iterating from right to left.
648
+ * @returns {Function} Returns the new base function.
649
+ */
650
+ function createBaseEach(eachFunc, fromRight) {
651
+ return function(collection, iteratee) {
652
+ if (collection == null) {
653
+ return collection;
654
+ }
655
+ if (!isArrayLike_1(collection)) {
656
+ return eachFunc(collection, iteratee);
657
+ }
658
+ var length = collection.length,
659
+ index = fromRight ? length : -1,
660
+ iterable = Object(collection);
661
+
662
+ while ((fromRight ? index-- : ++index < length)) {
663
+ if (iteratee(iterable[index], index, iterable) === false) {
664
+ break;
665
+ }
666
+ }
667
+ return collection;
668
+ };
669
+ }
670
+
671
+ var _createBaseEach = createBaseEach;
672
+
673
+ /**
674
+ * The base implementation of `_.forEach` without support for iteratee shorthands.
675
+ *
676
+ * @private
677
+ * @param {Array|Object} collection The collection to iterate over.
678
+ * @param {Function} iteratee The function invoked per iteration.
679
+ * @returns {Array|Object} Returns `collection`.
680
+ */
681
+ var baseEach = _createBaseEach(_baseForOwn);
682
+
683
+ var _baseEach = baseEach;
684
+
685
+ /**
686
+ * This method returns the first argument it receives.
687
+ *
688
+ * @static
689
+ * @since 0.1.0
690
+ * @memberOf _
691
+ * @category Util
692
+ * @param {*} value Any value.
693
+ * @returns {*} Returns `value`.
694
+ * @example
695
+ *
696
+ * var object = { 'a': 1 };
697
+ *
698
+ * console.log(_.identity(object) === object);
699
+ * // => true
700
+ */
701
+ function identity(value) {
702
+ return value;
703
+ }
704
+
705
+ var identity_1 = identity;
706
+
707
+ /**
708
+ * Casts `value` to `identity` if it's not a function.
709
+ *
710
+ * @private
711
+ * @param {*} value The value to inspect.
712
+ * @returns {Function} Returns cast function.
713
+ */
714
+ function castFunction(value) {
715
+ return typeof value == 'function' ? value : identity_1;
716
+ }
717
+
718
+ var _castFunction = castFunction;
719
+
720
+ /**
721
+ * Iterates over elements of `collection` and invokes `iteratee` for each element.
722
+ * The iteratee is invoked with three arguments: (value, index|key, collection).
723
+ * Iteratee functions may exit iteration early by explicitly returning `false`.
724
+ *
725
+ * **Note:** As with other "Collections" methods, objects with a "length"
726
+ * property are iterated like arrays. To avoid this behavior use `_.forIn`
727
+ * or `_.forOwn` for object iteration.
728
+ *
729
+ * @static
730
+ * @memberOf _
731
+ * @since 0.1.0
732
+ * @alias each
733
+ * @category Collection
734
+ * @param {Array|Object} collection The collection to iterate over.
735
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
736
+ * @returns {Array|Object} Returns `collection`.
737
+ * @see _.forEachRight
738
+ * @example
739
+ *
740
+ * _.forEach([1, 2], function(value) {
741
+ * console.log(value);
742
+ * });
743
+ * // => Logs `1` then `2`.
744
+ *
745
+ * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
746
+ * console.log(key);
747
+ * });
748
+ * // => Logs 'a' then 'b' (iteration order is not guaranteed).
749
+ */
750
+ function forEach(collection, iteratee) {
751
+ var func = isArray_1(collection) ? _arrayEach : _baseEach;
752
+ return func(collection, _castFunction(iteratee));
753
+ }
754
+
755
+ var forEach_1 = forEach;
756
+
757
+ var each = forEach_1;
758
+
759
+ /**
760
+ * A specialized version of `_.reduce` for arrays without support for
761
+ * iteratee shorthands.
762
+ *
763
+ * @private
764
+ * @param {Array} [array] The array to iterate over.
765
+ * @param {Function} iteratee The function invoked per iteration.
766
+ * @param {*} [accumulator] The initial value.
767
+ * @param {boolean} [initAccum] Specify using the first element of `array` as
768
+ * the initial value.
769
+ * @returns {*} Returns the accumulated value.
770
+ */
771
+ function arrayReduce(array, iteratee, accumulator, initAccum) {
772
+ var index = -1,
773
+ length = array == null ? 0 : array.length;
774
+
775
+ if (initAccum && length) {
776
+ accumulator = array[++index];
777
+ }
778
+ while (++index < length) {
779
+ accumulator = iteratee(accumulator, array[index], index, array);
780
+ }
781
+ return accumulator;
782
+ }
783
+
784
+ var _arrayReduce = arrayReduce;
785
+
786
+ /**
787
+ * Removes all key-value entries from the list cache.
788
+ *
789
+ * @private
790
+ * @name clear
791
+ * @memberOf ListCache
792
+ */
793
+ function listCacheClear() {
794
+ this.__data__ = [];
795
+ this.size = 0;
796
+ }
797
+
798
+ var _listCacheClear = listCacheClear;
799
+
800
+ /**
801
+ * Performs a
802
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
803
+ * comparison between two values to determine if they are equivalent.
804
+ *
805
+ * @static
806
+ * @memberOf _
807
+ * @since 4.0.0
808
+ * @category Lang
809
+ * @param {*} value The value to compare.
810
+ * @param {*} other The other value to compare.
811
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
812
+ * @example
813
+ *
814
+ * var object = { 'a': 1 };
815
+ * var other = { 'a': 1 };
816
+ *
817
+ * _.eq(object, object);
818
+ * // => true
819
+ *
820
+ * _.eq(object, other);
821
+ * // => false
822
+ *
823
+ * _.eq('a', 'a');
824
+ * // => true
825
+ *
826
+ * _.eq('a', Object('a'));
827
+ * // => false
828
+ *
829
+ * _.eq(NaN, NaN);
830
+ * // => true
831
+ */
832
+ function eq(value, other) {
833
+ return value === other || (value !== value && other !== other);
834
+ }
835
+
836
+ var eq_1 = eq;
837
+
838
+ /**
839
+ * Gets the index at which the `key` is found in `array` of key-value pairs.
840
+ *
841
+ * @private
842
+ * @param {Array} array The array to inspect.
843
+ * @param {*} key The key to search for.
844
+ * @returns {number} Returns the index of the matched value, else `-1`.
845
+ */
846
+ function assocIndexOf(array, key) {
847
+ var length = array.length;
848
+ while (length--) {
849
+ if (eq_1(array[length][0], key)) {
850
+ return length;
851
+ }
852
+ }
853
+ return -1;
854
+ }
855
+
856
+ var _assocIndexOf = assocIndexOf;
857
+
858
+ /** Used for built-in method references. */
859
+ var arrayProto = Array.prototype;
860
+
861
+ /** Built-in value references. */
862
+ var splice = arrayProto.splice;
863
+
864
+ /**
865
+ * Removes `key` and its value from the list cache.
866
+ *
867
+ * @private
868
+ * @name delete
869
+ * @memberOf ListCache
870
+ * @param {string} key The key of the value to remove.
871
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
872
+ */
873
+ function listCacheDelete(key) {
874
+ var data = this.__data__,
875
+ index = _assocIndexOf(data, key);
876
+
877
+ if (index < 0) {
878
+ return false;
879
+ }
880
+ var lastIndex = data.length - 1;
881
+ if (index == lastIndex) {
882
+ data.pop();
883
+ } else {
884
+ splice.call(data, index, 1);
885
+ }
886
+ --this.size;
887
+ return true;
888
+ }
889
+
890
+ var _listCacheDelete = listCacheDelete;
891
+
892
+ /**
893
+ * Gets the list cache value for `key`.
894
+ *
895
+ * @private
896
+ * @name get
897
+ * @memberOf ListCache
898
+ * @param {string} key The key of the value to get.
899
+ * @returns {*} Returns the entry value.
900
+ */
901
+ function listCacheGet(key) {
902
+ var data = this.__data__,
903
+ index = _assocIndexOf(data, key);
904
+
905
+ return index < 0 ? undefined : data[index][1];
906
+ }
907
+
908
+ var _listCacheGet = listCacheGet;
909
+
910
+ /**
911
+ * Checks if a list cache value for `key` exists.
912
+ *
913
+ * @private
914
+ * @name has
915
+ * @memberOf ListCache
916
+ * @param {string} key The key of the entry to check.
917
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
918
+ */
919
+ function listCacheHas(key) {
920
+ return _assocIndexOf(this.__data__, key) > -1;
921
+ }
922
+
923
+ var _listCacheHas = listCacheHas;
924
+
925
+ /**
926
+ * Sets the list cache `key` to `value`.
927
+ *
928
+ * @private
929
+ * @name set
930
+ * @memberOf ListCache
931
+ * @param {string} key The key of the value to set.
932
+ * @param {*} value The value to set.
933
+ * @returns {Object} Returns the list cache instance.
934
+ */
935
+ function listCacheSet(key, value) {
936
+ var data = this.__data__,
937
+ index = _assocIndexOf(data, key);
938
+
939
+ if (index < 0) {
940
+ ++this.size;
941
+ data.push([key, value]);
942
+ } else {
943
+ data[index][1] = value;
944
+ }
945
+ return this;
946
+ }
947
+
948
+ var _listCacheSet = listCacheSet;
949
+
950
+ /**
951
+ * Creates an list cache object.
952
+ *
953
+ * @private
954
+ * @constructor
955
+ * @param {Array} [entries] The key-value pairs to cache.
956
+ */
957
+ function ListCache(entries) {
958
+ var index = -1,
959
+ length = entries == null ? 0 : entries.length;
960
+
961
+ this.clear();
962
+ while (++index < length) {
963
+ var entry = entries[index];
964
+ this.set(entry[0], entry[1]);
965
+ }
966
+ }
967
+
968
+ // Add methods to `ListCache`.
969
+ ListCache.prototype.clear = _listCacheClear;
970
+ ListCache.prototype['delete'] = _listCacheDelete;
971
+ ListCache.prototype.get = _listCacheGet;
972
+ ListCache.prototype.has = _listCacheHas;
973
+ ListCache.prototype.set = _listCacheSet;
974
+
975
+ var _ListCache = ListCache;
976
+
977
+ /**
978
+ * Removes all key-value entries from the stack.
979
+ *
980
+ * @private
981
+ * @name clear
982
+ * @memberOf Stack
983
+ */
984
+ function stackClear() {
985
+ this.__data__ = new _ListCache;
986
+ this.size = 0;
987
+ }
988
+
989
+ var _stackClear = stackClear;
990
+
991
+ /**
992
+ * Removes `key` and its value from the stack.
993
+ *
994
+ * @private
995
+ * @name delete
996
+ * @memberOf Stack
997
+ * @param {string} key The key of the value to remove.
998
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
999
+ */
1000
+ function stackDelete(key) {
1001
+ var data = this.__data__,
1002
+ result = data['delete'](key);
1003
+
1004
+ this.size = data.size;
1005
+ return result;
1006
+ }
1007
+
1008
+ var _stackDelete = stackDelete;
1009
+
1010
+ /**
1011
+ * Gets the stack value for `key`.
1012
+ *
1013
+ * @private
1014
+ * @name get
1015
+ * @memberOf Stack
1016
+ * @param {string} key The key of the value to get.
1017
+ * @returns {*} Returns the entry value.
1018
+ */
1019
+ function stackGet(key) {
1020
+ return this.__data__.get(key);
1021
+ }
1022
+
1023
+ var _stackGet = stackGet;
1024
+
1025
+ /**
1026
+ * Checks if a stack value for `key` exists.
1027
+ *
1028
+ * @private
1029
+ * @name has
1030
+ * @memberOf Stack
1031
+ * @param {string} key The key of the entry to check.
1032
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1033
+ */
1034
+ function stackHas(key) {
1035
+ return this.__data__.has(key);
1036
+ }
1037
+
1038
+ var _stackHas = stackHas;
1039
+
1040
+ /** Used to detect overreaching core-js shims. */
1041
+ var coreJsData = debounce$1._root['__core-js_shared__'];
1042
+
1043
+ var _coreJsData = coreJsData;
1044
+
1045
+ /** Used to detect methods masquerading as native. */
1046
+ var maskSrcKey = (function() {
1047
+ var uid = /[^.]+$/.exec(_coreJsData && _coreJsData.keys && _coreJsData.keys.IE_PROTO || '');
1048
+ return uid ? ('Symbol(src)_1.' + uid) : '';
1049
+ }());
1050
+
1051
+ /**
1052
+ * Checks if `func` has its source masked.
1053
+ *
1054
+ * @private
1055
+ * @param {Function} func The function to check.
1056
+ * @returns {boolean} Returns `true` if `func` is masked, else `false`.
1057
+ */
1058
+ function isMasked(func) {
1059
+ return !!maskSrcKey && (maskSrcKey in func);
1060
+ }
1061
+
1062
+ var _isMasked = isMasked;
1063
+
1064
+ /** Used for built-in method references. */
1065
+ var funcProto$1 = Function.prototype;
1066
+
1067
+ /** Used to resolve the decompiled source of functions. */
1068
+ var funcToString$1 = funcProto$1.toString;
1069
+
1070
+ /**
1071
+ * Converts `func` to its source code.
1072
+ *
1073
+ * @private
1074
+ * @param {Function} func The function to convert.
1075
+ * @returns {string} Returns the source code.
1076
+ */
1077
+ function toSource(func) {
1078
+ if (func != null) {
1079
+ try {
1080
+ return funcToString$1.call(func);
1081
+ } catch (e) {}
1082
+ try {
1083
+ return (func + '');
1084
+ } catch (e) {}
1085
+ }
1086
+ return '';
1087
+ }
1088
+
1089
+ var _toSource = toSource;
1090
+
1091
+ /**
1092
+ * Used to match `RegExp`
1093
+ * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
1094
+ */
1095
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
1096
+
1097
+ /** Used to detect host constructors (Safari). */
1098
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
1099
+
1100
+ /** Used for built-in method references. */
1101
+ var funcProto = Function.prototype,
1102
+ objectProto$5 = Object.prototype;
1103
+
1104
+ /** Used to resolve the decompiled source of functions. */
1105
+ var funcToString = funcProto.toString;
1106
+
1107
+ /** Used to check objects for own properties. */
1108
+ var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
1109
+
1110
+ /** Used to detect if a method is native. */
1111
+ var reIsNative = RegExp('^' +
1112
+ funcToString.call(hasOwnProperty$4).replace(reRegExpChar, '\\$&')
1113
+ .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
1114
+ );
1115
+
1116
+ /**
1117
+ * The base implementation of `_.isNative` without bad shim checks.
1118
+ *
1119
+ * @private
1120
+ * @param {*} value The value to check.
1121
+ * @returns {boolean} Returns `true` if `value` is a native function,
1122
+ * else `false`.
1123
+ */
1124
+ function baseIsNative(value) {
1125
+ if (!debounce$1.isObject_1(value) || _isMasked(value)) {
1126
+ return false;
1127
+ }
1128
+ var pattern = isFunction_1(value) ? reIsNative : reIsHostCtor;
1129
+ return pattern.test(_toSource(value));
1130
+ }
1131
+
1132
+ var _baseIsNative = baseIsNative;
1133
+
1134
+ /**
1135
+ * Gets the value at `key` of `object`.
1136
+ *
1137
+ * @private
1138
+ * @param {Object} [object] The object to query.
1139
+ * @param {string} key The key of the property to get.
1140
+ * @returns {*} Returns the property value.
1141
+ */
1142
+ function getValue(object, key) {
1143
+ return object == null ? undefined : object[key];
1144
+ }
1145
+
1146
+ var _getValue = getValue;
1147
+
1148
+ /**
1149
+ * Gets the native function at `key` of `object`.
1150
+ *
1151
+ * @private
1152
+ * @param {Object} object The object to query.
1153
+ * @param {string} key The key of the method to get.
1154
+ * @returns {*} Returns the function if it's native, else `undefined`.
1155
+ */
1156
+ function getNative(object, key) {
1157
+ var value = _getValue(object, key);
1158
+ return _baseIsNative(value) ? value : undefined;
1159
+ }
1160
+
1161
+ var _getNative = getNative;
1162
+
1163
+ /* Built-in method references that are verified to be native. */
1164
+ var Map$1 = _getNative(debounce$1._root, 'Map');
1165
+
1166
+ var _Map = Map$1;
1167
+
1168
+ /* Built-in method references that are verified to be native. */
1169
+ var nativeCreate = _getNative(Object, 'create');
1170
+
1171
+ var _nativeCreate = nativeCreate;
1172
+
1173
+ /**
1174
+ * Removes all key-value entries from the hash.
1175
+ *
1176
+ * @private
1177
+ * @name clear
1178
+ * @memberOf Hash
1179
+ */
1180
+ function hashClear() {
1181
+ this.__data__ = _nativeCreate ? _nativeCreate(null) : {};
1182
+ this.size = 0;
1183
+ }
1184
+
1185
+ var _hashClear = hashClear;
1186
+
1187
+ /**
1188
+ * Removes `key` and its value from the hash.
1189
+ *
1190
+ * @private
1191
+ * @name delete
1192
+ * @memberOf Hash
1193
+ * @param {Object} hash The hash to modify.
1194
+ * @param {string} key The key of the value to remove.
1195
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1196
+ */
1197
+ function hashDelete(key) {
1198
+ var result = this.has(key) && delete this.__data__[key];
1199
+ this.size -= result ? 1 : 0;
1200
+ return result;
1201
+ }
1202
+
1203
+ var _hashDelete = hashDelete;
1204
+
1205
+ /** Used to stand-in for `undefined` hash values. */
1206
+ var HASH_UNDEFINED$2 = '__lodash_hash_undefined__';
1207
+
1208
+ /** Used for built-in method references. */
1209
+ var objectProto$4 = Object.prototype;
1210
+
1211
+ /** Used to check objects for own properties. */
1212
+ var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
1213
+
1214
+ /**
1215
+ * Gets the hash value for `key`.
1216
+ *
1217
+ * @private
1218
+ * @name get
1219
+ * @memberOf Hash
1220
+ * @param {string} key The key of the value to get.
1221
+ * @returns {*} Returns the entry value.
1222
+ */
1223
+ function hashGet(key) {
1224
+ var data = this.__data__;
1225
+ if (_nativeCreate) {
1226
+ var result = data[key];
1227
+ return result === HASH_UNDEFINED$2 ? undefined : result;
1228
+ }
1229
+ return hasOwnProperty$3.call(data, key) ? data[key] : undefined;
1230
+ }
1231
+
1232
+ var _hashGet = hashGet;
1233
+
1234
+ /** Used for built-in method references. */
1235
+ var objectProto$3 = Object.prototype;
1236
+
1237
+ /** Used to check objects for own properties. */
1238
+ var hasOwnProperty$2 = objectProto$3.hasOwnProperty;
1239
+
1240
+ /**
1241
+ * Checks if a hash value for `key` exists.
1242
+ *
1243
+ * @private
1244
+ * @name has
1245
+ * @memberOf Hash
1246
+ * @param {string} key The key of the entry to check.
1247
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1248
+ */
1249
+ function hashHas(key) {
1250
+ var data = this.__data__;
1251
+ return _nativeCreate ? (data[key] !== undefined) : hasOwnProperty$2.call(data, key);
1252
+ }
1253
+
1254
+ var _hashHas = hashHas;
1255
+
1256
+ /** Used to stand-in for `undefined` hash values. */
1257
+ var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
1258
+
1259
+ /**
1260
+ * Sets the hash `key` to `value`.
1261
+ *
1262
+ * @private
1263
+ * @name set
1264
+ * @memberOf Hash
1265
+ * @param {string} key The key of the value to set.
1266
+ * @param {*} value The value to set.
1267
+ * @returns {Object} Returns the hash instance.
1268
+ */
1269
+ function hashSet(key, value) {
1270
+ var data = this.__data__;
1271
+ this.size += this.has(key) ? 0 : 1;
1272
+ data[key] = (_nativeCreate && value === undefined) ? HASH_UNDEFINED$1 : value;
1273
+ return this;
1274
+ }
1275
+
1276
+ var _hashSet = hashSet;
1277
+
1278
+ /**
1279
+ * Creates a hash object.
1280
+ *
1281
+ * @private
1282
+ * @constructor
1283
+ * @param {Array} [entries] The key-value pairs to cache.
1284
+ */
1285
+ function Hash(entries) {
1286
+ var index = -1,
1287
+ length = entries == null ? 0 : entries.length;
1288
+
1289
+ this.clear();
1290
+ while (++index < length) {
1291
+ var entry = entries[index];
1292
+ this.set(entry[0], entry[1]);
1293
+ }
1294
+ }
1295
+
1296
+ // Add methods to `Hash`.
1297
+ Hash.prototype.clear = _hashClear;
1298
+ Hash.prototype['delete'] = _hashDelete;
1299
+ Hash.prototype.get = _hashGet;
1300
+ Hash.prototype.has = _hashHas;
1301
+ Hash.prototype.set = _hashSet;
1302
+
1303
+ var _Hash = Hash;
1304
+
1305
+ /**
1306
+ * Removes all key-value entries from the map.
1307
+ *
1308
+ * @private
1309
+ * @name clear
1310
+ * @memberOf MapCache
1311
+ */
1312
+ function mapCacheClear() {
1313
+ this.size = 0;
1314
+ this.__data__ = {
1315
+ 'hash': new _Hash,
1316
+ 'map': new (_Map || _ListCache),
1317
+ 'string': new _Hash
1318
+ };
1319
+ }
1320
+
1321
+ var _mapCacheClear = mapCacheClear;
1322
+
1323
+ /**
1324
+ * Checks if `value` is suitable for use as unique object key.
1325
+ *
1326
+ * @private
1327
+ * @param {*} value The value to check.
1328
+ * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
1329
+ */
1330
+ function isKeyable(value) {
1331
+ var type = typeof value;
1332
+ return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
1333
+ ? (value !== '__proto__')
1334
+ : (value === null);
1335
+ }
1336
+
1337
+ var _isKeyable = isKeyable;
1338
+
1339
+ /**
1340
+ * Gets the data for `map`.
1341
+ *
1342
+ * @private
1343
+ * @param {Object} map The map to query.
1344
+ * @param {string} key The reference key.
1345
+ * @returns {*} Returns the map data.
1346
+ */
1347
+ function getMapData(map, key) {
1348
+ var data = map.__data__;
1349
+ return _isKeyable(key)
1350
+ ? data[typeof key == 'string' ? 'string' : 'hash']
1351
+ : data.map;
1352
+ }
1353
+
1354
+ var _getMapData = getMapData;
1355
+
1356
+ /**
1357
+ * Removes `key` and its value from the map.
1358
+ *
1359
+ * @private
1360
+ * @name delete
1361
+ * @memberOf MapCache
1362
+ * @param {string} key The key of the value to remove.
1363
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1364
+ */
1365
+ function mapCacheDelete(key) {
1366
+ var result = _getMapData(this, key)['delete'](key);
1367
+ this.size -= result ? 1 : 0;
1368
+ return result;
1369
+ }
1370
+
1371
+ var _mapCacheDelete = mapCacheDelete;
1372
+
1373
+ /**
1374
+ * Gets the map value for `key`.
1375
+ *
1376
+ * @private
1377
+ * @name get
1378
+ * @memberOf MapCache
1379
+ * @param {string} key The key of the value to get.
1380
+ * @returns {*} Returns the entry value.
1381
+ */
1382
+ function mapCacheGet(key) {
1383
+ return _getMapData(this, key).get(key);
1384
+ }
1385
+
1386
+ var _mapCacheGet = mapCacheGet;
1387
+
1388
+ /**
1389
+ * Checks if a map value for `key` exists.
1390
+ *
1391
+ * @private
1392
+ * @name has
1393
+ * @memberOf MapCache
1394
+ * @param {string} key The key of the entry to check.
1395
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1396
+ */
1397
+ function mapCacheHas(key) {
1398
+ return _getMapData(this, key).has(key);
1399
+ }
1400
+
1401
+ var _mapCacheHas = mapCacheHas;
1402
+
1403
+ /**
1404
+ * Sets the map `key` to `value`.
1405
+ *
1406
+ * @private
1407
+ * @name set
1408
+ * @memberOf MapCache
1409
+ * @param {string} key The key of the value to set.
1410
+ * @param {*} value The value to set.
1411
+ * @returns {Object} Returns the map cache instance.
1412
+ */
1413
+ function mapCacheSet(key, value) {
1414
+ var data = _getMapData(this, key),
1415
+ size = data.size;
1416
+
1417
+ data.set(key, value);
1418
+ this.size += data.size == size ? 0 : 1;
1419
+ return this;
1420
+ }
1421
+
1422
+ var _mapCacheSet = mapCacheSet;
1423
+
1424
+ /**
1425
+ * Creates a map cache object to store key-value pairs.
1426
+ *
1427
+ * @private
1428
+ * @constructor
1429
+ * @param {Array} [entries] The key-value pairs to cache.
1430
+ */
1431
+ function MapCache(entries) {
1432
+ var index = -1,
1433
+ length = entries == null ? 0 : entries.length;
1434
+
1435
+ this.clear();
1436
+ while (++index < length) {
1437
+ var entry = entries[index];
1438
+ this.set(entry[0], entry[1]);
1439
+ }
1440
+ }
1441
+
1442
+ // Add methods to `MapCache`.
1443
+ MapCache.prototype.clear = _mapCacheClear;
1444
+ MapCache.prototype['delete'] = _mapCacheDelete;
1445
+ MapCache.prototype.get = _mapCacheGet;
1446
+ MapCache.prototype.has = _mapCacheHas;
1447
+ MapCache.prototype.set = _mapCacheSet;
1448
+
1449
+ var _MapCache = MapCache;
1450
+
1451
+ /** Used as the size to enable large array optimizations. */
1452
+ var LARGE_ARRAY_SIZE = 200;
1453
+
1454
+ /**
1455
+ * Sets the stack `key` to `value`.
1456
+ *
1457
+ * @private
1458
+ * @name set
1459
+ * @memberOf Stack
1460
+ * @param {string} key The key of the value to set.
1461
+ * @param {*} value The value to set.
1462
+ * @returns {Object} Returns the stack cache instance.
1463
+ */
1464
+ function stackSet(key, value) {
1465
+ var data = this.__data__;
1466
+ if (data instanceof _ListCache) {
1467
+ var pairs = data.__data__;
1468
+ if (!_Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
1469
+ pairs.push([key, value]);
1470
+ this.size = ++data.size;
1471
+ return this;
1472
+ }
1473
+ data = this.__data__ = new _MapCache(pairs);
1474
+ }
1475
+ data.set(key, value);
1476
+ this.size = data.size;
1477
+ return this;
1478
+ }
1479
+
1480
+ var _stackSet = stackSet;
1481
+
1482
+ /**
1483
+ * Creates a stack cache object to store key-value pairs.
1484
+ *
1485
+ * @private
1486
+ * @constructor
1487
+ * @param {Array} [entries] The key-value pairs to cache.
1488
+ */
1489
+ function Stack(entries) {
1490
+ var data = this.__data__ = new _ListCache(entries);
1491
+ this.size = data.size;
1492
+ }
1493
+
1494
+ // Add methods to `Stack`.
1495
+ Stack.prototype.clear = _stackClear;
1496
+ Stack.prototype['delete'] = _stackDelete;
1497
+ Stack.prototype.get = _stackGet;
1498
+ Stack.prototype.has = _stackHas;
1499
+ Stack.prototype.set = _stackSet;
1500
+
1501
+ var _Stack = Stack;
1502
+
1503
+ /** Used to stand-in for `undefined` hash values. */
1504
+ var HASH_UNDEFINED = '__lodash_hash_undefined__';
1505
+
1506
+ /**
1507
+ * Adds `value` to the array cache.
1508
+ *
1509
+ * @private
1510
+ * @name add
1511
+ * @memberOf SetCache
1512
+ * @alias push
1513
+ * @param {*} value The value to cache.
1514
+ * @returns {Object} Returns the cache instance.
1515
+ */
1516
+ function setCacheAdd(value) {
1517
+ this.__data__.set(value, HASH_UNDEFINED);
1518
+ return this;
1519
+ }
1520
+
1521
+ var _setCacheAdd = setCacheAdd;
1522
+
1523
+ /**
1524
+ * Checks if `value` is in the array cache.
1525
+ *
1526
+ * @private
1527
+ * @name has
1528
+ * @memberOf SetCache
1529
+ * @param {*} value The value to search for.
1530
+ * @returns {number} Returns `true` if `value` is found, else `false`.
1531
+ */
1532
+ function setCacheHas(value) {
1533
+ return this.__data__.has(value);
1534
+ }
1535
+
1536
+ var _setCacheHas = setCacheHas;
1537
+
1538
+ /**
1539
+ *
1540
+ * Creates an array cache object to store unique values.
1541
+ *
1542
+ * @private
1543
+ * @constructor
1544
+ * @param {Array} [values] The values to cache.
1545
+ */
1546
+ function SetCache(values) {
1547
+ var index = -1,
1548
+ length = values == null ? 0 : values.length;
1549
+
1550
+ this.__data__ = new _MapCache;
1551
+ while (++index < length) {
1552
+ this.add(values[index]);
1553
+ }
1554
+ }
1555
+
1556
+ // Add methods to `SetCache`.
1557
+ SetCache.prototype.add = SetCache.prototype.push = _setCacheAdd;
1558
+ SetCache.prototype.has = _setCacheHas;
1559
+
1560
+ var _SetCache = SetCache;
1561
+
1562
+ /**
1563
+ * A specialized version of `_.some` for arrays without support for iteratee
1564
+ * shorthands.
1565
+ *
1566
+ * @private
1567
+ * @param {Array} [array] The array to iterate over.
1568
+ * @param {Function} predicate The function invoked per iteration.
1569
+ * @returns {boolean} Returns `true` if any element passes the predicate check,
1570
+ * else `false`.
1571
+ */
1572
+ function arraySome(array, predicate) {
1573
+ var index = -1,
1574
+ length = array == null ? 0 : array.length;
1575
+
1576
+ while (++index < length) {
1577
+ if (predicate(array[index], index, array)) {
1578
+ return true;
1579
+ }
1580
+ }
1581
+ return false;
1582
+ }
1583
+
1584
+ var _arraySome = arraySome;
1585
+
1586
+ /**
1587
+ * Checks if a `cache` value for `key` exists.
1588
+ *
1589
+ * @private
1590
+ * @param {Object} cache The cache to query.
1591
+ * @param {string} key The key of the entry to check.
1592
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1593
+ */
1594
+ function cacheHas(cache, key) {
1595
+ return cache.has(key);
1596
+ }
1597
+
1598
+ var _cacheHas = cacheHas;
1599
+
1600
+ /** Used to compose bitmasks for value comparisons. */
1601
+ var COMPARE_PARTIAL_FLAG$5 = 1,
1602
+ COMPARE_UNORDERED_FLAG$3 = 2;
1603
+
1604
+ /**
1605
+ * A specialized version of `baseIsEqualDeep` for arrays with support for
1606
+ * partial deep comparisons.
1607
+ *
1608
+ * @private
1609
+ * @param {Array} array The array to compare.
1610
+ * @param {Array} other The other array to compare.
1611
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
1612
+ * @param {Function} customizer The function to customize comparisons.
1613
+ * @param {Function} equalFunc The function to determine equivalents of values.
1614
+ * @param {Object} stack Tracks traversed `array` and `other` objects.
1615
+ * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
1616
+ */
1617
+ function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
1618
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG$5,
1619
+ arrLength = array.length,
1620
+ othLength = other.length;
1621
+
1622
+ if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
1623
+ return false;
1624
+ }
1625
+ // Check that cyclic values are equal.
1626
+ var arrStacked = stack.get(array);
1627
+ var othStacked = stack.get(other);
1628
+ if (arrStacked && othStacked) {
1629
+ return arrStacked == other && othStacked == array;
1630
+ }
1631
+ var index = -1,
1632
+ result = true,
1633
+ seen = (bitmask & COMPARE_UNORDERED_FLAG$3) ? new _SetCache : undefined;
1634
+
1635
+ stack.set(array, other);
1636
+ stack.set(other, array);
1637
+
1638
+ // Ignore non-index properties.
1639
+ while (++index < arrLength) {
1640
+ var arrValue = array[index],
1641
+ othValue = other[index];
1642
+
1643
+ if (customizer) {
1644
+ var compared = isPartial
1645
+ ? customizer(othValue, arrValue, index, other, array, stack)
1646
+ : customizer(arrValue, othValue, index, array, other, stack);
1647
+ }
1648
+ if (compared !== undefined) {
1649
+ if (compared) {
1650
+ continue;
1651
+ }
1652
+ result = false;
1653
+ break;
1654
+ }
1655
+ // Recursively compare arrays (susceptible to call stack limits).
1656
+ if (seen) {
1657
+ if (!_arraySome(other, function(othValue, othIndex) {
1658
+ if (!_cacheHas(seen, othIndex) &&
1659
+ (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
1660
+ return seen.push(othIndex);
1661
+ }
1662
+ })) {
1663
+ result = false;
1664
+ break;
1665
+ }
1666
+ } else if (!(
1667
+ arrValue === othValue ||
1668
+ equalFunc(arrValue, othValue, bitmask, customizer, stack)
1669
+ )) {
1670
+ result = false;
1671
+ break;
1672
+ }
1673
+ }
1674
+ stack['delete'](array);
1675
+ stack['delete'](other);
1676
+ return result;
1677
+ }
1678
+
1679
+ var _equalArrays = equalArrays;
1680
+
1681
+ /** Built-in value references. */
1682
+ var Uint8Array = debounce$1._root.Uint8Array;
1683
+
1684
+ var _Uint8Array = Uint8Array;
1685
+
1686
+ /**
1687
+ * Converts `map` to its key-value pairs.
1688
+ *
1689
+ * @private
1690
+ * @param {Object} map The map to convert.
1691
+ * @returns {Array} Returns the key-value pairs.
1692
+ */
1693
+ function mapToArray(map) {
1694
+ var index = -1,
1695
+ result = Array(map.size);
1696
+
1697
+ map.forEach(function(value, key) {
1698
+ result[++index] = [key, value];
1699
+ });
1700
+ return result;
1701
+ }
1702
+
1703
+ var _mapToArray = mapToArray;
1704
+
1705
+ /**
1706
+ * Converts `set` to an array of its values.
1707
+ *
1708
+ * @private
1709
+ * @param {Object} set The set to convert.
1710
+ * @returns {Array} Returns the values.
1711
+ */
1712
+ function setToArray(set) {
1713
+ var index = -1,
1714
+ result = Array(set.size);
1715
+
1716
+ set.forEach(function(value) {
1717
+ result[++index] = value;
1718
+ });
1719
+ return result;
1720
+ }
1721
+
1722
+ var _setToArray = setToArray;
1723
+
1724
+ /** Used to compose bitmasks for value comparisons. */
1725
+ var COMPARE_PARTIAL_FLAG$4 = 1,
1726
+ COMPARE_UNORDERED_FLAG$2 = 2;
1727
+
1728
+ /** `Object#toString` result references. */
1729
+ var boolTag = '[object Boolean]',
1730
+ dateTag = '[object Date]',
1731
+ errorTag = '[object Error]',
1732
+ mapTag$1 = '[object Map]',
1733
+ numberTag = '[object Number]',
1734
+ regexpTag = '[object RegExp]',
1735
+ setTag$1 = '[object Set]',
1736
+ stringTag = '[object String]',
1737
+ symbolTag = '[object Symbol]';
1738
+
1739
+ var arrayBufferTag = '[object ArrayBuffer]',
1740
+ dataViewTag$1 = '[object DataView]';
1741
+
1742
+ /** Used to convert symbols to primitives and strings. */
1743
+ var symbolProto$1 = debounce$1._Symbol ? debounce$1._Symbol.prototype : undefined,
1744
+ symbolValueOf = symbolProto$1 ? symbolProto$1.valueOf : undefined;
1745
+
1746
+ /**
1747
+ * A specialized version of `baseIsEqualDeep` for comparing objects of
1748
+ * the same `toStringTag`.
1749
+ *
1750
+ * **Note:** This function only supports comparing values with tags of
1751
+ * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
1752
+ *
1753
+ * @private
1754
+ * @param {Object} object The object to compare.
1755
+ * @param {Object} other The other object to compare.
1756
+ * @param {string} tag The `toStringTag` of the objects to compare.
1757
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
1758
+ * @param {Function} customizer The function to customize comparisons.
1759
+ * @param {Function} equalFunc The function to determine equivalents of values.
1760
+ * @param {Object} stack Tracks traversed `object` and `other` objects.
1761
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
1762
+ */
1763
+ function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
1764
+ switch (tag) {
1765
+ case dataViewTag$1:
1766
+ if ((object.byteLength != other.byteLength) ||
1767
+ (object.byteOffset != other.byteOffset)) {
1768
+ return false;
1769
+ }
1770
+ object = object.buffer;
1771
+ other = other.buffer;
1772
+
1773
+ case arrayBufferTag:
1774
+ if ((object.byteLength != other.byteLength) ||
1775
+ !equalFunc(new _Uint8Array(object), new _Uint8Array(other))) {
1776
+ return false;
1777
+ }
1778
+ return true;
1779
+
1780
+ case boolTag:
1781
+ case dateTag:
1782
+ case numberTag:
1783
+ // Coerce booleans to `1` or `0` and dates to milliseconds.
1784
+ // Invalid dates are coerced to `NaN`.
1785
+ return eq_1(+object, +other);
1786
+
1787
+ case errorTag:
1788
+ return object.name == other.name && object.message == other.message;
1789
+
1790
+ case regexpTag:
1791
+ case stringTag:
1792
+ // Coerce regexes to strings and treat strings, primitives and objects,
1793
+ // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
1794
+ // for more details.
1795
+ return object == (other + '');
1796
+
1797
+ case mapTag$1:
1798
+ var convert = _mapToArray;
1799
+
1800
+ case setTag$1:
1801
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG$4;
1802
+ convert || (convert = _setToArray);
1803
+
1804
+ if (object.size != other.size && !isPartial) {
1805
+ return false;
1806
+ }
1807
+ // Assume cyclic values are equal.
1808
+ var stacked = stack.get(object);
1809
+ if (stacked) {
1810
+ return stacked == other;
1811
+ }
1812
+ bitmask |= COMPARE_UNORDERED_FLAG$2;
1813
+
1814
+ // Recursively compare objects (susceptible to call stack limits).
1815
+ stack.set(object, other);
1816
+ var result = _equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
1817
+ stack['delete'](object);
1818
+ return result;
1819
+
1820
+ case symbolTag:
1821
+ if (symbolValueOf) {
1822
+ return symbolValueOf.call(object) == symbolValueOf.call(other);
1823
+ }
1824
+ }
1825
+ return false;
1826
+ }
1827
+
1828
+ var _equalByTag = equalByTag;
1829
+
1830
+ /**
1831
+ * Appends the elements of `values` to `array`.
1832
+ *
1833
+ * @private
1834
+ * @param {Array} array The array to modify.
1835
+ * @param {Array} values The values to append.
1836
+ * @returns {Array} Returns `array`.
1837
+ */
1838
+ function arrayPush(array, values) {
1839
+ var index = -1,
1840
+ length = values.length,
1841
+ offset = array.length;
1842
+
1843
+ while (++index < length) {
1844
+ array[offset + index] = values[index];
1845
+ }
1846
+ return array;
1847
+ }
1848
+
1849
+ var _arrayPush = arrayPush;
1850
+
1851
+ /**
1852
+ * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
1853
+ * `keysFunc` and `symbolsFunc` to get the enumerable property names and
1854
+ * symbols of `object`.
1855
+ *
1856
+ * @private
1857
+ * @param {Object} object The object to query.
1858
+ * @param {Function} keysFunc The function to get the keys of `object`.
1859
+ * @param {Function} symbolsFunc The function to get the symbols of `object`.
1860
+ * @returns {Array} Returns the array of property names and symbols.
1861
+ */
1862
+ function baseGetAllKeys(object, keysFunc, symbolsFunc) {
1863
+ var result = keysFunc(object);
1864
+ return isArray_1(object) ? result : _arrayPush(result, symbolsFunc(object));
1865
+ }
1866
+
1867
+ var _baseGetAllKeys = baseGetAllKeys;
1868
+
1869
+ /**
1870
+ * A specialized version of `_.filter` for arrays without support for
1871
+ * iteratee shorthands.
1872
+ *
1873
+ * @private
1874
+ * @param {Array} [array] The array to iterate over.
1875
+ * @param {Function} predicate The function invoked per iteration.
1876
+ * @returns {Array} Returns the new filtered array.
1877
+ */
1878
+ function arrayFilter(array, predicate) {
1879
+ var index = -1,
1880
+ length = array == null ? 0 : array.length,
1881
+ resIndex = 0,
1882
+ result = [];
1883
+
1884
+ while (++index < length) {
1885
+ var value = array[index];
1886
+ if (predicate(value, index, array)) {
1887
+ result[resIndex++] = value;
1888
+ }
1889
+ }
1890
+ return result;
1891
+ }
1892
+
1893
+ var _arrayFilter = arrayFilter;
1894
+
1895
+ /**
1896
+ * This method returns a new empty array.
1897
+ *
1898
+ * @static
1899
+ * @memberOf _
1900
+ * @since 4.13.0
1901
+ * @category Util
1902
+ * @returns {Array} Returns the new empty array.
1903
+ * @example
1904
+ *
1905
+ * var arrays = _.times(2, _.stubArray);
1906
+ *
1907
+ * console.log(arrays);
1908
+ * // => [[], []]
1909
+ *
1910
+ * console.log(arrays[0] === arrays[1]);
1911
+ * // => false
1912
+ */
1913
+ function stubArray() {
1914
+ return [];
1915
+ }
1916
+
1917
+ var stubArray_1 = stubArray;
1918
+
1919
+ /** Used for built-in method references. */
1920
+ var objectProto$2 = Object.prototype;
1921
+
1922
+ /** Built-in value references. */
1923
+ var propertyIsEnumerable = objectProto$2.propertyIsEnumerable;
1924
+
1925
+ /* Built-in method references for those with the same name as other `lodash` methods. */
1926
+ var nativeGetSymbols = Object.getOwnPropertySymbols;
1927
+
1928
+ /**
1929
+ * Creates an array of the own enumerable symbols of `object`.
1930
+ *
1931
+ * @private
1932
+ * @param {Object} object The object to query.
1933
+ * @returns {Array} Returns the array of symbols.
1934
+ */
1935
+ var getSymbols = !nativeGetSymbols ? stubArray_1 : function(object) {
1936
+ if (object == null) {
1937
+ return [];
1938
+ }
1939
+ object = Object(object);
1940
+ return _arrayFilter(nativeGetSymbols(object), function(symbol) {
1941
+ return propertyIsEnumerable.call(object, symbol);
1942
+ });
1943
+ };
1944
+
1945
+ var _getSymbols = getSymbols;
1946
+
1947
+ /**
1948
+ * Creates an array of own enumerable property names and symbols of `object`.
1949
+ *
1950
+ * @private
1951
+ * @param {Object} object The object to query.
1952
+ * @returns {Array} Returns the array of property names and symbols.
1953
+ */
1954
+ function getAllKeys(object) {
1955
+ return _baseGetAllKeys(object, keys_1, _getSymbols);
1956
+ }
1957
+
1958
+ var _getAllKeys = getAllKeys;
1959
+
1960
+ /** Used to compose bitmasks for value comparisons. */
1961
+ var COMPARE_PARTIAL_FLAG$3 = 1;
1962
+
1963
+ /** Used for built-in method references. */
1964
+ var objectProto$1 = Object.prototype;
1965
+
1966
+ /** Used to check objects for own properties. */
1967
+ var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
1968
+
1969
+ /**
1970
+ * A specialized version of `baseIsEqualDeep` for objects with support for
1971
+ * partial deep comparisons.
1972
+ *
1973
+ * @private
1974
+ * @param {Object} object The object to compare.
1975
+ * @param {Object} other The other object to compare.
1976
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
1977
+ * @param {Function} customizer The function to customize comparisons.
1978
+ * @param {Function} equalFunc The function to determine equivalents of values.
1979
+ * @param {Object} stack Tracks traversed `object` and `other` objects.
1980
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
1981
+ */
1982
+ function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
1983
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3,
1984
+ objProps = _getAllKeys(object),
1985
+ objLength = objProps.length,
1986
+ othProps = _getAllKeys(other),
1987
+ othLength = othProps.length;
1988
+
1989
+ if (objLength != othLength && !isPartial) {
1990
+ return false;
1991
+ }
1992
+ var index = objLength;
1993
+ while (index--) {
1994
+ var key = objProps[index];
1995
+ if (!(isPartial ? key in other : hasOwnProperty$1.call(other, key))) {
1996
+ return false;
1997
+ }
1998
+ }
1999
+ // Check that cyclic values are equal.
2000
+ var objStacked = stack.get(object);
2001
+ var othStacked = stack.get(other);
2002
+ if (objStacked && othStacked) {
2003
+ return objStacked == other && othStacked == object;
2004
+ }
2005
+ var result = true;
2006
+ stack.set(object, other);
2007
+ stack.set(other, object);
2008
+
2009
+ var skipCtor = isPartial;
2010
+ while (++index < objLength) {
2011
+ key = objProps[index];
2012
+ var objValue = object[key],
2013
+ othValue = other[key];
2014
+
2015
+ if (customizer) {
2016
+ var compared = isPartial
2017
+ ? customizer(othValue, objValue, key, other, object, stack)
2018
+ : customizer(objValue, othValue, key, object, other, stack);
2019
+ }
2020
+ // Recursively compare objects (susceptible to call stack limits).
2021
+ if (!(compared === undefined
2022
+ ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
2023
+ : compared
2024
+ )) {
2025
+ result = false;
2026
+ break;
2027
+ }
2028
+ skipCtor || (skipCtor = key == 'constructor');
2029
+ }
2030
+ if (result && !skipCtor) {
2031
+ var objCtor = object.constructor,
2032
+ othCtor = other.constructor;
2033
+
2034
+ // Non `Object` object instances with different constructors are not equal.
2035
+ if (objCtor != othCtor &&
2036
+ ('constructor' in object && 'constructor' in other) &&
2037
+ !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
2038
+ typeof othCtor == 'function' && othCtor instanceof othCtor)) {
2039
+ result = false;
2040
+ }
2041
+ }
2042
+ stack['delete'](object);
2043
+ stack['delete'](other);
2044
+ return result;
2045
+ }
2046
+
2047
+ var _equalObjects = equalObjects;
2048
+
2049
+ /* Built-in method references that are verified to be native. */
2050
+ var DataView = _getNative(debounce$1._root, 'DataView');
2051
+
2052
+ var _DataView = DataView;
2053
+
2054
+ /* Built-in method references that are verified to be native. */
2055
+ var Promise$1 = _getNative(debounce$1._root, 'Promise');
2056
+
2057
+ var _Promise = Promise$1;
2058
+
2059
+ /* Built-in method references that are verified to be native. */
2060
+ var Set = _getNative(debounce$1._root, 'Set');
2061
+
2062
+ var _Set = Set;
2063
+
2064
+ /* Built-in method references that are verified to be native. */
2065
+ var WeakMap = _getNative(debounce$1._root, 'WeakMap');
2066
+
2067
+ var _WeakMap = WeakMap;
2068
+
2069
+ /** `Object#toString` result references. */
2070
+ var mapTag = '[object Map]',
2071
+ objectTag$1 = '[object Object]',
2072
+ promiseTag = '[object Promise]',
2073
+ setTag = '[object Set]',
2074
+ weakMapTag = '[object WeakMap]';
2075
+
2076
+ var dataViewTag = '[object DataView]';
2077
+
2078
+ /** Used to detect maps, sets, and weakmaps. */
2079
+ var dataViewCtorString = _toSource(_DataView),
2080
+ mapCtorString = _toSource(_Map),
2081
+ promiseCtorString = _toSource(_Promise),
2082
+ setCtorString = _toSource(_Set),
2083
+ weakMapCtorString = _toSource(_WeakMap);
2084
+
2085
+ /**
2086
+ * Gets the `toStringTag` of `value`.
2087
+ *
2088
+ * @private
2089
+ * @param {*} value The value to query.
2090
+ * @returns {string} Returns the `toStringTag`.
2091
+ */
2092
+ var getTag = debounce$1._baseGetTag;
2093
+
2094
+ // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
2095
+ if ((_DataView && getTag(new _DataView(new ArrayBuffer(1))) != dataViewTag) ||
2096
+ (_Map && getTag(new _Map) != mapTag) ||
2097
+ (_Promise && getTag(_Promise.resolve()) != promiseTag) ||
2098
+ (_Set && getTag(new _Set) != setTag) ||
2099
+ (_WeakMap && getTag(new _WeakMap) != weakMapTag)) {
2100
+ getTag = function(value) {
2101
+ var result = debounce$1._baseGetTag(value),
2102
+ Ctor = result == objectTag$1 ? value.constructor : undefined,
2103
+ ctorString = Ctor ? _toSource(Ctor) : '';
2104
+
2105
+ if (ctorString) {
2106
+ switch (ctorString) {
2107
+ case dataViewCtorString: return dataViewTag;
2108
+ case mapCtorString: return mapTag;
2109
+ case promiseCtorString: return promiseTag;
2110
+ case setCtorString: return setTag;
2111
+ case weakMapCtorString: return weakMapTag;
2112
+ }
2113
+ }
2114
+ return result;
2115
+ };
2116
+ }
2117
+
2118
+ var _getTag = getTag;
2119
+
2120
+ /** Used to compose bitmasks for value comparisons. */
2121
+ var COMPARE_PARTIAL_FLAG$2 = 1;
2122
+
2123
+ /** `Object#toString` result references. */
2124
+ var argsTag = '[object Arguments]',
2125
+ arrayTag = '[object Array]',
2126
+ objectTag = '[object Object]';
2127
+
2128
+ /** Used for built-in method references. */
2129
+ var objectProto = Object.prototype;
2130
+
2131
+ /** Used to check objects for own properties. */
2132
+ var hasOwnProperty = objectProto.hasOwnProperty;
2133
+
2134
+ /**
2135
+ * A specialized version of `baseIsEqual` for arrays and objects which performs
2136
+ * deep comparisons and tracks traversed objects enabling objects with circular
2137
+ * references to be compared.
2138
+ *
2139
+ * @private
2140
+ * @param {Object} object The object to compare.
2141
+ * @param {Object} other The other object to compare.
2142
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
2143
+ * @param {Function} customizer The function to customize comparisons.
2144
+ * @param {Function} equalFunc The function to determine equivalents of values.
2145
+ * @param {Object} [stack] Tracks traversed `object` and `other` objects.
2146
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
2147
+ */
2148
+ function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
2149
+ var objIsArr = isArray_1(object),
2150
+ othIsArr = isArray_1(other),
2151
+ objTag = objIsArr ? arrayTag : _getTag(object),
2152
+ othTag = othIsArr ? arrayTag : _getTag(other);
2153
+
2154
+ objTag = objTag == argsTag ? objectTag : objTag;
2155
+ othTag = othTag == argsTag ? objectTag : othTag;
2156
+
2157
+ var objIsObj = objTag == objectTag,
2158
+ othIsObj = othTag == objectTag,
2159
+ isSameTag = objTag == othTag;
2160
+
2161
+ if (isSameTag && isBuffer_1(object)) {
2162
+ if (!isBuffer_1(other)) {
2163
+ return false;
2164
+ }
2165
+ objIsArr = true;
2166
+ objIsObj = false;
2167
+ }
2168
+ if (isSameTag && !objIsObj) {
2169
+ stack || (stack = new _Stack);
2170
+ return (objIsArr || isTypedArray_1(object))
2171
+ ? _equalArrays(object, other, bitmask, customizer, equalFunc, stack)
2172
+ : _equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
2173
+ }
2174
+ if (!(bitmask & COMPARE_PARTIAL_FLAG$2)) {
2175
+ var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
2176
+ othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
2177
+
2178
+ if (objIsWrapped || othIsWrapped) {
2179
+ var objUnwrapped = objIsWrapped ? object.value() : object,
2180
+ othUnwrapped = othIsWrapped ? other.value() : other;
2181
+
2182
+ stack || (stack = new _Stack);
2183
+ return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
2184
+ }
2185
+ }
2186
+ if (!isSameTag) {
2187
+ return false;
2188
+ }
2189
+ stack || (stack = new _Stack);
2190
+ return _equalObjects(object, other, bitmask, customizer, equalFunc, stack);
2191
+ }
2192
+
2193
+ var _baseIsEqualDeep = baseIsEqualDeep;
2194
+
2195
+ /**
2196
+ * The base implementation of `_.isEqual` which supports partial comparisons
2197
+ * and tracks traversed objects.
2198
+ *
2199
+ * @private
2200
+ * @param {*} value The value to compare.
2201
+ * @param {*} other The other value to compare.
2202
+ * @param {boolean} bitmask The bitmask flags.
2203
+ * 1 - Unordered comparison
2204
+ * 2 - Partial comparison
2205
+ * @param {Function} [customizer] The function to customize comparisons.
2206
+ * @param {Object} [stack] Tracks traversed `value` and `other` objects.
2207
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
2208
+ */
2209
+ function baseIsEqual(value, other, bitmask, customizer, stack) {
2210
+ if (value === other) {
2211
+ return true;
2212
+ }
2213
+ if (value == null || other == null || (!debounce$1.isObjectLike_1(value) && !debounce$1.isObjectLike_1(other))) {
2214
+ return value !== value && other !== other;
2215
+ }
2216
+ return _baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
2217
+ }
2218
+
2219
+ var _baseIsEqual = baseIsEqual;
2220
+
2221
+ /** Used to compose bitmasks for value comparisons. */
2222
+ var COMPARE_PARTIAL_FLAG$1 = 1,
2223
+ COMPARE_UNORDERED_FLAG$1 = 2;
2224
+
2225
+ /**
2226
+ * The base implementation of `_.isMatch` without support for iteratee shorthands.
2227
+ *
2228
+ * @private
2229
+ * @param {Object} object The object to inspect.
2230
+ * @param {Object} source The object of property values to match.
2231
+ * @param {Array} matchData The property names, values, and compare flags to match.
2232
+ * @param {Function} [customizer] The function to customize comparisons.
2233
+ * @returns {boolean} Returns `true` if `object` is a match, else `false`.
2234
+ */
2235
+ function baseIsMatch(object, source, matchData, customizer) {
2236
+ var index = matchData.length,
2237
+ length = index,
2238
+ noCustomizer = !customizer;
2239
+
2240
+ if (object == null) {
2241
+ return !length;
2242
+ }
2243
+ object = Object(object);
2244
+ while (index--) {
2245
+ var data = matchData[index];
2246
+ if ((noCustomizer && data[2])
2247
+ ? data[1] !== object[data[0]]
2248
+ : !(data[0] in object)
2249
+ ) {
2250
+ return false;
2251
+ }
2252
+ }
2253
+ while (++index < length) {
2254
+ data = matchData[index];
2255
+ var key = data[0],
2256
+ objValue = object[key],
2257
+ srcValue = data[1];
2258
+
2259
+ if (noCustomizer && data[2]) {
2260
+ if (objValue === undefined && !(key in object)) {
2261
+ return false;
2262
+ }
2263
+ } else {
2264
+ var stack = new _Stack;
2265
+ if (customizer) {
2266
+ var result = customizer(objValue, srcValue, key, object, source, stack);
2267
+ }
2268
+ if (!(result === undefined
2269
+ ? _baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG$1 | COMPARE_UNORDERED_FLAG$1, customizer, stack)
2270
+ : result
2271
+ )) {
2272
+ return false;
2273
+ }
2274
+ }
2275
+ }
2276
+ return true;
2277
+ }
2278
+
2279
+ var _baseIsMatch = baseIsMatch;
2280
+
2281
+ /**
2282
+ * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
2283
+ *
2284
+ * @private
2285
+ * @param {*} value The value to check.
2286
+ * @returns {boolean} Returns `true` if `value` if suitable for strict
2287
+ * equality comparisons, else `false`.
2288
+ */
2289
+ function isStrictComparable(value) {
2290
+ return value === value && !debounce$1.isObject_1(value);
2291
+ }
2292
+
2293
+ var _isStrictComparable = isStrictComparable;
2294
+
2295
+ /**
2296
+ * Gets the property names, values, and compare flags of `object`.
2297
+ *
2298
+ * @private
2299
+ * @param {Object} object The object to query.
2300
+ * @returns {Array} Returns the match data of `object`.
2301
+ */
2302
+ function getMatchData(object) {
2303
+ var result = keys_1(object),
2304
+ length = result.length;
2305
+
2306
+ while (length--) {
2307
+ var key = result[length],
2308
+ value = object[key];
2309
+
2310
+ result[length] = [key, value, _isStrictComparable(value)];
2311
+ }
2312
+ return result;
2313
+ }
2314
+
2315
+ var _getMatchData = getMatchData;
2316
+
2317
+ /**
2318
+ * A specialized version of `matchesProperty` for source values suitable
2319
+ * for strict equality comparisons, i.e. `===`.
2320
+ *
2321
+ * @private
2322
+ * @param {string} key The key of the property to get.
2323
+ * @param {*} srcValue The value to match.
2324
+ * @returns {Function} Returns the new spec function.
2325
+ */
2326
+ function matchesStrictComparable(key, srcValue) {
2327
+ return function(object) {
2328
+ if (object == null) {
2329
+ return false;
2330
+ }
2331
+ return object[key] === srcValue &&
2332
+ (srcValue !== undefined || (key in Object(object)));
2333
+ };
2334
+ }
2335
+
2336
+ var _matchesStrictComparable = matchesStrictComparable;
2337
+
2338
+ /**
2339
+ * The base implementation of `_.matches` which doesn't clone `source`.
2340
+ *
2341
+ * @private
2342
+ * @param {Object} source The object of property values to match.
2343
+ * @returns {Function} Returns the new spec function.
2344
+ */
2345
+ function baseMatches(source) {
2346
+ var matchData = _getMatchData(source);
2347
+ if (matchData.length == 1 && matchData[0][2]) {
2348
+ return _matchesStrictComparable(matchData[0][0], matchData[0][1]);
2349
+ }
2350
+ return function(object) {
2351
+ return object === source || _baseIsMatch(object, source, matchData);
2352
+ };
2353
+ }
2354
+
2355
+ var _baseMatches = baseMatches;
2356
+
2357
+ /** Used to match property names within property paths. */
2358
+ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
2359
+ reIsPlainProp = /^\w*$/;
2360
+
2361
+ /**
2362
+ * Checks if `value` is a property name and not a property path.
2363
+ *
2364
+ * @private
2365
+ * @param {*} value The value to check.
2366
+ * @param {Object} [object] The object to query keys on.
2367
+ * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
2368
+ */
2369
+ function isKey(value, object) {
2370
+ if (isArray_1(value)) {
2371
+ return false;
2372
+ }
2373
+ var type = typeof value;
2374
+ if (type == 'number' || type == 'symbol' || type == 'boolean' ||
2375
+ value == null || debounce$1.isSymbol_1(value)) {
2376
+ return true;
2377
+ }
2378
+ return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
2379
+ (object != null && value in Object(object));
2380
+ }
2381
+
2382
+ var _isKey = isKey;
2383
+
2384
+ /** Error message constants. */
2385
+ var FUNC_ERROR_TEXT = 'Expected a function';
2386
+
2387
+ /**
2388
+ * Creates a function that memoizes the result of `func`. If `resolver` is
2389
+ * provided, it determines the cache key for storing the result based on the
2390
+ * arguments provided to the memoized function. By default, the first argument
2391
+ * provided to the memoized function is used as the map cache key. The `func`
2392
+ * is invoked with the `this` binding of the memoized function.
2393
+ *
2394
+ * **Note:** The cache is exposed as the `cache` property on the memoized
2395
+ * function. Its creation may be customized by replacing the `_.memoize.Cache`
2396
+ * constructor with one whose instances implement the
2397
+ * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
2398
+ * method interface of `clear`, `delete`, `get`, `has`, and `set`.
2399
+ *
2400
+ * @static
2401
+ * @memberOf _
2402
+ * @since 0.1.0
2403
+ * @category Function
2404
+ * @param {Function} func The function to have its output memoized.
2405
+ * @param {Function} [resolver] The function to resolve the cache key.
2406
+ * @returns {Function} Returns the new memoized function.
2407
+ * @example
2408
+ *
2409
+ * var object = { 'a': 1, 'b': 2 };
2410
+ * var other = { 'c': 3, 'd': 4 };
2411
+ *
2412
+ * var values = _.memoize(_.values);
2413
+ * values(object);
2414
+ * // => [1, 2]
2415
+ *
2416
+ * values(other);
2417
+ * // => [3, 4]
2418
+ *
2419
+ * object.a = 2;
2420
+ * values(object);
2421
+ * // => [1, 2]
2422
+ *
2423
+ * // Modify the result cache.
2424
+ * values.cache.set(object, ['a', 'b']);
2425
+ * values(object);
2426
+ * // => ['a', 'b']
2427
+ *
2428
+ * // Replace `_.memoize.Cache`.
2429
+ * _.memoize.Cache = WeakMap;
2430
+ */
2431
+ function memoize(func, resolver) {
2432
+ if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
2433
+ throw new TypeError(FUNC_ERROR_TEXT);
2434
+ }
2435
+ var memoized = function() {
2436
+ var args = arguments,
2437
+ key = resolver ? resolver.apply(this, args) : args[0],
2438
+ cache = memoized.cache;
2439
+
2440
+ if (cache.has(key)) {
2441
+ return cache.get(key);
2442
+ }
2443
+ var result = func.apply(this, args);
2444
+ memoized.cache = cache.set(key, result) || cache;
2445
+ return result;
2446
+ };
2447
+ memoized.cache = new (memoize.Cache || _MapCache);
2448
+ return memoized;
2449
+ }
2450
+
2451
+ // Expose `MapCache`.
2452
+ memoize.Cache = _MapCache;
2453
+
2454
+ var memoize_1 = memoize;
2455
+
2456
+ /** Used as the maximum memoize cache size. */
2457
+ var MAX_MEMOIZE_SIZE = 500;
2458
+
2459
+ /**
2460
+ * A specialized version of `_.memoize` which clears the memoized function's
2461
+ * cache when it exceeds `MAX_MEMOIZE_SIZE`.
2462
+ *
2463
+ * @private
2464
+ * @param {Function} func The function to have its output memoized.
2465
+ * @returns {Function} Returns the new memoized function.
2466
+ */
2467
+ function memoizeCapped(func) {
2468
+ var result = memoize_1(func, function(key) {
2469
+ if (cache.size === MAX_MEMOIZE_SIZE) {
2470
+ cache.clear();
2471
+ }
2472
+ return key;
2473
+ });
2474
+
2475
+ var cache = result.cache;
2476
+ return result;
2477
+ }
2478
+
2479
+ var _memoizeCapped = memoizeCapped;
2480
+
2481
+ /** Used to match property names within property paths. */
2482
+ var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
2483
+
2484
+ /** Used to match backslashes in property paths. */
2485
+ var reEscapeChar = /\\(\\)?/g;
2486
+
2487
+ /**
2488
+ * Converts `string` to a property path array.
2489
+ *
2490
+ * @private
2491
+ * @param {string} string The string to convert.
2492
+ * @returns {Array} Returns the property path array.
2493
+ */
2494
+ var stringToPath = _memoizeCapped(function(string) {
2495
+ var result = [];
2496
+ if (string.charCodeAt(0) === 46 /* . */) {
2497
+ result.push('');
2498
+ }
2499
+ string.replace(rePropName, function(match, number, quote, subString) {
2500
+ result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
2501
+ });
2502
+ return result;
2503
+ });
2504
+
2505
+ var _stringToPath = stringToPath;
2506
+
2507
+ /**
2508
+ * A specialized version of `_.map` for arrays without support for iteratee
2509
+ * shorthands.
2510
+ *
2511
+ * @private
2512
+ * @param {Array} [array] The array to iterate over.
2513
+ * @param {Function} iteratee The function invoked per iteration.
2514
+ * @returns {Array} Returns the new mapped array.
2515
+ */
2516
+ function arrayMap(array, iteratee) {
2517
+ var index = -1,
2518
+ length = array == null ? 0 : array.length,
2519
+ result = Array(length);
2520
+
2521
+ while (++index < length) {
2522
+ result[index] = iteratee(array[index], index, array);
2523
+ }
2524
+ return result;
2525
+ }
2526
+
2527
+ var _arrayMap = arrayMap;
2528
+
2529
+ /** Used as references for various `Number` constants. */
2530
+ var INFINITY$2 = 1 / 0;
2531
+
2532
+ /** Used to convert symbols to primitives and strings. */
2533
+ var symbolProto = debounce$1._Symbol ? debounce$1._Symbol.prototype : undefined,
2534
+ symbolToString = symbolProto ? symbolProto.toString : undefined;
2535
+
2536
+ /**
2537
+ * The base implementation of `_.toString` which doesn't convert nullish
2538
+ * values to empty strings.
2539
+ *
2540
+ * @private
2541
+ * @param {*} value The value to process.
2542
+ * @returns {string} Returns the string.
2543
+ */
2544
+ function baseToString(value) {
2545
+ // Exit early for strings to avoid a performance hit in some environments.
2546
+ if (typeof value == 'string') {
2547
+ return value;
2548
+ }
2549
+ if (isArray_1(value)) {
2550
+ // Recursively convert values (susceptible to call stack limits).
2551
+ return _arrayMap(value, baseToString) + '';
2552
+ }
2553
+ if (debounce$1.isSymbol_1(value)) {
2554
+ return symbolToString ? symbolToString.call(value) : '';
2555
+ }
2556
+ var result = (value + '');
2557
+ return (result == '0' && (1 / value) == -INFINITY$2) ? '-0' : result;
2558
+ }
2559
+
2560
+ var _baseToString = baseToString;
2561
+
2562
+ /**
2563
+ * Converts `value` to a string. An empty string is returned for `null`
2564
+ * and `undefined` values. The sign of `-0` is preserved.
2565
+ *
2566
+ * @static
2567
+ * @memberOf _
2568
+ * @since 4.0.0
2569
+ * @category Lang
2570
+ * @param {*} value The value to convert.
2571
+ * @returns {string} Returns the converted string.
2572
+ * @example
2573
+ *
2574
+ * _.toString(null);
2575
+ * // => ''
2576
+ *
2577
+ * _.toString(-0);
2578
+ * // => '-0'
2579
+ *
2580
+ * _.toString([1, 2, 3]);
2581
+ * // => '1,2,3'
2582
+ */
2583
+ function toString(value) {
2584
+ return value == null ? '' : _baseToString(value);
2585
+ }
2586
+
2587
+ var toString_1 = toString;
2588
+
2589
+ /**
2590
+ * Casts `value` to a path array if it's not one.
2591
+ *
2592
+ * @private
2593
+ * @param {*} value The value to inspect.
2594
+ * @param {Object} [object] The object to query keys on.
2595
+ * @returns {Array} Returns the cast property path array.
2596
+ */
2597
+ function castPath(value, object) {
2598
+ if (isArray_1(value)) {
2599
+ return value;
2600
+ }
2601
+ return _isKey(value, object) ? [value] : _stringToPath(toString_1(value));
2602
+ }
2603
+
2604
+ var _castPath = castPath;
2605
+
2606
+ /** Used as references for various `Number` constants. */
2607
+ var INFINITY$1 = 1 / 0;
2608
+
2609
+ /**
2610
+ * Converts `value` to a string key if it's not a string or symbol.
2611
+ *
2612
+ * @private
2613
+ * @param {*} value The value to inspect.
2614
+ * @returns {string|symbol} Returns the key.
2615
+ */
2616
+ function toKey(value) {
2617
+ if (typeof value == 'string' || debounce$1.isSymbol_1(value)) {
2618
+ return value;
2619
+ }
2620
+ var result = (value + '');
2621
+ return (result == '0' && (1 / value) == -INFINITY$1) ? '-0' : result;
2622
+ }
2623
+
2624
+ var _toKey = toKey;
2625
+
2626
+ /**
2627
+ * The base implementation of `_.get` without support for default values.
2628
+ *
2629
+ * @private
2630
+ * @param {Object} object The object to query.
2631
+ * @param {Array|string} path The path of the property to get.
2632
+ * @returns {*} Returns the resolved value.
2633
+ */
2634
+ function baseGet(object, path) {
2635
+ path = _castPath(path, object);
2636
+
2637
+ var index = 0,
2638
+ length = path.length;
2639
+
2640
+ while (object != null && index < length) {
2641
+ object = object[_toKey(path[index++])];
2642
+ }
2643
+ return (index && index == length) ? object : undefined;
2644
+ }
2645
+
2646
+ var _baseGet = baseGet;
2647
+
2648
+ /**
2649
+ * Gets the value at `path` of `object`. If the resolved value is
2650
+ * `undefined`, the `defaultValue` is returned in its place.
2651
+ *
2652
+ * @static
2653
+ * @memberOf _
2654
+ * @since 3.7.0
2655
+ * @category Object
2656
+ * @param {Object} object The object to query.
2657
+ * @param {Array|string} path The path of the property to get.
2658
+ * @param {*} [defaultValue] The value returned for `undefined` resolved values.
2659
+ * @returns {*} Returns the resolved value.
2660
+ * @example
2661
+ *
2662
+ * var object = { 'a': [{ 'b': { 'c': 3 } }] };
2663
+ *
2664
+ * _.get(object, 'a[0].b.c');
2665
+ * // => 3
2666
+ *
2667
+ * _.get(object, ['a', '0', 'b', 'c']);
2668
+ * // => 3
2669
+ *
2670
+ * _.get(object, 'a.b.c', 'default');
2671
+ * // => 'default'
2672
+ */
2673
+ function get(object, path, defaultValue) {
2674
+ var result = object == null ? undefined : _baseGet(object, path);
2675
+ return result === undefined ? defaultValue : result;
2676
+ }
2677
+
2678
+ var get_1 = get;
2679
+
2680
+ /**
2681
+ * The base implementation of `_.hasIn` without support for deep paths.
2682
+ *
2683
+ * @private
2684
+ * @param {Object} [object] The object to query.
2685
+ * @param {Array|string} key The key to check.
2686
+ * @returns {boolean} Returns `true` if `key` exists, else `false`.
2687
+ */
2688
+ function baseHasIn(object, key) {
2689
+ return object != null && key in Object(object);
2690
+ }
2691
+
2692
+ var _baseHasIn = baseHasIn;
2693
+
2694
+ /**
2695
+ * Checks if `path` exists on `object`.
2696
+ *
2697
+ * @private
2698
+ * @param {Object} object The object to query.
2699
+ * @param {Array|string} path The path to check.
2700
+ * @param {Function} hasFunc The function to check properties.
2701
+ * @returns {boolean} Returns `true` if `path` exists, else `false`.
2702
+ */
2703
+ function hasPath(object, path, hasFunc) {
2704
+ path = _castPath(path, object);
2705
+
2706
+ var index = -1,
2707
+ length = path.length,
2708
+ result = false;
2709
+
2710
+ while (++index < length) {
2711
+ var key = _toKey(path[index]);
2712
+ if (!(result = object != null && hasFunc(object, key))) {
2713
+ break;
2714
+ }
2715
+ object = object[key];
2716
+ }
2717
+ if (result || ++index != length) {
2718
+ return result;
2719
+ }
2720
+ length = object == null ? 0 : object.length;
2721
+ return !!length && isLength_1(length) && _isIndex(key, length) &&
2722
+ (isArray_1(object) || isArguments_1(object));
2723
+ }
2724
+
2725
+ var _hasPath = hasPath;
2726
+
2727
+ /**
2728
+ * Checks if `path` is a direct or inherited property of `object`.
2729
+ *
2730
+ * @static
2731
+ * @memberOf _
2732
+ * @since 4.0.0
2733
+ * @category Object
2734
+ * @param {Object} object The object to query.
2735
+ * @param {Array|string} path The path to check.
2736
+ * @returns {boolean} Returns `true` if `path` exists, else `false`.
2737
+ * @example
2738
+ *
2739
+ * var object = _.create({ 'a': _.create({ 'b': 2 }) });
2740
+ *
2741
+ * _.hasIn(object, 'a');
2742
+ * // => true
2743
+ *
2744
+ * _.hasIn(object, 'a.b');
2745
+ * // => true
2746
+ *
2747
+ * _.hasIn(object, ['a', 'b']);
2748
+ * // => true
2749
+ *
2750
+ * _.hasIn(object, 'b');
2751
+ * // => false
2752
+ */
2753
+ function hasIn(object, path) {
2754
+ return object != null && _hasPath(object, path, _baseHasIn);
2755
+ }
2756
+
2757
+ var hasIn_1 = hasIn;
2758
+
2759
+ /** Used to compose bitmasks for value comparisons. */
2760
+ var COMPARE_PARTIAL_FLAG = 1,
2761
+ COMPARE_UNORDERED_FLAG = 2;
2762
+
2763
+ /**
2764
+ * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
2765
+ *
2766
+ * @private
2767
+ * @param {string} path The path of the property to get.
2768
+ * @param {*} srcValue The value to match.
2769
+ * @returns {Function} Returns the new spec function.
2770
+ */
2771
+ function baseMatchesProperty(path, srcValue) {
2772
+ if (_isKey(path) && _isStrictComparable(srcValue)) {
2773
+ return _matchesStrictComparable(_toKey(path), srcValue);
2774
+ }
2775
+ return function(object) {
2776
+ var objValue = get_1(object, path);
2777
+ return (objValue === undefined && objValue === srcValue)
2778
+ ? hasIn_1(object, path)
2779
+ : _baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
2780
+ };
2781
+ }
2782
+
2783
+ var _baseMatchesProperty = baseMatchesProperty;
2784
+
2785
+ /**
2786
+ * The base implementation of `_.property` without support for deep paths.
2787
+ *
2788
+ * @private
2789
+ * @param {string} key The key of the property to get.
2790
+ * @returns {Function} Returns the new accessor function.
2791
+ */
2792
+ function baseProperty(key) {
2793
+ return function(object) {
2794
+ return object == null ? undefined : object[key];
2795
+ };
2796
+ }
2797
+
2798
+ var _baseProperty = baseProperty;
2799
+
2800
+ /**
2801
+ * A specialized version of `baseProperty` which supports deep paths.
2802
+ *
2803
+ * @private
2804
+ * @param {Array|string} path The path of the property to get.
2805
+ * @returns {Function} Returns the new accessor function.
2806
+ */
2807
+ function basePropertyDeep(path) {
2808
+ return function(object) {
2809
+ return _baseGet(object, path);
2810
+ };
2811
+ }
2812
+
2813
+ var _basePropertyDeep = basePropertyDeep;
2814
+
2815
+ /**
2816
+ * Creates a function that returns the value at `path` of a given object.
2817
+ *
2818
+ * @static
2819
+ * @memberOf _
2820
+ * @since 2.4.0
2821
+ * @category Util
2822
+ * @param {Array|string} path The path of the property to get.
2823
+ * @returns {Function} Returns the new accessor function.
2824
+ * @example
2825
+ *
2826
+ * var objects = [
2827
+ * { 'a': { 'b': 2 } },
2828
+ * { 'a': { 'b': 1 } }
2829
+ * ];
2830
+ *
2831
+ * _.map(objects, _.property('a.b'));
2832
+ * // => [2, 1]
2833
+ *
2834
+ * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
2835
+ * // => [1, 2]
2836
+ */
2837
+ function property(path) {
2838
+ return _isKey(path) ? _baseProperty(_toKey(path)) : _basePropertyDeep(path);
2839
+ }
2840
+
2841
+ var property_1 = property;
2842
+
2843
+ /**
2844
+ * The base implementation of `_.iteratee`.
2845
+ *
2846
+ * @private
2847
+ * @param {*} [value=_.identity] The value to convert to an iteratee.
2848
+ * @returns {Function} Returns the iteratee.
2849
+ */
2850
+ function baseIteratee(value) {
2851
+ // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
2852
+ // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
2853
+ if (typeof value == 'function') {
2854
+ return value;
2855
+ }
2856
+ if (value == null) {
2857
+ return identity_1;
2858
+ }
2859
+ if (typeof value == 'object') {
2860
+ return isArray_1(value)
2861
+ ? _baseMatchesProperty(value[0], value[1])
2862
+ : _baseMatches(value);
2863
+ }
2864
+ return property_1(value);
2865
+ }
2866
+
2867
+ var _baseIteratee = baseIteratee;
2868
+
2869
+ /**
2870
+ * The base implementation of `_.reduce` and `_.reduceRight`, without support
2871
+ * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
2872
+ *
2873
+ * @private
2874
+ * @param {Array|Object} collection The collection to iterate over.
2875
+ * @param {Function} iteratee The function invoked per iteration.
2876
+ * @param {*} accumulator The initial value.
2877
+ * @param {boolean} initAccum Specify using the first or last element of
2878
+ * `collection` as the initial value.
2879
+ * @param {Function} eachFunc The function to iterate over `collection`.
2880
+ * @returns {*} Returns the accumulated value.
2881
+ */
2882
+ function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
2883
+ eachFunc(collection, function(value, index, collection) {
2884
+ accumulator = initAccum
2885
+ ? (initAccum = false, value)
2886
+ : iteratee(accumulator, value, index, collection);
2887
+ });
2888
+ return accumulator;
2889
+ }
2890
+
2891
+ var _baseReduce = baseReduce;
2892
+
2893
+ /**
2894
+ * Reduces `collection` to a value which is the accumulated result of running
2895
+ * each element in `collection` thru `iteratee`, where each successive
2896
+ * invocation is supplied the return value of the previous. If `accumulator`
2897
+ * is not given, the first element of `collection` is used as the initial
2898
+ * value. The iteratee is invoked with four arguments:
2899
+ * (accumulator, value, index|key, collection).
2900
+ *
2901
+ * Many lodash methods are guarded to work as iteratees for methods like
2902
+ * `_.reduce`, `_.reduceRight`, and `_.transform`.
2903
+ *
2904
+ * The guarded methods are:
2905
+ * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
2906
+ * and `sortBy`
2907
+ *
2908
+ * @static
2909
+ * @memberOf _
2910
+ * @since 0.1.0
2911
+ * @category Collection
2912
+ * @param {Array|Object} collection The collection to iterate over.
2913
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
2914
+ * @param {*} [accumulator] The initial value.
2915
+ * @returns {*} Returns the accumulated value.
2916
+ * @see _.reduceRight
2917
+ * @example
2918
+ *
2919
+ * _.reduce([1, 2], function(sum, n) {
2920
+ * return sum + n;
2921
+ * }, 0);
2922
+ * // => 3
2923
+ *
2924
+ * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
2925
+ * (result[value] || (result[value] = [])).push(key);
2926
+ * return result;
2927
+ * }, {});
2928
+ * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
2929
+ */
2930
+ function reduce(collection, iteratee, accumulator) {
2931
+ var func = isArray_1(collection) ? _arrayReduce : _baseReduce,
2932
+ initAccum = arguments.length < 3;
2933
+
2934
+ return func(collection, _baseIteratee(iteratee), accumulator, initAccum, _baseEach);
2935
+ }
2936
+
2937
+ var reduce_1 = reduce;
2938
+
2939
+ /**
2940
+ * The base implementation of `_.findIndex` and `_.findLastIndex` without
2941
+ * support for iteratee shorthands.
2942
+ *
2943
+ * @private
2944
+ * @param {Array} array The array to inspect.
2945
+ * @param {Function} predicate The function invoked per iteration.
2946
+ * @param {number} fromIndex The index to search from.
2947
+ * @param {boolean} [fromRight] Specify iterating from right to left.
2948
+ * @returns {number} Returns the index of the matched value, else `-1`.
2949
+ */
2950
+ function baseFindIndex(array, predicate, fromIndex, fromRight) {
2951
+ var length = array.length,
2952
+ index = fromIndex + (fromRight ? 1 : -1);
2953
+
2954
+ while ((fromRight ? index-- : ++index < length)) {
2955
+ if (predicate(array[index], index, array)) {
2956
+ return index;
2957
+ }
2958
+ }
2959
+ return -1;
2960
+ }
2961
+
2962
+ var _baseFindIndex = baseFindIndex;
2963
+
2964
+ /** Used as references for various `Number` constants. */
2965
+ var INFINITY = 1 / 0,
2966
+ MAX_INTEGER = 1.7976931348623157e+308;
2967
+
2968
+ /**
2969
+ * Converts `value` to a finite number.
2970
+ *
2971
+ * @static
2972
+ * @memberOf _
2973
+ * @since 4.12.0
2974
+ * @category Lang
2975
+ * @param {*} value The value to convert.
2976
+ * @returns {number} Returns the converted number.
2977
+ * @example
2978
+ *
2979
+ * _.toFinite(3.2);
2980
+ * // => 3.2
2981
+ *
2982
+ * _.toFinite(Number.MIN_VALUE);
2983
+ * // => 5e-324
2984
+ *
2985
+ * _.toFinite(Infinity);
2986
+ * // => 1.7976931348623157e+308
2987
+ *
2988
+ * _.toFinite('3.2');
2989
+ * // => 3.2
2990
+ */
2991
+ function toFinite(value) {
2992
+ if (!value) {
2993
+ return value === 0 ? value : 0;
2994
+ }
2995
+ value = debounce$1.toNumber_1(value);
2996
+ if (value === INFINITY || value === -INFINITY) {
2997
+ var sign = (value < 0 ? -1 : 1);
2998
+ return sign * MAX_INTEGER;
2999
+ }
3000
+ return value === value ? value : 0;
3001
+ }
3002
+
3003
+ var toFinite_1 = toFinite;
3004
+
3005
+ /**
3006
+ * Converts `value` to an integer.
3007
+ *
3008
+ * **Note:** This method is loosely based on
3009
+ * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
3010
+ *
3011
+ * @static
3012
+ * @memberOf _
3013
+ * @since 4.0.0
3014
+ * @category Lang
3015
+ * @param {*} value The value to convert.
3016
+ * @returns {number} Returns the converted integer.
3017
+ * @example
3018
+ *
3019
+ * _.toInteger(3.2);
3020
+ * // => 3
3021
+ *
3022
+ * _.toInteger(Number.MIN_VALUE);
3023
+ * // => 0
3024
+ *
3025
+ * _.toInteger(Infinity);
3026
+ * // => 1.7976931348623157e+308
3027
+ *
3028
+ * _.toInteger('3.2');
3029
+ * // => 3
3030
+ */
3031
+ function toInteger(value) {
3032
+ var result = toFinite_1(value),
3033
+ remainder = result % 1;
3034
+
3035
+ return result === result ? (remainder ? result - remainder : result) : 0;
3036
+ }
3037
+
3038
+ var toInteger_1 = toInteger;
3039
+
3040
+ /* Built-in method references for those with the same name as other `lodash` methods. */
3041
+ var nativeMax$1 = Math.max;
3042
+
3043
+ /**
3044
+ * This method is like `_.find` except that it returns the index of the first
3045
+ * element `predicate` returns truthy for instead of the element itself.
3046
+ *
3047
+ * @static
3048
+ * @memberOf _
3049
+ * @since 1.1.0
3050
+ * @category Array
3051
+ * @param {Array} array The array to inspect.
3052
+ * @param {Function} [predicate=_.identity] The function invoked per iteration.
3053
+ * @param {number} [fromIndex=0] The index to search from.
3054
+ * @returns {number} Returns the index of the found element, else `-1`.
3055
+ * @example
3056
+ *
3057
+ * var users = [
3058
+ * { 'user': 'barney', 'active': false },
3059
+ * { 'user': 'fred', 'active': false },
3060
+ * { 'user': 'pebbles', 'active': true }
3061
+ * ];
3062
+ *
3063
+ * _.findIndex(users, function(o) { return o.user == 'barney'; });
3064
+ * // => 0
3065
+ *
3066
+ * // The `_.matches` iteratee shorthand.
3067
+ * _.findIndex(users, { 'user': 'fred', 'active': false });
3068
+ * // => 1
3069
+ *
3070
+ * // The `_.matchesProperty` iteratee shorthand.
3071
+ * _.findIndex(users, ['active', false]);
3072
+ * // => 0
3073
+ *
3074
+ * // The `_.property` iteratee shorthand.
3075
+ * _.findIndex(users, 'active');
3076
+ * // => 2
3077
+ */
3078
+ function findIndex(array, predicate, fromIndex) {
3079
+ var length = array == null ? 0 : array.length;
3080
+ if (!length) {
3081
+ return -1;
3082
+ }
3083
+ var index = fromIndex == null ? 0 : toInteger_1(fromIndex);
3084
+ if (index < 0) {
3085
+ index = nativeMax$1(length + index, 0);
3086
+ }
3087
+ return _baseFindIndex(array, _baseIteratee(predicate), index);
3088
+ }
3089
+
3090
+ var findIndex_1 = findIndex;
3091
+
3092
+ const appendToMap = (map, propName, value) => {
3093
+ const items = map.get(propName);
3094
+ if (!items) {
3095
+ map.set(propName, [value]);
3096
+ }
3097
+ else if (!items.includes(value)) {
3098
+ items.push(value);
3099
+ }
3100
+ };
3101
+ const debounce = (fn, ms) => {
3102
+ let timeoutId;
3103
+ return (...args) => {
3104
+ if (timeoutId) {
3105
+ clearTimeout(timeoutId);
3106
+ }
3107
+ timeoutId = setTimeout(() => {
3108
+ timeoutId = 0;
3109
+ fn(...args);
3110
+ }, ms);
3111
+ };
3112
+ };
3113
+
3114
+ /**
3115
+ * Check if a possible element isConnected.
3116
+ * The property might not be there, so we check for it.
3117
+ *
3118
+ * We want it to return true if isConnected is not a property,
3119
+ * otherwise we would remove these elements and would not update.
3120
+ *
3121
+ * Better leak in Edge than to be useless.
3122
+ */
3123
+ const isConnected = (maybeElement) => !('isConnected' in maybeElement) || maybeElement.isConnected;
3124
+ const cleanupElements = debounce((map) => {
3125
+ for (let key of map.keys()) {
3126
+ map.set(key, map.get(key).filter(isConnected));
3127
+ }
3128
+ }, 2000);
3129
+ const stencilSubscription = () => {
3130
+ if (typeof index.getRenderingRef !== 'function') {
3131
+ // If we are not in a stencil project, we do nothing.
3132
+ // This function is not really exported by @stencil/core.
3133
+ return {};
3134
+ }
3135
+ const elmsToUpdate = new Map();
3136
+ return {
3137
+ dispose: () => elmsToUpdate.clear(),
3138
+ get: (propName) => {
3139
+ const elm = index.getRenderingRef();
3140
+ if (elm) {
3141
+ appendToMap(elmsToUpdate, propName, elm);
3142
+ }
3143
+ },
3144
+ set: (propName) => {
3145
+ const elements = elmsToUpdate.get(propName);
3146
+ if (elements) {
3147
+ elmsToUpdate.set(propName, elements.filter(index.forceUpdate));
3148
+ }
3149
+ cleanupElements(elmsToUpdate);
3150
+ },
3151
+ reset: () => {
3152
+ elmsToUpdate.forEach((elms) => elms.forEach(index.forceUpdate));
3153
+ cleanupElements(elmsToUpdate);
3154
+ },
3155
+ };
3156
+ };
3157
+
3158
+ const unwrap = (val) => (typeof val === 'function' ? val() : val);
3159
+ const createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) => {
3160
+ const unwrappedState = unwrap(defaultState);
3161
+ let states = new Map(Object.entries(unwrappedState !== null && unwrappedState !== void 0 ? unwrappedState : {}));
3162
+ const handlers = {
3163
+ dispose: [],
3164
+ get: [],
3165
+ set: [],
3166
+ reset: [],
3167
+ };
3168
+ const reset = () => {
3169
+ var _a;
3170
+ // When resetting the state, the default state may be a function - unwrap it to invoke it.
3171
+ // otherwise, the state won't be properly reset
3172
+ states = new Map(Object.entries((_a = unwrap(defaultState)) !== null && _a !== void 0 ? _a : {}));
3173
+ handlers.reset.forEach((cb) => cb());
3174
+ };
3175
+ const dispose = () => {
3176
+ // Call first dispose as resetting the state would
3177
+ // cause less updates ;)
3178
+ handlers.dispose.forEach((cb) => cb());
3179
+ reset();
3180
+ };
3181
+ const get = (propName) => {
3182
+ handlers.get.forEach((cb) => cb(propName));
3183
+ return states.get(propName);
3184
+ };
3185
+ const set = (propName, value) => {
3186
+ const oldValue = states.get(propName);
3187
+ if (shouldUpdate(value, oldValue, propName)) {
3188
+ states.set(propName, value);
3189
+ handlers.set.forEach((cb) => cb(propName, value, oldValue));
3190
+ }
3191
+ };
3192
+ const state = (typeof Proxy === 'undefined'
3193
+ ? {}
3194
+ : new Proxy(unwrappedState, {
3195
+ get(_, propName) {
3196
+ return get(propName);
3197
+ },
3198
+ ownKeys(_) {
3199
+ return Array.from(states.keys());
3200
+ },
3201
+ getOwnPropertyDescriptor() {
3202
+ return {
3203
+ enumerable: true,
3204
+ configurable: true,
3205
+ };
3206
+ },
3207
+ has(_, propName) {
3208
+ return states.has(propName);
3209
+ },
3210
+ set(_, propName, value) {
3211
+ set(propName, value);
3212
+ return true;
3213
+ },
3214
+ }));
3215
+ const on = (eventName, callback) => {
3216
+ handlers[eventName].push(callback);
3217
+ return () => {
3218
+ removeFromArray(handlers[eventName], callback);
3219
+ };
3220
+ };
3221
+ const onChange = (propName, cb) => {
3222
+ const unSet = on('set', (key, newValue) => {
3223
+ if (key === propName) {
3224
+ cb(newValue);
3225
+ }
3226
+ });
3227
+ // We need to unwrap the defaultState because it might be a function.
3228
+ // Otherwise we might not be sending the right reset value.
3229
+ const unReset = on('reset', () => cb(unwrap(defaultState)[propName]));
3230
+ return () => {
3231
+ unSet();
3232
+ unReset();
3233
+ };
3234
+ };
3235
+ const use = (...subscriptions) => {
3236
+ const unsubs = subscriptions.reduce((unsubs, subscription) => {
3237
+ if (subscription.set) {
3238
+ unsubs.push(on('set', subscription.set));
3239
+ }
3240
+ if (subscription.get) {
3241
+ unsubs.push(on('get', subscription.get));
3242
+ }
3243
+ if (subscription.reset) {
3244
+ unsubs.push(on('reset', subscription.reset));
3245
+ }
3246
+ if (subscription.dispose) {
3247
+ unsubs.push(on('dispose', subscription.dispose));
3248
+ }
3249
+ return unsubs;
3250
+ }, []);
3251
+ return () => unsubs.forEach((unsub) => unsub());
3252
+ };
3253
+ const forceUpdate = (key) => {
3254
+ const oldValue = states.get(key);
3255
+ handlers.set.forEach((cb) => cb(key, oldValue, oldValue));
3256
+ };
3257
+ return {
3258
+ state,
3259
+ get,
3260
+ set,
3261
+ on,
3262
+ onChange,
3263
+ use,
3264
+ dispose,
3265
+ reset,
3266
+ forceUpdate,
3267
+ };
3268
+ };
3269
+ const removeFromArray = (array, item) => {
3270
+ const index = array.indexOf(item);
3271
+ if (index >= 0) {
3272
+ array[index] = array[array.length - 1];
3273
+ array.length--;
3274
+ }
3275
+ };
3276
+
3277
+ const createStore = (defaultState, shouldUpdate) => {
3278
+ const map = createObservableMap(defaultState, shouldUpdate);
3279
+ map.use(stencilSubscription());
3280
+ return map;
3281
+ };
3282
+
3283
+ /* Built-in method references for those with the same name as other `lodash` methods. */
3284
+ var nativeCeil = Math.ceil,
3285
+ nativeMax = Math.max;
3286
+
3287
+ /**
3288
+ * The base implementation of `_.range` and `_.rangeRight` which doesn't
3289
+ * coerce arguments.
3290
+ *
3291
+ * @private
3292
+ * @param {number} start The start of the range.
3293
+ * @param {number} end The end of the range.
3294
+ * @param {number} step The value to increment or decrement by.
3295
+ * @param {boolean} [fromRight] Specify iterating from right to left.
3296
+ * @returns {Array} Returns the range of numbers.
3297
+ */
3298
+ function baseRange(start, end, step, fromRight) {
3299
+ var index = -1,
3300
+ length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
3301
+ result = Array(length);
3302
+
3303
+ while (length--) {
3304
+ result[fromRight ? length : ++index] = start;
3305
+ start += step;
3306
+ }
3307
+ return result;
3308
+ }
3309
+
3310
+ var _baseRange = baseRange;
3311
+
3312
+ /**
3313
+ * Checks if the given arguments are from an iteratee call.
3314
+ *
3315
+ * @private
3316
+ * @param {*} value The potential iteratee value argument.
3317
+ * @param {*} index The potential iteratee index or key argument.
3318
+ * @param {*} object The potential iteratee object argument.
3319
+ * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
3320
+ * else `false`.
3321
+ */
3322
+ function isIterateeCall(value, index, object) {
3323
+ if (!debounce$1.isObject_1(object)) {
3324
+ return false;
3325
+ }
3326
+ var type = typeof index;
3327
+ if (type == 'number'
3328
+ ? (isArrayLike_1(object) && _isIndex(index, object.length))
3329
+ : (type == 'string' && index in object)
3330
+ ) {
3331
+ return eq_1(object[index], value);
3332
+ }
3333
+ return false;
3334
+ }
3335
+
3336
+ var _isIterateeCall = isIterateeCall;
3337
+
3338
+ /**
3339
+ * Creates a `_.range` or `_.rangeRight` function.
3340
+ *
3341
+ * @private
3342
+ * @param {boolean} [fromRight] Specify iterating from right to left.
3343
+ * @returns {Function} Returns the new range function.
3344
+ */
3345
+ function createRange(fromRight) {
3346
+ return function(start, end, step) {
3347
+ if (step && typeof step != 'number' && _isIterateeCall(start, end, step)) {
3348
+ end = step = undefined;
3349
+ }
3350
+ // Ensure the sign of `-0` is preserved.
3351
+ start = toFinite_1(start);
3352
+ if (end === undefined) {
3353
+ end = start;
3354
+ start = 0;
3355
+ } else {
3356
+ end = toFinite_1(end);
3357
+ }
3358
+ step = step === undefined ? (start < end ? 1 : -1) : toFinite_1(step);
3359
+ return _baseRange(start, end, step, fromRight);
3360
+ };
3361
+ }
3362
+
3363
+ var _createRange = createRange;
3364
+
3365
+ /**
3366
+ * Creates an array of numbers (positive and/or negative) progressing from
3367
+ * `start` up to, but not including, `end`. A step of `-1` is used if a negative
3368
+ * `start` is specified without an `end` or `step`. If `end` is not specified,
3369
+ * it's set to `start` with `start` then set to `0`.
3370
+ *
3371
+ * **Note:** JavaScript follows the IEEE-754 standard for resolving
3372
+ * floating-point values which can produce unexpected results.
3373
+ *
3374
+ * @static
3375
+ * @since 0.1.0
3376
+ * @memberOf _
3377
+ * @category Util
3378
+ * @param {number} [start=0] The start of the range.
3379
+ * @param {number} end The end of the range.
3380
+ * @param {number} [step=1] The value to increment or decrement by.
3381
+ * @returns {Array} Returns the range of numbers.
3382
+ * @see _.inRange, _.rangeRight
3383
+ * @example
3384
+ *
3385
+ * _.range(4);
3386
+ * // => [0, 1, 2, 3]
3387
+ *
3388
+ * _.range(-4);
3389
+ * // => [0, -1, -2, -3]
3390
+ *
3391
+ * _.range(1, 5);
3392
+ * // => [1, 2, 3, 4]
3393
+ *
3394
+ * _.range(0, 20, 5);
3395
+ * // => [0, 5, 10, 15]
3396
+ *
3397
+ * _.range(0, -4, -1);
3398
+ * // => [0, -1, -2, -3]
3399
+ *
3400
+ * _.range(1, 4, 0);
3401
+ * // => [1, 1, 1]
3402
+ *
3403
+ * _.range(0);
3404
+ * // => []
3405
+ */
3406
+ var range = _createRange();
3407
+
3408
+ var range_1 = range;
3409
+
3410
+ /**
3411
+ * Hide items from main collection
3412
+ * But keep them in store
3413
+ */
3414
+ const trimmedPlugin = (store) => ({
3415
+ set(k, newVal) {
3416
+ switch (k) {
3417
+ case 'trimmed':
3418
+ const proxy = store.get('proxyItems');
3419
+ const trimmed = gatherTrimmedItems(newVal);
3420
+ const newItems = proxy.reduce((result, v) => {
3421
+ // check if present in new trimmed remove from items (filter)
3422
+ if (!trimmed[v]) {
3423
+ result.push(v);
3424
+ }
3425
+ return result;
3426
+ }, []);
3427
+ store.set('items', newItems);
3428
+ break;
3429
+ }
3430
+ },
3431
+ });
3432
+ function gatherTrimmedItems(trimmedItems) {
3433
+ const trimmed = {};
3434
+ for (let trimmedKey in trimmedItems) {
3435
+ // trimmed overweight not trimmed
3436
+ for (let t in trimmedItems[trimmedKey]) {
3437
+ trimmed[t] = trimmed[t] || trimmedItems[trimmedKey][t];
3438
+ }
3439
+ }
3440
+ return trimmed;
3441
+ }
3442
+
3443
+ /** Set stores data */
3444
+ function setStore(store, data) {
3445
+ for (let key in data) {
3446
+ store.set(key, data[key]);
3447
+ }
3448
+ }
3449
+
3450
+ /**
3451
+ * All items
3452
+ * Used as proxy for sorting
3453
+ * Keep order but do not modify final source
3454
+ */
3455
+ const proxyPlugin = (store) => ({
3456
+ set(k, newVal) {
3457
+ if (!isProxy(k)) {
3458
+ return;
3459
+ }
3460
+ /**
3461
+ * Getting existing collection of items
3462
+ * Mark indexes as visible
3463
+ */
3464
+ const oldItems = store.get('items').reduce((r, v) => {
3465
+ r[v] = true;
3466
+ return r;
3467
+ }, {});
3468
+ /**
3469
+ * Check if new values where present in items
3470
+ * Filter item collection according presense
3471
+ */
3472
+ const newItems = newVal.reduce((r, i) => {
3473
+ if (oldItems[i]) {
3474
+ r.push(i);
3475
+ }
3476
+ return r;
3477
+ }, []);
3478
+ store.set('items', newItems);
3479
+ },
3480
+ });
3481
+ function isProxy(k) {
3482
+ return k === 'proxyItems';
3483
+ }
3484
+
3485
+ class DataStore {
3486
+ get store() {
3487
+ return this.dataStore;
3488
+ }
3489
+ constructor(type) {
3490
+ const store = (this.dataStore = createStore({
3491
+ items: [],
3492
+ proxyItems: [],
3493
+ source: [],
3494
+ groupingDepth: 0,
3495
+ groups: {},
3496
+ type,
3497
+ trimmed: {},
3498
+ groupingCustomRenderer: undefined,
3499
+ }));
3500
+ store.use(proxyPlugin(store));
3501
+ store.use(trimmedPlugin(store));
3502
+ }
3503
+ /**
3504
+ * full data source update
3505
+ * @param source - data column/rgRow source
3506
+ * @param grouping - grouping information if present
3507
+ */
3508
+ updateData(source, grouping, silent = false) {
3509
+ // during full update we do drop trim
3510
+ if (!silent) {
3511
+ this.store.set('trimmed', {});
3512
+ }
3513
+ // clear items
3514
+ this.store.set('items', []);
3515
+ const items = range_1(0, (source === null || source === void 0 ? void 0 : source.length) || 0);
3516
+ // set proxy first
3517
+ setStore(this.store, {
3518
+ source,
3519
+ proxyItems: [...items],
3520
+ });
3521
+ // update data items
3522
+ this.store.set('items', items);
3523
+ // apply grooping if present
3524
+ if (grouping) {
3525
+ setStore(this.store, {
3526
+ groupingDepth: grouping.depth,
3527
+ groups: grouping.groups,
3528
+ groupingCustomRenderer: grouping.customRenderer,
3529
+ });
3530
+ }
3531
+ }
3532
+ addTrimmed(some) {
3533
+ let trimmed = this.store.get('trimmed');
3534
+ trimmed = Object.assign(Object.assign({}, trimmed), some);
3535
+ setStore(this.store, { trimmed });
3536
+ }
3537
+ // local data update
3538
+ setData(input) {
3539
+ const data = Object.assign({}, input);
3540
+ setStore(this.store, data);
3541
+ }
3542
+ refresh() {
3543
+ const source = this.store.get('source');
3544
+ this.store.set('source', [...source]);
3545
+ }
3546
+ }
3547
+ /**
3548
+ * get physical index by virtual
3549
+ * @param store - store to process
3550
+ */
3551
+ function getPhysical(store, virtualIndex) {
3552
+ const items = store.get('items');
3553
+ return items[virtualIndex];
3554
+ }
3555
+ /**
3556
+ * get all visible items
3557
+ * @param store - store to process
3558
+ */
3559
+ function getVisibleSourceItem(store) {
3560
+ const source = store.get('source');
3561
+ return store.get('items').map(v => source[v]);
3562
+ }
3563
+ /**
3564
+ * get mapped item from source
3565
+ * @param store - store to process
3566
+ * @param virtualIndex - virtual index to process
3567
+ */
3568
+ function getSourceItem(store, virtualIndex) {
3569
+ const items = store.get('items');
3570
+ const source = store.get('source');
3571
+ return source[items[virtualIndex]];
3572
+ }
3573
+ /**
3574
+ * set item to source
3575
+ * @param store - store to process
3576
+ * @param modelByIndex - collection of rows with virtual indexes to setup
3577
+ */
3578
+ function setSourceByVirtualIndex(store, modelByIndex) {
3579
+ const items = store.get('items');
3580
+ const source = store.get('source');
3581
+ for (let virtualIndex in modelByIndex) {
3582
+ const realIndex = items[virtualIndex];
3583
+ source[realIndex] = modelByIndex[virtualIndex];
3584
+ }
3585
+ store.set('source', [...source]);
3586
+ }
3587
+ function setItems(store, items) {
3588
+ store.set('items', items);
3589
+ }
3590
+ function getSourceItemVirtualIndexByProp(store, prop) {
3591
+ const items = store.get('items');
3592
+ const source = store.get('source');
3593
+ const physicalIndex = findIndex_1(source, { prop });
3594
+ return items.indexOf(physicalIndex);
3595
+ }
3596
+
3597
+ /** Used as references for the maximum length and index of an array. */
3598
+ var MAX_ARRAY_LENGTH$1 = 4294967295,
3599
+ MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH$1 - 1;
3600
+
3601
+ /* Built-in method references for those with the same name as other `lodash` methods. */
3602
+ var nativeFloor = Math.floor,
3603
+ nativeMin = Math.min;
3604
+
3605
+ /**
3606
+ * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
3607
+ * which invokes `iteratee` for `value` and each element of `array` to compute
3608
+ * their sort ranking. The iteratee is invoked with one argument; (value).
3609
+ *
3610
+ * @private
3611
+ * @param {Array} array The sorted array to inspect.
3612
+ * @param {*} value The value to evaluate.
3613
+ * @param {Function} iteratee The iteratee invoked per element.
3614
+ * @param {boolean} [retHighest] Specify returning the highest qualified index.
3615
+ * @returns {number} Returns the index at which `value` should be inserted
3616
+ * into `array`.
3617
+ */
3618
+ function baseSortedIndexBy(array, value, iteratee, retHighest) {
3619
+ var low = 0,
3620
+ high = array == null ? 0 : array.length;
3621
+ if (high === 0) {
3622
+ return 0;
3623
+ }
3624
+
3625
+ value = iteratee(value);
3626
+ var valIsNaN = value !== value,
3627
+ valIsNull = value === null,
3628
+ valIsSymbol = debounce$1.isSymbol_1(value),
3629
+ valIsUndefined = value === undefined;
3630
+
3631
+ while (low < high) {
3632
+ var mid = nativeFloor((low + high) / 2),
3633
+ computed = iteratee(array[mid]),
3634
+ othIsDefined = computed !== undefined,
3635
+ othIsNull = computed === null,
3636
+ othIsReflexive = computed === computed,
3637
+ othIsSymbol = debounce$1.isSymbol_1(computed);
3638
+
3639
+ if (valIsNaN) {
3640
+ var setLow = retHighest || othIsReflexive;
3641
+ } else if (valIsUndefined) {
3642
+ setLow = othIsReflexive && (retHighest || othIsDefined);
3643
+ } else if (valIsNull) {
3644
+ setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
3645
+ } else if (valIsSymbol) {
3646
+ setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
3647
+ } else if (othIsNull || othIsSymbol) {
3648
+ setLow = false;
3649
+ } else {
3650
+ setLow = retHighest ? (computed <= value) : (computed < value);
3651
+ }
3652
+ if (setLow) {
3653
+ low = mid + 1;
3654
+ } else {
3655
+ high = mid;
3656
+ }
3657
+ }
3658
+ return nativeMin(high, MAX_ARRAY_INDEX);
3659
+ }
3660
+
3661
+ var _baseSortedIndexBy = baseSortedIndexBy;
3662
+
3663
+ /** Used as references for the maximum length and index of an array. */
3664
+ var MAX_ARRAY_LENGTH = 4294967295,
3665
+ HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
3666
+
3667
+ /**
3668
+ * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
3669
+ * performs a binary search of `array` to determine the index at which `value`
3670
+ * should be inserted into `array` in order to maintain its sort order.
3671
+ *
3672
+ * @private
3673
+ * @param {Array} array The sorted array to inspect.
3674
+ * @param {*} value The value to evaluate.
3675
+ * @param {boolean} [retHighest] Specify returning the highest qualified index.
3676
+ * @returns {number} Returns the index at which `value` should be inserted
3677
+ * into `array`.
3678
+ */
3679
+ function baseSortedIndex(array, value, retHighest) {
3680
+ var low = 0,
3681
+ high = array == null ? low : array.length;
3682
+
3683
+ if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
3684
+ while (low < high) {
3685
+ var mid = (low + high) >>> 1,
3686
+ computed = array[mid];
3687
+
3688
+ if (computed !== null && !debounce$1.isSymbol_1(computed) &&
3689
+ (retHighest ? (computed <= value) : (computed < value))) {
3690
+ low = mid + 1;
3691
+ } else {
3692
+ high = mid;
3693
+ }
3694
+ }
3695
+ return high;
3696
+ }
3697
+ return _baseSortedIndexBy(array, value, identity_1, retHighest);
3698
+ }
3699
+
3700
+ var _baseSortedIndex = baseSortedIndex;
3701
+
3702
+ /**
3703
+ * Uses a binary search to determine the lowest index at which `value`
3704
+ * should be inserted into `array` in order to maintain its sort order.
3705
+ *
3706
+ * @static
3707
+ * @memberOf _
3708
+ * @since 0.1.0
3709
+ * @category Array
3710
+ * @param {Array} array The sorted array to inspect.
3711
+ * @param {*} value The value to evaluate.
3712
+ * @returns {number} Returns the index at which `value` should be inserted
3713
+ * into `array`.
3714
+ * @example
3715
+ *
3716
+ * _.sortedIndex([30, 50], 40);
3717
+ * // => 1
3718
+ */
3719
+ function sortedIndex(array, value) {
3720
+ return _baseSortedIndex(array, value);
3721
+ }
3722
+
3723
+ var sortedIndex_1 = sortedIndex;
3724
+
3725
+ /**
3726
+ * Pre-calculation
3727
+ * Dimension custom sizes for each cell
3728
+ * Keeps only changed sizes, skips origin size
3729
+ */
3730
+ function calculateDimensionData(originItemSize, newSizes = {}) {
3731
+ const positionIndexes = [];
3732
+ const positionIndexToItem = {};
3733
+ const indexToItem = {};
3734
+ // combine all new sizes
3735
+ const sizes = Object.assign({}, newSizes);
3736
+ // prepare order sorted new sizes and calculate changed real size
3737
+ let newIndexes = [];
3738
+ each(newSizes, (_, i) => {
3739
+ const index = parseInt(i, 10);
3740
+ newIndexes[sortedIndex_1(newIndexes, index)] = index;
3741
+ });
3742
+ // fill new coordinates based on what is changed
3743
+ reduce_1(newIndexes, (previous, itemIndex, i) => {
3744
+ const newItem = {
3745
+ itemIndex,
3746
+ start: 0,
3747
+ end: 0,
3748
+ };
3749
+ // if previous item was changed too
3750
+ if (previous) {
3751
+ const itemsBetween = (itemIndex - previous.itemIndex - 1) * originItemSize;
3752
+ newItem.start = itemsBetween + previous.end;
3753
+ }
3754
+ else {
3755
+ newItem.start = itemIndex * originItemSize;
3756
+ }
3757
+ newItem.end = newItem.start + sizes[itemIndex];
3758
+ positionIndexes.push(newItem.start);
3759
+ indexToItem[itemIndex] = positionIndexToItem[i] = newItem;
3760
+ return newItem;
3761
+ }, undefined);
3762
+ return {
3763
+ indexes: newIndexes,
3764
+ positionIndexes: [...positionIndexes],
3765
+ positionIndexToItem: Object.assign({}, positionIndexToItem),
3766
+ indexToItem,
3767
+ sizes,
3768
+ };
3769
+ }
3770
+ /**
3771
+ * Calculate item by position
3772
+ */
3773
+ function getItemByPosition({ indexes, positionIndexes, originItemSize, positionIndexToItem }, pos) {
3774
+ const item = {
3775
+ itemIndex: 0,
3776
+ start: 0,
3777
+ end: 0,
3778
+ };
3779
+ const currentPlace = indexes.length ? sortedIndex_1(positionIndexes, pos) : 0;
3780
+ // not found or first index
3781
+ if (!currentPlace) {
3782
+ item.itemIndex = Math.floor(pos / originItemSize);
3783
+ item.start = item.itemIndex * originItemSize;
3784
+ item.end = item.start + originItemSize;
3785
+ return item;
3786
+ }
3787
+ const positionItem = positionIndexToItem[currentPlace - 1];
3788
+ // if item has specified size
3789
+ if (positionItem.end > pos) {
3790
+ return positionItem;
3791
+ }
3792
+ // special size item was present before
3793
+ const relativePos = pos - positionItem.end;
3794
+ const relativeIndex = Math.floor(relativePos / originItemSize);
3795
+ item.itemIndex = positionItem.itemIndex + 1 + relativeIndex;
3796
+ item.start = positionItem.end + relativeIndex * originItemSize;
3797
+ item.end = item.start + originItemSize;
3798
+ return item;
3799
+ }
3800
+ function getItemByIndex(dimension, index) {
3801
+ let item = {
3802
+ itemIndex: index,
3803
+ start: 0,
3804
+ end: 0,
3805
+ };
3806
+ // if item has specified size
3807
+ if (dimension.indexToItem[index]) {
3808
+ return dimension.indexToItem[index];
3809
+ }
3810
+ const currentPlace = dimension.indexes.length ? sortedIndex_1(dimension.indexes, index) : 0;
3811
+ // not found or first index
3812
+ if (!currentPlace) {
3813
+ item.start = item.itemIndex * dimension.originItemSize;
3814
+ item.end = item.start + dimension.originItemSize;
3815
+ return item;
3816
+ }
3817
+ // special size item was present before
3818
+ const positionItem = dimension.indexToItem[dimension.indexes[currentPlace - 1]];
3819
+ item.start = positionItem.end + (index - positionItem.itemIndex - 1) * dimension.originItemSize;
3820
+ item.end = item.start + dimension.originItemSize;
3821
+ return item;
3822
+ }
3823
+
3824
+ const MIN_COL_SIZE = 30;
3825
+ const RESIZE_INTERVAL = 40;
3826
+ const DATA_COL = 'data-rgCol';
3827
+ const DATA_ROW = 'data-rgRow';
3828
+ const UUID = 'grid-uuid';
3829
+ const DISABLED_CLASS = 'disabled';
3830
+ const CELL_CLASS = 'rgCell';
3831
+ const ROW_HEADER_TYPE = 'rowHeaders';
3832
+ const HEADER_CLASS = 'rgHeaderCell';
3833
+ const HEADER_SORTABLE_CLASS = 'sortable';
3834
+ const HEADER_ROW_CLASS = 'header-rgRow';
3835
+ const HEADER_ACTUAL_ROW_CLASS = 'actual-rgRow';
3836
+ const DRAG_ICON_CLASS = 'revo-drag-icon';
3837
+ const DRAGGABLE_CLASS = 'revo-draggable';
3838
+ const FOCUS_CLASS = 'focused-cell';
3839
+ const SELECTION_BORDER_CLASS = 'selection-border-range';
3840
+ const MOBILE_CLASS = 'mobile-handler';
3841
+ const TMP_SELECTION_BG_CLASS = 'temp-bg-range';
3842
+ const CELL_HANDLER_CLASS = 'autofill-handle';
3843
+ const EDIT_INPUT_WR = 'edit-input-wrapper';
3844
+ const DRAGG_TEXT = 'Draggable item';
3845
+ const GRID_INTERNALS = '__rvgr';
3846
+
3847
+ /* Calculate system scrollbar width */
3848
+ function getScrollbarWidth(doc) {
3849
+ // Creating invisible container
3850
+ const outer = doc.createElement('div');
3851
+ const styles = outer.style;
3852
+ styles.visibility = 'hidden';
3853
+ styles.overflow = 'scroll'; // forcing scrollbar to appear
3854
+ styles.msOverflowStyle = 'scrollbar'; // needed for WinJS apps
3855
+ doc.body.appendChild(outer);
3856
+ // Creating inner element and placing it in the container
3857
+ const inner = doc.createElement('div');
3858
+ outer.appendChild(inner);
3859
+ // Calculating difference between container's full width and the child width
3860
+ const scrollbarWidth = outer.offsetWidth - inner.offsetWidth;
3861
+ // Removing temporary elements from the DOM
3862
+ outer.parentNode.removeChild(outer);
3863
+ return scrollbarWidth;
3864
+ }
3865
+ /* Scale a value between 2 ranges
3866
+ *
3867
+ * Sample:
3868
+ * // 55 from a 0-100 range to a 0-1000 range (Ranges don't have to be positive)
3869
+ * const n = scaleValue(55, [0,100], [0,1000]);
3870
+ *
3871
+ * Ranges of two values
3872
+ * @from
3873
+ * @to
3874
+ *
3875
+ * ~~ return value does the equivalent of Math.floor but faster.
3876
+ */
3877
+ function scaleValue(value, from, to) {
3878
+ return ((to[1] - to[0]) * (value - from[0])) / (from[1] - from[0]) + to[0];
3879
+ }
3880
+ /**
3881
+ * Async timeout
3882
+ */
3883
+ async function timeout(delay = 0) {
3884
+ await new Promise((r) => {
3885
+ setTimeout(() => r(), delay);
3886
+ });
3887
+ }
3888
+
3889
+ exports.CELL_CLASS = CELL_CLASS;
3890
+ exports.CELL_HANDLER_CLASS = CELL_HANDLER_CLASS;
3891
+ exports.DATA_COL = DATA_COL;
3892
+ exports.DATA_ROW = DATA_ROW;
3893
+ exports.DISABLED_CLASS = DISABLED_CLASS;
3894
+ exports.DRAGGABLE_CLASS = DRAGGABLE_CLASS;
3895
+ exports.DRAGG_TEXT = DRAGG_TEXT;
3896
+ exports.DRAG_ICON_CLASS = DRAG_ICON_CLASS;
3897
+ exports.DataStore = DataStore;
3898
+ exports.EDIT_INPUT_WR = EDIT_INPUT_WR;
3899
+ exports.FOCUS_CLASS = FOCUS_CLASS;
3900
+ exports.GRID_INTERNALS = GRID_INTERNALS;
3901
+ exports.HEADER_ACTUAL_ROW_CLASS = HEADER_ACTUAL_ROW_CLASS;
3902
+ exports.HEADER_CLASS = HEADER_CLASS;
3903
+ exports.HEADER_ROW_CLASS = HEADER_ROW_CLASS;
3904
+ exports.HEADER_SORTABLE_CLASS = HEADER_SORTABLE_CLASS;
3905
+ exports.MIN_COL_SIZE = MIN_COL_SIZE;
3906
+ exports.MOBILE_CLASS = MOBILE_CLASS;
3907
+ exports.RESIZE_INTERVAL = RESIZE_INTERVAL;
3908
+ exports.ROW_HEADER_TYPE = ROW_HEADER_TYPE;
3909
+ exports.SELECTION_BORDER_CLASS = SELECTION_BORDER_CLASS;
3910
+ exports.TMP_SELECTION_BG_CLASS = TMP_SELECTION_BG_CLASS;
3911
+ exports.UUID = UUID;
3912
+ exports._arrayMap = _arrayMap;
3913
+ exports._baseEach = _baseEach;
3914
+ exports._baseFindIndex = _baseFindIndex;
3915
+ exports._baseIteratee = _baseIteratee;
3916
+ exports._baseKeys = _baseKeys;
3917
+ exports._baseProperty = _baseProperty;
3918
+ exports._getNative = _getNative;
3919
+ exports._getTag = _getTag;
3920
+ exports._isIterateeCall = _isIterateeCall;
3921
+ exports.calculateDimensionData = calculateDimensionData;
3922
+ exports.createStore = createStore;
3923
+ exports.each = each;
3924
+ exports.findIndex_1 = findIndex_1;
3925
+ exports.gatherTrimmedItems = gatherTrimmedItems;
3926
+ exports.getItemByIndex = getItemByIndex;
3927
+ exports.getItemByPosition = getItemByPosition;
3928
+ exports.getPhysical = getPhysical;
3929
+ exports.getScrollbarWidth = getScrollbarWidth;
3930
+ exports.getSourceItem = getSourceItem;
3931
+ exports.getSourceItemVirtualIndexByProp = getSourceItemVirtualIndexByProp;
3932
+ exports.getVisibleSourceItem = getVisibleSourceItem;
3933
+ exports.isArrayLike_1 = isArrayLike_1;
3934
+ exports.isArray_1 = isArray_1;
3935
+ exports.keys_1 = keys_1;
3936
+ exports.reduce_1 = reduce_1;
3937
+ exports.scaleValue = scaleValue;
3938
+ exports.setItems = setItems;
3939
+ exports.setSourceByVirtualIndex = setSourceByVirtualIndex;
3940
+ exports.setStore = setStore;
3941
+ exports.timeout = timeout;
3942
+ exports.toInteger_1 = toInteger_1;
3943
+
3944
+ //# sourceMappingURL=index-effc94b9.js.map