UNPKG

818 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 = 236);
74/******/ })
75/************************************************************************/
76/******/ ([
77/* 0 */
78/***/ (function(module, exports, __webpack_require__) {
79
80"use strict";
81
82var global = __webpack_require__(9);
83var apply = __webpack_require__(62);
84var uncurryThis = __webpack_require__(6);
85var isCallable = __webpack_require__(7);
86var getOwnPropertyDescriptor = __webpack_require__(64).f;
87var isForced = __webpack_require__(142);
88var path = __webpack_require__(13);
89var bind = __webpack_require__(50);
90var createNonEnumerableProperty = __webpack_require__(36);
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, __webpack_exports__, __webpack_require__) {
188
189"use strict";
190Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
191/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__index_default_js__ = __webpack_require__(279);
192/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return __WEBPACK_IMPORTED_MODULE_0__index_default_js__["a"]; });
193/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__index_js__ = __webpack_require__(120);
194/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "VERSION", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["VERSION"]; });
195/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "restArguments", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["restArguments"]; });
196/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isObject", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isObject"]; });
197/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isNull", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isNull"]; });
198/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isUndefined", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isUndefined"]; });
199/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isBoolean", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isBoolean"]; });
200/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isElement", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isElement"]; });
201/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isString", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isString"]; });
202/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isNumber", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isNumber"]; });
203/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isDate", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isDate"]; });
204/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isRegExp", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isRegExp"]; });
205/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isError", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isError"]; });
206/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isSymbol", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isSymbol"]; });
207/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isArrayBuffer", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isArrayBuffer"]; });
208/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isDataView", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isDataView"]; });
209/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isArray", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isArray"]; });
210/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isFunction", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isFunction"]; });
211/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isArguments", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isArguments"]; });
212/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isFinite", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isFinite"]; });
213/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isNaN", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isNaN"]; });
214/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isTypedArray", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isTypedArray"]; });
215/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isEmpty"]; });
216/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isMatch", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isMatch"]; });
217/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isEqual", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isEqual"]; });
218/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isMap", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isMap"]; });
219/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isWeakMap", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isWeakMap"]; });
220/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isSet", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isSet"]; });
221/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isWeakSet", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isWeakSet"]; });
222/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "keys", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["keys"]; });
223/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "allKeys", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["allKeys"]; });
224/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "values", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["values"]; });
225/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "pairs", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["pairs"]; });
226/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "invert", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["invert"]; });
227/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "functions", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["functions"]; });
228/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "methods", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["methods"]; });
229/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "extend", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["extend"]; });
230/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "extendOwn", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["extendOwn"]; });
231/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "assign", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["assign"]; });
232/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "defaults", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["defaults"]; });
233/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "create", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["create"]; });
234/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "clone", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["clone"]; });
235/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "tap", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["tap"]; });
236/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "get", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["get"]; });
237/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "has", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["has"]; });
238/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "mapObject", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["mapObject"]; });
239/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["identity"]; });
240/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "constant", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["constant"]; });
241/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "noop", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["noop"]; });
242/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "toPath", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["toPath"]; });
243/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "property", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["property"]; });
244/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "propertyOf", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["propertyOf"]; });
245/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "matcher", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["matcher"]; });
246/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "matches", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["matches"]; });
247/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "times", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["times"]; });
248/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "random", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["random"]; });
249/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "now", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["now"]; });
250/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "escape", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["escape"]; });
251/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "unescape", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["unescape"]; });
252/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "templateSettings", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["templateSettings"]; });
253/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "template", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["template"]; });
254/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "result", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["result"]; });
255/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "uniqueId", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["uniqueId"]; });
256/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "chain", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["chain"]; });
257/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "iteratee", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["iteratee"]; });
258/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "partial", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["partial"]; });
259/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "bind", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["bind"]; });
260/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "bindAll", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["bindAll"]; });
261/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "memoize", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["memoize"]; });
262/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "delay", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["delay"]; });
263/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "defer", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["defer"]; });
264/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "throttle", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["throttle"]; });
265/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "debounce", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["debounce"]; });
266/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "wrap", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["wrap"]; });
267/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "negate", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["negate"]; });
268/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "compose", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["compose"]; });
269/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "after", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["after"]; });
270/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "before", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["before"]; });
271/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "once", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["once"]; });
272/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "findKey", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["findKey"]; });
273/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "findIndex", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["findIndex"]; });
274/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "findLastIndex", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["findLastIndex"]; });
275/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "sortedIndex", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["sortedIndex"]; });
276/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "indexOf", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["indexOf"]; });
277/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "lastIndexOf", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["lastIndexOf"]; });
278/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "find", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["find"]; });
279/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "detect", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["detect"]; });
280/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "findWhere", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["findWhere"]; });
281/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "each", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["each"]; });
282/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "forEach", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["forEach"]; });
283/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "map", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["map"]; });
284/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "collect", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["collect"]; });
285/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "reduce", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["reduce"]; });
286/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "foldl", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["foldl"]; });
287/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "inject", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["inject"]; });
288/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "reduceRight", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["reduceRight"]; });
289/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "foldr", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["foldr"]; });
290/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "filter", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["filter"]; });
291/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "select", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["select"]; });
292/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "reject", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["reject"]; });
293/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "every", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["every"]; });
294/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "all", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["all"]; });
295/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "some", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["some"]; });
296/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "any", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["any"]; });
297/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "contains", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["contains"]; });
298/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "includes", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["includes"]; });
299/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "include", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["include"]; });
300/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "invoke", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["invoke"]; });
301/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "pluck", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["pluck"]; });
302/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "where", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["where"]; });
303/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "max", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["max"]; });
304/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "min", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["min"]; });
305/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "shuffle", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["shuffle"]; });
306/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "sample", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["sample"]; });
307/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "sortBy", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["sortBy"]; });
308/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "groupBy", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["groupBy"]; });
309/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "indexBy", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["indexBy"]; });
310/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "countBy", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["countBy"]; });
311/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "partition", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["partition"]; });
312/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "toArray", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["toArray"]; });
313/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "size", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["size"]; });
314/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "pick", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["pick"]; });
315/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "omit", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["omit"]; });
316/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "first", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["first"]; });
317/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "head", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["head"]; });
318/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "take", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["take"]; });
319/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "initial", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["initial"]; });
320/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "last", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["last"]; });
321/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "rest", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["rest"]; });
322/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "tail", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["tail"]; });
323/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "drop", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["drop"]; });
324/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "compact", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["compact"]; });
325/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "flatten", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["flatten"]; });
326/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "without", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["without"]; });
327/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "uniq", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["uniq"]; });
328/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "unique", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["unique"]; });
329/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "union", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["union"]; });
330/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "intersection", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["intersection"]; });
331/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "difference", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["difference"]; });
332/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "unzip", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["unzip"]; });
333/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "transpose", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["transpose"]; });
334/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "zip", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["zip"]; });
335/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "object", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["object"]; });
336/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "range", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["range"]; });
337/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "chunk", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["chunk"]; });
338/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "mixin", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["mixin"]; });
339// ESM Exports
340// ===========
341// This module is the package entry point for ES module users. In other words,
342// it is the module they are interfacing with when they import from the whole
343// package instead of from a submodule, like this:
344//
345// ```js
346// import { map } from 'underscore';
347// ```
348//
349// The difference with `./index-default`, which is the package entry point for
350// CommonJS, AMD and UMD users, is purely technical. In ES modules, named and
351// default exports are considered to be siblings, so when you have a default
352// export, its properties are not automatically available as named exports. For
353// this reason, we re-export the named exports in addition to providing the same
354// default export as in `./index-default`.
355
356
357
358
359/***/ }),
360/* 2 */
361/***/ (function(module, exports) {
362
363function _interopRequireDefault(obj) {
364 return obj && obj.__esModule ? obj : {
365 "default": obj
366 };
367}
368
369module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
370
371/***/ }),
372/* 3 */
373/***/ (function(module, __webpack_exports__, __webpack_require__) {
374
375"use strict";
376/* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return VERSION; });
377/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "p", function() { return root; });
378/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ArrayProto; });
379/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return ObjProto; });
380/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return SymbolProto; });
381/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return push; });
382/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "q", function() { return slice; });
383/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "t", function() { return toString; });
384/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return hasOwnProperty; });
385/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "r", function() { return supportsArrayBuffer; });
386/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "s", function() { return supportsDataView; });
387/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return nativeIsArray; });
388/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return nativeKeys; });
389/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return nativeCreate; });
390/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return nativeIsView; });
391/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return _isNaN; });
392/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return _isFinite; });
393/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return hasEnumBug; });
394/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return nonEnumerableProps; });
395/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return MAX_ARRAY_INDEX; });
396// Current version.
397var VERSION = '1.12.1';
398
399// Establish the root object, `window` (`self`) in the browser, `global`
400// on the server, or `this` in some virtual machines. We use `self`
401// instead of `window` for `WebWorker` support.
402var root = typeof self == 'object' && self.self === self && self ||
403 typeof global == 'object' && global.global === global && global ||
404 Function('return this')() ||
405 {};
406
407// Save bytes in the minified (but not gzipped) version:
408var ArrayProto = Array.prototype, ObjProto = Object.prototype;
409var SymbolProto = typeof Symbol !== 'undefined' ? Symbol.prototype : null;
410
411// Create quick reference variables for speed access to core prototypes.
412var push = ArrayProto.push,
413 slice = ArrayProto.slice,
414 toString = ObjProto.toString,
415 hasOwnProperty = ObjProto.hasOwnProperty;
416
417// Modern feature detection.
418var supportsArrayBuffer = typeof ArrayBuffer !== 'undefined',
419 supportsDataView = typeof DataView !== 'undefined';
420
421// All **ECMAScript 5+** native function implementations that we hope to use
422// are declared here.
423var nativeIsArray = Array.isArray,
424 nativeKeys = Object.keys,
425 nativeCreate = Object.create,
426 nativeIsView = supportsArrayBuffer && ArrayBuffer.isView;
427
428// Create references to these builtin functions because we override them.
429var _isNaN = isNaN,
430 _isFinite = isFinite;
431
432// Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed.
433var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString');
434var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString',
435 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString'];
436
437// The largest integer that can be represented exactly.
438var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1;
439
440/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(105)))
441
442/***/ }),
443/* 4 */
444/***/ (function(module, exports) {
445
446module.exports = function (exec) {
447 try {
448 return !!exec();
449 } catch (error) {
450 return true;
451 }
452};
453
454
455/***/ }),
456/* 5 */
457/***/ (function(module, exports, __webpack_require__) {
458
459var path = __webpack_require__(13);
460var hasOwn = __webpack_require__(14);
461var wrappedWellKnownSymbolModule = __webpack_require__(136);
462var defineProperty = __webpack_require__(32).f;
463
464module.exports = function (NAME) {
465 var Symbol = path.Symbol || (path.Symbol = {});
466 if (!hasOwn(Symbol, NAME)) defineProperty(Symbol, NAME, {
467 value: wrappedWellKnownSymbolModule.f(NAME)
468 });
469};
470
471
472/***/ }),
473/* 6 */
474/***/ (function(module, exports, __webpack_require__) {
475
476var NATIVE_BIND = __webpack_require__(63);
477
478var FunctionPrototype = Function.prototype;
479var bind = FunctionPrototype.bind;
480var call = FunctionPrototype.call;
481var uncurryThis = NATIVE_BIND && bind.bind(call, call);
482
483module.exports = NATIVE_BIND ? function (fn) {
484 return fn && uncurryThis(fn);
485} : function (fn) {
486 return fn && function () {
487 return call.apply(fn, arguments);
488 };
489};
490
491
492/***/ }),
493/* 7 */
494/***/ (function(module, exports) {
495
496// `IsCallable` abstract operation
497// https://tc39.es/ecma262/#sec-iscallable
498module.exports = function (argument) {
499 return typeof argument == 'function';
500};
501
502
503/***/ }),
504/* 8 */
505/***/ (function(module, exports, __webpack_require__) {
506
507var global = __webpack_require__(9);
508var shared = __webpack_require__(67);
509var hasOwn = __webpack_require__(14);
510var uid = __webpack_require__(109);
511var NATIVE_SYMBOL = __webpack_require__(49);
512var USE_SYMBOL_AS_UID = __webpack_require__(140);
513
514var WellKnownSymbolsStore = shared('wks');
515var Symbol = global.Symbol;
516var symbolFor = Symbol && Symbol['for'];
517var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid;
518
519module.exports = function (name) {
520 if (!hasOwn(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {
521 var description = 'Symbol.' + name;
522 if (NATIVE_SYMBOL && hasOwn(Symbol, name)) {
523 WellKnownSymbolsStore[name] = Symbol[name];
524 } else if (USE_SYMBOL_AS_UID && symbolFor) {
525 WellKnownSymbolsStore[name] = symbolFor(description);
526 } else {
527 WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
528 }
529 } return WellKnownSymbolsStore[name];
530};
531
532
533/***/ }),
534/* 9 */
535/***/ (function(module, exports, __webpack_require__) {
536
537/* WEBPACK VAR INJECTION */(function(global) {var check = function (it) {
538 return it && it.Math == Math && it;
539};
540
541// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
542module.exports =
543 // eslint-disable-next-line es-x/no-global-this -- safe
544 check(typeof globalThis == 'object' && globalThis) ||
545 check(typeof window == 'object' && window) ||
546 // eslint-disable-next-line no-restricted-globals -- safe
547 check(typeof self == 'object' && self) ||
548 check(typeof global == 'object' && global) ||
549 // eslint-disable-next-line no-new-func -- fallback
550 (function () { return this; })() || Function('return this')();
551
552/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(105)))
553
554/***/ }),
555/* 10 */
556/***/ (function(module, exports, __webpack_require__) {
557
558var NATIVE_BIND = __webpack_require__(63);
559
560var call = Function.prototype.call;
561
562module.exports = NATIVE_BIND ? call.bind(call) : function () {
563 return call.apply(call, arguments);
564};
565
566
567/***/ }),
568/* 11 */
569/***/ (function(module, __webpack_exports__, __webpack_require__) {
570
571"use strict";
572/* harmony export (immutable) */ __webpack_exports__["a"] = keys;
573/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isObject_js__ = __webpack_require__(45);
574/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(3);
575/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__has_js__ = __webpack_require__(37);
576/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__collectNonEnumProps_js__ = __webpack_require__(172);
577
578
579
580
581
582// Retrieve the names of an object's own properties.
583// Delegates to **ECMAScript 5**'s native `Object.keys`.
584function keys(obj) {
585 if (!Object(__WEBPACK_IMPORTED_MODULE_0__isObject_js__["a" /* default */])(obj)) return [];
586 if (__WEBPACK_IMPORTED_MODULE_1__setup_js__["m" /* nativeKeys */]) return Object(__WEBPACK_IMPORTED_MODULE_1__setup_js__["m" /* nativeKeys */])(obj);
587 var keys = [];
588 for (var key in obj) if (Object(__WEBPACK_IMPORTED_MODULE_2__has_js__["a" /* default */])(obj, key)) keys.push(key);
589 // Ahem, IE < 9.
590 if (__WEBPACK_IMPORTED_MODULE_1__setup_js__["h" /* hasEnumBug */]) Object(__WEBPACK_IMPORTED_MODULE_3__collectNonEnumProps_js__["a" /* default */])(obj, keys);
591 return keys;
592}
593
594
595/***/ }),
596/* 12 */
597/***/ (function(module, exports, __webpack_require__) {
598
599module.exports = __webpack_require__(238);
600
601/***/ }),
602/* 13 */
603/***/ (function(module, exports) {
604
605module.exports = {};
606
607
608/***/ }),
609/* 14 */
610/***/ (function(module, exports, __webpack_require__) {
611
612var uncurryThis = __webpack_require__(6);
613var toObject = __webpack_require__(35);
614
615var hasOwnProperty = uncurryThis({}.hasOwnProperty);
616
617// `HasOwnProperty` abstract operation
618// https://tc39.es/ecma262/#sec-hasownproperty
619// eslint-disable-next-line es-x/no-object-hasown -- safe
620module.exports = Object.hasOwn || function hasOwn(it, key) {
621 return hasOwnProperty(toObject(it), key);
622};
623
624
625/***/ }),
626/* 15 */
627/***/ (function(module, __webpack_exports__, __webpack_require__) {
628
629"use strict";
630/* harmony export (immutable) */ __webpack_exports__["a"] = tagTester;
631/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(3);
632
633
634// Internal function for creating a `toString`-based type tester.
635function tagTester(name) {
636 var tag = '[object ' + name + ']';
637 return function(obj) {
638 return __WEBPACK_IMPORTED_MODULE_0__setup_js__["t" /* toString */].call(obj) === tag;
639 };
640}
641
642
643/***/ }),
644/* 16 */
645/***/ (function(module, exports, __webpack_require__) {
646
647var path = __webpack_require__(13);
648var global = __webpack_require__(9);
649var isCallable = __webpack_require__(7);
650
651var aFunction = function (variable) {
652 return isCallable(variable) ? variable : undefined;
653};
654
655module.exports = function (namespace, method) {
656 return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace])
657 : path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method];
658};
659
660
661/***/ }),
662/* 17 */
663/***/ (function(module, exports, __webpack_require__) {
664
665var isCallable = __webpack_require__(7);
666
667module.exports = function (it) {
668 return typeof it == 'object' ? it !== null : isCallable(it);
669};
670
671
672/***/ }),
673/* 18 */
674/***/ (function(module, __webpack_exports__, __webpack_require__) {
675
676"use strict";
677/* harmony export (immutable) */ __webpack_exports__["a"] = cb;
678/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(23);
679/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__baseIteratee_js__ = __webpack_require__(182);
680/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__iteratee_js__ = __webpack_require__(183);
681
682
683
684
685// The function we call internally to generate a callback. It invokes
686// `_.iteratee` if overridden, otherwise `baseIteratee`.
687function cb(value, context, argCount) {
688 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);
689 return Object(__WEBPACK_IMPORTED_MODULE_1__baseIteratee_js__["a" /* default */])(value, context, argCount);
690}
691
692
693/***/ }),
694/* 19 */
695/***/ (function(module, exports, __webpack_require__) {
696
697var fails = __webpack_require__(4);
698
699// Detect IE8's incomplete defineProperty implementation
700module.exports = !fails(function () {
701 // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
702 return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
703});
704
705
706/***/ }),
707/* 20 */
708/***/ (function(module, exports, __webpack_require__) {
709
710var uncurryThis = __webpack_require__(6);
711
712module.exports = uncurryThis({}.isPrototypeOf);
713
714
715/***/ }),
716/* 21 */
717/***/ (function(module, exports, __webpack_require__) {
718
719var isObject = __webpack_require__(17);
720
721var $String = String;
722var $TypeError = TypeError;
723
724// `Assert: Type(argument) is Object`
725module.exports = function (argument) {
726 if (isObject(argument)) return argument;
727 throw $TypeError($String(argument) + ' is not an object');
728};
729
730
731/***/ }),
732/* 22 */
733/***/ (function(module, __webpack_exports__, __webpack_require__) {
734
735"use strict";
736/* harmony export (immutable) */ __webpack_exports__["a"] = restArguments;
737// Some functions take a variable number of arguments, or a few expected
738// arguments at the beginning and then a variable number of values to operate
739// on. This helper accumulates all remaining arguments past the function’s
740// argument length (or an explicit `startIndex`), into an array that becomes
741// the last argument. Similar to ES6’s "rest parameter".
742function restArguments(func, startIndex) {
743 startIndex = startIndex == null ? func.length - 1 : +startIndex;
744 return function() {
745 var length = Math.max(arguments.length - startIndex, 0),
746 rest = Array(length),
747 index = 0;
748 for (; index < length; index++) {
749 rest[index] = arguments[index + startIndex];
750 }
751 switch (startIndex) {
752 case 0: return func.call(this, rest);
753 case 1: return func.call(this, arguments[0], rest);
754 case 2: return func.call(this, arguments[0], arguments[1], rest);
755 }
756 var args = Array(startIndex + 1);
757 for (index = 0; index < startIndex; index++) {
758 args[index] = arguments[index];
759 }
760 args[startIndex] = rest;
761 return func.apply(this, args);
762 };
763}
764
765
766/***/ }),
767/* 23 */
768/***/ (function(module, __webpack_exports__, __webpack_require__) {
769
770"use strict";
771/* harmony export (immutable) */ __webpack_exports__["a"] = _;
772/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(3);
773
774
775// If Underscore is called as a function, it returns a wrapped object that can
776// be used OO-style. This wrapper holds altered versions of all functions added
777// through `_.mixin`. Wrapped objects may be chained.
778function _(obj) {
779 if (obj instanceof _) return obj;
780 if (!(this instanceof _)) return new _(obj);
781 this._wrapped = obj;
782}
783
784_.VERSION = __WEBPACK_IMPORTED_MODULE_0__setup_js__["e" /* VERSION */];
785
786// Extracts the result from a wrapped and chained object.
787_.prototype.value = function() {
788 return this._wrapped;
789};
790
791// Provide unwrapping proxies for some methods used in engine operations
792// such as arithmetic and JSON stringification.
793_.prototype.valueOf = _.prototype.toJSON = _.prototype.value;
794
795_.prototype.toString = function() {
796 return String(this._wrapped);
797};
798
799
800/***/ }),
801/* 24 */
802/***/ (function(module, __webpack_exports__, __webpack_require__) {
803
804"use strict";
805/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createSizePropertyCheck_js__ = __webpack_require__(170);
806/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getLength_js__ = __webpack_require__(27);
807
808
809
810// Internal helper for collection methods to determine whether a collection
811// should be iterated as an array or as an object.
812// Related: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength
813// Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094
814/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createSizePropertyCheck_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__getLength_js__["a" /* default */]));
815
816
817/***/ }),
818/* 25 */
819/***/ (function(module, exports, __webpack_require__) {
820
821"use strict";
822
823
824var _interopRequireDefault = __webpack_require__(2);
825
826var _concat = _interopRequireDefault(__webpack_require__(29));
827
828var _promise = _interopRequireDefault(__webpack_require__(12));
829
830var _ = __webpack_require__(1);
831
832var md5 = __webpack_require__(496);
833
834var _require = __webpack_require__(1),
835 extend = _require.extend;
836
837var AV = __webpack_require__(59);
838
839var AVError = __webpack_require__(40);
840
841var _require2 = __webpack_require__(28),
842 getSessionToken = _require2.getSessionToken;
843
844var ajax = __webpack_require__(103); // 计算 X-LC-Sign 的签名方法
845
846
847var sign = function sign(key, isMasterKey) {
848 var _context2;
849
850 var now = new Date().getTime();
851 var signature = md5(now + key);
852
853 if (isMasterKey) {
854 var _context;
855
856 return (0, _concat.default)(_context = "".concat(signature, ",")).call(_context, now, ",master");
857 }
858
859 return (0, _concat.default)(_context2 = "".concat(signature, ",")).call(_context2, now);
860};
861
862var setAppKey = function setAppKey(headers, signKey) {
863 if (signKey) {
864 headers['X-LC-Sign'] = sign(AV.applicationKey);
865 } else {
866 headers['X-LC-Key'] = AV.applicationKey;
867 }
868};
869
870var setHeaders = function setHeaders() {
871 var authOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
872 var signKey = arguments.length > 1 ? arguments[1] : undefined;
873 var headers = {
874 'X-LC-Id': AV.applicationId,
875 'Content-Type': 'application/json;charset=UTF-8'
876 };
877 var useMasterKey = false;
878
879 if (typeof authOptions.useMasterKey === 'boolean') {
880 useMasterKey = authOptions.useMasterKey;
881 } else if (typeof AV._config.useMasterKey === 'boolean') {
882 useMasterKey = AV._config.useMasterKey;
883 }
884
885 if (useMasterKey) {
886 if (AV.masterKey) {
887 if (signKey) {
888 headers['X-LC-Sign'] = sign(AV.masterKey, true);
889 } else {
890 headers['X-LC-Key'] = "".concat(AV.masterKey, ",master");
891 }
892 } else {
893 console.warn('masterKey is not set, fall back to use appKey');
894 setAppKey(headers, signKey);
895 }
896 } else {
897 setAppKey(headers, signKey);
898 }
899
900 if (AV.hookKey) {
901 headers['X-LC-Hook-Key'] = AV.hookKey;
902 }
903
904 if (AV._config.production !== null) {
905 headers['X-LC-Prod'] = String(AV._config.production);
906 }
907
908 headers[undefined === 'NODE_JS' ? 'User-Agent' : 'X-LC-UA'] = AV._sharedConfig.userAgent;
909 return _promise.default.resolve().then(function () {
910 // Pass the session token
911 var sessionToken = getSessionToken(authOptions);
912
913 if (sessionToken) {
914 headers['X-LC-Session'] = sessionToken;
915 } else if (!AV._config.disableCurrentUser) {
916 return AV.User.currentAsync().then(function (currentUser) {
917 if (currentUser && currentUser._sessionToken) {
918 headers['X-LC-Session'] = currentUser._sessionToken;
919 }
920
921 return headers;
922 });
923 }
924
925 return headers;
926 });
927};
928
929var createApiUrl = function createApiUrl(_ref) {
930 var _ref$service = _ref.service,
931 service = _ref$service === void 0 ? 'api' : _ref$service,
932 _ref$version = _ref.version,
933 version = _ref$version === void 0 ? '1.1' : _ref$version,
934 path = _ref.path;
935 var apiURL = AV._config.serverURLs[service];
936 if (!apiURL) throw new Error("undefined server URL for ".concat(service));
937
938 if (apiURL.charAt(apiURL.length - 1) !== '/') {
939 apiURL += '/';
940 }
941
942 apiURL += version;
943
944 if (path) {
945 apiURL += path;
946 }
947
948 return apiURL;
949};
950/**
951 * Low level REST API client. Call REST endpoints with authorization headers.
952 * @function AV.request
953 * @since 3.0.0
954 * @param {Object} options
955 * @param {String} options.method HTTP method
956 * @param {String} options.path endpoint path, e.g. `/classes/Test/55759577e4b029ae6015ac20`
957 * @param {Object} [options.query] query string dict
958 * @param {Object} [options.data] HTTP body
959 * @param {AuthOptions} [options.authOptions]
960 * @param {String} [options.service = 'api']
961 * @param {String} [options.version = '1.1']
962 */
963
964
965var request = function request(_ref2) {
966 var service = _ref2.service,
967 version = _ref2.version,
968 method = _ref2.method,
969 path = _ref2.path,
970 query = _ref2.query,
971 data = _ref2.data,
972 authOptions = _ref2.authOptions,
973 _ref2$signKey = _ref2.signKey,
974 signKey = _ref2$signKey === void 0 ? true : _ref2$signKey;
975
976 if (!(AV.applicationId && (AV.applicationKey || AV.masterKey))) {
977 throw new Error('Not initialized');
978 }
979
980 if (AV._appRouter) {
981 AV._appRouter.refresh();
982 }
983
984 var timeout = AV._config.requestTimeout;
985 var url = createApiUrl({
986 service: service,
987 path: path,
988 version: version
989 });
990 return setHeaders(authOptions, signKey).then(function (headers) {
991 return ajax({
992 method: method,
993 url: url,
994 query: query,
995 data: data,
996 headers: headers,
997 timeout: timeout
998 }).catch(function (error) {
999 var errorJSON = {
1000 code: error.code || -1,
1001 error: error.message || error.responseText
1002 };
1003
1004 if (error.response && error.response.code) {
1005 errorJSON = error.response;
1006 } else if (error.responseText) {
1007 try {
1008 errorJSON = JSON.parse(error.responseText);
1009 } catch (e) {// If we fail to parse the error text, that's okay.
1010 }
1011 }
1012
1013 errorJSON.rawMessage = errorJSON.rawMessage || errorJSON.error;
1014
1015 if (!AV._sharedConfig.keepErrorRawMessage) {
1016 var _context3, _context4;
1017
1018 errorJSON.error += (0, _concat.default)(_context3 = (0, _concat.default)(_context4 = " [".concat(error.statusCode || 'N/A', " ")).call(_context4, method, " ")).call(_context3, url, "]");
1019 } // Transform the error into an instance of AVError by trying to parse
1020 // the error string as JSON.
1021
1022
1023 var err = new AVError(errorJSON.code, errorJSON.error);
1024 delete errorJSON.error;
1025 throw _.extend(err, errorJSON);
1026 });
1027 });
1028}; // lagecy request
1029
1030
1031var _request = function _request(route, className, objectId, method, data, authOptions, query) {
1032 var path = '';
1033 if (route) path += "/".concat(route);
1034 if (className) path += "/".concat(className);
1035 if (objectId) path += "/".concat(objectId); // for migeration
1036
1037 if (data && data._fetchWhenSave) throw new Error('_fetchWhenSave should be in the query');
1038 if (data && data._where) throw new Error('_where should be in the query');
1039
1040 if (method && method.toLowerCase() === 'get') {
1041 query = extend({}, query, data);
1042 data = null;
1043 }
1044
1045 return request({
1046 method: method,
1047 path: path,
1048 query: query,
1049 data: data,
1050 authOptions: authOptions
1051 });
1052};
1053
1054AV.request = request;
1055module.exports = {
1056 _request: _request,
1057 request: request
1058};
1059
1060/***/ }),
1061/* 26 */
1062/***/ (function(module, __webpack_exports__, __webpack_require__) {
1063
1064"use strict";
1065/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(15);
1066/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(3);
1067
1068
1069
1070var isFunction = Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Function');
1071
1072// Optimize `isFunction` if appropriate. Work around some `typeof` bugs in old
1073// v8, IE 11 (#1621), Safari 8 (#1929), and PhantomJS (#2236).
1074var nodelist = __WEBPACK_IMPORTED_MODULE_1__setup_js__["p" /* root */].document && __WEBPACK_IMPORTED_MODULE_1__setup_js__["p" /* root */].document.childNodes;
1075if (typeof /./ != 'function' && typeof Int8Array != 'object' && typeof nodelist != 'function') {
1076 isFunction = function(obj) {
1077 return typeof obj == 'function' || false;
1078 };
1079}
1080
1081/* harmony default export */ __webpack_exports__["a"] = (isFunction);
1082
1083
1084/***/ }),
1085/* 27 */
1086/***/ (function(module, __webpack_exports__, __webpack_require__) {
1087
1088"use strict";
1089/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__shallowProperty_js__ = __webpack_require__(171);
1090
1091
1092// Internal helper to obtain the `length` property of an object.
1093/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__shallowProperty_js__["a" /* default */])('length'));
1094
1095
1096/***/ }),
1097/* 28 */
1098/***/ (function(module, exports, __webpack_require__) {
1099
1100"use strict";
1101
1102
1103var _interopRequireDefault = __webpack_require__(2);
1104
1105var _keys = _interopRequireDefault(__webpack_require__(48));
1106
1107var _getPrototypeOf = _interopRequireDefault(__webpack_require__(215));
1108
1109var _promise = _interopRequireDefault(__webpack_require__(12));
1110
1111var _ = __webpack_require__(1); // Helper function to check null or undefined.
1112
1113
1114var isNullOrUndefined = function isNullOrUndefined(x) {
1115 return _.isNull(x) || _.isUndefined(x);
1116};
1117
1118var ensureArray = function ensureArray(target) {
1119 if (_.isArray(target)) {
1120 return target;
1121 }
1122
1123 if (target === undefined || target === null) {
1124 return [];
1125 }
1126
1127 return [target];
1128};
1129
1130var transformFetchOptions = function transformFetchOptions() {
1131 var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
1132 keys = (0, _keys.default)(_ref),
1133 include = _ref.include,
1134 includeACL = _ref.includeACL;
1135
1136 var fetchOptions = {};
1137
1138 if (keys) {
1139 fetchOptions.keys = ensureArray(keys).join(',');
1140 }
1141
1142 if (include) {
1143 fetchOptions.include = ensureArray(include).join(',');
1144 }
1145
1146 if (includeACL) {
1147 fetchOptions.returnACL = includeACL;
1148 }
1149
1150 return fetchOptions;
1151};
1152
1153var getSessionToken = function getSessionToken(authOptions) {
1154 if (authOptions.sessionToken) {
1155 return authOptions.sessionToken;
1156 }
1157
1158 if (authOptions.user && typeof authOptions.user.getSessionToken === 'function') {
1159 return authOptions.user.getSessionToken();
1160 }
1161};
1162
1163var tap = function tap(interceptor) {
1164 return function (value) {
1165 return interceptor(value), value;
1166 };
1167}; // Shared empty constructor function to aid in prototype-chain creation.
1168
1169
1170var EmptyConstructor = function EmptyConstructor() {}; // Helper function to correctly set up the prototype chain, for subclasses.
1171// Similar to `goog.inherits`, but uses a hash of prototype properties and
1172// class properties to be extended.
1173
1174
1175var inherits = function inherits(parent, protoProps, staticProps) {
1176 var child; // The constructor function for the new subclass is either defined by you
1177 // (the "constructor" property in your `extend` definition), or defaulted
1178 // by us to simply call the parent's constructor.
1179
1180 if (protoProps && protoProps.hasOwnProperty('constructor')) {
1181 child = protoProps.constructor;
1182 } else {
1183 /** @ignore */
1184 child = function child() {
1185 parent.apply(this, arguments);
1186 };
1187 } // Inherit class (static) properties from parent.
1188
1189
1190 _.extend(child, parent); // Set the prototype chain to inherit from `parent`, without calling
1191 // `parent`'s constructor function.
1192
1193
1194 EmptyConstructor.prototype = parent.prototype;
1195 child.prototype = new EmptyConstructor(); // Add prototype properties (instance properties) to the subclass,
1196 // if supplied.
1197
1198 if (protoProps) {
1199 _.extend(child.prototype, protoProps);
1200 } // Add static properties to the constructor function, if supplied.
1201
1202
1203 if (staticProps) {
1204 _.extend(child, staticProps);
1205 } // Correctly set child's `prototype.constructor`.
1206
1207
1208 child.prototype.constructor = child; // Set a convenience property in case the parent's prototype is
1209 // needed later.
1210
1211 child.__super__ = parent.prototype;
1212 return child;
1213};
1214
1215var parseDate = function parseDate(iso8601) {
1216 return new Date(iso8601);
1217};
1218
1219var setValue = function setValue(target, key, value) {
1220 // '.' is not allowed in Class keys, escaping is not in concern now.
1221 var segs = key.split('.');
1222 var lastSeg = segs.pop();
1223 var currentTarget = target;
1224 segs.forEach(function (seg) {
1225 if (currentTarget[seg] === undefined) currentTarget[seg] = {};
1226 currentTarget = currentTarget[seg];
1227 });
1228 currentTarget[lastSeg] = value;
1229 return target;
1230};
1231
1232var findValue = function findValue(target, key) {
1233 var segs = key.split('.');
1234 var firstSeg = segs[0];
1235 var lastSeg = segs.pop();
1236 var currentTarget = target;
1237
1238 for (var i = 0; i < segs.length; i++) {
1239 currentTarget = currentTarget[segs[i]];
1240
1241 if (currentTarget === undefined) {
1242 return [undefined, undefined, lastSeg];
1243 }
1244 }
1245
1246 var value = currentTarget[lastSeg];
1247 return [value, currentTarget, lastSeg, firstSeg];
1248};
1249
1250var isPlainObject = function isPlainObject(obj) {
1251 return _.isObject(obj) && (0, _getPrototypeOf.default)(obj) === Object.prototype;
1252};
1253
1254var continueWhile = function continueWhile(predicate, asyncFunction) {
1255 if (predicate()) {
1256 return asyncFunction().then(function () {
1257 return continueWhile(predicate, asyncFunction);
1258 });
1259 }
1260
1261 return _promise.default.resolve();
1262};
1263
1264module.exports = {
1265 isNullOrUndefined: isNullOrUndefined,
1266 ensureArray: ensureArray,
1267 transformFetchOptions: transformFetchOptions,
1268 getSessionToken: getSessionToken,
1269 tap: tap,
1270 inherits: inherits,
1271 parseDate: parseDate,
1272 setValue: setValue,
1273 findValue: findValue,
1274 isPlainObject: isPlainObject,
1275 continueWhile: continueWhile
1276};
1277
1278/***/ }),
1279/* 29 */
1280/***/ (function(module, exports, __webpack_require__) {
1281
1282module.exports = __webpack_require__(351);
1283
1284/***/ }),
1285/* 30 */
1286/***/ (function(module, exports, __webpack_require__) {
1287
1288var isCallable = __webpack_require__(7);
1289var tryToString = __webpack_require__(66);
1290
1291var $TypeError = TypeError;
1292
1293// `Assert: IsCallable(argument) is true`
1294module.exports = function (argument) {
1295 if (isCallable(argument)) return argument;
1296 throw $TypeError(tryToString(argument) + ' is not a function');
1297};
1298
1299
1300/***/ }),
1301/* 31 */
1302/***/ (function(module, exports) {
1303
1304module.exports = true;
1305
1306
1307/***/ }),
1308/* 32 */
1309/***/ (function(module, exports, __webpack_require__) {
1310
1311var DESCRIPTORS = __webpack_require__(19);
1312var IE8_DOM_DEFINE = __webpack_require__(141);
1313var V8_PROTOTYPE_DEFINE_BUG = __webpack_require__(143);
1314var anObject = __webpack_require__(21);
1315var toPropertyKey = __webpack_require__(82);
1316
1317var $TypeError = TypeError;
1318// eslint-disable-next-line es-x/no-object-defineproperty -- safe
1319var $defineProperty = Object.defineProperty;
1320// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
1321var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
1322var ENUMERABLE = 'enumerable';
1323var CONFIGURABLE = 'configurable';
1324var WRITABLE = 'writable';
1325
1326// `Object.defineProperty` method
1327// https://tc39.es/ecma262/#sec-object.defineproperty
1328exports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {
1329 anObject(O);
1330 P = toPropertyKey(P);
1331 anObject(Attributes);
1332 if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
1333 var current = $getOwnPropertyDescriptor(O, P);
1334 if (current && current[WRITABLE]) {
1335 O[P] = Attributes.value;
1336 Attributes = {
1337 configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],
1338 enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
1339 writable: false
1340 };
1341 }
1342 } return $defineProperty(O, P, Attributes);
1343} : $defineProperty : function defineProperty(O, P, Attributes) {
1344 anObject(O);
1345 P = toPropertyKey(P);
1346 anObject(Attributes);
1347 if (IE8_DOM_DEFINE) try {
1348 return $defineProperty(O, P, Attributes);
1349 } catch (error) { /* empty */ }
1350 if ('get' in Attributes || 'set' in Attributes) throw $TypeError('Accessors not supported');
1351 if ('value' in Attributes) O[P] = Attributes.value;
1352 return O;
1353};
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__(139);
1362var requireObjectCoercible = __webpack_require__(106);
1363
1364module.exports = function (it) {
1365 return IndexedObject(requireObjectCoercible(it));
1366};
1367
1368
1369/***/ }),
1370/* 34 */
1371/***/ (function(module, exports, __webpack_require__) {
1372
1373module.exports = __webpack_require__(363);
1374
1375/***/ }),
1376/* 35 */
1377/***/ (function(module, exports, __webpack_require__) {
1378
1379var requireObjectCoercible = __webpack_require__(106);
1380
1381var $Object = Object;
1382
1383// `ToObject` abstract operation
1384// https://tc39.es/ecma262/#sec-toobject
1385module.exports = function (argument) {
1386 return $Object(requireObjectCoercible(argument));
1387};
1388
1389
1390/***/ }),
1391/* 36 */
1392/***/ (function(module, exports, __webpack_require__) {
1393
1394var DESCRIPTORS = __webpack_require__(19);
1395var definePropertyModule = __webpack_require__(32);
1396var createPropertyDescriptor = __webpack_require__(41);
1397
1398module.exports = DESCRIPTORS ? function (object, key, value) {
1399 return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));
1400} : function (object, key, value) {
1401 object[key] = value;
1402 return object;
1403};
1404
1405
1406/***/ }),
1407/* 37 */
1408/***/ (function(module, __webpack_exports__, __webpack_require__) {
1409
1410"use strict";
1411/* harmony export (immutable) */ __webpack_exports__["a"] = has;
1412/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(3);
1413
1414
1415// Internal function to check whether `key` is an own property name of `obj`.
1416function has(obj, key) {
1417 return obj != null && __WEBPACK_IMPORTED_MODULE_0__setup_js__["i" /* hasOwnProperty */].call(obj, key);
1418}
1419
1420
1421/***/ }),
1422/* 38 */
1423/***/ (function(module, exports, __webpack_require__) {
1424
1425var path = __webpack_require__(13);
1426
1427module.exports = function (CONSTRUCTOR) {
1428 return path[CONSTRUCTOR + 'Prototype'];
1429};
1430
1431
1432/***/ }),
1433/* 39 */
1434/***/ (function(module, exports, __webpack_require__) {
1435
1436module.exports = __webpack_require__(356);
1437
1438/***/ }),
1439/* 40 */
1440/***/ (function(module, exports, __webpack_require__) {
1441
1442"use strict";
1443
1444
1445var _interopRequireDefault = __webpack_require__(2);
1446
1447var _setPrototypeOf = _interopRequireDefault(__webpack_require__(379));
1448
1449var _getPrototypeOf = _interopRequireDefault(__webpack_require__(215));
1450
1451var _ = __webpack_require__(1);
1452/**
1453 * @class AV.Error
1454 */
1455
1456
1457function AVError(code, message) {
1458 if (this instanceof AVError ? this.constructor : void 0) {
1459 var error = new Error(message);
1460 (0, _setPrototypeOf.default)(error, (0, _getPrototypeOf.default)(this));
1461 error.code = code;
1462 return error;
1463 }
1464
1465 return new AVError(code, message);
1466}
1467
1468AVError.prototype = Object.create(Error.prototype, {
1469 constructor: {
1470 value: Error,
1471 enumerable: false,
1472 writable: true,
1473 configurable: true
1474 }
1475});
1476(0, _setPrototypeOf.default)(AVError, Error);
1477
1478_.extend(AVError,
1479/** @lends AV.Error */
1480{
1481 /**
1482 * Error code indicating some error other than those enumerated here.
1483 * @constant
1484 */
1485 OTHER_CAUSE: -1,
1486
1487 /**
1488 * Error code indicating that something has gone wrong with the server.
1489 * If you get this error code, it is AV's fault.
1490 * @constant
1491 */
1492 INTERNAL_SERVER_ERROR: 1,
1493
1494 /**
1495 * Error code indicating the connection to the AV servers failed.
1496 * @constant
1497 */
1498 CONNECTION_FAILED: 100,
1499
1500 /**
1501 * Error code indicating the specified object doesn't exist.
1502 * @constant
1503 */
1504 OBJECT_NOT_FOUND: 101,
1505
1506 /**
1507 * Error code indicating you tried to query with a datatype that doesn't
1508 * support it, like exact matching an array or object.
1509 * @constant
1510 */
1511 INVALID_QUERY: 102,
1512
1513 /**
1514 * Error code indicating a missing or invalid classname. Classnames are
1515 * case-sensitive. They must start with a letter, and a-zA-Z0-9_ are the
1516 * only valid characters.
1517 * @constant
1518 */
1519 INVALID_CLASS_NAME: 103,
1520
1521 /**
1522 * Error code indicating an unspecified object id.
1523 * @constant
1524 */
1525 MISSING_OBJECT_ID: 104,
1526
1527 /**
1528 * Error code indicating an invalid key name. Keys are case-sensitive. They
1529 * must start with a letter, and a-zA-Z0-9_ are the only valid characters.
1530 * @constant
1531 */
1532 INVALID_KEY_NAME: 105,
1533
1534 /**
1535 * Error code indicating a malformed pointer. You should not see this unless
1536 * you have been mucking about changing internal AV code.
1537 * @constant
1538 */
1539 INVALID_POINTER: 106,
1540
1541 /**
1542 * Error code indicating that badly formed JSON was received upstream. This
1543 * either indicates you have done something unusual with modifying how
1544 * things encode to JSON, or the network is failing badly.
1545 * @constant
1546 */
1547 INVALID_JSON: 107,
1548
1549 /**
1550 * Error code indicating that the feature you tried to access is only
1551 * available internally for testing purposes.
1552 * @constant
1553 */
1554 COMMAND_UNAVAILABLE: 108,
1555
1556 /**
1557 * You must call AV.initialize before using the AV library.
1558 * @constant
1559 */
1560 NOT_INITIALIZED: 109,
1561
1562 /**
1563 * Error code indicating that a field was set to an inconsistent type.
1564 * @constant
1565 */
1566 INCORRECT_TYPE: 111,
1567
1568 /**
1569 * Error code indicating an invalid channel name. A channel name is either
1570 * an empty string (the broadcast channel) or contains only a-zA-Z0-9_
1571 * characters.
1572 * @constant
1573 */
1574 INVALID_CHANNEL_NAME: 112,
1575
1576 /**
1577 * Error code indicating that push is misconfigured.
1578 * @constant
1579 */
1580 PUSH_MISCONFIGURED: 115,
1581
1582 /**
1583 * Error code indicating that the object is too large.
1584 * @constant
1585 */
1586 OBJECT_TOO_LARGE: 116,
1587
1588 /**
1589 * Error code indicating that the operation isn't allowed for clients.
1590 * @constant
1591 */
1592 OPERATION_FORBIDDEN: 119,
1593
1594 /**
1595 * Error code indicating the result was not found in the cache.
1596 * @constant
1597 */
1598 CACHE_MISS: 120,
1599
1600 /**
1601 * Error code indicating that an invalid key was used in a nested
1602 * JSONObject.
1603 * @constant
1604 */
1605 INVALID_NESTED_KEY: 121,
1606
1607 /**
1608 * Error code indicating that an invalid filename was used for AVFile.
1609 * A valid file name contains only a-zA-Z0-9_. characters and is between 1
1610 * and 128 characters.
1611 * @constant
1612 */
1613 INVALID_FILE_NAME: 122,
1614
1615 /**
1616 * Error code indicating an invalid ACL was provided.
1617 * @constant
1618 */
1619 INVALID_ACL: 123,
1620
1621 /**
1622 * Error code indicating that the request timed out on the server. Typically
1623 * this indicates that the request is too expensive to run.
1624 * @constant
1625 */
1626 TIMEOUT: 124,
1627
1628 /**
1629 * Error code indicating that the email address was invalid.
1630 * @constant
1631 */
1632 INVALID_EMAIL_ADDRESS: 125,
1633
1634 /**
1635 * Error code indicating a missing content type.
1636 * @constant
1637 */
1638 MISSING_CONTENT_TYPE: 126,
1639
1640 /**
1641 * Error code indicating a missing content length.
1642 * @constant
1643 */
1644 MISSING_CONTENT_LENGTH: 127,
1645
1646 /**
1647 * Error code indicating an invalid content length.
1648 * @constant
1649 */
1650 INVALID_CONTENT_LENGTH: 128,
1651
1652 /**
1653 * Error code indicating a file that was too large.
1654 * @constant
1655 */
1656 FILE_TOO_LARGE: 129,
1657
1658 /**
1659 * Error code indicating an error saving a file.
1660 * @constant
1661 */
1662 FILE_SAVE_ERROR: 130,
1663
1664 /**
1665 * Error code indicating an error deleting a file.
1666 * @constant
1667 */
1668 FILE_DELETE_ERROR: 153,
1669
1670 /**
1671 * Error code indicating that a unique field was given a value that is
1672 * already taken.
1673 * @constant
1674 */
1675 DUPLICATE_VALUE: 137,
1676
1677 /**
1678 * Error code indicating that a role's name is invalid.
1679 * @constant
1680 */
1681 INVALID_ROLE_NAME: 139,
1682
1683 /**
1684 * Error code indicating that an application quota was exceeded. Upgrade to
1685 * resolve.
1686 * @constant
1687 */
1688 EXCEEDED_QUOTA: 140,
1689
1690 /**
1691 * Error code indicating that a Cloud Code script failed.
1692 * @constant
1693 */
1694 SCRIPT_FAILED: 141,
1695
1696 /**
1697 * Error code indicating that a Cloud Code validation failed.
1698 * @constant
1699 */
1700 VALIDATION_ERROR: 142,
1701
1702 /**
1703 * Error code indicating that invalid image data was provided.
1704 * @constant
1705 */
1706 INVALID_IMAGE_DATA: 150,
1707
1708 /**
1709 * Error code indicating an unsaved file.
1710 * @constant
1711 */
1712 UNSAVED_FILE_ERROR: 151,
1713
1714 /**
1715 * Error code indicating an invalid push time.
1716 * @constant
1717 */
1718 INVALID_PUSH_TIME_ERROR: 152,
1719
1720 /**
1721 * Error code indicating that the username is missing or empty.
1722 * @constant
1723 */
1724 USERNAME_MISSING: 200,
1725
1726 /**
1727 * Error code indicating that the password is missing or empty.
1728 * @constant
1729 */
1730 PASSWORD_MISSING: 201,
1731
1732 /**
1733 * Error code indicating that the username has already been taken.
1734 * @constant
1735 */
1736 USERNAME_TAKEN: 202,
1737
1738 /**
1739 * Error code indicating that the email has already been taken.
1740 * @constant
1741 */
1742 EMAIL_TAKEN: 203,
1743
1744 /**
1745 * Error code indicating that the email is missing, but must be specified.
1746 * @constant
1747 */
1748 EMAIL_MISSING: 204,
1749
1750 /**
1751 * Error code indicating that a user with the specified email was not found.
1752 * @constant
1753 */
1754 EMAIL_NOT_FOUND: 205,
1755
1756 /**
1757 * Error code indicating that a user object without a valid session could
1758 * not be altered.
1759 * @constant
1760 */
1761 SESSION_MISSING: 206,
1762
1763 /**
1764 * Error code indicating that a user can only be created through signup.
1765 * @constant
1766 */
1767 MUST_CREATE_USER_THROUGH_SIGNUP: 207,
1768
1769 /**
1770 * Error code indicating that an an account being linked is already linked
1771 * to another user.
1772 * @constant
1773 */
1774 ACCOUNT_ALREADY_LINKED: 208,
1775
1776 /**
1777 * Error code indicating that a user cannot be linked to an account because
1778 * that account's id could not be found.
1779 * @constant
1780 */
1781 LINKED_ID_MISSING: 250,
1782
1783 /**
1784 * Error code indicating that a user with a linked (e.g. Facebook) account
1785 * has an invalid session.
1786 * @constant
1787 */
1788 INVALID_LINKED_SESSION: 251,
1789
1790 /**
1791 * Error code indicating that a service being linked (e.g. Facebook or
1792 * Twitter) is unsupported.
1793 * @constant
1794 */
1795 UNSUPPORTED_SERVICE: 252,
1796
1797 /**
1798 * Error code indicating a real error code is unavailable because
1799 * we had to use an XDomainRequest object to allow CORS requests in
1800 * Internet Explorer, which strips the body from HTTP responses that have
1801 * a non-2XX status code.
1802 * @constant
1803 */
1804 X_DOMAIN_REQUEST: 602
1805});
1806
1807module.exports = AVError;
1808
1809/***/ }),
1810/* 41 */
1811/***/ (function(module, exports) {
1812
1813module.exports = function (bitmap, value) {
1814 return {
1815 enumerable: !(bitmap & 1),
1816 configurable: !(bitmap & 2),
1817 writable: !(bitmap & 4),
1818 value: value
1819 };
1820};
1821
1822
1823/***/ }),
1824/* 42 */
1825/***/ (function(module, exports, __webpack_require__) {
1826
1827var toLength = __webpack_require__(249);
1828
1829// `LengthOfArrayLike` abstract operation
1830// https://tc39.es/ecma262/#sec-lengthofarraylike
1831module.exports = function (obj) {
1832 return toLength(obj.length);
1833};
1834
1835
1836/***/ }),
1837/* 43 */
1838/***/ (function(module, exports, __webpack_require__) {
1839
1840var createNonEnumerableProperty = __webpack_require__(36);
1841
1842module.exports = function (target, key, value, options) {
1843 if (options && options.enumerable) target[key] = value;
1844 else createNonEnumerableProperty(target, key, value);
1845 return target;
1846};
1847
1848
1849/***/ }),
1850/* 44 */
1851/***/ (function(module, exports, __webpack_require__) {
1852
1853"use strict";
1854
1855var aCallable = __webpack_require__(30);
1856
1857var PromiseCapability = function (C) {
1858 var resolve, reject;
1859 this.promise = new C(function ($$resolve, $$reject) {
1860 if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
1861 resolve = $$resolve;
1862 reject = $$reject;
1863 });
1864 this.resolve = aCallable(resolve);
1865 this.reject = aCallable(reject);
1866};
1867
1868// `NewPromiseCapability` abstract operation
1869// https://tc39.es/ecma262/#sec-newpromisecapability
1870module.exports.f = function (C) {
1871 return new PromiseCapability(C);
1872};
1873
1874
1875/***/ }),
1876/* 45 */
1877/***/ (function(module, __webpack_exports__, __webpack_require__) {
1878
1879"use strict";
1880/* harmony export (immutable) */ __webpack_exports__["a"] = isObject;
1881// Is a given variable an object?
1882function isObject(obj) {
1883 var type = typeof obj;
1884 return type === 'function' || type === 'object' && !!obj;
1885}
1886
1887
1888/***/ }),
1889/* 46 */
1890/***/ (function(module, __webpack_exports__, __webpack_require__) {
1891
1892"use strict";
1893/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(3);
1894/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__tagTester_js__ = __webpack_require__(15);
1895
1896
1897
1898// Is a given value an array?
1899// Delegates to ECMA5's native `Array.isArray`.
1900/* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0__setup_js__["k" /* nativeIsArray */] || Object(__WEBPACK_IMPORTED_MODULE_1__tagTester_js__["a" /* default */])('Array'));
1901
1902
1903/***/ }),
1904/* 47 */
1905/***/ (function(module, __webpack_exports__, __webpack_require__) {
1906
1907"use strict";
1908/* harmony export (immutable) */ __webpack_exports__["a"] = each;
1909/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__optimizeCb_js__ = __webpack_require__(77);
1910/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__ = __webpack_require__(24);
1911/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__keys_js__ = __webpack_require__(11);
1912
1913
1914
1915
1916// The cornerstone for collection functions, an `each`
1917// implementation, aka `forEach`.
1918// Handles raw objects in addition to array-likes. Treats all
1919// sparse array-likes as if they were dense.
1920function each(obj, iteratee, context) {
1921 iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__optimizeCb_js__["a" /* default */])(iteratee, context);
1922 var i, length;
1923 if (Object(__WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__["a" /* default */])(obj)) {
1924 for (i = 0, length = obj.length; i < length; i++) {
1925 iteratee(obj[i], i, obj);
1926 }
1927 } else {
1928 var _keys = Object(__WEBPACK_IMPORTED_MODULE_2__keys_js__["a" /* default */])(obj);
1929 for (i = 0, length = _keys.length; i < length; i++) {
1930 iteratee(obj[_keys[i]], _keys[i], obj);
1931 }
1932 }
1933 return obj;
1934}
1935
1936
1937/***/ }),
1938/* 48 */
1939/***/ (function(module, exports, __webpack_require__) {
1940
1941module.exports = __webpack_require__(370);
1942
1943/***/ }),
1944/* 49 */
1945/***/ (function(module, exports, __webpack_require__) {
1946
1947/* eslint-disable es-x/no-symbol -- required for testing */
1948var V8_VERSION = __webpack_require__(84);
1949var fails = __webpack_require__(4);
1950
1951// eslint-disable-next-line es-x/no-object-getownpropertysymbols -- required for testing
1952module.exports = !!Object.getOwnPropertySymbols && !fails(function () {
1953 var symbol = Symbol();
1954 // Chrome 38 Symbol has incorrect toString conversion
1955 // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
1956 return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
1957 // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
1958 !Symbol.sham && V8_VERSION && V8_VERSION < 41;
1959});
1960
1961
1962/***/ }),
1963/* 50 */
1964/***/ (function(module, exports, __webpack_require__) {
1965
1966var uncurryThis = __webpack_require__(6);
1967var aCallable = __webpack_require__(30);
1968var NATIVE_BIND = __webpack_require__(63);
1969
1970var bind = uncurryThis(uncurryThis.bind);
1971
1972// optional / simple context binding
1973module.exports = function (fn, that) {
1974 aCallable(fn);
1975 return that === undefined ? fn : NATIVE_BIND ? bind(fn, that) : function (/* ...args */) {
1976 return fn.apply(that, arguments);
1977 };
1978};
1979
1980
1981/***/ }),
1982/* 51 */
1983/***/ (function(module, exports, __webpack_require__) {
1984
1985/* global ActiveXObject -- old IE, WSH */
1986var anObject = __webpack_require__(21);
1987var definePropertiesModule = __webpack_require__(147);
1988var enumBugKeys = __webpack_require__(114);
1989var hiddenKeys = __webpack_require__(89);
1990var html = __webpack_require__(148);
1991var documentCreateElement = __webpack_require__(110);
1992var sharedKey = __webpack_require__(87);
1993
1994var GT = '>';
1995var LT = '<';
1996var PROTOTYPE = 'prototype';
1997var SCRIPT = 'script';
1998var IE_PROTO = sharedKey('IE_PROTO');
1999
2000var EmptyConstructor = function () { /* empty */ };
2001
2002var scriptTag = function (content) {
2003 return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
2004};
2005
2006// Create object with fake `null` prototype: use ActiveX Object with cleared prototype
2007var NullProtoObjectViaActiveX = function (activeXDocument) {
2008 activeXDocument.write(scriptTag(''));
2009 activeXDocument.close();
2010 var temp = activeXDocument.parentWindow.Object;
2011 activeXDocument = null; // avoid memory leak
2012 return temp;
2013};
2014
2015// Create object with fake `null` prototype: use iframe Object with cleared prototype
2016var NullProtoObjectViaIFrame = function () {
2017 // Thrash, waste and sodomy: IE GC bug
2018 var iframe = documentCreateElement('iframe');
2019 var JS = 'java' + SCRIPT + ':';
2020 var iframeDocument;
2021 iframe.style.display = 'none';
2022 html.appendChild(iframe);
2023 // https://github.com/zloirock/core-js/issues/475
2024 iframe.src = String(JS);
2025 iframeDocument = iframe.contentWindow.document;
2026 iframeDocument.open();
2027 iframeDocument.write(scriptTag('document.F=Object'));
2028 iframeDocument.close();
2029 return iframeDocument.F;
2030};
2031
2032// Check for document.domain and active x support
2033// No need to use active x approach when document.domain is not set
2034// see https://github.com/es-shims/es5-shim/issues/150
2035// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
2036// avoid IE GC bug
2037var activeXDocument;
2038var NullProtoObject = function () {
2039 try {
2040 activeXDocument = new ActiveXObject('htmlfile');
2041 } catch (error) { /* ignore */ }
2042 NullProtoObject = typeof document != 'undefined'
2043 ? document.domain && activeXDocument
2044 ? NullProtoObjectViaActiveX(activeXDocument) // old IE
2045 : NullProtoObjectViaIFrame()
2046 : NullProtoObjectViaActiveX(activeXDocument); // WSH
2047 var length = enumBugKeys.length;
2048 while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
2049 return NullProtoObject();
2050};
2051
2052hiddenKeys[IE_PROTO] = true;
2053
2054// `Object.create` method
2055// https://tc39.es/ecma262/#sec-object.create
2056// eslint-disable-next-line es-x/no-object-create -- safe
2057module.exports = Object.create || function create(O, Properties) {
2058 var result;
2059 if (O !== null) {
2060 EmptyConstructor[PROTOTYPE] = anObject(O);
2061 result = new EmptyConstructor();
2062 EmptyConstructor[PROTOTYPE] = null;
2063 // add "__proto__" for Object.getPrototypeOf polyfill
2064 result[IE_PROTO] = O;
2065 } else result = NullProtoObject();
2066 return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
2067};
2068
2069
2070/***/ }),
2071/* 52 */
2072/***/ (function(module, exports) {
2073
2074module.exports = {};
2075
2076
2077/***/ }),
2078/* 53 */
2079/***/ (function(module, exports, __webpack_require__) {
2080
2081var TO_STRING_TAG_SUPPORT = __webpack_require__(117);
2082var isCallable = __webpack_require__(7);
2083var classofRaw = __webpack_require__(65);
2084var wellKnownSymbol = __webpack_require__(8);
2085
2086var TO_STRING_TAG = wellKnownSymbol('toStringTag');
2087var $Object = Object;
2088
2089// ES3 wrong here
2090var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
2091
2092// fallback for IE11 Script Access Denied error
2093var tryGet = function (it, key) {
2094 try {
2095 return it[key];
2096 } catch (error) { /* empty */ }
2097};
2098
2099// getting tag from ES6+ `Object.prototype.toString`
2100module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
2101 var O, tag, result;
2102 return it === undefined ? 'Undefined' : it === null ? 'Null'
2103 // @@toStringTag case
2104 : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag
2105 // builtinTag case
2106 : CORRECT_ARGUMENTS ? classofRaw(O)
2107 // ES3 arguments fallback
2108 : (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;
2109};
2110
2111
2112/***/ }),
2113/* 54 */
2114/***/ (function(module, exports, __webpack_require__) {
2115
2116var TO_STRING_TAG_SUPPORT = __webpack_require__(117);
2117var defineProperty = __webpack_require__(32).f;
2118var createNonEnumerableProperty = __webpack_require__(36);
2119var hasOwn = __webpack_require__(14);
2120var toString = __webpack_require__(257);
2121var wellKnownSymbol = __webpack_require__(8);
2122
2123var TO_STRING_TAG = wellKnownSymbol('toStringTag');
2124
2125module.exports = function (it, TAG, STATIC, SET_METHOD) {
2126 if (it) {
2127 var target = STATIC ? it : it.prototype;
2128 if (!hasOwn(target, TO_STRING_TAG)) {
2129 defineProperty(target, TO_STRING_TAG, { configurable: true, value: TAG });
2130 }
2131 if (SET_METHOD && !TO_STRING_TAG_SUPPORT) {
2132 createNonEnumerableProperty(target, 'toString', toString);
2133 }
2134 }
2135};
2136
2137
2138/***/ }),
2139/* 55 */
2140/***/ (function(module, exports, __webpack_require__) {
2141
2142var global = __webpack_require__(9);
2143
2144module.exports = global.Promise;
2145
2146
2147/***/ }),
2148/* 56 */
2149/***/ (function(module, __webpack_exports__, __webpack_require__) {
2150
2151"use strict";
2152/* harmony export (immutable) */ __webpack_exports__["a"] = values;
2153/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__keys_js__ = __webpack_require__(11);
2154
2155
2156// Retrieve the values of an object's properties.
2157function values(obj) {
2158 var _keys = Object(__WEBPACK_IMPORTED_MODULE_0__keys_js__["a" /* default */])(obj);
2159 var length = _keys.length;
2160 var values = Array(length);
2161 for (var i = 0; i < length; i++) {
2162 values[i] = obj[_keys[i]];
2163 }
2164 return values;
2165}
2166
2167
2168/***/ }),
2169/* 57 */
2170/***/ (function(module, __webpack_exports__, __webpack_require__) {
2171
2172"use strict";
2173/* harmony export (immutable) */ __webpack_exports__["a"] = flatten;
2174/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(27);
2175/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__ = __webpack_require__(24);
2176/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isArray_js__ = __webpack_require__(46);
2177/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isArguments_js__ = __webpack_require__(123);
2178
2179
2180
2181
2182
2183// Internal implementation of a recursive `flatten` function.
2184function flatten(input, depth, strict, output) {
2185 output = output || [];
2186 if (!depth && depth !== 0) {
2187 depth = Infinity;
2188 } else if (depth <= 0) {
2189 return output.concat(input);
2190 }
2191 var idx = output.length;
2192 for (var i = 0, length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(input); i < length; i++) {
2193 var value = input[i];
2194 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))) {
2195 // Flatten current level of array or arguments object.
2196 if (depth > 1) {
2197 flatten(value, depth - 1, strict, output);
2198 idx = output.length;
2199 } else {
2200 var j = 0, len = value.length;
2201 while (j < len) output[idx++] = value[j++];
2202 }
2203 } else if (!strict) {
2204 output[idx++] = value;
2205 }
2206 }
2207 return output;
2208}
2209
2210
2211/***/ }),
2212/* 58 */
2213/***/ (function(module, __webpack_exports__, __webpack_require__) {
2214
2215"use strict";
2216/* harmony export (immutable) */ __webpack_exports__["a"] = map;
2217/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(18);
2218/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__ = __webpack_require__(24);
2219/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__keys_js__ = __webpack_require__(11);
2220
2221
2222
2223
2224// Return the results of applying the iteratee to each element.
2225function map(obj, iteratee, context) {
2226 iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(iteratee, context);
2227 var _keys = !Object(__WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__["a" /* default */])(obj) && Object(__WEBPACK_IMPORTED_MODULE_2__keys_js__["a" /* default */])(obj),
2228 length = (_keys || obj).length,
2229 results = Array(length);
2230 for (var index = 0; index < length; index++) {
2231 var currentKey = _keys ? _keys[index] : index;
2232 results[index] = iteratee(obj[currentKey], currentKey, obj);
2233 }
2234 return results;
2235}
2236
2237
2238/***/ }),
2239/* 59 */
2240/***/ (function(module, exports, __webpack_require__) {
2241
2242"use strict";
2243/* WEBPACK VAR INJECTION */(function(global) {
2244
2245var _interopRequireDefault = __webpack_require__(2);
2246
2247var _promise = _interopRequireDefault(__webpack_require__(12));
2248
2249var _concat = _interopRequireDefault(__webpack_require__(29));
2250
2251var _map = _interopRequireDefault(__webpack_require__(39));
2252
2253var _keys = _interopRequireDefault(__webpack_require__(212));
2254
2255var _stringify = _interopRequireDefault(__webpack_require__(34));
2256
2257var _indexOf = _interopRequireDefault(__webpack_require__(102));
2258
2259var _keys2 = _interopRequireDefault(__webpack_require__(48));
2260
2261var _ = __webpack_require__(1);
2262
2263var uuid = __webpack_require__(214);
2264
2265var debug = __webpack_require__(60);
2266
2267var _require = __webpack_require__(28),
2268 inherits = _require.inherits,
2269 parseDate = _require.parseDate;
2270
2271var version = __webpack_require__(217);
2272
2273var _require2 = __webpack_require__(61),
2274 setAdapters = _require2.setAdapters,
2275 adapterManager = _require2.adapterManager;
2276
2277var AV = global.AV || {}; // All internal configuration items
2278
2279AV._config = {
2280 serverURLs: {},
2281 useMasterKey: false,
2282 production: null,
2283 realtime: null,
2284 requestTimeout: null
2285};
2286var initialUserAgent = "LeanCloud-JS-SDK/".concat(version); // configs shared by all AV instances
2287
2288AV._sharedConfig = {
2289 userAgent: initialUserAgent,
2290 liveQueryRealtime: null
2291};
2292adapterManager.on('platformInfo', function (platformInfo) {
2293 var ua = initialUserAgent;
2294
2295 if (platformInfo) {
2296 if (platformInfo.userAgent) {
2297 ua = platformInfo.userAgent;
2298 } else {
2299 var comments = platformInfo.name;
2300
2301 if (platformInfo.version) {
2302 comments += "/".concat(platformInfo.version);
2303 }
2304
2305 if (platformInfo.extra) {
2306 comments += "; ".concat(platformInfo.extra);
2307 }
2308
2309 ua += " (".concat(comments, ")");
2310 }
2311 }
2312
2313 AV._sharedConfig.userAgent = ua;
2314});
2315/**
2316 * Contains all AV API classes and functions.
2317 * @namespace AV
2318 */
2319
2320/**
2321 * Returns prefix for localStorage keys used by this instance of AV.
2322 * @param {String} path The relative suffix to append to it.
2323 * null or undefined is treated as the empty string.
2324 * @return {String} The full key name.
2325 * @private
2326 */
2327
2328AV._getAVPath = function (path) {
2329 if (!AV.applicationId) {
2330 throw new Error('You need to call AV.initialize before using AV.');
2331 }
2332
2333 if (!path) {
2334 path = '';
2335 }
2336
2337 if (!_.isString(path)) {
2338 throw new Error("Tried to get a localStorage path that wasn't a String.");
2339 }
2340
2341 if (path[0] === '/') {
2342 path = path.substring(1);
2343 }
2344
2345 return 'AV/' + AV.applicationId + '/' + path;
2346};
2347/**
2348 * Returns the unique string for this app on this machine.
2349 * Gets reset when localStorage is cleared.
2350 * @private
2351 */
2352
2353
2354AV._installationId = null;
2355
2356AV._getInstallationId = function () {
2357 // See if it's cached in RAM.
2358 if (AV._installationId) {
2359 return _promise.default.resolve(AV._installationId);
2360 } // Try to get it from localStorage.
2361
2362
2363 var path = AV._getAVPath('installationId');
2364
2365 return AV.localStorage.getItemAsync(path).then(function (_installationId) {
2366 AV._installationId = _installationId;
2367
2368 if (!AV._installationId) {
2369 // It wasn't in localStorage, so create a new one.
2370 AV._installationId = _installationId = uuid();
2371 return AV.localStorage.setItemAsync(path, _installationId).then(function () {
2372 return _installationId;
2373 });
2374 }
2375
2376 return _installationId;
2377 });
2378};
2379
2380AV._subscriptionId = null;
2381
2382AV._refreshSubscriptionId = function () {
2383 var path = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : AV._getAVPath('subscriptionId');
2384 var subscriptionId = AV._subscriptionId = uuid();
2385 return AV.localStorage.setItemAsync(path, subscriptionId).then(function () {
2386 return subscriptionId;
2387 });
2388};
2389
2390AV._getSubscriptionId = function () {
2391 // See if it's cached in RAM.
2392 if (AV._subscriptionId) {
2393 return _promise.default.resolve(AV._subscriptionId);
2394 } // Try to get it from localStorage.
2395
2396
2397 var path = AV._getAVPath('subscriptionId');
2398
2399 return AV.localStorage.getItemAsync(path).then(function (_subscriptionId) {
2400 AV._subscriptionId = _subscriptionId;
2401
2402 if (!AV._subscriptionId) {
2403 // It wasn't in localStorage, so create a new one.
2404 _subscriptionId = AV._refreshSubscriptionId(path);
2405 }
2406
2407 return _subscriptionId;
2408 });
2409};
2410
2411AV._parseDate = parseDate; // A self-propagating extend function.
2412
2413AV._extend = function (protoProps, classProps) {
2414 var child = inherits(this, protoProps, classProps);
2415 child.extend = this.extend;
2416 return child;
2417};
2418/**
2419 * Converts a value in a AV Object into the appropriate representation.
2420 * This is the JS equivalent of Java's AV.maybeReferenceAndEncode(Object)
2421 * if seenObjects is falsey. Otherwise any AV.Objects not in
2422 * seenObjects will be fully embedded rather than encoded
2423 * as a pointer. This array will be used to prevent going into an infinite
2424 * loop because we have circular references. If <seenObjects>
2425 * is set, then none of the AV Objects that are serialized can be dirty.
2426 * @private
2427 */
2428
2429
2430AV._encode = function (value, seenObjects, disallowObjects) {
2431 var full = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
2432
2433 if (value instanceof AV.Object) {
2434 if (disallowObjects) {
2435 throw new Error('AV.Objects not allowed here');
2436 }
2437
2438 if (!seenObjects || _.include(seenObjects, value) || !value._hasData) {
2439 return value._toPointer();
2440 }
2441
2442 return value._toFullJSON((0, _concat.default)(seenObjects).call(seenObjects, value), full);
2443 }
2444
2445 if (value instanceof AV.ACL) {
2446 return value.toJSON();
2447 }
2448
2449 if (_.isDate(value)) {
2450 return full ? {
2451 __type: 'Date',
2452 iso: value.toJSON()
2453 } : value.toJSON();
2454 }
2455
2456 if (value instanceof AV.GeoPoint) {
2457 return value.toJSON();
2458 }
2459
2460 if (_.isArray(value)) {
2461 return (0, _map.default)(_).call(_, value, function (x) {
2462 return AV._encode(x, seenObjects, disallowObjects, full);
2463 });
2464 }
2465
2466 if (_.isRegExp(value)) {
2467 return value.source;
2468 }
2469
2470 if (value instanceof AV.Relation) {
2471 return value.toJSON();
2472 }
2473
2474 if (value instanceof AV.Op) {
2475 return value.toJSON();
2476 }
2477
2478 if (value instanceof AV.File) {
2479 if (!value.url() && !value.id) {
2480 throw new Error('Tried to save an object containing an unsaved file.');
2481 }
2482
2483 return value._toFullJSON(seenObjects, full);
2484 }
2485
2486 if (_.isObject(value)) {
2487 return _.mapObject(value, function (v, k) {
2488 return AV._encode(v, seenObjects, disallowObjects, full);
2489 });
2490 }
2491
2492 return value;
2493};
2494/**
2495 * The inverse function of AV._encode.
2496 * @private
2497 */
2498
2499
2500AV._decode = function (value, key) {
2501 if (!_.isObject(value) || _.isDate(value)) {
2502 return value;
2503 }
2504
2505 if (_.isArray(value)) {
2506 return (0, _map.default)(_).call(_, value, function (v) {
2507 return AV._decode(v);
2508 });
2509 }
2510
2511 if (value instanceof AV.Object) {
2512 return value;
2513 }
2514
2515 if (value instanceof AV.File) {
2516 return value;
2517 }
2518
2519 if (value instanceof AV.Op) {
2520 return value;
2521 }
2522
2523 if (value instanceof AV.GeoPoint) {
2524 return value;
2525 }
2526
2527 if (value instanceof AV.ACL) {
2528 return value;
2529 }
2530
2531 if (key === 'ACL') {
2532 return new AV.ACL(value);
2533 }
2534
2535 if (value.__op) {
2536 return AV.Op._decode(value);
2537 }
2538
2539 var className;
2540
2541 if (value.__type === 'Pointer') {
2542 className = value.className;
2543
2544 var pointer = AV.Object._create(className);
2545
2546 if ((0, _keys.default)(value).length > 3) {
2547 var v = _.clone(value);
2548
2549 delete v.__type;
2550 delete v.className;
2551
2552 pointer._finishFetch(v, true);
2553 } else {
2554 pointer._finishFetch({
2555 objectId: value.objectId
2556 }, false);
2557 }
2558
2559 return pointer;
2560 }
2561
2562 if (value.__type === 'Object') {
2563 // It's an Object included in a query result.
2564 className = value.className;
2565
2566 var _v = _.clone(value);
2567
2568 delete _v.__type;
2569 delete _v.className;
2570
2571 var object = AV.Object._create(className);
2572
2573 object._finishFetch(_v, true);
2574
2575 return object;
2576 }
2577
2578 if (value.__type === 'Date') {
2579 return AV._parseDate(value.iso);
2580 }
2581
2582 if (value.__type === 'GeoPoint') {
2583 return new AV.GeoPoint({
2584 latitude: value.latitude,
2585 longitude: value.longitude
2586 });
2587 }
2588
2589 if (value.__type === 'Relation') {
2590 if (!key) throw new Error('key missing decoding a Relation');
2591 var relation = new AV.Relation(null, key);
2592 relation.targetClassName = value.className;
2593 return relation;
2594 }
2595
2596 if (value.__type === 'File') {
2597 var file = new AV.File(value.name);
2598
2599 var _v2 = _.clone(value);
2600
2601 delete _v2.__type;
2602
2603 file._finishFetch(_v2);
2604
2605 return file;
2606 }
2607
2608 return _.mapObject(value, AV._decode);
2609};
2610/**
2611 * The inverse function of {@link AV.Object#toFullJSON}.
2612 * @since 3.0.0
2613 * @method
2614 * @param {Object}
2615 * return {AV.Object|AV.File|any}
2616 */
2617
2618
2619AV.parseJSON = AV._decode;
2620/**
2621 * Similar to JSON.parse, except that AV internal types will be used if possible.
2622 * Inverse to {@link AV.stringify}
2623 * @since 3.14.0
2624 * @param {string} text the string to parse.
2625 * @return {AV.Object|AV.File|any}
2626 */
2627
2628AV.parse = function (text) {
2629 return AV.parseJSON(JSON.parse(text));
2630};
2631/**
2632 * Serialize a target containing AV.Object, similar to JSON.stringify.
2633 * Inverse to {@link AV.parse}
2634 * @since 3.14.0
2635 * @return {string}
2636 */
2637
2638
2639AV.stringify = function (target) {
2640 return (0, _stringify.default)(AV._encode(target, [], false, true));
2641};
2642
2643AV._encodeObjectOrArray = function (value) {
2644 var encodeAVObject = function encodeAVObject(object) {
2645 if (object && object._toFullJSON) {
2646 object = object._toFullJSON([]);
2647 }
2648
2649 return _.mapObject(object, function (value) {
2650 return AV._encode(value, []);
2651 });
2652 };
2653
2654 if (_.isArray(value)) {
2655 return (0, _map.default)(value).call(value, function (object) {
2656 return encodeAVObject(object);
2657 });
2658 } else {
2659 return encodeAVObject(value);
2660 }
2661};
2662
2663AV._arrayEach = _.each;
2664/**
2665 * Does a deep traversal of every item in object, calling func on every one.
2666 * @param {Object} object The object or array to traverse deeply.
2667 * @param {Function} func The function to call for every item. It will
2668 * be passed the item as an argument. If it returns a truthy value, that
2669 * value will replace the item in its parent container.
2670 * @returns {} the result of calling func on the top-level object itself.
2671 * @private
2672 */
2673
2674AV._traverse = function (object, func, seen) {
2675 if (object instanceof AV.Object) {
2676 seen = seen || [];
2677
2678 if ((0, _indexOf.default)(_).call(_, seen, object) >= 0) {
2679 // We've already visited this object in this call.
2680 return;
2681 }
2682
2683 seen.push(object);
2684
2685 AV._traverse(object.attributes, func, seen);
2686
2687 return func(object);
2688 }
2689
2690 if (object instanceof AV.Relation || object instanceof AV.File) {
2691 // Nothing needs to be done, but we don't want to recurse into the
2692 // object's parent infinitely, so we catch this case.
2693 return func(object);
2694 }
2695
2696 if (_.isArray(object)) {
2697 _.each(object, function (child, index) {
2698 var newChild = AV._traverse(child, func, seen);
2699
2700 if (newChild) {
2701 object[index] = newChild;
2702 }
2703 });
2704
2705 return func(object);
2706 }
2707
2708 if (_.isObject(object)) {
2709 AV._each(object, function (child, key) {
2710 var newChild = AV._traverse(child, func, seen);
2711
2712 if (newChild) {
2713 object[key] = newChild;
2714 }
2715 });
2716
2717 return func(object);
2718 }
2719
2720 return func(object);
2721};
2722/**
2723 * This is like _.each, except:
2724 * * it doesn't work for so-called array-like objects,
2725 * * it does work for dictionaries with a "length" attribute.
2726 * @private
2727 */
2728
2729
2730AV._objectEach = AV._each = function (obj, callback) {
2731 if (_.isObject(obj)) {
2732 _.each((0, _keys2.default)(_).call(_, obj), function (key) {
2733 callback(obj[key], key);
2734 });
2735 } else {
2736 _.each(obj, callback);
2737 }
2738};
2739/**
2740 * @namespace
2741 * @since 3.14.0
2742 */
2743
2744
2745AV.debug = {
2746 /**
2747 * Enable debug
2748 */
2749 enable: function enable() {
2750 var namespaces = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'leancloud*';
2751 return debug.enable(namespaces);
2752 },
2753
2754 /**
2755 * Disable debug
2756 */
2757 disable: debug.disable
2758};
2759/**
2760 * Specify Adapters
2761 * @since 4.4.0
2762 * @function
2763 * @param {Adapters} newAdapters See {@link https://url.leanapp.cn/adapter-type-definitions @leancloud/adapter-types} for detailed definitions.
2764 */
2765
2766AV.setAdapters = setAdapters;
2767module.exports = AV;
2768/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(105)))
2769
2770/***/ }),
2771/* 60 */
2772/***/ (function(module, exports, __webpack_require__) {
2773
2774"use strict";
2775
2776
2777function _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); }
2778
2779/* eslint-env browser */
2780
2781/**
2782 * This is the web browser implementation of `debug()`.
2783 */
2784exports.log = log;
2785exports.formatArgs = formatArgs;
2786exports.save = save;
2787exports.load = load;
2788exports.useColors = useColors;
2789exports.storage = localstorage();
2790/**
2791 * Colors.
2792 */
2793
2794exports.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'];
2795/**
2796 * Currently only WebKit-based Web Inspectors, Firefox >= v31,
2797 * and the Firebug extension (any Firefox version) are known
2798 * to support "%c" CSS customizations.
2799 *
2800 * TODO: add a `localStorage` variable to explicitly enable/disable colors
2801 */
2802// eslint-disable-next-line complexity
2803
2804function useColors() {
2805 // NB: In an Electron preload script, document will be defined but not fully
2806 // initialized. Since we know we're in Chrome, we'll just detect this case
2807 // explicitly
2808 if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
2809 return true;
2810 } // Internet Explorer and Edge do not support colors.
2811
2812
2813 if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
2814 return false;
2815 } // Is webkit? http://stackoverflow.com/a/16459606/376773
2816 // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
2817
2818
2819 return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
2820 typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
2821 // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
2822 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
2823 typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
2824}
2825/**
2826 * Colorize log arguments if enabled.
2827 *
2828 * @api public
2829 */
2830
2831
2832function formatArgs(args) {
2833 args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff);
2834
2835 if (!this.useColors) {
2836 return;
2837 }
2838
2839 var c = 'color: ' + this.color;
2840 args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other
2841 // arguments passed either before or after the %c, so we need to
2842 // figure out the correct index to insert the CSS into
2843
2844 var index = 0;
2845 var lastC = 0;
2846 args[0].replace(/%[a-zA-Z%]/g, function (match) {
2847 if (match === '%%') {
2848 return;
2849 }
2850
2851 index++;
2852
2853 if (match === '%c') {
2854 // We only are interested in the *last* %c
2855 // (the user may have provided their own)
2856 lastC = index;
2857 }
2858 });
2859 args.splice(lastC, 0, c);
2860}
2861/**
2862 * Invokes `console.log()` when available.
2863 * No-op when `console.log` is not a "function".
2864 *
2865 * @api public
2866 */
2867
2868
2869function log() {
2870 var _console;
2871
2872 // This hackery is required for IE8/9, where
2873 // the `console.log` function doesn't have 'apply'
2874 return (typeof console === "undefined" ? "undefined" : _typeof(console)) === 'object' && console.log && (_console = console).log.apply(_console, arguments);
2875}
2876/**
2877 * Save `namespaces`.
2878 *
2879 * @param {String} namespaces
2880 * @api private
2881 */
2882
2883
2884function save(namespaces) {
2885 try {
2886 if (namespaces) {
2887 exports.storage.setItem('debug', namespaces);
2888 } else {
2889 exports.storage.removeItem('debug');
2890 }
2891 } catch (error) {// Swallow
2892 // XXX (@Qix-) should we be logging these?
2893 }
2894}
2895/**
2896 * Load `namespaces`.
2897 *
2898 * @return {String} returns the previously persisted debug modes
2899 * @api private
2900 */
2901
2902
2903function load() {
2904 var r;
2905
2906 try {
2907 r = exports.storage.getItem('debug');
2908 } catch (error) {} // Swallow
2909 // XXX (@Qix-) should we be logging these?
2910 // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
2911
2912
2913 if (!r && typeof process !== 'undefined' && 'env' in process) {
2914 r = process.env.DEBUG;
2915 }
2916
2917 return r;
2918}
2919/**
2920 * Localstorage attempts to return the localstorage.
2921 *
2922 * This is necessary because safari throws
2923 * when a user disables cookies/localstorage
2924 * and you attempt to access it.
2925 *
2926 * @return {LocalStorage}
2927 * @api private
2928 */
2929
2930
2931function localstorage() {
2932 try {
2933 // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
2934 // The Browser also has localStorage in the global context.
2935 return localStorage;
2936 } catch (error) {// Swallow
2937 // XXX (@Qix-) should we be logging these?
2938 }
2939}
2940
2941module.exports = __webpack_require__(375)(exports);
2942var formatters = module.exports.formatters;
2943/**
2944 * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
2945 */
2946
2947formatters.j = function (v) {
2948 try {
2949 return JSON.stringify(v);
2950 } catch (error) {
2951 return '[UnexpectedJSONParseError]: ' + error.message;
2952 }
2953};
2954
2955
2956
2957/***/ }),
2958/* 61 */
2959/***/ (function(module, exports, __webpack_require__) {
2960
2961"use strict";
2962
2963
2964var _interopRequireDefault = __webpack_require__(2);
2965
2966var _keys = _interopRequireDefault(__webpack_require__(48));
2967
2968var _ = __webpack_require__(1);
2969
2970var EventEmitter = __webpack_require__(218);
2971
2972var _require = __webpack_require__(28),
2973 inherits = _require.inherits;
2974
2975var AdapterManager = inherits(EventEmitter, {
2976 constructor: function constructor() {
2977 EventEmitter.apply(this);
2978 this._adapters = {};
2979 },
2980 getAdapter: function getAdapter(name) {
2981 var adapter = this._adapters[name];
2982
2983 if (adapter === undefined) {
2984 throw new Error("".concat(name, " adapter is not configured"));
2985 }
2986
2987 return adapter;
2988 },
2989 setAdapters: function setAdapters(newAdapters) {
2990 var _this = this;
2991
2992 _.extend(this._adapters, newAdapters);
2993
2994 (0, _keys.default)(_).call(_, newAdapters).forEach(function (name) {
2995 return _this.emit(name, newAdapters[name]);
2996 });
2997 }
2998});
2999var adapterManager = new AdapterManager();
3000module.exports = {
3001 getAdapter: adapterManager.getAdapter.bind(adapterManager),
3002 setAdapters: adapterManager.setAdapters.bind(adapterManager),
3003 adapterManager: adapterManager
3004};
3005
3006/***/ }),
3007/* 62 */
3008/***/ (function(module, exports, __webpack_require__) {
3009
3010var NATIVE_BIND = __webpack_require__(63);
3011
3012var FunctionPrototype = Function.prototype;
3013var apply = FunctionPrototype.apply;
3014var call = FunctionPrototype.call;
3015
3016// eslint-disable-next-line es-x/no-reflect -- safe
3017module.exports = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call.bind(apply) : function () {
3018 return call.apply(apply, arguments);
3019});
3020
3021
3022/***/ }),
3023/* 63 */
3024/***/ (function(module, exports, __webpack_require__) {
3025
3026var fails = __webpack_require__(4);
3027
3028module.exports = !fails(function () {
3029 // eslint-disable-next-line es-x/no-function-prototype-bind -- safe
3030 var test = (function () { /* empty */ }).bind();
3031 // eslint-disable-next-line no-prototype-builtins -- safe
3032 return typeof test != 'function' || test.hasOwnProperty('prototype');
3033});
3034
3035
3036/***/ }),
3037/* 64 */
3038/***/ (function(module, exports, __webpack_require__) {
3039
3040var DESCRIPTORS = __webpack_require__(19);
3041var call = __webpack_require__(10);
3042var propertyIsEnumerableModule = __webpack_require__(138);
3043var createPropertyDescriptor = __webpack_require__(41);
3044var toIndexedObject = __webpack_require__(33);
3045var toPropertyKey = __webpack_require__(82);
3046var hasOwn = __webpack_require__(14);
3047var IE8_DOM_DEFINE = __webpack_require__(141);
3048
3049// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
3050var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
3051
3052// `Object.getOwnPropertyDescriptor` method
3053// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
3054exports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
3055 O = toIndexedObject(O);
3056 P = toPropertyKey(P);
3057 if (IE8_DOM_DEFINE) try {
3058 return $getOwnPropertyDescriptor(O, P);
3059 } catch (error) { /* empty */ }
3060 if (hasOwn(O, P)) return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]);
3061};
3062
3063
3064/***/ }),
3065/* 65 */
3066/***/ (function(module, exports, __webpack_require__) {
3067
3068var uncurryThis = __webpack_require__(6);
3069
3070var toString = uncurryThis({}.toString);
3071var stringSlice = uncurryThis(''.slice);
3072
3073module.exports = function (it) {
3074 return stringSlice(toString(it), 8, -1);
3075};
3076
3077
3078/***/ }),
3079/* 66 */
3080/***/ (function(module, exports) {
3081
3082var $String = String;
3083
3084module.exports = function (argument) {
3085 try {
3086 return $String(argument);
3087 } catch (error) {
3088 return 'Object';
3089 }
3090};
3091
3092
3093/***/ }),
3094/* 67 */
3095/***/ (function(module, exports, __webpack_require__) {
3096
3097var IS_PURE = __webpack_require__(31);
3098var store = __webpack_require__(108);
3099
3100(module.exports = function (key, value) {
3101 return store[key] || (store[key] = value !== undefined ? value : {});
3102})('versions', []).push({
3103 version: '3.23.3',
3104 mode: IS_PURE ? 'pure' : 'global',
3105 copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
3106 license: 'https://github.com/zloirock/core-js/blob/v3.23.3/LICENSE',
3107 source: 'https://github.com/zloirock/core-js'
3108});
3109
3110
3111/***/ }),
3112/* 68 */
3113/***/ (function(module, exports, __webpack_require__) {
3114
3115var bind = __webpack_require__(50);
3116var call = __webpack_require__(10);
3117var anObject = __webpack_require__(21);
3118var tryToString = __webpack_require__(66);
3119var isArrayIteratorMethod = __webpack_require__(149);
3120var lengthOfArrayLike = __webpack_require__(42);
3121var isPrototypeOf = __webpack_require__(20);
3122var getIterator = __webpack_require__(150);
3123var getIteratorMethod = __webpack_require__(90);
3124var iteratorClose = __webpack_require__(151);
3125
3126var $TypeError = TypeError;
3127
3128var Result = function (stopped, result) {
3129 this.stopped = stopped;
3130 this.result = result;
3131};
3132
3133var ResultPrototype = Result.prototype;
3134
3135module.exports = function (iterable, unboundFunction, options) {
3136 var that = options && options.that;
3137 var AS_ENTRIES = !!(options && options.AS_ENTRIES);
3138 var IS_ITERATOR = !!(options && options.IS_ITERATOR);
3139 var INTERRUPTED = !!(options && options.INTERRUPTED);
3140 var fn = bind(unboundFunction, that);
3141 var iterator, iterFn, index, length, result, next, step;
3142
3143 var stop = function (condition) {
3144 if (iterator) iteratorClose(iterator, 'normal', condition);
3145 return new Result(true, condition);
3146 };
3147
3148 var callFn = function (value) {
3149 if (AS_ENTRIES) {
3150 anObject(value);
3151 return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
3152 } return INTERRUPTED ? fn(value, stop) : fn(value);
3153 };
3154
3155 if (IS_ITERATOR) {
3156 iterator = iterable;
3157 } else {
3158 iterFn = getIteratorMethod(iterable);
3159 if (!iterFn) throw $TypeError(tryToString(iterable) + ' is not iterable');
3160 // optimisation for array iterators
3161 if (isArrayIteratorMethod(iterFn)) {
3162 for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
3163 result = callFn(iterable[index]);
3164 if (result && isPrototypeOf(ResultPrototype, result)) return result;
3165 } return new Result(false);
3166 }
3167 iterator = getIterator(iterable, iterFn);
3168 }
3169
3170 next = iterator.next;
3171 while (!(step = call(next, iterator)).done) {
3172 try {
3173 result = callFn(step.value);
3174 } catch (error) {
3175 iteratorClose(iterator, 'throw', error);
3176 }
3177 if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;
3178 } return new Result(false);
3179};
3180
3181
3182/***/ }),
3183/* 69 */
3184/***/ (function(module, exports, __webpack_require__) {
3185
3186var classof = __webpack_require__(53);
3187
3188var $String = String;
3189
3190module.exports = function (argument) {
3191 if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
3192 return $String(argument);
3193};
3194
3195
3196/***/ }),
3197/* 70 */
3198/***/ (function(module, exports, __webpack_require__) {
3199
3200"use strict";
3201
3202var toIndexedObject = __webpack_require__(33);
3203var addToUnscopables = __webpack_require__(152);
3204var Iterators = __webpack_require__(52);
3205var InternalStateModule = __webpack_require__(91);
3206var defineProperty = __webpack_require__(32).f;
3207var defineIterator = __webpack_require__(153);
3208var IS_PURE = __webpack_require__(31);
3209var DESCRIPTORS = __webpack_require__(19);
3210
3211var ARRAY_ITERATOR = 'Array Iterator';
3212var setInternalState = InternalStateModule.set;
3213var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
3214
3215// `Array.prototype.entries` method
3216// https://tc39.es/ecma262/#sec-array.prototype.entries
3217// `Array.prototype.keys` method
3218// https://tc39.es/ecma262/#sec-array.prototype.keys
3219// `Array.prototype.values` method
3220// https://tc39.es/ecma262/#sec-array.prototype.values
3221// `Array.prototype[@@iterator]` method
3222// https://tc39.es/ecma262/#sec-array.prototype-@@iterator
3223// `CreateArrayIterator` internal method
3224// https://tc39.es/ecma262/#sec-createarrayiterator
3225module.exports = defineIterator(Array, 'Array', function (iterated, kind) {
3226 setInternalState(this, {
3227 type: ARRAY_ITERATOR,
3228 target: toIndexedObject(iterated), // target
3229 index: 0, // next index
3230 kind: kind // kind
3231 });
3232// `%ArrayIteratorPrototype%.next` method
3233// https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
3234}, function () {
3235 var state = getInternalState(this);
3236 var target = state.target;
3237 var kind = state.kind;
3238 var index = state.index++;
3239 if (!target || index >= target.length) {
3240 state.target = undefined;
3241 return { value: undefined, done: true };
3242 }
3243 if (kind == 'keys') return { value: index, done: false };
3244 if (kind == 'values') return { value: target[index], done: false };
3245 return { value: [index, target[index]], done: false };
3246}, 'values');
3247
3248// argumentsList[@@iterator] is %ArrayProto_values%
3249// https://tc39.es/ecma262/#sec-createunmappedargumentsobject
3250// https://tc39.es/ecma262/#sec-createmappedargumentsobject
3251var values = Iterators.Arguments = Iterators.Array;
3252
3253// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
3254addToUnscopables('keys');
3255addToUnscopables('values');
3256addToUnscopables('entries');
3257
3258// V8 ~ Chrome 45- bug
3259if (!IS_PURE && DESCRIPTORS && values.name !== 'values') try {
3260 defineProperty(values, 'name', { value: 'values' });
3261} catch (error) { /* empty */ }
3262
3263
3264/***/ }),
3265/* 71 */
3266/***/ (function(module, exports) {
3267
3268module.exports = function (exec) {
3269 try {
3270 return { error: false, value: exec() };
3271 } catch (error) {
3272 return { error: true, value: error };
3273 }
3274};
3275
3276
3277/***/ }),
3278/* 72 */
3279/***/ (function(module, exports, __webpack_require__) {
3280
3281var global = __webpack_require__(9);
3282var NativePromiseConstructor = __webpack_require__(55);
3283var isCallable = __webpack_require__(7);
3284var isForced = __webpack_require__(142);
3285var inspectSource = __webpack_require__(118);
3286var wellKnownSymbol = __webpack_require__(8);
3287var IS_BROWSER = __webpack_require__(268);
3288var IS_PURE = __webpack_require__(31);
3289var V8_VERSION = __webpack_require__(84);
3290
3291var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
3292var SPECIES = wellKnownSymbol('species');
3293var SUBCLASSING = false;
3294var NATIVE_PROMISE_REJECTION_EVENT = isCallable(global.PromiseRejectionEvent);
3295
3296var FORCED_PROMISE_CONSTRUCTOR = isForced('Promise', function () {
3297 var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(NativePromiseConstructor);
3298 var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(NativePromiseConstructor);
3299 // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
3300 // https://bugs.chromium.org/p/chromium/issues/detail?id=830565
3301 // We can't detect it synchronously, so just check versions
3302 if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true;
3303 // We need Promise#{ catch, finally } in the pure version for preventing prototype pollution
3304 if (IS_PURE && !(NativePromisePrototype['catch'] && NativePromisePrototype['finally'])) return true;
3305 // We can't use @@species feature detection in V8 since it causes
3306 // deoptimization and performance degradation
3307 // https://github.com/zloirock/core-js/issues/679
3308 if (V8_VERSION >= 51 && /native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) return false;
3309 // Detect correctness of subclassing with @@species support
3310 var promise = new NativePromiseConstructor(function (resolve) { resolve(1); });
3311 var FakePromise = function (exec) {
3312 exec(function () { /* empty */ }, function () { /* empty */ });
3313 };
3314 var constructor = promise.constructor = {};
3315 constructor[SPECIES] = FakePromise;
3316 SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise;
3317 if (!SUBCLASSING) return true;
3318 // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
3319 return !GLOBAL_CORE_JS_PROMISE && IS_BROWSER && !NATIVE_PROMISE_REJECTION_EVENT;
3320});
3321
3322module.exports = {
3323 CONSTRUCTOR: FORCED_PROMISE_CONSTRUCTOR,
3324 REJECTION_EVENT: NATIVE_PROMISE_REJECTION_EVENT,
3325 SUBCLASSING: SUBCLASSING
3326};
3327
3328
3329/***/ }),
3330/* 73 */
3331/***/ (function(module, exports, __webpack_require__) {
3332
3333__webpack_require__(70);
3334var DOMIterables = __webpack_require__(278);
3335var global = __webpack_require__(9);
3336var classof = __webpack_require__(53);
3337var createNonEnumerableProperty = __webpack_require__(36);
3338var Iterators = __webpack_require__(52);
3339var wellKnownSymbol = __webpack_require__(8);
3340
3341var TO_STRING_TAG = wellKnownSymbol('toStringTag');
3342
3343for (var COLLECTION_NAME in DOMIterables) {
3344 var Collection = global[COLLECTION_NAME];
3345 var CollectionPrototype = Collection && Collection.prototype;
3346 if (CollectionPrototype && classof(CollectionPrototype) !== TO_STRING_TAG) {
3347 createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);
3348 }
3349 Iterators[COLLECTION_NAME] = Iterators.Array;
3350}
3351
3352
3353/***/ }),
3354/* 74 */
3355/***/ (function(module, __webpack_exports__, __webpack_require__) {
3356
3357"use strict";
3358/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return hasStringTagBug; });
3359/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return isIE11; });
3360/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(3);
3361/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__hasObjectTag_js__ = __webpack_require__(285);
3362
3363
3364
3365// In IE 10 - Edge 13, `DataView` has string tag `'[object Object]'`.
3366// In IE 11, the most common among them, this problem also applies to
3367// `Map`, `WeakMap` and `Set`.
3368var hasStringTagBug = (
3369 __WEBPACK_IMPORTED_MODULE_0__setup_js__["s" /* supportsDataView */] && Object(__WEBPACK_IMPORTED_MODULE_1__hasObjectTag_js__["a" /* default */])(new DataView(new ArrayBuffer(8)))
3370 ),
3371 isIE11 = (typeof Map !== 'undefined' && Object(__WEBPACK_IMPORTED_MODULE_1__hasObjectTag_js__["a" /* default */])(new Map));
3372
3373
3374/***/ }),
3375/* 75 */
3376/***/ (function(module, __webpack_exports__, __webpack_require__) {
3377
3378"use strict";
3379/* harmony export (immutable) */ __webpack_exports__["a"] = allKeys;
3380/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isObject_js__ = __webpack_require__(45);
3381/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(3);
3382/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__collectNonEnumProps_js__ = __webpack_require__(172);
3383
3384
3385
3386
3387// Retrieve all the enumerable property names of an object.
3388function allKeys(obj) {
3389 if (!Object(__WEBPACK_IMPORTED_MODULE_0__isObject_js__["a" /* default */])(obj)) return [];
3390 var keys = [];
3391 for (var key in obj) keys.push(key);
3392 // Ahem, IE < 9.
3393 if (__WEBPACK_IMPORTED_MODULE_1__setup_js__["h" /* hasEnumBug */]) Object(__WEBPACK_IMPORTED_MODULE_2__collectNonEnumProps_js__["a" /* default */])(obj, keys);
3394 return keys;
3395}
3396
3397
3398/***/ }),
3399/* 76 */
3400/***/ (function(module, __webpack_exports__, __webpack_require__) {
3401
3402"use strict";
3403/* harmony export (immutable) */ __webpack_exports__["a"] = toPath;
3404/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(23);
3405/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__toPath_js__ = __webpack_require__(181);
3406
3407
3408
3409// Internal wrapper for `_.toPath` to enable minification.
3410// Similar to `cb` for `_.iteratee`.
3411function toPath(path) {
3412 return __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].toPath(path);
3413}
3414
3415
3416/***/ }),
3417/* 77 */
3418/***/ (function(module, __webpack_exports__, __webpack_require__) {
3419
3420"use strict";
3421/* harmony export (immutable) */ __webpack_exports__["a"] = optimizeCb;
3422// Internal function that returns an efficient (for current engines) version
3423// of the passed-in callback, to be repeatedly applied in other Underscore
3424// functions.
3425function optimizeCb(func, context, argCount) {
3426 if (context === void 0) return func;
3427 switch (argCount == null ? 3 : argCount) {
3428 case 1: return function(value) {
3429 return func.call(context, value);
3430 };
3431 // The 2-argument case is omitted because we’re not using it.
3432 case 3: return function(value, index, collection) {
3433 return func.call(context, value, index, collection);
3434 };
3435 case 4: return function(accumulator, value, index, collection) {
3436 return func.call(context, accumulator, value, index, collection);
3437 };
3438 }
3439 return function() {
3440 return func.apply(context, arguments);
3441 };
3442}
3443
3444
3445/***/ }),
3446/* 78 */
3447/***/ (function(module, __webpack_exports__, __webpack_require__) {
3448
3449"use strict";
3450/* harmony export (immutable) */ __webpack_exports__["a"] = filter;
3451/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(18);
3452/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__each_js__ = __webpack_require__(47);
3453
3454
3455
3456// Return all the elements that pass a truth test.
3457function filter(obj, predicate, context) {
3458 var results = [];
3459 predicate = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(predicate, context);
3460 Object(__WEBPACK_IMPORTED_MODULE_1__each_js__["a" /* default */])(obj, function(value, index, list) {
3461 if (predicate(value, index, list)) results.push(value);
3462 });
3463 return results;
3464}
3465
3466
3467/***/ }),
3468/* 79 */
3469/***/ (function(module, __webpack_exports__, __webpack_require__) {
3470
3471"use strict";
3472/* harmony export (immutable) */ __webpack_exports__["a"] = contains;
3473/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(24);
3474/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__values_js__ = __webpack_require__(56);
3475/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__indexOf_js__ = __webpack_require__(197);
3476
3477
3478
3479
3480// Determine if the array or object contains a given item (using `===`).
3481function contains(obj, item, fromIndex, guard) {
3482 if (!Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" /* default */])(obj)) obj = Object(__WEBPACK_IMPORTED_MODULE_1__values_js__["a" /* default */])(obj);
3483 if (typeof fromIndex != 'number' || guard) fromIndex = 0;
3484 return Object(__WEBPACK_IMPORTED_MODULE_2__indexOf_js__["a" /* default */])(obj, item, fromIndex) >= 0;
3485}
3486
3487
3488/***/ }),
3489/* 80 */
3490/***/ (function(module, exports, __webpack_require__) {
3491
3492var classof = __webpack_require__(65);
3493
3494// `IsArray` abstract operation
3495// https://tc39.es/ecma262/#sec-isarray
3496// eslint-disable-next-line es-x/no-array-isarray -- safe
3497module.exports = Array.isArray || function isArray(argument) {
3498 return classof(argument) == 'Array';
3499};
3500
3501
3502/***/ }),
3503/* 81 */
3504/***/ (function(module, exports, __webpack_require__) {
3505
3506module.exports = __webpack_require__(222);
3507
3508/***/ }),
3509/* 82 */
3510/***/ (function(module, exports, __webpack_require__) {
3511
3512var toPrimitive = __webpack_require__(242);
3513var isSymbol = __webpack_require__(83);
3514
3515// `ToPropertyKey` abstract operation
3516// https://tc39.es/ecma262/#sec-topropertykey
3517module.exports = function (argument) {
3518 var key = toPrimitive(argument, 'string');
3519 return isSymbol(key) ? key : key + '';
3520};
3521
3522
3523/***/ }),
3524/* 83 */
3525/***/ (function(module, exports, __webpack_require__) {
3526
3527var getBuiltIn = __webpack_require__(16);
3528var isCallable = __webpack_require__(7);
3529var isPrototypeOf = __webpack_require__(20);
3530var USE_SYMBOL_AS_UID = __webpack_require__(140);
3531
3532var $Object = Object;
3533
3534module.exports = USE_SYMBOL_AS_UID ? function (it) {
3535 return typeof it == 'symbol';
3536} : function (it) {
3537 var $Symbol = getBuiltIn('Symbol');
3538 return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it));
3539};
3540
3541
3542/***/ }),
3543/* 84 */
3544/***/ (function(module, exports, __webpack_require__) {
3545
3546var global = __webpack_require__(9);
3547var userAgent = __webpack_require__(85);
3548
3549var process = global.process;
3550var Deno = global.Deno;
3551var versions = process && process.versions || Deno && Deno.version;
3552var v8 = versions && versions.v8;
3553var match, version;
3554
3555if (v8) {
3556 match = v8.split('.');
3557 // in old Chrome, versions of V8 isn't V8 = Chrome / 10
3558 // but their correct versions are not interesting for us
3559 version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
3560}
3561
3562// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
3563// so check `userAgent` even if `.v8` exists, but 0
3564if (!version && userAgent) {
3565 match = userAgent.match(/Edge\/(\d+)/);
3566 if (!match || match[1] >= 74) {
3567 match = userAgent.match(/Chrome\/(\d+)/);
3568 if (match) version = +match[1];
3569 }
3570}
3571
3572module.exports = version;
3573
3574
3575/***/ }),
3576/* 85 */
3577/***/ (function(module, exports, __webpack_require__) {
3578
3579var getBuiltIn = __webpack_require__(16);
3580
3581module.exports = getBuiltIn('navigator', 'userAgent') || '';
3582
3583
3584/***/ }),
3585/* 86 */
3586/***/ (function(module, exports, __webpack_require__) {
3587
3588var hasOwn = __webpack_require__(14);
3589var isCallable = __webpack_require__(7);
3590var toObject = __webpack_require__(35);
3591var sharedKey = __webpack_require__(87);
3592var CORRECT_PROTOTYPE_GETTER = __webpack_require__(144);
3593
3594var IE_PROTO = sharedKey('IE_PROTO');
3595var $Object = Object;
3596var ObjectPrototype = $Object.prototype;
3597
3598// `Object.getPrototypeOf` method
3599// https://tc39.es/ecma262/#sec-object.getprototypeof
3600// eslint-disable-next-line es-x/no-object-getprototypeof -- safe
3601module.exports = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) {
3602 var object = toObject(O);
3603 if (hasOwn(object, IE_PROTO)) return object[IE_PROTO];
3604 var constructor = object.constructor;
3605 if (isCallable(constructor) && object instanceof constructor) {
3606 return constructor.prototype;
3607 } return object instanceof $Object ? ObjectPrototype : null;
3608};
3609
3610
3611/***/ }),
3612/* 87 */
3613/***/ (function(module, exports, __webpack_require__) {
3614
3615var shared = __webpack_require__(67);
3616var uid = __webpack_require__(109);
3617
3618var keys = shared('keys');
3619
3620module.exports = function (key) {
3621 return keys[key] || (keys[key] = uid(key));
3622};
3623
3624
3625/***/ }),
3626/* 88 */
3627/***/ (function(module, exports, __webpack_require__) {
3628
3629/* eslint-disable no-proto -- safe */
3630var uncurryThis = __webpack_require__(6);
3631var anObject = __webpack_require__(21);
3632var aPossiblePrototype = __webpack_require__(245);
3633
3634// `Object.setPrototypeOf` method
3635// https://tc39.es/ecma262/#sec-object.setprototypeof
3636// Works with __proto__ only. Old v8 can't work with null proto objects.
3637// eslint-disable-next-line es-x/no-object-setprototypeof -- safe
3638module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {
3639 var CORRECT_SETTER = false;
3640 var test = {};
3641 var setter;
3642 try {
3643 // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
3644 setter = uncurryThis(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
3645 setter(test, []);
3646 CORRECT_SETTER = test instanceof Array;
3647 } catch (error) { /* empty */ }
3648 return function setPrototypeOf(O, proto) {
3649 anObject(O);
3650 aPossiblePrototype(proto);
3651 if (CORRECT_SETTER) setter(O, proto);
3652 else O.__proto__ = proto;
3653 return O;
3654 };
3655}() : undefined);
3656
3657
3658/***/ }),
3659/* 89 */
3660/***/ (function(module, exports) {
3661
3662module.exports = {};
3663
3664
3665/***/ }),
3666/* 90 */
3667/***/ (function(module, exports, __webpack_require__) {
3668
3669var classof = __webpack_require__(53);
3670var getMethod = __webpack_require__(107);
3671var Iterators = __webpack_require__(52);
3672var wellKnownSymbol = __webpack_require__(8);
3673
3674var ITERATOR = wellKnownSymbol('iterator');
3675
3676module.exports = function (it) {
3677 if (it != undefined) return getMethod(it, ITERATOR)
3678 || getMethod(it, '@@iterator')
3679 || Iterators[classof(it)];
3680};
3681
3682
3683/***/ }),
3684/* 91 */
3685/***/ (function(module, exports, __webpack_require__) {
3686
3687var NATIVE_WEAK_MAP = __webpack_require__(254);
3688var global = __webpack_require__(9);
3689var uncurryThis = __webpack_require__(6);
3690var isObject = __webpack_require__(17);
3691var createNonEnumerableProperty = __webpack_require__(36);
3692var hasOwn = __webpack_require__(14);
3693var shared = __webpack_require__(108);
3694var sharedKey = __webpack_require__(87);
3695var hiddenKeys = __webpack_require__(89);
3696
3697var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
3698var TypeError = global.TypeError;
3699var WeakMap = global.WeakMap;
3700var set, get, has;
3701
3702var enforce = function (it) {
3703 return has(it) ? get(it) : set(it, {});
3704};
3705
3706var getterFor = function (TYPE) {
3707 return function (it) {
3708 var state;
3709 if (!isObject(it) || (state = get(it)).type !== TYPE) {
3710 throw TypeError('Incompatible receiver, ' + TYPE + ' required');
3711 } return state;
3712 };
3713};
3714
3715if (NATIVE_WEAK_MAP || shared.state) {
3716 var store = shared.state || (shared.state = new WeakMap());
3717 var wmget = uncurryThis(store.get);
3718 var wmhas = uncurryThis(store.has);
3719 var wmset = uncurryThis(store.set);
3720 set = function (it, metadata) {
3721 if (wmhas(store, it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
3722 metadata.facade = it;
3723 wmset(store, it, metadata);
3724 return metadata;
3725 };
3726 get = function (it) {
3727 return wmget(store, it) || {};
3728 };
3729 has = function (it) {
3730 return wmhas(store, it);
3731 };
3732} else {
3733 var STATE = sharedKey('state');
3734 hiddenKeys[STATE] = true;
3735 set = function (it, metadata) {
3736 if (hasOwn(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
3737 metadata.facade = it;
3738 createNonEnumerableProperty(it, STATE, metadata);
3739 return metadata;
3740 };
3741 get = function (it) {
3742 return hasOwn(it, STATE) ? it[STATE] : {};
3743 };
3744 has = function (it) {
3745 return hasOwn(it, STATE);
3746 };
3747}
3748
3749module.exports = {
3750 set: set,
3751 get: get,
3752 has: has,
3753 enforce: enforce,
3754 getterFor: getterFor
3755};
3756
3757
3758/***/ }),
3759/* 92 */
3760/***/ (function(module, exports) {
3761
3762// empty
3763
3764
3765/***/ }),
3766/* 93 */
3767/***/ (function(module, exports, __webpack_require__) {
3768
3769var uncurryThis = __webpack_require__(6);
3770var fails = __webpack_require__(4);
3771var isCallable = __webpack_require__(7);
3772var classof = __webpack_require__(53);
3773var getBuiltIn = __webpack_require__(16);
3774var inspectSource = __webpack_require__(118);
3775
3776var noop = function () { /* empty */ };
3777var empty = [];
3778var construct = getBuiltIn('Reflect', 'construct');
3779var constructorRegExp = /^\s*(?:class|function)\b/;
3780var exec = uncurryThis(constructorRegExp.exec);
3781var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
3782
3783var isConstructorModern = function isConstructor(argument) {
3784 if (!isCallable(argument)) return false;
3785 try {
3786 construct(noop, empty, argument);
3787 return true;
3788 } catch (error) {
3789 return false;
3790 }
3791};
3792
3793var isConstructorLegacy = function isConstructor(argument) {
3794 if (!isCallable(argument)) return false;
3795 switch (classof(argument)) {
3796 case 'AsyncFunction':
3797 case 'GeneratorFunction':
3798 case 'AsyncGeneratorFunction': return false;
3799 }
3800 try {
3801 // we can't check .prototype since constructors produced by .bind haven't it
3802 // `Function#toString` throws on some built-it function in some legacy engines
3803 // (for example, `DOMQuad` and similar in FF41-)
3804 return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));
3805 } catch (error) {
3806 return true;
3807 }
3808};
3809
3810isConstructorLegacy.sham = true;
3811
3812// `IsConstructor` abstract operation
3813// https://tc39.es/ecma262/#sec-isconstructor
3814module.exports = !construct || fails(function () {
3815 var called;
3816 return isConstructorModern(isConstructorModern.call)
3817 || !isConstructorModern(Object)
3818 || !isConstructorModern(function () { called = true; })
3819 || called;
3820}) ? isConstructorLegacy : isConstructorModern;
3821
3822
3823/***/ }),
3824/* 94 */
3825/***/ (function(module, exports, __webpack_require__) {
3826
3827var uncurryThis = __webpack_require__(6);
3828
3829module.exports = uncurryThis([].slice);
3830
3831
3832/***/ }),
3833/* 95 */
3834/***/ (function(module, exports, __webpack_require__) {
3835
3836"use strict";
3837
3838var charAt = __webpack_require__(277).charAt;
3839var toString = __webpack_require__(69);
3840var InternalStateModule = __webpack_require__(91);
3841var defineIterator = __webpack_require__(153);
3842
3843var STRING_ITERATOR = 'String Iterator';
3844var setInternalState = InternalStateModule.set;
3845var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR);
3846
3847// `String.prototype[@@iterator]` method
3848// https://tc39.es/ecma262/#sec-string.prototype-@@iterator
3849defineIterator(String, 'String', function (iterated) {
3850 setInternalState(this, {
3851 type: STRING_ITERATOR,
3852 string: toString(iterated),
3853 index: 0
3854 });
3855// `%StringIteratorPrototype%.next` method
3856// https://tc39.es/ecma262/#sec-%stringiteratorprototype%.next
3857}, function next() {
3858 var state = getInternalState(this);
3859 var string = state.string;
3860 var index = state.index;
3861 var point;
3862 if (index >= string.length) return { value: undefined, done: true };
3863 point = charAt(string, index);
3864 state.index += point.length;
3865 return { value: point, done: false };
3866});
3867
3868
3869/***/ }),
3870/* 96 */
3871/***/ (function(module, __webpack_exports__, __webpack_require__) {
3872
3873"use strict";
3874/* harmony export (immutable) */ __webpack_exports__["a"] = matcher;
3875/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__extendOwn_js__ = __webpack_require__(127);
3876/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isMatch_js__ = __webpack_require__(173);
3877
3878
3879
3880// Returns a predicate for checking whether an object has a given set of
3881// `key:value` pairs.
3882function matcher(attrs) {
3883 attrs = Object(__WEBPACK_IMPORTED_MODULE_0__extendOwn_js__["a" /* default */])({}, attrs);
3884 return function(obj) {
3885 return Object(__WEBPACK_IMPORTED_MODULE_1__isMatch_js__["a" /* default */])(obj, attrs);
3886 };
3887}
3888
3889
3890/***/ }),
3891/* 97 */
3892/***/ (function(module, __webpack_exports__, __webpack_require__) {
3893
3894"use strict";
3895/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(22);
3896/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__executeBound_js__ = __webpack_require__(189);
3897/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__underscore_js__ = __webpack_require__(23);
3898
3899
3900
3901
3902// Partially apply a function by creating a version that has had some of its
3903// arguments pre-filled, without changing its dynamic `this` context. `_` acts
3904// as a placeholder by default, allowing any combination of arguments to be
3905// pre-filled. Set `_.partial.placeholder` for a custom placeholder argument.
3906var partial = Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(func, boundArgs) {
3907 var placeholder = partial.placeholder;
3908 var bound = function() {
3909 var position = 0, length = boundArgs.length;
3910 var args = Array(length);
3911 for (var i = 0; i < length; i++) {
3912 args[i] = boundArgs[i] === placeholder ? arguments[position++] : boundArgs[i];
3913 }
3914 while (position < arguments.length) args.push(arguments[position++]);
3915 return Object(__WEBPACK_IMPORTED_MODULE_1__executeBound_js__["a" /* default */])(func, bound, this, this, args);
3916 };
3917 return bound;
3918});
3919
3920partial.placeholder = __WEBPACK_IMPORTED_MODULE_2__underscore_js__["a" /* default */];
3921/* harmony default export */ __webpack_exports__["a"] = (partial);
3922
3923
3924/***/ }),
3925/* 98 */
3926/***/ (function(module, __webpack_exports__, __webpack_require__) {
3927
3928"use strict";
3929/* harmony export (immutable) */ __webpack_exports__["a"] = group;
3930/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(18);
3931/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__each_js__ = __webpack_require__(47);
3932
3933
3934
3935// An internal function used for aggregate "group by" operations.
3936function group(behavior, partition) {
3937 return function(obj, iteratee, context) {
3938 var result = partition ? [[], []] : {};
3939 iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(iteratee, context);
3940 Object(__WEBPACK_IMPORTED_MODULE_1__each_js__["a" /* default */])(obj, function(value, index) {
3941 var key = iteratee(value, index, obj);
3942 behavior(result, value, key);
3943 });
3944 return result;
3945 };
3946}
3947
3948
3949/***/ }),
3950/* 99 */
3951/***/ (function(module, exports, __webpack_require__) {
3952
3953"use strict";
3954
3955var toPropertyKey = __webpack_require__(82);
3956var definePropertyModule = __webpack_require__(32);
3957var createPropertyDescriptor = __webpack_require__(41);
3958
3959module.exports = function (object, key, value) {
3960 var propertyKey = toPropertyKey(key);
3961 if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));
3962 else object[propertyKey] = value;
3963};
3964
3965
3966/***/ }),
3967/* 100 */
3968/***/ (function(module, exports, __webpack_require__) {
3969
3970var fails = __webpack_require__(4);
3971var wellKnownSymbol = __webpack_require__(8);
3972var V8_VERSION = __webpack_require__(84);
3973
3974var SPECIES = wellKnownSymbol('species');
3975
3976module.exports = function (METHOD_NAME) {
3977 // We can't use this feature detection in V8 since it causes
3978 // deoptimization and serious performance degradation
3979 // https://github.com/zloirock/core-js/issues/677
3980 return V8_VERSION >= 51 || !fails(function () {
3981 var array = [];
3982 var constructor = array.constructor = {};
3983 constructor[SPECIES] = function () {
3984 return { foo: 1 };
3985 };
3986 return array[METHOD_NAME](Boolean).foo !== 1;
3987 });
3988};
3989
3990
3991/***/ }),
3992/* 101 */
3993/***/ (function(module, exports, __webpack_require__) {
3994
3995var bind = __webpack_require__(50);
3996var uncurryThis = __webpack_require__(6);
3997var IndexedObject = __webpack_require__(139);
3998var toObject = __webpack_require__(35);
3999var lengthOfArrayLike = __webpack_require__(42);
4000var arraySpeciesCreate = __webpack_require__(211);
4001
4002var push = uncurryThis([].push);
4003
4004// `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation
4005var createMethod = function (TYPE) {
4006 var IS_MAP = TYPE == 1;
4007 var IS_FILTER = TYPE == 2;
4008 var IS_SOME = TYPE == 3;
4009 var IS_EVERY = TYPE == 4;
4010 var IS_FIND_INDEX = TYPE == 6;
4011 var IS_FILTER_REJECT = TYPE == 7;
4012 var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
4013 return function ($this, callbackfn, that, specificCreate) {
4014 var O = toObject($this);
4015 var self = IndexedObject(O);
4016 var boundFunction = bind(callbackfn, that);
4017 var length = lengthOfArrayLike(self);
4018 var index = 0;
4019 var create = specificCreate || arraySpeciesCreate;
4020 var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined;
4021 var value, result;
4022 for (;length > index; index++) if (NO_HOLES || index in self) {
4023 value = self[index];
4024 result = boundFunction(value, index, O);
4025 if (TYPE) {
4026 if (IS_MAP) target[index] = result; // map
4027 else if (result) switch (TYPE) {
4028 case 3: return true; // some
4029 case 5: return value; // find
4030 case 6: return index; // findIndex
4031 case 2: push(target, value); // filter
4032 } else switch (TYPE) {
4033 case 4: return false; // every
4034 case 7: push(target, value); // filterReject
4035 }
4036 }
4037 }
4038 return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
4039 };
4040};
4041
4042module.exports = {
4043 // `Array.prototype.forEach` method
4044 // https://tc39.es/ecma262/#sec-array.prototype.foreach
4045 forEach: createMethod(0),
4046 // `Array.prototype.map` method
4047 // https://tc39.es/ecma262/#sec-array.prototype.map
4048 map: createMethod(1),
4049 // `Array.prototype.filter` method
4050 // https://tc39.es/ecma262/#sec-array.prototype.filter
4051 filter: createMethod(2),
4052 // `Array.prototype.some` method
4053 // https://tc39.es/ecma262/#sec-array.prototype.some
4054 some: createMethod(3),
4055 // `Array.prototype.every` method
4056 // https://tc39.es/ecma262/#sec-array.prototype.every
4057 every: createMethod(4),
4058 // `Array.prototype.find` method
4059 // https://tc39.es/ecma262/#sec-array.prototype.find
4060 find: createMethod(5),
4061 // `Array.prototype.findIndex` method
4062 // https://tc39.es/ecma262/#sec-array.prototype.findIndex
4063 findIndex: createMethod(6),
4064 // `Array.prototype.filterReject` method
4065 // https://github.com/tc39/proposal-array-filtering
4066 filterReject: createMethod(7)
4067};
4068
4069
4070/***/ }),
4071/* 102 */
4072/***/ (function(module, exports, __webpack_require__) {
4073
4074module.exports = __webpack_require__(365);
4075
4076/***/ }),
4077/* 103 */
4078/***/ (function(module, exports, __webpack_require__) {
4079
4080"use strict";
4081
4082
4083var _interopRequireDefault = __webpack_require__(2);
4084
4085var _typeof2 = _interopRequireDefault(__webpack_require__(135));
4086
4087var _filter = _interopRequireDefault(__webpack_require__(430));
4088
4089var _map = _interopRequireDefault(__webpack_require__(39));
4090
4091var _keys = _interopRequireDefault(__webpack_require__(212));
4092
4093var _stringify = _interopRequireDefault(__webpack_require__(34));
4094
4095var _concat = _interopRequireDefault(__webpack_require__(29));
4096
4097var _ = __webpack_require__(1);
4098
4099var _require = __webpack_require__(435),
4100 timeout = _require.timeout;
4101
4102var debug = __webpack_require__(60);
4103
4104var debugRequest = debug('leancloud:request');
4105var debugRequestError = debug('leancloud:request:error');
4106
4107var _require2 = __webpack_require__(61),
4108 getAdapter = _require2.getAdapter;
4109
4110var requestsCount = 0;
4111
4112var ajax = function ajax(_ref) {
4113 var method = _ref.method,
4114 url = _ref.url,
4115 query = _ref.query,
4116 data = _ref.data,
4117 _ref$headers = _ref.headers,
4118 headers = _ref$headers === void 0 ? {} : _ref$headers,
4119 time = _ref.timeout,
4120 onprogress = _ref.onprogress;
4121
4122 if (query) {
4123 var _context, _context2, _context4;
4124
4125 var queryString = (0, _filter.default)(_context = (0, _map.default)(_context2 = (0, _keys.default)(query)).call(_context2, function (key) {
4126 var _context3;
4127
4128 var value = query[key];
4129 if (value === undefined) return undefined;
4130 var v = (0, _typeof2.default)(value) === 'object' ? (0, _stringify.default)(value) : value;
4131 return (0, _concat.default)(_context3 = "".concat(encodeURIComponent(key), "=")).call(_context3, encodeURIComponent(v));
4132 })).call(_context, function (qs) {
4133 return qs;
4134 }).join('&');
4135 url = (0, _concat.default)(_context4 = "".concat(url, "?")).call(_context4, queryString);
4136 }
4137
4138 var count = requestsCount++;
4139 debugRequest('request(%d) %s %s %o %o %o', count, method, url, query, data, headers);
4140 var request = getAdapter('request');
4141 var promise = request(url, {
4142 method: method,
4143 headers: headers,
4144 data: data,
4145 onprogress: onprogress
4146 }).then(function (response) {
4147 debugRequest('response(%d) %d %O %o', count, response.status, response.data || response.text, response.header);
4148
4149 if (response.ok === false) {
4150 var error = new Error();
4151 error.response = response;
4152 throw error;
4153 }
4154
4155 return response.data;
4156 }).catch(function (error) {
4157 if (error.response) {
4158 if (!debug.enabled('leancloud:request')) {
4159 debugRequestError('request(%d) %s %s %o %o %o', count, method, url, query, data, headers);
4160 }
4161
4162 debugRequestError('response(%d) %d %O %o', count, error.response.status, error.response.data || error.response.text, error.response.header);
4163 error.statusCode = error.response.status;
4164 error.responseText = error.response.text;
4165 error.response = error.response.data;
4166 }
4167
4168 throw error;
4169 });
4170 return time ? timeout(promise, time) : promise;
4171};
4172
4173module.exports = ajax;
4174
4175/***/ }),
4176/* 104 */
4177/***/ (function(module, exports, __webpack_require__) {
4178
4179module.exports = __webpack_require__(440);
4180
4181/***/ }),
4182/* 105 */
4183/***/ (function(module, exports) {
4184
4185var g;
4186
4187// This works in non-strict mode
4188g = (function() {
4189 return this;
4190})();
4191
4192try {
4193 // This works if eval is allowed (see CSP)
4194 g = g || Function("return this")() || (1,eval)("this");
4195} catch(e) {
4196 // This works if the window reference is available
4197 if(typeof window === "object")
4198 g = window;
4199}
4200
4201// g can still be undefined, but nothing to do about it...
4202// We return undefined, instead of nothing here, so it's
4203// easier to handle this case. if(!global) { ...}
4204
4205module.exports = g;
4206
4207
4208/***/ }),
4209/* 106 */
4210/***/ (function(module, exports) {
4211
4212var $TypeError = TypeError;
4213
4214// `RequireObjectCoercible` abstract operation
4215// https://tc39.es/ecma262/#sec-requireobjectcoercible
4216module.exports = function (it) {
4217 if (it == undefined) throw $TypeError("Can't call method on " + it);
4218 return it;
4219};
4220
4221
4222/***/ }),
4223/* 107 */
4224/***/ (function(module, exports, __webpack_require__) {
4225
4226var aCallable = __webpack_require__(30);
4227
4228// `GetMethod` abstract operation
4229// https://tc39.es/ecma262/#sec-getmethod
4230module.exports = function (V, P) {
4231 var func = V[P];
4232 return func == null ? undefined : aCallable(func);
4233};
4234
4235
4236/***/ }),
4237/* 108 */
4238/***/ (function(module, exports, __webpack_require__) {
4239
4240var global = __webpack_require__(9);
4241var defineGlobalProperty = __webpack_require__(244);
4242
4243var SHARED = '__core-js_shared__';
4244var store = global[SHARED] || defineGlobalProperty(SHARED, {});
4245
4246module.exports = store;
4247
4248
4249/***/ }),
4250/* 109 */
4251/***/ (function(module, exports, __webpack_require__) {
4252
4253var uncurryThis = __webpack_require__(6);
4254
4255var id = 0;
4256var postfix = Math.random();
4257var toString = uncurryThis(1.0.toString);
4258
4259module.exports = function (key) {
4260 return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
4261};
4262
4263
4264/***/ }),
4265/* 110 */
4266/***/ (function(module, exports, __webpack_require__) {
4267
4268var global = __webpack_require__(9);
4269var isObject = __webpack_require__(17);
4270
4271var document = global.document;
4272// typeof document.createElement is 'object' in old IE
4273var EXISTS = isObject(document) && isObject(document.createElement);
4274
4275module.exports = function (it) {
4276 return EXISTS ? document.createElement(it) : {};
4277};
4278
4279
4280/***/ }),
4281/* 111 */
4282/***/ (function(module, exports, __webpack_require__) {
4283
4284var internalObjectKeys = __webpack_require__(145);
4285var enumBugKeys = __webpack_require__(114);
4286
4287var hiddenKeys = enumBugKeys.concat('length', 'prototype');
4288
4289// `Object.getOwnPropertyNames` method
4290// https://tc39.es/ecma262/#sec-object.getownpropertynames
4291// eslint-disable-next-line es-x/no-object-getownpropertynames -- safe
4292exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
4293 return internalObjectKeys(O, hiddenKeys);
4294};
4295
4296
4297/***/ }),
4298/* 112 */
4299/***/ (function(module, exports, __webpack_require__) {
4300
4301var toIntegerOrInfinity = __webpack_require__(113);
4302
4303var max = Math.max;
4304var min = Math.min;
4305
4306// Helper for a popular repeating case of the spec:
4307// Let integer be ? ToInteger(index).
4308// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
4309module.exports = function (index, length) {
4310 var integer = toIntegerOrInfinity(index);
4311 return integer < 0 ? max(integer + length, 0) : min(integer, length);
4312};
4313
4314
4315/***/ }),
4316/* 113 */
4317/***/ (function(module, exports, __webpack_require__) {
4318
4319var trunc = __webpack_require__(248);
4320
4321// `ToIntegerOrInfinity` abstract operation
4322// https://tc39.es/ecma262/#sec-tointegerorinfinity
4323module.exports = function (argument) {
4324 var number = +argument;
4325 // eslint-disable-next-line no-self-compare -- NaN check
4326 return number !== number || number === 0 ? 0 : trunc(number);
4327};
4328
4329
4330/***/ }),
4331/* 114 */
4332/***/ (function(module, exports) {
4333
4334// IE8- don't enum bug keys
4335module.exports = [
4336 'constructor',
4337 'hasOwnProperty',
4338 'isPrototypeOf',
4339 'propertyIsEnumerable',
4340 'toLocaleString',
4341 'toString',
4342 'valueOf'
4343];
4344
4345
4346/***/ }),
4347/* 115 */
4348/***/ (function(module, exports) {
4349
4350// eslint-disable-next-line es-x/no-object-getownpropertysymbols -- safe
4351exports.f = Object.getOwnPropertySymbols;
4352
4353
4354/***/ }),
4355/* 116 */
4356/***/ (function(module, exports, __webpack_require__) {
4357
4358var internalObjectKeys = __webpack_require__(145);
4359var enumBugKeys = __webpack_require__(114);
4360
4361// `Object.keys` method
4362// https://tc39.es/ecma262/#sec-object.keys
4363// eslint-disable-next-line es-x/no-object-keys -- safe
4364module.exports = Object.keys || function keys(O) {
4365 return internalObjectKeys(O, enumBugKeys);
4366};
4367
4368
4369/***/ }),
4370/* 117 */
4371/***/ (function(module, exports, __webpack_require__) {
4372
4373var wellKnownSymbol = __webpack_require__(8);
4374
4375var TO_STRING_TAG = wellKnownSymbol('toStringTag');
4376var test = {};
4377
4378test[TO_STRING_TAG] = 'z';
4379
4380module.exports = String(test) === '[object z]';
4381
4382
4383/***/ }),
4384/* 118 */
4385/***/ (function(module, exports, __webpack_require__) {
4386
4387var uncurryThis = __webpack_require__(6);
4388var isCallable = __webpack_require__(7);
4389var store = __webpack_require__(108);
4390
4391var functionToString = uncurryThis(Function.toString);
4392
4393// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
4394if (!isCallable(store.inspectSource)) {
4395 store.inspectSource = function (it) {
4396 return functionToString(it);
4397 };
4398}
4399
4400module.exports = store.inspectSource;
4401
4402
4403/***/ }),
4404/* 119 */
4405/***/ (function(module, exports, __webpack_require__) {
4406
4407var classof = __webpack_require__(65);
4408var global = __webpack_require__(9);
4409
4410module.exports = classof(global.process) == 'process';
4411
4412
4413/***/ }),
4414/* 120 */
4415/***/ (function(module, __webpack_exports__, __webpack_require__) {
4416
4417"use strict";
4418Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
4419/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(3);
4420/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "VERSION", function() { return __WEBPACK_IMPORTED_MODULE_0__setup_js__["e"]; });
4421/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__restArguments_js__ = __webpack_require__(22);
4422/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "restArguments", function() { return __WEBPACK_IMPORTED_MODULE_1__restArguments_js__["a"]; });
4423/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isObject_js__ = __webpack_require__(45);
4424/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isObject", function() { return __WEBPACK_IMPORTED_MODULE_2__isObject_js__["a"]; });
4425/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isNull_js__ = __webpack_require__(280);
4426/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isNull", function() { return __WEBPACK_IMPORTED_MODULE_3__isNull_js__["a"]; });
4427/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__isUndefined_js__ = __webpack_require__(162);
4428/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isUndefined", function() { return __WEBPACK_IMPORTED_MODULE_4__isUndefined_js__["a"]; });
4429/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__isBoolean_js__ = __webpack_require__(163);
4430/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isBoolean", function() { return __WEBPACK_IMPORTED_MODULE_5__isBoolean_js__["a"]; });
4431/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__isElement_js__ = __webpack_require__(281);
4432/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isElement", function() { return __WEBPACK_IMPORTED_MODULE_6__isElement_js__["a"]; });
4433/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__isString_js__ = __webpack_require__(121);
4434/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isString", function() { return __WEBPACK_IMPORTED_MODULE_7__isString_js__["a"]; });
4435/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__isNumber_js__ = __webpack_require__(164);
4436/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isNumber", function() { return __WEBPACK_IMPORTED_MODULE_8__isNumber_js__["a"]; });
4437/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__isDate_js__ = __webpack_require__(282);
4438/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isDate", function() { return __WEBPACK_IMPORTED_MODULE_9__isDate_js__["a"]; });
4439/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__isRegExp_js__ = __webpack_require__(283);
4440/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isRegExp", function() { return __WEBPACK_IMPORTED_MODULE_10__isRegExp_js__["a"]; });
4441/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__isError_js__ = __webpack_require__(284);
4442/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isError", function() { return __WEBPACK_IMPORTED_MODULE_11__isError_js__["a"]; });
4443/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__isSymbol_js__ = __webpack_require__(165);
4444/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isSymbol", function() { return __WEBPACK_IMPORTED_MODULE_12__isSymbol_js__["a"]; });
4445/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__isArrayBuffer_js__ = __webpack_require__(166);
4446/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isArrayBuffer", function() { return __WEBPACK_IMPORTED_MODULE_13__isArrayBuffer_js__["a"]; });
4447/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__isDataView_js__ = __webpack_require__(122);
4448/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isDataView", function() { return __WEBPACK_IMPORTED_MODULE_14__isDataView_js__["a"]; });
4449/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__isArray_js__ = __webpack_require__(46);
4450/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isArray", function() { return __WEBPACK_IMPORTED_MODULE_15__isArray_js__["a"]; });
4451/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__isFunction_js__ = __webpack_require__(26);
4452/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isFunction", function() { return __WEBPACK_IMPORTED_MODULE_16__isFunction_js__["a"]; });
4453/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__isArguments_js__ = __webpack_require__(123);
4454/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isArguments", function() { return __WEBPACK_IMPORTED_MODULE_17__isArguments_js__["a"]; });
4455/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__isFinite_js__ = __webpack_require__(286);
4456/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isFinite", function() { return __WEBPACK_IMPORTED_MODULE_18__isFinite_js__["a"]; });
4457/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__isNaN_js__ = __webpack_require__(167);
4458/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isNaN", function() { return __WEBPACK_IMPORTED_MODULE_19__isNaN_js__["a"]; });
4459/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__isTypedArray_js__ = __webpack_require__(168);
4460/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isTypedArray", function() { return __WEBPACK_IMPORTED_MODULE_20__isTypedArray_js__["a"]; });
4461/* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__isEmpty_js__ = __webpack_require__(288);
4462/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return __WEBPACK_IMPORTED_MODULE_21__isEmpty_js__["a"]; });
4463/* harmony import */ var __WEBPACK_IMPORTED_MODULE_22__isMatch_js__ = __webpack_require__(173);
4464/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isMatch", function() { return __WEBPACK_IMPORTED_MODULE_22__isMatch_js__["a"]; });
4465/* harmony import */ var __WEBPACK_IMPORTED_MODULE_23__isEqual_js__ = __webpack_require__(289);
4466/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isEqual", function() { return __WEBPACK_IMPORTED_MODULE_23__isEqual_js__["a"]; });
4467/* harmony import */ var __WEBPACK_IMPORTED_MODULE_24__isMap_js__ = __webpack_require__(291);
4468/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isMap", function() { return __WEBPACK_IMPORTED_MODULE_24__isMap_js__["a"]; });
4469/* harmony import */ var __WEBPACK_IMPORTED_MODULE_25__isWeakMap_js__ = __webpack_require__(292);
4470/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isWeakMap", function() { return __WEBPACK_IMPORTED_MODULE_25__isWeakMap_js__["a"]; });
4471/* harmony import */ var __WEBPACK_IMPORTED_MODULE_26__isSet_js__ = __webpack_require__(293);
4472/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isSet", function() { return __WEBPACK_IMPORTED_MODULE_26__isSet_js__["a"]; });
4473/* harmony import */ var __WEBPACK_IMPORTED_MODULE_27__isWeakSet_js__ = __webpack_require__(294);
4474/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isWeakSet", function() { return __WEBPACK_IMPORTED_MODULE_27__isWeakSet_js__["a"]; });
4475/* harmony import */ var __WEBPACK_IMPORTED_MODULE_28__keys_js__ = __webpack_require__(11);
4476/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "keys", function() { return __WEBPACK_IMPORTED_MODULE_28__keys_js__["a"]; });
4477/* harmony import */ var __WEBPACK_IMPORTED_MODULE_29__allKeys_js__ = __webpack_require__(75);
4478/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "allKeys", function() { return __WEBPACK_IMPORTED_MODULE_29__allKeys_js__["a"]; });
4479/* harmony import */ var __WEBPACK_IMPORTED_MODULE_30__values_js__ = __webpack_require__(56);
4480/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "values", function() { return __WEBPACK_IMPORTED_MODULE_30__values_js__["a"]; });
4481/* harmony import */ var __WEBPACK_IMPORTED_MODULE_31__pairs_js__ = __webpack_require__(295);
4482/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "pairs", function() { return __WEBPACK_IMPORTED_MODULE_31__pairs_js__["a"]; });
4483/* harmony import */ var __WEBPACK_IMPORTED_MODULE_32__invert_js__ = __webpack_require__(174);
4484/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "invert", function() { return __WEBPACK_IMPORTED_MODULE_32__invert_js__["a"]; });
4485/* harmony import */ var __WEBPACK_IMPORTED_MODULE_33__functions_js__ = __webpack_require__(175);
4486/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "functions", function() { return __WEBPACK_IMPORTED_MODULE_33__functions_js__["a"]; });
4487/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "methods", function() { return __WEBPACK_IMPORTED_MODULE_33__functions_js__["a"]; });
4488/* harmony import */ var __WEBPACK_IMPORTED_MODULE_34__extend_js__ = __webpack_require__(176);
4489/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "extend", function() { return __WEBPACK_IMPORTED_MODULE_34__extend_js__["a"]; });
4490/* harmony import */ var __WEBPACK_IMPORTED_MODULE_35__extendOwn_js__ = __webpack_require__(127);
4491/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "extendOwn", function() { return __WEBPACK_IMPORTED_MODULE_35__extendOwn_js__["a"]; });
4492/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "assign", function() { return __WEBPACK_IMPORTED_MODULE_35__extendOwn_js__["a"]; });
4493/* harmony import */ var __WEBPACK_IMPORTED_MODULE_36__defaults_js__ = __webpack_require__(177);
4494/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "defaults", function() { return __WEBPACK_IMPORTED_MODULE_36__defaults_js__["a"]; });
4495/* harmony import */ var __WEBPACK_IMPORTED_MODULE_37__create_js__ = __webpack_require__(296);
4496/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return __WEBPACK_IMPORTED_MODULE_37__create_js__["a"]; });
4497/* harmony import */ var __WEBPACK_IMPORTED_MODULE_38__clone_js__ = __webpack_require__(179);
4498/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "clone", function() { return __WEBPACK_IMPORTED_MODULE_38__clone_js__["a"]; });
4499/* harmony import */ var __WEBPACK_IMPORTED_MODULE_39__tap_js__ = __webpack_require__(297);
4500/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "tap", function() { return __WEBPACK_IMPORTED_MODULE_39__tap_js__["a"]; });
4501/* harmony import */ var __WEBPACK_IMPORTED_MODULE_40__get_js__ = __webpack_require__(180);
4502/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "get", function() { return __WEBPACK_IMPORTED_MODULE_40__get_js__["a"]; });
4503/* harmony import */ var __WEBPACK_IMPORTED_MODULE_41__has_js__ = __webpack_require__(298);
4504/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "has", function() { return __WEBPACK_IMPORTED_MODULE_41__has_js__["a"]; });
4505/* harmony import */ var __WEBPACK_IMPORTED_MODULE_42__mapObject_js__ = __webpack_require__(299);
4506/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "mapObject", function() { return __WEBPACK_IMPORTED_MODULE_42__mapObject_js__["a"]; });
4507/* harmony import */ var __WEBPACK_IMPORTED_MODULE_43__identity_js__ = __webpack_require__(129);
4508/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return __WEBPACK_IMPORTED_MODULE_43__identity_js__["a"]; });
4509/* harmony import */ var __WEBPACK_IMPORTED_MODULE_44__constant_js__ = __webpack_require__(169);
4510/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "constant", function() { return __WEBPACK_IMPORTED_MODULE_44__constant_js__["a"]; });
4511/* harmony import */ var __WEBPACK_IMPORTED_MODULE_45__noop_js__ = __webpack_require__(184);
4512/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "noop", function() { return __WEBPACK_IMPORTED_MODULE_45__noop_js__["a"]; });
4513/* harmony import */ var __WEBPACK_IMPORTED_MODULE_46__toPath_js__ = __webpack_require__(181);
4514/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "toPath", function() { return __WEBPACK_IMPORTED_MODULE_46__toPath_js__["a"]; });
4515/* harmony import */ var __WEBPACK_IMPORTED_MODULE_47__property_js__ = __webpack_require__(130);
4516/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "property", function() { return __WEBPACK_IMPORTED_MODULE_47__property_js__["a"]; });
4517/* harmony import */ var __WEBPACK_IMPORTED_MODULE_48__propertyOf_js__ = __webpack_require__(300);
4518/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "propertyOf", function() { return __WEBPACK_IMPORTED_MODULE_48__propertyOf_js__["a"]; });
4519/* harmony import */ var __WEBPACK_IMPORTED_MODULE_49__matcher_js__ = __webpack_require__(96);
4520/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "matcher", function() { return __WEBPACK_IMPORTED_MODULE_49__matcher_js__["a"]; });
4521/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "matches", function() { return __WEBPACK_IMPORTED_MODULE_49__matcher_js__["a"]; });
4522/* harmony import */ var __WEBPACK_IMPORTED_MODULE_50__times_js__ = __webpack_require__(301);
4523/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "times", function() { return __WEBPACK_IMPORTED_MODULE_50__times_js__["a"]; });
4524/* harmony import */ var __WEBPACK_IMPORTED_MODULE_51__random_js__ = __webpack_require__(185);
4525/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "random", function() { return __WEBPACK_IMPORTED_MODULE_51__random_js__["a"]; });
4526/* harmony import */ var __WEBPACK_IMPORTED_MODULE_52__now_js__ = __webpack_require__(131);
4527/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "now", function() { return __WEBPACK_IMPORTED_MODULE_52__now_js__["a"]; });
4528/* harmony import */ var __WEBPACK_IMPORTED_MODULE_53__escape_js__ = __webpack_require__(302);
4529/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "escape", function() { return __WEBPACK_IMPORTED_MODULE_53__escape_js__["a"]; });
4530/* harmony import */ var __WEBPACK_IMPORTED_MODULE_54__unescape_js__ = __webpack_require__(303);
4531/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "unescape", function() { return __WEBPACK_IMPORTED_MODULE_54__unescape_js__["a"]; });
4532/* harmony import */ var __WEBPACK_IMPORTED_MODULE_55__templateSettings_js__ = __webpack_require__(188);
4533/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "templateSettings", function() { return __WEBPACK_IMPORTED_MODULE_55__templateSettings_js__["a"]; });
4534/* harmony import */ var __WEBPACK_IMPORTED_MODULE_56__template_js__ = __webpack_require__(305);
4535/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "template", function() { return __WEBPACK_IMPORTED_MODULE_56__template_js__["a"]; });
4536/* harmony import */ var __WEBPACK_IMPORTED_MODULE_57__result_js__ = __webpack_require__(306);
4537/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "result", function() { return __WEBPACK_IMPORTED_MODULE_57__result_js__["a"]; });
4538/* harmony import */ var __WEBPACK_IMPORTED_MODULE_58__uniqueId_js__ = __webpack_require__(307);
4539/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "uniqueId", function() { return __WEBPACK_IMPORTED_MODULE_58__uniqueId_js__["a"]; });
4540/* harmony import */ var __WEBPACK_IMPORTED_MODULE_59__chain_js__ = __webpack_require__(308);
4541/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "chain", function() { return __WEBPACK_IMPORTED_MODULE_59__chain_js__["a"]; });
4542/* harmony import */ var __WEBPACK_IMPORTED_MODULE_60__iteratee_js__ = __webpack_require__(183);
4543/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "iteratee", function() { return __WEBPACK_IMPORTED_MODULE_60__iteratee_js__["a"]; });
4544/* harmony import */ var __WEBPACK_IMPORTED_MODULE_61__partial_js__ = __webpack_require__(97);
4545/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "partial", function() { return __WEBPACK_IMPORTED_MODULE_61__partial_js__["a"]; });
4546/* harmony import */ var __WEBPACK_IMPORTED_MODULE_62__bind_js__ = __webpack_require__(190);
4547/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "bind", function() { return __WEBPACK_IMPORTED_MODULE_62__bind_js__["a"]; });
4548/* harmony import */ var __WEBPACK_IMPORTED_MODULE_63__bindAll_js__ = __webpack_require__(309);
4549/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "bindAll", function() { return __WEBPACK_IMPORTED_MODULE_63__bindAll_js__["a"]; });
4550/* harmony import */ var __WEBPACK_IMPORTED_MODULE_64__memoize_js__ = __webpack_require__(310);
4551/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "memoize", function() { return __WEBPACK_IMPORTED_MODULE_64__memoize_js__["a"]; });
4552/* harmony import */ var __WEBPACK_IMPORTED_MODULE_65__delay_js__ = __webpack_require__(191);
4553/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "delay", function() { return __WEBPACK_IMPORTED_MODULE_65__delay_js__["a"]; });
4554/* harmony import */ var __WEBPACK_IMPORTED_MODULE_66__defer_js__ = __webpack_require__(311);
4555/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "defer", function() { return __WEBPACK_IMPORTED_MODULE_66__defer_js__["a"]; });
4556/* harmony import */ var __WEBPACK_IMPORTED_MODULE_67__throttle_js__ = __webpack_require__(312);
4557/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "throttle", function() { return __WEBPACK_IMPORTED_MODULE_67__throttle_js__["a"]; });
4558/* harmony import */ var __WEBPACK_IMPORTED_MODULE_68__debounce_js__ = __webpack_require__(313);
4559/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "debounce", function() { return __WEBPACK_IMPORTED_MODULE_68__debounce_js__["a"]; });
4560/* harmony import */ var __WEBPACK_IMPORTED_MODULE_69__wrap_js__ = __webpack_require__(314);
4561/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "wrap", function() { return __WEBPACK_IMPORTED_MODULE_69__wrap_js__["a"]; });
4562/* harmony import */ var __WEBPACK_IMPORTED_MODULE_70__negate_js__ = __webpack_require__(132);
4563/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "negate", function() { return __WEBPACK_IMPORTED_MODULE_70__negate_js__["a"]; });
4564/* harmony import */ var __WEBPACK_IMPORTED_MODULE_71__compose_js__ = __webpack_require__(315);
4565/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "compose", function() { return __WEBPACK_IMPORTED_MODULE_71__compose_js__["a"]; });
4566/* harmony import */ var __WEBPACK_IMPORTED_MODULE_72__after_js__ = __webpack_require__(316);
4567/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "after", function() { return __WEBPACK_IMPORTED_MODULE_72__after_js__["a"]; });
4568/* harmony import */ var __WEBPACK_IMPORTED_MODULE_73__before_js__ = __webpack_require__(192);
4569/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "before", function() { return __WEBPACK_IMPORTED_MODULE_73__before_js__["a"]; });
4570/* harmony import */ var __WEBPACK_IMPORTED_MODULE_74__once_js__ = __webpack_require__(317);
4571/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "once", function() { return __WEBPACK_IMPORTED_MODULE_74__once_js__["a"]; });
4572/* harmony import */ var __WEBPACK_IMPORTED_MODULE_75__findKey_js__ = __webpack_require__(193);
4573/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "findKey", function() { return __WEBPACK_IMPORTED_MODULE_75__findKey_js__["a"]; });
4574/* harmony import */ var __WEBPACK_IMPORTED_MODULE_76__findIndex_js__ = __webpack_require__(133);
4575/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "findIndex", function() { return __WEBPACK_IMPORTED_MODULE_76__findIndex_js__["a"]; });
4576/* harmony import */ var __WEBPACK_IMPORTED_MODULE_77__findLastIndex_js__ = __webpack_require__(195);
4577/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "findLastIndex", function() { return __WEBPACK_IMPORTED_MODULE_77__findLastIndex_js__["a"]; });
4578/* harmony import */ var __WEBPACK_IMPORTED_MODULE_78__sortedIndex_js__ = __webpack_require__(196);
4579/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "sortedIndex", function() { return __WEBPACK_IMPORTED_MODULE_78__sortedIndex_js__["a"]; });
4580/* harmony import */ var __WEBPACK_IMPORTED_MODULE_79__indexOf_js__ = __webpack_require__(197);
4581/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "indexOf", function() { return __WEBPACK_IMPORTED_MODULE_79__indexOf_js__["a"]; });
4582/* harmony import */ var __WEBPACK_IMPORTED_MODULE_80__lastIndexOf_js__ = __webpack_require__(318);
4583/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "lastIndexOf", function() { return __WEBPACK_IMPORTED_MODULE_80__lastIndexOf_js__["a"]; });
4584/* harmony import */ var __WEBPACK_IMPORTED_MODULE_81__find_js__ = __webpack_require__(199);
4585/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "find", function() { return __WEBPACK_IMPORTED_MODULE_81__find_js__["a"]; });
4586/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "detect", function() { return __WEBPACK_IMPORTED_MODULE_81__find_js__["a"]; });
4587/* harmony import */ var __WEBPACK_IMPORTED_MODULE_82__findWhere_js__ = __webpack_require__(319);
4588/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "findWhere", function() { return __WEBPACK_IMPORTED_MODULE_82__findWhere_js__["a"]; });
4589/* harmony import */ var __WEBPACK_IMPORTED_MODULE_83__each_js__ = __webpack_require__(47);
4590/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "each", function() { return __WEBPACK_IMPORTED_MODULE_83__each_js__["a"]; });
4591/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "forEach", function() { return __WEBPACK_IMPORTED_MODULE_83__each_js__["a"]; });
4592/* harmony import */ var __WEBPACK_IMPORTED_MODULE_84__map_js__ = __webpack_require__(58);
4593/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "map", function() { return __WEBPACK_IMPORTED_MODULE_84__map_js__["a"]; });
4594/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "collect", function() { return __WEBPACK_IMPORTED_MODULE_84__map_js__["a"]; });
4595/* harmony import */ var __WEBPACK_IMPORTED_MODULE_85__reduce_js__ = __webpack_require__(320);
4596/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "reduce", function() { return __WEBPACK_IMPORTED_MODULE_85__reduce_js__["a"]; });
4597/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "foldl", function() { return __WEBPACK_IMPORTED_MODULE_85__reduce_js__["a"]; });
4598/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "inject", function() { return __WEBPACK_IMPORTED_MODULE_85__reduce_js__["a"]; });
4599/* harmony import */ var __WEBPACK_IMPORTED_MODULE_86__reduceRight_js__ = __webpack_require__(321);
4600/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "reduceRight", function() { return __WEBPACK_IMPORTED_MODULE_86__reduceRight_js__["a"]; });
4601/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "foldr", function() { return __WEBPACK_IMPORTED_MODULE_86__reduceRight_js__["a"]; });
4602/* harmony import */ var __WEBPACK_IMPORTED_MODULE_87__filter_js__ = __webpack_require__(78);
4603/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "filter", function() { return __WEBPACK_IMPORTED_MODULE_87__filter_js__["a"]; });
4604/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "select", function() { return __WEBPACK_IMPORTED_MODULE_87__filter_js__["a"]; });
4605/* harmony import */ var __WEBPACK_IMPORTED_MODULE_88__reject_js__ = __webpack_require__(322);
4606/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "reject", function() { return __WEBPACK_IMPORTED_MODULE_88__reject_js__["a"]; });
4607/* harmony import */ var __WEBPACK_IMPORTED_MODULE_89__every_js__ = __webpack_require__(323);
4608/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "every", function() { return __WEBPACK_IMPORTED_MODULE_89__every_js__["a"]; });
4609/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "all", function() { return __WEBPACK_IMPORTED_MODULE_89__every_js__["a"]; });
4610/* harmony import */ var __WEBPACK_IMPORTED_MODULE_90__some_js__ = __webpack_require__(324);
4611/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "some", function() { return __WEBPACK_IMPORTED_MODULE_90__some_js__["a"]; });
4612/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "any", function() { return __WEBPACK_IMPORTED_MODULE_90__some_js__["a"]; });
4613/* harmony import */ var __WEBPACK_IMPORTED_MODULE_91__contains_js__ = __webpack_require__(79);
4614/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "contains", function() { return __WEBPACK_IMPORTED_MODULE_91__contains_js__["a"]; });
4615/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "includes", function() { return __WEBPACK_IMPORTED_MODULE_91__contains_js__["a"]; });
4616/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "include", function() { return __WEBPACK_IMPORTED_MODULE_91__contains_js__["a"]; });
4617/* harmony import */ var __WEBPACK_IMPORTED_MODULE_92__invoke_js__ = __webpack_require__(325);
4618/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "invoke", function() { return __WEBPACK_IMPORTED_MODULE_92__invoke_js__["a"]; });
4619/* harmony import */ var __WEBPACK_IMPORTED_MODULE_93__pluck_js__ = __webpack_require__(134);
4620/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "pluck", function() { return __WEBPACK_IMPORTED_MODULE_93__pluck_js__["a"]; });
4621/* harmony import */ var __WEBPACK_IMPORTED_MODULE_94__where_js__ = __webpack_require__(326);
4622/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "where", function() { return __WEBPACK_IMPORTED_MODULE_94__where_js__["a"]; });
4623/* harmony import */ var __WEBPACK_IMPORTED_MODULE_95__max_js__ = __webpack_require__(201);
4624/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "max", function() { return __WEBPACK_IMPORTED_MODULE_95__max_js__["a"]; });
4625/* harmony import */ var __WEBPACK_IMPORTED_MODULE_96__min_js__ = __webpack_require__(327);
4626/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "min", function() { return __WEBPACK_IMPORTED_MODULE_96__min_js__["a"]; });
4627/* harmony import */ var __WEBPACK_IMPORTED_MODULE_97__shuffle_js__ = __webpack_require__(328);
4628/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "shuffle", function() { return __WEBPACK_IMPORTED_MODULE_97__shuffle_js__["a"]; });
4629/* harmony import */ var __WEBPACK_IMPORTED_MODULE_98__sample_js__ = __webpack_require__(202);
4630/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "sample", function() { return __WEBPACK_IMPORTED_MODULE_98__sample_js__["a"]; });
4631/* harmony import */ var __WEBPACK_IMPORTED_MODULE_99__sortBy_js__ = __webpack_require__(329);
4632/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "sortBy", function() { return __WEBPACK_IMPORTED_MODULE_99__sortBy_js__["a"]; });
4633/* harmony import */ var __WEBPACK_IMPORTED_MODULE_100__groupBy_js__ = __webpack_require__(330);
4634/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "groupBy", function() { return __WEBPACK_IMPORTED_MODULE_100__groupBy_js__["a"]; });
4635/* harmony import */ var __WEBPACK_IMPORTED_MODULE_101__indexBy_js__ = __webpack_require__(331);
4636/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "indexBy", function() { return __WEBPACK_IMPORTED_MODULE_101__indexBy_js__["a"]; });
4637/* harmony import */ var __WEBPACK_IMPORTED_MODULE_102__countBy_js__ = __webpack_require__(332);
4638/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "countBy", function() { return __WEBPACK_IMPORTED_MODULE_102__countBy_js__["a"]; });
4639/* harmony import */ var __WEBPACK_IMPORTED_MODULE_103__partition_js__ = __webpack_require__(333);
4640/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "partition", function() { return __WEBPACK_IMPORTED_MODULE_103__partition_js__["a"]; });
4641/* harmony import */ var __WEBPACK_IMPORTED_MODULE_104__toArray_js__ = __webpack_require__(334);
4642/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "toArray", function() { return __WEBPACK_IMPORTED_MODULE_104__toArray_js__["a"]; });
4643/* harmony import */ var __WEBPACK_IMPORTED_MODULE_105__size_js__ = __webpack_require__(335);
4644/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "size", function() { return __WEBPACK_IMPORTED_MODULE_105__size_js__["a"]; });
4645/* harmony import */ var __WEBPACK_IMPORTED_MODULE_106__pick_js__ = __webpack_require__(203);
4646/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "pick", function() { return __WEBPACK_IMPORTED_MODULE_106__pick_js__["a"]; });
4647/* harmony import */ var __WEBPACK_IMPORTED_MODULE_107__omit_js__ = __webpack_require__(337);
4648/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "omit", function() { return __WEBPACK_IMPORTED_MODULE_107__omit_js__["a"]; });
4649/* harmony import */ var __WEBPACK_IMPORTED_MODULE_108__first_js__ = __webpack_require__(338);
4650/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "first", function() { return __WEBPACK_IMPORTED_MODULE_108__first_js__["a"]; });
4651/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "head", function() { return __WEBPACK_IMPORTED_MODULE_108__first_js__["a"]; });
4652/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "take", function() { return __WEBPACK_IMPORTED_MODULE_108__first_js__["a"]; });
4653/* harmony import */ var __WEBPACK_IMPORTED_MODULE_109__initial_js__ = __webpack_require__(204);
4654/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "initial", function() { return __WEBPACK_IMPORTED_MODULE_109__initial_js__["a"]; });
4655/* harmony import */ var __WEBPACK_IMPORTED_MODULE_110__last_js__ = __webpack_require__(339);
4656/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "last", function() { return __WEBPACK_IMPORTED_MODULE_110__last_js__["a"]; });
4657/* harmony import */ var __WEBPACK_IMPORTED_MODULE_111__rest_js__ = __webpack_require__(205);
4658/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "rest", function() { return __WEBPACK_IMPORTED_MODULE_111__rest_js__["a"]; });
4659/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "tail", function() { return __WEBPACK_IMPORTED_MODULE_111__rest_js__["a"]; });
4660/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "drop", function() { return __WEBPACK_IMPORTED_MODULE_111__rest_js__["a"]; });
4661/* harmony import */ var __WEBPACK_IMPORTED_MODULE_112__compact_js__ = __webpack_require__(340);
4662/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "compact", function() { return __WEBPACK_IMPORTED_MODULE_112__compact_js__["a"]; });
4663/* harmony import */ var __WEBPACK_IMPORTED_MODULE_113__flatten_js__ = __webpack_require__(341);
4664/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "flatten", function() { return __WEBPACK_IMPORTED_MODULE_113__flatten_js__["a"]; });
4665/* harmony import */ var __WEBPACK_IMPORTED_MODULE_114__without_js__ = __webpack_require__(342);
4666/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "without", function() { return __WEBPACK_IMPORTED_MODULE_114__without_js__["a"]; });
4667/* harmony import */ var __WEBPACK_IMPORTED_MODULE_115__uniq_js__ = __webpack_require__(207);
4668/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "uniq", function() { return __WEBPACK_IMPORTED_MODULE_115__uniq_js__["a"]; });
4669/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "unique", function() { return __WEBPACK_IMPORTED_MODULE_115__uniq_js__["a"]; });
4670/* harmony import */ var __WEBPACK_IMPORTED_MODULE_116__union_js__ = __webpack_require__(343);
4671/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "union", function() { return __WEBPACK_IMPORTED_MODULE_116__union_js__["a"]; });
4672/* harmony import */ var __WEBPACK_IMPORTED_MODULE_117__intersection_js__ = __webpack_require__(344);
4673/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "intersection", function() { return __WEBPACK_IMPORTED_MODULE_117__intersection_js__["a"]; });
4674/* harmony import */ var __WEBPACK_IMPORTED_MODULE_118__difference_js__ = __webpack_require__(206);
4675/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "difference", function() { return __WEBPACK_IMPORTED_MODULE_118__difference_js__["a"]; });
4676/* harmony import */ var __WEBPACK_IMPORTED_MODULE_119__unzip_js__ = __webpack_require__(208);
4677/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "unzip", function() { return __WEBPACK_IMPORTED_MODULE_119__unzip_js__["a"]; });
4678/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "transpose", function() { return __WEBPACK_IMPORTED_MODULE_119__unzip_js__["a"]; });
4679/* harmony import */ var __WEBPACK_IMPORTED_MODULE_120__zip_js__ = __webpack_require__(345);
4680/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "zip", function() { return __WEBPACK_IMPORTED_MODULE_120__zip_js__["a"]; });
4681/* harmony import */ var __WEBPACK_IMPORTED_MODULE_121__object_js__ = __webpack_require__(346);
4682/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "object", function() { return __WEBPACK_IMPORTED_MODULE_121__object_js__["a"]; });
4683/* harmony import */ var __WEBPACK_IMPORTED_MODULE_122__range_js__ = __webpack_require__(347);
4684/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "range", function() { return __WEBPACK_IMPORTED_MODULE_122__range_js__["a"]; });
4685/* harmony import */ var __WEBPACK_IMPORTED_MODULE_123__chunk_js__ = __webpack_require__(348);
4686/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "chunk", function() { return __WEBPACK_IMPORTED_MODULE_123__chunk_js__["a"]; });
4687/* harmony import */ var __WEBPACK_IMPORTED_MODULE_124__mixin_js__ = __webpack_require__(349);
4688/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "mixin", function() { return __WEBPACK_IMPORTED_MODULE_124__mixin_js__["a"]; });
4689/* harmony import */ var __WEBPACK_IMPORTED_MODULE_125__underscore_array_methods_js__ = __webpack_require__(350);
4690/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return __WEBPACK_IMPORTED_MODULE_125__underscore_array_methods_js__["a"]; });
4691// Named Exports
4692// =============
4693
4694// Underscore.js 1.12.1
4695// https://underscorejs.org
4696// (c) 2009-2020 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
4697// Underscore may be freely distributed under the MIT license.
4698
4699// Baseline setup.
4700
4701
4702
4703// Object Functions
4704// ----------------
4705// Our most fundamental functions operate on any JavaScript object.
4706// Most functions in Underscore depend on at least one function in this section.
4707
4708// A group of functions that check the types of core JavaScript values.
4709// These are often informally referred to as the "isType" functions.
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737// Functions that treat an object as a dictionary of key-value pairs.
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754// Utility Functions
4755// -----------------
4756// A bit of a grab bag: Predicate-generating functions for use with filters and
4757// loops, string escaping and templating, create random numbers and unique ids,
4758// and functions that facilitate Underscore's chaining and iteration conventions.
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778// Function (ahem) Functions
4779// -------------------------
4780// These functions take a function as an argument and return a new function
4781// as the result. Also known as higher-order functions.
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797// Finders
4798// -------
4799// Functions that extract (the position of) a single element from an object
4800// or array based on some criterion.
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810// Collection Functions
4811// --------------------
4812// Functions that work on any collection of elements: either an array, or
4813// an object of key-value pairs.
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838// `_.pick` and `_.omit` are actually object functions, but we put
4839// them here in order to create a more natural reading order in the
4840// monolithic build as they depend on `_.contains`.
4841
4842
4843
4844// Array Functions
4845// ---------------
4846// Functions that operate on arrays (and array-likes) only, because they’re
4847// expressed in terms of operations on an ordered list of values.
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865// OOP
4866// ---
4867// These modules support the "object-oriented" calling style. See also
4868// `underscore.js` and `index-default.js`.
4869
4870
4871
4872
4873/***/ }),
4874/* 121 */
4875/***/ (function(module, __webpack_exports__, __webpack_require__) {
4876
4877"use strict";
4878/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(15);
4879
4880
4881/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('String'));
4882
4883
4884/***/ }),
4885/* 122 */
4886/***/ (function(module, __webpack_exports__, __webpack_require__) {
4887
4888"use strict";
4889/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(15);
4890/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(26);
4891/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isArrayBuffer_js__ = __webpack_require__(166);
4892/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__stringTagBug_js__ = __webpack_require__(74);
4893
4894
4895
4896
4897
4898var isDataView = Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('DataView');
4899
4900// In IE 10 - Edge 13, we need a different heuristic
4901// to determine whether an object is a `DataView`.
4902function ie10IsDataView(obj) {
4903 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);
4904}
4905
4906/* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_3__stringTagBug_js__["a" /* hasStringTagBug */] ? ie10IsDataView : isDataView);
4907
4908
4909/***/ }),
4910/* 123 */
4911/***/ (function(module, __webpack_exports__, __webpack_require__) {
4912
4913"use strict";
4914/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(15);
4915/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__has_js__ = __webpack_require__(37);
4916
4917
4918
4919var isArguments = Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Arguments');
4920
4921// Define a fallback version of the method in browsers (ahem, IE < 9), where
4922// there isn't any inspectable "Arguments" type.
4923(function() {
4924 if (!isArguments(arguments)) {
4925 isArguments = function(obj) {
4926 return Object(__WEBPACK_IMPORTED_MODULE_1__has_js__["a" /* default */])(obj, 'callee');
4927 };
4928 }
4929}());
4930
4931/* harmony default export */ __webpack_exports__["a"] = (isArguments);
4932
4933
4934/***/ }),
4935/* 124 */
4936/***/ (function(module, __webpack_exports__, __webpack_require__) {
4937
4938"use strict";
4939/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__shallowProperty_js__ = __webpack_require__(171);
4940
4941
4942// Internal helper to obtain the `byteLength` property of an object.
4943/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__shallowProperty_js__["a" /* default */])('byteLength'));
4944
4945
4946/***/ }),
4947/* 125 */
4948/***/ (function(module, __webpack_exports__, __webpack_require__) {
4949
4950"use strict";
4951/* harmony export (immutable) */ __webpack_exports__["a"] = ie11fingerprint;
4952/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return mapMethods; });
4953/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return weakMapMethods; });
4954/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return setMethods; });
4955/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(27);
4956/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(26);
4957/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__allKeys_js__ = __webpack_require__(75);
4958
4959
4960
4961
4962// Since the regular `Object.prototype.toString` type tests don't work for
4963// some types in IE 11, we use a fingerprinting heuristic instead, based
4964// on the methods. It's not great, but it's the best we got.
4965// The fingerprint method lists are defined below.
4966function ie11fingerprint(methods) {
4967 var length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(methods);
4968 return function(obj) {
4969 if (obj == null) return false;
4970 // `Map`, `WeakMap` and `Set` have no enumerable keys.
4971 var keys = Object(__WEBPACK_IMPORTED_MODULE_2__allKeys_js__["a" /* default */])(obj);
4972 if (Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(keys)) return false;
4973 for (var i = 0; i < length; i++) {
4974 if (!Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(obj[methods[i]])) return false;
4975 }
4976 // If we are testing against `WeakMap`, we need to ensure that
4977 // `obj` doesn't have a `forEach` method in order to distinguish
4978 // it from a regular `Map`.
4979 return methods !== weakMapMethods || !Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(obj[forEachName]);
4980 };
4981}
4982
4983// In the interest of compact minification, we write
4984// each string in the fingerprints only once.
4985var forEachName = 'forEach',
4986 hasName = 'has',
4987 commonInit = ['clear', 'delete'],
4988 mapTail = ['get', hasName, 'set'];
4989
4990// `Map`, `WeakMap` and `Set` each have slightly different
4991// combinations of the above sublists.
4992var mapMethods = commonInit.concat(forEachName, mapTail),
4993 weakMapMethods = commonInit.concat(mapTail),
4994 setMethods = ['add'].concat(commonInit, forEachName, hasName);
4995
4996
4997/***/ }),
4998/* 126 */
4999/***/ (function(module, __webpack_exports__, __webpack_require__) {
5000
5001"use strict";
5002/* harmony export (immutable) */ __webpack_exports__["a"] = createAssigner;
5003// An internal function for creating assigner functions.
5004function createAssigner(keysFunc, defaults) {
5005 return function(obj) {
5006 var length = arguments.length;
5007 if (defaults) obj = Object(obj);
5008 if (length < 2 || obj == null) return obj;
5009 for (var index = 1; index < length; index++) {
5010 var source = arguments[index],
5011 keys = keysFunc(source),
5012 l = keys.length;
5013 for (var i = 0; i < l; i++) {
5014 var key = keys[i];
5015 if (!defaults || obj[key] === void 0) obj[key] = source[key];
5016 }
5017 }
5018 return obj;
5019 };
5020}
5021
5022
5023/***/ }),
5024/* 127 */
5025/***/ (function(module, __webpack_exports__, __webpack_require__) {
5026
5027"use strict";
5028/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createAssigner_js__ = __webpack_require__(126);
5029/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__keys_js__ = __webpack_require__(11);
5030
5031
5032
5033// Assigns a given object with all the own properties in the passed-in
5034// object(s).
5035// (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)
5036/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createAssigner_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__keys_js__["a" /* default */]));
5037
5038
5039/***/ }),
5040/* 128 */
5041/***/ (function(module, __webpack_exports__, __webpack_require__) {
5042
5043"use strict";
5044/* harmony export (immutable) */ __webpack_exports__["a"] = deepGet;
5045// Internal function to obtain a nested property in `obj` along `path`.
5046function deepGet(obj, path) {
5047 var length = path.length;
5048 for (var i = 0; i < length; i++) {
5049 if (obj == null) return void 0;
5050 obj = obj[path[i]];
5051 }
5052 return length ? obj : void 0;
5053}
5054
5055
5056/***/ }),
5057/* 129 */
5058/***/ (function(module, __webpack_exports__, __webpack_require__) {
5059
5060"use strict";
5061/* harmony export (immutable) */ __webpack_exports__["a"] = identity;
5062// Keep the identity function around for default iteratees.
5063function identity(value) {
5064 return value;
5065}
5066
5067
5068/***/ }),
5069/* 130 */
5070/***/ (function(module, __webpack_exports__, __webpack_require__) {
5071
5072"use strict";
5073/* harmony export (immutable) */ __webpack_exports__["a"] = property;
5074/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__deepGet_js__ = __webpack_require__(128);
5075/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__toPath_js__ = __webpack_require__(76);
5076
5077
5078
5079// Creates a function that, when passed an object, will traverse that object’s
5080// properties down the given `path`, specified as an array of keys or indices.
5081function property(path) {
5082 path = Object(__WEBPACK_IMPORTED_MODULE_1__toPath_js__["a" /* default */])(path);
5083 return function(obj) {
5084 return Object(__WEBPACK_IMPORTED_MODULE_0__deepGet_js__["a" /* default */])(obj, path);
5085 };
5086}
5087
5088
5089/***/ }),
5090/* 131 */
5091/***/ (function(module, __webpack_exports__, __webpack_require__) {
5092
5093"use strict";
5094// A (possibly faster) way to get the current timestamp as an integer.
5095/* harmony default export */ __webpack_exports__["a"] = (Date.now || function() {
5096 return new Date().getTime();
5097});
5098
5099
5100/***/ }),
5101/* 132 */
5102/***/ (function(module, __webpack_exports__, __webpack_require__) {
5103
5104"use strict";
5105/* harmony export (immutable) */ __webpack_exports__["a"] = negate;
5106// Returns a negated version of the passed-in predicate.
5107function negate(predicate) {
5108 return function() {
5109 return !predicate.apply(this, arguments);
5110 };
5111}
5112
5113
5114/***/ }),
5115/* 133 */
5116/***/ (function(module, __webpack_exports__, __webpack_require__) {
5117
5118"use strict";
5119/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createPredicateIndexFinder_js__ = __webpack_require__(194);
5120
5121
5122// Returns the first index on an array-like that passes a truth test.
5123/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createPredicateIndexFinder_js__["a" /* default */])(1));
5124
5125
5126/***/ }),
5127/* 134 */
5128/***/ (function(module, __webpack_exports__, __webpack_require__) {
5129
5130"use strict";
5131/* harmony export (immutable) */ __webpack_exports__["a"] = pluck;
5132/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__map_js__ = __webpack_require__(58);
5133/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__property_js__ = __webpack_require__(130);
5134
5135
5136
5137// Convenience version of a common use case of `_.map`: fetching a property.
5138function pluck(obj, key) {
5139 return Object(__WEBPACK_IMPORTED_MODULE_0__map_js__["a" /* default */])(obj, Object(__WEBPACK_IMPORTED_MODULE_1__property_js__["a" /* default */])(key));
5140}
5141
5142
5143/***/ }),
5144/* 135 */
5145/***/ (function(module, exports, __webpack_require__) {
5146
5147var _Symbol = __webpack_require__(225);
5148
5149var _Symbol$iterator = __webpack_require__(424);
5150
5151function _typeof(obj) {
5152 "@babel/helpers - typeof";
5153
5154 return (module.exports = _typeof = "function" == typeof _Symbol && "symbol" == typeof _Symbol$iterator ? function (obj) {
5155 return typeof obj;
5156 } : function (obj) {
5157 return obj && "function" == typeof _Symbol && obj.constructor === _Symbol && obj !== _Symbol.prototype ? "symbol" : typeof obj;
5158 }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
5159}
5160
5161module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
5162
5163/***/ }),
5164/* 136 */
5165/***/ (function(module, exports, __webpack_require__) {
5166
5167var wellKnownSymbol = __webpack_require__(8);
5168
5169exports.f = wellKnownSymbol;
5170
5171
5172/***/ }),
5173/* 137 */
5174/***/ (function(module, exports, __webpack_require__) {
5175
5176module.exports = __webpack_require__(471);
5177
5178/***/ }),
5179/* 138 */
5180/***/ (function(module, exports, __webpack_require__) {
5181
5182"use strict";
5183
5184var $propertyIsEnumerable = {}.propertyIsEnumerable;
5185// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
5186var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
5187
5188// Nashorn ~ JDK8 bug
5189var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);
5190
5191// `Object.prototype.propertyIsEnumerable` method implementation
5192// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
5193exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
5194 var descriptor = getOwnPropertyDescriptor(this, V);
5195 return !!descriptor && descriptor.enumerable;
5196} : $propertyIsEnumerable;
5197
5198
5199/***/ }),
5200/* 139 */
5201/***/ (function(module, exports, __webpack_require__) {
5202
5203var uncurryThis = __webpack_require__(6);
5204var fails = __webpack_require__(4);
5205var classof = __webpack_require__(65);
5206
5207var $Object = Object;
5208var split = uncurryThis(''.split);
5209
5210// fallback for non-array-like ES3 and non-enumerable old V8 strings
5211module.exports = fails(function () {
5212 // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
5213 // eslint-disable-next-line no-prototype-builtins -- safe
5214 return !$Object('z').propertyIsEnumerable(0);
5215}) ? function (it) {
5216 return classof(it) == 'String' ? split(it, '') : $Object(it);
5217} : $Object;
5218
5219
5220/***/ }),
5221/* 140 */
5222/***/ (function(module, exports, __webpack_require__) {
5223
5224/* eslint-disable es-x/no-symbol -- required for testing */
5225var NATIVE_SYMBOL = __webpack_require__(49);
5226
5227module.exports = NATIVE_SYMBOL
5228 && !Symbol.sham
5229 && typeof Symbol.iterator == 'symbol';
5230
5231
5232/***/ }),
5233/* 141 */
5234/***/ (function(module, exports, __webpack_require__) {
5235
5236var DESCRIPTORS = __webpack_require__(19);
5237var fails = __webpack_require__(4);
5238var createElement = __webpack_require__(110);
5239
5240// Thanks to IE8 for its funny defineProperty
5241module.exports = !DESCRIPTORS && !fails(function () {
5242 // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
5243 return Object.defineProperty(createElement('div'), 'a', {
5244 get: function () { return 7; }
5245 }).a != 7;
5246});
5247
5248
5249/***/ }),
5250/* 142 */
5251/***/ (function(module, exports, __webpack_require__) {
5252
5253var fails = __webpack_require__(4);
5254var isCallable = __webpack_require__(7);
5255
5256var replacement = /#|\.prototype\./;
5257
5258var isForced = function (feature, detection) {
5259 var value = data[normalize(feature)];
5260 return value == POLYFILL ? true
5261 : value == NATIVE ? false
5262 : isCallable(detection) ? fails(detection)
5263 : !!detection;
5264};
5265
5266var normalize = isForced.normalize = function (string) {
5267 return String(string).replace(replacement, '.').toLowerCase();
5268};
5269
5270var data = isForced.data = {};
5271var NATIVE = isForced.NATIVE = 'N';
5272var POLYFILL = isForced.POLYFILL = 'P';
5273
5274module.exports = isForced;
5275
5276
5277/***/ }),
5278/* 143 */
5279/***/ (function(module, exports, __webpack_require__) {
5280
5281var DESCRIPTORS = __webpack_require__(19);
5282var fails = __webpack_require__(4);
5283
5284// V8 ~ Chrome 36-
5285// https://bugs.chromium.org/p/v8/issues/detail?id=3334
5286module.exports = DESCRIPTORS && fails(function () {
5287 // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
5288 return Object.defineProperty(function () { /* empty */ }, 'prototype', {
5289 value: 42,
5290 writable: false
5291 }).prototype != 42;
5292});
5293
5294
5295/***/ }),
5296/* 144 */
5297/***/ (function(module, exports, __webpack_require__) {
5298
5299var fails = __webpack_require__(4);
5300
5301module.exports = !fails(function () {
5302 function F() { /* empty */ }
5303 F.prototype.constructor = null;
5304 // eslint-disable-next-line es-x/no-object-getprototypeof -- required for testing
5305 return Object.getPrototypeOf(new F()) !== F.prototype;
5306});
5307
5308
5309/***/ }),
5310/* 145 */
5311/***/ (function(module, exports, __webpack_require__) {
5312
5313var uncurryThis = __webpack_require__(6);
5314var hasOwn = __webpack_require__(14);
5315var toIndexedObject = __webpack_require__(33);
5316var indexOf = __webpack_require__(146).indexOf;
5317var hiddenKeys = __webpack_require__(89);
5318
5319var push = uncurryThis([].push);
5320
5321module.exports = function (object, names) {
5322 var O = toIndexedObject(object);
5323 var i = 0;
5324 var result = [];
5325 var key;
5326 for (key in O) !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key);
5327 // Don't enum bug & hidden keys
5328 while (names.length > i) if (hasOwn(O, key = names[i++])) {
5329 ~indexOf(result, key) || push(result, key);
5330 }
5331 return result;
5332};
5333
5334
5335/***/ }),
5336/* 146 */
5337/***/ (function(module, exports, __webpack_require__) {
5338
5339var toIndexedObject = __webpack_require__(33);
5340var toAbsoluteIndex = __webpack_require__(112);
5341var lengthOfArrayLike = __webpack_require__(42);
5342
5343// `Array.prototype.{ indexOf, includes }` methods implementation
5344var createMethod = function (IS_INCLUDES) {
5345 return function ($this, el, fromIndex) {
5346 var O = toIndexedObject($this);
5347 var length = lengthOfArrayLike(O);
5348 var index = toAbsoluteIndex(fromIndex, length);
5349 var value;
5350 // Array#includes uses SameValueZero equality algorithm
5351 // eslint-disable-next-line no-self-compare -- NaN check
5352 if (IS_INCLUDES && el != el) while (length > index) {
5353 value = O[index++];
5354 // eslint-disable-next-line no-self-compare -- NaN check
5355 if (value != value) return true;
5356 // Array#indexOf ignores holes, Array#includes - not
5357 } else for (;length > index; index++) {
5358 if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
5359 } return !IS_INCLUDES && -1;
5360 };
5361};
5362
5363module.exports = {
5364 // `Array.prototype.includes` method
5365 // https://tc39.es/ecma262/#sec-array.prototype.includes
5366 includes: createMethod(true),
5367 // `Array.prototype.indexOf` method
5368 // https://tc39.es/ecma262/#sec-array.prototype.indexof
5369 indexOf: createMethod(false)
5370};
5371
5372
5373/***/ }),
5374/* 147 */
5375/***/ (function(module, exports, __webpack_require__) {
5376
5377var DESCRIPTORS = __webpack_require__(19);
5378var V8_PROTOTYPE_DEFINE_BUG = __webpack_require__(143);
5379var definePropertyModule = __webpack_require__(32);
5380var anObject = __webpack_require__(21);
5381var toIndexedObject = __webpack_require__(33);
5382var objectKeys = __webpack_require__(116);
5383
5384// `Object.defineProperties` method
5385// https://tc39.es/ecma262/#sec-object.defineproperties
5386// eslint-disable-next-line es-x/no-object-defineproperties -- safe
5387exports.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
5388 anObject(O);
5389 var props = toIndexedObject(Properties);
5390 var keys = objectKeys(Properties);
5391 var length = keys.length;
5392 var index = 0;
5393 var key;
5394 while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);
5395 return O;
5396};
5397
5398
5399/***/ }),
5400/* 148 */
5401/***/ (function(module, exports, __webpack_require__) {
5402
5403var getBuiltIn = __webpack_require__(16);
5404
5405module.exports = getBuiltIn('document', 'documentElement');
5406
5407
5408/***/ }),
5409/* 149 */
5410/***/ (function(module, exports, __webpack_require__) {
5411
5412var wellKnownSymbol = __webpack_require__(8);
5413var Iterators = __webpack_require__(52);
5414
5415var ITERATOR = wellKnownSymbol('iterator');
5416var ArrayPrototype = Array.prototype;
5417
5418// check on default Array iterator
5419module.exports = function (it) {
5420 return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);
5421};
5422
5423
5424/***/ }),
5425/* 150 */
5426/***/ (function(module, exports, __webpack_require__) {
5427
5428var call = __webpack_require__(10);
5429var aCallable = __webpack_require__(30);
5430var anObject = __webpack_require__(21);
5431var tryToString = __webpack_require__(66);
5432var getIteratorMethod = __webpack_require__(90);
5433
5434var $TypeError = TypeError;
5435
5436module.exports = function (argument, usingIterator) {
5437 var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
5438 if (aCallable(iteratorMethod)) return anObject(call(iteratorMethod, argument));
5439 throw $TypeError(tryToString(argument) + ' is not iterable');
5440};
5441
5442
5443/***/ }),
5444/* 151 */
5445/***/ (function(module, exports, __webpack_require__) {
5446
5447var call = __webpack_require__(10);
5448var anObject = __webpack_require__(21);
5449var getMethod = __webpack_require__(107);
5450
5451module.exports = function (iterator, kind, value) {
5452 var innerResult, innerError;
5453 anObject(iterator);
5454 try {
5455 innerResult = getMethod(iterator, 'return');
5456 if (!innerResult) {
5457 if (kind === 'throw') throw value;
5458 return value;
5459 }
5460 innerResult = call(innerResult, iterator);
5461 } catch (error) {
5462 innerError = true;
5463 innerResult = error;
5464 }
5465 if (kind === 'throw') throw value;
5466 if (innerError) throw innerResult;
5467 anObject(innerResult);
5468 return value;
5469};
5470
5471
5472/***/ }),
5473/* 152 */
5474/***/ (function(module, exports) {
5475
5476module.exports = function () { /* empty */ };
5477
5478
5479/***/ }),
5480/* 153 */
5481/***/ (function(module, exports, __webpack_require__) {
5482
5483"use strict";
5484
5485var $ = __webpack_require__(0);
5486var call = __webpack_require__(10);
5487var IS_PURE = __webpack_require__(31);
5488var FunctionName = __webpack_require__(255);
5489var isCallable = __webpack_require__(7);
5490var createIteratorConstructor = __webpack_require__(256);
5491var getPrototypeOf = __webpack_require__(86);
5492var setPrototypeOf = __webpack_require__(88);
5493var setToStringTag = __webpack_require__(54);
5494var createNonEnumerableProperty = __webpack_require__(36);
5495var defineBuiltIn = __webpack_require__(43);
5496var wellKnownSymbol = __webpack_require__(8);
5497var Iterators = __webpack_require__(52);
5498var IteratorsCore = __webpack_require__(154);
5499
5500var PROPER_FUNCTION_NAME = FunctionName.PROPER;
5501var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
5502var IteratorPrototype = IteratorsCore.IteratorPrototype;
5503var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
5504var ITERATOR = wellKnownSymbol('iterator');
5505var KEYS = 'keys';
5506var VALUES = 'values';
5507var ENTRIES = 'entries';
5508
5509var returnThis = function () { return this; };
5510
5511module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
5512 createIteratorConstructor(IteratorConstructor, NAME, next);
5513
5514 var getIterationMethod = function (KIND) {
5515 if (KIND === DEFAULT && defaultIterator) return defaultIterator;
5516 if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];
5517 switch (KIND) {
5518 case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
5519 case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
5520 case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
5521 } return function () { return new IteratorConstructor(this); };
5522 };
5523
5524 var TO_STRING_TAG = NAME + ' Iterator';
5525 var INCORRECT_VALUES_NAME = false;
5526 var IterablePrototype = Iterable.prototype;
5527 var nativeIterator = IterablePrototype[ITERATOR]
5528 || IterablePrototype['@@iterator']
5529 || DEFAULT && IterablePrototype[DEFAULT];
5530 var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
5531 var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
5532 var CurrentIteratorPrototype, methods, KEY;
5533
5534 // fix native
5535 if (anyNativeIterator) {
5536 CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
5537 if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
5538 if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
5539 if (setPrototypeOf) {
5540 setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
5541 } else if (!isCallable(CurrentIteratorPrototype[ITERATOR])) {
5542 defineBuiltIn(CurrentIteratorPrototype, ITERATOR, returnThis);
5543 }
5544 }
5545 // Set @@toStringTag to native iterators
5546 setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);
5547 if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis;
5548 }
5549 }
5550
5551 // fix Array.prototype.{ values, @@iterator }.name in V8 / FF
5552 if (PROPER_FUNCTION_NAME && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
5553 if (!IS_PURE && CONFIGURABLE_FUNCTION_NAME) {
5554 createNonEnumerableProperty(IterablePrototype, 'name', VALUES);
5555 } else {
5556 INCORRECT_VALUES_NAME = true;
5557 defaultIterator = function values() { return call(nativeIterator, this); };
5558 }
5559 }
5560
5561 // export additional methods
5562 if (DEFAULT) {
5563 methods = {
5564 values: getIterationMethod(VALUES),
5565 keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
5566 entries: getIterationMethod(ENTRIES)
5567 };
5568 if (FORCED) for (KEY in methods) {
5569 if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
5570 defineBuiltIn(IterablePrototype, KEY, methods[KEY]);
5571 }
5572 } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
5573 }
5574
5575 // define iterator
5576 if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {
5577 defineBuiltIn(IterablePrototype, ITERATOR, defaultIterator, { name: DEFAULT });
5578 }
5579 Iterators[NAME] = defaultIterator;
5580
5581 return methods;
5582};
5583
5584
5585/***/ }),
5586/* 154 */
5587/***/ (function(module, exports, __webpack_require__) {
5588
5589"use strict";
5590
5591var fails = __webpack_require__(4);
5592var isCallable = __webpack_require__(7);
5593var create = __webpack_require__(51);
5594var getPrototypeOf = __webpack_require__(86);
5595var defineBuiltIn = __webpack_require__(43);
5596var wellKnownSymbol = __webpack_require__(8);
5597var IS_PURE = __webpack_require__(31);
5598
5599var ITERATOR = wellKnownSymbol('iterator');
5600var BUGGY_SAFARI_ITERATORS = false;
5601
5602// `%IteratorPrototype%` object
5603// https://tc39.es/ecma262/#sec-%iteratorprototype%-object
5604var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
5605
5606/* eslint-disable es-x/no-array-prototype-keys -- safe */
5607if ([].keys) {
5608 arrayIterator = [].keys();
5609 // Safari 8 has buggy iterators w/o `next`
5610 if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;
5611 else {
5612 PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));
5613 if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;
5614 }
5615}
5616
5617var NEW_ITERATOR_PROTOTYPE = IteratorPrototype == undefined || fails(function () {
5618 var test = {};
5619 // FF44- legacy iterators case
5620 return IteratorPrototype[ITERATOR].call(test) !== test;
5621});
5622
5623if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {};
5624else if (IS_PURE) IteratorPrototype = create(IteratorPrototype);
5625
5626// `%IteratorPrototype%[@@iterator]()` method
5627// https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
5628if (!isCallable(IteratorPrototype[ITERATOR])) {
5629 defineBuiltIn(IteratorPrototype, ITERATOR, function () {
5630 return this;
5631 });
5632}
5633
5634module.exports = {
5635 IteratorPrototype: IteratorPrototype,
5636 BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
5637};
5638
5639
5640/***/ }),
5641/* 155 */
5642/***/ (function(module, exports, __webpack_require__) {
5643
5644var anObject = __webpack_require__(21);
5645var aConstructor = __webpack_require__(156);
5646var wellKnownSymbol = __webpack_require__(8);
5647
5648var SPECIES = wellKnownSymbol('species');
5649
5650// `SpeciesConstructor` abstract operation
5651// https://tc39.es/ecma262/#sec-speciesconstructor
5652module.exports = function (O, defaultConstructor) {
5653 var C = anObject(O).constructor;
5654 var S;
5655 return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? defaultConstructor : aConstructor(S);
5656};
5657
5658
5659/***/ }),
5660/* 156 */
5661/***/ (function(module, exports, __webpack_require__) {
5662
5663var isConstructor = __webpack_require__(93);
5664var tryToString = __webpack_require__(66);
5665
5666var $TypeError = TypeError;
5667
5668// `Assert: IsConstructor(argument) is true`
5669module.exports = function (argument) {
5670 if (isConstructor(argument)) return argument;
5671 throw $TypeError(tryToString(argument) + ' is not a constructor');
5672};
5673
5674
5675/***/ }),
5676/* 157 */
5677/***/ (function(module, exports, __webpack_require__) {
5678
5679var global = __webpack_require__(9);
5680var apply = __webpack_require__(62);
5681var bind = __webpack_require__(50);
5682var isCallable = __webpack_require__(7);
5683var hasOwn = __webpack_require__(14);
5684var fails = __webpack_require__(4);
5685var html = __webpack_require__(148);
5686var arraySlice = __webpack_require__(94);
5687var createElement = __webpack_require__(110);
5688var validateArgumentsLength = __webpack_require__(262);
5689var IS_IOS = __webpack_require__(158);
5690var IS_NODE = __webpack_require__(119);
5691
5692var set = global.setImmediate;
5693var clear = global.clearImmediate;
5694var process = global.process;
5695var Dispatch = global.Dispatch;
5696var Function = global.Function;
5697var MessageChannel = global.MessageChannel;
5698var String = global.String;
5699var counter = 0;
5700var queue = {};
5701var ONREADYSTATECHANGE = 'onreadystatechange';
5702var location, defer, channel, port;
5703
5704try {
5705 // Deno throws a ReferenceError on `location` access without `--location` flag
5706 location = global.location;
5707} catch (error) { /* empty */ }
5708
5709var run = function (id) {
5710 if (hasOwn(queue, id)) {
5711 var fn = queue[id];
5712 delete queue[id];
5713 fn();
5714 }
5715};
5716
5717var runner = function (id) {
5718 return function () {
5719 run(id);
5720 };
5721};
5722
5723var listener = function (event) {
5724 run(event.data);
5725};
5726
5727var post = function (id) {
5728 // old engines have not location.origin
5729 global.postMessage(String(id), location.protocol + '//' + location.host);
5730};
5731
5732// Node.js 0.9+ & IE10+ has setImmediate, otherwise:
5733if (!set || !clear) {
5734 set = function setImmediate(handler) {
5735 validateArgumentsLength(arguments.length, 1);
5736 var fn = isCallable(handler) ? handler : Function(handler);
5737 var args = arraySlice(arguments, 1);
5738 queue[++counter] = function () {
5739 apply(fn, undefined, args);
5740 };
5741 defer(counter);
5742 return counter;
5743 };
5744 clear = function clearImmediate(id) {
5745 delete queue[id];
5746 };
5747 // Node.js 0.8-
5748 if (IS_NODE) {
5749 defer = function (id) {
5750 process.nextTick(runner(id));
5751 };
5752 // Sphere (JS game engine) Dispatch API
5753 } else if (Dispatch && Dispatch.now) {
5754 defer = function (id) {
5755 Dispatch.now(runner(id));
5756 };
5757 // Browsers with MessageChannel, includes WebWorkers
5758 // except iOS - https://github.com/zloirock/core-js/issues/624
5759 } else if (MessageChannel && !IS_IOS) {
5760 channel = new MessageChannel();
5761 port = channel.port2;
5762 channel.port1.onmessage = listener;
5763 defer = bind(port.postMessage, port);
5764 // Browsers with postMessage, skip WebWorkers
5765 // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
5766 } else if (
5767 global.addEventListener &&
5768 isCallable(global.postMessage) &&
5769 !global.importScripts &&
5770 location && location.protocol !== 'file:' &&
5771 !fails(post)
5772 ) {
5773 defer = post;
5774 global.addEventListener('message', listener, false);
5775 // IE8-
5776 } else if (ONREADYSTATECHANGE in createElement('script')) {
5777 defer = function (id) {
5778 html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {
5779 html.removeChild(this);
5780 run(id);
5781 };
5782 };
5783 // Rest old browsers
5784 } else {
5785 defer = function (id) {
5786 setTimeout(runner(id), 0);
5787 };
5788 }
5789}
5790
5791module.exports = {
5792 set: set,
5793 clear: clear
5794};
5795
5796
5797/***/ }),
5798/* 158 */
5799/***/ (function(module, exports, __webpack_require__) {
5800
5801var userAgent = __webpack_require__(85);
5802
5803module.exports = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent);
5804
5805
5806/***/ }),
5807/* 159 */
5808/***/ (function(module, exports, __webpack_require__) {
5809
5810var NativePromiseConstructor = __webpack_require__(55);
5811var checkCorrectnessOfIteration = __webpack_require__(160);
5812var FORCED_PROMISE_CONSTRUCTOR = __webpack_require__(72).CONSTRUCTOR;
5813
5814module.exports = FORCED_PROMISE_CONSTRUCTOR || !checkCorrectnessOfIteration(function (iterable) {
5815 NativePromiseConstructor.all(iterable).then(undefined, function () { /* empty */ });
5816});
5817
5818
5819/***/ }),
5820/* 160 */
5821/***/ (function(module, exports, __webpack_require__) {
5822
5823var wellKnownSymbol = __webpack_require__(8);
5824
5825var ITERATOR = wellKnownSymbol('iterator');
5826var SAFE_CLOSING = false;
5827
5828try {
5829 var called = 0;
5830 var iteratorWithReturn = {
5831 next: function () {
5832 return { done: !!called++ };
5833 },
5834 'return': function () {
5835 SAFE_CLOSING = true;
5836 }
5837 };
5838 iteratorWithReturn[ITERATOR] = function () {
5839 return this;
5840 };
5841 // eslint-disable-next-line es-x/no-array-from, no-throw-literal -- required for testing
5842 Array.from(iteratorWithReturn, function () { throw 2; });
5843} catch (error) { /* empty */ }
5844
5845module.exports = function (exec, SKIP_CLOSING) {
5846 if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
5847 var ITERATION_SUPPORT = false;
5848 try {
5849 var object = {};
5850 object[ITERATOR] = function () {
5851 return {
5852 next: function () {
5853 return { done: ITERATION_SUPPORT = true };
5854 }
5855 };
5856 };
5857 exec(object);
5858 } catch (error) { /* empty */ }
5859 return ITERATION_SUPPORT;
5860};
5861
5862
5863/***/ }),
5864/* 161 */
5865/***/ (function(module, exports, __webpack_require__) {
5866
5867var anObject = __webpack_require__(21);
5868var isObject = __webpack_require__(17);
5869var newPromiseCapability = __webpack_require__(44);
5870
5871module.exports = function (C, x) {
5872 anObject(C);
5873 if (isObject(x) && x.constructor === C) return x;
5874 var promiseCapability = newPromiseCapability.f(C);
5875 var resolve = promiseCapability.resolve;
5876 resolve(x);
5877 return promiseCapability.promise;
5878};
5879
5880
5881/***/ }),
5882/* 162 */
5883/***/ (function(module, __webpack_exports__, __webpack_require__) {
5884
5885"use strict";
5886/* harmony export (immutable) */ __webpack_exports__["a"] = isUndefined;
5887// Is a given variable undefined?
5888function isUndefined(obj) {
5889 return obj === void 0;
5890}
5891
5892
5893/***/ }),
5894/* 163 */
5895/***/ (function(module, __webpack_exports__, __webpack_require__) {
5896
5897"use strict";
5898/* harmony export (immutable) */ __webpack_exports__["a"] = isBoolean;
5899/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(3);
5900
5901
5902// Is a given value a boolean?
5903function isBoolean(obj) {
5904 return obj === true || obj === false || __WEBPACK_IMPORTED_MODULE_0__setup_js__["t" /* toString */].call(obj) === '[object Boolean]';
5905}
5906
5907
5908/***/ }),
5909/* 164 */
5910/***/ (function(module, __webpack_exports__, __webpack_require__) {
5911
5912"use strict";
5913/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(15);
5914
5915
5916/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Number'));
5917
5918
5919/***/ }),
5920/* 165 */
5921/***/ (function(module, __webpack_exports__, __webpack_require__) {
5922
5923"use strict";
5924/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(15);
5925
5926
5927/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Symbol'));
5928
5929
5930/***/ }),
5931/* 166 */
5932/***/ (function(module, __webpack_exports__, __webpack_require__) {
5933
5934"use strict";
5935/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(15);
5936
5937
5938/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('ArrayBuffer'));
5939
5940
5941/***/ }),
5942/* 167 */
5943/***/ (function(module, __webpack_exports__, __webpack_require__) {
5944
5945"use strict";
5946/* harmony export (immutable) */ __webpack_exports__["a"] = isNaN;
5947/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(3);
5948/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isNumber_js__ = __webpack_require__(164);
5949
5950
5951
5952// Is the given value `NaN`?
5953function isNaN(obj) {
5954 return Object(__WEBPACK_IMPORTED_MODULE_1__isNumber_js__["a" /* default */])(obj) && Object(__WEBPACK_IMPORTED_MODULE_0__setup_js__["g" /* _isNaN */])(obj);
5955}
5956
5957
5958/***/ }),
5959/* 168 */
5960/***/ (function(module, __webpack_exports__, __webpack_require__) {
5961
5962"use strict";
5963/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(3);
5964/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isDataView_js__ = __webpack_require__(122);
5965/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constant_js__ = __webpack_require__(169);
5966/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isBufferLike_js__ = __webpack_require__(287);
5967
5968
5969
5970
5971
5972// Is a given value a typed array?
5973var typedArrayPattern = /\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;
5974function isTypedArray(obj) {
5975 // `ArrayBuffer.isView` is the most future-proof, so use it when available.
5976 // Otherwise, fall back on the above regular expression.
5977 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)) :
5978 Object(__WEBPACK_IMPORTED_MODULE_3__isBufferLike_js__["a" /* default */])(obj) && typedArrayPattern.test(__WEBPACK_IMPORTED_MODULE_0__setup_js__["t" /* toString */].call(obj));
5979}
5980
5981/* 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));
5982
5983
5984/***/ }),
5985/* 169 */
5986/***/ (function(module, __webpack_exports__, __webpack_require__) {
5987
5988"use strict";
5989/* harmony export (immutable) */ __webpack_exports__["a"] = constant;
5990// Predicate-generating function. Often useful outside of Underscore.
5991function constant(value) {
5992 return function() {
5993 return value;
5994 };
5995}
5996
5997
5998/***/ }),
5999/* 170 */
6000/***/ (function(module, __webpack_exports__, __webpack_require__) {
6001
6002"use strict";
6003/* harmony export (immutable) */ __webpack_exports__["a"] = createSizePropertyCheck;
6004/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(3);
6005
6006
6007// Common internal logic for `isArrayLike` and `isBufferLike`.
6008function createSizePropertyCheck(getSizeProperty) {
6009 return function(collection) {
6010 var sizeProperty = getSizeProperty(collection);
6011 return typeof sizeProperty == 'number' && sizeProperty >= 0 && sizeProperty <= __WEBPACK_IMPORTED_MODULE_0__setup_js__["b" /* MAX_ARRAY_INDEX */];
6012 }
6013}
6014
6015
6016/***/ }),
6017/* 171 */
6018/***/ (function(module, __webpack_exports__, __webpack_require__) {
6019
6020"use strict";
6021/* harmony export (immutable) */ __webpack_exports__["a"] = shallowProperty;
6022// Internal helper to generate a function to obtain property `key` from `obj`.
6023function shallowProperty(key) {
6024 return function(obj) {
6025 return obj == null ? void 0 : obj[key];
6026 };
6027}
6028
6029
6030/***/ }),
6031/* 172 */
6032/***/ (function(module, __webpack_exports__, __webpack_require__) {
6033
6034"use strict";
6035/* harmony export (immutable) */ __webpack_exports__["a"] = collectNonEnumProps;
6036/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(3);
6037/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(26);
6038/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__has_js__ = __webpack_require__(37);
6039
6040
6041
6042
6043// Internal helper to create a simple lookup structure.
6044// `collectNonEnumProps` used to depend on `_.contains`, but this led to
6045// circular imports. `emulatedSet` is a one-off solution that only works for
6046// arrays of strings.
6047function emulatedSet(keys) {
6048 var hash = {};
6049 for (var l = keys.length, i = 0; i < l; ++i) hash[keys[i]] = true;
6050 return {
6051 contains: function(key) { return hash[key]; },
6052 push: function(key) {
6053 hash[key] = true;
6054 return keys.push(key);
6055 }
6056 };
6057}
6058
6059// Internal helper. Checks `keys` for the presence of keys in IE < 9 that won't
6060// be iterated by `for key in ...` and thus missed. Extends `keys` in place if
6061// needed.
6062function collectNonEnumProps(obj, keys) {
6063 keys = emulatedSet(keys);
6064 var nonEnumIdx = __WEBPACK_IMPORTED_MODULE_0__setup_js__["n" /* nonEnumerableProps */].length;
6065 var constructor = obj.constructor;
6066 var proto = Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(constructor) && constructor.prototype || __WEBPACK_IMPORTED_MODULE_0__setup_js__["c" /* ObjProto */];
6067
6068 // Constructor is a special case.
6069 var prop = 'constructor';
6070 if (Object(__WEBPACK_IMPORTED_MODULE_2__has_js__["a" /* default */])(obj, prop) && !keys.contains(prop)) keys.push(prop);
6071
6072 while (nonEnumIdx--) {
6073 prop = __WEBPACK_IMPORTED_MODULE_0__setup_js__["n" /* nonEnumerableProps */][nonEnumIdx];
6074 if (prop in obj && obj[prop] !== proto[prop] && !keys.contains(prop)) {
6075 keys.push(prop);
6076 }
6077 }
6078}
6079
6080
6081/***/ }),
6082/* 173 */
6083/***/ (function(module, __webpack_exports__, __webpack_require__) {
6084
6085"use strict";
6086/* harmony export (immutable) */ __webpack_exports__["a"] = isMatch;
6087/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__keys_js__ = __webpack_require__(11);
6088
6089
6090// Returns whether an object has a given set of `key:value` pairs.
6091function isMatch(object, attrs) {
6092 var _keys = Object(__WEBPACK_IMPORTED_MODULE_0__keys_js__["a" /* default */])(attrs), length = _keys.length;
6093 if (object == null) return !length;
6094 var obj = Object(object);
6095 for (var i = 0; i < length; i++) {
6096 var key = _keys[i];
6097 if (attrs[key] !== obj[key] || !(key in obj)) return false;
6098 }
6099 return true;
6100}
6101
6102
6103/***/ }),
6104/* 174 */
6105/***/ (function(module, __webpack_exports__, __webpack_require__) {
6106
6107"use strict";
6108/* harmony export (immutable) */ __webpack_exports__["a"] = invert;
6109/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__keys_js__ = __webpack_require__(11);
6110
6111
6112// Invert the keys and values of an object. The values must be serializable.
6113function invert(obj) {
6114 var result = {};
6115 var _keys = Object(__WEBPACK_IMPORTED_MODULE_0__keys_js__["a" /* default */])(obj);
6116 for (var i = 0, length = _keys.length; i < length; i++) {
6117 result[obj[_keys[i]]] = _keys[i];
6118 }
6119 return result;
6120}
6121
6122
6123/***/ }),
6124/* 175 */
6125/***/ (function(module, __webpack_exports__, __webpack_require__) {
6126
6127"use strict";
6128/* harmony export (immutable) */ __webpack_exports__["a"] = functions;
6129/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isFunction_js__ = __webpack_require__(26);
6130
6131
6132// Return a sorted list of the function names available on the object.
6133function functions(obj) {
6134 var names = [];
6135 for (var key in obj) {
6136 if (Object(__WEBPACK_IMPORTED_MODULE_0__isFunction_js__["a" /* default */])(obj[key])) names.push(key);
6137 }
6138 return names.sort();
6139}
6140
6141
6142/***/ }),
6143/* 176 */
6144/***/ (function(module, __webpack_exports__, __webpack_require__) {
6145
6146"use strict";
6147/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createAssigner_js__ = __webpack_require__(126);
6148/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__allKeys_js__ = __webpack_require__(75);
6149
6150
6151
6152// Extend a given object with all the properties in passed-in object(s).
6153/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createAssigner_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__allKeys_js__["a" /* default */]));
6154
6155
6156/***/ }),
6157/* 177 */
6158/***/ (function(module, __webpack_exports__, __webpack_require__) {
6159
6160"use strict";
6161/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createAssigner_js__ = __webpack_require__(126);
6162/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__allKeys_js__ = __webpack_require__(75);
6163
6164
6165
6166// Fill in a given object with default properties.
6167/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createAssigner_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__allKeys_js__["a" /* default */], true));
6168
6169
6170/***/ }),
6171/* 178 */
6172/***/ (function(module, __webpack_exports__, __webpack_require__) {
6173
6174"use strict";
6175/* harmony export (immutable) */ __webpack_exports__["a"] = baseCreate;
6176/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isObject_js__ = __webpack_require__(45);
6177/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(3);
6178
6179
6180
6181// Create a naked function reference for surrogate-prototype-swapping.
6182function ctor() {
6183 return function(){};
6184}
6185
6186// An internal function for creating a new object that inherits from another.
6187function baseCreate(prototype) {
6188 if (!Object(__WEBPACK_IMPORTED_MODULE_0__isObject_js__["a" /* default */])(prototype)) return {};
6189 if (__WEBPACK_IMPORTED_MODULE_1__setup_js__["j" /* nativeCreate */]) return Object(__WEBPACK_IMPORTED_MODULE_1__setup_js__["j" /* nativeCreate */])(prototype);
6190 var Ctor = ctor();
6191 Ctor.prototype = prototype;
6192 var result = new Ctor;
6193 Ctor.prototype = null;
6194 return result;
6195}
6196
6197
6198/***/ }),
6199/* 179 */
6200/***/ (function(module, __webpack_exports__, __webpack_require__) {
6201
6202"use strict";
6203/* harmony export (immutable) */ __webpack_exports__["a"] = clone;
6204/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isObject_js__ = __webpack_require__(45);
6205/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArray_js__ = __webpack_require__(46);
6206/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__extend_js__ = __webpack_require__(176);
6207
6208
6209
6210
6211// Create a (shallow-cloned) duplicate of an object.
6212function clone(obj) {
6213 if (!Object(__WEBPACK_IMPORTED_MODULE_0__isObject_js__["a" /* default */])(obj)) return obj;
6214 return Object(__WEBPACK_IMPORTED_MODULE_1__isArray_js__["a" /* default */])(obj) ? obj.slice() : Object(__WEBPACK_IMPORTED_MODULE_2__extend_js__["a" /* default */])({}, obj);
6215}
6216
6217
6218/***/ }),
6219/* 180 */
6220/***/ (function(module, __webpack_exports__, __webpack_require__) {
6221
6222"use strict";
6223/* harmony export (immutable) */ __webpack_exports__["a"] = get;
6224/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__toPath_js__ = __webpack_require__(76);
6225/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__deepGet_js__ = __webpack_require__(128);
6226/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isUndefined_js__ = __webpack_require__(162);
6227
6228
6229
6230
6231// Get the value of the (deep) property on `path` from `object`.
6232// If any property in `path` does not exist or if the value is
6233// `undefined`, return `defaultValue` instead.
6234// The `path` is normalized through `_.toPath`.
6235function get(object, path, defaultValue) {
6236 var value = Object(__WEBPACK_IMPORTED_MODULE_1__deepGet_js__["a" /* default */])(object, Object(__WEBPACK_IMPORTED_MODULE_0__toPath_js__["a" /* default */])(path));
6237 return Object(__WEBPACK_IMPORTED_MODULE_2__isUndefined_js__["a" /* default */])(value) ? defaultValue : value;
6238}
6239
6240
6241/***/ }),
6242/* 181 */
6243/***/ (function(module, __webpack_exports__, __webpack_require__) {
6244
6245"use strict";
6246/* harmony export (immutable) */ __webpack_exports__["a"] = toPath;
6247/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(23);
6248/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArray_js__ = __webpack_require__(46);
6249
6250
6251
6252// Normalize a (deep) property `path` to array.
6253// Like `_.iteratee`, this function can be customized.
6254function toPath(path) {
6255 return Object(__WEBPACK_IMPORTED_MODULE_1__isArray_js__["a" /* default */])(path) ? path : [path];
6256}
6257__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].toPath = toPath;
6258
6259
6260/***/ }),
6261/* 182 */
6262/***/ (function(module, __webpack_exports__, __webpack_require__) {
6263
6264"use strict";
6265/* harmony export (immutable) */ __webpack_exports__["a"] = baseIteratee;
6266/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__identity_js__ = __webpack_require__(129);
6267/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(26);
6268/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isObject_js__ = __webpack_require__(45);
6269/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isArray_js__ = __webpack_require__(46);
6270/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__matcher_js__ = __webpack_require__(96);
6271/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__property_js__ = __webpack_require__(130);
6272/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__optimizeCb_js__ = __webpack_require__(77);
6273
6274
6275
6276
6277
6278
6279
6280
6281// An internal function to generate callbacks that can be applied to each
6282// element in a collection, returning the desired result — either `_.identity`,
6283// an arbitrary callback, a property matcher, or a property accessor.
6284function baseIteratee(value, context, argCount) {
6285 if (value == null) return __WEBPACK_IMPORTED_MODULE_0__identity_js__["a" /* default */];
6286 if (Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(value)) return Object(__WEBPACK_IMPORTED_MODULE_6__optimizeCb_js__["a" /* default */])(value, context, argCount);
6287 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);
6288 return Object(__WEBPACK_IMPORTED_MODULE_5__property_js__["a" /* default */])(value);
6289}
6290
6291
6292/***/ }),
6293/* 183 */
6294/***/ (function(module, __webpack_exports__, __webpack_require__) {
6295
6296"use strict";
6297/* harmony export (immutable) */ __webpack_exports__["a"] = iteratee;
6298/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(23);
6299/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__baseIteratee_js__ = __webpack_require__(182);
6300
6301
6302
6303// External wrapper for our callback generator. Users may customize
6304// `_.iteratee` if they want additional predicate/iteratee shorthand styles.
6305// This abstraction hides the internal-only `argCount` argument.
6306function iteratee(value, context) {
6307 return Object(__WEBPACK_IMPORTED_MODULE_1__baseIteratee_js__["a" /* default */])(value, context, Infinity);
6308}
6309__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].iteratee = iteratee;
6310
6311
6312/***/ }),
6313/* 184 */
6314/***/ (function(module, __webpack_exports__, __webpack_require__) {
6315
6316"use strict";
6317/* harmony export (immutable) */ __webpack_exports__["a"] = noop;
6318// Predicate-generating function. Often useful outside of Underscore.
6319function noop(){}
6320
6321
6322/***/ }),
6323/* 185 */
6324/***/ (function(module, __webpack_exports__, __webpack_require__) {
6325
6326"use strict";
6327/* harmony export (immutable) */ __webpack_exports__["a"] = random;
6328// Return a random integer between `min` and `max` (inclusive).
6329function random(min, max) {
6330 if (max == null) {
6331 max = min;
6332 min = 0;
6333 }
6334 return min + Math.floor(Math.random() * (max - min + 1));
6335}
6336
6337
6338/***/ }),
6339/* 186 */
6340/***/ (function(module, __webpack_exports__, __webpack_require__) {
6341
6342"use strict";
6343/* harmony export (immutable) */ __webpack_exports__["a"] = createEscaper;
6344/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__keys_js__ = __webpack_require__(11);
6345
6346
6347// Internal helper to generate functions for escaping and unescaping strings
6348// to/from HTML interpolation.
6349function createEscaper(map) {
6350 var escaper = function(match) {
6351 return map[match];
6352 };
6353 // Regexes for identifying a key that needs to be escaped.
6354 var source = '(?:' + Object(__WEBPACK_IMPORTED_MODULE_0__keys_js__["a" /* default */])(map).join('|') + ')';
6355 var testRegexp = RegExp(source);
6356 var replaceRegexp = RegExp(source, 'g');
6357 return function(string) {
6358 string = string == null ? '' : '' + string;
6359 return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;
6360 };
6361}
6362
6363
6364/***/ }),
6365/* 187 */
6366/***/ (function(module, __webpack_exports__, __webpack_require__) {
6367
6368"use strict";
6369// Internal list of HTML entities for escaping.
6370/* harmony default export */ __webpack_exports__["a"] = ({
6371 '&': '&amp;',
6372 '<': '&lt;',
6373 '>': '&gt;',
6374 '"': '&quot;',
6375 "'": '&#x27;',
6376 '`': '&#x60;'
6377});
6378
6379
6380/***/ }),
6381/* 188 */
6382/***/ (function(module, __webpack_exports__, __webpack_require__) {
6383
6384"use strict";
6385/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(23);
6386
6387
6388// By default, Underscore uses ERB-style template delimiters. Change the
6389// following template settings to use alternative delimiters.
6390/* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].templateSettings = {
6391 evaluate: /<%([\s\S]+?)%>/g,
6392 interpolate: /<%=([\s\S]+?)%>/g,
6393 escape: /<%-([\s\S]+?)%>/g
6394});
6395
6396
6397/***/ }),
6398/* 189 */
6399/***/ (function(module, __webpack_exports__, __webpack_require__) {
6400
6401"use strict";
6402/* harmony export (immutable) */ __webpack_exports__["a"] = executeBound;
6403/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseCreate_js__ = __webpack_require__(178);
6404/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isObject_js__ = __webpack_require__(45);
6405
6406
6407
6408// Internal function to execute `sourceFunc` bound to `context` with optional
6409// `args`. Determines whether to execute a function as a constructor or as a
6410// normal function.
6411function executeBound(sourceFunc, boundFunc, context, callingContext, args) {
6412 if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);
6413 var self = Object(__WEBPACK_IMPORTED_MODULE_0__baseCreate_js__["a" /* default */])(sourceFunc.prototype);
6414 var result = sourceFunc.apply(self, args);
6415 if (Object(__WEBPACK_IMPORTED_MODULE_1__isObject_js__["a" /* default */])(result)) return result;
6416 return self;
6417}
6418
6419
6420/***/ }),
6421/* 190 */
6422/***/ (function(module, __webpack_exports__, __webpack_require__) {
6423
6424"use strict";
6425/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(22);
6426/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(26);
6427/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__executeBound_js__ = __webpack_require__(189);
6428
6429
6430
6431
6432// Create a function bound to a given object (assigning `this`, and arguments,
6433// optionally).
6434/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(func, context, args) {
6435 if (!Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(func)) throw new TypeError('Bind must be called on a function');
6436 var bound = Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(callArgs) {
6437 return Object(__WEBPACK_IMPORTED_MODULE_2__executeBound_js__["a" /* default */])(func, bound, context, this, args.concat(callArgs));
6438 });
6439 return bound;
6440}));
6441
6442
6443/***/ }),
6444/* 191 */
6445/***/ (function(module, __webpack_exports__, __webpack_require__) {
6446
6447"use strict";
6448/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(22);
6449
6450
6451// Delays a function for the given number of milliseconds, and then calls
6452// it with the arguments supplied.
6453/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(func, wait, args) {
6454 return setTimeout(function() {
6455 return func.apply(null, args);
6456 }, wait);
6457}));
6458
6459
6460/***/ }),
6461/* 192 */
6462/***/ (function(module, __webpack_exports__, __webpack_require__) {
6463
6464"use strict";
6465/* harmony export (immutable) */ __webpack_exports__["a"] = before;
6466// Returns a function that will only be executed up to (but not including) the
6467// Nth call.
6468function before(times, func) {
6469 var memo;
6470 return function() {
6471 if (--times > 0) {
6472 memo = func.apply(this, arguments);
6473 }
6474 if (times <= 1) func = null;
6475 return memo;
6476 };
6477}
6478
6479
6480/***/ }),
6481/* 193 */
6482/***/ (function(module, __webpack_exports__, __webpack_require__) {
6483
6484"use strict";
6485/* harmony export (immutable) */ __webpack_exports__["a"] = findKey;
6486/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(18);
6487/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__keys_js__ = __webpack_require__(11);
6488
6489
6490
6491// Returns the first key on an object that passes a truth test.
6492function findKey(obj, predicate, context) {
6493 predicate = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(predicate, context);
6494 var _keys = Object(__WEBPACK_IMPORTED_MODULE_1__keys_js__["a" /* default */])(obj), key;
6495 for (var i = 0, length = _keys.length; i < length; i++) {
6496 key = _keys[i];
6497 if (predicate(obj[key], key, obj)) return key;
6498 }
6499}
6500
6501
6502/***/ }),
6503/* 194 */
6504/***/ (function(module, __webpack_exports__, __webpack_require__) {
6505
6506"use strict";
6507/* harmony export (immutable) */ __webpack_exports__["a"] = createPredicateIndexFinder;
6508/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(18);
6509/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getLength_js__ = __webpack_require__(27);
6510
6511
6512
6513// Internal function to generate `_.findIndex` and `_.findLastIndex`.
6514function createPredicateIndexFinder(dir) {
6515 return function(array, predicate, context) {
6516 predicate = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(predicate, context);
6517 var length = Object(__WEBPACK_IMPORTED_MODULE_1__getLength_js__["a" /* default */])(array);
6518 var index = dir > 0 ? 0 : length - 1;
6519 for (; index >= 0 && index < length; index += dir) {
6520 if (predicate(array[index], index, array)) return index;
6521 }
6522 return -1;
6523 };
6524}
6525
6526
6527/***/ }),
6528/* 195 */
6529/***/ (function(module, __webpack_exports__, __webpack_require__) {
6530
6531"use strict";
6532/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createPredicateIndexFinder_js__ = __webpack_require__(194);
6533
6534
6535// Returns the last index on an array-like that passes a truth test.
6536/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createPredicateIndexFinder_js__["a" /* default */])(-1));
6537
6538
6539/***/ }),
6540/* 196 */
6541/***/ (function(module, __webpack_exports__, __webpack_require__) {
6542
6543"use strict";
6544/* harmony export (immutable) */ __webpack_exports__["a"] = sortedIndex;
6545/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(18);
6546/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getLength_js__ = __webpack_require__(27);
6547
6548
6549
6550// Use a comparator function to figure out the smallest index at which
6551// an object should be inserted so as to maintain order. Uses binary search.
6552function sortedIndex(array, obj, iteratee, context) {
6553 iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(iteratee, context, 1);
6554 var value = iteratee(obj);
6555 var low = 0, high = Object(__WEBPACK_IMPORTED_MODULE_1__getLength_js__["a" /* default */])(array);
6556 while (low < high) {
6557 var mid = Math.floor((low + high) / 2);
6558 if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;
6559 }
6560 return low;
6561}
6562
6563
6564/***/ }),
6565/* 197 */
6566/***/ (function(module, __webpack_exports__, __webpack_require__) {
6567
6568"use strict";
6569/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__sortedIndex_js__ = __webpack_require__(196);
6570/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__findIndex_js__ = __webpack_require__(133);
6571/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__createIndexFinder_js__ = __webpack_require__(198);
6572
6573
6574
6575
6576// Return the position of the first occurrence of an item in an array,
6577// or -1 if the item is not included in the array.
6578// If the array is large and already in sort order, pass `true`
6579// for **isSorted** to use binary search.
6580/* 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 */]));
6581
6582
6583/***/ }),
6584/* 198 */
6585/***/ (function(module, __webpack_exports__, __webpack_require__) {
6586
6587"use strict";
6588/* harmony export (immutable) */ __webpack_exports__["a"] = createIndexFinder;
6589/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(27);
6590/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(3);
6591/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isNaN_js__ = __webpack_require__(167);
6592
6593
6594
6595
6596// Internal function to generate the `_.indexOf` and `_.lastIndexOf` functions.
6597function createIndexFinder(dir, predicateFind, sortedIndex) {
6598 return function(array, item, idx) {
6599 var i = 0, length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(array);
6600 if (typeof idx == 'number') {
6601 if (dir > 0) {
6602 i = idx >= 0 ? idx : Math.max(idx + length, i);
6603 } else {
6604 length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;
6605 }
6606 } else if (sortedIndex && idx && length) {
6607 idx = sortedIndex(array, item);
6608 return array[idx] === item ? idx : -1;
6609 }
6610 if (item !== item) {
6611 idx = predicateFind(__WEBPACK_IMPORTED_MODULE_1__setup_js__["q" /* slice */].call(array, i, length), __WEBPACK_IMPORTED_MODULE_2__isNaN_js__["a" /* default */]);
6612 return idx >= 0 ? idx + i : -1;
6613 }
6614 for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {
6615 if (array[idx] === item) return idx;
6616 }
6617 return -1;
6618 };
6619}
6620
6621
6622/***/ }),
6623/* 199 */
6624/***/ (function(module, __webpack_exports__, __webpack_require__) {
6625
6626"use strict";
6627/* harmony export (immutable) */ __webpack_exports__["a"] = find;
6628/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(24);
6629/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__findIndex_js__ = __webpack_require__(133);
6630/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__findKey_js__ = __webpack_require__(193);
6631
6632
6633
6634
6635// Return the first value which passes a truth test.
6636function find(obj, predicate, context) {
6637 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 */];
6638 var key = keyFinder(obj, predicate, context);
6639 if (key !== void 0 && key !== -1) return obj[key];
6640}
6641
6642
6643/***/ }),
6644/* 200 */
6645/***/ (function(module, __webpack_exports__, __webpack_require__) {
6646
6647"use strict";
6648/* harmony export (immutable) */ __webpack_exports__["a"] = createReduce;
6649/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(24);
6650/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__keys_js__ = __webpack_require__(11);
6651/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__optimizeCb_js__ = __webpack_require__(77);
6652
6653
6654
6655
6656// Internal helper to create a reducing function, iterating left or right.
6657function createReduce(dir) {
6658 // Wrap code that reassigns argument variables in a separate function than
6659 // the one that accesses `arguments.length` to avoid a perf hit. (#1991)
6660 var reducer = function(obj, iteratee, memo, initial) {
6661 var _keys = !Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" /* default */])(obj) && Object(__WEBPACK_IMPORTED_MODULE_1__keys_js__["a" /* default */])(obj),
6662 length = (_keys || obj).length,
6663 index = dir > 0 ? 0 : length - 1;
6664 if (!initial) {
6665 memo = obj[_keys ? _keys[index] : index];
6666 index += dir;
6667 }
6668 for (; index >= 0 && index < length; index += dir) {
6669 var currentKey = _keys ? _keys[index] : index;
6670 memo = iteratee(memo, obj[currentKey], currentKey, obj);
6671 }
6672 return memo;
6673 };
6674
6675 return function(obj, iteratee, memo, context) {
6676 var initial = arguments.length >= 3;
6677 return reducer(obj, Object(__WEBPACK_IMPORTED_MODULE_2__optimizeCb_js__["a" /* default */])(iteratee, context, 4), memo, initial);
6678 };
6679}
6680
6681
6682/***/ }),
6683/* 201 */
6684/***/ (function(module, __webpack_exports__, __webpack_require__) {
6685
6686"use strict";
6687/* harmony export (immutable) */ __webpack_exports__["a"] = max;
6688/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(24);
6689/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__values_js__ = __webpack_require__(56);
6690/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__cb_js__ = __webpack_require__(18);
6691/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__each_js__ = __webpack_require__(47);
6692
6693
6694
6695
6696
6697// Return the maximum element (or element-based computation).
6698function max(obj, iteratee, context) {
6699 var result = -Infinity, lastComputed = -Infinity,
6700 value, computed;
6701 if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) {
6702 obj = Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" /* default */])(obj) ? obj : Object(__WEBPACK_IMPORTED_MODULE_1__values_js__["a" /* default */])(obj);
6703 for (var i = 0, length = obj.length; i < length; i++) {
6704 value = obj[i];
6705 if (value != null && value > result) {
6706 result = value;
6707 }
6708 }
6709 } else {
6710 iteratee = Object(__WEBPACK_IMPORTED_MODULE_2__cb_js__["a" /* default */])(iteratee, context);
6711 Object(__WEBPACK_IMPORTED_MODULE_3__each_js__["a" /* default */])(obj, function(v, index, list) {
6712 computed = iteratee(v, index, list);
6713 if (computed > lastComputed || computed === -Infinity && result === -Infinity) {
6714 result = v;
6715 lastComputed = computed;
6716 }
6717 });
6718 }
6719 return result;
6720}
6721
6722
6723/***/ }),
6724/* 202 */
6725/***/ (function(module, __webpack_exports__, __webpack_require__) {
6726
6727"use strict";
6728/* harmony export (immutable) */ __webpack_exports__["a"] = sample;
6729/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(24);
6730/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__clone_js__ = __webpack_require__(179);
6731/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__values_js__ = __webpack_require__(56);
6732/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__getLength_js__ = __webpack_require__(27);
6733/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__random_js__ = __webpack_require__(185);
6734
6735
6736
6737
6738
6739
6740// Sample **n** random values from a collection using the modern version of the
6741// [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher–Yates_shuffle).
6742// If **n** is not specified, returns a single random element.
6743// The internal `guard` argument allows it to work with `_.map`.
6744function sample(obj, n, guard) {
6745 if (n == null || guard) {
6746 if (!Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" /* default */])(obj)) obj = Object(__WEBPACK_IMPORTED_MODULE_2__values_js__["a" /* default */])(obj);
6747 return obj[Object(__WEBPACK_IMPORTED_MODULE_4__random_js__["a" /* default */])(obj.length - 1)];
6748 }
6749 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);
6750 var length = Object(__WEBPACK_IMPORTED_MODULE_3__getLength_js__["a" /* default */])(sample);
6751 n = Math.max(Math.min(n, length), 0);
6752 var last = length - 1;
6753 for (var index = 0; index < n; index++) {
6754 var rand = Object(__WEBPACK_IMPORTED_MODULE_4__random_js__["a" /* default */])(index, last);
6755 var temp = sample[index];
6756 sample[index] = sample[rand];
6757 sample[rand] = temp;
6758 }
6759 return sample.slice(0, n);
6760}
6761
6762
6763/***/ }),
6764/* 203 */
6765/***/ (function(module, __webpack_exports__, __webpack_require__) {
6766
6767"use strict";
6768/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(22);
6769/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(26);
6770/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__optimizeCb_js__ = __webpack_require__(77);
6771/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__allKeys_js__ = __webpack_require__(75);
6772/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__keyInObj_js__ = __webpack_require__(336);
6773/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__flatten_js__ = __webpack_require__(57);
6774
6775
6776
6777
6778
6779
6780
6781// Return a copy of the object only containing the allowed properties.
6782/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(obj, keys) {
6783 var result = {}, iteratee = keys[0];
6784 if (obj == null) return result;
6785 if (Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(iteratee)) {
6786 if (keys.length > 1) iteratee = Object(__WEBPACK_IMPORTED_MODULE_2__optimizeCb_js__["a" /* default */])(iteratee, keys[1]);
6787 keys = Object(__WEBPACK_IMPORTED_MODULE_3__allKeys_js__["a" /* default */])(obj);
6788 } else {
6789 iteratee = __WEBPACK_IMPORTED_MODULE_4__keyInObj_js__["a" /* default */];
6790 keys = Object(__WEBPACK_IMPORTED_MODULE_5__flatten_js__["a" /* default */])(keys, false, false);
6791 obj = Object(obj);
6792 }
6793 for (var i = 0, length = keys.length; i < length; i++) {
6794 var key = keys[i];
6795 var value = obj[key];
6796 if (iteratee(value, key, obj)) result[key] = value;
6797 }
6798 return result;
6799}));
6800
6801
6802/***/ }),
6803/* 204 */
6804/***/ (function(module, __webpack_exports__, __webpack_require__) {
6805
6806"use strict";
6807/* harmony export (immutable) */ __webpack_exports__["a"] = initial;
6808/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(3);
6809
6810
6811// Returns everything but the last entry of the array. Especially useful on
6812// the arguments object. Passing **n** will return all the values in
6813// the array, excluding the last N.
6814function initial(array, n, guard) {
6815 return __WEBPACK_IMPORTED_MODULE_0__setup_js__["q" /* slice */].call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));
6816}
6817
6818
6819/***/ }),
6820/* 205 */
6821/***/ (function(module, __webpack_exports__, __webpack_require__) {
6822
6823"use strict";
6824/* harmony export (immutable) */ __webpack_exports__["a"] = rest;
6825/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(3);
6826
6827
6828// Returns everything but the first entry of the `array`. Especially useful on
6829// the `arguments` object. Passing an **n** will return the rest N values in the
6830// `array`.
6831function rest(array, n, guard) {
6832 return __WEBPACK_IMPORTED_MODULE_0__setup_js__["q" /* slice */].call(array, n == null || guard ? 1 : n);
6833}
6834
6835
6836/***/ }),
6837/* 206 */
6838/***/ (function(module, __webpack_exports__, __webpack_require__) {
6839
6840"use strict";
6841/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(22);
6842/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__flatten_js__ = __webpack_require__(57);
6843/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__filter_js__ = __webpack_require__(78);
6844/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__contains_js__ = __webpack_require__(79);
6845
6846
6847
6848
6849
6850// Take the difference between one array and a number of other arrays.
6851// Only the elements present in just the first array will remain.
6852/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(array, rest) {
6853 rest = Object(__WEBPACK_IMPORTED_MODULE_1__flatten_js__["a" /* default */])(rest, true, true);
6854 return Object(__WEBPACK_IMPORTED_MODULE_2__filter_js__["a" /* default */])(array, function(value){
6855 return !Object(__WEBPACK_IMPORTED_MODULE_3__contains_js__["a" /* default */])(rest, value);
6856 });
6857}));
6858
6859
6860/***/ }),
6861/* 207 */
6862/***/ (function(module, __webpack_exports__, __webpack_require__) {
6863
6864"use strict";
6865/* harmony export (immutable) */ __webpack_exports__["a"] = uniq;
6866/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isBoolean_js__ = __webpack_require__(163);
6867/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__cb_js__ = __webpack_require__(18);
6868/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__getLength_js__ = __webpack_require__(27);
6869/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__contains_js__ = __webpack_require__(79);
6870
6871
6872
6873
6874
6875// Produce a duplicate-free version of the array. If the array has already
6876// been sorted, you have the option of using a faster algorithm.
6877// The faster algorithm will not work with an iteratee if the iteratee
6878// is not a one-to-one function, so providing an iteratee will disable
6879// the faster algorithm.
6880function uniq(array, isSorted, iteratee, context) {
6881 if (!Object(__WEBPACK_IMPORTED_MODULE_0__isBoolean_js__["a" /* default */])(isSorted)) {
6882 context = iteratee;
6883 iteratee = isSorted;
6884 isSorted = false;
6885 }
6886 if (iteratee != null) iteratee = Object(__WEBPACK_IMPORTED_MODULE_1__cb_js__["a" /* default */])(iteratee, context);
6887 var result = [];
6888 var seen = [];
6889 for (var i = 0, length = Object(__WEBPACK_IMPORTED_MODULE_2__getLength_js__["a" /* default */])(array); i < length; i++) {
6890 var value = array[i],
6891 computed = iteratee ? iteratee(value, i, array) : value;
6892 if (isSorted && !iteratee) {
6893 if (!i || seen !== computed) result.push(value);
6894 seen = computed;
6895 } else if (iteratee) {
6896 if (!Object(__WEBPACK_IMPORTED_MODULE_3__contains_js__["a" /* default */])(seen, computed)) {
6897 seen.push(computed);
6898 result.push(value);
6899 }
6900 } else if (!Object(__WEBPACK_IMPORTED_MODULE_3__contains_js__["a" /* default */])(result, value)) {
6901 result.push(value);
6902 }
6903 }
6904 return result;
6905}
6906
6907
6908/***/ }),
6909/* 208 */
6910/***/ (function(module, __webpack_exports__, __webpack_require__) {
6911
6912"use strict";
6913/* harmony export (immutable) */ __webpack_exports__["a"] = unzip;
6914/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__max_js__ = __webpack_require__(201);
6915/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getLength_js__ = __webpack_require__(27);
6916/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__pluck_js__ = __webpack_require__(134);
6917
6918
6919
6920
6921// Complement of zip. Unzip accepts an array of arrays and groups
6922// each array's elements on shared indices.
6923function unzip(array) {
6924 var length = array && Object(__WEBPACK_IMPORTED_MODULE_0__max_js__["a" /* default */])(array, __WEBPACK_IMPORTED_MODULE_1__getLength_js__["a" /* default */]).length || 0;
6925 var result = Array(length);
6926
6927 for (var index = 0; index < length; index++) {
6928 result[index] = Object(__WEBPACK_IMPORTED_MODULE_2__pluck_js__["a" /* default */])(array, index);
6929 }
6930 return result;
6931}
6932
6933
6934/***/ }),
6935/* 209 */
6936/***/ (function(module, __webpack_exports__, __webpack_require__) {
6937
6938"use strict";
6939/* harmony export (immutable) */ __webpack_exports__["a"] = chainResult;
6940/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(23);
6941
6942
6943// Helper function to continue chaining intermediate results.
6944function chainResult(instance, obj) {
6945 return instance._chain ? Object(__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */])(obj).chain() : obj;
6946}
6947
6948
6949/***/ }),
6950/* 210 */
6951/***/ (function(module, exports, __webpack_require__) {
6952
6953"use strict";
6954
6955var $ = __webpack_require__(0);
6956var fails = __webpack_require__(4);
6957var isArray = __webpack_require__(80);
6958var isObject = __webpack_require__(17);
6959var toObject = __webpack_require__(35);
6960var lengthOfArrayLike = __webpack_require__(42);
6961var doesNotExceedSafeInteger = __webpack_require__(354);
6962var createProperty = __webpack_require__(99);
6963var arraySpeciesCreate = __webpack_require__(211);
6964var arrayMethodHasSpeciesSupport = __webpack_require__(100);
6965var wellKnownSymbol = __webpack_require__(8);
6966var V8_VERSION = __webpack_require__(84);
6967
6968var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
6969
6970// We can't use this feature detection in V8 since it causes
6971// deoptimization and serious performance degradation
6972// https://github.com/zloirock/core-js/issues/679
6973var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function () {
6974 var array = [];
6975 array[IS_CONCAT_SPREADABLE] = false;
6976 return array.concat()[0] !== array;
6977});
6978
6979var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
6980
6981var isConcatSpreadable = function (O) {
6982 if (!isObject(O)) return false;
6983 var spreadable = O[IS_CONCAT_SPREADABLE];
6984 return spreadable !== undefined ? !!spreadable : isArray(O);
6985};
6986
6987var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
6988
6989// `Array.prototype.concat` method
6990// https://tc39.es/ecma262/#sec-array.prototype.concat
6991// with adding support of @@isConcatSpreadable and @@species
6992$({ target: 'Array', proto: true, arity: 1, forced: FORCED }, {
6993 // eslint-disable-next-line no-unused-vars -- required for `.length`
6994 concat: function concat(arg) {
6995 var O = toObject(this);
6996 var A = arraySpeciesCreate(O, 0);
6997 var n = 0;
6998 var i, k, length, len, E;
6999 for (i = -1, length = arguments.length; i < length; i++) {
7000 E = i === -1 ? O : arguments[i];
7001 if (isConcatSpreadable(E)) {
7002 len = lengthOfArrayLike(E);
7003 doesNotExceedSafeInteger(n + len);
7004 for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
7005 } else {
7006 doesNotExceedSafeInteger(n + 1);
7007 createProperty(A, n++, E);
7008 }
7009 }
7010 A.length = n;
7011 return A;
7012 }
7013});
7014
7015
7016/***/ }),
7017/* 211 */
7018/***/ (function(module, exports, __webpack_require__) {
7019
7020var arraySpeciesConstructor = __webpack_require__(355);
7021
7022// `ArraySpeciesCreate` abstract operation
7023// https://tc39.es/ecma262/#sec-arrayspeciescreate
7024module.exports = function (originalArray, length) {
7025 return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
7026};
7027
7028
7029/***/ }),
7030/* 212 */
7031/***/ (function(module, exports, __webpack_require__) {
7032
7033module.exports = __webpack_require__(360);
7034
7035/***/ }),
7036/* 213 */
7037/***/ (function(module, exports, __webpack_require__) {
7038
7039var $ = __webpack_require__(0);
7040var getBuiltIn = __webpack_require__(16);
7041var apply = __webpack_require__(62);
7042var call = __webpack_require__(10);
7043var uncurryThis = __webpack_require__(6);
7044var fails = __webpack_require__(4);
7045var isArray = __webpack_require__(80);
7046var isCallable = __webpack_require__(7);
7047var isObject = __webpack_require__(17);
7048var isSymbol = __webpack_require__(83);
7049var arraySlice = __webpack_require__(94);
7050var NATIVE_SYMBOL = __webpack_require__(49);
7051
7052var $stringify = getBuiltIn('JSON', 'stringify');
7053var exec = uncurryThis(/./.exec);
7054var charAt = uncurryThis(''.charAt);
7055var charCodeAt = uncurryThis(''.charCodeAt);
7056var replace = uncurryThis(''.replace);
7057var numberToString = uncurryThis(1.0.toString);
7058
7059var tester = /[\uD800-\uDFFF]/g;
7060var low = /^[\uD800-\uDBFF]$/;
7061var hi = /^[\uDC00-\uDFFF]$/;
7062
7063var WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL || fails(function () {
7064 var symbol = getBuiltIn('Symbol')();
7065 // MS Edge converts symbol values to JSON as {}
7066 return $stringify([symbol]) != '[null]'
7067 // WebKit converts symbol values to JSON as null
7068 || $stringify({ a: symbol }) != '{}'
7069 // V8 throws on boxed symbols
7070 || $stringify(Object(symbol)) != '{}';
7071});
7072
7073// https://github.com/tc39/proposal-well-formed-stringify
7074var ILL_FORMED_UNICODE = fails(function () {
7075 return $stringify('\uDF06\uD834') !== '"\\udf06\\ud834"'
7076 || $stringify('\uDEAD') !== '"\\udead"';
7077});
7078
7079var stringifyWithSymbolsFix = function (it, replacer) {
7080 var args = arraySlice(arguments);
7081 var $replacer = replacer;
7082 if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
7083 if (!isArray(replacer)) replacer = function (key, value) {
7084 if (isCallable($replacer)) value = call($replacer, this, key, value);
7085 if (!isSymbol(value)) return value;
7086 };
7087 args[1] = replacer;
7088 return apply($stringify, null, args);
7089};
7090
7091var fixIllFormed = function (match, offset, string) {
7092 var prev = charAt(string, offset - 1);
7093 var next = charAt(string, offset + 1);
7094 if ((exec(low, match) && !exec(hi, next)) || (exec(hi, match) && !exec(low, prev))) {
7095 return '\\u' + numberToString(charCodeAt(match, 0), 16);
7096 } return match;
7097};
7098
7099if ($stringify) {
7100 // `JSON.stringify` method
7101 // https://tc39.es/ecma262/#sec-json.stringify
7102 $({ target: 'JSON', stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE }, {
7103 // eslint-disable-next-line no-unused-vars -- required for `.length`
7104 stringify: function stringify(it, replacer, space) {
7105 var args = arraySlice(arguments);
7106 var result = apply(WRONG_SYMBOLS_CONVERSION ? stringifyWithSymbolsFix : $stringify, null, args);
7107 return ILL_FORMED_UNICODE && typeof result == 'string' ? replace(result, tester, fixIllFormed) : result;
7108 }
7109 });
7110}
7111
7112
7113/***/ }),
7114/* 214 */
7115/***/ (function(module, exports, __webpack_require__) {
7116
7117var rng = __webpack_require__(373);
7118var bytesToUuid = __webpack_require__(374);
7119
7120function v4(options, buf, offset) {
7121 var i = buf && offset || 0;
7122
7123 if (typeof(options) == 'string') {
7124 buf = options === 'binary' ? new Array(16) : null;
7125 options = null;
7126 }
7127 options = options || {};
7128
7129 var rnds = options.random || (options.rng || rng)();
7130
7131 // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
7132 rnds[6] = (rnds[6] & 0x0f) | 0x40;
7133 rnds[8] = (rnds[8] & 0x3f) | 0x80;
7134
7135 // Copy bytes to buffer, if provided
7136 if (buf) {
7137 for (var ii = 0; ii < 16; ++ii) {
7138 buf[i + ii] = rnds[ii];
7139 }
7140 }
7141
7142 return buf || bytesToUuid(rnds);
7143}
7144
7145module.exports = v4;
7146
7147
7148/***/ }),
7149/* 215 */
7150/***/ (function(module, exports, __webpack_require__) {
7151
7152module.exports = __webpack_require__(216);
7153
7154/***/ }),
7155/* 216 */
7156/***/ (function(module, exports, __webpack_require__) {
7157
7158var parent = __webpack_require__(377);
7159
7160module.exports = parent;
7161
7162
7163/***/ }),
7164/* 217 */
7165/***/ (function(module, exports, __webpack_require__) {
7166
7167"use strict";
7168
7169
7170module.exports = '4.13.1';
7171
7172/***/ }),
7173/* 218 */
7174/***/ (function(module, exports, __webpack_require__) {
7175
7176"use strict";
7177
7178
7179var has = Object.prototype.hasOwnProperty
7180 , prefix = '~';
7181
7182/**
7183 * Constructor to create a storage for our `EE` objects.
7184 * An `Events` instance is a plain object whose properties are event names.
7185 *
7186 * @constructor
7187 * @api private
7188 */
7189function Events() {}
7190
7191//
7192// We try to not inherit from `Object.prototype`. In some engines creating an
7193// instance in this way is faster than calling `Object.create(null)` directly.
7194// If `Object.create(null)` is not supported we prefix the event names with a
7195// character to make sure that the built-in object properties are not
7196// overridden or used as an attack vector.
7197//
7198if (Object.create) {
7199 Events.prototype = Object.create(null);
7200
7201 //
7202 // This hack is needed because the `__proto__` property is still inherited in
7203 // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.
7204 //
7205 if (!new Events().__proto__) prefix = false;
7206}
7207
7208/**
7209 * Representation of a single event listener.
7210 *
7211 * @param {Function} fn The listener function.
7212 * @param {Mixed} context The context to invoke the listener with.
7213 * @param {Boolean} [once=false] Specify if the listener is a one-time listener.
7214 * @constructor
7215 * @api private
7216 */
7217function EE(fn, context, once) {
7218 this.fn = fn;
7219 this.context = context;
7220 this.once = once || false;
7221}
7222
7223/**
7224 * Minimal `EventEmitter` interface that is molded against the Node.js
7225 * `EventEmitter` interface.
7226 *
7227 * @constructor
7228 * @api public
7229 */
7230function EventEmitter() {
7231 this._events = new Events();
7232 this._eventsCount = 0;
7233}
7234
7235/**
7236 * Return an array listing the events for which the emitter has registered
7237 * listeners.
7238 *
7239 * @returns {Array}
7240 * @api public
7241 */
7242EventEmitter.prototype.eventNames = function eventNames() {
7243 var names = []
7244 , events
7245 , name;
7246
7247 if (this._eventsCount === 0) return names;
7248
7249 for (name in (events = this._events)) {
7250 if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);
7251 }
7252
7253 if (Object.getOwnPropertySymbols) {
7254 return names.concat(Object.getOwnPropertySymbols(events));
7255 }
7256
7257 return names;
7258};
7259
7260/**
7261 * Return the listeners registered for a given event.
7262 *
7263 * @param {String|Symbol} event The event name.
7264 * @param {Boolean} exists Only check if there are listeners.
7265 * @returns {Array|Boolean}
7266 * @api public
7267 */
7268EventEmitter.prototype.listeners = function listeners(event, exists) {
7269 var evt = prefix ? prefix + event : event
7270 , available = this._events[evt];
7271
7272 if (exists) return !!available;
7273 if (!available) return [];
7274 if (available.fn) return [available.fn];
7275
7276 for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) {
7277 ee[i] = available[i].fn;
7278 }
7279
7280 return ee;
7281};
7282
7283/**
7284 * Calls each of the listeners registered for a given event.
7285 *
7286 * @param {String|Symbol} event The event name.
7287 * @returns {Boolean} `true` if the event had listeners, else `false`.
7288 * @api public
7289 */
7290EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
7291 var evt = prefix ? prefix + event : event;
7292
7293 if (!this._events[evt]) return false;
7294
7295 var listeners = this._events[evt]
7296 , len = arguments.length
7297 , args
7298 , i;
7299
7300 if (listeners.fn) {
7301 if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);
7302
7303 switch (len) {
7304 case 1: return listeners.fn.call(listeners.context), true;
7305 case 2: return listeners.fn.call(listeners.context, a1), true;
7306 case 3: return listeners.fn.call(listeners.context, a1, a2), true;
7307 case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;
7308 case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
7309 case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
7310 }
7311
7312 for (i = 1, args = new Array(len -1); i < len; i++) {
7313 args[i - 1] = arguments[i];
7314 }
7315
7316 listeners.fn.apply(listeners.context, args);
7317 } else {
7318 var length = listeners.length
7319 , j;
7320
7321 for (i = 0; i < length; i++) {
7322 if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);
7323
7324 switch (len) {
7325 case 1: listeners[i].fn.call(listeners[i].context); break;
7326 case 2: listeners[i].fn.call(listeners[i].context, a1); break;
7327 case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;
7328 case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;
7329 default:
7330 if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {
7331 args[j - 1] = arguments[j];
7332 }
7333
7334 listeners[i].fn.apply(listeners[i].context, args);
7335 }
7336 }
7337 }
7338
7339 return true;
7340};
7341
7342/**
7343 * Add a listener for a given event.
7344 *
7345 * @param {String|Symbol} event The event name.
7346 * @param {Function} fn The listener function.
7347 * @param {Mixed} [context=this] The context to invoke the listener with.
7348 * @returns {EventEmitter} `this`.
7349 * @api public
7350 */
7351EventEmitter.prototype.on = function on(event, fn, context) {
7352 var listener = new EE(fn, context || this)
7353 , evt = prefix ? prefix + event : event;
7354
7355 if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;
7356 else if (!this._events[evt].fn) this._events[evt].push(listener);
7357 else this._events[evt] = [this._events[evt], listener];
7358
7359 return this;
7360};
7361
7362/**
7363 * Add a one-time listener for a given event.
7364 *
7365 * @param {String|Symbol} event The event name.
7366 * @param {Function} fn The listener function.
7367 * @param {Mixed} [context=this] The context to invoke the listener with.
7368 * @returns {EventEmitter} `this`.
7369 * @api public
7370 */
7371EventEmitter.prototype.once = function once(event, fn, context) {
7372 var listener = new EE(fn, context || this, true)
7373 , evt = prefix ? prefix + event : event;
7374
7375 if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;
7376 else if (!this._events[evt].fn) this._events[evt].push(listener);
7377 else this._events[evt] = [this._events[evt], listener];
7378
7379 return this;
7380};
7381
7382/**
7383 * Remove the listeners of a given event.
7384 *
7385 * @param {String|Symbol} event The event name.
7386 * @param {Function} fn Only remove the listeners that match this function.
7387 * @param {Mixed} context Only remove the listeners that have this context.
7388 * @param {Boolean} once Only remove one-time listeners.
7389 * @returns {EventEmitter} `this`.
7390 * @api public
7391 */
7392EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {
7393 var evt = prefix ? prefix + event : event;
7394
7395 if (!this._events[evt]) return this;
7396 if (!fn) {
7397 if (--this._eventsCount === 0) this._events = new Events();
7398 else delete this._events[evt];
7399 return this;
7400 }
7401
7402 var listeners = this._events[evt];
7403
7404 if (listeners.fn) {
7405 if (
7406 listeners.fn === fn
7407 && (!once || listeners.once)
7408 && (!context || listeners.context === context)
7409 ) {
7410 if (--this._eventsCount === 0) this._events = new Events();
7411 else delete this._events[evt];
7412 }
7413 } else {
7414 for (var i = 0, events = [], length = listeners.length; i < length; i++) {
7415 if (
7416 listeners[i].fn !== fn
7417 || (once && !listeners[i].once)
7418 || (context && listeners[i].context !== context)
7419 ) {
7420 events.push(listeners[i]);
7421 }
7422 }
7423
7424 //
7425 // Reset the array, or remove it completely if we have no more listeners.
7426 //
7427 if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;
7428 else if (--this._eventsCount === 0) this._events = new Events();
7429 else delete this._events[evt];
7430 }
7431
7432 return this;
7433};
7434
7435/**
7436 * Remove all listeners, or those of the specified event.
7437 *
7438 * @param {String|Symbol} [event] The event name.
7439 * @returns {EventEmitter} `this`.
7440 * @api public
7441 */
7442EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {
7443 var evt;
7444
7445 if (event) {
7446 evt = prefix ? prefix + event : event;
7447 if (this._events[evt]) {
7448 if (--this._eventsCount === 0) this._events = new Events();
7449 else delete this._events[evt];
7450 }
7451 } else {
7452 this._events = new Events();
7453 this._eventsCount = 0;
7454 }
7455
7456 return this;
7457};
7458
7459//
7460// Alias methods names because people roll like that.
7461//
7462EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
7463EventEmitter.prototype.addListener = EventEmitter.prototype.on;
7464
7465//
7466// This function doesn't apply anymore.
7467//
7468EventEmitter.prototype.setMaxListeners = function setMaxListeners() {
7469 return this;
7470};
7471
7472//
7473// Expose the prefix.
7474//
7475EventEmitter.prefixed = prefix;
7476
7477//
7478// Allow `EventEmitter` to be imported as module namespace.
7479//
7480EventEmitter.EventEmitter = EventEmitter;
7481
7482//
7483// Expose the module.
7484//
7485if (true) {
7486 module.exports = EventEmitter;
7487}
7488
7489
7490/***/ }),
7491/* 219 */
7492/***/ (function(module, exports, __webpack_require__) {
7493
7494"use strict";
7495
7496
7497var _interopRequireDefault = __webpack_require__(2);
7498
7499var _promise = _interopRequireDefault(__webpack_require__(12));
7500
7501var _require = __webpack_require__(61),
7502 getAdapter = _require.getAdapter;
7503
7504var syncApiNames = ['getItem', 'setItem', 'removeItem', 'clear'];
7505var localStorage = {
7506 get async() {
7507 return getAdapter('storage').async;
7508 }
7509
7510}; // wrap sync apis with async ones.
7511
7512syncApiNames.forEach(function (apiName) {
7513 localStorage[apiName + 'Async'] = function () {
7514 var storage = getAdapter('storage');
7515 return _promise.default.resolve(storage[apiName].apply(storage, arguments));
7516 };
7517
7518 localStorage[apiName] = function () {
7519 var storage = getAdapter('storage');
7520
7521 if (!storage.async) {
7522 return storage[apiName].apply(storage, arguments);
7523 }
7524
7525 var error = new Error('Synchronous API [' + apiName + '] is not available in this runtime.');
7526 error.code = 'SYNC_API_NOT_AVAILABLE';
7527 throw error;
7528 };
7529});
7530module.exports = localStorage;
7531
7532/***/ }),
7533/* 220 */
7534/***/ (function(module, exports, __webpack_require__) {
7535
7536"use strict";
7537
7538
7539var _interopRequireDefault = __webpack_require__(2);
7540
7541var _concat = _interopRequireDefault(__webpack_require__(29));
7542
7543var _stringify = _interopRequireDefault(__webpack_require__(34));
7544
7545var storage = __webpack_require__(219);
7546
7547var AV = __webpack_require__(59);
7548
7549var removeAsync = exports.removeAsync = storage.removeItemAsync.bind(storage);
7550
7551var getCacheData = function getCacheData(cacheData, key) {
7552 try {
7553 cacheData = JSON.parse(cacheData);
7554 } catch (e) {
7555 return null;
7556 }
7557
7558 if (cacheData) {
7559 var expired = cacheData.expiredAt && cacheData.expiredAt < Date.now();
7560
7561 if (!expired) {
7562 return cacheData.value;
7563 }
7564
7565 return removeAsync(key).then(function () {
7566 return null;
7567 });
7568 }
7569
7570 return null;
7571};
7572
7573exports.getAsync = function (key) {
7574 var _context;
7575
7576 key = (0, _concat.default)(_context = "AV/".concat(AV.applicationId, "/")).call(_context, key);
7577 return storage.getItemAsync(key).then(function (cache) {
7578 return getCacheData(cache, key);
7579 });
7580};
7581
7582exports.setAsync = function (key, value, ttl) {
7583 var _context2;
7584
7585 var cache = {
7586 value: value
7587 };
7588
7589 if (typeof ttl === 'number') {
7590 cache.expiredAt = Date.now() + ttl;
7591 }
7592
7593 return storage.setItemAsync((0, _concat.default)(_context2 = "AV/".concat(AV.applicationId, "/")).call(_context2, key), (0, _stringify.default)(cache));
7594};
7595
7596/***/ }),
7597/* 221 */
7598/***/ (function(module, exports, __webpack_require__) {
7599
7600var parent = __webpack_require__(380);
7601
7602module.exports = parent;
7603
7604
7605/***/ }),
7606/* 222 */
7607/***/ (function(module, exports, __webpack_require__) {
7608
7609var parent = __webpack_require__(383);
7610
7611module.exports = parent;
7612
7613
7614/***/ }),
7615/* 223 */
7616/***/ (function(module, exports, __webpack_require__) {
7617
7618module.exports = __webpack_require__(224);
7619
7620/***/ }),
7621/* 224 */
7622/***/ (function(module, exports, __webpack_require__) {
7623
7624var parent = __webpack_require__(386);
7625
7626module.exports = parent;
7627
7628
7629/***/ }),
7630/* 225 */
7631/***/ (function(module, exports, __webpack_require__) {
7632
7633module.exports = __webpack_require__(389);
7634
7635/***/ }),
7636/* 226 */
7637/***/ (function(module, exports, __webpack_require__) {
7638
7639var parent = __webpack_require__(392);
7640__webpack_require__(73);
7641
7642module.exports = parent;
7643
7644
7645/***/ }),
7646/* 227 */
7647/***/ (function(module, exports, __webpack_require__) {
7648
7649var call = __webpack_require__(10);
7650var getBuiltIn = __webpack_require__(16);
7651var wellKnownSymbol = __webpack_require__(8);
7652var defineBuiltIn = __webpack_require__(43);
7653
7654module.exports = function () {
7655 var Symbol = getBuiltIn('Symbol');
7656 var SymbolPrototype = Symbol && Symbol.prototype;
7657 var valueOf = SymbolPrototype && SymbolPrototype.valueOf;
7658 var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
7659
7660 if (SymbolPrototype && !SymbolPrototype[TO_PRIMITIVE]) {
7661 // `Symbol.prototype[@@toPrimitive]` method
7662 // https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive
7663 // eslint-disable-next-line no-unused-vars -- required for .length
7664 defineBuiltIn(SymbolPrototype, TO_PRIMITIVE, function (hint) {
7665 return call(valueOf, this);
7666 }, { arity: 1 });
7667 }
7668};
7669
7670
7671/***/ }),
7672/* 228 */
7673/***/ (function(module, exports, __webpack_require__) {
7674
7675var NATIVE_SYMBOL = __webpack_require__(49);
7676
7677/* eslint-disable es-x/no-symbol -- safe */
7678module.exports = NATIVE_SYMBOL && !!Symbol['for'] && !!Symbol.keyFor;
7679
7680
7681/***/ }),
7682/* 229 */
7683/***/ (function(module, exports, __webpack_require__) {
7684
7685var defineWellKnownSymbol = __webpack_require__(5);
7686
7687// `Symbol.iterator` well-known symbol
7688// https://tc39.es/ecma262/#sec-symbol.iterator
7689defineWellKnownSymbol('iterator');
7690
7691
7692/***/ }),
7693/* 230 */
7694/***/ (function(module, exports, __webpack_require__) {
7695
7696var parent = __webpack_require__(449);
7697
7698module.exports = parent;
7699
7700
7701/***/ }),
7702/* 231 */
7703/***/ (function(module, exports, __webpack_require__) {
7704
7705module.exports = __webpack_require__(454);
7706
7707/***/ }),
7708/* 232 */
7709/***/ (function(module, exports, __webpack_require__) {
7710
7711"use strict";
7712
7713var uncurryThis = __webpack_require__(6);
7714var aCallable = __webpack_require__(30);
7715var isObject = __webpack_require__(17);
7716var hasOwn = __webpack_require__(14);
7717var arraySlice = __webpack_require__(94);
7718var NATIVE_BIND = __webpack_require__(63);
7719
7720var $Function = Function;
7721var concat = uncurryThis([].concat);
7722var join = uncurryThis([].join);
7723var factories = {};
7724
7725var construct = function (C, argsLength, args) {
7726 if (!hasOwn(factories, argsLength)) {
7727 for (var list = [], i = 0; i < argsLength; i++) list[i] = 'a[' + i + ']';
7728 factories[argsLength] = $Function('C,a', 'return new C(' + join(list, ',') + ')');
7729 } return factories[argsLength](C, args);
7730};
7731
7732// `Function.prototype.bind` method implementation
7733// https://tc39.es/ecma262/#sec-function.prototype.bind
7734module.exports = NATIVE_BIND ? $Function.bind : function bind(that /* , ...args */) {
7735 var F = aCallable(this);
7736 var Prototype = F.prototype;
7737 var partArgs = arraySlice(arguments, 1);
7738 var boundFunction = function bound(/* args... */) {
7739 var args = concat(partArgs, arraySlice(arguments));
7740 return this instanceof boundFunction ? construct(F, args.length, args) : F.apply(that, args);
7741 };
7742 if (isObject(Prototype)) boundFunction.prototype = Prototype;
7743 return boundFunction;
7744};
7745
7746
7747/***/ }),
7748/* 233 */
7749/***/ (function(module, exports, __webpack_require__) {
7750
7751module.exports = __webpack_require__(475);
7752
7753/***/ }),
7754/* 234 */
7755/***/ (function(module, exports, __webpack_require__) {
7756
7757module.exports = __webpack_require__(478);
7758
7759/***/ }),
7760/* 235 */
7761/***/ (function(module, exports) {
7762
7763var charenc = {
7764 // UTF-8 encoding
7765 utf8: {
7766 // Convert a string to a byte array
7767 stringToBytes: function(str) {
7768 return charenc.bin.stringToBytes(unescape(encodeURIComponent(str)));
7769 },
7770
7771 // Convert a byte array to a string
7772 bytesToString: function(bytes) {
7773 return decodeURIComponent(escape(charenc.bin.bytesToString(bytes)));
7774 }
7775 },
7776
7777 // Binary encoding
7778 bin: {
7779 // Convert a string to a byte array
7780 stringToBytes: function(str) {
7781 for (var bytes = [], i = 0; i < str.length; i++)
7782 bytes.push(str.charCodeAt(i) & 0xFF);
7783 return bytes;
7784 },
7785
7786 // Convert a byte array to a string
7787 bytesToString: function(bytes) {
7788 for (var str = [], i = 0; i < bytes.length; i++)
7789 str.push(String.fromCharCode(bytes[i]));
7790 return str.join('');
7791 }
7792 }
7793};
7794
7795module.exports = charenc;
7796
7797
7798/***/ }),
7799/* 236 */
7800/***/ (function(module, exports, __webpack_require__) {
7801
7802"use strict";
7803
7804
7805module.exports = __webpack_require__(237);
7806
7807/***/ }),
7808/* 237 */
7809/***/ (function(module, exports, __webpack_require__) {
7810
7811"use strict";
7812
7813
7814var _interopRequireDefault = __webpack_require__(2);
7815
7816var _promise = _interopRequireDefault(__webpack_require__(12));
7817
7818/*!
7819 * LeanCloud JavaScript SDK
7820 * https://leancloud.cn
7821 *
7822 * Copyright 2016 LeanCloud.cn, Inc.
7823 * The LeanCloud JavaScript SDK is freely distributable under the MIT license.
7824 */
7825var _ = __webpack_require__(1);
7826
7827var AV = __webpack_require__(59);
7828
7829AV._ = _;
7830AV.version = __webpack_require__(217);
7831AV.Promise = _promise.default;
7832AV.localStorage = __webpack_require__(219);
7833AV.Cache = __webpack_require__(220);
7834AV.Error = __webpack_require__(40);
7835
7836__webpack_require__(382);
7837
7838__webpack_require__(436)(AV);
7839
7840__webpack_require__(437)(AV);
7841
7842__webpack_require__(438)(AV);
7843
7844__webpack_require__(439)(AV);
7845
7846__webpack_require__(444)(AV);
7847
7848__webpack_require__(445)(AV);
7849
7850__webpack_require__(500)(AV);
7851
7852__webpack_require__(526)(AV);
7853
7854__webpack_require__(527)(AV);
7855
7856__webpack_require__(529)(AV);
7857
7858__webpack_require__(530)(AV);
7859
7860__webpack_require__(531)(AV);
7861
7862__webpack_require__(532)(AV);
7863
7864__webpack_require__(533)(AV);
7865
7866__webpack_require__(534)(AV);
7867
7868__webpack_require__(535)(AV);
7869
7870__webpack_require__(536)(AV);
7871
7872__webpack_require__(537)(AV);
7873
7874AV.Conversation = __webpack_require__(538);
7875
7876__webpack_require__(539);
7877
7878module.exports = AV;
7879/**
7880 * Options to controll the authentication for an operation
7881 * @typedef {Object} AuthOptions
7882 * @property {String} [sessionToken] Specify a user to excute the operation as.
7883 * @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.
7884 * @property {Boolean} [useMasterKey] Indicates whether masterKey is used for this operation. Only valid when masterKey is set.
7885 */
7886
7887/**
7888 * Options to controll the authentication for an SMS operation
7889 * @typedef {Object} SMSAuthOptions
7890 * @property {String} [sessionToken] Specify a user to excute the operation as.
7891 * @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.
7892 * @property {Boolean} [useMasterKey] Indicates whether masterKey is used for this operation. Only valid when masterKey is set.
7893 * @property {String} [validateToken] a validate token returned by {@link AV.Cloud.verifyCaptcha}
7894 */
7895
7896/***/ }),
7897/* 238 */
7898/***/ (function(module, exports, __webpack_require__) {
7899
7900var parent = __webpack_require__(239);
7901__webpack_require__(73);
7902
7903module.exports = parent;
7904
7905
7906/***/ }),
7907/* 239 */
7908/***/ (function(module, exports, __webpack_require__) {
7909
7910__webpack_require__(240);
7911__webpack_require__(70);
7912__webpack_require__(92);
7913__webpack_require__(258);
7914__webpack_require__(274);
7915__webpack_require__(275);
7916__webpack_require__(276);
7917__webpack_require__(95);
7918var path = __webpack_require__(13);
7919
7920module.exports = path.Promise;
7921
7922
7923/***/ }),
7924/* 240 */
7925/***/ (function(module, exports, __webpack_require__) {
7926
7927// TODO: Remove this module from `core-js@4` since it's replaced to module below
7928__webpack_require__(241);
7929
7930
7931/***/ }),
7932/* 241 */
7933/***/ (function(module, exports, __webpack_require__) {
7934
7935"use strict";
7936
7937var $ = __webpack_require__(0);
7938var isPrototypeOf = __webpack_require__(20);
7939var getPrototypeOf = __webpack_require__(86);
7940var setPrototypeOf = __webpack_require__(88);
7941var copyConstructorProperties = __webpack_require__(246);
7942var create = __webpack_require__(51);
7943var createNonEnumerableProperty = __webpack_require__(36);
7944var createPropertyDescriptor = __webpack_require__(41);
7945var clearErrorStack = __webpack_require__(250);
7946var installErrorCause = __webpack_require__(251);
7947var iterate = __webpack_require__(68);
7948var normalizeStringArgument = __webpack_require__(252);
7949var wellKnownSymbol = __webpack_require__(8);
7950var ERROR_STACK_INSTALLABLE = __webpack_require__(253);
7951
7952var TO_STRING_TAG = wellKnownSymbol('toStringTag');
7953var $Error = Error;
7954var push = [].push;
7955
7956var $AggregateError = function AggregateError(errors, message /* , options */) {
7957 var options = arguments.length > 2 ? arguments[2] : undefined;
7958 var isInstance = isPrototypeOf(AggregateErrorPrototype, this);
7959 var that;
7960 if (setPrototypeOf) {
7961 that = setPrototypeOf(new $Error(), isInstance ? getPrototypeOf(this) : AggregateErrorPrototype);
7962 } else {
7963 that = isInstance ? this : create(AggregateErrorPrototype);
7964 createNonEnumerableProperty(that, TO_STRING_TAG, 'Error');
7965 }
7966 if (message !== undefined) createNonEnumerableProperty(that, 'message', normalizeStringArgument(message));
7967 if (ERROR_STACK_INSTALLABLE) createNonEnumerableProperty(that, 'stack', clearErrorStack(that.stack, 1));
7968 installErrorCause(that, options);
7969 var errorsArray = [];
7970 iterate(errors, push, { that: errorsArray });
7971 createNonEnumerableProperty(that, 'errors', errorsArray);
7972 return that;
7973};
7974
7975if (setPrototypeOf) setPrototypeOf($AggregateError, $Error);
7976else copyConstructorProperties($AggregateError, $Error, { name: true });
7977
7978var AggregateErrorPrototype = $AggregateError.prototype = create($Error.prototype, {
7979 constructor: createPropertyDescriptor(1, $AggregateError),
7980 message: createPropertyDescriptor(1, ''),
7981 name: createPropertyDescriptor(1, 'AggregateError')
7982});
7983
7984// `AggregateError` constructor
7985// https://tc39.es/ecma262/#sec-aggregate-error-constructor
7986$({ global: true, constructor: true, arity: 2 }, {
7987 AggregateError: $AggregateError
7988});
7989
7990
7991/***/ }),
7992/* 242 */
7993/***/ (function(module, exports, __webpack_require__) {
7994
7995var call = __webpack_require__(10);
7996var isObject = __webpack_require__(17);
7997var isSymbol = __webpack_require__(83);
7998var getMethod = __webpack_require__(107);
7999var ordinaryToPrimitive = __webpack_require__(243);
8000var wellKnownSymbol = __webpack_require__(8);
8001
8002var $TypeError = TypeError;
8003var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
8004
8005// `ToPrimitive` abstract operation
8006// https://tc39.es/ecma262/#sec-toprimitive
8007module.exports = function (input, pref) {
8008 if (!isObject(input) || isSymbol(input)) return input;
8009 var exoticToPrim = getMethod(input, TO_PRIMITIVE);
8010 var result;
8011 if (exoticToPrim) {
8012 if (pref === undefined) pref = 'default';
8013 result = call(exoticToPrim, input, pref);
8014 if (!isObject(result) || isSymbol(result)) return result;
8015 throw $TypeError("Can't convert object to primitive value");
8016 }
8017 if (pref === undefined) pref = 'number';
8018 return ordinaryToPrimitive(input, pref);
8019};
8020
8021
8022/***/ }),
8023/* 243 */
8024/***/ (function(module, exports, __webpack_require__) {
8025
8026var call = __webpack_require__(10);
8027var isCallable = __webpack_require__(7);
8028var isObject = __webpack_require__(17);
8029
8030var $TypeError = TypeError;
8031
8032// `OrdinaryToPrimitive` abstract operation
8033// https://tc39.es/ecma262/#sec-ordinarytoprimitive
8034module.exports = function (input, pref) {
8035 var fn, val;
8036 if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;
8037 if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val;
8038 if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;
8039 throw $TypeError("Can't convert object to primitive value");
8040};
8041
8042
8043/***/ }),
8044/* 244 */
8045/***/ (function(module, exports, __webpack_require__) {
8046
8047var global = __webpack_require__(9);
8048
8049// eslint-disable-next-line es-x/no-object-defineproperty -- safe
8050var defineProperty = Object.defineProperty;
8051
8052module.exports = function (key, value) {
8053 try {
8054 defineProperty(global, key, { value: value, configurable: true, writable: true });
8055 } catch (error) {
8056 global[key] = value;
8057 } return value;
8058};
8059
8060
8061/***/ }),
8062/* 245 */
8063/***/ (function(module, exports, __webpack_require__) {
8064
8065var isCallable = __webpack_require__(7);
8066
8067var $String = String;
8068var $TypeError = TypeError;
8069
8070module.exports = function (argument) {
8071 if (typeof argument == 'object' || isCallable(argument)) return argument;
8072 throw $TypeError("Can't set " + $String(argument) + ' as a prototype');
8073};
8074
8075
8076/***/ }),
8077/* 246 */
8078/***/ (function(module, exports, __webpack_require__) {
8079
8080var hasOwn = __webpack_require__(14);
8081var ownKeys = __webpack_require__(247);
8082var getOwnPropertyDescriptorModule = __webpack_require__(64);
8083var definePropertyModule = __webpack_require__(32);
8084
8085module.exports = function (target, source, exceptions) {
8086 var keys = ownKeys(source);
8087 var defineProperty = definePropertyModule.f;
8088 var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
8089 for (var i = 0; i < keys.length; i++) {
8090 var key = keys[i];
8091 if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {
8092 defineProperty(target, key, getOwnPropertyDescriptor(source, key));
8093 }
8094 }
8095};
8096
8097
8098/***/ }),
8099/* 247 */
8100/***/ (function(module, exports, __webpack_require__) {
8101
8102var getBuiltIn = __webpack_require__(16);
8103var uncurryThis = __webpack_require__(6);
8104var getOwnPropertyNamesModule = __webpack_require__(111);
8105var getOwnPropertySymbolsModule = __webpack_require__(115);
8106var anObject = __webpack_require__(21);
8107
8108var concat = uncurryThis([].concat);
8109
8110// all object keys, includes non-enumerable and symbols
8111module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
8112 var keys = getOwnPropertyNamesModule.f(anObject(it));
8113 var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
8114 return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
8115};
8116
8117
8118/***/ }),
8119/* 248 */
8120/***/ (function(module, exports) {
8121
8122var ceil = Math.ceil;
8123var floor = Math.floor;
8124
8125// `Math.trunc` method
8126// https://tc39.es/ecma262/#sec-math.trunc
8127// eslint-disable-next-line es-x/no-math-trunc -- safe
8128module.exports = Math.trunc || function trunc(x) {
8129 var n = +x;
8130 return (n > 0 ? floor : ceil)(n);
8131};
8132
8133
8134/***/ }),
8135/* 249 */
8136/***/ (function(module, exports, __webpack_require__) {
8137
8138var toIntegerOrInfinity = __webpack_require__(113);
8139
8140var min = Math.min;
8141
8142// `ToLength` abstract operation
8143// https://tc39.es/ecma262/#sec-tolength
8144module.exports = function (argument) {
8145 return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
8146};
8147
8148
8149/***/ }),
8150/* 250 */
8151/***/ (function(module, exports, __webpack_require__) {
8152
8153var uncurryThis = __webpack_require__(6);
8154
8155var $Error = Error;
8156var replace = uncurryThis(''.replace);
8157
8158var TEST = (function (arg) { return String($Error(arg).stack); })('zxcasd');
8159var V8_OR_CHAKRA_STACK_ENTRY = /\n\s*at [^:]*:[^\n]*/;
8160var IS_V8_OR_CHAKRA_STACK = V8_OR_CHAKRA_STACK_ENTRY.test(TEST);
8161
8162module.exports = function (stack, dropEntries) {
8163 if (IS_V8_OR_CHAKRA_STACK && typeof stack == 'string' && !$Error.prepareStackTrace) {
8164 while (dropEntries--) stack = replace(stack, V8_OR_CHAKRA_STACK_ENTRY, '');
8165 } return stack;
8166};
8167
8168
8169/***/ }),
8170/* 251 */
8171/***/ (function(module, exports, __webpack_require__) {
8172
8173var isObject = __webpack_require__(17);
8174var createNonEnumerableProperty = __webpack_require__(36);
8175
8176// `InstallErrorCause` abstract operation
8177// https://tc39.es/proposal-error-cause/#sec-errorobjects-install-error-cause
8178module.exports = function (O, options) {
8179 if (isObject(options) && 'cause' in options) {
8180 createNonEnumerableProperty(O, 'cause', options.cause);
8181 }
8182};
8183
8184
8185/***/ }),
8186/* 252 */
8187/***/ (function(module, exports, __webpack_require__) {
8188
8189var toString = __webpack_require__(69);
8190
8191module.exports = function (argument, $default) {
8192 return argument === undefined ? arguments.length < 2 ? '' : $default : toString(argument);
8193};
8194
8195
8196/***/ }),
8197/* 253 */
8198/***/ (function(module, exports, __webpack_require__) {
8199
8200var fails = __webpack_require__(4);
8201var createPropertyDescriptor = __webpack_require__(41);
8202
8203module.exports = !fails(function () {
8204 var error = Error('a');
8205 if (!('stack' in error)) return true;
8206 // eslint-disable-next-line es-x/no-object-defineproperty -- safe
8207 Object.defineProperty(error, 'stack', createPropertyDescriptor(1, 7));
8208 return error.stack !== 7;
8209});
8210
8211
8212/***/ }),
8213/* 254 */
8214/***/ (function(module, exports, __webpack_require__) {
8215
8216var global = __webpack_require__(9);
8217var isCallable = __webpack_require__(7);
8218var inspectSource = __webpack_require__(118);
8219
8220var WeakMap = global.WeakMap;
8221
8222module.exports = isCallable(WeakMap) && /native code/.test(inspectSource(WeakMap));
8223
8224
8225/***/ }),
8226/* 255 */
8227/***/ (function(module, exports, __webpack_require__) {
8228
8229var DESCRIPTORS = __webpack_require__(19);
8230var hasOwn = __webpack_require__(14);
8231
8232var FunctionPrototype = Function.prototype;
8233// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
8234var getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor;
8235
8236var EXISTS = hasOwn(FunctionPrototype, 'name');
8237// additional protection from minified / mangled / dropped function names
8238var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
8239var CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable));
8240
8241module.exports = {
8242 EXISTS: EXISTS,
8243 PROPER: PROPER,
8244 CONFIGURABLE: CONFIGURABLE
8245};
8246
8247
8248/***/ }),
8249/* 256 */
8250/***/ (function(module, exports, __webpack_require__) {
8251
8252"use strict";
8253
8254var IteratorPrototype = __webpack_require__(154).IteratorPrototype;
8255var create = __webpack_require__(51);
8256var createPropertyDescriptor = __webpack_require__(41);
8257var setToStringTag = __webpack_require__(54);
8258var Iterators = __webpack_require__(52);
8259
8260var returnThis = function () { return this; };
8261
8262module.exports = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
8263 var TO_STRING_TAG = NAME + ' Iterator';
8264 IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
8265 setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);
8266 Iterators[TO_STRING_TAG] = returnThis;
8267 return IteratorConstructor;
8268};
8269
8270
8271/***/ }),
8272/* 257 */
8273/***/ (function(module, exports, __webpack_require__) {
8274
8275"use strict";
8276
8277var TO_STRING_TAG_SUPPORT = __webpack_require__(117);
8278var classof = __webpack_require__(53);
8279
8280// `Object.prototype.toString` method implementation
8281// https://tc39.es/ecma262/#sec-object.prototype.tostring
8282module.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() {
8283 return '[object ' + classof(this) + ']';
8284};
8285
8286
8287/***/ }),
8288/* 258 */
8289/***/ (function(module, exports, __webpack_require__) {
8290
8291// TODO: Remove this module from `core-js@4` since it's split to modules listed below
8292__webpack_require__(259);
8293__webpack_require__(269);
8294__webpack_require__(270);
8295__webpack_require__(271);
8296__webpack_require__(272);
8297__webpack_require__(273);
8298
8299
8300/***/ }),
8301/* 259 */
8302/***/ (function(module, exports, __webpack_require__) {
8303
8304"use strict";
8305
8306var $ = __webpack_require__(0);
8307var IS_PURE = __webpack_require__(31);
8308var IS_NODE = __webpack_require__(119);
8309var global = __webpack_require__(9);
8310var call = __webpack_require__(10);
8311var defineBuiltIn = __webpack_require__(43);
8312var setPrototypeOf = __webpack_require__(88);
8313var setToStringTag = __webpack_require__(54);
8314var setSpecies = __webpack_require__(260);
8315var aCallable = __webpack_require__(30);
8316var isCallable = __webpack_require__(7);
8317var isObject = __webpack_require__(17);
8318var anInstance = __webpack_require__(261);
8319var speciesConstructor = __webpack_require__(155);
8320var task = __webpack_require__(157).set;
8321var microtask = __webpack_require__(263);
8322var hostReportErrors = __webpack_require__(266);
8323var perform = __webpack_require__(71);
8324var Queue = __webpack_require__(267);
8325var InternalStateModule = __webpack_require__(91);
8326var NativePromiseConstructor = __webpack_require__(55);
8327var PromiseConstructorDetection = __webpack_require__(72);
8328var newPromiseCapabilityModule = __webpack_require__(44);
8329
8330var PROMISE = 'Promise';
8331var FORCED_PROMISE_CONSTRUCTOR = PromiseConstructorDetection.CONSTRUCTOR;
8332var NATIVE_PROMISE_REJECTION_EVENT = PromiseConstructorDetection.REJECTION_EVENT;
8333var NATIVE_PROMISE_SUBCLASSING = PromiseConstructorDetection.SUBCLASSING;
8334var getInternalPromiseState = InternalStateModule.getterFor(PROMISE);
8335var setInternalState = InternalStateModule.set;
8336var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
8337var PromiseConstructor = NativePromiseConstructor;
8338var PromisePrototype = NativePromisePrototype;
8339var TypeError = global.TypeError;
8340var document = global.document;
8341var process = global.process;
8342var newPromiseCapability = newPromiseCapabilityModule.f;
8343var newGenericPromiseCapability = newPromiseCapability;
8344
8345var DISPATCH_EVENT = !!(document && document.createEvent && global.dispatchEvent);
8346var UNHANDLED_REJECTION = 'unhandledrejection';
8347var REJECTION_HANDLED = 'rejectionhandled';
8348var PENDING = 0;
8349var FULFILLED = 1;
8350var REJECTED = 2;
8351var HANDLED = 1;
8352var UNHANDLED = 2;
8353
8354var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
8355
8356// helpers
8357var isThenable = function (it) {
8358 var then;
8359 return isObject(it) && isCallable(then = it.then) ? then : false;
8360};
8361
8362var callReaction = function (reaction, state) {
8363 var value = state.value;
8364 var ok = state.state == FULFILLED;
8365 var handler = ok ? reaction.ok : reaction.fail;
8366 var resolve = reaction.resolve;
8367 var reject = reaction.reject;
8368 var domain = reaction.domain;
8369 var result, then, exited;
8370 try {
8371 if (handler) {
8372 if (!ok) {
8373 if (state.rejection === UNHANDLED) onHandleUnhandled(state);
8374 state.rejection = HANDLED;
8375 }
8376 if (handler === true) result = value;
8377 else {
8378 if (domain) domain.enter();
8379 result = handler(value); // can throw
8380 if (domain) {
8381 domain.exit();
8382 exited = true;
8383 }
8384 }
8385 if (result === reaction.promise) {
8386 reject(TypeError('Promise-chain cycle'));
8387 } else if (then = isThenable(result)) {
8388 call(then, result, resolve, reject);
8389 } else resolve(result);
8390 } else reject(value);
8391 } catch (error) {
8392 if (domain && !exited) domain.exit();
8393 reject(error);
8394 }
8395};
8396
8397var notify = function (state, isReject) {
8398 if (state.notified) return;
8399 state.notified = true;
8400 microtask(function () {
8401 var reactions = state.reactions;
8402 var reaction;
8403 while (reaction = reactions.get()) {
8404 callReaction(reaction, state);
8405 }
8406 state.notified = false;
8407 if (isReject && !state.rejection) onUnhandled(state);
8408 });
8409};
8410
8411var dispatchEvent = function (name, promise, reason) {
8412 var event, handler;
8413 if (DISPATCH_EVENT) {
8414 event = document.createEvent('Event');
8415 event.promise = promise;
8416 event.reason = reason;
8417 event.initEvent(name, false, true);
8418 global.dispatchEvent(event);
8419 } else event = { promise: promise, reason: reason };
8420 if (!NATIVE_PROMISE_REJECTION_EVENT && (handler = global['on' + name])) handler(event);
8421 else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);
8422};
8423
8424var onUnhandled = function (state) {
8425 call(task, global, function () {
8426 var promise = state.facade;
8427 var value = state.value;
8428 var IS_UNHANDLED = isUnhandled(state);
8429 var result;
8430 if (IS_UNHANDLED) {
8431 result = perform(function () {
8432 if (IS_NODE) {
8433 process.emit('unhandledRejection', value, promise);
8434 } else dispatchEvent(UNHANDLED_REJECTION, promise, value);
8435 });
8436 // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
8437 state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;
8438 if (result.error) throw result.value;
8439 }
8440 });
8441};
8442
8443var isUnhandled = function (state) {
8444 return state.rejection !== HANDLED && !state.parent;
8445};
8446
8447var onHandleUnhandled = function (state) {
8448 call(task, global, function () {
8449 var promise = state.facade;
8450 if (IS_NODE) {
8451 process.emit('rejectionHandled', promise);
8452 } else dispatchEvent(REJECTION_HANDLED, promise, state.value);
8453 });
8454};
8455
8456var bind = function (fn, state, unwrap) {
8457 return function (value) {
8458 fn(state, value, unwrap);
8459 };
8460};
8461
8462var internalReject = function (state, value, unwrap) {
8463 if (state.done) return;
8464 state.done = true;
8465 if (unwrap) state = unwrap;
8466 state.value = value;
8467 state.state = REJECTED;
8468 notify(state, true);
8469};
8470
8471var internalResolve = function (state, value, unwrap) {
8472 if (state.done) return;
8473 state.done = true;
8474 if (unwrap) state = unwrap;
8475 try {
8476 if (state.facade === value) throw TypeError("Promise can't be resolved itself");
8477 var then = isThenable(value);
8478 if (then) {
8479 microtask(function () {
8480 var wrapper = { done: false };
8481 try {
8482 call(then, value,
8483 bind(internalResolve, wrapper, state),
8484 bind(internalReject, wrapper, state)
8485 );
8486 } catch (error) {
8487 internalReject(wrapper, error, state);
8488 }
8489 });
8490 } else {
8491 state.value = value;
8492 state.state = FULFILLED;
8493 notify(state, false);
8494 }
8495 } catch (error) {
8496 internalReject({ done: false }, error, state);
8497 }
8498};
8499
8500// constructor polyfill
8501if (FORCED_PROMISE_CONSTRUCTOR) {
8502 // 25.4.3.1 Promise(executor)
8503 PromiseConstructor = function Promise(executor) {
8504 anInstance(this, PromisePrototype);
8505 aCallable(executor);
8506 call(Internal, this);
8507 var state = getInternalPromiseState(this);
8508 try {
8509 executor(bind(internalResolve, state), bind(internalReject, state));
8510 } catch (error) {
8511 internalReject(state, error);
8512 }
8513 };
8514
8515 PromisePrototype = PromiseConstructor.prototype;
8516
8517 // eslint-disable-next-line no-unused-vars -- required for `.length`
8518 Internal = function Promise(executor) {
8519 setInternalState(this, {
8520 type: PROMISE,
8521 done: false,
8522 notified: false,
8523 parent: false,
8524 reactions: new Queue(),
8525 rejection: false,
8526 state: PENDING,
8527 value: undefined
8528 });
8529 };
8530
8531 // `Promise.prototype.then` method
8532 // https://tc39.es/ecma262/#sec-promise.prototype.then
8533 Internal.prototype = defineBuiltIn(PromisePrototype, 'then', function then(onFulfilled, onRejected) {
8534 var state = getInternalPromiseState(this);
8535 var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor));
8536 state.parent = true;
8537 reaction.ok = isCallable(onFulfilled) ? onFulfilled : true;
8538 reaction.fail = isCallable(onRejected) && onRejected;
8539 reaction.domain = IS_NODE ? process.domain : undefined;
8540 if (state.state == PENDING) state.reactions.add(reaction);
8541 else microtask(function () {
8542 callReaction(reaction, state);
8543 });
8544 return reaction.promise;
8545 });
8546
8547 OwnPromiseCapability = function () {
8548 var promise = new Internal();
8549 var state = getInternalPromiseState(promise);
8550 this.promise = promise;
8551 this.resolve = bind(internalResolve, state);
8552 this.reject = bind(internalReject, state);
8553 };
8554
8555 newPromiseCapabilityModule.f = newPromiseCapability = function (C) {
8556 return C === PromiseConstructor || C === PromiseWrapper
8557 ? new OwnPromiseCapability(C)
8558 : newGenericPromiseCapability(C);
8559 };
8560
8561 if (!IS_PURE && isCallable(NativePromiseConstructor) && NativePromisePrototype !== Object.prototype) {
8562 nativeThen = NativePromisePrototype.then;
8563
8564 if (!NATIVE_PROMISE_SUBCLASSING) {
8565 // make `Promise#then` return a polyfilled `Promise` for native promise-based APIs
8566 defineBuiltIn(NativePromisePrototype, 'then', function then(onFulfilled, onRejected) {
8567 var that = this;
8568 return new PromiseConstructor(function (resolve, reject) {
8569 call(nativeThen, that, resolve, reject);
8570 }).then(onFulfilled, onRejected);
8571 // https://github.com/zloirock/core-js/issues/640
8572 }, { unsafe: true });
8573 }
8574
8575 // make `.constructor === Promise` work for native promise-based APIs
8576 try {
8577 delete NativePromisePrototype.constructor;
8578 } catch (error) { /* empty */ }
8579
8580 // make `instanceof Promise` work for native promise-based APIs
8581 if (setPrototypeOf) {
8582 setPrototypeOf(NativePromisePrototype, PromisePrototype);
8583 }
8584 }
8585}
8586
8587$({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
8588 Promise: PromiseConstructor
8589});
8590
8591setToStringTag(PromiseConstructor, PROMISE, false, true);
8592setSpecies(PROMISE);
8593
8594
8595/***/ }),
8596/* 260 */
8597/***/ (function(module, exports, __webpack_require__) {
8598
8599"use strict";
8600
8601var getBuiltIn = __webpack_require__(16);
8602var definePropertyModule = __webpack_require__(32);
8603var wellKnownSymbol = __webpack_require__(8);
8604var DESCRIPTORS = __webpack_require__(19);
8605
8606var SPECIES = wellKnownSymbol('species');
8607
8608module.exports = function (CONSTRUCTOR_NAME) {
8609 var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
8610 var defineProperty = definePropertyModule.f;
8611
8612 if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) {
8613 defineProperty(Constructor, SPECIES, {
8614 configurable: true,
8615 get: function () { return this; }
8616 });
8617 }
8618};
8619
8620
8621/***/ }),
8622/* 261 */
8623/***/ (function(module, exports, __webpack_require__) {
8624
8625var isPrototypeOf = __webpack_require__(20);
8626
8627var $TypeError = TypeError;
8628
8629module.exports = function (it, Prototype) {
8630 if (isPrototypeOf(Prototype, it)) return it;
8631 throw $TypeError('Incorrect invocation');
8632};
8633
8634
8635/***/ }),
8636/* 262 */
8637/***/ (function(module, exports) {
8638
8639var $TypeError = TypeError;
8640
8641module.exports = function (passed, required) {
8642 if (passed < required) throw $TypeError('Not enough arguments');
8643 return passed;
8644};
8645
8646
8647/***/ }),
8648/* 263 */
8649/***/ (function(module, exports, __webpack_require__) {
8650
8651var global = __webpack_require__(9);
8652var bind = __webpack_require__(50);
8653var getOwnPropertyDescriptor = __webpack_require__(64).f;
8654var macrotask = __webpack_require__(157).set;
8655var IS_IOS = __webpack_require__(158);
8656var IS_IOS_PEBBLE = __webpack_require__(264);
8657var IS_WEBOS_WEBKIT = __webpack_require__(265);
8658var IS_NODE = __webpack_require__(119);
8659
8660var MutationObserver = global.MutationObserver || global.WebKitMutationObserver;
8661var document = global.document;
8662var process = global.process;
8663var Promise = global.Promise;
8664// Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`
8665var queueMicrotaskDescriptor = getOwnPropertyDescriptor(global, 'queueMicrotask');
8666var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
8667
8668var flush, head, last, notify, toggle, node, promise, then;
8669
8670// modern engines have queueMicrotask method
8671if (!queueMicrotask) {
8672 flush = function () {
8673 var parent, fn;
8674 if (IS_NODE && (parent = process.domain)) parent.exit();
8675 while (head) {
8676 fn = head.fn;
8677 head = head.next;
8678 try {
8679 fn();
8680 } catch (error) {
8681 if (head) notify();
8682 else last = undefined;
8683 throw error;
8684 }
8685 } last = undefined;
8686 if (parent) parent.enter();
8687 };
8688
8689 // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339
8690 // also except WebOS Webkit https://github.com/zloirock/core-js/issues/898
8691 if (!IS_IOS && !IS_NODE && !IS_WEBOS_WEBKIT && MutationObserver && document) {
8692 toggle = true;
8693 node = document.createTextNode('');
8694 new MutationObserver(flush).observe(node, { characterData: true });
8695 notify = function () {
8696 node.data = toggle = !toggle;
8697 };
8698 // environments with maybe non-completely correct, but existent Promise
8699 } else if (!IS_IOS_PEBBLE && Promise && Promise.resolve) {
8700 // Promise.resolve without an argument throws an error in LG WebOS 2
8701 promise = Promise.resolve(undefined);
8702 // workaround of WebKit ~ iOS Safari 10.1 bug
8703 promise.constructor = Promise;
8704 then = bind(promise.then, promise);
8705 notify = function () {
8706 then(flush);
8707 };
8708 // Node.js without promises
8709 } else if (IS_NODE) {
8710 notify = function () {
8711 process.nextTick(flush);
8712 };
8713 // for other environments - macrotask based on:
8714 // - setImmediate
8715 // - MessageChannel
8716 // - window.postMessage
8717 // - onreadystatechange
8718 // - setTimeout
8719 } else {
8720 // strange IE + webpack dev server bug - use .bind(global)
8721 macrotask = bind(macrotask, global);
8722 notify = function () {
8723 macrotask(flush);
8724 };
8725 }
8726}
8727
8728module.exports = queueMicrotask || function (fn) {
8729 var task = { fn: fn, next: undefined };
8730 if (last) last.next = task;
8731 if (!head) {
8732 head = task;
8733 notify();
8734 } last = task;
8735};
8736
8737
8738/***/ }),
8739/* 264 */
8740/***/ (function(module, exports, __webpack_require__) {
8741
8742var userAgent = __webpack_require__(85);
8743var global = __webpack_require__(9);
8744
8745module.exports = /ipad|iphone|ipod/i.test(userAgent) && global.Pebble !== undefined;
8746
8747
8748/***/ }),
8749/* 265 */
8750/***/ (function(module, exports, __webpack_require__) {
8751
8752var userAgent = __webpack_require__(85);
8753
8754module.exports = /web0s(?!.*chrome)/i.test(userAgent);
8755
8756
8757/***/ }),
8758/* 266 */
8759/***/ (function(module, exports, __webpack_require__) {
8760
8761var global = __webpack_require__(9);
8762
8763module.exports = function (a, b) {
8764 var console = global.console;
8765 if (console && console.error) {
8766 arguments.length == 1 ? console.error(a) : console.error(a, b);
8767 }
8768};
8769
8770
8771/***/ }),
8772/* 267 */
8773/***/ (function(module, exports) {
8774
8775var Queue = function () {
8776 this.head = null;
8777 this.tail = null;
8778};
8779
8780Queue.prototype = {
8781 add: function (item) {
8782 var entry = { item: item, next: null };
8783 if (this.head) this.tail.next = entry;
8784 else this.head = entry;
8785 this.tail = entry;
8786 },
8787 get: function () {
8788 var entry = this.head;
8789 if (entry) {
8790 this.head = entry.next;
8791 if (this.tail === entry) this.tail = null;
8792 return entry.item;
8793 }
8794 }
8795};
8796
8797module.exports = Queue;
8798
8799
8800/***/ }),
8801/* 268 */
8802/***/ (function(module, exports) {
8803
8804module.exports = typeof window == 'object' && typeof Deno != 'object';
8805
8806
8807/***/ }),
8808/* 269 */
8809/***/ (function(module, exports, __webpack_require__) {
8810
8811"use strict";
8812
8813var $ = __webpack_require__(0);
8814var call = __webpack_require__(10);
8815var aCallable = __webpack_require__(30);
8816var newPromiseCapabilityModule = __webpack_require__(44);
8817var perform = __webpack_require__(71);
8818var iterate = __webpack_require__(68);
8819var PROMISE_STATICS_INCORRECT_ITERATION = __webpack_require__(159);
8820
8821// `Promise.all` method
8822// https://tc39.es/ecma262/#sec-promise.all
8823$({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
8824 all: function all(iterable) {
8825 var C = this;
8826 var capability = newPromiseCapabilityModule.f(C);
8827 var resolve = capability.resolve;
8828 var reject = capability.reject;
8829 var result = perform(function () {
8830 var $promiseResolve = aCallable(C.resolve);
8831 var values = [];
8832 var counter = 0;
8833 var remaining = 1;
8834 iterate(iterable, function (promise) {
8835 var index = counter++;
8836 var alreadyCalled = false;
8837 remaining++;
8838 call($promiseResolve, C, promise).then(function (value) {
8839 if (alreadyCalled) return;
8840 alreadyCalled = true;
8841 values[index] = value;
8842 --remaining || resolve(values);
8843 }, reject);
8844 });
8845 --remaining || resolve(values);
8846 });
8847 if (result.error) reject(result.value);
8848 return capability.promise;
8849 }
8850});
8851
8852
8853/***/ }),
8854/* 270 */
8855/***/ (function(module, exports, __webpack_require__) {
8856
8857"use strict";
8858
8859var $ = __webpack_require__(0);
8860var IS_PURE = __webpack_require__(31);
8861var FORCED_PROMISE_CONSTRUCTOR = __webpack_require__(72).CONSTRUCTOR;
8862var NativePromiseConstructor = __webpack_require__(55);
8863var getBuiltIn = __webpack_require__(16);
8864var isCallable = __webpack_require__(7);
8865var defineBuiltIn = __webpack_require__(43);
8866
8867var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
8868
8869// `Promise.prototype.catch` method
8870// https://tc39.es/ecma262/#sec-promise.prototype.catch
8871$({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR, real: true }, {
8872 'catch': function (onRejected) {
8873 return this.then(undefined, onRejected);
8874 }
8875});
8876
8877// makes sure that native promise-based APIs `Promise#catch` properly works with patched `Promise#then`
8878if (!IS_PURE && isCallable(NativePromiseConstructor)) {
8879 var method = getBuiltIn('Promise').prototype['catch'];
8880 if (NativePromisePrototype['catch'] !== method) {
8881 defineBuiltIn(NativePromisePrototype, 'catch', method, { unsafe: true });
8882 }
8883}
8884
8885
8886/***/ }),
8887/* 271 */
8888/***/ (function(module, exports, __webpack_require__) {
8889
8890"use strict";
8891
8892var $ = __webpack_require__(0);
8893var call = __webpack_require__(10);
8894var aCallable = __webpack_require__(30);
8895var newPromiseCapabilityModule = __webpack_require__(44);
8896var perform = __webpack_require__(71);
8897var iterate = __webpack_require__(68);
8898var PROMISE_STATICS_INCORRECT_ITERATION = __webpack_require__(159);
8899
8900// `Promise.race` method
8901// https://tc39.es/ecma262/#sec-promise.race
8902$({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
8903 race: function race(iterable) {
8904 var C = this;
8905 var capability = newPromiseCapabilityModule.f(C);
8906 var reject = capability.reject;
8907 var result = perform(function () {
8908 var $promiseResolve = aCallable(C.resolve);
8909 iterate(iterable, function (promise) {
8910 call($promiseResolve, C, promise).then(capability.resolve, reject);
8911 });
8912 });
8913 if (result.error) reject(result.value);
8914 return capability.promise;
8915 }
8916});
8917
8918
8919/***/ }),
8920/* 272 */
8921/***/ (function(module, exports, __webpack_require__) {
8922
8923"use strict";
8924
8925var $ = __webpack_require__(0);
8926var call = __webpack_require__(10);
8927var newPromiseCapabilityModule = __webpack_require__(44);
8928var FORCED_PROMISE_CONSTRUCTOR = __webpack_require__(72).CONSTRUCTOR;
8929
8930// `Promise.reject` method
8931// https://tc39.es/ecma262/#sec-promise.reject
8932$({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
8933 reject: function reject(r) {
8934 var capability = newPromiseCapabilityModule.f(this);
8935 call(capability.reject, undefined, r);
8936 return capability.promise;
8937 }
8938});
8939
8940
8941/***/ }),
8942/* 273 */
8943/***/ (function(module, exports, __webpack_require__) {
8944
8945"use strict";
8946
8947var $ = __webpack_require__(0);
8948var getBuiltIn = __webpack_require__(16);
8949var IS_PURE = __webpack_require__(31);
8950var NativePromiseConstructor = __webpack_require__(55);
8951var FORCED_PROMISE_CONSTRUCTOR = __webpack_require__(72).CONSTRUCTOR;
8952var promiseResolve = __webpack_require__(161);
8953
8954var PromiseConstructorWrapper = getBuiltIn('Promise');
8955var CHECK_WRAPPER = IS_PURE && !FORCED_PROMISE_CONSTRUCTOR;
8956
8957// `Promise.resolve` method
8958// https://tc39.es/ecma262/#sec-promise.resolve
8959$({ target: 'Promise', stat: true, forced: IS_PURE || FORCED_PROMISE_CONSTRUCTOR }, {
8960 resolve: function resolve(x) {
8961 return promiseResolve(CHECK_WRAPPER && this === PromiseConstructorWrapper ? NativePromiseConstructor : this, x);
8962 }
8963});
8964
8965
8966/***/ }),
8967/* 274 */
8968/***/ (function(module, exports, __webpack_require__) {
8969
8970"use strict";
8971
8972var $ = __webpack_require__(0);
8973var call = __webpack_require__(10);
8974var aCallable = __webpack_require__(30);
8975var newPromiseCapabilityModule = __webpack_require__(44);
8976var perform = __webpack_require__(71);
8977var iterate = __webpack_require__(68);
8978
8979// `Promise.allSettled` method
8980// https://tc39.es/ecma262/#sec-promise.allsettled
8981$({ target: 'Promise', stat: true }, {
8982 allSettled: function allSettled(iterable) {
8983 var C = this;
8984 var capability = newPromiseCapabilityModule.f(C);
8985 var resolve = capability.resolve;
8986 var reject = capability.reject;
8987 var result = perform(function () {
8988 var promiseResolve = aCallable(C.resolve);
8989 var values = [];
8990 var counter = 0;
8991 var remaining = 1;
8992 iterate(iterable, function (promise) {
8993 var index = counter++;
8994 var alreadyCalled = false;
8995 remaining++;
8996 call(promiseResolve, C, promise).then(function (value) {
8997 if (alreadyCalled) return;
8998 alreadyCalled = true;
8999 values[index] = { status: 'fulfilled', value: value };
9000 --remaining || resolve(values);
9001 }, function (error) {
9002 if (alreadyCalled) return;
9003 alreadyCalled = true;
9004 values[index] = { status: 'rejected', reason: error };
9005 --remaining || resolve(values);
9006 });
9007 });
9008 --remaining || resolve(values);
9009 });
9010 if (result.error) reject(result.value);
9011 return capability.promise;
9012 }
9013});
9014
9015
9016/***/ }),
9017/* 275 */
9018/***/ (function(module, exports, __webpack_require__) {
9019
9020"use strict";
9021
9022var $ = __webpack_require__(0);
9023var call = __webpack_require__(10);
9024var aCallable = __webpack_require__(30);
9025var getBuiltIn = __webpack_require__(16);
9026var newPromiseCapabilityModule = __webpack_require__(44);
9027var perform = __webpack_require__(71);
9028var iterate = __webpack_require__(68);
9029
9030var PROMISE_ANY_ERROR = 'No one promise resolved';
9031
9032// `Promise.any` method
9033// https://tc39.es/ecma262/#sec-promise.any
9034$({ target: 'Promise', stat: true }, {
9035 any: function any(iterable) {
9036 var C = this;
9037 var AggregateError = getBuiltIn('AggregateError');
9038 var capability = newPromiseCapabilityModule.f(C);
9039 var resolve = capability.resolve;
9040 var reject = capability.reject;
9041 var result = perform(function () {
9042 var promiseResolve = aCallable(C.resolve);
9043 var errors = [];
9044 var counter = 0;
9045 var remaining = 1;
9046 var alreadyResolved = false;
9047 iterate(iterable, function (promise) {
9048 var index = counter++;
9049 var alreadyRejected = false;
9050 remaining++;
9051 call(promiseResolve, C, promise).then(function (value) {
9052 if (alreadyRejected || alreadyResolved) return;
9053 alreadyResolved = true;
9054 resolve(value);
9055 }, function (error) {
9056 if (alreadyRejected || alreadyResolved) return;
9057 alreadyRejected = true;
9058 errors[index] = error;
9059 --remaining || reject(new AggregateError(errors, PROMISE_ANY_ERROR));
9060 });
9061 });
9062 --remaining || reject(new AggregateError(errors, PROMISE_ANY_ERROR));
9063 });
9064 if (result.error) reject(result.value);
9065 return capability.promise;
9066 }
9067});
9068
9069
9070/***/ }),
9071/* 276 */
9072/***/ (function(module, exports, __webpack_require__) {
9073
9074"use strict";
9075
9076var $ = __webpack_require__(0);
9077var IS_PURE = __webpack_require__(31);
9078var NativePromiseConstructor = __webpack_require__(55);
9079var fails = __webpack_require__(4);
9080var getBuiltIn = __webpack_require__(16);
9081var isCallable = __webpack_require__(7);
9082var speciesConstructor = __webpack_require__(155);
9083var promiseResolve = __webpack_require__(161);
9084var defineBuiltIn = __webpack_require__(43);
9085
9086var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
9087
9088// Safari bug https://bugs.webkit.org/show_bug.cgi?id=200829
9089var NON_GENERIC = !!NativePromiseConstructor && fails(function () {
9090 // eslint-disable-next-line unicorn/no-thenable -- required for testing
9091 NativePromisePrototype['finally'].call({ then: function () { /* empty */ } }, function () { /* empty */ });
9092});
9093
9094// `Promise.prototype.finally` method
9095// https://tc39.es/ecma262/#sec-promise.prototype.finally
9096$({ target: 'Promise', proto: true, real: true, forced: NON_GENERIC }, {
9097 'finally': function (onFinally) {
9098 var C = speciesConstructor(this, getBuiltIn('Promise'));
9099 var isFunction = isCallable(onFinally);
9100 return this.then(
9101 isFunction ? function (x) {
9102 return promiseResolve(C, onFinally()).then(function () { return x; });
9103 } : onFinally,
9104 isFunction ? function (e) {
9105 return promiseResolve(C, onFinally()).then(function () { throw e; });
9106 } : onFinally
9107 );
9108 }
9109});
9110
9111// makes sure that native promise-based APIs `Promise#finally` properly works with patched `Promise#then`
9112if (!IS_PURE && isCallable(NativePromiseConstructor)) {
9113 var method = getBuiltIn('Promise').prototype['finally'];
9114 if (NativePromisePrototype['finally'] !== method) {
9115 defineBuiltIn(NativePromisePrototype, 'finally', method, { unsafe: true });
9116 }
9117}
9118
9119
9120/***/ }),
9121/* 277 */
9122/***/ (function(module, exports, __webpack_require__) {
9123
9124var uncurryThis = __webpack_require__(6);
9125var toIntegerOrInfinity = __webpack_require__(113);
9126var toString = __webpack_require__(69);
9127var requireObjectCoercible = __webpack_require__(106);
9128
9129var charAt = uncurryThis(''.charAt);
9130var charCodeAt = uncurryThis(''.charCodeAt);
9131var stringSlice = uncurryThis(''.slice);
9132
9133var createMethod = function (CONVERT_TO_STRING) {
9134 return function ($this, pos) {
9135 var S = toString(requireObjectCoercible($this));
9136 var position = toIntegerOrInfinity(pos);
9137 var size = S.length;
9138 var first, second;
9139 if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
9140 first = charCodeAt(S, position);
9141 return first < 0xD800 || first > 0xDBFF || position + 1 === size
9142 || (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF
9143 ? CONVERT_TO_STRING
9144 ? charAt(S, position)
9145 : first
9146 : CONVERT_TO_STRING
9147 ? stringSlice(S, position, position + 2)
9148 : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
9149 };
9150};
9151
9152module.exports = {
9153 // `String.prototype.codePointAt` method
9154 // https://tc39.es/ecma262/#sec-string.prototype.codepointat
9155 codeAt: createMethod(false),
9156 // `String.prototype.at` method
9157 // https://github.com/mathiasbynens/String.prototype.at
9158 charAt: createMethod(true)
9159};
9160
9161
9162/***/ }),
9163/* 278 */
9164/***/ (function(module, exports) {
9165
9166// iterable DOM collections
9167// flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
9168module.exports = {
9169 CSSRuleList: 0,
9170 CSSStyleDeclaration: 0,
9171 CSSValueList: 0,
9172 ClientRectList: 0,
9173 DOMRectList: 0,
9174 DOMStringList: 0,
9175 DOMTokenList: 1,
9176 DataTransferItemList: 0,
9177 FileList: 0,
9178 HTMLAllCollection: 0,
9179 HTMLCollection: 0,
9180 HTMLFormElement: 0,
9181 HTMLSelectElement: 0,
9182 MediaList: 0,
9183 MimeTypeArray: 0,
9184 NamedNodeMap: 0,
9185 NodeList: 1,
9186 PaintRequestList: 0,
9187 Plugin: 0,
9188 PluginArray: 0,
9189 SVGLengthList: 0,
9190 SVGNumberList: 0,
9191 SVGPathSegList: 0,
9192 SVGPointList: 0,
9193 SVGStringList: 0,
9194 SVGTransformList: 0,
9195 SourceBufferList: 0,
9196 StyleSheetList: 0,
9197 TextTrackCueList: 0,
9198 TextTrackList: 0,
9199 TouchList: 0
9200};
9201
9202
9203/***/ }),
9204/* 279 */
9205/***/ (function(module, __webpack_exports__, __webpack_require__) {
9206
9207"use strict";
9208/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__index_js__ = __webpack_require__(120);
9209// Default Export
9210// ==============
9211// In this module, we mix our bundled exports into the `_` object and export
9212// the result. This is analogous to setting `module.exports = _` in CommonJS.
9213// Hence, this module is also the entry point of our UMD bundle and the package
9214// entry point for CommonJS and AMD users. In other words, this is (the source
9215// of) the module you are interfacing with when you do any of the following:
9216//
9217// ```js
9218// // CommonJS
9219// var _ = require('underscore');
9220//
9221// // AMD
9222// define(['underscore'], function(_) {...});
9223//
9224// // UMD in the browser
9225// // _ is available as a global variable
9226// ```
9227
9228
9229
9230// Add all of the Underscore functions to the wrapper object.
9231var _ = Object(__WEBPACK_IMPORTED_MODULE_0__index_js__["mixin"])(__WEBPACK_IMPORTED_MODULE_0__index_js__);
9232// Legacy Node.js API.
9233_._ = _;
9234// Export the Underscore API.
9235/* harmony default export */ __webpack_exports__["a"] = (_);
9236
9237
9238/***/ }),
9239/* 280 */
9240/***/ (function(module, __webpack_exports__, __webpack_require__) {
9241
9242"use strict";
9243/* harmony export (immutable) */ __webpack_exports__["a"] = isNull;
9244// Is a given value equal to null?
9245function isNull(obj) {
9246 return obj === null;
9247}
9248
9249
9250/***/ }),
9251/* 281 */
9252/***/ (function(module, __webpack_exports__, __webpack_require__) {
9253
9254"use strict";
9255/* harmony export (immutable) */ __webpack_exports__["a"] = isElement;
9256// Is a given value a DOM element?
9257function isElement(obj) {
9258 return !!(obj && obj.nodeType === 1);
9259}
9260
9261
9262/***/ }),
9263/* 282 */
9264/***/ (function(module, __webpack_exports__, __webpack_require__) {
9265
9266"use strict";
9267/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(15);
9268
9269
9270/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Date'));
9271
9272
9273/***/ }),
9274/* 283 */
9275/***/ (function(module, __webpack_exports__, __webpack_require__) {
9276
9277"use strict";
9278/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(15);
9279
9280
9281/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('RegExp'));
9282
9283
9284/***/ }),
9285/* 284 */
9286/***/ (function(module, __webpack_exports__, __webpack_require__) {
9287
9288"use strict";
9289/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(15);
9290
9291
9292/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Error'));
9293
9294
9295/***/ }),
9296/* 285 */
9297/***/ (function(module, __webpack_exports__, __webpack_require__) {
9298
9299"use strict";
9300/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(15);
9301
9302
9303/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Object'));
9304
9305
9306/***/ }),
9307/* 286 */
9308/***/ (function(module, __webpack_exports__, __webpack_require__) {
9309
9310"use strict";
9311/* harmony export (immutable) */ __webpack_exports__["a"] = isFinite;
9312/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(3);
9313/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isSymbol_js__ = __webpack_require__(165);
9314
9315
9316
9317// Is a given object a finite number?
9318function isFinite(obj) {
9319 return !Object(__WEBPACK_IMPORTED_MODULE_1__isSymbol_js__["a" /* default */])(obj) && Object(__WEBPACK_IMPORTED_MODULE_0__setup_js__["f" /* _isFinite */])(obj) && !isNaN(parseFloat(obj));
9320}
9321
9322
9323/***/ }),
9324/* 287 */
9325/***/ (function(module, __webpack_exports__, __webpack_require__) {
9326
9327"use strict";
9328/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createSizePropertyCheck_js__ = __webpack_require__(170);
9329/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getByteLength_js__ = __webpack_require__(124);
9330
9331
9332
9333// Internal helper to determine whether we should spend extensive checks against
9334// `ArrayBuffer` et al.
9335/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createSizePropertyCheck_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__getByteLength_js__["a" /* default */]));
9336
9337
9338/***/ }),
9339/* 288 */
9340/***/ (function(module, __webpack_exports__, __webpack_require__) {
9341
9342"use strict";
9343/* harmony export (immutable) */ __webpack_exports__["a"] = isEmpty;
9344/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(27);
9345/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArray_js__ = __webpack_require__(46);
9346/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isString_js__ = __webpack_require__(121);
9347/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isArguments_js__ = __webpack_require__(123);
9348/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__keys_js__ = __webpack_require__(11);
9349
9350
9351
9352
9353
9354
9355// Is a given array, string, or object empty?
9356// An "empty" object has no enumerable own-properties.
9357function isEmpty(obj) {
9358 if (obj == null) return true;
9359 // Skip the more expensive `toString`-based type checks if `obj` has no
9360 // `.length`.
9361 var length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(obj);
9362 if (typeof length == 'number' && (
9363 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)
9364 )) return length === 0;
9365 return Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_4__keys_js__["a" /* default */])(obj)) === 0;
9366}
9367
9368
9369/***/ }),
9370/* 289 */
9371/***/ (function(module, __webpack_exports__, __webpack_require__) {
9372
9373"use strict";
9374/* harmony export (immutable) */ __webpack_exports__["a"] = isEqual;
9375/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(23);
9376/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(3);
9377/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__getByteLength_js__ = __webpack_require__(124);
9378/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isTypedArray_js__ = __webpack_require__(168);
9379/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__isFunction_js__ = __webpack_require__(26);
9380/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__stringTagBug_js__ = __webpack_require__(74);
9381/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__isDataView_js__ = __webpack_require__(122);
9382/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__keys_js__ = __webpack_require__(11);
9383/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__has_js__ = __webpack_require__(37);
9384/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__toBufferView_js__ = __webpack_require__(290);
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396// We use this string twice, so give it a name for minification.
9397var tagDataView = '[object DataView]';
9398
9399// Internal recursive comparison function for `_.isEqual`.
9400function eq(a, b, aStack, bStack) {
9401 // Identical objects are equal. `0 === -0`, but they aren't identical.
9402 // See the [Harmony `egal` proposal](https://wiki.ecmascript.org/doku.php?id=harmony:egal).
9403 if (a === b) return a !== 0 || 1 / a === 1 / b;
9404 // `null` or `undefined` only equal to itself (strict comparison).
9405 if (a == null || b == null) return false;
9406 // `NaN`s are equivalent, but non-reflexive.
9407 if (a !== a) return b !== b;
9408 // Exhaust primitive checks
9409 var type = typeof a;
9410 if (type !== 'function' && type !== 'object' && typeof b != 'object') return false;
9411 return deepEq(a, b, aStack, bStack);
9412}
9413
9414// Internal recursive comparison function for `_.isEqual`.
9415function deepEq(a, b, aStack, bStack) {
9416 // Unwrap any wrapped objects.
9417 if (a instanceof __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */]) a = a._wrapped;
9418 if (b instanceof __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */]) b = b._wrapped;
9419 // Compare `[[Class]]` names.
9420 var className = __WEBPACK_IMPORTED_MODULE_1__setup_js__["t" /* toString */].call(a);
9421 if (className !== __WEBPACK_IMPORTED_MODULE_1__setup_js__["t" /* toString */].call(b)) return false;
9422 // Work around a bug in IE 10 - Edge 13.
9423 if (__WEBPACK_IMPORTED_MODULE_5__stringTagBug_js__["a" /* hasStringTagBug */] && className == '[object Object]' && Object(__WEBPACK_IMPORTED_MODULE_6__isDataView_js__["a" /* default */])(a)) {
9424 if (!Object(__WEBPACK_IMPORTED_MODULE_6__isDataView_js__["a" /* default */])(b)) return false;
9425 className = tagDataView;
9426 }
9427 switch (className) {
9428 // These types are compared by value.
9429 case '[object RegExp]':
9430 // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')
9431 case '[object String]':
9432 // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is
9433 // equivalent to `new String("5")`.
9434 return '' + a === '' + b;
9435 case '[object Number]':
9436 // `NaN`s are equivalent, but non-reflexive.
9437 // Object(NaN) is equivalent to NaN.
9438 if (+a !== +a) return +b !== +b;
9439 // An `egal` comparison is performed for other numeric values.
9440 return +a === 0 ? 1 / +a === 1 / b : +a === +b;
9441 case '[object Date]':
9442 case '[object Boolean]':
9443 // Coerce dates and booleans to numeric primitive values. Dates are compared by their
9444 // millisecond representations. Note that invalid dates with millisecond representations
9445 // of `NaN` are not equivalent.
9446 return +a === +b;
9447 case '[object Symbol]':
9448 return __WEBPACK_IMPORTED_MODULE_1__setup_js__["d" /* SymbolProto */].valueOf.call(a) === __WEBPACK_IMPORTED_MODULE_1__setup_js__["d" /* SymbolProto */].valueOf.call(b);
9449 case '[object ArrayBuffer]':
9450 case tagDataView:
9451 // Coerce to typed array so we can fall through.
9452 return deepEq(Object(__WEBPACK_IMPORTED_MODULE_9__toBufferView_js__["a" /* default */])(a), Object(__WEBPACK_IMPORTED_MODULE_9__toBufferView_js__["a" /* default */])(b), aStack, bStack);
9453 }
9454
9455 var areArrays = className === '[object Array]';
9456 if (!areArrays && Object(__WEBPACK_IMPORTED_MODULE_3__isTypedArray_js__["a" /* default */])(a)) {
9457 var byteLength = Object(__WEBPACK_IMPORTED_MODULE_2__getByteLength_js__["a" /* default */])(a);
9458 if (byteLength !== Object(__WEBPACK_IMPORTED_MODULE_2__getByteLength_js__["a" /* default */])(b)) return false;
9459 if (a.buffer === b.buffer && a.byteOffset === b.byteOffset) return true;
9460 areArrays = true;
9461 }
9462 if (!areArrays) {
9463 if (typeof a != 'object' || typeof b != 'object') return false;
9464
9465 // Objects with different constructors are not equivalent, but `Object`s or `Array`s
9466 // from different frames are.
9467 var aCtor = a.constructor, bCtor = b.constructor;
9468 if (aCtor !== bCtor && !(Object(__WEBPACK_IMPORTED_MODULE_4__isFunction_js__["a" /* default */])(aCtor) && aCtor instanceof aCtor &&
9469 Object(__WEBPACK_IMPORTED_MODULE_4__isFunction_js__["a" /* default */])(bCtor) && bCtor instanceof bCtor)
9470 && ('constructor' in a && 'constructor' in b)) {
9471 return false;
9472 }
9473 }
9474 // Assume equality for cyclic structures. The algorithm for detecting cyclic
9475 // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.
9476
9477 // Initializing stack of traversed objects.
9478 // It's done here since we only need them for objects and arrays comparison.
9479 aStack = aStack || [];
9480 bStack = bStack || [];
9481 var length = aStack.length;
9482 while (length--) {
9483 // Linear search. Performance is inversely proportional to the number of
9484 // unique nested structures.
9485 if (aStack[length] === a) return bStack[length] === b;
9486 }
9487
9488 // Add the first object to the stack of traversed objects.
9489 aStack.push(a);
9490 bStack.push(b);
9491
9492 // Recursively compare objects and arrays.
9493 if (areArrays) {
9494 // Compare array lengths to determine if a deep comparison is necessary.
9495 length = a.length;
9496 if (length !== b.length) return false;
9497 // Deep compare the contents, ignoring non-numeric properties.
9498 while (length--) {
9499 if (!eq(a[length], b[length], aStack, bStack)) return false;
9500 }
9501 } else {
9502 // Deep compare objects.
9503 var _keys = Object(__WEBPACK_IMPORTED_MODULE_7__keys_js__["a" /* default */])(a), key;
9504 length = _keys.length;
9505 // Ensure that both objects contain the same number of properties before comparing deep equality.
9506 if (Object(__WEBPACK_IMPORTED_MODULE_7__keys_js__["a" /* default */])(b).length !== length) return false;
9507 while (length--) {
9508 // Deep compare each member
9509 key = _keys[length];
9510 if (!(Object(__WEBPACK_IMPORTED_MODULE_8__has_js__["a" /* default */])(b, key) && eq(a[key], b[key], aStack, bStack))) return false;
9511 }
9512 }
9513 // Remove the first object from the stack of traversed objects.
9514 aStack.pop();
9515 bStack.pop();
9516 return true;
9517}
9518
9519// Perform a deep comparison to check if two objects are equal.
9520function isEqual(a, b) {
9521 return eq(a, b);
9522}
9523
9524
9525/***/ }),
9526/* 290 */
9527/***/ (function(module, __webpack_exports__, __webpack_require__) {
9528
9529"use strict";
9530/* harmony export (immutable) */ __webpack_exports__["a"] = toBufferView;
9531/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getByteLength_js__ = __webpack_require__(124);
9532
9533
9534// Internal function to wrap or shallow-copy an ArrayBuffer,
9535// typed array or DataView to a new view, reusing the buffer.
9536function toBufferView(bufferSource) {
9537 return new Uint8Array(
9538 bufferSource.buffer || bufferSource,
9539 bufferSource.byteOffset || 0,
9540 Object(__WEBPACK_IMPORTED_MODULE_0__getByteLength_js__["a" /* default */])(bufferSource)
9541 );
9542}
9543
9544
9545/***/ }),
9546/* 291 */
9547/***/ (function(module, __webpack_exports__, __webpack_require__) {
9548
9549"use strict";
9550/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(15);
9551/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__stringTagBug_js__ = __webpack_require__(74);
9552/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__ = __webpack_require__(125);
9553
9554
9555
9556
9557/* 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'));
9558
9559
9560/***/ }),
9561/* 292 */
9562/***/ (function(module, __webpack_exports__, __webpack_require__) {
9563
9564"use strict";
9565/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(15);
9566/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__stringTagBug_js__ = __webpack_require__(74);
9567/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__ = __webpack_require__(125);
9568
9569
9570
9571
9572/* 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'));
9573
9574
9575/***/ }),
9576/* 293 */
9577/***/ (function(module, __webpack_exports__, __webpack_require__) {
9578
9579"use strict";
9580/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(15);
9581/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__stringTagBug_js__ = __webpack_require__(74);
9582/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__ = __webpack_require__(125);
9583
9584
9585
9586
9587/* 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'));
9588
9589
9590/***/ }),
9591/* 294 */
9592/***/ (function(module, __webpack_exports__, __webpack_require__) {
9593
9594"use strict";
9595/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(15);
9596
9597
9598/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('WeakSet'));
9599
9600
9601/***/ }),
9602/* 295 */
9603/***/ (function(module, __webpack_exports__, __webpack_require__) {
9604
9605"use strict";
9606/* harmony export (immutable) */ __webpack_exports__["a"] = pairs;
9607/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__keys_js__ = __webpack_require__(11);
9608
9609
9610// Convert an object into a list of `[key, value]` pairs.
9611// The opposite of `_.object` with one argument.
9612function pairs(obj) {
9613 var _keys = Object(__WEBPACK_IMPORTED_MODULE_0__keys_js__["a" /* default */])(obj);
9614 var length = _keys.length;
9615 var pairs = Array(length);
9616 for (var i = 0; i < length; i++) {
9617 pairs[i] = [_keys[i], obj[_keys[i]]];
9618 }
9619 return pairs;
9620}
9621
9622
9623/***/ }),
9624/* 296 */
9625/***/ (function(module, __webpack_exports__, __webpack_require__) {
9626
9627"use strict";
9628/* harmony export (immutable) */ __webpack_exports__["a"] = create;
9629/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseCreate_js__ = __webpack_require__(178);
9630/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__extendOwn_js__ = __webpack_require__(127);
9631
9632
9633
9634// Creates an object that inherits from the given prototype object.
9635// If additional properties are provided then they will be added to the
9636// created object.
9637function create(prototype, props) {
9638 var result = Object(__WEBPACK_IMPORTED_MODULE_0__baseCreate_js__["a" /* default */])(prototype);
9639 if (props) Object(__WEBPACK_IMPORTED_MODULE_1__extendOwn_js__["a" /* default */])(result, props);
9640 return result;
9641}
9642
9643
9644/***/ }),
9645/* 297 */
9646/***/ (function(module, __webpack_exports__, __webpack_require__) {
9647
9648"use strict";
9649/* harmony export (immutable) */ __webpack_exports__["a"] = tap;
9650// Invokes `interceptor` with the `obj` and then returns `obj`.
9651// The primary purpose of this method is to "tap into" a method chain, in
9652// order to perform operations on intermediate results within the chain.
9653function tap(obj, interceptor) {
9654 interceptor(obj);
9655 return obj;
9656}
9657
9658
9659/***/ }),
9660/* 298 */
9661/***/ (function(module, __webpack_exports__, __webpack_require__) {
9662
9663"use strict";
9664/* harmony export (immutable) */ __webpack_exports__["a"] = has;
9665/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__has_js__ = __webpack_require__(37);
9666/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__toPath_js__ = __webpack_require__(76);
9667
9668
9669
9670// Shortcut function for checking if an object has a given property directly on
9671// itself (in other words, not on a prototype). Unlike the internal `has`
9672// function, this public version can also traverse nested properties.
9673function has(obj, path) {
9674 path = Object(__WEBPACK_IMPORTED_MODULE_1__toPath_js__["a" /* default */])(path);
9675 var length = path.length;
9676 for (var i = 0; i < length; i++) {
9677 var key = path[i];
9678 if (!Object(__WEBPACK_IMPORTED_MODULE_0__has_js__["a" /* default */])(obj, key)) return false;
9679 obj = obj[key];
9680 }
9681 return !!length;
9682}
9683
9684
9685/***/ }),
9686/* 299 */
9687/***/ (function(module, __webpack_exports__, __webpack_require__) {
9688
9689"use strict";
9690/* harmony export (immutable) */ __webpack_exports__["a"] = mapObject;
9691/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(18);
9692/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__keys_js__ = __webpack_require__(11);
9693
9694
9695
9696// Returns the results of applying the `iteratee` to each element of `obj`.
9697// In contrast to `_.map` it returns an object.
9698function mapObject(obj, iteratee, context) {
9699 iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(iteratee, context);
9700 var _keys = Object(__WEBPACK_IMPORTED_MODULE_1__keys_js__["a" /* default */])(obj),
9701 length = _keys.length,
9702 results = {};
9703 for (var index = 0; index < length; index++) {
9704 var currentKey = _keys[index];
9705 results[currentKey] = iteratee(obj[currentKey], currentKey, obj);
9706 }
9707 return results;
9708}
9709
9710
9711/***/ }),
9712/* 300 */
9713/***/ (function(module, __webpack_exports__, __webpack_require__) {
9714
9715"use strict";
9716/* harmony export (immutable) */ __webpack_exports__["a"] = propertyOf;
9717/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__noop_js__ = __webpack_require__(184);
9718/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__get_js__ = __webpack_require__(180);
9719
9720
9721
9722// Generates a function for a given object that returns a given property.
9723function propertyOf(obj) {
9724 if (obj == null) return __WEBPACK_IMPORTED_MODULE_0__noop_js__["a" /* default */];
9725 return function(path) {
9726 return Object(__WEBPACK_IMPORTED_MODULE_1__get_js__["a" /* default */])(obj, path);
9727 };
9728}
9729
9730
9731/***/ }),
9732/* 301 */
9733/***/ (function(module, __webpack_exports__, __webpack_require__) {
9734
9735"use strict";
9736/* harmony export (immutable) */ __webpack_exports__["a"] = times;
9737/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__optimizeCb_js__ = __webpack_require__(77);
9738
9739
9740// Run a function **n** times.
9741function times(n, iteratee, context) {
9742 var accum = Array(Math.max(0, n));
9743 iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__optimizeCb_js__["a" /* default */])(iteratee, context, 1);
9744 for (var i = 0; i < n; i++) accum[i] = iteratee(i);
9745 return accum;
9746}
9747
9748
9749/***/ }),
9750/* 302 */
9751/***/ (function(module, __webpack_exports__, __webpack_require__) {
9752
9753"use strict";
9754/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createEscaper_js__ = __webpack_require__(186);
9755/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__escapeMap_js__ = __webpack_require__(187);
9756
9757
9758
9759// Function for escaping strings to HTML interpolation.
9760/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createEscaper_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__escapeMap_js__["a" /* default */]));
9761
9762
9763/***/ }),
9764/* 303 */
9765/***/ (function(module, __webpack_exports__, __webpack_require__) {
9766
9767"use strict";
9768/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createEscaper_js__ = __webpack_require__(186);
9769/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__unescapeMap_js__ = __webpack_require__(304);
9770
9771
9772
9773// Function for unescaping strings from HTML interpolation.
9774/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createEscaper_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__unescapeMap_js__["a" /* default */]));
9775
9776
9777/***/ }),
9778/* 304 */
9779/***/ (function(module, __webpack_exports__, __webpack_require__) {
9780
9781"use strict";
9782/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__invert_js__ = __webpack_require__(174);
9783/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__escapeMap_js__ = __webpack_require__(187);
9784
9785
9786
9787// Internal list of HTML entities for unescaping.
9788/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__invert_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__escapeMap_js__["a" /* default */]));
9789
9790
9791/***/ }),
9792/* 305 */
9793/***/ (function(module, __webpack_exports__, __webpack_require__) {
9794
9795"use strict";
9796/* harmony export (immutable) */ __webpack_exports__["a"] = template;
9797/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__defaults_js__ = __webpack_require__(177);
9798/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__underscore_js__ = __webpack_require__(23);
9799/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__templateSettings_js__ = __webpack_require__(188);
9800
9801
9802
9803
9804// When customizing `_.templateSettings`, if you don't want to define an
9805// interpolation, evaluation or escaping regex, we need one that is
9806// guaranteed not to match.
9807var noMatch = /(.)^/;
9808
9809// Certain characters need to be escaped so that they can be put into a
9810// string literal.
9811var escapes = {
9812 "'": "'",
9813 '\\': '\\',
9814 '\r': 'r',
9815 '\n': 'n',
9816 '\u2028': 'u2028',
9817 '\u2029': 'u2029'
9818};
9819
9820var escapeRegExp = /\\|'|\r|\n|\u2028|\u2029/g;
9821
9822function escapeChar(match) {
9823 return '\\' + escapes[match];
9824}
9825
9826var bareIdentifier = /^\s*(\w|\$)+\s*$/;
9827
9828// JavaScript micro-templating, similar to John Resig's implementation.
9829// Underscore templating handles arbitrary delimiters, preserves whitespace,
9830// and correctly escapes quotes within interpolated code.
9831// NB: `oldSettings` only exists for backwards compatibility.
9832function template(text, settings, oldSettings) {
9833 if (!settings && oldSettings) settings = oldSettings;
9834 settings = Object(__WEBPACK_IMPORTED_MODULE_0__defaults_js__["a" /* default */])({}, settings, __WEBPACK_IMPORTED_MODULE_1__underscore_js__["a" /* default */].templateSettings);
9835
9836 // Combine delimiters into one regular expression via alternation.
9837 var matcher = RegExp([
9838 (settings.escape || noMatch).source,
9839 (settings.interpolate || noMatch).source,
9840 (settings.evaluate || noMatch).source
9841 ].join('|') + '|$', 'g');
9842
9843 // Compile the template source, escaping string literals appropriately.
9844 var index = 0;
9845 var source = "__p+='";
9846 text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {
9847 source += text.slice(index, offset).replace(escapeRegExp, escapeChar);
9848 index = offset + match.length;
9849
9850 if (escape) {
9851 source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'";
9852 } else if (interpolate) {
9853 source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'";
9854 } else if (evaluate) {
9855 source += "';\n" + evaluate + "\n__p+='";
9856 }
9857
9858 // Adobe VMs need the match returned to produce the correct offset.
9859 return match;
9860 });
9861 source += "';\n";
9862
9863 var argument = settings.variable;
9864 if (argument) {
9865 if (!bareIdentifier.test(argument)) throw new Error(argument);
9866 } else {
9867 // If a variable is not specified, place data values in local scope.
9868 source = 'with(obj||{}){\n' + source + '}\n';
9869 argument = 'obj';
9870 }
9871
9872 source = "var __t,__p='',__j=Array.prototype.join," +
9873 "print=function(){__p+=__j.call(arguments,'');};\n" +
9874 source + 'return __p;\n';
9875
9876 var render;
9877 try {
9878 render = new Function(argument, '_', source);
9879 } catch (e) {
9880 e.source = source;
9881 throw e;
9882 }
9883
9884 var template = function(data) {
9885 return render.call(this, data, __WEBPACK_IMPORTED_MODULE_1__underscore_js__["a" /* default */]);
9886 };
9887
9888 // Provide the compiled source as a convenience for precompilation.
9889 template.source = 'function(' + argument + '){\n' + source + '}';
9890
9891 return template;
9892}
9893
9894
9895/***/ }),
9896/* 306 */
9897/***/ (function(module, __webpack_exports__, __webpack_require__) {
9898
9899"use strict";
9900/* harmony export (immutable) */ __webpack_exports__["a"] = result;
9901/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isFunction_js__ = __webpack_require__(26);
9902/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__toPath_js__ = __webpack_require__(76);
9903
9904
9905
9906// Traverses the children of `obj` along `path`. If a child is a function, it
9907// is invoked with its parent as context. Returns the value of the final
9908// child, or `fallback` if any child is undefined.
9909function result(obj, path, fallback) {
9910 path = Object(__WEBPACK_IMPORTED_MODULE_1__toPath_js__["a" /* default */])(path);
9911 var length = path.length;
9912 if (!length) {
9913 return Object(__WEBPACK_IMPORTED_MODULE_0__isFunction_js__["a" /* default */])(fallback) ? fallback.call(obj) : fallback;
9914 }
9915 for (var i = 0; i < length; i++) {
9916 var prop = obj == null ? void 0 : obj[path[i]];
9917 if (prop === void 0) {
9918 prop = fallback;
9919 i = length; // Ensure we don't continue iterating.
9920 }
9921 obj = Object(__WEBPACK_IMPORTED_MODULE_0__isFunction_js__["a" /* default */])(prop) ? prop.call(obj) : prop;
9922 }
9923 return obj;
9924}
9925
9926
9927/***/ }),
9928/* 307 */
9929/***/ (function(module, __webpack_exports__, __webpack_require__) {
9930
9931"use strict";
9932/* harmony export (immutable) */ __webpack_exports__["a"] = uniqueId;
9933// Generate a unique integer id (unique within the entire client session).
9934// Useful for temporary DOM ids.
9935var idCounter = 0;
9936function uniqueId(prefix) {
9937 var id = ++idCounter + '';
9938 return prefix ? prefix + id : id;
9939}
9940
9941
9942/***/ }),
9943/* 308 */
9944/***/ (function(module, __webpack_exports__, __webpack_require__) {
9945
9946"use strict";
9947/* harmony export (immutable) */ __webpack_exports__["a"] = chain;
9948/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(23);
9949
9950
9951// Start chaining a wrapped Underscore object.
9952function chain(obj) {
9953 var instance = Object(__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */])(obj);
9954 instance._chain = true;
9955 return instance;
9956}
9957
9958
9959/***/ }),
9960/* 309 */
9961/***/ (function(module, __webpack_exports__, __webpack_require__) {
9962
9963"use strict";
9964/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(22);
9965/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__flatten_js__ = __webpack_require__(57);
9966/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__bind_js__ = __webpack_require__(190);
9967
9968
9969
9970
9971// Bind a number of an object's methods to that object. Remaining arguments
9972// are the method names to be bound. Useful for ensuring that all callbacks
9973// defined on an object belong to it.
9974/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(obj, keys) {
9975 keys = Object(__WEBPACK_IMPORTED_MODULE_1__flatten_js__["a" /* default */])(keys, false, false);
9976 var index = keys.length;
9977 if (index < 1) throw new Error('bindAll must be passed function names');
9978 while (index--) {
9979 var key = keys[index];
9980 obj[key] = Object(__WEBPACK_IMPORTED_MODULE_2__bind_js__["a" /* default */])(obj[key], obj);
9981 }
9982 return obj;
9983}));
9984
9985
9986/***/ }),
9987/* 310 */
9988/***/ (function(module, __webpack_exports__, __webpack_require__) {
9989
9990"use strict";
9991/* harmony export (immutable) */ __webpack_exports__["a"] = memoize;
9992/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__has_js__ = __webpack_require__(37);
9993
9994
9995// Memoize an expensive function by storing its results.
9996function memoize(func, hasher) {
9997 var memoize = function(key) {
9998 var cache = memoize.cache;
9999 var address = '' + (hasher ? hasher.apply(this, arguments) : key);
10000 if (!Object(__WEBPACK_IMPORTED_MODULE_0__has_js__["a" /* default */])(cache, address)) cache[address] = func.apply(this, arguments);
10001 return cache[address];
10002 };
10003 memoize.cache = {};
10004 return memoize;
10005}
10006
10007
10008/***/ }),
10009/* 311 */
10010/***/ (function(module, __webpack_exports__, __webpack_require__) {
10011
10012"use strict";
10013/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__partial_js__ = __webpack_require__(97);
10014/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__delay_js__ = __webpack_require__(191);
10015/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__underscore_js__ = __webpack_require__(23);
10016
10017
10018
10019
10020// Defers a function, scheduling it to run after the current call stack has
10021// cleared.
10022/* 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));
10023
10024
10025/***/ }),
10026/* 312 */
10027/***/ (function(module, __webpack_exports__, __webpack_require__) {
10028
10029"use strict";
10030/* harmony export (immutable) */ __webpack_exports__["a"] = throttle;
10031/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__now_js__ = __webpack_require__(131);
10032
10033
10034// Returns a function, that, when invoked, will only be triggered at most once
10035// during a given window of time. Normally, the throttled function will run
10036// as much as it can, without ever going more than once per `wait` duration;
10037// but if you'd like to disable the execution on the leading edge, pass
10038// `{leading: false}`. To disable execution on the trailing edge, ditto.
10039function throttle(func, wait, options) {
10040 var timeout, context, args, result;
10041 var previous = 0;
10042 if (!options) options = {};
10043
10044 var later = function() {
10045 previous = options.leading === false ? 0 : Object(__WEBPACK_IMPORTED_MODULE_0__now_js__["a" /* default */])();
10046 timeout = null;
10047 result = func.apply(context, args);
10048 if (!timeout) context = args = null;
10049 };
10050
10051 var throttled = function() {
10052 var _now = Object(__WEBPACK_IMPORTED_MODULE_0__now_js__["a" /* default */])();
10053 if (!previous && options.leading === false) previous = _now;
10054 var remaining = wait - (_now - previous);
10055 context = this;
10056 args = arguments;
10057 if (remaining <= 0 || remaining > wait) {
10058 if (timeout) {
10059 clearTimeout(timeout);
10060 timeout = null;
10061 }
10062 previous = _now;
10063 result = func.apply(context, args);
10064 if (!timeout) context = args = null;
10065 } else if (!timeout && options.trailing !== false) {
10066 timeout = setTimeout(later, remaining);
10067 }
10068 return result;
10069 };
10070
10071 throttled.cancel = function() {
10072 clearTimeout(timeout);
10073 previous = 0;
10074 timeout = context = args = null;
10075 };
10076
10077 return throttled;
10078}
10079
10080
10081/***/ }),
10082/* 313 */
10083/***/ (function(module, __webpack_exports__, __webpack_require__) {
10084
10085"use strict";
10086/* harmony export (immutable) */ __webpack_exports__["a"] = debounce;
10087/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(22);
10088/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__now_js__ = __webpack_require__(131);
10089
10090
10091
10092// When a sequence of calls of the returned function ends, the argument
10093// function is triggered. The end of a sequence is defined by the `wait`
10094// parameter. If `immediate` is passed, the argument function will be
10095// triggered at the beginning of the sequence instead of at the end.
10096function debounce(func, wait, immediate) {
10097 var timeout, previous, args, result, context;
10098
10099 var later = function() {
10100 var passed = Object(__WEBPACK_IMPORTED_MODULE_1__now_js__["a" /* default */])() - previous;
10101 if (wait > passed) {
10102 timeout = setTimeout(later, wait - passed);
10103 } else {
10104 timeout = null;
10105 if (!immediate) result = func.apply(context, args);
10106 // This check is needed because `func` can recursively invoke `debounced`.
10107 if (!timeout) args = context = null;
10108 }
10109 };
10110
10111 var debounced = Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(_args) {
10112 context = this;
10113 args = _args;
10114 previous = Object(__WEBPACK_IMPORTED_MODULE_1__now_js__["a" /* default */])();
10115 if (!timeout) {
10116 timeout = setTimeout(later, wait);
10117 if (immediate) result = func.apply(context, args);
10118 }
10119 return result;
10120 });
10121
10122 debounced.cancel = function() {
10123 clearTimeout(timeout);
10124 timeout = args = context = null;
10125 };
10126
10127 return debounced;
10128}
10129
10130
10131/***/ }),
10132/* 314 */
10133/***/ (function(module, __webpack_exports__, __webpack_require__) {
10134
10135"use strict";
10136/* harmony export (immutable) */ __webpack_exports__["a"] = wrap;
10137/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__partial_js__ = __webpack_require__(97);
10138
10139
10140// Returns the first function passed as an argument to the second,
10141// allowing you to adjust arguments, run code before and after, and
10142// conditionally execute the original function.
10143function wrap(func, wrapper) {
10144 return Object(__WEBPACK_IMPORTED_MODULE_0__partial_js__["a" /* default */])(wrapper, func);
10145}
10146
10147
10148/***/ }),
10149/* 315 */
10150/***/ (function(module, __webpack_exports__, __webpack_require__) {
10151
10152"use strict";
10153/* harmony export (immutable) */ __webpack_exports__["a"] = compose;
10154// Returns a function that is the composition of a list of functions, each
10155// consuming the return value of the function that follows.
10156function compose() {
10157 var args = arguments;
10158 var start = args.length - 1;
10159 return function() {
10160 var i = start;
10161 var result = args[start].apply(this, arguments);
10162 while (i--) result = args[i].call(this, result);
10163 return result;
10164 };
10165}
10166
10167
10168/***/ }),
10169/* 316 */
10170/***/ (function(module, __webpack_exports__, __webpack_require__) {
10171
10172"use strict";
10173/* harmony export (immutable) */ __webpack_exports__["a"] = after;
10174// Returns a function that will only be executed on and after the Nth call.
10175function after(times, func) {
10176 return function() {
10177 if (--times < 1) {
10178 return func.apply(this, arguments);
10179 }
10180 };
10181}
10182
10183
10184/***/ }),
10185/* 317 */
10186/***/ (function(module, __webpack_exports__, __webpack_require__) {
10187
10188"use strict";
10189/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__partial_js__ = __webpack_require__(97);
10190/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__before_js__ = __webpack_require__(192);
10191
10192
10193
10194// Returns a function that will be executed at most one time, no matter how
10195// often you call it. Useful for lazy initialization.
10196/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__partial_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__before_js__["a" /* default */], 2));
10197
10198
10199/***/ }),
10200/* 318 */
10201/***/ (function(module, __webpack_exports__, __webpack_require__) {
10202
10203"use strict";
10204/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__findLastIndex_js__ = __webpack_require__(195);
10205/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__createIndexFinder_js__ = __webpack_require__(198);
10206
10207
10208
10209// Return the position of the last occurrence of an item in an array,
10210// or -1 if the item is not included in the array.
10211/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_1__createIndexFinder_js__["a" /* default */])(-1, __WEBPACK_IMPORTED_MODULE_0__findLastIndex_js__["a" /* default */]));
10212
10213
10214/***/ }),
10215/* 319 */
10216/***/ (function(module, __webpack_exports__, __webpack_require__) {
10217
10218"use strict";
10219/* harmony export (immutable) */ __webpack_exports__["a"] = findWhere;
10220/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__find_js__ = __webpack_require__(199);
10221/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__matcher_js__ = __webpack_require__(96);
10222
10223
10224
10225// Convenience version of a common use case of `_.find`: getting the first
10226// object containing specific `key:value` pairs.
10227function findWhere(obj, attrs) {
10228 return Object(__WEBPACK_IMPORTED_MODULE_0__find_js__["a" /* default */])(obj, Object(__WEBPACK_IMPORTED_MODULE_1__matcher_js__["a" /* default */])(attrs));
10229}
10230
10231
10232/***/ }),
10233/* 320 */
10234/***/ (function(module, __webpack_exports__, __webpack_require__) {
10235
10236"use strict";
10237/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createReduce_js__ = __webpack_require__(200);
10238
10239
10240// **Reduce** builds up a single result from a list of values, aka `inject`,
10241// or `foldl`.
10242/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createReduce_js__["a" /* default */])(1));
10243
10244
10245/***/ }),
10246/* 321 */
10247/***/ (function(module, __webpack_exports__, __webpack_require__) {
10248
10249"use strict";
10250/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createReduce_js__ = __webpack_require__(200);
10251
10252
10253// The right-associative version of reduce, also known as `foldr`.
10254/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createReduce_js__["a" /* default */])(-1));
10255
10256
10257/***/ }),
10258/* 322 */
10259/***/ (function(module, __webpack_exports__, __webpack_require__) {
10260
10261"use strict";
10262/* harmony export (immutable) */ __webpack_exports__["a"] = reject;
10263/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__filter_js__ = __webpack_require__(78);
10264/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__negate_js__ = __webpack_require__(132);
10265/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__cb_js__ = __webpack_require__(18);
10266
10267
10268
10269
10270// Return all the elements for which a truth test fails.
10271function reject(obj, predicate, context) {
10272 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);
10273}
10274
10275
10276/***/ }),
10277/* 323 */
10278/***/ (function(module, __webpack_exports__, __webpack_require__) {
10279
10280"use strict";
10281/* harmony export (immutable) */ __webpack_exports__["a"] = every;
10282/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(18);
10283/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__ = __webpack_require__(24);
10284/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__keys_js__ = __webpack_require__(11);
10285
10286
10287
10288
10289// Determine whether all of the elements pass a truth test.
10290function every(obj, predicate, context) {
10291 predicate = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(predicate, context);
10292 var _keys = !Object(__WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__["a" /* default */])(obj) && Object(__WEBPACK_IMPORTED_MODULE_2__keys_js__["a" /* default */])(obj),
10293 length = (_keys || obj).length;
10294 for (var index = 0; index < length; index++) {
10295 var currentKey = _keys ? _keys[index] : index;
10296 if (!predicate(obj[currentKey], currentKey, obj)) return false;
10297 }
10298 return true;
10299}
10300
10301
10302/***/ }),
10303/* 324 */
10304/***/ (function(module, __webpack_exports__, __webpack_require__) {
10305
10306"use strict";
10307/* harmony export (immutable) */ __webpack_exports__["a"] = some;
10308/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(18);
10309/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__ = __webpack_require__(24);
10310/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__keys_js__ = __webpack_require__(11);
10311
10312
10313
10314
10315// Determine if at least one element in the object passes a truth test.
10316function some(obj, predicate, context) {
10317 predicate = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(predicate, context);
10318 var _keys = !Object(__WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__["a" /* default */])(obj) && Object(__WEBPACK_IMPORTED_MODULE_2__keys_js__["a" /* default */])(obj),
10319 length = (_keys || obj).length;
10320 for (var index = 0; index < length; index++) {
10321 var currentKey = _keys ? _keys[index] : index;
10322 if (predicate(obj[currentKey], currentKey, obj)) return true;
10323 }
10324 return false;
10325}
10326
10327
10328/***/ }),
10329/* 325 */
10330/***/ (function(module, __webpack_exports__, __webpack_require__) {
10331
10332"use strict";
10333/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(22);
10334/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(26);
10335/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__map_js__ = __webpack_require__(58);
10336/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__deepGet_js__ = __webpack_require__(128);
10337/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__toPath_js__ = __webpack_require__(76);
10338
10339
10340
10341
10342
10343
10344// Invoke a method (with arguments) on every item in a collection.
10345/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(obj, path, args) {
10346 var contextPath, func;
10347 if (Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(path)) {
10348 func = path;
10349 } else {
10350 path = Object(__WEBPACK_IMPORTED_MODULE_4__toPath_js__["a" /* default */])(path);
10351 contextPath = path.slice(0, -1);
10352 path = path[path.length - 1];
10353 }
10354 return Object(__WEBPACK_IMPORTED_MODULE_2__map_js__["a" /* default */])(obj, function(context) {
10355 var method = func;
10356 if (!method) {
10357 if (contextPath && contextPath.length) {
10358 context = Object(__WEBPACK_IMPORTED_MODULE_3__deepGet_js__["a" /* default */])(context, contextPath);
10359 }
10360 if (context == null) return void 0;
10361 method = context[path];
10362 }
10363 return method == null ? method : method.apply(context, args);
10364 });
10365}));
10366
10367
10368/***/ }),
10369/* 326 */
10370/***/ (function(module, __webpack_exports__, __webpack_require__) {
10371
10372"use strict";
10373/* harmony export (immutable) */ __webpack_exports__["a"] = where;
10374/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__filter_js__ = __webpack_require__(78);
10375/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__matcher_js__ = __webpack_require__(96);
10376
10377
10378
10379// Convenience version of a common use case of `_.filter`: selecting only
10380// objects containing specific `key:value` pairs.
10381function where(obj, attrs) {
10382 return Object(__WEBPACK_IMPORTED_MODULE_0__filter_js__["a" /* default */])(obj, Object(__WEBPACK_IMPORTED_MODULE_1__matcher_js__["a" /* default */])(attrs));
10383}
10384
10385
10386/***/ }),
10387/* 327 */
10388/***/ (function(module, __webpack_exports__, __webpack_require__) {
10389
10390"use strict";
10391/* harmony export (immutable) */ __webpack_exports__["a"] = min;
10392/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(24);
10393/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__values_js__ = __webpack_require__(56);
10394/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__cb_js__ = __webpack_require__(18);
10395/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__each_js__ = __webpack_require__(47);
10396
10397
10398
10399
10400
10401// Return the minimum element (or element-based computation).
10402function min(obj, iteratee, context) {
10403 var result = Infinity, lastComputed = Infinity,
10404 value, computed;
10405 if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) {
10406 obj = Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" /* default */])(obj) ? obj : Object(__WEBPACK_IMPORTED_MODULE_1__values_js__["a" /* default */])(obj);
10407 for (var i = 0, length = obj.length; i < length; i++) {
10408 value = obj[i];
10409 if (value != null && value < result) {
10410 result = value;
10411 }
10412 }
10413 } else {
10414 iteratee = Object(__WEBPACK_IMPORTED_MODULE_2__cb_js__["a" /* default */])(iteratee, context);
10415 Object(__WEBPACK_IMPORTED_MODULE_3__each_js__["a" /* default */])(obj, function(v, index, list) {
10416 computed = iteratee(v, index, list);
10417 if (computed < lastComputed || computed === Infinity && result === Infinity) {
10418 result = v;
10419 lastComputed = computed;
10420 }
10421 });
10422 }
10423 return result;
10424}
10425
10426
10427/***/ }),
10428/* 328 */
10429/***/ (function(module, __webpack_exports__, __webpack_require__) {
10430
10431"use strict";
10432/* harmony export (immutable) */ __webpack_exports__["a"] = shuffle;
10433/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__sample_js__ = __webpack_require__(202);
10434
10435
10436// Shuffle a collection.
10437function shuffle(obj) {
10438 return Object(__WEBPACK_IMPORTED_MODULE_0__sample_js__["a" /* default */])(obj, Infinity);
10439}
10440
10441
10442/***/ }),
10443/* 329 */
10444/***/ (function(module, __webpack_exports__, __webpack_require__) {
10445
10446"use strict";
10447/* harmony export (immutable) */ __webpack_exports__["a"] = sortBy;
10448/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(18);
10449/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__pluck_js__ = __webpack_require__(134);
10450/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__map_js__ = __webpack_require__(58);
10451
10452
10453
10454
10455// Sort the object's values by a criterion produced by an iteratee.
10456function sortBy(obj, iteratee, context) {
10457 var index = 0;
10458 iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(iteratee, context);
10459 return Object(__WEBPACK_IMPORTED_MODULE_1__pluck_js__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_2__map_js__["a" /* default */])(obj, function(value, key, list) {
10460 return {
10461 value: value,
10462 index: index++,
10463 criteria: iteratee(value, key, list)
10464 };
10465 }).sort(function(left, right) {
10466 var a = left.criteria;
10467 var b = right.criteria;
10468 if (a !== b) {
10469 if (a > b || a === void 0) return 1;
10470 if (a < b || b === void 0) return -1;
10471 }
10472 return left.index - right.index;
10473 }), 'value');
10474}
10475
10476
10477/***/ }),
10478/* 330 */
10479/***/ (function(module, __webpack_exports__, __webpack_require__) {
10480
10481"use strict";
10482/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__group_js__ = __webpack_require__(98);
10483/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__has_js__ = __webpack_require__(37);
10484
10485
10486
10487// Groups the object's values by a criterion. Pass either a string attribute
10488// to group by, or a function that returns the criterion.
10489/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__group_js__["a" /* default */])(function(result, value, key) {
10490 if (Object(__WEBPACK_IMPORTED_MODULE_1__has_js__["a" /* default */])(result, key)) result[key].push(value); else result[key] = [value];
10491}));
10492
10493
10494/***/ }),
10495/* 331 */
10496/***/ (function(module, __webpack_exports__, __webpack_require__) {
10497
10498"use strict";
10499/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__group_js__ = __webpack_require__(98);
10500
10501
10502// Indexes the object's values by a criterion, similar to `_.groupBy`, but for
10503// when you know that your index values will be unique.
10504/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__group_js__["a" /* default */])(function(result, value, key) {
10505 result[key] = value;
10506}));
10507
10508
10509/***/ }),
10510/* 332 */
10511/***/ (function(module, __webpack_exports__, __webpack_require__) {
10512
10513"use strict";
10514/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__group_js__ = __webpack_require__(98);
10515/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__has_js__ = __webpack_require__(37);
10516
10517
10518
10519// Counts instances of an object that group by a certain criterion. Pass
10520// either a string attribute to count by, or a function that returns the
10521// criterion.
10522/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__group_js__["a" /* default */])(function(result, value, key) {
10523 if (Object(__WEBPACK_IMPORTED_MODULE_1__has_js__["a" /* default */])(result, key)) result[key]++; else result[key] = 1;
10524}));
10525
10526
10527/***/ }),
10528/* 333 */
10529/***/ (function(module, __webpack_exports__, __webpack_require__) {
10530
10531"use strict";
10532/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__group_js__ = __webpack_require__(98);
10533
10534
10535// Split a collection into two arrays: one whose elements all pass the given
10536// truth test, and one whose elements all do not pass the truth test.
10537/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__group_js__["a" /* default */])(function(result, value, pass) {
10538 result[pass ? 0 : 1].push(value);
10539}, true));
10540
10541
10542/***/ }),
10543/* 334 */
10544/***/ (function(module, __webpack_exports__, __webpack_require__) {
10545
10546"use strict";
10547/* harmony export (immutable) */ __webpack_exports__["a"] = toArray;
10548/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArray_js__ = __webpack_require__(46);
10549/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(3);
10550/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isString_js__ = __webpack_require__(121);
10551/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isArrayLike_js__ = __webpack_require__(24);
10552/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__map_js__ = __webpack_require__(58);
10553/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__identity_js__ = __webpack_require__(129);
10554/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__values_js__ = __webpack_require__(56);
10555
10556
10557
10558
10559
10560
10561
10562
10563// Safely create a real, live array from anything iterable.
10564var reStrSymbol = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;
10565function toArray(obj) {
10566 if (!obj) return [];
10567 if (Object(__WEBPACK_IMPORTED_MODULE_0__isArray_js__["a" /* default */])(obj)) return __WEBPACK_IMPORTED_MODULE_1__setup_js__["q" /* slice */].call(obj);
10568 if (Object(__WEBPACK_IMPORTED_MODULE_2__isString_js__["a" /* default */])(obj)) {
10569 // Keep surrogate pair characters together.
10570 return obj.match(reStrSymbol);
10571 }
10572 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 */]);
10573 return Object(__WEBPACK_IMPORTED_MODULE_6__values_js__["a" /* default */])(obj);
10574}
10575
10576
10577/***/ }),
10578/* 335 */
10579/***/ (function(module, __webpack_exports__, __webpack_require__) {
10580
10581"use strict";
10582/* harmony export (immutable) */ __webpack_exports__["a"] = size;
10583/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(24);
10584/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__keys_js__ = __webpack_require__(11);
10585
10586
10587
10588// Return the number of elements in a collection.
10589function size(obj) {
10590 if (obj == null) return 0;
10591 return Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" /* default */])(obj) ? obj.length : Object(__WEBPACK_IMPORTED_MODULE_1__keys_js__["a" /* default */])(obj).length;
10592}
10593
10594
10595/***/ }),
10596/* 336 */
10597/***/ (function(module, __webpack_exports__, __webpack_require__) {
10598
10599"use strict";
10600/* harmony export (immutable) */ __webpack_exports__["a"] = keyInObj;
10601// Internal `_.pick` helper function to determine whether `key` is an enumerable
10602// property name of `obj`.
10603function keyInObj(value, key, obj) {
10604 return key in obj;
10605}
10606
10607
10608/***/ }),
10609/* 337 */
10610/***/ (function(module, __webpack_exports__, __webpack_require__) {
10611
10612"use strict";
10613/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(22);
10614/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(26);
10615/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__negate_js__ = __webpack_require__(132);
10616/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__map_js__ = __webpack_require__(58);
10617/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__flatten_js__ = __webpack_require__(57);
10618/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__contains_js__ = __webpack_require__(79);
10619/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__pick_js__ = __webpack_require__(203);
10620
10621
10622
10623
10624
10625
10626
10627
10628// Return a copy of the object without the disallowed properties.
10629/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(obj, keys) {
10630 var iteratee = keys[0], context;
10631 if (Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(iteratee)) {
10632 iteratee = Object(__WEBPACK_IMPORTED_MODULE_2__negate_js__["a" /* default */])(iteratee);
10633 if (keys.length > 1) context = keys[1];
10634 } else {
10635 keys = Object(__WEBPACK_IMPORTED_MODULE_3__map_js__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_4__flatten_js__["a" /* default */])(keys, false, false), String);
10636 iteratee = function(value, key) {
10637 return !Object(__WEBPACK_IMPORTED_MODULE_5__contains_js__["a" /* default */])(keys, key);
10638 };
10639 }
10640 return Object(__WEBPACK_IMPORTED_MODULE_6__pick_js__["a" /* default */])(obj, iteratee, context);
10641}));
10642
10643
10644/***/ }),
10645/* 338 */
10646/***/ (function(module, __webpack_exports__, __webpack_require__) {
10647
10648"use strict";
10649/* harmony export (immutable) */ __webpack_exports__["a"] = first;
10650/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__initial_js__ = __webpack_require__(204);
10651
10652
10653// Get the first element of an array. Passing **n** will return the first N
10654// values in the array. The **guard** check allows it to work with `_.map`.
10655function first(array, n, guard) {
10656 if (array == null || array.length < 1) return n == null || guard ? void 0 : [];
10657 if (n == null || guard) return array[0];
10658 return Object(__WEBPACK_IMPORTED_MODULE_0__initial_js__["a" /* default */])(array, array.length - n);
10659}
10660
10661
10662/***/ }),
10663/* 339 */
10664/***/ (function(module, __webpack_exports__, __webpack_require__) {
10665
10666"use strict";
10667/* harmony export (immutable) */ __webpack_exports__["a"] = last;
10668/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__rest_js__ = __webpack_require__(205);
10669
10670
10671// Get the last element of an array. Passing **n** will return the last N
10672// values in the array.
10673function last(array, n, guard) {
10674 if (array == null || array.length < 1) return n == null || guard ? void 0 : [];
10675 if (n == null || guard) return array[array.length - 1];
10676 return Object(__WEBPACK_IMPORTED_MODULE_0__rest_js__["a" /* default */])(array, Math.max(0, array.length - n));
10677}
10678
10679
10680/***/ }),
10681/* 340 */
10682/***/ (function(module, __webpack_exports__, __webpack_require__) {
10683
10684"use strict";
10685/* harmony export (immutable) */ __webpack_exports__["a"] = compact;
10686/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__filter_js__ = __webpack_require__(78);
10687
10688
10689// Trim out all falsy values from an array.
10690function compact(array) {
10691 return Object(__WEBPACK_IMPORTED_MODULE_0__filter_js__["a" /* default */])(array, Boolean);
10692}
10693
10694
10695/***/ }),
10696/* 341 */
10697/***/ (function(module, __webpack_exports__, __webpack_require__) {
10698
10699"use strict";
10700/* harmony export (immutable) */ __webpack_exports__["a"] = flatten;
10701/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__flatten_js__ = __webpack_require__(57);
10702
10703
10704// Flatten out an array, either recursively (by default), or up to `depth`.
10705// Passing `true` or `false` as `depth` means `1` or `Infinity`, respectively.
10706function flatten(array, depth) {
10707 return Object(__WEBPACK_IMPORTED_MODULE_0__flatten_js__["a" /* default */])(array, depth, false);
10708}
10709
10710
10711/***/ }),
10712/* 342 */
10713/***/ (function(module, __webpack_exports__, __webpack_require__) {
10714
10715"use strict";
10716/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(22);
10717/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__difference_js__ = __webpack_require__(206);
10718
10719
10720
10721// Return a version of the array that does not contain the specified value(s).
10722/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(array, otherArrays) {
10723 return Object(__WEBPACK_IMPORTED_MODULE_1__difference_js__["a" /* default */])(array, otherArrays);
10724}));
10725
10726
10727/***/ }),
10728/* 343 */
10729/***/ (function(module, __webpack_exports__, __webpack_require__) {
10730
10731"use strict";
10732/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(22);
10733/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__uniq_js__ = __webpack_require__(207);
10734/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__flatten_js__ = __webpack_require__(57);
10735
10736
10737
10738
10739// Produce an array that contains the union: each distinct element from all of
10740// the passed-in arrays.
10741/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(arrays) {
10742 return Object(__WEBPACK_IMPORTED_MODULE_1__uniq_js__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_2__flatten_js__["a" /* default */])(arrays, true, true));
10743}));
10744
10745
10746/***/ }),
10747/* 344 */
10748/***/ (function(module, __webpack_exports__, __webpack_require__) {
10749
10750"use strict";
10751/* harmony export (immutable) */ __webpack_exports__["a"] = intersection;
10752/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(27);
10753/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__contains_js__ = __webpack_require__(79);
10754
10755
10756
10757// Produce an array that contains every item shared between all the
10758// passed-in arrays.
10759function intersection(array) {
10760 var result = [];
10761 var argsLength = arguments.length;
10762 for (var i = 0, length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(array); i < length; i++) {
10763 var item = array[i];
10764 if (Object(__WEBPACK_IMPORTED_MODULE_1__contains_js__["a" /* default */])(result, item)) continue;
10765 var j;
10766 for (j = 1; j < argsLength; j++) {
10767 if (!Object(__WEBPACK_IMPORTED_MODULE_1__contains_js__["a" /* default */])(arguments[j], item)) break;
10768 }
10769 if (j === argsLength) result.push(item);
10770 }
10771 return result;
10772}
10773
10774
10775/***/ }),
10776/* 345 */
10777/***/ (function(module, __webpack_exports__, __webpack_require__) {
10778
10779"use strict";
10780/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(22);
10781/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__unzip_js__ = __webpack_require__(208);
10782
10783
10784
10785// Zip together multiple lists into a single array -- elements that share
10786// an index go together.
10787/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__unzip_js__["a" /* default */]));
10788
10789
10790/***/ }),
10791/* 346 */
10792/***/ (function(module, __webpack_exports__, __webpack_require__) {
10793
10794"use strict";
10795/* harmony export (immutable) */ __webpack_exports__["a"] = object;
10796/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(27);
10797
10798
10799// Converts lists into objects. Pass either a single array of `[key, value]`
10800// pairs, or two parallel arrays of the same length -- one of keys, and one of
10801// the corresponding values. Passing by pairs is the reverse of `_.pairs`.
10802function object(list, values) {
10803 var result = {};
10804 for (var i = 0, length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(list); i < length; i++) {
10805 if (values) {
10806 result[list[i]] = values[i];
10807 } else {
10808 result[list[i][0]] = list[i][1];
10809 }
10810 }
10811 return result;
10812}
10813
10814
10815/***/ }),
10816/* 347 */
10817/***/ (function(module, __webpack_exports__, __webpack_require__) {
10818
10819"use strict";
10820/* harmony export (immutable) */ __webpack_exports__["a"] = range;
10821// Generate an integer Array containing an arithmetic progression. A port of
10822// the native Python `range()` function. See
10823// [the Python documentation](https://docs.python.org/library/functions.html#range).
10824function range(start, stop, step) {
10825 if (stop == null) {
10826 stop = start || 0;
10827 start = 0;
10828 }
10829 if (!step) {
10830 step = stop < start ? -1 : 1;
10831 }
10832
10833 var length = Math.max(Math.ceil((stop - start) / step), 0);
10834 var range = Array(length);
10835
10836 for (var idx = 0; idx < length; idx++, start += step) {
10837 range[idx] = start;
10838 }
10839
10840 return range;
10841}
10842
10843
10844/***/ }),
10845/* 348 */
10846/***/ (function(module, __webpack_exports__, __webpack_require__) {
10847
10848"use strict";
10849/* harmony export (immutable) */ __webpack_exports__["a"] = chunk;
10850/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(3);
10851
10852
10853// Chunk a single array into multiple arrays, each containing `count` or fewer
10854// items.
10855function chunk(array, count) {
10856 if (count == null || count < 1) return [];
10857 var result = [];
10858 var i = 0, length = array.length;
10859 while (i < length) {
10860 result.push(__WEBPACK_IMPORTED_MODULE_0__setup_js__["q" /* slice */].call(array, i, i += count));
10861 }
10862 return result;
10863}
10864
10865
10866/***/ }),
10867/* 349 */
10868/***/ (function(module, __webpack_exports__, __webpack_require__) {
10869
10870"use strict";
10871/* harmony export (immutable) */ __webpack_exports__["a"] = mixin;
10872/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(23);
10873/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__each_js__ = __webpack_require__(47);
10874/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__functions_js__ = __webpack_require__(175);
10875/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__setup_js__ = __webpack_require__(3);
10876/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__chainResult_js__ = __webpack_require__(209);
10877
10878
10879
10880
10881
10882
10883// Add your own custom functions to the Underscore object.
10884function mixin(obj) {
10885 Object(__WEBPACK_IMPORTED_MODULE_1__each_js__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_2__functions_js__["a" /* default */])(obj), function(name) {
10886 var func = __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */][name] = obj[name];
10887 __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].prototype[name] = function() {
10888 var args = [this._wrapped];
10889 __WEBPACK_IMPORTED_MODULE_3__setup_js__["o" /* push */].apply(args, arguments);
10890 return Object(__WEBPACK_IMPORTED_MODULE_4__chainResult_js__["a" /* default */])(this, func.apply(__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */], args));
10891 };
10892 });
10893 return __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */];
10894}
10895
10896
10897/***/ }),
10898/* 350 */
10899/***/ (function(module, __webpack_exports__, __webpack_require__) {
10900
10901"use strict";
10902/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(23);
10903/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__each_js__ = __webpack_require__(47);
10904/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__setup_js__ = __webpack_require__(3);
10905/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__chainResult_js__ = __webpack_require__(209);
10906
10907
10908
10909
10910
10911// Add all mutator `Array` functions to the wrapper.
10912Object(__WEBPACK_IMPORTED_MODULE_1__each_js__["a" /* default */])(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
10913 var method = __WEBPACK_IMPORTED_MODULE_2__setup_js__["a" /* ArrayProto */][name];
10914 __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].prototype[name] = function() {
10915 var obj = this._wrapped;
10916 if (obj != null) {
10917 method.apply(obj, arguments);
10918 if ((name === 'shift' || name === 'splice') && obj.length === 0) {
10919 delete obj[0];
10920 }
10921 }
10922 return Object(__WEBPACK_IMPORTED_MODULE_3__chainResult_js__["a" /* default */])(this, obj);
10923 };
10924});
10925
10926// Add all accessor `Array` functions to the wrapper.
10927Object(__WEBPACK_IMPORTED_MODULE_1__each_js__["a" /* default */])(['concat', 'join', 'slice'], function(name) {
10928 var method = __WEBPACK_IMPORTED_MODULE_2__setup_js__["a" /* ArrayProto */][name];
10929 __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].prototype[name] = function() {
10930 var obj = this._wrapped;
10931 if (obj != null) obj = method.apply(obj, arguments);
10932 return Object(__WEBPACK_IMPORTED_MODULE_3__chainResult_js__["a" /* default */])(this, obj);
10933 };
10934});
10935
10936/* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */]);
10937
10938
10939/***/ }),
10940/* 351 */
10941/***/ (function(module, exports, __webpack_require__) {
10942
10943var parent = __webpack_require__(352);
10944
10945module.exports = parent;
10946
10947
10948/***/ }),
10949/* 352 */
10950/***/ (function(module, exports, __webpack_require__) {
10951
10952var isPrototypeOf = __webpack_require__(20);
10953var method = __webpack_require__(353);
10954
10955var ArrayPrototype = Array.prototype;
10956
10957module.exports = function (it) {
10958 var own = it.concat;
10959 return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.concat) ? method : own;
10960};
10961
10962
10963/***/ }),
10964/* 353 */
10965/***/ (function(module, exports, __webpack_require__) {
10966
10967__webpack_require__(210);
10968var entryVirtual = __webpack_require__(38);
10969
10970module.exports = entryVirtual('Array').concat;
10971
10972
10973/***/ }),
10974/* 354 */
10975/***/ (function(module, exports) {
10976
10977var $TypeError = TypeError;
10978var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; // 2 ** 53 - 1 == 9007199254740991
10979
10980module.exports = function (it) {
10981 if (it > MAX_SAFE_INTEGER) throw $TypeError('Maximum allowed index exceeded');
10982 return it;
10983};
10984
10985
10986/***/ }),
10987/* 355 */
10988/***/ (function(module, exports, __webpack_require__) {
10989
10990var isArray = __webpack_require__(80);
10991var isConstructor = __webpack_require__(93);
10992var isObject = __webpack_require__(17);
10993var wellKnownSymbol = __webpack_require__(8);
10994
10995var SPECIES = wellKnownSymbol('species');
10996var $Array = Array;
10997
10998// a part of `ArraySpeciesCreate` abstract operation
10999// https://tc39.es/ecma262/#sec-arrayspeciescreate
11000module.exports = function (originalArray) {
11001 var C;
11002 if (isArray(originalArray)) {
11003 C = originalArray.constructor;
11004 // cross-realm fallback
11005 if (isConstructor(C) && (C === $Array || isArray(C.prototype))) C = undefined;
11006 else if (isObject(C)) {
11007 C = C[SPECIES];
11008 if (C === null) C = undefined;
11009 }
11010 } return C === undefined ? $Array : C;
11011};
11012
11013
11014/***/ }),
11015/* 356 */
11016/***/ (function(module, exports, __webpack_require__) {
11017
11018var parent = __webpack_require__(357);
11019
11020module.exports = parent;
11021
11022
11023/***/ }),
11024/* 357 */
11025/***/ (function(module, exports, __webpack_require__) {
11026
11027var isPrototypeOf = __webpack_require__(20);
11028var method = __webpack_require__(358);
11029
11030var ArrayPrototype = Array.prototype;
11031
11032module.exports = function (it) {
11033 var own = it.map;
11034 return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.map) ? method : own;
11035};
11036
11037
11038/***/ }),
11039/* 358 */
11040/***/ (function(module, exports, __webpack_require__) {
11041
11042__webpack_require__(359);
11043var entryVirtual = __webpack_require__(38);
11044
11045module.exports = entryVirtual('Array').map;
11046
11047
11048/***/ }),
11049/* 359 */
11050/***/ (function(module, exports, __webpack_require__) {
11051
11052"use strict";
11053
11054var $ = __webpack_require__(0);
11055var $map = __webpack_require__(101).map;
11056var arrayMethodHasSpeciesSupport = __webpack_require__(100);
11057
11058var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map');
11059
11060// `Array.prototype.map` method
11061// https://tc39.es/ecma262/#sec-array.prototype.map
11062// with adding support of @@species
11063$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
11064 map: function map(callbackfn /* , thisArg */) {
11065 return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
11066 }
11067});
11068
11069
11070/***/ }),
11071/* 360 */
11072/***/ (function(module, exports, __webpack_require__) {
11073
11074var parent = __webpack_require__(361);
11075
11076module.exports = parent;
11077
11078
11079/***/ }),
11080/* 361 */
11081/***/ (function(module, exports, __webpack_require__) {
11082
11083__webpack_require__(362);
11084var path = __webpack_require__(13);
11085
11086module.exports = path.Object.keys;
11087
11088
11089/***/ }),
11090/* 362 */
11091/***/ (function(module, exports, __webpack_require__) {
11092
11093var $ = __webpack_require__(0);
11094var toObject = __webpack_require__(35);
11095var nativeKeys = __webpack_require__(116);
11096var fails = __webpack_require__(4);
11097
11098var FAILS_ON_PRIMITIVES = fails(function () { nativeKeys(1); });
11099
11100// `Object.keys` method
11101// https://tc39.es/ecma262/#sec-object.keys
11102$({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
11103 keys: function keys(it) {
11104 return nativeKeys(toObject(it));
11105 }
11106});
11107
11108
11109/***/ }),
11110/* 363 */
11111/***/ (function(module, exports, __webpack_require__) {
11112
11113var parent = __webpack_require__(364);
11114
11115module.exports = parent;
11116
11117
11118/***/ }),
11119/* 364 */
11120/***/ (function(module, exports, __webpack_require__) {
11121
11122__webpack_require__(213);
11123var path = __webpack_require__(13);
11124var apply = __webpack_require__(62);
11125
11126// eslint-disable-next-line es-x/no-json -- safe
11127if (!path.JSON) path.JSON = { stringify: JSON.stringify };
11128
11129// eslint-disable-next-line no-unused-vars -- required for `.length`
11130module.exports = function stringify(it, replacer, space) {
11131 return apply(path.JSON.stringify, null, arguments);
11132};
11133
11134
11135/***/ }),
11136/* 365 */
11137/***/ (function(module, exports, __webpack_require__) {
11138
11139var parent = __webpack_require__(366);
11140
11141module.exports = parent;
11142
11143
11144/***/ }),
11145/* 366 */
11146/***/ (function(module, exports, __webpack_require__) {
11147
11148var isPrototypeOf = __webpack_require__(20);
11149var method = __webpack_require__(367);
11150
11151var ArrayPrototype = Array.prototype;
11152
11153module.exports = function (it) {
11154 var own = it.indexOf;
11155 return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.indexOf) ? method : own;
11156};
11157
11158
11159/***/ }),
11160/* 367 */
11161/***/ (function(module, exports, __webpack_require__) {
11162
11163__webpack_require__(368);
11164var entryVirtual = __webpack_require__(38);
11165
11166module.exports = entryVirtual('Array').indexOf;
11167
11168
11169/***/ }),
11170/* 368 */
11171/***/ (function(module, exports, __webpack_require__) {
11172
11173"use strict";
11174
11175/* eslint-disable es-x/no-array-prototype-indexof -- required for testing */
11176var $ = __webpack_require__(0);
11177var uncurryThis = __webpack_require__(6);
11178var $IndexOf = __webpack_require__(146).indexOf;
11179var arrayMethodIsStrict = __webpack_require__(369);
11180
11181var un$IndexOf = uncurryThis([].indexOf);
11182
11183var NEGATIVE_ZERO = !!un$IndexOf && 1 / un$IndexOf([1], 1, -0) < 0;
11184var STRICT_METHOD = arrayMethodIsStrict('indexOf');
11185
11186// `Array.prototype.indexOf` method
11187// https://tc39.es/ecma262/#sec-array.prototype.indexof
11188$({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD }, {
11189 indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
11190 var fromIndex = arguments.length > 1 ? arguments[1] : undefined;
11191 return NEGATIVE_ZERO
11192 // convert -0 to +0
11193 ? un$IndexOf(this, searchElement, fromIndex) || 0
11194 : $IndexOf(this, searchElement, fromIndex);
11195 }
11196});
11197
11198
11199/***/ }),
11200/* 369 */
11201/***/ (function(module, exports, __webpack_require__) {
11202
11203"use strict";
11204
11205var fails = __webpack_require__(4);
11206
11207module.exports = function (METHOD_NAME, argument) {
11208 var method = [][METHOD_NAME];
11209 return !!method && fails(function () {
11210 // eslint-disable-next-line no-useless-call -- required for testing
11211 method.call(null, argument || function () { return 1; }, 1);
11212 });
11213};
11214
11215
11216/***/ }),
11217/* 370 */
11218/***/ (function(module, exports, __webpack_require__) {
11219
11220__webpack_require__(73);
11221var classof = __webpack_require__(53);
11222var hasOwn = __webpack_require__(14);
11223var isPrototypeOf = __webpack_require__(20);
11224var method = __webpack_require__(371);
11225
11226var ArrayPrototype = Array.prototype;
11227
11228var DOMIterables = {
11229 DOMTokenList: true,
11230 NodeList: true
11231};
11232
11233module.exports = function (it) {
11234 var own = it.keys;
11235 return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.keys)
11236 || hasOwn(DOMIterables, classof(it)) ? method : own;
11237};
11238
11239
11240/***/ }),
11241/* 371 */
11242/***/ (function(module, exports, __webpack_require__) {
11243
11244var parent = __webpack_require__(372);
11245
11246module.exports = parent;
11247
11248
11249/***/ }),
11250/* 372 */
11251/***/ (function(module, exports, __webpack_require__) {
11252
11253__webpack_require__(70);
11254__webpack_require__(92);
11255var entryVirtual = __webpack_require__(38);
11256
11257module.exports = entryVirtual('Array').keys;
11258
11259
11260/***/ }),
11261/* 373 */
11262/***/ (function(module, exports) {
11263
11264// Unique ID creation requires a high quality random # generator. In the
11265// browser this is a little complicated due to unknown quality of Math.random()
11266// and inconsistent support for the `crypto` API. We do the best we can via
11267// feature-detection
11268
11269// getRandomValues needs to be invoked in a context where "this" is a Crypto
11270// implementation. Also, find the complete implementation of crypto on IE11.
11271var getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||
11272 (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));
11273
11274if (getRandomValues) {
11275 // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto
11276 var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef
11277
11278 module.exports = function whatwgRNG() {
11279 getRandomValues(rnds8);
11280 return rnds8;
11281 };
11282} else {
11283 // Math.random()-based (RNG)
11284 //
11285 // If all else fails, use Math.random(). It's fast, but is of unspecified
11286 // quality.
11287 var rnds = new Array(16);
11288
11289 module.exports = function mathRNG() {
11290 for (var i = 0, r; i < 16; i++) {
11291 if ((i & 0x03) === 0) r = Math.random() * 0x100000000;
11292 rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;
11293 }
11294
11295 return rnds;
11296 };
11297}
11298
11299
11300/***/ }),
11301/* 374 */
11302/***/ (function(module, exports) {
11303
11304/**
11305 * Convert array of 16 byte values to UUID string format of the form:
11306 * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
11307 */
11308var byteToHex = [];
11309for (var i = 0; i < 256; ++i) {
11310 byteToHex[i] = (i + 0x100).toString(16).substr(1);
11311}
11312
11313function bytesToUuid(buf, offset) {
11314 var i = offset || 0;
11315 var bth = byteToHex;
11316 // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
11317 return ([bth[buf[i++]], bth[buf[i++]],
11318 bth[buf[i++]], bth[buf[i++]], '-',
11319 bth[buf[i++]], bth[buf[i++]], '-',
11320 bth[buf[i++]], bth[buf[i++]], '-',
11321 bth[buf[i++]], bth[buf[i++]], '-',
11322 bth[buf[i++]], bth[buf[i++]],
11323 bth[buf[i++]], bth[buf[i++]],
11324 bth[buf[i++]], bth[buf[i++]]]).join('');
11325}
11326
11327module.exports = bytesToUuid;
11328
11329
11330/***/ }),
11331/* 375 */
11332/***/ (function(module, exports, __webpack_require__) {
11333
11334"use strict";
11335
11336
11337/**
11338 * This is the common logic for both the Node.js and web browser
11339 * implementations of `debug()`.
11340 */
11341function setup(env) {
11342 createDebug.debug = createDebug;
11343 createDebug.default = createDebug;
11344 createDebug.coerce = coerce;
11345 createDebug.disable = disable;
11346 createDebug.enable = enable;
11347 createDebug.enabled = enabled;
11348 createDebug.humanize = __webpack_require__(376);
11349 Object.keys(env).forEach(function (key) {
11350 createDebug[key] = env[key];
11351 });
11352 /**
11353 * Active `debug` instances.
11354 */
11355
11356 createDebug.instances = [];
11357 /**
11358 * The currently active debug mode names, and names to skip.
11359 */
11360
11361 createDebug.names = [];
11362 createDebug.skips = [];
11363 /**
11364 * Map of special "%n" handling functions, for the debug "format" argument.
11365 *
11366 * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
11367 */
11368
11369 createDebug.formatters = {};
11370 /**
11371 * Selects a color for a debug namespace
11372 * @param {String} namespace The namespace string for the for the debug instance to be colored
11373 * @return {Number|String} An ANSI color code for the given namespace
11374 * @api private
11375 */
11376
11377 function selectColor(namespace) {
11378 var hash = 0;
11379
11380 for (var i = 0; i < namespace.length; i++) {
11381 hash = (hash << 5) - hash + namespace.charCodeAt(i);
11382 hash |= 0; // Convert to 32bit integer
11383 }
11384
11385 return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
11386 }
11387
11388 createDebug.selectColor = selectColor;
11389 /**
11390 * Create a debugger with the given `namespace`.
11391 *
11392 * @param {String} namespace
11393 * @return {Function}
11394 * @api public
11395 */
11396
11397 function createDebug(namespace) {
11398 var prevTime;
11399
11400 function debug() {
11401 // Disabled?
11402 if (!debug.enabled) {
11403 return;
11404 }
11405
11406 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
11407 args[_key] = arguments[_key];
11408 }
11409
11410 var self = debug; // Set `diff` timestamp
11411
11412 var curr = Number(new Date());
11413 var ms = curr - (prevTime || curr);
11414 self.diff = ms;
11415 self.prev = prevTime;
11416 self.curr = curr;
11417 prevTime = curr;
11418 args[0] = createDebug.coerce(args[0]);
11419
11420 if (typeof args[0] !== 'string') {
11421 // Anything else let's inspect with %O
11422 args.unshift('%O');
11423 } // Apply any `formatters` transformations
11424
11425
11426 var index = 0;
11427 args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) {
11428 // If we encounter an escaped % then don't increase the array index
11429 if (match === '%%') {
11430 return match;
11431 }
11432
11433 index++;
11434 var formatter = createDebug.formatters[format];
11435
11436 if (typeof formatter === 'function') {
11437 var val = args[index];
11438 match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format`
11439
11440 args.splice(index, 1);
11441 index--;
11442 }
11443
11444 return match;
11445 }); // Apply env-specific formatting (colors, etc.)
11446
11447 createDebug.formatArgs.call(self, args);
11448 var logFn = self.log || createDebug.log;
11449 logFn.apply(self, args);
11450 }
11451
11452 debug.namespace = namespace;
11453 debug.enabled = createDebug.enabled(namespace);
11454 debug.useColors = createDebug.useColors();
11455 debug.color = selectColor(namespace);
11456 debug.destroy = destroy;
11457 debug.extend = extend; // Debug.formatArgs = formatArgs;
11458 // debug.rawLog = rawLog;
11459 // env-specific initialization logic for debug instances
11460
11461 if (typeof createDebug.init === 'function') {
11462 createDebug.init(debug);
11463 }
11464
11465 createDebug.instances.push(debug);
11466 return debug;
11467 }
11468
11469 function destroy() {
11470 var index = createDebug.instances.indexOf(this);
11471
11472 if (index !== -1) {
11473 createDebug.instances.splice(index, 1);
11474 return true;
11475 }
11476
11477 return false;
11478 }
11479
11480 function extend(namespace, delimiter) {
11481 return createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
11482 }
11483 /**
11484 * Enables a debug mode by namespaces. This can include modes
11485 * separated by a colon and wildcards.
11486 *
11487 * @param {String} namespaces
11488 * @api public
11489 */
11490
11491
11492 function enable(namespaces) {
11493 createDebug.save(namespaces);
11494 createDebug.names = [];
11495 createDebug.skips = [];
11496 var i;
11497 var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
11498 var len = split.length;
11499
11500 for (i = 0; i < len; i++) {
11501 if (!split[i]) {
11502 // ignore empty strings
11503 continue;
11504 }
11505
11506 namespaces = split[i].replace(/\*/g, '.*?');
11507
11508 if (namespaces[0] === '-') {
11509 createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
11510 } else {
11511 createDebug.names.push(new RegExp('^' + namespaces + '$'));
11512 }
11513 }
11514
11515 for (i = 0; i < createDebug.instances.length; i++) {
11516 var instance = createDebug.instances[i];
11517 instance.enabled = createDebug.enabled(instance.namespace);
11518 }
11519 }
11520 /**
11521 * Disable debug output.
11522 *
11523 * @api public
11524 */
11525
11526
11527 function disable() {
11528 createDebug.enable('');
11529 }
11530 /**
11531 * Returns true if the given mode name is enabled, false otherwise.
11532 *
11533 * @param {String} name
11534 * @return {Boolean}
11535 * @api public
11536 */
11537
11538
11539 function enabled(name) {
11540 if (name[name.length - 1] === '*') {
11541 return true;
11542 }
11543
11544 var i;
11545 var len;
11546
11547 for (i = 0, len = createDebug.skips.length; i < len; i++) {
11548 if (createDebug.skips[i].test(name)) {
11549 return false;
11550 }
11551 }
11552
11553 for (i = 0, len = createDebug.names.length; i < len; i++) {
11554 if (createDebug.names[i].test(name)) {
11555 return true;
11556 }
11557 }
11558
11559 return false;
11560 }
11561 /**
11562 * Coerce `val`.
11563 *
11564 * @param {Mixed} val
11565 * @return {Mixed}
11566 * @api private
11567 */
11568
11569
11570 function coerce(val) {
11571 if (val instanceof Error) {
11572 return val.stack || val.message;
11573 }
11574
11575 return val;
11576 }
11577
11578 createDebug.enable(createDebug.load());
11579 return createDebug;
11580}
11581
11582module.exports = setup;
11583
11584
11585
11586/***/ }),
11587/* 376 */
11588/***/ (function(module, exports) {
11589
11590/**
11591 * Helpers.
11592 */
11593
11594var s = 1000;
11595var m = s * 60;
11596var h = m * 60;
11597var d = h * 24;
11598var w = d * 7;
11599var y = d * 365.25;
11600
11601/**
11602 * Parse or format the given `val`.
11603 *
11604 * Options:
11605 *
11606 * - `long` verbose formatting [false]
11607 *
11608 * @param {String|Number} val
11609 * @param {Object} [options]
11610 * @throws {Error} throw an error if val is not a non-empty string or a number
11611 * @return {String|Number}
11612 * @api public
11613 */
11614
11615module.exports = function(val, options) {
11616 options = options || {};
11617 var type = typeof val;
11618 if (type === 'string' && val.length > 0) {
11619 return parse(val);
11620 } else if (type === 'number' && isFinite(val)) {
11621 return options.long ? fmtLong(val) : fmtShort(val);
11622 }
11623 throw new Error(
11624 'val is not a non-empty string or a valid number. val=' +
11625 JSON.stringify(val)
11626 );
11627};
11628
11629/**
11630 * Parse the given `str` and return milliseconds.
11631 *
11632 * @param {String} str
11633 * @return {Number}
11634 * @api private
11635 */
11636
11637function parse(str) {
11638 str = String(str);
11639 if (str.length > 100) {
11640 return;
11641 }
11642 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(
11643 str
11644 );
11645 if (!match) {
11646 return;
11647 }
11648 var n = parseFloat(match[1]);
11649 var type = (match[2] || 'ms').toLowerCase();
11650 switch (type) {
11651 case 'years':
11652 case 'year':
11653 case 'yrs':
11654 case 'yr':
11655 case 'y':
11656 return n * y;
11657 case 'weeks':
11658 case 'week':
11659 case 'w':
11660 return n * w;
11661 case 'days':
11662 case 'day':
11663 case 'd':
11664 return n * d;
11665 case 'hours':
11666 case 'hour':
11667 case 'hrs':
11668 case 'hr':
11669 case 'h':
11670 return n * h;
11671 case 'minutes':
11672 case 'minute':
11673 case 'mins':
11674 case 'min':
11675 case 'm':
11676 return n * m;
11677 case 'seconds':
11678 case 'second':
11679 case 'secs':
11680 case 'sec':
11681 case 's':
11682 return n * s;
11683 case 'milliseconds':
11684 case 'millisecond':
11685 case 'msecs':
11686 case 'msec':
11687 case 'ms':
11688 return n;
11689 default:
11690 return undefined;
11691 }
11692}
11693
11694/**
11695 * Short format for `ms`.
11696 *
11697 * @param {Number} ms
11698 * @return {String}
11699 * @api private
11700 */
11701
11702function fmtShort(ms) {
11703 var msAbs = Math.abs(ms);
11704 if (msAbs >= d) {
11705 return Math.round(ms / d) + 'd';
11706 }
11707 if (msAbs >= h) {
11708 return Math.round(ms / h) + 'h';
11709 }
11710 if (msAbs >= m) {
11711 return Math.round(ms / m) + 'm';
11712 }
11713 if (msAbs >= s) {
11714 return Math.round(ms / s) + 's';
11715 }
11716 return ms + 'ms';
11717}
11718
11719/**
11720 * Long format for `ms`.
11721 *
11722 * @param {Number} ms
11723 * @return {String}
11724 * @api private
11725 */
11726
11727function fmtLong(ms) {
11728 var msAbs = Math.abs(ms);
11729 if (msAbs >= d) {
11730 return plural(ms, msAbs, d, 'day');
11731 }
11732 if (msAbs >= h) {
11733 return plural(ms, msAbs, h, 'hour');
11734 }
11735 if (msAbs >= m) {
11736 return plural(ms, msAbs, m, 'minute');
11737 }
11738 if (msAbs >= s) {
11739 return plural(ms, msAbs, s, 'second');
11740 }
11741 return ms + ' ms';
11742}
11743
11744/**
11745 * Pluralization helper.
11746 */
11747
11748function plural(ms, msAbs, n, name) {
11749 var isPlural = msAbs >= n * 1.5;
11750 return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
11751}
11752
11753
11754/***/ }),
11755/* 377 */
11756/***/ (function(module, exports, __webpack_require__) {
11757
11758__webpack_require__(378);
11759var path = __webpack_require__(13);
11760
11761module.exports = path.Object.getPrototypeOf;
11762
11763
11764/***/ }),
11765/* 378 */
11766/***/ (function(module, exports, __webpack_require__) {
11767
11768var $ = __webpack_require__(0);
11769var fails = __webpack_require__(4);
11770var toObject = __webpack_require__(35);
11771var nativeGetPrototypeOf = __webpack_require__(86);
11772var CORRECT_PROTOTYPE_GETTER = __webpack_require__(144);
11773
11774var FAILS_ON_PRIMITIVES = fails(function () { nativeGetPrototypeOf(1); });
11775
11776// `Object.getPrototypeOf` method
11777// https://tc39.es/ecma262/#sec-object.getprototypeof
11778$({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !CORRECT_PROTOTYPE_GETTER }, {
11779 getPrototypeOf: function getPrototypeOf(it) {
11780 return nativeGetPrototypeOf(toObject(it));
11781 }
11782});
11783
11784
11785
11786/***/ }),
11787/* 379 */
11788/***/ (function(module, exports, __webpack_require__) {
11789
11790module.exports = __webpack_require__(221);
11791
11792/***/ }),
11793/* 380 */
11794/***/ (function(module, exports, __webpack_require__) {
11795
11796__webpack_require__(381);
11797var path = __webpack_require__(13);
11798
11799module.exports = path.Object.setPrototypeOf;
11800
11801
11802/***/ }),
11803/* 381 */
11804/***/ (function(module, exports, __webpack_require__) {
11805
11806var $ = __webpack_require__(0);
11807var setPrototypeOf = __webpack_require__(88);
11808
11809// `Object.setPrototypeOf` method
11810// https://tc39.es/ecma262/#sec-object.setprototypeof
11811$({ target: 'Object', stat: true }, {
11812 setPrototypeOf: setPrototypeOf
11813});
11814
11815
11816/***/ }),
11817/* 382 */
11818/***/ (function(module, exports, __webpack_require__) {
11819
11820"use strict";
11821
11822
11823var _interopRequireDefault = __webpack_require__(2);
11824
11825var _slice = _interopRequireDefault(__webpack_require__(81));
11826
11827var _concat = _interopRequireDefault(__webpack_require__(29));
11828
11829var _defineProperty = _interopRequireDefault(__webpack_require__(223));
11830
11831var AV = __webpack_require__(59);
11832
11833var AppRouter = __webpack_require__(388);
11834
11835var _require = __webpack_require__(28),
11836 isNullOrUndefined = _require.isNullOrUndefined;
11837
11838var _require2 = __webpack_require__(1),
11839 extend = _require2.extend,
11840 isObject = _require2.isObject,
11841 isEmpty = _require2.isEmpty;
11842
11843var isCNApp = function isCNApp(appId) {
11844 return (0, _slice.default)(appId).call(appId, -9) !== '-MdYXbMMI';
11845};
11846
11847var fillServerURLs = function fillServerURLs(url) {
11848 return {
11849 push: url,
11850 stats: url,
11851 engine: url,
11852 api: url,
11853 rtm: url
11854 };
11855};
11856
11857function getDefaultServerURLs(appId) {
11858 var _context, _context2, _context3, _context4, _context5;
11859
11860 if (isCNApp(appId)) {
11861 return {};
11862 }
11863
11864 var id = (0, _slice.default)(appId).call(appId, 0, 8).toLowerCase();
11865 var domain = 'lncldglobal.com';
11866 return {
11867 push: (0, _concat.default)(_context = "https://".concat(id, ".push.")).call(_context, domain),
11868 stats: (0, _concat.default)(_context2 = "https://".concat(id, ".stats.")).call(_context2, domain),
11869 engine: (0, _concat.default)(_context3 = "https://".concat(id, ".engine.")).call(_context3, domain),
11870 api: (0, _concat.default)(_context4 = "https://".concat(id, ".api.")).call(_context4, domain),
11871 rtm: (0, _concat.default)(_context5 = "https://".concat(id, ".rtm.")).call(_context5, domain)
11872 };
11873}
11874
11875var _disableAppRouter = false;
11876var _initialized = false;
11877/**
11878 * URLs for services
11879 * @typedef {Object} ServerURLs
11880 * @property {String} [api] serverURL for API service
11881 * @property {String} [engine] serverURL for engine service
11882 * @property {String} [stats] serverURL for stats service
11883 * @property {String} [push] serverURL for push service
11884 * @property {String} [rtm] serverURL for LiveQuery service
11885 */
11886
11887/**
11888 * Call this method first to set up your authentication tokens for AV.
11889 * You can get your app keys from the LeanCloud dashboard on http://leancloud.cn .
11890 * @function AV.init
11891 * @param {Object} options
11892 * @param {String} options.appId application id
11893 * @param {String} options.appKey application key
11894 * @param {String} [options.masterKey] application master key
11895 * @param {Boolean} [options.production]
11896 * @param {String|ServerURLs} [options.serverURL] URLs for services. if a string was given, it will be applied for all services.
11897 * @param {Boolean} [options.disableCurrentUser]
11898 */
11899
11900AV.init = function init(options) {
11901 if (!isObject(options)) {
11902 return AV.init({
11903 appId: options,
11904 appKey: arguments.length <= 1 ? undefined : arguments[1],
11905 masterKey: arguments.length <= 2 ? undefined : arguments[2]
11906 });
11907 }
11908
11909 var appId = options.appId,
11910 appKey = options.appKey,
11911 masterKey = options.masterKey,
11912 hookKey = options.hookKey,
11913 serverURL = options.serverURL,
11914 _options$serverURLs = options.serverURLs,
11915 serverURLs = _options$serverURLs === void 0 ? serverURL : _options$serverURLs,
11916 disableCurrentUser = options.disableCurrentUser,
11917 production = options.production,
11918 realtime = options.realtime;
11919 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.');
11920 if (!appId) throw new TypeError('appId must be a string');
11921 if (!appKey) throw new TypeError('appKey must be a string');
11922 if (undefined !== 'NODE_JS' && masterKey) console.warn('MasterKey is not supposed to be used at client side.');
11923
11924 if (isCNApp(appId)) {
11925 if (!serverURLs && isEmpty(AV._config.serverURLs)) {
11926 throw new TypeError("serverURL option is required for apps from CN region");
11927 }
11928 }
11929
11930 if (appId !== AV._config.applicationId) {
11931 // overwrite all keys when reinitializing as a new app
11932 AV._config.masterKey = masterKey;
11933 AV._config.hookKey = hookKey;
11934 } else {
11935 if (masterKey) AV._config.masterKey = masterKey;
11936 if (hookKey) AV._config.hookKey = hookKey;
11937 }
11938
11939 AV._config.applicationId = appId;
11940 AV._config.applicationKey = appKey;
11941
11942 if (!isNullOrUndefined(production)) {
11943 AV.setProduction(production);
11944 }
11945
11946 if (typeof disableCurrentUser !== 'undefined') AV._config.disableCurrentUser = disableCurrentUser;
11947 var disableAppRouter = _disableAppRouter || typeof serverURLs !== 'undefined';
11948
11949 if (!disableAppRouter) {
11950 AV._appRouter = new AppRouter(AV);
11951 }
11952
11953 AV._setServerURLs(extend({}, getDefaultServerURLs(appId), AV._config.serverURLs, typeof serverURLs === 'string' ? fillServerURLs(serverURLs) : serverURLs), disableAppRouter);
11954
11955 if (realtime) {
11956 AV._config.realtime = realtime;
11957 } else if (AV._sharedConfig.liveQueryRealtime) {
11958 var _AV$_config$serverURL = AV._config.serverURLs,
11959 api = _AV$_config$serverURL.api,
11960 rtm = _AV$_config$serverURL.rtm;
11961 AV._config.realtime = new AV._sharedConfig.liveQueryRealtime({
11962 appId: appId,
11963 appKey: appKey,
11964 server: {
11965 api: api,
11966 RTMRouter: rtm
11967 }
11968 });
11969 }
11970
11971 _initialized = true;
11972}; // If we're running in node.js, allow using the master key.
11973
11974
11975if (undefined === 'NODE_JS') {
11976 AV.Cloud = AV.Cloud || {};
11977 /**
11978 * Switches the LeanCloud SDK to using the Master key. The Master key grants
11979 * priveleged access to the data in LeanCloud and can be used to bypass ACLs and
11980 * other restrictions that are applied to the client SDKs.
11981 * <p><strong><em>Available in Cloud Code and Node.js only.</em></strong>
11982 * </p>
11983 */
11984
11985 AV.Cloud.useMasterKey = function () {
11986 AV._config.useMasterKey = true;
11987 };
11988}
11989/**
11990 * Call this method to set production environment variable.
11991 * @function AV.setProduction
11992 * @param {Boolean} production True is production environment,and
11993 * it's true by default.
11994 */
11995
11996
11997AV.setProduction = function (production) {
11998 if (!isNullOrUndefined(production)) {
11999 AV._config.production = production ? 1 : 0;
12000 } else {
12001 // change to default value
12002 AV._config.production = null;
12003 }
12004};
12005
12006AV._setServerURLs = function (urls) {
12007 var disableAppRouter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
12008
12009 if (typeof urls !== 'string') {
12010 extend(AV._config.serverURLs, urls);
12011 } else {
12012 AV._config.serverURLs = fillServerURLs(urls);
12013 }
12014
12015 if (disableAppRouter) {
12016 if (AV._appRouter) {
12017 AV._appRouter.disable();
12018 } else {
12019 _disableAppRouter = true;
12020 }
12021 }
12022};
12023/**
12024 * Set server URLs for services.
12025 * @function AV.setServerURL
12026 * @since 4.3.0
12027 * @param {String|ServerURLs} urls URLs for services. if a string was given, it will be applied for all services.
12028 * You can also set them when initializing SDK with `options.serverURL`
12029 */
12030
12031
12032AV.setServerURL = function (urls) {
12033 return AV._setServerURLs(urls);
12034};
12035
12036AV.setServerURLs = AV.setServerURL;
12037
12038AV.keepErrorRawMessage = function (value) {
12039 AV._sharedConfig.keepErrorRawMessage = value;
12040};
12041/**
12042 * Set a deadline for requests to complete.
12043 * Note that file upload requests are not affected.
12044 * @function AV.setRequestTimeout
12045 * @since 3.6.0
12046 * @param {number} ms
12047 */
12048
12049
12050AV.setRequestTimeout = function (ms) {
12051 AV._config.requestTimeout = ms;
12052}; // backword compatible
12053
12054
12055AV.initialize = AV.init;
12056
12057var defineConfig = function defineConfig(property) {
12058 return (0, _defineProperty.default)(AV, property, {
12059 get: function get() {
12060 return AV._config[property];
12061 },
12062 set: function set(value) {
12063 AV._config[property] = value;
12064 }
12065 });
12066};
12067
12068['applicationId', 'applicationKey', 'masterKey', 'hookKey'].forEach(defineConfig);
12069
12070/***/ }),
12071/* 383 */
12072/***/ (function(module, exports, __webpack_require__) {
12073
12074var isPrototypeOf = __webpack_require__(20);
12075var method = __webpack_require__(384);
12076
12077var ArrayPrototype = Array.prototype;
12078
12079module.exports = function (it) {
12080 var own = it.slice;
12081 return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.slice) ? method : own;
12082};
12083
12084
12085/***/ }),
12086/* 384 */
12087/***/ (function(module, exports, __webpack_require__) {
12088
12089__webpack_require__(385);
12090var entryVirtual = __webpack_require__(38);
12091
12092module.exports = entryVirtual('Array').slice;
12093
12094
12095/***/ }),
12096/* 385 */
12097/***/ (function(module, exports, __webpack_require__) {
12098
12099"use strict";
12100
12101var $ = __webpack_require__(0);
12102var isArray = __webpack_require__(80);
12103var isConstructor = __webpack_require__(93);
12104var isObject = __webpack_require__(17);
12105var toAbsoluteIndex = __webpack_require__(112);
12106var lengthOfArrayLike = __webpack_require__(42);
12107var toIndexedObject = __webpack_require__(33);
12108var createProperty = __webpack_require__(99);
12109var wellKnownSymbol = __webpack_require__(8);
12110var arrayMethodHasSpeciesSupport = __webpack_require__(100);
12111var un$Slice = __webpack_require__(94);
12112
12113var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice');
12114
12115var SPECIES = wellKnownSymbol('species');
12116var $Array = Array;
12117var max = Math.max;
12118
12119// `Array.prototype.slice` method
12120// https://tc39.es/ecma262/#sec-array.prototype.slice
12121// fallback for not array-like ES3 strings and DOM objects
12122$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
12123 slice: function slice(start, end) {
12124 var O = toIndexedObject(this);
12125 var length = lengthOfArrayLike(O);
12126 var k = toAbsoluteIndex(start, length);
12127 var fin = toAbsoluteIndex(end === undefined ? length : end, length);
12128 // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
12129 var Constructor, result, n;
12130 if (isArray(O)) {
12131 Constructor = O.constructor;
12132 // cross-realm fallback
12133 if (isConstructor(Constructor) && (Constructor === $Array || isArray(Constructor.prototype))) {
12134 Constructor = undefined;
12135 } else if (isObject(Constructor)) {
12136 Constructor = Constructor[SPECIES];
12137 if (Constructor === null) Constructor = undefined;
12138 }
12139 if (Constructor === $Array || Constructor === undefined) {
12140 return un$Slice(O, k, fin);
12141 }
12142 }
12143 result = new (Constructor === undefined ? $Array : Constructor)(max(fin - k, 0));
12144 for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
12145 result.length = n;
12146 return result;
12147 }
12148});
12149
12150
12151/***/ }),
12152/* 386 */
12153/***/ (function(module, exports, __webpack_require__) {
12154
12155__webpack_require__(387);
12156var path = __webpack_require__(13);
12157
12158var Object = path.Object;
12159
12160var defineProperty = module.exports = function defineProperty(it, key, desc) {
12161 return Object.defineProperty(it, key, desc);
12162};
12163
12164if (Object.defineProperty.sham) defineProperty.sham = true;
12165
12166
12167/***/ }),
12168/* 387 */
12169/***/ (function(module, exports, __webpack_require__) {
12170
12171var $ = __webpack_require__(0);
12172var DESCRIPTORS = __webpack_require__(19);
12173var defineProperty = __webpack_require__(32).f;
12174
12175// `Object.defineProperty` method
12176// https://tc39.es/ecma262/#sec-object.defineproperty
12177// eslint-disable-next-line es-x/no-object-defineproperty -- safe
12178$({ target: 'Object', stat: true, forced: Object.defineProperty !== defineProperty, sham: !DESCRIPTORS }, {
12179 defineProperty: defineProperty
12180});
12181
12182
12183/***/ }),
12184/* 388 */
12185/***/ (function(module, exports, __webpack_require__) {
12186
12187"use strict";
12188
12189
12190var ajax = __webpack_require__(103);
12191
12192var Cache = __webpack_require__(220);
12193
12194function AppRouter(AV) {
12195 var _this = this;
12196
12197 this.AV = AV;
12198 this.lockedUntil = 0;
12199 Cache.getAsync('serverURLs').then(function (data) {
12200 if (_this.disabled) return;
12201 if (!data) return _this.lock(0);
12202 var serverURLs = data.serverURLs,
12203 lockedUntil = data.lockedUntil;
12204
12205 _this.AV._setServerURLs(serverURLs, false);
12206
12207 _this.lockedUntil = lockedUntil;
12208 }).catch(function () {
12209 return _this.lock(0);
12210 });
12211}
12212
12213AppRouter.prototype.disable = function disable() {
12214 this.disabled = true;
12215};
12216
12217AppRouter.prototype.lock = function lock(ttl) {
12218 this.lockedUntil = Date.now() + ttl;
12219};
12220
12221AppRouter.prototype.refresh = function refresh() {
12222 var _this2 = this;
12223
12224 if (this.disabled) return;
12225 if (Date.now() < this.lockedUntil) return;
12226 this.lock(10);
12227 var url = 'https://app-router.com/2/route';
12228 return ajax({
12229 method: 'get',
12230 url: url,
12231 query: {
12232 appId: this.AV.applicationId
12233 }
12234 }).then(function (servers) {
12235 if (_this2.disabled) return;
12236 var ttl = servers.ttl;
12237 if (!ttl) throw new Error('missing ttl');
12238 ttl = ttl * 1000;
12239 var protocal = 'https://';
12240 var serverURLs = {
12241 push: protocal + servers.push_server,
12242 stats: protocal + servers.stats_server,
12243 engine: protocal + servers.engine_server,
12244 api: protocal + servers.api_server
12245 };
12246
12247 _this2.AV._setServerURLs(serverURLs, false);
12248
12249 _this2.lock(ttl);
12250
12251 return Cache.setAsync('serverURLs', {
12252 serverURLs: serverURLs,
12253 lockedUntil: _this2.lockedUntil
12254 }, ttl);
12255 }).catch(function (error) {
12256 // bypass all errors
12257 console.warn("refresh server URLs failed: ".concat(error.message));
12258
12259 _this2.lock(600);
12260 });
12261};
12262
12263module.exports = AppRouter;
12264
12265/***/ }),
12266/* 389 */
12267/***/ (function(module, exports, __webpack_require__) {
12268
12269module.exports = __webpack_require__(390);
12270
12271
12272/***/ }),
12273/* 390 */
12274/***/ (function(module, exports, __webpack_require__) {
12275
12276var parent = __webpack_require__(391);
12277__webpack_require__(416);
12278__webpack_require__(417);
12279__webpack_require__(418);
12280__webpack_require__(419);
12281__webpack_require__(420);
12282// TODO: Remove from `core-js@4`
12283__webpack_require__(421);
12284__webpack_require__(422);
12285__webpack_require__(423);
12286
12287module.exports = parent;
12288
12289
12290/***/ }),
12291/* 391 */
12292/***/ (function(module, exports, __webpack_require__) {
12293
12294var parent = __webpack_require__(226);
12295
12296module.exports = parent;
12297
12298
12299/***/ }),
12300/* 392 */
12301/***/ (function(module, exports, __webpack_require__) {
12302
12303__webpack_require__(210);
12304__webpack_require__(92);
12305__webpack_require__(393);
12306__webpack_require__(400);
12307__webpack_require__(401);
12308__webpack_require__(402);
12309__webpack_require__(403);
12310__webpack_require__(229);
12311__webpack_require__(404);
12312__webpack_require__(405);
12313__webpack_require__(406);
12314__webpack_require__(407);
12315__webpack_require__(408);
12316__webpack_require__(409);
12317__webpack_require__(410);
12318__webpack_require__(411);
12319__webpack_require__(412);
12320__webpack_require__(413);
12321__webpack_require__(414);
12322__webpack_require__(415);
12323var path = __webpack_require__(13);
12324
12325module.exports = path.Symbol;
12326
12327
12328/***/ }),
12329/* 393 */
12330/***/ (function(module, exports, __webpack_require__) {
12331
12332// TODO: Remove this module from `core-js@4` since it's split to modules listed below
12333__webpack_require__(394);
12334__webpack_require__(397);
12335__webpack_require__(398);
12336__webpack_require__(213);
12337__webpack_require__(399);
12338
12339
12340/***/ }),
12341/* 394 */
12342/***/ (function(module, exports, __webpack_require__) {
12343
12344"use strict";
12345
12346var $ = __webpack_require__(0);
12347var global = __webpack_require__(9);
12348var call = __webpack_require__(10);
12349var uncurryThis = __webpack_require__(6);
12350var IS_PURE = __webpack_require__(31);
12351var DESCRIPTORS = __webpack_require__(19);
12352var NATIVE_SYMBOL = __webpack_require__(49);
12353var fails = __webpack_require__(4);
12354var hasOwn = __webpack_require__(14);
12355var isPrototypeOf = __webpack_require__(20);
12356var anObject = __webpack_require__(21);
12357var toIndexedObject = __webpack_require__(33);
12358var toPropertyKey = __webpack_require__(82);
12359var $toString = __webpack_require__(69);
12360var createPropertyDescriptor = __webpack_require__(41);
12361var nativeObjectCreate = __webpack_require__(51);
12362var objectKeys = __webpack_require__(116);
12363var getOwnPropertyNamesModule = __webpack_require__(111);
12364var getOwnPropertyNamesExternal = __webpack_require__(395);
12365var getOwnPropertySymbolsModule = __webpack_require__(115);
12366var getOwnPropertyDescriptorModule = __webpack_require__(64);
12367var definePropertyModule = __webpack_require__(32);
12368var definePropertiesModule = __webpack_require__(147);
12369var propertyIsEnumerableModule = __webpack_require__(138);
12370var defineBuiltIn = __webpack_require__(43);
12371var shared = __webpack_require__(67);
12372var sharedKey = __webpack_require__(87);
12373var hiddenKeys = __webpack_require__(89);
12374var uid = __webpack_require__(109);
12375var wellKnownSymbol = __webpack_require__(8);
12376var wrappedWellKnownSymbolModule = __webpack_require__(136);
12377var defineWellKnownSymbol = __webpack_require__(5);
12378var defineSymbolToPrimitive = __webpack_require__(227);
12379var setToStringTag = __webpack_require__(54);
12380var InternalStateModule = __webpack_require__(91);
12381var $forEach = __webpack_require__(101).forEach;
12382
12383var HIDDEN = sharedKey('hidden');
12384var SYMBOL = 'Symbol';
12385var PROTOTYPE = 'prototype';
12386
12387var setInternalState = InternalStateModule.set;
12388var getInternalState = InternalStateModule.getterFor(SYMBOL);
12389
12390var ObjectPrototype = Object[PROTOTYPE];
12391var $Symbol = global.Symbol;
12392var SymbolPrototype = $Symbol && $Symbol[PROTOTYPE];
12393var TypeError = global.TypeError;
12394var QObject = global.QObject;
12395var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
12396var nativeDefineProperty = definePropertyModule.f;
12397var nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f;
12398var nativePropertyIsEnumerable = propertyIsEnumerableModule.f;
12399var push = uncurryThis([].push);
12400
12401var AllSymbols = shared('symbols');
12402var ObjectPrototypeSymbols = shared('op-symbols');
12403var WellKnownSymbolsStore = shared('wks');
12404
12405// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
12406var USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
12407
12408// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
12409var setSymbolDescriptor = DESCRIPTORS && fails(function () {
12410 return nativeObjectCreate(nativeDefineProperty({}, 'a', {
12411 get: function () { return nativeDefineProperty(this, 'a', { value: 7 }).a; }
12412 })).a != 7;
12413}) ? function (O, P, Attributes) {
12414 var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor(ObjectPrototype, P);
12415 if (ObjectPrototypeDescriptor) delete ObjectPrototype[P];
12416 nativeDefineProperty(O, P, Attributes);
12417 if (ObjectPrototypeDescriptor && O !== ObjectPrototype) {
12418 nativeDefineProperty(ObjectPrototype, P, ObjectPrototypeDescriptor);
12419 }
12420} : nativeDefineProperty;
12421
12422var wrap = function (tag, description) {
12423 var symbol = AllSymbols[tag] = nativeObjectCreate(SymbolPrototype);
12424 setInternalState(symbol, {
12425 type: SYMBOL,
12426 tag: tag,
12427 description: description
12428 });
12429 if (!DESCRIPTORS) symbol.description = description;
12430 return symbol;
12431};
12432
12433var $defineProperty = function defineProperty(O, P, Attributes) {
12434 if (O === ObjectPrototype) $defineProperty(ObjectPrototypeSymbols, P, Attributes);
12435 anObject(O);
12436 var key = toPropertyKey(P);
12437 anObject(Attributes);
12438 if (hasOwn(AllSymbols, key)) {
12439 if (!Attributes.enumerable) {
12440 if (!hasOwn(O, HIDDEN)) nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, {}));
12441 O[HIDDEN][key] = true;
12442 } else {
12443 if (hasOwn(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false;
12444 Attributes = nativeObjectCreate(Attributes, { enumerable: createPropertyDescriptor(0, false) });
12445 } return setSymbolDescriptor(O, key, Attributes);
12446 } return nativeDefineProperty(O, key, Attributes);
12447};
12448
12449var $defineProperties = function defineProperties(O, Properties) {
12450 anObject(O);
12451 var properties = toIndexedObject(Properties);
12452 var keys = objectKeys(properties).concat($getOwnPropertySymbols(properties));
12453 $forEach(keys, function (key) {
12454 if (!DESCRIPTORS || call($propertyIsEnumerable, properties, key)) $defineProperty(O, key, properties[key]);
12455 });
12456 return O;
12457};
12458
12459var $create = function create(O, Properties) {
12460 return Properties === undefined ? nativeObjectCreate(O) : $defineProperties(nativeObjectCreate(O), Properties);
12461};
12462
12463var $propertyIsEnumerable = function propertyIsEnumerable(V) {
12464 var P = toPropertyKey(V);
12465 var enumerable = call(nativePropertyIsEnumerable, this, P);
12466 if (this === ObjectPrototype && hasOwn(AllSymbols, P) && !hasOwn(ObjectPrototypeSymbols, P)) return false;
12467 return enumerable || !hasOwn(this, P) || !hasOwn(AllSymbols, P) || hasOwn(this, HIDDEN) && this[HIDDEN][P]
12468 ? enumerable : true;
12469};
12470
12471var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) {
12472 var it = toIndexedObject(O);
12473 var key = toPropertyKey(P);
12474 if (it === ObjectPrototype && hasOwn(AllSymbols, key) && !hasOwn(ObjectPrototypeSymbols, key)) return;
12475 var descriptor = nativeGetOwnPropertyDescriptor(it, key);
12476 if (descriptor && hasOwn(AllSymbols, key) && !(hasOwn(it, HIDDEN) && it[HIDDEN][key])) {
12477 descriptor.enumerable = true;
12478 }
12479 return descriptor;
12480};
12481
12482var $getOwnPropertyNames = function getOwnPropertyNames(O) {
12483 var names = nativeGetOwnPropertyNames(toIndexedObject(O));
12484 var result = [];
12485 $forEach(names, function (key) {
12486 if (!hasOwn(AllSymbols, key) && !hasOwn(hiddenKeys, key)) push(result, key);
12487 });
12488 return result;
12489};
12490
12491var $getOwnPropertySymbols = function (O) {
12492 var IS_OBJECT_PROTOTYPE = O === ObjectPrototype;
12493 var names = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O));
12494 var result = [];
12495 $forEach(names, function (key) {
12496 if (hasOwn(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || hasOwn(ObjectPrototype, key))) {
12497 push(result, AllSymbols[key]);
12498 }
12499 });
12500 return result;
12501};
12502
12503// `Symbol` constructor
12504// https://tc39.es/ecma262/#sec-symbol-constructor
12505if (!NATIVE_SYMBOL) {
12506 $Symbol = function Symbol() {
12507 if (isPrototypeOf(SymbolPrototype, this)) throw TypeError('Symbol is not a constructor');
12508 var description = !arguments.length || arguments[0] === undefined ? undefined : $toString(arguments[0]);
12509 var tag = uid(description);
12510 var setter = function (value) {
12511 if (this === ObjectPrototype) call(setter, ObjectPrototypeSymbols, value);
12512 if (hasOwn(this, HIDDEN) && hasOwn(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
12513 setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value));
12514 };
12515 if (DESCRIPTORS && USE_SETTER) setSymbolDescriptor(ObjectPrototype, tag, { configurable: true, set: setter });
12516 return wrap(tag, description);
12517 };
12518
12519 SymbolPrototype = $Symbol[PROTOTYPE];
12520
12521 defineBuiltIn(SymbolPrototype, 'toString', function toString() {
12522 return getInternalState(this).tag;
12523 });
12524
12525 defineBuiltIn($Symbol, 'withoutSetter', function (description) {
12526 return wrap(uid(description), description);
12527 });
12528
12529 propertyIsEnumerableModule.f = $propertyIsEnumerable;
12530 definePropertyModule.f = $defineProperty;
12531 definePropertiesModule.f = $defineProperties;
12532 getOwnPropertyDescriptorModule.f = $getOwnPropertyDescriptor;
12533 getOwnPropertyNamesModule.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames;
12534 getOwnPropertySymbolsModule.f = $getOwnPropertySymbols;
12535
12536 wrappedWellKnownSymbolModule.f = function (name) {
12537 return wrap(wellKnownSymbol(name), name);
12538 };
12539
12540 if (DESCRIPTORS) {
12541 // https://github.com/tc39/proposal-Symbol-description
12542 nativeDefineProperty(SymbolPrototype, 'description', {
12543 configurable: true,
12544 get: function description() {
12545 return getInternalState(this).description;
12546 }
12547 });
12548 if (!IS_PURE) {
12549 defineBuiltIn(ObjectPrototype, 'propertyIsEnumerable', $propertyIsEnumerable, { unsafe: true });
12550 }
12551 }
12552}
12553
12554$({ global: true, constructor: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, {
12555 Symbol: $Symbol
12556});
12557
12558$forEach(objectKeys(WellKnownSymbolsStore), function (name) {
12559 defineWellKnownSymbol(name);
12560});
12561
12562$({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL }, {
12563 useSetter: function () { USE_SETTER = true; },
12564 useSimple: function () { USE_SETTER = false; }
12565});
12566
12567$({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL, sham: !DESCRIPTORS }, {
12568 // `Object.create` method
12569 // https://tc39.es/ecma262/#sec-object.create
12570 create: $create,
12571 // `Object.defineProperty` method
12572 // https://tc39.es/ecma262/#sec-object.defineproperty
12573 defineProperty: $defineProperty,
12574 // `Object.defineProperties` method
12575 // https://tc39.es/ecma262/#sec-object.defineproperties
12576 defineProperties: $defineProperties,
12577 // `Object.getOwnPropertyDescriptor` method
12578 // https://tc39.es/ecma262/#sec-object.getownpropertydescriptors
12579 getOwnPropertyDescriptor: $getOwnPropertyDescriptor
12580});
12581
12582$({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL }, {
12583 // `Object.getOwnPropertyNames` method
12584 // https://tc39.es/ecma262/#sec-object.getownpropertynames
12585 getOwnPropertyNames: $getOwnPropertyNames
12586});
12587
12588// `Symbol.prototype[@@toPrimitive]` method
12589// https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive
12590defineSymbolToPrimitive();
12591
12592// `Symbol.prototype[@@toStringTag]` property
12593// https://tc39.es/ecma262/#sec-symbol.prototype-@@tostringtag
12594setToStringTag($Symbol, SYMBOL);
12595
12596hiddenKeys[HIDDEN] = true;
12597
12598
12599/***/ }),
12600/* 395 */
12601/***/ (function(module, exports, __webpack_require__) {
12602
12603/* eslint-disable es-x/no-object-getownpropertynames -- safe */
12604var classof = __webpack_require__(65);
12605var toIndexedObject = __webpack_require__(33);
12606var $getOwnPropertyNames = __webpack_require__(111).f;
12607var arraySlice = __webpack_require__(396);
12608
12609var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
12610 ? Object.getOwnPropertyNames(window) : [];
12611
12612var getWindowNames = function (it) {
12613 try {
12614 return $getOwnPropertyNames(it);
12615 } catch (error) {
12616 return arraySlice(windowNames);
12617 }
12618};
12619
12620// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
12621module.exports.f = function getOwnPropertyNames(it) {
12622 return windowNames && classof(it) == 'Window'
12623 ? getWindowNames(it)
12624 : $getOwnPropertyNames(toIndexedObject(it));
12625};
12626
12627
12628/***/ }),
12629/* 396 */
12630/***/ (function(module, exports, __webpack_require__) {
12631
12632var toAbsoluteIndex = __webpack_require__(112);
12633var lengthOfArrayLike = __webpack_require__(42);
12634var createProperty = __webpack_require__(99);
12635
12636var $Array = Array;
12637var max = Math.max;
12638
12639module.exports = function (O, start, end) {
12640 var length = lengthOfArrayLike(O);
12641 var k = toAbsoluteIndex(start, length);
12642 var fin = toAbsoluteIndex(end === undefined ? length : end, length);
12643 var result = $Array(max(fin - k, 0));
12644 for (var n = 0; k < fin; k++, n++) createProperty(result, n, O[k]);
12645 result.length = n;
12646 return result;
12647};
12648
12649
12650/***/ }),
12651/* 397 */
12652/***/ (function(module, exports, __webpack_require__) {
12653
12654var $ = __webpack_require__(0);
12655var getBuiltIn = __webpack_require__(16);
12656var hasOwn = __webpack_require__(14);
12657var toString = __webpack_require__(69);
12658var shared = __webpack_require__(67);
12659var NATIVE_SYMBOL_REGISTRY = __webpack_require__(228);
12660
12661var StringToSymbolRegistry = shared('string-to-symbol-registry');
12662var SymbolToStringRegistry = shared('symbol-to-string-registry');
12663
12664// `Symbol.for` method
12665// https://tc39.es/ecma262/#sec-symbol.for
12666$({ target: 'Symbol', stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, {
12667 'for': function (key) {
12668 var string = toString(key);
12669 if (hasOwn(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string];
12670 var symbol = getBuiltIn('Symbol')(string);
12671 StringToSymbolRegistry[string] = symbol;
12672 SymbolToStringRegistry[symbol] = string;
12673 return symbol;
12674 }
12675});
12676
12677
12678/***/ }),
12679/* 398 */
12680/***/ (function(module, exports, __webpack_require__) {
12681
12682var $ = __webpack_require__(0);
12683var hasOwn = __webpack_require__(14);
12684var isSymbol = __webpack_require__(83);
12685var tryToString = __webpack_require__(66);
12686var shared = __webpack_require__(67);
12687var NATIVE_SYMBOL_REGISTRY = __webpack_require__(228);
12688
12689var SymbolToStringRegistry = shared('symbol-to-string-registry');
12690
12691// `Symbol.keyFor` method
12692// https://tc39.es/ecma262/#sec-symbol.keyfor
12693$({ target: 'Symbol', stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, {
12694 keyFor: function keyFor(sym) {
12695 if (!isSymbol(sym)) throw TypeError(tryToString(sym) + ' is not a symbol');
12696 if (hasOwn(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym];
12697 }
12698});
12699
12700
12701/***/ }),
12702/* 399 */
12703/***/ (function(module, exports, __webpack_require__) {
12704
12705var $ = __webpack_require__(0);
12706var NATIVE_SYMBOL = __webpack_require__(49);
12707var fails = __webpack_require__(4);
12708var getOwnPropertySymbolsModule = __webpack_require__(115);
12709var toObject = __webpack_require__(35);
12710
12711// V8 ~ Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives
12712// https://bugs.chromium.org/p/v8/issues/detail?id=3443
12713var FORCED = !NATIVE_SYMBOL || fails(function () { getOwnPropertySymbolsModule.f(1); });
12714
12715// `Object.getOwnPropertySymbols` method
12716// https://tc39.es/ecma262/#sec-object.getownpropertysymbols
12717$({ target: 'Object', stat: true, forced: FORCED }, {
12718 getOwnPropertySymbols: function getOwnPropertySymbols(it) {
12719 var $getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
12720 return $getOwnPropertySymbols ? $getOwnPropertySymbols(toObject(it)) : [];
12721 }
12722});
12723
12724
12725/***/ }),
12726/* 400 */
12727/***/ (function(module, exports, __webpack_require__) {
12728
12729var defineWellKnownSymbol = __webpack_require__(5);
12730
12731// `Symbol.asyncIterator` well-known symbol
12732// https://tc39.es/ecma262/#sec-symbol.asynciterator
12733defineWellKnownSymbol('asyncIterator');
12734
12735
12736/***/ }),
12737/* 401 */
12738/***/ (function(module, exports) {
12739
12740// empty
12741
12742
12743/***/ }),
12744/* 402 */
12745/***/ (function(module, exports, __webpack_require__) {
12746
12747var defineWellKnownSymbol = __webpack_require__(5);
12748
12749// `Symbol.hasInstance` well-known symbol
12750// https://tc39.es/ecma262/#sec-symbol.hasinstance
12751defineWellKnownSymbol('hasInstance');
12752
12753
12754/***/ }),
12755/* 403 */
12756/***/ (function(module, exports, __webpack_require__) {
12757
12758var defineWellKnownSymbol = __webpack_require__(5);
12759
12760// `Symbol.isConcatSpreadable` well-known symbol
12761// https://tc39.es/ecma262/#sec-symbol.isconcatspreadable
12762defineWellKnownSymbol('isConcatSpreadable');
12763
12764
12765/***/ }),
12766/* 404 */
12767/***/ (function(module, exports, __webpack_require__) {
12768
12769var defineWellKnownSymbol = __webpack_require__(5);
12770
12771// `Symbol.match` well-known symbol
12772// https://tc39.es/ecma262/#sec-symbol.match
12773defineWellKnownSymbol('match');
12774
12775
12776/***/ }),
12777/* 405 */
12778/***/ (function(module, exports, __webpack_require__) {
12779
12780var defineWellKnownSymbol = __webpack_require__(5);
12781
12782// `Symbol.matchAll` well-known symbol
12783// https://tc39.es/ecma262/#sec-symbol.matchall
12784defineWellKnownSymbol('matchAll');
12785
12786
12787/***/ }),
12788/* 406 */
12789/***/ (function(module, exports, __webpack_require__) {
12790
12791var defineWellKnownSymbol = __webpack_require__(5);
12792
12793// `Symbol.replace` well-known symbol
12794// https://tc39.es/ecma262/#sec-symbol.replace
12795defineWellKnownSymbol('replace');
12796
12797
12798/***/ }),
12799/* 407 */
12800/***/ (function(module, exports, __webpack_require__) {
12801
12802var defineWellKnownSymbol = __webpack_require__(5);
12803
12804// `Symbol.search` well-known symbol
12805// https://tc39.es/ecma262/#sec-symbol.search
12806defineWellKnownSymbol('search');
12807
12808
12809/***/ }),
12810/* 408 */
12811/***/ (function(module, exports, __webpack_require__) {
12812
12813var defineWellKnownSymbol = __webpack_require__(5);
12814
12815// `Symbol.species` well-known symbol
12816// https://tc39.es/ecma262/#sec-symbol.species
12817defineWellKnownSymbol('species');
12818
12819
12820/***/ }),
12821/* 409 */
12822/***/ (function(module, exports, __webpack_require__) {
12823
12824var defineWellKnownSymbol = __webpack_require__(5);
12825
12826// `Symbol.split` well-known symbol
12827// https://tc39.es/ecma262/#sec-symbol.split
12828defineWellKnownSymbol('split');
12829
12830
12831/***/ }),
12832/* 410 */
12833/***/ (function(module, exports, __webpack_require__) {
12834
12835var defineWellKnownSymbol = __webpack_require__(5);
12836var defineSymbolToPrimitive = __webpack_require__(227);
12837
12838// `Symbol.toPrimitive` well-known symbol
12839// https://tc39.es/ecma262/#sec-symbol.toprimitive
12840defineWellKnownSymbol('toPrimitive');
12841
12842// `Symbol.prototype[@@toPrimitive]` method
12843// https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive
12844defineSymbolToPrimitive();
12845
12846
12847/***/ }),
12848/* 411 */
12849/***/ (function(module, exports, __webpack_require__) {
12850
12851var getBuiltIn = __webpack_require__(16);
12852var defineWellKnownSymbol = __webpack_require__(5);
12853var setToStringTag = __webpack_require__(54);
12854
12855// `Symbol.toStringTag` well-known symbol
12856// https://tc39.es/ecma262/#sec-symbol.tostringtag
12857defineWellKnownSymbol('toStringTag');
12858
12859// `Symbol.prototype[@@toStringTag]` property
12860// https://tc39.es/ecma262/#sec-symbol.prototype-@@tostringtag
12861setToStringTag(getBuiltIn('Symbol'), 'Symbol');
12862
12863
12864/***/ }),
12865/* 412 */
12866/***/ (function(module, exports, __webpack_require__) {
12867
12868var defineWellKnownSymbol = __webpack_require__(5);
12869
12870// `Symbol.unscopables` well-known symbol
12871// https://tc39.es/ecma262/#sec-symbol.unscopables
12872defineWellKnownSymbol('unscopables');
12873
12874
12875/***/ }),
12876/* 413 */
12877/***/ (function(module, exports, __webpack_require__) {
12878
12879var global = __webpack_require__(9);
12880var setToStringTag = __webpack_require__(54);
12881
12882// JSON[@@toStringTag] property
12883// https://tc39.es/ecma262/#sec-json-@@tostringtag
12884setToStringTag(global.JSON, 'JSON', true);
12885
12886
12887/***/ }),
12888/* 414 */
12889/***/ (function(module, exports) {
12890
12891// empty
12892
12893
12894/***/ }),
12895/* 415 */
12896/***/ (function(module, exports) {
12897
12898// empty
12899
12900
12901/***/ }),
12902/* 416 */
12903/***/ (function(module, exports, __webpack_require__) {
12904
12905var defineWellKnownSymbol = __webpack_require__(5);
12906
12907// `Symbol.asyncDispose` well-known symbol
12908// https://github.com/tc39/proposal-using-statement
12909defineWellKnownSymbol('asyncDispose');
12910
12911
12912/***/ }),
12913/* 417 */
12914/***/ (function(module, exports, __webpack_require__) {
12915
12916var defineWellKnownSymbol = __webpack_require__(5);
12917
12918// `Symbol.dispose` well-known symbol
12919// https://github.com/tc39/proposal-using-statement
12920defineWellKnownSymbol('dispose');
12921
12922
12923/***/ }),
12924/* 418 */
12925/***/ (function(module, exports, __webpack_require__) {
12926
12927var defineWellKnownSymbol = __webpack_require__(5);
12928
12929// `Symbol.matcher` well-known symbol
12930// https://github.com/tc39/proposal-pattern-matching
12931defineWellKnownSymbol('matcher');
12932
12933
12934/***/ }),
12935/* 419 */
12936/***/ (function(module, exports, __webpack_require__) {
12937
12938var defineWellKnownSymbol = __webpack_require__(5);
12939
12940// `Symbol.metadataKey` well-known symbol
12941// https://github.com/tc39/proposal-decorator-metadata
12942defineWellKnownSymbol('metadataKey');
12943
12944
12945/***/ }),
12946/* 420 */
12947/***/ (function(module, exports, __webpack_require__) {
12948
12949var defineWellKnownSymbol = __webpack_require__(5);
12950
12951// `Symbol.observable` well-known symbol
12952// https://github.com/tc39/proposal-observable
12953defineWellKnownSymbol('observable');
12954
12955
12956/***/ }),
12957/* 421 */
12958/***/ (function(module, exports, __webpack_require__) {
12959
12960// TODO: Remove from `core-js@4`
12961var defineWellKnownSymbol = __webpack_require__(5);
12962
12963// `Symbol.metadata` well-known symbol
12964// https://github.com/tc39/proposal-decorators
12965defineWellKnownSymbol('metadata');
12966
12967
12968/***/ }),
12969/* 422 */
12970/***/ (function(module, exports, __webpack_require__) {
12971
12972// TODO: remove from `core-js@4`
12973var defineWellKnownSymbol = __webpack_require__(5);
12974
12975// `Symbol.patternMatch` well-known symbol
12976// https://github.com/tc39/proposal-pattern-matching
12977defineWellKnownSymbol('patternMatch');
12978
12979
12980/***/ }),
12981/* 423 */
12982/***/ (function(module, exports, __webpack_require__) {
12983
12984// TODO: remove from `core-js@4`
12985var defineWellKnownSymbol = __webpack_require__(5);
12986
12987defineWellKnownSymbol('replaceAll');
12988
12989
12990/***/ }),
12991/* 424 */
12992/***/ (function(module, exports, __webpack_require__) {
12993
12994module.exports = __webpack_require__(425);
12995
12996/***/ }),
12997/* 425 */
12998/***/ (function(module, exports, __webpack_require__) {
12999
13000module.exports = __webpack_require__(426);
13001
13002
13003/***/ }),
13004/* 426 */
13005/***/ (function(module, exports, __webpack_require__) {
13006
13007var parent = __webpack_require__(427);
13008
13009module.exports = parent;
13010
13011
13012/***/ }),
13013/* 427 */
13014/***/ (function(module, exports, __webpack_require__) {
13015
13016var parent = __webpack_require__(428);
13017
13018module.exports = parent;
13019
13020
13021/***/ }),
13022/* 428 */
13023/***/ (function(module, exports, __webpack_require__) {
13024
13025var parent = __webpack_require__(429);
13026__webpack_require__(73);
13027
13028module.exports = parent;
13029
13030
13031/***/ }),
13032/* 429 */
13033/***/ (function(module, exports, __webpack_require__) {
13034
13035__webpack_require__(70);
13036__webpack_require__(92);
13037__webpack_require__(95);
13038__webpack_require__(229);
13039var WrappedWellKnownSymbolModule = __webpack_require__(136);
13040
13041module.exports = WrappedWellKnownSymbolModule.f('iterator');
13042
13043
13044/***/ }),
13045/* 430 */
13046/***/ (function(module, exports, __webpack_require__) {
13047
13048module.exports = __webpack_require__(431);
13049
13050/***/ }),
13051/* 431 */
13052/***/ (function(module, exports, __webpack_require__) {
13053
13054var parent = __webpack_require__(432);
13055
13056module.exports = parent;
13057
13058
13059/***/ }),
13060/* 432 */
13061/***/ (function(module, exports, __webpack_require__) {
13062
13063var isPrototypeOf = __webpack_require__(20);
13064var method = __webpack_require__(433);
13065
13066var ArrayPrototype = Array.prototype;
13067
13068module.exports = function (it) {
13069 var own = it.filter;
13070 return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.filter) ? method : own;
13071};
13072
13073
13074/***/ }),
13075/* 433 */
13076/***/ (function(module, exports, __webpack_require__) {
13077
13078__webpack_require__(434);
13079var entryVirtual = __webpack_require__(38);
13080
13081module.exports = entryVirtual('Array').filter;
13082
13083
13084/***/ }),
13085/* 434 */
13086/***/ (function(module, exports, __webpack_require__) {
13087
13088"use strict";
13089
13090var $ = __webpack_require__(0);
13091var $filter = __webpack_require__(101).filter;
13092var arrayMethodHasSpeciesSupport = __webpack_require__(100);
13093
13094var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
13095
13096// `Array.prototype.filter` method
13097// https://tc39.es/ecma262/#sec-array.prototype.filter
13098// with adding support of @@species
13099$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
13100 filter: function filter(callbackfn /* , thisArg */) {
13101 return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
13102 }
13103});
13104
13105
13106/***/ }),
13107/* 435 */
13108/***/ (function(module, exports, __webpack_require__) {
13109
13110"use strict";
13111// Copyright (c) 2015-2017 David M. Lee, II
13112
13113
13114/**
13115 * Local reference to TimeoutError
13116 * @private
13117 */
13118var TimeoutError;
13119
13120/**
13121 * Rejects a promise with a {@link TimeoutError} if it does not settle within
13122 * the specified timeout.
13123 *
13124 * @param {Promise} promise The promise.
13125 * @param {number} timeoutMillis Number of milliseconds to wait on settling.
13126 * @returns {Promise} Either resolves/rejects with `promise`, or rejects with
13127 * `TimeoutError`, whichever settles first.
13128 */
13129var timeout = module.exports.timeout = function(promise, timeoutMillis) {
13130 var error = new TimeoutError(),
13131 timeout;
13132
13133 return Promise.race([
13134 promise,
13135 new Promise(function(resolve, reject) {
13136 timeout = setTimeout(function() {
13137 reject(error);
13138 }, timeoutMillis);
13139 }),
13140 ]).then(function(v) {
13141 clearTimeout(timeout);
13142 return v;
13143 }, function(err) {
13144 clearTimeout(timeout);
13145 throw err;
13146 });
13147};
13148
13149/**
13150 * Exception indicating that the timeout expired.
13151 */
13152TimeoutError = module.exports.TimeoutError = function() {
13153 Error.call(this)
13154 this.stack = Error().stack
13155 this.message = 'Timeout';
13156};
13157
13158TimeoutError.prototype = Object.create(Error.prototype);
13159TimeoutError.prototype.name = "TimeoutError";
13160
13161
13162/***/ }),
13163/* 436 */
13164/***/ (function(module, exports, __webpack_require__) {
13165
13166"use strict";
13167
13168
13169var _interopRequireDefault = __webpack_require__(2);
13170
13171var _slice = _interopRequireDefault(__webpack_require__(81));
13172
13173var _keys = _interopRequireDefault(__webpack_require__(48));
13174
13175var _concat = _interopRequireDefault(__webpack_require__(29));
13176
13177var _ = __webpack_require__(1);
13178
13179module.exports = function (AV) {
13180 var eventSplitter = /\s+/;
13181 var slice = (0, _slice.default)(Array.prototype);
13182 /**
13183 * @class
13184 *
13185 * <p>AV.Events is a fork of Backbone's Events module, provided for your
13186 * convenience.</p>
13187 *
13188 * <p>A module that can be mixed in to any object in order to provide
13189 * it with custom events. You may bind callback functions to an event
13190 * with `on`, or remove these functions with `off`.
13191 * Triggering an event fires all callbacks in the order that `on` was
13192 * called.
13193 *
13194 * @private
13195 * @example
13196 * var object = {};
13197 * _.extend(object, AV.Events);
13198 * object.on('expand', function(){ alert('expanded'); });
13199 * object.trigger('expand');</pre></p>
13200 *
13201 */
13202
13203 AV.Events = {
13204 /**
13205 * Bind one or more space separated events, `events`, to a `callback`
13206 * function. Passing `"all"` will bind the callback to all events fired.
13207 */
13208 on: function on(events, callback, context) {
13209 var calls, event, node, tail, list;
13210
13211 if (!callback) {
13212 return this;
13213 }
13214
13215 events = events.split(eventSplitter);
13216 calls = this._callbacks || (this._callbacks = {}); // Create an immutable callback list, allowing traversal during
13217 // modification. The tail is an empty object that will always be used
13218 // as the next node.
13219
13220 event = events.shift();
13221
13222 while (event) {
13223 list = calls[event];
13224 node = list ? list.tail : {};
13225 node.next = tail = {};
13226 node.context = context;
13227 node.callback = callback;
13228 calls[event] = {
13229 tail: tail,
13230 next: list ? list.next : node
13231 };
13232 event = events.shift();
13233 }
13234
13235 return this;
13236 },
13237
13238 /**
13239 * Remove one or many callbacks. If `context` is null, removes all callbacks
13240 * with that function. If `callback` is null, removes all callbacks for the
13241 * event. If `events` is null, removes all bound callbacks for all events.
13242 */
13243 off: function off(events, callback, context) {
13244 var event, calls, node, tail, cb, ctx; // No events, or removing *all* events.
13245
13246 if (!(calls = this._callbacks)) {
13247 return;
13248 }
13249
13250 if (!(events || callback || context)) {
13251 delete this._callbacks;
13252 return this;
13253 } // Loop through the listed events and contexts, splicing them out of the
13254 // linked list of callbacks if appropriate.
13255
13256
13257 events = events ? events.split(eventSplitter) : (0, _keys.default)(_).call(_, calls);
13258 event = events.shift();
13259
13260 while (event) {
13261 node = calls[event];
13262 delete calls[event];
13263
13264 if (!node || !(callback || context)) {
13265 continue;
13266 } // Create a new list, omitting the indicated callbacks.
13267
13268
13269 tail = node.tail;
13270 node = node.next;
13271
13272 while (node !== tail) {
13273 cb = node.callback;
13274 ctx = node.context;
13275
13276 if (callback && cb !== callback || context && ctx !== context) {
13277 this.on(event, cb, ctx);
13278 }
13279
13280 node = node.next;
13281 }
13282
13283 event = events.shift();
13284 }
13285
13286 return this;
13287 },
13288
13289 /**
13290 * Trigger one or many events, firing all bound callbacks. Callbacks are
13291 * passed the same arguments as `trigger` is, apart from the event name
13292 * (unless you're listening on `"all"`, which will cause your callback to
13293 * receive the true name of the event as the first argument).
13294 */
13295 trigger: function trigger(events) {
13296 var event, node, calls, tail, args, all, rest;
13297
13298 if (!(calls = this._callbacks)) {
13299 return this;
13300 }
13301
13302 all = calls.all;
13303 events = events.split(eventSplitter);
13304 rest = slice.call(arguments, 1); // For each event, walk through the linked list of callbacks twice,
13305 // first to trigger the event, then to trigger any `"all"` callbacks.
13306
13307 event = events.shift();
13308
13309 while (event) {
13310 node = calls[event];
13311
13312 if (node) {
13313 tail = node.tail;
13314
13315 while ((node = node.next) !== tail) {
13316 node.callback.apply(node.context || this, rest);
13317 }
13318 }
13319
13320 node = all;
13321
13322 if (node) {
13323 var _context;
13324
13325 tail = node.tail;
13326 args = (0, _concat.default)(_context = [event]).call(_context, rest);
13327
13328 while ((node = node.next) !== tail) {
13329 node.callback.apply(node.context || this, args);
13330 }
13331 }
13332
13333 event = events.shift();
13334 }
13335
13336 return this;
13337 }
13338 };
13339 /**
13340 * @function
13341 */
13342
13343 AV.Events.bind = AV.Events.on;
13344 /**
13345 * @function
13346 */
13347
13348 AV.Events.unbind = AV.Events.off;
13349};
13350
13351/***/ }),
13352/* 437 */
13353/***/ (function(module, exports, __webpack_require__) {
13354
13355"use strict";
13356
13357
13358var _interopRequireDefault = __webpack_require__(2);
13359
13360var _promise = _interopRequireDefault(__webpack_require__(12));
13361
13362var _ = __webpack_require__(1);
13363/*global navigator: false */
13364
13365
13366module.exports = function (AV) {
13367 /**
13368 * Creates a new GeoPoint with any of the following forms:<br>
13369 * @example
13370 * new GeoPoint(otherGeoPoint)
13371 * new GeoPoint(30, 30)
13372 * new GeoPoint([30, 30])
13373 * new GeoPoint({latitude: 30, longitude: 30})
13374 * new GeoPoint() // defaults to (0, 0)
13375 * @class
13376 *
13377 * <p>Represents a latitude / longitude point that may be associated
13378 * with a key in a AVObject or used as a reference point for geo queries.
13379 * This allows proximity-based queries on the key.</p>
13380 *
13381 * <p>Only one key in a class may contain a GeoPoint.</p>
13382 *
13383 * <p>Example:<pre>
13384 * var point = new AV.GeoPoint(30.0, -20.0);
13385 * var object = new AV.Object("PlaceObject");
13386 * object.set("location", point);
13387 * object.save();</pre></p>
13388 */
13389 AV.GeoPoint = function (arg1, arg2) {
13390 if (_.isArray(arg1)) {
13391 AV.GeoPoint._validate(arg1[0], arg1[1]);
13392
13393 this.latitude = arg1[0];
13394 this.longitude = arg1[1];
13395 } else if (_.isObject(arg1)) {
13396 AV.GeoPoint._validate(arg1.latitude, arg1.longitude);
13397
13398 this.latitude = arg1.latitude;
13399 this.longitude = arg1.longitude;
13400 } else if (_.isNumber(arg1) && _.isNumber(arg2)) {
13401 AV.GeoPoint._validate(arg1, arg2);
13402
13403 this.latitude = arg1;
13404 this.longitude = arg2;
13405 } else {
13406 this.latitude = 0;
13407 this.longitude = 0;
13408 } // Add properties so that anyone using Webkit or Mozilla will get an error
13409 // if they try to set values that are out of bounds.
13410
13411
13412 var self = this;
13413
13414 if (this.__defineGetter__ && this.__defineSetter__) {
13415 // Use _latitude and _longitude to actually store the values, and add
13416 // getters and setters for latitude and longitude.
13417 this._latitude = this.latitude;
13418 this._longitude = this.longitude;
13419
13420 this.__defineGetter__('latitude', function () {
13421 return self._latitude;
13422 });
13423
13424 this.__defineGetter__('longitude', function () {
13425 return self._longitude;
13426 });
13427
13428 this.__defineSetter__('latitude', function (val) {
13429 AV.GeoPoint._validate(val, self.longitude);
13430
13431 self._latitude = val;
13432 });
13433
13434 this.__defineSetter__('longitude', function (val) {
13435 AV.GeoPoint._validate(self.latitude, val);
13436
13437 self._longitude = val;
13438 });
13439 }
13440 };
13441 /**
13442 * @lends AV.GeoPoint.prototype
13443 * @property {float} latitude North-south portion of the coordinate, in range
13444 * [-90, 90]. Throws an exception if set out of range in a modern browser.
13445 * @property {float} longitude East-west portion of the coordinate, in range
13446 * [-180, 180]. Throws if set out of range in a modern browser.
13447 */
13448
13449 /**
13450 * Throws an exception if the given lat-long is out of bounds.
13451 * @private
13452 */
13453
13454
13455 AV.GeoPoint._validate = function (latitude, longitude) {
13456 if (latitude < -90.0) {
13457 throw new Error('AV.GeoPoint latitude ' + latitude + ' < -90.0.');
13458 }
13459
13460 if (latitude > 90.0) {
13461 throw new Error('AV.GeoPoint latitude ' + latitude + ' > 90.0.');
13462 }
13463
13464 if (longitude < -180.0) {
13465 throw new Error('AV.GeoPoint longitude ' + longitude + ' < -180.0.');
13466 }
13467
13468 if (longitude > 180.0) {
13469 throw new Error('AV.GeoPoint longitude ' + longitude + ' > 180.0.');
13470 }
13471 };
13472 /**
13473 * Creates a GeoPoint with the user's current location, if available.
13474 * @return {Promise.<AV.GeoPoint>}
13475 */
13476
13477
13478 AV.GeoPoint.current = function () {
13479 return new _promise.default(function (resolve, reject) {
13480 navigator.geolocation.getCurrentPosition(function (location) {
13481 resolve(new AV.GeoPoint({
13482 latitude: location.coords.latitude,
13483 longitude: location.coords.longitude
13484 }));
13485 }, reject);
13486 });
13487 };
13488
13489 _.extend(AV.GeoPoint.prototype,
13490 /** @lends AV.GeoPoint.prototype */
13491 {
13492 /**
13493 * Returns a JSON representation of the GeoPoint, suitable for AV.
13494 * @return {Object}
13495 */
13496 toJSON: function toJSON() {
13497 AV.GeoPoint._validate(this.latitude, this.longitude);
13498
13499 return {
13500 __type: 'GeoPoint',
13501 latitude: this.latitude,
13502 longitude: this.longitude
13503 };
13504 },
13505
13506 /**
13507 * Returns the distance from this GeoPoint to another in radians.
13508 * @param {AV.GeoPoint} point the other AV.GeoPoint.
13509 * @return {Number}
13510 */
13511 radiansTo: function radiansTo(point) {
13512 var d2r = Math.PI / 180.0;
13513 var lat1rad = this.latitude * d2r;
13514 var long1rad = this.longitude * d2r;
13515 var lat2rad = point.latitude * d2r;
13516 var long2rad = point.longitude * d2r;
13517 var deltaLat = lat1rad - lat2rad;
13518 var deltaLong = long1rad - long2rad;
13519 var sinDeltaLatDiv2 = Math.sin(deltaLat / 2);
13520 var sinDeltaLongDiv2 = Math.sin(deltaLong / 2); // Square of half the straight line chord distance between both points.
13521
13522 var a = sinDeltaLatDiv2 * sinDeltaLatDiv2 + Math.cos(lat1rad) * Math.cos(lat2rad) * sinDeltaLongDiv2 * sinDeltaLongDiv2;
13523 a = Math.min(1.0, a);
13524 return 2 * Math.asin(Math.sqrt(a));
13525 },
13526
13527 /**
13528 * Returns the distance from this GeoPoint to another in kilometers.
13529 * @param {AV.GeoPoint} point the other AV.GeoPoint.
13530 * @return {Number}
13531 */
13532 kilometersTo: function kilometersTo(point) {
13533 return this.radiansTo(point) * 6371.0;
13534 },
13535
13536 /**
13537 * Returns the distance from this GeoPoint to another in miles.
13538 * @param {AV.GeoPoint} point the other AV.GeoPoint.
13539 * @return {Number}
13540 */
13541 milesTo: function milesTo(point) {
13542 return this.radiansTo(point) * 3958.8;
13543 }
13544 });
13545};
13546
13547/***/ }),
13548/* 438 */
13549/***/ (function(module, exports, __webpack_require__) {
13550
13551"use strict";
13552
13553
13554var _ = __webpack_require__(1);
13555
13556module.exports = function (AV) {
13557 var PUBLIC_KEY = '*';
13558 /**
13559 * Creates a new ACL.
13560 * If no argument is given, the ACL has no permissions for anyone.
13561 * If the argument is a AV.User, the ACL will have read and write
13562 * permission for only that user.
13563 * If the argument is any other JSON object, that object will be interpretted
13564 * as a serialized ACL created with toJSON().
13565 * @see AV.Object#setACL
13566 * @class
13567 *
13568 * <p>An ACL, or Access Control List can be added to any
13569 * <code>AV.Object</code> to restrict access to only a subset of users
13570 * of your application.</p>
13571 */
13572
13573 AV.ACL = function (arg1) {
13574 var self = this;
13575 self.permissionsById = {};
13576
13577 if (_.isObject(arg1)) {
13578 if (arg1 instanceof AV.User) {
13579 self.setReadAccess(arg1, true);
13580 self.setWriteAccess(arg1, true);
13581 } else {
13582 if (_.isFunction(arg1)) {
13583 throw new Error('AV.ACL() called with a function. Did you forget ()?');
13584 }
13585
13586 AV._objectEach(arg1, function (accessList, userId) {
13587 if (!_.isString(userId)) {
13588 throw new Error('Tried to create an ACL with an invalid userId.');
13589 }
13590
13591 self.permissionsById[userId] = {};
13592
13593 AV._objectEach(accessList, function (allowed, permission) {
13594 if (permission !== 'read' && permission !== 'write') {
13595 throw new Error('Tried to create an ACL with an invalid permission type.');
13596 }
13597
13598 if (!_.isBoolean(allowed)) {
13599 throw new Error('Tried to create an ACL with an invalid permission value.');
13600 }
13601
13602 self.permissionsById[userId][permission] = allowed;
13603 });
13604 });
13605 }
13606 }
13607 };
13608 /**
13609 * Returns a JSON-encoded version of the ACL.
13610 * @return {Object}
13611 */
13612
13613
13614 AV.ACL.prototype.toJSON = function () {
13615 return _.clone(this.permissionsById);
13616 };
13617
13618 AV.ACL.prototype._setAccess = function (accessType, userId, allowed) {
13619 if (userId instanceof AV.User) {
13620 userId = userId.id;
13621 } else if (userId instanceof AV.Role) {
13622 userId = 'role:' + userId.getName();
13623 }
13624
13625 if (!_.isString(userId)) {
13626 throw new Error('userId must be a string.');
13627 }
13628
13629 if (!_.isBoolean(allowed)) {
13630 throw new Error('allowed must be either true or false.');
13631 }
13632
13633 var permissions = this.permissionsById[userId];
13634
13635 if (!permissions) {
13636 if (!allowed) {
13637 // The user already doesn't have this permission, so no action needed.
13638 return;
13639 } else {
13640 permissions = {};
13641 this.permissionsById[userId] = permissions;
13642 }
13643 }
13644
13645 if (allowed) {
13646 this.permissionsById[userId][accessType] = true;
13647 } else {
13648 delete permissions[accessType];
13649
13650 if (_.isEmpty(permissions)) {
13651 delete this.permissionsById[userId];
13652 }
13653 }
13654 };
13655
13656 AV.ACL.prototype._getAccess = function (accessType, userId) {
13657 if (userId instanceof AV.User) {
13658 userId = userId.id;
13659 } else if (userId instanceof AV.Role) {
13660 userId = 'role:' + userId.getName();
13661 }
13662
13663 var permissions = this.permissionsById[userId];
13664
13665 if (!permissions) {
13666 return false;
13667 }
13668
13669 return permissions[accessType] ? true : false;
13670 };
13671 /**
13672 * Set whether the given user is allowed to read this object.
13673 * @param userId An instance of AV.User or its objectId.
13674 * @param {Boolean} allowed Whether that user should have read access.
13675 */
13676
13677
13678 AV.ACL.prototype.setReadAccess = function (userId, allowed) {
13679 this._setAccess('read', userId, allowed);
13680 };
13681 /**
13682 * Get whether the given user id is *explicitly* allowed to read this object.
13683 * Even if this returns false, the user may still be able to access it if
13684 * getPublicReadAccess returns true or a role that the user belongs to has
13685 * write access.
13686 * @param userId An instance of AV.User or its objectId, or a AV.Role.
13687 * @return {Boolean}
13688 */
13689
13690
13691 AV.ACL.prototype.getReadAccess = function (userId) {
13692 return this._getAccess('read', userId);
13693 };
13694 /**
13695 * Set whether the given user id is allowed to write this object.
13696 * @param userId An instance of AV.User or its objectId, or a AV.Role..
13697 * @param {Boolean} allowed Whether that user should have write access.
13698 */
13699
13700
13701 AV.ACL.prototype.setWriteAccess = function (userId, allowed) {
13702 this._setAccess('write', userId, allowed);
13703 };
13704 /**
13705 * Get whether the given user id is *explicitly* allowed to write this object.
13706 * Even if this returns false, the user may still be able to write it if
13707 * getPublicWriteAccess returns true or a role that the user belongs to has
13708 * write access.
13709 * @param userId An instance of AV.User or its objectId, or a AV.Role.
13710 * @return {Boolean}
13711 */
13712
13713
13714 AV.ACL.prototype.getWriteAccess = function (userId) {
13715 return this._getAccess('write', userId);
13716 };
13717 /**
13718 * Set whether the public is allowed to read this object.
13719 * @param {Boolean} allowed
13720 */
13721
13722
13723 AV.ACL.prototype.setPublicReadAccess = function (allowed) {
13724 this.setReadAccess(PUBLIC_KEY, allowed);
13725 };
13726 /**
13727 * Get whether the public is allowed to read this object.
13728 * @return {Boolean}
13729 */
13730
13731
13732 AV.ACL.prototype.getPublicReadAccess = function () {
13733 return this.getReadAccess(PUBLIC_KEY);
13734 };
13735 /**
13736 * Set whether the public is allowed to write this object.
13737 * @param {Boolean} allowed
13738 */
13739
13740
13741 AV.ACL.prototype.setPublicWriteAccess = function (allowed) {
13742 this.setWriteAccess(PUBLIC_KEY, allowed);
13743 };
13744 /**
13745 * Get whether the public is allowed to write this object.
13746 * @return {Boolean}
13747 */
13748
13749
13750 AV.ACL.prototype.getPublicWriteAccess = function () {
13751 return this.getWriteAccess(PUBLIC_KEY);
13752 };
13753 /**
13754 * Get whether users belonging to the given role are allowed
13755 * to read this object. Even if this returns false, the role may
13756 * still be able to write it if a parent role has read access.
13757 *
13758 * @param role The name of the role, or a AV.Role object.
13759 * @return {Boolean} true if the role has read access. false otherwise.
13760 * @throws {String} If role is neither a AV.Role nor a String.
13761 */
13762
13763
13764 AV.ACL.prototype.getRoleReadAccess = function (role) {
13765 if (role instanceof AV.Role) {
13766 // Normalize to the String name
13767 role = role.getName();
13768 }
13769
13770 if (_.isString(role)) {
13771 return this.getReadAccess('role:' + role);
13772 }
13773
13774 throw new Error('role must be a AV.Role or a String');
13775 };
13776 /**
13777 * Get whether users belonging to the given role are allowed
13778 * to write this object. Even if this returns false, the role may
13779 * still be able to write it if a parent role has write access.
13780 *
13781 * @param role The name of the role, or a AV.Role object.
13782 * @return {Boolean} true if the role has write access. false otherwise.
13783 * @throws {String} If role is neither a AV.Role nor a String.
13784 */
13785
13786
13787 AV.ACL.prototype.getRoleWriteAccess = function (role) {
13788 if (role instanceof AV.Role) {
13789 // Normalize to the String name
13790 role = role.getName();
13791 }
13792
13793 if (_.isString(role)) {
13794 return this.getWriteAccess('role:' + role);
13795 }
13796
13797 throw new Error('role must be a AV.Role or a String');
13798 };
13799 /**
13800 * Set whether users belonging to the given role are allowed
13801 * to read this object.
13802 *
13803 * @param role The name of the role, or a AV.Role object.
13804 * @param {Boolean} allowed Whether the given role can read this object.
13805 * @throws {String} If role is neither a AV.Role nor a String.
13806 */
13807
13808
13809 AV.ACL.prototype.setRoleReadAccess = function (role, allowed) {
13810 if (role instanceof AV.Role) {
13811 // Normalize to the String name
13812 role = role.getName();
13813 }
13814
13815 if (_.isString(role)) {
13816 this.setReadAccess('role:' + role, allowed);
13817 return;
13818 }
13819
13820 throw new Error('role must be a AV.Role or a String');
13821 };
13822 /**
13823 * Set whether users belonging to the given role are allowed
13824 * to write this object.
13825 *
13826 * @param role The name of the role, or a AV.Role object.
13827 * @param {Boolean} allowed Whether the given role can write this object.
13828 * @throws {String} If role is neither a AV.Role nor a String.
13829 */
13830
13831
13832 AV.ACL.prototype.setRoleWriteAccess = function (role, allowed) {
13833 if (role instanceof AV.Role) {
13834 // Normalize to the String name
13835 role = role.getName();
13836 }
13837
13838 if (_.isString(role)) {
13839 this.setWriteAccess('role:' + role, allowed);
13840 return;
13841 }
13842
13843 throw new Error('role must be a AV.Role or a String');
13844 };
13845};
13846
13847/***/ }),
13848/* 439 */
13849/***/ (function(module, exports, __webpack_require__) {
13850
13851"use strict";
13852
13853
13854var _interopRequireDefault = __webpack_require__(2);
13855
13856var _concat = _interopRequireDefault(__webpack_require__(29));
13857
13858var _find = _interopRequireDefault(__webpack_require__(104));
13859
13860var _indexOf = _interopRequireDefault(__webpack_require__(102));
13861
13862var _map = _interopRequireDefault(__webpack_require__(39));
13863
13864var _ = __webpack_require__(1);
13865
13866module.exports = function (AV) {
13867 /**
13868 * @private
13869 * @class
13870 * A AV.Op is an atomic operation that can be applied to a field in a
13871 * AV.Object. For example, calling <code>object.set("foo", "bar")</code>
13872 * is an example of a AV.Op.Set. Calling <code>object.unset("foo")</code>
13873 * is a AV.Op.Unset. These operations are stored in a AV.Object and
13874 * sent to the server as part of <code>object.save()</code> operations.
13875 * Instances of AV.Op should be immutable.
13876 *
13877 * You should not create subclasses of AV.Op or instantiate AV.Op
13878 * directly.
13879 */
13880 AV.Op = function () {
13881 this._initialize.apply(this, arguments);
13882 };
13883
13884 _.extend(AV.Op.prototype,
13885 /** @lends AV.Op.prototype */
13886 {
13887 _initialize: function _initialize() {}
13888 });
13889
13890 _.extend(AV.Op, {
13891 /**
13892 * To create a new Op, call AV.Op._extend();
13893 * @private
13894 */
13895 _extend: AV._extend,
13896 // A map of __op string to decoder function.
13897 _opDecoderMap: {},
13898
13899 /**
13900 * Registers a function to convert a json object with an __op field into an
13901 * instance of a subclass of AV.Op.
13902 * @private
13903 */
13904 _registerDecoder: function _registerDecoder(opName, decoder) {
13905 AV.Op._opDecoderMap[opName] = decoder;
13906 },
13907
13908 /**
13909 * Converts a json object into an instance of a subclass of AV.Op.
13910 * @private
13911 */
13912 _decode: function _decode(json) {
13913 var decoder = AV.Op._opDecoderMap[json.__op];
13914
13915 if (decoder) {
13916 return decoder(json);
13917 } else {
13918 return undefined;
13919 }
13920 }
13921 });
13922 /*
13923 * Add a handler for Batch ops.
13924 */
13925
13926
13927 AV.Op._registerDecoder('Batch', function (json) {
13928 var op = null;
13929
13930 AV._arrayEach(json.ops, function (nextOp) {
13931 nextOp = AV.Op._decode(nextOp);
13932 op = nextOp._mergeWithPrevious(op);
13933 });
13934
13935 return op;
13936 });
13937 /**
13938 * @private
13939 * @class
13940 * A Set operation indicates that either the field was changed using
13941 * AV.Object.set, or it is a mutable container that was detected as being
13942 * changed.
13943 */
13944
13945
13946 AV.Op.Set = AV.Op._extend(
13947 /** @lends AV.Op.Set.prototype */
13948 {
13949 _initialize: function _initialize(value) {
13950 this._value = value;
13951 },
13952
13953 /**
13954 * Returns the new value of this field after the set.
13955 */
13956 value: function value() {
13957 return this._value;
13958 },
13959
13960 /**
13961 * Returns a JSON version of the operation suitable for sending to AV.
13962 * @return {Object}
13963 */
13964 toJSON: function toJSON() {
13965 return AV._encode(this.value());
13966 },
13967 _mergeWithPrevious: function _mergeWithPrevious(previous) {
13968 return this;
13969 },
13970 _estimate: function _estimate(oldValue) {
13971 return this.value();
13972 }
13973 });
13974 /**
13975 * A sentinel value that is returned by AV.Op.Unset._estimate to
13976 * indicate the field should be deleted. Basically, if you find _UNSET as a
13977 * value in your object, you should remove that key.
13978 */
13979
13980 AV.Op._UNSET = {};
13981 /**
13982 * @private
13983 * @class
13984 * An Unset operation indicates that this field has been deleted from the
13985 * object.
13986 */
13987
13988 AV.Op.Unset = AV.Op._extend(
13989 /** @lends AV.Op.Unset.prototype */
13990 {
13991 /**
13992 * Returns a JSON version of the operation suitable for sending to AV.
13993 * @return {Object}
13994 */
13995 toJSON: function toJSON() {
13996 return {
13997 __op: 'Delete'
13998 };
13999 },
14000 _mergeWithPrevious: function _mergeWithPrevious(previous) {
14001 return this;
14002 },
14003 _estimate: function _estimate(oldValue) {
14004 return AV.Op._UNSET;
14005 }
14006 });
14007
14008 AV.Op._registerDecoder('Delete', function (json) {
14009 return new AV.Op.Unset();
14010 });
14011 /**
14012 * @private
14013 * @class
14014 * An Increment is an atomic operation where the numeric value for the field
14015 * will be increased by a given amount.
14016 */
14017
14018
14019 AV.Op.Increment = AV.Op._extend(
14020 /** @lends AV.Op.Increment.prototype */
14021 {
14022 _initialize: function _initialize(amount) {
14023 this._amount = amount;
14024 },
14025
14026 /**
14027 * Returns the amount to increment by.
14028 * @return {Number} the amount to increment by.
14029 */
14030 amount: function amount() {
14031 return this._amount;
14032 },
14033
14034 /**
14035 * Returns a JSON version of the operation suitable for sending to AV.
14036 * @return {Object}
14037 */
14038 toJSON: function toJSON() {
14039 return {
14040 __op: 'Increment',
14041 amount: this._amount
14042 };
14043 },
14044 _mergeWithPrevious: function _mergeWithPrevious(previous) {
14045 if (!previous) {
14046 return this;
14047 } else if (previous instanceof AV.Op.Unset) {
14048 return new AV.Op.Set(this.amount());
14049 } else if (previous instanceof AV.Op.Set) {
14050 return new AV.Op.Set(previous.value() + this.amount());
14051 } else if (previous instanceof AV.Op.Increment) {
14052 return new AV.Op.Increment(this.amount() + previous.amount());
14053 } else {
14054 throw new Error('Op is invalid after previous op.');
14055 }
14056 },
14057 _estimate: function _estimate(oldValue) {
14058 if (!oldValue) {
14059 return this.amount();
14060 }
14061
14062 return oldValue + this.amount();
14063 }
14064 });
14065
14066 AV.Op._registerDecoder('Increment', function (json) {
14067 return new AV.Op.Increment(json.amount);
14068 });
14069 /**
14070 * @private
14071 * @class
14072 * BitAnd is an atomic operation where the given value will be bit and to the
14073 * value than is stored in this field.
14074 */
14075
14076
14077 AV.Op.BitAnd = AV.Op._extend(
14078 /** @lends AV.Op.BitAnd.prototype */
14079 {
14080 _initialize: function _initialize(value) {
14081 this._value = value;
14082 },
14083 value: function value() {
14084 return this._value;
14085 },
14086
14087 /**
14088 * Returns a JSON version of the operation suitable for sending to AV.
14089 * @return {Object}
14090 */
14091 toJSON: function toJSON() {
14092 return {
14093 __op: 'BitAnd',
14094 value: this.value()
14095 };
14096 },
14097 _mergeWithPrevious: function _mergeWithPrevious(previous) {
14098 if (!previous) {
14099 return this;
14100 } else if (previous instanceof AV.Op.Unset) {
14101 return new AV.Op.Set(0);
14102 } else if (previous instanceof AV.Op.Set) {
14103 return new AV.Op.Set(previous.value() & this.value());
14104 } else {
14105 throw new Error('Op is invalid after previous op.');
14106 }
14107 },
14108 _estimate: function _estimate(oldValue) {
14109 return oldValue & this.value();
14110 }
14111 });
14112
14113 AV.Op._registerDecoder('BitAnd', function (json) {
14114 return new AV.Op.BitAnd(json.value);
14115 });
14116 /**
14117 * @private
14118 * @class
14119 * BitOr is an atomic operation where the given value will be bit and to the
14120 * value than is stored in this field.
14121 */
14122
14123
14124 AV.Op.BitOr = AV.Op._extend(
14125 /** @lends AV.Op.BitOr.prototype */
14126 {
14127 _initialize: function _initialize(value) {
14128 this._value = value;
14129 },
14130 value: function value() {
14131 return this._value;
14132 },
14133
14134 /**
14135 * Returns a JSON version of the operation suitable for sending to AV.
14136 * @return {Object}
14137 */
14138 toJSON: function toJSON() {
14139 return {
14140 __op: 'BitOr',
14141 value: this.value()
14142 };
14143 },
14144 _mergeWithPrevious: function _mergeWithPrevious(previous) {
14145 if (!previous) {
14146 return this;
14147 } else if (previous instanceof AV.Op.Unset) {
14148 return new AV.Op.Set(this.value());
14149 } else if (previous instanceof AV.Op.Set) {
14150 return new AV.Op.Set(previous.value() | this.value());
14151 } else {
14152 throw new Error('Op is invalid after previous op.');
14153 }
14154 },
14155 _estimate: function _estimate(oldValue) {
14156 return oldValue | this.value();
14157 }
14158 });
14159
14160 AV.Op._registerDecoder('BitOr', function (json) {
14161 return new AV.Op.BitOr(json.value);
14162 });
14163 /**
14164 * @private
14165 * @class
14166 * BitXor is an atomic operation where the given value will be bit and to the
14167 * value than is stored in this field.
14168 */
14169
14170
14171 AV.Op.BitXor = AV.Op._extend(
14172 /** @lends AV.Op.BitXor.prototype */
14173 {
14174 _initialize: function _initialize(value) {
14175 this._value = value;
14176 },
14177 value: function value() {
14178 return this._value;
14179 },
14180
14181 /**
14182 * Returns a JSON version of the operation suitable for sending to AV.
14183 * @return {Object}
14184 */
14185 toJSON: function toJSON() {
14186 return {
14187 __op: 'BitXor',
14188 value: this.value()
14189 };
14190 },
14191 _mergeWithPrevious: function _mergeWithPrevious(previous) {
14192 if (!previous) {
14193 return this;
14194 } else if (previous instanceof AV.Op.Unset) {
14195 return new AV.Op.Set(this.value());
14196 } else if (previous instanceof AV.Op.Set) {
14197 return new AV.Op.Set(previous.value() ^ this.value());
14198 } else {
14199 throw new Error('Op is invalid after previous op.');
14200 }
14201 },
14202 _estimate: function _estimate(oldValue) {
14203 return oldValue ^ this.value();
14204 }
14205 });
14206
14207 AV.Op._registerDecoder('BitXor', function (json) {
14208 return new AV.Op.BitXor(json.value);
14209 });
14210 /**
14211 * @private
14212 * @class
14213 * Add is an atomic operation where the given objects will be appended to the
14214 * array that is stored in this field.
14215 */
14216
14217
14218 AV.Op.Add = AV.Op._extend(
14219 /** @lends AV.Op.Add.prototype */
14220 {
14221 _initialize: function _initialize(objects) {
14222 this._objects = objects;
14223 },
14224
14225 /**
14226 * Returns the objects to be added to the array.
14227 * @return {Array} The objects to be added to the array.
14228 */
14229 objects: function objects() {
14230 return this._objects;
14231 },
14232
14233 /**
14234 * Returns a JSON version of the operation suitable for sending to AV.
14235 * @return {Object}
14236 */
14237 toJSON: function toJSON() {
14238 return {
14239 __op: 'Add',
14240 objects: AV._encode(this.objects())
14241 };
14242 },
14243 _mergeWithPrevious: function _mergeWithPrevious(previous) {
14244 if (!previous) {
14245 return this;
14246 } else if (previous instanceof AV.Op.Unset) {
14247 return new AV.Op.Set(this.objects());
14248 } else if (previous instanceof AV.Op.Set) {
14249 return new AV.Op.Set(this._estimate(previous.value()));
14250 } else if (previous instanceof AV.Op.Add) {
14251 var _context;
14252
14253 return new AV.Op.Add((0, _concat.default)(_context = previous.objects()).call(_context, this.objects()));
14254 } else {
14255 throw new Error('Op is invalid after previous op.');
14256 }
14257 },
14258 _estimate: function _estimate(oldValue) {
14259 if (!oldValue) {
14260 return _.clone(this.objects());
14261 } else {
14262 return (0, _concat.default)(oldValue).call(oldValue, this.objects());
14263 }
14264 }
14265 });
14266
14267 AV.Op._registerDecoder('Add', function (json) {
14268 return new AV.Op.Add(AV._decode(json.objects));
14269 });
14270 /**
14271 * @private
14272 * @class
14273 * AddUnique is an atomic operation where the given items will be appended to
14274 * the array that is stored in this field only if they were not already
14275 * present in the array.
14276 */
14277
14278
14279 AV.Op.AddUnique = AV.Op._extend(
14280 /** @lends AV.Op.AddUnique.prototype */
14281 {
14282 _initialize: function _initialize(objects) {
14283 this._objects = _.uniq(objects);
14284 },
14285
14286 /**
14287 * Returns the objects to be added to the array.
14288 * @return {Array} The objects to be added to the array.
14289 */
14290 objects: function objects() {
14291 return this._objects;
14292 },
14293
14294 /**
14295 * Returns a JSON version of the operation suitable for sending to AV.
14296 * @return {Object}
14297 */
14298 toJSON: function toJSON() {
14299 return {
14300 __op: 'AddUnique',
14301 objects: AV._encode(this.objects())
14302 };
14303 },
14304 _mergeWithPrevious: function _mergeWithPrevious(previous) {
14305 if (!previous) {
14306 return this;
14307 } else if (previous instanceof AV.Op.Unset) {
14308 return new AV.Op.Set(this.objects());
14309 } else if (previous instanceof AV.Op.Set) {
14310 return new AV.Op.Set(this._estimate(previous.value()));
14311 } else if (previous instanceof AV.Op.AddUnique) {
14312 return new AV.Op.AddUnique(this._estimate(previous.objects()));
14313 } else {
14314 throw new Error('Op is invalid after previous op.');
14315 }
14316 },
14317 _estimate: function _estimate(oldValue) {
14318 if (!oldValue) {
14319 return _.clone(this.objects());
14320 } else {
14321 // We can't just take the _.uniq(_.union(...)) of oldValue and
14322 // this.objects, because the uniqueness may not apply to oldValue
14323 // (especially if the oldValue was set via .set())
14324 var newValue = _.clone(oldValue);
14325
14326 AV._arrayEach(this.objects(), function (obj) {
14327 if (obj instanceof AV.Object && obj.id) {
14328 var matchingObj = (0, _find.default)(_).call(_, newValue, function (anObj) {
14329 return anObj instanceof AV.Object && anObj.id === obj.id;
14330 });
14331
14332 if (!matchingObj) {
14333 newValue.push(obj);
14334 } else {
14335 var index = (0, _indexOf.default)(_).call(_, newValue, matchingObj);
14336 newValue[index] = obj;
14337 }
14338 } else if (!_.contains(newValue, obj)) {
14339 newValue.push(obj);
14340 }
14341 });
14342
14343 return newValue;
14344 }
14345 }
14346 });
14347
14348 AV.Op._registerDecoder('AddUnique', function (json) {
14349 return new AV.Op.AddUnique(AV._decode(json.objects));
14350 });
14351 /**
14352 * @private
14353 * @class
14354 * Remove is an atomic operation where the given objects will be removed from
14355 * the array that is stored in this field.
14356 */
14357
14358
14359 AV.Op.Remove = AV.Op._extend(
14360 /** @lends AV.Op.Remove.prototype */
14361 {
14362 _initialize: function _initialize(objects) {
14363 this._objects = _.uniq(objects);
14364 },
14365
14366 /**
14367 * Returns the objects to be removed from the array.
14368 * @return {Array} The objects to be removed from the array.
14369 */
14370 objects: function objects() {
14371 return this._objects;
14372 },
14373
14374 /**
14375 * Returns a JSON version of the operation suitable for sending to AV.
14376 * @return {Object}
14377 */
14378 toJSON: function toJSON() {
14379 return {
14380 __op: 'Remove',
14381 objects: AV._encode(this.objects())
14382 };
14383 },
14384 _mergeWithPrevious: function _mergeWithPrevious(previous) {
14385 if (!previous) {
14386 return this;
14387 } else if (previous instanceof AV.Op.Unset) {
14388 return previous;
14389 } else if (previous instanceof AV.Op.Set) {
14390 return new AV.Op.Set(this._estimate(previous.value()));
14391 } else if (previous instanceof AV.Op.Remove) {
14392 return new AV.Op.Remove(_.union(previous.objects(), this.objects()));
14393 } else {
14394 throw new Error('Op is invalid after previous op.');
14395 }
14396 },
14397 _estimate: function _estimate(oldValue) {
14398 if (!oldValue) {
14399 return [];
14400 } else {
14401 var newValue = _.difference(oldValue, this.objects()); // If there are saved AV Objects being removed, also remove them.
14402
14403
14404 AV._arrayEach(this.objects(), function (obj) {
14405 if (obj instanceof AV.Object && obj.id) {
14406 newValue = _.reject(newValue, function (other) {
14407 return other instanceof AV.Object && other.id === obj.id;
14408 });
14409 }
14410 });
14411
14412 return newValue;
14413 }
14414 }
14415 });
14416
14417 AV.Op._registerDecoder('Remove', function (json) {
14418 return new AV.Op.Remove(AV._decode(json.objects));
14419 });
14420 /**
14421 * @private
14422 * @class
14423 * A Relation operation indicates that the field is an instance of
14424 * AV.Relation, and objects are being added to, or removed from, that
14425 * relation.
14426 */
14427
14428
14429 AV.Op.Relation = AV.Op._extend(
14430 /** @lends AV.Op.Relation.prototype */
14431 {
14432 _initialize: function _initialize(adds, removes) {
14433 this._targetClassName = null;
14434 var self = this;
14435
14436 var pointerToId = function pointerToId(object) {
14437 if (object instanceof AV.Object) {
14438 if (!object.id) {
14439 throw new Error("You can't add an unsaved AV.Object to a relation.");
14440 }
14441
14442 if (!self._targetClassName) {
14443 self._targetClassName = object.className;
14444 }
14445
14446 if (self._targetClassName !== object.className) {
14447 throw new Error('Tried to create a AV.Relation with 2 different types: ' + self._targetClassName + ' and ' + object.className + '.');
14448 }
14449
14450 return object.id;
14451 }
14452
14453 return object;
14454 };
14455
14456 this.relationsToAdd = _.uniq((0, _map.default)(_).call(_, adds, pointerToId));
14457 this.relationsToRemove = _.uniq((0, _map.default)(_).call(_, removes, pointerToId));
14458 },
14459
14460 /**
14461 * Returns an array of unfetched AV.Object that are being added to the
14462 * relation.
14463 * @return {Array}
14464 */
14465 added: function added() {
14466 var self = this;
14467 return (0, _map.default)(_).call(_, this.relationsToAdd, function (objectId) {
14468 var object = AV.Object._create(self._targetClassName);
14469
14470 object.id = objectId;
14471 return object;
14472 });
14473 },
14474
14475 /**
14476 * Returns an array of unfetched AV.Object that are being removed from
14477 * the relation.
14478 * @return {Array}
14479 */
14480 removed: function removed() {
14481 var self = this;
14482 return (0, _map.default)(_).call(_, this.relationsToRemove, function (objectId) {
14483 var object = AV.Object._create(self._targetClassName);
14484
14485 object.id = objectId;
14486 return object;
14487 });
14488 },
14489
14490 /**
14491 * Returns a JSON version of the operation suitable for sending to AV.
14492 * @return {Object}
14493 */
14494 toJSON: function toJSON() {
14495 var adds = null;
14496 var removes = null;
14497 var self = this;
14498
14499 var idToPointer = function idToPointer(id) {
14500 return {
14501 __type: 'Pointer',
14502 className: self._targetClassName,
14503 objectId: id
14504 };
14505 };
14506
14507 var pointers = null;
14508
14509 if (this.relationsToAdd.length > 0) {
14510 pointers = (0, _map.default)(_).call(_, this.relationsToAdd, idToPointer);
14511 adds = {
14512 __op: 'AddRelation',
14513 objects: pointers
14514 };
14515 }
14516
14517 if (this.relationsToRemove.length > 0) {
14518 pointers = (0, _map.default)(_).call(_, this.relationsToRemove, idToPointer);
14519 removes = {
14520 __op: 'RemoveRelation',
14521 objects: pointers
14522 };
14523 }
14524
14525 if (adds && removes) {
14526 return {
14527 __op: 'Batch',
14528 ops: [adds, removes]
14529 };
14530 }
14531
14532 return adds || removes || {};
14533 },
14534 _mergeWithPrevious: function _mergeWithPrevious(previous) {
14535 if (!previous) {
14536 return this;
14537 } else if (previous instanceof AV.Op.Unset) {
14538 throw new Error("You can't modify a relation after deleting it.");
14539 } else if (previous instanceof AV.Op.Relation) {
14540 if (previous._targetClassName && previous._targetClassName !== this._targetClassName) {
14541 throw new Error('Related object must be of class ' + previous._targetClassName + ', but ' + this._targetClassName + ' was passed in.');
14542 }
14543
14544 var newAdd = _.union(_.difference(previous.relationsToAdd, this.relationsToRemove), this.relationsToAdd);
14545
14546 var newRemove = _.union(_.difference(previous.relationsToRemove, this.relationsToAdd), this.relationsToRemove);
14547
14548 var newRelation = new AV.Op.Relation(newAdd, newRemove);
14549 newRelation._targetClassName = this._targetClassName;
14550 return newRelation;
14551 } else {
14552 throw new Error('Op is invalid after previous op.');
14553 }
14554 },
14555 _estimate: function _estimate(oldValue, object, key) {
14556 if (!oldValue) {
14557 var relation = new AV.Relation(object, key);
14558 relation.targetClassName = this._targetClassName;
14559 } else if (oldValue instanceof AV.Relation) {
14560 if (this._targetClassName) {
14561 if (oldValue.targetClassName) {
14562 if (oldValue.targetClassName !== this._targetClassName) {
14563 throw new Error('Related object must be a ' + oldValue.targetClassName + ', but a ' + this._targetClassName + ' was passed in.');
14564 }
14565 } else {
14566 oldValue.targetClassName = this._targetClassName;
14567 }
14568 }
14569
14570 return oldValue;
14571 } else {
14572 throw new Error('Op is invalid after previous op.');
14573 }
14574 }
14575 });
14576
14577 AV.Op._registerDecoder('AddRelation', function (json) {
14578 return new AV.Op.Relation(AV._decode(json.objects), []);
14579 });
14580
14581 AV.Op._registerDecoder('RemoveRelation', function (json) {
14582 return new AV.Op.Relation([], AV._decode(json.objects));
14583 });
14584};
14585
14586/***/ }),
14587/* 440 */
14588/***/ (function(module, exports, __webpack_require__) {
14589
14590var parent = __webpack_require__(441);
14591
14592module.exports = parent;
14593
14594
14595/***/ }),
14596/* 441 */
14597/***/ (function(module, exports, __webpack_require__) {
14598
14599var isPrototypeOf = __webpack_require__(20);
14600var method = __webpack_require__(442);
14601
14602var ArrayPrototype = Array.prototype;
14603
14604module.exports = function (it) {
14605 var own = it.find;
14606 return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.find) ? method : own;
14607};
14608
14609
14610/***/ }),
14611/* 442 */
14612/***/ (function(module, exports, __webpack_require__) {
14613
14614__webpack_require__(443);
14615var entryVirtual = __webpack_require__(38);
14616
14617module.exports = entryVirtual('Array').find;
14618
14619
14620/***/ }),
14621/* 443 */
14622/***/ (function(module, exports, __webpack_require__) {
14623
14624"use strict";
14625
14626var $ = __webpack_require__(0);
14627var $find = __webpack_require__(101).find;
14628var addToUnscopables = __webpack_require__(152);
14629
14630var FIND = 'find';
14631var SKIPS_HOLES = true;
14632
14633// Shouldn't skip holes
14634if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
14635
14636// `Array.prototype.find` method
14637// https://tc39.es/ecma262/#sec-array.prototype.find
14638$({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
14639 find: function find(callbackfn /* , that = undefined */) {
14640 return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
14641 }
14642});
14643
14644// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
14645addToUnscopables(FIND);
14646
14647
14648/***/ }),
14649/* 444 */
14650/***/ (function(module, exports, __webpack_require__) {
14651
14652"use strict";
14653
14654
14655var _ = __webpack_require__(1);
14656
14657module.exports = function (AV) {
14658 /**
14659 * Creates a new Relation for the given parent object and key. This
14660 * constructor should rarely be used directly, but rather created by
14661 * {@link AV.Object#relation}.
14662 * @param {AV.Object} parent The parent of this relation.
14663 * @param {String} key The key for this relation on the parent.
14664 * @see AV.Object#relation
14665 * @class
14666 *
14667 * <p>
14668 * A class that is used to access all of the children of a many-to-many
14669 * relationship. Each instance of AV.Relation is associated with a
14670 * particular parent object and key.
14671 * </p>
14672 */
14673 AV.Relation = function (parent, key) {
14674 if (!_.isString(key)) {
14675 throw new TypeError('key must be a string');
14676 }
14677
14678 this.parent = parent;
14679 this.key = key;
14680 this.targetClassName = null;
14681 };
14682 /**
14683 * Creates a query that can be used to query the parent objects in this relation.
14684 * @param {String} parentClass The parent class or name.
14685 * @param {String} relationKey The relation field key in parent.
14686 * @param {AV.Object} child The child object.
14687 * @return {AV.Query}
14688 */
14689
14690
14691 AV.Relation.reverseQuery = function (parentClass, relationKey, child) {
14692 var query = new AV.Query(parentClass);
14693 query.equalTo(relationKey, child._toPointer());
14694 return query;
14695 };
14696
14697 _.extend(AV.Relation.prototype,
14698 /** @lends AV.Relation.prototype */
14699 {
14700 /**
14701 * Makes sure that this relation has the right parent and key.
14702 * @private
14703 */
14704 _ensureParentAndKey: function _ensureParentAndKey(parent, key) {
14705 this.parent = this.parent || parent;
14706 this.key = this.key || key;
14707
14708 if (this.parent !== parent) {
14709 throw new Error('Internal Error. Relation retrieved from two different Objects.');
14710 }
14711
14712 if (this.key !== key) {
14713 throw new Error('Internal Error. Relation retrieved from two different keys.');
14714 }
14715 },
14716
14717 /**
14718 * Adds a AV.Object or an array of AV.Objects to the relation.
14719 * @param {AV.Object|AV.Object[]} objects The item or items to add.
14720 */
14721 add: function add(objects) {
14722 if (!_.isArray(objects)) {
14723 objects = [objects];
14724 }
14725
14726 var change = new AV.Op.Relation(objects, []);
14727 this.parent.set(this.key, change);
14728 this.targetClassName = change._targetClassName;
14729 },
14730
14731 /**
14732 * Removes a AV.Object or an array of AV.Objects from this relation.
14733 * @param {AV.Object|AV.Object[]} objects The item or items to remove.
14734 */
14735 remove: function remove(objects) {
14736 if (!_.isArray(objects)) {
14737 objects = [objects];
14738 }
14739
14740 var change = new AV.Op.Relation([], objects);
14741 this.parent.set(this.key, change);
14742 this.targetClassName = change._targetClassName;
14743 },
14744
14745 /**
14746 * Returns a JSON version of the object suitable for saving to disk.
14747 * @return {Object}
14748 */
14749 toJSON: function toJSON() {
14750 return {
14751 __type: 'Relation',
14752 className: this.targetClassName
14753 };
14754 },
14755
14756 /**
14757 * Returns a AV.Query that is limited to objects in this
14758 * relation.
14759 * @return {AV.Query}
14760 */
14761 query: function query() {
14762 var targetClass;
14763 var query;
14764
14765 if (!this.targetClassName) {
14766 targetClass = AV.Object._getSubclass(this.parent.className);
14767 query = new AV.Query(targetClass);
14768 query._defaultParams.redirectClassNameForKey = this.key;
14769 } else {
14770 targetClass = AV.Object._getSubclass(this.targetClassName);
14771 query = new AV.Query(targetClass);
14772 }
14773
14774 query._addCondition('$relatedTo', 'object', this.parent._toPointer());
14775
14776 query._addCondition('$relatedTo', 'key', this.key);
14777
14778 return query;
14779 }
14780 });
14781};
14782
14783/***/ }),
14784/* 445 */
14785/***/ (function(module, exports, __webpack_require__) {
14786
14787"use strict";
14788
14789
14790var _interopRequireDefault = __webpack_require__(2);
14791
14792var _promise = _interopRequireDefault(__webpack_require__(12));
14793
14794var _ = __webpack_require__(1);
14795
14796var cos = __webpack_require__(446);
14797
14798var qiniu = __webpack_require__(447);
14799
14800var s3 = __webpack_require__(495);
14801
14802var AVError = __webpack_require__(40);
14803
14804var _require = __webpack_require__(25),
14805 request = _require.request,
14806 AVRequest = _require._request;
14807
14808var _require2 = __webpack_require__(28),
14809 tap = _require2.tap,
14810 transformFetchOptions = _require2.transformFetchOptions;
14811
14812var debug = __webpack_require__(60)('leancloud:file');
14813
14814var parseBase64 = __webpack_require__(499);
14815
14816module.exports = function (AV) {
14817 // port from browserify path module
14818 // since react-native packager won't shim node modules.
14819 var extname = function extname(path) {
14820 if (!_.isString(path)) return '';
14821 return path.match(/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/)[4];
14822 };
14823
14824 var b64Digit = function b64Digit(number) {
14825 if (number < 26) {
14826 return String.fromCharCode(65 + number);
14827 }
14828
14829 if (number < 52) {
14830 return String.fromCharCode(97 + (number - 26));
14831 }
14832
14833 if (number < 62) {
14834 return String.fromCharCode(48 + (number - 52));
14835 }
14836
14837 if (number === 62) {
14838 return '+';
14839 }
14840
14841 if (number === 63) {
14842 return '/';
14843 }
14844
14845 throw new Error('Tried to encode large digit ' + number + ' in base64.');
14846 };
14847
14848 var encodeBase64 = function encodeBase64(array) {
14849 var chunks = [];
14850 chunks.length = Math.ceil(array.length / 3);
14851
14852 _.times(chunks.length, function (i) {
14853 var b1 = array[i * 3];
14854 var b2 = array[i * 3 + 1] || 0;
14855 var b3 = array[i * 3 + 2] || 0;
14856 var has2 = i * 3 + 1 < array.length;
14857 var has3 = i * 3 + 2 < array.length;
14858 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('');
14859 });
14860
14861 return chunks.join('');
14862 };
14863 /**
14864 * An AV.File is a local representation of a file that is saved to the AV
14865 * cloud.
14866 * @param name {String} The file's name. This will change to a unique value
14867 * once the file has finished saving.
14868 * @param data {Array} The data for the file, as either:
14869 * 1. an Array of byte value Numbers, or
14870 * 2. an Object like { base64: "..." } with a base64-encoded String.
14871 * 3. a Blob(File) selected with a file upload control in a browser.
14872 * 4. an Object like { blob: {uri: "..."} } that mimics Blob
14873 * in some non-browser environments such as React Native.
14874 * 5. a Buffer in Node.js runtime.
14875 * 6. a Stream in Node.js runtime.
14876 *
14877 * For example:<pre>
14878 * var fileUploadControl = $("#profilePhotoFileUpload")[0];
14879 * if (fileUploadControl.files.length > 0) {
14880 * var file = fileUploadControl.files[0];
14881 * var name = "photo.jpg";
14882 * var file = new AV.File(name, file);
14883 * file.save().then(function() {
14884 * // The file has been saved to AV.
14885 * }, function(error) {
14886 * // The file either could not be read, or could not be saved to AV.
14887 * });
14888 * }</pre>
14889 *
14890 * @class
14891 * @param [mimeType] {String} Content-Type header to use for the file. If
14892 * this is omitted, the content type will be inferred from the name's
14893 * extension.
14894 */
14895
14896
14897 AV.File = function (name, data, mimeType) {
14898 this.attributes = {
14899 name: name,
14900 url: '',
14901 metaData: {},
14902 // 用来存储转换后要上传的 base64 String
14903 base64: ''
14904 };
14905
14906 if (_.isString(data)) {
14907 throw new TypeError('Creating an AV.File from a String is not yet supported.');
14908 }
14909
14910 if (_.isArray(data)) {
14911 this.attributes.metaData.size = data.length;
14912 data = {
14913 base64: encodeBase64(data)
14914 };
14915 }
14916
14917 this._extName = '';
14918 this._data = data;
14919 this._uploadHeaders = {};
14920
14921 if (data && data.blob && typeof data.blob.uri === 'string') {
14922 this._extName = extname(data.blob.uri);
14923 }
14924
14925 if (typeof Blob !== 'undefined' && data instanceof Blob) {
14926 if (data.size) {
14927 this.attributes.metaData.size = data.size;
14928 }
14929
14930 if (data.name) {
14931 this._extName = extname(data.name);
14932 }
14933 }
14934
14935 var owner;
14936
14937 if (data && data.owner) {
14938 owner = data.owner;
14939 } else if (!AV._config.disableCurrentUser) {
14940 try {
14941 owner = AV.User.current();
14942 } catch (error) {
14943 if ('SYNC_API_NOT_AVAILABLE' !== error.code) {
14944 throw error;
14945 }
14946 }
14947 }
14948
14949 this.attributes.metaData.owner = owner ? owner.id : 'unknown';
14950 this.set('mime_type', mimeType);
14951 };
14952 /**
14953 * Creates a fresh AV.File object with exists url for saving to AVOS Cloud.
14954 * @param {String} name the file name
14955 * @param {String} url the file url.
14956 * @param {Object} [metaData] the file metadata object.
14957 * @param {String} [type] Content-Type header to use for the file. If
14958 * this is omitted, the content type will be inferred from the name's
14959 * extension.
14960 * @return {AV.File} the file object
14961 */
14962
14963
14964 AV.File.withURL = function (name, url, metaData, type) {
14965 if (!name || !url) {
14966 throw new Error('Please provide file name and url');
14967 }
14968
14969 var file = new AV.File(name, null, type); //copy metaData properties to file.
14970
14971 if (metaData) {
14972 for (var prop in metaData) {
14973 if (!file.attributes.metaData[prop]) file.attributes.metaData[prop] = metaData[prop];
14974 }
14975 }
14976
14977 file.attributes.url = url; //Mark the file is from external source.
14978
14979 file.attributes.metaData.__source = 'external';
14980 file.attributes.metaData.size = 0;
14981 return file;
14982 };
14983 /**
14984 * Creates a file object with exists objectId.
14985 * @param {String} objectId The objectId string
14986 * @return {AV.File} the file object
14987 */
14988
14989
14990 AV.File.createWithoutData = function (objectId) {
14991 if (!objectId) {
14992 throw new TypeError('The objectId must be provided');
14993 }
14994
14995 var file = new AV.File();
14996 file.id = objectId;
14997 return file;
14998 };
14999 /**
15000 * Request file censor.
15001 * @since 4.13.0
15002 * @param {String} objectId
15003 * @return {Promise.<string>}
15004 */
15005
15006
15007 AV.File.censor = function (objectId) {
15008 if (!AV._config.masterKey) {
15009 throw new Error('Cannot censor a file without masterKey');
15010 }
15011
15012 return request({
15013 method: 'POST',
15014 path: "/files/".concat(objectId, "/censor"),
15015 authOptions: {
15016 useMasterKey: true
15017 }
15018 }).then(function (res) {
15019 return res.censorResult;
15020 });
15021 };
15022
15023 _.extend(AV.File.prototype,
15024 /** @lends AV.File.prototype */
15025 {
15026 className: '_File',
15027 _toFullJSON: function _toFullJSON(seenObjects) {
15028 var _this = this;
15029
15030 var full = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
15031
15032 var json = _.clone(this.attributes);
15033
15034 AV._objectEach(json, function (val, key) {
15035 json[key] = AV._encode(val, seenObjects, undefined, full);
15036 });
15037
15038 AV._objectEach(this._operations, function (val, key) {
15039 json[key] = val;
15040 });
15041
15042 if (_.has(this, 'id')) {
15043 json.objectId = this.id;
15044 }
15045
15046 ['createdAt', 'updatedAt'].forEach(function (key) {
15047 if (_.has(_this, key)) {
15048 var val = _this[key];
15049 json[key] = _.isDate(val) ? val.toJSON() : val;
15050 }
15051 });
15052
15053 if (full) {
15054 json.__type = 'File';
15055 }
15056
15057 return json;
15058 },
15059
15060 /**
15061 * Returns a JSON version of the file with meta data.
15062 * Inverse to {@link AV.parseJSON}
15063 * @since 3.0.0
15064 * @return {Object}
15065 */
15066 toFullJSON: function toFullJSON() {
15067 var seenObjects = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
15068 return this._toFullJSON(seenObjects);
15069 },
15070
15071 /**
15072 * Returns a JSON version of the object.
15073 * @return {Object}
15074 */
15075 toJSON: function toJSON(key, holder) {
15076 var seenObjects = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [this];
15077 return this._toFullJSON(seenObjects, false);
15078 },
15079
15080 /**
15081 * Gets a Pointer referencing this file.
15082 * @private
15083 */
15084 _toPointer: function _toPointer() {
15085 return {
15086 __type: 'Pointer',
15087 className: this.className,
15088 objectId: this.id
15089 };
15090 },
15091
15092 /**
15093 * Returns the ACL for this file.
15094 * @returns {AV.ACL} An instance of AV.ACL.
15095 */
15096 getACL: function getACL() {
15097 return this._acl;
15098 },
15099
15100 /**
15101 * Sets the ACL to be used for this file.
15102 * @param {AV.ACL} acl An instance of AV.ACL.
15103 */
15104 setACL: function setACL(acl) {
15105 if (!(acl instanceof AV.ACL)) {
15106 return new AVError(AVError.OTHER_CAUSE, 'ACL must be a AV.ACL.');
15107 }
15108
15109 this._acl = acl;
15110 return this;
15111 },
15112
15113 /**
15114 * Gets the name of the file. Before save is called, this is the filename
15115 * given by the user. After save is called, that name gets prefixed with a
15116 * unique identifier.
15117 */
15118 name: function name() {
15119 return this.get('name');
15120 },
15121
15122 /**
15123 * Gets the url of the file. It is only available after you save the file or
15124 * after you get the file from a AV.Object.
15125 * @return {String}
15126 */
15127 url: function url() {
15128 return this.get('url');
15129 },
15130
15131 /**
15132 * Gets the attributs of the file object.
15133 * @param {String} The attribute name which want to get.
15134 * @returns {Any}
15135 */
15136 get: function get(attrName) {
15137 switch (attrName) {
15138 case 'objectId':
15139 return this.id;
15140
15141 case 'url':
15142 case 'name':
15143 case 'mime_type':
15144 case 'metaData':
15145 case 'createdAt':
15146 case 'updatedAt':
15147 return this.attributes[attrName];
15148
15149 default:
15150 return this.attributes.metaData[attrName];
15151 }
15152 },
15153
15154 /**
15155 * Set the metaData of the file object.
15156 * @param {Object} Object is an key value Object for setting metaData.
15157 * @param {String} attr is an optional metadata key.
15158 * @param {Object} value is an optional metadata value.
15159 * @returns {String|Number|Array|Object}
15160 */
15161 set: function set() {
15162 var _this2 = this;
15163
15164 var set = function set(attrName, value) {
15165 switch (attrName) {
15166 case 'name':
15167 case 'url':
15168 case 'mime_type':
15169 case 'base64':
15170 case 'metaData':
15171 _this2.attributes[attrName] = value;
15172 break;
15173
15174 default:
15175 // File 并非一个 AVObject,不能完全自定义其他属性,所以只能都放在 metaData 上面
15176 _this2.attributes.metaData[attrName] = value;
15177 break;
15178 }
15179 };
15180
15181 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
15182 args[_key] = arguments[_key];
15183 }
15184
15185 switch (args.length) {
15186 case 1:
15187 // 传入一个 Object
15188 for (var k in args[0]) {
15189 set(k, args[0][k]);
15190 }
15191
15192 break;
15193
15194 case 2:
15195 set(args[0], args[1]);
15196 break;
15197 }
15198
15199 return this;
15200 },
15201
15202 /**
15203 * Set a header for the upload request.
15204 * For more infomation, go to https://url.leanapp.cn/avfile-upload-headers
15205 *
15206 * @param {String} key header key
15207 * @param {String} value header value
15208 * @return {AV.File} this
15209 */
15210 setUploadHeader: function setUploadHeader(key, value) {
15211 this._uploadHeaders[key] = value;
15212 return this;
15213 },
15214
15215 /**
15216 * <p>Returns the file's metadata JSON object if no arguments is given.Returns the
15217 * metadata value if a key is given.Set metadata value if key and value are both given.</p>
15218 * <p><pre>
15219 * var metadata = file.metaData(); //Get metadata JSON object.
15220 * var size = file.metaData('size'); // Get the size metadata value.
15221 * file.metaData('format', 'jpeg'); //set metadata attribute and value.
15222 *</pre></p>
15223 * @return {Object} The file's metadata JSON object.
15224 * @param {String} attr an optional metadata key.
15225 * @param {Object} value an optional metadata value.
15226 **/
15227 metaData: function metaData(attr, value) {
15228 if (attr && value) {
15229 this.attributes.metaData[attr] = value;
15230 return this;
15231 } else if (attr && !value) {
15232 return this.attributes.metaData[attr];
15233 } else {
15234 return this.attributes.metaData;
15235 }
15236 },
15237
15238 /**
15239 * 如果文件是图片,获取图片的缩略图URL。可以传入宽度、高度、质量、格式等参数。
15240 * @return {String} 缩略图URL
15241 * @param {Number} width 宽度,单位:像素
15242 * @param {Number} heigth 高度,单位:像素
15243 * @param {Number} quality 质量,1-100的数字,默认100
15244 * @param {Number} scaleToFit 是否将图片自适应大小。默认为true。
15245 * @param {String} fmt 格式,默认为png,也可以为jpeg,gif等格式。
15246 */
15247 thumbnailURL: function thumbnailURL(width, height) {
15248 var quality = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 100;
15249 var scaleToFit = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
15250 var fmt = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'png';
15251 var url = this.attributes.url;
15252
15253 if (!url) {
15254 throw new Error('Invalid url.');
15255 }
15256
15257 if (!width || !height || width <= 0 || height <= 0) {
15258 throw new Error('Invalid width or height value.');
15259 }
15260
15261 if (quality <= 0 || quality > 100) {
15262 throw new Error('Invalid quality value.');
15263 }
15264
15265 var mode = scaleToFit ? 2 : 1;
15266 return url + '?imageView/' + mode + '/w/' + width + '/h/' + height + '/q/' + quality + '/format/' + fmt;
15267 },
15268
15269 /**
15270 * Returns the file's size.
15271 * @return {Number} The file's size in bytes.
15272 **/
15273 size: function size() {
15274 return this.metaData().size;
15275 },
15276
15277 /**
15278 * Returns the file's owner.
15279 * @return {String} The file's owner id.
15280 */
15281 ownerId: function ownerId() {
15282 return this.metaData().owner;
15283 },
15284
15285 /**
15286 * Destroy the file.
15287 * @param {AuthOptions} options
15288 * @return {Promise} A promise that is fulfilled when the destroy
15289 * completes.
15290 */
15291 destroy: function destroy(options) {
15292 if (!this.id) {
15293 return _promise.default.reject(new Error('The file id does not eixst.'));
15294 }
15295
15296 var request = AVRequest('files', null, this.id, 'DELETE', null, options);
15297 return request;
15298 },
15299
15300 /**
15301 * Request Qiniu upload token
15302 * @param {string} type
15303 * @return {Promise} Resolved with the response
15304 * @private
15305 */
15306 _fileToken: function _fileToken(type, authOptions) {
15307 var name = this.attributes.name;
15308 var extName = extname(name);
15309
15310 if (!extName && this._extName) {
15311 name += this._extName;
15312 extName = this._extName;
15313 }
15314
15315 var data = {
15316 name: name,
15317 keep_file_name: authOptions.keepFileName,
15318 key: authOptions.key,
15319 ACL: this._acl,
15320 mime_type: type,
15321 metaData: this.attributes.metaData
15322 };
15323 return AVRequest('fileTokens', null, null, 'POST', data, authOptions);
15324 },
15325
15326 /**
15327 * @callback UploadProgressCallback
15328 * @param {XMLHttpRequestProgressEvent} event - The progress event with 'loaded' and 'total' attributes
15329 */
15330
15331 /**
15332 * Saves the file to the AV cloud.
15333 * @param {AuthOptions} [options] AuthOptions plus:
15334 * @param {UploadProgressCallback} [options.onprogress] 文件上传进度,在 Node.js 中无效,回调参数说明详见 {@link UploadProgressCallback}。
15335 * @param {boolean} [options.keepFileName = false] 保留下载文件的文件名。
15336 * @param {string} [options.key] 指定文件的 key。设置该选项需要使用 masterKey
15337 * @return {Promise} Promise that is resolved when the save finishes.
15338 */
15339 save: function save() {
15340 var _this3 = this;
15341
15342 var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
15343
15344 if (this.id) {
15345 throw new Error('File is already saved.');
15346 }
15347
15348 if (!this._previousSave) {
15349 if (this._data) {
15350 var mimeType = this.get('mime_type');
15351 this._previousSave = this._fileToken(mimeType, options).then(function (uploadInfo) {
15352 if (uploadInfo.mime_type) {
15353 mimeType = uploadInfo.mime_type;
15354
15355 _this3.set('mime_type', mimeType);
15356 }
15357
15358 _this3._token = uploadInfo.token;
15359 return _promise.default.resolve().then(function () {
15360 var data = _this3._data;
15361
15362 if (data && data.base64) {
15363 return parseBase64(data.base64, mimeType);
15364 }
15365
15366 if (data && data.blob) {
15367 if (!data.blob.type && mimeType) {
15368 data.blob.type = mimeType;
15369 }
15370
15371 if (!data.blob.name) {
15372 data.blob.name = _this3.get('name');
15373 }
15374
15375 return data.blob;
15376 }
15377
15378 if (typeof Blob !== 'undefined' && data instanceof Blob) {
15379 return data;
15380 }
15381
15382 throw new TypeError('malformed file data');
15383 }).then(function (data) {
15384 var _options = _.extend({}, options); // filter out download progress events
15385
15386
15387 if (options.onprogress) {
15388 _options.onprogress = function (event) {
15389 if (event.direction === 'download') return;
15390 return options.onprogress(event);
15391 };
15392 }
15393
15394 switch (uploadInfo.provider) {
15395 case 's3':
15396 return s3(uploadInfo, data, _this3, _options);
15397
15398 case 'qcloud':
15399 return cos(uploadInfo, data, _this3, _options);
15400
15401 case 'qiniu':
15402 default:
15403 return qiniu(uploadInfo, data, _this3, _options);
15404 }
15405 }).then(tap(function () {
15406 return _this3._callback(true);
15407 }), function (error) {
15408 _this3._callback(false);
15409
15410 throw error;
15411 });
15412 });
15413 } else if (this.attributes.url && this.attributes.metaData.__source === 'external') {
15414 // external link file.
15415 var data = {
15416 name: this.attributes.name,
15417 ACL: this._acl,
15418 metaData: this.attributes.metaData,
15419 mime_type: this.mimeType,
15420 url: this.attributes.url
15421 };
15422 this._previousSave = AVRequest('files', null, null, 'post', data, options).then(function (response) {
15423 _this3.id = response.objectId;
15424 return _this3;
15425 });
15426 }
15427 }
15428
15429 return this._previousSave;
15430 },
15431 _callback: function _callback(success) {
15432 AVRequest('fileCallback', null, null, 'post', {
15433 token: this._token,
15434 result: success
15435 }).catch(debug);
15436 delete this._token;
15437 delete this._data;
15438 },
15439
15440 /**
15441 * fetch the file from server. If the server's representation of the
15442 * model differs from its current attributes, they will be overriden,
15443 * @param {Object} fetchOptions Optional options to set 'keys',
15444 * 'include' and 'includeACL' option.
15445 * @param {AuthOptions} options
15446 * @return {Promise} A promise that is fulfilled when the fetch
15447 * completes.
15448 */
15449 fetch: function fetch(fetchOptions, options) {
15450 if (!this.id) {
15451 throw new Error('Cannot fetch unsaved file');
15452 }
15453
15454 var request = AVRequest('files', null, this.id, 'GET', transformFetchOptions(fetchOptions), options);
15455 return request.then(this._finishFetch.bind(this));
15456 },
15457 _finishFetch: function _finishFetch(response) {
15458 var value = AV.Object.prototype.parse(response);
15459 value.attributes = {
15460 name: value.name,
15461 url: value.url,
15462 mime_type: value.mime_type,
15463 bucket: value.bucket
15464 };
15465 value.attributes.metaData = value.metaData || {};
15466 value.id = value.objectId; // clean
15467
15468 delete value.objectId;
15469 delete value.metaData;
15470 delete value.url;
15471 delete value.name;
15472 delete value.mime_type;
15473 delete value.bucket;
15474
15475 _.extend(this, value);
15476
15477 return this;
15478 },
15479
15480 /**
15481 * Request file censor
15482 * @since 4.13.0
15483 * @return {Promise.<string>}
15484 */
15485 censor: function censor() {
15486 if (!this.id) {
15487 throw new Error('Cannot censor an unsaved file');
15488 }
15489
15490 return AV.File.censor(this.id);
15491 }
15492 });
15493};
15494
15495/***/ }),
15496/* 446 */
15497/***/ (function(module, exports, __webpack_require__) {
15498
15499"use strict";
15500
15501
15502var _require = __webpack_require__(61),
15503 getAdapter = _require.getAdapter;
15504
15505var debug = __webpack_require__(60)('cos');
15506
15507module.exports = function (uploadInfo, data, file) {
15508 var saveOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
15509 var url = uploadInfo.upload_url + '?sign=' + encodeURIComponent(uploadInfo.token);
15510 var fileFormData = {
15511 field: 'fileContent',
15512 data: data,
15513 name: file.attributes.name
15514 };
15515 var options = {
15516 headers: file._uploadHeaders,
15517 data: {
15518 op: 'upload'
15519 },
15520 onprogress: saveOptions.onprogress
15521 };
15522 debug('url: %s, file: %o, options: %o', url, fileFormData, options);
15523 var upload = getAdapter('upload');
15524 return upload(url, fileFormData, options).then(function (response) {
15525 debug(response.status, response.data);
15526
15527 if (response.ok === false) {
15528 var error = new Error(response.status);
15529 error.response = response;
15530 throw error;
15531 }
15532
15533 file.attributes.url = uploadInfo.url;
15534 file._bucket = uploadInfo.bucket;
15535 file.id = uploadInfo.objectId;
15536 return file;
15537 }, function (error) {
15538 var response = error.response;
15539
15540 if (response) {
15541 debug(response.status, response.data);
15542 error.statusCode = response.status;
15543 error.response = response.data;
15544 }
15545
15546 throw error;
15547 });
15548};
15549
15550/***/ }),
15551/* 447 */
15552/***/ (function(module, exports, __webpack_require__) {
15553
15554"use strict";
15555
15556
15557var _sliceInstanceProperty2 = __webpack_require__(81);
15558
15559var _Array$from = __webpack_require__(448);
15560
15561var _Symbol = __webpack_require__(453);
15562
15563var _getIteratorMethod = __webpack_require__(231);
15564
15565var _Reflect$construct = __webpack_require__(459);
15566
15567var _interopRequireDefault = __webpack_require__(2);
15568
15569var _inherits2 = _interopRequireDefault(__webpack_require__(463));
15570
15571var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(485));
15572
15573var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(487));
15574
15575var _classCallCheck2 = _interopRequireDefault(__webpack_require__(492));
15576
15577var _createClass2 = _interopRequireDefault(__webpack_require__(493));
15578
15579var _stringify = _interopRequireDefault(__webpack_require__(34));
15580
15581var _concat = _interopRequireDefault(__webpack_require__(29));
15582
15583var _promise = _interopRequireDefault(__webpack_require__(12));
15584
15585var _slice = _interopRequireDefault(__webpack_require__(81));
15586
15587function _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); }; }
15588
15589function _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; } }
15590
15591function _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; } } }; }
15592
15593function _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); }
15594
15595function _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; }
15596
15597var _require = __webpack_require__(61),
15598 getAdapter = _require.getAdapter;
15599
15600var debug = __webpack_require__(60)('leancloud:qiniu');
15601
15602var ajax = __webpack_require__(103);
15603
15604var btoa = __webpack_require__(494);
15605
15606var SHARD_THRESHOLD = 1024 * 1024 * 64;
15607var CHUNK_SIZE = 1024 * 1024 * 16;
15608
15609function upload(uploadInfo, data, file) {
15610 var saveOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
15611 // Get the uptoken to upload files to qiniu.
15612 var uptoken = uploadInfo.token;
15613 var url = uploadInfo.upload_url || 'https://upload.qiniup.com';
15614 var fileFormData = {
15615 field: 'file',
15616 data: data,
15617 name: file.attributes.name
15618 };
15619 var options = {
15620 headers: file._uploadHeaders,
15621 data: {
15622 name: file.attributes.name,
15623 key: uploadInfo.key,
15624 token: uptoken
15625 },
15626 onprogress: saveOptions.onprogress
15627 };
15628 debug('url: %s, file: %o, options: %o', url, fileFormData, options);
15629 var upload = getAdapter('upload');
15630 return upload(url, fileFormData, options).then(function (response) {
15631 debug(response.status, response.data);
15632
15633 if (response.ok === false) {
15634 var message = response.status;
15635
15636 if (response.data) {
15637 if (response.data.error) {
15638 message = response.data.error;
15639 } else {
15640 message = (0, _stringify.default)(response.data);
15641 }
15642 }
15643
15644 var error = new Error(message);
15645 error.response = response;
15646 throw error;
15647 }
15648
15649 file.attributes.url = uploadInfo.url;
15650 file._bucket = uploadInfo.bucket;
15651 file.id = uploadInfo.objectId;
15652 return file;
15653 }, function (error) {
15654 var response = error.response;
15655
15656 if (response) {
15657 debug(response.status, response.data);
15658 error.statusCode = response.status;
15659 error.response = response.data;
15660 }
15661
15662 throw error;
15663 });
15664}
15665
15666function urlSafeBase64(string) {
15667 var base64 = btoa(unescape(encodeURIComponent(string)));
15668 var result = '';
15669
15670 var _iterator = _createForOfIteratorHelper(base64),
15671 _step;
15672
15673 try {
15674 for (_iterator.s(); !(_step = _iterator.n()).done;) {
15675 var ch = _step.value;
15676
15677 switch (ch) {
15678 case '+':
15679 result += '-';
15680 break;
15681
15682 case '/':
15683 result += '_';
15684 break;
15685
15686 default:
15687 result += ch;
15688 }
15689 }
15690 } catch (err) {
15691 _iterator.e(err);
15692 } finally {
15693 _iterator.f();
15694 }
15695
15696 return result;
15697}
15698
15699var ShardUploader = /*#__PURE__*/function () {
15700 function ShardUploader(uploadInfo, data, file, saveOptions) {
15701 var _context,
15702 _context2,
15703 _this = this;
15704
15705 (0, _classCallCheck2.default)(this, ShardUploader);
15706 this.uploadInfo = uploadInfo;
15707 this.data = data;
15708 this.file = file;
15709 this.size = undefined;
15710 this.offset = 0;
15711 this.uploadedChunks = 0;
15712 var key = urlSafeBase64(uploadInfo.key);
15713 var uploadURL = uploadInfo.upload_url || 'https://upload.qiniup.com';
15714 this.baseURL = (0, _concat.default)(_context = (0, _concat.default)(_context2 = "".concat(uploadURL, "/buckets/")).call(_context2, uploadInfo.bucket, "/objects/")).call(_context, key, "/uploads");
15715 this.upToken = 'UpToken ' + uploadInfo.token;
15716 this.uploaded = 0;
15717
15718 if (saveOptions && saveOptions.onprogress) {
15719 this.onProgress = function (_ref) {
15720 var loaded = _ref.loaded;
15721 loaded += _this.uploadedChunks * CHUNK_SIZE;
15722
15723 if (loaded <= _this.uploaded) {
15724 return;
15725 }
15726
15727 if (_this.size) {
15728 saveOptions.onprogress({
15729 loaded: loaded,
15730 total: _this.size,
15731 percent: loaded / _this.size * 100
15732 });
15733 } else {
15734 saveOptions.onprogress({
15735 loaded: loaded
15736 });
15737 }
15738
15739 _this.uploaded = loaded;
15740 };
15741 }
15742 }
15743 /**
15744 * @returns {Promise<string>}
15745 */
15746
15747
15748 (0, _createClass2.default)(ShardUploader, [{
15749 key: "getUploadId",
15750 value: function getUploadId() {
15751 return ajax({
15752 method: 'POST',
15753 url: this.baseURL,
15754 headers: {
15755 Authorization: this.upToken
15756 }
15757 }).then(function (res) {
15758 return res.uploadId;
15759 });
15760 }
15761 }, {
15762 key: "getChunk",
15763 value: function getChunk() {
15764 throw new Error('Not implemented');
15765 }
15766 /**
15767 * @param {string} uploadId
15768 * @param {number} partNumber
15769 * @param {any} data
15770 * @returns {Promise<{ partNumber: number, etag: string }>}
15771 */
15772
15773 }, {
15774 key: "uploadPart",
15775 value: function uploadPart(uploadId, partNumber, data) {
15776 var _context3, _context4;
15777
15778 return ajax({
15779 method: 'PUT',
15780 url: (0, _concat.default)(_context3 = (0, _concat.default)(_context4 = "".concat(this.baseURL, "/")).call(_context4, uploadId, "/")).call(_context3, partNumber),
15781 headers: {
15782 Authorization: this.upToken
15783 },
15784 data: data,
15785 onprogress: this.onProgress
15786 }).then(function (_ref2) {
15787 var etag = _ref2.etag;
15788 return {
15789 partNumber: partNumber,
15790 etag: etag
15791 };
15792 });
15793 }
15794 }, {
15795 key: "stopUpload",
15796 value: function stopUpload(uploadId) {
15797 var _context5;
15798
15799 return ajax({
15800 method: 'DELETE',
15801 url: (0, _concat.default)(_context5 = "".concat(this.baseURL, "/")).call(_context5, uploadId),
15802 headers: {
15803 Authorization: this.upToken
15804 }
15805 });
15806 }
15807 }, {
15808 key: "upload",
15809 value: function upload() {
15810 var _this2 = this;
15811
15812 var parts = [];
15813 return this.getUploadId().then(function (uploadId) {
15814 var uploadPart = function uploadPart() {
15815 return _promise.default.resolve(_this2.getChunk()).then(function (chunk) {
15816 if (!chunk) {
15817 return;
15818 }
15819
15820 var partNumber = parts.length + 1;
15821 return _this2.uploadPart(uploadId, partNumber, chunk).then(function (part) {
15822 parts.push(part);
15823 _this2.uploadedChunks++;
15824 return uploadPart();
15825 });
15826 }).catch(function (error) {
15827 return _this2.stopUpload(uploadId).then(function () {
15828 return _promise.default.reject(error);
15829 });
15830 });
15831 };
15832
15833 return uploadPart().then(function () {
15834 var _context6;
15835
15836 return ajax({
15837 method: 'POST',
15838 url: (0, _concat.default)(_context6 = "".concat(_this2.baseURL, "/")).call(_context6, uploadId),
15839 headers: {
15840 Authorization: _this2.upToken
15841 },
15842 data: {
15843 parts: parts,
15844 fname: _this2.file.attributes.name,
15845 mimeType: _this2.file.attributes.mime_type
15846 }
15847 });
15848 });
15849 }).then(function () {
15850 _this2.file.attributes.url = _this2.uploadInfo.url;
15851 _this2.file._bucket = _this2.uploadInfo.bucket;
15852 _this2.file.id = _this2.uploadInfo.objectId;
15853 return _this2.file;
15854 });
15855 }
15856 }]);
15857 return ShardUploader;
15858}();
15859
15860var BlobUploader = /*#__PURE__*/function (_ShardUploader) {
15861 (0, _inherits2.default)(BlobUploader, _ShardUploader);
15862
15863 var _super = _createSuper(BlobUploader);
15864
15865 function BlobUploader(uploadInfo, data, file, saveOptions) {
15866 var _this3;
15867
15868 (0, _classCallCheck2.default)(this, BlobUploader);
15869 _this3 = _super.call(this, uploadInfo, data, file, saveOptions);
15870 _this3.size = data.size;
15871 return _this3;
15872 }
15873 /**
15874 * @returns {Blob | null}
15875 */
15876
15877
15878 (0, _createClass2.default)(BlobUploader, [{
15879 key: "getChunk",
15880 value: function getChunk() {
15881 var _context7;
15882
15883 if (this.offset >= this.size) {
15884 return null;
15885 }
15886
15887 var chunk = (0, _slice.default)(_context7 = this.data).call(_context7, this.offset, this.offset + CHUNK_SIZE);
15888 this.offset += chunk.size;
15889 return chunk;
15890 }
15891 }]);
15892 return BlobUploader;
15893}(ShardUploader);
15894
15895function isBlob(data) {
15896 return typeof Blob !== 'undefined' && data instanceof Blob;
15897}
15898
15899module.exports = function (uploadInfo, data, file) {
15900 var saveOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
15901
15902 if (isBlob(data) && data.size >= SHARD_THRESHOLD) {
15903 return new BlobUploader(uploadInfo, data, file, saveOptions).upload();
15904 }
15905
15906 return upload(uploadInfo, data, file, saveOptions);
15907};
15908
15909/***/ }),
15910/* 448 */
15911/***/ (function(module, exports, __webpack_require__) {
15912
15913module.exports = __webpack_require__(230);
15914
15915/***/ }),
15916/* 449 */
15917/***/ (function(module, exports, __webpack_require__) {
15918
15919__webpack_require__(95);
15920__webpack_require__(450);
15921var path = __webpack_require__(13);
15922
15923module.exports = path.Array.from;
15924
15925
15926/***/ }),
15927/* 450 */
15928/***/ (function(module, exports, __webpack_require__) {
15929
15930var $ = __webpack_require__(0);
15931var from = __webpack_require__(451);
15932var checkCorrectnessOfIteration = __webpack_require__(160);
15933
15934var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function (iterable) {
15935 // eslint-disable-next-line es-x/no-array-from -- required for testing
15936 Array.from(iterable);
15937});
15938
15939// `Array.from` method
15940// https://tc39.es/ecma262/#sec-array.from
15941$({ target: 'Array', stat: true, forced: INCORRECT_ITERATION }, {
15942 from: from
15943});
15944
15945
15946/***/ }),
15947/* 451 */
15948/***/ (function(module, exports, __webpack_require__) {
15949
15950"use strict";
15951
15952var bind = __webpack_require__(50);
15953var call = __webpack_require__(10);
15954var toObject = __webpack_require__(35);
15955var callWithSafeIterationClosing = __webpack_require__(452);
15956var isArrayIteratorMethod = __webpack_require__(149);
15957var isConstructor = __webpack_require__(93);
15958var lengthOfArrayLike = __webpack_require__(42);
15959var createProperty = __webpack_require__(99);
15960var getIterator = __webpack_require__(150);
15961var getIteratorMethod = __webpack_require__(90);
15962
15963var $Array = Array;
15964
15965// `Array.from` method implementation
15966// https://tc39.es/ecma262/#sec-array.from
15967module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
15968 var O = toObject(arrayLike);
15969 var IS_CONSTRUCTOR = isConstructor(this);
15970 var argumentsLength = arguments.length;
15971 var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
15972 var mapping = mapfn !== undefined;
15973 if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined);
15974 var iteratorMethod = getIteratorMethod(O);
15975 var index = 0;
15976 var length, result, step, iterator, next, value;
15977 // if the target is not iterable or it's an array with the default iterator - use a simple case
15978 if (iteratorMethod && !(this === $Array && isArrayIteratorMethod(iteratorMethod))) {
15979 iterator = getIterator(O, iteratorMethod);
15980 next = iterator.next;
15981 result = IS_CONSTRUCTOR ? new this() : [];
15982 for (;!(step = call(next, iterator)).done; index++) {
15983 value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
15984 createProperty(result, index, value);
15985 }
15986 } else {
15987 length = lengthOfArrayLike(O);
15988 result = IS_CONSTRUCTOR ? new this(length) : $Array(length);
15989 for (;length > index; index++) {
15990 value = mapping ? mapfn(O[index], index) : O[index];
15991 createProperty(result, index, value);
15992 }
15993 }
15994 result.length = index;
15995 return result;
15996};
15997
15998
15999/***/ }),
16000/* 452 */
16001/***/ (function(module, exports, __webpack_require__) {
16002
16003var anObject = __webpack_require__(21);
16004var iteratorClose = __webpack_require__(151);
16005
16006// call something on iterator step with safe closing on error
16007module.exports = function (iterator, fn, value, ENTRIES) {
16008 try {
16009 return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
16010 } catch (error) {
16011 iteratorClose(iterator, 'throw', error);
16012 }
16013};
16014
16015
16016/***/ }),
16017/* 453 */
16018/***/ (function(module, exports, __webpack_require__) {
16019
16020module.exports = __webpack_require__(226);
16021
16022/***/ }),
16023/* 454 */
16024/***/ (function(module, exports, __webpack_require__) {
16025
16026module.exports = __webpack_require__(455);
16027
16028
16029/***/ }),
16030/* 455 */
16031/***/ (function(module, exports, __webpack_require__) {
16032
16033var parent = __webpack_require__(456);
16034
16035module.exports = parent;
16036
16037
16038/***/ }),
16039/* 456 */
16040/***/ (function(module, exports, __webpack_require__) {
16041
16042var parent = __webpack_require__(457);
16043
16044module.exports = parent;
16045
16046
16047/***/ }),
16048/* 457 */
16049/***/ (function(module, exports, __webpack_require__) {
16050
16051var parent = __webpack_require__(458);
16052__webpack_require__(73);
16053
16054module.exports = parent;
16055
16056
16057/***/ }),
16058/* 458 */
16059/***/ (function(module, exports, __webpack_require__) {
16060
16061__webpack_require__(70);
16062__webpack_require__(95);
16063var getIteratorMethod = __webpack_require__(90);
16064
16065module.exports = getIteratorMethod;
16066
16067
16068/***/ }),
16069/* 459 */
16070/***/ (function(module, exports, __webpack_require__) {
16071
16072module.exports = __webpack_require__(460);
16073
16074/***/ }),
16075/* 460 */
16076/***/ (function(module, exports, __webpack_require__) {
16077
16078var parent = __webpack_require__(461);
16079
16080module.exports = parent;
16081
16082
16083/***/ }),
16084/* 461 */
16085/***/ (function(module, exports, __webpack_require__) {
16086
16087__webpack_require__(462);
16088var path = __webpack_require__(13);
16089
16090module.exports = path.Reflect.construct;
16091
16092
16093/***/ }),
16094/* 462 */
16095/***/ (function(module, exports, __webpack_require__) {
16096
16097var $ = __webpack_require__(0);
16098var getBuiltIn = __webpack_require__(16);
16099var apply = __webpack_require__(62);
16100var bind = __webpack_require__(232);
16101var aConstructor = __webpack_require__(156);
16102var anObject = __webpack_require__(21);
16103var isObject = __webpack_require__(17);
16104var create = __webpack_require__(51);
16105var fails = __webpack_require__(4);
16106
16107var nativeConstruct = getBuiltIn('Reflect', 'construct');
16108var ObjectPrototype = Object.prototype;
16109var push = [].push;
16110
16111// `Reflect.construct` method
16112// https://tc39.es/ecma262/#sec-reflect.construct
16113// MS Edge supports only 2 arguments and argumentsList argument is optional
16114// FF Nightly sets third argument as `new.target`, but does not create `this` from it
16115var NEW_TARGET_BUG = fails(function () {
16116 function F() { /* empty */ }
16117 return !(nativeConstruct(function () { /* empty */ }, [], F) instanceof F);
16118});
16119
16120var ARGS_BUG = !fails(function () {
16121 nativeConstruct(function () { /* empty */ });
16122});
16123
16124var FORCED = NEW_TARGET_BUG || ARGS_BUG;
16125
16126$({ target: 'Reflect', stat: true, forced: FORCED, sham: FORCED }, {
16127 construct: function construct(Target, args /* , newTarget */) {
16128 aConstructor(Target);
16129 anObject(args);
16130 var newTarget = arguments.length < 3 ? Target : aConstructor(arguments[2]);
16131 if (ARGS_BUG && !NEW_TARGET_BUG) return nativeConstruct(Target, args, newTarget);
16132 if (Target == newTarget) {
16133 // w/o altered newTarget, optimization for 0-4 arguments
16134 switch (args.length) {
16135 case 0: return new Target();
16136 case 1: return new Target(args[0]);
16137 case 2: return new Target(args[0], args[1]);
16138 case 3: return new Target(args[0], args[1], args[2]);
16139 case 4: return new Target(args[0], args[1], args[2], args[3]);
16140 }
16141 // w/o altered newTarget, lot of arguments case
16142 var $args = [null];
16143 apply(push, $args, args);
16144 return new (apply(bind, Target, $args))();
16145 }
16146 // with altered newTarget, not support built-in constructors
16147 var proto = newTarget.prototype;
16148 var instance = create(isObject(proto) ? proto : ObjectPrototype);
16149 var result = apply(Target, instance, args);
16150 return isObject(result) ? result : instance;
16151 }
16152});
16153
16154
16155/***/ }),
16156/* 463 */
16157/***/ (function(module, exports, __webpack_require__) {
16158
16159var _Object$create = __webpack_require__(464);
16160
16161var _Object$defineProperty = __webpack_require__(137);
16162
16163var setPrototypeOf = __webpack_require__(474);
16164
16165function _inherits(subClass, superClass) {
16166 if (typeof superClass !== "function" && superClass !== null) {
16167 throw new TypeError("Super expression must either be null or a function");
16168 }
16169
16170 subClass.prototype = _Object$create(superClass && superClass.prototype, {
16171 constructor: {
16172 value: subClass,
16173 writable: true,
16174 configurable: true
16175 }
16176 });
16177
16178 _Object$defineProperty(subClass, "prototype", {
16179 writable: false
16180 });
16181
16182 if (superClass) setPrototypeOf(subClass, superClass);
16183}
16184
16185module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports;
16186
16187/***/ }),
16188/* 464 */
16189/***/ (function(module, exports, __webpack_require__) {
16190
16191module.exports = __webpack_require__(465);
16192
16193/***/ }),
16194/* 465 */
16195/***/ (function(module, exports, __webpack_require__) {
16196
16197module.exports = __webpack_require__(466);
16198
16199
16200/***/ }),
16201/* 466 */
16202/***/ (function(module, exports, __webpack_require__) {
16203
16204var parent = __webpack_require__(467);
16205
16206module.exports = parent;
16207
16208
16209/***/ }),
16210/* 467 */
16211/***/ (function(module, exports, __webpack_require__) {
16212
16213var parent = __webpack_require__(468);
16214
16215module.exports = parent;
16216
16217
16218/***/ }),
16219/* 468 */
16220/***/ (function(module, exports, __webpack_require__) {
16221
16222var parent = __webpack_require__(469);
16223
16224module.exports = parent;
16225
16226
16227/***/ }),
16228/* 469 */
16229/***/ (function(module, exports, __webpack_require__) {
16230
16231__webpack_require__(470);
16232var path = __webpack_require__(13);
16233
16234var Object = path.Object;
16235
16236module.exports = function create(P, D) {
16237 return Object.create(P, D);
16238};
16239
16240
16241/***/ }),
16242/* 470 */
16243/***/ (function(module, exports, __webpack_require__) {
16244
16245// TODO: Remove from `core-js@4`
16246var $ = __webpack_require__(0);
16247var DESCRIPTORS = __webpack_require__(19);
16248var create = __webpack_require__(51);
16249
16250// `Object.create` method
16251// https://tc39.es/ecma262/#sec-object.create
16252$({ target: 'Object', stat: true, sham: !DESCRIPTORS }, {
16253 create: create
16254});
16255
16256
16257/***/ }),
16258/* 471 */
16259/***/ (function(module, exports, __webpack_require__) {
16260
16261module.exports = __webpack_require__(472);
16262
16263
16264/***/ }),
16265/* 472 */
16266/***/ (function(module, exports, __webpack_require__) {
16267
16268var parent = __webpack_require__(473);
16269
16270module.exports = parent;
16271
16272
16273/***/ }),
16274/* 473 */
16275/***/ (function(module, exports, __webpack_require__) {
16276
16277var parent = __webpack_require__(224);
16278
16279module.exports = parent;
16280
16281
16282/***/ }),
16283/* 474 */
16284/***/ (function(module, exports, __webpack_require__) {
16285
16286var _Object$setPrototypeOf = __webpack_require__(233);
16287
16288var _bindInstanceProperty = __webpack_require__(234);
16289
16290function _setPrototypeOf(o, p) {
16291 var _context;
16292
16293 module.exports = _setPrototypeOf = _Object$setPrototypeOf ? _bindInstanceProperty(_context = _Object$setPrototypeOf).call(_context) : function _setPrototypeOf(o, p) {
16294 o.__proto__ = p;
16295 return o;
16296 }, module.exports.__esModule = true, module.exports["default"] = module.exports;
16297 return _setPrototypeOf(o, p);
16298}
16299
16300module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
16301
16302/***/ }),
16303/* 475 */
16304/***/ (function(module, exports, __webpack_require__) {
16305
16306module.exports = __webpack_require__(476);
16307
16308
16309/***/ }),
16310/* 476 */
16311/***/ (function(module, exports, __webpack_require__) {
16312
16313var parent = __webpack_require__(477);
16314
16315module.exports = parent;
16316
16317
16318/***/ }),
16319/* 477 */
16320/***/ (function(module, exports, __webpack_require__) {
16321
16322var parent = __webpack_require__(221);
16323
16324module.exports = parent;
16325
16326
16327/***/ }),
16328/* 478 */
16329/***/ (function(module, exports, __webpack_require__) {
16330
16331module.exports = __webpack_require__(479);
16332
16333
16334/***/ }),
16335/* 479 */
16336/***/ (function(module, exports, __webpack_require__) {
16337
16338var parent = __webpack_require__(480);
16339
16340module.exports = parent;
16341
16342
16343/***/ }),
16344/* 480 */
16345/***/ (function(module, exports, __webpack_require__) {
16346
16347var parent = __webpack_require__(481);
16348
16349module.exports = parent;
16350
16351
16352/***/ }),
16353/* 481 */
16354/***/ (function(module, exports, __webpack_require__) {
16355
16356var parent = __webpack_require__(482);
16357
16358module.exports = parent;
16359
16360
16361/***/ }),
16362/* 482 */
16363/***/ (function(module, exports, __webpack_require__) {
16364
16365var isPrototypeOf = __webpack_require__(20);
16366var method = __webpack_require__(483);
16367
16368var FunctionPrototype = Function.prototype;
16369
16370module.exports = function (it) {
16371 var own = it.bind;
16372 return it === FunctionPrototype || (isPrototypeOf(FunctionPrototype, it) && own === FunctionPrototype.bind) ? method : own;
16373};
16374
16375
16376/***/ }),
16377/* 483 */
16378/***/ (function(module, exports, __webpack_require__) {
16379
16380__webpack_require__(484);
16381var entryVirtual = __webpack_require__(38);
16382
16383module.exports = entryVirtual('Function').bind;
16384
16385
16386/***/ }),
16387/* 484 */
16388/***/ (function(module, exports, __webpack_require__) {
16389
16390// TODO: Remove from `core-js@4`
16391var $ = __webpack_require__(0);
16392var bind = __webpack_require__(232);
16393
16394// `Function.prototype.bind` method
16395// https://tc39.es/ecma262/#sec-function.prototype.bind
16396$({ target: 'Function', proto: true, forced: Function.bind !== bind }, {
16397 bind: bind
16398});
16399
16400
16401/***/ }),
16402/* 485 */
16403/***/ (function(module, exports, __webpack_require__) {
16404
16405var _typeof = __webpack_require__(135)["default"];
16406
16407var assertThisInitialized = __webpack_require__(486);
16408
16409function _possibleConstructorReturn(self, call) {
16410 if (call && (_typeof(call) === "object" || typeof call === "function")) {
16411 return call;
16412 } else if (call !== void 0) {
16413 throw new TypeError("Derived constructors may only return object or undefined");
16414 }
16415
16416 return assertThisInitialized(self);
16417}
16418
16419module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports;
16420
16421/***/ }),
16422/* 486 */
16423/***/ (function(module, exports) {
16424
16425function _assertThisInitialized(self) {
16426 if (self === void 0) {
16427 throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
16428 }
16429
16430 return self;
16431}
16432
16433module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports;
16434
16435/***/ }),
16436/* 487 */
16437/***/ (function(module, exports, __webpack_require__) {
16438
16439var _Object$setPrototypeOf = __webpack_require__(233);
16440
16441var _bindInstanceProperty = __webpack_require__(234);
16442
16443var _Object$getPrototypeOf = __webpack_require__(488);
16444
16445function _getPrototypeOf(o) {
16446 var _context;
16447
16448 module.exports = _getPrototypeOf = _Object$setPrototypeOf ? _bindInstanceProperty(_context = _Object$getPrototypeOf).call(_context) : function _getPrototypeOf(o) {
16449 return o.__proto__ || _Object$getPrototypeOf(o);
16450 }, module.exports.__esModule = true, module.exports["default"] = module.exports;
16451 return _getPrototypeOf(o);
16452}
16453
16454module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
16455
16456/***/ }),
16457/* 488 */
16458/***/ (function(module, exports, __webpack_require__) {
16459
16460module.exports = __webpack_require__(489);
16461
16462/***/ }),
16463/* 489 */
16464/***/ (function(module, exports, __webpack_require__) {
16465
16466module.exports = __webpack_require__(490);
16467
16468
16469/***/ }),
16470/* 490 */
16471/***/ (function(module, exports, __webpack_require__) {
16472
16473var parent = __webpack_require__(491);
16474
16475module.exports = parent;
16476
16477
16478/***/ }),
16479/* 491 */
16480/***/ (function(module, exports, __webpack_require__) {
16481
16482var parent = __webpack_require__(216);
16483
16484module.exports = parent;
16485
16486
16487/***/ }),
16488/* 492 */
16489/***/ (function(module, exports) {
16490
16491function _classCallCheck(instance, Constructor) {
16492 if (!(instance instanceof Constructor)) {
16493 throw new TypeError("Cannot call a class as a function");
16494 }
16495}
16496
16497module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
16498
16499/***/ }),
16500/* 493 */
16501/***/ (function(module, exports, __webpack_require__) {
16502
16503var _Object$defineProperty = __webpack_require__(137);
16504
16505function _defineProperties(target, props) {
16506 for (var i = 0; i < props.length; i++) {
16507 var descriptor = props[i];
16508 descriptor.enumerable = descriptor.enumerable || false;
16509 descriptor.configurable = true;
16510 if ("value" in descriptor) descriptor.writable = true;
16511
16512 _Object$defineProperty(target, descriptor.key, descriptor);
16513 }
16514}
16515
16516function _createClass(Constructor, protoProps, staticProps) {
16517 if (protoProps) _defineProperties(Constructor.prototype, protoProps);
16518 if (staticProps) _defineProperties(Constructor, staticProps);
16519
16520 _Object$defineProperty(Constructor, "prototype", {
16521 writable: false
16522 });
16523
16524 return Constructor;
16525}
16526
16527module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
16528
16529/***/ }),
16530/* 494 */
16531/***/ (function(module, exports, __webpack_require__) {
16532
16533"use strict";
16534
16535
16536var _interopRequireDefault = __webpack_require__(2);
16537
16538var _slice = _interopRequireDefault(__webpack_require__(81));
16539
16540// base64 character set, plus padding character (=)
16541var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
16542
16543module.exports = function (string) {
16544 var result = '';
16545
16546 for (var i = 0; i < string.length;) {
16547 var a = string.charCodeAt(i++);
16548 var b = string.charCodeAt(i++);
16549 var c = string.charCodeAt(i++);
16550
16551 if (a > 255 || b > 255 || c > 255) {
16552 throw new TypeError('Failed to encode base64: The string to be encoded contains characters outside of the Latin1 range.');
16553 }
16554
16555 var bitmap = a << 16 | b << 8 | c;
16556 result += b64.charAt(bitmap >> 18 & 63) + b64.charAt(bitmap >> 12 & 63) + b64.charAt(bitmap >> 6 & 63) + b64.charAt(bitmap & 63);
16557 } // To determine the final padding
16558
16559
16560 var rest = string.length % 3; // If there's need of padding, replace the last 'A's with equal signs
16561
16562 return rest ? (0, _slice.default)(result).call(result, 0, rest - 3) + '==='.substring(rest) : result;
16563};
16564
16565/***/ }),
16566/* 495 */
16567/***/ (function(module, exports, __webpack_require__) {
16568
16569"use strict";
16570
16571
16572var _ = __webpack_require__(1);
16573
16574var ajax = __webpack_require__(103);
16575
16576module.exports = function upload(uploadInfo, data, file) {
16577 var saveOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
16578 return ajax({
16579 url: uploadInfo.upload_url,
16580 method: 'PUT',
16581 data: data,
16582 headers: _.extend({
16583 'Content-Type': file.get('mime_type'),
16584 'Cache-Control': 'public, max-age=31536000'
16585 }, file._uploadHeaders),
16586 onprogress: saveOptions.onprogress
16587 }).then(function () {
16588 file.attributes.url = uploadInfo.url;
16589 file._bucket = uploadInfo.bucket;
16590 file.id = uploadInfo.objectId;
16591 return file;
16592 });
16593};
16594
16595/***/ }),
16596/* 496 */
16597/***/ (function(module, exports, __webpack_require__) {
16598
16599(function(){
16600 var crypt = __webpack_require__(497),
16601 utf8 = __webpack_require__(235).utf8,
16602 isBuffer = __webpack_require__(498),
16603 bin = __webpack_require__(235).bin,
16604
16605 // The core
16606 md5 = function (message, options) {
16607 // Convert to byte array
16608 if (message.constructor == String)
16609 if (options && options.encoding === 'binary')
16610 message = bin.stringToBytes(message);
16611 else
16612 message = utf8.stringToBytes(message);
16613 else if (isBuffer(message))
16614 message = Array.prototype.slice.call(message, 0);
16615 else if (!Array.isArray(message))
16616 message = message.toString();
16617 // else, assume byte array already
16618
16619 var m = crypt.bytesToWords(message),
16620 l = message.length * 8,
16621 a = 1732584193,
16622 b = -271733879,
16623 c = -1732584194,
16624 d = 271733878;
16625
16626 // Swap endian
16627 for (var i = 0; i < m.length; i++) {
16628 m[i] = ((m[i] << 8) | (m[i] >>> 24)) & 0x00FF00FF |
16629 ((m[i] << 24) | (m[i] >>> 8)) & 0xFF00FF00;
16630 }
16631
16632 // Padding
16633 m[l >>> 5] |= 0x80 << (l % 32);
16634 m[(((l + 64) >>> 9) << 4) + 14] = l;
16635
16636 // Method shortcuts
16637 var FF = md5._ff,
16638 GG = md5._gg,
16639 HH = md5._hh,
16640 II = md5._ii;
16641
16642 for (var i = 0; i < m.length; i += 16) {
16643
16644 var aa = a,
16645 bb = b,
16646 cc = c,
16647 dd = d;
16648
16649 a = FF(a, b, c, d, m[i+ 0], 7, -680876936);
16650 d = FF(d, a, b, c, m[i+ 1], 12, -389564586);
16651 c = FF(c, d, a, b, m[i+ 2], 17, 606105819);
16652 b = FF(b, c, d, a, m[i+ 3], 22, -1044525330);
16653 a = FF(a, b, c, d, m[i+ 4], 7, -176418897);
16654 d = FF(d, a, b, c, m[i+ 5], 12, 1200080426);
16655 c = FF(c, d, a, b, m[i+ 6], 17, -1473231341);
16656 b = FF(b, c, d, a, m[i+ 7], 22, -45705983);
16657 a = FF(a, b, c, d, m[i+ 8], 7, 1770035416);
16658 d = FF(d, a, b, c, m[i+ 9], 12, -1958414417);
16659 c = FF(c, d, a, b, m[i+10], 17, -42063);
16660 b = FF(b, c, d, a, m[i+11], 22, -1990404162);
16661 a = FF(a, b, c, d, m[i+12], 7, 1804603682);
16662 d = FF(d, a, b, c, m[i+13], 12, -40341101);
16663 c = FF(c, d, a, b, m[i+14], 17, -1502002290);
16664 b = FF(b, c, d, a, m[i+15], 22, 1236535329);
16665
16666 a = GG(a, b, c, d, m[i+ 1], 5, -165796510);
16667 d = GG(d, a, b, c, m[i+ 6], 9, -1069501632);
16668 c = GG(c, d, a, b, m[i+11], 14, 643717713);
16669 b = GG(b, c, d, a, m[i+ 0], 20, -373897302);
16670 a = GG(a, b, c, d, m[i+ 5], 5, -701558691);
16671 d = GG(d, a, b, c, m[i+10], 9, 38016083);
16672 c = GG(c, d, a, b, m[i+15], 14, -660478335);
16673 b = GG(b, c, d, a, m[i+ 4], 20, -405537848);
16674 a = GG(a, b, c, d, m[i+ 9], 5, 568446438);
16675 d = GG(d, a, b, c, m[i+14], 9, -1019803690);
16676 c = GG(c, d, a, b, m[i+ 3], 14, -187363961);
16677 b = GG(b, c, d, a, m[i+ 8], 20, 1163531501);
16678 a = GG(a, b, c, d, m[i+13], 5, -1444681467);
16679 d = GG(d, a, b, c, m[i+ 2], 9, -51403784);
16680 c = GG(c, d, a, b, m[i+ 7], 14, 1735328473);
16681 b = GG(b, c, d, a, m[i+12], 20, -1926607734);
16682
16683 a = HH(a, b, c, d, m[i+ 5], 4, -378558);
16684 d = HH(d, a, b, c, m[i+ 8], 11, -2022574463);
16685 c = HH(c, d, a, b, m[i+11], 16, 1839030562);
16686 b = HH(b, c, d, a, m[i+14], 23, -35309556);
16687 a = HH(a, b, c, d, m[i+ 1], 4, -1530992060);
16688 d = HH(d, a, b, c, m[i+ 4], 11, 1272893353);
16689 c = HH(c, d, a, b, m[i+ 7], 16, -155497632);
16690 b = HH(b, c, d, a, m[i+10], 23, -1094730640);
16691 a = HH(a, b, c, d, m[i+13], 4, 681279174);
16692 d = HH(d, a, b, c, m[i+ 0], 11, -358537222);
16693 c = HH(c, d, a, b, m[i+ 3], 16, -722521979);
16694 b = HH(b, c, d, a, m[i+ 6], 23, 76029189);
16695 a = HH(a, b, c, d, m[i+ 9], 4, -640364487);
16696 d = HH(d, a, b, c, m[i+12], 11, -421815835);
16697 c = HH(c, d, a, b, m[i+15], 16, 530742520);
16698 b = HH(b, c, d, a, m[i+ 2], 23, -995338651);
16699
16700 a = II(a, b, c, d, m[i+ 0], 6, -198630844);
16701 d = II(d, a, b, c, m[i+ 7], 10, 1126891415);
16702 c = II(c, d, a, b, m[i+14], 15, -1416354905);
16703 b = II(b, c, d, a, m[i+ 5], 21, -57434055);
16704 a = II(a, b, c, d, m[i+12], 6, 1700485571);
16705 d = II(d, a, b, c, m[i+ 3], 10, -1894986606);
16706 c = II(c, d, a, b, m[i+10], 15, -1051523);
16707 b = II(b, c, d, a, m[i+ 1], 21, -2054922799);
16708 a = II(a, b, c, d, m[i+ 8], 6, 1873313359);
16709 d = II(d, a, b, c, m[i+15], 10, -30611744);
16710 c = II(c, d, a, b, m[i+ 6], 15, -1560198380);
16711 b = II(b, c, d, a, m[i+13], 21, 1309151649);
16712 a = II(a, b, c, d, m[i+ 4], 6, -145523070);
16713 d = II(d, a, b, c, m[i+11], 10, -1120210379);
16714 c = II(c, d, a, b, m[i+ 2], 15, 718787259);
16715 b = II(b, c, d, a, m[i+ 9], 21, -343485551);
16716
16717 a = (a + aa) >>> 0;
16718 b = (b + bb) >>> 0;
16719 c = (c + cc) >>> 0;
16720 d = (d + dd) >>> 0;
16721 }
16722
16723 return crypt.endian([a, b, c, d]);
16724 };
16725
16726 // Auxiliary functions
16727 md5._ff = function (a, b, c, d, x, s, t) {
16728 var n = a + (b & c | ~b & d) + (x >>> 0) + t;
16729 return ((n << s) | (n >>> (32 - s))) + b;
16730 };
16731 md5._gg = function (a, b, c, d, x, s, t) {
16732 var n = a + (b & d | c & ~d) + (x >>> 0) + t;
16733 return ((n << s) | (n >>> (32 - s))) + b;
16734 };
16735 md5._hh = function (a, b, c, d, x, s, t) {
16736 var n = a + (b ^ c ^ d) + (x >>> 0) + t;
16737 return ((n << s) | (n >>> (32 - s))) + b;
16738 };
16739 md5._ii = function (a, b, c, d, x, s, t) {
16740 var n = a + (c ^ (b | ~d)) + (x >>> 0) + t;
16741 return ((n << s) | (n >>> (32 - s))) + b;
16742 };
16743
16744 // Package private blocksize
16745 md5._blocksize = 16;
16746 md5._digestsize = 16;
16747
16748 module.exports = function (message, options) {
16749 if (message === undefined || message === null)
16750 throw new Error('Illegal argument ' + message);
16751
16752 var digestbytes = crypt.wordsToBytes(md5(message, options));
16753 return options && options.asBytes ? digestbytes :
16754 options && options.asString ? bin.bytesToString(digestbytes) :
16755 crypt.bytesToHex(digestbytes);
16756 };
16757
16758})();
16759
16760
16761/***/ }),
16762/* 497 */
16763/***/ (function(module, exports) {
16764
16765(function() {
16766 var base64map
16767 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',
16768
16769 crypt = {
16770 // Bit-wise rotation left
16771 rotl: function(n, b) {
16772 return (n << b) | (n >>> (32 - b));
16773 },
16774
16775 // Bit-wise rotation right
16776 rotr: function(n, b) {
16777 return (n << (32 - b)) | (n >>> b);
16778 },
16779
16780 // Swap big-endian to little-endian and vice versa
16781 endian: function(n) {
16782 // If number given, swap endian
16783 if (n.constructor == Number) {
16784 return crypt.rotl(n, 8) & 0x00FF00FF | crypt.rotl(n, 24) & 0xFF00FF00;
16785 }
16786
16787 // Else, assume array and swap all items
16788 for (var i = 0; i < n.length; i++)
16789 n[i] = crypt.endian(n[i]);
16790 return n;
16791 },
16792
16793 // Generate an array of any length of random bytes
16794 randomBytes: function(n) {
16795 for (var bytes = []; n > 0; n--)
16796 bytes.push(Math.floor(Math.random() * 256));
16797 return bytes;
16798 },
16799
16800 // Convert a byte array to big-endian 32-bit words
16801 bytesToWords: function(bytes) {
16802 for (var words = [], i = 0, b = 0; i < bytes.length; i++, b += 8)
16803 words[b >>> 5] |= bytes[i] << (24 - b % 32);
16804 return words;
16805 },
16806
16807 // Convert big-endian 32-bit words to a byte array
16808 wordsToBytes: function(words) {
16809 for (var bytes = [], b = 0; b < words.length * 32; b += 8)
16810 bytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF);
16811 return bytes;
16812 },
16813
16814 // Convert a byte array to a hex string
16815 bytesToHex: function(bytes) {
16816 for (var hex = [], i = 0; i < bytes.length; i++) {
16817 hex.push((bytes[i] >>> 4).toString(16));
16818 hex.push((bytes[i] & 0xF).toString(16));
16819 }
16820 return hex.join('');
16821 },
16822
16823 // Convert a hex string to a byte array
16824 hexToBytes: function(hex) {
16825 for (var bytes = [], c = 0; c < hex.length; c += 2)
16826 bytes.push(parseInt(hex.substr(c, 2), 16));
16827 return bytes;
16828 },
16829
16830 // Convert a byte array to a base-64 string
16831 bytesToBase64: function(bytes) {
16832 for (var base64 = [], i = 0; i < bytes.length; i += 3) {
16833 var triplet = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2];
16834 for (var j = 0; j < 4; j++)
16835 if (i * 8 + j * 6 <= bytes.length * 8)
16836 base64.push(base64map.charAt((triplet >>> 6 * (3 - j)) & 0x3F));
16837 else
16838 base64.push('=');
16839 }
16840 return base64.join('');
16841 },
16842
16843 // Convert a base-64 string to a byte array
16844 base64ToBytes: function(base64) {
16845 // Remove non-base-64 characters
16846 base64 = base64.replace(/[^A-Z0-9+\/]/ig, '');
16847
16848 for (var bytes = [], i = 0, imod4 = 0; i < base64.length;
16849 imod4 = ++i % 4) {
16850 if (imod4 == 0) continue;
16851 bytes.push(((base64map.indexOf(base64.charAt(i - 1))
16852 & (Math.pow(2, -2 * imod4 + 8) - 1)) << (imod4 * 2))
16853 | (base64map.indexOf(base64.charAt(i)) >>> (6 - imod4 * 2)));
16854 }
16855 return bytes;
16856 }
16857 };
16858
16859 module.exports = crypt;
16860})();
16861
16862
16863/***/ }),
16864/* 498 */
16865/***/ (function(module, exports) {
16866
16867/*!
16868 * Determine if an object is a Buffer
16869 *
16870 * @author Feross Aboukhadijeh <https://feross.org>
16871 * @license MIT
16872 */
16873
16874// The _isBuffer check is for Safari 5-7 support, because it's missing
16875// Object.prototype.constructor. Remove this eventually
16876module.exports = function (obj) {
16877 return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)
16878}
16879
16880function isBuffer (obj) {
16881 return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
16882}
16883
16884// For Node v0.10 support. Remove this eventually.
16885function isSlowBuffer (obj) {
16886 return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))
16887}
16888
16889
16890/***/ }),
16891/* 499 */
16892/***/ (function(module, exports, __webpack_require__) {
16893
16894"use strict";
16895
16896
16897var _interopRequireDefault = __webpack_require__(2);
16898
16899var _indexOf = _interopRequireDefault(__webpack_require__(102));
16900
16901var dataURItoBlob = function dataURItoBlob(dataURI, type) {
16902 var _context;
16903
16904 var byteString; // 传入的 base64,不是 dataURL
16905
16906 if ((0, _indexOf.default)(dataURI).call(dataURI, 'base64') < 0) {
16907 byteString = atob(dataURI);
16908 } else if ((0, _indexOf.default)(_context = dataURI.split(',')[0]).call(_context, 'base64') >= 0) {
16909 type = type || dataURI.split(',')[0].split(':')[1].split(';')[0];
16910 byteString = atob(dataURI.split(',')[1]);
16911 } else {
16912 byteString = unescape(dataURI.split(',')[1]);
16913 }
16914
16915 var ia = new Uint8Array(byteString.length);
16916
16917 for (var i = 0; i < byteString.length; i++) {
16918 ia[i] = byteString.charCodeAt(i);
16919 }
16920
16921 return new Blob([ia], {
16922 type: type
16923 });
16924};
16925
16926module.exports = dataURItoBlob;
16927
16928/***/ }),
16929/* 500 */
16930/***/ (function(module, exports, __webpack_require__) {
16931
16932"use strict";
16933
16934
16935var _interopRequireDefault = __webpack_require__(2);
16936
16937var _slicedToArray2 = _interopRequireDefault(__webpack_require__(501));
16938
16939var _map = _interopRequireDefault(__webpack_require__(39));
16940
16941var _indexOf = _interopRequireDefault(__webpack_require__(102));
16942
16943var _find = _interopRequireDefault(__webpack_require__(104));
16944
16945var _promise = _interopRequireDefault(__webpack_require__(12));
16946
16947var _concat = _interopRequireDefault(__webpack_require__(29));
16948
16949var _keys2 = _interopRequireDefault(__webpack_require__(48));
16950
16951var _stringify = _interopRequireDefault(__webpack_require__(34));
16952
16953var _defineProperty = _interopRequireDefault(__webpack_require__(223));
16954
16955var _getOwnPropertyDescriptor = _interopRequireDefault(__webpack_require__(522));
16956
16957var _ = __webpack_require__(1);
16958
16959var AVError = __webpack_require__(40);
16960
16961var _require = __webpack_require__(25),
16962 _request = _require._request;
16963
16964var _require2 = __webpack_require__(28),
16965 isNullOrUndefined = _require2.isNullOrUndefined,
16966 ensureArray = _require2.ensureArray,
16967 transformFetchOptions = _require2.transformFetchOptions,
16968 setValue = _require2.setValue,
16969 findValue = _require2.findValue,
16970 isPlainObject = _require2.isPlainObject,
16971 continueWhile = _require2.continueWhile;
16972
16973var recursiveToPointer = function recursiveToPointer(value) {
16974 if (_.isArray(value)) return (0, _map.default)(value).call(value, recursiveToPointer);
16975 if (isPlainObject(value)) return _.mapObject(value, recursiveToPointer);
16976 if (_.isObject(value) && value._toPointer) return value._toPointer();
16977 return value;
16978};
16979
16980var RESERVED_KEYS = ['objectId', 'createdAt', 'updatedAt'];
16981
16982var checkReservedKey = function checkReservedKey(key) {
16983 if ((0, _indexOf.default)(RESERVED_KEYS).call(RESERVED_KEYS, key) !== -1) {
16984 throw new Error("key[".concat(key, "] is reserved"));
16985 }
16986};
16987
16988var handleBatchResults = function handleBatchResults(results) {
16989 var firstError = (0, _find.default)(_).call(_, results, function (result) {
16990 return result instanceof Error;
16991 });
16992
16993 if (!firstError) {
16994 return results;
16995 }
16996
16997 var error = new AVError(firstError.code, firstError.message);
16998 error.results = results;
16999 throw error;
17000}; // Helper function to get a value from a Backbone object as a property
17001// or as a function.
17002
17003
17004function getValue(object, prop) {
17005 if (!(object && object[prop])) {
17006 return null;
17007 }
17008
17009 return _.isFunction(object[prop]) ? object[prop]() : object[prop];
17010} // AV.Object is analogous to the Java AVObject.
17011// It also implements the same interface as a Backbone model.
17012
17013
17014module.exports = function (AV) {
17015 /**
17016 * Creates a new model with defined attributes. A client id (cid) is
17017 * automatically generated and assigned for you.
17018 *
17019 * <p>You won't normally call this method directly. It is recommended that
17020 * you use a subclass of <code>AV.Object</code> instead, created by calling
17021 * <code>extend</code>.</p>
17022 *
17023 * <p>However, if you don't want to use a subclass, or aren't sure which
17024 * subclass is appropriate, you can use this form:<pre>
17025 * var object = new AV.Object("ClassName");
17026 * </pre>
17027 * That is basically equivalent to:<pre>
17028 * var MyClass = AV.Object.extend("ClassName");
17029 * var object = new MyClass();
17030 * </pre></p>
17031 *
17032 * @param {Object} attributes The initial set of data to store in the object.
17033 * @param {Object} options A set of Backbone-like options for creating the
17034 * object. The only option currently supported is "collection".
17035 * @see AV.Object.extend
17036 *
17037 * @class
17038 *
17039 * <p>The fundamental unit of AV data, which implements the Backbone Model
17040 * interface.</p>
17041 */
17042 AV.Object = function (attributes, options) {
17043 // Allow new AV.Object("ClassName") as a shortcut to _create.
17044 if (_.isString(attributes)) {
17045 return AV.Object._create.apply(this, arguments);
17046 }
17047
17048 attributes = attributes || {};
17049
17050 if (options && options.parse) {
17051 attributes = this.parse(attributes);
17052 attributes = this._mergeMagicFields(attributes);
17053 }
17054
17055 var defaults = getValue(this, 'defaults');
17056
17057 if (defaults) {
17058 attributes = _.extend({}, defaults, attributes);
17059 }
17060
17061 if (options && options.collection) {
17062 this.collection = options.collection;
17063 }
17064
17065 this._serverData = {}; // The last known data for this object from cloud.
17066
17067 this._opSetQueue = [{}]; // List of sets of changes to the data.
17068
17069 this._flags = {};
17070 this.attributes = {}; // The best estimate of this's current data.
17071
17072 this._hashedJSON = {}; // Hash of values of containers at last save.
17073
17074 this._escapedAttributes = {};
17075 this.cid = _.uniqueId('c');
17076 this.changed = {};
17077 this._silent = {};
17078 this._pending = {};
17079 this.set(attributes, {
17080 silent: true
17081 });
17082 this.changed = {};
17083 this._silent = {};
17084 this._pending = {};
17085 this._hasData = true;
17086 this._previousAttributes = _.clone(this.attributes);
17087 this.initialize.apply(this, arguments);
17088 };
17089 /**
17090 * @lends AV.Object.prototype
17091 * @property {String} id The objectId of the AV Object.
17092 */
17093
17094 /**
17095 * Saves the given list of AV.Object.
17096 * If any error is encountered, stops and calls the error handler.
17097 *
17098 * @example
17099 * AV.Object.saveAll([object1, object2, ...]).then(function(list) {
17100 * // All the objects were saved.
17101 * }, function(error) {
17102 * // An error occurred while saving one of the objects.
17103 * });
17104 *
17105 * @param {Array} list A list of <code>AV.Object</code>.
17106 */
17107
17108
17109 AV.Object.saveAll = function (list, options) {
17110 return AV.Object._deepSaveAsync(list, null, options);
17111 };
17112 /**
17113 * Fetch the given list of AV.Object.
17114 *
17115 * @param {AV.Object[]} objects A list of <code>AV.Object</code>
17116 * @param {AuthOptions} options
17117 * @return {Promise.<AV.Object[]>} The given list of <code>AV.Object</code>, updated
17118 */
17119
17120
17121 AV.Object.fetchAll = function (objects, options) {
17122 return _promise.default.resolve().then(function () {
17123 return _request('batch', null, null, 'POST', {
17124 requests: (0, _map.default)(_).call(_, objects, function (object) {
17125 var _context;
17126
17127 if (!object.className) throw new Error('object must have className to fetch');
17128 if (!object.id) throw new Error('object must have id to fetch');
17129 if (object.dirty()) throw new Error('object is modified but not saved');
17130 return {
17131 method: 'GET',
17132 path: (0, _concat.default)(_context = "/1.1/classes/".concat(object.className, "/")).call(_context, object.id)
17133 };
17134 })
17135 }, options);
17136 }).then(function (response) {
17137 var results = (0, _map.default)(_).call(_, objects, function (object, i) {
17138 if (response[i].success) {
17139 var fetchedAttrs = object.parse(response[i].success);
17140
17141 object._cleanupUnsetKeys(fetchedAttrs);
17142
17143 object._finishFetch(fetchedAttrs);
17144
17145 return object;
17146 }
17147
17148 if (response[i].success === null) {
17149 return new AVError(AVError.OBJECT_NOT_FOUND, 'Object not found.');
17150 }
17151
17152 return new AVError(response[i].error.code, response[i].error.error);
17153 });
17154 return handleBatchResults(results);
17155 });
17156 }; // Attach all inheritable methods to the AV.Object prototype.
17157
17158
17159 _.extend(AV.Object.prototype, AV.Events,
17160 /** @lends AV.Object.prototype */
17161 {
17162 _fetchWhenSave: false,
17163
17164 /**
17165 * Initialize is an empty function by default. Override it with your own
17166 * initialization logic.
17167 */
17168 initialize: function initialize() {},
17169
17170 /**
17171 * Set whether to enable fetchWhenSave option when updating object.
17172 * When set true, SDK would fetch the latest object after saving.
17173 * Default is false.
17174 *
17175 * @deprecated use AV.Object#save with options.fetchWhenSave instead
17176 * @param {boolean} enable true to enable fetchWhenSave option.
17177 */
17178 fetchWhenSave: function fetchWhenSave(enable) {
17179 console.warn('AV.Object#fetchWhenSave is deprecated, use AV.Object#save with options.fetchWhenSave instead.');
17180
17181 if (!_.isBoolean(enable)) {
17182 throw new Error('Expect boolean value for fetchWhenSave');
17183 }
17184
17185 this._fetchWhenSave = enable;
17186 },
17187
17188 /**
17189 * Returns the object's objectId.
17190 * @return {String} the objectId.
17191 */
17192 getObjectId: function getObjectId() {
17193 return this.id;
17194 },
17195
17196 /**
17197 * Returns the object's createdAt attribute.
17198 * @return {Date}
17199 */
17200 getCreatedAt: function getCreatedAt() {
17201 return this.createdAt;
17202 },
17203
17204 /**
17205 * Returns the object's updatedAt attribute.
17206 * @return {Date}
17207 */
17208 getUpdatedAt: function getUpdatedAt() {
17209 return this.updatedAt;
17210 },
17211
17212 /**
17213 * Returns a JSON version of the object.
17214 * @return {Object}
17215 */
17216 toJSON: function toJSON(key, holder) {
17217 var seenObjects = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
17218 return this._toFullJSON(seenObjects, false);
17219 },
17220
17221 /**
17222 * Returns a JSON version of the object with meta data.
17223 * Inverse to {@link AV.parseJSON}
17224 * @since 3.0.0
17225 * @return {Object}
17226 */
17227 toFullJSON: function toFullJSON() {
17228 var seenObjects = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
17229 return this._toFullJSON(seenObjects);
17230 },
17231 _toFullJSON: function _toFullJSON(seenObjects) {
17232 var _this = this;
17233
17234 var full = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
17235
17236 var json = _.clone(this.attributes);
17237
17238 if (_.isArray(seenObjects)) {
17239 var newSeenObjects = (0, _concat.default)(seenObjects).call(seenObjects, this);
17240 }
17241
17242 AV._objectEach(json, function (val, key) {
17243 json[key] = AV._encode(val, newSeenObjects, undefined, full);
17244 });
17245
17246 AV._objectEach(this._operations, function (val, key) {
17247 json[key] = val;
17248 });
17249
17250 if (_.has(this, 'id')) {
17251 json.objectId = this.id;
17252 }
17253
17254 ['createdAt', 'updatedAt'].forEach(function (key) {
17255 if (_.has(_this, key)) {
17256 var val = _this[key];
17257 json[key] = _.isDate(val) ? val.toJSON() : val;
17258 }
17259 });
17260
17261 if (full) {
17262 json.__type = 'Object';
17263 if (_.isArray(seenObjects) && seenObjects.length) json.__type = 'Pointer';
17264 json.className = this.className;
17265 }
17266
17267 return json;
17268 },
17269
17270 /**
17271 * Updates _hashedJSON to reflect the current state of this object.
17272 * Adds any changed hash values to the set of pending changes.
17273 * @private
17274 */
17275 _refreshCache: function _refreshCache() {
17276 var self = this;
17277
17278 if (self._refreshingCache) {
17279 return;
17280 }
17281
17282 self._refreshingCache = true;
17283
17284 AV._objectEach(this.attributes, function (value, key) {
17285 if (value instanceof AV.Object) {
17286 value._refreshCache();
17287 } else if (_.isObject(value)) {
17288 if (self._resetCacheForKey(key)) {
17289 self.set(key, new AV.Op.Set(value), {
17290 silent: true
17291 });
17292 }
17293 }
17294 });
17295
17296 delete self._refreshingCache;
17297 },
17298
17299 /**
17300 * Returns true if this object has been modified since its last
17301 * save/refresh. If an attribute is specified, it returns true only if that
17302 * particular attribute has been modified since the last save/refresh.
17303 * @param {String} attr An attribute name (optional).
17304 * @return {Boolean}
17305 */
17306 dirty: function dirty(attr) {
17307 this._refreshCache();
17308
17309 var currentChanges = _.last(this._opSetQueue);
17310
17311 if (attr) {
17312 return currentChanges[attr] ? true : false;
17313 }
17314
17315 if (!this.id) {
17316 return true;
17317 }
17318
17319 if ((0, _keys2.default)(_).call(_, currentChanges).length > 0) {
17320 return true;
17321 }
17322
17323 return false;
17324 },
17325
17326 /**
17327 * Returns the keys of the modified attribute since its last save/refresh.
17328 * @return {String[]}
17329 */
17330 dirtyKeys: function dirtyKeys() {
17331 this._refreshCache();
17332
17333 var currentChanges = _.last(this._opSetQueue);
17334
17335 return (0, _keys2.default)(_).call(_, currentChanges);
17336 },
17337
17338 /**
17339 * Gets a Pointer referencing this Object.
17340 * @private
17341 */
17342 _toPointer: function _toPointer() {
17343 // if (!this.id) {
17344 // throw new Error("Can't serialize an unsaved AV.Object");
17345 // }
17346 return {
17347 __type: 'Pointer',
17348 className: this.className,
17349 objectId: this.id
17350 };
17351 },
17352
17353 /**
17354 * Gets the value of an attribute.
17355 * @param {String} attr The string name of an attribute.
17356 */
17357 get: function get(attr) {
17358 switch (attr) {
17359 case 'objectId':
17360 return this.id;
17361
17362 case 'createdAt':
17363 case 'updatedAt':
17364 return this[attr];
17365
17366 default:
17367 return this.attributes[attr];
17368 }
17369 },
17370
17371 /**
17372 * Gets a relation on the given class for the attribute.
17373 * @param {String} attr The attribute to get the relation for.
17374 * @return {AV.Relation}
17375 */
17376 relation: function relation(attr) {
17377 var value = this.get(attr);
17378
17379 if (value) {
17380 if (!(value instanceof AV.Relation)) {
17381 throw new Error('Called relation() on non-relation field ' + attr);
17382 }
17383
17384 value._ensureParentAndKey(this, attr);
17385
17386 return value;
17387 } else {
17388 return new AV.Relation(this, attr);
17389 }
17390 },
17391
17392 /**
17393 * Gets the HTML-escaped value of an attribute.
17394 */
17395 escape: function escape(attr) {
17396 var html = this._escapedAttributes[attr];
17397
17398 if (html) {
17399 return html;
17400 }
17401
17402 var val = this.attributes[attr];
17403 var escaped;
17404
17405 if (isNullOrUndefined(val)) {
17406 escaped = '';
17407 } else {
17408 escaped = _.escape(val.toString());
17409 }
17410
17411 this._escapedAttributes[attr] = escaped;
17412 return escaped;
17413 },
17414
17415 /**
17416 * Returns <code>true</code> if the attribute contains a value that is not
17417 * null or undefined.
17418 * @param {String} attr The string name of the attribute.
17419 * @return {Boolean}
17420 */
17421 has: function has(attr) {
17422 return !isNullOrUndefined(this.attributes[attr]);
17423 },
17424
17425 /**
17426 * Pulls "special" fields like objectId, createdAt, etc. out of attrs
17427 * and puts them on "this" directly. Removes them from attrs.
17428 * @param attrs - A dictionary with the data for this AV.Object.
17429 * @private
17430 */
17431 _mergeMagicFields: function _mergeMagicFields(attrs) {
17432 // Check for changes of magic fields.
17433 var model = this;
17434 var specialFields = ['objectId', 'createdAt', 'updatedAt'];
17435
17436 AV._arrayEach(specialFields, function (attr) {
17437 if (attrs[attr]) {
17438 if (attr === 'objectId') {
17439 model.id = attrs[attr];
17440 } else if ((attr === 'createdAt' || attr === 'updatedAt') && !_.isDate(attrs[attr])) {
17441 model[attr] = AV._parseDate(attrs[attr]);
17442 } else {
17443 model[attr] = attrs[attr];
17444 }
17445
17446 delete attrs[attr];
17447 }
17448 });
17449
17450 return attrs;
17451 },
17452
17453 /**
17454 * Returns the json to be sent to the server.
17455 * @private
17456 */
17457 _startSave: function _startSave() {
17458 this._opSetQueue.push({});
17459 },
17460
17461 /**
17462 * Called when a save fails because of an error. Any changes that were part
17463 * of the save need to be merged with changes made after the save. This
17464 * might throw an exception is you do conflicting operations. For example,
17465 * if you do:
17466 * object.set("foo", "bar");
17467 * object.set("invalid field name", "baz");
17468 * object.save();
17469 * object.increment("foo");
17470 * then this will throw when the save fails and the client tries to merge
17471 * "bar" with the +1.
17472 * @private
17473 */
17474 _cancelSave: function _cancelSave() {
17475 var failedChanges = _.first(this._opSetQueue);
17476
17477 this._opSetQueue = _.rest(this._opSetQueue);
17478
17479 var nextChanges = _.first(this._opSetQueue);
17480
17481 AV._objectEach(failedChanges, function (op, key) {
17482 var op1 = failedChanges[key];
17483 var op2 = nextChanges[key];
17484
17485 if (op1 && op2) {
17486 nextChanges[key] = op2._mergeWithPrevious(op1);
17487 } else if (op1) {
17488 nextChanges[key] = op1;
17489 }
17490 });
17491
17492 this._saving = this._saving - 1;
17493 },
17494
17495 /**
17496 * Called when a save completes successfully. This merges the changes that
17497 * were saved into the known server data, and overrides it with any data
17498 * sent directly from the server.
17499 * @private
17500 */
17501 _finishSave: function _finishSave(serverData) {
17502 var _context2;
17503
17504 // Grab a copy of any object referenced by this object. These instances
17505 // may have already been fetched, and we don't want to lose their data.
17506 // Note that doing it like this means we will unify separate copies of the
17507 // same object, but that's a risk we have to take.
17508 var fetchedObjects = {};
17509
17510 AV._traverse(this.attributes, function (object) {
17511 if (object instanceof AV.Object && object.id && object._hasData) {
17512 fetchedObjects[object.id] = object;
17513 }
17514 });
17515
17516 var savedChanges = _.first(this._opSetQueue);
17517
17518 this._opSetQueue = _.rest(this._opSetQueue);
17519
17520 this._applyOpSet(savedChanges, this._serverData);
17521
17522 this._mergeMagicFields(serverData);
17523
17524 var self = this;
17525
17526 AV._objectEach(serverData, function (value, key) {
17527 self._serverData[key] = AV._decode(value, key); // Look for any objects that might have become unfetched and fix them
17528 // by replacing their values with the previously observed values.
17529
17530 var fetched = AV._traverse(self._serverData[key], function (object) {
17531 if (object instanceof AV.Object && fetchedObjects[object.id]) {
17532 return fetchedObjects[object.id];
17533 }
17534 });
17535
17536 if (fetched) {
17537 self._serverData[key] = fetched;
17538 }
17539 });
17540
17541 this._rebuildAllEstimatedData();
17542
17543 var opSetQueue = (0, _map.default)(_context2 = this._opSetQueue).call(_context2, _.clone);
17544
17545 this._refreshCache();
17546
17547 this._opSetQueue = opSetQueue;
17548 this._saving = this._saving - 1;
17549 },
17550
17551 /**
17552 * Called when a fetch or login is complete to set the known server data to
17553 * the given object.
17554 * @private
17555 */
17556 _finishFetch: function _finishFetch(serverData, hasData) {
17557 // Clear out any changes the user might have made previously.
17558 this._opSetQueue = [{}]; // Bring in all the new server data.
17559
17560 this._mergeMagicFields(serverData);
17561
17562 var self = this;
17563
17564 AV._objectEach(serverData, function (value, key) {
17565 self._serverData[key] = AV._decode(value, key);
17566 }); // Refresh the attributes.
17567
17568
17569 this._rebuildAllEstimatedData(); // Clear out the cache of mutable containers.
17570
17571
17572 this._refreshCache();
17573
17574 this._opSetQueue = [{}];
17575 this._hasData = hasData;
17576 },
17577
17578 /**
17579 * Applies the set of AV.Op in opSet to the object target.
17580 * @private
17581 */
17582 _applyOpSet: function _applyOpSet(opSet, target) {
17583 var self = this;
17584
17585 AV._objectEach(opSet, function (change, key) {
17586 var _findValue = findValue(target, key),
17587 _findValue2 = (0, _slicedToArray2.default)(_findValue, 3),
17588 value = _findValue2[0],
17589 actualTarget = _findValue2[1],
17590 actualKey = _findValue2[2];
17591
17592 setValue(target, key, change._estimate(value, self, key));
17593
17594 if (actualTarget && actualTarget[actualKey] === AV.Op._UNSET) {
17595 delete actualTarget[actualKey];
17596 }
17597 });
17598 },
17599
17600 /**
17601 * Replaces the cached value for key with the current value.
17602 * Returns true if the new value is different than the old value.
17603 * @private
17604 */
17605 _resetCacheForKey: function _resetCacheForKey(key) {
17606 var value = this.attributes[key];
17607
17608 if (_.isObject(value) && !(value instanceof AV.Object) && !(value instanceof AV.File)) {
17609 var json = (0, _stringify.default)(recursiveToPointer(value));
17610
17611 if (this._hashedJSON[key] !== json) {
17612 var wasSet = !!this._hashedJSON[key];
17613 this._hashedJSON[key] = json;
17614 return wasSet;
17615 }
17616 }
17617
17618 return false;
17619 },
17620
17621 /**
17622 * Populates attributes[key] by starting with the last known data from the
17623 * server, and applying all of the local changes that have been made to that
17624 * key since then.
17625 * @private
17626 */
17627 _rebuildEstimatedDataForKey: function _rebuildEstimatedDataForKey(key) {
17628 var self = this;
17629 delete this.attributes[key];
17630
17631 if (this._serverData[key]) {
17632 this.attributes[key] = this._serverData[key];
17633 }
17634
17635 AV._arrayEach(this._opSetQueue, function (opSet) {
17636 var op = opSet[key];
17637
17638 if (op) {
17639 var _findValue3 = findValue(self.attributes, key),
17640 _findValue4 = (0, _slicedToArray2.default)(_findValue3, 4),
17641 value = _findValue4[0],
17642 actualTarget = _findValue4[1],
17643 actualKey = _findValue4[2],
17644 firstKey = _findValue4[3];
17645
17646 setValue(self.attributes, key, op._estimate(value, self, key));
17647
17648 if (actualTarget && actualTarget[actualKey] === AV.Op._UNSET) {
17649 delete actualTarget[actualKey];
17650 }
17651
17652 self._resetCacheForKey(firstKey);
17653 }
17654 });
17655 },
17656
17657 /**
17658 * Populates attributes by starting with the last known data from the
17659 * server, and applying all of the local changes that have been made since
17660 * then.
17661 * @private
17662 */
17663 _rebuildAllEstimatedData: function _rebuildAllEstimatedData() {
17664 var self = this;
17665
17666 var previousAttributes = _.clone(this.attributes);
17667
17668 this.attributes = _.clone(this._serverData);
17669
17670 AV._arrayEach(this._opSetQueue, function (opSet) {
17671 self._applyOpSet(opSet, self.attributes);
17672
17673 AV._objectEach(opSet, function (op, key) {
17674 self._resetCacheForKey(key);
17675 });
17676 }); // Trigger change events for anything that changed because of the fetch.
17677
17678
17679 AV._objectEach(previousAttributes, function (oldValue, key) {
17680 if (self.attributes[key] !== oldValue) {
17681 self.trigger('change:' + key, self, self.attributes[key], {});
17682 }
17683 });
17684
17685 AV._objectEach(this.attributes, function (newValue, key) {
17686 if (!_.has(previousAttributes, key)) {
17687 self.trigger('change:' + key, self, newValue, {});
17688 }
17689 });
17690 },
17691
17692 /**
17693 * Sets a hash of model attributes on the object, firing
17694 * <code>"change"</code> unless you choose to silence it.
17695 *
17696 * <p>You can call it with an object containing keys and values, or with one
17697 * key and value. For example:</p>
17698 *
17699 * @example
17700 * gameTurn.set({
17701 * player: player1,
17702 * diceRoll: 2
17703 * });
17704 *
17705 * game.set("currentPlayer", player2);
17706 *
17707 * game.set("finished", true);
17708 *
17709 * @param {String} key The key to set.
17710 * @param {Any} value The value to give it.
17711 * @param {Object} [options]
17712 * @param {Boolean} [options.silent]
17713 * @return {AV.Object} self if succeeded, throws if the value is not valid.
17714 * @see AV.Object#validate
17715 */
17716 set: function set(key, value, options) {
17717 var attrs;
17718
17719 if (_.isObject(key) || isNullOrUndefined(key)) {
17720 attrs = _.mapObject(key, function (v, k) {
17721 checkReservedKey(k);
17722 return AV._decode(v, k);
17723 });
17724 options = value;
17725 } else {
17726 attrs = {};
17727 checkReservedKey(key);
17728 attrs[key] = AV._decode(value, key);
17729 } // Extract attributes and options.
17730
17731
17732 options = options || {};
17733
17734 if (!attrs) {
17735 return this;
17736 }
17737
17738 if (attrs instanceof AV.Object) {
17739 attrs = attrs.attributes;
17740 } // If the unset option is used, every attribute should be a Unset.
17741
17742
17743 if (options.unset) {
17744 AV._objectEach(attrs, function (unused_value, key) {
17745 attrs[key] = new AV.Op.Unset();
17746 });
17747 } // Apply all the attributes to get the estimated values.
17748
17749
17750 var dataToValidate = _.clone(attrs);
17751
17752 var self = this;
17753
17754 AV._objectEach(dataToValidate, function (value, key) {
17755 if (value instanceof AV.Op) {
17756 dataToValidate[key] = value._estimate(self.attributes[key], self, key);
17757
17758 if (dataToValidate[key] === AV.Op._UNSET) {
17759 delete dataToValidate[key];
17760 }
17761 }
17762 }); // Run validation.
17763
17764
17765 this._validate(attrs, options);
17766
17767 options.changes = {};
17768 var escaped = this._escapedAttributes; // Update attributes.
17769
17770 AV._arrayEach((0, _keys2.default)(_).call(_, attrs), function (attr) {
17771 var val = attrs[attr]; // If this is a relation object we need to set the parent correctly,
17772 // since the location where it was parsed does not have access to
17773 // this object.
17774
17775 if (val instanceof AV.Relation) {
17776 val.parent = self;
17777 }
17778
17779 if (!(val instanceof AV.Op)) {
17780 val = new AV.Op.Set(val);
17781 } // See if this change will actually have any effect.
17782
17783
17784 var isRealChange = true;
17785
17786 if (val instanceof AV.Op.Set && _.isEqual(self.attributes[attr], val.value)) {
17787 isRealChange = false;
17788 }
17789
17790 if (isRealChange) {
17791 delete escaped[attr];
17792
17793 if (options.silent) {
17794 self._silent[attr] = true;
17795 } else {
17796 options.changes[attr] = true;
17797 }
17798 }
17799
17800 var currentChanges = _.last(self._opSetQueue);
17801
17802 currentChanges[attr] = val._mergeWithPrevious(currentChanges[attr]);
17803
17804 self._rebuildEstimatedDataForKey(attr);
17805
17806 if (isRealChange) {
17807 self.changed[attr] = self.attributes[attr];
17808
17809 if (!options.silent) {
17810 self._pending[attr] = true;
17811 }
17812 } else {
17813 delete self.changed[attr];
17814 delete self._pending[attr];
17815 }
17816 });
17817
17818 if (!options.silent) {
17819 this.change(options);
17820 }
17821
17822 return this;
17823 },
17824
17825 /**
17826 * Remove an attribute from the model, firing <code>"change"</code> unless
17827 * you choose to silence it. This is a noop if the attribute doesn't
17828 * exist.
17829 * @param key {String} The key.
17830 */
17831 unset: function unset(attr, options) {
17832 options = options || {};
17833 options.unset = true;
17834 return this.set(attr, null, options);
17835 },
17836
17837 /**
17838 * Atomically increments the value of the given attribute the next time the
17839 * object is saved. If no amount is specified, 1 is used by default.
17840 *
17841 * @param key {String} The key.
17842 * @param amount {Number} The amount to increment by.
17843 */
17844 increment: function increment(attr, amount) {
17845 if (_.isUndefined(amount) || _.isNull(amount)) {
17846 amount = 1;
17847 }
17848
17849 return this.set(attr, new AV.Op.Increment(amount));
17850 },
17851
17852 /**
17853 * Atomically add an object to the end of the array associated with a given
17854 * key.
17855 * @param key {String} The key.
17856 * @param item {} The item to add.
17857 */
17858 add: function add(attr, item) {
17859 return this.set(attr, new AV.Op.Add(ensureArray(item)));
17860 },
17861
17862 /**
17863 * Atomically add an object to the array associated with a given key, only
17864 * if it is not already present in the array. The position of the insert is
17865 * not guaranteed.
17866 *
17867 * @param key {String} The key.
17868 * @param item {} The object to add.
17869 */
17870 addUnique: function addUnique(attr, item) {
17871 return this.set(attr, new AV.Op.AddUnique(ensureArray(item)));
17872 },
17873
17874 /**
17875 * Atomically remove all instances of an object from the array associated
17876 * with a given key.
17877 *
17878 * @param key {String} The key.
17879 * @param item {} The object to remove.
17880 */
17881 remove: function remove(attr, item) {
17882 return this.set(attr, new AV.Op.Remove(ensureArray(item)));
17883 },
17884
17885 /**
17886 * Atomically apply a "bit and" operation on the value associated with a
17887 * given key.
17888 *
17889 * @param key {String} The key.
17890 * @param value {Number} The value to apply.
17891 */
17892 bitAnd: function bitAnd(attr, value) {
17893 return this.set(attr, new AV.Op.BitAnd(value));
17894 },
17895
17896 /**
17897 * Atomically apply a "bit or" operation on the value associated with a
17898 * given key.
17899 *
17900 * @param key {String} The key.
17901 * @param value {Number} The value to apply.
17902 */
17903 bitOr: function bitOr(attr, value) {
17904 return this.set(attr, new AV.Op.BitOr(value));
17905 },
17906
17907 /**
17908 * Atomically apply a "bit xor" operation on the value associated with a
17909 * given key.
17910 *
17911 * @param key {String} The key.
17912 * @param value {Number} The value to apply.
17913 */
17914 bitXor: function bitXor(attr, value) {
17915 return this.set(attr, new AV.Op.BitXor(value));
17916 },
17917
17918 /**
17919 * Returns an instance of a subclass of AV.Op describing what kind of
17920 * modification has been performed on this field since the last time it was
17921 * saved. For example, after calling object.increment("x"), calling
17922 * object.op("x") would return an instance of AV.Op.Increment.
17923 *
17924 * @param key {String} The key.
17925 * @returns {AV.Op} The operation, or undefined if none.
17926 */
17927 op: function op(attr) {
17928 return _.last(this._opSetQueue)[attr];
17929 },
17930
17931 /**
17932 * Clear all attributes on the model, firing <code>"change"</code> unless
17933 * you choose to silence it.
17934 */
17935 clear: function clear(options) {
17936 options = options || {};
17937 options.unset = true;
17938
17939 var keysToClear = _.extend(this.attributes, this._operations);
17940
17941 return this.set(keysToClear, options);
17942 },
17943
17944 /**
17945 * Clears any (or specific) changes to the model made since the last save.
17946 * @param {string|string[]} [keys] specify keys to revert.
17947 */
17948 revert: function revert(keys) {
17949 var lastOp = _.last(this._opSetQueue);
17950
17951 var _keys = ensureArray(keys || (0, _keys2.default)(_).call(_, lastOp));
17952
17953 _keys.forEach(function (key) {
17954 delete lastOp[key];
17955 });
17956
17957 this._rebuildAllEstimatedData();
17958
17959 return this;
17960 },
17961
17962 /**
17963 * Returns a JSON-encoded set of operations to be sent with the next save
17964 * request.
17965 * @private
17966 */
17967 _getSaveJSON: function _getSaveJSON() {
17968 var json = _.clone(_.first(this._opSetQueue));
17969
17970 AV._objectEach(json, function (op, key) {
17971 json[key] = op.toJSON();
17972 });
17973
17974 return json;
17975 },
17976
17977 /**
17978 * Returns true if this object can be serialized for saving.
17979 * @private
17980 */
17981 _canBeSerialized: function _canBeSerialized() {
17982 return AV.Object._canBeSerializedAsValue(this.attributes);
17983 },
17984
17985 /**
17986 * Fetch the model from the server. If the server's representation of the
17987 * model differs from its current attributes, they will be overriden,
17988 * triggering a <code>"change"</code> event.
17989 * @param {Object} fetchOptions Optional options to set 'keys',
17990 * 'include' and 'includeACL' option.
17991 * @param {AuthOptions} options
17992 * @return {Promise} A promise that is fulfilled when the fetch
17993 * completes.
17994 */
17995 fetch: function fetch() {
17996 var fetchOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
17997 var options = arguments.length > 1 ? arguments[1] : undefined;
17998
17999 if (!this.id) {
18000 throw new Error('Cannot fetch unsaved object');
18001 }
18002
18003 var self = this;
18004
18005 var request = _request('classes', this.className, this.id, 'GET', transformFetchOptions(fetchOptions), options);
18006
18007 return request.then(function (response) {
18008 var fetchedAttrs = self.parse(response);
18009
18010 self._cleanupUnsetKeys(fetchedAttrs, (0, _keys2.default)(fetchOptions) ? ensureArray((0, _keys2.default)(fetchOptions)).join(',').split(',') : undefined);
18011
18012 self._finishFetch(fetchedAttrs, true);
18013
18014 return self;
18015 });
18016 },
18017 _cleanupUnsetKeys: function _cleanupUnsetKeys(fetchedAttrs) {
18018 var _this2 = this;
18019
18020 var fetchedKeys = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (0, _keys2.default)(_).call(_, this._serverData);
18021
18022 _.forEach(fetchedKeys, function (key) {
18023 if (fetchedAttrs[key] === undefined) delete _this2._serverData[key];
18024 });
18025 },
18026
18027 /**
18028 * Set a hash of model attributes, and save the model to the server.
18029 * updatedAt will be updated when the request returns.
18030 * You can either call it as:<pre>
18031 * object.save();</pre>
18032 * or<pre>
18033 * object.save(null, options);</pre>
18034 * or<pre>
18035 * object.save(attrs, options);</pre>
18036 * or<pre>
18037 * object.save(key, value, options);</pre>
18038 *
18039 * @example
18040 * gameTurn.save({
18041 * player: "Jake Cutter",
18042 * diceRoll: 2
18043 * }).then(function(gameTurnAgain) {
18044 * // The save was successful.
18045 * }, function(error) {
18046 * // The save failed. Error is an instance of AVError.
18047 * });
18048 *
18049 * @param {AuthOptions} options AuthOptions plus:
18050 * @param {Boolean} options.fetchWhenSave fetch and update object after save succeeded
18051 * @param {AV.Query} options.query Save object only when it matches the query
18052 * @return {Promise} A promise that is fulfilled when the save
18053 * completes.
18054 * @see AVError
18055 */
18056 save: function save(arg1, arg2, arg3) {
18057 var attrs, current, options;
18058
18059 if (_.isObject(arg1) || isNullOrUndefined(arg1)) {
18060 attrs = arg1;
18061 options = arg2;
18062 } else {
18063 attrs = {};
18064 attrs[arg1] = arg2;
18065 options = arg3;
18066 }
18067
18068 options = _.clone(options) || {};
18069
18070 if (options.wait) {
18071 current = _.clone(this.attributes);
18072 }
18073
18074 var setOptions = _.clone(options) || {};
18075
18076 if (setOptions.wait) {
18077 setOptions.silent = true;
18078 }
18079
18080 if (attrs) {
18081 this.set(attrs, setOptions);
18082 }
18083
18084 var model = this;
18085 var unsavedChildren = [];
18086 var unsavedFiles = [];
18087
18088 AV.Object._findUnsavedChildren(model, unsavedChildren, unsavedFiles);
18089
18090 if (unsavedChildren.length + unsavedFiles.length > 1) {
18091 return AV.Object._deepSaveAsync(this, model, options);
18092 }
18093
18094 this._startSave();
18095
18096 this._saving = (this._saving || 0) + 1;
18097 this._allPreviousSaves = this._allPreviousSaves || _promise.default.resolve();
18098 this._allPreviousSaves = this._allPreviousSaves.catch(function (e) {}).then(function () {
18099 var method = model.id ? 'PUT' : 'POST';
18100
18101 var json = model._getSaveJSON();
18102
18103 var query = {};
18104
18105 if (model._fetchWhenSave || options.fetchWhenSave) {
18106 query['new'] = 'true';
18107 } // user login option
18108
18109
18110 if (options._failOnNotExist) {
18111 query.failOnNotExist = 'true';
18112 }
18113
18114 if (options.query) {
18115 var queryParams;
18116
18117 if (typeof options.query._getParams === 'function') {
18118 queryParams = options.query._getParams();
18119
18120 if (queryParams) {
18121 query.where = queryParams.where;
18122 }
18123 }
18124
18125 if (!query.where) {
18126 var error = new Error('options.query is not an AV.Query');
18127 throw error;
18128 }
18129 }
18130
18131 _.extend(json, model._flags);
18132
18133 var route = 'classes';
18134 var className = model.className;
18135
18136 if (model.className === '_User' && !model.id) {
18137 // Special-case user sign-up.
18138 route = 'users';
18139 className = null;
18140 } //hook makeRequest in options.
18141
18142
18143 var makeRequest = options._makeRequest || _request;
18144 var requestPromise = makeRequest(route, className, model.id, method, json, options, query);
18145 requestPromise = requestPromise.then(function (resp) {
18146 var serverAttrs = model.parse(resp);
18147
18148 if (options.wait) {
18149 serverAttrs = _.extend(attrs || {}, serverAttrs);
18150 }
18151
18152 model._finishSave(serverAttrs);
18153
18154 if (options.wait) {
18155 model.set(current, setOptions);
18156 }
18157
18158 return model;
18159 }, function (error) {
18160 model._cancelSave();
18161
18162 throw error;
18163 });
18164 return requestPromise;
18165 });
18166 return this._allPreviousSaves;
18167 },
18168
18169 /**
18170 * Destroy this model on the server if it was already persisted.
18171 * Optimistically removes the model from its collection, if it has one.
18172 * @param {AuthOptions} options AuthOptions plus:
18173 * @param {Boolean} [options.wait] wait for the server to respond
18174 * before removal.
18175 *
18176 * @return {Promise} A promise that is fulfilled when the destroy
18177 * completes.
18178 */
18179 destroy: function destroy(options) {
18180 options = options || {};
18181 var model = this;
18182
18183 var triggerDestroy = function triggerDestroy() {
18184 model.trigger('destroy', model, model.collection, options);
18185 };
18186
18187 if (!this.id) {
18188 return triggerDestroy();
18189 }
18190
18191 if (!options.wait) {
18192 triggerDestroy();
18193 }
18194
18195 var request = _request('classes', this.className, this.id, 'DELETE', this._flags, options);
18196
18197 return request.then(function () {
18198 if (options.wait) {
18199 triggerDestroy();
18200 }
18201
18202 return model;
18203 });
18204 },
18205
18206 /**
18207 * Converts a response into the hash of attributes to be set on the model.
18208 * @ignore
18209 */
18210 parse: function parse(resp) {
18211 var output = _.clone(resp);
18212
18213 ['createdAt', 'updatedAt'].forEach(function (key) {
18214 if (output[key]) {
18215 output[key] = AV._parseDate(output[key]);
18216 }
18217 });
18218
18219 if (output.createdAt && !output.updatedAt) {
18220 output.updatedAt = output.createdAt;
18221 }
18222
18223 return output;
18224 },
18225
18226 /**
18227 * Creates a new model with identical attributes to this one.
18228 * @return {AV.Object}
18229 */
18230 clone: function clone() {
18231 return new this.constructor(this.attributes);
18232 },
18233
18234 /**
18235 * Returns true if this object has never been saved to AV.
18236 * @return {Boolean}
18237 */
18238 isNew: function isNew() {
18239 return !this.id;
18240 },
18241
18242 /**
18243 * Call this method to manually fire a `"change"` event for this model and
18244 * a `"change:attribute"` event for each changed attribute.
18245 * Calling this will cause all objects observing the model to update.
18246 */
18247 change: function change(options) {
18248 options = options || {};
18249 var changing = this._changing;
18250 this._changing = true; // Silent changes become pending changes.
18251
18252 var self = this;
18253
18254 AV._objectEach(this._silent, function (attr) {
18255 self._pending[attr] = true;
18256 }); // Silent changes are triggered.
18257
18258
18259 var changes = _.extend({}, options.changes, this._silent);
18260
18261 this._silent = {};
18262
18263 AV._objectEach(changes, function (unused_value, attr) {
18264 self.trigger('change:' + attr, self, self.get(attr), options);
18265 });
18266
18267 if (changing) {
18268 return this;
18269 } // This is to get around lint not letting us make a function in a loop.
18270
18271
18272 var deleteChanged = function deleteChanged(value, attr) {
18273 if (!self._pending[attr] && !self._silent[attr]) {
18274 delete self.changed[attr];
18275 }
18276 }; // Continue firing `"change"` events while there are pending changes.
18277
18278
18279 while (!_.isEmpty(this._pending)) {
18280 this._pending = {};
18281 this.trigger('change', this, options); // Pending and silent changes still remain.
18282
18283 AV._objectEach(this.changed, deleteChanged);
18284
18285 self._previousAttributes = _.clone(this.attributes);
18286 }
18287
18288 this._changing = false;
18289 return this;
18290 },
18291
18292 /**
18293 * Gets the previous value of an attribute, recorded at the time the last
18294 * <code>"change"</code> event was fired.
18295 * @param {String} attr Name of the attribute to get.
18296 */
18297 previous: function previous(attr) {
18298 if (!arguments.length || !this._previousAttributes) {
18299 return null;
18300 }
18301
18302 return this._previousAttributes[attr];
18303 },
18304
18305 /**
18306 * Gets all of the attributes of the model at the time of the previous
18307 * <code>"change"</code> event.
18308 * @return {Object}
18309 */
18310 previousAttributes: function previousAttributes() {
18311 return _.clone(this._previousAttributes);
18312 },
18313
18314 /**
18315 * Checks if the model is currently in a valid state. It's only possible to
18316 * get into an *invalid* state if you're using silent changes.
18317 * @return {Boolean}
18318 */
18319 isValid: function isValid() {
18320 try {
18321 this.validate(this.attributes);
18322 } catch (error) {
18323 return false;
18324 }
18325
18326 return true;
18327 },
18328
18329 /**
18330 * You should not call this function directly unless you subclass
18331 * <code>AV.Object</code>, in which case you can override this method
18332 * to provide additional validation on <code>set</code> and
18333 * <code>save</code>. Your implementation should throw an Error if
18334 * the attrs is invalid
18335 *
18336 * @param {Object} attrs The current data to validate.
18337 * @see AV.Object#set
18338 */
18339 validate: function validate(attrs) {
18340 if (_.has(attrs, 'ACL') && !(attrs.ACL instanceof AV.ACL)) {
18341 throw new AVError(AVError.OTHER_CAUSE, 'ACL must be a AV.ACL.');
18342 }
18343 },
18344
18345 /**
18346 * Run validation against a set of incoming attributes, returning `true`
18347 * if all is well. If a specific `error` callback has been passed,
18348 * call that instead of firing the general `"error"` event.
18349 * @private
18350 */
18351 _validate: function _validate(attrs, options) {
18352 if (options.silent || !this.validate) {
18353 return;
18354 }
18355
18356 attrs = _.extend({}, this.attributes, attrs);
18357 this.validate(attrs);
18358 },
18359
18360 /**
18361 * Returns the ACL for this object.
18362 * @returns {AV.ACL} An instance of AV.ACL.
18363 * @see AV.Object#get
18364 */
18365 getACL: function getACL() {
18366 return this.get('ACL');
18367 },
18368
18369 /**
18370 * Sets the ACL to be used for this object.
18371 * @param {AV.ACL} acl An instance of AV.ACL.
18372 * @param {Object} options Optional Backbone-like options object to be
18373 * passed in to set.
18374 * @return {AV.Object} self
18375 * @see AV.Object#set
18376 */
18377 setACL: function setACL(acl, options) {
18378 return this.set('ACL', acl, options);
18379 },
18380 disableBeforeHook: function disableBeforeHook() {
18381 this.ignoreHook('beforeSave');
18382 this.ignoreHook('beforeUpdate');
18383 this.ignoreHook('beforeDelete');
18384 },
18385 disableAfterHook: function disableAfterHook() {
18386 this.ignoreHook('afterSave');
18387 this.ignoreHook('afterUpdate');
18388 this.ignoreHook('afterDelete');
18389 },
18390 ignoreHook: function ignoreHook(hookName) {
18391 if (!_.contains(['beforeSave', 'afterSave', 'beforeUpdate', 'afterUpdate', 'beforeDelete', 'afterDelete'], hookName)) {
18392 throw new Error('Unsupported hookName: ' + hookName);
18393 }
18394
18395 if (!AV.hookKey) {
18396 throw new Error('ignoreHook required hookKey');
18397 }
18398
18399 if (!this._flags.__ignore_hooks) {
18400 this._flags.__ignore_hooks = [];
18401 }
18402
18403 this._flags.__ignore_hooks.push(hookName);
18404 }
18405 });
18406 /**
18407 * Creates an instance of a subclass of AV.Object for the give classname
18408 * and id.
18409 * @param {String|Function} class the className or a subclass of AV.Object.
18410 * @param {String} id The object id of this model.
18411 * @return {AV.Object} A new subclass instance of AV.Object.
18412 */
18413
18414
18415 AV.Object.createWithoutData = function (klass, id, hasData) {
18416 var _klass;
18417
18418 if (_.isString(klass)) {
18419 _klass = AV.Object._getSubclass(klass);
18420 } else if (klass.prototype && klass.prototype instanceof AV.Object) {
18421 _klass = klass;
18422 } else {
18423 throw new Error('class must be a string or a subclass of AV.Object.');
18424 }
18425
18426 if (!id) {
18427 throw new TypeError('The objectId must be provided');
18428 }
18429
18430 var object = new _klass();
18431 object.id = id;
18432 object._hasData = hasData;
18433 return object;
18434 };
18435 /**
18436 * Delete objects in batch.
18437 * @param {AV.Object[]} objects The <code>AV.Object</code> array to be deleted.
18438 * @param {AuthOptions} options
18439 * @return {Promise} A promise that is fulfilled when the save
18440 * completes.
18441 */
18442
18443
18444 AV.Object.destroyAll = function (objects) {
18445 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
18446
18447 if (!objects || objects.length === 0) {
18448 return _promise.default.resolve();
18449 }
18450
18451 var objectsByClassNameAndFlags = _.groupBy(objects, function (object) {
18452 return (0, _stringify.default)({
18453 className: object.className,
18454 flags: object._flags
18455 });
18456 });
18457
18458 var body = {
18459 requests: (0, _map.default)(_).call(_, objectsByClassNameAndFlags, function (objects) {
18460 var _context3;
18461
18462 var ids = (0, _map.default)(_).call(_, objects, 'id').join(',');
18463 return {
18464 method: 'DELETE',
18465 path: (0, _concat.default)(_context3 = "/1.1/classes/".concat(objects[0].className, "/")).call(_context3, ids),
18466 body: objects[0]._flags
18467 };
18468 })
18469 };
18470 return _request('batch', null, null, 'POST', body, options).then(function (response) {
18471 var firstError = (0, _find.default)(_).call(_, response, function (result) {
18472 return !result.success;
18473 });
18474 if (firstError) throw new AVError(firstError.error.code, firstError.error.error);
18475 return undefined;
18476 });
18477 };
18478 /**
18479 * Returns the appropriate subclass for making new instances of the given
18480 * className string.
18481 * @private
18482 */
18483
18484
18485 AV.Object._getSubclass = function (className) {
18486 if (!_.isString(className)) {
18487 throw new Error('AV.Object._getSubclass requires a string argument.');
18488 }
18489
18490 var ObjectClass = AV.Object._classMap[className];
18491
18492 if (!ObjectClass) {
18493 ObjectClass = AV.Object.extend(className);
18494 AV.Object._classMap[className] = ObjectClass;
18495 }
18496
18497 return ObjectClass;
18498 };
18499 /**
18500 * Creates an instance of a subclass of AV.Object for the given classname.
18501 * @private
18502 */
18503
18504
18505 AV.Object._create = function (className, attributes, options) {
18506 var ObjectClass = AV.Object._getSubclass(className);
18507
18508 return new ObjectClass(attributes, options);
18509 }; // Set up a map of className to class so that we can create new instances of
18510 // AV Objects from JSON automatically.
18511
18512
18513 AV.Object._classMap = {};
18514 AV.Object._extend = AV._extend;
18515 /**
18516 * Creates a new model with defined attributes,
18517 * It's the same with
18518 * <pre>
18519 * new AV.Object(attributes, options);
18520 * </pre>
18521 * @param {Object} attributes The initial set of data to store in the object.
18522 * @param {Object} options A set of Backbone-like options for creating the
18523 * object. The only option currently supported is "collection".
18524 * @return {AV.Object}
18525 * @since v0.4.4
18526 * @see AV.Object
18527 * @see AV.Object.extend
18528 */
18529
18530 AV.Object['new'] = function (attributes, options) {
18531 return new AV.Object(attributes, options);
18532 };
18533 /**
18534 * Creates a new subclass of AV.Object for the given AV class name.
18535 *
18536 * <p>Every extension of a AV class will inherit from the most recent
18537 * previous extension of that class. When a AV.Object is automatically
18538 * created by parsing JSON, it will use the most recent extension of that
18539 * class.</p>
18540 *
18541 * @example
18542 * var MyClass = AV.Object.extend("MyClass", {
18543 * // Instance properties
18544 * }, {
18545 * // Class properties
18546 * });
18547 *
18548 * @param {String} className The name of the AV class backing this model.
18549 * @param {Object} protoProps Instance properties to add to instances of the
18550 * class returned from this method.
18551 * @param {Object} classProps Class properties to add the class returned from
18552 * this method.
18553 * @return {Class} A new subclass of AV.Object.
18554 */
18555
18556
18557 AV.Object.extend = function (className, protoProps, classProps) {
18558 // Handle the case with only two args.
18559 if (!_.isString(className)) {
18560 if (className && _.has(className, 'className')) {
18561 return AV.Object.extend(className.className, className, protoProps);
18562 } else {
18563 throw new Error("AV.Object.extend's first argument should be the className.");
18564 }
18565 } // If someone tries to subclass "User", coerce it to the right type.
18566
18567
18568 if (className === 'User') {
18569 className = '_User';
18570 }
18571
18572 var NewClassObject = null;
18573
18574 if (_.has(AV.Object._classMap, className)) {
18575 var OldClassObject = AV.Object._classMap[className]; // This new subclass has been told to extend both from "this" and from
18576 // OldClassObject. This is multiple inheritance, which isn't supported.
18577 // For now, let's just pick one.
18578
18579 if (protoProps || classProps) {
18580 NewClassObject = OldClassObject._extend(protoProps, classProps);
18581 } else {
18582 return OldClassObject;
18583 }
18584 } else {
18585 protoProps = protoProps || {};
18586 protoProps._className = className;
18587 NewClassObject = this._extend(protoProps, classProps);
18588 } // Extending a subclass should reuse the classname automatically.
18589
18590
18591 NewClassObject.extend = function (arg0) {
18592 var _context4;
18593
18594 if (_.isString(arg0) || arg0 && _.has(arg0, 'className')) {
18595 return AV.Object.extend.apply(NewClassObject, arguments);
18596 }
18597
18598 var newArguments = (0, _concat.default)(_context4 = [className]).call(_context4, _.toArray(arguments));
18599 return AV.Object.extend.apply(NewClassObject, newArguments);
18600 }; // Add the query property descriptor.
18601
18602
18603 (0, _defineProperty.default)(NewClassObject, 'query', (0, _getOwnPropertyDescriptor.default)(AV.Object, 'query'));
18604
18605 NewClassObject['new'] = function (attributes, options) {
18606 return new NewClassObject(attributes, options);
18607 };
18608
18609 AV.Object._classMap[className] = NewClassObject;
18610 return NewClassObject;
18611 }; // ES6 class syntax support
18612
18613
18614 (0, _defineProperty.default)(AV.Object.prototype, 'className', {
18615 get: function get() {
18616 var className = this._className || this.constructor._LCClassName || this.constructor.name; // If someone tries to subclass "User", coerce it to the right type.
18617
18618 if (className === 'User') {
18619 return '_User';
18620 }
18621
18622 return className;
18623 }
18624 });
18625 /**
18626 * Register a class.
18627 * If a subclass of <code>AV.Object</code> is defined with your own implement
18628 * rather then <code>AV.Object.extend</code>, the subclass must be registered.
18629 * @param {Function} klass A subclass of <code>AV.Object</code>
18630 * @param {String} [name] Specify the name of the class. Useful when the class might be uglified.
18631 * @example
18632 * class Person extend AV.Object {}
18633 * AV.Object.register(Person);
18634 */
18635
18636 AV.Object.register = function (klass, name) {
18637 if (!(klass.prototype instanceof AV.Object)) {
18638 throw new Error('registered class is not a subclass of AV.Object');
18639 }
18640
18641 var className = name || klass.name;
18642
18643 if (!className.length) {
18644 throw new Error('registered class must be named');
18645 }
18646
18647 if (name) {
18648 klass._LCClassName = name;
18649 }
18650
18651 AV.Object._classMap[className] = klass;
18652 };
18653 /**
18654 * Get a new Query of the current class
18655 * @name query
18656 * @memberof AV.Object
18657 * @type AV.Query
18658 * @readonly
18659 * @since v3.1.0
18660 * @example
18661 * const Post = AV.Object.extend('Post');
18662 * Post.query.equalTo('author', 'leancloud').find().then();
18663 */
18664
18665
18666 (0, _defineProperty.default)(AV.Object, 'query', {
18667 get: function get() {
18668 return new AV.Query(this.prototype.className);
18669 }
18670 });
18671
18672 AV.Object._findUnsavedChildren = function (objects, children, files) {
18673 AV._traverse(objects, function (object) {
18674 if (object instanceof AV.Object) {
18675 if (object.dirty()) {
18676 children.push(object);
18677 }
18678
18679 return;
18680 }
18681
18682 if (object instanceof AV.File) {
18683 if (!object.id) {
18684 files.push(object);
18685 }
18686
18687 return;
18688 }
18689 });
18690 };
18691
18692 AV.Object._canBeSerializedAsValue = function (object) {
18693 var canBeSerializedAsValue = true;
18694
18695 if (object instanceof AV.Object || object instanceof AV.File) {
18696 canBeSerializedAsValue = !!object.id;
18697 } else if (_.isArray(object)) {
18698 AV._arrayEach(object, function (child) {
18699 if (!AV.Object._canBeSerializedAsValue(child)) {
18700 canBeSerializedAsValue = false;
18701 }
18702 });
18703 } else if (_.isObject(object)) {
18704 AV._objectEach(object, function (child) {
18705 if (!AV.Object._canBeSerializedAsValue(child)) {
18706 canBeSerializedAsValue = false;
18707 }
18708 });
18709 }
18710
18711 return canBeSerializedAsValue;
18712 };
18713
18714 AV.Object._deepSaveAsync = function (object, model, options) {
18715 var unsavedChildren = [];
18716 var unsavedFiles = [];
18717
18718 AV.Object._findUnsavedChildren(object, unsavedChildren, unsavedFiles);
18719
18720 unsavedFiles = _.uniq(unsavedFiles);
18721
18722 var promise = _promise.default.resolve();
18723
18724 _.each(unsavedFiles, function (file) {
18725 promise = promise.then(function () {
18726 return file.save();
18727 });
18728 });
18729
18730 var objects = _.uniq(unsavedChildren);
18731
18732 var remaining = _.uniq(objects);
18733
18734 return promise.then(function () {
18735 return continueWhile(function () {
18736 return remaining.length > 0;
18737 }, function () {
18738 // Gather up all the objects that can be saved in this batch.
18739 var batch = [];
18740 var newRemaining = [];
18741
18742 AV._arrayEach(remaining, function (object) {
18743 if (object._canBeSerialized()) {
18744 batch.push(object);
18745 } else {
18746 newRemaining.push(object);
18747 }
18748 });
18749
18750 remaining = newRemaining; // If we can't save any objects, there must be a circular reference.
18751
18752 if (batch.length === 0) {
18753 return _promise.default.reject(new AVError(AVError.OTHER_CAUSE, 'Tried to save a batch with a cycle.'));
18754 } // Reserve a spot in every object's save queue.
18755
18756
18757 var readyToStart = _promise.default.resolve((0, _map.default)(_).call(_, batch, function (object) {
18758 return object._allPreviousSaves || _promise.default.resolve();
18759 })); // Save a single batch, whether previous saves succeeded or failed.
18760
18761
18762 var bathSavePromise = readyToStart.then(function () {
18763 return _request('batch', null, null, 'POST', {
18764 requests: (0, _map.default)(_).call(_, batch, function (object) {
18765 var method = object.id ? 'PUT' : 'POST';
18766
18767 var json = object._getSaveJSON();
18768
18769 _.extend(json, object._flags);
18770
18771 var route = 'classes';
18772 var className = object.className;
18773 var path = "/".concat(route, "/").concat(className);
18774
18775 if (object.className === '_User' && !object.id) {
18776 // Special-case user sign-up.
18777 path = '/users';
18778 }
18779
18780 var path = "/1.1".concat(path);
18781
18782 if (object.id) {
18783 path = path + '/' + object.id;
18784 }
18785
18786 object._startSave();
18787
18788 return {
18789 method: method,
18790 path: path,
18791 body: json,
18792 params: options && options.fetchWhenSave ? {
18793 fetchWhenSave: true
18794 } : undefined
18795 };
18796 })
18797 }, options).then(function (response) {
18798 var results = (0, _map.default)(_).call(_, batch, function (object, i) {
18799 if (response[i].success) {
18800 object._finishSave(object.parse(response[i].success));
18801
18802 return object;
18803 }
18804
18805 object._cancelSave();
18806
18807 return new AVError(response[i].error.code, response[i].error.error);
18808 });
18809 return handleBatchResults(results);
18810 });
18811 });
18812
18813 AV._arrayEach(batch, function (object) {
18814 object._allPreviousSaves = bathSavePromise;
18815 });
18816
18817 return bathSavePromise;
18818 });
18819 }).then(function () {
18820 return object;
18821 });
18822 };
18823};
18824
18825/***/ }),
18826/* 501 */
18827/***/ (function(module, exports, __webpack_require__) {
18828
18829var arrayWithHoles = __webpack_require__(502);
18830
18831var iterableToArrayLimit = __webpack_require__(510);
18832
18833var unsupportedIterableToArray = __webpack_require__(511);
18834
18835var nonIterableRest = __webpack_require__(521);
18836
18837function _slicedToArray(arr, i) {
18838 return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
18839}
18840
18841module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
18842
18843/***/ }),
18844/* 502 */
18845/***/ (function(module, exports, __webpack_require__) {
18846
18847var _Array$isArray = __webpack_require__(503);
18848
18849function _arrayWithHoles(arr) {
18850 if (_Array$isArray(arr)) return arr;
18851}
18852
18853module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
18854
18855/***/ }),
18856/* 503 */
18857/***/ (function(module, exports, __webpack_require__) {
18858
18859module.exports = __webpack_require__(504);
18860
18861/***/ }),
18862/* 504 */
18863/***/ (function(module, exports, __webpack_require__) {
18864
18865module.exports = __webpack_require__(505);
18866
18867
18868/***/ }),
18869/* 505 */
18870/***/ (function(module, exports, __webpack_require__) {
18871
18872var parent = __webpack_require__(506);
18873
18874module.exports = parent;
18875
18876
18877/***/ }),
18878/* 506 */
18879/***/ (function(module, exports, __webpack_require__) {
18880
18881var parent = __webpack_require__(507);
18882
18883module.exports = parent;
18884
18885
18886/***/ }),
18887/* 507 */
18888/***/ (function(module, exports, __webpack_require__) {
18889
18890var parent = __webpack_require__(508);
18891
18892module.exports = parent;
18893
18894
18895/***/ }),
18896/* 508 */
18897/***/ (function(module, exports, __webpack_require__) {
18898
18899__webpack_require__(509);
18900var path = __webpack_require__(13);
18901
18902module.exports = path.Array.isArray;
18903
18904
18905/***/ }),
18906/* 509 */
18907/***/ (function(module, exports, __webpack_require__) {
18908
18909var $ = __webpack_require__(0);
18910var isArray = __webpack_require__(80);
18911
18912// `Array.isArray` method
18913// https://tc39.es/ecma262/#sec-array.isarray
18914$({ target: 'Array', stat: true }, {
18915 isArray: isArray
18916});
18917
18918
18919/***/ }),
18920/* 510 */
18921/***/ (function(module, exports, __webpack_require__) {
18922
18923var _Symbol = __webpack_require__(225);
18924
18925var _getIteratorMethod = __webpack_require__(231);
18926
18927function _iterableToArrayLimit(arr, i) {
18928 var _i = arr == null ? null : typeof _Symbol !== "undefined" && _getIteratorMethod(arr) || arr["@@iterator"];
18929
18930 if (_i == null) return;
18931 var _arr = [];
18932 var _n = true;
18933 var _d = false;
18934
18935 var _s, _e;
18936
18937 try {
18938 for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
18939 _arr.push(_s.value);
18940
18941 if (i && _arr.length === i) break;
18942 }
18943 } catch (err) {
18944 _d = true;
18945 _e = err;
18946 } finally {
18947 try {
18948 if (!_n && _i["return"] != null) _i["return"]();
18949 } finally {
18950 if (_d) throw _e;
18951 }
18952 }
18953
18954 return _arr;
18955}
18956
18957module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports;
18958
18959/***/ }),
18960/* 511 */
18961/***/ (function(module, exports, __webpack_require__) {
18962
18963var _sliceInstanceProperty = __webpack_require__(512);
18964
18965var _Array$from = __webpack_require__(516);
18966
18967var arrayLikeToArray = __webpack_require__(520);
18968
18969function _unsupportedIterableToArray(o, minLen) {
18970 var _context;
18971
18972 if (!o) return;
18973 if (typeof o === "string") return arrayLikeToArray(o, minLen);
18974
18975 var n = _sliceInstanceProperty(_context = Object.prototype.toString.call(o)).call(_context, 8, -1);
18976
18977 if (n === "Object" && o.constructor) n = o.constructor.name;
18978 if (n === "Map" || n === "Set") return _Array$from(o);
18979 if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
18980}
18981
18982module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
18983
18984/***/ }),
18985/* 512 */
18986/***/ (function(module, exports, __webpack_require__) {
18987
18988module.exports = __webpack_require__(513);
18989
18990/***/ }),
18991/* 513 */
18992/***/ (function(module, exports, __webpack_require__) {
18993
18994module.exports = __webpack_require__(514);
18995
18996
18997/***/ }),
18998/* 514 */
18999/***/ (function(module, exports, __webpack_require__) {
19000
19001var parent = __webpack_require__(515);
19002
19003module.exports = parent;
19004
19005
19006/***/ }),
19007/* 515 */
19008/***/ (function(module, exports, __webpack_require__) {
19009
19010var parent = __webpack_require__(222);
19011
19012module.exports = parent;
19013
19014
19015/***/ }),
19016/* 516 */
19017/***/ (function(module, exports, __webpack_require__) {
19018
19019module.exports = __webpack_require__(517);
19020
19021/***/ }),
19022/* 517 */
19023/***/ (function(module, exports, __webpack_require__) {
19024
19025module.exports = __webpack_require__(518);
19026
19027
19028/***/ }),
19029/* 518 */
19030/***/ (function(module, exports, __webpack_require__) {
19031
19032var parent = __webpack_require__(519);
19033
19034module.exports = parent;
19035
19036
19037/***/ }),
19038/* 519 */
19039/***/ (function(module, exports, __webpack_require__) {
19040
19041var parent = __webpack_require__(230);
19042
19043module.exports = parent;
19044
19045
19046/***/ }),
19047/* 520 */
19048/***/ (function(module, exports) {
19049
19050function _arrayLikeToArray(arr, len) {
19051 if (len == null || len > arr.length) len = arr.length;
19052
19053 for (var i = 0, arr2 = new Array(len); i < len; i++) {
19054 arr2[i] = arr[i];
19055 }
19056
19057 return arr2;
19058}
19059
19060module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
19061
19062/***/ }),
19063/* 521 */
19064/***/ (function(module, exports) {
19065
19066function _nonIterableRest() {
19067 throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
19068}
19069
19070module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports;
19071
19072/***/ }),
19073/* 522 */
19074/***/ (function(module, exports, __webpack_require__) {
19075
19076module.exports = __webpack_require__(523);
19077
19078/***/ }),
19079/* 523 */
19080/***/ (function(module, exports, __webpack_require__) {
19081
19082var parent = __webpack_require__(524);
19083
19084module.exports = parent;
19085
19086
19087/***/ }),
19088/* 524 */
19089/***/ (function(module, exports, __webpack_require__) {
19090
19091__webpack_require__(525);
19092var path = __webpack_require__(13);
19093
19094var Object = path.Object;
19095
19096var getOwnPropertyDescriptor = module.exports = function getOwnPropertyDescriptor(it, key) {
19097 return Object.getOwnPropertyDescriptor(it, key);
19098};
19099
19100if (Object.getOwnPropertyDescriptor.sham) getOwnPropertyDescriptor.sham = true;
19101
19102
19103/***/ }),
19104/* 525 */
19105/***/ (function(module, exports, __webpack_require__) {
19106
19107var $ = __webpack_require__(0);
19108var fails = __webpack_require__(4);
19109var toIndexedObject = __webpack_require__(33);
19110var nativeGetOwnPropertyDescriptor = __webpack_require__(64).f;
19111var DESCRIPTORS = __webpack_require__(19);
19112
19113var FAILS_ON_PRIMITIVES = fails(function () { nativeGetOwnPropertyDescriptor(1); });
19114var FORCED = !DESCRIPTORS || FAILS_ON_PRIMITIVES;
19115
19116// `Object.getOwnPropertyDescriptor` method
19117// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
19118$({ target: 'Object', stat: true, forced: FORCED, sham: !DESCRIPTORS }, {
19119 getOwnPropertyDescriptor: function getOwnPropertyDescriptor(it, key) {
19120 return nativeGetOwnPropertyDescriptor(toIndexedObject(it), key);
19121 }
19122});
19123
19124
19125/***/ }),
19126/* 526 */
19127/***/ (function(module, exports, __webpack_require__) {
19128
19129"use strict";
19130
19131
19132var _ = __webpack_require__(1);
19133
19134var AVError = __webpack_require__(40);
19135
19136module.exports = function (AV) {
19137 AV.Role = AV.Object.extend('_Role',
19138 /** @lends AV.Role.prototype */
19139 {
19140 // Instance Methods
19141
19142 /**
19143 * Represents a Role on the AV server. Roles represent groupings of
19144 * Users for the purposes of granting permissions (e.g. specifying an ACL
19145 * for an Object). Roles are specified by their sets of child users and
19146 * child roles, all of which are granted any permissions that the parent
19147 * role has.
19148 *
19149 * <p>Roles must have a name (which cannot be changed after creation of the
19150 * role), and must specify an ACL.</p>
19151 * An AV.Role is a local representation of a role persisted to the AV
19152 * cloud.
19153 * @class AV.Role
19154 * @param {String} name The name of the Role to create.
19155 * @param {AV.ACL} acl The ACL for this role.
19156 */
19157 constructor: function constructor(name, acl) {
19158 if (_.isString(name)) {
19159 AV.Object.prototype.constructor.call(this, null, null);
19160 this.setName(name);
19161 } else {
19162 AV.Object.prototype.constructor.call(this, name, acl);
19163 }
19164
19165 if (acl) {
19166 if (!(acl instanceof AV.ACL)) {
19167 throw new TypeError('acl must be an instance of AV.ACL');
19168 } else {
19169 this.setACL(acl);
19170 }
19171 }
19172 },
19173
19174 /**
19175 * Gets the name of the role. You can alternatively call role.get("name")
19176 *
19177 * @return {String} the name of the role.
19178 */
19179 getName: function getName() {
19180 return this.get('name');
19181 },
19182
19183 /**
19184 * Sets the name for a role. This value must be set before the role has
19185 * been saved to the server, and cannot be set once the role has been
19186 * saved.
19187 *
19188 * <p>
19189 * A role's name can only contain alphanumeric characters, _, -, and
19190 * spaces.
19191 * </p>
19192 *
19193 * <p>This is equivalent to calling role.set("name", name)</p>
19194 *
19195 * @param {String} name The name of the role.
19196 */
19197 setName: function setName(name, options) {
19198 return this.set('name', name, options);
19199 },
19200
19201 /**
19202 * Gets the AV.Relation for the AV.Users that are direct
19203 * children of this role. These users are granted any privileges that this
19204 * role has been granted (e.g. read or write access through ACLs). You can
19205 * add or remove users from the role through this relation.
19206 *
19207 * <p>This is equivalent to calling role.relation("users")</p>
19208 *
19209 * @return {AV.Relation} the relation for the users belonging to this
19210 * role.
19211 */
19212 getUsers: function getUsers() {
19213 return this.relation('users');
19214 },
19215
19216 /**
19217 * Gets the AV.Relation for the AV.Roles that are direct
19218 * children of this role. These roles' users are granted any privileges that
19219 * this role has been granted (e.g. read or write access through ACLs). You
19220 * can add or remove child roles from this role through this relation.
19221 *
19222 * <p>This is equivalent to calling role.relation("roles")</p>
19223 *
19224 * @return {AV.Relation} the relation for the roles belonging to this
19225 * role.
19226 */
19227 getRoles: function getRoles() {
19228 return this.relation('roles');
19229 },
19230
19231 /**
19232 * @ignore
19233 */
19234 validate: function validate(attrs, options) {
19235 if ('name' in attrs && attrs.name !== this.getName()) {
19236 var newName = attrs.name;
19237
19238 if (this.id && this.id !== attrs.objectId) {
19239 // Check to see if the objectId being set matches this.id.
19240 // This happens during a fetch -- the id is set before calling fetch.
19241 // Let the name be set in this case.
19242 return new AVError(AVError.OTHER_CAUSE, "A role's name can only be set before it has been saved.");
19243 }
19244
19245 if (!_.isString(newName)) {
19246 return new AVError(AVError.OTHER_CAUSE, "A role's name must be a String.");
19247 }
19248
19249 if (!/^[0-9a-zA-Z\-_ ]+$/.test(newName)) {
19250 return new AVError(AVError.OTHER_CAUSE, "A role's name can only contain alphanumeric characters, _," + ' -, and spaces.');
19251 }
19252 }
19253
19254 if (AV.Object.prototype.validate) {
19255 return AV.Object.prototype.validate.call(this, attrs, options);
19256 }
19257
19258 return false;
19259 }
19260 });
19261};
19262
19263/***/ }),
19264/* 527 */
19265/***/ (function(module, exports, __webpack_require__) {
19266
19267"use strict";
19268
19269
19270var _interopRequireDefault = __webpack_require__(2);
19271
19272var _defineProperty2 = _interopRequireDefault(__webpack_require__(528));
19273
19274var _promise = _interopRequireDefault(__webpack_require__(12));
19275
19276var _map = _interopRequireDefault(__webpack_require__(39));
19277
19278var _find = _interopRequireDefault(__webpack_require__(104));
19279
19280var _stringify = _interopRequireDefault(__webpack_require__(34));
19281
19282var _ = __webpack_require__(1);
19283
19284var uuid = __webpack_require__(214);
19285
19286var AVError = __webpack_require__(40);
19287
19288var _require = __webpack_require__(25),
19289 AVRequest = _require._request,
19290 request = _require.request;
19291
19292var _require2 = __webpack_require__(61),
19293 getAdapter = _require2.getAdapter;
19294
19295var PLATFORM_ANONYMOUS = 'anonymous';
19296var PLATFORM_QQAPP = 'lc_qqapp';
19297
19298var mergeUnionDataIntoAuthData = function mergeUnionDataIntoAuthData() {
19299 var defaultUnionIdPlatform = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'weixin';
19300 return function (authData, unionId) {
19301 var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
19302 _ref$unionIdPlatform = _ref.unionIdPlatform,
19303 unionIdPlatform = _ref$unionIdPlatform === void 0 ? defaultUnionIdPlatform : _ref$unionIdPlatform,
19304 _ref$asMainAccount = _ref.asMainAccount,
19305 asMainAccount = _ref$asMainAccount === void 0 ? false : _ref$asMainAccount;
19306
19307 if (typeof unionId !== 'string') throw new AVError(AVError.OTHER_CAUSE, 'unionId is not a string');
19308 if (typeof unionIdPlatform !== 'string') throw new AVError(AVError.OTHER_CAUSE, 'unionIdPlatform is not a string');
19309 return _.extend({}, authData, {
19310 platform: unionIdPlatform,
19311 unionid: unionId,
19312 main_account: Boolean(asMainAccount)
19313 });
19314 };
19315};
19316
19317module.exports = function (AV) {
19318 /**
19319 * @class
19320 *
19321 * <p>An AV.User object is a local representation of a user persisted to the
19322 * LeanCloud server. This class is a subclass of an AV.Object, and retains the
19323 * same functionality of an AV.Object, but also extends it with various
19324 * user specific methods, like authentication, signing up, and validation of
19325 * uniqueness.</p>
19326 */
19327 AV.User = AV.Object.extend('_User',
19328 /** @lends AV.User.prototype */
19329 {
19330 // Instance Variables
19331 _isCurrentUser: false,
19332 // Instance Methods
19333
19334 /**
19335 * Internal method to handle special fields in a _User response.
19336 * @private
19337 */
19338 _mergeMagicFields: function _mergeMagicFields(attrs) {
19339 if (attrs.sessionToken) {
19340 this._sessionToken = attrs.sessionToken;
19341 delete attrs.sessionToken;
19342 }
19343
19344 return AV.User.__super__._mergeMagicFields.call(this, attrs);
19345 },
19346
19347 /**
19348 * Removes null values from authData (which exist temporarily for
19349 * unlinking)
19350 * @private
19351 */
19352 _cleanupAuthData: function _cleanupAuthData() {
19353 if (!this.isCurrent()) {
19354 return;
19355 }
19356
19357 var authData = this.get('authData');
19358
19359 if (!authData) {
19360 return;
19361 }
19362
19363 AV._objectEach(this.get('authData'), function (value, key) {
19364 if (!authData[key]) {
19365 delete authData[key];
19366 }
19367 });
19368 },
19369
19370 /**
19371 * Synchronizes authData for all providers.
19372 * @private
19373 */
19374 _synchronizeAllAuthData: function _synchronizeAllAuthData() {
19375 var authData = this.get('authData');
19376
19377 if (!authData) {
19378 return;
19379 }
19380
19381 var self = this;
19382
19383 AV._objectEach(this.get('authData'), function (value, key) {
19384 self._synchronizeAuthData(key);
19385 });
19386 },
19387
19388 /**
19389 * Synchronizes auth data for a provider (e.g. puts the access token in the
19390 * right place to be used by the Facebook SDK).
19391 * @private
19392 */
19393 _synchronizeAuthData: function _synchronizeAuthData(provider) {
19394 if (!this.isCurrent()) {
19395 return;
19396 }
19397
19398 var authType;
19399
19400 if (_.isString(provider)) {
19401 authType = provider;
19402 provider = AV.User._authProviders[authType];
19403 } else {
19404 authType = provider.getAuthType();
19405 }
19406
19407 var authData = this.get('authData');
19408
19409 if (!authData || !provider) {
19410 return;
19411 }
19412
19413 var success = provider.restoreAuthentication(authData[authType]);
19414
19415 if (!success) {
19416 this.dissociateAuthData(provider);
19417 }
19418 },
19419 _handleSaveResult: function _handleSaveResult(makeCurrent) {
19420 // Clean up and synchronize the authData object, removing any unset values
19421 if (makeCurrent && !AV._config.disableCurrentUser) {
19422 this._isCurrentUser = true;
19423 }
19424
19425 this._cleanupAuthData();
19426
19427 this._synchronizeAllAuthData(); // Don't keep the password around.
19428
19429
19430 delete this._serverData.password;
19431
19432 this._rebuildEstimatedDataForKey('password');
19433
19434 this._refreshCache();
19435
19436 if ((makeCurrent || this.isCurrent()) && !AV._config.disableCurrentUser) {
19437 // Some old version of leanengine-node-sdk will overwrite
19438 // AV.User._saveCurrentUser which returns no Promise.
19439 // So we need a Promise wrapper.
19440 return _promise.default.resolve(AV.User._saveCurrentUser(this));
19441 } else {
19442 return _promise.default.resolve();
19443 }
19444 },
19445
19446 /**
19447 * Unlike in the Android/iOS SDKs, logInWith is unnecessary, since you can
19448 * call linkWith on the user (even if it doesn't exist yet on the server).
19449 * @private
19450 */
19451 _linkWith: function _linkWith(provider, data) {
19452 var _this = this;
19453
19454 var _ref2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
19455 _ref2$failOnNotExist = _ref2.failOnNotExist,
19456 failOnNotExist = _ref2$failOnNotExist === void 0 ? false : _ref2$failOnNotExist;
19457
19458 var authType;
19459
19460 if (_.isString(provider)) {
19461 authType = provider;
19462 provider = AV.User._authProviders[provider];
19463 } else {
19464 authType = provider.getAuthType();
19465 }
19466
19467 if (data) {
19468 return this.save({
19469 authData: (0, _defineProperty2.default)({}, authType, data)
19470 }, {
19471 fetchWhenSave: !!this.get('authData'),
19472 _failOnNotExist: failOnNotExist
19473 }).then(function (model) {
19474 return model._handleSaveResult(true).then(function () {
19475 return model;
19476 });
19477 });
19478 } else {
19479 return provider.authenticate().then(function (result) {
19480 return _this._linkWith(provider, result);
19481 });
19482 }
19483 },
19484
19485 /**
19486 * Associate the user with a third party authData.
19487 * @since 3.3.0
19488 * @param {Object} authData The response json data returned from third party token, maybe like { openid: 'abc123', access_token: '123abc', expires_in: 1382686496 }
19489 * @param {string} platform Available platform for sign up.
19490 * @return {Promise<AV.User>} A promise that is fulfilled with the user when completed.
19491 * @example user.associateWithAuthData({
19492 * openid: 'abc123',
19493 * access_token: '123abc',
19494 * expires_in: 1382686496
19495 * }, 'weixin').then(function(user) {
19496 * //Access user here
19497 * }).catch(function(error) {
19498 * //console.error("error: ", error);
19499 * });
19500 */
19501 associateWithAuthData: function associateWithAuthData(authData, platform) {
19502 return this._linkWith(platform, authData);
19503 },
19504
19505 /**
19506 * Associate the user with a third party authData and unionId.
19507 * @since 3.5.0
19508 * @param {Object} authData The response json data returned from third party token, maybe like { openid: 'abc123', access_token: '123abc', expires_in: 1382686496 }
19509 * @param {string} platform Available platform for sign up.
19510 * @param {string} unionId
19511 * @param {Object} [unionLoginOptions]
19512 * @param {string} [unionLoginOptions.unionIdPlatform = 'weixin'] unionId platform
19513 * @param {boolean} [unionLoginOptions.asMainAccount = false] If true, the unionId will be associated with the user.
19514 * @return {Promise<AV.User>} A promise that is fulfilled with the user when completed.
19515 * @example user.associateWithAuthDataAndUnionId({
19516 * openid: 'abc123',
19517 * access_token: '123abc',
19518 * expires_in: 1382686496
19519 * }, 'weixin', 'union123', {
19520 * unionIdPlatform: 'weixin',
19521 * asMainAccount: true,
19522 * }).then(function(user) {
19523 * //Access user here
19524 * }).catch(function(error) {
19525 * //console.error("error: ", error);
19526 * });
19527 */
19528 associateWithAuthDataAndUnionId: function associateWithAuthDataAndUnionId(authData, platform, unionId, unionOptions) {
19529 return this._linkWith(platform, mergeUnionDataIntoAuthData()(authData, unionId, unionOptions));
19530 },
19531
19532 /**
19533 * Associate the user with the identity of the current mini-app.
19534 * @since 4.6.0
19535 * @param {Object} [authInfo]
19536 * @param {Object} [option]
19537 * @param {Boolean} [option.failOnNotExist] If true, the login request will fail when no user matches this authInfo.authData exists.
19538 * @return {Promise<AV.User>}
19539 */
19540 associateWithMiniApp: function associateWithMiniApp(authInfo, option) {
19541 var _this2 = this;
19542
19543 if (authInfo === undefined) {
19544 var getAuthInfo = getAdapter('getAuthInfo');
19545 return getAuthInfo().then(function (authInfo) {
19546 return _this2._linkWith(authInfo.provider, authInfo.authData, option);
19547 });
19548 }
19549
19550 return this._linkWith(authInfo.provider, authInfo.authData, option);
19551 },
19552
19553 /**
19554 * 将用户与 QQ 小程序用户进行关联。适用于为已经在用户系统中存在的用户关联当前使用 QQ 小程序的微信帐号。
19555 * 仅在 QQ 小程序中可用。
19556 *
19557 * @deprecated Please use {@link AV.User#associateWithMiniApp}
19558 * @since 4.2.0
19559 * @param {Object} [options]
19560 * @param {boolean} [options.preferUnionId = false] 如果服务端在登录时获取到了用户的 UnionId,是否将 UnionId 保存在用户账号中。
19561 * @param {string} [options.unionIdPlatform = 'qq'] (only take effect when preferUnionId) unionId platform
19562 * @param {boolean} [options.asMainAccount = true] (only take effect when preferUnionId) If true, the unionId will be associated with the user.
19563 * @return {Promise<AV.User>}
19564 */
19565 associateWithQQApp: function associateWithQQApp() {
19566 var _this3 = this;
19567
19568 var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
19569 _ref3$preferUnionId = _ref3.preferUnionId,
19570 preferUnionId = _ref3$preferUnionId === void 0 ? false : _ref3$preferUnionId,
19571 _ref3$unionIdPlatform = _ref3.unionIdPlatform,
19572 unionIdPlatform = _ref3$unionIdPlatform === void 0 ? 'qq' : _ref3$unionIdPlatform,
19573 _ref3$asMainAccount = _ref3.asMainAccount,
19574 asMainAccount = _ref3$asMainAccount === void 0 ? true : _ref3$asMainAccount;
19575
19576 var getAuthInfo = getAdapter('getAuthInfo');
19577 return getAuthInfo({
19578 preferUnionId: preferUnionId,
19579 asMainAccount: asMainAccount,
19580 platform: unionIdPlatform
19581 }).then(function (authInfo) {
19582 authInfo.provider = PLATFORM_QQAPP;
19583 return _this3.associateWithMiniApp(authInfo);
19584 });
19585 },
19586
19587 /**
19588 * 将用户与微信小程序用户进行关联。适用于为已经在用户系统中存在的用户关联当前使用微信小程序的微信帐号。
19589 * 仅在微信小程序中可用。
19590 *
19591 * @deprecated Please use {@link AV.User#associateWithMiniApp}
19592 * @since 3.13.0
19593 * @param {Object} [options]
19594 * @param {boolean} [options.preferUnionId = false] 当用户满足 {@link https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/union-id.html 获取 UnionId 的条件} 时,是否将 UnionId 保存在用户账号中。
19595 * @param {string} [options.unionIdPlatform = 'weixin'] (only take effect when preferUnionId) unionId platform
19596 * @param {boolean} [options.asMainAccount = true] (only take effect when preferUnionId) If true, the unionId will be associated with the user.
19597 * @return {Promise<AV.User>}
19598 */
19599 associateWithWeapp: function associateWithWeapp() {
19600 var _this4 = this;
19601
19602 var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
19603 _ref4$preferUnionId = _ref4.preferUnionId,
19604 preferUnionId = _ref4$preferUnionId === void 0 ? false : _ref4$preferUnionId,
19605 _ref4$unionIdPlatform = _ref4.unionIdPlatform,
19606 unionIdPlatform = _ref4$unionIdPlatform === void 0 ? 'weixin' : _ref4$unionIdPlatform,
19607 _ref4$asMainAccount = _ref4.asMainAccount,
19608 asMainAccount = _ref4$asMainAccount === void 0 ? true : _ref4$asMainAccount;
19609
19610 var getAuthInfo = getAdapter('getAuthInfo');
19611 return getAuthInfo({
19612 preferUnionId: preferUnionId,
19613 asMainAccount: asMainAccount,
19614 platform: unionIdPlatform
19615 }).then(function (authInfo) {
19616 return _this4.associateWithMiniApp(authInfo);
19617 });
19618 },
19619
19620 /**
19621 * @deprecated renamed to {@link AV.User#associateWithWeapp}
19622 * @return {Promise<AV.User>}
19623 */
19624 linkWithWeapp: function linkWithWeapp(options) {
19625 console.warn('DEPRECATED: User#linkWithWeapp 已废弃,请使用 User#associateWithWeapp 代替');
19626 return this.associateWithWeapp(options);
19627 },
19628
19629 /**
19630 * 将用户与 QQ 小程序用户进行关联。适用于为已经在用户系统中存在的用户关联当前使用 QQ 小程序的 QQ 帐号。
19631 * 仅在 QQ 小程序中可用。
19632 *
19633 * @deprecated Please use {@link AV.User#associateWithMiniApp}
19634 * @since 4.2.0
19635 * @param {string} unionId
19636 * @param {Object} [unionOptions]
19637 * @param {string} [unionOptions.unionIdPlatform = 'qq'] unionId platform
19638 * @param {boolean} [unionOptions.asMainAccount = false] If true, the unionId will be associated with the user.
19639 * @return {Promise<AV.User>}
19640 */
19641 associateWithQQAppWithUnionId: function associateWithQQAppWithUnionId(unionId) {
19642 var _this5 = this;
19643
19644 var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
19645 _ref5$unionIdPlatform = _ref5.unionIdPlatform,
19646 unionIdPlatform = _ref5$unionIdPlatform === void 0 ? 'qq' : _ref5$unionIdPlatform,
19647 _ref5$asMainAccount = _ref5.asMainAccount,
19648 asMainAccount = _ref5$asMainAccount === void 0 ? false : _ref5$asMainAccount;
19649
19650 var getAuthInfo = getAdapter('getAuthInfo');
19651 return getAuthInfo({
19652 platform: unionIdPlatform
19653 }).then(function (authInfo) {
19654 authInfo = AV.User.mergeUnionId(authInfo, unionId, {
19655 asMainAccount: asMainAccount
19656 });
19657 authInfo.provider = PLATFORM_QQAPP;
19658 return _this5.associateWithMiniApp(authInfo);
19659 });
19660 },
19661
19662 /**
19663 * 将用户与微信小程序用户进行关联。适用于为已经在用户系统中存在的用户关联当前使用微信小程序的微信帐号。
19664 * 仅在微信小程序中可用。
19665 *
19666 * @deprecated Please use {@link AV.User#associateWithMiniApp}
19667 * @since 3.13.0
19668 * @param {string} unionId
19669 * @param {Object} [unionOptions]
19670 * @param {string} [unionOptions.unionIdPlatform = 'weixin'] unionId platform
19671 * @param {boolean} [unionOptions.asMainAccount = false] If true, the unionId will be associated with the user.
19672 * @return {Promise<AV.User>}
19673 */
19674 associateWithWeappWithUnionId: function associateWithWeappWithUnionId(unionId) {
19675 var _this6 = this;
19676
19677 var _ref6 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
19678 _ref6$unionIdPlatform = _ref6.unionIdPlatform,
19679 unionIdPlatform = _ref6$unionIdPlatform === void 0 ? 'weixin' : _ref6$unionIdPlatform,
19680 _ref6$asMainAccount = _ref6.asMainAccount,
19681 asMainAccount = _ref6$asMainAccount === void 0 ? false : _ref6$asMainAccount;
19682
19683 var getAuthInfo = getAdapter('getAuthInfo');
19684 return getAuthInfo({
19685 platform: unionIdPlatform
19686 }).then(function (authInfo) {
19687 authInfo = AV.User.mergeUnionId(authInfo, unionId, {
19688 asMainAccount: asMainAccount
19689 });
19690 return _this6.associateWithMiniApp(authInfo);
19691 });
19692 },
19693
19694 /**
19695 * Unlinks a user from a service.
19696 * @param {string} platform
19697 * @return {Promise<AV.User>}
19698 * @since 3.3.0
19699 */
19700 dissociateAuthData: function dissociateAuthData(provider) {
19701 this.unset("authData.".concat(provider));
19702 return this.save().then(function (model) {
19703 return model._handleSaveResult(true).then(function () {
19704 return model;
19705 });
19706 });
19707 },
19708
19709 /**
19710 * @private
19711 * @deprecated
19712 */
19713 _unlinkFrom: function _unlinkFrom(provider) {
19714 console.warn('DEPRECATED: User#_unlinkFrom 已废弃,请使用 User#dissociateAuthData 代替');
19715 return this.dissociateAuthData(provider);
19716 },
19717
19718 /**
19719 * Checks whether a user is linked to a service.
19720 * @private
19721 */
19722 _isLinked: function _isLinked(provider) {
19723 var authType;
19724
19725 if (_.isString(provider)) {
19726 authType = provider;
19727 } else {
19728 authType = provider.getAuthType();
19729 }
19730
19731 var authData = this.get('authData') || {};
19732 return !!authData[authType];
19733 },
19734
19735 /**
19736 * Checks whether a user is anonymous.
19737 * @since 3.9.0
19738 * @return {boolean}
19739 */
19740 isAnonymous: function isAnonymous() {
19741 return this._isLinked(PLATFORM_ANONYMOUS);
19742 },
19743 logOut: function logOut() {
19744 this._logOutWithAll();
19745
19746 this._isCurrentUser = false;
19747 },
19748
19749 /**
19750 * Deauthenticates all providers.
19751 * @private
19752 */
19753 _logOutWithAll: function _logOutWithAll() {
19754 var authData = this.get('authData');
19755
19756 if (!authData) {
19757 return;
19758 }
19759
19760 var self = this;
19761
19762 AV._objectEach(this.get('authData'), function (value, key) {
19763 self._logOutWith(key);
19764 });
19765 },
19766
19767 /**
19768 * Deauthenticates a single provider (e.g. removing access tokens from the
19769 * Facebook SDK).
19770 * @private
19771 */
19772 _logOutWith: function _logOutWith(provider) {
19773 if (!this.isCurrent()) {
19774 return;
19775 }
19776
19777 if (_.isString(provider)) {
19778 provider = AV.User._authProviders[provider];
19779 }
19780
19781 if (provider && provider.deauthenticate) {
19782 provider.deauthenticate();
19783 }
19784 },
19785
19786 /**
19787 * Signs up a new user. You should call this instead of save for
19788 * new AV.Users. This will create a new AV.User on the server, and
19789 * also persist the session on disk so that you can access the user using
19790 * <code>current</code>.
19791 *
19792 * <p>A username and password must be set before calling signUp.</p>
19793 *
19794 * @param {Object} attrs Extra fields to set on the new user, or null.
19795 * @param {AuthOptions} options
19796 * @return {Promise} A promise that is fulfilled when the signup
19797 * finishes.
19798 * @see AV.User.signUp
19799 */
19800 signUp: function signUp(attrs, options) {
19801 var error;
19802 var username = attrs && attrs.username || this.get('username');
19803
19804 if (!username || username === '') {
19805 error = new AVError(AVError.OTHER_CAUSE, 'Cannot sign up user with an empty name.');
19806 throw error;
19807 }
19808
19809 var password = attrs && attrs.password || this.get('password');
19810
19811 if (!password || password === '') {
19812 error = new AVError(AVError.OTHER_CAUSE, 'Cannot sign up user with an empty password.');
19813 throw error;
19814 }
19815
19816 return this.save(attrs, options).then(function (model) {
19817 if (model.isAnonymous()) {
19818 model.unset("authData.".concat(PLATFORM_ANONYMOUS));
19819 model._opSetQueue = [{}];
19820 }
19821
19822 return model._handleSaveResult(true).then(function () {
19823 return model;
19824 });
19825 });
19826 },
19827
19828 /**
19829 * Signs up a new user with mobile phone and sms code.
19830 * You should call this instead of save for
19831 * new AV.Users. This will create a new AV.User on the server, and
19832 * also persist the session on disk so that you can access the user using
19833 * <code>current</code>.
19834 *
19835 * <p>A username and password must be set before calling signUp.</p>
19836 *
19837 * @param {Object} attrs Extra fields to set on the new user, or null.
19838 * @param {AuthOptions} options
19839 * @return {Promise} A promise that is fulfilled when the signup
19840 * finishes.
19841 * @see AV.User.signUpOrlogInWithMobilePhone
19842 * @see AV.Cloud.requestSmsCode
19843 */
19844 signUpOrlogInWithMobilePhone: function signUpOrlogInWithMobilePhone(attrs) {
19845 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
19846 var error;
19847 var mobilePhoneNumber = attrs && attrs.mobilePhoneNumber || this.get('mobilePhoneNumber');
19848
19849 if (!mobilePhoneNumber || mobilePhoneNumber === '') {
19850 error = new AVError(AVError.OTHER_CAUSE, 'Cannot sign up or login user by mobilePhoneNumber ' + 'with an empty mobilePhoneNumber.');
19851 throw error;
19852 }
19853
19854 var smsCode = attrs && attrs.smsCode || this.get('smsCode');
19855
19856 if (!smsCode || smsCode === '') {
19857 error = new AVError(AVError.OTHER_CAUSE, 'Cannot sign up or login user by mobilePhoneNumber ' + 'with an empty smsCode.');
19858 throw error;
19859 }
19860
19861 options._makeRequest = function (route, className, id, method, json) {
19862 return AVRequest('usersByMobilePhone', null, null, 'POST', json);
19863 };
19864
19865 return this.save(attrs, options).then(function (model) {
19866 delete model.attributes.smsCode;
19867 delete model._serverData.smsCode;
19868 return model._handleSaveResult(true).then(function () {
19869 return model;
19870 });
19871 });
19872 },
19873
19874 /**
19875 * The same with {@link AV.User.loginWithAuthData}, except that you can set attributes before login.
19876 * @since 3.7.0
19877 */
19878 loginWithAuthData: function loginWithAuthData(authData, platform, options) {
19879 return this._linkWith(platform, authData, options);
19880 },
19881
19882 /**
19883 * The same with {@link AV.User.loginWithAuthDataAndUnionId}, except that you can set attributes before login.
19884 * @since 3.7.0
19885 */
19886 loginWithAuthDataAndUnionId: function loginWithAuthDataAndUnionId(authData, platform, unionId, unionLoginOptions) {
19887 return this.loginWithAuthData(mergeUnionDataIntoAuthData()(authData, unionId, unionLoginOptions), platform, unionLoginOptions);
19888 },
19889
19890 /**
19891 * The same with {@link AV.User.loginWithWeapp}, except that you can set attributes before login.
19892 * @deprecated please use {@link AV.User#loginWithMiniApp}
19893 * @since 3.7.0
19894 * @param {Object} [options]
19895 * @param {boolean} [options.failOnNotExist] If true, the login request will fail when no user matches this authData exists.
19896 * @param {boolean} [options.preferUnionId] 当用户满足 {@link https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/union-id.html 获取 UnionId 的条件} 时,是否使用 UnionId 登录。(since 3.13.0)
19897 * @param {string} [options.unionIdPlatform = 'weixin'] (only take effect when preferUnionId) unionId platform
19898 * @param {boolean} [options.asMainAccount = true] (only take effect when preferUnionId) If true, the unionId will be associated with the user.
19899 * @return {Promise<AV.User>}
19900 */
19901 loginWithWeapp: function loginWithWeapp() {
19902 var _this7 = this;
19903
19904 var _ref7 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
19905 _ref7$preferUnionId = _ref7.preferUnionId,
19906 preferUnionId = _ref7$preferUnionId === void 0 ? false : _ref7$preferUnionId,
19907 _ref7$unionIdPlatform = _ref7.unionIdPlatform,
19908 unionIdPlatform = _ref7$unionIdPlatform === void 0 ? 'weixin' : _ref7$unionIdPlatform,
19909 _ref7$asMainAccount = _ref7.asMainAccount,
19910 asMainAccount = _ref7$asMainAccount === void 0 ? true : _ref7$asMainAccount,
19911 _ref7$failOnNotExist = _ref7.failOnNotExist,
19912 failOnNotExist = _ref7$failOnNotExist === void 0 ? false : _ref7$failOnNotExist;
19913
19914 var getAuthInfo = getAdapter('getAuthInfo');
19915 return getAuthInfo({
19916 preferUnionId: preferUnionId,
19917 asMainAccount: asMainAccount,
19918 platform: unionIdPlatform
19919 }).then(function (authInfo) {
19920 return _this7.loginWithMiniApp(authInfo, {
19921 failOnNotExist: failOnNotExist
19922 });
19923 });
19924 },
19925
19926 /**
19927 * The same with {@link AV.User.loginWithWeappWithUnionId}, except that you can set attributes before login.
19928 * @deprecated please use {@link AV.User#loginWithMiniApp}
19929 * @since 3.13.0
19930 */
19931 loginWithWeappWithUnionId: function loginWithWeappWithUnionId(unionId) {
19932 var _this8 = this;
19933
19934 var _ref8 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
19935 _ref8$unionIdPlatform = _ref8.unionIdPlatform,
19936 unionIdPlatform = _ref8$unionIdPlatform === void 0 ? 'weixin' : _ref8$unionIdPlatform,
19937 _ref8$asMainAccount = _ref8.asMainAccount,
19938 asMainAccount = _ref8$asMainAccount === void 0 ? false : _ref8$asMainAccount,
19939 _ref8$failOnNotExist = _ref8.failOnNotExist,
19940 failOnNotExist = _ref8$failOnNotExist === void 0 ? false : _ref8$failOnNotExist;
19941
19942 var getAuthInfo = getAdapter('getAuthInfo');
19943 return getAuthInfo({
19944 platform: unionIdPlatform
19945 }).then(function (authInfo) {
19946 authInfo = AV.User.mergeUnionId(authInfo, unionId, {
19947 asMainAccount: asMainAccount
19948 });
19949 return _this8.loginWithMiniApp(authInfo, {
19950 failOnNotExist: failOnNotExist
19951 });
19952 });
19953 },
19954
19955 /**
19956 * The same with {@link AV.User.loginWithQQApp}, except that you can set attributes before login.
19957 * @deprecated please use {@link AV.User#loginWithMiniApp}
19958 * @since 4.2.0
19959 * @param {Object} [options]
19960 * @param {boolean} [options.failOnNotExist] If true, the login request will fail when no user matches this authData exists.
19961 * @param {boolean} [options.preferUnionId] 如果服务端在登录时获取到了用户的 UnionId,是否将 UnionId 保存在用户账号中。
19962 * @param {string} [options.unionIdPlatform = 'qq'] (only take effect when preferUnionId) unionId platform
19963 * @param {boolean} [options.asMainAccount = true] (only take effect when preferUnionId) If true, the unionId will be associated with the user.
19964 */
19965 loginWithQQApp: function loginWithQQApp() {
19966 var _this9 = this;
19967
19968 var _ref9 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
19969 _ref9$preferUnionId = _ref9.preferUnionId,
19970 preferUnionId = _ref9$preferUnionId === void 0 ? false : _ref9$preferUnionId,
19971 _ref9$unionIdPlatform = _ref9.unionIdPlatform,
19972 unionIdPlatform = _ref9$unionIdPlatform === void 0 ? 'qq' : _ref9$unionIdPlatform,
19973 _ref9$asMainAccount = _ref9.asMainAccount,
19974 asMainAccount = _ref9$asMainAccount === void 0 ? true : _ref9$asMainAccount,
19975 _ref9$failOnNotExist = _ref9.failOnNotExist,
19976 failOnNotExist = _ref9$failOnNotExist === void 0 ? false : _ref9$failOnNotExist;
19977
19978 var getAuthInfo = getAdapter('getAuthInfo');
19979 return getAuthInfo({
19980 preferUnionId: preferUnionId,
19981 asMainAccount: asMainAccount,
19982 platform: unionIdPlatform
19983 }).then(function (authInfo) {
19984 authInfo.provider = PLATFORM_QQAPP;
19985 return _this9.loginWithMiniApp(authInfo, {
19986 failOnNotExist: failOnNotExist
19987 });
19988 });
19989 },
19990
19991 /**
19992 * The same with {@link AV.User.loginWithQQAppWithUnionId}, except that you can set attributes before login.
19993 * @deprecated please use {@link AV.User#loginWithMiniApp}
19994 * @since 4.2.0
19995 */
19996 loginWithQQAppWithUnionId: function loginWithQQAppWithUnionId(unionId) {
19997 var _this10 = this;
19998
19999 var _ref10 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
20000 _ref10$unionIdPlatfor = _ref10.unionIdPlatform,
20001 unionIdPlatform = _ref10$unionIdPlatfor === void 0 ? 'qq' : _ref10$unionIdPlatfor,
20002 _ref10$asMainAccount = _ref10.asMainAccount,
20003 asMainAccount = _ref10$asMainAccount === void 0 ? false : _ref10$asMainAccount,
20004 _ref10$failOnNotExist = _ref10.failOnNotExist,
20005 failOnNotExist = _ref10$failOnNotExist === void 0 ? false : _ref10$failOnNotExist;
20006
20007 var getAuthInfo = getAdapter('getAuthInfo');
20008 return getAuthInfo({
20009 platform: unionIdPlatform
20010 }).then(function (authInfo) {
20011 authInfo = AV.User.mergeUnionId(authInfo, unionId, {
20012 asMainAccount: asMainAccount
20013 });
20014 authInfo.provider = PLATFORM_QQAPP;
20015 return _this10.loginWithMiniApp(authInfo, {
20016 failOnNotExist: failOnNotExist
20017 });
20018 });
20019 },
20020
20021 /**
20022 * The same with {@link AV.User.loginWithMiniApp}, except that you can set attributes before login.
20023 * @since 4.6.0
20024 */
20025 loginWithMiniApp: function loginWithMiniApp(authInfo, option) {
20026 var _this11 = this;
20027
20028 if (authInfo === undefined) {
20029 var getAuthInfo = getAdapter('getAuthInfo');
20030 return getAuthInfo().then(function (authInfo) {
20031 return _this11.loginWithAuthData(authInfo.authData, authInfo.provider, option);
20032 });
20033 }
20034
20035 return this.loginWithAuthData(authInfo.authData, authInfo.provider, option);
20036 },
20037
20038 /**
20039 * Logs in a AV.User. On success, this saves the session to localStorage,
20040 * so you can retrieve the currently logged in user using
20041 * <code>current</code>.
20042 *
20043 * <p>A username and password must be set before calling logIn.</p>
20044 *
20045 * @see AV.User.logIn
20046 * @return {Promise} A promise that is fulfilled with the user when
20047 * the login is complete.
20048 */
20049 logIn: function logIn() {
20050 var model = this;
20051 var request = AVRequest('login', null, null, 'POST', this.toJSON());
20052 return request.then(function (resp) {
20053 var serverAttrs = model.parse(resp);
20054
20055 model._finishFetch(serverAttrs);
20056
20057 return model._handleSaveResult(true).then(function () {
20058 if (!serverAttrs.smsCode) delete model.attributes['smsCode'];
20059 return model;
20060 });
20061 });
20062 },
20063
20064 /**
20065 * @see AV.Object#save
20066 */
20067 save: function save(arg1, arg2, arg3) {
20068 var attrs, options;
20069
20070 if (_.isObject(arg1) || _.isNull(arg1) || _.isUndefined(arg1)) {
20071 attrs = arg1;
20072 options = arg2;
20073 } else {
20074 attrs = {};
20075 attrs[arg1] = arg2;
20076 options = arg3;
20077 }
20078
20079 options = options || {};
20080 return AV.Object.prototype.save.call(this, attrs, options).then(function (model) {
20081 return model._handleSaveResult(false).then(function () {
20082 return model;
20083 });
20084 });
20085 },
20086
20087 /**
20088 * Follow a user
20089 * @since 0.3.0
20090 * @param {Object | AV.User | String} options if an AV.User or string is given, it will be used as the target user.
20091 * @param {AV.User | String} options.user The target user or user's objectId to follow.
20092 * @param {Object} [options.attributes] key-value attributes dictionary to be used as
20093 * conditions of followerQuery/followeeQuery.
20094 * @param {AuthOptions} [authOptions]
20095 */
20096 follow: function follow(options, authOptions) {
20097 if (!this.id) {
20098 throw new Error('Please signin.');
20099 }
20100
20101 var user;
20102 var attributes;
20103
20104 if (options.user) {
20105 user = options.user;
20106 attributes = options.attributes;
20107 } else {
20108 user = options;
20109 }
20110
20111 var userObjectId = _.isString(user) ? user : user.id;
20112
20113 if (!userObjectId) {
20114 throw new Error('Invalid target user.');
20115 }
20116
20117 var route = 'users/' + this.id + '/friendship/' + userObjectId;
20118 var request = AVRequest(route, null, null, 'POST', AV._encode(attributes), authOptions);
20119 return request;
20120 },
20121
20122 /**
20123 * Unfollow a user.
20124 * @since 0.3.0
20125 * @param {Object | AV.User | String} options if an AV.User or string is given, it will be used as the target user.
20126 * @param {AV.User | String} options.user The target user or user's objectId to unfollow.
20127 * @param {AuthOptions} [authOptions]
20128 */
20129 unfollow: function unfollow(options, authOptions) {
20130 if (!this.id) {
20131 throw new Error('Please signin.');
20132 }
20133
20134 var user;
20135
20136 if (options.user) {
20137 user = options.user;
20138 } else {
20139 user = options;
20140 }
20141
20142 var userObjectId = _.isString(user) ? user : user.id;
20143
20144 if (!userObjectId) {
20145 throw new Error('Invalid target user.');
20146 }
20147
20148 var route = 'users/' + this.id + '/friendship/' + userObjectId;
20149 var request = AVRequest(route, null, null, 'DELETE', null, authOptions);
20150 return request;
20151 },
20152
20153 /**
20154 * Get the user's followers and followees.
20155 * @since 4.8.0
20156 * @param {Object} [options]
20157 * @param {Number} [options.skip]
20158 * @param {Number} [options.limit]
20159 * @param {AuthOptions} [authOptions]
20160 */
20161 getFollowersAndFollowees: function getFollowersAndFollowees(options, authOptions) {
20162 if (!this.id) {
20163 throw new Error('Please signin.');
20164 }
20165
20166 return request({
20167 method: 'GET',
20168 path: "/users/".concat(this.id, "/followersAndFollowees"),
20169 query: {
20170 skip: options && options.skip,
20171 limit: options && options.limit,
20172 include: 'follower,followee',
20173 keys: 'follower,followee'
20174 },
20175 authOptions: authOptions
20176 }).then(function (_ref11) {
20177 var followers = _ref11.followers,
20178 followees = _ref11.followees;
20179 return {
20180 followers: (0, _map.default)(followers).call(followers, function (_ref12) {
20181 var follower = _ref12.follower;
20182 return AV._decode(follower);
20183 }),
20184 followees: (0, _map.default)(followees).call(followees, function (_ref13) {
20185 var followee = _ref13.followee;
20186 return AV._decode(followee);
20187 })
20188 };
20189 });
20190 },
20191
20192 /**
20193 *Create a follower query to query the user's followers.
20194 * @since 0.3.0
20195 * @see AV.User#followerQuery
20196 */
20197 followerQuery: function followerQuery() {
20198 return AV.User.followerQuery(this.id);
20199 },
20200
20201 /**
20202 *Create a followee query to query the user's followees.
20203 * @since 0.3.0
20204 * @see AV.User#followeeQuery
20205 */
20206 followeeQuery: function followeeQuery() {
20207 return AV.User.followeeQuery(this.id);
20208 },
20209
20210 /**
20211 * @see AV.Object#fetch
20212 */
20213 fetch: function fetch(fetchOptions, options) {
20214 return AV.Object.prototype.fetch.call(this, fetchOptions, options).then(function (model) {
20215 return model._handleSaveResult(false).then(function () {
20216 return model;
20217 });
20218 });
20219 },
20220
20221 /**
20222 * Update user's new password safely based on old password.
20223 * @param {String} oldPassword the old password.
20224 * @param {String} newPassword the new password.
20225 * @param {AuthOptions} options
20226 */
20227 updatePassword: function updatePassword(oldPassword, newPassword, options) {
20228 var _this12 = this;
20229
20230 var route = 'users/' + this.id + '/updatePassword';
20231 var params = {
20232 old_password: oldPassword,
20233 new_password: newPassword
20234 };
20235 var request = AVRequest(route, null, null, 'PUT', params, options);
20236 return request.then(function (resp) {
20237 _this12._finishFetch(_this12.parse(resp));
20238
20239 return _this12._handleSaveResult(true).then(function () {
20240 return resp;
20241 });
20242 });
20243 },
20244
20245 /**
20246 * Returns true if <code>current</code> would return this user.
20247 * @see AV.User#current
20248 */
20249 isCurrent: function isCurrent() {
20250 return this._isCurrentUser;
20251 },
20252
20253 /**
20254 * Returns get("username").
20255 * @return {String}
20256 * @see AV.Object#get
20257 */
20258 getUsername: function getUsername() {
20259 return this.get('username');
20260 },
20261
20262 /**
20263 * Returns get("mobilePhoneNumber").
20264 * @return {String}
20265 * @see AV.Object#get
20266 */
20267 getMobilePhoneNumber: function getMobilePhoneNumber() {
20268 return this.get('mobilePhoneNumber');
20269 },
20270
20271 /**
20272 * Calls set("mobilePhoneNumber", phoneNumber, options) and returns the result.
20273 * @param {String} mobilePhoneNumber
20274 * @return {Boolean}
20275 * @see AV.Object#set
20276 */
20277 setMobilePhoneNumber: function setMobilePhoneNumber(phone, options) {
20278 return this.set('mobilePhoneNumber', phone, options);
20279 },
20280
20281 /**
20282 * Calls set("username", username, options) and returns the result.
20283 * @param {String} username
20284 * @return {Boolean}
20285 * @see AV.Object#set
20286 */
20287 setUsername: function setUsername(username, options) {
20288 return this.set('username', username, options);
20289 },
20290
20291 /**
20292 * Calls set("password", password, options) and returns the result.
20293 * @param {String} password
20294 * @return {Boolean}
20295 * @see AV.Object#set
20296 */
20297 setPassword: function setPassword(password, options) {
20298 return this.set('password', password, options);
20299 },
20300
20301 /**
20302 * Returns get("email").
20303 * @return {String}
20304 * @see AV.Object#get
20305 */
20306 getEmail: function getEmail() {
20307 return this.get('email');
20308 },
20309
20310 /**
20311 * Calls set("email", email, options) and returns the result.
20312 * @param {String} email
20313 * @param {AuthOptions} options
20314 * @return {Boolean}
20315 * @see AV.Object#set
20316 */
20317 setEmail: function setEmail(email, options) {
20318 return this.set('email', email, options);
20319 },
20320
20321 /**
20322 * Checks whether this user is the current user and has been authenticated.
20323 * @deprecated 如果要判断当前用户的登录状态是否有效,请使用 currentUser.isAuthenticated().then(),
20324 * 如果要判断该用户是否是当前登录用户,请使用 user.id === currentUser.id
20325 * @return (Boolean) whether this user is the current user and is logged in.
20326 */
20327 authenticated: function authenticated() {
20328 console.warn('DEPRECATED: 如果要判断当前用户的登录状态是否有效,请使用 currentUser.isAuthenticated().then(),如果要判断该用户是否是当前登录用户,请使用 user.id === currentUser.id。');
20329 return !!this._sessionToken && !AV._config.disableCurrentUser && AV.User.current() && AV.User.current().id === this.id;
20330 },
20331
20332 /**
20333 * Detects if current sessionToken is valid.
20334 *
20335 * @since 2.0.0
20336 * @return Promise.<Boolean>
20337 */
20338 isAuthenticated: function isAuthenticated() {
20339 var _this13 = this;
20340
20341 return _promise.default.resolve().then(function () {
20342 return !!_this13._sessionToken && AV.User._fetchUserBySessionToken(_this13._sessionToken).then(function () {
20343 return true;
20344 }, function (error) {
20345 if (error.code === 211) {
20346 return false;
20347 }
20348
20349 throw error;
20350 });
20351 });
20352 },
20353
20354 /**
20355 * Get sessionToken of current user.
20356 * @return {String} sessionToken
20357 */
20358 getSessionToken: function getSessionToken() {
20359 return this._sessionToken;
20360 },
20361
20362 /**
20363 * Refresh sessionToken of current user.
20364 * @since 2.1.0
20365 * @param {AuthOptions} [options]
20366 * @return {Promise.<AV.User>} user with refreshed sessionToken
20367 */
20368 refreshSessionToken: function refreshSessionToken(options) {
20369 var _this14 = this;
20370
20371 return AVRequest("users/".concat(this.id, "/refreshSessionToken"), null, null, 'PUT', null, options).then(function (response) {
20372 _this14._finishFetch(response);
20373
20374 return _this14._handleSaveResult(true).then(function () {
20375 return _this14;
20376 });
20377 });
20378 },
20379
20380 /**
20381 * Get this user's Roles.
20382 * @param {AuthOptions} [options]
20383 * @return {Promise.<AV.Role[]>} A promise that is fulfilled with the roles when
20384 * the query is complete.
20385 */
20386 getRoles: function getRoles(options) {
20387 var _context;
20388
20389 return (0, _find.default)(_context = AV.Relation.reverseQuery('_Role', 'users', this)).call(_context, options);
20390 }
20391 },
20392 /** @lends AV.User */
20393 {
20394 // Class Variables
20395 // The currently logged-in user.
20396 _currentUser: null,
20397 // Whether currentUser is known to match the serialized version on disk.
20398 // This is useful for saving a localstorage check if you try to load
20399 // _currentUser frequently while there is none stored.
20400 _currentUserMatchesDisk: false,
20401 // The localStorage key suffix that the current user is stored under.
20402 _CURRENT_USER_KEY: 'currentUser',
20403 // The mapping of auth provider names to actual providers
20404 _authProviders: {},
20405 // Class Methods
20406
20407 /**
20408 * Signs up a new user with a username (or email) and password.
20409 * This will create a new AV.User on the server, and also persist the
20410 * session in localStorage so that you can access the user using
20411 * {@link #current}.
20412 *
20413 * @param {String} username The username (or email) to sign up with.
20414 * @param {String} password The password to sign up with.
20415 * @param {Object} [attrs] Extra fields to set on the new user.
20416 * @param {AuthOptions} [options]
20417 * @return {Promise} A promise that is fulfilled with the user when
20418 * the signup completes.
20419 * @see AV.User#signUp
20420 */
20421 signUp: function signUp(username, password, attrs, options) {
20422 attrs = attrs || {};
20423 attrs.username = username;
20424 attrs.password = password;
20425
20426 var user = AV.Object._create('_User');
20427
20428 return user.signUp(attrs, options);
20429 },
20430
20431 /**
20432 * Logs in a user with a username (or email) and password. On success, this
20433 * saves the session to disk, so you can retrieve the currently logged in
20434 * user using <code>current</code>.
20435 *
20436 * @param {String} username The username (or email) to log in with.
20437 * @param {String} password The password to log in with.
20438 * @return {Promise} A promise that is fulfilled with the user when
20439 * the login completes.
20440 * @see AV.User#logIn
20441 */
20442 logIn: function logIn(username, password) {
20443 var user = AV.Object._create('_User');
20444
20445 user._finishFetch({
20446 username: username,
20447 password: password
20448 });
20449
20450 return user.logIn();
20451 },
20452
20453 /**
20454 * Logs in a user with a session token. On success, this saves the session
20455 * to disk, so you can retrieve the currently logged in user using
20456 * <code>current</code>.
20457 *
20458 * @param {String} sessionToken The sessionToken to log in with.
20459 * @return {Promise} A promise that is fulfilled with the user when
20460 * the login completes.
20461 */
20462 become: function become(sessionToken) {
20463 return this._fetchUserBySessionToken(sessionToken).then(function (user) {
20464 return user._handleSaveResult(true).then(function () {
20465 return user;
20466 });
20467 });
20468 },
20469 _fetchUserBySessionToken: function _fetchUserBySessionToken(sessionToken) {
20470 if (sessionToken === undefined) {
20471 return _promise.default.reject(new Error('The sessionToken cannot be undefined'));
20472 }
20473
20474 var user = AV.Object._create('_User');
20475
20476 return request({
20477 method: 'GET',
20478 path: '/users/me',
20479 authOptions: {
20480 sessionToken: sessionToken
20481 }
20482 }).then(function (resp) {
20483 var serverAttrs = user.parse(resp);
20484
20485 user._finishFetch(serverAttrs);
20486
20487 return user;
20488 });
20489 },
20490
20491 /**
20492 * Logs in a user with a mobile phone number and sms code sent by
20493 * AV.User.requestLoginSmsCode.On success, this
20494 * saves the session to disk, so you can retrieve the currently logged in
20495 * user using <code>current</code>.
20496 *
20497 * @param {String} mobilePhone The user's mobilePhoneNumber
20498 * @param {String} smsCode The sms code sent by AV.User.requestLoginSmsCode
20499 * @return {Promise} A promise that is fulfilled with the user when
20500 * the login completes.
20501 * @see AV.User#logIn
20502 */
20503 logInWithMobilePhoneSmsCode: function logInWithMobilePhoneSmsCode(mobilePhone, smsCode) {
20504 var user = AV.Object._create('_User');
20505
20506 user._finishFetch({
20507 mobilePhoneNumber: mobilePhone,
20508 smsCode: smsCode
20509 });
20510
20511 return user.logIn();
20512 },
20513
20514 /**
20515 * Signs up or logs in a user with a mobilePhoneNumber and smsCode.
20516 * On success, this saves the session to disk, so you can retrieve the currently
20517 * logged in user using <code>current</code>.
20518 *
20519 * @param {String} mobilePhoneNumber The user's mobilePhoneNumber.
20520 * @param {String} smsCode The sms code sent by AV.Cloud.requestSmsCode
20521 * @param {Object} attributes The user's other attributes such as username etc.
20522 * @param {AuthOptions} options
20523 * @return {Promise} A promise that is fulfilled with the user when
20524 * the login completes.
20525 * @see AV.User#signUpOrlogInWithMobilePhone
20526 * @see AV.Cloud.requestSmsCode
20527 */
20528 signUpOrlogInWithMobilePhone: function signUpOrlogInWithMobilePhone(mobilePhoneNumber, smsCode, attrs, options) {
20529 attrs = attrs || {};
20530 attrs.mobilePhoneNumber = mobilePhoneNumber;
20531 attrs.smsCode = smsCode;
20532
20533 var user = AV.Object._create('_User');
20534
20535 return user.signUpOrlogInWithMobilePhone(attrs, options);
20536 },
20537
20538 /**
20539 * Logs in a user with a mobile phone number and password. On success, this
20540 * saves the session to disk, so you can retrieve the currently logged in
20541 * user using <code>current</code>.
20542 *
20543 * @param {String} mobilePhone The user's mobilePhoneNumber
20544 * @param {String} password The password to log in with.
20545 * @return {Promise} A promise that is fulfilled with the user when
20546 * the login completes.
20547 * @see AV.User#logIn
20548 */
20549 logInWithMobilePhone: function logInWithMobilePhone(mobilePhone, password) {
20550 var user = AV.Object._create('_User');
20551
20552 user._finishFetch({
20553 mobilePhoneNumber: mobilePhone,
20554 password: password
20555 });
20556
20557 return user.logIn();
20558 },
20559
20560 /**
20561 * Logs in a user with email and password.
20562 *
20563 * @since 3.13.0
20564 * @param {String} email The user's email.
20565 * @param {String} password The password to log in with.
20566 * @return {Promise} A promise that is fulfilled with the user when
20567 * the login completes.
20568 */
20569 loginWithEmail: function loginWithEmail(email, password) {
20570 var user = AV.Object._create('_User');
20571
20572 user._finishFetch({
20573 email: email,
20574 password: password
20575 });
20576
20577 return user.logIn();
20578 },
20579
20580 /**
20581 * Signs up or logs in a user with a third party auth data(AccessToken).
20582 * On success, this saves the session to disk, so you can retrieve the currently
20583 * logged in user using <code>current</code>.
20584 *
20585 * @since 3.7.0
20586 * @param {Object} authData The response json data returned from third party token, maybe like { openid: 'abc123', access_token: '123abc', expires_in: 1382686496 }
20587 * @param {string} platform Available platform for sign up.
20588 * @param {Object} [options]
20589 * @param {boolean} [options.failOnNotExist] If true, the login request will fail when no user matches this authData exists.
20590 * @return {Promise} A promise that is fulfilled with the user when
20591 * the login completes.
20592 * @example AV.User.loginWithAuthData({
20593 * openid: 'abc123',
20594 * access_token: '123abc',
20595 * expires_in: 1382686496
20596 * }, 'weixin').then(function(user) {
20597 * //Access user here
20598 * }).catch(function(error) {
20599 * //console.error("error: ", error);
20600 * });
20601 * @see {@link https://leancloud.cn/docs/js_guide.html#绑定第三方平台账户}
20602 */
20603 loginWithAuthData: function loginWithAuthData(authData, platform, options) {
20604 return AV.User._logInWith(platform, authData, options);
20605 },
20606
20607 /**
20608 * @deprecated renamed to {@link AV.User.loginWithAuthData}
20609 */
20610 signUpOrlogInWithAuthData: function signUpOrlogInWithAuthData() {
20611 console.warn('DEPRECATED: User.signUpOrlogInWithAuthData 已废弃,请使用 User#loginWithAuthData 代替');
20612 return this.loginWithAuthData.apply(this, arguments);
20613 },
20614
20615 /**
20616 * Signs up or logs in a user with a third party authData and unionId.
20617 * @since 3.7.0
20618 * @param {Object} authData The response json data returned from third party token, maybe like { openid: 'abc123', access_token: '123abc', expires_in: 1382686496 }
20619 * @param {string} platform Available platform for sign up.
20620 * @param {string} unionId
20621 * @param {Object} [unionLoginOptions]
20622 * @param {string} [unionLoginOptions.unionIdPlatform = 'weixin'] unionId platform
20623 * @param {boolean} [unionLoginOptions.asMainAccount = false] If true, the unionId will be associated with the user.
20624 * @param {boolean} [unionLoginOptions.failOnNotExist] If true, the login request will fail when no user matches this authData exists.
20625 * @return {Promise<AV.User>} A promise that is fulfilled with the user when completed.
20626 * @example AV.User.loginWithAuthDataAndUnionId({
20627 * openid: 'abc123',
20628 * access_token: '123abc',
20629 * expires_in: 1382686496
20630 * }, 'weixin', 'union123', {
20631 * unionIdPlatform: 'weixin',
20632 * asMainAccount: true,
20633 * }).then(function(user) {
20634 * //Access user here
20635 * }).catch(function(error) {
20636 * //console.error("error: ", error);
20637 * });
20638 */
20639 loginWithAuthDataAndUnionId: function loginWithAuthDataAndUnionId(authData, platform, unionId, unionLoginOptions) {
20640 return this.loginWithAuthData(mergeUnionDataIntoAuthData()(authData, unionId, unionLoginOptions), platform, unionLoginOptions);
20641 },
20642
20643 /**
20644 * @deprecated renamed to {@link AV.User.loginWithAuthDataAndUnionId}
20645 * @since 3.5.0
20646 */
20647 signUpOrlogInWithAuthDataAndUnionId: function signUpOrlogInWithAuthDataAndUnionId() {
20648 console.warn('DEPRECATED: User.signUpOrlogInWithAuthDataAndUnionId 已废弃,请使用 User#loginWithAuthDataAndUnionId 代替');
20649 return this.loginWithAuthDataAndUnionId.apply(this, arguments);
20650 },
20651
20652 /**
20653 * Merge unionId into authInfo.
20654 * @since 4.6.0
20655 * @param {Object} authInfo
20656 * @param {String} unionId
20657 * @param {Object} [unionIdOption]
20658 * @param {Boolean} [unionIdOption.asMainAccount] If true, the unionId will be associated with the user.
20659 */
20660 mergeUnionId: function mergeUnionId(authInfo, unionId) {
20661 var _ref14 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
20662 _ref14$asMainAccount = _ref14.asMainAccount,
20663 asMainAccount = _ref14$asMainAccount === void 0 ? false : _ref14$asMainAccount;
20664
20665 authInfo = JSON.parse((0, _stringify.default)(authInfo));
20666 var _authInfo = authInfo,
20667 authData = _authInfo.authData,
20668 platform = _authInfo.platform;
20669 authData.platform = platform;
20670 authData.main_account = asMainAccount;
20671 authData.unionid = unionId;
20672 return authInfo;
20673 },
20674
20675 /**
20676 * 使用当前使用微信小程序的微信用户身份注册或登录,成功后用户的 session 会在设备上持久化保存,之后可以使用 AV.User.current() 获取当前登录用户。
20677 * 仅在微信小程序中可用。
20678 *
20679 * @deprecated please use {@link AV.User.loginWithMiniApp}
20680 * @since 2.0.0
20681 * @param {Object} [options]
20682 * @param {boolean} [options.preferUnionId] 当用户满足 {@link https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/union-id.html 获取 UnionId 的条件} 时,是否使用 UnionId 登录。(since 3.13.0)
20683 * @param {string} [options.unionIdPlatform = 'weixin'] (only take effect when preferUnionId) unionId platform
20684 * @param {boolean} [options.asMainAccount = true] (only take effect when preferUnionId) If true, the unionId will be associated with the user.
20685 * @param {boolean} [options.failOnNotExist] If true, the login request will fail when no user matches this authData exists. (since v3.7.0)
20686 * @return {Promise.<AV.User>}
20687 */
20688 loginWithWeapp: function loginWithWeapp() {
20689 var _this15 = this;
20690
20691 var _ref15 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
20692 _ref15$preferUnionId = _ref15.preferUnionId,
20693 preferUnionId = _ref15$preferUnionId === void 0 ? false : _ref15$preferUnionId,
20694 _ref15$unionIdPlatfor = _ref15.unionIdPlatform,
20695 unionIdPlatform = _ref15$unionIdPlatfor === void 0 ? 'weixin' : _ref15$unionIdPlatfor,
20696 _ref15$asMainAccount = _ref15.asMainAccount,
20697 asMainAccount = _ref15$asMainAccount === void 0 ? true : _ref15$asMainAccount,
20698 _ref15$failOnNotExist = _ref15.failOnNotExist,
20699 failOnNotExist = _ref15$failOnNotExist === void 0 ? false : _ref15$failOnNotExist;
20700
20701 var getAuthInfo = getAdapter('getAuthInfo');
20702 return getAuthInfo({
20703 preferUnionId: preferUnionId,
20704 asMainAccount: asMainAccount,
20705 platform: unionIdPlatform
20706 }).then(function (authInfo) {
20707 return _this15.loginWithMiniApp(authInfo, {
20708 failOnNotExist: failOnNotExist
20709 });
20710 });
20711 },
20712
20713 /**
20714 * 使用当前使用微信小程序的微信用户身份注册或登录,
20715 * 仅在微信小程序中可用。
20716 *
20717 * @deprecated please use {@link AV.User.loginWithMiniApp}
20718 * @since 3.13.0
20719 * @param {Object} [unionLoginOptions]
20720 * @param {string} [unionLoginOptions.unionIdPlatform = 'weixin'] unionId platform
20721 * @param {boolean} [unionLoginOptions.asMainAccount = false] If true, the unionId will be associated with the user.
20722 * @param {boolean} [unionLoginOptions.failOnNotExist] If true, the login request will fail when no user matches this authData exists. * @return {Promise.<AV.User>}
20723 */
20724 loginWithWeappWithUnionId: function loginWithWeappWithUnionId(unionId) {
20725 var _this16 = this;
20726
20727 var _ref16 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
20728 _ref16$unionIdPlatfor = _ref16.unionIdPlatform,
20729 unionIdPlatform = _ref16$unionIdPlatfor === void 0 ? 'weixin' : _ref16$unionIdPlatfor,
20730 _ref16$asMainAccount = _ref16.asMainAccount,
20731 asMainAccount = _ref16$asMainAccount === void 0 ? false : _ref16$asMainAccount,
20732 _ref16$failOnNotExist = _ref16.failOnNotExist,
20733 failOnNotExist = _ref16$failOnNotExist === void 0 ? false : _ref16$failOnNotExist;
20734
20735 var getAuthInfo = getAdapter('getAuthInfo');
20736 return getAuthInfo({
20737 platform: unionIdPlatform
20738 }).then(function (authInfo) {
20739 authInfo = AV.User.mergeUnionId(authInfo, unionId, {
20740 asMainAccount: asMainAccount
20741 });
20742 return _this16.loginWithMiniApp(authInfo, {
20743 failOnNotExist: failOnNotExist
20744 });
20745 });
20746 },
20747
20748 /**
20749 * 使用当前使用 QQ 小程序的 QQ 用户身份注册或登录,成功后用户的 session 会在设备上持久化保存,之后可以使用 AV.User.current() 获取当前登录用户。
20750 * 仅在 QQ 小程序中可用。
20751 *
20752 * @deprecated please use {@link AV.User.loginWithMiniApp}
20753 * @since 4.2.0
20754 * @param {Object} [options]
20755 * @param {boolean} [options.preferUnionId] 如果服务端在登录时获取到了用户的 UnionId,是否将 UnionId 保存在用户账号中。
20756 * @param {string} [options.unionIdPlatform = 'qq'] (only take effect when preferUnionId) unionId platform
20757 * @param {boolean} [options.asMainAccount = true] (only take effect when preferUnionId) If true, the unionId will be associated with the user.
20758 * @param {boolean} [options.failOnNotExist] If true, the login request will fail when no user matches this authData exists. (since v3.7.0)
20759 * @return {Promise.<AV.User>}
20760 */
20761 loginWithQQApp: function loginWithQQApp() {
20762 var _this17 = this;
20763
20764 var _ref17 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
20765 _ref17$preferUnionId = _ref17.preferUnionId,
20766 preferUnionId = _ref17$preferUnionId === void 0 ? false : _ref17$preferUnionId,
20767 _ref17$unionIdPlatfor = _ref17.unionIdPlatform,
20768 unionIdPlatform = _ref17$unionIdPlatfor === void 0 ? 'qq' : _ref17$unionIdPlatfor,
20769 _ref17$asMainAccount = _ref17.asMainAccount,
20770 asMainAccount = _ref17$asMainAccount === void 0 ? true : _ref17$asMainAccount,
20771 _ref17$failOnNotExist = _ref17.failOnNotExist,
20772 failOnNotExist = _ref17$failOnNotExist === void 0 ? false : _ref17$failOnNotExist;
20773
20774 var getAuthInfo = getAdapter('getAuthInfo');
20775 return getAuthInfo({
20776 preferUnionId: preferUnionId,
20777 asMainAccount: asMainAccount,
20778 platform: unionIdPlatform
20779 }).then(function (authInfo) {
20780 authInfo.provider = PLATFORM_QQAPP;
20781 return _this17.loginWithMiniApp(authInfo, {
20782 failOnNotExist: failOnNotExist
20783 });
20784 });
20785 },
20786
20787 /**
20788 * 使用当前使用 QQ 小程序的 QQ 用户身份注册或登录,
20789 * 仅在 QQ 小程序中可用。
20790 *
20791 * @deprecated please use {@link AV.User.loginWithMiniApp}
20792 * @since 4.2.0
20793 * @param {Object} [unionLoginOptions]
20794 * @param {string} [unionLoginOptions.unionIdPlatform = 'qq'] unionId platform
20795 * @param {boolean} [unionLoginOptions.asMainAccount = false] If true, the unionId will be associated with the user.
20796 * @param {boolean} [unionLoginOptions.failOnNotExist] If true, the login request will fail when no user matches this authData exists.
20797 * @return {Promise.<AV.User>}
20798 */
20799 loginWithQQAppWithUnionId: function loginWithQQAppWithUnionId(unionId) {
20800 var _this18 = this;
20801
20802 var _ref18 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
20803 _ref18$unionIdPlatfor = _ref18.unionIdPlatform,
20804 unionIdPlatform = _ref18$unionIdPlatfor === void 0 ? 'qq' : _ref18$unionIdPlatfor,
20805 _ref18$asMainAccount = _ref18.asMainAccount,
20806 asMainAccount = _ref18$asMainAccount === void 0 ? false : _ref18$asMainAccount,
20807 _ref18$failOnNotExist = _ref18.failOnNotExist,
20808 failOnNotExist = _ref18$failOnNotExist === void 0 ? false : _ref18$failOnNotExist;
20809
20810 var getAuthInfo = getAdapter('getAuthInfo');
20811 return getAuthInfo({
20812 platform: unionIdPlatform
20813 }).then(function (authInfo) {
20814 authInfo = AV.User.mergeUnionId(authInfo, unionId, {
20815 asMainAccount: asMainAccount
20816 });
20817 authInfo.provider = PLATFORM_QQAPP;
20818 return _this18.loginWithMiniApp(authInfo, {
20819 failOnNotExist: failOnNotExist
20820 });
20821 });
20822 },
20823
20824 /**
20825 * Register or login using the identity of the current mini-app.
20826 * @param {Object} authInfo
20827 * @param {Object} [option]
20828 * @param {Boolean} [option.failOnNotExist] If true, the login request will fail when no user matches this authInfo.authData exists.
20829 */
20830 loginWithMiniApp: function loginWithMiniApp(authInfo, option) {
20831 var _this19 = this;
20832
20833 if (authInfo === undefined) {
20834 var getAuthInfo = getAdapter('getAuthInfo');
20835 return getAuthInfo().then(function (authInfo) {
20836 return _this19.loginWithAuthData(authInfo.authData, authInfo.provider, option);
20837 });
20838 }
20839
20840 return this.loginWithAuthData(authInfo.authData, authInfo.provider, option);
20841 },
20842
20843 /**
20844 * Only use for DI in tests to produce deterministic IDs.
20845 */
20846 _genId: function _genId() {
20847 return uuid();
20848 },
20849
20850 /**
20851 * Creates an anonymous user.
20852 *
20853 * @since 3.9.0
20854 * @return {Promise.<AV.User>}
20855 */
20856 loginAnonymously: function loginAnonymously() {
20857 return this.loginWithAuthData({
20858 id: AV.User._genId()
20859 }, 'anonymous');
20860 },
20861 associateWithAuthData: function associateWithAuthData(userObj, platform, authData) {
20862 console.warn('DEPRECATED: User.associateWithAuthData 已废弃,请使用 User#associateWithAuthData 代替');
20863 return userObj._linkWith(platform, authData);
20864 },
20865
20866 /**
20867 * Logs out the currently logged in user session. This will remove the
20868 * session from disk, log out of linked services, and future calls to
20869 * <code>current</code> will return <code>null</code>.
20870 * @return {Promise}
20871 */
20872 logOut: function logOut() {
20873 if (AV._config.disableCurrentUser) {
20874 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');
20875 return _promise.default.resolve(null);
20876 }
20877
20878 if (AV.User._currentUser !== null) {
20879 AV.User._currentUser._logOutWithAll();
20880
20881 AV.User._currentUser._isCurrentUser = false;
20882 }
20883
20884 AV.User._currentUserMatchesDisk = true;
20885 AV.User._currentUser = null;
20886 return AV.localStorage.removeItemAsync(AV._getAVPath(AV.User._CURRENT_USER_KEY)).then(function () {
20887 return AV._refreshSubscriptionId();
20888 });
20889 },
20890
20891 /**
20892 *Create a follower query for special user to query the user's followers.
20893 * @param {String} userObjectId The user object id.
20894 * @return {AV.FriendShipQuery}
20895 * @since 0.3.0
20896 */
20897 followerQuery: function followerQuery(userObjectId) {
20898 if (!userObjectId || !_.isString(userObjectId)) {
20899 throw new Error('Invalid user object id.');
20900 }
20901
20902 var query = new AV.FriendShipQuery('_Follower');
20903 query._friendshipTag = 'follower';
20904 query.equalTo('user', AV.Object.createWithoutData('_User', userObjectId));
20905 return query;
20906 },
20907
20908 /**
20909 *Create a followee query for special user to query the user's followees.
20910 * @param {String} userObjectId The user object id.
20911 * @return {AV.FriendShipQuery}
20912 * @since 0.3.0
20913 */
20914 followeeQuery: function followeeQuery(userObjectId) {
20915 if (!userObjectId || !_.isString(userObjectId)) {
20916 throw new Error('Invalid user object id.');
20917 }
20918
20919 var query = new AV.FriendShipQuery('_Followee');
20920 query._friendshipTag = 'followee';
20921 query.equalTo('user', AV.Object.createWithoutData('_User', userObjectId));
20922 return query;
20923 },
20924
20925 /**
20926 * Requests a password reset email to be sent to the specified email address
20927 * associated with the user account. This email allows the user to securely
20928 * reset their password on the AV site.
20929 *
20930 * @param {String} email The email address associated with the user that
20931 * forgot their password.
20932 * @return {Promise}
20933 */
20934 requestPasswordReset: function requestPasswordReset(email) {
20935 var json = {
20936 email: email
20937 };
20938 var request = AVRequest('requestPasswordReset', null, null, 'POST', json);
20939 return request;
20940 },
20941
20942 /**
20943 * Requests a verify email to be sent to the specified email address
20944 * associated with the user account. This email allows the user to securely
20945 * verify their email address on the AV site.
20946 *
20947 * @param {String} email The email address associated with the user that
20948 * doesn't verify their email address.
20949 * @return {Promise}
20950 */
20951 requestEmailVerify: function requestEmailVerify(email) {
20952 var json = {
20953 email: email
20954 };
20955 var request = AVRequest('requestEmailVerify', null, null, 'POST', json);
20956 return request;
20957 },
20958
20959 /**
20960 * Requests a verify sms code to be sent to the specified mobile phone
20961 * number associated with the user account. This sms code allows the user to
20962 * verify their mobile phone number by calling AV.User.verifyMobilePhone
20963 *
20964 * @param {String} mobilePhoneNumber The mobile phone number associated with the
20965 * user that doesn't verify their mobile phone number.
20966 * @param {SMSAuthOptions} [options]
20967 * @return {Promise}
20968 */
20969 requestMobilePhoneVerify: function requestMobilePhoneVerify(mobilePhoneNumber) {
20970 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
20971 var data = {
20972 mobilePhoneNumber: mobilePhoneNumber
20973 };
20974
20975 if (options.validateToken) {
20976 data.validate_token = options.validateToken;
20977 }
20978
20979 var request = AVRequest('requestMobilePhoneVerify', null, null, 'POST', data, options);
20980 return request;
20981 },
20982
20983 /**
20984 * Requests a reset password sms code to be sent to the specified mobile phone
20985 * number associated with the user account. This sms code allows the user to
20986 * reset their account's password by calling AV.User.resetPasswordBySmsCode
20987 *
20988 * @param {String} mobilePhoneNumber The mobile phone number associated with the
20989 * user that doesn't verify their mobile phone number.
20990 * @param {SMSAuthOptions} [options]
20991 * @return {Promise}
20992 */
20993 requestPasswordResetBySmsCode: function requestPasswordResetBySmsCode(mobilePhoneNumber) {
20994 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
20995 var data = {
20996 mobilePhoneNumber: mobilePhoneNumber
20997 };
20998
20999 if (options.validateToken) {
21000 data.validate_token = options.validateToken;
21001 }
21002
21003 var request = AVRequest('requestPasswordResetBySmsCode', null, null, 'POST', data, options);
21004 return request;
21005 },
21006
21007 /**
21008 * Requests a change mobile phone number sms code to be sent to the mobilePhoneNumber.
21009 * This sms code allows current user to reset it's mobilePhoneNumber by
21010 * calling {@link AV.User.changePhoneNumber}
21011 * @since 4.7.0
21012 * @param {String} mobilePhoneNumber
21013 * @param {Number} [ttl] ttl of sms code (default is 6 minutes)
21014 * @param {SMSAuthOptions} [options]
21015 * @return {Promise}
21016 */
21017 requestChangePhoneNumber: function requestChangePhoneNumber(mobilePhoneNumber, ttl, options) {
21018 var data = {
21019 mobilePhoneNumber: mobilePhoneNumber
21020 };
21021
21022 if (ttl) {
21023 data.ttl = options.ttl;
21024 }
21025
21026 if (options && options.validateToken) {
21027 data.validate_token = options.validateToken;
21028 }
21029
21030 return AVRequest('requestChangePhoneNumber', null, null, 'POST', data, options);
21031 },
21032
21033 /**
21034 * Makes a call to reset user's account mobilePhoneNumber by sms code.
21035 * The sms code is sent by {@link AV.User.requestChangePhoneNumber}
21036 * @since 4.7.0
21037 * @param {String} mobilePhoneNumber
21038 * @param {String} code The sms code.
21039 * @return {Promise}
21040 */
21041 changePhoneNumber: function changePhoneNumber(mobilePhoneNumber, code) {
21042 var data = {
21043 mobilePhoneNumber: mobilePhoneNumber,
21044 code: code
21045 };
21046 return AVRequest('changePhoneNumber', null, null, 'POST', data);
21047 },
21048
21049 /**
21050 * Makes a call to reset user's account password by sms code and new password.
21051 * The sms code is sent by AV.User.requestPasswordResetBySmsCode.
21052 * @param {String} code The sms code sent by AV.User.Cloud.requestSmsCode
21053 * @param {String} password The new password.
21054 * @return {Promise} A promise that will be resolved with the result
21055 * of the function.
21056 */
21057 resetPasswordBySmsCode: function resetPasswordBySmsCode(code, password) {
21058 var json = {
21059 password: password
21060 };
21061 var request = AVRequest('resetPasswordBySmsCode', null, code, 'PUT', json);
21062 return request;
21063 },
21064
21065 /**
21066 * Makes a call to verify sms code that sent by AV.User.Cloud.requestSmsCode
21067 * If verify successfully,the user mobilePhoneVerified attribute will be true.
21068 * @param {String} code The sms code sent by AV.User.Cloud.requestSmsCode
21069 * @return {Promise} A promise that will be resolved with the result
21070 * of the function.
21071 */
21072 verifyMobilePhone: function verifyMobilePhone(code) {
21073 var request = AVRequest('verifyMobilePhone', null, code, 'POST', null);
21074 return request;
21075 },
21076
21077 /**
21078 * Requests a logIn sms code to be sent to the specified mobile phone
21079 * number associated with the user account. This sms code allows the user to
21080 * login by AV.User.logInWithMobilePhoneSmsCode function.
21081 *
21082 * @param {String} mobilePhoneNumber The mobile phone number associated with the
21083 * user that want to login by AV.User.logInWithMobilePhoneSmsCode
21084 * @param {SMSAuthOptions} [options]
21085 * @return {Promise}
21086 */
21087 requestLoginSmsCode: function requestLoginSmsCode(mobilePhoneNumber) {
21088 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
21089 var data = {
21090 mobilePhoneNumber: mobilePhoneNumber
21091 };
21092
21093 if (options.validateToken) {
21094 data.validate_token = options.validateToken;
21095 }
21096
21097 var request = AVRequest('requestLoginSmsCode', null, null, 'POST', data, options);
21098 return request;
21099 },
21100
21101 /**
21102 * Retrieves the currently logged in AVUser with a valid session,
21103 * either from memory or localStorage, if necessary.
21104 * @return {Promise.<AV.User>} resolved with the currently logged in AV.User.
21105 */
21106 currentAsync: function currentAsync() {
21107 if (AV._config.disableCurrentUser) {
21108 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');
21109 return _promise.default.resolve(null);
21110 }
21111
21112 if (AV.User._currentUser) {
21113 return _promise.default.resolve(AV.User._currentUser);
21114 }
21115
21116 if (AV.User._currentUserMatchesDisk) {
21117 return _promise.default.resolve(AV.User._currentUser);
21118 }
21119
21120 return AV.localStorage.getItemAsync(AV._getAVPath(AV.User._CURRENT_USER_KEY)).then(function (userData) {
21121 if (!userData) {
21122 return null;
21123 } // Load the user from local storage.
21124
21125
21126 AV.User._currentUserMatchesDisk = true;
21127 AV.User._currentUser = AV.Object._create('_User');
21128 AV.User._currentUser._isCurrentUser = true;
21129 var json = JSON.parse(userData);
21130 AV.User._currentUser.id = json._id;
21131 delete json._id;
21132 AV.User._currentUser._sessionToken = json._sessionToken;
21133 delete json._sessionToken;
21134
21135 AV.User._currentUser._finishFetch(json); //AV.User._currentUser.set(json);
21136
21137
21138 AV.User._currentUser._synchronizeAllAuthData();
21139
21140 AV.User._currentUser._refreshCache();
21141
21142 AV.User._currentUser._opSetQueue = [{}];
21143 return AV.User._currentUser;
21144 });
21145 },
21146
21147 /**
21148 * Retrieves the currently logged in AVUser with a valid session,
21149 * either from memory or localStorage, if necessary.
21150 * @return {AV.User} The currently logged in AV.User.
21151 */
21152 current: function current() {
21153 if (AV._config.disableCurrentUser) {
21154 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');
21155 return null;
21156 }
21157
21158 if (AV.localStorage.async) {
21159 var error = new Error('Synchronous API User.current() is not available in this runtime. Use User.currentAsync() instead.');
21160 error.code = 'SYNC_API_NOT_AVAILABLE';
21161 throw error;
21162 }
21163
21164 if (AV.User._currentUser) {
21165 return AV.User._currentUser;
21166 }
21167
21168 if (AV.User._currentUserMatchesDisk) {
21169 return AV.User._currentUser;
21170 } // Load the user from local storage.
21171
21172
21173 AV.User._currentUserMatchesDisk = true;
21174 var userData = AV.localStorage.getItem(AV._getAVPath(AV.User._CURRENT_USER_KEY));
21175
21176 if (!userData) {
21177 return null;
21178 }
21179
21180 AV.User._currentUser = AV.Object._create('_User');
21181 AV.User._currentUser._isCurrentUser = true;
21182 var json = JSON.parse(userData);
21183 AV.User._currentUser.id = json._id;
21184 delete json._id;
21185 AV.User._currentUser._sessionToken = json._sessionToken;
21186 delete json._sessionToken;
21187
21188 AV.User._currentUser._finishFetch(json); //AV.User._currentUser.set(json);
21189
21190
21191 AV.User._currentUser._synchronizeAllAuthData();
21192
21193 AV.User._currentUser._refreshCache();
21194
21195 AV.User._currentUser._opSetQueue = [{}];
21196 return AV.User._currentUser;
21197 },
21198
21199 /**
21200 * Persists a user as currentUser to localStorage, and into the singleton.
21201 * @private
21202 */
21203 _saveCurrentUser: function _saveCurrentUser(user) {
21204 var promise;
21205
21206 if (AV.User._currentUser !== user) {
21207 promise = AV.User.logOut();
21208 } else {
21209 promise = _promise.default.resolve();
21210 }
21211
21212 return promise.then(function () {
21213 user._isCurrentUser = true;
21214 AV.User._currentUser = user;
21215
21216 var json = user._toFullJSON();
21217
21218 json._id = user.id;
21219 json._sessionToken = user._sessionToken;
21220 return AV.localStorage.setItemAsync(AV._getAVPath(AV.User._CURRENT_USER_KEY), (0, _stringify.default)(json)).then(function () {
21221 AV.User._currentUserMatchesDisk = true;
21222 return AV._refreshSubscriptionId();
21223 });
21224 });
21225 },
21226 _registerAuthenticationProvider: function _registerAuthenticationProvider(provider) {
21227 AV.User._authProviders[provider.getAuthType()] = provider; // Synchronize the current user with the auth provider.
21228
21229 if (!AV._config.disableCurrentUser && AV.User.current()) {
21230 AV.User.current()._synchronizeAuthData(provider.getAuthType());
21231 }
21232 },
21233 _logInWith: function _logInWith(provider, authData, options) {
21234 var user = AV.Object._create('_User');
21235
21236 return user._linkWith(provider, authData, options);
21237 }
21238 });
21239};
21240
21241/***/ }),
21242/* 528 */
21243/***/ (function(module, exports, __webpack_require__) {
21244
21245var _Object$defineProperty = __webpack_require__(137);
21246
21247function _defineProperty(obj, key, value) {
21248 if (key in obj) {
21249 _Object$defineProperty(obj, key, {
21250 value: value,
21251 enumerable: true,
21252 configurable: true,
21253 writable: true
21254 });
21255 } else {
21256 obj[key] = value;
21257 }
21258
21259 return obj;
21260}
21261
21262module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
21263
21264/***/ }),
21265/* 529 */
21266/***/ (function(module, exports, __webpack_require__) {
21267
21268"use strict";
21269
21270
21271var _interopRequireDefault = __webpack_require__(2);
21272
21273var _map = _interopRequireDefault(__webpack_require__(39));
21274
21275var _promise = _interopRequireDefault(__webpack_require__(12));
21276
21277var _keys = _interopRequireDefault(__webpack_require__(48));
21278
21279var _stringify = _interopRequireDefault(__webpack_require__(34));
21280
21281var _concat = _interopRequireDefault(__webpack_require__(29));
21282
21283var _find = _interopRequireDefault(__webpack_require__(104));
21284
21285var _ = __webpack_require__(1);
21286
21287var debug = __webpack_require__(60)('leancloud:query');
21288
21289var AVError = __webpack_require__(40);
21290
21291var _require = __webpack_require__(25),
21292 _request = _require._request,
21293 request = _require.request;
21294
21295var _require2 = __webpack_require__(28),
21296 ensureArray = _require2.ensureArray,
21297 transformFetchOptions = _require2.transformFetchOptions,
21298 continueWhile = _require2.continueWhile;
21299
21300var requires = function requires(value, message) {
21301 if (value === undefined) {
21302 throw new Error(message);
21303 }
21304}; // AV.Query is a way to create a list of AV.Objects.
21305
21306
21307module.exports = function (AV) {
21308 /**
21309 * Creates a new AV.Query for the given AV.Object subclass.
21310 * @param {Class|String} objectClass An instance of a subclass of AV.Object, or a AV className string.
21311 * @class
21312 *
21313 * <p>AV.Query defines a query that is used to fetch AV.Objects. The
21314 * most common use case is finding all objects that match a query through the
21315 * <code>find</code> method. For example, this sample code fetches all objects
21316 * of class <code>MyClass</code>. It calls a different function depending on
21317 * whether the fetch succeeded or not.
21318 *
21319 * <pre>
21320 * var query = new AV.Query(MyClass);
21321 * query.find().then(function(results) {
21322 * // results is an array of AV.Object.
21323 * }, function(error) {
21324 * // error is an instance of AVError.
21325 * });</pre></p>
21326 *
21327 * <p>An AV.Query can also be used to retrieve a single object whose id is
21328 * known, through the get method. For example, this sample code fetches an
21329 * object of class <code>MyClass</code> and id <code>myId</code>. It calls a
21330 * different function depending on whether the fetch succeeded or not.
21331 *
21332 * <pre>
21333 * var query = new AV.Query(MyClass);
21334 * query.get(myId).then(function(object) {
21335 * // object is an instance of AV.Object.
21336 * }, function(error) {
21337 * // error is an instance of AVError.
21338 * });</pre></p>
21339 *
21340 * <p>An AV.Query can also be used to count the number of objects that match
21341 * the query without retrieving all of those objects. For example, this
21342 * sample code counts the number of objects of the class <code>MyClass</code>
21343 * <pre>
21344 * var query = new AV.Query(MyClass);
21345 * query.count().then(function(number) {
21346 * // There are number instances of MyClass.
21347 * }, function(error) {
21348 * // error is an instance of AVError.
21349 * });</pre></p>
21350 */
21351 AV.Query = function (objectClass) {
21352 if (_.isString(objectClass)) {
21353 objectClass = AV.Object._getSubclass(objectClass);
21354 }
21355
21356 this.objectClass = objectClass;
21357 this.className = objectClass.prototype.className;
21358 this._where = {};
21359 this._include = [];
21360 this._select = [];
21361 this._limit = -1; // negative limit means, do not send a limit
21362
21363 this._skip = 0;
21364 this._defaultParams = {};
21365 };
21366 /**
21367 * Constructs a AV.Query that is the OR of the passed in queries. For
21368 * example:
21369 * <pre>var compoundQuery = AV.Query.or(query1, query2, query3);</pre>
21370 *
21371 * will create a compoundQuery that is an or of the query1, query2, and
21372 * query3.
21373 * @param {...AV.Query} var_args The list of queries to OR.
21374 * @return {AV.Query} The query that is the OR of the passed in queries.
21375 */
21376
21377
21378 AV.Query.or = function () {
21379 var queries = _.toArray(arguments);
21380
21381 var className = null;
21382
21383 AV._arrayEach(queries, function (q) {
21384 if (_.isNull(className)) {
21385 className = q.className;
21386 }
21387
21388 if (className !== q.className) {
21389 throw new Error('All queries must be for the same class');
21390 }
21391 });
21392
21393 var query = new AV.Query(className);
21394
21395 query._orQuery(queries);
21396
21397 return query;
21398 };
21399 /**
21400 * Constructs a AV.Query that is the AND of the passed in queries. For
21401 * example:
21402 * <pre>var compoundQuery = AV.Query.and(query1, query2, query3);</pre>
21403 *
21404 * will create a compoundQuery that is an 'and' of the query1, query2, and
21405 * query3.
21406 * @param {...AV.Query} var_args The list of queries to AND.
21407 * @return {AV.Query} The query that is the AND of the passed in queries.
21408 */
21409
21410
21411 AV.Query.and = function () {
21412 var queries = _.toArray(arguments);
21413
21414 var className = null;
21415
21416 AV._arrayEach(queries, function (q) {
21417 if (_.isNull(className)) {
21418 className = q.className;
21419 }
21420
21421 if (className !== q.className) {
21422 throw new Error('All queries must be for the same class');
21423 }
21424 });
21425
21426 var query = new AV.Query(className);
21427
21428 query._andQuery(queries);
21429
21430 return query;
21431 };
21432 /**
21433 * Retrieves a list of AVObjects that satisfy the CQL.
21434 * CQL syntax please see {@link https://leancloud.cn/docs/cql_guide.html CQL Guide}.
21435 *
21436 * @param {String} cql A CQL string, see {@link https://leancloud.cn/docs/cql_guide.html CQL Guide}.
21437 * @param {Array} pvalues An array contains placeholder values.
21438 * @param {AuthOptions} options
21439 * @return {Promise} A promise that is resolved with the results when
21440 * the query completes.
21441 */
21442
21443
21444 AV.Query.doCloudQuery = function (cql, pvalues, options) {
21445 var params = {
21446 cql: cql
21447 };
21448
21449 if (_.isArray(pvalues)) {
21450 params.pvalues = pvalues;
21451 } else {
21452 options = pvalues;
21453 }
21454
21455 var request = _request('cloudQuery', null, null, 'GET', params, options);
21456
21457 return request.then(function (response) {
21458 //query to process results.
21459 var query = new AV.Query(response.className);
21460 var results = (0, _map.default)(_).call(_, response.results, function (json) {
21461 var obj = query._newObject(response);
21462
21463 if (obj._finishFetch) {
21464 obj._finishFetch(query._processResult(json), true);
21465 }
21466
21467 return obj;
21468 });
21469 return {
21470 results: results,
21471 count: response.count,
21472 className: response.className
21473 };
21474 });
21475 };
21476 /**
21477 * Return a query with conditions from json.
21478 * This can be useful to send a query from server side to client side.
21479 * @since 4.0.0
21480 * @param {Object} json from {@link AV.Query#toJSON}
21481 * @return {AV.Query}
21482 */
21483
21484
21485 AV.Query.fromJSON = function (_ref) {
21486 var className = _ref.className,
21487 where = _ref.where,
21488 include = _ref.include,
21489 select = _ref.select,
21490 includeACL = _ref.includeACL,
21491 limit = _ref.limit,
21492 skip = _ref.skip,
21493 order = _ref.order;
21494
21495 if (typeof className !== 'string') {
21496 throw new TypeError('Invalid Query JSON, className must be a String.');
21497 }
21498
21499 var query = new AV.Query(className);
21500
21501 _.extend(query, {
21502 _where: where,
21503 _include: include,
21504 _select: select,
21505 _includeACL: includeACL,
21506 _limit: limit,
21507 _skip: skip,
21508 _order: order
21509 });
21510
21511 return query;
21512 };
21513
21514 AV.Query._extend = AV._extend;
21515
21516 _.extend(AV.Query.prototype,
21517 /** @lends AV.Query.prototype */
21518 {
21519 //hook to iterate result. Added by dennis<xzhuang@avoscloud.com>.
21520 _processResult: function _processResult(obj) {
21521 return obj;
21522 },
21523
21524 /**
21525 * Constructs an AV.Object whose id is already known by fetching data from
21526 * the server.
21527 *
21528 * @param {String} objectId The id of the object to be fetched.
21529 * @param {AuthOptions} options
21530 * @return {Promise.<AV.Object>}
21531 */
21532 get: function get(objectId, options) {
21533 if (!_.isString(objectId)) {
21534 throw new Error('objectId must be a string');
21535 }
21536
21537 if (objectId === '') {
21538 return _promise.default.reject(new AVError(AVError.OBJECT_NOT_FOUND, 'Object not found.'));
21539 }
21540
21541 var obj = this._newObject();
21542
21543 obj.id = objectId;
21544
21545 var queryJSON = this._getParams();
21546
21547 var fetchOptions = {};
21548 if ((0, _keys.default)(queryJSON)) fetchOptions.keys = (0, _keys.default)(queryJSON);
21549 if (queryJSON.include) fetchOptions.include = queryJSON.include;
21550 if (queryJSON.includeACL) fetchOptions.includeACL = queryJSON.includeACL;
21551 return _request('classes', this.className, objectId, 'GET', transformFetchOptions(fetchOptions), options).then(function (response) {
21552 if (_.isEmpty(response)) throw new AVError(AVError.OBJECT_NOT_FOUND, 'Object not found.');
21553
21554 obj._finishFetch(obj.parse(response), true);
21555
21556 return obj;
21557 });
21558 },
21559
21560 /**
21561 * Returns a JSON representation of this query.
21562 * @return {Object}
21563 */
21564 toJSON: function toJSON() {
21565 var className = this.className,
21566 where = this._where,
21567 include = this._include,
21568 select = this._select,
21569 includeACL = this._includeACL,
21570 limit = this._limit,
21571 skip = this._skip,
21572 order = this._order;
21573 return {
21574 className: className,
21575 where: where,
21576 include: include,
21577 select: select,
21578 includeACL: includeACL,
21579 limit: limit,
21580 skip: skip,
21581 order: order
21582 };
21583 },
21584 _getParams: function _getParams() {
21585 var params = _.extend({}, this._defaultParams, {
21586 where: this._where
21587 });
21588
21589 if (this._include.length > 0) {
21590 params.include = this._include.join(',');
21591 }
21592
21593 if (this._select.length > 0) {
21594 params.keys = this._select.join(',');
21595 }
21596
21597 if (this._includeACL !== undefined) {
21598 params.returnACL = this._includeACL;
21599 }
21600
21601 if (this._limit >= 0) {
21602 params.limit = this._limit;
21603 }
21604
21605 if (this._skip > 0) {
21606 params.skip = this._skip;
21607 }
21608
21609 if (this._order !== undefined) {
21610 params.order = this._order;
21611 }
21612
21613 return params;
21614 },
21615 _newObject: function _newObject(response) {
21616 var obj;
21617
21618 if (response && response.className) {
21619 obj = new AV.Object(response.className);
21620 } else {
21621 obj = new this.objectClass();
21622 }
21623
21624 return obj;
21625 },
21626 _createRequest: function _createRequest() {
21627 var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this._getParams();
21628 var options = arguments.length > 1 ? arguments[1] : undefined;
21629 var path = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "/classes/".concat(this.className);
21630
21631 if (encodeURIComponent((0, _stringify.default)(params)).length > 2000) {
21632 var body = {
21633 requests: [{
21634 method: 'GET',
21635 path: "/1.1".concat(path),
21636 params: params
21637 }]
21638 };
21639 return request({
21640 path: '/batch',
21641 method: 'POST',
21642 data: body,
21643 authOptions: options
21644 }).then(function (response) {
21645 var result = response[0];
21646
21647 if (result.success) {
21648 return result.success;
21649 }
21650
21651 var error = new AVError(result.error.code, result.error.error || 'Unknown batch error');
21652 throw error;
21653 });
21654 }
21655
21656 return request({
21657 method: 'GET',
21658 path: path,
21659 query: params,
21660 authOptions: options
21661 });
21662 },
21663 _parseResponse: function _parseResponse(response) {
21664 var _this = this;
21665
21666 return (0, _map.default)(_).call(_, response.results, function (json) {
21667 var obj = _this._newObject(response);
21668
21669 if (obj._finishFetch) {
21670 obj._finishFetch(_this._processResult(json), true);
21671 }
21672
21673 return obj;
21674 });
21675 },
21676
21677 /**
21678 * Retrieves a list of AVObjects that satisfy this query.
21679 *
21680 * @param {AuthOptions} options
21681 * @return {Promise} A promise that is resolved with the results when
21682 * the query completes.
21683 */
21684 find: function find(options) {
21685 var request = this._createRequest(undefined, options);
21686
21687 return request.then(this._parseResponse.bind(this));
21688 },
21689
21690 /**
21691 * Retrieves both AVObjects and total count.
21692 *
21693 * @since 4.12.0
21694 * @param {AuthOptions} options
21695 * @return {Promise} A tuple contains results and count.
21696 */
21697 findAndCount: function findAndCount(options) {
21698 var _this2 = this;
21699
21700 var params = this._getParams();
21701
21702 params.count = 1;
21703
21704 var request = this._createRequest(params, options);
21705
21706 return request.then(function (response) {
21707 return [_this2._parseResponse(response), response.count];
21708 });
21709 },
21710
21711 /**
21712 * scan a Query. masterKey required.
21713 *
21714 * @since 2.1.0
21715 * @param {object} [options]
21716 * @param {string} [options.orderedBy] specify the key to sort
21717 * @param {number} [options.batchSize] specify the batch size for each request
21718 * @param {AuthOptions} [authOptions]
21719 * @return {AsyncIterator.<AV.Object>}
21720 * @example const testIterator = {
21721 * [Symbol.asyncIterator]() {
21722 * return new Query('Test').scan(undefined, { useMasterKey: true });
21723 * },
21724 * };
21725 * for await (const test of testIterator) {
21726 * console.log(test.id);
21727 * }
21728 */
21729 scan: function scan() {
21730 var _this3 = this;
21731
21732 var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
21733 orderedBy = _ref2.orderedBy,
21734 batchSize = _ref2.batchSize;
21735
21736 var authOptions = arguments.length > 1 ? arguments[1] : undefined;
21737
21738 var condition = this._getParams();
21739
21740 debug('scan %O', condition);
21741
21742 if (condition.order) {
21743 console.warn('The order of the query is ignored for Query#scan. Checkout the orderedBy option of Query#scan.');
21744 delete condition.order;
21745 }
21746
21747 if (condition.skip) {
21748 console.warn('The skip option of the query is ignored for Query#scan.');
21749 delete condition.skip;
21750 }
21751
21752 if (condition.limit) {
21753 console.warn('The limit option of the query is ignored for Query#scan.');
21754 delete condition.limit;
21755 }
21756
21757 if (orderedBy) condition.scan_key = orderedBy;
21758 if (batchSize) condition.limit = batchSize;
21759
21760 var promise = _promise.default.resolve([]);
21761
21762 var cursor;
21763 var endReached = false;
21764 return {
21765 next: function next() {
21766 promise = promise.then(function (remainResults) {
21767 if (endReached) return [];
21768 if (remainResults.length > 1) return remainResults; // no cursor means we have reached the end
21769 // except for the first time
21770
21771 if (!cursor && remainResults.length !== 0) {
21772 endReached = true;
21773 return remainResults;
21774 } // when only 1 item left in queue
21775 // start the next request to see if it is the last one
21776
21777
21778 return _request('scan/classes', _this3.className, null, 'GET', cursor ? _.extend({}, condition, {
21779 cursor: cursor
21780 }) : condition, authOptions).then(function (response) {
21781 cursor = response.cursor;
21782 return _this3._parseResponse(response);
21783 }).then(function (results) {
21784 if (!results.length) endReached = true;
21785 return (0, _concat.default)(remainResults).call(remainResults, results);
21786 });
21787 });
21788 return promise.then(function (remainResults) {
21789 return remainResults.shift();
21790 }).then(function (result) {
21791 return {
21792 value: result,
21793 done: result === undefined
21794 };
21795 });
21796 }
21797 };
21798 },
21799
21800 /**
21801 * Delete objects retrieved by this query.
21802 * @param {AuthOptions} options
21803 * @return {Promise} A promise that is fulfilled when the save
21804 * completes.
21805 */
21806 destroyAll: function destroyAll(options) {
21807 var self = this;
21808 return (0, _find.default)(self).call(self, options).then(function (objects) {
21809 return AV.Object.destroyAll(objects, options);
21810 });
21811 },
21812
21813 /**
21814 * Counts the number of objects that match this query.
21815 *
21816 * @param {AuthOptions} options
21817 * @return {Promise} A promise that is resolved with the count when
21818 * the query completes.
21819 */
21820 count: function count(options) {
21821 var params = this._getParams();
21822
21823 params.limit = 0;
21824 params.count = 1;
21825
21826 var request = this._createRequest(params, options);
21827
21828 return request.then(function (response) {
21829 return response.count;
21830 });
21831 },
21832
21833 /**
21834 * Retrieves at most one AV.Object that satisfies this query.
21835 *
21836 * @param {AuthOptions} options
21837 * @return {Promise} A promise that is resolved with the object when
21838 * the query completes.
21839 */
21840 first: function first(options) {
21841 var self = this;
21842
21843 var params = this._getParams();
21844
21845 params.limit = 1;
21846
21847 var request = this._createRequest(params, options);
21848
21849 return request.then(function (response) {
21850 return (0, _map.default)(_).call(_, response.results, function (json) {
21851 var obj = self._newObject();
21852
21853 if (obj._finishFetch) {
21854 obj._finishFetch(self._processResult(json), true);
21855 }
21856
21857 return obj;
21858 })[0];
21859 });
21860 },
21861
21862 /**
21863 * Sets the number of results to skip before returning any results.
21864 * This is useful for pagination.
21865 * Default is to skip zero results.
21866 * @param {Number} n the number of results to skip.
21867 * @return {AV.Query} Returns the query, so you can chain this call.
21868 */
21869 skip: function skip(n) {
21870 requires(n, 'undefined is not a valid skip value');
21871 this._skip = n;
21872 return this;
21873 },
21874
21875 /**
21876 * Sets the limit of the number of results to return. The default limit is
21877 * 100, with a maximum of 1000 results being returned at a time.
21878 * @param {Number} n the number of results to limit to.
21879 * @return {AV.Query} Returns the query, so you can chain this call.
21880 */
21881 limit: function limit(n) {
21882 requires(n, 'undefined is not a valid limit value');
21883 this._limit = n;
21884 return this;
21885 },
21886
21887 /**
21888 * Add a constraint to the query that requires a particular key's value to
21889 * be equal to the provided value.
21890 * @param {String} key The key to check.
21891 * @param value The value that the AV.Object must contain.
21892 * @return {AV.Query} Returns the query, so you can chain this call.
21893 */
21894 equalTo: function equalTo(key, value) {
21895 requires(key, 'undefined is not a valid key');
21896 requires(value, 'undefined is not a valid value');
21897 this._where[key] = AV._encode(value);
21898 return this;
21899 },
21900
21901 /**
21902 * Helper for condition queries
21903 * @private
21904 */
21905 _addCondition: function _addCondition(key, condition, value) {
21906 requires(key, 'undefined is not a valid condition key');
21907 requires(condition, 'undefined is not a valid condition');
21908 requires(value, 'undefined is not a valid condition value'); // Check if we already have a condition
21909
21910 if (!this._where[key]) {
21911 this._where[key] = {};
21912 }
21913
21914 this._where[key][condition] = AV._encode(value);
21915 return this;
21916 },
21917
21918 /**
21919 * Add a constraint to the query that requires a particular
21920 * <strong>array</strong> key's length to be equal to the provided value.
21921 * @param {String} key The array key to check.
21922 * @param {number} value The length value.
21923 * @return {AV.Query} Returns the query, so you can chain this call.
21924 */
21925 sizeEqualTo: function sizeEqualTo(key, value) {
21926 this._addCondition(key, '$size', value);
21927
21928 return this;
21929 },
21930
21931 /**
21932 * Add a constraint to the query that requires a particular key's value to
21933 * be not equal to the provided value.
21934 * @param {String} key The key to check.
21935 * @param value The value that must not be equalled.
21936 * @return {AV.Query} Returns the query, so you can chain this call.
21937 */
21938 notEqualTo: function notEqualTo(key, value) {
21939 this._addCondition(key, '$ne', value);
21940
21941 return this;
21942 },
21943
21944 /**
21945 * Add a constraint to the query that requires a particular key's value to
21946 * be less than the provided value.
21947 * @param {String} key The key to check.
21948 * @param value The value that provides an upper bound.
21949 * @return {AV.Query} Returns the query, so you can chain this call.
21950 */
21951 lessThan: function lessThan(key, value) {
21952 this._addCondition(key, '$lt', value);
21953
21954 return this;
21955 },
21956
21957 /**
21958 * Add a constraint to the query that requires a particular key's value to
21959 * be greater than the provided value.
21960 * @param {String} key The key to check.
21961 * @param value The value that provides an lower bound.
21962 * @return {AV.Query} Returns the query, so you can chain this call.
21963 */
21964 greaterThan: function greaterThan(key, value) {
21965 this._addCondition(key, '$gt', value);
21966
21967 return this;
21968 },
21969
21970 /**
21971 * Add a constraint to the query that requires a particular key's value to
21972 * be less than or equal to the provided value.
21973 * @param {String} key The key to check.
21974 * @param value The value that provides an upper bound.
21975 * @return {AV.Query} Returns the query, so you can chain this call.
21976 */
21977 lessThanOrEqualTo: function lessThanOrEqualTo(key, value) {
21978 this._addCondition(key, '$lte', value);
21979
21980 return this;
21981 },
21982
21983 /**
21984 * Add a constraint to the query that requires a particular key's value to
21985 * be greater than or equal to the provided value.
21986 * @param {String} key The key to check.
21987 * @param value The value that provides an lower bound.
21988 * @return {AV.Query} Returns the query, so you can chain this call.
21989 */
21990 greaterThanOrEqualTo: function greaterThanOrEqualTo(key, value) {
21991 this._addCondition(key, '$gte', value);
21992
21993 return this;
21994 },
21995
21996 /**
21997 * Add a constraint to the query that requires a particular key's value to
21998 * be contained in the provided list of values.
21999 * @param {String} key The key to check.
22000 * @param {Array} values The values that will match.
22001 * @return {AV.Query} Returns the query, so you can chain this call.
22002 */
22003 containedIn: function containedIn(key, values) {
22004 this._addCondition(key, '$in', values);
22005
22006 return this;
22007 },
22008
22009 /**
22010 * Add a constraint to the query that requires a particular key's value to
22011 * not be contained in the provided list of values.
22012 * @param {String} key The key to check.
22013 * @param {Array} values The values that will not match.
22014 * @return {AV.Query} Returns the query, so you can chain this call.
22015 */
22016 notContainedIn: function notContainedIn(key, values) {
22017 this._addCondition(key, '$nin', values);
22018
22019 return this;
22020 },
22021
22022 /**
22023 * Add a constraint to the query that requires a particular key's value to
22024 * contain each one of the provided list of values.
22025 * @param {String} key The key to check. This key's value must be an array.
22026 * @param {Array} values The values that will match.
22027 * @return {AV.Query} Returns the query, so you can chain this call.
22028 */
22029 containsAll: function containsAll(key, values) {
22030 this._addCondition(key, '$all', values);
22031
22032 return this;
22033 },
22034
22035 /**
22036 * Add a constraint for finding objects that contain the given key.
22037 * @param {String} key The key that should exist.
22038 * @return {AV.Query} Returns the query, so you can chain this call.
22039 */
22040 exists: function exists(key) {
22041 this._addCondition(key, '$exists', true);
22042
22043 return this;
22044 },
22045
22046 /**
22047 * Add a constraint for finding objects that do not contain a given key.
22048 * @param {String} key The key that should not exist
22049 * @return {AV.Query} Returns the query, so you can chain this call.
22050 */
22051 doesNotExist: function doesNotExist(key) {
22052 this._addCondition(key, '$exists', false);
22053
22054 return this;
22055 },
22056
22057 /**
22058 * Add a regular expression constraint for finding string values that match
22059 * the provided regular expression.
22060 * This may be slow for large datasets.
22061 * @param {String} key The key that the string to match is stored in.
22062 * @param {RegExp} regex The regular expression pattern to match.
22063 * @return {AV.Query} Returns the query, so you can chain this call.
22064 */
22065 matches: function matches(key, regex, modifiers) {
22066 this._addCondition(key, '$regex', regex);
22067
22068 if (!modifiers) {
22069 modifiers = '';
22070 } // Javascript regex options support mig as inline options but store them
22071 // as properties of the object. We support mi & should migrate them to
22072 // modifiers
22073
22074
22075 if (regex.ignoreCase) {
22076 modifiers += 'i';
22077 }
22078
22079 if (regex.multiline) {
22080 modifiers += 'm';
22081 }
22082
22083 if (modifiers && modifiers.length) {
22084 this._addCondition(key, '$options', modifiers);
22085 }
22086
22087 return this;
22088 },
22089
22090 /**
22091 * Add a constraint that requires that a key's value matches a AV.Query
22092 * constraint.
22093 * @param {String} key The key that the contains the object to match the
22094 * query.
22095 * @param {AV.Query} query The query that should match.
22096 * @return {AV.Query} Returns the query, so you can chain this call.
22097 */
22098 matchesQuery: function matchesQuery(key, query) {
22099 var queryJSON = query._getParams();
22100
22101 queryJSON.className = query.className;
22102
22103 this._addCondition(key, '$inQuery', queryJSON);
22104
22105 return this;
22106 },
22107
22108 /**
22109 * Add a constraint that requires that a key's value not matches a
22110 * AV.Query constraint.
22111 * @param {String} key The key that the contains the object to match the
22112 * query.
22113 * @param {AV.Query} query The query that should not match.
22114 * @return {AV.Query} Returns the query, so you can chain this call.
22115 */
22116 doesNotMatchQuery: function doesNotMatchQuery(key, query) {
22117 var queryJSON = query._getParams();
22118
22119 queryJSON.className = query.className;
22120
22121 this._addCondition(key, '$notInQuery', queryJSON);
22122
22123 return this;
22124 },
22125
22126 /**
22127 * Add a constraint that requires that a key's value matches a value in
22128 * an object returned by a different AV.Query.
22129 * @param {String} key The key that contains the value that is being
22130 * matched.
22131 * @param {String} queryKey The key in the objects returned by the query to
22132 * match against.
22133 * @param {AV.Query} query The query to run.
22134 * @return {AV.Query} Returns the query, so you can chain this call.
22135 */
22136 matchesKeyInQuery: function matchesKeyInQuery(key, queryKey, query) {
22137 var queryJSON = query._getParams();
22138
22139 queryJSON.className = query.className;
22140
22141 this._addCondition(key, '$select', {
22142 key: queryKey,
22143 query: queryJSON
22144 });
22145
22146 return this;
22147 },
22148
22149 /**
22150 * Add a constraint that requires that a key's value not match a value in
22151 * an object returned by a different AV.Query.
22152 * @param {String} key The key that contains the value that is being
22153 * excluded.
22154 * @param {String} queryKey The key in the objects returned by the query to
22155 * match against.
22156 * @param {AV.Query} query The query to run.
22157 * @return {AV.Query} Returns the query, so you can chain this call.
22158 */
22159 doesNotMatchKeyInQuery: function doesNotMatchKeyInQuery(key, queryKey, query) {
22160 var queryJSON = query._getParams();
22161
22162 queryJSON.className = query.className;
22163
22164 this._addCondition(key, '$dontSelect', {
22165 key: queryKey,
22166 query: queryJSON
22167 });
22168
22169 return this;
22170 },
22171
22172 /**
22173 * Add constraint that at least one of the passed in queries matches.
22174 * @param {Array} queries
22175 * @return {AV.Query} Returns the query, so you can chain this call.
22176 * @private
22177 */
22178 _orQuery: function _orQuery(queries) {
22179 var queryJSON = (0, _map.default)(_).call(_, queries, function (q) {
22180 return q._getParams().where;
22181 });
22182 this._where.$or = queryJSON;
22183 return this;
22184 },
22185
22186 /**
22187 * Add constraint that both of the passed in queries matches.
22188 * @param {Array} queries
22189 * @return {AV.Query} Returns the query, so you can chain this call.
22190 * @private
22191 */
22192 _andQuery: function _andQuery(queries) {
22193 var queryJSON = (0, _map.default)(_).call(_, queries, function (q) {
22194 return q._getParams().where;
22195 });
22196 this._where.$and = queryJSON;
22197 return this;
22198 },
22199
22200 /**
22201 * Converts a string into a regex that matches it.
22202 * Surrounding with \Q .. \E does this, we just need to escape \E's in
22203 * the text separately.
22204 * @private
22205 */
22206 _quote: function _quote(s) {
22207 return '\\Q' + s.replace('\\E', '\\E\\\\E\\Q') + '\\E';
22208 },
22209
22210 /**
22211 * Add a constraint for finding string values that contain a provided
22212 * string. This may be slow for large datasets.
22213 * @param {String} key The key that the string to match is stored in.
22214 * @param {String} substring The substring that the value must contain.
22215 * @return {AV.Query} Returns the query, so you can chain this call.
22216 */
22217 contains: function contains(key, value) {
22218 this._addCondition(key, '$regex', this._quote(value));
22219
22220 return this;
22221 },
22222
22223 /**
22224 * Add a constraint for finding string values that start with a provided
22225 * string. This query will use the backend index, so it will be fast even
22226 * for large datasets.
22227 * @param {String} key The key that the string to match is stored in.
22228 * @param {String} prefix The substring that the value must start with.
22229 * @return {AV.Query} Returns the query, so you can chain this call.
22230 */
22231 startsWith: function startsWith(key, value) {
22232 this._addCondition(key, '$regex', '^' + this._quote(value));
22233
22234 return this;
22235 },
22236
22237 /**
22238 * Add a constraint for finding string values that end with a provided
22239 * string. This will be slow for large datasets.
22240 * @param {String} key The key that the string to match is stored in.
22241 * @param {String} suffix The substring that the value must end with.
22242 * @return {AV.Query} Returns the query, so you can chain this call.
22243 */
22244 endsWith: function endsWith(key, value) {
22245 this._addCondition(key, '$regex', this._quote(value) + '$');
22246
22247 return this;
22248 },
22249
22250 /**
22251 * Sorts the results in ascending order by the given key.
22252 *
22253 * @param {String} key The key to order by.
22254 * @return {AV.Query} Returns the query, so you can chain this call.
22255 */
22256 ascending: function ascending(key) {
22257 requires(key, 'undefined is not a valid key');
22258 this._order = key;
22259 return this;
22260 },
22261
22262 /**
22263 * Also sorts the results in ascending order by the given key. The previous sort keys have
22264 * precedence over this key.
22265 *
22266 * @param {String} key The key to order by
22267 * @return {AV.Query} Returns the query so you can chain this call.
22268 */
22269 addAscending: function addAscending(key) {
22270 requires(key, 'undefined is not a valid key');
22271 if (this._order) this._order += ',' + key;else this._order = key;
22272 return this;
22273 },
22274
22275 /**
22276 * Sorts the results in descending order by the given key.
22277 *
22278 * @param {String} key The key to order by.
22279 * @return {AV.Query} Returns the query, so you can chain this call.
22280 */
22281 descending: function descending(key) {
22282 requires(key, 'undefined is not a valid key');
22283 this._order = '-' + key;
22284 return this;
22285 },
22286
22287 /**
22288 * Also sorts the results in descending order by the given key. The previous sort keys have
22289 * precedence over this key.
22290 *
22291 * @param {String} key The key to order by
22292 * @return {AV.Query} Returns the query so you can chain this call.
22293 */
22294 addDescending: function addDescending(key) {
22295 requires(key, 'undefined is not a valid key');
22296 if (this._order) this._order += ',-' + key;else this._order = '-' + key;
22297 return this;
22298 },
22299
22300 /**
22301 * Add a proximity based constraint for finding objects with key point
22302 * values near the point given.
22303 * @param {String} key The key that the AV.GeoPoint is stored in.
22304 * @param {AV.GeoPoint} point The reference AV.GeoPoint that is used.
22305 * @return {AV.Query} Returns the query, so you can chain this call.
22306 */
22307 near: function near(key, point) {
22308 if (!(point instanceof AV.GeoPoint)) {
22309 // Try to cast it to a GeoPoint, so that near("loc", [20,30]) works.
22310 point = new AV.GeoPoint(point);
22311 }
22312
22313 this._addCondition(key, '$nearSphere', point);
22314
22315 return this;
22316 },
22317
22318 /**
22319 * Add a proximity based constraint for finding objects with key point
22320 * values near the point given and within the maximum distance given.
22321 * @param {String} key The key that the AV.GeoPoint is stored in.
22322 * @param {AV.GeoPoint} point The reference AV.GeoPoint that is used.
22323 * @param maxDistance Maximum distance (in radians) of results to return.
22324 * @return {AV.Query} Returns the query, so you can chain this call.
22325 */
22326 withinRadians: function withinRadians(key, point, distance) {
22327 this.near(key, point);
22328
22329 this._addCondition(key, '$maxDistance', distance);
22330
22331 return this;
22332 },
22333
22334 /**
22335 * Add a proximity based constraint for finding objects with key point
22336 * values near the point given and within the maximum distance given.
22337 * Radius of earth used is 3958.8 miles.
22338 * @param {String} key The key that the AV.GeoPoint is stored in.
22339 * @param {AV.GeoPoint} point The reference AV.GeoPoint that is used.
22340 * @param {Number} maxDistance Maximum distance (in miles) of results to
22341 * return.
22342 * @return {AV.Query} Returns the query, so you can chain this call.
22343 */
22344 withinMiles: function withinMiles(key, point, distance) {
22345 return this.withinRadians(key, point, distance / 3958.8);
22346 },
22347
22348 /**
22349 * Add a proximity based constraint for finding objects with key point
22350 * values near the point given and within the maximum distance given.
22351 * Radius of earth used is 6371.0 kilometers.
22352 * @param {String} key The key that the AV.GeoPoint is stored in.
22353 * @param {AV.GeoPoint} point The reference AV.GeoPoint that is used.
22354 * @param {Number} maxDistance Maximum distance (in kilometers) of results
22355 * to return.
22356 * @return {AV.Query} Returns the query, so you can chain this call.
22357 */
22358 withinKilometers: function withinKilometers(key, point, distance) {
22359 return this.withinRadians(key, point, distance / 6371.0);
22360 },
22361
22362 /**
22363 * Add a constraint to the query that requires a particular key's
22364 * coordinates be contained within a given rectangular geographic bounding
22365 * box.
22366 * @param {String} key The key to be constrained.
22367 * @param {AV.GeoPoint} southwest
22368 * The lower-left inclusive corner of the box.
22369 * @param {AV.GeoPoint} northeast
22370 * The upper-right inclusive corner of the box.
22371 * @return {AV.Query} Returns the query, so you can chain this call.
22372 */
22373 withinGeoBox: function withinGeoBox(key, southwest, northeast) {
22374 if (!(southwest instanceof AV.GeoPoint)) {
22375 southwest = new AV.GeoPoint(southwest);
22376 }
22377
22378 if (!(northeast instanceof AV.GeoPoint)) {
22379 northeast = new AV.GeoPoint(northeast);
22380 }
22381
22382 this._addCondition(key, '$within', {
22383 $box: [southwest, northeast]
22384 });
22385
22386 return this;
22387 },
22388
22389 /**
22390 * Include nested AV.Objects for the provided key. You can use dot
22391 * notation to specify which fields in the included object are also fetch.
22392 * @param {String[]} keys The name of the key to include.
22393 * @return {AV.Query} Returns the query, so you can chain this call.
22394 */
22395 include: function include(keys) {
22396 var _this4 = this;
22397
22398 requires(keys, 'undefined is not a valid key');
22399
22400 _.forEach(arguments, function (keys) {
22401 var _context;
22402
22403 _this4._include = (0, _concat.default)(_context = _this4._include).call(_context, ensureArray(keys));
22404 });
22405
22406 return this;
22407 },
22408
22409 /**
22410 * Include the ACL.
22411 * @param {Boolean} [value=true] Whether to include the ACL
22412 * @return {AV.Query} Returns the query, so you can chain this call.
22413 */
22414 includeACL: function includeACL() {
22415 var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
22416 this._includeACL = value;
22417 return this;
22418 },
22419
22420 /**
22421 * Restrict the fields of the returned AV.Objects to include only the
22422 * provided keys. If this is called multiple times, then all of the keys
22423 * specified in each of the calls will be included.
22424 * @param {String[]} keys The names of the keys to include.
22425 * @return {AV.Query} Returns the query, so you can chain this call.
22426 */
22427 select: function select(keys) {
22428 var _this5 = this;
22429
22430 requires(keys, 'undefined is not a valid key');
22431
22432 _.forEach(arguments, function (keys) {
22433 var _context2;
22434
22435 _this5._select = (0, _concat.default)(_context2 = _this5._select).call(_context2, ensureArray(keys));
22436 });
22437
22438 return this;
22439 },
22440
22441 /**
22442 * Iterates over each result of a query, calling a callback for each one. If
22443 * the callback returns a promise, the iteration will not continue until
22444 * that promise has been fulfilled. If the callback returns a rejected
22445 * promise, then iteration will stop with that error. The items are
22446 * processed in an unspecified order. The query may not have any sort order,
22447 * and may not use limit or skip.
22448 * @param callback {Function} Callback that will be called with each result
22449 * of the query.
22450 * @return {Promise} A promise that will be fulfilled once the
22451 * iteration has completed.
22452 */
22453 each: function each(callback) {
22454 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
22455
22456 if (this._order || this._skip || this._limit >= 0) {
22457 var error = new Error('Cannot iterate on a query with sort, skip, or limit.');
22458 return _promise.default.reject(error);
22459 }
22460
22461 var query = new AV.Query(this.objectClass); // We can override the batch size from the options.
22462 // This is undocumented, but useful for testing.
22463
22464 query._limit = options.batchSize || 100;
22465 query._where = _.clone(this._where);
22466 query._include = _.clone(this._include);
22467 query.ascending('objectId');
22468 var finished = false;
22469 return continueWhile(function () {
22470 return !finished;
22471 }, function () {
22472 return (0, _find.default)(query).call(query, options).then(function (results) {
22473 var callbacksDone = _promise.default.resolve();
22474
22475 _.each(results, function (result) {
22476 callbacksDone = callbacksDone.then(function () {
22477 return callback(result);
22478 });
22479 });
22480
22481 return callbacksDone.then(function () {
22482 if (results.length >= query._limit) {
22483 query.greaterThan('objectId', results[results.length - 1].id);
22484 } else {
22485 finished = true;
22486 }
22487 });
22488 });
22489 });
22490 },
22491
22492 /**
22493 * Subscribe the changes of this query.
22494 *
22495 * LiveQuery is not included in the default bundle: {@link https://url.leanapp.cn/enable-live-query}.
22496 *
22497 * @since 3.0.0
22498 * @return {AV.LiveQuery} An eventemitter which can be used to get LiveQuery updates;
22499 */
22500 subscribe: function subscribe(options) {
22501 return AV.LiveQuery.init(this, options);
22502 }
22503 });
22504
22505 AV.FriendShipQuery = AV.Query._extend({
22506 _newObject: function _newObject() {
22507 var UserClass = AV.Object._getSubclass('_User');
22508
22509 return new UserClass();
22510 },
22511 _processResult: function _processResult(json) {
22512 if (json && json[this._friendshipTag]) {
22513 var user = json[this._friendshipTag];
22514
22515 if (user.__type === 'Pointer' && user.className === '_User') {
22516 delete user.__type;
22517 delete user.className;
22518 }
22519
22520 return user;
22521 } else {
22522 return null;
22523 }
22524 }
22525 });
22526};
22527
22528/***/ }),
22529/* 530 */
22530/***/ (function(module, exports, __webpack_require__) {
22531
22532"use strict";
22533
22534
22535var _interopRequireDefault = __webpack_require__(2);
22536
22537var _promise = _interopRequireDefault(__webpack_require__(12));
22538
22539var _keys = _interopRequireDefault(__webpack_require__(48));
22540
22541var _ = __webpack_require__(1);
22542
22543var EventEmitter = __webpack_require__(218);
22544
22545var _require = __webpack_require__(28),
22546 inherits = _require.inherits;
22547
22548var _require2 = __webpack_require__(25),
22549 request = _require2.request;
22550
22551var subscribe = function subscribe(queryJSON, subscriptionId) {
22552 return request({
22553 method: 'POST',
22554 path: '/LiveQuery/subscribe',
22555 data: {
22556 query: queryJSON,
22557 id: subscriptionId
22558 }
22559 });
22560};
22561
22562module.exports = function (AV) {
22563 var requireRealtime = function requireRealtime() {
22564 if (!AV._config.realtime) {
22565 throw new Error('LiveQuery not supported. Please use the LiveQuery bundle. https://url.leanapp.cn/enable-live-query');
22566 }
22567 };
22568 /**
22569 * @class
22570 * A LiveQuery, created by {@link AV.Query#subscribe} is an EventEmitter notifies changes of the Query.
22571 * @since 3.0.0
22572 */
22573
22574
22575 AV.LiveQuery = inherits(EventEmitter,
22576 /** @lends AV.LiveQuery.prototype */
22577 {
22578 constructor: function constructor(id, client, queryJSON, subscriptionId) {
22579 var _this = this;
22580
22581 EventEmitter.apply(this);
22582 this.id = id;
22583 this._client = client;
22584
22585 this._client.register(this);
22586
22587 this._queryJSON = queryJSON;
22588 this._subscriptionId = subscriptionId;
22589 this._onMessage = this._dispatch.bind(this);
22590
22591 this._onReconnect = function () {
22592 subscribe(_this._queryJSON, _this._subscriptionId).catch(function (error) {
22593 return console.error("LiveQuery resubscribe error: ".concat(error.message));
22594 });
22595 };
22596
22597 client.on('message', this._onMessage);
22598 client.on('reconnect', this._onReconnect);
22599 },
22600 _dispatch: function _dispatch(message) {
22601 var _this2 = this;
22602
22603 message.forEach(function (_ref) {
22604 var op = _ref.op,
22605 object = _ref.object,
22606 queryId = _ref.query_id,
22607 updatedKeys = _ref.updatedKeys;
22608 if (queryId !== _this2.id) return;
22609 var target = AV.parseJSON(_.extend({
22610 __type: object.className === '_File' ? 'File' : 'Object'
22611 }, object));
22612
22613 if (updatedKeys) {
22614 /**
22615 * An existing AV.Object which fulfills the Query you subscribe is updated.
22616 * @event AV.LiveQuery#update
22617 * @param {AV.Object|AV.File} target updated object
22618 * @param {String[]} updatedKeys updated keys
22619 */
22620
22621 /**
22622 * An existing AV.Object which doesn't fulfill the Query is updated and now it fulfills the Query.
22623 * @event AV.LiveQuery#enter
22624 * @param {AV.Object|AV.File} target updated object
22625 * @param {String[]} updatedKeys updated keys
22626 */
22627
22628 /**
22629 * An existing AV.Object which fulfills the Query is updated and now it doesn't fulfill the Query.
22630 * @event AV.LiveQuery#leave
22631 * @param {AV.Object|AV.File} target updated object
22632 * @param {String[]} updatedKeys updated keys
22633 */
22634 _this2.emit(op, target, updatedKeys);
22635 } else {
22636 /**
22637 * A new AV.Object which fulfills the Query you subscribe is created.
22638 * @event AV.LiveQuery#create
22639 * @param {AV.Object|AV.File} target updated object
22640 */
22641
22642 /**
22643 * An existing AV.Object which fulfills the Query you subscribe is deleted.
22644 * @event AV.LiveQuery#delete
22645 * @param {AV.Object|AV.File} target updated object
22646 */
22647 _this2.emit(op, target);
22648 }
22649 });
22650 },
22651
22652 /**
22653 * unsubscribe the query
22654 *
22655 * @return {Promise}
22656 */
22657 unsubscribe: function unsubscribe() {
22658 var client = this._client;
22659 client.off('message', this._onMessage);
22660 client.off('reconnect', this._onReconnect);
22661 client.deregister(this);
22662 return request({
22663 method: 'POST',
22664 path: '/LiveQuery/unsubscribe',
22665 data: {
22666 id: client.id,
22667 query_id: this.id
22668 }
22669 });
22670 }
22671 },
22672 /** @lends AV.LiveQuery */
22673 {
22674 init: function init(query) {
22675 var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
22676 _ref2$subscriptionId = _ref2.subscriptionId,
22677 userDefinedSubscriptionId = _ref2$subscriptionId === void 0 ? AV._getSubscriptionId() : _ref2$subscriptionId;
22678
22679 requireRealtime();
22680 if (!(query instanceof AV.Query)) throw new TypeError('LiveQuery must be inited with a Query');
22681 return _promise.default.resolve(userDefinedSubscriptionId).then(function (subscriptionId) {
22682 return AV._config.realtime.createLiveQueryClient(subscriptionId).then(function (liveQueryClient) {
22683 var _query$_getParams = query._getParams(),
22684 where = _query$_getParams.where,
22685 keys = (0, _keys.default)(_query$_getParams),
22686 returnACL = _query$_getParams.returnACL;
22687
22688 var queryJSON = {
22689 where: where,
22690 keys: keys,
22691 returnACL: returnACL,
22692 className: query.className
22693 };
22694 var promise = subscribe(queryJSON, subscriptionId).then(function (_ref3) {
22695 var queryId = _ref3.query_id;
22696 return new AV.LiveQuery(queryId, liveQueryClient, queryJSON, subscriptionId);
22697 }).finally(function () {
22698 liveQueryClient.deregister(promise);
22699 });
22700 liveQueryClient.register(promise);
22701 return promise;
22702 });
22703 });
22704 },
22705
22706 /**
22707 * Pause the LiveQuery connection. This is useful to deactivate the SDK when the app is swtiched to background.
22708 * @static
22709 * @return void
22710 */
22711 pause: function pause() {
22712 requireRealtime();
22713 return AV._config.realtime.pause();
22714 },
22715
22716 /**
22717 * Resume the LiveQuery connection. All subscriptions will be restored after reconnection.
22718 * @static
22719 * @return void
22720 */
22721 resume: function resume() {
22722 requireRealtime();
22723 return AV._config.realtime.resume();
22724 }
22725 });
22726};
22727
22728/***/ }),
22729/* 531 */
22730/***/ (function(module, exports, __webpack_require__) {
22731
22732"use strict";
22733
22734
22735var _ = __webpack_require__(1);
22736
22737var _require = __webpack_require__(28),
22738 tap = _require.tap;
22739
22740module.exports = function (AV) {
22741 /**
22742 * @class
22743 * @example
22744 * AV.Captcha.request().then(captcha => {
22745 * captcha.bind({
22746 * textInput: 'code', // the id for textInput
22747 * image: 'captcha',
22748 * verifyButton: 'verify',
22749 * }, {
22750 * success: (validateCode) => {}, // next step
22751 * error: (error) => {}, // present error.message to user
22752 * });
22753 * });
22754 */
22755 AV.Captcha = function Captcha(options, authOptions) {
22756 this._options = options;
22757 this._authOptions = authOptions;
22758 /**
22759 * The image url of the captcha
22760 * @type string
22761 */
22762
22763 this.url = undefined;
22764 /**
22765 * The captchaToken of the captcha.
22766 * @type string
22767 */
22768
22769 this.captchaToken = undefined;
22770 /**
22771 * The validateToken of the captcha.
22772 * @type string
22773 */
22774
22775 this.validateToken = undefined;
22776 };
22777 /**
22778 * Refresh the captcha
22779 * @return {Promise.<string>} a new capcha url
22780 */
22781
22782
22783 AV.Captcha.prototype.refresh = function refresh() {
22784 var _this = this;
22785
22786 return AV.Cloud._requestCaptcha(this._options, this._authOptions).then(function (_ref) {
22787 var captchaToken = _ref.captchaToken,
22788 url = _ref.url;
22789
22790 _.extend(_this, {
22791 captchaToken: captchaToken,
22792 url: url
22793 });
22794
22795 return url;
22796 });
22797 };
22798 /**
22799 * Verify the captcha
22800 * @param {String} code The code from user input
22801 * @return {Promise.<string>} validateToken if the code is valid
22802 */
22803
22804
22805 AV.Captcha.prototype.verify = function verify(code) {
22806 var _this2 = this;
22807
22808 return AV.Cloud.verifyCaptcha(code, this.captchaToken).then(tap(function (validateToken) {
22809 return _this2.validateToken = validateToken;
22810 }));
22811 };
22812
22813 if (undefined === 'Browser') {
22814 /**
22815 * Bind the captcha to HTMLElements. <b>ONLY AVAILABLE in browsers</b>.
22816 * @param [elements]
22817 * @param {String|HTMLInputElement} [elements.textInput] An input element typed text, or the id for the element.
22818 * @param {String|HTMLImageElement} [elements.image] An image element, or the id for the element.
22819 * @param {String|HTMLElement} [elements.verifyButton] A button element, or the id for the element.
22820 * @param [callbacks]
22821 * @param {Function} [callbacks.success] Success callback will be called if the code is verified. The param `validateCode` can be used for further SMS request.
22822 * @param {Function} [callbacks.error] Error callback will be called if something goes wrong, detailed in param `error.message`.
22823 */
22824 AV.Captcha.prototype.bind = function bind(_ref2, _ref3) {
22825 var _this3 = this;
22826
22827 var textInput = _ref2.textInput,
22828 image = _ref2.image,
22829 verifyButton = _ref2.verifyButton;
22830 var success = _ref3.success,
22831 error = _ref3.error;
22832
22833 if (typeof textInput === 'string') {
22834 textInput = document.getElementById(textInput);
22835 if (!textInput) throw new Error("textInput with id ".concat(textInput, " not found"));
22836 }
22837
22838 if (typeof image === 'string') {
22839 image = document.getElementById(image);
22840 if (!image) throw new Error("image with id ".concat(image, " not found"));
22841 }
22842
22843 if (typeof verifyButton === 'string') {
22844 verifyButton = document.getElementById(verifyButton);
22845 if (!verifyButton) throw new Error("verifyButton with id ".concat(verifyButton, " not found"));
22846 }
22847
22848 this.__refresh = function () {
22849 return _this3.refresh().then(function (url) {
22850 image.src = url;
22851
22852 if (textInput) {
22853 textInput.value = '';
22854 textInput.focus();
22855 }
22856 }).catch(function (err) {
22857 return console.warn("refresh captcha fail: ".concat(err.message));
22858 });
22859 };
22860
22861 if (image) {
22862 this.__image = image;
22863 image.src = this.url;
22864 image.addEventListener('click', this.__refresh);
22865 }
22866
22867 this.__verify = function () {
22868 var code = textInput.value;
22869
22870 _this3.verify(code).catch(function (err) {
22871 _this3.__refresh();
22872
22873 throw err;
22874 }).then(success, error).catch(function (err) {
22875 return console.warn("verify captcha fail: ".concat(err.message));
22876 });
22877 };
22878
22879 if (textInput && verifyButton) {
22880 this.__verifyButton = verifyButton;
22881 verifyButton.addEventListener('click', this.__verify);
22882 }
22883 };
22884 /**
22885 * unbind the captcha from HTMLElements. <b>ONLY AVAILABLE in browsers</b>.
22886 */
22887
22888
22889 AV.Captcha.prototype.unbind = function unbind() {
22890 if (this.__image) this.__image.removeEventListener('click', this.__refresh);
22891 if (this.__verifyButton) this.__verifyButton.removeEventListener('click', this.__verify);
22892 };
22893 }
22894 /**
22895 * Request a captcha
22896 * @param [options]
22897 * @param {Number} [options.width] width(px) of the captcha, ranged 60-200
22898 * @param {Number} [options.height] height(px) of the captcha, ranged 30-100
22899 * @param {Number} [options.size=4] length of the captcha, ranged 3-6. MasterKey required.
22900 * @param {Number} [options.ttl=60] time to live(s), ranged 10-180. MasterKey required.
22901 * @return {Promise.<AV.Captcha>}
22902 */
22903
22904
22905 AV.Captcha.request = function (options, authOptions) {
22906 var captcha = new AV.Captcha(options, authOptions);
22907 return captcha.refresh().then(function () {
22908 return captcha;
22909 });
22910 };
22911};
22912
22913/***/ }),
22914/* 532 */
22915/***/ (function(module, exports, __webpack_require__) {
22916
22917"use strict";
22918
22919
22920var _interopRequireDefault = __webpack_require__(2);
22921
22922var _promise = _interopRequireDefault(__webpack_require__(12));
22923
22924var _ = __webpack_require__(1);
22925
22926var _require = __webpack_require__(25),
22927 _request = _require._request,
22928 request = _require.request;
22929
22930module.exports = function (AV) {
22931 /**
22932 * Contains functions for calling and declaring
22933 * <p><strong><em>
22934 * Some functions are only available from Cloud Code.
22935 * </em></strong></p>
22936 *
22937 * @namespace
22938 * @borrows AV.Captcha.request as requestCaptcha
22939 */
22940 AV.Cloud = AV.Cloud || {};
22941
22942 _.extend(AV.Cloud,
22943 /** @lends AV.Cloud */
22944 {
22945 /**
22946 * Makes a call to a cloud function.
22947 * @param {String} name The function name.
22948 * @param {Object} [data] The parameters to send to the cloud function.
22949 * @param {AuthOptions} [options]
22950 * @return {Promise} A promise that will be resolved with the result
22951 * of the function.
22952 */
22953 run: function run(name, data, options) {
22954 return request({
22955 service: 'engine',
22956 method: 'POST',
22957 path: "/functions/".concat(name),
22958 data: AV._encode(data, null, true),
22959 authOptions: options
22960 }).then(function (resp) {
22961 return AV._decode(resp).result;
22962 });
22963 },
22964
22965 /**
22966 * Makes a call to a cloud function, you can send {AV.Object} as param or a field of param; the response
22967 * from server will also be parsed as an {AV.Object}, array of {AV.Object}, or object includes {AV.Object}
22968 * @param {String} name The function name.
22969 * @param {Object} [data] The parameters to send to the cloud function.
22970 * @param {AuthOptions} [options]
22971 * @return {Promise} A promise that will be resolved with the result of the function.
22972 */
22973 rpc: function rpc(name, data, options) {
22974 if (_.isArray(data)) {
22975 return _promise.default.reject(new Error("Can't pass Array as the param of rpc function in JavaScript SDK."));
22976 }
22977
22978 return request({
22979 service: 'engine',
22980 method: 'POST',
22981 path: "/call/".concat(name),
22982 data: AV._encodeObjectOrArray(data),
22983 authOptions: options
22984 }).then(function (resp) {
22985 return AV._decode(resp).result;
22986 });
22987 },
22988
22989 /**
22990 * Make a call to request server date time.
22991 * @return {Promise.<Date>} A promise that will be resolved with the result
22992 * of the function.
22993 * @since 0.5.9
22994 */
22995 getServerDate: function getServerDate() {
22996 return _request('date', null, null, 'GET').then(function (resp) {
22997 return AV._decode(resp);
22998 });
22999 },
23000
23001 /**
23002 * Makes a call to request an sms code for operation verification.
23003 * @param {String|Object} data The mobile phone number string or a JSON
23004 * object that contains mobilePhoneNumber,template,sign,op,ttl,name etc.
23005 * @param {String} data.mobilePhoneNumber
23006 * @param {String} [data.template] sms template name
23007 * @param {String} [data.sign] sms signature name
23008 * @param {String} [data.smsType] sending code by `sms` (default) or `voice` call
23009 * @param {SMSAuthOptions} [options]
23010 * @return {Promise} A promise that will be resolved if the request succeed
23011 */
23012 requestSmsCode: function requestSmsCode(data) {
23013 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
23014
23015 if (_.isString(data)) {
23016 data = {
23017 mobilePhoneNumber: data
23018 };
23019 }
23020
23021 if (!data.mobilePhoneNumber) {
23022 throw new Error('Missing mobilePhoneNumber.');
23023 }
23024
23025 if (options.validateToken) {
23026 data = _.extend({}, data, {
23027 validate_token: options.validateToken
23028 });
23029 }
23030
23031 return _request('requestSmsCode', null, null, 'POST', data, options);
23032 },
23033
23034 /**
23035 * Makes a call to verify sms code that sent by AV.Cloud.requestSmsCode
23036 * @param {String} code The sms code sent by AV.Cloud.requestSmsCode
23037 * @param {phone} phone The mobile phoner number.
23038 * @return {Promise} A promise that will be resolved with the result
23039 * of the function.
23040 */
23041 verifySmsCode: function verifySmsCode(code, phone) {
23042 if (!code) throw new Error('Missing sms code.');
23043 var params = {};
23044
23045 if (_.isString(phone)) {
23046 params['mobilePhoneNumber'] = phone;
23047 }
23048
23049 return _request('verifySmsCode', code, null, 'POST', params);
23050 },
23051 _requestCaptcha: function _requestCaptcha(options, authOptions) {
23052 return _request('requestCaptcha', null, null, 'GET', options, authOptions).then(function (_ref) {
23053 var url = _ref.captcha_url,
23054 captchaToken = _ref.captcha_token;
23055 return {
23056 captchaToken: captchaToken,
23057 url: url
23058 };
23059 });
23060 },
23061
23062 /**
23063 * Request a captcha.
23064 */
23065 requestCaptcha: AV.Captcha.request,
23066
23067 /**
23068 * Verify captcha code. This is the low-level API for captcha.
23069 * Checkout {@link AV.Captcha} for high abstract APIs.
23070 * @param {String} code the code from user input
23071 * @param {String} captchaToken captchaToken returned by {@link AV.Cloud.requestCaptcha}
23072 * @return {Promise.<String>} validateToken if the code is valid
23073 */
23074 verifyCaptcha: function verifyCaptcha(code, captchaToken) {
23075 return _request('verifyCaptcha', null, null, 'POST', {
23076 captcha_code: code,
23077 captcha_token: captchaToken
23078 }).then(function (_ref2) {
23079 var validateToken = _ref2.validate_token;
23080 return validateToken;
23081 });
23082 }
23083 });
23084};
23085
23086/***/ }),
23087/* 533 */
23088/***/ (function(module, exports, __webpack_require__) {
23089
23090"use strict";
23091
23092
23093var request = __webpack_require__(25).request;
23094
23095module.exports = function (AV) {
23096 AV.Installation = AV.Object.extend('_Installation');
23097 /**
23098 * @namespace
23099 */
23100
23101 AV.Push = AV.Push || {};
23102 /**
23103 * Sends a push notification.
23104 * @param {Object} data The data of the push notification.
23105 * @param {String[]} [data.channels] An Array of channels to push to.
23106 * @param {Date} [data.push_time] A Date object for when to send the push.
23107 * @param {Date} [data.expiration_time] A Date object for when to expire
23108 * the push.
23109 * @param {Number} [data.expiration_interval] The seconds from now to expire the push.
23110 * @param {Number} [data.flow_control] The clients to notify per second
23111 * @param {AV.Query} [data.where] An AV.Query over AV.Installation that is used to match
23112 * a set of installations to push to.
23113 * @param {String} [data.cql] A CQL statement over AV.Installation that is used to match
23114 * a set of installations to push to.
23115 * @param {Object} data.data The data to send as part of the push.
23116 More details: https://url.leanapp.cn/pushData
23117 * @param {AuthOptions} [options]
23118 * @return {Promise}
23119 */
23120
23121 AV.Push.send = function (data, options) {
23122 if (data.where) {
23123 data.where = data.where._getParams().where;
23124 }
23125
23126 if (data.where && data.cql) {
23127 throw new Error("Both where and cql can't be set");
23128 }
23129
23130 if (data.push_time) {
23131 data.push_time = data.push_time.toJSON();
23132 }
23133
23134 if (data.expiration_time) {
23135 data.expiration_time = data.expiration_time.toJSON();
23136 }
23137
23138 if (data.expiration_time && data.expiration_interval) {
23139 throw new Error("Both expiration_time and expiration_interval can't be set");
23140 }
23141
23142 return request({
23143 service: 'push',
23144 method: 'POST',
23145 path: '/push',
23146 data: data,
23147 authOptions: options
23148 });
23149 };
23150};
23151
23152/***/ }),
23153/* 534 */
23154/***/ (function(module, exports, __webpack_require__) {
23155
23156"use strict";
23157
23158
23159var _interopRequireDefault = __webpack_require__(2);
23160
23161var _promise = _interopRequireDefault(__webpack_require__(12));
23162
23163var _typeof2 = _interopRequireDefault(__webpack_require__(135));
23164
23165var _ = __webpack_require__(1);
23166
23167var AVRequest = __webpack_require__(25)._request;
23168
23169var _require = __webpack_require__(28),
23170 getSessionToken = _require.getSessionToken;
23171
23172module.exports = function (AV) {
23173 var getUser = function getUser() {
23174 var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
23175 var sessionToken = getSessionToken(options);
23176
23177 if (sessionToken) {
23178 return AV.User._fetchUserBySessionToken(getSessionToken(options));
23179 }
23180
23181 return AV.User.currentAsync();
23182 };
23183
23184 var getUserPointer = function getUserPointer(options) {
23185 return getUser(options).then(function (currUser) {
23186 return AV.Object.createWithoutData('_User', currUser.id)._toPointer();
23187 });
23188 };
23189 /**
23190 * Contains functions to deal with Status in LeanCloud.
23191 * @class
23192 */
23193
23194
23195 AV.Status = function (imageUrl, message) {
23196 this.data = {};
23197 this.inboxType = 'default';
23198 this.query = null;
23199
23200 if (imageUrl && (0, _typeof2.default)(imageUrl) === 'object') {
23201 this.data = imageUrl;
23202 } else {
23203 if (imageUrl) {
23204 this.data.image = imageUrl;
23205 }
23206
23207 if (message) {
23208 this.data.message = message;
23209 }
23210 }
23211
23212 return this;
23213 };
23214
23215 _.extend(AV.Status.prototype,
23216 /** @lends AV.Status.prototype */
23217 {
23218 /**
23219 * Gets the value of an attribute in status data.
23220 * @param {String} attr The string name of an attribute.
23221 */
23222 get: function get(attr) {
23223 return this.data[attr];
23224 },
23225
23226 /**
23227 * Sets a hash of model attributes on the status data.
23228 * @param {String} key The key to set.
23229 * @param {} value The value to give it.
23230 */
23231 set: function set(key, value) {
23232 this.data[key] = value;
23233 return this;
23234 },
23235
23236 /**
23237 * Destroy this status,then it will not be avaiable in other user's inboxes.
23238 * @param {AuthOptions} options
23239 * @return {Promise} A promise that is fulfilled when the destroy
23240 * completes.
23241 */
23242 destroy: function destroy(options) {
23243 if (!this.id) return _promise.default.reject(new Error('The status id is not exists.'));
23244 var request = AVRequest('statuses', null, this.id, 'DELETE', options);
23245 return request;
23246 },
23247
23248 /**
23249 * Cast the AV.Status object to an AV.Object pointer.
23250 * @return {AV.Object} A AV.Object pointer.
23251 */
23252 toObject: function toObject() {
23253 if (!this.id) return null;
23254 return AV.Object.createWithoutData('_Status', this.id);
23255 },
23256 _getDataJSON: function _getDataJSON() {
23257 var json = _.clone(this.data);
23258
23259 return AV._encode(json);
23260 },
23261
23262 /**
23263 * Send a status by a AV.Query object.
23264 * @since 0.3.0
23265 * @param {AuthOptions} options
23266 * @return {Promise} A promise that is fulfilled when the send
23267 * completes.
23268 * @example
23269 * // send a status to male users
23270 * var status = new AVStatus('image url', 'a message');
23271 * status.query = new AV.Query('_User');
23272 * status.query.equalTo('gender', 'male');
23273 * status.send().then(function(){
23274 * //send status successfully.
23275 * }, function(err){
23276 * //an error threw.
23277 * console.dir(err);
23278 * });
23279 */
23280 send: function send() {
23281 var _this = this;
23282
23283 var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
23284
23285 if (!getSessionToken(options) && !AV.User.current()) {
23286 throw new Error('Please signin an user.');
23287 }
23288
23289 if (!this.query) {
23290 return AV.Status.sendStatusToFollowers(this, options);
23291 }
23292
23293 return getUserPointer(options).then(function (currUser) {
23294 var query = _this.query._getParams();
23295
23296 query.className = _this.query.className;
23297 var data = {};
23298 data.query = query;
23299 _this.data = _this.data || {};
23300 _this.data.source = _this.data.source || currUser;
23301 data.data = _this._getDataJSON();
23302 data.inboxType = _this.inboxType || 'default';
23303 return AVRequest('statuses', null, null, 'POST', data, options);
23304 }).then(function (response) {
23305 _this.id = response.objectId;
23306 _this.createdAt = AV._parseDate(response.createdAt);
23307 return _this;
23308 });
23309 },
23310 _finishFetch: function _finishFetch(serverData) {
23311 this.id = serverData.objectId;
23312 this.createdAt = AV._parseDate(serverData.createdAt);
23313 this.updatedAt = AV._parseDate(serverData.updatedAt);
23314 this.messageId = serverData.messageId;
23315 delete serverData.messageId;
23316 delete serverData.objectId;
23317 delete serverData.createdAt;
23318 delete serverData.updatedAt;
23319 this.data = AV._decode(serverData);
23320 }
23321 });
23322 /**
23323 * Send a status to current signined user's followers.
23324 * @since 0.3.0
23325 * @param {AV.Status} status A status object to be send to followers.
23326 * @param {AuthOptions} options
23327 * @return {Promise} A promise that is fulfilled when the send
23328 * completes.
23329 * @example
23330 * var status = new AVStatus('image url', 'a message');
23331 * AV.Status.sendStatusToFollowers(status).then(function(){
23332 * //send status successfully.
23333 * }, function(err){
23334 * //an error threw.
23335 * console.dir(err);
23336 * });
23337 */
23338
23339
23340 AV.Status.sendStatusToFollowers = function (status) {
23341 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
23342
23343 if (!getSessionToken(options) && !AV.User.current()) {
23344 throw new Error('Please signin an user.');
23345 }
23346
23347 return getUserPointer(options).then(function (currUser) {
23348 var query = {};
23349 query.className = '_Follower';
23350 query.keys = 'follower';
23351 query.where = {
23352 user: currUser
23353 };
23354 var data = {};
23355 data.query = query;
23356 status.data = status.data || {};
23357 status.data.source = status.data.source || currUser;
23358 data.data = status._getDataJSON();
23359 data.inboxType = status.inboxType || 'default';
23360 var request = AVRequest('statuses', null, null, 'POST', data, options);
23361 return request.then(function (response) {
23362 status.id = response.objectId;
23363 status.createdAt = AV._parseDate(response.createdAt);
23364 return status;
23365 });
23366 });
23367 };
23368 /**
23369 * <p>Send a status from current signined user to other user's private status inbox.</p>
23370 * @since 0.3.0
23371 * @param {AV.Status} status A status object to be send to followers.
23372 * @param {String} target The target user or user's objectId.
23373 * @param {AuthOptions} options
23374 * @return {Promise} A promise that is fulfilled when the send
23375 * completes.
23376 * @example
23377 * // send a private status to user '52e84e47e4b0f8de283b079b'
23378 * var status = new AVStatus('image url', 'a message');
23379 * AV.Status.sendPrivateStatus(status, '52e84e47e4b0f8de283b079b').then(function(){
23380 * //send status successfully.
23381 * }, function(err){
23382 * //an error threw.
23383 * console.dir(err);
23384 * });
23385 */
23386
23387
23388 AV.Status.sendPrivateStatus = function (status, target) {
23389 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
23390
23391 if (!getSessionToken(options) && !AV.User.current()) {
23392 throw new Error('Please signin an user.');
23393 }
23394
23395 if (!target) {
23396 throw new Error('Invalid target user.');
23397 }
23398
23399 var userObjectId = _.isString(target) ? target : target.id;
23400
23401 if (!userObjectId) {
23402 throw new Error('Invalid target user.');
23403 }
23404
23405 return getUserPointer(options).then(function (currUser) {
23406 var query = {};
23407 query.className = '_User';
23408 query.where = {
23409 objectId: userObjectId
23410 };
23411 var data = {};
23412 data.query = query;
23413 status.data = status.data || {};
23414 status.data.source = status.data.source || currUser;
23415 data.data = status._getDataJSON();
23416 data.inboxType = 'private';
23417 status.inboxType = 'private';
23418 var request = AVRequest('statuses', null, null, 'POST', data, options);
23419 return request.then(function (response) {
23420 status.id = response.objectId;
23421 status.createdAt = AV._parseDate(response.createdAt);
23422 return status;
23423 });
23424 });
23425 };
23426 /**
23427 * Count unread statuses in someone's inbox.
23428 * @since 0.3.0
23429 * @param {AV.User} owner The status owner.
23430 * @param {String} inboxType The inbox type, 'default' by default.
23431 * @param {AuthOptions} options
23432 * @return {Promise} A promise that is fulfilled when the count
23433 * completes.
23434 * @example
23435 * AV.Status.countUnreadStatuses(AV.User.current()).then(function(response){
23436 * console.log(response.unread); //unread statuses number.
23437 * console.log(response.total); //total statuses number.
23438 * });
23439 */
23440
23441
23442 AV.Status.countUnreadStatuses = function (owner) {
23443 var inboxType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
23444 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
23445 if (!_.isString(inboxType)) options = inboxType;
23446
23447 if (!getSessionToken(options) && owner == null && !AV.User.current()) {
23448 throw new Error('Please signin an user or pass the owner objectId.');
23449 }
23450
23451 return _promise.default.resolve(owner || getUser(options)).then(function (owner) {
23452 var params = {};
23453 params.inboxType = AV._encode(inboxType);
23454 params.owner = AV._encode(owner);
23455 return AVRequest('subscribe/statuses/count', null, null, 'GET', params, options);
23456 });
23457 };
23458 /**
23459 * reset unread statuses count in someone's inbox.
23460 * @since 2.1.0
23461 * @param {AV.User} owner The status owner.
23462 * @param {String} inboxType The inbox type, 'default' by default.
23463 * @param {AuthOptions} options
23464 * @return {Promise} A promise that is fulfilled when the reset
23465 * completes.
23466 * @example
23467 * AV.Status.resetUnreadCount(AV.User.current()).then(function(response){
23468 * console.log(response.unread); //unread statuses number.
23469 * console.log(response.total); //total statuses number.
23470 * });
23471 */
23472
23473
23474 AV.Status.resetUnreadCount = function (owner) {
23475 var inboxType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
23476 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
23477 if (!_.isString(inboxType)) options = inboxType;
23478
23479 if (!getSessionToken(options) && owner == null && !AV.User.current()) {
23480 throw new Error('Please signin an user or pass the owner objectId.');
23481 }
23482
23483 return _promise.default.resolve(owner || getUser(options)).then(function (owner) {
23484 var params = {};
23485 params.inboxType = AV._encode(inboxType);
23486 params.owner = AV._encode(owner);
23487 return AVRequest('subscribe/statuses/resetUnreadCount', null, null, 'POST', params, options);
23488 });
23489 };
23490 /**
23491 * Create a status query to find someone's published statuses.
23492 * @since 0.3.0
23493 * @param {AV.User} source The status source, typically the publisher.
23494 * @return {AV.Query} The query object for status.
23495 * @example
23496 * //Find current user's published statuses.
23497 * var query = AV.Status.statusQuery(AV.User.current());
23498 * query.find().then(function(statuses){
23499 * //process statuses
23500 * });
23501 */
23502
23503
23504 AV.Status.statusQuery = function (source) {
23505 var query = new AV.Query('_Status');
23506
23507 if (source) {
23508 query.equalTo('source', source);
23509 }
23510
23511 return query;
23512 };
23513 /**
23514 * <p>AV.InboxQuery defines a query that is used to fetch somebody's inbox statuses.</p>
23515 * @class
23516 */
23517
23518
23519 AV.InboxQuery = AV.Query._extend(
23520 /** @lends AV.InboxQuery.prototype */
23521 {
23522 _objectClass: AV.Status,
23523 _sinceId: 0,
23524 _maxId: 0,
23525 _inboxType: 'default',
23526 _owner: null,
23527 _newObject: function _newObject() {
23528 return new AV.Status();
23529 },
23530 _createRequest: function _createRequest(params, options) {
23531 return AV.InboxQuery.__super__._createRequest.call(this, params, options, '/subscribe/statuses');
23532 },
23533
23534 /**
23535 * Sets the messageId of results to skip before returning any results.
23536 * This is useful for pagination.
23537 * Default is zero.
23538 * @param {Number} n the mesage id.
23539 * @return {AV.InboxQuery} Returns the query, so you can chain this call.
23540 */
23541 sinceId: function sinceId(id) {
23542 this._sinceId = id;
23543 return this;
23544 },
23545
23546 /**
23547 * Sets the maximal messageId of results。
23548 * This is useful for pagination.
23549 * Default is zero that is no limition.
23550 * @param {Number} n the mesage id.
23551 * @return {AV.InboxQuery} Returns the query, so you can chain this call.
23552 */
23553 maxId: function maxId(id) {
23554 this._maxId = id;
23555 return this;
23556 },
23557
23558 /**
23559 * Sets the owner of the querying inbox.
23560 * @param {AV.User} owner The inbox owner.
23561 * @return {AV.InboxQuery} Returns the query, so you can chain this call.
23562 */
23563 owner: function owner(_owner) {
23564 this._owner = _owner;
23565 return this;
23566 },
23567
23568 /**
23569 * Sets the querying inbox type.default is 'default'.
23570 * @param {Object} type The inbox type.
23571 * @return {AV.InboxQuery} Returns the query, so you can chain this call.
23572 */
23573 inboxType: function inboxType(type) {
23574 this._inboxType = type;
23575 return this;
23576 },
23577 _getParams: function _getParams() {
23578 var params = AV.InboxQuery.__super__._getParams.call(this);
23579
23580 params.owner = AV._encode(this._owner);
23581 params.inboxType = AV._encode(this._inboxType);
23582 params.sinceId = AV._encode(this._sinceId);
23583 params.maxId = AV._encode(this._maxId);
23584 return params;
23585 }
23586 });
23587 /**
23588 * Create a inbox status query to find someone's inbox statuses.
23589 * @since 0.3.0
23590 * @param {AV.User} owner The inbox's owner
23591 * @param {String} inboxType The inbox type,'default' by default.
23592 * @return {AV.InboxQuery} The inbox query object.
23593 * @see AV.InboxQuery
23594 * @example
23595 * //Find current user's default inbox statuses.
23596 * var query = AV.Status.inboxQuery(AV.User.current());
23597 * //find the statuses after the last message id
23598 * query.sinceId(lastMessageId);
23599 * query.find().then(function(statuses){
23600 * //process statuses
23601 * });
23602 */
23603
23604 AV.Status.inboxQuery = function (owner, inboxType) {
23605 var query = new AV.InboxQuery(AV.Status);
23606
23607 if (owner) {
23608 query._owner = owner;
23609 }
23610
23611 if (inboxType) {
23612 query._inboxType = inboxType;
23613 }
23614
23615 return query;
23616 };
23617};
23618
23619/***/ }),
23620/* 535 */
23621/***/ (function(module, exports, __webpack_require__) {
23622
23623"use strict";
23624
23625
23626var _interopRequireDefault = __webpack_require__(2);
23627
23628var _stringify = _interopRequireDefault(__webpack_require__(34));
23629
23630var _map = _interopRequireDefault(__webpack_require__(39));
23631
23632var _ = __webpack_require__(1);
23633
23634var AVRequest = __webpack_require__(25)._request;
23635
23636module.exports = function (AV) {
23637 /**
23638 * A builder to generate sort string for app searching.For example:
23639 * @class
23640 * @since 0.5.1
23641 * @example
23642 * var builder = new AV.SearchSortBuilder();
23643 * builder.ascending('key1').descending('key2','max');
23644 * var query = new AV.SearchQuery('Player');
23645 * query.sortBy(builder);
23646 * query.find().then();
23647 */
23648 AV.SearchSortBuilder = function () {
23649 this._sortFields = [];
23650 };
23651
23652 _.extend(AV.SearchSortBuilder.prototype,
23653 /** @lends AV.SearchSortBuilder.prototype */
23654 {
23655 _addField: function _addField(key, order, mode, missing) {
23656 var field = {};
23657 field[key] = {
23658 order: order || 'asc',
23659 mode: mode || 'avg',
23660 missing: '_' + (missing || 'last')
23661 };
23662
23663 this._sortFields.push(field);
23664
23665 return this;
23666 },
23667
23668 /**
23669 * Sorts the results in ascending order by the given key and options.
23670 *
23671 * @param {String} key The key to order by.
23672 * @param {String} mode The sort mode, default is 'avg', you can choose
23673 * 'max' or 'min' too.
23674 * @param {String} missing The missing key behaviour, default is 'last',
23675 * you can choose 'first' too.
23676 * @return {AV.SearchSortBuilder} Returns the builder, so you can chain this call.
23677 */
23678 ascending: function ascending(key, mode, missing) {
23679 return this._addField(key, 'asc', mode, missing);
23680 },
23681
23682 /**
23683 * Sorts the results in descending order by the given key and options.
23684 *
23685 * @param {String} key The key to order by.
23686 * @param {String} mode The sort mode, default is 'avg', you can choose
23687 * 'max' or 'min' too.
23688 * @param {String} missing The missing key behaviour, default is 'last',
23689 * you can choose 'first' too.
23690 * @return {AV.SearchSortBuilder} Returns the builder, so you can chain this call.
23691 */
23692 descending: function descending(key, mode, missing) {
23693 return this._addField(key, 'desc', mode, missing);
23694 },
23695
23696 /**
23697 * Add a proximity based constraint for finding objects with key point
23698 * values near the point given.
23699 * @param {String} key The key that the AV.GeoPoint is stored in.
23700 * @param {AV.GeoPoint} point The reference AV.GeoPoint that is used.
23701 * @param {Object} options The other options such as mode,order, unit etc.
23702 * @return {AV.SearchSortBuilder} Returns the builder, so you can chain this call.
23703 */
23704 whereNear: function whereNear(key, point, options) {
23705 options = options || {};
23706 var field = {};
23707 var geo = {
23708 lat: point.latitude,
23709 lon: point.longitude
23710 };
23711 var m = {
23712 order: options.order || 'asc',
23713 mode: options.mode || 'avg',
23714 unit: options.unit || 'km'
23715 };
23716 m[key] = geo;
23717 field['_geo_distance'] = m;
23718
23719 this._sortFields.push(field);
23720
23721 return this;
23722 },
23723
23724 /**
23725 * Build a sort string by configuration.
23726 * @return {String} the sort string.
23727 */
23728 build: function build() {
23729 return (0, _stringify.default)(AV._encode(this._sortFields));
23730 }
23731 });
23732 /**
23733 * App searching query.Use just like AV.Query:
23734 *
23735 * Visit <a href='https://leancloud.cn/docs/app_search_guide.html'>App Searching Guide</a>
23736 * for more details.
23737 * @class
23738 * @since 0.5.1
23739 * @example
23740 * var query = new AV.SearchQuery('Player');
23741 * query.queryString('*');
23742 * query.find().then(function(results) {
23743 * console.log('Found %d objects', query.hits());
23744 * //Process results
23745 * });
23746 */
23747
23748
23749 AV.SearchQuery = AV.Query._extend(
23750 /** @lends AV.SearchQuery.prototype */
23751 {
23752 _sid: null,
23753 _hits: 0,
23754 _queryString: null,
23755 _highlights: null,
23756 _sortBuilder: null,
23757 _clazz: null,
23758 constructor: function constructor(className) {
23759 if (className) {
23760 this._clazz = className;
23761 } else {
23762 className = '__INVALID_CLASS';
23763 }
23764
23765 AV.Query.call(this, className);
23766 },
23767 _createRequest: function _createRequest(params, options) {
23768 return AVRequest('search/select', null, null, 'GET', params || this._getParams(), options);
23769 },
23770
23771 /**
23772 * Sets the sid of app searching query.Default is null.
23773 * @param {String} sid Scroll id for searching.
23774 * @return {AV.SearchQuery} Returns the query, so you can chain this call.
23775 */
23776 sid: function sid(_sid) {
23777 this._sid = _sid;
23778 return this;
23779 },
23780
23781 /**
23782 * Sets the query string of app searching.
23783 * @param {String} q The query string.
23784 * @return {AV.SearchQuery} Returns the query, so you can chain this call.
23785 */
23786 queryString: function queryString(q) {
23787 this._queryString = q;
23788 return this;
23789 },
23790
23791 /**
23792 * Sets the highlight fields. Such as
23793 * <pre><code>
23794 * query.highlights('title');
23795 * //or pass an array.
23796 * query.highlights(['title', 'content'])
23797 * </code></pre>
23798 * @param {String|String[]} highlights a list of fields.
23799 * @return {AV.SearchQuery} Returns the query, so you can chain this call.
23800 */
23801 highlights: function highlights(_highlights) {
23802 var objects;
23803
23804 if (_highlights && _.isString(_highlights)) {
23805 objects = _.toArray(arguments);
23806 } else {
23807 objects = _highlights;
23808 }
23809
23810 this._highlights = objects;
23811 return this;
23812 },
23813
23814 /**
23815 * Sets the sort builder for this query.
23816 * @see AV.SearchSortBuilder
23817 * @param { AV.SearchSortBuilder} builder The sort builder.
23818 * @return {AV.SearchQuery} Returns the query, so you can chain this call.
23819 *
23820 */
23821 sortBy: function sortBy(builder) {
23822 this._sortBuilder = builder;
23823 return this;
23824 },
23825
23826 /**
23827 * Returns the number of objects that match this query.
23828 * @return {Number}
23829 */
23830 hits: function hits() {
23831 if (!this._hits) {
23832 this._hits = 0;
23833 }
23834
23835 return this._hits;
23836 },
23837 _processResult: function _processResult(json) {
23838 delete json['className'];
23839 delete json['_app_url'];
23840 delete json['_deeplink'];
23841 return json;
23842 },
23843
23844 /**
23845 * Returns true when there are more documents can be retrieved by this
23846 * query instance, you can call find function to get more results.
23847 * @see AV.SearchQuery#find
23848 * @return {Boolean}
23849 */
23850 hasMore: function hasMore() {
23851 return !this._hitEnd;
23852 },
23853
23854 /**
23855 * Reset current query instance state(such as sid, hits etc) except params
23856 * for a new searching. After resetting, hasMore() will return true.
23857 */
23858 reset: function reset() {
23859 this._hitEnd = false;
23860 this._sid = null;
23861 this._hits = 0;
23862 },
23863
23864 /**
23865 * Retrieves a list of AVObjects that satisfy this query.
23866 * Either options.success or options.error is called when the find
23867 * completes.
23868 *
23869 * @see AV.Query#find
23870 * @param {AuthOptions} options
23871 * @return {Promise} A promise that is resolved with the results when
23872 * the query completes.
23873 */
23874 find: function find(options) {
23875 var self = this;
23876
23877 var request = this._createRequest(undefined, options);
23878
23879 return request.then(function (response) {
23880 //update sid for next querying.
23881 if (response.sid) {
23882 self._oldSid = self._sid;
23883 self._sid = response.sid;
23884 } else {
23885 self._sid = null;
23886 self._hitEnd = true;
23887 }
23888
23889 self._hits = response.hits || 0;
23890 return (0, _map.default)(_).call(_, response.results, function (json) {
23891 if (json.className) {
23892 response.className = json.className;
23893 }
23894
23895 var obj = self._newObject(response);
23896
23897 obj.appURL = json['_app_url'];
23898
23899 obj._finishFetch(self._processResult(json), true);
23900
23901 return obj;
23902 });
23903 });
23904 },
23905 _getParams: function _getParams() {
23906 var params = AV.SearchQuery.__super__._getParams.call(this);
23907
23908 delete params.where;
23909
23910 if (this._clazz) {
23911 params.clazz = this.className;
23912 }
23913
23914 if (this._sid) {
23915 params.sid = this._sid;
23916 }
23917
23918 if (!this._queryString) {
23919 throw new Error('Please set query string.');
23920 } else {
23921 params.q = this._queryString;
23922 }
23923
23924 if (this._highlights) {
23925 params.highlights = this._highlights.join(',');
23926 }
23927
23928 if (this._sortBuilder && params.order) {
23929 throw new Error('sort and order can not be set at same time.');
23930 }
23931
23932 if (this._sortBuilder) {
23933 params.sort = this._sortBuilder.build();
23934 }
23935
23936 return params;
23937 }
23938 });
23939};
23940/**
23941 * Sorts the results in ascending order by the given key.
23942 *
23943 * @method AV.SearchQuery#ascending
23944 * @param {String} key The key to order by.
23945 * @return {AV.SearchQuery} Returns the query, so you can chain this call.
23946 */
23947
23948/**
23949 * Also sorts the results in ascending order by the given key. The previous sort keys have
23950 * precedence over this key.
23951 *
23952 * @method AV.SearchQuery#addAscending
23953 * @param {String} key The key to order by
23954 * @return {AV.SearchQuery} Returns the query so you can chain this call.
23955 */
23956
23957/**
23958 * Sorts the results in descending order by the given key.
23959 *
23960 * @method AV.SearchQuery#descending
23961 * @param {String} key The key to order by.
23962 * @return {AV.SearchQuery} Returns the query, so you can chain this call.
23963 */
23964
23965/**
23966 * Also sorts the results in descending order by the given key. The previous sort keys have
23967 * precedence over this key.
23968 *
23969 * @method AV.SearchQuery#addDescending
23970 * @param {String} key The key to order by
23971 * @return {AV.SearchQuery} Returns the query so you can chain this call.
23972 */
23973
23974/**
23975 * Include nested AV.Objects for the provided key. You can use dot
23976 * notation to specify which fields in the included object are also fetch.
23977 * @method AV.SearchQuery#include
23978 * @param {String[]} keys The name of the key to include.
23979 * @return {AV.SearchQuery} Returns the query, so you can chain this call.
23980 */
23981
23982/**
23983 * Sets the number of results to skip before returning any results.
23984 * This is useful for pagination.
23985 * Default is to skip zero results.
23986 * @method AV.SearchQuery#skip
23987 * @param {Number} n the number of results to skip.
23988 * @return {AV.SearchQuery} Returns the query, so you can chain this call.
23989 */
23990
23991/**
23992 * Sets the limit of the number of results to return. The default limit is
23993 * 100, with a maximum of 1000 results being returned at a time.
23994 * @method AV.SearchQuery#limit
23995 * @param {Number} n the number of results to limit to.
23996 * @return {AV.SearchQuery} Returns the query, so you can chain this call.
23997 */
23998
23999/***/ }),
24000/* 536 */
24001/***/ (function(module, exports, __webpack_require__) {
24002
24003"use strict";
24004
24005
24006var _interopRequireDefault = __webpack_require__(2);
24007
24008var _promise = _interopRequireDefault(__webpack_require__(12));
24009
24010var _ = __webpack_require__(1);
24011
24012var AVError = __webpack_require__(40);
24013
24014var _require = __webpack_require__(25),
24015 request = _require.request;
24016
24017module.exports = function (AV) {
24018 /**
24019 * 包含了使用了 LeanCloud
24020 * <a href='/docs/leaninsight_guide.html'>离线数据分析功能</a>的函数。
24021 * <p><strong><em>
24022 * 仅在云引擎运行环境下有效。
24023 * </em></strong></p>
24024 * @namespace
24025 */
24026 AV.Insight = AV.Insight || {};
24027
24028 _.extend(AV.Insight,
24029 /** @lends AV.Insight */
24030 {
24031 /**
24032 * 开始一个 Insight 任务。结果里将返回 Job id,你可以拿得到的 id 使用
24033 * AV.Insight.JobQuery 查询任务状态和结果。
24034 * @param {Object} jobConfig 任务配置的 JSON 对象,例如:<code><pre>
24035 * { "sql" : "select count(*) as c,gender from _User group by gender",
24036 * "saveAs": {
24037 * "className" : "UserGender",
24038 * "limit": 1
24039 * }
24040 * }
24041 * </pre></code>
24042 * sql 指定任务执行的 SQL 语句, saveAs(可选) 指定将结果保存在哪张表里,limit 最大 1000。
24043 * @param {AuthOptions} [options]
24044 * @return {Promise} A promise that will be resolved with the result
24045 * of the function.
24046 */
24047 startJob: function startJob(jobConfig, options) {
24048 if (!jobConfig || !jobConfig.sql) {
24049 throw new Error('Please provide the sql to run the job.');
24050 }
24051
24052 var data = {
24053 jobConfig: jobConfig,
24054 appId: AV.applicationId
24055 };
24056 return request({
24057 path: '/bigquery/jobs',
24058 method: 'POST',
24059 data: AV._encode(data, null, true),
24060 authOptions: options,
24061 signKey: false
24062 }).then(function (resp) {
24063 return AV._decode(resp).id;
24064 });
24065 },
24066
24067 /**
24068 * 监听 Insight 任务事件(未来推出独立部署的离线分析服务后开放)
24069 * <p><strong><em>
24070 * 仅在云引擎运行环境下有效。
24071 * </em></strong></p>
24072 * @param {String} event 监听的事件,目前尚不支持。
24073 * @param {Function} 监听回调函数,接收 (err, id) 两个参数,err 表示错误信息,
24074 * id 表示任务 id。接下来你可以拿这个 id 使用AV.Insight.JobQuery 查询任务状态和结果。
24075 *
24076 */
24077 on: function on(event, cb) {}
24078 });
24079 /**
24080 * 创建一个对象,用于查询 Insight 任务状态和结果。
24081 * @class
24082 * @param {String} id 任务 id
24083 * @since 0.5.5
24084 */
24085
24086
24087 AV.Insight.JobQuery = function (id, className) {
24088 if (!id) {
24089 throw new Error('Please provide the job id.');
24090 }
24091
24092 this.id = id;
24093 this.className = className;
24094 this._skip = 0;
24095 this._limit = 100;
24096 };
24097
24098 _.extend(AV.Insight.JobQuery.prototype,
24099 /** @lends AV.Insight.JobQuery.prototype */
24100 {
24101 /**
24102 * Sets the number of results to skip before returning any results.
24103 * This is useful for pagination.
24104 * Default is to skip zero results.
24105 * @param {Number} n the number of results to skip.
24106 * @return {AV.Query} Returns the query, so you can chain this call.
24107 */
24108 skip: function skip(n) {
24109 this._skip = n;
24110 return this;
24111 },
24112
24113 /**
24114 * Sets the limit of the number of results to return. The default limit is
24115 * 100, with a maximum of 1000 results being returned at a time.
24116 * @param {Number} n the number of results to limit to.
24117 * @return {AV.Query} Returns the query, so you can chain this call.
24118 */
24119 limit: function limit(n) {
24120 this._limit = n;
24121 return this;
24122 },
24123
24124 /**
24125 * 查询任务状态和结果,任务结果为一个 JSON 对象,包括 status 表示任务状态, totalCount 表示总数,
24126 * results 数组表示任务结果数组,previewCount 表示可以返回的结果总数,任务的开始和截止时间
24127 * startTime、endTime 等信息。
24128 *
24129 * @param {AuthOptions} [options]
24130 * @return {Promise} A promise that will be resolved with the result
24131 * of the function.
24132 *
24133 */
24134 find: function find(options) {
24135 var params = {
24136 skip: this._skip,
24137 limit: this._limit
24138 };
24139 return request({
24140 path: "/bigquery/jobs/".concat(this.id),
24141 method: 'GET',
24142 query: params,
24143 authOptions: options,
24144 signKey: false
24145 }).then(function (response) {
24146 if (response.error) {
24147 return _promise.default.reject(new AVError(response.code, response.error));
24148 }
24149
24150 return _promise.default.resolve(response);
24151 });
24152 }
24153 });
24154};
24155
24156/***/ }),
24157/* 537 */
24158/***/ (function(module, exports, __webpack_require__) {
24159
24160"use strict";
24161
24162
24163var _ = __webpack_require__(1);
24164
24165var _require = __webpack_require__(25),
24166 LCRequest = _require.request;
24167
24168var _require2 = __webpack_require__(28),
24169 getSessionToken = _require2.getSessionToken;
24170
24171module.exports = function (AV) {
24172 /**
24173 * Contains functions to deal with Friendship in LeanCloud.
24174 * @class
24175 */
24176 AV.Friendship = {
24177 /**
24178 * Request friendship.
24179 * @since 4.8.0
24180 * @param {String | AV.User | Object} options if an AV.User or string is given, it will be used as the friend.
24181 * @param {AV.User | string} options.friend The friend (or friend's objectId) to follow.
24182 * @param {Object} [options.attributes] key-value attributes dictionary to be used as conditions of followeeQuery.
24183 * @param {*} [authOptions]
24184 * @return {Promise<void>}
24185 */
24186 request: function request(options, authOptions) {
24187 if (!AV.User.current()) {
24188 throw new Error('Please signin an user.');
24189 }
24190
24191 var friend;
24192 var attributes;
24193
24194 if (options.friend) {
24195 friend = options.friend;
24196 attributes = options.attributes;
24197 } else {
24198 friend = options;
24199 }
24200
24201 var friendObject = _.isString(friend) ? AV.Object.createWithoutData('_User', friend) : friend;
24202 return LCRequest({
24203 method: 'POST',
24204 path: '/users/friendshipRequests',
24205 data: AV._encode({
24206 user: AV.User.current(),
24207 friend: friendObject,
24208 friendship: attributes
24209 }),
24210 authOptions: authOptions
24211 });
24212 },
24213
24214 /**
24215 * Accept a friendship request.
24216 * @since 4.8.0
24217 * @param {AV.Object | string | Object} options if an AV.Object or string is given, it will be used as the request in _FriendshipRequest.
24218 * @param {AV.Object} options.request The request (or it's objectId) to be accepted.
24219 * @param {Object} [options.attributes] key-value attributes dictionary to be used as conditions of {@link AV#followeeQuery}.
24220 * @param {AuthOptions} [authOptions]
24221 * @return {Promise<void>}
24222 */
24223 acceptRequest: function acceptRequest(options) {
24224 var authOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
24225
24226 if (!getSessionToken(authOptions) && !AV.User.current()) {
24227 throw new Error('Please signin an user.');
24228 }
24229
24230 var request;
24231 var attributes;
24232
24233 if (options.request) {
24234 request = options.request;
24235 attributes = options.attributes;
24236 } else {
24237 request = options;
24238 }
24239
24240 var requestId = _.isString(request) ? request : request.id;
24241 return LCRequest({
24242 method: 'PUT',
24243 path: '/users/friendshipRequests/' + requestId + '/accept',
24244 data: {
24245 friendship: AV._encode(attributes)
24246 },
24247 authOptions: authOptions
24248 });
24249 },
24250
24251 /**
24252 * Decline a friendship request.
24253 * @param {AV.Object | string} request The request (or it's objectId) to be declined.
24254 * @param {AuthOptions} [authOptions]
24255 * @return {Promise<void>}
24256 */
24257 declineRequest: function declineRequest(request) {
24258 var authOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
24259
24260 if (!getSessionToken(authOptions) && !AV.User.current()) {
24261 throw new Error('Please signin an user.');
24262 }
24263
24264 var requestId = _.isString(request) ? request : request.id;
24265 return LCRequest({
24266 method: 'PUT',
24267 path: '/users/friendshipRequests/' + requestId + '/decline',
24268 authOptions: authOptions
24269 });
24270 }
24271 };
24272};
24273
24274/***/ }),
24275/* 538 */
24276/***/ (function(module, exports, __webpack_require__) {
24277
24278"use strict";
24279
24280
24281var _interopRequireDefault = __webpack_require__(2);
24282
24283var _stringify = _interopRequireDefault(__webpack_require__(34));
24284
24285var _ = __webpack_require__(1);
24286
24287var _require = __webpack_require__(25),
24288 _request = _require._request;
24289
24290var AV = __webpack_require__(59);
24291
24292var serializeMessage = function serializeMessage(message) {
24293 if (typeof message === 'string') {
24294 return message;
24295 }
24296
24297 if (typeof message.getPayload === 'function') {
24298 return (0, _stringify.default)(message.getPayload());
24299 }
24300
24301 return (0, _stringify.default)(message);
24302};
24303/**
24304 * <p>An AV.Conversation is a local representation of a LeanCloud realtime's
24305 * conversation. This class is a subclass of AV.Object, and retains the
24306 * same functionality of an AV.Object, but also extends it with various
24307 * conversation specific methods, like get members, creators of this conversation.
24308 * </p>
24309 *
24310 * @class AV.Conversation
24311 * @param {String} name The name of the Role to create.
24312 * @param {Object} [options]
24313 * @param {Boolean} [options.isSystem] Set this conversation as system conversation.
24314 * @param {Boolean} [options.isTransient] Set this conversation as transient conversation.
24315 */
24316
24317
24318module.exports = AV.Object.extend('_Conversation',
24319/** @lends AV.Conversation.prototype */
24320{
24321 constructor: function constructor(name) {
24322 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
24323 AV.Object.prototype.constructor.call(this, null, null);
24324 this.set('name', name);
24325
24326 if (options.isSystem !== undefined) {
24327 this.set('sys', options.isSystem ? true : false);
24328 }
24329
24330 if (options.isTransient !== undefined) {
24331 this.set('tr', options.isTransient ? true : false);
24332 }
24333 },
24334
24335 /**
24336 * Get current conversation's creator.
24337 *
24338 * @return {String}
24339 */
24340 getCreator: function getCreator() {
24341 return this.get('c');
24342 },
24343
24344 /**
24345 * Get the last message's time.
24346 *
24347 * @return {Date}
24348 */
24349 getLastMessageAt: function getLastMessageAt() {
24350 return this.get('lm');
24351 },
24352
24353 /**
24354 * Get this conversation's members
24355 *
24356 * @return {String[]}
24357 */
24358 getMembers: function getMembers() {
24359 return this.get('m');
24360 },
24361
24362 /**
24363 * Add a member to this conversation
24364 *
24365 * @param {String} member
24366 */
24367 addMember: function addMember(member) {
24368 return this.add('m', member);
24369 },
24370
24371 /**
24372 * Get this conversation's members who set this conversation as muted.
24373 *
24374 * @return {String[]}
24375 */
24376 getMutedMembers: function getMutedMembers() {
24377 return this.get('mu');
24378 },
24379
24380 /**
24381 * Get this conversation's name field.
24382 *
24383 * @return String
24384 */
24385 getName: function getName() {
24386 return this.get('name');
24387 },
24388
24389 /**
24390 * Returns true if this conversation is transient conversation.
24391 *
24392 * @return {Boolean}
24393 */
24394 isTransient: function isTransient() {
24395 return this.get('tr');
24396 },
24397
24398 /**
24399 * Returns true if this conversation is system conversation.
24400 *
24401 * @return {Boolean}
24402 */
24403 isSystem: function isSystem() {
24404 return this.get('sys');
24405 },
24406
24407 /**
24408 * Send realtime message to this conversation, using HTTP request.
24409 *
24410 * @param {String} fromClient Sender's client id.
24411 * @param {String|Object} message The message which will send to conversation.
24412 * It could be a raw string, or an object with a `toJSON` method, like a
24413 * realtime SDK's Message object. See more: {@link https://leancloud.cn/docs/realtime_guide-js.html#消息}
24414 * @param {Object} [options]
24415 * @param {Boolean} [options.transient] Whether send this message as transient message or not.
24416 * @param {String[]} [options.toClients] Ids of clients to send to. This option can be used only in system conversation.
24417 * @param {Object} [options.pushData] Push data to this message. See more: {@link https://url.leanapp.cn/pushData 推送消息内容}
24418 * @param {AuthOptions} [authOptions]
24419 * @return {Promise}
24420 */
24421 send: function send(fromClient, message) {
24422 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
24423 var authOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
24424 var data = {
24425 from_peer: fromClient,
24426 conv_id: this.id,
24427 transient: false,
24428 message: serializeMessage(message)
24429 };
24430
24431 if (options.toClients !== undefined) {
24432 data.to_peers = options.toClients;
24433 }
24434
24435 if (options.transient !== undefined) {
24436 data.transient = options.transient ? true : false;
24437 }
24438
24439 if (options.pushData !== undefined) {
24440 data.push_data = options.pushData;
24441 }
24442
24443 return _request('rtm', 'messages', null, 'POST', data, authOptions);
24444 },
24445
24446 /**
24447 * Send realtime broadcast message to all clients, via this conversation, using HTTP request.
24448 *
24449 * @param {String} fromClient Sender's client id.
24450 * @param {String|Object} message The message which will send to conversation.
24451 * It could be a raw string, or an object with a `toJSON` method, like a
24452 * realtime SDK's Message object. See more: {@link https://leancloud.cn/docs/realtime_guide-js.html#消息}.
24453 * @param {Object} [options]
24454 * @param {Object} [options.pushData] Push data to this message. See more: {@link https://url.leanapp.cn/pushData 推送消息内容}.
24455 * @param {Object} [options.validTill] The message will valid till this time.
24456 * @param {AuthOptions} [authOptions]
24457 * @return {Promise}
24458 */
24459 broadcast: function broadcast(fromClient, message) {
24460 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
24461 var authOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
24462 var data = {
24463 from_peer: fromClient,
24464 conv_id: this.id,
24465 message: serializeMessage(message)
24466 };
24467
24468 if (options.pushData !== undefined) {
24469 data.push = options.pushData;
24470 }
24471
24472 if (options.validTill !== undefined) {
24473 var ts = options.validTill;
24474
24475 if (_.isDate(ts)) {
24476 ts = ts.getTime();
24477 }
24478
24479 options.valid_till = ts;
24480 }
24481
24482 return _request('rtm', 'broadcast', null, 'POST', data, authOptions);
24483 }
24484});
24485
24486/***/ }),
24487/* 539 */
24488/***/ (function(module, exports, __webpack_require__) {
24489
24490"use strict";
24491
24492
24493var _interopRequireDefault = __webpack_require__(2);
24494
24495var _promise = _interopRequireDefault(__webpack_require__(12));
24496
24497var _map = _interopRequireDefault(__webpack_require__(39));
24498
24499var _concat = _interopRequireDefault(__webpack_require__(29));
24500
24501var _ = __webpack_require__(1);
24502
24503var _require = __webpack_require__(25),
24504 request = _require.request;
24505
24506var _require2 = __webpack_require__(28),
24507 ensureArray = _require2.ensureArray,
24508 parseDate = _require2.parseDate;
24509
24510var AV = __webpack_require__(59);
24511/**
24512 * The version change interval for Leaderboard
24513 * @enum
24514 */
24515
24516
24517AV.LeaderboardVersionChangeInterval = {
24518 NEVER: 'never',
24519 DAY: 'day',
24520 WEEK: 'week',
24521 MONTH: 'month'
24522};
24523/**
24524 * The order of the leaderboard results
24525 * @enum
24526 */
24527
24528AV.LeaderboardOrder = {
24529 ASCENDING: 'ascending',
24530 DESCENDING: 'descending'
24531};
24532/**
24533 * The update strategy for Leaderboard
24534 * @enum
24535 */
24536
24537AV.LeaderboardUpdateStrategy = {
24538 /** Only keep the best statistic. If the leaderboard is in descending order, the best statistic is the highest one. */
24539 BETTER: 'better',
24540
24541 /** Keep the last updated statistic */
24542 LAST: 'last',
24543
24544 /** Keep the sum of all updated statistics */
24545 SUM: 'sum'
24546};
24547/**
24548 * @typedef {Object} Ranking
24549 * @property {number} rank Starts at 0
24550 * @property {number} value the statistic value of this ranking
24551 * @property {AV.User} user The user of this ranking
24552 * @property {Statistic[]} [includedStatistics] Other statistics of the user, specified by the `includeStatistic` option of `AV.Leaderboard.getResults()`
24553 */
24554
24555/**
24556 * @typedef {Object} LeaderboardArchive
24557 * @property {string} statisticName
24558 * @property {number} version version of the leaderboard
24559 * @property {string} status
24560 * @property {string} url URL for the downloadable archive
24561 * @property {Date} activatedAt time when this version became active
24562 * @property {Date} deactivatedAt time when this version was deactivated by a version incrementing
24563 */
24564
24565/**
24566 * @class
24567 */
24568
24569function Statistic(_ref) {
24570 var name = _ref.name,
24571 value = _ref.value,
24572 version = _ref.version;
24573
24574 /**
24575 * @type {string}
24576 */
24577 this.name = name;
24578 /**
24579 * @type {number}
24580 */
24581
24582 this.value = value;
24583 /**
24584 * @type {number?}
24585 */
24586
24587 this.version = version;
24588}
24589
24590var parseStatisticData = function parseStatisticData(statisticData) {
24591 var _AV$_decode = AV._decode(statisticData),
24592 name = _AV$_decode.statisticName,
24593 value = _AV$_decode.statisticValue,
24594 version = _AV$_decode.version;
24595
24596 return new Statistic({
24597 name: name,
24598 value: value,
24599 version: version
24600 });
24601};
24602/**
24603 * @class
24604 */
24605
24606
24607AV.Leaderboard = function Leaderboard(statisticName) {
24608 /**
24609 * @type {string}
24610 */
24611 this.statisticName = statisticName;
24612 /**
24613 * @type {AV.LeaderboardOrder}
24614 */
24615
24616 this.order = undefined;
24617 /**
24618 * @type {AV.LeaderboardUpdateStrategy}
24619 */
24620
24621 this.updateStrategy = undefined;
24622 /**
24623 * @type {AV.LeaderboardVersionChangeInterval}
24624 */
24625
24626 this.versionChangeInterval = undefined;
24627 /**
24628 * @type {number}
24629 */
24630
24631 this.version = undefined;
24632 /**
24633 * @type {Date?}
24634 */
24635
24636 this.nextResetAt = undefined;
24637 /**
24638 * @type {Date?}
24639 */
24640
24641 this.createdAt = undefined;
24642};
24643
24644var Leaderboard = AV.Leaderboard;
24645/**
24646 * Create an instance of Leaderboard for the give statistic name.
24647 * @param {string} statisticName
24648 * @return {AV.Leaderboard}
24649 */
24650
24651AV.Leaderboard.createWithoutData = function (statisticName) {
24652 return new Leaderboard(statisticName);
24653};
24654/**
24655 * (masterKey required) Create a new Leaderboard.
24656 * @param {Object} options
24657 * @param {string} options.statisticName
24658 * @param {AV.LeaderboardOrder} options.order
24659 * @param {AV.LeaderboardVersionChangeInterval} [options.versionChangeInterval] default to WEEK
24660 * @param {AV.LeaderboardUpdateStrategy} [options.updateStrategy] default to BETTER
24661 * @param {AuthOptions} [authOptions]
24662 * @return {Promise<AV.Leaderboard>}
24663 */
24664
24665
24666AV.Leaderboard.createLeaderboard = function (_ref2, authOptions) {
24667 var statisticName = _ref2.statisticName,
24668 order = _ref2.order,
24669 versionChangeInterval = _ref2.versionChangeInterval,
24670 updateStrategy = _ref2.updateStrategy;
24671 return request({
24672 method: 'POST',
24673 path: '/leaderboard/leaderboards',
24674 data: {
24675 statisticName: statisticName,
24676 order: order,
24677 versionChangeInterval: versionChangeInterval,
24678 updateStrategy: updateStrategy
24679 },
24680 authOptions: authOptions
24681 }).then(function (data) {
24682 var leaderboard = new Leaderboard(statisticName);
24683 return leaderboard._finishFetch(data);
24684 });
24685};
24686/**
24687 * Get the Leaderboard with the specified statistic name.
24688 * @param {string} statisticName
24689 * @param {AuthOptions} [authOptions]
24690 * @return {Promise<AV.Leaderboard>}
24691 */
24692
24693
24694AV.Leaderboard.getLeaderboard = function (statisticName, authOptions) {
24695 return Leaderboard.createWithoutData(statisticName).fetch(authOptions);
24696};
24697/**
24698 * Get Statistics for the specified user.
24699 * @param {AV.User} user The specified AV.User pointer.
24700 * @param {Object} [options]
24701 * @param {string[]} [options.statisticNames] Specify the statisticNames. If not set, all statistics of the user will be fetched.
24702 * @param {AuthOptions} [authOptions]
24703 * @return {Promise<Statistic[]>}
24704 */
24705
24706
24707AV.Leaderboard.getStatistics = function (user) {
24708 var _ref3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
24709 statisticNames = _ref3.statisticNames;
24710
24711 var authOptions = arguments.length > 2 ? arguments[2] : undefined;
24712 return _promise.default.resolve().then(function () {
24713 if (!(user && user.id)) throw new Error('user must be an AV.User');
24714 return request({
24715 method: 'GET',
24716 path: "/leaderboard/users/".concat(user.id, "/statistics"),
24717 query: {
24718 statistics: statisticNames ? ensureArray(statisticNames).join(',') : undefined
24719 },
24720 authOptions: authOptions
24721 }).then(function (_ref4) {
24722 var results = _ref4.results;
24723 return (0, _map.default)(results).call(results, parseStatisticData);
24724 });
24725 });
24726};
24727/**
24728 * Update Statistics for the specified user.
24729 * @param {AV.User} user The specified AV.User pointer.
24730 * @param {Object} statistics A name-value pair representing the statistics to update.
24731 * @param {AuthOptions} [options] AuthOptions plus:
24732 * @param {boolean} [options.overwrite] Wethere to overwrite these statistics disregarding the updateStrategy of there leaderboards
24733 * @return {Promise<Statistic[]>}
24734 */
24735
24736
24737AV.Leaderboard.updateStatistics = function (user, statistics) {
24738 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
24739 return _promise.default.resolve().then(function () {
24740 if (!(user && user.id)) throw new Error('user must be an AV.User');
24741 var data = (0, _map.default)(_).call(_, statistics, function (value, key) {
24742 return {
24743 statisticName: key,
24744 statisticValue: value
24745 };
24746 });
24747 var overwrite = options.overwrite;
24748 return request({
24749 method: 'POST',
24750 path: "/leaderboard/users/".concat(user.id, "/statistics"),
24751 query: {
24752 overwrite: overwrite ? 1 : undefined
24753 },
24754 data: data,
24755 authOptions: options
24756 }).then(function (_ref5) {
24757 var results = _ref5.results;
24758 return (0, _map.default)(results).call(results, parseStatisticData);
24759 });
24760 });
24761};
24762/**
24763 * Delete Statistics for the specified user.
24764 * @param {AV.User} user The specified AV.User pointer.
24765 * @param {Object} statistics A name-value pair representing the statistics to delete.
24766 * @param {AuthOptions} [options]
24767 * @return {Promise<void>}
24768 */
24769
24770
24771AV.Leaderboard.deleteStatistics = function (user, statisticNames, authOptions) {
24772 return _promise.default.resolve().then(function () {
24773 if (!(user && user.id)) throw new Error('user must be an AV.User');
24774 return request({
24775 method: 'DELETE',
24776 path: "/leaderboard/users/".concat(user.id, "/statistics"),
24777 query: {
24778 statistics: ensureArray(statisticNames).join(',')
24779 },
24780 authOptions: authOptions
24781 }).then(function () {
24782 return undefined;
24783 });
24784 });
24785};
24786
24787_.extend(Leaderboard.prototype,
24788/** @lends AV.Leaderboard.prototype */
24789{
24790 _finishFetch: function _finishFetch(data) {
24791 var _this = this;
24792
24793 _.forEach(data, function (value, key) {
24794 if (key === 'updatedAt' || key === 'objectId') return;
24795
24796 if (key === 'expiredAt') {
24797 key = 'nextResetAt';
24798 }
24799
24800 if (key === 'createdAt') {
24801 value = parseDate(value);
24802 }
24803
24804 if (value && value.__type === 'Date') {
24805 value = parseDate(value.iso);
24806 }
24807
24808 _this[key] = value;
24809 });
24810
24811 return this;
24812 },
24813
24814 /**
24815 * Fetch data from the srever.
24816 * @param {AuthOptions} [authOptions]
24817 * @return {Promise<AV.Leaderboard>}
24818 */
24819 fetch: function fetch(authOptions) {
24820 var _this2 = this;
24821
24822 return request({
24823 method: 'GET',
24824 path: "/leaderboard/leaderboards/".concat(this.statisticName),
24825 authOptions: authOptions
24826 }).then(function (data) {
24827 return _this2._finishFetch(data);
24828 });
24829 },
24830
24831 /**
24832 * Counts the number of users participated in this leaderboard
24833 * @param {Object} [options]
24834 * @param {number} [options.version] Specify the version of the leaderboard
24835 * @param {AuthOptions} [authOptions]
24836 * @return {Promise<number>}
24837 */
24838 count: function count() {
24839 var _ref6 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
24840 version = _ref6.version;
24841
24842 var authOptions = arguments.length > 1 ? arguments[1] : undefined;
24843 return request({
24844 method: 'GET',
24845 path: "/leaderboard/leaderboards/".concat(this.statisticName, "/ranks"),
24846 query: {
24847 count: 1,
24848 limit: 0,
24849 version: version
24850 },
24851 authOptions: authOptions
24852 }).then(function (_ref7) {
24853 var count = _ref7.count;
24854 return count;
24855 });
24856 },
24857 _getResults: function _getResults(_ref8, authOptions, userId) {
24858 var _context;
24859
24860 var skip = _ref8.skip,
24861 limit = _ref8.limit,
24862 selectUserKeys = _ref8.selectUserKeys,
24863 includeUserKeys = _ref8.includeUserKeys,
24864 includeStatistics = _ref8.includeStatistics,
24865 version = _ref8.version;
24866 return request({
24867 method: 'GET',
24868 path: (0, _concat.default)(_context = "/leaderboard/leaderboards/".concat(this.statisticName, "/ranks")).call(_context, userId ? "/".concat(userId) : ''),
24869 query: {
24870 skip: skip,
24871 limit: limit,
24872 selectUserKeys: _.union(ensureArray(selectUserKeys), ensureArray(includeUserKeys)).join(',') || undefined,
24873 includeUser: includeUserKeys ? ensureArray(includeUserKeys).join(',') : undefined,
24874 includeStatistics: includeStatistics ? ensureArray(includeStatistics).join(',') : undefined,
24875 version: version
24876 },
24877 authOptions: authOptions
24878 }).then(function (_ref9) {
24879 var rankings = _ref9.results;
24880 return (0, _map.default)(rankings).call(rankings, function (rankingData) {
24881 var _AV$_decode2 = AV._decode(rankingData),
24882 user = _AV$_decode2.user,
24883 value = _AV$_decode2.statisticValue,
24884 rank = _AV$_decode2.rank,
24885 _AV$_decode2$statisti = _AV$_decode2.statistics,
24886 statistics = _AV$_decode2$statisti === void 0 ? [] : _AV$_decode2$statisti;
24887
24888 return {
24889 user: user,
24890 value: value,
24891 rank: rank,
24892 includedStatistics: (0, _map.default)(statistics).call(statistics, parseStatisticData)
24893 };
24894 });
24895 });
24896 },
24897
24898 /**
24899 * Retrieve a list of ranked users for this Leaderboard.
24900 * @param {Object} [options]
24901 * @param {number} [options.skip] The number of results to skip. This is useful for pagination.
24902 * @param {number} [options.limit] The limit of the number of results.
24903 * @param {string[]} [options.selectUserKeys] Specify keys of the users to include in the Rankings
24904 * @param {string[]} [options.includeUserKeys] If the value of a selected user keys is a Pointer, use this options to include its value.
24905 * @param {string[]} [options.includeStatistics] Specify other statistics to include in the Rankings
24906 * @param {number} [options.version] Specify the version of the leaderboard
24907 * @param {AuthOptions} [authOptions]
24908 * @return {Promise<Ranking[]>}
24909 */
24910 getResults: function getResults() {
24911 var _ref10 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
24912 skip = _ref10.skip,
24913 limit = _ref10.limit,
24914 selectUserKeys = _ref10.selectUserKeys,
24915 includeUserKeys = _ref10.includeUserKeys,
24916 includeStatistics = _ref10.includeStatistics,
24917 version = _ref10.version;
24918
24919 var authOptions = arguments.length > 1 ? arguments[1] : undefined;
24920 return this._getResults({
24921 skip: skip,
24922 limit: limit,
24923 selectUserKeys: selectUserKeys,
24924 includeUserKeys: includeUserKeys,
24925 includeStatistics: includeStatistics,
24926 version: version
24927 }, authOptions);
24928 },
24929
24930 /**
24931 * Retrieve a list of ranked users for this Leaderboard, centered on the specified user.
24932 * @param {AV.User} user The specified AV.User pointer.
24933 * @param {Object} [options]
24934 * @param {number} [options.limit] The limit of the number of results.
24935 * @param {string[]} [options.selectUserKeys] Specify keys of the users to include in the Rankings
24936 * @param {string[]} [options.includeUserKeys] If the value of a selected user keys is a Pointer, use this options to include its value.
24937 * @param {string[]} [options.includeStatistics] Specify other statistics to include in the Rankings
24938 * @param {number} [options.version] Specify the version of the leaderboard
24939 * @param {AuthOptions} [authOptions]
24940 * @return {Promise<Ranking[]>}
24941 */
24942 getResultsAroundUser: function getResultsAroundUser(user) {
24943 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
24944 var authOptions = arguments.length > 2 ? arguments[2] : undefined;
24945
24946 // getResultsAroundUser(options, authOptions)
24947 if (user && typeof user.id !== 'string') {
24948 return this.getResultsAroundUser(undefined, user, options);
24949 }
24950
24951 var limit = options.limit,
24952 selectUserKeys = options.selectUserKeys,
24953 includeUserKeys = options.includeUserKeys,
24954 includeStatistics = options.includeStatistics,
24955 version = options.version;
24956 return this._getResults({
24957 limit: limit,
24958 selectUserKeys: selectUserKeys,
24959 includeUserKeys: includeUserKeys,
24960 includeStatistics: includeStatistics,
24961 version: version
24962 }, authOptions, user ? user.id : 'self');
24963 },
24964 _update: function _update(data, authOptions) {
24965 var _this3 = this;
24966
24967 return request({
24968 method: 'PUT',
24969 path: "/leaderboard/leaderboards/".concat(this.statisticName),
24970 data: data,
24971 authOptions: authOptions
24972 }).then(function (result) {
24973 return _this3._finishFetch(result);
24974 });
24975 },
24976
24977 /**
24978 * (masterKey required) Update the version change interval of the Leaderboard.
24979 * @param {AV.LeaderboardVersionChangeInterval} versionChangeInterval
24980 * @param {AuthOptions} [authOptions]
24981 * @return {Promise<AV.Leaderboard>}
24982 */
24983 updateVersionChangeInterval: function updateVersionChangeInterval(versionChangeInterval, authOptions) {
24984 return this._update({
24985 versionChangeInterval: versionChangeInterval
24986 }, authOptions);
24987 },
24988
24989 /**
24990 * (masterKey required) Update the version change interval of the Leaderboard.
24991 * @param {AV.LeaderboardUpdateStrategy} updateStrategy
24992 * @param {AuthOptions} [authOptions]
24993 * @return {Promise<AV.Leaderboard>}
24994 */
24995 updateUpdateStrategy: function updateUpdateStrategy(updateStrategy, authOptions) {
24996 return this._update({
24997 updateStrategy: updateStrategy
24998 }, authOptions);
24999 },
25000
25001 /**
25002 * (masterKey required) Reset the Leaderboard. The version of the Leaderboard will be incremented by 1.
25003 * @param {AuthOptions} [authOptions]
25004 * @return {Promise<AV.Leaderboard>}
25005 */
25006 reset: function reset(authOptions) {
25007 var _this4 = this;
25008
25009 return request({
25010 method: 'PUT',
25011 path: "/leaderboard/leaderboards/".concat(this.statisticName, "/incrementVersion"),
25012 authOptions: authOptions
25013 }).then(function (data) {
25014 return _this4._finishFetch(data);
25015 });
25016 },
25017
25018 /**
25019 * (masterKey required) Delete the Leaderboard and its all archived versions.
25020 * @param {AuthOptions} [authOptions]
25021 * @return {void}
25022 */
25023 destroy: function destroy(authOptions) {
25024 return AV.request({
25025 method: 'DELETE',
25026 path: "/leaderboard/leaderboards/".concat(this.statisticName),
25027 authOptions: authOptions
25028 }).then(function () {
25029 return undefined;
25030 });
25031 },
25032
25033 /**
25034 * (masterKey required) Get archived versions.
25035 * @param {Object} [options]
25036 * @param {number} [options.skip] The number of results to skip. This is useful for pagination.
25037 * @param {number} [options.limit] The limit of the number of results.
25038 * @param {AuthOptions} [authOptions]
25039 * @return {Promise<LeaderboardArchive[]>}
25040 */
25041 getArchives: function getArchives() {
25042 var _this5 = this;
25043
25044 var _ref11 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
25045 skip = _ref11.skip,
25046 limit = _ref11.limit;
25047
25048 var authOptions = arguments.length > 1 ? arguments[1] : undefined;
25049 return request({
25050 method: 'GET',
25051 path: "/leaderboard/leaderboards/".concat(this.statisticName, "/archives"),
25052 query: {
25053 skip: skip,
25054 limit: limit
25055 },
25056 authOptions: authOptions
25057 }).then(function (_ref12) {
25058 var results = _ref12.results;
25059 return (0, _map.default)(results).call(results, function (_ref13) {
25060 var version = _ref13.version,
25061 status = _ref13.status,
25062 url = _ref13.url,
25063 activatedAt = _ref13.activatedAt,
25064 deactivatedAt = _ref13.deactivatedAt;
25065 return {
25066 statisticName: _this5.statisticName,
25067 version: version,
25068 status: status,
25069 url: url,
25070 activatedAt: parseDate(activatedAt.iso),
25071 deactivatedAt: parseDate(deactivatedAt.iso)
25072 };
25073 });
25074 });
25075 }
25076});
25077
25078/***/ })
25079/******/ ]);
25080});
25081//# sourceMappingURL=av-core.js.map
\No newline at end of file