@chainrails/react 0.2.26 → 0.2.28

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.
@@ -1,47 +1,47 @@
1
- import { useState as C, useRef as re, useEffect as x, useMemo as ye, useSyncExternalStore as Rt, useCallback as At, useLayoutEffect as vt, useDebugValue as Pt } from "react";
2
- import { jsxs as we, jsx as M } from "react/jsx-runtime";
3
- import './index.css';class G extends Error {
1
+ import { useState as v, useRef as ie, useEffect as x, useMemo as Ee, useSyncExternalStore as gt, useCallback as mt, useLayoutEffect as pt, useDebugValue as yt } from "react";
2
+ import { jsxs as Te, jsx as L } from "react/jsx-runtime";
3
+ import './index.css';class ee extends Error {
4
4
  response;
5
5
  request;
6
6
  options;
7
- constructor(t, s, n) {
8
- const r = t.status || t.status === 0 ? t.status : "", i = t.statusText ?? "", o = `${r} ${i}`.trim(), a = o ? `status code ${o}` : "an unknown error";
9
- super(`Request failed with ${a}: ${s.method} ${s.url}`), this.name = "HTTPError", this.response = t, this.request = s, this.options = n;
7
+ constructor(e, s, n) {
8
+ const r = e.status || e.status === 0 ? e.status : "", i = e.statusText ?? "", o = `${r} ${i}`.trim(), a = o ? `status code ${o}` : "an unknown error";
9
+ super(`Request failed with ${a}: ${s.method} ${s.url}`), this.name = "HTTPError", this.response = e, this.request = s, this.options = n;
10
10
  }
11
11
  }
12
12
  class Me extends Error {
13
13
  name = "NonError";
14
14
  value;
15
- constructor(t) {
15
+ constructor(e) {
16
16
  let s = "Non-error value was thrown";
17
17
  try {
18
- typeof t == "string" ? s = t : t && typeof t == "object" && "message" in t && typeof t.message == "string" && (s = t.message);
18
+ typeof e == "string" ? s = e : e && typeof e == "object" && "message" in e && typeof e.message == "string" && (s = e.message);
19
19
  } catch {
20
20
  }
21
- super(s), this.value = t;
21
+ super(s), this.value = e;
22
22
  }
23
23
  }
24
- class K extends Error {
24
+ class V extends Error {
25
25
  name = "ForceRetryError";
26
26
  customDelay;
27
27
  code;
28
28
  customRequest;
29
- constructor(t) {
30
- const s = t?.cause ? t.cause instanceof Error ? t.cause : new Me(t.cause) : void 0;
31
- super(t?.code ? `Forced retry: ${t.code}` : "Forced retry", s ? { cause: s } : void 0), this.customDelay = t?.delay, this.code = t?.code, this.customRequest = t?.request;
29
+ constructor(e) {
30
+ const s = e?.cause ? e.cause instanceof Error ? e.cause : new Me(e.cause) : void 0;
31
+ super(e?.code ? `Forced retry: ${e.code}` : "Forced retry", s ? { cause: s } : void 0), this.customDelay = e?.delay, this.code = e?.code, this.customRequest = e?.request;
32
32
  }
33
33
  }
34
- const be = (() => {
35
- let e = !1, t = !1;
34
+ const Se = (() => {
35
+ let t = !1, e = !1;
36
36
  const s = typeof globalThis.ReadableStream == "function", n = typeof globalThis.Request == "function";
37
37
  if (s && n)
38
38
  try {
39
- t = new globalThis.Request("https://empty.invalid", {
39
+ e = new globalThis.Request("https://empty.invalid", {
40
40
  body: new globalThis.ReadableStream(),
41
41
  method: "POST",
42
42
  // @ts-expect-error - Types are outdated.
43
43
  get duplex() {
44
- return e = !0, "half";
44
+ return t = !0, "half";
45
45
  }
46
46
  }).headers.has("Content-Type");
47
47
  } catch (r) {
@@ -49,8 +49,8 @@ const be = (() => {
49
49
  return !1;
50
50
  throw r;
51
51
  }
52
- return e && !t;
53
- })(), It = typeof globalThis.AbortController == "function", Be = typeof globalThis.AbortSignal == "function" && typeof globalThis.AbortSignal.any == "function", Ct = typeof globalThis.ReadableStream == "function", Ut = typeof globalThis.FormData == "function", $e = ["get", "post", "put", "patch", "head", "delete"], xt = {
52
+ return t && !e;
53
+ })(), bt = typeof globalThis.AbortController == "function", Le = typeof globalThis.AbortSignal == "function" && typeof globalThis.AbortSignal.any == "function", Et = typeof globalThis.ReadableStream == "function", Tt = typeof globalThis.FormData == "function", Fe = ["get", "post", "put", "patch", "head", "delete"], St = {
54
54
  json: "application/json",
55
55
  text: "text/*",
56
56
  formData: "multipart/form-data",
@@ -59,14 +59,14 @@ const be = (() => {
59
59
  // Supported in modern Fetch implementations (for example, browsers and recent Node.js/undici).
60
60
  // We still feature-check at runtime before exposing the shortcut.
61
61
  bytes: "*/*"
62
- }, W = 2147483647, kt = new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length, ze = Symbol("stop");
63
- class Le {
62
+ }, Y = 2147483647, wt = new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length, _e = Symbol("stop");
63
+ class He {
64
64
  options;
65
- constructor(t) {
66
- this.options = t;
65
+ constructor(e) {
66
+ this.options = e;
67
67
  }
68
68
  }
69
- const Dt = (e) => new Le(e), Ot = {
69
+ const Rt = (t) => new He(t), Ct = {
70
70
  json: !0,
71
71
  parseJson: !0,
72
72
  stringifyJson: !0,
@@ -80,10 +80,10 @@ const Dt = (e) => new Le(e), Ot = {
80
80
  onUploadProgress: !0,
81
81
  fetch: !0,
82
82
  context: !0
83
- }, Nt = {
83
+ }, At = {
84
84
  next: !0
85
85
  // Next.js cache revalidation (revalidate, tags)
86
- }, Mt = {
86
+ }, Dt = {
87
87
  method: !0,
88
88
  headers: !0,
89
89
  body: !0,
@@ -98,94 +98,94 @@ const Dt = (e) => new Le(e), Ot = {
98
98
  signal: !0,
99
99
  window: !0,
100
100
  duplex: !0
101
- }, Bt = (e) => {
102
- if (!e)
101
+ }, Ut = (t) => {
102
+ if (!t)
103
103
  return 0;
104
- if (e instanceof FormData) {
105
- let t = 0;
106
- for (const [s, n] of e)
107
- t += kt, t += new TextEncoder().encode(`Content-Disposition: form-data; name="${s}"`).length, t += typeof n == "string" ? new TextEncoder().encode(n).length : n.size;
108
- return t;
104
+ if (t instanceof FormData) {
105
+ let e = 0;
106
+ for (const [s, n] of t)
107
+ e += wt, e += new TextEncoder().encode(`Content-Disposition: form-data; name="${s}"`).length, e += typeof n == "string" ? new TextEncoder().encode(n).length : n.size;
108
+ return e;
109
109
  }
110
- if (e instanceof Blob)
111
- return e.size;
112
- if (e instanceof ArrayBuffer)
113
- return e.byteLength;
114
- if (typeof e == "string")
115
- return new TextEncoder().encode(e).length;
116
- if (e instanceof URLSearchParams)
117
- return new TextEncoder().encode(e.toString()).length;
118
- if ("byteLength" in e)
119
- return e.byteLength;
120
- if (typeof e == "object" && e !== null)
110
+ if (t instanceof Blob)
111
+ return t.size;
112
+ if (t instanceof ArrayBuffer)
113
+ return t.byteLength;
114
+ if (typeof t == "string")
115
+ return new TextEncoder().encode(t).length;
116
+ if (t instanceof URLSearchParams)
117
+ return new TextEncoder().encode(t.toString()).length;
118
+ if ("byteLength" in t)
119
+ return t.byteLength;
120
+ if (typeof t == "object" && t !== null)
121
121
  try {
122
- const t = JSON.stringify(e);
123
- return new TextEncoder().encode(t).length;
122
+ const e = JSON.stringify(t);
123
+ return new TextEncoder().encode(e).length;
124
124
  } catch {
125
125
  return 0;
126
126
  }
127
127
  return 0;
128
- }, je = (e, t, s) => {
128
+ }, $e = (t, e, s) => {
129
129
  let n, r = 0;
130
- return e.pipeThrough(new TransformStream({
130
+ return t.pipeThrough(new TransformStream({
131
131
  transform(i, o) {
132
132
  if (o.enqueue(i), n) {
133
133
  r += n.byteLength;
134
- let a = t === 0 ? 0 : r / t;
135
- a >= 1 && (a = 1 - Number.EPSILON), s?.({ percent: a, totalBytes: Math.max(t, r), transferredBytes: r }, n);
134
+ let a = e === 0 ? 0 : r / e;
135
+ a >= 1 && (a = 1 - Number.EPSILON), s?.({ percent: a, totalBytes: Math.max(e, r), transferredBytes: r }, n);
136
136
  }
137
137
  n = i;
138
138
  },
139
139
  flush() {
140
- n && (r += n.byteLength, s?.({ percent: 1, totalBytes: Math.max(t, r), transferredBytes: r }, n));
140
+ n && (r += n.byteLength, s?.({ percent: 1, totalBytes: Math.max(e, r), transferredBytes: r }, n));
141
141
  }
142
142
  }));
143
- }, $t = (e, t) => {
144
- if (!e.body)
145
- return e;
146
- if (e.status === 204)
143
+ }, It = (t, e) => {
144
+ if (!t.body)
145
+ return t;
146
+ if (t.status === 204)
147
147
  return new Response(null, {
148
- status: e.status,
149
- statusText: e.statusText,
150
- headers: e.headers
148
+ status: t.status,
149
+ statusText: t.statusText,
150
+ headers: t.headers
151
151
  });
152
- const s = Math.max(0, Number(e.headers.get("content-length")) || 0);
153
- return new Response(je(e.body, s, t), {
154
- status: e.status,
155
- statusText: e.statusText,
156
- headers: e.headers
152
+ const s = Math.max(0, Number(t.headers.get("content-length")) || 0);
153
+ return new Response($e(t.body, s, e), {
154
+ status: t.status,
155
+ statusText: t.statusText,
156
+ headers: t.headers
157
157
  });
158
- }, zt = (e, t, s) => {
159
- if (!e.body)
160
- return e;
161
- const n = Bt(s ?? e.body);
162
- return new Request(e, {
158
+ }, Pt = (t, e, s) => {
159
+ if (!t.body)
160
+ return t;
161
+ const n = Ut(s ?? t.body);
162
+ return new Request(t, {
163
163
  // @ts-expect-error - Types are outdated.
164
164
  duplex: "half",
165
- body: je(e.body, n, t)
165
+ body: $e(t.body, n, e)
166
166
  });
167
- }, I = (e) => e !== null && typeof e == "object", B = (...e) => {
168
- for (const t of e)
169
- if ((!I(t) || Array.isArray(t)) && t !== void 0)
167
+ }, P = (t) => t !== null && typeof t == "object", F = (...t) => {
168
+ for (const e of t)
169
+ if ((!P(e) || Array.isArray(e)) && e !== void 0)
170
170
  throw new TypeError("The `options` argument must be an object");
171
- return oe({}, ...e);
172
- }, qe = (e = {}, t = {}) => {
173
- const s = new globalThis.Headers(e), n = t instanceof globalThis.Headers, r = new globalThis.Headers(t);
171
+ return ae({}, ...t);
172
+ }, ze = (t = {}, e = {}) => {
173
+ const s = new globalThis.Headers(t), n = e instanceof globalThis.Headers, r = new globalThis.Headers(e);
174
174
  for (const [i, o] of r.entries())
175
175
  n && o === "undefined" || o === void 0 ? s.delete(i) : s.set(i, o);
176
176
  return s;
177
177
  };
178
- function $(e, t, s) {
179
- return Object.hasOwn(t, s) && t[s] === void 0 ? [] : oe(e[s] ?? [], t[s] ?? []);
180
- }
181
- const _e = (e = {}, t = {}) => ({
182
- beforeRequest: $(e, t, "beforeRequest"),
183
- beforeRetry: $(e, t, "beforeRetry"),
184
- afterResponse: $(e, t, "afterResponse"),
185
- beforeError: $(e, t, "beforeError")
186
- }), Lt = (e, t) => {
178
+ function _(t, e, s) {
179
+ return Object.hasOwn(e, s) && e[s] === void 0 ? [] : ae(t[s] ?? [], e[s] ?? []);
180
+ }
181
+ const je = (t = {}, e = {}) => ({
182
+ beforeRequest: _(t, e, "beforeRequest"),
183
+ beforeRetry: _(t, e, "beforeRetry"),
184
+ afterResponse: _(t, e, "afterResponse"),
185
+ beforeError: _(t, e, "beforeError")
186
+ }), vt = (t, e) => {
187
187
  const s = new URLSearchParams();
188
- for (const n of [e, t])
188
+ for (const n of [t, e])
189
189
  if (n !== void 0)
190
190
  if (n instanceof URLSearchParams)
191
191
  for (const [r, i] of n.entries())
@@ -196,7 +196,7 @@ const _e = (e = {}, t = {}) => ({
196
196
  throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");
197
197
  s.append(String(r[0]), String(r[1]));
198
198
  }
199
- else if (I(n))
199
+ else if (P(n))
200
200
  for (const [r, i] of Object.entries(n))
201
201
  i !== void 0 && s.append(r, String(i));
202
202
  else {
@@ -205,150 +205,150 @@ const _e = (e = {}, t = {}) => ({
205
205
  s.append(i, o);
206
206
  }
207
207
  return s;
208
- }, oe = (...e) => {
209
- let t = {}, s = {}, n = {}, r;
208
+ }, ae = (...t) => {
209
+ let e = {}, s = {}, n = {}, r;
210
210
  const i = [];
211
- for (const o of e)
211
+ for (const o of t)
212
212
  if (Array.isArray(o))
213
- Array.isArray(t) || (t = []), t = [...t, ...o];
214
- else if (I(o)) {
215
- for (let [a, c] of Object.entries(o)) {
216
- if (a === "signal" && c instanceof globalThis.AbortSignal) {
217
- i.push(c);
213
+ Array.isArray(e) || (e = []), e = [...e, ...o];
214
+ else if (P(o)) {
215
+ for (let [a, u] of Object.entries(o)) {
216
+ if (a === "signal" && u instanceof globalThis.AbortSignal) {
217
+ i.push(u);
218
218
  continue;
219
219
  }
220
220
  if (a === "context") {
221
- if (c != null && (!I(c) || Array.isArray(c)))
221
+ if (u != null && (!P(u) || Array.isArray(u)))
222
222
  throw new TypeError("The `context` option must be an object");
223
- t = {
224
- ...t,
225
- context: c == null ? {} : { ...t.context, ...c }
223
+ e = {
224
+ ...e,
225
+ context: u == null ? {} : { ...e.context, ...u }
226
226
  };
227
227
  continue;
228
228
  }
229
229
  if (a === "searchParams") {
230
- c == null ? r = void 0 : r = r === void 0 ? c : Lt(r, c);
230
+ u == null ? r = void 0 : r = r === void 0 ? u : vt(r, u);
231
231
  continue;
232
232
  }
233
- I(c) && a in t && (c = oe(t[a], c)), t = { ...t, [a]: c };
233
+ P(u) && a in e && (u = ae(e[a], u)), e = { ...e, [a]: u };
234
234
  }
235
- I(o.hooks) && (n = _e(n, o.hooks), t.hooks = n), I(o.headers) && (s = qe(s, o.headers), t.headers = s);
235
+ P(o.hooks) && (n = je(n, o.hooks), e.hooks = n), P(o.headers) && (s = ze(s, o.headers), e.headers = s);
236
236
  }
237
- return r !== void 0 && (t.searchParams = r), i.length > 0 && (i.length === 1 ? t.signal = i[0] : Be ? t.signal = AbortSignal.any(i) : t.signal = i.at(-1)), t.context === void 0 && (t.context = {}), t;
238
- }, jt = (e) => $e.includes(e) ? e.toUpperCase() : e, qt = ["get", "put", "head", "delete", "options", "trace"], _t = [408, 413, 429, 500, 502, 503, 504], Ft = [413, 429, 503], Ee = {
237
+ return r !== void 0 && (e.searchParams = r), i.length > 0 && (i.length === 1 ? e.signal = i[0] : Le ? e.signal = AbortSignal.any(i) : e.signal = i.at(-1)), e.context === void 0 && (e.context = {}), e;
238
+ }, kt = (t) => Fe.includes(t) ? t.toUpperCase() : t, xt = ["get", "put", "head", "delete", "options", "trace"], Nt = [408, 413, 429, 500, 502, 503, 504], Ot = [413, 429, 503], we = {
239
239
  limit: 2,
240
- methods: qt,
241
- statusCodes: _t,
242
- afterStatusCodes: Ft,
240
+ methods: xt,
241
+ statusCodes: Nt,
242
+ afterStatusCodes: Ot,
243
243
  maxRetryAfter: Number.POSITIVE_INFINITY,
244
244
  backoffLimit: Number.POSITIVE_INFINITY,
245
- delay: (e) => 0.3 * 2 ** (e - 1) * 1e3,
245
+ delay: (t) => 0.3 * 2 ** (t - 1) * 1e3,
246
246
  jitter: void 0,
247
247
  retryOnTimeout: !1
248
- }, Ht = (e = {}) => {
249
- if (typeof e == "number")
248
+ }, Bt = (t = {}) => {
249
+ if (typeof t == "number")
250
250
  return {
251
- ...Ee,
252
- limit: e
251
+ ...we,
252
+ limit: t
253
253
  };
254
- if (e.methods && !Array.isArray(e.methods))
254
+ if (t.methods && !Array.isArray(t.methods))
255
255
  throw new Error("retry.methods must be an array");
256
- if (e.statusCodes && !Array.isArray(e.statusCodes))
256
+ if (t.statusCodes && !Array.isArray(t.statusCodes))
257
257
  throw new Error("retry.statusCodes must be an array");
258
258
  return {
259
- ...Ee,
260
- ...e
259
+ ...we,
260
+ ...t
261
261
  };
262
262
  };
263
- class Z extends Error {
263
+ class te extends Error {
264
264
  request;
265
- constructor(t) {
266
- super(`Request timed out: ${t.method} ${t.url}`), this.name = "TimeoutError", this.request = t;
265
+ constructor(e) {
266
+ super(`Request timed out: ${e.method} ${e.url}`), this.name = "TimeoutError", this.request = e;
267
267
  }
268
268
  }
269
- async function Kt(e, t, s, n) {
269
+ async function Mt(t, e, s, n) {
270
270
  return new Promise((r, i) => {
271
271
  const o = setTimeout(() => {
272
- s && s.abort(), i(new Z(e));
272
+ s && s.abort(), i(new te(t));
273
273
  }, n.timeout);
274
- n.fetch(e, t).then(r).catch(i).then(() => {
274
+ n.fetch(t, e).then(r).catch(i).then(() => {
275
275
  clearTimeout(o);
276
276
  });
277
277
  });
278
278
  }
279
- async function Wt(e, { signal: t }) {
279
+ async function Lt(t, { signal: e }) {
280
280
  return new Promise((s, n) => {
281
- t && (t.throwIfAborted(), t.addEventListener("abort", r, { once: !0 }));
281
+ e && (e.throwIfAborted(), e.addEventListener("abort", r, { once: !0 }));
282
282
  function r() {
283
- clearTimeout(i), n(t.reason);
283
+ clearTimeout(i), n(e.reason);
284
284
  }
285
285
  const i = setTimeout(() => {
286
- t?.removeEventListener("abort", r), s();
287
- }, e);
286
+ e?.removeEventListener("abort", r), s();
287
+ }, t);
288
288
  });
289
289
  }
290
- const Vt = (e, t) => {
290
+ const Ft = (t, e) => {
291
291
  const s = {};
292
- for (const n in t)
293
- Object.hasOwn(t, n) && !(n in Mt) && !(n in Ot) && (!(n in e) || n in Nt) && (s[n] = t[n]);
292
+ for (const n in e)
293
+ Object.hasOwn(e, n) && !(n in Dt) && !(n in Ct) && (!(n in t) || n in At) && (s[n] = e[n]);
294
294
  return s;
295
- }, Yt = (e) => e === void 0 ? !1 : Array.isArray(e) ? e.length > 0 : e instanceof URLSearchParams ? e.size > 0 : typeof e == "object" ? Object.keys(e).length > 0 : typeof e == "string" ? e.trim().length > 0 : !!e;
296
- function Xt(e) {
297
- return e instanceof G || e?.name === G.name;
298
- }
299
- function Jt(e) {
300
- return e instanceof Z || e?.name === Z.name;
301
- }
302
- class N {
303
- static create(t, s) {
304
- const n = new N(t, s), r = async () => {
305
- if (typeof n.#e.timeout == "number" && n.#e.timeout > W)
306
- throw new RangeError(`The \`timeout\` option cannot be greater than ${W}`);
295
+ }, _t = (t) => t === void 0 ? !1 : Array.isArray(t) ? t.length > 0 : t instanceof URLSearchParams ? t.size > 0 : typeof t == "object" ? Object.keys(t).length > 0 : typeof t == "string" ? t.trim().length > 0 : !!t;
296
+ function Ht(t) {
297
+ return t instanceof ee || t?.name === ee.name;
298
+ }
299
+ function $t(t) {
300
+ return t instanceof te || t?.name === te.name;
301
+ }
302
+ class M {
303
+ static create(e, s) {
304
+ const n = new M(e, s), r = async () => {
305
+ if (typeof n.#e.timeout == "number" && n.#e.timeout > Y)
306
+ throw new RangeError(`The \`timeout\` option cannot be greater than ${Y}`);
307
307
  await Promise.resolve();
308
- let o = await n.#g();
308
+ let o = await n.#m();
309
309
  for (const a of n.#e.hooks.afterResponse) {
310
- const c = n.#l(o.clone()), u = await a(n.request, n.#a(), c, { retryCount: n.#s });
311
- if (u instanceof globalThis.Response && (o = u), u instanceof Le)
310
+ const u = n.#l(o.clone()), l = await a(n.request, n.#a(), u, { retryCount: n.#s });
311
+ if (l instanceof globalThis.Response && (o = l), l instanceof He)
312
312
  throw await Promise.all([
313
- c.body?.cancel(),
313
+ u.body?.cancel(),
314
314
  o.body?.cancel()
315
- ]), new K(u.options);
315
+ ]), new V(l.options);
316
316
  }
317
317
  if (n.#l(o), !o.ok && (typeof n.#e.throwHttpErrors == "function" ? n.#e.throwHttpErrors(o.status) : n.#e.throwHttpErrors)) {
318
- let a = new G(o, n.request, n.#a());
319
- for (const c of n.#e.hooks.beforeError)
320
- a = await c(a, { retryCount: n.#s });
318
+ let a = new ee(o, n.request, n.#a());
319
+ for (const u of n.#e.hooks.beforeError)
320
+ a = await u(a, { retryCount: n.#s });
321
321
  throw a;
322
322
  }
323
323
  if (n.#e.onDownloadProgress) {
324
324
  if (typeof n.#e.onDownloadProgress != "function")
325
325
  throw new TypeError("The `onDownloadProgress` option must be a function");
326
- if (!Ct)
326
+ if (!Et)
327
327
  throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");
328
- return $t(o.clone(), n.#e.onDownloadProgress);
328
+ return It(o.clone(), n.#e.onDownloadProgress);
329
329
  }
330
330
  return o;
331
- }, i = n.#f(r).finally(async () => {
331
+ }, i = n.#d(r).finally(async () => {
332
332
  const o = n.#o, a = [];
333
333
  o && !o.bodyUsed && a.push(o.body?.cancel()), n.request.bodyUsed || a.push(n.request.body?.cancel()), await Promise.all(a);
334
334
  });
335
- for (const [o, a] of Object.entries(xt))
335
+ for (const [o, a] of Object.entries(St))
336
336
  o === "bytes" && typeof globalThis.Response?.prototype?.bytes != "function" || (i[o] = async () => {
337
337
  n.request.headers.set("accept", n.request.headers.get("accept") || a);
338
- const c = await i;
338
+ const u = await i;
339
339
  if (o === "json") {
340
- if (c.status === 204)
340
+ if (u.status === 204)
341
341
  return "";
342
- const u = await c.text();
343
- return u === "" ? "" : s.parseJson ? s.parseJson(u) : JSON.parse(u);
342
+ const l = await u.text();
343
+ return l === "" ? "" : s.parseJson ? s.parseJson(l) : JSON.parse(l);
344
344
  }
345
- return c[o]();
345
+ return u[o]();
346
346
  });
347
347
  return i;
348
348
  }
349
349
  // eslint-disable-next-line unicorn/prevent-abbreviations
350
- static #d(t) {
351
- return t && typeof t == "object" && !Array.isArray(t) && !(t instanceof URLSearchParams) ? Object.fromEntries(Object.entries(t).filter(([, s]) => s !== void 0)) : t;
350
+ static #h(e) {
351
+ return e && typeof e == "object" && !Array.isArray(e) && !(e instanceof URLSearchParams) ? Object.fromEntries(Object.entries(e).filter(([, s]) => s !== void 0)) : e;
352
352
  }
353
353
  request;
354
354
  #n;
@@ -360,20 +360,20 @@ class N {
360
360
  #r;
361
361
  #i;
362
362
  // eslint-disable-next-line complexity
363
- constructor(t, s = {}) {
364
- if (this.#t = t, this.#e = {
363
+ constructor(e, s = {}) {
364
+ if (this.#t = e, this.#e = {
365
365
  ...s,
366
- headers: qe(this.#t.headers, s.headers),
367
- hooks: _e({
366
+ headers: ze(this.#t.headers, s.headers),
367
+ hooks: je({
368
368
  beforeRequest: [],
369
369
  beforeRetry: [],
370
370
  beforeError: [],
371
371
  afterResponse: []
372
372
  }, s.hooks),
373
- method: jt(s.method ?? this.#t.method ?? "GET"),
373
+ method: kt(s.method ?? this.#t.method ?? "GET"),
374
374
  // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
375
375
  prefixUrl: String(s.prefixUrl || ""),
376
- retry: Ht(s.retry),
376
+ retry: Bt(s.retry),
377
377
  throwHttpErrors: s.throwHttpErrors ?? !0,
378
378
  timeout: s.timeout ?? 1e4,
379
379
  fetch: s.fetch ?? globalThis.fetch.bind(globalThis),
@@ -385,68 +385,68 @@ class N {
385
385
  throw new Error("`input` must not begin with a slash when using `prefixUrl`");
386
386
  this.#e.prefixUrl.endsWith("/") || (this.#e.prefixUrl += "/"), this.#t = this.#e.prefixUrl + this.#t;
387
387
  }
388
- It && Be && (this.#r = this.#e.signal ?? this.#t.signal, this.#n = new globalThis.AbortController(), this.#e.signal = this.#r ? AbortSignal.any([this.#r, this.#n.signal]) : this.#n.signal), be && (this.#e.duplex = "half"), this.#e.json !== void 0 && (this.#e.body = this.#e.stringifyJson?.(this.#e.json) ?? JSON.stringify(this.#e.json), this.#e.headers.set("content-type", this.#e.headers.get("content-type") ?? "application/json"));
388
+ bt && Le && (this.#r = this.#e.signal ?? this.#t.signal, this.#n = new globalThis.AbortController(), this.#e.signal = this.#r ? AbortSignal.any([this.#r, this.#n.signal]) : this.#n.signal), Se && (this.#e.duplex = "half"), this.#e.json !== void 0 && (this.#e.body = this.#e.stringifyJson?.(this.#e.json) ?? JSON.stringify(this.#e.json), this.#e.headers.set("content-type", this.#e.headers.get("content-type") ?? "application/json"));
389
389
  const n = s.headers && new globalThis.Headers(s.headers).has("content-type");
390
- if (this.#t instanceof globalThis.Request && (Ut && this.#e.body instanceof globalThis.FormData || this.#e.body instanceof URLSearchParams) && !n && this.#e.headers.delete("content-type"), this.request = new globalThis.Request(this.#t, this.#e), Yt(this.#e.searchParams)) {
391
- const i = "?" + (typeof this.#e.searchParams == "string" ? this.#e.searchParams.replace(/^\?/, "") : new URLSearchParams(N.#d(this.#e.searchParams)).toString()), o = this.request.url.replace(/(?:\?.*?)?(?=#|$)/, i);
390
+ if (this.#t instanceof globalThis.Request && (Tt && this.#e.body instanceof globalThis.FormData || this.#e.body instanceof URLSearchParams) && !n && this.#e.headers.delete("content-type"), this.request = new globalThis.Request(this.#t, this.#e), _t(this.#e.searchParams)) {
391
+ const i = "?" + (typeof this.#e.searchParams == "string" ? this.#e.searchParams.replace(/^\?/, "") : new URLSearchParams(M.#h(this.#e.searchParams)).toString()), o = this.request.url.replace(/(?:\?.*?)?(?=#|$)/, i);
392
392
  this.request = new globalThis.Request(o, this.#e);
393
393
  }
394
394
  if (this.#e.onUploadProgress) {
395
395
  if (typeof this.#e.onUploadProgress != "function")
396
396
  throw new TypeError("The `onUploadProgress` option must be a function");
397
- if (!be)
397
+ if (!Se)
398
398
  throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");
399
- this.request = this.#h(this.request, this.#e.body ?? void 0);
399
+ this.request = this.#f(this.request, this.#e.body ?? void 0);
400
400
  }
401
401
  }
402
402
  #c() {
403
- const t = this.#e.retry.delay(this.#s);
404
- let s = t;
405
- return this.#e.retry.jitter === !0 ? s = Math.random() * t : typeof this.#e.retry.jitter == "function" && (s = this.#e.retry.jitter(t), (!Number.isFinite(s) || s < 0) && (s = t)), Math.min(this.#e.retry.backoffLimit, s);
403
+ const e = this.#e.retry.delay(this.#s);
404
+ let s = e;
405
+ return this.#e.retry.jitter === !0 ? s = Math.random() * e : typeof this.#e.retry.jitter == "function" && (s = this.#e.retry.jitter(e), (!Number.isFinite(s) || s < 0) && (s = e)), Math.min(this.#e.retry.backoffLimit, s);
406
406
  }
407
- async #p(t) {
407
+ async #g(e) {
408
408
  if (this.#s++, this.#s > this.#e.retry.limit)
409
- throw t;
410
- const s = t instanceof Error ? t : new Me(t);
411
- if (s instanceof K)
409
+ throw e;
410
+ const s = e instanceof Error ? e : new Me(e);
411
+ if (s instanceof V)
412
412
  return s.customDelay ?? this.#c();
413
413
  if (!this.#e.retry.methods.includes(this.request.method.toLowerCase()))
414
- throw t;
414
+ throw e;
415
415
  if (this.#e.retry.shouldRetry !== void 0) {
416
416
  const n = await this.#e.retry.shouldRetry({ error: s, retryCount: this.#s });
417
417
  if (n === !1)
418
- throw t;
418
+ throw e;
419
419
  if (n === !0)
420
420
  return this.#c();
421
421
  }
422
- if (Jt(t) && !this.#e.retry.retryOnTimeout)
423
- throw t;
424
- if (Xt(t)) {
425
- if (!this.#e.retry.statusCodes.includes(t.response.status))
426
- throw t;
427
- const n = t.response.headers.get("Retry-After") ?? t.response.headers.get("RateLimit-Reset") ?? t.response.headers.get("X-RateLimit-Retry-After") ?? t.response.headers.get("X-RateLimit-Reset") ?? t.response.headers.get("X-Rate-Limit-Reset");
428
- if (n && this.#e.retry.afterStatusCodes.includes(t.response.status)) {
422
+ if ($t(e) && !this.#e.retry.retryOnTimeout)
423
+ throw e;
424
+ if (Ht(e)) {
425
+ if (!this.#e.retry.statusCodes.includes(e.response.status))
426
+ throw e;
427
+ const n = e.response.headers.get("Retry-After") ?? e.response.headers.get("RateLimit-Reset") ?? e.response.headers.get("X-RateLimit-Retry-After") ?? e.response.headers.get("X-RateLimit-Reset") ?? e.response.headers.get("X-Rate-Limit-Reset");
428
+ if (n && this.#e.retry.afterStatusCodes.includes(e.response.status)) {
429
429
  let r = Number(n) * 1e3;
430
430
  Number.isNaN(r) ? r = Date.parse(n) - Date.now() : r >= Date.parse("2024-01-01") && (r -= Date.now());
431
431
  const i = this.#e.retry.maxRetryAfter ?? r;
432
432
  return r < i ? r : i;
433
433
  }
434
- if (t.response.status === 413)
435
- throw t;
434
+ if (e.response.status === 413)
435
+ throw e;
436
436
  }
437
437
  return this.#c();
438
438
  }
439
- #l(t) {
440
- return this.#e.parseJson && (t.json = async () => this.#e.parseJson(await t.text())), t;
439
+ #l(e) {
440
+ return this.#e.parseJson && (e.json = async () => this.#e.parseJson(await e.text())), e;
441
441
  }
442
- async #f(t) {
442
+ async #d(e) {
443
443
  try {
444
- return await t();
444
+ return await e();
445
445
  } catch (s) {
446
- const n = Math.min(await this.#p(s), W);
446
+ const n = Math.min(await this.#g(s), Y);
447
447
  if (this.#s < 1)
448
448
  throw s;
449
- if (await Wt(n, this.#r ? { signal: this.#r } : {}), s instanceof K && s.customRequest) {
449
+ if (await Lt(n, this.#r ? { signal: this.#r } : {}), s instanceof V && s.customRequest) {
450
450
  const r = this.#e.signal ? new globalThis.Request(s.customRequest, { signal: this.#e.signal }) : new globalThis.Request(s.customRequest);
451
451
  this.#u(r);
452
452
  }
@@ -463,13 +463,13 @@ class N {
463
463
  }
464
464
  if (i instanceof globalThis.Response)
465
465
  return i;
466
- if (i === ze)
466
+ if (i === _e)
467
467
  return;
468
468
  }
469
- return this.#f(t);
469
+ return this.#d(e);
470
470
  }
471
471
  }
472
- async #g() {
472
+ async #m() {
473
473
  this.#n?.signal.aborted && (this.#n = new globalThis.AbortController(), this.#e.signal = this.#r ? AbortSignal.any([this.#r, this.#n.signal]) : this.#n.signal, this.request = new globalThis.Request(this.request, { signal: this.#e.signal }));
474
474
  for (const s of this.#e.hooks.beforeRequest) {
475
475
  const n = await s(this.request, this.#a(), { retryCount: this.#s });
@@ -480,113 +480,88 @@ class N {
480
480
  break;
481
481
  }
482
482
  }
483
- const t = Vt(this.request, this.#e);
484
- return this.#o = this.request, this.request = this.#o.clone(), this.#e.timeout === !1 ? this.#e.fetch(this.#o, t) : Kt(this.#o, t, this.#n, this.#e);
483
+ const e = Ft(this.request, this.#e);
484
+ return this.#o = this.request, this.request = this.#o.clone(), this.#e.timeout === !1 ? this.#e.fetch(this.#o, e) : Mt(this.#o, e, this.#n, this.#e);
485
485
  }
486
486
  #a() {
487
487
  if (!this.#i) {
488
- const { hooks: t, ...s } = this.#e;
488
+ const { hooks: e, ...s } = this.#e;
489
489
  this.#i = Object.freeze(s);
490
490
  }
491
491
  return this.#i;
492
492
  }
493
- #u(t) {
494
- this.#i = void 0, this.request = this.#h(t);
493
+ #u(e) {
494
+ this.#i = void 0, this.request = this.#f(e);
495
495
  }
496
- #h(t, s) {
497
- return !this.#e.onUploadProgress || !t.body ? t : zt(t, this.#e.onUploadProgress, s ?? this.#e.body ?? void 0);
496
+ #f(e, s) {
497
+ return !this.#e.onUploadProgress || !e.body ? e : Pt(e, this.#e.onUploadProgress, s ?? this.#e.body ?? void 0);
498
498
  }
499
499
  }
500
500
  /*! MIT License © Sindre Sorhus */
501
- const Q = (e) => {
502
- const t = (s, n) => N.create(s, B(e, n));
503
- for (const s of $e)
504
- t[s] = (n, r) => N.create(n, B(e, r, { method: s }));
505
- return t.create = (s) => Q(B(s)), t.extend = (s) => (typeof s == "function" && (s = s(e ?? {})), Q(B(e, s))), t.stop = ze, t.retry = Dt, t;
506
- }, Gt = Q();
507
- var S = /* @__PURE__ */ ((e) => (e.USDC = "USDC", e))(S || {});
508
- const Fe = {
509
- type: "evm",
510
- chainId: 42161,
511
- name: "Arbitrum",
512
- cctpDomain: 3,
513
- logoURI: "/images/chains/arbitrum.svg"
514
- }, He = {
515
- type: "evm",
516
- chainId: 421614,
517
- name: "Arbitrum Sepolia",
518
- cctpDomain: 3,
519
- logoURI: "/images/chains/arbitrum.svg"
520
- }, Ke = {
521
- type: "evm",
522
- chainId: 8453,
523
- name: "Base",
524
- cctpDomain: 6,
525
- logoURI: "/images/chains/base.webp"
526
- }, We = {
527
- type: "evm",
528
- chainId: 84532,
529
- name: "Base Sepolia",
530
- cctpDomain: 6,
531
- logoURI: "/images/chains/base.webp"
532
- }, Ve = {
533
- type: "evm",
534
- chainId: 56,
535
- name: "BNB Chain",
536
- cctpDomain: null,
537
- logoURI: "/images/chains/bsc.webp"
538
- }, Ye = {
539
- type: "evm",
540
- chainId: 1,
541
- name: "Ethereum",
542
- cctpDomain: 0,
543
- logoURI: "/images/chains/ethereum.svg"
544
- }, Xe = {
545
- type: "evm",
546
- chainId: 11155111,
547
- name: "Ethereum Sepolia",
548
- cctpDomain: 0,
549
- logoURI: "/images/chains/ethereum.svg"
550
- }, Je = {
551
- type: "evm",
552
- chainId: 43114,
553
- name: "Avalanche",
554
- cctpDomain: 1,
555
- logoURI: "/images/chains/avalanche.svg"
556
- }, Ge = {
557
- type: "evm",
558
- chainId: 43113,
559
- name: "Avalanche Fuji",
560
- cctpDomain: 1,
561
- logoURI: "/images/chains/avalanche.svg"
562
- }, Ze = {
563
- type: "starknet",
564
- chainId: "0x534e5f4d41494e",
565
- // SN_MAIN
566
- name: "Starknet",
567
- cctpDomain: null,
568
- logoURI: "/images/chains/starknet.svg"
501
+ const se = (t) => {
502
+ const e = (s, n) => M.create(s, F(t, n));
503
+ for (const s of Fe)
504
+ e[s] = (n, r) => M.create(n, F(t, r, { method: s }));
505
+ return e.create = (s) => se(F(s)), e.extend = (s) => (typeof s == "function" && (s = s(t ?? {})), se(F(t, s))), e.stop = _e, e.retry = Rt, e;
506
+ }, zt = se(), b = {
507
+ ARBITRUM: "ARBITRUM_MAINNET",
508
+ ARBITRUM_TESTNET: "ARBITRUM_TESTNET",
509
+ AVALANCHE: "AVALANCHE_MAINNET",
510
+ AVALANCHE_TESTNET: "AVALANCHE_TESTNET",
511
+ BASE: "BASE_MAINNET",
512
+ BASE_TESTNET: "BASE_TESTNET",
513
+ BSC: "BSC_MAINNET",
514
+ ETHEREUM: "ETHEREUM_MAINNET",
515
+ ETHEREUM_TESTNET: "ETHEREUM_TESTNET",
516
+ HYPEREVM: "HYPEREVM_MAINNET",
517
+ LISK: "LISK_MAINNET",
518
+ MONAD: "MONAD_MAINNET",
519
+ MONAD_TESTNET: "MONAD_TESTNET",
520
+ OPTIMISM: "OPTIMISM_MAINNET",
521
+ OPTIMISM_TESTNET: "OPTIMISM_TESTNET",
522
+ POLYGON: "POLYGON_MAINNET",
523
+ STARKNET: "STARKNET_MAINNET",
524
+ STARKNET_TESTNET: "STARKNET_TESTNET"
525
+ }, un = {
526
+ ARBITRUM: "ARBITRUM",
527
+ ARBITRUM_TESTNET: "ARBITRUM_TESTNET",
528
+ AVALANCHE: "AVALANCHE",
529
+ AVALANCHE_TESTNET: "AVALANCHE_TESTNET",
530
+ BASE: "BASE",
531
+ BASE_TESTNET: "BASE_TESTNET",
532
+ BSC: "BSC",
533
+ ETHEREUM: "ETHEREUM",
534
+ ETHEREUM_TESTNET: "ETHEREUM_TESTNET",
535
+ HYPEREVM: "HYPEREVM",
536
+ LISK: "LISK",
537
+ MONAD: "MONAD",
538
+ MONAD_TESTNET: "MONAD_TESTNET",
539
+ OPTIMISM: "OPTIMISM",
540
+ OPTIMISM_TESTNET: "OPTIMISM_TESTNET",
541
+ POLYGON: "POLYGON",
542
+ STARKNET: "STARKNET",
543
+ STARKNET_TESTNET: "STARKNET_TESTNET"
569
544
  };
570
- function ie(e, { strict: t = !0 } = {}) {
571
- return !e || typeof e != "string" ? !1 : t ? /^0x[0-9a-fA-F]*$/.test(e) : e.startsWith("0x");
545
+ function ce(t, { strict: e = !0 } = {}) {
546
+ return !t || typeof t != "string" ? !1 : e ? /^0x[0-9a-fA-F]*$/.test(t) : t.startsWith("0x");
572
547
  }
573
- function Se(e) {
574
- return ie(e, { strict: !1 }) ? Math.ceil((e.length - 2) / 2) : e.length;
548
+ function Re(t) {
549
+ return ce(t, { strict: !1 }) ? Math.ceil((t.length - 2) / 2) : t.length;
575
550
  }
576
- const Qe = "2.43.4";
577
- let V = {
578
- getDocsUrl: ({ docsBaseUrl: e, docsPath: t = "", docsSlug: s }) => t ? `${e ?? "https://viem.sh"}${t}${s ? `#${s}` : ""}` : void 0,
579
- version: `viem@${Qe}`
551
+ const qe = "2.43.4";
552
+ let G = {
553
+ getDocsUrl: ({ docsBaseUrl: t, docsPath: e = "", docsSlug: s }) => e ? `${t ?? "https://viem.sh"}${e}${s ? `#${s}` : ""}` : void 0,
554
+ version: `viem@${qe}`
580
555
  };
581
- class v extends Error {
582
- constructor(t, s = {}) {
583
- const n = s.cause instanceof v ? s.cause.details : s.cause?.message ? s.cause.message : s.details, r = s.cause instanceof v && s.cause.docsPath || s.docsPath, i = V.getDocsUrl?.({ ...s, docsPath: r }), o = [
584
- t || "An error occurred.",
556
+ class U extends Error {
557
+ constructor(e, s = {}) {
558
+ const n = s.cause instanceof U ? s.cause.details : s.cause?.message ? s.cause.message : s.details, r = s.cause instanceof U && s.cause.docsPath || s.docsPath, i = G.getDocsUrl?.({ ...s, docsPath: r }), o = [
559
+ e || "An error occurred.",
585
560
  "",
586
561
  ...s.metaMessages ? [...s.metaMessages, ""] : [],
587
562
  ...i ? [`Docs: ${i}`] : [],
588
563
  ...n ? [`Details: ${n}`] : [],
589
- ...V.version ? [`Version: ${V.version}`] : []
564
+ ...G.version ? [`Version: ${G.version}`] : []
590
565
  ].join(`
591
566
  `);
592
567
  super(o, s.cause ? { cause: s.cause } : void 0), Object.defineProperty(this, "details", {
@@ -619,95 +594,95 @@ class v extends Error {
619
594
  configurable: !0,
620
595
  writable: !0,
621
596
  value: "BaseError"
622
- }), this.details = n, this.docsPath = r, this.metaMessages = s.metaMessages, this.name = s.name ?? this.name, this.shortMessage = t, this.version = Qe;
597
+ }), this.details = n, this.docsPath = r, this.metaMessages = s.metaMessages, this.name = s.name ?? this.name, this.shortMessage = e, this.version = qe;
623
598
  }
624
- walk(t) {
625
- return et(this, t);
599
+ walk(e) {
600
+ return Ke(this, e);
626
601
  }
627
602
  }
628
- function et(e, t) {
629
- return t?.(e) ? e : e && typeof e == "object" && "cause" in e && e.cause !== void 0 ? et(e.cause, t) : t ? null : e;
603
+ function Ke(t, e) {
604
+ return e?.(t) ? t : t && typeof t == "object" && "cause" in t && t.cause !== void 0 ? Ke(t.cause, e) : e ? null : t;
630
605
  }
631
- class tt extends v {
632
- constructor({ size: t, targetSize: s, type: n }) {
633
- super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${t}) exceeds padding size (${s}).`, { name: "SizeExceedsPaddingSizeError" });
606
+ class We extends U {
607
+ constructor({ size: e, targetSize: s, type: n }) {
608
+ super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${e}) exceeds padding size (${s}).`, { name: "SizeExceedsPaddingSizeError" });
634
609
  }
635
610
  }
636
- function F(e, { dir: t, size: s = 32 } = {}) {
637
- return typeof e == "string" ? Zt(e, { dir: t, size: s }) : Qt(e, { dir: t, size: s });
611
+ function K(t, { dir: e, size: s = 32 } = {}) {
612
+ return typeof t == "string" ? jt(t, { dir: e, size: s }) : qt(t, { dir: e, size: s });
638
613
  }
639
- function Zt(e, { dir: t, size: s = 32 } = {}) {
614
+ function jt(t, { dir: e, size: s = 32 } = {}) {
640
615
  if (s === null)
641
- return e;
642
- const n = e.replace("0x", "");
616
+ return t;
617
+ const n = t.replace("0x", "");
643
618
  if (n.length > s * 2)
644
- throw new tt({
619
+ throw new We({
645
620
  size: Math.ceil(n.length / 2),
646
621
  targetSize: s,
647
622
  type: "hex"
648
623
  });
649
- return `0x${n[t === "right" ? "padEnd" : "padStart"](s * 2, "0")}`;
624
+ return `0x${n[e === "right" ? "padEnd" : "padStart"](s * 2, "0")}`;
650
625
  }
651
- function Qt(e, { dir: t, size: s = 32 } = {}) {
626
+ function qt(t, { dir: e, size: s = 32 } = {}) {
652
627
  if (s === null)
653
- return e;
654
- if (e.length > s)
655
- throw new tt({
656
- size: e.length,
628
+ return t;
629
+ if (t.length > s)
630
+ throw new We({
631
+ size: t.length,
657
632
  targetSize: s,
658
633
  type: "bytes"
659
634
  });
660
635
  const n = new Uint8Array(s);
661
636
  for (let r = 0; r < s; r++) {
662
- const i = t === "right";
663
- n[i ? r : s - r - 1] = e[i ? r : e.length - r - 1];
637
+ const i = e === "right";
638
+ n[i ? r : s - r - 1] = t[i ? r : t.length - r - 1];
664
639
  }
665
640
  return n;
666
641
  }
667
- class es extends v {
668
- constructor({ max: t, min: s, signed: n, size: r, value: i }) {
669
- super(`Number "${i}" is not in safe ${r ? `${r * 8}-bit ${n ? "signed" : "unsigned"} ` : ""}integer range ${t ? `(${s} to ${t})` : `(above ${s})`}`, { name: "IntegerOutOfRangeError" });
642
+ class Kt extends U {
643
+ constructor({ max: e, min: s, signed: n, size: r, value: i }) {
644
+ super(`Number "${i}" is not in safe ${r ? `${r * 8}-bit ${n ? "signed" : "unsigned"} ` : ""}integer range ${e ? `(${s} to ${e})` : `(above ${s})`}`, { name: "IntegerOutOfRangeError" });
670
645
  }
671
646
  }
672
- class ts extends v {
673
- constructor({ givenSize: t, maxSize: s }) {
674
- super(`Size cannot exceed ${s} bytes. Given size: ${t} bytes.`, { name: "SizeOverflowError" });
647
+ class Wt extends U {
648
+ constructor({ givenSize: e, maxSize: s }) {
649
+ super(`Size cannot exceed ${s} bytes. Given size: ${e} bytes.`, { name: "SizeOverflowError" });
675
650
  }
676
651
  }
677
- function ae(e, { size: t }) {
678
- if (Se(e) > t)
679
- throw new ts({
680
- givenSize: Se(e),
681
- maxSize: t
652
+ function ue(t, { size: e }) {
653
+ if (Re(t) > e)
654
+ throw new Wt({
655
+ givenSize: Re(t),
656
+ maxSize: e
682
657
  });
683
658
  }
684
- function ss(e, t = {}) {
685
- const { signed: s, size: n } = t, r = BigInt(e);
659
+ function Vt(t, e = {}) {
660
+ const { signed: s, size: n } = e, r = BigInt(t);
686
661
  let i;
687
- n ? s ? i = (1n << BigInt(n) * 8n - 1n) - 1n : i = 2n ** (BigInt(n) * 8n) - 1n : typeof e == "number" && (i = BigInt(Number.MAX_SAFE_INTEGER));
662
+ n ? s ? i = (1n << BigInt(n) * 8n - 1n) - 1n : i = 2n ** (BigInt(n) * 8n) - 1n : typeof t == "number" && (i = BigInt(Number.MAX_SAFE_INTEGER));
688
663
  const o = typeof i == "bigint" && s ? -i - 1n : 0;
689
664
  if (i && r > i || r < o) {
690
- const c = typeof e == "bigint" ? "n" : "";
691
- throw new es({
692
- max: i ? `${i}${c}` : void 0,
693
- min: `${o}${c}`,
665
+ const u = typeof t == "bigint" ? "n" : "";
666
+ throw new Kt({
667
+ max: i ? `${i}${u}` : void 0,
668
+ min: `${o}${u}`,
694
669
  signed: s,
695
670
  size: n,
696
- value: `${e}${c}`
671
+ value: `${t}${u}`
697
672
  });
698
673
  }
699
674
  const a = `0x${(s && r < 0 ? (1n << BigInt(n * 8)) + BigInt(r) : r).toString(16)}`;
700
- return n ? F(a, { size: n }) : a;
675
+ return n ? K(a, { size: n }) : a;
701
676
  }
702
- const ns = /* @__PURE__ */ new TextEncoder();
703
- function rs(e, t = {}) {
704
- return typeof e == "number" || typeof e == "bigint" ? is(e, t) : typeof e == "boolean" ? os(e, t) : ie(e) ? st(e, t) : nt(e, t);
677
+ const Yt = /* @__PURE__ */ new TextEncoder();
678
+ function Gt(t, e = {}) {
679
+ return typeof t == "number" || typeof t == "bigint" ? Jt(t, e) : typeof t == "boolean" ? Xt(t, e) : ce(t) ? Ve(t, e) : Ye(t, e);
705
680
  }
706
- function os(e, t = {}) {
681
+ function Xt(t, e = {}) {
707
682
  const s = new Uint8Array(1);
708
- return s[0] = Number(e), typeof t.size == "number" ? (ae(s, { size: t.size }), F(s, { size: t.size })) : s;
683
+ return s[0] = Number(t), typeof e.size == "number" ? (ue(s, { size: e.size }), K(s, { size: e.size })) : s;
709
684
  }
710
- const T = {
685
+ const A = {
711
686
  zero: 48,
712
687
  nine: 57,
713
688
  A: 65,
@@ -715,161 +690,161 @@ const T = {
715
690
  a: 97,
716
691
  f: 102
717
692
  };
718
- function Te(e) {
719
- if (e >= T.zero && e <= T.nine)
720
- return e - T.zero;
721
- if (e >= T.A && e <= T.F)
722
- return e - (T.A - 10);
723
- if (e >= T.a && e <= T.f)
724
- return e - (T.a - 10);
725
- }
726
- function st(e, t = {}) {
727
- let s = e;
728
- t.size && (ae(s, { size: t.size }), s = F(s, { dir: "right", size: t.size }));
693
+ function Ce(t) {
694
+ if (t >= A.zero && t <= A.nine)
695
+ return t - A.zero;
696
+ if (t >= A.A && t <= A.F)
697
+ return t - (A.A - 10);
698
+ if (t >= A.a && t <= A.f)
699
+ return t - (A.a - 10);
700
+ }
701
+ function Ve(t, e = {}) {
702
+ let s = t;
703
+ e.size && (ue(s, { size: e.size }), s = K(s, { dir: "right", size: e.size }));
729
704
  let n = s.slice(2);
730
705
  n.length % 2 && (n = `0${n}`);
731
706
  const r = n.length / 2, i = new Uint8Array(r);
732
707
  for (let o = 0, a = 0; o < r; o++) {
733
- const c = Te(n.charCodeAt(a++)), u = Te(n.charCodeAt(a++));
734
- if (c === void 0 || u === void 0)
735
- throw new v(`Invalid byte sequence ("${n[a - 2]}${n[a - 1]}" in "${n}").`);
736
- i[o] = c * 16 + u;
708
+ const u = Ce(n.charCodeAt(a++)), l = Ce(n.charCodeAt(a++));
709
+ if (u === void 0 || l === void 0)
710
+ throw new U(`Invalid byte sequence ("${n[a - 2]}${n[a - 1]}" in "${n}").`);
711
+ i[o] = u * 16 + l;
737
712
  }
738
713
  return i;
739
714
  }
740
- function is(e, t) {
741
- const s = ss(e, t);
742
- return st(s);
715
+ function Jt(t, e) {
716
+ const s = Vt(t, e);
717
+ return Ve(s);
743
718
  }
744
- function nt(e, t = {}) {
745
- const s = ns.encode(e);
746
- return typeof t.size == "number" ? (ae(s, { size: t.size }), F(s, { dir: "right", size: t.size })) : s;
719
+ function Ye(t, e = {}) {
720
+ const s = Yt.encode(t);
721
+ return typeof e.size == "number" ? (ue(s, { size: e.size }), K(s, { dir: "right", size: e.size })) : s;
747
722
  }
748
- const z = /* @__PURE__ */ BigInt(2 ** 32 - 1), Re = /* @__PURE__ */ BigInt(32);
749
- function as(e, t = !1) {
750
- return t ? { h: Number(e & z), l: Number(e >> Re & z) } : { h: Number(e >> Re & z) | 0, l: Number(e & z) | 0 };
723
+ const H = /* @__PURE__ */ BigInt(2 ** 32 - 1), Ae = /* @__PURE__ */ BigInt(32);
724
+ function Zt(t, e = !1) {
725
+ return e ? { h: Number(t & H), l: Number(t >> Ae & H) } : { h: Number(t >> Ae & H) | 0, l: Number(t & H) | 0 };
751
726
  }
752
- function cs(e, t = !1) {
753
- const s = e.length;
727
+ function Qt(t, e = !1) {
728
+ const s = t.length;
754
729
  let n = new Uint32Array(s), r = new Uint32Array(s);
755
730
  for (let i = 0; i < s; i++) {
756
- const { h: o, l: a } = as(e[i], t);
731
+ const { h: o, l: a } = Zt(t[i], e);
757
732
  [n[i], r[i]] = [o, a];
758
733
  }
759
734
  return [n, r];
760
735
  }
761
- const us = (e, t, s) => e << s | t >>> 32 - s, ls = (e, t, s) => t << s | e >>> 32 - s, fs = (e, t, s) => t << s - 32 | e >>> 64 - s, hs = (e, t, s) => e << s - 32 | t >>> 64 - s;
736
+ const es = (t, e, s) => t << s | e >>> 32 - s, ts = (t, e, s) => e << s | t >>> 32 - s, ss = (t, e, s) => e << s - 32 | t >>> 64 - s, ns = (t, e, s) => t << s - 32 | e >>> 64 - s;
762
737
  /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
763
- function ds(e) {
764
- return e instanceof Uint8Array || ArrayBuffer.isView(e) && e.constructor.name === "Uint8Array";
738
+ function rs(t) {
739
+ return t instanceof Uint8Array || ArrayBuffer.isView(t) && t.constructor.name === "Uint8Array";
765
740
  }
766
- function Ae(e) {
767
- if (!Number.isSafeInteger(e) || e < 0)
768
- throw new Error("positive integer expected, got " + e);
741
+ function De(t) {
742
+ if (!Number.isSafeInteger(t) || t < 0)
743
+ throw new Error("positive integer expected, got " + t);
769
744
  }
770
- function L(e, ...t) {
771
- if (!ds(e))
745
+ function $(t, ...e) {
746
+ if (!rs(t))
772
747
  throw new Error("Uint8Array expected");
773
- if (t.length > 0 && !t.includes(e.length))
774
- throw new Error("Uint8Array expected of length " + t + ", got length=" + e.length);
748
+ if (e.length > 0 && !e.includes(t.length))
749
+ throw new Error("Uint8Array expected of length " + e + ", got length=" + t.length);
775
750
  }
776
- function ve(e, t = !0) {
777
- if (e.destroyed)
751
+ function Ue(t, e = !0) {
752
+ if (t.destroyed)
778
753
  throw new Error("Hash instance has been destroyed");
779
- if (t && e.finished)
754
+ if (e && t.finished)
780
755
  throw new Error("Hash#digest() has already been called");
781
756
  }
782
- function ps(e, t) {
783
- L(e);
784
- const s = t.outputLen;
785
- if (e.length < s)
757
+ function os(t, e) {
758
+ $(t);
759
+ const s = e.outputLen;
760
+ if (t.length < s)
786
761
  throw new Error("digestInto() expects output buffer of length at least " + s);
787
762
  }
788
- function gs(e) {
789
- return new Uint32Array(e.buffer, e.byteOffset, Math.floor(e.byteLength / 4));
763
+ function is(t) {
764
+ return new Uint32Array(t.buffer, t.byteOffset, Math.floor(t.byteLength / 4));
790
765
  }
791
- function rt(...e) {
792
- for (let t = 0; t < e.length; t++)
793
- e[t].fill(0);
766
+ function Ge(...t) {
767
+ for (let e = 0; e < t.length; e++)
768
+ t[e].fill(0);
794
769
  }
795
- const ms = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
796
- function ys(e) {
797
- return e << 24 & 4278190080 | e << 8 & 16711680 | e >>> 8 & 65280 | e >>> 24 & 255;
770
+ const as = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
771
+ function cs(t) {
772
+ return t << 24 & 4278190080 | t << 8 & 16711680 | t >>> 8 & 65280 | t >>> 24 & 255;
798
773
  }
799
- function ws(e) {
800
- for (let t = 0; t < e.length; t++)
801
- e[t] = ys(e[t]);
802
- return e;
774
+ function us(t) {
775
+ for (let e = 0; e < t.length; e++)
776
+ t[e] = cs(t[e]);
777
+ return t;
803
778
  }
804
- const Pe = ms ? (e) => e : ws;
805
- function bs(e) {
806
- if (typeof e != "string")
779
+ const Ie = as ? (t) => t : us;
780
+ function ls(t) {
781
+ if (typeof t != "string")
807
782
  throw new Error("string expected");
808
- return new Uint8Array(new TextEncoder().encode(e));
783
+ return new Uint8Array(new TextEncoder().encode(t));
809
784
  }
810
- function ot(e) {
811
- return typeof e == "string" && (e = bs(e)), L(e), e;
785
+ function Xe(t) {
786
+ return typeof t == "string" && (t = ls(t)), $(t), t;
812
787
  }
813
- class Es {
788
+ class ds {
814
789
  }
815
- function Ss(e) {
816
- const t = (n) => e().update(ot(n)).digest(), s = e();
817
- return t.outputLen = s.outputLen, t.blockLen = s.blockLen, t.create = () => e(), t;
790
+ function fs(t) {
791
+ const e = (n) => t().update(Xe(n)).digest(), s = t();
792
+ return e.outputLen = s.outputLen, e.blockLen = s.blockLen, e.create = () => t(), e;
818
793
  }
819
- const Ts = BigInt(0), k = BigInt(1), Rs = BigInt(2), As = BigInt(7), vs = BigInt(256), Ps = BigInt(113), it = [], at = [], ct = [];
820
- for (let e = 0, t = k, s = 1, n = 0; e < 24; e++) {
821
- [s, n] = [n, (2 * s + 3 * n) % 5], it.push(2 * (5 * n + s)), at.push((e + 1) * (e + 2) / 2 % 64);
822
- let r = Ts;
794
+ const hs = BigInt(0), N = BigInt(1), gs = BigInt(2), ms = BigInt(7), ps = BigInt(256), ys = BigInt(113), Je = [], Ze = [], Qe = [];
795
+ for (let t = 0, e = N, s = 1, n = 0; t < 24; t++) {
796
+ [s, n] = [n, (2 * s + 3 * n) % 5], Je.push(2 * (5 * n + s)), Ze.push((t + 1) * (t + 2) / 2 % 64);
797
+ let r = hs;
823
798
  for (let i = 0; i < 7; i++)
824
- t = (t << k ^ (t >> As) * Ps) % vs, t & Rs && (r ^= k << (k << /* @__PURE__ */ BigInt(i)) - k);
825
- ct.push(r);
799
+ e = (e << N ^ (e >> ms) * ys) % ps, e & gs && (r ^= N << (N << /* @__PURE__ */ BigInt(i)) - N);
800
+ Qe.push(r);
826
801
  }
827
- const ut = cs(ct, !0), Is = ut[0], Cs = ut[1], Ie = (e, t, s) => s > 32 ? fs(e, t, s) : us(e, t, s), Ce = (e, t, s) => s > 32 ? hs(e, t, s) : ls(e, t, s);
828
- function Us(e, t = 24) {
802
+ const et = Qt(Qe, !0), bs = et[0], Es = et[1], Pe = (t, e, s) => s > 32 ? ss(t, e, s) : es(t, e, s), ve = (t, e, s) => s > 32 ? ns(t, e, s) : ts(t, e, s);
803
+ function Ts(t, e = 24) {
829
804
  const s = new Uint32Array(10);
830
- for (let n = 24 - t; n < 24; n++) {
805
+ for (let n = 24 - e; n < 24; n++) {
831
806
  for (let o = 0; o < 10; o++)
832
- s[o] = e[o] ^ e[o + 10] ^ e[o + 20] ^ e[o + 30] ^ e[o + 40];
807
+ s[o] = t[o] ^ t[o + 10] ^ t[o + 20] ^ t[o + 30] ^ t[o + 40];
833
808
  for (let o = 0; o < 10; o += 2) {
834
- const a = (o + 8) % 10, c = (o + 2) % 10, u = s[c], l = s[c + 1], w = Ie(u, l, 1) ^ s[a], p = Ce(u, l, 1) ^ s[a + 1];
835
- for (let m = 0; m < 50; m += 10)
836
- e[o + m] ^= w, e[o + m + 1] ^= p;
809
+ const a = (o + 8) % 10, u = (o + 2) % 10, l = s[u], d = s[u + 1], T = Pe(l, d, 1) ^ s[a], m = ve(l, d, 1) ^ s[a + 1];
810
+ for (let y = 0; y < 50; y += 10)
811
+ t[o + y] ^= T, t[o + y + 1] ^= m;
837
812
  }
838
- let r = e[2], i = e[3];
813
+ let r = t[2], i = t[3];
839
814
  for (let o = 0; o < 24; o++) {
840
- const a = at[o], c = Ie(r, i, a), u = Ce(r, i, a), l = it[o];
841
- r = e[l], i = e[l + 1], e[l] = c, e[l + 1] = u;
815
+ const a = Ze[o], u = Pe(r, i, a), l = ve(r, i, a), d = Je[o];
816
+ r = t[d], i = t[d + 1], t[d] = u, t[d + 1] = l;
842
817
  }
843
818
  for (let o = 0; o < 50; o += 10) {
844
819
  for (let a = 0; a < 10; a++)
845
- s[a] = e[o + a];
820
+ s[a] = t[o + a];
846
821
  for (let a = 0; a < 10; a++)
847
- e[o + a] ^= ~s[(a + 2) % 10] & s[(a + 4) % 10];
822
+ t[o + a] ^= ~s[(a + 2) % 10] & s[(a + 4) % 10];
848
823
  }
849
- e[0] ^= Is[n], e[1] ^= Cs[n];
824
+ t[0] ^= bs[n], t[1] ^= Es[n];
850
825
  }
851
- rt(s);
826
+ Ge(s);
852
827
  }
853
- class ce extends Es {
828
+ class le extends ds {
854
829
  // NOTE: we accept arguments in bytes instead of bits here.
855
- constructor(t, s, n, r = !1, i = 24) {
856
- if (super(), this.pos = 0, this.posOut = 0, this.finished = !1, this.destroyed = !1, this.enableXOF = !1, this.blockLen = t, this.suffix = s, this.outputLen = n, this.enableXOF = r, this.rounds = i, Ae(n), !(0 < t && t < 200))
830
+ constructor(e, s, n, r = !1, i = 24) {
831
+ if (super(), this.pos = 0, this.posOut = 0, this.finished = !1, this.destroyed = !1, this.enableXOF = !1, this.blockLen = e, this.suffix = s, this.outputLen = n, this.enableXOF = r, this.rounds = i, De(n), !(0 < e && e < 200))
857
832
  throw new Error("only keccak-f1600 function is supported");
858
- this.state = new Uint8Array(200), this.state32 = gs(this.state);
833
+ this.state = new Uint8Array(200), this.state32 = is(this.state);
859
834
  }
860
835
  clone() {
861
836
  return this._cloneInto();
862
837
  }
863
838
  keccak() {
864
- Pe(this.state32), Us(this.state32, this.rounds), Pe(this.state32), this.posOut = 0, this.pos = 0;
839
+ Ie(this.state32), Ts(this.state32, this.rounds), Ie(this.state32), this.posOut = 0, this.pos = 0;
865
840
  }
866
- update(t) {
867
- ve(this), t = ot(t), L(t);
868
- const { blockLen: s, state: n } = this, r = t.length;
841
+ update(e) {
842
+ Ue(this), e = Xe(e), $(e);
843
+ const { blockLen: s, state: n } = this, r = e.length;
869
844
  for (let i = 0; i < r; ) {
870
845
  const o = Math.min(s - this.pos, r - i);
871
846
  for (let a = 0; a < o; a++)
872
- n[this.pos++] ^= t[i++];
847
+ n[this.pos++] ^= e[i++];
873
848
  this.pos === s && this.keccak();
874
849
  }
875
850
  return this;
@@ -878,50 +853,50 @@ class ce extends Es {
878
853
  if (this.finished)
879
854
  return;
880
855
  this.finished = !0;
881
- const { state: t, suffix: s, pos: n, blockLen: r } = this;
882
- t[n] ^= s, (s & 128) !== 0 && n === r - 1 && this.keccak(), t[r - 1] ^= 128, this.keccak();
856
+ const { state: e, suffix: s, pos: n, blockLen: r } = this;
857
+ e[n] ^= s, (s & 128) !== 0 && n === r - 1 && this.keccak(), e[r - 1] ^= 128, this.keccak();
883
858
  }
884
- writeInto(t) {
885
- ve(this, !1), L(t), this.finish();
859
+ writeInto(e) {
860
+ Ue(this, !1), $(e), this.finish();
886
861
  const s = this.state, { blockLen: n } = this;
887
- for (let r = 0, i = t.length; r < i; ) {
862
+ for (let r = 0, i = e.length; r < i; ) {
888
863
  this.posOut >= n && this.keccak();
889
864
  const o = Math.min(n - this.posOut, i - r);
890
- t.set(s.subarray(this.posOut, this.posOut + o), r), this.posOut += o, r += o;
865
+ e.set(s.subarray(this.posOut, this.posOut + o), r), this.posOut += o, r += o;
891
866
  }
892
- return t;
867
+ return e;
893
868
  }
894
- xofInto(t) {
869
+ xofInto(e) {
895
870
  if (!this.enableXOF)
896
871
  throw new Error("XOF is not possible for this instance");
897
- return this.writeInto(t);
872
+ return this.writeInto(e);
898
873
  }
899
- xof(t) {
900
- return Ae(t), this.xofInto(new Uint8Array(t));
874
+ xof(e) {
875
+ return De(e), this.xofInto(new Uint8Array(e));
901
876
  }
902
- digestInto(t) {
903
- if (ps(t, this), this.finished)
877
+ digestInto(e) {
878
+ if (os(e, this), this.finished)
904
879
  throw new Error("digest() was already called");
905
- return this.writeInto(t), this.destroy(), t;
880
+ return this.writeInto(e), this.destroy(), e;
906
881
  }
907
882
  digest() {
908
883
  return this.digestInto(new Uint8Array(this.outputLen));
909
884
  }
910
885
  destroy() {
911
- this.destroyed = !0, rt(this.state);
886
+ this.destroyed = !0, Ge(this.state);
912
887
  }
913
- _cloneInto(t) {
888
+ _cloneInto(e) {
914
889
  const { blockLen: s, suffix: n, outputLen: r, rounds: i, enableXOF: o } = this;
915
- return t || (t = new ce(s, n, r, o, i)), t.state32.set(this.state32), t.pos = this.pos, t.posOut = this.posOut, t.finished = this.finished, t.rounds = i, t.suffix = n, t.outputLen = r, t.enableXOF = o, t.destroyed = this.destroyed, t;
890
+ return e || (e = new le(s, n, r, o, i)), e.state32.set(this.state32), e.pos = this.pos, e.posOut = this.posOut, e.finished = this.finished, e.rounds = i, e.suffix = n, e.outputLen = r, e.enableXOF = o, e.destroyed = this.destroyed, e;
916
891
  }
917
892
  }
918
- const xs = (e, t, s) => Ss(() => new ce(t, e, s)), ks = xs(1, 136, 256 / 8);
919
- function Ds(e, t) {
920
- return ks(ie(e, { strict: !1 }) ? rs(e) : e);
893
+ const Ss = (t, e, s) => fs(() => new le(e, t, s)), ws = Ss(1, 136, 256 / 8);
894
+ function Rs(t, e) {
895
+ return ws(ce(t, { strict: !1 }) ? Gt(t) : t);
921
896
  }
922
- class Os extends v {
923
- constructor({ address: t }) {
924
- super(`Address "${t}" is invalid.`, {
897
+ class Cs extends U {
898
+ constructor({ address: e }) {
899
+ super(`Address "${e}" is invalid.`, {
925
900
  metaMessages: [
926
901
  "- Address must be a hex value of 20 bytes (40 hex characters).",
927
902
  "- Address must match its checksum counterpart."
@@ -930,244 +905,612 @@ class Os extends v {
930
905
  });
931
906
  }
932
907
  }
933
- class lt extends Map {
934
- constructor(t) {
908
+ class tt extends Map {
909
+ constructor(e) {
935
910
  super(), Object.defineProperty(this, "maxSize", {
936
911
  enumerable: !0,
937
912
  configurable: !0,
938
913
  writable: !0,
939
914
  value: void 0
940
- }), this.maxSize = t;
915
+ }), this.maxSize = e;
941
916
  }
942
- get(t) {
943
- const s = super.get(t);
944
- return super.has(t) && s !== void 0 && (this.delete(t), super.set(t, s)), s;
917
+ get(e) {
918
+ const s = super.get(e);
919
+ return super.has(e) && s !== void 0 && (this.delete(e), super.set(e, s)), s;
945
920
  }
946
- set(t, s) {
947
- if (super.set(t, s), this.maxSize && this.size > this.maxSize) {
921
+ set(e, s) {
922
+ if (super.set(e, s), this.maxSize && this.size > this.maxSize) {
948
923
  const n = this.keys().next().value;
949
924
  n && this.delete(n);
950
925
  }
951
926
  return this;
952
927
  }
953
928
  }
954
- const Y = /* @__PURE__ */ new lt(8192);
955
- function ft(e, t) {
956
- if (Y.has(`${e}.${t}`))
957
- return Y.get(`${e}.${t}`);
958
- const s = e.substring(2).toLowerCase(), n = Ds(nt(s)), r = s.split("");
929
+ const X = /* @__PURE__ */ new tt(8192);
930
+ function st(t, e) {
931
+ if (X.has(`${t}.${e}`))
932
+ return X.get(`${t}.${e}`);
933
+ const s = t.substring(2).toLowerCase(), n = Rs(Ye(s)), r = s.split("");
959
934
  for (let o = 0; o < 40; o += 2)
960
935
  n[o >> 1] >> 4 >= 8 && r[o] && (r[o] = r[o].toUpperCase()), (n[o >> 1] & 15) >= 8 && r[o + 1] && (r[o + 1] = r[o + 1].toUpperCase());
961
936
  const i = `0x${r.join("")}`;
962
- return Y.set(`${e}.${t}`, i), i;
963
- }
964
- function R(e, t) {
965
- if (!Ms(e, { strict: !1 }))
966
- throw new Os({ address: e });
967
- return ft(e, t);
968
- }
969
- const Ns = /^0x[a-fA-F0-9]{40}$/, X = /* @__PURE__ */ new lt(8192);
970
- function Ms(e, t) {
971
- const { strict: s = !0 } = t ?? {}, n = `${e}.${s}`;
972
- if (X.has(n))
973
- return X.get(n);
974
- const r = Ns.test(e) ? e.toLowerCase() === e ? !0 : s ? ft(e) === e : !0 : !1;
975
- return X.set(n, r), r;
976
- }
977
- const Bs = {
978
- chainId: He.chainId,
979
- address: R("0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d"),
980
- symbol: "USDC",
981
- fiatISO: "USD",
982
- decimals: 6,
983
- logoURI: "https://pay.daimo.com/coin-logos/usdc.png",
984
- logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
985
- }, $s = {
986
- chainId: Fe.chainId,
987
- address: R("0xaf88d065e77c8cC2239327C5EDb3A432268e5831"),
988
- symbol: "USDC",
989
- name: "USD Coin",
990
- decimals: 6,
991
- logoURI: "https://pay.daimo.com/coin-logos/usdc.png"
992
- /* USDC */
993
- }, zs = {
994
- chainId: Ge.chainId,
995
- address: R("0x5425890298aed601595a70ab815c96711a31bc65"),
996
- symbol: "USDC",
997
- fiatISO: "USD",
998
- decimals: 6,
999
- logoURI: "https://pay.daimo.com/coin-logos/usdc.png",
1000
- logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
1001
- }, Ls = {
1002
- chainId: Je.chainId,
1003
- address: R("0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"),
1004
- symbol: "USDC",
1005
- fiatISO: "USD",
1006
- decimals: 6,
1007
- logoURI: "https://pay.daimo.com/coin-logos/usdc.png",
1008
- logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
1009
- }, js = {
1010
- chainId: We.chainId,
1011
- address: R("0x036CbD53842c5426634e7929541eC2318f3dCF7e"),
1012
- symbol: "USDC",
1013
- fiatISO: "USD",
1014
- decimals: 6,
1015
- logoURI: "https://pay.daimo.com/coin-logos/usdc.png",
1016
- logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
1017
- }, qs = {
1018
- chainId: Ke.chainId,
1019
- address: R("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"),
1020
- symbol: "USDC",
1021
- fiatISO: "USD",
1022
- decimals: 6,
1023
- logoURI: "https://pay.daimo.com/coin-logos/usdc.png",
1024
- logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
1025
- }, _s = {
1026
- chainId: Ve.chainId,
1027
- address: R("0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d"),
1028
- symbol: "USDC",
1029
- decimals: 18,
1030
- logoURI: "https://pay.daimo.com/coin-logos/usdc.png",
1031
- logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
1032
- }, Fs = {
1033
- chainId: Xe.chainId,
1034
- address: R("0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238"),
1035
- symbol: "USDC",
1036
- decimals: 6,
1037
- logoURI: "https://pay.daimo.com/coin-logos/usdc.png",
1038
- logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
1039
- }, Hs = {
1040
- chainId: Ye.chainId,
1041
- address: R("0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"),
1042
- symbol: "USDC",
1043
- decimals: 6,
1044
- logoURI: "https://pay.daimo.com/coin-logos/usdc.png",
1045
- logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
1046
- }, Ks = {
1047
- chainId: Ze.chainId,
1048
- address: "0x053C91253BC9682c04929cA02ED00b3E423f6710D2ee7e0D5EBB06F3eCF368A8",
1049
- symbol: "USDC",
1050
- decimals: 6,
1051
- logoURI: "https://pay.daimo.com/coin-logos/usdc.png",
1052
- logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
1053
- }, Ue = {
1054
- ARBITRUM_MAINNET: {
1055
- ...Fe,
1056
- tokens: {
1057
- [S.USDC]: $s
937
+ return X.set(`${t}.${e}`, i), i;
938
+ }
939
+ function w(t, e) {
940
+ if (!Ds(t, { strict: !1 }))
941
+ throw new Cs({ address: t });
942
+ return st(t, e);
943
+ }
944
+ const As = /^0x[a-fA-F0-9]{40}$/, J = /* @__PURE__ */ new tt(8192);
945
+ function Ds(t, e) {
946
+ const { strict: s = !0 } = e ?? {}, n = `${t}.${s}`;
947
+ if (J.has(n))
948
+ return J.get(n);
949
+ const r = As.test(t) ? t.toLowerCase() === t ? !0 : s ? st(t) === t : !0 : !1;
950
+ return J.set(n, r), r;
951
+ }
952
+ const c = {
953
+ USDC: "USDC",
954
+ USDT: "USDT",
955
+ DAI: "DAI",
956
+ BUSD: "BUSD",
957
+ EURC: "EURC",
958
+ ETH: "ETH",
959
+ WETH: "WETH",
960
+ STRK: "STRK",
961
+ BNB: "BNB",
962
+ LORDS: "LORDS"
963
+ };
964
+ c.USDC;
965
+ const nt = {
966
+ [b.ARBITRUM]: {
967
+ [c.DAI]: {
968
+ address: w("0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1"),
969
+ symbol: c.DAI,
970
+ name: "Dai Stablecoin",
971
+ decimals: 18,
972
+ logoURI: "/images/tokens/dai.png"
973
+ /* DAI */
974
+ },
975
+ [c.ETH]: {
976
+ address: "0x0000000000000000000000000000000000000000",
977
+ symbol: c.ETH,
978
+ name: "Ethereum",
979
+ decimals: 18,
980
+ logoURI: "/images/chains/ethereum.svg"
981
+ /* ETH */
982
+ },
983
+ [c.USDC]: {
984
+ address: w("0xaf88d065e77c8cC2239327C5EDb3A432268e5831"),
985
+ symbol: c.USDC,
986
+ name: "USD Coin",
987
+ decimals: 6,
988
+ logoURI: "/images/tokens/usdc.svg"
989
+ /* USDC */
990
+ },
991
+ [c.USDT]: {
992
+ address: w("0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9"),
993
+ symbol: c.USDT,
994
+ name: "Tether USD",
995
+ decimals: 6,
996
+ logoURI: "/images/tokens/usdt.png"
997
+ /* USDT */
1058
998
  },
1059
- explorer: "https://arbiscan.io"
999
+ [c.WETH]: {
1000
+ address: w("0x82aF49447D8a07e3bd95BD0d56f35241523fBab1"),
1001
+ symbol: c.WETH,
1002
+ name: "Wrapped Ether",
1003
+ decimals: 18,
1004
+ logoURI: "/images/tokens/weth.png"
1005
+ /* WETH */
1006
+ }
1060
1007
  },
1061
- ARBITRUM_TESTNET: {
1062
- ...He,
1063
- explorer: "https://sepolia.arbiscan.io",
1064
- tokens: {
1065
- [S.USDC]: Bs
1008
+ [b.ARBITRUM_TESTNET]: {
1009
+ [c.USDC]: {
1010
+ address: w("0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d"),
1011
+ symbol: c.USDC,
1012
+ name: "USD Coin",
1013
+ fiatISO: "USD",
1014
+ decimals: 6,
1015
+ logoURI: "/images/tokens/usdc.svg",
1016
+ logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
1066
1017
  }
1067
1018
  },
1068
- AVALANCHE_MAINNET: {
1069
- ...Je,
1070
- tokens: {
1071
- [S.USDC]: Ls
1019
+ [b.AVALANCHE]: {
1020
+ [c.DAI]: {
1021
+ address: "0xd586E7F844cEa2F87f50152665BCbc2C279D8d70",
1022
+ symbol: c.DAI,
1023
+ name: "Dai Stablecoin",
1024
+ decimals: 18,
1025
+ logoURI: "/images/tokens/dai.png"
1026
+ /* DAI */
1072
1027
  },
1073
- explorer: "https://snowtrace.io"
1074
- },
1075
- AVALANCHE_TESTNET: {
1076
- ...Ge,
1077
- tokens: {
1078
- [S.USDC]: zs
1028
+ [c.USDC]: {
1029
+ address: w("0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"),
1030
+ symbol: c.USDC,
1031
+ name: "USD Coin",
1032
+ fiatISO: "USD",
1033
+ decimals: 6,
1034
+ logoURI: "/images/tokens/usdc.svg",
1035
+ logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
1036
+ },
1037
+ [c.USDT]: {
1038
+ address: "0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7",
1039
+ symbol: c.USDT,
1040
+ name: "Tether USD",
1041
+ decimals: 6,
1042
+ logoURI: "/images/tokens/usdt.png"
1043
+ /* USDT */
1079
1044
  },
1080
- explorer: "https://testnet.snowtrace.io"
1045
+ [c.WETH]: {
1046
+ address: "0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB",
1047
+ symbol: c.WETH,
1048
+ name: "Wrapped Ether",
1049
+ decimals: 18,
1050
+ logoURI: "/images/tokens/weth.png"
1051
+ /* WETH */
1052
+ }
1053
+ },
1054
+ [b.AVALANCHE_TESTNET]: {
1055
+ [c.USDC]: {
1056
+ address: w("0x5425890298aed601595a70AB815c96711a31Bc65"),
1057
+ symbol: c.USDC,
1058
+ name: "USD Coin",
1059
+ fiatISO: "USD",
1060
+ decimals: 6,
1061
+ logoURI: "/images/tokens/usdc.svg",
1062
+ logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
1063
+ }
1081
1064
  },
1082
- BASE_MAINNET: {
1083
- ...Ke,
1084
- tokens: {
1085
- [S.USDC]: qs
1065
+ [b.BASE]: {
1066
+ [c.DAI]: {
1067
+ address: "0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb",
1068
+ symbol: c.DAI,
1069
+ name: "Dai Stablecoin",
1070
+ decimals: 18,
1071
+ logoURI: "/images/tokens/dai.png"
1072
+ /* DAI */
1073
+ },
1074
+ [c.ETH]: {
1075
+ address: "0x0000000000000000000000000000000000000000",
1076
+ symbol: c.ETH,
1077
+ name: "Ethereum",
1078
+ decimals: 18,
1079
+ logoURI: "/images/chains/ethereum.svg"
1080
+ /* ETH */
1086
1081
  },
1087
- explorer: "https://basescan.org"
1082
+ [c.EURC]: {
1083
+ address: "0x60a3E35Cc302bFA44Cb288Bc5a4F316Fdb1adb42",
1084
+ symbol: c.EURC,
1085
+ name: "Euro Coin",
1086
+ decimals: 6,
1087
+ logoURI: "/images/tokens/eurc.png"
1088
+ /* EURC */
1089
+ },
1090
+ [c.USDC]: {
1091
+ address: w("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"),
1092
+ symbol: c.USDC,
1093
+ name: "USD Coin",
1094
+ fiatISO: "USD",
1095
+ decimals: 6,
1096
+ logoURI: "/images/tokens/usdc.svg",
1097
+ logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
1098
+ },
1099
+ [c.WETH]: {
1100
+ address: w("0x4200000000000000000000000000000000000006"),
1101
+ symbol: c.WETH,
1102
+ name: "Wrapped Ether",
1103
+ decimals: 18,
1104
+ logoURI: "/images/tokens/weth.png"
1105
+ /* WETH */
1106
+ }
1088
1107
  },
1089
- BASE_TESTNET: {
1090
- ...We,
1091
- tokens: {
1092
- [S.USDC]: js
1108
+ [b.BASE_TESTNET]: {
1109
+ [c.USDC]: {
1110
+ address: w("0x036CbD53842c5426634e7929541eC2318f3dCF7e"),
1111
+ symbol: c.USDC,
1112
+ name: "USD Coin",
1113
+ fiatISO: "USD",
1114
+ decimals: 6,
1115
+ logoURI: "/images/tokens/usdc.svg",
1116
+ logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
1117
+ }
1118
+ },
1119
+ [b.BSC]: {
1120
+ [c.BNB]: {
1121
+ address: "0x0000000000000000000000000000000000000000",
1122
+ symbol: c.BNB,
1123
+ name: "BNB",
1124
+ decimals: 18,
1125
+ logoURI: "/images/chains/bsc.webp"
1126
+ /* BNB */
1127
+ },
1128
+ [c.BUSD]: {
1129
+ address: "0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56",
1130
+ symbol: c.BUSD,
1131
+ name: "Binance USD",
1132
+ decimals: 18,
1133
+ logoURI: "/images/tokens/busd.png"
1134
+ /* BUSD */
1135
+ },
1136
+ [c.DAI]: {
1137
+ address: "0x1AF3F329e8BE154074D8769D1FFa4eE058B1DBc3",
1138
+ symbol: c.DAI,
1139
+ name: "Dai Stablecoin",
1140
+ decimals: 18,
1141
+ logoURI: "/images/tokens/dai.png"
1142
+ /* DAI */
1093
1143
  },
1094
- explorer: "https://sepolia.basescan.org"
1144
+ [c.ETH]: {
1145
+ address: "0x2170Ed0880ac9A755fd29B2688956BD959F933F8",
1146
+ symbol: c.ETH,
1147
+ name: "Ethereum",
1148
+ decimals: 18,
1149
+ logoURI: "/images/chains/ethereum.svg"
1150
+ /* ETH */
1151
+ },
1152
+ [c.USDC]: {
1153
+ address: w("0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d"),
1154
+ symbol: c.USDC,
1155
+ decimals: 18,
1156
+ name: "USD Coin",
1157
+ logoURI: "/images/tokens/usdc.svg",
1158
+ logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
1159
+ },
1160
+ [c.USDT]: {
1161
+ address: "0x55d398326f99059fF775485246999027B3197955",
1162
+ symbol: c.USDT,
1163
+ name: "Tether USD",
1164
+ decimals: 18,
1165
+ logoURI: "/images/tokens/usdt.png"
1166
+ /* USDT */
1167
+ }
1095
1168
  },
1096
- BSC_MAINNET: {
1097
- ...Ve,
1098
- tokens: {
1099
- [S.USDC]: _s
1169
+ [b.ETHEREUM]: {
1170
+ [c.BUSD]: {
1171
+ address: "0x4Fabb145d64652a948d72533023f6E7A623C7C53",
1172
+ symbol: c.BUSD,
1173
+ name: "Binance USD",
1174
+ decimals: 18,
1175
+ logoURI: "/images/tokens/busd.png"
1176
+ /* BUSD */
1100
1177
  },
1101
- explorer: "https://bscscan.com"
1178
+ [c.DAI]: {
1179
+ address: w("0x6B175474E89094C44Da98b954EedeAC495271d0F"),
1180
+ symbol: c.DAI,
1181
+ name: "Dai Stablecoin",
1182
+ decimals: 18,
1183
+ logoURI: "/images/tokens/dai.png"
1184
+ /* DAI */
1185
+ },
1186
+ [c.ETH]: {
1187
+ address: "0x0000000000000000000000000000000000000000",
1188
+ symbol: c.ETH,
1189
+ name: "Ethereum",
1190
+ decimals: 18,
1191
+ logoURI: "/images/chains/ethereum.svg"
1192
+ /* ETH */
1193
+ },
1194
+ [c.EURC]: {
1195
+ address: "0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c",
1196
+ symbol: c.EURC,
1197
+ name: "Euro Coin",
1198
+ decimals: 6,
1199
+ logoURI: "/images/tokens/eurc.png"
1200
+ /* EURC */
1201
+ },
1202
+ [c.STRK]: {
1203
+ address: "0xCa14007Eff0dB1f8135f4C25B34De49AB0d42766",
1204
+ symbol: c.STRK,
1205
+ name: "Starknet Token",
1206
+ decimals: 18,
1207
+ logoURI: "/images/chains/starknet.svg"
1208
+ /* STRK */
1209
+ },
1210
+ [c.USDC]: {
1211
+ address: w("0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"),
1212
+ symbol: c.USDC,
1213
+ name: "USD Coin",
1214
+ decimals: 6,
1215
+ logoURI: "/images/tokens/usdc.svg",
1216
+ logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
1217
+ },
1218
+ [c.USDT]: {
1219
+ address: w("0xdAC17F958D2ee523a2206206994597C13D831ec7"),
1220
+ symbol: c.USDT,
1221
+ name: "Tether USD",
1222
+ decimals: 6,
1223
+ logoURI: "/images/tokens/usdt.png"
1224
+ /* USDT */
1225
+ },
1226
+ [c.WETH]: {
1227
+ address: w("0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"),
1228
+ symbol: c.WETH,
1229
+ name: "Wrapped Ether",
1230
+ decimals: 18,
1231
+ logoURI: "/images/tokens/weth.png"
1232
+ /* WETH */
1233
+ }
1102
1234
  },
1103
- ETHEREUM_MAINNET: {
1104
- ...Ye,
1105
- tokens: {
1106
- [S.USDC]: Hs
1235
+ [b.ETHEREUM_TESTNET]: {
1236
+ [c.USDC]: {
1237
+ address: w("0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238"),
1238
+ symbol: c.USDC,
1239
+ decimals: 6,
1240
+ name: "USD Coin",
1241
+ logoURI: "/images/tokens/usdc.svg",
1242
+ logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
1243
+ }
1244
+ },
1245
+ [b.HYPEREVM]: {
1246
+ [c.USDC]: {
1247
+ address: "0xb88339CB7199b77E23DB6E890353E22632Ba630f",
1248
+ symbol: c.USDC,
1249
+ name: "USD Coin",
1250
+ decimals: 6,
1251
+ logoURI: "/images/tokens/usdc.svg"
1252
+ /* USDC */
1253
+ }
1254
+ },
1255
+ [b.LISK]: {
1256
+ [c.USDC]: {
1257
+ address: "0xF242275d3a6527d877f2c927a82D9b057609cc71",
1258
+ symbol: c.USDC,
1259
+ name: "USD Coin",
1260
+ decimals: 6,
1261
+ logoURI: "/images/tokens/usdc.svg"
1262
+ /* USDC */
1263
+ }
1264
+ },
1265
+ [b.MONAD]: {
1266
+ [c.USDC]: {
1267
+ address: "0x754704Bc059F8C67012fEd69BC8A327a5aafb603",
1268
+ symbol: c.USDC,
1269
+ name: "USD Coin",
1270
+ decimals: 6,
1271
+ logoURI: "/images/tokens/usdc.svg"
1272
+ /* USDC */
1273
+ }
1274
+ },
1275
+ [b.MONAD_TESTNET]: {
1276
+ [c.USDC]: {
1277
+ address: "0x534b2f3A21130d7a60830c2Df862319e593943A3",
1278
+ symbol: c.USDC,
1279
+ name: "USD Coin",
1280
+ decimals: 6,
1281
+ logoURI: "/images/tokens/usdc.svg"
1282
+ /* USDC */
1283
+ }
1284
+ },
1285
+ [b.OPTIMISM]: {
1286
+ [c.DAI]: {
1287
+ address: "0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1",
1288
+ symbol: c.DAI,
1289
+ name: "Dai Stablecoin",
1290
+ decimals: 18,
1291
+ logoURI: "/images/tokens/dai.png"
1292
+ /* DAI */
1293
+ },
1294
+ [c.ETH]: {
1295
+ address: "0x0000000000000000000000000000000000000000",
1296
+ symbol: c.ETH,
1297
+ name: "Ethereum",
1298
+ decimals: 18,
1299
+ logoURI: "/images/chains/ethereum.svg"
1300
+ /* ETH */
1107
1301
  },
1108
- explorer: "https://etherscan.io"
1302
+ [c.USDC]: {
1303
+ address: "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",
1304
+ symbol: c.USDC,
1305
+ name: "USD Coin",
1306
+ decimals: 6,
1307
+ logoURI: "/images/tokens/usdc.svg"
1308
+ /* USDC */
1309
+ },
1310
+ [c.USDT]: {
1311
+ address: "0x94b008aA00579c1307B0EF2c499aD98a8ce58e58",
1312
+ symbol: c.USDT,
1313
+ name: "Tether USD",
1314
+ decimals: 6,
1315
+ logoURI: "/images/tokens/usdt.png"
1316
+ /* USDT */
1317
+ },
1318
+ [c.WETH]: {
1319
+ address: "0x4200000000000000000000000000000000000006",
1320
+ symbol: c.WETH,
1321
+ name: "Wrapped Ether",
1322
+ decimals: 18,
1323
+ logoURI: "/images/tokens/weth.png"
1324
+ /* WETH */
1325
+ }
1109
1326
  },
1110
- ETHEREUM_TESTNET: {
1111
- ...Xe,
1112
- tokens: {
1113
- [S.USDC]: Fs
1327
+ [b.OPTIMISM_TESTNET]: {
1328
+ [c.USDC]: {
1329
+ address: "0x5fd84259d66Cd46123540766Be93DFE6D43130D7",
1330
+ symbol: c.USDC,
1331
+ name: "USD Coin",
1332
+ decimals: 6,
1333
+ logoURI: "/images/tokens/usdc.svg"
1334
+ /* USDC */
1335
+ }
1336
+ },
1337
+ [b.POLYGON]: {
1338
+ [c.DAI]: {
1339
+ address: "0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063",
1340
+ symbol: c.DAI,
1341
+ name: "Dai Stablecoin",
1342
+ decimals: 18,
1343
+ logoURI: "/images/tokens/dai.png"
1344
+ /* DAI */
1345
+ },
1346
+ [c.USDC]: {
1347
+ address: "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359",
1348
+ symbol: c.USDC,
1349
+ name: "USD Coin",
1350
+ decimals: 6,
1351
+ logoURI: "/images/tokens/usdc.svg"
1352
+ /* USDC */
1353
+ },
1354
+ [c.USDT]: {
1355
+ address: "0xc2132D05D31c914a87C6611C10748AEb04B58e8F",
1356
+ symbol: c.USDT,
1357
+ name: "Tether USD",
1358
+ decimals: 6,
1359
+ logoURI: "/images/tokens/usdt.png"
1360
+ /* USDT */
1114
1361
  },
1115
- explorer: "https://sepolia.etherscan.io"
1362
+ [c.WETH]: {
1363
+ address: "0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619",
1364
+ symbol: c.WETH,
1365
+ name: "Wrapped Ether",
1366
+ decimals: 18,
1367
+ logoURI: "/images/tokens/weth.png"
1368
+ /* WETH */
1369
+ }
1116
1370
  },
1117
- STARKNET_MAINNET: {
1118
- ...Ze,
1119
- tokens: {
1120
- [S.USDC]: Ks
1371
+ [b.STARKNET]: {
1372
+ [c.DAI]: {
1373
+ address: "0x05574eb6b8789a91466f902c380d978e472db68170ff82a5b650b95a58ddf4ad",
1374
+ symbol: c.DAI,
1375
+ name: "Dai Stablecoin",
1376
+ decimals: 18,
1377
+ logoURI: "/images/tokens/dai.png"
1378
+ /* DAI */
1379
+ },
1380
+ [c.ETH]: {
1381
+ address: "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
1382
+ symbol: c.ETH,
1383
+ name: "Ethereum",
1384
+ decimals: 18,
1385
+ logoURI: "/images/chains/ethereum.svg"
1386
+ /* ETH */
1387
+ },
1388
+ [c.LORDS]: {
1389
+ address: "0x0124aeb495b947201f5faC96fD1138E326AD86195B98df6DEc9009158A533B49",
1390
+ symbol: c.LORDS,
1391
+ name: "LORDS Token",
1392
+ decimals: 18,
1393
+ logoURI: "/images/tokens/lords.png"
1394
+ /* LORDS */
1121
1395
  },
1122
- explorer: ""
1396
+ [c.STRK]: {
1397
+ address: "0x04718f5a0Fc34cC1AF16A1cdee98fFB20C31f5cD61D6Ab07201858f4287c938D",
1398
+ symbol: c.STRK,
1399
+ name: "Starknet Token",
1400
+ decimals: 18,
1401
+ logoURI: "/images/chains/starknet.svg"
1402
+ /* STRK */
1403
+ },
1404
+ [c.USDC]: {
1405
+ address: "0x033068F6539f8e6e6b131e6B2B814e6c34A5224bC66947c47DaB9dFeE93b35fb",
1406
+ symbol: c.USDC,
1407
+ name: "USD Coin",
1408
+ decimals: 6,
1409
+ logoURI: "/images/tokens/usdc.svg",
1410
+ logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
1411
+ },
1412
+ [c.USDT]: {
1413
+ address: "0x068f5c6a61780768455de69077e07e89787839bf8166decfbf92b645209c0fb8",
1414
+ symbol: c.USDT,
1415
+ name: "Tether USD",
1416
+ decimals: 6,
1417
+ logoURI: "/images/tokens/usdt.png"
1418
+ /* USDT */
1419
+ }
1420
+ },
1421
+ [b.STARKNET_TESTNET]: {
1422
+ [c.USDC]: {
1423
+ address: "0x0512feAc6339Ff7889822cb5aA2a86C848e9D392bB0E3E237C008674feeD8343",
1424
+ symbol: c.USDC,
1425
+ name: "USD Coin",
1426
+ decimals: 6,
1427
+ logoURI: "/images/tokens/usdc.svg"
1428
+ /* USDC */
1429
+ }
1123
1430
  }
1124
- };
1125
- var ee = /* @__PURE__ */ ((e) => (e.ARBITRUM = "ARBITRUM_MAINNET", e.ARBITRUM_TESTNET = "ARBITRUM_TESTNET", e.AVALANCHE = "AVALANCHE_MAINNET", e.AVALANCHE_TESTNET = "AVALANCHE_TESTNET", e.BASE = "BASE_MAINNET", e.BASE_TESTNET = "BASE_TESTNET", e.BSC = "BSC_MAINNET", e.ETHEREUM = "ETHEREUM_MAINNET", e.ETHEREUM_TESTNET = "ETHEREUM_TESTNET", e.STARKNET = "STARKNET_MAINNET", e))(ee || {}), ht = /* @__PURE__ */ ((e) => (e.USDC = "USDC", e))(ht || {});
1126
- const Ws = (e) => {
1127
- const t = e?.trim().toUpperCase();
1128
- if (Ue[t])
1129
- return Ue[t];
1130
- };
1131
- function Vs(e, t) {
1132
- return Ws(e)?.tokens[t]?.address;
1431
+ }, Us = new Set(Object.values(b));
1432
+ function S(t) {
1433
+ if (Is(t))
1434
+ return t;
1435
+ const e = b[t];
1436
+ if (!e)
1437
+ throw new Error(`Invalid chain: ${t}. Chain must be a valid chain alias or internal chain value from Chains.`);
1438
+ return e;
1439
+ }
1440
+ function Is(t) {
1441
+ return Us.has(t);
1133
1442
  }
1134
- var ue = /* @__PURE__ */ ((e) => (e.PRODUCTION = "production", e.STAGING = "staging", e))(ue || {});
1135
- class d {
1136
- constructor({ api_key: t, env: s, seesion_token: n, props: r }) {
1137
- this.api_key = t || "", this.sessionToken = n || "", this.env = s ?? ue.PRODUCTION, this.props = r;
1443
+ function Ps(t, e) {
1444
+ const s = e.toLowerCase().trim(), n = nt[t];
1445
+ if (!n)
1446
+ throw new Error(
1447
+ `Chain not found: ${t}. The chain key must be a valid chain identifier.`
1448
+ );
1449
+ let r;
1450
+ for (const i in n) {
1451
+ const o = n[i];
1452
+ if (o && o.address.toLowerCase() === s.toLowerCase()) {
1453
+ r = o;
1454
+ break;
1455
+ }
1138
1456
  }
1139
- static async config(t) {
1140
- if (!d.app) {
1141
- if (!t)
1457
+ if (!r)
1458
+ throw new Error(
1459
+ `Token address mismatch: address ${e} does not exist on chain ${t}. The token address must be a valid token address on the specified chain.`
1460
+ );
1461
+ return r;
1462
+ }
1463
+ function Z(t, e, s) {
1464
+ const n = Ps(t, e);
1465
+ if (n.symbol !== s)
1466
+ throw new Error(
1467
+ `Token address and symbol mismatch: address ${e} on chain ${t} corresponds to token "${n.symbol}", but expected "${s}". The token address must correspond to a token with the expected symbol on the specified chain.`
1468
+ );
1469
+ return n;
1470
+ }
1471
+ function vs(t, e) {
1472
+ return nt[t]?.[e];
1473
+ }
1474
+ function ks(t, e) {
1475
+ return vs(t, e)?.address;
1476
+ }
1477
+ var de = /* @__PURE__ */ ((t) => (t.PRODUCTION = "production", t.STAGING = "staging", t))(de || {});
1478
+ class g {
1479
+ constructor({ api_key: e, env: s, seesion_token: n, props: r }) {
1480
+ this.api_key = e || "", this.sessionToken = n || "", this.env = s ?? de.PRODUCTION, this.props = r;
1481
+ }
1482
+ static async config(e) {
1483
+ if (!g.app) {
1484
+ if (!e)
1142
1485
  throw new Error("Please provide an api_key");
1143
- d.app = new d(t);
1486
+ g.app = new g(e);
1144
1487
  }
1145
- return t && (t.api_key !== void 0 && (d.app.api_key = t.api_key), t.seesion_token !== void 0 && (d.app.sessionToken = t.seesion_token), t.env !== void 0 && (d.app.env = t.env), t.props !== void 0 && (d.app.props = t.props)), d.app;
1488
+ return e && (e.api_key !== void 0 && (g.app.api_key = e.api_key), e.seesion_token !== void 0 && (g.app.sessionToken = e.seesion_token), e.env !== void 0 && (g.app.env = e.env), e.props !== void 0 && (g.app.props = e.props)), g.app;
1146
1489
  }
1147
1490
  static getApiKey() {
1148
- if (!d.app)
1491
+ if (!g.app)
1149
1492
  throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
1150
- return d.app.api_key;
1493
+ return g.app.api_key;
1151
1494
  }
1152
1495
  static getSessionToken() {
1153
- if (!d.app)
1496
+ if (!g.app)
1154
1497
  throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
1155
- return d.app.sessionToken;
1498
+ return g.app.sessionToken;
1156
1499
  }
1157
1500
  static getProps() {
1158
- if (!d.app)
1501
+ if (!g.app)
1159
1502
  throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
1160
- return d.app.props;
1503
+ return g.app.props;
1161
1504
  }
1162
1505
  static getEnv() {
1163
- if (!d.app)
1506
+ if (!g.app)
1164
1507
  throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
1165
- return d.app.env === "internal" ? "staging" : d.app.env;
1508
+ return g.app.env === "internal" ? "staging" : g.app.env;
1166
1509
  }
1167
1510
  static getBaseUrl() {
1168
- if (!d.app)
1511
+ if (!g.app)
1169
1512
  throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
1170
- switch (d.app.env) {
1513
+ switch (g.app.env) {
1171
1514
  case "production":
1172
1515
  return "https://api.chainrails.io/api/v1";
1173
1516
  case "staging":
@@ -1178,352 +1521,411 @@ class d {
1178
1521
  return "https://api.chainrails.io/api/v1";
1179
1522
  }
1180
1523
  }
1181
- static getPayModalUrl(t) {
1182
- if (!d.app)
1524
+ static getPayModalUrl(e) {
1525
+ if (!g.app)
1183
1526
  throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
1184
- const s = d.app.env === "internal" ? "https://chainrails-frontend-git-staging-horus-labs.vercel.app" : "https://app.chainrails.io", n = Number(t), r = t && !isNaN(Number(t)) && n > 0 ? "/pay/" : "/deposit/", i = `${t && !isNaN(Number(t)) && n > 0 ? n * 100 : ""}`;
1527
+ const s = g.app.env === "internal" ? "https://chainrails-frontend-git-staging-horus-labs.vercel.app" : "https://app.chainrails.io", n = Number(e), r = e && !isNaN(Number(e)) && n > 0 ? "/pay/" : "/deposit/", i = `${e && !isNaN(Number(e)) && n > 0 ? n * 100 : ""}`;
1185
1528
  return s + r + i;
1186
1529
  }
1187
1530
  }
1188
- let te = null;
1189
- function Ys() {
1190
- te = Gt.create({
1191
- prefixUrl: d.getBaseUrl(),
1531
+ let ne = null;
1532
+ function xs() {
1533
+ ne = zt.create({
1534
+ prefixUrl: g.getBaseUrl(),
1192
1535
  headers: {
1193
1536
  "Content-Type": "application/json"
1194
1537
  },
1195
1538
  hooks: {
1196
1539
  beforeRequest: [
1197
- (e) => {
1198
- const t = d.getSessionToken() || d.getApiKey();
1199
- e.headers.set("Authorization", `Bearer ${t}`);
1540
+ (t) => {
1541
+ const e = g.getSessionToken() || g.getApiKey();
1542
+ t.headers.set("Authorization", `Bearer ${e}`);
1200
1543
  }
1201
1544
  ],
1202
- afterResponse: [(e, t, s) => s]
1545
+ afterResponse: [(t, e, s) => s]
1203
1546
  },
1204
1547
  retry: {
1205
1548
  limit: 2
1206
1549
  }
1207
1550
  });
1208
1551
  }
1209
- function g() {
1210
- return te || Ys(), te;
1211
- }
1212
- class Xs {
1213
- async getById(t) {
1214
- return await g().get("intents/" + t).json();
1215
- }
1216
- async getForSender(t) {
1217
- return await g().get("intents/user/" + t).json();
1218
- }
1219
- async getForAddress(t) {
1220
- return await g().get("intents/address/" + t).json();
1221
- }
1222
- async getForSession(t) {
1223
- return await g().get("modal/sessions/intents/" + t).json();
1224
- }
1225
- async getAll(t) {
1226
- return await g().get("intents", { searchParams: t }).json();
1227
- }
1228
- async create(t) {
1229
- return await g().post("intents", { json: t }).json();
1230
- }
1231
- async createForSession(t) {
1232
- return await g().post("modal/sessions/intents", { json: t }).json();
1233
- }
1234
- async update(t, s) {
1235
- return await g().post("intents", { json: s }).json();
1236
- }
1237
- async triggerProcessing(t) {
1238
- return await g().post(`intents/${t}/trigger-processing`).json();
1239
- }
1240
- async triggerProcessingForSession(t) {
1241
- return await g().post(`modal/sessions/intents/${t}/process`).json();
1242
- }
1552
+ function p() {
1553
+ return ne || xs(), ne;
1243
1554
  }
1244
- class Js {
1245
- async getFromSpecificBridge(t) {
1246
- return await g().get("quotes/single", { searchParams: t }).json();
1555
+ class Ns {
1556
+ async getById(e) {
1557
+ return await p().get("intents/" + e).json();
1247
1558
  }
1248
- async getFromAllBridges(t) {
1249
- return await g().get("quotes/multiple", { searchParams: t }).json();
1559
+ async getForSender(e) {
1560
+ return await p().get("intents/user/" + e).json();
1250
1561
  }
1251
- async getBestAcrossBridges(t) {
1252
- return await g().get("quotes/best", { searchParams: t }).json();
1562
+ async getForAddress(e) {
1563
+ return await p().get("intents/address/" + e).json();
1253
1564
  }
1254
- async getAll(t) {
1255
- return await g().get("quotes/multi-source", { searchParams: t }).json();
1565
+ async getForSession(e) {
1566
+ return await p().get("modal/sessions/intents/" + e).json();
1256
1567
  }
1257
- async getAllForSession(t) {
1258
- return await g().get("modal/sessions/quotes", { searchParams: t }).json();
1568
+ async getAll(e) {
1569
+ return await p().get("intents", { searchParams: e }).json();
1259
1570
  }
1260
- }
1261
- class Gs {
1262
- async getOptimalRoutes(t) {
1263
- return await g().get("router/optimal-route", { searchParams: t }).json();
1571
+ async create(e) {
1572
+ const s = S(e.source_chain), n = S(e.destination_chain);
1573
+ return await p().post("intents", {
1574
+ json: {
1575
+ ...e,
1576
+ source_chain: s,
1577
+ destination_chain: n
1578
+ }
1579
+ }).json();
1580
+ }
1581
+ async createForSession(e) {
1582
+ const s = S(e.sourceChain);
1583
+ return await p().post("modal/sessions/intents", {
1584
+ json: { ...e, sourceChain: s }
1585
+ }).json();
1586
+ }
1587
+ async update(e, s) {
1588
+ return await p().post("intents", { json: s }).json();
1589
+ }
1590
+ async triggerProcessing(e) {
1591
+ return await p().post(`intents/${e}/trigger-processing`).json();
1592
+ }
1593
+ async triggerProcessingForSession(e) {
1594
+ return await p().post(`modal/sessions/intents/${e}/process`).json();
1595
+ }
1596
+ }
1597
+ class Os {
1598
+ async getFromSpecificBridge(e) {
1599
+ const s = S(e.sourceChain);
1600
+ Z(s, e.tokenIn, e.amountSymbol);
1601
+ const n = S(e.destinationChain);
1602
+ return await p().get("quotes/single", {
1603
+ searchParams: {
1604
+ ...e,
1605
+ sourceChain: s,
1606
+ destinationChain: n
1607
+ }
1608
+ }).json();
1609
+ }
1610
+ async getFromAllBridges(e) {
1611
+ const s = S(e.sourceChain);
1612
+ Z(s, e.tokenIn, e.amountSymbol);
1613
+ const n = S(e.destinationChain);
1614
+ return await p().get("quotes/multiple", {
1615
+ searchParams: {
1616
+ ...e,
1617
+ sourceChain: s,
1618
+ destinationChain: n
1619
+ }
1620
+ }).json();
1621
+ }
1622
+ async getBestAcrossBridges(e) {
1623
+ const s = S(e.sourceChain);
1624
+ Z(s, e.tokenIn, e.amountSymbol);
1625
+ const n = S(e.destinationChain);
1626
+ return await p().get("quotes/best", { searchParams: {
1627
+ ...e,
1628
+ sourceChain: s,
1629
+ destinationChain: n
1630
+ } }).json();
1631
+ }
1632
+ async getAll(e) {
1633
+ const s = S(e.destinationChain);
1634
+ return await p().get("quotes/multi-source", { searchParams: {
1635
+ ...e,
1636
+ destinationChain: s
1637
+ } }).json();
1638
+ }
1639
+ async getAllForSession(e) {
1640
+ return await p().get("modal/sessions/quotes", { searchParams: e }).json();
1641
+ }
1642
+ }
1643
+ class Bs {
1644
+ async getOptimalRoutes(e) {
1645
+ const s = S(e.sourceChain), n = S(e.destinationChain);
1646
+ return await p().get("router/optimal-route", {
1647
+ searchParams: {
1648
+ ...e,
1649
+ sourceChain: s,
1650
+ destinationChain: n
1651
+ }
1652
+ }).json();
1264
1653
  }
1265
1654
  async getAllSupportedBridges() {
1266
- return await g().get("router/supported-bridges/all").json();
1267
- }
1268
- async getSupportedBridges(t) {
1269
- return await g().get("router/supported-bridges/route", { searchParams: t }).json();
1270
- }
1271
- async getSupportedRoutes(t, s) {
1272
- return await g().get("router/supported-bridges/bridge/" + t, { searchParams: s }).json();
1655
+ return await p().get("router/supported-bridges/all").json();
1656
+ }
1657
+ async getSupportedBridges(e) {
1658
+ const s = S(e.sourceChain), n = S(e.destinationChain);
1659
+ return await p().get("router/supported-bridges/route", { searchParams: {
1660
+ ...e,
1661
+ sourceChain: s,
1662
+ destinationChain: n
1663
+ } }).json();
1664
+ }
1665
+ async getSupportedRoutes(e, s) {
1666
+ const n = S(s.sourceChain), r = S(s.destinationChain);
1667
+ return await p().get("router/supported-routes/bridge/" + e, { searchParams: {
1668
+ ...s,
1669
+ sourceChain: n,
1670
+ destinationChain: r
1671
+ } }).json();
1273
1672
  }
1274
1673
  }
1275
- class Zs {
1276
- async getSupported(t) {
1277
- return await g().get("chains", { searchParams: t }).json();
1674
+ class Ms {
1675
+ async getSupported(e) {
1676
+ return await p().get("chains", { searchParams: e }).json();
1677
+ }
1678
+ async getBalance(e) {
1679
+ return await p().get(`chains/balances/${e.address}`, { searchParams: e }).json();
1278
1680
  }
1279
1681
  }
1280
- class Qs {
1682
+ class Ls {
1281
1683
  async getClientInfo() {
1282
- return await g().get("client/auth/client-info").json();
1684
+ return await p().get("client/auth/client-info").json();
1283
1685
  }
1284
1686
  async getClientInfoForSession() {
1285
- return await g().get("modal/sessions/client").json();
1687
+ return await p().get("modal/sessions/client").json();
1286
1688
  }
1287
1689
  }
1288
- class en {
1289
- getSessionToken(t) {
1290
- const s = {
1291
- recipient: t.recipient,
1292
- tokenOut: Vs(
1293
- ee[t.destinationChain?.replace("_MAINNET", "")],
1294
- ht[t.token]
1690
+ class Fs {
1691
+ async getSessionToken(e) {
1692
+ const s = S(e.destinationChain), n = {
1693
+ recipient: e.recipient,
1694
+ tokenOut: ks(
1695
+ s,
1696
+ e.token
1295
1697
  ),
1296
- destinationChain: ee[t.destinationChain?.replace("_MAINNET", "")],
1297
- amount: t.amount
1698
+ destinationChain: s,
1699
+ amount: e.amount
1298
1700
  };
1299
- return g().post("modal/sessions", { json: s }).json().then((n) => ({ ...n, amount: s.amount }));
1701
+ return p().post("modal/sessions", { json: n }).json().then((r) => ({ ...r, amount: n.amount }));
1300
1702
  }
1301
1703
  }
1302
- const vn = {
1303
- router: new Gs(),
1304
- quotes: new Js(),
1305
- intents: new Xs(),
1306
- chains: new Zs(),
1307
- client: new Qs(),
1308
- auth: new en()
1704
+ const ln = {
1705
+ router: new Bs(),
1706
+ quotes: new Os(),
1707
+ intents: new Ns(),
1708
+ chains: new Ms(),
1709
+ client: new Ls(),
1710
+ auth: new Fs()
1309
1711
  };
1310
- function dt(e) {
1311
- var t, s, n = "";
1312
- if (typeof e == "string" || typeof e == "number") n += e;
1313
- else if (typeof e == "object") if (Array.isArray(e)) {
1314
- var r = e.length;
1315
- for (t = 0; t < r; t++) e[t] && (s = dt(e[t])) && (n && (n += " "), n += s);
1316
- } else for (s in e) e[s] && (n && (n += " "), n += s);
1712
+ function rt(t) {
1713
+ var e, s, n = "";
1714
+ if (typeof t == "string" || typeof t == "number") n += t;
1715
+ else if (typeof t == "object") if (Array.isArray(t)) {
1716
+ var r = t.length;
1717
+ for (e = 0; e < r; e++) t[e] && (s = rt(t[e])) && (n && (n += " "), n += s);
1718
+ } else for (s in t) t[s] && (n && (n += " "), n += s);
1317
1719
  return n;
1318
1720
  }
1319
- function tn() {
1320
- for (var e, t, s = 0, n = "", r = arguments.length; s < r; s++) (e = arguments[s]) && (t = dt(e)) && (n && (n += " "), n += t);
1721
+ function _s() {
1722
+ for (var t, e, s = 0, n = "", r = arguments.length; s < r; s++) (t = arguments[s]) && (e = rt(t)) && (n && (n += " "), n += e);
1321
1723
  return n;
1322
1724
  }
1323
- function Pn(e) {
1725
+ function dn(t) {
1324
1726
  const {
1325
- amount: t,
1727
+ amount: e,
1326
1728
  styles: s,
1327
- excludedChains: n,
1729
+ excludeChains: n,
1328
1730
  isOpen: r,
1329
1731
  isPending: i,
1330
1732
  open: o,
1331
1733
  close: a,
1332
- onCancel: c,
1333
- onSuccess: u,
1334
- session_url: l,
1335
- sessionToken: w
1336
- } = e, [p, m] = C(0), [b, H] = C(""), f = re(null);
1337
- d.config({
1734
+ onCancel: u,
1735
+ onSuccess: l,
1736
+ session_url: d,
1737
+ sessionToken: T
1738
+ } = t, [m, y] = v(0), [R, W] = v(""), f = ie(null);
1739
+ g.config({
1338
1740
  api_key: "",
1339
1741
  // @ts-expect-error
1340
- env: e.env === "internal" ? "internal" : "production"
1742
+ env: t.env === "internal" ? "internal" : "production"
1341
1743
  }), x(() => {
1342
- H(d.getPayModalUrl(t));
1343
- }, [t]), x(() => {
1744
+ W(g.getPayModalUrl(e));
1745
+ }, [e]), x(() => {
1344
1746
  const h = document.body.style.overflow;
1345
1747
  r ? (document.body.style.overflow = "hidden", document.body.style.overflow = "hidden") : document.body.style.overflow = h || "";
1346
- const E = (P) => {
1347
- P.data === "closed" && (a(), c?.()), P.data === "completed" && (window.setTimeout(a, 2e3), u?.());
1748
+ const C = (I) => {
1749
+ I.data === "closed" && (a(), u?.()), I.data === "completed" && (window.setTimeout(a, 2e3), l?.());
1348
1750
  };
1349
- return window.addEventListener("message", E), () => {
1350
- document.body.style.overflow = h || "", window.removeEventListener("message", E);
1751
+ return window.addEventListener("message", C), () => {
1752
+ document.body.style.overflow = h || "", window.removeEventListener("message", C);
1351
1753
  };
1352
- }, [r, c, u]), x(() => {
1353
- if (!w) return;
1754
+ }, [r, u, l]), x(() => {
1755
+ if (!T) return;
1354
1756
  const h = {
1355
1757
  type: "session",
1356
- session_token: w,
1357
- environment: d.getEnv() || ue.PRODUCTION,
1758
+ session_token: T,
1759
+ environment: g.getEnv() || de.PRODUCTION,
1358
1760
  styles: s,
1359
1761
  props: {
1360
- excludedChains: n?.join(",")
1762
+ excludeChains: n?.join(",")
1361
1763
  }
1362
1764
  };
1363
1765
  f.current?.contentWindow?.postMessage(h, "https://app.chainrails.io"), f.current?.contentWindow?.postMessage(h, "https://chainrails-frontend-git-staging-horus-labs.vercel.app"), window.setTimeout(() => {
1364
1766
  f.current?.contentWindow?.postMessage(h, "https://app.chainrails.io"), f.current?.contentWindow?.postMessage(h, "https://chainrails-frontend-git-staging-horus-labs.vercel.app");
1365
1767
  }, 1e3);
1366
- }, [w, p, r, s]);
1367
- function y() {
1368
- m(Math.random());
1768
+ }, [T, m, r, s]);
1769
+ function E() {
1770
+ y(Math.random());
1369
1771
  }
1370
- return /* @__PURE__ */ we("div", {
1371
- className: tn("payment-modal-wrapper", p === 0 || i ? "loading" : "not-loading", r ? "open" : "closed"),
1372
- children: [(p === 0 || i) && /* @__PURE__ */ M("div", {
1772
+ return /* @__PURE__ */ Te("div", {
1773
+ className: _s("payment-modal-wrapper", m === 0 || i ? "loading" : "not-loading", r ? "open" : "closed"),
1774
+ children: [(m === 0 || i) && /* @__PURE__ */ L("div", {
1373
1775
  role: "status",
1374
1776
  className: "payment-modal-loader",
1375
- children: /* @__PURE__ */ we("svg", {
1777
+ children: /* @__PURE__ */ Te("svg", {
1376
1778
  "aria-hidden": "true",
1377
1779
  className: "icon",
1378
1780
  viewBox: "0 0 100 101",
1379
1781
  fill: "none",
1380
1782
  xmlns: "http://www.w3.org/2000/svg",
1381
- children: [/* @__PURE__ */ M("path", {
1783
+ children: [/* @__PURE__ */ L("path", {
1382
1784
  d: "M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",
1383
1785
  fill: "currentColor"
1384
- }), /* @__PURE__ */ M("path", {
1786
+ }), /* @__PURE__ */ L("path", {
1385
1787
  d: "M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",
1386
1788
  fill: "currentFill"
1387
1789
  })]
1388
1790
  })
1389
- }), /* @__PURE__ */ M("iframe", {
1791
+ }), /* @__PURE__ */ L("iframe", {
1390
1792
  allow: "clipboard-read *; clipboard-write *",
1391
- src: b || void 0,
1392
- onLoad: y,
1393
- className: `payment-modal ${p === 0 || i ? "invisible" : "visible"}`,
1394
- "data-id": t,
1793
+ src: R || void 0,
1794
+ onLoad: E,
1795
+ className: `payment-modal ${m === 0 || i ? "invisible" : "visible"}`,
1796
+ "data-id": e,
1395
1797
  ref: f
1396
- }, t)]
1798
+ }, e)]
1397
1799
  });
1398
1800
  }
1399
- const sn = Symbol(), le = Symbol(), D = "a", pt = "f", xe = "p", gt = "c", mt = "t", fe = "h", O = "w", he = "o", de = "k";
1400
- let nn = (e, t) => new Proxy(e, t);
1401
- const se = Object.getPrototypeOf, ne = /* @__PURE__ */ new WeakMap(), yt = (e) => e && (ne.has(e) ? ne.get(e) : se(e) === Object.prototype || se(e) === Array.prototype), j = (e) => typeof e == "object" && e !== null, rn = (e) => Object.values(Object.getOwnPropertyDescriptors(e)).some((t) => !t.configurable && !t.writable), on = (e) => {
1402
- if (Array.isArray(e))
1403
- return Array.from(e);
1404
- const t = Object.getOwnPropertyDescriptors(e);
1405
- return Object.values(t).forEach((s) => {
1801
+ const Hs = Symbol(), fe = Symbol(), O = "a", ot = "f", ke = "p", it = "c", at = "t", he = "h", B = "w", ge = "o", me = "k";
1802
+ let $s = (t, e) => new Proxy(t, e);
1803
+ const re = Object.getPrototypeOf, oe = /* @__PURE__ */ new WeakMap(), ct = (t) => t && (oe.has(t) ? oe.get(t) : re(t) === Object.prototype || re(t) === Array.prototype), z = (t) => typeof t == "object" && t !== null, zs = (t) => Object.values(Object.getOwnPropertyDescriptors(t)).some((e) => !e.configurable && !e.writable), js = (t) => {
1804
+ if (Array.isArray(t))
1805
+ return Array.from(t);
1806
+ const e = Object.getOwnPropertyDescriptors(t);
1807
+ return Object.values(e).forEach((s) => {
1406
1808
  s.configurable = !0;
1407
- }), Object.create(se(e), t);
1408
- }, an = (e, t) => {
1809
+ }), Object.create(re(t), e);
1810
+ }, qs = (t, e) => {
1409
1811
  const s = {
1410
- [pt]: t
1812
+ [ot]: e
1411
1813
  };
1412
1814
  let n = !1;
1413
- const r = (a, c) => {
1815
+ const r = (a, u) => {
1414
1816
  if (!n) {
1415
- let u = s[D].get(e);
1416
- if (u || (u = {}, s[D].set(e, u)), a === O)
1417
- u[O] = !0;
1817
+ let l = s[O].get(t);
1818
+ if (l || (l = {}, s[O].set(t, l)), a === B)
1819
+ l[B] = !0;
1418
1820
  else {
1419
- let l = u[a];
1420
- l || (l = /* @__PURE__ */ new Set(), u[a] = l), l.add(c);
1821
+ let d = l[a];
1822
+ d || (d = /* @__PURE__ */ new Set(), l[a] = d), d.add(u);
1421
1823
  }
1422
1824
  }
1423
1825
  }, i = () => {
1424
- n = !0, s[D].delete(e);
1826
+ n = !0, s[O].delete(t);
1425
1827
  }, o = {
1426
- get(a, c) {
1427
- return c === le ? e : (r(de, c), wt(Reflect.get(a, c), s[D], s[gt], s[mt]));
1828
+ get(a, u) {
1829
+ return u === fe ? t : (r(me, u), ut(Reflect.get(a, u), s[O], s[it], s[at]));
1428
1830
  },
1429
- has(a, c) {
1430
- return c === sn ? (i(), !0) : (r(fe, c), Reflect.has(a, c));
1831
+ has(a, u) {
1832
+ return u === Hs ? (i(), !0) : (r(he, u), Reflect.has(a, u));
1431
1833
  },
1432
- getOwnPropertyDescriptor(a, c) {
1433
- return r(he, c), Reflect.getOwnPropertyDescriptor(a, c);
1834
+ getOwnPropertyDescriptor(a, u) {
1835
+ return r(ge, u), Reflect.getOwnPropertyDescriptor(a, u);
1434
1836
  },
1435
1837
  ownKeys(a) {
1436
- return r(O), Reflect.ownKeys(a);
1838
+ return r(B), Reflect.ownKeys(a);
1437
1839
  }
1438
1840
  };
1439
- return t && (o.set = o.deleteProperty = () => !1), [o, s];
1440
- }, pe = (e) => (
1841
+ return e && (o.set = o.deleteProperty = () => !1), [o, s];
1842
+ }, pe = (t) => (
1441
1843
  // unwrap proxy
1442
- e[le] || // otherwise
1443
- e
1444
- ), wt = (e, t, s, n) => {
1445
- if (!yt(e))
1446
- return e;
1447
- let r = n && n.get(e);
1844
+ t[fe] || // otherwise
1845
+ t
1846
+ ), ut = (t, e, s, n) => {
1847
+ if (!ct(t))
1848
+ return t;
1849
+ let r = n && n.get(t);
1448
1850
  if (!r) {
1449
- const c = pe(e);
1450
- rn(c) ? r = [c, on(c)] : r = [c], n?.set(e, r);
1851
+ const u = pe(t);
1852
+ zs(u) ? r = [u, js(u)] : r = [u], n?.set(t, r);
1451
1853
  }
1452
1854
  const [i, o] = r;
1453
1855
  let a = s && s.get(i);
1454
- return (!a || a[1][pt] !== !!o) && (a = an(i, !!o), a[1][xe] = nn(o || i, a[0]), s && s.set(i, a)), a[1][D] = t, a[1][gt] = s, a[1][mt] = n, a[1][xe];
1455
- }, cn = (e, t) => {
1456
- const s = Reflect.ownKeys(e), n = Reflect.ownKeys(t);
1856
+ return (!a || a[1][ot] !== !!o) && (a = qs(i, !!o), a[1][ke] = $s(o || i, a[0]), s && s.set(i, a)), a[1][O] = e, a[1][it] = s, a[1][at] = n, a[1][ke];
1857
+ }, Ks = (t, e) => {
1858
+ const s = Reflect.ownKeys(t), n = Reflect.ownKeys(e);
1457
1859
  return s.length !== n.length || s.some((r, i) => r !== n[i]);
1458
- }, bt = (e, t, s, n, r = Object.is) => {
1459
- if (r(e, t))
1860
+ }, lt = (t, e, s, n, r = Object.is) => {
1861
+ if (r(t, e))
1460
1862
  return !1;
1461
- if (!j(e) || !j(t))
1863
+ if (!z(t) || !z(e))
1462
1864
  return !0;
1463
- const i = s.get(pe(e));
1865
+ const i = s.get(pe(t));
1464
1866
  if (!i)
1465
1867
  return !0;
1466
1868
  if (n) {
1467
- if (n.get(e) === t)
1869
+ if (n.get(t) === e)
1468
1870
  return !1;
1469
- n.set(e, t);
1871
+ n.set(t, e);
1470
1872
  }
1471
1873
  let o = null;
1472
- for (const a of i[fe] || [])
1473
- if (o = Reflect.has(e, a) !== Reflect.has(t, a), o)
1874
+ for (const a of i[he] || [])
1875
+ if (o = Reflect.has(t, a) !== Reflect.has(e, a), o)
1474
1876
  return o;
1475
- if (i[O] === !0) {
1476
- if (o = cn(e, t), o)
1877
+ if (i[B] === !0) {
1878
+ if (o = Ks(t, e), o)
1477
1879
  return o;
1478
1880
  } else
1479
- for (const a of i[he] || []) {
1480
- const c = !!Reflect.getOwnPropertyDescriptor(e, a), u = !!Reflect.getOwnPropertyDescriptor(t, a);
1481
- if (o = c !== u, o)
1881
+ for (const a of i[ge] || []) {
1882
+ const u = !!Reflect.getOwnPropertyDescriptor(t, a), l = !!Reflect.getOwnPropertyDescriptor(e, a);
1883
+ if (o = u !== l, o)
1482
1884
  return o;
1483
1885
  }
1484
- for (const a of i[de] || [])
1485
- if (o = bt(e[a], t[a], s, n, r), o)
1886
+ for (const a of i[me] || [])
1887
+ if (o = lt(t[a], e[a], s, n, r), o)
1486
1888
  return o;
1487
1889
  if (o === null)
1488
1890
  throw new Error("invalid used");
1489
1891
  return o;
1490
- }, un = (e) => yt(e) && e[le] || null, ke = (e, t = !0) => {
1491
- ne.set(e, t);
1492
- }, ln = (e, t, s) => {
1892
+ }, Ws = (t) => ct(t) && t[fe] || null, xe = (t, e = !0) => {
1893
+ oe.set(t, e);
1894
+ }, Vs = (t, e, s) => {
1493
1895
  const n = [], r = /* @__PURE__ */ new WeakSet(), i = (o, a) => {
1494
- var c, u, l;
1896
+ var u, l, d;
1495
1897
  if (r.has(o))
1496
1898
  return;
1497
- j(o) && r.add(o);
1498
- const w = j(o) && t.get(pe(o));
1499
- if (w) {
1500
- if ((c = w[fe]) === null || c === void 0 || c.forEach((p) => {
1501
- const m = `:has(${String(p)})`;
1899
+ z(o) && r.add(o);
1900
+ const T = z(o) && e.get(pe(o));
1901
+ if (T) {
1902
+ if ((u = T[he]) === null || u === void 0 || u.forEach((m) => {
1903
+ const y = `:has(${String(m)})`;
1904
+ n.push(a ? [...a, y] : [y]);
1905
+ }), T[B] === !0) {
1906
+ const m = ":ownKeys";
1502
1907
  n.push(a ? [...a, m] : [m]);
1503
- }), w[O] === !0) {
1504
- const p = ":ownKeys";
1505
- n.push(a ? [...a, p] : [p]);
1506
1908
  } else
1507
- (u = w[he]) === null || u === void 0 || u.forEach((p) => {
1508
- const m = `:hasOwn(${String(p)})`;
1509
- n.push(a ? [...a, m] : [m]);
1909
+ (l = T[ge]) === null || l === void 0 || l.forEach((m) => {
1910
+ const y = `:hasOwn(${String(m)})`;
1911
+ n.push(a ? [...a, y] : [y]);
1510
1912
  });
1511
- (l = w[de]) === null || l === void 0 || l.forEach((p) => {
1512
- "value" in (Object.getOwnPropertyDescriptor(o, p) || {}) && i(o[p], a ? [...a, p] : [p]);
1913
+ (d = T[me]) === null || d === void 0 || d.forEach((m) => {
1914
+ "value" in (Object.getOwnPropertyDescriptor(o, m) || {}) && i(o[m], a ? [...a, m] : [m]);
1513
1915
  });
1514
1916
  } else a && n.push(a);
1515
1917
  };
1516
- return i(e), n;
1517
- }, q = {}, ge = (e) => typeof e == "object" && e !== null, fn = (e) => ge(e) && !me.has(e) && (Array.isArray(e) || !(Symbol.iterator in e)) && !(e instanceof WeakMap) && !(e instanceof WeakSet) && !(e instanceof Error) && !(e instanceof Number) && !(e instanceof Date) && !(e instanceof String) && !(e instanceof RegExp) && !(e instanceof ArrayBuffer) && !(e instanceof Promise), Et = (e, t) => {
1518
- const s = De.get(e);
1519
- if (s?.[0] === t)
1918
+ return i(t), n;
1919
+ }, j = {}, ye = (t) => typeof t == "object" && t !== null, Ys = (t) => ye(t) && !be.has(t) && (Array.isArray(t) || !(Symbol.iterator in t)) && !(t instanceof WeakMap) && !(t instanceof WeakSet) && !(t instanceof Error) && !(t instanceof Number) && !(t instanceof Date) && !(t instanceof String) && !(t instanceof RegExp) && !(t instanceof ArrayBuffer) && !(t instanceof Promise), dt = (t, e) => {
1920
+ const s = Ne.get(t);
1921
+ if (s?.[0] === e)
1520
1922
  return s[1];
1521
- const n = Array.isArray(e) ? [] : Object.create(Object.getPrototypeOf(e));
1522
- return ke(n, !0), De.set(e, [t, n]), Reflect.ownKeys(e).forEach((r) => {
1923
+ const n = Array.isArray(t) ? [] : Object.create(Object.getPrototypeOf(t));
1924
+ return xe(n, !0), Ne.set(t, [e, n]), Reflect.ownKeys(t).forEach((r) => {
1523
1925
  if (Object.getOwnPropertyDescriptor(n, r))
1524
1926
  return;
1525
- const i = Reflect.get(e, r), { enumerable: o } = Reflect.getOwnPropertyDescriptor(
1526
- e,
1927
+ const i = Reflect.get(t, r), { enumerable: o } = Reflect.getOwnPropertyDescriptor(
1928
+ t,
1527
1929
  r
1528
1930
  ), a = {
1529
1931
  value: i,
@@ -1532,17 +1934,17 @@ const se = Object.getPrototypeOf, ne = /* @__PURE__ */ new WeakMap(), yt = (e) =
1532
1934
  // It's still non-writable, so it avoids assigning a value.
1533
1935
  configurable: !0
1534
1936
  };
1535
- if (me.has(i))
1536
- ke(i, !1);
1537
- else if (U.has(i)) {
1538
- const [c, u] = U.get(
1937
+ if (be.has(i))
1938
+ xe(i, !1);
1939
+ else if (k.has(i)) {
1940
+ const [u, l] = k.get(
1539
1941
  i
1540
1942
  );
1541
- a.value = Et(c, u());
1943
+ a.value = dt(u, l());
1542
1944
  }
1543
1945
  Object.defineProperty(n, r, a);
1544
1946
  }), Object.preventExtensions(n);
1545
- }, hn = (e, t, s, n) => ({
1947
+ }, Gs = (t, e, s, n) => ({
1546
1948
  deleteProperty(r, i) {
1547
1949
  const o = Reflect.get(r, i);
1548
1950
  s(i);
@@ -1550,225 +1952,225 @@ const se = Object.getPrototypeOf, ne = /* @__PURE__ */ new WeakMap(), yt = (e) =
1550
1952
  return a && n(["delete", [i], o]), a;
1551
1953
  },
1552
1954
  set(r, i, o, a) {
1553
- const c = !e() && Reflect.has(r, i), u = Reflect.get(r, i, a);
1554
- if (c && (Oe(u, o) || _.has(o) && Oe(u, _.get(o))))
1955
+ const u = !t() && Reflect.has(r, i), l = Reflect.get(r, i, a);
1956
+ if (u && (Oe(l, o) || q.has(o) && Oe(l, q.get(o))))
1555
1957
  return !0;
1556
- s(i), ge(o) && (o = un(o) || o);
1557
- const l = !U.has(o) && pn(o) ? St(o) : o;
1558
- return t(i, l), Reflect.set(r, i, l, a), n(["set", [i], o, u]), !0;
1559
- }
1560
- }), U = /* @__PURE__ */ new WeakMap(), me = /* @__PURE__ */ new WeakSet(), De = /* @__PURE__ */ new WeakMap(), J = [1], _ = /* @__PURE__ */ new WeakMap();
1561
- let Oe = Object.is, dn = (e, t) => new Proxy(e, t), pn = fn, gn = Et, mn = hn;
1562
- function St(e = {}) {
1563
- if (!ge(e))
1958
+ s(i), ye(o) && (o = Ws(o) || o);
1959
+ const d = !k.has(o) && Js(o) ? ft(o) : o;
1960
+ return e(i, d), Reflect.set(r, i, d, a), n(["set", [i], o, l]), !0;
1961
+ }
1962
+ }), k = /* @__PURE__ */ new WeakMap(), be = /* @__PURE__ */ new WeakSet(), Ne = /* @__PURE__ */ new WeakMap(), Q = [1], q = /* @__PURE__ */ new WeakMap();
1963
+ let Oe = Object.is, Xs = (t, e) => new Proxy(t, e), Js = Ys, Zs = dt, Qs = Gs;
1964
+ function ft(t = {}) {
1965
+ if (!ye(t))
1564
1966
  throw new Error("object required");
1565
- const t = _.get(e);
1566
- if (t)
1567
- return t;
1568
- let s = J[0];
1569
- const n = /* @__PURE__ */ new Set(), r = (f, y = ++J[0]) => {
1570
- s !== y && (i = s = y, n.forEach((h) => h(f, y)));
1967
+ const e = q.get(t);
1968
+ if (e)
1969
+ return e;
1970
+ let s = Q[0];
1971
+ const n = /* @__PURE__ */ new Set(), r = (f, E = ++Q[0]) => {
1972
+ s !== E && (i = s = E, n.forEach((h) => h(f, E)));
1571
1973
  };
1572
1974
  let i = s;
1573
- const o = (f = J[0]) => (i !== f && (i = f, c.forEach(([y]) => {
1574
- const h = y[1](f);
1975
+ const o = (f = Q[0]) => (i !== f && (i = f, u.forEach(([E]) => {
1976
+ const h = E[1](f);
1575
1977
  h > s && (s = h);
1576
- })), s), a = (f) => (y, h) => {
1577
- const E = [...y];
1578
- E[1] = [f, ...E[1]], r(E, h);
1579
- }, c = /* @__PURE__ */ new Map(), u = (f, y) => {
1580
- const h = !me.has(y) && U.get(y);
1978
+ })), s), a = (f) => (E, h) => {
1979
+ const C = [...E];
1980
+ C[1] = [f, ...C[1]], r(C, h);
1981
+ }, u = /* @__PURE__ */ new Map(), l = (f, E) => {
1982
+ const h = !be.has(E) && k.get(E);
1581
1983
  if (h) {
1582
- if ((q ? "production" : void 0) !== "production" && c.has(f))
1984
+ if ((j ? "production" : void 0) !== "production" && u.has(f))
1583
1985
  throw new Error("prop listener already exists");
1584
1986
  if (n.size) {
1585
- const E = h[2](a(f));
1586
- c.set(f, [h, E]);
1987
+ const C = h[2](a(f));
1988
+ u.set(f, [h, C]);
1587
1989
  } else
1588
- c.set(f, [h]);
1990
+ u.set(f, [h]);
1589
1991
  }
1590
- }, l = (f) => {
1591
- var y;
1592
- const h = c.get(f);
1593
- h && (c.delete(f), (y = h[1]) == null || y.call(h));
1594
- }, w = (f) => (n.add(f), n.size === 1 && c.forEach(([h, E], P) => {
1595
- if ((q ? "production" : void 0) !== "production" && E)
1992
+ }, d = (f) => {
1993
+ var E;
1994
+ const h = u.get(f);
1995
+ h && (u.delete(f), (E = h[1]) == null || E.call(h));
1996
+ }, T = (f) => (n.add(f), n.size === 1 && u.forEach(([h, C], I) => {
1997
+ if ((j ? "production" : void 0) !== "production" && C)
1596
1998
  throw new Error("remove already exists");
1597
- const Tt = h[2](a(P));
1598
- c.set(P, [h, Tt]);
1999
+ const ht = h[2](a(I));
2000
+ u.set(I, [h, ht]);
1599
2001
  }), () => {
1600
- n.delete(f), n.size === 0 && c.forEach(([h, E], P) => {
1601
- E && (E(), c.set(P, [h]));
2002
+ n.delete(f), n.size === 0 && u.forEach(([h, C], I) => {
2003
+ C && (C(), u.set(I, [h]));
1602
2004
  });
1603
2005
  });
1604
- let p = !0;
1605
- const m = mn(
1606
- () => p,
1607
- u,
2006
+ let m = !0;
2007
+ const y = Qs(
2008
+ () => m,
1608
2009
  l,
2010
+ d,
1609
2011
  r
1610
- ), b = dn(e, m);
1611
- _.set(e, b);
1612
- const H = [e, o, w];
1613
- return U.set(b, H), Reflect.ownKeys(e).forEach((f) => {
1614
- const y = Object.getOwnPropertyDescriptor(
1615
- e,
2012
+ ), R = Xs(t, y);
2013
+ q.set(t, R);
2014
+ const W = [t, o, T];
2015
+ return k.set(R, W), Reflect.ownKeys(t).forEach((f) => {
2016
+ const E = Object.getOwnPropertyDescriptor(
2017
+ t,
1616
2018
  f
1617
2019
  );
1618
- "value" in y && y.writable && (b[f] = e[f]);
1619
- }), p = !1, b;
2020
+ "value" in E && E.writable && (R[f] = t[f]);
2021
+ }), m = !1, R;
1620
2022
  }
1621
- function yn(e, t, s) {
1622
- const n = U.get(e);
1623
- (q ? "production" : void 0) !== "production" && !n && console.warn("Please use proxy object");
2023
+ function en(t, e, s) {
2024
+ const n = k.get(t);
2025
+ (j ? "production" : void 0) !== "production" && !n && console.warn("Please use proxy object");
1624
2026
  let r;
1625
2027
  const i = [], o = n[2];
1626
2028
  let a = !1;
1627
- const u = o((l) => {
1628
- i.push(l), r || (r = Promise.resolve().then(() => {
1629
- r = void 0, a && t(i.splice(0));
2029
+ const l = o((d) => {
2030
+ i.push(d), r || (r = Promise.resolve().then(() => {
2031
+ r = void 0, a && e(i.splice(0));
1630
2032
  }));
1631
2033
  });
1632
2034
  return a = !0, () => {
1633
- a = !1, u();
2035
+ a = !1, l();
1634
2036
  };
1635
2037
  }
1636
- function Ne(e) {
1637
- const t = U.get(e);
1638
- (q ? "production" : void 0) !== "production" && !t && console.warn("Please use proxy object");
1639
- const [s, n] = t;
1640
- return gn(s, n());
2038
+ function Be(t) {
2039
+ const e = k.get(t);
2040
+ (j ? "production" : void 0) !== "production" && !e && console.warn("Please use proxy object");
2041
+ const [s, n] = e;
2042
+ return Zs(s, n());
1641
2043
  }
1642
- const wn = {}, bn = (e, t) => {
1643
- const s = re(void 0);
2044
+ const tn = {}, sn = (t, e) => {
2045
+ const s = ie(void 0);
1644
2046
  x(() => {
1645
- s.current = ln(e, t);
1646
- }), Pt(s.current);
1647
- }, En = bn, Sn = /* @__PURE__ */ new WeakMap();
1648
- function Tn(e, t) {
1649
- const n = ye(
1650
- () => e && /* @__PURE__ */ new WeakMap(),
1651
- [e]
1652
- ), r = re(void 0);
2047
+ s.current = Vs(t, e);
2048
+ }), yt(s.current);
2049
+ }, nn = sn, rn = /* @__PURE__ */ new WeakMap();
2050
+ function on(t, e) {
2051
+ const n = Ee(
2052
+ () => t && /* @__PURE__ */ new WeakMap(),
2053
+ [t]
2054
+ ), r = ie(void 0);
1653
2055
  let i = !0;
1654
- const o = Rt(
1655
- At(
1656
- (c) => {
1657
- const u = yn(e, c);
1658
- return c(), u;
2056
+ const o = gt(
2057
+ mt(
2058
+ (u) => {
2059
+ const l = en(t, u);
2060
+ return u(), l;
1659
2061
  },
1660
- [e, void 0]
2062
+ [t, void 0]
1661
2063
  ),
1662
2064
  () => {
1663
- const c = Ne(e);
2065
+ const u = Be(t);
1664
2066
  try {
1665
- if (!i && r.current && !bt(
2067
+ if (!i && r.current && !lt(
1666
2068
  r.current,
1667
- c,
2069
+ u,
1668
2070
  n,
1669
2071
  /* @__PURE__ */ new WeakMap()
1670
2072
  ))
1671
2073
  return r.current;
1672
2074
  } catch {
1673
2075
  }
1674
- return c;
2076
+ return u;
1675
2077
  },
1676
- () => Ne(e)
2078
+ () => Be(t)
1677
2079
  );
1678
- i = !1, vt(() => {
2080
+ i = !1, pt(() => {
1679
2081
  r.current = o;
1680
- }), (wn ? "production" : void 0) !== "production" && En(o, n);
1681
- const a = ye(() => /* @__PURE__ */ new WeakMap(), []);
1682
- return wt(o, n, a, Sn);
2082
+ }), (tn ? "production" : void 0) !== "production" && nn(o, n);
2083
+ const a = Ee(() => /* @__PURE__ */ new WeakMap(), []);
2084
+ return ut(o, n, a, rn);
1683
2085
  }
1684
- const A = St({
2086
+ const D = ft({
1685
2087
  data: null,
1686
2088
  isPending: !1,
1687
2089
  error: null
1688
2090
  });
1689
- function In({
1690
- session_url: e,
1691
- onCancel: t,
2091
+ function fn({
2092
+ session_url: t,
2093
+ onCancel: e,
1692
2094
  onSuccess: s
1693
2095
  }) {
1694
- const n = Tn(A), [r, i] = C(!1), [o, a] = C(Date.now()), c = n?.data?.sessionToken, u = n?.data?.amount;
1695
- function l() {
1696
- c || window.setTimeout(() => {
1697
- c && i(!0);
2096
+ const n = on(D), [r, i] = v(!1), [o, a] = v(Date.now()), u = n?.data?.sessionToken, l = n?.data?.amount;
2097
+ function d() {
2098
+ u || window.setTimeout(() => {
2099
+ u && i(!0);
1698
2100
  }, 200), i(!0);
1699
2101
  }
1700
- function w() {
2102
+ function T() {
1701
2103
  i(!1);
1702
2104
  }
1703
- const p = () => {
1704
- const m = Date.now();
1705
- A.isPending = !0, A.error = null, A.data = null, fetch(e, {
2105
+ const m = () => {
2106
+ const y = Date.now();
2107
+ D.isPending = !0, D.error = null, D.data = null, fetch(t, {
1706
2108
  headers: {
1707
2109
  "Content-Type": "application/json"
1708
2110
  }
1709
- }).then((b) => b.json()).then((b) => {
1710
- m < o || (A.data = b, A.isPending = !1, a(m));
1711
- }).catch((b) => {
1712
- m < o || (A.error = b?.toString(), A.isPending = !1, a(m), setInterval(p, 5e3));
2111
+ }).then((R) => R.json()).then((R) => {
2112
+ y < o || (D.data = R, D.isPending = !1, a(y));
2113
+ }).catch((R) => {
2114
+ y < o || (D.error = R?.toString(), D.isPending = !1, a(y), setInterval(m, 5e3));
1713
2115
  });
1714
2116
  };
1715
2117
  return x(() => {
1716
- p();
1717
- }, [e]), {
1718
- sessionToken: c,
1719
- amount: u,
2118
+ m();
2119
+ }, [t]), {
2120
+ sessionToken: u,
2121
+ amount: l,
1720
2122
  isOpen: r,
1721
- session_url: e,
1722
- open: l,
1723
- close: w,
2123
+ session_url: t,
2124
+ open: d,
2125
+ close: T,
1724
2126
  isPending: n.isPending,
1725
2127
  error: n.error,
1726
- refetch: p,
2128
+ refetch: m,
1727
2129
  onSuccess: s,
1728
- onCancel: t
2130
+ onCancel: e
1729
2131
  };
1730
2132
  }
1731
- function Cn({
1732
- sessionToken: e,
1733
- amount: t,
2133
+ function hn({
2134
+ sessionToken: t,
2135
+ amount: e,
1734
2136
  onCancel: s,
1735
2137
  onSuccess: n
1736
2138
  }) {
1737
- const [r, i] = C(!1), [o, a] = C(e), [c, u] = C(t);
1738
- function l({
1739
- sessionToken: m,
1740
- amount: b
2139
+ const [r, i] = v(!1), [o, a] = v(t), [u, l] = v(e);
2140
+ function d({
2141
+ sessionToken: y,
2142
+ amount: R
1741
2143
  }) {
1742
- a(m), u(b);
2144
+ a(y), l(R);
1743
2145
  }
1744
2146
  x(() => {
1745
- a(e);
1746
- }, [e]);
1747
- function w() {
2147
+ a(t);
2148
+ }, [t]);
2149
+ function T() {
1748
2150
  o || window.setTimeout(() => {
1749
2151
  o && i(!0);
1750
2152
  }, 200), i(!0);
1751
2153
  }
1752
- function p() {
2154
+ function m() {
1753
2155
  i(!1);
1754
2156
  }
1755
2157
  return {
1756
2158
  sessionToken: o,
1757
- updateSession: l,
1758
- amount: c,
2159
+ updateSession: d,
2160
+ amount: u,
1759
2161
  isOpen: r,
1760
- open: w,
1761
- close: p,
2162
+ open: T,
2163
+ close: m,
1762
2164
  onSuccess: n,
1763
2165
  onCancel: s
1764
2166
  };
1765
2167
  }
1766
2168
  export {
1767
- d as Chainrails,
1768
- Pn as PaymentModal,
1769
- ee as chains,
1770
- vn as crapi,
1771
- ht as tokens,
1772
- Cn as usePaymentModal,
1773
- In as usePaymentSession
2169
+ c as AmountSymbols,
2170
+ g as Chainrails,
2171
+ un as Chains,
2172
+ dn as PaymentModal,
2173
+ ln as crapi,
2174
+ hn as usePaymentModal,
2175
+ fn as usePaymentSession
1774
2176
  };