@chainrails/react 0.0.30 → 0.0.31
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,5 +1,5 @@
|
|
|
1
1
|
import { useState as le, useRef as W, useEffect as F, useMemo as te, useSyncExternalStore as ke, useCallback as Ne, useLayoutEffect as qe, useDebugValue as _e } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { jsx as S, Fragment as Ue, jsxs as se } from "react/jsx-runtime";
|
|
3
3
|
import './index.css';class D extends Error {
|
|
4
4
|
response;
|
|
5
5
|
request;
|
|
@@ -50,7 +50,7 @@ const re = (() => {
|
|
|
50
50
|
throw n;
|
|
51
51
|
}
|
|
52
52
|
return t && !e;
|
|
53
|
-
})(),
|
|
53
|
+
})(), je = typeof globalThis.AbortController == "function", he = typeof globalThis.AbortSignal == "function" && typeof globalThis.AbortSignal.any == "function", Me = typeof globalThis.ReadableStream == "function", xe = typeof globalThis.FormData == "function", de = ["get", "post", "put", "patch", "head", "delete"], Le = {
|
|
54
54
|
json: "application/json",
|
|
55
55
|
text: "text/*",
|
|
56
56
|
formData: "multipart/form-data",
|
|
@@ -59,14 +59,14 @@ const re = (() => {
|
|
|
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
|
-
}, x = 2147483647,
|
|
62
|
+
}, x = 2147483647, De = new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length, pe = Symbol("stop");
|
|
63
63
|
class ye {
|
|
64
64
|
options;
|
|
65
65
|
constructor(e) {
|
|
66
66
|
this.options = e;
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
|
-
const
|
|
69
|
+
const Ie = (t) => new ye(t), Be = {
|
|
70
70
|
json: !0,
|
|
71
71
|
parseJson: !0,
|
|
72
72
|
stringifyJson: !0,
|
|
@@ -80,10 +80,10 @@ const De = (t) => new ye(t), Ie = {
|
|
|
80
80
|
onUploadProgress: !0,
|
|
81
81
|
fetch: !0,
|
|
82
82
|
context: !0
|
|
83
|
-
},
|
|
83
|
+
}, He = {
|
|
84
84
|
next: !0
|
|
85
85
|
// Next.js cache revalidation (revalidate, tags)
|
|
86
|
-
},
|
|
86
|
+
}, Ke = {
|
|
87
87
|
method: !0,
|
|
88
88
|
headers: !0,
|
|
89
89
|
body: !0,
|
|
@@ -98,13 +98,13 @@ const De = (t) => new ye(t), Ie = {
|
|
|
98
98
|
signal: !0,
|
|
99
99
|
window: !0,
|
|
100
100
|
duplex: !0
|
|
101
|
-
},
|
|
101
|
+
}, $e = (t) => {
|
|
102
102
|
if (!t)
|
|
103
103
|
return 0;
|
|
104
104
|
if (t instanceof FormData) {
|
|
105
105
|
let e = 0;
|
|
106
106
|
for (const [s, r] of t)
|
|
107
|
-
e +=
|
|
107
|
+
e += De, e += new TextEncoder().encode(`Content-Disposition: form-data; name="${s}"`).length, e += typeof r == "string" ? new TextEncoder().encode(r).length : r.size;
|
|
108
108
|
return e;
|
|
109
109
|
}
|
|
110
110
|
if (t instanceof Blob)
|
|
@@ -140,7 +140,7 @@ const De = (t) => new ye(t), Ie = {
|
|
|
140
140
|
r && (n += r.byteLength, s?.({ percent: 1, totalBytes: Math.max(e, n), transferredBytes: n }, r));
|
|
141
141
|
}
|
|
142
142
|
}));
|
|
143
|
-
},
|
|
143
|
+
}, We = (t, e) => {
|
|
144
144
|
if (!t.body)
|
|
145
145
|
return t;
|
|
146
146
|
if (t.status === 204)
|
|
@@ -155,10 +155,10 @@ const De = (t) => new ye(t), Ie = {
|
|
|
155
155
|
statusText: t.statusText,
|
|
156
156
|
headers: t.headers
|
|
157
157
|
});
|
|
158
|
-
},
|
|
158
|
+
}, Fe = (t, e, s) => {
|
|
159
159
|
if (!t.body)
|
|
160
160
|
return t;
|
|
161
|
-
const r =
|
|
161
|
+
const r = $e(s ?? t.body);
|
|
162
162
|
return new Request(t, {
|
|
163
163
|
// @ts-expect-error - Types are outdated.
|
|
164
164
|
duplex: "half",
|
|
@@ -183,7 +183,7 @@ const we = (t = {}, e = {}) => ({
|
|
|
183
183
|
beforeRetry: q(t, e, "beforeRetry"),
|
|
184
184
|
afterResponse: q(t, e, "afterResponse"),
|
|
185
185
|
beforeError: q(t, e, "beforeError")
|
|
186
|
-
}),
|
|
186
|
+
}), Ye = (t, e) => {
|
|
187
187
|
const s = new URLSearchParams();
|
|
188
188
|
for (const r of [t, e])
|
|
189
189
|
if (r !== void 0)
|
|
@@ -227,7 +227,7 @@ const we = (t = {}, e = {}) => ({
|
|
|
227
227
|
continue;
|
|
228
228
|
}
|
|
229
229
|
if (a === "searchParams") {
|
|
230
|
-
c == null ? n = void 0 : n = n === void 0 ? c :
|
|
230
|
+
c == null ? n = void 0 : n = n === void 0 ? c : Ye(n, c);
|
|
231
231
|
continue;
|
|
232
232
|
}
|
|
233
233
|
b(c) && a in e && (c = Y(e[a], c)), e = { ...e, [a]: c };
|
|
@@ -235,17 +235,17 @@ const we = (t = {}, e = {}) => ({
|
|
|
235
235
|
b(o.hooks) && (r = we(r, o.hooks), e.hooks = r), b(o.headers) && (s = me(s, o.headers), e.headers = s);
|
|
236
236
|
}
|
|
237
237
|
return n !== void 0 && (e.searchParams = n), i.length > 0 && (i.length === 1 ? e.signal = i[0] : he ? e.signal = AbortSignal.any(i) : e.signal = i.at(-1)), e.context === void 0 && (e.context = {}), e;
|
|
238
|
-
},
|
|
238
|
+
}, ze = (t) => de.includes(t) ? t.toUpperCase() : t, Ve = ["get", "put", "head", "delete", "options", "trace"], Je = [408, 413, 429, 500, 502, 503, 504], Ge = [413, 429, 503], ne = {
|
|
239
239
|
limit: 2,
|
|
240
|
-
methods:
|
|
241
|
-
statusCodes:
|
|
242
|
-
afterStatusCodes:
|
|
240
|
+
methods: Ve,
|
|
241
|
+
statusCodes: Je,
|
|
242
|
+
afterStatusCodes: Ge,
|
|
243
243
|
maxRetryAfter: Number.POSITIVE_INFINITY,
|
|
244
244
|
backoffLimit: Number.POSITIVE_INFINITY,
|
|
245
245
|
delay: (t) => 0.3 * 2 ** (t - 1) * 1e3,
|
|
246
246
|
jitter: void 0,
|
|
247
247
|
retryOnTimeout: !1
|
|
248
|
-
},
|
|
248
|
+
}, Xe = (t = {}) => {
|
|
249
249
|
if (typeof t == "number")
|
|
250
250
|
return {
|
|
251
251
|
...ne,
|
|
@@ -266,7 +266,7 @@ class I extends Error {
|
|
|
266
266
|
super(`Request timed out: ${e.method} ${e.url}`), this.name = "TimeoutError", this.request = e;
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
|
-
async function
|
|
269
|
+
async function Ze(t, e, s, r) {
|
|
270
270
|
return new Promise((n, i) => {
|
|
271
271
|
const o = setTimeout(() => {
|
|
272
272
|
s && s.abort(), i(new I(t));
|
|
@@ -276,7 +276,7 @@ async function Xe(t, e, s, r) {
|
|
|
276
276
|
});
|
|
277
277
|
});
|
|
278
278
|
}
|
|
279
|
-
async function
|
|
279
|
+
async function Qe(t, { signal: e }) {
|
|
280
280
|
return new Promise((s, r) => {
|
|
281
281
|
e && (e.throwIfAborted(), e.addEventListener("abort", n, { once: !0 }));
|
|
282
282
|
function n() {
|
|
@@ -287,21 +287,21 @@ async function Ze(t, { signal: e }) {
|
|
|
287
287
|
}, t);
|
|
288
288
|
});
|
|
289
289
|
}
|
|
290
|
-
const
|
|
290
|
+
const et = (t, e) => {
|
|
291
291
|
const s = {};
|
|
292
292
|
for (const r in e)
|
|
293
|
-
Object.hasOwn(e, r) && !(r in
|
|
293
|
+
Object.hasOwn(e, r) && !(r in Ke) && !(r in Be) && (!(r in t) || r in He) && (s[r] = e[r]);
|
|
294
294
|
return s;
|
|
295
|
-
},
|
|
296
|
-
function
|
|
295
|
+
}, tt = (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 st(t) {
|
|
297
297
|
return t instanceof D || t?.name === D.name;
|
|
298
298
|
}
|
|
299
|
-
function
|
|
299
|
+
function rt(t) {
|
|
300
300
|
return t instanceof I || t?.name === I.name;
|
|
301
301
|
}
|
|
302
|
-
class
|
|
302
|
+
class O {
|
|
303
303
|
static create(e, s) {
|
|
304
|
-
const r = new
|
|
304
|
+
const r = new O(e, s), n = async () => {
|
|
305
305
|
if (typeof r.#e.timeout == "number" && r.#e.timeout > x)
|
|
306
306
|
throw new RangeError(`The \`timeout\` option cannot be greater than ${x}`);
|
|
307
307
|
await Promise.resolve();
|
|
@@ -323,16 +323,16 @@ class v {
|
|
|
323
323
|
if (r.#e.onDownloadProgress) {
|
|
324
324
|
if (typeof r.#e.onDownloadProgress != "function")
|
|
325
325
|
throw new TypeError("The `onDownloadProgress` option must be a function");
|
|
326
|
-
if (!
|
|
326
|
+
if (!Me)
|
|
327
327
|
throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");
|
|
328
|
-
return
|
|
328
|
+
return We(o.clone(), r.#e.onDownloadProgress);
|
|
329
329
|
}
|
|
330
330
|
return o;
|
|
331
331
|
}, i = r.#f(n).finally(async () => {
|
|
332
332
|
const o = r.#o, a = [];
|
|
333
333
|
o && !o.bodyUsed && a.push(o.body?.cancel()), r.request.bodyUsed || a.push(r.request.body?.cancel()), await Promise.all(a);
|
|
334
334
|
});
|
|
335
|
-
for (const [o, a] of Object.entries(
|
|
335
|
+
for (const [o, a] of Object.entries(Le))
|
|
336
336
|
o === "bytes" && typeof globalThis.Response?.prototype?.bytes != "function" || (i[o] = async () => {
|
|
337
337
|
r.request.headers.set("accept", r.request.headers.get("accept") || a);
|
|
338
338
|
const c = await i;
|
|
@@ -370,10 +370,10 @@ class v {
|
|
|
370
370
|
beforeError: [],
|
|
371
371
|
afterResponse: []
|
|
372
372
|
}, s.hooks),
|
|
373
|
-
method:
|
|
373
|
+
method: ze(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:
|
|
376
|
+
retry: Xe(s.retry),
|
|
377
377
|
throwHttpErrors: s.throwHttpErrors ?? !0,
|
|
378
378
|
timeout: s.timeout ?? 1e4,
|
|
379
379
|
fetch: s.fetch ?? globalThis.fetch.bind(globalThis),
|
|
@@ -385,10 +385,10 @@ class v {
|
|
|
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
|
-
|
|
388
|
+
je && he && (this.#n = this.#e.signal ?? this.#t.signal, this.#r = new globalThis.AbortController(), this.#e.signal = this.#n ? AbortSignal.any([this.#n, this.#r.signal]) : this.#r.signal), re && (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 r = s.headers && new globalThis.Headers(s.headers).has("content-type");
|
|
390
|
-
if (this.#t instanceof globalThis.Request && (
|
|
391
|
-
const i = "?" + (typeof this.#e.searchParams == "string" ? this.#e.searchParams.replace(/^\?/, "") : new URLSearchParams(
|
|
390
|
+
if (this.#t instanceof globalThis.Request && (xe && this.#e.body instanceof globalThis.FormData || this.#e.body instanceof URLSearchParams) && !r && this.#e.headers.delete("content-type"), this.request = new globalThis.Request(this.#t, this.#e), tt(this.#e.searchParams)) {
|
|
391
|
+
const i = "?" + (typeof this.#e.searchParams == "string" ? this.#e.searchParams.replace(/^\?/, "") : new URLSearchParams(O.#d(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) {
|
|
@@ -419,9 +419,9 @@ class v {
|
|
|
419
419
|
if (r === !0)
|
|
420
420
|
return this.#c();
|
|
421
421
|
}
|
|
422
|
-
if (
|
|
422
|
+
if (rt(e) && !this.#e.retry.retryOnTimeout)
|
|
423
423
|
throw e;
|
|
424
|
-
if (
|
|
424
|
+
if (st(e)) {
|
|
425
425
|
if (!this.#e.retry.statusCodes.includes(e.response.status))
|
|
426
426
|
throw e;
|
|
427
427
|
const r = 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");
|
|
@@ -446,7 +446,7 @@ class v {
|
|
|
446
446
|
const r = Math.min(await this.#p(s), x);
|
|
447
447
|
if (this.#s < 1)
|
|
448
448
|
throw s;
|
|
449
|
-
if (await
|
|
449
|
+
if (await Qe(r, this.#n ? { signal: this.#n } : {}), s instanceof M && s.customRequest) {
|
|
450
450
|
const n = this.#e.signal ? new globalThis.Request(s.customRequest, { signal: this.#e.signal }) : new globalThis.Request(s.customRequest);
|
|
451
451
|
this.#u(n);
|
|
452
452
|
}
|
|
@@ -480,8 +480,8 @@ class v {
|
|
|
480
480
|
break;
|
|
481
481
|
}
|
|
482
482
|
}
|
|
483
|
-
const e =
|
|
484
|
-
return this.#o = this.request, this.request = this.#o.clone(), this.#e.timeout === !1 ? this.#e.fetch(this.#o, e) :
|
|
483
|
+
const e = et(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) : Ze(this.#o, e, this.#r, this.#e);
|
|
485
485
|
}
|
|
486
486
|
#a() {
|
|
487
487
|
if (!this.#i) {
|
|
@@ -494,17 +494,17 @@ class v {
|
|
|
494
494
|
this.#i = void 0, this.request = this.#h(e);
|
|
495
495
|
}
|
|
496
496
|
#h(e, s) {
|
|
497
|
-
return !this.#e.onUploadProgress || !e.body ? e :
|
|
497
|
+
return !this.#e.onUploadProgress || !e.body ? e : Fe(e, this.#e.onUploadProgress, s ?? this.#e.body ?? void 0);
|
|
498
498
|
}
|
|
499
499
|
}
|
|
500
500
|
/*! MIT License © Sindre Sorhus */
|
|
501
501
|
const B = (t) => {
|
|
502
|
-
const e = (s, r) =>
|
|
502
|
+
const e = (s, r) => O.create(s, N(t, r));
|
|
503
503
|
for (const s of de)
|
|
504
|
-
e[s] = (r, n) =>
|
|
505
|
-
return e.create = (s) => B(N(s)), e.extend = (s) => (typeof s == "function" && (s = s(t ?? {})), B(N(t, s))), e.stop = pe, e.retry =
|
|
506
|
-
},
|
|
507
|
-
var
|
|
504
|
+
e[s] = (r, n) => O.create(r, N(t, n, { method: s }));
|
|
505
|
+
return e.create = (s) => B(N(s)), e.extend = (s) => (typeof s == "function" && (s = s(t ?? {})), B(N(t, s))), e.stop = pe, e.retry = Ie, e;
|
|
506
|
+
}, nt = B();
|
|
507
|
+
var ot = /* @__PURE__ */ ((t) => (t.ARBITRUM = "ARBITRUM_MAINNET", t.ARBITRUM_TESTNET = "ARBITRUM_TESTNET", t.AVALANCHE = "AVALANCHE_MAINNET", t.AVALANCHE_TESTNET = "AVALANCHE_TESTNET", t.BASE = "BASE_MAINNET", t.BASE_TESTNET = "BASE_TESTNET", t.BSC = "BSC_MAINNET", t.ETHEREUM = "ETHEREUM_MAINNET", t.ETHEREUM_TESTNET = "ETHEREUM_TESTNET", t.STARKNET = "STARKNET_MAINNET", t))(ot || {}), it = /* @__PURE__ */ ((t) => (t.USDC = "USDC", t))(it || {}), z = /* @__PURE__ */ ((t) => (t.PRODUCTION = "production", t.STAGING = "staging", t))(z || {});
|
|
508
508
|
class h {
|
|
509
509
|
constructor({ api_key: e, env: s }) {
|
|
510
510
|
this.api_key = e, this.jwt = "", this.env = s ?? z.PRODUCTION;
|
|
@@ -567,8 +567,8 @@ class h {
|
|
|
567
567
|
}
|
|
568
568
|
}
|
|
569
569
|
let H = null;
|
|
570
|
-
function
|
|
571
|
-
H =
|
|
570
|
+
function at() {
|
|
571
|
+
H = nt.create({
|
|
572
572
|
prefixUrl: h.getBaseUrl(),
|
|
573
573
|
headers: {
|
|
574
574
|
"Content-Type": "application/json"
|
|
@@ -588,9 +588,9 @@ function it() {
|
|
|
588
588
|
});
|
|
589
589
|
}
|
|
590
590
|
function y() {
|
|
591
|
-
return H ||
|
|
591
|
+
return H || at(), H;
|
|
592
592
|
}
|
|
593
|
-
class
|
|
593
|
+
class ct {
|
|
594
594
|
async getById(e) {
|
|
595
595
|
return await y().get("intents/" + e).json();
|
|
596
596
|
}
|
|
@@ -613,7 +613,7 @@ class at {
|
|
|
613
613
|
return await y().post(`intents/${e}/trigger-processing`).json();
|
|
614
614
|
}
|
|
615
615
|
}
|
|
616
|
-
class
|
|
616
|
+
class ut {
|
|
617
617
|
async getFromSpecificBridge(e) {
|
|
618
618
|
return await y().get("quotes/single", { searchParams: e }).json();
|
|
619
619
|
}
|
|
@@ -627,7 +627,7 @@ class ct {
|
|
|
627
627
|
return await y().get("quotes/multi-source", { searchParams: e }).json();
|
|
628
628
|
}
|
|
629
629
|
}
|
|
630
|
-
class
|
|
630
|
+
class lt {
|
|
631
631
|
async getOptimalRoutes(e) {
|
|
632
632
|
return await y().get("router/optimal-route", { searchParams: e }).json();
|
|
633
633
|
}
|
|
@@ -641,22 +641,22 @@ class ut {
|
|
|
641
641
|
return await y().get("router/supported-bridges/bridge/" + e, { searchParams: s }).json();
|
|
642
642
|
}
|
|
643
643
|
}
|
|
644
|
-
class
|
|
644
|
+
class ft {
|
|
645
645
|
async getSupported(e) {
|
|
646
646
|
return await y().get("chains", { searchParams: e }).json();
|
|
647
647
|
}
|
|
648
648
|
}
|
|
649
|
-
class
|
|
649
|
+
class ht {
|
|
650
650
|
async getClientInfo() {
|
|
651
651
|
return await y().get("client/auth/client-info").json();
|
|
652
652
|
}
|
|
653
653
|
}
|
|
654
|
-
const
|
|
655
|
-
router: new
|
|
656
|
-
quotes: new
|
|
657
|
-
intents: new
|
|
658
|
-
chains: new
|
|
659
|
-
client: new
|
|
654
|
+
const xt = {
|
|
655
|
+
router: new lt(),
|
|
656
|
+
quotes: new ut(),
|
|
657
|
+
intents: new ct(),
|
|
658
|
+
chains: new ft(),
|
|
659
|
+
client: new ht()
|
|
660
660
|
};
|
|
661
661
|
function Te(t) {
|
|
662
662
|
var e, s, r = "";
|
|
@@ -667,11 +667,11 @@ function Te(t) {
|
|
|
667
667
|
} else for (s in t) t[s] && (r && (r += " "), r += s);
|
|
668
668
|
return r;
|
|
669
669
|
}
|
|
670
|
-
function
|
|
670
|
+
function dt() {
|
|
671
671
|
for (var t, e, s = 0, r = "", n = arguments.length; s < n; s++) (t = arguments[s]) && (e = Te(t)) && (r && (r += " "), r += e);
|
|
672
672
|
return r;
|
|
673
673
|
}
|
|
674
|
-
function
|
|
674
|
+
function Lt(t) {
|
|
675
675
|
const {
|
|
676
676
|
to: e,
|
|
677
677
|
token: s,
|
|
@@ -685,7 +685,7 @@ function xt(t) {
|
|
|
685
685
|
session_token: p
|
|
686
686
|
} = t, [m, g] = le(!0), w = W(null);
|
|
687
687
|
F(() => {
|
|
688
|
-
|
|
688
|
+
C();
|
|
689
689
|
const l = document.body.style.overflow;
|
|
690
690
|
i ? (document.body.style.overflow = "hidden", document.body.style.overflow = "hidden") : document.body.style.overflow = l || "";
|
|
691
691
|
const d = (f) => {
|
|
@@ -696,9 +696,9 @@ function xt(t) {
|
|
|
696
696
|
};
|
|
697
697
|
}, [i, c, u]);
|
|
698
698
|
function P() {
|
|
699
|
-
g(!1),
|
|
699
|
+
g(!1), C();
|
|
700
700
|
}
|
|
701
|
-
function
|
|
701
|
+
function C() {
|
|
702
702
|
if (!p) return;
|
|
703
703
|
const l = {
|
|
704
704
|
type: "session",
|
|
@@ -707,74 +707,73 @@ function xt(t) {
|
|
|
707
707
|
};
|
|
708
708
|
w.current?.contentWindow?.postMessage(l, "https://app.chainrails.io"), w.current?.contentWindow?.postMessage(l, "https://chainrails-frontend-git-staging-horus-labs.vercel.app");
|
|
709
709
|
}
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
});
|
|
710
|
+
return p ? /* @__PURE__ */ se("div", {
|
|
711
|
+
className: dt("payment-modal-wrapper", m ? "loading" : "not-loading", i ? "open" : "closed"),
|
|
712
|
+
children: [m && /* @__PURE__ */ S("div", {
|
|
713
|
+
role: "status",
|
|
714
|
+
className: "payment-modal-loader",
|
|
715
|
+
children: /* @__PURE__ */ se("svg", {
|
|
716
|
+
"aria-hidden": "true",
|
|
717
|
+
className: "icon",
|
|
718
|
+
viewBox: "0 0 100 101",
|
|
719
|
+
fill: "none",
|
|
720
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
721
|
+
children: [/* @__PURE__ */ S("path", {
|
|
722
|
+
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",
|
|
723
|
+
fill: "currentColor"
|
|
724
|
+
}), /* @__PURE__ */ S("path", {
|
|
725
|
+
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",
|
|
726
|
+
fill: "currentFill"
|
|
727
|
+
})]
|
|
728
|
+
})
|
|
729
|
+
}), /* @__PURE__ */ S("iframe", {
|
|
730
|
+
allow: "clipboard-read *; clipboard-write *",
|
|
731
|
+
src: h.getPayModalUrl(r, s, e, n),
|
|
732
|
+
onLoad: P,
|
|
733
|
+
className: `payment-modal ${m ? "invisible" : "visible"}`,
|
|
734
|
+
"data-id": n,
|
|
735
|
+
ref: w
|
|
736
|
+
})]
|
|
737
|
+
}) : /* @__PURE__ */ S(Ue, {});
|
|
739
738
|
}
|
|
740
|
-
const
|
|
741
|
-
let
|
|
742
|
-
const K = Object.getPrototypeOf, $ = /* @__PURE__ */ new WeakMap(), Pe = (t) => t && ($.has(t) ? $.get(t) : K(t) === Object.prototype || K(t) === Array.prototype), _ = (t) => typeof t == "object" && t !== null,
|
|
739
|
+
const pt = Symbol(), V = Symbol(), A = "a", Re = "f", oe = "p", be = "c", Ee = "t", J = "h", v = "w", G = "o", X = "k";
|
|
740
|
+
let yt = (t, e) => new Proxy(t, e);
|
|
741
|
+
const K = Object.getPrototypeOf, $ = /* @__PURE__ */ new WeakMap(), Pe = (t) => t && ($.has(t) ? $.get(t) : K(t) === Object.prototype || K(t) === Array.prototype), _ = (t) => typeof t == "object" && t !== null, gt = (t) => Object.values(Object.getOwnPropertyDescriptors(t)).some((e) => !e.configurable && !e.writable), mt = (t) => {
|
|
743
742
|
if (Array.isArray(t))
|
|
744
743
|
return Array.from(t);
|
|
745
744
|
const e = Object.getOwnPropertyDescriptors(t);
|
|
746
745
|
return Object.values(e).forEach((s) => {
|
|
747
746
|
s.configurable = !0;
|
|
748
747
|
}), Object.create(K(t), e);
|
|
749
|
-
},
|
|
748
|
+
}, wt = (t, e) => {
|
|
750
749
|
const s = {
|
|
751
750
|
[Re]: e
|
|
752
751
|
};
|
|
753
752
|
let r = !1;
|
|
754
753
|
const n = (a, c) => {
|
|
755
754
|
if (!r) {
|
|
756
|
-
let u = s[
|
|
757
|
-
if (u || (u = {}, s[
|
|
758
|
-
u[
|
|
755
|
+
let u = s[A].get(t);
|
|
756
|
+
if (u || (u = {}, s[A].set(t, u)), a === v)
|
|
757
|
+
u[v] = !0;
|
|
759
758
|
else {
|
|
760
759
|
let p = u[a];
|
|
761
760
|
p || (p = /* @__PURE__ */ new Set(), u[a] = p), p.add(c);
|
|
762
761
|
}
|
|
763
762
|
}
|
|
764
763
|
}, i = () => {
|
|
765
|
-
r = !0, s[
|
|
764
|
+
r = !0, s[A].delete(t);
|
|
766
765
|
}, o = {
|
|
767
766
|
get(a, c) {
|
|
768
|
-
return c === V ? t : (n(X, c), Se(Reflect.get(a, c), s[
|
|
767
|
+
return c === V ? t : (n(X, c), Se(Reflect.get(a, c), s[A], s[be], s[Ee]));
|
|
769
768
|
},
|
|
770
769
|
has(a, c) {
|
|
771
|
-
return c ===
|
|
770
|
+
return c === pt ? (i(), !0) : (n(J, c), Reflect.has(a, c));
|
|
772
771
|
},
|
|
773
772
|
getOwnPropertyDescriptor(a, c) {
|
|
774
773
|
return n(G, c), Reflect.getOwnPropertyDescriptor(a, c);
|
|
775
774
|
},
|
|
776
775
|
ownKeys(a) {
|
|
777
|
-
return n(
|
|
776
|
+
return n(v), Reflect.ownKeys(a);
|
|
778
777
|
}
|
|
779
778
|
};
|
|
780
779
|
return e && (o.set = o.deleteProperty = () => !1), [o, s];
|
|
@@ -788,12 +787,12 @@ const K = Object.getPrototypeOf, $ = /* @__PURE__ */ new WeakMap(), Pe = (t) =>
|
|
|
788
787
|
let n = r && r.get(t);
|
|
789
788
|
if (!n) {
|
|
790
789
|
const c = Z(t);
|
|
791
|
-
|
|
790
|
+
gt(c) ? n = [c, mt(c)] : n = [c], r?.set(t, n);
|
|
792
791
|
}
|
|
793
792
|
const [i, o] = n;
|
|
794
793
|
let a = s && s.get(i);
|
|
795
|
-
return (!a || a[1][Re] !== !!o) && (a =
|
|
796
|
-
},
|
|
794
|
+
return (!a || a[1][Re] !== !!o) && (a = wt(i, !!o), a[1][oe] = yt(o || i, a[0]), s && s.set(i, a)), a[1][A] = e, a[1][be] = s, a[1][Ee] = r, a[1][oe];
|
|
795
|
+
}, Tt = (t, e) => {
|
|
797
796
|
const s = Reflect.ownKeys(t), r = Reflect.ownKeys(e);
|
|
798
797
|
return s.length !== r.length || s.some((n, i) => n !== r[i]);
|
|
799
798
|
}, Ae = (t, e, s, r, n = Object.is) => {
|
|
@@ -813,8 +812,8 @@ const K = Object.getPrototypeOf, $ = /* @__PURE__ */ new WeakMap(), Pe = (t) =>
|
|
|
813
812
|
for (const a of i[J] || [])
|
|
814
813
|
if (o = Reflect.has(t, a) !== Reflect.has(e, a), o)
|
|
815
814
|
return o;
|
|
816
|
-
if (i[
|
|
817
|
-
if (o =
|
|
815
|
+
if (i[v] === !0) {
|
|
816
|
+
if (o = Tt(t, e), o)
|
|
818
817
|
return o;
|
|
819
818
|
} else
|
|
820
819
|
for (const a of i[G] || []) {
|
|
@@ -828,9 +827,9 @@ const K = Object.getPrototypeOf, $ = /* @__PURE__ */ new WeakMap(), Pe = (t) =>
|
|
|
828
827
|
if (o === null)
|
|
829
828
|
throw new Error("invalid used");
|
|
830
829
|
return o;
|
|
831
|
-
},
|
|
830
|
+
}, Rt = (t) => Pe(t) && t[V] || null, ie = (t, e = !0) => {
|
|
832
831
|
$.set(t, e);
|
|
833
|
-
},
|
|
832
|
+
}, bt = (t, e, s) => {
|
|
834
833
|
const r = [], n = /* @__PURE__ */ new WeakSet(), i = (o, a) => {
|
|
835
834
|
var c, u, p;
|
|
836
835
|
if (n.has(o))
|
|
@@ -841,7 +840,7 @@ const K = Object.getPrototypeOf, $ = /* @__PURE__ */ new WeakMap(), Pe = (t) =>
|
|
|
841
840
|
if ((c = m[J]) === null || c === void 0 || c.forEach((g) => {
|
|
842
841
|
const w = `:has(${String(g)})`;
|
|
843
842
|
r.push(a ? [...a, w] : [w]);
|
|
844
|
-
}), m[
|
|
843
|
+
}), m[v] === !0) {
|
|
845
844
|
const g = ":ownKeys";
|
|
846
845
|
r.push(a ? [...a, g] : [g]);
|
|
847
846
|
} else
|
|
@@ -855,7 +854,7 @@ const K = Object.getPrototypeOf, $ = /* @__PURE__ */ new WeakMap(), Pe = (t) =>
|
|
|
855
854
|
} else a && r.push(a);
|
|
856
855
|
};
|
|
857
856
|
return i(t), r;
|
|
858
|
-
}, U = {}, Q = (t) => typeof t == "object" && t !== null,
|
|
857
|
+
}, U = {}, Q = (t) => typeof t == "object" && t !== null, Et = (t) => Q(t) && !ee.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), ve = (t, e) => {
|
|
859
858
|
const s = ae.get(t);
|
|
860
859
|
if (s?.[0] === e)
|
|
861
860
|
return s[1];
|
|
@@ -883,7 +882,7 @@ const K = Object.getPrototypeOf, $ = /* @__PURE__ */ new WeakMap(), Pe = (t) =>
|
|
|
883
882
|
}
|
|
884
883
|
Object.defineProperty(r, n, a);
|
|
885
884
|
}), Object.preventExtensions(r);
|
|
886
|
-
},
|
|
885
|
+
}, Pt = (t, e, s, r) => ({
|
|
887
886
|
deleteProperty(n, i) {
|
|
888
887
|
const o = Reflect.get(n, i);
|
|
889
888
|
s(i);
|
|
@@ -894,12 +893,12 @@ const K = Object.getPrototypeOf, $ = /* @__PURE__ */ new WeakMap(), Pe = (t) =>
|
|
|
894
893
|
const c = !t() && Reflect.has(n, i), u = Reflect.get(n, i, a);
|
|
895
894
|
if (c && (ce(u, o) || j.has(o) && ce(u, j.get(o))))
|
|
896
895
|
return !0;
|
|
897
|
-
s(i), Q(o) && (o =
|
|
898
|
-
const p = !E.has(o) &&
|
|
896
|
+
s(i), Q(o) && (o = Rt(o) || o);
|
|
897
|
+
const p = !E.has(o) && At(o) ? Oe(o) : o;
|
|
899
898
|
return e(i, p), Reflect.set(n, i, p, a), r(["set", [i], o, u]), !0;
|
|
900
899
|
}
|
|
901
900
|
}), E = /* @__PURE__ */ new WeakMap(), ee = /* @__PURE__ */ new WeakSet(), ae = /* @__PURE__ */ new WeakMap(), L = [1], j = /* @__PURE__ */ new WeakMap();
|
|
902
|
-
let ce = Object.is,
|
|
901
|
+
let ce = Object.is, St = (t, e) => new Proxy(t, e), At = Et, vt = ve, Ot = Pt;
|
|
903
902
|
function Oe(t = {}) {
|
|
904
903
|
if (!Q(t))
|
|
905
904
|
throw new Error("object required");
|
|
@@ -932,26 +931,26 @@ function Oe(t = {}) {
|
|
|
932
931
|
var d;
|
|
933
932
|
const f = c.get(l);
|
|
934
933
|
f && (c.delete(l), (d = f[1]) == null || d.call(f));
|
|
935
|
-
}, m = (l) => (r.add(l), r.size === 1 && c.forEach(([f, T],
|
|
934
|
+
}, m = (l) => (r.add(l), r.size === 1 && c.forEach(([f, T], k) => {
|
|
936
935
|
if ((U ? "production" : void 0) !== "production" && T)
|
|
937
936
|
throw new Error("remove already exists");
|
|
938
|
-
const Ce = f[2](a(
|
|
939
|
-
c.set(
|
|
937
|
+
const Ce = f[2](a(k));
|
|
938
|
+
c.set(k, [f, Ce]);
|
|
940
939
|
}), () => {
|
|
941
|
-
r.delete(l), r.size === 0 && c.forEach(([f, T],
|
|
942
|
-
T && (T(), c.set(
|
|
940
|
+
r.delete(l), r.size === 0 && c.forEach(([f, T], k) => {
|
|
941
|
+
T && (T(), c.set(k, [f]));
|
|
943
942
|
});
|
|
944
943
|
});
|
|
945
944
|
let g = !0;
|
|
946
|
-
const w =
|
|
945
|
+
const w = Ot(
|
|
947
946
|
() => g,
|
|
948
947
|
u,
|
|
949
948
|
p,
|
|
950
949
|
n
|
|
951
|
-
), P =
|
|
950
|
+
), P = St(t, w);
|
|
952
951
|
j.set(t, P);
|
|
953
|
-
const
|
|
954
|
-
return E.set(P,
|
|
952
|
+
const C = [t, o, m];
|
|
953
|
+
return E.set(P, C), Reflect.ownKeys(t).forEach((l) => {
|
|
955
954
|
const d = Object.getOwnPropertyDescriptor(
|
|
956
955
|
t,
|
|
957
956
|
l
|
|
@@ -959,7 +958,7 @@ function Oe(t = {}) {
|
|
|
959
958
|
"value" in d && d.writable && (P[l] = t[l]);
|
|
960
959
|
}), g = !1, P;
|
|
961
960
|
}
|
|
962
|
-
function
|
|
961
|
+
function Ct(t, e, s) {
|
|
963
962
|
const r = E.get(t);
|
|
964
963
|
(U ? "production" : void 0) !== "production" && !r && console.warn("Please use proxy object");
|
|
965
964
|
let n;
|
|
@@ -978,15 +977,15 @@ function ue(t) {
|
|
|
978
977
|
const e = E.get(t);
|
|
979
978
|
(U ? "production" : void 0) !== "production" && !e && console.warn("Please use proxy object");
|
|
980
979
|
const [s, r] = e;
|
|
981
|
-
return
|
|
980
|
+
return vt(s, r());
|
|
982
981
|
}
|
|
983
|
-
const
|
|
982
|
+
const kt = {}, Nt = (t, e) => {
|
|
984
983
|
const s = W(void 0);
|
|
985
984
|
F(() => {
|
|
986
|
-
s.current =
|
|
985
|
+
s.current = bt(t, e);
|
|
987
986
|
}), _e(s.current);
|
|
988
|
-
},
|
|
989
|
-
function
|
|
987
|
+
}, qt = Nt, _t = /* @__PURE__ */ new WeakMap();
|
|
988
|
+
function Ut(t, e) {
|
|
990
989
|
const r = te(
|
|
991
990
|
() => t && /* @__PURE__ */ new WeakMap(),
|
|
992
991
|
[t]
|
|
@@ -995,7 +994,7 @@ function _t(t, e) {
|
|
|
995
994
|
const o = ke(
|
|
996
995
|
Ne(
|
|
997
996
|
(c) => {
|
|
998
|
-
const u =
|
|
997
|
+
const u = Ct(t, c);
|
|
999
998
|
return c(), u;
|
|
1000
999
|
},
|
|
1001
1000
|
[t, void 0]
|
|
@@ -1018,21 +1017,21 @@ function _t(t, e) {
|
|
|
1018
1017
|
);
|
|
1019
1018
|
i = !1, qe(() => {
|
|
1020
1019
|
n.current = o;
|
|
1021
|
-
}), (
|
|
1020
|
+
}), (kt ? "production" : void 0) !== "production" && qt(o, r);
|
|
1022
1021
|
const a = te(() => /* @__PURE__ */ new WeakMap(), []);
|
|
1023
|
-
return Se(o, r, a,
|
|
1022
|
+
return Se(o, r, a, _t);
|
|
1024
1023
|
}
|
|
1025
1024
|
const R = Oe({
|
|
1026
1025
|
data: null,
|
|
1027
1026
|
isPending: !1,
|
|
1028
1027
|
error: null
|
|
1029
1028
|
});
|
|
1030
|
-
function
|
|
1029
|
+
function Dt({
|
|
1031
1030
|
url: t,
|
|
1032
1031
|
params: e,
|
|
1033
1032
|
callbacks: s
|
|
1034
1033
|
}) {
|
|
1035
|
-
const r =
|
|
1034
|
+
const r = Ut(R), [n, i] = le(!1);
|
|
1036
1035
|
function o() {
|
|
1037
1036
|
i(!0);
|
|
1038
1037
|
}
|
|
@@ -1064,9 +1063,9 @@ function Lt({
|
|
|
1064
1063
|
}
|
|
1065
1064
|
export {
|
|
1066
1065
|
h as Chainrails,
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1066
|
+
Lt as PaymentModal,
|
|
1067
|
+
ot as chains,
|
|
1068
|
+
xt as crapi,
|
|
1069
|
+
it as tokens,
|
|
1070
|
+
Dt as useGetSessionToken
|
|
1072
1071
|
};
|