@fuul/sdk 1.0.3 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fuul-sdk.mjs +237 -238
- package/dist/fuul-sdk.umd.js +3 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/infrastructure/conversions/dtos.d.ts +5 -2
- package/dist/infrastructure/conversions/dtos.d.ts.map +1 -1
- package/dist/utils/localStorage.d.ts.map +1 -1
- package/package.json +4 -3
package/dist/fuul-sdk.mjs
CHANGED
|
@@ -1,54 +1,43 @@
|
|
|
1
1
|
var Ve = Object.defineProperty;
|
|
2
2
|
var We = (e, t, n) => t in e ? Ve(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var b = (e, t, n) => (We(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}, at = () => {
|
|
16
|
-
const e = new URLSearchParams(window.location.search), t = e.get("source"), n = e.get("referrer");
|
|
17
|
-
if (!t)
|
|
18
|
-
if (n)
|
|
19
|
-
localStorage.setItem(I, "affiliate"), localStorage.setItem(M, "affiliate"), localStorage.setItem(K, n);
|
|
20
|
-
else {
|
|
21
|
-
const r = document.referrer;
|
|
22
|
-
localStorage.setItem(M, r), localStorage.setItem(K, r), Qe.includes(r) ? localStorage.setItem(I, "organic") : localStorage.setItem(I, "direct");
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
function _e(e, t) {
|
|
4
|
+
class Ye {
|
|
5
|
+
constructor(t) {
|
|
6
|
+
b(this, "httpClient");
|
|
7
|
+
this.httpClient = t;
|
|
8
|
+
}
|
|
9
|
+
async getAll() {
|
|
10
|
+
const { data: t } = await this.httpClient.get("conversions");
|
|
11
|
+
return t;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
function Se(e, t) {
|
|
26
15
|
return function() {
|
|
27
16
|
return e.apply(t, arguments);
|
|
28
17
|
};
|
|
29
18
|
}
|
|
30
|
-
const { toString:
|
|
31
|
-
const n =
|
|
19
|
+
const { toString: ge } = Object.prototype, { getPrototypeOf: ne } = Object, re = ((e) => (t) => {
|
|
20
|
+
const n = ge.call(t);
|
|
32
21
|
return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
|
|
33
|
-
})(/* @__PURE__ */ Object.create(null)), O = (e) => (e = e.toLowerCase(), (t) => re(t) === e), $ = (e) => (t) => typeof t === e, { isArray: C } = Array,
|
|
34
|
-
function
|
|
35
|
-
return e !== null && !
|
|
22
|
+
})(/* @__PURE__ */ Object.create(null)), O = (e) => (e = e.toLowerCase(), (t) => re(t) === e), $ = (e) => (t) => typeof t === e, { isArray: C } = Array, F = $("undefined");
|
|
23
|
+
function Ge(e) {
|
|
24
|
+
return e !== null && !F(e) && e.constructor !== null && !F(e.constructor) && _(e.constructor.isBuffer) && e.constructor.isBuffer(e);
|
|
36
25
|
}
|
|
37
|
-
const
|
|
38
|
-
function
|
|
26
|
+
const Re = O("ArrayBuffer");
|
|
27
|
+
function Qe(e) {
|
|
39
28
|
let t;
|
|
40
|
-
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer &&
|
|
29
|
+
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && Re(e.buffer), t;
|
|
41
30
|
}
|
|
42
|
-
const
|
|
31
|
+
const Xe = $("string"), _ = $("function"), be = $("number"), se = (e) => e !== null && typeof e == "object", Ze = (e) => e === !0 || e === !1, k = (e) => {
|
|
43
32
|
if (re(e) !== "object")
|
|
44
33
|
return !1;
|
|
45
34
|
const t = ne(e);
|
|
46
35
|
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Symbol.toStringTag in e) && !(Symbol.iterator in e);
|
|
47
|
-
},
|
|
36
|
+
}, et = O("Date"), tt = O("File"), nt = O("Blob"), rt = O("FileList"), st = (e) => se(e) && _(e.pipe), ot = (e) => {
|
|
48
37
|
const t = "[object FormData]";
|
|
49
|
-
return e && (typeof FormData == "function" && e instanceof FormData ||
|
|
50
|
-
},
|
|
51
|
-
function
|
|
38
|
+
return e && (typeof FormData == "function" && e instanceof FormData || ge.call(e) === t || _(e.toString) && e.toString() === t);
|
|
39
|
+
}, it = O("URLSearchParams"), at = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
40
|
+
function D(e, t, { allOwnKeys: n = !1 } = {}) {
|
|
52
41
|
if (e === null || typeof e > "u")
|
|
53
42
|
return;
|
|
54
43
|
let r, s;
|
|
@@ -62,7 +51,7 @@ function L(e, t, { allOwnKeys: n = !1 } = {}) {
|
|
|
62
51
|
u = o[r], t.call(null, e[u], u, e);
|
|
63
52
|
}
|
|
64
53
|
}
|
|
65
|
-
function
|
|
54
|
+
function Ae(e, t) {
|
|
66
55
|
t = t.toLowerCase();
|
|
67
56
|
const n = Object.keys(e);
|
|
68
57
|
let r = n.length, s;
|
|
@@ -71,23 +60,23 @@ function xe(e, t) {
|
|
|
71
60
|
return s;
|
|
72
61
|
return null;
|
|
73
62
|
}
|
|
74
|
-
const
|
|
63
|
+
const Oe = (() => typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global)(), Te = (e) => !F(e) && e !== Oe;
|
|
75
64
|
function X() {
|
|
76
|
-
const { caseless: e } =
|
|
77
|
-
const o = e &&
|
|
65
|
+
const { caseless: e } = Te(this) && this || {}, t = {}, n = (r, s) => {
|
|
66
|
+
const o = e && Ae(t, s) || s;
|
|
78
67
|
k(t[o]) && k(r) ? t[o] = X(t[o], r) : k(r) ? t[o] = X({}, r) : C(r) ? t[o] = r.slice() : t[o] = r;
|
|
79
68
|
};
|
|
80
69
|
for (let r = 0, s = arguments.length; r < s; r++)
|
|
81
|
-
arguments[r] &&
|
|
70
|
+
arguments[r] && D(arguments[r], n);
|
|
82
71
|
return t;
|
|
83
72
|
}
|
|
84
|
-
const
|
|
85
|
-
n && _(s) ? e[o] =
|
|
86
|
-
}, { allOwnKeys: r }), e),
|
|
73
|
+
const ct = (e, t, n, { allOwnKeys: r } = {}) => (D(t, (s, o) => {
|
|
74
|
+
n && _(s) ? e[o] = Se(s, n) : e[o] = s;
|
|
75
|
+
}, { allOwnKeys: r }), e), ut = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), lt = (e, t, n, r) => {
|
|
87
76
|
e.prototype = Object.create(t.prototype, r), e.prototype.constructor = e, Object.defineProperty(e, "super", {
|
|
88
77
|
value: t.prototype
|
|
89
78
|
}), n && Object.assign(e.prototype, n);
|
|
90
|
-
},
|
|
79
|
+
}, ft = (e, t, n, r) => {
|
|
91
80
|
let s, o, i;
|
|
92
81
|
const u = {};
|
|
93
82
|
if (t = t || {}, e == null)
|
|
@@ -98,47 +87,47 @@ const gt = (e, t, n, { allOwnKeys: r } = {}) => (L(t, (s, o) => {
|
|
|
98
87
|
e = n !== !1 && ne(e);
|
|
99
88
|
} while (e && (!n || n(e, t)) && e !== Object.prototype);
|
|
100
89
|
return t;
|
|
101
|
-
},
|
|
90
|
+
}, dt = (e, t, n) => {
|
|
102
91
|
e = String(e), (n === void 0 || n > e.length) && (n = e.length), n -= t.length;
|
|
103
92
|
const r = e.indexOf(t, n);
|
|
104
93
|
return r !== -1 && r === n;
|
|
105
|
-
},
|
|
94
|
+
}, ht = (e) => {
|
|
106
95
|
if (!e)
|
|
107
96
|
return null;
|
|
108
97
|
if (C(e))
|
|
109
98
|
return e;
|
|
110
99
|
let t = e.length;
|
|
111
|
-
if (!
|
|
100
|
+
if (!be(t))
|
|
112
101
|
return null;
|
|
113
102
|
const n = new Array(t);
|
|
114
103
|
for (; t-- > 0; )
|
|
115
104
|
n[t] = e[t];
|
|
116
105
|
return n;
|
|
117
|
-
},
|
|
106
|
+
}, pt = ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && ne(Uint8Array)), mt = (e, t) => {
|
|
118
107
|
const r = (e && e[Symbol.iterator]).call(e);
|
|
119
108
|
let s;
|
|
120
109
|
for (; (s = r.next()) && !s.done; ) {
|
|
121
110
|
const o = s.value;
|
|
122
111
|
t.call(e, o[0], o[1]);
|
|
123
112
|
}
|
|
124
|
-
},
|
|
113
|
+
}, yt = (e, t) => {
|
|
125
114
|
let n;
|
|
126
115
|
const r = [];
|
|
127
116
|
for (; (n = e.exec(t)) !== null; )
|
|
128
117
|
r.push(n);
|
|
129
118
|
return r;
|
|
130
|
-
},
|
|
119
|
+
}, Et = O("HTMLFormElement"), wt = (e) => e.toLowerCase().replace(
|
|
131
120
|
/[-_\s]([a-z\d])(\w*)/g,
|
|
132
121
|
function(n, r, s) {
|
|
133
122
|
return r.toUpperCase() + s;
|
|
134
123
|
}
|
|
135
|
-
), ue = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype),
|
|
124
|
+
), ue = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), St = O("RegExp"), _e = (e, t) => {
|
|
136
125
|
const n = Object.getOwnPropertyDescriptors(e), r = {};
|
|
137
|
-
|
|
126
|
+
D(n, (s, o) => {
|
|
138
127
|
t(s, o, e) !== !1 && (r[o] = s);
|
|
139
128
|
}), Object.defineProperties(e, r);
|
|
140
|
-
},
|
|
141
|
-
|
|
129
|
+
}, gt = (e) => {
|
|
130
|
+
_e(e, (t, n) => {
|
|
142
131
|
if (_(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
|
|
143
132
|
return !1;
|
|
144
133
|
const r = e[n];
|
|
@@ -152,29 +141,29 @@ const gt = (e, t, n, { allOwnKeys: r } = {}) => (L(t, (s, o) => {
|
|
|
152
141
|
});
|
|
153
142
|
}
|
|
154
143
|
});
|
|
155
|
-
},
|
|
144
|
+
}, Rt = (e, t) => {
|
|
156
145
|
const n = {}, r = (s) => {
|
|
157
146
|
s.forEach((o) => {
|
|
158
147
|
n[o] = !0;
|
|
159
148
|
});
|
|
160
149
|
};
|
|
161
150
|
return C(e) ? r(e) : r(String(e).split(t)), n;
|
|
162
|
-
},
|
|
163
|
-
},
|
|
151
|
+
}, bt = () => {
|
|
152
|
+
}, At = (e, t) => (e = +e, Number.isFinite(e) ? e : t), W = "abcdefghijklmnopqrstuvwxyz", le = "0123456789", Pe = {
|
|
164
153
|
DIGIT: le,
|
|
165
154
|
ALPHA: W,
|
|
166
155
|
ALPHA_DIGIT: W + W.toUpperCase() + le
|
|
167
|
-
},
|
|
156
|
+
}, Ot = (e = 16, t = Pe.ALPHA_DIGIT) => {
|
|
168
157
|
let n = "";
|
|
169
158
|
const { length: r } = t;
|
|
170
159
|
for (; e--; )
|
|
171
160
|
n += t[Math.random() * r | 0];
|
|
172
161
|
return n;
|
|
173
162
|
};
|
|
174
|
-
function
|
|
163
|
+
function Tt(e) {
|
|
175
164
|
return !!(e && _(e.append) && e[Symbol.toStringTag] === "FormData" && e[Symbol.iterator]);
|
|
176
165
|
}
|
|
177
|
-
const
|
|
166
|
+
const _t = (e) => {
|
|
178
167
|
const t = new Array(10), n = (r, s) => {
|
|
179
168
|
if (se(r)) {
|
|
180
169
|
if (t.indexOf(r) >= 0)
|
|
@@ -182,9 +171,9 @@ const jt = (e) => {
|
|
|
182
171
|
if (!("toJSON" in r)) {
|
|
183
172
|
t[s] = r;
|
|
184
173
|
const o = C(r) ? [] : {};
|
|
185
|
-
return
|
|
174
|
+
return D(r, (i, u) => {
|
|
186
175
|
const d = n(i, s + 1);
|
|
187
|
-
!
|
|
176
|
+
!F(d) && (o[u] = d);
|
|
188
177
|
}), t[s] = void 0, o;
|
|
189
178
|
}
|
|
190
179
|
}
|
|
@@ -193,55 +182,55 @@ const jt = (e) => {
|
|
|
193
182
|
return n(e, 0);
|
|
194
183
|
}, a = {
|
|
195
184
|
isArray: C,
|
|
196
|
-
isArrayBuffer:
|
|
197
|
-
isBuffer:
|
|
198
|
-
isFormData:
|
|
199
|
-
isArrayBufferView:
|
|
200
|
-
isString:
|
|
201
|
-
isNumber:
|
|
202
|
-
isBoolean:
|
|
185
|
+
isArrayBuffer: Re,
|
|
186
|
+
isBuffer: Ge,
|
|
187
|
+
isFormData: ot,
|
|
188
|
+
isArrayBufferView: Qe,
|
|
189
|
+
isString: Xe,
|
|
190
|
+
isNumber: be,
|
|
191
|
+
isBoolean: Ze,
|
|
203
192
|
isObject: se,
|
|
204
193
|
isPlainObject: k,
|
|
205
|
-
isUndefined:
|
|
206
|
-
isDate:
|
|
207
|
-
isFile:
|
|
208
|
-
isBlob:
|
|
209
|
-
isRegExp:
|
|
194
|
+
isUndefined: F,
|
|
195
|
+
isDate: et,
|
|
196
|
+
isFile: tt,
|
|
197
|
+
isBlob: nt,
|
|
198
|
+
isRegExp: St,
|
|
210
199
|
isFunction: _,
|
|
211
|
-
isStream:
|
|
212
|
-
isURLSearchParams:
|
|
213
|
-
isTypedArray:
|
|
214
|
-
isFileList:
|
|
215
|
-
forEach:
|
|
200
|
+
isStream: st,
|
|
201
|
+
isURLSearchParams: it,
|
|
202
|
+
isTypedArray: pt,
|
|
203
|
+
isFileList: rt,
|
|
204
|
+
forEach: D,
|
|
216
205
|
merge: X,
|
|
217
|
-
extend:
|
|
218
|
-
trim:
|
|
219
|
-
stripBOM:
|
|
220
|
-
inherits:
|
|
221
|
-
toFlatObject:
|
|
206
|
+
extend: ct,
|
|
207
|
+
trim: at,
|
|
208
|
+
stripBOM: ut,
|
|
209
|
+
inherits: lt,
|
|
210
|
+
toFlatObject: ft,
|
|
222
211
|
kindOf: re,
|
|
223
212
|
kindOfTest: O,
|
|
224
|
-
endsWith:
|
|
225
|
-
toArray:
|
|
226
|
-
forEachEntry:
|
|
227
|
-
matchAll:
|
|
228
|
-
isHTMLForm:
|
|
213
|
+
endsWith: dt,
|
|
214
|
+
toArray: ht,
|
|
215
|
+
forEachEntry: mt,
|
|
216
|
+
matchAll: yt,
|
|
217
|
+
isHTMLForm: Et,
|
|
229
218
|
hasOwnProperty: ue,
|
|
230
219
|
hasOwnProp: ue,
|
|
231
220
|
// an alias to avoid ESLint no-prototype-builtins detection
|
|
232
|
-
reduceDescriptors:
|
|
233
|
-
freezeMethods:
|
|
234
|
-
toObjectSet:
|
|
235
|
-
toCamelCase:
|
|
236
|
-
noop:
|
|
237
|
-
toFiniteNumber:
|
|
238
|
-
findKey:
|
|
239
|
-
global:
|
|
240
|
-
isContextDefined:
|
|
241
|
-
ALPHABET:
|
|
242
|
-
generateString:
|
|
243
|
-
isSpecCompliantForm:
|
|
244
|
-
toJSONObject:
|
|
221
|
+
reduceDescriptors: _e,
|
|
222
|
+
freezeMethods: gt,
|
|
223
|
+
toObjectSet: Rt,
|
|
224
|
+
toCamelCase: wt,
|
|
225
|
+
noop: bt,
|
|
226
|
+
toFiniteNumber: At,
|
|
227
|
+
findKey: Ae,
|
|
228
|
+
global: Oe,
|
|
229
|
+
isContextDefined: Te,
|
|
230
|
+
ALPHABET: Pe,
|
|
231
|
+
generateString: Ot,
|
|
232
|
+
isSpecCompliantForm: Tt,
|
|
233
|
+
toJSONObject: _t
|
|
245
234
|
};
|
|
246
235
|
function m(e, t, n, r, s) {
|
|
247
236
|
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);
|
|
@@ -267,7 +256,7 @@ a.inherits(m, Error, {
|
|
|
267
256
|
};
|
|
268
257
|
}
|
|
269
258
|
});
|
|
270
|
-
const
|
|
259
|
+
const Ne = m.prototype, Ce = {};
|
|
271
260
|
[
|
|
272
261
|
"ERR_BAD_OPTION_VALUE",
|
|
273
262
|
"ERR_BAD_OPTION",
|
|
@@ -283,32 +272,32 @@ const Ue = m.prototype, Be = {};
|
|
|
283
272
|
"ERR_INVALID_URL"
|
|
284
273
|
// eslint-disable-next-line func-names
|
|
285
274
|
].forEach((e) => {
|
|
286
|
-
|
|
275
|
+
Ce[e] = { value: e };
|
|
287
276
|
});
|
|
288
|
-
Object.defineProperties(m,
|
|
289
|
-
Object.defineProperty(
|
|
277
|
+
Object.defineProperties(m, Ce);
|
|
278
|
+
Object.defineProperty(Ne, "isAxiosError", { value: !0 });
|
|
290
279
|
m.from = (e, t, n, r, s, o) => {
|
|
291
|
-
const i = Object.create(
|
|
280
|
+
const i = Object.create(Ne);
|
|
292
281
|
return a.toFlatObject(e, i, function(d) {
|
|
293
282
|
return d !== Error.prototype;
|
|
294
283
|
}, (u) => u !== "isAxiosError"), m.call(i, e.message, t, n, r, s), i.cause = e, i.name = e.name, o && Object.assign(i, o), i;
|
|
295
284
|
};
|
|
296
|
-
const
|
|
285
|
+
const Pt = null;
|
|
297
286
|
function Z(e) {
|
|
298
287
|
return a.isPlainObject(e) || a.isArray(e);
|
|
299
288
|
}
|
|
300
|
-
function
|
|
289
|
+
function xe(e) {
|
|
301
290
|
return a.endsWith(e, "[]") ? e.slice(0, -2) : e;
|
|
302
291
|
}
|
|
303
292
|
function fe(e, t, n) {
|
|
304
293
|
return e ? e.concat(t).map(function(s, o) {
|
|
305
|
-
return s =
|
|
294
|
+
return s = xe(s), !n && o ? "[" + s + "]" : s;
|
|
306
295
|
}).join(n ? "." : "") : t;
|
|
307
296
|
}
|
|
308
|
-
function
|
|
297
|
+
function Nt(e) {
|
|
309
298
|
return a.isArray(e) && !e.some(Z);
|
|
310
299
|
}
|
|
311
|
-
const
|
|
300
|
+
const Ct = a.toFlatObject(a, {}, null, function(t) {
|
|
312
301
|
return /^is[A-Z]/.test(t);
|
|
313
302
|
});
|
|
314
303
|
function z(e, t, n) {
|
|
@@ -338,8 +327,8 @@ function z(e, t, n) {
|
|
|
338
327
|
if (f && !R && typeof f == "object") {
|
|
339
328
|
if (a.endsWith(p, "{}"))
|
|
340
329
|
p = r ? p : p.slice(0, -2), f = JSON.stringify(f);
|
|
341
|
-
else if (a.isArray(f) &&
|
|
342
|
-
return p =
|
|
330
|
+
else if (a.isArray(f) && Nt(f) || (a.isFileList(f) || a.endsWith(p, "[]")) && (S = a.toArray(f)))
|
|
331
|
+
return p = xe(p), S.forEach(function(B, Je) {
|
|
343
332
|
!(a.isUndefined(B) || B === null) && t.append(
|
|
344
333
|
// eslint-disable-next-line no-nested-ternary
|
|
345
334
|
i === !0 ? fe([p], Je, o) : i === null ? p : p + "[]",
|
|
@@ -349,7 +338,7 @@ function z(e, t, n) {
|
|
|
349
338
|
}
|
|
350
339
|
return Z(f) ? !0 : (t.append(fe(R, p, o), c(f)), !1);
|
|
351
340
|
}
|
|
352
|
-
const h = [], E = Object.assign(
|
|
341
|
+
const h = [], E = Object.assign(Ct, {
|
|
353
342
|
defaultVisitor: l,
|
|
354
343
|
convertValue: c,
|
|
355
344
|
isVisitable: Z
|
|
@@ -390,11 +379,11 @@ function de(e) {
|
|
|
390
379
|
function oe(e, t) {
|
|
391
380
|
this._pairs = [], e && z(e, this, t);
|
|
392
381
|
}
|
|
393
|
-
const
|
|
394
|
-
|
|
382
|
+
const Ie = oe.prototype;
|
|
383
|
+
Ie.append = function(t, n) {
|
|
395
384
|
this._pairs.push([t, n]);
|
|
396
385
|
};
|
|
397
|
-
|
|
386
|
+
Ie.toString = function(t) {
|
|
398
387
|
const n = t ? function(r) {
|
|
399
388
|
return t.call(this, r, de);
|
|
400
389
|
} : de;
|
|
@@ -402,13 +391,13 @@ je.toString = function(t) {
|
|
|
402
391
|
return n(s[0]) + "=" + n(s[1]);
|
|
403
392
|
}, "").join("&");
|
|
404
393
|
};
|
|
405
|
-
function
|
|
394
|
+
function xt(e) {
|
|
406
395
|
return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
|
|
407
396
|
}
|
|
408
|
-
function
|
|
397
|
+
function Fe(e, t, n) {
|
|
409
398
|
if (!t)
|
|
410
399
|
return e;
|
|
411
|
-
const r = n && n.encode ||
|
|
400
|
+
const r = n && n.encode || xt, s = n && n.serialize;
|
|
412
401
|
let o;
|
|
413
402
|
if (s ? o = s(t, n) : o = a.isURLSearchParams(t) ? t.toString() : new oe(t, n).toString(r), o) {
|
|
414
403
|
const i = e.indexOf("#");
|
|
@@ -416,7 +405,7 @@ function qe(e, t, n) {
|
|
|
416
405
|
}
|
|
417
406
|
return e;
|
|
418
407
|
}
|
|
419
|
-
class
|
|
408
|
+
class It {
|
|
420
409
|
constructor() {
|
|
421
410
|
this.handlers = [];
|
|
422
411
|
}
|
|
@@ -470,36 +459,36 @@ class vt {
|
|
|
470
459
|
});
|
|
471
460
|
}
|
|
472
461
|
}
|
|
473
|
-
const he =
|
|
462
|
+
const he = It, Ue = {
|
|
474
463
|
silentJSONParsing: !0,
|
|
475
464
|
forcedJSONParsing: !0,
|
|
476
465
|
clarifyTimeoutError: !1
|
|
477
|
-
},
|
|
466
|
+
}, Ft = typeof URLSearchParams < "u" ? URLSearchParams : oe, Ut = typeof FormData < "u" ? FormData : null, Dt = typeof Blob < "u" ? Blob : null, Lt = (() => {
|
|
478
467
|
let e;
|
|
479
468
|
return typeof navigator < "u" && ((e = navigator.product) === "ReactNative" || e === "NativeScript" || e === "NS") ? !1 : typeof window < "u" && typeof document < "u";
|
|
480
|
-
})(),
|
|
469
|
+
})(), Bt = (() => typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
|
|
481
470
|
self instanceof WorkerGlobalScope && typeof self.importScripts == "function")(), g = {
|
|
482
471
|
isBrowser: !0,
|
|
483
472
|
classes: {
|
|
484
|
-
URLSearchParams:
|
|
485
|
-
FormData:
|
|
486
|
-
Blob:
|
|
473
|
+
URLSearchParams: Ft,
|
|
474
|
+
FormData: Ut,
|
|
475
|
+
Blob: Dt
|
|
487
476
|
},
|
|
488
|
-
isStandardBrowserEnv:
|
|
489
|
-
isStandardBrowserWebWorkerEnv:
|
|
477
|
+
isStandardBrowserEnv: Lt,
|
|
478
|
+
isStandardBrowserWebWorkerEnv: Bt,
|
|
490
479
|
protocols: ["http", "https", "file", "blob", "url", "data"]
|
|
491
480
|
};
|
|
492
|
-
function
|
|
481
|
+
function kt(e, t) {
|
|
493
482
|
return z(e, new g.classes.URLSearchParams(), Object.assign({
|
|
494
483
|
visitor: function(n, r, s, o) {
|
|
495
484
|
return g.isNode && a.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : o.defaultVisitor.apply(this, arguments);
|
|
496
485
|
}
|
|
497
486
|
}, t));
|
|
498
487
|
}
|
|
499
|
-
function
|
|
488
|
+
function jt(e) {
|
|
500
489
|
return a.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
|
|
501
490
|
}
|
|
502
|
-
function
|
|
491
|
+
function qt(e) {
|
|
503
492
|
const t = {}, n = Object.keys(e);
|
|
504
493
|
let r;
|
|
505
494
|
const s = n.length;
|
|
@@ -508,24 +497,24 @@ function Qt(e) {
|
|
|
508
497
|
o = n[r], t[o] = e[o];
|
|
509
498
|
return t;
|
|
510
499
|
}
|
|
511
|
-
function
|
|
500
|
+
function De(e) {
|
|
512
501
|
function t(n, r, s, o) {
|
|
513
502
|
let i = n[o++];
|
|
514
503
|
const u = Number.isFinite(+i), d = o >= n.length;
|
|
515
|
-
return i = !i && a.isArray(s) ? s.length : i, d ? (a.hasOwnProp(s, i) ? s[i] = [s[i], r] : s[i] = r, !u) : ((!s[i] || !a.isObject(s[i])) && (s[i] = []), t(n, r, s[i], o) && a.isArray(s[i]) && (s[i] =
|
|
504
|
+
return i = !i && a.isArray(s) ? s.length : i, d ? (a.hasOwnProp(s, i) ? s[i] = [s[i], r] : s[i] = r, !u) : ((!s[i] || !a.isObject(s[i])) && (s[i] = []), t(n, r, s[i], o) && a.isArray(s[i]) && (s[i] = qt(s[i])), !u);
|
|
516
505
|
}
|
|
517
506
|
if (a.isFormData(e) && a.isFunction(e.entries)) {
|
|
518
507
|
const n = {};
|
|
519
508
|
return a.forEachEntry(e, (r, s) => {
|
|
520
|
-
t(
|
|
509
|
+
t(jt(r), s, n, 0);
|
|
521
510
|
}), n;
|
|
522
511
|
}
|
|
523
512
|
return null;
|
|
524
513
|
}
|
|
525
|
-
const
|
|
514
|
+
const Ht = {
|
|
526
515
|
"Content-Type": void 0
|
|
527
516
|
};
|
|
528
|
-
function
|
|
517
|
+
function Mt(e, t, n) {
|
|
529
518
|
if (a.isString(e))
|
|
530
519
|
try {
|
|
531
520
|
return (t || JSON.parse)(e), a.trim(e);
|
|
@@ -536,12 +525,12 @@ function Zt(e, t, n) {
|
|
|
536
525
|
return (n || JSON.stringify)(e);
|
|
537
526
|
}
|
|
538
527
|
const J = {
|
|
539
|
-
transitional:
|
|
528
|
+
transitional: Ue,
|
|
540
529
|
adapter: ["xhr", "http"],
|
|
541
530
|
transformRequest: [function(t, n) {
|
|
542
531
|
const r = n.getContentType() || "", s = r.indexOf("application/json") > -1, o = a.isObject(t);
|
|
543
532
|
if (o && a.isHTMLForm(t) && (t = new FormData(t)), a.isFormData(t))
|
|
544
|
-
return s && s ? JSON.stringify(
|
|
533
|
+
return s && s ? JSON.stringify(De(t)) : t;
|
|
545
534
|
if (a.isArrayBuffer(t) || a.isBuffer(t) || a.isStream(t) || a.isFile(t) || a.isBlob(t))
|
|
546
535
|
return t;
|
|
547
536
|
if (a.isArrayBufferView(t))
|
|
@@ -551,7 +540,7 @@ const J = {
|
|
|
551
540
|
let u;
|
|
552
541
|
if (o) {
|
|
553
542
|
if (r.indexOf("application/x-www-form-urlencoded") > -1)
|
|
554
|
-
return
|
|
543
|
+
return kt(t, this.formSerializer).toString();
|
|
555
544
|
if ((u = a.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {
|
|
556
545
|
const d = this.env && this.env.FormData;
|
|
557
546
|
return z(
|
|
@@ -561,7 +550,7 @@ const J = {
|
|
|
561
550
|
);
|
|
562
551
|
}
|
|
563
552
|
}
|
|
564
|
-
return o || s ? (n.setContentType("application/json", !1),
|
|
553
|
+
return o || s ? (n.setContentType("application/json", !1), Mt(t)) : t;
|
|
565
554
|
}],
|
|
566
555
|
transformResponse: [function(t) {
|
|
567
556
|
const n = this.transitional || J.transitional, r = n && n.forcedJSONParsing, s = this.responseType === "json";
|
|
@@ -602,9 +591,9 @@ a.forEach(["delete", "get", "head"], function(t) {
|
|
|
602
591
|
J.headers[t] = {};
|
|
603
592
|
});
|
|
604
593
|
a.forEach(["post", "put", "patch"], function(t) {
|
|
605
|
-
J.headers[t] = a.merge(
|
|
594
|
+
J.headers[t] = a.merge(Ht);
|
|
606
595
|
});
|
|
607
|
-
const ie = J,
|
|
596
|
+
const ie = J, Kt = a.toObjectSet([
|
|
608
597
|
"age",
|
|
609
598
|
"authorization",
|
|
610
599
|
"content-length",
|
|
@@ -622,12 +611,12 @@ const ie = J, en = a.toObjectSet([
|
|
|
622
611
|
"referer",
|
|
623
612
|
"retry-after",
|
|
624
613
|
"user-agent"
|
|
625
|
-
]),
|
|
614
|
+
]), vt = (e) => {
|
|
626
615
|
const t = {};
|
|
627
616
|
let n, r, s;
|
|
628
617
|
return e && e.split(`
|
|
629
618
|
`).forEach(function(i) {
|
|
630
|
-
s = i.indexOf(":"), n = i.substring(0, s).trim().toLowerCase(), r = i.substring(s + 1).trim(), !(!n || t[n] &&
|
|
619
|
+
s = i.indexOf(":"), n = i.substring(0, s).trim().toLowerCase(), r = i.substring(s + 1).trim(), !(!n || t[n] && Kt[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r);
|
|
631
620
|
}), t;
|
|
632
621
|
}, pe = Symbol("internals");
|
|
633
622
|
function x(e) {
|
|
@@ -636,14 +625,14 @@ function x(e) {
|
|
|
636
625
|
function j(e) {
|
|
637
626
|
return e === !1 || e == null ? e : a.isArray(e) ? e.map(j) : String(e);
|
|
638
627
|
}
|
|
639
|
-
function
|
|
628
|
+
function $t(e) {
|
|
640
629
|
const t = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
641
630
|
let r;
|
|
642
631
|
for (; r = n.exec(e); )
|
|
643
632
|
t[r[1]] = r[2];
|
|
644
633
|
return t;
|
|
645
634
|
}
|
|
646
|
-
function
|
|
635
|
+
function zt(e) {
|
|
647
636
|
return /^[-_a-zA-Z]+$/.test(e.trim());
|
|
648
637
|
}
|
|
649
638
|
function Y(e, t, n, r, s) {
|
|
@@ -656,10 +645,10 @@ function Y(e, t, n, r, s) {
|
|
|
656
645
|
return r.test(t);
|
|
657
646
|
}
|
|
658
647
|
}
|
|
659
|
-
function
|
|
648
|
+
function Jt(e) {
|
|
660
649
|
return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, n, r) => n.toUpperCase() + r);
|
|
661
650
|
}
|
|
662
|
-
function
|
|
651
|
+
function Vt(e, t) {
|
|
663
652
|
const n = a.toCamelCase(" " + t);
|
|
664
653
|
["get", "set", "has"].forEach((r) => {
|
|
665
654
|
Object.defineProperty(e, r + n, {
|
|
@@ -684,7 +673,7 @@ class V {
|
|
|
684
673
|
(!h || s[h] === void 0 || c === !0 || c === void 0 && s[h] !== !1) && (s[h || d] = j(u));
|
|
685
674
|
}
|
|
686
675
|
const i = (u, d) => a.forEach(u, (c, l) => o(c, l, d));
|
|
687
|
-
return a.isPlainObject(t) || t instanceof this.constructor ? i(t, n) : a.isString(t) && (t = t.trim()) && !
|
|
676
|
+
return a.isPlainObject(t) || t instanceof this.constructor ? i(t, n) : a.isString(t) && (t = t.trim()) && !zt(t) ? i(vt(t), n) : t != null && o(n, t, r), this;
|
|
688
677
|
}
|
|
689
678
|
get(t, n) {
|
|
690
679
|
if (t = x(t), t) {
|
|
@@ -694,7 +683,7 @@ class V {
|
|
|
694
683
|
if (!n)
|
|
695
684
|
return s;
|
|
696
685
|
if (n === !0)
|
|
697
|
-
return
|
|
686
|
+
return $t(s);
|
|
698
687
|
if (a.isFunction(n))
|
|
699
688
|
return n.call(this, s, r);
|
|
700
689
|
if (a.isRegExp(n))
|
|
@@ -738,7 +727,7 @@ class V {
|
|
|
738
727
|
n[i] = j(s), delete n[o];
|
|
739
728
|
return;
|
|
740
729
|
}
|
|
741
|
-
const u = t ?
|
|
730
|
+
const u = t ? Jt(o) : String(o).trim();
|
|
742
731
|
u !== o && delete n[o], n[u] = j(s), r[u] = !0;
|
|
743
732
|
}), this;
|
|
744
733
|
}
|
|
@@ -774,7 +763,7 @@ class V {
|
|
|
774
763
|
}).accessors, s = this.prototype;
|
|
775
764
|
function o(i) {
|
|
776
765
|
const u = x(i);
|
|
777
|
-
r[u] || (
|
|
766
|
+
r[u] || (Vt(s, i), r[u] = !0);
|
|
778
767
|
}
|
|
779
768
|
return a.isArray(t) ? t.forEach(o) : o(t), this;
|
|
780
769
|
}
|
|
@@ -790,16 +779,16 @@ function G(e, t) {
|
|
|
790
779
|
o = u.call(n, o, s.normalize(), t ? t.status : void 0);
|
|
791
780
|
}), s.normalize(), o;
|
|
792
781
|
}
|
|
793
|
-
function
|
|
782
|
+
function Le(e) {
|
|
794
783
|
return !!(e && e.__CANCEL__);
|
|
795
784
|
}
|
|
796
|
-
function
|
|
785
|
+
function L(e, t, n) {
|
|
797
786
|
m.call(this, e ?? "canceled", m.ERR_CANCELED, t, n), this.name = "CanceledError";
|
|
798
787
|
}
|
|
799
|
-
a.inherits(
|
|
788
|
+
a.inherits(L, m, {
|
|
800
789
|
__CANCEL__: !0
|
|
801
790
|
});
|
|
802
|
-
function
|
|
791
|
+
function Wt(e, t, n) {
|
|
803
792
|
const r = n.config.validateStatus;
|
|
804
793
|
!n.status || !r || r(n.status) ? e(n) : t(new m(
|
|
805
794
|
"Request failed with status code " + n.status,
|
|
@@ -809,7 +798,7 @@ function an(e, t, n) {
|
|
|
809
798
|
n
|
|
810
799
|
));
|
|
811
800
|
}
|
|
812
|
-
const
|
|
801
|
+
const Yt = g.isStandardBrowserEnv ? (
|
|
813
802
|
// Standard browser envs support document.cookie
|
|
814
803
|
function() {
|
|
815
804
|
return {
|
|
@@ -840,16 +829,16 @@ const cn = g.isStandardBrowserEnv ? (
|
|
|
840
829
|
};
|
|
841
830
|
}()
|
|
842
831
|
);
|
|
843
|
-
function
|
|
832
|
+
function Gt(e) {
|
|
844
833
|
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
|
|
845
834
|
}
|
|
846
|
-
function
|
|
835
|
+
function Qt(e, t) {
|
|
847
836
|
return t ? e.replace(/\/+$/, "") + "/" + t.replace(/^\/+/, "") : e;
|
|
848
837
|
}
|
|
849
|
-
function
|
|
850
|
-
return e && !
|
|
838
|
+
function Be(e, t) {
|
|
839
|
+
return e && !Gt(t) ? Qt(e, t) : t;
|
|
851
840
|
}
|
|
852
|
-
const
|
|
841
|
+
const Xt = g.isStandardBrowserEnv ? (
|
|
853
842
|
// Standard browser envs have full support of the APIs needed to test
|
|
854
843
|
// whether the request URL is of the same origin as current location.
|
|
855
844
|
function() {
|
|
@@ -881,11 +870,11 @@ const fn = g.isStandardBrowserEnv ? (
|
|
|
881
870
|
};
|
|
882
871
|
}()
|
|
883
872
|
);
|
|
884
|
-
function
|
|
873
|
+
function Zt(e) {
|
|
885
874
|
const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
|
|
886
875
|
return t && t[1] || "";
|
|
887
876
|
}
|
|
888
|
-
function
|
|
877
|
+
function en(e, t) {
|
|
889
878
|
e = e || 10;
|
|
890
879
|
const n = new Array(e), r = new Array(e);
|
|
891
880
|
let s = 0, o = 0, i;
|
|
@@ -903,7 +892,7 @@ function hn(e, t) {
|
|
|
903
892
|
}
|
|
904
893
|
function me(e, t) {
|
|
905
894
|
let n = 0;
|
|
906
|
-
const r =
|
|
895
|
+
const r = en(50, 250);
|
|
907
896
|
return (s) => {
|
|
908
897
|
const o = s.loaded, i = s.lengthComputable ? s.total : void 0, u = o - n, d = r(u), c = o <= i;
|
|
909
898
|
n = o;
|
|
@@ -919,7 +908,7 @@ function me(e, t) {
|
|
|
919
908
|
l[t ? "download" : "upload"] = !0, e(l);
|
|
920
909
|
};
|
|
921
910
|
}
|
|
922
|
-
const
|
|
911
|
+
const tn = typeof XMLHttpRequest < "u", nn = tn && function(e) {
|
|
923
912
|
return new Promise(function(n, r) {
|
|
924
913
|
let s = e.data;
|
|
925
914
|
const o = A.from(e.headers).normalize(), i = e.responseType;
|
|
@@ -933,8 +922,8 @@ const pn = typeof XMLHttpRequest < "u", mn = pn && function(e) {
|
|
|
933
922
|
const y = e.auth.username || "", f = e.auth.password ? unescape(encodeURIComponent(e.auth.password)) : "";
|
|
934
923
|
o.set("Authorization", "Basic " + btoa(y + ":" + f));
|
|
935
924
|
}
|
|
936
|
-
const l =
|
|
937
|
-
c.open(e.method.toUpperCase(),
|
|
925
|
+
const l = Be(e.baseURL, e.url);
|
|
926
|
+
c.open(e.method.toUpperCase(), Fe(l, e.params, e.paramsSerializer), !0), c.timeout = e.timeout;
|
|
938
927
|
function h() {
|
|
939
928
|
if (!c)
|
|
940
929
|
return;
|
|
@@ -948,7 +937,7 @@ const pn = typeof XMLHttpRequest < "u", mn = pn && function(e) {
|
|
|
948
937
|
config: e,
|
|
949
938
|
request: c
|
|
950
939
|
};
|
|
951
|
-
|
|
940
|
+
Wt(function(S) {
|
|
952
941
|
n(S), d();
|
|
953
942
|
}, function(S) {
|
|
954
943
|
r(S), d();
|
|
@@ -962,7 +951,7 @@ const pn = typeof XMLHttpRequest < "u", mn = pn && function(e) {
|
|
|
962
951
|
r(new m("Network Error", m.ERR_NETWORK, e, c)), c = null;
|
|
963
952
|
}, c.ontimeout = function() {
|
|
964
953
|
let f = e.timeout ? "timeout of " + e.timeout + "ms exceeded" : "timeout exceeded";
|
|
965
|
-
const p = e.transitional ||
|
|
954
|
+
const p = e.transitional || Ue;
|
|
966
955
|
e.timeoutErrorMessage && (f = e.timeoutErrorMessage), r(new m(
|
|
967
956
|
f,
|
|
968
957
|
p.clarifyTimeoutError ? m.ETIMEDOUT : m.ECONNABORTED,
|
|
@@ -970,15 +959,15 @@ const pn = typeof XMLHttpRequest < "u", mn = pn && function(e) {
|
|
|
970
959
|
c
|
|
971
960
|
)), c = null;
|
|
972
961
|
}, g.isStandardBrowserEnv) {
|
|
973
|
-
const y = (e.withCredentials ||
|
|
962
|
+
const y = (e.withCredentials || Xt(l)) && e.xsrfCookieName && Yt.read(e.xsrfCookieName);
|
|
974
963
|
y && o.set(e.xsrfHeaderName, y);
|
|
975
964
|
}
|
|
976
965
|
s === void 0 && o.setContentType(null), "setRequestHeader" in c && a.forEach(o.toJSON(), function(f, p) {
|
|
977
966
|
c.setRequestHeader(p, f);
|
|
978
967
|
}), a.isUndefined(e.withCredentials) || (c.withCredentials = !!e.withCredentials), i && i !== "json" && (c.responseType = e.responseType), typeof e.onDownloadProgress == "function" && c.addEventListener("progress", me(e.onDownloadProgress, !0)), typeof e.onUploadProgress == "function" && c.upload && c.upload.addEventListener("progress", me(e.onUploadProgress)), (e.cancelToken || e.signal) && (u = (y) => {
|
|
979
|
-
c && (r(!y || y.type ? new
|
|
968
|
+
c && (r(!y || y.type ? new L(null, e, c) : y), c.abort(), c = null);
|
|
980
969
|
}, e.cancelToken && e.cancelToken.subscribe(u), e.signal && (e.signal.aborted ? u() : e.signal.addEventListener("abort", u)));
|
|
981
|
-
const E =
|
|
970
|
+
const E = Zt(l);
|
|
982
971
|
if (E && g.protocols.indexOf(E) === -1) {
|
|
983
972
|
r(new m("Unsupported protocol " + E + ":", m.ERR_BAD_REQUEST, e));
|
|
984
973
|
return;
|
|
@@ -986,8 +975,8 @@ const pn = typeof XMLHttpRequest < "u", mn = pn && function(e) {
|
|
|
986
975
|
c.send(s || null);
|
|
987
976
|
});
|
|
988
977
|
}, q = {
|
|
989
|
-
http:
|
|
990
|
-
xhr:
|
|
978
|
+
http: Pt,
|
|
979
|
+
xhr: nn
|
|
991
980
|
};
|
|
992
981
|
a.forEach(q, (e, t) => {
|
|
993
982
|
if (e) {
|
|
@@ -998,7 +987,7 @@ a.forEach(q, (e, t) => {
|
|
|
998
987
|
Object.defineProperty(e, "adapterName", { value: t });
|
|
999
988
|
}
|
|
1000
989
|
});
|
|
1001
|
-
const
|
|
990
|
+
const rn = {
|
|
1002
991
|
getAdapter: (e) => {
|
|
1003
992
|
e = a.isArray(e) ? e : [e];
|
|
1004
993
|
const { length: t } = e;
|
|
@@ -1020,20 +1009,20 @@ const yn = {
|
|
|
1020
1009
|
};
|
|
1021
1010
|
function Q(e) {
|
|
1022
1011
|
if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
|
|
1023
|
-
throw new
|
|
1012
|
+
throw new L(null, e);
|
|
1024
1013
|
}
|
|
1025
1014
|
function ye(e) {
|
|
1026
1015
|
return Q(e), e.headers = A.from(e.headers), e.data = G.call(
|
|
1027
1016
|
e,
|
|
1028
1017
|
e.transformRequest
|
|
1029
|
-
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1),
|
|
1018
|
+
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), rn.getAdapter(e.adapter || ie.adapter)(e).then(function(r) {
|
|
1030
1019
|
return Q(e), r.data = G.call(
|
|
1031
1020
|
e,
|
|
1032
1021
|
e.transformResponse,
|
|
1033
1022
|
r
|
|
1034
1023
|
), r.headers = A.from(r.headers), r;
|
|
1035
1024
|
}, function(r) {
|
|
1036
|
-
return
|
|
1025
|
+
return Le(r) || (Q(e), r && r.response && (r.response.data = G.call(
|
|
1037
1026
|
e,
|
|
1038
1027
|
e.transformResponse,
|
|
1039
1028
|
r.response
|
|
@@ -1106,7 +1095,7 @@ function N(e, t) {
|
|
|
1106
1095
|
a.isUndefined(E) && h !== u || (n[l] = E);
|
|
1107
1096
|
}), n;
|
|
1108
1097
|
}
|
|
1109
|
-
const
|
|
1098
|
+
const ke = "1.3.4", ae = {};
|
|
1110
1099
|
["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
|
|
1111
1100
|
ae[e] = function(r) {
|
|
1112
1101
|
return typeof r === e || "a" + (t < 1 ? "n " : " ") + e;
|
|
@@ -1115,7 +1104,7 @@ const $e = "1.3.4", ae = {};
|
|
|
1115
1104
|
const we = {};
|
|
1116
1105
|
ae.transitional = function(t, n, r) {
|
|
1117
1106
|
function s(o, i) {
|
|
1118
|
-
return "[Axios v" +
|
|
1107
|
+
return "[Axios v" + ke + "] Transitional option '" + o + "'" + i + (r ? ". " + r : "");
|
|
1119
1108
|
}
|
|
1120
1109
|
return (o, i, u) => {
|
|
1121
1110
|
if (t === !1)
|
|
@@ -1131,7 +1120,7 @@ ae.transitional = function(t, n, r) {
|
|
|
1131
1120
|
)), t ? t(o, i, u) : !0;
|
|
1132
1121
|
};
|
|
1133
1122
|
};
|
|
1134
|
-
function
|
|
1123
|
+
function sn(e, t, n) {
|
|
1135
1124
|
if (typeof e != "object")
|
|
1136
1125
|
throw new m("options must be an object", m.ERR_BAD_OPTION_VALUE);
|
|
1137
1126
|
const r = Object.keys(e);
|
|
@@ -1149,10 +1138,10 @@ function En(e, t, n) {
|
|
|
1149
1138
|
}
|
|
1150
1139
|
}
|
|
1151
1140
|
const ee = {
|
|
1152
|
-
assertOptions:
|
|
1141
|
+
assertOptions: sn,
|
|
1153
1142
|
validators: ae
|
|
1154
1143
|
}, T = ee.validators;
|
|
1155
|
-
class
|
|
1144
|
+
class M {
|
|
1156
1145
|
constructor(t) {
|
|
1157
1146
|
this.defaults = t, this.interceptors = {
|
|
1158
1147
|
request: new he(),
|
|
@@ -1226,12 +1215,12 @@ class v {
|
|
|
1226
1215
|
}
|
|
1227
1216
|
getUri(t) {
|
|
1228
1217
|
t = N(this.defaults, t);
|
|
1229
|
-
const n =
|
|
1230
|
-
return
|
|
1218
|
+
const n = Be(t.baseURL, t.url);
|
|
1219
|
+
return Fe(n, t.params, t.paramsSerializer);
|
|
1231
1220
|
}
|
|
1232
1221
|
}
|
|
1233
1222
|
a.forEach(["delete", "get", "head", "options"], function(t) {
|
|
1234
|
-
|
|
1223
|
+
M.prototype[t] = function(n, r) {
|
|
1235
1224
|
return this.request(N(r || {}, {
|
|
1236
1225
|
method: t,
|
|
1237
1226
|
url: n,
|
|
@@ -1252,9 +1241,9 @@ a.forEach(["post", "put", "patch"], function(t) {
|
|
|
1252
1241
|
}));
|
|
1253
1242
|
};
|
|
1254
1243
|
}
|
|
1255
|
-
|
|
1244
|
+
M.prototype[t] = n(), M.prototype[t + "Form"] = n(!0);
|
|
1256
1245
|
});
|
|
1257
|
-
const H =
|
|
1246
|
+
const H = M;
|
|
1258
1247
|
class ce {
|
|
1259
1248
|
constructor(t) {
|
|
1260
1249
|
if (typeof t != "function")
|
|
@@ -1280,7 +1269,7 @@ class ce {
|
|
|
1280
1269
|
r.unsubscribe(o);
|
|
1281
1270
|
}, i;
|
|
1282
1271
|
}, t(function(o, i, u) {
|
|
1283
|
-
r.reason || (r.reason = new
|
|
1272
|
+
r.reason || (r.reason = new L(o, i, u), n(r.reason));
|
|
1284
1273
|
});
|
|
1285
1274
|
}
|
|
1286
1275
|
/**
|
|
@@ -1323,13 +1312,13 @@ class ce {
|
|
|
1323
1312
|
};
|
|
1324
1313
|
}
|
|
1325
1314
|
}
|
|
1326
|
-
const
|
|
1327
|
-
function
|
|
1315
|
+
const on = ce;
|
|
1316
|
+
function an(e) {
|
|
1328
1317
|
return function(n) {
|
|
1329
1318
|
return e.apply(null, n);
|
|
1330
1319
|
};
|
|
1331
1320
|
}
|
|
1332
|
-
function
|
|
1321
|
+
function cn(e) {
|
|
1333
1322
|
return a.isObject(e) && e.isAxiosError === !0;
|
|
1334
1323
|
}
|
|
1335
1324
|
const te = {
|
|
@@ -1400,46 +1389,46 @@ const te = {
|
|
|
1400
1389
|
Object.entries(te).forEach(([e, t]) => {
|
|
1401
1390
|
te[t] = e;
|
|
1402
1391
|
});
|
|
1403
|
-
const
|
|
1404
|
-
function
|
|
1405
|
-
const t = new H(e), n =
|
|
1392
|
+
const un = te;
|
|
1393
|
+
function je(e) {
|
|
1394
|
+
const t = new H(e), n = Se(H.prototype.request, t);
|
|
1406
1395
|
return a.extend(n, H.prototype, t, { allOwnKeys: !0 }), a.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(s) {
|
|
1407
|
-
return
|
|
1396
|
+
return je(N(e, s));
|
|
1408
1397
|
}, n;
|
|
1409
1398
|
}
|
|
1410
|
-
const w =
|
|
1399
|
+
const w = je(ie);
|
|
1411
1400
|
w.Axios = H;
|
|
1412
|
-
w.CanceledError =
|
|
1413
|
-
w.CancelToken =
|
|
1414
|
-
w.isCancel =
|
|
1415
|
-
w.VERSION =
|
|
1401
|
+
w.CanceledError = L;
|
|
1402
|
+
w.CancelToken = on;
|
|
1403
|
+
w.isCancel = Le;
|
|
1404
|
+
w.VERSION = ke;
|
|
1416
1405
|
w.toFormData = z;
|
|
1417
1406
|
w.AxiosError = m;
|
|
1418
1407
|
w.Cancel = w.CanceledError;
|
|
1419
1408
|
w.all = function(t) {
|
|
1420
1409
|
return Promise.all(t);
|
|
1421
1410
|
};
|
|
1422
|
-
w.spread =
|
|
1423
|
-
w.isAxiosError =
|
|
1411
|
+
w.spread = an;
|
|
1412
|
+
w.isAxiosError = cn;
|
|
1424
1413
|
w.mergeConfig = N;
|
|
1425
1414
|
w.AxiosHeaders = A;
|
|
1426
|
-
w.formToJSON = (e) =>
|
|
1427
|
-
w.HttpStatusCode =
|
|
1415
|
+
w.formToJSON = (e) => De(a.isHTMLForm(e) ? new FormData(e) : e);
|
|
1416
|
+
w.HttpStatusCode = un;
|
|
1428
1417
|
w.default = w;
|
|
1429
|
-
const
|
|
1418
|
+
const ln = w, fn = (e) => {
|
|
1430
1419
|
let t = "";
|
|
1431
1420
|
return Object.keys(e).forEach((n) => {
|
|
1432
1421
|
t = t === "" ? t + `?${n}=${e[n]}` : t + `&${n}=${e[n]}`;
|
|
1433
1422
|
}), t;
|
|
1434
1423
|
};
|
|
1435
|
-
class
|
|
1424
|
+
class dn {
|
|
1436
1425
|
constructor(t) {
|
|
1437
1426
|
b(this, "client");
|
|
1438
1427
|
b(this, "queryParams");
|
|
1439
|
-
this.client =
|
|
1428
|
+
this.client = ln.create({
|
|
1440
1429
|
...t,
|
|
1441
1430
|
headers: t.apiKey ? this._getHeaders(t.apiKey) : {}
|
|
1442
|
-
}), this.queryParams = t.queryParams ?
|
|
1431
|
+
}), this.queryParams = t.queryParams ? fn(t.queryParams) : "";
|
|
1443
1432
|
}
|
|
1444
1433
|
async get(t, n) {
|
|
1445
1434
|
return this.client.get(t + this.queryParams, { params: n });
|
|
@@ -1458,48 +1447,58 @@ class On {
|
|
|
1458
1447
|
return n.Authorization = `Bearer ${t}`, n;
|
|
1459
1448
|
}
|
|
1460
1449
|
}
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
b(this, "httpClient");
|
|
1464
|
-
this.httpClient = t;
|
|
1465
|
-
}
|
|
1466
|
-
async getAll() {
|
|
1467
|
-
const { data: t } = await this.httpClient.get("conversions");
|
|
1468
|
-
return t;
|
|
1469
|
-
}
|
|
1470
|
-
}
|
|
1471
|
-
const _n = (e, t) => {
|
|
1472
|
-
const n = Date.now(), r = `${Ae}_${e}`, s = { ...t, timestamp: n };
|
|
1450
|
+
const qe = "fuul.session_id", He = "fuul.tracking_id", Me = "fuul.referrer_id", I = "fuul.traffic_source", K = "fuul.traffic_category", v = "fuul.traffic_title", Ke = "fuul.traffic_tag", hn = "fuul.traffic_origin_url", ve = "fuul.sent", pn = 6e4, mn = ["google.com", "bing.com", "yahoo.com"], yn = (e, t) => {
|
|
1451
|
+
const n = Date.now(), r = `${ve}_${e}`, s = { ...t, timestamp: n };
|
|
1473
1452
|
localStorage.setItem(r, JSON.stringify(s));
|
|
1474
|
-
},
|
|
1475
|
-
const n = `${
|
|
1453
|
+
}, En = (e, t) => {
|
|
1454
|
+
const n = `${ve}_${e}`, r = localStorage.getItem(n);
|
|
1476
1455
|
if (!r)
|
|
1477
1456
|
return !0;
|
|
1478
1457
|
const s = JSON.parse(r);
|
|
1479
|
-
if (Date.now() - s.timestamp >
|
|
1458
|
+
if (Date.now() - s.timestamp > pn)
|
|
1480
1459
|
return !0;
|
|
1481
1460
|
if (t.metadata) {
|
|
1482
1461
|
const { tracking_id: d, project_id: c, referrer: l, source: h, category: E, title: y, tag: f } = t.metadata, p = s.metadata.tracking_id === d && s.metadata.project_id === c && s.metadata.referrer === l && s.metadata.source === h && s.metadata.category === E && s.metadata.title === y && s.metadata.tag === f;
|
|
1483
1462
|
return s.user_address, t.user_address, !p;
|
|
1484
1463
|
}
|
|
1485
1464
|
return !0;
|
|
1486
|
-
}
|
|
1487
|
-
|
|
1465
|
+
};
|
|
1466
|
+
let wn = (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), "");
|
|
1467
|
+
const Sn = () => localStorage.getItem(qe), $e = () => localStorage.getItem(He), gn = () => localStorage.getItem(Me), Rn = () => localStorage.getItem(I), bn = () => localStorage.getItem(K), An = () => localStorage.getItem(v), On = () => localStorage.getItem(Ke), U = typeof window > "u" || typeof document > "u", ze = () => wn(), Tn = () => {
|
|
1468
|
+
U || localStorage.setItem(qe, ze());
|
|
1469
|
+
}, _n = () => {
|
|
1470
|
+
U || $e() || localStorage.setItem(He, ze());
|
|
1471
|
+
}, Pn = () => {
|
|
1472
|
+
if (U)
|
|
1473
|
+
return;
|
|
1474
|
+
const e = new URLSearchParams(window.location.search);
|
|
1475
|
+
localStorage.setItem(Me, e.get("referrer") ?? ""), localStorage.setItem(I, e.get("source") ?? ""), localStorage.setItem(K, e.get("category") ?? ""), localStorage.setItem(v, e.get("title") ?? ""), localStorage.setItem(Ke, e.get("tag") ?? ""), localStorage.setItem(hn, document.referrer ?? ""), Nn();
|
|
1476
|
+
}, Nn = () => {
|
|
1477
|
+
const e = new URLSearchParams(window.location.search), t = e.get("source"), n = e.get("referrer");
|
|
1478
|
+
if (!t)
|
|
1479
|
+
if (n)
|
|
1480
|
+
localStorage.setItem(I, "affiliate"), localStorage.setItem(K, "affiliate"), localStorage.setItem(v, n);
|
|
1481
|
+
else {
|
|
1482
|
+
const r = document.referrer;
|
|
1483
|
+
localStorage.setItem(K, r), localStorage.setItem(v, r), mn.includes(r) ? localStorage.setItem(I, "organic") : localStorage.setItem(I, "direct");
|
|
1484
|
+
}
|
|
1485
|
+
}, Cn = (e, t) => `p=${t}&source=fuul&referrer=${e}`;
|
|
1486
|
+
class In {
|
|
1488
1487
|
constructor(t, n = {}) {
|
|
1489
1488
|
b(this, "apiKey");
|
|
1490
1489
|
b(this, "BASE_API_URL", "https://api.fuul.xyz/api/v1/");
|
|
1491
1490
|
b(this, "httpClient");
|
|
1492
1491
|
b(this, "settings");
|
|
1493
1492
|
b(this, "conversionService");
|
|
1494
|
-
this.apiKey = t, this.settings = n, this.checkApiKey(),
|
|
1493
|
+
this.apiKey = t, this.settings = n, this.checkApiKey(), Tn(), _n(), Pn(), this.httpClient = new dn({
|
|
1495
1494
|
baseURL: n.baseApiUrl || this.BASE_API_URL,
|
|
1496
1495
|
timeout: 1e4,
|
|
1497
1496
|
apiKey: this.apiKey,
|
|
1498
1497
|
...this.settings.defaultQueryParams && { queryParams: this.settings.defaultQueryParams }
|
|
1499
|
-
}), this.conversionService = new
|
|
1498
|
+
}), this.conversionService = new Ye(this.httpClient), this.init();
|
|
1500
1499
|
}
|
|
1501
1500
|
async init() {
|
|
1502
|
-
|
|
1501
|
+
U || await this.sendEvent("pageview");
|
|
1503
1502
|
}
|
|
1504
1503
|
checkApiKey() {
|
|
1505
1504
|
if (!this.apiKey)
|
|
@@ -1516,7 +1515,7 @@ class xn {
|
|
|
1516
1515
|
* ```
|
|
1517
1516
|
*/
|
|
1518
1517
|
async sendEvent(t, n = {}, r = {}) {
|
|
1519
|
-
const s =
|
|
1518
|
+
const s = Sn(), o = $e(), i = gn(), u = Rn(), d = bn(), c = An(), l = On(), { userAddress: h, signature: E, signatureMessage: y } = r;
|
|
1520
1519
|
if (!o)
|
|
1521
1520
|
return;
|
|
1522
1521
|
const f = {
|
|
@@ -1535,15 +1534,15 @@ class xn {
|
|
|
1535
1534
|
...E && { signature: E },
|
|
1536
1535
|
...y && { signature_message: y }
|
|
1537
1536
|
};
|
|
1538
|
-
if (
|
|
1537
|
+
if (En(t, f))
|
|
1539
1538
|
try {
|
|
1540
|
-
await this.httpClient.post("events", f),
|
|
1539
|
+
await this.httpClient.post("events", f), yn(t, f);
|
|
1541
1540
|
} catch (p) {
|
|
1542
1541
|
return p;
|
|
1543
1542
|
}
|
|
1544
1543
|
}
|
|
1545
1544
|
verifyConnection() {
|
|
1546
|
-
if (
|
|
1545
|
+
if (U)
|
|
1547
1546
|
throw new Error(
|
|
1548
1547
|
'Fuul SDK is not supported in this environment. Please use "typeof window !== undefined" to check if you are in the browser environment.'
|
|
1549
1548
|
);
|
|
@@ -1558,12 +1557,12 @@ class xn {
|
|
|
1558
1557
|
* @returns {string} tracking link
|
|
1559
1558
|
**/
|
|
1560
1559
|
generateTrackingLink({ address: t, projectId: n, baseUrl: r }) {
|
|
1561
|
-
return `${r ?? window.location.href}?${
|
|
1560
|
+
return `${r ?? window.location.href}?${Cn(t, n)}`;
|
|
1562
1561
|
}
|
|
1563
1562
|
async getAllConversions() {
|
|
1564
1563
|
return this.conversionService.getAll();
|
|
1565
1564
|
}
|
|
1566
1565
|
}
|
|
1567
1566
|
export {
|
|
1568
|
-
|
|
1567
|
+
In as default
|
|
1569
1568
|
};
|