@eva/plugin-evax 1.1.1-beta.0 → 1.1.1-fix.2

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