UNPKG

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