1 | var _typeof = require("./typeof.js")["default"];
|
2 | var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
|
3 | var _Symbol = require("@babel/runtime-corejs2/core-js/symbol");
|
4 | var _Object$create = require("@babel/runtime-corejs2/core-js/object/create");
|
5 | var _Object$getPrototypeOf = require("@babel/runtime-corejs2/core-js/object/get-prototype-of");
|
6 | var _Object$setPrototypeOf = require("@babel/runtime-corejs2/core-js/object/set-prototype-of");
|
7 | var _Promise = require("@babel/runtime-corejs2/core-js/promise");
|
8 | function _regeneratorRuntime() {
|
9 | "use strict";
|
10 | module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
|
11 | return exports;
|
12 | }, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
13 | var exports = {},
|
14 | Op = Object.prototype,
|
15 | hasOwn = Op.hasOwnProperty,
|
16 | defineProperty = _Object$defineProperty || function (obj, key, desc) {
|
17 | obj[key] = desc.value;
|
18 | },
|
19 | $Symbol = "function" == typeof _Symbol ? _Symbol : {},
|
20 | iteratorSymbol = $Symbol.iterator || "@@iterator",
|
21 | asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
|
22 | toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
23 | function define(obj, key, value) {
|
24 | return _Object$defineProperty(obj, key, {
|
25 | value: value,
|
26 | enumerable: !0,
|
27 | configurable: !0,
|
28 | writable: !0
|
29 | }), obj[key];
|
30 | }
|
31 | try {
|
32 | define({}, "");
|
33 | } catch (err) {
|
34 | define = function define(obj, key, value) {
|
35 | return obj[key] = value;
|
36 | };
|
37 | }
|
38 | function wrap(innerFn, outerFn, self, tryLocsList) {
|
39 | var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
|
40 | generator = _Object$create(protoGenerator.prototype),
|
41 | context = new Context(tryLocsList || []);
|
42 | return defineProperty(generator, "_invoke", {
|
43 | value: makeInvokeMethod(innerFn, self, context)
|
44 | }), generator;
|
45 | }
|
46 | function tryCatch(fn, obj, arg) {
|
47 | try {
|
48 | return {
|
49 | type: "normal",
|
50 | arg: fn.call(obj, arg)
|
51 | };
|
52 | } catch (err) {
|
53 | return {
|
54 | type: "throw",
|
55 | arg: err
|
56 | };
|
57 | }
|
58 | }
|
59 | exports.wrap = wrap;
|
60 | var ContinueSentinel = {};
|
61 | function Generator() {}
|
62 | function GeneratorFunction() {}
|
63 | function GeneratorFunctionPrototype() {}
|
64 | var IteratorPrototype = {};
|
65 | define(IteratorPrototype, iteratorSymbol, function () {
|
66 | return this;
|
67 | });
|
68 | var getProto = _Object$getPrototypeOf,
|
69 | NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
70 | NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
|
71 | var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = _Object$create(IteratorPrototype);
|
72 | function defineIteratorMethods(prototype) {
|
73 | ["next", "throw", "return"].forEach(function (method) {
|
74 | define(prototype, method, function (arg) {
|
75 | return this._invoke(method, arg);
|
76 | });
|
77 | });
|
78 | }
|
79 | function AsyncIterator(generator, PromiseImpl) {
|
80 | function invoke(method, arg, resolve, reject) {
|
81 | var record = tryCatch(generator[method], generator, arg);
|
82 | if ("throw" !== record.type) {
|
83 | var result = record.arg,
|
84 | value = result.value;
|
85 | return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
|
86 | invoke("next", value, resolve, reject);
|
87 | }, function (err) {
|
88 | invoke("throw", err, resolve, reject);
|
89 | }) : PromiseImpl.resolve(value).then(function (unwrapped) {
|
90 | result.value = unwrapped, resolve(result);
|
91 | }, function (error) {
|
92 | return invoke("throw", error, resolve, reject);
|
93 | });
|
94 | }
|
95 | reject(record.arg);
|
96 | }
|
97 | var previousPromise;
|
98 | defineProperty(this, "_invoke", {
|
99 | value: function value(method, arg) {
|
100 | function callInvokeWithMethodAndArg() {
|
101 | return new PromiseImpl(function (resolve, reject) {
|
102 | invoke(method, arg, resolve, reject);
|
103 | });
|
104 | }
|
105 | return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
106 | }
|
107 | });
|
108 | }
|
109 | function makeInvokeMethod(innerFn, self, context) {
|
110 | var state = "suspendedStart";
|
111 | return function (method, arg) {
|
112 | if ("executing" === state) throw new Error("Generator is already running");
|
113 | if ("completed" === state) {
|
114 | if ("throw" === method) throw arg;
|
115 | return doneResult();
|
116 | }
|
117 | for (context.method = method, context.arg = arg;;) {
|
118 | var delegate = context.delegate;
|
119 | if (delegate) {
|
120 | var delegateResult = maybeInvokeDelegate(delegate, context);
|
121 | if (delegateResult) {
|
122 | if (delegateResult === ContinueSentinel) continue;
|
123 | return delegateResult;
|
124 | }
|
125 | }
|
126 | if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
|
127 | if ("suspendedStart" === state) throw state = "completed", context.arg;
|
128 | context.dispatchException(context.arg);
|
129 | } else "return" === context.method && context.abrupt("return", context.arg);
|
130 | state = "executing";
|
131 | var record = tryCatch(innerFn, self, context);
|
132 | if ("normal" === record.type) {
|
133 | if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
|
134 | return {
|
135 | value: record.arg,
|
136 | done: context.done
|
137 | };
|
138 | }
|
139 | "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
|
140 | }
|
141 | };
|
142 | }
|
143 | function maybeInvokeDelegate(delegate, context) {
|
144 | var methodName = context.method,
|
145 | method = delegate.iterator[methodName];
|
146 | if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
|
147 | var record = tryCatch(method, delegate.iterator, context.arg);
|
148 | if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
|
149 | var info = record.arg;
|
150 | return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
|
151 | }
|
152 | function pushTryEntry(locs) {
|
153 | var entry = {
|
154 | tryLoc: locs[0]
|
155 | };
|
156 | 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
|
157 | }
|
158 | function resetTryEntry(entry) {
|
159 | var record = entry.completion || {};
|
160 | record.type = "normal", delete record.arg, entry.completion = record;
|
161 | }
|
162 | function Context(tryLocsList) {
|
163 | this.tryEntries = [{
|
164 | tryLoc: "root"
|
165 | }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
|
166 | }
|
167 | function values(iterable) {
|
168 | if (iterable) {
|
169 | var iteratorMethod = iterable[iteratorSymbol];
|
170 | if (iteratorMethod) return iteratorMethod.call(iterable);
|
171 | if ("function" == typeof iterable.next) return iterable;
|
172 | if (!isNaN(iterable.length)) {
|
173 | var i = -1,
|
174 | next = function next() {
|
175 | for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
|
176 | return next.value = undefined, next.done = !0, next;
|
177 | };
|
178 | return next.next = next;
|
179 | }
|
180 | }
|
181 | return {
|
182 | next: doneResult
|
183 | };
|
184 | }
|
185 | function doneResult() {
|
186 | return {
|
187 | value: undefined,
|
188 | done: !0
|
189 | };
|
190 | }
|
191 | return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
|
192 | value: GeneratorFunctionPrototype,
|
193 | configurable: !0
|
194 | }), defineProperty(GeneratorFunctionPrototype, "constructor", {
|
195 | value: GeneratorFunction,
|
196 | configurable: !0
|
197 | }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
|
198 | var ctor = "function" == typeof genFun && genFun.constructor;
|
199 | return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
|
200 | }, exports.mark = function (genFun) {
|
201 | return _Object$setPrototypeOf ? _Object$setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = _Object$create(Gp), genFun;
|
202 | }, exports.awrap = function (arg) {
|
203 | return {
|
204 | __await: arg
|
205 | };
|
206 | }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
207 | return this;
|
208 | }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
209 | void 0 === PromiseImpl && (PromiseImpl = _Promise);
|
210 | var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
|
211 | return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
|
212 | return result.done ? result.value : iter.next();
|
213 | });
|
214 | }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
|
215 | return this;
|
216 | }), define(Gp, "toString", function () {
|
217 | return "[object Generator]";
|
218 | }), exports.keys = function (val) {
|
219 | var object = Object(val),
|
220 | keys = [];
|
221 | for (var key in object) keys.push(key);
|
222 | return keys.reverse(), function next() {
|
223 | for (; keys.length;) {
|
224 | var key = keys.pop();
|
225 | if (key in object) return next.value = key, next.done = !1, next;
|
226 | }
|
227 | return next.done = !0, next;
|
228 | };
|
229 | }, exports.values = values, Context.prototype = {
|
230 | constructor: Context,
|
231 | reset: function reset(skipTempReset) {
|
232 | if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
|
233 | },
|
234 | stop: function stop() {
|
235 | this.done = !0;
|
236 | var rootRecord = this.tryEntries[0].completion;
|
237 | if ("throw" === rootRecord.type) throw rootRecord.arg;
|
238 | return this.rval;
|
239 | },
|
240 | dispatchException: function dispatchException(exception) {
|
241 | if (this.done) throw exception;
|
242 | var context = this;
|
243 | function handle(loc, caught) {
|
244 | return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
|
245 | }
|
246 | for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
247 | var entry = this.tryEntries[i],
|
248 | record = entry.completion;
|
249 | if ("root" === entry.tryLoc) return handle("end");
|
250 | if (entry.tryLoc <= this.prev) {
|
251 | var hasCatch = hasOwn.call(entry, "catchLoc"),
|
252 | hasFinally = hasOwn.call(entry, "finallyLoc");
|
253 | if (hasCatch && hasFinally) {
|
254 | if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
255 | if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
256 | } else if (hasCatch) {
|
257 | if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
258 | } else {
|
259 | if (!hasFinally) throw new Error("try statement without catch or finally");
|
260 | if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
261 | }
|
262 | }
|
263 | }
|
264 | },
|
265 | abrupt: function abrupt(type, arg) {
|
266 | for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
267 | var entry = this.tryEntries[i];
|
268 | if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
|
269 | var finallyEntry = entry;
|
270 | break;
|
271 | }
|
272 | }
|
273 | finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
|
274 | var record = finallyEntry ? finallyEntry.completion : {};
|
275 | return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
|
276 | },
|
277 | complete: function complete(record, afterLoc) {
|
278 | if ("throw" === record.type) throw record.arg;
|
279 | return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
|
280 | },
|
281 | finish: function finish(finallyLoc) {
|
282 | for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
283 | var entry = this.tryEntries[i];
|
284 | if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
|
285 | }
|
286 | },
|
287 | "catch": function _catch(tryLoc) {
|
288 | for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
289 | var entry = this.tryEntries[i];
|
290 | if (entry.tryLoc === tryLoc) {
|
291 | var record = entry.completion;
|
292 | if ("throw" === record.type) {
|
293 | var thrown = record.arg;
|
294 | resetTryEntry(entry);
|
295 | }
|
296 | return thrown;
|
297 | }
|
298 | }
|
299 | throw new Error("illegal catch attempt");
|
300 | },
|
301 | delegateYield: function delegateYield(iterable, resultName, nextLoc) {
|
302 | return this.delegate = {
|
303 | iterator: values(iterable),
|
304 | resultName: resultName,
|
305 | nextLoc: nextLoc
|
306 | }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
|
307 | }
|
308 | }, exports;
|
309 | }
|
310 | module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports; |
\ | No newline at end of file |