@tarojs/taro 2.2.18 → 2.2.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -1,80 +1,57 @@
1
- function ownKeys(object, enumerableOnly) {
2
- var keys = Object.keys(object);
3
-
1
+ function ownKeys(e, r) {
2
+ var t = Object.keys(e);
4
3
  if (Object.getOwnPropertySymbols) {
5
- var symbols = Object.getOwnPropertySymbols(object);
6
-
7
- if (enumerableOnly) {
8
- symbols = symbols.filter(function (sym) {
9
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
10
- });
11
- }
12
-
13
- keys.push.apply(keys, symbols);
14
- }
15
-
16
- return keys;
17
- }
18
-
19
- function _objectSpread2(target) {
20
- for (var i = 1; i < arguments.length; i++) {
21
- var source = arguments[i] != null ? arguments[i] : {};
22
-
23
- if (i % 2) {
24
- ownKeys(Object(source), true).forEach(function (key) {
25
- _defineProperty(target, key, source[key]);
26
- });
27
- } else if (Object.getOwnPropertyDescriptors) {
28
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
29
- } else {
30
- ownKeys(Object(source)).forEach(function (key) {
31
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
32
- });
33
- }
4
+ var o = Object.getOwnPropertySymbols(e);
5
+ r && (o = o.filter(function (r) {
6
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
7
+ })), t.push.apply(t, o);
8
+ }
9
+ return t;
10
+ }
11
+ function _objectSpread2(e) {
12
+ for (var r = 1; r < arguments.length; r++) {
13
+ var t = null != arguments[r] ? arguments[r] : {};
14
+ r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
15
+ _defineProperty(e, r, t[r]);
16
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
17
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
18
+ });
34
19
  }
35
-
36
- return target;
20
+ return e;
37
21
  }
38
-
39
- function _typeof(obj) {
22
+ function _typeof(o) {
40
23
  "@babel/helpers - typeof";
41
24
 
42
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
43
- _typeof = function (obj) {
44
- return typeof obj;
45
- };
46
- } else {
47
- _typeof = function (obj) {
48
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
49
- };
50
- }
51
-
52
- return _typeof(obj);
25
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
26
+ return typeof o;
27
+ } : function (o) {
28
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
29
+ }, _typeof(o);
53
30
  }
54
-
55
31
  function _classCallCheck(instance, Constructor) {
56
32
  if (!(instance instanceof Constructor)) {
57
33
  throw new TypeError("Cannot call a class as a function");
58
34
  }
59
35
  }
60
-
61
36
  function _defineProperties(target, props) {
62
37
  for (var i = 0; i < props.length; i++) {
63
38
  var descriptor = props[i];
64
39
  descriptor.enumerable = descriptor.enumerable || false;
65
40
  descriptor.configurable = true;
66
41
  if ("value" in descriptor) descriptor.writable = true;
67
- Object.defineProperty(target, descriptor.key, descriptor);
42
+ Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
68
43
  }
69
44
  }
70
-
71
45
  function _createClass(Constructor, protoProps, staticProps) {
72
46
  if (protoProps) _defineProperties(Constructor.prototype, protoProps);
73
47
  if (staticProps) _defineProperties(Constructor, staticProps);
48
+ Object.defineProperty(Constructor, "prototype", {
49
+ writable: false
50
+ });
74
51
  return Constructor;
75
52
  }
76
-
77
53
  function _defineProperty(obj, key, value) {
54
+ key = _toPropertyKey(key);
78
55
  if (key in obj) {
79
56
  Object.defineProperty(obj, key, {
80
57
  value: value,
@@ -85,15 +62,12 @@ function _defineProperty(obj, key, value) {
85
62
  } else {
86
63
  obj[key] = value;
87
64
  }
88
-
89
65
  return obj;
90
66
  }
91
-
92
67
  function _inherits(subClass, superClass) {
93
68
  if (typeof superClass !== "function" && superClass !== null) {
94
69
  throw new TypeError("Super expression must either be null or a function");
95
70
  }
96
-
97
71
  subClass.prototype = Object.create(superClass && superClass.prototype, {
98
72
  constructor: {
99
73
  value: subClass,
@@ -101,30 +75,28 @@ function _inherits(subClass, superClass) {
101
75
  configurable: true
102
76
  }
103
77
  });
78
+ Object.defineProperty(subClass, "prototype", {
79
+ writable: false
80
+ });
104
81
  if (superClass) _setPrototypeOf(subClass, superClass);
105
82
  }
106
-
107
83
  function _getPrototypeOf(o) {
108
- _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
84
+ _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
109
85
  return o.__proto__ || Object.getPrototypeOf(o);
110
86
  };
111
87
  return _getPrototypeOf(o);
112
88
  }
113
-
114
89
  function _setPrototypeOf(o, p) {
115
- _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
90
+ _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
116
91
  o.__proto__ = p;
117
92
  return o;
118
93
  };
119
-
120
94
  return _setPrototypeOf(o, p);
121
95
  }
122
-
123
96
  function _isNativeReflectConstruct() {
124
97
  if (typeof Reflect === "undefined" || !Reflect.construct) return false;
125
98
  if (Reflect.construct.sham) return false;
126
99
  if (typeof Proxy === "function") return true;
127
-
128
100
  try {
129
101
  Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
130
102
  return true;
@@ -132,10 +104,9 @@ function _isNativeReflectConstruct() {
132
104
  return false;
133
105
  }
134
106
  }
135
-
136
107
  function _construct(Parent, args, Class) {
137
108
  if (_isNativeReflectConstruct()) {
138
- _construct = Reflect.construct;
109
+ _construct = Reflect.construct.bind();
139
110
  } else {
140
111
  _construct = function _construct(Parent, args, Class) {
141
112
  var a = [null];
@@ -146,34 +117,29 @@ function _construct(Parent, args, Class) {
146
117
  return instance;
147
118
  };
148
119
  }
149
-
150
120
  return _construct.apply(null, arguments);
151
121
  }
152
-
153
122
  function _isNativeFunction(fn) {
154
- return Function.toString.call(fn).indexOf("[native code]") !== -1;
123
+ try {
124
+ return Function.toString.call(fn).indexOf("[native code]") !== -1;
125
+ } catch (e) {
126
+ return typeof fn === "function";
127
+ }
155
128
  }
156
-
157
129
  function _wrapNativeSuper(Class) {
158
130
  var _cache = typeof Map === "function" ? new Map() : undefined;
159
-
160
131
  _wrapNativeSuper = function _wrapNativeSuper(Class) {
161
132
  if (Class === null || !_isNativeFunction(Class)) return Class;
162
-
163
133
  if (typeof Class !== "function") {
164
134
  throw new TypeError("Super expression must either be null or a function");
165
135
  }
166
-
167
136
  if (typeof _cache !== "undefined") {
168
137
  if (_cache.has(Class)) return _cache.get(Class);
169
-
170
138
  _cache.set(Class, Wrapper);
171
139
  }
172
-
173
140
  function Wrapper() {
174
141
  return _construct(Class, arguments, _getPrototypeOf(this).constructor);
175
142
  }
176
-
177
143
  Wrapper.prototype = Object.create(Class.prototype, {
178
144
  constructor: {
179
145
  value: Wrapper,
@@ -184,59 +150,45 @@ function _wrapNativeSuper(Class) {
184
150
  });
185
151
  return _setPrototypeOf(Wrapper, Class);
186
152
  };
187
-
188
153
  return _wrapNativeSuper(Class);
189
154
  }
190
-
191
155
  function _assertThisInitialized(self) {
192
156
  if (self === void 0) {
193
157
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
194
158
  }
195
-
196
159
  return self;
197
160
  }
198
-
199
161
  function _possibleConstructorReturn(self, call) {
200
162
  if (call && (typeof call === "object" || typeof call === "function")) {
201
163
  return call;
202
164
  } else if (call !== void 0) {
203
165
  throw new TypeError("Derived constructors may only return object or undefined");
204
166
  }
205
-
206
167
  return _assertThisInitialized(self);
207
168
  }
208
-
209
169
  function _createSuper(Derived) {
210
170
  var hasNativeReflectConstruct = _isNativeReflectConstruct();
211
-
212
171
  return function _createSuperInternal() {
213
172
  var Super = _getPrototypeOf(Derived),
214
- result;
215
-
173
+ result;
216
174
  if (hasNativeReflectConstruct) {
217
175
  var NewTarget = _getPrototypeOf(this).constructor;
218
-
219
176
  result = Reflect.construct(Super, arguments, NewTarget);
220
177
  } else {
221
178
  result = Super.apply(this, arguments);
222
179
  }
223
-
224
180
  return _possibleConstructorReturn(this, result);
225
181
  };
226
182
  }
227
-
228
183
  function _toConsumableArray(arr) {
229
184
  return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
230
185
  }
231
-
232
186
  function _arrayWithoutHoles(arr) {
233
187
  if (Array.isArray(arr)) return _arrayLikeToArray(arr);
234
188
  }
235
-
236
189
  function _iterableToArray(iter) {
237
190
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
238
191
  }
239
-
240
192
  function _unsupportedIterableToArray(o, minLen) {
241
193
  if (!o) return;
242
194
  if (typeof o === "string") return _arrayLikeToArray(o, minLen);
@@ -245,18 +197,28 @@ function _unsupportedIterableToArray(o, minLen) {
245
197
  if (n === "Map" || n === "Set") return Array.from(o);
246
198
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
247
199
  }
248
-
249
200
  function _arrayLikeToArray(arr, len) {
250
201
  if (len == null || len > arr.length) len = arr.length;
251
-
252
202
  for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
253
-
254
203
  return arr2;
255
204
  }
256
-
257
205
  function _nonIterableSpread() {
258
206
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
259
207
  }
208
+ function _toPrimitive(input, hint) {
209
+ if (typeof input !== "object" || input === null) return input;
210
+ var prim = input[Symbol.toPrimitive];
211
+ if (prim !== undefined) {
212
+ var res = prim.call(input, hint || "default");
213
+ if (typeof res !== "object") return res;
214
+ throw new TypeError("@@toPrimitive must return a primitive value.");
215
+ }
216
+ return (hint === "string" ? String : Number)(input);
217
+ }
218
+ function _toPropertyKey(arg) {
219
+ var key = _toPrimitive(arg, "string");
220
+ return typeof key === "symbol" ? key : String(key);
221
+ }
260
222
 
261
223
  if (typeof Object.assign !== 'function') {
262
224
  // Must be writable: true, enumerable: false, configurable: true
@@ -266,12 +228,9 @@ if (typeof Object.assign !== 'function') {
266
228
  // TypeError if undefined or null
267
229
  throw new TypeError('Cannot convert undefined or null to object');
268
230
  }
269
-
270
231
  var to = Object(target);
271
-
272
232
  for (var index = 1; index < arguments.length; index++) {
273
233
  var nextSource = arguments[index];
274
-
275
234
  if (nextSource != null) {
276
235
  // Skip over if undefined or null
277
236
  for (var nextKey in nextSource) {
@@ -282,90 +241,69 @@ if (typeof Object.assign !== 'function') {
282
241
  }
283
242
  }
284
243
  }
285
-
286
244
  return to;
287
245
  };
288
246
  }
289
-
290
247
  if (typeof Object.defineProperties !== 'function') {
291
248
  Object.defineProperties = function (obj, properties) {
292
249
  function convertToDescriptor(desc) {
293
250
  function hasProperty(obj, prop) {
294
251
  return Object.prototype.hasOwnProperty.call(obj, prop);
295
252
  }
296
-
297
253
  function isCallable(v) {
298
254
  // NB: modify as necessary if other values than functions are callable.
299
255
  return typeof v === 'function';
300
256
  }
301
-
302
257
  if (_typeof(desc) !== 'object' || desc === null) {
303
258
  throw new TypeError('bad desc');
304
259
  }
305
-
306
260
  var d = {};
307
261
  if (hasProperty(desc, 'enumerable')) d.enumerable = !!desc.enumerable;
308
-
309
262
  if (hasProperty(desc, 'configurable')) {
310
263
  d.configurable = !!desc.configurable;
311
264
  }
312
-
313
265
  if (hasProperty(desc, 'value')) d.value = desc.value;
314
266
  if (hasProperty(desc, 'writable')) d.writable = !!desc.writable;
315
-
316
267
  if (hasProperty(desc, 'get')) {
317
268
  var g = desc.get;
318
-
319
269
  if (!isCallable(g) && typeof g !== 'undefined') {
320
270
  throw new TypeError('bad get');
321
271
  }
322
-
323
272
  d.get = g;
324
273
  }
325
-
326
274
  if (hasProperty(desc, 'set')) {
327
275
  var s = desc.set;
328
-
329
276
  if (!isCallable(s) && typeof s !== 'undefined') {
330
277
  throw new TypeError('bad set');
331
278
  }
332
-
333
279
  d.set = s;
334
280
  }
335
-
336
281
  if (('get' in d || 'set' in d) && ('value' in d || 'writable' in d)) {
337
282
  throw new TypeError('identity-confused descriptor');
338
283
  }
339
-
340
284
  return d;
341
285
  }
342
-
343
286
  if (_typeof(obj) !== 'object' || obj === null) throw new TypeError('bad obj');
344
287
  properties = Object(properties);
345
288
  var keys = Object.keys(properties);
346
289
  var descs = [];
347
-
348
290
  for (var i = 0; i < keys.length; i++) {
349
291
  descs.push([keys[i], convertToDescriptor(properties[keys[i]])]);
350
292
  }
351
-
352
293
  for (var i = 0; i < descs.length; i++) {
353
294
  Object.defineProperty(obj, descs[i][0], descs[i][1]);
354
295
  }
355
-
356
296
  return obj;
357
297
  };
358
298
  }
359
299
 
360
- var Component = function Component(props) {
300
+ var Component = /*#__PURE__*/_createClass(function Component(props) {
361
301
  _classCallCheck(this, Component);
362
-
363
302
  this.state = {};
364
303
  this.props = props || {};
365
- };
304
+ });
366
305
 
367
306
  /* eslint-disable */
368
-
369
307
  /**
370
308
  * lodash (Custom Build) <https://lodash.com/>
371
309
  * Build: `lodash modularize exports="npm" -o ./`
@@ -376,50 +314,51 @@ var Component = function Component(props) {
376
314
 
377
315
  /** Used as the `TypeError` message for "Functions" methods. */
378
316
  var FUNC_ERROR_TEXT = 'Expected a function';
379
- /** Used to stand-in for `undefined` hash values. */
380
317
 
318
+ /** Used to stand-in for `undefined` hash values. */
381
319
  var HASH_UNDEFINED = '__lodash_hash_undefined__';
382
- /** Used as references for various `Number` constants. */
383
320
 
321
+ /** Used as references for various `Number` constants. */
384
322
  var INFINITY = 1 / 0;
385
- /** `Object#toString` result references. */
386
323
 
324
+ /** `Object#toString` result references. */
387
325
  var funcTag = '[object Function]',
388
- genTag = '[object GeneratorFunction]',
389
- symbolTag = '[object Symbol]';
390
- /** Used to match property names within property paths. */
326
+ genTag = '[object GeneratorFunction]',
327
+ symbolTag = '[object Symbol]';
391
328
 
329
+ /** Used to match property names within property paths. */
392
330
  var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
393
- reIsPlainProp = /^\w*$/,
394
- reLeadingDot = /^\./,
395
- rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
331
+ reIsPlainProp = /^\w*$/,
332
+ reLeadingDot = /^\./,
333
+ rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
334
+
396
335
  /**
397
336
  * Used to match `RegExp`
398
337
  * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
399
338
  */
400
-
401
339
  var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
402
- /** Used to match backslashes in property paths. */
403
340
 
341
+ /** Used to match backslashes in property paths. */
404
342
  var reEscapeChar = /\\(\\)?/g;
405
- /** Used to detect host constructors (Safari). */
406
343
 
344
+ /** Used to detect host constructors (Safari). */
407
345
  var reIsHostCtor = /^\[object .+?Constructor\]$/;
408
- /** Detect free variable `global` from Node.js. */
409
346
 
347
+ /** Detect free variable `global` from Node.js. */
410
348
  var freeGlobal = (typeof global === "undefined" ? "undefined" : _typeof(global)) === 'object' && global && global.Object === Object && global;
411
- /** Detect free variable `self`. */
412
349
 
350
+ /** Detect free variable `self`. */
413
351
  var freeSelf = (typeof self === "undefined" ? "undefined" : _typeof(self)) === 'object' && self && self.Object === Object && self;
414
- /** Used as a reference to the global object. */
415
352
 
353
+ /** Used as a reference to the global object. */
416
354
  var root = freeGlobal || freeSelf || Function('return this')();
417
- /** Used as references for various `Number` constants. */
418
355
 
356
+ /** Used as references for various `Number` constants. */
419
357
  var MAX_SAFE_INTEGER = 9007199254740991;
420
- /** Used to detect unsigned integer values. */
421
358
 
359
+ /** Used to detect unsigned integer values. */
422
360
  var reIsUint = /^(?:0|[1-9]\d*)$/;
361
+
423
362
  /**
424
363
  * Gets the value at `key` of `object`.
425
364
  *
@@ -428,10 +367,10 @@ var reIsUint = /^(?:0|[1-9]\d*)$/;
428
367
  * @param {string} key The key of the property to get.
429
368
  * @returns {*} Returns the property value.
430
369
  */
431
-
432
370
  function getValue(object, key) {
433
371
  return object == null ? undefined : object[key];
434
372
  }
373
+
435
374
  /**
436
375
  * Checks if `value` is a host object in IE < 9.
437
376
  *
@@ -439,65 +378,60 @@ function getValue(object, key) {
439
378
  * @param {*} value The value to check.
440
379
  * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
441
380
  */
442
-
443
-
444
381
  function isHostObject(value) {
445
382
  // Many host objects are `Object` objects that can coerce to strings
446
383
  // despite having improperly defined `toString` methods.
447
384
  var result = false;
448
-
449
385
  if (value != null && typeof value.toString !== 'function') {
450
386
  try {
451
387
  result = !!(value + '');
452
388
  } catch (e) {}
453
389
  }
454
-
455
390
  return result;
456
391
  }
457
- /** Used for built-in method references. */
458
-
459
392
 
393
+ /** Used for built-in method references. */
460
394
  var arrayProto = Array.prototype,
461
- funcProto = Function.prototype,
462
- objectProto = Object.prototype;
463
- /** Used to detect overreaching core-js shims. */
395
+ funcProto = Function.prototype,
396
+ objectProto = Object.prototype;
464
397
 
398
+ /** Used to detect overreaching core-js shims. */
465
399
  var coreJsData = root['__core-js_shared__'];
466
- /** Used to detect methods masquerading as native. */
467
400
 
401
+ /** Used to detect methods masquerading as native. */
468
402
  var maskSrcKey = function () {
469
403
  var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
470
404
  return uid ? 'Symbol(src)_1.' + uid : '';
471
405
  }();
472
- /** Used to resolve the decompiled source of functions. */
473
-
474
406
 
407
+ /** Used to resolve the decompiled source of functions. */
475
408
  var funcToString = funcProto.toString;
476
- /** Used to check objects for own properties. */
477
409
 
410
+ /** Used to check objects for own properties. */
478
411
  var hasOwnProperty = objectProto.hasOwnProperty;
412
+
479
413
  /**
480
414
  * Used to resolve the
481
415
  * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
482
416
  * of values.
483
417
  */
484
-
485
418
  var objectToString = objectProto.toString;
486
- /** Used to detect if a method is native. */
487
419
 
420
+ /** Used to detect if a method is native. */
488
421
  var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
489
- /** Built-in value references. */
490
422
 
423
+ /** Built-in value references. */
491
424
  var _Symbol = root.Symbol,
492
- splice = arrayProto.splice;
493
- /* Built-in method references that are verified to be native. */
425
+ splice = arrayProto.splice;
494
426
 
427
+ /* Built-in method references that are verified to be native. */
495
428
  var Map$1 = getNative(root, 'Map'),
496
- nativeCreate = getNative(Object, 'create');
497
- /** Used to convert symbols to primitives and strings. */
429
+ nativeCreate = getNative(Object, 'create');
498
430
 
431
+ /** Used to convert symbols to primitives and strings. */
499
432
  var symbolProto = _Symbol ? _Symbol.prototype : undefined,
500
- symbolToString = symbolProto ? symbolProto.toString : undefined;
433
+ symbolToString = symbolProto ? symbolProto.toString : undefined;
434
+
501
435
  /**
502
436
  * Creates a hash object.
503
437
  *
@@ -505,17 +439,16 @@ var symbolProto = _Symbol ? _Symbol.prototype : undefined,
505
439
  * @constructor
506
440
  * @param {Array} [entries] The key-value pairs to cache.
507
441
  */
508
-
509
442
  function Hash(entries) {
510
443
  var index = -1,
511
- length = entries ? entries.length : 0;
444
+ length = entries ? entries.length : 0;
512
445
  this.clear();
513
-
514
446
  while (++index < length) {
515
447
  var entry = entries[index];
516
448
  this.set(entry[0], entry[1]);
517
449
  }
518
450
  }
451
+
519
452
  /**
520
453
  * Removes all key-value entries from the hash.
521
454
  *
@@ -523,11 +456,10 @@ function Hash(entries) {
523
456
  * @name clear
524
457
  * @memberOf Hash
525
458
  */
526
-
527
-
528
459
  function hashClear() {
529
460
  this.__data__ = nativeCreate ? nativeCreate(null) : {};
530
461
  }
462
+
531
463
  /**
532
464
  * Removes `key` and its value from the hash.
533
465
  *
@@ -538,11 +470,10 @@ function hashClear() {
538
470
  * @param {string} key The key of the value to remove.
539
471
  * @returns {boolean} Returns `true` if the entry was removed, else `false`.
540
472
  */
541
-
542
-
543
473
  function hashDelete(key) {
544
474
  return this.has(key) && delete this.__data__[key];
545
475
  }
476
+
546
477
  /**
547
478
  * Gets the hash value for `key`.
548
479
  *
@@ -552,18 +483,15 @@ function hashDelete(key) {
552
483
  * @param {string} key The key of the value to get.
553
484
  * @returns {*} Returns the entry value.
554
485
  */
555
-
556
-
557
486
  function hashGet(key) {
558
487
  var data = this.__data__;
559
-
560
488
  if (nativeCreate) {
561
489
  var result = data[key];
562
490
  return result === HASH_UNDEFINED ? undefined : result;
563
491
  }
564
-
565
492
  return hasOwnProperty.call(data, key) ? data[key] : undefined;
566
493
  }
494
+
567
495
  /**
568
496
  * Checks if a hash value for `key` exists.
569
497
  *
@@ -573,12 +501,11 @@ function hashGet(key) {
573
501
  * @param {string} key The key of the entry to check.
574
502
  * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
575
503
  */
576
-
577
-
578
504
  function hashHas(key) {
579
505
  var data = this.__data__;
580
506
  return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
581
507
  }
508
+
582
509
  /**
583
510
  * Sets the hash `key` to `value`.
584
511
  *
@@ -589,20 +516,19 @@ function hashHas(key) {
589
516
  * @param {*} value The value to set.
590
517
  * @returns {Object} Returns the hash instance.
591
518
  */
592
-
593
-
594
519
  function hashSet(key, value) {
595
520
  var data = this.__data__;
596
521
  data[key] = nativeCreate && value === undefined ? HASH_UNDEFINED : value;
597
522
  return this;
598
- } // Add methods to `Hash`.
599
-
523
+ }
600
524
 
525
+ // Add methods to `Hash`.
601
526
  Hash.prototype.clear = hashClear;
602
527
  Hash.prototype['delete'] = hashDelete;
603
528
  Hash.prototype.get = hashGet;
604
529
  Hash.prototype.has = hashHas;
605
530
  Hash.prototype.set = hashSet;
531
+
606
532
  /**
607
533
  * Creates an list cache object.
608
534
  *
@@ -610,17 +536,16 @@ Hash.prototype.set = hashSet;
610
536
  * @constructor
611
537
  * @param {Array} [entries] The key-value pairs to cache.
612
538
  */
613
-
614
539
  function ListCache(entries) {
615
540
  var index = -1,
616
- length = entries ? entries.length : 0;
541
+ length = entries ? entries.length : 0;
617
542
  this.clear();
618
-
619
543
  while (++index < length) {
620
544
  var entry = entries[index];
621
545
  this.set(entry[0], entry[1]);
622
546
  }
623
547
  }
548
+
624
549
  /**
625
550
  * Removes all key-value entries from the list cache.
626
551
  *
@@ -628,11 +553,10 @@ function ListCache(entries) {
628
553
  * @name clear
629
554
  * @memberOf ListCache
630
555
  */
631
-
632
-
633
556
  function listCacheClear() {
634
557
  this.__data__ = [];
635
558
  }
559
+
636
560
  /**
637
561
  * Removes `key` and its value from the list cache.
638
562
  *
@@ -642,26 +566,21 @@ function listCacheClear() {
642
566
  * @param {string} key The key of the value to remove.
643
567
  * @returns {boolean} Returns `true` if the entry was removed, else `false`.
644
568
  */
645
-
646
-
647
569
  function listCacheDelete(key) {
648
570
  var data = this.__data__,
649
- index = assocIndexOf(data, key);
650
-
571
+ index = assocIndexOf(data, key);
651
572
  if (index < 0) {
652
573
  return false;
653
574
  }
654
-
655
575
  var lastIndex = data.length - 1;
656
-
657
576
  if (index == lastIndex) {
658
577
  data.pop();
659
578
  } else {
660
579
  splice.call(data, index, 1);
661
580
  }
662
-
663
581
  return true;
664
582
  }
583
+
665
584
  /**
666
585
  * Gets the list cache value for `key`.
667
586
  *
@@ -671,13 +590,12 @@ function listCacheDelete(key) {
671
590
  * @param {string} key The key of the value to get.
672
591
  * @returns {*} Returns the entry value.
673
592
  */
674
-
675
-
676
593
  function listCacheGet(key) {
677
594
  var data = this.__data__,
678
- index = assocIndexOf(data, key);
595
+ index = assocIndexOf(data, key);
679
596
  return index < 0 ? undefined : data[index][1];
680
597
  }
598
+
681
599
  /**
682
600
  * Checks if a list cache value for `key` exists.
683
601
  *
@@ -687,11 +605,10 @@ function listCacheGet(key) {
687
605
  * @param {string} key The key of the entry to check.
688
606
  * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
689
607
  */
690
-
691
-
692
608
  function listCacheHas(key) {
693
609
  return assocIndexOf(this.__data__, key) > -1;
694
610
  }
611
+
695
612
  /**
696
613
  * Sets the list cache `key` to `value`.
697
614
  *
@@ -702,27 +619,24 @@ function listCacheHas(key) {
702
619
  * @param {*} value The value to set.
703
620
  * @returns {Object} Returns the list cache instance.
704
621
  */
705
-
706
-
707
622
  function listCacheSet(key, value) {
708
623
  var data = this.__data__,
709
- index = assocIndexOf(data, key);
710
-
624
+ index = assocIndexOf(data, key);
711
625
  if (index < 0) {
712
626
  data.push([key, value]);
713
627
  } else {
714
628
  data[index][1] = value;
715
629
  }
716
-
717
630
  return this;
718
- } // Add methods to `ListCache`.
719
-
631
+ }
720
632
 
633
+ // Add methods to `ListCache`.
721
634
  ListCache.prototype.clear = listCacheClear;
722
635
  ListCache.prototype['delete'] = listCacheDelete;
723
636
  ListCache.prototype.get = listCacheGet;
724
637
  ListCache.prototype.has = listCacheHas;
725
638
  ListCache.prototype.set = listCacheSet;
639
+
726
640
  /**
727
641
  * Creates a map cache object to store key-value pairs.
728
642
  *
@@ -730,17 +644,16 @@ ListCache.prototype.set = listCacheSet;
730
644
  * @constructor
731
645
  * @param {Array} [entries] The key-value pairs to cache.
732
646
  */
733
-
734
647
  function MapCache(entries) {
735
648
  var index = -1,
736
- length = entries ? entries.length : 0;
649
+ length = entries ? entries.length : 0;
737
650
  this.clear();
738
-
739
651
  while (++index < length) {
740
652
  var entry = entries[index];
741
653
  this.set(entry[0], entry[1]);
742
654
  }
743
655
  }
656
+
744
657
  /**
745
658
  * Removes all key-value entries from the map.
746
659
  *
@@ -748,8 +661,6 @@ function MapCache(entries) {
748
661
  * @name clear
749
662
  * @memberOf MapCache
750
663
  */
751
-
752
-
753
664
  function mapCacheClear() {
754
665
  this.__data__ = {
755
666
  hash: new Hash(),
@@ -757,6 +668,7 @@ function mapCacheClear() {
757
668
  string: new Hash()
758
669
  };
759
670
  }
671
+
760
672
  /**
761
673
  * Removes `key` and its value from the map.
762
674
  *
@@ -766,11 +678,10 @@ function mapCacheClear() {
766
678
  * @param {string} key The key of the value to remove.
767
679
  * @returns {boolean} Returns `true` if the entry was removed, else `false`.
768
680
  */
769
-
770
-
771
681
  function mapCacheDelete(key) {
772
682
  return getMapData(this, key)['delete'](key);
773
683
  }
684
+
774
685
  /**
775
686
  * Gets the map value for `key`.
776
687
  *
@@ -780,11 +691,10 @@ function mapCacheDelete(key) {
780
691
  * @param {string} key The key of the value to get.
781
692
  * @returns {*} Returns the entry value.
782
693
  */
783
-
784
-
785
694
  function mapCacheGet(key) {
786
695
  return getMapData(this, key).get(key);
787
696
  }
697
+
788
698
  /**
789
699
  * Checks if a map value for `key` exists.
790
700
  *
@@ -794,11 +704,10 @@ function mapCacheGet(key) {
794
704
  * @param {string} key The key of the entry to check.
795
705
  * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
796
706
  */
797
-
798
-
799
707
  function mapCacheHas(key) {
800
708
  return getMapData(this, key).has(key);
801
709
  }
710
+
802
711
  /**
803
712
  * Sets the map `key` to `value`.
804
713
  *
@@ -809,19 +718,18 @@ function mapCacheHas(key) {
809
718
  * @param {*} value The value to set.
810
719
  * @returns {Object} Returns the map cache instance.
811
720
  */
812
-
813
-
814
721
  function mapCacheSet(key, value) {
815
722
  getMapData(this, key).set(key, value);
816
723
  return this;
817
- } // Add methods to `MapCache`.
818
-
724
+ }
819
725
 
726
+ // Add methods to `MapCache`.
820
727
  MapCache.prototype.clear = mapCacheClear;
821
728
  MapCache.prototype['delete'] = mapCacheDelete;
822
729
  MapCache.prototype.get = mapCacheGet;
823
730
  MapCache.prototype.has = mapCacheHas;
824
731
  MapCache.prototype.set = mapCacheSet;
732
+
825
733
  /**
826
734
  * Gets the index at which the `key` is found in `array` of key-value pairs.
827
735
  *
@@ -830,18 +738,16 @@ MapCache.prototype.set = mapCacheSet;
830
738
  * @param {*} key The key to search for.
831
739
  * @returns {number} Returns the index of the matched value, else `-1`.
832
740
  */
833
-
834
741
  function assocIndexOf(array, key) {
835
742
  var length = array.length;
836
-
837
743
  while (length--) {
838
744
  if (eq(array[length][0], key)) {
839
745
  return length;
840
746
  }
841
747
  }
842
-
843
748
  return -1;
844
749
  }
750
+
845
751
  /**
846
752
  * The base implementation of `_.get` without support for default values.
847
753
  *
@@ -850,19 +756,16 @@ function assocIndexOf(array, key) {
850
756
  * @param {Array|string} path The path of the property to get.
851
757
  * @returns {*} Returns the resolved value.
852
758
  */
853
-
854
-
855
759
  function baseGet(object, path) {
856
760
  path = isKey(path, object) ? [path] : castPath(path);
857
761
  var index = 0,
858
- length = path.length;
859
-
762
+ length = path.length;
860
763
  while (object != null && index < length) {
861
764
  object = object[toKey(path[index++])];
862
765
  }
863
-
864
766
  return index && index == length ? object : undefined;
865
767
  }
768
+
866
769
  /**
867
770
  * The base implementation of `_.isNative` without bad shim checks.
868
771
  *
@@ -871,15 +774,14 @@ function baseGet(object, path) {
871
774
  * @returns {boolean} Returns `true` if `value` is a native function,
872
775
  * else `false`.
873
776
  */
874
-
875
777
  function baseIsNative(value) {
876
778
  if (!isObject(value) || isMasked(value)) {
877
779
  return false;
878
780
  }
879
-
880
781
  var pattern = isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor;
881
782
  return pattern.test(toSource(value));
882
783
  }
784
+
883
785
  /**
884
786
  * The base implementation of `_.toString` which doesn't convert nullish
885
787
  * values to empty strings.
@@ -888,21 +790,18 @@ function baseIsNative(value) {
888
790
  * @param {*} value The value to process.
889
791
  * @returns {string} Returns the string.
890
792
  */
891
-
892
-
893
793
  function baseToString(value) {
894
794
  // Exit early for strings to avoid a performance hit in some environments.
895
795
  if (typeof value === 'string') {
896
796
  return value;
897
797
  }
898
-
899
798
  if (isSymbol(value)) {
900
799
  return symbolToString ? symbolToString.call(value) : '';
901
800
  }
902
-
903
801
  var result = value + '';
904
802
  return result == '0' && 1 / value == -INFINITY ? '-0' : result;
905
803
  }
804
+
906
805
  /**
907
806
  * Casts `value` to a path array if it's not one.
908
807
  *
@@ -910,11 +809,10 @@ function baseToString(value) {
910
809
  * @param {*} value The value to inspect.
911
810
  * @returns {Array} Returns the cast property path array.
912
811
  */
913
-
914
-
915
812
  function castPath(value) {
916
813
  return isArray(value) ? value : stringToPath(value);
917
814
  }
815
+
918
816
  /**
919
817
  * Gets the data for `map`.
920
818
  *
@@ -923,12 +821,11 @@ function castPath(value) {
923
821
  * @param {string} key The reference key.
924
822
  * @returns {*} Returns the map data.
925
823
  */
926
-
927
-
928
824
  function getMapData(map, key) {
929
825
  var data = map.__data__;
930
826
  return isKeyable(key) ? data[typeof key === 'string' ? 'string' : 'hash'] : data.map;
931
827
  }
828
+
932
829
  /**
933
830
  * Gets the native function at `key` of `object`.
934
831
  *
@@ -937,12 +834,11 @@ function getMapData(map, key) {
937
834
  * @param {string} key The key of the method to get.
938
835
  * @returns {*} Returns the function if it's native, else `undefined`.
939
836
  */
940
-
941
-
942
837
  function getNative(object, key) {
943
838
  var value = getValue(object, key);
944
839
  return baseIsNative(value) ? value : undefined;
945
840
  }
841
+
946
842
  /**
947
843
  * Checks if `value` is a property name and not a property path.
948
844
  *
@@ -951,21 +847,17 @@ function getNative(object, key) {
951
847
  * @param {Object} [object] The object to query keys on.
952
848
  * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
953
849
  */
954
-
955
-
956
850
  function isKey(value, object) {
957
851
  if (isArray(value)) {
958
852
  return false;
959
853
  }
960
-
961
854
  var type = _typeof(value);
962
-
963
855
  if (type == 'number' || type == 'symbol' || type == 'boolean' || value == null || isSymbol(value)) {
964
856
  return true;
965
857
  }
966
-
967
858
  return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
968
859
  }
860
+
969
861
  /**
970
862
  * Checks if `value` is suitable for use as unique object key.
971
863
  *
@@ -973,13 +865,11 @@ function isKey(value, object) {
973
865
  * @param {*} value The value to check.
974
866
  * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
975
867
  */
976
-
977
-
978
868
  function isKeyable(value) {
979
869
  var type = _typeof(value);
980
-
981
870
  return type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean' ? value !== '__proto__' : value === null;
982
871
  }
872
+
983
873
  /**
984
874
  * Checks if `func` has its source masked.
985
875
  *
@@ -987,11 +877,10 @@ function isKeyable(value) {
987
877
  * @param {Function} func The function to check.
988
878
  * @returns {boolean} Returns `true` if `func` is masked, else `false`.
989
879
  */
990
-
991
-
992
880
  function isMasked(func) {
993
881
  return !!maskSrcKey && maskSrcKey in func;
994
882
  }
883
+
995
884
  /**
996
885
  * Converts `string` to a property path array.
997
886
  *
@@ -999,21 +888,18 @@ function isMasked(func) {
999
888
  * @param {string} string The string to convert.
1000
889
  * @returns {Array} Returns the property path array.
1001
890
  */
1002
-
1003
-
1004
891
  var stringToPath = memoize(function (string) {
1005
892
  string = toString(string);
1006
893
  var result = [];
1007
-
1008
894
  if (reLeadingDot.test(string)) {
1009
895
  result.push('');
1010
896
  }
1011
-
1012
897
  string.replace(rePropName, function (match, number, quote, string) {
1013
898
  result.push(quote ? string.replace(reEscapeChar, '$1') : number || match);
1014
899
  });
1015
900
  return result;
1016
901
  });
902
+
1017
903
  /**
1018
904
  * Converts `value` to a string key if it's not a string or symbol.
1019
905
  *
@@ -1021,15 +907,14 @@ var stringToPath = memoize(function (string) {
1021
907
  * @param {*} value The value to inspect.
1022
908
  * @returns {string|symbol} Returns the key.
1023
909
  */
1024
-
1025
910
  function toKey(value) {
1026
911
  if (typeof value === 'string' || isSymbol(value)) {
1027
912
  return value;
1028
913
  }
1029
-
1030
914
  var result = value + '';
1031
915
  return result == '0' && 1 / value == -INFINITY ? '-0' : result;
1032
916
  }
917
+
1033
918
  /**
1034
919
  * Converts `func` to its source code.
1035
920
  *
@@ -1037,21 +922,18 @@ function toKey(value) {
1037
922
  * @param {Function} func The function to process.
1038
923
  * @returns {string} Returns the source code.
1039
924
  */
1040
-
1041
-
1042
925
  function toSource(func) {
1043
926
  if (func != null) {
1044
927
  try {
1045
928
  return funcToString.call(func);
1046
929
  } catch (e) {}
1047
-
1048
930
  try {
1049
931
  return func + '';
1050
932
  } catch (e) {}
1051
933
  }
1052
-
1053
934
  return '';
1054
935
  }
936
+
1055
937
  /**
1056
938
  * Creates a function that memoizes the result of `func`. If `resolver` is
1057
939
  * provided, it determines the cache key for storing the result based on the
@@ -1096,33 +978,28 @@ function toSource(func) {
1096
978
  * // Replace `_.memoize.Cache`.
1097
979
  * _.memoize.Cache = WeakMap;
1098
980
  */
1099
-
1100
-
1101
981
  function memoize(func, resolver) {
1102
982
  if (typeof func !== 'function' || resolver && typeof resolver !== 'function') {
1103
983
  throw new TypeError(FUNC_ERROR_TEXT);
1104
984
  }
1105
-
1106
985
  var memoized = function memoized() {
1107
986
  var args = arguments,
1108
- key = resolver ? resolver.apply(this, args) : args[0],
1109
- cache = memoized.cache;
1110
-
987
+ key = resolver ? resolver.apply(this, args) : args[0],
988
+ cache = memoized.cache;
1111
989
  if (cache.has(key)) {
1112
990
  return cache.get(key);
1113
991
  }
1114
-
1115
992
  var result = func.apply(this, args);
1116
993
  memoized.cache = cache.set(key, result);
1117
994
  return result;
1118
995
  };
1119
-
1120
996
  memoized.cache = new (memoize.Cache || MapCache)();
1121
997
  return memoized;
1122
- } // Assign cache to `_.memoize`.
1123
-
998
+ }
1124
999
 
1000
+ // Assign cache to `_.memoize`.
1125
1001
  memoize.Cache = MapCache;
1002
+
1126
1003
  /**
1127
1004
  * Performs a
1128
1005
  * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
@@ -1155,10 +1032,10 @@ memoize.Cache = MapCache;
1155
1032
  * _.eq(NaN, NaN);
1156
1033
  * // => true
1157
1034
  */
1158
-
1159
1035
  function eq(value, other) {
1160
1036
  return value === other || value !== value && other !== other;
1161
1037
  }
1038
+
1162
1039
  /**
1163
1040
  * Checks if `value` is classified as an `Array` object.
1164
1041
  *
@@ -1182,9 +1059,8 @@ function eq(value, other) {
1182
1059
  * _.isArray(_.noop);
1183
1060
  * // => false
1184
1061
  */
1185
-
1186
-
1187
1062
  var isArray = Array.isArray;
1063
+
1188
1064
  /**
1189
1065
  * Checks if `value` is classified as a `Function` object.
1190
1066
  *
@@ -1202,13 +1078,13 @@ var isArray = Array.isArray;
1202
1078
  * _.isFunction(/abc/);
1203
1079
  * // => false
1204
1080
  */
1205
-
1206
1081
  function isFunction(value) {
1207
1082
  // The use of `Object#toString` avoids issues with the `typeof` operator
1208
1083
  // in Safari 8-9 which returns 'object' for typed array and other constructors.
1209
1084
  var tag = isObject(value) ? objectToString.call(value) : '';
1210
1085
  return tag == funcTag || tag == genTag;
1211
1086
  }
1087
+
1212
1088
  /**
1213
1089
  * Checks if `value` is the
1214
1090
  * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
@@ -1234,13 +1110,11 @@ function isFunction(value) {
1234
1110
  * _.isObject(null);
1235
1111
  * // => false
1236
1112
  */
1237
-
1238
-
1239
1113
  function isObject(value) {
1240
1114
  var type = _typeof(value);
1241
-
1242
1115
  return !!value && (type == 'object' || type == 'function');
1243
1116
  }
1117
+
1244
1118
  /**
1245
1119
  * Checks if `value` is object-like. A value is object-like if it's not `null`
1246
1120
  * and has a `typeof` result of "object".
@@ -1265,11 +1139,10 @@ function isObject(value) {
1265
1139
  * _.isObjectLike(null);
1266
1140
  * // => false
1267
1141
  */
1268
-
1269
-
1270
1142
  function isObjectLike(value) {
1271
1143
  return !!value && _typeof(value) === 'object';
1272
1144
  }
1145
+
1273
1146
  /**
1274
1147
  * Checks if `value` is classified as a `Symbol` primitive or object.
1275
1148
  *
@@ -1287,11 +1160,10 @@ function isObjectLike(value) {
1287
1160
  * _.isSymbol('abc');
1288
1161
  * // => false
1289
1162
  */
1290
-
1291
-
1292
1163
  function isSymbol(value) {
1293
1164
  return _typeof(value) === 'symbol' || isObjectLike(value) && objectToString.call(value) == symbolTag;
1294
1165
  }
1166
+
1295
1167
  /**
1296
1168
  * Converts `value` to a string. An empty string is returned for `null`
1297
1169
  * and `undefined` values. The sign of `-0` is preserved.
@@ -1313,11 +1185,10 @@ function isSymbol(value) {
1313
1185
  * _.toString([1, 2, 3]);
1314
1186
  * // => '1,2,3'
1315
1187
  */
1316
-
1317
-
1318
1188
  function toString(value) {
1319
1189
  return value == null ? '' : baseToString(value);
1320
1190
  }
1191
+
1321
1192
  /**
1322
1193
  * Checks if `value` is a valid array-like index.
1323
1194
  *
@@ -1326,14 +1197,12 @@ function toString(value) {
1326
1197
  * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
1327
1198
  * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
1328
1199
  */
1329
-
1330
-
1331
1200
  function isIndex(value, length) {
1332
1201
  var type = _typeof(value);
1333
-
1334
1202
  length = length == null ? MAX_SAFE_INTEGER : length;
1335
1203
  return !!length && (type == 'number' || type != 'symbol' && reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
1336
1204
  }
1205
+
1337
1206
  /**
1338
1207
  * The base implementation of `assignValue` and `assignMergeValue` without
1339
1208
  * value checks.
@@ -1343,8 +1212,6 @@ function isIndex(value, length) {
1343
1212
  * @param {string} key The key of the property to assign.
1344
1213
  * @param {*} value The value to assign.
1345
1214
  */
1346
-
1347
-
1348
1215
  function baseAssignValue(object, key, value) {
1349
1216
  if (key == '__proto__') {
1350
1217
  Object.defineProperty(object, key, {
@@ -1357,10 +1224,10 @@ function baseAssignValue(object, key, value) {
1357
1224
  object[key] = value;
1358
1225
  }
1359
1226
  }
1360
- /** Used to check objects for own properties. */
1361
-
1362
1227
 
1228
+ /** Used to check objects for own properties. */
1363
1229
  var hasOwnProperty = Object.prototype.hasOwnProperty;
1230
+
1364
1231
  /**
1365
1232
  * Assigns `value` to `key` of `object` if the existing value is not equivalent
1366
1233
  * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
@@ -1371,14 +1238,13 @@ var hasOwnProperty = Object.prototype.hasOwnProperty;
1371
1238
  * @param {string} key The key of the property to assign.
1372
1239
  * @param {*} value The value to assign.
1373
1240
  */
1374
-
1375
1241
  function assignValue(object, key, value) {
1376
1242
  var objValue = object[key];
1377
-
1378
1243
  if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === undefined && !(key in object)) {
1379
1244
  baseAssignValue(object, key, value);
1380
1245
  }
1381
1246
  }
1247
+
1382
1248
  /**
1383
1249
  * The base implementation of `set`.
1384
1250
  *
@@ -1389,36 +1255,28 @@ function assignValue(object, key, value) {
1389
1255
  * @param {Function} [customizer] The function to customize path creation.
1390
1256
  * @returns {Object} Returns `object`.
1391
1257
  */
1392
-
1393
-
1394
1258
  function baseSet(object, path, value, customizer) {
1395
1259
  if (!isObject(object)) {
1396
1260
  return object;
1397
1261
  }
1398
-
1399
1262
  path = castPath(path, object);
1400
1263
  var length = path.length;
1401
1264
  var lastIndex = length - 1;
1402
1265
  var index = -1;
1403
1266
  var nested = object;
1404
-
1405
1267
  while (nested != null && ++index < length) {
1406
1268
  var key = toKey(path[index]);
1407
1269
  var newValue = value;
1408
-
1409
1270
  if (index != lastIndex) {
1410
1271
  var objValue = nested[key];
1411
1272
  newValue = customizer ? customizer(objValue, key, nested) : undefined;
1412
-
1413
1273
  if (newValue === undefined) {
1414
1274
  newValue = isObject(objValue) ? objValue : isIndex(path[index + 1]) ? [] : {};
1415
1275
  }
1416
1276
  }
1417
-
1418
1277
  assignValue(nested, key, newValue);
1419
1278
  nested = nested[key];
1420
1279
  }
1421
-
1422
1280
  return object;
1423
1281
  }
1424
1282
 
@@ -1447,7 +1305,6 @@ function baseSet(object, path, value, customizer) {
1447
1305
  * _.get(object, 'a.b.c', 'default');
1448
1306
  * // => 'default'
1449
1307
  */
1450
-
1451
1308
  function get(object, path, defaultValue) {
1452
1309
  var result = object == null ? undefined : baseGet(object, path);
1453
1310
  return result === undefined ? defaultValue : result;
@@ -1480,42 +1337,33 @@ function get(object, path, defaultValue) {
1480
1337
  * console.log(object.x[0].y.z)
1481
1338
  * // => 5
1482
1339
  */
1483
-
1484
1340
  function set$1(object, path, value) {
1485
1341
  return object == null ? object : baseSet(object, path, value);
1486
1342
  }
1487
1343
 
1488
1344
  var upperCasePattern = /([A-Z])/g;
1489
-
1490
1345
  function dashify(str) {
1491
1346
  return str.replace(upperCasePattern, dashLower);
1492
1347
  }
1493
-
1494
1348
  function dashLower(c) {
1495
1349
  return '-' + c.toLowerCase();
1496
1350
  }
1497
-
1498
1351
  function isObject$1(val) {
1499
1352
  return val != null && _typeof(val) === 'object' && Array.isArray(val) === false;
1500
1353
  }
1501
-
1502
1354
  function inlineStyle(obj) {
1503
1355
  if (obj == null) {
1504
1356
  return '';
1505
1357
  }
1506
-
1507
1358
  if (typeof obj === 'string') {
1508
1359
  return obj;
1509
1360
  }
1510
-
1511
1361
  if (obj === null || obj === undefined) {
1512
1362
  return '';
1513
1363
  }
1514
-
1515
1364
  if (!isObject$1(obj)) {
1516
1365
  throw new TypeError('style 只能是一个对象或字符串。');
1517
1366
  }
1518
-
1519
1367
  return Object.keys(obj).map(function (key) {
1520
1368
  return dashify(key).concat(':').concat(obj[key]);
1521
1369
  }).join(';');
@@ -1532,99 +1380,82 @@ var ENV_TYPE = {
1532
1380
  QQ: 'QQ',
1533
1381
  JD: 'JD'
1534
1382
  };
1535
- var _env = null; // 一个taro项目肯定运行同样的环境
1383
+ var _env = null;
1536
1384
 
1385
+ // 一个taro项目肯定运行同样的环境
1537
1386
  function getEnv() {
1538
1387
  if (_env) return _env;
1539
-
1540
1388
  if (typeof jd !== 'undefined' && jd.getSystemInfo) {
1541
1389
  _env = ENV_TYPE.JD;
1542
1390
  return ENV_TYPE.JD;
1543
1391
  }
1544
-
1545
1392
  if (typeof qq !== 'undefined' && qq.getSystemInfo) {
1546
1393
  _env = ENV_TYPE.QQ;
1547
1394
  return ENV_TYPE.QQ;
1548
1395
  }
1549
-
1550
1396
  if (typeof tt !== 'undefined' && tt.getSystemInfo) {
1551
1397
  _env = ENV_TYPE.TT;
1552
1398
  return ENV_TYPE.TT;
1553
1399
  }
1554
-
1555
1400
  if (typeof wx !== 'undefined' && wx.getSystemInfo) {
1556
1401
  _env = ENV_TYPE.WEAPP;
1557
1402
  return ENV_TYPE.WEAPP;
1558
1403
  }
1559
-
1560
1404
  if (typeof swan !== 'undefined' && swan.getSystemInfo) {
1561
1405
  _env = ENV_TYPE.SWAN;
1562
1406
  return ENV_TYPE.SWAN;
1563
1407
  }
1564
-
1565
1408
  if (typeof my !== 'undefined' && my.getSystemInfo) {
1566
1409
  _env = ENV_TYPE.ALIPAY;
1567
1410
  return ENV_TYPE.ALIPAY;
1568
1411
  }
1569
-
1570
1412
  if (typeof global !== 'undefined' && global.__fbGenNativeModule) {
1571
1413
  _env = ENV_TYPE.RN;
1572
1414
  return ENV_TYPE.RN;
1573
1415
  }
1574
-
1575
1416
  if (typeof global !== 'undefined' && global.getManifestField) {
1576
1417
  _env = ENV_TYPE.QUICKAPP;
1577
1418
  return ENV_TYPE.QUICKAPP;
1578
1419
  }
1579
-
1580
1420
  if (typeof window !== 'undefined') {
1581
1421
  _env = ENV_TYPE.WEB;
1582
1422
  return ENV_TYPE.WEB;
1583
1423
  }
1584
-
1585
1424
  return 'Unknown environment';
1586
1425
  }
1587
1426
 
1588
1427
  function isObject$2(arg) {
1589
1428
  return arg === Object(arg) && typeof arg !== 'function';
1590
1429
  }
1591
-
1592
1430
  var env = null;
1593
1431
  function getOriginal(item) {
1594
1432
  if (env === null) {
1595
1433
  env = getEnv();
1596
1434
  }
1597
-
1598
1435
  if (isObject$2(item)) {
1599
1436
  return item[env === ENV_TYPE.SWAN ? 'privateOriginal' : '$original'] || item;
1600
1437
  }
1601
-
1602
1438
  return item;
1603
1439
  }
1604
1440
 
1605
1441
  var Events = /*#__PURE__*/function () {
1606
1442
  function Events(opts) {
1607
1443
  _classCallCheck(this, Events);
1608
-
1609
1444
  if (typeof opts !== 'undefined' && opts.callbacks) {
1610
1445
  this.callbacks = opts.callbacks;
1611
1446
  } else {
1612
1447
  this.callbacks = {};
1613
1448
  }
1614
1449
  }
1615
-
1616
1450
  _createClass(Events, [{
1617
1451
  key: "on",
1618
1452
  value: function on(events, callback, context) {
1619
1453
  var calls, event, node, tail, list;
1620
-
1621
1454
  if (!callback) {
1622
1455
  return this;
1623
1456
  }
1624
-
1625
1457
  events = events.split(Events.eventSplitter);
1626
1458
  calls = this.callbacks;
1627
-
1628
1459
  while (event = events.shift()) {
1629
1460
  list = calls[event];
1630
1461
  node = list ? list.tail : {};
@@ -1636,24 +1467,19 @@ var Events = /*#__PURE__*/function () {
1636
1467
  next: list ? list.next : node
1637
1468
  };
1638
1469
  }
1639
-
1640
1470
  return this;
1641
1471
  }
1642
1472
  }, {
1643
1473
  key: "once",
1644
1474
  value: function once(events, callback, context) {
1645
1475
  var _this = this;
1646
-
1647
1476
  var wrapper = function wrapper() {
1648
1477
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1649
1478
  args[_key] = arguments[_key];
1650
1479
  }
1651
-
1652
1480
  callback.apply(_this, args);
1653
-
1654
1481
  _this.off(events, wrapper, context);
1655
1482
  };
1656
-
1657
1483
  this.on(events, wrapper, context);
1658
1484
  return this;
1659
1485
  }
@@ -1661,69 +1487,53 @@ var Events = /*#__PURE__*/function () {
1661
1487
  key: "off",
1662
1488
  value: function off(events, callback, context) {
1663
1489
  var event, calls, node, tail, cb, ctx;
1664
-
1665
1490
  if (!(calls = this.callbacks)) {
1666
1491
  return this;
1667
1492
  }
1668
-
1669
1493
  if (!(events || callback || context)) {
1670
1494
  delete this.callbacks;
1671
1495
  return this;
1672
1496
  }
1673
-
1674
1497
  events = events ? events.split(Events.eventSplitter) : Object.keys(calls);
1675
-
1676
1498
  while (event = events.shift()) {
1677
1499
  node = calls[event];
1678
1500
  delete calls[event];
1679
-
1680
1501
  if (!node || !(callback || context)) {
1681
1502
  continue;
1682
1503
  }
1683
-
1684
1504
  tail = node.tail;
1685
-
1686
1505
  while ((node = node.next) !== tail) {
1687
1506
  cb = node.callback;
1688
1507
  ctx = node.context;
1689
-
1690
1508
  if (callback && cb !== callback || context && ctx !== context) {
1691
1509
  this.on(event, cb, ctx);
1692
1510
  }
1693
1511
  }
1694
1512
  }
1695
-
1696
1513
  return this;
1697
1514
  }
1698
1515
  }, {
1699
1516
  key: "trigger",
1700
1517
  value: function trigger(events) {
1701
1518
  var event, node, calls, tail, rest;
1702
-
1703
1519
  if (!(calls = this.callbacks)) {
1704
1520
  return this;
1705
1521
  }
1706
-
1707
1522
  events = events.split(Events.eventSplitter);
1708
1523
  rest = [].slice.call(arguments, 1);
1709
-
1710
1524
  while (event = events.shift()) {
1711
1525
  if (node = calls[event]) {
1712
1526
  tail = node.tail;
1713
-
1714
1527
  while ((node = node.next) !== tail) {
1715
1528
  node.callback.apply(node.context || this, rest);
1716
1529
  }
1717
1530
  }
1718
1531
  }
1719
-
1720
1532
  return this;
1721
1533
  }
1722
1534
  }]);
1723
-
1724
1535
  return Events;
1725
1536
  }();
1726
-
1727
1537
  Events.eventSplitter = /\s+/;
1728
1538
 
1729
1539
  function render() {}
@@ -1733,6 +1543,7 @@ function createRef() {
1733
1543
  current: null
1734
1544
  };
1735
1545
  }
1546
+
1736
1547
  /**
1737
1548
  * 赋值 ref
1738
1549
  * @param {Object} ref ref 对象/ref 函数/ref 字符串
@@ -1740,11 +1551,9 @@ function createRef() {
1740
1551
  * @param {Object} component 组件实例
1741
1552
  * @param {Object} refs 字符串 ref 搜集器
1742
1553
  */
1743
-
1744
1554
  function commitAttachRef(ref, target, component, refs) {
1745
1555
  var isInit = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
1746
1556
  if (isInit && !target) return;
1747
-
1748
1557
  if ('refName' in ref && ref['refName']) {
1749
1558
  refs[ref.refName] = target;
1750
1559
  } else if ('fn' in ref && typeof ref['fn'] === 'function') {
@@ -1761,7 +1570,6 @@ function detachAllRef(component) {
1761
1570
  } else if (ref['fn'] && _typeof(ref['fn']) === 'object' && 'current' in ref['fn']) {
1762
1571
  ref['fn'].current = null;
1763
1572
  }
1764
-
1765
1573
  if ('target' in ref) delete ref['target'];
1766
1574
  });
1767
1575
  component.refs = {};
@@ -1769,29 +1577,22 @@ function detachAllRef(component) {
1769
1577
  }
1770
1578
  var RefsArray = /*#__PURE__*/function (_Array) {
1771
1579
  _inherits(RefsArray, _Array);
1772
-
1773
1580
  var _super = _createSuper(RefsArray);
1774
-
1775
1581
  /**
1776
1582
  * @param {Array} initList
1777
1583
  */
1778
1584
  function RefsArray() {
1779
1585
  var _this;
1780
-
1781
1586
  var initList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
1782
-
1783
1587
  _classCallCheck(this, RefsArray);
1784
-
1785
1588
  _this = _super.call.apply(_super, [this].concat(_toConsumableArray(initList)));
1786
1589
  _this.inited = false;
1787
1590
  return _this;
1788
1591
  }
1789
-
1790
1592
  _createClass(RefsArray, [{
1791
1593
  key: "pushRefs",
1792
1594
  value: function pushRefs($$refs) {
1793
1595
  var _this2 = this;
1794
-
1795
1596
  if (this.inited) return;
1796
1597
  $$refs.forEach(function (ref) {
1797
1598
  return _this2.pushRef(ref);
@@ -1807,20 +1608,16 @@ var RefsArray = /*#__PURE__*/function (_Array) {
1807
1608
  !isExist && this.push(ref);
1808
1609
  }
1809
1610
  }]);
1810
-
1811
1611
  return RefsArray;
1812
1612
  }( /*#__PURE__*/_wrapNativeSuper(Array));
1813
1613
  function handleLoopRef(getElementById) {
1814
1614
  return function (component, id, type, handler) {
1815
1615
  if (!component) return null;
1816
1616
  var dom = getElementById(component, id, type);
1817
-
1818
1617
  var handlerType = _typeof(handler);
1819
-
1820
1618
  if (handlerType !== 'function' && handlerType !== 'object') {
1821
1619
  return console.warn("\u5FAA\u73AF Ref \u53EA\u652F\u6301\u51FD\u6570\u6216 createRef()\uFF0C\u5F53\u524D\u7C7B\u578B\u4E3A\uFF1A".concat(handlerType));
1822
1620
  }
1823
-
1824
1621
  if (handlerType === 'object') {
1825
1622
  handler.current = dom;
1826
1623
  } else if (handlerType === 'function') {
@@ -1833,27 +1630,20 @@ var Chain = /*#__PURE__*/function () {
1833
1630
  function Chain(requestParams) {
1834
1631
  var interceptors = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
1835
1632
  var index = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
1836
-
1837
1633
  _classCallCheck(this, Chain);
1838
-
1839
1634
  this.index = index;
1840
1635
  this.requestParams = requestParams;
1841
1636
  this.interceptors = interceptors;
1842
1637
  }
1843
-
1844
1638
  _createClass(Chain, [{
1845
1639
  key: "proceed",
1846
1640
  value: function proceed(requestParams) {
1847
1641
  this.requestParams = requestParams;
1848
-
1849
1642
  if (this.index >= this.interceptors.length) {
1850
1643
  throw new Error('chain 参数错误, 请勿直接修改 request.chain');
1851
1644
  }
1852
-
1853
1645
  var nextInterceptor = this._getNextInterceptor();
1854
-
1855
1646
  var nextChain = this._getNextChain();
1856
-
1857
1647
  var p = nextInterceptor(nextChain);
1858
1648
  var res = p["catch"](function (err) {
1859
1649
  return Promise.reject(err);
@@ -1874,23 +1664,19 @@ var Chain = /*#__PURE__*/function () {
1874
1664
  return new Chain(this.requestParams, this.interceptors, this.index + 1);
1875
1665
  }
1876
1666
  }]);
1877
-
1878
1667
  return Chain;
1879
1668
  }();
1880
1669
 
1881
1670
  var Link = /*#__PURE__*/function () {
1882
1671
  function Link(interceptor) {
1883
1672
  _classCallCheck(this, Link);
1884
-
1885
1673
  this.taroInterceptor = interceptor;
1886
1674
  this.chain = new Chain();
1887
1675
  }
1888
-
1889
1676
  _createClass(Link, [{
1890
1677
  key: "request",
1891
1678
  value: function request(requestParams) {
1892
1679
  var _this = this;
1893
-
1894
1680
  this.chain.interceptors = this.chain.interceptors.filter(function (interceptor) {
1895
1681
  return interceptor !== _this.taroInterceptor;
1896
1682
  });
@@ -1908,7 +1694,6 @@ var Link = /*#__PURE__*/function () {
1908
1694
  this.chain = new Chain();
1909
1695
  }
1910
1696
  }]);
1911
-
1912
1697
  return Link;
1913
1698
  }();
1914
1699
 
@@ -1936,8 +1721,8 @@ function timeoutInterceptor(chain) {
1936
1721
  function logInterceptor(chain) {
1937
1722
  var requestParams = chain.requestParams;
1938
1723
  var method = requestParams.method,
1939
- data = requestParams.data,
1940
- url = requestParams.url;
1724
+ data = requestParams.data,
1725
+ url = requestParams.url;
1941
1726
  console.log("http ".concat(method || 'GET', " --> ").concat(url, " data: "), data);
1942
1727
  var p = chain.proceed(requestParams);
1943
1728
  var res = p.then(function (res) {
@@ -2253,31 +2038,29 @@ var otherApis = {
2253
2038
  navigateBackSmartProgram: true,
2254
2039
  preloadSubPackage: true
2255
2040
  };
2256
-
2257
2041
  function initPxTransform(config) {
2258
2042
  var _config$designWidth = config.designWidth,
2259
- designWidth = _config$designWidth === void 0 ? 700 : _config$designWidth,
2260
- _config$deviceRatio = config.deviceRatio,
2261
- deviceRatio = _config$deviceRatio === void 0 ? {
2262
- '640': 2.34 / 2,
2263
- '750': 1,
2264
- '828': 1.81 / 2
2265
- } : _config$deviceRatio;
2043
+ designWidth = _config$designWidth === void 0 ? 700 : _config$designWidth,
2044
+ _config$deviceRatio = config.deviceRatio,
2045
+ deviceRatio = _config$deviceRatio === void 0 ? {
2046
+ '640': 2.34 / 2,
2047
+ '750': 1,
2048
+ '828': 1.81 / 2
2049
+ } : _config$deviceRatio;
2266
2050
  this.config = this.config || {};
2267
2051
  this.config.designWidth = designWidth;
2268
2052
  this.config.deviceRatio = deviceRatio;
2269
2053
  }
2270
2054
 
2055
+ // Object.is polyfill
2271
2056
  // https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/is
2272
-
2273
2057
  function objectIs(x, y) {
2274
2058
  if (x === y) {
2275
2059
  // Steps 1-5, 7-10
2276
2060
  // Steps 6.b-6.e: +0 != -0
2277
2061
  return x !== 0 || 1 / x === 1 / y;
2278
- } // eslint-disable-next-line no-self-compare
2279
-
2280
-
2062
+ }
2063
+ // eslint-disable-next-line no-self-compare
2281
2064
  return x !== x && y !== y;
2282
2065
  }
2283
2066
  function isFunction$1(arg) {
@@ -2302,7 +2085,6 @@ function setIsUsingDiff(flag) {
2302
2085
  }
2303
2086
 
2304
2087
  var Current;
2305
-
2306
2088
  if (process.env.TARO_ENV === 'alipay') {
2307
2089
  if (!my.Current) {
2308
2090
  my.Current = {
@@ -2310,7 +2092,6 @@ if (process.env.TARO_ENV === 'alipay') {
2310
2092
  index: 0
2311
2093
  };
2312
2094
  }
2313
-
2314
2095
  Current = my.Current;
2315
2096
  } else {
2316
2097
  Current = {
@@ -2319,30 +2100,24 @@ if (process.env.TARO_ENV === 'alipay') {
2319
2100
  };
2320
2101
  }
2321
2102
 
2322
- function forceUpdateCallback() {//
2103
+ function forceUpdateCallback() {
2104
+ //
2323
2105
  }
2324
-
2325
2106
  function getHooks(index) {
2326
2107
  if (Current.current === null) {
2327
2108
  throw new Error("invalid hooks call: hooks can only be called in a stateless component.");
2328
2109
  }
2329
-
2330
2110
  var hooks = Current.current.hooks;
2331
-
2332
2111
  if (index >= hooks.length) {
2333
2112
  hooks.push({});
2334
2113
  }
2335
-
2336
2114
  return hooks[index];
2337
2115
  }
2338
-
2339
2116
  function useState(initialState) {
2340
2117
  if (isFunction$1(initialState)) {
2341
2118
  initialState = initialState();
2342
2119
  }
2343
-
2344
2120
  var hook = getHooks(Current.index++);
2345
-
2346
2121
  if (!hook.state) {
2347
2122
  hook.component = Current.current;
2348
2123
  hook.state = [initialState, function (action) {
@@ -2353,20 +2128,16 @@ function useState(initialState) {
2353
2128
  hook.component.setState({}, forceUpdateCallback);
2354
2129
  }];
2355
2130
  }
2356
-
2357
2131
  return hook.state;
2358
2132
  }
2359
-
2360
2133
  function usePageLifecycle(callback, lifecycle) {
2361
2134
  var hook = getHooks(Current.index++);
2362
-
2363
2135
  if (!hook.marked) {
2364
2136
  hook.marked = true;
2365
2137
  hook.component = Current.current;
2366
2138
  hook.callback = callback;
2367
2139
  var component = hook.component;
2368
2140
  var originalLifecycle = component[lifecycle];
2369
-
2370
2141
  hook.component[lifecycle] = function () {
2371
2142
  var callback = hook.callback;
2372
2143
  originalLifecycle && originalLifecycle.call.apply(originalLifecycle, [component].concat(Array.prototype.slice.call(arguments)));
@@ -2376,7 +2147,6 @@ function usePageLifecycle(callback, lifecycle) {
2376
2147
  hook.callback = callback;
2377
2148
  }
2378
2149
  }
2379
-
2380
2150
  function useDidShow(callback) {
2381
2151
  usePageLifecycle(callback, 'componentDidShow');
2382
2152
  }
@@ -2409,31 +2179,25 @@ function useAddToFavorites(callback) {
2409
2179
  }
2410
2180
  function useRouter() {
2411
2181
  var hook = getHooks(Current.index++);
2412
-
2413
2182
  if (!hook.router) {
2414
2183
  hook.component = Current.current;
2415
2184
  hook.router = hook.component.$router;
2416
2185
  }
2417
-
2418
2186
  return hook.router;
2419
2187
  }
2420
2188
  function useScope() {
2421
2189
  var hook = getHooks(Current.index++);
2422
-
2423
2190
  if (!hook.scope) {
2424
2191
  hook.component = Current.current;
2425
2192
  hook.scope = hook.component.$scope;
2426
2193
  }
2427
-
2428
2194
  return hook.scope;
2429
2195
  }
2430
2196
  function useReducer(reducer, initialState, initializer) {
2431
2197
  if (isFunction$1(initialState)) {
2432
2198
  initialState = initialState();
2433
2199
  }
2434
-
2435
2200
  var hook = getHooks(Current.index++);
2436
-
2437
2201
  if (!hook.state) {
2438
2202
  hook.component = Current.current;
2439
2203
  hook.state = [isUndefined(initializer) ? initialState : initializer(initialState), function (action) {
@@ -2442,34 +2206,27 @@ function useReducer(reducer, initialState, initializer) {
2442
2206
  hook.component.setState({}, forceUpdateCallback);
2443
2207
  }];
2444
2208
  }
2445
-
2446
2209
  return hook.state;
2447
2210
  }
2448
-
2449
2211
  function areDepsChanged(prevDeps, deps) {
2450
2212
  if (isNullOrUndef(prevDeps) || isNullOrUndef(deps)) {
2451
2213
  return true;
2452
2214
  }
2453
-
2454
2215
  return deps.some(function (d, i) {
2455
2216
  return !objectIs(d, prevDeps[i]);
2456
2217
  });
2457
2218
  }
2458
-
2459
2219
  function invokeEffects(component, delay) {
2460
2220
  var effects = delay ? component.effects : component.layoutEffects;
2461
2221
  effects.forEach(function (hook) {
2462
2222
  if (isFunction$1(hook.cleanup)) {
2463
2223
  hook.cleanup();
2464
2224
  }
2465
-
2466
2225
  var result = hook.effect();
2467
-
2468
2226
  if (isFunction$1(result)) {
2469
2227
  hook.cleanup = result;
2470
2228
  }
2471
2229
  });
2472
-
2473
2230
  if (delay) {
2474
2231
  component.effects = [];
2475
2232
  } else {
@@ -2477,12 +2234,10 @@ function invokeEffects(component, delay) {
2477
2234
  }
2478
2235
  }
2479
2236
  var scheduleEffectComponents = [];
2480
-
2481
2237
  function invokeScheduleEffects(component) {
2482
2238
  if (!component._afterScheduleEffect) {
2483
2239
  component._afterScheduleEffect = true;
2484
2240
  scheduleEffectComponents.push(component);
2485
-
2486
2241
  if (scheduleEffectComponents.length === 1) {
2487
2242
  defer(function () {
2488
2243
  setTimeout(function () {
@@ -2496,18 +2251,14 @@ function invokeScheduleEffects(component) {
2496
2251
  }
2497
2252
  }
2498
2253
  }
2499
-
2500
2254
  function useEffectImpl(effect, deps, delay) {
2501
2255
  var hook = getHooks(Current.index++);
2502
-
2503
2256
  if (Current.current._disableEffect || !Current.current.__isReady) {
2504
2257
  return;
2505
2258
  }
2506
-
2507
2259
  if (areDepsChanged(hook.deps, deps)) {
2508
2260
  hook.effect = effect;
2509
2261
  hook.deps = deps;
2510
-
2511
2262
  if (delay) {
2512
2263
  Current.current.effects = Current.current.effects.concat(hook);
2513
2264
  invokeScheduleEffects(Current.current);
@@ -2516,7 +2267,6 @@ function useEffectImpl(effect, deps, delay) {
2516
2267
  }
2517
2268
  }
2518
2269
  }
2519
-
2520
2270
  function useEffect(effect, deps) {
2521
2271
  useEffectImpl(effect, deps, true);
2522
2272
  }
@@ -2525,24 +2275,20 @@ function useLayoutEffect(effect, deps) {
2525
2275
  }
2526
2276
  function useRef(initialValue) {
2527
2277
  var hook = getHooks(Current.index++);
2528
-
2529
2278
  if (!hook.ref) {
2530
2279
  hook.ref = {
2531
2280
  current: initialValue
2532
2281
  };
2533
2282
  }
2534
-
2535
2283
  return hook.ref;
2536
2284
  }
2537
2285
  function useMemo(factory, deps) {
2538
2286
  var hook = getHooks(Current.index++);
2539
-
2540
2287
  if (areDepsChanged(hook.deps, deps)) {
2541
2288
  hook.deps = deps;
2542
2289
  hook.callback = factory;
2543
2290
  hook.value = factory();
2544
2291
  }
2545
-
2546
2292
  return hook.value;
2547
2293
  }
2548
2294
  function useCallback(callback, deps) {
@@ -2568,13 +2314,10 @@ function useImperativeHandle(ref, init, deps) {
2568
2314
  function useContext(_ref) {
2569
2315
  var context = _ref.context;
2570
2316
  var emitter = context.emitter;
2571
-
2572
2317
  if (emitter === null) {
2573
2318
  return context._defaultValue;
2574
2319
  }
2575
-
2576
2320
  var hook = getHooks(Current.index++);
2577
-
2578
2321
  if (isUndefined(hook.context)) {
2579
2322
  hook.context = true;
2580
2323
  hook.component = Current.current;
@@ -2585,20 +2328,16 @@ function useContext(_ref) {
2585
2328
  }
2586
2329
  });
2587
2330
  }
2588
-
2589
2331
  return emitter.value;
2590
2332
  }
2591
2333
 
2592
2334
  var Emitter = /*#__PURE__*/function () {
2593
2335
  function Emitter() {
2594
2336
  var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2595
-
2596
2337
  _classCallCheck(this, Emitter);
2597
-
2598
2338
  this.value = value;
2599
2339
  this.handlers = [];
2600
2340
  }
2601
-
2602
2341
  _createClass(Emitter, [{
2603
2342
  key: "on",
2604
2343
  value: function on(handler) {
@@ -2615,18 +2354,15 @@ var Emitter = /*#__PURE__*/function () {
2615
2354
  key: "set",
2616
2355
  value: function set(value) {
2617
2356
  var _this = this;
2618
-
2619
2357
  if (objectIs(value, this.value)) {
2620
2358
  return;
2621
2359
  }
2622
-
2623
2360
  this.value = value;
2624
2361
  this.handlers.forEach(function (h) {
2625
2362
  return h(_this.value);
2626
2363
  });
2627
2364
  }
2628
2365
  }]);
2629
-
2630
2366
  return Emitter;
2631
2367
  }();
2632
2368
 
@@ -2638,17 +2374,14 @@ function createContext(defaultValue) {
2638
2374
  _id: contextId,
2639
2375
  _defaultValue: defaultValue
2640
2376
  };
2641
-
2642
2377
  function Provider(newValue) {
2643
2378
  var emitter = context.emitter;
2644
-
2645
2379
  if (!emitter) {
2646
2380
  context.emitter = new Emitter(defaultValue);
2647
2381
  } else {
2648
2382
  emitter.set(newValue);
2649
2383
  }
2650
2384
  }
2651
-
2652
2385
  return {
2653
2386
  Provider: Provider,
2654
2387
  context: context
@@ -2660,42 +2393,32 @@ var objectIs$1 = Object.is || function (x, y) {
2660
2393
  if (x === y) {
2661
2394
  return x !== 0 || 1 / x === 1 / y;
2662
2395
  }
2663
-
2664
2396
  return x !== x && y !== y;
2665
2397
  };
2666
-
2667
2398
  function shallowEqual(obj1, obj2) {
2668
2399
  if (_typeof(obj1) !== 'object' && _typeof(obj2) !== 'object') {
2669
2400
  return obj1 === obj2;
2670
2401
  }
2671
-
2672
2402
  if (obj1 === null && obj2 === null) {
2673
2403
  return true;
2674
2404
  }
2675
-
2676
2405
  if (obj1 === null || obj2 === null) {
2677
2406
  return false;
2678
2407
  }
2679
-
2680
2408
  if (objectIs$1(obj1, obj2)) {
2681
2409
  return true;
2682
2410
  }
2683
-
2684
2411
  var obj1Keys = obj1 ? Object.keys(obj1) : [];
2685
2412
  var obj2Keys = obj2 ? Object.keys(obj2) : [];
2686
-
2687
2413
  if (obj1Keys.length !== obj2Keys.length) {
2688
2414
  return false;
2689
2415
  }
2690
-
2691
2416
  for (var i = 0; i < obj1Keys.length; i++) {
2692
2417
  var obj1KeyItem = obj1Keys[i];
2693
-
2694
2418
  if (!obj2.hasOwnProperty(obj1KeyItem) || !objectIs$1(obj1[obj1KeyItem], obj2[obj1KeyItem])) {
2695
2419
  return false;
2696
2420
  }
2697
2421
  }
2698
-
2699
2422
  return true;
2700
2423
  }
2701
2424
 
@@ -2703,18 +2426,15 @@ function memo(component, propsAreEqual) {
2703
2426
  component.prototype.shouldComponentUpdate = function (nextProps) {
2704
2427
  return isFunction$1(propsAreEqual) ? !propsAreEqual(this.props, nextProps) : !shallowEqual(this.props, nextProps);
2705
2428
  };
2706
-
2707
2429
  return component;
2708
2430
  }
2709
2431
 
2710
2432
  /* eslint-disable camelcase */
2711
2433
  var eventCenter;
2712
-
2713
2434
  if (process.env.TARO_ENV === 'alipay') {
2714
2435
  if (!my.taroEventCenter) {
2715
2436
  my.taroEventCenter = new Events();
2716
2437
  }
2717
-
2718
2438
  eventCenter = my.taroEventCenter;
2719
2439
  } else {
2720
2440
  eventCenter = new Events();