@fuul/sdk 4.1.1 → 4.1.3
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/core.d.ts +2 -0
- package/dist/core.d.ts.map +1 -1
- package/dist/index.mjs +96 -85
- package/dist/index.umd.js +4 -4
- package/package.json +1 -1
package/dist/core.d.ts
CHANGED
|
@@ -170,6 +170,8 @@ declare const _default: {
|
|
|
170
170
|
getPointsLeaderboard: typeof getPointsLeaderboard;
|
|
171
171
|
getUserPayoutsByConversion: typeof getUserPayoutsByConversion;
|
|
172
172
|
getUserPointsByConversion: typeof getUserPointsByConversion;
|
|
173
|
+
getUserPointsMovements: typeof getUserPointsMovements;
|
|
174
|
+
getUserPayoutMovements: typeof getUserPayoutMovements;
|
|
173
175
|
};
|
|
174
176
|
export default _default;
|
|
175
177
|
//# sourceMappingURL=core.d.ts.map
|
package/dist/core.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../src/core.ts"],"names":[],"mappings":"AAcA,OAAO,
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../src/core.ts"],"names":[],"mappings":"AAcA,OAAO,EACL,UAAU,EAEV,2BAA2B,EAC3B,0BAA0B,EAC1B,4BAA4B,EAC5B,gCAAgC,EAChC,+BAA+B,EAC/B,4BAA4B,EAC5B,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,2BAA2B,EAC3B,+BAA+B,EAC/B,8BAA8B,EAC9B,2BAA2B,EAC5B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAazF,wBAAgB,IAAI,CAAC,QAAQ,EAAE,YAAY,QAsB1C;AAQD;;;;;;;;GAQG;AACH,wBAAsB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAa7E;AAED;;;;;;;;;GASG;AACH,wBAAsB,YAAY,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAuBnE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,iBAAiB,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAyBjF;AAED;;;;;;;;;IASI;AACJ,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAGzG;AAED;;;;;;;;;IASI;AACJ,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAGzG;AAED;;;;;;;;IAQI;AACJ,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAG9E;AAED;;;;;;;;;;IAUI;AACJ,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAGxE;AAED;;;;;;;;;;;;IAYI;AACJ,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,MAAM,EACf,gBAAgB,EAAE,MAAM,EACxB,MAAM,CAAC,EAAE,mBAAmB,GAC3B,OAAO,CAAC,MAAM,CAAC,CAkBjB;AAED;;;;;;;;IAQI;AACJ,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,2BAA2B,GAClC,OAAO,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,CAAC,CAElD;AAED;;;;;;;;IAQI;AACJ,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,0BAA0B,GACjC,OAAO,CAAC,mBAAmB,CAAC,iBAAiB,CAAC,CAAC,CAEjD;AAED;;;;;;;;IAQI;AACJ,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,gCAAgC,GACvC,OAAO,CAAC,+BAA+B,CAAC,CAE1C;AAED;;;;;;;;IAQI;AACJ,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,+BAA+B,GACtC,OAAO,CAAC,8BAA8B,CAAC,CAEzC;AAED;;;;;;;;IAQI;AACJ,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,4BAA4B,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAEjH;AAED;;;;;;;;IAQI;AACJ,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,4BAA4B,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAEjH;AAED,wBAAsB,cAAc,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC,CAG5D;;;;;;;;;;;;;;;;;;;AAuBD,wBAiBE"}
|
package/dist/index.mjs
CHANGED
|
@@ -9,9 +9,9 @@ function Le(e, t) {
|
|
|
9
9
|
const { toString: at } = Object.prototype, { getPrototypeOf: ue } = Object, J = ((e) => (t) => {
|
|
10
10
|
const n = at.call(t);
|
|
11
11
|
return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
|
|
12
|
-
})(/* @__PURE__ */ Object.create(null)), R = (e) => (e = e.toLowerCase(), (t) => J(t) === e), M = (e) => (t) => typeof t === e, { isArray:
|
|
12
|
+
})(/* @__PURE__ */ Object.create(null)), R = (e) => (e = e.toLowerCase(), (t) => J(t) === e), M = (e) => (t) => typeof t === e, { isArray: B } = Array, v = M("undefined");
|
|
13
13
|
function ct(e) {
|
|
14
|
-
return e !== null && !
|
|
14
|
+
return e !== null && !v(e) && e.constructor !== null && !v(e.constructor) && C(e.constructor.isBuffer) && e.constructor.isBuffer(e);
|
|
15
15
|
}
|
|
16
16
|
const Be = R("ArrayBuffer");
|
|
17
17
|
function ut(e) {
|
|
@@ -32,7 +32,7 @@ function $(e, t, { allOwnKeys: n = !1 } = {}) {
|
|
|
32
32
|
if (e === null || typeof e > "u")
|
|
33
33
|
return;
|
|
34
34
|
let r, s;
|
|
35
|
-
if (typeof e != "object" && (e = [e]),
|
|
35
|
+
if (typeof e != "object" && (e = [e]), B(e))
|
|
36
36
|
for (r = 0, s = e.length; r < s; r++)
|
|
37
37
|
t.call(null, e[r], r, e);
|
|
38
38
|
else {
|
|
@@ -51,11 +51,11 @@ function ke(e, t) {
|
|
|
51
51
|
return s;
|
|
52
52
|
return null;
|
|
53
53
|
}
|
|
54
|
-
const je = (() => typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global)(),
|
|
54
|
+
const je = (() => typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global)(), ve = (e) => !v(e) && e !== je;
|
|
55
55
|
function re() {
|
|
56
|
-
const { caseless: e } =
|
|
56
|
+
const { caseless: e } = ve(this) && this || {}, t = {}, n = (r, s) => {
|
|
57
57
|
const i = e && ke(t, s) || s;
|
|
58
|
-
H(t[i]) && H(r) ? t[i] = re(t[i], r) : H(r) ? t[i] = re({}, r) :
|
|
58
|
+
H(t[i]) && H(r) ? t[i] = re(t[i], r) : H(r) ? t[i] = re({}, r) : B(r) ? t[i] = r.slice() : t[i] = r;
|
|
59
59
|
};
|
|
60
60
|
for (let r = 0, s = arguments.length; r < s; r++)
|
|
61
61
|
arguments[r] && $(arguments[r], n);
|
|
@@ -85,7 +85,7 @@ const bt = (e, t, n, { allOwnKeys: r } = {}) => ($(t, (s, i) => {
|
|
|
85
85
|
}, Ot = (e) => {
|
|
86
86
|
if (!e)
|
|
87
87
|
return null;
|
|
88
|
-
if (
|
|
88
|
+
if (B(e))
|
|
89
89
|
return e;
|
|
90
90
|
let t = e.length;
|
|
91
91
|
if (!Ie(t))
|
|
@@ -112,14 +112,14 @@ const bt = (e, t, n, { allOwnKeys: r } = {}) => ($(t, (s, i) => {
|
|
|
112
112
|
function(n, r, s) {
|
|
113
113
|
return r.toUpperCase() + s;
|
|
114
114
|
}
|
|
115
|
-
), ge = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), Ft = R("RegExp"),
|
|
115
|
+
), ge = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), Ft = R("RegExp"), $e = (e, t) => {
|
|
116
116
|
const n = Object.getOwnPropertyDescriptors(e), r = {};
|
|
117
117
|
$(n, (s, i) => {
|
|
118
118
|
let o;
|
|
119
119
|
(o = t(s, i, e)) !== !1 && (r[i] = o || s);
|
|
120
120
|
}), Object.defineProperties(e, r);
|
|
121
121
|
}, Ut = (e) => {
|
|
122
|
-
|
|
122
|
+
$e(e, (t, n) => {
|
|
123
123
|
if (C(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
|
|
124
124
|
return !1;
|
|
125
125
|
const r = e[n];
|
|
@@ -139,13 +139,13 @@ const bt = (e, t, n, { allOwnKeys: r } = {}) => ($(t, (s, i) => {
|
|
|
139
139
|
n[i] = !0;
|
|
140
140
|
});
|
|
141
141
|
};
|
|
142
|
-
return
|
|
142
|
+
return B(e) ? r(e) : r(String(e).split(t)), n;
|
|
143
143
|
}, Lt = () => {
|
|
144
|
-
}, Bt = (e, t) => (e = +e, Number.isFinite(e) ? e : t), Y = "abcdefghijklmnopqrstuvwxyz", we = "0123456789",
|
|
144
|
+
}, Bt = (e, t) => (e = +e, Number.isFinite(e) ? e : t), Y = "abcdefghijklmnopqrstuvwxyz", we = "0123456789", qe = {
|
|
145
145
|
DIGIT: we,
|
|
146
146
|
ALPHA: Y,
|
|
147
147
|
ALPHA_DIGIT: Y + Y.toUpperCase() + we
|
|
148
|
-
}, It = (e = 16, t =
|
|
148
|
+
}, It = (e = 16, t = qe.ALPHA_DIGIT) => {
|
|
149
149
|
let n = "";
|
|
150
150
|
const { length: r } = t;
|
|
151
151
|
for (; e--; )
|
|
@@ -162,18 +162,18 @@ const jt = (e) => {
|
|
|
162
162
|
return;
|
|
163
163
|
if (!("toJSON" in r)) {
|
|
164
164
|
t[s] = r;
|
|
165
|
-
const i =
|
|
165
|
+
const i = B(r) ? [] : {};
|
|
166
166
|
return $(r, (o, c) => {
|
|
167
167
|
const p = n(o, s + 1);
|
|
168
|
-
!
|
|
168
|
+
!v(p) && (i[c] = p);
|
|
169
169
|
}), t[s] = void 0, i;
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
172
|
return r;
|
|
173
173
|
};
|
|
174
174
|
return n(e, 0);
|
|
175
|
-
},
|
|
176
|
-
isArray:
|
|
175
|
+
}, vt = R("AsyncFunction"), $t = (e) => e && (W(e) || C(e)) && C(e.then) && C(e.catch), a = {
|
|
176
|
+
isArray: B,
|
|
177
177
|
isArrayBuffer: Be,
|
|
178
178
|
isBuffer: ct,
|
|
179
179
|
isFormData: gt,
|
|
@@ -183,7 +183,7 @@ const jt = (e) => {
|
|
|
183
183
|
isBoolean: ft,
|
|
184
184
|
isObject: W,
|
|
185
185
|
isPlainObject: H,
|
|
186
|
-
isUndefined:
|
|
186
|
+
isUndefined: v,
|
|
187
187
|
isDate: dt,
|
|
188
188
|
isFile: pt,
|
|
189
189
|
isBlob: ht,
|
|
@@ -210,7 +210,7 @@ const jt = (e) => {
|
|
|
210
210
|
hasOwnProperty: ge,
|
|
211
211
|
hasOwnProp: ge,
|
|
212
212
|
// an alias to avoid ESLint no-prototype-builtins detection
|
|
213
|
-
reduceDescriptors:
|
|
213
|
+
reduceDescriptors: $e,
|
|
214
214
|
freezeMethods: Ut,
|
|
215
215
|
toObjectSet: Dt,
|
|
216
216
|
toCamelCase: Nt,
|
|
@@ -218,13 +218,13 @@ const jt = (e) => {
|
|
|
218
218
|
toFiniteNumber: Bt,
|
|
219
219
|
findKey: ke,
|
|
220
220
|
global: je,
|
|
221
|
-
isContextDefined:
|
|
222
|
-
ALPHABET:
|
|
221
|
+
isContextDefined: ve,
|
|
222
|
+
ALPHABET: qe,
|
|
223
223
|
generateString: It,
|
|
224
224
|
isSpecCompliantForm: kt,
|
|
225
225
|
toJSONObject: jt,
|
|
226
|
-
isAsyncFn:
|
|
227
|
-
isThenable:
|
|
226
|
+
isAsyncFn: vt,
|
|
227
|
+
isThenable: $t
|
|
228
228
|
};
|
|
229
229
|
function m(e, t, n, r, s) {
|
|
230
230
|
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);
|
|
@@ -276,7 +276,7 @@ m.from = (e, t, n, r, s, i) => {
|
|
|
276
276
|
return p !== Error.prototype;
|
|
277
277
|
}, (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;
|
|
278
278
|
};
|
|
279
|
-
const
|
|
279
|
+
const qt = null;
|
|
280
280
|
function se(e) {
|
|
281
281
|
return a.isPlainObject(e) || a.isArray(e);
|
|
282
282
|
}
|
|
@@ -611,7 +611,7 @@ const de = fe, rn = a.toObjectSet([
|
|
|
611
611
|
s = o.indexOf(":"), n = o.substring(0, s).trim().toLowerCase(), r = o.substring(s + 1).trim(), !(!n || t[n] && rn[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r);
|
|
612
612
|
}), t;
|
|
613
613
|
}, Ce = Symbol("internals");
|
|
614
|
-
function
|
|
614
|
+
function k(e) {
|
|
615
615
|
return e && String(e).trim().toLowerCase();
|
|
616
616
|
}
|
|
617
617
|
function z(e) {
|
|
@@ -656,7 +656,7 @@ let X = class {
|
|
|
656
656
|
set(t, n, r) {
|
|
657
657
|
const s = this;
|
|
658
658
|
function i(c, p, h) {
|
|
659
|
-
const l =
|
|
659
|
+
const l = k(p);
|
|
660
660
|
if (!l)
|
|
661
661
|
throw new Error("header name must be a non-empty string");
|
|
662
662
|
const u = a.findKey(s, l);
|
|
@@ -666,7 +666,7 @@ let X = class {
|
|
|
666
666
|
return a.isPlainObject(t) || t instanceof this.constructor ? o(t, n) : a.isString(t) && (t = t.trim()) && !an(t) ? o(sn(t), n) : t != null && i(n, t, r), this;
|
|
667
667
|
}
|
|
668
668
|
get(t, n) {
|
|
669
|
-
if (t =
|
|
669
|
+
if (t = k(t), t) {
|
|
670
670
|
const r = a.findKey(this, t);
|
|
671
671
|
if (r) {
|
|
672
672
|
const s = this[r];
|
|
@@ -683,7 +683,7 @@ let X = class {
|
|
|
683
683
|
}
|
|
684
684
|
}
|
|
685
685
|
has(t, n) {
|
|
686
|
-
if (t =
|
|
686
|
+
if (t = k(t), t) {
|
|
687
687
|
const r = a.findKey(this, t);
|
|
688
688
|
return !!(r && this[r] !== void 0 && (!n || Z(this, this[r], r, n)));
|
|
689
689
|
}
|
|
@@ -693,7 +693,7 @@ let X = class {
|
|
|
693
693
|
const r = this;
|
|
694
694
|
let s = !1;
|
|
695
695
|
function i(o) {
|
|
696
|
-
if (o =
|
|
696
|
+
if (o = k(o), o) {
|
|
697
697
|
const c = a.findKey(r, o);
|
|
698
698
|
c && (!n || Z(r, r[c], c, n)) && (delete r[c], s = !0);
|
|
699
699
|
}
|
|
@@ -752,7 +752,7 @@ let X = class {
|
|
|
752
752
|
accessors: {}
|
|
753
753
|
}).accessors, s = this.prototype;
|
|
754
754
|
function i(o) {
|
|
755
|
-
const c =
|
|
755
|
+
const c = k(o);
|
|
756
756
|
r[c] || (un(s, o), r[c] = !0);
|
|
757
757
|
}
|
|
758
758
|
return a.isArray(t) ? t.forEach(i) : i(t), this;
|
|
@@ -977,7 +977,7 @@ const gn = typeof XMLHttpRequest < "u", wn = gn && function(e) {
|
|
|
977
977
|
u.send(s || null);
|
|
978
978
|
});
|
|
979
979
|
}, oe = {
|
|
980
|
-
http:
|
|
980
|
+
http: qt,
|
|
981
981
|
xhr: wn
|
|
982
982
|
};
|
|
983
983
|
a.forEach(oe, (e, t) => {
|
|
@@ -1043,7 +1043,7 @@ function Oe(e) {
|
|
|
1043
1043
|
});
|
|
1044
1044
|
}
|
|
1045
1045
|
const Te = (e) => e instanceof O ? e.toJSON() : e;
|
|
1046
|
-
function
|
|
1046
|
+
function D(e, t) {
|
|
1047
1047
|
t = t || {};
|
|
1048
1048
|
const n = {};
|
|
1049
1049
|
function r(h, l, u) {
|
|
@@ -1171,7 +1171,7 @@ let K = class {
|
|
|
1171
1171
|
* @returns {Promise} The Promise to be fulfilled
|
|
1172
1172
|
*/
|
|
1173
1173
|
request(t, n) {
|
|
1174
|
-
typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n =
|
|
1174
|
+
typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = D(this.defaults, n);
|
|
1175
1175
|
const { transitional: r, paramsSerializer: s, headers: i } = n;
|
|
1176
1176
|
r !== void 0 && ie.assertOptions(r, {
|
|
1177
1177
|
silentJSONParsing: x.transitional(x.boolean),
|
|
@@ -1230,14 +1230,14 @@ let K = class {
|
|
|
1230
1230
|
return l;
|
|
1231
1231
|
}
|
|
1232
1232
|
getUri(t) {
|
|
1233
|
-
t =
|
|
1233
|
+
t = D(this.defaults, t);
|
|
1234
1234
|
const n = Qe(t.baseURL, t.url);
|
|
1235
1235
|
return Je(n, t.params, t.paramsSerializer);
|
|
1236
1236
|
}
|
|
1237
1237
|
};
|
|
1238
1238
|
a.forEach(["delete", "get", "head", "options"], function(t) {
|
|
1239
1239
|
K.prototype[t] = function(n, r) {
|
|
1240
|
-
return this.request(
|
|
1240
|
+
return this.request(D(r || {}, {
|
|
1241
1241
|
method: t,
|
|
1242
1242
|
url: n,
|
|
1243
1243
|
data: (r || {}).data
|
|
@@ -1247,7 +1247,7 @@ a.forEach(["delete", "get", "head", "options"], function(t) {
|
|
|
1247
1247
|
a.forEach(["post", "put", "patch"], function(t) {
|
|
1248
1248
|
function n(r) {
|
|
1249
1249
|
return function(i, o, c) {
|
|
1250
|
-
return this.request(
|
|
1250
|
+
return this.request(D(c || {}, {
|
|
1251
1251
|
method: t,
|
|
1252
1252
|
headers: r ? {
|
|
1253
1253
|
"Content-Type": "multipart/form-data"
|
|
@@ -1409,7 +1409,7 @@ const On = ae;
|
|
|
1409
1409
|
function tt(e) {
|
|
1410
1410
|
const t = new V(e), n = Le(V.prototype.request, t);
|
|
1411
1411
|
return a.extend(n, V.prototype, t, { allOwnKeys: !0 }), a.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(s) {
|
|
1412
|
-
return tt(
|
|
1412
|
+
return tt(D(e, s));
|
|
1413
1413
|
}, n;
|
|
1414
1414
|
}
|
|
1415
1415
|
const y = tt(de);
|
|
@@ -1426,29 +1426,29 @@ y.all = function(t) {
|
|
|
1426
1426
|
};
|
|
1427
1427
|
y.spread = An;
|
|
1428
1428
|
y.isAxiosError = Rn;
|
|
1429
|
-
y.mergeConfig =
|
|
1429
|
+
y.mergeConfig = D;
|
|
1430
1430
|
y.AxiosHeaders = O;
|
|
1431
1431
|
y.formToJSON = (e) => Ge(a.isHTMLForm(e) ? new FormData(e) : e);
|
|
1432
1432
|
y.getAdapter = Ye.getAdapter;
|
|
1433
1433
|
y.HttpStatusCode = On;
|
|
1434
1434
|
y.default = y;
|
|
1435
1435
|
const nt = y, {
|
|
1436
|
-
Axios:
|
|
1436
|
+
Axios: fr,
|
|
1437
1437
|
AxiosError: ne,
|
|
1438
|
-
CanceledError:
|
|
1439
|
-
isCancel:
|
|
1440
|
-
CancelToken:
|
|
1441
|
-
VERSION:
|
|
1442
|
-
all:
|
|
1443
|
-
Cancel:
|
|
1444
|
-
isAxiosError:
|
|
1445
|
-
spread:
|
|
1446
|
-
toFormData:
|
|
1447
|
-
AxiosHeaders:
|
|
1448
|
-
HttpStatusCode:
|
|
1449
|
-
formToJSON:
|
|
1450
|
-
getAdapter:
|
|
1451
|
-
mergeConfig:
|
|
1438
|
+
CanceledError: dr,
|
|
1439
|
+
isCancel: pr,
|
|
1440
|
+
CancelToken: hr,
|
|
1441
|
+
VERSION: mr,
|
|
1442
|
+
all: yr,
|
|
1443
|
+
Cancel: gr,
|
|
1444
|
+
isAxiosError: wr,
|
|
1445
|
+
spread: Er,
|
|
1446
|
+
toFormData: br,
|
|
1447
|
+
AxiosHeaders: Sr,
|
|
1448
|
+
HttpStatusCode: Cr,
|
|
1449
|
+
formToJSON: Ar,
|
|
1450
|
+
getAdapter: Rr,
|
|
1451
|
+
mergeConfig: Or
|
|
1452
1452
|
} = nt;
|
|
1453
1453
|
class _e extends Error {
|
|
1454
1454
|
constructor(n) {
|
|
@@ -1583,7 +1583,7 @@ class xn {
|
|
|
1583
1583
|
localStorage.setItem(n, JSON.stringify(s));
|
|
1584
1584
|
}
|
|
1585
1585
|
}
|
|
1586
|
-
const Nn = "4.1.
|
|
1586
|
+
const Nn = "4.1.3", Fn = {
|
|
1587
1587
|
version: Nn
|
|
1588
1588
|
};
|
|
1589
1589
|
class Un {
|
|
@@ -1617,7 +1617,7 @@ class Un {
|
|
|
1617
1617
|
return this.client.delete(t + this.queryParams);
|
|
1618
1618
|
}
|
|
1619
1619
|
}
|
|
1620
|
-
const
|
|
1620
|
+
const F = "/payouts";
|
|
1621
1621
|
class Dn {
|
|
1622
1622
|
constructor(t) {
|
|
1623
1623
|
b(this, "httpClient");
|
|
@@ -1625,26 +1625,26 @@ class Dn {
|
|
|
1625
1625
|
this.httpClient = t.httpClient, this._debug = t.debug;
|
|
1626
1626
|
}
|
|
1627
1627
|
async getPayoutsLeaderboard(t) {
|
|
1628
|
-
return (await this.httpClient.get(`${
|
|
1628
|
+
return (await this.httpClient.get(`${F}/leaderboard`, t)).data;
|
|
1629
1629
|
}
|
|
1630
1630
|
async getPointsLeaderboard(t) {
|
|
1631
|
-
return (await this.httpClient.get(`${
|
|
1631
|
+
return (await this.httpClient.get(`${F}/leaderboard`, t)).data;
|
|
1632
1632
|
}
|
|
1633
1633
|
async getUserPayoutsByConversion(t) {
|
|
1634
|
-
return (await this.httpClient.get(
|
|
1634
|
+
return (await this.httpClient.get(F, { ...t, type: "onchain-currency" })).data;
|
|
1635
1635
|
}
|
|
1636
1636
|
async getUserPointsByConversion(t) {
|
|
1637
|
-
return (await this.httpClient.get(
|
|
1637
|
+
return (await this.httpClient.get(F, { ...t, type: "point" })).data;
|
|
1638
1638
|
}
|
|
1639
1639
|
async getUserPayoutMovements(t) {
|
|
1640
|
-
return (await this.httpClient.get(`${
|
|
1640
|
+
return (await this.httpClient.get(`${F}/movements`, { ...t, type: "onchain-currency" })).data;
|
|
1641
1641
|
}
|
|
1642
1642
|
async getUserPointsMovements(t) {
|
|
1643
|
-
return (await this.httpClient.get(`${
|
|
1643
|
+
return (await this.httpClient.get(`${F}/movements`, { ...t, type: "point" })).data;
|
|
1644
1644
|
}
|
|
1645
1645
|
}
|
|
1646
1646
|
let Ln = (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), "");
|
|
1647
|
-
const Bn = "fuul.tracking_id", he = () =>
|
|
1647
|
+
const Bn = "fuul.tracking_id", he = () => qn(Bn, () => Ln()), De = () => L("af") || L("referrer"), In = () => document.referrer, kn = () => Hn(), jn = () => L("category"), vn = () => L("title"), $n = () => L("tag"), qn = (e, t) => {
|
|
1648
1648
|
const n = localStorage.getItem(e);
|
|
1649
1649
|
if (n)
|
|
1650
1650
|
return n;
|
|
@@ -1652,17 +1652,17 @@ const Bn = "fuul.tracking_id", he = () => vn(Bn, () => Ln()), De = () => D("af")
|
|
|
1652
1652
|
const r = t();
|
|
1653
1653
|
return r ? localStorage.setItem(e, r) : localStorage.removeItem(e), r;
|
|
1654
1654
|
}
|
|
1655
|
-
},
|
|
1656
|
-
const e =
|
|
1655
|
+
}, L = (e) => new URLSearchParams(window.location.search).get(e), Hn = () => {
|
|
1656
|
+
const e = L("source");
|
|
1657
1657
|
if (e)
|
|
1658
1658
|
return e;
|
|
1659
1659
|
}, zn = "https://api.fuul.xyz/api/v1/";
|
|
1660
|
-
let
|
|
1660
|
+
let U = !1, ce = !1, me, j, rt, I, Q, N;
|
|
1661
1661
|
function Vn(e) {
|
|
1662
|
-
|
|
1662
|
+
U = !!e.debug, !ce && (me = e.apiKey, ir(), j = ar(
|
|
1663
1663
|
e.baseApiUrl ?? zn,
|
|
1664
1664
|
e.defaultQueryParams ?? {}
|
|
1665
|
-
), rt = new Pn({ httpClient:
|
|
1665
|
+
), rt = new Pn({ httpClient: j, debug: U }), Q = new xn({ httpClient: j, debug: U }), I = new Tn({ httpClient: j, debug: U }), N = new Dn({ httpClient: j, debug: U }), ce = !0, U && console.debug("Fuul SDK: init() complete"));
|
|
1666
1666
|
}
|
|
1667
1667
|
function T() {
|
|
1668
1668
|
if (!ce)
|
|
@@ -1694,8 +1694,8 @@ async function Jn(e) {
|
|
|
1694
1694
|
affiliate_id: De() ?? void 0,
|
|
1695
1695
|
referrer: De() ?? void 0,
|
|
1696
1696
|
category: jn() ?? void 0,
|
|
1697
|
-
title:
|
|
1698
|
-
tag:
|
|
1697
|
+
title: vn() ?? void 0,
|
|
1698
|
+
tag: $n() ?? void 0
|
|
1699
1699
|
}
|
|
1700
1700
|
};
|
|
1701
1701
|
await Q.sendEvent(t);
|
|
@@ -1704,7 +1704,10 @@ async function Mn(e) {
|
|
|
1704
1704
|
T(), ye();
|
|
1705
1705
|
const t = {
|
|
1706
1706
|
name: "connect_wallet",
|
|
1707
|
-
args: {
|
|
1707
|
+
args: {
|
|
1708
|
+
page: document.location.pathname,
|
|
1709
|
+
locationOrigin: document.location.origin
|
|
1710
|
+
},
|
|
1708
1711
|
metadata: {
|
|
1709
1712
|
tracking_id: he()
|
|
1710
1713
|
}
|
|
@@ -1712,48 +1715,54 @@ async function Mn(e) {
|
|
|
1712
1715
|
e != null && e.address && (t.user_address = e.address), e != null && e.signature && (t.signature = e == null ? void 0 : e.signature, t.signature_message = e == null ? void 0 : e.message), await Q.sendEvent(t);
|
|
1713
1716
|
}
|
|
1714
1717
|
async function Wn(e, t, n) {
|
|
1715
|
-
T(), await
|
|
1718
|
+
T(), await I.create(e, t, n);
|
|
1716
1719
|
}
|
|
1717
1720
|
async function Gn(e, t, n) {
|
|
1718
|
-
T(), await
|
|
1721
|
+
T(), await I.update(e, t, n);
|
|
1719
1722
|
}
|
|
1720
1723
|
async function Xn(e) {
|
|
1721
|
-
return T(), await
|
|
1724
|
+
return T(), await I.getCode(e);
|
|
1722
1725
|
}
|
|
1723
1726
|
async function Qn(e) {
|
|
1724
|
-
return T(), await
|
|
1727
|
+
return T(), await I.isCodeFree(e);
|
|
1725
1728
|
}
|
|
1726
1729
|
async function Yn(e, t, n) {
|
|
1727
1730
|
T();
|
|
1728
|
-
const r = await
|
|
1731
|
+
const r = await I.getCode(t), s = new URLSearchParams({
|
|
1729
1732
|
af: r ?? t
|
|
1730
1733
|
});
|
|
1731
1734
|
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()}`;
|
|
1732
1735
|
}
|
|
1733
1736
|
function Zn(e) {
|
|
1734
|
-
return
|
|
1737
|
+
return N.getPayoutsLeaderboard(e);
|
|
1735
1738
|
}
|
|
1736
1739
|
function er(e) {
|
|
1737
|
-
return
|
|
1740
|
+
return N.getPointsLeaderboard(e);
|
|
1738
1741
|
}
|
|
1739
1742
|
function tr(e) {
|
|
1740
|
-
return
|
|
1743
|
+
return N.getUserPayoutsByConversion(e);
|
|
1741
1744
|
}
|
|
1742
1745
|
function nr(e) {
|
|
1743
|
-
return
|
|
1746
|
+
return N.getUserPointsByConversion(e);
|
|
1747
|
+
}
|
|
1748
|
+
function rr(e) {
|
|
1749
|
+
return N.getUserPayoutMovements(e);
|
|
1750
|
+
}
|
|
1751
|
+
function sr(e) {
|
|
1752
|
+
return N.getUserPointsMovements(e);
|
|
1744
1753
|
}
|
|
1745
|
-
async function
|
|
1754
|
+
async function or() {
|
|
1746
1755
|
return T(), rt.getAll();
|
|
1747
1756
|
}
|
|
1748
1757
|
function ye() {
|
|
1749
1758
|
if (typeof window > "u" || typeof document > "u")
|
|
1750
1759
|
throw new Error("Fuul SDK: Browser context required");
|
|
1751
1760
|
}
|
|
1752
|
-
function
|
|
1761
|
+
function ir() {
|
|
1753
1762
|
if (!me)
|
|
1754
1763
|
throw new Error("Fuul SDK: Invalid API key");
|
|
1755
1764
|
}
|
|
1756
|
-
function
|
|
1765
|
+
function ar(e, t) {
|
|
1757
1766
|
return new Un({
|
|
1758
1767
|
baseURL: e,
|
|
1759
1768
|
timeout: 1e4,
|
|
@@ -1761,13 +1770,13 @@ function or(e, t) {
|
|
|
1761
1770
|
queryParams: t
|
|
1762
1771
|
});
|
|
1763
1772
|
}
|
|
1764
|
-
const
|
|
1773
|
+
const Tr = {
|
|
1765
1774
|
init: Vn,
|
|
1766
1775
|
sendEvent: Kn,
|
|
1767
1776
|
sendPageview: Jn,
|
|
1768
1777
|
sendConnectWallet: Mn,
|
|
1769
1778
|
generateTrackingLink: Yn,
|
|
1770
|
-
getConversions:
|
|
1779
|
+
getConversions: or,
|
|
1771
1780
|
createAffiliateCode: Wn,
|
|
1772
1781
|
updateAffiliateCode: Gn,
|
|
1773
1782
|
getAffiliateCode: Xn,
|
|
@@ -1775,12 +1784,14 @@ const Rr = {
|
|
|
1775
1784
|
getPayoutsLeaderboard: Zn,
|
|
1776
1785
|
getPointsLeaderboard: er,
|
|
1777
1786
|
getUserPayoutsByConversion: tr,
|
|
1778
|
-
getUserPointsByConversion: nr
|
|
1787
|
+
getUserPointsByConversion: nr,
|
|
1788
|
+
getUserPointsMovements: sr,
|
|
1789
|
+
getUserPayoutMovements: rr
|
|
1779
1790
|
};
|
|
1780
1791
|
export {
|
|
1781
1792
|
xe as AddressInUseError,
|
|
1782
1793
|
Ne as CodeInUseError,
|
|
1783
|
-
|
|
1794
|
+
Tr as Fuul,
|
|
1784
1795
|
Fe as InvalidSignatureError,
|
|
1785
1796
|
_e as ValidationError
|
|
1786
1797
|
};
|
package/dist/index.umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
(function(E,S){typeof exports=="object"&&typeof module<"u"?S(exports):typeof define=="function"&&define.amd?define(["exports"],S):(E=typeof globalThis<"u"?globalThis:E||self,S(E.Fuul={}))})(this,function(E){"use strict";var Qn=Object.defineProperty;var Yn=(E,S,U)=>S in E?Qn(E,S,{enumerable:!0,configurable:!0,writable:!0,value:U}):E[S]=U;var C=(E,S,U)=>(Yn(E,typeof S!="symbol"?S+"":S,U),U);function S(e,t){return function(){return e.apply(t,arguments)}}const{toString:U}=Object.prototype,{getPrototypeOf:te}=Object,K=(e=>t=>{const n=U.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),O=e=>(e=e.toLowerCase(),t=>K(t)===e),J=e=>t=>typeof t===e,{isArray:D}=Array,$=J("undefined");function it(e){return e!==null&&!$(e)&&e.constructor!==null&&!$(e.constructor)&&A(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Re=O("ArrayBuffer");function at(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Re(e.buffer),t}const ct=J("string"),A=J("function"),Oe=J("number"),M=e=>e!==null&&typeof e=="object",ut=e=>e===!0||e===!1,W=e=>{if(K(e)!=="object")return!1;const t=te(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},lt=O("Date"),ft=O("File"),dt=O("Blob"),pt=O("FileList"),ht=e=>M(e)&&A(e.pipe),mt=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||A(e.append)&&((t=K(e))==="formdata"||t==="object"&&A(e.toString)&&e.toString()==="[object FormData]"))},yt=O("URLSearchParams"),gt=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function v(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),D(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{const i=n?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let c;for(r=0;r<o;r++)c=i[r],t.call(null,e[c],c,e)}}function Te(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const Pe=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),_e=e=>!$(e)&&e!==Pe;function ne(){const{caseless:e}=_e(this)&&this||{},t={},n=(r,s)=>{const i=e&&Te(t,s)||s;W(t[i])&&W(r)?t[i]=ne(t[i],r):W(r)?t[i]=ne({},r):D(r)?t[i]=r.slice():t[i]=r};for(let r=0,s=arguments.length;r<s;r++)arguments[r]&&v(arguments[r],n);return t}const wt=(e,t,n,{allOwnKeys:r}={})=>(v(t,(s,i)=>{n&&A(s)?e[i]=S(s,n):e[i]=s},{allOwnKeys:r}),e),Et=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),bt=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},St=(e,t,n,r)=>{let s,i,o;const c={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),i=s.length;i-- >0;)o=s[i],(!r||r(o,e,t))&&!c[o]&&(t[o]=e[o],c[o]=!0);e=n!==!1&&te(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Ct=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},At=e=>{if(!e)return null;if(D(e))return e;let t=e.length;if(!Oe(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Rt=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&te(Uint8Array)),Ot=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let s;for(;(s=r.next())&&!s.done;){const i=s.value;t.call(e,i[0],i[1])}},Tt=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Pt=O("HTMLFormElement"),_t=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),Ne=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Nt=O("RegExp"),xe=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};v(n,(s,i)=>{let o;(o=t(s,i,e))!==!1&&(r[i]=o||s)}),Object.defineProperties(e,r)},xt=e=>{xe(e,(t,n)=>{if(A(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(A(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Ft=(e,t)=>{const n={},r=s=>{s.forEach(i=>{n[i]=!0})};return D(e)?r(e):r(String(e).split(t)),n},Ut=()=>{},Dt=(e,t)=>(e=+e,Number.isFinite(e)?e:t),re="abcdefghijklmnopqrstuvwxyz",Fe="0123456789",Ue={DIGIT:Fe,ALPHA:re,ALPHA_DIGIT:re+re.toUpperCase()+Fe},Lt=(e=16,t=Ue.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function Bt(e){return!!(e&&A(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const It=e=>{const t=new Array(10),n=(r,s)=>{if(M(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[s]=r;const i=D(r)?[]:{};return v(r,(o,c)=>{const p=n(o,s+1);!$(p)&&(i[c]=p)}),t[s]=void 0,i}}return r};return n(e,0)},jt=O("AsyncFunction"),a={isArray:D,isArrayBuffer:Re,isBuffer:it,isFormData:mt,isArrayBufferView:at,isString:ct,isNumber:Oe,isBoolean:ut,isObject:M,isPlainObject:W,isUndefined:$,isDate:lt,isFile:ft,isBlob:dt,isRegExp:Nt,isFunction:A,isStream:ht,isURLSearchParams:yt,isTypedArray:Rt,isFileList:pt,forEach:v,merge:ne,extend:wt,trim:gt,stripBOM:Et,inherits:bt,toFlatObject:St,kindOf:K,kindOfTest:O,endsWith:Ct,toArray:At,forEachEntry:Ot,matchAll:Tt,isHTMLForm:Pt,hasOwnProperty:Ne,hasOwnProp:Ne,reduceDescriptors:xe,freezeMethods:xt,toObjectSet:Ft,toCamelCase:_t,noop:Ut,toFiniteNumber:Dt,findKey:Te,global:Pe,isContextDefined:_e,ALPHABET:Ue,generateString:Lt,isSpecCompliantForm:Bt,toJSONObject:It,isAsyncFn:jt,isThenable:e=>e&&(M(e)||A(e))&&A(e.then)&&A(e.catch)};function m(e,t,n,r,s){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)}a.inherits(m,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:a.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const De=m.prototype,Le={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Le[e]={value:e}}),Object.defineProperties(m,Le),Object.defineProperty(De,"isAxiosError",{value:!0}),m.from=(e,t,n,r,s,i)=>{const o=Object.create(De);return a.toFlatObject(e,o,function(p){return p!==Error.prototype},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};const kt=null;function se(e){return a.isPlainObject(e)||a.isArray(e)}function Be(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function Ie(e,t,n){return e?e.concat(t).map(function(s,i){return s=Be(s),!n&&i?"["+s+"]":s}).join(n?".":""):t}function $t(e){return a.isArray(e)&&!e.some(se)}const vt=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function X(e,t,n){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(d,w){return!a.isUndefined(w[d])});const r=n.metaTokens,s=n.visitor||l,i=n.dots,o=n.indexes,p=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(s))throw new TypeError("visitor must be a function");function h(f){if(f===null)return"";if(a.isDate(f))return f.toISOString();if(!p&&a.isBlob(f))throw new m("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(f)||a.isTypedArray(f)?p&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function l(f,d,w){let b=f;if(f&&!w&&typeof f=="object"){if(a.endsWith(d,"{}"))d=r?d:d.slice(0,-2),f=JSON.stringify(f);else if(a.isArray(f)&&$t(f)||(a.isFileList(f)||a.endsWith(d,"[]"))&&(b=a.toArray(f)))return d=Be(d),b.forEach(function(F,Gn){!(a.isUndefined(F)||F===null)&&t.append(o===!0?Ie([d],Gn,i):o===null?d:d+"[]",h(F))}),!1}return se(f)?!0:(t.append(Ie(w,d,i),h(f)),!1)}const u=[],g=Object.assign(vt,{defaultVisitor:l,convertValue:h,isVisitable:se});function R(f,d){if(!a.isUndefined(f)){if(u.indexOf(f)!==-1)throw Error("Circular reference detected in "+d.join("."));u.push(f),a.forEach(f,function(b,x){(!(a.isUndefined(b)||b===null)&&s.call(t,b,a.isString(x)?x.trim():x,d,g))===!0&&R(b,d?d.concat(x):[x])}),u.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return R(e),t}function je(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function oe(e,t){this._pairs=[],e&&X(e,this,t)}const ke=oe.prototype;ke.append=function(t,n){this._pairs.push([t,n])},ke.toString=function(t){const n=t?function(r){return t.call(this,r,je)}:je;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function qt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function $e(e,t,n){if(!t)return e;const r=n&&n.encode||qt,s=n&&n.serialize;let i;if(s?i=s(t,n):i=a.isURLSearchParams(t)?t.toString():new oe(t,n).toString(r),i){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class Ht{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){a.forEach(this.handlers,function(r){r!==null&&t(r)})}}const ve=Ht,qe={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},zt={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:oe,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},He=typeof window<"u"&&typeof document<"u",Vt=(e=>He&&["ReactNative","NativeScript","NS"].indexOf(e)<0)(typeof navigator<"u"&&navigator.product),Kt=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),T={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:He,hasStandardBrowserEnv:Vt,hasStandardBrowserWebWorkerEnv:Kt},Symbol.toStringTag,{value:"Module"})),...zt};function Jt(e,t){return X(e,new T.classes.URLSearchParams,Object.assign({visitor:function(n,r,s,i){return T.isNode&&a.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}function Mt(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Wt(e){const t={},n=Object.keys(e);let r;const s=n.length;let i;for(r=0;r<s;r++)i=n[r],t[i]=e[i];return t}function ze(e){function t(n,r,s,i){let o=n[i++];const c=Number.isFinite(+o),p=i>=n.length;return o=!o&&a.isArray(s)?s.length:o,p?(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]=Wt(s[o])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){const n={};return a.forEachEntry(e,(r,s)=>{t(Mt(r),s,n,0)}),n}return null}function Xt(e,t,n){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const ie={transitional:qe,adapter:["xhr","http"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,i=a.isObject(t);if(i&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return s&&s?JSON.stringify(ze(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Jt(t,this.formSerializer).toString();if((c=a.isFileList(t))||r.indexOf("multipart/form-data")>-1){const p=this.env&&this.env.FormData;return X(c?{"files[]":t}:t,p&&new p,this.formSerializer)}}return i||s?(n.setContentType("application/json",!1),Xt(t)):t}],transformResponse:[function(t){const n=this.transitional||ie.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(t&&a.isString(t)&&(r&&!this.responseType||s)){const o=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(c){if(o)throw c.name==="SyntaxError"?m.from(c,m.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:T.classes.FormData,Blob:T.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],e=>{ie.headers[e]={}});const ae=ie,Gt=a.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Qt=e=>{const t={};let n,r,s;return e&&e.split(`
|
|
2
|
-
`).forEach(function(o){s=o.indexOf(":"),n=o.substring(0,s).trim().toLowerCase(),r=o.substring(s+1).trim(),!(!n||t[n]&&Gt[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Ve=Symbol("internals");function
|
|
3
|
-
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[Ve]=this[Ve]={accessors:{}}).accessors,s=this.prototype;function i(o){const c=
|
|
1
|
+
(function(E,S){typeof exports=="object"&&typeof module<"u"?S(exports):typeof define=="function"&&define.amd?define(["exports"],S):(E=typeof globalThis<"u"?globalThis:E||self,S(E.Fuul={}))})(this,function(E){"use strict";var Zn=Object.defineProperty;var er=(E,S,U)=>S in E?Zn(E,S,{enumerable:!0,configurable:!0,writable:!0,value:U}):E[S]=U;var C=(E,S,U)=>(er(E,typeof S!="symbol"?S+"":S,U),U);function S(e,t){return function(){return e.apply(t,arguments)}}const{toString:U}=Object.prototype,{getPrototypeOf:te}=Object,K=(e=>t=>{const n=U.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),O=e=>(e=e.toLowerCase(),t=>K(t)===e),J=e=>t=>typeof t===e,{isArray:L}=Array,v=J("undefined");function it(e){return e!==null&&!v(e)&&e.constructor!==null&&!v(e.constructor)&&A(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Re=O("ArrayBuffer");function at(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Re(e.buffer),t}const ct=J("string"),A=J("function"),Oe=J("number"),M=e=>e!==null&&typeof e=="object",ut=e=>e===!0||e===!1,W=e=>{if(K(e)!=="object")return!1;const t=te(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},lt=O("Date"),ft=O("File"),dt=O("Blob"),pt=O("FileList"),ht=e=>M(e)&&A(e.pipe),mt=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||A(e.append)&&((t=K(e))==="formdata"||t==="object"&&A(e.toString)&&e.toString()==="[object FormData]"))},yt=O("URLSearchParams"),gt=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function q(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),L(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{const i=n?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let c;for(r=0;r<o;r++)c=i[r],t.call(null,e[c],c,e)}}function Te(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const Pe=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),_e=e=>!v(e)&&e!==Pe;function ne(){const{caseless:e}=_e(this)&&this||{},t={},n=(r,s)=>{const i=e&&Te(t,s)||s;W(t[i])&&W(r)?t[i]=ne(t[i],r):W(r)?t[i]=ne({},r):L(r)?t[i]=r.slice():t[i]=r};for(let r=0,s=arguments.length;r<s;r++)arguments[r]&&q(arguments[r],n);return t}const wt=(e,t,n,{allOwnKeys:r}={})=>(q(t,(s,i)=>{n&&A(s)?e[i]=S(s,n):e[i]=s},{allOwnKeys:r}),e),Et=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),bt=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},St=(e,t,n,r)=>{let s,i,o;const c={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),i=s.length;i-- >0;)o=s[i],(!r||r(o,e,t))&&!c[o]&&(t[o]=e[o],c[o]=!0);e=n!==!1&&te(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Ct=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},At=e=>{if(!e)return null;if(L(e))return e;let t=e.length;if(!Oe(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Rt=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&te(Uint8Array)),Ot=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let s;for(;(s=r.next())&&!s.done;){const i=s.value;t.call(e,i[0],i[1])}},Tt=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Pt=O("HTMLFormElement"),_t=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),Ne=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Nt=O("RegExp"),xe=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};q(n,(s,i)=>{let o;(o=t(s,i,e))!==!1&&(r[i]=o||s)}),Object.defineProperties(e,r)},xt=e=>{xe(e,(t,n)=>{if(A(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(A(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Ft=(e,t)=>{const n={},r=s=>{s.forEach(i=>{n[i]=!0})};return L(e)?r(e):r(String(e).split(t)),n},Ut=()=>{},Dt=(e,t)=>(e=+e,Number.isFinite(e)?e:t),re="abcdefghijklmnopqrstuvwxyz",Fe="0123456789",Ue={DIGIT:Fe,ALPHA:re,ALPHA_DIGIT:re+re.toUpperCase()+Fe},Lt=(e=16,t=Ue.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function Bt(e){return!!(e&&A(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const It=e=>{const t=new Array(10),n=(r,s)=>{if(M(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[s]=r;const i=L(r)?[]:{};return q(r,(o,c)=>{const p=n(o,s+1);!v(p)&&(i[c]=p)}),t[s]=void 0,i}}return r};return n(e,0)},jt=O("AsyncFunction"),a={isArray:L,isArrayBuffer:Re,isBuffer:it,isFormData:mt,isArrayBufferView:at,isString:ct,isNumber:Oe,isBoolean:ut,isObject:M,isPlainObject:W,isUndefined:v,isDate:lt,isFile:ft,isBlob:dt,isRegExp:Nt,isFunction:A,isStream:ht,isURLSearchParams:yt,isTypedArray:Rt,isFileList:pt,forEach:q,merge:ne,extend:wt,trim:gt,stripBOM:Et,inherits:bt,toFlatObject:St,kindOf:K,kindOfTest:O,endsWith:Ct,toArray:At,forEachEntry:Ot,matchAll:Tt,isHTMLForm:Pt,hasOwnProperty:Ne,hasOwnProp:Ne,reduceDescriptors:xe,freezeMethods:xt,toObjectSet:Ft,toCamelCase:_t,noop:Ut,toFiniteNumber:Dt,findKey:Te,global:Pe,isContextDefined:_e,ALPHABET:Ue,generateString:Lt,isSpecCompliantForm:Bt,toJSONObject:It,isAsyncFn:jt,isThenable:e=>e&&(M(e)||A(e))&&A(e.then)&&A(e.catch)};function m(e,t,n,r,s){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)}a.inherits(m,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:a.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const De=m.prototype,Le={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Le[e]={value:e}}),Object.defineProperties(m,Le),Object.defineProperty(De,"isAxiosError",{value:!0}),m.from=(e,t,n,r,s,i)=>{const o=Object.create(De);return a.toFlatObject(e,o,function(p){return p!==Error.prototype},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};const kt=null;function se(e){return a.isPlainObject(e)||a.isArray(e)}function Be(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function Ie(e,t,n){return e?e.concat(t).map(function(s,i){return s=Be(s),!n&&i?"["+s+"]":s}).join(n?".":""):t}function $t(e){return a.isArray(e)&&!e.some(se)}const vt=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function X(e,t,n){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(d,w){return!a.isUndefined(w[d])});const r=n.metaTokens,s=n.visitor||l,i=n.dots,o=n.indexes,p=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(s))throw new TypeError("visitor must be a function");function h(f){if(f===null)return"";if(a.isDate(f))return f.toISOString();if(!p&&a.isBlob(f))throw new m("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(f)||a.isTypedArray(f)?p&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function l(f,d,w){let b=f;if(f&&!w&&typeof f=="object"){if(a.endsWith(d,"{}"))d=r?d:d.slice(0,-2),f=JSON.stringify(f);else if(a.isArray(f)&&$t(f)||(a.isFileList(f)||a.endsWith(d,"[]"))&&(b=a.toArray(f)))return d=Be(d),b.forEach(function(F,Yn){!(a.isUndefined(F)||F===null)&&t.append(o===!0?Ie([d],Yn,i):o===null?d:d+"[]",h(F))}),!1}return se(f)?!0:(t.append(Ie(w,d,i),h(f)),!1)}const u=[],g=Object.assign(vt,{defaultVisitor:l,convertValue:h,isVisitable:se});function R(f,d){if(!a.isUndefined(f)){if(u.indexOf(f)!==-1)throw Error("Circular reference detected in "+d.join("."));u.push(f),a.forEach(f,function(b,x){(!(a.isUndefined(b)||b===null)&&s.call(t,b,a.isString(x)?x.trim():x,d,g))===!0&&R(b,d?d.concat(x):[x])}),u.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return R(e),t}function je(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function oe(e,t){this._pairs=[],e&&X(e,this,t)}const ke=oe.prototype;ke.append=function(t,n){this._pairs.push([t,n])},ke.toString=function(t){const n=t?function(r){return t.call(this,r,je)}:je;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function qt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function $e(e,t,n){if(!t)return e;const r=n&&n.encode||qt,s=n&&n.serialize;let i;if(s?i=s(t,n):i=a.isURLSearchParams(t)?t.toString():new oe(t,n).toString(r),i){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class Ht{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){a.forEach(this.handlers,function(r){r!==null&&t(r)})}}const ve=Ht,qe={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},zt={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:oe,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},He=typeof window<"u"&&typeof document<"u",Vt=(e=>He&&["ReactNative","NativeScript","NS"].indexOf(e)<0)(typeof navigator<"u"&&navigator.product),Kt=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),T={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:He,hasStandardBrowserEnv:Vt,hasStandardBrowserWebWorkerEnv:Kt},Symbol.toStringTag,{value:"Module"})),...zt};function Jt(e,t){return X(e,new T.classes.URLSearchParams,Object.assign({visitor:function(n,r,s,i){return T.isNode&&a.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}function Mt(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Wt(e){const t={},n=Object.keys(e);let r;const s=n.length;let i;for(r=0;r<s;r++)i=n[r],t[i]=e[i];return t}function ze(e){function t(n,r,s,i){let o=n[i++];const c=Number.isFinite(+o),p=i>=n.length;return o=!o&&a.isArray(s)?s.length:o,p?(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]=Wt(s[o])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){const n={};return a.forEachEntry(e,(r,s)=>{t(Mt(r),s,n,0)}),n}return null}function Xt(e,t,n){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const ie={transitional:qe,adapter:["xhr","http"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,i=a.isObject(t);if(i&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return s&&s?JSON.stringify(ze(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Jt(t,this.formSerializer).toString();if((c=a.isFileList(t))||r.indexOf("multipart/form-data")>-1){const p=this.env&&this.env.FormData;return X(c?{"files[]":t}:t,p&&new p,this.formSerializer)}}return i||s?(n.setContentType("application/json",!1),Xt(t)):t}],transformResponse:[function(t){const n=this.transitional||ie.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(t&&a.isString(t)&&(r&&!this.responseType||s)){const o=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(c){if(o)throw c.name==="SyntaxError"?m.from(c,m.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:T.classes.FormData,Blob:T.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],e=>{ie.headers[e]={}});const ae=ie,Gt=a.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Qt=e=>{const t={};let n,r,s;return e&&e.split(`
|
|
2
|
+
`).forEach(function(o){s=o.indexOf(":"),n=o.substring(0,s).trim().toLowerCase(),r=o.substring(s+1).trim(),!(!n||t[n]&&Gt[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Ve=Symbol("internals");function H(e){return e&&String(e).trim().toLowerCase()}function G(e){return e===!1||e==null?e:a.isArray(e)?e.map(G):String(e)}function Yt(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const Zt=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ce(e,t,n,r,s){if(a.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!a.isString(t)){if(a.isString(r))return t.indexOf(r)!==-1;if(a.isRegExp(r))return r.test(t)}}function en(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function tn(e,t){const n=a.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,i,o){return this[r].call(this,t,s,i,o)},configurable:!0})})}let Q=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function i(c,p,h){const l=H(p);if(!l)throw new Error("header name must be a non-empty string");const u=a.findKey(s,l);(!u||s[u]===void 0||h===!0||h===void 0&&s[u]!==!1)&&(s[u||p]=G(c))}const o=(c,p)=>a.forEach(c,(h,l)=>i(h,l,p));return a.isPlainObject(t)||t instanceof this.constructor?o(t,n):a.isString(t)&&(t=t.trim())&&!Zt(t)?o(Qt(t),n):t!=null&&i(n,t,r),this}get(t,n){if(t=H(t),t){const r=a.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return Yt(s);if(a.isFunction(n))return n.call(this,s,r);if(a.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=H(t),t){const r=a.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||ce(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function i(o){if(o=H(o),o){const c=a.findKey(r,o);c&&(!n||ce(r,r[c],c,n))&&(delete r[c],s=!0)}}return a.isArray(t)?t.forEach(i):i(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const i=n[r];(!t||ce(this,this[i],i,t,!0))&&(delete this[i],s=!0)}return s}normalize(t){const n=this,r={};return a.forEach(this,(s,i)=>{const o=a.findKey(r,i);if(o){n[o]=G(s),delete n[i];return}const c=t?en(i):String(i).trim();c!==i&&delete n[i],n[c]=G(s),r[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return a.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&a.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
|
3
|
+
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[Ve]=this[Ve]={accessors:{}}).accessors,s=this.prototype;function i(o){const c=H(o);r[c]||(tn(s,o),r[c]=!0)}return a.isArray(t)?t.forEach(i):i(t),this}};Q.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),a.reduceDescriptors(Q.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),a.freezeMethods(Q);const P=Q;function ue(e,t){const n=this||ae,r=t||n,s=P.from(r.headers);let i=r.data;return a.forEach(e,function(c){i=c.call(n,i,s.normalize(),t?t.status:void 0)}),s.normalize(),i}function Ke(e){return!!(e&&e.__CANCEL__)}function z(e,t,n){m.call(this,e??"canceled",m.ERR_CANCELED,t,n),this.name="CanceledError"}a.inherits(z,m,{__CANCEL__:!0});function nn(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new m("Request failed with status code "+n.status,[m.ERR_BAD_REQUEST,m.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const rn=T.hasStandardBrowserEnv?{write(e,t,n,r,s,i){const o=[e+"="+encodeURIComponent(t)];a.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),a.isString(r)&&o.push("path="+r),a.isString(s)&&o.push("domain="+s),i===!0&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function sn(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function on(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Je(e,t){return e&&!sn(t)?on(e,t):t}const an=T.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function s(i){let o=i;return t&&(n.setAttribute("href",o),o=n.href),n.setAttribute("href",o),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=s(window.location.href),function(o){const c=a.isString(o)?s(o):o;return c.protocol===r.protocol&&c.host===r.host}}():function(){return function(){return!0}}();function cn(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function un(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,i=0,o;return t=t!==void 0?t:1e3,function(p){const h=Date.now(),l=r[i];o||(o=h),n[s]=p,r[s]=h;let u=i,g=0;for(;u!==s;)g+=n[u++],u=u%e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),h-o<t)return;const R=l&&h-l;return R?Math.round(g*1e3/R):void 0}}function Me(e,t){let n=0;const r=un(50,250);return s=>{const i=s.loaded,o=s.lengthComputable?s.total:void 0,c=i-n,p=r(c),h=i<=o;n=i;const l={loaded:i,total:o,progress:o?i/o:void 0,bytes:c,rate:p||void 0,estimated:p&&o&&h?(o-i)/p:void 0,event:s};l[t?"download":"upload"]=!0,e(l)}}const le={http:kt,xhr:typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){let s=e.data;const i=P.from(e.headers).normalize();let{responseType:o,withXSRFToken:c}=e,p;function h(){e.cancelToken&&e.cancelToken.unsubscribe(p),e.signal&&e.signal.removeEventListener("abort",p)}let l;if(a.isFormData(s)){if(T.hasStandardBrowserEnv||T.hasStandardBrowserWebWorkerEnv)i.setContentType(!1);else if((l=i.getContentType())!==!1){const[d,...w]=l?l.split(";").map(b=>b.trim()).filter(Boolean):[];i.setContentType([d||"multipart/form-data",...w].join("; "))}}let u=new XMLHttpRequest;if(e.auth){const d=e.auth.username||"",w=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(d+":"+w))}const g=Je(e.baseURL,e.url);u.open(e.method.toUpperCase(),$e(g,e.params,e.paramsSerializer),!0),u.timeout=e.timeout;function R(){if(!u)return;const d=P.from("getAllResponseHeaders"in u&&u.getAllResponseHeaders()),b={data:!o||o==="text"||o==="json"?u.responseText:u.response,status:u.status,statusText:u.statusText,headers:d,config:e,request:u};nn(function(F){n(F),h()},function(F){r(F),h()},b),u=null}if("onloadend"in u?u.onloadend=R:u.onreadystatechange=function(){!u||u.readyState!==4||u.status===0&&!(u.responseURL&&u.responseURL.indexOf("file:")===0)||setTimeout(R)},u.onabort=function(){u&&(r(new m("Request aborted",m.ECONNABORTED,e,u)),u=null)},u.onerror=function(){r(new m("Network Error",m.ERR_NETWORK,e,u)),u=null},u.ontimeout=function(){let w=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const b=e.transitional||qe;e.timeoutErrorMessage&&(w=e.timeoutErrorMessage),r(new m(w,b.clarifyTimeoutError?m.ETIMEDOUT:m.ECONNABORTED,e,u)),u=null},T.hasStandardBrowserEnv&&(c&&a.isFunction(c)&&(c=c(e)),c||c!==!1&&an(g))){const d=e.xsrfHeaderName&&e.xsrfCookieName&&rn.read(e.xsrfCookieName);d&&i.set(e.xsrfHeaderName,d)}s===void 0&&i.setContentType(null),"setRequestHeader"in u&&a.forEach(i.toJSON(),function(w,b){u.setRequestHeader(b,w)}),a.isUndefined(e.withCredentials)||(u.withCredentials=!!e.withCredentials),o&&o!=="json"&&(u.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&u.addEventListener("progress",Me(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&u.upload&&u.upload.addEventListener("progress",Me(e.onUploadProgress)),(e.cancelToken||e.signal)&&(p=d=>{u&&(r(!d||d.type?new z(null,e,u):d),u.abort(),u=null)},e.cancelToken&&e.cancelToken.subscribe(p),e.signal&&(e.signal.aborted?p():e.signal.addEventListener("abort",p)));const f=cn(g);if(f&&T.protocols.indexOf(f)===-1){r(new m("Unsupported protocol "+f+":",m.ERR_BAD_REQUEST,e));return}u.send(s||null)})}};a.forEach(le,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const We=e=>`- ${e}`,ln=e=>a.isFunction(e)||e===null||e===!1,Xe={getAdapter:e=>{e=a.isArray(e)?e:[e];const{length:t}=e;let n,r;const s={};for(let i=0;i<t;i++){n=e[i];let o;if(r=n,!ln(n)&&(r=le[(o=String(n)).toLowerCase()],r===void 0))throw new m(`Unknown adapter '${o}'`);if(r)break;s[o||"#"+i]=r}if(!r){const i=Object.entries(s).map(([c,p])=>`adapter ${c} `+(p===!1?"is not supported by the environment":"is not available in the build"));let o=t?i.length>1?`since :
|
|
4
4
|
`+i.map(We).join(`
|
|
5
|
-
`):" "+We(i[0]):"as no adapter specified";throw new m("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return r},adapters:le};function fe(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new H(null,e)}function Ge(e){return fe(e),e.headers=P.from(e.headers),e.data=ue.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Xe.getAdapter(e.adapter||ae.adapter)(e).then(function(r){return fe(e),r.data=ue.call(e,e.transformResponse,r),r.headers=P.from(r.headers),r},function(r){return Ke(r)||(fe(e),r&&r.response&&(r.response.data=ue.call(e,e.transformResponse,r.response),r.response.headers=P.from(r.response.headers))),Promise.reject(r)})}const Qe=e=>e instanceof P?e.toJSON():e;function L(e,t){t=t||{};const n={};function r(h,l,u){return a.isPlainObject(h)&&a.isPlainObject(l)?a.merge.call({caseless:u},h,l):a.isPlainObject(l)?a.merge({},l):a.isArray(l)?l.slice():l}function s(h,l,u){if(a.isUndefined(l)){if(!a.isUndefined(h))return r(void 0,h,u)}else return r(h,l,u)}function i(h,l){if(!a.isUndefined(l))return r(void 0,l)}function o(h,l){if(a.isUndefined(l)){if(!a.isUndefined(h))return r(void 0,h)}else return r(void 0,l)}function c(h,l,u){if(u in t)return r(h,l);if(u in e)return r(void 0,h)}const p={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:c,headers:(h,l)=>s(Qe(h),Qe(l),!0)};return a.forEach(Object.keys(Object.assign({},e,t)),function(l){const u=p[l]||s,g=u(e[l],t[l],l);a.isUndefined(g)&&u!==c||(n[l]=g)}),n}const Ye="1.6.3",de={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{de[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Ze={};de.transitional=function(t,n,r){function s(i,o){return"[Axios v"+Ye+"] Transitional option '"+i+"'"+o+(r?". "+r:"")}return(i,o,c)=>{if(t===!1)throw new m(s(o," has been removed"+(n?" in "+n:"")),m.ERR_DEPRECATED);return n&&!Ze[o]&&(Ze[o]=!0,console.warn(s(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,o,c):!0}};function fn(e,t,n){if(typeof e!="object")throw new m("options must be an object",m.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const i=r[s],o=t[i];if(o){const c=e[i],p=c===void 0||o(c,i,e);if(p!==!0)throw new m("option "+i+" must be "+p,m.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new m("Unknown option "+i,m.ERR_BAD_OPTION)}}const pe={assertOptions:fn,validators:de},N=pe.validators;let Y=class{constructor(t){this.defaults=t,this.interceptors={request:new ve,response:new ve}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=L(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:i}=n;r!==void 0&&pe.assertOptions(r,{silentJSONParsing:N.transitional(N.boolean),forcedJSONParsing:N.transitional(N.boolean),clarifyTimeoutError:N.transitional(N.boolean)},!1),s!=null&&(a.isFunction(s)?n.paramsSerializer={serialize:s}:pe.assertOptions(s,{encode:N.function,serialize:N.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=i&&a.merge(i.common,i[n.method]);i&&a.forEach(["delete","get","head","post","put","patch","common"],f=>{delete i[f]}),n.headers=P.concat(o,i);const c=[];let p=!0;this.interceptors.request.forEach(function(d){typeof d.runWhen=="function"&&d.runWhen(n)===!1||(p=p&&d.synchronous,c.unshift(d.fulfilled,d.rejected))});const h=[];this.interceptors.response.forEach(function(d){h.push(d.fulfilled,d.rejected)});let l,u=0,g;if(!p){const f=[Ge.bind(this),void 0];for(f.unshift.apply(f,c),f.push.apply(f,h),g=f.length,l=Promise.resolve(n);u<g;)l=l.then(f[u++],f[u++]);return l}g=c.length;let R=n;for(u=0;u<g;){const f=c[u++],d=c[u++];try{R=f(R)}catch(w){d.call(this,w);break}}try{l=Ge.call(this,R)}catch(f){return Promise.reject(f)}for(u=0,g=h.length;u<g;)l=l.then(h[u++],h[u++]);return l}getUri(t){t=L(this.defaults,t);const n=Je(t.baseURL,t.url);return $e(n,t.params,t.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(t){Y.prototype[t]=function(n,r){return this.request(L(r||{},{method:t,url:n,data:(r||{}).data}))}}),a.forEach(["post","put","patch"],function(t){function n(r){return function(i,o,c){return this.request(L(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}Y.prototype[t]=n(),Y.prototype[t+"Form"]=n(!0)});const Z=Y,dn=class ot{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(s=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](s);r._listeners=null}),this.promise.then=s=>{let i;const o=new Promise(c=>{r.subscribe(c),i=c}).then(s);return o.cancel=function(){r.unsubscribe(i)},o},t(function(i,o,c){r.reason||(r.reason=new H(i,o,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new ot(function(s){t=s}),cancel:t}}};function pn(e){return function(n){return e.apply(null,n)}}function hn(e){return a.isObject(e)&&e.isAxiosError===!0}const he={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(he).forEach(([e,t])=>{he[t]=e});const mn=he;function et(e){const t=new Z(e),n=S(Z.prototype.request,t);return a.extend(n,Z.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return et(L(e,s))},n}const y=et(ae);y.Axios=Z,y.CanceledError=H,y.CancelToken=dn,y.isCancel=Ke,y.VERSION=Ye,y.toFormData=X,y.AxiosError=m,y.Cancel=y.CanceledError,y.all=function(t){return Promise.all(t)},y.spread=pn,y.isAxiosError=hn,y.mergeConfig=L,y.AxiosHeaders=P,y.formToJSON=e=>ze(a.isHTMLForm(e)?new FormData(e):e),y.getAdapter=Xe.getAdapter,y.HttpStatusCode=mn,y.default=y;const tt=y,{Axios:ar,AxiosError:me,CanceledError:cr,isCancel:ur,CancelToken:lr,VERSION:fr,all:dr,Cancel:pr,isAxiosError:hr,spread:mr,toFormData:yr,AxiosHeaders:gr,HttpStatusCode:wr,formToJSON:Er,getAdapter:br,mergeConfig:Sr}=tt;class ye extends Error{constructor(n){super(n.join(", "));C(this,"errors");this.name="ValidationError",this.errors=n}}class ge extends Error{constructor(n){super("Address already registered.");C(this,"address");this.name="AddressInUseError",this.address=n}}class we extends Error{constructor(n){super("Code already registered.");C(this,"code");this.name="CodeInUseError",this.code=n}}class Ee extends Error{constructor(){super("Invalid signature provided"),this.name="InvalidSignatureError"}}class yn{constructor(t){C(this,"httpClient");C(this,"_debug");this.httpClient=t.httpClient,this._debug=t.debug}async create(t,n,r){var s;try{await this.httpClient.post("/affiliates",{address:t,name:n,code:n,signature:r})}catch(i){if(i instanceof me){const o=(s=i.response)==null?void 0:s.data;if(typeof(o==null?void 0:o.message)=="string"){const c=o.message.toLowerCase();throw c=="invalid signature"?new Ee:c=="address in use"?new ge(t):c=="code in use"?new we(n):new Error(c)}else if((o==null?void 0:o.message)instanceof Array)throw new ye(o.message)}throw i}}async update(t,n,r){var s;try{await this.httpClient.post(`/affiliates/${t}`,{code:n,address:t,signature:r})}catch(i){if(i instanceof me){const o=(s=i.response)==null?void 0:s.data;if(typeof(o==null?void 0:o.message)=="string"){const c=o.message.toLowerCase();throw c=="invalid signature"?new Ee:c=="address in use"?new ge(t):c=="code in use"?new we(n):new Error(c)}else if((o==null?void 0:o.message)instanceof Array)throw new ye(o.message)}throw i}}async isCodeFree(t){var n;try{return await this.httpClient.get(`/affiliates/codes/${t}`),!1}catch(r){return r instanceof me&&((n=r.response)==null?void 0:n.status)===404?!0:(console.error("Fuul SDK: Could not check affiliate code",r),!1)}}async getCode(t){try{return(await this.httpClient.get(`/affiliates/${t}`)).data.code}catch(n){return console.error("Fuul SDK: Could not get affiliate code",n),null}}}class gn{constructor(t){C(this,"httpClient");this.httpClient=t.httpClient}async getAll(){const{data:t}=await this.httpClient.get("conversions");return t}}const nt="fuul.sent",wn=60;class En{constructor(t){C(this,"debug");C(this,"httpClient");this.httpClient=t.httpClient,this.debug=!!t.debug}async sendEvent(t){if(this.isDuplicate(t)){this.debug&&console.debug("Fuul SDK: Event is considered duplicate and will not be sent");return}await this.httpClient.post("events",t),this.debug&&console.debug(`Fuul SDK: Sent '${t.name}' event`),this.saveSentEvent(t)}isDuplicate(t){const n=`${nt}_${t.name}`,r=localStorage.getItem(n);if(!r)return!1;const s=JSON.parse(r);if(this.getCurrentTimestamp()-s.timestamp>wn)return!1;let p=!1;t.metadata&&(p=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);let h=!1;return t.args&&s.args&&(h=s.args.page===t.args.page),h&&p}getCurrentTimestamp(){return Date.now()/1e3}saveSentEvent(t){const n=`${nt}_${t.name}`,r=this.getCurrentTimestamp(),s={...t,timestamp:r};localStorage.setItem(n,JSON.stringify(s))}}const bn={version:"4.1.1"};class Sn{constructor(t){C(this,"client");C(this,"queryParams");this.client=tt.create({...t,headers:{Authorization:`Bearer ${t.apiKey}`,"X-Fuul-Sdk-Version":bn.version}}),this.queryParams=t.queryParams?this.buildQueryParams(t.queryParams):""}buildQueryParams(t){let n="";return Object.keys(t).forEach(r=>{n=n===""?n+`?${r}=${t[r]}`:n+`&${r}=${t[r]}`}),n}async get(t,n){return this.client.get(t+this.queryParams,{params:n})}async post(t,n){return this.client.post(t+this.queryParams,n)}async put(t,n){return this.client.put(t+this.queryParams,n)}async delete(t){return this.client.delete(t+this.queryParams)}}const B="/payouts";class Cn{constructor(t){C(this,"httpClient");C(this,"_debug");this.httpClient=t.httpClient,this._debug=t.debug}async getPayoutsLeaderboard(t){return(await this.httpClient.get(`${B}/leaderboard`,t)).data}async getPointsLeaderboard(t){return(await this.httpClient.get(`${B}/leaderboard`,t)).data}async getUserPayoutsByConversion(t){return(await this.httpClient.get(B,{...t,type:"onchain-currency"})).data}async getUserPointsByConversion(t){return(await this.httpClient.get(B,{...t,type:"point"})).data}async getUserPayoutMovements(t){return(await this.httpClient.get(`${B}/movements`,{...t,type:"onchain-currency"})).data}async getUserPointsMovements(t){return(await this.httpClient.get(`${B}/movements`,{...t,type:"point"})).data}}let An=(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),"");const Rn="fuul.tracking_id",be=()=>xn(Rn,()=>An()),rt=()=>I("af")||I("referrer"),On=()=>document.referrer,Tn=()=>Fn(),Pn=()=>I("category"),_n=()=>I("title"),Nn=()=>I("tag"),xn=(e,t)=>{const n=localStorage.getItem(e);if(n)return n;{const r=t();return r?localStorage.setItem(e,r):localStorage.removeItem(e),r}},I=e=>new URLSearchParams(window.location.search).get(e),Fn=()=>{const e=I("source");if(e)return e},Un="https://api.fuul.xyz/api/v1/";let j=!1,Se=!1,Ce,z,st,k,ee,V;function Dn(e){j=!!e.debug,!Se&&(Ce=e.apiKey,Mn(),z=Wn(e.baseApiUrl??Un,e.defaultQueryParams??{}),st=new gn({httpClient:z,debug:j}),ee=new En({httpClient:z,debug:j}),k=new yn({httpClient:z,debug:j}),V=new Cn({httpClient:z,debug:j}),Se=!0,j&&console.debug("Fuul SDK: init() complete"))}function _(){if(!Se)throw new Error("Fuul SDK: You need to call init() to initialize the library before using any methods")}async function Ln(e,t){_(),Ae();const n={name:e,args:t??{},metadata:{tracking_id:be()}};await ee.sendEvent(n)}async function Bn(e){_(),Ae();const t={name:"pageview",args:{page:e??document.location.pathname,locationOrigin:document.location.origin},metadata:{tracking_id:be(),referrer_url:On(),source:Tn(),affiliate_id:rt()??void 0,referrer:rt()??void 0,category:Pn()??void 0,title:_n()??void 0,tag:Nn()??void 0}};await ee.sendEvent(t)}async function In(e){_(),Ae();const t={name:"connect_wallet",args:{},metadata:{tracking_id:be()}};e!=null&&e.address&&(t.user_address=e.address),e!=null&&e.signature&&(t.signature=e==null?void 0:e.signature,t.signature_message=e==null?void 0:e.message),await ee.sendEvent(t)}async function jn(e,t,n){_(),await k.create(e,t,n)}async function kn(e,t,n){_(),await k.update(e,t,n)}async function $n(e){return _(),await k.getCode(e)}async function vn(e){return _(),await k.isCodeFree(e)}async function qn(e,t,n){_();const r=await k.getCode(t),s=new URLSearchParams({af:r??t});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()}`}function Hn(e){return V.getPayoutsLeaderboard(e)}function zn(e){return V.getPointsLeaderboard(e)}function Vn(e){return V.getUserPayoutsByConversion(e)}function Kn(e){return V.getUserPointsByConversion(e)}async function Jn(){return _(),st.getAll()}function Ae(){if(typeof window>"u"||typeof document>"u")throw new Error("Fuul SDK: Browser context required")}function Mn(){if(!Ce)throw new Error("Fuul SDK: Invalid API key")}function Wn(e,t){return new Sn({baseURL:e,timeout:1e4,apiKey:Ce,queryParams:t})}const Xn={init:Dn,sendEvent:Ln,sendPageview:Bn,sendConnectWallet:In,generateTrackingLink:qn,getConversions:Jn,createAffiliateCode:jn,updateAffiliateCode:kn,getAffiliateCode:$n,isAffiliateCodeFree:vn,getPayoutsLeaderboard:Hn,getPointsLeaderboard:zn,getUserPayoutsByConversion:Vn,getUserPointsByConversion:Kn};E.AddressInUseError=ge,E.CodeInUseError=we,E.Fuul=Xn,E.InvalidSignatureError=Ee,E.ValidationError=ye,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})});
|
|
5
|
+
`):" "+We(i[0]):"as no adapter specified";throw new m("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return r},adapters:le};function fe(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new z(null,e)}function Ge(e){return fe(e),e.headers=P.from(e.headers),e.data=ue.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Xe.getAdapter(e.adapter||ae.adapter)(e).then(function(r){return fe(e),r.data=ue.call(e,e.transformResponse,r),r.headers=P.from(r.headers),r},function(r){return Ke(r)||(fe(e),r&&r.response&&(r.response.data=ue.call(e,e.transformResponse,r.response),r.response.headers=P.from(r.response.headers))),Promise.reject(r)})}const Qe=e=>e instanceof P?e.toJSON():e;function B(e,t){t=t||{};const n={};function r(h,l,u){return a.isPlainObject(h)&&a.isPlainObject(l)?a.merge.call({caseless:u},h,l):a.isPlainObject(l)?a.merge({},l):a.isArray(l)?l.slice():l}function s(h,l,u){if(a.isUndefined(l)){if(!a.isUndefined(h))return r(void 0,h,u)}else return r(h,l,u)}function i(h,l){if(!a.isUndefined(l))return r(void 0,l)}function o(h,l){if(a.isUndefined(l)){if(!a.isUndefined(h))return r(void 0,h)}else return r(void 0,l)}function c(h,l,u){if(u in t)return r(h,l);if(u in e)return r(void 0,h)}const p={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:c,headers:(h,l)=>s(Qe(h),Qe(l),!0)};return a.forEach(Object.keys(Object.assign({},e,t)),function(l){const u=p[l]||s,g=u(e[l],t[l],l);a.isUndefined(g)&&u!==c||(n[l]=g)}),n}const Ye="1.6.3",de={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{de[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Ze={};de.transitional=function(t,n,r){function s(i,o){return"[Axios v"+Ye+"] Transitional option '"+i+"'"+o+(r?". "+r:"")}return(i,o,c)=>{if(t===!1)throw new m(s(o," has been removed"+(n?" in "+n:"")),m.ERR_DEPRECATED);return n&&!Ze[o]&&(Ze[o]=!0,console.warn(s(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,o,c):!0}};function fn(e,t,n){if(typeof e!="object")throw new m("options must be an object",m.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const i=r[s],o=t[i];if(o){const c=e[i],p=c===void 0||o(c,i,e);if(p!==!0)throw new m("option "+i+" must be "+p,m.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new m("Unknown option "+i,m.ERR_BAD_OPTION)}}const pe={assertOptions:fn,validators:de},N=pe.validators;let Y=class{constructor(t){this.defaults=t,this.interceptors={request:new ve,response:new ve}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=B(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:i}=n;r!==void 0&&pe.assertOptions(r,{silentJSONParsing:N.transitional(N.boolean),forcedJSONParsing:N.transitional(N.boolean),clarifyTimeoutError:N.transitional(N.boolean)},!1),s!=null&&(a.isFunction(s)?n.paramsSerializer={serialize:s}:pe.assertOptions(s,{encode:N.function,serialize:N.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=i&&a.merge(i.common,i[n.method]);i&&a.forEach(["delete","get","head","post","put","patch","common"],f=>{delete i[f]}),n.headers=P.concat(o,i);const c=[];let p=!0;this.interceptors.request.forEach(function(d){typeof d.runWhen=="function"&&d.runWhen(n)===!1||(p=p&&d.synchronous,c.unshift(d.fulfilled,d.rejected))});const h=[];this.interceptors.response.forEach(function(d){h.push(d.fulfilled,d.rejected)});let l,u=0,g;if(!p){const f=[Ge.bind(this),void 0];for(f.unshift.apply(f,c),f.push.apply(f,h),g=f.length,l=Promise.resolve(n);u<g;)l=l.then(f[u++],f[u++]);return l}g=c.length;let R=n;for(u=0;u<g;){const f=c[u++],d=c[u++];try{R=f(R)}catch(w){d.call(this,w);break}}try{l=Ge.call(this,R)}catch(f){return Promise.reject(f)}for(u=0,g=h.length;u<g;)l=l.then(h[u++],h[u++]);return l}getUri(t){t=B(this.defaults,t);const n=Je(t.baseURL,t.url);return $e(n,t.params,t.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(t){Y.prototype[t]=function(n,r){return this.request(B(r||{},{method:t,url:n,data:(r||{}).data}))}}),a.forEach(["post","put","patch"],function(t){function n(r){return function(i,o,c){return this.request(B(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}Y.prototype[t]=n(),Y.prototype[t+"Form"]=n(!0)});const Z=Y,dn=class ot{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(s=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](s);r._listeners=null}),this.promise.then=s=>{let i;const o=new Promise(c=>{r.subscribe(c),i=c}).then(s);return o.cancel=function(){r.unsubscribe(i)},o},t(function(i,o,c){r.reason||(r.reason=new z(i,o,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new ot(function(s){t=s}),cancel:t}}};function pn(e){return function(n){return e.apply(null,n)}}function hn(e){return a.isObject(e)&&e.isAxiosError===!0}const he={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(he).forEach(([e,t])=>{he[t]=e});const mn=he;function et(e){const t=new Z(e),n=S(Z.prototype.request,t);return a.extend(n,Z.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return et(B(e,s))},n}const y=et(ae);y.Axios=Z,y.CanceledError=z,y.CancelToken=dn,y.isCancel=Ke,y.VERSION=Ye,y.toFormData=X,y.AxiosError=m,y.Cancel=y.CanceledError,y.all=function(t){return Promise.all(t)},y.spread=pn,y.isAxiosError=hn,y.mergeConfig=B,y.AxiosHeaders=P,y.formToJSON=e=>ze(a.isHTMLForm(e)?new FormData(e):e),y.getAdapter=Xe.getAdapter,y.HttpStatusCode=mn,y.default=y;const tt=y,{Axios:ur,AxiosError:me,CanceledError:lr,isCancel:fr,CancelToken:dr,VERSION:pr,all:hr,Cancel:mr,isAxiosError:yr,spread:gr,toFormData:wr,AxiosHeaders:Er,HttpStatusCode:br,formToJSON:Sr,getAdapter:Cr,mergeConfig:Ar}=tt;class ye extends Error{constructor(n){super(n.join(", "));C(this,"errors");this.name="ValidationError",this.errors=n}}class ge extends Error{constructor(n){super("Address already registered.");C(this,"address");this.name="AddressInUseError",this.address=n}}class we extends Error{constructor(n){super("Code already registered.");C(this,"code");this.name="CodeInUseError",this.code=n}}class Ee extends Error{constructor(){super("Invalid signature provided"),this.name="InvalidSignatureError"}}class yn{constructor(t){C(this,"httpClient");C(this,"_debug");this.httpClient=t.httpClient,this._debug=t.debug}async create(t,n,r){var s;try{await this.httpClient.post("/affiliates",{address:t,name:n,code:n,signature:r})}catch(i){if(i instanceof me){const o=(s=i.response)==null?void 0:s.data;if(typeof(o==null?void 0:o.message)=="string"){const c=o.message.toLowerCase();throw c=="invalid signature"?new Ee:c=="address in use"?new ge(t):c=="code in use"?new we(n):new Error(c)}else if((o==null?void 0:o.message)instanceof Array)throw new ye(o.message)}throw i}}async update(t,n,r){var s;try{await this.httpClient.post(`/affiliates/${t}`,{code:n,address:t,signature:r})}catch(i){if(i instanceof me){const o=(s=i.response)==null?void 0:s.data;if(typeof(o==null?void 0:o.message)=="string"){const c=o.message.toLowerCase();throw c=="invalid signature"?new Ee:c=="address in use"?new ge(t):c=="code in use"?new we(n):new Error(c)}else if((o==null?void 0:o.message)instanceof Array)throw new ye(o.message)}throw i}}async isCodeFree(t){var n;try{return await this.httpClient.get(`/affiliates/codes/${t}`),!1}catch(r){return r instanceof me&&((n=r.response)==null?void 0:n.status)===404?!0:(console.error("Fuul SDK: Could not check affiliate code",r),!1)}}async getCode(t){try{return(await this.httpClient.get(`/affiliates/${t}`)).data.code}catch(n){return console.error("Fuul SDK: Could not get affiliate code",n),null}}}class gn{constructor(t){C(this,"httpClient");this.httpClient=t.httpClient}async getAll(){const{data:t}=await this.httpClient.get("conversions");return t}}const nt="fuul.sent",wn=60;class En{constructor(t){C(this,"debug");C(this,"httpClient");this.httpClient=t.httpClient,this.debug=!!t.debug}async sendEvent(t){if(this.isDuplicate(t)){this.debug&&console.debug("Fuul SDK: Event is considered duplicate and will not be sent");return}await this.httpClient.post("events",t),this.debug&&console.debug(`Fuul SDK: Sent '${t.name}' event`),this.saveSentEvent(t)}isDuplicate(t){const n=`${nt}_${t.name}`,r=localStorage.getItem(n);if(!r)return!1;const s=JSON.parse(r);if(this.getCurrentTimestamp()-s.timestamp>wn)return!1;let p=!1;t.metadata&&(p=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);let h=!1;return t.args&&s.args&&(h=s.args.page===t.args.page),h&&p}getCurrentTimestamp(){return Date.now()/1e3}saveSentEvent(t){const n=`${nt}_${t.name}`,r=this.getCurrentTimestamp(),s={...t,timestamp:r};localStorage.setItem(n,JSON.stringify(s))}}const bn={version:"4.1.3"};class Sn{constructor(t){C(this,"client");C(this,"queryParams");this.client=tt.create({...t,headers:{Authorization:`Bearer ${t.apiKey}`,"X-Fuul-Sdk-Version":bn.version}}),this.queryParams=t.queryParams?this.buildQueryParams(t.queryParams):""}buildQueryParams(t){let n="";return Object.keys(t).forEach(r=>{n=n===""?n+`?${r}=${t[r]}`:n+`&${r}=${t[r]}`}),n}async get(t,n){return this.client.get(t+this.queryParams,{params:n})}async post(t,n){return this.client.post(t+this.queryParams,n)}async put(t,n){return this.client.put(t+this.queryParams,n)}async delete(t){return this.client.delete(t+this.queryParams)}}const I="/payouts";class Cn{constructor(t){C(this,"httpClient");C(this,"_debug");this.httpClient=t.httpClient,this._debug=t.debug}async getPayoutsLeaderboard(t){return(await this.httpClient.get(`${I}/leaderboard`,t)).data}async getPointsLeaderboard(t){return(await this.httpClient.get(`${I}/leaderboard`,t)).data}async getUserPayoutsByConversion(t){return(await this.httpClient.get(I,{...t,type:"onchain-currency"})).data}async getUserPointsByConversion(t){return(await this.httpClient.get(I,{...t,type:"point"})).data}async getUserPayoutMovements(t){return(await this.httpClient.get(`${I}/movements`,{...t,type:"onchain-currency"})).data}async getUserPointsMovements(t){return(await this.httpClient.get(`${I}/movements`,{...t,type:"point"})).data}}let An=(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),"");const Rn="fuul.tracking_id",be=()=>xn(Rn,()=>An()),rt=()=>j("af")||j("referrer"),On=()=>document.referrer,Tn=()=>Fn(),Pn=()=>j("category"),_n=()=>j("title"),Nn=()=>j("tag"),xn=(e,t)=>{const n=localStorage.getItem(e);if(n)return n;{const r=t();return r?localStorage.setItem(e,r):localStorage.removeItem(e),r}},j=e=>new URLSearchParams(window.location.search).get(e),Fn=()=>{const e=j("source");if(e)return e},Un="https://api.fuul.xyz/api/v1/";let k=!1,Se=!1,Ce,V,st,$,ee,D;function Dn(e){k=!!e.debug,!Se&&(Ce=e.apiKey,Xn(),V=Gn(e.baseApiUrl??Un,e.defaultQueryParams??{}),st=new gn({httpClient:V,debug:k}),ee=new En({httpClient:V,debug:k}),$=new yn({httpClient:V,debug:k}),D=new Cn({httpClient:V,debug:k}),Se=!0,k&&console.debug("Fuul SDK: init() complete"))}function _(){if(!Se)throw new Error("Fuul SDK: You need to call init() to initialize the library before using any methods")}async function Ln(e,t){_(),Ae();const n={name:e,args:t??{},metadata:{tracking_id:be()}};await ee.sendEvent(n)}async function Bn(e){_(),Ae();const t={name:"pageview",args:{page:e??document.location.pathname,locationOrigin:document.location.origin},metadata:{tracking_id:be(),referrer_url:On(),source:Tn(),affiliate_id:rt()??void 0,referrer:rt()??void 0,category:Pn()??void 0,title:_n()??void 0,tag:Nn()??void 0}};await ee.sendEvent(t)}async function In(e){_(),Ae();const t={name:"connect_wallet",args:{page:document.location.pathname,locationOrigin:document.location.origin},metadata:{tracking_id:be()}};e!=null&&e.address&&(t.user_address=e.address),e!=null&&e.signature&&(t.signature=e==null?void 0:e.signature,t.signature_message=e==null?void 0:e.message),await ee.sendEvent(t)}async function jn(e,t,n){_(),await $.create(e,t,n)}async function kn(e,t,n){_(),await $.update(e,t,n)}async function $n(e){return _(),await $.getCode(e)}async function vn(e){return _(),await $.isCodeFree(e)}async function qn(e,t,n){_();const r=await $.getCode(t),s=new URLSearchParams({af:r??t});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()}`}function Hn(e){return D.getPayoutsLeaderboard(e)}function zn(e){return D.getPointsLeaderboard(e)}function Vn(e){return D.getUserPayoutsByConversion(e)}function Kn(e){return D.getUserPointsByConversion(e)}function Jn(e){return D.getUserPayoutMovements(e)}function Mn(e){return D.getUserPointsMovements(e)}async function Wn(){return _(),st.getAll()}function Ae(){if(typeof window>"u"||typeof document>"u")throw new Error("Fuul SDK: Browser context required")}function Xn(){if(!Ce)throw new Error("Fuul SDK: Invalid API key")}function Gn(e,t){return new Sn({baseURL:e,timeout:1e4,apiKey:Ce,queryParams:t})}const Qn={init:Dn,sendEvent:Ln,sendPageview:Bn,sendConnectWallet:In,generateTrackingLink:qn,getConversions:Wn,createAffiliateCode:jn,updateAffiliateCode:kn,getAffiliateCode:$n,isAffiliateCodeFree:vn,getPayoutsLeaderboard:Hn,getPointsLeaderboard:zn,getUserPayoutsByConversion:Vn,getUserPointsByConversion:Kn,getUserPointsMovements:Mn,getUserPayoutMovements:Jn};E.AddressInUseError=ge,E.CodeInUseError=we,E.Fuul=Qn,E.InvalidSignatureError=Ee,E.ValidationError=ye,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})});
|