@fuul/sdk 7.0.1 → 7.0.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.
@@ -8,8 +8,8 @@ export declare class AffiliateService {
8
8
  private readonly httpClient;
9
9
  private readonly _debug;
10
10
  constructor(settings: AffiliateServiceSettings);
11
- create(address: string, identifier_type: UserIdentifierType, code: string, signature: string, accountChainId?: number): Promise<void>;
12
- update(user_identifier: string, identifier_type: UserIdentifierType, code: string, signature: string, accountChainId?: number): Promise<void>;
11
+ create(address: string, identifier_type: UserIdentifierType, code: string, signature: string, signaturePublicKey?: string, accountChainId?: number): Promise<void>;
12
+ update(user_identifier: string, identifier_type: UserIdentifierType, code: string, signature: string, signaturePublicKey?: string, accountChainId?: number): Promise<void>;
13
13
  isCodeFree(code: string): Promise<boolean>;
14
14
  getCode(address: string, identifier_type: UserIdentifierType): Promise<string | null>;
15
15
  }
@@ -1 +1 @@
1
- {"version":3,"file":"AffiliateService.d.ts","sourceRoot":"","sources":["../../src/affiliates/AffiliateService.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,IAAI,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3C,MAAM,MAAM,wBAAwB,GAAG;IACrC,UAAU,EAAE,UAAU,CAAC;IACvB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;IACxC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAsB;gBAEjC,QAAQ,EAAE,wBAAwB;IAKjC,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAqCrI,MAAM,CACjB,eAAe,EAAE,MAAM,EACvB,eAAe,EAAE,kBAAkB,EACnC,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,EACjB,cAAc,CAAC,EAAE,MAAM,GACtB,OAAO,CAAC,IAAI,CAAC;IAoCH,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAe1C,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;CAcnG"}
1
+ {"version":3,"file":"AffiliateService.d.ts","sourceRoot":"","sources":["../../src/affiliates/AffiliateService.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,IAAI,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3C,MAAM,MAAM,wBAAwB,GAAG;IACrC,UAAU,EAAE,UAAU,CAAC;IACvB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;IACxC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAsB;gBAEjC,QAAQ,EAAE,wBAAwB;IAKjC,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAsClK,MAAM,CACjB,eAAe,EAAE,MAAM,EACvB,eAAe,EAAE,kBAAkB,EACnC,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,EACjB,kBAAkB,CAAC,EAAE,MAAM,EAC3B,cAAc,CAAC,EAAE,MAAM,GACtB,OAAO,CAAC,IAAI,CAAC;IAqCH,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAe1C,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;CAcnG"}
package/dist/core.d.ts CHANGED
@@ -34,7 +34,8 @@ export declare function sendPageview(pageName?: string, projectIds?: string[]):
34
34
  * identifier: '0x12345',
35
35
  * identifierType: UserIdentifierType.EvmAddress,
36
36
  * signature: '0xaad9a0b62f87c15a248cb99ca926785b828b5',
37
- * signatureMessage: 'Accept referral from Fuul'
37
+ * message: 'Accept referral from Fuul',
38
+ * signaturePublicKey: '<public-key>' // optional
38
39
  * })
39
40
  *
40
41
  *
@@ -43,7 +44,8 @@ export declare function sendPageview(pageName?: string, projectIds?: string[]):
43
44
  * identifier: '0x12345',
44
45
  * identifierType: UserIdentifierType.EvmAddress,
45
46
  * signature: '0xaad9a0b62f87c15a248cb99ca926785b828b5',
46
- * signatureMessage: 'Accept referral from Fuul'
47
+ * message: 'Accept referral from Fuul',
48
+ * signaturePublicKey: '<public-key>', // optional
47
49
  * accountChainId: 8453,
48
50
  * })
49
51
  * ```
@@ -56,6 +58,7 @@ export declare function identifyUser(params: IdentifyUserParams, projectIds?: st
56
58
  * @param {UserIdentifierType} params.identifierType The affiliate identifier type
57
59
  * @param {string} params.code Affiliate code to map address to
58
60
  * @param {string} params.signature Signed message authenticating address ownership. Message to be signed: `I confirm that I am creating the ${code} code on Fuul`
61
+ * @param {string} [params.signaturePublicKey] Public key used for signature verification
59
62
  * @param {number} [params.accountChainId] Account chain id (required for EIP-1271 signature validation)
60
63
  * @example
61
64
  * ```typescript
@@ -63,7 +66,8 @@ export declare function identifyUser(params: IdentifyUserParams, projectIds?: st
63
66
  * userIdentifier: '0x12345',
64
67
  * identifierType: UserIdentifierType.EvmAddress,
65
68
  * code: 'my-cool-code',
66
- * signature: '<signature>'
69
+ * signature: '<signature>',
70
+ * signaturePublicKey: '<public-key>' // optional
67
71
  * })
68
72
  * ```
69
73
  **/
@@ -75,6 +79,7 @@ export declare function createAffiliateCode(params: AffiliateCodeParams): Promis
75
79
  * @param {UserIdentifierType} params.identifierType Affiliate identifier type
76
80
  * @param {string} params.code New affiliate code
77
81
  * @param {string} params.signature Signed message authenticating code update. Message to be signed: `I confirm that I am updating my code to ${code} on Fuul`
82
+ * @param {string} [params.signaturePublicKey] Public key used for signature verification
78
83
  * @param {number} [params.accountChainId] Account chain id (required for EIP-1271 signature validation)
79
84
  * @example
80
85
  * ```typescript
@@ -82,7 +87,8 @@ export declare function createAffiliateCode(params: AffiliateCodeParams): Promis
82
87
  * userIdentifier: '0x12345',
83
88
  * identifierType: UserIdentifierType.EvmAddress,
84
89
  * code: 'my-new-cool-code',
85
- * signature: '<signature>'
90
+ * signature: '<signature>',
91
+ * signaturePublicKey: '<public-key>' // optional
86
92
  * })
87
93
  * ```
88
94
  **/
@@ -1 +1 @@
1
- {"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"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"}
package/dist/index.mjs CHANGED
@@ -75,7 +75,7 @@ function me() {
75
75
  }
76
76
  const Ht = (e, t, n, { allOwnKeys: r } = {}) => (Q(t, (s, o) => {
77
77
  n && _(s) ? e[o] = Xe(s, n) : e[o] = s;
78
- }, { allOwnKeys: r }), e), Vt = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), Kt = (e, t, n, r) => {
78
+ }, { allOwnKeys: r }), e), Kt = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), Vt = (e, t, n, r) => {
79
79
  e.prototype = Object.create(t.prototype, r), e.prototype.constructor = e, Object.defineProperty(e, "super", {
80
80
  value: t.prototype
81
81
  }), n && Object.assign(e.prototype, n);
@@ -209,8 +209,8 @@ const an = (e) => {
209
209
  merge: me,
210
210
  extend: Ht,
211
211
  trim: $t,
212
- stripBOM: Vt,
213
- inherits: Kt,
212
+ stripBOM: Kt,
213
+ inherits: Vt,
214
214
  toFlatObject: zt,
215
215
  kindOf: oe,
216
216
  kindOfTest: P,
@@ -635,7 +635,7 @@ const Pn = a.toObjectSet([
635
635
  s = i.indexOf(":"), n = i.substring(0, s).trim().toLowerCase(), r = i.substring(s + 1).trim(), !(!n || t[n] && Pn[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r);
636
636
  }), t;
637
637
  }, De = Symbol("internals");
638
- function V(e) {
638
+ function K(e) {
639
639
  return e && String(e).trim().toLowerCase();
640
640
  }
641
641
  function ee(e) {
@@ -680,7 +680,7 @@ let O = class {
680
680
  set(t, n, r) {
681
681
  const s = this;
682
682
  function o(c, f, u) {
683
- const l = V(f);
683
+ const l = K(f);
684
684
  if (!l)
685
685
  throw new Error("header name must be a non-empty string");
686
686
  const d = a.findKey(s, l);
@@ -704,7 +704,7 @@ let O = class {
704
704
  return this;
705
705
  }
706
706
  get(t, n) {
707
- if (t = V(t), t) {
707
+ if (t = K(t), t) {
708
708
  const r = a.findKey(this, t);
709
709
  if (r) {
710
710
  const s = this[r];
@@ -721,7 +721,7 @@ let O = class {
721
721
  }
722
722
  }
723
723
  has(t, n) {
724
- if (t = V(t), t) {
724
+ if (t = K(t), t) {
725
725
  const r = a.findKey(this, t);
726
726
  return !!(r && this[r] !== void 0 && (!n || de(this, this[r], r, n)));
727
727
  }
@@ -731,7 +731,7 @@ let O = class {
731
731
  const r = this;
732
732
  let s = !1;
733
733
  function o(i) {
734
- if (i = V(i), i) {
734
+ if (i = K(i), i) {
735
735
  const c = a.findKey(r, i);
736
736
  c && (!n || de(r, r[c], c, n)) && (delete r[c], s = !0);
737
737
  }
@@ -793,7 +793,7 @@ let O = class {
793
793
  accessors: {}
794
794
  }).accessors, s = this.prototype;
795
795
  function o(i) {
796
- const c = V(i);
796
+ const c = K(i);
797
797
  r[c] || (Fn(s, i), r[c] = !0);
798
798
  }
799
799
  return a.isArray(t) ? t.forEach(o) : o(t), this;
@@ -1100,7 +1100,7 @@ const pt = (e) => {
1100
1100
  const { signal: f } = r;
1101
1101
  return f.unsubscribe = () => a.asap(c), f;
1102
1102
  }
1103
- }, Vn = function* (e, t) {
1103
+ }, Kn = function* (e, t) {
1104
1104
  let n = e.byteLength;
1105
1105
  if (n < t) {
1106
1106
  yield e;
@@ -1109,9 +1109,9 @@ const pt = (e) => {
1109
1109
  let r = 0, s;
1110
1110
  for (; r < n; )
1111
1111
  s = r + t, yield e.slice(r, s), r = s;
1112
- }, Kn = async function* (e, t) {
1112
+ }, Vn = async function* (e, t) {
1113
1113
  for await (const n of zn(e))
1114
- yield* Vn(n, t);
1114
+ yield* Kn(n, t);
1115
1115
  }, zn = async function* (e) {
1116
1116
  if (e[Symbol.asyncIterator]) {
1117
1117
  yield* e;
@@ -1129,7 +1129,7 @@ const pt = (e) => {
1129
1129
  await t.cancel();
1130
1130
  }
1131
1131
  }, Ie = (e, t, n, r) => {
1132
- const s = Kn(e, t);
1132
+ const s = Vn(e, t);
1133
1133
  let o = 0, i, c = (f) => {
1134
1134
  i || (i = !0, r && r(f));
1135
1135
  };
@@ -1725,14 +1725,14 @@ class He extends Error {
1725
1725
  this.name = "ValidationError", this.errors = n;
1726
1726
  }
1727
1727
  }
1728
- class Ve extends Error {
1728
+ class Ke extends Error {
1729
1729
  constructor(n) {
1730
1730
  super("Address already registered.");
1731
1731
  R(this, "address");
1732
1732
  this.name = "AddressInUseError", this.address = n;
1733
1733
  }
1734
1734
  }
1735
- class Ke extends Error {
1735
+ class Ve extends Error {
1736
1736
  constructor(n) {
1737
1737
  super("Code already registered.");
1738
1738
  R(this, "code");
@@ -1750,8 +1750,8 @@ class rr {
1750
1750
  R(this, "_debug");
1751
1751
  this.httpClient = t.httpClient, this._debug = t.debug;
1752
1752
  }
1753
- async create(t, n, r, s, o) {
1754
- var i;
1753
+ async create(t, n, r, s, o, i) {
1754
+ var c;
1755
1755
  try {
1756
1756
  await this.httpClient.post({
1757
1757
  path: "/affiliates",
@@ -1761,23 +1761,24 @@ class rr {
1761
1761
  name: r,
1762
1762
  code: r,
1763
1763
  signature: s,
1764
- account_chain_id: o
1764
+ signature_public_key: o,
1765
+ account_chain_id: i
1765
1766
  }
1766
1767
  });
1767
- } catch (c) {
1768
- if (c instanceof G) {
1769
- const f = (i = c.response) == null ? void 0 : i.data;
1770
- if (typeof (f == null ? void 0 : f.message) == "string") {
1771
- const u = f.message.toLowerCase();
1772
- throw u == "invalid signature" ? new ze() : u == "address in use" ? new Ve(t) : u == "code in use" ? new Ke(r) : new Error(u);
1773
- } else if ((f == null ? void 0 : f.message) instanceof Array)
1774
- throw new He(f.message);
1768
+ } catch (f) {
1769
+ if (f instanceof G) {
1770
+ const u = (c = f.response) == null ? void 0 : c.data;
1771
+ if (typeof (u == null ? void 0 : u.message) == "string") {
1772
+ const l = u.message.toLowerCase();
1773
+ throw l == "invalid signature" ? new ze() : l == "address in use" ? new Ke(t) : l == "code in use" ? new Ve(r) : new Error(l);
1774
+ } else if ((u == null ? void 0 : u.message) instanceof Array)
1775
+ throw new He(u.message);
1775
1776
  }
1776
- throw c;
1777
+ throw f;
1777
1778
  }
1778
1779
  }
1779
- async update(t, n, r, s, o) {
1780
- var i;
1780
+ async update(t, n, r, s, o, i) {
1781
+ var c;
1781
1782
  try {
1782
1783
  await this.httpClient.post({
1783
1784
  path: `/affiliates/${t}`,
@@ -1786,19 +1787,20 @@ class rr {
1786
1787
  user_identifier: t,
1787
1788
  identifier_type: n,
1788
1789
  signature: s,
1789
- account_chain_id: o
1790
+ signature_public_key: o,
1791
+ account_chain_id: i
1790
1792
  }
1791
1793
  });
1792
- } catch (c) {
1793
- if (c instanceof G) {
1794
- const f = (i = c.response) == null ? void 0 : i.data;
1795
- if (typeof (f == null ? void 0 : f.message) == "string") {
1796
- const u = f.message.toLowerCase();
1797
- throw u == "invalid signature" ? new ze() : u == "address in use" ? new Ve(t) : u == "code in use" ? new Ke(r) : new Error(u);
1798
- } else if ((f == null ? void 0 : f.message) instanceof Array)
1799
- throw new He(f.message);
1794
+ } catch (f) {
1795
+ if (f instanceof G) {
1796
+ const u = (c = f.response) == null ? void 0 : c.data;
1797
+ if (typeof (u == null ? void 0 : u.message) == "string") {
1798
+ const l = u.message.toLowerCase();
1799
+ throw l == "invalid signature" ? new ze() : l == "address in use" ? new Ke(t) : l == "code in use" ? new Ve(r) : new Error(l);
1800
+ } else if ((u == null ? void 0 : u.message) instanceof Array)
1801
+ throw new He(u.message);
1800
1802
  }
1801
- throw c;
1803
+ throw f;
1802
1804
  }
1803
1805
  }
1804
1806
  async isCodeFree(t) {
@@ -1902,7 +1904,7 @@ class ur {
1902
1904
  }
1903
1905
  }
1904
1906
  }
1905
- const lr = "7.0.1", fr = {
1907
+ const lr = "7.0.3", fr = {
1906
1908
  version: lr
1907
1909
  };
1908
1910
  class dr {
@@ -1975,7 +1977,7 @@ class hr {
1975
1977
  })).data;
1976
1978
  }
1977
1979
  }
1978
- const K = "/payouts";
1980
+ const V = "/payouts";
1979
1981
  class pr {
1980
1982
  constructor(t) {
1981
1983
  R(this, "httpClient");
@@ -1984,31 +1986,31 @@ class pr {
1984
1986
  }
1985
1987
  async getUserPayoutsByConversion(t) {
1986
1988
  return (await this.httpClient.get({
1987
- path: K,
1989
+ path: V,
1988
1990
  queryParams: { ...t, type: "onchain-currency" }
1989
1991
  })).data;
1990
1992
  }
1991
1993
  async getUserPointsByConversion(t) {
1992
1994
  return (await this.httpClient.get({
1993
- path: K,
1995
+ path: V,
1994
1996
  queryParams: { ...t, type: "point" }
1995
1997
  })).data;
1996
1998
  }
1997
1999
  async getUserPayoutMovements(t) {
1998
2000
  return (await this.httpClient.get({
1999
- path: `${K}/movements`,
2001
+ path: `${V}/movements`,
2000
2002
  queryParams: { ...t, type: "onchain-currency" }
2001
2003
  })).data;
2002
2004
  }
2003
2005
  async getUserPointsMovements(t) {
2004
2006
  return (await this.httpClient.get({
2005
- path: `${K}/movements`,
2007
+ path: `${V}/movements`,
2006
2008
  queryParams: { ...t, type: "point" }
2007
2009
  })).data;
2008
2010
  }
2009
2011
  async getVolumeLeaderboard(t) {
2010
2012
  return (await this.httpClient.get({
2011
- path: `${K}/leaderboard/volume`,
2013
+ path: `${V}/leaderboard/volume`,
2012
2014
  queryParams: { ...t }
2013
2015
  })).data;
2014
2016
  }
@@ -2102,10 +2104,10 @@ async function Ur(e, t) {
2102
2104
  e != null && e.signature && (n.signature = e == null ? void 0 : e.signature, n.signature_message = e == null ? void 0 : e.message), e != null && e.signaturePublicKey && (n.signature_public_key = e.signaturePublicKey), e != null && e.accountChainId && (n.account_chain_id = e.accountChainId), await le.sendEvent(n, t);
2103
2105
  }
2104
2106
  async function Lr(e) {
2105
- N(), await $.create(e.userIdentifier, e.identifierType, e.code, e.signature, e.accountChainId);
2107
+ N(), await $.create(e.userIdentifier, e.identifierType, e.code, e.signature, e.signaturePublicKey, e.accountChainId);
2106
2108
  }
2107
2109
  async function Fr(e) {
2108
- N(), await $.update(e.userIdentifier, e.identifierType, e.code, e.signature, e.accountChainId);
2110
+ N(), await $.update(e.userIdentifier, e.identifierType, e.code, e.signature, e.signaturePublicKey, e.accountChainId);
2109
2111
  }
2110
2112
  async function Dr(e, t) {
2111
2113
  return N(), await $.getCode(e, t);
@@ -2141,10 +2143,10 @@ function $r(e) {
2141
2143
  function Hr(e) {
2142
2144
  return H.getUserPayoutMovements(e);
2143
2145
  }
2144
- function Vr(e) {
2146
+ function Kr(e) {
2145
2147
  return H.getUserPointsMovements(e);
2146
2148
  }
2147
- async function Kr(e) {
2149
+ async function Vr(e) {
2148
2150
  return N(), St.getAll(e);
2149
2151
  }
2150
2152
  async function zr(e) {
@@ -2159,7 +2161,7 @@ function Oe() {
2159
2161
  }
2160
2162
  function Pe() {
2161
2163
  if (navigator.webdriver)
2162
- throw new Error("Fuul SDK: You are using a browser automation tool");
2164
+ throw new Error("Fuul SDK: Error");
2163
2165
  }
2164
2166
  function Wr() {
2165
2167
  if (!_e)
@@ -2179,7 +2181,7 @@ const ms = {
2179
2181
  sendPageview: xr,
2180
2182
  identifyUser: Ur,
2181
2183
  generateTrackingLink: Br,
2182
- getConversions: Kr,
2184
+ getConversions: Vr,
2183
2185
  createAffiliateCode: Lr,
2184
2186
  updateAffiliateCode: Fr,
2185
2187
  getAffiliateCode: Dr,
@@ -2190,15 +2192,15 @@ const ms = {
2190
2192
  getUserAudiences: Jr,
2191
2193
  getUserPayoutsByConversion: Mr,
2192
2194
  getUserPointsByConversion: $r,
2193
- getUserPointsMovements: Vr,
2195
+ getUserPointsMovements: Kr,
2194
2196
  getUserPayoutMovements: Hr,
2195
2197
  getUserAffiliates: zr,
2196
2198
  getVolumeLeaderboard: jr
2197
2199
  };
2198
2200
  var Xr = /* @__PURE__ */ ((e) => (e.EvmAddress = "evm_address", e.SolanaAddress = "solana_address", e.Email = "email", e))(Xr || {});
2199
2201
  export {
2200
- Ve as AddressInUseError,
2201
- Ke as CodeInUseError,
2202
+ Ke as AddressInUseError,
2203
+ Ve as CodeInUseError,
2202
2204
  ms as Fuul,
2203
2205
  ze as InvalidSignatureError,
2204
2206
  Xr as UserIdentifierType,
package/dist/index.umd.js CHANGED
@@ -1,6 +1,6 @@
1
- (function(R,_){typeof exports=="object"&&typeof module<"u"?_(exports):typeof define=="function"&&define.amd?define(["exports"],_):(R=typeof globalThis<"u"?globalThis:R||self,_(R.Fuul={}))})(this,function(R){"use strict";var Hr=Object.defineProperty;var Vr=(R,_,$)=>_ in R?Hr(R,_,{enumerable:!0,configurable:!0,writable:!0,value:$}):R[_]=$;var T=(R,_,$)=>Vr(R,typeof _!="symbol"?_+"":_,$);function _(e,t){return function(){return e.apply(t,arguments)}}const{toString:$}=Object.prototype,{getPrototypeOf:me}=Object,{iterator:ee,toStringTag:Be}=Symbol,te=(e=>t=>{const n=$.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),U=e=>(e=e.toLowerCase(),t=>te(t)===e),ne=e=>t=>typeof t===e,{isArray:M}=Array,J=ne("undefined");function W(e){return e!==null&&!J(e)&&e.constructor!==null&&!J(e.constructor)&&O(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Ie=U("ArrayBuffer");function Ot(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Ie(e.buffer),t}const Pt=ne("string"),O=ne("function"),qe=ne("number"),X=e=>e!==null&&typeof e=="object",Nt=e=>e===!0||e===!1,re=e=>{if(te(e)!=="object")return!1;const t=me(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Be in e)&&!(ee in e)},Ut=e=>{if(!X(e)||W(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},xt=U("Date"),Lt=U("File"),Ft=U("Blob"),Dt=U("FileList"),kt=e=>X(e)&&O(e.pipe),Bt=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||O(e.append)&&((t=te(e))==="formdata"||t==="object"&&O(e.toString)&&e.toString()==="[object FormData]"))},It=U("URLSearchParams"),[qt,vt,jt,$t]=["ReadableStream","Request","Response","Headers"].map(U),Mt=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]),M(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(W(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let c;for(r=0;r<i;r++)c=o[r],t.call(null,e[c],c,e)}}function ve(e,t){if(W(e))return null;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 B=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,je=e=>!J(e)&&e!==B;function ye(){const{caseless:e}=je(this)&&this||{},t={},n=(r,s)=>{const o=e&&ve(t,s)||s;re(t[o])&&re(r)?t[o]=ye(t[o],r):re(r)?t[o]=ye({},r):M(r)?t[o]=r.slice():t[o]=r};for(let r=0,s=arguments.length;r<s;r++)arguments[r]&&Q(arguments[r],n);return t}const Ht=(e,t,n,{allOwnKeys:r}={})=>(Q(t,(s,o)=>{n&&O(s)?e[o]=_(s,n):e[o]=s},{allOwnKeys:r}),e),Vt=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Kt=(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)},zt=(e,t,n,r)=>{let s,o,i;const c={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],(!r||r(i,e,t))&&!c[i]&&(t[i]=e[i],c[i]=!0);e=n!==!1&&me(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Jt=(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},Wt=e=>{if(!e)return null;if(M(e))return e;let t=e.length;if(!qe(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Xt=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&me(Uint8Array)),Qt=(e,t)=>{const r=(e&&e[ee]).call(e);let s;for(;(s=r.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},Yt=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Gt=U("HTMLFormElement"),Zt=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),$e=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),en=U("RegExp"),Me=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Q(n,(s,o)=>{let i;(i=t(s,o,e))!==!1&&(r[o]=i||s)}),Object.defineProperties(e,r)},tn=e=>{Me(e,(t,n)=>{if(O(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(O(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+"'")})}})},nn=(e,t)=>{const n={},r=s=>{s.forEach(o=>{n[o]=!0})};return M(e)?r(e):r(String(e).split(t)),n},rn=()=>{},sn=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function on(e){return!!(e&&O(e.append)&&e[Be]==="FormData"&&e[ee])}const an=e=>{const t=new Array(10),n=(r,s)=>{if(X(r)){if(t.indexOf(r)>=0)return;if(W(r))return r;if(!("toJSON"in r)){t[s]=r;const o=M(r)?[]:{};return Q(r,(i,c)=>{const f=n(i,s+1);!J(f)&&(o[c]=f)}),t[s]=void 0,o}}return r};return n(e,0)},cn=U("AsyncFunction"),un=e=>e&&(X(e)||O(e))&&O(e.then)&&O(e.catch),He=((e,t)=>e?setImmediate:t?((n,r)=>(B.addEventListener("message",({source:s,data:o})=>{s===B&&o===n&&r.length&&r.shift()()},!1),s=>{r.push(s),B.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",O(B.postMessage)),ln=typeof queueMicrotask<"u"?queueMicrotask.bind(B):typeof process<"u"&&process.nextTick||He,a={isArray:M,isArrayBuffer:Ie,isBuffer:W,isFormData:Bt,isArrayBufferView:Ot,isString:Pt,isNumber:qe,isBoolean:Nt,isObject:X,isPlainObject:re,isEmptyObject:Ut,isReadableStream:qt,isRequest:vt,isResponse:jt,isHeaders:$t,isUndefined:J,isDate:xt,isFile:Lt,isBlob:Ft,isRegExp:en,isFunction:O,isStream:kt,isURLSearchParams:It,isTypedArray:Xt,isFileList:Dt,forEach:Q,merge:ye,extend:Ht,trim:Mt,stripBOM:Vt,inherits:Kt,toFlatObject:zt,kindOf:te,kindOfTest:U,endsWith:Jt,toArray:Wt,forEachEntry:Qt,matchAll:Yt,isHTMLForm:Gt,hasOwnProperty:$e,hasOwnProp:$e,reduceDescriptors:Me,freezeMethods:tn,toObjectSet:nn,toCamelCase:Zt,noop:rn,toFiniteNumber:sn,findKey:ve,global:B,isContextDefined:je,isSpecCompliantForm:on,toJSONObject:an,isAsyncFn:cn,isThenable:un,setImmediate:He,asap:ln,isIterable:e=>e!=null&&O(e[ee])};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,this.status=s.status?s.status:null)}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.status}}});const Ve=m.prototype,Ke={};["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=>{Ke[e]={value:e}}),Object.defineProperties(m,Ke),Object.defineProperty(Ve,"isAxiosError",{value:!0}),m.from=(e,t,n,r,s,o)=>{const i=Object.create(Ve);return a.toFlatObject(e,i,function(f){return f!==Error.prototype},c=>c!=="isAxiosError"),m.call(i,e.message,t,n,r,s),i.cause=e,i.name=e.name,o&&Object.assign(i,o),i};const fn=null;function ge(e){return a.isPlainObject(e)||a.isArray(e)}function ze(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function Je(e,t,n){return e?e.concat(t).map(function(s,o){return s=ze(s),!n&&o?"["+s+"]":s}).join(n?".":""):t}function dn(e){return a.isArray(e)&&!e.some(ge)}const hn=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function se(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(y,p){return!a.isUndefined(p[y])});const r=n.metaTokens,s=n.visitor||l,o=n.dots,i=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(s))throw new TypeError("visitor must be a function");function u(h){if(h===null)return"";if(a.isDate(h))return h.toISOString();if(a.isBoolean(h))return h.toString();if(!f&&a.isBlob(h))throw new m("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(h)||a.isTypedArray(h)?f&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function l(h,y,p){let E=h;if(h&&!p&&typeof h=="object"){if(a.endsWith(y,"{}"))y=r?y:y.slice(0,-2),h=JSON.stringify(h);else if(a.isArray(h)&&dn(h)||(a.isFileList(h)||a.endsWith(y,"[]"))&&(E=a.toArray(h)))return y=ze(y),E.forEach(function(C,F){!(a.isUndefined(C)||C===null)&&t.append(i===!0?Je([y],F,o):i===null?y:y+"[]",u(C))}),!1}return ge(h)?!0:(t.append(Je(p,y,o),u(h)),!1)}const d=[],g=Object.assign(hn,{defaultVisitor:l,convertValue:u,isVisitable:ge});function w(h,y){if(!a.isUndefined(h)){if(d.indexOf(h)!==-1)throw Error("Circular reference detected in "+y.join("."));d.push(h),a.forEach(h,function(E,S){(!(a.isUndefined(E)||E===null)&&s.call(t,E,a.isString(S)?S.trim():S,y,g))===!0&&w(E,y?y.concat(S):[S])}),d.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return w(e),t}function We(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function we(e,t){this._pairs=[],e&&se(e,this,t)}const Xe=we.prototype;Xe.append=function(t,n){this._pairs.push([t,n])},Xe.toString=function(t){const n=t?function(r){return t.call(this,r,We)}:We;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function pn(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Qe(e,t,n){if(!t)return e;const r=n&&n.encode||pn;a.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let o;if(s?o=s(t,n):o=a.isURLSearchParams(t)?t.toString():new we(t,n).toString(r),o){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class Ye{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 Ge={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},mn={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:we,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},be=typeof window<"u"&&typeof document<"u",Ee=typeof navigator=="object"&&navigator||void 0,yn=be&&(!Ee||["ReactNative","NativeScript","NS"].indexOf(Ee.product)<0),gn=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",wn=be&&window.location.href||"http://localhost",A={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:be,hasStandardBrowserEnv:yn,hasStandardBrowserWebWorkerEnv:gn,navigator:Ee,origin:wn},Symbol.toStringTag,{value:"Module"})),...mn};function bn(e,t){return se(e,new A.classes.URLSearchParams,{visitor:function(n,r,s,o){return A.isNode&&a.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function En(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Sn(e){const t={},n=Object.keys(e);let r;const s=n.length;let o;for(r=0;r<s;r++)o=n[r],t[o]=e[o];return t}function Ze(e){function t(n,r,s,o){let i=n[o++];if(i==="__proto__")return!0;const c=Number.isFinite(+i),f=o>=n.length;return i=!i&&a.isArray(s)?s.length:i,f?(a.hasOwnProp(s,i)?s[i]=[s[i],r]:s[i]=r,!c):((!s[i]||!a.isObject(s[i]))&&(s[i]=[]),t(n,r,s[i],o)&&a.isArray(s[i])&&(s[i]=Sn(s[i])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){const n={};return a.forEachEntry(e,(r,s)=>{t(En(r),s,n,0)}),n}return null}function Cn(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(0,JSON.stringify)(e)}const Y={transitional:Ge,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,o=a.isObject(t);if(o&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return s?JSON.stringify(Ze(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t)||a.isReadableStream(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(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return bn(t,this.formSerializer).toString();if((c=a.isFileList(t))||r.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return se(c?{"files[]":t}:t,f&&new f,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),Cn(t)):t}],transformResponse:[function(t){const n=this.transitional||Y.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(a.isResponse(t)||a.isReadableStream(t))return t;if(t&&a.isString(t)&&(r&&!this.responseType||s)){const i=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(c){if(i)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:A.classes.FormData,Blob:A.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=>{Y.headers[e]={}});const Rn=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"]),Tn=e=>{const t={};let n,r,s;return e&&e.split(`
1
+ (function(R,_){typeof exports=="object"&&typeof module<"u"?_(exports):typeof define=="function"&&define.amd?define(["exports"],_):(R=typeof globalThis<"u"?globalThis:R||self,_(R.Fuul={}))})(this,function(R){"use strict";var Hr=Object.defineProperty;var Kr=(R,_,$)=>_ in R?Hr(R,_,{enumerable:!0,configurable:!0,writable:!0,value:$}):R[_]=$;var T=(R,_,$)=>Kr(R,typeof _!="symbol"?_+"":_,$);function _(e,t){return function(){return e.apply(t,arguments)}}const{toString:$}=Object.prototype,{getPrototypeOf:me}=Object,{iterator:ee,toStringTag:Be}=Symbol,te=(e=>t=>{const n=$.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),U=e=>(e=e.toLowerCase(),t=>te(t)===e),ne=e=>t=>typeof t===e,{isArray:M}=Array,J=ne("undefined");function W(e){return e!==null&&!J(e)&&e.constructor!==null&&!J(e.constructor)&&O(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Ie=U("ArrayBuffer");function Ot(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Ie(e.buffer),t}const Pt=ne("string"),O=ne("function"),qe=ne("number"),X=e=>e!==null&&typeof e=="object",Nt=e=>e===!0||e===!1,re=e=>{if(te(e)!=="object")return!1;const t=me(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Be in e)&&!(ee in e)},Ut=e=>{if(!X(e)||W(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},xt=U("Date"),Lt=U("File"),Ft=U("Blob"),Dt=U("FileList"),kt=e=>X(e)&&O(e.pipe),Bt=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||O(e.append)&&((t=te(e))==="formdata"||t==="object"&&O(e.toString)&&e.toString()==="[object FormData]"))},It=U("URLSearchParams"),[qt,vt,jt,$t]=["ReadableStream","Request","Response","Headers"].map(U),Mt=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]),M(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(W(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let c;for(r=0;r<i;r++)c=o[r],t.call(null,e[c],c,e)}}function ve(e,t){if(W(e))return null;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 B=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,je=e=>!J(e)&&e!==B;function ye(){const{caseless:e}=je(this)&&this||{},t={},n=(r,s)=>{const o=e&&ve(t,s)||s;re(t[o])&&re(r)?t[o]=ye(t[o],r):re(r)?t[o]=ye({},r):M(r)?t[o]=r.slice():t[o]=r};for(let r=0,s=arguments.length;r<s;r++)arguments[r]&&Q(arguments[r],n);return t}const Ht=(e,t,n,{allOwnKeys:r}={})=>(Q(t,(s,o)=>{n&&O(s)?e[o]=_(s,n):e[o]=s},{allOwnKeys:r}),e),Kt=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Vt=(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)},zt=(e,t,n,r)=>{let s,o,i;const c={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],(!r||r(i,e,t))&&!c[i]&&(t[i]=e[i],c[i]=!0);e=n!==!1&&me(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Jt=(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},Wt=e=>{if(!e)return null;if(M(e))return e;let t=e.length;if(!qe(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Xt=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&me(Uint8Array)),Qt=(e,t)=>{const r=(e&&e[ee]).call(e);let s;for(;(s=r.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},Yt=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Gt=U("HTMLFormElement"),Zt=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),$e=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),en=U("RegExp"),Me=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Q(n,(s,o)=>{let i;(i=t(s,o,e))!==!1&&(r[o]=i||s)}),Object.defineProperties(e,r)},tn=e=>{Me(e,(t,n)=>{if(O(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(O(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+"'")})}})},nn=(e,t)=>{const n={},r=s=>{s.forEach(o=>{n[o]=!0})};return M(e)?r(e):r(String(e).split(t)),n},rn=()=>{},sn=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function on(e){return!!(e&&O(e.append)&&e[Be]==="FormData"&&e[ee])}const an=e=>{const t=new Array(10),n=(r,s)=>{if(X(r)){if(t.indexOf(r)>=0)return;if(W(r))return r;if(!("toJSON"in r)){t[s]=r;const o=M(r)?[]:{};return Q(r,(i,c)=>{const f=n(i,s+1);!J(f)&&(o[c]=f)}),t[s]=void 0,o}}return r};return n(e,0)},cn=U("AsyncFunction"),un=e=>e&&(X(e)||O(e))&&O(e.then)&&O(e.catch),He=((e,t)=>e?setImmediate:t?((n,r)=>(B.addEventListener("message",({source:s,data:o})=>{s===B&&o===n&&r.length&&r.shift()()},!1),s=>{r.push(s),B.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",O(B.postMessage)),ln=typeof queueMicrotask<"u"?queueMicrotask.bind(B):typeof process<"u"&&process.nextTick||He,a={isArray:M,isArrayBuffer:Ie,isBuffer:W,isFormData:Bt,isArrayBufferView:Ot,isString:Pt,isNumber:qe,isBoolean:Nt,isObject:X,isPlainObject:re,isEmptyObject:Ut,isReadableStream:qt,isRequest:vt,isResponse:jt,isHeaders:$t,isUndefined:J,isDate:xt,isFile:Lt,isBlob:Ft,isRegExp:en,isFunction:O,isStream:kt,isURLSearchParams:It,isTypedArray:Xt,isFileList:Dt,forEach:Q,merge:ye,extend:Ht,trim:Mt,stripBOM:Kt,inherits:Vt,toFlatObject:zt,kindOf:te,kindOfTest:U,endsWith:Jt,toArray:Wt,forEachEntry:Qt,matchAll:Yt,isHTMLForm:Gt,hasOwnProperty:$e,hasOwnProp:$e,reduceDescriptors:Me,freezeMethods:tn,toObjectSet:nn,toCamelCase:Zt,noop:rn,toFiniteNumber:sn,findKey:ve,global:B,isContextDefined:je,isSpecCompliantForm:on,toJSONObject:an,isAsyncFn:cn,isThenable:un,setImmediate:He,asap:ln,isIterable:e=>e!=null&&O(e[ee])};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,this.status=s.status?s.status:null)}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.status}}});const Ke=m.prototype,Ve={};["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=>{Ve[e]={value:e}}),Object.defineProperties(m,Ve),Object.defineProperty(Ke,"isAxiosError",{value:!0}),m.from=(e,t,n,r,s,o)=>{const i=Object.create(Ke);return a.toFlatObject(e,i,function(f){return f!==Error.prototype},c=>c!=="isAxiosError"),m.call(i,e.message,t,n,r,s),i.cause=e,i.name=e.name,o&&Object.assign(i,o),i};const fn=null;function ge(e){return a.isPlainObject(e)||a.isArray(e)}function ze(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function Je(e,t,n){return e?e.concat(t).map(function(s,o){return s=ze(s),!n&&o?"["+s+"]":s}).join(n?".":""):t}function dn(e){return a.isArray(e)&&!e.some(ge)}const hn=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function se(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(y,p){return!a.isUndefined(p[y])});const r=n.metaTokens,s=n.visitor||l,o=n.dots,i=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(s))throw new TypeError("visitor must be a function");function u(h){if(h===null)return"";if(a.isDate(h))return h.toISOString();if(a.isBoolean(h))return h.toString();if(!f&&a.isBlob(h))throw new m("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(h)||a.isTypedArray(h)?f&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function l(h,y,p){let E=h;if(h&&!p&&typeof h=="object"){if(a.endsWith(y,"{}"))y=r?y:y.slice(0,-2),h=JSON.stringify(h);else if(a.isArray(h)&&dn(h)||(a.isFileList(h)||a.endsWith(y,"[]"))&&(E=a.toArray(h)))return y=ze(y),E.forEach(function(C,F){!(a.isUndefined(C)||C===null)&&t.append(i===!0?Je([y],F,o):i===null?y:y+"[]",u(C))}),!1}return ge(h)?!0:(t.append(Je(p,y,o),u(h)),!1)}const d=[],g=Object.assign(hn,{defaultVisitor:l,convertValue:u,isVisitable:ge});function w(h,y){if(!a.isUndefined(h)){if(d.indexOf(h)!==-1)throw Error("Circular reference detected in "+y.join("."));d.push(h),a.forEach(h,function(E,S){(!(a.isUndefined(E)||E===null)&&s.call(t,E,a.isString(S)?S.trim():S,y,g))===!0&&w(E,y?y.concat(S):[S])}),d.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return w(e),t}function We(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function we(e,t){this._pairs=[],e&&se(e,this,t)}const Xe=we.prototype;Xe.append=function(t,n){this._pairs.push([t,n])},Xe.toString=function(t){const n=t?function(r){return t.call(this,r,We)}:We;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function pn(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Qe(e,t,n){if(!t)return e;const r=n&&n.encode||pn;a.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let o;if(s?o=s(t,n):o=a.isURLSearchParams(t)?t.toString():new we(t,n).toString(r),o){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class Ye{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 Ge={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},mn={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:we,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},be=typeof window<"u"&&typeof document<"u",Ee=typeof navigator=="object"&&navigator||void 0,yn=be&&(!Ee||["ReactNative","NativeScript","NS"].indexOf(Ee.product)<0),gn=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",wn=be&&window.location.href||"http://localhost",A={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:be,hasStandardBrowserEnv:yn,hasStandardBrowserWebWorkerEnv:gn,navigator:Ee,origin:wn},Symbol.toStringTag,{value:"Module"})),...mn};function bn(e,t){return se(e,new A.classes.URLSearchParams,{visitor:function(n,r,s,o){return A.isNode&&a.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function En(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Sn(e){const t={},n=Object.keys(e);let r;const s=n.length;let o;for(r=0;r<s;r++)o=n[r],t[o]=e[o];return t}function Ze(e){function t(n,r,s,o){let i=n[o++];if(i==="__proto__")return!0;const c=Number.isFinite(+i),f=o>=n.length;return i=!i&&a.isArray(s)?s.length:i,f?(a.hasOwnProp(s,i)?s[i]=[s[i],r]:s[i]=r,!c):((!s[i]||!a.isObject(s[i]))&&(s[i]=[]),t(n,r,s[i],o)&&a.isArray(s[i])&&(s[i]=Sn(s[i])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){const n={};return a.forEachEntry(e,(r,s)=>{t(En(r),s,n,0)}),n}return null}function Cn(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(0,JSON.stringify)(e)}const Y={transitional:Ge,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,o=a.isObject(t);if(o&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return s?JSON.stringify(Ze(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t)||a.isReadableStream(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(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return bn(t,this.formSerializer).toString();if((c=a.isFileList(t))||r.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return se(c?{"files[]":t}:t,f&&new f,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),Cn(t)):t}],transformResponse:[function(t){const n=this.transitional||Y.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(a.isResponse(t)||a.isReadableStream(t))return t;if(t&&a.isString(t)&&(r&&!this.responseType||s)){const i=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(c){if(i)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:A.classes.FormData,Blob:A.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=>{Y.headers[e]={}});const Rn=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"]),Tn=e=>{const t={};let n,r,s;return e&&e.split(`
2
2
  `).forEach(function(i){s=i.indexOf(":"),n=i.substring(0,s).trim().toLowerCase(),r=i.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)}),t},et=Symbol("internals");function G(e){return e&&String(e).trim().toLowerCase()}function oe(e){return e===!1||e==null?e:a.isArray(e)?e.map(oe):String(e)}function An(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 _n=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Se(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 On(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function Pn(e,t){const n=a.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,o,i){return this[r].call(this,t,s,o,i)},configurable:!0})})}let P=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function o(c,f,u){const l=G(f);if(!l)throw new Error("header name must be a non-empty string");const d=a.findKey(s,l);(!d||s[d]===void 0||u===!0||u===void 0&&s[d]!==!1)&&(s[d||f]=oe(c))}const i=(c,f)=>a.forEach(c,(u,l)=>o(u,l,f));if(a.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if(a.isString(t)&&(t=t.trim())&&!_n(t))i(Tn(t),n);else if(a.isObject(t)&&a.isIterable(t)){let c={},f,u;for(const l of t){if(!a.isArray(l))throw TypeError("Object iterator must return a key-value pair");c[u=l[0]]=(f=c[u])?a.isArray(f)?[...f,l[1]]:[f,l[1]]:l[1]}i(c,n)}else t!=null&&o(n,t,r);return this}get(t,n){if(t=G(t),t){const r=a.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return An(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=G(t),t){const r=a.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Se(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function o(i){if(i=G(i),i){const c=a.findKey(r,i);c&&(!n||Se(r,r[c],c,n))&&(delete r[c],s=!0)}}return a.isArray(t)?t.forEach(o):o(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const o=n[r];(!t||Se(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const n=this,r={};return a.forEach(this,(s,o)=>{const i=a.findKey(r,o);if(i){n[i]=oe(s),delete n[o];return}const c=t?On(o):String(o).trim();c!==o&&delete n[o],n[c]=oe(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
- `)}getSetCookie(){return this.get("set-cookie")||[]}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[et]=this[et]={accessors:{}}).accessors,s=this.prototype;function o(i){const c=G(i);r[c]||(Pn(s,i),r[c]=!0)}return a.isArray(t)?t.forEach(o):o(t),this}};P.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),a.reduceDescriptors(P.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),a.freezeMethods(P);function Ce(e,t){const n=this||Y,r=t||n,s=P.from(r.headers);let o=r.data;return a.forEach(e,function(c){o=c.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function tt(e){return!!(e&&e.__CANCEL__)}function H(e,t,n){m.call(this,e??"canceled",m.ERR_CANCELED,t,n),this.name="CanceledError"}a.inherits(H,m,{__CANCEL__:!0});function nt(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))}function Nn(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,o=0,i;return t=t!==void 0?t:1e3,function(f){const u=Date.now(),l=r[o];i||(i=u),n[s]=f,r[s]=u;let d=o,g=0;for(;d!==s;)g+=n[d++],d=d%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),u-i<t)return;const w=l&&u-l;return w?Math.round(g*1e3/w):void 0}}function xn(e,t){let n=0,r=1e3/t,s,o;const i=(u,l=Date.now())=>{n=l,s=null,o&&(clearTimeout(o),o=null),e(...u)};return[(...u)=>{const l=Date.now(),d=l-n;d>=r?i(u,l):(s=u,o||(o=setTimeout(()=>{o=null,i(s)},r-d)))},()=>s&&i(s)]}const ie=(e,t,n=3)=>{let r=0;const s=Un(50,250);return xn(o=>{const i=o.loaded,c=o.lengthComputable?o.total:void 0,f=i-r,u=s(f),l=i<=c;r=i;const d={loaded:i,total:c,progress:c?i/c:void 0,bytes:f,rate:u||void 0,estimated:u&&c&&l?(c-i)/u:void 0,event:o,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(d)},n)},rt=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},st=e=>(...t)=>a.asap(()=>e(...t)),Ln=A.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,A.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(A.origin),A.navigator&&/(msie|trident)/i.test(A.navigator.userAgent)):()=>!0,Fn=A.hasStandardBrowserEnv?{write(e,t,n,r,s,o){const i=[e+"="+encodeURIComponent(t)];a.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),a.isString(r)&&i.push("path="+r),a.isString(s)&&i.push("domain="+s),o===!0&&i.push("secure"),document.cookie=i.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 Dn(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function kn(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function ot(e,t,n){let r=!Dn(t);return e&&(r||n==!1)?kn(e,t):t}const it=e=>e instanceof P?{...e}:e;function I(e,t){t=t||{};const n={};function r(u,l,d,g){return a.isPlainObject(u)&&a.isPlainObject(l)?a.merge.call({caseless:g},u,l):a.isPlainObject(l)?a.merge({},l):a.isArray(l)?l.slice():l}function s(u,l,d,g){if(a.isUndefined(l)){if(!a.isUndefined(u))return r(void 0,u,d,g)}else return r(u,l,d,g)}function o(u,l){if(!a.isUndefined(l))return r(void 0,l)}function i(u,l){if(a.isUndefined(l)){if(!a.isUndefined(u))return r(void 0,u)}else return r(void 0,l)}function c(u,l,d){if(d in t)return r(u,l);if(d in e)return r(void 0,u)}const f={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:c,headers:(u,l,d)=>s(it(u),it(l),d,!0)};return a.forEach(Object.keys({...e,...t}),function(l){const d=f[l]||s,g=d(e[l],t[l],l);a.isUndefined(g)&&d!==c||(n[l]=g)}),n}const at=e=>{const t=I({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:c}=t;t.headers=i=P.from(i),t.url=Qe(ot(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&i.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let f;if(a.isFormData(n)){if(A.hasStandardBrowserEnv||A.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if((f=i.getContentType())!==!1){const[u,...l]=f?f.split(";").map(d=>d.trim()).filter(Boolean):[];i.setContentType([u||"multipart/form-data",...l].join("; "))}}if(A.hasStandardBrowserEnv&&(r&&a.isFunction(r)&&(r=r(t)),r||r!==!1&&Ln(t.url))){const u=s&&o&&Fn.read(o);u&&i.set(s,u)}return t},Bn=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const s=at(e);let o=s.data;const i=P.from(s.headers).normalize();let{responseType:c,onUploadProgress:f,onDownloadProgress:u}=s,l,d,g,w,h;function y(){w&&w(),h&&h(),s.cancelToken&&s.cancelToken.unsubscribe(l),s.signal&&s.signal.removeEventListener("abort",l)}let p=new XMLHttpRequest;p.open(s.method.toUpperCase(),s.url,!0),p.timeout=s.timeout;function E(){if(!p)return;const C=P.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),N={data:!c||c==="text"||c==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:C,config:e,request:p};nt(function(j){n(j),y()},function(j){r(j),y()},N),p=null}"onloadend"in p?p.onloadend=E:p.onreadystatechange=function(){!p||p.readyState!==4||p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)||setTimeout(E)},p.onabort=function(){p&&(r(new m("Request aborted",m.ECONNABORTED,e,p)),p=null)},p.onerror=function(){r(new m("Network Error",m.ERR_NETWORK,e,p)),p=null},p.ontimeout=function(){let F=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const N=s.transitional||Ge;s.timeoutErrorMessage&&(F=s.timeoutErrorMessage),r(new m(F,N.clarifyTimeoutError?m.ETIMEDOUT:m.ECONNABORTED,e,p)),p=null},o===void 0&&i.setContentType(null),"setRequestHeader"in p&&a.forEach(i.toJSON(),function(F,N){p.setRequestHeader(N,F)}),a.isUndefined(s.withCredentials)||(p.withCredentials=!!s.withCredentials),c&&c!=="json"&&(p.responseType=s.responseType),u&&([g,h]=ie(u,!0),p.addEventListener("progress",g)),f&&p.upload&&([d,w]=ie(f),p.upload.addEventListener("progress",d),p.upload.addEventListener("loadend",w)),(s.cancelToken||s.signal)&&(l=C=>{p&&(r(!C||C.type?new H(null,e,p):C),p.abort(),p=null)},s.cancelToken&&s.cancelToken.subscribe(l),s.signal&&(s.signal.aborted?l():s.signal.addEventListener("abort",l)));const S=Nn(s.url);if(S&&A.protocols.indexOf(S)===-1){r(new m("Unsupported protocol "+S+":",m.ERR_BAD_REQUEST,e));return}p.send(o||null)})},In=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const o=function(u){if(!s){s=!0,c();const l=u instanceof Error?u:this.reason;r.abort(l instanceof m?l:new H(l instanceof Error?l.message:l))}};let i=t&&setTimeout(()=>{i=null,o(new m(`timeout ${t} of ms exceeded`,m.ETIMEDOUT))},t);const c=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(o):u.removeEventListener("abort",o)}),e=null)};e.forEach(u=>u.addEventListener("abort",o));const{signal:f}=r;return f.unsubscribe=()=>a.asap(c),f}},qn=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},vn=async function*(e,t){for await(const n of jn(e))yield*qn(n,t)},jn=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},ct=(e,t,n,r)=>{const s=vn(e,t);let o=0,i,c=f=>{i||(i=!0,r&&r(f))};return new ReadableStream({async pull(f){try{const{done:u,value:l}=await s.next();if(u){c(),f.close();return}let d=l.byteLength;if(n){let g=o+=d;n(g)}f.enqueue(new Uint8Array(l))}catch(u){throw c(u),u}},cancel(f){return c(f),s.return()}},{highWaterMark:2})},ae=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",ut=ae&&typeof ReadableStream=="function",$n=ae&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),lt=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Mn=ut&&lt(()=>{let e=!1;const t=new Request(A.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),ft=64*1024,Re=ut&&lt(()=>a.isReadableStream(new Response("").body)),ce={stream:Re&&(e=>e.body)};ae&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!ce[t]&&(ce[t]=a.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new m(`Response type '${t}' is not supported`,m.ERR_NOT_SUPPORT,r)})})})(new Response);const Hn=async e=>{if(e==null)return 0;if(a.isBlob(e))return e.size;if(a.isSpecCompliantForm(e))return(await new Request(A.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(a.isArrayBufferView(e)||a.isArrayBuffer(e))return e.byteLength;if(a.isURLSearchParams(e)&&(e=e+""),a.isString(e))return(await $n(e)).byteLength},Vn=async(e,t)=>{const n=a.toFiniteNumber(e.getContentLength());return n??Hn(t)},Te={http:fn,xhr:Bn,fetch:ae&&(async e=>{let{url:t,method:n,data:r,signal:s,cancelToken:o,timeout:i,onDownloadProgress:c,onUploadProgress:f,responseType:u,headers:l,withCredentials:d="same-origin",fetchOptions:g}=at(e);u=u?(u+"").toLowerCase():"text";let w=In([s,o&&o.toAbortSignal()],i),h;const y=w&&w.unsubscribe&&(()=>{w.unsubscribe()});let p;try{if(f&&Mn&&n!=="get"&&n!=="head"&&(p=await Vn(l,r))!==0){let N=new Request(t,{method:"POST",body:r,duplex:"half"}),k;if(a.isFormData(r)&&(k=N.headers.get("content-type"))&&l.setContentType(k),N.body){const[j,pe]=rt(p,ie(st(f)));r=ct(N.body,ft,j,pe)}}a.isString(d)||(d=d?"include":"omit");const E="credentials"in Request.prototype;h=new Request(t,{...g,signal:w,method:n.toUpperCase(),headers:l.normalize().toJSON(),body:r,duplex:"half",credentials:E?d:void 0});let S=await fetch(h,g);const C=Re&&(u==="stream"||u==="response");if(Re&&(c||C&&y)){const N={};["status","statusText","headers"].forEach(At=>{N[At]=S[At]});const k=a.toFiniteNumber(S.headers.get("content-length")),[j,pe]=c&&rt(k,ie(st(c),!0))||[];S=new Response(ct(S.body,ft,j,()=>{pe&&pe(),y&&y()}),N)}u=u||"text";let F=await ce[a.findKey(ce,u)||"text"](S,e);return!C&&y&&y(),await new Promise((N,k)=>{nt(N,k,{data:F,headers:P.from(S.headers),status:S.status,statusText:S.statusText,config:e,request:h})})}catch(E){throw y&&y(),E&&E.name==="TypeError"&&/Load failed|fetch/i.test(E.message)?Object.assign(new m("Network Error",m.ERR_NETWORK,e,h),{cause:E.cause||E}):m.from(E,E&&E.code,e,h)}})};a.forEach(Te,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const dt=e=>`- ${e}`,Kn=e=>a.isFunction(e)||e===null||e===!1,ht={getAdapter:e=>{e=a.isArray(e)?e:[e];const{length:t}=e;let n,r;const s={};for(let o=0;o<t;o++){n=e[o];let i;if(r=n,!Kn(n)&&(r=Te[(i=String(n)).toLowerCase()],r===void 0))throw new m(`Unknown adapter '${i}'`);if(r)break;s[i||"#"+o]=r}if(!r){const o=Object.entries(s).map(([c,f])=>`adapter ${c} `+(f===!1?"is not supported by the environment":"is not available in the build"));let i=t?o.length>1?`since :
3
+ `)}getSetCookie(){return this.get("set-cookie")||[]}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[et]=this[et]={accessors:{}}).accessors,s=this.prototype;function o(i){const c=G(i);r[c]||(Pn(s,i),r[c]=!0)}return a.isArray(t)?t.forEach(o):o(t),this}};P.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),a.reduceDescriptors(P.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),a.freezeMethods(P);function Ce(e,t){const n=this||Y,r=t||n,s=P.from(r.headers);let o=r.data;return a.forEach(e,function(c){o=c.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function tt(e){return!!(e&&e.__CANCEL__)}function H(e,t,n){m.call(this,e??"canceled",m.ERR_CANCELED,t,n),this.name="CanceledError"}a.inherits(H,m,{__CANCEL__:!0});function nt(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))}function Nn(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,o=0,i;return t=t!==void 0?t:1e3,function(f){const u=Date.now(),l=r[o];i||(i=u),n[s]=f,r[s]=u;let d=o,g=0;for(;d!==s;)g+=n[d++],d=d%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),u-i<t)return;const w=l&&u-l;return w?Math.round(g*1e3/w):void 0}}function xn(e,t){let n=0,r=1e3/t,s,o;const i=(u,l=Date.now())=>{n=l,s=null,o&&(clearTimeout(o),o=null),e(...u)};return[(...u)=>{const l=Date.now(),d=l-n;d>=r?i(u,l):(s=u,o||(o=setTimeout(()=>{o=null,i(s)},r-d)))},()=>s&&i(s)]}const ie=(e,t,n=3)=>{let r=0;const s=Un(50,250);return xn(o=>{const i=o.loaded,c=o.lengthComputable?o.total:void 0,f=i-r,u=s(f),l=i<=c;r=i;const d={loaded:i,total:c,progress:c?i/c:void 0,bytes:f,rate:u||void 0,estimated:u&&c&&l?(c-i)/u:void 0,event:o,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(d)},n)},rt=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},st=e=>(...t)=>a.asap(()=>e(...t)),Ln=A.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,A.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(A.origin),A.navigator&&/(msie|trident)/i.test(A.navigator.userAgent)):()=>!0,Fn=A.hasStandardBrowserEnv?{write(e,t,n,r,s,o){const i=[e+"="+encodeURIComponent(t)];a.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),a.isString(r)&&i.push("path="+r),a.isString(s)&&i.push("domain="+s),o===!0&&i.push("secure"),document.cookie=i.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 Dn(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function kn(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function ot(e,t,n){let r=!Dn(t);return e&&(r||n==!1)?kn(e,t):t}const it=e=>e instanceof P?{...e}:e;function I(e,t){t=t||{};const n={};function r(u,l,d,g){return a.isPlainObject(u)&&a.isPlainObject(l)?a.merge.call({caseless:g},u,l):a.isPlainObject(l)?a.merge({},l):a.isArray(l)?l.slice():l}function s(u,l,d,g){if(a.isUndefined(l)){if(!a.isUndefined(u))return r(void 0,u,d,g)}else return r(u,l,d,g)}function o(u,l){if(!a.isUndefined(l))return r(void 0,l)}function i(u,l){if(a.isUndefined(l)){if(!a.isUndefined(u))return r(void 0,u)}else return r(void 0,l)}function c(u,l,d){if(d in t)return r(u,l);if(d in e)return r(void 0,u)}const f={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:c,headers:(u,l,d)=>s(it(u),it(l),d,!0)};return a.forEach(Object.keys({...e,...t}),function(l){const d=f[l]||s,g=d(e[l],t[l],l);a.isUndefined(g)&&d!==c||(n[l]=g)}),n}const at=e=>{const t=I({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:c}=t;t.headers=i=P.from(i),t.url=Qe(ot(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&i.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let f;if(a.isFormData(n)){if(A.hasStandardBrowserEnv||A.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if((f=i.getContentType())!==!1){const[u,...l]=f?f.split(";").map(d=>d.trim()).filter(Boolean):[];i.setContentType([u||"multipart/form-data",...l].join("; "))}}if(A.hasStandardBrowserEnv&&(r&&a.isFunction(r)&&(r=r(t)),r||r!==!1&&Ln(t.url))){const u=s&&o&&Fn.read(o);u&&i.set(s,u)}return t},Bn=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const s=at(e);let o=s.data;const i=P.from(s.headers).normalize();let{responseType:c,onUploadProgress:f,onDownloadProgress:u}=s,l,d,g,w,h;function y(){w&&w(),h&&h(),s.cancelToken&&s.cancelToken.unsubscribe(l),s.signal&&s.signal.removeEventListener("abort",l)}let p=new XMLHttpRequest;p.open(s.method.toUpperCase(),s.url,!0),p.timeout=s.timeout;function E(){if(!p)return;const C=P.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),N={data:!c||c==="text"||c==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:C,config:e,request:p};nt(function(j){n(j),y()},function(j){r(j),y()},N),p=null}"onloadend"in p?p.onloadend=E:p.onreadystatechange=function(){!p||p.readyState!==4||p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)||setTimeout(E)},p.onabort=function(){p&&(r(new m("Request aborted",m.ECONNABORTED,e,p)),p=null)},p.onerror=function(){r(new m("Network Error",m.ERR_NETWORK,e,p)),p=null},p.ontimeout=function(){let F=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const N=s.transitional||Ge;s.timeoutErrorMessage&&(F=s.timeoutErrorMessage),r(new m(F,N.clarifyTimeoutError?m.ETIMEDOUT:m.ECONNABORTED,e,p)),p=null},o===void 0&&i.setContentType(null),"setRequestHeader"in p&&a.forEach(i.toJSON(),function(F,N){p.setRequestHeader(N,F)}),a.isUndefined(s.withCredentials)||(p.withCredentials=!!s.withCredentials),c&&c!=="json"&&(p.responseType=s.responseType),u&&([g,h]=ie(u,!0),p.addEventListener("progress",g)),f&&p.upload&&([d,w]=ie(f),p.upload.addEventListener("progress",d),p.upload.addEventListener("loadend",w)),(s.cancelToken||s.signal)&&(l=C=>{p&&(r(!C||C.type?new H(null,e,p):C),p.abort(),p=null)},s.cancelToken&&s.cancelToken.subscribe(l),s.signal&&(s.signal.aborted?l():s.signal.addEventListener("abort",l)));const S=Nn(s.url);if(S&&A.protocols.indexOf(S)===-1){r(new m("Unsupported protocol "+S+":",m.ERR_BAD_REQUEST,e));return}p.send(o||null)})},In=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const o=function(u){if(!s){s=!0,c();const l=u instanceof Error?u:this.reason;r.abort(l instanceof m?l:new H(l instanceof Error?l.message:l))}};let i=t&&setTimeout(()=>{i=null,o(new m(`timeout ${t} of ms exceeded`,m.ETIMEDOUT))},t);const c=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(o):u.removeEventListener("abort",o)}),e=null)};e.forEach(u=>u.addEventListener("abort",o));const{signal:f}=r;return f.unsubscribe=()=>a.asap(c),f}},qn=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},vn=async function*(e,t){for await(const n of jn(e))yield*qn(n,t)},jn=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},ct=(e,t,n,r)=>{const s=vn(e,t);let o=0,i,c=f=>{i||(i=!0,r&&r(f))};return new ReadableStream({async pull(f){try{const{done:u,value:l}=await s.next();if(u){c(),f.close();return}let d=l.byteLength;if(n){let g=o+=d;n(g)}f.enqueue(new Uint8Array(l))}catch(u){throw c(u),u}},cancel(f){return c(f),s.return()}},{highWaterMark:2})},ae=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",ut=ae&&typeof ReadableStream=="function",$n=ae&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),lt=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Mn=ut&&lt(()=>{let e=!1;const t=new Request(A.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),ft=64*1024,Re=ut&&lt(()=>a.isReadableStream(new Response("").body)),ce={stream:Re&&(e=>e.body)};ae&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!ce[t]&&(ce[t]=a.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new m(`Response type '${t}' is not supported`,m.ERR_NOT_SUPPORT,r)})})})(new Response);const Hn=async e=>{if(e==null)return 0;if(a.isBlob(e))return e.size;if(a.isSpecCompliantForm(e))return(await new Request(A.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(a.isArrayBufferView(e)||a.isArrayBuffer(e))return e.byteLength;if(a.isURLSearchParams(e)&&(e=e+""),a.isString(e))return(await $n(e)).byteLength},Kn=async(e,t)=>{const n=a.toFiniteNumber(e.getContentLength());return n??Hn(t)},Te={http:fn,xhr:Bn,fetch:ae&&(async e=>{let{url:t,method:n,data:r,signal:s,cancelToken:o,timeout:i,onDownloadProgress:c,onUploadProgress:f,responseType:u,headers:l,withCredentials:d="same-origin",fetchOptions:g}=at(e);u=u?(u+"").toLowerCase():"text";let w=In([s,o&&o.toAbortSignal()],i),h;const y=w&&w.unsubscribe&&(()=>{w.unsubscribe()});let p;try{if(f&&Mn&&n!=="get"&&n!=="head"&&(p=await Kn(l,r))!==0){let N=new Request(t,{method:"POST",body:r,duplex:"half"}),k;if(a.isFormData(r)&&(k=N.headers.get("content-type"))&&l.setContentType(k),N.body){const[j,pe]=rt(p,ie(st(f)));r=ct(N.body,ft,j,pe)}}a.isString(d)||(d=d?"include":"omit");const E="credentials"in Request.prototype;h=new Request(t,{...g,signal:w,method:n.toUpperCase(),headers:l.normalize().toJSON(),body:r,duplex:"half",credentials:E?d:void 0});let S=await fetch(h,g);const C=Re&&(u==="stream"||u==="response");if(Re&&(c||C&&y)){const N={};["status","statusText","headers"].forEach(At=>{N[At]=S[At]});const k=a.toFiniteNumber(S.headers.get("content-length")),[j,pe]=c&&rt(k,ie(st(c),!0))||[];S=new Response(ct(S.body,ft,j,()=>{pe&&pe(),y&&y()}),N)}u=u||"text";let F=await ce[a.findKey(ce,u)||"text"](S,e);return!C&&y&&y(),await new Promise((N,k)=>{nt(N,k,{data:F,headers:P.from(S.headers),status:S.status,statusText:S.statusText,config:e,request:h})})}catch(E){throw y&&y(),E&&E.name==="TypeError"&&/Load failed|fetch/i.test(E.message)?Object.assign(new m("Network Error",m.ERR_NETWORK,e,h),{cause:E.cause||E}):m.from(E,E&&E.code,e,h)}})};a.forEach(Te,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const dt=e=>`- ${e}`,Vn=e=>a.isFunction(e)||e===null||e===!1,ht={getAdapter:e=>{e=a.isArray(e)?e:[e];const{length:t}=e;let n,r;const s={};for(let o=0;o<t;o++){n=e[o];let i;if(r=n,!Vn(n)&&(r=Te[(i=String(n)).toLowerCase()],r===void 0))throw new m(`Unknown adapter '${i}'`);if(r)break;s[i||"#"+o]=r}if(!r){const o=Object.entries(s).map(([c,f])=>`adapter ${c} `+(f===!1?"is not supported by the environment":"is not available in the build"));let i=t?o.length>1?`since :
4
4
  `+o.map(dt).join(`
5
5
  `):" "+dt(o[0]):"as no adapter specified";throw new m("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return r},adapters:Te};function Ae(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new H(null,e)}function pt(e){return Ae(e),e.headers=P.from(e.headers),e.data=Ce.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),ht.getAdapter(e.adapter||Y.adapter)(e).then(function(r){return Ae(e),r.data=Ce.call(e,e.transformResponse,r),r.headers=P.from(r.headers),r},function(r){return tt(r)||(Ae(e),r&&r.response&&(r.response.data=Ce.call(e,e.transformResponse,r.response),r.response.headers=P.from(r.response.headers))),Promise.reject(r)})}const mt="1.11.0",ue={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ue[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const yt={};ue.transitional=function(t,n,r){function s(o,i){return"[Axios v"+mt+"] Transitional option '"+o+"'"+i+(r?". "+r:"")}return(o,i,c)=>{if(t===!1)throw new m(s(i," has been removed"+(n?" in "+n:"")),m.ERR_DEPRECATED);return n&&!yt[i]&&(yt[i]=!0,console.warn(s(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,i,c):!0}},ue.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function zn(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 o=r[s],i=t[o];if(i){const c=e[o],f=c===void 0||i(c,o,e);if(f!==!0)throw new m("option "+o+" must be "+f,m.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new m("Unknown option "+o,m.ERR_BAD_OPTION)}}const le={assertOptions:zn,validators:ue},L=le.validators;let q=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Ye,response:new Ye}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
6
- `+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=I(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&le.assertOptions(r,{silentJSONParsing:L.transitional(L.boolean),forcedJSONParsing:L.transitional(L.boolean),clarifyTimeoutError:L.transitional(L.boolean)},!1),s!=null&&(a.isFunction(s)?n.paramsSerializer={serialize:s}:le.assertOptions(s,{encode:L.function,serialize:L.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),le.assertOptions(n,{baseUrl:L.spelling("baseURL"),withXsrfToken:L.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&a.merge(o.common,o[n.method]);o&&a.forEach(["delete","get","head","post","put","patch","common"],h=>{delete o[h]}),n.headers=P.concat(i,o);const c=[];let f=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(n)===!1||(f=f&&y.synchronous,c.unshift(y.fulfilled,y.rejected))});const u=[];this.interceptors.response.forEach(function(y){u.push(y.fulfilled,y.rejected)});let l,d=0,g;if(!f){const h=[pt.bind(this),void 0];for(h.unshift(...c),h.push(...u),g=h.length,l=Promise.resolve(n);d<g;)l=l.then(h[d++],h[d++]);return l}g=c.length;let w=n;for(d=0;d<g;){const h=c[d++],y=c[d++];try{w=h(w)}catch(p){y.call(this,p);break}}try{l=pt.call(this,w)}catch(h){return Promise.reject(h)}for(d=0,g=u.length;d<g;)l=l.then(u[d++],u[d++]);return l}getUri(t){t=I(this.defaults,t);const n=ot(t.baseURL,t.url,t.allowAbsoluteUrls);return Qe(n,t.params,t.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(t){q.prototype[t]=function(n,r){return this.request(I(r||{},{method:t,url:n,data:(r||{}).data}))}}),a.forEach(["post","put","patch"],function(t){function n(r){return function(o,i,c){return this.request(I(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}q.prototype[t]=n(),q.prototype[t+"Form"]=n(!0)});let Jn=class _t{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(s=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(c=>{r.subscribe(c),o=c}).then(s);return i.cancel=function(){r.unsubscribe(o)},i},t(function(o,i,c){r.reason||(r.reason=new H(o,i,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)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new _t(function(s){t=s}),cancel:t}}};function Wn(e){return function(n){return e.apply(null,n)}}function Xn(e){return a.isObject(e)&&e.isAxiosError===!0}const _e={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(_e).forEach(([e,t])=>{_e[t]=e});function gt(e){const t=new q(e),n=_(q.prototype.request,t);return a.extend(n,q.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return gt(I(e,s))},n}const b=gt(Y);b.Axios=q,b.CanceledError=H,b.CancelToken=Jn,b.isCancel=tt,b.VERSION=mt,b.toFormData=se,b.AxiosError=m,b.Cancel=b.CanceledError,b.all=function(t){return Promise.all(t)},b.spread=Wn,b.isAxiosError=Xn,b.mergeConfig=I,b.AxiosHeaders=P,b.formToJSON=e=>Ze(a.isHTMLForm(e)?new FormData(e):e),b.getAdapter=ht.getAdapter,b.HttpStatusCode=_e,b.default=b;const{Axios:Gr,AxiosError:fe,CanceledError:Zr,isCancel:es,CancelToken:ts,VERSION:ns,all:rs,Cancel:ss,isAxiosError:os,spread:is,toFormData:as,AxiosHeaders:cs,HttpStatusCode:us,formToJSON:ls,getAdapter:fs,mergeConfig:ds}=b;class Oe extends Error{constructor(n){super(n.join(", "));T(this,"errors");this.name="ValidationError",this.errors=n}}class Pe extends Error{constructor(n){super("Address already registered.");T(this,"address");this.name="AddressInUseError",this.address=n}}class Ne extends Error{constructor(n){super("Code already registered.");T(this,"code");this.name="CodeInUseError",this.code=n}}class Ue extends Error{constructor(){super("Invalid signature provided"),this.name="InvalidSignatureError"}}class Qn{constructor(t){T(this,"httpClient");T(this,"_debug");this.httpClient=t.httpClient,this._debug=t.debug}async create(t,n,r,s,o){var i;try{await this.httpClient.post({path:"/affiliates",postData:{address:t,identifier_type:n,name:r,code:r,signature:s,account_chain_id:o}})}catch(c){if(c instanceof fe){const f=(i=c.response)==null?void 0:i.data;if(typeof(f==null?void 0:f.message)=="string"){const u=f.message.toLowerCase();throw u=="invalid signature"?new Ue:u=="address in use"?new Pe(t):u=="code in use"?new Ne(r):new Error(u)}else if((f==null?void 0:f.message)instanceof Array)throw new Oe(f.message)}throw c}}async update(t,n,r,s,o){var i;try{await this.httpClient.post({path:`/affiliates/${t}`,postData:{code:r,user_identifier:t,identifier_type:n,signature:s,account_chain_id:o}})}catch(c){if(c instanceof fe){const f=(i=c.response)==null?void 0:i.data;if(typeof(f==null?void 0:f.message)=="string"){const u=f.message.toLowerCase();throw u=="invalid signature"?new Ue:u=="address in use"?new Pe(t):u=="code in use"?new Ne(r):new Error(u)}else if((f==null?void 0:f.message)instanceof Array)throw new Oe(f.message)}throw c}}async isCodeFree(t){var n;try{return await this.httpClient.get({path:`/affiliates/codes/${t}`}),!1}catch(r){if(r instanceof fe&&((n=r.response)==null?void 0:n.status)===404)return!0;throw console.error("Fuul SDK: Could not check affiliate code",r),r}}async getCode(t,n){var r;try{return(await this.httpClient.get({path:`/affiliates/${t}`,queryParams:{identifier_type:n}})).data.code}catch(s){if(s instanceof fe&&((r=s.response)==null?void 0:r.status)===404)return null;throw console.error("Fuul SDK: Could not get affiliate code",s),s}}}const Yn="/audiences";class Gn{constructor(t){T(this,"httpClient");T(this,"_debug");this.httpClient=t.httpClient,this._debug=t.debug}async getUserAudiences(t){return(await this.httpClient.get({path:`${Yn}/user`,queryParams:{...t}})).data}}class Zn{constructor(t){T(this,"httpClient");this.httpClient=t.httpClient}async getAll(t){const{data:n}=await this.httpClient.get({path:"conversions",queryParams:{...t}});return n}}const wt="fuul.sent",er=60,tr="connect_wallet",bt=10;class nr{constructor(t){T(this,"debug");T(this,"httpClient");this.httpClient=t.httpClient,this.debug=!!t.debug}async sendEvent(t,n){if(this.isDuplicate(t)){this.debug&&console.debug("Fuul SDK: Event is considered duplicate and will not be sent");return}if(!n||!Array.isArray(n)||n.length===0)await this.httpClient.post({path:"events",postData:t});else for(const r of n){const s=structuredClone({...t,project_id:r});s.metadata.project_id=r,await this.httpClient.post({path:"events",postData:s,queryParams:{project_id:r}})}this.debug&&console.debug(`Fuul SDK: Sent '${t.name}' event`),this.saveSentEvent(t)}isDuplicate(t){var l,d,g,w;const n=`${wt}_${t.name}`,r=localStorage.getItem(n);if(!r)return!1;const s=JSON.parse(r);if(this.getCurrentTimestamp()-s.timestamp>er)return!1;let f=!1;t.metadata&&(f=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&&((l=s.user)==null?void 0:l.identifier)===((d=t.user)==null?void 0:d.identifier)&&((g=s.user)==null?void 0:g.identifier_type)===((w=t.user)==null?void 0:w.identifier_type)&&s.signature===t.signature&&s.signature_message===t.signature_message);let u=!1;return t.args&&s.args&&(u=s.args.page===t.args.page),u&&f}getCurrentTimestamp(){return Date.now()/1e3}saveSentEvent(t){var i,c,f,u;const n=`${wt}_${t.name}`,r=`${n}_all`,s=this.getCurrentTimestamp(),o={...t,timestamp:s};if(localStorage.setItem(n,JSON.stringify(o)),t.name===tr){const l=JSON.parse(localStorage.getItem(r)||"[]"),d={name:t.name,user:{identifier:(i=t.user)==null?void 0:i.identifier,identifier_type:(c=t.user)==null?void 0:c.identifier_type},tracking_id:(f=t.metadata)==null?void 0:f.tracking_id,page:(u=t.args)==null?void 0:u.page};"user_address"in t&&(d.user_address=t.user_address);const g=[...l,d];g.length>bt&&g.splice(0,g.length-bt),localStorage.setItem(r,JSON.stringify(g))}}}const rr={version:"7.0.1"};class sr{constructor(t){T(this,"client");T(this,"defaultQueryParams");this.client=b.create({...t,headers:{Authorization:`Bearer ${t.apiKey}`,"X-Fuul-Sdk-Version":rr.version}}),this.defaultQueryParams=t.queryParams||{}}makeQueryParams(t){return Object.assign({},this.defaultQueryParams||{},t||{})}async get(t){return this.client.request({url:t.path,params:this.makeQueryParams(t.queryParams),method:"GET"})}async post(t){return this.client.request({url:t.path,params:this.makeQueryParams(t.queryParams),data:t.postData,method:"POST"})}async put(t){return this.client.request({url:t.path,params:this.makeQueryParams(t.queryParams),data:t.postData,method:"PUT"})}async delete(t){return this.client.request({url:t.path,params:this.makeQueryParams(t.queryParams),method:"DELETE"})}}class or{constructor(t){T(this,"httpClient");this.httpClient=t.httpClient}async getPayoutsLeaderboard(t){return(await this.httpClient.get({path:"/payouts/leaderboard/payouts",queryParams:{...t}})).data}async getPointsLeaderboard(t){return(await this.httpClient.get({path:"/payouts/leaderboard/points",queryParams:{...t}})).data}async getReferredUsersLeaderboard(t){return(await this.httpClient.get({path:"/leaderboard/referred",queryParams:{...t}})).data}}const Z="/payouts";class ir{constructor(t){T(this,"httpClient");T(this,"_debug");this.httpClient=t.httpClient,this._debug=t.debug}async getUserPayoutsByConversion(t){return(await this.httpClient.get({path:Z,queryParams:{...t,type:"onchain-currency"}})).data}async getUserPointsByConversion(t){return(await this.httpClient.get({path:Z,queryParams:{...t,type:"point"}})).data}async getUserPayoutMovements(t){return(await this.httpClient.get({path:`${Z}/movements`,queryParams:{...t,type:"onchain-currency"}})).data}async getUserPointsMovements(t){return(await this.httpClient.get({path:`${Z}/movements`,queryParams:{...t,type:"point"}})).data}async getVolumeLeaderboard(t){return(await this.httpClient.get({path:`${Z}/leaderboard/volume`,queryParams:{...t}})).data}}const ar="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let cr=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=ar[n[e]&63];return t};const ur="fuul.tracking_id",xe=()=>mr(ur,()=>cr()),Et=()=>V("af")||V("referrer"),lr=()=>document.referrer,fr=()=>yr(),dr=()=>V("category"),hr=()=>V("title"),pr=()=>V("tag"),mr=(e,t)=>{const n=localStorage.getItem(e);if(n)return n;{const r=t();return r?localStorage.setItem(e,r):localStorage.removeItem(e),r}},V=e=>new URLSearchParams(window.location.search).get(e),yr=()=>{const e=V("source");if(e)return e},gr="/user";class wr{constructor(t){T(this,"httpClient");this.httpClient=t.httpClient}async getUserAffiliates(t){return(await this.httpClient.get({path:gr,queryParams:{...t}})).data.affiliates}}const br="https://api.fuul.xyz/api/v1/";let v=!1,Le=!1,Fe,D,St,Ct,K,de,z,Rt,he;function Er(e){v=!!e.debug,!Le&&(Fe=e.apiKey,jr(),D=$r(e.baseApiUrl??br,e.defaultQueryParams??{}),St=new Zn({httpClient:D,debug:v}),de=new nr({httpClient:D,debug:v}),K=new Qn({httpClient:D,debug:v}),z=new ir({httpClient:D,debug:v}),Ct=new wr({httpClient:D}),Rt=new Gn({httpClient:D,debug:v}),he=new or({httpClient:D}),Le=!0,v&&console.debug("Fuul SDK: init() complete"))}function x(){if(!Le)throw new Error("Fuul SDK: You need to call init() to initialize the library before using any methods")}async function Sr(e,t){x(),De(),ke();const n={name:e,args:t??{},metadata:{tracking_id:xe()}};await de.sendEvent(n)}async function Cr(e,t){x(),De(),ke();const n={name:"pageview",args:{page:e??document.location.pathname,locationOrigin:document.location.origin},metadata:{tracking_id:xe(),referrer_url:lr(),source:fr(),affiliate_id:Et()??void 0,referrer:Et()??void 0,category:dr()??void 0,title:hr()??void 0,tag:pr()??void 0}};await de.sendEvent(n,t)}async function Rr(e,t){x(),De(),ke();const n={name:"connect_wallet",user:{identifier:e.identifier,identifier_type:e.identifierType},args:{page:document.location.pathname,locationOrigin:document.location.origin},metadata:{tracking_id:xe()}};e!=null&&e.signature&&(n.signature=e==null?void 0:e.signature,n.signature_message=e==null?void 0:e.message),e!=null&&e.signaturePublicKey&&(n.signature_public_key=e.signaturePublicKey),e!=null&&e.accountChainId&&(n.account_chain_id=e.accountChainId),await de.sendEvent(n,t)}async function Tr(e){x(),await K.create(e.userIdentifier,e.identifierType,e.code,e.signature,e.accountChainId)}async function Ar(e){x(),await K.update(e.userIdentifier,e.identifierType,e.code,e.signature,e.accountChainId)}async function _r(e,t){return x(),await K.getCode(e,t)}async function Or(e){return x(),await K.isCodeFree(e)}async function Pr(e,t,n,r){x();const s=await K.getCode(t,n),o=new URLSearchParams({af:s??t});return r!=null&&r.title&&o.append("af_title",r.title),r!=null&&r.format&&o.append("af_format",r.format),r!=null&&r.place&&o.append("af_place",r.place),`${e}?${o.toString()}`}function Nr(e){return he.getPayoutsLeaderboard(e)}function Ur(e){return he.getPointsLeaderboard(e)}function xr(e){return he.getReferredUsersLeaderboard(e)}function Lr(e){return z.getVolumeLeaderboard(e)}function Fr(e){return z.getUserPayoutsByConversion(e)}function Dr(e){return z.getUserPointsByConversion(e)}function kr(e){return z.getUserPayoutMovements(e)}function Br(e){return z.getUserPointsMovements(e)}async function Ir(e){return x(),St.getAll(e)}async function qr(e){return x(),Ct.getUserAffiliates(e)}async function vr(e){return x(),Rt.getUserAudiences(e)}function De(){if(typeof window>"u"||typeof document>"u")throw new Error("Fuul SDK: Browser context required")}function ke(){if(navigator.webdriver)throw new Error("Fuul SDK: You are using a browser automation tool")}function jr(){if(!Fe)throw new Error("Fuul SDK: Invalid API key")}function $r(e,t){return new sr({baseURL:e,timeout:3e4,apiKey:Fe,queryParams:t})}const Mr={init:Er,sendEvent:Sr,sendPageview:Cr,identifyUser:Rr,generateTrackingLink:Pr,getConversions:Ir,createAffiliateCode:Tr,updateAffiliateCode:Ar,getAffiliateCode:_r,isAffiliateCodeFree:Or,getPayoutsLeaderboard:Nr,getPointsLeaderboard:Ur,getReferredUsersLeaderboard:xr,getUserAudiences:vr,getUserPayoutsByConversion:Fr,getUserPointsByConversion:Dr,getUserPointsMovements:Br,getUserPayoutMovements:kr,getUserAffiliates:qr,getVolumeLeaderboard:Lr};var Tt=(e=>(e.EvmAddress="evm_address",e.SolanaAddress="solana_address",e.Email="email",e))(Tt||{});R.AddressInUseError=Pe,R.CodeInUseError=Ne,R.Fuul=Mr,R.InvalidSignatureError=Ue,R.UserIdentifierType=Tt,R.ValidationError=Oe,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"})});
6
+ `+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=I(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&le.assertOptions(r,{silentJSONParsing:L.transitional(L.boolean),forcedJSONParsing:L.transitional(L.boolean),clarifyTimeoutError:L.transitional(L.boolean)},!1),s!=null&&(a.isFunction(s)?n.paramsSerializer={serialize:s}:le.assertOptions(s,{encode:L.function,serialize:L.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),le.assertOptions(n,{baseUrl:L.spelling("baseURL"),withXsrfToken:L.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&a.merge(o.common,o[n.method]);o&&a.forEach(["delete","get","head","post","put","patch","common"],h=>{delete o[h]}),n.headers=P.concat(i,o);const c=[];let f=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(n)===!1||(f=f&&y.synchronous,c.unshift(y.fulfilled,y.rejected))});const u=[];this.interceptors.response.forEach(function(y){u.push(y.fulfilled,y.rejected)});let l,d=0,g;if(!f){const h=[pt.bind(this),void 0];for(h.unshift(...c),h.push(...u),g=h.length,l=Promise.resolve(n);d<g;)l=l.then(h[d++],h[d++]);return l}g=c.length;let w=n;for(d=0;d<g;){const h=c[d++],y=c[d++];try{w=h(w)}catch(p){y.call(this,p);break}}try{l=pt.call(this,w)}catch(h){return Promise.reject(h)}for(d=0,g=u.length;d<g;)l=l.then(u[d++],u[d++]);return l}getUri(t){t=I(this.defaults,t);const n=ot(t.baseURL,t.url,t.allowAbsoluteUrls);return Qe(n,t.params,t.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(t){q.prototype[t]=function(n,r){return this.request(I(r||{},{method:t,url:n,data:(r||{}).data}))}}),a.forEach(["post","put","patch"],function(t){function n(r){return function(o,i,c){return this.request(I(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}q.prototype[t]=n(),q.prototype[t+"Form"]=n(!0)});let Jn=class _t{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(s=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(c=>{r.subscribe(c),o=c}).then(s);return i.cancel=function(){r.unsubscribe(o)},i},t(function(o,i,c){r.reason||(r.reason=new H(o,i,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)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new _t(function(s){t=s}),cancel:t}}};function Wn(e){return function(n){return e.apply(null,n)}}function Xn(e){return a.isObject(e)&&e.isAxiosError===!0}const _e={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(_e).forEach(([e,t])=>{_e[t]=e});function gt(e){const t=new q(e),n=_(q.prototype.request,t);return a.extend(n,q.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return gt(I(e,s))},n}const b=gt(Y);b.Axios=q,b.CanceledError=H,b.CancelToken=Jn,b.isCancel=tt,b.VERSION=mt,b.toFormData=se,b.AxiosError=m,b.Cancel=b.CanceledError,b.all=function(t){return Promise.all(t)},b.spread=Wn,b.isAxiosError=Xn,b.mergeConfig=I,b.AxiosHeaders=P,b.formToJSON=e=>Ze(a.isHTMLForm(e)?new FormData(e):e),b.getAdapter=ht.getAdapter,b.HttpStatusCode=_e,b.default=b;const{Axios:Gr,AxiosError:fe,CanceledError:Zr,isCancel:es,CancelToken:ts,VERSION:ns,all:rs,Cancel:ss,isAxiosError:os,spread:is,toFormData:as,AxiosHeaders:cs,HttpStatusCode:us,formToJSON:ls,getAdapter:fs,mergeConfig:ds}=b;class Oe extends Error{constructor(n){super(n.join(", "));T(this,"errors");this.name="ValidationError",this.errors=n}}class Pe extends Error{constructor(n){super("Address already registered.");T(this,"address");this.name="AddressInUseError",this.address=n}}class Ne extends Error{constructor(n){super("Code already registered.");T(this,"code");this.name="CodeInUseError",this.code=n}}class Ue extends Error{constructor(){super("Invalid signature provided"),this.name="InvalidSignatureError"}}class Qn{constructor(t){T(this,"httpClient");T(this,"_debug");this.httpClient=t.httpClient,this._debug=t.debug}async create(t,n,r,s,o,i){var c;try{await this.httpClient.post({path:"/affiliates",postData:{address:t,identifier_type:n,name:r,code:r,signature:s,signature_public_key:o,account_chain_id:i}})}catch(f){if(f instanceof fe){const u=(c=f.response)==null?void 0:c.data;if(typeof(u==null?void 0:u.message)=="string"){const l=u.message.toLowerCase();throw l=="invalid signature"?new Ue:l=="address in use"?new Pe(t):l=="code in use"?new Ne(r):new Error(l)}else if((u==null?void 0:u.message)instanceof Array)throw new Oe(u.message)}throw f}}async update(t,n,r,s,o,i){var c;try{await this.httpClient.post({path:`/affiliates/${t}`,postData:{code:r,user_identifier:t,identifier_type:n,signature:s,signature_public_key:o,account_chain_id:i}})}catch(f){if(f instanceof fe){const u=(c=f.response)==null?void 0:c.data;if(typeof(u==null?void 0:u.message)=="string"){const l=u.message.toLowerCase();throw l=="invalid signature"?new Ue:l=="address in use"?new Pe(t):l=="code in use"?new Ne(r):new Error(l)}else if((u==null?void 0:u.message)instanceof Array)throw new Oe(u.message)}throw f}}async isCodeFree(t){var n;try{return await this.httpClient.get({path:`/affiliates/codes/${t}`}),!1}catch(r){if(r instanceof fe&&((n=r.response)==null?void 0:n.status)===404)return!0;throw console.error("Fuul SDK: Could not check affiliate code",r),r}}async getCode(t,n){var r;try{return(await this.httpClient.get({path:`/affiliates/${t}`,queryParams:{identifier_type:n}})).data.code}catch(s){if(s instanceof fe&&((r=s.response)==null?void 0:r.status)===404)return null;throw console.error("Fuul SDK: Could not get affiliate code",s),s}}}const Yn="/audiences";class Gn{constructor(t){T(this,"httpClient");T(this,"_debug");this.httpClient=t.httpClient,this._debug=t.debug}async getUserAudiences(t){return(await this.httpClient.get({path:`${Yn}/user`,queryParams:{...t}})).data}}class Zn{constructor(t){T(this,"httpClient");this.httpClient=t.httpClient}async getAll(t){const{data:n}=await this.httpClient.get({path:"conversions",queryParams:{...t}});return n}}const wt="fuul.sent",er=60,tr="connect_wallet",bt=10;class nr{constructor(t){T(this,"debug");T(this,"httpClient");this.httpClient=t.httpClient,this.debug=!!t.debug}async sendEvent(t,n){if(this.isDuplicate(t)){this.debug&&console.debug("Fuul SDK: Event is considered duplicate and will not be sent");return}if(!n||!Array.isArray(n)||n.length===0)await this.httpClient.post({path:"events",postData:t});else for(const r of n){const s=structuredClone({...t,project_id:r});s.metadata.project_id=r,await this.httpClient.post({path:"events",postData:s,queryParams:{project_id:r}})}this.debug&&console.debug(`Fuul SDK: Sent '${t.name}' event`),this.saveSentEvent(t)}isDuplicate(t){var l,d,g,w;const n=`${wt}_${t.name}`,r=localStorage.getItem(n);if(!r)return!1;const s=JSON.parse(r);if(this.getCurrentTimestamp()-s.timestamp>er)return!1;let f=!1;t.metadata&&(f=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&&((l=s.user)==null?void 0:l.identifier)===((d=t.user)==null?void 0:d.identifier)&&((g=s.user)==null?void 0:g.identifier_type)===((w=t.user)==null?void 0:w.identifier_type)&&s.signature===t.signature&&s.signature_message===t.signature_message);let u=!1;return t.args&&s.args&&(u=s.args.page===t.args.page),u&&f}getCurrentTimestamp(){return Date.now()/1e3}saveSentEvent(t){var i,c,f,u;const n=`${wt}_${t.name}`,r=`${n}_all`,s=this.getCurrentTimestamp(),o={...t,timestamp:s};if(localStorage.setItem(n,JSON.stringify(o)),t.name===tr){const l=JSON.parse(localStorage.getItem(r)||"[]"),d={name:t.name,user:{identifier:(i=t.user)==null?void 0:i.identifier,identifier_type:(c=t.user)==null?void 0:c.identifier_type},tracking_id:(f=t.metadata)==null?void 0:f.tracking_id,page:(u=t.args)==null?void 0:u.page};"user_address"in t&&(d.user_address=t.user_address);const g=[...l,d];g.length>bt&&g.splice(0,g.length-bt),localStorage.setItem(r,JSON.stringify(g))}}}const rr={version:"7.0.3"};class sr{constructor(t){T(this,"client");T(this,"defaultQueryParams");this.client=b.create({...t,headers:{Authorization:`Bearer ${t.apiKey}`,"X-Fuul-Sdk-Version":rr.version}}),this.defaultQueryParams=t.queryParams||{}}makeQueryParams(t){return Object.assign({},this.defaultQueryParams||{},t||{})}async get(t){return this.client.request({url:t.path,params:this.makeQueryParams(t.queryParams),method:"GET"})}async post(t){return this.client.request({url:t.path,params:this.makeQueryParams(t.queryParams),data:t.postData,method:"POST"})}async put(t){return this.client.request({url:t.path,params:this.makeQueryParams(t.queryParams),data:t.postData,method:"PUT"})}async delete(t){return this.client.request({url:t.path,params:this.makeQueryParams(t.queryParams),method:"DELETE"})}}class or{constructor(t){T(this,"httpClient");this.httpClient=t.httpClient}async getPayoutsLeaderboard(t){return(await this.httpClient.get({path:"/payouts/leaderboard/payouts",queryParams:{...t}})).data}async getPointsLeaderboard(t){return(await this.httpClient.get({path:"/payouts/leaderboard/points",queryParams:{...t}})).data}async getReferredUsersLeaderboard(t){return(await this.httpClient.get({path:"/leaderboard/referred",queryParams:{...t}})).data}}const Z="/payouts";class ir{constructor(t){T(this,"httpClient");T(this,"_debug");this.httpClient=t.httpClient,this._debug=t.debug}async getUserPayoutsByConversion(t){return(await this.httpClient.get({path:Z,queryParams:{...t,type:"onchain-currency"}})).data}async getUserPointsByConversion(t){return(await this.httpClient.get({path:Z,queryParams:{...t,type:"point"}})).data}async getUserPayoutMovements(t){return(await this.httpClient.get({path:`${Z}/movements`,queryParams:{...t,type:"onchain-currency"}})).data}async getUserPointsMovements(t){return(await this.httpClient.get({path:`${Z}/movements`,queryParams:{...t,type:"point"}})).data}async getVolumeLeaderboard(t){return(await this.httpClient.get({path:`${Z}/leaderboard/volume`,queryParams:{...t}})).data}}const ar="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let cr=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=ar[n[e]&63];return t};const ur="fuul.tracking_id",xe=()=>mr(ur,()=>cr()),Et=()=>K("af")||K("referrer"),lr=()=>document.referrer,fr=()=>yr(),dr=()=>K("category"),hr=()=>K("title"),pr=()=>K("tag"),mr=(e,t)=>{const n=localStorage.getItem(e);if(n)return n;{const r=t();return r?localStorage.setItem(e,r):localStorage.removeItem(e),r}},K=e=>new URLSearchParams(window.location.search).get(e),yr=()=>{const e=K("source");if(e)return e},gr="/user";class wr{constructor(t){T(this,"httpClient");this.httpClient=t.httpClient}async getUserAffiliates(t){return(await this.httpClient.get({path:gr,queryParams:{...t}})).data.affiliates}}const br="https://api.fuul.xyz/api/v1/";let v=!1,Le=!1,Fe,D,St,Ct,V,de,z,Rt,he;function Er(e){v=!!e.debug,!Le&&(Fe=e.apiKey,jr(),D=$r(e.baseApiUrl??br,e.defaultQueryParams??{}),St=new Zn({httpClient:D,debug:v}),de=new nr({httpClient:D,debug:v}),V=new Qn({httpClient:D,debug:v}),z=new ir({httpClient:D,debug:v}),Ct=new wr({httpClient:D}),Rt=new Gn({httpClient:D,debug:v}),he=new or({httpClient:D}),Le=!0,v&&console.debug("Fuul SDK: init() complete"))}function x(){if(!Le)throw new Error("Fuul SDK: You need to call init() to initialize the library before using any methods")}async function Sr(e,t){x(),De(),ke();const n={name:e,args:t??{},metadata:{tracking_id:xe()}};await de.sendEvent(n)}async function Cr(e,t){x(),De(),ke();const n={name:"pageview",args:{page:e??document.location.pathname,locationOrigin:document.location.origin},metadata:{tracking_id:xe(),referrer_url:lr(),source:fr(),affiliate_id:Et()??void 0,referrer:Et()??void 0,category:dr()??void 0,title:hr()??void 0,tag:pr()??void 0}};await de.sendEvent(n,t)}async function Rr(e,t){x(),De(),ke();const n={name:"connect_wallet",user:{identifier:e.identifier,identifier_type:e.identifierType},args:{page:document.location.pathname,locationOrigin:document.location.origin},metadata:{tracking_id:xe()}};e!=null&&e.signature&&(n.signature=e==null?void 0:e.signature,n.signature_message=e==null?void 0:e.message),e!=null&&e.signaturePublicKey&&(n.signature_public_key=e.signaturePublicKey),e!=null&&e.accountChainId&&(n.account_chain_id=e.accountChainId),await de.sendEvent(n,t)}async function Tr(e){x(),await V.create(e.userIdentifier,e.identifierType,e.code,e.signature,e.signaturePublicKey,e.accountChainId)}async function Ar(e){x(),await V.update(e.userIdentifier,e.identifierType,e.code,e.signature,e.signaturePublicKey,e.accountChainId)}async function _r(e,t){return x(),await V.getCode(e,t)}async function Or(e){return x(),await V.isCodeFree(e)}async function Pr(e,t,n,r){x();const s=await V.getCode(t,n),o=new URLSearchParams({af:s??t});return r!=null&&r.title&&o.append("af_title",r.title),r!=null&&r.format&&o.append("af_format",r.format),r!=null&&r.place&&o.append("af_place",r.place),`${e}?${o.toString()}`}function Nr(e){return he.getPayoutsLeaderboard(e)}function Ur(e){return he.getPointsLeaderboard(e)}function xr(e){return he.getReferredUsersLeaderboard(e)}function Lr(e){return z.getVolumeLeaderboard(e)}function Fr(e){return z.getUserPayoutsByConversion(e)}function Dr(e){return z.getUserPointsByConversion(e)}function kr(e){return z.getUserPayoutMovements(e)}function Br(e){return z.getUserPointsMovements(e)}async function Ir(e){return x(),St.getAll(e)}async function qr(e){return x(),Ct.getUserAffiliates(e)}async function vr(e){return x(),Rt.getUserAudiences(e)}function De(){if(typeof window>"u"||typeof document>"u")throw new Error("Fuul SDK: Browser context required")}function ke(){if(navigator.webdriver)throw new Error("Fuul SDK: Error")}function jr(){if(!Fe)throw new Error("Fuul SDK: Invalid API key")}function $r(e,t){return new sr({baseURL:e,timeout:3e4,apiKey:Fe,queryParams:t})}const Mr={init:Er,sendEvent:Sr,sendPageview:Cr,identifyUser:Rr,generateTrackingLink:Pr,getConversions:Ir,createAffiliateCode:Tr,updateAffiliateCode:Ar,getAffiliateCode:_r,isAffiliateCodeFree:Or,getPayoutsLeaderboard:Nr,getPointsLeaderboard:Ur,getReferredUsersLeaderboard:xr,getUserAudiences:vr,getUserPayoutsByConversion:Fr,getUserPointsByConversion:Dr,getUserPointsMovements:Br,getUserPayoutMovements:kr,getUserAffiliates:qr,getVolumeLeaderboard:Lr};var Tt=(e=>(e.EvmAddress="evm_address",e.SolanaAddress="solana_address",e.Email="email",e))(Tt||{});R.AddressInUseError=Pe,R.CodeInUseError=Ne,R.Fuul=Mr,R.InvalidSignatureError=Ue,R.UserIdentifierType=Tt,R.ValidationError=Oe,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"})});
@@ -1,4 +1,4 @@
1
- declare const _default: { "version": "7.0.1" }
1
+ declare const _default: { "version": "7.0.3" }
2
2
  ;
3
3
 
4
4
  export default _default;
@@ -26,6 +26,7 @@ export type AffiliateCodeParams = {
26
26
  identifierType: UserIdentifierType;
27
27
  code: string;
28
28
  signature: string;
29
+ signaturePublicKey?: string;
29
30
  accountChainId?: number;
30
31
  };
31
32
  //# sourceMappingURL=sdk.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../src/types/sdk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,IAAI,CAAC;AAExC,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC7C,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,kBAAkB,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,kBAAkB,CAAC;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC"}
1
+ {"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../src/types/sdk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,IAAI,CAAC;AAExC,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC7C,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,kBAAkB,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,kBAAkB,CAAC;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fuul/sdk",
3
- "version": "7.0.1",
3
+ "version": "7.0.3",
4
4
  "description": "Fuul SDK",
5
5
  "keywords": [
6
6
  "Fuul",