everest-npm-features 0.0.2 → 0.0.4

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.
Files changed (67) hide show
  1. package/dist/Cancel-kWZwZbQf.js +8 -0
  2. package/dist/Delete-BbHDZPfy.js +8 -0
  3. package/dist/{PlayArrow-D98xCL5M.js → PlayArrow-Dwss80PJ.js} +1 -1
  4. package/dist/assets/index10.css +1 -1
  5. package/dist/assets/index11.css +1 -0
  6. package/dist/assets/index6.css +1 -1
  7. package/dist/assets/index7.css +1 -1
  8. package/dist/assets/index8.css +1 -1
  9. package/dist/assets/index9.css +1 -1
  10. package/dist/{auth-AwdxCQXF.js → auth-NmISGQ2S.js} +1 -1
  11. package/dist/{bank-D2rGgUDP.js → bank-CRy2oyUW.js} +1 -1
  12. package/dist/components/Account/index.js +9 -8
  13. package/dist/components/History/index.js +3 -3
  14. package/dist/components/MoveToEthereumOrEverChain/index.js +7 -7
  15. package/dist/components/Profile/documents.js +5 -4
  16. package/dist/components/Profile/index.js +3 -3
  17. package/dist/components/Receive/index.js +2 -2
  18. package/dist/components/RocketRamp/Buy/cardPayment.js +3 -3
  19. package/dist/components/RocketRamp/Buy/confirmTransaction.js +3 -3
  20. package/dist/components/RocketRamp/Buy/form.d.ts +1 -1
  21. package/dist/components/RocketRamp/Buy/form.js +4 -4
  22. package/dist/components/RocketRamp/Buy/index.d.ts +1 -0
  23. package/dist/components/RocketRamp/Buy/index.js +12 -7
  24. package/dist/components/RocketRamp/Buy/types.d.ts +2 -0
  25. package/dist/components/RocketRamp/Dashboard/index.js +54 -24
  26. package/dist/components/RocketRamp/MinimalKyc/form.d.ts +5 -0
  27. package/dist/components/RocketRamp/MinimalKyc/form.js +233 -0
  28. package/dist/components/RocketRamp/MinimalKyc/index.d.ts +2 -3
  29. package/dist/components/RocketRamp/MinimalKyc/index.js +17 -252
  30. package/dist/components/RocketRamp/SignIn/index.js +2 -2
  31. package/dist/components/RocketRamp/SignIn/loginForm.js +2 -2
  32. package/dist/components/RocketRamp/SignIn/otpForm.js +24 -23
  33. package/dist/components/RocketRamp/SignUp/email.js +2 -2
  34. package/dist/components/RocketRamp/SignUp/index.js +2 -2
  35. package/dist/components/RocketRamp/SignUp/personalInfo.js +2 -2
  36. package/dist/components/RocketRamp/SignUp/validateEmail.js +15 -14
  37. package/dist/components/RocketRamp/Transactions/index.js +2 -2
  38. package/dist/components/Send/index.js +3 -3
  39. package/dist/components/Shared/ConnectWallet/index.js +1 -1
  40. package/dist/components/Shared/addBank.js +2 -2
  41. package/dist/components/Shared/connectPlaidBank.js +2 -2
  42. package/dist/components/SignIn/index.js +2 -2
  43. package/dist/components/SignUp/index.js +3 -3
  44. package/dist/components/Stake/index.js +3 -3
  45. package/dist/components/Swap/index.js +2 -2
  46. package/dist/components/WalletPortfolio/index.js +3 -3
  47. package/dist/{constants-d3SWzaRo.js → constants-Bg2zYFVK.js} +35 -34
  48. package/dist/{documents-2UqIXbDq.js → documents-BGFSTan8.js} +35 -34
  49. package/dist/hooks/useRrDialog/index.d.ts +5 -0
  50. package/dist/hooks/useRrDialog/index.js +82 -0
  51. package/dist/hooks/useRrDialog/types.d.ts +15 -0
  52. package/dist/hooks/useRrDialog/types.js +1 -0
  53. package/dist/index-zP3Vu4Cl.js +816 -0
  54. package/dist/main.js +1 -1
  55. package/dist/order-CtACU1eX.js +27 -0
  56. package/dist/{stake-Q_O90kTv.js → stake-CQWZT4ug.js} +1 -1
  57. package/dist/store.d.ts +7 -1
  58. package/dist/{user-Dzur3Cro.js → user-Djw_k_OF.js} +7 -7
  59. package/dist/util/constants.d.ts +3 -0
  60. package/dist/util/constants.js +58 -55
  61. package/dist/util/functions.d.ts +2 -0
  62. package/dist/util/functions.js +48 -37
  63. package/dist/{wallet-Dw896DF7.js → wallet-CmeFL8-U.js} +1 -1
  64. package/package.json +1 -1
  65. package/dist/Cancel-BMPJ8ZAg.js +0 -11
  66. package/dist/index-DxLB0ZV1.js +0 -760
  67. package/dist/order-Cry6kuj8.js +0 -23
@@ -0,0 +1,816 @@
1
+ import { jsxs as n, Fragment as T, jsx as e } from "react/jsx-runtime";
2
+ import { useState as c, useEffect as g } from "react";
3
+ import ze from "./hoc/withThemeProvider.js";
4
+ import { P as Re, F as Oe } from "./PlayArrow-Dwss80PJ.js";
5
+ import { I as we } from "./Info-CkE3Gsf2.js";
6
+ import { G as Be } from "./generic-token-B_ptO5yb.js";
7
+ import ee from "./components/RocketRamp/Shared/Input/index.js";
8
+ import { ID_TOKEN_SYMBOL as de, FIAT_TO_EVER_ID as te, FIAT_TO_TOKEN as re, ESTIMATE_TOOLTIP_TEXT as Le, VISA_PAYMENT as Ve, VISA_PAYMENT_ACTIVE as Ye, SEPA_PAYMENT as We, SEPA_PAYMENT_ACTIVE as De, PAYMENT_BANK as ue, SEPA_ICON as Ke, VISA_ICON as _e, PAYMENT_PROVIDER_CHECKOUT as pe } from "./util/constants.js";
9
+ import { a7 as qe } from "./constants-Bg2zYFVK.js";
10
+ import { a as $e, b as ge, c as Ge, d as Ue, e as he } from "./order-CtACU1eX.js";
11
+ import je from "./components/Shared/tooltip.js";
12
+ import { getCurrencySymbol as be, removeExtraSpace as He, getOrionBalance as Xe } from "./util/functions.js";
13
+ import ne from "./components/RocketRamp/Shared/Button/index.js";
14
+ import Ce from "./components/RocketRamp/Shared/backBtn.js";
15
+ import { T as s } from "./Typography-Dx54MRM5.js";
16
+ import { B as f } from "./Box-BOgpENcC.js";
17
+ import { G as o } from "./Grid2-B0mJbwjl.js";
18
+ import { C as A } from "./CircularProgress-BAEiXRSn.js";
19
+ import "@incodetech/welcome";
20
+ import "./axios-BEX6n2A7.js";
21
+ import { useSnackBar as Qe } from "./hooks/useSnackBar.js";
22
+ import "./components/SignUp/pin.js";
23
+ import { u as Je, a as $ } from "./react-redux-B4BZippc.js";
24
+ import './assets/main.css';import './assets/index9.css';/* empty css */
25
+ import "./util/conversions.js";
26
+ import "./index-CAoLi5Qq.js";
27
+ import "./react-webcam-B3cXh1XT.js";
28
+ import "./components/Shared/transition.js";
29
+ import "./components/Shared/pin.js";
30
+ import "./moment-h96o7c8I.js";
31
+ import "./index.esm-BsMAMhYW.js";
32
+ import "./web3-u4qDZYpo.js";
33
+ import "./index-B8QKlEgj.js";
34
+ import Ze from "./components/RocketRamp/MinimalKyc/form.js";
35
+ import { c as et } from "./createSvgIcon-jkXneOQN.js";
36
+ import { s as fe, p as tt, h as rt, v as nt } from "./index-ceeCtFuh.js";
37
+ import { I as it } from "./TextField-BqIvz6Zw.js";
38
+ import { F as at } from "./FormControl-Nd-4LC8N.js";
39
+ import { S as ot } from "./Select-DTQDmdn_.js";
40
+ import { M as ye } from "./MenuItem-D12FP5Iq.js";
41
+ import { L as st } from "./ListItemIcon-JAntieDc.js";
42
+ import { I as xe } from "./IconButton-DAR3jsEV.js";
43
+ const ct = (N) => ({
44
+ type: qe,
45
+ payload: N
46
+ }), L = {
47
+ "confirm-payment": "_confirm-payment_alxbn_1",
48
+ "confirm-transaction-network": "_confirm-transaction-network_alxbn_33",
49
+ "buy-info": "_buy-info_alxbn_57"
50
+ }, lt = ({
51
+ setScreen: N,
52
+ orderData: b,
53
+ dispatch: u,
54
+ fiatAssets: h,
55
+ cryptoAssets: C,
56
+ getCryptoAssets: r,
57
+ showAlertMessage: y,
58
+ partnerKey: F,
59
+ balance: v
60
+ }) => {
61
+ const E = "USD", m = be(E), p = h.fiats, P = h.loader, x = C.featureTokens.list, M = C.featureTokens.default, G = C.loader, d = b.loader, k = b.estimate, S = k.crypto_out_amount, R = k.conversion_price, U = k.total_fee;
62
+ let V = 0, j = 0;
63
+ const Y = k.fee_breakdown;
64
+ for (let t = 0; t < Y.length; t++) {
65
+ const a = Y[t];
66
+ a.name === "ev_fee" ? V = Number(a.value) : a.name === "network_fee" && (j = Number(a.value));
67
+ }
68
+ const [_, O] = c({
69
+ symbol: ""
70
+ }), [W, z] = c(!1), [I, H] = c(0), [i, D] = c(0), [X, J] = c([]), [Q, Ne] = c(!1), [oe, ve] = c(50), [se, Ee] = c(3e3), [Z, ke] = c(50), [ce, Ie] = c(3e3), [Ae, K] = c(""), [w, le] = c(
71
+ k.fiat_amount || Z.toString()
72
+ );
73
+ g(() => {
74
+ if (k.crypto_currency) {
75
+ const t = x.find(
76
+ (a) => a.symbol === k.crypto_currency
77
+ );
78
+ O(t);
79
+ } else
80
+ M && M.id && O(M);
81
+ }, [M, k.crypto_currency]), g(() => {
82
+ i && r(i);
83
+ }, [i]), g(() => {
84
+ if (p.length === 0)
85
+ return;
86
+ const t = [];
87
+ for (let a = 0; a < p.length; a++) {
88
+ if (p[a].symbol === E) {
89
+ const l = p[a].payment_options;
90
+ D(p[a].id);
91
+ let q = !1;
92
+ for (let B = 0; B < l.length; B++) {
93
+ const me = l[B];
94
+ me.active && (t.push(me), l[B].id === I && (q = !0));
95
+ }
96
+ q || H(t[0].id);
97
+ }
98
+ J(t);
99
+ }
100
+ }, [E, p]), g(() => {
101
+ if (_ && _.id && w && I && i) {
102
+ u($e()), z(!1), K("");
103
+ const t = setTimeout(() => {
104
+ Te();
105
+ }, 1e3);
106
+ return () => clearTimeout(t);
107
+ }
108
+ }, [_, w, I, x, i]);
109
+ const Te = () => {
110
+ var q;
111
+ const t = parseFloat(w);
112
+ if (_.symbol === de) {
113
+ if (oe > t)
114
+ return K(
115
+ `Minimum value should be greater than ${m + oe}`
116
+ ), z(!0), !1;
117
+ if (se * 1 < t)
118
+ return K(
119
+ `Maximum value should be less than ${m + se}`
120
+ ), z(!0), !1;
121
+ } else {
122
+ if (Z * 1 > t)
123
+ return K(
124
+ `Minimum value should be greater than ${m + Z}`
125
+ ), z(!0), !1;
126
+ if (ce * 1 < t)
127
+ return K(
128
+ `Maximum value should be less than ${m + ce}`
129
+ ), z(!0), !1;
130
+ }
131
+ const a = X.find((B) => B.id === I), l = a.payment_type;
132
+ u(
133
+ ge({
134
+ apiKey: F,
135
+ transaction_type: _.symbol === de ? te : re,
136
+ coin_amount: w,
137
+ exchange: _.exchange,
138
+ payment_type: l,
139
+ fiat_ccy: E,
140
+ crypto_ccy: _.symbol,
141
+ network: (q = _.network) == null ? void 0 : q.name,
142
+ payment_provider: a.payment_provider
143
+ })
144
+ );
145
+ }, Fe = ({ value: t, label: a }) => {
146
+ let l;
147
+ if (a === "credit_debit_card" ? (l = Ve, I === t && (l = Ye)) : (l = We, I === t && (l = De)), a)
148
+ return /* @__PURE__ */ e(
149
+ f,
150
+ {
151
+ mt: 0.5,
152
+ sx: { cursor: "pointer" },
153
+ onClick: () => H(t * 1),
154
+ children: /* @__PURE__ */ e("img", { src: l, alt: "payment", width: "90%" })
155
+ }
156
+ );
157
+ };
158
+ g(() => {
159
+ const t = b.types.length;
160
+ if (t > 0)
161
+ for (let a = 0; a < t; a++) {
162
+ const l = b.types[a];
163
+ if (l.type === te) {
164
+ ve(parseFloat(l.min_deposit_amount)), Ee(parseFloat(l.max_deposit_amount));
165
+ break;
166
+ }
167
+ if (l.type === re) {
168
+ ke(parseFloat(l.min_deposit_amount)), Ie(parseFloat(l.max_deposit_amount));
169
+ break;
170
+ }
171
+ }
172
+ }, [b.types]);
173
+ const Me = (t) => {
174
+ const a = t.target.value;
175
+ a ? /^([0-9]+)$/.test(a) && le(a) : le("");
176
+ }, Pe = (t) => {
177
+ const a = x.find((l) => l.symbol === t);
178
+ O(a);
179
+ }, Se = () => {
180
+ if (!_.id)
181
+ return y({ message: "Please select token" }), !1;
182
+ if (!I)
183
+ return y({ message: "Please select payment method" }), !1;
184
+ if (!w)
185
+ return y({ message: "Please enter amount" }), !1;
186
+ if (!S)
187
+ return y({
188
+ message: "Please wait for the estimate to be calculated and then press next"
189
+ }), !1;
190
+ N(ae);
191
+ };
192
+ return /* @__PURE__ */ n(T, { children: [
193
+ /* @__PURE__ */ n(o, { mt: 0.5, spacing: 1, container: !0, children: [
194
+ /* @__PURE__ */ e(o, { size: { xs: 3.5 }, children: /* @__PURE__ */ n(f, { className: L["buy-info"], children: [
195
+ /* @__PURE__ */ e(s, { variant: "2xl", children: /* @__PURE__ */ e("strong", { children: "Buy Credits" }) }),
196
+ /* @__PURE__ */ n(s, { variant: "md", children: [
197
+ "1 credit = ",
198
+ R,
199
+ m
200
+ ] })
201
+ ] }) }),
202
+ /* @__PURE__ */ e(o, { size: { xs: 6 }, children: /* @__PURE__ */ n(
203
+ f,
204
+ {
205
+ className: L["buy-info"],
206
+ sx: {
207
+ padding: "0px 50px !important",
208
+ alignItems: "center"
209
+ },
210
+ children: [
211
+ /* @__PURE__ */ e(s, { variant: "md", children: "MAX amount you can request:" }),
212
+ /* @__PURE__ */ e(s, { variant: "md", children: "267 credits" })
213
+ ]
214
+ }
215
+ ) }),
216
+ /* @__PURE__ */ e(o, { size: { xs: 2.5 }, children: /* @__PURE__ */ n(
217
+ f,
218
+ {
219
+ className: L["buy-info"],
220
+ sx: {
221
+ background: "black !important",
222
+ color: "white !important"
223
+ },
224
+ children: [
225
+ /* @__PURE__ */ e(s, { variant: "md", className: "text-right", children: "Game Balance" }),
226
+ /* @__PURE__ */ e(s, { variant: "lg", className: "text-right", children: v })
227
+ ]
228
+ }
229
+ ) })
230
+ ] }),
231
+ /* @__PURE__ */ e(o, { mt: 2, spacing: 2, container: !0, children: /* @__PURE__ */ e(o, { size: { xs: 6 }, children: /* @__PURE__ */ e(
232
+ ee,
233
+ {
234
+ label: "You Pay",
235
+ value: w,
236
+ onChange: Me,
237
+ type: "text",
238
+ labelFontWeight: 600,
239
+ error: W,
240
+ errorText: Ae,
241
+ required: !0,
242
+ fullWidth: !0
243
+ }
244
+ ) }) }),
245
+ /* @__PURE__ */ n(f, { className: "text-left", mt: 3, children: [
246
+ /* @__PURE__ */ e(s, { variant: "sm", fontWeight: 600, children: "Select Payment Method" }),
247
+ P ? /* @__PURE__ */ e(A, { sx: { ml: 1, mt: 3 }, size: 50 }) : /* @__PURE__ */ e(o, { mt: 0.5, container: !0, children: X.map((t) => /* @__PURE__ */ e(o, { size: { xs: 2.5 }, children: /* @__PURE__ */ e(
248
+ Fe,
249
+ {
250
+ label: t.payment_type,
251
+ value: t.id
252
+ }
253
+ ) }, t.id)) })
254
+ ] }),
255
+ /* @__PURE__ */ n(o, { mt: 3, spacing: 2, container: !0, children: [
256
+ /* @__PURE__ */ e(o, { size: { xs: 6 }, children: /* @__PURE__ */ e(
257
+ ee,
258
+ {
259
+ label: "You Receive",
260
+ labelFontWeight: 600,
261
+ value: S && (+S * 1).toFixed(5),
262
+ type: "text",
263
+ error: W,
264
+ readOnly: !0,
265
+ required: !0,
266
+ fullWidth: !0
267
+ }
268
+ ) }),
269
+ /* @__PURE__ */ e(o, { size: { xs: 5 }, className: "content-center", children: G ? /* @__PURE__ */ e(A, { sx: { ml: 1 }, size: 30 }) : /* @__PURE__ */ n(T, { children: [
270
+ /* @__PURE__ */ e(it, { children: " " }),
271
+ /* @__PURE__ */ e(at, { variant: "outlined", fullWidth: !0, children: /* @__PURE__ */ n(
272
+ ot,
273
+ {
274
+ sx: { marginTop: "-2px" },
275
+ inputProps: {
276
+ sx: {
277
+ display: "flex",
278
+ alignItems: "center",
279
+ padding: "10px"
280
+ }
281
+ },
282
+ value: _.symbol,
283
+ onChange: (t) => Pe(t.target.value),
284
+ children: [
285
+ /* @__PURE__ */ e(ye, { value: "", children: "Please select" }),
286
+ x.map((t) => /* @__PURE__ */ n(ye, { value: t.symbol, children: [
287
+ /* @__PURE__ */ e(st, { className: "dropdown-list-item", children: /* @__PURE__ */ e(
288
+ "img",
289
+ {
290
+ src: t.icon_uri,
291
+ onError: ({ currentTarget: a }) => {
292
+ a.onerror = null, a.src = Be;
293
+ },
294
+ alt: "tokenImg",
295
+ width: "36",
296
+ height: "36"
297
+ }
298
+ ) }),
299
+ /* @__PURE__ */ e("span", { children: t.name })
300
+ ] }, t.id))
301
+ ]
302
+ }
303
+ ) })
304
+ ] }) })
305
+ ] }),
306
+ /* @__PURE__ */ e(f, { mt: 3, sx: { color: "#1A202C" }, children: /* @__PURE__ */ n(o, { container: !0, children: [
307
+ /* @__PURE__ */ e(o, { className: "text-left", size: { xs: 12 }, children: /* @__PURE__ */ n(
308
+ xe,
309
+ {
310
+ sx: { padding: "0" },
311
+ onClick: () => Ne((t) => !t),
312
+ disableFocusRipple: !0,
313
+ disableRipple: !0,
314
+ children: [
315
+ /* @__PURE__ */ e(s, { variant: "md", fontWeight: 500, children: "Fee Calculation" }),
316
+ /* @__PURE__ */ e(
317
+ Re,
318
+ {
319
+ sx: {
320
+ transform: `rotate(${Q ? "90" : "0"}deg)`,
321
+ fontSize: "15px"
322
+ }
323
+ }
324
+ )
325
+ ]
326
+ }
327
+ ) }),
328
+ Q && /* @__PURE__ */ n(T, { children: [
329
+ /* @__PURE__ */ e(o, { className: "text-left", size: { xs: 6 }, children: /* @__PURE__ */ e(s, { variant: "caption", children: "Everest Fee" }) }),
330
+ /* @__PURE__ */ e(o, { className: "text-right", size: { xs: 6 }, children: /* @__PURE__ */ n(s, { variant: "caption", children: [
331
+ m,
332
+ d ? /* @__PURE__ */ e(
333
+ A,
334
+ {
335
+ sx: { ml: 1 },
336
+ size: 15,
337
+ color: "primary"
338
+ }
339
+ ) : V.toFixed(2)
340
+ ] }) }),
341
+ /* @__PURE__ */ e(o, { className: "text-left", size: { xs: 6 }, children: /* @__PURE__ */ e(s, { variant: "caption", children: "Network Fee" }) }),
342
+ /* @__PURE__ */ e(o, { className: "text-right", size: { xs: 6 }, children: /* @__PURE__ */ n(s, { variant: "caption", children: [
343
+ m,
344
+ d ? /* @__PURE__ */ e(
345
+ A,
346
+ {
347
+ sx: { ml: 1 },
348
+ size: 15,
349
+ color: "primary"
350
+ }
351
+ ) : j.toFixed(2)
352
+ ] }) })
353
+ ] }),
354
+ /* @__PURE__ */ e(o, { className: "text-left", size: { xs: 6 }, children: /* @__PURE__ */ e(s, { variant: "caption", children: "Total Fees" }) }),
355
+ /* @__PURE__ */ e(o, { className: "text-right", size: { xs: 6 }, children: /* @__PURE__ */ n(s, { variant: "caption", children: [
356
+ m,
357
+ d ? /* @__PURE__ */ e(A, { sx: { ml: 1 }, size: 15, color: "primary" }) : Number(U).toFixed(2)
358
+ ] }) }),
359
+ _ && /* @__PURE__ */ n(T, { children: [
360
+ /* @__PURE__ */ e(o, { className: "text-left", size: { xs: 6 }, children: /* @__PURE__ */ n(s, { variant: "caption", children: [
361
+ "1 ",
362
+ _.symbol,
363
+ " ",
364
+ /* @__PURE__ */ e(
365
+ je,
366
+ {
367
+ title: Le,
368
+ placement: "right",
369
+ children: /* @__PURE__ */ e(xe, { className: "info-fee-icon", children: /* @__PURE__ */ e(
370
+ we,
371
+ {
372
+ sx: {
373
+ fontSize: "14px"
374
+ }
375
+ }
376
+ ) })
377
+ }
378
+ )
379
+ ] }) }),
380
+ /* @__PURE__ */ e(o, { className: "text-right", size: { xs: 6 }, children: /* @__PURE__ */ n(s, { variant: "caption", children: [
381
+ m,
382
+ d ? /* @__PURE__ */ e(
383
+ A,
384
+ {
385
+ sx: { ml: 1 },
386
+ size: 15,
387
+ color: "primary"
388
+ }
389
+ ) : Number(R).toFixed(2)
390
+ ] }) })
391
+ ] })
392
+ ] }) }),
393
+ /* @__PURE__ */ e(f, { mt: 4, children: /* @__PURE__ */ e(
394
+ ne,
395
+ {
396
+ onClick: Se,
397
+ disabled: W || !S,
398
+ fullWidth: !0,
399
+ children: /* @__PURE__ */ e("strong", { children: "Next" })
400
+ }
401
+ ) })
402
+ ] });
403
+ }, mt = ({
404
+ setScreen: N,
405
+ partnerKey: b,
406
+ orderData: u,
407
+ dispatch: h,
408
+ walletAddress: C
409
+ }) => {
410
+ const r = u.estimate, y = u.create.order_id, F = u.loader, v = r.fiat_amount, E = be(r.fiat_currency), [m, p] = c(!1);
411
+ g(() => {
412
+ y && m && N(pt);
413
+ }, [y]), g(() => {
414
+ P();
415
+ }, []);
416
+ const P = () => {
417
+ h(
418
+ ge({
419
+ ...r,
420
+ apiKey: b,
421
+ transaction_type: r.transaction_type,
422
+ coin_amount: r.fiat_amount,
423
+ exchange: r.exchange,
424
+ payment_type: r.payment_type,
425
+ fiat_ccy: r.fiat_currency,
426
+ crypto_ccy: r.crypto_currency,
427
+ network: r.network,
428
+ payment_provider: r.payment_provider
429
+ })
430
+ );
431
+ }, x = () => {
432
+ h(
433
+ Ge({
434
+ apiKey: b,
435
+ quoteId: r.quote_id,
436
+ walletAddress: C
437
+ })
438
+ ), p(!0);
439
+ };
440
+ return /* @__PURE__ */ n(T, { children: [
441
+ /* @__PURE__ */ e(Ce, { onClickHandler: () => N(ie) }),
442
+ /* @__PURE__ */ e(s, { mt: 2, variant: "sm", fontWeight: 600, children: "Using payment method" }),
443
+ /* @__PURE__ */ n(f, { mt: 2, className: L["confirm-payment"], children: [
444
+ /* @__PURE__ */ e(
445
+ "img",
446
+ {
447
+ src: r.payment_type === ue ? Ke : _e,
448
+ width: 100,
449
+ alt: "payment"
450
+ }
451
+ ),
452
+ /* @__PURE__ */ e(s, { variant: "caption", component: "span", children: /* @__PURE__ */ e("strong", { children: r.payment_type === ue ? "Bank Account" : "Debit Card" }) })
453
+ ] }),
454
+ /* @__PURE__ */ e(s, { mt: 4, variant: "sm", fontWeight: 600, children: "To Wallet Address" }),
455
+ /* @__PURE__ */ e(
456
+ f,
457
+ {
458
+ mt: 2,
459
+ className: L["confirm-payment"],
460
+ sx: { width: "100% !important" },
461
+ children: /* @__PURE__ */ e(s, { variant: "caption", component: "p", children: /* @__PURE__ */ e("strong", { children: C }) })
462
+ }
463
+ ),
464
+ /* @__PURE__ */ e(s, { mt: 3, variant: "sm", fontWeight: 600, component: "p", children: "Order Estimate Details" }),
465
+ /* @__PURE__ */ e(f, { sx: { color: "#A6A6A6" }, children: /* @__PURE__ */ n(o, { container: !0, children: [
466
+ /* @__PURE__ */ e(o, { className: "text-left", size: { xs: 6 }, children: /* @__PURE__ */ n(s, { variant: "caption", children: [
467
+ r.crypto_currency.toUpperCase(),
468
+ " @",
469
+ " ",
470
+ Number(r.conversion_price).toFixed(2),
471
+ " ",
472
+ r.fiat_currency
473
+ ] }) }),
474
+ /* @__PURE__ */ e(o, { className: "flex-right", size: { xs: 6 }, children: /* @__PURE__ */ e(
475
+ "span",
476
+ {
477
+ className: L["confirm-transaction-network"],
478
+ style: {
479
+ backgroundColor: r.network === "Ethereum" ? "#A1A9DC" : "#5D8CCC"
480
+ },
481
+ children: r.network
482
+ }
483
+ ) }),
484
+ /* @__PURE__ */ e(o, { className: "text-left", size: { xs: 6 }, children: /* @__PURE__ */ n(s, { variant: "caption", children: [
485
+ Number(r.crypto_out_amount).toFixed(5),
486
+ " ",
487
+ r.crypto_currency.toUpperCase()
488
+ ] }) }),
489
+ /* @__PURE__ */ e(o, { className: "text-right", size: { xs: 6 }, children: /* @__PURE__ */ n(s, { variant: "caption", children: [
490
+ (Number(v) - Number(r.total_fee)).toFixed(2),
491
+ " ",
492
+ r.fiat_currency
493
+ ] }) }),
494
+ /* @__PURE__ */ e(o, { className: "text-left", size: { xs: 6 }, children: /* @__PURE__ */ e(s, { variant: "caption", children: "Total Fees" }) }),
495
+ /* @__PURE__ */ e(o, { className: "text-right", size: { xs: 6 }, children: /* @__PURE__ */ n(s, { variant: "caption", children: [
496
+ Number(r.total_fee).toFixed(2),
497
+ " ",
498
+ r.fiat_currency
499
+ ] }) }),
500
+ /* @__PURE__ */ e(o, { className: "text-left", size: { xs: 6 }, children: /* @__PURE__ */ e(s, { variant: "caption", children: /* @__PURE__ */ e("strong", { children: "Order Total" }) }) }),
501
+ /* @__PURE__ */ e(o, { className: "text-right", size: { xs: 6 }, children: /* @__PURE__ */ e(s, { variant: "caption", children: /* @__PURE__ */ n("strong", { children: [
502
+ E,
503
+ Number(v).toFixed(2),
504
+ " ",
505
+ r.fiat_currency
506
+ ] }) }) })
507
+ ] }) }),
508
+ /* @__PURE__ */ e(f, { mt: 4, children: /* @__PURE__ */ e(
509
+ ne,
510
+ {
511
+ onClick: x,
512
+ disabled: F,
513
+ fullWidth: !0,
514
+ children: /* @__PURE__ */ e("strong", { children: F ? /* @__PURE__ */ n(T, { children: [
515
+ /* @__PURE__ */ e(A, { size: 15, color: "inherit" }),
516
+ " Processing..."
517
+ ] }) : "Payment Details" })
518
+ }
519
+ ) })
520
+ ] });
521
+ }, dt = et(/* @__PURE__ */ e("path", {
522
+ d: "M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"
523
+ }), "ErrorOutline"), ut = ({
524
+ checkoutKey: N,
525
+ setScreen: b,
526
+ showAlertMessage: u,
527
+ rrBaseUrl: h,
528
+ orderData: C,
529
+ dispatch: r
530
+ }) => {
531
+ const y = C.estimate, F = C.create.order_id, v = C.payment, [E, m] = c(!0), [p, P] = c(""), [x, M] = c(!1), [G, d] = c({
532
+ name: "",
533
+ billingAddress: {
534
+ addressLine1: ""
535
+ }
536
+ }), [k, S] = c(!1), [R, U] = c(!0), [V, j] = c(!0), [Y, _] = c(!0), [O, W] = c(!0);
537
+ g(() => {
538
+ v._links.redirect.href && window.location.replace(v._links.redirect.href);
539
+ }, [v]), g(() => {
540
+ d({
541
+ name: p,
542
+ billingAddress: {
543
+ addressLine1: ""
544
+ }
545
+ });
546
+ }, [p]), g(() => {
547
+ !V && !Y && !O && p !== "" ? R && U(!1) : R || U(!0);
548
+ }, [p, V, Y, O]);
549
+ const z = (i, D, X, J = /./) => {
550
+ if (i !== "" && !J.test(i))
551
+ return !1;
552
+ D(i);
553
+ const Q = typeof i == "string" ? He(i) : i;
554
+ X(!Q);
555
+ }, I = (i) => {
556
+ if (i && i.element)
557
+ switch (i.element) {
558
+ case "card-number":
559
+ j(i.isEmpty || !i.isValid);
560
+ break;
561
+ case "expiry-date":
562
+ _(i.isEmpty || !i.isValid);
563
+ break;
564
+ case "cvv":
565
+ W(i.isEmpty || !i.isValid);
566
+ break;
567
+ default:
568
+ console.log("NOOP");
569
+ break;
570
+ }
571
+ }, H = (i) => {
572
+ if (i === "") {
573
+ u({ message: "Error processing card" }), S(!1), b(ie);
574
+ return;
575
+ }
576
+ const D = {
577
+ token: i,
578
+ amount: Number(y.fiat_amount),
579
+ currency: y.fiat_currency,
580
+ reference: F,
581
+ success_url: `${h}/dashboard?payment=success`,
582
+ fail_url: `${h}/dashboard?payment=failed`
583
+ };
584
+ r(Ue(D));
585
+ };
586
+ return /* @__PURE__ */ n(T, { children: [
587
+ /* @__PURE__ */ e(Ce, { onClickHandler: () => b(ae) }),
588
+ /* @__PURE__ */ n(s, { className: "text-center", variant: "subtitle1", mt: 2, children: [
589
+ /* @__PURE__ */ e("img", { src: _e, width: 140, alt: "Debit Card" }),
590
+ /* @__PURE__ */ e("br", {}),
591
+ /* @__PURE__ */ e("b", { children: "Debit Card" })
592
+ ] }),
593
+ /* @__PURE__ */ n(
594
+ s,
595
+ {
596
+ className: "text-center d-flex items-center",
597
+ variant: "caption",
598
+ mt: 2,
599
+ children: [
600
+ /* @__PURE__ */ e(dt, {}),
601
+ "   ",
602
+ /* @__PURE__ */ e("b", { style: { marginTop: "3px" }, children: "Fiat purchasing is not available for users with Chase and Citi bank accounts" })
603
+ ]
604
+ }
605
+ ),
606
+ y.payment_provider === pe && E && /* @__PURE__ */ e(f, { className: "text-center", mt: 8, children: /* @__PURE__ */ e(A, {}) }),
607
+ /* @__PURE__ */ e(f, { mt: 2, children: y.payment_provider === pe && /* @__PURE__ */ n(
608
+ fe,
609
+ {
610
+ config: {
611
+ debug: !1,
612
+ publicKey: N,
613
+ acceptedPaymentMethods: ["Visa", "Mastercard"],
614
+ cardholder: G,
615
+ localization: {
616
+ cardNumberPlaceholder: "Card number",
617
+ expiryMonthPlaceholder: "MM",
618
+ expiryYearPlaceholder: "YY",
619
+ cvvPlaceholder: "CVV"
620
+ },
621
+ style: {
622
+ base: {
623
+ color: "black",
624
+ fontSize: "18px"
625
+ },
626
+ // autofill: {
627
+ // backgroundColor: "yellow",
628
+ // },
629
+ // hover: {
630
+ // color: "blue",
631
+ // },
632
+ focus: {
633
+ color: "blue"
634
+ },
635
+ valid: {
636
+ color: "green"
637
+ },
638
+ invalid: {
639
+ color: "red"
640
+ },
641
+ placeholder: {
642
+ base: {
643
+ color: "gray",
644
+ marginLeft: "20px"
645
+ }
646
+ }
647
+ }
648
+ },
649
+ ready: () => {
650
+ m(!1);
651
+ },
652
+ frameValidationChanged: (i) => {
653
+ I(i);
654
+ },
655
+ cardSubmitted: () => {
656
+ S(!0);
657
+ },
658
+ cardTokenized: (i) => {
659
+ H(i.token);
660
+ },
661
+ cardTokenizationFailed: (i) => {
662
+ alert("card tokenization failed"), console.log(i);
663
+ },
664
+ children: [
665
+ /* @__PURE__ */ e(
666
+ ee,
667
+ {
668
+ label: "Name on Card",
669
+ value: p,
670
+ onChange: (i) => z(i.target.value, P, M),
671
+ error: x
672
+ }
673
+ ),
674
+ /* @__PURE__ */ e(
675
+ tt,
676
+ {
677
+ style: {
678
+ height: "4em",
679
+ margin: "20px 0",
680
+ padding: "20px",
681
+ border: "1px solid #999"
682
+ }
683
+ }
684
+ ),
685
+ /* @__PURE__ */ e(
686
+ rt,
687
+ {
688
+ style: {
689
+ height: "4em",
690
+ margin: "20px 0",
691
+ padding: "20px",
692
+ border: "1px solid #999"
693
+ }
694
+ }
695
+ ),
696
+ /* @__PURE__ */ e(
697
+ nt,
698
+ {
699
+ style: {
700
+ height: "4em",
701
+ margin: "20px 0",
702
+ padding: "20px",
703
+ border: "1px solid #999"
704
+ }
705
+ }
706
+ ),
707
+ /* @__PURE__ */ e(
708
+ ne,
709
+ {
710
+ onClick: () => {
711
+ fe.submitCard();
712
+ },
713
+ fullWidth: !0,
714
+ disabled: R,
715
+ children: /* @__PURE__ */ e("strong", { children: k ? /* @__PURE__ */ n(T, { children: [
716
+ /* @__PURE__ */ e(A, { size: 15, color: "inherit" }),
717
+ " Processing..."
718
+ ] }) : "Pay" })
719
+ }
720
+ )
721
+ ]
722
+ }
723
+ ) }),
724
+ /* @__PURE__ */ e(f, { mt: 8, children: /* @__PURE__ */ e("div", { id: "st-animated-card" }) })
725
+ ] });
726
+ }, ie = "FORM_SCREEN", ae = "CONFIRM_SCREEN", pt = "PAYMENT_SCREEN", ht = "MINIMAL_KYC_SCREEN", ft = ({ partnerKey: N, rrBaseUrl: b }) => {
727
+ const u = Je(), h = $((d) => d.order), C = $(
728
+ (d) => d.user.profile
729
+ ), r = h.error, y = $(
730
+ (d) => d.user.profile.everWalletAddress
731
+ ), F = $(
732
+ (d) => d.fiatAssets
733
+ ), v = $(
734
+ (d) => d.cryptoAssets
735
+ ), [E, m] = c(ie), [p, P] = c(0), { showAlertMessage: x, snackBar: M } = Qe();
736
+ return g(() => {
737
+ P(Xe(C.tokens.list));
738
+ }, [C.tokens]), g(() => {
739
+ r && x({ message: r });
740
+ }, [r]), g(() => {
741
+ h.initMinimalKyc && (x({ message: r, type: "info" }), m(ht));
742
+ }, [h.initMinimalKyc]), g(() => {
743
+ u(ct()), u(he(re)), u(he(te));
744
+ }, []), /* @__PURE__ */ n(T, { children: [
745
+ M,
746
+ /* @__PURE__ */ e(
747
+ f,
748
+ {
749
+ sx: {
750
+ padding: { xs: "1rem", md: "2rem" },
751
+ backgroundColor: "#FFFFFF",
752
+ borderRadius: "1rem",
753
+ boxShadow: "0px 0px 64px 0px rgba(247, 247, 248, 1)"
754
+ },
755
+ children: {
756
+ FORM_SCREEN: /* @__PURE__ */ e(
757
+ lt,
758
+ {
759
+ showAlertMessage: x,
760
+ setScreen: m,
761
+ fiatAssets: F,
762
+ cryptoAssets: v,
763
+ orderData: h,
764
+ dispatch: u,
765
+ getCryptoAssets: (d) => {
766
+ u(Oe({ type: "buy", id: d, partnerKey: N }));
767
+ },
768
+ partnerKey: N,
769
+ balance: p
770
+ }
771
+ ),
772
+ CONFIRM_SCREEN: /* @__PURE__ */ e(
773
+ mt,
774
+ {
775
+ partnerKey: N,
776
+ setScreen: m,
777
+ showAlertMessage: x,
778
+ orderData: h,
779
+ dispatch: u,
780
+ walletAddress: y
781
+ }
782
+ ),
783
+ PAYMENT_SCREEN: /* @__PURE__ */ e(
784
+ ut,
785
+ {
786
+ checkoutKey: "pk_sbox_xnmwsvzydkhjeyi34z4b6ea5qi4",
787
+ setScreen: m,
788
+ showAlertMessage: x,
789
+ orderData: h,
790
+ rrBaseUrl: b,
791
+ dispatch: u
792
+ }
793
+ ),
794
+ MINIMAL_KYC_SCREEN: /* @__PURE__ */ e(
795
+ Ze,
796
+ {
797
+ onComplete: () => {
798
+ m(ae);
799
+ }
800
+ }
801
+ )
802
+ }[E]
803
+ }
804
+ )
805
+ ] });
806
+ }, ir = ze(ft);
807
+ export {
808
+ lt as B,
809
+ ut as C,
810
+ ie as F,
811
+ ht as M,
812
+ pt as P,
813
+ mt as a,
814
+ ae as b,
815
+ ir as i
816
+ };