@fuul/sdk 7.7.2 → 7.8.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/README.md +55 -0
- package/dist/claim-checks/ClaimCheckService.d.ts +31 -0
- package/dist/claim-checks/ClaimCheckService.d.ts.map +1 -0
- package/dist/claim-checks/types/index.d.ts +62 -0
- package/dist/claim-checks/types/index.d.ts.map +1 -0
- package/dist/core.d.ts +40 -0
- package/dist/core.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +1037 -989
- package/dist/index.umd.js +6 -6
- package/dist/release.json.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,271 +1,271 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
const
|
|
5
|
-
class
|
|
6
|
-
constructor(
|
|
7
|
-
|
|
8
|
-
this.httpClient =
|
|
9
|
-
}
|
|
10
|
-
async getAffiliateStats(
|
|
1
|
+
var xt = Object.defineProperty;
|
|
2
|
+
var Nt = (t, e, r) => e in t ? xt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
+
var b = (t, e, r) => Nt(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
+
const De = "/affiliate-portal";
|
|
5
|
+
class Ut {
|
|
6
|
+
constructor(e) {
|
|
7
|
+
b(this, "httpClient");
|
|
8
|
+
this.httpClient = e.httpClient;
|
|
9
|
+
}
|
|
10
|
+
async getAffiliateStats(e) {
|
|
11
11
|
return (await this.httpClient.get({
|
|
12
|
-
path: `${
|
|
12
|
+
path: `${De}/stats`,
|
|
13
13
|
queryParams: {
|
|
14
|
-
user_identifier:
|
|
14
|
+
user_identifier: e.user_identifier
|
|
15
15
|
}
|
|
16
16
|
})).data;
|
|
17
17
|
}
|
|
18
|
-
async getAffiliateNewTraders(
|
|
18
|
+
async getAffiliateNewTraders(e) {
|
|
19
19
|
return (await this.httpClient.get({
|
|
20
|
-
path: `${
|
|
20
|
+
path: `${De}/new-traders`,
|
|
21
21
|
queryParams: {
|
|
22
|
-
user_identifier:
|
|
23
|
-
from:
|
|
24
|
-
to:
|
|
22
|
+
user_identifier: e.user_identifier,
|
|
23
|
+
from: e.from,
|
|
24
|
+
to: e.to
|
|
25
25
|
}
|
|
26
26
|
})).data;
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function tt(t, e) {
|
|
30
30
|
return function() {
|
|
31
|
-
return
|
|
31
|
+
return t.apply(e, arguments);
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
const { toString:
|
|
35
|
-
const r =
|
|
36
|
-
return
|
|
37
|
-
})(/* @__PURE__ */ Object.create(null)),
|
|
38
|
-
function W(
|
|
39
|
-
return
|
|
34
|
+
const { toString: Lt } = Object.prototype, { getPrototypeOf: _e } = Object, { iterator: se, toStringTag: rt } = Symbol, ie = /* @__PURE__ */ ((t) => (e) => {
|
|
35
|
+
const r = Lt.call(e);
|
|
36
|
+
return t[r] || (t[r] = r.slice(8, -1).toLowerCase());
|
|
37
|
+
})(/* @__PURE__ */ Object.create(null)), N = (t) => (t = t.toLowerCase(), (e) => ie(e) === t), oe = (t) => (e) => typeof e === t, { isArray: H } = Array, J = oe("undefined");
|
|
38
|
+
function W(t) {
|
|
39
|
+
return t !== null && !J(t) && t.constructor !== null && !J(t.constructor) && P(t.constructor.isBuffer) && t.constructor.isBuffer(t);
|
|
40
40
|
}
|
|
41
|
-
const
|
|
42
|
-
function
|
|
43
|
-
let
|
|
44
|
-
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ?
|
|
41
|
+
const nt = N("ArrayBuffer");
|
|
42
|
+
function Dt(t) {
|
|
43
|
+
let e;
|
|
44
|
+
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? e = ArrayBuffer.isView(t) : e = t && t.buffer && nt(t.buffer), e;
|
|
45
45
|
}
|
|
46
|
-
const
|
|
47
|
-
if (ie(
|
|
46
|
+
const Ft = oe("string"), P = oe("function"), st = oe("number"), Q = (t) => t !== null && typeof t == "object", kt = (t) => t === !0 || t === !1, Z = (t) => {
|
|
47
|
+
if (ie(t) !== "object")
|
|
48
48
|
return !1;
|
|
49
|
-
const
|
|
50
|
-
return (
|
|
51
|
-
},
|
|
52
|
-
if (!Q(
|
|
49
|
+
const e = _e(t);
|
|
50
|
+
return (e === null || e === Object.prototype || Object.getPrototypeOf(e) === null) && !(rt in t) && !(se in t);
|
|
51
|
+
}, Bt = (t) => {
|
|
52
|
+
if (!Q(t) || W(t))
|
|
53
53
|
return !1;
|
|
54
54
|
try {
|
|
55
|
-
return Object.keys(
|
|
55
|
+
return Object.keys(t).length === 0 && Object.getPrototypeOf(t) === Object.prototype;
|
|
56
56
|
} catch {
|
|
57
57
|
return !1;
|
|
58
58
|
}
|
|
59
|
-
},
|
|
60
|
-
let
|
|
61
|
-
return
|
|
62
|
-
|
|
63
|
-
},
|
|
64
|
-
function X(
|
|
65
|
-
if (
|
|
59
|
+
}, qt = N("Date"), vt = N("File"), It = N("Blob"), jt = N("FileList"), $t = (t) => Q(t) && P(t.pipe), Mt = (t) => {
|
|
60
|
+
let e;
|
|
61
|
+
return t && (typeof FormData == "function" && t instanceof FormData || P(t.append) && ((e = ie(t)) === "formdata" || // detect form-data instance
|
|
62
|
+
e === "object" && P(t.toString) && t.toString() === "[object FormData]"));
|
|
63
|
+
}, Ht = N("URLSearchParams"), [Kt, Vt, zt, Jt] = ["ReadableStream", "Request", "Response", "Headers"].map(N), Wt = (t) => t.trim ? t.trim() : t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
64
|
+
function X(t, e, { allOwnKeys: r = !1 } = {}) {
|
|
65
|
+
if (t === null || typeof t > "u")
|
|
66
66
|
return;
|
|
67
67
|
let n, s;
|
|
68
|
-
if (typeof
|
|
69
|
-
for (n = 0, s =
|
|
70
|
-
|
|
68
|
+
if (typeof t != "object" && (t = [t]), H(t))
|
|
69
|
+
for (n = 0, s = t.length; n < s; n++)
|
|
70
|
+
e.call(null, t[n], n, t);
|
|
71
71
|
else {
|
|
72
|
-
if (W(
|
|
72
|
+
if (W(t))
|
|
73
73
|
return;
|
|
74
|
-
const i = r ? Object.getOwnPropertyNames(
|
|
74
|
+
const i = r ? Object.getOwnPropertyNames(t) : Object.keys(t), o = i.length;
|
|
75
75
|
let c;
|
|
76
76
|
for (n = 0; n < o; n++)
|
|
77
|
-
c = i[n],
|
|
77
|
+
c = i[n], e.call(null, t[c], c, t);
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
-
function
|
|
81
|
-
if (W(
|
|
80
|
+
function it(t, e) {
|
|
81
|
+
if (W(t))
|
|
82
82
|
return null;
|
|
83
|
-
|
|
84
|
-
const r = Object.keys(
|
|
83
|
+
e = e.toLowerCase();
|
|
84
|
+
const r = Object.keys(t);
|
|
85
85
|
let n = r.length, s;
|
|
86
86
|
for (; n-- > 0; )
|
|
87
|
-
if (s = r[n],
|
|
87
|
+
if (s = r[n], e === s.toLowerCase())
|
|
88
88
|
return s;
|
|
89
89
|
return null;
|
|
90
90
|
}
|
|
91
|
-
const B = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global,
|
|
91
|
+
const B = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, ot = (t) => !J(t) && t !== B;
|
|
92
92
|
function ye() {
|
|
93
|
-
const { caseless:
|
|
94
|
-
const i =
|
|
95
|
-
Z(
|
|
93
|
+
const { caseless: t } = ot(this) && this || {}, e = {}, r = (n, s) => {
|
|
94
|
+
const i = t && it(e, s) || s;
|
|
95
|
+
Z(e[i]) && Z(n) ? e[i] = ye(e[i], n) : Z(n) ? e[i] = ye({}, n) : H(n) ? e[i] = n.slice() : e[i] = n;
|
|
96
96
|
};
|
|
97
97
|
for (let n = 0, s = arguments.length; n < s; n++)
|
|
98
98
|
arguments[n] && X(arguments[n], r);
|
|
99
|
-
return
|
|
99
|
+
return e;
|
|
100
100
|
}
|
|
101
|
-
const
|
|
102
|
-
r && P(s) ?
|
|
103
|
-
}, { allOwnKeys: n }),
|
|
104
|
-
|
|
105
|
-
value:
|
|
106
|
-
}), r && Object.assign(
|
|
107
|
-
},
|
|
101
|
+
const Qt = (t, e, r, { allOwnKeys: n } = {}) => (X(e, (s, i) => {
|
|
102
|
+
r && P(s) ? t[i] = tt(s, r) : t[i] = s;
|
|
103
|
+
}, { allOwnKeys: n }), t), Xt = (t) => (t.charCodeAt(0) === 65279 && (t = t.slice(1)), t), Yt = (t, e, r, n) => {
|
|
104
|
+
t.prototype = Object.create(e.prototype, n), t.prototype.constructor = t, Object.defineProperty(t, "super", {
|
|
105
|
+
value: e.prototype
|
|
106
|
+
}), r && Object.assign(t.prototype, r);
|
|
107
|
+
}, Gt = (t, e, r, n) => {
|
|
108
108
|
let s, i, o;
|
|
109
109
|
const c = {};
|
|
110
|
-
if (
|
|
110
|
+
if (e = e || {}, t == null) return e;
|
|
111
111
|
do {
|
|
112
|
-
for (s = Object.getOwnPropertyNames(
|
|
113
|
-
o = s[i], (!n || n(o,
|
|
114
|
-
|
|
115
|
-
} while (
|
|
116
|
-
return
|
|
117
|
-
},
|
|
118
|
-
|
|
119
|
-
const n =
|
|
112
|
+
for (s = Object.getOwnPropertyNames(t), i = s.length; i-- > 0; )
|
|
113
|
+
o = s[i], (!n || n(o, t, e)) && !c[o] && (e[o] = t[o], c[o] = !0);
|
|
114
|
+
t = r !== !1 && _e(t);
|
|
115
|
+
} while (t && (!r || r(t, e)) && t !== Object.prototype);
|
|
116
|
+
return e;
|
|
117
|
+
}, Zt = (t, e, r) => {
|
|
118
|
+
t = String(t), (r === void 0 || r > t.length) && (r = t.length), r -= e.length;
|
|
119
|
+
const n = t.indexOf(e, r);
|
|
120
120
|
return n !== -1 && n === r;
|
|
121
|
-
},
|
|
122
|
-
if (!
|
|
123
|
-
if (H(
|
|
124
|
-
let
|
|
125
|
-
if (!
|
|
126
|
-
const r = new Array(
|
|
127
|
-
for (;
|
|
128
|
-
r[
|
|
121
|
+
}, er = (t) => {
|
|
122
|
+
if (!t) return null;
|
|
123
|
+
if (H(t)) return t;
|
|
124
|
+
let e = t.length;
|
|
125
|
+
if (!st(e)) return null;
|
|
126
|
+
const r = new Array(e);
|
|
127
|
+
for (; e-- > 0; )
|
|
128
|
+
r[e] = t[e];
|
|
129
129
|
return r;
|
|
130
|
-
},
|
|
131
|
-
const n = (
|
|
130
|
+
}, tr = /* @__PURE__ */ ((t) => (e) => t && e instanceof t)(typeof Uint8Array < "u" && _e(Uint8Array)), rr = (t, e) => {
|
|
131
|
+
const n = (t && t[se]).call(t);
|
|
132
132
|
let s;
|
|
133
133
|
for (; (s = n.next()) && !s.done; ) {
|
|
134
134
|
const i = s.value;
|
|
135
|
-
|
|
135
|
+
e.call(t, i[0], i[1]);
|
|
136
136
|
}
|
|
137
|
-
},
|
|
137
|
+
}, nr = (t, e) => {
|
|
138
138
|
let r;
|
|
139
139
|
const n = [];
|
|
140
|
-
for (; (r =
|
|
140
|
+
for (; (r = t.exec(e)) !== null; )
|
|
141
141
|
n.push(r);
|
|
142
142
|
return n;
|
|
143
|
-
},
|
|
143
|
+
}, sr = N("HTMLFormElement"), ir = (t) => t.toLowerCase().replace(
|
|
144
144
|
/[-_\s]([a-z\d])(\w*)/g,
|
|
145
145
|
function(r, n, s) {
|
|
146
146
|
return n.toUpperCase() + s;
|
|
147
147
|
}
|
|
148
|
-
),
|
|
149
|
-
const r = Object.getOwnPropertyDescriptors(
|
|
148
|
+
), Fe = (({ hasOwnProperty: t }) => (e, r) => t.call(e, r))(Object.prototype), or = N("RegExp"), at = (t, e) => {
|
|
149
|
+
const r = Object.getOwnPropertyDescriptors(t), n = {};
|
|
150
150
|
X(r, (s, i) => {
|
|
151
151
|
let o;
|
|
152
|
-
(o =
|
|
153
|
-
}), Object.defineProperties(
|
|
154
|
-
},
|
|
155
|
-
|
|
156
|
-
if (P(
|
|
152
|
+
(o = e(s, i, t)) !== !1 && (n[i] = o || s);
|
|
153
|
+
}), Object.defineProperties(t, n);
|
|
154
|
+
}, ar = (t) => {
|
|
155
|
+
at(t, (e, r) => {
|
|
156
|
+
if (P(t) && ["arguments", "caller", "callee"].indexOf(r) !== -1)
|
|
157
157
|
return !1;
|
|
158
|
-
const n =
|
|
158
|
+
const n = t[r];
|
|
159
159
|
if (P(n)) {
|
|
160
|
-
if (
|
|
161
|
-
|
|
160
|
+
if (e.enumerable = !1, "writable" in e) {
|
|
161
|
+
e.writable = !1;
|
|
162
162
|
return;
|
|
163
163
|
}
|
|
164
|
-
|
|
164
|
+
e.set || (e.set = () => {
|
|
165
165
|
throw Error("Can not rewrite read-only method '" + r + "'");
|
|
166
166
|
});
|
|
167
167
|
}
|
|
168
168
|
});
|
|
169
|
-
},
|
|
169
|
+
}, cr = (t, e) => {
|
|
170
170
|
const r = {}, n = (s) => {
|
|
171
171
|
s.forEach((i) => {
|
|
172
172
|
r[i] = !0;
|
|
173
173
|
});
|
|
174
174
|
};
|
|
175
|
-
return H(
|
|
176
|
-
},
|
|
177
|
-
},
|
|
178
|
-
function
|
|
179
|
-
return !!(
|
|
180
|
-
}
|
|
181
|
-
const
|
|
182
|
-
const
|
|
175
|
+
return H(t) ? n(t) : n(String(t).split(e)), r;
|
|
176
|
+
}, ur = () => {
|
|
177
|
+
}, lr = (t, e) => t != null && Number.isFinite(t = +t) ? t : e;
|
|
178
|
+
function fr(t) {
|
|
179
|
+
return !!(t && P(t.append) && t[rt] === "FormData" && t[se]);
|
|
180
|
+
}
|
|
181
|
+
const dr = (t) => {
|
|
182
|
+
const e = new Array(10), r = (n, s) => {
|
|
183
183
|
if (Q(n)) {
|
|
184
|
-
if (
|
|
184
|
+
if (e.indexOf(n) >= 0)
|
|
185
185
|
return;
|
|
186
186
|
if (W(n))
|
|
187
187
|
return n;
|
|
188
188
|
if (!("toJSON" in n)) {
|
|
189
|
-
|
|
189
|
+
e[s] = n;
|
|
190
190
|
const i = H(n) ? [] : {};
|
|
191
191
|
return X(n, (o, c) => {
|
|
192
192
|
const f = r(o, s + 1);
|
|
193
193
|
!J(f) && (i[c] = f);
|
|
194
|
-
}),
|
|
194
|
+
}), e[s] = void 0, i;
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
197
|
return n;
|
|
198
198
|
};
|
|
199
|
-
return r(
|
|
200
|
-
},
|
|
199
|
+
return r(t, 0);
|
|
200
|
+
}, hr = N("AsyncFunction"), pr = (t) => t && (Q(t) || P(t)) && P(t.then) && P(t.catch), ct = ((t, e) => t ? setImmediate : e ? ((r, n) => (B.addEventListener("message", ({ source: s, data: i }) => {
|
|
201
201
|
s === B && i === r && n.length && n.shift()();
|
|
202
202
|
}, !1), (s) => {
|
|
203
203
|
n.push(s), B.postMessage(r, "*");
|
|
204
204
|
}))(`axios@${Math.random()}`, []) : (r) => setTimeout(r))(
|
|
205
205
|
typeof setImmediate == "function",
|
|
206
206
|
P(B.postMessage)
|
|
207
|
-
),
|
|
207
|
+
), mr = typeof queueMicrotask < "u" ? queueMicrotask.bind(B) : typeof process < "u" && process.nextTick || ct, yr = (t) => t != null && P(t[se]), a = {
|
|
208
208
|
isArray: H,
|
|
209
|
-
isArrayBuffer:
|
|
209
|
+
isArrayBuffer: nt,
|
|
210
210
|
isBuffer: W,
|
|
211
|
-
isFormData:
|
|
212
|
-
isArrayBufferView:
|
|
213
|
-
isString:
|
|
214
|
-
isNumber:
|
|
215
|
-
isBoolean:
|
|
211
|
+
isFormData: Mt,
|
|
212
|
+
isArrayBufferView: Dt,
|
|
213
|
+
isString: Ft,
|
|
214
|
+
isNumber: st,
|
|
215
|
+
isBoolean: kt,
|
|
216
216
|
isObject: Q,
|
|
217
217
|
isPlainObject: Z,
|
|
218
|
-
isEmptyObject:
|
|
219
|
-
isReadableStream:
|
|
220
|
-
isRequest:
|
|
221
|
-
isResponse:
|
|
222
|
-
isHeaders:
|
|
218
|
+
isEmptyObject: Bt,
|
|
219
|
+
isReadableStream: Kt,
|
|
220
|
+
isRequest: Vt,
|
|
221
|
+
isResponse: zt,
|
|
222
|
+
isHeaders: Jt,
|
|
223
223
|
isUndefined: J,
|
|
224
|
-
isDate:
|
|
225
|
-
isFile:
|
|
226
|
-
isBlob:
|
|
227
|
-
isRegExp:
|
|
224
|
+
isDate: qt,
|
|
225
|
+
isFile: vt,
|
|
226
|
+
isBlob: It,
|
|
227
|
+
isRegExp: or,
|
|
228
228
|
isFunction: P,
|
|
229
|
-
isStream:
|
|
230
|
-
isURLSearchParams:
|
|
231
|
-
isTypedArray:
|
|
232
|
-
isFileList:
|
|
229
|
+
isStream: $t,
|
|
230
|
+
isURLSearchParams: Ht,
|
|
231
|
+
isTypedArray: tr,
|
|
232
|
+
isFileList: jt,
|
|
233
233
|
forEach: X,
|
|
234
234
|
merge: ye,
|
|
235
|
-
extend:
|
|
236
|
-
trim:
|
|
237
|
-
stripBOM:
|
|
238
|
-
inherits:
|
|
239
|
-
toFlatObject:
|
|
235
|
+
extend: Qt,
|
|
236
|
+
trim: Wt,
|
|
237
|
+
stripBOM: Xt,
|
|
238
|
+
inherits: Yt,
|
|
239
|
+
toFlatObject: Gt,
|
|
240
240
|
kindOf: ie,
|
|
241
|
-
kindOfTest:
|
|
242
|
-
endsWith:
|
|
243
|
-
toArray:
|
|
244
|
-
forEachEntry:
|
|
245
|
-
matchAll:
|
|
246
|
-
isHTMLForm:
|
|
247
|
-
hasOwnProperty:
|
|
248
|
-
hasOwnProp:
|
|
241
|
+
kindOfTest: N,
|
|
242
|
+
endsWith: Zt,
|
|
243
|
+
toArray: er,
|
|
244
|
+
forEachEntry: rr,
|
|
245
|
+
matchAll: nr,
|
|
246
|
+
isHTMLForm: sr,
|
|
247
|
+
hasOwnProperty: Fe,
|
|
248
|
+
hasOwnProp: Fe,
|
|
249
249
|
// an alias to avoid ESLint no-prototype-builtins detection
|
|
250
|
-
reduceDescriptors:
|
|
251
|
-
freezeMethods:
|
|
252
|
-
toObjectSet:
|
|
253
|
-
toCamelCase:
|
|
254
|
-
noop:
|
|
255
|
-
toFiniteNumber:
|
|
256
|
-
findKey:
|
|
250
|
+
reduceDescriptors: at,
|
|
251
|
+
freezeMethods: ar,
|
|
252
|
+
toObjectSet: cr,
|
|
253
|
+
toCamelCase: ir,
|
|
254
|
+
noop: ur,
|
|
255
|
+
toFiniteNumber: lr,
|
|
256
|
+
findKey: it,
|
|
257
257
|
global: B,
|
|
258
|
-
isContextDefined:
|
|
259
|
-
isSpecCompliantForm:
|
|
260
|
-
toJSONObject:
|
|
261
|
-
isAsyncFn:
|
|
262
|
-
isThenable:
|
|
263
|
-
setImmediate:
|
|
264
|
-
asap:
|
|
265
|
-
isIterable:
|
|
258
|
+
isContextDefined: ot,
|
|
259
|
+
isSpecCompliantForm: fr,
|
|
260
|
+
toJSONObject: dr,
|
|
261
|
+
isAsyncFn: hr,
|
|
262
|
+
isThenable: pr,
|
|
263
|
+
setImmediate: ct,
|
|
264
|
+
asap: mr,
|
|
265
|
+
isIterable: yr
|
|
266
266
|
};
|
|
267
|
-
function m(
|
|
268
|
-
Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message =
|
|
267
|
+
function m(t, e, r, n, s) {
|
|
268
|
+
Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = t, this.name = "AxiosError", e && (this.code = e), r && (this.config = r), n && (this.request = n), s && (this.response = s, this.status = s.status ? s.status : null);
|
|
269
269
|
}
|
|
270
270
|
a.inherits(m, Error, {
|
|
271
271
|
toJSON: function() {
|
|
@@ -288,7 +288,7 @@ a.inherits(m, Error, {
|
|
|
288
288
|
};
|
|
289
289
|
}
|
|
290
290
|
});
|
|
291
|
-
const
|
|
291
|
+
const ut = m.prototype, lt = {};
|
|
292
292
|
[
|
|
293
293
|
"ERR_BAD_OPTION_VALUE",
|
|
294
294
|
"ERR_BAD_OPTION",
|
|
@@ -303,46 +303,46 @@ const at = m.prototype, ct = {};
|
|
|
303
303
|
"ERR_NOT_SUPPORT",
|
|
304
304
|
"ERR_INVALID_URL"
|
|
305
305
|
// eslint-disable-next-line func-names
|
|
306
|
-
].forEach((
|
|
307
|
-
|
|
306
|
+
].forEach((t) => {
|
|
307
|
+
lt[t] = { value: t };
|
|
308
308
|
});
|
|
309
|
-
Object.defineProperties(m,
|
|
310
|
-
Object.defineProperty(
|
|
311
|
-
m.from = (
|
|
312
|
-
const o = Object.create(
|
|
313
|
-
return a.toFlatObject(
|
|
309
|
+
Object.defineProperties(m, lt);
|
|
310
|
+
Object.defineProperty(ut, "isAxiosError", { value: !0 });
|
|
311
|
+
m.from = (t, e, r, n, s, i) => {
|
|
312
|
+
const o = Object.create(ut);
|
|
313
|
+
return a.toFlatObject(t, o, function(f) {
|
|
314
314
|
return f !== Error.prototype;
|
|
315
|
-
}, (c) => c !== "isAxiosError"), m.call(o,
|
|
315
|
+
}, (c) => c !== "isAxiosError"), m.call(o, t.message, e, r, n, s), o.cause = t, o.name = t.name, i && Object.assign(o, i), o;
|
|
316
316
|
};
|
|
317
|
-
const
|
|
318
|
-
function ge(
|
|
319
|
-
return a.isPlainObject(
|
|
317
|
+
const gr = null;
|
|
318
|
+
function ge(t) {
|
|
319
|
+
return a.isPlainObject(t) || a.isArray(t);
|
|
320
320
|
}
|
|
321
|
-
function
|
|
322
|
-
return a.endsWith(
|
|
321
|
+
function ft(t) {
|
|
322
|
+
return a.endsWith(t, "[]") ? t.slice(0, -2) : t;
|
|
323
323
|
}
|
|
324
|
-
function
|
|
325
|
-
return
|
|
326
|
-
return s =
|
|
327
|
-
}).join(r ? "." : "") :
|
|
324
|
+
function ke(t, e, r) {
|
|
325
|
+
return t ? t.concat(e).map(function(s, i) {
|
|
326
|
+
return s = ft(s), !r && i ? "[" + s + "]" : s;
|
|
327
|
+
}).join(r ? "." : "") : e;
|
|
328
328
|
}
|
|
329
|
-
function
|
|
330
|
-
return a.isArray(
|
|
329
|
+
function wr(t) {
|
|
330
|
+
return a.isArray(t) && !t.some(ge);
|
|
331
331
|
}
|
|
332
|
-
const
|
|
333
|
-
return /^is[A-Z]/.test(
|
|
332
|
+
const br = a.toFlatObject(a, {}, null, function(e) {
|
|
333
|
+
return /^is[A-Z]/.test(e);
|
|
334
334
|
});
|
|
335
|
-
function ae(
|
|
336
|
-
if (!a.isObject(
|
|
335
|
+
function ae(t, e, r) {
|
|
336
|
+
if (!a.isObject(t))
|
|
337
337
|
throw new TypeError("target must be an object");
|
|
338
|
-
|
|
338
|
+
e = e || new FormData(), r = a.toFlatObject(r, {
|
|
339
339
|
metaTokens: !0,
|
|
340
340
|
dots: !1,
|
|
341
341
|
indexes: !1
|
|
342
342
|
}, !1, function(y, p) {
|
|
343
343
|
return !a.isUndefined(p[y]);
|
|
344
344
|
});
|
|
345
|
-
const n = r.metaTokens, s = r.visitor || u, i = r.dots, o = r.indexes, f = (r.Blob || typeof Blob < "u" && Blob) && a.isSpecCompliantForm(
|
|
345
|
+
const n = r.metaTokens, s = r.visitor || u, i = r.dots, o = r.indexes, f = (r.Blob || typeof Blob < "u" && Blob) && a.isSpecCompliantForm(e);
|
|
346
346
|
if (!a.isFunction(s))
|
|
347
347
|
throw new TypeError("visitor must be a function");
|
|
348
348
|
function l(h) {
|
|
@@ -356,22 +356,22 @@ function ae(e, t, r) {
|
|
|
356
356
|
return a.isArrayBuffer(h) || a.isTypedArray(h) ? f && typeof Blob == "function" ? new Blob([h]) : Buffer.from(h) : h;
|
|
357
357
|
}
|
|
358
358
|
function u(h, y, p) {
|
|
359
|
-
let
|
|
359
|
+
let C = h;
|
|
360
360
|
if (h && !p && typeof h == "object") {
|
|
361
361
|
if (a.endsWith(y, "{}"))
|
|
362
362
|
y = n ? y : y.slice(0, -2), h = JSON.stringify(h);
|
|
363
|
-
else if (a.isArray(h) &&
|
|
364
|
-
return y =
|
|
365
|
-
!(a.isUndefined(R) || R === null) &&
|
|
363
|
+
else if (a.isArray(h) && wr(h) || (a.isFileList(h) || a.endsWith(y, "[]")) && (C = a.toArray(h)))
|
|
364
|
+
return y = ft(y), C.forEach(function(R, L) {
|
|
365
|
+
!(a.isUndefined(R) || R === null) && e.append(
|
|
366
366
|
// eslint-disable-next-line no-nested-ternary
|
|
367
|
-
o === !0 ?
|
|
367
|
+
o === !0 ? ke([y], L, i) : o === null ? y : y + "[]",
|
|
368
368
|
l(R)
|
|
369
369
|
);
|
|
370
370
|
}), !1;
|
|
371
371
|
}
|
|
372
|
-
return ge(h) ? !0 : (
|
|
372
|
+
return ge(h) ? !0 : (e.append(ke(p, y, i), l(h)), !1);
|
|
373
373
|
}
|
|
374
|
-
const d = [], g = Object.assign(
|
|
374
|
+
const d = [], g = Object.assign(br, {
|
|
375
375
|
defaultVisitor: u,
|
|
376
376
|
convertValue: l,
|
|
377
377
|
isVisitable: ge
|
|
@@ -380,23 +380,23 @@ function ae(e, t, r) {
|
|
|
380
380
|
if (!a.isUndefined(h)) {
|
|
381
381
|
if (d.indexOf(h) !== -1)
|
|
382
382
|
throw Error("Circular reference detected in " + y.join("."));
|
|
383
|
-
d.push(h), a.forEach(h, function(
|
|
384
|
-
(!(a.isUndefined(
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
a.isString(
|
|
383
|
+
d.push(h), a.forEach(h, function(C, _) {
|
|
384
|
+
(!(a.isUndefined(C) || C === null) && s.call(
|
|
385
|
+
e,
|
|
386
|
+
C,
|
|
387
|
+
a.isString(_) ? _.trim() : _,
|
|
388
388
|
y,
|
|
389
389
|
g
|
|
390
|
-
)) === !0 && w(
|
|
390
|
+
)) === !0 && w(C, y ? y.concat(_) : [_]);
|
|
391
391
|
}), d.pop();
|
|
392
392
|
}
|
|
393
393
|
}
|
|
394
|
-
if (!a.isObject(
|
|
394
|
+
if (!a.isObject(t))
|
|
395
395
|
throw new TypeError("data must be an object");
|
|
396
|
-
return w(
|
|
396
|
+
return w(t), e;
|
|
397
397
|
}
|
|
398
|
-
function
|
|
399
|
-
const
|
|
398
|
+
function Be(t) {
|
|
399
|
+
const e = {
|
|
400
400
|
"!": "%21",
|
|
401
401
|
"'": "%27",
|
|
402
402
|
"(": "%28",
|
|
@@ -405,44 +405,44 @@ function ke(e) {
|
|
|
405
405
|
"%20": "+",
|
|
406
406
|
"%00": "\0"
|
|
407
407
|
};
|
|
408
|
-
return encodeURIComponent(
|
|
409
|
-
return
|
|
408
|
+
return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g, function(n) {
|
|
409
|
+
return e[n];
|
|
410
410
|
});
|
|
411
411
|
}
|
|
412
|
-
function Re(
|
|
413
|
-
this._pairs = [],
|
|
412
|
+
function Re(t, e) {
|
|
413
|
+
this._pairs = [], t && ae(t, this, e);
|
|
414
414
|
}
|
|
415
|
-
const
|
|
416
|
-
|
|
417
|
-
this._pairs.push([
|
|
415
|
+
const dt = Re.prototype;
|
|
416
|
+
dt.append = function(e, r) {
|
|
417
|
+
this._pairs.push([e, r]);
|
|
418
418
|
};
|
|
419
|
-
|
|
420
|
-
const r =
|
|
421
|
-
return
|
|
422
|
-
} :
|
|
419
|
+
dt.toString = function(e) {
|
|
420
|
+
const r = e ? function(n) {
|
|
421
|
+
return e.call(this, n, Be);
|
|
422
|
+
} : Be;
|
|
423
423
|
return this._pairs.map(function(s) {
|
|
424
424
|
return r(s[0]) + "=" + r(s[1]);
|
|
425
425
|
}, "").join("&");
|
|
426
426
|
};
|
|
427
|
-
function
|
|
428
|
-
return encodeURIComponent(
|
|
427
|
+
function Er(t) {
|
|
428
|
+
return encodeURIComponent(t).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
|
|
429
429
|
}
|
|
430
|
-
function
|
|
431
|
-
if (!
|
|
432
|
-
return
|
|
433
|
-
const n = r && r.encode ||
|
|
430
|
+
function ht(t, e, r) {
|
|
431
|
+
if (!e)
|
|
432
|
+
return t;
|
|
433
|
+
const n = r && r.encode || Er;
|
|
434
434
|
a.isFunction(r) && (r = {
|
|
435
435
|
serialize: r
|
|
436
436
|
});
|
|
437
437
|
const s = r && r.serialize;
|
|
438
438
|
let i;
|
|
439
|
-
if (s ? i = s(
|
|
440
|
-
const o =
|
|
441
|
-
o !== -1 && (
|
|
439
|
+
if (s ? i = s(e, r) : i = a.isURLSearchParams(e) ? e.toString() : new Re(e, r).toString(n), i) {
|
|
440
|
+
const o = t.indexOf("#");
|
|
441
|
+
o !== -1 && (t = t.slice(0, o)), t += (t.indexOf("?") === -1 ? "?" : "&") + i;
|
|
442
442
|
}
|
|
443
|
-
return
|
|
443
|
+
return t;
|
|
444
444
|
}
|
|
445
|
-
class
|
|
445
|
+
class qe {
|
|
446
446
|
constructor() {
|
|
447
447
|
this.handlers = [];
|
|
448
448
|
}
|
|
@@ -454,9 +454,9 @@ class Be {
|
|
|
454
454
|
*
|
|
455
455
|
* @return {Number} An ID used to remove interceptor later
|
|
456
456
|
*/
|
|
457
|
-
use(
|
|
457
|
+
use(e, r, n) {
|
|
458
458
|
return this.handlers.push({
|
|
459
|
-
fulfilled:
|
|
459
|
+
fulfilled: e,
|
|
460
460
|
rejected: r,
|
|
461
461
|
synchronous: n ? n.synchronous : !1,
|
|
462
462
|
runWhen: n ? n.runWhen : null
|
|
@@ -469,8 +469,8 @@ class Be {
|
|
|
469
469
|
*
|
|
470
470
|
* @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
|
|
471
471
|
*/
|
|
472
|
-
eject(
|
|
473
|
-
this.handlers[
|
|
472
|
+
eject(e) {
|
|
473
|
+
this.handlers[e] && (this.handlers[e] = null);
|
|
474
474
|
}
|
|
475
475
|
/**
|
|
476
476
|
* Clear all interceptors from the stack
|
|
@@ -490,123 +490,123 @@ class Be {
|
|
|
490
490
|
*
|
|
491
491
|
* @returns {void}
|
|
492
492
|
*/
|
|
493
|
-
forEach(
|
|
493
|
+
forEach(e) {
|
|
494
494
|
a.forEach(this.handlers, function(n) {
|
|
495
|
-
n !== null &&
|
|
495
|
+
n !== null && e(n);
|
|
496
496
|
});
|
|
497
497
|
}
|
|
498
498
|
}
|
|
499
|
-
const
|
|
499
|
+
const pt = {
|
|
500
500
|
silentJSONParsing: !0,
|
|
501
501
|
forcedJSONParsing: !0,
|
|
502
502
|
clarifyTimeoutError: !1
|
|
503
|
-
},
|
|
503
|
+
}, Cr = typeof URLSearchParams < "u" ? URLSearchParams : Re, Sr = typeof FormData < "u" ? FormData : null, _r = typeof Blob < "u" ? Blob : null, Rr = {
|
|
504
504
|
isBrowser: !0,
|
|
505
505
|
classes: {
|
|
506
|
-
URLSearchParams:
|
|
507
|
-
FormData:
|
|
508
|
-
Blob:
|
|
506
|
+
URLSearchParams: Cr,
|
|
507
|
+
FormData: Sr,
|
|
508
|
+
Blob: _r
|
|
509
509
|
},
|
|
510
510
|
protocols: ["http", "https", "file", "blob", "url", "data"]
|
|
511
|
-
},
|
|
512
|
-
self instanceof WorkerGlobalScope && typeof self.importScripts == "function",
|
|
511
|
+
}, Te = typeof window < "u" && typeof document < "u", we = typeof navigator == "object" && navigator || void 0, Tr = Te && (!we || ["ReactNative", "NativeScript", "NS"].indexOf(we.product) < 0), Ar = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
|
|
512
|
+
self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Pr = Te && window.location.href || "http://localhost", Or = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
513
513
|
__proto__: null,
|
|
514
|
-
hasBrowserEnv:
|
|
515
|
-
hasStandardBrowserEnv:
|
|
516
|
-
hasStandardBrowserWebWorkerEnv:
|
|
514
|
+
hasBrowserEnv: Te,
|
|
515
|
+
hasStandardBrowserEnv: Tr,
|
|
516
|
+
hasStandardBrowserWebWorkerEnv: Ar,
|
|
517
517
|
navigator: we,
|
|
518
|
-
origin:
|
|
519
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
520
|
-
...
|
|
521
|
-
...
|
|
518
|
+
origin: Pr
|
|
519
|
+
}, Symbol.toStringTag, { value: "Module" })), T = {
|
|
520
|
+
...Or,
|
|
521
|
+
...Rr
|
|
522
522
|
};
|
|
523
|
-
function
|
|
524
|
-
return ae(
|
|
523
|
+
function xr(t, e) {
|
|
524
|
+
return ae(t, new T.classes.URLSearchParams(), {
|
|
525
525
|
visitor: function(r, n, s, i) {
|
|
526
|
-
return
|
|
526
|
+
return T.isNode && a.isBuffer(r) ? (this.append(n, r.toString("base64")), !1) : i.defaultVisitor.apply(this, arguments);
|
|
527
527
|
},
|
|
528
|
-
...
|
|
528
|
+
...e
|
|
529
529
|
});
|
|
530
530
|
}
|
|
531
|
-
function
|
|
532
|
-
return a.matchAll(/\w+|\[(\w*)]/g,
|
|
531
|
+
function Nr(t) {
|
|
532
|
+
return a.matchAll(/\w+|\[(\w*)]/g, t).map((e) => e[0] === "[]" ? "" : e[1] || e[0]);
|
|
533
533
|
}
|
|
534
|
-
function
|
|
535
|
-
const
|
|
534
|
+
function Ur(t) {
|
|
535
|
+
const e = {}, r = Object.keys(t);
|
|
536
536
|
let n;
|
|
537
537
|
const s = r.length;
|
|
538
538
|
let i;
|
|
539
539
|
for (n = 0; n < s; n++)
|
|
540
|
-
i = r[n],
|
|
541
|
-
return
|
|
540
|
+
i = r[n], e[i] = t[i];
|
|
541
|
+
return e;
|
|
542
542
|
}
|
|
543
|
-
function
|
|
544
|
-
function
|
|
543
|
+
function mt(t) {
|
|
544
|
+
function e(r, n, s, i) {
|
|
545
545
|
let o = r[i++];
|
|
546
546
|
if (o === "__proto__") return !0;
|
|
547
547
|
const c = Number.isFinite(+o), f = i >= r.length;
|
|
548
|
-
return o = !o && a.isArray(s) ? s.length : o, f ? (a.hasOwnProp(s, o) ? s[o] = [s[o], n] : s[o] = n, !c) : ((!s[o] || !a.isObject(s[o])) && (s[o] = []),
|
|
548
|
+
return o = !o && a.isArray(s) ? s.length : o, f ? (a.hasOwnProp(s, o) ? s[o] = [s[o], n] : s[o] = n, !c) : ((!s[o] || !a.isObject(s[o])) && (s[o] = []), e(r, n, s[o], i) && a.isArray(s[o]) && (s[o] = Ur(s[o])), !c);
|
|
549
549
|
}
|
|
550
|
-
if (a.isFormData(
|
|
550
|
+
if (a.isFormData(t) && a.isFunction(t.entries)) {
|
|
551
551
|
const r = {};
|
|
552
|
-
return a.forEachEntry(
|
|
553
|
-
|
|
552
|
+
return a.forEachEntry(t, (n, s) => {
|
|
553
|
+
e(Nr(n), s, r, 0);
|
|
554
554
|
}), r;
|
|
555
555
|
}
|
|
556
556
|
return null;
|
|
557
557
|
}
|
|
558
|
-
function
|
|
559
|
-
if (a.isString(
|
|
558
|
+
function Lr(t, e, r) {
|
|
559
|
+
if (a.isString(t))
|
|
560
560
|
try {
|
|
561
|
-
return (
|
|
561
|
+
return (e || JSON.parse)(t), a.trim(t);
|
|
562
562
|
} catch (n) {
|
|
563
563
|
if (n.name !== "SyntaxError")
|
|
564
564
|
throw n;
|
|
565
565
|
}
|
|
566
|
-
return (0, JSON.stringify)(
|
|
566
|
+
return (0, JSON.stringify)(t);
|
|
567
567
|
}
|
|
568
568
|
const Y = {
|
|
569
|
-
transitional:
|
|
569
|
+
transitional: pt,
|
|
570
570
|
adapter: ["xhr", "http", "fetch"],
|
|
571
|
-
transformRequest: [function(
|
|
572
|
-
const n = r.getContentType() || "", s = n.indexOf("application/json") > -1, i = a.isObject(
|
|
573
|
-
if (i && a.isHTMLForm(
|
|
574
|
-
return s ? JSON.stringify(
|
|
575
|
-
if (a.isArrayBuffer(
|
|
576
|
-
return
|
|
577
|
-
if (a.isArrayBufferView(
|
|
578
|
-
return
|
|
579
|
-
if (a.isURLSearchParams(
|
|
580
|
-
return r.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1),
|
|
571
|
+
transformRequest: [function(e, r) {
|
|
572
|
+
const n = r.getContentType() || "", s = n.indexOf("application/json") > -1, i = a.isObject(e);
|
|
573
|
+
if (i && a.isHTMLForm(e) && (e = new FormData(e)), a.isFormData(e))
|
|
574
|
+
return s ? JSON.stringify(mt(e)) : e;
|
|
575
|
+
if (a.isArrayBuffer(e) || a.isBuffer(e) || a.isStream(e) || a.isFile(e) || a.isBlob(e) || a.isReadableStream(e))
|
|
576
|
+
return e;
|
|
577
|
+
if (a.isArrayBufferView(e))
|
|
578
|
+
return e.buffer;
|
|
579
|
+
if (a.isURLSearchParams(e))
|
|
580
|
+
return r.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), e.toString();
|
|
581
581
|
let c;
|
|
582
582
|
if (i) {
|
|
583
583
|
if (n.indexOf("application/x-www-form-urlencoded") > -1)
|
|
584
|
-
return
|
|
585
|
-
if ((c = a.isFileList(
|
|
584
|
+
return xr(e, this.formSerializer).toString();
|
|
585
|
+
if ((c = a.isFileList(e)) || n.indexOf("multipart/form-data") > -1) {
|
|
586
586
|
const f = this.env && this.env.FormData;
|
|
587
587
|
return ae(
|
|
588
|
-
c ? { "files[]":
|
|
588
|
+
c ? { "files[]": e } : e,
|
|
589
589
|
f && new f(),
|
|
590
590
|
this.formSerializer
|
|
591
591
|
);
|
|
592
592
|
}
|
|
593
593
|
}
|
|
594
|
-
return i || s ? (r.setContentType("application/json", !1),
|
|
594
|
+
return i || s ? (r.setContentType("application/json", !1), Lr(e)) : e;
|
|
595
595
|
}],
|
|
596
|
-
transformResponse: [function(
|
|
596
|
+
transformResponse: [function(e) {
|
|
597
597
|
const r = this.transitional || Y.transitional, n = r && r.forcedJSONParsing, s = this.responseType === "json";
|
|
598
|
-
if (a.isResponse(
|
|
599
|
-
return
|
|
600
|
-
if (
|
|
598
|
+
if (a.isResponse(e) || a.isReadableStream(e))
|
|
599
|
+
return e;
|
|
600
|
+
if (e && a.isString(e) && (n && !this.responseType || s)) {
|
|
601
601
|
const o = !(r && r.silentJSONParsing) && s;
|
|
602
602
|
try {
|
|
603
|
-
return JSON.parse(
|
|
603
|
+
return JSON.parse(e);
|
|
604
604
|
} catch (c) {
|
|
605
605
|
if (o)
|
|
606
606
|
throw c.name === "SyntaxError" ? m.from(c, m.ERR_BAD_RESPONSE, this, null, this.response) : c;
|
|
607
607
|
}
|
|
608
608
|
}
|
|
609
|
-
return
|
|
609
|
+
return e;
|
|
610
610
|
}],
|
|
611
611
|
/**
|
|
612
612
|
* A timeout in milliseconds to abort a request. If set to 0 (default) a
|
|
@@ -618,11 +618,11 @@ const Y = {
|
|
|
618
618
|
maxContentLength: -1,
|
|
619
619
|
maxBodyLength: -1,
|
|
620
620
|
env: {
|
|
621
|
-
FormData:
|
|
622
|
-
Blob:
|
|
621
|
+
FormData: T.classes.FormData,
|
|
622
|
+
Blob: T.classes.Blob
|
|
623
623
|
},
|
|
624
|
-
validateStatus: function(
|
|
625
|
-
return
|
|
624
|
+
validateStatus: function(e) {
|
|
625
|
+
return e >= 200 && e < 300;
|
|
626
626
|
},
|
|
627
627
|
headers: {
|
|
628
628
|
common: {
|
|
@@ -631,10 +631,10 @@ const Y = {
|
|
|
631
631
|
}
|
|
632
632
|
}
|
|
633
633
|
};
|
|
634
|
-
a.forEach(["delete", "get", "head", "post", "put", "patch"], (
|
|
635
|
-
Y.headers[
|
|
634
|
+
a.forEach(["delete", "get", "head", "post", "put", "patch"], (t) => {
|
|
635
|
+
Y.headers[t] = {};
|
|
636
636
|
});
|
|
637
|
-
const
|
|
637
|
+
const Dr = a.toObjectSet([
|
|
638
638
|
"age",
|
|
639
639
|
"authorization",
|
|
640
640
|
"content-length",
|
|
@@ -652,57 +652,57 @@ const Ur = a.toObjectSet([
|
|
|
652
652
|
"referer",
|
|
653
653
|
"retry-after",
|
|
654
654
|
"user-agent"
|
|
655
|
-
]),
|
|
656
|
-
const
|
|
655
|
+
]), Fr = (t) => {
|
|
656
|
+
const e = {};
|
|
657
657
|
let r, n, s;
|
|
658
|
-
return
|
|
658
|
+
return t && t.split(`
|
|
659
659
|
`).forEach(function(o) {
|
|
660
|
-
s = o.indexOf(":"), r = o.substring(0, s).trim().toLowerCase(), n = o.substring(s + 1).trim(), !(!r ||
|
|
661
|
-
}),
|
|
662
|
-
},
|
|
663
|
-
function z(
|
|
664
|
-
return
|
|
660
|
+
s = o.indexOf(":"), r = o.substring(0, s).trim().toLowerCase(), n = o.substring(s + 1).trim(), !(!r || e[r] && Dr[r]) && (r === "set-cookie" ? e[r] ? e[r].push(n) : e[r] = [n] : e[r] = e[r] ? e[r] + ", " + n : n);
|
|
661
|
+
}), e;
|
|
662
|
+
}, ve = Symbol("internals");
|
|
663
|
+
function z(t) {
|
|
664
|
+
return t && String(t).trim().toLowerCase();
|
|
665
665
|
}
|
|
666
|
-
function ee(
|
|
667
|
-
return
|
|
666
|
+
function ee(t) {
|
|
667
|
+
return t === !1 || t == null ? t : a.isArray(t) ? t.map(ee) : String(t);
|
|
668
668
|
}
|
|
669
|
-
function
|
|
670
|
-
const
|
|
669
|
+
function kr(t) {
|
|
670
|
+
const e = /* @__PURE__ */ Object.create(null), r = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
671
671
|
let n;
|
|
672
|
-
for (; n = r.exec(
|
|
673
|
-
|
|
674
|
-
return
|
|
672
|
+
for (; n = r.exec(t); )
|
|
673
|
+
e[n[1]] = n[2];
|
|
674
|
+
return e;
|
|
675
675
|
}
|
|
676
|
-
const
|
|
677
|
-
function de(
|
|
676
|
+
const Br = (t) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());
|
|
677
|
+
function de(t, e, r, n, s) {
|
|
678
678
|
if (a.isFunction(n))
|
|
679
|
-
return n.call(this,
|
|
680
|
-
if (s && (
|
|
679
|
+
return n.call(this, e, r);
|
|
680
|
+
if (s && (e = r), !!a.isString(e)) {
|
|
681
681
|
if (a.isString(n))
|
|
682
|
-
return
|
|
682
|
+
return e.indexOf(n) !== -1;
|
|
683
683
|
if (a.isRegExp(n))
|
|
684
|
-
return n.test(
|
|
684
|
+
return n.test(e);
|
|
685
685
|
}
|
|
686
686
|
}
|
|
687
|
-
function
|
|
688
|
-
return
|
|
687
|
+
function qr(t) {
|
|
688
|
+
return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (e, r, n) => r.toUpperCase() + n);
|
|
689
689
|
}
|
|
690
|
-
function
|
|
691
|
-
const r = a.toCamelCase(" " +
|
|
690
|
+
function vr(t, e) {
|
|
691
|
+
const r = a.toCamelCase(" " + e);
|
|
692
692
|
["get", "set", "has"].forEach((n) => {
|
|
693
|
-
Object.defineProperty(
|
|
693
|
+
Object.defineProperty(t, n + r, {
|
|
694
694
|
value: function(s, i, o) {
|
|
695
|
-
return this[n].call(this,
|
|
695
|
+
return this[n].call(this, e, s, i, o);
|
|
696
696
|
},
|
|
697
697
|
configurable: !0
|
|
698
698
|
});
|
|
699
699
|
});
|
|
700
700
|
}
|
|
701
701
|
let O = class {
|
|
702
|
-
constructor(
|
|
703
|
-
|
|
702
|
+
constructor(e) {
|
|
703
|
+
e && this.set(e);
|
|
704
704
|
}
|
|
705
|
-
set(
|
|
705
|
+
set(e, r, n) {
|
|
706
706
|
const s = this;
|
|
707
707
|
function i(c, f, l) {
|
|
708
708
|
const u = z(f);
|
|
@@ -712,31 +712,31 @@ let O = class {
|
|
|
712
712
|
(!d || s[d] === void 0 || l === !0 || l === void 0 && s[d] !== !1) && (s[d || f] = ee(c));
|
|
713
713
|
}
|
|
714
714
|
const o = (c, f) => a.forEach(c, (l, u) => i(l, u, f));
|
|
715
|
-
if (a.isPlainObject(
|
|
716
|
-
o(
|
|
717
|
-
else if (a.isString(
|
|
718
|
-
o(
|
|
719
|
-
else if (a.isObject(
|
|
715
|
+
if (a.isPlainObject(e) || e instanceof this.constructor)
|
|
716
|
+
o(e, r);
|
|
717
|
+
else if (a.isString(e) && (e = e.trim()) && !Br(e))
|
|
718
|
+
o(Fr(e), r);
|
|
719
|
+
else if (a.isObject(e) && a.isIterable(e)) {
|
|
720
720
|
let c = {}, f, l;
|
|
721
|
-
for (const u of
|
|
721
|
+
for (const u of e) {
|
|
722
722
|
if (!a.isArray(u))
|
|
723
723
|
throw TypeError("Object iterator must return a key-value pair");
|
|
724
724
|
c[l = u[0]] = (f = c[l]) ? a.isArray(f) ? [...f, u[1]] : [f, u[1]] : u[1];
|
|
725
725
|
}
|
|
726
726
|
o(c, r);
|
|
727
727
|
} else
|
|
728
|
-
|
|
728
|
+
e != null && i(r, e, n);
|
|
729
729
|
return this;
|
|
730
730
|
}
|
|
731
|
-
get(
|
|
732
|
-
if (
|
|
733
|
-
const n = a.findKey(this,
|
|
731
|
+
get(e, r) {
|
|
732
|
+
if (e = z(e), e) {
|
|
733
|
+
const n = a.findKey(this, e);
|
|
734
734
|
if (n) {
|
|
735
735
|
const s = this[n];
|
|
736
736
|
if (!r)
|
|
737
737
|
return s;
|
|
738
738
|
if (r === !0)
|
|
739
|
-
return
|
|
739
|
+
return kr(s);
|
|
740
740
|
if (a.isFunction(r))
|
|
741
741
|
return r.call(this, s, n);
|
|
742
742
|
if (a.isRegExp(r))
|
|
@@ -745,14 +745,14 @@ let O = class {
|
|
|
745
745
|
}
|
|
746
746
|
}
|
|
747
747
|
}
|
|
748
|
-
has(
|
|
749
|
-
if (
|
|
750
|
-
const n = a.findKey(this,
|
|
748
|
+
has(e, r) {
|
|
749
|
+
if (e = z(e), e) {
|
|
750
|
+
const n = a.findKey(this, e);
|
|
751
751
|
return !!(n && this[n] !== void 0 && (!r || de(this, this[n], n, r)));
|
|
752
752
|
}
|
|
753
753
|
return !1;
|
|
754
754
|
}
|
|
755
|
-
delete(
|
|
755
|
+
delete(e, r) {
|
|
756
756
|
const n = this;
|
|
757
757
|
let s = !1;
|
|
758
758
|
function i(o) {
|
|
@@ -761,18 +761,18 @@ let O = class {
|
|
|
761
761
|
c && (!r || de(n, n[c], c, r)) && (delete n[c], s = !0);
|
|
762
762
|
}
|
|
763
763
|
}
|
|
764
|
-
return a.isArray(
|
|
764
|
+
return a.isArray(e) ? e.forEach(i) : i(e), s;
|
|
765
765
|
}
|
|
766
|
-
clear(
|
|
766
|
+
clear(e) {
|
|
767
767
|
const r = Object.keys(this);
|
|
768
768
|
let n = r.length, s = !1;
|
|
769
769
|
for (; n--; ) {
|
|
770
770
|
const i = r[n];
|
|
771
|
-
(!
|
|
771
|
+
(!e || de(this, this[i], i, e, !0)) && (delete this[i], s = !0);
|
|
772
772
|
}
|
|
773
773
|
return s;
|
|
774
774
|
}
|
|
775
|
-
normalize(
|
|
775
|
+
normalize(e) {
|
|
776
776
|
const r = this, n = {};
|
|
777
777
|
return a.forEach(this, (s, i) => {
|
|
778
778
|
const o = a.findKey(n, i);
|
|
@@ -780,24 +780,24 @@ let O = class {
|
|
|
780
780
|
r[o] = ee(s), delete r[i];
|
|
781
781
|
return;
|
|
782
782
|
}
|
|
783
|
-
const c =
|
|
783
|
+
const c = e ? qr(i) : String(i).trim();
|
|
784
784
|
c !== i && delete r[i], r[c] = ee(s), n[c] = !0;
|
|
785
785
|
}), this;
|
|
786
786
|
}
|
|
787
|
-
concat(...
|
|
788
|
-
return this.constructor.concat(this, ...
|
|
787
|
+
concat(...e) {
|
|
788
|
+
return this.constructor.concat(this, ...e);
|
|
789
789
|
}
|
|
790
|
-
toJSON(
|
|
790
|
+
toJSON(e) {
|
|
791
791
|
const r = /* @__PURE__ */ Object.create(null);
|
|
792
792
|
return a.forEach(this, (n, s) => {
|
|
793
|
-
n != null && n !== !1 && (r[s] =
|
|
793
|
+
n != null && n !== !1 && (r[s] = e && a.isArray(n) ? n.join(", ") : n);
|
|
794
794
|
}), r;
|
|
795
795
|
}
|
|
796
796
|
[Symbol.iterator]() {
|
|
797
797
|
return Object.entries(this.toJSON())[Symbol.iterator]();
|
|
798
798
|
}
|
|
799
799
|
toString() {
|
|
800
|
-
return Object.entries(this.toJSON()).map(([
|
|
800
|
+
return Object.entries(this.toJSON()).map(([e, r]) => e + ": " + r).join(`
|
|
801
801
|
`);
|
|
802
802
|
}
|
|
803
803
|
getSetCookie() {
|
|
@@ -806,54 +806,54 @@ let O = class {
|
|
|
806
806
|
get [Symbol.toStringTag]() {
|
|
807
807
|
return "AxiosHeaders";
|
|
808
808
|
}
|
|
809
|
-
static from(
|
|
810
|
-
return
|
|
809
|
+
static from(e) {
|
|
810
|
+
return e instanceof this ? e : new this(e);
|
|
811
811
|
}
|
|
812
|
-
static concat(
|
|
813
|
-
const n = new this(
|
|
812
|
+
static concat(e, ...r) {
|
|
813
|
+
const n = new this(e);
|
|
814
814
|
return r.forEach((s) => n.set(s)), n;
|
|
815
815
|
}
|
|
816
|
-
static accessor(
|
|
817
|
-
const n = (this[
|
|
816
|
+
static accessor(e) {
|
|
817
|
+
const n = (this[ve] = this[ve] = {
|
|
818
818
|
accessors: {}
|
|
819
819
|
}).accessors, s = this.prototype;
|
|
820
820
|
function i(o) {
|
|
821
821
|
const c = z(o);
|
|
822
|
-
n[c] || (
|
|
822
|
+
n[c] || (vr(s, o), n[c] = !0);
|
|
823
823
|
}
|
|
824
|
-
return a.isArray(
|
|
824
|
+
return a.isArray(e) ? e.forEach(i) : i(e), this;
|
|
825
825
|
}
|
|
826
826
|
};
|
|
827
827
|
O.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
|
|
828
|
-
a.reduceDescriptors(O.prototype, ({ value:
|
|
829
|
-
let r =
|
|
828
|
+
a.reduceDescriptors(O.prototype, ({ value: t }, e) => {
|
|
829
|
+
let r = e[0].toUpperCase() + e.slice(1);
|
|
830
830
|
return {
|
|
831
|
-
get: () =>
|
|
831
|
+
get: () => t,
|
|
832
832
|
set(n) {
|
|
833
833
|
this[r] = n;
|
|
834
834
|
}
|
|
835
835
|
};
|
|
836
836
|
});
|
|
837
837
|
a.freezeMethods(O);
|
|
838
|
-
function he(
|
|
839
|
-
const r = this || Y, n =
|
|
838
|
+
function he(t, e) {
|
|
839
|
+
const r = this || Y, n = e || r, s = O.from(n.headers);
|
|
840
840
|
let i = n.data;
|
|
841
|
-
return a.forEach(
|
|
842
|
-
i = c.call(r, i, s.normalize(),
|
|
841
|
+
return a.forEach(t, function(c) {
|
|
842
|
+
i = c.call(r, i, s.normalize(), e ? e.status : void 0);
|
|
843
843
|
}), s.normalize(), i;
|
|
844
844
|
}
|
|
845
|
-
function
|
|
846
|
-
return !!(
|
|
845
|
+
function yt(t) {
|
|
846
|
+
return !!(t && t.__CANCEL__);
|
|
847
847
|
}
|
|
848
|
-
function K(
|
|
849
|
-
m.call(this,
|
|
848
|
+
function K(t, e, r) {
|
|
849
|
+
m.call(this, t ?? "canceled", m.ERR_CANCELED, e, r), this.name = "CanceledError";
|
|
850
850
|
}
|
|
851
851
|
a.inherits(K, m, {
|
|
852
852
|
__CANCEL__: !0
|
|
853
853
|
});
|
|
854
|
-
function
|
|
854
|
+
function gt(t, e, r) {
|
|
855
855
|
const n = r.config.validateStatus;
|
|
856
|
-
!r.status || !n || n(r.status) ?
|
|
856
|
+
!r.status || !n || n(r.status) ? t(r) : e(new m(
|
|
857
857
|
"Request failed with status code " + r.status,
|
|
858
858
|
[m.ERR_BAD_REQUEST, m.ERR_BAD_RESPONSE][Math.floor(r.status / 100) - 4],
|
|
859
859
|
r.config,
|
|
@@ -861,30 +861,30 @@ function mt(e, t, r) {
|
|
|
861
861
|
r
|
|
862
862
|
));
|
|
863
863
|
}
|
|
864
|
-
function
|
|
865
|
-
const
|
|
866
|
-
return
|
|
864
|
+
function Ir(t) {
|
|
865
|
+
const e = /^([-+\w]{1,25})(:?\/\/|:)/.exec(t);
|
|
866
|
+
return e && e[1] || "";
|
|
867
867
|
}
|
|
868
|
-
function
|
|
869
|
-
|
|
870
|
-
const r = new Array(
|
|
868
|
+
function jr(t, e) {
|
|
869
|
+
t = t || 10;
|
|
870
|
+
const r = new Array(t), n = new Array(t);
|
|
871
871
|
let s = 0, i = 0, o;
|
|
872
|
-
return
|
|
872
|
+
return e = e !== void 0 ? e : 1e3, function(f) {
|
|
873
873
|
const l = Date.now(), u = n[i];
|
|
874
874
|
o || (o = l), r[s] = f, n[s] = l;
|
|
875
875
|
let d = i, g = 0;
|
|
876
876
|
for (; d !== s; )
|
|
877
|
-
g += r[d++], d = d %
|
|
878
|
-
if (s = (s + 1) %
|
|
877
|
+
g += r[d++], d = d % t;
|
|
878
|
+
if (s = (s + 1) % t, s === i && (i = (i + 1) % t), l - o < e)
|
|
879
879
|
return;
|
|
880
880
|
const w = u && l - u;
|
|
881
881
|
return w ? Math.round(g * 1e3 / w) : void 0;
|
|
882
882
|
};
|
|
883
883
|
}
|
|
884
|
-
function
|
|
885
|
-
let r = 0, n = 1e3 /
|
|
884
|
+
function $r(t, e) {
|
|
885
|
+
let r = 0, n = 1e3 / e, s, i;
|
|
886
886
|
const o = (l, u = Date.now()) => {
|
|
887
|
-
r = u, s = null, i && (clearTimeout(i), i = null),
|
|
887
|
+
r = u, s = null, i && (clearTimeout(i), i = null), t(...l);
|
|
888
888
|
};
|
|
889
889
|
return [(...l) => {
|
|
890
890
|
const u = Date.now(), d = u - r;
|
|
@@ -893,10 +893,10 @@ function Ir(e, t) {
|
|
|
893
893
|
}, n - d)));
|
|
894
894
|
}, () => s && o(s)];
|
|
895
895
|
}
|
|
896
|
-
const re = (
|
|
896
|
+
const re = (t, e, r = 3) => {
|
|
897
897
|
let n = 0;
|
|
898
|
-
const s =
|
|
899
|
-
return
|
|
898
|
+
const s = jr(50, 250);
|
|
899
|
+
return $r((i) => {
|
|
900
900
|
const o = i.loaded, c = i.lengthComputable ? i.total : void 0, f = o - n, l = s(f), u = o <= c;
|
|
901
901
|
n = o;
|
|
902
902
|
const d = {
|
|
@@ -908,33 +908,33 @@ const re = (e, t, r = 3) => {
|
|
|
908
908
|
estimated: l && c && u ? (c - o) / l : void 0,
|
|
909
909
|
event: i,
|
|
910
910
|
lengthComputable: c != null,
|
|
911
|
-
[
|
|
911
|
+
[e ? "download" : "upload"]: !0
|
|
912
912
|
};
|
|
913
|
-
|
|
913
|
+
t(d);
|
|
914
914
|
}, r);
|
|
915
|
-
},
|
|
916
|
-
const r =
|
|
917
|
-
return [(n) =>
|
|
915
|
+
}, Ie = (t, e) => {
|
|
916
|
+
const r = t != null;
|
|
917
|
+
return [(n) => e[0]({
|
|
918
918
|
lengthComputable: r,
|
|
919
|
-
total:
|
|
919
|
+
total: t,
|
|
920
920
|
loaded: n
|
|
921
|
-
}),
|
|
922
|
-
},
|
|
923
|
-
new URL(
|
|
924
|
-
|
|
925
|
-
) : () => !0,
|
|
921
|
+
}), e[1]];
|
|
922
|
+
}, je = (t) => (...e) => a.asap(() => t(...e)), Mr = T.hasStandardBrowserEnv ? /* @__PURE__ */ ((t, e) => (r) => (r = new URL(r, T.origin), t.protocol === r.protocol && t.host === r.host && (e || t.port === r.port)))(
|
|
923
|
+
new URL(T.origin),
|
|
924
|
+
T.navigator && /(msie|trident)/i.test(T.navigator.userAgent)
|
|
925
|
+
) : () => !0, Hr = T.hasStandardBrowserEnv ? (
|
|
926
926
|
// Standard browser envs support document.cookie
|
|
927
927
|
{
|
|
928
|
-
write(
|
|
929
|
-
const o = [
|
|
928
|
+
write(t, e, r, n, s, i) {
|
|
929
|
+
const o = [t + "=" + encodeURIComponent(e)];
|
|
930
930
|
a.isNumber(r) && o.push("expires=" + new Date(r).toGMTString()), a.isString(n) && o.push("path=" + n), a.isString(s) && o.push("domain=" + s), i === !0 && o.push("secure"), document.cookie = o.join("; ");
|
|
931
931
|
},
|
|
932
|
-
read(
|
|
933
|
-
const
|
|
934
|
-
return
|
|
932
|
+
read(t) {
|
|
933
|
+
const e = document.cookie.match(new RegExp("(^|;\\s*)(" + t + ")=([^;]*)"));
|
|
934
|
+
return e ? decodeURIComponent(e[3]) : null;
|
|
935
935
|
},
|
|
936
|
-
remove(
|
|
937
|
-
this.write(
|
|
936
|
+
remove(t) {
|
|
937
|
+
this.write(t, "", Date.now() - 864e5);
|
|
938
938
|
}
|
|
939
939
|
}
|
|
940
940
|
) : (
|
|
@@ -949,19 +949,19 @@ const re = (e, t, r = 3) => {
|
|
|
949
949
|
}
|
|
950
950
|
}
|
|
951
951
|
);
|
|
952
|
-
function
|
|
953
|
-
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(
|
|
952
|
+
function Kr(t) {
|
|
953
|
+
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);
|
|
954
954
|
}
|
|
955
|
-
function
|
|
956
|
-
return
|
|
955
|
+
function Vr(t, e) {
|
|
956
|
+
return e ? t.replace(/\/?\/$/, "") + "/" + e.replace(/^\/+/, "") : t;
|
|
957
957
|
}
|
|
958
|
-
function
|
|
959
|
-
let n = !
|
|
960
|
-
return
|
|
958
|
+
function wt(t, e, r) {
|
|
959
|
+
let n = !Kr(e);
|
|
960
|
+
return t && (n || r == !1) ? Vr(t, e) : e;
|
|
961
961
|
}
|
|
962
|
-
const
|
|
963
|
-
function v(
|
|
964
|
-
|
|
962
|
+
const $e = (t) => t instanceof O ? { ...t } : t;
|
|
963
|
+
function v(t, e) {
|
|
964
|
+
e = e || {};
|
|
965
965
|
const r = {};
|
|
966
966
|
function n(l, u, d, g) {
|
|
967
967
|
return a.isPlainObject(l) && a.isPlainObject(u) ? a.merge.call({ caseless: g }, l, u) : a.isPlainObject(u) ? a.merge({}, u) : a.isArray(u) ? u.slice() : u;
|
|
@@ -983,9 +983,9 @@ function v(e, t) {
|
|
|
983
983
|
} else return n(void 0, u);
|
|
984
984
|
}
|
|
985
985
|
function c(l, u, d) {
|
|
986
|
-
if (d in t)
|
|
987
|
-
return n(l, u);
|
|
988
986
|
if (d in e)
|
|
987
|
+
return n(l, u);
|
|
988
|
+
if (d in t)
|
|
989
989
|
return n(void 0, l);
|
|
990
990
|
}
|
|
991
991
|
const f = {
|
|
@@ -1017,37 +1017,37 @@ function v(e, t) {
|
|
|
1017
1017
|
socketPath: o,
|
|
1018
1018
|
responseEncoding: o,
|
|
1019
1019
|
validateStatus: c,
|
|
1020
|
-
headers: (l, u, d) => s(
|
|
1020
|
+
headers: (l, u, d) => s($e(l), $e(u), d, !0)
|
|
1021
1021
|
};
|
|
1022
|
-
return a.forEach(Object.keys({ ...
|
|
1023
|
-
const d = f[u] || s, g = d(
|
|
1022
|
+
return a.forEach(Object.keys({ ...t, ...e }), function(u) {
|
|
1023
|
+
const d = f[u] || s, g = d(t[u], e[u], u);
|
|
1024
1024
|
a.isUndefined(g) && d !== c || (r[u] = g);
|
|
1025
1025
|
}), r;
|
|
1026
1026
|
}
|
|
1027
|
-
const
|
|
1028
|
-
const
|
|
1029
|
-
let { data: r, withXSRFToken: n, xsrfHeaderName: s, xsrfCookieName: i, headers: o, auth: c } =
|
|
1030
|
-
|
|
1027
|
+
const bt = (t) => {
|
|
1028
|
+
const e = v({}, t);
|
|
1029
|
+
let { data: r, withXSRFToken: n, xsrfHeaderName: s, xsrfCookieName: i, headers: o, auth: c } = e;
|
|
1030
|
+
e.headers = o = O.from(o), e.url = ht(wt(e.baseURL, e.url, e.allowAbsoluteUrls), t.params, t.paramsSerializer), c && o.set(
|
|
1031
1031
|
"Authorization",
|
|
1032
1032
|
"Basic " + btoa((c.username || "") + ":" + (c.password ? unescape(encodeURIComponent(c.password)) : ""))
|
|
1033
1033
|
);
|
|
1034
1034
|
let f;
|
|
1035
1035
|
if (a.isFormData(r)) {
|
|
1036
|
-
if (
|
|
1036
|
+
if (T.hasStandardBrowserEnv || T.hasStandardBrowserWebWorkerEnv)
|
|
1037
1037
|
o.setContentType(void 0);
|
|
1038
1038
|
else if ((f = o.getContentType()) !== !1) {
|
|
1039
1039
|
const [l, ...u] = f ? f.split(";").map((d) => d.trim()).filter(Boolean) : [];
|
|
1040
1040
|
o.setContentType([l || "multipart/form-data", ...u].join("; "));
|
|
1041
1041
|
}
|
|
1042
1042
|
}
|
|
1043
|
-
if (
|
|
1044
|
-
const l = s && i &&
|
|
1043
|
+
if (T.hasStandardBrowserEnv && (n && a.isFunction(n) && (n = n(e)), n || n !== !1 && Mr(e.url))) {
|
|
1044
|
+
const l = s && i && Hr.read(i);
|
|
1045
1045
|
l && o.set(s, l);
|
|
1046
1046
|
}
|
|
1047
|
-
return
|
|
1048
|
-
},
|
|
1047
|
+
return e;
|
|
1048
|
+
}, zr = typeof XMLHttpRequest < "u", Jr = zr && function(t) {
|
|
1049
1049
|
return new Promise(function(r, n) {
|
|
1050
|
-
const s =
|
|
1050
|
+
const s = bt(t);
|
|
1051
1051
|
let i = s.data;
|
|
1052
1052
|
const o = O.from(s.headers).normalize();
|
|
1053
1053
|
let { responseType: c, onUploadProgress: f, onDownloadProgress: l } = s, u, d, g, w, h;
|
|
@@ -1056,55 +1056,55 @@ const gt = (e) => {
|
|
|
1056
1056
|
}
|
|
1057
1057
|
let p = new XMLHttpRequest();
|
|
1058
1058
|
p.open(s.method.toUpperCase(), s.url, !0), p.timeout = s.timeout;
|
|
1059
|
-
function
|
|
1059
|
+
function C() {
|
|
1060
1060
|
if (!p)
|
|
1061
1061
|
return;
|
|
1062
1062
|
const R = O.from(
|
|
1063
1063
|
"getAllResponseHeaders" in p && p.getAllResponseHeaders()
|
|
1064
|
-
),
|
|
1064
|
+
), A = {
|
|
1065
1065
|
data: !c || c === "text" || c === "json" ? p.responseText : p.response,
|
|
1066
1066
|
status: p.status,
|
|
1067
1067
|
statusText: p.statusText,
|
|
1068
1068
|
headers: R,
|
|
1069
|
-
config:
|
|
1069
|
+
config: t,
|
|
1070
1070
|
request: p
|
|
1071
1071
|
};
|
|
1072
|
-
|
|
1072
|
+
gt(function(k) {
|
|
1073
1073
|
r(k), y();
|
|
1074
1074
|
}, function(k) {
|
|
1075
1075
|
n(k), y();
|
|
1076
|
-
},
|
|
1076
|
+
}, A), p = null;
|
|
1077
1077
|
}
|
|
1078
|
-
"onloadend" in p ? p.onloadend =
|
|
1079
|
-
!p || p.readyState !== 4 || p.status === 0 && !(p.responseURL && p.responseURL.indexOf("file:") === 0) || setTimeout(
|
|
1078
|
+
"onloadend" in p ? p.onloadend = C : p.onreadystatechange = function() {
|
|
1079
|
+
!p || p.readyState !== 4 || p.status === 0 && !(p.responseURL && p.responseURL.indexOf("file:") === 0) || setTimeout(C);
|
|
1080
1080
|
}, p.onabort = function() {
|
|
1081
|
-
p && (n(new m("Request aborted", m.ECONNABORTED,
|
|
1081
|
+
p && (n(new m("Request aborted", m.ECONNABORTED, t, p)), p = null);
|
|
1082
1082
|
}, p.onerror = function() {
|
|
1083
|
-
n(new m("Network Error", m.ERR_NETWORK,
|
|
1083
|
+
n(new m("Network Error", m.ERR_NETWORK, t, p)), p = null;
|
|
1084
1084
|
}, p.ontimeout = function() {
|
|
1085
1085
|
let L = s.timeout ? "timeout of " + s.timeout + "ms exceeded" : "timeout exceeded";
|
|
1086
|
-
const
|
|
1086
|
+
const A = s.transitional || pt;
|
|
1087
1087
|
s.timeoutErrorMessage && (L = s.timeoutErrorMessage), n(new m(
|
|
1088
1088
|
L,
|
|
1089
|
-
|
|
1090
|
-
|
|
1089
|
+
A.clarifyTimeoutError ? m.ETIMEDOUT : m.ECONNABORTED,
|
|
1090
|
+
t,
|
|
1091
1091
|
p
|
|
1092
1092
|
)), p = null;
|
|
1093
|
-
}, i === void 0 && o.setContentType(null), "setRequestHeader" in p && a.forEach(o.toJSON(), function(L,
|
|
1094
|
-
p.setRequestHeader(
|
|
1093
|
+
}, i === void 0 && o.setContentType(null), "setRequestHeader" in p && a.forEach(o.toJSON(), function(L, A) {
|
|
1094
|
+
p.setRequestHeader(A, L);
|
|
1095
1095
|
}), a.isUndefined(s.withCredentials) || (p.withCredentials = !!s.withCredentials), c && c !== "json" && (p.responseType = s.responseType), l && ([g, h] = re(l, !0), p.addEventListener("progress", g)), f && p.upload && ([d, w] = re(f), p.upload.addEventListener("progress", d), p.upload.addEventListener("loadend", w)), (s.cancelToken || s.signal) && (u = (R) => {
|
|
1096
|
-
p && (n(!R || R.type ? new K(null,
|
|
1096
|
+
p && (n(!R || R.type ? new K(null, t, p) : R), p.abort(), p = null);
|
|
1097
1097
|
}, s.cancelToken && s.cancelToken.subscribe(u), s.signal && (s.signal.aborted ? u() : s.signal.addEventListener("abort", u)));
|
|
1098
|
-
const
|
|
1099
|
-
if (
|
|
1100
|
-
n(new m("Unsupported protocol " +
|
|
1098
|
+
const _ = Ir(s.url);
|
|
1099
|
+
if (_ && T.protocols.indexOf(_) === -1) {
|
|
1100
|
+
n(new m("Unsupported protocol " + _ + ":", m.ERR_BAD_REQUEST, t));
|
|
1101
1101
|
return;
|
|
1102
1102
|
}
|
|
1103
1103
|
p.send(i || null);
|
|
1104
1104
|
});
|
|
1105
|
-
},
|
|
1106
|
-
const { length: r } =
|
|
1107
|
-
if (
|
|
1105
|
+
}, Wr = (t, e) => {
|
|
1106
|
+
const { length: r } = t = t ? t.filter(Boolean) : [];
|
|
1107
|
+
if (e || r) {
|
|
1108
1108
|
let n = new AbortController(), s;
|
|
1109
1109
|
const i = function(l) {
|
|
1110
1110
|
if (!s) {
|
|
@@ -1113,48 +1113,48 @@ const gt = (e) => {
|
|
|
1113
1113
|
n.abort(u instanceof m ? u : new K(u instanceof Error ? u.message : u));
|
|
1114
1114
|
}
|
|
1115
1115
|
};
|
|
1116
|
-
let o =
|
|
1117
|
-
o = null, i(new m(`timeout ${
|
|
1118
|
-
},
|
|
1116
|
+
let o = e && setTimeout(() => {
|
|
1117
|
+
o = null, i(new m(`timeout ${e} of ms exceeded`, m.ETIMEDOUT));
|
|
1118
|
+
}, e);
|
|
1119
1119
|
const c = () => {
|
|
1120
|
-
|
|
1120
|
+
t && (o && clearTimeout(o), o = null, t.forEach((l) => {
|
|
1121
1121
|
l.unsubscribe ? l.unsubscribe(i) : l.removeEventListener("abort", i);
|
|
1122
|
-
}),
|
|
1122
|
+
}), t = null);
|
|
1123
1123
|
};
|
|
1124
|
-
|
|
1124
|
+
t.forEach((l) => l.addEventListener("abort", i));
|
|
1125
1125
|
const { signal: f } = n;
|
|
1126
1126
|
return f.unsubscribe = () => a.asap(c), f;
|
|
1127
1127
|
}
|
|
1128
|
-
},
|
|
1129
|
-
let r =
|
|
1130
|
-
if (r <
|
|
1131
|
-
yield
|
|
1128
|
+
}, Qr = function* (t, e) {
|
|
1129
|
+
let r = t.byteLength;
|
|
1130
|
+
if (r < e) {
|
|
1131
|
+
yield t;
|
|
1132
1132
|
return;
|
|
1133
1133
|
}
|
|
1134
1134
|
let n = 0, s;
|
|
1135
1135
|
for (; n < r; )
|
|
1136
|
-
s = n +
|
|
1137
|
-
},
|
|
1138
|
-
for await (const r of
|
|
1139
|
-
yield*
|
|
1140
|
-
},
|
|
1141
|
-
if (
|
|
1142
|
-
yield*
|
|
1136
|
+
s = n + e, yield t.slice(n, s), n = s;
|
|
1137
|
+
}, Xr = async function* (t, e) {
|
|
1138
|
+
for await (const r of Yr(t))
|
|
1139
|
+
yield* Qr(r, e);
|
|
1140
|
+
}, Yr = async function* (t) {
|
|
1141
|
+
if (t[Symbol.asyncIterator]) {
|
|
1142
|
+
yield* t;
|
|
1143
1143
|
return;
|
|
1144
1144
|
}
|
|
1145
|
-
const
|
|
1145
|
+
const e = t.getReader();
|
|
1146
1146
|
try {
|
|
1147
1147
|
for (; ; ) {
|
|
1148
|
-
const { done: r, value: n } = await
|
|
1148
|
+
const { done: r, value: n } = await e.read();
|
|
1149
1149
|
if (r)
|
|
1150
1150
|
break;
|
|
1151
1151
|
yield n;
|
|
1152
1152
|
}
|
|
1153
1153
|
} finally {
|
|
1154
|
-
await
|
|
1154
|
+
await e.cancel();
|
|
1155
1155
|
}
|
|
1156
|
-
},
|
|
1157
|
-
const s =
|
|
1156
|
+
}, Me = (t, e, r, n) => {
|
|
1157
|
+
const s = Xr(t, e);
|
|
1158
1158
|
let i = 0, o, c = (f) => {
|
|
1159
1159
|
o || (o = !0, n && n(f));
|
|
1160
1160
|
};
|
|
@@ -1182,52 +1182,52 @@ const gt = (e) => {
|
|
|
1182
1182
|
}, {
|
|
1183
1183
|
highWaterMark: 2
|
|
1184
1184
|
});
|
|
1185
|
-
}, ce = typeof fetch == "function" && typeof Request == "function" && typeof Response == "function",
|
|
1185
|
+
}, ce = typeof fetch == "function" && typeof Request == "function" && typeof Response == "function", Et = ce && typeof ReadableStream == "function", Gr = ce && (typeof TextEncoder == "function" ? /* @__PURE__ */ ((t) => (e) => t.encode(e))(new TextEncoder()) : async (t) => new Uint8Array(await new Response(t).arrayBuffer())), Ct = (t, ...e) => {
|
|
1186
1186
|
try {
|
|
1187
|
-
return !!
|
|
1187
|
+
return !!t(...e);
|
|
1188
1188
|
} catch {
|
|
1189
1189
|
return !1;
|
|
1190
1190
|
}
|
|
1191
|
-
},
|
|
1192
|
-
let
|
|
1193
|
-
const
|
|
1191
|
+
}, Zr = Et && Ct(() => {
|
|
1192
|
+
let t = !1;
|
|
1193
|
+
const e = new Request(T.origin, {
|
|
1194
1194
|
body: new ReadableStream(),
|
|
1195
1195
|
method: "POST",
|
|
1196
1196
|
get duplex() {
|
|
1197
|
-
return
|
|
1197
|
+
return t = !0, "half";
|
|
1198
1198
|
}
|
|
1199
1199
|
}).headers.has("Content-Type");
|
|
1200
|
-
return
|
|
1201
|
-
}),
|
|
1202
|
-
stream: be && ((
|
|
1200
|
+
return t && !e;
|
|
1201
|
+
}), He = 64 * 1024, be = Et && Ct(() => a.isReadableStream(new Response("").body)), ne = {
|
|
1202
|
+
stream: be && ((t) => t.body)
|
|
1203
1203
|
};
|
|
1204
|
-
ce && ((
|
|
1205
|
-
["text", "arrayBuffer", "blob", "formData", "stream"].forEach((
|
|
1206
|
-
!ne[
|
|
1207
|
-
throw new m(`Response type '${
|
|
1204
|
+
ce && ((t) => {
|
|
1205
|
+
["text", "arrayBuffer", "blob", "formData", "stream"].forEach((e) => {
|
|
1206
|
+
!ne[e] && (ne[e] = a.isFunction(t[e]) ? (r) => r[e]() : (r, n) => {
|
|
1207
|
+
throw new m(`Response type '${e}' is not supported`, m.ERR_NOT_SUPPORT, n);
|
|
1208
1208
|
});
|
|
1209
1209
|
});
|
|
1210
1210
|
})(new Response());
|
|
1211
|
-
const
|
|
1212
|
-
if (
|
|
1211
|
+
const en = async (t) => {
|
|
1212
|
+
if (t == null)
|
|
1213
1213
|
return 0;
|
|
1214
|
-
if (a.isBlob(
|
|
1215
|
-
return
|
|
1216
|
-
if (a.isSpecCompliantForm(
|
|
1217
|
-
return (await new Request(
|
|
1214
|
+
if (a.isBlob(t))
|
|
1215
|
+
return t.size;
|
|
1216
|
+
if (a.isSpecCompliantForm(t))
|
|
1217
|
+
return (await new Request(T.origin, {
|
|
1218
1218
|
method: "POST",
|
|
1219
|
-
body:
|
|
1219
|
+
body: t
|
|
1220
1220
|
}).arrayBuffer()).byteLength;
|
|
1221
|
-
if (a.isArrayBufferView(
|
|
1222
|
-
return
|
|
1223
|
-
if (a.isURLSearchParams(
|
|
1224
|
-
return (await
|
|
1225
|
-
},
|
|
1226
|
-
const r = a.toFiniteNumber(
|
|
1227
|
-
return r ??
|
|
1228
|
-
},
|
|
1221
|
+
if (a.isArrayBufferView(t) || a.isArrayBuffer(t))
|
|
1222
|
+
return t.byteLength;
|
|
1223
|
+
if (a.isURLSearchParams(t) && (t = t + ""), a.isString(t))
|
|
1224
|
+
return (await Gr(t)).byteLength;
|
|
1225
|
+
}, tn = async (t, e) => {
|
|
1226
|
+
const r = a.toFiniteNumber(t.getContentLength());
|
|
1227
|
+
return r ?? en(e);
|
|
1228
|
+
}, rn = ce && (async (t) => {
|
|
1229
1229
|
let {
|
|
1230
|
-
url:
|
|
1230
|
+
url: e,
|
|
1231
1231
|
method: r,
|
|
1232
1232
|
data: n,
|
|
1233
1233
|
signal: s,
|
|
@@ -1239,101 +1239,101 @@ const Gr = async (e) => {
|
|
|
1239
1239
|
headers: u,
|
|
1240
1240
|
withCredentials: d = "same-origin",
|
|
1241
1241
|
fetchOptions: g
|
|
1242
|
-
} =
|
|
1242
|
+
} = bt(t);
|
|
1243
1243
|
l = l ? (l + "").toLowerCase() : "text";
|
|
1244
|
-
let w =
|
|
1244
|
+
let w = Wr([s, i && i.toAbortSignal()], o), h;
|
|
1245
1245
|
const y = w && w.unsubscribe && (() => {
|
|
1246
1246
|
w.unsubscribe();
|
|
1247
1247
|
});
|
|
1248
1248
|
let p;
|
|
1249
1249
|
try {
|
|
1250
|
-
if (f &&
|
|
1251
|
-
let
|
|
1250
|
+
if (f && Zr && r !== "get" && r !== "head" && (p = await tn(u, n)) !== 0) {
|
|
1251
|
+
let A = new Request(e, {
|
|
1252
1252
|
method: "POST",
|
|
1253
1253
|
body: n,
|
|
1254
1254
|
duplex: "half"
|
|
1255
|
-
}),
|
|
1256
|
-
if (a.isFormData(n) && (
|
|
1257
|
-
const [k, G] =
|
|
1255
|
+
}), F;
|
|
1256
|
+
if (a.isFormData(n) && (F = A.headers.get("content-type")) && u.setContentType(F), A.body) {
|
|
1257
|
+
const [k, G] = Ie(
|
|
1258
1258
|
p,
|
|
1259
|
-
re(
|
|
1259
|
+
re(je(f))
|
|
1260
1260
|
);
|
|
1261
|
-
n =
|
|
1261
|
+
n = Me(A.body, He, k, G);
|
|
1262
1262
|
}
|
|
1263
1263
|
}
|
|
1264
1264
|
a.isString(d) || (d = d ? "include" : "omit");
|
|
1265
|
-
const
|
|
1266
|
-
h = new Request(
|
|
1265
|
+
const C = "credentials" in Request.prototype;
|
|
1266
|
+
h = new Request(e, {
|
|
1267
1267
|
...g,
|
|
1268
1268
|
signal: w,
|
|
1269
1269
|
method: r.toUpperCase(),
|
|
1270
1270
|
headers: u.normalize().toJSON(),
|
|
1271
1271
|
body: n,
|
|
1272
1272
|
duplex: "half",
|
|
1273
|
-
credentials:
|
|
1273
|
+
credentials: C ? d : void 0
|
|
1274
1274
|
});
|
|
1275
|
-
let
|
|
1275
|
+
let _ = await fetch(h, g);
|
|
1276
1276
|
const R = be && (l === "stream" || l === "response");
|
|
1277
1277
|
if (be && (c || R && y)) {
|
|
1278
|
-
const
|
|
1279
|
-
["status", "statusText", "headers"].forEach((
|
|
1280
|
-
|
|
1278
|
+
const A = {};
|
|
1279
|
+
["status", "statusText", "headers"].forEach((Le) => {
|
|
1280
|
+
A[Le] = _[Le];
|
|
1281
1281
|
});
|
|
1282
|
-
const
|
|
1283
|
-
|
|
1284
|
-
re(
|
|
1282
|
+
const F = a.toFiniteNumber(_.headers.get("content-length")), [k, G] = c && Ie(
|
|
1283
|
+
F,
|
|
1284
|
+
re(je(c), !0)
|
|
1285
1285
|
) || [];
|
|
1286
|
-
|
|
1287
|
-
|
|
1286
|
+
_ = new Response(
|
|
1287
|
+
Me(_.body, He, k, () => {
|
|
1288
1288
|
G && G(), y && y();
|
|
1289
1289
|
}),
|
|
1290
|
-
|
|
1290
|
+
A
|
|
1291
1291
|
);
|
|
1292
1292
|
}
|
|
1293
1293
|
l = l || "text";
|
|
1294
|
-
let L = await ne[a.findKey(ne, l) || "text"](
|
|
1295
|
-
return !R && y && y(), await new Promise((
|
|
1296
|
-
|
|
1294
|
+
let L = await ne[a.findKey(ne, l) || "text"](_, t);
|
|
1295
|
+
return !R && y && y(), await new Promise((A, F) => {
|
|
1296
|
+
gt(A, F, {
|
|
1297
1297
|
data: L,
|
|
1298
|
-
headers: O.from(
|
|
1299
|
-
status:
|
|
1300
|
-
statusText:
|
|
1301
|
-
config:
|
|
1298
|
+
headers: O.from(_.headers),
|
|
1299
|
+
status: _.status,
|
|
1300
|
+
statusText: _.statusText,
|
|
1301
|
+
config: t,
|
|
1302
1302
|
request: h
|
|
1303
1303
|
});
|
|
1304
1304
|
});
|
|
1305
|
-
} catch (
|
|
1306
|
-
throw y && y(),
|
|
1307
|
-
new m("Network Error", m.ERR_NETWORK,
|
|
1305
|
+
} catch (C) {
|
|
1306
|
+
throw y && y(), C && C.name === "TypeError" && /Load failed|fetch/i.test(C.message) ? Object.assign(
|
|
1307
|
+
new m("Network Error", m.ERR_NETWORK, t, h),
|
|
1308
1308
|
{
|
|
1309
|
-
cause:
|
|
1309
|
+
cause: C.cause || C
|
|
1310
1310
|
}
|
|
1311
|
-
) : m.from(
|
|
1311
|
+
) : m.from(C, C && C.code, t, h);
|
|
1312
1312
|
}
|
|
1313
1313
|
}), Ee = {
|
|
1314
|
-
http:
|
|
1315
|
-
xhr:
|
|
1316
|
-
fetch:
|
|
1314
|
+
http: gr,
|
|
1315
|
+
xhr: Jr,
|
|
1316
|
+
fetch: rn
|
|
1317
1317
|
};
|
|
1318
|
-
a.forEach(Ee, (
|
|
1319
|
-
if (
|
|
1318
|
+
a.forEach(Ee, (t, e) => {
|
|
1319
|
+
if (t) {
|
|
1320
1320
|
try {
|
|
1321
|
-
Object.defineProperty(
|
|
1321
|
+
Object.defineProperty(t, "name", { value: e });
|
|
1322
1322
|
} catch {
|
|
1323
1323
|
}
|
|
1324
|
-
Object.defineProperty(
|
|
1324
|
+
Object.defineProperty(t, "adapterName", { value: e });
|
|
1325
1325
|
}
|
|
1326
1326
|
});
|
|
1327
|
-
const
|
|
1328
|
-
getAdapter: (
|
|
1329
|
-
|
|
1330
|
-
const { length:
|
|
1327
|
+
const Ke = (t) => `- ${t}`, nn = (t) => a.isFunction(t) || t === null || t === !1, St = {
|
|
1328
|
+
getAdapter: (t) => {
|
|
1329
|
+
t = a.isArray(t) ? t : [t];
|
|
1330
|
+
const { length: e } = t;
|
|
1331
1331
|
let r, n;
|
|
1332
1332
|
const s = {};
|
|
1333
|
-
for (let i = 0; i <
|
|
1334
|
-
r =
|
|
1333
|
+
for (let i = 0; i < e; i++) {
|
|
1334
|
+
r = t[i];
|
|
1335
1335
|
let o;
|
|
1336
|
-
if (n = r, !
|
|
1336
|
+
if (n = r, !nn(r) && (n = Ee[(o = String(r)).toLowerCase()], n === void 0))
|
|
1337
1337
|
throw new m(`Unknown adapter '${o}'`);
|
|
1338
1338
|
if (n)
|
|
1339
1339
|
break;
|
|
@@ -1343,9 +1343,9 @@ const He = (e) => `- ${e}`, tn = (e) => a.isFunction(e) || e === null || e === !
|
|
|
1343
1343
|
const i = Object.entries(s).map(
|
|
1344
1344
|
([c, f]) => `adapter ${c} ` + (f === !1 ? "is not supported by the environment" : "is not available in the build")
|
|
1345
1345
|
);
|
|
1346
|
-
let o =
|
|
1347
|
-
` + i.map(
|
|
1348
|
-
`) : " " +
|
|
1346
|
+
let o = e ? i.length > 1 ? `since :
|
|
1347
|
+
` + i.map(Ke).join(`
|
|
1348
|
+
`) : " " + Ke(i[0]) : "as no adapter specified";
|
|
1349
1349
|
throw new m(
|
|
1350
1350
|
"There is no suitable adapter to dispatch the request " + o,
|
|
1351
1351
|
"ERR_NOT_SUPPORT"
|
|
@@ -1355,65 +1355,65 @@ const He = (e) => `- ${e}`, tn = (e) => a.isFunction(e) || e === null || e === !
|
|
|
1355
1355
|
},
|
|
1356
1356
|
adapters: Ee
|
|
1357
1357
|
};
|
|
1358
|
-
function pe(
|
|
1359
|
-
if (
|
|
1360
|
-
throw new K(null,
|
|
1361
|
-
}
|
|
1362
|
-
function
|
|
1363
|
-
return pe(
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
), ["post", "put", "patch"].indexOf(
|
|
1367
|
-
return pe(
|
|
1368
|
-
|
|
1369
|
-
|
|
1358
|
+
function pe(t) {
|
|
1359
|
+
if (t.cancelToken && t.cancelToken.throwIfRequested(), t.signal && t.signal.aborted)
|
|
1360
|
+
throw new K(null, t);
|
|
1361
|
+
}
|
|
1362
|
+
function Ve(t) {
|
|
1363
|
+
return pe(t), t.headers = O.from(t.headers), t.data = he.call(
|
|
1364
|
+
t,
|
|
1365
|
+
t.transformRequest
|
|
1366
|
+
), ["post", "put", "patch"].indexOf(t.method) !== -1 && t.headers.setContentType("application/x-www-form-urlencoded", !1), St.getAdapter(t.adapter || Y.adapter)(t).then(function(n) {
|
|
1367
|
+
return pe(t), n.data = he.call(
|
|
1368
|
+
t,
|
|
1369
|
+
t.transformResponse,
|
|
1370
1370
|
n
|
|
1371
1371
|
), n.headers = O.from(n.headers), n;
|
|
1372
1372
|
}, function(n) {
|
|
1373
|
-
return
|
|
1374
|
-
|
|
1375
|
-
|
|
1373
|
+
return yt(n) || (pe(t), n && n.response && (n.response.data = he.call(
|
|
1374
|
+
t,
|
|
1375
|
+
t.transformResponse,
|
|
1376
1376
|
n.response
|
|
1377
1377
|
), n.response.headers = O.from(n.response.headers))), Promise.reject(n);
|
|
1378
1378
|
});
|
|
1379
1379
|
}
|
|
1380
|
-
const
|
|
1381
|
-
["object", "boolean", "number", "function", "string", "symbol"].forEach((
|
|
1382
|
-
ue[
|
|
1383
|
-
return typeof n ===
|
|
1380
|
+
const _t = "1.11.0", ue = {};
|
|
1381
|
+
["object", "boolean", "number", "function", "string", "symbol"].forEach((t, e) => {
|
|
1382
|
+
ue[t] = function(n) {
|
|
1383
|
+
return typeof n === t || "a" + (e < 1 ? "n " : " ") + t;
|
|
1384
1384
|
};
|
|
1385
1385
|
});
|
|
1386
|
-
const
|
|
1387
|
-
ue.transitional = function(
|
|
1386
|
+
const ze = {};
|
|
1387
|
+
ue.transitional = function(e, r, n) {
|
|
1388
1388
|
function s(i, o) {
|
|
1389
|
-
return "[Axios v" +
|
|
1389
|
+
return "[Axios v" + _t + "] Transitional option '" + i + "'" + o + (n ? ". " + n : "");
|
|
1390
1390
|
}
|
|
1391
1391
|
return (i, o, c) => {
|
|
1392
|
-
if (
|
|
1392
|
+
if (e === !1)
|
|
1393
1393
|
throw new m(
|
|
1394
1394
|
s(o, " has been removed" + (r ? " in " + r : "")),
|
|
1395
1395
|
m.ERR_DEPRECATED
|
|
1396
1396
|
);
|
|
1397
|
-
return r && !
|
|
1397
|
+
return r && !ze[o] && (ze[o] = !0, console.warn(
|
|
1398
1398
|
s(
|
|
1399
1399
|
o,
|
|
1400
1400
|
" has been deprecated since v" + r + " and will be removed in the near future"
|
|
1401
1401
|
)
|
|
1402
|
-
)),
|
|
1402
|
+
)), e ? e(i, o, c) : !0;
|
|
1403
1403
|
};
|
|
1404
1404
|
};
|
|
1405
|
-
ue.spelling = function(
|
|
1406
|
-
return (r, n) => (console.warn(`${n} is likely a misspelling of ${
|
|
1405
|
+
ue.spelling = function(e) {
|
|
1406
|
+
return (r, n) => (console.warn(`${n} is likely a misspelling of ${e}`), !0);
|
|
1407
1407
|
};
|
|
1408
|
-
function
|
|
1409
|
-
if (typeof
|
|
1408
|
+
function sn(t, e, r) {
|
|
1409
|
+
if (typeof t != "object")
|
|
1410
1410
|
throw new m("options must be an object", m.ERR_BAD_OPTION_VALUE);
|
|
1411
|
-
const n = Object.keys(
|
|
1411
|
+
const n = Object.keys(t);
|
|
1412
1412
|
let s = n.length;
|
|
1413
1413
|
for (; s-- > 0; ) {
|
|
1414
|
-
const i = n[s], o =
|
|
1414
|
+
const i = n[s], o = e[i];
|
|
1415
1415
|
if (o) {
|
|
1416
|
-
const c =
|
|
1416
|
+
const c = t[i], f = c === void 0 || o(c, i, t);
|
|
1417
1417
|
if (f !== !0)
|
|
1418
1418
|
throw new m("option " + i + " must be " + f, m.ERR_BAD_OPTION_VALUE);
|
|
1419
1419
|
continue;
|
|
@@ -1423,14 +1423,14 @@ function rn(e, t, r) {
|
|
|
1423
1423
|
}
|
|
1424
1424
|
}
|
|
1425
1425
|
const te = {
|
|
1426
|
-
assertOptions:
|
|
1426
|
+
assertOptions: sn,
|
|
1427
1427
|
validators: ue
|
|
1428
|
-
},
|
|
1428
|
+
}, U = te.validators;
|
|
1429
1429
|
let q = class {
|
|
1430
|
-
constructor(
|
|
1431
|
-
this.defaults =
|
|
1432
|
-
request: new
|
|
1433
|
-
response: new
|
|
1430
|
+
constructor(e) {
|
|
1431
|
+
this.defaults = e || {}, this.interceptors = {
|
|
1432
|
+
request: new qe(),
|
|
1433
|
+
response: new qe()
|
|
1434
1434
|
};
|
|
1435
1435
|
}
|
|
1436
1436
|
/**
|
|
@@ -1441,9 +1441,9 @@ let q = class {
|
|
|
1441
1441
|
*
|
|
1442
1442
|
* @returns {Promise} The Promise to be fulfilled
|
|
1443
1443
|
*/
|
|
1444
|
-
async request(
|
|
1444
|
+
async request(e, r) {
|
|
1445
1445
|
try {
|
|
1446
|
-
return await this._request(
|
|
1446
|
+
return await this._request(e, r);
|
|
1447
1447
|
} catch (n) {
|
|
1448
1448
|
if (n instanceof Error) {
|
|
1449
1449
|
let s = {};
|
|
@@ -1458,21 +1458,21 @@ let q = class {
|
|
|
1458
1458
|
throw n;
|
|
1459
1459
|
}
|
|
1460
1460
|
}
|
|
1461
|
-
_request(
|
|
1462
|
-
typeof
|
|
1461
|
+
_request(e, r) {
|
|
1462
|
+
typeof e == "string" ? (r = r || {}, r.url = e) : r = e || {}, r = v(this.defaults, r);
|
|
1463
1463
|
const { transitional: n, paramsSerializer: s, headers: i } = r;
|
|
1464
1464
|
n !== void 0 && te.assertOptions(n, {
|
|
1465
|
-
silentJSONParsing:
|
|
1466
|
-
forcedJSONParsing:
|
|
1467
|
-
clarifyTimeoutError:
|
|
1465
|
+
silentJSONParsing: U.transitional(U.boolean),
|
|
1466
|
+
forcedJSONParsing: U.transitional(U.boolean),
|
|
1467
|
+
clarifyTimeoutError: U.transitional(U.boolean)
|
|
1468
1468
|
}, !1), s != null && (a.isFunction(s) ? r.paramsSerializer = {
|
|
1469
1469
|
serialize: s
|
|
1470
1470
|
} : te.assertOptions(s, {
|
|
1471
|
-
encode:
|
|
1472
|
-
serialize:
|
|
1471
|
+
encode: U.function,
|
|
1472
|
+
serialize: U.function
|
|
1473
1473
|
}, !0)), r.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? r.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : r.allowAbsoluteUrls = !0), te.assertOptions(r, {
|
|
1474
|
-
baseUrl:
|
|
1475
|
-
withXsrfToken:
|
|
1474
|
+
baseUrl: U.spelling("baseURL"),
|
|
1475
|
+
withXsrfToken: U.spelling("withXSRFToken")
|
|
1476
1476
|
}, !0), r.method = (r.method || this.defaults.method || "get").toLowerCase();
|
|
1477
1477
|
let o = i && a.merge(
|
|
1478
1478
|
i.common,
|
|
@@ -1495,7 +1495,7 @@ let q = class {
|
|
|
1495
1495
|
});
|
|
1496
1496
|
let u, d = 0, g;
|
|
1497
1497
|
if (!f) {
|
|
1498
|
-
const h = [
|
|
1498
|
+
const h = [Ve.bind(this), void 0];
|
|
1499
1499
|
for (h.unshift(...c), h.push(...l), g = h.length, u = Promise.resolve(r); d < g; )
|
|
1500
1500
|
u = u.then(h[d++], h[d++]);
|
|
1501
1501
|
return u;
|
|
@@ -1512,7 +1512,7 @@ let q = class {
|
|
|
1512
1512
|
}
|
|
1513
1513
|
}
|
|
1514
1514
|
try {
|
|
1515
|
-
u =
|
|
1515
|
+
u = Ve.call(this, w);
|
|
1516
1516
|
} catch (h) {
|
|
1517
1517
|
return Promise.reject(h);
|
|
1518
1518
|
}
|
|
@@ -1520,26 +1520,26 @@ let q = class {
|
|
|
1520
1520
|
u = u.then(l[d++], l[d++]);
|
|
1521
1521
|
return u;
|
|
1522
1522
|
}
|
|
1523
|
-
getUri(
|
|
1524
|
-
|
|
1525
|
-
const r =
|
|
1526
|
-
return
|
|
1523
|
+
getUri(e) {
|
|
1524
|
+
e = v(this.defaults, e);
|
|
1525
|
+
const r = wt(e.baseURL, e.url, e.allowAbsoluteUrls);
|
|
1526
|
+
return ht(r, e.params, e.paramsSerializer);
|
|
1527
1527
|
}
|
|
1528
1528
|
};
|
|
1529
|
-
a.forEach(["delete", "get", "head", "options"], function(
|
|
1530
|
-
q.prototype[
|
|
1529
|
+
a.forEach(["delete", "get", "head", "options"], function(e) {
|
|
1530
|
+
q.prototype[e] = function(r, n) {
|
|
1531
1531
|
return this.request(v(n || {}, {
|
|
1532
|
-
method:
|
|
1532
|
+
method: e,
|
|
1533
1533
|
url: r,
|
|
1534
1534
|
data: (n || {}).data
|
|
1535
1535
|
}));
|
|
1536
1536
|
};
|
|
1537
1537
|
});
|
|
1538
|
-
a.forEach(["post", "put", "patch"], function(
|
|
1538
|
+
a.forEach(["post", "put", "patch"], function(e) {
|
|
1539
1539
|
function r(n) {
|
|
1540
1540
|
return function(i, o, c) {
|
|
1541
1541
|
return this.request(v(c || {}, {
|
|
1542
|
-
method:
|
|
1542
|
+
method: e,
|
|
1543
1543
|
headers: n ? {
|
|
1544
1544
|
"Content-Type": "multipart/form-data"
|
|
1545
1545
|
} : {},
|
|
@@ -1548,11 +1548,11 @@ a.forEach(["post", "put", "patch"], function(t) {
|
|
|
1548
1548
|
}));
|
|
1549
1549
|
};
|
|
1550
1550
|
}
|
|
1551
|
-
q.prototype[
|
|
1551
|
+
q.prototype[e] = r(), q.prototype[e + "Form"] = r(!0);
|
|
1552
1552
|
});
|
|
1553
|
-
let
|
|
1554
|
-
constructor(
|
|
1555
|
-
if (typeof
|
|
1553
|
+
let on = class Rt {
|
|
1554
|
+
constructor(e) {
|
|
1555
|
+
if (typeof e != "function")
|
|
1556
1556
|
throw new TypeError("executor must be a function.");
|
|
1557
1557
|
let r;
|
|
1558
1558
|
this.promise = new Promise(function(i) {
|
|
@@ -1573,7 +1573,7 @@ let nn = class _t {
|
|
|
1573
1573
|
return o.cancel = function() {
|
|
1574
1574
|
n.unsubscribe(i);
|
|
1575
1575
|
}, o;
|
|
1576
|
-
},
|
|
1576
|
+
}, e(function(i, o, c) {
|
|
1577
1577
|
n.reason || (n.reason = new K(i, o, c), r(n.reason));
|
|
1578
1578
|
});
|
|
1579
1579
|
}
|
|
@@ -1587,51 +1587,51 @@ let nn = class _t {
|
|
|
1587
1587
|
/**
|
|
1588
1588
|
* Subscribe to the cancel signal
|
|
1589
1589
|
*/
|
|
1590
|
-
subscribe(
|
|
1590
|
+
subscribe(e) {
|
|
1591
1591
|
if (this.reason) {
|
|
1592
|
-
|
|
1592
|
+
e(this.reason);
|
|
1593
1593
|
return;
|
|
1594
1594
|
}
|
|
1595
|
-
this._listeners ? this._listeners.push(
|
|
1595
|
+
this._listeners ? this._listeners.push(e) : this._listeners = [e];
|
|
1596
1596
|
}
|
|
1597
1597
|
/**
|
|
1598
1598
|
* Unsubscribe from the cancel signal
|
|
1599
1599
|
*/
|
|
1600
|
-
unsubscribe(
|
|
1600
|
+
unsubscribe(e) {
|
|
1601
1601
|
if (!this._listeners)
|
|
1602
1602
|
return;
|
|
1603
|
-
const r = this._listeners.indexOf(
|
|
1603
|
+
const r = this._listeners.indexOf(e);
|
|
1604
1604
|
r !== -1 && this._listeners.splice(r, 1);
|
|
1605
1605
|
}
|
|
1606
1606
|
toAbortSignal() {
|
|
1607
|
-
const
|
|
1608
|
-
|
|
1607
|
+
const e = new AbortController(), r = (n) => {
|
|
1608
|
+
e.abort(n);
|
|
1609
1609
|
};
|
|
1610
|
-
return this.subscribe(r),
|
|
1610
|
+
return this.subscribe(r), e.signal.unsubscribe = () => this.unsubscribe(r), e.signal;
|
|
1611
1611
|
}
|
|
1612
1612
|
/**
|
|
1613
1613
|
* Returns an object that contains a new `CancelToken` and a function that, when called,
|
|
1614
1614
|
* cancels the `CancelToken`.
|
|
1615
1615
|
*/
|
|
1616
1616
|
static source() {
|
|
1617
|
-
let
|
|
1617
|
+
let e;
|
|
1618
1618
|
return {
|
|
1619
|
-
token: new
|
|
1620
|
-
|
|
1619
|
+
token: new Rt(function(s) {
|
|
1620
|
+
e = s;
|
|
1621
1621
|
}),
|
|
1622
|
-
cancel:
|
|
1622
|
+
cancel: e
|
|
1623
1623
|
};
|
|
1624
1624
|
}
|
|
1625
1625
|
};
|
|
1626
|
-
function
|
|
1626
|
+
function an(t) {
|
|
1627
1627
|
return function(r) {
|
|
1628
|
-
return
|
|
1628
|
+
return t.apply(null, r);
|
|
1629
1629
|
};
|
|
1630
1630
|
}
|
|
1631
|
-
function
|
|
1632
|
-
return a.isObject(
|
|
1631
|
+
function cn(t) {
|
|
1632
|
+
return a.isObject(t) && t.isAxiosError === !0;
|
|
1633
1633
|
}
|
|
1634
|
-
const
|
|
1634
|
+
const Ce = {
|
|
1635
1635
|
Continue: 100,
|
|
1636
1636
|
SwitchingProtocols: 101,
|
|
1637
1637
|
Processing: 102,
|
|
@@ -1696,92 +1696,92 @@ const Se = {
|
|
|
1696
1696
|
NotExtended: 510,
|
|
1697
1697
|
NetworkAuthenticationRequired: 511
|
|
1698
1698
|
};
|
|
1699
|
-
Object.entries(
|
|
1700
|
-
|
|
1699
|
+
Object.entries(Ce).forEach(([t, e]) => {
|
|
1700
|
+
Ce[e] = t;
|
|
1701
1701
|
});
|
|
1702
|
-
function
|
|
1703
|
-
const
|
|
1704
|
-
return a.extend(r, q.prototype,
|
|
1705
|
-
return
|
|
1702
|
+
function Tt(t) {
|
|
1703
|
+
const e = new q(t), r = tt(q.prototype.request, e);
|
|
1704
|
+
return a.extend(r, q.prototype, e, { allOwnKeys: !0 }), a.extend(r, e, null, { allOwnKeys: !0 }), r.create = function(s) {
|
|
1705
|
+
return Tt(v(t, s));
|
|
1706
1706
|
}, r;
|
|
1707
1707
|
}
|
|
1708
|
-
const
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
return Promise.all(
|
|
1708
|
+
const S = Tt(Y);
|
|
1709
|
+
S.Axios = q;
|
|
1710
|
+
S.CanceledError = K;
|
|
1711
|
+
S.CancelToken = on;
|
|
1712
|
+
S.isCancel = yt;
|
|
1713
|
+
S.VERSION = _t;
|
|
1714
|
+
S.toFormData = ae;
|
|
1715
|
+
S.AxiosError = m;
|
|
1716
|
+
S.Cancel = S.CanceledError;
|
|
1717
|
+
S.all = function(e) {
|
|
1718
|
+
return Promise.all(e);
|
|
1719
1719
|
};
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1720
|
+
S.spread = an;
|
|
1721
|
+
S.isAxiosError = cn;
|
|
1722
|
+
S.mergeConfig = v;
|
|
1723
|
+
S.AxiosHeaders = O;
|
|
1724
|
+
S.formToJSON = (t) => mt(a.isHTMLForm(t) ? new FormData(t) : t);
|
|
1725
|
+
S.getAdapter = St.getAdapter;
|
|
1726
|
+
S.HttpStatusCode = Ce;
|
|
1727
|
+
S.default = S;
|
|
1728
1728
|
const {
|
|
1729
|
-
Axios:
|
|
1729
|
+
Axios: bs,
|
|
1730
1730
|
AxiosError: me,
|
|
1731
|
-
CanceledError:
|
|
1732
|
-
isCancel:
|
|
1733
|
-
CancelToken:
|
|
1734
|
-
VERSION:
|
|
1735
|
-
all:
|
|
1736
|
-
Cancel:
|
|
1737
|
-
isAxiosError:
|
|
1738
|
-
spread:
|
|
1739
|
-
toFormData:
|
|
1740
|
-
AxiosHeaders:
|
|
1741
|
-
HttpStatusCode:
|
|
1742
|
-
formToJSON:
|
|
1743
|
-
getAdapter:
|
|
1744
|
-
mergeConfig:
|
|
1745
|
-
} =
|
|
1746
|
-
class
|
|
1731
|
+
CanceledError: Es,
|
|
1732
|
+
isCancel: Cs,
|
|
1733
|
+
CancelToken: Ss,
|
|
1734
|
+
VERSION: _s,
|
|
1735
|
+
all: Rs,
|
|
1736
|
+
Cancel: Ts,
|
|
1737
|
+
isAxiosError: As,
|
|
1738
|
+
spread: Ps,
|
|
1739
|
+
toFormData: Os,
|
|
1740
|
+
AxiosHeaders: xs,
|
|
1741
|
+
HttpStatusCode: Ns,
|
|
1742
|
+
formToJSON: Us,
|
|
1743
|
+
getAdapter: Ls,
|
|
1744
|
+
mergeConfig: Ds
|
|
1745
|
+
} = S;
|
|
1746
|
+
class Je extends Error {
|
|
1747
1747
|
constructor(r) {
|
|
1748
1748
|
super(r.join(", "));
|
|
1749
|
-
|
|
1749
|
+
b(this, "errors");
|
|
1750
1750
|
this.name = "ValidationError", this.errors = r;
|
|
1751
1751
|
}
|
|
1752
1752
|
}
|
|
1753
|
-
class
|
|
1753
|
+
class We extends Error {
|
|
1754
1754
|
constructor(r) {
|
|
1755
1755
|
super("Address already registered.");
|
|
1756
|
-
|
|
1756
|
+
b(this, "address");
|
|
1757
1757
|
this.name = "AddressInUseError", this.address = r;
|
|
1758
1758
|
}
|
|
1759
1759
|
}
|
|
1760
|
-
class
|
|
1760
|
+
class Qe extends Error {
|
|
1761
1761
|
constructor(r) {
|
|
1762
1762
|
super("Code already registered.");
|
|
1763
|
-
|
|
1763
|
+
b(this, "code");
|
|
1764
1764
|
this.name = "CodeInUseError", this.code = r;
|
|
1765
1765
|
}
|
|
1766
1766
|
}
|
|
1767
|
-
class
|
|
1767
|
+
class Xe extends Error {
|
|
1768
1768
|
constructor() {
|
|
1769
1769
|
super("Invalid signature provided"), this.name = "InvalidSignatureError";
|
|
1770
1770
|
}
|
|
1771
1771
|
}
|
|
1772
|
-
class
|
|
1773
|
-
constructor(
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
this.httpClient =
|
|
1772
|
+
class un {
|
|
1773
|
+
constructor(e) {
|
|
1774
|
+
b(this, "httpClient");
|
|
1775
|
+
b(this, "_debug");
|
|
1776
|
+
this.httpClient = e.httpClient, this._debug = e.debug;
|
|
1777
1777
|
}
|
|
1778
|
-
async create(
|
|
1778
|
+
async create(e, r, n, s, i, o, c) {
|
|
1779
1779
|
var f;
|
|
1780
1780
|
try {
|
|
1781
1781
|
await this.httpClient.post({
|
|
1782
1782
|
path: "/affiliates",
|
|
1783
1783
|
postData: {
|
|
1784
|
-
address:
|
|
1784
|
+
address: e,
|
|
1785
1785
|
identifier_type: r,
|
|
1786
1786
|
name: n,
|
|
1787
1787
|
code: n,
|
|
@@ -1796,21 +1796,21 @@ class an {
|
|
|
1796
1796
|
const u = (f = l.response) == null ? void 0 : f.data;
|
|
1797
1797
|
if (typeof (u == null ? void 0 : u.message) == "string") {
|
|
1798
1798
|
const d = u.message.toLowerCase();
|
|
1799
|
-
throw d == "invalid signature" ? new
|
|
1799
|
+
throw d == "invalid signature" ? new Xe() : d == "address in use" ? new We(e) : d == "code in use" ? new Qe(n) : new Error(d);
|
|
1800
1800
|
} else if ((u == null ? void 0 : u.message) instanceof Array)
|
|
1801
|
-
throw new
|
|
1801
|
+
throw new Je(u.message);
|
|
1802
1802
|
}
|
|
1803
1803
|
throw l;
|
|
1804
1804
|
}
|
|
1805
1805
|
}
|
|
1806
|
-
async update(
|
|
1806
|
+
async update(e, r, n, s, i, o, c) {
|
|
1807
1807
|
var f;
|
|
1808
1808
|
try {
|
|
1809
1809
|
await this.httpClient.post({
|
|
1810
|
-
path: `/affiliates/${
|
|
1810
|
+
path: `/affiliates/${e}`,
|
|
1811
1811
|
postData: {
|
|
1812
1812
|
code: n,
|
|
1813
|
-
user_identifier:
|
|
1813
|
+
user_identifier: e,
|
|
1814
1814
|
identifier_type: r,
|
|
1815
1815
|
signature: s,
|
|
1816
1816
|
signature_public_key: i,
|
|
@@ -1823,24 +1823,24 @@ class an {
|
|
|
1823
1823
|
const u = (f = l.response) == null ? void 0 : f.data;
|
|
1824
1824
|
if (typeof (u == null ? void 0 : u.message) == "string") {
|
|
1825
1825
|
const d = u.message.toLowerCase();
|
|
1826
|
-
throw d == "invalid signature" ? new
|
|
1826
|
+
throw d == "invalid signature" ? new Xe() : d == "address in use" ? new We(e) : d == "code in use" ? new Qe(n) : new Error(d);
|
|
1827
1827
|
} else if ((u == null ? void 0 : u.message) instanceof Array)
|
|
1828
|
-
throw new
|
|
1828
|
+
throw new Je(u.message);
|
|
1829
1829
|
}
|
|
1830
1830
|
throw l;
|
|
1831
1831
|
}
|
|
1832
1832
|
}
|
|
1833
|
-
async isCodeFree(
|
|
1833
|
+
async isCodeFree(e) {
|
|
1834
1834
|
try {
|
|
1835
|
-
return (await this.httpClient.get({ path: `/affiliates/codes/${
|
|
1835
|
+
return (await this.httpClient.get({ path: `/affiliates/codes/${e}` })).data.available;
|
|
1836
1836
|
} catch (r) {
|
|
1837
1837
|
throw console.error("Fuul SDK: Could not check affiliate code", r), r;
|
|
1838
1838
|
}
|
|
1839
1839
|
}
|
|
1840
|
-
async getCode(
|
|
1840
|
+
async getCode(e, r) {
|
|
1841
1841
|
var n;
|
|
1842
1842
|
try {
|
|
1843
|
-
return (await this.httpClient.get({ path: `/affiliates/${
|
|
1843
|
+
return (await this.httpClient.get({ path: `/affiliates/${e}`, queryParams: { identifier_type: r } })).data;
|
|
1844
1844
|
} catch (s) {
|
|
1845
1845
|
if (s instanceof me && ((n = s.response) == null ? void 0 : n.status) === 404)
|
|
1846
1846
|
return null;
|
|
@@ -1848,258 +1848,298 @@ class an {
|
|
|
1848
1848
|
}
|
|
1849
1849
|
}
|
|
1850
1850
|
}
|
|
1851
|
-
const
|
|
1852
|
-
class
|
|
1853
|
-
constructor(
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
this.httpClient =
|
|
1851
|
+
const ln = "/audiences";
|
|
1852
|
+
class fn {
|
|
1853
|
+
constructor(e) {
|
|
1854
|
+
b(this, "httpClient");
|
|
1855
|
+
b(this, "_debug");
|
|
1856
|
+
this.httpClient = e.httpClient, this._debug = e.debug;
|
|
1857
1857
|
}
|
|
1858
|
-
async getUserAudiences(
|
|
1858
|
+
async getUserAudiences(e) {
|
|
1859
1859
|
return (await this.httpClient.get({
|
|
1860
|
-
path: `${
|
|
1861
|
-
queryParams: { ...
|
|
1860
|
+
path: `${ln}/audience-segments/user`,
|
|
1861
|
+
queryParams: { ...e }
|
|
1862
1862
|
})).data;
|
|
1863
1863
|
}
|
|
1864
1864
|
}
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
this
|
|
1865
|
+
const Ye = "/claim-checks";
|
|
1866
|
+
class dn {
|
|
1867
|
+
constructor(e) {
|
|
1868
|
+
b(this, "httpClient");
|
|
1869
|
+
b(this, "_debug");
|
|
1870
|
+
this.httpClient = e.httpClient, this._debug = e.debug;
|
|
1869
1871
|
}
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1872
|
+
/**
|
|
1873
|
+
* Retrieves all claimable claim checks for a user
|
|
1874
|
+
* Returns only unclaimed checks with valid (non-expired) deadlines
|
|
1875
|
+
*
|
|
1876
|
+
* @param {GetClaimableChecksParams} params - User identifier parameters
|
|
1877
|
+
* @returns {Promise<GetClaimableChecksResponse>} Array of claimable claim checks
|
|
1878
|
+
*/
|
|
1879
|
+
async getClaimableChecks(e) {
|
|
1880
|
+
return (await this.httpClient.post({
|
|
1881
|
+
path: `${Ye}/claim`,
|
|
1882
|
+
postData: {
|
|
1883
|
+
userIdentifier: e.user_identifier,
|
|
1884
|
+
userIdentifierType: e.user_identifier_type
|
|
1885
|
+
}
|
|
1886
|
+
})).data;
|
|
1887
|
+
}
|
|
1888
|
+
/**
|
|
1889
|
+
* Gets aggregated totals of claimed and unclaimed claim checks for a user
|
|
1890
|
+
* Includes both expired and non-expired claims, grouped by currency
|
|
1891
|
+
*
|
|
1892
|
+
* @param {GetClaimCheckTotalsParams} params - User identifier parameters
|
|
1893
|
+
* @returns {Promise<GetClaimCheckTotalsResponse>} Totals grouped by status and currency
|
|
1894
|
+
*/
|
|
1895
|
+
async getClaimCheckTotals(e) {
|
|
1896
|
+
return (await this.httpClient.get({
|
|
1897
|
+
path: `${Ye}/totals`,
|
|
1898
|
+
queryParams: {
|
|
1899
|
+
user_identifier: e.user_identifier,
|
|
1900
|
+
user_identifier_type: e.user_identifier_type
|
|
1901
|
+
}
|
|
1902
|
+
})).data;
|
|
1873
1903
|
}
|
|
1874
1904
|
}
|
|
1875
|
-
const Xe = "fuul.sent", fn = 60, dn = "connect_wallet", Ye = 10;
|
|
1876
1905
|
class hn {
|
|
1877
|
-
constructor(
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1906
|
+
constructor(e) {
|
|
1907
|
+
b(this, "httpClient");
|
|
1908
|
+
this.httpClient = e.httpClient;
|
|
1909
|
+
}
|
|
1910
|
+
async getAll(e) {
|
|
1911
|
+
const { data: r } = await this.httpClient.get({ path: "conversions", queryParams: { ...e } });
|
|
1912
|
+
return r;
|
|
1913
|
+
}
|
|
1914
|
+
}
|
|
1915
|
+
const Ge = "fuul.sent", pn = 60, mn = "connect_wallet", Ze = 10;
|
|
1916
|
+
class yn {
|
|
1917
|
+
constructor(e) {
|
|
1918
|
+
b(this, "debug");
|
|
1919
|
+
b(this, "httpClient");
|
|
1920
|
+
this.httpClient = e.httpClient, this.debug = !!e.debug;
|
|
1881
1921
|
}
|
|
1882
|
-
async sendEvent(
|
|
1883
|
-
if (this.isDuplicate(
|
|
1922
|
+
async sendEvent(e, r) {
|
|
1923
|
+
if (this.isDuplicate(e)) {
|
|
1884
1924
|
this.debug && console.debug("Fuul SDK: Event is considered duplicate and will not be sent");
|
|
1885
1925
|
return;
|
|
1886
1926
|
}
|
|
1887
1927
|
if (!r || !Array.isArray(r) || r.length === 0)
|
|
1888
|
-
await this.httpClient.post({ path: "events", postData:
|
|
1928
|
+
await this.httpClient.post({ path: "events", postData: e });
|
|
1889
1929
|
else
|
|
1890
1930
|
for (const n of r) {
|
|
1891
|
-
const s = structuredClone({ ...
|
|
1931
|
+
const s = structuredClone({ ...e, project_id: n });
|
|
1892
1932
|
s.metadata.project_id = n, await this.httpClient.post({ path: "events", postData: s, queryParams: { project_id: n } });
|
|
1893
1933
|
}
|
|
1894
|
-
this.debug && console.debug(`Fuul SDK: Sent '${
|
|
1934
|
+
this.debug && console.debug(`Fuul SDK: Sent '${e.name}' event`), this.saveSentEvent(e);
|
|
1895
1935
|
}
|
|
1896
|
-
isDuplicate(
|
|
1936
|
+
isDuplicate(e) {
|
|
1897
1937
|
var u, d, g, w;
|
|
1898
|
-
const r = `${
|
|
1938
|
+
const r = `${Ge}_${e.name}`, n = localStorage.getItem(r);
|
|
1899
1939
|
if (!n)
|
|
1900
1940
|
return !1;
|
|
1901
1941
|
const s = JSON.parse(n);
|
|
1902
|
-
if (this.getCurrentTimestamp() - s.timestamp >
|
|
1942
|
+
if (this.getCurrentTimestamp() - s.timestamp > pn)
|
|
1903
1943
|
return !1;
|
|
1904
1944
|
let f = !1;
|
|
1905
|
-
|
|
1945
|
+
e.metadata && (f = s.metadata.tracking_id === e.metadata.tracking_id && s.metadata.project_id === e.metadata.project_id && s.metadata.referrer === e.metadata.referrer && s.metadata.source === e.metadata.source && s.metadata.category === e.metadata.category && s.metadata.title === e.metadata.title && s.metadata.tag === e.metadata.tag && s.user_address === e.user_address && ((u = s.user) == null ? void 0 : u.identifier) === ((d = e.user) == null ? void 0 : d.identifier) && ((g = s.user) == null ? void 0 : g.identifier_type) === ((w = e.user) == null ? void 0 : w.identifier_type) && s.signature === e.signature && s.signature_message === e.signature_message);
|
|
1906
1946
|
let l = !1;
|
|
1907
|
-
return
|
|
1947
|
+
return e.args && s.args && (l = s.args.page === e.args.page), l && f;
|
|
1908
1948
|
}
|
|
1909
1949
|
getCurrentTimestamp() {
|
|
1910
1950
|
return Date.now() / 1e3;
|
|
1911
1951
|
}
|
|
1912
|
-
saveSentEvent(
|
|
1952
|
+
saveSentEvent(e) {
|
|
1913
1953
|
var o, c, f, l;
|
|
1914
|
-
const r = `${
|
|
1915
|
-
if (localStorage.setItem(r, JSON.stringify(i)),
|
|
1954
|
+
const r = `${Ge}_${e.name}`, n = `${r}_all`, s = this.getCurrentTimestamp(), i = { ...e, timestamp: s };
|
|
1955
|
+
if (localStorage.setItem(r, JSON.stringify(i)), e.name === mn) {
|
|
1916
1956
|
const u = JSON.parse(localStorage.getItem(n) || "[]"), d = {
|
|
1917
|
-
name:
|
|
1957
|
+
name: e.name,
|
|
1918
1958
|
user: {
|
|
1919
|
-
identifier: (o =
|
|
1920
|
-
identifier_type: (c =
|
|
1959
|
+
identifier: (o = e.user) == null ? void 0 : o.identifier,
|
|
1960
|
+
identifier_type: (c = e.user) == null ? void 0 : c.identifier_type
|
|
1921
1961
|
},
|
|
1922
|
-
tracking_id: (f =
|
|
1923
|
-
page: (l =
|
|
1962
|
+
tracking_id: (f = e.metadata) == null ? void 0 : f.tracking_id,
|
|
1963
|
+
page: (l = e.args) == null ? void 0 : l.page
|
|
1924
1964
|
};
|
|
1925
|
-
"user_address" in
|
|
1965
|
+
"user_address" in e && (d.user_address = e.user_address);
|
|
1926
1966
|
const g = [...u, d];
|
|
1927
|
-
g.length >
|
|
1967
|
+
g.length > Ze && g.splice(0, g.length - Ze), localStorage.setItem(n, JSON.stringify(g));
|
|
1928
1968
|
}
|
|
1929
1969
|
}
|
|
1930
1970
|
}
|
|
1931
|
-
const
|
|
1932
|
-
version:
|
|
1971
|
+
const gn = "7.8.0", wn = {
|
|
1972
|
+
version: gn
|
|
1933
1973
|
};
|
|
1934
|
-
class
|
|
1935
|
-
constructor(
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
this.client =
|
|
1939
|
-
...
|
|
1974
|
+
class bn {
|
|
1975
|
+
constructor(e) {
|
|
1976
|
+
b(this, "client");
|
|
1977
|
+
b(this, "defaultQueryParams");
|
|
1978
|
+
this.client = S.create({
|
|
1979
|
+
...e,
|
|
1940
1980
|
headers: {
|
|
1941
|
-
Authorization: `Bearer ${
|
|
1942
|
-
"X-Fuul-Sdk-Version":
|
|
1981
|
+
Authorization: `Bearer ${e.apiKey}`,
|
|
1982
|
+
"X-Fuul-Sdk-Version": wn.version
|
|
1943
1983
|
}
|
|
1944
|
-
}), this.defaultQueryParams =
|
|
1984
|
+
}), this.defaultQueryParams = e.queryParams || {};
|
|
1945
1985
|
}
|
|
1946
|
-
makeQueryParams(
|
|
1947
|
-
return Object.assign({}, this.defaultQueryParams || {},
|
|
1986
|
+
makeQueryParams(e) {
|
|
1987
|
+
return Object.assign({}, this.defaultQueryParams || {}, e || {});
|
|
1948
1988
|
}
|
|
1949
|
-
async get(
|
|
1989
|
+
async get(e) {
|
|
1950
1990
|
return this.client.request({
|
|
1951
|
-
url:
|
|
1952
|
-
params: this.makeQueryParams(
|
|
1991
|
+
url: e.path,
|
|
1992
|
+
params: this.makeQueryParams(e.queryParams),
|
|
1953
1993
|
method: "GET"
|
|
1954
1994
|
});
|
|
1955
1995
|
}
|
|
1956
|
-
async post(
|
|
1996
|
+
async post(e) {
|
|
1957
1997
|
return this.client.request({
|
|
1958
|
-
url:
|
|
1959
|
-
params: this.makeQueryParams(
|
|
1960
|
-
data:
|
|
1998
|
+
url: e.path,
|
|
1999
|
+
params: this.makeQueryParams(e.queryParams),
|
|
2000
|
+
data: e.postData,
|
|
1961
2001
|
method: "POST"
|
|
1962
2002
|
});
|
|
1963
2003
|
}
|
|
1964
|
-
async put(
|
|
2004
|
+
async put(e) {
|
|
1965
2005
|
return this.client.request({
|
|
1966
|
-
url:
|
|
1967
|
-
params: this.makeQueryParams(
|
|
1968
|
-
data:
|
|
2006
|
+
url: e.path,
|
|
2007
|
+
params: this.makeQueryParams(e.queryParams),
|
|
2008
|
+
data: e.postData,
|
|
1969
2009
|
method: "PUT"
|
|
1970
2010
|
});
|
|
1971
2011
|
}
|
|
1972
|
-
async patch(
|
|
2012
|
+
async patch(e) {
|
|
1973
2013
|
return this.client.request({
|
|
1974
|
-
url:
|
|
1975
|
-
params: this.makeQueryParams(
|
|
1976
|
-
data:
|
|
2014
|
+
url: e.path,
|
|
2015
|
+
params: this.makeQueryParams(e.queryParams),
|
|
2016
|
+
data: e.postData,
|
|
1977
2017
|
method: "PATCH"
|
|
1978
2018
|
});
|
|
1979
2019
|
}
|
|
1980
|
-
async delete(
|
|
2020
|
+
async delete(e) {
|
|
1981
2021
|
return this.client.request({
|
|
1982
|
-
url:
|
|
1983
|
-
params: this.makeQueryParams(
|
|
2022
|
+
url: e.path,
|
|
2023
|
+
params: this.makeQueryParams(e.queryParams),
|
|
1984
2024
|
method: "DELETE"
|
|
1985
2025
|
});
|
|
1986
2026
|
}
|
|
1987
2027
|
}
|
|
1988
|
-
class
|
|
1989
|
-
constructor(
|
|
1990
|
-
|
|
1991
|
-
this.httpClient =
|
|
2028
|
+
class En {
|
|
2029
|
+
constructor(e) {
|
|
2030
|
+
b(this, "httpClient");
|
|
2031
|
+
this.httpClient = e.httpClient;
|
|
1992
2032
|
}
|
|
1993
|
-
async getPayoutsLeaderboard(
|
|
2033
|
+
async getPayoutsLeaderboard(e) {
|
|
1994
2034
|
return (await this.httpClient.get({
|
|
1995
2035
|
path: "/payouts/leaderboard/payouts",
|
|
1996
|
-
queryParams: { ...
|
|
2036
|
+
queryParams: { ...e }
|
|
1997
2037
|
})).data;
|
|
1998
2038
|
}
|
|
1999
|
-
async getPointsLeaderboard(
|
|
2039
|
+
async getPointsLeaderboard(e) {
|
|
2000
2040
|
return (await this.httpClient.get({
|
|
2001
2041
|
path: "/payouts/leaderboard/points",
|
|
2002
|
-
queryParams: { ...
|
|
2042
|
+
queryParams: { ...e }
|
|
2003
2043
|
})).data;
|
|
2004
2044
|
}
|
|
2005
|
-
async getReferredUsersLeaderboard(
|
|
2045
|
+
async getReferredUsersLeaderboard(e) {
|
|
2006
2046
|
return (await this.httpClient.get({
|
|
2007
2047
|
path: "/leaderboard/referred",
|
|
2008
|
-
queryParams: { ...
|
|
2048
|
+
queryParams: { ...e }
|
|
2009
2049
|
})).data;
|
|
2010
2050
|
}
|
|
2011
2051
|
}
|
|
2012
2052
|
const $ = "/payouts";
|
|
2013
|
-
class
|
|
2014
|
-
constructor(
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
this.httpClient =
|
|
2053
|
+
class Cn {
|
|
2054
|
+
constructor(e) {
|
|
2055
|
+
b(this, "httpClient");
|
|
2056
|
+
b(this, "_debug");
|
|
2057
|
+
this.httpClient = e.httpClient, this._debug = e.debug;
|
|
2018
2058
|
}
|
|
2019
|
-
async getUserPayoutsByConversion(
|
|
2059
|
+
async getUserPayoutsByConversion(e) {
|
|
2020
2060
|
return (await this.httpClient.get({
|
|
2021
2061
|
path: $,
|
|
2022
|
-
queryParams: { ...
|
|
2062
|
+
queryParams: { ...e, type: "onchain-currency" }
|
|
2023
2063
|
})).data;
|
|
2024
2064
|
}
|
|
2025
|
-
async getUserPointsByConversion(
|
|
2065
|
+
async getUserPointsByConversion(e) {
|
|
2026
2066
|
return (await this.httpClient.get({
|
|
2027
2067
|
path: $,
|
|
2028
|
-
queryParams: { ...
|
|
2068
|
+
queryParams: { ...e, type: "point" }
|
|
2029
2069
|
})).data;
|
|
2030
2070
|
}
|
|
2031
|
-
async getUserPayoutMovements(
|
|
2071
|
+
async getUserPayoutMovements(e) {
|
|
2032
2072
|
return (await this.httpClient.get({
|
|
2033
2073
|
path: `${$}/movements`,
|
|
2034
|
-
queryParams: { ...
|
|
2074
|
+
queryParams: { ...e, type: "onchain-currency" }
|
|
2035
2075
|
})).data;
|
|
2036
2076
|
}
|
|
2037
|
-
async getUserPointsMovements(
|
|
2077
|
+
async getUserPointsMovements(e) {
|
|
2038
2078
|
return (await this.httpClient.get({
|
|
2039
2079
|
path: `${$}/movements`,
|
|
2040
|
-
queryParams: { ...
|
|
2080
|
+
queryParams: { ...e, type: "point" }
|
|
2041
2081
|
})).data;
|
|
2042
2082
|
}
|
|
2043
|
-
async getVolumeLeaderboard(
|
|
2083
|
+
async getVolumeLeaderboard(e) {
|
|
2044
2084
|
return (await this.httpClient.get({
|
|
2045
2085
|
path: `${$}/leaderboard/volume`,
|
|
2046
|
-
queryParams: { ...
|
|
2086
|
+
queryParams: { ...e }
|
|
2047
2087
|
})).data;
|
|
2048
2088
|
}
|
|
2049
|
-
async getPayoutsByReferrer(
|
|
2089
|
+
async getPayoutsByReferrer(e) {
|
|
2050
2090
|
return (await this.httpClient.get({
|
|
2051
2091
|
path: `${$}/by-referrer`,
|
|
2052
2092
|
queryParams: {
|
|
2053
|
-
user_identifier:
|
|
2054
|
-
user_identifier_type:
|
|
2093
|
+
user_identifier: e.user_identifier,
|
|
2094
|
+
user_identifier_type: e.user_identifier_type
|
|
2055
2095
|
}
|
|
2056
2096
|
})).data;
|
|
2057
2097
|
}
|
|
2058
2098
|
}
|
|
2059
|
-
class
|
|
2060
|
-
constructor(
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
this.httpClient =
|
|
2099
|
+
class Sn {
|
|
2100
|
+
constructor(e) {
|
|
2101
|
+
b(this, "httpClient");
|
|
2102
|
+
b(this, "_debug");
|
|
2103
|
+
this.httpClient = e.httpClient, this._debug = e.debug;
|
|
2064
2104
|
}
|
|
2065
|
-
async listUserReferralCodes(
|
|
2105
|
+
async listUserReferralCodes(e) {
|
|
2066
2106
|
return (await this.httpClient.get({
|
|
2067
2107
|
path: "/referral_codes",
|
|
2068
2108
|
queryParams: {
|
|
2069
|
-
user_identifier:
|
|
2070
|
-
user_identifier_type:
|
|
2071
|
-
page:
|
|
2072
|
-
page_size:
|
|
2109
|
+
user_identifier: e.user_identifier,
|
|
2110
|
+
user_identifier_type: e.user_identifier_type,
|
|
2111
|
+
page: e.page,
|
|
2112
|
+
page_size: e.page_size
|
|
2073
2113
|
}
|
|
2074
2114
|
})).data;
|
|
2075
2115
|
}
|
|
2076
|
-
async generateReferralCodes(
|
|
2116
|
+
async generateReferralCodes(e) {
|
|
2077
2117
|
return (await this.httpClient.post({
|
|
2078
2118
|
path: "/referral_codes",
|
|
2079
2119
|
queryParams: {
|
|
2080
|
-
user_identifier:
|
|
2081
|
-
user_identifier_type:
|
|
2082
|
-
quantity:
|
|
2083
|
-
max_uses:
|
|
2120
|
+
user_identifier: e.user_identifier,
|
|
2121
|
+
user_identifier_type: e.user_identifier_type,
|
|
2122
|
+
quantity: e.quantity,
|
|
2123
|
+
max_uses: e.max_uses
|
|
2084
2124
|
}
|
|
2085
2125
|
})).data;
|
|
2086
2126
|
}
|
|
2087
|
-
async getReferralStatus(
|
|
2127
|
+
async getReferralStatus(e) {
|
|
2088
2128
|
return (await this.httpClient.get({
|
|
2089
2129
|
path: "/referral_codes/status",
|
|
2090
2130
|
queryParams: {
|
|
2091
|
-
user_identifier:
|
|
2092
|
-
user_identifier_type:
|
|
2131
|
+
user_identifier: e.user_identifier,
|
|
2132
|
+
user_identifier_type: e.user_identifier_type
|
|
2093
2133
|
}
|
|
2094
2134
|
})).data;
|
|
2095
2135
|
}
|
|
2096
|
-
async getReferralCode(
|
|
2136
|
+
async getReferralCode(e) {
|
|
2097
2137
|
return (await this.httpClient.get({
|
|
2098
|
-
path: `/referral_codes/${
|
|
2138
|
+
path: `/referral_codes/${e.code}`
|
|
2099
2139
|
})).data;
|
|
2100
2140
|
}
|
|
2101
|
-
async useReferralCode(
|
|
2102
|
-
const { code: r, user_identifier: n, user_identifier_type: s, signature: i, signature_message: o, chain_id: c } =
|
|
2141
|
+
async useReferralCode(e) {
|
|
2142
|
+
const { code: r, user_identifier: n, user_identifier_type: s, signature: i, signature_message: o, chain_id: c } = e;
|
|
2103
2143
|
await this.httpClient.patch({
|
|
2104
2144
|
path: `/referral_codes/${r}/use`,
|
|
2105
2145
|
queryParams: {
|
|
@@ -2113,255 +2153,263 @@ class bn {
|
|
|
2113
2153
|
}
|
|
2114
2154
|
});
|
|
2115
2155
|
}
|
|
2116
|
-
async updateReferralCode(
|
|
2156
|
+
async updateReferralCode(e) {
|
|
2117
2157
|
await this.httpClient.patch({
|
|
2118
|
-
path: `/referral_codes/${
|
|
2158
|
+
path: `/referral_codes/${e.code}`,
|
|
2119
2159
|
postData: {
|
|
2120
|
-
max_uses:
|
|
2160
|
+
max_uses: e.max_uses
|
|
2121
2161
|
}
|
|
2122
2162
|
});
|
|
2123
2163
|
}
|
|
2124
2164
|
}
|
|
2125
|
-
const
|
|
2126
|
-
let
|
|
2127
|
-
let
|
|
2128
|
-
for (;
|
|
2129
|
-
|
|
2130
|
-
return
|
|
2165
|
+
const _n = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
2166
|
+
let Rn = (t = 21) => {
|
|
2167
|
+
let e = "", r = crypto.getRandomValues(new Uint8Array(t |= 0));
|
|
2168
|
+
for (; t--; )
|
|
2169
|
+
e += _n[r[t] & 63];
|
|
2170
|
+
return e;
|
|
2131
2171
|
};
|
|
2132
|
-
const
|
|
2133
|
-
const r = localStorage.getItem(
|
|
2172
|
+
const Tn = "fuul.tracking_id", Ae = () => Un(Tn, () => Rn()), et = () => M("af") || M("referrer"), An = () => document.referrer, Pn = () => Ln(), On = () => M("category"), xn = () => M("title"), Nn = () => M("tag"), Un = (t, e) => {
|
|
2173
|
+
const r = localStorage.getItem(t);
|
|
2134
2174
|
if (r)
|
|
2135
2175
|
return r;
|
|
2136
2176
|
{
|
|
2137
|
-
const n =
|
|
2138
|
-
return n ? localStorage.setItem(
|
|
2177
|
+
const n = e();
|
|
2178
|
+
return n ? localStorage.setItem(t, n) : localStorage.removeItem(t), n;
|
|
2139
2179
|
}
|
|
2140
|
-
}, M = (
|
|
2141
|
-
const
|
|
2142
|
-
if (
|
|
2143
|
-
return
|
|
2144
|
-
},
|
|
2145
|
-
class
|
|
2146
|
-
constructor(
|
|
2147
|
-
|
|
2148
|
-
this.httpClient =
|
|
2180
|
+
}, M = (t) => new URLSearchParams(window.location.search).get(t), Ln = () => {
|
|
2181
|
+
const t = M("source");
|
|
2182
|
+
if (t)
|
|
2183
|
+
return t;
|
|
2184
|
+
}, Dn = "/user";
|
|
2185
|
+
class Fn {
|
|
2186
|
+
constructor(e) {
|
|
2187
|
+
b(this, "httpClient");
|
|
2188
|
+
this.httpClient = e.httpClient;
|
|
2149
2189
|
}
|
|
2150
|
-
async getUserReferrer(
|
|
2151
|
-
return (await this.httpClient.get({ path: `${
|
|
2190
|
+
async getUserReferrer(e) {
|
|
2191
|
+
return (await this.httpClient.get({ path: `${Dn}/referrer`, queryParams: { ...e } })).data;
|
|
2152
2192
|
}
|
|
2153
2193
|
}
|
|
2154
|
-
const
|
|
2155
|
-
let
|
|
2156
|
-
function
|
|
2157
|
-
|
|
2194
|
+
const kn = "https://api.fuul.xyz/api/v1/";
|
|
2195
|
+
let D = !1, Se = !1, Pe, x, At, Pt, V, Oe, le, I, Ot, fe, j, xe;
|
|
2196
|
+
function Bn(t) {
|
|
2197
|
+
D = !!t.debug, !Se && (Pe = t.apiKey, hs(), x = ps(t.baseApiUrl ?? kn, t.defaultQueryParams ?? {}), At = new hn({ httpClient: x, debug: D }), le = new yn({ httpClient: x, debug: D }), V = new un({ httpClient: x, debug: D }), Oe = new Ut({ httpClient: x }), I = new Cn({ httpClient: x, debug: D }), Pt = new Fn({ httpClient: x }), Ot = new fn({ httpClient: x, debug: D }), fe = new En({ httpClient: x }), j = new Sn({ httpClient: x, debug: D }), xe = new dn({ httpClient: x, debug: D }), Se = !0, D && console.debug("Fuul SDK: init() complete"));
|
|
2158
2198
|
}
|
|
2159
|
-
function
|
|
2160
|
-
if (!
|
|
2199
|
+
function E() {
|
|
2200
|
+
if (!Se)
|
|
2161
2201
|
throw new Error("Fuul SDK: You need to call init() to initialize the library before using any methods");
|
|
2162
2202
|
}
|
|
2163
|
-
async function
|
|
2164
|
-
|
|
2203
|
+
async function qn(t, e) {
|
|
2204
|
+
E(), Ne(), Ue();
|
|
2165
2205
|
const r = {
|
|
2166
|
-
name:
|
|
2167
|
-
args:
|
|
2206
|
+
name: t,
|
|
2207
|
+
args: e ?? {},
|
|
2168
2208
|
metadata: {
|
|
2169
|
-
tracking_id:
|
|
2209
|
+
tracking_id: Ae()
|
|
2170
2210
|
}
|
|
2171
2211
|
};
|
|
2172
2212
|
await le.sendEvent(r);
|
|
2173
2213
|
}
|
|
2174
|
-
async function
|
|
2175
|
-
|
|
2214
|
+
async function vn(t, e) {
|
|
2215
|
+
E(), Ne(), Ue();
|
|
2176
2216
|
const r = {
|
|
2177
2217
|
name: "pageview",
|
|
2178
2218
|
args: {
|
|
2179
|
-
page:
|
|
2219
|
+
page: t ?? document.location.pathname,
|
|
2180
2220
|
locationOrigin: document.location.origin
|
|
2181
2221
|
},
|
|
2182
2222
|
metadata: {
|
|
2183
|
-
tracking_id:
|
|
2184
|
-
referrer_url:
|
|
2185
|
-
source:
|
|
2186
|
-
affiliate_id:
|
|
2187
|
-
referrer:
|
|
2188
|
-
category:
|
|
2189
|
-
title:
|
|
2190
|
-
tag:
|
|
2223
|
+
tracking_id: Ae(),
|
|
2224
|
+
referrer_url: An(),
|
|
2225
|
+
source: Pn(),
|
|
2226
|
+
affiliate_id: et() ?? void 0,
|
|
2227
|
+
referrer: et() ?? void 0,
|
|
2228
|
+
category: On() ?? void 0,
|
|
2229
|
+
title: xn() ?? void 0,
|
|
2230
|
+
tag: Nn() ?? void 0
|
|
2191
2231
|
}
|
|
2192
2232
|
};
|
|
2193
|
-
await le.sendEvent(r,
|
|
2233
|
+
await le.sendEvent(r, e);
|
|
2194
2234
|
}
|
|
2195
|
-
async function
|
|
2196
|
-
|
|
2235
|
+
async function In(t, e) {
|
|
2236
|
+
E(), Ne(), Ue();
|
|
2197
2237
|
const r = {
|
|
2198
2238
|
name: "connect_wallet",
|
|
2199
2239
|
user: {
|
|
2200
|
-
identifier:
|
|
2201
|
-
identifier_type:
|
|
2240
|
+
identifier: t.identifier,
|
|
2241
|
+
identifier_type: t.identifierType
|
|
2202
2242
|
},
|
|
2203
2243
|
args: {
|
|
2204
2244
|
page: document.location.pathname,
|
|
2205
2245
|
locationOrigin: document.location.origin
|
|
2206
2246
|
},
|
|
2207
2247
|
metadata: {
|
|
2208
|
-
tracking_id:
|
|
2248
|
+
tracking_id: Ae()
|
|
2209
2249
|
}
|
|
2210
2250
|
};
|
|
2211
|
-
|
|
2212
|
-
}
|
|
2213
|
-
async function
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2251
|
+
t != null && t.signature && (r.signature = t == null ? void 0 : t.signature, r.signature_message = t == null ? void 0 : t.message), t != null && t.signaturePublicKey && (r.signature_public_key = t.signaturePublicKey), t != null && t.accountChainId && (r.account_chain_id = t.accountChainId), await le.sendEvent(r, e);
|
|
2252
|
+
}
|
|
2253
|
+
async function jn(t) {
|
|
2254
|
+
E(), await V.create(
|
|
2255
|
+
t.userIdentifier,
|
|
2256
|
+
t.identifierType,
|
|
2257
|
+
t.code,
|
|
2258
|
+
t.signature,
|
|
2259
|
+
t.signaturePublicKey,
|
|
2260
|
+
t.accountChainId,
|
|
2261
|
+
t.userRebateRate
|
|
2222
2262
|
);
|
|
2223
2263
|
}
|
|
2224
|
-
async function
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2264
|
+
async function $n(t) {
|
|
2265
|
+
E(), await V.update(
|
|
2266
|
+
t.userIdentifier,
|
|
2267
|
+
t.identifierType,
|
|
2268
|
+
t.code,
|
|
2269
|
+
t.signature,
|
|
2270
|
+
t.signaturePublicKey,
|
|
2271
|
+
t.accountChainId,
|
|
2272
|
+
t.userRebateRate
|
|
2233
2273
|
);
|
|
2234
2274
|
}
|
|
2235
|
-
async function
|
|
2236
|
-
return
|
|
2275
|
+
async function Mn(t, e) {
|
|
2276
|
+
return E(), await V.getCode(t, e);
|
|
2237
2277
|
}
|
|
2238
|
-
async function
|
|
2239
|
-
return
|
|
2278
|
+
async function Hn(t) {
|
|
2279
|
+
return E(), await V.isCodeFree(t);
|
|
2240
2280
|
}
|
|
2241
|
-
async function
|
|
2242
|
-
|
|
2243
|
-
const s = await V.getCode(
|
|
2244
|
-
af: (s == null ? void 0 : s.code) ??
|
|
2281
|
+
async function Kn(t, e, r, n) {
|
|
2282
|
+
E();
|
|
2283
|
+
const s = await V.getCode(e, r), i = new URLSearchParams({
|
|
2284
|
+
af: (s == null ? void 0 : s.code) ?? e
|
|
2245
2285
|
});
|
|
2246
|
-
return n != null && n.title && i.append("af_title", n.title), n != null && n.format && i.append("af_format", n.format), n != null && n.place && i.append("af_place", n.place), `${
|
|
2286
|
+
return n != null && n.title && i.append("af_title", n.title), n != null && n.format && i.append("af_format", n.format), n != null && n.place && i.append("af_place", n.place), `${t}?${i.toString()}`;
|
|
2287
|
+
}
|
|
2288
|
+
function Vn(t) {
|
|
2289
|
+
return fe.getPayoutsLeaderboard(t);
|
|
2247
2290
|
}
|
|
2248
|
-
function
|
|
2249
|
-
return fe.
|
|
2291
|
+
function zn(t) {
|
|
2292
|
+
return fe.getPointsLeaderboard(t);
|
|
2250
2293
|
}
|
|
2251
|
-
function
|
|
2252
|
-
return fe.
|
|
2294
|
+
function Jn(t) {
|
|
2295
|
+
return fe.getReferredUsersLeaderboard(t);
|
|
2253
2296
|
}
|
|
2254
|
-
function
|
|
2255
|
-
return
|
|
2297
|
+
function Wn(t) {
|
|
2298
|
+
return I.getVolumeLeaderboard(t);
|
|
2256
2299
|
}
|
|
2257
|
-
function
|
|
2258
|
-
return I.
|
|
2300
|
+
function Qn(t) {
|
|
2301
|
+
return I.getUserPayoutsByConversion(t);
|
|
2259
2302
|
}
|
|
2260
|
-
function
|
|
2261
|
-
return I.
|
|
2303
|
+
function Xn(t) {
|
|
2304
|
+
return I.getUserPointsByConversion(t);
|
|
2262
2305
|
}
|
|
2263
|
-
function
|
|
2264
|
-
return I.
|
|
2306
|
+
function Yn(t) {
|
|
2307
|
+
return I.getUserPayoutMovements(t);
|
|
2265
2308
|
}
|
|
2266
|
-
function
|
|
2267
|
-
return I.
|
|
2309
|
+
function Gn(t) {
|
|
2310
|
+
return I.getUserPointsMovements(t);
|
|
2268
2311
|
}
|
|
2269
|
-
function
|
|
2270
|
-
return I.
|
|
2312
|
+
function Zn(t) {
|
|
2313
|
+
return E(), I.getPayoutsByReferrer(t);
|
|
2271
2314
|
}
|
|
2272
|
-
function
|
|
2273
|
-
return
|
|
2315
|
+
async function es(t) {
|
|
2316
|
+
return E(), At.getAll(t);
|
|
2274
2317
|
}
|
|
2275
|
-
async function
|
|
2276
|
-
return
|
|
2318
|
+
async function ts(t) {
|
|
2319
|
+
return E(), Pt.getUserReferrer(t);
|
|
2277
2320
|
}
|
|
2278
|
-
async function
|
|
2279
|
-
return
|
|
2321
|
+
async function rs(t) {
|
|
2322
|
+
return E(), Ot.getUserAudiences(t);
|
|
2280
2323
|
}
|
|
2281
|
-
async function
|
|
2282
|
-
return
|
|
2324
|
+
async function ns(t) {
|
|
2325
|
+
return E(), j.listUserReferralCodes(t);
|
|
2283
2326
|
}
|
|
2284
|
-
async function
|
|
2285
|
-
return
|
|
2327
|
+
async function ss(t) {
|
|
2328
|
+
return E(), j.generateReferralCodes(t);
|
|
2286
2329
|
}
|
|
2287
|
-
async function
|
|
2288
|
-
return
|
|
2330
|
+
async function is(t) {
|
|
2331
|
+
return E(), j.getReferralStatus(t);
|
|
2289
2332
|
}
|
|
2290
|
-
async function
|
|
2291
|
-
return
|
|
2333
|
+
async function os(t) {
|
|
2334
|
+
return E(), j.getReferralCode(t);
|
|
2292
2335
|
}
|
|
2293
|
-
async function
|
|
2294
|
-
return
|
|
2336
|
+
async function as(t) {
|
|
2337
|
+
return E(), j.useReferralCode(t);
|
|
2295
2338
|
}
|
|
2296
|
-
async function
|
|
2297
|
-
return
|
|
2339
|
+
async function cs(t) {
|
|
2340
|
+
return E(), j.updateReferralCode(t);
|
|
2298
2341
|
}
|
|
2299
|
-
async function
|
|
2300
|
-
return
|
|
2342
|
+
async function us(t) {
|
|
2343
|
+
return E(), Oe.getAffiliateStats(t);
|
|
2301
2344
|
}
|
|
2302
|
-
async function
|
|
2303
|
-
return
|
|
2345
|
+
async function ls(t) {
|
|
2346
|
+
return E(), Oe.getAffiliateNewTraders(t);
|
|
2304
2347
|
}
|
|
2305
|
-
async function
|
|
2306
|
-
return
|
|
2348
|
+
async function fs(t) {
|
|
2349
|
+
return E(), xe.getClaimableChecks(t);
|
|
2307
2350
|
}
|
|
2308
|
-
function
|
|
2351
|
+
async function ds(t) {
|
|
2352
|
+
return E(), xe.getClaimCheckTotals(t);
|
|
2353
|
+
}
|
|
2354
|
+
function Ne() {
|
|
2309
2355
|
if (typeof window > "u" || typeof document > "u")
|
|
2310
2356
|
throw new Error("Fuul SDK: Browser context required");
|
|
2311
2357
|
}
|
|
2312
|
-
function
|
|
2358
|
+
function Ue() {
|
|
2313
2359
|
if (navigator.webdriver)
|
|
2314
2360
|
throw new Error("Fuul SDK: Error");
|
|
2315
2361
|
}
|
|
2316
|
-
function
|
|
2362
|
+
function hs() {
|
|
2317
2363
|
if (!Pe)
|
|
2318
2364
|
throw new Error("Fuul SDK: Invalid API key");
|
|
2319
2365
|
}
|
|
2320
|
-
function
|
|
2321
|
-
return new
|
|
2322
|
-
baseURL:
|
|
2366
|
+
function ps(t, e) {
|
|
2367
|
+
return new bn({
|
|
2368
|
+
baseURL: t,
|
|
2323
2369
|
timeout: 3e4,
|
|
2324
2370
|
apiKey: Pe,
|
|
2325
|
-
queryParams:
|
|
2371
|
+
queryParams: e
|
|
2326
2372
|
});
|
|
2327
2373
|
}
|
|
2328
|
-
const
|
|
2329
|
-
init:
|
|
2330
|
-
sendEvent:
|
|
2331
|
-
sendPageview:
|
|
2332
|
-
identifyUser:
|
|
2333
|
-
generateTrackingLink:
|
|
2334
|
-
getConversions:
|
|
2335
|
-
createAffiliateCode:
|
|
2336
|
-
updateAffiliateCode:
|
|
2337
|
-
getAffiliateCode:
|
|
2338
|
-
isAffiliateCodeFree:
|
|
2339
|
-
getPayoutsLeaderboard:
|
|
2340
|
-
getPointsLeaderboard:
|
|
2341
|
-
getReferredUsersLeaderboard:
|
|
2342
|
-
getUserAudiences:
|
|
2343
|
-
getUserPayoutsByConversion:
|
|
2344
|
-
getUserPointsByConversion:
|
|
2345
|
-
getUserPointsMovements:
|
|
2346
|
-
getUserPayoutMovements:
|
|
2347
|
-
getPayoutsByReferrer:
|
|
2348
|
-
getUserReferrer:
|
|
2349
|
-
getVolumeLeaderboard:
|
|
2350
|
-
listUserReferralCodes:
|
|
2351
|
-
generateReferralCodes:
|
|
2352
|
-
getReferralStatus:
|
|
2353
|
-
getReferralCode:
|
|
2354
|
-
useReferralCode:
|
|
2355
|
-
updateReferralCode:
|
|
2356
|
-
getAffiliateStats:
|
|
2357
|
-
getAffiliateNewTraders:
|
|
2374
|
+
const Fs = {
|
|
2375
|
+
init: Bn,
|
|
2376
|
+
sendEvent: qn,
|
|
2377
|
+
sendPageview: vn,
|
|
2378
|
+
identifyUser: In,
|
|
2379
|
+
generateTrackingLink: Kn,
|
|
2380
|
+
getConversions: es,
|
|
2381
|
+
createAffiliateCode: jn,
|
|
2382
|
+
updateAffiliateCode: $n,
|
|
2383
|
+
getAffiliateCode: Mn,
|
|
2384
|
+
isAffiliateCodeFree: Hn,
|
|
2385
|
+
getPayoutsLeaderboard: Vn,
|
|
2386
|
+
getPointsLeaderboard: zn,
|
|
2387
|
+
getReferredUsersLeaderboard: Jn,
|
|
2388
|
+
getUserAudiences: rs,
|
|
2389
|
+
getUserPayoutsByConversion: Qn,
|
|
2390
|
+
getUserPointsByConversion: Xn,
|
|
2391
|
+
getUserPointsMovements: Gn,
|
|
2392
|
+
getUserPayoutMovements: Yn,
|
|
2393
|
+
getPayoutsByReferrer: Zn,
|
|
2394
|
+
getUserReferrer: ts,
|
|
2395
|
+
getVolumeLeaderboard: Wn,
|
|
2396
|
+
listUserReferralCodes: ns,
|
|
2397
|
+
generateReferralCodes: ss,
|
|
2398
|
+
getReferralStatus: is,
|
|
2399
|
+
getReferralCode: os,
|
|
2400
|
+
useReferralCode: as,
|
|
2401
|
+
updateReferralCode: cs,
|
|
2402
|
+
getAffiliateStats: us,
|
|
2403
|
+
getAffiliateNewTraders: ls,
|
|
2404
|
+
getClaimableChecks: fs,
|
|
2405
|
+
getClaimCheckTotals: ds
|
|
2358
2406
|
};
|
|
2359
|
-
var
|
|
2407
|
+
var ms = /* @__PURE__ */ ((t) => (t.EvmAddress = "evm_address", t.SolanaAddress = "solana_address", t.XRPLAddress = "xrpl_address", t.SuiAddress = "sui_address", t.Email = "email", t))(ms || {});
|
|
2360
2408
|
export {
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2409
|
+
We as AddressInUseError,
|
|
2410
|
+
Qe as CodeInUseError,
|
|
2411
|
+
Fs as Fuul,
|
|
2412
|
+
Xe as InvalidSignatureError,
|
|
2413
|
+
ms as UserIdentifierType,
|
|
2414
|
+
Je as ValidationError
|
|
2367
2415
|
};
|