@fuul/sdk 3.2.2 → 3.3.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 +1 -1
- package/dist/HttpClient.d.ts.map +1 -1
- package/dist/affiliates/AffiliateService.d.ts +15 -0
- package/dist/affiliates/AffiliateService.d.ts.map +1 -0
- package/dist/affiliates/errors.d.ts +16 -0
- package/dist/affiliates/errors.d.ts.map +1 -0
- package/dist/core.d.ts +42 -8
- 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 +614 -577
- package/dist/index.umd.js +3 -3
- package/package.json +2 -2
- package/dist/AffiliateService.d.ts +0 -28
- package/dist/AffiliateService.d.ts.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var S = (e, t, n) => (
|
|
4
|
-
function
|
|
1
|
+
var Ze = Object.defineProperty;
|
|
2
|
+
var et = (e, t, n) => t in e ? Ze(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var S = (e, t, n) => (et(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
4
|
+
function Pe(e, t) {
|
|
5
5
|
return function() {
|
|
6
6
|
return e.apply(t, arguments);
|
|
7
7
|
};
|
|
8
8
|
}
|
|
9
|
-
const { toString:
|
|
10
|
-
const n =
|
|
9
|
+
const { toString: Ne } = Object.prototype, { getPrototypeOf: se } = Object, oe = ((e) => (t) => {
|
|
10
|
+
const n = Ne.call(t);
|
|
11
11
|
return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
|
|
12
|
-
})(/* @__PURE__ */ Object.create(null)), O = (e) => (e = e.toLowerCase(), (t) =>
|
|
13
|
-
function
|
|
14
|
-
return e !== null && !
|
|
12
|
+
})(/* @__PURE__ */ Object.create(null)), O = (e) => (e = e.toLowerCase(), (t) => oe(t) === e), K = (e) => (t) => typeof t === e, { isArray: x } = Array, L = K("undefined");
|
|
13
|
+
function tt(e) {
|
|
14
|
+
return e !== null && !L(e) && e.constructor !== null && !L(e.constructor) && P(e.constructor.isBuffer) && e.constructor.isBuffer(e);
|
|
15
15
|
}
|
|
16
|
-
const
|
|
17
|
-
function
|
|
16
|
+
const _e = O("ArrayBuffer");
|
|
17
|
+
function nt(e) {
|
|
18
18
|
let t;
|
|
19
|
-
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer &&
|
|
19
|
+
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && _e(e.buffer), t;
|
|
20
20
|
}
|
|
21
|
-
const
|
|
22
|
-
if (
|
|
21
|
+
const rt = K("string"), P = K("function"), xe = K("number"), ie = (e) => e !== null && typeof e == "object", st = (e) => e === !0 || e === !1, q = (e) => {
|
|
22
|
+
if (oe(e) !== "object")
|
|
23
23
|
return !1;
|
|
24
|
-
const t =
|
|
24
|
+
const t = se(e);
|
|
25
25
|
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Symbol.toStringTag in e) && !(Symbol.iterator in e);
|
|
26
|
-
},
|
|
26
|
+
}, ot = O("Date"), it = O("File"), at = O("Blob"), ct = O("FileList"), ut = (e) => ie(e) && P(e.pipe), lt = (e) => {
|
|
27
27
|
const t = "[object FormData]";
|
|
28
|
-
return e && (typeof FormData == "function" && e instanceof FormData ||
|
|
29
|
-
},
|
|
30
|
-
function
|
|
28
|
+
return e && (typeof FormData == "function" && e instanceof FormData || Ne.call(e) === t || P(e.toString) && e.toString() === t);
|
|
29
|
+
}, ft = O("URLSearchParams"), dt = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
30
|
+
function B(e, t, { allOwnKeys: n = !1 } = {}) {
|
|
31
31
|
if (e === null || typeof e > "u")
|
|
32
32
|
return;
|
|
33
33
|
let r, s;
|
|
@@ -35,13 +35,13 @@ function L(e, t, { allOwnKeys: n = !1 } = {}) {
|
|
|
35
35
|
for (r = 0, s = e.length; r < s; r++)
|
|
36
36
|
t.call(null, e[r], r, e);
|
|
37
37
|
else {
|
|
38
|
-
const
|
|
38
|
+
const i = n ? Object.getOwnPropertyNames(e) : Object.keys(e), o = i.length;
|
|
39
39
|
let c;
|
|
40
|
-
for (r = 0; r <
|
|
41
|
-
c =
|
|
40
|
+
for (r = 0; r < o; r++)
|
|
41
|
+
c = i[r], t.call(null, e[c], c, e);
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function Fe(e, t) {
|
|
45
45
|
t = t.toLowerCase();
|
|
46
46
|
const n = Object.keys(e);
|
|
47
47
|
let r = n.length, s;
|
|
@@ -50,74 +50,74 @@ function Ce(e, t) {
|
|
|
50
50
|
return s;
|
|
51
51
|
return null;
|
|
52
52
|
}
|
|
53
|
-
const
|
|
54
|
-
function
|
|
55
|
-
const { caseless: e } =
|
|
56
|
-
const
|
|
57
|
-
|
|
53
|
+
const De = (() => typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global)(), Ue = (e) => !L(e) && e !== De;
|
|
54
|
+
function Z() {
|
|
55
|
+
const { caseless: e } = Ue(this) && this || {}, t = {}, n = (r, s) => {
|
|
56
|
+
const i = e && Fe(t, s) || s;
|
|
57
|
+
q(t[i]) && q(r) ? t[i] = Z(t[i], r) : q(r) ? t[i] = Z({}, r) : x(r) ? t[i] = r.slice() : t[i] = r;
|
|
58
58
|
};
|
|
59
59
|
for (let r = 0, s = arguments.length; r < s; r++)
|
|
60
|
-
arguments[r] &&
|
|
60
|
+
arguments[r] && B(arguments[r], n);
|
|
61
61
|
return t;
|
|
62
62
|
}
|
|
63
|
-
const
|
|
64
|
-
n && P(s) ? e[
|
|
65
|
-
}, { allOwnKeys: r }), e),
|
|
63
|
+
const ht = (e, t, n, { allOwnKeys: r } = {}) => (B(t, (s, i) => {
|
|
64
|
+
n && P(s) ? e[i] = Pe(s, n) : e[i] = s;
|
|
65
|
+
}, { allOwnKeys: r }), e), pt = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), mt = (e, t, n, r) => {
|
|
66
66
|
e.prototype = Object.create(t.prototype, r), e.prototype.constructor = e, Object.defineProperty(e, "super", {
|
|
67
67
|
value: t.prototype
|
|
68
68
|
}), n && Object.assign(e.prototype, n);
|
|
69
|
-
},
|
|
70
|
-
let s,
|
|
69
|
+
}, yt = (e, t, n, r) => {
|
|
70
|
+
let s, i, o;
|
|
71
71
|
const c = {};
|
|
72
72
|
if (t = t || {}, e == null)
|
|
73
73
|
return t;
|
|
74
74
|
do {
|
|
75
|
-
for (s = Object.getOwnPropertyNames(e),
|
|
76
|
-
|
|
77
|
-
e = n !== !1 &&
|
|
75
|
+
for (s = Object.getOwnPropertyNames(e), i = s.length; i-- > 0; )
|
|
76
|
+
o = s[i], (!r || r(o, e, t)) && !c[o] && (t[o] = e[o], c[o] = !0);
|
|
77
|
+
e = n !== !1 && se(e);
|
|
78
78
|
} while (e && (!n || n(e, t)) && e !== Object.prototype);
|
|
79
79
|
return t;
|
|
80
|
-
},
|
|
80
|
+
}, wt = (e, t, n) => {
|
|
81
81
|
e = String(e), (n === void 0 || n > e.length) && (n = e.length), n -= t.length;
|
|
82
82
|
const r = e.indexOf(t, n);
|
|
83
83
|
return r !== -1 && r === n;
|
|
84
|
-
},
|
|
84
|
+
}, Et = (e) => {
|
|
85
85
|
if (!e)
|
|
86
86
|
return null;
|
|
87
87
|
if (x(e))
|
|
88
88
|
return e;
|
|
89
89
|
let t = e.length;
|
|
90
|
-
if (!
|
|
90
|
+
if (!xe(t))
|
|
91
91
|
return null;
|
|
92
92
|
const n = new Array(t);
|
|
93
93
|
for (; t-- > 0; )
|
|
94
94
|
n[t] = e[t];
|
|
95
95
|
return n;
|
|
96
|
-
},
|
|
96
|
+
}, gt = ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && se(Uint8Array)), St = (e, t) => {
|
|
97
97
|
const r = (e && e[Symbol.iterator]).call(e);
|
|
98
98
|
let s;
|
|
99
99
|
for (; (s = r.next()) && !s.done; ) {
|
|
100
|
-
const
|
|
101
|
-
t.call(e,
|
|
100
|
+
const i = s.value;
|
|
101
|
+
t.call(e, i[0], i[1]);
|
|
102
102
|
}
|
|
103
|
-
},
|
|
103
|
+
}, bt = (e, t) => {
|
|
104
104
|
let n;
|
|
105
105
|
const r = [];
|
|
106
106
|
for (; (n = e.exec(t)) !== null; )
|
|
107
107
|
r.push(n);
|
|
108
108
|
return r;
|
|
109
|
-
},
|
|
109
|
+
}, At = O("HTMLFormElement"), Rt = (e) => e.toLowerCase().replace(
|
|
110
110
|
/[-_\s]([a-z\d])(\w*)/g,
|
|
111
111
|
function(n, r, s) {
|
|
112
112
|
return r.toUpperCase() + s;
|
|
113
113
|
}
|
|
114
|
-
),
|
|
114
|
+
), de = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), Ot = O("RegExp"), Le = (e, t) => {
|
|
115
115
|
const n = Object.getOwnPropertyDescriptors(e), r = {};
|
|
116
|
-
|
|
117
|
-
t(s,
|
|
116
|
+
B(n, (s, i) => {
|
|
117
|
+
t(s, i, e) !== !1 && (r[i] = s);
|
|
118
118
|
}), Object.defineProperties(e, r);
|
|
119
|
-
},
|
|
120
|
-
|
|
119
|
+
}, Ct = (e) => {
|
|
120
|
+
Le(e, (t, n) => {
|
|
121
121
|
if (P(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
|
|
122
122
|
return !1;
|
|
123
123
|
const r = e[n];
|
|
@@ -131,40 +131,40 @@ const ct = (e, t, n, { allOwnKeys: r } = {}) => (L(t, (s, o) => {
|
|
|
131
131
|
});
|
|
132
132
|
}
|
|
133
133
|
});
|
|
134
|
-
},
|
|
134
|
+
}, Tt = (e, t) => {
|
|
135
135
|
const n = {}, r = (s) => {
|
|
136
|
-
s.forEach((
|
|
137
|
-
n[
|
|
136
|
+
s.forEach((i) => {
|
|
137
|
+
n[i] = !0;
|
|
138
138
|
});
|
|
139
139
|
};
|
|
140
140
|
return x(e) ? r(e) : r(String(e).split(t)), n;
|
|
141
|
-
},
|
|
142
|
-
},
|
|
143
|
-
DIGIT:
|
|
141
|
+
}, Pt = () => {
|
|
142
|
+
}, Nt = (e, t) => (e = +e, Number.isFinite(e) ? e : t), W = "abcdefghijklmnopqrstuvwxyz", he = "0123456789", Be = {
|
|
143
|
+
DIGIT: he,
|
|
144
144
|
ALPHA: W,
|
|
145
|
-
ALPHA_DIGIT: W + W.toUpperCase() +
|
|
146
|
-
},
|
|
145
|
+
ALPHA_DIGIT: W + W.toUpperCase() + he
|
|
146
|
+
}, _t = (e = 16, t = Be.ALPHA_DIGIT) => {
|
|
147
147
|
let n = "";
|
|
148
148
|
const { length: r } = t;
|
|
149
149
|
for (; e--; )
|
|
150
150
|
n += t[Math.random() * r | 0];
|
|
151
151
|
return n;
|
|
152
152
|
};
|
|
153
|
-
function
|
|
153
|
+
function xt(e) {
|
|
154
154
|
return !!(e && P(e.append) && e[Symbol.toStringTag] === "FormData" && e[Symbol.iterator]);
|
|
155
155
|
}
|
|
156
|
-
const
|
|
156
|
+
const Ft = (e) => {
|
|
157
157
|
const t = new Array(10), n = (r, s) => {
|
|
158
|
-
if (
|
|
158
|
+
if (ie(r)) {
|
|
159
159
|
if (t.indexOf(r) >= 0)
|
|
160
160
|
return;
|
|
161
161
|
if (!("toJSON" in r)) {
|
|
162
162
|
t[s] = r;
|
|
163
|
-
const
|
|
164
|
-
return
|
|
165
|
-
const
|
|
166
|
-
!
|
|
167
|
-
}), t[s] = void 0,
|
|
163
|
+
const i = x(r) ? [] : {};
|
|
164
|
+
return B(r, (o, c) => {
|
|
165
|
+
const d = n(o, s + 1);
|
|
166
|
+
!L(d) && (i[c] = d);
|
|
167
|
+
}), t[s] = void 0, i;
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
return r;
|
|
@@ -172,55 +172,55 @@ const Ct = (e) => {
|
|
|
172
172
|
return n(e, 0);
|
|
173
173
|
}, a = {
|
|
174
174
|
isArray: x,
|
|
175
|
-
isArrayBuffer:
|
|
176
|
-
isBuffer:
|
|
177
|
-
isFormData:
|
|
178
|
-
isArrayBufferView:
|
|
179
|
-
isString:
|
|
180
|
-
isNumber:
|
|
181
|
-
isBoolean:
|
|
182
|
-
isObject:
|
|
183
|
-
isPlainObject:
|
|
184
|
-
isUndefined:
|
|
185
|
-
isDate:
|
|
186
|
-
isFile:
|
|
187
|
-
isBlob:
|
|
188
|
-
isRegExp:
|
|
175
|
+
isArrayBuffer: _e,
|
|
176
|
+
isBuffer: tt,
|
|
177
|
+
isFormData: lt,
|
|
178
|
+
isArrayBufferView: nt,
|
|
179
|
+
isString: rt,
|
|
180
|
+
isNumber: xe,
|
|
181
|
+
isBoolean: st,
|
|
182
|
+
isObject: ie,
|
|
183
|
+
isPlainObject: q,
|
|
184
|
+
isUndefined: L,
|
|
185
|
+
isDate: ot,
|
|
186
|
+
isFile: it,
|
|
187
|
+
isBlob: at,
|
|
188
|
+
isRegExp: Ot,
|
|
189
189
|
isFunction: P,
|
|
190
|
-
isStream:
|
|
191
|
-
isURLSearchParams:
|
|
192
|
-
isTypedArray:
|
|
193
|
-
isFileList:
|
|
194
|
-
forEach:
|
|
195
|
-
merge:
|
|
196
|
-
extend:
|
|
197
|
-
trim:
|
|
198
|
-
stripBOM:
|
|
199
|
-
inherits:
|
|
200
|
-
toFlatObject:
|
|
201
|
-
kindOf:
|
|
190
|
+
isStream: ut,
|
|
191
|
+
isURLSearchParams: ft,
|
|
192
|
+
isTypedArray: gt,
|
|
193
|
+
isFileList: ct,
|
|
194
|
+
forEach: B,
|
|
195
|
+
merge: Z,
|
|
196
|
+
extend: ht,
|
|
197
|
+
trim: dt,
|
|
198
|
+
stripBOM: pt,
|
|
199
|
+
inherits: mt,
|
|
200
|
+
toFlatObject: yt,
|
|
201
|
+
kindOf: oe,
|
|
202
202
|
kindOfTest: O,
|
|
203
|
-
endsWith:
|
|
204
|
-
toArray:
|
|
205
|
-
forEachEntry:
|
|
206
|
-
matchAll:
|
|
207
|
-
isHTMLForm:
|
|
208
|
-
hasOwnProperty:
|
|
209
|
-
hasOwnProp:
|
|
203
|
+
endsWith: wt,
|
|
204
|
+
toArray: Et,
|
|
205
|
+
forEachEntry: St,
|
|
206
|
+
matchAll: bt,
|
|
207
|
+
isHTMLForm: At,
|
|
208
|
+
hasOwnProperty: de,
|
|
209
|
+
hasOwnProp: de,
|
|
210
210
|
// an alias to avoid ESLint no-prototype-builtins detection
|
|
211
|
-
reduceDescriptors:
|
|
212
|
-
freezeMethods:
|
|
213
|
-
toObjectSet:
|
|
214
|
-
toCamelCase:
|
|
215
|
-
noop:
|
|
216
|
-
toFiniteNumber:
|
|
217
|
-
findKey:
|
|
218
|
-
global:
|
|
219
|
-
isContextDefined:
|
|
220
|
-
ALPHABET:
|
|
221
|
-
generateString:
|
|
222
|
-
isSpecCompliantForm:
|
|
223
|
-
toJSONObject:
|
|
211
|
+
reduceDescriptors: Le,
|
|
212
|
+
freezeMethods: Ct,
|
|
213
|
+
toObjectSet: Tt,
|
|
214
|
+
toCamelCase: Rt,
|
|
215
|
+
noop: Pt,
|
|
216
|
+
toFiniteNumber: Nt,
|
|
217
|
+
findKey: Fe,
|
|
218
|
+
global: De,
|
|
219
|
+
isContextDefined: Ue,
|
|
220
|
+
ALPHABET: Be,
|
|
221
|
+
generateString: _t,
|
|
222
|
+
isSpecCompliantForm: xt,
|
|
223
|
+
toJSONObject: Ft
|
|
224
224
|
};
|
|
225
225
|
function m(e, t, n, r, s) {
|
|
226
226
|
Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = e, this.name = "AxiosError", t && (this.code = t), n && (this.config = n), r && (this.request = r), s && (this.response = s);
|
|
@@ -246,7 +246,7 @@ a.inherits(m, Error, {
|
|
|
246
246
|
};
|
|
247
247
|
}
|
|
248
248
|
});
|
|
249
|
-
const
|
|
249
|
+
const Ie = m.prototype, ke = {};
|
|
250
250
|
[
|
|
251
251
|
"ERR_BAD_OPTION_VALUE",
|
|
252
252
|
"ERR_BAD_OPTION",
|
|
@@ -262,97 +262,97 @@ const De = m.prototype, Fe = {};
|
|
|
262
262
|
"ERR_INVALID_URL"
|
|
263
263
|
// eslint-disable-next-line func-names
|
|
264
264
|
].forEach((e) => {
|
|
265
|
-
|
|
265
|
+
ke[e] = { value: e };
|
|
266
266
|
});
|
|
267
|
-
Object.defineProperties(m,
|
|
268
|
-
Object.defineProperty(
|
|
269
|
-
m.from = (e, t, n, r, s,
|
|
270
|
-
const
|
|
271
|
-
return a.toFlatObject(e,
|
|
272
|
-
return
|
|
273
|
-
}, (c) => c !== "isAxiosError"), m.call(
|
|
267
|
+
Object.defineProperties(m, ke);
|
|
268
|
+
Object.defineProperty(Ie, "isAxiosError", { value: !0 });
|
|
269
|
+
m.from = (e, t, n, r, s, i) => {
|
|
270
|
+
const o = Object.create(Ie);
|
|
271
|
+
return a.toFlatObject(e, o, function(d) {
|
|
272
|
+
return d !== Error.prototype;
|
|
273
|
+
}, (c) => c !== "isAxiosError"), m.call(o, e.message, t, n, r, s), o.cause = e, o.name = e.name, i && Object.assign(o, i), o;
|
|
274
274
|
};
|
|
275
|
-
const
|
|
276
|
-
function
|
|
275
|
+
const Dt = null;
|
|
276
|
+
function ee(e) {
|
|
277
277
|
return a.isPlainObject(e) || a.isArray(e);
|
|
278
278
|
}
|
|
279
|
-
function
|
|
279
|
+
function je(e) {
|
|
280
280
|
return a.endsWith(e, "[]") ? e.slice(0, -2) : e;
|
|
281
281
|
}
|
|
282
282
|
function pe(e, t, n) {
|
|
283
|
-
return e ? e.concat(t).map(function(s,
|
|
284
|
-
return s =
|
|
283
|
+
return e ? e.concat(t).map(function(s, i) {
|
|
284
|
+
return s = je(s), !n && i ? "[" + s + "]" : s;
|
|
285
285
|
}).join(n ? "." : "") : t;
|
|
286
286
|
}
|
|
287
|
-
function
|
|
288
|
-
return a.isArray(e) && !e.some(
|
|
287
|
+
function Ut(e) {
|
|
288
|
+
return a.isArray(e) && !e.some(ee);
|
|
289
289
|
}
|
|
290
|
-
const
|
|
290
|
+
const Lt = a.toFlatObject(a, {}, null, function(t) {
|
|
291
291
|
return /^is[A-Z]/.test(t);
|
|
292
292
|
});
|
|
293
|
-
function
|
|
293
|
+
function J(e, t, n) {
|
|
294
294
|
if (!a.isObject(e))
|
|
295
295
|
throw new TypeError("target must be an object");
|
|
296
296
|
t = t || new FormData(), n = a.toFlatObject(n, {
|
|
297
297
|
metaTokens: !0,
|
|
298
298
|
dots: !1,
|
|
299
299
|
indexes: !1
|
|
300
|
-
}, !1, function(
|
|
301
|
-
return !a.isUndefined(A[
|
|
300
|
+
}, !1, function(p, A) {
|
|
301
|
+
return !a.isUndefined(A[p]);
|
|
302
302
|
});
|
|
303
|
-
const r = n.metaTokens, s = n.visitor || l,
|
|
303
|
+
const r = n.metaTokens, s = n.visitor || l, i = n.dots, o = n.indexes, d = (n.Blob || typeof Blob < "u" && Blob) && a.isSpecCompliantForm(t);
|
|
304
304
|
if (!a.isFunction(s))
|
|
305
305
|
throw new TypeError("visitor must be a function");
|
|
306
|
-
function u(
|
|
307
|
-
if (
|
|
306
|
+
function u(f) {
|
|
307
|
+
if (f === null)
|
|
308
308
|
return "";
|
|
309
|
-
if (a.isDate(
|
|
310
|
-
return
|
|
311
|
-
if (!
|
|
309
|
+
if (a.isDate(f))
|
|
310
|
+
return f.toISOString();
|
|
311
|
+
if (!d && a.isBlob(f))
|
|
312
312
|
throw new m("Blob is not supported. Use a Buffer instead.");
|
|
313
|
-
return a.isArrayBuffer(
|
|
314
|
-
}
|
|
315
|
-
function l(
|
|
316
|
-
let g =
|
|
317
|
-
if (
|
|
318
|
-
if (a.endsWith(
|
|
319
|
-
|
|
320
|
-
else if (a.isArray(
|
|
321
|
-
return
|
|
322
|
-
!(a.isUndefined(
|
|
313
|
+
return a.isArrayBuffer(f) || a.isTypedArray(f) ? d && typeof Blob == "function" ? new Blob([f]) : Buffer.from(f) : f;
|
|
314
|
+
}
|
|
315
|
+
function l(f, p, A) {
|
|
316
|
+
let g = f;
|
|
317
|
+
if (f && !A && typeof f == "object") {
|
|
318
|
+
if (a.endsWith(p, "{}"))
|
|
319
|
+
p = r ? p : p.slice(0, -2), f = JSON.stringify(f);
|
|
320
|
+
else if (a.isArray(f) && Ut(f) || (a.isFileList(f) || a.endsWith(p, "[]")) && (g = a.toArray(f)))
|
|
321
|
+
return p = je(p), g.forEach(function(k, Qe) {
|
|
322
|
+
!(a.isUndefined(k) || k === null) && t.append(
|
|
323
323
|
// eslint-disable-next-line no-nested-ternary
|
|
324
|
-
|
|
325
|
-
u(
|
|
324
|
+
o === !0 ? pe([p], Qe, i) : o === null ? p : p + "[]",
|
|
325
|
+
u(k)
|
|
326
326
|
);
|
|
327
327
|
}), !1;
|
|
328
328
|
}
|
|
329
|
-
return
|
|
329
|
+
return ee(f) ? !0 : (t.append(pe(A, p, i), u(f)), !1);
|
|
330
330
|
}
|
|
331
|
-
const
|
|
331
|
+
const h = [], E = Object.assign(Lt, {
|
|
332
332
|
defaultVisitor: l,
|
|
333
333
|
convertValue: u,
|
|
334
|
-
isVisitable:
|
|
334
|
+
isVisitable: ee
|
|
335
335
|
});
|
|
336
|
-
function y(
|
|
337
|
-
if (!a.isUndefined(
|
|
338
|
-
if (
|
|
339
|
-
throw Error("Circular reference detected in " +
|
|
340
|
-
|
|
336
|
+
function y(f, p) {
|
|
337
|
+
if (!a.isUndefined(f)) {
|
|
338
|
+
if (h.indexOf(f) !== -1)
|
|
339
|
+
throw Error("Circular reference detected in " + p.join("."));
|
|
340
|
+
h.push(f), a.forEach(f, function(g, N) {
|
|
341
341
|
(!(a.isUndefined(g) || g === null) && s.call(
|
|
342
342
|
t,
|
|
343
343
|
g,
|
|
344
|
-
a.isString(
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
)) === !0 && y(g,
|
|
348
|
-
}),
|
|
344
|
+
a.isString(N) ? N.trim() : N,
|
|
345
|
+
p,
|
|
346
|
+
E
|
|
347
|
+
)) === !0 && y(g, p ? p.concat(N) : [N]);
|
|
348
|
+
}), h.pop();
|
|
349
349
|
}
|
|
350
350
|
}
|
|
351
351
|
if (!a.isObject(e))
|
|
352
352
|
throw new TypeError("data must be an object");
|
|
353
353
|
return y(e), t;
|
|
354
354
|
}
|
|
355
|
-
function
|
|
355
|
+
function me(e) {
|
|
356
356
|
const t = {
|
|
357
357
|
"!": "%21",
|
|
358
358
|
"'": "%27",
|
|
@@ -366,36 +366,36 @@ function he(e) {
|
|
|
366
366
|
return t[r];
|
|
367
367
|
});
|
|
368
368
|
}
|
|
369
|
-
function
|
|
370
|
-
this._pairs = [], e &&
|
|
369
|
+
function ae(e, t) {
|
|
370
|
+
this._pairs = [], e && J(e, this, t);
|
|
371
371
|
}
|
|
372
|
-
const
|
|
373
|
-
|
|
372
|
+
const qe = ae.prototype;
|
|
373
|
+
qe.append = function(t, n) {
|
|
374
374
|
this._pairs.push([t, n]);
|
|
375
375
|
};
|
|
376
|
-
|
|
376
|
+
qe.toString = function(t) {
|
|
377
377
|
const n = t ? function(r) {
|
|
378
|
-
return t.call(this, r,
|
|
379
|
-
} :
|
|
378
|
+
return t.call(this, r, me);
|
|
379
|
+
} : me;
|
|
380
380
|
return this._pairs.map(function(s) {
|
|
381
381
|
return n(s[0]) + "=" + n(s[1]);
|
|
382
382
|
}, "").join("&");
|
|
383
383
|
};
|
|
384
|
-
function
|
|
384
|
+
function Bt(e) {
|
|
385
385
|
return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
|
|
386
386
|
}
|
|
387
|
-
function
|
|
387
|
+
function He(e, t, n) {
|
|
388
388
|
if (!t)
|
|
389
389
|
return e;
|
|
390
|
-
const r = n && n.encode ||
|
|
391
|
-
let
|
|
392
|
-
if (s ?
|
|
393
|
-
const
|
|
394
|
-
|
|
390
|
+
const r = n && n.encode || Bt, s = n && n.serialize;
|
|
391
|
+
let i;
|
|
392
|
+
if (s ? i = s(t, n) : i = a.isURLSearchParams(t) ? t.toString() : new ae(t, n).toString(r), i) {
|
|
393
|
+
const o = e.indexOf("#");
|
|
394
|
+
o !== -1 && (e = e.slice(0, o)), e += (e.indexOf("?") === -1 ? "?" : "&") + i;
|
|
395
395
|
}
|
|
396
396
|
return e;
|
|
397
397
|
}
|
|
398
|
-
class
|
|
398
|
+
class It {
|
|
399
399
|
constructor() {
|
|
400
400
|
this.handlers = [];
|
|
401
401
|
}
|
|
@@ -449,62 +449,62 @@ class Dt {
|
|
|
449
449
|
});
|
|
450
450
|
}
|
|
451
451
|
}
|
|
452
|
-
const
|
|
452
|
+
const ye = It, $e = {
|
|
453
453
|
silentJSONParsing: !0,
|
|
454
454
|
forcedJSONParsing: !0,
|
|
455
455
|
clarifyTimeoutError: !1
|
|
456
|
-
},
|
|
456
|
+
}, kt = typeof URLSearchParams < "u" ? URLSearchParams : ae, jt = typeof FormData < "u" ? FormData : null, qt = typeof Blob < "u" ? Blob : null, Ht = (() => {
|
|
457
457
|
let e;
|
|
458
458
|
return typeof navigator < "u" && ((e = navigator.product) === "ReactNative" || e === "NativeScript" || e === "NS") ? !1 : typeof window < "u" && typeof document < "u";
|
|
459
|
-
})(),
|
|
459
|
+
})(), $t = (() => typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
|
|
460
460
|
self instanceof WorkerGlobalScope && typeof self.importScripts == "function")(), b = {
|
|
461
461
|
isBrowser: !0,
|
|
462
462
|
classes: {
|
|
463
|
-
URLSearchParams:
|
|
464
|
-
FormData:
|
|
465
|
-
Blob:
|
|
463
|
+
URLSearchParams: kt,
|
|
464
|
+
FormData: jt,
|
|
465
|
+
Blob: qt
|
|
466
466
|
},
|
|
467
|
-
isStandardBrowserEnv:
|
|
468
|
-
isStandardBrowserWebWorkerEnv:
|
|
467
|
+
isStandardBrowserEnv: Ht,
|
|
468
|
+
isStandardBrowserWebWorkerEnv: $t,
|
|
469
469
|
protocols: ["http", "https", "file", "blob", "url", "data"]
|
|
470
470
|
};
|
|
471
|
-
function
|
|
472
|
-
return
|
|
473
|
-
visitor: function(n, r, s,
|
|
474
|
-
return b.isNode && a.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) :
|
|
471
|
+
function zt(e, t) {
|
|
472
|
+
return J(e, new b.classes.URLSearchParams(), Object.assign({
|
|
473
|
+
visitor: function(n, r, s, i) {
|
|
474
|
+
return b.isNode && a.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : i.defaultVisitor.apply(this, arguments);
|
|
475
475
|
}
|
|
476
476
|
}, t));
|
|
477
477
|
}
|
|
478
|
-
function
|
|
478
|
+
function Vt(e) {
|
|
479
479
|
return a.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
|
|
480
480
|
}
|
|
481
|
-
function
|
|
481
|
+
function Kt(e) {
|
|
482
482
|
const t = {}, n = Object.keys(e);
|
|
483
483
|
let r;
|
|
484
484
|
const s = n.length;
|
|
485
|
-
let
|
|
485
|
+
let i;
|
|
486
486
|
for (r = 0; r < s; r++)
|
|
487
|
-
|
|
487
|
+
i = n[r], t[i] = e[i];
|
|
488
488
|
return t;
|
|
489
489
|
}
|
|
490
|
-
function
|
|
491
|
-
function t(n, r, s,
|
|
492
|
-
let
|
|
493
|
-
const c = Number.isFinite(+
|
|
494
|
-
return
|
|
490
|
+
function ze(e) {
|
|
491
|
+
function t(n, r, s, i) {
|
|
492
|
+
let o = n[i++];
|
|
493
|
+
const c = Number.isFinite(+o), d = i >= n.length;
|
|
494
|
+
return o = !o && a.isArray(s) ? s.length : o, d ? (a.hasOwnProp(s, o) ? s[o] = [s[o], r] : s[o] = r, !c) : ((!s[o] || !a.isObject(s[o])) && (s[o] = []), t(n, r, s[o], i) && a.isArray(s[o]) && (s[o] = Kt(s[o])), !c);
|
|
495
495
|
}
|
|
496
496
|
if (a.isFormData(e) && a.isFunction(e.entries)) {
|
|
497
497
|
const n = {};
|
|
498
498
|
return a.forEachEntry(e, (r, s) => {
|
|
499
|
-
t(
|
|
499
|
+
t(Vt(r), s, n, 0);
|
|
500
500
|
}), n;
|
|
501
501
|
}
|
|
502
502
|
return null;
|
|
503
503
|
}
|
|
504
|
-
const
|
|
504
|
+
const Jt = {
|
|
505
505
|
"Content-Type": void 0
|
|
506
506
|
};
|
|
507
|
-
function
|
|
507
|
+
function vt(e, t, n) {
|
|
508
508
|
if (a.isString(e))
|
|
509
509
|
try {
|
|
510
510
|
return (t || JSON.parse)(e), a.trim(e);
|
|
@@ -514,13 +514,13 @@ function Ht(e, t, n) {
|
|
|
514
514
|
}
|
|
515
515
|
return (n || JSON.stringify)(e);
|
|
516
516
|
}
|
|
517
|
-
const
|
|
518
|
-
transitional:
|
|
517
|
+
const v = {
|
|
518
|
+
transitional: $e,
|
|
519
519
|
adapter: ["xhr", "http"],
|
|
520
520
|
transformRequest: [function(t, n) {
|
|
521
|
-
const r = n.getContentType() || "", s = r.indexOf("application/json") > -1,
|
|
522
|
-
if (
|
|
523
|
-
return s && s ? JSON.stringify(
|
|
521
|
+
const r = n.getContentType() || "", s = r.indexOf("application/json") > -1, i = a.isObject(t);
|
|
522
|
+
if (i && a.isHTMLForm(t) && (t = new FormData(t)), a.isFormData(t))
|
|
523
|
+
return s && s ? JSON.stringify(ze(t)) : t;
|
|
524
524
|
if (a.isArrayBuffer(t) || a.isBuffer(t) || a.isStream(t) || a.isFile(t) || a.isBlob(t))
|
|
525
525
|
return t;
|
|
526
526
|
if (a.isArrayBufferView(t))
|
|
@@ -528,28 +528,28 @@ const J = {
|
|
|
528
528
|
if (a.isURLSearchParams(t))
|
|
529
529
|
return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
|
|
530
530
|
let c;
|
|
531
|
-
if (
|
|
531
|
+
if (i) {
|
|
532
532
|
if (r.indexOf("application/x-www-form-urlencoded") > -1)
|
|
533
|
-
return
|
|
533
|
+
return zt(t, this.formSerializer).toString();
|
|
534
534
|
if ((c = a.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {
|
|
535
|
-
const
|
|
536
|
-
return
|
|
535
|
+
const d = this.env && this.env.FormData;
|
|
536
|
+
return J(
|
|
537
537
|
c ? { "files[]": t } : t,
|
|
538
|
-
|
|
538
|
+
d && new d(),
|
|
539
539
|
this.formSerializer
|
|
540
540
|
);
|
|
541
541
|
}
|
|
542
542
|
}
|
|
543
|
-
return
|
|
543
|
+
return i || s ? (n.setContentType("application/json", !1), vt(t)) : t;
|
|
544
544
|
}],
|
|
545
545
|
transformResponse: [function(t) {
|
|
546
|
-
const n = this.transitional ||
|
|
546
|
+
const n = this.transitional || v.transitional, r = n && n.forcedJSONParsing, s = this.responseType === "json";
|
|
547
547
|
if (t && a.isString(t) && (r && !this.responseType || s)) {
|
|
548
|
-
const
|
|
548
|
+
const o = !(n && n.silentJSONParsing) && s;
|
|
549
549
|
try {
|
|
550
550
|
return JSON.parse(t);
|
|
551
551
|
} catch (c) {
|
|
552
|
-
if (
|
|
552
|
+
if (o)
|
|
553
553
|
throw c.name === "SyntaxError" ? m.from(c, m.ERR_BAD_RESPONSE, this, null, this.response) : c;
|
|
554
554
|
}
|
|
555
555
|
}
|
|
@@ -578,12 +578,12 @@ const J = {
|
|
|
578
578
|
}
|
|
579
579
|
};
|
|
580
580
|
a.forEach(["delete", "get", "head"], function(t) {
|
|
581
|
-
|
|
581
|
+
v.headers[t] = {};
|
|
582
582
|
});
|
|
583
583
|
a.forEach(["post", "put", "patch"], function(t) {
|
|
584
|
-
|
|
584
|
+
v.headers[t] = a.merge(Jt);
|
|
585
585
|
});
|
|
586
|
-
const
|
|
586
|
+
const ce = v, Mt = a.toObjectSet([
|
|
587
587
|
"age",
|
|
588
588
|
"authorization",
|
|
589
589
|
"content-length",
|
|
@@ -601,28 +601,28 @@ const ae = J, zt = a.toObjectSet([
|
|
|
601
601
|
"referer",
|
|
602
602
|
"retry-after",
|
|
603
603
|
"user-agent"
|
|
604
|
-
]),
|
|
604
|
+
]), Wt = (e) => {
|
|
605
605
|
const t = {};
|
|
606
606
|
let n, r, s;
|
|
607
607
|
return e && e.split(`
|
|
608
|
-
`).forEach(function(
|
|
609
|
-
s =
|
|
608
|
+
`).forEach(function(o) {
|
|
609
|
+
s = o.indexOf(":"), n = o.substring(0, s).trim().toLowerCase(), r = o.substring(s + 1).trim(), !(!n || t[n] && Mt[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r);
|
|
610
610
|
}), t;
|
|
611
|
-
},
|
|
611
|
+
}, we = Symbol("internals");
|
|
612
612
|
function D(e) {
|
|
613
613
|
return e && String(e).trim().toLowerCase();
|
|
614
614
|
}
|
|
615
|
-
function
|
|
616
|
-
return e === !1 || e == null ? e : a.isArray(e) ? e.map(
|
|
615
|
+
function H(e) {
|
|
616
|
+
return e === !1 || e == null ? e : a.isArray(e) ? e.map(H) : String(e);
|
|
617
617
|
}
|
|
618
|
-
function
|
|
618
|
+
function Gt(e) {
|
|
619
619
|
const t = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
620
620
|
let r;
|
|
621
621
|
for (; r = n.exec(e); )
|
|
622
622
|
t[r[1]] = r[2];
|
|
623
623
|
return t;
|
|
624
624
|
}
|
|
625
|
-
function
|
|
625
|
+
function Xt(e) {
|
|
626
626
|
return /^[-_a-zA-Z]+$/.test(e.trim());
|
|
627
627
|
}
|
|
628
628
|
function G(e, t, n, r, s) {
|
|
@@ -635,35 +635,35 @@ function G(e, t, n, r, s) {
|
|
|
635
635
|
return r.test(t);
|
|
636
636
|
}
|
|
637
637
|
}
|
|
638
|
-
function
|
|
638
|
+
function Yt(e) {
|
|
639
639
|
return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, n, r) => n.toUpperCase() + r);
|
|
640
640
|
}
|
|
641
|
-
function
|
|
641
|
+
function Qt(e, t) {
|
|
642
642
|
const n = a.toCamelCase(" " + t);
|
|
643
643
|
["get", "set", "has"].forEach((r) => {
|
|
644
644
|
Object.defineProperty(e, r + n, {
|
|
645
|
-
value: function(s,
|
|
646
|
-
return this[r].call(this, t, s,
|
|
645
|
+
value: function(s, i, o) {
|
|
646
|
+
return this[r].call(this, t, s, i, o);
|
|
647
647
|
},
|
|
648
648
|
configurable: !0
|
|
649
649
|
});
|
|
650
650
|
});
|
|
651
651
|
}
|
|
652
|
-
let
|
|
652
|
+
let M = class {
|
|
653
653
|
constructor(t) {
|
|
654
654
|
t && this.set(t);
|
|
655
655
|
}
|
|
656
656
|
set(t, n, r) {
|
|
657
657
|
const s = this;
|
|
658
|
-
function
|
|
659
|
-
const l = D(
|
|
658
|
+
function i(c, d, u) {
|
|
659
|
+
const l = D(d);
|
|
660
660
|
if (!l)
|
|
661
661
|
throw new Error("header name must be a non-empty string");
|
|
662
|
-
const
|
|
663
|
-
(!
|
|
662
|
+
const h = a.findKey(s, l);
|
|
663
|
+
(!h || s[h] === void 0 || u === !0 || u === void 0 && s[h] !== !1) && (s[h || d] = H(c));
|
|
664
664
|
}
|
|
665
|
-
const
|
|
666
|
-
return a.isPlainObject(t) || t instanceof this.constructor ?
|
|
665
|
+
const o = (c, d) => a.forEach(c, (u, l) => i(u, l, d));
|
|
666
|
+
return a.isPlainObject(t) || t instanceof this.constructor ? o(t, n) : a.isString(t) && (t = t.trim()) && !Xt(t) ? o(Wt(t), n) : t != null && i(n, t, r), this;
|
|
667
667
|
}
|
|
668
668
|
get(t, n) {
|
|
669
669
|
if (t = D(t), t) {
|
|
@@ -673,7 +673,7 @@ let v = class {
|
|
|
673
673
|
if (!n)
|
|
674
674
|
return s;
|
|
675
675
|
if (n === !0)
|
|
676
|
-
return
|
|
676
|
+
return Gt(s);
|
|
677
677
|
if (a.isFunction(n))
|
|
678
678
|
return n.call(this, s, r);
|
|
679
679
|
if (a.isRegExp(n))
|
|
@@ -692,33 +692,33 @@ let v = class {
|
|
|
692
692
|
delete(t, n) {
|
|
693
693
|
const r = this;
|
|
694
694
|
let s = !1;
|
|
695
|
-
function o
|
|
696
|
-
if (
|
|
697
|
-
const c = a.findKey(r,
|
|
695
|
+
function i(o) {
|
|
696
|
+
if (o = D(o), o) {
|
|
697
|
+
const c = a.findKey(r, o);
|
|
698
698
|
c && (!n || G(r, r[c], c, n)) && (delete r[c], s = !0);
|
|
699
699
|
}
|
|
700
700
|
}
|
|
701
|
-
return a.isArray(t) ? t.forEach(
|
|
701
|
+
return a.isArray(t) ? t.forEach(i) : i(t), s;
|
|
702
702
|
}
|
|
703
703
|
clear(t) {
|
|
704
704
|
const n = Object.keys(this);
|
|
705
705
|
let r = n.length, s = !1;
|
|
706
706
|
for (; r--; ) {
|
|
707
|
-
const
|
|
708
|
-
(!t || G(this, this[
|
|
707
|
+
const i = n[r];
|
|
708
|
+
(!t || G(this, this[i], i, t, !0)) && (delete this[i], s = !0);
|
|
709
709
|
}
|
|
710
710
|
return s;
|
|
711
711
|
}
|
|
712
712
|
normalize(t) {
|
|
713
713
|
const n = this, r = {};
|
|
714
|
-
return a.forEach(this, (s,
|
|
715
|
-
const
|
|
716
|
-
if (
|
|
717
|
-
n[
|
|
714
|
+
return a.forEach(this, (s, i) => {
|
|
715
|
+
const o = a.findKey(r, i);
|
|
716
|
+
if (o) {
|
|
717
|
+
n[o] = H(s), delete n[i];
|
|
718
718
|
return;
|
|
719
719
|
}
|
|
720
|
-
const c = t ?
|
|
721
|
-
c !==
|
|
720
|
+
const c = t ? Yt(i) : String(i).trim();
|
|
721
|
+
c !== i && delete n[i], n[c] = H(s), r[c] = !0;
|
|
722
722
|
}), this;
|
|
723
723
|
}
|
|
724
724
|
concat(...t) {
|
|
@@ -748,37 +748,37 @@ let v = class {
|
|
|
748
748
|
return n.forEach((s) => r.set(s)), r;
|
|
749
749
|
}
|
|
750
750
|
static accessor(t) {
|
|
751
|
-
const r = (this[
|
|
751
|
+
const r = (this[we] = this[we] = {
|
|
752
752
|
accessors: {}
|
|
753
753
|
}).accessors, s = this.prototype;
|
|
754
|
-
function o
|
|
755
|
-
const c = D(
|
|
756
|
-
r[c] || (
|
|
754
|
+
function i(o) {
|
|
755
|
+
const c = D(o);
|
|
756
|
+
r[c] || (Qt(s, o), r[c] = !0);
|
|
757
757
|
}
|
|
758
|
-
return a.isArray(t) ? t.forEach(
|
|
758
|
+
return a.isArray(t) ? t.forEach(i) : i(t), this;
|
|
759
759
|
}
|
|
760
760
|
};
|
|
761
|
-
|
|
762
|
-
a.freezeMethods(
|
|
763
|
-
a.freezeMethods(
|
|
764
|
-
const R =
|
|
761
|
+
M.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
|
|
762
|
+
a.freezeMethods(M.prototype);
|
|
763
|
+
a.freezeMethods(M);
|
|
764
|
+
const R = M;
|
|
765
765
|
function X(e, t) {
|
|
766
|
-
const n = this ||
|
|
767
|
-
let
|
|
766
|
+
const n = this || ce, r = t || n, s = R.from(r.headers);
|
|
767
|
+
let i = r.data;
|
|
768
768
|
return a.forEach(e, function(c) {
|
|
769
|
-
|
|
770
|
-
}), s.normalize(),
|
|
769
|
+
i = c.call(n, i, s.normalize(), t ? t.status : void 0);
|
|
770
|
+
}), s.normalize(), i;
|
|
771
771
|
}
|
|
772
|
-
function
|
|
772
|
+
function Ve(e) {
|
|
773
773
|
return !!(e && e.__CANCEL__);
|
|
774
774
|
}
|
|
775
|
-
function
|
|
775
|
+
function I(e, t, n) {
|
|
776
776
|
m.call(this, e ?? "canceled", m.ERR_CANCELED, t, n), this.name = "CanceledError";
|
|
777
777
|
}
|
|
778
|
-
a.inherits(
|
|
778
|
+
a.inherits(I, m, {
|
|
779
779
|
__CANCEL__: !0
|
|
780
780
|
});
|
|
781
|
-
function
|
|
781
|
+
function Zt(e, t, n) {
|
|
782
782
|
const r = n.config.validateStatus;
|
|
783
783
|
!n.status || !r || r(n.status) ? e(n) : t(new m(
|
|
784
784
|
"Request failed with status code " + n.status,
|
|
@@ -788,13 +788,13 @@ function Wt(e, t, n) {
|
|
|
788
788
|
n
|
|
789
789
|
));
|
|
790
790
|
}
|
|
791
|
-
const
|
|
791
|
+
const en = b.isStandardBrowserEnv ? (
|
|
792
792
|
// Standard browser envs support document.cookie
|
|
793
793
|
function() {
|
|
794
794
|
return {
|
|
795
|
-
write: function(n, r, s,
|
|
796
|
-
const
|
|
797
|
-
|
|
795
|
+
write: function(n, r, s, i, o, c) {
|
|
796
|
+
const d = [];
|
|
797
|
+
d.push(n + "=" + encodeURIComponent(r)), a.isNumber(s) && d.push("expires=" + new Date(s).toGMTString()), a.isString(i) && d.push("path=" + i), a.isString(o) && d.push("domain=" + o), c === !0 && d.push("secure"), document.cookie = d.join("; ");
|
|
798
798
|
},
|
|
799
799
|
read: function(n) {
|
|
800
800
|
const r = document.cookie.match(new RegExp("(^|;\\s*)(" + n + ")=([^;]*)"));
|
|
@@ -819,24 +819,24 @@ const Gt = b.isStandardBrowserEnv ? (
|
|
|
819
819
|
};
|
|
820
820
|
}()
|
|
821
821
|
);
|
|
822
|
-
function
|
|
822
|
+
function tn(e) {
|
|
823
823
|
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
|
|
824
824
|
}
|
|
825
|
-
function
|
|
825
|
+
function nn(e, t) {
|
|
826
826
|
return t ? e.replace(/\/+$/, "") + "/" + t.replace(/^\/+/, "") : e;
|
|
827
827
|
}
|
|
828
|
-
function
|
|
829
|
-
return e && !
|
|
828
|
+
function Ke(e, t) {
|
|
829
|
+
return e && !tn(t) ? nn(e, t) : t;
|
|
830
830
|
}
|
|
831
|
-
const
|
|
831
|
+
const rn = b.isStandardBrowserEnv ? (
|
|
832
832
|
// Standard browser envs have full support of the APIs needed to test
|
|
833
833
|
// whether the request URL is of the same origin as current location.
|
|
834
834
|
function() {
|
|
835
835
|
const t = /(msie|trident)/i.test(navigator.userAgent), n = document.createElement("a");
|
|
836
836
|
let r;
|
|
837
|
-
function s(
|
|
838
|
-
let
|
|
839
|
-
return t && (n.setAttribute("href",
|
|
837
|
+
function s(i) {
|
|
838
|
+
let o = i;
|
|
839
|
+
return t && (n.setAttribute("href", o), o = n.href), n.setAttribute("href", o), {
|
|
840
840
|
href: n.href,
|
|
841
841
|
protocol: n.protocol ? n.protocol.replace(/:$/, "") : "",
|
|
842
842
|
host: n.host,
|
|
@@ -847,8 +847,8 @@ const Qt = b.isStandardBrowserEnv ? (
|
|
|
847
847
|
pathname: n.pathname.charAt(0) === "/" ? n.pathname : "/" + n.pathname
|
|
848
848
|
};
|
|
849
849
|
}
|
|
850
|
-
return r = s(window.location.href), function(
|
|
851
|
-
const c = a.isString(
|
|
850
|
+
return r = s(window.location.href), function(o) {
|
|
851
|
+
const c = a.isString(o) ? s(o) : o;
|
|
852
852
|
return c.protocol === r.protocol && c.host === r.host;
|
|
853
853
|
};
|
|
854
854
|
}()
|
|
@@ -860,113 +860,113 @@ const Qt = b.isStandardBrowserEnv ? (
|
|
|
860
860
|
};
|
|
861
861
|
}()
|
|
862
862
|
);
|
|
863
|
-
function
|
|
863
|
+
function sn(e) {
|
|
864
864
|
const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
|
|
865
865
|
return t && t[1] || "";
|
|
866
866
|
}
|
|
867
|
-
function
|
|
867
|
+
function on(e, t) {
|
|
868
868
|
e = e || 10;
|
|
869
869
|
const n = new Array(e), r = new Array(e);
|
|
870
|
-
let s = 0,
|
|
871
|
-
return t = t !== void 0 ? t : 1e3, function(
|
|
872
|
-
const u = Date.now(), l = r[
|
|
873
|
-
|
|
874
|
-
let
|
|
875
|
-
for (;
|
|
876
|
-
|
|
877
|
-
if (s = (s + 1) % e, s ===
|
|
870
|
+
let s = 0, i = 0, o;
|
|
871
|
+
return t = t !== void 0 ? t : 1e3, function(d) {
|
|
872
|
+
const u = Date.now(), l = r[i];
|
|
873
|
+
o || (o = u), n[s] = d, r[s] = u;
|
|
874
|
+
let h = i, E = 0;
|
|
875
|
+
for (; h !== s; )
|
|
876
|
+
E += n[h++], h = h % e;
|
|
877
|
+
if (s = (s + 1) % e, s === i && (i = (i + 1) % e), u - o < t)
|
|
878
878
|
return;
|
|
879
879
|
const y = l && u - l;
|
|
880
|
-
return y ? Math.round(
|
|
880
|
+
return y ? Math.round(E * 1e3 / y) : void 0;
|
|
881
881
|
};
|
|
882
882
|
}
|
|
883
883
|
function Ee(e, t) {
|
|
884
884
|
let n = 0;
|
|
885
|
-
const r =
|
|
885
|
+
const r = on(50, 250);
|
|
886
886
|
return (s) => {
|
|
887
|
-
const
|
|
888
|
-
n =
|
|
887
|
+
const i = s.loaded, o = s.lengthComputable ? s.total : void 0, c = i - n, d = r(c), u = i <= o;
|
|
888
|
+
n = i;
|
|
889
889
|
const l = {
|
|
890
|
-
loaded:
|
|
891
|
-
total:
|
|
892
|
-
progress:
|
|
890
|
+
loaded: i,
|
|
891
|
+
total: o,
|
|
892
|
+
progress: o ? i / o : void 0,
|
|
893
893
|
bytes: c,
|
|
894
|
-
rate:
|
|
895
|
-
estimated:
|
|
894
|
+
rate: d || void 0,
|
|
895
|
+
estimated: d && o && u ? (o - i) / d : void 0,
|
|
896
896
|
event: s
|
|
897
897
|
};
|
|
898
898
|
l[t ? "download" : "upload"] = !0, e(l);
|
|
899
899
|
};
|
|
900
900
|
}
|
|
901
|
-
const
|
|
901
|
+
const an = typeof XMLHttpRequest < "u", cn = an && function(e) {
|
|
902
902
|
return new Promise(function(n, r) {
|
|
903
903
|
let s = e.data;
|
|
904
|
-
const
|
|
904
|
+
const i = R.from(e.headers).normalize(), o = e.responseType;
|
|
905
905
|
let c;
|
|
906
|
-
function
|
|
906
|
+
function d() {
|
|
907
907
|
e.cancelToken && e.cancelToken.unsubscribe(c), e.signal && e.signal.removeEventListener("abort", c);
|
|
908
908
|
}
|
|
909
|
-
a.isFormData(s) && (b.isStandardBrowserEnv || b.isStandardBrowserWebWorkerEnv) &&
|
|
909
|
+
a.isFormData(s) && (b.isStandardBrowserEnv || b.isStandardBrowserWebWorkerEnv) && i.setContentType(!1);
|
|
910
910
|
let u = new XMLHttpRequest();
|
|
911
911
|
if (e.auth) {
|
|
912
|
-
const y = e.auth.username || "",
|
|
913
|
-
|
|
912
|
+
const y = e.auth.username || "", f = e.auth.password ? unescape(encodeURIComponent(e.auth.password)) : "";
|
|
913
|
+
i.set("Authorization", "Basic " + btoa(y + ":" + f));
|
|
914
914
|
}
|
|
915
|
-
const l =
|
|
916
|
-
u.open(e.method.toUpperCase(),
|
|
917
|
-
function
|
|
915
|
+
const l = Ke(e.baseURL, e.url);
|
|
916
|
+
u.open(e.method.toUpperCase(), He(l, e.params, e.paramsSerializer), !0), u.timeout = e.timeout;
|
|
917
|
+
function h() {
|
|
918
918
|
if (!u)
|
|
919
919
|
return;
|
|
920
920
|
const y = R.from(
|
|
921
921
|
"getAllResponseHeaders" in u && u.getAllResponseHeaders()
|
|
922
|
-
),
|
|
923
|
-
data: !
|
|
922
|
+
), p = {
|
|
923
|
+
data: !o || o === "text" || o === "json" ? u.responseText : u.response,
|
|
924
924
|
status: u.status,
|
|
925
925
|
statusText: u.statusText,
|
|
926
926
|
headers: y,
|
|
927
927
|
config: e,
|
|
928
928
|
request: u
|
|
929
929
|
};
|
|
930
|
-
|
|
931
|
-
n(g),
|
|
930
|
+
Zt(function(g) {
|
|
931
|
+
n(g), d();
|
|
932
932
|
}, function(g) {
|
|
933
|
-
r(g),
|
|
934
|
-
},
|
|
933
|
+
r(g), d();
|
|
934
|
+
}, p), u = null;
|
|
935
935
|
}
|
|
936
|
-
if ("onloadend" in u ? u.onloadend =
|
|
937
|
-
!u || u.readyState !== 4 || u.status === 0 && !(u.responseURL && u.responseURL.indexOf("file:") === 0) || setTimeout(
|
|
936
|
+
if ("onloadend" in u ? u.onloadend = h : u.onreadystatechange = function() {
|
|
937
|
+
!u || u.readyState !== 4 || u.status === 0 && !(u.responseURL && u.responseURL.indexOf("file:") === 0) || setTimeout(h);
|
|
938
938
|
}, u.onabort = function() {
|
|
939
939
|
u && (r(new m("Request aborted", m.ECONNABORTED, e, u)), u = null);
|
|
940
940
|
}, u.onerror = function() {
|
|
941
941
|
r(new m("Network Error", m.ERR_NETWORK, e, u)), u = null;
|
|
942
942
|
}, u.ontimeout = function() {
|
|
943
|
-
let
|
|
944
|
-
const
|
|
945
|
-
e.timeoutErrorMessage && (
|
|
946
|
-
|
|
947
|
-
|
|
943
|
+
let f = e.timeout ? "timeout of " + e.timeout + "ms exceeded" : "timeout exceeded";
|
|
944
|
+
const p = e.transitional || $e;
|
|
945
|
+
e.timeoutErrorMessage && (f = e.timeoutErrorMessage), r(new m(
|
|
946
|
+
f,
|
|
947
|
+
p.clarifyTimeoutError ? m.ETIMEDOUT : m.ECONNABORTED,
|
|
948
948
|
e,
|
|
949
949
|
u
|
|
950
950
|
)), u = null;
|
|
951
951
|
}, b.isStandardBrowserEnv) {
|
|
952
|
-
const y = (e.withCredentials ||
|
|
953
|
-
y &&
|
|
952
|
+
const y = (e.withCredentials || rn(l)) && e.xsrfCookieName && en.read(e.xsrfCookieName);
|
|
953
|
+
y && i.set(e.xsrfHeaderName, y);
|
|
954
954
|
}
|
|
955
|
-
s === void 0 &&
|
|
956
|
-
u.setRequestHeader(
|
|
957
|
-
}), a.isUndefined(e.withCredentials) || (u.withCredentials = !!e.withCredentials),
|
|
958
|
-
u && (r(!y || y.type ? new
|
|
955
|
+
s === void 0 && i.setContentType(null), "setRequestHeader" in u && a.forEach(i.toJSON(), function(f, p) {
|
|
956
|
+
u.setRequestHeader(p, f);
|
|
957
|
+
}), a.isUndefined(e.withCredentials) || (u.withCredentials = !!e.withCredentials), o && o !== "json" && (u.responseType = e.responseType), typeof e.onDownloadProgress == "function" && u.addEventListener("progress", Ee(e.onDownloadProgress, !0)), typeof e.onUploadProgress == "function" && u.upload && u.upload.addEventListener("progress", Ee(e.onUploadProgress)), (e.cancelToken || e.signal) && (c = (y) => {
|
|
958
|
+
u && (r(!y || y.type ? new I(null, e, u) : y), u.abort(), u = null);
|
|
959
959
|
}, e.cancelToken && e.cancelToken.subscribe(c), e.signal && (e.signal.aborted ? c() : e.signal.addEventListener("abort", c)));
|
|
960
|
-
const
|
|
961
|
-
if (
|
|
962
|
-
r(new m("Unsupported protocol " +
|
|
960
|
+
const E = sn(l);
|
|
961
|
+
if (E && b.protocols.indexOf(E) === -1) {
|
|
962
|
+
r(new m("Unsupported protocol " + E + ":", m.ERR_BAD_REQUEST, e));
|
|
963
963
|
return;
|
|
964
964
|
}
|
|
965
965
|
u.send(s || null);
|
|
966
966
|
});
|
|
967
967
|
}, $ = {
|
|
968
|
-
http:
|
|
969
|
-
xhr:
|
|
968
|
+
http: Dt,
|
|
969
|
+
xhr: cn
|
|
970
970
|
};
|
|
971
971
|
a.forEach($, (e, t) => {
|
|
972
972
|
if (e) {
|
|
@@ -977,7 +977,7 @@ a.forEach($, (e, t) => {
|
|
|
977
977
|
Object.defineProperty(e, "adapterName", { value: t });
|
|
978
978
|
}
|
|
979
979
|
});
|
|
980
|
-
const
|
|
980
|
+
const un = {
|
|
981
981
|
getAdapter: (e) => {
|
|
982
982
|
e = a.isArray(e) ? e : [e];
|
|
983
983
|
const { length: t } = e;
|
|
@@ -999,143 +999,143 @@ const rn = {
|
|
|
999
999
|
};
|
|
1000
1000
|
function Y(e) {
|
|
1001
1001
|
if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
|
|
1002
|
-
throw new
|
|
1002
|
+
throw new I(null, e);
|
|
1003
1003
|
}
|
|
1004
|
-
function
|
|
1004
|
+
function ge(e) {
|
|
1005
1005
|
return Y(e), e.headers = R.from(e.headers), e.data = X.call(
|
|
1006
1006
|
e,
|
|
1007
1007
|
e.transformRequest
|
|
1008
|
-
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1),
|
|
1008
|
+
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), un.getAdapter(e.adapter || ce.adapter)(e).then(function(r) {
|
|
1009
1009
|
return Y(e), r.data = X.call(
|
|
1010
1010
|
e,
|
|
1011
1011
|
e.transformResponse,
|
|
1012
1012
|
r
|
|
1013
1013
|
), r.headers = R.from(r.headers), r;
|
|
1014
1014
|
}, function(r) {
|
|
1015
|
-
return
|
|
1015
|
+
return Ve(r) || (Y(e), r && r.response && (r.response.data = X.call(
|
|
1016
1016
|
e,
|
|
1017
1017
|
e.transformResponse,
|
|
1018
1018
|
r.response
|
|
1019
1019
|
), r.response.headers = R.from(r.response.headers))), Promise.reject(r);
|
|
1020
1020
|
});
|
|
1021
1021
|
}
|
|
1022
|
-
const
|
|
1023
|
-
function
|
|
1022
|
+
const Se = (e) => e instanceof R ? e.toJSON() : e;
|
|
1023
|
+
function _(e, t) {
|
|
1024
1024
|
t = t || {};
|
|
1025
1025
|
const n = {};
|
|
1026
|
-
function r(u, l,
|
|
1027
|
-
return a.isPlainObject(u) && a.isPlainObject(l) ? a.merge.call({ caseless:
|
|
1026
|
+
function r(u, l, h) {
|
|
1027
|
+
return a.isPlainObject(u) && a.isPlainObject(l) ? a.merge.call({ caseless: h }, u, l) : a.isPlainObject(l) ? a.merge({}, l) : a.isArray(l) ? l.slice() : l;
|
|
1028
1028
|
}
|
|
1029
|
-
function s(u, l,
|
|
1029
|
+
function s(u, l, h) {
|
|
1030
1030
|
if (a.isUndefined(l)) {
|
|
1031
1031
|
if (!a.isUndefined(u))
|
|
1032
|
-
return r(void 0, u,
|
|
1032
|
+
return r(void 0, u, h);
|
|
1033
1033
|
} else
|
|
1034
|
-
return r(u, l,
|
|
1034
|
+
return r(u, l, h);
|
|
1035
1035
|
}
|
|
1036
|
-
function
|
|
1036
|
+
function i(u, l) {
|
|
1037
1037
|
if (!a.isUndefined(l))
|
|
1038
1038
|
return r(void 0, l);
|
|
1039
1039
|
}
|
|
1040
|
-
function
|
|
1040
|
+
function o(u, l) {
|
|
1041
1041
|
if (a.isUndefined(l)) {
|
|
1042
1042
|
if (!a.isUndefined(u))
|
|
1043
1043
|
return r(void 0, u);
|
|
1044
1044
|
} else
|
|
1045
1045
|
return r(void 0, l);
|
|
1046
1046
|
}
|
|
1047
|
-
function c(u, l,
|
|
1048
|
-
if (
|
|
1047
|
+
function c(u, l, h) {
|
|
1048
|
+
if (h in t)
|
|
1049
1049
|
return r(u, l);
|
|
1050
|
-
if (
|
|
1050
|
+
if (h in e)
|
|
1051
1051
|
return r(void 0, u);
|
|
1052
1052
|
}
|
|
1053
|
-
const
|
|
1054
|
-
url:
|
|
1055
|
-
method:
|
|
1056
|
-
data:
|
|
1057
|
-
baseURL:
|
|
1058
|
-
transformRequest:
|
|
1059
|
-
transformResponse:
|
|
1060
|
-
paramsSerializer:
|
|
1061
|
-
timeout:
|
|
1062
|
-
timeoutMessage:
|
|
1063
|
-
withCredentials:
|
|
1064
|
-
adapter:
|
|
1065
|
-
responseType:
|
|
1066
|
-
xsrfCookieName:
|
|
1067
|
-
xsrfHeaderName:
|
|
1068
|
-
onUploadProgress:
|
|
1069
|
-
onDownloadProgress:
|
|
1070
|
-
decompress:
|
|
1071
|
-
maxContentLength:
|
|
1072
|
-
maxBodyLength:
|
|
1073
|
-
beforeRedirect:
|
|
1074
|
-
transport:
|
|
1075
|
-
httpAgent:
|
|
1076
|
-
httpsAgent:
|
|
1077
|
-
cancelToken:
|
|
1078
|
-
socketPath:
|
|
1079
|
-
responseEncoding:
|
|
1053
|
+
const d = {
|
|
1054
|
+
url: i,
|
|
1055
|
+
method: i,
|
|
1056
|
+
data: i,
|
|
1057
|
+
baseURL: o,
|
|
1058
|
+
transformRequest: o,
|
|
1059
|
+
transformResponse: o,
|
|
1060
|
+
paramsSerializer: o,
|
|
1061
|
+
timeout: o,
|
|
1062
|
+
timeoutMessage: o,
|
|
1063
|
+
withCredentials: o,
|
|
1064
|
+
adapter: o,
|
|
1065
|
+
responseType: o,
|
|
1066
|
+
xsrfCookieName: o,
|
|
1067
|
+
xsrfHeaderName: o,
|
|
1068
|
+
onUploadProgress: o,
|
|
1069
|
+
onDownloadProgress: o,
|
|
1070
|
+
decompress: o,
|
|
1071
|
+
maxContentLength: o,
|
|
1072
|
+
maxBodyLength: o,
|
|
1073
|
+
beforeRedirect: o,
|
|
1074
|
+
transport: o,
|
|
1075
|
+
httpAgent: o,
|
|
1076
|
+
httpsAgent: o,
|
|
1077
|
+
cancelToken: o,
|
|
1078
|
+
socketPath: o,
|
|
1079
|
+
responseEncoding: o,
|
|
1080
1080
|
validateStatus: c,
|
|
1081
|
-
headers: (u, l) => s(
|
|
1081
|
+
headers: (u, l) => s(Se(u), Se(l), !0)
|
|
1082
1082
|
};
|
|
1083
1083
|
return a.forEach(Object.keys(e).concat(Object.keys(t)), function(l) {
|
|
1084
|
-
const
|
|
1085
|
-
a.isUndefined(
|
|
1084
|
+
const h = d[l] || s, E = h(e[l], t[l], l);
|
|
1085
|
+
a.isUndefined(E) && h !== c || (n[l] = E);
|
|
1086
1086
|
}), n;
|
|
1087
1087
|
}
|
|
1088
|
-
const
|
|
1088
|
+
const Je = "1.3.4", ue = {};
|
|
1089
1089
|
["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
|
|
1090
|
-
|
|
1090
|
+
ue[e] = function(r) {
|
|
1091
1091
|
return typeof r === e || "a" + (t < 1 ? "n " : " ") + e;
|
|
1092
1092
|
};
|
|
1093
1093
|
});
|
|
1094
|
-
const
|
|
1095
|
-
|
|
1096
|
-
function s(
|
|
1097
|
-
return "[Axios v" +
|
|
1094
|
+
const be = {};
|
|
1095
|
+
ue.transitional = function(t, n, r) {
|
|
1096
|
+
function s(i, o) {
|
|
1097
|
+
return "[Axios v" + Je + "] Transitional option '" + i + "'" + o + (r ? ". " + r : "");
|
|
1098
1098
|
}
|
|
1099
|
-
return (
|
|
1099
|
+
return (i, o, c) => {
|
|
1100
1100
|
if (t === !1)
|
|
1101
1101
|
throw new m(
|
|
1102
|
-
s(
|
|
1102
|
+
s(o, " has been removed" + (n ? " in " + n : "")),
|
|
1103
1103
|
m.ERR_DEPRECATED
|
|
1104
1104
|
);
|
|
1105
|
-
return n && !
|
|
1105
|
+
return n && !be[o] && (be[o] = !0, console.warn(
|
|
1106
1106
|
s(
|
|
1107
|
-
|
|
1107
|
+
o,
|
|
1108
1108
|
" has been deprecated since v" + n + " and will be removed in the near future"
|
|
1109
1109
|
)
|
|
1110
|
-
)), t ? t(
|
|
1110
|
+
)), t ? t(i, o, c) : !0;
|
|
1111
1111
|
};
|
|
1112
1112
|
};
|
|
1113
|
-
function
|
|
1113
|
+
function ln(e, t, n) {
|
|
1114
1114
|
if (typeof e != "object")
|
|
1115
1115
|
throw new m("options must be an object", m.ERR_BAD_OPTION_VALUE);
|
|
1116
1116
|
const r = Object.keys(e);
|
|
1117
1117
|
let s = r.length;
|
|
1118
1118
|
for (; s-- > 0; ) {
|
|
1119
|
-
const
|
|
1120
|
-
if (
|
|
1121
|
-
const c = e[
|
|
1122
|
-
if (
|
|
1123
|
-
throw new m("option " +
|
|
1119
|
+
const i = r[s], o = t[i];
|
|
1120
|
+
if (o) {
|
|
1121
|
+
const c = e[i], d = c === void 0 || o(c, i, e);
|
|
1122
|
+
if (d !== !0)
|
|
1123
|
+
throw new m("option " + i + " must be " + d, m.ERR_BAD_OPTION_VALUE);
|
|
1124
1124
|
continue;
|
|
1125
1125
|
}
|
|
1126
1126
|
if (n !== !0)
|
|
1127
|
-
throw new m("Unknown option " +
|
|
1127
|
+
throw new m("Unknown option " + i, m.ERR_BAD_OPTION);
|
|
1128
1128
|
}
|
|
1129
1129
|
}
|
|
1130
|
-
const
|
|
1131
|
-
assertOptions:
|
|
1132
|
-
validators:
|
|
1133
|
-
},
|
|
1134
|
-
let
|
|
1130
|
+
const te = {
|
|
1131
|
+
assertOptions: ln,
|
|
1132
|
+
validators: ue
|
|
1133
|
+
}, C = te.validators;
|
|
1134
|
+
let V = class {
|
|
1135
1135
|
constructor(t) {
|
|
1136
1136
|
this.defaults = t, this.interceptors = {
|
|
1137
|
-
request: new
|
|
1138
|
-
response: new
|
|
1137
|
+
request: new ye(),
|
|
1138
|
+
response: new ye()
|
|
1139
1139
|
};
|
|
1140
1140
|
}
|
|
1141
1141
|
/**
|
|
@@ -1147,71 +1147,71 @@ let z = class {
|
|
|
1147
1147
|
* @returns {Promise} The Promise to be fulfilled
|
|
1148
1148
|
*/
|
|
1149
1149
|
request(t, n) {
|
|
1150
|
-
typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n =
|
|
1151
|
-
const { transitional: r, paramsSerializer: s, headers:
|
|
1152
|
-
r !== void 0 &&
|
|
1153
|
-
silentJSONParsing:
|
|
1154
|
-
forcedJSONParsing:
|
|
1155
|
-
clarifyTimeoutError:
|
|
1156
|
-
}, !1), s !== void 0 &&
|
|
1157
|
-
encode:
|
|
1158
|
-
serialize:
|
|
1150
|
+
typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = _(this.defaults, n);
|
|
1151
|
+
const { transitional: r, paramsSerializer: s, headers: i } = n;
|
|
1152
|
+
r !== void 0 && te.assertOptions(r, {
|
|
1153
|
+
silentJSONParsing: C.transitional(C.boolean),
|
|
1154
|
+
forcedJSONParsing: C.transitional(C.boolean),
|
|
1155
|
+
clarifyTimeoutError: C.transitional(C.boolean)
|
|
1156
|
+
}, !1), s !== void 0 && te.assertOptions(s, {
|
|
1157
|
+
encode: C.function,
|
|
1158
|
+
serialize: C.function
|
|
1159
1159
|
}, !0), n.method = (n.method || this.defaults.method || "get").toLowerCase();
|
|
1160
|
-
let
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
),
|
|
1160
|
+
let o;
|
|
1161
|
+
o = i && a.merge(
|
|
1162
|
+
i.common,
|
|
1163
|
+
i[n.method]
|
|
1164
|
+
), o && a.forEach(
|
|
1165
1165
|
["delete", "get", "head", "post", "put", "patch", "common"],
|
|
1166
|
-
(
|
|
1167
|
-
delete
|
|
1166
|
+
(f) => {
|
|
1167
|
+
delete i[f];
|
|
1168
1168
|
}
|
|
1169
|
-
), n.headers = R.concat(
|
|
1169
|
+
), n.headers = R.concat(o, i);
|
|
1170
1170
|
const c = [];
|
|
1171
|
-
let
|
|
1172
|
-
this.interceptors.request.forEach(function(
|
|
1173
|
-
typeof
|
|
1171
|
+
let d = !0;
|
|
1172
|
+
this.interceptors.request.forEach(function(p) {
|
|
1173
|
+
typeof p.runWhen == "function" && p.runWhen(n) === !1 || (d = d && p.synchronous, c.unshift(p.fulfilled, p.rejected));
|
|
1174
1174
|
});
|
|
1175
1175
|
const u = [];
|
|
1176
|
-
this.interceptors.response.forEach(function(
|
|
1177
|
-
u.push(
|
|
1176
|
+
this.interceptors.response.forEach(function(p) {
|
|
1177
|
+
u.push(p.fulfilled, p.rejected);
|
|
1178
1178
|
});
|
|
1179
|
-
let l,
|
|
1180
|
-
if (!
|
|
1181
|
-
const
|
|
1182
|
-
for (
|
|
1183
|
-
l = l.then(
|
|
1179
|
+
let l, h = 0, E;
|
|
1180
|
+
if (!d) {
|
|
1181
|
+
const f = [ge.bind(this), void 0];
|
|
1182
|
+
for (f.unshift.apply(f, c), f.push.apply(f, u), E = f.length, l = Promise.resolve(n); h < E; )
|
|
1183
|
+
l = l.then(f[h++], f[h++]);
|
|
1184
1184
|
return l;
|
|
1185
1185
|
}
|
|
1186
|
-
|
|
1186
|
+
E = c.length;
|
|
1187
1187
|
let y = n;
|
|
1188
|
-
for (
|
|
1189
|
-
const
|
|
1188
|
+
for (h = 0; h < E; ) {
|
|
1189
|
+
const f = c[h++], p = c[h++];
|
|
1190
1190
|
try {
|
|
1191
|
-
y =
|
|
1191
|
+
y = f(y);
|
|
1192
1192
|
} catch (A) {
|
|
1193
|
-
|
|
1193
|
+
p.call(this, A);
|
|
1194
1194
|
break;
|
|
1195
1195
|
}
|
|
1196
1196
|
}
|
|
1197
1197
|
try {
|
|
1198
|
-
l =
|
|
1199
|
-
} catch (
|
|
1200
|
-
return Promise.reject(
|
|
1198
|
+
l = ge.call(this, y);
|
|
1199
|
+
} catch (f) {
|
|
1200
|
+
return Promise.reject(f);
|
|
1201
1201
|
}
|
|
1202
|
-
for (
|
|
1203
|
-
l = l.then(u[
|
|
1202
|
+
for (h = 0, E = u.length; h < E; )
|
|
1203
|
+
l = l.then(u[h++], u[h++]);
|
|
1204
1204
|
return l;
|
|
1205
1205
|
}
|
|
1206
1206
|
getUri(t) {
|
|
1207
|
-
t =
|
|
1208
|
-
const n =
|
|
1209
|
-
return
|
|
1207
|
+
t = _(this.defaults, t);
|
|
1208
|
+
const n = Ke(t.baseURL, t.url);
|
|
1209
|
+
return He(n, t.params, t.paramsSerializer);
|
|
1210
1210
|
}
|
|
1211
1211
|
};
|
|
1212
1212
|
a.forEach(["delete", "get", "head", "options"], function(t) {
|
|
1213
|
-
|
|
1214
|
-
return this.request(
|
|
1213
|
+
V.prototype[t] = function(n, r) {
|
|
1214
|
+
return this.request(_(r || {}, {
|
|
1215
1215
|
method: t,
|
|
1216
1216
|
url: n,
|
|
1217
1217
|
data: (r || {}).data
|
|
@@ -1220,46 +1220,46 @@ a.forEach(["delete", "get", "head", "options"], function(t) {
|
|
|
1220
1220
|
});
|
|
1221
1221
|
a.forEach(["post", "put", "patch"], function(t) {
|
|
1222
1222
|
function n(r) {
|
|
1223
|
-
return function(
|
|
1224
|
-
return this.request(
|
|
1223
|
+
return function(i, o, c) {
|
|
1224
|
+
return this.request(_(c || {}, {
|
|
1225
1225
|
method: t,
|
|
1226
1226
|
headers: r ? {
|
|
1227
1227
|
"Content-Type": "multipart/form-data"
|
|
1228
1228
|
} : {},
|
|
1229
|
-
url:
|
|
1230
|
-
data:
|
|
1229
|
+
url: i,
|
|
1230
|
+
data: o
|
|
1231
1231
|
}));
|
|
1232
1232
|
};
|
|
1233
1233
|
}
|
|
1234
|
-
|
|
1234
|
+
V.prototype[t] = n(), V.prototype[t + "Form"] = n(!0);
|
|
1235
1235
|
});
|
|
1236
|
-
const
|
|
1237
|
-
let
|
|
1236
|
+
const z = V;
|
|
1237
|
+
let fn = class ve {
|
|
1238
1238
|
constructor(t) {
|
|
1239
1239
|
if (typeof t != "function")
|
|
1240
1240
|
throw new TypeError("executor must be a function.");
|
|
1241
1241
|
let n;
|
|
1242
|
-
this.promise = new Promise(function(
|
|
1243
|
-
n =
|
|
1242
|
+
this.promise = new Promise(function(i) {
|
|
1243
|
+
n = i;
|
|
1244
1244
|
});
|
|
1245
1245
|
const r = this;
|
|
1246
1246
|
this.promise.then((s) => {
|
|
1247
1247
|
if (!r._listeners)
|
|
1248
1248
|
return;
|
|
1249
|
-
let
|
|
1250
|
-
for (;
|
|
1251
|
-
r._listeners[
|
|
1249
|
+
let i = r._listeners.length;
|
|
1250
|
+
for (; i-- > 0; )
|
|
1251
|
+
r._listeners[i](s);
|
|
1252
1252
|
r._listeners = null;
|
|
1253
1253
|
}), this.promise.then = (s) => {
|
|
1254
|
-
let
|
|
1255
|
-
const
|
|
1256
|
-
r.subscribe(c),
|
|
1254
|
+
let i;
|
|
1255
|
+
const o = new Promise((c) => {
|
|
1256
|
+
r.subscribe(c), i = c;
|
|
1257
1257
|
}).then(s);
|
|
1258
|
-
return
|
|
1259
|
-
r.unsubscribe(
|
|
1260
|
-
},
|
|
1261
|
-
}, t(function(
|
|
1262
|
-
r.reason || (r.reason = new
|
|
1258
|
+
return o.cancel = function() {
|
|
1259
|
+
r.unsubscribe(i);
|
|
1260
|
+
}, o;
|
|
1261
|
+
}, t(function(i, o, c) {
|
|
1262
|
+
r.reason || (r.reason = new I(i, o, c), n(r.reason));
|
|
1263
1263
|
});
|
|
1264
1264
|
}
|
|
1265
1265
|
/**
|
|
@@ -1295,23 +1295,23 @@ let on = class He {
|
|
|
1295
1295
|
static source() {
|
|
1296
1296
|
let t;
|
|
1297
1297
|
return {
|
|
1298
|
-
token: new
|
|
1298
|
+
token: new ve(function(s) {
|
|
1299
1299
|
t = s;
|
|
1300
1300
|
}),
|
|
1301
1301
|
cancel: t
|
|
1302
1302
|
};
|
|
1303
1303
|
}
|
|
1304
1304
|
};
|
|
1305
|
-
const
|
|
1306
|
-
function
|
|
1305
|
+
const dn = fn;
|
|
1306
|
+
function hn(e) {
|
|
1307
1307
|
return function(n) {
|
|
1308
1308
|
return e.apply(null, n);
|
|
1309
1309
|
};
|
|
1310
1310
|
}
|
|
1311
|
-
function
|
|
1311
|
+
function pn(e) {
|
|
1312
1312
|
return a.isObject(e) && e.isAxiosError === !0;
|
|
1313
1313
|
}
|
|
1314
|
-
const
|
|
1314
|
+
const ne = {
|
|
1315
1315
|
Continue: 100,
|
|
1316
1316
|
SwitchingProtocols: 101,
|
|
1317
1317
|
Processing: 102,
|
|
@@ -1376,74 +1376,74 @@ const te = {
|
|
|
1376
1376
|
NotExtended: 510,
|
|
1377
1377
|
NetworkAuthenticationRequired: 511
|
|
1378
1378
|
};
|
|
1379
|
-
Object.entries(
|
|
1380
|
-
|
|
1379
|
+
Object.entries(ne).forEach(([e, t]) => {
|
|
1380
|
+
ne[t] = e;
|
|
1381
1381
|
});
|
|
1382
|
-
const
|
|
1383
|
-
function
|
|
1384
|
-
const t = new
|
|
1385
|
-
return a.extend(n,
|
|
1386
|
-
return
|
|
1382
|
+
const mn = ne;
|
|
1383
|
+
function Me(e) {
|
|
1384
|
+
const t = new z(e), n = Pe(z.prototype.request, t);
|
|
1385
|
+
return a.extend(n, z.prototype, t, { allOwnKeys: !0 }), a.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(s) {
|
|
1386
|
+
return Me(_(e, s));
|
|
1387
1387
|
}, n;
|
|
1388
1388
|
}
|
|
1389
|
-
const
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1389
|
+
const w = Me(ce);
|
|
1390
|
+
w.Axios = z;
|
|
1391
|
+
w.CanceledError = I;
|
|
1392
|
+
w.CancelToken = dn;
|
|
1393
|
+
w.isCancel = Ve;
|
|
1394
|
+
w.VERSION = Je;
|
|
1395
|
+
w.toFormData = J;
|
|
1396
|
+
w.AxiosError = m;
|
|
1397
|
+
w.Cancel = w.CanceledError;
|
|
1398
|
+
w.all = function(t) {
|
|
1399
1399
|
return Promise.all(t);
|
|
1400
1400
|
};
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
const
|
|
1409
|
-
Axios:
|
|
1410
|
-
AxiosError:
|
|
1411
|
-
CanceledError:
|
|
1412
|
-
isCancel:
|
|
1413
|
-
CancelToken:
|
|
1414
|
-
VERSION:
|
|
1415
|
-
all:
|
|
1416
|
-
Cancel:
|
|
1417
|
-
isAxiosError:
|
|
1418
|
-
spread:
|
|
1419
|
-
toFormData:
|
|
1420
|
-
AxiosHeaders:
|
|
1421
|
-
HttpStatusCode:
|
|
1422
|
-
formToJSON:
|
|
1423
|
-
mergeConfig:
|
|
1424
|
-
} =
|
|
1425
|
-
class
|
|
1401
|
+
w.spread = hn;
|
|
1402
|
+
w.isAxiosError = pn;
|
|
1403
|
+
w.mergeConfig = _;
|
|
1404
|
+
w.AxiosHeaders = R;
|
|
1405
|
+
w.formToJSON = (e) => ze(a.isHTMLForm(e) ? new FormData(e) : e);
|
|
1406
|
+
w.HttpStatusCode = mn;
|
|
1407
|
+
w.default = w;
|
|
1408
|
+
const We = w, {
|
|
1409
|
+
Axios: Xn,
|
|
1410
|
+
AxiosError: Q,
|
|
1411
|
+
CanceledError: Yn,
|
|
1412
|
+
isCancel: Qn,
|
|
1413
|
+
CancelToken: Zn,
|
|
1414
|
+
VERSION: er,
|
|
1415
|
+
all: tr,
|
|
1416
|
+
Cancel: nr,
|
|
1417
|
+
isAxiosError: rr,
|
|
1418
|
+
spread: sr,
|
|
1419
|
+
toFormData: or,
|
|
1420
|
+
AxiosHeaders: ir,
|
|
1421
|
+
HttpStatusCode: ar,
|
|
1422
|
+
formToJSON: cr,
|
|
1423
|
+
mergeConfig: ur
|
|
1424
|
+
} = We;
|
|
1425
|
+
class Ae extends Error {
|
|
1426
1426
|
constructor(n) {
|
|
1427
1427
|
super(n.join(", "));
|
|
1428
1428
|
S(this, "errors");
|
|
1429
1429
|
this.name = "ValidationError", this.errors = n;
|
|
1430
1430
|
}
|
|
1431
1431
|
}
|
|
1432
|
-
class
|
|
1432
|
+
class Re extends Error {
|
|
1433
1433
|
constructor(n) {
|
|
1434
|
-
super(
|
|
1434
|
+
super("Address already registered.");
|
|
1435
1435
|
S(this, "address");
|
|
1436
1436
|
this.name = "AddressInUseError", this.address = n;
|
|
1437
1437
|
}
|
|
1438
1438
|
}
|
|
1439
|
-
class
|
|
1439
|
+
class Oe extends Error {
|
|
1440
1440
|
constructor(n) {
|
|
1441
|
-
super(
|
|
1441
|
+
super("Code already registered.");
|
|
1442
1442
|
S(this, "code");
|
|
1443
1443
|
this.name = "CodeInUseError", this.code = n;
|
|
1444
1444
|
}
|
|
1445
1445
|
}
|
|
1446
|
-
class
|
|
1446
|
+
class Ce extends Error {
|
|
1447
1447
|
constructor() {
|
|
1448
1448
|
super("Invalid signature provided"), this.name = "InvalidSignatureError";
|
|
1449
1449
|
}
|
|
@@ -1454,38 +1454,64 @@ class yn {
|
|
|
1454
1454
|
S(this, "_debug");
|
|
1455
1455
|
this.httpClient = t.httpClient, this._debug = t.debug;
|
|
1456
1456
|
}
|
|
1457
|
-
async create(t, n, r
|
|
1458
|
-
var
|
|
1457
|
+
async create(t, n, r) {
|
|
1458
|
+
var s;
|
|
1459
1459
|
try {
|
|
1460
1460
|
await this.httpClient.post("/affiliates", {
|
|
1461
1461
|
address: t,
|
|
1462
1462
|
name: n,
|
|
1463
1463
|
code: n,
|
|
1464
|
-
signature: r
|
|
1465
|
-
|
|
1464
|
+
signature: r
|
|
1465
|
+
});
|
|
1466
|
+
} catch (i) {
|
|
1467
|
+
if (i instanceof Q) {
|
|
1468
|
+
const o = (s = i.response) == null ? void 0 : s.data;
|
|
1469
|
+
if (typeof (o == null ? void 0 : o.message) == "string") {
|
|
1470
|
+
const c = o.message.toLowerCase();
|
|
1471
|
+
throw c == "invalid signature" ? new Ce() : c == "address in use" ? new Re(t) : c == "code in use" ? new Oe(n) : new Error(c);
|
|
1472
|
+
} else if ((o == null ? void 0 : o.message) instanceof Array)
|
|
1473
|
+
throw new Ae(o.message);
|
|
1474
|
+
}
|
|
1475
|
+
throw i;
|
|
1476
|
+
}
|
|
1477
|
+
}
|
|
1478
|
+
async update(t, n, r) {
|
|
1479
|
+
var s;
|
|
1480
|
+
try {
|
|
1481
|
+
await this.httpClient.post(`/affiliates/${t}`, {
|
|
1482
|
+
code: n,
|
|
1483
|
+
address: t,
|
|
1484
|
+
signature: r
|
|
1466
1485
|
});
|
|
1467
1486
|
} catch (i) {
|
|
1468
|
-
if (i instanceof
|
|
1469
|
-
const
|
|
1470
|
-
if (typeof (
|
|
1471
|
-
const
|
|
1472
|
-
throw
|
|
1473
|
-
} else if ((
|
|
1474
|
-
throw new
|
|
1487
|
+
if (i instanceof Q) {
|
|
1488
|
+
const o = (s = i.response) == null ? void 0 : s.data;
|
|
1489
|
+
if (typeof (o == null ? void 0 : o.message) == "string") {
|
|
1490
|
+
const c = o.message.toLowerCase();
|
|
1491
|
+
throw c == "invalid signature" ? new Ce() : c == "address in use" ? new Re(t) : c == "code in use" ? new Oe(n) : new Error(c);
|
|
1492
|
+
} else if ((o == null ? void 0 : o.message) instanceof Array)
|
|
1493
|
+
throw new Ae(o.message);
|
|
1475
1494
|
}
|
|
1476
1495
|
throw i;
|
|
1477
1496
|
}
|
|
1478
1497
|
}
|
|
1498
|
+
async isCodeFree(t) {
|
|
1499
|
+
var n;
|
|
1500
|
+
try {
|
|
1501
|
+
return await this.httpClient.get(`/affiliates/codes/${t}`), !1;
|
|
1502
|
+
} catch (r) {
|
|
1503
|
+
return r instanceof Q && ((n = r.response) == null ? void 0 : n.status) === 404 ? !0 : (console.error("Fuul SDK: Could not check affiliate code", r), !1);
|
|
1504
|
+
}
|
|
1505
|
+
}
|
|
1479
1506
|
async getCode(t) {
|
|
1480
1507
|
try {
|
|
1481
|
-
|
|
1482
|
-
return n.status !== 200 ? null : n.data.code;
|
|
1508
|
+
return (await this.httpClient.get(`/affiliates/${t}`)).data.code;
|
|
1483
1509
|
} catch (n) {
|
|
1484
1510
|
return console.error("Fuul SDK: Could not get affiliate code", n), null;
|
|
1485
1511
|
}
|
|
1486
1512
|
}
|
|
1487
1513
|
}
|
|
1488
|
-
class
|
|
1514
|
+
class wn {
|
|
1489
1515
|
constructor(t) {
|
|
1490
1516
|
S(this, "httpClient");
|
|
1491
1517
|
this.httpClient = t.httpClient;
|
|
@@ -1495,7 +1521,7 @@ class En {
|
|
|
1495
1521
|
return t;
|
|
1496
1522
|
}
|
|
1497
1523
|
}
|
|
1498
|
-
const
|
|
1524
|
+
const Te = "fuul.sent", En = 60;
|
|
1499
1525
|
class gn {
|
|
1500
1526
|
constructor(t) {
|
|
1501
1527
|
S(this, "debug");
|
|
@@ -1510,22 +1536,22 @@ class gn {
|
|
|
1510
1536
|
await this.httpClient.post("events", t), this.debug && console.debug(`Fuul SDK: Sent '${t.name}' event`), this.saveSentEvent(t);
|
|
1511
1537
|
}
|
|
1512
1538
|
isDuplicate(t) {
|
|
1513
|
-
const n = `${
|
|
1539
|
+
const n = `${Te}_${t.name}`, r = localStorage.getItem(n);
|
|
1514
1540
|
if (!r)
|
|
1515
1541
|
return !1;
|
|
1516
1542
|
const s = JSON.parse(r);
|
|
1517
|
-
if (this.getCurrentTimestamp() - s.timestamp >
|
|
1543
|
+
if (this.getCurrentTimestamp() - s.timestamp > En)
|
|
1518
1544
|
return !1;
|
|
1519
|
-
let
|
|
1520
|
-
t.metadata && (
|
|
1545
|
+
let d = !1;
|
|
1546
|
+
t.metadata && (d = s.metadata.tracking_id === t.metadata.tracking_id && s.metadata.project_id === t.metadata.project_id && s.metadata.referrer === t.metadata.referrer && s.metadata.source === t.metadata.source && s.metadata.category === t.metadata.category && s.metadata.title === t.metadata.title && s.metadata.tag === t.metadata.tag && s.user_address === t.user_address && s.signature === t.signature && s.signature_message === t.signature_message);
|
|
1521
1547
|
let u = !1;
|
|
1522
|
-
return t.args && s.args && (u = s.args.page === t.args.page), u &&
|
|
1548
|
+
return t.args && s.args && (u = s.args.page === t.args.page), u && d;
|
|
1523
1549
|
}
|
|
1524
1550
|
getCurrentTimestamp() {
|
|
1525
1551
|
return Date.now() / 1e3;
|
|
1526
1552
|
}
|
|
1527
1553
|
saveSentEvent(t) {
|
|
1528
|
-
const n = `${
|
|
1554
|
+
const n = `${Te}_${t.name}`, r = this.getCurrentTimestamp(), s = { ...t, timestamp: r };
|
|
1529
1555
|
localStorage.setItem(n, JSON.stringify(s));
|
|
1530
1556
|
}
|
|
1531
1557
|
}
|
|
@@ -1533,11 +1559,11 @@ class Sn {
|
|
|
1533
1559
|
constructor(t) {
|
|
1534
1560
|
S(this, "client");
|
|
1535
1561
|
S(this, "queryParams");
|
|
1536
|
-
this.client =
|
|
1562
|
+
this.client = We.create({
|
|
1537
1563
|
...t,
|
|
1538
1564
|
headers: {
|
|
1539
1565
|
Authorization: `Bearer ${t.apiKey}`,
|
|
1540
|
-
"X-Fuul-Sdk-Version": "3.
|
|
1566
|
+
"X-Fuul-Sdk-Version": "3.3.0"
|
|
1541
1567
|
}
|
|
1542
1568
|
}), this.queryParams = t.queryParams ? this.buildQueryParams(t.queryParams) : "";
|
|
1543
1569
|
}
|
|
@@ -1561,7 +1587,7 @@ class Sn {
|
|
|
1561
1587
|
}
|
|
1562
1588
|
}
|
|
1563
1589
|
let bn = (e = 21) => crypto.getRandomValues(new Uint8Array(e)).reduce((t, n) => (n &= 63, n < 36 ? t += n.toString(36) : n < 62 ? t += (n - 26).toString(36).toUpperCase() : n > 62 ? t += "-" : t += "_", t), "");
|
|
1564
|
-
const An = "fuul.tracking_id", Rn = ["google.com", "bing.com", "yahoo.com"], On = () =>
|
|
1590
|
+
const An = "fuul.tracking_id", Rn = ["google.com", "bing.com", "yahoo.com"], On = () => Fn(An, () => bn()), Cn = () => T("af") || T("referrer"), Tn = () => document.referrer, Pn = () => Dn(), Nn = () => T("category"), _n = () => T("title"), xn = () => T("tag"), Fn = (e, t) => {
|
|
1565
1591
|
const n = localStorage.getItem(e);
|
|
1566
1592
|
if (n)
|
|
1567
1593
|
return n;
|
|
@@ -1569,8 +1595,8 @@ const An = "fuul.tracking_id", Rn = ["google.com", "bing.com", "yahoo.com"], On
|
|
|
1569
1595
|
const r = t();
|
|
1570
1596
|
return r ? localStorage.setItem(e, r) : localStorage.removeItem(e), r;
|
|
1571
1597
|
}
|
|
1572
|
-
},
|
|
1573
|
-
const e =
|
|
1598
|
+
}, T = (e) => new URLSearchParams(window.location.search).get(e), Dn = () => {
|
|
1599
|
+
const e = T("source"), t = T("af") || T("referrer");
|
|
1574
1600
|
if (e)
|
|
1575
1601
|
return e;
|
|
1576
1602
|
if (t)
|
|
@@ -1585,79 +1611,90 @@ const An = "fuul.tracking_id", Rn = ["google.com", "bing.com", "yahoo.com"], On
|
|
|
1585
1611
|
return null;
|
|
1586
1612
|
}
|
|
1587
1613
|
}, Ln = "https://api.fuul.xyz/api/v1/";
|
|
1588
|
-
let
|
|
1614
|
+
let U = !1, re = !1, le, j, Ge, F, Xe;
|
|
1589
1615
|
function Bn(e) {
|
|
1590
|
-
|
|
1616
|
+
U = !!e.debug, !re && (le = e.apiKey, Jn(), j = vn(
|
|
1591
1617
|
e.baseApiUrl ?? Ln,
|
|
1592
1618
|
e.defaultQueryParams ?? {}
|
|
1593
|
-
),
|
|
1619
|
+
), Ge = new wn({ httpClient: j, debug: U }), Xe = new gn({ httpClient: j, debug: U }), F = new yn({ httpClient: j, debug: U }), re = !0, U && console.debug("Fuul SDK: init() complete"));
|
|
1594
1620
|
}
|
|
1595
|
-
function
|
|
1596
|
-
if (!
|
|
1621
|
+
function Ye() {
|
|
1622
|
+
if (!re)
|
|
1597
1623
|
throw new Error("Fuul SDK: You need to call init() to initialize the library before using any methods");
|
|
1598
1624
|
}
|
|
1599
|
-
async function
|
|
1600
|
-
|
|
1601
|
-
const r = On(), s =
|
|
1625
|
+
async function fe(e, t, n) {
|
|
1626
|
+
Ye(), Kn();
|
|
1627
|
+
const r = On(), s = Cn(), i = Pn(), o = Nn(), c = _n(), d = xn(), u = Tn(), l = {
|
|
1602
1628
|
name: e,
|
|
1603
1629
|
args: t || {},
|
|
1604
1630
|
metadata: {
|
|
1605
1631
|
tracking_id: r ?? ""
|
|
1606
1632
|
}
|
|
1607
1633
|
};
|
|
1608
|
-
n != null && n.address && (l.user_address = n.address), n != null && n.signature && (l.signature = n == null ? void 0 : n.signature, l.signature_message = n == null ? void 0 : n.message), s && (l.metadata.referrer = s, l.metadata.affiliate_id = s), u && (l.metadata.referrer_url = u),
|
|
1634
|
+
n != null && n.address && (l.user_address = n.address), n != null && n.signature && (l.signature = n == null ? void 0 : n.signature, l.signature_message = n == null ? void 0 : n.message), s && (l.metadata.referrer = s, l.metadata.affiliate_id = s), u && (l.metadata.referrer_url = u), i && (l.metadata.source = i), o && (l.metadata.category = o), c && (l.metadata.title = c), d && (l.metadata.tag = d), Xe.sendEvent(l);
|
|
1609
1635
|
}
|
|
1610
1636
|
async function In(e) {
|
|
1611
|
-
await
|
|
1637
|
+
await fe("pageview", {
|
|
1612
1638
|
page: e ?? document.location.pathname,
|
|
1613
1639
|
locationOrigin: document.location.origin
|
|
1614
1640
|
});
|
|
1615
1641
|
}
|
|
1616
1642
|
async function kn(e) {
|
|
1617
|
-
await
|
|
1643
|
+
await fe("connect_wallet", {}, e);
|
|
1618
1644
|
}
|
|
1619
1645
|
async function jn(e, t, n) {
|
|
1620
|
-
|
|
1621
|
-
await M.create(e, t, n, r);
|
|
1646
|
+
await F.create(e, t, n);
|
|
1622
1647
|
}
|
|
1623
1648
|
async function qn(e, t, n) {
|
|
1624
|
-
|
|
1649
|
+
await F.update(e, t, n);
|
|
1650
|
+
}
|
|
1651
|
+
async function Hn(e) {
|
|
1652
|
+
return await F.getCode(e);
|
|
1653
|
+
}
|
|
1654
|
+
async function $n(e) {
|
|
1655
|
+
return await F.isCodeFree(e);
|
|
1656
|
+
}
|
|
1657
|
+
async function zn(e, t, n) {
|
|
1658
|
+
const r = await F.getCode(t), s = new URLSearchParams({
|
|
1625
1659
|
af: r ?? t
|
|
1626
1660
|
});
|
|
1627
1661
|
return n != null && n.title && s.append("af_title", n.title), n != null && n.format && s.append("af_format", n.format), n != null && n.place && s.append("af_place", n.place), `${e}?${s.toString()}`;
|
|
1628
1662
|
}
|
|
1629
|
-
async function
|
|
1630
|
-
return
|
|
1631
|
-
}
|
|
1632
|
-
async function Hn() {
|
|
1633
|
-
return ve(), Ke.getAll();
|
|
1663
|
+
async function Vn() {
|
|
1664
|
+
return Ye(), Ge.getAll();
|
|
1634
1665
|
}
|
|
1635
|
-
function
|
|
1666
|
+
function Kn() {
|
|
1636
1667
|
if (typeof window > "u" || typeof document > "u")
|
|
1637
1668
|
throw new Error("Fuul SDK: Browser context required");
|
|
1638
1669
|
}
|
|
1639
|
-
function
|
|
1640
|
-
if (!
|
|
1670
|
+
function Jn() {
|
|
1671
|
+
if (!le)
|
|
1641
1672
|
throw new Error("Fuul SDK: Invalid API key");
|
|
1642
1673
|
}
|
|
1643
|
-
function
|
|
1674
|
+
function vn(e, t) {
|
|
1644
1675
|
return new Sn({
|
|
1645
1676
|
baseURL: e,
|
|
1646
1677
|
timeout: 1e4,
|
|
1647
|
-
apiKey:
|
|
1678
|
+
apiKey: le,
|
|
1648
1679
|
queryParams: t
|
|
1649
1680
|
});
|
|
1650
1681
|
}
|
|
1651
|
-
const
|
|
1682
|
+
const lr = {
|
|
1652
1683
|
init: Bn,
|
|
1653
|
-
sendEvent:
|
|
1684
|
+
sendEvent: fe,
|
|
1654
1685
|
sendPageview: In,
|
|
1655
1686
|
sendConnectWallet: kn,
|
|
1656
|
-
generateTrackingLink:
|
|
1657
|
-
getConversions:
|
|
1687
|
+
generateTrackingLink: zn,
|
|
1688
|
+
getConversions: Vn,
|
|
1658
1689
|
createAffiliateCode: jn,
|
|
1659
|
-
|
|
1690
|
+
updateAffiliateCode: qn,
|
|
1691
|
+
getAffiliateCode: Hn,
|
|
1692
|
+
isAffiliateCodeFree: $n
|
|
1660
1693
|
};
|
|
1661
1694
|
export {
|
|
1662
|
-
|
|
1695
|
+
Re as AddressInUseError,
|
|
1696
|
+
Oe as CodeInUseError,
|
|
1697
|
+
lr as Fuul,
|
|
1698
|
+
Ce as InvalidSignatureError,
|
|
1699
|
+
Ae as ValidationError
|
|
1663
1700
|
};
|