coinley-checkout 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/coinley-checkout.es.js +568 -601
- package/dist/coinley-checkout.umd.js +11 -11
- package/package.json +1 -1
@@ -1,5 +1,5 @@
|
|
1
|
-
import
|
2
|
-
var
|
1
|
+
import $e, { createContext as Be, useContext as Ze, useState as O, useEffect as X, lazy as wt, forwardRef as vt, useImperativeHandle as Nt } from "react";
|
2
|
+
var Ae = { exports: {} }, le = {};
|
3
3
|
/**
|
4
4
|
* @license React
|
5
5
|
* react-jsx-runtime.production.min.js
|
@@ -9,23 +9,23 @@ var De = { exports: {} }, le = {};
|
|
9
9
|
* This source code is licensed under the MIT license found in the
|
10
10
|
* LICENSE file in the root directory of this source tree.
|
11
11
|
*/
|
12
|
-
var
|
13
|
-
function
|
14
|
-
if (
|
12
|
+
var Ge;
|
13
|
+
function bt() {
|
14
|
+
if (Ge)
|
15
15
|
return le;
|
16
|
-
|
17
|
-
var a =
|
18
|
-
function
|
19
|
-
var
|
20
|
-
|
21
|
-
for (
|
22
|
-
c.call(
|
23
|
-
if (
|
24
|
-
for (
|
25
|
-
|
26
|
-
return { $$typeof: n, type:
|
16
|
+
Ge = 1;
|
17
|
+
var a = $e, n = Symbol.for("react.element"), i = Symbol.for("react.fragment"), c = Object.prototype.hasOwnProperty, x = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, d = { key: !0, ref: !0, __self: !0, __source: !0 };
|
18
|
+
function w(L, o, S) {
|
19
|
+
var M, C = {}, z = null, N = null;
|
20
|
+
S !== void 0 && (z = "" + S), o.key !== void 0 && (z = "" + o.key), o.ref !== void 0 && (N = o.ref);
|
21
|
+
for (M in o)
|
22
|
+
c.call(o, M) && !d.hasOwnProperty(M) && (C[M] = o[M]);
|
23
|
+
if (L && L.defaultProps)
|
24
|
+
for (M in o = L.defaultProps, o)
|
25
|
+
C[M] === void 0 && (C[M] = o[M]);
|
26
|
+
return { $$typeof: n, type: L, key: z, ref: N, props: C, _owner: x.current };
|
27
27
|
}
|
28
|
-
return le.Fragment =
|
28
|
+
return le.Fragment = i, le.jsx = w, le.jsxs = w, le;
|
29
29
|
}
|
30
30
|
var ue = {};
|
31
31
|
/**
|
@@ -37,91 +37,91 @@ var ue = {};
|
|
37
37
|
* This source code is licensed under the MIT license found in the
|
38
38
|
* LICENSE file in the root directory of this source tree.
|
39
39
|
*/
|
40
|
-
var
|
41
|
-
function
|
42
|
-
return
|
43
|
-
var a =
|
44
|
-
function
|
40
|
+
var We;
|
41
|
+
function Lt() {
|
42
|
+
return We || (We = 1, process.env.NODE_ENV !== "production" && function() {
|
43
|
+
var a = $e, n = Symbol.for("react.element"), i = Symbol.for("react.portal"), c = Symbol.for("react.fragment"), x = Symbol.for("react.strict_mode"), d = Symbol.for("react.profiler"), w = Symbol.for("react.provider"), L = Symbol.for("react.context"), o = Symbol.for("react.forward_ref"), S = Symbol.for("react.suspense"), M = Symbol.for("react.suspense_list"), C = Symbol.for("react.memo"), z = Symbol.for("react.lazy"), N = Symbol.for("react.offscreen"), U = Symbol.iterator, Y = "@@iterator";
|
44
|
+
function W(e) {
|
45
45
|
if (e === null || typeof e != "object")
|
46
46
|
return null;
|
47
|
-
var r =
|
47
|
+
var r = U && e[U] || e[Y];
|
48
48
|
return typeof r == "function" ? r : null;
|
49
49
|
}
|
50
|
-
var
|
51
|
-
function
|
50
|
+
var A = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
51
|
+
function p(e) {
|
52
52
|
{
|
53
|
-
for (var r = arguments.length,
|
54
|
-
|
55
|
-
se("error", e,
|
53
|
+
for (var r = arguments.length, s = new Array(r > 1 ? r - 1 : 0), l = 1; l < r; l++)
|
54
|
+
s[l - 1] = arguments[l];
|
55
|
+
se("error", e, s);
|
56
56
|
}
|
57
57
|
}
|
58
|
-
function se(e, r,
|
58
|
+
function se(e, r, s) {
|
59
59
|
{
|
60
|
-
var
|
61
|
-
|
62
|
-
var
|
63
|
-
return String(
|
60
|
+
var l = A.ReactDebugCurrentFrame, m = l.getStackAddendum();
|
61
|
+
m !== "" && (r += "%s", s = s.concat([m]));
|
62
|
+
var h = s.map(function(f) {
|
63
|
+
return String(f);
|
64
64
|
});
|
65
|
-
|
65
|
+
h.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, h);
|
66
66
|
}
|
67
67
|
}
|
68
|
-
var
|
68
|
+
var _ = !1, $ = !1, J = !1, oe = !1, F = !1, K;
|
69
69
|
K = Symbol.for("react.module.reference");
|
70
70
|
function B(e) {
|
71
|
-
return !!(typeof e == "string" || typeof e == "function" || e === c || e ===
|
71
|
+
return !!(typeof e == "string" || typeof e == "function" || e === c || e === d || F || e === x || e === S || e === M || oe || e === N || _ || $ || J || typeof e == "object" && e !== null && (e.$$typeof === z || e.$$typeof === C || e.$$typeof === w || e.$$typeof === L || e.$$typeof === o || // This needs to include all possible module reference object
|
72
72
|
// types supported by any Flight configuration anywhere since
|
73
73
|
// we don't know which Flight build this will end up being used
|
74
74
|
// with.
|
75
75
|
e.$$typeof === K || e.getModuleId !== void 0));
|
76
76
|
}
|
77
|
-
function ee(e, r,
|
78
|
-
var
|
79
|
-
if (
|
80
|
-
return
|
81
|
-
var
|
82
|
-
return
|
77
|
+
function ee(e, r, s) {
|
78
|
+
var l = e.displayName;
|
79
|
+
if (l)
|
80
|
+
return l;
|
81
|
+
var m = r.displayName || r.name || "";
|
82
|
+
return m !== "" ? s + "(" + m + ")" : s;
|
83
83
|
}
|
84
|
-
function
|
84
|
+
function Q(e) {
|
85
85
|
return e.displayName || "Context";
|
86
86
|
}
|
87
87
|
function I(e) {
|
88
88
|
if (e == null)
|
89
89
|
return null;
|
90
|
-
if (typeof e.tag == "number" &&
|
90
|
+
if (typeof e.tag == "number" && p("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
91
91
|
return e.displayName || e.name || null;
|
92
92
|
if (typeof e == "string")
|
93
93
|
return e;
|
94
94
|
switch (e) {
|
95
95
|
case c:
|
96
96
|
return "Fragment";
|
97
|
-
case
|
97
|
+
case i:
|
98
98
|
return "Portal";
|
99
|
-
case
|
99
|
+
case d:
|
100
100
|
return "Profiler";
|
101
|
-
case
|
101
|
+
case x:
|
102
102
|
return "StrictMode";
|
103
|
-
case
|
103
|
+
case S:
|
104
104
|
return "Suspense";
|
105
|
-
case
|
105
|
+
case M:
|
106
106
|
return "SuspenseList";
|
107
107
|
}
|
108
108
|
if (typeof e == "object")
|
109
109
|
switch (e.$$typeof) {
|
110
|
-
case
|
110
|
+
case L:
|
111
111
|
var r = e;
|
112
|
-
return
|
113
|
-
case
|
114
|
-
var
|
115
|
-
return
|
116
|
-
case
|
112
|
+
return Q(r) + ".Consumer";
|
113
|
+
case w:
|
114
|
+
var s = e;
|
115
|
+
return Q(s._context) + ".Provider";
|
116
|
+
case o:
|
117
117
|
return ee(e, e.render, "ForwardRef");
|
118
|
-
case
|
119
|
-
var
|
120
|
-
return
|
121
|
-
case
|
122
|
-
var
|
118
|
+
case C:
|
119
|
+
var l = e.displayName || null;
|
120
|
+
return l !== null ? l : I(e.type) || "Memo";
|
121
|
+
case z: {
|
122
|
+
var m = e, h = m._payload, f = m._init;
|
123
123
|
try {
|
124
|
-
return I(
|
124
|
+
return I(f(h));
|
125
125
|
} catch {
|
126
126
|
return null;
|
127
127
|
}
|
@@ -129,14 +129,14 @@ function bt() {
|
|
129
129
|
}
|
130
130
|
return null;
|
131
131
|
}
|
132
|
-
var
|
132
|
+
var k = Object.assign, j = 0, H, Z, q, T, de, g, y;
|
133
133
|
function fe() {
|
134
134
|
}
|
135
135
|
fe.__reactDisabledLog = !0;
|
136
|
-
function
|
136
|
+
function xe() {
|
137
137
|
{
|
138
|
-
if (
|
139
|
-
H = console.log, Z = console.info, q = console.warn,
|
138
|
+
if (j === 0) {
|
139
|
+
H = console.log, Z = console.info, q = console.warn, T = console.error, de = console.group, g = console.groupCollapsed, y = console.groupEnd;
|
140
140
|
var e = {
|
141
141
|
configurable: !0,
|
142
142
|
enumerable: !0,
|
@@ -153,222 +153,222 @@ function bt() {
|
|
153
153
|
groupEnd: e
|
154
154
|
});
|
155
155
|
}
|
156
|
-
|
156
|
+
j++;
|
157
157
|
}
|
158
158
|
}
|
159
159
|
function he() {
|
160
160
|
{
|
161
|
-
if (
|
161
|
+
if (j--, j === 0) {
|
162
162
|
var e = {
|
163
163
|
configurable: !0,
|
164
164
|
enumerable: !0,
|
165
165
|
writable: !0
|
166
166
|
};
|
167
167
|
Object.defineProperties(console, {
|
168
|
-
log:
|
168
|
+
log: k({}, e, {
|
169
169
|
value: H
|
170
170
|
}),
|
171
|
-
info:
|
171
|
+
info: k({}, e, {
|
172
172
|
value: Z
|
173
173
|
}),
|
174
|
-
warn:
|
174
|
+
warn: k({}, e, {
|
175
175
|
value: q
|
176
176
|
}),
|
177
|
-
error:
|
178
|
-
value:
|
177
|
+
error: k({}, e, {
|
178
|
+
value: T
|
179
179
|
}),
|
180
|
-
group:
|
180
|
+
group: k({}, e, {
|
181
181
|
value: de
|
182
182
|
}),
|
183
|
-
groupCollapsed:
|
184
|
-
value:
|
183
|
+
groupCollapsed: k({}, e, {
|
184
|
+
value: g
|
185
185
|
}),
|
186
|
-
groupEnd:
|
187
|
-
value:
|
186
|
+
groupEnd: k({}, e, {
|
187
|
+
value: y
|
188
188
|
})
|
189
189
|
});
|
190
190
|
}
|
191
|
-
|
191
|
+
j < 0 && p("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
192
192
|
}
|
193
193
|
}
|
194
|
-
var te =
|
195
|
-
function ge(e, r,
|
194
|
+
var te = A.ReactCurrentDispatcher, je;
|
195
|
+
function ge(e, r, s) {
|
196
196
|
{
|
197
197
|
if (je === void 0)
|
198
198
|
try {
|
199
199
|
throw Error();
|
200
|
-
} catch (
|
201
|
-
var
|
202
|
-
je =
|
200
|
+
} catch (m) {
|
201
|
+
var l = m.stack.trim().match(/\n( *(at )?)/);
|
202
|
+
je = l && l[1] || "";
|
203
203
|
}
|
204
204
|
return `
|
205
205
|
` + je + e;
|
206
206
|
}
|
207
207
|
}
|
208
|
-
var
|
208
|
+
var pe = !1, ye;
|
209
209
|
{
|
210
210
|
var Ve = typeof WeakMap == "function" ? WeakMap : Map;
|
211
211
|
ye = new Ve();
|
212
212
|
}
|
213
|
-
function
|
214
|
-
if (!e ||
|
213
|
+
function Te(e, r) {
|
214
|
+
if (!e || pe)
|
215
215
|
return "";
|
216
216
|
{
|
217
|
-
var
|
218
|
-
if (
|
219
|
-
return
|
217
|
+
var s = ye.get(e);
|
218
|
+
if (s !== void 0)
|
219
|
+
return s;
|
220
220
|
}
|
221
|
-
var
|
222
|
-
|
223
|
-
var
|
221
|
+
var l;
|
222
|
+
pe = !0;
|
223
|
+
var m = Error.prepareStackTrace;
|
224
224
|
Error.prepareStackTrace = void 0;
|
225
|
-
var
|
226
|
-
|
225
|
+
var h;
|
226
|
+
h = te.current, te.current = null, xe();
|
227
227
|
try {
|
228
228
|
if (r) {
|
229
|
-
var
|
229
|
+
var f = function() {
|
230
230
|
throw Error();
|
231
231
|
};
|
232
|
-
if (Object.defineProperty(
|
232
|
+
if (Object.defineProperty(f.prototype, "props", {
|
233
233
|
set: function() {
|
234
234
|
throw Error();
|
235
235
|
}
|
236
236
|
}), typeof Reflect == "object" && Reflect.construct) {
|
237
237
|
try {
|
238
|
-
Reflect.construct(
|
239
|
-
} catch (
|
240
|
-
|
238
|
+
Reflect.construct(f, []);
|
239
|
+
} catch (E) {
|
240
|
+
l = E;
|
241
241
|
}
|
242
|
-
Reflect.construct(e, [],
|
242
|
+
Reflect.construct(e, [], f);
|
243
243
|
} else {
|
244
244
|
try {
|
245
|
-
|
246
|
-
} catch (
|
247
|
-
|
245
|
+
f.call();
|
246
|
+
} catch (E) {
|
247
|
+
l = E;
|
248
248
|
}
|
249
|
-
e.call(
|
249
|
+
e.call(f.prototype);
|
250
250
|
}
|
251
251
|
} else {
|
252
252
|
try {
|
253
253
|
throw Error();
|
254
|
-
} catch (
|
255
|
-
|
254
|
+
} catch (E) {
|
255
|
+
l = E;
|
256
256
|
}
|
257
257
|
e();
|
258
258
|
}
|
259
|
-
} catch (
|
260
|
-
if (
|
261
|
-
for (var
|
262
|
-
`),
|
263
|
-
`),
|
264
|
-
|
265
|
-
for (;
|
266
|
-
if (
|
267
|
-
if (
|
259
|
+
} catch (E) {
|
260
|
+
if (E && l && typeof E.stack == "string") {
|
261
|
+
for (var u = E.stack.split(`
|
262
|
+
`), D = l.stack.split(`
|
263
|
+
`), v = u.length - 1, b = D.length - 1; v >= 1 && b >= 0 && u[v] !== D[b]; )
|
264
|
+
b--;
|
265
|
+
for (; v >= 1 && b >= 0; v--, b--)
|
266
|
+
if (u[v] !== D[b]) {
|
267
|
+
if (v !== 1 || b !== 1)
|
268
268
|
do
|
269
|
-
if (
|
269
|
+
if (v--, b--, b < 0 || u[v] !== D[b]) {
|
270
270
|
var R = `
|
271
|
-
` +
|
271
|
+
` + u[v].replace(" at new ", " at ");
|
272
272
|
return e.displayName && R.includes("<anonymous>") && (R = R.replace("<anonymous>", e.displayName)), typeof e == "function" && ye.set(e, R), R;
|
273
273
|
}
|
274
|
-
while (
|
274
|
+
while (v >= 1 && b >= 0);
|
275
275
|
break;
|
276
276
|
}
|
277
277
|
}
|
278
278
|
} finally {
|
279
|
-
|
279
|
+
pe = !1, te.current = h, he(), Error.prepareStackTrace = m;
|
280
280
|
}
|
281
281
|
var ae = e ? e.displayName || e.name : "", V = ae ? ge(ae) : "";
|
282
282
|
return typeof e == "function" && ye.set(e, V), V;
|
283
283
|
}
|
284
|
-
function Xe(e, r,
|
285
|
-
return
|
284
|
+
function Xe(e, r, s) {
|
285
|
+
return Te(e, !1);
|
286
286
|
}
|
287
287
|
function Je(e) {
|
288
288
|
var r = e.prototype;
|
289
289
|
return !!(r && r.isReactComponent);
|
290
290
|
}
|
291
|
-
function
|
291
|
+
function me(e, r, s) {
|
292
292
|
if (e == null)
|
293
293
|
return "";
|
294
294
|
if (typeof e == "function")
|
295
|
-
return
|
295
|
+
return Te(e, Je(e));
|
296
296
|
if (typeof e == "string")
|
297
297
|
return ge(e);
|
298
298
|
switch (e) {
|
299
|
-
case
|
299
|
+
case S:
|
300
300
|
return ge("Suspense");
|
301
|
-
case
|
301
|
+
case M:
|
302
302
|
return ge("SuspenseList");
|
303
303
|
}
|
304
304
|
if (typeof e == "object")
|
305
305
|
switch (e.$$typeof) {
|
306
|
-
case
|
306
|
+
case o:
|
307
307
|
return Xe(e.render);
|
308
|
-
case
|
309
|
-
return
|
310
|
-
case
|
311
|
-
var
|
308
|
+
case C:
|
309
|
+
return me(e.type, r, s);
|
310
|
+
case z: {
|
311
|
+
var l = e, m = l._payload, h = l._init;
|
312
312
|
try {
|
313
|
-
return
|
313
|
+
return me(h(m), r, s);
|
314
314
|
} catch {
|
315
315
|
}
|
316
316
|
}
|
317
317
|
}
|
318
318
|
return "";
|
319
319
|
}
|
320
|
-
var ie = Object.prototype.hasOwnProperty,
|
321
|
-
function
|
320
|
+
var ie = Object.prototype.hasOwnProperty, De = {}, Ie = A.ReactDebugCurrentFrame;
|
321
|
+
function Me(e) {
|
322
322
|
if (e) {
|
323
|
-
var r = e._owner,
|
324
|
-
Ie.setExtraStackFrame(
|
323
|
+
var r = e._owner, s = me(e.type, e._source, r ? r.type : null);
|
324
|
+
Ie.setExtraStackFrame(s);
|
325
325
|
} else
|
326
326
|
Ie.setExtraStackFrame(null);
|
327
327
|
}
|
328
|
-
function Ke(e, r,
|
328
|
+
function Ke(e, r, s, l, m) {
|
329
329
|
{
|
330
|
-
var
|
331
|
-
for (var
|
332
|
-
if (
|
333
|
-
var
|
330
|
+
var h = Function.call.bind(ie);
|
331
|
+
for (var f in e)
|
332
|
+
if (h(e, f)) {
|
333
|
+
var u = void 0;
|
334
334
|
try {
|
335
|
-
if (typeof e[
|
336
|
-
var
|
337
|
-
throw
|
335
|
+
if (typeof e[f] != "function") {
|
336
|
+
var D = Error((l || "React class") + ": " + s + " type `" + f + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[f] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
337
|
+
throw D.name = "Invariant Violation", D;
|
338
338
|
}
|
339
|
-
|
340
|
-
} catch (
|
341
|
-
|
339
|
+
u = e[f](r, f, l, s, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
340
|
+
} catch (v) {
|
341
|
+
u = v;
|
342
342
|
}
|
343
|
-
|
343
|
+
u && !(u instanceof Error) && (Me(m), p("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", l || "React class", s, f, typeof u), Me(null)), u instanceof Error && !(u.message in De) && (De[u.message] = !0, Me(m), p("Failed %s type: %s", s, u.message), Me(null));
|
344
344
|
}
|
345
345
|
}
|
346
346
|
}
|
347
347
|
var et = Array.isArray;
|
348
|
-
function
|
348
|
+
function we(e) {
|
349
349
|
return et(e);
|
350
350
|
}
|
351
351
|
function tt(e) {
|
352
352
|
{
|
353
|
-
var r = typeof Symbol == "function" && Symbol.toStringTag,
|
354
|
-
return
|
353
|
+
var r = typeof Symbol == "function" && Symbol.toStringTag, s = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
354
|
+
return s;
|
355
355
|
}
|
356
356
|
}
|
357
357
|
function rt(e) {
|
358
358
|
try {
|
359
|
-
return
|
359
|
+
return Ee(e), !1;
|
360
360
|
} catch {
|
361
361
|
return !0;
|
362
362
|
}
|
363
363
|
}
|
364
|
-
function
|
364
|
+
function Ee(e) {
|
365
365
|
return "" + e;
|
366
366
|
}
|
367
|
-
function
|
367
|
+
function ke(e) {
|
368
368
|
if (rt(e))
|
369
|
-
return
|
369
|
+
return p("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", tt(e)), Ee(e);
|
370
370
|
}
|
371
|
-
var ce =
|
371
|
+
var ce = A.ReactCurrentOwner, at = {
|
372
372
|
key: !0,
|
373
373
|
ref: !0,
|
374
374
|
__self: !0,
|
@@ -393,84 +393,84 @@ function bt() {
|
|
393
393
|
}
|
394
394
|
function ot(e, r) {
|
395
395
|
if (typeof e.ref == "string" && ce.current && r && ce.current.stateNode !== r) {
|
396
|
-
var
|
397
|
-
ve[
|
396
|
+
var s = I(ce.current.type);
|
397
|
+
ve[s] || (p('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', I(ce.current.type), e.ref), ve[s] = !0);
|
398
398
|
}
|
399
399
|
}
|
400
400
|
function it(e, r) {
|
401
401
|
{
|
402
|
-
var
|
403
|
-
Oe || (Oe = !0,
|
402
|
+
var s = function() {
|
403
|
+
Oe || (Oe = !0, p("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
404
404
|
};
|
405
|
-
|
406
|
-
get:
|
405
|
+
s.isReactWarning = !0, Object.defineProperty(e, "key", {
|
406
|
+
get: s,
|
407
407
|
configurable: !0
|
408
408
|
});
|
409
409
|
}
|
410
410
|
}
|
411
411
|
function ct(e, r) {
|
412
412
|
{
|
413
|
-
var
|
414
|
-
Pe || (Pe = !0,
|
413
|
+
var s = function() {
|
414
|
+
Pe || (Pe = !0, p("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
415
415
|
};
|
416
|
-
|
417
|
-
get:
|
416
|
+
s.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
417
|
+
get: s,
|
418
418
|
configurable: !0
|
419
419
|
});
|
420
420
|
}
|
421
421
|
}
|
422
|
-
var lt = function(e, r,
|
423
|
-
var
|
422
|
+
var lt = function(e, r, s, l, m, h, f) {
|
423
|
+
var u = {
|
424
424
|
// This tag allows us to uniquely identify this as a React Element
|
425
425
|
$$typeof: n,
|
426
426
|
// Built-in properties that belong on the element
|
427
427
|
type: e,
|
428
428
|
key: r,
|
429
|
-
ref:
|
430
|
-
props:
|
429
|
+
ref: s,
|
430
|
+
props: f,
|
431
431
|
// Record the component responsible for creating this element.
|
432
|
-
_owner:
|
432
|
+
_owner: h
|
433
433
|
};
|
434
|
-
return
|
434
|
+
return u._store = {}, Object.defineProperty(u._store, "validated", {
|
435
435
|
configurable: !1,
|
436
436
|
enumerable: !1,
|
437
437
|
writable: !0,
|
438
438
|
value: !1
|
439
|
-
}), Object.defineProperty(
|
439
|
+
}), Object.defineProperty(u, "_self", {
|
440
440
|
configurable: !1,
|
441
441
|
enumerable: !1,
|
442
442
|
writable: !1,
|
443
|
-
value:
|
444
|
-
}), Object.defineProperty(
|
443
|
+
value: l
|
444
|
+
}), Object.defineProperty(u, "_source", {
|
445
445
|
configurable: !1,
|
446
446
|
enumerable: !1,
|
447
447
|
writable: !1,
|
448
|
-
value:
|
449
|
-
}), Object.freeze && (Object.freeze(
|
448
|
+
value: m
|
449
|
+
}), Object.freeze && (Object.freeze(u.props), Object.freeze(u)), u;
|
450
450
|
};
|
451
|
-
function ut(e, r,
|
451
|
+
function ut(e, r, s, l, m) {
|
452
452
|
{
|
453
|
-
var
|
454
|
-
|
455
|
-
for (
|
456
|
-
ie.call(r,
|
453
|
+
var h, f = {}, u = null, D = null;
|
454
|
+
s !== void 0 && (ke(s), u = "" + s), st(r) && (ke(r.key), u = "" + r.key), nt(r) && (D = r.ref, ot(r, m));
|
455
|
+
for (h in r)
|
456
|
+
ie.call(r, h) && !at.hasOwnProperty(h) && (f[h] = r[h]);
|
457
457
|
if (e && e.defaultProps) {
|
458
|
-
var
|
459
|
-
for (
|
460
|
-
|
458
|
+
var v = e.defaultProps;
|
459
|
+
for (h in v)
|
460
|
+
f[h] === void 0 && (f[h] = v[h]);
|
461
461
|
}
|
462
|
-
if (
|
463
|
-
var
|
464
|
-
|
462
|
+
if (u || D) {
|
463
|
+
var b = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
464
|
+
u && it(f, b), D && ct(f, b);
|
465
465
|
}
|
466
|
-
return lt(e,
|
466
|
+
return lt(e, u, D, m, l, ce.current, f);
|
467
467
|
}
|
468
468
|
}
|
469
|
-
var Ne =
|
469
|
+
var Ne = A.ReactCurrentOwner, Re = A.ReactDebugCurrentFrame;
|
470
470
|
function re(e) {
|
471
471
|
if (e) {
|
472
|
-
var r = e._owner,
|
473
|
-
Re.setExtraStackFrame(
|
472
|
+
var r = e._owner, s = me(e.type, e._source, r ? r.type : null);
|
473
|
+
Re.setExtraStackFrame(s);
|
474
474
|
} else
|
475
475
|
Re.setExtraStackFrame(null);
|
476
476
|
}
|
@@ -479,7 +479,7 @@ function bt() {
|
|
479
479
|
function Le(e) {
|
480
480
|
return typeof e == "object" && e !== null && e.$$typeof === n;
|
481
481
|
}
|
482
|
-
function
|
482
|
+
function ze() {
|
483
483
|
{
|
484
484
|
if (Ne.current) {
|
485
485
|
var e = I(Ne.current.type);
|
@@ -494,56 +494,56 @@ Check the render method of \`` + e + "`.";
|
|
494
494
|
function dt(e) {
|
495
495
|
{
|
496
496
|
if (e !== void 0) {
|
497
|
-
var r = e.fileName.replace(/^.*[\\\/]/, ""),
|
497
|
+
var r = e.fileName.replace(/^.*[\\\/]/, ""), s = e.lineNumber;
|
498
498
|
return `
|
499
499
|
|
500
|
-
Check your code at ` + r + ":" +
|
500
|
+
Check your code at ` + r + ":" + s + ".";
|
501
501
|
}
|
502
502
|
return "";
|
503
503
|
}
|
504
504
|
}
|
505
|
-
var
|
505
|
+
var Ue = {};
|
506
506
|
function ft(e) {
|
507
507
|
{
|
508
|
-
var r =
|
508
|
+
var r = ze();
|
509
509
|
if (!r) {
|
510
|
-
var
|
511
|
-
|
510
|
+
var s = typeof e == "string" ? e : e.displayName || e.name;
|
511
|
+
s && (r = `
|
512
512
|
|
513
|
-
Check the top-level render call using <` +
|
513
|
+
Check the top-level render call using <` + s + ">.");
|
514
514
|
}
|
515
515
|
return r;
|
516
516
|
}
|
517
517
|
}
|
518
|
-
function
|
518
|
+
function Ye(e, r) {
|
519
519
|
{
|
520
520
|
if (!e._store || e._store.validated || e.key != null)
|
521
521
|
return;
|
522
522
|
e._store.validated = !0;
|
523
|
-
var
|
524
|
-
if (
|
523
|
+
var s = ft(r);
|
524
|
+
if (Ue[s])
|
525
525
|
return;
|
526
|
-
|
527
|
-
var
|
528
|
-
e && e._owner && e._owner !== Ne.current && (
|
526
|
+
Ue[s] = !0;
|
527
|
+
var l = "";
|
528
|
+
e && e._owner && e._owner !== Ne.current && (l = " It was passed a child from " + I(e._owner.type) + "."), re(e), p('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', s, l), re(null);
|
529
529
|
}
|
530
530
|
}
|
531
|
-
function
|
531
|
+
function Fe(e, r) {
|
532
532
|
{
|
533
533
|
if (typeof e != "object")
|
534
534
|
return;
|
535
|
-
if (
|
536
|
-
for (var
|
537
|
-
var
|
538
|
-
Le(
|
535
|
+
if (we(e))
|
536
|
+
for (var s = 0; s < e.length; s++) {
|
537
|
+
var l = e[s];
|
538
|
+
Le(l) && Ye(l, r);
|
539
539
|
}
|
540
540
|
else if (Le(e))
|
541
541
|
e._store && (e._store.validated = !0);
|
542
542
|
else if (e) {
|
543
|
-
var
|
544
|
-
if (typeof
|
545
|
-
for (var
|
546
|
-
Le(
|
543
|
+
var m = W(e);
|
544
|
+
if (typeof m == "function" && m !== e.entries)
|
545
|
+
for (var h = m.call(e), f; !(f = h.next()).done; )
|
546
|
+
Le(f.value) && Ye(f.value, r);
|
547
547
|
}
|
548
548
|
}
|
549
549
|
}
|
@@ -552,115 +552,115 @@ Check the top-level render call using <` + o + ">.");
|
|
552
552
|
var r = e.type;
|
553
553
|
if (r == null || typeof r == "string")
|
554
554
|
return;
|
555
|
-
var
|
555
|
+
var s;
|
556
556
|
if (typeof r == "function")
|
557
|
-
|
558
|
-
else if (typeof r == "object" && (r.$$typeof ===
|
557
|
+
s = r.propTypes;
|
558
|
+
else if (typeof r == "object" && (r.$$typeof === o || // Note: Memo only checks outer props here.
|
559
559
|
// Inner props are checked in the reconciler.
|
560
|
-
r.$$typeof ===
|
561
|
-
|
560
|
+
r.$$typeof === C))
|
561
|
+
s = r.propTypes;
|
562
562
|
else
|
563
563
|
return;
|
564
|
-
if (
|
565
|
-
var
|
566
|
-
Ke(
|
564
|
+
if (s) {
|
565
|
+
var l = I(r);
|
566
|
+
Ke(s, e.props, "prop", l, e);
|
567
567
|
} else if (r.PropTypes !== void 0 && !be) {
|
568
568
|
be = !0;
|
569
|
-
var
|
570
|
-
|
569
|
+
var m = I(r);
|
570
|
+
p("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", m || "Unknown");
|
571
571
|
}
|
572
|
-
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved &&
|
572
|
+
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && p("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
573
573
|
}
|
574
574
|
}
|
575
575
|
function yt(e) {
|
576
576
|
{
|
577
|
-
for (var r = Object.keys(e.props),
|
578
|
-
var
|
579
|
-
if (
|
580
|
-
re(e),
|
577
|
+
for (var r = Object.keys(e.props), s = 0; s < r.length; s++) {
|
578
|
+
var l = r[s];
|
579
|
+
if (l !== "children" && l !== "key") {
|
580
|
+
re(e), p("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", l), re(null);
|
581
581
|
break;
|
582
582
|
}
|
583
583
|
}
|
584
|
-
e.ref !== null && (re(e),
|
584
|
+
e.ref !== null && (re(e), p("Invalid attribute `ref` supplied to `React.Fragment`."), re(null));
|
585
585
|
}
|
586
586
|
}
|
587
|
-
var
|
588
|
-
function
|
587
|
+
var _e = {};
|
588
|
+
function Qe(e, r, s, l, m, h) {
|
589
589
|
{
|
590
|
-
var
|
591
|
-
if (!
|
592
|
-
var
|
593
|
-
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (
|
594
|
-
var
|
595
|
-
|
596
|
-
var
|
597
|
-
e === null ?
|
590
|
+
var f = B(e);
|
591
|
+
if (!f) {
|
592
|
+
var u = "";
|
593
|
+
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (u += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
594
|
+
var D = dt(m);
|
595
|
+
D ? u += D : u += ze();
|
596
|
+
var v;
|
597
|
+
e === null ? v = "null" : we(e) ? v = "array" : e !== void 0 && e.$$typeof === n ? (v = "<" + (I(e.type) || "Unknown") + " />", u = " Did you accidentally export a JSX literal instead of a component?") : v = typeof e, p("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", v, u);
|
598
598
|
}
|
599
|
-
var
|
600
|
-
if (
|
601
|
-
return
|
602
|
-
if (
|
599
|
+
var b = ut(e, r, s, m, h);
|
600
|
+
if (b == null)
|
601
|
+
return b;
|
602
|
+
if (f) {
|
603
603
|
var R = r.children;
|
604
604
|
if (R !== void 0)
|
605
|
-
if (
|
606
|
-
if (
|
605
|
+
if (l)
|
606
|
+
if (we(R)) {
|
607
607
|
for (var ae = 0; ae < R.length; ae++)
|
608
|
-
|
608
|
+
Fe(R[ae], e);
|
609
609
|
Object.freeze && Object.freeze(R);
|
610
610
|
} else
|
611
|
-
|
611
|
+
p("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
612
612
|
else
|
613
|
-
|
613
|
+
Fe(R, e);
|
614
614
|
}
|
615
615
|
if (ie.call(r, "key")) {
|
616
|
-
var V = I(e),
|
617
|
-
return
|
618
|
-
}), Se =
|
619
|
-
if (!
|
620
|
-
var jt =
|
621
|
-
|
616
|
+
var V = I(e), E = Object.keys(r).filter(function(pt) {
|
617
|
+
return pt !== "key";
|
618
|
+
}), Se = E.length > 0 ? "{key: someKey, " + E.join(": ..., ") + ": ...}" : "{key: someKey}";
|
619
|
+
if (!_e[V + Se]) {
|
620
|
+
var jt = E.length > 0 ? "{" + E.join(": ..., ") + ": ...}" : "{}";
|
621
|
+
p(`A props object containing a "key" prop is being spread into JSX:
|
622
622
|
let props = %s;
|
623
623
|
<%s {...props} />
|
624
624
|
React keys must be passed directly to JSX without using spread:
|
625
625
|
let props = %s;
|
626
|
-
<%s key={someKey} {...props} />`, Se, V, jt, V),
|
626
|
+
<%s key={someKey} {...props} />`, Se, V, jt, V), _e[V + Se] = !0;
|
627
627
|
}
|
628
628
|
}
|
629
|
-
return e === c ? yt(
|
629
|
+
return e === c ? yt(b) : gt(b), b;
|
630
630
|
}
|
631
631
|
}
|
632
|
-
function
|
633
|
-
return
|
632
|
+
function mt(e, r, s) {
|
633
|
+
return Qe(e, r, s, !0);
|
634
634
|
}
|
635
|
-
function
|
636
|
-
return
|
635
|
+
function Mt(e, r, s) {
|
636
|
+
return Qe(e, r, s, !1);
|
637
637
|
}
|
638
|
-
var
|
639
|
-
ue.Fragment = c, ue.jsx =
|
638
|
+
var xt = Mt, ht = mt;
|
639
|
+
ue.Fragment = c, ue.jsx = xt, ue.jsxs = ht;
|
640
640
|
}()), ue;
|
641
641
|
}
|
642
|
-
process.env.NODE_ENV === "production" ?
|
643
|
-
var t =
|
644
|
-
const He = Be(),
|
645
|
-
const [
|
646
|
-
c((
|
642
|
+
process.env.NODE_ENV === "production" ? Ae.exports = bt() : Ae.exports = Lt();
|
643
|
+
var t = Ae.exports;
|
644
|
+
const He = Be(), St = () => Ze(He), Qt = ({ initialTheme: a = "light", children: n }) => {
|
645
|
+
const [i, c] = O(a), x = () => {
|
646
|
+
c((d) => d === "light" ? "dark" : "light");
|
647
647
|
};
|
648
648
|
return X(() => {
|
649
|
-
document.documentElement.classList.remove("light", "dark"), document.documentElement.classList.add(
|
650
|
-
}, [
|
649
|
+
document.documentElement.classList.remove("light", "dark"), document.documentElement.classList.add(i);
|
650
|
+
}, [i]), /* @__PURE__ */ t.jsx(He.Provider, { value: { theme: i, setTheme: c, toggleTheme: x }, children: n });
|
651
651
|
};
|
652
652
|
let P = {
|
653
653
|
apiKey: null,
|
654
654
|
apiSecret: null,
|
655
655
|
apiUrl: "https://coinleyserver-production.up.railway.app"
|
656
656
|
};
|
657
|
-
const
|
657
|
+
const Ct = (a) => {
|
658
658
|
P = { ...P, ...a }, console.log("API initialized with:", P);
|
659
659
|
}, ne = () => ({
|
660
660
|
"Content-Type": "application/json",
|
661
661
|
"x-api-key": P.apiKey,
|
662
662
|
"x-api-secret": P.apiSecret
|
663
|
-
}),
|
663
|
+
}), At = async (a) => {
|
664
664
|
try {
|
665
665
|
console.log("Creating payment with data:", a), console.log("API URL:", `${P.apiUrl}/api/payments/create`);
|
666
666
|
const n = await fetch(`${P.apiUrl}/api/payments/create`, {
|
@@ -672,12 +672,12 @@ const St = (a) => {
|
|
672
672
|
const c = await n.json();
|
673
673
|
throw console.error("Error creating payment:", c), new Error(c.error || `Failed to create payment: ${n.status}`);
|
674
674
|
}
|
675
|
-
const
|
676
|
-
return console.log("Create payment response data:",
|
675
|
+
const i = await n.json();
|
676
|
+
return console.log("Create payment response data:", i), i;
|
677
677
|
} catch (n) {
|
678
678
|
throw console.error("Create payment error:", n), n;
|
679
679
|
}
|
680
|
-
},
|
680
|
+
}, Gt = async (a) => {
|
681
681
|
try {
|
682
682
|
console.log("Getting payment:", a);
|
683
683
|
const n = await fetch(`${P.apiUrl}/api/payments/${a}`, {
|
@@ -688,12 +688,12 @@ const St = (a) => {
|
|
688
688
|
const c = await n.json();
|
689
689
|
throw console.error("Error getting payment:", c), new Error(c.error || `Failed to get payment: ${n.status}`);
|
690
690
|
}
|
691
|
-
const
|
692
|
-
return console.log("Get payment response:",
|
691
|
+
const i = await n.json();
|
692
|
+
return console.log("Get payment response:", i), i;
|
693
693
|
} catch (n) {
|
694
694
|
throw console.error("Get payment error:", n), n;
|
695
695
|
}
|
696
|
-
},
|
696
|
+
}, Tt = async (a) => {
|
697
697
|
try {
|
698
698
|
console.log("Processing payment with data:", a), console.log("API URL:", `${P.apiUrl}/api/payments/process`);
|
699
699
|
const n = await fetch(`${P.apiUrl}/api/payments/process`, {
|
@@ -705,28 +705,28 @@ const St = (a) => {
|
|
705
705
|
const c = await n.json();
|
706
706
|
throw console.error("Error processing payment:", c), new Error(c.error || `Failed to process payment: ${n.status}`);
|
707
707
|
}
|
708
|
-
const
|
709
|
-
return console.log("Process payment response data:",
|
708
|
+
const i = await n.json();
|
709
|
+
return console.log("Process payment response data:", i), i;
|
710
710
|
} catch (n) {
|
711
711
|
throw console.error("Process payment error:", n), n;
|
712
712
|
}
|
713
|
-
},
|
713
|
+
}, Wt = async (a = {}) => {
|
714
714
|
try {
|
715
|
-
const { page: n = 1, limit:
|
716
|
-
|
717
|
-
const
|
715
|
+
const { page: n = 1, limit: i = 10, status: c, currency: x, startDate: d, endDate: w, search: L } = a, o = new URLSearchParams();
|
716
|
+
o.append("page", n), o.append("limit", i), c && o.append("status", c), x && o.append("currency", x), d && o.append("startDate", d), w && o.append("endDate", w), L && o.append("search", L);
|
717
|
+
const S = `${P.apiUrl}/api/payments/merchant/list?${o.toString()}`, M = await fetch(S, {
|
718
718
|
method: "GET",
|
719
719
|
headers: ne()
|
720
720
|
});
|
721
|
-
if (!
|
722
|
-
const
|
723
|
-
throw new Error(
|
721
|
+
if (!M.ok) {
|
722
|
+
const C = await M.json();
|
723
|
+
throw new Error(C.error || `Failed to get payments: ${M.status}`);
|
724
724
|
}
|
725
|
-
return await
|
725
|
+
return await M.json();
|
726
726
|
} catch (n) {
|
727
727
|
throw console.error("Get merchant payments error:", n), n;
|
728
728
|
}
|
729
|
-
},
|
729
|
+
}, $t = async () => {
|
730
730
|
try {
|
731
731
|
const a = await fetch(`${P.apiUrl}/api/payments/merchant/stats`, {
|
732
732
|
method: "GET",
|
@@ -740,7 +740,7 @@ const St = (a) => {
|
|
740
740
|
} catch (a) {
|
741
741
|
throw console.error("Get merchant payment stats error:", a), a;
|
742
742
|
}
|
743
|
-
},
|
743
|
+
}, Bt = async () => {
|
744
744
|
try {
|
745
745
|
const a = await fetch(`${P.apiUrl}/api/payments/currencies`, {
|
746
746
|
method: "GET",
|
@@ -762,35 +762,54 @@ const St = (a) => {
|
|
762
762
|
]
|
763
763
|
};
|
764
764
|
}
|
765
|
-
}, qe = Be(),
|
765
|
+
}, qe = Be(), Dt = () => Ze(qe), Zt = ({
|
766
766
|
apiKey: a,
|
767
767
|
apiSecret: n,
|
768
|
-
apiUrl:
|
768
|
+
apiUrl: i = "https://coinleyserver-production.up.railway.app",
|
769
769
|
debug: c = !1,
|
770
|
-
children:
|
770
|
+
children: x
|
771
771
|
}) => {
|
772
|
-
const [
|
772
|
+
const [d, w] = O(!1), [L, o] = O(null);
|
773
773
|
X(() => {
|
774
774
|
if (!a || !n) {
|
775
|
-
|
775
|
+
o("API key and secret are required");
|
776
776
|
return;
|
777
777
|
}
|
778
778
|
try {
|
779
|
-
|
780
|
-
} catch (
|
781
|
-
|
779
|
+
Ct({ apiKey: a, apiSecret: n, apiUrl: i }), w(!0), c && console.log("Coinley SDK initialized with:", { apiKey: a, apiUrl: i });
|
780
|
+
} catch (M) {
|
781
|
+
o(M.message), c && console.error("Coinley SDK initialization error:", M);
|
782
782
|
}
|
783
|
-
}, [a, n,
|
784
|
-
const
|
783
|
+
}, [a, n, i, c]);
|
784
|
+
const S = {
|
785
785
|
apiKey: a,
|
786
786
|
apiSecret: n,
|
787
|
-
apiUrl:
|
788
|
-
isInitialized:
|
789
|
-
error:
|
787
|
+
apiUrl: i,
|
788
|
+
isInitialized: d,
|
789
|
+
error: L,
|
790
790
|
debug: c
|
791
791
|
};
|
792
|
-
return /* @__PURE__ */ t.jsx(qe.Provider, { value:
|
793
|
-
},
|
792
|
+
return /* @__PURE__ */ t.jsx(qe.Provider, { value: S, children: x });
|
793
|
+
}, It = ({ walletAddress: a, amount: n, currency: i, theme: c = "light" }) => /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col items-center", children: [
|
794
|
+
/* @__PURE__ */ t.jsx("div", { className: `p-4 rounded-lg ${c === "dark" ? "bg-gray-700" : "bg-white"} mb-3`, children: /* @__PURE__ */ t.jsxs("div", { style: { width: "200px", height: "200px", backgroundColor: "#f0f0f0", display: "flex", alignItems: "center", justifyContent: "center" }, children: [
|
795
|
+
"QR Code: ",
|
796
|
+
i
|
797
|
+
] }) }),
|
798
|
+
/* @__PURE__ */ t.jsx("div", { className: "text-center text-sm", children: "Scan with your wallet app to pay" }),
|
799
|
+
a && /* @__PURE__ */ t.jsxs("div", { className: "mt-3 w-full", children: [
|
800
|
+
/* @__PURE__ */ t.jsxs("p", { className: "text-xs mb-1", children: [
|
801
|
+
"Send ",
|
802
|
+
n,
|
803
|
+
" ",
|
804
|
+
i,
|
805
|
+
" to:"
|
806
|
+
] }),
|
807
|
+
/* @__PURE__ */ t.jsx("div", { className: "text-xs font-mono p-2 rounded overflow-auto break-all bg-gray-100", children: a })
|
808
|
+
] })
|
809
|
+
] }), Et = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
810
|
+
__proto__: null,
|
811
|
+
default: It
|
812
|
+
}, Symbol.toStringTag, { value: "Module" })), kt = ({ onSelect: a, selected: n, theme: i = "light" }) => {
|
794
813
|
console.log("PaymentMethods render:", { selected: n });
|
795
814
|
const c = [
|
796
815
|
{
|
@@ -823,23 +842,23 @@ const St = (a) => {
|
|
823
842
|
description: "USD Coin on Solana",
|
824
843
|
logo: "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48Y2lyY2xlIGN4PSIxNiIgY3k9IjE2IiByPSIxNiIgZmlsbD0iIzJCNzVFRCIvPjxwYXRoIGZpbGw9IiNGRkYiIGQ9Ik0yMS4yMDkgOS43MzlsLTIuOTQxIDIuOTQxYTMuMTMyIDMuMTMyIDAgMDAtNC41MzYgMGwtMi45NDItMi45NDFhNy42MjMgNy42MjMgMCAwMTEwLjQxOSAwek0xMC43OTEgMjIuMjYxbDIuOTQxLTIuOTQxYTMuMTMyIDMuMTMyIDAgMDA0LjUzNiAwbDIuOTQyIDIuOTQxYTcuNjIzIDcuNjIzIDAgMDEtMTAuNDE5IDB6bTExLjU3NS00LjI2MWgtNC4xNTNhMy4xMzMgMy4xMzMgMCAwMDAtNC41MzdoNC4xNTNhNy42MjEgNy42MjEgMCAwMTAgNC41Mzd6bS0xMy43OTMtNC41MzdoNC4xNTNhMy4xMzMgMy4xMzMgMCAwMDAgNC41MzdIOS42ODZhNy42MjEgNy42MjEgMCAwMTAtNC41Mzd6Ii8+PC9nPjwvc3ZnPg=="
|
825
844
|
}
|
826
|
-
],
|
827
|
-
console.log("Method selected:",
|
845
|
+
], x = (d) => {
|
846
|
+
console.log("Method selected:", d), a(d);
|
828
847
|
};
|
829
848
|
return /* @__PURE__ */ t.jsxs("div", { children: [
|
830
|
-
/* @__PURE__ */ t.jsx("h3", { className: `text-lg font-medium mb-3 ${
|
831
|
-
/* @__PURE__ */ t.jsx("div", { className: "space-y-2", children: c.map((
|
849
|
+
/* @__PURE__ */ t.jsx("h3", { className: `text-lg font-medium mb-3 ${i === "dark" ? "text-white" : "text-gray-800"}`, children: "Select Payment Method" }),
|
850
|
+
/* @__PURE__ */ t.jsx("div", { className: "space-y-2", children: c.map((d) => /* @__PURE__ */ t.jsxs(
|
832
851
|
"button",
|
833
852
|
{
|
834
|
-
onClick: () =>
|
835
|
-
className: `w-full flex items-center p-3 rounded-lg transition-colors ${n ===
|
853
|
+
onClick: () => x(d.id),
|
854
|
+
className: `w-full flex items-center p-3 rounded-lg transition-colors ${n === d.id ? i === "dark" ? "bg-blue-900/30 border border-blue-500" : "bg-blue-50 border border-blue-500" : i === "dark" ? "bg-gray-700 hover:bg-gray-600 border border-gray-700" : "bg-white hover:bg-gray-50 border border-gray-200"}`,
|
836
855
|
children: [
|
837
|
-
/* @__PURE__ */ t.jsx("div", { className: "flex-shrink-0 h-10 w-10 bg-white rounded-full flex items-center justify-center mr-3", children: /* @__PURE__ */ t.jsx("img", { src:
|
856
|
+
/* @__PURE__ */ t.jsx("div", { className: "flex-shrink-0 h-10 w-10 bg-white rounded-full flex items-center justify-center mr-3", children: /* @__PURE__ */ t.jsx("img", { src: d.logo, alt: d.name, className: "h-6 w-6" }) }),
|
838
857
|
/* @__PURE__ */ t.jsxs("div", { className: "flex-1 text-left", children: [
|
839
|
-
/* @__PURE__ */ t.jsx("h4", { className: `font-medium ${
|
840
|
-
/* @__PURE__ */ t.jsx("p", { className: `text-sm ${
|
858
|
+
/* @__PURE__ */ t.jsx("h4", { className: `font-medium ${i === "dark" ? "text-white" : "text-gray-900"}`, children: d.name }),
|
859
|
+
/* @__PURE__ */ t.jsx("p", { className: `text-sm ${i === "dark" ? "text-gray-300" : "text-gray-500"}`, children: d.description })
|
841
860
|
] }),
|
842
|
-
n ===
|
861
|
+
n === d.id && /* @__PURE__ */ t.jsx(
|
843
862
|
"svg",
|
844
863
|
{
|
845
864
|
xmlns: "http://www.w3.org/2000/svg",
|
@@ -858,11 +877,11 @@ const St = (a) => {
|
|
858
877
|
)
|
859
878
|
]
|
860
879
|
},
|
861
|
-
|
880
|
+
d.id
|
862
881
|
)) })
|
863
882
|
] });
|
864
|
-
},
|
865
|
-
console.log("PaymentStatus render:", { status: a, message:
|
883
|
+
}, Ce = ({ status: a, theme: n = "light", message: i }) => {
|
884
|
+
console.log("PaymentStatus render:", { status: a, message: i });
|
866
885
|
const c = () => {
|
867
886
|
switch (a) {
|
868
887
|
case "processing":
|
@@ -896,7 +915,7 @@ const St = (a) => {
|
|
896
915
|
default:
|
897
916
|
return null;
|
898
917
|
}
|
899
|
-
},
|
918
|
+
}, x = () => {
|
900
919
|
switch (a) {
|
901
920
|
case "processing":
|
902
921
|
return "Processing Payment";
|
@@ -907,7 +926,7 @@ const St = (a) => {
|
|
907
926
|
default:
|
908
927
|
return "Unknown Status";
|
909
928
|
}
|
910
|
-
},
|
929
|
+
}, d = () => {
|
911
930
|
switch (a) {
|
912
931
|
case "processing":
|
913
932
|
return n === "dark" ? "text-blue-300" : "text-blue-600";
|
@@ -921,89 +940,37 @@ const St = (a) => {
|
|
921
940
|
};
|
922
941
|
return /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col items-center justify-center py-6", children: [
|
923
942
|
/* @__PURE__ */ t.jsx("div", { className: "mb-4", children: c() }),
|
924
|
-
/* @__PURE__ */ t.jsx("h3", { className: `text-xl font-bold mb-2 ${n === "dark" ? "text-white" : "text-gray-900"}`, children:
|
925
|
-
/* @__PURE__ */ t.jsx("p", { className: `text-center ${
|
943
|
+
/* @__PURE__ */ t.jsx("h3", { className: `text-xl font-bold mb-2 ${n === "dark" ? "text-white" : "text-gray-900"}`, children: x() }),
|
944
|
+
/* @__PURE__ */ t.jsx("p", { className: `text-center ${d()}`, children: i }),
|
926
945
|
a === "processing" && /* @__PURE__ */ t.jsx("div", { className: `mt-4 text-xs ${n === "dark" ? "text-gray-400" : "text-gray-500"}`, children: "This may take a few moments. Please do not close this window." }),
|
927
946
|
a === "success" && /* @__PURE__ */ t.jsx("div", { className: `mt-4 p-2 rounded ${n === "dark" ? "bg-gray-700" : "bg-gray-100"}`, children: /* @__PURE__ */ t.jsx("p", { className: `text-xs ${n === "dark" ? "text-gray-300" : "text-gray-600"}`, children: "Your payment has been successfully processed. You will receive a confirmation shortly." }) })
|
928
947
|
] });
|
929
|
-
},
|
930
|
-
|
931
|
-
amount: n,
|
932
|
-
currency: l,
|
933
|
-
theme: c = "light",
|
934
|
-
size: u = 200
|
935
|
-
}) => {
|
936
|
-
const f = () => {
|
937
|
-
const s = Math.floor(u / 10);
|
938
|
-
let y = `<svg xmlns="http://www.w3.org/2000/svg" width="${u}" height="${u}" viewBox="0 0 ${u} ${u}">`;
|
939
|
-
y += `<rect width="${u}" height="${u}" fill="${c === "dark" ? "#1f2937" : "white"}"/>`, y += `<rect x="${s}" y="${s}" width="${s * 3}" height="${s * 3}" fill="${c === "dark" ? "white" : "black"}"/>`, y += `<rect x="${s * 1.5}" y="${s * 1.5}" width="${s * 2}" height="${s * 2}" fill="${c === "dark" ? "#1f2937" : "white"}"/>`, y += `<rect x="${s * 2}" y="${s * 2}" width="${s}" height="${s}" fill="${c === "dark" ? "white" : "black"}"/>`, y += `<rect x="${u - s * 4}" y="${s}" width="${s * 3}" height="${s * 3}" fill="${c === "dark" ? "white" : "black"}"/>`, y += `<rect x="${u - s * 3.5}" y="${s * 1.5}" width="${s * 2}" height="${s * 2}" fill="${c === "dark" ? "#1f2937" : "white"}"/>`, y += `<rect x="${u - s * 3}" y="${s * 2}" width="${s}" height="${s}" fill="${c === "dark" ? "white" : "black"}"/>`, y += `<rect x="${s}" y="${u - s * 4}" width="${s * 3}" height="${s * 3}" fill="${c === "dark" ? "white" : "black"}"/>`, y += `<rect x="${s * 1.5}" y="${u - s * 3.5}" width="${s * 2}" height="${s * 2}" fill="${c === "dark" ? "#1f2937" : "white"}"/>`, y += `<rect x="${s * 2}" y="${u - s * 3}" width="${s}" height="${s}" fill="${c === "dark" ? "white" : "black"}"/>`, l.length + ((a == null ? void 0 : a.length) || 0);
|
940
|
-
for (let i = 0; i < 50; i++) {
|
941
|
-
const N = s * (1 + Math.floor(Math.random() * 8)), x = s * (1 + Math.floor(Math.random() * 8));
|
942
|
-
N < s * 4 && x < s * 4 || N > u - s * 5 && x < s * 4 || N < s * 4 && x > u - s * 5 || (y += `<rect x="${N}" y="${x}" width="${s}" height="${s}" fill="${c === "dark" ? "white" : "black"}"/>`);
|
943
|
-
}
|
944
|
-
return y += `<rect x="${u / 2 - s * 3}" y="${u / 2 - s * 1.5}" width="${s * 6}" height="${s * 3}" fill="${c === "dark" ? "#1f2937" : "white"}"/>`, y += `<text x="${u / 2}" y="${u / 2 + s / 2}" font-family="Arial" font-size="${s * 2}" font-weight="bold" text-anchor="middle" fill="${c === "dark" ? "white" : "black"}">${l}</text>`, y += "</svg>", y;
|
945
|
-
};
|
946
|
-
return /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col items-center", children: [
|
947
|
-
/* @__PURE__ */ t.jsx(
|
948
|
-
"div",
|
949
|
-
{
|
950
|
-
className: `p-4 rounded-lg ${c === "dark" ? "bg-gray-700" : "bg-white"} mb-3`,
|
951
|
-
dangerouslySetInnerHTML: { __html: f() }
|
952
|
-
}
|
953
|
-
),
|
954
|
-
/* @__PURE__ */ t.jsx("div", { className: `text-center text-sm ${c === "dark" ? "text-gray-300" : "text-gray-700"}`, children: "Scan with your wallet app to pay" }),
|
955
|
-
a && /* @__PURE__ */ t.jsxs("div", { className: "mt-3 w-full", children: [
|
956
|
-
/* @__PURE__ */ t.jsxs("p", { className: `text-xs ${c === "dark" ? "text-gray-400" : "text-gray-500"} mb-1`, children: [
|
957
|
-
"Send ",
|
958
|
-
n,
|
959
|
-
" ",
|
960
|
-
l,
|
961
|
-
" to:"
|
962
|
-
] }),
|
963
|
-
/* @__PURE__ */ t.jsx("div", { className: `text-xs font-mono p-2 rounded overflow-auto break-all ${c === "dark" ? "bg-gray-800 text-gray-300" : "bg-gray-100 text-gray-700"}`, children: a })
|
964
|
-
] }),
|
965
|
-
/* @__PURE__ */ t.jsx("div", { className: "mt-4 w-full", children: /* @__PURE__ */ t.jsxs("div", { className: `p-3 rounded ${c === "dark" ? "bg-gray-700" : "bg-gray-100"}`, children: [
|
966
|
-
/* @__PURE__ */ t.jsx("h4", { className: `text-sm font-medium mb-2 ${c === "dark" ? "text-white" : "text-gray-800"}`, children: "Payment Instructions" }),
|
967
|
-
/* @__PURE__ */ t.jsxs("ol", { className: `text-xs space-y-2 ${c === "dark" ? "text-gray-300" : "text-gray-600"}`, children: [
|
968
|
-
/* @__PURE__ */ t.jsx("li", { children: "1. Open your crypto wallet app" }),
|
969
|
-
/* @__PURE__ */ t.jsx("li", { children: "2. Scan the QR code above" }),
|
970
|
-
/* @__PURE__ */ t.jsxs("li", { children: [
|
971
|
-
"3. Confirm the payment amount (",
|
972
|
-
n,
|
973
|
-
" ",
|
974
|
-
l,
|
975
|
-
")"
|
976
|
-
] }),
|
977
|
-
/* @__PURE__ */ t.jsx("li", { children: '4. Click "Pay Now" button below after sending the payment' })
|
978
|
-
] })
|
979
|
-
] }) })
|
980
|
-
] });
|
981
|
-
}, Q = () => typeof window < "u" && typeof window.ethereum < "u", kt = async () => {
|
982
|
-
if (!Q())
|
948
|
+
}, G = () => typeof window < "u" && typeof window.ethereum < "u", Ot = async () => {
|
949
|
+
if (!G())
|
983
950
|
throw new Error("MetaMask is not installed");
|
984
951
|
try {
|
985
952
|
return await window.ethereum.request({ method: "eth_requestAccounts" });
|
986
953
|
} catch (a) {
|
987
954
|
throw console.error("Error connecting to wallet:", a), a;
|
988
955
|
}
|
989
|
-
},
|
990
|
-
if (!
|
956
|
+
}, Pt = async () => {
|
957
|
+
if (!G())
|
991
958
|
throw new Error("MetaMask is not installed");
|
992
959
|
try {
|
993
960
|
return await window.ethereum.request({ method: "eth_accounts" });
|
994
961
|
} catch (a) {
|
995
962
|
throw console.error("Error getting accounts:", a), a;
|
996
963
|
}
|
997
|
-
},
|
998
|
-
if (!
|
964
|
+
}, Ht = async () => {
|
965
|
+
if (!G())
|
999
966
|
throw new Error("MetaMask is not installed");
|
1000
967
|
try {
|
1001
968
|
return await window.ethereum.request({ method: "eth_chainId" });
|
1002
969
|
} catch (a) {
|
1003
970
|
throw console.error("Error getting chain ID:", a), a;
|
1004
971
|
}
|
1005
|
-
},
|
1006
|
-
if (!
|
972
|
+
}, Rt = async (a) => {
|
973
|
+
if (!G())
|
1007
974
|
throw new Error("MetaMask is not installed");
|
1008
975
|
try {
|
1009
976
|
return await window.ethereum.request({
|
@@ -1013,29 +980,29 @@ const St = (a) => {
|
|
1013
980
|
} catch (n) {
|
1014
981
|
throw console.error("Error sending transaction:", n), n;
|
1015
982
|
}
|
1016
|
-
},
|
1017
|
-
if (!
|
983
|
+
}, qt = async (a, n, i) => {
|
984
|
+
if (!G())
|
1018
985
|
throw new Error("MetaMask is not installed");
|
1019
986
|
try {
|
1020
|
-
const
|
1021
|
-
from:
|
987
|
+
const x = (await window.ethereum.request({ method: "eth_requestAccounts" }))[0], d = "0xa9059cbb", w = n.slice(2).padStart(64, "0"), L = i.toString(16).padStart(64, "0"), o = `${d}${w}${L}`, S = {
|
988
|
+
from: x,
|
1022
989
|
to: a,
|
1023
|
-
data:
|
990
|
+
data: o
|
1024
991
|
};
|
1025
992
|
return await window.ethereum.request({
|
1026
993
|
method: "eth_sendTransaction",
|
1027
|
-
params: [
|
994
|
+
params: [S]
|
1028
995
|
});
|
1029
996
|
} catch (c) {
|
1030
997
|
throw console.error("Error sending token:", c), c;
|
1031
998
|
}
|
1032
|
-
},
|
999
|
+
}, Vt = async () => {
|
1033
1000
|
try {
|
1034
|
-
return (await
|
1001
|
+
return (await Pt()).length > 0;
|
1035
1002
|
} catch {
|
1036
1003
|
return !1;
|
1037
1004
|
}
|
1038
|
-
},
|
1005
|
+
}, Xt = (a) => ({
|
1039
1006
|
"0x1": "Ethereum Mainnet",
|
1040
1007
|
"0x3": "Ropsten Testnet",
|
1041
1008
|
"0x4": "Rinkeby Testnet",
|
@@ -1044,116 +1011,116 @@ const St = (a) => {
|
|
1044
1011
|
"0x38": "Binance Smart Chain",
|
1045
1012
|
"0x89": "Polygon",
|
1046
1013
|
"0xa86a": "Avalanche"
|
1047
|
-
})[a] || `Unknown Network (${a})`,
|
1048
|
-
if (!
|
1014
|
+
})[a] || `Unknown Network (${a})`, Jt = async (a, n) => {
|
1015
|
+
if (!G())
|
1049
1016
|
throw new Error("MetaMask is not installed");
|
1050
1017
|
try {
|
1051
|
-
const
|
1018
|
+
const i = "0x70a08231", c = n.slice(2).padStart(64, "0"), x = `${i}${c}`, d = await window.ethereum.request({
|
1052
1019
|
method: "eth_call",
|
1053
1020
|
params: [
|
1054
1021
|
{
|
1055
1022
|
to: a,
|
1056
|
-
data:
|
1023
|
+
data: x
|
1057
1024
|
},
|
1058
1025
|
"latest"
|
1059
1026
|
]
|
1060
1027
|
});
|
1061
|
-
return parseInt(
|
1062
|
-
} catch (
|
1063
|
-
throw console.error("Error getting token balance:",
|
1028
|
+
return parseInt(d, 16).toString();
|
1029
|
+
} catch (i) {
|
1030
|
+
throw console.error("Error getting token balance:", i), i;
|
1064
1031
|
}
|
1065
|
-
},
|
1032
|
+
}, Kt = {
|
1066
1033
|
USDT: "0xdAC17F958D2ee523a2206206994597C13D831ec7",
|
1067
1034
|
USDC: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
1068
1035
|
DAI: "0x6B175474E89094C44Da98b954EedeAC495271d0F",
|
1069
1036
|
WETH: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
|
1070
1037
|
WBTC: "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599"
|
1071
|
-
},
|
1038
|
+
}, zt = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHgAAAAcCAYAAACqAXueAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAiaSURBVHgB7VrdddNIFL4zNuDAw2orQDQATgUoUABQAU4FOGcLiF0BpoI4FcQ0QLQVxAHOvqLtwDyQOBBr9rszI2n058jeBEhOvnNkS6M7o7m6c39HRA3Qf/bxLR+l9uDIR/sXHD26trjTJeoMiO6/pEuCEBuHOBQfZuxfB9mQjpnv958d9/O9W2/w6+N4StcSHV+INoQhdoVQB7ju0Q1DUwFbiN1Cw6Wt+l+EHg4vu5TXdKHWIydgmFyv//xjWWhCzOyZB5pA0xo63zSrf0vjQNvZhNPvjTB/Gf9NNwx5DZZyQIoOSn5VOYxLaRaAUkHaFotpcgqhdmG6j7Aq4LNbXfqtMQ+VUts4xkrRDq7HdMOQF3BMkT3zcez1n30yJjmOJymNsv5WyCdZx0XIvzvB59cQ7qHur1SUtP/eYKHOt4lOR3QD0XYvRuGTUX/r+A1Msm9a1ACm9isEPMYFm2kP94zPUsq3/+9H4eaMNVdJTWe7iiG301ro+PgJKHUBEhYixjGPGvRN+uFQeD5bl3l4wbMskvE98Di3vrmDMWaz8thaGcJmc1r67ICW8unOxZ1jHfL07dJ9Fb8iobXQErGpJTxUDe15kX6kfa1sHTiNEO6TMa2MTsARLRmm3YfwPLC27o/jOB5WMSnlxhuY2QHlgiZh/zcijIu+J8NiP7R/SZ+iOltmMcz7dh5o4+vONq73yvPSY09g4ndWE/QqfM67oD3M5rixs8zaCHGGeYqXhlaFpSgaWjeleAFGKdM+0dodfXiCQdU7HO/to94ZQW6GEC5P1rftQ9AOaEWwgCwjQR0NJtwDzVE+Z/U8zjshXGbaq+nqo+8AL+4or7EXA8/zL5jXS3Pf85qMJ+X93YZ8Hpq5ausTZvOhF1QLzZsbJO+3jfZx4CTYp7JQjyHgEMcm/OyhNtfCTAaCS/NgI/CMSdNXC3cNX9bpWQG5mIHRqWFKcLCWvEAIVO0pdSci+jHFimXLEbgdMdbUmGfd17mnoA3yQClvKzO7F8LPxlUhadOsMAfZde75rPX4HywbyFgZNSjwOMF/koU8dearFxbmugkrMnTaA+MqKt1OULgO22lQlJtJi61FSAqarAiMtJavznixzYOt53O52JDLr8E0DV0zpJSmGzh0nonQdZQeZHRaANuuuYTZ5fHZtdiVrbpNhFFAhLG3KsblxaUzBZxDeN6ofuF0fOtCLMRUsTssmHaMG9hx+Z37Up7txvF8h90MpXLSJjgsPgH9XmfjiDHeYSTRGlEVWGtli/3TbBQ+HtMSQLCT9QMqN8jgiZ1vVfuY+YBTGRYijkcc/eYXhg6mtsq+cA7hnOJF0iSlhDCamlQzJ7VdPS773hQY75tfP4roU2aFoirh2nHBn9jOns3FGM/Ds/bTkQS9Ls8/DdgsYk0vaXH+yvjTGiR57xWhvOp+TOupWfCJENOI1vb9sU1LUBbGSUDNMKuPwovt9ZYOQnmazUWEy4OykwllMRBHxZBBZ1Ro6xc6Bc55lMytbTWPq04jaCwTvchSoRj+OF7Dp66EbnZ6/p6aw3fOZ8sXBoNf6MY0e572oRO6AEkccAlI+UQMAYFtBNQcPpt+mO93idXC/wvX5BurZGAWkEEaRUPQESpSEbH0uUihCxViqtuvFs6qlyuYeeVqS9N+67qRy4b2rxccVdZg7Jx3rRUja54dRYnTdFDnwbqurAiBiC1eZOih0OGvk/asAFNAMfAb9yLhCqupP23sd68ALp8cPa+ymC2ttkIhWXPM2qw4GDb+PcHUNf9tXY7Mh+55xDVB2OWBTWDAJ+yPMeFxs24trvokF96S1MGiuMppCe2VIOUTPO5X+NBGwMIopExcBzh74dzPxVMw0apXMxavmjFJVb3D5KAffO7SmkA06frdgOjB6zpaUyTY+GL2bb/xC4uSe6bSVBcZ80uQTqUtC0J+FvDi0w0bEwUvK7gwH3V708XCh64D+A5B6FJL5LA7lAUSM53/mqiaA5CeLk9ih+mvZ/88pDrIeFd/9YFtQloZG2PKCSoesyDzL8DzUCR4a4sEvhFmZ8Cr2RkI7WdHmV9KwHnl90OT/xpAg+qzhitDPgo2laq7FYrD+fXZAfOI97BXtRDKSpG0cxaSj84FVaD//NMRqPNayZUt2YYpiL9ytcp83SEejj483tGCFfIIKjbjtGv1wEwn94cVNyL77xfa2YdtMjNSdsZgrKj1eJHsWpRX7AvhYuHqvFjDfFaT3FO2Fp0VVUzxhFOzalT159IppeaYF+F8YPns2Zp2kUdU5ATz5FOpKuf2T6DNMtcovDztAnx9z2UGpVq0/vaqKFwdUetS5AC7RMbe6wqXTq8CnWpx4s4TRGVsdU3Wyf0rKke5PpWFG5liiFmpqPL0KjTSsxrr59ngYsG9pfny1WJu951z8HG85PozNRIug1OmUu0iKgqXUfyiw+e/IhFv/dkNhTKEabebFK/0hFvtNYR8wrsym27FpgBmaqjUvc1yznvaNxv3VJmzcrutRvVWqEFfEU5HXIlbwifZat1WtXATaJPv9MlyXxc5Ew2zOyh/d6Xe8SYDf+VBZo/VXh/jATa5jhd/JqVK+0UHm6gJzPea2qL3NB0NXEBwD6JmwtE+yx6cVzfdR/5V4JhBgt/YM/O9GzbkM2fubfk2KlLl94MV+XmRW2Ga77B83RQnKyX7TAcC5WBhzKesyaDXO1HWfIe0MjSDYaGNmkEzGdG1QTGaP7m4S2GDxsYJURVlQcDxAIHUQ+1z48V+Jhzp+OSFEWy8mECwdgXlfbYNsh6tF1Xfoh7GslnN9Z0btZay8MmOFkw5YpR2MKW3BCNLO0O0HZqP78QfVYP/jx2mW5TAmcbZYTHxsYFYVNer2XfRyobjxWh1cT607T7d4qejPsrO0EzAgv0u/HH4OBeGaxPO94Q6plv8FECovJc8uTjKNvgPcUpIo0ZgmzUAAAAASUVORK5CYII=", Ut = wt(() => Promise.resolve().then(() => Et)), Yt = ({
|
1072
1039
|
isOpen: a,
|
1073
1040
|
onClose: n,
|
1074
|
-
payment:
|
1041
|
+
payment: i,
|
1075
1042
|
paymentStatus: c,
|
1076
|
-
selectedCurrency:
|
1077
|
-
onCurrencySelect:
|
1078
|
-
onPayment:
|
1079
|
-
error:
|
1080
|
-
theme:
|
1081
|
-
merchantName:
|
1082
|
-
transactionHash:
|
1083
|
-
walletConnected:
|
1084
|
-
onConnectWallet:
|
1085
|
-
testMode:
|
1043
|
+
selectedCurrency: x,
|
1044
|
+
onCurrencySelect: d,
|
1045
|
+
onPayment: w,
|
1046
|
+
error: L,
|
1047
|
+
theme: o = "light",
|
1048
|
+
merchantName: S,
|
1049
|
+
transactionHash: M,
|
1050
|
+
walletConnected: C,
|
1051
|
+
onConnectWallet: z,
|
1052
|
+
testMode: N = !1
|
1086
1053
|
}) => {
|
1087
|
-
const [
|
1054
|
+
const [U, Y] = O("select-currency"), [W, A] = O(!1), [p, se] = O("wallet");
|
1088
1055
|
X(() => {
|
1089
|
-
typeof window < "u" &&
|
1056
|
+
typeof window < "u" && A(G());
|
1090
1057
|
}, []), X(() => {
|
1091
|
-
c === "loading" ?
|
1092
|
-
}, [c,
|
1093
|
-
const
|
1094
|
-
|
1095
|
-
},
|
1096
|
-
|
1058
|
+
c === "loading" ? Y("processing") : c === "success" ? Y("success") : c === "error" ? Y("error") : c === "idle" && i && Y("select-currency");
|
1059
|
+
}, [c, i]);
|
1060
|
+
const _ = (T) => {
|
1061
|
+
d(T), Y("confirm");
|
1062
|
+
}, $ = () => {
|
1063
|
+
w(p === "qrcode");
|
1097
1064
|
}, J = () => {
|
1098
|
-
|
1065
|
+
U === "confirm" && Y("select-currency");
|
1099
1066
|
}, oe = () => {
|
1100
1067
|
n();
|
1101
|
-
},
|
1102
|
-
se(
|
1103
|
-
}, ee = `fixed inset-0 z-50 overflow-y-auto ${
|
1104
|
-
return a ? /* @__PURE__ */ t.jsx("div", { className: ee, children: /* @__PURE__ */ t.jsx("div", { className: "flex min-h-screen items-center justify-center p-4", children: /* @__PURE__ */ t.jsxs("div", { className:
|
1068
|
+
}, F = (T) => parseFloat(T).toFixed(2), K = (T) => T ? T.length <= 14 ? T : `${T.slice(0, 8)}...${T.slice(-6)}` : "", B = (T) => {
|
1069
|
+
se(T);
|
1070
|
+
}, ee = `fixed inset-0 z-50 overflow-y-auto ${o === "dark" ? "bg-gray-900/75" : "bg-black/50"}`, Q = `relative p-6 w-full max-w-md mx-auto rounded-lg shadow-xl ${o === "dark" ? "bg-gray-800 text-white" : "bg-white text-gray-800"}`, I = `text-xl font-bold mb-4 ${o === "dark" ? "text-white" : "text-gray-900"}`, k = `w-full py-2 px-4 rounded-md font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 ${o === "dark" ? "bg-blue-600 hover:bg-blue-700 text-white focus:ring-blue-500" : "bg-blue-500 hover:bg-blue-600 text-white focus:ring-blue-500"}`, j = `w-full py-2 px-4 rounded-md font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 ${o === "dark" ? "bg-gray-700 hover:bg-gray-600 text-white focus:ring-gray-500" : "bg-gray-200 hover:bg-gray-300 text-gray-800 focus:ring-gray-500"}`, H = "py-2 px-4 text-sm font-medium focus:outline-none transition-colors", Z = `${o === "dark" ? "bg-gray-700 text-white" : "bg-gray-100 text-gray-800"} rounded-t-md`, q = `${o === "dark" ? "text-gray-400 hover:text-gray-300" : "text-gray-500 hover:text-gray-700"}`;
|
1071
|
+
return a ? /* @__PURE__ */ t.jsx("div", { className: ee, children: /* @__PURE__ */ t.jsx("div", { className: "flex min-h-screen items-center justify-center p-4", children: /* @__PURE__ */ t.jsxs("div", { className: Q, children: [
|
1105
1072
|
/* @__PURE__ */ t.jsxs("div", { className: "flex justify-between items-center mb-6", children: [
|
1106
1073
|
/* @__PURE__ */ t.jsxs("div", { className: "flex items-center", children: [
|
1107
|
-
/* @__PURE__ */ t.jsx("img", { src:
|
1074
|
+
/* @__PURE__ */ t.jsx("img", { src: zt, alt: "Coinley Logo", className: "h-8 mr-2" }),
|
1108
1075
|
/* @__PURE__ */ t.jsx("h2", { className: I, children: "Coinley Pay" })
|
1109
1076
|
] }),
|
1110
1077
|
/* @__PURE__ */ t.jsx(
|
1111
1078
|
"button",
|
1112
1079
|
{
|
1113
1080
|
onClick: oe,
|
1114
|
-
className: `text-gray-500 hover:text-gray-700 focus:outline-none ${
|
1081
|
+
className: `text-gray-500 hover:text-gray-700 focus:outline-none ${o === "dark" ? "text-gray-400 hover:text-gray-300" : ""}`,
|
1115
1082
|
children: /* @__PURE__ */ t.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-6 w-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ t.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) })
|
1116
1083
|
}
|
1117
1084
|
)
|
1118
1085
|
] }),
|
1119
1086
|
/* @__PURE__ */ t.jsxs("div", { className: "mb-6", children: [
|
1120
|
-
|
1121
|
-
/* @__PURE__ */ t.jsx("p", { className: `text-sm ${
|
1087
|
+
i && /* @__PURE__ */ t.jsxs("div", { className: `mb-6 p-4 rounded-lg ${o === "dark" ? "bg-gray-700" : "bg-gray-100"}`, children: [
|
1088
|
+
/* @__PURE__ */ t.jsx("p", { className: `text-sm ${o === "dark" ? "text-gray-300" : "text-gray-600"}`, children: S }),
|
1122
1089
|
/* @__PURE__ */ t.jsxs("div", { className: "flex justify-between items-center mt-2", children: [
|
1123
|
-
/* @__PURE__ */ t.jsx("span", { className: `font-medium ${
|
1090
|
+
/* @__PURE__ */ t.jsx("span", { className: `font-medium ${o === "dark" ? "text-gray-300" : "text-gray-700"}`, children: "Amount:" }),
|
1124
1091
|
/* @__PURE__ */ t.jsxs("span", { className: "font-bold text-xl", children: [
|
1125
1092
|
"$",
|
1126
|
-
|
1093
|
+
F(i.totalAmount || i.amount)
|
1127
1094
|
] })
|
1128
1095
|
] }),
|
1129
|
-
/* @__PURE__ */ t.jsx("div", { className: "text-xs mt-1 text-right", children: /* @__PURE__ */ t.jsxs("span", { className: `${
|
1096
|
+
/* @__PURE__ */ t.jsx("div", { className: "text-xs mt-1 text-right", children: /* @__PURE__ */ t.jsxs("span", { className: `${o === "dark" ? "text-gray-400" : "text-gray-500"}`, children: [
|
1130
1097
|
"Payment ID: ",
|
1131
|
-
|
1098
|
+
i.id.slice(0, 8),
|
1132
1099
|
"..."
|
1133
1100
|
] }) })
|
1134
1101
|
] }),
|
1135
|
-
|
1136
|
-
|
1102
|
+
U === "select-currency" && /* @__PURE__ */ t.jsx(
|
1103
|
+
kt,
|
1137
1104
|
{
|
1138
|
-
onSelect:
|
1139
|
-
selected:
|
1140
|
-
theme:
|
1105
|
+
onSelect: _,
|
1106
|
+
selected: x,
|
1107
|
+
theme: o
|
1141
1108
|
}
|
1142
1109
|
),
|
1143
|
-
|
1144
|
-
/* @__PURE__ */ t.jsxs("div", { className: `p-4 rounded-lg mb-4 ${
|
1145
|
-
/* @__PURE__ */ t.jsx("h3", { className: `text-lg font-medium mb-2 ${
|
1110
|
+
U === "confirm" && i && /* @__PURE__ */ t.jsxs("div", { children: [
|
1111
|
+
/* @__PURE__ */ t.jsxs("div", { className: `p-4 rounded-lg mb-4 ${o === "dark" ? "bg-gray-700" : "bg-gray-100"}`, children: [
|
1112
|
+
/* @__PURE__ */ t.jsx("h3", { className: `text-lg font-medium mb-2 ${o === "dark" ? "text-white" : "text-gray-800"}`, children: "Payment Details" }),
|
1146
1113
|
/* @__PURE__ */ t.jsxs("div", { className: "space-y-2", children: [
|
1147
1114
|
/* @__PURE__ */ t.jsxs("div", { className: "flex justify-between", children: [
|
1148
|
-
/* @__PURE__ */ t.jsx("span", { className:
|
1149
|
-
/* @__PURE__ */ t.jsx("span", { className: "font-medium", children:
|
1115
|
+
/* @__PURE__ */ t.jsx("span", { className: o === "dark" ? "text-gray-300" : "text-gray-600", children: "Currency:" }),
|
1116
|
+
/* @__PURE__ */ t.jsx("span", { className: "font-medium", children: x })
|
1150
1117
|
] }),
|
1151
1118
|
/* @__PURE__ */ t.jsxs("div", { className: "flex justify-between", children: [
|
1152
|
-
/* @__PURE__ */ t.jsx("span", { className:
|
1153
|
-
/* @__PURE__ */ t.jsx("span", { className: "font-medium", children:
|
1119
|
+
/* @__PURE__ */ t.jsx("span", { className: o === "dark" ? "text-gray-300" : "text-gray-600", children: "Network:" }),
|
1120
|
+
/* @__PURE__ */ t.jsx("span", { className: "font-medium", children: x === "SOL" || x === "USDC_SOL" ? "Solana" : "Ethereum" })
|
1154
1121
|
] }),
|
1155
1122
|
/* @__PURE__ */ t.jsxs("div", { className: "flex justify-between", children: [
|
1156
|
-
/* @__PURE__ */ t.jsx("span", { className:
|
1123
|
+
/* @__PURE__ */ t.jsx("span", { className: o === "dark" ? "text-gray-300" : "text-gray-600", children: "Fee:" }),
|
1157
1124
|
/* @__PURE__ */ t.jsx("span", { className: "font-medium", children: "1.75%" })
|
1158
1125
|
] })
|
1159
1126
|
] })
|
@@ -1163,7 +1130,7 @@ const St = (a) => {
|
|
1163
1130
|
"button",
|
1164
1131
|
{
|
1165
1132
|
onClick: () => B("wallet"),
|
1166
|
-
className: `${H} ${
|
1133
|
+
className: `${H} ${p === "wallet" ? Z : q}`,
|
1167
1134
|
children: "Connect Wallet"
|
1168
1135
|
}
|
1169
1136
|
),
|
@@ -1171,34 +1138,34 @@ const St = (a) => {
|
|
1171
1138
|
"button",
|
1172
1139
|
{
|
1173
1140
|
onClick: () => B("qrcode"),
|
1174
|
-
className: `${H} ${
|
1141
|
+
className: `${H} ${p === "qrcode" ? Z : q}`,
|
1175
1142
|
children: "QR Code"
|
1176
1143
|
}
|
1177
1144
|
)
|
1178
1145
|
] }) }),
|
1179
|
-
|
1146
|
+
N ? (
|
1180
1147
|
// Test mode payment option
|
1181
|
-
/* @__PURE__ */ t.jsx("div", { className: `p-4 rounded-lg mb-4 ${
|
1148
|
+
/* @__PURE__ */ t.jsx("div", { className: `p-4 rounded-lg mb-4 ${o === "dark" ? "bg-blue-900/20" : "bg-blue-50"}`, children: /* @__PURE__ */ t.jsxs("div", { className: "flex items-center", children: [
|
1182
1149
|
/* @__PURE__ */ t.jsx("div", { className: "bg-blue-500 rounded-full p-2 mr-3", children: /* @__PURE__ */ t.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-6 w-6 text-white", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ t.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13 10V3L4 14h7v7l9-11h-7z" }) }) }),
|
1183
1150
|
/* @__PURE__ */ t.jsxs("div", { children: [
|
1184
|
-
/* @__PURE__ */ t.jsx("h3", { className: `font-medium ${
|
1185
|
-
/* @__PURE__ */ t.jsx("p", { className: `text-sm ${
|
1151
|
+
/* @__PURE__ */ t.jsx("h3", { className: `font-medium ${o === "dark" ? "text-white" : "text-gray-800"}`, children: "Test Mode Payment" }),
|
1152
|
+
/* @__PURE__ */ t.jsx("p", { className: `text-sm ${o === "dark" ? "text-gray-300" : "text-gray-600"}`, children: 'Click "Pay Now" to simulate a successful payment' })
|
1186
1153
|
] })
|
1187
1154
|
] }) })
|
1188
|
-
) :
|
1155
|
+
) : p === "qrcode" ? (
|
1189
1156
|
// QR Code payment option
|
1190
|
-
/* @__PURE__ */ t.jsx("div", { className: `p-4 rounded-lg mb-4 ${
|
1191
|
-
|
1157
|
+
/* @__PURE__ */ t.jsx("div", { className: `p-4 rounded-lg mb-4 ${o === "dark" ? "bg-blue-900/20" : "bg-blue-50"}`, children: /* @__PURE__ */ t.jsx(
|
1158
|
+
Ut,
|
1192
1159
|
{
|
1193
|
-
walletAddress:
|
1194
|
-
amount:
|
1195
|
-
currency:
|
1196
|
-
theme:
|
1160
|
+
walletAddress: i.walletAddress || "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
|
1161
|
+
amount: i.totalAmount || i.amount,
|
1162
|
+
currency: x,
|
1163
|
+
theme: o
|
1197
1164
|
}
|
1198
1165
|
) })
|
1199
|
-
) :
|
1166
|
+
) : W ? (
|
1200
1167
|
// MetaMask available option
|
1201
|
-
/* @__PURE__ */ t.jsxs("div", { className: `p-4 rounded-lg mb-4 ${
|
1168
|
+
/* @__PURE__ */ t.jsxs("div", { className: `p-4 rounded-lg mb-4 ${o === "dark" ? "bg-blue-900/20" : "bg-blue-50"}`, children: [
|
1202
1169
|
/* @__PURE__ */ t.jsxs("div", { className: "flex items-center", children: [
|
1203
1170
|
/* @__PURE__ */ t.jsx(
|
1204
1171
|
"img",
|
@@ -1209,27 +1176,27 @@ const St = (a) => {
|
|
1209
1176
|
}
|
1210
1177
|
),
|
1211
1178
|
/* @__PURE__ */ t.jsxs("div", { children: [
|
1212
|
-
/* @__PURE__ */ t.jsx("h3", { className: `font-medium ${
|
1213
|
-
/* @__PURE__ */ t.jsx("p", { className: `text-sm ${
|
1179
|
+
/* @__PURE__ */ t.jsx("h3", { className: `font-medium ${o === "dark" ? "text-white" : "text-gray-800"}`, children: "Pay with MetaMask" }),
|
1180
|
+
/* @__PURE__ */ t.jsx("p", { className: `text-sm ${o === "dark" ? "text-gray-300" : "text-gray-600"}`, children: C ? "Your wallet is connected. Click 'Pay Now' to proceed." : "Click 'Connect Wallet' to proceed with payment." })
|
1214
1181
|
] })
|
1215
1182
|
] }),
|
1216
|
-
!
|
1183
|
+
!C && /* @__PURE__ */ t.jsx(
|
1217
1184
|
"button",
|
1218
1185
|
{
|
1219
|
-
onClick:
|
1220
|
-
className: `mt-3 ${
|
1186
|
+
onClick: z,
|
1187
|
+
className: `mt-3 ${k}`,
|
1221
1188
|
children: "Connect Wallet"
|
1222
1189
|
}
|
1223
1190
|
)
|
1224
1191
|
] })
|
1225
1192
|
) : (
|
1226
1193
|
// MetaMask not available warning
|
1227
|
-
/* @__PURE__ */ t.jsxs("div", { className: `p-4 rounded-lg mb-4 ${
|
1194
|
+
/* @__PURE__ */ t.jsxs("div", { className: `p-4 rounded-lg mb-4 ${o === "dark" ? "bg-yellow-900/20" : "bg-yellow-50"}`, children: [
|
1228
1195
|
/* @__PURE__ */ t.jsxs("div", { className: "flex items-center", children: [
|
1229
1196
|
/* @__PURE__ */ t.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-6 w-6 text-yellow-500 mr-2", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ t.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" }) }),
|
1230
1197
|
/* @__PURE__ */ t.jsxs("div", { children: [
|
1231
|
-
/* @__PURE__ */ t.jsx("h3", { className: `font-medium ${
|
1232
|
-
/* @__PURE__ */ t.jsx("p", { className: `text-sm ${
|
1198
|
+
/* @__PURE__ */ t.jsx("h3", { className: `font-medium ${o === "dark" ? "text-white" : "text-gray-800"}`, children: "MetaMask Not Detected" }),
|
1199
|
+
/* @__PURE__ */ t.jsx("p", { className: `text-sm ${o === "dark" ? "text-gray-300" : "text-gray-600"}`, children: "Please install MetaMask extension to make payments" })
|
1233
1200
|
] })
|
1234
1201
|
] }),
|
1235
1202
|
/* @__PURE__ */ t.jsx(
|
@@ -1238,7 +1205,7 @@ const St = (a) => {
|
|
1238
1205
|
href: "https://metamask.io/download/",
|
1239
1206
|
target: "_blank",
|
1240
1207
|
rel: "noopener noreferrer",
|
1241
|
-
className: `block mt-3 text-center ${
|
1208
|
+
className: `block mt-3 text-center ${k}`,
|
1242
1209
|
children: "Install MetaMask"
|
1243
1210
|
}
|
1244
1211
|
)
|
@@ -1250,7 +1217,7 @@ const St = (a) => {
|
|
1250
1217
|
{
|
1251
1218
|
type: "button",
|
1252
1219
|
onClick: J,
|
1253
|
-
className:
|
1220
|
+
className: j,
|
1254
1221
|
children: "Back"
|
1255
1222
|
}
|
1256
1223
|
),
|
@@ -1258,53 +1225,53 @@ const St = (a) => {
|
|
1258
1225
|
"button",
|
1259
1226
|
{
|
1260
1227
|
type: "button",
|
1261
|
-
onClick:
|
1262
|
-
className:
|
1263
|
-
disabled: !
|
1228
|
+
onClick: $,
|
1229
|
+
className: k,
|
1230
|
+
disabled: !N && p === "wallet" && W && !C,
|
1264
1231
|
children: "Pay Now"
|
1265
1232
|
}
|
1266
1233
|
)
|
1267
1234
|
] })
|
1268
1235
|
] }),
|
1269
|
-
|
1270
|
-
|
1236
|
+
U === "processing" && /* @__PURE__ */ t.jsx(
|
1237
|
+
Ce,
|
1271
1238
|
{
|
1272
1239
|
status: "processing",
|
1273
|
-
theme:
|
1240
|
+
theme: o,
|
1274
1241
|
message: "Processing your payment..."
|
1275
1242
|
}
|
1276
1243
|
),
|
1277
|
-
|
1244
|
+
U === "success" && /* @__PURE__ */ t.jsxs("div", { children: [
|
1278
1245
|
/* @__PURE__ */ t.jsx(
|
1279
|
-
|
1246
|
+
Ce,
|
1280
1247
|
{
|
1281
1248
|
status: "success",
|
1282
|
-
theme:
|
1249
|
+
theme: o,
|
1283
1250
|
message: "Payment successful!"
|
1284
1251
|
}
|
1285
1252
|
),
|
1286
|
-
|
1287
|
-
/* @__PURE__ */ t.jsx("p", { className: `text-xs ${
|
1288
|
-
/* @__PURE__ */ t.jsx("p", { className: `text-sm font-mono break-all ${
|
1253
|
+
M && /* @__PURE__ */ t.jsxs("div", { className: `mt-4 p-3 rounded-lg ${o === "dark" ? "bg-gray-700" : "bg-gray-100"}`, children: [
|
1254
|
+
/* @__PURE__ */ t.jsx("p", { className: `text-xs ${o === "dark" ? "text-gray-300" : "text-gray-600"} mb-1`, children: "Transaction Hash:" }),
|
1255
|
+
/* @__PURE__ */ t.jsx("p", { className: `text-sm font-mono break-all ${o === "dark" ? "text-white" : "text-gray-800"}`, children: K(M) }),
|
1289
1256
|
/* @__PURE__ */ t.jsx(
|
1290
1257
|
"a",
|
1291
1258
|
{
|
1292
|
-
href: `https://etherscan.io/tx/${
|
1259
|
+
href: `https://etherscan.io/tx/${M}`,
|
1293
1260
|
target: "_blank",
|
1294
1261
|
rel: "noopener noreferrer",
|
1295
|
-
className: `text-xs ${
|
1262
|
+
className: `text-xs ${o === "dark" ? "text-blue-400" : "text-blue-600"} mt-2 inline-block`,
|
1296
1263
|
children: "View on Etherscan →"
|
1297
1264
|
}
|
1298
1265
|
)
|
1299
1266
|
] })
|
1300
1267
|
] }),
|
1301
|
-
|
1268
|
+
U === "error" && /* @__PURE__ */ t.jsxs("div", { children: [
|
1302
1269
|
/* @__PURE__ */ t.jsx(
|
1303
|
-
|
1270
|
+
Ce,
|
1304
1271
|
{
|
1305
1272
|
status: "error",
|
1306
|
-
theme:
|
1307
|
-
message:
|
1273
|
+
theme: o,
|
1274
|
+
message: L || "An error occurred while processing your payment."
|
1308
1275
|
}
|
1309
1276
|
),
|
1310
1277
|
/* @__PURE__ */ t.jsx(
|
@@ -1312,186 +1279,186 @@ const St = (a) => {
|
|
1312
1279
|
{
|
1313
1280
|
type: "button",
|
1314
1281
|
onClick: J,
|
1315
|
-
className: `mt-4 ${
|
1282
|
+
className: `mt-4 ${j}`,
|
1316
1283
|
children: "Try Again"
|
1317
1284
|
}
|
1318
1285
|
)
|
1319
1286
|
] })
|
1320
1287
|
] }),
|
1321
|
-
/* @__PURE__ */ t.jsx("div", { className: `text-center text-xs ${
|
1288
|
+
/* @__PURE__ */ t.jsx("div", { className: `text-center text-xs ${o === "dark" ? "text-gray-400" : "text-gray-500"}`, children: /* @__PURE__ */ t.jsx("p", { children: "Powered by Coinley - Secure Cryptocurrency Payments" }) })
|
1322
1289
|
] }) }) }) : null;
|
1323
|
-
},
|
1290
|
+
}, Ft = vt(({
|
1324
1291
|
apiKey: a,
|
1325
1292
|
apiSecret: n,
|
1326
|
-
apiUrl:
|
1293
|
+
apiUrl: i,
|
1327
1294
|
customerEmail: c,
|
1328
|
-
merchantName:
|
1329
|
-
onSuccess:
|
1330
|
-
onError:
|
1331
|
-
onClose:
|
1332
|
-
theme:
|
1333
|
-
autoOpen:
|
1334
|
-
debug:
|
1335
|
-
testMode:
|
1336
|
-
},
|
1337
|
-
const
|
1338
|
-
a || (
|
1339
|
-
const I =
|
1340
|
-
|
1341
|
-
open: (
|
1342
|
-
H(
|
1295
|
+
merchantName: x = "Merchant",
|
1296
|
+
onSuccess: d,
|
1297
|
+
onError: w,
|
1298
|
+
onClose: L,
|
1299
|
+
theme: o,
|
1300
|
+
autoOpen: S = !1,
|
1301
|
+
debug: M = !1,
|
1302
|
+
testMode: C = !1
|
1303
|
+
}, z) => {
|
1304
|
+
const N = Dt(), { theme: U } = St(), [Y, W] = O(S), [A, p] = O(null), [se, _] = O("idle"), [$, J] = O("USDT"), [oe, F] = O(null), [K, B] = O(null), [ee, Q] = O(!1);
|
1305
|
+
a || (N == null || N.apiKey), n || (N == null || N.apiSecret), i || (N == null || N.apiUrl);
|
1306
|
+
const I = o || U, k = M || (N == null ? void 0 : N.debug);
|
1307
|
+
Nt(z, () => ({
|
1308
|
+
open: (g) => {
|
1309
|
+
H(g);
|
1343
1310
|
},
|
1344
1311
|
close: () => {
|
1345
1312
|
Z();
|
1346
1313
|
},
|
1347
|
-
getPayment: () =>
|
1314
|
+
getPayment: () => A
|
1348
1315
|
}));
|
1349
|
-
const
|
1350
|
-
|
1316
|
+
const j = (g, y) => {
|
1317
|
+
k && console.log(`[Coinley SDK] ${g}`, y);
|
1351
1318
|
};
|
1352
1319
|
X(() => {
|
1353
1320
|
(async () => {
|
1354
|
-
if (
|
1321
|
+
if (G())
|
1355
1322
|
try {
|
1356
|
-
const
|
1357
|
-
|
1358
|
-
} catch (
|
1359
|
-
|
1323
|
+
const y = await window.ethereum.request({ method: "eth_accounts" });
|
1324
|
+
Q(y && y.length > 0);
|
1325
|
+
} catch (y) {
|
1326
|
+
j("Error checking wallet connection:", y), Q(!1);
|
1360
1327
|
}
|
1361
1328
|
else
|
1362
|
-
|
1329
|
+
Q(!1);
|
1363
1330
|
})();
|
1364
1331
|
}, []), X(() => {
|
1365
|
-
const
|
1366
|
-
|
1332
|
+
const g = (y) => {
|
1333
|
+
Q(y.length > 0);
|
1367
1334
|
};
|
1368
|
-
return typeof window < "u" && window.ethereum && window.ethereum.on("accountsChanged",
|
1369
|
-
typeof window < "u" && window.ethereum && window.ethereum.removeListener("accountsChanged",
|
1335
|
+
return typeof window < "u" && window.ethereum && window.ethereum.on("accountsChanged", g), () => {
|
1336
|
+
typeof window < "u" && window.ethereum && window.ethereum.removeListener("accountsChanged", g);
|
1370
1337
|
};
|
1371
1338
|
}, []);
|
1372
|
-
const H = async (
|
1373
|
-
if (!
|
1374
|
-
|
1339
|
+
const H = async (g) => {
|
1340
|
+
if (!g || !g.amount) {
|
1341
|
+
F("Payment amount is required"), w && w(new Error("Payment amount is required"));
|
1375
1342
|
return;
|
1376
1343
|
}
|
1377
|
-
|
1344
|
+
_("loading"), W(!0);
|
1378
1345
|
try {
|
1379
|
-
|
1380
|
-
const
|
1381
|
-
amount:
|
1382
|
-
currency:
|
1383
|
-
customerEmail:
|
1384
|
-
callbackUrl:
|
1385
|
-
metadata:
|
1346
|
+
j("Creating payment with details:", g);
|
1347
|
+
const y = await At({
|
1348
|
+
amount: g.amount,
|
1349
|
+
currency: g.currency || "USDT",
|
1350
|
+
customerEmail: g.customerEmail || c,
|
1351
|
+
callbackUrl: g.callbackUrl,
|
1352
|
+
metadata: g.metadata || {}
|
1386
1353
|
});
|
1387
|
-
|
1388
|
-
payment:
|
1354
|
+
j("Payment created:", y), p(y.payment), _("idle"), F(null), j("Payment created and state updated:", {
|
1355
|
+
payment: y.payment,
|
1389
1356
|
status: "idle"
|
1390
1357
|
});
|
1391
|
-
} catch (
|
1392
|
-
|
1358
|
+
} catch (y) {
|
1359
|
+
j("Error creating payment:", y), F(y.message || "Failed to create payment"), _("error"), w && w(y);
|
1393
1360
|
}
|
1394
1361
|
}, Z = () => {
|
1395
|
-
|
1396
|
-
}, q = (
|
1397
|
-
|
1398
|
-
},
|
1399
|
-
if (!
|
1400
|
-
return
|
1362
|
+
W(!1), B(null), L && L();
|
1363
|
+
}, q = (g) => {
|
1364
|
+
j("Currency selected:", g), J(g);
|
1365
|
+
}, T = async () => {
|
1366
|
+
if (!G())
|
1367
|
+
return F("MetaMask is not installed. Please install MetaMask to make payments."), !1;
|
1401
1368
|
try {
|
1402
|
-
const
|
1403
|
-
return
|
1404
|
-
} catch (
|
1405
|
-
return
|
1369
|
+
const g = await Ot();
|
1370
|
+
return Q(g.length > 0), g.length > 0;
|
1371
|
+
} catch (g) {
|
1372
|
+
return j("Error connecting to wallet:", g), F(g.message || "Failed to connect to wallet"), !1;
|
1406
1373
|
}
|
1407
|
-
}, de = async (
|
1408
|
-
if (!
|
1409
|
-
|
1374
|
+
}, de = async (g = !1) => {
|
1375
|
+
if (!A) {
|
1376
|
+
F("No active payment to process");
|
1410
1377
|
return;
|
1411
1378
|
}
|
1412
|
-
|
1379
|
+
j("Starting payment process...", { isQrCodeMode: g }), _("loading"), B(null);
|
1413
1380
|
try {
|
1414
|
-
|
1415
|
-
let
|
1416
|
-
if (
|
1417
|
-
|
1418
|
-
else if (
|
1419
|
-
|
1381
|
+
j("Processing payment:", { paymentId: A.id, currency: $, isQrCodeMode: g });
|
1382
|
+
let y;
|
1383
|
+
if (C)
|
1384
|
+
j("Test mode: Generating mock transaction..."), y = `0x${Array.from({ length: 64 }, () => Math.floor(Math.random() * 16).toString(16)).join("")}`;
|
1385
|
+
else if (g)
|
1386
|
+
j("QR code payment: User confirms payment was sent"), y = `qrcode_${Date.now().toString(16)}_${Math.random().toString(16).substring(2, 10)}`;
|
1420
1387
|
else {
|
1421
|
-
if (!ee && !await
|
1388
|
+
if (!ee && !await T())
|
1422
1389
|
throw new Error("Please connect your wallet to proceed with payment");
|
1423
|
-
const
|
1390
|
+
const xe = A.walletAddress || "0x742d35Cc6634C0532925a3b844Bc454e4438f44e", he = {
|
1424
1391
|
from: await window.ethereum.request({ method: "eth_requestAccounts" }).then((te) => te[0]),
|
1425
|
-
to:
|
1392
|
+
to: xe,
|
1426
1393
|
value: "0x0",
|
1427
1394
|
// For ERC-20 tokens, value is 0
|
1428
1395
|
data: "0x"
|
1429
1396
|
// Would include token transfer data for ERC-20
|
1430
1397
|
};
|
1431
|
-
|
1398
|
+
j("Sending transaction to wallet for approval..."), y = await Rt(he);
|
1432
1399
|
}
|
1433
|
-
|
1434
|
-
const fe = await
|
1435
|
-
paymentId:
|
1436
|
-
transactionHash:
|
1437
|
-
network:
|
1400
|
+
j("Transaction hash:", y), B(y), j("Sending process payment request to API...");
|
1401
|
+
const fe = await Tt({
|
1402
|
+
paymentId: A.id,
|
1403
|
+
transactionHash: y,
|
1404
|
+
network: $ === "SOL" || $ === "USDC_SOL" ? "solana" : "ethereum"
|
1438
1405
|
});
|
1439
|
-
|
1440
|
-
} catch (
|
1441
|
-
|
1406
|
+
j("Payment processed successfully:", fe), _("success"), d && (j("Calling onSuccess callback..."), d(A.id, y));
|
1407
|
+
} catch (y) {
|
1408
|
+
j("Payment error:", y), F(y.message || "Failed to process payment"), _("error"), w && w(y);
|
1442
1409
|
}
|
1443
1410
|
};
|
1444
1411
|
return X(() => {
|
1445
|
-
|
1446
|
-
}, [
|
1447
|
-
|
1412
|
+
S && A && W(!0);
|
1413
|
+
}, [S, A]), /* @__PURE__ */ t.jsx(t.Fragment, { children: Y && /* @__PURE__ */ t.jsx(
|
1414
|
+
Yt,
|
1448
1415
|
{
|
1449
|
-
isOpen:
|
1416
|
+
isOpen: Y,
|
1450
1417
|
onClose: Z,
|
1451
|
-
payment:
|
1418
|
+
payment: A,
|
1452
1419
|
paymentStatus: se,
|
1453
|
-
selectedCurrency:
|
1420
|
+
selectedCurrency: $,
|
1454
1421
|
onCurrencySelect: q,
|
1455
1422
|
onPayment: de,
|
1456
1423
|
error: oe,
|
1457
1424
|
theme: I,
|
1458
|
-
merchantName:
|
1425
|
+
merchantName: x,
|
1459
1426
|
transactionHash: K,
|
1460
1427
|
walletConnected: ee,
|
1461
|
-
onConnectWallet:
|
1462
|
-
testMode:
|
1428
|
+
onConnectWallet: T,
|
1429
|
+
testMode: C
|
1463
1430
|
}
|
1464
1431
|
) });
|
1465
1432
|
});
|
1466
|
-
|
1467
|
-
const
|
1433
|
+
Ft.displayName = "CoinleyCheckout";
|
1434
|
+
const er = {
|
1468
1435
|
apiUrl: "https://coinleyserver-production.up.railway.app",
|
1469
1436
|
debug: !1,
|
1470
1437
|
testMode: !1,
|
1471
1438
|
theme: "light"
|
1472
|
-
},
|
1439
|
+
}, tr = "1.0.2";
|
1473
1440
|
export {
|
1474
|
-
|
1475
|
-
|
1476
|
-
|
1477
|
-
|
1441
|
+
Ft as CoinleyCheckout,
|
1442
|
+
Yt as CoinleyModal,
|
1443
|
+
Zt as CoinleyProvider,
|
1444
|
+
er as DEFAULT_CONFIG,
|
1478
1445
|
It as QRCode,
|
1479
|
-
|
1480
|
-
|
1481
|
-
|
1482
|
-
|
1483
|
-
|
1484
|
-
|
1485
|
-
|
1486
|
-
|
1487
|
-
|
1488
|
-
|
1489
|
-
|
1490
|
-
|
1491
|
-
|
1492
|
-
|
1493
|
-
|
1494
|
-
|
1495
|
-
|
1496
|
-
|
1446
|
+
Kt as TOKEN_ADDRESSES,
|
1447
|
+
Qt as ThemeProvider,
|
1448
|
+
tr as VERSION,
|
1449
|
+
Ot as connectWallet,
|
1450
|
+
At as createPayment,
|
1451
|
+
Pt as getAccounts,
|
1452
|
+
Ht as getChainId,
|
1453
|
+
$t as getMerchantPaymentStats,
|
1454
|
+
Wt as getMerchantPayments,
|
1455
|
+
Xt as getNetworkName,
|
1456
|
+
Gt as getPayment,
|
1457
|
+
Bt as getSupportedCurrencies,
|
1458
|
+
Jt as getTokenBalance,
|
1459
|
+
G as isMetaMaskInstalled,
|
1460
|
+
Vt as isWalletConnected,
|
1461
|
+
Tt as processPayment,
|
1462
|
+
qt as sendToken,
|
1463
|
+
Rt as sendTransaction
|
1497
1464
|
};
|