@fuul/sdk 4.12.1 → 5.0.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/HttpClient.d.ts +11 -10
- package/dist/HttpClient.d.ts.map +1 -1
- package/dist/affiliates/AffiliateService.d.ts +4 -3
- package/dist/affiliates/AffiliateService.d.ts.map +1 -1
- package/dist/audiences/AudienceService.d.ts.map +1 -1
- package/dist/core.d.ts +9 -2
- package/dist/core.d.ts.map +1 -1
- package/dist/index.mjs +486 -436
- package/dist/index.umd.js +5 -5
- package/dist/leaderboard/LeaderboardService.d.ts.map +1 -1
- package/dist/payouts/PayoutService.d.ts.map +1 -1
- package/dist/release.json.d.ts +1 -1
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/sdk.d.ts +2 -0
- package/dist/types/sdk.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
var Rt = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var R = (e, t, n) =>
|
|
4
|
-
function
|
|
2
|
+
var Tt = (e, t, n) => t in e ? Rt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var R = (e, t, n) => Tt(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
function Qe(e, t) {
|
|
5
5
|
return function() {
|
|
6
6
|
return e.apply(t, arguments);
|
|
7
7
|
};
|
|
8
8
|
}
|
|
9
|
-
const { toString:
|
|
10
|
-
const n =
|
|
9
|
+
const { toString: At } = Object.prototype, { getPrototypeOf: Ee } = Object, te = /* @__PURE__ */ ((e) => (t) => {
|
|
10
|
+
const n = At.call(t);
|
|
11
11
|
return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
|
|
12
|
-
})(/* @__PURE__ */ Object.create(null)),
|
|
13
|
-
function
|
|
14
|
-
return e !== null && !J(e) && e.constructor !== null && !J(e.constructor) &&
|
|
12
|
+
})(/* @__PURE__ */ Object.create(null)), _ = (e) => (e = e.toLowerCase(), (t) => te(t) === e), ne = (e) => (t) => typeof t === e, { isArray: j } = Array, J = ne("undefined");
|
|
13
|
+
function Pt(e) {
|
|
14
|
+
return e !== null && !J(e) && e.constructor !== null && !J(e.constructor) && O(e.constructor.isBuffer) && e.constructor.isBuffer(e);
|
|
15
15
|
}
|
|
16
|
-
const
|
|
17
|
-
function
|
|
16
|
+
const Ge = _("ArrayBuffer");
|
|
17
|
+
function Ot(e) {
|
|
18
18
|
let t;
|
|
19
|
-
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer &&
|
|
19
|
+
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && Ge(e.buffer), t;
|
|
20
20
|
}
|
|
21
|
-
const
|
|
21
|
+
const _t = ne("string"), O = ne("function"), Xe = ne("number"), re = (e) => e !== null && typeof e == "object", xt = (e) => e === !0 || e === !1, X = (e) => {
|
|
22
22
|
if (te(e) !== "object")
|
|
23
23
|
return !1;
|
|
24
24
|
const t = Ee(e);
|
|
25
25
|
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Symbol.toStringTag in e) && !(Symbol.iterator in e);
|
|
26
|
-
}, Nt =
|
|
26
|
+
}, Nt = _("Date"), Ut = _("File"), Lt = _("Blob"), Dt = _("FileList"), Ft = (e) => re(e) && O(e.pipe), Bt = (e) => {
|
|
27
27
|
let t;
|
|
28
|
-
return e && (typeof FormData == "function" && e instanceof FormData ||
|
|
29
|
-
t === "object" &&
|
|
30
|
-
},
|
|
28
|
+
return e && (typeof FormData == "function" && e instanceof FormData || O(e.append) && ((t = te(e)) === "formdata" || // detect form-data instance
|
|
29
|
+
t === "object" && O(e.toString) && e.toString() === "[object FormData]"));
|
|
30
|
+
}, kt = _("URLSearchParams"), [vt, qt, It, jt] = ["ReadableStream", "Request", "Response", "Headers"].map(_), Ht = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
31
31
|
function M(e, t, { allOwnKeys: n = !1 } = {}) {
|
|
32
32
|
if (e === null || typeof e > "u")
|
|
33
33
|
return;
|
|
@@ -42,7 +42,7 @@ function M(e, t, { allOwnKeys: n = !1 } = {}) {
|
|
|
42
42
|
c = o[r], t.call(null, e[c], c, e);
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function Ye(e, t) {
|
|
46
46
|
t = t.toLowerCase();
|
|
47
47
|
const n = Object.keys(e);
|
|
48
48
|
let r = n.length, s;
|
|
@@ -51,18 +51,18 @@ function Qe(e, t) {
|
|
|
51
51
|
return s;
|
|
52
52
|
return null;
|
|
53
53
|
}
|
|
54
|
-
const
|
|
54
|
+
const k = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, Ze = (e) => !J(e) && e !== k;
|
|
55
55
|
function de() {
|
|
56
56
|
const { caseless: e } = Ze(this) && this || {}, t = {}, n = (r, s) => {
|
|
57
|
-
const o = e &&
|
|
58
|
-
|
|
57
|
+
const o = e && Ye(t, s) || s;
|
|
58
|
+
X(t[o]) && X(r) ? t[o] = de(t[o], r) : X(r) ? t[o] = de({}, r) : j(r) ? t[o] = r.slice() : t[o] = r;
|
|
59
59
|
};
|
|
60
60
|
for (let r = 0, s = arguments.length; r < s; r++)
|
|
61
61
|
arguments[r] && M(arguments[r], n);
|
|
62
62
|
return t;
|
|
63
63
|
}
|
|
64
|
-
const
|
|
65
|
-
n &&
|
|
64
|
+
const $t = (e, t, n, { allOwnKeys: r } = {}) => (M(t, (s, o) => {
|
|
65
|
+
n && O(s) ? e[o] = Qe(s, n) : e[o] = s;
|
|
66
66
|
}, { allOwnKeys: r }), e), zt = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), Vt = (e, t, n, r) => {
|
|
67
67
|
e.prototype = Object.create(t.prototype, r), e.prototype.constructor = e, Object.defineProperty(e, "super", {
|
|
68
68
|
value: t.prototype
|
|
@@ -85,30 +85,30 @@ const Ht = (e, t, n, { allOwnKeys: r } = {}) => (M(t, (s, o) => {
|
|
|
85
85
|
if (!e) return null;
|
|
86
86
|
if (j(e)) return e;
|
|
87
87
|
let t = e.length;
|
|
88
|
-
if (!
|
|
88
|
+
if (!Xe(t)) return null;
|
|
89
89
|
const n = new Array(t);
|
|
90
90
|
for (; t-- > 0; )
|
|
91
91
|
n[t] = e[t];
|
|
92
92
|
return n;
|
|
93
|
-
}, Wt = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && Ee(Uint8Array)),
|
|
93
|
+
}, Wt = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && Ee(Uint8Array)), Qt = (e, t) => {
|
|
94
94
|
const r = (e && e[Symbol.iterator]).call(e);
|
|
95
95
|
let s;
|
|
96
96
|
for (; (s = r.next()) && !s.done; ) {
|
|
97
97
|
const o = s.value;
|
|
98
98
|
t.call(e, o[0], o[1]);
|
|
99
99
|
}
|
|
100
|
-
},
|
|
100
|
+
}, Gt = (e, t) => {
|
|
101
101
|
let n;
|
|
102
102
|
const r = [];
|
|
103
103
|
for (; (n = e.exec(t)) !== null; )
|
|
104
104
|
r.push(n);
|
|
105
105
|
return r;
|
|
106
|
-
},
|
|
106
|
+
}, Xt = _("HTMLFormElement"), Yt = (e) => e.toLowerCase().replace(
|
|
107
107
|
/[-_\s]([a-z\d])(\w*)/g,
|
|
108
108
|
function(n, r, s) {
|
|
109
109
|
return r.toUpperCase() + s;
|
|
110
110
|
}
|
|
111
|
-
), xe = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), Zt =
|
|
111
|
+
), xe = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), Zt = _("RegExp"), et = (e, t) => {
|
|
112
112
|
const n = Object.getOwnPropertyDescriptors(e), r = {};
|
|
113
113
|
M(n, (s, o) => {
|
|
114
114
|
let i;
|
|
@@ -116,10 +116,10 @@ const Ht = (e, t, n, { allOwnKeys: r } = {}) => (M(t, (s, o) => {
|
|
|
116
116
|
}), Object.defineProperties(e, r);
|
|
117
117
|
}, en = (e) => {
|
|
118
118
|
et(e, (t, n) => {
|
|
119
|
-
if (
|
|
119
|
+
if (O(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
|
|
120
120
|
return !1;
|
|
121
121
|
const r = e[n];
|
|
122
|
-
if (
|
|
122
|
+
if (O(r)) {
|
|
123
123
|
if (t.enumerable = !1, "writable" in t) {
|
|
124
124
|
t.writable = !1;
|
|
125
125
|
return;
|
|
@@ -149,7 +149,7 @@ const Ht = (e, t, n, { allOwnKeys: r } = {}) => (M(t, (s, o) => {
|
|
|
149
149
|
return n;
|
|
150
150
|
};
|
|
151
151
|
function on(e) {
|
|
152
|
-
return !!(e &&
|
|
152
|
+
return !!(e && O(e.append) && e[Symbol.toStringTag] === "FormData" && e[Symbol.iterator]);
|
|
153
153
|
}
|
|
154
154
|
const an = (e) => {
|
|
155
155
|
const t = new Array(10), n = (r, s) => {
|
|
@@ -160,71 +160,71 @@ const an = (e) => {
|
|
|
160
160
|
t[s] = r;
|
|
161
161
|
const o = j(r) ? [] : {};
|
|
162
162
|
return M(r, (i, c) => {
|
|
163
|
-
const
|
|
164
|
-
!J(
|
|
163
|
+
const l = n(i, s + 1);
|
|
164
|
+
!J(l) && (o[c] = l);
|
|
165
165
|
}), t[s] = void 0, o;
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
168
|
return r;
|
|
169
169
|
};
|
|
170
170
|
return n(e, 0);
|
|
171
|
-
}, cn =
|
|
172
|
-
s ===
|
|
171
|
+
}, cn = _("AsyncFunction"), un = (e) => e && (re(e) || O(e)) && O(e.then) && O(e.catch), nt = ((e, t) => e ? setImmediate : t ? ((n, r) => (k.addEventListener("message", ({ source: s, data: o }) => {
|
|
172
|
+
s === k && o === n && r.length && r.shift()();
|
|
173
173
|
}, !1), (s) => {
|
|
174
|
-
r.push(s),
|
|
174
|
+
r.push(s), k.postMessage(n, "*");
|
|
175
175
|
}))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
|
|
176
176
|
typeof setImmediate == "function",
|
|
177
|
-
|
|
178
|
-
), ln = typeof queueMicrotask < "u" ? queueMicrotask.bind(
|
|
177
|
+
O(k.postMessage)
|
|
178
|
+
), ln = typeof queueMicrotask < "u" ? queueMicrotask.bind(k) : typeof process < "u" && process.nextTick || nt, a = {
|
|
179
179
|
isArray: j,
|
|
180
|
-
isArrayBuffer:
|
|
181
|
-
isBuffer:
|
|
180
|
+
isArrayBuffer: Ge,
|
|
181
|
+
isBuffer: Pt,
|
|
182
182
|
isFormData: Bt,
|
|
183
|
-
isArrayBufferView:
|
|
184
|
-
isString:
|
|
185
|
-
isNumber:
|
|
183
|
+
isArrayBufferView: Ot,
|
|
184
|
+
isString: _t,
|
|
185
|
+
isNumber: Xe,
|
|
186
186
|
isBoolean: xt,
|
|
187
187
|
isObject: re,
|
|
188
|
-
isPlainObject:
|
|
189
|
-
isReadableStream:
|
|
190
|
-
isRequest:
|
|
191
|
-
isResponse:
|
|
188
|
+
isPlainObject: X,
|
|
189
|
+
isReadableStream: vt,
|
|
190
|
+
isRequest: qt,
|
|
191
|
+
isResponse: It,
|
|
192
192
|
isHeaders: jt,
|
|
193
193
|
isUndefined: J,
|
|
194
194
|
isDate: Nt,
|
|
195
195
|
isFile: Ut,
|
|
196
196
|
isBlob: Lt,
|
|
197
197
|
isRegExp: Zt,
|
|
198
|
-
isFunction:
|
|
199
|
-
isStream:
|
|
200
|
-
isURLSearchParams:
|
|
198
|
+
isFunction: O,
|
|
199
|
+
isStream: Ft,
|
|
200
|
+
isURLSearchParams: kt,
|
|
201
201
|
isTypedArray: Wt,
|
|
202
|
-
isFileList:
|
|
202
|
+
isFileList: Dt,
|
|
203
203
|
forEach: M,
|
|
204
204
|
merge: de,
|
|
205
|
-
extend:
|
|
206
|
-
trim:
|
|
205
|
+
extend: $t,
|
|
206
|
+
trim: Ht,
|
|
207
207
|
stripBOM: zt,
|
|
208
208
|
inherits: Vt,
|
|
209
209
|
toFlatObject: Kt,
|
|
210
210
|
kindOf: te,
|
|
211
|
-
kindOfTest:
|
|
211
|
+
kindOfTest: _,
|
|
212
212
|
endsWith: Jt,
|
|
213
213
|
toArray: Mt,
|
|
214
|
-
forEachEntry:
|
|
215
|
-
matchAll:
|
|
216
|
-
isHTMLForm:
|
|
214
|
+
forEachEntry: Qt,
|
|
215
|
+
matchAll: Gt,
|
|
216
|
+
isHTMLForm: Xt,
|
|
217
217
|
hasOwnProperty: xe,
|
|
218
218
|
hasOwnProp: xe,
|
|
219
219
|
// an alias to avoid ESLint no-prototype-builtins detection
|
|
220
220
|
reduceDescriptors: et,
|
|
221
221
|
freezeMethods: en,
|
|
222
222
|
toObjectSet: tn,
|
|
223
|
-
toCamelCase:
|
|
223
|
+
toCamelCase: Yt,
|
|
224
224
|
noop: nn,
|
|
225
225
|
toFiniteNumber: rn,
|
|
226
|
-
findKey:
|
|
227
|
-
global:
|
|
226
|
+
findKey: Ye,
|
|
227
|
+
global: k,
|
|
228
228
|
isContextDefined: Ze,
|
|
229
229
|
ALPHABET: tt,
|
|
230
230
|
generateString: sn,
|
|
@@ -281,8 +281,8 @@ Object.defineProperties(m, st);
|
|
|
281
281
|
Object.defineProperty(rt, "isAxiosError", { value: !0 });
|
|
282
282
|
m.from = (e, t, n, r, s, o) => {
|
|
283
283
|
const i = Object.create(rt);
|
|
284
|
-
return a.toFlatObject(e, i, function(
|
|
285
|
-
return
|
|
284
|
+
return a.toFlatObject(e, i, function(l) {
|
|
285
|
+
return l !== Error.prototype;
|
|
286
286
|
}, (c) => c !== "isAxiosError"), m.call(i, e.message, t, n, r, s), i.cause = e, i.name = e.name, o && Object.assign(i, o), i;
|
|
287
287
|
};
|
|
288
288
|
const fn = null;
|
|
@@ -310,53 +310,53 @@ function se(e, t, n) {
|
|
|
310
310
|
metaTokens: !0,
|
|
311
311
|
dots: !1,
|
|
312
312
|
indexes: !1
|
|
313
|
-
}, !1, function(
|
|
314
|
-
return !a.isUndefined(p[
|
|
313
|
+
}, !1, function(y, p) {
|
|
314
|
+
return !a.isUndefined(p[y]);
|
|
315
315
|
});
|
|
316
|
-
const r = n.metaTokens, s = n.visitor ||
|
|
316
|
+
const r = n.metaTokens, s = n.visitor || f, o = n.dots, i = n.indexes, l = (n.Blob || typeof Blob < "u" && Blob) && a.isSpecCompliantForm(t);
|
|
317
317
|
if (!a.isFunction(s))
|
|
318
318
|
throw new TypeError("visitor must be a function");
|
|
319
319
|
function u(h) {
|
|
320
320
|
if (h === null) return "";
|
|
321
321
|
if (a.isDate(h))
|
|
322
322
|
return h.toISOString();
|
|
323
|
-
if (!
|
|
323
|
+
if (!l && a.isBlob(h))
|
|
324
324
|
throw new m("Blob is not supported. Use a Buffer instead.");
|
|
325
|
-
return a.isArrayBuffer(h) || a.isTypedArray(h) ?
|
|
325
|
+
return a.isArrayBuffer(h) || a.isTypedArray(h) ? l && typeof Blob == "function" ? new Blob([h]) : Buffer.from(h) : h;
|
|
326
326
|
}
|
|
327
|
-
function
|
|
327
|
+
function f(h, y, p) {
|
|
328
328
|
let w = h;
|
|
329
329
|
if (h && !p && typeof h == "object") {
|
|
330
|
-
if (a.endsWith(
|
|
331
|
-
|
|
332
|
-
else if (a.isArray(h) && dn(h) || (a.isFileList(h) || a.endsWith(
|
|
333
|
-
return
|
|
330
|
+
if (a.endsWith(y, "{}"))
|
|
331
|
+
y = r ? y : y.slice(0, -2), h = JSON.stringify(h);
|
|
332
|
+
else if (a.isArray(h) && dn(h) || (a.isFileList(h) || a.endsWith(y, "[]")) && (w = a.toArray(h)))
|
|
333
|
+
return y = ot(y), w.forEach(function(C, N) {
|
|
334
334
|
!(a.isUndefined(C) || C === null) && t.append(
|
|
335
335
|
// eslint-disable-next-line no-nested-ternary
|
|
336
|
-
i === !0 ? Ue([
|
|
336
|
+
i === !0 ? Ue([y], N, o) : i === null ? y : y + "[]",
|
|
337
337
|
u(C)
|
|
338
338
|
);
|
|
339
339
|
}), !1;
|
|
340
340
|
}
|
|
341
|
-
return he(h) ? !0 : (t.append(Ue(p,
|
|
341
|
+
return he(h) ? !0 : (t.append(Ue(p, y, o), u(h)), !1);
|
|
342
342
|
}
|
|
343
|
-
const d = [],
|
|
344
|
-
defaultVisitor:
|
|
343
|
+
const d = [], g = Object.assign(hn, {
|
|
344
|
+
defaultVisitor: f,
|
|
345
345
|
convertValue: u,
|
|
346
346
|
isVisitable: he
|
|
347
347
|
});
|
|
348
|
-
function E(h,
|
|
348
|
+
function E(h, y) {
|
|
349
349
|
if (!a.isUndefined(h)) {
|
|
350
350
|
if (d.indexOf(h) !== -1)
|
|
351
|
-
throw Error("Circular reference detected in " +
|
|
351
|
+
throw Error("Circular reference detected in " + y.join("."));
|
|
352
352
|
d.push(h), a.forEach(h, function(w, S) {
|
|
353
353
|
(!(a.isUndefined(w) || w === null) && s.call(
|
|
354
354
|
t,
|
|
355
355
|
w,
|
|
356
356
|
a.isString(S) ? S.trim() : S,
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
)) === !0 && E(w,
|
|
357
|
+
y,
|
|
358
|
+
g
|
|
359
|
+
)) === !0 && E(w, y ? y.concat(S) : [S]);
|
|
360
360
|
}), d.pop();
|
|
361
361
|
}
|
|
362
362
|
}
|
|
@@ -407,7 +407,7 @@ function at(e, t, n) {
|
|
|
407
407
|
}
|
|
408
408
|
return e;
|
|
409
409
|
}
|
|
410
|
-
class
|
|
410
|
+
class De {
|
|
411
411
|
constructor() {
|
|
412
412
|
this.handlers = [];
|
|
413
413
|
}
|
|
@@ -465,12 +465,12 @@ const ct = {
|
|
|
465
465
|
silentJSONParsing: !0,
|
|
466
466
|
forcedJSONParsing: !0,
|
|
467
467
|
clarifyTimeoutError: !1
|
|
468
|
-
}, mn = typeof URLSearchParams < "u" ? URLSearchParams : Se,
|
|
468
|
+
}, mn = typeof URLSearchParams < "u" ? URLSearchParams : Se, yn = typeof FormData < "u" ? FormData : null, gn = typeof Blob < "u" ? Blob : null, wn = {
|
|
469
469
|
isBrowser: !0,
|
|
470
470
|
classes: {
|
|
471
471
|
URLSearchParams: mn,
|
|
472
|
-
FormData:
|
|
473
|
-
Blob:
|
|
472
|
+
FormData: yn,
|
|
473
|
+
Blob: gn
|
|
474
474
|
},
|
|
475
475
|
protocols: ["http", "https", "file", "blob", "url", "data"]
|
|
476
476
|
}, Ce = typeof window < "u" && typeof document < "u", pe = typeof navigator == "object" && navigator || void 0, bn = Ce && (!pe || ["ReactNative", "NativeScript", "NS"].indexOf(pe.product) < 0), En = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
|
|
@@ -481,21 +481,21 @@ self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Sn
|
|
|
481
481
|
hasStandardBrowserWebWorkerEnv: En,
|
|
482
482
|
navigator: pe,
|
|
483
483
|
origin: Sn
|
|
484
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
484
|
+
}, Symbol.toStringTag, { value: "Module" })), A = {
|
|
485
485
|
...Cn,
|
|
486
486
|
...wn
|
|
487
487
|
};
|
|
488
488
|
function Rn(e, t) {
|
|
489
|
-
return se(e, new
|
|
489
|
+
return se(e, new A.classes.URLSearchParams(), Object.assign({
|
|
490
490
|
visitor: function(n, r, s, o) {
|
|
491
|
-
return
|
|
491
|
+
return A.isNode && a.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : o.defaultVisitor.apply(this, arguments);
|
|
492
492
|
}
|
|
493
493
|
}, t));
|
|
494
494
|
}
|
|
495
|
-
function
|
|
495
|
+
function Tn(e) {
|
|
496
496
|
return a.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
|
|
497
497
|
}
|
|
498
|
-
function
|
|
498
|
+
function An(e) {
|
|
499
499
|
const t = {}, n = Object.keys(e);
|
|
500
500
|
let r;
|
|
501
501
|
const s = n.length;
|
|
@@ -508,18 +508,18 @@ function ut(e) {
|
|
|
508
508
|
function t(n, r, s, o) {
|
|
509
509
|
let i = n[o++];
|
|
510
510
|
if (i === "__proto__") return !0;
|
|
511
|
-
const c = Number.isFinite(+i),
|
|
512
|
-
return i = !i && a.isArray(s) ? s.length : i,
|
|
511
|
+
const c = Number.isFinite(+i), l = o >= n.length;
|
|
512
|
+
return i = !i && a.isArray(s) ? s.length : i, l ? (a.hasOwnProp(s, i) ? s[i] = [s[i], r] : s[i] = r, !c) : ((!s[i] || !a.isObject(s[i])) && (s[i] = []), t(n, r, s[i], o) && a.isArray(s[i]) && (s[i] = An(s[i])), !c);
|
|
513
513
|
}
|
|
514
514
|
if (a.isFormData(e) && a.isFunction(e.entries)) {
|
|
515
515
|
const n = {};
|
|
516
516
|
return a.forEachEntry(e, (r, s) => {
|
|
517
|
-
t(
|
|
517
|
+
t(Tn(r), s, n, 0);
|
|
518
518
|
}), n;
|
|
519
519
|
}
|
|
520
520
|
return null;
|
|
521
521
|
}
|
|
522
|
-
function
|
|
522
|
+
function Pn(e, t, n) {
|
|
523
523
|
if (a.isString(e))
|
|
524
524
|
try {
|
|
525
525
|
return (t || JSON.parse)(e), a.trim(e);
|
|
@@ -547,15 +547,15 @@ const W = {
|
|
|
547
547
|
if (r.indexOf("application/x-www-form-urlencoded") > -1)
|
|
548
548
|
return Rn(t, this.formSerializer).toString();
|
|
549
549
|
if ((c = a.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {
|
|
550
|
-
const
|
|
550
|
+
const l = this.env && this.env.FormData;
|
|
551
551
|
return se(
|
|
552
552
|
c ? { "files[]": t } : t,
|
|
553
|
-
|
|
553
|
+
l && new l(),
|
|
554
554
|
this.formSerializer
|
|
555
555
|
);
|
|
556
556
|
}
|
|
557
557
|
}
|
|
558
|
-
return o || s ? (n.setContentType("application/json", !1),
|
|
558
|
+
return o || s ? (n.setContentType("application/json", !1), Pn(t)) : t;
|
|
559
559
|
}],
|
|
560
560
|
transformResponse: [function(t) {
|
|
561
561
|
const n = this.transitional || W.transitional, r = n && n.forcedJSONParsing, s = this.responseType === "json";
|
|
@@ -582,8 +582,8 @@ const W = {
|
|
|
582
582
|
maxContentLength: -1,
|
|
583
583
|
maxBodyLength: -1,
|
|
584
584
|
env: {
|
|
585
|
-
FormData:
|
|
586
|
-
Blob:
|
|
585
|
+
FormData: A.classes.FormData,
|
|
586
|
+
Blob: A.classes.Blob
|
|
587
587
|
},
|
|
588
588
|
validateStatus: function(t) {
|
|
589
589
|
return t >= 200 && t < 300;
|
|
@@ -598,7 +598,7 @@ const W = {
|
|
|
598
598
|
a.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
|
|
599
599
|
W.headers[e] = {};
|
|
600
600
|
});
|
|
601
|
-
const
|
|
601
|
+
const On = a.toObjectSet([
|
|
602
602
|
"age",
|
|
603
603
|
"authorization",
|
|
604
604
|
"content-length",
|
|
@@ -616,19 +616,19 @@ const _n = a.toObjectSet([
|
|
|
616
616
|
"referer",
|
|
617
617
|
"retry-after",
|
|
618
618
|
"user-agent"
|
|
619
|
-
]),
|
|
619
|
+
]), _n = (e) => {
|
|
620
620
|
const t = {};
|
|
621
621
|
let n, r, s;
|
|
622
622
|
return e && e.split(`
|
|
623
623
|
`).forEach(function(i) {
|
|
624
|
-
s = i.indexOf(":"), n = i.substring(0, s).trim().toLowerCase(), r = i.substring(s + 1).trim(), !(!n || t[n] &&
|
|
624
|
+
s = i.indexOf(":"), n = i.substring(0, s).trim().toLowerCase(), r = i.substring(s + 1).trim(), !(!n || t[n] && On[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r);
|
|
625
625
|
}), t;
|
|
626
|
-
},
|
|
626
|
+
}, Fe = Symbol("internals");
|
|
627
627
|
function V(e) {
|
|
628
628
|
return e && String(e).trim().toLowerCase();
|
|
629
629
|
}
|
|
630
|
-
function
|
|
631
|
-
return e === !1 || e == null ? e : a.isArray(e) ? e.map(
|
|
630
|
+
function Y(e) {
|
|
631
|
+
return e === !1 || e == null ? e : a.isArray(e) ? e.map(Y) : String(e);
|
|
632
632
|
}
|
|
633
633
|
function xn(e) {
|
|
634
634
|
const t = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
@@ -662,27 +662,27 @@ function Ln(e, t) {
|
|
|
662
662
|
});
|
|
663
663
|
});
|
|
664
664
|
}
|
|
665
|
-
let
|
|
665
|
+
let P = class {
|
|
666
666
|
constructor(t) {
|
|
667
667
|
t && this.set(t);
|
|
668
668
|
}
|
|
669
669
|
set(t, n, r) {
|
|
670
670
|
const s = this;
|
|
671
|
-
function o(c,
|
|
672
|
-
const
|
|
673
|
-
if (!
|
|
671
|
+
function o(c, l, u) {
|
|
672
|
+
const f = V(l);
|
|
673
|
+
if (!f)
|
|
674
674
|
throw new Error("header name must be a non-empty string");
|
|
675
|
-
const d = a.findKey(s,
|
|
676
|
-
(!d || s[d] === void 0 || u === !0 || u === void 0 && s[d] !== !1) && (s[d ||
|
|
675
|
+
const d = a.findKey(s, f);
|
|
676
|
+
(!d || s[d] === void 0 || u === !0 || u === void 0 && s[d] !== !1) && (s[d || l] = Y(c));
|
|
677
677
|
}
|
|
678
|
-
const i = (c,
|
|
678
|
+
const i = (c, l) => a.forEach(c, (u, f) => o(u, f, l));
|
|
679
679
|
if (a.isPlainObject(t) || t instanceof this.constructor)
|
|
680
680
|
i(t, n);
|
|
681
681
|
else if (a.isString(t) && (t = t.trim()) && !Nn(t))
|
|
682
|
-
i(
|
|
682
|
+
i(_n(t), n);
|
|
683
683
|
else if (a.isHeaders(t))
|
|
684
|
-
for (const [c,
|
|
685
|
-
o(
|
|
684
|
+
for (const [c, l] of t.entries())
|
|
685
|
+
o(l, c, r);
|
|
686
686
|
else
|
|
687
687
|
t != null && o(n, t, r);
|
|
688
688
|
return this;
|
|
@@ -736,11 +736,11 @@ let O = class {
|
|
|
736
736
|
return a.forEach(this, (s, o) => {
|
|
737
737
|
const i = a.findKey(r, o);
|
|
738
738
|
if (i) {
|
|
739
|
-
n[i] =
|
|
739
|
+
n[i] = Y(s), delete n[o];
|
|
740
740
|
return;
|
|
741
741
|
}
|
|
742
742
|
const c = t ? Un(o) : String(o).trim();
|
|
743
|
-
c !== o && delete n[o], n[c] =
|
|
743
|
+
c !== o && delete n[o], n[c] = Y(s), r[c] = !0;
|
|
744
744
|
}), this;
|
|
745
745
|
}
|
|
746
746
|
concat(...t) {
|
|
@@ -770,7 +770,7 @@ let O = class {
|
|
|
770
770
|
return n.forEach((s) => r.set(s)), r;
|
|
771
771
|
}
|
|
772
772
|
static accessor(t) {
|
|
773
|
-
const r = (this[
|
|
773
|
+
const r = (this[Fe] = this[Fe] = {
|
|
774
774
|
accessors: {}
|
|
775
775
|
}).accessors, s = this.prototype;
|
|
776
776
|
function o(i) {
|
|
@@ -780,8 +780,8 @@ let O = class {
|
|
|
780
780
|
return a.isArray(t) ? t.forEach(o) : o(t), this;
|
|
781
781
|
}
|
|
782
782
|
};
|
|
783
|
-
|
|
784
|
-
a.reduceDescriptors(
|
|
783
|
+
P.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
|
|
784
|
+
a.reduceDescriptors(P.prototype, ({ value: e }, t) => {
|
|
785
785
|
let n = t[0].toUpperCase() + t.slice(1);
|
|
786
786
|
return {
|
|
787
787
|
get: () => e,
|
|
@@ -790,9 +790,9 @@ a.reduceDescriptors(O.prototype, ({ value: e }, t) => {
|
|
|
790
790
|
}
|
|
791
791
|
};
|
|
792
792
|
});
|
|
793
|
-
a.freezeMethods(
|
|
793
|
+
a.freezeMethods(P);
|
|
794
794
|
function le(e, t) {
|
|
795
|
-
const n = this || W, r = t || n, s =
|
|
795
|
+
const n = this || W, r = t || n, s = P.from(r.headers);
|
|
796
796
|
let o = r.data;
|
|
797
797
|
return a.forEach(e, function(c) {
|
|
798
798
|
o = c.call(n, o, s.normalize(), t ? t.status : void 0);
|
|
@@ -801,10 +801,10 @@ function le(e, t) {
|
|
|
801
801
|
function lt(e) {
|
|
802
802
|
return !!(e && e.__CANCEL__);
|
|
803
803
|
}
|
|
804
|
-
function
|
|
804
|
+
function H(e, t, n) {
|
|
805
805
|
m.call(this, e ?? "canceled", m.ERR_CANCELED, t, n), this.name = "CanceledError";
|
|
806
806
|
}
|
|
807
|
-
a.inherits(
|
|
807
|
+
a.inherits(H, m, {
|
|
808
808
|
__CANCEL__: !0
|
|
809
809
|
});
|
|
810
810
|
function ft(e, t, n) {
|
|
@@ -817,51 +817,51 @@ function ft(e, t, n) {
|
|
|
817
817
|
n
|
|
818
818
|
));
|
|
819
819
|
}
|
|
820
|
-
function
|
|
820
|
+
function Dn(e) {
|
|
821
821
|
const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
|
|
822
822
|
return t && t[1] || "";
|
|
823
823
|
}
|
|
824
|
-
function
|
|
824
|
+
function Fn(e, t) {
|
|
825
825
|
e = e || 10;
|
|
826
826
|
const n = new Array(e), r = new Array(e);
|
|
827
827
|
let s = 0, o = 0, i;
|
|
828
|
-
return t = t !== void 0 ? t : 1e3, function(
|
|
829
|
-
const u = Date.now(),
|
|
830
|
-
i || (i = u), n[s] =
|
|
831
|
-
let d = o,
|
|
828
|
+
return t = t !== void 0 ? t : 1e3, function(l) {
|
|
829
|
+
const u = Date.now(), f = r[o];
|
|
830
|
+
i || (i = u), n[s] = l, r[s] = u;
|
|
831
|
+
let d = o, g = 0;
|
|
832
832
|
for (; d !== s; )
|
|
833
|
-
|
|
833
|
+
g += n[d++], d = d % e;
|
|
834
834
|
if (s = (s + 1) % e, s === o && (o = (o + 1) % e), u - i < t)
|
|
835
835
|
return;
|
|
836
|
-
const E =
|
|
837
|
-
return E ? Math.round(
|
|
836
|
+
const E = f && u - f;
|
|
837
|
+
return E ? Math.round(g * 1e3 / E) : void 0;
|
|
838
838
|
};
|
|
839
839
|
}
|
|
840
840
|
function Bn(e, t) {
|
|
841
841
|
let n = 0, r = 1e3 / t, s, o;
|
|
842
|
-
const i = (u,
|
|
843
|
-
n =
|
|
842
|
+
const i = (u, f = Date.now()) => {
|
|
843
|
+
n = f, s = null, o && (clearTimeout(o), o = null), e.apply(null, u);
|
|
844
844
|
};
|
|
845
845
|
return [(...u) => {
|
|
846
|
-
const
|
|
847
|
-
d >= r ? i(u,
|
|
846
|
+
const f = Date.now(), d = f - n;
|
|
847
|
+
d >= r ? i(u, f) : (s = u, o || (o = setTimeout(() => {
|
|
848
848
|
o = null, i(s);
|
|
849
849
|
}, r - d)));
|
|
850
850
|
}, () => s && i(s)];
|
|
851
851
|
}
|
|
852
852
|
const Z = (e, t, n = 3) => {
|
|
853
853
|
let r = 0;
|
|
854
|
-
const s =
|
|
854
|
+
const s = Fn(50, 250);
|
|
855
855
|
return Bn((o) => {
|
|
856
|
-
const i = o.loaded, c = o.lengthComputable ? o.total : void 0,
|
|
856
|
+
const i = o.loaded, c = o.lengthComputable ? o.total : void 0, l = i - r, u = s(l), f = i <= c;
|
|
857
857
|
r = i;
|
|
858
858
|
const d = {
|
|
859
859
|
loaded: i,
|
|
860
860
|
total: c,
|
|
861
861
|
progress: c ? i / c : void 0,
|
|
862
|
-
bytes:
|
|
862
|
+
bytes: l,
|
|
863
863
|
rate: u || void 0,
|
|
864
|
-
estimated: u && c &&
|
|
864
|
+
estimated: u && c && f ? (c - i) / u : void 0,
|
|
865
865
|
event: o,
|
|
866
866
|
lengthComputable: c != null,
|
|
867
867
|
[t ? "download" : "upload"]: !0
|
|
@@ -875,11 +875,11 @@ const Z = (e, t, n = 3) => {
|
|
|
875
875
|
total: e,
|
|
876
876
|
loaded: r
|
|
877
877
|
}), t[1]];
|
|
878
|
-
},
|
|
878
|
+
}, ke = (e) => (...t) => a.asap(() => e(...t)), kn = A.hasStandardBrowserEnv ? (
|
|
879
879
|
// Standard browser envs have full support of the APIs needed to test
|
|
880
880
|
// whether the request URL is of the same origin as current location.
|
|
881
881
|
function() {
|
|
882
|
-
const t =
|
|
882
|
+
const t = A.navigator && /(msie|trident)/i.test(A.navigator.userAgent), n = document.createElement("a");
|
|
883
883
|
let r;
|
|
884
884
|
function s(o) {
|
|
885
885
|
let i = o;
|
|
@@ -906,7 +906,7 @@ const Z = (e, t, n = 3) => {
|
|
|
906
906
|
return !0;
|
|
907
907
|
};
|
|
908
908
|
}()
|
|
909
|
-
),
|
|
909
|
+
), vn = A.hasStandardBrowserEnv ? (
|
|
910
910
|
// Standard browser envs support document.cookie
|
|
911
911
|
{
|
|
912
912
|
write(e, t, n, r, s, o) {
|
|
@@ -933,45 +933,45 @@ const Z = (e, t, n = 3) => {
|
|
|
933
933
|
}
|
|
934
934
|
}
|
|
935
935
|
);
|
|
936
|
-
function
|
|
936
|
+
function qn(e) {
|
|
937
937
|
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
|
|
938
938
|
}
|
|
939
|
-
function
|
|
939
|
+
function In(e, t) {
|
|
940
940
|
return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
|
|
941
941
|
}
|
|
942
942
|
function dt(e, t) {
|
|
943
|
-
return e && !
|
|
943
|
+
return e && !qn(t) ? In(e, t) : t;
|
|
944
944
|
}
|
|
945
|
-
const
|
|
946
|
-
function
|
|
945
|
+
const ve = (e) => e instanceof P ? { ...e } : e;
|
|
946
|
+
function q(e, t) {
|
|
947
947
|
t = t || {};
|
|
948
948
|
const n = {};
|
|
949
|
-
function r(u,
|
|
950
|
-
return a.isPlainObject(u) && a.isPlainObject(
|
|
949
|
+
function r(u, f, d) {
|
|
950
|
+
return a.isPlainObject(u) && a.isPlainObject(f) ? a.merge.call({ caseless: d }, u, f) : a.isPlainObject(f) ? a.merge({}, f) : a.isArray(f) ? f.slice() : f;
|
|
951
951
|
}
|
|
952
|
-
function s(u,
|
|
953
|
-
if (a.isUndefined(
|
|
952
|
+
function s(u, f, d) {
|
|
953
|
+
if (a.isUndefined(f)) {
|
|
954
954
|
if (!a.isUndefined(u))
|
|
955
955
|
return r(void 0, u, d);
|
|
956
|
-
} else return r(u,
|
|
956
|
+
} else return r(u, f, d);
|
|
957
957
|
}
|
|
958
|
-
function o(u,
|
|
959
|
-
if (!a.isUndefined(
|
|
960
|
-
return r(void 0,
|
|
958
|
+
function o(u, f) {
|
|
959
|
+
if (!a.isUndefined(f))
|
|
960
|
+
return r(void 0, f);
|
|
961
961
|
}
|
|
962
|
-
function i(u,
|
|
963
|
-
if (a.isUndefined(
|
|
962
|
+
function i(u, f) {
|
|
963
|
+
if (a.isUndefined(f)) {
|
|
964
964
|
if (!a.isUndefined(u))
|
|
965
965
|
return r(void 0, u);
|
|
966
|
-
} else return r(void 0,
|
|
966
|
+
} else return r(void 0, f);
|
|
967
967
|
}
|
|
968
|
-
function c(u,
|
|
968
|
+
function c(u, f, d) {
|
|
969
969
|
if (d in t)
|
|
970
|
-
return r(u,
|
|
970
|
+
return r(u, f);
|
|
971
971
|
if (d in e)
|
|
972
972
|
return r(void 0, u);
|
|
973
973
|
}
|
|
974
|
-
const
|
|
974
|
+
const l = {
|
|
975
975
|
url: o,
|
|
976
976
|
method: o,
|
|
977
977
|
data: o,
|
|
@@ -1000,51 +1000,51 @@ function I(e, t) {
|
|
|
1000
1000
|
socketPath: i,
|
|
1001
1001
|
responseEncoding: i,
|
|
1002
1002
|
validateStatus: c,
|
|
1003
|
-
headers: (u,
|
|
1003
|
+
headers: (u, f) => s(ve(u), ve(f), !0)
|
|
1004
1004
|
};
|
|
1005
|
-
return a.forEach(Object.keys(Object.assign({}, e, t)), function(
|
|
1006
|
-
const d = f
|
|
1007
|
-
a.isUndefined(
|
|
1005
|
+
return a.forEach(Object.keys(Object.assign({}, e, t)), function(f) {
|
|
1006
|
+
const d = l[f] || s, g = d(e[f], t[f], f);
|
|
1007
|
+
a.isUndefined(g) && d !== c || (n[f] = g);
|
|
1008
1008
|
}), n;
|
|
1009
1009
|
}
|
|
1010
1010
|
const ht = (e) => {
|
|
1011
|
-
const t =
|
|
1011
|
+
const t = q({}, e);
|
|
1012
1012
|
let { data: n, withXSRFToken: r, xsrfHeaderName: s, xsrfCookieName: o, headers: i, auth: c } = t;
|
|
1013
|
-
t.headers = i =
|
|
1013
|
+
t.headers = i = P.from(i), t.url = at(dt(t.baseURL, t.url), e.params, e.paramsSerializer), c && i.set(
|
|
1014
1014
|
"Authorization",
|
|
1015
1015
|
"Basic " + btoa((c.username || "") + ":" + (c.password ? unescape(encodeURIComponent(c.password)) : ""))
|
|
1016
1016
|
);
|
|
1017
|
-
let
|
|
1017
|
+
let l;
|
|
1018
1018
|
if (a.isFormData(n)) {
|
|
1019
|
-
if (
|
|
1019
|
+
if (A.hasStandardBrowserEnv || A.hasStandardBrowserWebWorkerEnv)
|
|
1020
1020
|
i.setContentType(void 0);
|
|
1021
|
-
else if ((
|
|
1022
|
-
const [u, ...
|
|
1023
|
-
i.setContentType([u || "multipart/form-data", ...
|
|
1021
|
+
else if ((l = i.getContentType()) !== !1) {
|
|
1022
|
+
const [u, ...f] = l ? l.split(";").map((d) => d.trim()).filter(Boolean) : [];
|
|
1023
|
+
i.setContentType([u || "multipart/form-data", ...f].join("; "));
|
|
1024
1024
|
}
|
|
1025
1025
|
}
|
|
1026
|
-
if (
|
|
1027
|
-
const u = s && o &&
|
|
1026
|
+
if (A.hasStandardBrowserEnv && (r && a.isFunction(r) && (r = r(t)), r || r !== !1 && kn(t.url))) {
|
|
1027
|
+
const u = s && o && vn.read(o);
|
|
1028
1028
|
u && i.set(s, u);
|
|
1029
1029
|
}
|
|
1030
1030
|
return t;
|
|
1031
|
-
}, jn = typeof XMLHttpRequest < "u",
|
|
1031
|
+
}, jn = typeof XMLHttpRequest < "u", Hn = jn && function(e) {
|
|
1032
1032
|
return new Promise(function(n, r) {
|
|
1033
1033
|
const s = ht(e);
|
|
1034
1034
|
let o = s.data;
|
|
1035
|
-
const i =
|
|
1036
|
-
let { responseType: c, onUploadProgress:
|
|
1037
|
-
function
|
|
1038
|
-
E && E(), h && h(), s.cancelToken && s.cancelToken.unsubscribe(
|
|
1035
|
+
const i = P.from(s.headers).normalize();
|
|
1036
|
+
let { responseType: c, onUploadProgress: l, onDownloadProgress: u } = s, f, d, g, E, h;
|
|
1037
|
+
function y() {
|
|
1038
|
+
E && E(), h && h(), s.cancelToken && s.cancelToken.unsubscribe(f), s.signal && s.signal.removeEventListener("abort", f);
|
|
1039
1039
|
}
|
|
1040
1040
|
let p = new XMLHttpRequest();
|
|
1041
1041
|
p.open(s.method.toUpperCase(), s.url, !0), p.timeout = s.timeout;
|
|
1042
1042
|
function w() {
|
|
1043
1043
|
if (!p)
|
|
1044
1044
|
return;
|
|
1045
|
-
const C =
|
|
1045
|
+
const C = P.from(
|
|
1046
1046
|
"getAllResponseHeaders" in p && p.getAllResponseHeaders()
|
|
1047
|
-
),
|
|
1047
|
+
), T = {
|
|
1048
1048
|
data: !c || c === "text" || c === "json" ? p.responseText : p.response,
|
|
1049
1049
|
status: p.status,
|
|
1050
1050
|
statusText: p.statusText,
|
|
@@ -1052,11 +1052,11 @@ const ht = (e) => {
|
|
|
1052
1052
|
config: e,
|
|
1053
1053
|
request: p
|
|
1054
1054
|
};
|
|
1055
|
-
ft(function(
|
|
1056
|
-
n(
|
|
1057
|
-
}, function(
|
|
1058
|
-
r(
|
|
1059
|
-
},
|
|
1055
|
+
ft(function(F) {
|
|
1056
|
+
n(F), y();
|
|
1057
|
+
}, function(F) {
|
|
1058
|
+
r(F), y();
|
|
1059
|
+
}, T), p = null;
|
|
1060
1060
|
}
|
|
1061
1061
|
"onloadend" in p ? p.onloadend = w : p.onreadystatechange = function() {
|
|
1062
1062
|
!p || p.readyState !== 4 || p.status === 0 && !(p.responseURL && p.responseURL.indexOf("file:") === 0) || setTimeout(w);
|
|
@@ -1066,34 +1066,34 @@ const ht = (e) => {
|
|
|
1066
1066
|
r(new m("Network Error", m.ERR_NETWORK, e, p)), p = null;
|
|
1067
1067
|
}, p.ontimeout = function() {
|
|
1068
1068
|
let N = s.timeout ? "timeout of " + s.timeout + "ms exceeded" : "timeout exceeded";
|
|
1069
|
-
const
|
|
1069
|
+
const T = s.transitional || ct;
|
|
1070
1070
|
s.timeoutErrorMessage && (N = s.timeoutErrorMessage), r(new m(
|
|
1071
1071
|
N,
|
|
1072
|
-
|
|
1072
|
+
T.clarifyTimeoutError ? m.ETIMEDOUT : m.ECONNABORTED,
|
|
1073
1073
|
e,
|
|
1074
1074
|
p
|
|
1075
1075
|
)), p = null;
|
|
1076
|
-
}, o === void 0 && i.setContentType(null), "setRequestHeader" in p && a.forEach(i.toJSON(), function(N,
|
|
1077
|
-
p.setRequestHeader(
|
|
1078
|
-
}), a.isUndefined(s.withCredentials) || (p.withCredentials = !!s.withCredentials), c && c !== "json" && (p.responseType = s.responseType), u && ([
|
|
1079
|
-
p && (r(!C || C.type ? new
|
|
1080
|
-
}, s.cancelToken && s.cancelToken.subscribe(
|
|
1081
|
-
const S =
|
|
1082
|
-
if (S &&
|
|
1076
|
+
}, o === void 0 && i.setContentType(null), "setRequestHeader" in p && a.forEach(i.toJSON(), function(N, T) {
|
|
1077
|
+
p.setRequestHeader(T, N);
|
|
1078
|
+
}), a.isUndefined(s.withCredentials) || (p.withCredentials = !!s.withCredentials), c && c !== "json" && (p.responseType = s.responseType), u && ([g, h] = Z(u, !0), p.addEventListener("progress", g)), l && p.upload && ([d, E] = Z(l), p.upload.addEventListener("progress", d), p.upload.addEventListener("loadend", E)), (s.cancelToken || s.signal) && (f = (C) => {
|
|
1079
|
+
p && (r(!C || C.type ? new H(null, e, p) : C), p.abort(), p = null);
|
|
1080
|
+
}, s.cancelToken && s.cancelToken.subscribe(f), s.signal && (s.signal.aborted ? f() : s.signal.addEventListener("abort", f)));
|
|
1081
|
+
const S = Dn(s.url);
|
|
1082
|
+
if (S && A.protocols.indexOf(S) === -1) {
|
|
1083
1083
|
r(new m("Unsupported protocol " + S + ":", m.ERR_BAD_REQUEST, e));
|
|
1084
1084
|
return;
|
|
1085
1085
|
}
|
|
1086
1086
|
p.send(o || null);
|
|
1087
1087
|
});
|
|
1088
|
-
},
|
|
1088
|
+
}, $n = (e, t) => {
|
|
1089
1089
|
const { length: n } = e = e ? e.filter(Boolean) : [];
|
|
1090
1090
|
if (t || n) {
|
|
1091
1091
|
let r = new AbortController(), s;
|
|
1092
1092
|
const o = function(u) {
|
|
1093
1093
|
if (!s) {
|
|
1094
1094
|
s = !0, c();
|
|
1095
|
-
const
|
|
1096
|
-
r.abort(
|
|
1095
|
+
const f = u instanceof Error ? u : this.reason;
|
|
1096
|
+
r.abort(f instanceof m ? f : new H(f instanceof Error ? f.message : f));
|
|
1097
1097
|
}
|
|
1098
1098
|
};
|
|
1099
1099
|
let i = t && setTimeout(() => {
|
|
@@ -1105,8 +1105,8 @@ const ht = (e) => {
|
|
|
1105
1105
|
}), e = null);
|
|
1106
1106
|
};
|
|
1107
1107
|
e.forEach((u) => u.addEventListener("abort", o));
|
|
1108
|
-
const { signal:
|
|
1109
|
-
return
|
|
1108
|
+
const { signal: l } = r;
|
|
1109
|
+
return l.unsubscribe = () => a.asap(c), l;
|
|
1110
1110
|
}
|
|
1111
1111
|
}, zn = function* (e, t) {
|
|
1112
1112
|
let n = e.byteLength;
|
|
@@ -1136,31 +1136,31 @@ const ht = (e) => {
|
|
|
1136
1136
|
} finally {
|
|
1137
1137
|
await t.cancel();
|
|
1138
1138
|
}
|
|
1139
|
-
},
|
|
1139
|
+
}, qe = (e, t, n, r) => {
|
|
1140
1140
|
const s = Vn(e, t);
|
|
1141
|
-
let o = 0, i, c = (
|
|
1142
|
-
i || (i = !0, r && r(
|
|
1141
|
+
let o = 0, i, c = (l) => {
|
|
1142
|
+
i || (i = !0, r && r(l));
|
|
1143
1143
|
};
|
|
1144
1144
|
return new ReadableStream({
|
|
1145
|
-
async pull(
|
|
1145
|
+
async pull(l) {
|
|
1146
1146
|
try {
|
|
1147
|
-
const { done: u, value:
|
|
1147
|
+
const { done: u, value: f } = await s.next();
|
|
1148
1148
|
if (u) {
|
|
1149
|
-
c(),
|
|
1149
|
+
c(), l.close();
|
|
1150
1150
|
return;
|
|
1151
1151
|
}
|
|
1152
|
-
let d =
|
|
1152
|
+
let d = f.byteLength;
|
|
1153
1153
|
if (n) {
|
|
1154
|
-
let
|
|
1155
|
-
n(
|
|
1154
|
+
let g = o += d;
|
|
1155
|
+
n(g);
|
|
1156
1156
|
}
|
|
1157
|
-
|
|
1157
|
+
l.enqueue(new Uint8Array(f));
|
|
1158
1158
|
} catch (u) {
|
|
1159
1159
|
throw c(u), u;
|
|
1160
1160
|
}
|
|
1161
1161
|
},
|
|
1162
|
-
cancel(
|
|
1163
|
-
return c(
|
|
1162
|
+
cancel(l) {
|
|
1163
|
+
return c(l), s.return();
|
|
1164
1164
|
}
|
|
1165
1165
|
}, {
|
|
1166
1166
|
highWaterMark: 2
|
|
@@ -1173,7 +1173,7 @@ const ht = (e) => {
|
|
|
1173
1173
|
}
|
|
1174
1174
|
}, Mn = pt && mt(() => {
|
|
1175
1175
|
let e = !1;
|
|
1176
|
-
const t = new Request(
|
|
1176
|
+
const t = new Request(A.origin, {
|
|
1177
1177
|
body: new ReadableStream(),
|
|
1178
1178
|
method: "POST",
|
|
1179
1179
|
get duplex() {
|
|
@@ -1181,7 +1181,7 @@ const ht = (e) => {
|
|
|
1181
1181
|
}
|
|
1182
1182
|
}).headers.has("Content-Type");
|
|
1183
1183
|
return e && !t;
|
|
1184
|
-
}),
|
|
1184
|
+
}), Ie = 64 * 1024, me = pt && mt(() => a.isReadableStream(new Response("").body)), ee = {
|
|
1185
1185
|
stream: me && ((e) => e.body)
|
|
1186
1186
|
};
|
|
1187
1187
|
oe && ((e) => {
|
|
@@ -1197,7 +1197,7 @@ const Wn = async (e) => {
|
|
|
1197
1197
|
if (a.isBlob(e))
|
|
1198
1198
|
return e.size;
|
|
1199
1199
|
if (a.isSpecCompliantForm(e))
|
|
1200
|
-
return (await new Request(
|
|
1200
|
+
return (await new Request(A.origin, {
|
|
1201
1201
|
method: "POST",
|
|
1202
1202
|
body: e
|
|
1203
1203
|
}).arrayBuffer()).byteLength;
|
|
@@ -1205,10 +1205,10 @@ const Wn = async (e) => {
|
|
|
1205
1205
|
return e.byteLength;
|
|
1206
1206
|
if (a.isURLSearchParams(e) && (e = e + ""), a.isString(e))
|
|
1207
1207
|
return (await Jn(e)).byteLength;
|
|
1208
|
-
},
|
|
1208
|
+
}, Qn = async (e, t) => {
|
|
1209
1209
|
const n = a.toFiniteNumber(e.getContentLength());
|
|
1210
1210
|
return n ?? Wn(t);
|
|
1211
|
-
},
|
|
1211
|
+
}, Gn = oe && (async (e) => {
|
|
1212
1212
|
let {
|
|
1213
1213
|
url: t,
|
|
1214
1214
|
method: n,
|
|
@@ -1217,68 +1217,68 @@ const Wn = async (e) => {
|
|
|
1217
1217
|
cancelToken: o,
|
|
1218
1218
|
timeout: i,
|
|
1219
1219
|
onDownloadProgress: c,
|
|
1220
|
-
onUploadProgress:
|
|
1220
|
+
onUploadProgress: l,
|
|
1221
1221
|
responseType: u,
|
|
1222
|
-
headers:
|
|
1222
|
+
headers: f,
|
|
1223
1223
|
withCredentials: d = "same-origin",
|
|
1224
|
-
fetchOptions:
|
|
1224
|
+
fetchOptions: g
|
|
1225
1225
|
} = ht(e);
|
|
1226
1226
|
u = u ? (u + "").toLowerCase() : "text";
|
|
1227
|
-
let E =
|
|
1228
|
-
const
|
|
1227
|
+
let E = $n([s, o && o.toAbortSignal()], i), h;
|
|
1228
|
+
const y = E && E.unsubscribe && (() => {
|
|
1229
1229
|
E.unsubscribe();
|
|
1230
1230
|
});
|
|
1231
1231
|
let p;
|
|
1232
1232
|
try {
|
|
1233
|
-
if (
|
|
1234
|
-
let
|
|
1233
|
+
if (l && Mn && n !== "get" && n !== "head" && (p = await Qn(f, r)) !== 0) {
|
|
1234
|
+
let T = new Request(t, {
|
|
1235
1235
|
method: "POST",
|
|
1236
1236
|
body: r,
|
|
1237
1237
|
duplex: "half"
|
|
1238
1238
|
}), U;
|
|
1239
|
-
if (a.isFormData(r) && (U =
|
|
1240
|
-
const [
|
|
1239
|
+
if (a.isFormData(r) && (U = T.headers.get("content-type")) && f.setContentType(U), T.body) {
|
|
1240
|
+
const [F, Q] = Be(
|
|
1241
1241
|
p,
|
|
1242
|
-
Z(
|
|
1242
|
+
Z(ke(l))
|
|
1243
1243
|
);
|
|
1244
|
-
r =
|
|
1244
|
+
r = qe(T.body, Ie, F, Q);
|
|
1245
1245
|
}
|
|
1246
1246
|
}
|
|
1247
1247
|
a.isString(d) || (d = d ? "include" : "omit");
|
|
1248
1248
|
const w = "credentials" in Request.prototype;
|
|
1249
1249
|
h = new Request(t, {
|
|
1250
|
-
...
|
|
1250
|
+
...g,
|
|
1251
1251
|
signal: E,
|
|
1252
1252
|
method: n.toUpperCase(),
|
|
1253
|
-
headers:
|
|
1253
|
+
headers: f.normalize().toJSON(),
|
|
1254
1254
|
body: r,
|
|
1255
1255
|
duplex: "half",
|
|
1256
1256
|
credentials: w ? d : void 0
|
|
1257
1257
|
});
|
|
1258
1258
|
let S = await fetch(h);
|
|
1259
1259
|
const C = me && (u === "stream" || u === "response");
|
|
1260
|
-
if (me && (c || C &&
|
|
1261
|
-
const
|
|
1262
|
-
["status", "statusText", "headers"].forEach((
|
|
1263
|
-
|
|
1260
|
+
if (me && (c || C && y)) {
|
|
1261
|
+
const T = {};
|
|
1262
|
+
["status", "statusText", "headers"].forEach((_e) => {
|
|
1263
|
+
T[_e] = S[_e];
|
|
1264
1264
|
});
|
|
1265
|
-
const U = a.toFiniteNumber(S.headers.get("content-length")), [
|
|
1265
|
+
const U = a.toFiniteNumber(S.headers.get("content-length")), [F, Q] = c && Be(
|
|
1266
1266
|
U,
|
|
1267
|
-
Z(
|
|
1267
|
+
Z(ke(c), !0)
|
|
1268
1268
|
) || [];
|
|
1269
1269
|
S = new Response(
|
|
1270
|
-
|
|
1271
|
-
|
|
1270
|
+
qe(S.body, Ie, F, () => {
|
|
1271
|
+
Q && Q(), y && y();
|
|
1272
1272
|
}),
|
|
1273
|
-
|
|
1273
|
+
T
|
|
1274
1274
|
);
|
|
1275
1275
|
}
|
|
1276
1276
|
u = u || "text";
|
|
1277
1277
|
let N = await ee[a.findKey(ee, u) || "text"](S, e);
|
|
1278
|
-
return !C &&
|
|
1279
|
-
ft(
|
|
1278
|
+
return !C && y && y(), await new Promise((T, U) => {
|
|
1279
|
+
ft(T, U, {
|
|
1280
1280
|
data: N,
|
|
1281
|
-
headers:
|
|
1281
|
+
headers: P.from(S.headers),
|
|
1282
1282
|
status: S.status,
|
|
1283
1283
|
statusText: S.statusText,
|
|
1284
1284
|
config: e,
|
|
@@ -1286,19 +1286,19 @@ const Wn = async (e) => {
|
|
|
1286
1286
|
});
|
|
1287
1287
|
});
|
|
1288
1288
|
} catch (w) {
|
|
1289
|
-
throw
|
|
1289
|
+
throw y && y(), w && w.name === "TypeError" && /fetch/i.test(w.message) ? Object.assign(
|
|
1290
1290
|
new m("Network Error", m.ERR_NETWORK, e, h),
|
|
1291
1291
|
{
|
|
1292
1292
|
cause: w.cause || w
|
|
1293
1293
|
}
|
|
1294
1294
|
) : m.from(w, w && w.code, e, h);
|
|
1295
1295
|
}
|
|
1296
|
-
}),
|
|
1296
|
+
}), ye = {
|
|
1297
1297
|
http: fn,
|
|
1298
|
-
xhr:
|
|
1299
|
-
fetch:
|
|
1298
|
+
xhr: Hn,
|
|
1299
|
+
fetch: Gn
|
|
1300
1300
|
};
|
|
1301
|
-
a.forEach(
|
|
1301
|
+
a.forEach(ye, (e, t) => {
|
|
1302
1302
|
if (e) {
|
|
1303
1303
|
try {
|
|
1304
1304
|
Object.defineProperty(e, "name", { value: t });
|
|
@@ -1307,7 +1307,7 @@ a.forEach(ge, (e, t) => {
|
|
|
1307
1307
|
Object.defineProperty(e, "adapterName", { value: t });
|
|
1308
1308
|
}
|
|
1309
1309
|
});
|
|
1310
|
-
const je = (e) => `- ${e}`,
|
|
1310
|
+
const je = (e) => `- ${e}`, Xn = (e) => a.isFunction(e) || e === null || e === !1, yt = {
|
|
1311
1311
|
getAdapter: (e) => {
|
|
1312
1312
|
e = a.isArray(e) ? e : [e];
|
|
1313
1313
|
const { length: t } = e;
|
|
@@ -1316,7 +1316,7 @@ const je = (e) => `- ${e}`, Yn = (e) => a.isFunction(e) || e === null || e === !
|
|
|
1316
1316
|
for (let o = 0; o < t; o++) {
|
|
1317
1317
|
n = e[o];
|
|
1318
1318
|
let i;
|
|
1319
|
-
if (r = n, !
|
|
1319
|
+
if (r = n, !Xn(n) && (r = ye[(i = String(n)).toLowerCase()], r === void 0))
|
|
1320
1320
|
throw new m(`Unknown adapter '${i}'`);
|
|
1321
1321
|
if (r)
|
|
1322
1322
|
break;
|
|
@@ -1324,7 +1324,7 @@ const je = (e) => `- ${e}`, Yn = (e) => a.isFunction(e) || e === null || e === !
|
|
|
1324
1324
|
}
|
|
1325
1325
|
if (!r) {
|
|
1326
1326
|
const o = Object.entries(s).map(
|
|
1327
|
-
([c,
|
|
1327
|
+
([c, l]) => `adapter ${c} ` + (l === !1 ? "is not supported by the environment" : "is not available in the build")
|
|
1328
1328
|
);
|
|
1329
1329
|
let i = t ? o.length > 1 ? `since :
|
|
1330
1330
|
` + o.map(je).join(`
|
|
@@ -1336,40 +1336,40 @@ const je = (e) => `- ${e}`, Yn = (e) => a.isFunction(e) || e === null || e === !
|
|
|
1336
1336
|
}
|
|
1337
1337
|
return r;
|
|
1338
1338
|
},
|
|
1339
|
-
adapters:
|
|
1339
|
+
adapters: ye
|
|
1340
1340
|
};
|
|
1341
1341
|
function fe(e) {
|
|
1342
1342
|
if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
|
|
1343
|
-
throw new
|
|
1343
|
+
throw new H(null, e);
|
|
1344
1344
|
}
|
|
1345
|
-
function
|
|
1346
|
-
return fe(e), e.headers =
|
|
1345
|
+
function He(e) {
|
|
1346
|
+
return fe(e), e.headers = P.from(e.headers), e.data = le.call(
|
|
1347
1347
|
e,
|
|
1348
1348
|
e.transformRequest
|
|
1349
|
-
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1),
|
|
1349
|
+
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), yt.getAdapter(e.adapter || W.adapter)(e).then(function(r) {
|
|
1350
1350
|
return fe(e), r.data = le.call(
|
|
1351
1351
|
e,
|
|
1352
1352
|
e.transformResponse,
|
|
1353
1353
|
r
|
|
1354
|
-
), r.headers =
|
|
1354
|
+
), r.headers = P.from(r.headers), r;
|
|
1355
1355
|
}, function(r) {
|
|
1356
1356
|
return lt(r) || (fe(e), r && r.response && (r.response.data = le.call(
|
|
1357
1357
|
e,
|
|
1358
1358
|
e.transformResponse,
|
|
1359
1359
|
r.response
|
|
1360
|
-
), r.response.headers =
|
|
1360
|
+
), r.response.headers = P.from(r.response.headers))), Promise.reject(r);
|
|
1361
1361
|
});
|
|
1362
1362
|
}
|
|
1363
|
-
const
|
|
1363
|
+
const gt = "1.7.7", Re = {};
|
|
1364
1364
|
["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
|
|
1365
1365
|
Re[e] = function(r) {
|
|
1366
1366
|
return typeof r === e || "a" + (t < 1 ? "n " : " ") + e;
|
|
1367
1367
|
};
|
|
1368
1368
|
});
|
|
1369
|
-
const
|
|
1369
|
+
const $e = {};
|
|
1370
1370
|
Re.transitional = function(t, n, r) {
|
|
1371
1371
|
function s(o, i) {
|
|
1372
|
-
return "[Axios v" +
|
|
1372
|
+
return "[Axios v" + gt + "] Transitional option '" + o + "'" + i + (r ? ". " + r : "");
|
|
1373
1373
|
}
|
|
1374
1374
|
return (o, i, c) => {
|
|
1375
1375
|
if (t === !1)
|
|
@@ -1377,7 +1377,7 @@ Re.transitional = function(t, n, r) {
|
|
|
1377
1377
|
s(i, " has been removed" + (n ? " in " + n : "")),
|
|
1378
1378
|
m.ERR_DEPRECATED
|
|
1379
1379
|
);
|
|
1380
|
-
return n &&
|
|
1380
|
+
return n && !$e[i] && ($e[i] = !0, console.warn(
|
|
1381
1381
|
s(
|
|
1382
1382
|
i,
|
|
1383
1383
|
" has been deprecated since v" + n + " and will be removed in the near future"
|
|
@@ -1385,7 +1385,7 @@ Re.transitional = function(t, n, r) {
|
|
|
1385
1385
|
)), t ? t(o, i, c) : !0;
|
|
1386
1386
|
};
|
|
1387
1387
|
};
|
|
1388
|
-
function
|
|
1388
|
+
function Yn(e, t, n) {
|
|
1389
1389
|
if (typeof e != "object")
|
|
1390
1390
|
throw new m("options must be an object", m.ERR_BAD_OPTION_VALUE);
|
|
1391
1391
|
const r = Object.keys(e);
|
|
@@ -1393,24 +1393,24 @@ function Qn(e, t, n) {
|
|
|
1393
1393
|
for (; s-- > 0; ) {
|
|
1394
1394
|
const o = r[s], i = t[o];
|
|
1395
1395
|
if (i) {
|
|
1396
|
-
const c = e[o],
|
|
1397
|
-
if (
|
|
1398
|
-
throw new m("option " + o + " must be " +
|
|
1396
|
+
const c = e[o], l = c === void 0 || i(c, o, e);
|
|
1397
|
+
if (l !== !0)
|
|
1398
|
+
throw new m("option " + o + " must be " + l, m.ERR_BAD_OPTION_VALUE);
|
|
1399
1399
|
continue;
|
|
1400
1400
|
}
|
|
1401
1401
|
if (n !== !0)
|
|
1402
1402
|
throw new m("Unknown option " + o, m.ERR_BAD_OPTION);
|
|
1403
1403
|
}
|
|
1404
1404
|
}
|
|
1405
|
-
const
|
|
1406
|
-
assertOptions:
|
|
1405
|
+
const ge = {
|
|
1406
|
+
assertOptions: Yn,
|
|
1407
1407
|
validators: Re
|
|
1408
|
-
}, L =
|
|
1409
|
-
let
|
|
1408
|
+
}, L = ge.validators;
|
|
1409
|
+
let v = class {
|
|
1410
1410
|
constructor(t) {
|
|
1411
1411
|
this.defaults = t, this.interceptors = {
|
|
1412
|
-
request: new
|
|
1413
|
-
response: new
|
|
1412
|
+
request: new De(),
|
|
1413
|
+
response: new De()
|
|
1414
1414
|
};
|
|
1415
1415
|
}
|
|
1416
1416
|
/**
|
|
@@ -1439,15 +1439,15 @@ let k = class {
|
|
|
1439
1439
|
}
|
|
1440
1440
|
}
|
|
1441
1441
|
_request(t, n) {
|
|
1442
|
-
typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n =
|
|
1442
|
+
typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = q(this.defaults, n);
|
|
1443
1443
|
const { transitional: r, paramsSerializer: s, headers: o } = n;
|
|
1444
|
-
r !== void 0 &&
|
|
1444
|
+
r !== void 0 && ge.assertOptions(r, {
|
|
1445
1445
|
silentJSONParsing: L.transitional(L.boolean),
|
|
1446
1446
|
forcedJSONParsing: L.transitional(L.boolean),
|
|
1447
1447
|
clarifyTimeoutError: L.transitional(L.boolean)
|
|
1448
1448
|
}, !1), s != null && (a.isFunction(s) ? n.paramsSerializer = {
|
|
1449
1449
|
serialize: s
|
|
1450
|
-
} :
|
|
1450
|
+
} : ge.assertOptions(s, {
|
|
1451
1451
|
encode: L.function,
|
|
1452
1452
|
serialize: L.function
|
|
1453
1453
|
}, !0)), n.method = (n.method || this.defaults.method || "get").toLowerCase();
|
|
@@ -1460,52 +1460,52 @@ let k = class {
|
|
|
1460
1460
|
(h) => {
|
|
1461
1461
|
delete o[h];
|
|
1462
1462
|
}
|
|
1463
|
-
), n.headers =
|
|
1463
|
+
), n.headers = P.concat(i, o);
|
|
1464
1464
|
const c = [];
|
|
1465
|
-
let
|
|
1466
|
-
this.interceptors.request.forEach(function(
|
|
1467
|
-
typeof
|
|
1465
|
+
let l = !0;
|
|
1466
|
+
this.interceptors.request.forEach(function(y) {
|
|
1467
|
+
typeof y.runWhen == "function" && y.runWhen(n) === !1 || (l = l && y.synchronous, c.unshift(y.fulfilled, y.rejected));
|
|
1468
1468
|
});
|
|
1469
1469
|
const u = [];
|
|
1470
|
-
this.interceptors.response.forEach(function(
|
|
1471
|
-
u.push(
|
|
1470
|
+
this.interceptors.response.forEach(function(y) {
|
|
1471
|
+
u.push(y.fulfilled, y.rejected);
|
|
1472
1472
|
});
|
|
1473
|
-
let
|
|
1474
|
-
if (!
|
|
1475
|
-
const h = [
|
|
1476
|
-
for (h.unshift.apply(h, c), h.push.apply(h, u),
|
|
1477
|
-
|
|
1478
|
-
return
|
|
1473
|
+
let f, d = 0, g;
|
|
1474
|
+
if (!l) {
|
|
1475
|
+
const h = [He.bind(this), void 0];
|
|
1476
|
+
for (h.unshift.apply(h, c), h.push.apply(h, u), g = h.length, f = Promise.resolve(n); d < g; )
|
|
1477
|
+
f = f.then(h[d++], h[d++]);
|
|
1478
|
+
return f;
|
|
1479
1479
|
}
|
|
1480
|
-
|
|
1480
|
+
g = c.length;
|
|
1481
1481
|
let E = n;
|
|
1482
|
-
for (d = 0; d <
|
|
1483
|
-
const h = c[d++],
|
|
1482
|
+
for (d = 0; d < g; ) {
|
|
1483
|
+
const h = c[d++], y = c[d++];
|
|
1484
1484
|
try {
|
|
1485
1485
|
E = h(E);
|
|
1486
1486
|
} catch (p) {
|
|
1487
|
-
|
|
1487
|
+
y.call(this, p);
|
|
1488
1488
|
break;
|
|
1489
1489
|
}
|
|
1490
1490
|
}
|
|
1491
1491
|
try {
|
|
1492
|
-
|
|
1492
|
+
f = He.call(this, E);
|
|
1493
1493
|
} catch (h) {
|
|
1494
1494
|
return Promise.reject(h);
|
|
1495
1495
|
}
|
|
1496
|
-
for (d = 0,
|
|
1497
|
-
|
|
1498
|
-
return
|
|
1496
|
+
for (d = 0, g = u.length; d < g; )
|
|
1497
|
+
f = f.then(u[d++], u[d++]);
|
|
1498
|
+
return f;
|
|
1499
1499
|
}
|
|
1500
1500
|
getUri(t) {
|
|
1501
|
-
t =
|
|
1501
|
+
t = q(this.defaults, t);
|
|
1502
1502
|
const n = dt(t.baseURL, t.url);
|
|
1503
1503
|
return at(n, t.params, t.paramsSerializer);
|
|
1504
1504
|
}
|
|
1505
1505
|
};
|
|
1506
1506
|
a.forEach(["delete", "get", "head", "options"], function(t) {
|
|
1507
|
-
|
|
1508
|
-
return this.request(
|
|
1507
|
+
v.prototype[t] = function(n, r) {
|
|
1508
|
+
return this.request(q(r || {}, {
|
|
1509
1509
|
method: t,
|
|
1510
1510
|
url: n,
|
|
1511
1511
|
data: (r || {}).data
|
|
@@ -1515,7 +1515,7 @@ a.forEach(["delete", "get", "head", "options"], function(t) {
|
|
|
1515
1515
|
a.forEach(["post", "put", "patch"], function(t) {
|
|
1516
1516
|
function n(r) {
|
|
1517
1517
|
return function(o, i, c) {
|
|
1518
|
-
return this.request(
|
|
1518
|
+
return this.request(q(c || {}, {
|
|
1519
1519
|
method: t,
|
|
1520
1520
|
headers: r ? {
|
|
1521
1521
|
"Content-Type": "multipart/form-data"
|
|
@@ -1525,7 +1525,7 @@ a.forEach(["post", "put", "patch"], function(t) {
|
|
|
1525
1525
|
}));
|
|
1526
1526
|
};
|
|
1527
1527
|
}
|
|
1528
|
-
|
|
1528
|
+
v.prototype[t] = n(), v.prototype[t + "Form"] = n(!0);
|
|
1529
1529
|
});
|
|
1530
1530
|
let Zn = class wt {
|
|
1531
1531
|
constructor(t) {
|
|
@@ -1551,7 +1551,7 @@ let Zn = class wt {
|
|
|
1551
1551
|
r.unsubscribe(o);
|
|
1552
1552
|
}, i;
|
|
1553
1553
|
}, t(function(o, i, c) {
|
|
1554
|
-
r.reason || (r.reason = new
|
|
1554
|
+
r.reason || (r.reason = new H(o, i, c), n(r.reason));
|
|
1555
1555
|
});
|
|
1556
1556
|
}
|
|
1557
1557
|
/**
|
|
@@ -1677,17 +1677,17 @@ Object.entries(we).forEach(([e, t]) => {
|
|
|
1677
1677
|
we[t] = e;
|
|
1678
1678
|
});
|
|
1679
1679
|
function bt(e) {
|
|
1680
|
-
const t = new
|
|
1681
|
-
return a.extend(n,
|
|
1682
|
-
return bt(
|
|
1680
|
+
const t = new v(e), n = Qe(v.prototype.request, t);
|
|
1681
|
+
return a.extend(n, v.prototype, t, { allOwnKeys: !0 }), a.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(s) {
|
|
1682
|
+
return bt(q(e, s));
|
|
1683
1683
|
}, n;
|
|
1684
1684
|
}
|
|
1685
1685
|
const b = bt(W);
|
|
1686
|
-
b.Axios =
|
|
1687
|
-
b.CanceledError =
|
|
1686
|
+
b.Axios = v;
|
|
1687
|
+
b.CanceledError = H;
|
|
1688
1688
|
b.CancelToken = Zn;
|
|
1689
1689
|
b.isCancel = lt;
|
|
1690
|
-
b.VERSION =
|
|
1690
|
+
b.VERSION = gt;
|
|
1691
1691
|
b.toFormData = se;
|
|
1692
1692
|
b.AxiosError = m;
|
|
1693
1693
|
b.Cancel = b.CanceledError;
|
|
@@ -1696,17 +1696,17 @@ b.all = function(t) {
|
|
|
1696
1696
|
};
|
|
1697
1697
|
b.spread = er;
|
|
1698
1698
|
b.isAxiosError = tr;
|
|
1699
|
-
b.mergeConfig =
|
|
1700
|
-
b.AxiosHeaders =
|
|
1699
|
+
b.mergeConfig = q;
|
|
1700
|
+
b.AxiosHeaders = P;
|
|
1701
1701
|
b.formToJSON = (e) => ut(a.isHTMLForm(e) ? new FormData(e) : e);
|
|
1702
|
-
b.getAdapter =
|
|
1702
|
+
b.getAdapter = yt.getAdapter;
|
|
1703
1703
|
b.HttpStatusCode = we;
|
|
1704
1704
|
b.default = b;
|
|
1705
1705
|
const {
|
|
1706
|
-
Axios:
|
|
1707
|
-
AxiosError:
|
|
1708
|
-
CanceledError:
|
|
1709
|
-
isCancel:
|
|
1706
|
+
Axios: Gr,
|
|
1707
|
+
AxiosError: G,
|
|
1708
|
+
CanceledError: Xr,
|
|
1709
|
+
isCancel: Yr,
|
|
1710
1710
|
CancelToken: Zr,
|
|
1711
1711
|
VERSION: es,
|
|
1712
1712
|
all: ts,
|
|
@@ -1752,67 +1752,75 @@ class nr {
|
|
|
1752
1752
|
R(this, "_debug");
|
|
1753
1753
|
this.httpClient = t.httpClient, this._debug = t.debug;
|
|
1754
1754
|
}
|
|
1755
|
-
async create(t, n, r, s) {
|
|
1756
|
-
var
|
|
1755
|
+
async create(t, n, r, s, o) {
|
|
1756
|
+
var i;
|
|
1757
1757
|
try {
|
|
1758
|
-
await this.httpClient.post(
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1758
|
+
await this.httpClient.post({
|
|
1759
|
+
path: "/affiliates",
|
|
1760
|
+
postData: {
|
|
1761
|
+
address: t,
|
|
1762
|
+
blockchain: n,
|
|
1763
|
+
name: r,
|
|
1764
|
+
code: r,
|
|
1765
|
+
signature: s,
|
|
1766
|
+
account_chain_id: o
|
|
1767
|
+
}
|
|
1764
1768
|
});
|
|
1765
|
-
} catch (
|
|
1766
|
-
if (
|
|
1767
|
-
const
|
|
1768
|
-
if (typeof (
|
|
1769
|
-
const
|
|
1770
|
-
throw
|
|
1771
|
-
} else if ((
|
|
1772
|
-
throw new ze(
|
|
1769
|
+
} catch (c) {
|
|
1770
|
+
if (c instanceof G) {
|
|
1771
|
+
const l = (i = c.response) == null ? void 0 : i.data;
|
|
1772
|
+
if (typeof (l == null ? void 0 : l.message) == "string") {
|
|
1773
|
+
const u = l.message.toLowerCase();
|
|
1774
|
+
throw u == "invalid signature" ? new Je() : u == "address in use" ? new Ve(t) : u == "code in use" ? new Ke(r) : new Error(u);
|
|
1775
|
+
} else if ((l == null ? void 0 : l.message) instanceof Array)
|
|
1776
|
+
throw new ze(l.message);
|
|
1773
1777
|
}
|
|
1774
|
-
throw
|
|
1778
|
+
throw c;
|
|
1775
1779
|
}
|
|
1776
1780
|
}
|
|
1777
|
-
async update(t, n, r, s) {
|
|
1778
|
-
var
|
|
1781
|
+
async update(t, n, r, s, o) {
|
|
1782
|
+
var i;
|
|
1779
1783
|
try {
|
|
1780
|
-
await this.httpClient.post(
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1784
|
+
await this.httpClient.post({
|
|
1785
|
+
path: `/affiliates/${t}`,
|
|
1786
|
+
postData: {
|
|
1787
|
+
code: r,
|
|
1788
|
+
address: t,
|
|
1789
|
+
blockchain: n,
|
|
1790
|
+
signature: s,
|
|
1791
|
+
account_chain_id: o
|
|
1792
|
+
}
|
|
1785
1793
|
});
|
|
1786
|
-
} catch (
|
|
1787
|
-
if (
|
|
1788
|
-
const
|
|
1789
|
-
if (typeof (
|
|
1790
|
-
const
|
|
1791
|
-
throw
|
|
1792
|
-
} else if ((
|
|
1793
|
-
throw new ze(
|
|
1794
|
+
} catch (c) {
|
|
1795
|
+
if (c instanceof G) {
|
|
1796
|
+
const l = (i = c.response) == null ? void 0 : i.data;
|
|
1797
|
+
if (typeof (l == null ? void 0 : l.message) == "string") {
|
|
1798
|
+
const u = l.message.toLowerCase();
|
|
1799
|
+
throw u == "invalid signature" ? new Je() : u == "address in use" ? new Ve(t) : u == "code in use" ? new Ke(r) : new Error(u);
|
|
1800
|
+
} else if ((l == null ? void 0 : l.message) instanceof Array)
|
|
1801
|
+
throw new ze(l.message);
|
|
1794
1802
|
}
|
|
1795
|
-
throw
|
|
1803
|
+
throw c;
|
|
1796
1804
|
}
|
|
1797
1805
|
}
|
|
1798
1806
|
async isCodeFree(t) {
|
|
1799
1807
|
var n;
|
|
1800
1808
|
try {
|
|
1801
|
-
return await this.httpClient.get(`/affiliates/codes/${t}`), !1;
|
|
1809
|
+
return await this.httpClient.get({ path: `/affiliates/codes/${t}` }), !1;
|
|
1802
1810
|
} catch (r) {
|
|
1803
|
-
if (r instanceof
|
|
1811
|
+
if (r instanceof G && ((n = r.response) == null ? void 0 : n.status) === 404)
|
|
1804
1812
|
return !0;
|
|
1805
1813
|
throw console.error("Fuul SDK: Could not check affiliate code", r), r;
|
|
1806
1814
|
}
|
|
1807
1815
|
}
|
|
1808
|
-
async getCode(t) {
|
|
1809
|
-
var
|
|
1816
|
+
async getCode(t, n) {
|
|
1817
|
+
var r;
|
|
1810
1818
|
try {
|
|
1811
|
-
return (await this.httpClient.get(`/affiliates/${t}
|
|
1812
|
-
} catch (
|
|
1813
|
-
if (
|
|
1819
|
+
return (await this.httpClient.get({ path: `/affiliates/${t}`, queryParams: { blockchain: n } })).data.code;
|
|
1820
|
+
} catch (s) {
|
|
1821
|
+
if (s instanceof G && ((r = s.response) == null ? void 0 : r.status) === 404)
|
|
1814
1822
|
return null;
|
|
1815
|
-
throw console.error("Fuul SDK: Could not get affiliate code",
|
|
1823
|
+
throw console.error("Fuul SDK: Could not get affiliate code", s), s;
|
|
1816
1824
|
}
|
|
1817
1825
|
}
|
|
1818
1826
|
}
|
|
@@ -1824,7 +1832,10 @@ class sr {
|
|
|
1824
1832
|
this.httpClient = t.httpClient, this._debug = t.debug;
|
|
1825
1833
|
}
|
|
1826
1834
|
async getUserAudiences(t) {
|
|
1827
|
-
return (await this.httpClient.get(
|
|
1835
|
+
return (await this.httpClient.get({
|
|
1836
|
+
path: `${rr}/user`,
|
|
1837
|
+
queryParams: { ...t }
|
|
1838
|
+
})).data;
|
|
1828
1839
|
}
|
|
1829
1840
|
}
|
|
1830
1841
|
class or {
|
|
@@ -1833,7 +1844,7 @@ class or {
|
|
|
1833
1844
|
this.httpClient = t.httpClient;
|
|
1834
1845
|
}
|
|
1835
1846
|
async getAll(t) {
|
|
1836
|
-
const { data: n } = await this.httpClient.get("conversions", t);
|
|
1847
|
+
const { data: n } = await this.httpClient.get({ path: "conversions", queryParams: { ...t } });
|
|
1837
1848
|
return n;
|
|
1838
1849
|
}
|
|
1839
1850
|
}
|
|
@@ -1850,11 +1861,11 @@ class ar {
|
|
|
1850
1861
|
return;
|
|
1851
1862
|
}
|
|
1852
1863
|
if (!n || !Array.isArray(n) || n.length === 0)
|
|
1853
|
-
await this.httpClient.post("events", t);
|
|
1864
|
+
await this.httpClient.post({ path: "events", postData: t });
|
|
1854
1865
|
else
|
|
1855
1866
|
for (const r of n) {
|
|
1856
1867
|
const s = structuredClone({ ...t, project_id: r });
|
|
1857
|
-
s.metadata.project_id = r, await this.httpClient.post("events", s);
|
|
1868
|
+
s.metadata.project_id = r, await this.httpClient.post({ path: "events", postData: s, queryParams: { project_id: r } });
|
|
1858
1869
|
}
|
|
1859
1870
|
this.debug && console.debug(`Fuul SDK: Sent '${t.name}' event`), this.saveSentEvent(t);
|
|
1860
1871
|
}
|
|
@@ -1865,10 +1876,10 @@ class ar {
|
|
|
1865
1876
|
const s = JSON.parse(r);
|
|
1866
1877
|
if (this.getCurrentTimestamp() - s.timestamp > ir)
|
|
1867
1878
|
return !1;
|
|
1868
|
-
let
|
|
1869
|
-
t.metadata && (
|
|
1879
|
+
let l = !1;
|
|
1880
|
+
t.metadata && (l = s.metadata.tracking_id === t.metadata.tracking_id && s.metadata.project_id === t.metadata.project_id && s.metadata.referrer === t.metadata.referrer && s.metadata.source === t.metadata.source && s.metadata.category === t.metadata.category && s.metadata.title === t.metadata.title && s.metadata.tag === t.metadata.tag && s.user_address === t.user_address && s.signature === t.signature && s.signature_message === t.signature_message);
|
|
1870
1881
|
let u = !1;
|
|
1871
|
-
return t.args && s.args && (u = s.args.page === t.args.page), u &&
|
|
1882
|
+
return t.args && s.args && (u = s.args.page === t.args.page), u && l;
|
|
1872
1883
|
}
|
|
1873
1884
|
getCurrentTimestamp() {
|
|
1874
1885
|
return Date.now() / 1e3;
|
|
@@ -1878,38 +1889,53 @@ class ar {
|
|
|
1878
1889
|
localStorage.setItem(n, JSON.stringify(s));
|
|
1879
1890
|
}
|
|
1880
1891
|
}
|
|
1881
|
-
const cr = "
|
|
1892
|
+
const cr = "5.0.0", ur = {
|
|
1882
1893
|
version: cr
|
|
1883
1894
|
};
|
|
1884
1895
|
class lr {
|
|
1885
1896
|
constructor(t) {
|
|
1886
1897
|
R(this, "client");
|
|
1887
|
-
R(this, "
|
|
1898
|
+
R(this, "defaultQueryParams");
|
|
1888
1899
|
this.client = b.create({
|
|
1889
1900
|
...t,
|
|
1890
1901
|
headers: {
|
|
1891
1902
|
Authorization: `Bearer ${t.apiKey}`,
|
|
1892
1903
|
"X-Fuul-Sdk-Version": ur.version
|
|
1893
1904
|
}
|
|
1894
|
-
}), this.
|
|
1905
|
+
}), this.defaultQueryParams = t.queryParams || {};
|
|
1895
1906
|
}
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
return Object.keys(t).forEach((r) => {
|
|
1899
|
-
n = n === "" ? n + `?${r}=${t[r]}` : n + `&${r}=${t[r]}`;
|
|
1900
|
-
}), n;
|
|
1907
|
+
makeQueryParams(t) {
|
|
1908
|
+
return Object.assign({}, this.defaultQueryParams || {}, t || {});
|
|
1901
1909
|
}
|
|
1902
|
-
async get(t
|
|
1903
|
-
return this.client.
|
|
1910
|
+
async get(t) {
|
|
1911
|
+
return this.client.request({
|
|
1912
|
+
url: t.path,
|
|
1913
|
+
params: this.makeQueryParams(t.queryParams),
|
|
1914
|
+
method: "GET"
|
|
1915
|
+
});
|
|
1904
1916
|
}
|
|
1905
|
-
async post(t
|
|
1906
|
-
return this.client.
|
|
1917
|
+
async post(t) {
|
|
1918
|
+
return this.client.request({
|
|
1919
|
+
url: t.path,
|
|
1920
|
+
params: this.makeQueryParams(t.queryParams),
|
|
1921
|
+
data: t.postData,
|
|
1922
|
+
method: "POST"
|
|
1923
|
+
});
|
|
1907
1924
|
}
|
|
1908
|
-
async put(t
|
|
1909
|
-
return this.client.
|
|
1925
|
+
async put(t) {
|
|
1926
|
+
return this.client.request({
|
|
1927
|
+
url: t.path,
|
|
1928
|
+
params: this.makeQueryParams(t.queryParams),
|
|
1929
|
+
data: t.postData,
|
|
1930
|
+
method: "PUT"
|
|
1931
|
+
});
|
|
1910
1932
|
}
|
|
1911
1933
|
async delete(t) {
|
|
1912
|
-
return this.client.
|
|
1934
|
+
return this.client.request({
|
|
1935
|
+
url: t.path,
|
|
1936
|
+
params: this.makeQueryParams(t.queryParams),
|
|
1937
|
+
method: "DELETE"
|
|
1938
|
+
});
|
|
1913
1939
|
}
|
|
1914
1940
|
}
|
|
1915
1941
|
class fr {
|
|
@@ -1918,13 +1944,22 @@ class fr {
|
|
|
1918
1944
|
this.httpClient = t.httpClient;
|
|
1919
1945
|
}
|
|
1920
1946
|
async getPayoutsLeaderboard(t) {
|
|
1921
|
-
return (await this.httpClient.get(
|
|
1947
|
+
return (await this.httpClient.get({
|
|
1948
|
+
path: "/payouts/leaderboard/payouts",
|
|
1949
|
+
queryParams: { ...t }
|
|
1950
|
+
})).data;
|
|
1922
1951
|
}
|
|
1923
1952
|
async getPointsLeaderboard(t) {
|
|
1924
|
-
return (await this.httpClient.get(
|
|
1953
|
+
return (await this.httpClient.get({
|
|
1954
|
+
path: "/payouts/leaderboard/points",
|
|
1955
|
+
queryParams: { ...t }
|
|
1956
|
+
})).data;
|
|
1925
1957
|
}
|
|
1926
1958
|
async getReferredUsersLeaderboard(t) {
|
|
1927
|
-
return (await this.httpClient.get(
|
|
1959
|
+
return (await this.httpClient.get({
|
|
1960
|
+
path: "/leaderboard/referred",
|
|
1961
|
+
queryParams: { ...t }
|
|
1962
|
+
})).data;
|
|
1928
1963
|
}
|
|
1929
1964
|
}
|
|
1930
1965
|
const K = "/payouts";
|
|
@@ -1935,23 +1970,38 @@ class dr {
|
|
|
1935
1970
|
this.httpClient = t.httpClient, this._debug = t.debug;
|
|
1936
1971
|
}
|
|
1937
1972
|
async getUserPayoutsByConversion(t) {
|
|
1938
|
-
return (await this.httpClient.get(
|
|
1973
|
+
return (await this.httpClient.get({
|
|
1974
|
+
path: K,
|
|
1975
|
+
queryParams: { ...t, type: "onchain-currency" }
|
|
1976
|
+
})).data;
|
|
1939
1977
|
}
|
|
1940
1978
|
async getUserPointsByConversion(t) {
|
|
1941
|
-
return (await this.httpClient.get(
|
|
1979
|
+
return (await this.httpClient.get({
|
|
1980
|
+
path: K,
|
|
1981
|
+
queryParams: { ...t, type: "point" }
|
|
1982
|
+
})).data;
|
|
1942
1983
|
}
|
|
1943
1984
|
async getUserPayoutMovements(t) {
|
|
1944
|
-
return (await this.httpClient.get(
|
|
1985
|
+
return (await this.httpClient.get({
|
|
1986
|
+
path: `${K}/movements`,
|
|
1987
|
+
queryParams: { ...t, type: "onchain-currency" }
|
|
1988
|
+
})).data;
|
|
1945
1989
|
}
|
|
1946
1990
|
async getUserPointsMovements(t) {
|
|
1947
|
-
return (await this.httpClient.get(
|
|
1991
|
+
return (await this.httpClient.get({
|
|
1992
|
+
path: `${K}/movements`,
|
|
1993
|
+
queryParams: { ...t, type: "point" }
|
|
1994
|
+
})).data;
|
|
1948
1995
|
}
|
|
1949
1996
|
async getVolumeLeaderboard(t) {
|
|
1950
|
-
return (await this.httpClient.get(
|
|
1997
|
+
return (await this.httpClient.get({
|
|
1998
|
+
path: `${K}/leaderboard/volume`,
|
|
1999
|
+
queryParams: { ...t }
|
|
2000
|
+
})).data;
|
|
1951
2001
|
}
|
|
1952
2002
|
}
|
|
1953
2003
|
let hr = (e = 21) => crypto.getRandomValues(new Uint8Array(e)).reduce((t, n) => (n &= 63, n < 36 ? t += n.toString(36) : n < 62 ? t += (n - 26).toString(36).toUpperCase() : n > 62 ? t += "-" : t += "_", t), "");
|
|
1954
|
-
const pr = "fuul.tracking_id",
|
|
2004
|
+
const pr = "fuul.tracking_id", Te = () => Er(pr, () => hr()), We = () => I("af") || I("referrer"), mr = () => document.referrer, yr = () => Sr(), gr = () => I("category"), wr = () => I("title"), br = () => I("tag"), Er = (e, t) => {
|
|
1955
2005
|
const n = localStorage.getItem(e);
|
|
1956
2006
|
if (n)
|
|
1957
2007
|
return n;
|
|
@@ -1959,8 +2009,8 @@ const pr = "fuul.tracking_id", Ae = () => Er(pr, () => hr()), We = () => q("af")
|
|
|
1959
2009
|
const r = t();
|
|
1960
2010
|
return r ? localStorage.setItem(e, r) : localStorage.removeItem(e), r;
|
|
1961
2011
|
}
|
|
1962
|
-
},
|
|
1963
|
-
const e =
|
|
2012
|
+
}, I = (e) => new URLSearchParams(window.location.search).get(e), Sr = () => {
|
|
2013
|
+
const e = I("source");
|
|
1964
2014
|
if (e)
|
|
1965
2015
|
return e;
|
|
1966
2016
|
}, Cr = "/user";
|
|
@@ -1970,31 +2020,31 @@ class Rr {
|
|
|
1970
2020
|
this.httpClient = t.httpClient;
|
|
1971
2021
|
}
|
|
1972
2022
|
async getUserAffiliates(t) {
|
|
1973
|
-
return (await this.httpClient.get(Cr, t)).data.affiliates;
|
|
2023
|
+
return (await this.httpClient.get({ path: Cr, queryParams: { ...t } })).data.affiliates;
|
|
1974
2024
|
}
|
|
1975
2025
|
}
|
|
1976
|
-
const
|
|
1977
|
-
let B = !1, be = !1,
|
|
1978
|
-
function
|
|
1979
|
-
B = !!e.debug, !be && (
|
|
2026
|
+
const Tr = "https://api.fuul.xyz/api/v1/";
|
|
2027
|
+
let B = !1, be = !1, Ae, D, Et, St, $, ie, z, Ct, ae;
|
|
2028
|
+
function Ar(e) {
|
|
2029
|
+
B = !!e.debug, !be && (Ae = e.apiKey, Kr(), D = Jr(e.baseApiUrl ?? Tr, e.defaultQueryParams ?? {}), Et = new or({ httpClient: D, debug: B }), ie = new ar({ httpClient: D, debug: B }), $ = new nr({ httpClient: D, debug: B }), z = new dr({ httpClient: D, debug: B }), St = new Rr({ httpClient: D }), Ct = new sr({ httpClient: D, debug: B }), ae = new fr({ httpClient: D }), be = !0, B && console.debug("Fuul SDK: init() complete"));
|
|
1980
2030
|
}
|
|
1981
2031
|
function x() {
|
|
1982
2032
|
if (!be)
|
|
1983
2033
|
throw new Error("Fuul SDK: You need to call init() to initialize the library before using any methods");
|
|
1984
2034
|
}
|
|
1985
|
-
async function
|
|
1986
|
-
x(),
|
|
2035
|
+
async function Pr(e, t) {
|
|
2036
|
+
x(), Pe(), Oe();
|
|
1987
2037
|
const n = {
|
|
1988
2038
|
name: e,
|
|
1989
2039
|
args: t ?? {},
|
|
1990
2040
|
metadata: {
|
|
1991
|
-
tracking_id:
|
|
2041
|
+
tracking_id: Te()
|
|
1992
2042
|
}
|
|
1993
2043
|
};
|
|
1994
2044
|
await ie.sendEvent(n);
|
|
1995
2045
|
}
|
|
1996
|
-
async function
|
|
1997
|
-
x(),
|
|
2046
|
+
async function Or(e, t) {
|
|
2047
|
+
x(), Pe(), Oe();
|
|
1998
2048
|
const n = {
|
|
1999
2049
|
name: "pageview",
|
|
2000
2050
|
args: {
|
|
@@ -2002,20 +2052,20 @@ async function _r(e, t) {
|
|
|
2002
2052
|
locationOrigin: document.location.origin
|
|
2003
2053
|
},
|
|
2004
2054
|
metadata: {
|
|
2005
|
-
tracking_id:
|
|
2055
|
+
tracking_id: Te(),
|
|
2006
2056
|
referrer_url: mr(),
|
|
2007
|
-
source:
|
|
2057
|
+
source: yr(),
|
|
2008
2058
|
affiliate_id: We() ?? void 0,
|
|
2009
2059
|
referrer: We() ?? void 0,
|
|
2010
|
-
category:
|
|
2060
|
+
category: gr() ?? void 0,
|
|
2011
2061
|
title: wr() ?? void 0,
|
|
2012
2062
|
tag: br() ?? void 0
|
|
2013
2063
|
}
|
|
2014
2064
|
};
|
|
2015
2065
|
await ie.sendEvent(n, t);
|
|
2016
2066
|
}
|
|
2017
|
-
async function
|
|
2018
|
-
x(),
|
|
2067
|
+
async function _r(e, t) {
|
|
2068
|
+
x(), Pe(), Oe();
|
|
2019
2069
|
const n = {
|
|
2020
2070
|
name: "connect_wallet",
|
|
2021
2071
|
args: {
|
|
@@ -2023,55 +2073,55 @@ async function Pr(e, t) {
|
|
|
2023
2073
|
locationOrigin: document.location.origin
|
|
2024
2074
|
},
|
|
2025
2075
|
metadata: {
|
|
2026
|
-
tracking_id:
|
|
2076
|
+
tracking_id: Te()
|
|
2027
2077
|
}
|
|
2028
2078
|
};
|
|
2029
2079
|
e != null && e.address && (n.user_address = e.address), e != null && e.signature && (n.signature = e == null ? void 0 : e.signature, n.signature_message = e == null ? void 0 : e.message), e != null && e.accountChainId && (n.account_chain_id = e.accountChainId), await ie.sendEvent(n, t);
|
|
2030
2080
|
}
|
|
2031
2081
|
async function xr(e) {
|
|
2032
|
-
x(), await
|
|
2082
|
+
x(), await $.create(e.address, e.blockchain, e.code, e.signature, e.accountChainId);
|
|
2033
2083
|
}
|
|
2034
2084
|
async function Nr(e) {
|
|
2035
|
-
x(), await
|
|
2085
|
+
x(), await $.update(e.address, e.blockchain, e.code, e.signature, e.accountChainId);
|
|
2036
2086
|
}
|
|
2037
|
-
async function Ur(e) {
|
|
2038
|
-
return x(), await
|
|
2087
|
+
async function Ur(e, t) {
|
|
2088
|
+
return x(), await $.getCode(e, t);
|
|
2039
2089
|
}
|
|
2040
2090
|
async function Lr(e) {
|
|
2041
|
-
return x(), await
|
|
2091
|
+
return x(), await $.isCodeFree(e);
|
|
2042
2092
|
}
|
|
2043
|
-
async function
|
|
2093
|
+
async function Dr(e, t, n, r) {
|
|
2044
2094
|
x();
|
|
2045
|
-
const
|
|
2046
|
-
af:
|
|
2095
|
+
const s = await $.getCode(t, n), o = new URLSearchParams({
|
|
2096
|
+
af: s ?? t
|
|
2047
2097
|
});
|
|
2048
|
-
return
|
|
2098
|
+
return r != null && r.title && o.append("af_title", r.title), r != null && r.format && o.append("af_format", r.format), r != null && r.place && o.append("af_place", r.place), `${e}?${o.toString()}`;
|
|
2049
2099
|
}
|
|
2050
|
-
function
|
|
2100
|
+
function Fr(e) {
|
|
2051
2101
|
return ae.getPayoutsLeaderboard(e);
|
|
2052
2102
|
}
|
|
2053
2103
|
function Br(e) {
|
|
2054
2104
|
return ae.getPointsLeaderboard(e);
|
|
2055
2105
|
}
|
|
2056
|
-
function
|
|
2106
|
+
function kr(e) {
|
|
2057
2107
|
return ae.getReferredUsersLeaderboard(e);
|
|
2058
2108
|
}
|
|
2059
|
-
function
|
|
2109
|
+
function vr(e) {
|
|
2060
2110
|
return z.getVolumeLeaderboard(e);
|
|
2061
2111
|
}
|
|
2062
|
-
function
|
|
2112
|
+
function qr(e) {
|
|
2063
2113
|
return z.getUserPayoutsByConversion(e);
|
|
2064
2114
|
}
|
|
2065
|
-
function
|
|
2115
|
+
function Ir(e) {
|
|
2066
2116
|
return z.getUserPointsByConversion(e);
|
|
2067
2117
|
}
|
|
2068
2118
|
function jr(e) {
|
|
2069
2119
|
return z.getUserPayoutMovements(e);
|
|
2070
2120
|
}
|
|
2071
|
-
function
|
|
2121
|
+
function Hr(e) {
|
|
2072
2122
|
return z.getUserPointsMovements(e);
|
|
2073
2123
|
}
|
|
2074
|
-
async function
|
|
2124
|
+
async function $r(e) {
|
|
2075
2125
|
return x(), Et.getAll(e);
|
|
2076
2126
|
}
|
|
2077
2127
|
async function zr(e) {
|
|
@@ -2080,47 +2130,47 @@ async function zr(e) {
|
|
|
2080
2130
|
async function Vr(e) {
|
|
2081
2131
|
return x(), Ct.getUserAudiences(e);
|
|
2082
2132
|
}
|
|
2083
|
-
function
|
|
2133
|
+
function Pe() {
|
|
2084
2134
|
if (typeof window > "u" || typeof document > "u")
|
|
2085
2135
|
throw new Error("Fuul SDK: Browser context required");
|
|
2086
2136
|
}
|
|
2087
|
-
function
|
|
2137
|
+
function Oe() {
|
|
2088
2138
|
if (navigator.webdriver)
|
|
2089
2139
|
throw new Error("Fuul SDK: You are using a browser automation tool");
|
|
2090
2140
|
}
|
|
2091
2141
|
function Kr() {
|
|
2092
|
-
if (!
|
|
2142
|
+
if (!Ae)
|
|
2093
2143
|
throw new Error("Fuul SDK: Invalid API key");
|
|
2094
2144
|
}
|
|
2095
2145
|
function Jr(e, t) {
|
|
2096
2146
|
return new lr({
|
|
2097
2147
|
baseURL: e,
|
|
2098
2148
|
timeout: 3e4,
|
|
2099
|
-
apiKey:
|
|
2149
|
+
apiKey: Ae,
|
|
2100
2150
|
queryParams: t
|
|
2101
2151
|
});
|
|
2102
2152
|
}
|
|
2103
2153
|
const fs = {
|
|
2104
|
-
init:
|
|
2105
|
-
sendEvent:
|
|
2106
|
-
sendPageview:
|
|
2107
|
-
sendConnectWallet:
|
|
2108
|
-
generateTrackingLink:
|
|
2109
|
-
getConversions:
|
|
2154
|
+
init: Ar,
|
|
2155
|
+
sendEvent: Pr,
|
|
2156
|
+
sendPageview: Or,
|
|
2157
|
+
sendConnectWallet: _r,
|
|
2158
|
+
generateTrackingLink: Dr,
|
|
2159
|
+
getConversions: $r,
|
|
2110
2160
|
createAffiliateCode: xr,
|
|
2111
2161
|
updateAffiliateCode: Nr,
|
|
2112
2162
|
getAffiliateCode: Ur,
|
|
2113
2163
|
isAffiliateCodeFree: Lr,
|
|
2114
|
-
getPayoutsLeaderboard:
|
|
2164
|
+
getPayoutsLeaderboard: Fr,
|
|
2115
2165
|
getPointsLeaderboard: Br,
|
|
2116
|
-
getReferredUsersLeaderboard:
|
|
2166
|
+
getReferredUsersLeaderboard: kr,
|
|
2117
2167
|
getUserAudiences: Vr,
|
|
2118
|
-
getUserPayoutsByConversion:
|
|
2119
|
-
getUserPointsByConversion:
|
|
2120
|
-
getUserPointsMovements:
|
|
2168
|
+
getUserPayoutsByConversion: qr,
|
|
2169
|
+
getUserPointsByConversion: Ir,
|
|
2170
|
+
getUserPointsMovements: Hr,
|
|
2121
2171
|
getUserPayoutMovements: jr,
|
|
2122
2172
|
getUserAffiliates: zr,
|
|
2123
|
-
getVolumeLeaderboard:
|
|
2173
|
+
getVolumeLeaderboard: vr
|
|
2124
2174
|
};
|
|
2125
2175
|
export {
|
|
2126
2176
|
Ve as AddressInUseError,
|