UNPKG

885 kBJavaScriptView Raw
1(function webpackUniversalModuleDefinition(root, factory) {
2 if(typeof exports === 'object' && typeof module === 'object')
3 module.exports = factory();
4 else if(typeof define === 'function' && define.amd)
5 define([], factory);
6 else if(typeof exports === 'object')
7 exports["AV"] = factory();
8 else
9 root["AV"] = factory();
10})(typeof self !== 'undefined' ? self : this, function() {
11return /******/ (function(modules) { // webpackBootstrap
12/******/ // The module cache
13/******/ var installedModules = {};
14/******/
15/******/ // The require function
16/******/ function __webpack_require__(moduleId) {
17/******/
18/******/ // Check if module is in cache
19/******/ if(installedModules[moduleId]) {
20/******/ return installedModules[moduleId].exports;
21/******/ }
22/******/ // Create a new module (and put it into the cache)
23/******/ var module = installedModules[moduleId] = {
24/******/ i: moduleId,
25/******/ l: false,
26/******/ exports: {}
27/******/ };
28/******/
29/******/ // Execute the module function
30/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
31/******/
32/******/ // Flag the module as loaded
33/******/ module.l = true;
34/******/
35/******/ // Return the exports of the module
36/******/ return module.exports;
37/******/ }
38/******/
39/******/
40/******/ // expose the modules object (__webpack_modules__)
41/******/ __webpack_require__.m = modules;
42/******/
43/******/ // expose the module cache
44/******/ __webpack_require__.c = installedModules;
45/******/
46/******/ // define getter function for harmony exports
47/******/ __webpack_require__.d = function(exports, name, getter) {
48/******/ if(!__webpack_require__.o(exports, name)) {
49/******/ Object.defineProperty(exports, name, {
50/******/ configurable: false,
51/******/ enumerable: true,
52/******/ get: getter
53/******/ });
54/******/ }
55/******/ };
56/******/
57/******/ // getDefaultExport function for compatibility with non-harmony modules
58/******/ __webpack_require__.n = function(module) {
59/******/ var getter = module && module.__esModule ?
60/******/ function getDefault() { return module['default']; } :
61/******/ function getModuleExports() { return module; };
62/******/ __webpack_require__.d(getter, 'a', getter);
63/******/ return getter;
64/******/ };
65/******/
66/******/ // Object.prototype.hasOwnProperty.call
67/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
68/******/
69/******/ // __webpack_public_path__
70/******/ __webpack_require__.p = "";
71/******/
72/******/ // Load entry module and return exports
73/******/ return __webpack_require__(__webpack_require__.s = 249);
74/******/ })
75/************************************************************************/
76/******/ ([
77/* 0 */
78/***/ (function(module, exports, __webpack_require__) {
79
80"use strict";
81
82var global = __webpack_require__(6);
83var apply = __webpack_require__(69);
84var uncurryThis = __webpack_require__(4);
85var isCallable = __webpack_require__(7);
86var getOwnPropertyDescriptor = __webpack_require__(71).f;
87var isForced = __webpack_require__(149);
88var path = __webpack_require__(10);
89var bind = __webpack_require__(45);
90var createNonEnumerableProperty = __webpack_require__(35);
91var hasOwn = __webpack_require__(14);
92
93var wrapConstructor = function (NativeConstructor) {
94 var Wrapper = function (a, b, c) {
95 if (this instanceof Wrapper) {
96 switch (arguments.length) {
97 case 0: return new NativeConstructor();
98 case 1: return new NativeConstructor(a);
99 case 2: return new NativeConstructor(a, b);
100 } return new NativeConstructor(a, b, c);
101 } return apply(NativeConstructor, this, arguments);
102 };
103 Wrapper.prototype = NativeConstructor.prototype;
104 return Wrapper;
105};
106
107/*
108 options.target - name of the target object
109 options.global - target is the global object
110 options.stat - export as static methods of target
111 options.proto - export as prototype methods of target
112 options.real - real prototype method for the `pure` version
113 options.forced - export even if the native feature is available
114 options.bind - bind methods to the target, required for the `pure` version
115 options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
116 options.unsafe - use the simple assignment of property instead of delete + defineProperty
117 options.sham - add a flag to not completely full polyfills
118 options.enumerable - export as enumerable property
119 options.dontCallGetSet - prevent calling a getter on target
120 options.name - the .name of the function if it does not match the key
121*/
122module.exports = function (options, source) {
123 var TARGET = options.target;
124 var GLOBAL = options.global;
125 var STATIC = options.stat;
126 var PROTO = options.proto;
127
128 var nativeSource = GLOBAL ? global : STATIC ? global[TARGET] : (global[TARGET] || {}).prototype;
129
130 var target = GLOBAL ? path : path[TARGET] || createNonEnumerableProperty(path, TARGET, {})[TARGET];
131 var targetPrototype = target.prototype;
132
133 var FORCED, USE_NATIVE, VIRTUAL_PROTOTYPE;
134 var key, sourceProperty, targetProperty, nativeProperty, resultProperty, descriptor;
135
136 for (key in source) {
137 FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
138 // contains in native
139 USE_NATIVE = !FORCED && nativeSource && hasOwn(nativeSource, key);
140
141 targetProperty = target[key];
142
143 if (USE_NATIVE) if (options.dontCallGetSet) {
144 descriptor = getOwnPropertyDescriptor(nativeSource, key);
145 nativeProperty = descriptor && descriptor.value;
146 } else nativeProperty = nativeSource[key];
147
148 // export native or implementation
149 sourceProperty = (USE_NATIVE && nativeProperty) ? nativeProperty : source[key];
150
151 if (USE_NATIVE && typeof targetProperty == typeof sourceProperty) continue;
152
153 // bind timers to global for call from export context
154 if (options.bind && USE_NATIVE) resultProperty = bind(sourceProperty, global);
155 // wrap global constructors for prevent changs in this version
156 else if (options.wrap && USE_NATIVE) resultProperty = wrapConstructor(sourceProperty);
157 // make static versions for prototype methods
158 else if (PROTO && isCallable(sourceProperty)) resultProperty = uncurryThis(sourceProperty);
159 // default case
160 else resultProperty = sourceProperty;
161
162 // add a flag to not completely full polyfills
163 if (options.sham || (sourceProperty && sourceProperty.sham) || (targetProperty && targetProperty.sham)) {
164 createNonEnumerableProperty(resultProperty, 'sham', true);
165 }
166
167 createNonEnumerableProperty(target, key, resultProperty);
168
169 if (PROTO) {
170 VIRTUAL_PROTOTYPE = TARGET + 'Prototype';
171 if (!hasOwn(path, VIRTUAL_PROTOTYPE)) {
172 createNonEnumerableProperty(path, VIRTUAL_PROTOTYPE, {});
173 }
174 // export virtual prototype methods
175 createNonEnumerableProperty(path[VIRTUAL_PROTOTYPE], key, sourceProperty);
176 // export real prototype methods
177 if (options.real && targetPrototype && !targetPrototype[key]) {
178 createNonEnumerableProperty(targetPrototype, key, sourceProperty);
179 }
180 }
181 }
182};
183
184
185/***/ }),
186/* 1 */
187/***/ (function(module, exports) {
188
189function _interopRequireDefault(obj) {
190 return obj && obj.__esModule ? obj : {
191 "default": obj
192 };
193}
194
195module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
196
197/***/ }),
198/* 2 */
199/***/ (function(module, __webpack_exports__, __webpack_require__) {
200
201"use strict";
202Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
203/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__index_default_js__ = __webpack_require__(290);
204/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return __WEBPACK_IMPORTED_MODULE_0__index_default_js__["a"]; });
205/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__index_js__ = __webpack_require__(126);
206/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "VERSION", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["VERSION"]; });
207/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "restArguments", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["restArguments"]; });
208/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isObject", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isObject"]; });
209/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isNull", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isNull"]; });
210/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isUndefined", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isUndefined"]; });
211/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isBoolean", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isBoolean"]; });
212/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isElement", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isElement"]; });
213/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isString", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isString"]; });
214/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isNumber", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isNumber"]; });
215/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isDate", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isDate"]; });
216/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isRegExp", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isRegExp"]; });
217/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isError", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isError"]; });
218/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isSymbol", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isSymbol"]; });
219/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isArrayBuffer", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isArrayBuffer"]; });
220/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isDataView", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isDataView"]; });
221/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isArray", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isArray"]; });
222/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isFunction", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isFunction"]; });
223/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isArguments", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isArguments"]; });
224/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isFinite", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isFinite"]; });
225/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isNaN", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isNaN"]; });
226/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isTypedArray", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isTypedArray"]; });
227/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isEmpty"]; });
228/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isMatch", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isMatch"]; });
229/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isEqual", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isEqual"]; });
230/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isMap", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isMap"]; });
231/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isWeakMap", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isWeakMap"]; });
232/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isSet", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isSet"]; });
233/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isWeakSet", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isWeakSet"]; });
234/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "keys", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["keys"]; });
235/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "allKeys", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["allKeys"]; });
236/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "values", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["values"]; });
237/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "pairs", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["pairs"]; });
238/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "invert", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["invert"]; });
239/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "functions", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["functions"]; });
240/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "methods", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["methods"]; });
241/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "extend", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["extend"]; });
242/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "extendOwn", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["extendOwn"]; });
243/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "assign", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["assign"]; });
244/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "defaults", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["defaults"]; });
245/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "create", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["create"]; });
246/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "clone", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["clone"]; });
247/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "tap", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["tap"]; });
248/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "get", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["get"]; });
249/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "has", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["has"]; });
250/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "mapObject", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["mapObject"]; });
251/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["identity"]; });
252/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "constant", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["constant"]; });
253/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "noop", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["noop"]; });
254/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "toPath", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["toPath"]; });
255/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "property", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["property"]; });
256/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "propertyOf", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["propertyOf"]; });
257/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "matcher", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["matcher"]; });
258/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "matches", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["matches"]; });
259/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "times", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["times"]; });
260/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "random", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["random"]; });
261/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "now", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["now"]; });
262/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "escape", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["escape"]; });
263/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "unescape", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["unescape"]; });
264/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "templateSettings", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["templateSettings"]; });
265/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "template", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["template"]; });
266/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "result", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["result"]; });
267/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "uniqueId", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["uniqueId"]; });
268/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "chain", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["chain"]; });
269/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "iteratee", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["iteratee"]; });
270/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "partial", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["partial"]; });
271/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "bind", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["bind"]; });
272/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "bindAll", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["bindAll"]; });
273/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "memoize", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["memoize"]; });
274/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "delay", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["delay"]; });
275/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "defer", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["defer"]; });
276/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "throttle", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["throttle"]; });
277/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "debounce", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["debounce"]; });
278/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "wrap", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["wrap"]; });
279/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "negate", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["negate"]; });
280/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "compose", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["compose"]; });
281/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "after", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["after"]; });
282/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "before", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["before"]; });
283/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "once", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["once"]; });
284/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "findKey", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["findKey"]; });
285/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "findIndex", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["findIndex"]; });
286/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "findLastIndex", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["findLastIndex"]; });
287/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "sortedIndex", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["sortedIndex"]; });
288/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "indexOf", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["indexOf"]; });
289/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "lastIndexOf", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["lastIndexOf"]; });
290/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "find", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["find"]; });
291/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "detect", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["detect"]; });
292/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "findWhere", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["findWhere"]; });
293/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "each", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["each"]; });
294/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "forEach", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["forEach"]; });
295/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "map", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["map"]; });
296/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "collect", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["collect"]; });
297/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "reduce", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["reduce"]; });
298/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "foldl", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["foldl"]; });
299/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "inject", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["inject"]; });
300/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "reduceRight", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["reduceRight"]; });
301/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "foldr", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["foldr"]; });
302/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "filter", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["filter"]; });
303/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "select", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["select"]; });
304/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "reject", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["reject"]; });
305/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "every", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["every"]; });
306/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "all", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["all"]; });
307/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "some", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["some"]; });
308/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "any", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["any"]; });
309/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "contains", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["contains"]; });
310/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "includes", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["includes"]; });
311/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "include", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["include"]; });
312/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "invoke", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["invoke"]; });
313/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "pluck", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["pluck"]; });
314/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "where", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["where"]; });
315/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "max", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["max"]; });
316/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "min", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["min"]; });
317/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "shuffle", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["shuffle"]; });
318/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "sample", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["sample"]; });
319/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "sortBy", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["sortBy"]; });
320/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "groupBy", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["groupBy"]; });
321/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "indexBy", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["indexBy"]; });
322/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "countBy", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["countBy"]; });
323/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "partition", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["partition"]; });
324/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "toArray", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["toArray"]; });
325/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "size", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["size"]; });
326/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "pick", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["pick"]; });
327/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "omit", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["omit"]; });
328/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "first", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["first"]; });
329/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "head", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["head"]; });
330/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "take", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["take"]; });
331/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "initial", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["initial"]; });
332/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "last", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["last"]; });
333/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "rest", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["rest"]; });
334/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "tail", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["tail"]; });
335/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "drop", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["drop"]; });
336/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "compact", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["compact"]; });
337/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "flatten", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["flatten"]; });
338/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "without", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["without"]; });
339/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "uniq", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["uniq"]; });
340/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "unique", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["unique"]; });
341/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "union", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["union"]; });
342/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "intersection", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["intersection"]; });
343/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "difference", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["difference"]; });
344/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "unzip", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["unzip"]; });
345/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "transpose", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["transpose"]; });
346/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "zip", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["zip"]; });
347/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "object", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["object"]; });
348/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "range", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["range"]; });
349/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "chunk", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["chunk"]; });
350/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "mixin", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["mixin"]; });
351// ESM Exports
352// ===========
353// This module is the package entry point for ES module users. In other words,
354// it is the module they are interfacing with when they import from the whole
355// package instead of from a submodule, like this:
356//
357// ```js
358// import { map } from 'underscore';
359// ```
360//
361// The difference with `./index-default`, which is the package entry point for
362// CommonJS, AMD and UMD users, is purely technical. In ES modules, named and
363// default exports are considered to be siblings, so when you have a default
364// export, its properties are not automatically available as named exports. For
365// this reason, we re-export the named exports in addition to providing the same
366// default export as in `./index-default`.
367
368
369
370
371/***/ }),
372/* 3 */
373/***/ (function(module, exports) {
374
375module.exports = function (exec) {
376 try {
377 return !!exec();
378 } catch (error) {
379 return true;
380 }
381};
382
383
384/***/ }),
385/* 4 */
386/***/ (function(module, exports, __webpack_require__) {
387
388var NATIVE_BIND = __webpack_require__(70);
389
390var FunctionPrototype = Function.prototype;
391var bind = FunctionPrototype.bind;
392var call = FunctionPrototype.call;
393var uncurryThis = NATIVE_BIND && bind.bind(call, call);
394
395module.exports = NATIVE_BIND ? function (fn) {
396 return fn && uncurryThis(fn);
397} : function (fn) {
398 return fn && function () {
399 return call.apply(fn, arguments);
400 };
401};
402
403
404/***/ }),
405/* 5 */
406/***/ (function(module, __webpack_exports__, __webpack_require__) {
407
408"use strict";
409/* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return VERSION; });
410/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "p", function() { return root; });
411/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ArrayProto; });
412/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return ObjProto; });
413/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return SymbolProto; });
414/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return push; });
415/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "q", function() { return slice; });
416/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "t", function() { return toString; });
417/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return hasOwnProperty; });
418/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "r", function() { return supportsArrayBuffer; });
419/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "s", function() { return supportsDataView; });
420/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return nativeIsArray; });
421/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return nativeKeys; });
422/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return nativeCreate; });
423/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return nativeIsView; });
424/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return _isNaN; });
425/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return _isFinite; });
426/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return hasEnumBug; });
427/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return nonEnumerableProps; });
428/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return MAX_ARRAY_INDEX; });
429// Current version.
430var VERSION = '1.12.1';
431
432// Establish the root object, `window` (`self`) in the browser, `global`
433// on the server, or `this` in some virtual machines. We use `self`
434// instead of `window` for `WebWorker` support.
435var root = typeof self == 'object' && self.self === self && self ||
436 typeof global == 'object' && global.global === global && global ||
437 Function('return this')() ||
438 {};
439
440// Save bytes in the minified (but not gzipped) version:
441var ArrayProto = Array.prototype, ObjProto = Object.prototype;
442var SymbolProto = typeof Symbol !== 'undefined' ? Symbol.prototype : null;
443
444// Create quick reference variables for speed access to core prototypes.
445var push = ArrayProto.push,
446 slice = ArrayProto.slice,
447 toString = ObjProto.toString,
448 hasOwnProperty = ObjProto.hasOwnProperty;
449
450// Modern feature detection.
451var supportsArrayBuffer = typeof ArrayBuffer !== 'undefined',
452 supportsDataView = typeof DataView !== 'undefined';
453
454// All **ECMAScript 5+** native function implementations that we hope to use
455// are declared here.
456var nativeIsArray = Array.isArray,
457 nativeKeys = Object.keys,
458 nativeCreate = Object.create,
459 nativeIsView = supportsArrayBuffer && ArrayBuffer.isView;
460
461// Create references to these builtin functions because we override them.
462var _isNaN = isNaN,
463 _isFinite = isFinite;
464
465// Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed.
466var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString');
467var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString',
468 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString'];
469
470// The largest integer that can be represented exactly.
471var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1;
472
473/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(112)))
474
475/***/ }),
476/* 6 */
477/***/ (function(module, exports, __webpack_require__) {
478
479/* WEBPACK VAR INJECTION */(function(global) {var check = function (it) {
480 return it && it.Math == Math && it;
481};
482
483// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
484module.exports =
485 // eslint-disable-next-line es-x/no-global-this -- safe
486 check(typeof globalThis == 'object' && globalThis) ||
487 check(typeof window == 'object' && window) ||
488 // eslint-disable-next-line no-restricted-globals -- safe
489 check(typeof self == 'object' && self) ||
490 check(typeof global == 'object' && global) ||
491 // eslint-disable-next-line no-new-func -- fallback
492 (function () { return this; })() || Function('return this')();
493
494/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(112)))
495
496/***/ }),
497/* 7 */
498/***/ (function(module, exports) {
499
500// `IsCallable` abstract operation
501// https://tc39.es/ecma262/#sec-iscallable
502module.exports = function (argument) {
503 return typeof argument == 'function';
504};
505
506
507/***/ }),
508/* 8 */
509/***/ (function(module, exports, __webpack_require__) {
510
511var path = __webpack_require__(10);
512var hasOwn = __webpack_require__(14);
513var wrappedWellKnownSymbolModule = __webpack_require__(144);
514var defineProperty = __webpack_require__(22).f;
515
516module.exports = function (NAME) {
517 var Symbol = path.Symbol || (path.Symbol = {});
518 if (!hasOwn(Symbol, NAME)) defineProperty(Symbol, NAME, {
519 value: wrappedWellKnownSymbolModule.f(NAME)
520 });
521};
522
523
524/***/ }),
525/* 9 */
526/***/ (function(module, exports, __webpack_require__) {
527
528var global = __webpack_require__(6);
529var shared = __webpack_require__(73);
530var hasOwn = __webpack_require__(14);
531var uid = __webpack_require__(92);
532var NATIVE_SYMBOL = __webpack_require__(57);
533var USE_SYMBOL_AS_UID = __webpack_require__(147);
534
535var WellKnownSymbolsStore = shared('wks');
536var Symbol = global.Symbol;
537var symbolFor = Symbol && Symbol['for'];
538var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid;
539
540module.exports = function (name) {
541 if (!hasOwn(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {
542 var description = 'Symbol.' + name;
543 if (NATIVE_SYMBOL && hasOwn(Symbol, name)) {
544 WellKnownSymbolsStore[name] = Symbol[name];
545 } else if (USE_SYMBOL_AS_UID && symbolFor) {
546 WellKnownSymbolsStore[name] = symbolFor(description);
547 } else {
548 WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
549 }
550 } return WellKnownSymbolsStore[name];
551};
552
553
554/***/ }),
555/* 10 */
556/***/ (function(module, exports) {
557
558module.exports = {};
559
560
561/***/ }),
562/* 11 */
563/***/ (function(module, exports, __webpack_require__) {
564
565var isCallable = __webpack_require__(7);
566
567module.exports = function (it) {
568 return typeof it == 'object' ? it !== null : isCallable(it);
569};
570
571
572/***/ }),
573/* 12 */
574/***/ (function(module, exports, __webpack_require__) {
575
576module.exports = __webpack_require__(252);
577
578/***/ }),
579/* 13 */
580/***/ (function(module, exports, __webpack_require__) {
581
582var NATIVE_BIND = __webpack_require__(70);
583
584var call = Function.prototype.call;
585
586module.exports = NATIVE_BIND ? call.bind(call) : function () {
587 return call.apply(call, arguments);
588};
589
590
591/***/ }),
592/* 14 */
593/***/ (function(module, exports, __webpack_require__) {
594
595var uncurryThis = __webpack_require__(4);
596var toObject = __webpack_require__(34);
597
598var hasOwnProperty = uncurryThis({}.hasOwnProperty);
599
600// `HasOwnProperty` abstract operation
601// https://tc39.es/ecma262/#sec-hasownproperty
602// eslint-disable-next-line es-x/no-object-hasown -- safe
603module.exports = Object.hasOwn || function hasOwn(it, key) {
604 return hasOwnProperty(toObject(it), key);
605};
606
607
608/***/ }),
609/* 15 */
610/***/ (function(module, __webpack_exports__, __webpack_require__) {
611
612"use strict";
613/* harmony export (immutable) */ __webpack_exports__["a"] = keys;
614/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isObject_js__ = __webpack_require__(52);
615/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(5);
616/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__has_js__ = __webpack_require__(40);
617/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__collectNonEnumProps_js__ = __webpack_require__(180);
618
619
620
621
622
623// Retrieve the names of an object's own properties.
624// Delegates to **ECMAScript 5**'s native `Object.keys`.
625function keys(obj) {
626 if (!Object(__WEBPACK_IMPORTED_MODULE_0__isObject_js__["a" /* default */])(obj)) return [];
627 if (__WEBPACK_IMPORTED_MODULE_1__setup_js__["m" /* nativeKeys */]) return Object(__WEBPACK_IMPORTED_MODULE_1__setup_js__["m" /* nativeKeys */])(obj);
628 var keys = [];
629 for (var key in obj) if (Object(__WEBPACK_IMPORTED_MODULE_2__has_js__["a" /* default */])(obj, key)) keys.push(key);
630 // Ahem, IE < 9.
631 if (__WEBPACK_IMPORTED_MODULE_1__setup_js__["h" /* hasEnumBug */]) Object(__WEBPACK_IMPORTED_MODULE_3__collectNonEnumProps_js__["a" /* default */])(obj, keys);
632 return keys;
633}
634
635
636/***/ }),
637/* 16 */
638/***/ (function(module, exports, __webpack_require__) {
639
640var fails = __webpack_require__(3);
641
642// Detect IE8's incomplete defineProperty implementation
643module.exports = !fails(function () {
644 // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
645 return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
646});
647
648
649/***/ }),
650/* 17 */
651/***/ (function(module, __webpack_exports__, __webpack_require__) {
652
653"use strict";
654/* harmony export (immutable) */ __webpack_exports__["a"] = tagTester;
655/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
656
657
658// Internal function for creating a `toString`-based type tester.
659function tagTester(name) {
660 var tag = '[object ' + name + ']';
661 return function(obj) {
662 return __WEBPACK_IMPORTED_MODULE_0__setup_js__["t" /* toString */].call(obj) === tag;
663 };
664}
665
666
667/***/ }),
668/* 18 */
669/***/ (function(module, exports, __webpack_require__) {
670
671var path = __webpack_require__(10);
672var global = __webpack_require__(6);
673var isCallable = __webpack_require__(7);
674
675var aFunction = function (variable) {
676 return isCallable(variable) ? variable : undefined;
677};
678
679module.exports = function (namespace, method) {
680 return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace])
681 : path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method];
682};
683
684
685/***/ }),
686/* 19 */
687/***/ (function(module, exports, __webpack_require__) {
688
689var isObject = __webpack_require__(11);
690
691var $String = String;
692var $TypeError = TypeError;
693
694// `Assert: Type(argument) is Object`
695module.exports = function (argument) {
696 if (isObject(argument)) return argument;
697 throw $TypeError($String(argument) + ' is not an object');
698};
699
700
701/***/ }),
702/* 20 */
703/***/ (function(module, __webpack_exports__, __webpack_require__) {
704
705"use strict";
706/* harmony export (immutable) */ __webpack_exports__["a"] = cb;
707/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(24);
708/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__baseIteratee_js__ = __webpack_require__(190);
709/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__iteratee_js__ = __webpack_require__(191);
710
711
712
713
714// The function we call internally to generate a callback. It invokes
715// `_.iteratee` if overridden, otherwise `baseIteratee`.
716function cb(value, context, argCount) {
717 if (__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].iteratee !== __WEBPACK_IMPORTED_MODULE_2__iteratee_js__["a" /* default */]) return __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].iteratee(value, context);
718 return Object(__WEBPACK_IMPORTED_MODULE_1__baseIteratee_js__["a" /* default */])(value, context, argCount);
719}
720
721
722/***/ }),
723/* 21 */
724/***/ (function(module, exports, __webpack_require__) {
725
726var uncurryThis = __webpack_require__(4);
727
728module.exports = uncurryThis({}.isPrototypeOf);
729
730
731/***/ }),
732/* 22 */
733/***/ (function(module, exports, __webpack_require__) {
734
735var DESCRIPTORS = __webpack_require__(16);
736var IE8_DOM_DEFINE = __webpack_require__(148);
737var V8_PROTOTYPE_DEFINE_BUG = __webpack_require__(150);
738var anObject = __webpack_require__(19);
739var toPropertyKey = __webpack_require__(88);
740
741var $TypeError = TypeError;
742// eslint-disable-next-line es-x/no-object-defineproperty -- safe
743var $defineProperty = Object.defineProperty;
744// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
745var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
746var ENUMERABLE = 'enumerable';
747var CONFIGURABLE = 'configurable';
748var WRITABLE = 'writable';
749
750// `Object.defineProperty` method
751// https://tc39.es/ecma262/#sec-object.defineproperty
752exports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {
753 anObject(O);
754 P = toPropertyKey(P);
755 anObject(Attributes);
756 if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
757 var current = $getOwnPropertyDescriptor(O, P);
758 if (current && current[WRITABLE]) {
759 O[P] = Attributes.value;
760 Attributes = {
761 configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],
762 enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
763 writable: false
764 };
765 }
766 } return $defineProperty(O, P, Attributes);
767} : $defineProperty : function defineProperty(O, P, Attributes) {
768 anObject(O);
769 P = toPropertyKey(P);
770 anObject(Attributes);
771 if (IE8_DOM_DEFINE) try {
772 return $defineProperty(O, P, Attributes);
773 } catch (error) { /* empty */ }
774 if ('get' in Attributes || 'set' in Attributes) throw $TypeError('Accessors not supported');
775 if ('value' in Attributes) O[P] = Attributes.value;
776 return O;
777};
778
779
780/***/ }),
781/* 23 */
782/***/ (function(module, __webpack_exports__, __webpack_require__) {
783
784"use strict";
785/* harmony export (immutable) */ __webpack_exports__["a"] = restArguments;
786// Some functions take a variable number of arguments, or a few expected
787// arguments at the beginning and then a variable number of values to operate
788// on. This helper accumulates all remaining arguments past the function’s
789// argument length (or an explicit `startIndex`), into an array that becomes
790// the last argument. Similar to ES6’s "rest parameter".
791function restArguments(func, startIndex) {
792 startIndex = startIndex == null ? func.length - 1 : +startIndex;
793 return function() {
794 var length = Math.max(arguments.length - startIndex, 0),
795 rest = Array(length),
796 index = 0;
797 for (; index < length; index++) {
798 rest[index] = arguments[index + startIndex];
799 }
800 switch (startIndex) {
801 case 0: return func.call(this, rest);
802 case 1: return func.call(this, arguments[0], rest);
803 case 2: return func.call(this, arguments[0], arguments[1], rest);
804 }
805 var args = Array(startIndex + 1);
806 for (index = 0; index < startIndex; index++) {
807 args[index] = arguments[index];
808 }
809 args[startIndex] = rest;
810 return func.apply(this, args);
811 };
812}
813
814
815/***/ }),
816/* 24 */
817/***/ (function(module, __webpack_exports__, __webpack_require__) {
818
819"use strict";
820/* harmony export (immutable) */ __webpack_exports__["a"] = _;
821/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
822
823
824// If Underscore is called as a function, it returns a wrapped object that can
825// be used OO-style. This wrapper holds altered versions of all functions added
826// through `_.mixin`. Wrapped objects may be chained.
827function _(obj) {
828 if (obj instanceof _) return obj;
829 if (!(this instanceof _)) return new _(obj);
830 this._wrapped = obj;
831}
832
833_.VERSION = __WEBPACK_IMPORTED_MODULE_0__setup_js__["e" /* VERSION */];
834
835// Extracts the result from a wrapped and chained object.
836_.prototype.value = function() {
837 return this._wrapped;
838};
839
840// Provide unwrapping proxies for some methods used in engine operations
841// such as arithmetic and JSON stringification.
842_.prototype.valueOf = _.prototype.toJSON = _.prototype.value;
843
844_.prototype.toString = function() {
845 return String(this._wrapped);
846};
847
848
849/***/ }),
850/* 25 */
851/***/ (function(module, __webpack_exports__, __webpack_require__) {
852
853"use strict";
854/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createSizePropertyCheck_js__ = __webpack_require__(178);
855/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getLength_js__ = __webpack_require__(28);
856
857
858
859// Internal helper for collection methods to determine whether a collection
860// should be iterated as an array or as an object.
861// Related: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength
862// Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094
863/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createSizePropertyCheck_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__getLength_js__["a" /* default */]));
864
865
866/***/ }),
867/* 26 */
868/***/ (function(module, exports, __webpack_require__) {
869
870"use strict";
871
872
873var _interopRequireDefault = __webpack_require__(1);
874
875var _concat = _interopRequireDefault(__webpack_require__(30));
876
877var _promise = _interopRequireDefault(__webpack_require__(12));
878
879var _ = __webpack_require__(2);
880
881var md5 = __webpack_require__(502);
882
883var _require = __webpack_require__(2),
884 extend = _require.extend;
885
886var AV = __webpack_require__(65);
887
888var AVError = __webpack_require__(43);
889
890var _require2 = __webpack_require__(29),
891 getSessionToken = _require2.getSessionToken;
892
893var ajax = __webpack_require__(108); // 计算 X-LC-Sign 的签名方法
894
895
896var sign = function sign(key, isMasterKey) {
897 var _context2;
898
899 var now = new Date().getTime();
900 var signature = md5(now + key);
901
902 if (isMasterKey) {
903 var _context;
904
905 return (0, _concat.default)(_context = "".concat(signature, ",")).call(_context, now, ",master");
906 }
907
908 return (0, _concat.default)(_context2 = "".concat(signature, ",")).call(_context2, now);
909};
910
911var setAppKey = function setAppKey(headers, signKey) {
912 if (signKey) {
913 headers['X-LC-Sign'] = sign(AV.applicationKey);
914 } else {
915 headers['X-LC-Key'] = AV.applicationKey;
916 }
917};
918
919var setHeaders = function setHeaders() {
920 var authOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
921 var signKey = arguments.length > 1 ? arguments[1] : undefined;
922 var headers = {
923 'X-LC-Id': AV.applicationId,
924 'Content-Type': 'application/json;charset=UTF-8'
925 };
926 var useMasterKey = false;
927
928 if (typeof authOptions.useMasterKey === 'boolean') {
929 useMasterKey = authOptions.useMasterKey;
930 } else if (typeof AV._config.useMasterKey === 'boolean') {
931 useMasterKey = AV._config.useMasterKey;
932 }
933
934 if (useMasterKey) {
935 if (AV.masterKey) {
936 if (signKey) {
937 headers['X-LC-Sign'] = sign(AV.masterKey, true);
938 } else {
939 headers['X-LC-Key'] = "".concat(AV.masterKey, ",master");
940 }
941 } else {
942 console.warn('masterKey is not set, fall back to use appKey');
943 setAppKey(headers, signKey);
944 }
945 } else {
946 setAppKey(headers, signKey);
947 }
948
949 if (AV.hookKey) {
950 headers['X-LC-Hook-Key'] = AV.hookKey;
951 }
952
953 if (AV._config.production !== null) {
954 headers['X-LC-Prod'] = String(AV._config.production);
955 }
956
957 headers[ false ? 'User-Agent' : 'X-LC-UA'] = AV._sharedConfig.userAgent;
958 return _promise.default.resolve().then(function () {
959 // Pass the session token
960 var sessionToken = getSessionToken(authOptions);
961
962 if (sessionToken) {
963 headers['X-LC-Session'] = sessionToken;
964 } else if (!AV._config.disableCurrentUser) {
965 return AV.User.currentAsync().then(function (currentUser) {
966 if (currentUser && currentUser._sessionToken) {
967 headers['X-LC-Session'] = currentUser._sessionToken;
968 }
969
970 return headers;
971 });
972 }
973
974 return headers;
975 });
976};
977
978var createApiUrl = function createApiUrl(_ref) {
979 var _ref$service = _ref.service,
980 service = _ref$service === void 0 ? 'api' : _ref$service,
981 _ref$version = _ref.version,
982 version = _ref$version === void 0 ? '1.1' : _ref$version,
983 path = _ref.path;
984 var apiURL = AV._config.serverURLs[service];
985 if (!apiURL) throw new Error("undefined server URL for ".concat(service));
986
987 if (apiURL.charAt(apiURL.length - 1) !== '/') {
988 apiURL += '/';
989 }
990
991 apiURL += version;
992
993 if (path) {
994 apiURL += path;
995 }
996
997 return apiURL;
998};
999/**
1000 * Low level REST API client. Call REST endpoints with authorization headers.
1001 * @function AV.request
1002 * @since 3.0.0
1003 * @param {Object} options
1004 * @param {String} options.method HTTP method
1005 * @param {String} options.path endpoint path, e.g. `/classes/Test/55759577e4b029ae6015ac20`
1006 * @param {Object} [options.query] query string dict
1007 * @param {Object} [options.data] HTTP body
1008 * @param {AuthOptions} [options.authOptions]
1009 * @param {String} [options.service = 'api']
1010 * @param {String} [options.version = '1.1']
1011 */
1012
1013
1014var request = function request(_ref2) {
1015 var service = _ref2.service,
1016 version = _ref2.version,
1017 method = _ref2.method,
1018 path = _ref2.path,
1019 query = _ref2.query,
1020 data = _ref2.data,
1021 authOptions = _ref2.authOptions,
1022 _ref2$signKey = _ref2.signKey,
1023 signKey = _ref2$signKey === void 0 ? true : _ref2$signKey;
1024
1025 if (!(AV.applicationId && (AV.applicationKey || AV.masterKey))) {
1026 throw new Error('Not initialized');
1027 }
1028
1029 if (AV._appRouter) {
1030 AV._appRouter.refresh();
1031 }
1032
1033 var timeout = AV._config.requestTimeout;
1034 var url = createApiUrl({
1035 service: service,
1036 path: path,
1037 version: version
1038 });
1039 return setHeaders(authOptions, signKey).then(function (headers) {
1040 return ajax({
1041 method: method,
1042 url: url,
1043 query: query,
1044 data: data,
1045 headers: headers,
1046 timeout: timeout
1047 }).catch(function (error) {
1048 var errorJSON = {
1049 code: error.code || -1,
1050 error: error.message || error.responseText
1051 };
1052
1053 if (error.response && error.response.code) {
1054 errorJSON = error.response;
1055 } else if (error.responseText) {
1056 try {
1057 errorJSON = JSON.parse(error.responseText);
1058 } catch (e) {// If we fail to parse the error text, that's okay.
1059 }
1060 }
1061
1062 errorJSON.rawMessage = errorJSON.rawMessage || errorJSON.error;
1063
1064 if (!AV._sharedConfig.keepErrorRawMessage) {
1065 var _context3, _context4;
1066
1067 errorJSON.error += (0, _concat.default)(_context3 = (0, _concat.default)(_context4 = " [".concat(error.statusCode || 'N/A', " ")).call(_context4, method, " ")).call(_context3, url, "]");
1068 } // Transform the error into an instance of AVError by trying to parse
1069 // the error string as JSON.
1070
1071
1072 var err = new AVError(errorJSON.code, errorJSON.error);
1073 delete errorJSON.error;
1074 throw _.extend(err, errorJSON);
1075 });
1076 });
1077}; // lagecy request
1078
1079
1080var _request = function _request(route, className, objectId, method, data, authOptions, query) {
1081 var path = '';
1082 if (route) path += "/".concat(route);
1083 if (className) path += "/".concat(className);
1084 if (objectId) path += "/".concat(objectId); // for migeration
1085
1086 if (data && data._fetchWhenSave) throw new Error('_fetchWhenSave should be in the query');
1087 if (data && data._where) throw new Error('_where should be in the query');
1088
1089 if (method && method.toLowerCase() === 'get') {
1090 query = extend({}, query, data);
1091 data = null;
1092 }
1093
1094 return request({
1095 method: method,
1096 path: path,
1097 query: query,
1098 data: data,
1099 authOptions: authOptions
1100 });
1101};
1102
1103AV.request = request;
1104module.exports = {
1105 _request: _request,
1106 request: request
1107};
1108
1109/***/ }),
1110/* 27 */
1111/***/ (function(module, __webpack_exports__, __webpack_require__) {
1112
1113"use strict";
1114/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
1115/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(5);
1116
1117
1118
1119var isFunction = Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Function');
1120
1121// Optimize `isFunction` if appropriate. Work around some `typeof` bugs in old
1122// v8, IE 11 (#1621), Safari 8 (#1929), and PhantomJS (#2236).
1123var nodelist = __WEBPACK_IMPORTED_MODULE_1__setup_js__["p" /* root */].document && __WEBPACK_IMPORTED_MODULE_1__setup_js__["p" /* root */].document.childNodes;
1124if (typeof /./ != 'function' && typeof Int8Array != 'object' && typeof nodelist != 'function') {
1125 isFunction = function(obj) {
1126 return typeof obj == 'function' || false;
1127 };
1128}
1129
1130/* harmony default export */ __webpack_exports__["a"] = (isFunction);
1131
1132
1133/***/ }),
1134/* 28 */
1135/***/ (function(module, __webpack_exports__, __webpack_require__) {
1136
1137"use strict";
1138/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__shallowProperty_js__ = __webpack_require__(179);
1139
1140
1141// Internal helper to obtain the `length` property of an object.
1142/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__shallowProperty_js__["a" /* default */])('length'));
1143
1144
1145/***/ }),
1146/* 29 */
1147/***/ (function(module, exports, __webpack_require__) {
1148
1149"use strict";
1150
1151
1152var _interopRequireDefault = __webpack_require__(1);
1153
1154var _keys = _interopRequireDefault(__webpack_require__(55));
1155
1156var _getPrototypeOf = _interopRequireDefault(__webpack_require__(142));
1157
1158var _promise = _interopRequireDefault(__webpack_require__(12));
1159
1160var _ = __webpack_require__(2); // Helper function to check null or undefined.
1161
1162
1163var isNullOrUndefined = function isNullOrUndefined(x) {
1164 return _.isNull(x) || _.isUndefined(x);
1165};
1166
1167var ensureArray = function ensureArray(target) {
1168 if (_.isArray(target)) {
1169 return target;
1170 }
1171
1172 if (target === undefined || target === null) {
1173 return [];
1174 }
1175
1176 return [target];
1177};
1178
1179var transformFetchOptions = function transformFetchOptions() {
1180 var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
1181 keys = (0, _keys.default)(_ref),
1182 include = _ref.include,
1183 includeACL = _ref.includeACL;
1184
1185 var fetchOptions = {};
1186
1187 if (keys) {
1188 fetchOptions.keys = ensureArray(keys).join(',');
1189 }
1190
1191 if (include) {
1192 fetchOptions.include = ensureArray(include).join(',');
1193 }
1194
1195 if (includeACL) {
1196 fetchOptions.returnACL = includeACL;
1197 }
1198
1199 return fetchOptions;
1200};
1201
1202var getSessionToken = function getSessionToken(authOptions) {
1203 if (authOptions.sessionToken) {
1204 return authOptions.sessionToken;
1205 }
1206
1207 if (authOptions.user && typeof authOptions.user.getSessionToken === 'function') {
1208 return authOptions.user.getSessionToken();
1209 }
1210};
1211
1212var tap = function tap(interceptor) {
1213 return function (value) {
1214 return interceptor(value), value;
1215 };
1216}; // Shared empty constructor function to aid in prototype-chain creation.
1217
1218
1219var EmptyConstructor = function EmptyConstructor() {}; // Helper function to correctly set up the prototype chain, for subclasses.
1220// Similar to `goog.inherits`, but uses a hash of prototype properties and
1221// class properties to be extended.
1222
1223
1224var inherits = function inherits(parent, protoProps, staticProps) {
1225 var child; // The constructor function for the new subclass is either defined by you
1226 // (the "constructor" property in your `extend` definition), or defaulted
1227 // by us to simply call the parent's constructor.
1228
1229 if (protoProps && protoProps.hasOwnProperty('constructor')) {
1230 child = protoProps.constructor;
1231 } else {
1232 /** @ignore */
1233 child = function child() {
1234 parent.apply(this, arguments);
1235 };
1236 } // Inherit class (static) properties from parent.
1237
1238
1239 _.extend(child, parent); // Set the prototype chain to inherit from `parent`, without calling
1240 // `parent`'s constructor function.
1241
1242
1243 EmptyConstructor.prototype = parent.prototype;
1244 child.prototype = new EmptyConstructor(); // Add prototype properties (instance properties) to the subclass,
1245 // if supplied.
1246
1247 if (protoProps) {
1248 _.extend(child.prototype, protoProps);
1249 } // Add static properties to the constructor function, if supplied.
1250
1251
1252 if (staticProps) {
1253 _.extend(child, staticProps);
1254 } // Correctly set child's `prototype.constructor`.
1255
1256
1257 child.prototype.constructor = child; // Set a convenience property in case the parent's prototype is
1258 // needed later.
1259
1260 child.__super__ = parent.prototype;
1261 return child;
1262};
1263
1264var parseDate = function parseDate(iso8601) {
1265 return new Date(iso8601);
1266};
1267
1268var setValue = function setValue(target, key, value) {
1269 // '.' is not allowed in Class keys, escaping is not in concern now.
1270 var segs = key.split('.');
1271 var lastSeg = segs.pop();
1272 var currentTarget = target;
1273 segs.forEach(function (seg) {
1274 if (currentTarget[seg] === undefined) currentTarget[seg] = {};
1275 currentTarget = currentTarget[seg];
1276 });
1277 currentTarget[lastSeg] = value;
1278 return target;
1279};
1280
1281var findValue = function findValue(target, key) {
1282 var segs = key.split('.');
1283 var firstSeg = segs[0];
1284 var lastSeg = segs.pop();
1285 var currentTarget = target;
1286
1287 for (var i = 0; i < segs.length; i++) {
1288 currentTarget = currentTarget[segs[i]];
1289
1290 if (currentTarget === undefined) {
1291 return [undefined, undefined, lastSeg];
1292 }
1293 }
1294
1295 var value = currentTarget[lastSeg];
1296 return [value, currentTarget, lastSeg, firstSeg];
1297};
1298
1299var isPlainObject = function isPlainObject(obj) {
1300 return _.isObject(obj) && (0, _getPrototypeOf.default)(obj) === Object.prototype;
1301};
1302
1303var continueWhile = function continueWhile(predicate, asyncFunction) {
1304 if (predicate()) {
1305 return asyncFunction().then(function () {
1306 return continueWhile(predicate, asyncFunction);
1307 });
1308 }
1309
1310 return _promise.default.resolve();
1311};
1312
1313module.exports = {
1314 isNullOrUndefined: isNullOrUndefined,
1315 ensureArray: ensureArray,
1316 transformFetchOptions: transformFetchOptions,
1317 getSessionToken: getSessionToken,
1318 tap: tap,
1319 inherits: inherits,
1320 parseDate: parseDate,
1321 setValue: setValue,
1322 findValue: findValue,
1323 isPlainObject: isPlainObject,
1324 continueWhile: continueWhile
1325};
1326
1327/***/ }),
1328/* 30 */
1329/***/ (function(module, exports, __webpack_require__) {
1330
1331module.exports = __webpack_require__(362);
1332
1333/***/ }),
1334/* 31 */
1335/***/ (function(module, exports, __webpack_require__) {
1336
1337var isCallable = __webpack_require__(7);
1338var tryToString = __webpack_require__(72);
1339
1340var $TypeError = TypeError;
1341
1342// `Assert: IsCallable(argument) is true`
1343module.exports = function (argument) {
1344 if (isCallable(argument)) return argument;
1345 throw $TypeError(tryToString(argument) + ' is not a function');
1346};
1347
1348
1349/***/ }),
1350/* 32 */
1351/***/ (function(module, exports) {
1352
1353module.exports = true;
1354
1355
1356/***/ }),
1357/* 33 */
1358/***/ (function(module, exports, __webpack_require__) {
1359
1360// toObject with fallback for non-array-like ES3 strings
1361var IndexedObject = __webpack_require__(114);
1362var requireObjectCoercible = __webpack_require__(115);
1363
1364module.exports = function (it) {
1365 return IndexedObject(requireObjectCoercible(it));
1366};
1367
1368
1369/***/ }),
1370/* 34 */
1371/***/ (function(module, exports, __webpack_require__) {
1372
1373var requireObjectCoercible = __webpack_require__(115);
1374
1375var $Object = Object;
1376
1377// `ToObject` abstract operation
1378// https://tc39.es/ecma262/#sec-toobject
1379module.exports = function (argument) {
1380 return $Object(requireObjectCoercible(argument));
1381};
1382
1383
1384/***/ }),
1385/* 35 */
1386/***/ (function(module, exports, __webpack_require__) {
1387
1388var DESCRIPTORS = __webpack_require__(16);
1389var definePropertyModule = __webpack_require__(22);
1390var createPropertyDescriptor = __webpack_require__(44);
1391
1392module.exports = DESCRIPTORS ? function (object, key, value) {
1393 return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));
1394} : function (object, key, value) {
1395 object[key] = value;
1396 return object;
1397};
1398
1399
1400/***/ }),
1401/* 36 */
1402/***/ (function(module, exports, __webpack_require__) {
1403
1404module.exports = __webpack_require__(374);
1405
1406/***/ }),
1407/* 37 */
1408/***/ (function(module, exports, __webpack_require__) {
1409
1410var bind = __webpack_require__(45);
1411var call = __webpack_require__(13);
1412var anObject = __webpack_require__(19);
1413var tryToString = __webpack_require__(72);
1414var isArrayIteratorMethod = __webpack_require__(156);
1415var lengthOfArrayLike = __webpack_require__(46);
1416var isPrototypeOf = __webpack_require__(21);
1417var getIterator = __webpack_require__(157);
1418var getIteratorMethod = __webpack_require__(99);
1419var iteratorClose = __webpack_require__(158);
1420
1421var $TypeError = TypeError;
1422
1423var Result = function (stopped, result) {
1424 this.stopped = stopped;
1425 this.result = result;
1426};
1427
1428var ResultPrototype = Result.prototype;
1429
1430module.exports = function (iterable, unboundFunction, options) {
1431 var that = options && options.that;
1432 var AS_ENTRIES = !!(options && options.AS_ENTRIES);
1433 var IS_ITERATOR = !!(options && options.IS_ITERATOR);
1434 var INTERRUPTED = !!(options && options.INTERRUPTED);
1435 var fn = bind(unboundFunction, that);
1436 var iterator, iterFn, index, length, result, next, step;
1437
1438 var stop = function (condition) {
1439 if (iterator) iteratorClose(iterator, 'normal', condition);
1440 return new Result(true, condition);
1441 };
1442
1443 var callFn = function (value) {
1444 if (AS_ENTRIES) {
1445 anObject(value);
1446 return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
1447 } return INTERRUPTED ? fn(value, stop) : fn(value);
1448 };
1449
1450 if (IS_ITERATOR) {
1451 iterator = iterable;
1452 } else {
1453 iterFn = getIteratorMethod(iterable);
1454 if (!iterFn) throw $TypeError(tryToString(iterable) + ' is not iterable');
1455 // optimisation for array iterators
1456 if (isArrayIteratorMethod(iterFn)) {
1457 for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
1458 result = callFn(iterable[index]);
1459 if (result && isPrototypeOf(ResultPrototype, result)) return result;
1460 } return new Result(false);
1461 }
1462 iterator = getIterator(iterable, iterFn);
1463 }
1464
1465 next = iterator.next;
1466 while (!(step = call(next, iterator)).done) {
1467 try {
1468 result = callFn(step.value);
1469 } catch (error) {
1470 iteratorClose(iterator, 'throw', error);
1471 }
1472 if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;
1473 } return new Result(false);
1474};
1475
1476
1477/***/ }),
1478/* 38 */
1479/***/ (function(module, exports, __webpack_require__) {
1480
1481var NATIVE_WEAK_MAP = __webpack_require__(160);
1482var global = __webpack_require__(6);
1483var uncurryThis = __webpack_require__(4);
1484var isObject = __webpack_require__(11);
1485var createNonEnumerableProperty = __webpack_require__(35);
1486var hasOwn = __webpack_require__(14);
1487var shared = __webpack_require__(117);
1488var sharedKey = __webpack_require__(94);
1489var hiddenKeys = __webpack_require__(74);
1490
1491var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
1492var TypeError = global.TypeError;
1493var WeakMap = global.WeakMap;
1494var set, get, has;
1495
1496var enforce = function (it) {
1497 return has(it) ? get(it) : set(it, {});
1498};
1499
1500var getterFor = function (TYPE) {
1501 return function (it) {
1502 var state;
1503 if (!isObject(it) || (state = get(it)).type !== TYPE) {
1504 throw TypeError('Incompatible receiver, ' + TYPE + ' required');
1505 } return state;
1506 };
1507};
1508
1509if (NATIVE_WEAK_MAP || shared.state) {
1510 var store = shared.state || (shared.state = new WeakMap());
1511 var wmget = uncurryThis(store.get);
1512 var wmhas = uncurryThis(store.has);
1513 var wmset = uncurryThis(store.set);
1514 set = function (it, metadata) {
1515 if (wmhas(store, it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
1516 metadata.facade = it;
1517 wmset(store, it, metadata);
1518 return metadata;
1519 };
1520 get = function (it) {
1521 return wmget(store, it) || {};
1522 };
1523 has = function (it) {
1524 return wmhas(store, it);
1525 };
1526} else {
1527 var STATE = sharedKey('state');
1528 hiddenKeys[STATE] = true;
1529 set = function (it, metadata) {
1530 if (hasOwn(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
1531 metadata.facade = it;
1532 createNonEnumerableProperty(it, STATE, metadata);
1533 return metadata;
1534 };
1535 get = function (it) {
1536 return hasOwn(it, STATE) ? it[STATE] : {};
1537 };
1538 has = function (it) {
1539 return hasOwn(it, STATE);
1540 };
1541}
1542
1543module.exports = {
1544 set: set,
1545 get: get,
1546 has: has,
1547 enforce: enforce,
1548 getterFor: getterFor
1549};
1550
1551
1552/***/ }),
1553/* 39 */
1554/***/ (function(module, exports, __webpack_require__) {
1555
1556var createNonEnumerableProperty = __webpack_require__(35);
1557
1558module.exports = function (target, key, value, options) {
1559 if (options && options.enumerable) target[key] = value;
1560 else createNonEnumerableProperty(target, key, value);
1561 return target;
1562};
1563
1564
1565/***/ }),
1566/* 40 */
1567/***/ (function(module, __webpack_exports__, __webpack_require__) {
1568
1569"use strict";
1570/* harmony export (immutable) */ __webpack_exports__["a"] = has;
1571/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
1572
1573
1574// Internal function to check whether `key` is an own property name of `obj`.
1575function has(obj, key) {
1576 return obj != null && __WEBPACK_IMPORTED_MODULE_0__setup_js__["i" /* hasOwnProperty */].call(obj, key);
1577}
1578
1579
1580/***/ }),
1581/* 41 */
1582/***/ (function(module, exports, __webpack_require__) {
1583
1584var path = __webpack_require__(10);
1585
1586module.exports = function (CONSTRUCTOR) {
1587 return path[CONSTRUCTOR + 'Prototype'];
1588};
1589
1590
1591/***/ }),
1592/* 42 */
1593/***/ (function(module, exports, __webpack_require__) {
1594
1595module.exports = __webpack_require__(367);
1596
1597/***/ }),
1598/* 43 */
1599/***/ (function(module, exports, __webpack_require__) {
1600
1601"use strict";
1602
1603
1604var _interopRequireDefault = __webpack_require__(1);
1605
1606var _setPrototypeOf = _interopRequireDefault(__webpack_require__(227));
1607
1608var _getPrototypeOf = _interopRequireDefault(__webpack_require__(142));
1609
1610var _ = __webpack_require__(2);
1611/**
1612 * @class AV.Error
1613 */
1614
1615
1616function AVError(code, message) {
1617 if (this instanceof AVError ? this.constructor : void 0) {
1618 var error = new Error(message);
1619 (0, _setPrototypeOf.default)(error, (0, _getPrototypeOf.default)(this));
1620 error.code = code;
1621 return error;
1622 }
1623
1624 return new AVError(code, message);
1625}
1626
1627AVError.prototype = Object.create(Error.prototype, {
1628 constructor: {
1629 value: Error,
1630 enumerable: false,
1631 writable: true,
1632 configurable: true
1633 }
1634});
1635(0, _setPrototypeOf.default)(AVError, Error);
1636
1637_.extend(AVError,
1638/** @lends AV.Error */
1639{
1640 /**
1641 * Error code indicating some error other than those enumerated here.
1642 * @constant
1643 */
1644 OTHER_CAUSE: -1,
1645
1646 /**
1647 * Error code indicating that something has gone wrong with the server.
1648 * If you get this error code, it is AV's fault.
1649 * @constant
1650 */
1651 INTERNAL_SERVER_ERROR: 1,
1652
1653 /**
1654 * Error code indicating the connection to the AV servers failed.
1655 * @constant
1656 */
1657 CONNECTION_FAILED: 100,
1658
1659 /**
1660 * Error code indicating the specified object doesn't exist.
1661 * @constant
1662 */
1663 OBJECT_NOT_FOUND: 101,
1664
1665 /**
1666 * Error code indicating you tried to query with a datatype that doesn't
1667 * support it, like exact matching an array or object.
1668 * @constant
1669 */
1670 INVALID_QUERY: 102,
1671
1672 /**
1673 * Error code indicating a missing or invalid classname. Classnames are
1674 * case-sensitive. They must start with a letter, and a-zA-Z0-9_ are the
1675 * only valid characters.
1676 * @constant
1677 */
1678 INVALID_CLASS_NAME: 103,
1679
1680 /**
1681 * Error code indicating an unspecified object id.
1682 * @constant
1683 */
1684 MISSING_OBJECT_ID: 104,
1685
1686 /**
1687 * Error code indicating an invalid key name. Keys are case-sensitive. They
1688 * must start with a letter, and a-zA-Z0-9_ are the only valid characters.
1689 * @constant
1690 */
1691 INVALID_KEY_NAME: 105,
1692
1693 /**
1694 * Error code indicating a malformed pointer. You should not see this unless
1695 * you have been mucking about changing internal AV code.
1696 * @constant
1697 */
1698 INVALID_POINTER: 106,
1699
1700 /**
1701 * Error code indicating that badly formed JSON was received upstream. This
1702 * either indicates you have done something unusual with modifying how
1703 * things encode to JSON, or the network is failing badly.
1704 * @constant
1705 */
1706 INVALID_JSON: 107,
1707
1708 /**
1709 * Error code indicating that the feature you tried to access is only
1710 * available internally for testing purposes.
1711 * @constant
1712 */
1713 COMMAND_UNAVAILABLE: 108,
1714
1715 /**
1716 * You must call AV.initialize before using the AV library.
1717 * @constant
1718 */
1719 NOT_INITIALIZED: 109,
1720
1721 /**
1722 * Error code indicating that a field was set to an inconsistent type.
1723 * @constant
1724 */
1725 INCORRECT_TYPE: 111,
1726
1727 /**
1728 * Error code indicating an invalid channel name. A channel name is either
1729 * an empty string (the broadcast channel) or contains only a-zA-Z0-9_
1730 * characters.
1731 * @constant
1732 */
1733 INVALID_CHANNEL_NAME: 112,
1734
1735 /**
1736 * Error code indicating that push is misconfigured.
1737 * @constant
1738 */
1739 PUSH_MISCONFIGURED: 115,
1740
1741 /**
1742 * Error code indicating that the object is too large.
1743 * @constant
1744 */
1745 OBJECT_TOO_LARGE: 116,
1746
1747 /**
1748 * Error code indicating that the operation isn't allowed for clients.
1749 * @constant
1750 */
1751 OPERATION_FORBIDDEN: 119,
1752
1753 /**
1754 * Error code indicating the result was not found in the cache.
1755 * @constant
1756 */
1757 CACHE_MISS: 120,
1758
1759 /**
1760 * Error code indicating that an invalid key was used in a nested
1761 * JSONObject.
1762 * @constant
1763 */
1764 INVALID_NESTED_KEY: 121,
1765
1766 /**
1767 * Error code indicating that an invalid filename was used for AVFile.
1768 * A valid file name contains only a-zA-Z0-9_. characters and is between 1
1769 * and 128 characters.
1770 * @constant
1771 */
1772 INVALID_FILE_NAME: 122,
1773
1774 /**
1775 * Error code indicating an invalid ACL was provided.
1776 * @constant
1777 */
1778 INVALID_ACL: 123,
1779
1780 /**
1781 * Error code indicating that the request timed out on the server. Typically
1782 * this indicates that the request is too expensive to run.
1783 * @constant
1784 */
1785 TIMEOUT: 124,
1786
1787 /**
1788 * Error code indicating that the email address was invalid.
1789 * @constant
1790 */
1791 INVALID_EMAIL_ADDRESS: 125,
1792
1793 /**
1794 * Error code indicating a missing content type.
1795 * @constant
1796 */
1797 MISSING_CONTENT_TYPE: 126,
1798
1799 /**
1800 * Error code indicating a missing content length.
1801 * @constant
1802 */
1803 MISSING_CONTENT_LENGTH: 127,
1804
1805 /**
1806 * Error code indicating an invalid content length.
1807 * @constant
1808 */
1809 INVALID_CONTENT_LENGTH: 128,
1810
1811 /**
1812 * Error code indicating a file that was too large.
1813 * @constant
1814 */
1815 FILE_TOO_LARGE: 129,
1816
1817 /**
1818 * Error code indicating an error saving a file.
1819 * @constant
1820 */
1821 FILE_SAVE_ERROR: 130,
1822
1823 /**
1824 * Error code indicating an error deleting a file.
1825 * @constant
1826 */
1827 FILE_DELETE_ERROR: 153,
1828
1829 /**
1830 * Error code indicating that a unique field was given a value that is
1831 * already taken.
1832 * @constant
1833 */
1834 DUPLICATE_VALUE: 137,
1835
1836 /**
1837 * Error code indicating that a role's name is invalid.
1838 * @constant
1839 */
1840 INVALID_ROLE_NAME: 139,
1841
1842 /**
1843 * Error code indicating that an application quota was exceeded. Upgrade to
1844 * resolve.
1845 * @constant
1846 */
1847 EXCEEDED_QUOTA: 140,
1848
1849 /**
1850 * Error code indicating that a Cloud Code script failed.
1851 * @constant
1852 */
1853 SCRIPT_FAILED: 141,
1854
1855 /**
1856 * Error code indicating that a Cloud Code validation failed.
1857 * @constant
1858 */
1859 VALIDATION_ERROR: 142,
1860
1861 /**
1862 * Error code indicating that invalid image data was provided.
1863 * @constant
1864 */
1865 INVALID_IMAGE_DATA: 150,
1866
1867 /**
1868 * Error code indicating an unsaved file.
1869 * @constant
1870 */
1871 UNSAVED_FILE_ERROR: 151,
1872
1873 /**
1874 * Error code indicating an invalid push time.
1875 * @constant
1876 */
1877 INVALID_PUSH_TIME_ERROR: 152,
1878
1879 /**
1880 * Error code indicating that the username is missing or empty.
1881 * @constant
1882 */
1883 USERNAME_MISSING: 200,
1884
1885 /**
1886 * Error code indicating that the password is missing or empty.
1887 * @constant
1888 */
1889 PASSWORD_MISSING: 201,
1890
1891 /**
1892 * Error code indicating that the username has already been taken.
1893 * @constant
1894 */
1895 USERNAME_TAKEN: 202,
1896
1897 /**
1898 * Error code indicating that the email has already been taken.
1899 * @constant
1900 */
1901 EMAIL_TAKEN: 203,
1902
1903 /**
1904 * Error code indicating that the email is missing, but must be specified.
1905 * @constant
1906 */
1907 EMAIL_MISSING: 204,
1908
1909 /**
1910 * Error code indicating that a user with the specified email was not found.
1911 * @constant
1912 */
1913 EMAIL_NOT_FOUND: 205,
1914
1915 /**
1916 * Error code indicating that a user object without a valid session could
1917 * not be altered.
1918 * @constant
1919 */
1920 SESSION_MISSING: 206,
1921
1922 /**
1923 * Error code indicating that a user can only be created through signup.
1924 * @constant
1925 */
1926 MUST_CREATE_USER_THROUGH_SIGNUP: 207,
1927
1928 /**
1929 * Error code indicating that an an account being linked is already linked
1930 * to another user.
1931 * @constant
1932 */
1933 ACCOUNT_ALREADY_LINKED: 208,
1934
1935 /**
1936 * Error code indicating that a user cannot be linked to an account because
1937 * that account's id could not be found.
1938 * @constant
1939 */
1940 LINKED_ID_MISSING: 250,
1941
1942 /**
1943 * Error code indicating that a user with a linked (e.g. Facebook) account
1944 * has an invalid session.
1945 * @constant
1946 */
1947 INVALID_LINKED_SESSION: 251,
1948
1949 /**
1950 * Error code indicating that a service being linked (e.g. Facebook or
1951 * Twitter) is unsupported.
1952 * @constant
1953 */
1954 UNSUPPORTED_SERVICE: 252,
1955
1956 /**
1957 * Error code indicating a real error code is unavailable because
1958 * we had to use an XDomainRequest object to allow CORS requests in
1959 * Internet Explorer, which strips the body from HTTP responses that have
1960 * a non-2XX status code.
1961 * @constant
1962 */
1963 X_DOMAIN_REQUEST: 602
1964});
1965
1966module.exports = AVError;
1967
1968/***/ }),
1969/* 44 */
1970/***/ (function(module, exports) {
1971
1972module.exports = function (bitmap, value) {
1973 return {
1974 enumerable: !(bitmap & 1),
1975 configurable: !(bitmap & 2),
1976 writable: !(bitmap & 4),
1977 value: value
1978 };
1979};
1980
1981
1982/***/ }),
1983/* 45 */
1984/***/ (function(module, exports, __webpack_require__) {
1985
1986var uncurryThis = __webpack_require__(4);
1987var aCallable = __webpack_require__(31);
1988var NATIVE_BIND = __webpack_require__(70);
1989
1990var bind = uncurryThis(uncurryThis.bind);
1991
1992// optional / simple context binding
1993module.exports = function (fn, that) {
1994 aCallable(fn);
1995 return that === undefined ? fn : NATIVE_BIND ? bind(fn, that) : function (/* ...args */) {
1996 return fn.apply(that, arguments);
1997 };
1998};
1999
2000
2001/***/ }),
2002/* 46 */
2003/***/ (function(module, exports, __webpack_require__) {
2004
2005var toLength = __webpack_require__(263);
2006
2007// `LengthOfArrayLike` abstract operation
2008// https://tc39.es/ecma262/#sec-lengthofarraylike
2009module.exports = function (obj) {
2010 return toLength(obj.length);
2011};
2012
2013
2014/***/ }),
2015/* 47 */
2016/***/ (function(module, exports, __webpack_require__) {
2017
2018/* global ActiveXObject -- old IE, WSH */
2019var anObject = __webpack_require__(19);
2020var definePropertiesModule = __webpack_require__(154);
2021var enumBugKeys = __webpack_require__(121);
2022var hiddenKeys = __webpack_require__(74);
2023var html = __webpack_require__(155);
2024var documentCreateElement = __webpack_require__(118);
2025var sharedKey = __webpack_require__(94);
2026
2027var GT = '>';
2028var LT = '<';
2029var PROTOTYPE = 'prototype';
2030var SCRIPT = 'script';
2031var IE_PROTO = sharedKey('IE_PROTO');
2032
2033var EmptyConstructor = function () { /* empty */ };
2034
2035var scriptTag = function (content) {
2036 return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
2037};
2038
2039// Create object with fake `null` prototype: use ActiveX Object with cleared prototype
2040var NullProtoObjectViaActiveX = function (activeXDocument) {
2041 activeXDocument.write(scriptTag(''));
2042 activeXDocument.close();
2043 var temp = activeXDocument.parentWindow.Object;
2044 activeXDocument = null; // avoid memory leak
2045 return temp;
2046};
2047
2048// Create object with fake `null` prototype: use iframe Object with cleared prototype
2049var NullProtoObjectViaIFrame = function () {
2050 // Thrash, waste and sodomy: IE GC bug
2051 var iframe = documentCreateElement('iframe');
2052 var JS = 'java' + SCRIPT + ':';
2053 var iframeDocument;
2054 iframe.style.display = 'none';
2055 html.appendChild(iframe);
2056 // https://github.com/zloirock/core-js/issues/475
2057 iframe.src = String(JS);
2058 iframeDocument = iframe.contentWindow.document;
2059 iframeDocument.open();
2060 iframeDocument.write(scriptTag('document.F=Object'));
2061 iframeDocument.close();
2062 return iframeDocument.F;
2063};
2064
2065// Check for document.domain and active x support
2066// No need to use active x approach when document.domain is not set
2067// see https://github.com/es-shims/es5-shim/issues/150
2068// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
2069// avoid IE GC bug
2070var activeXDocument;
2071var NullProtoObject = function () {
2072 try {
2073 activeXDocument = new ActiveXObject('htmlfile');
2074 } catch (error) { /* ignore */ }
2075 NullProtoObject = typeof document != 'undefined'
2076 ? document.domain && activeXDocument
2077 ? NullProtoObjectViaActiveX(activeXDocument) // old IE
2078 : NullProtoObjectViaIFrame()
2079 : NullProtoObjectViaActiveX(activeXDocument); // WSH
2080 var length = enumBugKeys.length;
2081 while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
2082 return NullProtoObject();
2083};
2084
2085hiddenKeys[IE_PROTO] = true;
2086
2087// `Object.create` method
2088// https://tc39.es/ecma262/#sec-object.create
2089// eslint-disable-next-line es-x/no-object-create -- safe
2090module.exports = Object.create || function create(O, Properties) {
2091 var result;
2092 if (O !== null) {
2093 EmptyConstructor[PROTOTYPE] = anObject(O);
2094 result = new EmptyConstructor();
2095 EmptyConstructor[PROTOTYPE] = null;
2096 // add "__proto__" for Object.getPrototypeOf polyfill
2097 result[IE_PROTO] = O;
2098 } else result = NullProtoObject();
2099 return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
2100};
2101
2102
2103/***/ }),
2104/* 48 */
2105/***/ (function(module, exports, __webpack_require__) {
2106
2107"use strict";
2108
2109var toIndexedObject = __webpack_require__(33);
2110var addToUnscopables = __webpack_require__(159);
2111var Iterators = __webpack_require__(58);
2112var InternalStateModule = __webpack_require__(38);
2113var defineProperty = __webpack_require__(22).f;
2114var defineIterator = __webpack_require__(124);
2115var IS_PURE = __webpack_require__(32);
2116var DESCRIPTORS = __webpack_require__(16);
2117
2118var ARRAY_ITERATOR = 'Array Iterator';
2119var setInternalState = InternalStateModule.set;
2120var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
2121
2122// `Array.prototype.entries` method
2123// https://tc39.es/ecma262/#sec-array.prototype.entries
2124// `Array.prototype.keys` method
2125// https://tc39.es/ecma262/#sec-array.prototype.keys
2126// `Array.prototype.values` method
2127// https://tc39.es/ecma262/#sec-array.prototype.values
2128// `Array.prototype[@@iterator]` method
2129// https://tc39.es/ecma262/#sec-array.prototype-@@iterator
2130// `CreateArrayIterator` internal method
2131// https://tc39.es/ecma262/#sec-createarrayiterator
2132module.exports = defineIterator(Array, 'Array', function (iterated, kind) {
2133 setInternalState(this, {
2134 type: ARRAY_ITERATOR,
2135 target: toIndexedObject(iterated), // target
2136 index: 0, // next index
2137 kind: kind // kind
2138 });
2139// `%ArrayIteratorPrototype%.next` method
2140// https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
2141}, function () {
2142 var state = getInternalState(this);
2143 var target = state.target;
2144 var kind = state.kind;
2145 var index = state.index++;
2146 if (!target || index >= target.length) {
2147 state.target = undefined;
2148 return { value: undefined, done: true };
2149 }
2150 if (kind == 'keys') return { value: index, done: false };
2151 if (kind == 'values') return { value: target[index], done: false };
2152 return { value: [index, target[index]], done: false };
2153}, 'values');
2154
2155// argumentsList[@@iterator] is %ArrayProto_values%
2156// https://tc39.es/ecma262/#sec-createunmappedargumentsobject
2157// https://tc39.es/ecma262/#sec-createmappedargumentsobject
2158var values = Iterators.Arguments = Iterators.Array;
2159
2160// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
2161addToUnscopables('keys');
2162addToUnscopables('values');
2163addToUnscopables('entries');
2164
2165// V8 ~ Chrome 45- bug
2166if (!IS_PURE && DESCRIPTORS && values.name !== 'values') try {
2167 defineProperty(values, 'name', { value: 'values' });
2168} catch (error) { /* empty */ }
2169
2170
2171/***/ }),
2172/* 49 */
2173/***/ (function(module, exports, __webpack_require__) {
2174
2175var TO_STRING_TAG_SUPPORT = __webpack_require__(122);
2176var defineProperty = __webpack_require__(22).f;
2177var createNonEnumerableProperty = __webpack_require__(35);
2178var hasOwn = __webpack_require__(14);
2179var toString = __webpack_require__(270);
2180var wellKnownSymbol = __webpack_require__(9);
2181
2182var TO_STRING_TAG = wellKnownSymbol('toStringTag');
2183
2184module.exports = function (it, TAG, STATIC, SET_METHOD) {
2185 if (it) {
2186 var target = STATIC ? it : it.prototype;
2187 if (!hasOwn(target, TO_STRING_TAG)) {
2188 defineProperty(target, TO_STRING_TAG, { configurable: true, value: TAG });
2189 }
2190 if (SET_METHOD && !TO_STRING_TAG_SUPPORT) {
2191 createNonEnumerableProperty(target, 'toString', toString);
2192 }
2193 }
2194};
2195
2196
2197/***/ }),
2198/* 50 */
2199/***/ (function(module, exports, __webpack_require__) {
2200
2201"use strict";
2202
2203var aCallable = __webpack_require__(31);
2204
2205var PromiseCapability = function (C) {
2206 var resolve, reject;
2207 this.promise = new C(function ($$resolve, $$reject) {
2208 if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
2209 resolve = $$resolve;
2210 reject = $$reject;
2211 });
2212 this.resolve = aCallable(resolve);
2213 this.reject = aCallable(reject);
2214};
2215
2216// `NewPromiseCapability` abstract operation
2217// https://tc39.es/ecma262/#sec-newpromisecapability
2218module.exports.f = function (C) {
2219 return new PromiseCapability(C);
2220};
2221
2222
2223/***/ }),
2224/* 51 */
2225/***/ (function(module, exports, __webpack_require__) {
2226
2227__webpack_require__(48);
2228var DOMIterables = __webpack_require__(289);
2229var global = __webpack_require__(6);
2230var classof = __webpack_require__(59);
2231var createNonEnumerableProperty = __webpack_require__(35);
2232var Iterators = __webpack_require__(58);
2233var wellKnownSymbol = __webpack_require__(9);
2234
2235var TO_STRING_TAG = wellKnownSymbol('toStringTag');
2236
2237for (var COLLECTION_NAME in DOMIterables) {
2238 var Collection = global[COLLECTION_NAME];
2239 var CollectionPrototype = Collection && Collection.prototype;
2240 if (CollectionPrototype && classof(CollectionPrototype) !== TO_STRING_TAG) {
2241 createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);
2242 }
2243 Iterators[COLLECTION_NAME] = Iterators.Array;
2244}
2245
2246
2247/***/ }),
2248/* 52 */
2249/***/ (function(module, __webpack_exports__, __webpack_require__) {
2250
2251"use strict";
2252/* harmony export (immutable) */ __webpack_exports__["a"] = isObject;
2253// Is a given variable an object?
2254function isObject(obj) {
2255 var type = typeof obj;
2256 return type === 'function' || type === 'object' && !!obj;
2257}
2258
2259
2260/***/ }),
2261/* 53 */
2262/***/ (function(module, __webpack_exports__, __webpack_require__) {
2263
2264"use strict";
2265/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
2266/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__tagTester_js__ = __webpack_require__(17);
2267
2268
2269
2270// Is a given value an array?
2271// Delegates to ECMA5's native `Array.isArray`.
2272/* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0__setup_js__["k" /* nativeIsArray */] || Object(__WEBPACK_IMPORTED_MODULE_1__tagTester_js__["a" /* default */])('Array'));
2273
2274
2275/***/ }),
2276/* 54 */
2277/***/ (function(module, __webpack_exports__, __webpack_require__) {
2278
2279"use strict";
2280/* harmony export (immutable) */ __webpack_exports__["a"] = each;
2281/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__optimizeCb_js__ = __webpack_require__(82);
2282/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__ = __webpack_require__(25);
2283/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__keys_js__ = __webpack_require__(15);
2284
2285
2286
2287
2288// The cornerstone for collection functions, an `each`
2289// implementation, aka `forEach`.
2290// Handles raw objects in addition to array-likes. Treats all
2291// sparse array-likes as if they were dense.
2292function each(obj, iteratee, context) {
2293 iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__optimizeCb_js__["a" /* default */])(iteratee, context);
2294 var i, length;
2295 if (Object(__WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__["a" /* default */])(obj)) {
2296 for (i = 0, length = obj.length; i < length; i++) {
2297 iteratee(obj[i], i, obj);
2298 }
2299 } else {
2300 var _keys = Object(__WEBPACK_IMPORTED_MODULE_2__keys_js__["a" /* default */])(obj);
2301 for (i = 0, length = _keys.length; i < length; i++) {
2302 iteratee(obj[_keys[i]], _keys[i], obj);
2303 }
2304 }
2305 return obj;
2306}
2307
2308
2309/***/ }),
2310/* 55 */
2311/***/ (function(module, exports, __webpack_require__) {
2312
2313module.exports = __webpack_require__(381);
2314
2315/***/ }),
2316/* 56 */
2317/***/ (function(module, exports, __webpack_require__) {
2318
2319var uncurryThis = __webpack_require__(4);
2320
2321var toString = uncurryThis({}.toString);
2322var stringSlice = uncurryThis(''.slice);
2323
2324module.exports = function (it) {
2325 return stringSlice(toString(it), 8, -1);
2326};
2327
2328
2329/***/ }),
2330/* 57 */
2331/***/ (function(module, exports, __webpack_require__) {
2332
2333/* eslint-disable es-x/no-symbol -- required for testing */
2334var V8_VERSION = __webpack_require__(90);
2335var fails = __webpack_require__(3);
2336
2337// eslint-disable-next-line es-x/no-object-getownpropertysymbols -- required for testing
2338module.exports = !!Object.getOwnPropertySymbols && !fails(function () {
2339 var symbol = Symbol();
2340 // Chrome 38 Symbol has incorrect toString conversion
2341 // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
2342 return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
2343 // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
2344 !Symbol.sham && V8_VERSION && V8_VERSION < 41;
2345});
2346
2347
2348/***/ }),
2349/* 58 */
2350/***/ (function(module, exports) {
2351
2352module.exports = {};
2353
2354
2355/***/ }),
2356/* 59 */
2357/***/ (function(module, exports, __webpack_require__) {
2358
2359var TO_STRING_TAG_SUPPORT = __webpack_require__(122);
2360var isCallable = __webpack_require__(7);
2361var classofRaw = __webpack_require__(56);
2362var wellKnownSymbol = __webpack_require__(9);
2363
2364var TO_STRING_TAG = wellKnownSymbol('toStringTag');
2365var $Object = Object;
2366
2367// ES3 wrong here
2368var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
2369
2370// fallback for IE11 Script Access Denied error
2371var tryGet = function (it, key) {
2372 try {
2373 return it[key];
2374 } catch (error) { /* empty */ }
2375};
2376
2377// getting tag from ES6+ `Object.prototype.toString`
2378module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
2379 var O, tag, result;
2380 return it === undefined ? 'Undefined' : it === null ? 'Null'
2381 // @@toStringTag case
2382 : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag
2383 // builtinTag case
2384 : CORRECT_ARGUMENTS ? classofRaw(O)
2385 // ES3 arguments fallback
2386 : (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;
2387};
2388
2389
2390/***/ }),
2391/* 60 */
2392/***/ (function(module, exports) {
2393
2394// empty
2395
2396
2397/***/ }),
2398/* 61 */
2399/***/ (function(module, exports, __webpack_require__) {
2400
2401var global = __webpack_require__(6);
2402
2403module.exports = global.Promise;
2404
2405
2406/***/ }),
2407/* 62 */
2408/***/ (function(module, __webpack_exports__, __webpack_require__) {
2409
2410"use strict";
2411/* harmony export (immutable) */ __webpack_exports__["a"] = values;
2412/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__keys_js__ = __webpack_require__(15);
2413
2414
2415// Retrieve the values of an object's properties.
2416function values(obj) {
2417 var _keys = Object(__WEBPACK_IMPORTED_MODULE_0__keys_js__["a" /* default */])(obj);
2418 var length = _keys.length;
2419 var values = Array(length);
2420 for (var i = 0; i < length; i++) {
2421 values[i] = obj[_keys[i]];
2422 }
2423 return values;
2424}
2425
2426
2427/***/ }),
2428/* 63 */
2429/***/ (function(module, __webpack_exports__, __webpack_require__) {
2430
2431"use strict";
2432/* harmony export (immutable) */ __webpack_exports__["a"] = flatten;
2433/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(28);
2434/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__ = __webpack_require__(25);
2435/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isArray_js__ = __webpack_require__(53);
2436/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isArguments_js__ = __webpack_require__(129);
2437
2438
2439
2440
2441
2442// Internal implementation of a recursive `flatten` function.
2443function flatten(input, depth, strict, output) {
2444 output = output || [];
2445 if (!depth && depth !== 0) {
2446 depth = Infinity;
2447 } else if (depth <= 0) {
2448 return output.concat(input);
2449 }
2450 var idx = output.length;
2451 for (var i = 0, length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(input); i < length; i++) {
2452 var value = input[i];
2453 if (Object(__WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__["a" /* default */])(value) && (Object(__WEBPACK_IMPORTED_MODULE_2__isArray_js__["a" /* default */])(value) || Object(__WEBPACK_IMPORTED_MODULE_3__isArguments_js__["a" /* default */])(value))) {
2454 // Flatten current level of array or arguments object.
2455 if (depth > 1) {
2456 flatten(value, depth - 1, strict, output);
2457 idx = output.length;
2458 } else {
2459 var j = 0, len = value.length;
2460 while (j < len) output[idx++] = value[j++];
2461 }
2462 } else if (!strict) {
2463 output[idx++] = value;
2464 }
2465 }
2466 return output;
2467}
2468
2469
2470/***/ }),
2471/* 64 */
2472/***/ (function(module, __webpack_exports__, __webpack_require__) {
2473
2474"use strict";
2475/* harmony export (immutable) */ __webpack_exports__["a"] = map;
2476/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(20);
2477/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__ = __webpack_require__(25);
2478/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__keys_js__ = __webpack_require__(15);
2479
2480
2481
2482
2483// Return the results of applying the iteratee to each element.
2484function map(obj, iteratee, context) {
2485 iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(iteratee, context);
2486 var _keys = !Object(__WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__["a" /* default */])(obj) && Object(__WEBPACK_IMPORTED_MODULE_2__keys_js__["a" /* default */])(obj),
2487 length = (_keys || obj).length,
2488 results = Array(length);
2489 for (var index = 0; index < length; index++) {
2490 var currentKey = _keys ? _keys[index] : index;
2491 results[index] = iteratee(obj[currentKey], currentKey, obj);
2492 }
2493 return results;
2494}
2495
2496
2497/***/ }),
2498/* 65 */
2499/***/ (function(module, exports, __webpack_require__) {
2500
2501"use strict";
2502/* WEBPACK VAR INJECTION */(function(global) {
2503
2504var _interopRequireDefault = __webpack_require__(1);
2505
2506var _promise = _interopRequireDefault(__webpack_require__(12));
2507
2508var _concat = _interopRequireDefault(__webpack_require__(30));
2509
2510var _map = _interopRequireDefault(__webpack_require__(42));
2511
2512var _keys = _interopRequireDefault(__webpack_require__(141));
2513
2514var _stringify = _interopRequireDefault(__webpack_require__(36));
2515
2516var _indexOf = _interopRequireDefault(__webpack_require__(86));
2517
2518var _keys2 = _interopRequireDefault(__webpack_require__(55));
2519
2520var _ = __webpack_require__(2);
2521
2522var uuid = __webpack_require__(221);
2523
2524var debug = __webpack_require__(67);
2525
2526var _require = __webpack_require__(29),
2527 inherits = _require.inherits,
2528 parseDate = _require.parseDate;
2529
2530var version = __webpack_require__(223);
2531
2532var _require2 = __webpack_require__(68),
2533 setAdapters = _require2.setAdapters,
2534 adapterManager = _require2.adapterManager;
2535
2536var AV = global.AV || {}; // All internal configuration items
2537
2538AV._config = {
2539 serverURLs: {},
2540 useMasterKey: false,
2541 production: null,
2542 realtime: null,
2543 requestTimeout: null
2544};
2545var initialUserAgent = "LeanCloud-JS-SDK/".concat(version); // configs shared by all AV instances
2546
2547AV._sharedConfig = {
2548 userAgent: initialUserAgent,
2549 liveQueryRealtime: null
2550};
2551adapterManager.on('platformInfo', function (platformInfo) {
2552 var ua = initialUserAgent;
2553
2554 if (platformInfo) {
2555 if (platformInfo.userAgent) {
2556 ua = platformInfo.userAgent;
2557 } else {
2558 var comments = platformInfo.name;
2559
2560 if (platformInfo.version) {
2561 comments += "/".concat(platformInfo.version);
2562 }
2563
2564 if (platformInfo.extra) {
2565 comments += "; ".concat(platformInfo.extra);
2566 }
2567
2568 ua += " (".concat(comments, ")");
2569 }
2570 }
2571
2572 AV._sharedConfig.userAgent = ua;
2573});
2574/**
2575 * Contains all AV API classes and functions.
2576 * @namespace AV
2577 */
2578
2579/**
2580 * Returns prefix for localStorage keys used by this instance of AV.
2581 * @param {String} path The relative suffix to append to it.
2582 * null or undefined is treated as the empty string.
2583 * @return {String} The full key name.
2584 * @private
2585 */
2586
2587AV._getAVPath = function (path) {
2588 if (!AV.applicationId) {
2589 throw new Error('You need to call AV.initialize before using AV.');
2590 }
2591
2592 if (!path) {
2593 path = '';
2594 }
2595
2596 if (!_.isString(path)) {
2597 throw new Error("Tried to get a localStorage path that wasn't a String.");
2598 }
2599
2600 if (path[0] === '/') {
2601 path = path.substring(1);
2602 }
2603
2604 return 'AV/' + AV.applicationId + '/' + path;
2605};
2606/**
2607 * Returns the unique string for this app on this machine.
2608 * Gets reset when localStorage is cleared.
2609 * @private
2610 */
2611
2612
2613AV._installationId = null;
2614
2615AV._getInstallationId = function () {
2616 // See if it's cached in RAM.
2617 if (AV._installationId) {
2618 return _promise.default.resolve(AV._installationId);
2619 } // Try to get it from localStorage.
2620
2621
2622 var path = AV._getAVPath('installationId');
2623
2624 return AV.localStorage.getItemAsync(path).then(function (_installationId) {
2625 AV._installationId = _installationId;
2626
2627 if (!AV._installationId) {
2628 // It wasn't in localStorage, so create a new one.
2629 AV._installationId = _installationId = uuid();
2630 return AV.localStorage.setItemAsync(path, _installationId).then(function () {
2631 return _installationId;
2632 });
2633 }
2634
2635 return _installationId;
2636 });
2637};
2638
2639AV._subscriptionId = null;
2640
2641AV._refreshSubscriptionId = function () {
2642 var path = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : AV._getAVPath('subscriptionId');
2643 var subscriptionId = AV._subscriptionId = uuid();
2644 return AV.localStorage.setItemAsync(path, subscriptionId).then(function () {
2645 return subscriptionId;
2646 });
2647};
2648
2649AV._getSubscriptionId = function () {
2650 // See if it's cached in RAM.
2651 if (AV._subscriptionId) {
2652 return _promise.default.resolve(AV._subscriptionId);
2653 } // Try to get it from localStorage.
2654
2655
2656 var path = AV._getAVPath('subscriptionId');
2657
2658 return AV.localStorage.getItemAsync(path).then(function (_subscriptionId) {
2659 AV._subscriptionId = _subscriptionId;
2660
2661 if (!AV._subscriptionId) {
2662 // It wasn't in localStorage, so create a new one.
2663 _subscriptionId = AV._refreshSubscriptionId(path);
2664 }
2665
2666 return _subscriptionId;
2667 });
2668};
2669
2670AV._parseDate = parseDate; // A self-propagating extend function.
2671
2672AV._extend = function (protoProps, classProps) {
2673 var child = inherits(this, protoProps, classProps);
2674 child.extend = this.extend;
2675 return child;
2676};
2677/**
2678 * Converts a value in a AV Object into the appropriate representation.
2679 * This is the JS equivalent of Java's AV.maybeReferenceAndEncode(Object)
2680 * if seenObjects is falsey. Otherwise any AV.Objects not in
2681 * seenObjects will be fully embedded rather than encoded
2682 * as a pointer. This array will be used to prevent going into an infinite
2683 * loop because we have circular references. If <seenObjects>
2684 * is set, then none of the AV Objects that are serialized can be dirty.
2685 * @private
2686 */
2687
2688
2689AV._encode = function (value, seenObjects, disallowObjects) {
2690 var full = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
2691
2692 if (value instanceof AV.Object) {
2693 if (disallowObjects) {
2694 throw new Error('AV.Objects not allowed here');
2695 }
2696
2697 if (!seenObjects || _.include(seenObjects, value) || !value._hasData) {
2698 return value._toPointer();
2699 }
2700
2701 return value._toFullJSON((0, _concat.default)(seenObjects).call(seenObjects, value), full);
2702 }
2703
2704 if (value instanceof AV.ACL) {
2705 return value.toJSON();
2706 }
2707
2708 if (_.isDate(value)) {
2709 return full ? {
2710 __type: 'Date',
2711 iso: value.toJSON()
2712 } : value.toJSON();
2713 }
2714
2715 if (value instanceof AV.GeoPoint) {
2716 return value.toJSON();
2717 }
2718
2719 if (_.isArray(value)) {
2720 return (0, _map.default)(_).call(_, value, function (x) {
2721 return AV._encode(x, seenObjects, disallowObjects, full);
2722 });
2723 }
2724
2725 if (_.isRegExp(value)) {
2726 return value.source;
2727 }
2728
2729 if (value instanceof AV.Relation) {
2730 return value.toJSON();
2731 }
2732
2733 if (value instanceof AV.Op) {
2734 return value.toJSON();
2735 }
2736
2737 if (value instanceof AV.File) {
2738 if (!value.url() && !value.id) {
2739 throw new Error('Tried to save an object containing an unsaved file.');
2740 }
2741
2742 return value._toFullJSON(seenObjects, full);
2743 }
2744
2745 if (_.isObject(value)) {
2746 return _.mapObject(value, function (v, k) {
2747 return AV._encode(v, seenObjects, disallowObjects, full);
2748 });
2749 }
2750
2751 return value;
2752};
2753/**
2754 * The inverse function of AV._encode.
2755 * @private
2756 */
2757
2758
2759AV._decode = function (value, key) {
2760 if (!_.isObject(value) || _.isDate(value)) {
2761 return value;
2762 }
2763
2764 if (_.isArray(value)) {
2765 return (0, _map.default)(_).call(_, value, function (v) {
2766 return AV._decode(v);
2767 });
2768 }
2769
2770 if (value instanceof AV.Object) {
2771 return value;
2772 }
2773
2774 if (value instanceof AV.File) {
2775 return value;
2776 }
2777
2778 if (value instanceof AV.Op) {
2779 return value;
2780 }
2781
2782 if (value instanceof AV.GeoPoint) {
2783 return value;
2784 }
2785
2786 if (value instanceof AV.ACL) {
2787 return value;
2788 }
2789
2790 if (key === 'ACL') {
2791 return new AV.ACL(value);
2792 }
2793
2794 if (value.__op) {
2795 return AV.Op._decode(value);
2796 }
2797
2798 var className;
2799
2800 if (value.__type === 'Pointer') {
2801 className = value.className;
2802
2803 var pointer = AV.Object._create(className);
2804
2805 if ((0, _keys.default)(value).length > 3) {
2806 var v = _.clone(value);
2807
2808 delete v.__type;
2809 delete v.className;
2810
2811 pointer._finishFetch(v, true);
2812 } else {
2813 pointer._finishFetch({
2814 objectId: value.objectId
2815 }, false);
2816 }
2817
2818 return pointer;
2819 }
2820
2821 if (value.__type === 'Object') {
2822 // It's an Object included in a query result.
2823 className = value.className;
2824
2825 var _v = _.clone(value);
2826
2827 delete _v.__type;
2828 delete _v.className;
2829
2830 var object = AV.Object._create(className);
2831
2832 object._finishFetch(_v, true);
2833
2834 return object;
2835 }
2836
2837 if (value.__type === 'Date') {
2838 return AV._parseDate(value.iso);
2839 }
2840
2841 if (value.__type === 'GeoPoint') {
2842 return new AV.GeoPoint({
2843 latitude: value.latitude,
2844 longitude: value.longitude
2845 });
2846 }
2847
2848 if (value.__type === 'Relation') {
2849 if (!key) throw new Error('key missing decoding a Relation');
2850 var relation = new AV.Relation(null, key);
2851 relation.targetClassName = value.className;
2852 return relation;
2853 }
2854
2855 if (value.__type === 'File') {
2856 var file = new AV.File(value.name);
2857
2858 var _v2 = _.clone(value);
2859
2860 delete _v2.__type;
2861
2862 file._finishFetch(_v2);
2863
2864 return file;
2865 }
2866
2867 return _.mapObject(value, AV._decode);
2868};
2869/**
2870 * The inverse function of {@link AV.Object#toFullJSON}.
2871 * @since 3.0.0
2872 * @method
2873 * @param {Object}
2874 * return {AV.Object|AV.File|any}
2875 */
2876
2877
2878AV.parseJSON = AV._decode;
2879/**
2880 * Similar to JSON.parse, except that AV internal types will be used if possible.
2881 * Inverse to {@link AV.stringify}
2882 * @since 3.14.0
2883 * @param {string} text the string to parse.
2884 * @return {AV.Object|AV.File|any}
2885 */
2886
2887AV.parse = function (text) {
2888 return AV.parseJSON(JSON.parse(text));
2889};
2890/**
2891 * Serialize a target containing AV.Object, similar to JSON.stringify.
2892 * Inverse to {@link AV.parse}
2893 * @since 3.14.0
2894 * @return {string}
2895 */
2896
2897
2898AV.stringify = function (target) {
2899 return (0, _stringify.default)(AV._encode(target, [], false, true));
2900};
2901
2902AV._encodeObjectOrArray = function (value) {
2903 var encodeAVObject = function encodeAVObject(object) {
2904 if (object && object._toFullJSON) {
2905 object = object._toFullJSON([]);
2906 }
2907
2908 return _.mapObject(object, function (value) {
2909 return AV._encode(value, []);
2910 });
2911 };
2912
2913 if (_.isArray(value)) {
2914 return (0, _map.default)(value).call(value, function (object) {
2915 return encodeAVObject(object);
2916 });
2917 } else {
2918 return encodeAVObject(value);
2919 }
2920};
2921
2922AV._arrayEach = _.each;
2923/**
2924 * Does a deep traversal of every item in object, calling func on every one.
2925 * @param {Object} object The object or array to traverse deeply.
2926 * @param {Function} func The function to call for every item. It will
2927 * be passed the item as an argument. If it returns a truthy value, that
2928 * value will replace the item in its parent container.
2929 * @returns {} the result of calling func on the top-level object itself.
2930 * @private
2931 */
2932
2933AV._traverse = function (object, func, seen) {
2934 if (object instanceof AV.Object) {
2935 seen = seen || [];
2936
2937 if ((0, _indexOf.default)(_).call(_, seen, object) >= 0) {
2938 // We've already visited this object in this call.
2939 return;
2940 }
2941
2942 seen.push(object);
2943
2944 AV._traverse(object.attributes, func, seen);
2945
2946 return func(object);
2947 }
2948
2949 if (object instanceof AV.Relation || object instanceof AV.File) {
2950 // Nothing needs to be done, but we don't want to recurse into the
2951 // object's parent infinitely, so we catch this case.
2952 return func(object);
2953 }
2954
2955 if (_.isArray(object)) {
2956 _.each(object, function (child, index) {
2957 var newChild = AV._traverse(child, func, seen);
2958
2959 if (newChild) {
2960 object[index] = newChild;
2961 }
2962 });
2963
2964 return func(object);
2965 }
2966
2967 if (_.isObject(object)) {
2968 AV._each(object, function (child, key) {
2969 var newChild = AV._traverse(child, func, seen);
2970
2971 if (newChild) {
2972 object[key] = newChild;
2973 }
2974 });
2975
2976 return func(object);
2977 }
2978
2979 return func(object);
2980};
2981/**
2982 * This is like _.each, except:
2983 * * it doesn't work for so-called array-like objects,
2984 * * it does work for dictionaries with a "length" attribute.
2985 * @private
2986 */
2987
2988
2989AV._objectEach = AV._each = function (obj, callback) {
2990 if (_.isObject(obj)) {
2991 _.each((0, _keys2.default)(_).call(_, obj), function (key) {
2992 callback(obj[key], key);
2993 });
2994 } else {
2995 _.each(obj, callback);
2996 }
2997};
2998/**
2999 * @namespace
3000 * @since 3.14.0
3001 */
3002
3003
3004AV.debug = {
3005 /**
3006 * Enable debug
3007 */
3008 enable: function enable() {
3009 var namespaces = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'leancloud*';
3010 return debug.enable(namespaces);
3011 },
3012
3013 /**
3014 * Disable debug
3015 */
3016 disable: debug.disable
3017};
3018/**
3019 * Specify Adapters
3020 * @since 4.4.0
3021 * @function
3022 * @param {Adapters} newAdapters See {@link https://url.leanapp.cn/adapter-type-definitions @leancloud/adapter-types} for detailed definitions.
3023 */
3024
3025AV.setAdapters = setAdapters;
3026module.exports = AV;
3027/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(112)))
3028
3029/***/ }),
3030/* 66 */
3031/***/ (function(module, exports, __webpack_require__) {
3032
3033var bind = __webpack_require__(45);
3034var uncurryThis = __webpack_require__(4);
3035var IndexedObject = __webpack_require__(114);
3036var toObject = __webpack_require__(34);
3037var lengthOfArrayLike = __webpack_require__(46);
3038var arraySpeciesCreate = __webpack_require__(219);
3039
3040var push = uncurryThis([].push);
3041
3042// `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation
3043var createMethod = function (TYPE) {
3044 var IS_MAP = TYPE == 1;
3045 var IS_FILTER = TYPE == 2;
3046 var IS_SOME = TYPE == 3;
3047 var IS_EVERY = TYPE == 4;
3048 var IS_FIND_INDEX = TYPE == 6;
3049 var IS_FILTER_REJECT = TYPE == 7;
3050 var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
3051 return function ($this, callbackfn, that, specificCreate) {
3052 var O = toObject($this);
3053 var self = IndexedObject(O);
3054 var boundFunction = bind(callbackfn, that);
3055 var length = lengthOfArrayLike(self);
3056 var index = 0;
3057 var create = specificCreate || arraySpeciesCreate;
3058 var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined;
3059 var value, result;
3060 for (;length > index; index++) if (NO_HOLES || index in self) {
3061 value = self[index];
3062 result = boundFunction(value, index, O);
3063 if (TYPE) {
3064 if (IS_MAP) target[index] = result; // map
3065 else if (result) switch (TYPE) {
3066 case 3: return true; // some
3067 case 5: return value; // find
3068 case 6: return index; // findIndex
3069 case 2: push(target, value); // filter
3070 } else switch (TYPE) {
3071 case 4: return false; // every
3072 case 7: push(target, value); // filterReject
3073 }
3074 }
3075 }
3076 return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
3077 };
3078};
3079
3080module.exports = {
3081 // `Array.prototype.forEach` method
3082 // https://tc39.es/ecma262/#sec-array.prototype.foreach
3083 forEach: createMethod(0),
3084 // `Array.prototype.map` method
3085 // https://tc39.es/ecma262/#sec-array.prototype.map
3086 map: createMethod(1),
3087 // `Array.prototype.filter` method
3088 // https://tc39.es/ecma262/#sec-array.prototype.filter
3089 filter: createMethod(2),
3090 // `Array.prototype.some` method
3091 // https://tc39.es/ecma262/#sec-array.prototype.some
3092 some: createMethod(3),
3093 // `Array.prototype.every` method
3094 // https://tc39.es/ecma262/#sec-array.prototype.every
3095 every: createMethod(4),
3096 // `Array.prototype.find` method
3097 // https://tc39.es/ecma262/#sec-array.prototype.find
3098 find: createMethod(5),
3099 // `Array.prototype.findIndex` method
3100 // https://tc39.es/ecma262/#sec-array.prototype.findIndex
3101 findIndex: createMethod(6),
3102 // `Array.prototype.filterReject` method
3103 // https://github.com/tc39/proposal-array-filtering
3104 filterReject: createMethod(7)
3105};
3106
3107
3108/***/ }),
3109/* 67 */
3110/***/ (function(module, exports, __webpack_require__) {
3111
3112"use strict";
3113
3114
3115function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
3116
3117/* eslint-env browser */
3118
3119/**
3120 * This is the web browser implementation of `debug()`.
3121 */
3122exports.log = log;
3123exports.formatArgs = formatArgs;
3124exports.save = save;
3125exports.load = load;
3126exports.useColors = useColors;
3127exports.storage = localstorage();
3128/**
3129 * Colors.
3130 */
3131
3132exports.colors = ['#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33'];
3133/**
3134 * Currently only WebKit-based Web Inspectors, Firefox >= v31,
3135 * and the Firebug extension (any Firefox version) are known
3136 * to support "%c" CSS customizations.
3137 *
3138 * TODO: add a `localStorage` variable to explicitly enable/disable colors
3139 */
3140// eslint-disable-next-line complexity
3141
3142function useColors() {
3143 // NB: In an Electron preload script, document will be defined but not fully
3144 // initialized. Since we know we're in Chrome, we'll just detect this case
3145 // explicitly
3146 if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
3147 return true;
3148 } // Internet Explorer and Edge do not support colors.
3149
3150
3151 if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
3152 return false;
3153 } // Is webkit? http://stackoverflow.com/a/16459606/376773
3154 // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
3155
3156
3157 return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
3158 typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
3159 // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
3160 typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
3161 typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
3162}
3163/**
3164 * Colorize log arguments if enabled.
3165 *
3166 * @api public
3167 */
3168
3169
3170function formatArgs(args) {
3171 args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff);
3172
3173 if (!this.useColors) {
3174 return;
3175 }
3176
3177 var c = 'color: ' + this.color;
3178 args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other
3179 // arguments passed either before or after the %c, so we need to
3180 // figure out the correct index to insert the CSS into
3181
3182 var index = 0;
3183 var lastC = 0;
3184 args[0].replace(/%[a-zA-Z%]/g, function (match) {
3185 if (match === '%%') {
3186 return;
3187 }
3188
3189 index++;
3190
3191 if (match === '%c') {
3192 // We only are interested in the *last* %c
3193 // (the user may have provided their own)
3194 lastC = index;
3195 }
3196 });
3197 args.splice(lastC, 0, c);
3198}
3199/**
3200 * Invokes `console.log()` when available.
3201 * No-op when `console.log` is not a "function".
3202 *
3203 * @api public
3204 */
3205
3206
3207function log() {
3208 var _console;
3209
3210 // This hackery is required for IE8/9, where
3211 // the `console.log` function doesn't have 'apply'
3212 return (typeof console === "undefined" ? "undefined" : _typeof(console)) === 'object' && console.log && (_console = console).log.apply(_console, arguments);
3213}
3214/**
3215 * Save `namespaces`.
3216 *
3217 * @param {String} namespaces
3218 * @api private
3219 */
3220
3221
3222function save(namespaces) {
3223 try {
3224 if (namespaces) {
3225 exports.storage.setItem('debug', namespaces);
3226 } else {
3227 exports.storage.removeItem('debug');
3228 }
3229 } catch (error) {// Swallow
3230 // XXX (@Qix-) should we be logging these?
3231 }
3232}
3233/**
3234 * Load `namespaces`.
3235 *
3236 * @return {String} returns the previously persisted debug modes
3237 * @api private
3238 */
3239
3240
3241function load() {
3242 var r;
3243
3244 try {
3245 r = exports.storage.getItem('debug');
3246 } catch (error) {} // Swallow
3247 // XXX (@Qix-) should we be logging these?
3248 // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
3249
3250
3251 if (!r && typeof process !== 'undefined' && 'env' in process) {
3252 r = process.env.DEBUG;
3253 }
3254
3255 return r;
3256}
3257/**
3258 * Localstorage attempts to return the localstorage.
3259 *
3260 * This is necessary because safari throws
3261 * when a user disables cookies/localstorage
3262 * and you attempt to access it.
3263 *
3264 * @return {LocalStorage}
3265 * @api private
3266 */
3267
3268
3269function localstorage() {
3270 try {
3271 // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
3272 // The Browser also has localStorage in the global context.
3273 return localStorage;
3274 } catch (error) {// Swallow
3275 // XXX (@Qix-) should we be logging these?
3276 }
3277}
3278
3279module.exports = __webpack_require__(386)(exports);
3280var formatters = module.exports.formatters;
3281/**
3282 * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
3283 */
3284
3285formatters.j = function (v) {
3286 try {
3287 return JSON.stringify(v);
3288 } catch (error) {
3289 return '[UnexpectedJSONParseError]: ' + error.message;
3290 }
3291};
3292
3293
3294
3295/***/ }),
3296/* 68 */
3297/***/ (function(module, exports, __webpack_require__) {
3298
3299"use strict";
3300
3301
3302var _interopRequireDefault = __webpack_require__(1);
3303
3304var _keys = _interopRequireDefault(__webpack_require__(55));
3305
3306var _ = __webpack_require__(2);
3307
3308var EventEmitter = __webpack_require__(224);
3309
3310var _require = __webpack_require__(29),
3311 inherits = _require.inherits;
3312
3313var AdapterManager = inherits(EventEmitter, {
3314 constructor: function constructor() {
3315 EventEmitter.apply(this);
3316 this._adapters = {};
3317 },
3318 getAdapter: function getAdapter(name) {
3319 var adapter = this._adapters[name];
3320
3321 if (adapter === undefined) {
3322 throw new Error("".concat(name, " adapter is not configured"));
3323 }
3324
3325 return adapter;
3326 },
3327 setAdapters: function setAdapters(newAdapters) {
3328 var _this = this;
3329
3330 _.extend(this._adapters, newAdapters);
3331
3332 (0, _keys.default)(_).call(_, newAdapters).forEach(function (name) {
3333 return _this.emit(name, newAdapters[name]);
3334 });
3335 }
3336});
3337var adapterManager = new AdapterManager();
3338module.exports = {
3339 getAdapter: adapterManager.getAdapter.bind(adapterManager),
3340 setAdapters: adapterManager.setAdapters.bind(adapterManager),
3341 adapterManager: adapterManager
3342};
3343
3344/***/ }),
3345/* 69 */
3346/***/ (function(module, exports, __webpack_require__) {
3347
3348var NATIVE_BIND = __webpack_require__(70);
3349
3350var FunctionPrototype = Function.prototype;
3351var apply = FunctionPrototype.apply;
3352var call = FunctionPrototype.call;
3353
3354// eslint-disable-next-line es-x/no-reflect -- safe
3355module.exports = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call.bind(apply) : function () {
3356 return call.apply(apply, arguments);
3357});
3358
3359
3360/***/ }),
3361/* 70 */
3362/***/ (function(module, exports, __webpack_require__) {
3363
3364var fails = __webpack_require__(3);
3365
3366module.exports = !fails(function () {
3367 // eslint-disable-next-line es-x/no-function-prototype-bind -- safe
3368 var test = (function () { /* empty */ }).bind();
3369 // eslint-disable-next-line no-prototype-builtins -- safe
3370 return typeof test != 'function' || test.hasOwnProperty('prototype');
3371});
3372
3373
3374/***/ }),
3375/* 71 */
3376/***/ (function(module, exports, __webpack_require__) {
3377
3378var DESCRIPTORS = __webpack_require__(16);
3379var call = __webpack_require__(13);
3380var propertyIsEnumerableModule = __webpack_require__(113);
3381var createPropertyDescriptor = __webpack_require__(44);
3382var toIndexedObject = __webpack_require__(33);
3383var toPropertyKey = __webpack_require__(88);
3384var hasOwn = __webpack_require__(14);
3385var IE8_DOM_DEFINE = __webpack_require__(148);
3386
3387// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
3388var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
3389
3390// `Object.getOwnPropertyDescriptor` method
3391// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
3392exports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
3393 O = toIndexedObject(O);
3394 P = toPropertyKey(P);
3395 if (IE8_DOM_DEFINE) try {
3396 return $getOwnPropertyDescriptor(O, P);
3397 } catch (error) { /* empty */ }
3398 if (hasOwn(O, P)) return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]);
3399};
3400
3401
3402/***/ }),
3403/* 72 */
3404/***/ (function(module, exports) {
3405
3406var $String = String;
3407
3408module.exports = function (argument) {
3409 try {
3410 return $String(argument);
3411 } catch (error) {
3412 return 'Object';
3413 }
3414};
3415
3416
3417/***/ }),
3418/* 73 */
3419/***/ (function(module, exports, __webpack_require__) {
3420
3421var IS_PURE = __webpack_require__(32);
3422var store = __webpack_require__(117);
3423
3424(module.exports = function (key, value) {
3425 return store[key] || (store[key] = value !== undefined ? value : {});
3426})('versions', []).push({
3427 version: '3.23.3',
3428 mode: IS_PURE ? 'pure' : 'global',
3429 copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
3430 license: 'https://github.com/zloirock/core-js/blob/v3.23.3/LICENSE',
3431 source: 'https://github.com/zloirock/core-js'
3432});
3433
3434
3435/***/ }),
3436/* 74 */
3437/***/ (function(module, exports) {
3438
3439module.exports = {};
3440
3441
3442/***/ }),
3443/* 75 */
3444/***/ (function(module, exports, __webpack_require__) {
3445
3446var classof = __webpack_require__(59);
3447
3448var $String = String;
3449
3450module.exports = function (argument) {
3451 if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
3452 return $String(argument);
3453};
3454
3455
3456/***/ }),
3457/* 76 */
3458/***/ (function(module, exports) {
3459
3460module.exports = function (exec) {
3461 try {
3462 return { error: false, value: exec() };
3463 } catch (error) {
3464 return { error: true, value: error };
3465 }
3466};
3467
3468
3469/***/ }),
3470/* 77 */
3471/***/ (function(module, exports, __webpack_require__) {
3472
3473var global = __webpack_require__(6);
3474var NativePromiseConstructor = __webpack_require__(61);
3475var isCallable = __webpack_require__(7);
3476var isForced = __webpack_require__(149);
3477var inspectSource = __webpack_require__(123);
3478var wellKnownSymbol = __webpack_require__(9);
3479var IS_BROWSER = __webpack_require__(279);
3480var IS_PURE = __webpack_require__(32);
3481var V8_VERSION = __webpack_require__(90);
3482
3483var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
3484var SPECIES = wellKnownSymbol('species');
3485var SUBCLASSING = false;
3486var NATIVE_PROMISE_REJECTION_EVENT = isCallable(global.PromiseRejectionEvent);
3487
3488var FORCED_PROMISE_CONSTRUCTOR = isForced('Promise', function () {
3489 var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(NativePromiseConstructor);
3490 var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(NativePromiseConstructor);
3491 // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
3492 // https://bugs.chromium.org/p/chromium/issues/detail?id=830565
3493 // We can't detect it synchronously, so just check versions
3494 if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true;
3495 // We need Promise#{ catch, finally } in the pure version for preventing prototype pollution
3496 if (IS_PURE && !(NativePromisePrototype['catch'] && NativePromisePrototype['finally'])) return true;
3497 // We can't use @@species feature detection in V8 since it causes
3498 // deoptimization and performance degradation
3499 // https://github.com/zloirock/core-js/issues/679
3500 if (V8_VERSION >= 51 && /native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) return false;
3501 // Detect correctness of subclassing with @@species support
3502 var promise = new NativePromiseConstructor(function (resolve) { resolve(1); });
3503 var FakePromise = function (exec) {
3504 exec(function () { /* empty */ }, function () { /* empty */ });
3505 };
3506 var constructor = promise.constructor = {};
3507 constructor[SPECIES] = FakePromise;
3508 SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise;
3509 if (!SUBCLASSING) return true;
3510 // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
3511 return !GLOBAL_CORE_JS_PROMISE && IS_BROWSER && !NATIVE_PROMISE_REJECTION_EVENT;
3512});
3513
3514module.exports = {
3515 CONSTRUCTOR: FORCED_PROMISE_CONSTRUCTOR,
3516 REJECTION_EVENT: NATIVE_PROMISE_REJECTION_EVENT,
3517 SUBCLASSING: SUBCLASSING
3518};
3519
3520
3521/***/ }),
3522/* 78 */
3523/***/ (function(module, exports, __webpack_require__) {
3524
3525"use strict";
3526
3527var charAt = __webpack_require__(288).charAt;
3528var toString = __webpack_require__(75);
3529var InternalStateModule = __webpack_require__(38);
3530var defineIterator = __webpack_require__(124);
3531
3532var STRING_ITERATOR = 'String Iterator';
3533var setInternalState = InternalStateModule.set;
3534var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR);
3535
3536// `String.prototype[@@iterator]` method
3537// https://tc39.es/ecma262/#sec-string.prototype-@@iterator
3538defineIterator(String, 'String', function (iterated) {
3539 setInternalState(this, {
3540 type: STRING_ITERATOR,
3541 string: toString(iterated),
3542 index: 0
3543 });
3544// `%StringIteratorPrototype%.next` method
3545// https://tc39.es/ecma262/#sec-%stringiteratorprototype%.next
3546}, function next() {
3547 var state = getInternalState(this);
3548 var string = state.string;
3549 var index = state.index;
3550 var point;
3551 if (index >= string.length) return { value: undefined, done: true };
3552 point = charAt(string, index);
3553 state.index += point.length;
3554 return { value: point, done: false };
3555});
3556
3557
3558/***/ }),
3559/* 79 */
3560/***/ (function(module, __webpack_exports__, __webpack_require__) {
3561
3562"use strict";
3563/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return hasStringTagBug; });
3564/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return isIE11; });
3565/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
3566/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__hasObjectTag_js__ = __webpack_require__(296);
3567
3568
3569
3570// In IE 10 - Edge 13, `DataView` has string tag `'[object Object]'`.
3571// In IE 11, the most common among them, this problem also applies to
3572// `Map`, `WeakMap` and `Set`.
3573var hasStringTagBug = (
3574 __WEBPACK_IMPORTED_MODULE_0__setup_js__["s" /* supportsDataView */] && Object(__WEBPACK_IMPORTED_MODULE_1__hasObjectTag_js__["a" /* default */])(new DataView(new ArrayBuffer(8)))
3575 ),
3576 isIE11 = (typeof Map !== 'undefined' && Object(__WEBPACK_IMPORTED_MODULE_1__hasObjectTag_js__["a" /* default */])(new Map));
3577
3578
3579/***/ }),
3580/* 80 */
3581/***/ (function(module, __webpack_exports__, __webpack_require__) {
3582
3583"use strict";
3584/* harmony export (immutable) */ __webpack_exports__["a"] = allKeys;
3585/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isObject_js__ = __webpack_require__(52);
3586/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(5);
3587/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__collectNonEnumProps_js__ = __webpack_require__(180);
3588
3589
3590
3591
3592// Retrieve all the enumerable property names of an object.
3593function allKeys(obj) {
3594 if (!Object(__WEBPACK_IMPORTED_MODULE_0__isObject_js__["a" /* default */])(obj)) return [];
3595 var keys = [];
3596 for (var key in obj) keys.push(key);
3597 // Ahem, IE < 9.
3598 if (__WEBPACK_IMPORTED_MODULE_1__setup_js__["h" /* hasEnumBug */]) Object(__WEBPACK_IMPORTED_MODULE_2__collectNonEnumProps_js__["a" /* default */])(obj, keys);
3599 return keys;
3600}
3601
3602
3603/***/ }),
3604/* 81 */
3605/***/ (function(module, __webpack_exports__, __webpack_require__) {
3606
3607"use strict";
3608/* harmony export (immutable) */ __webpack_exports__["a"] = toPath;
3609/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(24);
3610/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__toPath_js__ = __webpack_require__(189);
3611
3612
3613
3614// Internal wrapper for `_.toPath` to enable minification.
3615// Similar to `cb` for `_.iteratee`.
3616function toPath(path) {
3617 return __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].toPath(path);
3618}
3619
3620
3621/***/ }),
3622/* 82 */
3623/***/ (function(module, __webpack_exports__, __webpack_require__) {
3624
3625"use strict";
3626/* harmony export (immutable) */ __webpack_exports__["a"] = optimizeCb;
3627// Internal function that returns an efficient (for current engines) version
3628// of the passed-in callback, to be repeatedly applied in other Underscore
3629// functions.
3630function optimizeCb(func, context, argCount) {
3631 if (context === void 0) return func;
3632 switch (argCount == null ? 3 : argCount) {
3633 case 1: return function(value) {
3634 return func.call(context, value);
3635 };
3636 // The 2-argument case is omitted because we’re not using it.
3637 case 3: return function(value, index, collection) {
3638 return func.call(context, value, index, collection);
3639 };
3640 case 4: return function(accumulator, value, index, collection) {
3641 return func.call(context, accumulator, value, index, collection);
3642 };
3643 }
3644 return function() {
3645 return func.apply(context, arguments);
3646 };
3647}
3648
3649
3650/***/ }),
3651/* 83 */
3652/***/ (function(module, __webpack_exports__, __webpack_require__) {
3653
3654"use strict";
3655/* harmony export (immutable) */ __webpack_exports__["a"] = filter;
3656/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(20);
3657/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__each_js__ = __webpack_require__(54);
3658
3659
3660
3661// Return all the elements that pass a truth test.
3662function filter(obj, predicate, context) {
3663 var results = [];
3664 predicate = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(predicate, context);
3665 Object(__WEBPACK_IMPORTED_MODULE_1__each_js__["a" /* default */])(obj, function(value, index, list) {
3666 if (predicate(value, index, list)) results.push(value);
3667 });
3668 return results;
3669}
3670
3671
3672/***/ }),
3673/* 84 */
3674/***/ (function(module, __webpack_exports__, __webpack_require__) {
3675
3676"use strict";
3677/* harmony export (immutable) */ __webpack_exports__["a"] = contains;
3678/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(25);
3679/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__values_js__ = __webpack_require__(62);
3680/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__indexOf_js__ = __webpack_require__(205);
3681
3682
3683
3684
3685// Determine if the array or object contains a given item (using `===`).
3686function contains(obj, item, fromIndex, guard) {
3687 if (!Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" /* default */])(obj)) obj = Object(__WEBPACK_IMPORTED_MODULE_1__values_js__["a" /* default */])(obj);
3688 if (typeof fromIndex != 'number' || guard) fromIndex = 0;
3689 return Object(__WEBPACK_IMPORTED_MODULE_2__indexOf_js__["a" /* default */])(obj, item, fromIndex) >= 0;
3690}
3691
3692
3693/***/ }),
3694/* 85 */
3695/***/ (function(module, exports, __webpack_require__) {
3696
3697var classof = __webpack_require__(56);
3698
3699// `IsArray` abstract operation
3700// https://tc39.es/ecma262/#sec-isarray
3701// eslint-disable-next-line es-x/no-array-isarray -- safe
3702module.exports = Array.isArray || function isArray(argument) {
3703 return classof(argument) == 'Array';
3704};
3705
3706
3707/***/ }),
3708/* 86 */
3709/***/ (function(module, exports, __webpack_require__) {
3710
3711module.exports = __webpack_require__(376);
3712
3713/***/ }),
3714/* 87 */
3715/***/ (function(module, exports, __webpack_require__) {
3716
3717module.exports = __webpack_require__(229);
3718
3719/***/ }),
3720/* 88 */
3721/***/ (function(module, exports, __webpack_require__) {
3722
3723var toPrimitive = __webpack_require__(256);
3724var isSymbol = __webpack_require__(89);
3725
3726// `ToPropertyKey` abstract operation
3727// https://tc39.es/ecma262/#sec-topropertykey
3728module.exports = function (argument) {
3729 var key = toPrimitive(argument, 'string');
3730 return isSymbol(key) ? key : key + '';
3731};
3732
3733
3734/***/ }),
3735/* 89 */
3736/***/ (function(module, exports, __webpack_require__) {
3737
3738var getBuiltIn = __webpack_require__(18);
3739var isCallable = __webpack_require__(7);
3740var isPrototypeOf = __webpack_require__(21);
3741var USE_SYMBOL_AS_UID = __webpack_require__(147);
3742
3743var $Object = Object;
3744
3745module.exports = USE_SYMBOL_AS_UID ? function (it) {
3746 return typeof it == 'symbol';
3747} : function (it) {
3748 var $Symbol = getBuiltIn('Symbol');
3749 return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it));
3750};
3751
3752
3753/***/ }),
3754/* 90 */
3755/***/ (function(module, exports, __webpack_require__) {
3756
3757var global = __webpack_require__(6);
3758var userAgent = __webpack_require__(91);
3759
3760var process = global.process;
3761var Deno = global.Deno;
3762var versions = process && process.versions || Deno && Deno.version;
3763var v8 = versions && versions.v8;
3764var match, version;
3765
3766if (v8) {
3767 match = v8.split('.');
3768 // in old Chrome, versions of V8 isn't V8 = Chrome / 10
3769 // but their correct versions are not interesting for us
3770 version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
3771}
3772
3773// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
3774// so check `userAgent` even if `.v8` exists, but 0
3775if (!version && userAgent) {
3776 match = userAgent.match(/Edge\/(\d+)/);
3777 if (!match || match[1] >= 74) {
3778 match = userAgent.match(/Chrome\/(\d+)/);
3779 if (match) version = +match[1];
3780 }
3781}
3782
3783module.exports = version;
3784
3785
3786/***/ }),
3787/* 91 */
3788/***/ (function(module, exports, __webpack_require__) {
3789
3790var getBuiltIn = __webpack_require__(18);
3791
3792module.exports = getBuiltIn('navigator', 'userAgent') || '';
3793
3794
3795/***/ }),
3796/* 92 */
3797/***/ (function(module, exports, __webpack_require__) {
3798
3799var uncurryThis = __webpack_require__(4);
3800
3801var id = 0;
3802var postfix = Math.random();
3803var toString = uncurryThis(1.0.toString);
3804
3805module.exports = function (key) {
3806 return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
3807};
3808
3809
3810/***/ }),
3811/* 93 */
3812/***/ (function(module, exports, __webpack_require__) {
3813
3814var hasOwn = __webpack_require__(14);
3815var isCallable = __webpack_require__(7);
3816var toObject = __webpack_require__(34);
3817var sharedKey = __webpack_require__(94);
3818var CORRECT_PROTOTYPE_GETTER = __webpack_require__(151);
3819
3820var IE_PROTO = sharedKey('IE_PROTO');
3821var $Object = Object;
3822var ObjectPrototype = $Object.prototype;
3823
3824// `Object.getPrototypeOf` method
3825// https://tc39.es/ecma262/#sec-object.getprototypeof
3826// eslint-disable-next-line es-x/no-object-getprototypeof -- safe
3827module.exports = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) {
3828 var object = toObject(O);
3829 if (hasOwn(object, IE_PROTO)) return object[IE_PROTO];
3830 var constructor = object.constructor;
3831 if (isCallable(constructor) && object instanceof constructor) {
3832 return constructor.prototype;
3833 } return object instanceof $Object ? ObjectPrototype : null;
3834};
3835
3836
3837/***/ }),
3838/* 94 */
3839/***/ (function(module, exports, __webpack_require__) {
3840
3841var shared = __webpack_require__(73);
3842var uid = __webpack_require__(92);
3843
3844var keys = shared('keys');
3845
3846module.exports = function (key) {
3847 return keys[key] || (keys[key] = uid(key));
3848};
3849
3850
3851/***/ }),
3852/* 95 */
3853/***/ (function(module, exports, __webpack_require__) {
3854
3855/* eslint-disable no-proto -- safe */
3856var uncurryThis = __webpack_require__(4);
3857var anObject = __webpack_require__(19);
3858var aPossiblePrototype = __webpack_require__(259);
3859
3860// `Object.setPrototypeOf` method
3861// https://tc39.es/ecma262/#sec-object.setprototypeof
3862// Works with __proto__ only. Old v8 can't work with null proto objects.
3863// eslint-disable-next-line es-x/no-object-setprototypeof -- safe
3864module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {
3865 var CORRECT_SETTER = false;
3866 var test = {};
3867 var setter;
3868 try {
3869 // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
3870 setter = uncurryThis(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
3871 setter(test, []);
3872 CORRECT_SETTER = test instanceof Array;
3873 } catch (error) { /* empty */ }
3874 return function setPrototypeOf(O, proto) {
3875 anObject(O);
3876 aPossiblePrototype(proto);
3877 if (CORRECT_SETTER) setter(O, proto);
3878 else O.__proto__ = proto;
3879 return O;
3880 };
3881}() : undefined);
3882
3883
3884/***/ }),
3885/* 96 */
3886/***/ (function(module, exports, __webpack_require__) {
3887
3888var internalObjectKeys = __webpack_require__(152);
3889var enumBugKeys = __webpack_require__(121);
3890
3891var hiddenKeys = enumBugKeys.concat('length', 'prototype');
3892
3893// `Object.getOwnPropertyNames` method
3894// https://tc39.es/ecma262/#sec-object.getownpropertynames
3895// eslint-disable-next-line es-x/no-object-getownpropertynames -- safe
3896exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
3897 return internalObjectKeys(O, hiddenKeys);
3898};
3899
3900
3901/***/ }),
3902/* 97 */
3903/***/ (function(module, exports) {
3904
3905// eslint-disable-next-line es-x/no-object-getownpropertysymbols -- safe
3906exports.f = Object.getOwnPropertySymbols;
3907
3908
3909/***/ }),
3910/* 98 */
3911/***/ (function(module, exports, __webpack_require__) {
3912
3913var internalObjectKeys = __webpack_require__(152);
3914var enumBugKeys = __webpack_require__(121);
3915
3916// `Object.keys` method
3917// https://tc39.es/ecma262/#sec-object.keys
3918// eslint-disable-next-line es-x/no-object-keys -- safe
3919module.exports = Object.keys || function keys(O) {
3920 return internalObjectKeys(O, enumBugKeys);
3921};
3922
3923
3924/***/ }),
3925/* 99 */
3926/***/ (function(module, exports, __webpack_require__) {
3927
3928var classof = __webpack_require__(59);
3929var getMethod = __webpack_require__(116);
3930var Iterators = __webpack_require__(58);
3931var wellKnownSymbol = __webpack_require__(9);
3932
3933var ITERATOR = wellKnownSymbol('iterator');
3934
3935module.exports = function (it) {
3936 if (it != undefined) return getMethod(it, ITERATOR)
3937 || getMethod(it, '@@iterator')
3938 || Iterators[classof(it)];
3939};
3940
3941
3942/***/ }),
3943/* 100 */
3944/***/ (function(module, exports, __webpack_require__) {
3945
3946var isPrototypeOf = __webpack_require__(21);
3947
3948var $TypeError = TypeError;
3949
3950module.exports = function (it, Prototype) {
3951 if (isPrototypeOf(Prototype, it)) return it;
3952 throw $TypeError('Incorrect invocation');
3953};
3954
3955
3956/***/ }),
3957/* 101 */
3958/***/ (function(module, exports, __webpack_require__) {
3959
3960var uncurryThis = __webpack_require__(4);
3961var fails = __webpack_require__(3);
3962var isCallable = __webpack_require__(7);
3963var classof = __webpack_require__(59);
3964var getBuiltIn = __webpack_require__(18);
3965var inspectSource = __webpack_require__(123);
3966
3967var noop = function () { /* empty */ };
3968var empty = [];
3969var construct = getBuiltIn('Reflect', 'construct');
3970var constructorRegExp = /^\s*(?:class|function)\b/;
3971var exec = uncurryThis(constructorRegExp.exec);
3972var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
3973
3974var isConstructorModern = function isConstructor(argument) {
3975 if (!isCallable(argument)) return false;
3976 try {
3977 construct(noop, empty, argument);
3978 return true;
3979 } catch (error) {
3980 return false;
3981 }
3982};
3983
3984var isConstructorLegacy = function isConstructor(argument) {
3985 if (!isCallable(argument)) return false;
3986 switch (classof(argument)) {
3987 case 'AsyncFunction':
3988 case 'GeneratorFunction':
3989 case 'AsyncGeneratorFunction': return false;
3990 }
3991 try {
3992 // we can't check .prototype since constructors produced by .bind haven't it
3993 // `Function#toString` throws on some built-it function in some legacy engines
3994 // (for example, `DOMQuad` and similar in FF41-)
3995 return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));
3996 } catch (error) {
3997 return true;
3998 }
3999};
4000
4001isConstructorLegacy.sham = true;
4002
4003// `IsConstructor` abstract operation
4004// https://tc39.es/ecma262/#sec-isconstructor
4005module.exports = !construct || fails(function () {
4006 var called;
4007 return isConstructorModern(isConstructorModern.call)
4008 || !isConstructorModern(Object)
4009 || !isConstructorModern(function () { called = true; })
4010 || called;
4011}) ? isConstructorLegacy : isConstructorModern;
4012
4013
4014/***/ }),
4015/* 102 */
4016/***/ (function(module, exports, __webpack_require__) {
4017
4018var uncurryThis = __webpack_require__(4);
4019
4020module.exports = uncurryThis([].slice);
4021
4022
4023/***/ }),
4024/* 103 */
4025/***/ (function(module, __webpack_exports__, __webpack_require__) {
4026
4027"use strict";
4028/* harmony export (immutable) */ __webpack_exports__["a"] = matcher;
4029/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__extendOwn_js__ = __webpack_require__(133);
4030/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isMatch_js__ = __webpack_require__(181);
4031
4032
4033
4034// Returns a predicate for checking whether an object has a given set of
4035// `key:value` pairs.
4036function matcher(attrs) {
4037 attrs = Object(__WEBPACK_IMPORTED_MODULE_0__extendOwn_js__["a" /* default */])({}, attrs);
4038 return function(obj) {
4039 return Object(__WEBPACK_IMPORTED_MODULE_1__isMatch_js__["a" /* default */])(obj, attrs);
4040 };
4041}
4042
4043
4044/***/ }),
4045/* 104 */
4046/***/ (function(module, __webpack_exports__, __webpack_require__) {
4047
4048"use strict";
4049/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(23);
4050/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__executeBound_js__ = __webpack_require__(197);
4051/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__underscore_js__ = __webpack_require__(24);
4052
4053
4054
4055
4056// Partially apply a function by creating a version that has had some of its
4057// arguments pre-filled, without changing its dynamic `this` context. `_` acts
4058// as a placeholder by default, allowing any combination of arguments to be
4059// pre-filled. Set `_.partial.placeholder` for a custom placeholder argument.
4060var partial = Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(func, boundArgs) {
4061 var placeholder = partial.placeholder;
4062 var bound = function() {
4063 var position = 0, length = boundArgs.length;
4064 var args = Array(length);
4065 for (var i = 0; i < length; i++) {
4066 args[i] = boundArgs[i] === placeholder ? arguments[position++] : boundArgs[i];
4067 }
4068 while (position < arguments.length) args.push(arguments[position++]);
4069 return Object(__WEBPACK_IMPORTED_MODULE_1__executeBound_js__["a" /* default */])(func, bound, this, this, args);
4070 };
4071 return bound;
4072});
4073
4074partial.placeholder = __WEBPACK_IMPORTED_MODULE_2__underscore_js__["a" /* default */];
4075/* harmony default export */ __webpack_exports__["a"] = (partial);
4076
4077
4078/***/ }),
4079/* 105 */
4080/***/ (function(module, __webpack_exports__, __webpack_require__) {
4081
4082"use strict";
4083/* harmony export (immutable) */ __webpack_exports__["a"] = group;
4084/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(20);
4085/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__each_js__ = __webpack_require__(54);
4086
4087
4088
4089// An internal function used for aggregate "group by" operations.
4090function group(behavior, partition) {
4091 return function(obj, iteratee, context) {
4092 var result = partition ? [[], []] : {};
4093 iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(iteratee, context);
4094 Object(__WEBPACK_IMPORTED_MODULE_1__each_js__["a" /* default */])(obj, function(value, index) {
4095 var key = iteratee(value, index, obj);
4096 behavior(result, value, key);
4097 });
4098 return result;
4099 };
4100}
4101
4102
4103/***/ }),
4104/* 106 */
4105/***/ (function(module, exports, __webpack_require__) {
4106
4107"use strict";
4108
4109var toPropertyKey = __webpack_require__(88);
4110var definePropertyModule = __webpack_require__(22);
4111var createPropertyDescriptor = __webpack_require__(44);
4112
4113module.exports = function (object, key, value) {
4114 var propertyKey = toPropertyKey(key);
4115 if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));
4116 else object[propertyKey] = value;
4117};
4118
4119
4120/***/ }),
4121/* 107 */
4122/***/ (function(module, exports, __webpack_require__) {
4123
4124var fails = __webpack_require__(3);
4125var wellKnownSymbol = __webpack_require__(9);
4126var V8_VERSION = __webpack_require__(90);
4127
4128var SPECIES = wellKnownSymbol('species');
4129
4130module.exports = function (METHOD_NAME) {
4131 // We can't use this feature detection in V8 since it causes
4132 // deoptimization and serious performance degradation
4133 // https://github.com/zloirock/core-js/issues/677
4134 return V8_VERSION >= 51 || !fails(function () {
4135 var array = [];
4136 var constructor = array.constructor = {};
4137 constructor[SPECIES] = function () {
4138 return { foo: 1 };
4139 };
4140 return array[METHOD_NAME](Boolean).foo !== 1;
4141 });
4142};
4143
4144
4145/***/ }),
4146/* 108 */
4147/***/ (function(module, exports, __webpack_require__) {
4148
4149"use strict";
4150
4151
4152var _interopRequireDefault = __webpack_require__(1);
4153
4154var _typeof2 = _interopRequireDefault(__webpack_require__(109));
4155
4156var _filter = _interopRequireDefault(__webpack_require__(437));
4157
4158var _map = _interopRequireDefault(__webpack_require__(42));
4159
4160var _keys = _interopRequireDefault(__webpack_require__(141));
4161
4162var _stringify = _interopRequireDefault(__webpack_require__(36));
4163
4164var _concat = _interopRequireDefault(__webpack_require__(30));
4165
4166var _ = __webpack_require__(2);
4167
4168var _require = __webpack_require__(442),
4169 timeout = _require.timeout;
4170
4171var debug = __webpack_require__(67);
4172
4173var debugRequest = debug('leancloud:request');
4174var debugRequestError = debug('leancloud:request:error');
4175
4176var _require2 = __webpack_require__(68),
4177 getAdapter = _require2.getAdapter;
4178
4179var requestsCount = 0;
4180
4181var ajax = function ajax(_ref) {
4182 var method = _ref.method,
4183 url = _ref.url,
4184 query = _ref.query,
4185 data = _ref.data,
4186 _ref$headers = _ref.headers,
4187 headers = _ref$headers === void 0 ? {} : _ref$headers,
4188 time = _ref.timeout,
4189 onprogress = _ref.onprogress;
4190
4191 if (query) {
4192 var _context, _context2, _context4;
4193
4194 var queryString = (0, _filter.default)(_context = (0, _map.default)(_context2 = (0, _keys.default)(query)).call(_context2, function (key) {
4195 var _context3;
4196
4197 var value = query[key];
4198 if (value === undefined) return undefined;
4199 var v = (0, _typeof2.default)(value) === 'object' ? (0, _stringify.default)(value) : value;
4200 return (0, _concat.default)(_context3 = "".concat(encodeURIComponent(key), "=")).call(_context3, encodeURIComponent(v));
4201 })).call(_context, function (qs) {
4202 return qs;
4203 }).join('&');
4204 url = (0, _concat.default)(_context4 = "".concat(url, "?")).call(_context4, queryString);
4205 }
4206
4207 var count = requestsCount++;
4208 debugRequest('request(%d) %s %s %o %o %o', count, method, url, query, data, headers);
4209 var request = getAdapter('request');
4210 var promise = request(url, {
4211 method: method,
4212 headers: headers,
4213 data: data,
4214 onprogress: onprogress
4215 }).then(function (response) {
4216 debugRequest('response(%d) %d %O %o', count, response.status, response.data || response.text, response.header);
4217
4218 if (response.ok === false) {
4219 var error = new Error();
4220 error.response = response;
4221 throw error;
4222 }
4223
4224 return response.data;
4225 }).catch(function (error) {
4226 if (error.response) {
4227 if (!debug.enabled('leancloud:request')) {
4228 debugRequestError('request(%d) %s %s %o %o %o', count, method, url, query, data, headers);
4229 }
4230
4231 debugRequestError('response(%d) %d %O %o', count, error.response.status, error.response.data || error.response.text, error.response.header);
4232 error.statusCode = error.response.status;
4233 error.responseText = error.response.text;
4234 error.response = error.response.data;
4235 }
4236
4237 throw error;
4238 });
4239 return time ? timeout(promise, time) : promise;
4240};
4241
4242module.exports = ajax;
4243
4244/***/ }),
4245/* 109 */
4246/***/ (function(module, exports, __webpack_require__) {
4247
4248var _Symbol = __webpack_require__(231);
4249
4250var _Symbol$iterator = __webpack_require__(432);
4251
4252function _typeof(obj) {
4253 "@babel/helpers - typeof";
4254
4255 return (module.exports = _typeof = "function" == typeof _Symbol && "symbol" == typeof _Symbol$iterator ? function (obj) {
4256 return typeof obj;
4257 } : function (obj) {
4258 return obj && "function" == typeof _Symbol && obj.constructor === _Symbol && obj !== _Symbol.prototype ? "symbol" : typeof obj;
4259 }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
4260}
4261
4262module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
4263
4264/***/ }),
4265/* 110 */
4266/***/ (function(module, exports, __webpack_require__) {
4267
4268module.exports = __webpack_require__(447);
4269
4270/***/ }),
4271/* 111 */
4272/***/ (function(module, exports, __webpack_require__) {
4273
4274var $ = __webpack_require__(0);
4275var uncurryThis = __webpack_require__(4);
4276var hiddenKeys = __webpack_require__(74);
4277var isObject = __webpack_require__(11);
4278var hasOwn = __webpack_require__(14);
4279var defineProperty = __webpack_require__(22).f;
4280var getOwnPropertyNamesModule = __webpack_require__(96);
4281var getOwnPropertyNamesExternalModule = __webpack_require__(234);
4282var isExtensible = __webpack_require__(247);
4283var uid = __webpack_require__(92);
4284var FREEZING = __webpack_require__(562);
4285
4286var REQUIRED = false;
4287var METADATA = uid('meta');
4288var id = 0;
4289
4290var setMetadata = function (it) {
4291 defineProperty(it, METADATA, { value: {
4292 objectID: 'O' + id++, // object ID
4293 weakData: {} // weak collections IDs
4294 } });
4295};
4296
4297var fastKey = function (it, create) {
4298 // return a primitive with prefix
4299 if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
4300 if (!hasOwn(it, METADATA)) {
4301 // can't set metadata to uncaught frozen object
4302 if (!isExtensible(it)) return 'F';
4303 // not necessary to add metadata
4304 if (!create) return 'E';
4305 // add missing metadata
4306 setMetadata(it);
4307 // return object ID
4308 } return it[METADATA].objectID;
4309};
4310
4311var getWeakData = function (it, create) {
4312 if (!hasOwn(it, METADATA)) {
4313 // can't set metadata to uncaught frozen object
4314 if (!isExtensible(it)) return true;
4315 // not necessary to add metadata
4316 if (!create) return false;
4317 // add missing metadata
4318 setMetadata(it);
4319 // return the store of weak collections IDs
4320 } return it[METADATA].weakData;
4321};
4322
4323// add metadata on freeze-family methods calling
4324var onFreeze = function (it) {
4325 if (FREEZING && REQUIRED && isExtensible(it) && !hasOwn(it, METADATA)) setMetadata(it);
4326 return it;
4327};
4328
4329var enable = function () {
4330 meta.enable = function () { /* empty */ };
4331 REQUIRED = true;
4332 var getOwnPropertyNames = getOwnPropertyNamesModule.f;
4333 var splice = uncurryThis([].splice);
4334 var test = {};
4335 test[METADATA] = 1;
4336
4337 // prevent exposing of metadata key
4338 if (getOwnPropertyNames(test).length) {
4339 getOwnPropertyNamesModule.f = function (it) {
4340 var result = getOwnPropertyNames(it);
4341 for (var i = 0, length = result.length; i < length; i++) {
4342 if (result[i] === METADATA) {
4343 splice(result, i, 1);
4344 break;
4345 }
4346 } return result;
4347 };
4348
4349 $({ target: 'Object', stat: true, forced: true }, {
4350 getOwnPropertyNames: getOwnPropertyNamesExternalModule.f
4351 });
4352 }
4353};
4354
4355var meta = module.exports = {
4356 enable: enable,
4357 fastKey: fastKey,
4358 getWeakData: getWeakData,
4359 onFreeze: onFreeze
4360};
4361
4362hiddenKeys[METADATA] = true;
4363
4364
4365/***/ }),
4366/* 112 */
4367/***/ (function(module, exports) {
4368
4369var g;
4370
4371// This works in non-strict mode
4372g = (function() {
4373 return this;
4374})();
4375
4376try {
4377 // This works if eval is allowed (see CSP)
4378 g = g || Function("return this")() || (1,eval)("this");
4379} catch(e) {
4380 // This works if the window reference is available
4381 if(typeof window === "object")
4382 g = window;
4383}
4384
4385// g can still be undefined, but nothing to do about it...
4386// We return undefined, instead of nothing here, so it's
4387// easier to handle this case. if(!global) { ...}
4388
4389module.exports = g;
4390
4391
4392/***/ }),
4393/* 113 */
4394/***/ (function(module, exports, __webpack_require__) {
4395
4396"use strict";
4397
4398var $propertyIsEnumerable = {}.propertyIsEnumerable;
4399// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
4400var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
4401
4402// Nashorn ~ JDK8 bug
4403var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);
4404
4405// `Object.prototype.propertyIsEnumerable` method implementation
4406// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
4407exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
4408 var descriptor = getOwnPropertyDescriptor(this, V);
4409 return !!descriptor && descriptor.enumerable;
4410} : $propertyIsEnumerable;
4411
4412
4413/***/ }),
4414/* 114 */
4415/***/ (function(module, exports, __webpack_require__) {
4416
4417var uncurryThis = __webpack_require__(4);
4418var fails = __webpack_require__(3);
4419var classof = __webpack_require__(56);
4420
4421var $Object = Object;
4422var split = uncurryThis(''.split);
4423
4424// fallback for non-array-like ES3 and non-enumerable old V8 strings
4425module.exports = fails(function () {
4426 // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
4427 // eslint-disable-next-line no-prototype-builtins -- safe
4428 return !$Object('z').propertyIsEnumerable(0);
4429}) ? function (it) {
4430 return classof(it) == 'String' ? split(it, '') : $Object(it);
4431} : $Object;
4432
4433
4434/***/ }),
4435/* 115 */
4436/***/ (function(module, exports) {
4437
4438var $TypeError = TypeError;
4439
4440// `RequireObjectCoercible` abstract operation
4441// https://tc39.es/ecma262/#sec-requireobjectcoercible
4442module.exports = function (it) {
4443 if (it == undefined) throw $TypeError("Can't call method on " + it);
4444 return it;
4445};
4446
4447
4448/***/ }),
4449/* 116 */
4450/***/ (function(module, exports, __webpack_require__) {
4451
4452var aCallable = __webpack_require__(31);
4453
4454// `GetMethod` abstract operation
4455// https://tc39.es/ecma262/#sec-getmethod
4456module.exports = function (V, P) {
4457 var func = V[P];
4458 return func == null ? undefined : aCallable(func);
4459};
4460
4461
4462/***/ }),
4463/* 117 */
4464/***/ (function(module, exports, __webpack_require__) {
4465
4466var global = __webpack_require__(6);
4467var defineGlobalProperty = __webpack_require__(258);
4468
4469var SHARED = '__core-js_shared__';
4470var store = global[SHARED] || defineGlobalProperty(SHARED, {});
4471
4472module.exports = store;
4473
4474
4475/***/ }),
4476/* 118 */
4477/***/ (function(module, exports, __webpack_require__) {
4478
4479var global = __webpack_require__(6);
4480var isObject = __webpack_require__(11);
4481
4482var document = global.document;
4483// typeof document.createElement is 'object' in old IE
4484var EXISTS = isObject(document) && isObject(document.createElement);
4485
4486module.exports = function (it) {
4487 return EXISTS ? document.createElement(it) : {};
4488};
4489
4490
4491/***/ }),
4492/* 119 */
4493/***/ (function(module, exports, __webpack_require__) {
4494
4495var toIntegerOrInfinity = __webpack_require__(120);
4496
4497var max = Math.max;
4498var min = Math.min;
4499
4500// Helper for a popular repeating case of the spec:
4501// Let integer be ? ToInteger(index).
4502// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
4503module.exports = function (index, length) {
4504 var integer = toIntegerOrInfinity(index);
4505 return integer < 0 ? max(integer + length, 0) : min(integer, length);
4506};
4507
4508
4509/***/ }),
4510/* 120 */
4511/***/ (function(module, exports, __webpack_require__) {
4512
4513var trunc = __webpack_require__(262);
4514
4515// `ToIntegerOrInfinity` abstract operation
4516// https://tc39.es/ecma262/#sec-tointegerorinfinity
4517module.exports = function (argument) {
4518 var number = +argument;
4519 // eslint-disable-next-line no-self-compare -- NaN check
4520 return number !== number || number === 0 ? 0 : trunc(number);
4521};
4522
4523
4524/***/ }),
4525/* 121 */
4526/***/ (function(module, exports) {
4527
4528// IE8- don't enum bug keys
4529module.exports = [
4530 'constructor',
4531 'hasOwnProperty',
4532 'isPrototypeOf',
4533 'propertyIsEnumerable',
4534 'toLocaleString',
4535 'toString',
4536 'valueOf'
4537];
4538
4539
4540/***/ }),
4541/* 122 */
4542/***/ (function(module, exports, __webpack_require__) {
4543
4544var wellKnownSymbol = __webpack_require__(9);
4545
4546var TO_STRING_TAG = wellKnownSymbol('toStringTag');
4547var test = {};
4548
4549test[TO_STRING_TAG] = 'z';
4550
4551module.exports = String(test) === '[object z]';
4552
4553
4554/***/ }),
4555/* 123 */
4556/***/ (function(module, exports, __webpack_require__) {
4557
4558var uncurryThis = __webpack_require__(4);
4559var isCallable = __webpack_require__(7);
4560var store = __webpack_require__(117);
4561
4562var functionToString = uncurryThis(Function.toString);
4563
4564// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
4565if (!isCallable(store.inspectSource)) {
4566 store.inspectSource = function (it) {
4567 return functionToString(it);
4568 };
4569}
4570
4571module.exports = store.inspectSource;
4572
4573
4574/***/ }),
4575/* 124 */
4576/***/ (function(module, exports, __webpack_require__) {
4577
4578"use strict";
4579
4580var $ = __webpack_require__(0);
4581var call = __webpack_require__(13);
4582var IS_PURE = __webpack_require__(32);
4583var FunctionName = __webpack_require__(268);
4584var isCallable = __webpack_require__(7);
4585var createIteratorConstructor = __webpack_require__(269);
4586var getPrototypeOf = __webpack_require__(93);
4587var setPrototypeOf = __webpack_require__(95);
4588var setToStringTag = __webpack_require__(49);
4589var createNonEnumerableProperty = __webpack_require__(35);
4590var defineBuiltIn = __webpack_require__(39);
4591var wellKnownSymbol = __webpack_require__(9);
4592var Iterators = __webpack_require__(58);
4593var IteratorsCore = __webpack_require__(161);
4594
4595var PROPER_FUNCTION_NAME = FunctionName.PROPER;
4596var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
4597var IteratorPrototype = IteratorsCore.IteratorPrototype;
4598var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
4599var ITERATOR = wellKnownSymbol('iterator');
4600var KEYS = 'keys';
4601var VALUES = 'values';
4602var ENTRIES = 'entries';
4603
4604var returnThis = function () { return this; };
4605
4606module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
4607 createIteratorConstructor(IteratorConstructor, NAME, next);
4608
4609 var getIterationMethod = function (KIND) {
4610 if (KIND === DEFAULT && defaultIterator) return defaultIterator;
4611 if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];
4612 switch (KIND) {
4613 case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
4614 case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
4615 case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
4616 } return function () { return new IteratorConstructor(this); };
4617 };
4618
4619 var TO_STRING_TAG = NAME + ' Iterator';
4620 var INCORRECT_VALUES_NAME = false;
4621 var IterablePrototype = Iterable.prototype;
4622 var nativeIterator = IterablePrototype[ITERATOR]
4623 || IterablePrototype['@@iterator']
4624 || DEFAULT && IterablePrototype[DEFAULT];
4625 var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
4626 var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
4627 var CurrentIteratorPrototype, methods, KEY;
4628
4629 // fix native
4630 if (anyNativeIterator) {
4631 CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
4632 if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
4633 if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
4634 if (setPrototypeOf) {
4635 setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
4636 } else if (!isCallable(CurrentIteratorPrototype[ITERATOR])) {
4637 defineBuiltIn(CurrentIteratorPrototype, ITERATOR, returnThis);
4638 }
4639 }
4640 // Set @@toStringTag to native iterators
4641 setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);
4642 if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis;
4643 }
4644 }
4645
4646 // fix Array.prototype.{ values, @@iterator }.name in V8 / FF
4647 if (PROPER_FUNCTION_NAME && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
4648 if (!IS_PURE && CONFIGURABLE_FUNCTION_NAME) {
4649 createNonEnumerableProperty(IterablePrototype, 'name', VALUES);
4650 } else {
4651 INCORRECT_VALUES_NAME = true;
4652 defaultIterator = function values() { return call(nativeIterator, this); };
4653 }
4654 }
4655
4656 // export additional methods
4657 if (DEFAULT) {
4658 methods = {
4659 values: getIterationMethod(VALUES),
4660 keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
4661 entries: getIterationMethod(ENTRIES)
4662 };
4663 if (FORCED) for (KEY in methods) {
4664 if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
4665 defineBuiltIn(IterablePrototype, KEY, methods[KEY]);
4666 }
4667 } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
4668 }
4669
4670 // define iterator
4671 if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {
4672 defineBuiltIn(IterablePrototype, ITERATOR, defaultIterator, { name: DEFAULT });
4673 }
4674 Iterators[NAME] = defaultIterator;
4675
4676 return methods;
4677};
4678
4679
4680/***/ }),
4681/* 125 */
4682/***/ (function(module, exports, __webpack_require__) {
4683
4684var classof = __webpack_require__(56);
4685var global = __webpack_require__(6);
4686
4687module.exports = classof(global.process) == 'process';
4688
4689
4690/***/ }),
4691/* 126 */
4692/***/ (function(module, __webpack_exports__, __webpack_require__) {
4693
4694"use strict";
4695Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
4696/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
4697/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "VERSION", function() { return __WEBPACK_IMPORTED_MODULE_0__setup_js__["e"]; });
4698/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__restArguments_js__ = __webpack_require__(23);
4699/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "restArguments", function() { return __WEBPACK_IMPORTED_MODULE_1__restArguments_js__["a"]; });
4700/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isObject_js__ = __webpack_require__(52);
4701/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isObject", function() { return __WEBPACK_IMPORTED_MODULE_2__isObject_js__["a"]; });
4702/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isNull_js__ = __webpack_require__(291);
4703/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isNull", function() { return __WEBPACK_IMPORTED_MODULE_3__isNull_js__["a"]; });
4704/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__isUndefined_js__ = __webpack_require__(170);
4705/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isUndefined", function() { return __WEBPACK_IMPORTED_MODULE_4__isUndefined_js__["a"]; });
4706/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__isBoolean_js__ = __webpack_require__(171);
4707/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isBoolean", function() { return __WEBPACK_IMPORTED_MODULE_5__isBoolean_js__["a"]; });
4708/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__isElement_js__ = __webpack_require__(292);
4709/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isElement", function() { return __WEBPACK_IMPORTED_MODULE_6__isElement_js__["a"]; });
4710/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__isString_js__ = __webpack_require__(127);
4711/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isString", function() { return __WEBPACK_IMPORTED_MODULE_7__isString_js__["a"]; });
4712/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__isNumber_js__ = __webpack_require__(172);
4713/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isNumber", function() { return __WEBPACK_IMPORTED_MODULE_8__isNumber_js__["a"]; });
4714/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__isDate_js__ = __webpack_require__(293);
4715/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isDate", function() { return __WEBPACK_IMPORTED_MODULE_9__isDate_js__["a"]; });
4716/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__isRegExp_js__ = __webpack_require__(294);
4717/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isRegExp", function() { return __WEBPACK_IMPORTED_MODULE_10__isRegExp_js__["a"]; });
4718/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__isError_js__ = __webpack_require__(295);
4719/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isError", function() { return __WEBPACK_IMPORTED_MODULE_11__isError_js__["a"]; });
4720/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__isSymbol_js__ = __webpack_require__(173);
4721/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isSymbol", function() { return __WEBPACK_IMPORTED_MODULE_12__isSymbol_js__["a"]; });
4722/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__isArrayBuffer_js__ = __webpack_require__(174);
4723/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isArrayBuffer", function() { return __WEBPACK_IMPORTED_MODULE_13__isArrayBuffer_js__["a"]; });
4724/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__isDataView_js__ = __webpack_require__(128);
4725/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isDataView", function() { return __WEBPACK_IMPORTED_MODULE_14__isDataView_js__["a"]; });
4726/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__isArray_js__ = __webpack_require__(53);
4727/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isArray", function() { return __WEBPACK_IMPORTED_MODULE_15__isArray_js__["a"]; });
4728/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__isFunction_js__ = __webpack_require__(27);
4729/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isFunction", function() { return __WEBPACK_IMPORTED_MODULE_16__isFunction_js__["a"]; });
4730/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__isArguments_js__ = __webpack_require__(129);
4731/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isArguments", function() { return __WEBPACK_IMPORTED_MODULE_17__isArguments_js__["a"]; });
4732/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__isFinite_js__ = __webpack_require__(297);
4733/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isFinite", function() { return __WEBPACK_IMPORTED_MODULE_18__isFinite_js__["a"]; });
4734/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__isNaN_js__ = __webpack_require__(175);
4735/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isNaN", function() { return __WEBPACK_IMPORTED_MODULE_19__isNaN_js__["a"]; });
4736/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__isTypedArray_js__ = __webpack_require__(176);
4737/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isTypedArray", function() { return __WEBPACK_IMPORTED_MODULE_20__isTypedArray_js__["a"]; });
4738/* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__isEmpty_js__ = __webpack_require__(299);
4739/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return __WEBPACK_IMPORTED_MODULE_21__isEmpty_js__["a"]; });
4740/* harmony import */ var __WEBPACK_IMPORTED_MODULE_22__isMatch_js__ = __webpack_require__(181);
4741/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isMatch", function() { return __WEBPACK_IMPORTED_MODULE_22__isMatch_js__["a"]; });
4742/* harmony import */ var __WEBPACK_IMPORTED_MODULE_23__isEqual_js__ = __webpack_require__(300);
4743/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isEqual", function() { return __WEBPACK_IMPORTED_MODULE_23__isEqual_js__["a"]; });
4744/* harmony import */ var __WEBPACK_IMPORTED_MODULE_24__isMap_js__ = __webpack_require__(302);
4745/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isMap", function() { return __WEBPACK_IMPORTED_MODULE_24__isMap_js__["a"]; });
4746/* harmony import */ var __WEBPACK_IMPORTED_MODULE_25__isWeakMap_js__ = __webpack_require__(303);
4747/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isWeakMap", function() { return __WEBPACK_IMPORTED_MODULE_25__isWeakMap_js__["a"]; });
4748/* harmony import */ var __WEBPACK_IMPORTED_MODULE_26__isSet_js__ = __webpack_require__(304);
4749/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isSet", function() { return __WEBPACK_IMPORTED_MODULE_26__isSet_js__["a"]; });
4750/* harmony import */ var __WEBPACK_IMPORTED_MODULE_27__isWeakSet_js__ = __webpack_require__(305);
4751/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isWeakSet", function() { return __WEBPACK_IMPORTED_MODULE_27__isWeakSet_js__["a"]; });
4752/* harmony import */ var __WEBPACK_IMPORTED_MODULE_28__keys_js__ = __webpack_require__(15);
4753/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "keys", function() { return __WEBPACK_IMPORTED_MODULE_28__keys_js__["a"]; });
4754/* harmony import */ var __WEBPACK_IMPORTED_MODULE_29__allKeys_js__ = __webpack_require__(80);
4755/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "allKeys", function() { return __WEBPACK_IMPORTED_MODULE_29__allKeys_js__["a"]; });
4756/* harmony import */ var __WEBPACK_IMPORTED_MODULE_30__values_js__ = __webpack_require__(62);
4757/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "values", function() { return __WEBPACK_IMPORTED_MODULE_30__values_js__["a"]; });
4758/* harmony import */ var __WEBPACK_IMPORTED_MODULE_31__pairs_js__ = __webpack_require__(306);
4759/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "pairs", function() { return __WEBPACK_IMPORTED_MODULE_31__pairs_js__["a"]; });
4760/* harmony import */ var __WEBPACK_IMPORTED_MODULE_32__invert_js__ = __webpack_require__(182);
4761/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "invert", function() { return __WEBPACK_IMPORTED_MODULE_32__invert_js__["a"]; });
4762/* harmony import */ var __WEBPACK_IMPORTED_MODULE_33__functions_js__ = __webpack_require__(183);
4763/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "functions", function() { return __WEBPACK_IMPORTED_MODULE_33__functions_js__["a"]; });
4764/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "methods", function() { return __WEBPACK_IMPORTED_MODULE_33__functions_js__["a"]; });
4765/* harmony import */ var __WEBPACK_IMPORTED_MODULE_34__extend_js__ = __webpack_require__(184);
4766/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "extend", function() { return __WEBPACK_IMPORTED_MODULE_34__extend_js__["a"]; });
4767/* harmony import */ var __WEBPACK_IMPORTED_MODULE_35__extendOwn_js__ = __webpack_require__(133);
4768/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "extendOwn", function() { return __WEBPACK_IMPORTED_MODULE_35__extendOwn_js__["a"]; });
4769/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "assign", function() { return __WEBPACK_IMPORTED_MODULE_35__extendOwn_js__["a"]; });
4770/* harmony import */ var __WEBPACK_IMPORTED_MODULE_36__defaults_js__ = __webpack_require__(185);
4771/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "defaults", function() { return __WEBPACK_IMPORTED_MODULE_36__defaults_js__["a"]; });
4772/* harmony import */ var __WEBPACK_IMPORTED_MODULE_37__create_js__ = __webpack_require__(307);
4773/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return __WEBPACK_IMPORTED_MODULE_37__create_js__["a"]; });
4774/* harmony import */ var __WEBPACK_IMPORTED_MODULE_38__clone_js__ = __webpack_require__(187);
4775/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "clone", function() { return __WEBPACK_IMPORTED_MODULE_38__clone_js__["a"]; });
4776/* harmony import */ var __WEBPACK_IMPORTED_MODULE_39__tap_js__ = __webpack_require__(308);
4777/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "tap", function() { return __WEBPACK_IMPORTED_MODULE_39__tap_js__["a"]; });
4778/* harmony import */ var __WEBPACK_IMPORTED_MODULE_40__get_js__ = __webpack_require__(188);
4779/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "get", function() { return __WEBPACK_IMPORTED_MODULE_40__get_js__["a"]; });
4780/* harmony import */ var __WEBPACK_IMPORTED_MODULE_41__has_js__ = __webpack_require__(309);
4781/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "has", function() { return __WEBPACK_IMPORTED_MODULE_41__has_js__["a"]; });
4782/* harmony import */ var __WEBPACK_IMPORTED_MODULE_42__mapObject_js__ = __webpack_require__(310);
4783/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "mapObject", function() { return __WEBPACK_IMPORTED_MODULE_42__mapObject_js__["a"]; });
4784/* harmony import */ var __WEBPACK_IMPORTED_MODULE_43__identity_js__ = __webpack_require__(135);
4785/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return __WEBPACK_IMPORTED_MODULE_43__identity_js__["a"]; });
4786/* harmony import */ var __WEBPACK_IMPORTED_MODULE_44__constant_js__ = __webpack_require__(177);
4787/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "constant", function() { return __WEBPACK_IMPORTED_MODULE_44__constant_js__["a"]; });
4788/* harmony import */ var __WEBPACK_IMPORTED_MODULE_45__noop_js__ = __webpack_require__(192);
4789/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "noop", function() { return __WEBPACK_IMPORTED_MODULE_45__noop_js__["a"]; });
4790/* harmony import */ var __WEBPACK_IMPORTED_MODULE_46__toPath_js__ = __webpack_require__(189);
4791/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "toPath", function() { return __WEBPACK_IMPORTED_MODULE_46__toPath_js__["a"]; });
4792/* harmony import */ var __WEBPACK_IMPORTED_MODULE_47__property_js__ = __webpack_require__(136);
4793/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "property", function() { return __WEBPACK_IMPORTED_MODULE_47__property_js__["a"]; });
4794/* harmony import */ var __WEBPACK_IMPORTED_MODULE_48__propertyOf_js__ = __webpack_require__(311);
4795/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "propertyOf", function() { return __WEBPACK_IMPORTED_MODULE_48__propertyOf_js__["a"]; });
4796/* harmony import */ var __WEBPACK_IMPORTED_MODULE_49__matcher_js__ = __webpack_require__(103);
4797/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "matcher", function() { return __WEBPACK_IMPORTED_MODULE_49__matcher_js__["a"]; });
4798/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "matches", function() { return __WEBPACK_IMPORTED_MODULE_49__matcher_js__["a"]; });
4799/* harmony import */ var __WEBPACK_IMPORTED_MODULE_50__times_js__ = __webpack_require__(312);
4800/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "times", function() { return __WEBPACK_IMPORTED_MODULE_50__times_js__["a"]; });
4801/* harmony import */ var __WEBPACK_IMPORTED_MODULE_51__random_js__ = __webpack_require__(193);
4802/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "random", function() { return __WEBPACK_IMPORTED_MODULE_51__random_js__["a"]; });
4803/* harmony import */ var __WEBPACK_IMPORTED_MODULE_52__now_js__ = __webpack_require__(137);
4804/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "now", function() { return __WEBPACK_IMPORTED_MODULE_52__now_js__["a"]; });
4805/* harmony import */ var __WEBPACK_IMPORTED_MODULE_53__escape_js__ = __webpack_require__(313);
4806/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "escape", function() { return __WEBPACK_IMPORTED_MODULE_53__escape_js__["a"]; });
4807/* harmony import */ var __WEBPACK_IMPORTED_MODULE_54__unescape_js__ = __webpack_require__(314);
4808/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "unescape", function() { return __WEBPACK_IMPORTED_MODULE_54__unescape_js__["a"]; });
4809/* harmony import */ var __WEBPACK_IMPORTED_MODULE_55__templateSettings_js__ = __webpack_require__(196);
4810/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "templateSettings", function() { return __WEBPACK_IMPORTED_MODULE_55__templateSettings_js__["a"]; });
4811/* harmony import */ var __WEBPACK_IMPORTED_MODULE_56__template_js__ = __webpack_require__(316);
4812/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "template", function() { return __WEBPACK_IMPORTED_MODULE_56__template_js__["a"]; });
4813/* harmony import */ var __WEBPACK_IMPORTED_MODULE_57__result_js__ = __webpack_require__(317);
4814/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "result", function() { return __WEBPACK_IMPORTED_MODULE_57__result_js__["a"]; });
4815/* harmony import */ var __WEBPACK_IMPORTED_MODULE_58__uniqueId_js__ = __webpack_require__(318);
4816/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "uniqueId", function() { return __WEBPACK_IMPORTED_MODULE_58__uniqueId_js__["a"]; });
4817/* harmony import */ var __WEBPACK_IMPORTED_MODULE_59__chain_js__ = __webpack_require__(319);
4818/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "chain", function() { return __WEBPACK_IMPORTED_MODULE_59__chain_js__["a"]; });
4819/* harmony import */ var __WEBPACK_IMPORTED_MODULE_60__iteratee_js__ = __webpack_require__(191);
4820/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "iteratee", function() { return __WEBPACK_IMPORTED_MODULE_60__iteratee_js__["a"]; });
4821/* harmony import */ var __WEBPACK_IMPORTED_MODULE_61__partial_js__ = __webpack_require__(104);
4822/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "partial", function() { return __WEBPACK_IMPORTED_MODULE_61__partial_js__["a"]; });
4823/* harmony import */ var __WEBPACK_IMPORTED_MODULE_62__bind_js__ = __webpack_require__(198);
4824/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "bind", function() { return __WEBPACK_IMPORTED_MODULE_62__bind_js__["a"]; });
4825/* harmony import */ var __WEBPACK_IMPORTED_MODULE_63__bindAll_js__ = __webpack_require__(320);
4826/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "bindAll", function() { return __WEBPACK_IMPORTED_MODULE_63__bindAll_js__["a"]; });
4827/* harmony import */ var __WEBPACK_IMPORTED_MODULE_64__memoize_js__ = __webpack_require__(321);
4828/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "memoize", function() { return __WEBPACK_IMPORTED_MODULE_64__memoize_js__["a"]; });
4829/* harmony import */ var __WEBPACK_IMPORTED_MODULE_65__delay_js__ = __webpack_require__(199);
4830/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "delay", function() { return __WEBPACK_IMPORTED_MODULE_65__delay_js__["a"]; });
4831/* harmony import */ var __WEBPACK_IMPORTED_MODULE_66__defer_js__ = __webpack_require__(322);
4832/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "defer", function() { return __WEBPACK_IMPORTED_MODULE_66__defer_js__["a"]; });
4833/* harmony import */ var __WEBPACK_IMPORTED_MODULE_67__throttle_js__ = __webpack_require__(323);
4834/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "throttle", function() { return __WEBPACK_IMPORTED_MODULE_67__throttle_js__["a"]; });
4835/* harmony import */ var __WEBPACK_IMPORTED_MODULE_68__debounce_js__ = __webpack_require__(324);
4836/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "debounce", function() { return __WEBPACK_IMPORTED_MODULE_68__debounce_js__["a"]; });
4837/* harmony import */ var __WEBPACK_IMPORTED_MODULE_69__wrap_js__ = __webpack_require__(325);
4838/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "wrap", function() { return __WEBPACK_IMPORTED_MODULE_69__wrap_js__["a"]; });
4839/* harmony import */ var __WEBPACK_IMPORTED_MODULE_70__negate_js__ = __webpack_require__(138);
4840/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "negate", function() { return __WEBPACK_IMPORTED_MODULE_70__negate_js__["a"]; });
4841/* harmony import */ var __WEBPACK_IMPORTED_MODULE_71__compose_js__ = __webpack_require__(326);
4842/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "compose", function() { return __WEBPACK_IMPORTED_MODULE_71__compose_js__["a"]; });
4843/* harmony import */ var __WEBPACK_IMPORTED_MODULE_72__after_js__ = __webpack_require__(327);
4844/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "after", function() { return __WEBPACK_IMPORTED_MODULE_72__after_js__["a"]; });
4845/* harmony import */ var __WEBPACK_IMPORTED_MODULE_73__before_js__ = __webpack_require__(200);
4846/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "before", function() { return __WEBPACK_IMPORTED_MODULE_73__before_js__["a"]; });
4847/* harmony import */ var __WEBPACK_IMPORTED_MODULE_74__once_js__ = __webpack_require__(328);
4848/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "once", function() { return __WEBPACK_IMPORTED_MODULE_74__once_js__["a"]; });
4849/* harmony import */ var __WEBPACK_IMPORTED_MODULE_75__findKey_js__ = __webpack_require__(201);
4850/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "findKey", function() { return __WEBPACK_IMPORTED_MODULE_75__findKey_js__["a"]; });
4851/* harmony import */ var __WEBPACK_IMPORTED_MODULE_76__findIndex_js__ = __webpack_require__(139);
4852/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "findIndex", function() { return __WEBPACK_IMPORTED_MODULE_76__findIndex_js__["a"]; });
4853/* harmony import */ var __WEBPACK_IMPORTED_MODULE_77__findLastIndex_js__ = __webpack_require__(203);
4854/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "findLastIndex", function() { return __WEBPACK_IMPORTED_MODULE_77__findLastIndex_js__["a"]; });
4855/* harmony import */ var __WEBPACK_IMPORTED_MODULE_78__sortedIndex_js__ = __webpack_require__(204);
4856/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "sortedIndex", function() { return __WEBPACK_IMPORTED_MODULE_78__sortedIndex_js__["a"]; });
4857/* harmony import */ var __WEBPACK_IMPORTED_MODULE_79__indexOf_js__ = __webpack_require__(205);
4858/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "indexOf", function() { return __WEBPACK_IMPORTED_MODULE_79__indexOf_js__["a"]; });
4859/* harmony import */ var __WEBPACK_IMPORTED_MODULE_80__lastIndexOf_js__ = __webpack_require__(329);
4860/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "lastIndexOf", function() { return __WEBPACK_IMPORTED_MODULE_80__lastIndexOf_js__["a"]; });
4861/* harmony import */ var __WEBPACK_IMPORTED_MODULE_81__find_js__ = __webpack_require__(207);
4862/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "find", function() { return __WEBPACK_IMPORTED_MODULE_81__find_js__["a"]; });
4863/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "detect", function() { return __WEBPACK_IMPORTED_MODULE_81__find_js__["a"]; });
4864/* harmony import */ var __WEBPACK_IMPORTED_MODULE_82__findWhere_js__ = __webpack_require__(330);
4865/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "findWhere", function() { return __WEBPACK_IMPORTED_MODULE_82__findWhere_js__["a"]; });
4866/* harmony import */ var __WEBPACK_IMPORTED_MODULE_83__each_js__ = __webpack_require__(54);
4867/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "each", function() { return __WEBPACK_IMPORTED_MODULE_83__each_js__["a"]; });
4868/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "forEach", function() { return __WEBPACK_IMPORTED_MODULE_83__each_js__["a"]; });
4869/* harmony import */ var __WEBPACK_IMPORTED_MODULE_84__map_js__ = __webpack_require__(64);
4870/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "map", function() { return __WEBPACK_IMPORTED_MODULE_84__map_js__["a"]; });
4871/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "collect", function() { return __WEBPACK_IMPORTED_MODULE_84__map_js__["a"]; });
4872/* harmony import */ var __WEBPACK_IMPORTED_MODULE_85__reduce_js__ = __webpack_require__(331);
4873/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "reduce", function() { return __WEBPACK_IMPORTED_MODULE_85__reduce_js__["a"]; });
4874/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "foldl", function() { return __WEBPACK_IMPORTED_MODULE_85__reduce_js__["a"]; });
4875/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "inject", function() { return __WEBPACK_IMPORTED_MODULE_85__reduce_js__["a"]; });
4876/* harmony import */ var __WEBPACK_IMPORTED_MODULE_86__reduceRight_js__ = __webpack_require__(332);
4877/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "reduceRight", function() { return __WEBPACK_IMPORTED_MODULE_86__reduceRight_js__["a"]; });
4878/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "foldr", function() { return __WEBPACK_IMPORTED_MODULE_86__reduceRight_js__["a"]; });
4879/* harmony import */ var __WEBPACK_IMPORTED_MODULE_87__filter_js__ = __webpack_require__(83);
4880/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "filter", function() { return __WEBPACK_IMPORTED_MODULE_87__filter_js__["a"]; });
4881/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "select", function() { return __WEBPACK_IMPORTED_MODULE_87__filter_js__["a"]; });
4882/* harmony import */ var __WEBPACK_IMPORTED_MODULE_88__reject_js__ = __webpack_require__(333);
4883/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "reject", function() { return __WEBPACK_IMPORTED_MODULE_88__reject_js__["a"]; });
4884/* harmony import */ var __WEBPACK_IMPORTED_MODULE_89__every_js__ = __webpack_require__(334);
4885/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "every", function() { return __WEBPACK_IMPORTED_MODULE_89__every_js__["a"]; });
4886/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "all", function() { return __WEBPACK_IMPORTED_MODULE_89__every_js__["a"]; });
4887/* harmony import */ var __WEBPACK_IMPORTED_MODULE_90__some_js__ = __webpack_require__(335);
4888/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "some", function() { return __WEBPACK_IMPORTED_MODULE_90__some_js__["a"]; });
4889/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "any", function() { return __WEBPACK_IMPORTED_MODULE_90__some_js__["a"]; });
4890/* harmony import */ var __WEBPACK_IMPORTED_MODULE_91__contains_js__ = __webpack_require__(84);
4891/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "contains", function() { return __WEBPACK_IMPORTED_MODULE_91__contains_js__["a"]; });
4892/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "includes", function() { return __WEBPACK_IMPORTED_MODULE_91__contains_js__["a"]; });
4893/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "include", function() { return __WEBPACK_IMPORTED_MODULE_91__contains_js__["a"]; });
4894/* harmony import */ var __WEBPACK_IMPORTED_MODULE_92__invoke_js__ = __webpack_require__(336);
4895/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "invoke", function() { return __WEBPACK_IMPORTED_MODULE_92__invoke_js__["a"]; });
4896/* harmony import */ var __WEBPACK_IMPORTED_MODULE_93__pluck_js__ = __webpack_require__(140);
4897/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "pluck", function() { return __WEBPACK_IMPORTED_MODULE_93__pluck_js__["a"]; });
4898/* harmony import */ var __WEBPACK_IMPORTED_MODULE_94__where_js__ = __webpack_require__(337);
4899/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "where", function() { return __WEBPACK_IMPORTED_MODULE_94__where_js__["a"]; });
4900/* harmony import */ var __WEBPACK_IMPORTED_MODULE_95__max_js__ = __webpack_require__(209);
4901/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "max", function() { return __WEBPACK_IMPORTED_MODULE_95__max_js__["a"]; });
4902/* harmony import */ var __WEBPACK_IMPORTED_MODULE_96__min_js__ = __webpack_require__(338);
4903/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "min", function() { return __WEBPACK_IMPORTED_MODULE_96__min_js__["a"]; });
4904/* harmony import */ var __WEBPACK_IMPORTED_MODULE_97__shuffle_js__ = __webpack_require__(339);
4905/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "shuffle", function() { return __WEBPACK_IMPORTED_MODULE_97__shuffle_js__["a"]; });
4906/* harmony import */ var __WEBPACK_IMPORTED_MODULE_98__sample_js__ = __webpack_require__(210);
4907/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "sample", function() { return __WEBPACK_IMPORTED_MODULE_98__sample_js__["a"]; });
4908/* harmony import */ var __WEBPACK_IMPORTED_MODULE_99__sortBy_js__ = __webpack_require__(340);
4909/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "sortBy", function() { return __WEBPACK_IMPORTED_MODULE_99__sortBy_js__["a"]; });
4910/* harmony import */ var __WEBPACK_IMPORTED_MODULE_100__groupBy_js__ = __webpack_require__(341);
4911/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "groupBy", function() { return __WEBPACK_IMPORTED_MODULE_100__groupBy_js__["a"]; });
4912/* harmony import */ var __WEBPACK_IMPORTED_MODULE_101__indexBy_js__ = __webpack_require__(342);
4913/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "indexBy", function() { return __WEBPACK_IMPORTED_MODULE_101__indexBy_js__["a"]; });
4914/* harmony import */ var __WEBPACK_IMPORTED_MODULE_102__countBy_js__ = __webpack_require__(343);
4915/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "countBy", function() { return __WEBPACK_IMPORTED_MODULE_102__countBy_js__["a"]; });
4916/* harmony import */ var __WEBPACK_IMPORTED_MODULE_103__partition_js__ = __webpack_require__(344);
4917/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "partition", function() { return __WEBPACK_IMPORTED_MODULE_103__partition_js__["a"]; });
4918/* harmony import */ var __WEBPACK_IMPORTED_MODULE_104__toArray_js__ = __webpack_require__(345);
4919/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "toArray", function() { return __WEBPACK_IMPORTED_MODULE_104__toArray_js__["a"]; });
4920/* harmony import */ var __WEBPACK_IMPORTED_MODULE_105__size_js__ = __webpack_require__(346);
4921/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "size", function() { return __WEBPACK_IMPORTED_MODULE_105__size_js__["a"]; });
4922/* harmony import */ var __WEBPACK_IMPORTED_MODULE_106__pick_js__ = __webpack_require__(211);
4923/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "pick", function() { return __WEBPACK_IMPORTED_MODULE_106__pick_js__["a"]; });
4924/* harmony import */ var __WEBPACK_IMPORTED_MODULE_107__omit_js__ = __webpack_require__(348);
4925/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "omit", function() { return __WEBPACK_IMPORTED_MODULE_107__omit_js__["a"]; });
4926/* harmony import */ var __WEBPACK_IMPORTED_MODULE_108__first_js__ = __webpack_require__(349);
4927/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "first", function() { return __WEBPACK_IMPORTED_MODULE_108__first_js__["a"]; });
4928/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "head", function() { return __WEBPACK_IMPORTED_MODULE_108__first_js__["a"]; });
4929/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "take", function() { return __WEBPACK_IMPORTED_MODULE_108__first_js__["a"]; });
4930/* harmony import */ var __WEBPACK_IMPORTED_MODULE_109__initial_js__ = __webpack_require__(212);
4931/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "initial", function() { return __WEBPACK_IMPORTED_MODULE_109__initial_js__["a"]; });
4932/* harmony import */ var __WEBPACK_IMPORTED_MODULE_110__last_js__ = __webpack_require__(350);
4933/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "last", function() { return __WEBPACK_IMPORTED_MODULE_110__last_js__["a"]; });
4934/* harmony import */ var __WEBPACK_IMPORTED_MODULE_111__rest_js__ = __webpack_require__(213);
4935/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "rest", function() { return __WEBPACK_IMPORTED_MODULE_111__rest_js__["a"]; });
4936/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "tail", function() { return __WEBPACK_IMPORTED_MODULE_111__rest_js__["a"]; });
4937/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "drop", function() { return __WEBPACK_IMPORTED_MODULE_111__rest_js__["a"]; });
4938/* harmony import */ var __WEBPACK_IMPORTED_MODULE_112__compact_js__ = __webpack_require__(351);
4939/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "compact", function() { return __WEBPACK_IMPORTED_MODULE_112__compact_js__["a"]; });
4940/* harmony import */ var __WEBPACK_IMPORTED_MODULE_113__flatten_js__ = __webpack_require__(352);
4941/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "flatten", function() { return __WEBPACK_IMPORTED_MODULE_113__flatten_js__["a"]; });
4942/* harmony import */ var __WEBPACK_IMPORTED_MODULE_114__without_js__ = __webpack_require__(353);
4943/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "without", function() { return __WEBPACK_IMPORTED_MODULE_114__without_js__["a"]; });
4944/* harmony import */ var __WEBPACK_IMPORTED_MODULE_115__uniq_js__ = __webpack_require__(215);
4945/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "uniq", function() { return __WEBPACK_IMPORTED_MODULE_115__uniq_js__["a"]; });
4946/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "unique", function() { return __WEBPACK_IMPORTED_MODULE_115__uniq_js__["a"]; });
4947/* harmony import */ var __WEBPACK_IMPORTED_MODULE_116__union_js__ = __webpack_require__(354);
4948/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "union", function() { return __WEBPACK_IMPORTED_MODULE_116__union_js__["a"]; });
4949/* harmony import */ var __WEBPACK_IMPORTED_MODULE_117__intersection_js__ = __webpack_require__(355);
4950/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "intersection", function() { return __WEBPACK_IMPORTED_MODULE_117__intersection_js__["a"]; });
4951/* harmony import */ var __WEBPACK_IMPORTED_MODULE_118__difference_js__ = __webpack_require__(214);
4952/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "difference", function() { return __WEBPACK_IMPORTED_MODULE_118__difference_js__["a"]; });
4953/* harmony import */ var __WEBPACK_IMPORTED_MODULE_119__unzip_js__ = __webpack_require__(216);
4954/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "unzip", function() { return __WEBPACK_IMPORTED_MODULE_119__unzip_js__["a"]; });
4955/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "transpose", function() { return __WEBPACK_IMPORTED_MODULE_119__unzip_js__["a"]; });
4956/* harmony import */ var __WEBPACK_IMPORTED_MODULE_120__zip_js__ = __webpack_require__(356);
4957/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "zip", function() { return __WEBPACK_IMPORTED_MODULE_120__zip_js__["a"]; });
4958/* harmony import */ var __WEBPACK_IMPORTED_MODULE_121__object_js__ = __webpack_require__(357);
4959/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "object", function() { return __WEBPACK_IMPORTED_MODULE_121__object_js__["a"]; });
4960/* harmony import */ var __WEBPACK_IMPORTED_MODULE_122__range_js__ = __webpack_require__(358);
4961/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "range", function() { return __WEBPACK_IMPORTED_MODULE_122__range_js__["a"]; });
4962/* harmony import */ var __WEBPACK_IMPORTED_MODULE_123__chunk_js__ = __webpack_require__(359);
4963/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "chunk", function() { return __WEBPACK_IMPORTED_MODULE_123__chunk_js__["a"]; });
4964/* harmony import */ var __WEBPACK_IMPORTED_MODULE_124__mixin_js__ = __webpack_require__(360);
4965/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "mixin", function() { return __WEBPACK_IMPORTED_MODULE_124__mixin_js__["a"]; });
4966/* harmony import */ var __WEBPACK_IMPORTED_MODULE_125__underscore_array_methods_js__ = __webpack_require__(361);
4967/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return __WEBPACK_IMPORTED_MODULE_125__underscore_array_methods_js__["a"]; });
4968// Named Exports
4969// =============
4970
4971// Underscore.js 1.12.1
4972// https://underscorejs.org
4973// (c) 2009-2020 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
4974// Underscore may be freely distributed under the MIT license.
4975
4976// Baseline setup.
4977
4978
4979
4980// Object Functions
4981// ----------------
4982// Our most fundamental functions operate on any JavaScript object.
4983// Most functions in Underscore depend on at least one function in this section.
4984
4985// A group of functions that check the types of core JavaScript values.
4986// These are often informally referred to as the "isType" functions.
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014// Functions that treat an object as a dictionary of key-value pairs.
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031// Utility Functions
5032// -----------------
5033// A bit of a grab bag: Predicate-generating functions for use with filters and
5034// loops, string escaping and templating, create random numbers and unique ids,
5035// and functions that facilitate Underscore's chaining and iteration conventions.
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055// Function (ahem) Functions
5056// -------------------------
5057// These functions take a function as an argument and return a new function
5058// as the result. Also known as higher-order functions.
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074// Finders
5075// -------
5076// Functions that extract (the position of) a single element from an object
5077// or array based on some criterion.
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087// Collection Functions
5088// --------------------
5089// Functions that work on any collection of elements: either an array, or
5090// an object of key-value pairs.
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115// `_.pick` and `_.omit` are actually object functions, but we put
5116// them here in order to create a more natural reading order in the
5117// monolithic build as they depend on `_.contains`.
5118
5119
5120
5121// Array Functions
5122// ---------------
5123// Functions that operate on arrays (and array-likes) only, because they’re
5124// expressed in terms of operations on an ordered list of values.
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142// OOP
5143// ---
5144// These modules support the "object-oriented" calling style. See also
5145// `underscore.js` and `index-default.js`.
5146
5147
5148
5149
5150/***/ }),
5151/* 127 */
5152/***/ (function(module, __webpack_exports__, __webpack_require__) {
5153
5154"use strict";
5155/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
5156
5157
5158/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('String'));
5159
5160
5161/***/ }),
5162/* 128 */
5163/***/ (function(module, __webpack_exports__, __webpack_require__) {
5164
5165"use strict";
5166/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
5167/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(27);
5168/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isArrayBuffer_js__ = __webpack_require__(174);
5169/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__stringTagBug_js__ = __webpack_require__(79);
5170
5171
5172
5173
5174
5175var isDataView = Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('DataView');
5176
5177// In IE 10 - Edge 13, we need a different heuristic
5178// to determine whether an object is a `DataView`.
5179function ie10IsDataView(obj) {
5180 return obj != null && Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(obj.getInt8) && Object(__WEBPACK_IMPORTED_MODULE_2__isArrayBuffer_js__["a" /* default */])(obj.buffer);
5181}
5182
5183/* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_3__stringTagBug_js__["a" /* hasStringTagBug */] ? ie10IsDataView : isDataView);
5184
5185
5186/***/ }),
5187/* 129 */
5188/***/ (function(module, __webpack_exports__, __webpack_require__) {
5189
5190"use strict";
5191/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
5192/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__has_js__ = __webpack_require__(40);
5193
5194
5195
5196var isArguments = Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Arguments');
5197
5198// Define a fallback version of the method in browsers (ahem, IE < 9), where
5199// there isn't any inspectable "Arguments" type.
5200(function() {
5201 if (!isArguments(arguments)) {
5202 isArguments = function(obj) {
5203 return Object(__WEBPACK_IMPORTED_MODULE_1__has_js__["a" /* default */])(obj, 'callee');
5204 };
5205 }
5206}());
5207
5208/* harmony default export */ __webpack_exports__["a"] = (isArguments);
5209
5210
5211/***/ }),
5212/* 130 */
5213/***/ (function(module, __webpack_exports__, __webpack_require__) {
5214
5215"use strict";
5216/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__shallowProperty_js__ = __webpack_require__(179);
5217
5218
5219// Internal helper to obtain the `byteLength` property of an object.
5220/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__shallowProperty_js__["a" /* default */])('byteLength'));
5221
5222
5223/***/ }),
5224/* 131 */
5225/***/ (function(module, __webpack_exports__, __webpack_require__) {
5226
5227"use strict";
5228/* harmony export (immutable) */ __webpack_exports__["a"] = ie11fingerprint;
5229/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return mapMethods; });
5230/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return weakMapMethods; });
5231/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return setMethods; });
5232/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(28);
5233/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(27);
5234/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__allKeys_js__ = __webpack_require__(80);
5235
5236
5237
5238
5239// Since the regular `Object.prototype.toString` type tests don't work for
5240// some types in IE 11, we use a fingerprinting heuristic instead, based
5241// on the methods. It's not great, but it's the best we got.
5242// The fingerprint method lists are defined below.
5243function ie11fingerprint(methods) {
5244 var length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(methods);
5245 return function(obj) {
5246 if (obj == null) return false;
5247 // `Map`, `WeakMap` and `Set` have no enumerable keys.
5248 var keys = Object(__WEBPACK_IMPORTED_MODULE_2__allKeys_js__["a" /* default */])(obj);
5249 if (Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(keys)) return false;
5250 for (var i = 0; i < length; i++) {
5251 if (!Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(obj[methods[i]])) return false;
5252 }
5253 // If we are testing against `WeakMap`, we need to ensure that
5254 // `obj` doesn't have a `forEach` method in order to distinguish
5255 // it from a regular `Map`.
5256 return methods !== weakMapMethods || !Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(obj[forEachName]);
5257 };
5258}
5259
5260// In the interest of compact minification, we write
5261// each string in the fingerprints only once.
5262var forEachName = 'forEach',
5263 hasName = 'has',
5264 commonInit = ['clear', 'delete'],
5265 mapTail = ['get', hasName, 'set'];
5266
5267// `Map`, `WeakMap` and `Set` each have slightly different
5268// combinations of the above sublists.
5269var mapMethods = commonInit.concat(forEachName, mapTail),
5270 weakMapMethods = commonInit.concat(mapTail),
5271 setMethods = ['add'].concat(commonInit, forEachName, hasName);
5272
5273
5274/***/ }),
5275/* 132 */
5276/***/ (function(module, __webpack_exports__, __webpack_require__) {
5277
5278"use strict";
5279/* harmony export (immutable) */ __webpack_exports__["a"] = createAssigner;
5280// An internal function for creating assigner functions.
5281function createAssigner(keysFunc, defaults) {
5282 return function(obj) {
5283 var length = arguments.length;
5284 if (defaults) obj = Object(obj);
5285 if (length < 2 || obj == null) return obj;
5286 for (var index = 1; index < length; index++) {
5287 var source = arguments[index],
5288 keys = keysFunc(source),
5289 l = keys.length;
5290 for (var i = 0; i < l; i++) {
5291 var key = keys[i];
5292 if (!defaults || obj[key] === void 0) obj[key] = source[key];
5293 }
5294 }
5295 return obj;
5296 };
5297}
5298
5299
5300/***/ }),
5301/* 133 */
5302/***/ (function(module, __webpack_exports__, __webpack_require__) {
5303
5304"use strict";
5305/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createAssigner_js__ = __webpack_require__(132);
5306/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__keys_js__ = __webpack_require__(15);
5307
5308
5309
5310// Assigns a given object with all the own properties in the passed-in
5311// object(s).
5312// (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)
5313/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createAssigner_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__keys_js__["a" /* default */]));
5314
5315
5316/***/ }),
5317/* 134 */
5318/***/ (function(module, __webpack_exports__, __webpack_require__) {
5319
5320"use strict";
5321/* harmony export (immutable) */ __webpack_exports__["a"] = deepGet;
5322// Internal function to obtain a nested property in `obj` along `path`.
5323function deepGet(obj, path) {
5324 var length = path.length;
5325 for (var i = 0; i < length; i++) {
5326 if (obj == null) return void 0;
5327 obj = obj[path[i]];
5328 }
5329 return length ? obj : void 0;
5330}
5331
5332
5333/***/ }),
5334/* 135 */
5335/***/ (function(module, __webpack_exports__, __webpack_require__) {
5336
5337"use strict";
5338/* harmony export (immutable) */ __webpack_exports__["a"] = identity;
5339// Keep the identity function around for default iteratees.
5340function identity(value) {
5341 return value;
5342}
5343
5344
5345/***/ }),
5346/* 136 */
5347/***/ (function(module, __webpack_exports__, __webpack_require__) {
5348
5349"use strict";
5350/* harmony export (immutable) */ __webpack_exports__["a"] = property;
5351/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__deepGet_js__ = __webpack_require__(134);
5352/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__toPath_js__ = __webpack_require__(81);
5353
5354
5355
5356// Creates a function that, when passed an object, will traverse that object’s
5357// properties down the given `path`, specified as an array of keys or indices.
5358function property(path) {
5359 path = Object(__WEBPACK_IMPORTED_MODULE_1__toPath_js__["a" /* default */])(path);
5360 return function(obj) {
5361 return Object(__WEBPACK_IMPORTED_MODULE_0__deepGet_js__["a" /* default */])(obj, path);
5362 };
5363}
5364
5365
5366/***/ }),
5367/* 137 */
5368/***/ (function(module, __webpack_exports__, __webpack_require__) {
5369
5370"use strict";
5371// A (possibly faster) way to get the current timestamp as an integer.
5372/* harmony default export */ __webpack_exports__["a"] = (Date.now || function() {
5373 return new Date().getTime();
5374});
5375
5376
5377/***/ }),
5378/* 138 */
5379/***/ (function(module, __webpack_exports__, __webpack_require__) {
5380
5381"use strict";
5382/* harmony export (immutable) */ __webpack_exports__["a"] = negate;
5383// Returns a negated version of the passed-in predicate.
5384function negate(predicate) {
5385 return function() {
5386 return !predicate.apply(this, arguments);
5387 };
5388}
5389
5390
5391/***/ }),
5392/* 139 */
5393/***/ (function(module, __webpack_exports__, __webpack_require__) {
5394
5395"use strict";
5396/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createPredicateIndexFinder_js__ = __webpack_require__(202);
5397
5398
5399// Returns the first index on an array-like that passes a truth test.
5400/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createPredicateIndexFinder_js__["a" /* default */])(1));
5401
5402
5403/***/ }),
5404/* 140 */
5405/***/ (function(module, __webpack_exports__, __webpack_require__) {
5406
5407"use strict";
5408/* harmony export (immutable) */ __webpack_exports__["a"] = pluck;
5409/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__map_js__ = __webpack_require__(64);
5410/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__property_js__ = __webpack_require__(136);
5411
5412
5413
5414// Convenience version of a common use case of `_.map`: fetching a property.
5415function pluck(obj, key) {
5416 return Object(__WEBPACK_IMPORTED_MODULE_0__map_js__["a" /* default */])(obj, Object(__WEBPACK_IMPORTED_MODULE_1__property_js__["a" /* default */])(key));
5417}
5418
5419
5420/***/ }),
5421/* 141 */
5422/***/ (function(module, exports, __webpack_require__) {
5423
5424module.exports = __webpack_require__(371);
5425
5426/***/ }),
5427/* 142 */
5428/***/ (function(module, exports, __webpack_require__) {
5429
5430module.exports = __webpack_require__(222);
5431
5432/***/ }),
5433/* 143 */
5434/***/ (function(module, exports, __webpack_require__) {
5435
5436module.exports = __webpack_require__(230);
5437
5438/***/ }),
5439/* 144 */
5440/***/ (function(module, exports, __webpack_require__) {
5441
5442var wellKnownSymbol = __webpack_require__(9);
5443
5444exports.f = wellKnownSymbol;
5445
5446
5447/***/ }),
5448/* 145 */
5449/***/ (function(module, exports, __webpack_require__) {
5450
5451module.exports = __webpack_require__(477);
5452
5453/***/ }),
5454/* 146 */
5455/***/ (function(module, exports, __webpack_require__) {
5456
5457var defineBuiltIn = __webpack_require__(39);
5458
5459module.exports = function (target, src, options) {
5460 for (var key in src) {
5461 if (options && options.unsafe && target[key]) target[key] = src[key];
5462 else defineBuiltIn(target, key, src[key], options);
5463 } return target;
5464};
5465
5466
5467/***/ }),
5468/* 147 */
5469/***/ (function(module, exports, __webpack_require__) {
5470
5471/* eslint-disable es-x/no-symbol -- required for testing */
5472var NATIVE_SYMBOL = __webpack_require__(57);
5473
5474module.exports = NATIVE_SYMBOL
5475 && !Symbol.sham
5476 && typeof Symbol.iterator == 'symbol';
5477
5478
5479/***/ }),
5480/* 148 */
5481/***/ (function(module, exports, __webpack_require__) {
5482
5483var DESCRIPTORS = __webpack_require__(16);
5484var fails = __webpack_require__(3);
5485var createElement = __webpack_require__(118);
5486
5487// Thanks to IE8 for its funny defineProperty
5488module.exports = !DESCRIPTORS && !fails(function () {
5489 // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
5490 return Object.defineProperty(createElement('div'), 'a', {
5491 get: function () { return 7; }
5492 }).a != 7;
5493});
5494
5495
5496/***/ }),
5497/* 149 */
5498/***/ (function(module, exports, __webpack_require__) {
5499
5500var fails = __webpack_require__(3);
5501var isCallable = __webpack_require__(7);
5502
5503var replacement = /#|\.prototype\./;
5504
5505var isForced = function (feature, detection) {
5506 var value = data[normalize(feature)];
5507 return value == POLYFILL ? true
5508 : value == NATIVE ? false
5509 : isCallable(detection) ? fails(detection)
5510 : !!detection;
5511};
5512
5513var normalize = isForced.normalize = function (string) {
5514 return String(string).replace(replacement, '.').toLowerCase();
5515};
5516
5517var data = isForced.data = {};
5518var NATIVE = isForced.NATIVE = 'N';
5519var POLYFILL = isForced.POLYFILL = 'P';
5520
5521module.exports = isForced;
5522
5523
5524/***/ }),
5525/* 150 */
5526/***/ (function(module, exports, __webpack_require__) {
5527
5528var DESCRIPTORS = __webpack_require__(16);
5529var fails = __webpack_require__(3);
5530
5531// V8 ~ Chrome 36-
5532// https://bugs.chromium.org/p/v8/issues/detail?id=3334
5533module.exports = DESCRIPTORS && fails(function () {
5534 // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
5535 return Object.defineProperty(function () { /* empty */ }, 'prototype', {
5536 value: 42,
5537 writable: false
5538 }).prototype != 42;
5539});
5540
5541
5542/***/ }),
5543/* 151 */
5544/***/ (function(module, exports, __webpack_require__) {
5545
5546var fails = __webpack_require__(3);
5547
5548module.exports = !fails(function () {
5549 function F() { /* empty */ }
5550 F.prototype.constructor = null;
5551 // eslint-disable-next-line es-x/no-object-getprototypeof -- required for testing
5552 return Object.getPrototypeOf(new F()) !== F.prototype;
5553});
5554
5555
5556/***/ }),
5557/* 152 */
5558/***/ (function(module, exports, __webpack_require__) {
5559
5560var uncurryThis = __webpack_require__(4);
5561var hasOwn = __webpack_require__(14);
5562var toIndexedObject = __webpack_require__(33);
5563var indexOf = __webpack_require__(153).indexOf;
5564var hiddenKeys = __webpack_require__(74);
5565
5566var push = uncurryThis([].push);
5567
5568module.exports = function (object, names) {
5569 var O = toIndexedObject(object);
5570 var i = 0;
5571 var result = [];
5572 var key;
5573 for (key in O) !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key);
5574 // Don't enum bug & hidden keys
5575 while (names.length > i) if (hasOwn(O, key = names[i++])) {
5576 ~indexOf(result, key) || push(result, key);
5577 }
5578 return result;
5579};
5580
5581
5582/***/ }),
5583/* 153 */
5584/***/ (function(module, exports, __webpack_require__) {
5585
5586var toIndexedObject = __webpack_require__(33);
5587var toAbsoluteIndex = __webpack_require__(119);
5588var lengthOfArrayLike = __webpack_require__(46);
5589
5590// `Array.prototype.{ indexOf, includes }` methods implementation
5591var createMethod = function (IS_INCLUDES) {
5592 return function ($this, el, fromIndex) {
5593 var O = toIndexedObject($this);
5594 var length = lengthOfArrayLike(O);
5595 var index = toAbsoluteIndex(fromIndex, length);
5596 var value;
5597 // Array#includes uses SameValueZero equality algorithm
5598 // eslint-disable-next-line no-self-compare -- NaN check
5599 if (IS_INCLUDES && el != el) while (length > index) {
5600 value = O[index++];
5601 // eslint-disable-next-line no-self-compare -- NaN check
5602 if (value != value) return true;
5603 // Array#indexOf ignores holes, Array#includes - not
5604 } else for (;length > index; index++) {
5605 if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
5606 } return !IS_INCLUDES && -1;
5607 };
5608};
5609
5610module.exports = {
5611 // `Array.prototype.includes` method
5612 // https://tc39.es/ecma262/#sec-array.prototype.includes
5613 includes: createMethod(true),
5614 // `Array.prototype.indexOf` method
5615 // https://tc39.es/ecma262/#sec-array.prototype.indexof
5616 indexOf: createMethod(false)
5617};
5618
5619
5620/***/ }),
5621/* 154 */
5622/***/ (function(module, exports, __webpack_require__) {
5623
5624var DESCRIPTORS = __webpack_require__(16);
5625var V8_PROTOTYPE_DEFINE_BUG = __webpack_require__(150);
5626var definePropertyModule = __webpack_require__(22);
5627var anObject = __webpack_require__(19);
5628var toIndexedObject = __webpack_require__(33);
5629var objectKeys = __webpack_require__(98);
5630
5631// `Object.defineProperties` method
5632// https://tc39.es/ecma262/#sec-object.defineproperties
5633// eslint-disable-next-line es-x/no-object-defineproperties -- safe
5634exports.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
5635 anObject(O);
5636 var props = toIndexedObject(Properties);
5637 var keys = objectKeys(Properties);
5638 var length = keys.length;
5639 var index = 0;
5640 var key;
5641 while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);
5642 return O;
5643};
5644
5645
5646/***/ }),
5647/* 155 */
5648/***/ (function(module, exports, __webpack_require__) {
5649
5650var getBuiltIn = __webpack_require__(18);
5651
5652module.exports = getBuiltIn('document', 'documentElement');
5653
5654
5655/***/ }),
5656/* 156 */
5657/***/ (function(module, exports, __webpack_require__) {
5658
5659var wellKnownSymbol = __webpack_require__(9);
5660var Iterators = __webpack_require__(58);
5661
5662var ITERATOR = wellKnownSymbol('iterator');
5663var ArrayPrototype = Array.prototype;
5664
5665// check on default Array iterator
5666module.exports = function (it) {
5667 return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);
5668};
5669
5670
5671/***/ }),
5672/* 157 */
5673/***/ (function(module, exports, __webpack_require__) {
5674
5675var call = __webpack_require__(13);
5676var aCallable = __webpack_require__(31);
5677var anObject = __webpack_require__(19);
5678var tryToString = __webpack_require__(72);
5679var getIteratorMethod = __webpack_require__(99);
5680
5681var $TypeError = TypeError;
5682
5683module.exports = function (argument, usingIterator) {
5684 var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
5685 if (aCallable(iteratorMethod)) return anObject(call(iteratorMethod, argument));
5686 throw $TypeError(tryToString(argument) + ' is not iterable');
5687};
5688
5689
5690/***/ }),
5691/* 158 */
5692/***/ (function(module, exports, __webpack_require__) {
5693
5694var call = __webpack_require__(13);
5695var anObject = __webpack_require__(19);
5696var getMethod = __webpack_require__(116);
5697
5698module.exports = function (iterator, kind, value) {
5699 var innerResult, innerError;
5700 anObject(iterator);
5701 try {
5702 innerResult = getMethod(iterator, 'return');
5703 if (!innerResult) {
5704 if (kind === 'throw') throw value;
5705 return value;
5706 }
5707 innerResult = call(innerResult, iterator);
5708 } catch (error) {
5709 innerError = true;
5710 innerResult = error;
5711 }
5712 if (kind === 'throw') throw value;
5713 if (innerError) throw innerResult;
5714 anObject(innerResult);
5715 return value;
5716};
5717
5718
5719/***/ }),
5720/* 159 */
5721/***/ (function(module, exports) {
5722
5723module.exports = function () { /* empty */ };
5724
5725
5726/***/ }),
5727/* 160 */
5728/***/ (function(module, exports, __webpack_require__) {
5729
5730var global = __webpack_require__(6);
5731var isCallable = __webpack_require__(7);
5732var inspectSource = __webpack_require__(123);
5733
5734var WeakMap = global.WeakMap;
5735
5736module.exports = isCallable(WeakMap) && /native code/.test(inspectSource(WeakMap));
5737
5738
5739/***/ }),
5740/* 161 */
5741/***/ (function(module, exports, __webpack_require__) {
5742
5743"use strict";
5744
5745var fails = __webpack_require__(3);
5746var isCallable = __webpack_require__(7);
5747var create = __webpack_require__(47);
5748var getPrototypeOf = __webpack_require__(93);
5749var defineBuiltIn = __webpack_require__(39);
5750var wellKnownSymbol = __webpack_require__(9);
5751var IS_PURE = __webpack_require__(32);
5752
5753var ITERATOR = wellKnownSymbol('iterator');
5754var BUGGY_SAFARI_ITERATORS = false;
5755
5756// `%IteratorPrototype%` object
5757// https://tc39.es/ecma262/#sec-%iteratorprototype%-object
5758var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
5759
5760/* eslint-disable es-x/no-array-prototype-keys -- safe */
5761if ([].keys) {
5762 arrayIterator = [].keys();
5763 // Safari 8 has buggy iterators w/o `next`
5764 if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;
5765 else {
5766 PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));
5767 if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;
5768 }
5769}
5770
5771var NEW_ITERATOR_PROTOTYPE = IteratorPrototype == undefined || fails(function () {
5772 var test = {};
5773 // FF44- legacy iterators case
5774 return IteratorPrototype[ITERATOR].call(test) !== test;
5775});
5776
5777if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {};
5778else if (IS_PURE) IteratorPrototype = create(IteratorPrototype);
5779
5780// `%IteratorPrototype%[@@iterator]()` method
5781// https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
5782if (!isCallable(IteratorPrototype[ITERATOR])) {
5783 defineBuiltIn(IteratorPrototype, ITERATOR, function () {
5784 return this;
5785 });
5786}
5787
5788module.exports = {
5789 IteratorPrototype: IteratorPrototype,
5790 BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
5791};
5792
5793
5794/***/ }),
5795/* 162 */
5796/***/ (function(module, exports, __webpack_require__) {
5797
5798"use strict";
5799
5800var getBuiltIn = __webpack_require__(18);
5801var definePropertyModule = __webpack_require__(22);
5802var wellKnownSymbol = __webpack_require__(9);
5803var DESCRIPTORS = __webpack_require__(16);
5804
5805var SPECIES = wellKnownSymbol('species');
5806
5807module.exports = function (CONSTRUCTOR_NAME) {
5808 var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
5809 var defineProperty = definePropertyModule.f;
5810
5811 if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) {
5812 defineProperty(Constructor, SPECIES, {
5813 configurable: true,
5814 get: function () { return this; }
5815 });
5816 }
5817};
5818
5819
5820/***/ }),
5821/* 163 */
5822/***/ (function(module, exports, __webpack_require__) {
5823
5824var anObject = __webpack_require__(19);
5825var aConstructor = __webpack_require__(164);
5826var wellKnownSymbol = __webpack_require__(9);
5827
5828var SPECIES = wellKnownSymbol('species');
5829
5830// `SpeciesConstructor` abstract operation
5831// https://tc39.es/ecma262/#sec-speciesconstructor
5832module.exports = function (O, defaultConstructor) {
5833 var C = anObject(O).constructor;
5834 var S;
5835 return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? defaultConstructor : aConstructor(S);
5836};
5837
5838
5839/***/ }),
5840/* 164 */
5841/***/ (function(module, exports, __webpack_require__) {
5842
5843var isConstructor = __webpack_require__(101);
5844var tryToString = __webpack_require__(72);
5845
5846var $TypeError = TypeError;
5847
5848// `Assert: IsConstructor(argument) is true`
5849module.exports = function (argument) {
5850 if (isConstructor(argument)) return argument;
5851 throw $TypeError(tryToString(argument) + ' is not a constructor');
5852};
5853
5854
5855/***/ }),
5856/* 165 */
5857/***/ (function(module, exports, __webpack_require__) {
5858
5859var global = __webpack_require__(6);
5860var apply = __webpack_require__(69);
5861var bind = __webpack_require__(45);
5862var isCallable = __webpack_require__(7);
5863var hasOwn = __webpack_require__(14);
5864var fails = __webpack_require__(3);
5865var html = __webpack_require__(155);
5866var arraySlice = __webpack_require__(102);
5867var createElement = __webpack_require__(118);
5868var validateArgumentsLength = __webpack_require__(273);
5869var IS_IOS = __webpack_require__(166);
5870var IS_NODE = __webpack_require__(125);
5871
5872var set = global.setImmediate;
5873var clear = global.clearImmediate;
5874var process = global.process;
5875var Dispatch = global.Dispatch;
5876var Function = global.Function;
5877var MessageChannel = global.MessageChannel;
5878var String = global.String;
5879var counter = 0;
5880var queue = {};
5881var ONREADYSTATECHANGE = 'onreadystatechange';
5882var location, defer, channel, port;
5883
5884try {
5885 // Deno throws a ReferenceError on `location` access without `--location` flag
5886 location = global.location;
5887} catch (error) { /* empty */ }
5888
5889var run = function (id) {
5890 if (hasOwn(queue, id)) {
5891 var fn = queue[id];
5892 delete queue[id];
5893 fn();
5894 }
5895};
5896
5897var runner = function (id) {
5898 return function () {
5899 run(id);
5900 };
5901};
5902
5903var listener = function (event) {
5904 run(event.data);
5905};
5906
5907var post = function (id) {
5908 // old engines have not location.origin
5909 global.postMessage(String(id), location.protocol + '//' + location.host);
5910};
5911
5912// Node.js 0.9+ & IE10+ has setImmediate, otherwise:
5913if (!set || !clear) {
5914 set = function setImmediate(handler) {
5915 validateArgumentsLength(arguments.length, 1);
5916 var fn = isCallable(handler) ? handler : Function(handler);
5917 var args = arraySlice(arguments, 1);
5918 queue[++counter] = function () {
5919 apply(fn, undefined, args);
5920 };
5921 defer(counter);
5922 return counter;
5923 };
5924 clear = function clearImmediate(id) {
5925 delete queue[id];
5926 };
5927 // Node.js 0.8-
5928 if (IS_NODE) {
5929 defer = function (id) {
5930 process.nextTick(runner(id));
5931 };
5932 // Sphere (JS game engine) Dispatch API
5933 } else if (Dispatch && Dispatch.now) {
5934 defer = function (id) {
5935 Dispatch.now(runner(id));
5936 };
5937 // Browsers with MessageChannel, includes WebWorkers
5938 // except iOS - https://github.com/zloirock/core-js/issues/624
5939 } else if (MessageChannel && !IS_IOS) {
5940 channel = new MessageChannel();
5941 port = channel.port2;
5942 channel.port1.onmessage = listener;
5943 defer = bind(port.postMessage, port);
5944 // Browsers with postMessage, skip WebWorkers
5945 // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
5946 } else if (
5947 global.addEventListener &&
5948 isCallable(global.postMessage) &&
5949 !global.importScripts &&
5950 location && location.protocol !== 'file:' &&
5951 !fails(post)
5952 ) {
5953 defer = post;
5954 global.addEventListener('message', listener, false);
5955 // IE8-
5956 } else if (ONREADYSTATECHANGE in createElement('script')) {
5957 defer = function (id) {
5958 html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {
5959 html.removeChild(this);
5960 run(id);
5961 };
5962 };
5963 // Rest old browsers
5964 } else {
5965 defer = function (id) {
5966 setTimeout(runner(id), 0);
5967 };
5968 }
5969}
5970
5971module.exports = {
5972 set: set,
5973 clear: clear
5974};
5975
5976
5977/***/ }),
5978/* 166 */
5979/***/ (function(module, exports, __webpack_require__) {
5980
5981var userAgent = __webpack_require__(91);
5982
5983module.exports = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent);
5984
5985
5986/***/ }),
5987/* 167 */
5988/***/ (function(module, exports, __webpack_require__) {
5989
5990var NativePromiseConstructor = __webpack_require__(61);
5991var checkCorrectnessOfIteration = __webpack_require__(168);
5992var FORCED_PROMISE_CONSTRUCTOR = __webpack_require__(77).CONSTRUCTOR;
5993
5994module.exports = FORCED_PROMISE_CONSTRUCTOR || !checkCorrectnessOfIteration(function (iterable) {
5995 NativePromiseConstructor.all(iterable).then(undefined, function () { /* empty */ });
5996});
5997
5998
5999/***/ }),
6000/* 168 */
6001/***/ (function(module, exports, __webpack_require__) {
6002
6003var wellKnownSymbol = __webpack_require__(9);
6004
6005var ITERATOR = wellKnownSymbol('iterator');
6006var SAFE_CLOSING = false;
6007
6008try {
6009 var called = 0;
6010 var iteratorWithReturn = {
6011 next: function () {
6012 return { done: !!called++ };
6013 },
6014 'return': function () {
6015 SAFE_CLOSING = true;
6016 }
6017 };
6018 iteratorWithReturn[ITERATOR] = function () {
6019 return this;
6020 };
6021 // eslint-disable-next-line es-x/no-array-from, no-throw-literal -- required for testing
6022 Array.from(iteratorWithReturn, function () { throw 2; });
6023} catch (error) { /* empty */ }
6024
6025module.exports = function (exec, SKIP_CLOSING) {
6026 if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
6027 var ITERATION_SUPPORT = false;
6028 try {
6029 var object = {};
6030 object[ITERATOR] = function () {
6031 return {
6032 next: function () {
6033 return { done: ITERATION_SUPPORT = true };
6034 }
6035 };
6036 };
6037 exec(object);
6038 } catch (error) { /* empty */ }
6039 return ITERATION_SUPPORT;
6040};
6041
6042
6043/***/ }),
6044/* 169 */
6045/***/ (function(module, exports, __webpack_require__) {
6046
6047var anObject = __webpack_require__(19);
6048var isObject = __webpack_require__(11);
6049var newPromiseCapability = __webpack_require__(50);
6050
6051module.exports = function (C, x) {
6052 anObject(C);
6053 if (isObject(x) && x.constructor === C) return x;
6054 var promiseCapability = newPromiseCapability.f(C);
6055 var resolve = promiseCapability.resolve;
6056 resolve(x);
6057 return promiseCapability.promise;
6058};
6059
6060
6061/***/ }),
6062/* 170 */
6063/***/ (function(module, __webpack_exports__, __webpack_require__) {
6064
6065"use strict";
6066/* harmony export (immutable) */ __webpack_exports__["a"] = isUndefined;
6067// Is a given variable undefined?
6068function isUndefined(obj) {
6069 return obj === void 0;
6070}
6071
6072
6073/***/ }),
6074/* 171 */
6075/***/ (function(module, __webpack_exports__, __webpack_require__) {
6076
6077"use strict";
6078/* harmony export (immutable) */ __webpack_exports__["a"] = isBoolean;
6079/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
6080
6081
6082// Is a given value a boolean?
6083function isBoolean(obj) {
6084 return obj === true || obj === false || __WEBPACK_IMPORTED_MODULE_0__setup_js__["t" /* toString */].call(obj) === '[object Boolean]';
6085}
6086
6087
6088/***/ }),
6089/* 172 */
6090/***/ (function(module, __webpack_exports__, __webpack_require__) {
6091
6092"use strict";
6093/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
6094
6095
6096/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Number'));
6097
6098
6099/***/ }),
6100/* 173 */
6101/***/ (function(module, __webpack_exports__, __webpack_require__) {
6102
6103"use strict";
6104/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
6105
6106
6107/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Symbol'));
6108
6109
6110/***/ }),
6111/* 174 */
6112/***/ (function(module, __webpack_exports__, __webpack_require__) {
6113
6114"use strict";
6115/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
6116
6117
6118/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('ArrayBuffer'));
6119
6120
6121/***/ }),
6122/* 175 */
6123/***/ (function(module, __webpack_exports__, __webpack_require__) {
6124
6125"use strict";
6126/* harmony export (immutable) */ __webpack_exports__["a"] = isNaN;
6127/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
6128/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isNumber_js__ = __webpack_require__(172);
6129
6130
6131
6132// Is the given value `NaN`?
6133function isNaN(obj) {
6134 return Object(__WEBPACK_IMPORTED_MODULE_1__isNumber_js__["a" /* default */])(obj) && Object(__WEBPACK_IMPORTED_MODULE_0__setup_js__["g" /* _isNaN */])(obj);
6135}
6136
6137
6138/***/ }),
6139/* 176 */
6140/***/ (function(module, __webpack_exports__, __webpack_require__) {
6141
6142"use strict";
6143/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
6144/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isDataView_js__ = __webpack_require__(128);
6145/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constant_js__ = __webpack_require__(177);
6146/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isBufferLike_js__ = __webpack_require__(298);
6147
6148
6149
6150
6151
6152// Is a given value a typed array?
6153var typedArrayPattern = /\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;
6154function isTypedArray(obj) {
6155 // `ArrayBuffer.isView` is the most future-proof, so use it when available.
6156 // Otherwise, fall back on the above regular expression.
6157 return __WEBPACK_IMPORTED_MODULE_0__setup_js__["l" /* nativeIsView */] ? (Object(__WEBPACK_IMPORTED_MODULE_0__setup_js__["l" /* nativeIsView */])(obj) && !Object(__WEBPACK_IMPORTED_MODULE_1__isDataView_js__["a" /* default */])(obj)) :
6158 Object(__WEBPACK_IMPORTED_MODULE_3__isBufferLike_js__["a" /* default */])(obj) && typedArrayPattern.test(__WEBPACK_IMPORTED_MODULE_0__setup_js__["t" /* toString */].call(obj));
6159}
6160
6161/* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0__setup_js__["r" /* supportsArrayBuffer */] ? isTypedArray : Object(__WEBPACK_IMPORTED_MODULE_2__constant_js__["a" /* default */])(false));
6162
6163
6164/***/ }),
6165/* 177 */
6166/***/ (function(module, __webpack_exports__, __webpack_require__) {
6167
6168"use strict";
6169/* harmony export (immutable) */ __webpack_exports__["a"] = constant;
6170// Predicate-generating function. Often useful outside of Underscore.
6171function constant(value) {
6172 return function() {
6173 return value;
6174 };
6175}
6176
6177
6178/***/ }),
6179/* 178 */
6180/***/ (function(module, __webpack_exports__, __webpack_require__) {
6181
6182"use strict";
6183/* harmony export (immutable) */ __webpack_exports__["a"] = createSizePropertyCheck;
6184/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
6185
6186
6187// Common internal logic for `isArrayLike` and `isBufferLike`.
6188function createSizePropertyCheck(getSizeProperty) {
6189 return function(collection) {
6190 var sizeProperty = getSizeProperty(collection);
6191 return typeof sizeProperty == 'number' && sizeProperty >= 0 && sizeProperty <= __WEBPACK_IMPORTED_MODULE_0__setup_js__["b" /* MAX_ARRAY_INDEX */];
6192 }
6193}
6194
6195
6196/***/ }),
6197/* 179 */
6198/***/ (function(module, __webpack_exports__, __webpack_require__) {
6199
6200"use strict";
6201/* harmony export (immutable) */ __webpack_exports__["a"] = shallowProperty;
6202// Internal helper to generate a function to obtain property `key` from `obj`.
6203function shallowProperty(key) {
6204 return function(obj) {
6205 return obj == null ? void 0 : obj[key];
6206 };
6207}
6208
6209
6210/***/ }),
6211/* 180 */
6212/***/ (function(module, __webpack_exports__, __webpack_require__) {
6213
6214"use strict";
6215/* harmony export (immutable) */ __webpack_exports__["a"] = collectNonEnumProps;
6216/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
6217/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(27);
6218/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__has_js__ = __webpack_require__(40);
6219
6220
6221
6222
6223// Internal helper to create a simple lookup structure.
6224// `collectNonEnumProps` used to depend on `_.contains`, but this led to
6225// circular imports. `emulatedSet` is a one-off solution that only works for
6226// arrays of strings.
6227function emulatedSet(keys) {
6228 var hash = {};
6229 for (var l = keys.length, i = 0; i < l; ++i) hash[keys[i]] = true;
6230 return {
6231 contains: function(key) { return hash[key]; },
6232 push: function(key) {
6233 hash[key] = true;
6234 return keys.push(key);
6235 }
6236 };
6237}
6238
6239// Internal helper. Checks `keys` for the presence of keys in IE < 9 that won't
6240// be iterated by `for key in ...` and thus missed. Extends `keys` in place if
6241// needed.
6242function collectNonEnumProps(obj, keys) {
6243 keys = emulatedSet(keys);
6244 var nonEnumIdx = __WEBPACK_IMPORTED_MODULE_0__setup_js__["n" /* nonEnumerableProps */].length;
6245 var constructor = obj.constructor;
6246 var proto = Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(constructor) && constructor.prototype || __WEBPACK_IMPORTED_MODULE_0__setup_js__["c" /* ObjProto */];
6247
6248 // Constructor is a special case.
6249 var prop = 'constructor';
6250 if (Object(__WEBPACK_IMPORTED_MODULE_2__has_js__["a" /* default */])(obj, prop) && !keys.contains(prop)) keys.push(prop);
6251
6252 while (nonEnumIdx--) {
6253 prop = __WEBPACK_IMPORTED_MODULE_0__setup_js__["n" /* nonEnumerableProps */][nonEnumIdx];
6254 if (prop in obj && obj[prop] !== proto[prop] && !keys.contains(prop)) {
6255 keys.push(prop);
6256 }
6257 }
6258}
6259
6260
6261/***/ }),
6262/* 181 */
6263/***/ (function(module, __webpack_exports__, __webpack_require__) {
6264
6265"use strict";
6266/* harmony export (immutable) */ __webpack_exports__["a"] = isMatch;
6267/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__keys_js__ = __webpack_require__(15);
6268
6269
6270// Returns whether an object has a given set of `key:value` pairs.
6271function isMatch(object, attrs) {
6272 var _keys = Object(__WEBPACK_IMPORTED_MODULE_0__keys_js__["a" /* default */])(attrs), length = _keys.length;
6273 if (object == null) return !length;
6274 var obj = Object(object);
6275 for (var i = 0; i < length; i++) {
6276 var key = _keys[i];
6277 if (attrs[key] !== obj[key] || !(key in obj)) return false;
6278 }
6279 return true;
6280}
6281
6282
6283/***/ }),
6284/* 182 */
6285/***/ (function(module, __webpack_exports__, __webpack_require__) {
6286
6287"use strict";
6288/* harmony export (immutable) */ __webpack_exports__["a"] = invert;
6289/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__keys_js__ = __webpack_require__(15);
6290
6291
6292// Invert the keys and values of an object. The values must be serializable.
6293function invert(obj) {
6294 var result = {};
6295 var _keys = Object(__WEBPACK_IMPORTED_MODULE_0__keys_js__["a" /* default */])(obj);
6296 for (var i = 0, length = _keys.length; i < length; i++) {
6297 result[obj[_keys[i]]] = _keys[i];
6298 }
6299 return result;
6300}
6301
6302
6303/***/ }),
6304/* 183 */
6305/***/ (function(module, __webpack_exports__, __webpack_require__) {
6306
6307"use strict";
6308/* harmony export (immutable) */ __webpack_exports__["a"] = functions;
6309/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isFunction_js__ = __webpack_require__(27);
6310
6311
6312// Return a sorted list of the function names available on the object.
6313function functions(obj) {
6314 var names = [];
6315 for (var key in obj) {
6316 if (Object(__WEBPACK_IMPORTED_MODULE_0__isFunction_js__["a" /* default */])(obj[key])) names.push(key);
6317 }
6318 return names.sort();
6319}
6320
6321
6322/***/ }),
6323/* 184 */
6324/***/ (function(module, __webpack_exports__, __webpack_require__) {
6325
6326"use strict";
6327/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createAssigner_js__ = __webpack_require__(132);
6328/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__allKeys_js__ = __webpack_require__(80);
6329
6330
6331
6332// Extend a given object with all the properties in passed-in object(s).
6333/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createAssigner_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__allKeys_js__["a" /* default */]));
6334
6335
6336/***/ }),
6337/* 185 */
6338/***/ (function(module, __webpack_exports__, __webpack_require__) {
6339
6340"use strict";
6341/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createAssigner_js__ = __webpack_require__(132);
6342/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__allKeys_js__ = __webpack_require__(80);
6343
6344
6345
6346// Fill in a given object with default properties.
6347/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createAssigner_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__allKeys_js__["a" /* default */], true));
6348
6349
6350/***/ }),
6351/* 186 */
6352/***/ (function(module, __webpack_exports__, __webpack_require__) {
6353
6354"use strict";
6355/* harmony export (immutable) */ __webpack_exports__["a"] = baseCreate;
6356/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isObject_js__ = __webpack_require__(52);
6357/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(5);
6358
6359
6360
6361// Create a naked function reference for surrogate-prototype-swapping.
6362function ctor() {
6363 return function(){};
6364}
6365
6366// An internal function for creating a new object that inherits from another.
6367function baseCreate(prototype) {
6368 if (!Object(__WEBPACK_IMPORTED_MODULE_0__isObject_js__["a" /* default */])(prototype)) return {};
6369 if (__WEBPACK_IMPORTED_MODULE_1__setup_js__["j" /* nativeCreate */]) return Object(__WEBPACK_IMPORTED_MODULE_1__setup_js__["j" /* nativeCreate */])(prototype);
6370 var Ctor = ctor();
6371 Ctor.prototype = prototype;
6372 var result = new Ctor;
6373 Ctor.prototype = null;
6374 return result;
6375}
6376
6377
6378/***/ }),
6379/* 187 */
6380/***/ (function(module, __webpack_exports__, __webpack_require__) {
6381
6382"use strict";
6383/* harmony export (immutable) */ __webpack_exports__["a"] = clone;
6384/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isObject_js__ = __webpack_require__(52);
6385/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArray_js__ = __webpack_require__(53);
6386/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__extend_js__ = __webpack_require__(184);
6387
6388
6389
6390
6391// Create a (shallow-cloned) duplicate of an object.
6392function clone(obj) {
6393 if (!Object(__WEBPACK_IMPORTED_MODULE_0__isObject_js__["a" /* default */])(obj)) return obj;
6394 return Object(__WEBPACK_IMPORTED_MODULE_1__isArray_js__["a" /* default */])(obj) ? obj.slice() : Object(__WEBPACK_IMPORTED_MODULE_2__extend_js__["a" /* default */])({}, obj);
6395}
6396
6397
6398/***/ }),
6399/* 188 */
6400/***/ (function(module, __webpack_exports__, __webpack_require__) {
6401
6402"use strict";
6403/* harmony export (immutable) */ __webpack_exports__["a"] = get;
6404/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__toPath_js__ = __webpack_require__(81);
6405/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__deepGet_js__ = __webpack_require__(134);
6406/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isUndefined_js__ = __webpack_require__(170);
6407
6408
6409
6410
6411// Get the value of the (deep) property on `path` from `object`.
6412// If any property in `path` does not exist or if the value is
6413// `undefined`, return `defaultValue` instead.
6414// The `path` is normalized through `_.toPath`.
6415function get(object, path, defaultValue) {
6416 var value = Object(__WEBPACK_IMPORTED_MODULE_1__deepGet_js__["a" /* default */])(object, Object(__WEBPACK_IMPORTED_MODULE_0__toPath_js__["a" /* default */])(path));
6417 return Object(__WEBPACK_IMPORTED_MODULE_2__isUndefined_js__["a" /* default */])(value) ? defaultValue : value;
6418}
6419
6420
6421/***/ }),
6422/* 189 */
6423/***/ (function(module, __webpack_exports__, __webpack_require__) {
6424
6425"use strict";
6426/* harmony export (immutable) */ __webpack_exports__["a"] = toPath;
6427/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(24);
6428/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArray_js__ = __webpack_require__(53);
6429
6430
6431
6432// Normalize a (deep) property `path` to array.
6433// Like `_.iteratee`, this function can be customized.
6434function toPath(path) {
6435 return Object(__WEBPACK_IMPORTED_MODULE_1__isArray_js__["a" /* default */])(path) ? path : [path];
6436}
6437__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].toPath = toPath;
6438
6439
6440/***/ }),
6441/* 190 */
6442/***/ (function(module, __webpack_exports__, __webpack_require__) {
6443
6444"use strict";
6445/* harmony export (immutable) */ __webpack_exports__["a"] = baseIteratee;
6446/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__identity_js__ = __webpack_require__(135);
6447/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(27);
6448/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isObject_js__ = __webpack_require__(52);
6449/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isArray_js__ = __webpack_require__(53);
6450/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__matcher_js__ = __webpack_require__(103);
6451/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__property_js__ = __webpack_require__(136);
6452/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__optimizeCb_js__ = __webpack_require__(82);
6453
6454
6455
6456
6457
6458
6459
6460
6461// An internal function to generate callbacks that can be applied to each
6462// element in a collection, returning the desired result — either `_.identity`,
6463// an arbitrary callback, a property matcher, or a property accessor.
6464function baseIteratee(value, context, argCount) {
6465 if (value == null) return __WEBPACK_IMPORTED_MODULE_0__identity_js__["a" /* default */];
6466 if (Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(value)) return Object(__WEBPACK_IMPORTED_MODULE_6__optimizeCb_js__["a" /* default */])(value, context, argCount);
6467 if (Object(__WEBPACK_IMPORTED_MODULE_2__isObject_js__["a" /* default */])(value) && !Object(__WEBPACK_IMPORTED_MODULE_3__isArray_js__["a" /* default */])(value)) return Object(__WEBPACK_IMPORTED_MODULE_4__matcher_js__["a" /* default */])(value);
6468 return Object(__WEBPACK_IMPORTED_MODULE_5__property_js__["a" /* default */])(value);
6469}
6470
6471
6472/***/ }),
6473/* 191 */
6474/***/ (function(module, __webpack_exports__, __webpack_require__) {
6475
6476"use strict";
6477/* harmony export (immutable) */ __webpack_exports__["a"] = iteratee;
6478/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(24);
6479/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__baseIteratee_js__ = __webpack_require__(190);
6480
6481
6482
6483// External wrapper for our callback generator. Users may customize
6484// `_.iteratee` if they want additional predicate/iteratee shorthand styles.
6485// This abstraction hides the internal-only `argCount` argument.
6486function iteratee(value, context) {
6487 return Object(__WEBPACK_IMPORTED_MODULE_1__baseIteratee_js__["a" /* default */])(value, context, Infinity);
6488}
6489__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].iteratee = iteratee;
6490
6491
6492/***/ }),
6493/* 192 */
6494/***/ (function(module, __webpack_exports__, __webpack_require__) {
6495
6496"use strict";
6497/* harmony export (immutable) */ __webpack_exports__["a"] = noop;
6498// Predicate-generating function. Often useful outside of Underscore.
6499function noop(){}
6500
6501
6502/***/ }),
6503/* 193 */
6504/***/ (function(module, __webpack_exports__, __webpack_require__) {
6505
6506"use strict";
6507/* harmony export (immutable) */ __webpack_exports__["a"] = random;
6508// Return a random integer between `min` and `max` (inclusive).
6509function random(min, max) {
6510 if (max == null) {
6511 max = min;
6512 min = 0;
6513 }
6514 return min + Math.floor(Math.random() * (max - min + 1));
6515}
6516
6517
6518/***/ }),
6519/* 194 */
6520/***/ (function(module, __webpack_exports__, __webpack_require__) {
6521
6522"use strict";
6523/* harmony export (immutable) */ __webpack_exports__["a"] = createEscaper;
6524/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__keys_js__ = __webpack_require__(15);
6525
6526
6527// Internal helper to generate functions for escaping and unescaping strings
6528// to/from HTML interpolation.
6529function createEscaper(map) {
6530 var escaper = function(match) {
6531 return map[match];
6532 };
6533 // Regexes for identifying a key that needs to be escaped.
6534 var source = '(?:' + Object(__WEBPACK_IMPORTED_MODULE_0__keys_js__["a" /* default */])(map).join('|') + ')';
6535 var testRegexp = RegExp(source);
6536 var replaceRegexp = RegExp(source, 'g');
6537 return function(string) {
6538 string = string == null ? '' : '' + string;
6539 return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;
6540 };
6541}
6542
6543
6544/***/ }),
6545/* 195 */
6546/***/ (function(module, __webpack_exports__, __webpack_require__) {
6547
6548"use strict";
6549// Internal list of HTML entities for escaping.
6550/* harmony default export */ __webpack_exports__["a"] = ({
6551 '&': '&amp;',
6552 '<': '&lt;',
6553 '>': '&gt;',
6554 '"': '&quot;',
6555 "'": '&#x27;',
6556 '`': '&#x60;'
6557});
6558
6559
6560/***/ }),
6561/* 196 */
6562/***/ (function(module, __webpack_exports__, __webpack_require__) {
6563
6564"use strict";
6565/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(24);
6566
6567
6568// By default, Underscore uses ERB-style template delimiters. Change the
6569// following template settings to use alternative delimiters.
6570/* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].templateSettings = {
6571 evaluate: /<%([\s\S]+?)%>/g,
6572 interpolate: /<%=([\s\S]+?)%>/g,
6573 escape: /<%-([\s\S]+?)%>/g
6574});
6575
6576
6577/***/ }),
6578/* 197 */
6579/***/ (function(module, __webpack_exports__, __webpack_require__) {
6580
6581"use strict";
6582/* harmony export (immutable) */ __webpack_exports__["a"] = executeBound;
6583/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseCreate_js__ = __webpack_require__(186);
6584/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isObject_js__ = __webpack_require__(52);
6585
6586
6587
6588// Internal function to execute `sourceFunc` bound to `context` with optional
6589// `args`. Determines whether to execute a function as a constructor or as a
6590// normal function.
6591function executeBound(sourceFunc, boundFunc, context, callingContext, args) {
6592 if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);
6593 var self = Object(__WEBPACK_IMPORTED_MODULE_0__baseCreate_js__["a" /* default */])(sourceFunc.prototype);
6594 var result = sourceFunc.apply(self, args);
6595 if (Object(__WEBPACK_IMPORTED_MODULE_1__isObject_js__["a" /* default */])(result)) return result;
6596 return self;
6597}
6598
6599
6600/***/ }),
6601/* 198 */
6602/***/ (function(module, __webpack_exports__, __webpack_require__) {
6603
6604"use strict";
6605/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(23);
6606/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(27);
6607/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__executeBound_js__ = __webpack_require__(197);
6608
6609
6610
6611
6612// Create a function bound to a given object (assigning `this`, and arguments,
6613// optionally).
6614/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(func, context, args) {
6615 if (!Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(func)) throw new TypeError('Bind must be called on a function');
6616 var bound = Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(callArgs) {
6617 return Object(__WEBPACK_IMPORTED_MODULE_2__executeBound_js__["a" /* default */])(func, bound, context, this, args.concat(callArgs));
6618 });
6619 return bound;
6620}));
6621
6622
6623/***/ }),
6624/* 199 */
6625/***/ (function(module, __webpack_exports__, __webpack_require__) {
6626
6627"use strict";
6628/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(23);
6629
6630
6631// Delays a function for the given number of milliseconds, and then calls
6632// it with the arguments supplied.
6633/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(func, wait, args) {
6634 return setTimeout(function() {
6635 return func.apply(null, args);
6636 }, wait);
6637}));
6638
6639
6640/***/ }),
6641/* 200 */
6642/***/ (function(module, __webpack_exports__, __webpack_require__) {
6643
6644"use strict";
6645/* harmony export (immutable) */ __webpack_exports__["a"] = before;
6646// Returns a function that will only be executed up to (but not including) the
6647// Nth call.
6648function before(times, func) {
6649 var memo;
6650 return function() {
6651 if (--times > 0) {
6652 memo = func.apply(this, arguments);
6653 }
6654 if (times <= 1) func = null;
6655 return memo;
6656 };
6657}
6658
6659
6660/***/ }),
6661/* 201 */
6662/***/ (function(module, __webpack_exports__, __webpack_require__) {
6663
6664"use strict";
6665/* harmony export (immutable) */ __webpack_exports__["a"] = findKey;
6666/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(20);
6667/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__keys_js__ = __webpack_require__(15);
6668
6669
6670
6671// Returns the first key on an object that passes a truth test.
6672function findKey(obj, predicate, context) {
6673 predicate = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(predicate, context);
6674 var _keys = Object(__WEBPACK_IMPORTED_MODULE_1__keys_js__["a" /* default */])(obj), key;
6675 for (var i = 0, length = _keys.length; i < length; i++) {
6676 key = _keys[i];
6677 if (predicate(obj[key], key, obj)) return key;
6678 }
6679}
6680
6681
6682/***/ }),
6683/* 202 */
6684/***/ (function(module, __webpack_exports__, __webpack_require__) {
6685
6686"use strict";
6687/* harmony export (immutable) */ __webpack_exports__["a"] = createPredicateIndexFinder;
6688/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(20);
6689/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getLength_js__ = __webpack_require__(28);
6690
6691
6692
6693// Internal function to generate `_.findIndex` and `_.findLastIndex`.
6694function createPredicateIndexFinder(dir) {
6695 return function(array, predicate, context) {
6696 predicate = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(predicate, context);
6697 var length = Object(__WEBPACK_IMPORTED_MODULE_1__getLength_js__["a" /* default */])(array);
6698 var index = dir > 0 ? 0 : length - 1;
6699 for (; index >= 0 && index < length; index += dir) {
6700 if (predicate(array[index], index, array)) return index;
6701 }
6702 return -1;
6703 };
6704}
6705
6706
6707/***/ }),
6708/* 203 */
6709/***/ (function(module, __webpack_exports__, __webpack_require__) {
6710
6711"use strict";
6712/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createPredicateIndexFinder_js__ = __webpack_require__(202);
6713
6714
6715// Returns the last index on an array-like that passes a truth test.
6716/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createPredicateIndexFinder_js__["a" /* default */])(-1));
6717
6718
6719/***/ }),
6720/* 204 */
6721/***/ (function(module, __webpack_exports__, __webpack_require__) {
6722
6723"use strict";
6724/* harmony export (immutable) */ __webpack_exports__["a"] = sortedIndex;
6725/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(20);
6726/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getLength_js__ = __webpack_require__(28);
6727
6728
6729
6730// Use a comparator function to figure out the smallest index at which
6731// an object should be inserted so as to maintain order. Uses binary search.
6732function sortedIndex(array, obj, iteratee, context) {
6733 iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(iteratee, context, 1);
6734 var value = iteratee(obj);
6735 var low = 0, high = Object(__WEBPACK_IMPORTED_MODULE_1__getLength_js__["a" /* default */])(array);
6736 while (low < high) {
6737 var mid = Math.floor((low + high) / 2);
6738 if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;
6739 }
6740 return low;
6741}
6742
6743
6744/***/ }),
6745/* 205 */
6746/***/ (function(module, __webpack_exports__, __webpack_require__) {
6747
6748"use strict";
6749/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__sortedIndex_js__ = __webpack_require__(204);
6750/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__findIndex_js__ = __webpack_require__(139);
6751/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__createIndexFinder_js__ = __webpack_require__(206);
6752
6753
6754
6755
6756// Return the position of the first occurrence of an item in an array,
6757// or -1 if the item is not included in the array.
6758// If the array is large and already in sort order, pass `true`
6759// for **isSorted** to use binary search.
6760/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_2__createIndexFinder_js__["a" /* default */])(1, __WEBPACK_IMPORTED_MODULE_1__findIndex_js__["a" /* default */], __WEBPACK_IMPORTED_MODULE_0__sortedIndex_js__["a" /* default */]));
6761
6762
6763/***/ }),
6764/* 206 */
6765/***/ (function(module, __webpack_exports__, __webpack_require__) {
6766
6767"use strict";
6768/* harmony export (immutable) */ __webpack_exports__["a"] = createIndexFinder;
6769/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(28);
6770/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(5);
6771/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isNaN_js__ = __webpack_require__(175);
6772
6773
6774
6775
6776// Internal function to generate the `_.indexOf` and `_.lastIndexOf` functions.
6777function createIndexFinder(dir, predicateFind, sortedIndex) {
6778 return function(array, item, idx) {
6779 var i = 0, length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(array);
6780 if (typeof idx == 'number') {
6781 if (dir > 0) {
6782 i = idx >= 0 ? idx : Math.max(idx + length, i);
6783 } else {
6784 length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;
6785 }
6786 } else if (sortedIndex && idx && length) {
6787 idx = sortedIndex(array, item);
6788 return array[idx] === item ? idx : -1;
6789 }
6790 if (item !== item) {
6791 idx = predicateFind(__WEBPACK_IMPORTED_MODULE_1__setup_js__["q" /* slice */].call(array, i, length), __WEBPACK_IMPORTED_MODULE_2__isNaN_js__["a" /* default */]);
6792 return idx >= 0 ? idx + i : -1;
6793 }
6794 for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {
6795 if (array[idx] === item) return idx;
6796 }
6797 return -1;
6798 };
6799}
6800
6801
6802/***/ }),
6803/* 207 */
6804/***/ (function(module, __webpack_exports__, __webpack_require__) {
6805
6806"use strict";
6807/* harmony export (immutable) */ __webpack_exports__["a"] = find;
6808/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(25);
6809/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__findIndex_js__ = __webpack_require__(139);
6810/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__findKey_js__ = __webpack_require__(201);
6811
6812
6813
6814
6815// Return the first value which passes a truth test.
6816function find(obj, predicate, context) {
6817 var keyFinder = Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" /* default */])(obj) ? __WEBPACK_IMPORTED_MODULE_1__findIndex_js__["a" /* default */] : __WEBPACK_IMPORTED_MODULE_2__findKey_js__["a" /* default */];
6818 var key = keyFinder(obj, predicate, context);
6819 if (key !== void 0 && key !== -1) return obj[key];
6820}
6821
6822
6823/***/ }),
6824/* 208 */
6825/***/ (function(module, __webpack_exports__, __webpack_require__) {
6826
6827"use strict";
6828/* harmony export (immutable) */ __webpack_exports__["a"] = createReduce;
6829/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(25);
6830/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__keys_js__ = __webpack_require__(15);
6831/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__optimizeCb_js__ = __webpack_require__(82);
6832
6833
6834
6835
6836// Internal helper to create a reducing function, iterating left or right.
6837function createReduce(dir) {
6838 // Wrap code that reassigns argument variables in a separate function than
6839 // the one that accesses `arguments.length` to avoid a perf hit. (#1991)
6840 var reducer = function(obj, iteratee, memo, initial) {
6841 var _keys = !Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" /* default */])(obj) && Object(__WEBPACK_IMPORTED_MODULE_1__keys_js__["a" /* default */])(obj),
6842 length = (_keys || obj).length,
6843 index = dir > 0 ? 0 : length - 1;
6844 if (!initial) {
6845 memo = obj[_keys ? _keys[index] : index];
6846 index += dir;
6847 }
6848 for (; index >= 0 && index < length; index += dir) {
6849 var currentKey = _keys ? _keys[index] : index;
6850 memo = iteratee(memo, obj[currentKey], currentKey, obj);
6851 }
6852 return memo;
6853 };
6854
6855 return function(obj, iteratee, memo, context) {
6856 var initial = arguments.length >= 3;
6857 return reducer(obj, Object(__WEBPACK_IMPORTED_MODULE_2__optimizeCb_js__["a" /* default */])(iteratee, context, 4), memo, initial);
6858 };
6859}
6860
6861
6862/***/ }),
6863/* 209 */
6864/***/ (function(module, __webpack_exports__, __webpack_require__) {
6865
6866"use strict";
6867/* harmony export (immutable) */ __webpack_exports__["a"] = max;
6868/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(25);
6869/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__values_js__ = __webpack_require__(62);
6870/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__cb_js__ = __webpack_require__(20);
6871/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__each_js__ = __webpack_require__(54);
6872
6873
6874
6875
6876
6877// Return the maximum element (or element-based computation).
6878function max(obj, iteratee, context) {
6879 var result = -Infinity, lastComputed = -Infinity,
6880 value, computed;
6881 if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) {
6882 obj = Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" /* default */])(obj) ? obj : Object(__WEBPACK_IMPORTED_MODULE_1__values_js__["a" /* default */])(obj);
6883 for (var i = 0, length = obj.length; i < length; i++) {
6884 value = obj[i];
6885 if (value != null && value > result) {
6886 result = value;
6887 }
6888 }
6889 } else {
6890 iteratee = Object(__WEBPACK_IMPORTED_MODULE_2__cb_js__["a" /* default */])(iteratee, context);
6891 Object(__WEBPACK_IMPORTED_MODULE_3__each_js__["a" /* default */])(obj, function(v, index, list) {
6892 computed = iteratee(v, index, list);
6893 if (computed > lastComputed || computed === -Infinity && result === -Infinity) {
6894 result = v;
6895 lastComputed = computed;
6896 }
6897 });
6898 }
6899 return result;
6900}
6901
6902
6903/***/ }),
6904/* 210 */
6905/***/ (function(module, __webpack_exports__, __webpack_require__) {
6906
6907"use strict";
6908/* harmony export (immutable) */ __webpack_exports__["a"] = sample;
6909/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(25);
6910/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__clone_js__ = __webpack_require__(187);
6911/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__values_js__ = __webpack_require__(62);
6912/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__getLength_js__ = __webpack_require__(28);
6913/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__random_js__ = __webpack_require__(193);
6914
6915
6916
6917
6918
6919
6920// Sample **n** random values from a collection using the modern version of the
6921// [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher–Yates_shuffle).
6922// If **n** is not specified, returns a single random element.
6923// The internal `guard` argument allows it to work with `_.map`.
6924function sample(obj, n, guard) {
6925 if (n == null || guard) {
6926 if (!Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" /* default */])(obj)) obj = Object(__WEBPACK_IMPORTED_MODULE_2__values_js__["a" /* default */])(obj);
6927 return obj[Object(__WEBPACK_IMPORTED_MODULE_4__random_js__["a" /* default */])(obj.length - 1)];
6928 }
6929 var sample = Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" /* default */])(obj) ? Object(__WEBPACK_IMPORTED_MODULE_1__clone_js__["a" /* default */])(obj) : Object(__WEBPACK_IMPORTED_MODULE_2__values_js__["a" /* default */])(obj);
6930 var length = Object(__WEBPACK_IMPORTED_MODULE_3__getLength_js__["a" /* default */])(sample);
6931 n = Math.max(Math.min(n, length), 0);
6932 var last = length - 1;
6933 for (var index = 0; index < n; index++) {
6934 var rand = Object(__WEBPACK_IMPORTED_MODULE_4__random_js__["a" /* default */])(index, last);
6935 var temp = sample[index];
6936 sample[index] = sample[rand];
6937 sample[rand] = temp;
6938 }
6939 return sample.slice(0, n);
6940}
6941
6942
6943/***/ }),
6944/* 211 */
6945/***/ (function(module, __webpack_exports__, __webpack_require__) {
6946
6947"use strict";
6948/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(23);
6949/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(27);
6950/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__optimizeCb_js__ = __webpack_require__(82);
6951/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__allKeys_js__ = __webpack_require__(80);
6952/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__keyInObj_js__ = __webpack_require__(347);
6953/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__flatten_js__ = __webpack_require__(63);
6954
6955
6956
6957
6958
6959
6960
6961// Return a copy of the object only containing the allowed properties.
6962/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(obj, keys) {
6963 var result = {}, iteratee = keys[0];
6964 if (obj == null) return result;
6965 if (Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(iteratee)) {
6966 if (keys.length > 1) iteratee = Object(__WEBPACK_IMPORTED_MODULE_2__optimizeCb_js__["a" /* default */])(iteratee, keys[1]);
6967 keys = Object(__WEBPACK_IMPORTED_MODULE_3__allKeys_js__["a" /* default */])(obj);
6968 } else {
6969 iteratee = __WEBPACK_IMPORTED_MODULE_4__keyInObj_js__["a" /* default */];
6970 keys = Object(__WEBPACK_IMPORTED_MODULE_5__flatten_js__["a" /* default */])(keys, false, false);
6971 obj = Object(obj);
6972 }
6973 for (var i = 0, length = keys.length; i < length; i++) {
6974 var key = keys[i];
6975 var value = obj[key];
6976 if (iteratee(value, key, obj)) result[key] = value;
6977 }
6978 return result;
6979}));
6980
6981
6982/***/ }),
6983/* 212 */
6984/***/ (function(module, __webpack_exports__, __webpack_require__) {
6985
6986"use strict";
6987/* harmony export (immutable) */ __webpack_exports__["a"] = initial;
6988/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
6989
6990
6991// Returns everything but the last entry of the array. Especially useful on
6992// the arguments object. Passing **n** will return all the values in
6993// the array, excluding the last N.
6994function initial(array, n, guard) {
6995 return __WEBPACK_IMPORTED_MODULE_0__setup_js__["q" /* slice */].call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));
6996}
6997
6998
6999/***/ }),
7000/* 213 */
7001/***/ (function(module, __webpack_exports__, __webpack_require__) {
7002
7003"use strict";
7004/* harmony export (immutable) */ __webpack_exports__["a"] = rest;
7005/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
7006
7007
7008// Returns everything but the first entry of the `array`. Especially useful on
7009// the `arguments` object. Passing an **n** will return the rest N values in the
7010// `array`.
7011function rest(array, n, guard) {
7012 return __WEBPACK_IMPORTED_MODULE_0__setup_js__["q" /* slice */].call(array, n == null || guard ? 1 : n);
7013}
7014
7015
7016/***/ }),
7017/* 214 */
7018/***/ (function(module, __webpack_exports__, __webpack_require__) {
7019
7020"use strict";
7021/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(23);
7022/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__flatten_js__ = __webpack_require__(63);
7023/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__filter_js__ = __webpack_require__(83);
7024/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__contains_js__ = __webpack_require__(84);
7025
7026
7027
7028
7029
7030// Take the difference between one array and a number of other arrays.
7031// Only the elements present in just the first array will remain.
7032/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(array, rest) {
7033 rest = Object(__WEBPACK_IMPORTED_MODULE_1__flatten_js__["a" /* default */])(rest, true, true);
7034 return Object(__WEBPACK_IMPORTED_MODULE_2__filter_js__["a" /* default */])(array, function(value){
7035 return !Object(__WEBPACK_IMPORTED_MODULE_3__contains_js__["a" /* default */])(rest, value);
7036 });
7037}));
7038
7039
7040/***/ }),
7041/* 215 */
7042/***/ (function(module, __webpack_exports__, __webpack_require__) {
7043
7044"use strict";
7045/* harmony export (immutable) */ __webpack_exports__["a"] = uniq;
7046/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isBoolean_js__ = __webpack_require__(171);
7047/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__cb_js__ = __webpack_require__(20);
7048/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__getLength_js__ = __webpack_require__(28);
7049/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__contains_js__ = __webpack_require__(84);
7050
7051
7052
7053
7054
7055// Produce a duplicate-free version of the array. If the array has already
7056// been sorted, you have the option of using a faster algorithm.
7057// The faster algorithm will not work with an iteratee if the iteratee
7058// is not a one-to-one function, so providing an iteratee will disable
7059// the faster algorithm.
7060function uniq(array, isSorted, iteratee, context) {
7061 if (!Object(__WEBPACK_IMPORTED_MODULE_0__isBoolean_js__["a" /* default */])(isSorted)) {
7062 context = iteratee;
7063 iteratee = isSorted;
7064 isSorted = false;
7065 }
7066 if (iteratee != null) iteratee = Object(__WEBPACK_IMPORTED_MODULE_1__cb_js__["a" /* default */])(iteratee, context);
7067 var result = [];
7068 var seen = [];
7069 for (var i = 0, length = Object(__WEBPACK_IMPORTED_MODULE_2__getLength_js__["a" /* default */])(array); i < length; i++) {
7070 var value = array[i],
7071 computed = iteratee ? iteratee(value, i, array) : value;
7072 if (isSorted && !iteratee) {
7073 if (!i || seen !== computed) result.push(value);
7074 seen = computed;
7075 } else if (iteratee) {
7076 if (!Object(__WEBPACK_IMPORTED_MODULE_3__contains_js__["a" /* default */])(seen, computed)) {
7077 seen.push(computed);
7078 result.push(value);
7079 }
7080 } else if (!Object(__WEBPACK_IMPORTED_MODULE_3__contains_js__["a" /* default */])(result, value)) {
7081 result.push(value);
7082 }
7083 }
7084 return result;
7085}
7086
7087
7088/***/ }),
7089/* 216 */
7090/***/ (function(module, __webpack_exports__, __webpack_require__) {
7091
7092"use strict";
7093/* harmony export (immutable) */ __webpack_exports__["a"] = unzip;
7094/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__max_js__ = __webpack_require__(209);
7095/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getLength_js__ = __webpack_require__(28);
7096/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__pluck_js__ = __webpack_require__(140);
7097
7098
7099
7100
7101// Complement of zip. Unzip accepts an array of arrays and groups
7102// each array's elements on shared indices.
7103function unzip(array) {
7104 var length = array && Object(__WEBPACK_IMPORTED_MODULE_0__max_js__["a" /* default */])(array, __WEBPACK_IMPORTED_MODULE_1__getLength_js__["a" /* default */]).length || 0;
7105 var result = Array(length);
7106
7107 for (var index = 0; index < length; index++) {
7108 result[index] = Object(__WEBPACK_IMPORTED_MODULE_2__pluck_js__["a" /* default */])(array, index);
7109 }
7110 return result;
7111}
7112
7113
7114/***/ }),
7115/* 217 */
7116/***/ (function(module, __webpack_exports__, __webpack_require__) {
7117
7118"use strict";
7119/* harmony export (immutable) */ __webpack_exports__["a"] = chainResult;
7120/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(24);
7121
7122
7123// Helper function to continue chaining intermediate results.
7124function chainResult(instance, obj) {
7125 return instance._chain ? Object(__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */])(obj).chain() : obj;
7126}
7127
7128
7129/***/ }),
7130/* 218 */
7131/***/ (function(module, exports, __webpack_require__) {
7132
7133"use strict";
7134
7135var $ = __webpack_require__(0);
7136var fails = __webpack_require__(3);
7137var isArray = __webpack_require__(85);
7138var isObject = __webpack_require__(11);
7139var toObject = __webpack_require__(34);
7140var lengthOfArrayLike = __webpack_require__(46);
7141var doesNotExceedSafeInteger = __webpack_require__(365);
7142var createProperty = __webpack_require__(106);
7143var arraySpeciesCreate = __webpack_require__(219);
7144var arrayMethodHasSpeciesSupport = __webpack_require__(107);
7145var wellKnownSymbol = __webpack_require__(9);
7146var V8_VERSION = __webpack_require__(90);
7147
7148var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
7149
7150// We can't use this feature detection in V8 since it causes
7151// deoptimization and serious performance degradation
7152// https://github.com/zloirock/core-js/issues/679
7153var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function () {
7154 var array = [];
7155 array[IS_CONCAT_SPREADABLE] = false;
7156 return array.concat()[0] !== array;
7157});
7158
7159var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
7160
7161var isConcatSpreadable = function (O) {
7162 if (!isObject(O)) return false;
7163 var spreadable = O[IS_CONCAT_SPREADABLE];
7164 return spreadable !== undefined ? !!spreadable : isArray(O);
7165};
7166
7167var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
7168
7169// `Array.prototype.concat` method
7170// https://tc39.es/ecma262/#sec-array.prototype.concat
7171// with adding support of @@isConcatSpreadable and @@species
7172$({ target: 'Array', proto: true, arity: 1, forced: FORCED }, {
7173 // eslint-disable-next-line no-unused-vars -- required for `.length`
7174 concat: function concat(arg) {
7175 var O = toObject(this);
7176 var A = arraySpeciesCreate(O, 0);
7177 var n = 0;
7178 var i, k, length, len, E;
7179 for (i = -1, length = arguments.length; i < length; i++) {
7180 E = i === -1 ? O : arguments[i];
7181 if (isConcatSpreadable(E)) {
7182 len = lengthOfArrayLike(E);
7183 doesNotExceedSafeInteger(n + len);
7184 for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
7185 } else {
7186 doesNotExceedSafeInteger(n + 1);
7187 createProperty(A, n++, E);
7188 }
7189 }
7190 A.length = n;
7191 return A;
7192 }
7193});
7194
7195
7196/***/ }),
7197/* 219 */
7198/***/ (function(module, exports, __webpack_require__) {
7199
7200var arraySpeciesConstructor = __webpack_require__(366);
7201
7202// `ArraySpeciesCreate` abstract operation
7203// https://tc39.es/ecma262/#sec-arrayspeciescreate
7204module.exports = function (originalArray, length) {
7205 return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
7206};
7207
7208
7209/***/ }),
7210/* 220 */
7211/***/ (function(module, exports, __webpack_require__) {
7212
7213var $ = __webpack_require__(0);
7214var getBuiltIn = __webpack_require__(18);
7215var apply = __webpack_require__(69);
7216var call = __webpack_require__(13);
7217var uncurryThis = __webpack_require__(4);
7218var fails = __webpack_require__(3);
7219var isArray = __webpack_require__(85);
7220var isCallable = __webpack_require__(7);
7221var isObject = __webpack_require__(11);
7222var isSymbol = __webpack_require__(89);
7223var arraySlice = __webpack_require__(102);
7224var NATIVE_SYMBOL = __webpack_require__(57);
7225
7226var $stringify = getBuiltIn('JSON', 'stringify');
7227var exec = uncurryThis(/./.exec);
7228var charAt = uncurryThis(''.charAt);
7229var charCodeAt = uncurryThis(''.charCodeAt);
7230var replace = uncurryThis(''.replace);
7231var numberToString = uncurryThis(1.0.toString);
7232
7233var tester = /[\uD800-\uDFFF]/g;
7234var low = /^[\uD800-\uDBFF]$/;
7235var hi = /^[\uDC00-\uDFFF]$/;
7236
7237var WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL || fails(function () {
7238 var symbol = getBuiltIn('Symbol')();
7239 // MS Edge converts symbol values to JSON as {}
7240 return $stringify([symbol]) != '[null]'
7241 // WebKit converts symbol values to JSON as null
7242 || $stringify({ a: symbol }) != '{}'
7243 // V8 throws on boxed symbols
7244 || $stringify(Object(symbol)) != '{}';
7245});
7246
7247// https://github.com/tc39/proposal-well-formed-stringify
7248var ILL_FORMED_UNICODE = fails(function () {
7249 return $stringify('\uDF06\uD834') !== '"\\udf06\\ud834"'
7250 || $stringify('\uDEAD') !== '"\\udead"';
7251});
7252
7253var stringifyWithSymbolsFix = function (it, replacer) {
7254 var args = arraySlice(arguments);
7255 var $replacer = replacer;
7256 if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
7257 if (!isArray(replacer)) replacer = function (key, value) {
7258 if (isCallable($replacer)) value = call($replacer, this, key, value);
7259 if (!isSymbol(value)) return value;
7260 };
7261 args[1] = replacer;
7262 return apply($stringify, null, args);
7263};
7264
7265var fixIllFormed = function (match, offset, string) {
7266 var prev = charAt(string, offset - 1);
7267 var next = charAt(string, offset + 1);
7268 if ((exec(low, match) && !exec(hi, next)) || (exec(hi, match) && !exec(low, prev))) {
7269 return '\\u' + numberToString(charCodeAt(match, 0), 16);
7270 } return match;
7271};
7272
7273if ($stringify) {
7274 // `JSON.stringify` method
7275 // https://tc39.es/ecma262/#sec-json.stringify
7276 $({ target: 'JSON', stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE }, {
7277 // eslint-disable-next-line no-unused-vars -- required for `.length`
7278 stringify: function stringify(it, replacer, space) {
7279 var args = arraySlice(arguments);
7280 var result = apply(WRONG_SYMBOLS_CONVERSION ? stringifyWithSymbolsFix : $stringify, null, args);
7281 return ILL_FORMED_UNICODE && typeof result == 'string' ? replace(result, tester, fixIllFormed) : result;
7282 }
7283 });
7284}
7285
7286
7287/***/ }),
7288/* 221 */
7289/***/ (function(module, exports, __webpack_require__) {
7290
7291var rng = __webpack_require__(384);
7292var bytesToUuid = __webpack_require__(385);
7293
7294function v4(options, buf, offset) {
7295 var i = buf && offset || 0;
7296
7297 if (typeof(options) == 'string') {
7298 buf = options === 'binary' ? new Array(16) : null;
7299 options = null;
7300 }
7301 options = options || {};
7302
7303 var rnds = options.random || (options.rng || rng)();
7304
7305 // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
7306 rnds[6] = (rnds[6] & 0x0f) | 0x40;
7307 rnds[8] = (rnds[8] & 0x3f) | 0x80;
7308
7309 // Copy bytes to buffer, if provided
7310 if (buf) {
7311 for (var ii = 0; ii < 16; ++ii) {
7312 buf[i + ii] = rnds[ii];
7313 }
7314 }
7315
7316 return buf || bytesToUuid(rnds);
7317}
7318
7319module.exports = v4;
7320
7321
7322/***/ }),
7323/* 222 */
7324/***/ (function(module, exports, __webpack_require__) {
7325
7326var parent = __webpack_require__(388);
7327
7328module.exports = parent;
7329
7330
7331/***/ }),
7332/* 223 */
7333/***/ (function(module, exports, __webpack_require__) {
7334
7335"use strict";
7336
7337
7338module.exports = '4.13.4';
7339
7340/***/ }),
7341/* 224 */
7342/***/ (function(module, exports, __webpack_require__) {
7343
7344"use strict";
7345
7346
7347var has = Object.prototype.hasOwnProperty
7348 , prefix = '~';
7349
7350/**
7351 * Constructor to create a storage for our `EE` objects.
7352 * An `Events` instance is a plain object whose properties are event names.
7353 *
7354 * @constructor
7355 * @api private
7356 */
7357function Events() {}
7358
7359//
7360// We try to not inherit from `Object.prototype`. In some engines creating an
7361// instance in this way is faster than calling `Object.create(null)` directly.
7362// If `Object.create(null)` is not supported we prefix the event names with a
7363// character to make sure that the built-in object properties are not
7364// overridden or used as an attack vector.
7365//
7366if (Object.create) {
7367 Events.prototype = Object.create(null);
7368
7369 //
7370 // This hack is needed because the `__proto__` property is still inherited in
7371 // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.
7372 //
7373 if (!new Events().__proto__) prefix = false;
7374}
7375
7376/**
7377 * Representation of a single event listener.
7378 *
7379 * @param {Function} fn The listener function.
7380 * @param {Mixed} context The context to invoke the listener with.
7381 * @param {Boolean} [once=false] Specify if the listener is a one-time listener.
7382 * @constructor
7383 * @api private
7384 */
7385function EE(fn, context, once) {
7386 this.fn = fn;
7387 this.context = context;
7388 this.once = once || false;
7389}
7390
7391/**
7392 * Minimal `EventEmitter` interface that is molded against the Node.js
7393 * `EventEmitter` interface.
7394 *
7395 * @constructor
7396 * @api public
7397 */
7398function EventEmitter() {
7399 this._events = new Events();
7400 this._eventsCount = 0;
7401}
7402
7403/**
7404 * Return an array listing the events for which the emitter has registered
7405 * listeners.
7406 *
7407 * @returns {Array}
7408 * @api public
7409 */
7410EventEmitter.prototype.eventNames = function eventNames() {
7411 var names = []
7412 , events
7413 , name;
7414
7415 if (this._eventsCount === 0) return names;
7416
7417 for (name in (events = this._events)) {
7418 if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);
7419 }
7420
7421 if (Object.getOwnPropertySymbols) {
7422 return names.concat(Object.getOwnPropertySymbols(events));
7423 }
7424
7425 return names;
7426};
7427
7428/**
7429 * Return the listeners registered for a given event.
7430 *
7431 * @param {String|Symbol} event The event name.
7432 * @param {Boolean} exists Only check if there are listeners.
7433 * @returns {Array|Boolean}
7434 * @api public
7435 */
7436EventEmitter.prototype.listeners = function listeners(event, exists) {
7437 var evt = prefix ? prefix + event : event
7438 , available = this._events[evt];
7439
7440 if (exists) return !!available;
7441 if (!available) return [];
7442 if (available.fn) return [available.fn];
7443
7444 for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) {
7445 ee[i] = available[i].fn;
7446 }
7447
7448 return ee;
7449};
7450
7451/**
7452 * Calls each of the listeners registered for a given event.
7453 *
7454 * @param {String|Symbol} event The event name.
7455 * @returns {Boolean} `true` if the event had listeners, else `false`.
7456 * @api public
7457 */
7458EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
7459 var evt = prefix ? prefix + event : event;
7460
7461 if (!this._events[evt]) return false;
7462
7463 var listeners = this._events[evt]
7464 , len = arguments.length
7465 , args
7466 , i;
7467
7468 if (listeners.fn) {
7469 if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);
7470
7471 switch (len) {
7472 case 1: return listeners.fn.call(listeners.context), true;
7473 case 2: return listeners.fn.call(listeners.context, a1), true;
7474 case 3: return listeners.fn.call(listeners.context, a1, a2), true;
7475 case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;
7476 case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
7477 case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
7478 }
7479
7480 for (i = 1, args = new Array(len -1); i < len; i++) {
7481 args[i - 1] = arguments[i];
7482 }
7483
7484 listeners.fn.apply(listeners.context, args);
7485 } else {
7486 var length = listeners.length
7487 , j;
7488
7489 for (i = 0; i < length; i++) {
7490 if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);
7491
7492 switch (len) {
7493 case 1: listeners[i].fn.call(listeners[i].context); break;
7494 case 2: listeners[i].fn.call(listeners[i].context, a1); break;
7495 case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;
7496 case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;
7497 default:
7498 if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {
7499 args[j - 1] = arguments[j];
7500 }
7501
7502 listeners[i].fn.apply(listeners[i].context, args);
7503 }
7504 }
7505 }
7506
7507 return true;
7508};
7509
7510/**
7511 * Add a listener for a given event.
7512 *
7513 * @param {String|Symbol} event The event name.
7514 * @param {Function} fn The listener function.
7515 * @param {Mixed} [context=this] The context to invoke the listener with.
7516 * @returns {EventEmitter} `this`.
7517 * @api public
7518 */
7519EventEmitter.prototype.on = function on(event, fn, context) {
7520 var listener = new EE(fn, context || this)
7521 , evt = prefix ? prefix + event : event;
7522
7523 if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;
7524 else if (!this._events[evt].fn) this._events[evt].push(listener);
7525 else this._events[evt] = [this._events[evt], listener];
7526
7527 return this;
7528};
7529
7530/**
7531 * Add a one-time listener for a given event.
7532 *
7533 * @param {String|Symbol} event The event name.
7534 * @param {Function} fn The listener function.
7535 * @param {Mixed} [context=this] The context to invoke the listener with.
7536 * @returns {EventEmitter} `this`.
7537 * @api public
7538 */
7539EventEmitter.prototype.once = function once(event, fn, context) {
7540 var listener = new EE(fn, context || this, true)
7541 , evt = prefix ? prefix + event : event;
7542
7543 if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;
7544 else if (!this._events[evt].fn) this._events[evt].push(listener);
7545 else this._events[evt] = [this._events[evt], listener];
7546
7547 return this;
7548};
7549
7550/**
7551 * Remove the listeners of a given event.
7552 *
7553 * @param {String|Symbol} event The event name.
7554 * @param {Function} fn Only remove the listeners that match this function.
7555 * @param {Mixed} context Only remove the listeners that have this context.
7556 * @param {Boolean} once Only remove one-time listeners.
7557 * @returns {EventEmitter} `this`.
7558 * @api public
7559 */
7560EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {
7561 var evt = prefix ? prefix + event : event;
7562
7563 if (!this._events[evt]) return this;
7564 if (!fn) {
7565 if (--this._eventsCount === 0) this._events = new Events();
7566 else delete this._events[evt];
7567 return this;
7568 }
7569
7570 var listeners = this._events[evt];
7571
7572 if (listeners.fn) {
7573 if (
7574 listeners.fn === fn
7575 && (!once || listeners.once)
7576 && (!context || listeners.context === context)
7577 ) {
7578 if (--this._eventsCount === 0) this._events = new Events();
7579 else delete this._events[evt];
7580 }
7581 } else {
7582 for (var i = 0, events = [], length = listeners.length; i < length; i++) {
7583 if (
7584 listeners[i].fn !== fn
7585 || (once && !listeners[i].once)
7586 || (context && listeners[i].context !== context)
7587 ) {
7588 events.push(listeners[i]);
7589 }
7590 }
7591
7592 //
7593 // Reset the array, or remove it completely if we have no more listeners.
7594 //
7595 if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;
7596 else if (--this._eventsCount === 0) this._events = new Events();
7597 else delete this._events[evt];
7598 }
7599
7600 return this;
7601};
7602
7603/**
7604 * Remove all listeners, or those of the specified event.
7605 *
7606 * @param {String|Symbol} [event] The event name.
7607 * @returns {EventEmitter} `this`.
7608 * @api public
7609 */
7610EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {
7611 var evt;
7612
7613 if (event) {
7614 evt = prefix ? prefix + event : event;
7615 if (this._events[evt]) {
7616 if (--this._eventsCount === 0) this._events = new Events();
7617 else delete this._events[evt];
7618 }
7619 } else {
7620 this._events = new Events();
7621 this._eventsCount = 0;
7622 }
7623
7624 return this;
7625};
7626
7627//
7628// Alias methods names because people roll like that.
7629//
7630EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
7631EventEmitter.prototype.addListener = EventEmitter.prototype.on;
7632
7633//
7634// This function doesn't apply anymore.
7635//
7636EventEmitter.prototype.setMaxListeners = function setMaxListeners() {
7637 return this;
7638};
7639
7640//
7641// Expose the prefix.
7642//
7643EventEmitter.prefixed = prefix;
7644
7645//
7646// Allow `EventEmitter` to be imported as module namespace.
7647//
7648EventEmitter.EventEmitter = EventEmitter;
7649
7650//
7651// Expose the module.
7652//
7653if (true) {
7654 module.exports = EventEmitter;
7655}
7656
7657
7658/***/ }),
7659/* 225 */
7660/***/ (function(module, exports, __webpack_require__) {
7661
7662"use strict";
7663
7664
7665var _interopRequireDefault = __webpack_require__(1);
7666
7667var _promise = _interopRequireDefault(__webpack_require__(12));
7668
7669var _require = __webpack_require__(68),
7670 getAdapter = _require.getAdapter;
7671
7672var syncApiNames = ['getItem', 'setItem', 'removeItem', 'clear'];
7673var localStorage = {
7674 get async() {
7675 return getAdapter('storage').async;
7676 }
7677
7678}; // wrap sync apis with async ones.
7679
7680syncApiNames.forEach(function (apiName) {
7681 localStorage[apiName + 'Async'] = function () {
7682 var storage = getAdapter('storage');
7683 return _promise.default.resolve(storage[apiName].apply(storage, arguments));
7684 };
7685
7686 localStorage[apiName] = function () {
7687 var storage = getAdapter('storage');
7688
7689 if (!storage.async) {
7690 return storage[apiName].apply(storage, arguments);
7691 }
7692
7693 var error = new Error('Synchronous API [' + apiName + '] is not available in this runtime.');
7694 error.code = 'SYNC_API_NOT_AVAILABLE';
7695 throw error;
7696 };
7697});
7698module.exports = localStorage;
7699
7700/***/ }),
7701/* 226 */
7702/***/ (function(module, exports, __webpack_require__) {
7703
7704"use strict";
7705
7706
7707var _interopRequireDefault = __webpack_require__(1);
7708
7709var _concat = _interopRequireDefault(__webpack_require__(30));
7710
7711var _stringify = _interopRequireDefault(__webpack_require__(36));
7712
7713var storage = __webpack_require__(225);
7714
7715var AV = __webpack_require__(65);
7716
7717var removeAsync = exports.removeAsync = storage.removeItemAsync.bind(storage);
7718
7719var getCacheData = function getCacheData(cacheData, key) {
7720 try {
7721 cacheData = JSON.parse(cacheData);
7722 } catch (e) {
7723 return null;
7724 }
7725
7726 if (cacheData) {
7727 var expired = cacheData.expiredAt && cacheData.expiredAt < Date.now();
7728
7729 if (!expired) {
7730 return cacheData.value;
7731 }
7732
7733 return removeAsync(key).then(function () {
7734 return null;
7735 });
7736 }
7737
7738 return null;
7739};
7740
7741exports.getAsync = function (key) {
7742 var _context;
7743
7744 key = (0, _concat.default)(_context = "AV/".concat(AV.applicationId, "/")).call(_context, key);
7745 return storage.getItemAsync(key).then(function (cache) {
7746 return getCacheData(cache, key);
7747 });
7748};
7749
7750exports.setAsync = function (key, value, ttl) {
7751 var _context2;
7752
7753 var cache = {
7754 value: value
7755 };
7756
7757 if (typeof ttl === 'number') {
7758 cache.expiredAt = Date.now() + ttl;
7759 }
7760
7761 return storage.setItemAsync((0, _concat.default)(_context2 = "AV/".concat(AV.applicationId, "/")).call(_context2, key), (0, _stringify.default)(cache));
7762};
7763
7764/***/ }),
7765/* 227 */
7766/***/ (function(module, exports, __webpack_require__) {
7767
7768module.exports = __webpack_require__(228);
7769
7770/***/ }),
7771/* 228 */
7772/***/ (function(module, exports, __webpack_require__) {
7773
7774var parent = __webpack_require__(390);
7775
7776module.exports = parent;
7777
7778
7779/***/ }),
7780/* 229 */
7781/***/ (function(module, exports, __webpack_require__) {
7782
7783var parent = __webpack_require__(393);
7784
7785module.exports = parent;
7786
7787
7788/***/ }),
7789/* 230 */
7790/***/ (function(module, exports, __webpack_require__) {
7791
7792var parent = __webpack_require__(396);
7793
7794module.exports = parent;
7795
7796
7797/***/ }),
7798/* 231 */
7799/***/ (function(module, exports, __webpack_require__) {
7800
7801module.exports = __webpack_require__(399);
7802
7803/***/ }),
7804/* 232 */
7805/***/ (function(module, exports, __webpack_require__) {
7806
7807var parent = __webpack_require__(402);
7808__webpack_require__(51);
7809
7810module.exports = parent;
7811
7812
7813/***/ }),
7814/* 233 */
7815/***/ (function(module, exports, __webpack_require__) {
7816
7817// TODO: Remove this module from `core-js@4` since it's split to modules listed below
7818__webpack_require__(403);
7819__webpack_require__(405);
7820__webpack_require__(406);
7821__webpack_require__(220);
7822__webpack_require__(407);
7823
7824
7825/***/ }),
7826/* 234 */
7827/***/ (function(module, exports, __webpack_require__) {
7828
7829/* eslint-disable es-x/no-object-getownpropertynames -- safe */
7830var classof = __webpack_require__(56);
7831var toIndexedObject = __webpack_require__(33);
7832var $getOwnPropertyNames = __webpack_require__(96).f;
7833var arraySlice = __webpack_require__(404);
7834
7835var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
7836 ? Object.getOwnPropertyNames(window) : [];
7837
7838var getWindowNames = function (it) {
7839 try {
7840 return $getOwnPropertyNames(it);
7841 } catch (error) {
7842 return arraySlice(windowNames);
7843 }
7844};
7845
7846// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
7847module.exports.f = function getOwnPropertyNames(it) {
7848 return windowNames && classof(it) == 'Window'
7849 ? getWindowNames(it)
7850 : $getOwnPropertyNames(toIndexedObject(it));
7851};
7852
7853
7854/***/ }),
7855/* 235 */
7856/***/ (function(module, exports, __webpack_require__) {
7857
7858var call = __webpack_require__(13);
7859var getBuiltIn = __webpack_require__(18);
7860var wellKnownSymbol = __webpack_require__(9);
7861var defineBuiltIn = __webpack_require__(39);
7862
7863module.exports = function () {
7864 var Symbol = getBuiltIn('Symbol');
7865 var SymbolPrototype = Symbol && Symbol.prototype;
7866 var valueOf = SymbolPrototype && SymbolPrototype.valueOf;
7867 var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
7868
7869 if (SymbolPrototype && !SymbolPrototype[TO_PRIMITIVE]) {
7870 // `Symbol.prototype[@@toPrimitive]` method
7871 // https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive
7872 // eslint-disable-next-line no-unused-vars -- required for .length
7873 defineBuiltIn(SymbolPrototype, TO_PRIMITIVE, function (hint) {
7874 return call(valueOf, this);
7875 }, { arity: 1 });
7876 }
7877};
7878
7879
7880/***/ }),
7881/* 236 */
7882/***/ (function(module, exports, __webpack_require__) {
7883
7884var NATIVE_SYMBOL = __webpack_require__(57);
7885
7886/* eslint-disable es-x/no-symbol -- safe */
7887module.exports = NATIVE_SYMBOL && !!Symbol['for'] && !!Symbol.keyFor;
7888
7889
7890/***/ }),
7891/* 237 */
7892/***/ (function(module, exports, __webpack_require__) {
7893
7894var defineWellKnownSymbol = __webpack_require__(8);
7895
7896// `Symbol.iterator` well-known symbol
7897// https://tc39.es/ecma262/#sec-symbol.iterator
7898defineWellKnownSymbol('iterator');
7899
7900
7901/***/ }),
7902/* 238 */
7903/***/ (function(module, exports, __webpack_require__) {
7904
7905var parent = __webpack_require__(436);
7906__webpack_require__(51);
7907
7908module.exports = parent;
7909
7910
7911/***/ }),
7912/* 239 */
7913/***/ (function(module, exports, __webpack_require__) {
7914
7915var parent = __webpack_require__(456);
7916
7917module.exports = parent;
7918
7919
7920/***/ }),
7921/* 240 */
7922/***/ (function(module, exports, __webpack_require__) {
7923
7924module.exports = __webpack_require__(232);
7925
7926/***/ }),
7927/* 241 */
7928/***/ (function(module, exports, __webpack_require__) {
7929
7930module.exports = __webpack_require__(460);
7931
7932/***/ }),
7933/* 242 */
7934/***/ (function(module, exports, __webpack_require__) {
7935
7936"use strict";
7937
7938var uncurryThis = __webpack_require__(4);
7939var aCallable = __webpack_require__(31);
7940var isObject = __webpack_require__(11);
7941var hasOwn = __webpack_require__(14);
7942var arraySlice = __webpack_require__(102);
7943var NATIVE_BIND = __webpack_require__(70);
7944
7945var $Function = Function;
7946var concat = uncurryThis([].concat);
7947var join = uncurryThis([].join);
7948var factories = {};
7949
7950var construct = function (C, argsLength, args) {
7951 if (!hasOwn(factories, argsLength)) {
7952 for (var list = [], i = 0; i < argsLength; i++) list[i] = 'a[' + i + ']';
7953 factories[argsLength] = $Function('C,a', 'return new C(' + join(list, ',') + ')');
7954 } return factories[argsLength](C, args);
7955};
7956
7957// `Function.prototype.bind` method implementation
7958// https://tc39.es/ecma262/#sec-function.prototype.bind
7959module.exports = NATIVE_BIND ? $Function.bind : function bind(that /* , ...args */) {
7960 var F = aCallable(this);
7961 var Prototype = F.prototype;
7962 var partArgs = arraySlice(arguments, 1);
7963 var boundFunction = function bound(/* args... */) {
7964 var args = concat(partArgs, arraySlice(arguments));
7965 return this instanceof boundFunction ? construct(F, args.length, args) : F.apply(that, args);
7966 };
7967 if (isObject(Prototype)) boundFunction.prototype = Prototype;
7968 return boundFunction;
7969};
7970
7971
7972/***/ }),
7973/* 243 */
7974/***/ (function(module, exports, __webpack_require__) {
7975
7976module.exports = __webpack_require__(481);
7977
7978/***/ }),
7979/* 244 */
7980/***/ (function(module, exports, __webpack_require__) {
7981
7982module.exports = __webpack_require__(484);
7983
7984/***/ }),
7985/* 245 */
7986/***/ (function(module, exports) {
7987
7988var charenc = {
7989 // UTF-8 encoding
7990 utf8: {
7991 // Convert a string to a byte array
7992 stringToBytes: function(str) {
7993 return charenc.bin.stringToBytes(unescape(encodeURIComponent(str)));
7994 },
7995
7996 // Convert a byte array to a string
7997 bytesToString: function(bytes) {
7998 return decodeURIComponent(escape(charenc.bin.bytesToString(bytes)));
7999 }
8000 },
8001
8002 // Binary encoding
8003 bin: {
8004 // Convert a string to a byte array
8005 stringToBytes: function(str) {
8006 for (var bytes = [], i = 0; i < str.length; i++)
8007 bytes.push(str.charCodeAt(i) & 0xFF);
8008 return bytes;
8009 },
8010
8011 // Convert a byte array to a string
8012 bytesToString: function(bytes) {
8013 for (var str = [], i = 0; i < bytes.length; i++)
8014 str.push(String.fromCharCode(bytes[i]));
8015 return str.join('');
8016 }
8017 }
8018};
8019
8020module.exports = charenc;
8021
8022
8023/***/ }),
8024/* 246 */
8025/***/ (function(module, exports, __webpack_require__) {
8026
8027module.exports = __webpack_require__(528);
8028
8029/***/ }),
8030/* 247 */
8031/***/ (function(module, exports, __webpack_require__) {
8032
8033var fails = __webpack_require__(3);
8034var isObject = __webpack_require__(11);
8035var classof = __webpack_require__(56);
8036var ARRAY_BUFFER_NON_EXTENSIBLE = __webpack_require__(561);
8037
8038// eslint-disable-next-line es-x/no-object-isextensible -- safe
8039var $isExtensible = Object.isExtensible;
8040var FAILS_ON_PRIMITIVES = fails(function () { $isExtensible(1); });
8041
8042// `Object.isExtensible` method
8043// https://tc39.es/ecma262/#sec-object.isextensible
8044module.exports = (FAILS_ON_PRIMITIVES || ARRAY_BUFFER_NON_EXTENSIBLE) ? function isExtensible(it) {
8045 if (!isObject(it)) return false;
8046 if (ARRAY_BUFFER_NON_EXTENSIBLE && classof(it) == 'ArrayBuffer') return false;
8047 return $isExtensible ? $isExtensible(it) : true;
8048} : $isExtensible;
8049
8050
8051/***/ }),
8052/* 248 */
8053/***/ (function(module, exports, __webpack_require__) {
8054
8055"use strict";
8056
8057var $ = __webpack_require__(0);
8058var global = __webpack_require__(6);
8059var InternalMetadataModule = __webpack_require__(111);
8060var fails = __webpack_require__(3);
8061var createNonEnumerableProperty = __webpack_require__(35);
8062var iterate = __webpack_require__(37);
8063var anInstance = __webpack_require__(100);
8064var isCallable = __webpack_require__(7);
8065var isObject = __webpack_require__(11);
8066var setToStringTag = __webpack_require__(49);
8067var defineProperty = __webpack_require__(22).f;
8068var forEach = __webpack_require__(66).forEach;
8069var DESCRIPTORS = __webpack_require__(16);
8070var InternalStateModule = __webpack_require__(38);
8071
8072var setInternalState = InternalStateModule.set;
8073var internalStateGetterFor = InternalStateModule.getterFor;
8074
8075module.exports = function (CONSTRUCTOR_NAME, wrapper, common) {
8076 var IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== -1;
8077 var IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== -1;
8078 var ADDER = IS_MAP ? 'set' : 'add';
8079 var NativeConstructor = global[CONSTRUCTOR_NAME];
8080 var NativePrototype = NativeConstructor && NativeConstructor.prototype;
8081 var exported = {};
8082 var Constructor;
8083
8084 if (!DESCRIPTORS || !isCallable(NativeConstructor)
8085 || !(IS_WEAK || NativePrototype.forEach && !fails(function () { new NativeConstructor().entries().next(); }))
8086 ) {
8087 // create collection constructor
8088 Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER);
8089 InternalMetadataModule.enable();
8090 } else {
8091 Constructor = wrapper(function (target, iterable) {
8092 setInternalState(anInstance(target, Prototype), {
8093 type: CONSTRUCTOR_NAME,
8094 collection: new NativeConstructor()
8095 });
8096 if (iterable != undefined) iterate(iterable, target[ADDER], { that: target, AS_ENTRIES: IS_MAP });
8097 });
8098
8099 var Prototype = Constructor.prototype;
8100
8101 var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
8102
8103 forEach(['add', 'clear', 'delete', 'forEach', 'get', 'has', 'set', 'keys', 'values', 'entries'], function (KEY) {
8104 var IS_ADDER = KEY == 'add' || KEY == 'set';
8105 if (KEY in NativePrototype && !(IS_WEAK && KEY == 'clear')) {
8106 createNonEnumerableProperty(Prototype, KEY, function (a, b) {
8107 var collection = getInternalState(this).collection;
8108 if (!IS_ADDER && IS_WEAK && !isObject(a)) return KEY == 'get' ? undefined : false;
8109 var result = collection[KEY](a === 0 ? 0 : a, b);
8110 return IS_ADDER ? this : result;
8111 });
8112 }
8113 });
8114
8115 IS_WEAK || defineProperty(Prototype, 'size', {
8116 configurable: true,
8117 get: function () {
8118 return getInternalState(this).collection.size;
8119 }
8120 });
8121 }
8122
8123 setToStringTag(Constructor, CONSTRUCTOR_NAME, false, true);
8124
8125 exported[CONSTRUCTOR_NAME] = Constructor;
8126 $({ global: true, forced: true }, exported);
8127
8128 if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP);
8129
8130 return Constructor;
8131};
8132
8133
8134/***/ }),
8135/* 249 */
8136/***/ (function(module, exports, __webpack_require__) {
8137
8138"use strict";
8139
8140
8141var AV = __webpack_require__(250);
8142
8143var useAdatpers = __webpack_require__(545);
8144
8145module.exports = useAdatpers(AV);
8146
8147/***/ }),
8148/* 250 */
8149/***/ (function(module, exports, __webpack_require__) {
8150
8151"use strict";
8152
8153
8154module.exports = __webpack_require__(251);
8155
8156/***/ }),
8157/* 251 */
8158/***/ (function(module, exports, __webpack_require__) {
8159
8160"use strict";
8161
8162
8163var _interopRequireDefault = __webpack_require__(1);
8164
8165var _promise = _interopRequireDefault(__webpack_require__(12));
8166
8167/*!
8168 * LeanCloud JavaScript SDK
8169 * https://leancloud.cn
8170 *
8171 * Copyright 2016 LeanCloud.cn, Inc.
8172 * The LeanCloud JavaScript SDK is freely distributable under the MIT license.
8173 */
8174var _ = __webpack_require__(2);
8175
8176var AV = __webpack_require__(65);
8177
8178AV._ = _;
8179AV.version = __webpack_require__(223);
8180AV.Promise = _promise.default;
8181AV.localStorage = __webpack_require__(225);
8182AV.Cache = __webpack_require__(226);
8183AV.Error = __webpack_require__(43);
8184
8185__webpack_require__(392);
8186
8187__webpack_require__(443)(AV);
8188
8189__webpack_require__(444)(AV);
8190
8191__webpack_require__(445)(AV);
8192
8193__webpack_require__(446)(AV);
8194
8195__webpack_require__(451)(AV);
8196
8197__webpack_require__(452)(AV);
8198
8199__webpack_require__(506)(AV);
8200
8201__webpack_require__(531)(AV);
8202
8203__webpack_require__(532)(AV);
8204
8205__webpack_require__(534)(AV);
8206
8207__webpack_require__(535)(AV);
8208
8209__webpack_require__(536)(AV);
8210
8211__webpack_require__(537)(AV);
8212
8213__webpack_require__(538)(AV);
8214
8215__webpack_require__(539)(AV);
8216
8217__webpack_require__(540)(AV);
8218
8219__webpack_require__(541)(AV);
8220
8221__webpack_require__(542)(AV);
8222
8223AV.Conversation = __webpack_require__(543);
8224
8225__webpack_require__(544);
8226
8227module.exports = AV;
8228/**
8229 * Options to controll the authentication for an operation
8230 * @typedef {Object} AuthOptions
8231 * @property {String} [sessionToken] Specify a user to excute the operation as.
8232 * @property {AV.User} [user] Specify a user to excute the operation as. The user must have _sessionToken. This option will be ignored if sessionToken option provided.
8233 * @property {Boolean} [useMasterKey] Indicates whether masterKey is used for this operation. Only valid when masterKey is set.
8234 */
8235
8236/**
8237 * Options to controll the authentication for an SMS operation
8238 * @typedef {Object} SMSAuthOptions
8239 * @property {String} [sessionToken] Specify a user to excute the operation as.
8240 * @property {AV.User} [user] Specify a user to excute the operation as. The user must have _sessionToken. This option will be ignored if sessionToken option provided.
8241 * @property {Boolean} [useMasterKey] Indicates whether masterKey is used for this operation. Only valid when masterKey is set.
8242 * @property {String} [validateToken] a validate token returned by {@link AV.Cloud.verifyCaptcha}
8243 */
8244
8245/***/ }),
8246/* 252 */
8247/***/ (function(module, exports, __webpack_require__) {
8248
8249var parent = __webpack_require__(253);
8250__webpack_require__(51);
8251
8252module.exports = parent;
8253
8254
8255/***/ }),
8256/* 253 */
8257/***/ (function(module, exports, __webpack_require__) {
8258
8259__webpack_require__(254);
8260__webpack_require__(48);
8261__webpack_require__(60);
8262__webpack_require__(271);
8263__webpack_require__(285);
8264__webpack_require__(286);
8265__webpack_require__(287);
8266__webpack_require__(78);
8267var path = __webpack_require__(10);
8268
8269module.exports = path.Promise;
8270
8271
8272/***/ }),
8273/* 254 */
8274/***/ (function(module, exports, __webpack_require__) {
8275
8276// TODO: Remove this module from `core-js@4` since it's replaced to module below
8277__webpack_require__(255);
8278
8279
8280/***/ }),
8281/* 255 */
8282/***/ (function(module, exports, __webpack_require__) {
8283
8284"use strict";
8285
8286var $ = __webpack_require__(0);
8287var isPrototypeOf = __webpack_require__(21);
8288var getPrototypeOf = __webpack_require__(93);
8289var setPrototypeOf = __webpack_require__(95);
8290var copyConstructorProperties = __webpack_require__(260);
8291var create = __webpack_require__(47);
8292var createNonEnumerableProperty = __webpack_require__(35);
8293var createPropertyDescriptor = __webpack_require__(44);
8294var clearErrorStack = __webpack_require__(264);
8295var installErrorCause = __webpack_require__(265);
8296var iterate = __webpack_require__(37);
8297var normalizeStringArgument = __webpack_require__(266);
8298var wellKnownSymbol = __webpack_require__(9);
8299var ERROR_STACK_INSTALLABLE = __webpack_require__(267);
8300
8301var TO_STRING_TAG = wellKnownSymbol('toStringTag');
8302var $Error = Error;
8303var push = [].push;
8304
8305var $AggregateError = function AggregateError(errors, message /* , options */) {
8306 var options = arguments.length > 2 ? arguments[2] : undefined;
8307 var isInstance = isPrototypeOf(AggregateErrorPrototype, this);
8308 var that;
8309 if (setPrototypeOf) {
8310 that = setPrototypeOf(new $Error(), isInstance ? getPrototypeOf(this) : AggregateErrorPrototype);
8311 } else {
8312 that = isInstance ? this : create(AggregateErrorPrototype);
8313 createNonEnumerableProperty(that, TO_STRING_TAG, 'Error');
8314 }
8315 if (message !== undefined) createNonEnumerableProperty(that, 'message', normalizeStringArgument(message));
8316 if (ERROR_STACK_INSTALLABLE) createNonEnumerableProperty(that, 'stack', clearErrorStack(that.stack, 1));
8317 installErrorCause(that, options);
8318 var errorsArray = [];
8319 iterate(errors, push, { that: errorsArray });
8320 createNonEnumerableProperty(that, 'errors', errorsArray);
8321 return that;
8322};
8323
8324if (setPrototypeOf) setPrototypeOf($AggregateError, $Error);
8325else copyConstructorProperties($AggregateError, $Error, { name: true });
8326
8327var AggregateErrorPrototype = $AggregateError.prototype = create($Error.prototype, {
8328 constructor: createPropertyDescriptor(1, $AggregateError),
8329 message: createPropertyDescriptor(1, ''),
8330 name: createPropertyDescriptor(1, 'AggregateError')
8331});
8332
8333// `AggregateError` constructor
8334// https://tc39.es/ecma262/#sec-aggregate-error-constructor
8335$({ global: true, constructor: true, arity: 2 }, {
8336 AggregateError: $AggregateError
8337});
8338
8339
8340/***/ }),
8341/* 256 */
8342/***/ (function(module, exports, __webpack_require__) {
8343
8344var call = __webpack_require__(13);
8345var isObject = __webpack_require__(11);
8346var isSymbol = __webpack_require__(89);
8347var getMethod = __webpack_require__(116);
8348var ordinaryToPrimitive = __webpack_require__(257);
8349var wellKnownSymbol = __webpack_require__(9);
8350
8351var $TypeError = TypeError;
8352var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
8353
8354// `ToPrimitive` abstract operation
8355// https://tc39.es/ecma262/#sec-toprimitive
8356module.exports = function (input, pref) {
8357 if (!isObject(input) || isSymbol(input)) return input;
8358 var exoticToPrim = getMethod(input, TO_PRIMITIVE);
8359 var result;
8360 if (exoticToPrim) {
8361 if (pref === undefined) pref = 'default';
8362 result = call(exoticToPrim, input, pref);
8363 if (!isObject(result) || isSymbol(result)) return result;
8364 throw $TypeError("Can't convert object to primitive value");
8365 }
8366 if (pref === undefined) pref = 'number';
8367 return ordinaryToPrimitive(input, pref);
8368};
8369
8370
8371/***/ }),
8372/* 257 */
8373/***/ (function(module, exports, __webpack_require__) {
8374
8375var call = __webpack_require__(13);
8376var isCallable = __webpack_require__(7);
8377var isObject = __webpack_require__(11);
8378
8379var $TypeError = TypeError;
8380
8381// `OrdinaryToPrimitive` abstract operation
8382// https://tc39.es/ecma262/#sec-ordinarytoprimitive
8383module.exports = function (input, pref) {
8384 var fn, val;
8385 if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;
8386 if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val;
8387 if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;
8388 throw $TypeError("Can't convert object to primitive value");
8389};
8390
8391
8392/***/ }),
8393/* 258 */
8394/***/ (function(module, exports, __webpack_require__) {
8395
8396var global = __webpack_require__(6);
8397
8398// eslint-disable-next-line es-x/no-object-defineproperty -- safe
8399var defineProperty = Object.defineProperty;
8400
8401module.exports = function (key, value) {
8402 try {
8403 defineProperty(global, key, { value: value, configurable: true, writable: true });
8404 } catch (error) {
8405 global[key] = value;
8406 } return value;
8407};
8408
8409
8410/***/ }),
8411/* 259 */
8412/***/ (function(module, exports, __webpack_require__) {
8413
8414var isCallable = __webpack_require__(7);
8415
8416var $String = String;
8417var $TypeError = TypeError;
8418
8419module.exports = function (argument) {
8420 if (typeof argument == 'object' || isCallable(argument)) return argument;
8421 throw $TypeError("Can't set " + $String(argument) + ' as a prototype');
8422};
8423
8424
8425/***/ }),
8426/* 260 */
8427/***/ (function(module, exports, __webpack_require__) {
8428
8429var hasOwn = __webpack_require__(14);
8430var ownKeys = __webpack_require__(261);
8431var getOwnPropertyDescriptorModule = __webpack_require__(71);
8432var definePropertyModule = __webpack_require__(22);
8433
8434module.exports = function (target, source, exceptions) {
8435 var keys = ownKeys(source);
8436 var defineProperty = definePropertyModule.f;
8437 var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
8438 for (var i = 0; i < keys.length; i++) {
8439 var key = keys[i];
8440 if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {
8441 defineProperty(target, key, getOwnPropertyDescriptor(source, key));
8442 }
8443 }
8444};
8445
8446
8447/***/ }),
8448/* 261 */
8449/***/ (function(module, exports, __webpack_require__) {
8450
8451var getBuiltIn = __webpack_require__(18);
8452var uncurryThis = __webpack_require__(4);
8453var getOwnPropertyNamesModule = __webpack_require__(96);
8454var getOwnPropertySymbolsModule = __webpack_require__(97);
8455var anObject = __webpack_require__(19);
8456
8457var concat = uncurryThis([].concat);
8458
8459// all object keys, includes non-enumerable and symbols
8460module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
8461 var keys = getOwnPropertyNamesModule.f(anObject(it));
8462 var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
8463 return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
8464};
8465
8466
8467/***/ }),
8468/* 262 */
8469/***/ (function(module, exports) {
8470
8471var ceil = Math.ceil;
8472var floor = Math.floor;
8473
8474// `Math.trunc` method
8475// https://tc39.es/ecma262/#sec-math.trunc
8476// eslint-disable-next-line es-x/no-math-trunc -- safe
8477module.exports = Math.trunc || function trunc(x) {
8478 var n = +x;
8479 return (n > 0 ? floor : ceil)(n);
8480};
8481
8482
8483/***/ }),
8484/* 263 */
8485/***/ (function(module, exports, __webpack_require__) {
8486
8487var toIntegerOrInfinity = __webpack_require__(120);
8488
8489var min = Math.min;
8490
8491// `ToLength` abstract operation
8492// https://tc39.es/ecma262/#sec-tolength
8493module.exports = function (argument) {
8494 return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
8495};
8496
8497
8498/***/ }),
8499/* 264 */
8500/***/ (function(module, exports, __webpack_require__) {
8501
8502var uncurryThis = __webpack_require__(4);
8503
8504var $Error = Error;
8505var replace = uncurryThis(''.replace);
8506
8507var TEST = (function (arg) { return String($Error(arg).stack); })('zxcasd');
8508var V8_OR_CHAKRA_STACK_ENTRY = /\n\s*at [^:]*:[^\n]*/;
8509var IS_V8_OR_CHAKRA_STACK = V8_OR_CHAKRA_STACK_ENTRY.test(TEST);
8510
8511module.exports = function (stack, dropEntries) {
8512 if (IS_V8_OR_CHAKRA_STACK && typeof stack == 'string' && !$Error.prepareStackTrace) {
8513 while (dropEntries--) stack = replace(stack, V8_OR_CHAKRA_STACK_ENTRY, '');
8514 } return stack;
8515};
8516
8517
8518/***/ }),
8519/* 265 */
8520/***/ (function(module, exports, __webpack_require__) {
8521
8522var isObject = __webpack_require__(11);
8523var createNonEnumerableProperty = __webpack_require__(35);
8524
8525// `InstallErrorCause` abstract operation
8526// https://tc39.es/proposal-error-cause/#sec-errorobjects-install-error-cause
8527module.exports = function (O, options) {
8528 if (isObject(options) && 'cause' in options) {
8529 createNonEnumerableProperty(O, 'cause', options.cause);
8530 }
8531};
8532
8533
8534/***/ }),
8535/* 266 */
8536/***/ (function(module, exports, __webpack_require__) {
8537
8538var toString = __webpack_require__(75);
8539
8540module.exports = function (argument, $default) {
8541 return argument === undefined ? arguments.length < 2 ? '' : $default : toString(argument);
8542};
8543
8544
8545/***/ }),
8546/* 267 */
8547/***/ (function(module, exports, __webpack_require__) {
8548
8549var fails = __webpack_require__(3);
8550var createPropertyDescriptor = __webpack_require__(44);
8551
8552module.exports = !fails(function () {
8553 var error = Error('a');
8554 if (!('stack' in error)) return true;
8555 // eslint-disable-next-line es-x/no-object-defineproperty -- safe
8556 Object.defineProperty(error, 'stack', createPropertyDescriptor(1, 7));
8557 return error.stack !== 7;
8558});
8559
8560
8561/***/ }),
8562/* 268 */
8563/***/ (function(module, exports, __webpack_require__) {
8564
8565var DESCRIPTORS = __webpack_require__(16);
8566var hasOwn = __webpack_require__(14);
8567
8568var FunctionPrototype = Function.prototype;
8569// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
8570var getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor;
8571
8572var EXISTS = hasOwn(FunctionPrototype, 'name');
8573// additional protection from minified / mangled / dropped function names
8574var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
8575var CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable));
8576
8577module.exports = {
8578 EXISTS: EXISTS,
8579 PROPER: PROPER,
8580 CONFIGURABLE: CONFIGURABLE
8581};
8582
8583
8584/***/ }),
8585/* 269 */
8586/***/ (function(module, exports, __webpack_require__) {
8587
8588"use strict";
8589
8590var IteratorPrototype = __webpack_require__(161).IteratorPrototype;
8591var create = __webpack_require__(47);
8592var createPropertyDescriptor = __webpack_require__(44);
8593var setToStringTag = __webpack_require__(49);
8594var Iterators = __webpack_require__(58);
8595
8596var returnThis = function () { return this; };
8597
8598module.exports = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
8599 var TO_STRING_TAG = NAME + ' Iterator';
8600 IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
8601 setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);
8602 Iterators[TO_STRING_TAG] = returnThis;
8603 return IteratorConstructor;
8604};
8605
8606
8607/***/ }),
8608/* 270 */
8609/***/ (function(module, exports, __webpack_require__) {
8610
8611"use strict";
8612
8613var TO_STRING_TAG_SUPPORT = __webpack_require__(122);
8614var classof = __webpack_require__(59);
8615
8616// `Object.prototype.toString` method implementation
8617// https://tc39.es/ecma262/#sec-object.prototype.tostring
8618module.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() {
8619 return '[object ' + classof(this) + ']';
8620};
8621
8622
8623/***/ }),
8624/* 271 */
8625/***/ (function(module, exports, __webpack_require__) {
8626
8627// TODO: Remove this module from `core-js@4` since it's split to modules listed below
8628__webpack_require__(272);
8629__webpack_require__(280);
8630__webpack_require__(281);
8631__webpack_require__(282);
8632__webpack_require__(283);
8633__webpack_require__(284);
8634
8635
8636/***/ }),
8637/* 272 */
8638/***/ (function(module, exports, __webpack_require__) {
8639
8640"use strict";
8641
8642var $ = __webpack_require__(0);
8643var IS_PURE = __webpack_require__(32);
8644var IS_NODE = __webpack_require__(125);
8645var global = __webpack_require__(6);
8646var call = __webpack_require__(13);
8647var defineBuiltIn = __webpack_require__(39);
8648var setPrototypeOf = __webpack_require__(95);
8649var setToStringTag = __webpack_require__(49);
8650var setSpecies = __webpack_require__(162);
8651var aCallable = __webpack_require__(31);
8652var isCallable = __webpack_require__(7);
8653var isObject = __webpack_require__(11);
8654var anInstance = __webpack_require__(100);
8655var speciesConstructor = __webpack_require__(163);
8656var task = __webpack_require__(165).set;
8657var microtask = __webpack_require__(274);
8658var hostReportErrors = __webpack_require__(277);
8659var perform = __webpack_require__(76);
8660var Queue = __webpack_require__(278);
8661var InternalStateModule = __webpack_require__(38);
8662var NativePromiseConstructor = __webpack_require__(61);
8663var PromiseConstructorDetection = __webpack_require__(77);
8664var newPromiseCapabilityModule = __webpack_require__(50);
8665
8666var PROMISE = 'Promise';
8667var FORCED_PROMISE_CONSTRUCTOR = PromiseConstructorDetection.CONSTRUCTOR;
8668var NATIVE_PROMISE_REJECTION_EVENT = PromiseConstructorDetection.REJECTION_EVENT;
8669var NATIVE_PROMISE_SUBCLASSING = PromiseConstructorDetection.SUBCLASSING;
8670var getInternalPromiseState = InternalStateModule.getterFor(PROMISE);
8671var setInternalState = InternalStateModule.set;
8672var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
8673var PromiseConstructor = NativePromiseConstructor;
8674var PromisePrototype = NativePromisePrototype;
8675var TypeError = global.TypeError;
8676var document = global.document;
8677var process = global.process;
8678var newPromiseCapability = newPromiseCapabilityModule.f;
8679var newGenericPromiseCapability = newPromiseCapability;
8680
8681var DISPATCH_EVENT = !!(document && document.createEvent && global.dispatchEvent);
8682var UNHANDLED_REJECTION = 'unhandledrejection';
8683var REJECTION_HANDLED = 'rejectionhandled';
8684var PENDING = 0;
8685var FULFILLED = 1;
8686var REJECTED = 2;
8687var HANDLED = 1;
8688var UNHANDLED = 2;
8689
8690var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
8691
8692// helpers
8693var isThenable = function (it) {
8694 var then;
8695 return isObject(it) && isCallable(then = it.then) ? then : false;
8696};
8697
8698var callReaction = function (reaction, state) {
8699 var value = state.value;
8700 var ok = state.state == FULFILLED;
8701 var handler = ok ? reaction.ok : reaction.fail;
8702 var resolve = reaction.resolve;
8703 var reject = reaction.reject;
8704 var domain = reaction.domain;
8705 var result, then, exited;
8706 try {
8707 if (handler) {
8708 if (!ok) {
8709 if (state.rejection === UNHANDLED) onHandleUnhandled(state);
8710 state.rejection = HANDLED;
8711 }
8712 if (handler === true) result = value;
8713 else {
8714 if (domain) domain.enter();
8715 result = handler(value); // can throw
8716 if (domain) {
8717 domain.exit();
8718 exited = true;
8719 }
8720 }
8721 if (result === reaction.promise) {
8722 reject(TypeError('Promise-chain cycle'));
8723 } else if (then = isThenable(result)) {
8724 call(then, result, resolve, reject);
8725 } else resolve(result);
8726 } else reject(value);
8727 } catch (error) {
8728 if (domain && !exited) domain.exit();
8729 reject(error);
8730 }
8731};
8732
8733var notify = function (state, isReject) {
8734 if (state.notified) return;
8735 state.notified = true;
8736 microtask(function () {
8737 var reactions = state.reactions;
8738 var reaction;
8739 while (reaction = reactions.get()) {
8740 callReaction(reaction, state);
8741 }
8742 state.notified = false;
8743 if (isReject && !state.rejection) onUnhandled(state);
8744 });
8745};
8746
8747var dispatchEvent = function (name, promise, reason) {
8748 var event, handler;
8749 if (DISPATCH_EVENT) {
8750 event = document.createEvent('Event');
8751 event.promise = promise;
8752 event.reason = reason;
8753 event.initEvent(name, false, true);
8754 global.dispatchEvent(event);
8755 } else event = { promise: promise, reason: reason };
8756 if (!NATIVE_PROMISE_REJECTION_EVENT && (handler = global['on' + name])) handler(event);
8757 else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);
8758};
8759
8760var onUnhandled = function (state) {
8761 call(task, global, function () {
8762 var promise = state.facade;
8763 var value = state.value;
8764 var IS_UNHANDLED = isUnhandled(state);
8765 var result;
8766 if (IS_UNHANDLED) {
8767 result = perform(function () {
8768 if (IS_NODE) {
8769 process.emit('unhandledRejection', value, promise);
8770 } else dispatchEvent(UNHANDLED_REJECTION, promise, value);
8771 });
8772 // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
8773 state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;
8774 if (result.error) throw result.value;
8775 }
8776 });
8777};
8778
8779var isUnhandled = function (state) {
8780 return state.rejection !== HANDLED && !state.parent;
8781};
8782
8783var onHandleUnhandled = function (state) {
8784 call(task, global, function () {
8785 var promise = state.facade;
8786 if (IS_NODE) {
8787 process.emit('rejectionHandled', promise);
8788 } else dispatchEvent(REJECTION_HANDLED, promise, state.value);
8789 });
8790};
8791
8792var bind = function (fn, state, unwrap) {
8793 return function (value) {
8794 fn(state, value, unwrap);
8795 };
8796};
8797
8798var internalReject = function (state, value, unwrap) {
8799 if (state.done) return;
8800 state.done = true;
8801 if (unwrap) state = unwrap;
8802 state.value = value;
8803 state.state = REJECTED;
8804 notify(state, true);
8805};
8806
8807var internalResolve = function (state, value, unwrap) {
8808 if (state.done) return;
8809 state.done = true;
8810 if (unwrap) state = unwrap;
8811 try {
8812 if (state.facade === value) throw TypeError("Promise can't be resolved itself");
8813 var then = isThenable(value);
8814 if (then) {
8815 microtask(function () {
8816 var wrapper = { done: false };
8817 try {
8818 call(then, value,
8819 bind(internalResolve, wrapper, state),
8820 bind(internalReject, wrapper, state)
8821 );
8822 } catch (error) {
8823 internalReject(wrapper, error, state);
8824 }
8825 });
8826 } else {
8827 state.value = value;
8828 state.state = FULFILLED;
8829 notify(state, false);
8830 }
8831 } catch (error) {
8832 internalReject({ done: false }, error, state);
8833 }
8834};
8835
8836// constructor polyfill
8837if (FORCED_PROMISE_CONSTRUCTOR) {
8838 // 25.4.3.1 Promise(executor)
8839 PromiseConstructor = function Promise(executor) {
8840 anInstance(this, PromisePrototype);
8841 aCallable(executor);
8842 call(Internal, this);
8843 var state = getInternalPromiseState(this);
8844 try {
8845 executor(bind(internalResolve, state), bind(internalReject, state));
8846 } catch (error) {
8847 internalReject(state, error);
8848 }
8849 };
8850
8851 PromisePrototype = PromiseConstructor.prototype;
8852
8853 // eslint-disable-next-line no-unused-vars -- required for `.length`
8854 Internal = function Promise(executor) {
8855 setInternalState(this, {
8856 type: PROMISE,
8857 done: false,
8858 notified: false,
8859 parent: false,
8860 reactions: new Queue(),
8861 rejection: false,
8862 state: PENDING,
8863 value: undefined
8864 });
8865 };
8866
8867 // `Promise.prototype.then` method
8868 // https://tc39.es/ecma262/#sec-promise.prototype.then
8869 Internal.prototype = defineBuiltIn(PromisePrototype, 'then', function then(onFulfilled, onRejected) {
8870 var state = getInternalPromiseState(this);
8871 var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor));
8872 state.parent = true;
8873 reaction.ok = isCallable(onFulfilled) ? onFulfilled : true;
8874 reaction.fail = isCallable(onRejected) && onRejected;
8875 reaction.domain = IS_NODE ? process.domain : undefined;
8876 if (state.state == PENDING) state.reactions.add(reaction);
8877 else microtask(function () {
8878 callReaction(reaction, state);
8879 });
8880 return reaction.promise;
8881 });
8882
8883 OwnPromiseCapability = function () {
8884 var promise = new Internal();
8885 var state = getInternalPromiseState(promise);
8886 this.promise = promise;
8887 this.resolve = bind(internalResolve, state);
8888 this.reject = bind(internalReject, state);
8889 };
8890
8891 newPromiseCapabilityModule.f = newPromiseCapability = function (C) {
8892 return C === PromiseConstructor || C === PromiseWrapper
8893 ? new OwnPromiseCapability(C)
8894 : newGenericPromiseCapability(C);
8895 };
8896
8897 if (!IS_PURE && isCallable(NativePromiseConstructor) && NativePromisePrototype !== Object.prototype) {
8898 nativeThen = NativePromisePrototype.then;
8899
8900 if (!NATIVE_PROMISE_SUBCLASSING) {
8901 // make `Promise#then` return a polyfilled `Promise` for native promise-based APIs
8902 defineBuiltIn(NativePromisePrototype, 'then', function then(onFulfilled, onRejected) {
8903 var that = this;
8904 return new PromiseConstructor(function (resolve, reject) {
8905 call(nativeThen, that, resolve, reject);
8906 }).then(onFulfilled, onRejected);
8907 // https://github.com/zloirock/core-js/issues/640
8908 }, { unsafe: true });
8909 }
8910
8911 // make `.constructor === Promise` work for native promise-based APIs
8912 try {
8913 delete NativePromisePrototype.constructor;
8914 } catch (error) { /* empty */ }
8915
8916 // make `instanceof Promise` work for native promise-based APIs
8917 if (setPrototypeOf) {
8918 setPrototypeOf(NativePromisePrototype, PromisePrototype);
8919 }
8920 }
8921}
8922
8923$({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
8924 Promise: PromiseConstructor
8925});
8926
8927setToStringTag(PromiseConstructor, PROMISE, false, true);
8928setSpecies(PROMISE);
8929
8930
8931/***/ }),
8932/* 273 */
8933/***/ (function(module, exports) {
8934
8935var $TypeError = TypeError;
8936
8937module.exports = function (passed, required) {
8938 if (passed < required) throw $TypeError('Not enough arguments');
8939 return passed;
8940};
8941
8942
8943/***/ }),
8944/* 274 */
8945/***/ (function(module, exports, __webpack_require__) {
8946
8947var global = __webpack_require__(6);
8948var bind = __webpack_require__(45);
8949var getOwnPropertyDescriptor = __webpack_require__(71).f;
8950var macrotask = __webpack_require__(165).set;
8951var IS_IOS = __webpack_require__(166);
8952var IS_IOS_PEBBLE = __webpack_require__(275);
8953var IS_WEBOS_WEBKIT = __webpack_require__(276);
8954var IS_NODE = __webpack_require__(125);
8955
8956var MutationObserver = global.MutationObserver || global.WebKitMutationObserver;
8957var document = global.document;
8958var process = global.process;
8959var Promise = global.Promise;
8960// Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`
8961var queueMicrotaskDescriptor = getOwnPropertyDescriptor(global, 'queueMicrotask');
8962var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
8963
8964var flush, head, last, notify, toggle, node, promise, then;
8965
8966// modern engines have queueMicrotask method
8967if (!queueMicrotask) {
8968 flush = function () {
8969 var parent, fn;
8970 if (IS_NODE && (parent = process.domain)) parent.exit();
8971 while (head) {
8972 fn = head.fn;
8973 head = head.next;
8974 try {
8975 fn();
8976 } catch (error) {
8977 if (head) notify();
8978 else last = undefined;
8979 throw error;
8980 }
8981 } last = undefined;
8982 if (parent) parent.enter();
8983 };
8984
8985 // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339
8986 // also except WebOS Webkit https://github.com/zloirock/core-js/issues/898
8987 if (!IS_IOS && !IS_NODE && !IS_WEBOS_WEBKIT && MutationObserver && document) {
8988 toggle = true;
8989 node = document.createTextNode('');
8990 new MutationObserver(flush).observe(node, { characterData: true });
8991 notify = function () {
8992 node.data = toggle = !toggle;
8993 };
8994 // environments with maybe non-completely correct, but existent Promise
8995 } else if (!IS_IOS_PEBBLE && Promise && Promise.resolve) {
8996 // Promise.resolve without an argument throws an error in LG WebOS 2
8997 promise = Promise.resolve(undefined);
8998 // workaround of WebKit ~ iOS Safari 10.1 bug
8999 promise.constructor = Promise;
9000 then = bind(promise.then, promise);
9001 notify = function () {
9002 then(flush);
9003 };
9004 // Node.js without promises
9005 } else if (IS_NODE) {
9006 notify = function () {
9007 process.nextTick(flush);
9008 };
9009 // for other environments - macrotask based on:
9010 // - setImmediate
9011 // - MessageChannel
9012 // - window.postMessage
9013 // - onreadystatechange
9014 // - setTimeout
9015 } else {
9016 // strange IE + webpack dev server bug - use .bind(global)
9017 macrotask = bind(macrotask, global);
9018 notify = function () {
9019 macrotask(flush);
9020 };
9021 }
9022}
9023
9024module.exports = queueMicrotask || function (fn) {
9025 var task = { fn: fn, next: undefined };
9026 if (last) last.next = task;
9027 if (!head) {
9028 head = task;
9029 notify();
9030 } last = task;
9031};
9032
9033
9034/***/ }),
9035/* 275 */
9036/***/ (function(module, exports, __webpack_require__) {
9037
9038var userAgent = __webpack_require__(91);
9039var global = __webpack_require__(6);
9040
9041module.exports = /ipad|iphone|ipod/i.test(userAgent) && global.Pebble !== undefined;
9042
9043
9044/***/ }),
9045/* 276 */
9046/***/ (function(module, exports, __webpack_require__) {
9047
9048var userAgent = __webpack_require__(91);
9049
9050module.exports = /web0s(?!.*chrome)/i.test(userAgent);
9051
9052
9053/***/ }),
9054/* 277 */
9055/***/ (function(module, exports, __webpack_require__) {
9056
9057var global = __webpack_require__(6);
9058
9059module.exports = function (a, b) {
9060 var console = global.console;
9061 if (console && console.error) {
9062 arguments.length == 1 ? console.error(a) : console.error(a, b);
9063 }
9064};
9065
9066
9067/***/ }),
9068/* 278 */
9069/***/ (function(module, exports) {
9070
9071var Queue = function () {
9072 this.head = null;
9073 this.tail = null;
9074};
9075
9076Queue.prototype = {
9077 add: function (item) {
9078 var entry = { item: item, next: null };
9079 if (this.head) this.tail.next = entry;
9080 else this.head = entry;
9081 this.tail = entry;
9082 },
9083 get: function () {
9084 var entry = this.head;
9085 if (entry) {
9086 this.head = entry.next;
9087 if (this.tail === entry) this.tail = null;
9088 return entry.item;
9089 }
9090 }
9091};
9092
9093module.exports = Queue;
9094
9095
9096/***/ }),
9097/* 279 */
9098/***/ (function(module, exports) {
9099
9100module.exports = typeof window == 'object' && typeof Deno != 'object';
9101
9102
9103/***/ }),
9104/* 280 */
9105/***/ (function(module, exports, __webpack_require__) {
9106
9107"use strict";
9108
9109var $ = __webpack_require__(0);
9110var call = __webpack_require__(13);
9111var aCallable = __webpack_require__(31);
9112var newPromiseCapabilityModule = __webpack_require__(50);
9113var perform = __webpack_require__(76);
9114var iterate = __webpack_require__(37);
9115var PROMISE_STATICS_INCORRECT_ITERATION = __webpack_require__(167);
9116
9117// `Promise.all` method
9118// https://tc39.es/ecma262/#sec-promise.all
9119$({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
9120 all: function all(iterable) {
9121 var C = this;
9122 var capability = newPromiseCapabilityModule.f(C);
9123 var resolve = capability.resolve;
9124 var reject = capability.reject;
9125 var result = perform(function () {
9126 var $promiseResolve = aCallable(C.resolve);
9127 var values = [];
9128 var counter = 0;
9129 var remaining = 1;
9130 iterate(iterable, function (promise) {
9131 var index = counter++;
9132 var alreadyCalled = false;
9133 remaining++;
9134 call($promiseResolve, C, promise).then(function (value) {
9135 if (alreadyCalled) return;
9136 alreadyCalled = true;
9137 values[index] = value;
9138 --remaining || resolve(values);
9139 }, reject);
9140 });
9141 --remaining || resolve(values);
9142 });
9143 if (result.error) reject(result.value);
9144 return capability.promise;
9145 }
9146});
9147
9148
9149/***/ }),
9150/* 281 */
9151/***/ (function(module, exports, __webpack_require__) {
9152
9153"use strict";
9154
9155var $ = __webpack_require__(0);
9156var IS_PURE = __webpack_require__(32);
9157var FORCED_PROMISE_CONSTRUCTOR = __webpack_require__(77).CONSTRUCTOR;
9158var NativePromiseConstructor = __webpack_require__(61);
9159var getBuiltIn = __webpack_require__(18);
9160var isCallable = __webpack_require__(7);
9161var defineBuiltIn = __webpack_require__(39);
9162
9163var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
9164
9165// `Promise.prototype.catch` method
9166// https://tc39.es/ecma262/#sec-promise.prototype.catch
9167$({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR, real: true }, {
9168 'catch': function (onRejected) {
9169 return this.then(undefined, onRejected);
9170 }
9171});
9172
9173// makes sure that native promise-based APIs `Promise#catch` properly works with patched `Promise#then`
9174if (!IS_PURE && isCallable(NativePromiseConstructor)) {
9175 var method = getBuiltIn('Promise').prototype['catch'];
9176 if (NativePromisePrototype['catch'] !== method) {
9177 defineBuiltIn(NativePromisePrototype, 'catch', method, { unsafe: true });
9178 }
9179}
9180
9181
9182/***/ }),
9183/* 282 */
9184/***/ (function(module, exports, __webpack_require__) {
9185
9186"use strict";
9187
9188var $ = __webpack_require__(0);
9189var call = __webpack_require__(13);
9190var aCallable = __webpack_require__(31);
9191var newPromiseCapabilityModule = __webpack_require__(50);
9192var perform = __webpack_require__(76);
9193var iterate = __webpack_require__(37);
9194var PROMISE_STATICS_INCORRECT_ITERATION = __webpack_require__(167);
9195
9196// `Promise.race` method
9197// https://tc39.es/ecma262/#sec-promise.race
9198$({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
9199 race: function race(iterable) {
9200 var C = this;
9201 var capability = newPromiseCapabilityModule.f(C);
9202 var reject = capability.reject;
9203 var result = perform(function () {
9204 var $promiseResolve = aCallable(C.resolve);
9205 iterate(iterable, function (promise) {
9206 call($promiseResolve, C, promise).then(capability.resolve, reject);
9207 });
9208 });
9209 if (result.error) reject(result.value);
9210 return capability.promise;
9211 }
9212});
9213
9214
9215/***/ }),
9216/* 283 */
9217/***/ (function(module, exports, __webpack_require__) {
9218
9219"use strict";
9220
9221var $ = __webpack_require__(0);
9222var call = __webpack_require__(13);
9223var newPromiseCapabilityModule = __webpack_require__(50);
9224var FORCED_PROMISE_CONSTRUCTOR = __webpack_require__(77).CONSTRUCTOR;
9225
9226// `Promise.reject` method
9227// https://tc39.es/ecma262/#sec-promise.reject
9228$({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
9229 reject: function reject(r) {
9230 var capability = newPromiseCapabilityModule.f(this);
9231 call(capability.reject, undefined, r);
9232 return capability.promise;
9233 }
9234});
9235
9236
9237/***/ }),
9238/* 284 */
9239/***/ (function(module, exports, __webpack_require__) {
9240
9241"use strict";
9242
9243var $ = __webpack_require__(0);
9244var getBuiltIn = __webpack_require__(18);
9245var IS_PURE = __webpack_require__(32);
9246var NativePromiseConstructor = __webpack_require__(61);
9247var FORCED_PROMISE_CONSTRUCTOR = __webpack_require__(77).CONSTRUCTOR;
9248var promiseResolve = __webpack_require__(169);
9249
9250var PromiseConstructorWrapper = getBuiltIn('Promise');
9251var CHECK_WRAPPER = IS_PURE && !FORCED_PROMISE_CONSTRUCTOR;
9252
9253// `Promise.resolve` method
9254// https://tc39.es/ecma262/#sec-promise.resolve
9255$({ target: 'Promise', stat: true, forced: IS_PURE || FORCED_PROMISE_CONSTRUCTOR }, {
9256 resolve: function resolve(x) {
9257 return promiseResolve(CHECK_WRAPPER && this === PromiseConstructorWrapper ? NativePromiseConstructor : this, x);
9258 }
9259});
9260
9261
9262/***/ }),
9263/* 285 */
9264/***/ (function(module, exports, __webpack_require__) {
9265
9266"use strict";
9267
9268var $ = __webpack_require__(0);
9269var call = __webpack_require__(13);
9270var aCallable = __webpack_require__(31);
9271var newPromiseCapabilityModule = __webpack_require__(50);
9272var perform = __webpack_require__(76);
9273var iterate = __webpack_require__(37);
9274
9275// `Promise.allSettled` method
9276// https://tc39.es/ecma262/#sec-promise.allsettled
9277$({ target: 'Promise', stat: true }, {
9278 allSettled: function allSettled(iterable) {
9279 var C = this;
9280 var capability = newPromiseCapabilityModule.f(C);
9281 var resolve = capability.resolve;
9282 var reject = capability.reject;
9283 var result = perform(function () {
9284 var promiseResolve = aCallable(C.resolve);
9285 var values = [];
9286 var counter = 0;
9287 var remaining = 1;
9288 iterate(iterable, function (promise) {
9289 var index = counter++;
9290 var alreadyCalled = false;
9291 remaining++;
9292 call(promiseResolve, C, promise).then(function (value) {
9293 if (alreadyCalled) return;
9294 alreadyCalled = true;
9295 values[index] = { status: 'fulfilled', value: value };
9296 --remaining || resolve(values);
9297 }, function (error) {
9298 if (alreadyCalled) return;
9299 alreadyCalled = true;
9300 values[index] = { status: 'rejected', reason: error };
9301 --remaining || resolve(values);
9302 });
9303 });
9304 --remaining || resolve(values);
9305 });
9306 if (result.error) reject(result.value);
9307 return capability.promise;
9308 }
9309});
9310
9311
9312/***/ }),
9313/* 286 */
9314/***/ (function(module, exports, __webpack_require__) {
9315
9316"use strict";
9317
9318var $ = __webpack_require__(0);
9319var call = __webpack_require__(13);
9320var aCallable = __webpack_require__(31);
9321var getBuiltIn = __webpack_require__(18);
9322var newPromiseCapabilityModule = __webpack_require__(50);
9323var perform = __webpack_require__(76);
9324var iterate = __webpack_require__(37);
9325
9326var PROMISE_ANY_ERROR = 'No one promise resolved';
9327
9328// `Promise.any` method
9329// https://tc39.es/ecma262/#sec-promise.any
9330$({ target: 'Promise', stat: true }, {
9331 any: function any(iterable) {
9332 var C = this;
9333 var AggregateError = getBuiltIn('AggregateError');
9334 var capability = newPromiseCapabilityModule.f(C);
9335 var resolve = capability.resolve;
9336 var reject = capability.reject;
9337 var result = perform(function () {
9338 var promiseResolve = aCallable(C.resolve);
9339 var errors = [];
9340 var counter = 0;
9341 var remaining = 1;
9342 var alreadyResolved = false;
9343 iterate(iterable, function (promise) {
9344 var index = counter++;
9345 var alreadyRejected = false;
9346 remaining++;
9347 call(promiseResolve, C, promise).then(function (value) {
9348 if (alreadyRejected || alreadyResolved) return;
9349 alreadyResolved = true;
9350 resolve(value);
9351 }, function (error) {
9352 if (alreadyRejected || alreadyResolved) return;
9353 alreadyRejected = true;
9354 errors[index] = error;
9355 --remaining || reject(new AggregateError(errors, PROMISE_ANY_ERROR));
9356 });
9357 });
9358 --remaining || reject(new AggregateError(errors, PROMISE_ANY_ERROR));
9359 });
9360 if (result.error) reject(result.value);
9361 return capability.promise;
9362 }
9363});
9364
9365
9366/***/ }),
9367/* 287 */
9368/***/ (function(module, exports, __webpack_require__) {
9369
9370"use strict";
9371
9372var $ = __webpack_require__(0);
9373var IS_PURE = __webpack_require__(32);
9374var NativePromiseConstructor = __webpack_require__(61);
9375var fails = __webpack_require__(3);
9376var getBuiltIn = __webpack_require__(18);
9377var isCallable = __webpack_require__(7);
9378var speciesConstructor = __webpack_require__(163);
9379var promiseResolve = __webpack_require__(169);
9380var defineBuiltIn = __webpack_require__(39);
9381
9382var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
9383
9384// Safari bug https://bugs.webkit.org/show_bug.cgi?id=200829
9385var NON_GENERIC = !!NativePromiseConstructor && fails(function () {
9386 // eslint-disable-next-line unicorn/no-thenable -- required for testing
9387 NativePromisePrototype['finally'].call({ then: function () { /* empty */ } }, function () { /* empty */ });
9388});
9389
9390// `Promise.prototype.finally` method
9391// https://tc39.es/ecma262/#sec-promise.prototype.finally
9392$({ target: 'Promise', proto: true, real: true, forced: NON_GENERIC }, {
9393 'finally': function (onFinally) {
9394 var C = speciesConstructor(this, getBuiltIn('Promise'));
9395 var isFunction = isCallable(onFinally);
9396 return this.then(
9397 isFunction ? function (x) {
9398 return promiseResolve(C, onFinally()).then(function () { return x; });
9399 } : onFinally,
9400 isFunction ? function (e) {
9401 return promiseResolve(C, onFinally()).then(function () { throw e; });
9402 } : onFinally
9403 );
9404 }
9405});
9406
9407// makes sure that native promise-based APIs `Promise#finally` properly works with patched `Promise#then`
9408if (!IS_PURE && isCallable(NativePromiseConstructor)) {
9409 var method = getBuiltIn('Promise').prototype['finally'];
9410 if (NativePromisePrototype['finally'] !== method) {
9411 defineBuiltIn(NativePromisePrototype, 'finally', method, { unsafe: true });
9412 }
9413}
9414
9415
9416/***/ }),
9417/* 288 */
9418/***/ (function(module, exports, __webpack_require__) {
9419
9420var uncurryThis = __webpack_require__(4);
9421var toIntegerOrInfinity = __webpack_require__(120);
9422var toString = __webpack_require__(75);
9423var requireObjectCoercible = __webpack_require__(115);
9424
9425var charAt = uncurryThis(''.charAt);
9426var charCodeAt = uncurryThis(''.charCodeAt);
9427var stringSlice = uncurryThis(''.slice);
9428
9429var createMethod = function (CONVERT_TO_STRING) {
9430 return function ($this, pos) {
9431 var S = toString(requireObjectCoercible($this));
9432 var position = toIntegerOrInfinity(pos);
9433 var size = S.length;
9434 var first, second;
9435 if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
9436 first = charCodeAt(S, position);
9437 return first < 0xD800 || first > 0xDBFF || position + 1 === size
9438 || (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF
9439 ? CONVERT_TO_STRING
9440 ? charAt(S, position)
9441 : first
9442 : CONVERT_TO_STRING
9443 ? stringSlice(S, position, position + 2)
9444 : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
9445 };
9446};
9447
9448module.exports = {
9449 // `String.prototype.codePointAt` method
9450 // https://tc39.es/ecma262/#sec-string.prototype.codepointat
9451 codeAt: createMethod(false),
9452 // `String.prototype.at` method
9453 // https://github.com/mathiasbynens/String.prototype.at
9454 charAt: createMethod(true)
9455};
9456
9457
9458/***/ }),
9459/* 289 */
9460/***/ (function(module, exports) {
9461
9462// iterable DOM collections
9463// flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
9464module.exports = {
9465 CSSRuleList: 0,
9466 CSSStyleDeclaration: 0,
9467 CSSValueList: 0,
9468 ClientRectList: 0,
9469 DOMRectList: 0,
9470 DOMStringList: 0,
9471 DOMTokenList: 1,
9472 DataTransferItemList: 0,
9473 FileList: 0,
9474 HTMLAllCollection: 0,
9475 HTMLCollection: 0,
9476 HTMLFormElement: 0,
9477 HTMLSelectElement: 0,
9478 MediaList: 0,
9479 MimeTypeArray: 0,
9480 NamedNodeMap: 0,
9481 NodeList: 1,
9482 PaintRequestList: 0,
9483 Plugin: 0,
9484 PluginArray: 0,
9485 SVGLengthList: 0,
9486 SVGNumberList: 0,
9487 SVGPathSegList: 0,
9488 SVGPointList: 0,
9489 SVGStringList: 0,
9490 SVGTransformList: 0,
9491 SourceBufferList: 0,
9492 StyleSheetList: 0,
9493 TextTrackCueList: 0,
9494 TextTrackList: 0,
9495 TouchList: 0
9496};
9497
9498
9499/***/ }),
9500/* 290 */
9501/***/ (function(module, __webpack_exports__, __webpack_require__) {
9502
9503"use strict";
9504/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__index_js__ = __webpack_require__(126);
9505// Default Export
9506// ==============
9507// In this module, we mix our bundled exports into the `_` object and export
9508// the result. This is analogous to setting `module.exports = _` in CommonJS.
9509// Hence, this module is also the entry point of our UMD bundle and the package
9510// entry point for CommonJS and AMD users. In other words, this is (the source
9511// of) the module you are interfacing with when you do any of the following:
9512//
9513// ```js
9514// // CommonJS
9515// var _ = require('underscore');
9516//
9517// // AMD
9518// define(['underscore'], function(_) {...});
9519//
9520// // UMD in the browser
9521// // _ is available as a global variable
9522// ```
9523
9524
9525
9526// Add all of the Underscore functions to the wrapper object.
9527var _ = Object(__WEBPACK_IMPORTED_MODULE_0__index_js__["mixin"])(__WEBPACK_IMPORTED_MODULE_0__index_js__);
9528// Legacy Node.js API.
9529_._ = _;
9530// Export the Underscore API.
9531/* harmony default export */ __webpack_exports__["a"] = (_);
9532
9533
9534/***/ }),
9535/* 291 */
9536/***/ (function(module, __webpack_exports__, __webpack_require__) {
9537
9538"use strict";
9539/* harmony export (immutable) */ __webpack_exports__["a"] = isNull;
9540// Is a given value equal to null?
9541function isNull(obj) {
9542 return obj === null;
9543}
9544
9545
9546/***/ }),
9547/* 292 */
9548/***/ (function(module, __webpack_exports__, __webpack_require__) {
9549
9550"use strict";
9551/* harmony export (immutable) */ __webpack_exports__["a"] = isElement;
9552// Is a given value a DOM element?
9553function isElement(obj) {
9554 return !!(obj && obj.nodeType === 1);
9555}
9556
9557
9558/***/ }),
9559/* 293 */
9560/***/ (function(module, __webpack_exports__, __webpack_require__) {
9561
9562"use strict";
9563/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
9564
9565
9566/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Date'));
9567
9568
9569/***/ }),
9570/* 294 */
9571/***/ (function(module, __webpack_exports__, __webpack_require__) {
9572
9573"use strict";
9574/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
9575
9576
9577/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('RegExp'));
9578
9579
9580/***/ }),
9581/* 295 */
9582/***/ (function(module, __webpack_exports__, __webpack_require__) {
9583
9584"use strict";
9585/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
9586
9587
9588/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Error'));
9589
9590
9591/***/ }),
9592/* 296 */
9593/***/ (function(module, __webpack_exports__, __webpack_require__) {
9594
9595"use strict";
9596/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
9597
9598
9599/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Object'));
9600
9601
9602/***/ }),
9603/* 297 */
9604/***/ (function(module, __webpack_exports__, __webpack_require__) {
9605
9606"use strict";
9607/* harmony export (immutable) */ __webpack_exports__["a"] = isFinite;
9608/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
9609/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isSymbol_js__ = __webpack_require__(173);
9610
9611
9612
9613// Is a given object a finite number?
9614function isFinite(obj) {
9615 return !Object(__WEBPACK_IMPORTED_MODULE_1__isSymbol_js__["a" /* default */])(obj) && Object(__WEBPACK_IMPORTED_MODULE_0__setup_js__["f" /* _isFinite */])(obj) && !isNaN(parseFloat(obj));
9616}
9617
9618
9619/***/ }),
9620/* 298 */
9621/***/ (function(module, __webpack_exports__, __webpack_require__) {
9622
9623"use strict";
9624/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createSizePropertyCheck_js__ = __webpack_require__(178);
9625/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getByteLength_js__ = __webpack_require__(130);
9626
9627
9628
9629// Internal helper to determine whether we should spend extensive checks against
9630// `ArrayBuffer` et al.
9631/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createSizePropertyCheck_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__getByteLength_js__["a" /* default */]));
9632
9633
9634/***/ }),
9635/* 299 */
9636/***/ (function(module, __webpack_exports__, __webpack_require__) {
9637
9638"use strict";
9639/* harmony export (immutable) */ __webpack_exports__["a"] = isEmpty;
9640/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(28);
9641/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArray_js__ = __webpack_require__(53);
9642/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isString_js__ = __webpack_require__(127);
9643/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isArguments_js__ = __webpack_require__(129);
9644/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__keys_js__ = __webpack_require__(15);
9645
9646
9647
9648
9649
9650
9651// Is a given array, string, or object empty?
9652// An "empty" object has no enumerable own-properties.
9653function isEmpty(obj) {
9654 if (obj == null) return true;
9655 // Skip the more expensive `toString`-based type checks if `obj` has no
9656 // `.length`.
9657 var length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(obj);
9658 if (typeof length == 'number' && (
9659 Object(__WEBPACK_IMPORTED_MODULE_1__isArray_js__["a" /* default */])(obj) || Object(__WEBPACK_IMPORTED_MODULE_2__isString_js__["a" /* default */])(obj) || Object(__WEBPACK_IMPORTED_MODULE_3__isArguments_js__["a" /* default */])(obj)
9660 )) return length === 0;
9661 return Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_4__keys_js__["a" /* default */])(obj)) === 0;
9662}
9663
9664
9665/***/ }),
9666/* 300 */
9667/***/ (function(module, __webpack_exports__, __webpack_require__) {
9668
9669"use strict";
9670/* harmony export (immutable) */ __webpack_exports__["a"] = isEqual;
9671/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(24);
9672/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(5);
9673/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__getByteLength_js__ = __webpack_require__(130);
9674/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isTypedArray_js__ = __webpack_require__(176);
9675/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__isFunction_js__ = __webpack_require__(27);
9676/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__stringTagBug_js__ = __webpack_require__(79);
9677/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__isDataView_js__ = __webpack_require__(128);
9678/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__keys_js__ = __webpack_require__(15);
9679/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__has_js__ = __webpack_require__(40);
9680/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__toBufferView_js__ = __webpack_require__(301);
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692// We use this string twice, so give it a name for minification.
9693var tagDataView = '[object DataView]';
9694
9695// Internal recursive comparison function for `_.isEqual`.
9696function eq(a, b, aStack, bStack) {
9697 // Identical objects are equal. `0 === -0`, but they aren't identical.
9698 // See the [Harmony `egal` proposal](https://wiki.ecmascript.org/doku.php?id=harmony:egal).
9699 if (a === b) return a !== 0 || 1 / a === 1 / b;
9700 // `null` or `undefined` only equal to itself (strict comparison).
9701 if (a == null || b == null) return false;
9702 // `NaN`s are equivalent, but non-reflexive.
9703 if (a !== a) return b !== b;
9704 // Exhaust primitive checks
9705 var type = typeof a;
9706 if (type !== 'function' && type !== 'object' && typeof b != 'object') return false;
9707 return deepEq(a, b, aStack, bStack);
9708}
9709
9710// Internal recursive comparison function for `_.isEqual`.
9711function deepEq(a, b, aStack, bStack) {
9712 // Unwrap any wrapped objects.
9713 if (a instanceof __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */]) a = a._wrapped;
9714 if (b instanceof __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */]) b = b._wrapped;
9715 // Compare `[[Class]]` names.
9716 var className = __WEBPACK_IMPORTED_MODULE_1__setup_js__["t" /* toString */].call(a);
9717 if (className !== __WEBPACK_IMPORTED_MODULE_1__setup_js__["t" /* toString */].call(b)) return false;
9718 // Work around a bug in IE 10 - Edge 13.
9719 if (__WEBPACK_IMPORTED_MODULE_5__stringTagBug_js__["a" /* hasStringTagBug */] && className == '[object Object]' && Object(__WEBPACK_IMPORTED_MODULE_6__isDataView_js__["a" /* default */])(a)) {
9720 if (!Object(__WEBPACK_IMPORTED_MODULE_6__isDataView_js__["a" /* default */])(b)) return false;
9721 className = tagDataView;
9722 }
9723 switch (className) {
9724 // These types are compared by value.
9725 case '[object RegExp]':
9726 // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')
9727 case '[object String]':
9728 // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is
9729 // equivalent to `new String("5")`.
9730 return '' + a === '' + b;
9731 case '[object Number]':
9732 // `NaN`s are equivalent, but non-reflexive.
9733 // Object(NaN) is equivalent to NaN.
9734 if (+a !== +a) return +b !== +b;
9735 // An `egal` comparison is performed for other numeric values.
9736 return +a === 0 ? 1 / +a === 1 / b : +a === +b;
9737 case '[object Date]':
9738 case '[object Boolean]':
9739 // Coerce dates and booleans to numeric primitive values. Dates are compared by their
9740 // millisecond representations. Note that invalid dates with millisecond representations
9741 // of `NaN` are not equivalent.
9742 return +a === +b;
9743 case '[object Symbol]':
9744 return __WEBPACK_IMPORTED_MODULE_1__setup_js__["d" /* SymbolProto */].valueOf.call(a) === __WEBPACK_IMPORTED_MODULE_1__setup_js__["d" /* SymbolProto */].valueOf.call(b);
9745 case '[object ArrayBuffer]':
9746 case tagDataView:
9747 // Coerce to typed array so we can fall through.
9748 return deepEq(Object(__WEBPACK_IMPORTED_MODULE_9__toBufferView_js__["a" /* default */])(a), Object(__WEBPACK_IMPORTED_MODULE_9__toBufferView_js__["a" /* default */])(b), aStack, bStack);
9749 }
9750
9751 var areArrays = className === '[object Array]';
9752 if (!areArrays && Object(__WEBPACK_IMPORTED_MODULE_3__isTypedArray_js__["a" /* default */])(a)) {
9753 var byteLength = Object(__WEBPACK_IMPORTED_MODULE_2__getByteLength_js__["a" /* default */])(a);
9754 if (byteLength !== Object(__WEBPACK_IMPORTED_MODULE_2__getByteLength_js__["a" /* default */])(b)) return false;
9755 if (a.buffer === b.buffer && a.byteOffset === b.byteOffset) return true;
9756 areArrays = true;
9757 }
9758 if (!areArrays) {
9759 if (typeof a != 'object' || typeof b != 'object') return false;
9760
9761 // Objects with different constructors are not equivalent, but `Object`s or `Array`s
9762 // from different frames are.
9763 var aCtor = a.constructor, bCtor = b.constructor;
9764 if (aCtor !== bCtor && !(Object(__WEBPACK_IMPORTED_MODULE_4__isFunction_js__["a" /* default */])(aCtor) && aCtor instanceof aCtor &&
9765 Object(__WEBPACK_IMPORTED_MODULE_4__isFunction_js__["a" /* default */])(bCtor) && bCtor instanceof bCtor)
9766 && ('constructor' in a && 'constructor' in b)) {
9767 return false;
9768 }
9769 }
9770 // Assume equality for cyclic structures. The algorithm for detecting cyclic
9771 // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.
9772
9773 // Initializing stack of traversed objects.
9774 // It's done here since we only need them for objects and arrays comparison.
9775 aStack = aStack || [];
9776 bStack = bStack || [];
9777 var length = aStack.length;
9778 while (length--) {
9779 // Linear search. Performance is inversely proportional to the number of
9780 // unique nested structures.
9781 if (aStack[length] === a) return bStack[length] === b;
9782 }
9783
9784 // Add the first object to the stack of traversed objects.
9785 aStack.push(a);
9786 bStack.push(b);
9787
9788 // Recursively compare objects and arrays.
9789 if (areArrays) {
9790 // Compare array lengths to determine if a deep comparison is necessary.
9791 length = a.length;
9792 if (length !== b.length) return false;
9793 // Deep compare the contents, ignoring non-numeric properties.
9794 while (length--) {
9795 if (!eq(a[length], b[length], aStack, bStack)) return false;
9796 }
9797 } else {
9798 // Deep compare objects.
9799 var _keys = Object(__WEBPACK_IMPORTED_MODULE_7__keys_js__["a" /* default */])(a), key;
9800 length = _keys.length;
9801 // Ensure that both objects contain the same number of properties before comparing deep equality.
9802 if (Object(__WEBPACK_IMPORTED_MODULE_7__keys_js__["a" /* default */])(b).length !== length) return false;
9803 while (length--) {
9804 // Deep compare each member
9805 key = _keys[length];
9806 if (!(Object(__WEBPACK_IMPORTED_MODULE_8__has_js__["a" /* default */])(b, key) && eq(a[key], b[key], aStack, bStack))) return false;
9807 }
9808 }
9809 // Remove the first object from the stack of traversed objects.
9810 aStack.pop();
9811 bStack.pop();
9812 return true;
9813}
9814
9815// Perform a deep comparison to check if two objects are equal.
9816function isEqual(a, b) {
9817 return eq(a, b);
9818}
9819
9820
9821/***/ }),
9822/* 301 */
9823/***/ (function(module, __webpack_exports__, __webpack_require__) {
9824
9825"use strict";
9826/* harmony export (immutable) */ __webpack_exports__["a"] = toBufferView;
9827/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getByteLength_js__ = __webpack_require__(130);
9828
9829
9830// Internal function to wrap or shallow-copy an ArrayBuffer,
9831// typed array or DataView to a new view, reusing the buffer.
9832function toBufferView(bufferSource) {
9833 return new Uint8Array(
9834 bufferSource.buffer || bufferSource,
9835 bufferSource.byteOffset || 0,
9836 Object(__WEBPACK_IMPORTED_MODULE_0__getByteLength_js__["a" /* default */])(bufferSource)
9837 );
9838}
9839
9840
9841/***/ }),
9842/* 302 */
9843/***/ (function(module, __webpack_exports__, __webpack_require__) {
9844
9845"use strict";
9846/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
9847/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__stringTagBug_js__ = __webpack_require__(79);
9848/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__ = __webpack_require__(131);
9849
9850
9851
9852
9853/* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_1__stringTagBug_js__["b" /* isIE11 */] ? Object(__WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__["a" /* ie11fingerprint */])(__WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__["b" /* mapMethods */]) : Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Map'));
9854
9855
9856/***/ }),
9857/* 303 */
9858/***/ (function(module, __webpack_exports__, __webpack_require__) {
9859
9860"use strict";
9861/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
9862/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__stringTagBug_js__ = __webpack_require__(79);
9863/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__ = __webpack_require__(131);
9864
9865
9866
9867
9868/* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_1__stringTagBug_js__["b" /* isIE11 */] ? Object(__WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__["a" /* ie11fingerprint */])(__WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__["d" /* weakMapMethods */]) : Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('WeakMap'));
9869
9870
9871/***/ }),
9872/* 304 */
9873/***/ (function(module, __webpack_exports__, __webpack_require__) {
9874
9875"use strict";
9876/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
9877/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__stringTagBug_js__ = __webpack_require__(79);
9878/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__ = __webpack_require__(131);
9879
9880
9881
9882
9883/* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_1__stringTagBug_js__["b" /* isIE11 */] ? Object(__WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__["a" /* ie11fingerprint */])(__WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__["c" /* setMethods */]) : Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Set'));
9884
9885
9886/***/ }),
9887/* 305 */
9888/***/ (function(module, __webpack_exports__, __webpack_require__) {
9889
9890"use strict";
9891/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
9892
9893
9894/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('WeakSet'));
9895
9896
9897/***/ }),
9898/* 306 */
9899/***/ (function(module, __webpack_exports__, __webpack_require__) {
9900
9901"use strict";
9902/* harmony export (immutable) */ __webpack_exports__["a"] = pairs;
9903/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__keys_js__ = __webpack_require__(15);
9904
9905
9906// Convert an object into a list of `[key, value]` pairs.
9907// The opposite of `_.object` with one argument.
9908function pairs(obj) {
9909 var _keys = Object(__WEBPACK_IMPORTED_MODULE_0__keys_js__["a" /* default */])(obj);
9910 var length = _keys.length;
9911 var pairs = Array(length);
9912 for (var i = 0; i < length; i++) {
9913 pairs[i] = [_keys[i], obj[_keys[i]]];
9914 }
9915 return pairs;
9916}
9917
9918
9919/***/ }),
9920/* 307 */
9921/***/ (function(module, __webpack_exports__, __webpack_require__) {
9922
9923"use strict";
9924/* harmony export (immutable) */ __webpack_exports__["a"] = create;
9925/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseCreate_js__ = __webpack_require__(186);
9926/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__extendOwn_js__ = __webpack_require__(133);
9927
9928
9929
9930// Creates an object that inherits from the given prototype object.
9931// If additional properties are provided then they will be added to the
9932// created object.
9933function create(prototype, props) {
9934 var result = Object(__WEBPACK_IMPORTED_MODULE_0__baseCreate_js__["a" /* default */])(prototype);
9935 if (props) Object(__WEBPACK_IMPORTED_MODULE_1__extendOwn_js__["a" /* default */])(result, props);
9936 return result;
9937}
9938
9939
9940/***/ }),
9941/* 308 */
9942/***/ (function(module, __webpack_exports__, __webpack_require__) {
9943
9944"use strict";
9945/* harmony export (immutable) */ __webpack_exports__["a"] = tap;
9946// Invokes `interceptor` with the `obj` and then returns `obj`.
9947// The primary purpose of this method is to "tap into" a method chain, in
9948// order to perform operations on intermediate results within the chain.
9949function tap(obj, interceptor) {
9950 interceptor(obj);
9951 return obj;
9952}
9953
9954
9955/***/ }),
9956/* 309 */
9957/***/ (function(module, __webpack_exports__, __webpack_require__) {
9958
9959"use strict";
9960/* harmony export (immutable) */ __webpack_exports__["a"] = has;
9961/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__has_js__ = __webpack_require__(40);
9962/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__toPath_js__ = __webpack_require__(81);
9963
9964
9965
9966// Shortcut function for checking if an object has a given property directly on
9967// itself (in other words, not on a prototype). Unlike the internal `has`
9968// function, this public version can also traverse nested properties.
9969function has(obj, path) {
9970 path = Object(__WEBPACK_IMPORTED_MODULE_1__toPath_js__["a" /* default */])(path);
9971 var length = path.length;
9972 for (var i = 0; i < length; i++) {
9973 var key = path[i];
9974 if (!Object(__WEBPACK_IMPORTED_MODULE_0__has_js__["a" /* default */])(obj, key)) return false;
9975 obj = obj[key];
9976 }
9977 return !!length;
9978}
9979
9980
9981/***/ }),
9982/* 310 */
9983/***/ (function(module, __webpack_exports__, __webpack_require__) {
9984
9985"use strict";
9986/* harmony export (immutable) */ __webpack_exports__["a"] = mapObject;
9987/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(20);
9988/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__keys_js__ = __webpack_require__(15);
9989
9990
9991
9992// Returns the results of applying the `iteratee` to each element of `obj`.
9993// In contrast to `_.map` it returns an object.
9994function mapObject(obj, iteratee, context) {
9995 iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(iteratee, context);
9996 var _keys = Object(__WEBPACK_IMPORTED_MODULE_1__keys_js__["a" /* default */])(obj),
9997 length = _keys.length,
9998 results = {};
9999 for (var index = 0; index < length; index++) {
10000 var currentKey = _keys[index];
10001 results[currentKey] = iteratee(obj[currentKey], currentKey, obj);
10002 }
10003 return results;
10004}
10005
10006
10007/***/ }),
10008/* 311 */
10009/***/ (function(module, __webpack_exports__, __webpack_require__) {
10010
10011"use strict";
10012/* harmony export (immutable) */ __webpack_exports__["a"] = propertyOf;
10013/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__noop_js__ = __webpack_require__(192);
10014/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__get_js__ = __webpack_require__(188);
10015
10016
10017
10018// Generates a function for a given object that returns a given property.
10019function propertyOf(obj) {
10020 if (obj == null) return __WEBPACK_IMPORTED_MODULE_0__noop_js__["a" /* default */];
10021 return function(path) {
10022 return Object(__WEBPACK_IMPORTED_MODULE_1__get_js__["a" /* default */])(obj, path);
10023 };
10024}
10025
10026
10027/***/ }),
10028/* 312 */
10029/***/ (function(module, __webpack_exports__, __webpack_require__) {
10030
10031"use strict";
10032/* harmony export (immutable) */ __webpack_exports__["a"] = times;
10033/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__optimizeCb_js__ = __webpack_require__(82);
10034
10035
10036// Run a function **n** times.
10037function times(n, iteratee, context) {
10038 var accum = Array(Math.max(0, n));
10039 iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__optimizeCb_js__["a" /* default */])(iteratee, context, 1);
10040 for (var i = 0; i < n; i++) accum[i] = iteratee(i);
10041 return accum;
10042}
10043
10044
10045/***/ }),
10046/* 313 */
10047/***/ (function(module, __webpack_exports__, __webpack_require__) {
10048
10049"use strict";
10050/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createEscaper_js__ = __webpack_require__(194);
10051/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__escapeMap_js__ = __webpack_require__(195);
10052
10053
10054
10055// Function for escaping strings to HTML interpolation.
10056/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createEscaper_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__escapeMap_js__["a" /* default */]));
10057
10058
10059/***/ }),
10060/* 314 */
10061/***/ (function(module, __webpack_exports__, __webpack_require__) {
10062
10063"use strict";
10064/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createEscaper_js__ = __webpack_require__(194);
10065/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__unescapeMap_js__ = __webpack_require__(315);
10066
10067
10068
10069// Function for unescaping strings from HTML interpolation.
10070/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createEscaper_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__unescapeMap_js__["a" /* default */]));
10071
10072
10073/***/ }),
10074/* 315 */
10075/***/ (function(module, __webpack_exports__, __webpack_require__) {
10076
10077"use strict";
10078/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__invert_js__ = __webpack_require__(182);
10079/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__escapeMap_js__ = __webpack_require__(195);
10080
10081
10082
10083// Internal list of HTML entities for unescaping.
10084/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__invert_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__escapeMap_js__["a" /* default */]));
10085
10086
10087/***/ }),
10088/* 316 */
10089/***/ (function(module, __webpack_exports__, __webpack_require__) {
10090
10091"use strict";
10092/* harmony export (immutable) */ __webpack_exports__["a"] = template;
10093/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__defaults_js__ = __webpack_require__(185);
10094/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__underscore_js__ = __webpack_require__(24);
10095/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__templateSettings_js__ = __webpack_require__(196);
10096
10097
10098
10099
10100// When customizing `_.templateSettings`, if you don't want to define an
10101// interpolation, evaluation or escaping regex, we need one that is
10102// guaranteed not to match.
10103var noMatch = /(.)^/;
10104
10105// Certain characters need to be escaped so that they can be put into a
10106// string literal.
10107var escapes = {
10108 "'": "'",
10109 '\\': '\\',
10110 '\r': 'r',
10111 '\n': 'n',
10112 '\u2028': 'u2028',
10113 '\u2029': 'u2029'
10114};
10115
10116var escapeRegExp = /\\|'|\r|\n|\u2028|\u2029/g;
10117
10118function escapeChar(match) {
10119 return '\\' + escapes[match];
10120}
10121
10122var bareIdentifier = /^\s*(\w|\$)+\s*$/;
10123
10124// JavaScript micro-templating, similar to John Resig's implementation.
10125// Underscore templating handles arbitrary delimiters, preserves whitespace,
10126// and correctly escapes quotes within interpolated code.
10127// NB: `oldSettings` only exists for backwards compatibility.
10128function template(text, settings, oldSettings) {
10129 if (!settings && oldSettings) settings = oldSettings;
10130 settings = Object(__WEBPACK_IMPORTED_MODULE_0__defaults_js__["a" /* default */])({}, settings, __WEBPACK_IMPORTED_MODULE_1__underscore_js__["a" /* default */].templateSettings);
10131
10132 // Combine delimiters into one regular expression via alternation.
10133 var matcher = RegExp([
10134 (settings.escape || noMatch).source,
10135 (settings.interpolate || noMatch).source,
10136 (settings.evaluate || noMatch).source
10137 ].join('|') + '|$', 'g');
10138
10139 // Compile the template source, escaping string literals appropriately.
10140 var index = 0;
10141 var source = "__p+='";
10142 text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {
10143 source += text.slice(index, offset).replace(escapeRegExp, escapeChar);
10144 index = offset + match.length;
10145
10146 if (escape) {
10147 source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'";
10148 } else if (interpolate) {
10149 source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'";
10150 } else if (evaluate) {
10151 source += "';\n" + evaluate + "\n__p+='";
10152 }
10153
10154 // Adobe VMs need the match returned to produce the correct offset.
10155 return match;
10156 });
10157 source += "';\n";
10158
10159 var argument = settings.variable;
10160 if (argument) {
10161 if (!bareIdentifier.test(argument)) throw new Error(argument);
10162 } else {
10163 // If a variable is not specified, place data values in local scope.
10164 source = 'with(obj||{}){\n' + source + '}\n';
10165 argument = 'obj';
10166 }
10167
10168 source = "var __t,__p='',__j=Array.prototype.join," +
10169 "print=function(){__p+=__j.call(arguments,'');};\n" +
10170 source + 'return __p;\n';
10171
10172 var render;
10173 try {
10174 render = new Function(argument, '_', source);
10175 } catch (e) {
10176 e.source = source;
10177 throw e;
10178 }
10179
10180 var template = function(data) {
10181 return render.call(this, data, __WEBPACK_IMPORTED_MODULE_1__underscore_js__["a" /* default */]);
10182 };
10183
10184 // Provide the compiled source as a convenience for precompilation.
10185 template.source = 'function(' + argument + '){\n' + source + '}';
10186
10187 return template;
10188}
10189
10190
10191/***/ }),
10192/* 317 */
10193/***/ (function(module, __webpack_exports__, __webpack_require__) {
10194
10195"use strict";
10196/* harmony export (immutable) */ __webpack_exports__["a"] = result;
10197/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isFunction_js__ = __webpack_require__(27);
10198/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__toPath_js__ = __webpack_require__(81);
10199
10200
10201
10202// Traverses the children of `obj` along `path`. If a child is a function, it
10203// is invoked with its parent as context. Returns the value of the final
10204// child, or `fallback` if any child is undefined.
10205function result(obj, path, fallback) {
10206 path = Object(__WEBPACK_IMPORTED_MODULE_1__toPath_js__["a" /* default */])(path);
10207 var length = path.length;
10208 if (!length) {
10209 return Object(__WEBPACK_IMPORTED_MODULE_0__isFunction_js__["a" /* default */])(fallback) ? fallback.call(obj) : fallback;
10210 }
10211 for (var i = 0; i < length; i++) {
10212 var prop = obj == null ? void 0 : obj[path[i]];
10213 if (prop === void 0) {
10214 prop = fallback;
10215 i = length; // Ensure we don't continue iterating.
10216 }
10217 obj = Object(__WEBPACK_IMPORTED_MODULE_0__isFunction_js__["a" /* default */])(prop) ? prop.call(obj) : prop;
10218 }
10219 return obj;
10220}
10221
10222
10223/***/ }),
10224/* 318 */
10225/***/ (function(module, __webpack_exports__, __webpack_require__) {
10226
10227"use strict";
10228/* harmony export (immutable) */ __webpack_exports__["a"] = uniqueId;
10229// Generate a unique integer id (unique within the entire client session).
10230// Useful for temporary DOM ids.
10231var idCounter = 0;
10232function uniqueId(prefix) {
10233 var id = ++idCounter + '';
10234 return prefix ? prefix + id : id;
10235}
10236
10237
10238/***/ }),
10239/* 319 */
10240/***/ (function(module, __webpack_exports__, __webpack_require__) {
10241
10242"use strict";
10243/* harmony export (immutable) */ __webpack_exports__["a"] = chain;
10244/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(24);
10245
10246
10247// Start chaining a wrapped Underscore object.
10248function chain(obj) {
10249 var instance = Object(__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */])(obj);
10250 instance._chain = true;
10251 return instance;
10252}
10253
10254
10255/***/ }),
10256/* 320 */
10257/***/ (function(module, __webpack_exports__, __webpack_require__) {
10258
10259"use strict";
10260/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(23);
10261/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__flatten_js__ = __webpack_require__(63);
10262/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__bind_js__ = __webpack_require__(198);
10263
10264
10265
10266
10267// Bind a number of an object's methods to that object. Remaining arguments
10268// are the method names to be bound. Useful for ensuring that all callbacks
10269// defined on an object belong to it.
10270/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(obj, keys) {
10271 keys = Object(__WEBPACK_IMPORTED_MODULE_1__flatten_js__["a" /* default */])(keys, false, false);
10272 var index = keys.length;
10273 if (index < 1) throw new Error('bindAll must be passed function names');
10274 while (index--) {
10275 var key = keys[index];
10276 obj[key] = Object(__WEBPACK_IMPORTED_MODULE_2__bind_js__["a" /* default */])(obj[key], obj);
10277 }
10278 return obj;
10279}));
10280
10281
10282/***/ }),
10283/* 321 */
10284/***/ (function(module, __webpack_exports__, __webpack_require__) {
10285
10286"use strict";
10287/* harmony export (immutable) */ __webpack_exports__["a"] = memoize;
10288/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__has_js__ = __webpack_require__(40);
10289
10290
10291// Memoize an expensive function by storing its results.
10292function memoize(func, hasher) {
10293 var memoize = function(key) {
10294 var cache = memoize.cache;
10295 var address = '' + (hasher ? hasher.apply(this, arguments) : key);
10296 if (!Object(__WEBPACK_IMPORTED_MODULE_0__has_js__["a" /* default */])(cache, address)) cache[address] = func.apply(this, arguments);
10297 return cache[address];
10298 };
10299 memoize.cache = {};
10300 return memoize;
10301}
10302
10303
10304/***/ }),
10305/* 322 */
10306/***/ (function(module, __webpack_exports__, __webpack_require__) {
10307
10308"use strict";
10309/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__partial_js__ = __webpack_require__(104);
10310/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__delay_js__ = __webpack_require__(199);
10311/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__underscore_js__ = __webpack_require__(24);
10312
10313
10314
10315
10316// Defers a function, scheduling it to run after the current call stack has
10317// cleared.
10318/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__partial_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__delay_js__["a" /* default */], __WEBPACK_IMPORTED_MODULE_2__underscore_js__["a" /* default */], 1));
10319
10320
10321/***/ }),
10322/* 323 */
10323/***/ (function(module, __webpack_exports__, __webpack_require__) {
10324
10325"use strict";
10326/* harmony export (immutable) */ __webpack_exports__["a"] = throttle;
10327/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__now_js__ = __webpack_require__(137);
10328
10329
10330// Returns a function, that, when invoked, will only be triggered at most once
10331// during a given window of time. Normally, the throttled function will run
10332// as much as it can, without ever going more than once per `wait` duration;
10333// but if you'd like to disable the execution on the leading edge, pass
10334// `{leading: false}`. To disable execution on the trailing edge, ditto.
10335function throttle(func, wait, options) {
10336 var timeout, context, args, result;
10337 var previous = 0;
10338 if (!options) options = {};
10339
10340 var later = function() {
10341 previous = options.leading === false ? 0 : Object(__WEBPACK_IMPORTED_MODULE_0__now_js__["a" /* default */])();
10342 timeout = null;
10343 result = func.apply(context, args);
10344 if (!timeout) context = args = null;
10345 };
10346
10347 var throttled = function() {
10348 var _now = Object(__WEBPACK_IMPORTED_MODULE_0__now_js__["a" /* default */])();
10349 if (!previous && options.leading === false) previous = _now;
10350 var remaining = wait - (_now - previous);
10351 context = this;
10352 args = arguments;
10353 if (remaining <= 0 || remaining > wait) {
10354 if (timeout) {
10355 clearTimeout(timeout);
10356 timeout = null;
10357 }
10358 previous = _now;
10359 result = func.apply(context, args);
10360 if (!timeout) context = args = null;
10361 } else if (!timeout && options.trailing !== false) {
10362 timeout = setTimeout(later, remaining);
10363 }
10364 return result;
10365 };
10366
10367 throttled.cancel = function() {
10368 clearTimeout(timeout);
10369 previous = 0;
10370 timeout = context = args = null;
10371 };
10372
10373 return throttled;
10374}
10375
10376
10377/***/ }),
10378/* 324 */
10379/***/ (function(module, __webpack_exports__, __webpack_require__) {
10380
10381"use strict";
10382/* harmony export (immutable) */ __webpack_exports__["a"] = debounce;
10383/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(23);
10384/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__now_js__ = __webpack_require__(137);
10385
10386
10387
10388// When a sequence of calls of the returned function ends, the argument
10389// function is triggered. The end of a sequence is defined by the `wait`
10390// parameter. If `immediate` is passed, the argument function will be
10391// triggered at the beginning of the sequence instead of at the end.
10392function debounce(func, wait, immediate) {
10393 var timeout, previous, args, result, context;
10394
10395 var later = function() {
10396 var passed = Object(__WEBPACK_IMPORTED_MODULE_1__now_js__["a" /* default */])() - previous;
10397 if (wait > passed) {
10398 timeout = setTimeout(later, wait - passed);
10399 } else {
10400 timeout = null;
10401 if (!immediate) result = func.apply(context, args);
10402 // This check is needed because `func` can recursively invoke `debounced`.
10403 if (!timeout) args = context = null;
10404 }
10405 };
10406
10407 var debounced = Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(_args) {
10408 context = this;
10409 args = _args;
10410 previous = Object(__WEBPACK_IMPORTED_MODULE_1__now_js__["a" /* default */])();
10411 if (!timeout) {
10412 timeout = setTimeout(later, wait);
10413 if (immediate) result = func.apply(context, args);
10414 }
10415 return result;
10416 });
10417
10418 debounced.cancel = function() {
10419 clearTimeout(timeout);
10420 timeout = args = context = null;
10421 };
10422
10423 return debounced;
10424}
10425
10426
10427/***/ }),
10428/* 325 */
10429/***/ (function(module, __webpack_exports__, __webpack_require__) {
10430
10431"use strict";
10432/* harmony export (immutable) */ __webpack_exports__["a"] = wrap;
10433/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__partial_js__ = __webpack_require__(104);
10434
10435
10436// Returns the first function passed as an argument to the second,
10437// allowing you to adjust arguments, run code before and after, and
10438// conditionally execute the original function.
10439function wrap(func, wrapper) {
10440 return Object(__WEBPACK_IMPORTED_MODULE_0__partial_js__["a" /* default */])(wrapper, func);
10441}
10442
10443
10444/***/ }),
10445/* 326 */
10446/***/ (function(module, __webpack_exports__, __webpack_require__) {
10447
10448"use strict";
10449/* harmony export (immutable) */ __webpack_exports__["a"] = compose;
10450// Returns a function that is the composition of a list of functions, each
10451// consuming the return value of the function that follows.
10452function compose() {
10453 var args = arguments;
10454 var start = args.length - 1;
10455 return function() {
10456 var i = start;
10457 var result = args[start].apply(this, arguments);
10458 while (i--) result = args[i].call(this, result);
10459 return result;
10460 };
10461}
10462
10463
10464/***/ }),
10465/* 327 */
10466/***/ (function(module, __webpack_exports__, __webpack_require__) {
10467
10468"use strict";
10469/* harmony export (immutable) */ __webpack_exports__["a"] = after;
10470// Returns a function that will only be executed on and after the Nth call.
10471function after(times, func) {
10472 return function() {
10473 if (--times < 1) {
10474 return func.apply(this, arguments);
10475 }
10476 };
10477}
10478
10479
10480/***/ }),
10481/* 328 */
10482/***/ (function(module, __webpack_exports__, __webpack_require__) {
10483
10484"use strict";
10485/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__partial_js__ = __webpack_require__(104);
10486/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__before_js__ = __webpack_require__(200);
10487
10488
10489
10490// Returns a function that will be executed at most one time, no matter how
10491// often you call it. Useful for lazy initialization.
10492/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__partial_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__before_js__["a" /* default */], 2));
10493
10494
10495/***/ }),
10496/* 329 */
10497/***/ (function(module, __webpack_exports__, __webpack_require__) {
10498
10499"use strict";
10500/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__findLastIndex_js__ = __webpack_require__(203);
10501/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__createIndexFinder_js__ = __webpack_require__(206);
10502
10503
10504
10505// Return the position of the last occurrence of an item in an array,
10506// or -1 if the item is not included in the array.
10507/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_1__createIndexFinder_js__["a" /* default */])(-1, __WEBPACK_IMPORTED_MODULE_0__findLastIndex_js__["a" /* default */]));
10508
10509
10510/***/ }),
10511/* 330 */
10512/***/ (function(module, __webpack_exports__, __webpack_require__) {
10513
10514"use strict";
10515/* harmony export (immutable) */ __webpack_exports__["a"] = findWhere;
10516/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__find_js__ = __webpack_require__(207);
10517/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__matcher_js__ = __webpack_require__(103);
10518
10519
10520
10521// Convenience version of a common use case of `_.find`: getting the first
10522// object containing specific `key:value` pairs.
10523function findWhere(obj, attrs) {
10524 return Object(__WEBPACK_IMPORTED_MODULE_0__find_js__["a" /* default */])(obj, Object(__WEBPACK_IMPORTED_MODULE_1__matcher_js__["a" /* default */])(attrs));
10525}
10526
10527
10528/***/ }),
10529/* 331 */
10530/***/ (function(module, __webpack_exports__, __webpack_require__) {
10531
10532"use strict";
10533/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createReduce_js__ = __webpack_require__(208);
10534
10535
10536// **Reduce** builds up a single result from a list of values, aka `inject`,
10537// or `foldl`.
10538/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createReduce_js__["a" /* default */])(1));
10539
10540
10541/***/ }),
10542/* 332 */
10543/***/ (function(module, __webpack_exports__, __webpack_require__) {
10544
10545"use strict";
10546/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createReduce_js__ = __webpack_require__(208);
10547
10548
10549// The right-associative version of reduce, also known as `foldr`.
10550/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createReduce_js__["a" /* default */])(-1));
10551
10552
10553/***/ }),
10554/* 333 */
10555/***/ (function(module, __webpack_exports__, __webpack_require__) {
10556
10557"use strict";
10558/* harmony export (immutable) */ __webpack_exports__["a"] = reject;
10559/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__filter_js__ = __webpack_require__(83);
10560/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__negate_js__ = __webpack_require__(138);
10561/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__cb_js__ = __webpack_require__(20);
10562
10563
10564
10565
10566// Return all the elements for which a truth test fails.
10567function reject(obj, predicate, context) {
10568 return Object(__WEBPACK_IMPORTED_MODULE_0__filter_js__["a" /* default */])(obj, Object(__WEBPACK_IMPORTED_MODULE_1__negate_js__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_2__cb_js__["a" /* default */])(predicate)), context);
10569}
10570
10571
10572/***/ }),
10573/* 334 */
10574/***/ (function(module, __webpack_exports__, __webpack_require__) {
10575
10576"use strict";
10577/* harmony export (immutable) */ __webpack_exports__["a"] = every;
10578/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(20);
10579/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__ = __webpack_require__(25);
10580/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__keys_js__ = __webpack_require__(15);
10581
10582
10583
10584
10585// Determine whether all of the elements pass a truth test.
10586function every(obj, predicate, context) {
10587 predicate = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(predicate, context);
10588 var _keys = !Object(__WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__["a" /* default */])(obj) && Object(__WEBPACK_IMPORTED_MODULE_2__keys_js__["a" /* default */])(obj),
10589 length = (_keys || obj).length;
10590 for (var index = 0; index < length; index++) {
10591 var currentKey = _keys ? _keys[index] : index;
10592 if (!predicate(obj[currentKey], currentKey, obj)) return false;
10593 }
10594 return true;
10595}
10596
10597
10598/***/ }),
10599/* 335 */
10600/***/ (function(module, __webpack_exports__, __webpack_require__) {
10601
10602"use strict";
10603/* harmony export (immutable) */ __webpack_exports__["a"] = some;
10604/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(20);
10605/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__ = __webpack_require__(25);
10606/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__keys_js__ = __webpack_require__(15);
10607
10608
10609
10610
10611// Determine if at least one element in the object passes a truth test.
10612function some(obj, predicate, context) {
10613 predicate = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(predicate, context);
10614 var _keys = !Object(__WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__["a" /* default */])(obj) && Object(__WEBPACK_IMPORTED_MODULE_2__keys_js__["a" /* default */])(obj),
10615 length = (_keys || obj).length;
10616 for (var index = 0; index < length; index++) {
10617 var currentKey = _keys ? _keys[index] : index;
10618 if (predicate(obj[currentKey], currentKey, obj)) return true;
10619 }
10620 return false;
10621}
10622
10623
10624/***/ }),
10625/* 336 */
10626/***/ (function(module, __webpack_exports__, __webpack_require__) {
10627
10628"use strict";
10629/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(23);
10630/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(27);
10631/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__map_js__ = __webpack_require__(64);
10632/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__deepGet_js__ = __webpack_require__(134);
10633/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__toPath_js__ = __webpack_require__(81);
10634
10635
10636
10637
10638
10639
10640// Invoke a method (with arguments) on every item in a collection.
10641/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(obj, path, args) {
10642 var contextPath, func;
10643 if (Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(path)) {
10644 func = path;
10645 } else {
10646 path = Object(__WEBPACK_IMPORTED_MODULE_4__toPath_js__["a" /* default */])(path);
10647 contextPath = path.slice(0, -1);
10648 path = path[path.length - 1];
10649 }
10650 return Object(__WEBPACK_IMPORTED_MODULE_2__map_js__["a" /* default */])(obj, function(context) {
10651 var method = func;
10652 if (!method) {
10653 if (contextPath && contextPath.length) {
10654 context = Object(__WEBPACK_IMPORTED_MODULE_3__deepGet_js__["a" /* default */])(context, contextPath);
10655 }
10656 if (context == null) return void 0;
10657 method = context[path];
10658 }
10659 return method == null ? method : method.apply(context, args);
10660 });
10661}));
10662
10663
10664/***/ }),
10665/* 337 */
10666/***/ (function(module, __webpack_exports__, __webpack_require__) {
10667
10668"use strict";
10669/* harmony export (immutable) */ __webpack_exports__["a"] = where;
10670/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__filter_js__ = __webpack_require__(83);
10671/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__matcher_js__ = __webpack_require__(103);
10672
10673
10674
10675// Convenience version of a common use case of `_.filter`: selecting only
10676// objects containing specific `key:value` pairs.
10677function where(obj, attrs) {
10678 return Object(__WEBPACK_IMPORTED_MODULE_0__filter_js__["a" /* default */])(obj, Object(__WEBPACK_IMPORTED_MODULE_1__matcher_js__["a" /* default */])(attrs));
10679}
10680
10681
10682/***/ }),
10683/* 338 */
10684/***/ (function(module, __webpack_exports__, __webpack_require__) {
10685
10686"use strict";
10687/* harmony export (immutable) */ __webpack_exports__["a"] = min;
10688/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(25);
10689/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__values_js__ = __webpack_require__(62);
10690/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__cb_js__ = __webpack_require__(20);
10691/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__each_js__ = __webpack_require__(54);
10692
10693
10694
10695
10696
10697// Return the minimum element (or element-based computation).
10698function min(obj, iteratee, context) {
10699 var result = Infinity, lastComputed = Infinity,
10700 value, computed;
10701 if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) {
10702 obj = Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" /* default */])(obj) ? obj : Object(__WEBPACK_IMPORTED_MODULE_1__values_js__["a" /* default */])(obj);
10703 for (var i = 0, length = obj.length; i < length; i++) {
10704 value = obj[i];
10705 if (value != null && value < result) {
10706 result = value;
10707 }
10708 }
10709 } else {
10710 iteratee = Object(__WEBPACK_IMPORTED_MODULE_2__cb_js__["a" /* default */])(iteratee, context);
10711 Object(__WEBPACK_IMPORTED_MODULE_3__each_js__["a" /* default */])(obj, function(v, index, list) {
10712 computed = iteratee(v, index, list);
10713 if (computed < lastComputed || computed === Infinity && result === Infinity) {
10714 result = v;
10715 lastComputed = computed;
10716 }
10717 });
10718 }
10719 return result;
10720}
10721
10722
10723/***/ }),
10724/* 339 */
10725/***/ (function(module, __webpack_exports__, __webpack_require__) {
10726
10727"use strict";
10728/* harmony export (immutable) */ __webpack_exports__["a"] = shuffle;
10729/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__sample_js__ = __webpack_require__(210);
10730
10731
10732// Shuffle a collection.
10733function shuffle(obj) {
10734 return Object(__WEBPACK_IMPORTED_MODULE_0__sample_js__["a" /* default */])(obj, Infinity);
10735}
10736
10737
10738/***/ }),
10739/* 340 */
10740/***/ (function(module, __webpack_exports__, __webpack_require__) {
10741
10742"use strict";
10743/* harmony export (immutable) */ __webpack_exports__["a"] = sortBy;
10744/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(20);
10745/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__pluck_js__ = __webpack_require__(140);
10746/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__map_js__ = __webpack_require__(64);
10747
10748
10749
10750
10751// Sort the object's values by a criterion produced by an iteratee.
10752function sortBy(obj, iteratee, context) {
10753 var index = 0;
10754 iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(iteratee, context);
10755 return Object(__WEBPACK_IMPORTED_MODULE_1__pluck_js__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_2__map_js__["a" /* default */])(obj, function(value, key, list) {
10756 return {
10757 value: value,
10758 index: index++,
10759 criteria: iteratee(value, key, list)
10760 };
10761 }).sort(function(left, right) {
10762 var a = left.criteria;
10763 var b = right.criteria;
10764 if (a !== b) {
10765 if (a > b || a === void 0) return 1;
10766 if (a < b || b === void 0) return -1;
10767 }
10768 return left.index - right.index;
10769 }), 'value');
10770}
10771
10772
10773/***/ }),
10774/* 341 */
10775/***/ (function(module, __webpack_exports__, __webpack_require__) {
10776
10777"use strict";
10778/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__group_js__ = __webpack_require__(105);
10779/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__has_js__ = __webpack_require__(40);
10780
10781
10782
10783// Groups the object's values by a criterion. Pass either a string attribute
10784// to group by, or a function that returns the criterion.
10785/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__group_js__["a" /* default */])(function(result, value, key) {
10786 if (Object(__WEBPACK_IMPORTED_MODULE_1__has_js__["a" /* default */])(result, key)) result[key].push(value); else result[key] = [value];
10787}));
10788
10789
10790/***/ }),
10791/* 342 */
10792/***/ (function(module, __webpack_exports__, __webpack_require__) {
10793
10794"use strict";
10795/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__group_js__ = __webpack_require__(105);
10796
10797
10798// Indexes the object's values by a criterion, similar to `_.groupBy`, but for
10799// when you know that your index values will be unique.
10800/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__group_js__["a" /* default */])(function(result, value, key) {
10801 result[key] = value;
10802}));
10803
10804
10805/***/ }),
10806/* 343 */
10807/***/ (function(module, __webpack_exports__, __webpack_require__) {
10808
10809"use strict";
10810/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__group_js__ = __webpack_require__(105);
10811/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__has_js__ = __webpack_require__(40);
10812
10813
10814
10815// Counts instances of an object that group by a certain criterion. Pass
10816// either a string attribute to count by, or a function that returns the
10817// criterion.
10818/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__group_js__["a" /* default */])(function(result, value, key) {
10819 if (Object(__WEBPACK_IMPORTED_MODULE_1__has_js__["a" /* default */])(result, key)) result[key]++; else result[key] = 1;
10820}));
10821
10822
10823/***/ }),
10824/* 344 */
10825/***/ (function(module, __webpack_exports__, __webpack_require__) {
10826
10827"use strict";
10828/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__group_js__ = __webpack_require__(105);
10829
10830
10831// Split a collection into two arrays: one whose elements all pass the given
10832// truth test, and one whose elements all do not pass the truth test.
10833/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__group_js__["a" /* default */])(function(result, value, pass) {
10834 result[pass ? 0 : 1].push(value);
10835}, true));
10836
10837
10838/***/ }),
10839/* 345 */
10840/***/ (function(module, __webpack_exports__, __webpack_require__) {
10841
10842"use strict";
10843/* harmony export (immutable) */ __webpack_exports__["a"] = toArray;
10844/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArray_js__ = __webpack_require__(53);
10845/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(5);
10846/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isString_js__ = __webpack_require__(127);
10847/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isArrayLike_js__ = __webpack_require__(25);
10848/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__map_js__ = __webpack_require__(64);
10849/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__identity_js__ = __webpack_require__(135);
10850/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__values_js__ = __webpack_require__(62);
10851
10852
10853
10854
10855
10856
10857
10858
10859// Safely create a real, live array from anything iterable.
10860var reStrSymbol = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;
10861function toArray(obj) {
10862 if (!obj) return [];
10863 if (Object(__WEBPACK_IMPORTED_MODULE_0__isArray_js__["a" /* default */])(obj)) return __WEBPACK_IMPORTED_MODULE_1__setup_js__["q" /* slice */].call(obj);
10864 if (Object(__WEBPACK_IMPORTED_MODULE_2__isString_js__["a" /* default */])(obj)) {
10865 // Keep surrogate pair characters together.
10866 return obj.match(reStrSymbol);
10867 }
10868 if (Object(__WEBPACK_IMPORTED_MODULE_3__isArrayLike_js__["a" /* default */])(obj)) return Object(__WEBPACK_IMPORTED_MODULE_4__map_js__["a" /* default */])(obj, __WEBPACK_IMPORTED_MODULE_5__identity_js__["a" /* default */]);
10869 return Object(__WEBPACK_IMPORTED_MODULE_6__values_js__["a" /* default */])(obj);
10870}
10871
10872
10873/***/ }),
10874/* 346 */
10875/***/ (function(module, __webpack_exports__, __webpack_require__) {
10876
10877"use strict";
10878/* harmony export (immutable) */ __webpack_exports__["a"] = size;
10879/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(25);
10880/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__keys_js__ = __webpack_require__(15);
10881
10882
10883
10884// Return the number of elements in a collection.
10885function size(obj) {
10886 if (obj == null) return 0;
10887 return Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" /* default */])(obj) ? obj.length : Object(__WEBPACK_IMPORTED_MODULE_1__keys_js__["a" /* default */])(obj).length;
10888}
10889
10890
10891/***/ }),
10892/* 347 */
10893/***/ (function(module, __webpack_exports__, __webpack_require__) {
10894
10895"use strict";
10896/* harmony export (immutable) */ __webpack_exports__["a"] = keyInObj;
10897// Internal `_.pick` helper function to determine whether `key` is an enumerable
10898// property name of `obj`.
10899function keyInObj(value, key, obj) {
10900 return key in obj;
10901}
10902
10903
10904/***/ }),
10905/* 348 */
10906/***/ (function(module, __webpack_exports__, __webpack_require__) {
10907
10908"use strict";
10909/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(23);
10910/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(27);
10911/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__negate_js__ = __webpack_require__(138);
10912/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__map_js__ = __webpack_require__(64);
10913/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__flatten_js__ = __webpack_require__(63);
10914/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__contains_js__ = __webpack_require__(84);
10915/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__pick_js__ = __webpack_require__(211);
10916
10917
10918
10919
10920
10921
10922
10923
10924// Return a copy of the object without the disallowed properties.
10925/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(obj, keys) {
10926 var iteratee = keys[0], context;
10927 if (Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(iteratee)) {
10928 iteratee = Object(__WEBPACK_IMPORTED_MODULE_2__negate_js__["a" /* default */])(iteratee);
10929 if (keys.length > 1) context = keys[1];
10930 } else {
10931 keys = Object(__WEBPACK_IMPORTED_MODULE_3__map_js__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_4__flatten_js__["a" /* default */])(keys, false, false), String);
10932 iteratee = function(value, key) {
10933 return !Object(__WEBPACK_IMPORTED_MODULE_5__contains_js__["a" /* default */])(keys, key);
10934 };
10935 }
10936 return Object(__WEBPACK_IMPORTED_MODULE_6__pick_js__["a" /* default */])(obj, iteratee, context);
10937}));
10938
10939
10940/***/ }),
10941/* 349 */
10942/***/ (function(module, __webpack_exports__, __webpack_require__) {
10943
10944"use strict";
10945/* harmony export (immutable) */ __webpack_exports__["a"] = first;
10946/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__initial_js__ = __webpack_require__(212);
10947
10948
10949// Get the first element of an array. Passing **n** will return the first N
10950// values in the array. The **guard** check allows it to work with `_.map`.
10951function first(array, n, guard) {
10952 if (array == null || array.length < 1) return n == null || guard ? void 0 : [];
10953 if (n == null || guard) return array[0];
10954 return Object(__WEBPACK_IMPORTED_MODULE_0__initial_js__["a" /* default */])(array, array.length - n);
10955}
10956
10957
10958/***/ }),
10959/* 350 */
10960/***/ (function(module, __webpack_exports__, __webpack_require__) {
10961
10962"use strict";
10963/* harmony export (immutable) */ __webpack_exports__["a"] = last;
10964/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__rest_js__ = __webpack_require__(213);
10965
10966
10967// Get the last element of an array. Passing **n** will return the last N
10968// values in the array.
10969function last(array, n, guard) {
10970 if (array == null || array.length < 1) return n == null || guard ? void 0 : [];
10971 if (n == null || guard) return array[array.length - 1];
10972 return Object(__WEBPACK_IMPORTED_MODULE_0__rest_js__["a" /* default */])(array, Math.max(0, array.length - n));
10973}
10974
10975
10976/***/ }),
10977/* 351 */
10978/***/ (function(module, __webpack_exports__, __webpack_require__) {
10979
10980"use strict";
10981/* harmony export (immutable) */ __webpack_exports__["a"] = compact;
10982/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__filter_js__ = __webpack_require__(83);
10983
10984
10985// Trim out all falsy values from an array.
10986function compact(array) {
10987 return Object(__WEBPACK_IMPORTED_MODULE_0__filter_js__["a" /* default */])(array, Boolean);
10988}
10989
10990
10991/***/ }),
10992/* 352 */
10993/***/ (function(module, __webpack_exports__, __webpack_require__) {
10994
10995"use strict";
10996/* harmony export (immutable) */ __webpack_exports__["a"] = flatten;
10997/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__flatten_js__ = __webpack_require__(63);
10998
10999
11000// Flatten out an array, either recursively (by default), or up to `depth`.
11001// Passing `true` or `false` as `depth` means `1` or `Infinity`, respectively.
11002function flatten(array, depth) {
11003 return Object(__WEBPACK_IMPORTED_MODULE_0__flatten_js__["a" /* default */])(array, depth, false);
11004}
11005
11006
11007/***/ }),
11008/* 353 */
11009/***/ (function(module, __webpack_exports__, __webpack_require__) {
11010
11011"use strict";
11012/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(23);
11013/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__difference_js__ = __webpack_require__(214);
11014
11015
11016
11017// Return a version of the array that does not contain the specified value(s).
11018/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(array, otherArrays) {
11019 return Object(__WEBPACK_IMPORTED_MODULE_1__difference_js__["a" /* default */])(array, otherArrays);
11020}));
11021
11022
11023/***/ }),
11024/* 354 */
11025/***/ (function(module, __webpack_exports__, __webpack_require__) {
11026
11027"use strict";
11028/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(23);
11029/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__uniq_js__ = __webpack_require__(215);
11030/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__flatten_js__ = __webpack_require__(63);
11031
11032
11033
11034
11035// Produce an array that contains the union: each distinct element from all of
11036// the passed-in arrays.
11037/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(arrays) {
11038 return Object(__WEBPACK_IMPORTED_MODULE_1__uniq_js__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_2__flatten_js__["a" /* default */])(arrays, true, true));
11039}));
11040
11041
11042/***/ }),
11043/* 355 */
11044/***/ (function(module, __webpack_exports__, __webpack_require__) {
11045
11046"use strict";
11047/* harmony export (immutable) */ __webpack_exports__["a"] = intersection;
11048/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(28);
11049/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__contains_js__ = __webpack_require__(84);
11050
11051
11052
11053// Produce an array that contains every item shared between all the
11054// passed-in arrays.
11055function intersection(array) {
11056 var result = [];
11057 var argsLength = arguments.length;
11058 for (var i = 0, length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(array); i < length; i++) {
11059 var item = array[i];
11060 if (Object(__WEBPACK_IMPORTED_MODULE_1__contains_js__["a" /* default */])(result, item)) continue;
11061 var j;
11062 for (j = 1; j < argsLength; j++) {
11063 if (!Object(__WEBPACK_IMPORTED_MODULE_1__contains_js__["a" /* default */])(arguments[j], item)) break;
11064 }
11065 if (j === argsLength) result.push(item);
11066 }
11067 return result;
11068}
11069
11070
11071/***/ }),
11072/* 356 */
11073/***/ (function(module, __webpack_exports__, __webpack_require__) {
11074
11075"use strict";
11076/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(23);
11077/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__unzip_js__ = __webpack_require__(216);
11078
11079
11080
11081// Zip together multiple lists into a single array -- elements that share
11082// an index go together.
11083/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__unzip_js__["a" /* default */]));
11084
11085
11086/***/ }),
11087/* 357 */
11088/***/ (function(module, __webpack_exports__, __webpack_require__) {
11089
11090"use strict";
11091/* harmony export (immutable) */ __webpack_exports__["a"] = object;
11092/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(28);
11093
11094
11095// Converts lists into objects. Pass either a single array of `[key, value]`
11096// pairs, or two parallel arrays of the same length -- one of keys, and one of
11097// the corresponding values. Passing by pairs is the reverse of `_.pairs`.
11098function object(list, values) {
11099 var result = {};
11100 for (var i = 0, length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(list); i < length; i++) {
11101 if (values) {
11102 result[list[i]] = values[i];
11103 } else {
11104 result[list[i][0]] = list[i][1];
11105 }
11106 }
11107 return result;
11108}
11109
11110
11111/***/ }),
11112/* 358 */
11113/***/ (function(module, __webpack_exports__, __webpack_require__) {
11114
11115"use strict";
11116/* harmony export (immutable) */ __webpack_exports__["a"] = range;
11117// Generate an integer Array containing an arithmetic progression. A port of
11118// the native Python `range()` function. See
11119// [the Python documentation](https://docs.python.org/library/functions.html#range).
11120function range(start, stop, step) {
11121 if (stop == null) {
11122 stop = start || 0;
11123 start = 0;
11124 }
11125 if (!step) {
11126 step = stop < start ? -1 : 1;
11127 }
11128
11129 var length = Math.max(Math.ceil((stop - start) / step), 0);
11130 var range = Array(length);
11131
11132 for (var idx = 0; idx < length; idx++, start += step) {
11133 range[idx] = start;
11134 }
11135
11136 return range;
11137}
11138
11139
11140/***/ }),
11141/* 359 */
11142/***/ (function(module, __webpack_exports__, __webpack_require__) {
11143
11144"use strict";
11145/* harmony export (immutable) */ __webpack_exports__["a"] = chunk;
11146/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
11147
11148
11149// Chunk a single array into multiple arrays, each containing `count` or fewer
11150// items.
11151function chunk(array, count) {
11152 if (count == null || count < 1) return [];
11153 var result = [];
11154 var i = 0, length = array.length;
11155 while (i < length) {
11156 result.push(__WEBPACK_IMPORTED_MODULE_0__setup_js__["q" /* slice */].call(array, i, i += count));
11157 }
11158 return result;
11159}
11160
11161
11162/***/ }),
11163/* 360 */
11164/***/ (function(module, __webpack_exports__, __webpack_require__) {
11165
11166"use strict";
11167/* harmony export (immutable) */ __webpack_exports__["a"] = mixin;
11168/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(24);
11169/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__each_js__ = __webpack_require__(54);
11170/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__functions_js__ = __webpack_require__(183);
11171/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__setup_js__ = __webpack_require__(5);
11172/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__chainResult_js__ = __webpack_require__(217);
11173
11174
11175
11176
11177
11178
11179// Add your own custom functions to the Underscore object.
11180function mixin(obj) {
11181 Object(__WEBPACK_IMPORTED_MODULE_1__each_js__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_2__functions_js__["a" /* default */])(obj), function(name) {
11182 var func = __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */][name] = obj[name];
11183 __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].prototype[name] = function() {
11184 var args = [this._wrapped];
11185 __WEBPACK_IMPORTED_MODULE_3__setup_js__["o" /* push */].apply(args, arguments);
11186 return Object(__WEBPACK_IMPORTED_MODULE_4__chainResult_js__["a" /* default */])(this, func.apply(__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */], args));
11187 };
11188 });
11189 return __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */];
11190}
11191
11192
11193/***/ }),
11194/* 361 */
11195/***/ (function(module, __webpack_exports__, __webpack_require__) {
11196
11197"use strict";
11198/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(24);
11199/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__each_js__ = __webpack_require__(54);
11200/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__setup_js__ = __webpack_require__(5);
11201/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__chainResult_js__ = __webpack_require__(217);
11202
11203
11204
11205
11206
11207// Add all mutator `Array` functions to the wrapper.
11208Object(__WEBPACK_IMPORTED_MODULE_1__each_js__["a" /* default */])(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
11209 var method = __WEBPACK_IMPORTED_MODULE_2__setup_js__["a" /* ArrayProto */][name];
11210 __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].prototype[name] = function() {
11211 var obj = this._wrapped;
11212 if (obj != null) {
11213 method.apply(obj, arguments);
11214 if ((name === 'shift' || name === 'splice') && obj.length === 0) {
11215 delete obj[0];
11216 }
11217 }
11218 return Object(__WEBPACK_IMPORTED_MODULE_3__chainResult_js__["a" /* default */])(this, obj);
11219 };
11220});
11221
11222// Add all accessor `Array` functions to the wrapper.
11223Object(__WEBPACK_IMPORTED_MODULE_1__each_js__["a" /* default */])(['concat', 'join', 'slice'], function(name) {
11224 var method = __WEBPACK_IMPORTED_MODULE_2__setup_js__["a" /* ArrayProto */][name];
11225 __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].prototype[name] = function() {
11226 var obj = this._wrapped;
11227 if (obj != null) obj = method.apply(obj, arguments);
11228 return Object(__WEBPACK_IMPORTED_MODULE_3__chainResult_js__["a" /* default */])(this, obj);
11229 };
11230});
11231
11232/* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */]);
11233
11234
11235/***/ }),
11236/* 362 */
11237/***/ (function(module, exports, __webpack_require__) {
11238
11239var parent = __webpack_require__(363);
11240
11241module.exports = parent;
11242
11243
11244/***/ }),
11245/* 363 */
11246/***/ (function(module, exports, __webpack_require__) {
11247
11248var isPrototypeOf = __webpack_require__(21);
11249var method = __webpack_require__(364);
11250
11251var ArrayPrototype = Array.prototype;
11252
11253module.exports = function (it) {
11254 var own = it.concat;
11255 return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.concat) ? method : own;
11256};
11257
11258
11259/***/ }),
11260/* 364 */
11261/***/ (function(module, exports, __webpack_require__) {
11262
11263__webpack_require__(218);
11264var entryVirtual = __webpack_require__(41);
11265
11266module.exports = entryVirtual('Array').concat;
11267
11268
11269/***/ }),
11270/* 365 */
11271/***/ (function(module, exports) {
11272
11273var $TypeError = TypeError;
11274var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; // 2 ** 53 - 1 == 9007199254740991
11275
11276module.exports = function (it) {
11277 if (it > MAX_SAFE_INTEGER) throw $TypeError('Maximum allowed index exceeded');
11278 return it;
11279};
11280
11281
11282/***/ }),
11283/* 366 */
11284/***/ (function(module, exports, __webpack_require__) {
11285
11286var isArray = __webpack_require__(85);
11287var isConstructor = __webpack_require__(101);
11288var isObject = __webpack_require__(11);
11289var wellKnownSymbol = __webpack_require__(9);
11290
11291var SPECIES = wellKnownSymbol('species');
11292var $Array = Array;
11293
11294// a part of `ArraySpeciesCreate` abstract operation
11295// https://tc39.es/ecma262/#sec-arrayspeciescreate
11296module.exports = function (originalArray) {
11297 var C;
11298 if (isArray(originalArray)) {
11299 C = originalArray.constructor;
11300 // cross-realm fallback
11301 if (isConstructor(C) && (C === $Array || isArray(C.prototype))) C = undefined;
11302 else if (isObject(C)) {
11303 C = C[SPECIES];
11304 if (C === null) C = undefined;
11305 }
11306 } return C === undefined ? $Array : C;
11307};
11308
11309
11310/***/ }),
11311/* 367 */
11312/***/ (function(module, exports, __webpack_require__) {
11313
11314var parent = __webpack_require__(368);
11315
11316module.exports = parent;
11317
11318
11319/***/ }),
11320/* 368 */
11321/***/ (function(module, exports, __webpack_require__) {
11322
11323var isPrototypeOf = __webpack_require__(21);
11324var method = __webpack_require__(369);
11325
11326var ArrayPrototype = Array.prototype;
11327
11328module.exports = function (it) {
11329 var own = it.map;
11330 return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.map) ? method : own;
11331};
11332
11333
11334/***/ }),
11335/* 369 */
11336/***/ (function(module, exports, __webpack_require__) {
11337
11338__webpack_require__(370);
11339var entryVirtual = __webpack_require__(41);
11340
11341module.exports = entryVirtual('Array').map;
11342
11343
11344/***/ }),
11345/* 370 */
11346/***/ (function(module, exports, __webpack_require__) {
11347
11348"use strict";
11349
11350var $ = __webpack_require__(0);
11351var $map = __webpack_require__(66).map;
11352var arrayMethodHasSpeciesSupport = __webpack_require__(107);
11353
11354var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map');
11355
11356// `Array.prototype.map` method
11357// https://tc39.es/ecma262/#sec-array.prototype.map
11358// with adding support of @@species
11359$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
11360 map: function map(callbackfn /* , thisArg */) {
11361 return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
11362 }
11363});
11364
11365
11366/***/ }),
11367/* 371 */
11368/***/ (function(module, exports, __webpack_require__) {
11369
11370var parent = __webpack_require__(372);
11371
11372module.exports = parent;
11373
11374
11375/***/ }),
11376/* 372 */
11377/***/ (function(module, exports, __webpack_require__) {
11378
11379__webpack_require__(373);
11380var path = __webpack_require__(10);
11381
11382module.exports = path.Object.keys;
11383
11384
11385/***/ }),
11386/* 373 */
11387/***/ (function(module, exports, __webpack_require__) {
11388
11389var $ = __webpack_require__(0);
11390var toObject = __webpack_require__(34);
11391var nativeKeys = __webpack_require__(98);
11392var fails = __webpack_require__(3);
11393
11394var FAILS_ON_PRIMITIVES = fails(function () { nativeKeys(1); });
11395
11396// `Object.keys` method
11397// https://tc39.es/ecma262/#sec-object.keys
11398$({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
11399 keys: function keys(it) {
11400 return nativeKeys(toObject(it));
11401 }
11402});
11403
11404
11405/***/ }),
11406/* 374 */
11407/***/ (function(module, exports, __webpack_require__) {
11408
11409var parent = __webpack_require__(375);
11410
11411module.exports = parent;
11412
11413
11414/***/ }),
11415/* 375 */
11416/***/ (function(module, exports, __webpack_require__) {
11417
11418__webpack_require__(220);
11419var path = __webpack_require__(10);
11420var apply = __webpack_require__(69);
11421
11422// eslint-disable-next-line es-x/no-json -- safe
11423if (!path.JSON) path.JSON = { stringify: JSON.stringify };
11424
11425// eslint-disable-next-line no-unused-vars -- required for `.length`
11426module.exports = function stringify(it, replacer, space) {
11427 return apply(path.JSON.stringify, null, arguments);
11428};
11429
11430
11431/***/ }),
11432/* 376 */
11433/***/ (function(module, exports, __webpack_require__) {
11434
11435var parent = __webpack_require__(377);
11436
11437module.exports = parent;
11438
11439
11440/***/ }),
11441/* 377 */
11442/***/ (function(module, exports, __webpack_require__) {
11443
11444var isPrototypeOf = __webpack_require__(21);
11445var method = __webpack_require__(378);
11446
11447var ArrayPrototype = Array.prototype;
11448
11449module.exports = function (it) {
11450 var own = it.indexOf;
11451 return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.indexOf) ? method : own;
11452};
11453
11454
11455/***/ }),
11456/* 378 */
11457/***/ (function(module, exports, __webpack_require__) {
11458
11459__webpack_require__(379);
11460var entryVirtual = __webpack_require__(41);
11461
11462module.exports = entryVirtual('Array').indexOf;
11463
11464
11465/***/ }),
11466/* 379 */
11467/***/ (function(module, exports, __webpack_require__) {
11468
11469"use strict";
11470
11471/* eslint-disable es-x/no-array-prototype-indexof -- required for testing */
11472var $ = __webpack_require__(0);
11473var uncurryThis = __webpack_require__(4);
11474var $IndexOf = __webpack_require__(153).indexOf;
11475var arrayMethodIsStrict = __webpack_require__(380);
11476
11477var un$IndexOf = uncurryThis([].indexOf);
11478
11479var NEGATIVE_ZERO = !!un$IndexOf && 1 / un$IndexOf([1], 1, -0) < 0;
11480var STRICT_METHOD = arrayMethodIsStrict('indexOf');
11481
11482// `Array.prototype.indexOf` method
11483// https://tc39.es/ecma262/#sec-array.prototype.indexof
11484$({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD }, {
11485 indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
11486 var fromIndex = arguments.length > 1 ? arguments[1] : undefined;
11487 return NEGATIVE_ZERO
11488 // convert -0 to +0
11489 ? un$IndexOf(this, searchElement, fromIndex) || 0
11490 : $IndexOf(this, searchElement, fromIndex);
11491 }
11492});
11493
11494
11495/***/ }),
11496/* 380 */
11497/***/ (function(module, exports, __webpack_require__) {
11498
11499"use strict";
11500
11501var fails = __webpack_require__(3);
11502
11503module.exports = function (METHOD_NAME, argument) {
11504 var method = [][METHOD_NAME];
11505 return !!method && fails(function () {
11506 // eslint-disable-next-line no-useless-call -- required for testing
11507 method.call(null, argument || function () { return 1; }, 1);
11508 });
11509};
11510
11511
11512/***/ }),
11513/* 381 */
11514/***/ (function(module, exports, __webpack_require__) {
11515
11516__webpack_require__(51);
11517var classof = __webpack_require__(59);
11518var hasOwn = __webpack_require__(14);
11519var isPrototypeOf = __webpack_require__(21);
11520var method = __webpack_require__(382);
11521
11522var ArrayPrototype = Array.prototype;
11523
11524var DOMIterables = {
11525 DOMTokenList: true,
11526 NodeList: true
11527};
11528
11529module.exports = function (it) {
11530 var own = it.keys;
11531 return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.keys)
11532 || hasOwn(DOMIterables, classof(it)) ? method : own;
11533};
11534
11535
11536/***/ }),
11537/* 382 */
11538/***/ (function(module, exports, __webpack_require__) {
11539
11540var parent = __webpack_require__(383);
11541
11542module.exports = parent;
11543
11544
11545/***/ }),
11546/* 383 */
11547/***/ (function(module, exports, __webpack_require__) {
11548
11549__webpack_require__(48);
11550__webpack_require__(60);
11551var entryVirtual = __webpack_require__(41);
11552
11553module.exports = entryVirtual('Array').keys;
11554
11555
11556/***/ }),
11557/* 384 */
11558/***/ (function(module, exports) {
11559
11560// Unique ID creation requires a high quality random # generator. In the
11561// browser this is a little complicated due to unknown quality of Math.random()
11562// and inconsistent support for the `crypto` API. We do the best we can via
11563// feature-detection
11564
11565// getRandomValues needs to be invoked in a context where "this" is a Crypto
11566// implementation. Also, find the complete implementation of crypto on IE11.
11567var getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||
11568 (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));
11569
11570if (getRandomValues) {
11571 // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto
11572 var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef
11573
11574 module.exports = function whatwgRNG() {
11575 getRandomValues(rnds8);
11576 return rnds8;
11577 };
11578} else {
11579 // Math.random()-based (RNG)
11580 //
11581 // If all else fails, use Math.random(). It's fast, but is of unspecified
11582 // quality.
11583 var rnds = new Array(16);
11584
11585 module.exports = function mathRNG() {
11586 for (var i = 0, r; i < 16; i++) {
11587 if ((i & 0x03) === 0) r = Math.random() * 0x100000000;
11588 rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;
11589 }
11590
11591 return rnds;
11592 };
11593}
11594
11595
11596/***/ }),
11597/* 385 */
11598/***/ (function(module, exports) {
11599
11600/**
11601 * Convert array of 16 byte values to UUID string format of the form:
11602 * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
11603 */
11604var byteToHex = [];
11605for (var i = 0; i < 256; ++i) {
11606 byteToHex[i] = (i + 0x100).toString(16).substr(1);
11607}
11608
11609function bytesToUuid(buf, offset) {
11610 var i = offset || 0;
11611 var bth = byteToHex;
11612 // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
11613 return ([bth[buf[i++]], bth[buf[i++]],
11614 bth[buf[i++]], bth[buf[i++]], '-',
11615 bth[buf[i++]], bth[buf[i++]], '-',
11616 bth[buf[i++]], bth[buf[i++]], '-',
11617 bth[buf[i++]], bth[buf[i++]], '-',
11618 bth[buf[i++]], bth[buf[i++]],
11619 bth[buf[i++]], bth[buf[i++]],
11620 bth[buf[i++]], bth[buf[i++]]]).join('');
11621}
11622
11623module.exports = bytesToUuid;
11624
11625
11626/***/ }),
11627/* 386 */
11628/***/ (function(module, exports, __webpack_require__) {
11629
11630"use strict";
11631
11632
11633/**
11634 * This is the common logic for both the Node.js and web browser
11635 * implementations of `debug()`.
11636 */
11637function setup(env) {
11638 createDebug.debug = createDebug;
11639 createDebug.default = createDebug;
11640 createDebug.coerce = coerce;
11641 createDebug.disable = disable;
11642 createDebug.enable = enable;
11643 createDebug.enabled = enabled;
11644 createDebug.humanize = __webpack_require__(387);
11645 Object.keys(env).forEach(function (key) {
11646 createDebug[key] = env[key];
11647 });
11648 /**
11649 * Active `debug` instances.
11650 */
11651
11652 createDebug.instances = [];
11653 /**
11654 * The currently active debug mode names, and names to skip.
11655 */
11656
11657 createDebug.names = [];
11658 createDebug.skips = [];
11659 /**
11660 * Map of special "%n" handling functions, for the debug "format" argument.
11661 *
11662 * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
11663 */
11664
11665 createDebug.formatters = {};
11666 /**
11667 * Selects a color for a debug namespace
11668 * @param {String} namespace The namespace string for the for the debug instance to be colored
11669 * @return {Number|String} An ANSI color code for the given namespace
11670 * @api private
11671 */
11672
11673 function selectColor(namespace) {
11674 var hash = 0;
11675
11676 for (var i = 0; i < namespace.length; i++) {
11677 hash = (hash << 5) - hash + namespace.charCodeAt(i);
11678 hash |= 0; // Convert to 32bit integer
11679 }
11680
11681 return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
11682 }
11683
11684 createDebug.selectColor = selectColor;
11685 /**
11686 * Create a debugger with the given `namespace`.
11687 *
11688 * @param {String} namespace
11689 * @return {Function}
11690 * @api public
11691 */
11692
11693 function createDebug(namespace) {
11694 var prevTime;
11695
11696 function debug() {
11697 // Disabled?
11698 if (!debug.enabled) {
11699 return;
11700 }
11701
11702 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
11703 args[_key] = arguments[_key];
11704 }
11705
11706 var self = debug; // Set `diff` timestamp
11707
11708 var curr = Number(new Date());
11709 var ms = curr - (prevTime || curr);
11710 self.diff = ms;
11711 self.prev = prevTime;
11712 self.curr = curr;
11713 prevTime = curr;
11714 args[0] = createDebug.coerce(args[0]);
11715
11716 if (typeof args[0] !== 'string') {
11717 // Anything else let's inspect with %O
11718 args.unshift('%O');
11719 } // Apply any `formatters` transformations
11720
11721
11722 var index = 0;
11723 args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) {
11724 // If we encounter an escaped % then don't increase the array index
11725 if (match === '%%') {
11726 return match;
11727 }
11728
11729 index++;
11730 var formatter = createDebug.formatters[format];
11731
11732 if (typeof formatter === 'function') {
11733 var val = args[index];
11734 match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format`
11735
11736 args.splice(index, 1);
11737 index--;
11738 }
11739
11740 return match;
11741 }); // Apply env-specific formatting (colors, etc.)
11742
11743 createDebug.formatArgs.call(self, args);
11744 var logFn = self.log || createDebug.log;
11745 logFn.apply(self, args);
11746 }
11747
11748 debug.namespace = namespace;
11749 debug.enabled = createDebug.enabled(namespace);
11750 debug.useColors = createDebug.useColors();
11751 debug.color = selectColor(namespace);
11752 debug.destroy = destroy;
11753 debug.extend = extend; // Debug.formatArgs = formatArgs;
11754 // debug.rawLog = rawLog;
11755 // env-specific initialization logic for debug instances
11756
11757 if (typeof createDebug.init === 'function') {
11758 createDebug.init(debug);
11759 }
11760
11761 createDebug.instances.push(debug);
11762 return debug;
11763 }
11764
11765 function destroy() {
11766 var index = createDebug.instances.indexOf(this);
11767
11768 if (index !== -1) {
11769 createDebug.instances.splice(index, 1);
11770 return true;
11771 }
11772
11773 return false;
11774 }
11775
11776 function extend(namespace, delimiter) {
11777 return createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
11778 }
11779 /**
11780 * Enables a debug mode by namespaces. This can include modes
11781 * separated by a colon and wildcards.
11782 *
11783 * @param {String} namespaces
11784 * @api public
11785 */
11786
11787
11788 function enable(namespaces) {
11789 createDebug.save(namespaces);
11790 createDebug.names = [];
11791 createDebug.skips = [];
11792 var i;
11793 var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
11794 var len = split.length;
11795
11796 for (i = 0; i < len; i++) {
11797 if (!split[i]) {
11798 // ignore empty strings
11799 continue;
11800 }
11801
11802 namespaces = split[i].replace(/\*/g, '.*?');
11803
11804 if (namespaces[0] === '-') {
11805 createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
11806 } else {
11807 createDebug.names.push(new RegExp('^' + namespaces + '$'));
11808 }
11809 }
11810
11811 for (i = 0; i < createDebug.instances.length; i++) {
11812 var instance = createDebug.instances[i];
11813 instance.enabled = createDebug.enabled(instance.namespace);
11814 }
11815 }
11816 /**
11817 * Disable debug output.
11818 *
11819 * @api public
11820 */
11821
11822
11823 function disable() {
11824 createDebug.enable('');
11825 }
11826 /**
11827 * Returns true if the given mode name is enabled, false otherwise.
11828 *
11829 * @param {String} name
11830 * @return {Boolean}
11831 * @api public
11832 */
11833
11834
11835 function enabled(name) {
11836 if (name[name.length - 1] === '*') {
11837 return true;
11838 }
11839
11840 var i;
11841 var len;
11842
11843 for (i = 0, len = createDebug.skips.length; i < len; i++) {
11844 if (createDebug.skips[i].test(name)) {
11845 return false;
11846 }
11847 }
11848
11849 for (i = 0, len = createDebug.names.length; i < len; i++) {
11850 if (createDebug.names[i].test(name)) {
11851 return true;
11852 }
11853 }
11854
11855 return false;
11856 }
11857 /**
11858 * Coerce `val`.
11859 *
11860 * @param {Mixed} val
11861 * @return {Mixed}
11862 * @api private
11863 */
11864
11865
11866 function coerce(val) {
11867 if (val instanceof Error) {
11868 return val.stack || val.message;
11869 }
11870
11871 return val;
11872 }
11873
11874 createDebug.enable(createDebug.load());
11875 return createDebug;
11876}
11877
11878module.exports = setup;
11879
11880
11881
11882/***/ }),
11883/* 387 */
11884/***/ (function(module, exports) {
11885
11886/**
11887 * Helpers.
11888 */
11889
11890var s = 1000;
11891var m = s * 60;
11892var h = m * 60;
11893var d = h * 24;
11894var w = d * 7;
11895var y = d * 365.25;
11896
11897/**
11898 * Parse or format the given `val`.
11899 *
11900 * Options:
11901 *
11902 * - `long` verbose formatting [false]
11903 *
11904 * @param {String|Number} val
11905 * @param {Object} [options]
11906 * @throws {Error} throw an error if val is not a non-empty string or a number
11907 * @return {String|Number}
11908 * @api public
11909 */
11910
11911module.exports = function(val, options) {
11912 options = options || {};
11913 var type = typeof val;
11914 if (type === 'string' && val.length > 0) {
11915 return parse(val);
11916 } else if (type === 'number' && isFinite(val)) {
11917 return options.long ? fmtLong(val) : fmtShort(val);
11918 }
11919 throw new Error(
11920 'val is not a non-empty string or a valid number. val=' +
11921 JSON.stringify(val)
11922 );
11923};
11924
11925/**
11926 * Parse the given `str` and return milliseconds.
11927 *
11928 * @param {String} str
11929 * @return {Number}
11930 * @api private
11931 */
11932
11933function parse(str) {
11934 str = String(str);
11935 if (str.length > 100) {
11936 return;
11937 }
11938 var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
11939 str
11940 );
11941 if (!match) {
11942 return;
11943 }
11944 var n = parseFloat(match[1]);
11945 var type = (match[2] || 'ms').toLowerCase();
11946 switch (type) {
11947 case 'years':
11948 case 'year':
11949 case 'yrs':
11950 case 'yr':
11951 case 'y':
11952 return n * y;
11953 case 'weeks':
11954 case 'week':
11955 case 'w':
11956 return n * w;
11957 case 'days':
11958 case 'day':
11959 case 'd':
11960 return n * d;
11961 case 'hours':
11962 case 'hour':
11963 case 'hrs':
11964 case 'hr':
11965 case 'h':
11966 return n * h;
11967 case 'minutes':
11968 case 'minute':
11969 case 'mins':
11970 case 'min':
11971 case 'm':
11972 return n * m;
11973 case 'seconds':
11974 case 'second':
11975 case 'secs':
11976 case 'sec':
11977 case 's':
11978 return n * s;
11979 case 'milliseconds':
11980 case 'millisecond':
11981 case 'msecs':
11982 case 'msec':
11983 case 'ms':
11984 return n;
11985 default:
11986 return undefined;
11987 }
11988}
11989
11990/**
11991 * Short format for `ms`.
11992 *
11993 * @param {Number} ms
11994 * @return {String}
11995 * @api private
11996 */
11997
11998function fmtShort(ms) {
11999 var msAbs = Math.abs(ms);
12000 if (msAbs >= d) {
12001 return Math.round(ms / d) + 'd';
12002 }
12003 if (msAbs >= h) {
12004 return Math.round(ms / h) + 'h';
12005 }
12006 if (msAbs >= m) {
12007 return Math.round(ms / m) + 'm';
12008 }
12009 if (msAbs >= s) {
12010 return Math.round(ms / s) + 's';
12011 }
12012 return ms + 'ms';
12013}
12014
12015/**
12016 * Long format for `ms`.
12017 *
12018 * @param {Number} ms
12019 * @return {String}
12020 * @api private
12021 */
12022
12023function fmtLong(ms) {
12024 var msAbs = Math.abs(ms);
12025 if (msAbs >= d) {
12026 return plural(ms, msAbs, d, 'day');
12027 }
12028 if (msAbs >= h) {
12029 return plural(ms, msAbs, h, 'hour');
12030 }
12031 if (msAbs >= m) {
12032 return plural(ms, msAbs, m, 'minute');
12033 }
12034 if (msAbs >= s) {
12035 return plural(ms, msAbs, s, 'second');
12036 }
12037 return ms + ' ms';
12038}
12039
12040/**
12041 * Pluralization helper.
12042 */
12043
12044function plural(ms, msAbs, n, name) {
12045 var isPlural = msAbs >= n * 1.5;
12046 return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
12047}
12048
12049
12050/***/ }),
12051/* 388 */
12052/***/ (function(module, exports, __webpack_require__) {
12053
12054__webpack_require__(389);
12055var path = __webpack_require__(10);
12056
12057module.exports = path.Object.getPrototypeOf;
12058
12059
12060/***/ }),
12061/* 389 */
12062/***/ (function(module, exports, __webpack_require__) {
12063
12064var $ = __webpack_require__(0);
12065var fails = __webpack_require__(3);
12066var toObject = __webpack_require__(34);
12067var nativeGetPrototypeOf = __webpack_require__(93);
12068var CORRECT_PROTOTYPE_GETTER = __webpack_require__(151);
12069
12070var FAILS_ON_PRIMITIVES = fails(function () { nativeGetPrototypeOf(1); });
12071
12072// `Object.getPrototypeOf` method
12073// https://tc39.es/ecma262/#sec-object.getprototypeof
12074$({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !CORRECT_PROTOTYPE_GETTER }, {
12075 getPrototypeOf: function getPrototypeOf(it) {
12076 return nativeGetPrototypeOf(toObject(it));
12077 }
12078});
12079
12080
12081
12082/***/ }),
12083/* 390 */
12084/***/ (function(module, exports, __webpack_require__) {
12085
12086__webpack_require__(391);
12087var path = __webpack_require__(10);
12088
12089module.exports = path.Object.setPrototypeOf;
12090
12091
12092/***/ }),
12093/* 391 */
12094/***/ (function(module, exports, __webpack_require__) {
12095
12096var $ = __webpack_require__(0);
12097var setPrototypeOf = __webpack_require__(95);
12098
12099// `Object.setPrototypeOf` method
12100// https://tc39.es/ecma262/#sec-object.setprototypeof
12101$({ target: 'Object', stat: true }, {
12102 setPrototypeOf: setPrototypeOf
12103});
12104
12105
12106/***/ }),
12107/* 392 */
12108/***/ (function(module, exports, __webpack_require__) {
12109
12110"use strict";
12111
12112
12113var _interopRequireDefault = __webpack_require__(1);
12114
12115var _slice = _interopRequireDefault(__webpack_require__(87));
12116
12117var _concat = _interopRequireDefault(__webpack_require__(30));
12118
12119var _defineProperty = _interopRequireDefault(__webpack_require__(143));
12120
12121var AV = __webpack_require__(65);
12122
12123var AppRouter = __webpack_require__(398);
12124
12125var _require = __webpack_require__(29),
12126 isNullOrUndefined = _require.isNullOrUndefined;
12127
12128var _require2 = __webpack_require__(2),
12129 extend = _require2.extend,
12130 isObject = _require2.isObject,
12131 isEmpty = _require2.isEmpty;
12132
12133var isCNApp = function isCNApp(appId) {
12134 return (0, _slice.default)(appId).call(appId, -9) !== '-MdYXbMMI';
12135};
12136
12137var fillServerURLs = function fillServerURLs(url) {
12138 return {
12139 push: url,
12140 stats: url,
12141 engine: url,
12142 api: url,
12143 rtm: url
12144 };
12145};
12146
12147function getDefaultServerURLs(appId) {
12148 var _context, _context2, _context3, _context4, _context5;
12149
12150 if (isCNApp(appId)) {
12151 return {};
12152 }
12153
12154 var id = (0, _slice.default)(appId).call(appId, 0, 8).toLowerCase();
12155 var domain = 'lncldglobal.com';
12156 return {
12157 push: (0, _concat.default)(_context = "https://".concat(id, ".push.")).call(_context, domain),
12158 stats: (0, _concat.default)(_context2 = "https://".concat(id, ".stats.")).call(_context2, domain),
12159 engine: (0, _concat.default)(_context3 = "https://".concat(id, ".engine.")).call(_context3, domain),
12160 api: (0, _concat.default)(_context4 = "https://".concat(id, ".api.")).call(_context4, domain),
12161 rtm: (0, _concat.default)(_context5 = "https://".concat(id, ".rtm.")).call(_context5, domain)
12162 };
12163}
12164
12165var _disableAppRouter = false;
12166var _initialized = false;
12167/**
12168 * URLs for services
12169 * @typedef {Object} ServerURLs
12170 * @property {String} [api] serverURL for API service
12171 * @property {String} [engine] serverURL for engine service
12172 * @property {String} [stats] serverURL for stats service
12173 * @property {String} [push] serverURL for push service
12174 * @property {String} [rtm] serverURL for LiveQuery service
12175 */
12176
12177/**
12178 * Call this method first to set up your authentication tokens for AV.
12179 * You can get your app keys from the LeanCloud dashboard on http://leancloud.cn .
12180 * @function AV.init
12181 * @param {Object} options
12182 * @param {String} options.appId application id
12183 * @param {String} options.appKey application key
12184 * @param {String} [options.masterKey] application master key
12185 * @param {Boolean} [options.production]
12186 * @param {String|ServerURLs} [options.serverURL] URLs for services. if a string was given, it will be applied for all services.
12187 * @param {Boolean} [options.disableCurrentUser]
12188 */
12189
12190AV.init = function init(options) {
12191 if (!isObject(options)) {
12192 return AV.init({
12193 appId: options,
12194 appKey: arguments.length <= 1 ? undefined : arguments[1],
12195 masterKey: arguments.length <= 2 ? undefined : arguments[2]
12196 });
12197 }
12198
12199 var appId = options.appId,
12200 appKey = options.appKey,
12201 masterKey = options.masterKey,
12202 hookKey = options.hookKey,
12203 serverURL = options.serverURL,
12204 _options$serverURLs = options.serverURLs,
12205 serverURLs = _options$serverURLs === void 0 ? serverURL : _options$serverURLs,
12206 disableCurrentUser = options.disableCurrentUser,
12207 production = options.production,
12208 realtime = options.realtime;
12209 if (_initialized) console.warn('Initializing LeanCloud Storage SDK which has already been initialized. Reinitializing the SDK might cause problems like unexpected cross-app data writing and invalid relations.');
12210 if (!appId) throw new TypeError('appId must be a string');
12211 if (!appKey) throw new TypeError('appKey must be a string');
12212 if ("Weapp" !== 'NODE_JS' && masterKey) console.warn('MasterKey is not supposed to be used at client side.');
12213
12214 if (isCNApp(appId)) {
12215 if (!serverURLs && isEmpty(AV._config.serverURLs)) {
12216 throw new TypeError("serverURL option is required for apps from CN region");
12217 }
12218 }
12219
12220 if (appId !== AV._config.applicationId) {
12221 // overwrite all keys when reinitializing as a new app
12222 AV._config.masterKey = masterKey;
12223 AV._config.hookKey = hookKey;
12224 } else {
12225 if (masterKey) AV._config.masterKey = masterKey;
12226 if (hookKey) AV._config.hookKey = hookKey;
12227 }
12228
12229 AV._config.applicationId = appId;
12230 AV._config.applicationKey = appKey;
12231
12232 if (!isNullOrUndefined(production)) {
12233 AV.setProduction(production);
12234 }
12235
12236 if (typeof disableCurrentUser !== 'undefined') AV._config.disableCurrentUser = disableCurrentUser;
12237 var disableAppRouter = _disableAppRouter || typeof serverURLs !== 'undefined';
12238
12239 if (!disableAppRouter) {
12240 AV._appRouter = new AppRouter(AV);
12241 }
12242
12243 AV._setServerURLs(extend({}, getDefaultServerURLs(appId), AV._config.serverURLs, typeof serverURLs === 'string' ? fillServerURLs(serverURLs) : serverURLs), disableAppRouter);
12244
12245 if (realtime) {
12246 AV._config.realtime = realtime;
12247 } else if (AV._sharedConfig.liveQueryRealtime) {
12248 var _AV$_config$serverURL = AV._config.serverURLs,
12249 api = _AV$_config$serverURL.api,
12250 rtm = _AV$_config$serverURL.rtm;
12251 AV._config.realtime = new AV._sharedConfig.liveQueryRealtime({
12252 appId: appId,
12253 appKey: appKey,
12254 server: {
12255 api: api,
12256 RTMRouter: rtm
12257 }
12258 });
12259 }
12260
12261 _initialized = true;
12262}; // If we're running in node.js, allow using the master key.
12263
12264
12265if (false) {
12266 AV.Cloud = AV.Cloud || {};
12267 /**
12268 * Switches the LeanCloud SDK to using the Master key. The Master key grants
12269 * priveleged access to the data in LeanCloud and can be used to bypass ACLs and
12270 * other restrictions that are applied to the client SDKs.
12271 * <p><strong><em>Available in Cloud Code and Node.js only.</em></strong>
12272 * </p>
12273 */
12274
12275 AV.Cloud.useMasterKey = function () {
12276 AV._config.useMasterKey = true;
12277 };
12278}
12279/**
12280 * Call this method to set production environment variable.
12281 * @function AV.setProduction
12282 * @param {Boolean} production True is production environment,and
12283 * it's true by default.
12284 */
12285
12286
12287AV.setProduction = function (production) {
12288 if (!isNullOrUndefined(production)) {
12289 AV._config.production = production ? 1 : 0;
12290 } else {
12291 // change to default value
12292 AV._config.production = null;
12293 }
12294};
12295
12296AV._setServerURLs = function (urls) {
12297 var disableAppRouter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
12298
12299 if (typeof urls !== 'string') {
12300 extend(AV._config.serverURLs, urls);
12301 } else {
12302 AV._config.serverURLs = fillServerURLs(urls);
12303 }
12304
12305 if (disableAppRouter) {
12306 if (AV._appRouter) {
12307 AV._appRouter.disable();
12308 } else {
12309 _disableAppRouter = true;
12310 }
12311 }
12312};
12313/**
12314 * Set server URLs for services.
12315 * @function AV.setServerURL
12316 * @since 4.3.0
12317 * @param {String|ServerURLs} urls URLs for services. if a string was given, it will be applied for all services.
12318 * You can also set them when initializing SDK with `options.serverURL`
12319 */
12320
12321
12322AV.setServerURL = function (urls) {
12323 return AV._setServerURLs(urls);
12324};
12325
12326AV.setServerURLs = AV.setServerURL;
12327
12328AV.keepErrorRawMessage = function (value) {
12329 AV._sharedConfig.keepErrorRawMessage = value;
12330};
12331/**
12332 * Set a deadline for requests to complete.
12333 * Note that file upload requests are not affected.
12334 * @function AV.setRequestTimeout
12335 * @since 3.6.0
12336 * @param {number} ms
12337 */
12338
12339
12340AV.setRequestTimeout = function (ms) {
12341 AV._config.requestTimeout = ms;
12342}; // backword compatible
12343
12344
12345AV.initialize = AV.init;
12346
12347var defineConfig = function defineConfig(property) {
12348 return (0, _defineProperty.default)(AV, property, {
12349 get: function get() {
12350 return AV._config[property];
12351 },
12352 set: function set(value) {
12353 AV._config[property] = value;
12354 }
12355 });
12356};
12357
12358['applicationId', 'applicationKey', 'masterKey', 'hookKey'].forEach(defineConfig);
12359
12360/***/ }),
12361/* 393 */
12362/***/ (function(module, exports, __webpack_require__) {
12363
12364var isPrototypeOf = __webpack_require__(21);
12365var method = __webpack_require__(394);
12366
12367var ArrayPrototype = Array.prototype;
12368
12369module.exports = function (it) {
12370 var own = it.slice;
12371 return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.slice) ? method : own;
12372};
12373
12374
12375/***/ }),
12376/* 394 */
12377/***/ (function(module, exports, __webpack_require__) {
12378
12379__webpack_require__(395);
12380var entryVirtual = __webpack_require__(41);
12381
12382module.exports = entryVirtual('Array').slice;
12383
12384
12385/***/ }),
12386/* 395 */
12387/***/ (function(module, exports, __webpack_require__) {
12388
12389"use strict";
12390
12391var $ = __webpack_require__(0);
12392var isArray = __webpack_require__(85);
12393var isConstructor = __webpack_require__(101);
12394var isObject = __webpack_require__(11);
12395var toAbsoluteIndex = __webpack_require__(119);
12396var lengthOfArrayLike = __webpack_require__(46);
12397var toIndexedObject = __webpack_require__(33);
12398var createProperty = __webpack_require__(106);
12399var wellKnownSymbol = __webpack_require__(9);
12400var arrayMethodHasSpeciesSupport = __webpack_require__(107);
12401var un$Slice = __webpack_require__(102);
12402
12403var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice');
12404
12405var SPECIES = wellKnownSymbol('species');
12406var $Array = Array;
12407var max = Math.max;
12408
12409// `Array.prototype.slice` method
12410// https://tc39.es/ecma262/#sec-array.prototype.slice
12411// fallback for not array-like ES3 strings and DOM objects
12412$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
12413 slice: function slice(start, end) {
12414 var O = toIndexedObject(this);
12415 var length = lengthOfArrayLike(O);
12416 var k = toAbsoluteIndex(start, length);
12417 var fin = toAbsoluteIndex(end === undefined ? length : end, length);
12418 // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
12419 var Constructor, result, n;
12420 if (isArray(O)) {
12421 Constructor = O.constructor;
12422 // cross-realm fallback
12423 if (isConstructor(Constructor) && (Constructor === $Array || isArray(Constructor.prototype))) {
12424 Constructor = undefined;
12425 } else if (isObject(Constructor)) {
12426 Constructor = Constructor[SPECIES];
12427 if (Constructor === null) Constructor = undefined;
12428 }
12429 if (Constructor === $Array || Constructor === undefined) {
12430 return un$Slice(O, k, fin);
12431 }
12432 }
12433 result = new (Constructor === undefined ? $Array : Constructor)(max(fin - k, 0));
12434 for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
12435 result.length = n;
12436 return result;
12437 }
12438});
12439
12440
12441/***/ }),
12442/* 396 */
12443/***/ (function(module, exports, __webpack_require__) {
12444
12445__webpack_require__(397);
12446var path = __webpack_require__(10);
12447
12448var Object = path.Object;
12449
12450var defineProperty = module.exports = function defineProperty(it, key, desc) {
12451 return Object.defineProperty(it, key, desc);
12452};
12453
12454if (Object.defineProperty.sham) defineProperty.sham = true;
12455
12456
12457/***/ }),
12458/* 397 */
12459/***/ (function(module, exports, __webpack_require__) {
12460
12461var $ = __webpack_require__(0);
12462var DESCRIPTORS = __webpack_require__(16);
12463var defineProperty = __webpack_require__(22).f;
12464
12465// `Object.defineProperty` method
12466// https://tc39.es/ecma262/#sec-object.defineproperty
12467// eslint-disable-next-line es-x/no-object-defineproperty -- safe
12468$({ target: 'Object', stat: true, forced: Object.defineProperty !== defineProperty, sham: !DESCRIPTORS }, {
12469 defineProperty: defineProperty
12470});
12471
12472
12473/***/ }),
12474/* 398 */
12475/***/ (function(module, exports, __webpack_require__) {
12476
12477"use strict";
12478
12479
12480var ajax = __webpack_require__(108);
12481
12482var Cache = __webpack_require__(226);
12483
12484function AppRouter(AV) {
12485 var _this = this;
12486
12487 this.AV = AV;
12488 this.lockedUntil = 0;
12489 Cache.getAsync('serverURLs').then(function (data) {
12490 if (_this.disabled) return;
12491 if (!data) return _this.lock(0);
12492 var serverURLs = data.serverURLs,
12493 lockedUntil = data.lockedUntil;
12494
12495 _this.AV._setServerURLs(serverURLs, false);
12496
12497 _this.lockedUntil = lockedUntil;
12498 }).catch(function () {
12499 return _this.lock(0);
12500 });
12501}
12502
12503AppRouter.prototype.disable = function disable() {
12504 this.disabled = true;
12505};
12506
12507AppRouter.prototype.lock = function lock(ttl) {
12508 this.lockedUntil = Date.now() + ttl;
12509};
12510
12511AppRouter.prototype.refresh = function refresh() {
12512 var _this2 = this;
12513
12514 if (this.disabled) return;
12515 if (Date.now() < this.lockedUntil) return;
12516 this.lock(10);
12517 var url = 'https://app-router.com/2/route';
12518 return ajax({
12519 method: 'get',
12520 url: url,
12521 query: {
12522 appId: this.AV.applicationId
12523 }
12524 }).then(function (servers) {
12525 if (_this2.disabled) return;
12526 var ttl = servers.ttl;
12527 if (!ttl) throw new Error('missing ttl');
12528 ttl = ttl * 1000;
12529 var protocal = 'https://';
12530 var serverURLs = {
12531 push: protocal + servers.push_server,
12532 stats: protocal + servers.stats_server,
12533 engine: protocal + servers.engine_server,
12534 api: protocal + servers.api_server
12535 };
12536
12537 _this2.AV._setServerURLs(serverURLs, false);
12538
12539 _this2.lock(ttl);
12540
12541 return Cache.setAsync('serverURLs', {
12542 serverURLs: serverURLs,
12543 lockedUntil: _this2.lockedUntil
12544 }, ttl);
12545 }).catch(function (error) {
12546 // bypass all errors
12547 console.warn("refresh server URLs failed: ".concat(error.message));
12548
12549 _this2.lock(600);
12550 });
12551};
12552
12553module.exports = AppRouter;
12554
12555/***/ }),
12556/* 399 */
12557/***/ (function(module, exports, __webpack_require__) {
12558
12559module.exports = __webpack_require__(400);
12560
12561
12562/***/ }),
12563/* 400 */
12564/***/ (function(module, exports, __webpack_require__) {
12565
12566var parent = __webpack_require__(401);
12567__webpack_require__(424);
12568__webpack_require__(425);
12569__webpack_require__(426);
12570__webpack_require__(427);
12571__webpack_require__(428);
12572// TODO: Remove from `core-js@4`
12573__webpack_require__(429);
12574__webpack_require__(430);
12575__webpack_require__(431);
12576
12577module.exports = parent;
12578
12579
12580/***/ }),
12581/* 401 */
12582/***/ (function(module, exports, __webpack_require__) {
12583
12584var parent = __webpack_require__(232);
12585
12586module.exports = parent;
12587
12588
12589/***/ }),
12590/* 402 */
12591/***/ (function(module, exports, __webpack_require__) {
12592
12593__webpack_require__(218);
12594__webpack_require__(60);
12595__webpack_require__(233);
12596__webpack_require__(408);
12597__webpack_require__(409);
12598__webpack_require__(410);
12599__webpack_require__(411);
12600__webpack_require__(237);
12601__webpack_require__(412);
12602__webpack_require__(413);
12603__webpack_require__(414);
12604__webpack_require__(415);
12605__webpack_require__(416);
12606__webpack_require__(417);
12607__webpack_require__(418);
12608__webpack_require__(419);
12609__webpack_require__(420);
12610__webpack_require__(421);
12611__webpack_require__(422);
12612__webpack_require__(423);
12613var path = __webpack_require__(10);
12614
12615module.exports = path.Symbol;
12616
12617
12618/***/ }),
12619/* 403 */
12620/***/ (function(module, exports, __webpack_require__) {
12621
12622"use strict";
12623
12624var $ = __webpack_require__(0);
12625var global = __webpack_require__(6);
12626var call = __webpack_require__(13);
12627var uncurryThis = __webpack_require__(4);
12628var IS_PURE = __webpack_require__(32);
12629var DESCRIPTORS = __webpack_require__(16);
12630var NATIVE_SYMBOL = __webpack_require__(57);
12631var fails = __webpack_require__(3);
12632var hasOwn = __webpack_require__(14);
12633var isPrototypeOf = __webpack_require__(21);
12634var anObject = __webpack_require__(19);
12635var toIndexedObject = __webpack_require__(33);
12636var toPropertyKey = __webpack_require__(88);
12637var $toString = __webpack_require__(75);
12638var createPropertyDescriptor = __webpack_require__(44);
12639var nativeObjectCreate = __webpack_require__(47);
12640var objectKeys = __webpack_require__(98);
12641var getOwnPropertyNamesModule = __webpack_require__(96);
12642var getOwnPropertyNamesExternal = __webpack_require__(234);
12643var getOwnPropertySymbolsModule = __webpack_require__(97);
12644var getOwnPropertyDescriptorModule = __webpack_require__(71);
12645var definePropertyModule = __webpack_require__(22);
12646var definePropertiesModule = __webpack_require__(154);
12647var propertyIsEnumerableModule = __webpack_require__(113);
12648var defineBuiltIn = __webpack_require__(39);
12649var shared = __webpack_require__(73);
12650var sharedKey = __webpack_require__(94);
12651var hiddenKeys = __webpack_require__(74);
12652var uid = __webpack_require__(92);
12653var wellKnownSymbol = __webpack_require__(9);
12654var wrappedWellKnownSymbolModule = __webpack_require__(144);
12655var defineWellKnownSymbol = __webpack_require__(8);
12656var defineSymbolToPrimitive = __webpack_require__(235);
12657var setToStringTag = __webpack_require__(49);
12658var InternalStateModule = __webpack_require__(38);
12659var $forEach = __webpack_require__(66).forEach;
12660
12661var HIDDEN = sharedKey('hidden');
12662var SYMBOL = 'Symbol';
12663var PROTOTYPE = 'prototype';
12664
12665var setInternalState = InternalStateModule.set;
12666var getInternalState = InternalStateModule.getterFor(SYMBOL);
12667
12668var ObjectPrototype = Object[PROTOTYPE];
12669var $Symbol = global.Symbol;
12670var SymbolPrototype = $Symbol && $Symbol[PROTOTYPE];
12671var TypeError = global.TypeError;
12672var QObject = global.QObject;
12673var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
12674var nativeDefineProperty = definePropertyModule.f;
12675var nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f;
12676var nativePropertyIsEnumerable = propertyIsEnumerableModule.f;
12677var push = uncurryThis([].push);
12678
12679var AllSymbols = shared('symbols');
12680var ObjectPrototypeSymbols = shared('op-symbols');
12681var WellKnownSymbolsStore = shared('wks');
12682
12683// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
12684var USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
12685
12686// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
12687var setSymbolDescriptor = DESCRIPTORS && fails(function () {
12688 return nativeObjectCreate(nativeDefineProperty({}, 'a', {
12689 get: function () { return nativeDefineProperty(this, 'a', { value: 7 }).a; }
12690 })).a != 7;
12691}) ? function (O, P, Attributes) {
12692 var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor(ObjectPrototype, P);
12693 if (ObjectPrototypeDescriptor) delete ObjectPrototype[P];
12694 nativeDefineProperty(O, P, Attributes);
12695 if (ObjectPrototypeDescriptor && O !== ObjectPrototype) {
12696 nativeDefineProperty(ObjectPrototype, P, ObjectPrototypeDescriptor);
12697 }
12698} : nativeDefineProperty;
12699
12700var wrap = function (tag, description) {
12701 var symbol = AllSymbols[tag] = nativeObjectCreate(SymbolPrototype);
12702 setInternalState(symbol, {
12703 type: SYMBOL,
12704 tag: tag,
12705 description: description
12706 });
12707 if (!DESCRIPTORS) symbol.description = description;
12708 return symbol;
12709};
12710
12711var $defineProperty = function defineProperty(O, P, Attributes) {
12712 if (O === ObjectPrototype) $defineProperty(ObjectPrototypeSymbols, P, Attributes);
12713 anObject(O);
12714 var key = toPropertyKey(P);
12715 anObject(Attributes);
12716 if (hasOwn(AllSymbols, key)) {
12717 if (!Attributes.enumerable) {
12718 if (!hasOwn(O, HIDDEN)) nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, {}));
12719 O[HIDDEN][key] = true;
12720 } else {
12721 if (hasOwn(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false;
12722 Attributes = nativeObjectCreate(Attributes, { enumerable: createPropertyDescriptor(0, false) });
12723 } return setSymbolDescriptor(O, key, Attributes);
12724 } return nativeDefineProperty(O, key, Attributes);
12725};
12726
12727var $defineProperties = function defineProperties(O, Properties) {
12728 anObject(O);
12729 var properties = toIndexedObject(Properties);
12730 var keys = objectKeys(properties).concat($getOwnPropertySymbols(properties));
12731 $forEach(keys, function (key) {
12732 if (!DESCRIPTORS || call($propertyIsEnumerable, properties, key)) $defineProperty(O, key, properties[key]);
12733 });
12734 return O;
12735};
12736
12737var $create = function create(O, Properties) {
12738 return Properties === undefined ? nativeObjectCreate(O) : $defineProperties(nativeObjectCreate(O), Properties);
12739};
12740
12741var $propertyIsEnumerable = function propertyIsEnumerable(V) {
12742 var P = toPropertyKey(V);
12743 var enumerable = call(nativePropertyIsEnumerable, this, P);
12744 if (this === ObjectPrototype && hasOwn(AllSymbols, P) && !hasOwn(ObjectPrototypeSymbols, P)) return false;
12745 return enumerable || !hasOwn(this, P) || !hasOwn(AllSymbols, P) || hasOwn(this, HIDDEN) && this[HIDDEN][P]
12746 ? enumerable : true;
12747};
12748
12749var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) {
12750 var it = toIndexedObject(O);
12751 var key = toPropertyKey(P);
12752 if (it === ObjectPrototype && hasOwn(AllSymbols, key) && !hasOwn(ObjectPrototypeSymbols, key)) return;
12753 var descriptor = nativeGetOwnPropertyDescriptor(it, key);
12754 if (descriptor && hasOwn(AllSymbols, key) && !(hasOwn(it, HIDDEN) && it[HIDDEN][key])) {
12755 descriptor.enumerable = true;
12756 }
12757 return descriptor;
12758};
12759
12760var $getOwnPropertyNames = function getOwnPropertyNames(O) {
12761 var names = nativeGetOwnPropertyNames(toIndexedObject(O));
12762 var result = [];
12763 $forEach(names, function (key) {
12764 if (!hasOwn(AllSymbols, key) && !hasOwn(hiddenKeys, key)) push(result, key);
12765 });
12766 return result;
12767};
12768
12769var $getOwnPropertySymbols = function (O) {
12770 var IS_OBJECT_PROTOTYPE = O === ObjectPrototype;
12771 var names = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O));
12772 var result = [];
12773 $forEach(names, function (key) {
12774 if (hasOwn(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || hasOwn(ObjectPrototype, key))) {
12775 push(result, AllSymbols[key]);
12776 }
12777 });
12778 return result;
12779};
12780
12781// `Symbol` constructor
12782// https://tc39.es/ecma262/#sec-symbol-constructor
12783if (!NATIVE_SYMBOL) {
12784 $Symbol = function Symbol() {
12785 if (isPrototypeOf(SymbolPrototype, this)) throw TypeError('Symbol is not a constructor');
12786 var description = !arguments.length || arguments[0] === undefined ? undefined : $toString(arguments[0]);
12787 var tag = uid(description);
12788 var setter = function (value) {
12789 if (this === ObjectPrototype) call(setter, ObjectPrototypeSymbols, value);
12790 if (hasOwn(this, HIDDEN) && hasOwn(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
12791 setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value));
12792 };
12793 if (DESCRIPTORS && USE_SETTER) setSymbolDescriptor(ObjectPrototype, tag, { configurable: true, set: setter });
12794 return wrap(tag, description);
12795 };
12796
12797 SymbolPrototype = $Symbol[PROTOTYPE];
12798
12799 defineBuiltIn(SymbolPrototype, 'toString', function toString() {
12800 return getInternalState(this).tag;
12801 });
12802
12803 defineBuiltIn($Symbol, 'withoutSetter', function (description) {
12804 return wrap(uid(description), description);
12805 });
12806
12807 propertyIsEnumerableModule.f = $propertyIsEnumerable;
12808 definePropertyModule.f = $defineProperty;
12809 definePropertiesModule.f = $defineProperties;
12810 getOwnPropertyDescriptorModule.f = $getOwnPropertyDescriptor;
12811 getOwnPropertyNamesModule.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames;
12812 getOwnPropertySymbolsModule.f = $getOwnPropertySymbols;
12813
12814 wrappedWellKnownSymbolModule.f = function (name) {
12815 return wrap(wellKnownSymbol(name), name);
12816 };
12817
12818 if (DESCRIPTORS) {
12819 // https://github.com/tc39/proposal-Symbol-description
12820 nativeDefineProperty(SymbolPrototype, 'description', {
12821 configurable: true,
12822 get: function description() {
12823 return getInternalState(this).description;
12824 }
12825 });
12826 if (!IS_PURE) {
12827 defineBuiltIn(ObjectPrototype, 'propertyIsEnumerable', $propertyIsEnumerable, { unsafe: true });
12828 }
12829 }
12830}
12831
12832$({ global: true, constructor: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, {
12833 Symbol: $Symbol
12834});
12835
12836$forEach(objectKeys(WellKnownSymbolsStore), function (name) {
12837 defineWellKnownSymbol(name);
12838});
12839
12840$({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL }, {
12841 useSetter: function () { USE_SETTER = true; },
12842 useSimple: function () { USE_SETTER = false; }
12843});
12844
12845$({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL, sham: !DESCRIPTORS }, {
12846 // `Object.create` method
12847 // https://tc39.es/ecma262/#sec-object.create
12848 create: $create,
12849 // `Object.defineProperty` method
12850 // https://tc39.es/ecma262/#sec-object.defineproperty
12851 defineProperty: $defineProperty,
12852 // `Object.defineProperties` method
12853 // https://tc39.es/ecma262/#sec-object.defineproperties
12854 defineProperties: $defineProperties,
12855 // `Object.getOwnPropertyDescriptor` method
12856 // https://tc39.es/ecma262/#sec-object.getownpropertydescriptors
12857 getOwnPropertyDescriptor: $getOwnPropertyDescriptor
12858});
12859
12860$({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL }, {
12861 // `Object.getOwnPropertyNames` method
12862 // https://tc39.es/ecma262/#sec-object.getownpropertynames
12863 getOwnPropertyNames: $getOwnPropertyNames
12864});
12865
12866// `Symbol.prototype[@@toPrimitive]` method
12867// https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive
12868defineSymbolToPrimitive();
12869
12870// `Symbol.prototype[@@toStringTag]` property
12871// https://tc39.es/ecma262/#sec-symbol.prototype-@@tostringtag
12872setToStringTag($Symbol, SYMBOL);
12873
12874hiddenKeys[HIDDEN] = true;
12875
12876
12877/***/ }),
12878/* 404 */
12879/***/ (function(module, exports, __webpack_require__) {
12880
12881var toAbsoluteIndex = __webpack_require__(119);
12882var lengthOfArrayLike = __webpack_require__(46);
12883var createProperty = __webpack_require__(106);
12884
12885var $Array = Array;
12886var max = Math.max;
12887
12888module.exports = function (O, start, end) {
12889 var length = lengthOfArrayLike(O);
12890 var k = toAbsoluteIndex(start, length);
12891 var fin = toAbsoluteIndex(end === undefined ? length : end, length);
12892 var result = $Array(max(fin - k, 0));
12893 for (var n = 0; k < fin; k++, n++) createProperty(result, n, O[k]);
12894 result.length = n;
12895 return result;
12896};
12897
12898
12899/***/ }),
12900/* 405 */
12901/***/ (function(module, exports, __webpack_require__) {
12902
12903var $ = __webpack_require__(0);
12904var getBuiltIn = __webpack_require__(18);
12905var hasOwn = __webpack_require__(14);
12906var toString = __webpack_require__(75);
12907var shared = __webpack_require__(73);
12908var NATIVE_SYMBOL_REGISTRY = __webpack_require__(236);
12909
12910var StringToSymbolRegistry = shared('string-to-symbol-registry');
12911var SymbolToStringRegistry = shared('symbol-to-string-registry');
12912
12913// `Symbol.for` method
12914// https://tc39.es/ecma262/#sec-symbol.for
12915$({ target: 'Symbol', stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, {
12916 'for': function (key) {
12917 var string = toString(key);
12918 if (hasOwn(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string];
12919 var symbol = getBuiltIn('Symbol')(string);
12920 StringToSymbolRegistry[string] = symbol;
12921 SymbolToStringRegistry[symbol] = string;
12922 return symbol;
12923 }
12924});
12925
12926
12927/***/ }),
12928/* 406 */
12929/***/ (function(module, exports, __webpack_require__) {
12930
12931var $ = __webpack_require__(0);
12932var hasOwn = __webpack_require__(14);
12933var isSymbol = __webpack_require__(89);
12934var tryToString = __webpack_require__(72);
12935var shared = __webpack_require__(73);
12936var NATIVE_SYMBOL_REGISTRY = __webpack_require__(236);
12937
12938var SymbolToStringRegistry = shared('symbol-to-string-registry');
12939
12940// `Symbol.keyFor` method
12941// https://tc39.es/ecma262/#sec-symbol.keyfor
12942$({ target: 'Symbol', stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, {
12943 keyFor: function keyFor(sym) {
12944 if (!isSymbol(sym)) throw TypeError(tryToString(sym) + ' is not a symbol');
12945 if (hasOwn(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym];
12946 }
12947});
12948
12949
12950/***/ }),
12951/* 407 */
12952/***/ (function(module, exports, __webpack_require__) {
12953
12954var $ = __webpack_require__(0);
12955var NATIVE_SYMBOL = __webpack_require__(57);
12956var fails = __webpack_require__(3);
12957var getOwnPropertySymbolsModule = __webpack_require__(97);
12958var toObject = __webpack_require__(34);
12959
12960// V8 ~ Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives
12961// https://bugs.chromium.org/p/v8/issues/detail?id=3443
12962var FORCED = !NATIVE_SYMBOL || fails(function () { getOwnPropertySymbolsModule.f(1); });
12963
12964// `Object.getOwnPropertySymbols` method
12965// https://tc39.es/ecma262/#sec-object.getownpropertysymbols
12966$({ target: 'Object', stat: true, forced: FORCED }, {
12967 getOwnPropertySymbols: function getOwnPropertySymbols(it) {
12968 var $getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
12969 return $getOwnPropertySymbols ? $getOwnPropertySymbols(toObject(it)) : [];
12970 }
12971});
12972
12973
12974/***/ }),
12975/* 408 */
12976/***/ (function(module, exports, __webpack_require__) {
12977
12978var defineWellKnownSymbol = __webpack_require__(8);
12979
12980// `Symbol.asyncIterator` well-known symbol
12981// https://tc39.es/ecma262/#sec-symbol.asynciterator
12982defineWellKnownSymbol('asyncIterator');
12983
12984
12985/***/ }),
12986/* 409 */
12987/***/ (function(module, exports) {
12988
12989// empty
12990
12991
12992/***/ }),
12993/* 410 */
12994/***/ (function(module, exports, __webpack_require__) {
12995
12996var defineWellKnownSymbol = __webpack_require__(8);
12997
12998// `Symbol.hasInstance` well-known symbol
12999// https://tc39.es/ecma262/#sec-symbol.hasinstance
13000defineWellKnownSymbol('hasInstance');
13001
13002
13003/***/ }),
13004/* 411 */
13005/***/ (function(module, exports, __webpack_require__) {
13006
13007var defineWellKnownSymbol = __webpack_require__(8);
13008
13009// `Symbol.isConcatSpreadable` well-known symbol
13010// https://tc39.es/ecma262/#sec-symbol.isconcatspreadable
13011defineWellKnownSymbol('isConcatSpreadable');
13012
13013
13014/***/ }),
13015/* 412 */
13016/***/ (function(module, exports, __webpack_require__) {
13017
13018var defineWellKnownSymbol = __webpack_require__(8);
13019
13020// `Symbol.match` well-known symbol
13021// https://tc39.es/ecma262/#sec-symbol.match
13022defineWellKnownSymbol('match');
13023
13024
13025/***/ }),
13026/* 413 */
13027/***/ (function(module, exports, __webpack_require__) {
13028
13029var defineWellKnownSymbol = __webpack_require__(8);
13030
13031// `Symbol.matchAll` well-known symbol
13032// https://tc39.es/ecma262/#sec-symbol.matchall
13033defineWellKnownSymbol('matchAll');
13034
13035
13036/***/ }),
13037/* 414 */
13038/***/ (function(module, exports, __webpack_require__) {
13039
13040var defineWellKnownSymbol = __webpack_require__(8);
13041
13042// `Symbol.replace` well-known symbol
13043// https://tc39.es/ecma262/#sec-symbol.replace
13044defineWellKnownSymbol('replace');
13045
13046
13047/***/ }),
13048/* 415 */
13049/***/ (function(module, exports, __webpack_require__) {
13050
13051var defineWellKnownSymbol = __webpack_require__(8);
13052
13053// `Symbol.search` well-known symbol
13054// https://tc39.es/ecma262/#sec-symbol.search
13055defineWellKnownSymbol('search');
13056
13057
13058/***/ }),
13059/* 416 */
13060/***/ (function(module, exports, __webpack_require__) {
13061
13062var defineWellKnownSymbol = __webpack_require__(8);
13063
13064// `Symbol.species` well-known symbol
13065// https://tc39.es/ecma262/#sec-symbol.species
13066defineWellKnownSymbol('species');
13067
13068
13069/***/ }),
13070/* 417 */
13071/***/ (function(module, exports, __webpack_require__) {
13072
13073var defineWellKnownSymbol = __webpack_require__(8);
13074
13075// `Symbol.split` well-known symbol
13076// https://tc39.es/ecma262/#sec-symbol.split
13077defineWellKnownSymbol('split');
13078
13079
13080/***/ }),
13081/* 418 */
13082/***/ (function(module, exports, __webpack_require__) {
13083
13084var defineWellKnownSymbol = __webpack_require__(8);
13085var defineSymbolToPrimitive = __webpack_require__(235);
13086
13087// `Symbol.toPrimitive` well-known symbol
13088// https://tc39.es/ecma262/#sec-symbol.toprimitive
13089defineWellKnownSymbol('toPrimitive');
13090
13091// `Symbol.prototype[@@toPrimitive]` method
13092// https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive
13093defineSymbolToPrimitive();
13094
13095
13096/***/ }),
13097/* 419 */
13098/***/ (function(module, exports, __webpack_require__) {
13099
13100var getBuiltIn = __webpack_require__(18);
13101var defineWellKnownSymbol = __webpack_require__(8);
13102var setToStringTag = __webpack_require__(49);
13103
13104// `Symbol.toStringTag` well-known symbol
13105// https://tc39.es/ecma262/#sec-symbol.tostringtag
13106defineWellKnownSymbol('toStringTag');
13107
13108// `Symbol.prototype[@@toStringTag]` property
13109// https://tc39.es/ecma262/#sec-symbol.prototype-@@tostringtag
13110setToStringTag(getBuiltIn('Symbol'), 'Symbol');
13111
13112
13113/***/ }),
13114/* 420 */
13115/***/ (function(module, exports, __webpack_require__) {
13116
13117var defineWellKnownSymbol = __webpack_require__(8);
13118
13119// `Symbol.unscopables` well-known symbol
13120// https://tc39.es/ecma262/#sec-symbol.unscopables
13121defineWellKnownSymbol('unscopables');
13122
13123
13124/***/ }),
13125/* 421 */
13126/***/ (function(module, exports, __webpack_require__) {
13127
13128var global = __webpack_require__(6);
13129var setToStringTag = __webpack_require__(49);
13130
13131// JSON[@@toStringTag] property
13132// https://tc39.es/ecma262/#sec-json-@@tostringtag
13133setToStringTag(global.JSON, 'JSON', true);
13134
13135
13136/***/ }),
13137/* 422 */
13138/***/ (function(module, exports) {
13139
13140// empty
13141
13142
13143/***/ }),
13144/* 423 */
13145/***/ (function(module, exports) {
13146
13147// empty
13148
13149
13150/***/ }),
13151/* 424 */
13152/***/ (function(module, exports, __webpack_require__) {
13153
13154var defineWellKnownSymbol = __webpack_require__(8);
13155
13156// `Symbol.asyncDispose` well-known symbol
13157// https://github.com/tc39/proposal-using-statement
13158defineWellKnownSymbol('asyncDispose');
13159
13160
13161/***/ }),
13162/* 425 */
13163/***/ (function(module, exports, __webpack_require__) {
13164
13165var defineWellKnownSymbol = __webpack_require__(8);
13166
13167// `Symbol.dispose` well-known symbol
13168// https://github.com/tc39/proposal-using-statement
13169defineWellKnownSymbol('dispose');
13170
13171
13172/***/ }),
13173/* 426 */
13174/***/ (function(module, exports, __webpack_require__) {
13175
13176var defineWellKnownSymbol = __webpack_require__(8);
13177
13178// `Symbol.matcher` well-known symbol
13179// https://github.com/tc39/proposal-pattern-matching
13180defineWellKnownSymbol('matcher');
13181
13182
13183/***/ }),
13184/* 427 */
13185/***/ (function(module, exports, __webpack_require__) {
13186
13187var defineWellKnownSymbol = __webpack_require__(8);
13188
13189// `Symbol.metadataKey` well-known symbol
13190// https://github.com/tc39/proposal-decorator-metadata
13191defineWellKnownSymbol('metadataKey');
13192
13193
13194/***/ }),
13195/* 428 */
13196/***/ (function(module, exports, __webpack_require__) {
13197
13198var defineWellKnownSymbol = __webpack_require__(8);
13199
13200// `Symbol.observable` well-known symbol
13201// https://github.com/tc39/proposal-observable
13202defineWellKnownSymbol('observable');
13203
13204
13205/***/ }),
13206/* 429 */
13207/***/ (function(module, exports, __webpack_require__) {
13208
13209// TODO: Remove from `core-js@4`
13210var defineWellKnownSymbol = __webpack_require__(8);
13211
13212// `Symbol.metadata` well-known symbol
13213// https://github.com/tc39/proposal-decorators
13214defineWellKnownSymbol('metadata');
13215
13216
13217/***/ }),
13218/* 430 */
13219/***/ (function(module, exports, __webpack_require__) {
13220
13221// TODO: remove from `core-js@4`
13222var defineWellKnownSymbol = __webpack_require__(8);
13223
13224// `Symbol.patternMatch` well-known symbol
13225// https://github.com/tc39/proposal-pattern-matching
13226defineWellKnownSymbol('patternMatch');
13227
13228
13229/***/ }),
13230/* 431 */
13231/***/ (function(module, exports, __webpack_require__) {
13232
13233// TODO: remove from `core-js@4`
13234var defineWellKnownSymbol = __webpack_require__(8);
13235
13236defineWellKnownSymbol('replaceAll');
13237
13238
13239/***/ }),
13240/* 432 */
13241/***/ (function(module, exports, __webpack_require__) {
13242
13243module.exports = __webpack_require__(433);
13244
13245/***/ }),
13246/* 433 */
13247/***/ (function(module, exports, __webpack_require__) {
13248
13249module.exports = __webpack_require__(434);
13250
13251
13252/***/ }),
13253/* 434 */
13254/***/ (function(module, exports, __webpack_require__) {
13255
13256var parent = __webpack_require__(435);
13257
13258module.exports = parent;
13259
13260
13261/***/ }),
13262/* 435 */
13263/***/ (function(module, exports, __webpack_require__) {
13264
13265var parent = __webpack_require__(238);
13266
13267module.exports = parent;
13268
13269
13270/***/ }),
13271/* 436 */
13272/***/ (function(module, exports, __webpack_require__) {
13273
13274__webpack_require__(48);
13275__webpack_require__(60);
13276__webpack_require__(78);
13277__webpack_require__(237);
13278var WrappedWellKnownSymbolModule = __webpack_require__(144);
13279
13280module.exports = WrappedWellKnownSymbolModule.f('iterator');
13281
13282
13283/***/ }),
13284/* 437 */
13285/***/ (function(module, exports, __webpack_require__) {
13286
13287module.exports = __webpack_require__(438);
13288
13289/***/ }),
13290/* 438 */
13291/***/ (function(module, exports, __webpack_require__) {
13292
13293var parent = __webpack_require__(439);
13294
13295module.exports = parent;
13296
13297
13298/***/ }),
13299/* 439 */
13300/***/ (function(module, exports, __webpack_require__) {
13301
13302var isPrototypeOf = __webpack_require__(21);
13303var method = __webpack_require__(440);
13304
13305var ArrayPrototype = Array.prototype;
13306
13307module.exports = function (it) {
13308 var own = it.filter;
13309 return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.filter) ? method : own;
13310};
13311
13312
13313/***/ }),
13314/* 440 */
13315/***/ (function(module, exports, __webpack_require__) {
13316
13317__webpack_require__(441);
13318var entryVirtual = __webpack_require__(41);
13319
13320module.exports = entryVirtual('Array').filter;
13321
13322
13323/***/ }),
13324/* 441 */
13325/***/ (function(module, exports, __webpack_require__) {
13326
13327"use strict";
13328
13329var $ = __webpack_require__(0);
13330var $filter = __webpack_require__(66).filter;
13331var arrayMethodHasSpeciesSupport = __webpack_require__(107);
13332
13333var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
13334
13335// `Array.prototype.filter` method
13336// https://tc39.es/ecma262/#sec-array.prototype.filter
13337// with adding support of @@species
13338$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
13339 filter: function filter(callbackfn /* , thisArg */) {
13340 return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
13341 }
13342});
13343
13344
13345/***/ }),
13346/* 442 */
13347/***/ (function(module, exports, __webpack_require__) {
13348
13349"use strict";
13350// Copyright (c) 2015-2017 David M. Lee, II
13351
13352
13353/**
13354 * Local reference to TimeoutError
13355 * @private
13356 */
13357var TimeoutError;
13358
13359/**
13360 * Rejects a promise with a {@link TimeoutError} if it does not settle within
13361 * the specified timeout.
13362 *
13363 * @param {Promise} promise The promise.
13364 * @param {number} timeoutMillis Number of milliseconds to wait on settling.
13365 * @returns {Promise} Either resolves/rejects with `promise`, or rejects with
13366 * `TimeoutError`, whichever settles first.
13367 */
13368var timeout = module.exports.timeout = function(promise, timeoutMillis) {
13369 var error = new TimeoutError(),
13370 timeout;
13371
13372 return Promise.race([
13373 promise,
13374 new Promise(function(resolve, reject) {
13375 timeout = setTimeout(function() {
13376 reject(error);
13377 }, timeoutMillis);
13378 }),
13379 ]).then(function(v) {
13380 clearTimeout(timeout);
13381 return v;
13382 }, function(err) {
13383 clearTimeout(timeout);
13384 throw err;
13385 });
13386};
13387
13388/**
13389 * Exception indicating that the timeout expired.
13390 */
13391TimeoutError = module.exports.TimeoutError = function() {
13392 Error.call(this)
13393 this.stack = Error().stack
13394 this.message = 'Timeout';
13395};
13396
13397TimeoutError.prototype = Object.create(Error.prototype);
13398TimeoutError.prototype.name = "TimeoutError";
13399
13400
13401/***/ }),
13402/* 443 */
13403/***/ (function(module, exports, __webpack_require__) {
13404
13405"use strict";
13406
13407
13408var _interopRequireDefault = __webpack_require__(1);
13409
13410var _slice = _interopRequireDefault(__webpack_require__(87));
13411
13412var _keys = _interopRequireDefault(__webpack_require__(55));
13413
13414var _concat = _interopRequireDefault(__webpack_require__(30));
13415
13416var _ = __webpack_require__(2);
13417
13418module.exports = function (AV) {
13419 var eventSplitter = /\s+/;
13420 var slice = (0, _slice.default)(Array.prototype);
13421 /**
13422 * @class
13423 *
13424 * <p>AV.Events is a fork of Backbone's Events module, provided for your
13425 * convenience.</p>
13426 *
13427 * <p>A module that can be mixed in to any object in order to provide
13428 * it with custom events. You may bind callback functions to an event
13429 * with `on`, or remove these functions with `off`.
13430 * Triggering an event fires all callbacks in the order that `on` was
13431 * called.
13432 *
13433 * @private
13434 * @example
13435 * var object = {};
13436 * _.extend(object, AV.Events);
13437 * object.on('expand', function(){ alert('expanded'); });
13438 * object.trigger('expand');</pre></p>
13439 *
13440 */
13441
13442 AV.Events = {
13443 /**
13444 * Bind one or more space separated events, `events`, to a `callback`
13445 * function. Passing `"all"` will bind the callback to all events fired.
13446 */
13447 on: function on(events, callback, context) {
13448 var calls, event, node, tail, list;
13449
13450 if (!callback) {
13451 return this;
13452 }
13453
13454 events = events.split(eventSplitter);
13455 calls = this._callbacks || (this._callbacks = {}); // Create an immutable callback list, allowing traversal during
13456 // modification. The tail is an empty object that will always be used
13457 // as the next node.
13458
13459 event = events.shift();
13460
13461 while (event) {
13462 list = calls[event];
13463 node = list ? list.tail : {};
13464 node.next = tail = {};
13465 node.context = context;
13466 node.callback = callback;
13467 calls[event] = {
13468 tail: tail,
13469 next: list ? list.next : node
13470 };
13471 event = events.shift();
13472 }
13473
13474 return this;
13475 },
13476
13477 /**
13478 * Remove one or many callbacks. If `context` is null, removes all callbacks
13479 * with that function. If `callback` is null, removes all callbacks for the
13480 * event. If `events` is null, removes all bound callbacks for all events.
13481 */
13482 off: function off(events, callback, context) {
13483 var event, calls, node, tail, cb, ctx; // No events, or removing *all* events.
13484
13485 if (!(calls = this._callbacks)) {
13486 return;
13487 }
13488
13489 if (!(events || callback || context)) {
13490 delete this._callbacks;
13491 return this;
13492 } // Loop through the listed events and contexts, splicing them out of the
13493 // linked list of callbacks if appropriate.
13494
13495
13496 events = events ? events.split(eventSplitter) : (0, _keys.default)(_).call(_, calls);
13497 event = events.shift();
13498
13499 while (event) {
13500 node = calls[event];
13501 delete calls[event];
13502
13503 if (!node || !(callback || context)) {
13504 continue;
13505 } // Create a new list, omitting the indicated callbacks.
13506
13507
13508 tail = node.tail;
13509 node = node.next;
13510
13511 while (node !== tail) {
13512 cb = node.callback;
13513 ctx = node.context;
13514
13515 if (callback && cb !== callback || context && ctx !== context) {
13516 this.on(event, cb, ctx);
13517 }
13518
13519 node = node.next;
13520 }
13521
13522 event = events.shift();
13523 }
13524
13525 return this;
13526 },
13527
13528 /**
13529 * Trigger one or many events, firing all bound callbacks. Callbacks are
13530 * passed the same arguments as `trigger` is, apart from the event name
13531 * (unless you're listening on `"all"`, which will cause your callback to
13532 * receive the true name of the event as the first argument).
13533 */
13534 trigger: function trigger(events) {
13535 var event, node, calls, tail, args, all, rest;
13536
13537 if (!(calls = this._callbacks)) {
13538 return this;
13539 }
13540
13541 all = calls.all;
13542 events = events.split(eventSplitter);
13543 rest = slice.call(arguments, 1); // For each event, walk through the linked list of callbacks twice,
13544 // first to trigger the event, then to trigger any `"all"` callbacks.
13545
13546 event = events.shift();
13547
13548 while (event) {
13549 node = calls[event];
13550
13551 if (node) {
13552 tail = node.tail;
13553
13554 while ((node = node.next) !== tail) {
13555 node.callback.apply(node.context || this, rest);
13556 }
13557 }
13558
13559 node = all;
13560
13561 if (node) {
13562 var _context;
13563
13564 tail = node.tail;
13565 args = (0, _concat.default)(_context = [event]).call(_context, rest);
13566
13567 while ((node = node.next) !== tail) {
13568 node.callback.apply(node.context || this, args);
13569 }
13570 }
13571
13572 event = events.shift();
13573 }
13574
13575 return this;
13576 }
13577 };
13578 /**
13579 * @function
13580 */
13581
13582 AV.Events.bind = AV.Events.on;
13583 /**
13584 * @function
13585 */
13586
13587 AV.Events.unbind = AV.Events.off;
13588};
13589
13590/***/ }),
13591/* 444 */
13592/***/ (function(module, exports, __webpack_require__) {
13593
13594"use strict";
13595
13596
13597var _interopRequireDefault = __webpack_require__(1);
13598
13599var _promise = _interopRequireDefault(__webpack_require__(12));
13600
13601var _ = __webpack_require__(2);
13602/*global navigator: false */
13603
13604
13605module.exports = function (AV) {
13606 /**
13607 * Creates a new GeoPoint with any of the following forms:<br>
13608 * @example
13609 * new GeoPoint(otherGeoPoint)
13610 * new GeoPoint(30, 30)
13611 * new GeoPoint([30, 30])
13612 * new GeoPoint({latitude: 30, longitude: 30})
13613 * new GeoPoint() // defaults to (0, 0)
13614 * @class
13615 *
13616 * <p>Represents a latitude / longitude point that may be associated
13617 * with a key in a AVObject or used as a reference point for geo queries.
13618 * This allows proximity-based queries on the key.</p>
13619 *
13620 * <p>Only one key in a class may contain a GeoPoint.</p>
13621 *
13622 * <p>Example:<pre>
13623 * var point = new AV.GeoPoint(30.0, -20.0);
13624 * var object = new AV.Object("PlaceObject");
13625 * object.set("location", point);
13626 * object.save();</pre></p>
13627 */
13628 AV.GeoPoint = function (arg1, arg2) {
13629 if (_.isArray(arg1)) {
13630 AV.GeoPoint._validate(arg1[0], arg1[1]);
13631
13632 this.latitude = arg1[0];
13633 this.longitude = arg1[1];
13634 } else if (_.isObject(arg1)) {
13635 AV.GeoPoint._validate(arg1.latitude, arg1.longitude);
13636
13637 this.latitude = arg1.latitude;
13638 this.longitude = arg1.longitude;
13639 } else if (_.isNumber(arg1) && _.isNumber(arg2)) {
13640 AV.GeoPoint._validate(arg1, arg2);
13641
13642 this.latitude = arg1;
13643 this.longitude = arg2;
13644 } else {
13645 this.latitude = 0;
13646 this.longitude = 0;
13647 } // Add properties so that anyone using Webkit or Mozilla will get an error
13648 // if they try to set values that are out of bounds.
13649
13650
13651 var self = this;
13652
13653 if (this.__defineGetter__ && this.__defineSetter__) {
13654 // Use _latitude and _longitude to actually store the values, and add
13655 // getters and setters for latitude and longitude.
13656 this._latitude = this.latitude;
13657 this._longitude = this.longitude;
13658
13659 this.__defineGetter__('latitude', function () {
13660 return self._latitude;
13661 });
13662
13663 this.__defineGetter__('longitude', function () {
13664 return self._longitude;
13665 });
13666
13667 this.__defineSetter__('latitude', function (val) {
13668 AV.GeoPoint._validate(val, self.longitude);
13669
13670 self._latitude = val;
13671 });
13672
13673 this.__defineSetter__('longitude', function (val) {
13674 AV.GeoPoint._validate(self.latitude, val);
13675
13676 self._longitude = val;
13677 });
13678 }
13679 };
13680 /**
13681 * @lends AV.GeoPoint.prototype
13682 * @property {float} latitude North-south portion of the coordinate, in range
13683 * [-90, 90]. Throws an exception if set out of range in a modern browser.
13684 * @property {float} longitude East-west portion of the coordinate, in range
13685 * [-180, 180]. Throws if set out of range in a modern browser.
13686 */
13687
13688 /**
13689 * Throws an exception if the given lat-long is out of bounds.
13690 * @private
13691 */
13692
13693
13694 AV.GeoPoint._validate = function (latitude, longitude) {
13695 if (latitude < -90.0) {
13696 throw new Error('AV.GeoPoint latitude ' + latitude + ' < -90.0.');
13697 }
13698
13699 if (latitude > 90.0) {
13700 throw new Error('AV.GeoPoint latitude ' + latitude + ' > 90.0.');
13701 }
13702
13703 if (longitude < -180.0) {
13704 throw new Error('AV.GeoPoint longitude ' + longitude + ' < -180.0.');
13705 }
13706
13707 if (longitude > 180.0) {
13708 throw new Error('AV.GeoPoint longitude ' + longitude + ' > 180.0.');
13709 }
13710 };
13711 /**
13712 * Creates a GeoPoint with the user's current location, if available.
13713 * @return {Promise.<AV.GeoPoint>}
13714 */
13715
13716
13717 AV.GeoPoint.current = function () {
13718 return new _promise.default(function (resolve, reject) {
13719 navigator.geolocation.getCurrentPosition(function (location) {
13720 resolve(new AV.GeoPoint({
13721 latitude: location.coords.latitude,
13722 longitude: location.coords.longitude
13723 }));
13724 }, reject);
13725 });
13726 };
13727
13728 _.extend(AV.GeoPoint.prototype,
13729 /** @lends AV.GeoPoint.prototype */
13730 {
13731 /**
13732 * Returns a JSON representation of the GeoPoint, suitable for AV.
13733 * @return {Object}
13734 */
13735 toJSON: function toJSON() {
13736 AV.GeoPoint._validate(this.latitude, this.longitude);
13737
13738 return {
13739 __type: 'GeoPoint',
13740 latitude: this.latitude,
13741 longitude: this.longitude
13742 };
13743 },
13744
13745 /**
13746 * Returns the distance from this GeoPoint to another in radians.
13747 * @param {AV.GeoPoint} point the other AV.GeoPoint.
13748 * @return {Number}
13749 */
13750 radiansTo: function radiansTo(point) {
13751 var d2r = Math.PI / 180.0;
13752 var lat1rad = this.latitude * d2r;
13753 var long1rad = this.longitude * d2r;
13754 var lat2rad = point.latitude * d2r;
13755 var long2rad = point.longitude * d2r;
13756 var deltaLat = lat1rad - lat2rad;
13757 var deltaLong = long1rad - long2rad;
13758 var sinDeltaLatDiv2 = Math.sin(deltaLat / 2);
13759 var sinDeltaLongDiv2 = Math.sin(deltaLong / 2); // Square of half the straight line chord distance between both points.
13760
13761 var a = sinDeltaLatDiv2 * sinDeltaLatDiv2 + Math.cos(lat1rad) * Math.cos(lat2rad) * sinDeltaLongDiv2 * sinDeltaLongDiv2;
13762 a = Math.min(1.0, a);
13763 return 2 * Math.asin(Math.sqrt(a));
13764 },
13765
13766 /**
13767 * Returns the distance from this GeoPoint to another in kilometers.
13768 * @param {AV.GeoPoint} point the other AV.GeoPoint.
13769 * @return {Number}
13770 */
13771 kilometersTo: function kilometersTo(point) {
13772 return this.radiansTo(point) * 6371.0;
13773 },
13774
13775 /**
13776 * Returns the distance from this GeoPoint to another in miles.
13777 * @param {AV.GeoPoint} point the other AV.GeoPoint.
13778 * @return {Number}
13779 */
13780 milesTo: function milesTo(point) {
13781 return this.radiansTo(point) * 3958.8;
13782 }
13783 });
13784};
13785
13786/***/ }),
13787/* 445 */
13788/***/ (function(module, exports, __webpack_require__) {
13789
13790"use strict";
13791
13792
13793var _ = __webpack_require__(2);
13794
13795module.exports = function (AV) {
13796 var PUBLIC_KEY = '*';
13797 /**
13798 * Creates a new ACL.
13799 * If no argument is given, the ACL has no permissions for anyone.
13800 * If the argument is a AV.User, the ACL will have read and write
13801 * permission for only that user.
13802 * If the argument is any other JSON object, that object will be interpretted
13803 * as a serialized ACL created with toJSON().
13804 * @see AV.Object#setACL
13805 * @class
13806 *
13807 * <p>An ACL, or Access Control List can be added to any
13808 * <code>AV.Object</code> to restrict access to only a subset of users
13809 * of your application.</p>
13810 */
13811
13812 AV.ACL = function (arg1) {
13813 var self = this;
13814 self.permissionsById = {};
13815
13816 if (_.isObject(arg1)) {
13817 if (arg1 instanceof AV.User) {
13818 self.setReadAccess(arg1, true);
13819 self.setWriteAccess(arg1, true);
13820 } else {
13821 if (_.isFunction(arg1)) {
13822 throw new Error('AV.ACL() called with a function. Did you forget ()?');
13823 }
13824
13825 AV._objectEach(arg1, function (accessList, userId) {
13826 if (!_.isString(userId)) {
13827 throw new Error('Tried to create an ACL with an invalid userId.');
13828 }
13829
13830 self.permissionsById[userId] = {};
13831
13832 AV._objectEach(accessList, function (allowed, permission) {
13833 if (permission !== 'read' && permission !== 'write') {
13834 throw new Error('Tried to create an ACL with an invalid permission type.');
13835 }
13836
13837 if (!_.isBoolean(allowed)) {
13838 throw new Error('Tried to create an ACL with an invalid permission value.');
13839 }
13840
13841 self.permissionsById[userId][permission] = allowed;
13842 });
13843 });
13844 }
13845 }
13846 };
13847 /**
13848 * Returns a JSON-encoded version of the ACL.
13849 * @return {Object}
13850 */
13851
13852
13853 AV.ACL.prototype.toJSON = function () {
13854 return _.clone(this.permissionsById);
13855 };
13856
13857 AV.ACL.prototype._setAccess = function (accessType, userId, allowed) {
13858 if (userId instanceof AV.User) {
13859 userId = userId.id;
13860 } else if (userId instanceof AV.Role) {
13861 userId = 'role:' + userId.getName();
13862 }
13863
13864 if (!_.isString(userId)) {
13865 throw new Error('userId must be a string.');
13866 }
13867
13868 if (!_.isBoolean(allowed)) {
13869 throw new Error('allowed must be either true or false.');
13870 }
13871
13872 var permissions = this.permissionsById[userId];
13873
13874 if (!permissions) {
13875 if (!allowed) {
13876 // The user already doesn't have this permission, so no action needed.
13877 return;
13878 } else {
13879 permissions = {};
13880 this.permissionsById[userId] = permissions;
13881 }
13882 }
13883
13884 if (allowed) {
13885 this.permissionsById[userId][accessType] = true;
13886 } else {
13887 delete permissions[accessType];
13888
13889 if (_.isEmpty(permissions)) {
13890 delete this.permissionsById[userId];
13891 }
13892 }
13893 };
13894
13895 AV.ACL.prototype._getAccess = function (accessType, userId) {
13896 if (userId instanceof AV.User) {
13897 userId = userId.id;
13898 } else if (userId instanceof AV.Role) {
13899 userId = 'role:' + userId.getName();
13900 }
13901
13902 var permissions = this.permissionsById[userId];
13903
13904 if (!permissions) {
13905 return false;
13906 }
13907
13908 return permissions[accessType] ? true : false;
13909 };
13910 /**
13911 * Set whether the given user is allowed to read this object.
13912 * @param userId An instance of AV.User or its objectId.
13913 * @param {Boolean} allowed Whether that user should have read access.
13914 */
13915
13916
13917 AV.ACL.prototype.setReadAccess = function (userId, allowed) {
13918 this._setAccess('read', userId, allowed);
13919 };
13920 /**
13921 * Get whether the given user id is *explicitly* allowed to read this object.
13922 * Even if this returns false, the user may still be able to access it if
13923 * getPublicReadAccess returns true or a role that the user belongs to has
13924 * write access.
13925 * @param userId An instance of AV.User or its objectId, or a AV.Role.
13926 * @return {Boolean}
13927 */
13928
13929
13930 AV.ACL.prototype.getReadAccess = function (userId) {
13931 return this._getAccess('read', userId);
13932 };
13933 /**
13934 * Set whether the given user id is allowed to write this object.
13935 * @param userId An instance of AV.User or its objectId, or a AV.Role..
13936 * @param {Boolean} allowed Whether that user should have write access.
13937 */
13938
13939
13940 AV.ACL.prototype.setWriteAccess = function (userId, allowed) {
13941 this._setAccess('write', userId, allowed);
13942 };
13943 /**
13944 * Get whether the given user id is *explicitly* allowed to write this object.
13945 * Even if this returns false, the user may still be able to write it if
13946 * getPublicWriteAccess returns true or a role that the user belongs to has
13947 * write access.
13948 * @param userId An instance of AV.User or its objectId, or a AV.Role.
13949 * @return {Boolean}
13950 */
13951
13952
13953 AV.ACL.prototype.getWriteAccess = function (userId) {
13954 return this._getAccess('write', userId);
13955 };
13956 /**
13957 * Set whether the public is allowed to read this object.
13958 * @param {Boolean} allowed
13959 */
13960
13961
13962 AV.ACL.prototype.setPublicReadAccess = function (allowed) {
13963 this.setReadAccess(PUBLIC_KEY, allowed);
13964 };
13965 /**
13966 * Get whether the public is allowed to read this object.
13967 * @return {Boolean}
13968 */
13969
13970
13971 AV.ACL.prototype.getPublicReadAccess = function () {
13972 return this.getReadAccess(PUBLIC_KEY);
13973 };
13974 /**
13975 * Set whether the public is allowed to write this object.
13976 * @param {Boolean} allowed
13977 */
13978
13979
13980 AV.ACL.prototype.setPublicWriteAccess = function (allowed) {
13981 this.setWriteAccess(PUBLIC_KEY, allowed);
13982 };
13983 /**
13984 * Get whether the public is allowed to write this object.
13985 * @return {Boolean}
13986 */
13987
13988
13989 AV.ACL.prototype.getPublicWriteAccess = function () {
13990 return this.getWriteAccess(PUBLIC_KEY);
13991 };
13992 /**
13993 * Get whether users belonging to the given role are allowed
13994 * to read this object. Even if this returns false, the role may
13995 * still be able to write it if a parent role has read access.
13996 *
13997 * @param role The name of the role, or a AV.Role object.
13998 * @return {Boolean} true if the role has read access. false otherwise.
13999 * @throws {String} If role is neither a AV.Role nor a String.
14000 */
14001
14002
14003 AV.ACL.prototype.getRoleReadAccess = function (role) {
14004 if (role instanceof AV.Role) {
14005 // Normalize to the String name
14006 role = role.getName();
14007 }
14008
14009 if (_.isString(role)) {
14010 return this.getReadAccess('role:' + role);
14011 }
14012
14013 throw new Error('role must be a AV.Role or a String');
14014 };
14015 /**
14016 * Get whether users belonging to the given role are allowed
14017 * to write this object. Even if this returns false, the role may
14018 * still be able to write it if a parent role has write access.
14019 *
14020 * @param role The name of the role, or a AV.Role object.
14021 * @return {Boolean} true if the role has write access. false otherwise.
14022 * @throws {String} If role is neither a AV.Role nor a String.
14023 */
14024
14025
14026 AV.ACL.prototype.getRoleWriteAccess = function (role) {
14027 if (role instanceof AV.Role) {
14028 // Normalize to the String name
14029 role = role.getName();
14030 }
14031
14032 if (_.isString(role)) {
14033 return this.getWriteAccess('role:' + role);
14034 }
14035
14036 throw new Error('role must be a AV.Role or a String');
14037 };
14038 /**
14039 * Set whether users belonging to the given role are allowed
14040 * to read this object.
14041 *
14042 * @param role The name of the role, or a AV.Role object.
14043 * @param {Boolean} allowed Whether the given role can read this object.
14044 * @throws {String} If role is neither a AV.Role nor a String.
14045 */
14046
14047
14048 AV.ACL.prototype.setRoleReadAccess = function (role, allowed) {
14049 if (role instanceof AV.Role) {
14050 // Normalize to the String name
14051 role = role.getName();
14052 }
14053
14054 if (_.isString(role)) {
14055 this.setReadAccess('role:' + role, allowed);
14056 return;
14057 }
14058
14059 throw new Error('role must be a AV.Role or a String');
14060 };
14061 /**
14062 * Set whether users belonging to the given role are allowed
14063 * to write this object.
14064 *
14065 * @param role The name of the role, or a AV.Role object.
14066 * @param {Boolean} allowed Whether the given role can write this object.
14067 * @throws {String} If role is neither a AV.Role nor a String.
14068 */
14069
14070
14071 AV.ACL.prototype.setRoleWriteAccess = function (role, allowed) {
14072 if (role instanceof AV.Role) {
14073 // Normalize to the String name
14074 role = role.getName();
14075 }
14076
14077 if (_.isString(role)) {
14078 this.setWriteAccess('role:' + role, allowed);
14079 return;
14080 }
14081
14082 throw new Error('role must be a AV.Role or a String');
14083 };
14084};
14085
14086/***/ }),
14087/* 446 */
14088/***/ (function(module, exports, __webpack_require__) {
14089
14090"use strict";
14091
14092
14093var _interopRequireDefault = __webpack_require__(1);
14094
14095var _concat = _interopRequireDefault(__webpack_require__(30));
14096
14097var _find = _interopRequireDefault(__webpack_require__(110));
14098
14099var _indexOf = _interopRequireDefault(__webpack_require__(86));
14100
14101var _map = _interopRequireDefault(__webpack_require__(42));
14102
14103var _ = __webpack_require__(2);
14104
14105module.exports = function (AV) {
14106 /**
14107 * @private
14108 * @class
14109 * A AV.Op is an atomic operation that can be applied to a field in a
14110 * AV.Object. For example, calling <code>object.set("foo", "bar")</code>
14111 * is an example of a AV.Op.Set. Calling <code>object.unset("foo")</code>
14112 * is a AV.Op.Unset. These operations are stored in a AV.Object and
14113 * sent to the server as part of <code>object.save()</code> operations.
14114 * Instances of AV.Op should be immutable.
14115 *
14116 * You should not create subclasses of AV.Op or instantiate AV.Op
14117 * directly.
14118 */
14119 AV.Op = function () {
14120 this._initialize.apply(this, arguments);
14121 };
14122
14123 _.extend(AV.Op.prototype,
14124 /** @lends AV.Op.prototype */
14125 {
14126 _initialize: function _initialize() {}
14127 });
14128
14129 _.extend(AV.Op, {
14130 /**
14131 * To create a new Op, call AV.Op._extend();
14132 * @private
14133 */
14134 _extend: AV._extend,
14135 // A map of __op string to decoder function.
14136 _opDecoderMap: {},
14137
14138 /**
14139 * Registers a function to convert a json object with an __op field into an
14140 * instance of a subclass of AV.Op.
14141 * @private
14142 */
14143 _registerDecoder: function _registerDecoder(opName, decoder) {
14144 AV.Op._opDecoderMap[opName] = decoder;
14145 },
14146
14147 /**
14148 * Converts a json object into an instance of a subclass of AV.Op.
14149 * @private
14150 */
14151 _decode: function _decode(json) {
14152 var decoder = AV.Op._opDecoderMap[json.__op];
14153
14154 if (decoder) {
14155 return decoder(json);
14156 } else {
14157 return undefined;
14158 }
14159 }
14160 });
14161 /*
14162 * Add a handler for Batch ops.
14163 */
14164
14165
14166 AV.Op._registerDecoder('Batch', function (json) {
14167 var op = null;
14168
14169 AV._arrayEach(json.ops, function (nextOp) {
14170 nextOp = AV.Op._decode(nextOp);
14171 op = nextOp._mergeWithPrevious(op);
14172 });
14173
14174 return op;
14175 });
14176 /**
14177 * @private
14178 * @class
14179 * A Set operation indicates that either the field was changed using
14180 * AV.Object.set, or it is a mutable container that was detected as being
14181 * changed.
14182 */
14183
14184
14185 AV.Op.Set = AV.Op._extend(
14186 /** @lends AV.Op.Set.prototype */
14187 {
14188 _initialize: function _initialize(value) {
14189 this._value = value;
14190 },
14191
14192 /**
14193 * Returns the new value of this field after the set.
14194 */
14195 value: function value() {
14196 return this._value;
14197 },
14198
14199 /**
14200 * Returns a JSON version of the operation suitable for sending to AV.
14201 * @return {Object}
14202 */
14203 toJSON: function toJSON() {
14204 return AV._encode(this.value());
14205 },
14206 _mergeWithPrevious: function _mergeWithPrevious(previous) {
14207 return this;
14208 },
14209 _estimate: function _estimate(oldValue) {
14210 return this.value();
14211 }
14212 });
14213 /**
14214 * A sentinel value that is returned by AV.Op.Unset._estimate to
14215 * indicate the field should be deleted. Basically, if you find _UNSET as a
14216 * value in your object, you should remove that key.
14217 */
14218
14219 AV.Op._UNSET = {};
14220 /**
14221 * @private
14222 * @class
14223 * An Unset operation indicates that this field has been deleted from the
14224 * object.
14225 */
14226
14227 AV.Op.Unset = AV.Op._extend(
14228 /** @lends AV.Op.Unset.prototype */
14229 {
14230 /**
14231 * Returns a JSON version of the operation suitable for sending to AV.
14232 * @return {Object}
14233 */
14234 toJSON: function toJSON() {
14235 return {
14236 __op: 'Delete'
14237 };
14238 },
14239 _mergeWithPrevious: function _mergeWithPrevious(previous) {
14240 return this;
14241 },
14242 _estimate: function _estimate(oldValue) {
14243 return AV.Op._UNSET;
14244 }
14245 });
14246
14247 AV.Op._registerDecoder('Delete', function (json) {
14248 return new AV.Op.Unset();
14249 });
14250 /**
14251 * @private
14252 * @class
14253 * An Increment is an atomic operation where the numeric value for the field
14254 * will be increased by a given amount.
14255 */
14256
14257
14258 AV.Op.Increment = AV.Op._extend(
14259 /** @lends AV.Op.Increment.prototype */
14260 {
14261 _initialize: function _initialize(amount) {
14262 this._amount = amount;
14263 },
14264
14265 /**
14266 * Returns the amount to increment by.
14267 * @return {Number} the amount to increment by.
14268 */
14269 amount: function amount() {
14270 return this._amount;
14271 },
14272
14273 /**
14274 * Returns a JSON version of the operation suitable for sending to AV.
14275 * @return {Object}
14276 */
14277 toJSON: function toJSON() {
14278 return {
14279 __op: 'Increment',
14280 amount: this._amount
14281 };
14282 },
14283 _mergeWithPrevious: function _mergeWithPrevious(previous) {
14284 if (!previous) {
14285 return this;
14286 } else if (previous instanceof AV.Op.Unset) {
14287 return new AV.Op.Set(this.amount());
14288 } else if (previous instanceof AV.Op.Set) {
14289 return new AV.Op.Set(previous.value() + this.amount());
14290 } else if (previous instanceof AV.Op.Increment) {
14291 return new AV.Op.Increment(this.amount() + previous.amount());
14292 } else {
14293 throw new Error('Op is invalid after previous op.');
14294 }
14295 },
14296 _estimate: function _estimate(oldValue) {
14297 if (!oldValue) {
14298 return this.amount();
14299 }
14300
14301 return oldValue + this.amount();
14302 }
14303 });
14304
14305 AV.Op._registerDecoder('Increment', function (json) {
14306 return new AV.Op.Increment(json.amount);
14307 });
14308 /**
14309 * @private
14310 * @class
14311 * BitAnd is an atomic operation where the given value will be bit and to the
14312 * value than is stored in this field.
14313 */
14314
14315
14316 AV.Op.BitAnd = AV.Op._extend(
14317 /** @lends AV.Op.BitAnd.prototype */
14318 {
14319 _initialize: function _initialize(value) {
14320 this._value = value;
14321 },
14322 value: function value() {
14323 return this._value;
14324 },
14325
14326 /**
14327 * Returns a JSON version of the operation suitable for sending to AV.
14328 * @return {Object}
14329 */
14330 toJSON: function toJSON() {
14331 return {
14332 __op: 'BitAnd',
14333 value: this.value()
14334 };
14335 },
14336 _mergeWithPrevious: function _mergeWithPrevious(previous) {
14337 if (!previous) {
14338 return this;
14339 } else if (previous instanceof AV.Op.Unset) {
14340 return new AV.Op.Set(0);
14341 } else if (previous instanceof AV.Op.Set) {
14342 return new AV.Op.Set(previous.value() & this.value());
14343 } else {
14344 throw new Error('Op is invalid after previous op.');
14345 }
14346 },
14347 _estimate: function _estimate(oldValue) {
14348 return oldValue & this.value();
14349 }
14350 });
14351
14352 AV.Op._registerDecoder('BitAnd', function (json) {
14353 return new AV.Op.BitAnd(json.value);
14354 });
14355 /**
14356 * @private
14357 * @class
14358 * BitOr is an atomic operation where the given value will be bit and to the
14359 * value than is stored in this field.
14360 */
14361
14362
14363 AV.Op.BitOr = AV.Op._extend(
14364 /** @lends AV.Op.BitOr.prototype */
14365 {
14366 _initialize: function _initialize(value) {
14367 this._value = value;
14368 },
14369 value: function value() {
14370 return this._value;
14371 },
14372
14373 /**
14374 * Returns a JSON version of the operation suitable for sending to AV.
14375 * @return {Object}
14376 */
14377 toJSON: function toJSON() {
14378 return {
14379 __op: 'BitOr',
14380 value: this.value()
14381 };
14382 },
14383 _mergeWithPrevious: function _mergeWithPrevious(previous) {
14384 if (!previous) {
14385 return this;
14386 } else if (previous instanceof AV.Op.Unset) {
14387 return new AV.Op.Set(this.value());
14388 } else if (previous instanceof AV.Op.Set) {
14389 return new AV.Op.Set(previous.value() | this.value());
14390 } else {
14391 throw new Error('Op is invalid after previous op.');
14392 }
14393 },
14394 _estimate: function _estimate(oldValue) {
14395 return oldValue | this.value();
14396 }
14397 });
14398
14399 AV.Op._registerDecoder('BitOr', function (json) {
14400 return new AV.Op.BitOr(json.value);
14401 });
14402 /**
14403 * @private
14404 * @class
14405 * BitXor is an atomic operation where the given value will be bit and to the
14406 * value than is stored in this field.
14407 */
14408
14409
14410 AV.Op.BitXor = AV.Op._extend(
14411 /** @lends AV.Op.BitXor.prototype */
14412 {
14413 _initialize: function _initialize(value) {
14414 this._value = value;
14415 },
14416 value: function value() {
14417 return this._value;
14418 },
14419
14420 /**
14421 * Returns a JSON version of the operation suitable for sending to AV.
14422 * @return {Object}
14423 */
14424 toJSON: function toJSON() {
14425 return {
14426 __op: 'BitXor',
14427 value: this.value()
14428 };
14429 },
14430 _mergeWithPrevious: function _mergeWithPrevious(previous) {
14431 if (!previous) {
14432 return this;
14433 } else if (previous instanceof AV.Op.Unset) {
14434 return new AV.Op.Set(this.value());
14435 } else if (previous instanceof AV.Op.Set) {
14436 return new AV.Op.Set(previous.value() ^ this.value());
14437 } else {
14438 throw new Error('Op is invalid after previous op.');
14439 }
14440 },
14441 _estimate: function _estimate(oldValue) {
14442 return oldValue ^ this.value();
14443 }
14444 });
14445
14446 AV.Op._registerDecoder('BitXor', function (json) {
14447 return new AV.Op.BitXor(json.value);
14448 });
14449 /**
14450 * @private
14451 * @class
14452 * Add is an atomic operation where the given objects will be appended to the
14453 * array that is stored in this field.
14454 */
14455
14456
14457 AV.Op.Add = AV.Op._extend(
14458 /** @lends AV.Op.Add.prototype */
14459 {
14460 _initialize: function _initialize(objects) {
14461 this._objects = objects;
14462 },
14463
14464 /**
14465 * Returns the objects to be added to the array.
14466 * @return {Array} The objects to be added to the array.
14467 */
14468 objects: function objects() {
14469 return this._objects;
14470 },
14471
14472 /**
14473 * Returns a JSON version of the operation suitable for sending to AV.
14474 * @return {Object}
14475 */
14476 toJSON: function toJSON() {
14477 return {
14478 __op: 'Add',
14479 objects: AV._encode(this.objects())
14480 };
14481 },
14482 _mergeWithPrevious: function _mergeWithPrevious(previous) {
14483 if (!previous) {
14484 return this;
14485 } else if (previous instanceof AV.Op.Unset) {
14486 return new AV.Op.Set(this.objects());
14487 } else if (previous instanceof AV.Op.Set) {
14488 return new AV.Op.Set(this._estimate(previous.value()));
14489 } else if (previous instanceof AV.Op.Add) {
14490 var _context;
14491
14492 return new AV.Op.Add((0, _concat.default)(_context = previous.objects()).call(_context, this.objects()));
14493 } else {
14494 throw new Error('Op is invalid after previous op.');
14495 }
14496 },
14497 _estimate: function _estimate(oldValue) {
14498 if (!oldValue) {
14499 return _.clone(this.objects());
14500 } else {
14501 return (0, _concat.default)(oldValue).call(oldValue, this.objects());
14502 }
14503 }
14504 });
14505
14506 AV.Op._registerDecoder('Add', function (json) {
14507 return new AV.Op.Add(AV._decode(json.objects));
14508 });
14509 /**
14510 * @private
14511 * @class
14512 * AddUnique is an atomic operation where the given items will be appended to
14513 * the array that is stored in this field only if they were not already
14514 * present in the array.
14515 */
14516
14517
14518 AV.Op.AddUnique = AV.Op._extend(
14519 /** @lends AV.Op.AddUnique.prototype */
14520 {
14521 _initialize: function _initialize(objects) {
14522 this._objects = _.uniq(objects);
14523 },
14524
14525 /**
14526 * Returns the objects to be added to the array.
14527 * @return {Array} The objects to be added to the array.
14528 */
14529 objects: function objects() {
14530 return this._objects;
14531 },
14532
14533 /**
14534 * Returns a JSON version of the operation suitable for sending to AV.
14535 * @return {Object}
14536 */
14537 toJSON: function toJSON() {
14538 return {
14539 __op: 'AddUnique',
14540 objects: AV._encode(this.objects())
14541 };
14542 },
14543 _mergeWithPrevious: function _mergeWithPrevious(previous) {
14544 if (!previous) {
14545 return this;
14546 } else if (previous instanceof AV.Op.Unset) {
14547 return new AV.Op.Set(this.objects());
14548 } else if (previous instanceof AV.Op.Set) {
14549 return new AV.Op.Set(this._estimate(previous.value()));
14550 } else if (previous instanceof AV.Op.AddUnique) {
14551 return new AV.Op.AddUnique(this._estimate(previous.objects()));
14552 } else {
14553 throw new Error('Op is invalid after previous op.');
14554 }
14555 },
14556 _estimate: function _estimate(oldValue) {
14557 if (!oldValue) {
14558 return _.clone(this.objects());
14559 } else {
14560 // We can't just take the _.uniq(_.union(...)) of oldValue and
14561 // this.objects, because the uniqueness may not apply to oldValue
14562 // (especially if the oldValue was set via .set())
14563 var newValue = _.clone(oldValue);
14564
14565 AV._arrayEach(this.objects(), function (obj) {
14566 if (obj instanceof AV.Object && obj.id) {
14567 var matchingObj = (0, _find.default)(_).call(_, newValue, function (anObj) {
14568 return anObj instanceof AV.Object && anObj.id === obj.id;
14569 });
14570
14571 if (!matchingObj) {
14572 newValue.push(obj);
14573 } else {
14574 var index = (0, _indexOf.default)(_).call(_, newValue, matchingObj);
14575 newValue[index] = obj;
14576 }
14577 } else if (!_.contains(newValue, obj)) {
14578 newValue.push(obj);
14579 }
14580 });
14581
14582 return newValue;
14583 }
14584 }
14585 });
14586
14587 AV.Op._registerDecoder('AddUnique', function (json) {
14588 return new AV.Op.AddUnique(AV._decode(json.objects));
14589 });
14590 /**
14591 * @private
14592 * @class
14593 * Remove is an atomic operation where the given objects will be removed from
14594 * the array that is stored in this field.
14595 */
14596
14597
14598 AV.Op.Remove = AV.Op._extend(
14599 /** @lends AV.Op.Remove.prototype */
14600 {
14601 _initialize: function _initialize(objects) {
14602 this._objects = _.uniq(objects);
14603 },
14604
14605 /**
14606 * Returns the objects to be removed from the array.
14607 * @return {Array} The objects to be removed from the array.
14608 */
14609 objects: function objects() {
14610 return this._objects;
14611 },
14612
14613 /**
14614 * Returns a JSON version of the operation suitable for sending to AV.
14615 * @return {Object}
14616 */
14617 toJSON: function toJSON() {
14618 return {
14619 __op: 'Remove',
14620 objects: AV._encode(this.objects())
14621 };
14622 },
14623 _mergeWithPrevious: function _mergeWithPrevious(previous) {
14624 if (!previous) {
14625 return this;
14626 } else if (previous instanceof AV.Op.Unset) {
14627 return previous;
14628 } else if (previous instanceof AV.Op.Set) {
14629 return new AV.Op.Set(this._estimate(previous.value()));
14630 } else if (previous instanceof AV.Op.Remove) {
14631 return new AV.Op.Remove(_.union(previous.objects(), this.objects()));
14632 } else {
14633 throw new Error('Op is invalid after previous op.');
14634 }
14635 },
14636 _estimate: function _estimate(oldValue) {
14637 if (!oldValue) {
14638 return [];
14639 } else {
14640 var newValue = _.difference(oldValue, this.objects()); // If there are saved AV Objects being removed, also remove them.
14641
14642
14643 AV._arrayEach(this.objects(), function (obj) {
14644 if (obj instanceof AV.Object && obj.id) {
14645 newValue = _.reject(newValue, function (other) {
14646 return other instanceof AV.Object && other.id === obj.id;
14647 });
14648 }
14649 });
14650
14651 return newValue;
14652 }
14653 }
14654 });
14655
14656 AV.Op._registerDecoder('Remove', function (json) {
14657 return new AV.Op.Remove(AV._decode(json.objects));
14658 });
14659 /**
14660 * @private
14661 * @class
14662 * A Relation operation indicates that the field is an instance of
14663 * AV.Relation, and objects are being added to, or removed from, that
14664 * relation.
14665 */
14666
14667
14668 AV.Op.Relation = AV.Op._extend(
14669 /** @lends AV.Op.Relation.prototype */
14670 {
14671 _initialize: function _initialize(adds, removes) {
14672 this._targetClassName = null;
14673 var self = this;
14674
14675 var pointerToId = function pointerToId(object) {
14676 if (object instanceof AV.Object) {
14677 if (!object.id) {
14678 throw new Error("You can't add an unsaved AV.Object to a relation.");
14679 }
14680
14681 if (!self._targetClassName) {
14682 self._targetClassName = object.className;
14683 }
14684
14685 if (self._targetClassName !== object.className) {
14686 throw new Error('Tried to create a AV.Relation with 2 different types: ' + self._targetClassName + ' and ' + object.className + '.');
14687 }
14688
14689 return object.id;
14690 }
14691
14692 return object;
14693 };
14694
14695 this.relationsToAdd = _.uniq((0, _map.default)(_).call(_, adds, pointerToId));
14696 this.relationsToRemove = _.uniq((0, _map.default)(_).call(_, removes, pointerToId));
14697 },
14698
14699 /**
14700 * Returns an array of unfetched AV.Object that are being added to the
14701 * relation.
14702 * @return {Array}
14703 */
14704 added: function added() {
14705 var self = this;
14706 return (0, _map.default)(_).call(_, this.relationsToAdd, function (objectId) {
14707 var object = AV.Object._create(self._targetClassName);
14708
14709 object.id = objectId;
14710 return object;
14711 });
14712 },
14713
14714 /**
14715 * Returns an array of unfetched AV.Object that are being removed from
14716 * the relation.
14717 * @return {Array}
14718 */
14719 removed: function removed() {
14720 var self = this;
14721 return (0, _map.default)(_).call(_, this.relationsToRemove, function (objectId) {
14722 var object = AV.Object._create(self._targetClassName);
14723
14724 object.id = objectId;
14725 return object;
14726 });
14727 },
14728
14729 /**
14730 * Returns a JSON version of the operation suitable for sending to AV.
14731 * @return {Object}
14732 */
14733 toJSON: function toJSON() {
14734 var adds = null;
14735 var removes = null;
14736 var self = this;
14737
14738 var idToPointer = function idToPointer(id) {
14739 return {
14740 __type: 'Pointer',
14741 className: self._targetClassName,
14742 objectId: id
14743 };
14744 };
14745
14746 var pointers = null;
14747
14748 if (this.relationsToAdd.length > 0) {
14749 pointers = (0, _map.default)(_).call(_, this.relationsToAdd, idToPointer);
14750 adds = {
14751 __op: 'AddRelation',
14752 objects: pointers
14753 };
14754 }
14755
14756 if (this.relationsToRemove.length > 0) {
14757 pointers = (0, _map.default)(_).call(_, this.relationsToRemove, idToPointer);
14758 removes = {
14759 __op: 'RemoveRelation',
14760 objects: pointers
14761 };
14762 }
14763
14764 if (adds && removes) {
14765 return {
14766 __op: 'Batch',
14767 ops: [adds, removes]
14768 };
14769 }
14770
14771 return adds || removes || {};
14772 },
14773 _mergeWithPrevious: function _mergeWithPrevious(previous) {
14774 if (!previous) {
14775 return this;
14776 } else if (previous instanceof AV.Op.Unset) {
14777 throw new Error("You can't modify a relation after deleting it.");
14778 } else if (previous instanceof AV.Op.Relation) {
14779 if (previous._targetClassName && previous._targetClassName !== this._targetClassName) {
14780 throw new Error('Related object must be of class ' + previous._targetClassName + ', but ' + this._targetClassName + ' was passed in.');
14781 }
14782
14783 var newAdd = _.union(_.difference(previous.relationsToAdd, this.relationsToRemove), this.relationsToAdd);
14784
14785 var newRemove = _.union(_.difference(previous.relationsToRemove, this.relationsToAdd), this.relationsToRemove);
14786
14787 var newRelation = new AV.Op.Relation(newAdd, newRemove);
14788 newRelation._targetClassName = this._targetClassName;
14789 return newRelation;
14790 } else {
14791 throw new Error('Op is invalid after previous op.');
14792 }
14793 },
14794 _estimate: function _estimate(oldValue, object, key) {
14795 if (!oldValue) {
14796 var relation = new AV.Relation(object, key);
14797 relation.targetClassName = this._targetClassName;
14798 } else if (oldValue instanceof AV.Relation) {
14799 if (this._targetClassName) {
14800 if (oldValue.targetClassName) {
14801 if (oldValue.targetClassName !== this._targetClassName) {
14802 throw new Error('Related object must be a ' + oldValue.targetClassName + ', but a ' + this._targetClassName + ' was passed in.');
14803 }
14804 } else {
14805 oldValue.targetClassName = this._targetClassName;
14806 }
14807 }
14808
14809 return oldValue;
14810 } else {
14811 throw new Error('Op is invalid after previous op.');
14812 }
14813 }
14814 });
14815
14816 AV.Op._registerDecoder('AddRelation', function (json) {
14817 return new AV.Op.Relation(AV._decode(json.objects), []);
14818 });
14819
14820 AV.Op._registerDecoder('RemoveRelation', function (json) {
14821 return new AV.Op.Relation([], AV._decode(json.objects));
14822 });
14823};
14824
14825/***/ }),
14826/* 447 */
14827/***/ (function(module, exports, __webpack_require__) {
14828
14829var parent = __webpack_require__(448);
14830
14831module.exports = parent;
14832
14833
14834/***/ }),
14835/* 448 */
14836/***/ (function(module, exports, __webpack_require__) {
14837
14838var isPrototypeOf = __webpack_require__(21);
14839var method = __webpack_require__(449);
14840
14841var ArrayPrototype = Array.prototype;
14842
14843module.exports = function (it) {
14844 var own = it.find;
14845 return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.find) ? method : own;
14846};
14847
14848
14849/***/ }),
14850/* 449 */
14851/***/ (function(module, exports, __webpack_require__) {
14852
14853__webpack_require__(450);
14854var entryVirtual = __webpack_require__(41);
14855
14856module.exports = entryVirtual('Array').find;
14857
14858
14859/***/ }),
14860/* 450 */
14861/***/ (function(module, exports, __webpack_require__) {
14862
14863"use strict";
14864
14865var $ = __webpack_require__(0);
14866var $find = __webpack_require__(66).find;
14867var addToUnscopables = __webpack_require__(159);
14868
14869var FIND = 'find';
14870var SKIPS_HOLES = true;
14871
14872// Shouldn't skip holes
14873if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
14874
14875// `Array.prototype.find` method
14876// https://tc39.es/ecma262/#sec-array.prototype.find
14877$({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
14878 find: function find(callbackfn /* , that = undefined */) {
14879 return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
14880 }
14881});
14882
14883// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
14884addToUnscopables(FIND);
14885
14886
14887/***/ }),
14888/* 451 */
14889/***/ (function(module, exports, __webpack_require__) {
14890
14891"use strict";
14892
14893
14894var _ = __webpack_require__(2);
14895
14896module.exports = function (AV) {
14897 /**
14898 * Creates a new Relation for the given parent object and key. This
14899 * constructor should rarely be used directly, but rather created by
14900 * {@link AV.Object#relation}.
14901 * @param {AV.Object} parent The parent of this relation.
14902 * @param {String} key The key for this relation on the parent.
14903 * @see AV.Object#relation
14904 * @class
14905 *
14906 * <p>
14907 * A class that is used to access all of the children of a many-to-many
14908 * relationship. Each instance of AV.Relation is associated with a
14909 * particular parent object and key.
14910 * </p>
14911 */
14912 AV.Relation = function (parent, key) {
14913 if (!_.isString(key)) {
14914 throw new TypeError('key must be a string');
14915 }
14916
14917 this.parent = parent;
14918 this.key = key;
14919 this.targetClassName = null;
14920 };
14921 /**
14922 * Creates a query that can be used to query the parent objects in this relation.
14923 * @param {String} parentClass The parent class or name.
14924 * @param {String} relationKey The relation field key in parent.
14925 * @param {AV.Object} child The child object.
14926 * @return {AV.Query}
14927 */
14928
14929
14930 AV.Relation.reverseQuery = function (parentClass, relationKey, child) {
14931 var query = new AV.Query(parentClass);
14932 query.equalTo(relationKey, child._toPointer());
14933 return query;
14934 };
14935
14936 _.extend(AV.Relation.prototype,
14937 /** @lends AV.Relation.prototype */
14938 {
14939 /**
14940 * Makes sure that this relation has the right parent and key.
14941 * @private
14942 */
14943 _ensureParentAndKey: function _ensureParentAndKey(parent, key) {
14944 this.parent = this.parent || parent;
14945 this.key = this.key || key;
14946
14947 if (this.parent !== parent) {
14948 throw new Error('Internal Error. Relation retrieved from two different Objects.');
14949 }
14950
14951 if (this.key !== key) {
14952 throw new Error('Internal Error. Relation retrieved from two different keys.');
14953 }
14954 },
14955
14956 /**
14957 * Adds a AV.Object or an array of AV.Objects to the relation.
14958 * @param {AV.Object|AV.Object[]} objects The item or items to add.
14959 */
14960 add: function add(objects) {
14961 if (!_.isArray(objects)) {
14962 objects = [objects];
14963 }
14964
14965 var change = new AV.Op.Relation(objects, []);
14966 this.parent.set(this.key, change);
14967 this.targetClassName = change._targetClassName;
14968 },
14969
14970 /**
14971 * Removes a AV.Object or an array of AV.Objects from this relation.
14972 * @param {AV.Object|AV.Object[]} objects The item or items to remove.
14973 */
14974 remove: function remove(objects) {
14975 if (!_.isArray(objects)) {
14976 objects = [objects];
14977 }
14978
14979 var change = new AV.Op.Relation([], objects);
14980 this.parent.set(this.key, change);
14981 this.targetClassName = change._targetClassName;
14982 },
14983
14984 /**
14985 * Returns a JSON version of the object suitable for saving to disk.
14986 * @return {Object}
14987 */
14988 toJSON: function toJSON() {
14989 return {
14990 __type: 'Relation',
14991 className: this.targetClassName
14992 };
14993 },
14994
14995 /**
14996 * Returns a AV.Query that is limited to objects in this
14997 * relation.
14998 * @return {AV.Query}
14999 */
15000 query: function query() {
15001 var targetClass;
15002 var query;
15003
15004 if (!this.targetClassName) {
15005 targetClass = AV.Object._getSubclass(this.parent.className);
15006 query = new AV.Query(targetClass);
15007 query._defaultParams.redirectClassNameForKey = this.key;
15008 } else {
15009 targetClass = AV.Object._getSubclass(this.targetClassName);
15010 query = new AV.Query(targetClass);
15011 }
15012
15013 query._addCondition('$relatedTo', 'object', this.parent._toPointer());
15014
15015 query._addCondition('$relatedTo', 'key', this.key);
15016
15017 return query;
15018 }
15019 });
15020};
15021
15022/***/ }),
15023/* 452 */
15024/***/ (function(module, exports, __webpack_require__) {
15025
15026"use strict";
15027
15028
15029var _interopRequireDefault = __webpack_require__(1);
15030
15031var _promise = _interopRequireDefault(__webpack_require__(12));
15032
15033var _ = __webpack_require__(2);
15034
15035var cos = __webpack_require__(453);
15036
15037var qiniu = __webpack_require__(454);
15038
15039var s3 = __webpack_require__(501);
15040
15041var AVError = __webpack_require__(43);
15042
15043var _require = __webpack_require__(26),
15044 request = _require.request,
15045 AVRequest = _require._request;
15046
15047var _require2 = __webpack_require__(29),
15048 tap = _require2.tap,
15049 transformFetchOptions = _require2.transformFetchOptions;
15050
15051var debug = __webpack_require__(67)('leancloud:file');
15052
15053var parseBase64 = __webpack_require__(505);
15054
15055module.exports = function (AV) {
15056 // port from browserify path module
15057 // since react-native packager won't shim node modules.
15058 var extname = function extname(path) {
15059 if (!_.isString(path)) return '';
15060 return path.match(/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/)[4];
15061 };
15062
15063 var b64Digit = function b64Digit(number) {
15064 if (number < 26) {
15065 return String.fromCharCode(65 + number);
15066 }
15067
15068 if (number < 52) {
15069 return String.fromCharCode(97 + (number - 26));
15070 }
15071
15072 if (number < 62) {
15073 return String.fromCharCode(48 + (number - 52));
15074 }
15075
15076 if (number === 62) {
15077 return '+';
15078 }
15079
15080 if (number === 63) {
15081 return '/';
15082 }
15083
15084 throw new Error('Tried to encode large digit ' + number + ' in base64.');
15085 };
15086
15087 var encodeBase64 = function encodeBase64(array) {
15088 var chunks = [];
15089 chunks.length = Math.ceil(array.length / 3);
15090
15091 _.times(chunks.length, function (i) {
15092 var b1 = array[i * 3];
15093 var b2 = array[i * 3 + 1] || 0;
15094 var b3 = array[i * 3 + 2] || 0;
15095 var has2 = i * 3 + 1 < array.length;
15096 var has3 = i * 3 + 2 < array.length;
15097 chunks[i] = [b64Digit(b1 >> 2 & 0x3f), b64Digit(b1 << 4 & 0x30 | b2 >> 4 & 0x0f), has2 ? b64Digit(b2 << 2 & 0x3c | b3 >> 6 & 0x03) : '=', has3 ? b64Digit(b3 & 0x3f) : '='].join('');
15098 });
15099
15100 return chunks.join('');
15101 };
15102 /**
15103 * An AV.File is a local representation of a file that is saved to the AV
15104 * cloud.
15105 * @param name {String} The file's name. This will change to a unique value
15106 * once the file has finished saving.
15107 * @param data {Array} The data for the file, as either:
15108 * 1. an Array of byte value Numbers, or
15109 * 2. an Object like { base64: "..." } with a base64-encoded String.
15110 * 3. a Blob(File) selected with a file upload control in a browser.
15111 * 4. an Object like { blob: {uri: "..."} } that mimics Blob
15112 * in some non-browser environments such as React Native.
15113 * 5. a Buffer in Node.js runtime.
15114 * 6. a Stream in Node.js runtime.
15115 *
15116 * For example:<pre>
15117 * var fileUploadControl = $("#profilePhotoFileUpload")[0];
15118 * if (fileUploadControl.files.length > 0) {
15119 * var file = fileUploadControl.files[0];
15120 * var name = "photo.jpg";
15121 * var file = new AV.File(name, file);
15122 * file.save().then(function() {
15123 * // The file has been saved to AV.
15124 * }, function(error) {
15125 * // The file either could not be read, or could not be saved to AV.
15126 * });
15127 * }</pre>
15128 *
15129 * @class
15130 * @param [mimeType] {String} Content-Type header to use for the file. If
15131 * this is omitted, the content type will be inferred from the name's
15132 * extension.
15133 */
15134
15135
15136 AV.File = function (name, data, mimeType) {
15137 this.attributes = {
15138 name: name,
15139 url: '',
15140 metaData: {},
15141 // 用来存储转换后要上传的 base64 String
15142 base64: ''
15143 };
15144
15145 if (_.isString(data)) {
15146 throw new TypeError('Creating an AV.File from a String is not yet supported.');
15147 }
15148
15149 if (_.isArray(data)) {
15150 this.attributes.metaData.size = data.length;
15151 data = {
15152 base64: encodeBase64(data)
15153 };
15154 }
15155
15156 this._extName = '';
15157 this._data = data;
15158 this._uploadHeaders = {};
15159
15160 if (data && data.blob && typeof data.blob.uri === 'string') {
15161 this._extName = extname(data.blob.uri);
15162 }
15163
15164 if (typeof Blob !== 'undefined' && data instanceof Blob) {
15165 if (data.size) {
15166 this.attributes.metaData.size = data.size;
15167 }
15168
15169 if (data.name) {
15170 this._extName = extname(data.name);
15171 }
15172 }
15173
15174 var owner;
15175
15176 if (data && data.owner) {
15177 owner = data.owner;
15178 } else if (!AV._config.disableCurrentUser) {
15179 try {
15180 owner = AV.User.current();
15181 } catch (error) {
15182 if ('SYNC_API_NOT_AVAILABLE' !== error.code) {
15183 throw error;
15184 }
15185 }
15186 }
15187
15188 this.attributes.metaData.owner = owner ? owner.id : 'unknown';
15189 this.set('mime_type', mimeType);
15190 };
15191 /**
15192 * Creates a fresh AV.File object with exists url for saving to AVOS Cloud.
15193 * @param {String} name the file name
15194 * @param {String} url the file url.
15195 * @param {Object} [metaData] the file metadata object.
15196 * @param {String} [type] Content-Type header to use for the file. If
15197 * this is omitted, the content type will be inferred from the name's
15198 * extension.
15199 * @return {AV.File} the file object
15200 */
15201
15202
15203 AV.File.withURL = function (name, url, metaData, type) {
15204 if (!name || !url) {
15205 throw new Error('Please provide file name and url');
15206 }
15207
15208 var file = new AV.File(name, null, type); //copy metaData properties to file.
15209
15210 if (metaData) {
15211 for (var prop in metaData) {
15212 if (!file.attributes.metaData[prop]) file.attributes.metaData[prop] = metaData[prop];
15213 }
15214 }
15215
15216 file.attributes.url = url; //Mark the file is from external source.
15217
15218 file.attributes.metaData.__source = 'external';
15219 file.attributes.metaData.size = 0;
15220 return file;
15221 };
15222 /**
15223 * Creates a file object with exists objectId.
15224 * @param {String} objectId The objectId string
15225 * @return {AV.File} the file object
15226 */
15227
15228
15229 AV.File.createWithoutData = function (objectId) {
15230 if (!objectId) {
15231 throw new TypeError('The objectId must be provided');
15232 }
15233
15234 var file = new AV.File();
15235 file.id = objectId;
15236 return file;
15237 };
15238 /**
15239 * Request file censor.
15240 * @since 4.13.0
15241 * @param {String} objectId
15242 * @return {Promise.<string>}
15243 */
15244
15245
15246 AV.File.censor = function (objectId) {
15247 if (!AV._config.masterKey) {
15248 throw new Error('Cannot censor a file without masterKey');
15249 }
15250
15251 return request({
15252 method: 'POST',
15253 path: "/files/".concat(objectId, "/censor"),
15254 authOptions: {
15255 useMasterKey: true
15256 }
15257 }).then(function (res) {
15258 return res.censorResult;
15259 });
15260 };
15261
15262 _.extend(AV.File.prototype,
15263 /** @lends AV.File.prototype */
15264 {
15265 className: '_File',
15266 _toFullJSON: function _toFullJSON(seenObjects) {
15267 var _this = this;
15268
15269 var full = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
15270
15271 var json = _.clone(this.attributes);
15272
15273 AV._objectEach(json, function (val, key) {
15274 json[key] = AV._encode(val, seenObjects, undefined, full);
15275 });
15276
15277 AV._objectEach(this._operations, function (val, key) {
15278 json[key] = val;
15279 });
15280
15281 if (_.has(this, 'id')) {
15282 json.objectId = this.id;
15283 }
15284
15285 ['createdAt', 'updatedAt'].forEach(function (key) {
15286 if (_.has(_this, key)) {
15287 var val = _this[key];
15288 json[key] = _.isDate(val) ? val.toJSON() : val;
15289 }
15290 });
15291
15292 if (full) {
15293 json.__type = 'File';
15294 }
15295
15296 return json;
15297 },
15298
15299 /**
15300 * Returns a JSON version of the file with meta data.
15301 * Inverse to {@link AV.parseJSON}
15302 * @since 3.0.0
15303 * @return {Object}
15304 */
15305 toFullJSON: function toFullJSON() {
15306 var seenObjects = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
15307 return this._toFullJSON(seenObjects);
15308 },
15309
15310 /**
15311 * Returns a JSON version of the object.
15312 * @return {Object}
15313 */
15314 toJSON: function toJSON(key, holder) {
15315 var seenObjects = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [this];
15316 return this._toFullJSON(seenObjects, false);
15317 },
15318
15319 /**
15320 * Gets a Pointer referencing this file.
15321 * @private
15322 */
15323 _toPointer: function _toPointer() {
15324 return {
15325 __type: 'Pointer',
15326 className: this.className,
15327 objectId: this.id
15328 };
15329 },
15330
15331 /**
15332 * Returns the ACL for this file.
15333 * @returns {AV.ACL} An instance of AV.ACL.
15334 */
15335 getACL: function getACL() {
15336 return this._acl;
15337 },
15338
15339 /**
15340 * Sets the ACL to be used for this file.
15341 * @param {AV.ACL} acl An instance of AV.ACL.
15342 */
15343 setACL: function setACL(acl) {
15344 if (!(acl instanceof AV.ACL)) {
15345 return new AVError(AVError.OTHER_CAUSE, 'ACL must be a AV.ACL.');
15346 }
15347
15348 this._acl = acl;
15349 return this;
15350 },
15351
15352 /**
15353 * Gets the name of the file. Before save is called, this is the filename
15354 * given by the user. After save is called, that name gets prefixed with a
15355 * unique identifier.
15356 */
15357 name: function name() {
15358 return this.get('name');
15359 },
15360
15361 /**
15362 * Gets the url of the file. It is only available after you save the file or
15363 * after you get the file from a AV.Object.
15364 * @return {String}
15365 */
15366 url: function url() {
15367 return this.get('url');
15368 },
15369
15370 /**
15371 * Gets the attributs of the file object.
15372 * @param {String} The attribute name which want to get.
15373 * @returns {Any}
15374 */
15375 get: function get(attrName) {
15376 switch (attrName) {
15377 case 'objectId':
15378 return this.id;
15379
15380 case 'url':
15381 case 'name':
15382 case 'mime_type':
15383 case 'metaData':
15384 case 'createdAt':
15385 case 'updatedAt':
15386 return this.attributes[attrName];
15387
15388 default:
15389 return this.attributes.metaData[attrName];
15390 }
15391 },
15392
15393 /**
15394 * Set the metaData of the file object.
15395 * @param {Object} Object is an key value Object for setting metaData.
15396 * @param {String} attr is an optional metadata key.
15397 * @param {Object} value is an optional metadata value.
15398 * @returns {String|Number|Array|Object}
15399 */
15400 set: function set() {
15401 var _this2 = this;
15402
15403 var set = function set(attrName, value) {
15404 switch (attrName) {
15405 case 'name':
15406 case 'url':
15407 case 'mime_type':
15408 case 'base64':
15409 case 'metaData':
15410 _this2.attributes[attrName] = value;
15411 break;
15412
15413 default:
15414 // File 并非一个 AVObject,不能完全自定义其他属性,所以只能都放在 metaData 上面
15415 _this2.attributes.metaData[attrName] = value;
15416 break;
15417 }
15418 };
15419
15420 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
15421 args[_key] = arguments[_key];
15422 }
15423
15424 switch (args.length) {
15425 case 1:
15426 // 传入一个 Object
15427 for (var k in args[0]) {
15428 set(k, args[0][k]);
15429 }
15430
15431 break;
15432
15433 case 2:
15434 set(args[0], args[1]);
15435 break;
15436 }
15437
15438 return this;
15439 },
15440
15441 /**
15442 * Set a header for the upload request.
15443 * For more infomation, go to https://url.leanapp.cn/avfile-upload-headers
15444 *
15445 * @param {String} key header key
15446 * @param {String} value header value
15447 * @return {AV.File} this
15448 */
15449 setUploadHeader: function setUploadHeader(key, value) {
15450 this._uploadHeaders[key] = value;
15451 return this;
15452 },
15453
15454 /**
15455 * <p>Returns the file's metadata JSON object if no arguments is given.Returns the
15456 * metadata value if a key is given.Set metadata value if key and value are both given.</p>
15457 * <p><pre>
15458 * var metadata = file.metaData(); //Get metadata JSON object.
15459 * var size = file.metaData('size'); // Get the size metadata value.
15460 * file.metaData('format', 'jpeg'); //set metadata attribute and value.
15461 *</pre></p>
15462 * @return {Object} The file's metadata JSON object.
15463 * @param {String} attr an optional metadata key.
15464 * @param {Object} value an optional metadata value.
15465 **/
15466 metaData: function metaData(attr, value) {
15467 if (attr && value) {
15468 this.attributes.metaData[attr] = value;
15469 return this;
15470 } else if (attr && !value) {
15471 return this.attributes.metaData[attr];
15472 } else {
15473 return this.attributes.metaData;
15474 }
15475 },
15476
15477 /**
15478 * 如果文件是图片,获取图片的缩略图URL。可以传入宽度、高度、质量、格式等参数。
15479 * @return {String} 缩略图URL
15480 * @param {Number} width 宽度,单位:像素
15481 * @param {Number} heigth 高度,单位:像素
15482 * @param {Number} quality 质量,1-100的数字,默认100
15483 * @param {Number} scaleToFit 是否将图片自适应大小。默认为true。
15484 * @param {String} fmt 格式,默认为png,也可以为jpeg,gif等格式。
15485 */
15486 thumbnailURL: function thumbnailURL(width, height) {
15487 var quality = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 100;
15488 var scaleToFit = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
15489 var fmt = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'png';
15490 var url = this.attributes.url;
15491
15492 if (!url) {
15493 throw new Error('Invalid url.');
15494 }
15495
15496 if (!width || !height || width <= 0 || height <= 0) {
15497 throw new Error('Invalid width or height value.');
15498 }
15499
15500 if (quality <= 0 || quality > 100) {
15501 throw new Error('Invalid quality value.');
15502 }
15503
15504 var mode = scaleToFit ? 2 : 1;
15505 return url + '?imageView/' + mode + '/w/' + width + '/h/' + height + '/q/' + quality + '/format/' + fmt;
15506 },
15507
15508 /**
15509 * Returns the file's size.
15510 * @return {Number} The file's size in bytes.
15511 **/
15512 size: function size() {
15513 return this.metaData().size;
15514 },
15515
15516 /**
15517 * Returns the file's owner.
15518 * @return {String} The file's owner id.
15519 */
15520 ownerId: function ownerId() {
15521 return this.metaData().owner;
15522 },
15523
15524 /**
15525 * Destroy the file.
15526 * @param {AuthOptions} options
15527 * @return {Promise} A promise that is fulfilled when the destroy
15528 * completes.
15529 */
15530 destroy: function destroy(options) {
15531 if (!this.id) {
15532 return _promise.default.reject(new Error('The file id does not eixst.'));
15533 }
15534
15535 var request = AVRequest('files', null, this.id, 'DELETE', null, options);
15536 return request;
15537 },
15538
15539 /**
15540 * Request Qiniu upload token
15541 * @param {string} type
15542 * @return {Promise} Resolved with the response
15543 * @private
15544 */
15545 _fileToken: function _fileToken(type, authOptions) {
15546 var name = this.attributes.name;
15547 var extName = extname(name);
15548
15549 if (!extName && this._extName) {
15550 name += this._extName;
15551 extName = this._extName;
15552 }
15553
15554 var data = {
15555 name: name,
15556 keep_file_name: authOptions.keepFileName,
15557 key: authOptions.key,
15558 ACL: this._acl,
15559 mime_type: type,
15560 metaData: this.attributes.metaData
15561 };
15562 return AVRequest('fileTokens', null, null, 'POST', data, authOptions);
15563 },
15564
15565 /**
15566 * @callback UploadProgressCallback
15567 * @param {XMLHttpRequestProgressEvent} event - The progress event with 'loaded' and 'total' attributes
15568 */
15569
15570 /**
15571 * Saves the file to the AV cloud.
15572 * @param {AuthOptions} [options] AuthOptions plus:
15573 * @param {UploadProgressCallback} [options.onprogress] 文件上传进度,在 Node.js 中无效,回调参数说明详见 {@link UploadProgressCallback}。
15574 * @param {boolean} [options.keepFileName = false] 保留下载文件的文件名。
15575 * @param {string} [options.key] 指定文件的 key。设置该选项需要使用 masterKey
15576 * @return {Promise} Promise that is resolved when the save finishes.
15577 */
15578 save: function save() {
15579 var _this3 = this;
15580
15581 var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
15582
15583 if (this.id) {
15584 throw new Error('File is already saved.');
15585 }
15586
15587 if (!this._previousSave) {
15588 if (this._data) {
15589 var mimeType = this.get('mime_type');
15590 this._previousSave = this._fileToken(mimeType, options).then(function (uploadInfo) {
15591 if (uploadInfo.mime_type) {
15592 mimeType = uploadInfo.mime_type;
15593
15594 _this3.set('mime_type', mimeType);
15595 }
15596
15597 _this3._token = uploadInfo.token;
15598 return _promise.default.resolve().then(function () {
15599 var data = _this3._data;
15600
15601 if (data && data.base64) {
15602 return parseBase64(data.base64, mimeType);
15603 }
15604
15605 if (data && data.blob) {
15606 if (!data.blob.type && mimeType) {
15607 data.blob.type = mimeType;
15608 }
15609
15610 if (!data.blob.name) {
15611 data.blob.name = _this3.get('name');
15612 }
15613
15614 return data.blob;
15615 }
15616
15617 if (typeof Blob !== 'undefined' && data instanceof Blob) {
15618 return data;
15619 }
15620
15621 throw new TypeError('malformed file data');
15622 }).then(function (data) {
15623 var _options = _.extend({}, options); // filter out download progress events
15624
15625
15626 if (options.onprogress) {
15627 _options.onprogress = function (event) {
15628 if (event.direction === 'download') return;
15629 return options.onprogress(event);
15630 };
15631 }
15632
15633 switch (uploadInfo.provider) {
15634 case 's3':
15635 return s3(uploadInfo, data, _this3, _options);
15636
15637 case 'qcloud':
15638 return cos(uploadInfo, data, _this3, _options);
15639
15640 case 'qiniu':
15641 default:
15642 return qiniu(uploadInfo, data, _this3, _options);
15643 }
15644 }).then(tap(function () {
15645 return _this3._callback(true);
15646 }), function (error) {
15647 _this3._callback(false);
15648
15649 throw error;
15650 });
15651 });
15652 } else if (this.attributes.url && this.attributes.metaData.__source === 'external') {
15653 // external link file.
15654 var data = {
15655 name: this.attributes.name,
15656 ACL: this._acl,
15657 metaData: this.attributes.metaData,
15658 mime_type: this.mimeType,
15659 url: this.attributes.url
15660 };
15661 this._previousSave = AVRequest('files', null, null, 'post', data, options).then(function (response) {
15662 _this3.id = response.objectId;
15663 return _this3;
15664 });
15665 }
15666 }
15667
15668 return this._previousSave;
15669 },
15670 _callback: function _callback(success) {
15671 AVRequest('fileCallback', null, null, 'post', {
15672 token: this._token,
15673 result: success
15674 }).catch(debug);
15675 delete this._token;
15676 delete this._data;
15677 },
15678
15679 /**
15680 * fetch the file from server. If the server's representation of the
15681 * model differs from its current attributes, they will be overriden,
15682 * @param {Object} fetchOptions Optional options to set 'keys',
15683 * 'include' and 'includeACL' option.
15684 * @param {AuthOptions} options
15685 * @return {Promise} A promise that is fulfilled when the fetch
15686 * completes.
15687 */
15688 fetch: function fetch(fetchOptions, options) {
15689 if (!this.id) {
15690 throw new Error('Cannot fetch unsaved file');
15691 }
15692
15693 var request = AVRequest('files', null, this.id, 'GET', transformFetchOptions(fetchOptions), options);
15694 return request.then(this._finishFetch.bind(this));
15695 },
15696 _finishFetch: function _finishFetch(response) {
15697 var value = AV.Object.prototype.parse(response);
15698 value.attributes = {
15699 name: value.name,
15700 url: value.url,
15701 mime_type: value.mime_type,
15702 bucket: value.bucket
15703 };
15704 value.attributes.metaData = value.metaData || {};
15705 value.id = value.objectId; // clean
15706
15707 delete value.objectId;
15708 delete value.metaData;
15709 delete value.url;
15710 delete value.name;
15711 delete value.mime_type;
15712 delete value.bucket;
15713
15714 _.extend(this, value);
15715
15716 return this;
15717 },
15718
15719 /**
15720 * Request file censor
15721 * @since 4.13.0
15722 * @return {Promise.<string>}
15723 */
15724 censor: function censor() {
15725 if (!this.id) {
15726 throw new Error('Cannot censor an unsaved file');
15727 }
15728
15729 return AV.File.censor(this.id);
15730 }
15731 });
15732};
15733
15734/***/ }),
15735/* 453 */
15736/***/ (function(module, exports, __webpack_require__) {
15737
15738"use strict";
15739
15740
15741var _require = __webpack_require__(68),
15742 getAdapter = _require.getAdapter;
15743
15744var debug = __webpack_require__(67)('cos');
15745
15746module.exports = function (uploadInfo, data, file) {
15747 var saveOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
15748 var url = uploadInfo.upload_url + '?sign=' + encodeURIComponent(uploadInfo.token);
15749 var fileFormData = {
15750 field: 'fileContent',
15751 data: data,
15752 name: file.attributes.name
15753 };
15754 var options = {
15755 headers: file._uploadHeaders,
15756 data: {
15757 op: 'upload'
15758 },
15759 onprogress: saveOptions.onprogress
15760 };
15761 debug('url: %s, file: %o, options: %o', url, fileFormData, options);
15762 var upload = getAdapter('upload');
15763 return upload(url, fileFormData, options).then(function (response) {
15764 debug(response.status, response.data);
15765
15766 if (response.ok === false) {
15767 var error = new Error(response.status);
15768 error.response = response;
15769 throw error;
15770 }
15771
15772 file.attributes.url = uploadInfo.url;
15773 file._bucket = uploadInfo.bucket;
15774 file.id = uploadInfo.objectId;
15775 return file;
15776 }, function (error) {
15777 var response = error.response;
15778
15779 if (response) {
15780 debug(response.status, response.data);
15781 error.statusCode = response.status;
15782 error.response = response.data;
15783 }
15784
15785 throw error;
15786 });
15787};
15788
15789/***/ }),
15790/* 454 */
15791/***/ (function(module, exports, __webpack_require__) {
15792
15793"use strict";
15794
15795
15796var _sliceInstanceProperty2 = __webpack_require__(87);
15797
15798var _Array$from = __webpack_require__(455);
15799
15800var _Symbol = __webpack_require__(240);
15801
15802var _getIteratorMethod = __webpack_require__(241);
15803
15804var _Reflect$construct = __webpack_require__(465);
15805
15806var _interopRequireDefault = __webpack_require__(1);
15807
15808var _inherits2 = _interopRequireDefault(__webpack_require__(469));
15809
15810var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(491));
15811
15812var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(493));
15813
15814var _classCallCheck2 = _interopRequireDefault(__webpack_require__(498));
15815
15816var _createClass2 = _interopRequireDefault(__webpack_require__(499));
15817
15818var _stringify = _interopRequireDefault(__webpack_require__(36));
15819
15820var _concat = _interopRequireDefault(__webpack_require__(30));
15821
15822var _promise = _interopRequireDefault(__webpack_require__(12));
15823
15824var _slice = _interopRequireDefault(__webpack_require__(87));
15825
15826function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
15827
15828function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
15829
15830function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
15831
15832function _unsupportedIterableToArray(o, minLen) { var _context8; if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = _sliceInstanceProperty2(_context8 = Object.prototype.toString.call(o)).call(_context8, 8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return _Array$from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
15833
15834function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
15835
15836var _require = __webpack_require__(68),
15837 getAdapter = _require.getAdapter;
15838
15839var debug = __webpack_require__(67)('leancloud:qiniu');
15840
15841var ajax = __webpack_require__(108);
15842
15843var btoa = __webpack_require__(500);
15844
15845var SHARD_THRESHOLD = 1024 * 1024 * 64;
15846var CHUNK_SIZE = 1024 * 1024 * 16;
15847
15848function upload(uploadInfo, data, file) {
15849 var saveOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
15850 // Get the uptoken to upload files to qiniu.
15851 var uptoken = uploadInfo.token;
15852 var url = uploadInfo.upload_url || 'https://upload.qiniup.com';
15853 var fileFormData = {
15854 field: 'file',
15855 data: data,
15856 name: file.attributes.name
15857 };
15858 var options = {
15859 headers: file._uploadHeaders,
15860 data: {
15861 name: file.attributes.name,
15862 key: uploadInfo.key,
15863 token: uptoken
15864 },
15865 onprogress: saveOptions.onprogress
15866 };
15867 debug('url: %s, file: %o, options: %o', url, fileFormData, options);
15868 var upload = getAdapter('upload');
15869 return upload(url, fileFormData, options).then(function (response) {
15870 debug(response.status, response.data);
15871
15872 if (response.ok === false) {
15873 var message = response.status;
15874
15875 if (response.data) {
15876 if (response.data.error) {
15877 message = response.data.error;
15878 } else {
15879 message = (0, _stringify.default)(response.data);
15880 }
15881 }
15882
15883 var error = new Error(message);
15884 error.response = response;
15885 throw error;
15886 }
15887
15888 file.attributes.url = uploadInfo.url;
15889 file._bucket = uploadInfo.bucket;
15890 file.id = uploadInfo.objectId;
15891 return file;
15892 }, function (error) {
15893 var response = error.response;
15894
15895 if (response) {
15896 debug(response.status, response.data);
15897 error.statusCode = response.status;
15898 error.response = response.data;
15899 }
15900
15901 throw error;
15902 });
15903}
15904
15905function urlSafeBase64(string) {
15906 var base64 = btoa(unescape(encodeURIComponent(string)));
15907 var result = '';
15908
15909 var _iterator = _createForOfIteratorHelper(base64),
15910 _step;
15911
15912 try {
15913 for (_iterator.s(); !(_step = _iterator.n()).done;) {
15914 var ch = _step.value;
15915
15916 switch (ch) {
15917 case '+':
15918 result += '-';
15919 break;
15920
15921 case '/':
15922 result += '_';
15923 break;
15924
15925 default:
15926 result += ch;
15927 }
15928 }
15929 } catch (err) {
15930 _iterator.e(err);
15931 } finally {
15932 _iterator.f();
15933 }
15934
15935 return result;
15936}
15937
15938var ShardUploader = /*#__PURE__*/function () {
15939 function ShardUploader(uploadInfo, data, file, saveOptions) {
15940 var _context,
15941 _context2,
15942 _this = this;
15943
15944 (0, _classCallCheck2.default)(this, ShardUploader);
15945 this.uploadInfo = uploadInfo;
15946 this.data = data;
15947 this.file = file;
15948 this.size = undefined;
15949 this.offset = 0;
15950 this.uploadedChunks = 0;
15951 var key = urlSafeBase64(uploadInfo.key);
15952 var uploadURL = uploadInfo.upload_url || 'https://upload.qiniup.com';
15953 this.baseURL = (0, _concat.default)(_context = (0, _concat.default)(_context2 = "".concat(uploadURL, "/buckets/")).call(_context2, uploadInfo.bucket, "/objects/")).call(_context, key, "/uploads");
15954 this.upToken = 'UpToken ' + uploadInfo.token;
15955 this.uploaded = 0;
15956
15957 if (saveOptions && saveOptions.onprogress) {
15958 this.onProgress = function (_ref) {
15959 var loaded = _ref.loaded;
15960 loaded += _this.uploadedChunks * CHUNK_SIZE;
15961
15962 if (loaded <= _this.uploaded) {
15963 return;
15964 }
15965
15966 if (_this.size) {
15967 saveOptions.onprogress({
15968 loaded: loaded,
15969 total: _this.size,
15970 percent: loaded / _this.size * 100
15971 });
15972 } else {
15973 saveOptions.onprogress({
15974 loaded: loaded
15975 });
15976 }
15977
15978 _this.uploaded = loaded;
15979 };
15980 }
15981 }
15982 /**
15983 * @returns {Promise<string>}
15984 */
15985
15986
15987 (0, _createClass2.default)(ShardUploader, [{
15988 key: "getUploadId",
15989 value: function getUploadId() {
15990 return ajax({
15991 method: 'POST',
15992 url: this.baseURL,
15993 headers: {
15994 Authorization: this.upToken
15995 }
15996 }).then(function (res) {
15997 return res.uploadId;
15998 });
15999 }
16000 }, {
16001 key: "getChunk",
16002 value: function getChunk() {
16003 throw new Error('Not implemented');
16004 }
16005 /**
16006 * @param {string} uploadId
16007 * @param {number} partNumber
16008 * @param {any} data
16009 * @returns {Promise<{ partNumber: number, etag: string }>}
16010 */
16011
16012 }, {
16013 key: "uploadPart",
16014 value: function uploadPart(uploadId, partNumber, data) {
16015 var _context3, _context4;
16016
16017 return ajax({
16018 method: 'PUT',
16019 url: (0, _concat.default)(_context3 = (0, _concat.default)(_context4 = "".concat(this.baseURL, "/")).call(_context4, uploadId, "/")).call(_context3, partNumber),
16020 headers: {
16021 Authorization: this.upToken
16022 },
16023 data: data,
16024 onprogress: this.onProgress
16025 }).then(function (_ref2) {
16026 var etag = _ref2.etag;
16027 return {
16028 partNumber: partNumber,
16029 etag: etag
16030 };
16031 });
16032 }
16033 }, {
16034 key: "stopUpload",
16035 value: function stopUpload(uploadId) {
16036 var _context5;
16037
16038 return ajax({
16039 method: 'DELETE',
16040 url: (0, _concat.default)(_context5 = "".concat(this.baseURL, "/")).call(_context5, uploadId),
16041 headers: {
16042 Authorization: this.upToken
16043 }
16044 });
16045 }
16046 }, {
16047 key: "upload",
16048 value: function upload() {
16049 var _this2 = this;
16050
16051 var parts = [];
16052 return this.getUploadId().then(function (uploadId) {
16053 var uploadPart = function uploadPart() {
16054 return _promise.default.resolve(_this2.getChunk()).then(function (chunk) {
16055 if (!chunk) {
16056 return;
16057 }
16058
16059 var partNumber = parts.length + 1;
16060 return _this2.uploadPart(uploadId, partNumber, chunk).then(function (part) {
16061 parts.push(part);
16062 _this2.uploadedChunks++;
16063 return uploadPart();
16064 });
16065 }).catch(function (error) {
16066 return _this2.stopUpload(uploadId).then(function () {
16067 return _promise.default.reject(error);
16068 });
16069 });
16070 };
16071
16072 return uploadPart().then(function () {
16073 var _context6;
16074
16075 return ajax({
16076 method: 'POST',
16077 url: (0, _concat.default)(_context6 = "".concat(_this2.baseURL, "/")).call(_context6, uploadId),
16078 headers: {
16079 Authorization: _this2.upToken
16080 },
16081 data: {
16082 parts: parts,
16083 fname: _this2.file.attributes.name,
16084 mimeType: _this2.file.attributes.mime_type
16085 }
16086 });
16087 });
16088 }).then(function () {
16089 _this2.file.attributes.url = _this2.uploadInfo.url;
16090 _this2.file._bucket = _this2.uploadInfo.bucket;
16091 _this2.file.id = _this2.uploadInfo.objectId;
16092 return _this2.file;
16093 });
16094 }
16095 }]);
16096 return ShardUploader;
16097}();
16098
16099var BlobUploader = /*#__PURE__*/function (_ShardUploader) {
16100 (0, _inherits2.default)(BlobUploader, _ShardUploader);
16101
16102 var _super = _createSuper(BlobUploader);
16103
16104 function BlobUploader(uploadInfo, data, file, saveOptions) {
16105 var _this3;
16106
16107 (0, _classCallCheck2.default)(this, BlobUploader);
16108 _this3 = _super.call(this, uploadInfo, data, file, saveOptions);
16109 _this3.size = data.size;
16110 return _this3;
16111 }
16112 /**
16113 * @returns {Blob | null}
16114 */
16115
16116
16117 (0, _createClass2.default)(BlobUploader, [{
16118 key: "getChunk",
16119 value: function getChunk() {
16120 var _context7;
16121
16122 if (this.offset >= this.size) {
16123 return null;
16124 }
16125
16126 var chunk = (0, _slice.default)(_context7 = this.data).call(_context7, this.offset, this.offset + CHUNK_SIZE);
16127 this.offset += chunk.size;
16128 return chunk;
16129 }
16130 }]);
16131 return BlobUploader;
16132}(ShardUploader);
16133
16134function isBlob(data) {
16135 return typeof Blob !== 'undefined' && data instanceof Blob;
16136}
16137
16138module.exports = function (uploadInfo, data, file) {
16139 var saveOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
16140
16141 if (isBlob(data) && data.size >= SHARD_THRESHOLD) {
16142 return new BlobUploader(uploadInfo, data, file, saveOptions).upload();
16143 }
16144
16145 return upload(uploadInfo, data, file, saveOptions);
16146};
16147
16148/***/ }),
16149/* 455 */
16150/***/ (function(module, exports, __webpack_require__) {
16151
16152module.exports = __webpack_require__(239);
16153
16154/***/ }),
16155/* 456 */
16156/***/ (function(module, exports, __webpack_require__) {
16157
16158__webpack_require__(78);
16159__webpack_require__(457);
16160var path = __webpack_require__(10);
16161
16162module.exports = path.Array.from;
16163
16164
16165/***/ }),
16166/* 457 */
16167/***/ (function(module, exports, __webpack_require__) {
16168
16169var $ = __webpack_require__(0);
16170var from = __webpack_require__(458);
16171var checkCorrectnessOfIteration = __webpack_require__(168);
16172
16173var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function (iterable) {
16174 // eslint-disable-next-line es-x/no-array-from -- required for testing
16175 Array.from(iterable);
16176});
16177
16178// `Array.from` method
16179// https://tc39.es/ecma262/#sec-array.from
16180$({ target: 'Array', stat: true, forced: INCORRECT_ITERATION }, {
16181 from: from
16182});
16183
16184
16185/***/ }),
16186/* 458 */
16187/***/ (function(module, exports, __webpack_require__) {
16188
16189"use strict";
16190
16191var bind = __webpack_require__(45);
16192var call = __webpack_require__(13);
16193var toObject = __webpack_require__(34);
16194var callWithSafeIterationClosing = __webpack_require__(459);
16195var isArrayIteratorMethod = __webpack_require__(156);
16196var isConstructor = __webpack_require__(101);
16197var lengthOfArrayLike = __webpack_require__(46);
16198var createProperty = __webpack_require__(106);
16199var getIterator = __webpack_require__(157);
16200var getIteratorMethod = __webpack_require__(99);
16201
16202var $Array = Array;
16203
16204// `Array.from` method implementation
16205// https://tc39.es/ecma262/#sec-array.from
16206module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
16207 var O = toObject(arrayLike);
16208 var IS_CONSTRUCTOR = isConstructor(this);
16209 var argumentsLength = arguments.length;
16210 var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
16211 var mapping = mapfn !== undefined;
16212 if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined);
16213 var iteratorMethod = getIteratorMethod(O);
16214 var index = 0;
16215 var length, result, step, iterator, next, value;
16216 // if the target is not iterable or it's an array with the default iterator - use a simple case
16217 if (iteratorMethod && !(this === $Array && isArrayIteratorMethod(iteratorMethod))) {
16218 iterator = getIterator(O, iteratorMethod);
16219 next = iterator.next;
16220 result = IS_CONSTRUCTOR ? new this() : [];
16221 for (;!(step = call(next, iterator)).done; index++) {
16222 value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
16223 createProperty(result, index, value);
16224 }
16225 } else {
16226 length = lengthOfArrayLike(O);
16227 result = IS_CONSTRUCTOR ? new this(length) : $Array(length);
16228 for (;length > index; index++) {
16229 value = mapping ? mapfn(O[index], index) : O[index];
16230 createProperty(result, index, value);
16231 }
16232 }
16233 result.length = index;
16234 return result;
16235};
16236
16237
16238/***/ }),
16239/* 459 */
16240/***/ (function(module, exports, __webpack_require__) {
16241
16242var anObject = __webpack_require__(19);
16243var iteratorClose = __webpack_require__(158);
16244
16245// call something on iterator step with safe closing on error
16246module.exports = function (iterator, fn, value, ENTRIES) {
16247 try {
16248 return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
16249 } catch (error) {
16250 iteratorClose(iterator, 'throw', error);
16251 }
16252};
16253
16254
16255/***/ }),
16256/* 460 */
16257/***/ (function(module, exports, __webpack_require__) {
16258
16259module.exports = __webpack_require__(461);
16260
16261
16262/***/ }),
16263/* 461 */
16264/***/ (function(module, exports, __webpack_require__) {
16265
16266var parent = __webpack_require__(462);
16267
16268module.exports = parent;
16269
16270
16271/***/ }),
16272/* 462 */
16273/***/ (function(module, exports, __webpack_require__) {
16274
16275var parent = __webpack_require__(463);
16276
16277module.exports = parent;
16278
16279
16280/***/ }),
16281/* 463 */
16282/***/ (function(module, exports, __webpack_require__) {
16283
16284var parent = __webpack_require__(464);
16285__webpack_require__(51);
16286
16287module.exports = parent;
16288
16289
16290/***/ }),
16291/* 464 */
16292/***/ (function(module, exports, __webpack_require__) {
16293
16294__webpack_require__(48);
16295__webpack_require__(78);
16296var getIteratorMethod = __webpack_require__(99);
16297
16298module.exports = getIteratorMethod;
16299
16300
16301/***/ }),
16302/* 465 */
16303/***/ (function(module, exports, __webpack_require__) {
16304
16305module.exports = __webpack_require__(466);
16306
16307/***/ }),
16308/* 466 */
16309/***/ (function(module, exports, __webpack_require__) {
16310
16311var parent = __webpack_require__(467);
16312
16313module.exports = parent;
16314
16315
16316/***/ }),
16317/* 467 */
16318/***/ (function(module, exports, __webpack_require__) {
16319
16320__webpack_require__(468);
16321var path = __webpack_require__(10);
16322
16323module.exports = path.Reflect.construct;
16324
16325
16326/***/ }),
16327/* 468 */
16328/***/ (function(module, exports, __webpack_require__) {
16329
16330var $ = __webpack_require__(0);
16331var getBuiltIn = __webpack_require__(18);
16332var apply = __webpack_require__(69);
16333var bind = __webpack_require__(242);
16334var aConstructor = __webpack_require__(164);
16335var anObject = __webpack_require__(19);
16336var isObject = __webpack_require__(11);
16337var create = __webpack_require__(47);
16338var fails = __webpack_require__(3);
16339
16340var nativeConstruct = getBuiltIn('Reflect', 'construct');
16341var ObjectPrototype = Object.prototype;
16342var push = [].push;
16343
16344// `Reflect.construct` method
16345// https://tc39.es/ecma262/#sec-reflect.construct
16346// MS Edge supports only 2 arguments and argumentsList argument is optional
16347// FF Nightly sets third argument as `new.target`, but does not create `this` from it
16348var NEW_TARGET_BUG = fails(function () {
16349 function F() { /* empty */ }
16350 return !(nativeConstruct(function () { /* empty */ }, [], F) instanceof F);
16351});
16352
16353var ARGS_BUG = !fails(function () {
16354 nativeConstruct(function () { /* empty */ });
16355});
16356
16357var FORCED = NEW_TARGET_BUG || ARGS_BUG;
16358
16359$({ target: 'Reflect', stat: true, forced: FORCED, sham: FORCED }, {
16360 construct: function construct(Target, args /* , newTarget */) {
16361 aConstructor(Target);
16362 anObject(args);
16363 var newTarget = arguments.length < 3 ? Target : aConstructor(arguments[2]);
16364 if (ARGS_BUG && !NEW_TARGET_BUG) return nativeConstruct(Target, args, newTarget);
16365 if (Target == newTarget) {
16366 // w/o altered newTarget, optimization for 0-4 arguments
16367 switch (args.length) {
16368 case 0: return new Target();
16369 case 1: return new Target(args[0]);
16370 case 2: return new Target(args[0], args[1]);
16371 case 3: return new Target(args[0], args[1], args[2]);
16372 case 4: return new Target(args[0], args[1], args[2], args[3]);
16373 }
16374 // w/o altered newTarget, lot of arguments case
16375 var $args = [null];
16376 apply(push, $args, args);
16377 return new (apply(bind, Target, $args))();
16378 }
16379 // with altered newTarget, not support built-in constructors
16380 var proto = newTarget.prototype;
16381 var instance = create(isObject(proto) ? proto : ObjectPrototype);
16382 var result = apply(Target, instance, args);
16383 return isObject(result) ? result : instance;
16384 }
16385});
16386
16387
16388/***/ }),
16389/* 469 */
16390/***/ (function(module, exports, __webpack_require__) {
16391
16392var _Object$create = __webpack_require__(470);
16393
16394var _Object$defineProperty = __webpack_require__(145);
16395
16396var setPrototypeOf = __webpack_require__(480);
16397
16398function _inherits(subClass, superClass) {
16399 if (typeof superClass !== "function" && superClass !== null) {
16400 throw new TypeError("Super expression must either be null or a function");
16401 }
16402
16403 subClass.prototype = _Object$create(superClass && superClass.prototype, {
16404 constructor: {
16405 value: subClass,
16406 writable: true,
16407 configurable: true
16408 }
16409 });
16410
16411 _Object$defineProperty(subClass, "prototype", {
16412 writable: false
16413 });
16414
16415 if (superClass) setPrototypeOf(subClass, superClass);
16416}
16417
16418module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports;
16419
16420/***/ }),
16421/* 470 */
16422/***/ (function(module, exports, __webpack_require__) {
16423
16424module.exports = __webpack_require__(471);
16425
16426/***/ }),
16427/* 471 */
16428/***/ (function(module, exports, __webpack_require__) {
16429
16430module.exports = __webpack_require__(472);
16431
16432
16433/***/ }),
16434/* 472 */
16435/***/ (function(module, exports, __webpack_require__) {
16436
16437var parent = __webpack_require__(473);
16438
16439module.exports = parent;
16440
16441
16442/***/ }),
16443/* 473 */
16444/***/ (function(module, exports, __webpack_require__) {
16445
16446var parent = __webpack_require__(474);
16447
16448module.exports = parent;
16449
16450
16451/***/ }),
16452/* 474 */
16453/***/ (function(module, exports, __webpack_require__) {
16454
16455var parent = __webpack_require__(475);
16456
16457module.exports = parent;
16458
16459
16460/***/ }),
16461/* 475 */
16462/***/ (function(module, exports, __webpack_require__) {
16463
16464__webpack_require__(476);
16465var path = __webpack_require__(10);
16466
16467var Object = path.Object;
16468
16469module.exports = function create(P, D) {
16470 return Object.create(P, D);
16471};
16472
16473
16474/***/ }),
16475/* 476 */
16476/***/ (function(module, exports, __webpack_require__) {
16477
16478// TODO: Remove from `core-js@4`
16479var $ = __webpack_require__(0);
16480var DESCRIPTORS = __webpack_require__(16);
16481var create = __webpack_require__(47);
16482
16483// `Object.create` method
16484// https://tc39.es/ecma262/#sec-object.create
16485$({ target: 'Object', stat: true, sham: !DESCRIPTORS }, {
16486 create: create
16487});
16488
16489
16490/***/ }),
16491/* 477 */
16492/***/ (function(module, exports, __webpack_require__) {
16493
16494module.exports = __webpack_require__(478);
16495
16496
16497/***/ }),
16498/* 478 */
16499/***/ (function(module, exports, __webpack_require__) {
16500
16501var parent = __webpack_require__(479);
16502
16503module.exports = parent;
16504
16505
16506/***/ }),
16507/* 479 */
16508/***/ (function(module, exports, __webpack_require__) {
16509
16510var parent = __webpack_require__(230);
16511
16512module.exports = parent;
16513
16514
16515/***/ }),
16516/* 480 */
16517/***/ (function(module, exports, __webpack_require__) {
16518
16519var _Object$setPrototypeOf = __webpack_require__(243);
16520
16521var _bindInstanceProperty = __webpack_require__(244);
16522
16523function _setPrototypeOf(o, p) {
16524 var _context;
16525
16526 module.exports = _setPrototypeOf = _Object$setPrototypeOf ? _bindInstanceProperty(_context = _Object$setPrototypeOf).call(_context) : function _setPrototypeOf(o, p) {
16527 o.__proto__ = p;
16528 return o;
16529 }, module.exports.__esModule = true, module.exports["default"] = module.exports;
16530 return _setPrototypeOf(o, p);
16531}
16532
16533module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
16534
16535/***/ }),
16536/* 481 */
16537/***/ (function(module, exports, __webpack_require__) {
16538
16539module.exports = __webpack_require__(482);
16540
16541
16542/***/ }),
16543/* 482 */
16544/***/ (function(module, exports, __webpack_require__) {
16545
16546var parent = __webpack_require__(483);
16547
16548module.exports = parent;
16549
16550
16551/***/ }),
16552/* 483 */
16553/***/ (function(module, exports, __webpack_require__) {
16554
16555var parent = __webpack_require__(228);
16556
16557module.exports = parent;
16558
16559
16560/***/ }),
16561/* 484 */
16562/***/ (function(module, exports, __webpack_require__) {
16563
16564module.exports = __webpack_require__(485);
16565
16566
16567/***/ }),
16568/* 485 */
16569/***/ (function(module, exports, __webpack_require__) {
16570
16571var parent = __webpack_require__(486);
16572
16573module.exports = parent;
16574
16575
16576/***/ }),
16577/* 486 */
16578/***/ (function(module, exports, __webpack_require__) {
16579
16580var parent = __webpack_require__(487);
16581
16582module.exports = parent;
16583
16584
16585/***/ }),
16586/* 487 */
16587/***/ (function(module, exports, __webpack_require__) {
16588
16589var parent = __webpack_require__(488);
16590
16591module.exports = parent;
16592
16593
16594/***/ }),
16595/* 488 */
16596/***/ (function(module, exports, __webpack_require__) {
16597
16598var isPrototypeOf = __webpack_require__(21);
16599var method = __webpack_require__(489);
16600
16601var FunctionPrototype = Function.prototype;
16602
16603module.exports = function (it) {
16604 var own = it.bind;
16605 return it === FunctionPrototype || (isPrototypeOf(FunctionPrototype, it) && own === FunctionPrototype.bind) ? method : own;
16606};
16607
16608
16609/***/ }),
16610/* 489 */
16611/***/ (function(module, exports, __webpack_require__) {
16612
16613__webpack_require__(490);
16614var entryVirtual = __webpack_require__(41);
16615
16616module.exports = entryVirtual('Function').bind;
16617
16618
16619/***/ }),
16620/* 490 */
16621/***/ (function(module, exports, __webpack_require__) {
16622
16623// TODO: Remove from `core-js@4`
16624var $ = __webpack_require__(0);
16625var bind = __webpack_require__(242);
16626
16627// `Function.prototype.bind` method
16628// https://tc39.es/ecma262/#sec-function.prototype.bind
16629$({ target: 'Function', proto: true, forced: Function.bind !== bind }, {
16630 bind: bind
16631});
16632
16633
16634/***/ }),
16635/* 491 */
16636/***/ (function(module, exports, __webpack_require__) {
16637
16638var _typeof = __webpack_require__(109)["default"];
16639
16640var assertThisInitialized = __webpack_require__(492);
16641
16642function _possibleConstructorReturn(self, call) {
16643 if (call && (_typeof(call) === "object" || typeof call === "function")) {
16644 return call;
16645 } else if (call !== void 0) {
16646 throw new TypeError("Derived constructors may only return object or undefined");
16647 }
16648
16649 return assertThisInitialized(self);
16650}
16651
16652module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports;
16653
16654/***/ }),
16655/* 492 */
16656/***/ (function(module, exports) {
16657
16658function _assertThisInitialized(self) {
16659 if (self === void 0) {
16660 throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
16661 }
16662
16663 return self;
16664}
16665
16666module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports;
16667
16668/***/ }),
16669/* 493 */
16670/***/ (function(module, exports, __webpack_require__) {
16671
16672var _Object$setPrototypeOf = __webpack_require__(243);
16673
16674var _bindInstanceProperty = __webpack_require__(244);
16675
16676var _Object$getPrototypeOf = __webpack_require__(494);
16677
16678function _getPrototypeOf(o) {
16679 var _context;
16680
16681 module.exports = _getPrototypeOf = _Object$setPrototypeOf ? _bindInstanceProperty(_context = _Object$getPrototypeOf).call(_context) : function _getPrototypeOf(o) {
16682 return o.__proto__ || _Object$getPrototypeOf(o);
16683 }, module.exports.__esModule = true, module.exports["default"] = module.exports;
16684 return _getPrototypeOf(o);
16685}
16686
16687module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
16688
16689/***/ }),
16690/* 494 */
16691/***/ (function(module, exports, __webpack_require__) {
16692
16693module.exports = __webpack_require__(495);
16694
16695/***/ }),
16696/* 495 */
16697/***/ (function(module, exports, __webpack_require__) {
16698
16699module.exports = __webpack_require__(496);
16700
16701
16702/***/ }),
16703/* 496 */
16704/***/ (function(module, exports, __webpack_require__) {
16705
16706var parent = __webpack_require__(497);
16707
16708module.exports = parent;
16709
16710
16711/***/ }),
16712/* 497 */
16713/***/ (function(module, exports, __webpack_require__) {
16714
16715var parent = __webpack_require__(222);
16716
16717module.exports = parent;
16718
16719
16720/***/ }),
16721/* 498 */
16722/***/ (function(module, exports) {
16723
16724function _classCallCheck(instance, Constructor) {
16725 if (!(instance instanceof Constructor)) {
16726 throw new TypeError("Cannot call a class as a function");
16727 }
16728}
16729
16730module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
16731
16732/***/ }),
16733/* 499 */
16734/***/ (function(module, exports, __webpack_require__) {
16735
16736var _Object$defineProperty = __webpack_require__(145);
16737
16738function _defineProperties(target, props) {
16739 for (var i = 0; i < props.length; i++) {
16740 var descriptor = props[i];
16741 descriptor.enumerable = descriptor.enumerable || false;
16742 descriptor.configurable = true;
16743 if ("value" in descriptor) descriptor.writable = true;
16744
16745 _Object$defineProperty(target, descriptor.key, descriptor);
16746 }
16747}
16748
16749function _createClass(Constructor, protoProps, staticProps) {
16750 if (protoProps) _defineProperties(Constructor.prototype, protoProps);
16751 if (staticProps) _defineProperties(Constructor, staticProps);
16752
16753 _Object$defineProperty(Constructor, "prototype", {
16754 writable: false
16755 });
16756
16757 return Constructor;
16758}
16759
16760module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
16761
16762/***/ }),
16763/* 500 */
16764/***/ (function(module, exports, __webpack_require__) {
16765
16766"use strict";
16767
16768
16769var _interopRequireDefault = __webpack_require__(1);
16770
16771var _slice = _interopRequireDefault(__webpack_require__(87));
16772
16773// base64 character set, plus padding character (=)
16774var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
16775
16776module.exports = function (string) {
16777 var result = '';
16778
16779 for (var i = 0; i < string.length;) {
16780 var a = string.charCodeAt(i++);
16781 var b = string.charCodeAt(i++);
16782 var c = string.charCodeAt(i++);
16783
16784 if (a > 255 || b > 255 || c > 255) {
16785 throw new TypeError('Failed to encode base64: The string to be encoded contains characters outside of the Latin1 range.');
16786 }
16787
16788 var bitmap = a << 16 | b << 8 | c;
16789 result += b64.charAt(bitmap >> 18 & 63) + b64.charAt(bitmap >> 12 & 63) + b64.charAt(bitmap >> 6 & 63) + b64.charAt(bitmap & 63);
16790 } // To determine the final padding
16791
16792
16793 var rest = string.length % 3; // If there's need of padding, replace the last 'A's with equal signs
16794
16795 return rest ? (0, _slice.default)(result).call(result, 0, rest - 3) + '==='.substring(rest) : result;
16796};
16797
16798/***/ }),
16799/* 501 */
16800/***/ (function(module, exports, __webpack_require__) {
16801
16802"use strict";
16803
16804
16805var _ = __webpack_require__(2);
16806
16807var ajax = __webpack_require__(108);
16808
16809module.exports = function upload(uploadInfo, data, file) {
16810 var saveOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
16811 return ajax({
16812 url: uploadInfo.upload_url,
16813 method: 'PUT',
16814 data: data,
16815 headers: _.extend({
16816 'Content-Type': file.get('mime_type'),
16817 'Cache-Control': 'public, max-age=31536000'
16818 }, file._uploadHeaders),
16819 onprogress: saveOptions.onprogress
16820 }).then(function () {
16821 file.attributes.url = uploadInfo.url;
16822 file._bucket = uploadInfo.bucket;
16823 file.id = uploadInfo.objectId;
16824 return file;
16825 });
16826};
16827
16828/***/ }),
16829/* 502 */
16830/***/ (function(module, exports, __webpack_require__) {
16831
16832(function(){
16833 var crypt = __webpack_require__(503),
16834 utf8 = __webpack_require__(245).utf8,
16835 isBuffer = __webpack_require__(504),
16836 bin = __webpack_require__(245).bin,
16837
16838 // The core
16839 md5 = function (message, options) {
16840 // Convert to byte array
16841 if (message.constructor == String)
16842 if (options && options.encoding === 'binary')
16843 message = bin.stringToBytes(message);
16844 else
16845 message = utf8.stringToBytes(message);
16846 else if (isBuffer(message))
16847 message = Array.prototype.slice.call(message, 0);
16848 else if (!Array.isArray(message))
16849 message = message.toString();
16850 // else, assume byte array already
16851
16852 var m = crypt.bytesToWords(message),
16853 l = message.length * 8,
16854 a = 1732584193,
16855 b = -271733879,
16856 c = -1732584194,
16857 d = 271733878;
16858
16859 // Swap endian
16860 for (var i = 0; i < m.length; i++) {
16861 m[i] = ((m[i] << 8) | (m[i] >>> 24)) & 0x00FF00FF |
16862 ((m[i] << 24) | (m[i] >>> 8)) & 0xFF00FF00;
16863 }
16864
16865 // Padding
16866 m[l >>> 5] |= 0x80 << (l % 32);
16867 m[(((l + 64) >>> 9) << 4) + 14] = l;
16868
16869 // Method shortcuts
16870 var FF = md5._ff,
16871 GG = md5._gg,
16872 HH = md5._hh,
16873 II = md5._ii;
16874
16875 for (var i = 0; i < m.length; i += 16) {
16876
16877 var aa = a,
16878 bb = b,
16879 cc = c,
16880 dd = d;
16881
16882 a = FF(a, b, c, d, m[i+ 0], 7, -680876936);
16883 d = FF(d, a, b, c, m[i+ 1], 12, -389564586);
16884 c = FF(c, d, a, b, m[i+ 2], 17, 606105819);
16885 b = FF(b, c, d, a, m[i+ 3], 22, -1044525330);
16886 a = FF(a, b, c, d, m[i+ 4], 7, -176418897);
16887 d = FF(d, a, b, c, m[i+ 5], 12, 1200080426);
16888 c = FF(c, d, a, b, m[i+ 6], 17, -1473231341);
16889 b = FF(b, c, d, a, m[i+ 7], 22, -45705983);
16890 a = FF(a, b, c, d, m[i+ 8], 7, 1770035416);
16891 d = FF(d, a, b, c, m[i+ 9], 12, -1958414417);
16892 c = FF(c, d, a, b, m[i+10], 17, -42063);
16893 b = FF(b, c, d, a, m[i+11], 22, -1990404162);
16894 a = FF(a, b, c, d, m[i+12], 7, 1804603682);
16895 d = FF(d, a, b, c, m[i+13], 12, -40341101);
16896 c = FF(c, d, a, b, m[i+14], 17, -1502002290);
16897 b = FF(b, c, d, a, m[i+15], 22, 1236535329);
16898
16899 a = GG(a, b, c, d, m[i+ 1], 5, -165796510);
16900 d = GG(d, a, b, c, m[i+ 6], 9, -1069501632);
16901 c = GG(c, d, a, b, m[i+11], 14, 643717713);
16902 b = GG(b, c, d, a, m[i+ 0], 20, -373897302);
16903 a = GG(a, b, c, d, m[i+ 5], 5, -701558691);
16904 d = GG(d, a, b, c, m[i+10], 9, 38016083);
16905 c = GG(c, d, a, b, m[i+15], 14, -660478335);
16906 b = GG(b, c, d, a, m[i+ 4], 20, -405537848);
16907 a = GG(a, b, c, d, m[i+ 9], 5, 568446438);
16908 d = GG(d, a, b, c, m[i+14], 9, -1019803690);
16909 c = GG(c, d, a, b, m[i+ 3], 14, -187363961);
16910 b = GG(b, c, d, a, m[i+ 8], 20, 1163531501);
16911 a = GG(a, b, c, d, m[i+13], 5, -1444681467);
16912 d = GG(d, a, b, c, m[i+ 2], 9, -51403784);
16913 c = GG(c, d, a, b, m[i+ 7], 14, 1735328473);
16914 b = GG(b, c, d, a, m[i+12], 20, -1926607734);
16915
16916 a = HH(a, b, c, d, m[i+ 5], 4, -378558);
16917 d = HH(d, a, b, c, m[i+ 8], 11, -2022574463);
16918 c = HH(c, d, a, b, m[i+11], 16, 1839030562);
16919 b = HH(b, c, d, a, m[i+14], 23, -35309556);
16920 a = HH(a, b, c, d, m[i+ 1], 4, -1530992060);
16921 d = HH(d, a, b, c, m[i+ 4], 11, 1272893353);
16922 c = HH(c, d, a, b, m[i+ 7], 16, -155497632);
16923 b = HH(b, c, d, a, m[i+10], 23, -1094730640);
16924 a = HH(a, b, c, d, m[i+13], 4, 681279174);
16925 d = HH(d, a, b, c, m[i+ 0], 11, -358537222);
16926 c = HH(c, d, a, b, m[i+ 3], 16, -722521979);
16927 b = HH(b, c, d, a, m[i+ 6], 23, 76029189);
16928 a = HH(a, b, c, d, m[i+ 9], 4, -640364487);
16929 d = HH(d, a, b, c, m[i+12], 11, -421815835);
16930 c = HH(c, d, a, b, m[i+15], 16, 530742520);
16931 b = HH(b, c, d, a, m[i+ 2], 23, -995338651);
16932
16933 a = II(a, b, c, d, m[i+ 0], 6, -198630844);
16934 d = II(d, a, b, c, m[i+ 7], 10, 1126891415);
16935 c = II(c, d, a, b, m[i+14], 15, -1416354905);
16936 b = II(b, c, d, a, m[i+ 5], 21, -57434055);
16937 a = II(a, b, c, d, m[i+12], 6, 1700485571);
16938 d = II(d, a, b, c, m[i+ 3], 10, -1894986606);
16939 c = II(c, d, a, b, m[i+10], 15, -1051523);
16940 b = II(b, c, d, a, m[i+ 1], 21, -2054922799);
16941 a = II(a, b, c, d, m[i+ 8], 6, 1873313359);
16942 d = II(d, a, b, c, m[i+15], 10, -30611744);
16943 c = II(c, d, a, b, m[i+ 6], 15, -1560198380);
16944 b = II(b, c, d, a, m[i+13], 21, 1309151649);
16945 a = II(a, b, c, d, m[i+ 4], 6, -145523070);
16946 d = II(d, a, b, c, m[i+11], 10, -1120210379);
16947 c = II(c, d, a, b, m[i+ 2], 15, 718787259);
16948 b = II(b, c, d, a, m[i+ 9], 21, -343485551);
16949
16950 a = (a + aa) >>> 0;
16951 b = (b + bb) >>> 0;
16952 c = (c + cc) >>> 0;
16953 d = (d + dd) >>> 0;
16954 }
16955
16956 return crypt.endian([a, b, c, d]);
16957 };
16958
16959 // Auxiliary functions
16960 md5._ff = function (a, b, c, d, x, s, t) {
16961 var n = a + (b & c | ~b & d) + (x >>> 0) + t;
16962 return ((n << s) | (n >>> (32 - s))) + b;
16963 };
16964 md5._gg = function (a, b, c, d, x, s, t) {
16965 var n = a + (b & d | c & ~d) + (x >>> 0) + t;
16966 return ((n << s) | (n >>> (32 - s))) + b;
16967 };
16968 md5._hh = function (a, b, c, d, x, s, t) {
16969 var n = a + (b ^ c ^ d) + (x >>> 0) + t;
16970 return ((n << s) | (n >>> (32 - s))) + b;
16971 };
16972 md5._ii = function (a, b, c, d, x, s, t) {
16973 var n = a + (c ^ (b | ~d)) + (x >>> 0) + t;
16974 return ((n << s) | (n >>> (32 - s))) + b;
16975 };
16976
16977 // Package private blocksize
16978 md5._blocksize = 16;
16979 md5._digestsize = 16;
16980
16981 module.exports = function (message, options) {
16982 if (message === undefined || message === null)
16983 throw new Error('Illegal argument ' + message);
16984
16985 var digestbytes = crypt.wordsToBytes(md5(message, options));
16986 return options && options.asBytes ? digestbytes :
16987 options && options.asString ? bin.bytesToString(digestbytes) :
16988 crypt.bytesToHex(digestbytes);
16989 };
16990
16991})();
16992
16993
16994/***/ }),
16995/* 503 */
16996/***/ (function(module, exports) {
16997
16998(function() {
16999 var base64map
17000 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',
17001
17002 crypt = {
17003 // Bit-wise rotation left
17004 rotl: function(n, b) {
17005 return (n << b) | (n >>> (32 - b));
17006 },
17007
17008 // Bit-wise rotation right
17009 rotr: function(n, b) {
17010 return (n << (32 - b)) | (n >>> b);
17011 },
17012
17013 // Swap big-endian to little-endian and vice versa
17014 endian: function(n) {
17015 // If number given, swap endian
17016 if (n.constructor == Number) {
17017 return crypt.rotl(n, 8) & 0x00FF00FF | crypt.rotl(n, 24) & 0xFF00FF00;
17018 }
17019
17020 // Else, assume array and swap all items
17021 for (var i = 0; i < n.length; i++)
17022 n[i] = crypt.endian(n[i]);
17023 return n;
17024 },
17025
17026 // Generate an array of any length of random bytes
17027 randomBytes: function(n) {
17028 for (var bytes = []; n > 0; n--)
17029 bytes.push(Math.floor(Math.random() * 256));
17030 return bytes;
17031 },
17032
17033 // Convert a byte array to big-endian 32-bit words
17034 bytesToWords: function(bytes) {
17035 for (var words = [], i = 0, b = 0; i < bytes.length; i++, b += 8)
17036 words[b >>> 5] |= bytes[i] << (24 - b % 32);
17037 return words;
17038 },
17039
17040 // Convert big-endian 32-bit words to a byte array
17041 wordsToBytes: function(words) {
17042 for (var bytes = [], b = 0; b < words.length * 32; b += 8)
17043 bytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF);
17044 return bytes;
17045 },
17046
17047 // Convert a byte array to a hex string
17048 bytesToHex: function(bytes) {
17049 for (var hex = [], i = 0; i < bytes.length; i++) {
17050 hex.push((bytes[i] >>> 4).toString(16));
17051 hex.push((bytes[i] & 0xF).toString(16));
17052 }
17053 return hex.join('');
17054 },
17055
17056 // Convert a hex string to a byte array
17057 hexToBytes: function(hex) {
17058 for (var bytes = [], c = 0; c < hex.length; c += 2)
17059 bytes.push(parseInt(hex.substr(c, 2), 16));
17060 return bytes;
17061 },
17062
17063 // Convert a byte array to a base-64 string
17064 bytesToBase64: function(bytes) {
17065 for (var base64 = [], i = 0; i < bytes.length; i += 3) {
17066 var triplet = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2];
17067 for (var j = 0; j < 4; j++)
17068 if (i * 8 + j * 6 <= bytes.length * 8)
17069 base64.push(base64map.charAt((triplet >>> 6 * (3 - j)) & 0x3F));
17070 else
17071 base64.push('=');
17072 }
17073 return base64.join('');
17074 },
17075
17076 // Convert a base-64 string to a byte array
17077 base64ToBytes: function(base64) {
17078 // Remove non-base-64 characters
17079 base64 = base64.replace(/[^A-Z0-9+\/]/ig, '');
17080
17081 for (var bytes = [], i = 0, imod4 = 0; i < base64.length;
17082 imod4 = ++i % 4) {
17083 if (imod4 == 0) continue;
17084 bytes.push(((base64map.indexOf(base64.charAt(i - 1))
17085 & (Math.pow(2, -2 * imod4 + 8) - 1)) << (imod4 * 2))
17086 | (base64map.indexOf(base64.charAt(i)) >>> (6 - imod4 * 2)));
17087 }
17088 return bytes;
17089 }
17090 };
17091
17092 module.exports = crypt;
17093})();
17094
17095
17096/***/ }),
17097/* 504 */
17098/***/ (function(module, exports) {
17099
17100/*!
17101 * Determine if an object is a Buffer
17102 *
17103 * @author Feross Aboukhadijeh <https://feross.org>
17104 * @license MIT
17105 */
17106
17107// The _isBuffer check is for Safari 5-7 support, because it's missing
17108// Object.prototype.constructor. Remove this eventually
17109module.exports = function (obj) {
17110 return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)
17111}
17112
17113function isBuffer (obj) {
17114 return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
17115}
17116
17117// For Node v0.10 support. Remove this eventually.
17118function isSlowBuffer (obj) {
17119 return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))
17120}
17121
17122
17123/***/ }),
17124/* 505 */
17125/***/ (function(module, exports, __webpack_require__) {
17126
17127"use strict";
17128
17129
17130var _interopRequireDefault = __webpack_require__(1);
17131
17132var _indexOf = _interopRequireDefault(__webpack_require__(86));
17133
17134var dataURItoBlob = function dataURItoBlob(dataURI, type) {
17135 var _context;
17136
17137 var byteString; // 传入的 base64,不是 dataURL
17138
17139 if ((0, _indexOf.default)(dataURI).call(dataURI, 'base64') < 0) {
17140 byteString = atob(dataURI);
17141 } else if ((0, _indexOf.default)(_context = dataURI.split(',')[0]).call(_context, 'base64') >= 0) {
17142 type = type || dataURI.split(',')[0].split(':')[1].split(';')[0];
17143 byteString = atob(dataURI.split(',')[1]);
17144 } else {
17145 byteString = unescape(dataURI.split(',')[1]);
17146 }
17147
17148 var ia = new Uint8Array(byteString.length);
17149
17150 for (var i = 0; i < byteString.length; i++) {
17151 ia[i] = byteString.charCodeAt(i);
17152 }
17153
17154 return new Blob([ia], {
17155 type: type
17156 });
17157};
17158
17159module.exports = dataURItoBlob;
17160
17161/***/ }),
17162/* 506 */
17163/***/ (function(module, exports, __webpack_require__) {
17164
17165"use strict";
17166
17167
17168var _interopRequireDefault = __webpack_require__(1);
17169
17170var _slicedToArray2 = _interopRequireDefault(__webpack_require__(507));
17171
17172var _map = _interopRequireDefault(__webpack_require__(42));
17173
17174var _indexOf = _interopRequireDefault(__webpack_require__(86));
17175
17176var _find = _interopRequireDefault(__webpack_require__(110));
17177
17178var _promise = _interopRequireDefault(__webpack_require__(12));
17179
17180var _concat = _interopRequireDefault(__webpack_require__(30));
17181
17182var _keys2 = _interopRequireDefault(__webpack_require__(55));
17183
17184var _stringify = _interopRequireDefault(__webpack_require__(36));
17185
17186var _defineProperty = _interopRequireDefault(__webpack_require__(143));
17187
17188var _getOwnPropertyDescriptor = _interopRequireDefault(__webpack_require__(246));
17189
17190var _ = __webpack_require__(2);
17191
17192var AVError = __webpack_require__(43);
17193
17194var _require = __webpack_require__(26),
17195 _request = _require._request;
17196
17197var _require2 = __webpack_require__(29),
17198 isNullOrUndefined = _require2.isNullOrUndefined,
17199 ensureArray = _require2.ensureArray,
17200 transformFetchOptions = _require2.transformFetchOptions,
17201 setValue = _require2.setValue,
17202 findValue = _require2.findValue,
17203 isPlainObject = _require2.isPlainObject,
17204 continueWhile = _require2.continueWhile;
17205
17206var recursiveToPointer = function recursiveToPointer(value) {
17207 if (_.isArray(value)) return (0, _map.default)(value).call(value, recursiveToPointer);
17208 if (isPlainObject(value)) return _.mapObject(value, recursiveToPointer);
17209 if (_.isObject(value) && value._toPointer) return value._toPointer();
17210 return value;
17211};
17212
17213var RESERVED_KEYS = ['objectId', 'createdAt', 'updatedAt'];
17214
17215var checkReservedKey = function checkReservedKey(key) {
17216 if ((0, _indexOf.default)(RESERVED_KEYS).call(RESERVED_KEYS, key) !== -1) {
17217 throw new Error("key[".concat(key, "] is reserved"));
17218 }
17219};
17220
17221var handleBatchResults = function handleBatchResults(results) {
17222 var firstError = (0, _find.default)(_).call(_, results, function (result) {
17223 return result instanceof Error;
17224 });
17225
17226 if (!firstError) {
17227 return results;
17228 }
17229
17230 var error = new AVError(firstError.code, firstError.message);
17231 error.results = results;
17232 throw error;
17233}; // Helper function to get a value from a Backbone object as a property
17234// or as a function.
17235
17236
17237function getValue(object, prop) {
17238 if (!(object && object[prop])) {
17239 return null;
17240 }
17241
17242 return _.isFunction(object[prop]) ? object[prop]() : object[prop];
17243} // AV.Object is analogous to the Java AVObject.
17244// It also implements the same interface as a Backbone model.
17245
17246
17247module.exports = function (AV) {
17248 /**
17249 * Creates a new model with defined attributes. A client id (cid) is
17250 * automatically generated and assigned for you.
17251 *
17252 * <p>You won't normally call this method directly. It is recommended that
17253 * you use a subclass of <code>AV.Object</code> instead, created by calling
17254 * <code>extend</code>.</p>
17255 *
17256 * <p>However, if you don't want to use a subclass, or aren't sure which
17257 * subclass is appropriate, you can use this form:<pre>
17258 * var object = new AV.Object("ClassName");
17259 * </pre>
17260 * That is basically equivalent to:<pre>
17261 * var MyClass = AV.Object.extend("ClassName");
17262 * var object = new MyClass();
17263 * </pre></p>
17264 *
17265 * @param {Object} attributes The initial set of data to store in the object.
17266 * @param {Object} options A set of Backbone-like options for creating the
17267 * object. The only option currently supported is "collection".
17268 * @see AV.Object.extend
17269 *
17270 * @class
17271 *
17272 * <p>The fundamental unit of AV data, which implements the Backbone Model
17273 * interface.</p>
17274 */
17275 AV.Object = function (attributes, options) {
17276 // Allow new AV.Object("ClassName") as a shortcut to _create.
17277 if (_.isString(attributes)) {
17278 return AV.Object._create.apply(this, arguments);
17279 }
17280
17281 attributes = attributes || {};
17282
17283 if (options && options.parse) {
17284 attributes = this.parse(attributes);
17285 attributes = this._mergeMagicFields(attributes);
17286 }
17287
17288 var defaults = getValue(this, 'defaults');
17289
17290 if (defaults) {
17291 attributes = _.extend({}, defaults, attributes);
17292 }
17293
17294 if (options && options.collection) {
17295 this.collection = options.collection;
17296 }
17297
17298 this._serverData = {}; // The last known data for this object from cloud.
17299
17300 this._opSetQueue = [{}]; // List of sets of changes to the data.
17301
17302 this._flags = {};
17303 this.attributes = {}; // The best estimate of this's current data.
17304
17305 this._hashedJSON = {}; // Hash of values of containers at last save.
17306
17307 this._escapedAttributes = {};
17308 this.cid = _.uniqueId('c');
17309 this.changed = {};
17310 this._silent = {};
17311 this._pending = {};
17312 this.set(attributes, {
17313 silent: true
17314 });
17315 this.changed = {};
17316 this._silent = {};
17317 this._pending = {};
17318 this._hasData = true;
17319 this._previousAttributes = _.clone(this.attributes);
17320 this.initialize.apply(this, arguments);
17321 };
17322 /**
17323 * @lends AV.Object.prototype
17324 * @property {String} id The objectId of the AV Object.
17325 */
17326
17327 /**
17328 * Saves the given list of AV.Object.
17329 * If any error is encountered, stops and calls the error handler.
17330 *
17331 * @example
17332 * AV.Object.saveAll([object1, object2, ...]).then(function(list) {
17333 * // All the objects were saved.
17334 * }, function(error) {
17335 * // An error occurred while saving one of the objects.
17336 * });
17337 *
17338 * @param {Array} list A list of <code>AV.Object</code>.
17339 */
17340
17341
17342 AV.Object.saveAll = function (list, options) {
17343 return AV.Object._deepSaveAsync(list, null, options);
17344 };
17345 /**
17346 * Fetch the given list of AV.Object.
17347 *
17348 * @param {AV.Object[]} objects A list of <code>AV.Object</code>
17349 * @param {AuthOptions} options
17350 * @return {Promise.<AV.Object[]>} The given list of <code>AV.Object</code>, updated
17351 */
17352
17353
17354 AV.Object.fetchAll = function (objects, options) {
17355 return _promise.default.resolve().then(function () {
17356 return _request('batch', null, null, 'POST', {
17357 requests: (0, _map.default)(_).call(_, objects, function (object) {
17358 var _context;
17359
17360 if (!object.className) throw new Error('object must have className to fetch');
17361 if (!object.id) throw new Error('object must have id to fetch');
17362 if (object.dirty()) throw new Error('object is modified but not saved');
17363 return {
17364 method: 'GET',
17365 path: (0, _concat.default)(_context = "/1.1/classes/".concat(object.className, "/")).call(_context, object.id)
17366 };
17367 })
17368 }, options);
17369 }).then(function (response) {
17370 var results = (0, _map.default)(_).call(_, objects, function (object, i) {
17371 if (response[i].success) {
17372 var fetchedAttrs = object.parse(response[i].success);
17373
17374 object._cleanupUnsetKeys(fetchedAttrs);
17375
17376 object._finishFetch(fetchedAttrs);
17377
17378 return object;
17379 }
17380
17381 if (response[i].success === null) {
17382 return new AVError(AVError.OBJECT_NOT_FOUND, 'Object not found.');
17383 }
17384
17385 return new AVError(response[i].error.code, response[i].error.error);
17386 });
17387 return handleBatchResults(results);
17388 });
17389 }; // Attach all inheritable methods to the AV.Object prototype.
17390
17391
17392 _.extend(AV.Object.prototype, AV.Events,
17393 /** @lends AV.Object.prototype */
17394 {
17395 _fetchWhenSave: false,
17396
17397 /**
17398 * Initialize is an empty function by default. Override it with your own
17399 * initialization logic.
17400 */
17401 initialize: function initialize() {},
17402
17403 /**
17404 * Set whether to enable fetchWhenSave option when updating object.
17405 * When set true, SDK would fetch the latest object after saving.
17406 * Default is false.
17407 *
17408 * @deprecated use AV.Object#save with options.fetchWhenSave instead
17409 * @param {boolean} enable true to enable fetchWhenSave option.
17410 */
17411 fetchWhenSave: function fetchWhenSave(enable) {
17412 console.warn('AV.Object#fetchWhenSave is deprecated, use AV.Object#save with options.fetchWhenSave instead.');
17413
17414 if (!_.isBoolean(enable)) {
17415 throw new Error('Expect boolean value for fetchWhenSave');
17416 }
17417
17418 this._fetchWhenSave = enable;
17419 },
17420
17421 /**
17422 * Returns the object's objectId.
17423 * @return {String} the objectId.
17424 */
17425 getObjectId: function getObjectId() {
17426 return this.id;
17427 },
17428
17429 /**
17430 * Returns the object's createdAt attribute.
17431 * @return {Date}
17432 */
17433 getCreatedAt: function getCreatedAt() {
17434 return this.createdAt;
17435 },
17436
17437 /**
17438 * Returns the object's updatedAt attribute.
17439 * @return {Date}
17440 */
17441 getUpdatedAt: function getUpdatedAt() {
17442 return this.updatedAt;
17443 },
17444
17445 /**
17446 * Returns a JSON version of the object.
17447 * @return {Object}
17448 */
17449 toJSON: function toJSON(key, holder) {
17450 var seenObjects = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
17451 return this._toFullJSON(seenObjects, false);
17452 },
17453
17454 /**
17455 * Returns a JSON version of the object with meta data.
17456 * Inverse to {@link AV.parseJSON}
17457 * @since 3.0.0
17458 * @return {Object}
17459 */
17460 toFullJSON: function toFullJSON() {
17461 var seenObjects = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
17462 return this._toFullJSON(seenObjects);
17463 },
17464 _toFullJSON: function _toFullJSON(seenObjects) {
17465 var _this = this;
17466
17467 var full = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
17468
17469 var json = _.clone(this.attributes);
17470
17471 if (_.isArray(seenObjects)) {
17472 var newSeenObjects = (0, _concat.default)(seenObjects).call(seenObjects, this);
17473 }
17474
17475 AV._objectEach(json, function (val, key) {
17476 json[key] = AV._encode(val, newSeenObjects, undefined, full);
17477 });
17478
17479 AV._objectEach(this._operations, function (val, key) {
17480 json[key] = val;
17481 });
17482
17483 if (_.has(this, 'id')) {
17484 json.objectId = this.id;
17485 }
17486
17487 ['createdAt', 'updatedAt'].forEach(function (key) {
17488 if (_.has(_this, key)) {
17489 var val = _this[key];
17490 json[key] = _.isDate(val) ? val.toJSON() : val;
17491 }
17492 });
17493
17494 if (full) {
17495 json.__type = 'Object';
17496 if (_.isArray(seenObjects) && seenObjects.length) json.__type = 'Pointer';
17497 json.className = this.className;
17498 }
17499
17500 return json;
17501 },
17502
17503 /**
17504 * Updates _hashedJSON to reflect the current state of this object.
17505 * Adds any changed hash values to the set of pending changes.
17506 * @private
17507 */
17508 _refreshCache: function _refreshCache() {
17509 var self = this;
17510
17511 if (self._refreshingCache) {
17512 return;
17513 }
17514
17515 self._refreshingCache = true;
17516
17517 AV._objectEach(this.attributes, function (value, key) {
17518 if (value instanceof AV.Object) {
17519 value._refreshCache();
17520 } else if (_.isObject(value)) {
17521 if (self._resetCacheForKey(key)) {
17522 self.set(key, new AV.Op.Set(value), {
17523 silent: true
17524 });
17525 }
17526 }
17527 });
17528
17529 delete self._refreshingCache;
17530 },
17531
17532 /**
17533 * Returns true if this object has been modified since its last
17534 * save/refresh. If an attribute is specified, it returns true only if that
17535 * particular attribute has been modified since the last save/refresh.
17536 * @param {String} attr An attribute name (optional).
17537 * @return {Boolean}
17538 */
17539 dirty: function dirty(attr) {
17540 this._refreshCache();
17541
17542 var currentChanges = _.last(this._opSetQueue);
17543
17544 if (attr) {
17545 return currentChanges[attr] ? true : false;
17546 }
17547
17548 if (!this.id) {
17549 return true;
17550 }
17551
17552 if ((0, _keys2.default)(_).call(_, currentChanges).length > 0) {
17553 return true;
17554 }
17555
17556 return false;
17557 },
17558
17559 /**
17560 * Returns the keys of the modified attribute since its last save/refresh.
17561 * @return {String[]}
17562 */
17563 dirtyKeys: function dirtyKeys() {
17564 this._refreshCache();
17565
17566 var currentChanges = _.last(this._opSetQueue);
17567
17568 return (0, _keys2.default)(_).call(_, currentChanges);
17569 },
17570
17571 /**
17572 * Gets a Pointer referencing this Object.
17573 * @private
17574 */
17575 _toPointer: function _toPointer() {
17576 // if (!this.id) {
17577 // throw new Error("Can't serialize an unsaved AV.Object");
17578 // }
17579 return {
17580 __type: 'Pointer',
17581 className: this.className,
17582 objectId: this.id
17583 };
17584 },
17585
17586 /**
17587 * Gets the value of an attribute.
17588 * @param {String} attr The string name of an attribute.
17589 */
17590 get: function get(attr) {
17591 switch (attr) {
17592 case 'objectId':
17593 return this.id;
17594
17595 case 'createdAt':
17596 case 'updatedAt':
17597 return this[attr];
17598
17599 default:
17600 return this.attributes[attr];
17601 }
17602 },
17603
17604 /**
17605 * Gets a relation on the given class for the attribute.
17606 * @param {String} attr The attribute to get the relation for.
17607 * @return {AV.Relation}
17608 */
17609 relation: function relation(attr) {
17610 var value = this.get(attr);
17611
17612 if (value) {
17613 if (!(value instanceof AV.Relation)) {
17614 throw new Error('Called relation() on non-relation field ' + attr);
17615 }
17616
17617 value._ensureParentAndKey(this, attr);
17618
17619 return value;
17620 } else {
17621 return new AV.Relation(this, attr);
17622 }
17623 },
17624
17625 /**
17626 * Gets the HTML-escaped value of an attribute.
17627 */
17628 escape: function escape(attr) {
17629 var html = this._escapedAttributes[attr];
17630
17631 if (html) {
17632 return html;
17633 }
17634
17635 var val = this.attributes[attr];
17636 var escaped;
17637
17638 if (isNullOrUndefined(val)) {
17639 escaped = '';
17640 } else {
17641 escaped = _.escape(val.toString());
17642 }
17643
17644 this._escapedAttributes[attr] = escaped;
17645 return escaped;
17646 },
17647
17648 /**
17649 * Returns <code>true</code> if the attribute contains a value that is not
17650 * null or undefined.
17651 * @param {String} attr The string name of the attribute.
17652 * @return {Boolean}
17653 */
17654 has: function has(attr) {
17655 return !isNullOrUndefined(this.attributes[attr]);
17656 },
17657
17658 /**
17659 * Pulls "special" fields like objectId, createdAt, etc. out of attrs
17660 * and puts them on "this" directly. Removes them from attrs.
17661 * @param attrs - A dictionary with the data for this AV.Object.
17662 * @private
17663 */
17664 _mergeMagicFields: function _mergeMagicFields(attrs) {
17665 // Check for changes of magic fields.
17666 var model = this;
17667 var specialFields = ['objectId', 'createdAt', 'updatedAt'];
17668
17669 AV._arrayEach(specialFields, function (attr) {
17670 if (attrs[attr]) {
17671 if (attr === 'objectId') {
17672 model.id = attrs[attr];
17673 } else if ((attr === 'createdAt' || attr === 'updatedAt') && !_.isDate(attrs[attr])) {
17674 model[attr] = AV._parseDate(attrs[attr]);
17675 } else {
17676 model[attr] = attrs[attr];
17677 }
17678
17679 delete attrs[attr];
17680 }
17681 });
17682
17683 return attrs;
17684 },
17685
17686 /**
17687 * Returns the json to be sent to the server.
17688 * @private
17689 */
17690 _startSave: function _startSave() {
17691 this._opSetQueue.push({});
17692 },
17693
17694 /**
17695 * Called when a save fails because of an error. Any changes that were part
17696 * of the save need to be merged with changes made after the save. This
17697 * might throw an exception is you do conflicting operations. For example,
17698 * if you do:
17699 * object.set("foo", "bar");
17700 * object.set("invalid field name", "baz");
17701 * object.save();
17702 * object.increment("foo");
17703 * then this will throw when the save fails and the client tries to merge
17704 * "bar" with the +1.
17705 * @private
17706 */
17707 _cancelSave: function _cancelSave() {
17708 var failedChanges = _.first(this._opSetQueue);
17709
17710 this._opSetQueue = _.rest(this._opSetQueue);
17711
17712 var nextChanges = _.first(this._opSetQueue);
17713
17714 AV._objectEach(failedChanges, function (op, key) {
17715 var op1 = failedChanges[key];
17716 var op2 = nextChanges[key];
17717
17718 if (op1 && op2) {
17719 nextChanges[key] = op2._mergeWithPrevious(op1);
17720 } else if (op1) {
17721 nextChanges[key] = op1;
17722 }
17723 });
17724
17725 this._saving = this._saving - 1;
17726 },
17727
17728 /**
17729 * Called when a save completes successfully. This merges the changes that
17730 * were saved into the known server data, and overrides it with any data
17731 * sent directly from the server.
17732 * @private
17733 */
17734 _finishSave: function _finishSave(serverData) {
17735 var _context2;
17736
17737 // Grab a copy of any object referenced by this object. These instances
17738 // may have already been fetched, and we don't want to lose their data.
17739 // Note that doing it like this means we will unify separate copies of the
17740 // same object, but that's a risk we have to take.
17741 var fetchedObjects = {};
17742
17743 AV._traverse(this.attributes, function (object) {
17744 if (object instanceof AV.Object && object.id && object._hasData) {
17745 fetchedObjects[object.id] = object;
17746 }
17747 });
17748
17749 var savedChanges = _.first(this._opSetQueue);
17750
17751 this._opSetQueue = _.rest(this._opSetQueue);
17752
17753 this._applyOpSet(savedChanges, this._serverData);
17754
17755 this._mergeMagicFields(serverData);
17756
17757 var self = this;
17758
17759 AV._objectEach(serverData, function (value, key) {
17760 self._serverData[key] = AV._decode(value, key); // Look for any objects that might have become unfetched and fix them
17761 // by replacing their values with the previously observed values.
17762
17763 var fetched = AV._traverse(self._serverData[key], function (object) {
17764 if (object instanceof AV.Object && fetchedObjects[object.id]) {
17765 return fetchedObjects[object.id];
17766 }
17767 });
17768
17769 if (fetched) {
17770 self._serverData[key] = fetched;
17771 }
17772 });
17773
17774 this._rebuildAllEstimatedData();
17775
17776 var opSetQueue = (0, _map.default)(_context2 = this._opSetQueue).call(_context2, _.clone);
17777
17778 this._refreshCache();
17779
17780 this._opSetQueue = opSetQueue;
17781 this._saving = this._saving - 1;
17782 },
17783
17784 /**
17785 * Called when a fetch or login is complete to set the known server data to
17786 * the given object.
17787 * @private
17788 */
17789 _finishFetch: function _finishFetch(serverData, hasData) {
17790 // Clear out any changes the user might have made previously.
17791 this._opSetQueue = [{}]; // Bring in all the new server data.
17792
17793 this._mergeMagicFields(serverData);
17794
17795 var self = this;
17796
17797 AV._objectEach(serverData, function (value, key) {
17798 self._serverData[key] = AV._decode(value, key);
17799 }); // Refresh the attributes.
17800
17801
17802 this._rebuildAllEstimatedData(); // Clear out the cache of mutable containers.
17803
17804
17805 this._refreshCache();
17806
17807 this._opSetQueue = [{}];
17808 this._hasData = hasData;
17809 },
17810
17811 /**
17812 * Applies the set of AV.Op in opSet to the object target.
17813 * @private
17814 */
17815 _applyOpSet: function _applyOpSet(opSet, target) {
17816 var self = this;
17817
17818 AV._objectEach(opSet, function (change, key) {
17819 var _findValue = findValue(target, key),
17820 _findValue2 = (0, _slicedToArray2.default)(_findValue, 3),
17821 value = _findValue2[0],
17822 actualTarget = _findValue2[1],
17823 actualKey = _findValue2[2];
17824
17825 setValue(target, key, change._estimate(value, self, key));
17826
17827 if (actualTarget && actualTarget[actualKey] === AV.Op._UNSET) {
17828 delete actualTarget[actualKey];
17829 }
17830 });
17831 },
17832
17833 /**
17834 * Replaces the cached value for key with the current value.
17835 * Returns true if the new value is different than the old value.
17836 * @private
17837 */
17838 _resetCacheForKey: function _resetCacheForKey(key) {
17839 var value = this.attributes[key];
17840
17841 if (_.isObject(value) && !(value instanceof AV.Object) && !(value instanceof AV.File)) {
17842 var json = (0, _stringify.default)(recursiveToPointer(value));
17843
17844 if (this._hashedJSON[key] !== json) {
17845 var wasSet = !!this._hashedJSON[key];
17846 this._hashedJSON[key] = json;
17847 return wasSet;
17848 }
17849 }
17850
17851 return false;
17852 },
17853
17854 /**
17855 * Populates attributes[key] by starting with the last known data from the
17856 * server, and applying all of the local changes that have been made to that
17857 * key since then.
17858 * @private
17859 */
17860 _rebuildEstimatedDataForKey: function _rebuildEstimatedDataForKey(key) {
17861 var self = this;
17862 delete this.attributes[key];
17863
17864 if (this._serverData[key]) {
17865 this.attributes[key] = this._serverData[key];
17866 }
17867
17868 AV._arrayEach(this._opSetQueue, function (opSet) {
17869 var op = opSet[key];
17870
17871 if (op) {
17872 var _findValue3 = findValue(self.attributes, key),
17873 _findValue4 = (0, _slicedToArray2.default)(_findValue3, 4),
17874 value = _findValue4[0],
17875 actualTarget = _findValue4[1],
17876 actualKey = _findValue4[2],
17877 firstKey = _findValue4[3];
17878
17879 setValue(self.attributes, key, op._estimate(value, self, key));
17880
17881 if (actualTarget && actualTarget[actualKey] === AV.Op._UNSET) {
17882 delete actualTarget[actualKey];
17883 }
17884
17885 self._resetCacheForKey(firstKey);
17886 }
17887 });
17888 },
17889
17890 /**
17891 * Populates attributes by starting with the last known data from the
17892 * server, and applying all of the local changes that have been made since
17893 * then.
17894 * @private
17895 */
17896 _rebuildAllEstimatedData: function _rebuildAllEstimatedData() {
17897 var self = this;
17898
17899 var previousAttributes = _.clone(this.attributes);
17900
17901 this.attributes = _.clone(this._serverData);
17902
17903 AV._arrayEach(this._opSetQueue, function (opSet) {
17904 self._applyOpSet(opSet, self.attributes);
17905
17906 AV._objectEach(opSet, function (op, key) {
17907 self._resetCacheForKey(key);
17908 });
17909 }); // Trigger change events for anything that changed because of the fetch.
17910
17911
17912 AV._objectEach(previousAttributes, function (oldValue, key) {
17913 if (self.attributes[key] !== oldValue) {
17914 self.trigger('change:' + key, self, self.attributes[key], {});
17915 }
17916 });
17917
17918 AV._objectEach(this.attributes, function (newValue, key) {
17919 if (!_.has(previousAttributes, key)) {
17920 self.trigger('change:' + key, self, newValue, {});
17921 }
17922 });
17923 },
17924
17925 /**
17926 * Sets a hash of model attributes on the object, firing
17927 * <code>"change"</code> unless you choose to silence it.
17928 *
17929 * <p>You can call it with an object containing keys and values, or with one
17930 * key and value. For example:</p>
17931 *
17932 * @example
17933 * gameTurn.set({
17934 * player: player1,
17935 * diceRoll: 2
17936 * });
17937 *
17938 * game.set("currentPlayer", player2);
17939 *
17940 * game.set("finished", true);
17941 *
17942 * @param {String} key The key to set.
17943 * @param {Any} value The value to give it.
17944 * @param {Object} [options]
17945 * @param {Boolean} [options.silent]
17946 * @return {AV.Object} self if succeeded, throws if the value is not valid.
17947 * @see AV.Object#validate
17948 */
17949 set: function set(key, value, options) {
17950 var attrs;
17951
17952 if (_.isObject(key) || isNullOrUndefined(key)) {
17953 attrs = _.mapObject(key, function (v, k) {
17954 checkReservedKey(k);
17955 return AV._decode(v, k);
17956 });
17957 options = value;
17958 } else {
17959 attrs = {};
17960 checkReservedKey(key);
17961 attrs[key] = AV._decode(value, key);
17962 } // Extract attributes and options.
17963
17964
17965 options = options || {};
17966
17967 if (!attrs) {
17968 return this;
17969 }
17970
17971 if (attrs instanceof AV.Object) {
17972 attrs = attrs.attributes;
17973 } // If the unset option is used, every attribute should be a Unset.
17974
17975
17976 if (options.unset) {
17977 AV._objectEach(attrs, function (unused_value, key) {
17978 attrs[key] = new AV.Op.Unset();
17979 });
17980 } // Apply all the attributes to get the estimated values.
17981
17982
17983 var dataToValidate = _.clone(attrs);
17984
17985 var self = this;
17986
17987 AV._objectEach(dataToValidate, function (value, key) {
17988 if (value instanceof AV.Op) {
17989 dataToValidate[key] = value._estimate(self.attributes[key], self, key);
17990
17991 if (dataToValidate[key] === AV.Op._UNSET) {
17992 delete dataToValidate[key];
17993 }
17994 }
17995 }); // Run validation.
17996
17997
17998 this._validate(attrs, options);
17999
18000 options.changes = {};
18001 var escaped = this._escapedAttributes; // Update attributes.
18002
18003 AV._arrayEach((0, _keys2.default)(_).call(_, attrs), function (attr) {
18004 var val = attrs[attr]; // If this is a relation object we need to set the parent correctly,
18005 // since the location where it was parsed does not have access to
18006 // this object.
18007
18008 if (val instanceof AV.Relation) {
18009 val.parent = self;
18010 }
18011
18012 if (!(val instanceof AV.Op)) {
18013 val = new AV.Op.Set(val);
18014 } // See if this change will actually have any effect.
18015
18016
18017 var isRealChange = true;
18018
18019 if (val instanceof AV.Op.Set && _.isEqual(self.attributes[attr], val.value)) {
18020 isRealChange = false;
18021 }
18022
18023 if (isRealChange) {
18024 delete escaped[attr];
18025
18026 if (options.silent) {
18027 self._silent[attr] = true;
18028 } else {
18029 options.changes[attr] = true;
18030 }
18031 }
18032
18033 var currentChanges = _.last(self._opSetQueue);
18034
18035 currentChanges[attr] = val._mergeWithPrevious(currentChanges[attr]);
18036
18037 self._rebuildEstimatedDataForKey(attr);
18038
18039 if (isRealChange) {
18040 self.changed[attr] = self.attributes[attr];
18041
18042 if (!options.silent) {
18043 self._pending[attr] = true;
18044 }
18045 } else {
18046 delete self.changed[attr];
18047 delete self._pending[attr];
18048 }
18049 });
18050
18051 if (!options.silent) {
18052 this.change(options);
18053 }
18054
18055 return this;
18056 },
18057
18058 /**
18059 * Remove an attribute from the model, firing <code>"change"</code> unless
18060 * you choose to silence it. This is a noop if the attribute doesn't
18061 * exist.
18062 * @param key {String} The key.
18063 */
18064 unset: function unset(attr, options) {
18065 options = options || {};
18066 options.unset = true;
18067 return this.set(attr, null, options);
18068 },
18069
18070 /**
18071 * Atomically increments the value of the given attribute the next time the
18072 * object is saved. If no amount is specified, 1 is used by default.
18073 *
18074 * @param key {String} The key.
18075 * @param amount {Number} The amount to increment by.
18076 */
18077 increment: function increment(attr, amount) {
18078 if (_.isUndefined(amount) || _.isNull(amount)) {
18079 amount = 1;
18080 }
18081
18082 return this.set(attr, new AV.Op.Increment(amount));
18083 },
18084
18085 /**
18086 * Atomically add an object to the end of the array associated with a given
18087 * key.
18088 * @param key {String} The key.
18089 * @param item {} The item to add.
18090 */
18091 add: function add(attr, item) {
18092 return this.set(attr, new AV.Op.Add(ensureArray(item)));
18093 },
18094
18095 /**
18096 * Atomically add an object to the array associated with a given key, only
18097 * if it is not already present in the array. The position of the insert is
18098 * not guaranteed.
18099 *
18100 * @param key {String} The key.
18101 * @param item {} The object to add.
18102 */
18103 addUnique: function addUnique(attr, item) {
18104 return this.set(attr, new AV.Op.AddUnique(ensureArray(item)));
18105 },
18106
18107 /**
18108 * Atomically remove all instances of an object from the array associated
18109 * with a given key.
18110 *
18111 * @param key {String} The key.
18112 * @param item {} The object to remove.
18113 */
18114 remove: function remove(attr, item) {
18115 return this.set(attr, new AV.Op.Remove(ensureArray(item)));
18116 },
18117
18118 /**
18119 * Atomically apply a "bit and" operation on the value associated with a
18120 * given key.
18121 *
18122 * @param key {String} The key.
18123 * @param value {Number} The value to apply.
18124 */
18125 bitAnd: function bitAnd(attr, value) {
18126 return this.set(attr, new AV.Op.BitAnd(value));
18127 },
18128
18129 /**
18130 * Atomically apply a "bit or" operation on the value associated with a
18131 * given key.
18132 *
18133 * @param key {String} The key.
18134 * @param value {Number} The value to apply.
18135 */
18136 bitOr: function bitOr(attr, value) {
18137 return this.set(attr, new AV.Op.BitOr(value));
18138 },
18139
18140 /**
18141 * Atomically apply a "bit xor" operation on the value associated with a
18142 * given key.
18143 *
18144 * @param key {String} The key.
18145 * @param value {Number} The value to apply.
18146 */
18147 bitXor: function bitXor(attr, value) {
18148 return this.set(attr, new AV.Op.BitXor(value));
18149 },
18150
18151 /**
18152 * Returns an instance of a subclass of AV.Op describing what kind of
18153 * modification has been performed on this field since the last time it was
18154 * saved. For example, after calling object.increment("x"), calling
18155 * object.op("x") would return an instance of AV.Op.Increment.
18156 *
18157 * @param key {String} The key.
18158 * @returns {AV.Op} The operation, or undefined if none.
18159 */
18160 op: function op(attr) {
18161 return _.last(this._opSetQueue)[attr];
18162 },
18163
18164 /**
18165 * Clear all attributes on the model, firing <code>"change"</code> unless
18166 * you choose to silence it.
18167 */
18168 clear: function clear(options) {
18169 options = options || {};
18170 options.unset = true;
18171
18172 var keysToClear = _.extend(this.attributes, this._operations);
18173
18174 return this.set(keysToClear, options);
18175 },
18176
18177 /**
18178 * Clears any (or specific) changes to the model made since the last save.
18179 * @param {string|string[]} [keys] specify keys to revert.
18180 */
18181 revert: function revert(keys) {
18182 var lastOp = _.last(this._opSetQueue);
18183
18184 var _keys = ensureArray(keys || (0, _keys2.default)(_).call(_, lastOp));
18185
18186 _keys.forEach(function (key) {
18187 delete lastOp[key];
18188 });
18189
18190 this._rebuildAllEstimatedData();
18191
18192 return this;
18193 },
18194
18195 /**
18196 * Returns a JSON-encoded set of operations to be sent with the next save
18197 * request.
18198 * @private
18199 */
18200 _getSaveJSON: function _getSaveJSON() {
18201 var json = _.clone(_.first(this._opSetQueue));
18202
18203 AV._objectEach(json, function (op, key) {
18204 json[key] = op.toJSON();
18205 });
18206
18207 return json;
18208 },
18209
18210 /**
18211 * Returns true if this object can be serialized for saving.
18212 * @private
18213 */
18214 _canBeSerialized: function _canBeSerialized() {
18215 return AV.Object._canBeSerializedAsValue(this.attributes);
18216 },
18217
18218 /**
18219 * Fetch the model from the server. If the server's representation of the
18220 * model differs from its current attributes, they will be overriden,
18221 * triggering a <code>"change"</code> event.
18222 * @param {Object} fetchOptions Optional options to set 'keys',
18223 * 'include' and 'includeACL' option.
18224 * @param {AuthOptions} options
18225 * @return {Promise} A promise that is fulfilled when the fetch
18226 * completes.
18227 */
18228 fetch: function fetch() {
18229 var fetchOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
18230 var options = arguments.length > 1 ? arguments[1] : undefined;
18231
18232 if (!this.id) {
18233 throw new Error('Cannot fetch unsaved object');
18234 }
18235
18236 var self = this;
18237
18238 var request = _request('classes', this.className, this.id, 'GET', transformFetchOptions(fetchOptions), options);
18239
18240 return request.then(function (response) {
18241 var fetchedAttrs = self.parse(response);
18242
18243 self._cleanupUnsetKeys(fetchedAttrs, (0, _keys2.default)(fetchOptions) ? ensureArray((0, _keys2.default)(fetchOptions)).join(',').split(',') : undefined);
18244
18245 self._finishFetch(fetchedAttrs, true);
18246
18247 return self;
18248 });
18249 },
18250 _cleanupUnsetKeys: function _cleanupUnsetKeys(fetchedAttrs) {
18251 var _this2 = this;
18252
18253 var fetchedKeys = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (0, _keys2.default)(_).call(_, this._serverData);
18254
18255 _.forEach(fetchedKeys, function (key) {
18256 if (fetchedAttrs[key] === undefined) delete _this2._serverData[key];
18257 });
18258 },
18259
18260 /**
18261 * Set a hash of model attributes, and save the model to the server.
18262 * updatedAt will be updated when the request returns.
18263 * You can either call it as:<pre>
18264 * object.save();</pre>
18265 * or<pre>
18266 * object.save(null, options);</pre>
18267 * or<pre>
18268 * object.save(attrs, options);</pre>
18269 * or<pre>
18270 * object.save(key, value, options);</pre>
18271 *
18272 * @example
18273 * gameTurn.save({
18274 * player: "Jake Cutter",
18275 * diceRoll: 2
18276 * }).then(function(gameTurnAgain) {
18277 * // The save was successful.
18278 * }, function(error) {
18279 * // The save failed. Error is an instance of AVError.
18280 * });
18281 *
18282 * @param {AuthOptions} options AuthOptions plus:
18283 * @param {Boolean} options.fetchWhenSave fetch and update object after save succeeded
18284 * @param {AV.Query} options.query Save object only when it matches the query
18285 * @return {Promise} A promise that is fulfilled when the save
18286 * completes.
18287 * @see AVError
18288 */
18289 save: function save(arg1, arg2, arg3) {
18290 var attrs, current, options;
18291
18292 if (_.isObject(arg1) || isNullOrUndefined(arg1)) {
18293 attrs = arg1;
18294 options = arg2;
18295 } else {
18296 attrs = {};
18297 attrs[arg1] = arg2;
18298 options = arg3;
18299 }
18300
18301 options = _.clone(options) || {};
18302
18303 if (options.wait) {
18304 current = _.clone(this.attributes);
18305 }
18306
18307 var setOptions = _.clone(options) || {};
18308
18309 if (setOptions.wait) {
18310 setOptions.silent = true;
18311 }
18312
18313 if (attrs) {
18314 this.set(attrs, setOptions);
18315 }
18316
18317 var model = this;
18318 var unsavedChildren = [];
18319 var unsavedFiles = [];
18320
18321 AV.Object._findUnsavedChildren(model, unsavedChildren, unsavedFiles);
18322
18323 if (unsavedChildren.length + unsavedFiles.length > 1) {
18324 return AV.Object._deepSaveAsync(this, model, options);
18325 }
18326
18327 this._startSave();
18328
18329 this._saving = (this._saving || 0) + 1;
18330 this._allPreviousSaves = this._allPreviousSaves || _promise.default.resolve();
18331 this._allPreviousSaves = this._allPreviousSaves.catch(function (e) {}).then(function () {
18332 var method = model.id ? 'PUT' : 'POST';
18333
18334 var json = model._getSaveJSON();
18335
18336 var query = {};
18337
18338 if (model._fetchWhenSave || options.fetchWhenSave) {
18339 query['new'] = 'true';
18340 } // user login option
18341
18342
18343 if (options._failOnNotExist) {
18344 query.failOnNotExist = 'true';
18345 }
18346
18347 if (options.query) {
18348 var queryParams;
18349
18350 if (typeof options.query._getParams === 'function') {
18351 queryParams = options.query._getParams();
18352
18353 if (queryParams) {
18354 query.where = queryParams.where;
18355 }
18356 }
18357
18358 if (!query.where) {
18359 var error = new Error('options.query is not an AV.Query');
18360 throw error;
18361 }
18362 }
18363
18364 _.extend(json, model._flags);
18365
18366 var route = 'classes';
18367 var className = model.className;
18368
18369 if (model.className === '_User' && !model.id) {
18370 // Special-case user sign-up.
18371 route = 'users';
18372 className = null;
18373 } //hook makeRequest in options.
18374
18375
18376 var makeRequest = options._makeRequest || _request;
18377 var requestPromise = makeRequest(route, className, model.id, method, json, options, query);
18378 requestPromise = requestPromise.then(function (resp) {
18379 var serverAttrs = model.parse(resp);
18380
18381 if (options.wait) {
18382 serverAttrs = _.extend(attrs || {}, serverAttrs);
18383 }
18384
18385 model._finishSave(serverAttrs);
18386
18387 if (options.wait) {
18388 model.set(current, setOptions);
18389 }
18390
18391 return model;
18392 }, function (error) {
18393 model._cancelSave();
18394
18395 throw error;
18396 });
18397 return requestPromise;
18398 });
18399 return this._allPreviousSaves;
18400 },
18401
18402 /**
18403 * Destroy this model on the server if it was already persisted.
18404 * Optimistically removes the model from its collection, if it has one.
18405 * @param {AuthOptions} options AuthOptions plus:
18406 * @param {Boolean} [options.wait] wait for the server to respond
18407 * before removal.
18408 *
18409 * @return {Promise} A promise that is fulfilled when the destroy
18410 * completes.
18411 */
18412 destroy: function destroy(options) {
18413 options = options || {};
18414 var model = this;
18415
18416 var triggerDestroy = function triggerDestroy() {
18417 model.trigger('destroy', model, model.collection, options);
18418 };
18419
18420 if (!this.id) {
18421 return triggerDestroy();
18422 }
18423
18424 if (!options.wait) {
18425 triggerDestroy();
18426 }
18427
18428 var request = _request('classes', this.className, this.id, 'DELETE', this._flags, options);
18429
18430 return request.then(function () {
18431 if (options.wait) {
18432 triggerDestroy();
18433 }
18434
18435 return model;
18436 });
18437 },
18438
18439 /**
18440 * Converts a response into the hash of attributes to be set on the model.
18441 * @ignore
18442 */
18443 parse: function parse(resp) {
18444 var output = _.clone(resp);
18445
18446 ['createdAt', 'updatedAt'].forEach(function (key) {
18447 if (output[key]) {
18448 output[key] = AV._parseDate(output[key]);
18449 }
18450 });
18451
18452 if (output.createdAt && !output.updatedAt) {
18453 output.updatedAt = output.createdAt;
18454 }
18455
18456 return output;
18457 },
18458
18459 /**
18460 * Creates a new model with identical attributes to this one.
18461 * @return {AV.Object}
18462 */
18463 clone: function clone() {
18464 return new this.constructor(this.attributes);
18465 },
18466
18467 /**
18468 * Returns true if this object has never been saved to AV.
18469 * @return {Boolean}
18470 */
18471 isNew: function isNew() {
18472 return !this.id;
18473 },
18474
18475 /**
18476 * Call this method to manually fire a `"change"` event for this model and
18477 * a `"change:attribute"` event for each changed attribute.
18478 * Calling this will cause all objects observing the model to update.
18479 */
18480 change: function change(options) {
18481 options = options || {};
18482 var changing = this._changing;
18483 this._changing = true; // Silent changes become pending changes.
18484
18485 var self = this;
18486
18487 AV._objectEach(this._silent, function (attr) {
18488 self._pending[attr] = true;
18489 }); // Silent changes are triggered.
18490
18491
18492 var changes = _.extend({}, options.changes, this._silent);
18493
18494 this._silent = {};
18495
18496 AV._objectEach(changes, function (unused_value, attr) {
18497 self.trigger('change:' + attr, self, self.get(attr), options);
18498 });
18499
18500 if (changing) {
18501 return this;
18502 } // This is to get around lint not letting us make a function in a loop.
18503
18504
18505 var deleteChanged = function deleteChanged(value, attr) {
18506 if (!self._pending[attr] && !self._silent[attr]) {
18507 delete self.changed[attr];
18508 }
18509 }; // Continue firing `"change"` events while there are pending changes.
18510
18511
18512 while (!_.isEmpty(this._pending)) {
18513 this._pending = {};
18514 this.trigger('change', this, options); // Pending and silent changes still remain.
18515
18516 AV._objectEach(this.changed, deleteChanged);
18517
18518 self._previousAttributes = _.clone(this.attributes);
18519 }
18520
18521 this._changing = false;
18522 return this;
18523 },
18524
18525 /**
18526 * Gets the previous value of an attribute, recorded at the time the last
18527 * <code>"change"</code> event was fired.
18528 * @param {String} attr Name of the attribute to get.
18529 */
18530 previous: function previous(attr) {
18531 if (!arguments.length || !this._previousAttributes) {
18532 return null;
18533 }
18534
18535 return this._previousAttributes[attr];
18536 },
18537
18538 /**
18539 * Gets all of the attributes of the model at the time of the previous
18540 * <code>"change"</code> event.
18541 * @return {Object}
18542 */
18543 previousAttributes: function previousAttributes() {
18544 return _.clone(this._previousAttributes);
18545 },
18546
18547 /**
18548 * Checks if the model is currently in a valid state. It's only possible to
18549 * get into an *invalid* state if you're using silent changes.
18550 * @return {Boolean}
18551 */
18552 isValid: function isValid() {
18553 try {
18554 this.validate(this.attributes);
18555 } catch (error) {
18556 return false;
18557 }
18558
18559 return true;
18560 },
18561
18562 /**
18563 * You should not call this function directly unless you subclass
18564 * <code>AV.Object</code>, in which case you can override this method
18565 * to provide additional validation on <code>set</code> and
18566 * <code>save</code>. Your implementation should throw an Error if
18567 * the attrs is invalid
18568 *
18569 * @param {Object} attrs The current data to validate.
18570 * @see AV.Object#set
18571 */
18572 validate: function validate(attrs) {
18573 if (_.has(attrs, 'ACL') && !(attrs.ACL instanceof AV.ACL)) {
18574 throw new AVError(AVError.OTHER_CAUSE, 'ACL must be a AV.ACL.');
18575 }
18576 },
18577
18578 /**
18579 * Run validation against a set of incoming attributes, returning `true`
18580 * if all is well. If a specific `error` callback has been passed,
18581 * call that instead of firing the general `"error"` event.
18582 * @private
18583 */
18584 _validate: function _validate(attrs, options) {
18585 if (options.silent || !this.validate) {
18586 return;
18587 }
18588
18589 attrs = _.extend({}, this.attributes, attrs);
18590 this.validate(attrs);
18591 },
18592
18593 /**
18594 * Returns the ACL for this object.
18595 * @returns {AV.ACL} An instance of AV.ACL.
18596 * @see AV.Object#get
18597 */
18598 getACL: function getACL() {
18599 return this.get('ACL');
18600 },
18601
18602 /**
18603 * Sets the ACL to be used for this object.
18604 * @param {AV.ACL} acl An instance of AV.ACL.
18605 * @param {Object} options Optional Backbone-like options object to be
18606 * passed in to set.
18607 * @return {AV.Object} self
18608 * @see AV.Object#set
18609 */
18610 setACL: function setACL(acl, options) {
18611 return this.set('ACL', acl, options);
18612 },
18613 disableBeforeHook: function disableBeforeHook() {
18614 this.ignoreHook('beforeSave');
18615 this.ignoreHook('beforeUpdate');
18616 this.ignoreHook('beforeDelete');
18617 },
18618 disableAfterHook: function disableAfterHook() {
18619 this.ignoreHook('afterSave');
18620 this.ignoreHook('afterUpdate');
18621 this.ignoreHook('afterDelete');
18622 },
18623 ignoreHook: function ignoreHook(hookName) {
18624 if (!_.contains(['beforeSave', 'afterSave', 'beforeUpdate', 'afterUpdate', 'beforeDelete', 'afterDelete'], hookName)) {
18625 throw new Error('Unsupported hookName: ' + hookName);
18626 }
18627
18628 if (!AV.hookKey) {
18629 throw new Error('ignoreHook required hookKey');
18630 }
18631
18632 if (!this._flags.__ignore_hooks) {
18633 this._flags.__ignore_hooks = [];
18634 }
18635
18636 this._flags.__ignore_hooks.push(hookName);
18637 }
18638 });
18639 /**
18640 * Creates an instance of a subclass of AV.Object for the give classname
18641 * and id.
18642 * @param {String|Function} class the className or a subclass of AV.Object.
18643 * @param {String} id The object id of this model.
18644 * @return {AV.Object} A new subclass instance of AV.Object.
18645 */
18646
18647
18648 AV.Object.createWithoutData = function (klass, id, hasData) {
18649 var _klass;
18650
18651 if (_.isString(klass)) {
18652 _klass = AV.Object._getSubclass(klass);
18653 } else if (klass.prototype && klass.prototype instanceof AV.Object) {
18654 _klass = klass;
18655 } else {
18656 throw new Error('class must be a string or a subclass of AV.Object.');
18657 }
18658
18659 if (!id) {
18660 throw new TypeError('The objectId must be provided');
18661 }
18662
18663 var object = new _klass();
18664 object.id = id;
18665 object._hasData = hasData;
18666 return object;
18667 };
18668 /**
18669 * Delete objects in batch.
18670 * @param {AV.Object[]} objects The <code>AV.Object</code> array to be deleted.
18671 * @param {AuthOptions} options
18672 * @return {Promise} A promise that is fulfilled when the save
18673 * completes.
18674 */
18675
18676
18677 AV.Object.destroyAll = function (objects) {
18678 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
18679
18680 if (!objects || objects.length === 0) {
18681 return _promise.default.resolve();
18682 }
18683
18684 var objectsByClassNameAndFlags = _.groupBy(objects, function (object) {
18685 return (0, _stringify.default)({
18686 className: object.className,
18687 flags: object._flags
18688 });
18689 });
18690
18691 var body = {
18692 requests: (0, _map.default)(_).call(_, objectsByClassNameAndFlags, function (objects) {
18693 var _context3;
18694
18695 var ids = (0, _map.default)(_).call(_, objects, 'id').join(',');
18696 return {
18697 method: 'DELETE',
18698 path: (0, _concat.default)(_context3 = "/1.1/classes/".concat(objects[0].className, "/")).call(_context3, ids),
18699 body: objects[0]._flags
18700 };
18701 })
18702 };
18703 return _request('batch', null, null, 'POST', body, options).then(function (response) {
18704 var firstError = (0, _find.default)(_).call(_, response, function (result) {
18705 return !result.success;
18706 });
18707 if (firstError) throw new AVError(firstError.error.code, firstError.error.error);
18708 return undefined;
18709 });
18710 };
18711 /**
18712 * Returns the appropriate subclass for making new instances of the given
18713 * className string.
18714 * @private
18715 */
18716
18717
18718 AV.Object._getSubclass = function (className) {
18719 if (!_.isString(className)) {
18720 throw new Error('AV.Object._getSubclass requires a string argument.');
18721 }
18722
18723 var ObjectClass = AV.Object._classMap[className];
18724
18725 if (!ObjectClass) {
18726 ObjectClass = AV.Object.extend(className);
18727 AV.Object._classMap[className] = ObjectClass;
18728 }
18729
18730 return ObjectClass;
18731 };
18732 /**
18733 * Creates an instance of a subclass of AV.Object for the given classname.
18734 * @private
18735 */
18736
18737
18738 AV.Object._create = function (className, attributes, options) {
18739 var ObjectClass = AV.Object._getSubclass(className);
18740
18741 return new ObjectClass(attributes, options);
18742 }; // Set up a map of className to class so that we can create new instances of
18743 // AV Objects from JSON automatically.
18744
18745
18746 AV.Object._classMap = {};
18747 AV.Object._extend = AV._extend;
18748 /**
18749 * Creates a new model with defined attributes,
18750 * It's the same with
18751 * <pre>
18752 * new AV.Object(attributes, options);
18753 * </pre>
18754 * @param {Object} attributes The initial set of data to store in the object.
18755 * @param {Object} options A set of Backbone-like options for creating the
18756 * object. The only option currently supported is "collection".
18757 * @return {AV.Object}
18758 * @since v0.4.4
18759 * @see AV.Object
18760 * @see AV.Object.extend
18761 */
18762
18763 AV.Object['new'] = function (attributes, options) {
18764 return new AV.Object(attributes, options);
18765 };
18766 /**
18767 * Creates a new subclass of AV.Object for the given AV class name.
18768 *
18769 * <p>Every extension of a AV class will inherit from the most recent
18770 * previous extension of that class. When a AV.Object is automatically
18771 * created by parsing JSON, it will use the most recent extension of that
18772 * class.</p>
18773 *
18774 * @example
18775 * var MyClass = AV.Object.extend("MyClass", {
18776 * // Instance properties
18777 * }, {
18778 * // Class properties
18779 * });
18780 *
18781 * @param {String} className The name of the AV class backing this model.
18782 * @param {Object} protoProps Instance properties to add to instances of the
18783 * class returned from this method.
18784 * @param {Object} classProps Class properties to add the class returned from
18785 * this method.
18786 * @return {Class} A new subclass of AV.Object.
18787 */
18788
18789
18790 AV.Object.extend = function (className, protoProps, classProps) {
18791 // Handle the case with only two args.
18792 if (!_.isString(className)) {
18793 if (className && _.has(className, 'className')) {
18794 return AV.Object.extend(className.className, className, protoProps);
18795 } else {
18796 throw new Error("AV.Object.extend's first argument should be the className.");
18797 }
18798 } // If someone tries to subclass "User", coerce it to the right type.
18799
18800
18801 if (className === 'User') {
18802 className = '_User';
18803 }
18804
18805 var NewClassObject = null;
18806
18807 if (_.has(AV.Object._classMap, className)) {
18808 var OldClassObject = AV.Object._classMap[className]; // This new subclass has been told to extend both from "this" and from
18809 // OldClassObject. This is multiple inheritance, which isn't supported.
18810 // For now, let's just pick one.
18811
18812 if (protoProps || classProps) {
18813 NewClassObject = OldClassObject._extend(protoProps, classProps);
18814 } else {
18815 return OldClassObject;
18816 }
18817 } else {
18818 protoProps = protoProps || {};
18819 protoProps._className = className;
18820 NewClassObject = this._extend(protoProps, classProps);
18821 } // Extending a subclass should reuse the classname automatically.
18822
18823
18824 NewClassObject.extend = function (arg0) {
18825 var _context4;
18826
18827 if (_.isString(arg0) || arg0 && _.has(arg0, 'className')) {
18828 return AV.Object.extend.apply(NewClassObject, arguments);
18829 }
18830
18831 var newArguments = (0, _concat.default)(_context4 = [className]).call(_context4, _.toArray(arguments));
18832 return AV.Object.extend.apply(NewClassObject, newArguments);
18833 }; // Add the query property descriptor.
18834
18835
18836 (0, _defineProperty.default)(NewClassObject, 'query', (0, _getOwnPropertyDescriptor.default)(AV.Object, 'query'));
18837
18838 NewClassObject['new'] = function (attributes, options) {
18839 return new NewClassObject(attributes, options);
18840 };
18841
18842 AV.Object._classMap[className] = NewClassObject;
18843 return NewClassObject;
18844 }; // ES6 class syntax support
18845
18846
18847 (0, _defineProperty.default)(AV.Object.prototype, 'className', {
18848 get: function get() {
18849 var className = this._className || this.constructor._LCClassName || this.constructor.name; // If someone tries to subclass "User", coerce it to the right type.
18850
18851 if (className === 'User') {
18852 return '_User';
18853 }
18854
18855 return className;
18856 }
18857 });
18858 /**
18859 * Register a class.
18860 * If a subclass of <code>AV.Object</code> is defined with your own implement
18861 * rather then <code>AV.Object.extend</code>, the subclass must be registered.
18862 * @param {Function} klass A subclass of <code>AV.Object</code>
18863 * @param {String} [name] Specify the name of the class. Useful when the class might be uglified.
18864 * @example
18865 * class Person extend AV.Object {}
18866 * AV.Object.register(Person);
18867 */
18868
18869 AV.Object.register = function (klass, name) {
18870 if (!(klass.prototype instanceof AV.Object)) {
18871 throw new Error('registered class is not a subclass of AV.Object');
18872 }
18873
18874 var className = name || klass.name;
18875
18876 if (!className.length) {
18877 throw new Error('registered class must be named');
18878 }
18879
18880 if (name) {
18881 klass._LCClassName = name;
18882 }
18883
18884 AV.Object._classMap[className] = klass;
18885 };
18886 /**
18887 * Get a new Query of the current class
18888 * @name query
18889 * @memberof AV.Object
18890 * @type AV.Query
18891 * @readonly
18892 * @since v3.1.0
18893 * @example
18894 * const Post = AV.Object.extend('Post');
18895 * Post.query.equalTo('author', 'leancloud').find().then();
18896 */
18897
18898
18899 (0, _defineProperty.default)(AV.Object, 'query', {
18900 get: function get() {
18901 return new AV.Query(this.prototype.className);
18902 }
18903 });
18904
18905 AV.Object._findUnsavedChildren = function (objects, children, files) {
18906 AV._traverse(objects, function (object) {
18907 if (object instanceof AV.Object) {
18908 if (object.dirty()) {
18909 children.push(object);
18910 }
18911
18912 return;
18913 }
18914
18915 if (object instanceof AV.File) {
18916 if (!object.id) {
18917 files.push(object);
18918 }
18919
18920 return;
18921 }
18922 });
18923 };
18924
18925 AV.Object._canBeSerializedAsValue = function (object) {
18926 var canBeSerializedAsValue = true;
18927
18928 if (object instanceof AV.Object || object instanceof AV.File) {
18929 canBeSerializedAsValue = !!object.id;
18930 } else if (_.isArray(object)) {
18931 AV._arrayEach(object, function (child) {
18932 if (!AV.Object._canBeSerializedAsValue(child)) {
18933 canBeSerializedAsValue = false;
18934 }
18935 });
18936 } else if (_.isObject(object)) {
18937 AV._objectEach(object, function (child) {
18938 if (!AV.Object._canBeSerializedAsValue(child)) {
18939 canBeSerializedAsValue = false;
18940 }
18941 });
18942 }
18943
18944 return canBeSerializedAsValue;
18945 };
18946
18947 AV.Object._deepSaveAsync = function (object, model, options) {
18948 var unsavedChildren = [];
18949 var unsavedFiles = [];
18950
18951 AV.Object._findUnsavedChildren(object, unsavedChildren, unsavedFiles);
18952
18953 unsavedFiles = _.uniq(unsavedFiles);
18954
18955 var promise = _promise.default.resolve();
18956
18957 _.each(unsavedFiles, function (file) {
18958 promise = promise.then(function () {
18959 return file.save();
18960 });
18961 });
18962
18963 var objects = _.uniq(unsavedChildren);
18964
18965 var remaining = _.uniq(objects);
18966
18967 return promise.then(function () {
18968 return continueWhile(function () {
18969 return remaining.length > 0;
18970 }, function () {
18971 // Gather up all the objects that can be saved in this batch.
18972 var batch = [];
18973 var newRemaining = [];
18974
18975 AV._arrayEach(remaining, function (object) {
18976 if (object._canBeSerialized()) {
18977 batch.push(object);
18978 } else {
18979 newRemaining.push(object);
18980 }
18981 });
18982
18983 remaining = newRemaining; // If we can't save any objects, there must be a circular reference.
18984
18985 if (batch.length === 0) {
18986 return _promise.default.reject(new AVError(AVError.OTHER_CAUSE, 'Tried to save a batch with a cycle.'));
18987 } // Reserve a spot in every object's save queue.
18988
18989
18990 var readyToStart = _promise.default.resolve((0, _map.default)(_).call(_, batch, function (object) {
18991 return object._allPreviousSaves || _promise.default.resolve();
18992 })); // Save a single batch, whether previous saves succeeded or failed.
18993
18994
18995 var bathSavePromise = readyToStart.then(function () {
18996 return _request('batch', null, null, 'POST', {
18997 requests: (0, _map.default)(_).call(_, batch, function (object) {
18998 var method = object.id ? 'PUT' : 'POST';
18999
19000 var json = object._getSaveJSON();
19001
19002 _.extend(json, object._flags);
19003
19004 var route = 'classes';
19005 var className = object.className;
19006 var path = "/".concat(route, "/").concat(className);
19007
19008 if (object.className === '_User' && !object.id) {
19009 // Special-case user sign-up.
19010 path = '/users';
19011 }
19012
19013 var path = "/1.1".concat(path);
19014
19015 if (object.id) {
19016 path = path + '/' + object.id;
19017 }
19018
19019 object._startSave();
19020
19021 return {
19022 method: method,
19023 path: path,
19024 body: json,
19025 params: options && options.fetchWhenSave ? {
19026 fetchWhenSave: true
19027 } : undefined
19028 };
19029 })
19030 }, options).then(function (response) {
19031 var results = (0, _map.default)(_).call(_, batch, function (object, i) {
19032 if (response[i].success) {
19033 object._finishSave(object.parse(response[i].success));
19034
19035 return object;
19036 }
19037
19038 object._cancelSave();
19039
19040 return new AVError(response[i].error.code, response[i].error.error);
19041 });
19042 return handleBatchResults(results);
19043 });
19044 });
19045
19046 AV._arrayEach(batch, function (object) {
19047 object._allPreviousSaves = bathSavePromise;
19048 });
19049
19050 return bathSavePromise;
19051 });
19052 }).then(function () {
19053 return object;
19054 });
19055 };
19056};
19057
19058/***/ }),
19059/* 507 */
19060/***/ (function(module, exports, __webpack_require__) {
19061
19062var arrayWithHoles = __webpack_require__(508);
19063
19064var iterableToArrayLimit = __webpack_require__(516);
19065
19066var unsupportedIterableToArray = __webpack_require__(517);
19067
19068var nonIterableRest = __webpack_require__(527);
19069
19070function _slicedToArray(arr, i) {
19071 return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
19072}
19073
19074module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
19075
19076/***/ }),
19077/* 508 */
19078/***/ (function(module, exports, __webpack_require__) {
19079
19080var _Array$isArray = __webpack_require__(509);
19081
19082function _arrayWithHoles(arr) {
19083 if (_Array$isArray(arr)) return arr;
19084}
19085
19086module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
19087
19088/***/ }),
19089/* 509 */
19090/***/ (function(module, exports, __webpack_require__) {
19091
19092module.exports = __webpack_require__(510);
19093
19094/***/ }),
19095/* 510 */
19096/***/ (function(module, exports, __webpack_require__) {
19097
19098module.exports = __webpack_require__(511);
19099
19100
19101/***/ }),
19102/* 511 */
19103/***/ (function(module, exports, __webpack_require__) {
19104
19105var parent = __webpack_require__(512);
19106
19107module.exports = parent;
19108
19109
19110/***/ }),
19111/* 512 */
19112/***/ (function(module, exports, __webpack_require__) {
19113
19114var parent = __webpack_require__(513);
19115
19116module.exports = parent;
19117
19118
19119/***/ }),
19120/* 513 */
19121/***/ (function(module, exports, __webpack_require__) {
19122
19123var parent = __webpack_require__(514);
19124
19125module.exports = parent;
19126
19127
19128/***/ }),
19129/* 514 */
19130/***/ (function(module, exports, __webpack_require__) {
19131
19132__webpack_require__(515);
19133var path = __webpack_require__(10);
19134
19135module.exports = path.Array.isArray;
19136
19137
19138/***/ }),
19139/* 515 */
19140/***/ (function(module, exports, __webpack_require__) {
19141
19142var $ = __webpack_require__(0);
19143var isArray = __webpack_require__(85);
19144
19145// `Array.isArray` method
19146// https://tc39.es/ecma262/#sec-array.isarray
19147$({ target: 'Array', stat: true }, {
19148 isArray: isArray
19149});
19150
19151
19152/***/ }),
19153/* 516 */
19154/***/ (function(module, exports, __webpack_require__) {
19155
19156var _Symbol = __webpack_require__(231);
19157
19158var _getIteratorMethod = __webpack_require__(241);
19159
19160function _iterableToArrayLimit(arr, i) {
19161 var _i = arr == null ? null : typeof _Symbol !== "undefined" && _getIteratorMethod(arr) || arr["@@iterator"];
19162
19163 if (_i == null) return;
19164 var _arr = [];
19165 var _n = true;
19166 var _d = false;
19167
19168 var _s, _e;
19169
19170 try {
19171 for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
19172 _arr.push(_s.value);
19173
19174 if (i && _arr.length === i) break;
19175 }
19176 } catch (err) {
19177 _d = true;
19178 _e = err;
19179 } finally {
19180 try {
19181 if (!_n && _i["return"] != null) _i["return"]();
19182 } finally {
19183 if (_d) throw _e;
19184 }
19185 }
19186
19187 return _arr;
19188}
19189
19190module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports;
19191
19192/***/ }),
19193/* 517 */
19194/***/ (function(module, exports, __webpack_require__) {
19195
19196var _sliceInstanceProperty = __webpack_require__(518);
19197
19198var _Array$from = __webpack_require__(522);
19199
19200var arrayLikeToArray = __webpack_require__(526);
19201
19202function _unsupportedIterableToArray(o, minLen) {
19203 var _context;
19204
19205 if (!o) return;
19206 if (typeof o === "string") return arrayLikeToArray(o, minLen);
19207
19208 var n = _sliceInstanceProperty(_context = Object.prototype.toString.call(o)).call(_context, 8, -1);
19209
19210 if (n === "Object" && o.constructor) n = o.constructor.name;
19211 if (n === "Map" || n === "Set") return _Array$from(o);
19212 if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
19213}
19214
19215module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
19216
19217/***/ }),
19218/* 518 */
19219/***/ (function(module, exports, __webpack_require__) {
19220
19221module.exports = __webpack_require__(519);
19222
19223/***/ }),
19224/* 519 */
19225/***/ (function(module, exports, __webpack_require__) {
19226
19227module.exports = __webpack_require__(520);
19228
19229
19230/***/ }),
19231/* 520 */
19232/***/ (function(module, exports, __webpack_require__) {
19233
19234var parent = __webpack_require__(521);
19235
19236module.exports = parent;
19237
19238
19239/***/ }),
19240/* 521 */
19241/***/ (function(module, exports, __webpack_require__) {
19242
19243var parent = __webpack_require__(229);
19244
19245module.exports = parent;
19246
19247
19248/***/ }),
19249/* 522 */
19250/***/ (function(module, exports, __webpack_require__) {
19251
19252module.exports = __webpack_require__(523);
19253
19254/***/ }),
19255/* 523 */
19256/***/ (function(module, exports, __webpack_require__) {
19257
19258module.exports = __webpack_require__(524);
19259
19260
19261/***/ }),
19262/* 524 */
19263/***/ (function(module, exports, __webpack_require__) {
19264
19265var parent = __webpack_require__(525);
19266
19267module.exports = parent;
19268
19269
19270/***/ }),
19271/* 525 */
19272/***/ (function(module, exports, __webpack_require__) {
19273
19274var parent = __webpack_require__(239);
19275
19276module.exports = parent;
19277
19278
19279/***/ }),
19280/* 526 */
19281/***/ (function(module, exports) {
19282
19283function _arrayLikeToArray(arr, len) {
19284 if (len == null || len > arr.length) len = arr.length;
19285
19286 for (var i = 0, arr2 = new Array(len); i < len; i++) {
19287 arr2[i] = arr[i];
19288 }
19289
19290 return arr2;
19291}
19292
19293module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
19294
19295/***/ }),
19296/* 527 */
19297/***/ (function(module, exports) {
19298
19299function _nonIterableRest() {
19300 throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
19301}
19302
19303module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports;
19304
19305/***/ }),
19306/* 528 */
19307/***/ (function(module, exports, __webpack_require__) {
19308
19309var parent = __webpack_require__(529);
19310
19311module.exports = parent;
19312
19313
19314/***/ }),
19315/* 529 */
19316/***/ (function(module, exports, __webpack_require__) {
19317
19318__webpack_require__(530);
19319var path = __webpack_require__(10);
19320
19321var Object = path.Object;
19322
19323var getOwnPropertyDescriptor = module.exports = function getOwnPropertyDescriptor(it, key) {
19324 return Object.getOwnPropertyDescriptor(it, key);
19325};
19326
19327if (Object.getOwnPropertyDescriptor.sham) getOwnPropertyDescriptor.sham = true;
19328
19329
19330/***/ }),
19331/* 530 */
19332/***/ (function(module, exports, __webpack_require__) {
19333
19334var $ = __webpack_require__(0);
19335var fails = __webpack_require__(3);
19336var toIndexedObject = __webpack_require__(33);
19337var nativeGetOwnPropertyDescriptor = __webpack_require__(71).f;
19338var DESCRIPTORS = __webpack_require__(16);
19339
19340var FAILS_ON_PRIMITIVES = fails(function () { nativeGetOwnPropertyDescriptor(1); });
19341var FORCED = !DESCRIPTORS || FAILS_ON_PRIMITIVES;
19342
19343// `Object.getOwnPropertyDescriptor` method
19344// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
19345$({ target: 'Object', stat: true, forced: FORCED, sham: !DESCRIPTORS }, {
19346 getOwnPropertyDescriptor: function getOwnPropertyDescriptor(it, key) {
19347 return nativeGetOwnPropertyDescriptor(toIndexedObject(it), key);
19348 }
19349});
19350
19351
19352/***/ }),
19353/* 531 */
19354/***/ (function(module, exports, __webpack_require__) {
19355
19356"use strict";
19357
19358
19359var _ = __webpack_require__(2);
19360
19361var AVError = __webpack_require__(43);
19362
19363module.exports = function (AV) {
19364 AV.Role = AV.Object.extend('_Role',
19365 /** @lends AV.Role.prototype */
19366 {
19367 // Instance Methods
19368
19369 /**
19370 * Represents a Role on the AV server. Roles represent groupings of
19371 * Users for the purposes of granting permissions (e.g. specifying an ACL
19372 * for an Object). Roles are specified by their sets of child users and
19373 * child roles, all of which are granted any permissions that the parent
19374 * role has.
19375 *
19376 * <p>Roles must have a name (which cannot be changed after creation of the
19377 * role), and must specify an ACL.</p>
19378 * An AV.Role is a local representation of a role persisted to the AV
19379 * cloud.
19380 * @class AV.Role
19381 * @param {String} name The name of the Role to create.
19382 * @param {AV.ACL} acl The ACL for this role.
19383 */
19384 constructor: function constructor(name, acl) {
19385 if (_.isString(name)) {
19386 AV.Object.prototype.constructor.call(this, null, null);
19387 this.setName(name);
19388 } else {
19389 AV.Object.prototype.constructor.call(this, name, acl);
19390 }
19391
19392 if (acl) {
19393 if (!(acl instanceof AV.ACL)) {
19394 throw new TypeError('acl must be an instance of AV.ACL');
19395 } else {
19396 this.setACL(acl);
19397 }
19398 }
19399 },
19400
19401 /**
19402 * Gets the name of the role. You can alternatively call role.get("name")
19403 *
19404 * @return {String} the name of the role.
19405 */
19406 getName: function getName() {
19407 return this.get('name');
19408 },
19409
19410 /**
19411 * Sets the name for a role. This value must be set before the role has
19412 * been saved to the server, and cannot be set once the role has been
19413 * saved.
19414 *
19415 * <p>
19416 * A role's name can only contain alphanumeric characters, _, -, and
19417 * spaces.
19418 * </p>
19419 *
19420 * <p>This is equivalent to calling role.set("name", name)</p>
19421 *
19422 * @param {String} name The name of the role.
19423 */
19424 setName: function setName(name, options) {
19425 return this.set('name', name, options);
19426 },
19427
19428 /**
19429 * Gets the AV.Relation for the AV.Users that are direct
19430 * children of this role. These users are granted any privileges that this
19431 * role has been granted (e.g. read or write access through ACLs). You can
19432 * add or remove users from the role through this relation.
19433 *
19434 * <p>This is equivalent to calling role.relation("users")</p>
19435 *
19436 * @return {AV.Relation} the relation for the users belonging to this
19437 * role.
19438 */
19439 getUsers: function getUsers() {
19440 return this.relation('users');
19441 },
19442
19443 /**
19444 * Gets the AV.Relation for the AV.Roles that are direct
19445 * children of this role. These roles' users are granted any privileges that
19446 * this role has been granted (e.g. read or write access through ACLs). You
19447 * can add or remove child roles from this role through this relation.
19448 *
19449 * <p>This is equivalent to calling role.relation("roles")</p>
19450 *
19451 * @return {AV.Relation} the relation for the roles belonging to this
19452 * role.
19453 */
19454 getRoles: function getRoles() {
19455 return this.relation('roles');
19456 },
19457
19458 /**
19459 * @ignore
19460 */
19461 validate: function validate(attrs, options) {
19462 if ('name' in attrs && attrs.name !== this.getName()) {
19463 var newName = attrs.name;
19464
19465 if (this.id && this.id !== attrs.objectId) {
19466 // Check to see if the objectId being set matches this.id.
19467 // This happens during a fetch -- the id is set before calling fetch.
19468 // Let the name be set in this case.
19469 return new AVError(AVError.OTHER_CAUSE, "A role's name can only be set before it has been saved.");
19470 }
19471
19472 if (!_.isString(newName)) {
19473 return new AVError(AVError.OTHER_CAUSE, "A role's name must be a String.");
19474 }
19475
19476 if (!/^[0-9a-zA-Z\-_ ]+$/.test(newName)) {
19477 return new AVError(AVError.OTHER_CAUSE, "A role's name can only contain alphanumeric characters, _," + ' -, and spaces.');
19478 }
19479 }
19480
19481 if (AV.Object.prototype.validate) {
19482 return AV.Object.prototype.validate.call(this, attrs, options);
19483 }
19484
19485 return false;
19486 }
19487 });
19488};
19489
19490/***/ }),
19491/* 532 */
19492/***/ (function(module, exports, __webpack_require__) {
19493
19494"use strict";
19495
19496
19497var _interopRequireDefault = __webpack_require__(1);
19498
19499var _defineProperty2 = _interopRequireDefault(__webpack_require__(533));
19500
19501var _promise = _interopRequireDefault(__webpack_require__(12));
19502
19503var _map = _interopRequireDefault(__webpack_require__(42));
19504
19505var _find = _interopRequireDefault(__webpack_require__(110));
19506
19507var _stringify = _interopRequireDefault(__webpack_require__(36));
19508
19509var _ = __webpack_require__(2);
19510
19511var uuid = __webpack_require__(221);
19512
19513var AVError = __webpack_require__(43);
19514
19515var _require = __webpack_require__(26),
19516 AVRequest = _require._request,
19517 request = _require.request;
19518
19519var _require2 = __webpack_require__(68),
19520 getAdapter = _require2.getAdapter;
19521
19522var PLATFORM_ANONYMOUS = 'anonymous';
19523var PLATFORM_QQAPP = 'lc_qqapp';
19524
19525var mergeUnionDataIntoAuthData = function mergeUnionDataIntoAuthData() {
19526 var defaultUnionIdPlatform = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'weixin';
19527 return function (authData, unionId) {
19528 var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
19529 _ref$unionIdPlatform = _ref.unionIdPlatform,
19530 unionIdPlatform = _ref$unionIdPlatform === void 0 ? defaultUnionIdPlatform : _ref$unionIdPlatform,
19531 _ref$asMainAccount = _ref.asMainAccount,
19532 asMainAccount = _ref$asMainAccount === void 0 ? false : _ref$asMainAccount;
19533
19534 if (typeof unionId !== 'string') throw new AVError(AVError.OTHER_CAUSE, 'unionId is not a string');
19535 if (typeof unionIdPlatform !== 'string') throw new AVError(AVError.OTHER_CAUSE, 'unionIdPlatform is not a string');
19536 return _.extend({}, authData, {
19537 platform: unionIdPlatform,
19538 unionid: unionId,
19539 main_account: Boolean(asMainAccount)
19540 });
19541 };
19542};
19543
19544module.exports = function (AV) {
19545 /**
19546 * @class
19547 *
19548 * <p>An AV.User object is a local representation of a user persisted to the
19549 * LeanCloud server. This class is a subclass of an AV.Object, and retains the
19550 * same functionality of an AV.Object, but also extends it with various
19551 * user specific methods, like authentication, signing up, and validation of
19552 * uniqueness.</p>
19553 */
19554 AV.User = AV.Object.extend('_User',
19555 /** @lends AV.User.prototype */
19556 {
19557 // Instance Variables
19558 _isCurrentUser: false,
19559 // Instance Methods
19560
19561 /**
19562 * Internal method to handle special fields in a _User response.
19563 * @private
19564 */
19565 _mergeMagicFields: function _mergeMagicFields(attrs) {
19566 if (attrs.sessionToken) {
19567 this._sessionToken = attrs.sessionToken;
19568 delete attrs.sessionToken;
19569 }
19570
19571 return AV.User.__super__._mergeMagicFields.call(this, attrs);
19572 },
19573
19574 /**
19575 * Removes null values from authData (which exist temporarily for
19576 * unlinking)
19577 * @private
19578 */
19579 _cleanupAuthData: function _cleanupAuthData() {
19580 if (!this.isCurrent()) {
19581 return;
19582 }
19583
19584 var authData = this.get('authData');
19585
19586 if (!authData) {
19587 return;
19588 }
19589
19590 AV._objectEach(this.get('authData'), function (value, key) {
19591 if (!authData[key]) {
19592 delete authData[key];
19593 }
19594 });
19595 },
19596
19597 /**
19598 * Synchronizes authData for all providers.
19599 * @private
19600 */
19601 _synchronizeAllAuthData: function _synchronizeAllAuthData() {
19602 var authData = this.get('authData');
19603
19604 if (!authData) {
19605 return;
19606 }
19607
19608 var self = this;
19609
19610 AV._objectEach(this.get('authData'), function (value, key) {
19611 self._synchronizeAuthData(key);
19612 });
19613 },
19614
19615 /**
19616 * Synchronizes auth data for a provider (e.g. puts the access token in the
19617 * right place to be used by the Facebook SDK).
19618 * @private
19619 */
19620 _synchronizeAuthData: function _synchronizeAuthData(provider) {
19621 if (!this.isCurrent()) {
19622 return;
19623 }
19624
19625 var authType;
19626
19627 if (_.isString(provider)) {
19628 authType = provider;
19629 provider = AV.User._authProviders[authType];
19630 } else {
19631 authType = provider.getAuthType();
19632 }
19633
19634 var authData = this.get('authData');
19635
19636 if (!authData || !provider) {
19637 return;
19638 }
19639
19640 var success = provider.restoreAuthentication(authData[authType]);
19641
19642 if (!success) {
19643 this.dissociateAuthData(provider);
19644 }
19645 },
19646 _handleSaveResult: function _handleSaveResult(makeCurrent) {
19647 // Clean up and synchronize the authData object, removing any unset values
19648 if (makeCurrent && !AV._config.disableCurrentUser) {
19649 this._isCurrentUser = true;
19650 }
19651
19652 this._cleanupAuthData();
19653
19654 this._synchronizeAllAuthData(); // Don't keep the password around.
19655
19656
19657 delete this._serverData.password;
19658
19659 this._rebuildEstimatedDataForKey('password');
19660
19661 this._refreshCache();
19662
19663 if ((makeCurrent || this.isCurrent()) && !AV._config.disableCurrentUser) {
19664 // Some old version of leanengine-node-sdk will overwrite
19665 // AV.User._saveCurrentUser which returns no Promise.
19666 // So we need a Promise wrapper.
19667 return _promise.default.resolve(AV.User._saveCurrentUser(this));
19668 } else {
19669 return _promise.default.resolve();
19670 }
19671 },
19672
19673 /**
19674 * Unlike in the Android/iOS SDKs, logInWith is unnecessary, since you can
19675 * call linkWith on the user (even if it doesn't exist yet on the server).
19676 * @private
19677 */
19678 _linkWith: function _linkWith(provider, data) {
19679 var _this = this;
19680
19681 var _ref2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
19682 _ref2$failOnNotExist = _ref2.failOnNotExist,
19683 failOnNotExist = _ref2$failOnNotExist === void 0 ? false : _ref2$failOnNotExist;
19684
19685 var authType;
19686
19687 if (_.isString(provider)) {
19688 authType = provider;
19689 provider = AV.User._authProviders[provider];
19690 } else {
19691 authType = provider.getAuthType();
19692 }
19693
19694 if (data) {
19695 return this.save({
19696 authData: (0, _defineProperty2.default)({}, authType, data)
19697 }, {
19698 fetchWhenSave: !!this.get('authData'),
19699 _failOnNotExist: failOnNotExist
19700 }).then(function (model) {
19701 return model._handleSaveResult(true).then(function () {
19702 return model;
19703 });
19704 });
19705 } else {
19706 return provider.authenticate().then(function (result) {
19707 return _this._linkWith(provider, result);
19708 });
19709 }
19710 },
19711
19712 /**
19713 * Associate the user with a third party authData.
19714 * @since 3.3.0
19715 * @param {Object} authData The response json data returned from third party token, maybe like { openid: 'abc123', access_token: '123abc', expires_in: 1382686496 }
19716 * @param {string} platform Available platform for sign up.
19717 * @return {Promise<AV.User>} A promise that is fulfilled with the user when completed.
19718 * @example user.associateWithAuthData({
19719 * openid: 'abc123',
19720 * access_token: '123abc',
19721 * expires_in: 1382686496
19722 * }, 'weixin').then(function(user) {
19723 * //Access user here
19724 * }).catch(function(error) {
19725 * //console.error("error: ", error);
19726 * });
19727 */
19728 associateWithAuthData: function associateWithAuthData(authData, platform) {
19729 return this._linkWith(platform, authData);
19730 },
19731
19732 /**
19733 * Associate the user with a third party authData and unionId.
19734 * @since 3.5.0
19735 * @param {Object} authData The response json data returned from third party token, maybe like { openid: 'abc123', access_token: '123abc', expires_in: 1382686496 }
19736 * @param {string} platform Available platform for sign up.
19737 * @param {string} unionId
19738 * @param {Object} [unionLoginOptions]
19739 * @param {string} [unionLoginOptions.unionIdPlatform = 'weixin'] unionId platform
19740 * @param {boolean} [unionLoginOptions.asMainAccount = false] If true, the unionId will be associated with the user.
19741 * @return {Promise<AV.User>} A promise that is fulfilled with the user when completed.
19742 * @example user.associateWithAuthDataAndUnionId({
19743 * openid: 'abc123',
19744 * access_token: '123abc',
19745 * expires_in: 1382686496
19746 * }, 'weixin', 'union123', {
19747 * unionIdPlatform: 'weixin',
19748 * asMainAccount: true,
19749 * }).then(function(user) {
19750 * //Access user here
19751 * }).catch(function(error) {
19752 * //console.error("error: ", error);
19753 * });
19754 */
19755 associateWithAuthDataAndUnionId: function associateWithAuthDataAndUnionId(authData, platform, unionId, unionOptions) {
19756 return this._linkWith(platform, mergeUnionDataIntoAuthData()(authData, unionId, unionOptions));
19757 },
19758
19759 /**
19760 * Associate the user with the identity of the current mini-app.
19761 * @since 4.6.0
19762 * @param {Object} [authInfo]
19763 * @param {Object} [option]
19764 * @param {Boolean} [option.failOnNotExist] If true, the login request will fail when no user matches this authInfo.authData exists.
19765 * @return {Promise<AV.User>}
19766 */
19767 associateWithMiniApp: function associateWithMiniApp(authInfo, option) {
19768 var _this2 = this;
19769
19770 if (authInfo === undefined) {
19771 var getAuthInfo = getAdapter('getAuthInfo');
19772 return getAuthInfo().then(function (authInfo) {
19773 return _this2._linkWith(authInfo.provider, authInfo.authData, option);
19774 });
19775 }
19776
19777 return this._linkWith(authInfo.provider, authInfo.authData, option);
19778 },
19779
19780 /**
19781 * 将用户与 QQ 小程序用户进行关联。适用于为已经在用户系统中存在的用户关联当前使用 QQ 小程序的微信帐号。
19782 * 仅在 QQ 小程序中可用。
19783 *
19784 * @deprecated Please use {@link AV.User#associateWithMiniApp}
19785 * @since 4.2.0
19786 * @param {Object} [options]
19787 * @param {boolean} [options.preferUnionId = false] 如果服务端在登录时获取到了用户的 UnionId,是否将 UnionId 保存在用户账号中。
19788 * @param {string} [options.unionIdPlatform = 'qq'] (only take effect when preferUnionId) unionId platform
19789 * @param {boolean} [options.asMainAccount = true] (only take effect when preferUnionId) If true, the unionId will be associated with the user.
19790 * @return {Promise<AV.User>}
19791 */
19792 associateWithQQApp: function associateWithQQApp() {
19793 var _this3 = this;
19794
19795 var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
19796 _ref3$preferUnionId = _ref3.preferUnionId,
19797 preferUnionId = _ref3$preferUnionId === void 0 ? false : _ref3$preferUnionId,
19798 _ref3$unionIdPlatform = _ref3.unionIdPlatform,
19799 unionIdPlatform = _ref3$unionIdPlatform === void 0 ? 'qq' : _ref3$unionIdPlatform,
19800 _ref3$asMainAccount = _ref3.asMainAccount,
19801 asMainAccount = _ref3$asMainAccount === void 0 ? true : _ref3$asMainAccount;
19802
19803 var getAuthInfo = getAdapter('getAuthInfo');
19804 return getAuthInfo({
19805 preferUnionId: preferUnionId,
19806 asMainAccount: asMainAccount,
19807 platform: unionIdPlatform
19808 }).then(function (authInfo) {
19809 authInfo.provider = PLATFORM_QQAPP;
19810 return _this3.associateWithMiniApp(authInfo);
19811 });
19812 },
19813
19814 /**
19815 * 将用户与微信小程序用户进行关联。适用于为已经在用户系统中存在的用户关联当前使用微信小程序的微信帐号。
19816 * 仅在微信小程序中可用。
19817 *
19818 * @deprecated Please use {@link AV.User#associateWithMiniApp}
19819 * @since 3.13.0
19820 * @param {Object} [options]
19821 * @param {boolean} [options.preferUnionId = false] 当用户满足 {@link https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/union-id.html 获取 UnionId 的条件} 时,是否将 UnionId 保存在用户账号中。
19822 * @param {string} [options.unionIdPlatform = 'weixin'] (only take effect when preferUnionId) unionId platform
19823 * @param {boolean} [options.asMainAccount = true] (only take effect when preferUnionId) If true, the unionId will be associated with the user.
19824 * @return {Promise<AV.User>}
19825 */
19826 associateWithWeapp: function associateWithWeapp() {
19827 var _this4 = this;
19828
19829 var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
19830 _ref4$preferUnionId = _ref4.preferUnionId,
19831 preferUnionId = _ref4$preferUnionId === void 0 ? false : _ref4$preferUnionId,
19832 _ref4$unionIdPlatform = _ref4.unionIdPlatform,
19833 unionIdPlatform = _ref4$unionIdPlatform === void 0 ? 'weixin' : _ref4$unionIdPlatform,
19834 _ref4$asMainAccount = _ref4.asMainAccount,
19835 asMainAccount = _ref4$asMainAccount === void 0 ? true : _ref4$asMainAccount;
19836
19837 var getAuthInfo = getAdapter('getAuthInfo');
19838 return getAuthInfo({
19839 preferUnionId: preferUnionId,
19840 asMainAccount: asMainAccount,
19841 platform: unionIdPlatform
19842 }).then(function (authInfo) {
19843 return _this4.associateWithMiniApp(authInfo);
19844 });
19845 },
19846
19847 /**
19848 * @deprecated renamed to {@link AV.User#associateWithWeapp}
19849 * @return {Promise<AV.User>}
19850 */
19851 linkWithWeapp: function linkWithWeapp(options) {
19852 console.warn('DEPRECATED: User#linkWithWeapp 已废弃,请使用 User#associateWithWeapp 代替');
19853 return this.associateWithWeapp(options);
19854 },
19855
19856 /**
19857 * 将用户与 QQ 小程序用户进行关联。适用于为已经在用户系统中存在的用户关联当前使用 QQ 小程序的 QQ 帐号。
19858 * 仅在 QQ 小程序中可用。
19859 *
19860 * @deprecated Please use {@link AV.User#associateWithMiniApp}
19861 * @since 4.2.0
19862 * @param {string} unionId
19863 * @param {Object} [unionOptions]
19864 * @param {string} [unionOptions.unionIdPlatform = 'qq'] unionId platform
19865 * @param {boolean} [unionOptions.asMainAccount = false] If true, the unionId will be associated with the user.
19866 * @return {Promise<AV.User>}
19867 */
19868 associateWithQQAppWithUnionId: function associateWithQQAppWithUnionId(unionId) {
19869 var _this5 = this;
19870
19871 var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
19872 _ref5$unionIdPlatform = _ref5.unionIdPlatform,
19873 unionIdPlatform = _ref5$unionIdPlatform === void 0 ? 'qq' : _ref5$unionIdPlatform,
19874 _ref5$asMainAccount = _ref5.asMainAccount,
19875 asMainAccount = _ref5$asMainAccount === void 0 ? false : _ref5$asMainAccount;
19876
19877 var getAuthInfo = getAdapter('getAuthInfo');
19878 return getAuthInfo({
19879 platform: unionIdPlatform
19880 }).then(function (authInfo) {
19881 authInfo = AV.User.mergeUnionId(authInfo, unionId, {
19882 asMainAccount: asMainAccount
19883 });
19884 authInfo.provider = PLATFORM_QQAPP;
19885 return _this5.associateWithMiniApp(authInfo);
19886 });
19887 },
19888
19889 /**
19890 * 将用户与微信小程序用户进行关联。适用于为已经在用户系统中存在的用户关联当前使用微信小程序的微信帐号。
19891 * 仅在微信小程序中可用。
19892 *
19893 * @deprecated Please use {@link AV.User#associateWithMiniApp}
19894 * @since 3.13.0
19895 * @param {string} unionId
19896 * @param {Object} [unionOptions]
19897 * @param {string} [unionOptions.unionIdPlatform = 'weixin'] unionId platform
19898 * @param {boolean} [unionOptions.asMainAccount = false] If true, the unionId will be associated with the user.
19899 * @return {Promise<AV.User>}
19900 */
19901 associateWithWeappWithUnionId: function associateWithWeappWithUnionId(unionId) {
19902 var _this6 = this;
19903
19904 var _ref6 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
19905 _ref6$unionIdPlatform = _ref6.unionIdPlatform,
19906 unionIdPlatform = _ref6$unionIdPlatform === void 0 ? 'weixin' : _ref6$unionIdPlatform,
19907 _ref6$asMainAccount = _ref6.asMainAccount,
19908 asMainAccount = _ref6$asMainAccount === void 0 ? false : _ref6$asMainAccount;
19909
19910 var getAuthInfo = getAdapter('getAuthInfo');
19911 return getAuthInfo({
19912 platform: unionIdPlatform
19913 }).then(function (authInfo) {
19914 authInfo = AV.User.mergeUnionId(authInfo, unionId, {
19915 asMainAccount: asMainAccount
19916 });
19917 return _this6.associateWithMiniApp(authInfo);
19918 });
19919 },
19920
19921 /**
19922 * Unlinks a user from a service.
19923 * @param {string} platform
19924 * @return {Promise<AV.User>}
19925 * @since 3.3.0
19926 */
19927 dissociateAuthData: function dissociateAuthData(provider) {
19928 this.unset("authData.".concat(provider));
19929 return this.save().then(function (model) {
19930 return model._handleSaveResult(true).then(function () {
19931 return model;
19932 });
19933 });
19934 },
19935
19936 /**
19937 * @private
19938 * @deprecated
19939 */
19940 _unlinkFrom: function _unlinkFrom(provider) {
19941 console.warn('DEPRECATED: User#_unlinkFrom 已废弃,请使用 User#dissociateAuthData 代替');
19942 return this.dissociateAuthData(provider);
19943 },
19944
19945 /**
19946 * Checks whether a user is linked to a service.
19947 * @private
19948 */
19949 _isLinked: function _isLinked(provider) {
19950 var authType;
19951
19952 if (_.isString(provider)) {
19953 authType = provider;
19954 } else {
19955 authType = provider.getAuthType();
19956 }
19957
19958 var authData = this.get('authData') || {};
19959 return !!authData[authType];
19960 },
19961
19962 /**
19963 * Checks whether a user is anonymous.
19964 * @since 3.9.0
19965 * @return {boolean}
19966 */
19967 isAnonymous: function isAnonymous() {
19968 return this._isLinked(PLATFORM_ANONYMOUS);
19969 },
19970 logOut: function logOut() {
19971 this._logOutWithAll();
19972
19973 this._isCurrentUser = false;
19974 },
19975
19976 /**
19977 * Deauthenticates all providers.
19978 * @private
19979 */
19980 _logOutWithAll: function _logOutWithAll() {
19981 var authData = this.get('authData');
19982
19983 if (!authData) {
19984 return;
19985 }
19986
19987 var self = this;
19988
19989 AV._objectEach(this.get('authData'), function (value, key) {
19990 self._logOutWith(key);
19991 });
19992 },
19993
19994 /**
19995 * Deauthenticates a single provider (e.g. removing access tokens from the
19996 * Facebook SDK).
19997 * @private
19998 */
19999 _logOutWith: function _logOutWith(provider) {
20000 if (!this.isCurrent()) {
20001 return;
20002 }
20003
20004 if (_.isString(provider)) {
20005 provider = AV.User._authProviders[provider];
20006 }
20007
20008 if (provider && provider.deauthenticate) {
20009 provider.deauthenticate();
20010 }
20011 },
20012
20013 /**
20014 * Signs up a new user. You should call this instead of save for
20015 * new AV.Users. This will create a new AV.User on the server, and
20016 * also persist the session on disk so that you can access the user using
20017 * <code>current</code>.
20018 *
20019 * <p>A username and password must be set before calling signUp.</p>
20020 *
20021 * @param {Object} attrs Extra fields to set on the new user, or null.
20022 * @param {AuthOptions} options
20023 * @return {Promise} A promise that is fulfilled when the signup
20024 * finishes.
20025 * @see AV.User.signUp
20026 */
20027 signUp: function signUp(attrs, options) {
20028 var error;
20029 var username = attrs && attrs.username || this.get('username');
20030
20031 if (!username || username === '') {
20032 error = new AVError(AVError.OTHER_CAUSE, 'Cannot sign up user with an empty name.');
20033 throw error;
20034 }
20035
20036 var password = attrs && attrs.password || this.get('password');
20037
20038 if (!password || password === '') {
20039 error = new AVError(AVError.OTHER_CAUSE, 'Cannot sign up user with an empty password.');
20040 throw error;
20041 }
20042
20043 return this.save(attrs, options).then(function (model) {
20044 if (model.isAnonymous()) {
20045 model.unset("authData.".concat(PLATFORM_ANONYMOUS));
20046 model._opSetQueue = [{}];
20047 }
20048
20049 return model._handleSaveResult(true).then(function () {
20050 return model;
20051 });
20052 });
20053 },
20054
20055 /**
20056 * Signs up a new user with mobile phone and sms code.
20057 * You should call this instead of save for
20058 * new AV.Users. This will create a new AV.User on the server, and
20059 * also persist the session on disk so that you can access the user using
20060 * <code>current</code>.
20061 *
20062 * <p>A username and password must be set before calling signUp.</p>
20063 *
20064 * @param {Object} attrs Extra fields to set on the new user, or null.
20065 * @param {AuthOptions} options
20066 * @return {Promise} A promise that is fulfilled when the signup
20067 * finishes.
20068 * @see AV.User.signUpOrlogInWithMobilePhone
20069 * @see AV.Cloud.requestSmsCode
20070 */
20071 signUpOrlogInWithMobilePhone: function signUpOrlogInWithMobilePhone(attrs) {
20072 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
20073 var error;
20074 var mobilePhoneNumber = attrs && attrs.mobilePhoneNumber || this.get('mobilePhoneNumber');
20075
20076 if (!mobilePhoneNumber || mobilePhoneNumber === '') {
20077 error = new AVError(AVError.OTHER_CAUSE, 'Cannot sign up or login user by mobilePhoneNumber ' + 'with an empty mobilePhoneNumber.');
20078 throw error;
20079 }
20080
20081 var smsCode = attrs && attrs.smsCode || this.get('smsCode');
20082
20083 if (!smsCode || smsCode === '') {
20084 error = new AVError(AVError.OTHER_CAUSE, 'Cannot sign up or login user by mobilePhoneNumber ' + 'with an empty smsCode.');
20085 throw error;
20086 }
20087
20088 options._makeRequest = function (route, className, id, method, json) {
20089 return AVRequest('usersByMobilePhone', null, null, 'POST', json);
20090 };
20091
20092 return this.save(attrs, options).then(function (model) {
20093 delete model.attributes.smsCode;
20094 delete model._serverData.smsCode;
20095 return model._handleSaveResult(true).then(function () {
20096 return model;
20097 });
20098 });
20099 },
20100
20101 /**
20102 * The same with {@link AV.User.loginWithAuthData}, except that you can set attributes before login.
20103 * @since 3.7.0
20104 */
20105 loginWithAuthData: function loginWithAuthData(authData, platform, options) {
20106 return this._linkWith(platform, authData, options);
20107 },
20108
20109 /**
20110 * The same with {@link AV.User.loginWithAuthDataAndUnionId}, except that you can set attributes before login.
20111 * @since 3.7.0
20112 */
20113 loginWithAuthDataAndUnionId: function loginWithAuthDataAndUnionId(authData, platform, unionId, unionLoginOptions) {
20114 return this.loginWithAuthData(mergeUnionDataIntoAuthData()(authData, unionId, unionLoginOptions), platform, unionLoginOptions);
20115 },
20116
20117 /**
20118 * The same with {@link AV.User.loginWithWeapp}, except that you can set attributes before login.
20119 * @deprecated please use {@link AV.User#loginWithMiniApp}
20120 * @since 3.7.0
20121 * @param {Object} [options]
20122 * @param {boolean} [options.failOnNotExist] If true, the login request will fail when no user matches this authData exists.
20123 * @param {boolean} [options.preferUnionId] 当用户满足 {@link https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/union-id.html 获取 UnionId 的条件} 时,是否使用 UnionId 登录。(since 3.13.0)
20124 * @param {string} [options.unionIdPlatform = 'weixin'] (only take effect when preferUnionId) unionId platform
20125 * @param {boolean} [options.asMainAccount = true] (only take effect when preferUnionId) If true, the unionId will be associated with the user.
20126 * @return {Promise<AV.User>}
20127 */
20128 loginWithWeapp: function loginWithWeapp() {
20129 var _this7 = this;
20130
20131 var _ref7 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
20132 _ref7$preferUnionId = _ref7.preferUnionId,
20133 preferUnionId = _ref7$preferUnionId === void 0 ? false : _ref7$preferUnionId,
20134 _ref7$unionIdPlatform = _ref7.unionIdPlatform,
20135 unionIdPlatform = _ref7$unionIdPlatform === void 0 ? 'weixin' : _ref7$unionIdPlatform,
20136 _ref7$asMainAccount = _ref7.asMainAccount,
20137 asMainAccount = _ref7$asMainAccount === void 0 ? true : _ref7$asMainAccount,
20138 _ref7$failOnNotExist = _ref7.failOnNotExist,
20139 failOnNotExist = _ref7$failOnNotExist === void 0 ? false : _ref7$failOnNotExist;
20140
20141 var getAuthInfo = getAdapter('getAuthInfo');
20142 return getAuthInfo({
20143 preferUnionId: preferUnionId,
20144 asMainAccount: asMainAccount,
20145 platform: unionIdPlatform
20146 }).then(function (authInfo) {
20147 return _this7.loginWithMiniApp(authInfo, {
20148 failOnNotExist: failOnNotExist
20149 });
20150 });
20151 },
20152
20153 /**
20154 * The same with {@link AV.User.loginWithWeappWithUnionId}, except that you can set attributes before login.
20155 * @deprecated please use {@link AV.User#loginWithMiniApp}
20156 * @since 3.13.0
20157 */
20158 loginWithWeappWithUnionId: function loginWithWeappWithUnionId(unionId) {
20159 var _this8 = this;
20160
20161 var _ref8 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
20162 _ref8$unionIdPlatform = _ref8.unionIdPlatform,
20163 unionIdPlatform = _ref8$unionIdPlatform === void 0 ? 'weixin' : _ref8$unionIdPlatform,
20164 _ref8$asMainAccount = _ref8.asMainAccount,
20165 asMainAccount = _ref8$asMainAccount === void 0 ? false : _ref8$asMainAccount,
20166 _ref8$failOnNotExist = _ref8.failOnNotExist,
20167 failOnNotExist = _ref8$failOnNotExist === void 0 ? false : _ref8$failOnNotExist;
20168
20169 var getAuthInfo = getAdapter('getAuthInfo');
20170 return getAuthInfo({
20171 platform: unionIdPlatform
20172 }).then(function (authInfo) {
20173 authInfo = AV.User.mergeUnionId(authInfo, unionId, {
20174 asMainAccount: asMainAccount
20175 });
20176 return _this8.loginWithMiniApp(authInfo, {
20177 failOnNotExist: failOnNotExist
20178 });
20179 });
20180 },
20181
20182 /**
20183 * The same with {@link AV.User.loginWithQQApp}, except that you can set attributes before login.
20184 * @deprecated please use {@link AV.User#loginWithMiniApp}
20185 * @since 4.2.0
20186 * @param {Object} [options]
20187 * @param {boolean} [options.failOnNotExist] If true, the login request will fail when no user matches this authData exists.
20188 * @param {boolean} [options.preferUnionId] 如果服务端在登录时获取到了用户的 UnionId,是否将 UnionId 保存在用户账号中。
20189 * @param {string} [options.unionIdPlatform = 'qq'] (only take effect when preferUnionId) unionId platform
20190 * @param {boolean} [options.asMainAccount = true] (only take effect when preferUnionId) If true, the unionId will be associated with the user.
20191 */
20192 loginWithQQApp: function loginWithQQApp() {
20193 var _this9 = this;
20194
20195 var _ref9 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
20196 _ref9$preferUnionId = _ref9.preferUnionId,
20197 preferUnionId = _ref9$preferUnionId === void 0 ? false : _ref9$preferUnionId,
20198 _ref9$unionIdPlatform = _ref9.unionIdPlatform,
20199 unionIdPlatform = _ref9$unionIdPlatform === void 0 ? 'qq' : _ref9$unionIdPlatform,
20200 _ref9$asMainAccount = _ref9.asMainAccount,
20201 asMainAccount = _ref9$asMainAccount === void 0 ? true : _ref9$asMainAccount,
20202 _ref9$failOnNotExist = _ref9.failOnNotExist,
20203 failOnNotExist = _ref9$failOnNotExist === void 0 ? false : _ref9$failOnNotExist;
20204
20205 var getAuthInfo = getAdapter('getAuthInfo');
20206 return getAuthInfo({
20207 preferUnionId: preferUnionId,
20208 asMainAccount: asMainAccount,
20209 platform: unionIdPlatform
20210 }).then(function (authInfo) {
20211 authInfo.provider = PLATFORM_QQAPP;
20212 return _this9.loginWithMiniApp(authInfo, {
20213 failOnNotExist: failOnNotExist
20214 });
20215 });
20216 },
20217
20218 /**
20219 * The same with {@link AV.User.loginWithQQAppWithUnionId}, except that you can set attributes before login.
20220 * @deprecated please use {@link AV.User#loginWithMiniApp}
20221 * @since 4.2.0
20222 */
20223 loginWithQQAppWithUnionId: function loginWithQQAppWithUnionId(unionId) {
20224 var _this10 = this;
20225
20226 var _ref10 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
20227 _ref10$unionIdPlatfor = _ref10.unionIdPlatform,
20228 unionIdPlatform = _ref10$unionIdPlatfor === void 0 ? 'qq' : _ref10$unionIdPlatfor,
20229 _ref10$asMainAccount = _ref10.asMainAccount,
20230 asMainAccount = _ref10$asMainAccount === void 0 ? false : _ref10$asMainAccount,
20231 _ref10$failOnNotExist = _ref10.failOnNotExist,
20232 failOnNotExist = _ref10$failOnNotExist === void 0 ? false : _ref10$failOnNotExist;
20233
20234 var getAuthInfo = getAdapter('getAuthInfo');
20235 return getAuthInfo({
20236 platform: unionIdPlatform
20237 }).then(function (authInfo) {
20238 authInfo = AV.User.mergeUnionId(authInfo, unionId, {
20239 asMainAccount: asMainAccount
20240 });
20241 authInfo.provider = PLATFORM_QQAPP;
20242 return _this10.loginWithMiniApp(authInfo, {
20243 failOnNotExist: failOnNotExist
20244 });
20245 });
20246 },
20247
20248 /**
20249 * The same with {@link AV.User.loginWithMiniApp}, except that you can set attributes before login.
20250 * @since 4.6.0
20251 */
20252 loginWithMiniApp: function loginWithMiniApp(authInfo, option) {
20253 var _this11 = this;
20254
20255 if (authInfo === undefined) {
20256 var getAuthInfo = getAdapter('getAuthInfo');
20257 return getAuthInfo().then(function (authInfo) {
20258 return _this11.loginWithAuthData(authInfo.authData, authInfo.provider, option);
20259 });
20260 }
20261
20262 return this.loginWithAuthData(authInfo.authData, authInfo.provider, option);
20263 },
20264
20265 /**
20266 * Logs in a AV.User. On success, this saves the session to localStorage,
20267 * so you can retrieve the currently logged in user using
20268 * <code>current</code>.
20269 *
20270 * <p>A username and password must be set before calling logIn.</p>
20271 *
20272 * @see AV.User.logIn
20273 * @return {Promise} A promise that is fulfilled with the user when
20274 * the login is complete.
20275 */
20276 logIn: function logIn() {
20277 var model = this;
20278 var request = AVRequest('login', null, null, 'POST', this.toJSON());
20279 return request.then(function (resp) {
20280 var serverAttrs = model.parse(resp);
20281
20282 model._finishFetch(serverAttrs);
20283
20284 return model._handleSaveResult(true).then(function () {
20285 if (!serverAttrs.smsCode) delete model.attributes['smsCode'];
20286 return model;
20287 });
20288 });
20289 },
20290
20291 /**
20292 * @see AV.Object#save
20293 */
20294 save: function save(arg1, arg2, arg3) {
20295 var attrs, options;
20296
20297 if (_.isObject(arg1) || _.isNull(arg1) || _.isUndefined(arg1)) {
20298 attrs = arg1;
20299 options = arg2;
20300 } else {
20301 attrs = {};
20302 attrs[arg1] = arg2;
20303 options = arg3;
20304 }
20305
20306 options = options || {};
20307 return AV.Object.prototype.save.call(this, attrs, options).then(function (model) {
20308 return model._handleSaveResult(false).then(function () {
20309 return model;
20310 });
20311 });
20312 },
20313
20314 /**
20315 * Follow a user
20316 * @since 0.3.0
20317 * @param {Object | AV.User | String} options if an AV.User or string is given, it will be used as the target user.
20318 * @param {AV.User | String} options.user The target user or user's objectId to follow.
20319 * @param {Object} [options.attributes] key-value attributes dictionary to be used as
20320 * conditions of followerQuery/followeeQuery.
20321 * @param {AuthOptions} [authOptions]
20322 */
20323 follow: function follow(options, authOptions) {
20324 if (!this.id) {
20325 throw new Error('Please signin.');
20326 }
20327
20328 var user;
20329 var attributes;
20330
20331 if (options.user) {
20332 user = options.user;
20333 attributes = options.attributes;
20334 } else {
20335 user = options;
20336 }
20337
20338 var userObjectId = _.isString(user) ? user : user.id;
20339
20340 if (!userObjectId) {
20341 throw new Error('Invalid target user.');
20342 }
20343
20344 var route = 'users/' + this.id + '/friendship/' + userObjectId;
20345 var request = AVRequest(route, null, null, 'POST', AV._encode(attributes), authOptions);
20346 return request;
20347 },
20348
20349 /**
20350 * Unfollow a user.
20351 * @since 0.3.0
20352 * @param {Object | AV.User | String} options if an AV.User or string is given, it will be used as the target user.
20353 * @param {AV.User | String} options.user The target user or user's objectId to unfollow.
20354 * @param {AuthOptions} [authOptions]
20355 */
20356 unfollow: function unfollow(options, authOptions) {
20357 if (!this.id) {
20358 throw new Error('Please signin.');
20359 }
20360
20361 var user;
20362
20363 if (options.user) {
20364 user = options.user;
20365 } else {
20366 user = options;
20367 }
20368
20369 var userObjectId = _.isString(user) ? user : user.id;
20370
20371 if (!userObjectId) {
20372 throw new Error('Invalid target user.');
20373 }
20374
20375 var route = 'users/' + this.id + '/friendship/' + userObjectId;
20376 var request = AVRequest(route, null, null, 'DELETE', null, authOptions);
20377 return request;
20378 },
20379
20380 /**
20381 * Get the user's followers and followees.
20382 * @since 4.8.0
20383 * @param {Object} [options]
20384 * @param {Number} [options.skip]
20385 * @param {Number} [options.limit]
20386 * @param {AuthOptions} [authOptions]
20387 */
20388 getFollowersAndFollowees: function getFollowersAndFollowees(options, authOptions) {
20389 if (!this.id) {
20390 throw new Error('Please signin.');
20391 }
20392
20393 return request({
20394 method: 'GET',
20395 path: "/users/".concat(this.id, "/followersAndFollowees"),
20396 query: {
20397 skip: options && options.skip,
20398 limit: options && options.limit,
20399 include: 'follower,followee',
20400 keys: 'follower,followee'
20401 },
20402 authOptions: authOptions
20403 }).then(function (_ref11) {
20404 var followers = _ref11.followers,
20405 followees = _ref11.followees;
20406 return {
20407 followers: (0, _map.default)(followers).call(followers, function (_ref12) {
20408 var follower = _ref12.follower;
20409 return AV._decode(follower);
20410 }),
20411 followees: (0, _map.default)(followees).call(followees, function (_ref13) {
20412 var followee = _ref13.followee;
20413 return AV._decode(followee);
20414 })
20415 };
20416 });
20417 },
20418
20419 /**
20420 *Create a follower query to query the user's followers.
20421 * @since 0.3.0
20422 * @see AV.User#followerQuery
20423 */
20424 followerQuery: function followerQuery() {
20425 return AV.User.followerQuery(this.id);
20426 },
20427
20428 /**
20429 *Create a followee query to query the user's followees.
20430 * @since 0.3.0
20431 * @see AV.User#followeeQuery
20432 */
20433 followeeQuery: function followeeQuery() {
20434 return AV.User.followeeQuery(this.id);
20435 },
20436
20437 /**
20438 * @see AV.Object#fetch
20439 */
20440 fetch: function fetch(fetchOptions, options) {
20441 return AV.Object.prototype.fetch.call(this, fetchOptions, options).then(function (model) {
20442 return model._handleSaveResult(false).then(function () {
20443 return model;
20444 });
20445 });
20446 },
20447
20448 /**
20449 * Update user's new password safely based on old password.
20450 * @param {String} oldPassword the old password.
20451 * @param {String} newPassword the new password.
20452 * @param {AuthOptions} options
20453 */
20454 updatePassword: function updatePassword(oldPassword, newPassword, options) {
20455 var _this12 = this;
20456
20457 var route = 'users/' + this.id + '/updatePassword';
20458 var params = {
20459 old_password: oldPassword,
20460 new_password: newPassword
20461 };
20462 var request = AVRequest(route, null, null, 'PUT', params, options);
20463 return request.then(function (resp) {
20464 _this12._finishFetch(_this12.parse(resp));
20465
20466 return _this12._handleSaveResult(true).then(function () {
20467 return resp;
20468 });
20469 });
20470 },
20471
20472 /**
20473 * Returns true if <code>current</code> would return this user.
20474 * @see AV.User#current
20475 */
20476 isCurrent: function isCurrent() {
20477 return this._isCurrentUser;
20478 },
20479
20480 /**
20481 * Returns get("username").
20482 * @return {String}
20483 * @see AV.Object#get
20484 */
20485 getUsername: function getUsername() {
20486 return this.get('username');
20487 },
20488
20489 /**
20490 * Returns get("mobilePhoneNumber").
20491 * @return {String}
20492 * @see AV.Object#get
20493 */
20494 getMobilePhoneNumber: function getMobilePhoneNumber() {
20495 return this.get('mobilePhoneNumber');
20496 },
20497
20498 /**
20499 * Calls set("mobilePhoneNumber", phoneNumber, options) and returns the result.
20500 * @param {String} mobilePhoneNumber
20501 * @return {Boolean}
20502 * @see AV.Object#set
20503 */
20504 setMobilePhoneNumber: function setMobilePhoneNumber(phone, options) {
20505 return this.set('mobilePhoneNumber', phone, options);
20506 },
20507
20508 /**
20509 * Calls set("username", username, options) and returns the result.
20510 * @param {String} username
20511 * @return {Boolean}
20512 * @see AV.Object#set
20513 */
20514 setUsername: function setUsername(username, options) {
20515 return this.set('username', username, options);
20516 },
20517
20518 /**
20519 * Calls set("password", password, options) and returns the result.
20520 * @param {String} password
20521 * @return {Boolean}
20522 * @see AV.Object#set
20523 */
20524 setPassword: function setPassword(password, options) {
20525 return this.set('password', password, options);
20526 },
20527
20528 /**
20529 * Returns get("email").
20530 * @return {String}
20531 * @see AV.Object#get
20532 */
20533 getEmail: function getEmail() {
20534 return this.get('email');
20535 },
20536
20537 /**
20538 * Calls set("email", email, options) and returns the result.
20539 * @param {String} email
20540 * @param {AuthOptions} options
20541 * @return {Boolean}
20542 * @see AV.Object#set
20543 */
20544 setEmail: function setEmail(email, options) {
20545 return this.set('email', email, options);
20546 },
20547
20548 /**
20549 * Checks whether this user is the current user and has been authenticated.
20550 * @deprecated 如果要判断当前用户的登录状态是否有效,请使用 currentUser.isAuthenticated().then(),
20551 * 如果要判断该用户是否是当前登录用户,请使用 user.id === currentUser.id
20552 * @return (Boolean) whether this user is the current user and is logged in.
20553 */
20554 authenticated: function authenticated() {
20555 console.warn('DEPRECATED: 如果要判断当前用户的登录状态是否有效,请使用 currentUser.isAuthenticated().then(),如果要判断该用户是否是当前登录用户,请使用 user.id === currentUser.id。');
20556 return !!this._sessionToken && !AV._config.disableCurrentUser && AV.User.current() && AV.User.current().id === this.id;
20557 },
20558
20559 /**
20560 * Detects if current sessionToken is valid.
20561 *
20562 * @since 2.0.0
20563 * @return Promise.<Boolean>
20564 */
20565 isAuthenticated: function isAuthenticated() {
20566 var _this13 = this;
20567
20568 return _promise.default.resolve().then(function () {
20569 return !!_this13._sessionToken && AV.User._fetchUserBySessionToken(_this13._sessionToken).then(function () {
20570 return true;
20571 }, function (error) {
20572 if (error.code === 211) {
20573 return false;
20574 }
20575
20576 throw error;
20577 });
20578 });
20579 },
20580
20581 /**
20582 * Get sessionToken of current user.
20583 * @return {String} sessionToken
20584 */
20585 getSessionToken: function getSessionToken() {
20586 return this._sessionToken;
20587 },
20588
20589 /**
20590 * Refresh sessionToken of current user.
20591 * @since 2.1.0
20592 * @param {AuthOptions} [options]
20593 * @return {Promise.<AV.User>} user with refreshed sessionToken
20594 */
20595 refreshSessionToken: function refreshSessionToken(options) {
20596 var _this14 = this;
20597
20598 return AVRequest("users/".concat(this.id, "/refreshSessionToken"), null, null, 'PUT', null, options).then(function (response) {
20599 _this14._finishFetch(response);
20600
20601 return _this14._handleSaveResult(true).then(function () {
20602 return _this14;
20603 });
20604 });
20605 },
20606
20607 /**
20608 * Get this user's Roles.
20609 * @param {AuthOptions} [options]
20610 * @return {Promise.<AV.Role[]>} A promise that is fulfilled with the roles when
20611 * the query is complete.
20612 */
20613 getRoles: function getRoles(options) {
20614 var _context;
20615
20616 return (0, _find.default)(_context = AV.Relation.reverseQuery('_Role', 'users', this)).call(_context, options);
20617 }
20618 },
20619 /** @lends AV.User */
20620 {
20621 // Class Variables
20622 // The currently logged-in user.
20623 _currentUser: null,
20624 // Whether currentUser is known to match the serialized version on disk.
20625 // This is useful for saving a localstorage check if you try to load
20626 // _currentUser frequently while there is none stored.
20627 _currentUserMatchesDisk: false,
20628 // The localStorage key suffix that the current user is stored under.
20629 _CURRENT_USER_KEY: 'currentUser',
20630 // The mapping of auth provider names to actual providers
20631 _authProviders: {},
20632 // Class Methods
20633
20634 /**
20635 * Signs up a new user with a username (or email) and password.
20636 * This will create a new AV.User on the server, and also persist the
20637 * session in localStorage so that you can access the user using
20638 * {@link #current}.
20639 *
20640 * @param {String} username The username (or email) to sign up with.
20641 * @param {String} password The password to sign up with.
20642 * @param {Object} [attrs] Extra fields to set on the new user.
20643 * @param {AuthOptions} [options]
20644 * @return {Promise} A promise that is fulfilled with the user when
20645 * the signup completes.
20646 * @see AV.User#signUp
20647 */
20648 signUp: function signUp(username, password, attrs, options) {
20649 attrs = attrs || {};
20650 attrs.username = username;
20651 attrs.password = password;
20652
20653 var user = AV.Object._create('_User');
20654
20655 return user.signUp(attrs, options);
20656 },
20657
20658 /**
20659 * Logs in a user with a username (or email) and password. On success, this
20660 * saves the session to disk, so you can retrieve the currently logged in
20661 * user using <code>current</code>.
20662 *
20663 * @param {String} username The username (or email) to log in with.
20664 * @param {String} password The password to log in with.
20665 * @return {Promise} A promise that is fulfilled with the user when
20666 * the login completes.
20667 * @see AV.User#logIn
20668 */
20669 logIn: function logIn(username, password) {
20670 var user = AV.Object._create('_User');
20671
20672 user._finishFetch({
20673 username: username,
20674 password: password
20675 });
20676
20677 return user.logIn();
20678 },
20679
20680 /**
20681 * Logs in a user with a session token. On success, this saves the session
20682 * to disk, so you can retrieve the currently logged in user using
20683 * <code>current</code>.
20684 *
20685 * @param {String} sessionToken The sessionToken to log in with.
20686 * @return {Promise} A promise that is fulfilled with the user when
20687 * the login completes.
20688 */
20689 become: function become(sessionToken) {
20690 return this._fetchUserBySessionToken(sessionToken).then(function (user) {
20691 return user._handleSaveResult(true).then(function () {
20692 return user;
20693 });
20694 });
20695 },
20696 _fetchUserBySessionToken: function _fetchUserBySessionToken(sessionToken) {
20697 if (sessionToken === undefined) {
20698 return _promise.default.reject(new Error('The sessionToken cannot be undefined'));
20699 }
20700
20701 var user = AV.Object._create('_User');
20702
20703 return request({
20704 method: 'GET',
20705 path: '/users/me',
20706 authOptions: {
20707 sessionToken: sessionToken
20708 }
20709 }).then(function (resp) {
20710 var serverAttrs = user.parse(resp);
20711
20712 user._finishFetch(serverAttrs);
20713
20714 return user;
20715 });
20716 },
20717
20718 /**
20719 * Logs in a user with a mobile phone number and sms code sent by
20720 * AV.User.requestLoginSmsCode.On success, this
20721 * saves the session to disk, so you can retrieve the currently logged in
20722 * user using <code>current</code>.
20723 *
20724 * @param {String} mobilePhone The user's mobilePhoneNumber
20725 * @param {String} smsCode The sms code sent by AV.User.requestLoginSmsCode
20726 * @return {Promise} A promise that is fulfilled with the user when
20727 * the login completes.
20728 * @see AV.User#logIn
20729 */
20730 logInWithMobilePhoneSmsCode: function logInWithMobilePhoneSmsCode(mobilePhone, smsCode) {
20731 var user = AV.Object._create('_User');
20732
20733 user._finishFetch({
20734 mobilePhoneNumber: mobilePhone,
20735 smsCode: smsCode
20736 });
20737
20738 return user.logIn();
20739 },
20740
20741 /**
20742 * Signs up or logs in a user with a mobilePhoneNumber and smsCode.
20743 * On success, this saves the session to disk, so you can retrieve the currently
20744 * logged in user using <code>current</code>.
20745 *
20746 * @param {String} mobilePhoneNumber The user's mobilePhoneNumber.
20747 * @param {String} smsCode The sms code sent by AV.Cloud.requestSmsCode
20748 * @param {Object} attributes The user's other attributes such as username etc.
20749 * @param {AuthOptions} options
20750 * @return {Promise} A promise that is fulfilled with the user when
20751 * the login completes.
20752 * @see AV.User#signUpOrlogInWithMobilePhone
20753 * @see AV.Cloud.requestSmsCode
20754 */
20755 signUpOrlogInWithMobilePhone: function signUpOrlogInWithMobilePhone(mobilePhoneNumber, smsCode, attrs, options) {
20756 attrs = attrs || {};
20757 attrs.mobilePhoneNumber = mobilePhoneNumber;
20758 attrs.smsCode = smsCode;
20759
20760 var user = AV.Object._create('_User');
20761
20762 return user.signUpOrlogInWithMobilePhone(attrs, options);
20763 },
20764
20765 /**
20766 * Logs in a user with a mobile phone number and password. On success, this
20767 * saves the session to disk, so you can retrieve the currently logged in
20768 * user using <code>current</code>.
20769 *
20770 * @param {String} mobilePhone The user's mobilePhoneNumber
20771 * @param {String} password The password to log in with.
20772 * @return {Promise} A promise that is fulfilled with the user when
20773 * the login completes.
20774 * @see AV.User#logIn
20775 */
20776 logInWithMobilePhone: function logInWithMobilePhone(mobilePhone, password) {
20777 var user = AV.Object._create('_User');
20778
20779 user._finishFetch({
20780 mobilePhoneNumber: mobilePhone,
20781 password: password
20782 });
20783
20784 return user.logIn();
20785 },
20786
20787 /**
20788 * Logs in a user with email and password.
20789 *
20790 * @since 3.13.0
20791 * @param {String} email The user's email.
20792 * @param {String} password The password to log in with.
20793 * @return {Promise} A promise that is fulfilled with the user when
20794 * the login completes.
20795 */
20796 loginWithEmail: function loginWithEmail(email, password) {
20797 var user = AV.Object._create('_User');
20798
20799 user._finishFetch({
20800 email: email,
20801 password: password
20802 });
20803
20804 return user.logIn();
20805 },
20806
20807 /**
20808 * Signs up or logs in a user with a third party auth data(AccessToken).
20809 * On success, this saves the session to disk, so you can retrieve the currently
20810 * logged in user using <code>current</code>.
20811 *
20812 * @since 3.7.0
20813 * @param {Object} authData The response json data returned from third party token, maybe like { openid: 'abc123', access_token: '123abc', expires_in: 1382686496 }
20814 * @param {string} platform Available platform for sign up.
20815 * @param {Object} [options]
20816 * @param {boolean} [options.failOnNotExist] If true, the login request will fail when no user matches this authData exists.
20817 * @return {Promise} A promise that is fulfilled with the user when
20818 * the login completes.
20819 * @example AV.User.loginWithAuthData({
20820 * openid: 'abc123',
20821 * access_token: '123abc',
20822 * expires_in: 1382686496
20823 * }, 'weixin').then(function(user) {
20824 * //Access user here
20825 * }).catch(function(error) {
20826 * //console.error("error: ", error);
20827 * });
20828 * @see {@link https://leancloud.cn/docs/js_guide.html#绑定第三方平台账户}
20829 */
20830 loginWithAuthData: function loginWithAuthData(authData, platform, options) {
20831 return AV.User._logInWith(platform, authData, options);
20832 },
20833
20834 /**
20835 * @deprecated renamed to {@link AV.User.loginWithAuthData}
20836 */
20837 signUpOrlogInWithAuthData: function signUpOrlogInWithAuthData() {
20838 console.warn('DEPRECATED: User.signUpOrlogInWithAuthData 已废弃,请使用 User#loginWithAuthData 代替');
20839 return this.loginWithAuthData.apply(this, arguments);
20840 },
20841
20842 /**
20843 * Signs up or logs in a user with a third party authData and unionId.
20844 * @since 3.7.0
20845 * @param {Object} authData The response json data returned from third party token, maybe like { openid: 'abc123', access_token: '123abc', expires_in: 1382686496 }
20846 * @param {string} platform Available platform for sign up.
20847 * @param {string} unionId
20848 * @param {Object} [unionLoginOptions]
20849 * @param {string} [unionLoginOptions.unionIdPlatform = 'weixin'] unionId platform
20850 * @param {boolean} [unionLoginOptions.asMainAccount = false] If true, the unionId will be associated with the user.
20851 * @param {boolean} [unionLoginOptions.failOnNotExist] If true, the login request will fail when no user matches this authData exists.
20852 * @return {Promise<AV.User>} A promise that is fulfilled with the user when completed.
20853 * @example AV.User.loginWithAuthDataAndUnionId({
20854 * openid: 'abc123',
20855 * access_token: '123abc',
20856 * expires_in: 1382686496
20857 * }, 'weixin', 'union123', {
20858 * unionIdPlatform: 'weixin',
20859 * asMainAccount: true,
20860 * }).then(function(user) {
20861 * //Access user here
20862 * }).catch(function(error) {
20863 * //console.error("error: ", error);
20864 * });
20865 */
20866 loginWithAuthDataAndUnionId: function loginWithAuthDataAndUnionId(authData, platform, unionId, unionLoginOptions) {
20867 return this.loginWithAuthData(mergeUnionDataIntoAuthData()(authData, unionId, unionLoginOptions), platform, unionLoginOptions);
20868 },
20869
20870 /**
20871 * @deprecated renamed to {@link AV.User.loginWithAuthDataAndUnionId}
20872 * @since 3.5.0
20873 */
20874 signUpOrlogInWithAuthDataAndUnionId: function signUpOrlogInWithAuthDataAndUnionId() {
20875 console.warn('DEPRECATED: User.signUpOrlogInWithAuthDataAndUnionId 已废弃,请使用 User#loginWithAuthDataAndUnionId 代替');
20876 return this.loginWithAuthDataAndUnionId.apply(this, arguments);
20877 },
20878
20879 /**
20880 * Merge unionId into authInfo.
20881 * @since 4.6.0
20882 * @param {Object} authInfo
20883 * @param {String} unionId
20884 * @param {Object} [unionIdOption]
20885 * @param {Boolean} [unionIdOption.asMainAccount] If true, the unionId will be associated with the user.
20886 */
20887 mergeUnionId: function mergeUnionId(authInfo, unionId) {
20888 var _ref14 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
20889 _ref14$asMainAccount = _ref14.asMainAccount,
20890 asMainAccount = _ref14$asMainAccount === void 0 ? false : _ref14$asMainAccount;
20891
20892 authInfo = JSON.parse((0, _stringify.default)(authInfo));
20893 var _authInfo = authInfo,
20894 authData = _authInfo.authData,
20895 platform = _authInfo.platform;
20896 authData.platform = platform;
20897 authData.main_account = asMainAccount;
20898 authData.unionid = unionId;
20899 return authInfo;
20900 },
20901
20902 /**
20903 * 使用当前使用微信小程序的微信用户身份注册或登录,成功后用户的 session 会在设备上持久化保存,之后可以使用 AV.User.current() 获取当前登录用户。
20904 * 仅在微信小程序中可用。
20905 *
20906 * @deprecated please use {@link AV.User.loginWithMiniApp}
20907 * @since 2.0.0
20908 * @param {Object} [options]
20909 * @param {boolean} [options.preferUnionId] 当用户满足 {@link https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/union-id.html 获取 UnionId 的条件} 时,是否使用 UnionId 登录。(since 3.13.0)
20910 * @param {string} [options.unionIdPlatform = 'weixin'] (only take effect when preferUnionId) unionId platform
20911 * @param {boolean} [options.asMainAccount = true] (only take effect when preferUnionId) If true, the unionId will be associated with the user.
20912 * @param {boolean} [options.failOnNotExist] If true, the login request will fail when no user matches this authData exists. (since v3.7.0)
20913 * @return {Promise.<AV.User>}
20914 */
20915 loginWithWeapp: function loginWithWeapp() {
20916 var _this15 = this;
20917
20918 var _ref15 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
20919 _ref15$preferUnionId = _ref15.preferUnionId,
20920 preferUnionId = _ref15$preferUnionId === void 0 ? false : _ref15$preferUnionId,
20921 _ref15$unionIdPlatfor = _ref15.unionIdPlatform,
20922 unionIdPlatform = _ref15$unionIdPlatfor === void 0 ? 'weixin' : _ref15$unionIdPlatfor,
20923 _ref15$asMainAccount = _ref15.asMainAccount,
20924 asMainAccount = _ref15$asMainAccount === void 0 ? true : _ref15$asMainAccount,
20925 _ref15$failOnNotExist = _ref15.failOnNotExist,
20926 failOnNotExist = _ref15$failOnNotExist === void 0 ? false : _ref15$failOnNotExist;
20927
20928 var getAuthInfo = getAdapter('getAuthInfo');
20929 return getAuthInfo({
20930 preferUnionId: preferUnionId,
20931 asMainAccount: asMainAccount,
20932 platform: unionIdPlatform
20933 }).then(function (authInfo) {
20934 return _this15.loginWithMiniApp(authInfo, {
20935 failOnNotExist: failOnNotExist
20936 });
20937 });
20938 },
20939
20940 /**
20941 * 使用当前使用微信小程序的微信用户身份注册或登录,
20942 * 仅在微信小程序中可用。
20943 *
20944 * @deprecated please use {@link AV.User.loginWithMiniApp}
20945 * @since 3.13.0
20946 * @param {Object} [unionLoginOptions]
20947 * @param {string} [unionLoginOptions.unionIdPlatform = 'weixin'] unionId platform
20948 * @param {boolean} [unionLoginOptions.asMainAccount = false] If true, the unionId will be associated with the user.
20949 * @param {boolean} [unionLoginOptions.failOnNotExist] If true, the login request will fail when no user matches this authData exists. * @return {Promise.<AV.User>}
20950 */
20951 loginWithWeappWithUnionId: function loginWithWeappWithUnionId(unionId) {
20952 var _this16 = this;
20953
20954 var _ref16 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
20955 _ref16$unionIdPlatfor = _ref16.unionIdPlatform,
20956 unionIdPlatform = _ref16$unionIdPlatfor === void 0 ? 'weixin' : _ref16$unionIdPlatfor,
20957 _ref16$asMainAccount = _ref16.asMainAccount,
20958 asMainAccount = _ref16$asMainAccount === void 0 ? false : _ref16$asMainAccount,
20959 _ref16$failOnNotExist = _ref16.failOnNotExist,
20960 failOnNotExist = _ref16$failOnNotExist === void 0 ? false : _ref16$failOnNotExist;
20961
20962 var getAuthInfo = getAdapter('getAuthInfo');
20963 return getAuthInfo({
20964 platform: unionIdPlatform
20965 }).then(function (authInfo) {
20966 authInfo = AV.User.mergeUnionId(authInfo, unionId, {
20967 asMainAccount: asMainAccount
20968 });
20969 return _this16.loginWithMiniApp(authInfo, {
20970 failOnNotExist: failOnNotExist
20971 });
20972 });
20973 },
20974
20975 /**
20976 * 使用当前使用 QQ 小程序的 QQ 用户身份注册或登录,成功后用户的 session 会在设备上持久化保存,之后可以使用 AV.User.current() 获取当前登录用户。
20977 * 仅在 QQ 小程序中可用。
20978 *
20979 * @deprecated please use {@link AV.User.loginWithMiniApp}
20980 * @since 4.2.0
20981 * @param {Object} [options]
20982 * @param {boolean} [options.preferUnionId] 如果服务端在登录时获取到了用户的 UnionId,是否将 UnionId 保存在用户账号中。
20983 * @param {string} [options.unionIdPlatform = 'qq'] (only take effect when preferUnionId) unionId platform
20984 * @param {boolean} [options.asMainAccount = true] (only take effect when preferUnionId) If true, the unionId will be associated with the user.
20985 * @param {boolean} [options.failOnNotExist] If true, the login request will fail when no user matches this authData exists. (since v3.7.0)
20986 * @return {Promise.<AV.User>}
20987 */
20988 loginWithQQApp: function loginWithQQApp() {
20989 var _this17 = this;
20990
20991 var _ref17 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
20992 _ref17$preferUnionId = _ref17.preferUnionId,
20993 preferUnionId = _ref17$preferUnionId === void 0 ? false : _ref17$preferUnionId,
20994 _ref17$unionIdPlatfor = _ref17.unionIdPlatform,
20995 unionIdPlatform = _ref17$unionIdPlatfor === void 0 ? 'qq' : _ref17$unionIdPlatfor,
20996 _ref17$asMainAccount = _ref17.asMainAccount,
20997 asMainAccount = _ref17$asMainAccount === void 0 ? true : _ref17$asMainAccount,
20998 _ref17$failOnNotExist = _ref17.failOnNotExist,
20999 failOnNotExist = _ref17$failOnNotExist === void 0 ? false : _ref17$failOnNotExist;
21000
21001 var getAuthInfo = getAdapter('getAuthInfo');
21002 return getAuthInfo({
21003 preferUnionId: preferUnionId,
21004 asMainAccount: asMainAccount,
21005 platform: unionIdPlatform
21006 }).then(function (authInfo) {
21007 authInfo.provider = PLATFORM_QQAPP;
21008 return _this17.loginWithMiniApp(authInfo, {
21009 failOnNotExist: failOnNotExist
21010 });
21011 });
21012 },
21013
21014 /**
21015 * 使用当前使用 QQ 小程序的 QQ 用户身份注册或登录,
21016 * 仅在 QQ 小程序中可用。
21017 *
21018 * @deprecated please use {@link AV.User.loginWithMiniApp}
21019 * @since 4.2.0
21020 * @param {Object} [unionLoginOptions]
21021 * @param {string} [unionLoginOptions.unionIdPlatform = 'qq'] unionId platform
21022 * @param {boolean} [unionLoginOptions.asMainAccount = false] If true, the unionId will be associated with the user.
21023 * @param {boolean} [unionLoginOptions.failOnNotExist] If true, the login request will fail when no user matches this authData exists.
21024 * @return {Promise.<AV.User>}
21025 */
21026 loginWithQQAppWithUnionId: function loginWithQQAppWithUnionId(unionId) {
21027 var _this18 = this;
21028
21029 var _ref18 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
21030 _ref18$unionIdPlatfor = _ref18.unionIdPlatform,
21031 unionIdPlatform = _ref18$unionIdPlatfor === void 0 ? 'qq' : _ref18$unionIdPlatfor,
21032 _ref18$asMainAccount = _ref18.asMainAccount,
21033 asMainAccount = _ref18$asMainAccount === void 0 ? false : _ref18$asMainAccount,
21034 _ref18$failOnNotExist = _ref18.failOnNotExist,
21035 failOnNotExist = _ref18$failOnNotExist === void 0 ? false : _ref18$failOnNotExist;
21036
21037 var getAuthInfo = getAdapter('getAuthInfo');
21038 return getAuthInfo({
21039 platform: unionIdPlatform
21040 }).then(function (authInfo) {
21041 authInfo = AV.User.mergeUnionId(authInfo, unionId, {
21042 asMainAccount: asMainAccount
21043 });
21044 authInfo.provider = PLATFORM_QQAPP;
21045 return _this18.loginWithMiniApp(authInfo, {
21046 failOnNotExist: failOnNotExist
21047 });
21048 });
21049 },
21050
21051 /**
21052 * Register or login using the identity of the current mini-app.
21053 * @param {Object} authInfo
21054 * @param {Object} [option]
21055 * @param {Boolean} [option.failOnNotExist] If true, the login request will fail when no user matches this authInfo.authData exists.
21056 */
21057 loginWithMiniApp: function loginWithMiniApp(authInfo, option) {
21058 var _this19 = this;
21059
21060 if (authInfo === undefined) {
21061 var getAuthInfo = getAdapter('getAuthInfo');
21062 return getAuthInfo().then(function (authInfo) {
21063 return _this19.loginWithAuthData(authInfo.authData, authInfo.provider, option);
21064 });
21065 }
21066
21067 return this.loginWithAuthData(authInfo.authData, authInfo.provider, option);
21068 },
21069
21070 /**
21071 * Only use for DI in tests to produce deterministic IDs.
21072 */
21073 _genId: function _genId() {
21074 return uuid();
21075 },
21076
21077 /**
21078 * Creates an anonymous user.
21079 *
21080 * @since 3.9.0
21081 * @return {Promise.<AV.User>}
21082 */
21083 loginAnonymously: function loginAnonymously() {
21084 return this.loginWithAuthData({
21085 id: AV.User._genId()
21086 }, 'anonymous');
21087 },
21088 associateWithAuthData: function associateWithAuthData(userObj, platform, authData) {
21089 console.warn('DEPRECATED: User.associateWithAuthData 已废弃,请使用 User#associateWithAuthData 代替');
21090 return userObj._linkWith(platform, authData);
21091 },
21092
21093 /**
21094 * Logs out the currently logged in user session. This will remove the
21095 * session from disk, log out of linked services, and future calls to
21096 * <code>current</code> will return <code>null</code>.
21097 * @return {Promise}
21098 */
21099 logOut: function logOut() {
21100 if (AV._config.disableCurrentUser) {
21101 console.warn('AV.User.current() was disabled in multi-user environment, call logOut() from user object instead https://leancloud.cn/docs/leanengine-node-sdk-upgrade-1.html');
21102 return _promise.default.resolve(null);
21103 }
21104
21105 if (AV.User._currentUser !== null) {
21106 AV.User._currentUser._logOutWithAll();
21107
21108 AV.User._currentUser._isCurrentUser = false;
21109 }
21110
21111 AV.User._currentUserMatchesDisk = true;
21112 AV.User._currentUser = null;
21113 return AV.localStorage.removeItemAsync(AV._getAVPath(AV.User._CURRENT_USER_KEY)).then(function () {
21114 return AV._refreshSubscriptionId();
21115 });
21116 },
21117
21118 /**
21119 *Create a follower query for special user to query the user's followers.
21120 * @param {String} userObjectId The user object id.
21121 * @return {AV.FriendShipQuery}
21122 * @since 0.3.0
21123 */
21124 followerQuery: function followerQuery(userObjectId) {
21125 if (!userObjectId || !_.isString(userObjectId)) {
21126 throw new Error('Invalid user object id.');
21127 }
21128
21129 var query = new AV.FriendShipQuery('_Follower');
21130 query._friendshipTag = 'follower';
21131 query.equalTo('user', AV.Object.createWithoutData('_User', userObjectId));
21132 return query;
21133 },
21134
21135 /**
21136 *Create a followee query for special user to query the user's followees.
21137 * @param {String} userObjectId The user object id.
21138 * @return {AV.FriendShipQuery}
21139 * @since 0.3.0
21140 */
21141 followeeQuery: function followeeQuery(userObjectId) {
21142 if (!userObjectId || !_.isString(userObjectId)) {
21143 throw new Error('Invalid user object id.');
21144 }
21145
21146 var query = new AV.FriendShipQuery('_Followee');
21147 query._friendshipTag = 'followee';
21148 query.equalTo('user', AV.Object.createWithoutData('_User', userObjectId));
21149 return query;
21150 },
21151
21152 /**
21153 * Requests a password reset email to be sent to the specified email address
21154 * associated with the user account. This email allows the user to securely
21155 * reset their password on the AV site.
21156 *
21157 * @param {String} email The email address associated with the user that
21158 * forgot their password.
21159 * @return {Promise}
21160 */
21161 requestPasswordReset: function requestPasswordReset(email) {
21162 var json = {
21163 email: email
21164 };
21165 var request = AVRequest('requestPasswordReset', null, null, 'POST', json);
21166 return request;
21167 },
21168
21169 /**
21170 * Requests a verify email to be sent to the specified email address
21171 * associated with the user account. This email allows the user to securely
21172 * verify their email address on the AV site.
21173 *
21174 * @param {String} email The email address associated with the user that
21175 * doesn't verify their email address.
21176 * @return {Promise}
21177 */
21178 requestEmailVerify: function requestEmailVerify(email) {
21179 var json = {
21180 email: email
21181 };
21182 var request = AVRequest('requestEmailVerify', null, null, 'POST', json);
21183 return request;
21184 },
21185
21186 /**
21187 * Requests a verify sms code to be sent to the specified mobile phone
21188 * number associated with the user account. This sms code allows the user to
21189 * verify their mobile phone number by calling AV.User.verifyMobilePhone
21190 *
21191 * @param {String} mobilePhoneNumber The mobile phone number associated with the
21192 * user that doesn't verify their mobile phone number.
21193 * @param {SMSAuthOptions} [options]
21194 * @return {Promise}
21195 */
21196 requestMobilePhoneVerify: function requestMobilePhoneVerify(mobilePhoneNumber) {
21197 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
21198 var data = {
21199 mobilePhoneNumber: mobilePhoneNumber
21200 };
21201
21202 if (options.validateToken) {
21203 data.validate_token = options.validateToken;
21204 }
21205
21206 var request = AVRequest('requestMobilePhoneVerify', null, null, 'POST', data, options);
21207 return request;
21208 },
21209
21210 /**
21211 * Requests a reset password sms code to be sent to the specified mobile phone
21212 * number associated with the user account. This sms code allows the user to
21213 * reset their account's password by calling AV.User.resetPasswordBySmsCode
21214 *
21215 * @param {String} mobilePhoneNumber The mobile phone number associated with the
21216 * user that doesn't verify their mobile phone number.
21217 * @param {SMSAuthOptions} [options]
21218 * @return {Promise}
21219 */
21220 requestPasswordResetBySmsCode: function requestPasswordResetBySmsCode(mobilePhoneNumber) {
21221 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
21222 var data = {
21223 mobilePhoneNumber: mobilePhoneNumber
21224 };
21225
21226 if (options.validateToken) {
21227 data.validate_token = options.validateToken;
21228 }
21229
21230 var request = AVRequest('requestPasswordResetBySmsCode', null, null, 'POST', data, options);
21231 return request;
21232 },
21233
21234 /**
21235 * Requests a change mobile phone number sms code to be sent to the mobilePhoneNumber.
21236 * This sms code allows current user to reset it's mobilePhoneNumber by
21237 * calling {@link AV.User.changePhoneNumber}
21238 * @since 4.7.0
21239 * @param {String} mobilePhoneNumber
21240 * @param {Number} [ttl] ttl of sms code (default is 6 minutes)
21241 * @param {SMSAuthOptions} [options]
21242 * @return {Promise}
21243 */
21244 requestChangePhoneNumber: function requestChangePhoneNumber(mobilePhoneNumber, ttl, options) {
21245 var data = {
21246 mobilePhoneNumber: mobilePhoneNumber
21247 };
21248
21249 if (ttl) {
21250 data.ttl = options.ttl;
21251 }
21252
21253 if (options && options.validateToken) {
21254 data.validate_token = options.validateToken;
21255 }
21256
21257 return AVRequest('requestChangePhoneNumber', null, null, 'POST', data, options);
21258 },
21259
21260 /**
21261 * Makes a call to reset user's account mobilePhoneNumber by sms code.
21262 * The sms code is sent by {@link AV.User.requestChangePhoneNumber}
21263 * @since 4.7.0
21264 * @param {String} mobilePhoneNumber
21265 * @param {String} code The sms code.
21266 * @return {Promise}
21267 */
21268 changePhoneNumber: function changePhoneNumber(mobilePhoneNumber, code) {
21269 var data = {
21270 mobilePhoneNumber: mobilePhoneNumber,
21271 code: code
21272 };
21273 return AVRequest('changePhoneNumber', null, null, 'POST', data);
21274 },
21275
21276 /**
21277 * Makes a call to reset user's account password by sms code and new password.
21278 * The sms code is sent by AV.User.requestPasswordResetBySmsCode.
21279 * @param {String} code The sms code sent by AV.User.Cloud.requestSmsCode
21280 * @param {String} password The new password.
21281 * @return {Promise} A promise that will be resolved with the result
21282 * of the function.
21283 */
21284 resetPasswordBySmsCode: function resetPasswordBySmsCode(code, password) {
21285 var json = {
21286 password: password
21287 };
21288 var request = AVRequest('resetPasswordBySmsCode', null, code, 'PUT', json);
21289 return request;
21290 },
21291
21292 /**
21293 * Makes a call to verify sms code that sent by AV.User.Cloud.requestSmsCode
21294 * If verify successfully,the user mobilePhoneVerified attribute will be true.
21295 * @param {String} code The sms code sent by AV.User.Cloud.requestSmsCode
21296 * @return {Promise} A promise that will be resolved with the result
21297 * of the function.
21298 */
21299 verifyMobilePhone: function verifyMobilePhone(code) {
21300 var request = AVRequest('verifyMobilePhone', null, code, 'POST', null);
21301 return request;
21302 },
21303
21304 /**
21305 * Requests a logIn sms code to be sent to the specified mobile phone
21306 * number associated with the user account. This sms code allows the user to
21307 * login by AV.User.logInWithMobilePhoneSmsCode function.
21308 *
21309 * @param {String} mobilePhoneNumber The mobile phone number associated with the
21310 * user that want to login by AV.User.logInWithMobilePhoneSmsCode
21311 * @param {SMSAuthOptions} [options]
21312 * @return {Promise}
21313 */
21314 requestLoginSmsCode: function requestLoginSmsCode(mobilePhoneNumber) {
21315 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
21316 var data = {
21317 mobilePhoneNumber: mobilePhoneNumber
21318 };
21319
21320 if (options.validateToken) {
21321 data.validate_token = options.validateToken;
21322 }
21323
21324 var request = AVRequest('requestLoginSmsCode', null, null, 'POST', data, options);
21325 return request;
21326 },
21327
21328 /**
21329 * Retrieves the currently logged in AVUser with a valid session,
21330 * either from memory or localStorage, if necessary.
21331 * @return {Promise.<AV.User>} resolved with the currently logged in AV.User.
21332 */
21333 currentAsync: function currentAsync() {
21334 if (AV._config.disableCurrentUser) {
21335 console.warn('AV.User.currentAsync() was disabled in multi-user environment, access user from request instead https://leancloud.cn/docs/leanengine-node-sdk-upgrade-1.html');
21336 return _promise.default.resolve(null);
21337 }
21338
21339 if (AV.User._currentUser) {
21340 return _promise.default.resolve(AV.User._currentUser);
21341 }
21342
21343 if (AV.User._currentUserMatchesDisk) {
21344 return _promise.default.resolve(AV.User._currentUser);
21345 }
21346
21347 return AV.localStorage.getItemAsync(AV._getAVPath(AV.User._CURRENT_USER_KEY)).then(function (userData) {
21348 if (!userData) {
21349 return null;
21350 } // Load the user from local storage.
21351
21352
21353 AV.User._currentUserMatchesDisk = true;
21354 AV.User._currentUser = AV.Object._create('_User');
21355 AV.User._currentUser._isCurrentUser = true;
21356 var json = JSON.parse(userData);
21357 AV.User._currentUser.id = json._id;
21358 delete json._id;
21359 AV.User._currentUser._sessionToken = json._sessionToken;
21360 delete json._sessionToken;
21361
21362 AV.User._currentUser._finishFetch(json); //AV.User._currentUser.set(json);
21363
21364
21365 AV.User._currentUser._synchronizeAllAuthData();
21366
21367 AV.User._currentUser._refreshCache();
21368
21369 AV.User._currentUser._opSetQueue = [{}];
21370 return AV.User._currentUser;
21371 });
21372 },
21373
21374 /**
21375 * Retrieves the currently logged in AVUser with a valid session,
21376 * either from memory or localStorage, if necessary.
21377 * @return {AV.User} The currently logged in AV.User.
21378 */
21379 current: function current() {
21380 if (AV._config.disableCurrentUser) {
21381 console.warn('AV.User.current() was disabled in multi-user environment, access user from request instead https://leancloud.cn/docs/leanengine-node-sdk-upgrade-1.html');
21382 return null;
21383 }
21384
21385 if (AV.localStorage.async) {
21386 var error = new Error('Synchronous API User.current() is not available in this runtime. Use User.currentAsync() instead.');
21387 error.code = 'SYNC_API_NOT_AVAILABLE';
21388 throw error;
21389 }
21390
21391 if (AV.User._currentUser) {
21392 return AV.User._currentUser;
21393 }
21394
21395 if (AV.User._currentUserMatchesDisk) {
21396 return AV.User._currentUser;
21397 } // Load the user from local storage.
21398
21399
21400 AV.User._currentUserMatchesDisk = true;
21401 var userData = AV.localStorage.getItem(AV._getAVPath(AV.User._CURRENT_USER_KEY));
21402
21403 if (!userData) {
21404 return null;
21405 }
21406
21407 AV.User._currentUser = AV.Object._create('_User');
21408 AV.User._currentUser._isCurrentUser = true;
21409 var json = JSON.parse(userData);
21410 AV.User._currentUser.id = json._id;
21411 delete json._id;
21412 AV.User._currentUser._sessionToken = json._sessionToken;
21413 delete json._sessionToken;
21414
21415 AV.User._currentUser._finishFetch(json); //AV.User._currentUser.set(json);
21416
21417
21418 AV.User._currentUser._synchronizeAllAuthData();
21419
21420 AV.User._currentUser._refreshCache();
21421
21422 AV.User._currentUser._opSetQueue = [{}];
21423 return AV.User._currentUser;
21424 },
21425
21426 /**
21427 * Persists a user as currentUser to localStorage, and into the singleton.
21428 * @private
21429 */
21430 _saveCurrentUser: function _saveCurrentUser(user) {
21431 var promise;
21432
21433 if (AV.User._currentUser !== user) {
21434 promise = AV.User.logOut();
21435 } else {
21436 promise = _promise.default.resolve();
21437 }
21438
21439 return promise.then(function () {
21440 user._isCurrentUser = true;
21441 AV.User._currentUser = user;
21442
21443 var json = user._toFullJSON();
21444
21445 json._id = user.id;
21446 json._sessionToken = user._sessionToken;
21447 return AV.localStorage.setItemAsync(AV._getAVPath(AV.User._CURRENT_USER_KEY), (0, _stringify.default)(json)).then(function () {
21448 AV.User._currentUserMatchesDisk = true;
21449 return AV._refreshSubscriptionId();
21450 });
21451 });
21452 },
21453 _registerAuthenticationProvider: function _registerAuthenticationProvider(provider) {
21454 AV.User._authProviders[provider.getAuthType()] = provider; // Synchronize the current user with the auth provider.
21455
21456 if (!AV._config.disableCurrentUser && AV.User.current()) {
21457 AV.User.current()._synchronizeAuthData(provider.getAuthType());
21458 }
21459 },
21460 _logInWith: function _logInWith(provider, authData, options) {
21461 var user = AV.Object._create('_User');
21462
21463 return user._linkWith(provider, authData, options);
21464 }
21465 });
21466};
21467
21468/***/ }),
21469/* 533 */
21470/***/ (function(module, exports, __webpack_require__) {
21471
21472var _Object$defineProperty = __webpack_require__(145);
21473
21474function _defineProperty(obj, key, value) {
21475 if (key in obj) {
21476 _Object$defineProperty(obj, key, {
21477 value: value,
21478 enumerable: true,
21479 configurable: true,
21480 writable: true
21481 });
21482 } else {
21483 obj[key] = value;
21484 }
21485
21486 return obj;
21487}
21488
21489module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
21490
21491/***/ }),
21492/* 534 */
21493/***/ (function(module, exports, __webpack_require__) {
21494
21495"use strict";
21496
21497
21498var _interopRequireDefault = __webpack_require__(1);
21499
21500var _map = _interopRequireDefault(__webpack_require__(42));
21501
21502var _promise = _interopRequireDefault(__webpack_require__(12));
21503
21504var _keys = _interopRequireDefault(__webpack_require__(55));
21505
21506var _stringify = _interopRequireDefault(__webpack_require__(36));
21507
21508var _find = _interopRequireDefault(__webpack_require__(110));
21509
21510var _concat = _interopRequireDefault(__webpack_require__(30));
21511
21512var _ = __webpack_require__(2);
21513
21514var debug = __webpack_require__(67)('leancloud:query');
21515
21516var AVError = __webpack_require__(43);
21517
21518var _require = __webpack_require__(26),
21519 _request = _require._request,
21520 request = _require.request;
21521
21522var _require2 = __webpack_require__(29),
21523 ensureArray = _require2.ensureArray,
21524 transformFetchOptions = _require2.transformFetchOptions,
21525 continueWhile = _require2.continueWhile;
21526
21527var requires = function requires(value, message) {
21528 if (value === undefined) {
21529 throw new Error(message);
21530 }
21531}; // AV.Query is a way to create a list of AV.Objects.
21532
21533
21534module.exports = function (AV) {
21535 /**
21536 * Creates a new AV.Query for the given AV.Object subclass.
21537 * @param {Class|String} objectClass An instance of a subclass of AV.Object, or a AV className string.
21538 * @class
21539 *
21540 * <p>AV.Query defines a query that is used to fetch AV.Objects. The
21541 * most common use case is finding all objects that match a query through the
21542 * <code>find</code> method. For example, this sample code fetches all objects
21543 * of class <code>MyClass</code>. It calls a different function depending on
21544 * whether the fetch succeeded or not.
21545 *
21546 * <pre>
21547 * var query = new AV.Query(MyClass);
21548 * query.find().then(function(results) {
21549 * // results is an array of AV.Object.
21550 * }, function(error) {
21551 * // error is an instance of AVError.
21552 * });</pre></p>
21553 *
21554 * <p>An AV.Query can also be used to retrieve a single object whose id is
21555 * known, through the get method. For example, this sample code fetches an
21556 * object of class <code>MyClass</code> and id <code>myId</code>. It calls a
21557 * different function depending on whether the fetch succeeded or not.
21558 *
21559 * <pre>
21560 * var query = new AV.Query(MyClass);
21561 * query.get(myId).then(function(object) {
21562 * // object is an instance of AV.Object.
21563 * }, function(error) {
21564 * // error is an instance of AVError.
21565 * });</pre></p>
21566 *
21567 * <p>An AV.Query can also be used to count the number of objects that match
21568 * the query without retrieving all of those objects. For example, this
21569 * sample code counts the number of objects of the class <code>MyClass</code>
21570 * <pre>
21571 * var query = new AV.Query(MyClass);
21572 * query.count().then(function(number) {
21573 * // There are number instances of MyClass.
21574 * }, function(error) {
21575 * // error is an instance of AVError.
21576 * });</pre></p>
21577 */
21578 AV.Query = function (objectClass) {
21579 if (_.isString(objectClass)) {
21580 objectClass = AV.Object._getSubclass(objectClass);
21581 }
21582
21583 this.objectClass = objectClass;
21584 this.className = objectClass.prototype.className;
21585 this._where = {};
21586 this._include = [];
21587 this._select = [];
21588 this._limit = -1; // negative limit means, do not send a limit
21589
21590 this._skip = 0;
21591 this._defaultParams = {};
21592 };
21593 /**
21594 * Constructs a AV.Query that is the OR of the passed in queries. For
21595 * example:
21596 * <pre>var compoundQuery = AV.Query.or(query1, query2, query3);</pre>
21597 *
21598 * will create a compoundQuery that is an or of the query1, query2, and
21599 * query3.
21600 * @param {...AV.Query} var_args The list of queries to OR.
21601 * @return {AV.Query} The query that is the OR of the passed in queries.
21602 */
21603
21604
21605 AV.Query.or = function () {
21606 var queries = _.toArray(arguments);
21607
21608 var className = null;
21609
21610 AV._arrayEach(queries, function (q) {
21611 if (_.isNull(className)) {
21612 className = q.className;
21613 }
21614
21615 if (className !== q.className) {
21616 throw new Error('All queries must be for the same class');
21617 }
21618 });
21619
21620 var query = new AV.Query(className);
21621
21622 query._orQuery(queries);
21623
21624 return query;
21625 };
21626 /**
21627 * Constructs a AV.Query that is the AND of the passed in queries. For
21628 * example:
21629 * <pre>var compoundQuery = AV.Query.and(query1, query2, query3);</pre>
21630 *
21631 * will create a compoundQuery that is an 'and' of the query1, query2, and
21632 * query3.
21633 * @param {...AV.Query} var_args The list of queries to AND.
21634 * @return {AV.Query} The query that is the AND of the passed in queries.
21635 */
21636
21637
21638 AV.Query.and = function () {
21639 var queries = _.toArray(arguments);
21640
21641 var className = null;
21642
21643 AV._arrayEach(queries, function (q) {
21644 if (_.isNull(className)) {
21645 className = q.className;
21646 }
21647
21648 if (className !== q.className) {
21649 throw new Error('All queries must be for the same class');
21650 }
21651 });
21652
21653 var query = new AV.Query(className);
21654
21655 query._andQuery(queries);
21656
21657 return query;
21658 };
21659 /**
21660 * Retrieves a list of AVObjects that satisfy the CQL.
21661 * CQL syntax please see {@link https://leancloud.cn/docs/cql_guide.html CQL Guide}.
21662 *
21663 * @param {String} cql A CQL string, see {@link https://leancloud.cn/docs/cql_guide.html CQL Guide}.
21664 * @param {Array} pvalues An array contains placeholder values.
21665 * @param {AuthOptions} options
21666 * @return {Promise} A promise that is resolved with the results when
21667 * the query completes.
21668 */
21669
21670
21671 AV.Query.doCloudQuery = function (cql, pvalues, options) {
21672 var params = {
21673 cql: cql
21674 };
21675
21676 if (_.isArray(pvalues)) {
21677 params.pvalues = pvalues;
21678 } else {
21679 options = pvalues;
21680 }
21681
21682 var request = _request('cloudQuery', null, null, 'GET', params, options);
21683
21684 return request.then(function (response) {
21685 //query to process results.
21686 var query = new AV.Query(response.className);
21687 var results = (0, _map.default)(_).call(_, response.results, function (json) {
21688 var obj = query._newObject(response);
21689
21690 if (obj._finishFetch) {
21691 obj._finishFetch(query._processResult(json), true);
21692 }
21693
21694 return obj;
21695 });
21696 return {
21697 results: results,
21698 count: response.count,
21699 className: response.className
21700 };
21701 });
21702 };
21703 /**
21704 * Return a query with conditions from json.
21705 * This can be useful to send a query from server side to client side.
21706 * @since 4.0.0
21707 * @param {Object} json from {@link AV.Query#toJSON}
21708 * @return {AV.Query}
21709 */
21710
21711
21712 AV.Query.fromJSON = function (_ref) {
21713 var className = _ref.className,
21714 where = _ref.where,
21715 include = _ref.include,
21716 select = _ref.select,
21717 includeACL = _ref.includeACL,
21718 limit = _ref.limit,
21719 skip = _ref.skip,
21720 order = _ref.order;
21721
21722 if (typeof className !== 'string') {
21723 throw new TypeError('Invalid Query JSON, className must be a String.');
21724 }
21725
21726 var query = new AV.Query(className);
21727
21728 _.extend(query, {
21729 _where: where,
21730 _include: include,
21731 _select: select,
21732 _includeACL: includeACL,
21733 _limit: limit,
21734 _skip: skip,
21735 _order: order
21736 });
21737
21738 return query;
21739 };
21740
21741 AV.Query._extend = AV._extend;
21742
21743 _.extend(AV.Query.prototype,
21744 /** @lends AV.Query.prototype */
21745 {
21746 //hook to iterate result. Added by dennis<xzhuang@avoscloud.com>.
21747 _processResult: function _processResult(obj) {
21748 return obj;
21749 },
21750
21751 /**
21752 * Constructs an AV.Object whose id is already known by fetching data from
21753 * the server.
21754 *
21755 * @param {String} objectId The id of the object to be fetched.
21756 * @param {AuthOptions} options
21757 * @return {Promise.<AV.Object>}
21758 */
21759 get: function get(objectId, options) {
21760 if (!_.isString(objectId)) {
21761 throw new Error('objectId must be a string');
21762 }
21763
21764 if (objectId === '') {
21765 return _promise.default.reject(new AVError(AVError.OBJECT_NOT_FOUND, 'Object not found.'));
21766 }
21767
21768 var obj = this._newObject();
21769
21770 obj.id = objectId;
21771
21772 var queryJSON = this._getParams();
21773
21774 var fetchOptions = {};
21775 if ((0, _keys.default)(queryJSON)) fetchOptions.keys = (0, _keys.default)(queryJSON);
21776 if (queryJSON.include) fetchOptions.include = queryJSON.include;
21777 if (queryJSON.includeACL) fetchOptions.includeACL = queryJSON.includeACL;
21778 return _request('classes', this.className, objectId, 'GET', transformFetchOptions(fetchOptions), options).then(function (response) {
21779 if (_.isEmpty(response)) throw new AVError(AVError.OBJECT_NOT_FOUND, 'Object not found.');
21780
21781 obj._finishFetch(obj.parse(response), true);
21782
21783 return obj;
21784 });
21785 },
21786
21787 /**
21788 * Returns a JSON representation of this query.
21789 * @return {Object}
21790 */
21791 toJSON: function toJSON() {
21792 var className = this.className,
21793 where = this._where,
21794 include = this._include,
21795 select = this._select,
21796 includeACL = this._includeACL,
21797 limit = this._limit,
21798 skip = this._skip,
21799 order = this._order;
21800 return {
21801 className: className,
21802 where: where,
21803 include: include,
21804 select: select,
21805 includeACL: includeACL,
21806 limit: limit,
21807 skip: skip,
21808 order: order
21809 };
21810 },
21811 _getParams: function _getParams() {
21812 var params = _.extend({}, this._defaultParams, {
21813 where: this._where
21814 });
21815
21816 if (this._include.length > 0) {
21817 params.include = this._include.join(',');
21818 }
21819
21820 if (this._select.length > 0) {
21821 params.keys = this._select.join(',');
21822 }
21823
21824 if (this._includeACL !== undefined) {
21825 params.returnACL = this._includeACL;
21826 }
21827
21828 if (this._limit >= 0) {
21829 params.limit = this._limit;
21830 }
21831
21832 if (this._skip > 0) {
21833 params.skip = this._skip;
21834 }
21835
21836 if (this._order !== undefined) {
21837 params.order = this._order;
21838 }
21839
21840 return params;
21841 },
21842 _newObject: function _newObject(response) {
21843 var obj;
21844
21845 if (response && response.className) {
21846 obj = new AV.Object(response.className);
21847 } else {
21848 obj = new this.objectClass();
21849 }
21850
21851 return obj;
21852 },
21853 _createRequest: function _createRequest() {
21854 var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this._getParams();
21855 var options = arguments.length > 1 ? arguments[1] : undefined;
21856 var path = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "/classes/".concat(this.className);
21857
21858 if (encodeURIComponent((0, _stringify.default)(params)).length > 2000) {
21859 var body = {
21860 requests: [{
21861 method: 'GET',
21862 path: "/1.1".concat(path),
21863 params: params
21864 }]
21865 };
21866 return request({
21867 path: '/batch',
21868 method: 'POST',
21869 data: body,
21870 authOptions: options
21871 }).then(function (response) {
21872 var result = response[0];
21873
21874 if (result.success) {
21875 return result.success;
21876 }
21877
21878 var error = new AVError(result.error.code, result.error.error || 'Unknown batch error');
21879 throw error;
21880 });
21881 }
21882
21883 return request({
21884 method: 'GET',
21885 path: path,
21886 query: params,
21887 authOptions: options
21888 });
21889 },
21890 _parseResponse: function _parseResponse(response) {
21891 var _this = this;
21892
21893 return (0, _map.default)(_).call(_, response.results, function (json) {
21894 var obj = _this._newObject(response);
21895
21896 if (obj._finishFetch) {
21897 obj._finishFetch(_this._processResult(json), true);
21898 }
21899
21900 return obj;
21901 });
21902 },
21903
21904 /**
21905 * Retrieves a list of AVObjects that satisfy this query.
21906 *
21907 * @param {AuthOptions} options
21908 * @return {Promise} A promise that is resolved with the results when
21909 * the query completes.
21910 */
21911 find: function find(options) {
21912 var request = this._createRequest(undefined, options);
21913
21914 return request.then(this._parseResponse.bind(this));
21915 },
21916
21917 /**
21918 * Retrieves both AVObjects and total count.
21919 *
21920 * @since 4.12.0
21921 * @param {AuthOptions} options
21922 * @return {Promise} A tuple contains results and count.
21923 */
21924 findAndCount: function findAndCount(options) {
21925 var _this2 = this;
21926
21927 var params = this._getParams();
21928
21929 params.count = 1;
21930
21931 var request = this._createRequest(params, options);
21932
21933 return request.then(function (response) {
21934 return [_this2._parseResponse(response), response.count];
21935 });
21936 },
21937
21938 /**
21939 * scan a Query. masterKey required.
21940 *
21941 * @since 2.1.0
21942 * @param {object} [options]
21943 * @param {string} [options.orderedBy] specify the key to sort
21944 * @param {number} [options.batchSize] specify the batch size for each request
21945 * @param {AuthOptions} [authOptions]
21946 * @return {AsyncIterator.<AV.Object>}
21947 * @example const testIterator = {
21948 * [Symbol.asyncIterator]() {
21949 * return new Query('Test').scan(undefined, { useMasterKey: true });
21950 * },
21951 * };
21952 * for await (const test of testIterator) {
21953 * console.log(test.id);
21954 * }
21955 */
21956 scan: function scan() {
21957 var _this3 = this;
21958
21959 var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
21960 orderedBy = _ref2.orderedBy,
21961 batchSize = _ref2.batchSize;
21962
21963 var authOptions = arguments.length > 1 ? arguments[1] : undefined;
21964
21965 var condition = this._getParams();
21966
21967 debug('scan %O', condition);
21968
21969 if (condition.order) {
21970 console.warn('The order of the query is ignored for Query#scan. Checkout the orderedBy option of Query#scan.');
21971 delete condition.order;
21972 }
21973
21974 if (condition.skip) {
21975 console.warn('The skip option of the query is ignored for Query#scan.');
21976 delete condition.skip;
21977 }
21978
21979 if (condition.limit) {
21980 console.warn('The limit option of the query is ignored for Query#scan.');
21981 delete condition.limit;
21982 }
21983
21984 if (orderedBy) condition.scan_key = orderedBy;
21985 if (batchSize) condition.limit = batchSize;
21986 var cursor;
21987 var remainResults = [];
21988 return {
21989 next: function next() {
21990 if (remainResults.length) {
21991 return _promise.default.resolve({
21992 done: false,
21993 value: remainResults.shift()
21994 });
21995 }
21996
21997 if (cursor === null) {
21998 return _promise.default.resolve({
21999 done: true
22000 });
22001 }
22002
22003 return _request('scan/classes', _this3.className, null, 'GET', cursor ? _.extend({}, condition, {
22004 cursor: cursor
22005 }) : condition, authOptions).then(function (response) {
22006 cursor = response.cursor;
22007
22008 if (response.results.length) {
22009 var results = _this3._parseResponse(response);
22010
22011 results.forEach(function (result) {
22012 return remainResults.push(result);
22013 });
22014 }
22015
22016 if (cursor === null && remainResults.length === 0) {
22017 return {
22018 done: true
22019 };
22020 }
22021
22022 return {
22023 done: false,
22024 value: remainResults.shift()
22025 };
22026 });
22027 }
22028 };
22029 },
22030
22031 /**
22032 * Delete objects retrieved by this query.
22033 * @param {AuthOptions} options
22034 * @return {Promise} A promise that is fulfilled when the save
22035 * completes.
22036 */
22037 destroyAll: function destroyAll(options) {
22038 var self = this;
22039 return (0, _find.default)(self).call(self, options).then(function (objects) {
22040 return AV.Object.destroyAll(objects, options);
22041 });
22042 },
22043
22044 /**
22045 * Counts the number of objects that match this query.
22046 *
22047 * @param {AuthOptions} options
22048 * @return {Promise} A promise that is resolved with the count when
22049 * the query completes.
22050 */
22051 count: function count(options) {
22052 var params = this._getParams();
22053
22054 params.limit = 0;
22055 params.count = 1;
22056
22057 var request = this._createRequest(params, options);
22058
22059 return request.then(function (response) {
22060 return response.count;
22061 });
22062 },
22063
22064 /**
22065 * Retrieves at most one AV.Object that satisfies this query.
22066 *
22067 * @param {AuthOptions} options
22068 * @return {Promise} A promise that is resolved with the object when
22069 * the query completes.
22070 */
22071 first: function first(options) {
22072 var self = this;
22073
22074 var params = this._getParams();
22075
22076 params.limit = 1;
22077
22078 var request = this._createRequest(params, options);
22079
22080 return request.then(function (response) {
22081 return (0, _map.default)(_).call(_, response.results, function (json) {
22082 var obj = self._newObject();
22083
22084 if (obj._finishFetch) {
22085 obj._finishFetch(self._processResult(json), true);
22086 }
22087
22088 return obj;
22089 })[0];
22090 });
22091 },
22092
22093 /**
22094 * Sets the number of results to skip before returning any results.
22095 * This is useful for pagination.
22096 * Default is to skip zero results.
22097 * @param {Number} n the number of results to skip.
22098 * @return {AV.Query} Returns the query, so you can chain this call.
22099 */
22100 skip: function skip(n) {
22101 requires(n, 'undefined is not a valid skip value');
22102 this._skip = n;
22103 return this;
22104 },
22105
22106 /**
22107 * Sets the limit of the number of results to return. The default limit is
22108 * 100, with a maximum of 1000 results being returned at a time.
22109 * @param {Number} n the number of results to limit to.
22110 * @return {AV.Query} Returns the query, so you can chain this call.
22111 */
22112 limit: function limit(n) {
22113 requires(n, 'undefined is not a valid limit value');
22114 this._limit = n;
22115 return this;
22116 },
22117
22118 /**
22119 * Add a constraint to the query that requires a particular key's value to
22120 * be equal to the provided value.
22121 * @param {String} key The key to check.
22122 * @param value The value that the AV.Object must contain.
22123 * @return {AV.Query} Returns the query, so you can chain this call.
22124 */
22125 equalTo: function equalTo(key, value) {
22126 requires(key, 'undefined is not a valid key');
22127 requires(value, 'undefined is not a valid value');
22128 this._where[key] = AV._encode(value);
22129 return this;
22130 },
22131
22132 /**
22133 * Helper for condition queries
22134 * @private
22135 */
22136 _addCondition: function _addCondition(key, condition, value) {
22137 requires(key, 'undefined is not a valid condition key');
22138 requires(condition, 'undefined is not a valid condition');
22139 requires(value, 'undefined is not a valid condition value'); // Check if we already have a condition
22140
22141 if (!this._where[key]) {
22142 this._where[key] = {};
22143 }
22144
22145 this._where[key][condition] = AV._encode(value);
22146 return this;
22147 },
22148
22149 /**
22150 * Add a constraint to the query that requires a particular
22151 * <strong>array</strong> key's length to be equal to the provided value.
22152 * @param {String} key The array key to check.
22153 * @param {number} value The length value.
22154 * @return {AV.Query} Returns the query, so you can chain this call.
22155 */
22156 sizeEqualTo: function sizeEqualTo(key, value) {
22157 this._addCondition(key, '$size', value);
22158
22159 return this;
22160 },
22161
22162 /**
22163 * Add a constraint to the query that requires a particular key's value to
22164 * be not equal to the provided value.
22165 * @param {String} key The key to check.
22166 * @param value The value that must not be equalled.
22167 * @return {AV.Query} Returns the query, so you can chain this call.
22168 */
22169 notEqualTo: function notEqualTo(key, value) {
22170 this._addCondition(key, '$ne', value);
22171
22172 return this;
22173 },
22174
22175 /**
22176 * Add a constraint to the query that requires a particular key's value to
22177 * be less than the provided value.
22178 * @param {String} key The key to check.
22179 * @param value The value that provides an upper bound.
22180 * @return {AV.Query} Returns the query, so you can chain this call.
22181 */
22182 lessThan: function lessThan(key, value) {
22183 this._addCondition(key, '$lt', value);
22184
22185 return this;
22186 },
22187
22188 /**
22189 * Add a constraint to the query that requires a particular key's value to
22190 * be greater than the provided value.
22191 * @param {String} key The key to check.
22192 * @param value The value that provides an lower bound.
22193 * @return {AV.Query} Returns the query, so you can chain this call.
22194 */
22195 greaterThan: function greaterThan(key, value) {
22196 this._addCondition(key, '$gt', value);
22197
22198 return this;
22199 },
22200
22201 /**
22202 * Add a constraint to the query that requires a particular key's value to
22203 * be less than or equal to the provided value.
22204 * @param {String} key The key to check.
22205 * @param value The value that provides an upper bound.
22206 * @return {AV.Query} Returns the query, so you can chain this call.
22207 */
22208 lessThanOrEqualTo: function lessThanOrEqualTo(key, value) {
22209 this._addCondition(key, '$lte', value);
22210
22211 return this;
22212 },
22213
22214 /**
22215 * Add a constraint to the query that requires a particular key's value to
22216 * be greater than or equal to the provided value.
22217 * @param {String} key The key to check.
22218 * @param value The value that provides an lower bound.
22219 * @return {AV.Query} Returns the query, so you can chain this call.
22220 */
22221 greaterThanOrEqualTo: function greaterThanOrEqualTo(key, value) {
22222 this._addCondition(key, '$gte', value);
22223
22224 return this;
22225 },
22226
22227 /**
22228 * Add a constraint to the query that requires a particular key's value to
22229 * be contained in the provided list of values.
22230 * @param {String} key The key to check.
22231 * @param {Array} values The values that will match.
22232 * @return {AV.Query} Returns the query, so you can chain this call.
22233 */
22234 containedIn: function containedIn(key, values) {
22235 this._addCondition(key, '$in', values);
22236
22237 return this;
22238 },
22239
22240 /**
22241 * Add a constraint to the query that requires a particular key's value to
22242 * not be contained in the provided list of values.
22243 * @param {String} key The key to check.
22244 * @param {Array} values The values that will not match.
22245 * @return {AV.Query} Returns the query, so you can chain this call.
22246 */
22247 notContainedIn: function notContainedIn(key, values) {
22248 this._addCondition(key, '$nin', values);
22249
22250 return this;
22251 },
22252
22253 /**
22254 * Add a constraint to the query that requires a particular key's value to
22255 * contain each one of the provided list of values.
22256 * @param {String} key The key to check. This key's value must be an array.
22257 * @param {Array} values The values that will match.
22258 * @return {AV.Query} Returns the query, so you can chain this call.
22259 */
22260 containsAll: function containsAll(key, values) {
22261 this._addCondition(key, '$all', values);
22262
22263 return this;
22264 },
22265
22266 /**
22267 * Add a constraint for finding objects that contain the given key.
22268 * @param {String} key The key that should exist.
22269 * @return {AV.Query} Returns the query, so you can chain this call.
22270 */
22271 exists: function exists(key) {
22272 this._addCondition(key, '$exists', true);
22273
22274 return this;
22275 },
22276
22277 /**
22278 * Add a constraint for finding objects that do not contain a given key.
22279 * @param {String} key The key that should not exist
22280 * @return {AV.Query} Returns the query, so you can chain this call.
22281 */
22282 doesNotExist: function doesNotExist(key) {
22283 this._addCondition(key, '$exists', false);
22284
22285 return this;
22286 },
22287
22288 /**
22289 * Add a regular expression constraint for finding string values that match
22290 * the provided regular expression.
22291 * This may be slow for large datasets.
22292 * @param {String} key The key that the string to match is stored in.
22293 * @param {RegExp} regex The regular expression pattern to match.
22294 * @return {AV.Query} Returns the query, so you can chain this call.
22295 */
22296 matches: function matches(key, regex, modifiers) {
22297 this._addCondition(key, '$regex', regex);
22298
22299 if (!modifiers) {
22300 modifiers = '';
22301 } // Javascript regex options support mig as inline options but store them
22302 // as properties of the object. We support mi & should migrate them to
22303 // modifiers
22304
22305
22306 if (regex.ignoreCase) {
22307 modifiers += 'i';
22308 }
22309
22310 if (regex.multiline) {
22311 modifiers += 'm';
22312 }
22313
22314 if (modifiers && modifiers.length) {
22315 this._addCondition(key, '$options', modifiers);
22316 }
22317
22318 return this;
22319 },
22320
22321 /**
22322 * Add a constraint that requires that a key's value matches a AV.Query
22323 * constraint.
22324 * @param {String} key The key that the contains the object to match the
22325 * query.
22326 * @param {AV.Query} query The query that should match.
22327 * @return {AV.Query} Returns the query, so you can chain this call.
22328 */
22329 matchesQuery: function matchesQuery(key, query) {
22330 var queryJSON = query._getParams();
22331
22332 queryJSON.className = query.className;
22333
22334 this._addCondition(key, '$inQuery', queryJSON);
22335
22336 return this;
22337 },
22338
22339 /**
22340 * Add a constraint that requires that a key's value not matches a
22341 * AV.Query constraint.
22342 * @param {String} key The key that the contains the object to match the
22343 * query.
22344 * @param {AV.Query} query The query that should not match.
22345 * @return {AV.Query} Returns the query, so you can chain this call.
22346 */
22347 doesNotMatchQuery: function doesNotMatchQuery(key, query) {
22348 var queryJSON = query._getParams();
22349
22350 queryJSON.className = query.className;
22351
22352 this._addCondition(key, '$notInQuery', queryJSON);
22353
22354 return this;
22355 },
22356
22357 /**
22358 * Add a constraint that requires that a key's value matches a value in
22359 * an object returned by a different AV.Query.
22360 * @param {String} key The key that contains the value that is being
22361 * matched.
22362 * @param {String} queryKey The key in the objects returned by the query to
22363 * match against.
22364 * @param {AV.Query} query The query to run.
22365 * @return {AV.Query} Returns the query, so you can chain this call.
22366 */
22367 matchesKeyInQuery: function matchesKeyInQuery(key, queryKey, query) {
22368 var queryJSON = query._getParams();
22369
22370 queryJSON.className = query.className;
22371
22372 this._addCondition(key, '$select', {
22373 key: queryKey,
22374 query: queryJSON
22375 });
22376
22377 return this;
22378 },
22379
22380 /**
22381 * Add a constraint that requires that a key's value not match a value in
22382 * an object returned by a different AV.Query.
22383 * @param {String} key The key that contains the value that is being
22384 * excluded.
22385 * @param {String} queryKey The key in the objects returned by the query to
22386 * match against.
22387 * @param {AV.Query} query The query to run.
22388 * @return {AV.Query} Returns the query, so you can chain this call.
22389 */
22390 doesNotMatchKeyInQuery: function doesNotMatchKeyInQuery(key, queryKey, query) {
22391 var queryJSON = query._getParams();
22392
22393 queryJSON.className = query.className;
22394
22395 this._addCondition(key, '$dontSelect', {
22396 key: queryKey,
22397 query: queryJSON
22398 });
22399
22400 return this;
22401 },
22402
22403 /**
22404 * Add constraint that at least one of the passed in queries matches.
22405 * @param {Array} queries
22406 * @return {AV.Query} Returns the query, so you can chain this call.
22407 * @private
22408 */
22409 _orQuery: function _orQuery(queries) {
22410 var queryJSON = (0, _map.default)(_).call(_, queries, function (q) {
22411 return q._getParams().where;
22412 });
22413 this._where.$or = queryJSON;
22414 return this;
22415 },
22416
22417 /**
22418 * Add constraint that both of the passed in queries matches.
22419 * @param {Array} queries
22420 * @return {AV.Query} Returns the query, so you can chain this call.
22421 * @private
22422 */
22423 _andQuery: function _andQuery(queries) {
22424 var queryJSON = (0, _map.default)(_).call(_, queries, function (q) {
22425 return q._getParams().where;
22426 });
22427 this._where.$and = queryJSON;
22428 return this;
22429 },
22430
22431 /**
22432 * Converts a string into a regex that matches it.
22433 * Surrounding with \Q .. \E does this, we just need to escape \E's in
22434 * the text separately.
22435 * @private
22436 */
22437 _quote: function _quote(s) {
22438 return '\\Q' + s.replace('\\E', '\\E\\\\E\\Q') + '\\E';
22439 },
22440
22441 /**
22442 * Add a constraint for finding string values that contain a provided
22443 * string. This may be slow for large datasets.
22444 * @param {String} key The key that the string to match is stored in.
22445 * @param {String} substring The substring that the value must contain.
22446 * @return {AV.Query} Returns the query, so you can chain this call.
22447 */
22448 contains: function contains(key, value) {
22449 this._addCondition(key, '$regex', this._quote(value));
22450
22451 return this;
22452 },
22453
22454 /**
22455 * Add a constraint for finding string values that start with a provided
22456 * string. This query will use the backend index, so it will be fast even
22457 * for large datasets.
22458 * @param {String} key The key that the string to match is stored in.
22459 * @param {String} prefix The substring that the value must start with.
22460 * @return {AV.Query} Returns the query, so you can chain this call.
22461 */
22462 startsWith: function startsWith(key, value) {
22463 this._addCondition(key, '$regex', '^' + this._quote(value));
22464
22465 return this;
22466 },
22467
22468 /**
22469 * Add a constraint for finding string values that end with a provided
22470 * string. This will be slow for large datasets.
22471 * @param {String} key The key that the string to match is stored in.
22472 * @param {String} suffix The substring that the value must end with.
22473 * @return {AV.Query} Returns the query, so you can chain this call.
22474 */
22475 endsWith: function endsWith(key, value) {
22476 this._addCondition(key, '$regex', this._quote(value) + '$');
22477
22478 return this;
22479 },
22480
22481 /**
22482 * Sorts the results in ascending order by the given key.
22483 *
22484 * @param {String} key The key to order by.
22485 * @return {AV.Query} Returns the query, so you can chain this call.
22486 */
22487 ascending: function ascending(key) {
22488 requires(key, 'undefined is not a valid key');
22489 this._order = key;
22490 return this;
22491 },
22492
22493 /**
22494 * Also sorts the results in ascending order by the given key. The previous sort keys have
22495 * precedence over this key.
22496 *
22497 * @param {String} key The key to order by
22498 * @return {AV.Query} Returns the query so you can chain this call.
22499 */
22500 addAscending: function addAscending(key) {
22501 requires(key, 'undefined is not a valid key');
22502 if (this._order) this._order += ',' + key;else this._order = key;
22503 return this;
22504 },
22505
22506 /**
22507 * Sorts the results in descending order by the given key.
22508 *
22509 * @param {String} key The key to order by.
22510 * @return {AV.Query} Returns the query, so you can chain this call.
22511 */
22512 descending: function descending(key) {
22513 requires(key, 'undefined is not a valid key');
22514 this._order = '-' + key;
22515 return this;
22516 },
22517
22518 /**
22519 * Also sorts the results in descending order by the given key. The previous sort keys have
22520 * precedence over this key.
22521 *
22522 * @param {String} key The key to order by
22523 * @return {AV.Query} Returns the query so you can chain this call.
22524 */
22525 addDescending: function addDescending(key) {
22526 requires(key, 'undefined is not a valid key');
22527 if (this._order) this._order += ',-' + key;else this._order = '-' + key;
22528 return this;
22529 },
22530
22531 /**
22532 * Add a proximity based constraint for finding objects with key point
22533 * values near the point given.
22534 * @param {String} key The key that the AV.GeoPoint is stored in.
22535 * @param {AV.GeoPoint} point The reference AV.GeoPoint that is used.
22536 * @return {AV.Query} Returns the query, so you can chain this call.
22537 */
22538 near: function near(key, point) {
22539 if (!(point instanceof AV.GeoPoint)) {
22540 // Try to cast it to a GeoPoint, so that near("loc", [20,30]) works.
22541 point = new AV.GeoPoint(point);
22542 }
22543
22544 this._addCondition(key, '$nearSphere', point);
22545
22546 return this;
22547 },
22548
22549 /**
22550 * Add a proximity based constraint for finding objects with key point
22551 * values near the point given and within the maximum distance given.
22552 * @param {String} key The key that the AV.GeoPoint is stored in.
22553 * @param {AV.GeoPoint} point The reference AV.GeoPoint that is used.
22554 * @param maxDistance Maximum distance (in radians) of results to return.
22555 * @return {AV.Query} Returns the query, so you can chain this call.
22556 */
22557 withinRadians: function withinRadians(key, point, distance) {
22558 this.near(key, point);
22559
22560 this._addCondition(key, '$maxDistance', distance);
22561
22562 return this;
22563 },
22564
22565 /**
22566 * Add a proximity based constraint for finding objects with key point
22567 * values near the point given and within the maximum distance given.
22568 * Radius of earth used is 3958.8 miles.
22569 * @param {String} key The key that the AV.GeoPoint is stored in.
22570 * @param {AV.GeoPoint} point The reference AV.GeoPoint that is used.
22571 * @param {Number} maxDistance Maximum distance (in miles) of results to
22572 * return.
22573 * @return {AV.Query} Returns the query, so you can chain this call.
22574 */
22575 withinMiles: function withinMiles(key, point, distance) {
22576 return this.withinRadians(key, point, distance / 3958.8);
22577 },
22578
22579 /**
22580 * Add a proximity based constraint for finding objects with key point
22581 * values near the point given and within the maximum distance given.
22582 * Radius of earth used is 6371.0 kilometers.
22583 * @param {String} key The key that the AV.GeoPoint is stored in.
22584 * @param {AV.GeoPoint} point The reference AV.GeoPoint that is used.
22585 * @param {Number} maxDistance Maximum distance (in kilometers) of results
22586 * to return.
22587 * @return {AV.Query} Returns the query, so you can chain this call.
22588 */
22589 withinKilometers: function withinKilometers(key, point, distance) {
22590 return this.withinRadians(key, point, distance / 6371.0);
22591 },
22592
22593 /**
22594 * Add a constraint to the query that requires a particular key's
22595 * coordinates be contained within a given rectangular geographic bounding
22596 * box.
22597 * @param {String} key The key to be constrained.
22598 * @param {AV.GeoPoint} southwest
22599 * The lower-left inclusive corner of the box.
22600 * @param {AV.GeoPoint} northeast
22601 * The upper-right inclusive corner of the box.
22602 * @return {AV.Query} Returns the query, so you can chain this call.
22603 */
22604 withinGeoBox: function withinGeoBox(key, southwest, northeast) {
22605 if (!(southwest instanceof AV.GeoPoint)) {
22606 southwest = new AV.GeoPoint(southwest);
22607 }
22608
22609 if (!(northeast instanceof AV.GeoPoint)) {
22610 northeast = new AV.GeoPoint(northeast);
22611 }
22612
22613 this._addCondition(key, '$within', {
22614 $box: [southwest, northeast]
22615 });
22616
22617 return this;
22618 },
22619
22620 /**
22621 * Include nested AV.Objects for the provided key. You can use dot
22622 * notation to specify which fields in the included object are also fetch.
22623 * @param {String[]} keys The name of the key to include.
22624 * @return {AV.Query} Returns the query, so you can chain this call.
22625 */
22626 include: function include(keys) {
22627 var _this4 = this;
22628
22629 requires(keys, 'undefined is not a valid key');
22630
22631 _.forEach(arguments, function (keys) {
22632 var _context;
22633
22634 _this4._include = (0, _concat.default)(_context = _this4._include).call(_context, ensureArray(keys));
22635 });
22636
22637 return this;
22638 },
22639
22640 /**
22641 * Include the ACL.
22642 * @param {Boolean} [value=true] Whether to include the ACL
22643 * @return {AV.Query} Returns the query, so you can chain this call.
22644 */
22645 includeACL: function includeACL() {
22646 var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
22647 this._includeACL = value;
22648 return this;
22649 },
22650
22651 /**
22652 * Restrict the fields of the returned AV.Objects to include only the
22653 * provided keys. If this is called multiple times, then all of the keys
22654 * specified in each of the calls will be included.
22655 * @param {String[]} keys The names of the keys to include.
22656 * @return {AV.Query} Returns the query, so you can chain this call.
22657 */
22658 select: function select(keys) {
22659 var _this5 = this;
22660
22661 requires(keys, 'undefined is not a valid key');
22662
22663 _.forEach(arguments, function (keys) {
22664 var _context2;
22665
22666 _this5._select = (0, _concat.default)(_context2 = _this5._select).call(_context2, ensureArray(keys));
22667 });
22668
22669 return this;
22670 },
22671
22672 /**
22673 * Iterates over each result of a query, calling a callback for each one. If
22674 * the callback returns a promise, the iteration will not continue until
22675 * that promise has been fulfilled. If the callback returns a rejected
22676 * promise, then iteration will stop with that error. The items are
22677 * processed in an unspecified order. The query may not have any sort order,
22678 * and may not use limit or skip.
22679 * @param callback {Function} Callback that will be called with each result
22680 * of the query.
22681 * @return {Promise} A promise that will be fulfilled once the
22682 * iteration has completed.
22683 */
22684 each: function each(callback) {
22685 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
22686
22687 if (this._order || this._skip || this._limit >= 0) {
22688 var error = new Error('Cannot iterate on a query with sort, skip, or limit.');
22689 return _promise.default.reject(error);
22690 }
22691
22692 var query = new AV.Query(this.objectClass); // We can override the batch size from the options.
22693 // This is undocumented, but useful for testing.
22694
22695 query._limit = options.batchSize || 100;
22696 query._where = _.clone(this._where);
22697 query._include = _.clone(this._include);
22698 query.ascending('objectId');
22699 var finished = false;
22700 return continueWhile(function () {
22701 return !finished;
22702 }, function () {
22703 return (0, _find.default)(query).call(query, options).then(function (results) {
22704 var callbacksDone = _promise.default.resolve();
22705
22706 _.each(results, function (result) {
22707 callbacksDone = callbacksDone.then(function () {
22708 return callback(result);
22709 });
22710 });
22711
22712 return callbacksDone.then(function () {
22713 if (results.length >= query._limit) {
22714 query.greaterThan('objectId', results[results.length - 1].id);
22715 } else {
22716 finished = true;
22717 }
22718 });
22719 });
22720 });
22721 },
22722
22723 /**
22724 * Subscribe the changes of this query.
22725 *
22726 * LiveQuery is not included in the default bundle: {@link https://url.leanapp.cn/enable-live-query}.
22727 *
22728 * @since 3.0.0
22729 * @return {AV.LiveQuery} An eventemitter which can be used to get LiveQuery updates;
22730 */
22731 subscribe: function subscribe(options) {
22732 return AV.LiveQuery.init(this, options);
22733 }
22734 });
22735
22736 AV.FriendShipQuery = AV.Query._extend({
22737 _newObject: function _newObject() {
22738 var UserClass = AV.Object._getSubclass('_User');
22739
22740 return new UserClass();
22741 },
22742 _processResult: function _processResult(json) {
22743 if (json && json[this._friendshipTag]) {
22744 var user = json[this._friendshipTag];
22745
22746 if (user.__type === 'Pointer' && user.className === '_User') {
22747 delete user.__type;
22748 delete user.className;
22749 }
22750
22751 return user;
22752 } else {
22753 return null;
22754 }
22755 }
22756 });
22757};
22758
22759/***/ }),
22760/* 535 */
22761/***/ (function(module, exports, __webpack_require__) {
22762
22763"use strict";
22764
22765
22766var _interopRequireDefault = __webpack_require__(1);
22767
22768var _promise = _interopRequireDefault(__webpack_require__(12));
22769
22770var _keys = _interopRequireDefault(__webpack_require__(55));
22771
22772var _ = __webpack_require__(2);
22773
22774var EventEmitter = __webpack_require__(224);
22775
22776var _require = __webpack_require__(29),
22777 inherits = _require.inherits;
22778
22779var _require2 = __webpack_require__(26),
22780 request = _require2.request;
22781
22782var subscribe = function subscribe(queryJSON, subscriptionId) {
22783 return request({
22784 method: 'POST',
22785 path: '/LiveQuery/subscribe',
22786 data: {
22787 query: queryJSON,
22788 id: subscriptionId
22789 }
22790 });
22791};
22792
22793module.exports = function (AV) {
22794 var requireRealtime = function requireRealtime() {
22795 if (!AV._config.realtime) {
22796 throw new Error('LiveQuery not supported. Please use the LiveQuery bundle. https://url.leanapp.cn/enable-live-query');
22797 }
22798 };
22799 /**
22800 * @class
22801 * A LiveQuery, created by {@link AV.Query#subscribe} is an EventEmitter notifies changes of the Query.
22802 * @since 3.0.0
22803 */
22804
22805
22806 AV.LiveQuery = inherits(EventEmitter,
22807 /** @lends AV.LiveQuery.prototype */
22808 {
22809 constructor: function constructor(id, client, queryJSON, subscriptionId) {
22810 var _this = this;
22811
22812 EventEmitter.apply(this);
22813 this.id = id;
22814 this._client = client;
22815
22816 this._client.register(this);
22817
22818 this._queryJSON = queryJSON;
22819 this._subscriptionId = subscriptionId;
22820 this._onMessage = this._dispatch.bind(this);
22821
22822 this._onReconnect = function () {
22823 subscribe(_this._queryJSON, _this._subscriptionId).catch(function (error) {
22824 return console.error("LiveQuery resubscribe error: ".concat(error.message));
22825 });
22826 };
22827
22828 client.on('message', this._onMessage);
22829 client.on('reconnect', this._onReconnect);
22830 },
22831 _dispatch: function _dispatch(message) {
22832 var _this2 = this;
22833
22834 message.forEach(function (_ref) {
22835 var op = _ref.op,
22836 object = _ref.object,
22837 queryId = _ref.query_id,
22838 updatedKeys = _ref.updatedKeys;
22839 if (queryId !== _this2.id) return;
22840 var target = AV.parseJSON(_.extend({
22841 __type: object.className === '_File' ? 'File' : 'Object'
22842 }, object));
22843
22844 if (updatedKeys) {
22845 /**
22846 * An existing AV.Object which fulfills the Query you subscribe is updated.
22847 * @event AV.LiveQuery#update
22848 * @param {AV.Object|AV.File} target updated object
22849 * @param {String[]} updatedKeys updated keys
22850 */
22851
22852 /**
22853 * An existing AV.Object which doesn't fulfill the Query is updated and now it fulfills the Query.
22854 * @event AV.LiveQuery#enter
22855 * @param {AV.Object|AV.File} target updated object
22856 * @param {String[]} updatedKeys updated keys
22857 */
22858
22859 /**
22860 * An existing AV.Object which fulfills the Query is updated and now it doesn't fulfill the Query.
22861 * @event AV.LiveQuery#leave
22862 * @param {AV.Object|AV.File} target updated object
22863 * @param {String[]} updatedKeys updated keys
22864 */
22865 _this2.emit(op, target, updatedKeys);
22866 } else {
22867 /**
22868 * A new AV.Object which fulfills the Query you subscribe is created.
22869 * @event AV.LiveQuery#create
22870 * @param {AV.Object|AV.File} target updated object
22871 */
22872
22873 /**
22874 * An existing AV.Object which fulfills the Query you subscribe is deleted.
22875 * @event AV.LiveQuery#delete
22876 * @param {AV.Object|AV.File} target updated object
22877 */
22878 _this2.emit(op, target);
22879 }
22880 });
22881 },
22882
22883 /**
22884 * unsubscribe the query
22885 *
22886 * @return {Promise}
22887 */
22888 unsubscribe: function unsubscribe() {
22889 var client = this._client;
22890 client.off('message', this._onMessage);
22891 client.off('reconnect', this._onReconnect);
22892 client.deregister(this);
22893 return request({
22894 method: 'POST',
22895 path: '/LiveQuery/unsubscribe',
22896 data: {
22897 id: client.id,
22898 query_id: this.id
22899 }
22900 });
22901 }
22902 },
22903 /** @lends AV.LiveQuery */
22904 {
22905 init: function init(query) {
22906 var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
22907 _ref2$subscriptionId = _ref2.subscriptionId,
22908 userDefinedSubscriptionId = _ref2$subscriptionId === void 0 ? AV._getSubscriptionId() : _ref2$subscriptionId;
22909
22910 requireRealtime();
22911 if (!(query instanceof AV.Query)) throw new TypeError('LiveQuery must be inited with a Query');
22912 return _promise.default.resolve(userDefinedSubscriptionId).then(function (subscriptionId) {
22913 return AV._config.realtime.createLiveQueryClient(subscriptionId).then(function (liveQueryClient) {
22914 var _query$_getParams = query._getParams(),
22915 where = _query$_getParams.where,
22916 keys = (0, _keys.default)(_query$_getParams),
22917 returnACL = _query$_getParams.returnACL;
22918
22919 var queryJSON = {
22920 where: where,
22921 keys: keys,
22922 returnACL: returnACL,
22923 className: query.className
22924 };
22925 var promise = subscribe(queryJSON, subscriptionId).then(function (_ref3) {
22926 var queryId = _ref3.query_id;
22927 return new AV.LiveQuery(queryId, liveQueryClient, queryJSON, subscriptionId);
22928 }).finally(function () {
22929 liveQueryClient.deregister(promise);
22930 });
22931 liveQueryClient.register(promise);
22932 return promise;
22933 });
22934 });
22935 },
22936
22937 /**
22938 * Pause the LiveQuery connection. This is useful to deactivate the SDK when the app is swtiched to background.
22939 * @static
22940 * @return void
22941 */
22942 pause: function pause() {
22943 requireRealtime();
22944 return AV._config.realtime.pause();
22945 },
22946
22947 /**
22948 * Resume the LiveQuery connection. All subscriptions will be restored after reconnection.
22949 * @static
22950 * @return void
22951 */
22952 resume: function resume() {
22953 requireRealtime();
22954 return AV._config.realtime.resume();
22955 }
22956 });
22957};
22958
22959/***/ }),
22960/* 536 */
22961/***/ (function(module, exports, __webpack_require__) {
22962
22963"use strict";
22964
22965
22966var _ = __webpack_require__(2);
22967
22968var _require = __webpack_require__(29),
22969 tap = _require.tap;
22970
22971module.exports = function (AV) {
22972 /**
22973 * @class
22974 * @example
22975 * AV.Captcha.request().then(captcha => {
22976 * captcha.bind({
22977 * textInput: 'code', // the id for textInput
22978 * image: 'captcha',
22979 * verifyButton: 'verify',
22980 * }, {
22981 * success: (validateCode) => {}, // next step
22982 * error: (error) => {}, // present error.message to user
22983 * });
22984 * });
22985 */
22986 AV.Captcha = function Captcha(options, authOptions) {
22987 this._options = options;
22988 this._authOptions = authOptions;
22989 /**
22990 * The image url of the captcha
22991 * @type string
22992 */
22993
22994 this.url = undefined;
22995 /**
22996 * The captchaToken of the captcha.
22997 * @type string
22998 */
22999
23000 this.captchaToken = undefined;
23001 /**
23002 * The validateToken of the captcha.
23003 * @type string
23004 */
23005
23006 this.validateToken = undefined;
23007 };
23008 /**
23009 * Refresh the captcha
23010 * @return {Promise.<string>} a new capcha url
23011 */
23012
23013
23014 AV.Captcha.prototype.refresh = function refresh() {
23015 var _this = this;
23016
23017 return AV.Cloud._requestCaptcha(this._options, this._authOptions).then(function (_ref) {
23018 var captchaToken = _ref.captchaToken,
23019 url = _ref.url;
23020
23021 _.extend(_this, {
23022 captchaToken: captchaToken,
23023 url: url
23024 });
23025
23026 return url;
23027 });
23028 };
23029 /**
23030 * Verify the captcha
23031 * @param {String} code The code from user input
23032 * @return {Promise.<string>} validateToken if the code is valid
23033 */
23034
23035
23036 AV.Captcha.prototype.verify = function verify(code) {
23037 var _this2 = this;
23038
23039 return AV.Cloud.verifyCaptcha(code, this.captchaToken).then(tap(function (validateToken) {
23040 return _this2.validateToken = validateToken;
23041 }));
23042 };
23043
23044 if (false) {
23045 /**
23046 * Bind the captcha to HTMLElements. <b>ONLY AVAILABLE in browsers</b>.
23047 * @param [elements]
23048 * @param {String|HTMLInputElement} [elements.textInput] An input element typed text, or the id for the element.
23049 * @param {String|HTMLImageElement} [elements.image] An image element, or the id for the element.
23050 * @param {String|HTMLElement} [elements.verifyButton] A button element, or the id for the element.
23051 * @param [callbacks]
23052 * @param {Function} [callbacks.success] Success callback will be called if the code is verified. The param `validateCode` can be used for further SMS request.
23053 * @param {Function} [callbacks.error] Error callback will be called if something goes wrong, detailed in param `error.message`.
23054 */
23055 AV.Captcha.prototype.bind = function bind(_ref2, _ref3) {
23056 var _this3 = this;
23057
23058 var textInput = _ref2.textInput,
23059 image = _ref2.image,
23060 verifyButton = _ref2.verifyButton;
23061 var success = _ref3.success,
23062 error = _ref3.error;
23063
23064 if (typeof textInput === 'string') {
23065 textInput = document.getElementById(textInput);
23066 if (!textInput) throw new Error("textInput with id ".concat(textInput, " not found"));
23067 }
23068
23069 if (typeof image === 'string') {
23070 image = document.getElementById(image);
23071 if (!image) throw new Error("image with id ".concat(image, " not found"));
23072 }
23073
23074 if (typeof verifyButton === 'string') {
23075 verifyButton = document.getElementById(verifyButton);
23076 if (!verifyButton) throw new Error("verifyButton with id ".concat(verifyButton, " not found"));
23077 }
23078
23079 this.__refresh = function () {
23080 return _this3.refresh().then(function (url) {
23081 image.src = url;
23082
23083 if (textInput) {
23084 textInput.value = '';
23085 textInput.focus();
23086 }
23087 }).catch(function (err) {
23088 return console.warn("refresh captcha fail: ".concat(err.message));
23089 });
23090 };
23091
23092 if (image) {
23093 this.__image = image;
23094 image.src = this.url;
23095 image.addEventListener('click', this.__refresh);
23096 }
23097
23098 this.__verify = function () {
23099 var code = textInput.value;
23100
23101 _this3.verify(code).catch(function (err) {
23102 _this3.__refresh();
23103
23104 throw err;
23105 }).then(success, error).catch(function (err) {
23106 return console.warn("verify captcha fail: ".concat(err.message));
23107 });
23108 };
23109
23110 if (textInput && verifyButton) {
23111 this.__verifyButton = verifyButton;
23112 verifyButton.addEventListener('click', this.__verify);
23113 }
23114 };
23115 /**
23116 * unbind the captcha from HTMLElements. <b>ONLY AVAILABLE in browsers</b>.
23117 */
23118
23119
23120 AV.Captcha.prototype.unbind = function unbind() {
23121 if (this.__image) this.__image.removeEventListener('click', this.__refresh);
23122 if (this.__verifyButton) this.__verifyButton.removeEventListener('click', this.__verify);
23123 };
23124 }
23125 /**
23126 * Request a captcha
23127 * @param [options]
23128 * @param {Number} [options.width] width(px) of the captcha, ranged 60-200
23129 * @param {Number} [options.height] height(px) of the captcha, ranged 30-100
23130 * @param {Number} [options.size=4] length of the captcha, ranged 3-6. MasterKey required.
23131 * @param {Number} [options.ttl=60] time to live(s), ranged 10-180. MasterKey required.
23132 * @return {Promise.<AV.Captcha>}
23133 */
23134
23135
23136 AV.Captcha.request = function (options, authOptions) {
23137 var captcha = new AV.Captcha(options, authOptions);
23138 return captcha.refresh().then(function () {
23139 return captcha;
23140 });
23141 };
23142};
23143
23144/***/ }),
23145/* 537 */
23146/***/ (function(module, exports, __webpack_require__) {
23147
23148"use strict";
23149
23150
23151var _interopRequireDefault = __webpack_require__(1);
23152
23153var _promise = _interopRequireDefault(__webpack_require__(12));
23154
23155var _ = __webpack_require__(2);
23156
23157var _require = __webpack_require__(26),
23158 _request = _require._request,
23159 request = _require.request;
23160
23161module.exports = function (AV) {
23162 /**
23163 * Contains functions for calling and declaring
23164 * <p><strong><em>
23165 * Some functions are only available from Cloud Code.
23166 * </em></strong></p>
23167 *
23168 * @namespace
23169 * @borrows AV.Captcha.request as requestCaptcha
23170 */
23171 AV.Cloud = AV.Cloud || {};
23172
23173 _.extend(AV.Cloud,
23174 /** @lends AV.Cloud */
23175 {
23176 /**
23177 * Makes a call to a cloud function.
23178 * @param {String} name The function name.
23179 * @param {Object} [data] The parameters to send to the cloud function.
23180 * @param {AuthOptions} [options]
23181 * @return {Promise} A promise that will be resolved with the result
23182 * of the function.
23183 */
23184 run: function run(name, data, options) {
23185 return request({
23186 service: 'engine',
23187 method: 'POST',
23188 path: "/functions/".concat(name),
23189 data: AV._encode(data, null, true),
23190 authOptions: options
23191 }).then(function (resp) {
23192 return AV._decode(resp).result;
23193 });
23194 },
23195
23196 /**
23197 * Makes a call to a cloud function, you can send {AV.Object} as param or a field of param; the response
23198 * from server will also be parsed as an {AV.Object}, array of {AV.Object}, or object includes {AV.Object}
23199 * @param {String} name The function name.
23200 * @param {Object} [data] The parameters to send to the cloud function.
23201 * @param {AuthOptions} [options]
23202 * @return {Promise} A promise that will be resolved with the result of the function.
23203 */
23204 rpc: function rpc(name, data, options) {
23205 if (_.isArray(data)) {
23206 return _promise.default.reject(new Error("Can't pass Array as the param of rpc function in JavaScript SDK."));
23207 }
23208
23209 return request({
23210 service: 'engine',
23211 method: 'POST',
23212 path: "/call/".concat(name),
23213 data: AV._encodeObjectOrArray(data),
23214 authOptions: options
23215 }).then(function (resp) {
23216 return AV._decode(resp).result;
23217 });
23218 },
23219
23220 /**
23221 * Make a call to request server date time.
23222 * @return {Promise.<Date>} A promise that will be resolved with the result
23223 * of the function.
23224 * @since 0.5.9
23225 */
23226 getServerDate: function getServerDate() {
23227 return _request('date', null, null, 'GET').then(function (resp) {
23228 return AV._decode(resp);
23229 });
23230 },
23231
23232 /**
23233 * Makes a call to request an sms code for operation verification.
23234 * @param {String|Object} data The mobile phone number string or a JSON
23235 * object that contains mobilePhoneNumber,template,sign,op,ttl,name etc.
23236 * @param {String} data.mobilePhoneNumber
23237 * @param {String} [data.template] sms template name
23238 * @param {String} [data.sign] sms signature name
23239 * @param {String} [data.smsType] sending code by `sms` (default) or `voice` call
23240 * @param {SMSAuthOptions} [options]
23241 * @return {Promise} A promise that will be resolved if the request succeed
23242 */
23243 requestSmsCode: function requestSmsCode(data) {
23244 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
23245
23246 if (_.isString(data)) {
23247 data = {
23248 mobilePhoneNumber: data
23249 };
23250 }
23251
23252 if (!data.mobilePhoneNumber) {
23253 throw new Error('Missing mobilePhoneNumber.');
23254 }
23255
23256 if (options.validateToken) {
23257 data = _.extend({}, data, {
23258 validate_token: options.validateToken
23259 });
23260 }
23261
23262 return _request('requestSmsCode', null, null, 'POST', data, options);
23263 },
23264
23265 /**
23266 * Makes a call to verify sms code that sent by AV.Cloud.requestSmsCode
23267 * @param {String} code The sms code sent by AV.Cloud.requestSmsCode
23268 * @param {phone} phone The mobile phoner number.
23269 * @return {Promise} A promise that will be resolved with the result
23270 * of the function.
23271 */
23272 verifySmsCode: function verifySmsCode(code, phone) {
23273 if (!code) throw new Error('Missing sms code.');
23274 var params = {};
23275
23276 if (_.isString(phone)) {
23277 params['mobilePhoneNumber'] = phone;
23278 }
23279
23280 return _request('verifySmsCode', code, null, 'POST', params);
23281 },
23282 _requestCaptcha: function _requestCaptcha(options, authOptions) {
23283 return _request('requestCaptcha', null, null, 'GET', options, authOptions).then(function (_ref) {
23284 var url = _ref.captcha_url,
23285 captchaToken = _ref.captcha_token;
23286 return {
23287 captchaToken: captchaToken,
23288 url: url
23289 };
23290 });
23291 },
23292
23293 /**
23294 * Request a captcha.
23295 */
23296 requestCaptcha: AV.Captcha.request,
23297
23298 /**
23299 * Verify captcha code. This is the low-level API for captcha.
23300 * Checkout {@link AV.Captcha} for high abstract APIs.
23301 * @param {String} code the code from user input
23302 * @param {String} captchaToken captchaToken returned by {@link AV.Cloud.requestCaptcha}
23303 * @return {Promise.<String>} validateToken if the code is valid
23304 */
23305 verifyCaptcha: function verifyCaptcha(code, captchaToken) {
23306 return _request('verifyCaptcha', null, null, 'POST', {
23307 captcha_code: code,
23308 captcha_token: captchaToken
23309 }).then(function (_ref2) {
23310 var validateToken = _ref2.validate_token;
23311 return validateToken;
23312 });
23313 }
23314 });
23315};
23316
23317/***/ }),
23318/* 538 */
23319/***/ (function(module, exports, __webpack_require__) {
23320
23321"use strict";
23322
23323
23324var request = __webpack_require__(26).request;
23325
23326module.exports = function (AV) {
23327 AV.Installation = AV.Object.extend('_Installation');
23328 /**
23329 * @namespace
23330 */
23331
23332 AV.Push = AV.Push || {};
23333 /**
23334 * Sends a push notification.
23335 * @param {Object} data The data of the push notification.
23336 * @param {String[]} [data.channels] An Array of channels to push to.
23337 * @param {Date} [data.push_time] A Date object for when to send the push.
23338 * @param {Date} [data.expiration_time] A Date object for when to expire
23339 * the push.
23340 * @param {Number} [data.expiration_interval] The seconds from now to expire the push.
23341 * @param {Number} [data.flow_control] The clients to notify per second
23342 * @param {AV.Query} [data.where] An AV.Query over AV.Installation that is used to match
23343 * a set of installations to push to.
23344 * @param {String} [data.cql] A CQL statement over AV.Installation that is used to match
23345 * a set of installations to push to.
23346 * @param {Object} data.data The data to send as part of the push.
23347 More details: https://url.leanapp.cn/pushData
23348 * @param {AuthOptions} [options]
23349 * @return {Promise}
23350 */
23351
23352 AV.Push.send = function (data, options) {
23353 if (data.where) {
23354 data.where = data.where._getParams().where;
23355 }
23356
23357 if (data.where && data.cql) {
23358 throw new Error("Both where and cql can't be set");
23359 }
23360
23361 if (data.push_time) {
23362 data.push_time = data.push_time.toJSON();
23363 }
23364
23365 if (data.expiration_time) {
23366 data.expiration_time = data.expiration_time.toJSON();
23367 }
23368
23369 if (data.expiration_time && data.expiration_interval) {
23370 throw new Error("Both expiration_time and expiration_interval can't be set");
23371 }
23372
23373 return request({
23374 service: 'push',
23375 method: 'POST',
23376 path: '/push',
23377 data: data,
23378 authOptions: options
23379 });
23380 };
23381};
23382
23383/***/ }),
23384/* 539 */
23385/***/ (function(module, exports, __webpack_require__) {
23386
23387"use strict";
23388
23389
23390var _interopRequireDefault = __webpack_require__(1);
23391
23392var _promise = _interopRequireDefault(__webpack_require__(12));
23393
23394var _typeof2 = _interopRequireDefault(__webpack_require__(109));
23395
23396var _ = __webpack_require__(2);
23397
23398var AVRequest = __webpack_require__(26)._request;
23399
23400var _require = __webpack_require__(29),
23401 getSessionToken = _require.getSessionToken;
23402
23403module.exports = function (AV) {
23404 var getUser = function getUser() {
23405 var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
23406 var sessionToken = getSessionToken(options);
23407
23408 if (sessionToken) {
23409 return AV.User._fetchUserBySessionToken(getSessionToken(options));
23410 }
23411
23412 return AV.User.currentAsync();
23413 };
23414
23415 var getUserPointer = function getUserPointer(options) {
23416 return getUser(options).then(function (currUser) {
23417 return AV.Object.createWithoutData('_User', currUser.id)._toPointer();
23418 });
23419 };
23420 /**
23421 * Contains functions to deal with Status in LeanCloud.
23422 * @class
23423 */
23424
23425
23426 AV.Status = function (imageUrl, message) {
23427 this.data = {};
23428 this.inboxType = 'default';
23429 this.query = null;
23430
23431 if (imageUrl && (0, _typeof2.default)(imageUrl) === 'object') {
23432 this.data = imageUrl;
23433 } else {
23434 if (imageUrl) {
23435 this.data.image = imageUrl;
23436 }
23437
23438 if (message) {
23439 this.data.message = message;
23440 }
23441 }
23442
23443 return this;
23444 };
23445
23446 _.extend(AV.Status.prototype,
23447 /** @lends AV.Status.prototype */
23448 {
23449 /**
23450 * Gets the value of an attribute in status data.
23451 * @param {String} attr The string name of an attribute.
23452 */
23453 get: function get(attr) {
23454 return this.data[attr];
23455 },
23456
23457 /**
23458 * Sets a hash of model attributes on the status data.
23459 * @param {String} key The key to set.
23460 * @param {any} value The value to give it.
23461 */
23462 set: function set(key, value) {
23463 this.data[key] = value;
23464 return this;
23465 },
23466
23467 /**
23468 * Destroy this status,then it will not be avaiable in other user's inboxes.
23469 * @param {AuthOptions} options
23470 * @return {Promise} A promise that is fulfilled when the destroy
23471 * completes.
23472 */
23473 destroy: function destroy(options) {
23474 if (!this.id) return _promise.default.reject(new Error('The status id is not exists.'));
23475 var request = AVRequest('statuses', null, this.id, 'DELETE', options);
23476 return request;
23477 },
23478
23479 /**
23480 * Cast the AV.Status object to an AV.Object pointer.
23481 * @return {AV.Object} A AV.Object pointer.
23482 */
23483 toObject: function toObject() {
23484 if (!this.id) return null;
23485 return AV.Object.createWithoutData('_Status', this.id);
23486 },
23487 _getDataJSON: function _getDataJSON() {
23488 var json = _.clone(this.data);
23489
23490 return AV._encode(json);
23491 },
23492
23493 /**
23494 * Send a status by a AV.Query object.
23495 * @since 0.3.0
23496 * @param {AuthOptions} options
23497 * @return {Promise} A promise that is fulfilled when the send
23498 * completes.
23499 * @example
23500 * // send a status to male users
23501 * var status = new AVStatus('image url', 'a message');
23502 * status.query = new AV.Query('_User');
23503 * status.query.equalTo('gender', 'male');
23504 * status.send().then(function(){
23505 * //send status successfully.
23506 * }, function(err){
23507 * //an error threw.
23508 * console.dir(err);
23509 * });
23510 */
23511 send: function send() {
23512 var _this = this;
23513
23514 var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
23515
23516 if (!getSessionToken(options) && !AV.User.current()) {
23517 throw new Error('Please signin an user.');
23518 }
23519
23520 if (!this.query) {
23521 return AV.Status.sendStatusToFollowers(this, options);
23522 }
23523
23524 return getUserPointer(options).then(function (currUser) {
23525 var query = _this.query._getParams();
23526
23527 query.className = _this.query.className;
23528 var data = {};
23529 data.query = query;
23530 _this.data = _this.data || {};
23531 _this.data.source = _this.data.source || currUser;
23532 data.data = _this._getDataJSON();
23533 data.inboxType = _this.inboxType || 'default';
23534 return AVRequest('statuses', null, null, 'POST', data, options);
23535 }).then(function (response) {
23536 _this.id = response.objectId;
23537 _this.createdAt = AV._parseDate(response.createdAt);
23538 return _this;
23539 });
23540 },
23541 _finishFetch: function _finishFetch(serverData) {
23542 this.id = serverData.objectId;
23543 this.createdAt = AV._parseDate(serverData.createdAt);
23544 this.updatedAt = AV._parseDate(serverData.updatedAt);
23545 this.messageId = serverData.messageId;
23546 delete serverData.messageId;
23547 delete serverData.objectId;
23548 delete serverData.createdAt;
23549 delete serverData.updatedAt;
23550 this.data = AV._decode(serverData);
23551 }
23552 });
23553 /**
23554 * Send a status to current signined user's followers.
23555 * @since 0.3.0
23556 * @param {AV.Status} status A status object to be send to followers.
23557 * @param {AuthOptions} options
23558 * @return {Promise} A promise that is fulfilled when the send
23559 * completes.
23560 * @example
23561 * var status = new AVStatus('image url', 'a message');
23562 * AV.Status.sendStatusToFollowers(status).then(function(){
23563 * //send status successfully.
23564 * }, function(err){
23565 * //an error threw.
23566 * console.dir(err);
23567 * });
23568 */
23569
23570
23571 AV.Status.sendStatusToFollowers = function (status) {
23572 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
23573
23574 if (!getSessionToken(options) && !AV.User.current()) {
23575 throw new Error('Please signin an user.');
23576 }
23577
23578 return getUserPointer(options).then(function (currUser) {
23579 var query = {};
23580 query.className = '_Follower';
23581 query.keys = 'follower';
23582 query.where = {
23583 user: currUser
23584 };
23585 var data = {};
23586 data.query = query;
23587 status.data = status.data || {};
23588 status.data.source = status.data.source || currUser;
23589 data.data = status._getDataJSON();
23590 data.inboxType = status.inboxType || 'default';
23591 var request = AVRequest('statuses', null, null, 'POST', data, options);
23592 return request.then(function (response) {
23593 status.id = response.objectId;
23594 status.createdAt = AV._parseDate(response.createdAt);
23595 return status;
23596 });
23597 });
23598 };
23599 /**
23600 * <p>Send a status from current signined user to other user's private status inbox.</p>
23601 * @since 0.3.0
23602 * @param {AV.Status} status A status object to be send to followers.
23603 * @param {String} target The target user or user's objectId.
23604 * @param {AuthOptions} options
23605 * @return {Promise} A promise that is fulfilled when the send
23606 * completes.
23607 * @example
23608 * // send a private status to user '52e84e47e4b0f8de283b079b'
23609 * var status = new AVStatus('image url', 'a message');
23610 * AV.Status.sendPrivateStatus(status, '52e84e47e4b0f8de283b079b').then(function(){
23611 * //send status successfully.
23612 * }, function(err){
23613 * //an error threw.
23614 * console.dir(err);
23615 * });
23616 */
23617
23618
23619 AV.Status.sendPrivateStatus = function (status, target) {
23620 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
23621
23622 if (!getSessionToken(options) && !AV.User.current()) {
23623 throw new Error('Please signin an user.');
23624 }
23625
23626 if (!target) {
23627 throw new Error('Invalid target user.');
23628 }
23629
23630 var userObjectId = _.isString(target) ? target : target.id;
23631
23632 if (!userObjectId) {
23633 throw new Error('Invalid target user.');
23634 }
23635
23636 return getUserPointer(options).then(function (currUser) {
23637 var query = {};
23638 query.className = '_User';
23639 query.where = {
23640 objectId: userObjectId
23641 };
23642 var data = {};
23643 data.query = query;
23644 status.data = status.data || {};
23645 status.data.source = status.data.source || currUser;
23646 data.data = status._getDataJSON();
23647 data.inboxType = 'private';
23648 status.inboxType = 'private';
23649 var request = AVRequest('statuses', null, null, 'POST', data, options);
23650 return request.then(function (response) {
23651 status.id = response.objectId;
23652 status.createdAt = AV._parseDate(response.createdAt);
23653 return status;
23654 });
23655 });
23656 };
23657 /**
23658 * Count unread statuses in someone's inbox.
23659 * @since 0.3.0
23660 * @param {AV.User} owner The status owner.
23661 * @param {String} inboxType The inbox type, 'default' by default.
23662 * @param {AuthOptions} options
23663 * @return {Promise} A promise that is fulfilled when the count
23664 * completes.
23665 * @example
23666 * AV.Status.countUnreadStatuses(AV.User.current()).then(function(response){
23667 * console.log(response.unread); //unread statuses number.
23668 * console.log(response.total); //total statuses number.
23669 * });
23670 */
23671
23672
23673 AV.Status.countUnreadStatuses = function (owner) {
23674 var inboxType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
23675 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
23676 if (!_.isString(inboxType)) options = inboxType;
23677
23678 if (!getSessionToken(options) && owner == null && !AV.User.current()) {
23679 throw new Error('Please signin an user or pass the owner objectId.');
23680 }
23681
23682 return _promise.default.resolve(owner || getUser(options)).then(function (owner) {
23683 var params = {};
23684 params.inboxType = AV._encode(inboxType);
23685 params.owner = AV._encode(owner);
23686 return AVRequest('subscribe/statuses/count', null, null, 'GET', params, options);
23687 });
23688 };
23689 /**
23690 * reset unread statuses count in someone's inbox.
23691 * @since 2.1.0
23692 * @param {AV.User} owner The status owner.
23693 * @param {String} inboxType The inbox type, 'default' by default.
23694 * @param {AuthOptions} options
23695 * @return {Promise} A promise that is fulfilled when the reset
23696 * completes.
23697 * @example
23698 * AV.Status.resetUnreadCount(AV.User.current()).then(function(response){
23699 * console.log(response.unread); //unread statuses number.
23700 * console.log(response.total); //total statuses number.
23701 * });
23702 */
23703
23704
23705 AV.Status.resetUnreadCount = function (owner) {
23706 var inboxType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
23707 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
23708 if (!_.isString(inboxType)) options = inboxType;
23709
23710 if (!getSessionToken(options) && owner == null && !AV.User.current()) {
23711 throw new Error('Please signin an user or pass the owner objectId.');
23712 }
23713
23714 return _promise.default.resolve(owner || getUser(options)).then(function (owner) {
23715 var params = {};
23716 params.inboxType = AV._encode(inboxType);
23717 params.owner = AV._encode(owner);
23718 return AVRequest('subscribe/statuses/resetUnreadCount', null, null, 'POST', params, options);
23719 });
23720 };
23721 /**
23722 * Create a status query to find someone's published statuses.
23723 * @since 0.3.0
23724 * @param {AV.User} source The status source, typically the publisher.
23725 * @return {AV.Query} The query object for status.
23726 * @example
23727 * //Find current user's published statuses.
23728 * var query = AV.Status.statusQuery(AV.User.current());
23729 * query.find().then(function(statuses){
23730 * //process statuses
23731 * });
23732 */
23733
23734
23735 AV.Status.statusQuery = function (source) {
23736 var query = new AV.Query('_Status');
23737
23738 if (source) {
23739 query.equalTo('source', source);
23740 }
23741
23742 return query;
23743 };
23744 /**
23745 * <p>AV.InboxQuery defines a query that is used to fetch somebody's inbox statuses.</p>
23746 * @class
23747 */
23748
23749
23750 AV.InboxQuery = AV.Query._extend(
23751 /** @lends AV.InboxQuery.prototype */
23752 {
23753 _objectClass: AV.Status,
23754 _sinceId: 0,
23755 _maxId: 0,
23756 _inboxType: 'default',
23757 _owner: null,
23758 _newObject: function _newObject() {
23759 return new AV.Status();
23760 },
23761 _createRequest: function _createRequest(params, options) {
23762 return AV.InboxQuery.__super__._createRequest.call(this, params, options, '/subscribe/statuses');
23763 },
23764
23765 /**
23766 * Sets the messageId of results to skip before returning any results.
23767 * This is useful for pagination.
23768 * Default is zero.
23769 * @param {Number} n the mesage id.
23770 * @return {AV.InboxQuery} Returns the query, so you can chain this call.
23771 */
23772 sinceId: function sinceId(id) {
23773 this._sinceId = id;
23774 return this;
23775 },
23776
23777 /**
23778 * Sets the maximal messageId of results。
23779 * This is useful for pagination.
23780 * Default is zero that is no limition.
23781 * @param {Number} n the mesage id.
23782 * @return {AV.InboxQuery} Returns the query, so you can chain this call.
23783 */
23784 maxId: function maxId(id) {
23785 this._maxId = id;
23786 return this;
23787 },
23788
23789 /**
23790 * Sets the owner of the querying inbox.
23791 * @param {AV.User} owner The inbox owner.
23792 * @return {AV.InboxQuery} Returns the query, so you can chain this call.
23793 */
23794 owner: function owner(_owner) {
23795 this._owner = _owner;
23796 return this;
23797 },
23798
23799 /**
23800 * Sets the querying inbox type.default is 'default'.
23801 * @param {String} type The inbox type.
23802 * @return {AV.InboxQuery} Returns the query, so you can chain this call.
23803 */
23804 inboxType: function inboxType(type) {
23805 this._inboxType = type;
23806 return this;
23807 },
23808 _getParams: function _getParams() {
23809 var params = AV.InboxQuery.__super__._getParams.call(this);
23810
23811 params.owner = AV._encode(this._owner);
23812 params.inboxType = AV._encode(this._inboxType);
23813 params.sinceId = AV._encode(this._sinceId);
23814 params.maxId = AV._encode(this._maxId);
23815 return params;
23816 }
23817 });
23818 /**
23819 * Create a inbox status query to find someone's inbox statuses.
23820 * @since 0.3.0
23821 * @param {AV.User} owner The inbox's owner
23822 * @param {String} inboxType The inbox type,'default' by default.
23823 * @return {AV.InboxQuery} The inbox query object.
23824 * @see AV.InboxQuery
23825 * @example
23826 * //Find current user's default inbox statuses.
23827 * var query = AV.Status.inboxQuery(AV.User.current());
23828 * //find the statuses after the last message id
23829 * query.sinceId(lastMessageId);
23830 * query.find().then(function(statuses){
23831 * //process statuses
23832 * });
23833 */
23834
23835 AV.Status.inboxQuery = function (owner, inboxType) {
23836 var query = new AV.InboxQuery(AV.Status);
23837
23838 if (owner) {
23839 query._owner = owner;
23840 }
23841
23842 if (inboxType) {
23843 query._inboxType = inboxType;
23844 }
23845
23846 return query;
23847 };
23848};
23849
23850/***/ }),
23851/* 540 */
23852/***/ (function(module, exports, __webpack_require__) {
23853
23854"use strict";
23855
23856
23857var _interopRequireDefault = __webpack_require__(1);
23858
23859var _stringify = _interopRequireDefault(__webpack_require__(36));
23860
23861var _map = _interopRequireDefault(__webpack_require__(42));
23862
23863var _ = __webpack_require__(2);
23864
23865var AVRequest = __webpack_require__(26)._request;
23866
23867module.exports = function (AV) {
23868 /**
23869 * A builder to generate sort string for app searching.For example:
23870 * @class
23871 * @since 0.5.1
23872 * @example
23873 * var builder = new AV.SearchSortBuilder();
23874 * builder.ascending('key1').descending('key2','max');
23875 * var query = new AV.SearchQuery('Player');
23876 * query.sortBy(builder);
23877 * query.find().then();
23878 */
23879 AV.SearchSortBuilder = function () {
23880 this._sortFields = [];
23881 };
23882
23883 _.extend(AV.SearchSortBuilder.prototype,
23884 /** @lends AV.SearchSortBuilder.prototype */
23885 {
23886 _addField: function _addField(key, order, mode, missing) {
23887 var field = {};
23888 field[key] = {
23889 order: order || 'asc',
23890 mode: mode || 'avg',
23891 missing: '_' + (missing || 'last')
23892 };
23893
23894 this._sortFields.push(field);
23895
23896 return this;
23897 },
23898
23899 /**
23900 * Sorts the results in ascending order by the given key and options.
23901 *
23902 * @param {String} key The key to order by.
23903 * @param {String} mode The sort mode, default is 'avg', you can choose
23904 * 'max' or 'min' too.
23905 * @param {String} missing The missing key behaviour, default is 'last',
23906 * you can choose 'first' too.
23907 * @return {AV.SearchSortBuilder} Returns the builder, so you can chain this call.
23908 */
23909 ascending: function ascending(key, mode, missing) {
23910 return this._addField(key, 'asc', mode, missing);
23911 },
23912
23913 /**
23914 * Sorts the results in descending order by the given key and options.
23915 *
23916 * @param {String} key The key to order by.
23917 * @param {String} mode The sort mode, default is 'avg', you can choose
23918 * 'max' or 'min' too.
23919 * @param {String} missing The missing key behaviour, default is 'last',
23920 * you can choose 'first' too.
23921 * @return {AV.SearchSortBuilder} Returns the builder, so you can chain this call.
23922 */
23923 descending: function descending(key, mode, missing) {
23924 return this._addField(key, 'desc', mode, missing);
23925 },
23926
23927 /**
23928 * Add a proximity based constraint for finding objects with key point
23929 * values near the point given.
23930 * @param {String} key The key that the AV.GeoPoint is stored in.
23931 * @param {AV.GeoPoint} point The reference AV.GeoPoint that is used.
23932 * @param {Object} options The other options such as mode,order, unit etc.
23933 * @return {AV.SearchSortBuilder} Returns the builder, so you can chain this call.
23934 */
23935 whereNear: function whereNear(key, point, options) {
23936 options = options || {};
23937 var field = {};
23938 var geo = {
23939 lat: point.latitude,
23940 lon: point.longitude
23941 };
23942 var m = {
23943 order: options.order || 'asc',
23944 mode: options.mode || 'avg',
23945 unit: options.unit || 'km'
23946 };
23947 m[key] = geo;
23948 field['_geo_distance'] = m;
23949
23950 this._sortFields.push(field);
23951
23952 return this;
23953 },
23954
23955 /**
23956 * Build a sort string by configuration.
23957 * @return {String} the sort string.
23958 */
23959 build: function build() {
23960 return (0, _stringify.default)(AV._encode(this._sortFields));
23961 }
23962 });
23963 /**
23964 * App searching query.Use just like AV.Query:
23965 *
23966 * Visit <a href='https://leancloud.cn/docs/app_search_guide.html'>App Searching Guide</a>
23967 * for more details.
23968 * @class
23969 * @since 0.5.1
23970 * @example
23971 * var query = new AV.SearchQuery('Player');
23972 * query.queryString('*');
23973 * query.find().then(function(results) {
23974 * console.log('Found %d objects', query.hits());
23975 * //Process results
23976 * });
23977 */
23978
23979
23980 AV.SearchQuery = AV.Query._extend(
23981 /** @lends AV.SearchQuery.prototype */
23982 {
23983 _sid: null,
23984 _hits: 0,
23985 _queryString: null,
23986 _highlights: null,
23987 _sortBuilder: null,
23988 _clazz: null,
23989 constructor: function constructor(className) {
23990 if (className) {
23991 this._clazz = className;
23992 } else {
23993 className = '__INVALID_CLASS';
23994 }
23995
23996 AV.Query.call(this, className);
23997 },
23998 _createRequest: function _createRequest(params, options) {
23999 return AVRequest('search/select', null, null, 'GET', params || this._getParams(), options);
24000 },
24001
24002 /**
24003 * Sets the sid of app searching query.Default is null.
24004 * @param {String} sid Scroll id for searching.
24005 * @return {AV.SearchQuery} Returns the query, so you can chain this call.
24006 */
24007 sid: function sid(_sid) {
24008 this._sid = _sid;
24009 return this;
24010 },
24011
24012 /**
24013 * Sets the query string of app searching.
24014 * @param {String} q The query string.
24015 * @return {AV.SearchQuery} Returns the query, so you can chain this call.
24016 */
24017 queryString: function queryString(q) {
24018 this._queryString = q;
24019 return this;
24020 },
24021
24022 /**
24023 * Sets the highlight fields. Such as
24024 * <pre><code>
24025 * query.highlights('title');
24026 * //or pass an array.
24027 * query.highlights(['title', 'content'])
24028 * </code></pre>
24029 * @param {String|String[]} highlights a list of fields.
24030 * @return {AV.SearchQuery} Returns the query, so you can chain this call.
24031 */
24032 highlights: function highlights(_highlights) {
24033 var objects;
24034
24035 if (_highlights && _.isString(_highlights)) {
24036 objects = _.toArray(arguments);
24037 } else {
24038 objects = _highlights;
24039 }
24040
24041 this._highlights = objects;
24042 return this;
24043 },
24044
24045 /**
24046 * Sets the sort builder for this query.
24047 * @see AV.SearchSortBuilder
24048 * @param { AV.SearchSortBuilder} builder The sort builder.
24049 * @return {AV.SearchQuery} Returns the query, so you can chain this call.
24050 *
24051 */
24052 sortBy: function sortBy(builder) {
24053 this._sortBuilder = builder;
24054 return this;
24055 },
24056
24057 /**
24058 * Returns the number of objects that match this query.
24059 * @return {Number}
24060 */
24061 hits: function hits() {
24062 if (!this._hits) {
24063 this._hits = 0;
24064 }
24065
24066 return this._hits;
24067 },
24068 _processResult: function _processResult(json) {
24069 delete json['className'];
24070 delete json['_app_url'];
24071 delete json['_deeplink'];
24072 return json;
24073 },
24074
24075 /**
24076 * Returns true when there are more documents can be retrieved by this
24077 * query instance, you can call find function to get more results.
24078 * @see AV.SearchQuery#find
24079 * @return {Boolean}
24080 */
24081 hasMore: function hasMore() {
24082 return !this._hitEnd;
24083 },
24084
24085 /**
24086 * Reset current query instance state(such as sid, hits etc) except params
24087 * for a new searching. After resetting, hasMore() will return true.
24088 */
24089 reset: function reset() {
24090 this._hitEnd = false;
24091 this._sid = null;
24092 this._hits = 0;
24093 },
24094
24095 /**
24096 * Retrieves a list of AVObjects that satisfy this query.
24097 * Either options.success or options.error is called when the find
24098 * completes.
24099 *
24100 * @see AV.Query#find
24101 * @param {AuthOptions} options
24102 * @return {Promise} A promise that is resolved with the results when
24103 * the query completes.
24104 */
24105 find: function find(options) {
24106 var self = this;
24107
24108 var request = this._createRequest(undefined, options);
24109
24110 return request.then(function (response) {
24111 //update sid for next querying.
24112 if (response.sid) {
24113 self._oldSid = self._sid;
24114 self._sid = response.sid;
24115 } else {
24116 self._sid = null;
24117 self._hitEnd = true;
24118 }
24119
24120 self._hits = response.hits || 0;
24121 return (0, _map.default)(_).call(_, response.results, function (json) {
24122 if (json.className) {
24123 response.className = json.className;
24124 }
24125
24126 var obj = self._newObject(response);
24127
24128 obj.appURL = json['_app_url'];
24129
24130 obj._finishFetch(self._processResult(json), true);
24131
24132 return obj;
24133 });
24134 });
24135 },
24136 _getParams: function _getParams() {
24137 var params = AV.SearchQuery.__super__._getParams.call(this);
24138
24139 delete params.where;
24140
24141 if (this._clazz) {
24142 params.clazz = this.className;
24143 }
24144
24145 if (this._sid) {
24146 params.sid = this._sid;
24147 }
24148
24149 if (!this._queryString) {
24150 throw new Error('Please set query string.');
24151 } else {
24152 params.q = this._queryString;
24153 }
24154
24155 if (this._highlights) {
24156 params.highlights = this._highlights.join(',');
24157 }
24158
24159 if (this._sortBuilder && params.order) {
24160 throw new Error('sort and order can not be set at same time.');
24161 }
24162
24163 if (this._sortBuilder) {
24164 params.sort = this._sortBuilder.build();
24165 }
24166
24167 return params;
24168 }
24169 });
24170};
24171/**
24172 * Sorts the results in ascending order by the given key.
24173 *
24174 * @method AV.SearchQuery#ascending
24175 * @param {String} key The key to order by.
24176 * @return {AV.SearchQuery} Returns the query, so you can chain this call.
24177 */
24178
24179/**
24180 * Also sorts the results in ascending order by the given key. The previous sort keys have
24181 * precedence over this key.
24182 *
24183 * @method AV.SearchQuery#addAscending
24184 * @param {String} key The key to order by
24185 * @return {AV.SearchQuery} Returns the query so you can chain this call.
24186 */
24187
24188/**
24189 * Sorts the results in descending order by the given key.
24190 *
24191 * @method AV.SearchQuery#descending
24192 * @param {String} key The key to order by.
24193 * @return {AV.SearchQuery} Returns the query, so you can chain this call.
24194 */
24195
24196/**
24197 * Also sorts the results in descending order by the given key. The previous sort keys have
24198 * precedence over this key.
24199 *
24200 * @method AV.SearchQuery#addDescending
24201 * @param {String} key The key to order by
24202 * @return {AV.SearchQuery} Returns the query so you can chain this call.
24203 */
24204
24205/**
24206 * Include nested AV.Objects for the provided key. You can use dot
24207 * notation to specify which fields in the included object are also fetch.
24208 * @method AV.SearchQuery#include
24209 * @param {String[]} keys The name of the key to include.
24210 * @return {AV.SearchQuery} Returns the query, so you can chain this call.
24211 */
24212
24213/**
24214 * Sets the number of results to skip before returning any results.
24215 * This is useful for pagination.
24216 * Default is to skip zero results.
24217 * @method AV.SearchQuery#skip
24218 * @param {Number} n the number of results to skip.
24219 * @return {AV.SearchQuery} Returns the query, so you can chain this call.
24220 */
24221
24222/**
24223 * Sets the limit of the number of results to return. The default limit is
24224 * 100, with a maximum of 1000 results being returned at a time.
24225 * @method AV.SearchQuery#limit
24226 * @param {Number} n the number of results to limit to.
24227 * @return {AV.SearchQuery} Returns the query, so you can chain this call.
24228 */
24229
24230/***/ }),
24231/* 541 */
24232/***/ (function(module, exports, __webpack_require__) {
24233
24234"use strict";
24235
24236
24237var _interopRequireDefault = __webpack_require__(1);
24238
24239var _promise = _interopRequireDefault(__webpack_require__(12));
24240
24241var _ = __webpack_require__(2);
24242
24243var AVError = __webpack_require__(43);
24244
24245var _require = __webpack_require__(26),
24246 request = _require.request;
24247
24248module.exports = function (AV) {
24249 /**
24250 * 包含了使用了 LeanCloud
24251 * <a href='/docs/leaninsight_guide.html'>离线数据分析功能</a>的函数。
24252 * <p><strong><em>
24253 * 仅在云引擎运行环境下有效。
24254 * </em></strong></p>
24255 * @namespace
24256 */
24257 AV.Insight = AV.Insight || {};
24258
24259 _.extend(AV.Insight,
24260 /** @lends AV.Insight */
24261 {
24262 /**
24263 * 开始一个 Insight 任务。结果里将返回 Job id,你可以拿得到的 id 使用
24264 * AV.Insight.JobQuery 查询任务状态和结果。
24265 * @param {Object} jobConfig 任务配置的 JSON 对象,例如:<code><pre>
24266 * { "sql" : "select count(*) as c,gender from _User group by gender",
24267 * "saveAs": {
24268 * "className" : "UserGender",
24269 * "limit": 1
24270 * }
24271 * }
24272 * </pre></code>
24273 * sql 指定任务执行的 SQL 语句, saveAs(可选) 指定将结果保存在哪张表里,limit 最大 1000。
24274 * @param {AuthOptions} [options]
24275 * @return {Promise} A promise that will be resolved with the result
24276 * of the function.
24277 */
24278 startJob: function startJob(jobConfig, options) {
24279 if (!jobConfig || !jobConfig.sql) {
24280 throw new Error('Please provide the sql to run the job.');
24281 }
24282
24283 var data = {
24284 jobConfig: jobConfig,
24285 appId: AV.applicationId
24286 };
24287 return request({
24288 path: '/bigquery/jobs',
24289 method: 'POST',
24290 data: AV._encode(data, null, true),
24291 authOptions: options,
24292 signKey: false
24293 }).then(function (resp) {
24294 return AV._decode(resp).id;
24295 });
24296 },
24297
24298 /**
24299 * 监听 Insight 任务事件(未来推出独立部署的离线分析服务后开放)
24300 * <p><strong><em>
24301 * 仅在云引擎运行环境下有效。
24302 * </em></strong></p>
24303 * @param {String} event 监听的事件,目前尚不支持。
24304 * @param {Function} 监听回调函数,接收 (err, id) 两个参数,err 表示错误信息,
24305 * id 表示任务 id。接下来你可以拿这个 id 使用AV.Insight.JobQuery 查询任务状态和结果。
24306 *
24307 */
24308 on: function on(event, cb) {}
24309 });
24310 /**
24311 * 创建一个对象,用于查询 Insight 任务状态和结果。
24312 * @class
24313 * @param {String} id 任务 id
24314 * @since 0.5.5
24315 */
24316
24317
24318 AV.Insight.JobQuery = function (id, className) {
24319 if (!id) {
24320 throw new Error('Please provide the job id.');
24321 }
24322
24323 this.id = id;
24324 this.className = className;
24325 this._skip = 0;
24326 this._limit = 100;
24327 };
24328
24329 _.extend(AV.Insight.JobQuery.prototype,
24330 /** @lends AV.Insight.JobQuery.prototype */
24331 {
24332 /**
24333 * Sets the number of results to skip before returning any results.
24334 * This is useful for pagination.
24335 * Default is to skip zero results.
24336 * @param {Number} n the number of results to skip.
24337 * @return {AV.Query} Returns the query, so you can chain this call.
24338 */
24339 skip: function skip(n) {
24340 this._skip = n;
24341 return this;
24342 },
24343
24344 /**
24345 * Sets the limit of the number of results to return. The default limit is
24346 * 100, with a maximum of 1000 results being returned at a time.
24347 * @param {Number} n the number of results to limit to.
24348 * @return {AV.Query} Returns the query, so you can chain this call.
24349 */
24350 limit: function limit(n) {
24351 this._limit = n;
24352 return this;
24353 },
24354
24355 /**
24356 * 查询任务状态和结果,任务结果为一个 JSON 对象,包括 status 表示任务状态, totalCount 表示总数,
24357 * results 数组表示任务结果数组,previewCount 表示可以返回的结果总数,任务的开始和截止时间
24358 * startTime、endTime 等信息。
24359 *
24360 * @param {AuthOptions} [options]
24361 * @return {Promise} A promise that will be resolved with the result
24362 * of the function.
24363 *
24364 */
24365 find: function find(options) {
24366 var params = {
24367 skip: this._skip,
24368 limit: this._limit
24369 };
24370 return request({
24371 path: "/bigquery/jobs/".concat(this.id),
24372 method: 'GET',
24373 query: params,
24374 authOptions: options,
24375 signKey: false
24376 }).then(function (response) {
24377 if (response.error) {
24378 return _promise.default.reject(new AVError(response.code, response.error));
24379 }
24380
24381 return _promise.default.resolve(response);
24382 });
24383 }
24384 });
24385};
24386
24387/***/ }),
24388/* 542 */
24389/***/ (function(module, exports, __webpack_require__) {
24390
24391"use strict";
24392
24393
24394var _interopRequireDefault = __webpack_require__(1);
24395
24396var _promise = _interopRequireDefault(__webpack_require__(12));
24397
24398var _ = __webpack_require__(2);
24399
24400var _require = __webpack_require__(26),
24401 LCRequest = _require.request;
24402
24403var _require2 = __webpack_require__(29),
24404 getSessionToken = _require2.getSessionToken;
24405
24406module.exports = function (AV) {
24407 var getUserWithSessionToken = function getUserWithSessionToken(authOptions) {
24408 if (authOptions.user) {
24409 if (!authOptions.user._sessionToken) {
24410 throw new Error('authOptions.user is not signed in.');
24411 }
24412
24413 return _promise.default.resolve(authOptions.user);
24414 }
24415
24416 if (authOptions.sessionToken) {
24417 return AV.User._fetchUserBySessionToken(authOptions.sessionToken);
24418 }
24419
24420 return AV.User.currentAsync();
24421 };
24422
24423 var getSessionTokenAsync = function getSessionTokenAsync(authOptions) {
24424 var sessionToken = getSessionToken(authOptions);
24425
24426 if (sessionToken) {
24427 return _promise.default.resolve(sessionToken);
24428 }
24429
24430 return AV.User.currentAsync().then(function (user) {
24431 if (user) {
24432 return user.getSessionToken();
24433 }
24434 });
24435 };
24436 /**
24437 * Contains functions to deal with Friendship in LeanCloud.
24438 * @class
24439 */
24440
24441
24442 AV.Friendship = {
24443 /**
24444 * Request friendship.
24445 * @since 4.8.0
24446 * @param {String | AV.User | Object} options if an AV.User or string is given, it will be used as the friend.
24447 * @param {AV.User | string} options.friend The friend (or friend's objectId) to follow.
24448 * @param {Object} [options.attributes] key-value attributes dictionary to be used as conditions of followeeQuery.
24449 * @param {AuthOptions} [authOptions]
24450 * @return {Promise<void>}
24451 */
24452 request: function request(options) {
24453 var authOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
24454 var friend;
24455 var attributes;
24456
24457 if (options.friend) {
24458 friend = options.friend;
24459 attributes = options.attributes;
24460 } else {
24461 friend = options;
24462 }
24463
24464 var friendObj = _.isString(friend) ? AV.Object.createWithoutData('_User', friend) : friend;
24465 return getUserWithSessionToken(authOptions).then(function (userObj) {
24466 if (!userObj) {
24467 throw new Error('Please signin an user.');
24468 }
24469
24470 return LCRequest({
24471 method: 'POST',
24472 path: '/users/friendshipRequests',
24473 data: {
24474 user: userObj._toPointer(),
24475 friend: friendObj._toPointer(),
24476 friendship: attributes
24477 },
24478 authOptions: authOptions
24479 });
24480 });
24481 },
24482
24483 /**
24484 * Accept a friendship request.
24485 * @since 4.8.0
24486 * @param {AV.Object | string | Object} options if an AV.Object or string is given, it will be used as the request in _FriendshipRequest.
24487 * @param {AV.Object} options.request The request (or it's objectId) to be accepted.
24488 * @param {Object} [options.attributes] key-value attributes dictionary to be used as conditions of {@link AV#followeeQuery}.
24489 * @param {AuthOptions} [authOptions]
24490 * @return {Promise<void>}
24491 */
24492 acceptRequest: function acceptRequest(options) {
24493 var authOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
24494 var request;
24495 var attributes;
24496
24497 if (options.request) {
24498 request = options.request;
24499 attributes = options.attributes;
24500 } else {
24501 request = options;
24502 }
24503
24504 var requestId = _.isString(request) ? request : request.id;
24505 return getSessionTokenAsync(authOptions).then(function (sessionToken) {
24506 if (!sessionToken) {
24507 throw new Error('Please signin an user.');
24508 }
24509
24510 return LCRequest({
24511 method: 'PUT',
24512 path: '/users/friendshipRequests/' + requestId + '/accept',
24513 data: {
24514 friendship: AV._encode(attributes)
24515 },
24516 authOptions: authOptions
24517 });
24518 });
24519 },
24520
24521 /**
24522 * Decline a friendship request.
24523 * @param {AV.Object | string} request The request (or it's objectId) to be declined.
24524 * @param {AuthOptions} [authOptions]
24525 * @return {Promise<void>}
24526 */
24527 declineRequest: function declineRequest(request) {
24528 var authOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
24529 var requestId = _.isString(request) ? request : request.id;
24530 return getSessionTokenAsync(authOptions).then(function (sessionToken) {
24531 if (!sessionToken) {
24532 throw new Error('Please signin an user.');
24533 }
24534
24535 return LCRequest({
24536 method: 'PUT',
24537 path: '/users/friendshipRequests/' + requestId + '/decline',
24538 authOptions: authOptions
24539 });
24540 });
24541 }
24542 };
24543};
24544
24545/***/ }),
24546/* 543 */
24547/***/ (function(module, exports, __webpack_require__) {
24548
24549"use strict";
24550
24551
24552var _interopRequireDefault = __webpack_require__(1);
24553
24554var _stringify = _interopRequireDefault(__webpack_require__(36));
24555
24556var _ = __webpack_require__(2);
24557
24558var _require = __webpack_require__(26),
24559 _request = _require._request;
24560
24561var AV = __webpack_require__(65);
24562
24563var serializeMessage = function serializeMessage(message) {
24564 if (typeof message === 'string') {
24565 return message;
24566 }
24567
24568 if (typeof message.getPayload === 'function') {
24569 return (0, _stringify.default)(message.getPayload());
24570 }
24571
24572 return (0, _stringify.default)(message);
24573};
24574/**
24575 * <p>An AV.Conversation is a local representation of a LeanCloud realtime's
24576 * conversation. This class is a subclass of AV.Object, and retains the
24577 * same functionality of an AV.Object, but also extends it with various
24578 * conversation specific methods, like get members, creators of this conversation.
24579 * </p>
24580 *
24581 * @class AV.Conversation
24582 * @param {String} name The name of the Role to create.
24583 * @param {Object} [options]
24584 * @param {Boolean} [options.isSystem] Set this conversation as system conversation.
24585 * @param {Boolean} [options.isTransient] Set this conversation as transient conversation.
24586 */
24587
24588
24589module.exports = AV.Object.extend('_Conversation',
24590/** @lends AV.Conversation.prototype */
24591{
24592 constructor: function constructor(name) {
24593 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
24594 AV.Object.prototype.constructor.call(this, null, null);
24595 this.set('name', name);
24596
24597 if (options.isSystem !== undefined) {
24598 this.set('sys', options.isSystem ? true : false);
24599 }
24600
24601 if (options.isTransient !== undefined) {
24602 this.set('tr', options.isTransient ? true : false);
24603 }
24604 },
24605
24606 /**
24607 * Get current conversation's creator.
24608 *
24609 * @return {String}
24610 */
24611 getCreator: function getCreator() {
24612 return this.get('c');
24613 },
24614
24615 /**
24616 * Get the last message's time.
24617 *
24618 * @return {Date}
24619 */
24620 getLastMessageAt: function getLastMessageAt() {
24621 return this.get('lm');
24622 },
24623
24624 /**
24625 * Get this conversation's members
24626 *
24627 * @return {String[]}
24628 */
24629 getMembers: function getMembers() {
24630 return this.get('m');
24631 },
24632
24633 /**
24634 * Add a member to this conversation
24635 *
24636 * @param {String} member
24637 */
24638 addMember: function addMember(member) {
24639 return this.add('m', member);
24640 },
24641
24642 /**
24643 * Get this conversation's members who set this conversation as muted.
24644 *
24645 * @return {String[]}
24646 */
24647 getMutedMembers: function getMutedMembers() {
24648 return this.get('mu');
24649 },
24650
24651 /**
24652 * Get this conversation's name field.
24653 *
24654 * @return String
24655 */
24656 getName: function getName() {
24657 return this.get('name');
24658 },
24659
24660 /**
24661 * Returns true if this conversation is transient conversation.
24662 *
24663 * @return {Boolean}
24664 */
24665 isTransient: function isTransient() {
24666 return this.get('tr');
24667 },
24668
24669 /**
24670 * Returns true if this conversation is system conversation.
24671 *
24672 * @return {Boolean}
24673 */
24674 isSystem: function isSystem() {
24675 return this.get('sys');
24676 },
24677
24678 /**
24679 * Send realtime message to this conversation, using HTTP request.
24680 *
24681 * @param {String} fromClient Sender's client id.
24682 * @param {String|Object} message The message which will send to conversation.
24683 * It could be a raw string, or an object with a `toJSON` method, like a
24684 * realtime SDK's Message object. See more: {@link https://leancloud.cn/docs/realtime_guide-js.html#消息}
24685 * @param {Object} [options]
24686 * @param {Boolean} [options.transient] Whether send this message as transient message or not.
24687 * @param {String[]} [options.toClients] Ids of clients to send to. This option can be used only in system conversation.
24688 * @param {Object} [options.pushData] Push data to this message. See more: {@link https://url.leanapp.cn/pushData 推送消息内容}
24689 * @param {AuthOptions} [authOptions]
24690 * @return {Promise}
24691 */
24692 send: function send(fromClient, message) {
24693 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
24694 var authOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
24695 var data = {
24696 from_peer: fromClient,
24697 conv_id: this.id,
24698 transient: false,
24699 message: serializeMessage(message)
24700 };
24701
24702 if (options.toClients !== undefined) {
24703 data.to_peers = options.toClients;
24704 }
24705
24706 if (options.transient !== undefined) {
24707 data.transient = options.transient ? true : false;
24708 }
24709
24710 if (options.pushData !== undefined) {
24711 data.push_data = options.pushData;
24712 }
24713
24714 return _request('rtm', 'messages', null, 'POST', data, authOptions);
24715 },
24716
24717 /**
24718 * Send realtime broadcast message to all clients, via this conversation, using HTTP request.
24719 *
24720 * @param {String} fromClient Sender's client id.
24721 * @param {String|Object} message The message which will send to conversation.
24722 * It could be a raw string, or an object with a `toJSON` method, like a
24723 * realtime SDK's Message object. See more: {@link https://leancloud.cn/docs/realtime_guide-js.html#消息}.
24724 * @param {Object} [options]
24725 * @param {Object} [options.pushData] Push data to this message. See more: {@link https://url.leanapp.cn/pushData 推送消息内容}.
24726 * @param {Object} [options.validTill] The message will valid till this time.
24727 * @param {AuthOptions} [authOptions]
24728 * @return {Promise}
24729 */
24730 broadcast: function broadcast(fromClient, message) {
24731 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
24732 var authOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
24733 var data = {
24734 from_peer: fromClient,
24735 conv_id: this.id,
24736 message: serializeMessage(message)
24737 };
24738
24739 if (options.pushData !== undefined) {
24740 data.push = options.pushData;
24741 }
24742
24743 if (options.validTill !== undefined) {
24744 var ts = options.validTill;
24745
24746 if (_.isDate(ts)) {
24747 ts = ts.getTime();
24748 }
24749
24750 options.valid_till = ts;
24751 }
24752
24753 return _request('rtm', 'broadcast', null, 'POST', data, authOptions);
24754 }
24755});
24756
24757/***/ }),
24758/* 544 */
24759/***/ (function(module, exports, __webpack_require__) {
24760
24761"use strict";
24762
24763
24764var _interopRequireDefault = __webpack_require__(1);
24765
24766var _promise = _interopRequireDefault(__webpack_require__(12));
24767
24768var _map = _interopRequireDefault(__webpack_require__(42));
24769
24770var _concat = _interopRequireDefault(__webpack_require__(30));
24771
24772var _ = __webpack_require__(2);
24773
24774var _require = __webpack_require__(26),
24775 request = _require.request;
24776
24777var _require2 = __webpack_require__(29),
24778 ensureArray = _require2.ensureArray,
24779 parseDate = _require2.parseDate;
24780
24781var AV = __webpack_require__(65);
24782/**
24783 * The version change interval for Leaderboard
24784 * @enum
24785 */
24786
24787
24788AV.LeaderboardVersionChangeInterval = {
24789 NEVER: 'never',
24790 DAY: 'day',
24791 WEEK: 'week',
24792 MONTH: 'month'
24793};
24794/**
24795 * The order of the leaderboard results
24796 * @enum
24797 */
24798
24799AV.LeaderboardOrder = {
24800 ASCENDING: 'ascending',
24801 DESCENDING: 'descending'
24802};
24803/**
24804 * The update strategy for Leaderboard
24805 * @enum
24806 */
24807
24808AV.LeaderboardUpdateStrategy = {
24809 /** Only keep the best statistic. If the leaderboard is in descending order, the best statistic is the highest one. */
24810 BETTER: 'better',
24811
24812 /** Keep the last updated statistic */
24813 LAST: 'last',
24814
24815 /** Keep the sum of all updated statistics */
24816 SUM: 'sum'
24817};
24818/**
24819 * @typedef {Object} Ranking
24820 * @property {number} rank Starts at 0
24821 * @property {number} value the statistic value of this ranking
24822 * @property {AV.User} user The user of this ranking
24823 * @property {Statistic[]} [includedStatistics] Other statistics of the user, specified by the `includeStatistic` option of `AV.Leaderboard.getResults()`
24824 */
24825
24826/**
24827 * @typedef {Object} LeaderboardArchive
24828 * @property {string} statisticName
24829 * @property {number} version version of the leaderboard
24830 * @property {string} status
24831 * @property {string} url URL for the downloadable archive
24832 * @property {Date} activatedAt time when this version became active
24833 * @property {Date} deactivatedAt time when this version was deactivated by a version incrementing
24834 */
24835
24836/**
24837 * @class
24838 */
24839
24840function Statistic(_ref) {
24841 var name = _ref.name,
24842 value = _ref.value,
24843 version = _ref.version;
24844
24845 /**
24846 * @type {string}
24847 */
24848 this.name = name;
24849 /**
24850 * @type {number}
24851 */
24852
24853 this.value = value;
24854 /**
24855 * @type {number?}
24856 */
24857
24858 this.version = version;
24859}
24860
24861var parseStatisticData = function parseStatisticData(statisticData) {
24862 var _AV$_decode = AV._decode(statisticData),
24863 name = _AV$_decode.statisticName,
24864 value = _AV$_decode.statisticValue,
24865 version = _AV$_decode.version;
24866
24867 return new Statistic({
24868 name: name,
24869 value: value,
24870 version: version
24871 });
24872};
24873/**
24874 * @class
24875 */
24876
24877
24878AV.Leaderboard = function Leaderboard(statisticName) {
24879 /**
24880 * @type {string}
24881 */
24882 this.statisticName = statisticName;
24883 /**
24884 * @type {AV.LeaderboardOrder}
24885 */
24886
24887 this.order = undefined;
24888 /**
24889 * @type {AV.LeaderboardUpdateStrategy}
24890 */
24891
24892 this.updateStrategy = undefined;
24893 /**
24894 * @type {AV.LeaderboardVersionChangeInterval}
24895 */
24896
24897 this.versionChangeInterval = undefined;
24898 /**
24899 * @type {number}
24900 */
24901
24902 this.version = undefined;
24903 /**
24904 * @type {Date?}
24905 */
24906
24907 this.nextResetAt = undefined;
24908 /**
24909 * @type {Date?}
24910 */
24911
24912 this.createdAt = undefined;
24913};
24914
24915var Leaderboard = AV.Leaderboard;
24916/**
24917 * Create an instance of Leaderboard for the give statistic name.
24918 * @param {string} statisticName
24919 * @return {AV.Leaderboard}
24920 */
24921
24922AV.Leaderboard.createWithoutData = function (statisticName) {
24923 return new Leaderboard(statisticName);
24924};
24925/**
24926 * (masterKey required) Create a new Leaderboard.
24927 * @param {Object} options
24928 * @param {string} options.statisticName
24929 * @param {AV.LeaderboardOrder} options.order
24930 * @param {AV.LeaderboardVersionChangeInterval} [options.versionChangeInterval] default to WEEK
24931 * @param {AV.LeaderboardUpdateStrategy} [options.updateStrategy] default to BETTER
24932 * @param {AuthOptions} [authOptions]
24933 * @return {Promise<AV.Leaderboard>}
24934 */
24935
24936
24937AV.Leaderboard.createLeaderboard = function (_ref2, authOptions) {
24938 var statisticName = _ref2.statisticName,
24939 order = _ref2.order,
24940 versionChangeInterval = _ref2.versionChangeInterval,
24941 updateStrategy = _ref2.updateStrategy;
24942 return request({
24943 method: 'POST',
24944 path: '/leaderboard/leaderboards',
24945 data: {
24946 statisticName: statisticName,
24947 order: order,
24948 versionChangeInterval: versionChangeInterval,
24949 updateStrategy: updateStrategy
24950 },
24951 authOptions: authOptions
24952 }).then(function (data) {
24953 var leaderboard = new Leaderboard(statisticName);
24954 return leaderboard._finishFetch(data);
24955 });
24956};
24957/**
24958 * Get the Leaderboard with the specified statistic name.
24959 * @param {string} statisticName
24960 * @param {AuthOptions} [authOptions]
24961 * @return {Promise<AV.Leaderboard>}
24962 */
24963
24964
24965AV.Leaderboard.getLeaderboard = function (statisticName, authOptions) {
24966 return Leaderboard.createWithoutData(statisticName).fetch(authOptions);
24967};
24968/**
24969 * Get Statistics for the specified user.
24970 * @param {AV.User} user The specified AV.User pointer.
24971 * @param {Object} [options]
24972 * @param {string[]} [options.statisticNames] Specify the statisticNames. If not set, all statistics of the user will be fetched.
24973 * @param {AuthOptions} [authOptions]
24974 * @return {Promise<Statistic[]>}
24975 */
24976
24977
24978AV.Leaderboard.getStatistics = function (user) {
24979 var _ref3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
24980 statisticNames = _ref3.statisticNames;
24981
24982 var authOptions = arguments.length > 2 ? arguments[2] : undefined;
24983 return _promise.default.resolve().then(function () {
24984 if (!(user && user.id)) throw new Error('user must be an AV.User');
24985 return request({
24986 method: 'GET',
24987 path: "/leaderboard/users/".concat(user.id, "/statistics"),
24988 query: {
24989 statistics: statisticNames ? ensureArray(statisticNames).join(',') : undefined
24990 },
24991 authOptions: authOptions
24992 }).then(function (_ref4) {
24993 var results = _ref4.results;
24994 return (0, _map.default)(results).call(results, parseStatisticData);
24995 });
24996 });
24997};
24998/**
24999 * Update Statistics for the specified user.
25000 * @param {AV.User} user The specified AV.User pointer.
25001 * @param {Object} statistics A name-value pair representing the statistics to update.
25002 * @param {AuthOptions} [options] AuthOptions plus:
25003 * @param {boolean} [options.overwrite] Wethere to overwrite these statistics disregarding the updateStrategy of there leaderboards
25004 * @return {Promise<Statistic[]>}
25005 */
25006
25007
25008AV.Leaderboard.updateStatistics = function (user, statistics) {
25009 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
25010 return _promise.default.resolve().then(function () {
25011 if (!(user && user.id)) throw new Error('user must be an AV.User');
25012 var data = (0, _map.default)(_).call(_, statistics, function (value, key) {
25013 return {
25014 statisticName: key,
25015 statisticValue: value
25016 };
25017 });
25018 var overwrite = options.overwrite;
25019 return request({
25020 method: 'POST',
25021 path: "/leaderboard/users/".concat(user.id, "/statistics"),
25022 query: {
25023 overwrite: overwrite ? 1 : undefined
25024 },
25025 data: data,
25026 authOptions: options
25027 }).then(function (_ref5) {
25028 var results = _ref5.results;
25029 return (0, _map.default)(results).call(results, parseStatisticData);
25030 });
25031 });
25032};
25033/**
25034 * Delete Statistics for the specified user.
25035 * @param {AV.User} user The specified AV.User pointer.
25036 * @param {Object} statistics A name-value pair representing the statistics to delete.
25037 * @param {AuthOptions} [options]
25038 * @return {Promise<void>}
25039 */
25040
25041
25042AV.Leaderboard.deleteStatistics = function (user, statisticNames, authOptions) {
25043 return _promise.default.resolve().then(function () {
25044 if (!(user && user.id)) throw new Error('user must be an AV.User');
25045 return request({
25046 method: 'DELETE',
25047 path: "/leaderboard/users/".concat(user.id, "/statistics"),
25048 query: {
25049 statistics: ensureArray(statisticNames).join(',')
25050 },
25051 authOptions: authOptions
25052 }).then(function () {
25053 return undefined;
25054 });
25055 });
25056};
25057
25058_.extend(Leaderboard.prototype,
25059/** @lends AV.Leaderboard.prototype */
25060{
25061 _finishFetch: function _finishFetch(data) {
25062 var _this = this;
25063
25064 _.forEach(data, function (value, key) {
25065 if (key === 'updatedAt' || key === 'objectId') return;
25066
25067 if (key === 'expiredAt') {
25068 key = 'nextResetAt';
25069 }
25070
25071 if (key === 'createdAt') {
25072 value = parseDate(value);
25073 }
25074
25075 if (value && value.__type === 'Date') {
25076 value = parseDate(value.iso);
25077 }
25078
25079 _this[key] = value;
25080 });
25081
25082 return this;
25083 },
25084
25085 /**
25086 * Fetch data from the srever.
25087 * @param {AuthOptions} [authOptions]
25088 * @return {Promise<AV.Leaderboard>}
25089 */
25090 fetch: function fetch(authOptions) {
25091 var _this2 = this;
25092
25093 return request({
25094 method: 'GET',
25095 path: "/leaderboard/leaderboards/".concat(this.statisticName),
25096 authOptions: authOptions
25097 }).then(function (data) {
25098 return _this2._finishFetch(data);
25099 });
25100 },
25101
25102 /**
25103 * Counts the number of users participated in this leaderboard
25104 * @param {Object} [options]
25105 * @param {number} [options.version] Specify the version of the leaderboard
25106 * @param {AuthOptions} [authOptions]
25107 * @return {Promise<number>}
25108 */
25109 count: function count() {
25110 var _ref6 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
25111 version = _ref6.version;
25112
25113 var authOptions = arguments.length > 1 ? arguments[1] : undefined;
25114 return request({
25115 method: 'GET',
25116 path: "/leaderboard/leaderboards/".concat(this.statisticName, "/ranks"),
25117 query: {
25118 count: 1,
25119 limit: 0,
25120 version: version
25121 },
25122 authOptions: authOptions
25123 }).then(function (_ref7) {
25124 var count = _ref7.count;
25125 return count;
25126 });
25127 },
25128 _getResults: function _getResults(_ref8, authOptions, userId) {
25129 var _context;
25130
25131 var skip = _ref8.skip,
25132 limit = _ref8.limit,
25133 selectUserKeys = _ref8.selectUserKeys,
25134 includeUserKeys = _ref8.includeUserKeys,
25135 includeStatistics = _ref8.includeStatistics,
25136 version = _ref8.version;
25137 return request({
25138 method: 'GET',
25139 path: (0, _concat.default)(_context = "/leaderboard/leaderboards/".concat(this.statisticName, "/ranks")).call(_context, userId ? "/".concat(userId) : ''),
25140 query: {
25141 skip: skip,
25142 limit: limit,
25143 selectUserKeys: _.union(ensureArray(selectUserKeys), ensureArray(includeUserKeys)).join(',') || undefined,
25144 includeUser: includeUserKeys ? ensureArray(includeUserKeys).join(',') : undefined,
25145 includeStatistics: includeStatistics ? ensureArray(includeStatistics).join(',') : undefined,
25146 version: version
25147 },
25148 authOptions: authOptions
25149 }).then(function (_ref9) {
25150 var rankings = _ref9.results;
25151 return (0, _map.default)(rankings).call(rankings, function (rankingData) {
25152 var _AV$_decode2 = AV._decode(rankingData),
25153 user = _AV$_decode2.user,
25154 value = _AV$_decode2.statisticValue,
25155 rank = _AV$_decode2.rank,
25156 _AV$_decode2$statisti = _AV$_decode2.statistics,
25157 statistics = _AV$_decode2$statisti === void 0 ? [] : _AV$_decode2$statisti;
25158
25159 return {
25160 user: user,
25161 value: value,
25162 rank: rank,
25163 includedStatistics: (0, _map.default)(statistics).call(statistics, parseStatisticData)
25164 };
25165 });
25166 });
25167 },
25168
25169 /**
25170 * Retrieve a list of ranked users for this Leaderboard.
25171 * @param {Object} [options]
25172 * @param {number} [options.skip] The number of results to skip. This is useful for pagination.
25173 * @param {number} [options.limit] The limit of the number of results.
25174 * @param {string[]} [options.selectUserKeys] Specify keys of the users to include in the Rankings
25175 * @param {string[]} [options.includeUserKeys] If the value of a selected user keys is a Pointer, use this options to include its value.
25176 * @param {string[]} [options.includeStatistics] Specify other statistics to include in the Rankings
25177 * @param {number} [options.version] Specify the version of the leaderboard
25178 * @param {AuthOptions} [authOptions]
25179 * @return {Promise<Ranking[]>}
25180 */
25181 getResults: function getResults() {
25182 var _ref10 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
25183 skip = _ref10.skip,
25184 limit = _ref10.limit,
25185 selectUserKeys = _ref10.selectUserKeys,
25186 includeUserKeys = _ref10.includeUserKeys,
25187 includeStatistics = _ref10.includeStatistics,
25188 version = _ref10.version;
25189
25190 var authOptions = arguments.length > 1 ? arguments[1] : undefined;
25191 return this._getResults({
25192 skip: skip,
25193 limit: limit,
25194 selectUserKeys: selectUserKeys,
25195 includeUserKeys: includeUserKeys,
25196 includeStatistics: includeStatistics,
25197 version: version
25198 }, authOptions);
25199 },
25200
25201 /**
25202 * Retrieve a list of ranked users for this Leaderboard, centered on the specified user.
25203 * @param {AV.User} user The specified AV.User pointer.
25204 * @param {Object} [options]
25205 * @param {number} [options.limit] The limit of the number of results.
25206 * @param {string[]} [options.selectUserKeys] Specify keys of the users to include in the Rankings
25207 * @param {string[]} [options.includeUserKeys] If the value of a selected user keys is a Pointer, use this options to include its value.
25208 * @param {string[]} [options.includeStatistics] Specify other statistics to include in the Rankings
25209 * @param {number} [options.version] Specify the version of the leaderboard
25210 * @param {AuthOptions} [authOptions]
25211 * @return {Promise<Ranking[]>}
25212 */
25213 getResultsAroundUser: function getResultsAroundUser(user) {
25214 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
25215 var authOptions = arguments.length > 2 ? arguments[2] : undefined;
25216
25217 // getResultsAroundUser(options, authOptions)
25218 if (user && typeof user.id !== 'string') {
25219 return this.getResultsAroundUser(undefined, user, options);
25220 }
25221
25222 var limit = options.limit,
25223 selectUserKeys = options.selectUserKeys,
25224 includeUserKeys = options.includeUserKeys,
25225 includeStatistics = options.includeStatistics,
25226 version = options.version;
25227 return this._getResults({
25228 limit: limit,
25229 selectUserKeys: selectUserKeys,
25230 includeUserKeys: includeUserKeys,
25231 includeStatistics: includeStatistics,
25232 version: version
25233 }, authOptions, user ? user.id : 'self');
25234 },
25235 _update: function _update(data, authOptions) {
25236 var _this3 = this;
25237
25238 return request({
25239 method: 'PUT',
25240 path: "/leaderboard/leaderboards/".concat(this.statisticName),
25241 data: data,
25242 authOptions: authOptions
25243 }).then(function (result) {
25244 return _this3._finishFetch(result);
25245 });
25246 },
25247
25248 /**
25249 * (masterKey required) Update the version change interval of the Leaderboard.
25250 * @param {AV.LeaderboardVersionChangeInterval} versionChangeInterval
25251 * @param {AuthOptions} [authOptions]
25252 * @return {Promise<AV.Leaderboard>}
25253 */
25254 updateVersionChangeInterval: function updateVersionChangeInterval(versionChangeInterval, authOptions) {
25255 return this._update({
25256 versionChangeInterval: versionChangeInterval
25257 }, authOptions);
25258 },
25259
25260 /**
25261 * (masterKey required) Update the version change interval of the Leaderboard.
25262 * @param {AV.LeaderboardUpdateStrategy} updateStrategy
25263 * @param {AuthOptions} [authOptions]
25264 * @return {Promise<AV.Leaderboard>}
25265 */
25266 updateUpdateStrategy: function updateUpdateStrategy(updateStrategy, authOptions) {
25267 return this._update({
25268 updateStrategy: updateStrategy
25269 }, authOptions);
25270 },
25271
25272 /**
25273 * (masterKey required) Reset the Leaderboard. The version of the Leaderboard will be incremented by 1.
25274 * @param {AuthOptions} [authOptions]
25275 * @return {Promise<AV.Leaderboard>}
25276 */
25277 reset: function reset(authOptions) {
25278 var _this4 = this;
25279
25280 return request({
25281 method: 'PUT',
25282 path: "/leaderboard/leaderboards/".concat(this.statisticName, "/incrementVersion"),
25283 authOptions: authOptions
25284 }).then(function (data) {
25285 return _this4._finishFetch(data);
25286 });
25287 },
25288
25289 /**
25290 * (masterKey required) Delete the Leaderboard and its all archived versions.
25291 * @param {AuthOptions} [authOptions]
25292 * @return {void}
25293 */
25294 destroy: function destroy(authOptions) {
25295 return AV.request({
25296 method: 'DELETE',
25297 path: "/leaderboard/leaderboards/".concat(this.statisticName),
25298 authOptions: authOptions
25299 }).then(function () {
25300 return undefined;
25301 });
25302 },
25303
25304 /**
25305 * (masterKey required) Get archived versions.
25306 * @param {Object} [options]
25307 * @param {number} [options.skip] The number of results to skip. This is useful for pagination.
25308 * @param {number} [options.limit] The limit of the number of results.
25309 * @param {AuthOptions} [authOptions]
25310 * @return {Promise<LeaderboardArchive[]>}
25311 */
25312 getArchives: function getArchives() {
25313 var _this5 = this;
25314
25315 var _ref11 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
25316 skip = _ref11.skip,
25317 limit = _ref11.limit;
25318
25319 var authOptions = arguments.length > 1 ? arguments[1] : undefined;
25320 return request({
25321 method: 'GET',
25322 path: "/leaderboard/leaderboards/".concat(this.statisticName, "/archives"),
25323 query: {
25324 skip: skip,
25325 limit: limit
25326 },
25327 authOptions: authOptions
25328 }).then(function (_ref12) {
25329 var results = _ref12.results;
25330 return (0, _map.default)(results).call(results, function (_ref13) {
25331 var version = _ref13.version,
25332 status = _ref13.status,
25333 url = _ref13.url,
25334 activatedAt = _ref13.activatedAt,
25335 deactivatedAt = _ref13.deactivatedAt;
25336 return {
25337 statisticName: _this5.statisticName,
25338 version: version,
25339 status: status,
25340 url: url,
25341 activatedAt: parseDate(activatedAt.iso),
25342 deactivatedAt: parseDate(deactivatedAt.iso)
25343 };
25344 });
25345 });
25346 }
25347});
25348
25349/***/ }),
25350/* 545 */
25351/***/ (function(module, exports, __webpack_require__) {
25352
25353"use strict";
25354
25355
25356var adapters = __webpack_require__(546);
25357
25358module.exports = function (AV) {
25359 AV.setAdapters(adapters);
25360 return AV;
25361};
25362
25363/***/ }),
25364/* 546 */
25365/***/ (function(module, exports, __webpack_require__) {
25366
25367"use strict";
25368
25369
25370var _interopRequireDefault = __webpack_require__(1);
25371
25372var _typeof2 = _interopRequireDefault(__webpack_require__(109));
25373
25374var _defineProperty = _interopRequireDefault(__webpack_require__(143));
25375
25376var _setPrototypeOf = _interopRequireDefault(__webpack_require__(227));
25377
25378var _assign2 = _interopRequireDefault(__webpack_require__(547));
25379
25380var _indexOf = _interopRequireDefault(__webpack_require__(86));
25381
25382var _getOwnPropertySymbols = _interopRequireDefault(__webpack_require__(552));
25383
25384var _promise = _interopRequireDefault(__webpack_require__(12));
25385
25386var _symbol = _interopRequireDefault(__webpack_require__(240));
25387
25388var _iterator = _interopRequireDefault(__webpack_require__(555));
25389
25390var _weakMap = _interopRequireDefault(__webpack_require__(556));
25391
25392var _keys = _interopRequireDefault(__webpack_require__(141));
25393
25394var _getOwnPropertyDescriptor = _interopRequireDefault(__webpack_require__(246));
25395
25396var _getPrototypeOf = _interopRequireDefault(__webpack_require__(142));
25397
25398var _map = _interopRequireDefault(__webpack_require__(564));
25399
25400(0, _defineProperty.default)(exports, '__esModule', {
25401 value: true
25402});
25403/******************************************************************************
25404Copyright (c) Microsoft Corporation.
25405
25406Permission to use, copy, modify, and/or distribute this software for any
25407purpose with or without fee is hereby granted.
25408
25409THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
25410REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
25411AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
25412INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
25413LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
25414OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
25415PERFORMANCE OF THIS SOFTWARE.
25416***************************************************************************** */
25417
25418/* global Reflect, Promise */
25419
25420var _extendStatics$ = function extendStatics$1(d, b) {
25421 _extendStatics$ = _setPrototypeOf.default || {
25422 __proto__: []
25423 } instanceof Array && function (d, b) {
25424 d.__proto__ = b;
25425 } || function (d, b) {
25426 for (var p in b) {
25427 if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
25428 }
25429 };
25430
25431 return _extendStatics$(d, b);
25432};
25433
25434function __extends$1(d, b) {
25435 if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
25436
25437 _extendStatics$(d, b);
25438
25439 function __() {
25440 this.constructor = d;
25441 }
25442
25443 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
25444}
25445
25446var _assign = function __assign() {
25447 _assign = _assign2.default || function __assign(t) {
25448 for (var s, i = 1, n = arguments.length; i < n; i++) {
25449 s = arguments[i];
25450
25451 for (var p in s) {
25452 if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
25453 }
25454 }
25455
25456 return t;
25457 };
25458
25459 return _assign.apply(this, arguments);
25460};
25461
25462function __rest(s, e) {
25463 var t = {};
25464
25465 for (var p in s) {
25466 if (Object.prototype.hasOwnProperty.call(s, p) && (0, _indexOf.default)(e).call(e, p) < 0) t[p] = s[p];
25467 }
25468
25469 if (s != null && typeof _getOwnPropertySymbols.default === "function") for (var i = 0, p = (0, _getOwnPropertySymbols.default)(s); i < p.length; i++) {
25470 if ((0, _indexOf.default)(e).call(e, p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
25471 }
25472 return t;
25473}
25474
25475function __awaiter(thisArg, _arguments, P, generator) {
25476 function adopt(value) {
25477 return value instanceof P ? value : new P(function (resolve) {
25478 resolve(value);
25479 });
25480 }
25481
25482 return new (P || (P = _promise.default))(function (resolve, reject) {
25483 function fulfilled(value) {
25484 try {
25485 step(generator.next(value));
25486 } catch (e) {
25487 reject(e);
25488 }
25489 }
25490
25491 function rejected(value) {
25492 try {
25493 step(generator["throw"](value));
25494 } catch (e) {
25495 reject(e);
25496 }
25497 }
25498
25499 function step(result) {
25500 result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
25501 }
25502
25503 step((generator = generator.apply(thisArg, _arguments || [])).next());
25504 });
25505}
25506
25507function __generator(thisArg, body) {
25508 var _ = {
25509 label: 0,
25510 sent: function sent() {
25511 if (t[0] & 1) throw t[1];
25512 return t[1];
25513 },
25514 trys: [],
25515 ops: []
25516 },
25517 f,
25518 y,
25519 t,
25520 g;
25521 return g = {
25522 next: verb(0),
25523 "throw": verb(1),
25524 "return": verb(2)
25525 }, typeof _symbol.default === "function" && (g[_iterator.default] = function () {
25526 return this;
25527 }), g;
25528
25529 function verb(n) {
25530 return function (v) {
25531 return step([n, v]);
25532 };
25533 }
25534
25535 function step(op) {
25536 if (f) throw new TypeError("Generator is already executing.");
25537
25538 while (_) {
25539 try {
25540 if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
25541 if (y = 0, t) op = [op[0] & 2, t.value];
25542
25543 switch (op[0]) {
25544 case 0:
25545 case 1:
25546 t = op;
25547 break;
25548
25549 case 4:
25550 _.label++;
25551 return {
25552 value: op[1],
25553 done: false
25554 };
25555
25556 case 5:
25557 _.label++;
25558 y = op[1];
25559 op = [0];
25560 continue;
25561
25562 case 7:
25563 op = _.ops.pop();
25564
25565 _.trys.pop();
25566
25567 continue;
25568
25569 default:
25570 if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
25571 _ = 0;
25572 continue;
25573 }
25574
25575 if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
25576 _.label = op[1];
25577 break;
25578 }
25579
25580 if (op[0] === 6 && _.label < t[1]) {
25581 _.label = t[1];
25582 t = op;
25583 break;
25584 }
25585
25586 if (t && _.label < t[2]) {
25587 _.label = t[2];
25588
25589 _.ops.push(op);
25590
25591 break;
25592 }
25593
25594 if (t[2]) _.ops.pop();
25595
25596 _.trys.pop();
25597
25598 continue;
25599 }
25600
25601 op = body.call(thisArg, _);
25602 } catch (e) {
25603 op = [6, e];
25604 y = 0;
25605 } finally {
25606 f = t = 0;
25607 }
25608 }
25609
25610 if (op[0] & 5) throw op[1];
25611 return {
25612 value: op[0] ? op[1] : void 0,
25613 done: true
25614 };
25615 }
25616}
25617
25618var PROVIDER = "lc_weapp";
25619var PLATFORM = "weixin";
25620
25621function getLoginCode() {
25622 return new _promise.default(function (resolve, reject) {
25623 wx.login({
25624 success: function success(res) {
25625 return res.code ? resolve(res.code) : reject(new Error(res.errMsg));
25626 },
25627 fail: function fail(_a) {
25628 var errMsg = _a.errMsg;
25629 return reject(new Error(errMsg));
25630 }
25631 });
25632 });
25633}
25634
25635var getAuthInfo = function getAuthInfo(_a) {
25636 var _b = _a === void 0 ? {} : _a,
25637 _c = _b.platform,
25638 platform = _c === void 0 ? PLATFORM : _c,
25639 _d = _b.preferUnionId,
25640 preferUnionId = _d === void 0 ? false : _d,
25641 _e = _b.asMainAccount,
25642 asMainAccount = _e === void 0 ? false : _e;
25643
25644 return __awaiter(this, void 0, void 0, function () {
25645 var code, authData;
25646 return __generator(this, function (_f) {
25647 switch (_f.label) {
25648 case 0:
25649 return [4
25650 /*yield*/
25651 , getLoginCode()];
25652
25653 case 1:
25654 code = _f.sent();
25655 authData = {
25656 code: code
25657 };
25658
25659 if (preferUnionId) {
25660 authData.platform = platform;
25661 authData.main_account = asMainAccount;
25662 }
25663
25664 return [2
25665 /*return*/
25666 , {
25667 authData: authData,
25668 platform: platform,
25669 provider: PROVIDER
25670 }];
25671 }
25672 });
25673 });
25674};
25675
25676var storage = {
25677 getItem: function getItem(key) {
25678 return wx.getStorageSync(key);
25679 },
25680 setItem: function setItem(key, value) {
25681 return wx.setStorageSync(key, value);
25682 },
25683 removeItem: function removeItem(key) {
25684 return wx.removeStorageSync(key);
25685 },
25686 clear: function clear() {
25687 return wx.clearStorageSync();
25688 }
25689};
25690/******************************************************************************
25691Copyright (c) Microsoft Corporation.
25692
25693Permission to use, copy, modify, and/or distribute this software for any
25694purpose with or without fee is hereby granted.
25695
25696THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
25697REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
25698AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
25699INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
25700LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
25701OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
25702PERFORMANCE OF THIS SOFTWARE.
25703***************************************************************************** */
25704
25705/* global Reflect, Promise */
25706
25707var _extendStatics = function extendStatics(d, b) {
25708 _extendStatics = _setPrototypeOf.default || {
25709 __proto__: []
25710 } instanceof Array && function (d, b) {
25711 d.__proto__ = b;
25712 } || function (d, b) {
25713 for (var p in b) {
25714 if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
25715 }
25716 };
25717
25718 return _extendStatics(d, b);
25719};
25720
25721function __extends(d, b) {
25722 if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
25723
25724 _extendStatics(d, b);
25725
25726 function __() {
25727 this.constructor = d;
25728 }
25729
25730 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
25731}
25732
25733var AbortError =
25734/** @class */
25735function (_super) {
25736 __extends(AbortError, _super);
25737
25738 function AbortError() {
25739 var _this = _super !== null && _super.apply(this, arguments) || this;
25740
25741 _this.name = "AbortError";
25742 return _this;
25743 }
25744
25745 return AbortError;
25746}(Error);
25747
25748var request = function request(url, options) {
25749 if (options === void 0) {
25750 options = {};
25751 }
25752
25753 var method = options.method,
25754 data = options.data,
25755 headers = options.headers,
25756 signal = options.signal;
25757
25758 if (signal === null || signal === void 0 ? void 0 : signal.aborted) {
25759 return _promise.default.reject(new AbortError("Request aborted"));
25760 }
25761
25762 return new _promise.default(function (resolve, reject) {
25763 var task = wx.request({
25764 url: url,
25765 method: method,
25766 data: data,
25767 header: headers,
25768 complete: function complete(res) {
25769 signal === null || signal === void 0 ? void 0 : signal.removeEventListener("abort", abortListener);
25770
25771 if (!res.statusCode) {
25772 reject(new Error(res.errMsg));
25773 return;
25774 }
25775
25776 resolve({
25777 ok: !(res.statusCode >= 400),
25778 status: res.statusCode,
25779 headers: res.header,
25780 data: res.data
25781 });
25782 }
25783 });
25784
25785 var abortListener = function abortListener() {
25786 reject(new AbortError("Request aborted"));
25787 task.abort();
25788 };
25789
25790 signal === null || signal === void 0 ? void 0 : signal.addEventListener("abort", abortListener);
25791 });
25792};
25793
25794var upload = function upload(url, file, options) {
25795 if (options === void 0) {
25796 options = {};
25797 }
25798
25799 var headers = options.headers,
25800 data = options.data,
25801 onprogress = options.onprogress,
25802 signal = options.signal;
25803
25804 if (signal === null || signal === void 0 ? void 0 : signal.aborted) {
25805 return _promise.default.reject(new AbortError("Request aborted"));
25806 }
25807
25808 if (!(file && file.data && file.data.uri)) {
25809 return _promise.default.reject(new TypeError("File data must be an object like { uri: localPath }."));
25810 }
25811
25812 return new _promise.default(function (resolve, reject) {
25813 var task = wx.uploadFile({
25814 url: url,
25815 header: headers,
25816 filePath: file.data.uri,
25817 name: file.field,
25818 formData: data,
25819 success: function success(response) {
25820 var status = response.statusCode,
25821 data = response.data,
25822 rest = __rest(response, ["statusCode", "data"]);
25823
25824 resolve(_assign(_assign({}, rest), {
25825 data: typeof data === "string" ? JSON.parse(data) : data,
25826 status: status,
25827 ok: !(status >= 400)
25828 }));
25829 },
25830 fail: function fail(response) {
25831 reject(new Error(response.errMsg));
25832 },
25833 complete: function complete() {
25834 signal === null || signal === void 0 ? void 0 : signal.removeEventListener("abort", abortListener);
25835 }
25836 });
25837
25838 var abortListener = function abortListener() {
25839 reject(new AbortError("Request aborted"));
25840 task.abort();
25841 };
25842
25843 signal === null || signal === void 0 ? void 0 : signal.addEventListener("abort", abortListener);
25844
25845 if (onprogress) {
25846 task.onProgressUpdate(function (event) {
25847 return onprogress({
25848 loaded: event.totalBytesSent,
25849 total: event.totalBytesExpectedToSend,
25850 percent: event.progress
25851 });
25852 });
25853 }
25854 });
25855};
25856/**
25857 * @author Toru Nagashima <https://github.com/mysticatea>
25858 * @copyright 2015 Toru Nagashima. All rights reserved.
25859 * See LICENSE file in root directory for full license.
25860 */
25861
25862/**
25863 * @typedef {object} PrivateData
25864 * @property {EventTarget} eventTarget The event target.
25865 * @property {{type:string}} event The original event object.
25866 * @property {number} eventPhase The current event phase.
25867 * @property {EventTarget|null} currentTarget The current event target.
25868 * @property {boolean} canceled The flag to prevent default.
25869 * @property {boolean} stopped The flag to stop propagation.
25870 * @property {boolean} immediateStopped The flag to stop propagation immediately.
25871 * @property {Function|null} passiveListener The listener if the current listener is passive. Otherwise this is null.
25872 * @property {number} timeStamp The unix time.
25873 * @private
25874 */
25875
25876/**
25877 * Private data for event wrappers.
25878 * @type {WeakMap<Event, PrivateData>}
25879 * @private
25880 */
25881
25882
25883var privateData = new _weakMap.default();
25884/**
25885 * Cache for wrapper classes.
25886 * @type {WeakMap<Object, Function>}
25887 * @private
25888 */
25889
25890var wrappers = new _weakMap.default();
25891/**
25892 * Get private data.
25893 * @param {Event} event The event object to get private data.
25894 * @returns {PrivateData} The private data of the event.
25895 * @private
25896 */
25897
25898function pd(event) {
25899 var retv = privateData.get(event);
25900 console.assert(retv != null, "'this' is expected an Event object, but got", event);
25901 return retv;
25902}
25903/**
25904 * https://dom.spec.whatwg.org/#set-the-canceled-flag
25905 * @param data {PrivateData} private data.
25906 */
25907
25908
25909function setCancelFlag(data) {
25910 if (data.passiveListener != null) {
25911 if (typeof console !== "undefined" && typeof console.error === "function") {
25912 console.error("Unable to preventDefault inside passive event listener invocation.", data.passiveListener);
25913 }
25914
25915 return;
25916 }
25917
25918 if (!data.event.cancelable) {
25919 return;
25920 }
25921
25922 data.canceled = true;
25923
25924 if (typeof data.event.preventDefault === "function") {
25925 data.event.preventDefault();
25926 }
25927}
25928/**
25929 * @see https://dom.spec.whatwg.org/#interface-event
25930 * @private
25931 */
25932
25933/**
25934 * The event wrapper.
25935 * @constructor
25936 * @param {EventTarget} eventTarget The event target of this dispatching.
25937 * @param {Event|{type:string}} event The original event to wrap.
25938 */
25939
25940
25941function Event(eventTarget, event) {
25942 privateData.set(this, {
25943 eventTarget: eventTarget,
25944 event: event,
25945 eventPhase: 2,
25946 currentTarget: eventTarget,
25947 canceled: false,
25948 stopped: false,
25949 immediateStopped: false,
25950 passiveListener: null,
25951 timeStamp: event.timeStamp || Date.now()
25952 }); // https://heycam.github.io/webidl/#Unforgeable
25953
25954 (0, _defineProperty.default)(this, "isTrusted", {
25955 value: false,
25956 enumerable: true
25957 }); // Define accessors
25958
25959 var keys = (0, _keys.default)(event);
25960
25961 for (var i = 0; i < keys.length; ++i) {
25962 var key = keys[i];
25963
25964 if (!(key in this)) {
25965 (0, _defineProperty.default)(this, key, defineRedirectDescriptor(key));
25966 }
25967 }
25968} // Should be enumerable, but class methods are not enumerable.
25969
25970
25971Event.prototype = {
25972 /**
25973 * The type of this event.
25974 * @type {string}
25975 */
25976 get type() {
25977 return pd(this).event.type;
25978 },
25979
25980 /**
25981 * The target of this event.
25982 * @type {EventTarget}
25983 */
25984 get target() {
25985 return pd(this).eventTarget;
25986 },
25987
25988 /**
25989 * The target of this event.
25990 * @type {EventTarget}
25991 */
25992 get currentTarget() {
25993 return pd(this).currentTarget;
25994 },
25995
25996 /**
25997 * @returns {EventTarget[]} The composed path of this event.
25998 */
25999 composedPath: function composedPath() {
26000 var currentTarget = pd(this).currentTarget;
26001
26002 if (currentTarget == null) {
26003 return [];
26004 }
26005
26006 return [currentTarget];
26007 },
26008
26009 /**
26010 * Constant of NONE.
26011 * @type {number}
26012 */
26013 get NONE() {
26014 return 0;
26015 },
26016
26017 /**
26018 * Constant of CAPTURING_PHASE.
26019 * @type {number}
26020 */
26021 get CAPTURING_PHASE() {
26022 return 1;
26023 },
26024
26025 /**
26026 * Constant of AT_TARGET.
26027 * @type {number}
26028 */
26029 get AT_TARGET() {
26030 return 2;
26031 },
26032
26033 /**
26034 * Constant of BUBBLING_PHASE.
26035 * @type {number}
26036 */
26037 get BUBBLING_PHASE() {
26038 return 3;
26039 },
26040
26041 /**
26042 * The target of this event.
26043 * @type {number}
26044 */
26045 get eventPhase() {
26046 return pd(this).eventPhase;
26047 },
26048
26049 /**
26050 * Stop event bubbling.
26051 * @returns {void}
26052 */
26053 stopPropagation: function stopPropagation() {
26054 var data = pd(this);
26055 data.stopped = true;
26056
26057 if (typeof data.event.stopPropagation === "function") {
26058 data.event.stopPropagation();
26059 }
26060 },
26061
26062 /**
26063 * Stop event bubbling.
26064 * @returns {void}
26065 */
26066 stopImmediatePropagation: function stopImmediatePropagation() {
26067 var data = pd(this);
26068 data.stopped = true;
26069 data.immediateStopped = true;
26070
26071 if (typeof data.event.stopImmediatePropagation === "function") {
26072 data.event.stopImmediatePropagation();
26073 }
26074 },
26075
26076 /**
26077 * The flag to be bubbling.
26078 * @type {boolean}
26079 */
26080 get bubbles() {
26081 return Boolean(pd(this).event.bubbles);
26082 },
26083
26084 /**
26085 * The flag to be cancelable.
26086 * @type {boolean}
26087 */
26088 get cancelable() {
26089 return Boolean(pd(this).event.cancelable);
26090 },
26091
26092 /**
26093 * Cancel this event.
26094 * @returns {void}
26095 */
26096 preventDefault: function preventDefault() {
26097 setCancelFlag(pd(this));
26098 },
26099
26100 /**
26101 * The flag to indicate cancellation state.
26102 * @type {boolean}
26103 */
26104 get defaultPrevented() {
26105 return pd(this).canceled;
26106 },
26107
26108 /**
26109 * The flag to be composed.
26110 * @type {boolean}
26111 */
26112 get composed() {
26113 return Boolean(pd(this).event.composed);
26114 },
26115
26116 /**
26117 * The unix time of this event.
26118 * @type {number}
26119 */
26120 get timeStamp() {
26121 return pd(this).timeStamp;
26122 },
26123
26124 /**
26125 * The target of this event.
26126 * @type {EventTarget}
26127 * @deprecated
26128 */
26129 get srcElement() {
26130 return pd(this).eventTarget;
26131 },
26132
26133 /**
26134 * The flag to stop event bubbling.
26135 * @type {boolean}
26136 * @deprecated
26137 */
26138 get cancelBubble() {
26139 return pd(this).stopped;
26140 },
26141
26142 set cancelBubble(value) {
26143 if (!value) {
26144 return;
26145 }
26146
26147 var data = pd(this);
26148 data.stopped = true;
26149
26150 if (typeof data.event.cancelBubble === "boolean") {
26151 data.event.cancelBubble = true;
26152 }
26153 },
26154
26155 /**
26156 * The flag to indicate cancellation state.
26157 * @type {boolean}
26158 * @deprecated
26159 */
26160 get returnValue() {
26161 return !pd(this).canceled;
26162 },
26163
26164 set returnValue(value) {
26165 if (!value) {
26166 setCancelFlag(pd(this));
26167 }
26168 },
26169
26170 /**
26171 * Initialize this event object. But do nothing under event dispatching.
26172 * @param {string} type The event type.
26173 * @param {boolean} [bubbles=false] The flag to be possible to bubble up.
26174 * @param {boolean} [cancelable=false] The flag to be possible to cancel.
26175 * @deprecated
26176 */
26177 initEvent: function initEvent() {// Do nothing.
26178 }
26179}; // `constructor` is not enumerable.
26180
26181(0, _defineProperty.default)(Event.prototype, "constructor", {
26182 value: Event,
26183 configurable: true,
26184 writable: true
26185}); // Ensure `event instanceof window.Event` is `true`.
26186
26187if (typeof window !== "undefined" && typeof window.Event !== "undefined") {
26188 (0, _setPrototypeOf.default)(Event.prototype, window.Event.prototype); // Make association for wrappers.
26189
26190 wrappers.set(window.Event.prototype, Event);
26191}
26192/**
26193 * Get the property descriptor to redirect a given property.
26194 * @param {string} key Property name to define property descriptor.
26195 * @returns {PropertyDescriptor} The property descriptor to redirect the property.
26196 * @private
26197 */
26198
26199
26200function defineRedirectDescriptor(key) {
26201 return {
26202 get: function get() {
26203 return pd(this).event[key];
26204 },
26205 set: function set(value) {
26206 pd(this).event[key] = value;
26207 },
26208 configurable: true,
26209 enumerable: true
26210 };
26211}
26212/**
26213 * Get the property descriptor to call a given method property.
26214 * @param {string} key Property name to define property descriptor.
26215 * @returns {PropertyDescriptor} The property descriptor to call the method property.
26216 * @private
26217 */
26218
26219
26220function defineCallDescriptor(key) {
26221 return {
26222 value: function value() {
26223 var event = pd(this).event;
26224 return event[key].apply(event, arguments);
26225 },
26226 configurable: true,
26227 enumerable: true
26228 };
26229}
26230/**
26231 * Define new wrapper class.
26232 * @param {Function} BaseEvent The base wrapper class.
26233 * @param {Object} proto The prototype of the original event.
26234 * @returns {Function} The defined wrapper class.
26235 * @private
26236 */
26237
26238
26239function defineWrapper(BaseEvent, proto) {
26240 var keys = (0, _keys.default)(proto);
26241
26242 if (keys.length === 0) {
26243 return BaseEvent;
26244 }
26245 /** CustomEvent */
26246
26247
26248 function CustomEvent(eventTarget, event) {
26249 BaseEvent.call(this, eventTarget, event);
26250 }
26251
26252 CustomEvent.prototype = Object.create(BaseEvent.prototype, {
26253 constructor: {
26254 value: CustomEvent,
26255 configurable: true,
26256 writable: true
26257 }
26258 }); // Define accessors.
26259
26260 for (var i = 0; i < keys.length; ++i) {
26261 var key = keys[i];
26262
26263 if (!(key in BaseEvent.prototype)) {
26264 var descriptor = (0, _getOwnPropertyDescriptor.default)(proto, key);
26265 var isFunc = typeof descriptor.value === "function";
26266 (0, _defineProperty.default)(CustomEvent.prototype, key, isFunc ? defineCallDescriptor(key) : defineRedirectDescriptor(key));
26267 }
26268 }
26269
26270 return CustomEvent;
26271}
26272/**
26273 * Get the wrapper class of a given prototype.
26274 * @param {Object} proto The prototype of the original event to get its wrapper.
26275 * @returns {Function} The wrapper class.
26276 * @private
26277 */
26278
26279
26280function getWrapper(proto) {
26281 if (proto == null || proto === Object.prototype) {
26282 return Event;
26283 }
26284
26285 var wrapper = wrappers.get(proto);
26286
26287 if (wrapper == null) {
26288 wrapper = defineWrapper(getWrapper((0, _getPrototypeOf.default)(proto)), proto);
26289 wrappers.set(proto, wrapper);
26290 }
26291
26292 return wrapper;
26293}
26294/**
26295 * Wrap a given event to management a dispatching.
26296 * @param {EventTarget} eventTarget The event target of this dispatching.
26297 * @param {Object} event The event to wrap.
26298 * @returns {Event} The wrapper instance.
26299 * @private
26300 */
26301
26302
26303function wrapEvent(eventTarget, event) {
26304 var Wrapper = getWrapper((0, _getPrototypeOf.default)(event));
26305 return new Wrapper(eventTarget, event);
26306}
26307/**
26308 * Get the immediateStopped flag of a given event.
26309 * @param {Event} event The event to get.
26310 * @returns {boolean} The flag to stop propagation immediately.
26311 * @private
26312 */
26313
26314
26315function isStopped(event) {
26316 return pd(event).immediateStopped;
26317}
26318/**
26319 * Set the current event phase of a given event.
26320 * @param {Event} event The event to set current target.
26321 * @param {number} eventPhase New event phase.
26322 * @returns {void}
26323 * @private
26324 */
26325
26326
26327function setEventPhase(event, eventPhase) {
26328 pd(event).eventPhase = eventPhase;
26329}
26330/**
26331 * Set the current target of a given event.
26332 * @param {Event} event The event to set current target.
26333 * @param {EventTarget|null} currentTarget New current target.
26334 * @returns {void}
26335 * @private
26336 */
26337
26338
26339function setCurrentTarget(event, currentTarget) {
26340 pd(event).currentTarget = currentTarget;
26341}
26342/**
26343 * Set a passive listener of a given event.
26344 * @param {Event} event The event to set current target.
26345 * @param {Function|null} passiveListener New passive listener.
26346 * @returns {void}
26347 * @private
26348 */
26349
26350
26351function setPassiveListener(event, passiveListener) {
26352 pd(event).passiveListener = passiveListener;
26353}
26354/**
26355 * @typedef {object} ListenerNode
26356 * @property {Function} listener
26357 * @property {1|2|3} listenerType
26358 * @property {boolean} passive
26359 * @property {boolean} once
26360 * @property {ListenerNode|null} next
26361 * @private
26362 */
26363
26364/**
26365 * @type {WeakMap<object, Map<string, ListenerNode>>}
26366 * @private
26367 */
26368
26369
26370var listenersMap = new _weakMap.default(); // Listener types
26371
26372var CAPTURE = 1;
26373var BUBBLE = 2;
26374var ATTRIBUTE = 3;
26375/**
26376 * Check whether a given value is an object or not.
26377 * @param {any} x The value to check.
26378 * @returns {boolean} `true` if the value is an object.
26379 */
26380
26381function isObject(x) {
26382 return x !== null && (0, _typeof2.default)(x) === "object"; //eslint-disable-line no-restricted-syntax
26383}
26384/**
26385 * Get listeners.
26386 * @param {EventTarget} eventTarget The event target to get.
26387 * @returns {Map<string, ListenerNode>} The listeners.
26388 * @private
26389 */
26390
26391
26392function getListeners(eventTarget) {
26393 var listeners = listenersMap.get(eventTarget);
26394
26395 if (listeners == null) {
26396 throw new TypeError("'this' is expected an EventTarget object, but got another value.");
26397 }
26398
26399 return listeners;
26400}
26401/**
26402 * Get the property descriptor for the event attribute of a given event.
26403 * @param {string} eventName The event name to get property descriptor.
26404 * @returns {PropertyDescriptor} The property descriptor.
26405 * @private
26406 */
26407
26408
26409function defineEventAttributeDescriptor(eventName) {
26410 return {
26411 get: function get() {
26412 var listeners = getListeners(this);
26413 var node = listeners.get(eventName);
26414
26415 while (node != null) {
26416 if (node.listenerType === ATTRIBUTE) {
26417 return node.listener;
26418 }
26419
26420 node = node.next;
26421 }
26422
26423 return null;
26424 },
26425 set: function set(listener) {
26426 if (typeof listener !== "function" && !isObject(listener)) {
26427 listener = null; // eslint-disable-line no-param-reassign
26428 }
26429
26430 var listeners = getListeners(this); // Traverse to the tail while removing old value.
26431
26432 var prev = null;
26433 var node = listeners.get(eventName);
26434
26435 while (node != null) {
26436 if (node.listenerType === ATTRIBUTE) {
26437 // Remove old value.
26438 if (prev !== null) {
26439 prev.next = node.next;
26440 } else if (node.next !== null) {
26441 listeners.set(eventName, node.next);
26442 } else {
26443 listeners.delete(eventName);
26444 }
26445 } else {
26446 prev = node;
26447 }
26448
26449 node = node.next;
26450 } // Add new value.
26451
26452
26453 if (listener !== null) {
26454 var newNode = {
26455 listener: listener,
26456 listenerType: ATTRIBUTE,
26457 passive: false,
26458 once: false,
26459 next: null
26460 };
26461
26462 if (prev === null) {
26463 listeners.set(eventName, newNode);
26464 } else {
26465 prev.next = newNode;
26466 }
26467 }
26468 },
26469 configurable: true,
26470 enumerable: true
26471 };
26472}
26473/**
26474 * Define an event attribute (e.g. `eventTarget.onclick`).
26475 * @param {Object} eventTargetPrototype The event target prototype to define an event attrbite.
26476 * @param {string} eventName The event name to define.
26477 * @returns {void}
26478 */
26479
26480
26481function defineEventAttribute(eventTargetPrototype, eventName) {
26482 (0, _defineProperty.default)(eventTargetPrototype, "on".concat(eventName), defineEventAttributeDescriptor(eventName));
26483}
26484/**
26485 * Define a custom EventTarget with event attributes.
26486 * @param {string[]} eventNames Event names for event attributes.
26487 * @returns {EventTarget} The custom EventTarget.
26488 * @private
26489 */
26490
26491
26492function defineCustomEventTarget(eventNames) {
26493 /** CustomEventTarget */
26494 function CustomEventTarget() {
26495 EventTarget.call(this);
26496 }
26497
26498 CustomEventTarget.prototype = Object.create(EventTarget.prototype, {
26499 constructor: {
26500 value: CustomEventTarget,
26501 configurable: true,
26502 writable: true
26503 }
26504 });
26505
26506 for (var i = 0; i < eventNames.length; ++i) {
26507 defineEventAttribute(CustomEventTarget.prototype, eventNames[i]);
26508 }
26509
26510 return CustomEventTarget;
26511}
26512/**
26513 * EventTarget.
26514 *
26515 * - This is constructor if no arguments.
26516 * - This is a function which returns a CustomEventTarget constructor if there are arguments.
26517 *
26518 * For example:
26519 *
26520 * class A extends EventTarget {}
26521 * class B extends EventTarget("message") {}
26522 * class C extends EventTarget("message", "error") {}
26523 * class D extends EventTarget(["message", "error"]) {}
26524 */
26525
26526
26527function EventTarget() {
26528 /*eslint-disable consistent-return */
26529 if (this instanceof EventTarget) {
26530 listenersMap.set(this, new _map.default());
26531 return;
26532 }
26533
26534 if (arguments.length === 1 && Array.isArray(arguments[0])) {
26535 return defineCustomEventTarget(arguments[0]);
26536 }
26537
26538 if (arguments.length > 0) {
26539 var types = new Array(arguments.length);
26540
26541 for (var i = 0; i < arguments.length; ++i) {
26542 types[i] = arguments[i];
26543 }
26544
26545 return defineCustomEventTarget(types);
26546 }
26547
26548 throw new TypeError("Cannot call a class as a function");
26549 /*eslint-enable consistent-return */
26550} // Should be enumerable, but class methods are not enumerable.
26551
26552
26553EventTarget.prototype = {
26554 /**
26555 * Add a given listener to this event target.
26556 * @param {string} eventName The event name to add.
26557 * @param {Function} listener The listener to add.
26558 * @param {boolean|{capture?:boolean,passive?:boolean,once?:boolean}} [options] The options for this listener.
26559 * @returns {void}
26560 */
26561 addEventListener: function addEventListener(eventName, listener, options) {
26562 if (listener == null) {
26563 return;
26564 }
26565
26566 if (typeof listener !== "function" && !isObject(listener)) {
26567 throw new TypeError("'listener' should be a function or an object.");
26568 }
26569
26570 var listeners = getListeners(this);
26571 var optionsIsObj = isObject(options);
26572 var capture = optionsIsObj ? Boolean(options.capture) : Boolean(options);
26573 var listenerType = capture ? CAPTURE : BUBBLE;
26574 var newNode = {
26575 listener: listener,
26576 listenerType: listenerType,
26577 passive: optionsIsObj && Boolean(options.passive),
26578 once: optionsIsObj && Boolean(options.once),
26579 next: null
26580 }; // Set it as the first node if the first node is null.
26581
26582 var node = listeners.get(eventName);
26583
26584 if (node === undefined) {
26585 listeners.set(eventName, newNode);
26586 return;
26587 } // Traverse to the tail while checking duplication..
26588
26589
26590 var prev = null;
26591
26592 while (node != null) {
26593 if (node.listener === listener && node.listenerType === listenerType) {
26594 // Should ignore duplication.
26595 return;
26596 }
26597
26598 prev = node;
26599 node = node.next;
26600 } // Add it.
26601
26602
26603 prev.next = newNode;
26604 },
26605
26606 /**
26607 * Remove a given listener from this event target.
26608 * @param {string} eventName The event name to remove.
26609 * @param {Function} listener The listener to remove.
26610 * @param {boolean|{capture?:boolean,passive?:boolean,once?:boolean}} [options] The options for this listener.
26611 * @returns {void}
26612 */
26613 removeEventListener: function removeEventListener(eventName, listener, options) {
26614 if (listener == null) {
26615 return;
26616 }
26617
26618 var listeners = getListeners(this);
26619 var capture = isObject(options) ? Boolean(options.capture) : Boolean(options);
26620 var listenerType = capture ? CAPTURE : BUBBLE;
26621 var prev = null;
26622 var node = listeners.get(eventName);
26623
26624 while (node != null) {
26625 if (node.listener === listener && node.listenerType === listenerType) {
26626 if (prev !== null) {
26627 prev.next = node.next;
26628 } else if (node.next !== null) {
26629 listeners.set(eventName, node.next);
26630 } else {
26631 listeners.delete(eventName);
26632 }
26633
26634 return;
26635 }
26636
26637 prev = node;
26638 node = node.next;
26639 }
26640 },
26641
26642 /**
26643 * Dispatch a given event.
26644 * @param {Event|{type:string}} event The event to dispatch.
26645 * @returns {boolean} `false` if canceled.
26646 */
26647 dispatchEvent: function dispatchEvent(event) {
26648 if (event == null || typeof event.type !== "string") {
26649 throw new TypeError('"event.type" should be a string.');
26650 } // If listeners aren't registered, terminate.
26651
26652
26653 var listeners = getListeners(this);
26654 var eventName = event.type;
26655 var node = listeners.get(eventName);
26656
26657 if (node == null) {
26658 return true;
26659 } // Since we cannot rewrite several properties, so wrap object.
26660
26661
26662 var wrappedEvent = wrapEvent(this, event); // This doesn't process capturing phase and bubbling phase.
26663 // This isn't participating in a tree.
26664
26665 var prev = null;
26666
26667 while (node != null) {
26668 // Remove this listener if it's once
26669 if (node.once) {
26670 if (prev !== null) {
26671 prev.next = node.next;
26672 } else if (node.next !== null) {
26673 listeners.set(eventName, node.next);
26674 } else {
26675 listeners.delete(eventName);
26676 }
26677 } else {
26678 prev = node;
26679 } // Call this listener
26680
26681
26682 setPassiveListener(wrappedEvent, node.passive ? node.listener : null);
26683
26684 if (typeof node.listener === "function") {
26685 try {
26686 node.listener.call(this, wrappedEvent);
26687 } catch (err) {
26688 if (typeof console !== "undefined" && typeof console.error === "function") {
26689 console.error(err);
26690 }
26691 }
26692 } else if (node.listenerType !== ATTRIBUTE && typeof node.listener.handleEvent === "function") {
26693 node.listener.handleEvent(wrappedEvent);
26694 } // Break if `event.stopImmediatePropagation` was called.
26695
26696
26697 if (isStopped(wrappedEvent)) {
26698 break;
26699 }
26700
26701 node = node.next;
26702 }
26703
26704 setPassiveListener(wrappedEvent, null);
26705 setEventPhase(wrappedEvent, 0);
26706 setCurrentTarget(wrappedEvent, null);
26707 return !wrappedEvent.defaultPrevented;
26708 }
26709}; // `constructor` is not enumerable.
26710
26711(0, _defineProperty.default)(EventTarget.prototype, "constructor", {
26712 value: EventTarget,
26713 configurable: true,
26714 writable: true
26715}); // Ensure `eventTarget instanceof window.EventTarget` is `true`.
26716
26717if (typeof window !== "undefined" && typeof window.EventTarget !== "undefined") {
26718 (0, _setPrototypeOf.default)(EventTarget.prototype, window.EventTarget.prototype);
26719}
26720
26721var WS =
26722/** @class */
26723function (_super) {
26724 __extends$1(WS, _super);
26725
26726 function WS(url, protocol) {
26727 var _this = _super.call(this) || this;
26728
26729 _this._readyState = WS.CLOSED;
26730
26731 if (!url) {
26732 throw new TypeError("Failed to construct 'WebSocket': url required");
26733 }
26734
26735 _this._url = url;
26736 _this._protocol = protocol;
26737 return _this;
26738 }
26739
26740 (0, _defineProperty.default)(WS.prototype, "url", {
26741 get: function get() {
26742 return this._url;
26743 },
26744 enumerable: false,
26745 configurable: true
26746 });
26747 (0, _defineProperty.default)(WS.prototype, "protocol", {
26748 get: function get() {
26749 return this._protocol;
26750 },
26751 enumerable: false,
26752 configurable: true
26753 });
26754 (0, _defineProperty.default)(WS.prototype, "readyState", {
26755 get: function get() {
26756 return this._readyState;
26757 },
26758 enumerable: false,
26759 configurable: true
26760 });
26761 WS.CONNECTING = 0;
26762 WS.OPEN = 1;
26763 WS.CLOSING = 2;
26764 WS.CLOSED = 3;
26765 return WS;
26766}(EventTarget("open", "error", "message", "close"));
26767
26768var WechatWS =
26769/** @class */
26770function (_super) {
26771 __extends$1(WechatWS, _super);
26772
26773 function WechatWS(url, protocol) {
26774 var _this = _super.call(this, url, protocol) || this;
26775
26776 if (protocol && !(wx.canIUse && wx.canIUse("connectSocket.object.protocols"))) {
26777 throw new Error("subprotocol not supported in weapp");
26778 }
26779
26780 _this._readyState = WS.CONNECTING;
26781
26782 var errorHandler = function errorHandler(event) {
26783 _this._readyState = WS.CLOSED;
26784
26785 _this.dispatchEvent({
26786 type: "error",
26787 message: event.errMsg
26788 });
26789 };
26790
26791 var socketTask = wx.connectSocket({
26792 url: url,
26793 protocols: _this._protocol === undefined || Array.isArray(_this._protocol) ? _this._protocol : [_this._protocol],
26794 fail: function fail(error) {
26795 return setTimeout(function () {
26796 return errorHandler(error);
26797 }, 0);
26798 }
26799 });
26800 _this._socketTask = socketTask;
26801 socketTask.onOpen(function () {
26802 _this._readyState = WS.OPEN;
26803
26804 _this.dispatchEvent({
26805 type: "open"
26806 });
26807 });
26808 socketTask.onError(errorHandler);
26809 socketTask.onMessage(function (event) {
26810 var data = event.data;
26811
26812 _this.dispatchEvent({
26813 data: data,
26814 type: "message"
26815 });
26816 });
26817 socketTask.onClose(function (event) {
26818 _this._readyState = WS.CLOSED;
26819 var code = event.code,
26820 reason = event.reason;
26821
26822 _this.dispatchEvent({
26823 code: code,
26824 reason: reason,
26825 type: "close"
26826 });
26827 });
26828 return _this;
26829 }
26830
26831 WechatWS.prototype.close = function () {
26832 if (this.readyState === WS.CLOSED) return;
26833
26834 if (this.readyState === WS.CONNECTING) {
26835 console.warn("close WebSocket which is connecting might not work");
26836 }
26837
26838 this._socketTask.close({});
26839 };
26840
26841 WechatWS.prototype.send = function (data) {
26842 if (this.readyState !== WS.OPEN) {
26843 throw new Error("INVALID_STATE_ERR");
26844 }
26845
26846 if (!(typeof data === "string" || data instanceof ArrayBuffer)) {
26847 throw new TypeError("only String/ArrayBuffer supported");
26848 }
26849
26850 this._socketTask.send({
26851 data: data
26852 });
26853 };
26854
26855 return WechatWS;
26856}(WS);
26857
26858var WebSocket = WechatWS;
26859var platformInfo = {
26860 name: "Weapp"
26861};
26862exports.WebSocket = WebSocket;
26863exports.getAuthInfo = getAuthInfo;
26864exports.platformInfo = platformInfo;
26865exports.request = request;
26866exports.storage = storage;
26867exports.upload = upload;
26868
26869/***/ }),
26870/* 547 */
26871/***/ (function(module, exports, __webpack_require__) {
26872
26873module.exports = __webpack_require__(548);
26874
26875/***/ }),
26876/* 548 */
26877/***/ (function(module, exports, __webpack_require__) {
26878
26879var parent = __webpack_require__(549);
26880
26881module.exports = parent;
26882
26883
26884/***/ }),
26885/* 549 */
26886/***/ (function(module, exports, __webpack_require__) {
26887
26888__webpack_require__(550);
26889var path = __webpack_require__(10);
26890
26891module.exports = path.Object.assign;
26892
26893
26894/***/ }),
26895/* 550 */
26896/***/ (function(module, exports, __webpack_require__) {
26897
26898var $ = __webpack_require__(0);
26899var assign = __webpack_require__(551);
26900
26901// `Object.assign` method
26902// https://tc39.es/ecma262/#sec-object.assign
26903// eslint-disable-next-line es-x/no-object-assign -- required for testing
26904$({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
26905 assign: assign
26906});
26907
26908
26909/***/ }),
26910/* 551 */
26911/***/ (function(module, exports, __webpack_require__) {
26912
26913"use strict";
26914
26915var DESCRIPTORS = __webpack_require__(16);
26916var uncurryThis = __webpack_require__(4);
26917var call = __webpack_require__(13);
26918var fails = __webpack_require__(3);
26919var objectKeys = __webpack_require__(98);
26920var getOwnPropertySymbolsModule = __webpack_require__(97);
26921var propertyIsEnumerableModule = __webpack_require__(113);
26922var toObject = __webpack_require__(34);
26923var IndexedObject = __webpack_require__(114);
26924
26925// eslint-disable-next-line es-x/no-object-assign -- safe
26926var $assign = Object.assign;
26927// eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
26928var defineProperty = Object.defineProperty;
26929var concat = uncurryThis([].concat);
26930
26931// `Object.assign` method
26932// https://tc39.es/ecma262/#sec-object.assign
26933module.exports = !$assign || fails(function () {
26934 // should have correct order of operations (Edge bug)
26935 if (DESCRIPTORS && $assign({ b: 1 }, $assign(defineProperty({}, 'a', {
26936 enumerable: true,
26937 get: function () {
26938 defineProperty(this, 'b', {
26939 value: 3,
26940 enumerable: false
26941 });
26942 }
26943 }), { b: 2 })).b !== 1) return true;
26944 // should work with symbols and should have deterministic property order (V8 bug)
26945 var A = {};
26946 var B = {};
26947 // eslint-disable-next-line es-x/no-symbol -- safe
26948 var symbol = Symbol();
26949 var alphabet = 'abcdefghijklmnopqrst';
26950 A[symbol] = 7;
26951 alphabet.split('').forEach(function (chr) { B[chr] = chr; });
26952 return $assign({}, A)[symbol] != 7 || objectKeys($assign({}, B)).join('') != alphabet;
26953}) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
26954 var T = toObject(target);
26955 var argumentsLength = arguments.length;
26956 var index = 1;
26957 var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
26958 var propertyIsEnumerable = propertyIsEnumerableModule.f;
26959 while (argumentsLength > index) {
26960 var S = IndexedObject(arguments[index++]);
26961 var keys = getOwnPropertySymbols ? concat(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S);
26962 var length = keys.length;
26963 var j = 0;
26964 var key;
26965 while (length > j) {
26966 key = keys[j++];
26967 if (!DESCRIPTORS || call(propertyIsEnumerable, S, key)) T[key] = S[key];
26968 }
26969 } return T;
26970} : $assign;
26971
26972
26973/***/ }),
26974/* 552 */
26975/***/ (function(module, exports, __webpack_require__) {
26976
26977module.exports = __webpack_require__(553);
26978
26979/***/ }),
26980/* 553 */
26981/***/ (function(module, exports, __webpack_require__) {
26982
26983var parent = __webpack_require__(554);
26984
26985module.exports = parent;
26986
26987
26988/***/ }),
26989/* 554 */
26990/***/ (function(module, exports, __webpack_require__) {
26991
26992__webpack_require__(233);
26993var path = __webpack_require__(10);
26994
26995module.exports = path.Object.getOwnPropertySymbols;
26996
26997
26998/***/ }),
26999/* 555 */
27000/***/ (function(module, exports, __webpack_require__) {
27001
27002module.exports = __webpack_require__(238);
27003
27004/***/ }),
27005/* 556 */
27006/***/ (function(module, exports, __webpack_require__) {
27007
27008module.exports = __webpack_require__(557);
27009
27010/***/ }),
27011/* 557 */
27012/***/ (function(module, exports, __webpack_require__) {
27013
27014var parent = __webpack_require__(558);
27015__webpack_require__(51);
27016
27017module.exports = parent;
27018
27019
27020/***/ }),
27021/* 558 */
27022/***/ (function(module, exports, __webpack_require__) {
27023
27024__webpack_require__(48);
27025__webpack_require__(60);
27026__webpack_require__(559);
27027var path = __webpack_require__(10);
27028
27029module.exports = path.WeakMap;
27030
27031
27032/***/ }),
27033/* 559 */
27034/***/ (function(module, exports, __webpack_require__) {
27035
27036// TODO: Remove this module from `core-js@4` since it's replaced to module below
27037__webpack_require__(560);
27038
27039
27040/***/ }),
27041/* 560 */
27042/***/ (function(module, exports, __webpack_require__) {
27043
27044"use strict";
27045
27046var global = __webpack_require__(6);
27047var uncurryThis = __webpack_require__(4);
27048var defineBuiltIns = __webpack_require__(146);
27049var InternalMetadataModule = __webpack_require__(111);
27050var collection = __webpack_require__(248);
27051var collectionWeak = __webpack_require__(563);
27052var isObject = __webpack_require__(11);
27053var isExtensible = __webpack_require__(247);
27054var enforceInternalState = __webpack_require__(38).enforce;
27055var NATIVE_WEAK_MAP = __webpack_require__(160);
27056
27057var IS_IE11 = !global.ActiveXObject && 'ActiveXObject' in global;
27058var InternalWeakMap;
27059
27060var wrapper = function (init) {
27061 return function WeakMap() {
27062 return init(this, arguments.length ? arguments[0] : undefined);
27063 };
27064};
27065
27066// `WeakMap` constructor
27067// https://tc39.es/ecma262/#sec-weakmap-constructor
27068var $WeakMap = collection('WeakMap', wrapper, collectionWeak);
27069
27070// IE11 WeakMap frozen keys fix
27071// We can't use feature detection because it crash some old IE builds
27072// https://github.com/zloirock/core-js/issues/485
27073if (NATIVE_WEAK_MAP && IS_IE11) {
27074 InternalWeakMap = collectionWeak.getConstructor(wrapper, 'WeakMap', true);
27075 InternalMetadataModule.enable();
27076 var WeakMapPrototype = $WeakMap.prototype;
27077 var nativeDelete = uncurryThis(WeakMapPrototype['delete']);
27078 var nativeHas = uncurryThis(WeakMapPrototype.has);
27079 var nativeGet = uncurryThis(WeakMapPrototype.get);
27080 var nativeSet = uncurryThis(WeakMapPrototype.set);
27081 defineBuiltIns(WeakMapPrototype, {
27082 'delete': function (key) {
27083 if (isObject(key) && !isExtensible(key)) {
27084 var state = enforceInternalState(this);
27085 if (!state.frozen) state.frozen = new InternalWeakMap();
27086 return nativeDelete(this, key) || state.frozen['delete'](key);
27087 } return nativeDelete(this, key);
27088 },
27089 has: function has(key) {
27090 if (isObject(key) && !isExtensible(key)) {
27091 var state = enforceInternalState(this);
27092 if (!state.frozen) state.frozen = new InternalWeakMap();
27093 return nativeHas(this, key) || state.frozen.has(key);
27094 } return nativeHas(this, key);
27095 },
27096 get: function get(key) {
27097 if (isObject(key) && !isExtensible(key)) {
27098 var state = enforceInternalState(this);
27099 if (!state.frozen) state.frozen = new InternalWeakMap();
27100 return nativeHas(this, key) ? nativeGet(this, key) : state.frozen.get(key);
27101 } return nativeGet(this, key);
27102 },
27103 set: function set(key, value) {
27104 if (isObject(key) && !isExtensible(key)) {
27105 var state = enforceInternalState(this);
27106 if (!state.frozen) state.frozen = new InternalWeakMap();
27107 nativeHas(this, key) ? nativeSet(this, key, value) : state.frozen.set(key, value);
27108 } else nativeSet(this, key, value);
27109 return this;
27110 }
27111 });
27112}
27113
27114
27115/***/ }),
27116/* 561 */
27117/***/ (function(module, exports, __webpack_require__) {
27118
27119// FF26- bug: ArrayBuffers are non-extensible, but Object.isExtensible does not report it
27120var fails = __webpack_require__(3);
27121
27122module.exports = fails(function () {
27123 if (typeof ArrayBuffer == 'function') {
27124 var buffer = new ArrayBuffer(8);
27125 // eslint-disable-next-line es-x/no-object-isextensible, es-x/no-object-defineproperty -- safe
27126 if (Object.isExtensible(buffer)) Object.defineProperty(buffer, 'a', { value: 8 });
27127 }
27128});
27129
27130
27131/***/ }),
27132/* 562 */
27133/***/ (function(module, exports, __webpack_require__) {
27134
27135var fails = __webpack_require__(3);
27136
27137module.exports = !fails(function () {
27138 // eslint-disable-next-line es-x/no-object-isextensible, es-x/no-object-preventextensions -- required for testing
27139 return Object.isExtensible(Object.preventExtensions({}));
27140});
27141
27142
27143/***/ }),
27144/* 563 */
27145/***/ (function(module, exports, __webpack_require__) {
27146
27147"use strict";
27148
27149var uncurryThis = __webpack_require__(4);
27150var defineBuiltIns = __webpack_require__(146);
27151var getWeakData = __webpack_require__(111).getWeakData;
27152var anObject = __webpack_require__(19);
27153var isObject = __webpack_require__(11);
27154var anInstance = __webpack_require__(100);
27155var iterate = __webpack_require__(37);
27156var ArrayIterationModule = __webpack_require__(66);
27157var hasOwn = __webpack_require__(14);
27158var InternalStateModule = __webpack_require__(38);
27159
27160var setInternalState = InternalStateModule.set;
27161var internalStateGetterFor = InternalStateModule.getterFor;
27162var find = ArrayIterationModule.find;
27163var findIndex = ArrayIterationModule.findIndex;
27164var splice = uncurryThis([].splice);
27165var id = 0;
27166
27167// fallback for uncaught frozen keys
27168var uncaughtFrozenStore = function (store) {
27169 return store.frozen || (store.frozen = new UncaughtFrozenStore());
27170};
27171
27172var UncaughtFrozenStore = function () {
27173 this.entries = [];
27174};
27175
27176var findUncaughtFrozen = function (store, key) {
27177 return find(store.entries, function (it) {
27178 return it[0] === key;
27179 });
27180};
27181
27182UncaughtFrozenStore.prototype = {
27183 get: function (key) {
27184 var entry = findUncaughtFrozen(this, key);
27185 if (entry) return entry[1];
27186 },
27187 has: function (key) {
27188 return !!findUncaughtFrozen(this, key);
27189 },
27190 set: function (key, value) {
27191 var entry = findUncaughtFrozen(this, key);
27192 if (entry) entry[1] = value;
27193 else this.entries.push([key, value]);
27194 },
27195 'delete': function (key) {
27196 var index = findIndex(this.entries, function (it) {
27197 return it[0] === key;
27198 });
27199 if (~index) splice(this.entries, index, 1);
27200 return !!~index;
27201 }
27202};
27203
27204module.exports = {
27205 getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {
27206 var Constructor = wrapper(function (that, iterable) {
27207 anInstance(that, Prototype);
27208 setInternalState(that, {
27209 type: CONSTRUCTOR_NAME,
27210 id: id++,
27211 frozen: undefined
27212 });
27213 if (iterable != undefined) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
27214 });
27215
27216 var Prototype = Constructor.prototype;
27217
27218 var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
27219
27220 var define = function (that, key, value) {
27221 var state = getInternalState(that);
27222 var data = getWeakData(anObject(key), true);
27223 if (data === true) uncaughtFrozenStore(state).set(key, value);
27224 else data[state.id] = value;
27225 return that;
27226 };
27227
27228 defineBuiltIns(Prototype, {
27229 // `{ WeakMap, WeakSet }.prototype.delete(key)` methods
27230 // https://tc39.es/ecma262/#sec-weakmap.prototype.delete
27231 // https://tc39.es/ecma262/#sec-weakset.prototype.delete
27232 'delete': function (key) {
27233 var state = getInternalState(this);
27234 if (!isObject(key)) return false;
27235 var data = getWeakData(key);
27236 if (data === true) return uncaughtFrozenStore(state)['delete'](key);
27237 return data && hasOwn(data, state.id) && delete data[state.id];
27238 },
27239 // `{ WeakMap, WeakSet }.prototype.has(key)` methods
27240 // https://tc39.es/ecma262/#sec-weakmap.prototype.has
27241 // https://tc39.es/ecma262/#sec-weakset.prototype.has
27242 has: function has(key) {
27243 var state = getInternalState(this);
27244 if (!isObject(key)) return false;
27245 var data = getWeakData(key);
27246 if (data === true) return uncaughtFrozenStore(state).has(key);
27247 return data && hasOwn(data, state.id);
27248 }
27249 });
27250
27251 defineBuiltIns(Prototype, IS_MAP ? {
27252 // `WeakMap.prototype.get(key)` method
27253 // https://tc39.es/ecma262/#sec-weakmap.prototype.get
27254 get: function get(key) {
27255 var state = getInternalState(this);
27256 if (isObject(key)) {
27257 var data = getWeakData(key);
27258 if (data === true) return uncaughtFrozenStore(state).get(key);
27259 return data ? data[state.id] : undefined;
27260 }
27261 },
27262 // `WeakMap.prototype.set(key, value)` method
27263 // https://tc39.es/ecma262/#sec-weakmap.prototype.set
27264 set: function set(key, value) {
27265 return define(this, key, value);
27266 }
27267 } : {
27268 // `WeakSet.prototype.add(value)` method
27269 // https://tc39.es/ecma262/#sec-weakset.prototype.add
27270 add: function add(value) {
27271 return define(this, value, true);
27272 }
27273 });
27274
27275 return Constructor;
27276 }
27277};
27278
27279
27280/***/ }),
27281/* 564 */
27282/***/ (function(module, exports, __webpack_require__) {
27283
27284module.exports = __webpack_require__(565);
27285
27286/***/ }),
27287/* 565 */
27288/***/ (function(module, exports, __webpack_require__) {
27289
27290var parent = __webpack_require__(566);
27291__webpack_require__(51);
27292
27293module.exports = parent;
27294
27295
27296/***/ }),
27297/* 566 */
27298/***/ (function(module, exports, __webpack_require__) {
27299
27300__webpack_require__(48);
27301__webpack_require__(567);
27302__webpack_require__(60);
27303__webpack_require__(78);
27304var path = __webpack_require__(10);
27305
27306module.exports = path.Map;
27307
27308
27309/***/ }),
27310/* 567 */
27311/***/ (function(module, exports, __webpack_require__) {
27312
27313// TODO: Remove this module from `core-js@4` since it's replaced to module below
27314__webpack_require__(568);
27315
27316
27317/***/ }),
27318/* 568 */
27319/***/ (function(module, exports, __webpack_require__) {
27320
27321"use strict";
27322
27323var collection = __webpack_require__(248);
27324var collectionStrong = __webpack_require__(569);
27325
27326// `Map` constructor
27327// https://tc39.es/ecma262/#sec-map-objects
27328collection('Map', function (init) {
27329 return function Map() { return init(this, arguments.length ? arguments[0] : undefined); };
27330}, collectionStrong);
27331
27332
27333/***/ }),
27334/* 569 */
27335/***/ (function(module, exports, __webpack_require__) {
27336
27337"use strict";
27338
27339var defineProperty = __webpack_require__(22).f;
27340var create = __webpack_require__(47);
27341var defineBuiltIns = __webpack_require__(146);
27342var bind = __webpack_require__(45);
27343var anInstance = __webpack_require__(100);
27344var iterate = __webpack_require__(37);
27345var defineIterator = __webpack_require__(124);
27346var setSpecies = __webpack_require__(162);
27347var DESCRIPTORS = __webpack_require__(16);
27348var fastKey = __webpack_require__(111).fastKey;
27349var InternalStateModule = __webpack_require__(38);
27350
27351var setInternalState = InternalStateModule.set;
27352var internalStateGetterFor = InternalStateModule.getterFor;
27353
27354module.exports = {
27355 getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {
27356 var Constructor = wrapper(function (that, iterable) {
27357 anInstance(that, Prototype);
27358 setInternalState(that, {
27359 type: CONSTRUCTOR_NAME,
27360 index: create(null),
27361 first: undefined,
27362 last: undefined,
27363 size: 0
27364 });
27365 if (!DESCRIPTORS) that.size = 0;
27366 if (iterable != undefined) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
27367 });
27368
27369 var Prototype = Constructor.prototype;
27370
27371 var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
27372
27373 var define = function (that, key, value) {
27374 var state = getInternalState(that);
27375 var entry = getEntry(that, key);
27376 var previous, index;
27377 // change existing entry
27378 if (entry) {
27379 entry.value = value;
27380 // create new entry
27381 } else {
27382 state.last = entry = {
27383 index: index = fastKey(key, true),
27384 key: key,
27385 value: value,
27386 previous: previous = state.last,
27387 next: undefined,
27388 removed: false
27389 };
27390 if (!state.first) state.first = entry;
27391 if (previous) previous.next = entry;
27392 if (DESCRIPTORS) state.size++;
27393 else that.size++;
27394 // add to index
27395 if (index !== 'F') state.index[index] = entry;
27396 } return that;
27397 };
27398
27399 var getEntry = function (that, key) {
27400 var state = getInternalState(that);
27401 // fast case
27402 var index = fastKey(key);
27403 var entry;
27404 if (index !== 'F') return state.index[index];
27405 // frozen object case
27406 for (entry = state.first; entry; entry = entry.next) {
27407 if (entry.key == key) return entry;
27408 }
27409 };
27410
27411 defineBuiltIns(Prototype, {
27412 // `{ Map, Set }.prototype.clear()` methods
27413 // https://tc39.es/ecma262/#sec-map.prototype.clear
27414 // https://tc39.es/ecma262/#sec-set.prototype.clear
27415 clear: function clear() {
27416 var that = this;
27417 var state = getInternalState(that);
27418 var data = state.index;
27419 var entry = state.first;
27420 while (entry) {
27421 entry.removed = true;
27422 if (entry.previous) entry.previous = entry.previous.next = undefined;
27423 delete data[entry.index];
27424 entry = entry.next;
27425 }
27426 state.first = state.last = undefined;
27427 if (DESCRIPTORS) state.size = 0;
27428 else that.size = 0;
27429 },
27430 // `{ Map, Set }.prototype.delete(key)` methods
27431 // https://tc39.es/ecma262/#sec-map.prototype.delete
27432 // https://tc39.es/ecma262/#sec-set.prototype.delete
27433 'delete': function (key) {
27434 var that = this;
27435 var state = getInternalState(that);
27436 var entry = getEntry(that, key);
27437 if (entry) {
27438 var next = entry.next;
27439 var prev = entry.previous;
27440 delete state.index[entry.index];
27441 entry.removed = true;
27442 if (prev) prev.next = next;
27443 if (next) next.previous = prev;
27444 if (state.first == entry) state.first = next;
27445 if (state.last == entry) state.last = prev;
27446 if (DESCRIPTORS) state.size--;
27447 else that.size--;
27448 } return !!entry;
27449 },
27450 // `{ Map, Set }.prototype.forEach(callbackfn, thisArg = undefined)` methods
27451 // https://tc39.es/ecma262/#sec-map.prototype.foreach
27452 // https://tc39.es/ecma262/#sec-set.prototype.foreach
27453 forEach: function forEach(callbackfn /* , that = undefined */) {
27454 var state = getInternalState(this);
27455 var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined);
27456 var entry;
27457 while (entry = entry ? entry.next : state.first) {
27458 boundFunction(entry.value, entry.key, this);
27459 // revert to the last existing entry
27460 while (entry && entry.removed) entry = entry.previous;
27461 }
27462 },
27463 // `{ Map, Set}.prototype.has(key)` methods
27464 // https://tc39.es/ecma262/#sec-map.prototype.has
27465 // https://tc39.es/ecma262/#sec-set.prototype.has
27466 has: function has(key) {
27467 return !!getEntry(this, key);
27468 }
27469 });
27470
27471 defineBuiltIns(Prototype, IS_MAP ? {
27472 // `Map.prototype.get(key)` method
27473 // https://tc39.es/ecma262/#sec-map.prototype.get
27474 get: function get(key) {
27475 var entry = getEntry(this, key);
27476 return entry && entry.value;
27477 },
27478 // `Map.prototype.set(key, value)` method
27479 // https://tc39.es/ecma262/#sec-map.prototype.set
27480 set: function set(key, value) {
27481 return define(this, key === 0 ? 0 : key, value);
27482 }
27483 } : {
27484 // `Set.prototype.add(value)` method
27485 // https://tc39.es/ecma262/#sec-set.prototype.add
27486 add: function add(value) {
27487 return define(this, value = value === 0 ? 0 : value, value);
27488 }
27489 });
27490 if (DESCRIPTORS) defineProperty(Prototype, 'size', {
27491 get: function () {
27492 return getInternalState(this).size;
27493 }
27494 });
27495 return Constructor;
27496 },
27497 setStrong: function (Constructor, CONSTRUCTOR_NAME, IS_MAP) {
27498 var ITERATOR_NAME = CONSTRUCTOR_NAME + ' Iterator';
27499 var getInternalCollectionState = internalStateGetterFor(CONSTRUCTOR_NAME);
27500 var getInternalIteratorState = internalStateGetterFor(ITERATOR_NAME);
27501 // `{ Map, Set }.prototype.{ keys, values, entries, @@iterator }()` methods
27502 // https://tc39.es/ecma262/#sec-map.prototype.entries
27503 // https://tc39.es/ecma262/#sec-map.prototype.keys
27504 // https://tc39.es/ecma262/#sec-map.prototype.values
27505 // https://tc39.es/ecma262/#sec-map.prototype-@@iterator
27506 // https://tc39.es/ecma262/#sec-set.prototype.entries
27507 // https://tc39.es/ecma262/#sec-set.prototype.keys
27508 // https://tc39.es/ecma262/#sec-set.prototype.values
27509 // https://tc39.es/ecma262/#sec-set.prototype-@@iterator
27510 defineIterator(Constructor, CONSTRUCTOR_NAME, function (iterated, kind) {
27511 setInternalState(this, {
27512 type: ITERATOR_NAME,
27513 target: iterated,
27514 state: getInternalCollectionState(iterated),
27515 kind: kind,
27516 last: undefined
27517 });
27518 }, function () {
27519 var state = getInternalIteratorState(this);
27520 var kind = state.kind;
27521 var entry = state.last;
27522 // revert to the last existing entry
27523 while (entry && entry.removed) entry = entry.previous;
27524 // get next entry
27525 if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) {
27526 // or finish the iteration
27527 state.target = undefined;
27528 return { value: undefined, done: true };
27529 }
27530 // return step by kind
27531 if (kind == 'keys') return { value: entry.key, done: false };
27532 if (kind == 'values') return { value: entry.value, done: false };
27533 return { value: [entry.key, entry.value], done: false };
27534 }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);
27535
27536 // `{ Map, Set }.prototype[@@species]` accessors
27537 // https://tc39.es/ecma262/#sec-get-map-@@species
27538 // https://tc39.es/ecma262/#sec-get-set-@@species
27539 setSpecies(CONSTRUCTOR_NAME);
27540 }
27541};
27542
27543
27544/***/ })
27545/******/ ]);
27546});
27547//# sourceMappingURL=av-weapp.js.map
\No newline at end of file