varsnap 1.8.5 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/varsnap.js DELETED
@@ -1,1923 +0,0 @@
1
- /*
2
- * Varsnap.js v1.8.5
3
- */
4
- (function(exports) {
5
- !function(t) {
6
- if ("object" == typeof exports && "undefined" != typeof module) module.exports = t(); else if ("function" == typeof define && define.amd) define([], t); else {
7
- ("undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : this).varsnap = t();
8
- }
9
- }(function() {
10
- var t, e, r, n = (t = function(t, r) {
11
- (function(t) {
12
- (function() {
13
- "use strict";
14
- function t(t) {
15
- if (t > 2147483647) throw new RangeError('The value "' + t + '" is invalid for option "size"');
16
- var e = new Uint8Array(t);
17
- return e.__proto__ = n.prototype, e;
18
- }
19
- function n(t, e, r) {
20
- if ("number" == typeof t) {
21
- if ("string" == typeof e) throw new TypeError('The "string" argument must be of type string. Received type number');
22
- return a(t);
23
- }
24
- return o(t, e, r);
25
- }
26
- function o(e, r, o) {
27
- if ("string" == typeof e) return function(e, r) {
28
- if ("string" == typeof r && "" !== r || (r = "utf8"),
29
- !n.isEncoding(r)) throw new TypeError("Unknown encoding: " + r);
30
- var o = 0 | f(e, r), i = t(o), a = i.write(e, r);
31
- return a !== o && (i = i.slice(0, a)), i;
32
- }(e, r);
33
- if (ArrayBuffer.isView(e)) return s(e);
34
- if (null == e) throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof e);
35
- if (I(e, ArrayBuffer) || e && I(e.buffer, ArrayBuffer)) return function(t, e, r) {
36
- if (e < 0 || t.byteLength < e) throw new RangeError('"offset" is outside of buffer bounds');
37
- if (t.byteLength < e + (r || 0)) throw new RangeError('"length" is outside of buffer bounds');
38
- var o;
39
- return (o = void 0 === e && void 0 === r ? new Uint8Array(t) : void 0 === r ? new Uint8Array(t, e) : new Uint8Array(t, e, r)).__proto__ = n.prototype,
40
- o;
41
- }(e, r, o);
42
- if ("number" == typeof e) throw new TypeError('The "value" argument must not be of type number. Received type number');
43
- var i = e.valueOf && e.valueOf();
44
- if (null != i && i !== e) return n.from(i, r, o);
45
- var a = function(e) {
46
- if (n.isBuffer(e)) {
47
- var r = 0 | u(e.length), o = t(r);
48
- return 0 === o.length || e.copy(o, 0, 0, r), o;
49
- }
50
- return void 0 !== e.length ? "number" != typeof e.length || D(e.length) ? t(0) : s(e) : "Buffer" === e.type && Array.isArray(e.data) ? s(e.data) : void 0;
51
- }(e);
52
- if (a) return a;
53
- if ("undefined" != typeof Symbol && null != Symbol.toPrimitive && "function" == typeof e[Symbol.toPrimitive]) return n.from(e[Symbol.toPrimitive]("string"), r, o);
54
- throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof e);
55
- }
56
- function i(t) {
57
- if ("number" != typeof t) throw new TypeError('"size" argument must be of type number');
58
- if (t < 0) throw new RangeError('The value "' + t + '" is invalid for option "size"');
59
- }
60
- function a(e) {
61
- return i(e), t(e < 0 ? 0 : 0 | u(e));
62
- }
63
- function s(e) {
64
- for (var r = e.length < 0 ? 0 : 0 | u(e.length), n = t(r), o = 0; o < r; o += 1) n[o] = 255 & e[o];
65
- return n;
66
- }
67
- function u(t) {
68
- if (t >= 2147483647) throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + 2147483647..toString(16) + " bytes");
69
- return 0 | t;
70
- }
71
- function f(t, e) {
72
- if (n.isBuffer(t)) return t.length;
73
- if (ArrayBuffer.isView(t) || I(t, ArrayBuffer)) return t.byteLength;
74
- if ("string" != typeof t) throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof t);
75
- var r = t.length, o = arguments.length > 2 && !0 === arguments[2];
76
- if (!o && 0 === r) return 0;
77
- for (var i = !1; ;) switch (e) {
78
- case "ascii":
79
- case "latin1":
80
- case "binary":
81
- return r;
82
-
83
- case "utf8":
84
- case "utf-8":
85
- return P(t).length;
86
-
87
- case "ucs2":
88
- case "ucs-2":
89
- case "utf16le":
90
- case "utf-16le":
91
- return 2 * r;
92
-
93
- case "hex":
94
- return r >>> 1;
95
-
96
- case "base64":
97
- return N(t).length;
98
-
99
- default:
100
- if (i) return o ? -1 : P(t).length;
101
- e = ("" + e).toLowerCase(), i = !0;
102
- }
103
- }
104
- function c(t, e, r) {
105
- var n = !1;
106
- if ((void 0 === e || e < 0) && (e = 0), e > this.length) return "";
107
- if ((void 0 === r || r > this.length) && (r = this.length),
108
- r <= 0) return "";
109
- if ((r >>>= 0) <= (e >>>= 0)) return "";
110
- for (t || (t = "utf8"); ;) switch (t) {
111
- case "hex":
112
- return _(this, e, r);
113
-
114
- case "utf8":
115
- case "utf-8":
116
- return E(this, e, r);
117
-
118
- case "ascii":
119
- return T(this, e, r);
120
-
121
- case "latin1":
122
- case "binary":
123
- return S(this, e, r);
124
-
125
- case "base64":
126
- return b(this, e, r);
127
-
128
- case "ucs2":
129
- case "ucs-2":
130
- case "utf16le":
131
- case "utf-16le":
132
- return R(this, e, r);
133
-
134
- default:
135
- if (n) throw new TypeError("Unknown encoding: " + t);
136
- t = (t + "").toLowerCase(), n = !0;
137
- }
138
- }
139
- function l(t, e, r) {
140
- var n = t[e];
141
- t[e] = t[r], t[r] = n;
142
- }
143
- function h(t, e, r, o, i) {
144
- if (0 === t.length) return -1;
145
- if ("string" == typeof r ? (o = r, r = 0) : r > 2147483647 ? r = 2147483647 : r < -2147483648 && (r = -2147483648),
146
- D(r = +r) && (r = i ? 0 : t.length - 1), r < 0 && (r = t.length + r),
147
- r >= t.length) {
148
- if (i) return -1;
149
- r = t.length - 1;
150
- } else if (r < 0) {
151
- if (!i) return -1;
152
- r = 0;
153
- }
154
- if ("string" == typeof e && (e = n.from(e, o)), n.isBuffer(e)) return 0 === e.length ? -1 : p(t, e, r, o, i);
155
- if ("number" == typeof e) return e &= 255, "function" == typeof Uint8Array.prototype.indexOf ? i ? Uint8Array.prototype.indexOf.call(t, e, r) : Uint8Array.prototype.lastIndexOf.call(t, e, r) : p(t, [ e ], r, o, i);
156
- throw new TypeError("val must be string, number or Buffer");
157
- }
158
- function p(t, e, r, n, o) {
159
- var i, a = 1, s = t.length, u = e.length;
160
- if (void 0 !== n && ("ucs2" === (n = String(n).toLowerCase()) || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
161
- if (t.length < 2 || e.length < 2) return -1;
162
- a = 2, s /= 2, u /= 2, r /= 2;
163
- }
164
- function f(t, e) {
165
- return 1 === a ? t[e] : t.readUInt16BE(e * a);
166
- }
167
- if (o) {
168
- var c = -1;
169
- for (i = r; i < s; i++) if (f(t, i) === f(e, -1 === c ? 0 : i - c)) {
170
- if (-1 === c && (c = i), i - c + 1 === u) return c * a;
171
- } else -1 !== c && (i -= i - c), c = -1;
172
- } else for (r + u > s && (r = s - u), i = r; i >= 0; i--) {
173
- for (var l = !0, h = 0; h < u; h++) if (f(t, i + h) !== f(e, h)) {
174
- l = !1;
175
- break;
176
- }
177
- if (l) return i;
178
- }
179
- return -1;
180
- }
181
- function d(t, e, r, n) {
182
- r = Number(r) || 0;
183
- var o = t.length - r;
184
- n ? (n = Number(n)) > o && (n = o) : n = o;
185
- var i = e.length;
186
- n > i / 2 && (n = i / 2);
187
- for (var a = 0; a < n; ++a) {
188
- var s = parseInt(e.substr(2 * a, 2), 16);
189
- if (D(s)) return a;
190
- t[r + a] = s;
191
- }
192
- return a;
193
- }
194
- function g(t, e, r, n) {
195
- return L(P(e, t.length - r), t, r, n);
196
- }
197
- function y(t, e, r, n) {
198
- return L(function(t) {
199
- for (var e = [], r = 0; r < t.length; ++r) e.push(255 & t.charCodeAt(r));
200
- return e;
201
- }(e), t, r, n);
202
- }
203
- function v(t, e, r, n) {
204
- return y(t, e, r, n);
205
- }
206
- function m(t, e, r, n) {
207
- return L(N(e), t, r, n);
208
- }
209
- function w(t, e, r, n) {
210
- return L(function(t, e) {
211
- for (var r, n, o, i = [], a = 0; a < t.length && !((e -= 2) < 0); ++a) n = (r = t.charCodeAt(a)) >> 8,
212
- o = r % 256, i.push(o), i.push(n);
213
- return i;
214
- }(e, t.length - r), t, r, n);
215
- }
216
- function b(t, e, r) {
217
- return 0 === e && r === t.length ? x.fromByteArray(t) : x.fromByteArray(t.slice(e, r));
218
- }
219
- function E(t, e, r) {
220
- r = Math.min(t.length, r);
221
- for (var n = [], o = e; o < r; ) {
222
- var i, a, s, u, f = t[o], c = null, l = f > 239 ? 4 : f > 223 ? 3 : f > 191 ? 2 : 1;
223
- if (o + l <= r) switch (l) {
224
- case 1:
225
- f < 128 && (c = f);
226
- break;
227
-
228
- case 2:
229
- 128 == (192 & (i = t[o + 1])) && (u = (31 & f) << 6 | 63 & i) > 127 && (c = u);
230
- break;
231
-
232
- case 3:
233
- i = t[o + 1], a = t[o + 2], 128 == (192 & i) && 128 == (192 & a) && (u = (15 & f) << 12 | (63 & i) << 6 | 63 & a) > 2047 && (u < 55296 || u > 57343) && (c = u);
234
- break;
235
-
236
- case 4:
237
- i = t[o + 1], a = t[o + 2], s = t[o + 3], 128 == (192 & i) && 128 == (192 & a) && 128 == (192 & s) && (u = (15 & f) << 18 | (63 & i) << 12 | (63 & a) << 6 | 63 & s) > 65535 && u < 1114112 && (c = u);
238
- }
239
- null === c ? (c = 65533, l = 1) : c > 65535 && (c -= 65536,
240
- n.push(c >>> 10 & 1023 | 55296), c = 56320 | 1023 & c),
241
- n.push(c), o += l;
242
- }
243
- return function(t) {
244
- var e = t.length;
245
- if (e <= A) return String.fromCharCode.apply(String, t);
246
- for (var r = "", n = 0; n < e; ) r += String.fromCharCode.apply(String, t.slice(n, n += A));
247
- return r;
248
- }(n);
249
- }
250
- r.Buffer = n, r.INSPECT_MAX_BYTES = 50, n.TYPED_ARRAY_SUPPORT = function() {
251
- try {
252
- var t = new Uint8Array(1);
253
- return t.__proto__ = {
254
- __proto__: Uint8Array.prototype,
255
- foo: function() {
256
- return 42;
257
- }
258
- }, 42 === t.foo();
259
- } catch (e) {
260
- return !1;
261
- }
262
- }(), n.TYPED_ARRAY_SUPPORT || "undefined" == typeof console || "function" != typeof console.error || console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),
263
- Object.defineProperty(n.prototype, "parent", {
264
- enumerable: !0,
265
- get: function() {
266
- if (n.isBuffer(this)) return this.buffer;
267
- }
268
- }), Object.defineProperty(n.prototype, "offset", {
269
- enumerable: !0,
270
- get: function() {
271
- if (n.isBuffer(this)) return this.byteOffset;
272
- }
273
- }), "undefined" != typeof Symbol && null != Symbol.species && n[Symbol.species] === n && Object.defineProperty(n, Symbol.species, {
274
- value: null,
275
- configurable: !0,
276
- enumerable: !1,
277
- writable: !1
278
- }), n.poolSize = 8192, n.from = function(t, e, r) {
279
- return o(t, e, r);
280
- }, n.prototype.__proto__ = Uint8Array.prototype, n.__proto__ = Uint8Array,
281
- n.alloc = function(e, r, n) {
282
- return function(e, r, n) {
283
- return i(e), e <= 0 ? t(e) : void 0 !== r ? "string" == typeof n ? t(e).fill(r, n) : t(e).fill(r) : t(e);
284
- }(e, r, n);
285
- }, n.allocUnsafe = function(t) {
286
- return a(t);
287
- }, n.allocUnsafeSlow = function(t) {
288
- return a(t);
289
- }, n.isBuffer = function(t) {
290
- return null != t && !0 === t._isBuffer && t !== n.prototype;
291
- }, n.compare = function(t, e) {
292
- if (I(t, Uint8Array) && (t = n.from(t, t.offset, t.byteLength)),
293
- I(e, Uint8Array) && (e = n.from(e, e.offset, e.byteLength)),
294
- !n.isBuffer(t) || !n.isBuffer(e)) throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');
295
- if (t === e) return 0;
296
- for (var r = t.length, o = e.length, i = 0, a = Math.min(r, o); i < a; ++i) if (t[i] !== e[i]) {
297
- r = t[i], o = e[i];
298
- break;
299
- }
300
- return r < o ? -1 : o < r ? 1 : 0;
301
- }, n.isEncoding = function(t) {
302
- switch (String(t).toLowerCase()) {
303
- case "hex":
304
- case "utf8":
305
- case "utf-8":
306
- case "ascii":
307
- case "latin1":
308
- case "binary":
309
- case "base64":
310
- case "ucs2":
311
- case "ucs-2":
312
- case "utf16le":
313
- case "utf-16le":
314
- return !0;
315
-
316
- default:
317
- return !1;
318
- }
319
- }, n.concat = function(t, e) {
320
- if (!Array.isArray(t)) throw new TypeError('"list" argument must be an Array of Buffers');
321
- if (0 === t.length) return n.alloc(0);
322
- var r;
323
- if (void 0 === e) for (e = 0, r = 0; r < t.length; ++r) e += t[r].length;
324
- var o = n.allocUnsafe(e), i = 0;
325
- for (r = 0; r < t.length; ++r) {
326
- var a = t[r];
327
- if (I(a, Uint8Array) && (a = n.from(a)), !n.isBuffer(a)) throw new TypeError('"list" argument must be an Array of Buffers');
328
- a.copy(o, i), i += a.length;
329
- }
330
- return o;
331
- }, n.byteLength = f, n.prototype._isBuffer = !0, n.prototype.swap16 = function() {
332
- var t = this.length;
333
- if (t % 2 != 0) throw new RangeError("Buffer size must be a multiple of 16-bits");
334
- for (var e = 0; e < t; e += 2) l(this, e, e + 1);
335
- return this;
336
- }, n.prototype.swap32 = function() {
337
- var t = this.length;
338
- if (t % 4 != 0) throw new RangeError("Buffer size must be a multiple of 32-bits");
339
- for (var e = 0; e < t; e += 4) l(this, e, e + 3), l(this, e + 1, e + 2);
340
- return this;
341
- }, n.prototype.swap64 = function() {
342
- var t = this.length;
343
- if (t % 8 != 0) throw new RangeError("Buffer size must be a multiple of 64-bits");
344
- for (var e = 0; e < t; e += 8) l(this, e, e + 7), l(this, e + 1, e + 6),
345
- l(this, e + 2, e + 5), l(this, e + 3, e + 4);
346
- return this;
347
- }, n.prototype.toString = function() {
348
- var t = this.length;
349
- return 0 === t ? "" : 0 === arguments.length ? E(this, 0, t) : c.apply(this, arguments);
350
- }, n.prototype.toLocaleString = n.prototype.toString, n.prototype.equals = function(t) {
351
- if (!n.isBuffer(t)) throw new TypeError("Argument must be a Buffer");
352
- return this === t || 0 === n.compare(this, t);
353
- }, n.prototype.inspect = function() {
354
- var t = "", e = r.INSPECT_MAX_BYTES;
355
- return t = this.toString("hex", 0, e).replace(/(.{2})/g, "$1 ").trim(),
356
- this.length > e && (t += " ... "), "<Buffer " + t + ">";
357
- }, n.prototype.compare = function(t, e, r, o, i) {
358
- if (I(t, Uint8Array) && (t = n.from(t, t.offset, t.byteLength)),
359
- !n.isBuffer(t)) throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof t);
360
- if (void 0 === e && (e = 0), void 0 === r && (r = t ? t.length : 0),
361
- void 0 === o && (o = 0), void 0 === i && (i = this.length),
362
- e < 0 || r > t.length || o < 0 || i > this.length) throw new RangeError("out of range index");
363
- if (o >= i && e >= r) return 0;
364
- if (o >= i) return -1;
365
- if (e >= r) return 1;
366
- if (this === t) return 0;
367
- for (var a = (i >>>= 0) - (o >>>= 0), s = (r >>>= 0) - (e >>>= 0), u = Math.min(a, s), f = this.slice(o, i), c = t.slice(e, r), l = 0; l < u; ++l) if (f[l] !== c[l]) {
368
- a = f[l], s = c[l];
369
- break;
370
- }
371
- return a < s ? -1 : s < a ? 1 : 0;
372
- }, n.prototype.includes = function(t, e, r) {
373
- return -1 !== this.indexOf(t, e, r);
374
- }, n.prototype.indexOf = function(t, e, r) {
375
- return h(this, t, e, r, !0);
376
- }, n.prototype.lastIndexOf = function(t, e, r) {
377
- return h(this, t, e, r, !1);
378
- }, n.prototype.write = function(t, e, r, n) {
379
- if (void 0 === e) n = "utf8", r = this.length, e = 0; else if (void 0 === r && "string" == typeof e) n = e,
380
- r = this.length, e = 0; else {
381
- if (!isFinite(e)) throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
382
- e >>>= 0, isFinite(r) ? (r >>>= 0, void 0 === n && (n = "utf8")) : (n = r,
383
- r = void 0);
384
- }
385
- var o = this.length - e;
386
- if ((void 0 === r || r > o) && (r = o), t.length > 0 && (r < 0 || e < 0) || e > this.length) throw new RangeError("Attempt to write outside buffer bounds");
387
- n || (n = "utf8");
388
- for (var i = !1; ;) switch (n) {
389
- case "hex":
390
- return d(this, t, e, r);
391
-
392
- case "utf8":
393
- case "utf-8":
394
- return g(this, t, e, r);
395
-
396
- case "ascii":
397
- return y(this, t, e, r);
398
-
399
- case "latin1":
400
- case "binary":
401
- return v(this, t, e, r);
402
-
403
- case "base64":
404
- return m(this, t, e, r);
405
-
406
- case "ucs2":
407
- case "ucs-2":
408
- case "utf16le":
409
- case "utf-16le":
410
- return w(this, t, e, r);
411
-
412
- default:
413
- if (i) throw new TypeError("Unknown encoding: " + n);
414
- n = ("" + n).toLowerCase(), i = !0;
415
- }
416
- }, n.prototype.toJSON = function() {
417
- return {
418
- type: "Buffer",
419
- data: Array.prototype.slice.call(this._arr || this, 0)
420
- };
421
- };
422
- var A = 4096;
423
- function T(t, e, r) {
424
- var n = "";
425
- r = Math.min(t.length, r);
426
- for (var o = e; o < r; ++o) n += String.fromCharCode(127 & t[o]);
427
- return n;
428
- }
429
- function S(t, e, r) {
430
- var n = "";
431
- r = Math.min(t.length, r);
432
- for (var o = e; o < r; ++o) n += String.fromCharCode(t[o]);
433
- return n;
434
- }
435
- function _(t, e, r) {
436
- var n, o = t.length;
437
- (!e || e < 0) && (e = 0), (!r || r < 0 || r > o) && (r = o);
438
- for (var i = "", a = e; a < r; ++a) i += (n = t[a]) < 16 ? "0" + n.toString(16) : n.toString(16);
439
- return i;
440
- }
441
- function R(t, e, r) {
442
- for (var n = t.slice(e, r), o = "", i = 0; i < n.length; i += 2) o += String.fromCharCode(n[i] + 256 * n[i + 1]);
443
- return o;
444
- }
445
- function O(t, e, r) {
446
- if (t % 1 != 0 || t < 0) throw new RangeError("offset is not uint");
447
- if (t + e > r) throw new RangeError("Trying to access beyond buffer length");
448
- }
449
- function C(t, e, r, o, i, a) {
450
- if (!n.isBuffer(t)) throw new TypeError('"buffer" argument must be a Buffer instance');
451
- if (e > i || e < a) throw new RangeError('"value" argument is out of bounds');
452
- if (r + o > t.length) throw new RangeError("Index out of range");
453
- }
454
- function B(t, e, r, n, o, i) {
455
- if (r + n > t.length) throw new RangeError("Index out of range");
456
- if (r < 0) throw new RangeError("Index out of range");
457
- }
458
- function U(t, e, r, n, o) {
459
- return e = +e, r >>>= 0, o || B(t, 0, r, 4), q.write(t, e, r, n, 23, 4),
460
- r + 4;
461
- }
462
- function k(t, e, r, n, o) {
463
- return e = +e, r >>>= 0, o || B(t, 0, r, 8), q.write(t, e, r, n, 52, 8),
464
- r + 8;
465
- }
466
- n.prototype.slice = function(t, e) {
467
- var r = this.length;
468
- (t = ~~t) < 0 ? (t += r) < 0 && (t = 0) : t > r && (t = r),
469
- (e = void 0 === e ? r : ~~e) < 0 ? (e += r) < 0 && (e = 0) : e > r && (e = r),
470
- e < t && (e = t);
471
- var o = this.subarray(t, e);
472
- return o.__proto__ = n.prototype, o;
473
- }, n.prototype.readUIntLE = function(t, e, r) {
474
- t >>>= 0, e >>>= 0, r || O(t, e, this.length);
475
- for (var n = this[t], o = 1, i = 0; ++i < e && (o *= 256); ) n += this[t + i] * o;
476
- return n;
477
- }, n.prototype.readUIntBE = function(t, e, r) {
478
- t >>>= 0, e >>>= 0, r || O(t, e, this.length);
479
- for (var n = this[t + --e], o = 1; e > 0 && (o *= 256); ) n += this[t + --e] * o;
480
- return n;
481
- }, n.prototype.readUInt8 = function(t, e) {
482
- return t >>>= 0, e || O(t, 1, this.length), this[t];
483
- }, n.prototype.readUInt16LE = function(t, e) {
484
- return t >>>= 0, e || O(t, 2, this.length), this[t] | this[t + 1] << 8;
485
- }, n.prototype.readUInt16BE = function(t, e) {
486
- return t >>>= 0, e || O(t, 2, this.length), this[t] << 8 | this[t + 1];
487
- }, n.prototype.readUInt32LE = function(t, e) {
488
- return t >>>= 0, e || O(t, 4, this.length), (this[t] | this[t + 1] << 8 | this[t + 2] << 16) + 16777216 * this[t + 3];
489
- }, n.prototype.readUInt32BE = function(t, e) {
490
- return t >>>= 0, e || O(t, 4, this.length), 16777216 * this[t] + (this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3]);
491
- }, n.prototype.readIntLE = function(t, e, r) {
492
- t >>>= 0, e >>>= 0, r || O(t, e, this.length);
493
- for (var n = this[t], o = 1, i = 0; ++i < e && (o *= 256); ) n += this[t + i] * o;
494
- return n >= (o *= 128) && (n -= Math.pow(2, 8 * e)), n;
495
- }, n.prototype.readIntBE = function(t, e, r) {
496
- t >>>= 0, e >>>= 0, r || O(t, e, this.length);
497
- for (var n = e, o = 1, i = this[t + --n]; n > 0 && (o *= 256); ) i += this[t + --n] * o;
498
- return i >= (o *= 128) && (i -= Math.pow(2, 8 * e)), i;
499
- }, n.prototype.readInt8 = function(t, e) {
500
- return t >>>= 0, e || O(t, 1, this.length), 128 & this[t] ? -1 * (255 - this[t] + 1) : this[t];
501
- }, n.prototype.readInt16LE = function(t, e) {
502
- t >>>= 0, e || O(t, 2, this.length);
503
- var r = this[t] | this[t + 1] << 8;
504
- return 32768 & r ? 4294901760 | r : r;
505
- }, n.prototype.readInt16BE = function(t, e) {
506
- t >>>= 0, e || O(t, 2, this.length);
507
- var r = this[t + 1] | this[t] << 8;
508
- return 32768 & r ? 4294901760 | r : r;
509
- }, n.prototype.readInt32LE = function(t, e) {
510
- return t >>>= 0, e || O(t, 4, this.length), this[t] | this[t + 1] << 8 | this[t + 2] << 16 | this[t + 3] << 24;
511
- }, n.prototype.readInt32BE = function(t, e) {
512
- return t >>>= 0, e || O(t, 4, this.length), this[t] << 24 | this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3];
513
- }, n.prototype.readFloatLE = function(t, e) {
514
- return t >>>= 0, e || O(t, 4, this.length), q.read(this, t, !0, 23, 4);
515
- }, n.prototype.readFloatBE = function(t, e) {
516
- return t >>>= 0, e || O(t, 4, this.length), q.read(this, t, !1, 23, 4);
517
- }, n.prototype.readDoubleLE = function(t, e) {
518
- return t >>>= 0, e || O(t, 8, this.length), q.read(this, t, !0, 52, 8);
519
- }, n.prototype.readDoubleBE = function(t, e) {
520
- return t >>>= 0, e || O(t, 8, this.length), q.read(this, t, !1, 52, 8);
521
- }, n.prototype.writeUIntLE = function(t, e, r, n) {
522
- t = +t, e >>>= 0, r >>>= 0, n || C(this, t, e, r, Math.pow(2, 8 * r) - 1, 0);
523
- var o = 1, i = 0;
524
- for (this[e] = 255 & t; ++i < r && (o *= 256); ) this[e + i] = t / o & 255;
525
- return e + r;
526
- }, n.prototype.writeUIntBE = function(t, e, r, n) {
527
- t = +t, e >>>= 0, r >>>= 0, n || C(this, t, e, r, Math.pow(2, 8 * r) - 1, 0);
528
- var o = r - 1, i = 1;
529
- for (this[e + o] = 255 & t; --o >= 0 && (i *= 256); ) this[e + o] = t / i & 255;
530
- return e + r;
531
- }, n.prototype.writeUInt8 = function(t, e, r) {
532
- return t = +t, e >>>= 0, r || C(this, t, e, 1, 255, 0),
533
- this[e] = 255 & t, e + 1;
534
- }, n.prototype.writeUInt16LE = function(t, e, r) {
535
- return t = +t, e >>>= 0, r || C(this, t, e, 2, 65535, 0),
536
- this[e] = 255 & t, this[e + 1] = t >>> 8, e + 2;
537
- }, n.prototype.writeUInt16BE = function(t, e, r) {
538
- return t = +t, e >>>= 0, r || C(this, t, e, 2, 65535, 0),
539
- this[e] = t >>> 8, this[e + 1] = 255 & t, e + 2;
540
- }, n.prototype.writeUInt32LE = function(t, e, r) {
541
- return t = +t, e >>>= 0, r || C(this, t, e, 4, 4294967295, 0),
542
- this[e + 3] = t >>> 24, this[e + 2] = t >>> 16, this[e + 1] = t >>> 8,
543
- this[e] = 255 & t, e + 4;
544
- }, n.prototype.writeUInt32BE = function(t, e, r) {
545
- return t = +t, e >>>= 0, r || C(this, t, e, 4, 4294967295, 0),
546
- this[e] = t >>> 24, this[e + 1] = t >>> 16, this[e + 2] = t >>> 8,
547
- this[e + 3] = 255 & t, e + 4;
548
- }, n.prototype.writeIntLE = function(t, e, r, n) {
549
- if (t = +t, e >>>= 0, !n) {
550
- var o = Math.pow(2, 8 * r - 1);
551
- C(this, t, e, r, o - 1, -o);
552
- }
553
- var i = 0, a = 1, s = 0;
554
- for (this[e] = 255 & t; ++i < r && (a *= 256); ) t < 0 && 0 === s && 0 !== this[e + i - 1] && (s = 1),
555
- this[e + i] = (t / a >> 0) - s & 255;
556
- return e + r;
557
- }, n.prototype.writeIntBE = function(t, e, r, n) {
558
- if (t = +t, e >>>= 0, !n) {
559
- var o = Math.pow(2, 8 * r - 1);
560
- C(this, t, e, r, o - 1, -o);
561
- }
562
- var i = r - 1, a = 1, s = 0;
563
- for (this[e + i] = 255 & t; --i >= 0 && (a *= 256); ) t < 0 && 0 === s && 0 !== this[e + i + 1] && (s = 1),
564
- this[e + i] = (t / a >> 0) - s & 255;
565
- return e + r;
566
- }, n.prototype.writeInt8 = function(t, e, r) {
567
- return t = +t, e >>>= 0, r || C(this, t, e, 1, 127, -128),
568
- t < 0 && (t = 255 + t + 1), this[e] = 255 & t, e + 1;
569
- }, n.prototype.writeInt16LE = function(t, e, r) {
570
- return t = +t, e >>>= 0, r || C(this, t, e, 2, 32767, -32768),
571
- this[e] = 255 & t, this[e + 1] = t >>> 8, e + 2;
572
- }, n.prototype.writeInt16BE = function(t, e, r) {
573
- return t = +t, e >>>= 0, r || C(this, t, e, 2, 32767, -32768),
574
- this[e] = t >>> 8, this[e + 1] = 255 & t, e + 2;
575
- }, n.prototype.writeInt32LE = function(t, e, r) {
576
- return t = +t, e >>>= 0, r || C(this, t, e, 4, 2147483647, -2147483648),
577
- this[e] = 255 & t, this[e + 1] = t >>> 8, this[e + 2] = t >>> 16,
578
- this[e + 3] = t >>> 24, e + 4;
579
- }, n.prototype.writeInt32BE = function(t, e, r) {
580
- return t = +t, e >>>= 0, r || C(this, t, e, 4, 2147483647, -2147483648),
581
- t < 0 && (t = 4294967295 + t + 1), this[e] = t >>> 24, this[e + 1] = t >>> 16,
582
- this[e + 2] = t >>> 8, this[e + 3] = 255 & t, e + 4;
583
- }, n.prototype.writeFloatLE = function(t, e, r) {
584
- return U(this, t, e, !0, r);
585
- }, n.prototype.writeFloatBE = function(t, e, r) {
586
- return U(this, t, e, !1, r);
587
- }, n.prototype.writeDoubleLE = function(t, e, r) {
588
- return k(this, t, e, !0, r);
589
- }, n.prototype.writeDoubleBE = function(t, e, r) {
590
- return k(this, t, e, !1, r);
591
- }, n.prototype.copy = function(t, e, r, o) {
592
- if (!n.isBuffer(t)) throw new TypeError("argument should be a Buffer");
593
- if (r || (r = 0), o || 0 === o || (o = this.length), e >= t.length && (e = t.length),
594
- e || (e = 0), o > 0 && o < r && (o = r), o === r) return 0;
595
- if (0 === t.length || 0 === this.length) return 0;
596
- if (e < 0) throw new RangeError("targetStart out of bounds");
597
- if (r < 0 || r >= this.length) throw new RangeError("Index out of range");
598
- if (o < 0) throw new RangeError("sourceEnd out of bounds");
599
- o > this.length && (o = this.length), t.length - e < o - r && (o = t.length - e + r);
600
- var i = o - r;
601
- if (this === t && "function" == typeof Uint8Array.prototype.copyWithin) this.copyWithin(e, r, o); else if (this === t && r < e && e < o) for (var a = i - 1; a >= 0; --a) t[a + e] = this[a + r]; else Uint8Array.prototype.set.call(t, this.subarray(r, o), e);
602
- return i;
603
- }, n.prototype.fill = function(t, e, r, o) {
604
- if ("string" == typeof t) {
605
- if ("string" == typeof e ? (o = e, e = 0, r = this.length) : "string" == typeof r && (o = r,
606
- r = this.length), void 0 !== o && "string" != typeof o) throw new TypeError("encoding must be a string");
607
- if ("string" == typeof o && !n.isEncoding(o)) throw new TypeError("Unknown encoding: " + o);
608
- if (1 === t.length) {
609
- var i = t.charCodeAt(0);
610
- ("utf8" === o && i < 128 || "latin1" === o) && (t = i);
611
- }
612
- } else "number" == typeof t && (t &= 255);
613
- if (e < 0 || this.length < e || this.length < r) throw new RangeError("Out of range index");
614
- if (r <= e) return this;
615
- var a;
616
- if (e >>>= 0, r = void 0 === r ? this.length : r >>> 0,
617
- t || (t = 0), "number" == typeof t) for (a = e; a < r; ++a) this[a] = t; else {
618
- var s = n.isBuffer(t) ? t : n.from(t, o), u = s.length;
619
- if (0 === u) throw new TypeError('The value "' + t + '" is invalid for argument "value"');
620
- for (a = 0; a < r - e; ++a) this[a + e] = s[a % u];
621
- }
622
- return this;
623
- };
624
- var j = /[^+/0-9A-Za-z-_]/g;
625
- function P(t, e) {
626
- var r;
627
- e = e || 1 / 0;
628
- for (var n = t.length, o = null, i = [], a = 0; a < n; ++a) {
629
- if ((r = t.charCodeAt(a)) > 55295 && r < 57344) {
630
- if (!o) {
631
- if (r > 56319) {
632
- (e -= 3) > -1 && i.push(239, 191, 189);
633
- continue;
634
- }
635
- if (a + 1 === n) {
636
- (e -= 3) > -1 && i.push(239, 191, 189);
637
- continue;
638
- }
639
- o = r;
640
- continue;
641
- }
642
- if (r < 56320) {
643
- (e -= 3) > -1 && i.push(239, 191, 189), o = r;
644
- continue;
645
- }
646
- r = 65536 + (o - 55296 << 10 | r - 56320);
647
- } else o && (e -= 3) > -1 && i.push(239, 191, 189);
648
- if (o = null, r < 128) {
649
- if ((e -= 1) < 0) break;
650
- i.push(r);
651
- } else if (r < 2048) {
652
- if ((e -= 2) < 0) break;
653
- i.push(r >> 6 | 192, 63 & r | 128);
654
- } else if (r < 65536) {
655
- if ((e -= 3) < 0) break;
656
- i.push(r >> 12 | 224, r >> 6 & 63 | 128, 63 & r | 128);
657
- } else {
658
- if (!(r < 1114112)) throw new Error("Invalid code point");
659
- if ((e -= 4) < 0) break;
660
- i.push(r >> 18 | 240, r >> 12 & 63 | 128, r >> 6 & 63 | 128, 63 & r | 128);
661
- }
662
- }
663
- return i;
664
- }
665
- function N(t) {
666
- return x.toByteArray(function(t) {
667
- if ((t = (t = t.split("=")[0]).trim().replace(j, "")).length < 2) return "";
668
- for (;t.length % 4 != 0; ) t += "=";
669
- return t;
670
- }(t));
671
- }
672
- function L(t, e, r, n) {
673
- for (var o = 0; o < n && !(o + r >= e.length || o >= t.length); ++o) e[o + r] = t[o];
674
- return o;
675
- }
676
- function I(t, e) {
677
- return t instanceof e || null != t && null != t.constructor && null != t.constructor.name && t.constructor.name === e.name;
678
- }
679
- function D(t) {
680
- return t != t;
681
- }
682
- }).call(this);
683
- }).call(this, n({}).Buffer);
684
- }, function(r) {
685
- return e || t(e = {
686
- exports: {},
687
- parent: r
688
- }, e.exports), e.exports;
689
- }), o = function(t, e) {
690
- return function() {
691
- for (var r = new Array(arguments.length), n = 0; n < r.length; n++) r[n] = arguments[n];
692
- return t.apply(e, r);
693
- };
694
- }, i = Object.prototype.toString, a = (r = Object.create(null), function(t) {
695
- var e = i.call(t);
696
- return r[e] || (r[e] = e.slice(8, -1).toLowerCase());
697
- });
698
- function s(t) {
699
- return t = t.toLowerCase(), function(e) {
700
- return a(e) === t;
701
- };
702
- }
703
- function u(t) {
704
- return Array.isArray(t);
705
- }
706
- function f(t) {
707
- return void 0 === t;
708
- }
709
- var c = s("ArrayBuffer");
710
- function l(t) {
711
- return null !== t && "object" == typeof t;
712
- }
713
- function h(t) {
714
- if ("object" !== a(t)) return !1;
715
- var e = Object.getPrototypeOf(t);
716
- return null === e || e === Object.prototype;
717
- }
718
- var p = s("Date"), d = s("File"), g = s("Blob"), y = s("FileList");
719
- function v(t) {
720
- return "[object Function]" === i.call(t);
721
- }
722
- var m = s("URLSearchParams");
723
- function w(t, e) {
724
- if (null != t) if ("object" != typeof t && (t = [ t ]), u(t)) for (var r = 0, n = t.length; r < n; r++) e.call(null, t[r], r, t); else for (var o in t) Object.prototype.hasOwnProperty.call(t, o) && e.call(null, t[o], o, t);
725
- }
726
- var b, E = (b = "undefined" != typeof Uint8Array && Object.getPrototypeOf(Uint8Array),
727
- function(t) {
728
- return b && t instanceof b;
729
- }), A = {
730
- isArray: u,
731
- isArrayBuffer: c,
732
- isBuffer: function(t) {
733
- return null !== t && !f(t) && null !== t.constructor && !f(t.constructor) && "function" == typeof t.constructor.isBuffer && t.constructor.isBuffer(t);
734
- },
735
- isFormData: function(t) {
736
- return t && ("function" == typeof FormData && t instanceof FormData || "[object FormData]" === i.call(t) || v(t.toString) && "[object FormData]" === t.toString());
737
- },
738
- isArrayBufferView: function(t) {
739
- return "undefined" != typeof ArrayBuffer && ArrayBuffer.isView ? ArrayBuffer.isView(t) : t && t.buffer && c(t.buffer);
740
- },
741
- isString: function(t) {
742
- return "string" == typeof t;
743
- },
744
- isNumber: function(t) {
745
- return "number" == typeof t;
746
- },
747
- isObject: l,
748
- isPlainObject: h,
749
- isUndefined: f,
750
- isDate: p,
751
- isFile: d,
752
- isBlob: g,
753
- isStream: function(t) {
754
- return l(t) && v(t.pipe);
755
- },
756
- isURLSearchParams: m,
757
- isStandardBrowserEnv: function() {
758
- return ("undefined" == typeof navigator || "ReactNative" !== navigator.product && "NativeScript" !== navigator.product && "NS" !== navigator.product) && "undefined" != typeof window && "undefined" != typeof document;
759
- },
760
- forEach: w,
761
- merge: function t() {
762
- var e = {};
763
- function r(r, n) {
764
- h(e[n]) && h(r) ? e[n] = t(e[n], r) : h(r) ? e[n] = t({}, r) : u(r) ? e[n] = r.slice() : e[n] = r;
765
- }
766
- for (var n = 0, o = arguments.length; n < o; n++) w(arguments[n], r);
767
- return e;
768
- },
769
- extend: function(t, e, r) {
770
- return w(e, function(e, n) {
771
- t[n] = r && "function" == typeof e ? o(e, r) : e;
772
- }), t;
773
- },
774
- trim: function(t) {
775
- return t.trim ? t.trim() : t.replace(/^\s+|\s+$/g, "");
776
- },
777
- inherits: function(t, e, r, n) {
778
- t.prototype = Object.create(e.prototype, n), t.prototype.constructor = t,
779
- r && Object.assign(t.prototype, r);
780
- },
781
- toFlatObject: function(t, e, r) {
782
- var n, o, i, a = {};
783
- e = e || {};
784
- do {
785
- for (o = (n = Object.getOwnPropertyNames(t)).length; o-- > 0; ) a[i = n[o]] || (e[i] = t[i],
786
- a[i] = !0);
787
- t = Object.getPrototypeOf(t);
788
- } while (t && (!r || r(t, e)) && t !== Object.prototype);
789
- return e;
790
- },
791
- endsWith: function(t, e, r) {
792
- t = String(t), (void 0 === r || r > t.length) && (r = t.length),
793
- r -= e.length;
794
- var n = t.indexOf(e, r);
795
- return -1 !== n && n === r;
796
- },
797
- toArray: function(t) {
798
- if (!t) return null;
799
- var e = t.length;
800
- if (f(e)) return null;
801
- for (var r = new Array(e); e-- > 0; ) r[e] = t[e];
802
- return r;
803
- },
804
- isTypedArray: E,
805
- isFileList: y
806
- };
807
- function T(t) {
808
- return encodeURIComponent(t).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
809
- }
810
- var S = function(t, e, r) {
811
- if (!e) return t;
812
- var n;
813
- if (r) n = r(e); else if (A.isURLSearchParams(e)) n = e.toString(); else {
814
- var o = [];
815
- A.forEach(e, function(t, e) {
816
- null != t && (A.isArray(t) ? e += "[]" : t = [ t ], A.forEach(t, function(t) {
817
- A.isDate(t) ? t = t.toISOString() : A.isObject(t) && (t = JSON.stringify(t)),
818
- o.push(T(e) + "=" + T(t));
819
- }));
820
- }), n = o.join("&");
821
- }
822
- if (n) {
823
- var i = t.indexOf("#");
824
- -1 !== i && (t = t.slice(0, i)), t += (-1 === t.indexOf("?") ? "?" : "&") + n;
825
- }
826
- return t;
827
- }, _ = {};
828
- function R() {
829
- this.handlers = [];
830
- }
831
- R.prototype.use = function(t, e, r) {
832
- return this.handlers.push({
833
- fulfilled: t,
834
- rejected: e,
835
- synchronous: !!r && r.synchronous,
836
- runWhen: r ? r.runWhen : null
837
- }), this.handlers.length - 1;
838
- }, R.prototype.eject = function(t) {
839
- this.handlers[t] && (this.handlers[t] = null);
840
- }, R.prototype.forEach = function(t) {
841
- A.forEach(this.handlers, function(e) {
842
- null !== e && t(e);
843
- });
844
- }, _ = R;
845
- var O = function(t, e) {
846
- A.forEach(t, function(r, n) {
847
- n !== e && n.toUpperCase() === e.toUpperCase() && (t[e] = r, delete t[n]);
848
- });
849
- }, C = {};
850
- function B(t, e, r, n, o) {
851
- Error.call(this), this.message = t, this.name = "AxiosError", e && (this.code = e),
852
- r && (this.config = r), n && (this.request = n), o && (this.response = o);
853
- }
854
- A.inherits(B, Error, {
855
- toJSON: function() {
856
- return {
857
- message: this.message,
858
- name: this.name,
859
- description: this.description,
860
- number: this.number,
861
- fileName: this.fileName,
862
- lineNumber: this.lineNumber,
863
- columnNumber: this.columnNumber,
864
- stack: this.stack,
865
- config: this.config,
866
- code: this.code,
867
- status: this.response && this.response.status ? this.response.status : null
868
- };
869
- }
870
- });
871
- var U = B.prototype, k = {};
872
- [ "ERR_BAD_OPTION_VALUE", "ERR_BAD_OPTION", "ECONNABORTED", "ETIMEDOUT", "ERR_NETWORK", "ERR_FR_TOO_MANY_REDIRECTS", "ERR_DEPRECATED", "ERR_BAD_RESPONSE", "ERR_BAD_REQUEST", "ERR_CANCELED" ].forEach(function(t) {
873
- k[t] = {
874
- value: t
875
- };
876
- }), Object.defineProperties(B, k), Object.defineProperty(U, "isAxiosError", {
877
- value: !0
878
- }), B.from = function(t, e, r, n, o, i) {
879
- var a = Object.create(U);
880
- return A.toFlatObject(t, a, function(t) {
881
- return t !== Error.prototype;
882
- }), B.call(a, t.message, e, r, n, o), a.name = t.name, i && Object.assign(a, i),
883
- a;
884
- }, C = B;
885
- for (var j = {
886
- silentJSONParsing: !0,
887
- forcedJSONParsing: !0,
888
- clarifyTimeoutError: !1
889
- }, x = {
890
- toByteArray: function(t) {
891
- var e, r, n = F(t), o = n[0], i = n[1], a = new L(function(t, e, r) {
892
- return 3 * (e + r) / 4 - r;
893
- }(0, o, i)), s = 0, u = i > 0 ? o - 4 : o;
894
- for (r = 0; r < u; r += 4) e = N[t.charCodeAt(r)] << 18 | N[t.charCodeAt(r + 1)] << 12 | N[t.charCodeAt(r + 2)] << 6 | N[t.charCodeAt(r + 3)],
895
- a[s++] = e >> 16 & 255, a[s++] = e >> 8 & 255, a[s++] = 255 & e;
896
- return 2 === i && (e = N[t.charCodeAt(r)] << 2 | N[t.charCodeAt(r + 1)] >> 4,
897
- a[s++] = 255 & e), 1 === i && (e = N[t.charCodeAt(r)] << 10 | N[t.charCodeAt(r + 1)] << 4 | N[t.charCodeAt(r + 2)] >> 2,
898
- a[s++] = e >> 8 & 255, a[s++] = 255 & e), a;
899
- },
900
- fromByteArray: function(t) {
901
- for (var e, r = t.length, n = r % 3, o = [], i = 0, a = r - n; i < a; i += 16383) o.push(z(t, i, i + 16383 > a ? a : i + 16383));
902
- return 1 === n ? (e = t[r - 1], o.push(P[e >> 2] + P[e << 4 & 63] + "==")) : 2 === n && (e = (t[r - 2] << 8) + t[r - 1],
903
- o.push(P[e >> 10] + P[e >> 4 & 63] + P[e << 2 & 63] + "=")), o.join("");
904
- }
905
- }, P = [], N = [], L = "undefined" != typeof Uint8Array ? Uint8Array : Array, I = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", D = 0, M = I.length; D < M; ++D) P[D] = I[D],
906
- N[I.charCodeAt(D)] = D;
907
- function F(t) {
908
- var e = t.length;
909
- if (e % 4 > 0) throw new Error("Invalid string. Length must be a multiple of 4");
910
- var r = t.indexOf("=");
911
- return -1 === r && (r = e), [ r, r === e ? 0 : 4 - r % 4 ];
912
- }
913
- function z(t, e, r) {
914
- for (var n, o, i = [], a = e; a < r; a += 3) n = (t[a] << 16 & 16711680) + (t[a + 1] << 8 & 65280) + (255 & t[a + 2]),
915
- i.push(P[(o = n) >> 18 & 63] + P[o >> 12 & 63] + P[o >> 6 & 63] + P[63 & o]);
916
- return i.join("");
917
- }
918
- N["-".charCodeAt(0)] = 62, N["_".charCodeAt(0)] = 63;
919
- var q = {
920
- read: function(t, e, r, n, o) {
921
- var i, a, s = 8 * o - n - 1, u = (1 << s) - 1, f = u >> 1, c = -7, l = r ? o - 1 : 0, h = r ? -1 : 1, p = t[e + l];
922
- for (l += h, i = p & (1 << -c) - 1, p >>= -c, c += s; c > 0; i = 256 * i + t[e + l],
923
- l += h, c -= 8);
924
- for (a = i & (1 << -c) - 1, i >>= -c, c += n; c > 0; a = 256 * a + t[e + l],
925
- l += h, c -= 8);
926
- if (0 === i) i = 1 - f; else {
927
- if (i === u) return a ? NaN : 1 / 0 * (p ? -1 : 1);
928
- a += Math.pow(2, n), i -= f;
929
- }
930
- return (p ? -1 : 1) * a * Math.pow(2, i - n);
931
- },
932
- write: function(t, e, r, n, o, i) {
933
- var a, s, u, f = 8 * i - o - 1, c = (1 << f) - 1, l = c >> 1, h = 23 === o ? Math.pow(2, -24) - Math.pow(2, -77) : 0, p = n ? 0 : i - 1, d = n ? 1 : -1, g = e < 0 || 0 === e && 1 / e < 0 ? 1 : 0;
934
- for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (s = isNaN(e) ? 1 : 0,
935
- a = c) : (a = Math.floor(Math.log(e) / Math.LN2), e * (u = Math.pow(2, -a)) < 1 && (a--,
936
- u *= 2), (e += a + l >= 1 ? h / u : h * Math.pow(2, 1 - l)) * u >= 2 && (a++,
937
- u /= 2), a + l >= c ? (s = 0, a = c) : a + l >= 1 ? (s = (e * u - 1) * Math.pow(2, o),
938
- a += l) : (s = e * Math.pow(2, l - 1) * Math.pow(2, o), a = 0)); o >= 8; t[r + p] = 255 & s,
939
- p += d, s /= 256, o -= 8);
940
- for (a = a << o | s, f += o; f > 0; t[r + p] = 255 & a, p += d,
941
- a /= 256, f -= 8);
942
- t[r + p - d] |= 128 * g;
943
- }
944
- }, V = {};
945
- (function(t) {
946
- (function() {
947
- "use strict";
948
- V = function(e, r) {
949
- r = r || new FormData();
950
- var n = [];
951
- function o(e) {
952
- return null === e ? "" : A.isDate(e) ? e.toISOString() : A.isArrayBuffer(e) || A.isTypedArray(e) ? "function" == typeof Blob ? new Blob([ e ]) : t.from(e) : e;
953
- }
954
- return function t(e, i) {
955
- if (A.isPlainObject(e) || A.isArray(e)) {
956
- if (-1 !== n.indexOf(e)) throw Error("Circular reference detected in " + i);
957
- n.push(e), A.forEach(e, function(e, n) {
958
- if (!A.isUndefined(e)) {
959
- var a, s = i ? i + "." + n : n;
960
- if (e && !i && "object" == typeof e) if (A.endsWith(n, "{}")) e = JSON.stringify(e); else if (A.endsWith(n, "[]") && (a = A.toArray(e))) return void a.forEach(function(t) {
961
- !A.isUndefined(t) && r.append(s, o(t));
962
- });
963
- t(e, s);
964
- }
965
- }), n.pop();
966
- } else r.append(i, o(e));
967
- }(e), r;
968
- };
969
- }).call(this);
970
- }).call(this, n({}).Buffer);
971
- var J = A.isStandardBrowserEnv() ? {
972
- write: function(t, e, r, n, o, i) {
973
- var a = [];
974
- a.push(t + "=" + encodeURIComponent(e)), A.isNumber(r) && a.push("expires=" + new Date(r).toGMTString()),
975
- A.isString(n) && a.push("path=" + n), A.isString(o) && a.push("domain=" + o),
976
- !0 === i && a.push("secure"), document.cookie = a.join("; ");
977
- },
978
- read: function(t) {
979
- var e = document.cookie.match(new RegExp("(^|;\\s*)(" + t + ")=([^;]*)"));
980
- return e ? decodeURIComponent(e[3]) : null;
981
- },
982
- remove: function(t) {
983
- this.write(t, "", Date.now() - 864e5);
984
- }
985
- } : {
986
- write: function() {},
987
- read: function() {
988
- return null;
989
- },
990
- remove: function() {}
991
- }, W = function(t, e) {
992
- return t && !/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e) ? function(t, e) {
993
- return e ? t.replace(/\/+$/, "") + "/" + e.replace(/^\/+/, "") : t;
994
- }(t, e) : e;
995
- }, H = [ "age", "authorization", "content-length", "content-type", "etag", "expires", "from", "host", "if-modified-since", "if-unmodified-since", "last-modified", "location", "max-forwards", "proxy-authorization", "referer", "retry-after", "user-agent" ], Y = A.isStandardBrowserEnv() ? function() {
996
- var t, e = /(msie|trident)/i.test(navigator.userAgent), r = document.createElement("a");
997
- function n(t) {
998
- var n = t;
999
- return e && (r.setAttribute("href", n), n = r.href), r.setAttribute("href", n),
1000
- {
1001
- href: r.href,
1002
- protocol: r.protocol ? r.protocol.replace(/:$/, "") : "",
1003
- host: r.host,
1004
- search: r.search ? r.search.replace(/^\?/, "") : "",
1005
- hash: r.hash ? r.hash.replace(/^#/, "") : "",
1006
- hostname: r.hostname,
1007
- port: r.port,
1008
- pathname: "/" === r.pathname.charAt(0) ? r.pathname : "/" + r.pathname
1009
- };
1010
- }
1011
- return t = n(window.location.href), function(e) {
1012
- var r = A.isString(e) ? n(e) : e;
1013
- return r.protocol === t.protocol && r.host === t.host;
1014
- };
1015
- }() : function() {
1016
- return !0;
1017
- }, X = {};
1018
- function $(t) {
1019
- C.call(this, null == t ? "canceled" : t, C.ERR_CANCELED), this.name = "CanceledError";
1020
- }
1021
- A.inherits($, C, {
1022
- __CANCEL__: !0
1023
- }), X = $;
1024
- var G, K, Q, Z = function(t) {
1025
- return new Promise(function(e, r) {
1026
- var n, o = t.data, i = t.headers, a = t.responseType;
1027
- function s() {
1028
- t.cancelToken && t.cancelToken.unsubscribe(n), t.signal && t.signal.removeEventListener("abort", n);
1029
- }
1030
- A.isFormData(o) && A.isStandardBrowserEnv() && delete i["Content-Type"];
1031
- var u = new XMLHttpRequest();
1032
- if (t.auth) {
1033
- var f = t.auth.username || "", c = t.auth.password ? unescape(encodeURIComponent(t.auth.password)) : "";
1034
- i.Authorization = "Basic " + btoa(f + ":" + c);
1035
- }
1036
- var l = W(t.baseURL, t.url);
1037
- function h() {
1038
- if (u) {
1039
- var n = "getAllResponseHeaders" in u ? function(t) {
1040
- var e, r, n, o = {};
1041
- return t ? (A.forEach(t.split("\n"), function(t) {
1042
- if (n = t.indexOf(":"), e = A.trim(t.substr(0, n)).toLowerCase(),
1043
- r = A.trim(t.substr(n + 1)), e) {
1044
- if (o[e] && H.indexOf(e) >= 0) return;
1045
- o[e] = "set-cookie" === e ? (o[e] ? o[e] : []).concat([ r ]) : o[e] ? o[e] + ", " + r : r;
1046
- }
1047
- }), o) : o;
1048
- }(u.getAllResponseHeaders()) : null;
1049
- (function(t, e, r) {
1050
- var n = r.config.validateStatus;
1051
- r.status && n && !n(r.status) ? e(new C("Request failed with status code " + r.status, [ C.ERR_BAD_REQUEST, C.ERR_BAD_RESPONSE ][Math.floor(r.status / 100) - 4], r.config, r.request, r)) : t(r);
1052
- })(function(t) {
1053
- e(t), s();
1054
- }, function(t) {
1055
- r(t), s();
1056
- }, {
1057
- data: a && "text" !== a && "json" !== a ? u.response : u.responseText,
1058
- status: u.status,
1059
- statusText: u.statusText,
1060
- headers: n,
1061
- config: t,
1062
- request: u
1063
- }), u = null;
1064
- }
1065
- }
1066
- if (u.open(t.method.toUpperCase(), S(l, t.params, t.paramsSerializer), !0),
1067
- u.timeout = t.timeout, "onloadend" in u ? u.onloadend = h : u.onreadystatechange = function() {
1068
- u && 4 === u.readyState && (0 !== u.status || u.responseURL && 0 === u.responseURL.indexOf("file:")) && setTimeout(h);
1069
- }, u.onabort = function() {
1070
- u && (r(new C("Request aborted", C.ECONNABORTED, t, u)), u = null);
1071
- }, u.onerror = function() {
1072
- r(new C("Network Error", C.ERR_NETWORK, t, u, u)), u = null;
1073
- }, u.ontimeout = function() {
1074
- var e = t.timeout ? "timeout of " + t.timeout + "ms exceeded" : "timeout exceeded", n = t.transitional || j;
1075
- t.timeoutErrorMessage && (e = t.timeoutErrorMessage), r(new C(e, n.clarifyTimeoutError ? C.ETIMEDOUT : C.ECONNABORTED, t, u)),
1076
- u = null;
1077
- }, A.isStandardBrowserEnv()) {
1078
- var p = (t.withCredentials || Y(l)) && t.xsrfCookieName ? J.read(t.xsrfCookieName) : void 0;
1079
- p && (i[t.xsrfHeaderName] = p);
1080
- }
1081
- "setRequestHeader" in u && A.forEach(i, function(t, e) {
1082
- void 0 === o && "content-type" === e.toLowerCase() ? delete i[e] : u.setRequestHeader(e, t);
1083
- }), A.isUndefined(t.withCredentials) || (u.withCredentials = !!t.withCredentials),
1084
- a && "json" !== a && (u.responseType = t.responseType), "function" == typeof t.onDownloadProgress && u.addEventListener("progress", t.onDownloadProgress),
1085
- "function" == typeof t.onUploadProgress && u.upload && u.upload.addEventListener("progress", t.onUploadProgress),
1086
- (t.cancelToken || t.signal) && (n = function(t) {
1087
- u && (r(!t || t && t.type ? new X() : t), u.abort(), u = null);
1088
- }, t.cancelToken && t.cancelToken.subscribe(n), t.signal && (t.signal.aborted ? n() : t.signal.addEventListener("abort", n))),
1089
- o || (o = null);
1090
- var d, g = (d = /^([-+\w]{1,25})(:?\/\/|:)/.exec(l)) && d[1] || "";
1091
- g && -1 === [ "http", "https", "file" ].indexOf(g) ? r(new C("Unsupported protocol " + g + ":", C.ERR_BAD_REQUEST, t)) : u.send(o);
1092
- });
1093
- }, tt = G = {};
1094
- function et() {
1095
- throw new Error("setTimeout has not been defined");
1096
- }
1097
- function rt() {
1098
- throw new Error("clearTimeout has not been defined");
1099
- }
1100
- function nt(t) {
1101
- if (K === setTimeout) return setTimeout(t, 0);
1102
- if ((K === et || !K) && setTimeout) return K = setTimeout, setTimeout(t, 0);
1103
- try {
1104
- return K(t, 0);
1105
- } catch (e) {
1106
- try {
1107
- return K.call(null, t, 0);
1108
- } catch (e) {
1109
- return K.call(this, t, 0);
1110
- }
1111
- }
1112
- }
1113
- !function() {
1114
- try {
1115
- K = "function" == typeof setTimeout ? setTimeout : et;
1116
- } catch (e) {
1117
- K = et;
1118
- }
1119
- try {
1120
- Q = "function" == typeof clearTimeout ? clearTimeout : rt;
1121
- } catch (e) {
1122
- Q = rt;
1123
- }
1124
- }();
1125
- var ot, it = [], at = !1, st = -1;
1126
- function ut() {
1127
- at && ot && (at = !1, ot.length ? it = ot.concat(it) : st = -1, it.length && ft());
1128
- }
1129
- function ft() {
1130
- if (!at) {
1131
- var t = nt(ut);
1132
- at = !0;
1133
- for (var r = it.length; r; ) {
1134
- for (ot = it, it = []; ++st < r; ) ot && ot[st].run();
1135
- st = -1, r = it.length;
1136
- }
1137
- ot = null, at = !1, function(t) {
1138
- if (Q === clearTimeout) return clearTimeout(t);
1139
- if ((Q === rt || !Q) && clearTimeout) return Q = clearTimeout,
1140
- clearTimeout(t);
1141
- try {
1142
- Q(t);
1143
- } catch (e) {
1144
- try {
1145
- return Q.call(null, t);
1146
- } catch (e) {
1147
- return Q.call(this, t);
1148
- }
1149
- }
1150
- }(t);
1151
- }
1152
- }
1153
- function ct(t, e) {
1154
- this.fun = t, this.array = e;
1155
- }
1156
- function lt() {}
1157
- tt.nextTick = function(t) {
1158
- var e = new Array(arguments.length - 1);
1159
- if (arguments.length > 1) for (var r = 1; r < arguments.length; r++) e[r - 1] = arguments[r];
1160
- it.push(new ct(t, e)), 1 !== it.length || at || nt(ft);
1161
- }, ct.prototype.run = function() {
1162
- this.fun.apply(null, this.array);
1163
- }, tt.title = "browser", tt.browser = !0, tt.env = {}, tt.argv = [], tt.version = "",
1164
- tt.versions = {}, tt.on = lt, tt.addListener = lt, tt.once = lt, tt.off = lt,
1165
- tt.removeListener = lt, tt.removeAllListeners = lt, tt.emit = lt, tt.prependListener = lt,
1166
- tt.prependOnceListener = lt, tt.listeners = function(t) {
1167
- return [];
1168
- }, tt.binding = function(t) {
1169
- throw new Error("process.binding is not supported");
1170
- }, tt.cwd = function() {
1171
- return "/";
1172
- }, tt.chdir = function(t) {
1173
- throw new Error("process.chdir is not supported");
1174
- }, tt.umask = function() {
1175
- return 0;
1176
- };
1177
- var ht = {};
1178
- (function(t) {
1179
- (function() {
1180
- "use strict";
1181
- var r = {
1182
- "Content-Type": "application/x-www-form-urlencoded"
1183
- };
1184
- function n(t, e) {
1185
- !A.isUndefined(t) && A.isUndefined(t["Content-Type"]) && (t["Content-Type"] = e);
1186
- }
1187
- var o, i = {
1188
- transitional: j,
1189
- adapter: (("undefined" != typeof XMLHttpRequest || void 0 !== t && "[object process]" === Object.prototype.toString.call(t)) && (o = Z),
1190
- o),
1191
- transformRequest: [ function(t, r) {
1192
- if (O(r, "Accept"), O(r, "Content-Type"), A.isFormData(t) || A.isArrayBuffer(t) || A.isBuffer(t) || A.isStream(t) || A.isFile(t) || A.isBlob(t)) return t;
1193
- if (A.isArrayBufferView(t)) return t.buffer;
1194
- if (A.isURLSearchParams(t)) return n(r, "application/x-www-form-urlencoded;charset=utf-8"),
1195
- t.toString();
1196
- var o, i = A.isObject(t), a = r && r["Content-Type"];
1197
- if ((o = A.isFileList(t)) || i && "multipart/form-data" === a) {
1198
- var s = this.env && this.env.FormData;
1199
- return V(o ? {
1200
- "files[]": t
1201
- } : t, s && new s());
1202
- }
1203
- return i || "application/json" === a ? (n(r, "application/json"),
1204
- function(t, r, n) {
1205
- if (A.isString(t)) try {
1206
- return (0, JSON.parse)(t), A.trim(t);
1207
- } catch (e) {
1208
- if ("SyntaxError" !== e.name) throw e;
1209
- }
1210
- return (0, JSON.stringify)(t);
1211
- }(t)) : t;
1212
- } ],
1213
- transformResponse: [ function(t) {
1214
- var r = this.transitional || i.transitional, n = r && r.silentJSONParsing, o = r && r.forcedJSONParsing, a = !n && "json" === this.responseType;
1215
- if (a || o && A.isString(t) && t.length) try {
1216
- return JSON.parse(t);
1217
- } catch (e) {
1218
- if (a) {
1219
- if ("SyntaxError" === e.name) throw C.from(e, C.ERR_BAD_RESPONSE, this, null, this.response);
1220
- throw e;
1221
- }
1222
- }
1223
- return t;
1224
- } ],
1225
- timeout: 0,
1226
- xsrfCookieName: "XSRF-TOKEN",
1227
- xsrfHeaderName: "X-XSRF-TOKEN",
1228
- maxContentLength: -1,
1229
- maxBodyLength: -1,
1230
- env: {
1231
- FormData: null
1232
- },
1233
- validateStatus: function(t) {
1234
- return t >= 200 && t < 300;
1235
- },
1236
- headers: {
1237
- common: {
1238
- Accept: "application/json, text/plain, */*"
1239
- }
1240
- }
1241
- };
1242
- A.forEach([ "delete", "get", "head" ], function(t) {
1243
- i.headers[t] = {};
1244
- }), A.forEach([ "post", "put", "patch" ], function(t) {
1245
- i.headers[t] = A.merge(r);
1246
- }), ht = i;
1247
- }).call(this);
1248
- }).call(this, G);
1249
- var pt = function(t, e, r) {
1250
- var n = this || ht;
1251
- return A.forEach(r, function(r) {
1252
- t = r.call(n, t, e);
1253
- }), t;
1254
- }, dt = function(t) {
1255
- return !(!t || !t.__CANCEL__);
1256
- };
1257
- function gt(t) {
1258
- if (t.cancelToken && t.cancelToken.throwIfRequested(), t.signal && t.signal.aborted) throw new X();
1259
- }
1260
- var yt, vt = function(t) {
1261
- return gt(t), t.headers = t.headers || {}, t.data = pt.call(t, t.data, t.headers, t.transformRequest),
1262
- t.headers = A.merge(t.headers.common || {}, t.headers[t.method] || {}, t.headers),
1263
- A.forEach([ "delete", "get", "head", "post", "put", "patch", "common" ], function(e) {
1264
- delete t.headers[e];
1265
- }), (t.adapter || ht.adapter)(t).then(function(e) {
1266
- return gt(t), e.data = pt.call(t, e.data, e.headers, t.transformResponse),
1267
- e;
1268
- }, function(e) {
1269
- return dt(e) || (gt(t), e && e.response && (e.response.data = pt.call(t, e.response.data, e.response.headers, t.transformResponse))),
1270
- Promise.reject(e);
1271
- });
1272
- }, mt = function(t, e) {
1273
- e = e || {};
1274
- var r = {};
1275
- function n(t, e) {
1276
- return A.isPlainObject(t) && A.isPlainObject(e) ? A.merge(t, e) : A.isPlainObject(e) ? A.merge({}, e) : A.isArray(e) ? e.slice() : e;
1277
- }
1278
- function o(r) {
1279
- return A.isUndefined(e[r]) ? A.isUndefined(t[r]) ? void 0 : n(void 0, t[r]) : n(t[r], e[r]);
1280
- }
1281
- function i(t) {
1282
- if (!A.isUndefined(e[t])) return n(void 0, e[t]);
1283
- }
1284
- function a(r) {
1285
- return A.isUndefined(e[r]) ? A.isUndefined(t[r]) ? void 0 : n(void 0, t[r]) : n(void 0, e[r]);
1286
- }
1287
- function s(r) {
1288
- return r in e ? n(t[r], e[r]) : r in t ? n(void 0, t[r]) : void 0;
1289
- }
1290
- var u = {
1291
- url: i,
1292
- method: i,
1293
- data: i,
1294
- baseURL: a,
1295
- transformRequest: a,
1296
- transformResponse: a,
1297
- paramsSerializer: a,
1298
- timeout: a,
1299
- timeoutMessage: a,
1300
- withCredentials: a,
1301
- adapter: a,
1302
- responseType: a,
1303
- xsrfCookieName: a,
1304
- xsrfHeaderName: a,
1305
- onUploadProgress: a,
1306
- onDownloadProgress: a,
1307
- decompress: a,
1308
- maxContentLength: a,
1309
- maxBodyLength: a,
1310
- beforeRedirect: a,
1311
- transport: a,
1312
- httpAgent: a,
1313
- httpsAgent: a,
1314
- cancelToken: a,
1315
- socketPath: a,
1316
- responseEncoding: a,
1317
- validateStatus: s
1318
- };
1319
- return A.forEach(Object.keys(t).concat(Object.keys(e)), function(t) {
1320
- var e = u[t] || o, n = e(t);
1321
- A.isUndefined(n) && e !== s || (r[t] = n);
1322
- }), r;
1323
- }, wt = "0.27.2", bt = wt, Et = {};
1324
- [ "object", "boolean", "number", "function", "string", "symbol" ].forEach(function(t, e) {
1325
- Et[t] = function(r) {
1326
- return typeof r === t || "a" + (e < 1 ? "n " : " ") + t;
1327
- };
1328
- });
1329
- var At = {};
1330
- Et.transitional = function(t, e, r) {
1331
- function n(t, e) {
1332
- return "[Axios v" + bt + "] Transitional option '" + t + "'" + e + (r ? ". " + r : "");
1333
- }
1334
- return function(r, o, i) {
1335
- if (!1 === t) throw new C(n(o, " has been removed" + (e ? " in " + e : "")), C.ERR_DEPRECATED);
1336
- return e && !At[o] && (At[o] = !0, console.warn(n(o, " has been deprecated since v" + e + " and will be removed in the near future"))),
1337
- !t || t(r, o, i);
1338
- };
1339
- };
1340
- var Tt = {}, St = (yt = {
1341
- assertOptions: function(t, e, r) {
1342
- if ("object" != typeof t) throw new C("options must be an object", C.ERR_BAD_OPTION_VALUE);
1343
- for (var n = Object.keys(t), o = n.length; o-- > 0; ) {
1344
- var i = n[o], a = e[i];
1345
- if (a) {
1346
- var s = t[i], u = void 0 === s || a(s, i, t);
1347
- if (!0 !== u) throw new C("option " + i + " must be " + u, C.ERR_BAD_OPTION_VALUE);
1348
- } else if (!0 !== r) throw new C("Unknown option " + i, C.ERR_BAD_OPTION);
1349
- }
1350
- },
1351
- validators: Et
1352
- }).validators;
1353
- function _t(t) {
1354
- this.defaults = t, this.interceptors = {
1355
- request: new _(),
1356
- response: new _()
1357
- };
1358
- }
1359
- _t.prototype.request = function(t, e) {
1360
- "string" == typeof t ? (e = e || {}).url = t : e = t || {}, (e = mt(this.defaults, e)).method ? e.method = e.method.toLowerCase() : this.defaults.method ? e.method = this.defaults.method.toLowerCase() : e.method = "get";
1361
- var r = e.transitional;
1362
- void 0 !== r && yt.assertOptions(r, {
1363
- silentJSONParsing: St.transitional(St.boolean),
1364
- forcedJSONParsing: St.transitional(St.boolean),
1365
- clarifyTimeoutError: St.transitional(St.boolean)
1366
- }, !1);
1367
- var n = [], o = !0;
1368
- this.interceptors.request.forEach(function(t) {
1369
- "function" == typeof t.runWhen && !1 === t.runWhen(e) || (o = o && t.synchronous,
1370
- n.unshift(t.fulfilled, t.rejected));
1371
- });
1372
- var i, a = [];
1373
- if (this.interceptors.response.forEach(function(t) {
1374
- a.push(t.fulfilled, t.rejected);
1375
- }), !o) {
1376
- var s = [ vt, void 0 ];
1377
- for (Array.prototype.unshift.apply(s, n), s = s.concat(a), i = Promise.resolve(e); s.length; ) i = i.then(s.shift(), s.shift());
1378
- return i;
1379
- }
1380
- for (var u = e; n.length; ) {
1381
- var f = n.shift(), c = n.shift();
1382
- try {
1383
- u = f(u);
1384
- } catch (l) {
1385
- c(l);
1386
- break;
1387
- }
1388
- }
1389
- try {
1390
- i = vt(u);
1391
- } catch (l) {
1392
- return Promise.reject(l);
1393
- }
1394
- for (;a.length; ) i = i.then(a.shift(), a.shift());
1395
- return i;
1396
- }, _t.prototype.getUri = function(t) {
1397
- t = mt(this.defaults, t);
1398
- var e = W(t.baseURL, t.url);
1399
- return S(e, t.params, t.paramsSerializer);
1400
- }, A.forEach([ "delete", "get", "head", "options" ], function(t) {
1401
- _t.prototype[t] = function(e, r) {
1402
- return this.request(mt(r || {}, {
1403
- method: t,
1404
- url: e,
1405
- data: (r || {}).data
1406
- }));
1407
- };
1408
- }), A.forEach([ "post", "put", "patch" ], function(t) {
1409
- function e(e) {
1410
- return function(r, n, o) {
1411
- return this.request(mt(o || {}, {
1412
- method: t,
1413
- headers: e ? {
1414
- "Content-Type": "multipart/form-data"
1415
- } : {},
1416
- url: r,
1417
- data: n
1418
- }));
1419
- };
1420
- }
1421
- _t.prototype[t] = e(), _t.prototype[t + "Form"] = e(!0);
1422
- }), Tt = _t;
1423
- var Rt;
1424
- function Ot(t) {
1425
- if ("function" != typeof t) throw new TypeError("executor must be a function.");
1426
- var e;
1427
- this.promise = new Promise(function(t) {
1428
- e = t;
1429
- });
1430
- var r = this;
1431
- this.promise.then(function(t) {
1432
- if (r._listeners) {
1433
- var e, n = r._listeners.length;
1434
- for (e = 0; e < n; e++) r._listeners[e](t);
1435
- r._listeners = null;
1436
- }
1437
- }), this.promise.then = function(t) {
1438
- var e, n = new Promise(function(t) {
1439
- r.subscribe(t), e = t;
1440
- }).then(t);
1441
- return n.cancel = function() {
1442
- r.unsubscribe(e);
1443
- }, n;
1444
- }, t(function(t) {
1445
- r.reason || (r.reason = new X(t), e(r.reason));
1446
- });
1447
- }
1448
- Ot.prototype.throwIfRequested = function() {
1449
- if (this.reason) throw this.reason;
1450
- }, Ot.prototype.subscribe = function(t) {
1451
- this.reason ? t(this.reason) : this._listeners ? this._listeners.push(t) : this._listeners = [ t ];
1452
- }, Ot.prototype.unsubscribe = function(t) {
1453
- if (this._listeners) {
1454
- var e = this._listeners.indexOf(t);
1455
- -1 !== e && this._listeners.splice(e, 1);
1456
- }
1457
- }, Ot.source = function() {
1458
- var t;
1459
- return {
1460
- token: new Ot(function(e) {
1461
- t = e;
1462
- }),
1463
- cancel: t
1464
- };
1465
- }, Rt = Ot;
1466
- var Ct = {}, Bt = function t(e) {
1467
- var r = new Tt(e), n = o(Tt.prototype.request, r);
1468
- return A.extend(n, Tt.prototype, r), A.extend(n, r), n.create = function(r) {
1469
- return t(mt(e, r));
1470
- }, n;
1471
- }(ht);
1472
- Bt.Axios = Tt, Bt.CanceledError = X, Bt.CancelToken = Rt, Bt.isCancel = dt,
1473
- Bt.VERSION = wt, Bt.toFormData = V, Bt.AxiosError = C, Bt.Cancel = Bt.CanceledError,
1474
- Bt.all = function(t) {
1475
- return Promise.all(t);
1476
- }, Bt.spread = function(t) {
1477
- return function(e) {
1478
- return t.apply(null, e);
1479
- };
1480
- }, Bt.isAxiosError = function(t) {
1481
- return A.isObject(t) && !0 === t.isAxiosError;
1482
- }, (Ct = Bt).default = Bt;
1483
- var Ut = Ct, kt = {}, jt = {};
1484
- return function(t) {
1485
- (function() {
1486
- "use strict";
1487
- function e(t, e) {
1488
- var n = "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"];
1489
- if (!n) {
1490
- if (Array.isArray(t) || (n = r(t)) || e && t && "number" == typeof t.length) {
1491
- n && (t = n);
1492
- var o = 0, i = function() {};
1493
- return {
1494
- s: i,
1495
- n: function() {
1496
- return o >= t.length ? {
1497
- done: !0
1498
- } : {
1499
- done: !1,
1500
- value: t[o++]
1501
- };
1502
- },
1503
- e: function(t) {
1504
- throw t;
1505
- },
1506
- f: i
1507
- };
1508
- }
1509
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1510
- }
1511
- var a, s = !0, u = !1;
1512
- return {
1513
- s: function() {
1514
- n = n.call(t);
1515
- },
1516
- n: function() {
1517
- var t = n.next();
1518
- return s = t.done, t;
1519
- },
1520
- e: function(t) {
1521
- u = !0, a = t;
1522
- },
1523
- f: function() {
1524
- try {
1525
- s || null == n.return || n.return();
1526
- } finally {
1527
- if (u) throw a;
1528
- }
1529
- }
1530
- };
1531
- }
1532
- function r(t, e) {
1533
- if (t) {
1534
- if ("string" == typeof t) return n(t, e);
1535
- var r = Object.prototype.toString.call(t).slice(8, -1);
1536
- return "Object" === r && t.constructor && (r = t.constructor.name),
1537
- "Map" === r || "Set" === r ? Array.from(t) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? n(t, e) : void 0;
1538
- }
1539
- }
1540
- function n(t, e) {
1541
- (null == e || e > t.length) && (e = t.length);
1542
- for (var r = 0, n = new Array(e); r < e; r++) n[r] = t[r];
1543
- return n;
1544
- }
1545
- function o(t) {
1546
- return (o = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
1547
- return typeof t;
1548
- } : function(t) {
1549
- return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
1550
- })(t);
1551
- }
1552
- function i(t, e) {
1553
- if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
1554
- }
1555
- function a(t, e) {
1556
- for (var r = 0; r < e.length; r++) {
1557
- var n = e[r];
1558
- n.enumerable = n.enumerable || !1, n.configurable = !0,
1559
- "value" in n && (n.writable = !0), Object.defineProperty(t, (void 0,
1560
- i = function(t, e) {
1561
- if ("object" !== o(t) || null === t) return t;
1562
- var r = t[Symbol.toPrimitive];
1563
- if (void 0 !== r) {
1564
- var n = r.call(t, "string");
1565
- if ("object" !== o(n)) return n;
1566
- throw new TypeError("@@toPrimitive must return a primitive value.");
1567
- }
1568
- return String(t);
1569
- }(n.key), "symbol" === o(i) ? i : String(i)), n);
1570
- }
1571
- var i;
1572
- }
1573
- function s(t, e, r) {
1574
- return e && a(t.prototype, e), r && a(t, r), Object.defineProperty(t, "prototype", {
1575
- writable: !1
1576
- }), t;
1577
- }
1578
- Object.defineProperty(jt, "__esModule", {
1579
- value: !0
1580
- }), jt.varsnap = jt.clientName = jt.version = void 0;
1581
- jt.version = "1.8.5", jt.clientName = "javascript." + jt.version;
1582
- var u = {
1583
- varsnap: !0,
1584
- env: "development",
1585
- branch: "",
1586
- producerToken: "",
1587
- consumerToken: "",
1588
- logger: console
1589
- }, f = [], c = [], l = function() {
1590
- function e() {
1591
- i(this, e);
1592
- }
1593
- return s(e, null, [ {
1594
- key: "getConfig",
1595
- value: function(t, e) {
1596
- if (!t) return "";
1597
- var r = t[e];
1598
- return r ? r = r.toString().toLowerCase() : "";
1599
- }
1600
- }, {
1601
- key: "setConfig",
1602
- value: function(t, e, r) {
1603
- return "varsnap" === e && ("string" == typeof r && (r = "true" === r),
1604
- t[e] = r), "env" !== e && "producerToken" !== e && "consumerToken" !== e && "branch" !== e || (t[e] = r),
1605
- "logger" === e && (t[e] = r), t;
1606
- }
1607
- }, {
1608
- key: "getSignature",
1609
- value: function(t, e) {
1610
- var r = "";
1611
- return r = "" !== e && void 0 !== e ? e : (r = (r = t.toString().split("{")[0]).replace(/^\s+|\s+$/g, "")).replace(/,\s+/g, ","),
1612
- "javascript." + jt.version + "." + r;
1613
- }
1614
- }, {
1615
- key: "ajax",
1616
- value: function(t, r) {
1617
- var n = {
1618
- method: "POST",
1619
- url: t,
1620
- headers: {
1621
- "Content-Type": "application/x-www-form-urlencoded"
1622
- },
1623
- data: new URLSearchParams(r).toString(),
1624
- responseType: "json"
1625
- };
1626
- return e.isNode() && n.headers && (n.headers["User-Agent"] = "varsnap.js"),
1627
- (0, Ut.default)(n).then(function(t) {
1628
- return t.data;
1629
- }).catch(function(t) {
1630
- return t;
1631
- });
1632
- }
1633
- }, {
1634
- key: "debug",
1635
- value: function(t, e) {
1636
- t.logger && t.logger.debug(e);
1637
- }
1638
- }, {
1639
- key: "log",
1640
- value: function(t, e) {
1641
- t.logger && t.logger.log(e);
1642
- }
1643
- }, {
1644
- key: "error",
1645
- value: function(t, e) {
1646
- t.logger && t.logger.error(e);
1647
- }
1648
- }, {
1649
- key: "resetProducers",
1650
- value: function() {
1651
- f = [];
1652
- }
1653
- }, {
1654
- key: "resetConsumers",
1655
- value: function() {
1656
- c = [];
1657
- }
1658
- }, {
1659
- key: "getProducers",
1660
- value: function() {
1661
- return f;
1662
- }
1663
- }, {
1664
- key: "getConsumers",
1665
- value: function() {
1666
- return c;
1667
- }
1668
- }, {
1669
- key: "limitString",
1670
- value: function(t) {
1671
- var e = String(t);
1672
- return e.length <= 30 ? e : e.substring(0, 30 - "...".length) + "...";
1673
- }
1674
- }, {
1675
- key: "isNode",
1676
- value: function() {
1677
- return "object" === (void 0 === t ? "undefined" : o(t)) && "undefined" == typeof window;
1678
- }
1679
- }, {
1680
- key: "getBranch",
1681
- value: function(t) {
1682
- var r = e.getConfig(t, "branch");
1683
- return r ? new Promise(function(t) {
1684
- return t(r);
1685
- }) : e.isNode() ? new Promise(function(t) {
1686
- (0, kt.exec)("git rev-parse --abbrev-ref HEAD", function(e, r) {
1687
- return t(r.trim());
1688
- });
1689
- }) : new Promise(function(t) {
1690
- return t("");
1691
- });
1692
- }
1693
- } ]), e;
1694
- }(), h = function() {
1695
- function t(e, r, n) {
1696
- i(this, t), this.targetFunc = e, this.signature = r, this.config = n;
1697
- }
1698
- return s(t, [ {
1699
- key: "isEnabled",
1700
- value: function() {
1701
- return !!this.config.varsnap && "production" === l.getConfig(this.config, "env") && !!l.getConfig(this.config, "producerToken");
1702
- }
1703
- }, {
1704
- key: "produce",
1705
- value: function(e, r) {
1706
- var n = this;
1707
- return this.isEnabled() ? (l.debug(this.config, "Sending call to Varsnap"),
1708
- Promise.resolve(r).then(function(r) {
1709
- var o = {
1710
- producer_token: l.getConfig(n.config, "producerToken"),
1711
- signature: n.signature,
1712
- inputs: t.serialize(e),
1713
- prod_outputs: t.serialize(r)
1714
- };
1715
- return l.ajax("https://www.varsnap.com/api/snap/produce/", o).then(function() {
1716
- return !0;
1717
- }).catch(function(t) {
1718
- if (t.response) {
1719
- if (429 === t.response.status) return l.error(n.config, "Cannot produce to Varsnap; Signature at rate limit"),
1720
- !0;
1721
- 404 === t.response.status ? l.error(n.config, "Cannot produce to Varsnap; check your producer token") : l.error(n.config, t.response.statusText);
1722
- }
1723
- return !1;
1724
- });
1725
- })) : new Promise(function(t) {
1726
- return t(!1);
1727
- });
1728
- }
1729
- } ], [ {
1730
- key: "serialize",
1731
- value: function(t) {
1732
- return JSON.stringify(t);
1733
- }
1734
- }, {
1735
- key: "serialize_formatted",
1736
- value: function(t) {
1737
- return JSON.stringify(t, null, 2);
1738
- }
1739
- } ]), t;
1740
- }(), p = function() {
1741
- function t(e, r, n) {
1742
- i(this, t), this.targetFunc = e, this.signature = r, this.config = n;
1743
- }
1744
- return s(t, [ {
1745
- key: "isEnabled",
1746
- value: function() {
1747
- return !!this.config.varsnap && "development" === l.getConfig(this.config, "env") && !!l.getConfig(this.config, "consumerToken");
1748
- }
1749
- }, {
1750
- key: "consume",
1751
- value: function(o) {
1752
- var i = this;
1753
- if (!this.isEnabled()) return new Promise(function(t) {
1754
- return l.error(i.config, "Varsnap not enabled for testing"),
1755
- t(!1);
1756
- });
1757
- var a = {
1758
- consumer_token: l.getConfig(this.config, "consumerToken"),
1759
- signature: this.signature
1760
- };
1761
- return l.ajax("https://www.varsnap.com/api/snap/consume/", a).then(function(s) {
1762
- var u = s;
1763
- if (!u || "ok" !== u.status) return [ new Promise(function(t) {
1764
- return l.error(i.config, "Received error from Varsnap: " + u.status),
1765
- t(!1);
1766
- }) ];
1767
- 0 === u.results.length && l.log(i.config, "No snaps found for signature: " + a.signature);
1768
- var f, c = [], p = e(u.results);
1769
- try {
1770
- var d = function() {
1771
- var e, a, s = f.value, u = t.deserialize(s.inputs), l = t.deserialize(s.prod_outputs);
1772
- try {
1773
- e = i.targetFunc.apply(i, function(t) {
1774
- if (Array.isArray(t)) return n(t);
1775
- }(a = u) || function(t) {
1776
- if ("undefined" != typeof Symbol && null != t[Symbol.iterator] || null != t["@@iterator"]) return Array.from(t);
1777
- }(a) || r(a) || function() {
1778
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1779
- }());
1780
- } catch (d) {
1781
- e = d;
1782
- }
1783
- var p = Promise.resolve(e).then(function(t) {
1784
- var e = h.serialize(l) === h.serialize(t);
1785
- return i.reportCentral(o, s, l, t, e).then(function(r) {
1786
- i.reportLog(s.id, u, l, t, e, r);
1787
- }), e;
1788
- });
1789
- c.push(p);
1790
- };
1791
- for (p.s(); !(f = p.n()).done; ) d();
1792
- } catch (g) {
1793
- p.e(g);
1794
- } finally {
1795
- p.f();
1796
- }
1797
- return c;
1798
- }).then(function(t) {
1799
- return Promise.all(t).then(function(t) {
1800
- return t.every(function(t) {
1801
- return t;
1802
- });
1803
- });
1804
- }).catch(function(t) {
1805
- return l.error(i.config, "Cannot contact Varsnap: " + t),
1806
- !1;
1807
- });
1808
- }
1809
- }, {
1810
- key: "reportCentral",
1811
- value: function(t, e, r, n, o) {
1812
- var i = this, a = {
1813
- trial_group_id: t.trial_group_id,
1814
- consumer_token: l.getConfig(this.config, "consumerToken"),
1815
- snap_id: e.id,
1816
- test_outputs: h.serialize(n),
1817
- matches: o.toString(),
1818
- snap_outputs_formatted: h.serialize_formatted(r),
1819
- test_outputs_formatted: h.serialize_formatted(n)
1820
- };
1821
- return l.ajax("https://www.varsnap.com/api/trial/produce/", a).then(function(t) {
1822
- var e = t;
1823
- return !(!e || "ok" !== e.status) && e.trial_url;
1824
- }).catch(function(t) {
1825
- return l.error(i.config, "Cannot upload test results to Varsnap: " + t),
1826
- !1;
1827
- });
1828
- }
1829
- }, {
1830
- key: "reportLog",
1831
- value: function(t, e, r, n, o, i) {
1832
- if (!o) {
1833
- l.log(this.config, ""), l.log(this.config, "Testing with Varsnap uuid: " + t),
1834
- l.log(this.config, "Signature: " + this.signature),
1835
- l.log(this.config, "Function input args: " + l.limitString(e)),
1836
- l.log(this.config, "Production function outputs: " + l.limitString(r)),
1837
- l.log(this.config, "Your function outputs: " + l.limitString(n)),
1838
- l.log(this.config, "Matching outputs: " + o);
1839
- var a = "Cannot upload trial";
1840
- i && (a = String(i)), l.log(this.config, "Trial URL: " + a);
1841
- }
1842
- }
1843
- }, {
1844
- key: "reportTrialGroup",
1845
- value: function(t) {
1846
- l.log(this.config, "Trial Group: " + t.trial_group_url);
1847
- }
1848
- } ], [ {
1849
- key: "deserialize",
1850
- value: function(t) {
1851
- if ("" !== t) return JSON.parse(t);
1852
- }
1853
- } ]), t;
1854
- }();
1855
- function d(t, e) {
1856
- void 0 === e && (e = "");
1857
- var r = l.getSignature(t, e), n = new h(t, r, d._config), o = new p(t, r, d._config), i = function() {
1858
- for (var e, r = arguments.length, o = new Array(r), i = 0; i < r; i++) o[i] = arguments[i];
1859
- try {
1860
- e = t.apply(void 0, o);
1861
- } catch (a) {
1862
- throw n.produce(o, a), a;
1863
- }
1864
- return n.produce(o, e), e;
1865
- };
1866
- return i.producer = n, i.consumer = o, i.signature = r, f.push(n),
1867
- c.push(o), i;
1868
- }
1869
- function g() {
1870
- var t, r = l.getConsumers();
1871
- return 0 === r.length ? Promise.resolve(!0) : (t = r[0].config,
1872
- l.getBranch(t).then(function(e) {
1873
- return {
1874
- branch: e,
1875
- consumer_token: l.getConfig(t, "consumerToken"),
1876
- client: jt.clientName
1877
- };
1878
- }).then(function(t) {
1879
- var e = t;
1880
- return l.ajax("https://www.varsnap.com/api/trial_group/", e);
1881
- }).then(function(t) {
1882
- return t;
1883
- }).catch(function(e) {
1884
- var r;
1885
- return r = e && e.response && e.response.data ? e.response.data.error : e.toString(),
1886
- l.error(t, "Cannot generate a new Trial Group: " + r), {
1887
- status: "not ok",
1888
- project_id: "",
1889
- trial_group_id: "",
1890
- trial_group_url: ""
1891
- };
1892
- })).then(function(t) {
1893
- var n, o = [], i = e(r);
1894
- try {
1895
- for (i.s(); !(n = i.n()).done; ) {
1896
- var a = n.value.consume(t);
1897
- o.push(a);
1898
- }
1899
- } catch (s) {
1900
- i.e(s);
1901
- } finally {
1902
- i.f();
1903
- }
1904
- return r.length > 0 && r[0].reportTrialGroup(t), Promise.all(o);
1905
- }).then(function(t) {
1906
- return t.every(function(t) {
1907
- return t;
1908
- });
1909
- });
1910
- }
1911
- jt.varsnap = d, d._config = u, d.updateConfig = function(t) {
1912
- for (var e = d._config, r = 0, n = Object.keys(d._config); r < n.length; r++) {
1913
- var o = n[r];
1914
- Object.prototype.hasOwnProperty.call(t, o) && (e = l.setConfig(e, o, t[o]));
1915
- }
1916
- d._config = e;
1917
- }, d.reset = function() {
1918
- l.resetConsumers(), l.resetProducers();
1919
- }, d.version = jt.version, d.runTests = g;
1920
- }).call(this);
1921
- }.call(this, G), jt.varsnap;
1922
- });
1923
- })(typeof Varsnap == "undefined" ? Varsnap = {} : Varsnap);