coinley-checkout 0.3.0 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,111 +1,441 @@
1
- var Xt = Object.defineProperty, Zt = Object.defineProperties;
2
- var er = Object.getOwnPropertyDescriptors;
3
- var ot = Object.getOwnPropertySymbols;
4
- var tr = Object.prototype.hasOwnProperty, rr = Object.prototype.propertyIsEnumerable;
5
- var it = (o, a, n) => a in o ? Xt(o, a, { enumerable: !0, configurable: !0, writable: !0, value: n }) : o[a] = n, ce = (o, a) => {
6
- for (var n in a || (a = {}))
7
- tr.call(a, n) && it(o, n, a[n]);
8
- if (ot)
9
- for (var n of ot(a))
10
- rr.call(a, n) && it(o, n, a[n]);
11
- return o;
12
- }, lt = (o, a) => Zt(o, er(a));
13
- var G = (o, a, n) => new Promise((d, h) => {
14
- var m = (t) => {
1
+ var qe = Object.defineProperty, He = Object.defineProperties;
2
+ var $e = Object.getOwnPropertyDescriptors;
3
+ var ge = Object.getOwnPropertySymbols;
4
+ var Ke = Object.prototype.hasOwnProperty, Ve = Object.prototype.propertyIsEnumerable;
5
+ var fe = (s, t, e) => t in s ? qe(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e, z = (s, t) => {
6
+ for (var e in t || (t = {}))
7
+ Ke.call(t, e) && fe(s, e, t[e]);
8
+ if (ge)
9
+ for (var e of ge(t))
10
+ Ve.call(t, e) && fe(s, e, t[e]);
11
+ return s;
12
+ }, we = (s, t) => He(s, $e(t));
13
+ var R = (s, t, e) => new Promise((i, c) => {
14
+ var u = (r) => {
15
15
  try {
16
- y(n.next(t));
17
- } catch (s) {
18
- h(s);
16
+ x(e.next(r));
17
+ } catch (n) {
18
+ c(n);
19
19
  }
20
- }, b = (t) => {
20
+ }, y = (r) => {
21
21
  try {
22
- y(n.throw(t));
23
- } catch (s) {
24
- h(s);
22
+ x(e.throw(r));
23
+ } catch (n) {
24
+ c(n);
25
25
  }
26
- }, y = (t) => t.done ? d(t.value) : Promise.resolve(t.value).then(m, b);
27
- y((n = n.apply(o, a)).next());
26
+ }, x = (r) => r.done ? i(r.value) : Promise.resolve(r.value).then(u, y);
27
+ x((e = e.apply(s, t)).next());
28
28
  });
29
- import B, { createContext as ft, useContext as ht, useState as H, useEffect as je, forwardRef as nr, useImperativeHandle as sr } from "react";
30
- let X = {
29
+ import L, { createContext as xe, useContext as ye, useState as D, useEffect as Z, forwardRef as _e, useImperativeHandle as Je } from "react";
30
+ const b = {
31
+ ETHEREUM: "ethereum",
32
+ BSC: "bsc",
33
+ TRON: "tron",
34
+ ALGORAND: "algorand"
35
+ }, N = {
36
+ METAMASK: "metamask",
37
+ TRONLINK: "tronlink",
38
+ TRUST_WALLET: "trust_wallet",
39
+ LUTE: "lute"
40
+ }, de = {
41
+ [b.ETHEREUM]: {
42
+ chainId: "0x1",
43
+ chainName: "Ethereum Mainnet",
44
+ nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
45
+ rpcUrls: ["https://mainnet.infura.io/v3/"],
46
+ blockExplorerUrls: ["https://etherscan.io/"],
47
+ supportedWallets: [N.METAMASK, N.TRUST_WALLET]
48
+ },
49
+ [b.BSC]: {
50
+ chainId: "0x38",
51
+ chainName: "BNB Smart Chain",
52
+ nativeCurrency: { name: "BNB", symbol: "BNB", decimals: 18 },
53
+ rpcUrls: ["https://bsc-dataseed.binance.org/"],
54
+ blockExplorerUrls: ["https://bscscan.com/"],
55
+ supportedWallets: [N.METAMASK, N.TRUST_WALLET]
56
+ },
57
+ [b.TRON]: {
58
+ fullHost: "https://api.trongrid.io",
59
+ explorerUrl: "https://tronscan.org",
60
+ supportedWallets: [N.TRONLINK]
61
+ },
62
+ [b.ALGORAND]: {
63
+ network: "mainnet",
64
+ explorerUrl: "https://algoexplorer.io",
65
+ supportedWallets: [N.LUTE]
66
+ }
67
+ }, Ye = {
68
+ USDT: {
69
+ [b.ETHEREUM]: {
70
+ address: "0xdAC17F958D2ee523a2206206994597C13D831ec7",
71
+ decimals: 6
72
+ },
73
+ [b.BSC]: {
74
+ address: "0x55d398326f99059fF775485246999027B3197955",
75
+ decimals: 18
76
+ },
77
+ [b.TRON]: {
78
+ address: "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
79
+ decimals: 6
80
+ }
81
+ },
82
+ USDC: {
83
+ [b.ETHEREUM]: {
84
+ address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
85
+ decimals: 6
86
+ },
87
+ [b.BSC]: {
88
+ address: "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d",
89
+ decimals: 18
90
+ },
91
+ [b.TRON]: {
92
+ address: "TEkxiTehnzSmSe2XqrBj4w32RUN966rdz8",
93
+ decimals: 6
94
+ }
95
+ },
96
+ ALGO: {
97
+ [b.ALGORAND]: {
98
+ address: "native",
99
+ decimals: 6
100
+ }
101
+ }
102
+ };
103
+ let _ = null;
104
+ const Xe = () => R(void 0, null, function* () {
105
+ if (_)
106
+ return _;
107
+ try {
108
+ if (typeof window != "undefined" && window.Web3)
109
+ return _ = window.Web3, _;
110
+ const s = yield import("web3");
111
+ return _ = s.default || s.Web3 || s, _;
112
+ } catch (s) {
113
+ throw console.error("Failed to load Web3:", s), new Error("Web3 is required for blockchain transactions. Please ensure web3 is installed: npm install web3");
114
+ }
115
+ }), ue = () => {
116
+ const s = {
117
+ [N.METAMASK]: !1,
118
+ [N.TRUST_WALLET]: !1,
119
+ [N.TRONLINK]: !1,
120
+ [N.LUTE]: !1
121
+ };
122
+ if (typeof window == "undefined")
123
+ return s;
124
+ try {
125
+ s[N.METAMASK] = !!(window.ethereum && window.ethereum.isMetaMask), s[N.TRONLINK] = !!window.tronWeb, s[N.TRUST_WALLET] = !!(window.ethereum && window.ethereum.isTrust), s[N.LUTE] = !!(window.algorand && window.algorand.isLute);
126
+ } catch (t) {
127
+ console.warn("Error detecting wallets:", t);
128
+ }
129
+ return s;
130
+ }, Ze = (s) => {
131
+ const t = de[s];
132
+ if (!t)
133
+ return [];
134
+ const e = ue();
135
+ return t.supportedWallets.filter((i) => e[i]);
136
+ }, et = (s, t) => R(void 0, null, function* () {
137
+ switch (s) {
138
+ case N.METAMASK:
139
+ return yield tt(t);
140
+ case N.TRONLINK:
141
+ return yield rt();
142
+ case N.TRUST_WALLET:
143
+ return yield st(t);
144
+ case N.LUTE:
145
+ return yield nt();
146
+ default:
147
+ throw new Error(`Unsupported wallet type: ${s}`);
148
+ }
149
+ }), tt = (s) => R(void 0, null, function* () {
150
+ if (typeof window == "undefined" || !window.ethereum || !window.ethereum.isMetaMask)
151
+ throw new Error("MetaMask is not installed. Please install MetaMask extension.");
152
+ try {
153
+ const t = yield window.ethereum.request({
154
+ method: "eth_requestAccounts"
155
+ });
156
+ if (!t || t.length === 0)
157
+ throw new Error("No accounts found. Please unlock MetaMask.");
158
+ const e = de[s];
159
+ return e && e.chainId && (yield be(e)), {
160
+ address: t[0],
161
+ network: s,
162
+ walletType: N.METAMASK
163
+ };
164
+ } catch (t) {
165
+ throw t.code === 4001 ? new Error("User rejected the connection request") : new Error(`Failed to connect MetaMask: ${t.message}`);
166
+ }
167
+ }), rt = () => R(void 0, null, function* () {
168
+ var i;
169
+ if (typeof window == "undefined" || !window.tronWeb)
170
+ throw new Error("TronLink is not installed. Please install TronLink extension.");
171
+ let s = 0;
172
+ const t = 10;
173
+ for (; !window.tronWeb.ready && s < t; )
174
+ yield new Promise((c) => setTimeout(c, 1e3)), s++;
175
+ if (!window.tronWeb.ready)
176
+ throw new Error("TronLink is not ready. Please unlock your TronLink wallet and try again.");
177
+ const e = (i = window.tronWeb.defaultAddress) == null ? void 0 : i.base58;
178
+ if (!e)
179
+ throw new Error("No account found in TronLink. Please make sure you have an account set up.");
180
+ return {
181
+ address: e,
182
+ network: b.TRON,
183
+ walletType: N.TRONLINK
184
+ };
185
+ }), st = (s) => R(void 0, null, function* () {
186
+ if (typeof window == "undefined" || !window.ethereum || !window.ethereum.isTrust)
187
+ throw new Error("Trust Wallet is not installed. Please install Trust Wallet extension.");
188
+ try {
189
+ const t = yield window.ethereum.request({
190
+ method: "eth_requestAccounts"
191
+ });
192
+ if (!t || t.length === 0)
193
+ throw new Error("No accounts found. Please unlock Trust Wallet.");
194
+ const e = de[s];
195
+ return e && e.chainId && (yield be(e)), {
196
+ address: t[0],
197
+ network: s,
198
+ walletType: N.TRUST_WALLET
199
+ };
200
+ } catch (t) {
201
+ throw t.code === 4001 ? new Error("User rejected the connection request") : new Error(`Failed to connect Trust Wallet: ${t.message}`);
202
+ }
203
+ }), nt = () => R(void 0, null, function* () {
204
+ if (typeof window == "undefined" || !window.algorand || !window.algorand.isLute)
205
+ throw new Error("Lute wallet is not installed. Please install Lute wallet extension.");
206
+ try {
207
+ const s = yield window.algorand.connect();
208
+ if (!s || s.length === 0)
209
+ throw new Error("No accounts found. Please unlock Lute wallet.");
210
+ return {
211
+ address: s[0],
212
+ network: b.ALGORAND,
213
+ walletType: N.LUTE
214
+ };
215
+ } catch (s) {
216
+ throw new Error(`Failed to connect Lute wallet: ${s.message}`);
217
+ }
218
+ }), be = (s) => R(void 0, null, function* () {
219
+ if (typeof window == "undefined" || !window.ethereum)
220
+ throw new Error("Ethereum provider not found");
221
+ try {
222
+ yield window.ethereum.request({
223
+ method: "wallet_switchEthereumChain",
224
+ params: [{ chainId: s.chainId }]
225
+ });
226
+ } catch (t) {
227
+ if (t.code === 4902)
228
+ try {
229
+ yield window.ethereum.request({
230
+ method: "wallet_addEthereumChain",
231
+ params: [s]
232
+ });
233
+ } catch (e) {
234
+ throw new Error(`Failed to add ${s.chainName} to wallet: ${e.message}`);
235
+ }
236
+ else
237
+ throw t.code === 4001 ? new Error("User rejected network switch request") : new Error(`Failed to switch to ${s.chainName}: ${t.message}`);
238
+ }
239
+ }), ot = (s, t) => R(void 0, null, function* () {
240
+ const { walletType: e, network: i, address: c } = s, { to: u, amount: y, tokenAddress: x, tokenDecimals: r } = t;
241
+ switch (e) {
242
+ case N.METAMASK:
243
+ case N.TRUST_WALLET:
244
+ return yield at(c, u, y, x, r);
245
+ case N.TRONLINK:
246
+ return yield it(u, y, x, r);
247
+ case N.LUTE:
248
+ return yield lt(c, u, y);
249
+ default:
250
+ throw new Error(`Unsupported wallet type: ${e}`);
251
+ }
252
+ }), at = (s, t, e, i, c) => R(void 0, null, function* () {
253
+ if (typeof window == "undefined" || !window.ethereum)
254
+ throw new Error("Ethereum provider not found");
255
+ try {
256
+ const u = yield Xe(), y = new u(window.ethereum), x = y.utils.toBN(
257
+ Math.floor(parseFloat(e) * Math.pow(10, c || 18))
258
+ );
259
+ if (i && i !== "native") {
260
+ const r = [
261
+ {
262
+ constant: !1,
263
+ inputs: [
264
+ { name: "_to", type: "address" },
265
+ { name: "_value", type: "uint256" }
266
+ ],
267
+ name: "transfer",
268
+ outputs: [{ name: "", type: "bool" }],
269
+ payable: !1,
270
+ stateMutability: "nonpayable",
271
+ type: "function"
272
+ }
273
+ ];
274
+ return (yield new y.eth.Contract(r, i).methods.transfer(t, x).send({ from: s })).transactionHash;
275
+ } else
276
+ return (yield y.eth.sendTransaction({
277
+ from: s,
278
+ to: t,
279
+ value: x
280
+ })).transactionHash;
281
+ } catch (u) {
282
+ throw u.code === 4001 ? new Error("Transaction was rejected by user") : new Error(`Transaction failed: ${u.message}`);
283
+ }
284
+ }), it = (s, t, e, i) => R(void 0, null, function* () {
285
+ if (typeof window == "undefined" || !window.tronWeb || !window.tronWeb.ready)
286
+ throw new Error("TronLink is not ready");
287
+ try {
288
+ const c = Math.floor(parseFloat(t) * Math.pow(10, i || 6));
289
+ return e && e !== "native" ? yield (yield window.tronWeb.contract().at(e)).transfer(s, c).send({
290
+ feeLimit: 1e8,
291
+ callValue: 0
292
+ }) : (yield window.tronWeb.trx.sendTransaction(s, c)).txid;
293
+ } catch (c) {
294
+ throw new Error(`TRON transaction failed: ${c.message}`);
295
+ }
296
+ }), lt = (s, t, e) => R(void 0, null, function* () {
297
+ if (typeof window == "undefined" || !window.algorand)
298
+ throw new Error("Algorand wallet is not available");
299
+ try {
300
+ const i = Math.floor(parseFloat(e) * 1e6), c = {
301
+ from: s,
302
+ to: t,
303
+ amount: i,
304
+ type: "pay"
305
+ }, u = yield window.algorand.signTransaction(c);
306
+ return (yield window.algorand.sendTransaction(u)).txId;
307
+ } catch (i) {
308
+ throw new Error(`Algorand transaction failed: ${i.message}`);
309
+ }
310
+ }), ct = (s) => ({
311
+ [N.METAMASK]: "https://metamask.io/",
312
+ [N.TRONLINK]: "https://www.tronlink.org/",
313
+ [N.TRUST_WALLET]: "https://trustwallet.com/",
314
+ [N.LUTE]: "https://lute.app/"
315
+ })[s] || "";
316
+ let U = {
31
317
  apiKey: null,
32
318
  apiSecret: null,
33
319
  apiUrl: "http://localhost:9000",
34
320
  merchantWalletAddresses: {}
35
321
  // Changed to object for multi-network support
36
322
  };
37
- const ar = (o) => {
38
- X = ce(ce({}, X), o), console.log("API initialized with:", {
39
- apiUrl: X.apiUrl,
40
- apiKey: X.apiKey ? `${X.apiKey.substring(0, 6)}...` : null,
41
- hasWalletAddresses: Object.keys(X.merchantWalletAddresses || {}).length > 0
323
+ const dt = (s) => {
324
+ U = z(z({}, U), s), console.log("API initialized with:", {
325
+ apiUrl: U.apiUrl,
326
+ apiKey: U.apiKey ? `${U.apiKey.substring(0, 6)}...` : null,
327
+ hasWalletAddresses: Object.keys(U.merchantWalletAddresses || {}).length > 0
42
328
  });
43
- }, Ve = () => ({
329
+ }, Y = () => ({
44
330
  "Content-Type": "application/json",
45
- "x-api-key": X.apiKey,
46
- "x-api-secret": X.apiSecret
47
- }), or = (o) => G(void 0, null, function* () {
331
+ "x-api-key": U.apiKey,
332
+ "x-api-secret": U.apiSecret
333
+ }), ut = (s) => R(void 0, null, function* () {
48
334
  try {
49
- console.log("Creating payment with data:", o), console.log("API URL:", `${X.apiUrl}/api/payments/create`);
50
- const a = lt(ce({}, o), {
51
- merchantWalletAddresses: ce(ce({}, X.merchantWalletAddresses), o.merchantWalletAddresses)
52
- }), n = yield fetch(`${X.apiUrl}/api/payments/create`, {
335
+ console.log("Creating payment with data:", s), console.log("API URL:", `${U.apiUrl}/api/payments/create`);
336
+ const t = we(z({}, s), {
337
+ merchantWalletAddresses: z(z({}, U.merchantWalletAddresses), s.merchantWalletAddresses)
338
+ }), e = yield fetch(`${U.apiUrl}/api/payments/create`, {
53
339
  method: "POST",
54
- headers: Ve(),
55
- body: JSON.stringify(a)
340
+ headers: Y(),
341
+ body: JSON.stringify(t)
56
342
  });
57
- if (console.log("Create payment response status:", n.status), !n.ok) {
58
- const h = yield n.json();
59
- throw console.error("Error creating payment:", h), new Error(h.error || `Failed to create payment: ${n.status}`);
60
- }
61
- const d = yield n.json();
62
- return console.log("Create payment response data:", d), d;
63
- } catch (a) {
64
- throw console.error("Create payment error:", a), a;
343
+ if (console.log("Create payment response status:", e.status), !e.ok) {
344
+ const c = yield e.json();
345
+ throw console.error("Error creating payment:", c), new Error(c.error || `Failed to create payment: ${e.status}`);
346
+ }
347
+ const i = yield e.json();
348
+ return console.log("Create payment response data:", i), i;
349
+ } catch (t) {
350
+ throw console.error("Create payment error:", t), t;
65
351
  }
66
- }), Br = (o) => G(void 0, null, function* () {
352
+ }), Bt = (s) => R(void 0, null, function* () {
67
353
  try {
68
- console.log("Getting payment:", o);
69
- const a = yield fetch(`${X.apiUrl}/api/payments/${o}`, {
354
+ console.log("Getting payment:", s);
355
+ const t = yield fetch(`${U.apiUrl}/api/payments/${s}`, {
70
356
  method: "GET",
71
- headers: Ve()
357
+ headers: Y()
72
358
  });
73
- if (!a.ok) {
74
- const d = yield a.json();
75
- throw console.error("Error getting payment:", d), new Error(d.error || `Failed to get payment: ${a.status}`);
76
- }
77
- const n = yield a.json();
78
- return console.log("Get payment response:", n), n;
79
- } catch (a) {
80
- throw console.error("Get payment error:", a), a;
359
+ if (!t.ok) {
360
+ const i = yield t.json();
361
+ throw console.error("Error getting payment:", i), new Error(i.error || `Failed to get payment: ${t.status}`);
362
+ }
363
+ const e = yield t.json();
364
+ return console.log("Get payment response:", e), e;
365
+ } catch (t) {
366
+ throw console.error("Get payment error:", t), t;
81
367
  }
82
- }), ir = (o) => G(void 0, null, function* () {
368
+ }), ht = (s) => R(void 0, null, function* () {
83
369
  try {
84
- console.log("Processing payment with data:", o), console.log("API URL:", `${X.apiUrl}/api/payments/process`);
85
- const a = yield fetch(`${X.apiUrl}/api/payments/process`, {
370
+ console.log("Processing payment with data:", s), console.log("API URL:", `${U.apiUrl}/api/payments/process`);
371
+ const t = yield fetch(`${U.apiUrl}/api/payments/process`, {
86
372
  method: "POST",
87
- headers: Ve(),
88
- body: JSON.stringify(o)
373
+ headers: Y(),
374
+ body: JSON.stringify(s)
89
375
  });
90
- if (console.log("Process payment response status:", a.status), !a.ok) {
91
- const d = yield a.json();
92
- throw console.error("Error processing payment:", d), new Error(d.error || `Failed to process payment: ${a.status}`);
93
- }
94
- const n = yield a.json();
95
- return console.log("Process payment response data:", n), n;
96
- } catch (a) {
97
- throw console.error("Process payment error:", a), a;
376
+ if (console.log("Process payment response status:", t.status), !t.ok) {
377
+ const i = yield t.json();
378
+ throw console.error("Error processing payment:", i), new Error(i.error || `Failed to process payment: ${t.status}`);
379
+ }
380
+ const e = yield t.json();
381
+ return console.log("Process payment response data:", e), e;
382
+ } catch (t) {
383
+ throw console.error("Process payment error:", t), t;
98
384
  }
99
- }), lr = () => typeof window != "undefined" && typeof window.ethereum != "undefined", zr = () => G(void 0, null, function* () {
100
- if (!lr())
101
- throw new Error("MetaMask is not installed");
385
+ }), Wt = () => R(void 0, null, function* () {
102
386
  try {
103
- return yield window.ethereum.request({ method: "eth_requestAccounts" });
104
- } catch (o) {
105
- throw console.error("Error connecting to wallet:", o), o;
387
+ const s = yield fetch(`${U.apiUrl}/api/networks`, {
388
+ method: "GET",
389
+ headers: Y()
390
+ });
391
+ if (!s.ok) {
392
+ const e = yield s.json();
393
+ throw new Error(e.error || `Failed to get networks: ${s.status}`);
394
+ }
395
+ return yield s.json();
396
+ } catch (s) {
397
+ throw console.error("Get supported networks error:", s), s;
106
398
  }
107
- });
108
- var Be = { exports: {} }, Ce = {};
399
+ }), Qt = () => R(void 0, null, function* () {
400
+ try {
401
+ const s = yield fetch(`${U.apiUrl}/api/merchants/profile`, {
402
+ method: "GET",
403
+ headers: Y()
404
+ });
405
+ if (!s.ok) {
406
+ const e = yield s.json();
407
+ throw new Error(e.error || `Failed to get merchant profile: ${s.status}`);
408
+ }
409
+ const t = yield s.json();
410
+ return t.merchant && t.merchant.walletAddresses && (U.merchantWalletAddresses = z(z({}, U.merchantWalletAddresses), t.merchant.walletAddresses)), t;
411
+ } catch (s) {
412
+ throw console.error("Get merchant profile error:", s), s;
413
+ }
414
+ }), zt = (s, t) => R(void 0, null, function* () {
415
+ try {
416
+ const e = yield fetch(`${U.apiUrl}/api/wallets/validate`, {
417
+ method: "POST",
418
+ headers: Y(),
419
+ body: JSON.stringify({ address: s, network: t })
420
+ });
421
+ if (!e.ok) {
422
+ const c = yield e.json();
423
+ throw new Error(c.error || `Failed to validate address: ${e.status}`);
424
+ }
425
+ return yield e.json();
426
+ } catch (e) {
427
+ throw console.error("Validate wallet address error:", e), e;
428
+ }
429
+ }), Gt = (s = "ethereum") => {
430
+ const e = {
431
+ ethereum: "0x",
432
+ bsc: "0x",
433
+ tron: "",
434
+ algorand: ""
435
+ }[s] || "0x", i = Array.from({ length: 64 }, () => Math.floor(Math.random() * 16).toString(16)).join("");
436
+ return `${e}${i}`;
437
+ };
438
+ var Ne = { exports: {} }, ne = {};
109
439
  /**
110
440
  * @license React
111
441
  * react-jsx-runtime.production.min.js
@@ -115,745 +445,129 @@ var Be = { exports: {} }, Ce = {};
115
445
  * This source code is licensed under the MIT license found in the
116
446
  * LICENSE file in the root directory of this source tree.
117
447
  */
118
- var ct;
119
- function cr() {
120
- if (ct)
121
- return Ce;
122
- ct = 1;
123
- var o = B, a = Symbol.for("react.element"), n = Symbol.for("react.fragment"), d = Object.prototype.hasOwnProperty, h = o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, m = { key: !0, ref: !0, __self: !0, __source: !0 };
124
- function b(y, t, s) {
125
- var r, l = {}, c = null, w = null;
126
- s !== void 0 && (c = "" + s), t.key !== void 0 && (c = "" + t.key), t.ref !== void 0 && (w = t.ref);
127
- for (r in t)
128
- d.call(t, r) && !m.hasOwnProperty(r) && (l[r] = t[r]);
129
- if (y && y.defaultProps)
130
- for (r in t = y.defaultProps, t)
131
- l[r] === void 0 && (l[r] = t[r]);
132
- return { $$typeof: a, type: y, key: c, ref: w, props: l, _owner: h.current };
133
- }
134
- return Ce.Fragment = n, Ce.jsx = b, Ce.jsxs = b, Ce;
448
+ var mt = L, gt = Symbol.for("react.element"), ft = Symbol.for("react.fragment"), wt = Object.prototype.hasOwnProperty, pt = mt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, xt = { key: !0, ref: !0, __self: !0, __source: !0 };
449
+ function Ee(s, t, e) {
450
+ var i, c = {}, u = null, y = null;
451
+ e !== void 0 && (u = "" + e), t.key !== void 0 && (u = "" + t.key), t.ref !== void 0 && (y = t.ref);
452
+ for (i in t)
453
+ wt.call(t, i) && !xt.hasOwnProperty(i) && (c[i] = t[i]);
454
+ if (s && s.defaultProps)
455
+ for (i in t = s.defaultProps, t)
456
+ c[i] === void 0 && (c[i] = t[i]);
457
+ return { $$typeof: gt, type: s, key: u, ref: y, props: c, _owner: pt.current };
135
458
  }
136
- var Ae = {};
137
- /**
138
- * @license React
139
- * react-jsx-runtime.development.js
140
- *
141
- * Copyright (c) Facebook, Inc. and its affiliates.
142
- *
143
- * This source code is licensed under the MIT license found in the
144
- * LICENSE file in the root directory of this source tree.
145
- */
146
- var ut;
147
- function ur() {
148
- return ut || (ut = 1, process.env.NODE_ENV !== "production" && function() {
149
- var o = B, a = Symbol.for("react.element"), n = Symbol.for("react.portal"), d = Symbol.for("react.fragment"), h = Symbol.for("react.strict_mode"), m = Symbol.for("react.profiler"), b = Symbol.for("react.provider"), y = Symbol.for("react.context"), t = Symbol.for("react.forward_ref"), s = Symbol.for("react.suspense"), r = Symbol.for("react.suspense_list"), l = Symbol.for("react.memo"), c = Symbol.for("react.lazy"), w = Symbol.for("react.offscreen"), u = Symbol.iterator, p = "@@iterator";
150
- function v(e) {
151
- if (e === null || typeof e != "object")
152
- return null;
153
- var f = u && e[u] || e[p];
154
- return typeof f == "function" ? f : null;
155
- }
156
- var T = o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
157
- function N(e) {
158
- {
159
- for (var f = arguments.length, g = new Array(f > 1 ? f - 1 : 0), E = 1; E < f; E++)
160
- g[E - 1] = arguments[E];
161
- x("error", e, g);
162
- }
163
- }
164
- function x(e, f, g) {
165
- {
166
- var E = T.ReactDebugCurrentFrame, M = E.getStackAddendum();
167
- M !== "" && (f += "%s", g = g.concat([M]));
168
- var L = g.map(function(S) {
169
- return String(S);
170
- });
171
- L.unshift("Warning: " + f), Function.prototype.apply.call(console[e], console, L);
172
- }
173
- }
174
- var D = !1, I = !1, Z = !1, ae = !1, R = !1, P;
175
- P = Symbol.for("react.module.reference");
176
- function oe(e) {
177
- return !!(typeof e == "string" || typeof e == "function" || e === d || e === m || R || e === h || e === s || e === r || ae || e === w || D || I || Z || typeof e == "object" && e !== null && (e.$$typeof === c || e.$$typeof === l || e.$$typeof === b || e.$$typeof === y || e.$$typeof === t || // This needs to include all possible module reference object
178
- // types supported by any Flight configuration anywhere since
179
- // we don't know which Flight build this will end up being used
180
- // with.
181
- e.$$typeof === P || e.getModuleId !== void 0));
182
- }
183
- function K(e, f, g) {
184
- var E = e.displayName;
185
- if (E)
186
- return E;
187
- var M = f.displayName || f.name || "";
188
- return M !== "" ? g + "(" + M + ")" : g;
189
- }
190
- function $(e) {
191
- return e.displayName || "Context";
192
- }
193
- function Y(e) {
194
- if (e == null)
195
- return null;
196
- if (typeof e.tag == "number" && N("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
197
- return e.displayName || e.name || null;
198
- if (typeof e == "string")
199
- return e;
200
- switch (e) {
201
- case d:
202
- return "Fragment";
203
- case n:
204
- return "Portal";
205
- case m:
206
- return "Profiler";
207
- case h:
208
- return "StrictMode";
209
- case s:
210
- return "Suspense";
211
- case r:
212
- return "SuspenseList";
213
- }
214
- if (typeof e == "object")
215
- switch (e.$$typeof) {
216
- case y:
217
- var f = e;
218
- return $(f) + ".Consumer";
219
- case b:
220
- var g = e;
221
- return $(g._context) + ".Provider";
222
- case t:
223
- return K(e, e.render, "ForwardRef");
224
- case l:
225
- var E = e.displayName || null;
226
- return E !== null ? E : Y(e.type) || "Memo";
227
- case c: {
228
- var M = e, L = M._payload, S = M._init;
229
- try {
230
- return Y(S(L));
231
- } catch (j) {
232
- return null;
233
- }
234
- }
235
- }
236
- return null;
237
- }
238
- var Q = Object.assign, F = 0, se, ne, ue, ie, ee, me, de;
239
- function ge() {
240
- }
241
- ge.__reactDisabledLog = !0;
242
- function _() {
243
- {
244
- if (F === 0) {
245
- se = console.log, ne = console.info, ue = console.warn, ie = console.error, ee = console.group, me = console.groupCollapsed, de = console.groupEnd;
246
- var e = {
247
- configurable: !0,
248
- enumerable: !0,
249
- value: ge,
250
- writable: !0
251
- };
252
- Object.defineProperties(console, {
253
- info: e,
254
- log: e,
255
- warn: e,
256
- error: e,
257
- group: e,
258
- groupCollapsed: e,
259
- groupEnd: e
260
- });
261
- }
262
- F++;
263
- }
264
- }
265
- function Pe() {
266
- {
267
- if (F--, F === 0) {
268
- var e = {
269
- configurable: !0,
270
- enumerable: !0,
271
- writable: !0
272
- };
273
- Object.defineProperties(console, {
274
- log: Q({}, e, {
275
- value: se
276
- }),
277
- info: Q({}, e, {
278
- value: ne
279
- }),
280
- warn: Q({}, e, {
281
- value: ue
282
- }),
283
- error: Q({}, e, {
284
- value: ie
285
- }),
286
- group: Q({}, e, {
287
- value: ee
288
- }),
289
- groupCollapsed: Q({}, e, {
290
- value: me
291
- }),
292
- groupEnd: Q({}, e, {
293
- value: de
294
- })
295
- });
296
- }
297
- F < 0 && N("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
298
- }
299
- }
300
- var pe = T.ReactCurrentDispatcher, Ne;
301
- function we(e, f, g) {
302
- {
303
- if (Ne === void 0)
304
- try {
305
- throw Error();
306
- } catch (M) {
307
- var E = M.stack.trim().match(/\n( *(at )?)/);
308
- Ne = E && E[1] || "";
309
- }
310
- return `
311
- ` + Ne + e;
312
- }
313
- }
314
- var Re = !1, ye;
315
- {
316
- var Oe = typeof WeakMap == "function" ? WeakMap : Map;
317
- ye = new Oe();
318
- }
319
- function O(e, f) {
320
- if (!e || Re)
321
- return "";
322
- {
323
- var g = ye.get(e);
324
- if (g !== void 0)
325
- return g;
326
- }
327
- var E;
328
- Re = !0;
329
- var M = Error.prepareStackTrace;
330
- Error.prepareStackTrace = void 0;
331
- var L;
332
- L = pe.current, pe.current = null, _();
333
- try {
334
- if (f) {
335
- var S = function() {
336
- throw Error();
337
- };
338
- if (Object.defineProperty(S.prototype, "props", {
339
- set: function() {
340
- throw Error();
341
- }
342
- }), typeof Reflect == "object" && Reflect.construct) {
343
- try {
344
- Reflect.construct(S, []);
345
- } catch (J) {
346
- E = J;
347
- }
348
- Reflect.construct(e, [], S);
349
- } else {
350
- try {
351
- S.call();
352
- } catch (J) {
353
- E = J;
354
- }
355
- e.call(S.prototype);
356
- }
357
- } else {
358
- try {
359
- throw Error();
360
- } catch (J) {
361
- E = J;
362
- }
363
- e();
364
- }
365
- } catch (J) {
366
- if (J && E && typeof J.stack == "string") {
367
- for (var j = J.stack.split(`
368
- `), q = E.stack.split(`
369
- `), W = j.length - 1, z = q.length - 1; W >= 1 && z >= 0 && j[W] !== q[z]; )
370
- z--;
371
- for (; W >= 1 && z >= 0; W--, z--)
372
- if (j[W] !== q[z]) {
373
- if (W !== 1 || z !== 1)
374
- do
375
- if (W--, z--, z < 0 || j[W] !== q[z]) {
376
- var re = `
377
- ` + j[W].replace(" at new ", " at ");
378
- return e.displayName && re.includes("<anonymous>") && (re = re.replace("<anonymous>", e.displayName)), typeof e == "function" && ye.set(e, re), re;
379
- }
380
- while (W >= 1 && z >= 0);
381
- break;
382
- }
383
- }
384
- } finally {
385
- Re = !1, pe.current = L, Pe(), Error.prepareStackTrace = M;
386
- }
387
- var Ee = e ? e.displayName || e.name : "", fe = Ee ? we(Ee) : "";
388
- return typeof e == "function" && ye.set(e, fe), fe;
389
- }
390
- function V(e, f, g) {
391
- return O(e, !1);
392
- }
393
- function te(e) {
394
- var f = e.prototype;
395
- return !!(f && f.isReactComponent);
396
- }
397
- function ve(e, f, g) {
398
- if (e == null)
399
- return "";
400
- if (typeof e == "function")
401
- return O(e, te(e));
402
- if (typeof e == "string")
403
- return we(e);
404
- switch (e) {
405
- case s:
406
- return we("Suspense");
407
- case r:
408
- return we("SuspenseList");
409
- }
410
- if (typeof e == "object")
411
- switch (e.$$typeof) {
412
- case t:
413
- return V(e.render);
414
- case l:
415
- return ve(e.type, f, g);
416
- case c: {
417
- var E = e, M = E._payload, L = E._init;
418
- try {
419
- return ve(L(M), f, g);
420
- } catch (S) {
421
- }
422
- }
423
- }
424
- return "";
425
- }
426
- var le = Object.prototype.hasOwnProperty, Ke = {}, Ye = T.ReactDebugCurrentFrame;
427
- function Se(e) {
428
- if (e) {
429
- var f = e._owner, g = ve(e.type, e._source, f ? f.type : null);
430
- Ye.setExtraStackFrame(g);
431
- } else
432
- Ye.setExtraStackFrame(null);
433
- }
434
- function kt(e, f, g, E, M) {
435
- {
436
- var L = Function.call.bind(le);
437
- for (var S in e)
438
- if (L(e, S)) {
439
- var j = void 0;
440
- try {
441
- if (typeof e[S] != "function") {
442
- var q = Error((E || "React class") + ": " + g + " type `" + S + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[S] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
443
- throw q.name = "Invariant Violation", q;
444
- }
445
- j = e[S](f, S, E, g, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
446
- } catch (W) {
447
- j = W;
448
- }
449
- j && !(j instanceof Error) && (Se(M), N("%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).", E || "React class", g, S, typeof j), Se(null)), j instanceof Error && !(j.message in Ke) && (Ke[j.message] = !0, Se(M), N("Failed %s type: %s", g, j.message), Se(null));
450
- }
451
- }
452
- }
453
- var Mt = Array.isArray;
454
- function Le(e) {
455
- return Mt(e);
456
- }
457
- function Pt(e) {
458
- {
459
- var f = typeof Symbol == "function" && Symbol.toStringTag, g = f && e[Symbol.toStringTag] || e.constructor.name || "Object";
460
- return g;
461
- }
462
- }
463
- function Ot(e) {
464
- try {
465
- return qe(e), !1;
466
- } catch (f) {
467
- return !0;
468
- }
469
- }
470
- function qe(e) {
471
- return "" + e;
472
- }
473
- function $e(e) {
474
- if (Ot(e))
475
- return N("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Pt(e)), qe(e);
476
- }
477
- var Te = T.ReactCurrentOwner, Lt = {
478
- key: !0,
479
- ref: !0,
480
- __self: !0,
481
- __source: !0
482
- }, Je, Xe, De;
483
- De = {};
484
- function Dt(e) {
485
- if (le.call(e, "ref")) {
486
- var f = Object.getOwnPropertyDescriptor(e, "ref").get;
487
- if (f && f.isReactWarning)
488
- return !1;
489
- }
490
- return e.ref !== void 0;
491
- }
492
- function It(e) {
493
- if (le.call(e, "key")) {
494
- var f = Object.getOwnPropertyDescriptor(e, "key").get;
495
- if (f && f.isReactWarning)
496
- return !1;
497
- }
498
- return e.key !== void 0;
499
- }
500
- function Ft(e, f) {
501
- if (typeof e.ref == "string" && Te.current && f && Te.current.stateNode !== f) {
502
- var g = Y(Te.current.type);
503
- De[g] || (N('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', Y(Te.current.type), e.ref), De[g] = !0);
504
- }
505
- }
506
- function Ut(e, f) {
507
- {
508
- var g = function() {
509
- Je || (Je = !0, N("%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)", f));
510
- };
511
- g.isReactWarning = !0, Object.defineProperty(e, "key", {
512
- get: g,
513
- configurable: !0
514
- });
515
- }
516
- }
517
- function _t(e, f) {
518
- {
519
- var g = function() {
520
- Xe || (Xe = !0, N("%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)", f));
521
- };
522
- g.isReactWarning = !0, Object.defineProperty(e, "ref", {
523
- get: g,
524
- configurable: !0
525
- });
526
- }
527
- }
528
- var Wt = function(e, f, g, E, M, L, S) {
529
- var j = {
530
- // This tag allows us to uniquely identify this as a React Element
531
- $$typeof: a,
532
- // Built-in properties that belong on the element
533
- type: e,
534
- key: f,
535
- ref: g,
536
- props: S,
537
- // Record the component responsible for creating this element.
538
- _owner: L
539
- };
540
- return j._store = {}, Object.defineProperty(j._store, "validated", {
541
- configurable: !1,
542
- enumerable: !1,
543
- writable: !0,
544
- value: !1
545
- }), Object.defineProperty(j, "_self", {
546
- configurable: !1,
547
- enumerable: !1,
548
- writable: !1,
549
- value: E
550
- }), Object.defineProperty(j, "_source", {
551
- configurable: !1,
552
- enumerable: !1,
553
- writable: !1,
554
- value: M
555
- }), Object.freeze && (Object.freeze(j.props), Object.freeze(j)), j;
556
- };
557
- function Bt(e, f, g, E, M) {
558
- {
559
- var L, S = {}, j = null, q = null;
560
- g !== void 0 && ($e(g), j = "" + g), It(f) && ($e(f.key), j = "" + f.key), Dt(f) && (q = f.ref, Ft(f, M));
561
- for (L in f)
562
- le.call(f, L) && !Lt.hasOwnProperty(L) && (S[L] = f[L]);
563
- if (e && e.defaultProps) {
564
- var W = e.defaultProps;
565
- for (L in W)
566
- S[L] === void 0 && (S[L] = W[L]);
567
- }
568
- if (j || q) {
569
- var z = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
570
- j && Ut(S, z), q && _t(S, z);
571
- }
572
- return Wt(e, j, q, M, E, Te.current, S);
573
- }
574
- }
575
- var Ie = T.ReactCurrentOwner, Ze = T.ReactDebugCurrentFrame;
576
- function xe(e) {
577
- if (e) {
578
- var f = e._owner, g = ve(e.type, e._source, f ? f.type : null);
579
- Ze.setExtraStackFrame(g);
580
- } else
581
- Ze.setExtraStackFrame(null);
582
- }
583
- var Fe;
584
- Fe = !1;
585
- function Ue(e) {
586
- return typeof e == "object" && e !== null && e.$$typeof === a;
587
- }
588
- function et() {
589
- {
590
- if (Ie.current) {
591
- var e = Y(Ie.current.type);
592
- if (e)
593
- return `
594
-
595
- Check the render method of \`` + e + "`.";
596
- }
597
- return "";
598
- }
599
- }
600
- function zt(e) {
601
- {
602
- if (e !== void 0) {
603
- var f = e.fileName.replace(/^.*[\\\/]/, ""), g = e.lineNumber;
604
- return `
605
-
606
- Check your code at ` + f + ":" + g + ".";
607
- }
608
- return "";
609
- }
610
- }
611
- var tt = {};
612
- function Qt(e) {
613
- {
614
- var f = et();
615
- if (!f) {
616
- var g = typeof e == "string" ? e : e.displayName || e.name;
617
- g && (f = `
618
-
619
- Check the top-level render call using <` + g + ">.");
620
- }
621
- return f;
622
- }
623
- }
624
- function rt(e, f) {
625
- {
626
- if (!e._store || e._store.validated || e.key != null)
627
- return;
628
- e._store.validated = !0;
629
- var g = Qt(f);
630
- if (tt[g])
631
- return;
632
- tt[g] = !0;
633
- var E = "";
634
- e && e._owner && e._owner !== Ie.current && (E = " It was passed a child from " + Y(e._owner.type) + "."), xe(e), N('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', g, E), xe(null);
635
- }
636
- }
637
- function nt(e, f) {
638
- {
639
- if (typeof e != "object")
640
- return;
641
- if (Le(e))
642
- for (var g = 0; g < e.length; g++) {
643
- var E = e[g];
644
- Ue(E) && rt(E, f);
645
- }
646
- else if (Ue(e))
647
- e._store && (e._store.validated = !0);
648
- else if (e) {
649
- var M = v(e);
650
- if (typeof M == "function" && M !== e.entries)
651
- for (var L = M.call(e), S; !(S = L.next()).done; )
652
- Ue(S.value) && rt(S.value, f);
653
- }
654
- }
655
- }
656
- function Vt(e) {
657
- {
658
- var f = e.type;
659
- if (f == null || typeof f == "string")
660
- return;
661
- var g;
662
- if (typeof f == "function")
663
- g = f.propTypes;
664
- else if (typeof f == "object" && (f.$$typeof === t || // Note: Memo only checks outer props here.
665
- // Inner props are checked in the reconciler.
666
- f.$$typeof === l))
667
- g = f.propTypes;
668
- else
669
- return;
670
- if (g) {
671
- var E = Y(f);
672
- kt(g, e.props, "prop", E, e);
673
- } else if (f.PropTypes !== void 0 && !Fe) {
674
- Fe = !0;
675
- var M = Y(f);
676
- N("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", M || "Unknown");
677
- }
678
- typeof f.getDefaultProps == "function" && !f.getDefaultProps.isReactClassApproved && N("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
679
- }
680
- }
681
- function Gt(e) {
682
- {
683
- for (var f = Object.keys(e.props), g = 0; g < f.length; g++) {
684
- var E = f[g];
685
- if (E !== "children" && E !== "key") {
686
- xe(e), N("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", E), xe(null);
687
- break;
688
- }
689
- }
690
- e.ref !== null && (xe(e), N("Invalid attribute `ref` supplied to `React.Fragment`."), xe(null));
691
- }
692
- }
693
- var st = {};
694
- function at(e, f, g, E, M, L) {
695
- {
696
- var S = oe(e);
697
- if (!S) {
698
- var j = "";
699
- (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (j += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
700
- var q = zt(M);
701
- q ? j += q : j += et();
702
- var W;
703
- e === null ? W = "null" : Le(e) ? W = "array" : e !== void 0 && e.$$typeof === a ? (W = "<" + (Y(e.type) || "Unknown") + " />", j = " Did you accidentally export a JSX literal instead of a component?") : W = typeof e, N("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", W, j);
704
- }
705
- var z = Bt(e, f, g, M, L);
706
- if (z == null)
707
- return z;
708
- if (S) {
709
- var re = f.children;
710
- if (re !== void 0)
711
- if (E)
712
- if (Le(re)) {
713
- for (var Ee = 0; Ee < re.length; Ee++)
714
- nt(re[Ee], e);
715
- Object.freeze && Object.freeze(re);
716
- } else
717
- N("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
718
- else
719
- nt(re, e);
720
- }
721
- if (le.call(f, "key")) {
722
- var fe = Y(e), J = Object.keys(f).filter(function(Jt) {
723
- return Jt !== "key";
724
- }), _e = J.length > 0 ? "{key: someKey, " + J.join(": ..., ") + ": ...}" : "{key: someKey}";
725
- if (!st[fe + _e]) {
726
- var $t = J.length > 0 ? "{" + J.join(": ..., ") + ": ...}" : "{}";
727
- N(`A props object containing a "key" prop is being spread into JSX:
728
- let props = %s;
729
- <%s {...props} />
730
- React keys must be passed directly to JSX without using spread:
731
- let props = %s;
732
- <%s key={someKey} {...props} />`, _e, fe, $t, fe), st[fe + _e] = !0;
733
- }
734
- }
735
- return e === d ? Gt(z) : Vt(z), z;
736
- }
737
- }
738
- function Ht(e, f, g) {
739
- return at(e, f, g, !0);
740
- }
741
- function Kt(e, f, g) {
742
- return at(e, f, g, !1);
743
- }
744
- var Yt = Kt, qt = Ht;
745
- Ae.Fragment = d, Ae.jsx = Yt, Ae.jsxs = qt;
746
- }()), Ae;
747
- }
748
- process.env.NODE_ENV === "production" ? Be.exports = cr() : Be.exports = ur();
749
- var i = Be.exports;
750
- const mt = ft(), dr = () => ht(mt), Qr = ({ initialTheme: o = "light", children: a }) => {
751
- const [n, d] = H(o), h = () => {
752
- d((m) => m === "light" ? "dark" : "light");
459
+ ne.Fragment = ft;
460
+ ne.jsx = Ee;
461
+ ne.jsxs = Ee;
462
+ Ne.exports = ne;
463
+ var o = Ne.exports;
464
+ const ve = xe(), yt = () => ye(ve), qt = ({ initialTheme: s = "light", children: t }) => {
465
+ const [e, i] = D(s), c = () => {
466
+ i((u) => u === "light" ? "dark" : "light");
753
467
  };
754
- return je(() => {
755
- document.documentElement.classList.remove("light", "dark"), document.documentElement.classList.add(n);
756
- }, [n]), /* @__PURE__ */ i.jsx(mt.Provider, { value: { theme: n, setTheme: d, toggleTheme: h }, children: a });
757
- }, gt = ft(), fr = () => ht(gt), Vr = ({
758
- apiKey: o,
759
- apiSecret: a,
760
- apiUrl: n = "http://localhost:9000",
761
- merchantWalletAddress: d = null,
468
+ return Z(() => {
469
+ document.documentElement.classList.remove("light", "dark"), document.documentElement.classList.add(e);
470
+ }, [e]), /* @__PURE__ */ o.jsx(ve.Provider, { value: { theme: e, setTheme: i, toggleTheme: c }, children: t });
471
+ }, ke = xe(), bt = () => ye(ke), Ht = ({
472
+ apiKey: s,
473
+ apiSecret: t,
474
+ apiUrl: e = "http://localhost:9000",
475
+ merchantWalletAddress: i = null,
762
476
  // New prop for merchant wallet address
763
- merchantSolWalletAddress: h = null,
477
+ merchantSolWalletAddress: c = null,
764
478
  // New prop for Solana wallet address
765
- debug: m = !1,
766
- children: b
479
+ debug: u = !1,
480
+ children: y
767
481
  }) => {
768
- const [y, t] = H(!1), [s, r] = H(null), [l, c] = H(null);
769
- je(() => {
770
- if (!o || !a) {
771
- r("API key and secret are required");
482
+ const [x, r] = D(!1), [n, a] = D(null), [l, d] = D(null);
483
+ Z(() => {
484
+ if (!s || !t) {
485
+ a("API key and secret are required");
772
486
  return;
773
487
  }
774
488
  try {
775
- ar({
776
- apiKey: o,
777
- apiSecret: a,
778
- apiUrl: n,
779
- merchantWalletAddress: d,
489
+ dt({
490
+ apiKey: s,
491
+ apiSecret: t,
492
+ apiUrl: e,
493
+ merchantWalletAddress: i,
780
494
  // Pass wallet address to API service
781
- merchantSolWalletAddress: h
782
- }), t(!0), m && console.log("Coinley SDK initialized with:", {
783
- apiKey: o,
784
- apiUrl: n,
785
- merchantWalletAddress: d ? `${d.substring(0, 6)}...${d.substring(d.length - 4)}` : "Not provided",
786
- merchantSolWalletAddress: h ? `${h.substring(0, 6)}...${h.substring(h.length - 4)}` : "Not provided"
495
+ merchantSolWalletAddress: c
496
+ }), r(!0), u && console.log("Coinley SDK initialized with:", {
497
+ apiKey: s,
498
+ apiUrl: e,
499
+ merchantWalletAddress: i ? `${i.substring(0, 6)}...${i.substring(i.length - 4)}` : "Not provided",
500
+ merchantSolWalletAddress: c ? `${c.substring(0, 6)}...${c.substring(c.length - 4)}` : "Not provided"
787
501
  });
788
- } catch (p) {
789
- r(p.message), m && console.error("Coinley SDK initialization error:", p);
790
- }
791
- }, [o, a, n, d, h, m]);
792
- const u = {
793
- apiKey: o,
794
- apiSecret: a,
795
- apiUrl: n,
796
- merchantWalletAddress: d,
797
- merchantSolWalletAddress: h,
798
- isInitialized: y,
799
- error: s,
800
- debug: m,
502
+ } catch (m) {
503
+ a(m.message), u && console.error("Coinley SDK initialization error:", m);
504
+ }
505
+ }, [s, t, e, i, c, u]);
506
+ const h = {
507
+ apiKey: s,
508
+ apiSecret: t,
509
+ apiUrl: e,
510
+ merchantWalletAddress: i,
511
+ merchantSolWalletAddress: c,
512
+ isInitialized: x,
513
+ error: n,
514
+ debug: u,
801
515
  paymentData: l,
802
- storePaymentData: (p) => (c(p), p)
516
+ storePaymentData: (m) => (d(m), m)
803
517
  };
804
- return /* @__PURE__ */ i.jsx(gt.Provider, { value: u, children: b });
518
+ return /* @__PURE__ */ o.jsx(ke.Provider, { value: h, children: y });
805
519
  };
806
- var hr = Object.defineProperty, Me = Object.getOwnPropertySymbols, pt = Object.prototype.hasOwnProperty, wt = Object.prototype.propertyIsEnumerable, dt = (o, a, n) => a in o ? hr(o, a, { enumerable: !0, configurable: !0, writable: !0, value: n }) : o[a] = n, ze = (o, a) => {
807
- for (var n in a || (a = {}))
808
- pt.call(a, n) && dt(o, n, a[n]);
809
- if (Me)
810
- for (var n of Me(a))
811
- wt.call(a, n) && dt(o, n, a[n]);
812
- return o;
813
- }, Qe = (o, a) => {
814
- var n = {};
815
- for (var d in o)
816
- pt.call(o, d) && a.indexOf(d) < 0 && (n[d] = o[d]);
817
- if (o != null && Me)
818
- for (var d of Me(o))
819
- a.indexOf(d) < 0 && wt.call(o, d) && (n[d] = o[d]);
820
- return n;
520
+ var Nt = Object.defineProperty, se = Object.getOwnPropertySymbols, Te = Object.prototype.hasOwnProperty, Ae = Object.prototype.propertyIsEnumerable, pe = (s, t, e) => t in s ? Nt(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e, le = (s, t) => {
521
+ for (var e in t || (t = {}))
522
+ Te.call(t, e) && pe(s, e, t[e]);
523
+ if (se)
524
+ for (var e of se(t))
525
+ Ae.call(t, e) && pe(s, e, t[e]);
526
+ return s;
527
+ }, ce = (s, t) => {
528
+ var e = {};
529
+ for (var i in s)
530
+ Te.call(s, i) && t.indexOf(i) < 0 && (e[i] = s[i]);
531
+ if (s != null && se)
532
+ for (var i of se(s))
533
+ t.indexOf(i) < 0 && Ae.call(s, i) && (e[i] = s[i]);
534
+ return e;
821
535
  };
822
536
  /**
823
537
  * @license QR Code generator library (TypeScript)
824
538
  * Copyright (c) Project Nayuki.
825
539
  * SPDX-License-Identifier: MIT
826
540
  */
827
- var he;
828
- ((o) => {
829
- const a = class A {
541
+ var K;
542
+ ((s) => {
543
+ const t = class E {
830
544
  /*-- Constructor (low level) and fields --*/
831
545
  // Creates a new QR Code with the given version number,
832
546
  // error correction level, data codeword bytes, and mask number.
833
547
  // This is a low-level API that most users should not use directly.
834
548
  // A mid-level API is the encodeSegments() function.
835
- constructor(t, s, r, l) {
836
- if (this.version = t, this.errorCorrectionLevel = s, this.modules = [], this.isFunction = [], t < A.MIN_VERSION || t > A.MAX_VERSION)
549
+ constructor(r, n, a, l) {
550
+ if (this.version = r, this.errorCorrectionLevel = n, this.modules = [], this.isFunction = [], r < E.MIN_VERSION || r > E.MAX_VERSION)
837
551
  throw new RangeError("Version value out of range");
838
552
  if (l < -1 || l > 7)
839
553
  throw new RangeError("Mask value out of range");
840
- this.size = t * 4 + 17;
841
- let c = [];
842
- for (let u = 0; u < this.size; u++)
843
- c.push(!1);
844
- for (let u = 0; u < this.size; u++)
845
- this.modules.push(c.slice()), this.isFunction.push(c.slice());
554
+ this.size = r * 4 + 17;
555
+ let d = [];
556
+ for (let h = 0; h < this.size; h++)
557
+ d.push(!1);
558
+ for (let h = 0; h < this.size; h++)
559
+ this.modules.push(d.slice()), this.isFunction.push(d.slice());
846
560
  this.drawFunctionPatterns();
847
- const w = this.addEccAndInterleave(r);
848
- if (this.drawCodewords(w), l == -1) {
849
- let u = 1e9;
850
- for (let p = 0; p < 8; p++) {
851
- this.applyMask(p), this.drawFormatBits(p);
852
- const v = this.getPenaltyScore();
853
- v < u && (l = p, u = v), this.applyMask(p);
561
+ const g = this.addEccAndInterleave(a);
562
+ if (this.drawCodewords(g), l == -1) {
563
+ let h = 1e9;
564
+ for (let m = 0; m < 8; m++) {
565
+ this.applyMask(m), this.drawFormatBits(m);
566
+ const f = this.getPenaltyScore();
567
+ f < h && (l = m, h = f), this.applyMask(m);
854
568
  }
855
569
  }
856
- h(0 <= l && l <= 7), this.mask = l, this.applyMask(l), this.drawFormatBits(l), this.isFunction = [];
570
+ c(0 <= l && l <= 7), this.mask = l, this.applyMask(l), this.drawFormatBits(l), this.isFunction = [];
857
571
  }
858
572
  /*-- Static factory functions (high level) --*/
859
573
  // Returns a QR Code representing the given Unicode text string at the given error correction level.
@@ -861,17 +575,17 @@ var he;
861
575
  // Unicode code points (not UTF-16 code units) if the low error correction level is used. The smallest possible
862
576
  // QR Code version is automatically chosen for the output. The ECC level of the result may be higher than the
863
577
  // ecl argument if it can be done without increasing the version.
864
- static encodeText(t, s) {
865
- const r = o.QrSegment.makeSegments(t);
866
- return A.encodeSegments(r, s);
578
+ static encodeText(r, n) {
579
+ const a = s.QrSegment.makeSegments(r);
580
+ return E.encodeSegments(a, n);
867
581
  }
868
582
  // Returns a QR Code representing the given binary data at the given error correction level.
869
583
  // This function always encodes using the binary segment mode, not any text mode. The maximum number of
870
584
  // bytes allowed is 2953. The smallest possible QR Code version is automatically chosen for the output.
871
585
  // The ECC level of the result may be higher than the ecl argument if it can be done without increasing the version.
872
- static encodeBinary(t, s) {
873
- const r = o.QrSegment.makeBytes(t);
874
- return A.encodeSegments([r], s);
586
+ static encodeBinary(r, n) {
587
+ const a = s.QrSegment.makeBytes(r);
588
+ return E.encodeSegments([a], n);
875
589
  }
876
590
  /*-- Static factory functions (mid level) --*/
877
591
  // Returns a QR Code representing the given segments with the given encoding parameters.
@@ -883,43 +597,43 @@ var he;
883
597
  // This function allows the user to create a custom sequence of segments that switches
884
598
  // between modes (such as alphanumeric and byte) to encode text in less space.
885
599
  // This is a mid-level API; the high-level API is encodeText() and encodeBinary().
886
- static encodeSegments(t, s, r = 1, l = 40, c = -1, w = !0) {
887
- if (!(A.MIN_VERSION <= r && r <= l && l <= A.MAX_VERSION) || c < -1 || c > 7)
600
+ static encodeSegments(r, n, a = 1, l = 40, d = -1, g = !0) {
601
+ if (!(E.MIN_VERSION <= a && a <= l && l <= E.MAX_VERSION) || d < -1 || d > 7)
888
602
  throw new RangeError("Invalid value");
889
- let u, p;
890
- for (u = r; ; u++) {
891
- const x = A.getNumDataCodewords(u, s) * 8, D = b.getTotalBits(t, u);
892
- if (D <= x) {
893
- p = D;
603
+ let h, m;
604
+ for (h = a; ; h++) {
605
+ const p = E.getNumDataCodewords(h, n) * 8, T = y.getTotalBits(r, h);
606
+ if (T <= p) {
607
+ m = T;
894
608
  break;
895
609
  }
896
- if (u >= l)
610
+ if (h >= l)
897
611
  throw new RangeError("Data too long");
898
612
  }
899
- for (const x of [A.Ecc.MEDIUM, A.Ecc.QUARTILE, A.Ecc.HIGH])
900
- w && p <= A.getNumDataCodewords(u, x) * 8 && (s = x);
901
- let v = [];
902
- for (const x of t) {
903
- n(x.mode.modeBits, 4, v), n(x.numChars, x.mode.numCharCountBits(u), v);
904
- for (const D of x.getData())
905
- v.push(D);
613
+ for (const p of [E.Ecc.MEDIUM, E.Ecc.QUARTILE, E.Ecc.HIGH])
614
+ g && m <= E.getNumDataCodewords(h, p) * 8 && (n = p);
615
+ let f = [];
616
+ for (const p of r) {
617
+ e(p.mode.modeBits, 4, f), e(p.numChars, p.mode.numCharCountBits(h), f);
618
+ for (const T of p.getData())
619
+ f.push(T);
906
620
  }
907
- h(v.length == p);
908
- const T = A.getNumDataCodewords(u, s) * 8;
909
- h(v.length <= T), n(0, Math.min(4, T - v.length), v), n(0, (8 - v.length % 8) % 8, v), h(v.length % 8 == 0);
910
- for (let x = 236; v.length < T; x ^= 253)
911
- n(x, 8, v);
912
- let N = [];
913
- for (; N.length * 8 < v.length; )
914
- N.push(0);
915
- return v.forEach((x, D) => N[D >>> 3] |= x << 7 - (D & 7)), new A(u, s, N, c);
621
+ c(f.length == m);
622
+ const k = E.getNumDataCodewords(h, n) * 8;
623
+ c(f.length <= k), e(0, Math.min(4, k - f.length), f), e(0, (8 - f.length % 8) % 8, f), c(f.length % 8 == 0);
624
+ for (let p = 236; f.length < k; p ^= 253)
625
+ e(p, 8, f);
626
+ let w = [];
627
+ for (; w.length * 8 < f.length; )
628
+ w.push(0);
629
+ return f.forEach((p, T) => w[T >>> 3] |= p << 7 - (T & 7)), new E(h, n, w, d);
916
630
  }
917
631
  /*-- Accessor methods --*/
918
632
  // Returns the color of the module (pixel) at the given coordinates, which is false
919
633
  // for light or true for dark. The top left corner has the coordinates (x=0, y=0).
920
634
  // If the given coordinates are out of bounds, then false (light) is returned.
921
- getModule(t, s) {
922
- return 0 <= t && t < this.size && 0 <= s && s < this.size && this.modules[s][t];
635
+ getModule(r, n) {
636
+ return 0 <= r && r < this.size && 0 <= n && n < this.size && this.modules[n][r];
923
637
  }
924
638
  // Modified to expose modules for easy access
925
639
  getModules() {
@@ -928,33 +642,33 @@ var he;
928
642
  /*-- Private helper methods for constructor: Drawing function modules --*/
929
643
  // Reads this object's version field, and draws and marks all function modules.
930
644
  drawFunctionPatterns() {
931
- for (let r = 0; r < this.size; r++)
932
- this.setFunctionModule(6, r, r % 2 == 0), this.setFunctionModule(r, 6, r % 2 == 0);
645
+ for (let a = 0; a < this.size; a++)
646
+ this.setFunctionModule(6, a, a % 2 == 0), this.setFunctionModule(a, 6, a % 2 == 0);
933
647
  this.drawFinderPattern(3, 3), this.drawFinderPattern(this.size - 4, 3), this.drawFinderPattern(3, this.size - 4);
934
- const t = this.getAlignmentPatternPositions(), s = t.length;
935
- for (let r = 0; r < s; r++)
936
- for (let l = 0; l < s; l++)
937
- r == 0 && l == 0 || r == 0 && l == s - 1 || r == s - 1 && l == 0 || this.drawAlignmentPattern(t[r], t[l]);
648
+ const r = this.getAlignmentPatternPositions(), n = r.length;
649
+ for (let a = 0; a < n; a++)
650
+ for (let l = 0; l < n; l++)
651
+ a == 0 && l == 0 || a == 0 && l == n - 1 || a == n - 1 && l == 0 || this.drawAlignmentPattern(r[a], r[l]);
938
652
  this.drawFormatBits(0), this.drawVersion();
939
653
  }
940
654
  // Draws two copies of the format bits (with its own error correction code)
941
655
  // based on the given mask and this object's error correction level field.
942
- drawFormatBits(t) {
943
- const s = this.errorCorrectionLevel.formatBits << 3 | t;
944
- let r = s;
945
- for (let c = 0; c < 10; c++)
946
- r = r << 1 ^ (r >>> 9) * 1335;
947
- const l = (s << 10 | r) ^ 21522;
948
- h(l >>> 15 == 0);
949
- for (let c = 0; c <= 5; c++)
950
- this.setFunctionModule(8, c, d(l, c));
951
- this.setFunctionModule(8, 7, d(l, 6)), this.setFunctionModule(8, 8, d(l, 7)), this.setFunctionModule(7, 8, d(l, 8));
952
- for (let c = 9; c < 15; c++)
953
- this.setFunctionModule(14 - c, 8, d(l, c));
954
- for (let c = 0; c < 8; c++)
955
- this.setFunctionModule(this.size - 1 - c, 8, d(l, c));
956
- for (let c = 8; c < 15; c++)
957
- this.setFunctionModule(8, this.size - 15 + c, d(l, c));
656
+ drawFormatBits(r) {
657
+ const n = this.errorCorrectionLevel.formatBits << 3 | r;
658
+ let a = n;
659
+ for (let d = 0; d < 10; d++)
660
+ a = a << 1 ^ (a >>> 9) * 1335;
661
+ const l = (n << 10 | a) ^ 21522;
662
+ c(l >>> 15 == 0);
663
+ for (let d = 0; d <= 5; d++)
664
+ this.setFunctionModule(8, d, i(l, d));
665
+ this.setFunctionModule(8, 7, i(l, 6)), this.setFunctionModule(8, 8, i(l, 7)), this.setFunctionModule(7, 8, i(l, 8));
666
+ for (let d = 9; d < 15; d++)
667
+ this.setFunctionModule(14 - d, 8, i(l, d));
668
+ for (let d = 0; d < 8; d++)
669
+ this.setFunctionModule(this.size - 1 - d, 8, i(l, d));
670
+ for (let d = 8; d < 15; d++)
671
+ this.setFunctionModule(8, this.size - 15 + d, i(l, d));
958
672
  this.setFunctionModule(8, this.size - 8, !0);
959
673
  }
960
674
  // Draws two copies of the version bits (with its own error correction code),
@@ -962,144 +676,144 @@ var he;
962
676
  drawVersion() {
963
677
  if (this.version < 7)
964
678
  return;
965
- let t = this.version;
966
- for (let r = 0; r < 12; r++)
967
- t = t << 1 ^ (t >>> 11) * 7973;
968
- const s = this.version << 12 | t;
969
- h(s >>> 18 == 0);
970
- for (let r = 0; r < 18; r++) {
971
- const l = d(s, r), c = this.size - 11 + r % 3, w = Math.floor(r / 3);
972
- this.setFunctionModule(c, w, l), this.setFunctionModule(w, c, l);
679
+ let r = this.version;
680
+ for (let a = 0; a < 12; a++)
681
+ r = r << 1 ^ (r >>> 11) * 7973;
682
+ const n = this.version << 12 | r;
683
+ c(n >>> 18 == 0);
684
+ for (let a = 0; a < 18; a++) {
685
+ const l = i(n, a), d = this.size - 11 + a % 3, g = Math.floor(a / 3);
686
+ this.setFunctionModule(d, g, l), this.setFunctionModule(g, d, l);
973
687
  }
974
688
  }
975
689
  // Draws a 9*9 finder pattern including the border separator,
976
690
  // with the center module at (x, y). Modules can be out of bounds.
977
- drawFinderPattern(t, s) {
978
- for (let r = -4; r <= 4; r++)
691
+ drawFinderPattern(r, n) {
692
+ for (let a = -4; a <= 4; a++)
979
693
  for (let l = -4; l <= 4; l++) {
980
- const c = Math.max(Math.abs(l), Math.abs(r)), w = t + l, u = s + r;
981
- 0 <= w && w < this.size && 0 <= u && u < this.size && this.setFunctionModule(w, u, c != 2 && c != 4);
694
+ const d = Math.max(Math.abs(l), Math.abs(a)), g = r + l, h = n + a;
695
+ 0 <= g && g < this.size && 0 <= h && h < this.size && this.setFunctionModule(g, h, d != 2 && d != 4);
982
696
  }
983
697
  }
984
698
  // Draws a 5*5 alignment pattern, with the center module
985
699
  // at (x, y). All modules must be in bounds.
986
- drawAlignmentPattern(t, s) {
987
- for (let r = -2; r <= 2; r++)
700
+ drawAlignmentPattern(r, n) {
701
+ for (let a = -2; a <= 2; a++)
988
702
  for (let l = -2; l <= 2; l++)
989
- this.setFunctionModule(t + l, s + r, Math.max(Math.abs(l), Math.abs(r)) != 1);
703
+ this.setFunctionModule(r + l, n + a, Math.max(Math.abs(l), Math.abs(a)) != 1);
990
704
  }
991
705
  // Sets the color of a module and marks it as a function module.
992
706
  // Only used by the constructor. Coordinates must be in bounds.
993
- setFunctionModule(t, s, r) {
994
- this.modules[s][t] = r, this.isFunction[s][t] = !0;
707
+ setFunctionModule(r, n, a) {
708
+ this.modules[n][r] = a, this.isFunction[n][r] = !0;
995
709
  }
996
710
  /*-- Private helper methods for constructor: Codewords and masking --*/
997
711
  // Returns a new byte string representing the given data with the appropriate error correction
998
712
  // codewords appended to it, based on this object's version and error correction level.
999
- addEccAndInterleave(t) {
1000
- const s = this.version, r = this.errorCorrectionLevel;
1001
- if (t.length != A.getNumDataCodewords(s, r))
713
+ addEccAndInterleave(r) {
714
+ const n = this.version, a = this.errorCorrectionLevel;
715
+ if (r.length != E.getNumDataCodewords(n, a))
1002
716
  throw new RangeError("Invalid argument");
1003
- const l = A.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][s], c = A.ECC_CODEWORDS_PER_BLOCK[r.ordinal][s], w = Math.floor(A.getNumRawDataModules(s) / 8), u = l - w % l, p = Math.floor(w / l);
1004
- let v = [];
1005
- const T = A.reedSolomonComputeDivisor(c);
1006
- for (let x = 0, D = 0; x < l; x++) {
1007
- let I = t.slice(D, D + p - c + (x < u ? 0 : 1));
1008
- D += I.length;
1009
- const Z = A.reedSolomonComputeRemainder(I, T);
1010
- x < u && I.push(0), v.push(I.concat(Z));
717
+ const l = E.NUM_ERROR_CORRECTION_BLOCKS[a.ordinal][n], d = E.ECC_CODEWORDS_PER_BLOCK[a.ordinal][n], g = Math.floor(E.getNumRawDataModules(n) / 8), h = l - g % l, m = Math.floor(g / l);
718
+ let f = [];
719
+ const k = E.reedSolomonComputeDivisor(d);
720
+ for (let p = 0, T = 0; p < l; p++) {
721
+ let C = r.slice(T, T + m - d + (p < h ? 0 : 1));
722
+ T += C.length;
723
+ const q = E.reedSolomonComputeRemainder(C, k);
724
+ p < h && C.push(0), f.push(C.concat(q));
1011
725
  }
1012
- let N = [];
1013
- for (let x = 0; x < v[0].length; x++)
1014
- v.forEach((D, I) => {
1015
- (x != p - c || I >= u) && N.push(D[x]);
726
+ let w = [];
727
+ for (let p = 0; p < f[0].length; p++)
728
+ f.forEach((T, C) => {
729
+ (p != m - d || C >= h) && w.push(T[p]);
1016
730
  });
1017
- return h(N.length == w), N;
731
+ return c(w.length == g), w;
1018
732
  }
1019
733
  // Draws the given sequence of 8-bit codewords (data and error correction) onto the entire
1020
734
  // data area of this QR Code. Function modules need to be marked off before this is called.
1021
- drawCodewords(t) {
1022
- if (t.length != Math.floor(A.getNumRawDataModules(this.version) / 8))
735
+ drawCodewords(r) {
736
+ if (r.length != Math.floor(E.getNumRawDataModules(this.version) / 8))
1023
737
  throw new RangeError("Invalid argument");
1024
- let s = 0;
1025
- for (let r = this.size - 1; r >= 1; r -= 2) {
1026
- r == 6 && (r = 5);
738
+ let n = 0;
739
+ for (let a = this.size - 1; a >= 1; a -= 2) {
740
+ a == 6 && (a = 5);
1027
741
  for (let l = 0; l < this.size; l++)
1028
- for (let c = 0; c < 2; c++) {
1029
- const w = r - c, p = (r + 1 & 2) == 0 ? this.size - 1 - l : l;
1030
- !this.isFunction[p][w] && s < t.length * 8 && (this.modules[p][w] = d(t[s >>> 3], 7 - (s & 7)), s++);
742
+ for (let d = 0; d < 2; d++) {
743
+ const g = a - d, m = (a + 1 & 2) == 0 ? this.size - 1 - l : l;
744
+ !this.isFunction[m][g] && n < r.length * 8 && (this.modules[m][g] = i(r[n >>> 3], 7 - (n & 7)), n++);
1031
745
  }
1032
746
  }
1033
- h(s == t.length * 8);
747
+ c(n == r.length * 8);
1034
748
  }
1035
749
  // XORs the codeword modules in this QR Code with the given mask pattern.
1036
750
  // The function modules must be marked and the codeword bits must be drawn
1037
751
  // before masking. Due to the arithmetic of XOR, calling applyMask() with
1038
752
  // the same mask value a second time will undo the mask. A final well-formed
1039
753
  // QR Code needs exactly one (not zero, two, etc.) mask applied.
1040
- applyMask(t) {
1041
- if (t < 0 || t > 7)
754
+ applyMask(r) {
755
+ if (r < 0 || r > 7)
1042
756
  throw new RangeError("Mask value out of range");
1043
- for (let s = 0; s < this.size; s++)
1044
- for (let r = 0; r < this.size; r++) {
757
+ for (let n = 0; n < this.size; n++)
758
+ for (let a = 0; a < this.size; a++) {
1045
759
  let l;
1046
- switch (t) {
760
+ switch (r) {
1047
761
  case 0:
1048
- l = (r + s) % 2 == 0;
762
+ l = (a + n) % 2 == 0;
1049
763
  break;
1050
764
  case 1:
1051
- l = s % 2 == 0;
765
+ l = n % 2 == 0;
1052
766
  break;
1053
767
  case 2:
1054
- l = r % 3 == 0;
768
+ l = a % 3 == 0;
1055
769
  break;
1056
770
  case 3:
1057
- l = (r + s) % 3 == 0;
771
+ l = (a + n) % 3 == 0;
1058
772
  break;
1059
773
  case 4:
1060
- l = (Math.floor(r / 3) + Math.floor(s / 2)) % 2 == 0;
774
+ l = (Math.floor(a / 3) + Math.floor(n / 2)) % 2 == 0;
1061
775
  break;
1062
776
  case 5:
1063
- l = r * s % 2 + r * s % 3 == 0;
777
+ l = a * n % 2 + a * n % 3 == 0;
1064
778
  break;
1065
779
  case 6:
1066
- l = (r * s % 2 + r * s % 3) % 2 == 0;
780
+ l = (a * n % 2 + a * n % 3) % 2 == 0;
1067
781
  break;
1068
782
  case 7:
1069
- l = ((r + s) % 2 + r * s % 3) % 2 == 0;
783
+ l = ((a + n) % 2 + a * n % 3) % 2 == 0;
1070
784
  break;
1071
785
  default:
1072
786
  throw new Error("Unreachable");
1073
787
  }
1074
- !this.isFunction[s][r] && l && (this.modules[s][r] = !this.modules[s][r]);
788
+ !this.isFunction[n][a] && l && (this.modules[n][a] = !this.modules[n][a]);
1075
789
  }
1076
790
  }
1077
791
  // Calculates and returns the penalty score based on state of this QR Code's current modules.
1078
792
  // This is used by the automatic mask choice algorithm to find the mask pattern that yields the lowest score.
1079
793
  getPenaltyScore() {
1080
- let t = 0;
1081
- for (let c = 0; c < this.size; c++) {
1082
- let w = !1, u = 0, p = [0, 0, 0, 0, 0, 0, 0];
1083
- for (let v = 0; v < this.size; v++)
1084
- this.modules[c][v] == w ? (u++, u == 5 ? t += A.PENALTY_N1 : u > 5 && t++) : (this.finderPenaltyAddHistory(u, p), w || (t += this.finderPenaltyCountPatterns(p) * A.PENALTY_N3), w = this.modules[c][v], u = 1);
1085
- t += this.finderPenaltyTerminateAndCount(w, u, p) * A.PENALTY_N3;
794
+ let r = 0;
795
+ for (let d = 0; d < this.size; d++) {
796
+ let g = !1, h = 0, m = [0, 0, 0, 0, 0, 0, 0];
797
+ for (let f = 0; f < this.size; f++)
798
+ this.modules[d][f] == g ? (h++, h == 5 ? r += E.PENALTY_N1 : h > 5 && r++) : (this.finderPenaltyAddHistory(h, m), g || (r += this.finderPenaltyCountPatterns(m) * E.PENALTY_N3), g = this.modules[d][f], h = 1);
799
+ r += this.finderPenaltyTerminateAndCount(g, h, m) * E.PENALTY_N3;
1086
800
  }
1087
- for (let c = 0; c < this.size; c++) {
1088
- let w = !1, u = 0, p = [0, 0, 0, 0, 0, 0, 0];
1089
- for (let v = 0; v < this.size; v++)
1090
- this.modules[v][c] == w ? (u++, u == 5 ? t += A.PENALTY_N1 : u > 5 && t++) : (this.finderPenaltyAddHistory(u, p), w || (t += this.finderPenaltyCountPatterns(p) * A.PENALTY_N3), w = this.modules[v][c], u = 1);
1091
- t += this.finderPenaltyTerminateAndCount(w, u, p) * A.PENALTY_N3;
801
+ for (let d = 0; d < this.size; d++) {
802
+ let g = !1, h = 0, m = [0, 0, 0, 0, 0, 0, 0];
803
+ for (let f = 0; f < this.size; f++)
804
+ this.modules[f][d] == g ? (h++, h == 5 ? r += E.PENALTY_N1 : h > 5 && r++) : (this.finderPenaltyAddHistory(h, m), g || (r += this.finderPenaltyCountPatterns(m) * E.PENALTY_N3), g = this.modules[f][d], h = 1);
805
+ r += this.finderPenaltyTerminateAndCount(g, h, m) * E.PENALTY_N3;
1092
806
  }
1093
- for (let c = 0; c < this.size - 1; c++)
1094
- for (let w = 0; w < this.size - 1; w++) {
1095
- const u = this.modules[c][w];
1096
- u == this.modules[c][w + 1] && u == this.modules[c + 1][w] && u == this.modules[c + 1][w + 1] && (t += A.PENALTY_N2);
807
+ for (let d = 0; d < this.size - 1; d++)
808
+ for (let g = 0; g < this.size - 1; g++) {
809
+ const h = this.modules[d][g];
810
+ h == this.modules[d][g + 1] && h == this.modules[d + 1][g] && h == this.modules[d + 1][g + 1] && (r += E.PENALTY_N2);
1097
811
  }
1098
- let s = 0;
1099
- for (const c of this.modules)
1100
- s = c.reduce((w, u) => w + (u ? 1 : 0), s);
1101
- const r = this.size * this.size, l = Math.ceil(Math.abs(s * 20 - r * 10) / r) - 1;
1102
- return h(0 <= l && l <= 9), t += l * A.PENALTY_N4, h(0 <= t && t <= 2568888), t;
812
+ let n = 0;
813
+ for (const d of this.modules)
814
+ n = d.reduce((g, h) => g + (h ? 1 : 0), n);
815
+ const a = this.size * this.size, l = Math.ceil(Math.abs(n * 20 - a * 10) / a) - 1;
816
+ return c(0 <= l && l <= 9), r += l * E.PENALTY_N4, c(0 <= r && r <= 2568888), r;
1103
817
  }
1104
818
  /*-- Private helper functions --*/
1105
819
  // Returns an ascending list of positions of alignment patterns for this version number.
@@ -1109,86 +823,86 @@ var he;
1109
823
  if (this.version == 1)
1110
824
  return [];
1111
825
  {
1112
- const t = Math.floor(this.version / 7) + 2, s = this.version == 32 ? 26 : Math.ceil((this.version * 4 + 4) / (t * 2 - 2)) * 2;
1113
- let r = [6];
1114
- for (let l = this.size - 7; r.length < t; l -= s)
1115
- r.splice(1, 0, l);
1116
- return r;
826
+ const r = Math.floor(this.version / 7) + 2, n = this.version == 32 ? 26 : Math.ceil((this.version * 4 + 4) / (r * 2 - 2)) * 2;
827
+ let a = [6];
828
+ for (let l = this.size - 7; a.length < r; l -= n)
829
+ a.splice(1, 0, l);
830
+ return a;
1117
831
  }
1118
832
  }
1119
833
  // Returns the number of data bits that can be stored in a QR Code of the given version number, after
1120
834
  // all function modules are excluded. This includes remainder bits, so it might not be a multiple of 8.
1121
835
  // The result is in the range [208, 29648]. This could be implemented as a 40-entry lookup table.
1122
- static getNumRawDataModules(t) {
1123
- if (t < A.MIN_VERSION || t > A.MAX_VERSION)
836
+ static getNumRawDataModules(r) {
837
+ if (r < E.MIN_VERSION || r > E.MAX_VERSION)
1124
838
  throw new RangeError("Version number out of range");
1125
- let s = (16 * t + 128) * t + 64;
1126
- if (t >= 2) {
1127
- const r = Math.floor(t / 7) + 2;
1128
- s -= (25 * r - 10) * r - 55, t >= 7 && (s -= 36);
839
+ let n = (16 * r + 128) * r + 64;
840
+ if (r >= 2) {
841
+ const a = Math.floor(r / 7) + 2;
842
+ n -= (25 * a - 10) * a - 55, r >= 7 && (n -= 36);
1129
843
  }
1130
- return h(208 <= s && s <= 29648), s;
844
+ return c(208 <= n && n <= 29648), n;
1131
845
  }
1132
846
  // Returns the number of 8-bit data (i.e. not error correction) codewords contained in any
1133
847
  // QR Code of the given version number and error correction level, with remainder bits discarded.
1134
848
  // This stateless pure function could be implemented as a (40*4)-cell lookup table.
1135
- static getNumDataCodewords(t, s) {
1136
- return Math.floor(A.getNumRawDataModules(t) / 8) - A.ECC_CODEWORDS_PER_BLOCK[s.ordinal][t] * A.NUM_ERROR_CORRECTION_BLOCKS[s.ordinal][t];
849
+ static getNumDataCodewords(r, n) {
850
+ return Math.floor(E.getNumRawDataModules(r) / 8) - E.ECC_CODEWORDS_PER_BLOCK[n.ordinal][r] * E.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][r];
1137
851
  }
1138
852
  // Returns a Reed-Solomon ECC generator polynomial for the given degree. This could be
1139
853
  // implemented as a lookup table over all possible parameter values, instead of as an algorithm.
1140
- static reedSolomonComputeDivisor(t) {
1141
- if (t < 1 || t > 255)
854
+ static reedSolomonComputeDivisor(r) {
855
+ if (r < 1 || r > 255)
1142
856
  throw new RangeError("Degree out of range");
1143
- let s = [];
1144
- for (let l = 0; l < t - 1; l++)
1145
- s.push(0);
1146
- s.push(1);
1147
- let r = 1;
1148
- for (let l = 0; l < t; l++) {
1149
- for (let c = 0; c < s.length; c++)
1150
- s[c] = A.reedSolomonMultiply(s[c], r), c + 1 < s.length && (s[c] ^= s[c + 1]);
1151
- r = A.reedSolomonMultiply(r, 2);
857
+ let n = [];
858
+ for (let l = 0; l < r - 1; l++)
859
+ n.push(0);
860
+ n.push(1);
861
+ let a = 1;
862
+ for (let l = 0; l < r; l++) {
863
+ for (let d = 0; d < n.length; d++)
864
+ n[d] = E.reedSolomonMultiply(n[d], a), d + 1 < n.length && (n[d] ^= n[d + 1]);
865
+ a = E.reedSolomonMultiply(a, 2);
1152
866
  }
1153
- return s;
867
+ return n;
1154
868
  }
1155
869
  // Returns the Reed-Solomon error correction codeword for the given data and divisor polynomials.
1156
- static reedSolomonComputeRemainder(t, s) {
1157
- let r = s.map((l) => 0);
1158
- for (const l of t) {
1159
- const c = l ^ r.shift();
1160
- r.push(0), s.forEach((w, u) => r[u] ^= A.reedSolomonMultiply(w, c));
870
+ static reedSolomonComputeRemainder(r, n) {
871
+ let a = n.map((l) => 0);
872
+ for (const l of r) {
873
+ const d = l ^ a.shift();
874
+ a.push(0), n.forEach((g, h) => a[h] ^= E.reedSolomonMultiply(g, d));
1161
875
  }
1162
- return r;
876
+ return a;
1163
877
  }
1164
878
  // Returns the product of the two given field elements modulo GF(2^8/0x11D). The arguments and result
1165
879
  // are unsigned 8-bit integers. This could be implemented as a lookup table of 256*256 entries of uint8.
1166
- static reedSolomonMultiply(t, s) {
1167
- if (t >>> 8 || s >>> 8)
880
+ static reedSolomonMultiply(r, n) {
881
+ if (r >>> 8 || n >>> 8)
1168
882
  throw new RangeError("Byte out of range");
1169
- let r = 0;
883
+ let a = 0;
1170
884
  for (let l = 7; l >= 0; l--)
1171
- r = r << 1 ^ (r >>> 7) * 285, r ^= (s >>> l & 1) * t;
1172
- return h(r >>> 8 == 0), r;
885
+ a = a << 1 ^ (a >>> 7) * 285, a ^= (n >>> l & 1) * r;
886
+ return c(a >>> 8 == 0), a;
1173
887
  }
1174
888
  // Can only be called immediately after a light run is added, and
1175
889
  // returns either 0, 1, or 2. A helper function for getPenaltyScore().
1176
- finderPenaltyCountPatterns(t) {
1177
- const s = t[1];
1178
- h(s <= this.size * 3);
1179
- const r = s > 0 && t[2] == s && t[3] == s * 3 && t[4] == s && t[5] == s;
1180
- return (r && t[0] >= s * 4 && t[6] >= s ? 1 : 0) + (r && t[6] >= s * 4 && t[0] >= s ? 1 : 0);
890
+ finderPenaltyCountPatterns(r) {
891
+ const n = r[1];
892
+ c(n <= this.size * 3);
893
+ const a = n > 0 && r[2] == n && r[3] == n * 3 && r[4] == n && r[5] == n;
894
+ return (a && r[0] >= n * 4 && r[6] >= n ? 1 : 0) + (a && r[6] >= n * 4 && r[0] >= n ? 1 : 0);
1181
895
  }
1182
896
  // Must be called at the end of a line (row or column) of modules. A helper function for getPenaltyScore().
1183
- finderPenaltyTerminateAndCount(t, s, r) {
1184
- return t && (this.finderPenaltyAddHistory(s, r), s = 0), s += this.size, this.finderPenaltyAddHistory(s, r), this.finderPenaltyCountPatterns(r);
897
+ finderPenaltyTerminateAndCount(r, n, a) {
898
+ return r && (this.finderPenaltyAddHistory(n, a), n = 0), n += this.size, this.finderPenaltyAddHistory(n, a), this.finderPenaltyCountPatterns(a);
1185
899
  }
1186
900
  // Pushes the given value to the front and drops the last value. A helper function for getPenaltyScore().
1187
- finderPenaltyAddHistory(t, s) {
1188
- s[0] == 0 && (t += this.size), s.pop(), s.unshift(t);
901
+ finderPenaltyAddHistory(r, n) {
902
+ n[0] == 0 && (r += this.size), n.pop(), n.unshift(r);
1189
903
  }
1190
904
  };
1191
- a.MIN_VERSION = 1, a.MAX_VERSION = 40, a.PENALTY_N1 = 3, a.PENALTY_N2 = 3, a.PENALTY_N3 = 40, a.PENALTY_N4 = 10, a.ECC_CODEWORDS_PER_BLOCK = [
905
+ t.MIN_VERSION = 1, t.MAX_VERSION = 40, t.PENALTY_N1 = 3, t.PENALTY_N2 = 3, t.PENALTY_N3 = 40, t.PENALTY_N4 = 10, t.ECC_CODEWORDS_PER_BLOCK = [
1192
906
  // Version: (note that index 0 is for padding, and is set to an illegal value)
1193
907
  //0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 Error correction level
1194
908
  [-1, 7, 10, 15, 20, 26, 18, 20, 24, 30, 18, 20, 24, 26, 30, 22, 24, 28, 30, 28, 28, 28, 28, 30, 30, 26, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30],
@@ -1199,7 +913,7 @@ var he;
1199
913
  // Quartile
1200
914
  [-1, 17, 28, 22, 16, 22, 28, 26, 26, 24, 28, 24, 28, 22, 24, 24, 30, 28, 28, 26, 28, 30, 24, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30]
1201
915
  // High
1202
- ], a.NUM_ERROR_CORRECTION_BLOCKS = [
916
+ ], t.NUM_ERROR_CORRECTION_BLOCKS = [
1203
917
  // Version: (note that index 0 is for padding, and is set to an illegal value)
1204
918
  //0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 Error correction level
1205
919
  [-1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 4, 4, 4, 4, 6, 6, 6, 6, 7, 8, 8, 9, 9, 10, 12, 12, 12, 13, 14, 15, 16, 17, 18, 19, 19, 20, 21, 22, 24, 25],
@@ -1210,95 +924,95 @@ var he;
1210
924
  // Quartile
1211
925
  [-1, 1, 1, 2, 4, 4, 4, 5, 6, 8, 8, 11, 11, 16, 16, 18, 16, 19, 21, 25, 25, 25, 34, 30, 32, 35, 37, 40, 42, 45, 48, 51, 54, 57, 60, 63, 66, 70, 74, 77, 81]
1212
926
  // High
1213
- ], o.QrCode = a;
1214
- function n(y, t, s) {
1215
- if (t < 0 || t > 31 || y >>> t)
927
+ ], s.QrCode = t;
928
+ function e(x, r, n) {
929
+ if (r < 0 || r > 31 || x >>> r)
1216
930
  throw new RangeError("Value out of range");
1217
- for (let r = t - 1; r >= 0; r--)
1218
- s.push(y >>> r & 1);
931
+ for (let a = r - 1; a >= 0; a--)
932
+ n.push(x >>> a & 1);
1219
933
  }
1220
- function d(y, t) {
1221
- return (y >>> t & 1) != 0;
934
+ function i(x, r) {
935
+ return (x >>> r & 1) != 0;
1222
936
  }
1223
- function h(y) {
1224
- if (!y)
937
+ function c(x) {
938
+ if (!x)
1225
939
  throw new Error("Assertion error");
1226
940
  }
1227
- const m = class U {
941
+ const u = class j {
1228
942
  /*-- Constructor (low level) and fields --*/
1229
943
  // Creates a new QR Code segment with the given attributes and data.
1230
944
  // The character count (numChars) must agree with the mode and the bit buffer length,
1231
945
  // but the constraint isn't checked. The given bit buffer is cloned and stored.
1232
- constructor(t, s, r) {
1233
- if (this.mode = t, this.numChars = s, this.bitData = r, s < 0)
946
+ constructor(r, n, a) {
947
+ if (this.mode = r, this.numChars = n, this.bitData = a, n < 0)
1234
948
  throw new RangeError("Invalid argument");
1235
- this.bitData = r.slice();
949
+ this.bitData = a.slice();
1236
950
  }
1237
951
  /*-- Static factory functions (mid level) --*/
1238
952
  // Returns a segment representing the given binary data encoded in
1239
953
  // byte mode. All input byte arrays are acceptable. Any text string
1240
954
  // can be converted to UTF-8 bytes and encoded as a byte mode segment.
1241
- static makeBytes(t) {
1242
- let s = [];
1243
- for (const r of t)
1244
- n(r, 8, s);
1245
- return new U(U.Mode.BYTE, t.length, s);
955
+ static makeBytes(r) {
956
+ let n = [];
957
+ for (const a of r)
958
+ e(a, 8, n);
959
+ return new j(j.Mode.BYTE, r.length, n);
1246
960
  }
1247
961
  // Returns a segment representing the given string of decimal digits encoded in numeric mode.
1248
- static makeNumeric(t) {
1249
- if (!U.isNumeric(t))
962
+ static makeNumeric(r) {
963
+ if (!j.isNumeric(r))
1250
964
  throw new RangeError("String contains non-numeric characters");
1251
- let s = [];
1252
- for (let r = 0; r < t.length; ) {
1253
- const l = Math.min(t.length - r, 3);
1254
- n(parseInt(t.substring(r, r + l), 10), l * 3 + 1, s), r += l;
965
+ let n = [];
966
+ for (let a = 0; a < r.length; ) {
967
+ const l = Math.min(r.length - a, 3);
968
+ e(parseInt(r.substring(a, a + l), 10), l * 3 + 1, n), a += l;
1255
969
  }
1256
- return new U(U.Mode.NUMERIC, t.length, s);
970
+ return new j(j.Mode.NUMERIC, r.length, n);
1257
971
  }
1258
972
  // Returns a segment representing the given text string encoded in alphanumeric mode.
1259
973
  // The characters allowed are: 0 to 9, A to Z (uppercase only), space,
1260
974
  // dollar, percent, asterisk, plus, hyphen, period, slash, colon.
1261
- static makeAlphanumeric(t) {
1262
- if (!U.isAlphanumeric(t))
975
+ static makeAlphanumeric(r) {
976
+ if (!j.isAlphanumeric(r))
1263
977
  throw new RangeError("String contains unencodable characters in alphanumeric mode");
1264
- let s = [], r;
1265
- for (r = 0; r + 2 <= t.length; r += 2) {
1266
- let l = U.ALPHANUMERIC_CHARSET.indexOf(t.charAt(r)) * 45;
1267
- l += U.ALPHANUMERIC_CHARSET.indexOf(t.charAt(r + 1)), n(l, 11, s);
978
+ let n = [], a;
979
+ for (a = 0; a + 2 <= r.length; a += 2) {
980
+ let l = j.ALPHANUMERIC_CHARSET.indexOf(r.charAt(a)) * 45;
981
+ l += j.ALPHANUMERIC_CHARSET.indexOf(r.charAt(a + 1)), e(l, 11, n);
1268
982
  }
1269
- return r < t.length && n(U.ALPHANUMERIC_CHARSET.indexOf(t.charAt(r)), 6, s), new U(U.Mode.ALPHANUMERIC, t.length, s);
983
+ return a < r.length && e(j.ALPHANUMERIC_CHARSET.indexOf(r.charAt(a)), 6, n), new j(j.Mode.ALPHANUMERIC, r.length, n);
1270
984
  }
1271
985
  // Returns a new mutable list of zero or more segments to represent the given Unicode text string.
1272
986
  // The result may use various segment modes and switch modes to optimize the length of the bit stream.
1273
- static makeSegments(t) {
1274
- return t == "" ? [] : U.isNumeric(t) ? [U.makeNumeric(t)] : U.isAlphanumeric(t) ? [U.makeAlphanumeric(t)] : [U.makeBytes(U.toUtf8ByteArray(t))];
987
+ static makeSegments(r) {
988
+ return r == "" ? [] : j.isNumeric(r) ? [j.makeNumeric(r)] : j.isAlphanumeric(r) ? [j.makeAlphanumeric(r)] : [j.makeBytes(j.toUtf8ByteArray(r))];
1275
989
  }
1276
990
  // Returns a segment representing an Extended Channel Interpretation
1277
991
  // (ECI) designator with the given assignment value.
1278
- static makeEci(t) {
1279
- let s = [];
1280
- if (t < 0)
992
+ static makeEci(r) {
993
+ let n = [];
994
+ if (r < 0)
1281
995
  throw new RangeError("ECI assignment value out of range");
1282
- if (t < 128)
1283
- n(t, 8, s);
1284
- else if (t < 16384)
1285
- n(2, 2, s), n(t, 14, s);
1286
- else if (t < 1e6)
1287
- n(6, 3, s), n(t, 21, s);
996
+ if (r < 128)
997
+ e(r, 8, n);
998
+ else if (r < 16384)
999
+ e(2, 2, n), e(r, 14, n);
1000
+ else if (r < 1e6)
1001
+ e(6, 3, n), e(r, 21, n);
1288
1002
  else
1289
1003
  throw new RangeError("ECI assignment value out of range");
1290
- return new U(U.Mode.ECI, 0, s);
1004
+ return new j(j.Mode.ECI, 0, n);
1291
1005
  }
1292
1006
  // Tests whether the given string can be encoded as a segment in numeric mode.
1293
1007
  // A string is encodable iff each character is in the range 0 to 9.
1294
- static isNumeric(t) {
1295
- return U.NUMERIC_REGEX.test(t);
1008
+ static isNumeric(r) {
1009
+ return j.NUMERIC_REGEX.test(r);
1296
1010
  }
1297
1011
  // Tests whether the given string can be encoded as a segment in alphanumeric mode.
1298
1012
  // A string is encodable iff each character is in the following set: 0 to 9, A to Z
1299
1013
  // (uppercase only), space, dollar, percent, asterisk, plus, hyphen, period, slash, colon.
1300
- static isAlphanumeric(t) {
1301
- return U.ALPHANUMERIC_REGEX.test(t);
1014
+ static isAlphanumeric(r) {
1015
+ return j.ALPHANUMERIC_REGEX.test(r);
1302
1016
  }
1303
1017
  /*-- Methods --*/
1304
1018
  // Returns a new copy of the data bits of this segment.
@@ -1307,176 +1021,176 @@ var he;
1307
1021
  }
1308
1022
  // (Package-private) Calculates and returns the number of bits needed to encode the given segments at
1309
1023
  // the given version. The result is infinity if a segment has too many characters to fit its length field.
1310
- static getTotalBits(t, s) {
1311
- let r = 0;
1312
- for (const l of t) {
1313
- const c = l.mode.numCharCountBits(s);
1314
- if (l.numChars >= 1 << c)
1024
+ static getTotalBits(r, n) {
1025
+ let a = 0;
1026
+ for (const l of r) {
1027
+ const d = l.mode.numCharCountBits(n);
1028
+ if (l.numChars >= 1 << d)
1315
1029
  return 1 / 0;
1316
- r += 4 + c + l.bitData.length;
1030
+ a += 4 + d + l.bitData.length;
1317
1031
  }
1318
- return r;
1032
+ return a;
1319
1033
  }
1320
1034
  // Returns a new array of bytes representing the given string encoded in UTF-8.
1321
- static toUtf8ByteArray(t) {
1322
- t = encodeURI(t);
1323
- let s = [];
1324
- for (let r = 0; r < t.length; r++)
1325
- t.charAt(r) != "%" ? s.push(t.charCodeAt(r)) : (s.push(parseInt(t.substring(r + 1, r + 3), 16)), r += 2);
1326
- return s;
1035
+ static toUtf8ByteArray(r) {
1036
+ r = encodeURI(r);
1037
+ let n = [];
1038
+ for (let a = 0; a < r.length; a++)
1039
+ r.charAt(a) != "%" ? n.push(r.charCodeAt(a)) : (n.push(parseInt(r.substring(a + 1, a + 3), 16)), a += 2);
1040
+ return n;
1327
1041
  }
1328
1042
  };
1329
- m.NUMERIC_REGEX = /^[0-9]*$/, m.ALPHANUMERIC_REGEX = /^[A-Z0-9 $%*+.\/:-]*$/, m.ALPHANUMERIC_CHARSET = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";
1330
- let b = m;
1331
- o.QrSegment = m;
1332
- })(he || (he = {}));
1333
- ((o) => {
1334
- ((a) => {
1335
- const n = class {
1043
+ u.NUMERIC_REGEX = /^[0-9]*$/, u.ALPHANUMERIC_REGEX = /^[A-Z0-9 $%*+.\/:-]*$/, u.ALPHANUMERIC_CHARSET = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";
1044
+ let y = u;
1045
+ s.QrSegment = u;
1046
+ })(K || (K = {}));
1047
+ ((s) => {
1048
+ ((t) => {
1049
+ const e = class {
1336
1050
  // The QR Code can tolerate about 30% erroneous codewords
1337
1051
  /*-- Constructor and fields --*/
1338
- constructor(h, m) {
1339
- this.ordinal = h, this.formatBits = m;
1052
+ constructor(c, u) {
1053
+ this.ordinal = c, this.formatBits = u;
1340
1054
  }
1341
1055
  };
1342
- n.LOW = new n(0, 1), n.MEDIUM = new n(1, 0), n.QUARTILE = new n(2, 3), n.HIGH = new n(3, 2), a.Ecc = n;
1343
- })(o.QrCode || (o.QrCode = {}));
1344
- })(he || (he = {}));
1345
- ((o) => {
1346
- ((a) => {
1347
- const n = class {
1056
+ e.LOW = new e(0, 1), e.MEDIUM = new e(1, 0), e.QUARTILE = new e(2, 3), e.HIGH = new e(3, 2), t.Ecc = e;
1057
+ })(s.QrCode || (s.QrCode = {}));
1058
+ })(K || (K = {}));
1059
+ ((s) => {
1060
+ ((t) => {
1061
+ const e = class {
1348
1062
  /*-- Constructor and fields --*/
1349
- constructor(h, m) {
1350
- this.modeBits = h, this.numBitsCharCount = m;
1063
+ constructor(c, u) {
1064
+ this.modeBits = c, this.numBitsCharCount = u;
1351
1065
  }
1352
1066
  /*-- Method --*/
1353
1067
  // (Package-private) Returns the bit width of the character count field for a segment in
1354
1068
  // this mode in a QR Code at the given version number. The result is in the range [0, 16].
1355
- numCharCountBits(h) {
1356
- return this.numBitsCharCount[Math.floor((h + 7) / 17)];
1069
+ numCharCountBits(c) {
1070
+ return this.numBitsCharCount[Math.floor((c + 7) / 17)];
1357
1071
  }
1358
1072
  };
1359
- n.NUMERIC = new n(1, [10, 12, 14]), n.ALPHANUMERIC = new n(2, [9, 11, 13]), n.BYTE = new n(4, [8, 16, 16]), n.KANJI = new n(8, [8, 10, 12]), n.ECI = new n(7, [0, 0, 0]), a.Mode = n;
1360
- })(o.QrSegment || (o.QrSegment = {}));
1361
- })(he || (he = {}));
1362
- var be = he;
1073
+ e.NUMERIC = new e(1, [10, 12, 14]), e.ALPHANUMERIC = new e(2, [9, 11, 13]), e.BYTE = new e(4, [8, 16, 16]), e.KANJI = new e(8, [8, 10, 12]), e.ECI = new e(7, [0, 0, 0]), t.Mode = e;
1074
+ })(s.QrSegment || (s.QrSegment = {}));
1075
+ })(K || (K = {}));
1076
+ var J = K;
1363
1077
  /**
1364
1078
  * @license qrcode.react
1365
1079
  * Copyright (c) Paul O'Shannessy
1366
1080
  * SPDX-License-Identifier: ISC
1367
1081
  */
1368
- var mr = {
1369
- L: be.QrCode.Ecc.LOW,
1370
- M: be.QrCode.Ecc.MEDIUM,
1371
- Q: be.QrCode.Ecc.QUARTILE,
1372
- H: be.QrCode.Ecc.HIGH
1373
- }, yt = 128, vt = "L", xt = "#FFFFFF", Et = "#000000", bt = !1, Nt = 1, gr = 4, pr = 0, wr = 0.1;
1374
- function Rt(o, a = 0) {
1375
- const n = [];
1376
- return o.forEach(function(d, h) {
1377
- let m = null;
1378
- d.forEach(function(b, y) {
1379
- if (!b && m !== null) {
1380
- n.push(
1381
- `M${m + a} ${h + a}h${y - m}v1H${m + a}z`
1382
- ), m = null;
1082
+ var Et = {
1083
+ L: J.QrCode.Ecc.LOW,
1084
+ M: J.QrCode.Ecc.MEDIUM,
1085
+ Q: J.QrCode.Ecc.QUARTILE,
1086
+ H: J.QrCode.Ecc.HIGH
1087
+ }, Ce = 128, je = "L", Me = "#FFFFFF", Re = "#000000", Se = !1, Le = 1, vt = 4, kt = 0, Tt = 0.1;
1088
+ function Pe(s, t = 0) {
1089
+ const e = [];
1090
+ return s.forEach(function(i, c) {
1091
+ let u = null;
1092
+ i.forEach(function(y, x) {
1093
+ if (!y && u !== null) {
1094
+ e.push(
1095
+ `M${u + t} ${c + t}h${x - u}v1H${u + t}z`
1096
+ ), u = null;
1383
1097
  return;
1384
1098
  }
1385
- if (y === d.length - 1) {
1386
- if (!b)
1099
+ if (x === i.length - 1) {
1100
+ if (!y)
1387
1101
  return;
1388
- m === null ? n.push(`M${y + a},${h + a} h1v1H${y + a}z`) : n.push(
1389
- `M${m + a},${h + a} h${y + 1 - m}v1H${m + a}z`
1102
+ u === null ? e.push(`M${x + t},${c + t} h1v1H${x + t}z`) : e.push(
1103
+ `M${u + t},${c + t} h${x + 1 - u}v1H${u + t}z`
1390
1104
  );
1391
1105
  return;
1392
1106
  }
1393
- b && m === null && (m = y);
1107
+ y && u === null && (u = x);
1394
1108
  });
1395
- }), n.join("");
1109
+ }), e.join("");
1396
1110
  }
1397
- function Tt(o, a) {
1398
- return o.slice().map((n, d) => d < a.y || d >= a.y + a.h ? n : n.map((h, m) => m < a.x || m >= a.x + a.w ? h : !1));
1111
+ function De(s, t) {
1112
+ return s.slice().map((e, i) => i < t.y || i >= t.y + t.h ? e : e.map((c, u) => u < t.x || u >= t.x + t.w ? c : !1));
1399
1113
  }
1400
- function yr(o, a, n, d) {
1401
- if (d == null)
1114
+ function At(s, t, e, i) {
1115
+ if (i == null)
1402
1116
  return null;
1403
- const h = o.length + n * 2, m = Math.floor(a * wr), b = h / a, y = (d.width || m) * b, t = (d.height || m) * b, s = d.x == null ? o.length / 2 - y / 2 : d.x * b, r = d.y == null ? o.length / 2 - t / 2 : d.y * b, l = d.opacity == null ? 1 : d.opacity;
1404
- let c = null;
1405
- if (d.excavate) {
1406
- let u = Math.floor(s), p = Math.floor(r), v = Math.ceil(y + s - u), T = Math.ceil(t + r - p);
1407
- c = { x: u, y: p, w: v, h: T };
1117
+ const c = s.length + e * 2, u = Math.floor(t * Tt), y = c / t, x = (i.width || u) * y, r = (i.height || u) * y, n = i.x == null ? s.length / 2 - x / 2 : i.x * y, a = i.y == null ? s.length / 2 - r / 2 : i.y * y, l = i.opacity == null ? 1 : i.opacity;
1118
+ let d = null;
1119
+ if (i.excavate) {
1120
+ let h = Math.floor(n), m = Math.floor(a), f = Math.ceil(x + n - h), k = Math.ceil(r + a - m);
1121
+ d = { x: h, y: m, w: f, h: k };
1408
1122
  }
1409
- const w = d.crossOrigin;
1410
- return { x: s, y: r, h: t, w: y, excavation: c, opacity: l, crossOrigin: w };
1123
+ const g = i.crossOrigin;
1124
+ return { x: n, y: a, h: r, w: x, excavation: d, opacity: l, crossOrigin: g };
1411
1125
  }
1412
- function vr(o, a) {
1413
- return a != null ? Math.max(Math.floor(a), 0) : o ? gr : pr;
1126
+ function Ct(s, t) {
1127
+ return t != null ? Math.max(Math.floor(t), 0) : s ? vt : kt;
1414
1128
  }
1415
- function Ct({
1416
- value: o,
1417
- level: a,
1418
- minVersion: n,
1419
- includeMargin: d,
1420
- marginSize: h,
1421
- imageSettings: m,
1422
- size: b,
1423
- boostLevel: y
1129
+ function Ue({
1130
+ value: s,
1131
+ level: t,
1132
+ minVersion: e,
1133
+ includeMargin: i,
1134
+ marginSize: c,
1135
+ imageSettings: u,
1136
+ size: y,
1137
+ boostLevel: x
1424
1138
  }) {
1425
- let t = B.useMemo(() => {
1426
- const u = (Array.isArray(o) ? o : [o]).reduce((p, v) => (p.push(...be.QrSegment.makeSegments(v)), p), []);
1427
- return be.QrCode.encodeSegments(
1428
- u,
1429
- mr[a],
1430
- n,
1139
+ let r = L.useMemo(() => {
1140
+ const h = (Array.isArray(s) ? s : [s]).reduce((m, f) => (m.push(...J.QrSegment.makeSegments(f)), m), []);
1141
+ return J.QrCode.encodeSegments(
1142
+ h,
1143
+ Et[t],
1144
+ e,
1431
1145
  void 0,
1432
1146
  void 0,
1433
- y
1147
+ x
1434
1148
  );
1435
- }, [o, a, n, y]);
1436
- const { cells: s, margin: r, numCells: l, calculatedImageSettings: c } = B.useMemo(() => {
1437
- let w = t.getModules();
1438
- const u = vr(d, h), p = w.length + u * 2, v = yr(
1439
- w,
1440
- b,
1441
- u,
1442
- m
1149
+ }, [s, t, e, x]);
1150
+ const { cells: n, margin: a, numCells: l, calculatedImageSettings: d } = L.useMemo(() => {
1151
+ let g = r.getModules();
1152
+ const h = Ct(i, c), m = g.length + h * 2, f = At(
1153
+ g,
1154
+ y,
1155
+ h,
1156
+ u
1443
1157
  );
1444
1158
  return {
1445
- cells: w,
1446
- margin: u,
1447
- numCells: p,
1448
- calculatedImageSettings: v
1159
+ cells: g,
1160
+ margin: h,
1161
+ numCells: m,
1162
+ calculatedImageSettings: f
1449
1163
  };
1450
- }, [t, b, m, d, h]);
1164
+ }, [r, y, u, i, c]);
1451
1165
  return {
1452
- qrcode: t,
1453
- margin: r,
1454
- cells: s,
1166
+ qrcode: r,
1167
+ margin: a,
1168
+ cells: n,
1455
1169
  numCells: l,
1456
- calculatedImageSettings: c
1170
+ calculatedImageSettings: d
1457
1171
  };
1458
1172
  }
1459
- var xr = function() {
1173
+ var jt = function() {
1460
1174
  try {
1461
1175
  new Path2D().addPath(new Path2D());
1462
- } catch (o) {
1176
+ } catch (s) {
1463
1177
  return !1;
1464
1178
  }
1465
1179
  return !0;
1466
- }(), Er = B.forwardRef(
1467
- function(a, n) {
1468
- const d = a, {
1469
- value: h,
1470
- size: m = yt,
1471
- level: b = vt,
1472
- bgColor: y = xt,
1473
- fgColor: t = Et,
1474
- includeMargin: s = bt,
1475
- minVersion: r = Nt,
1180
+ }(), Mt = L.forwardRef(
1181
+ function(t, e) {
1182
+ const i = t, {
1183
+ value: c,
1184
+ size: u = Ce,
1185
+ level: y = je,
1186
+ bgColor: x = Me,
1187
+ fgColor: r = Re,
1188
+ includeMargin: n = Se,
1189
+ minVersion: a = Le,
1476
1190
  boostLevel: l,
1477
- marginSize: c,
1478
- imageSettings: w
1479
- } = d, p = Qe(d, [
1191
+ marginSize: d,
1192
+ imageSettings: g
1193
+ } = i, m = ce(i, [
1480
1194
  "value",
1481
1195
  "size",
1482
1196
  "level",
@@ -1487,92 +1201,92 @@ var xr = function() {
1487
1201
  "boostLevel",
1488
1202
  "marginSize",
1489
1203
  "imageSettings"
1490
- ]), { style: v } = p, T = Qe(p, ["style"]), N = w == null ? void 0 : w.src, x = B.useRef(null), D = B.useRef(null), I = B.useCallback(
1491
- (Q) => {
1492
- x.current = Q, typeof n == "function" ? n(Q) : n && (n.current = Q);
1204
+ ]), { style: f } = m, k = ce(m, ["style"]), w = g == null ? void 0 : g.src, p = L.useRef(null), T = L.useRef(null), C = L.useCallback(
1205
+ (W) => {
1206
+ p.current = W, typeof e == "function" ? e(W) : e && (e.current = W);
1493
1207
  },
1494
- [n]
1495
- ), [Z, ae] = B.useState(!1), { margin: R, cells: P, numCells: oe, calculatedImageSettings: K } = Ct({
1496
- value: h,
1497
- level: b,
1498
- minVersion: r,
1208
+ [e]
1209
+ ), [q, H] = L.useState(!1), { margin: O, cells: M, numCells: v, calculatedImageSettings: S } = Ue({
1210
+ value: c,
1211
+ level: y,
1212
+ minVersion: a,
1499
1213
  boostLevel: l,
1500
- includeMargin: s,
1501
- marginSize: c,
1502
- imageSettings: w,
1503
- size: m
1214
+ includeMargin: n,
1215
+ marginSize: d,
1216
+ imageSettings: g,
1217
+ size: u
1504
1218
  });
1505
- B.useEffect(() => {
1506
- if (x.current != null) {
1507
- const Q = x.current, F = Q.getContext("2d");
1508
- if (!F)
1219
+ L.useEffect(() => {
1220
+ if (p.current != null) {
1221
+ const W = p.current, I = W.getContext("2d");
1222
+ if (!I)
1509
1223
  return;
1510
- let se = P;
1511
- const ne = D.current, ue = K != null && ne !== null && ne.complete && ne.naturalHeight !== 0 && ne.naturalWidth !== 0;
1512
- ue && K.excavation != null && (se = Tt(
1513
- P,
1514
- K.excavation
1224
+ let V = M;
1225
+ const $ = T.current, te = S != null && $ !== null && $.complete && $.naturalHeight !== 0 && $.naturalWidth !== 0;
1226
+ te && S.excavation != null && (V = De(
1227
+ M,
1228
+ S.excavation
1515
1229
  ));
1516
- const ie = window.devicePixelRatio || 1;
1517
- Q.height = Q.width = m * ie;
1518
- const ee = m / oe * ie;
1519
- F.scale(ee, ee), F.fillStyle = y, F.fillRect(0, 0, oe, oe), F.fillStyle = t, xr ? F.fill(new Path2D(Rt(se, R))) : P.forEach(function(me, de) {
1520
- me.forEach(function(ge, _) {
1521
- ge && F.fillRect(_ + R, de + R, 1, 1);
1230
+ const X = window.devicePixelRatio || 1;
1231
+ W.height = W.width = u * X;
1232
+ const G = u / v * X;
1233
+ I.scale(G, G), I.fillStyle = x, I.fillRect(0, 0, v, v), I.fillStyle = r, jt ? I.fill(new Path2D(Pe(V, O))) : M.forEach(function(oe, re) {
1234
+ oe.forEach(function(ae, P) {
1235
+ ae && I.fillRect(P + O, re + O, 1, 1);
1522
1236
  });
1523
- }), K && (F.globalAlpha = K.opacity), ue && F.drawImage(
1524
- ne,
1525
- K.x + R,
1526
- K.y + R,
1527
- K.w,
1528
- K.h
1237
+ }), S && (I.globalAlpha = S.opacity), te && I.drawImage(
1238
+ $,
1239
+ S.x + O,
1240
+ S.y + O,
1241
+ S.w,
1242
+ S.h
1529
1243
  );
1530
1244
  }
1531
- }), B.useEffect(() => {
1532
- ae(!1);
1533
- }, [N]);
1534
- const $ = ze({ height: m, width: m }, v);
1535
- let Y = null;
1536
- return N != null && (Y = /* @__PURE__ */ B.createElement(
1245
+ }), L.useEffect(() => {
1246
+ H(!1);
1247
+ }, [w]);
1248
+ const B = le({ height: u, width: u }, f);
1249
+ let ee = null;
1250
+ return w != null && (ee = /* @__PURE__ */ L.createElement(
1537
1251
  "img",
1538
1252
  {
1539
- src: N,
1540
- key: N,
1253
+ src: w,
1254
+ key: w,
1541
1255
  style: { display: "none" },
1542
1256
  onLoad: () => {
1543
- ae(!0);
1257
+ H(!0);
1544
1258
  },
1545
- ref: D,
1546
- crossOrigin: K == null ? void 0 : K.crossOrigin
1259
+ ref: T,
1260
+ crossOrigin: S == null ? void 0 : S.crossOrigin
1547
1261
  }
1548
- )), /* @__PURE__ */ B.createElement(B.Fragment, null, /* @__PURE__ */ B.createElement(
1262
+ )), /* @__PURE__ */ L.createElement(L.Fragment, null, /* @__PURE__ */ L.createElement(
1549
1263
  "canvas",
1550
- ze({
1551
- style: $,
1552
- height: m,
1553
- width: m,
1554
- ref: I,
1264
+ le({
1265
+ style: B,
1266
+ height: u,
1267
+ width: u,
1268
+ ref: C,
1555
1269
  role: "img"
1556
- }, T)
1557
- ), Y);
1270
+ }, k)
1271
+ ), ee);
1558
1272
  }
1559
1273
  );
1560
- Er.displayName = "QRCodeCanvas";
1561
- var At = B.forwardRef(
1562
- function(a, n) {
1563
- const d = a, {
1564
- value: h,
1565
- size: m = yt,
1566
- level: b = vt,
1567
- bgColor: y = xt,
1568
- fgColor: t = Et,
1569
- includeMargin: s = bt,
1570
- minVersion: r = Nt,
1274
+ Mt.displayName = "QRCodeCanvas";
1275
+ var Oe = L.forwardRef(
1276
+ function(t, e) {
1277
+ const i = t, {
1278
+ value: c,
1279
+ size: u = Ce,
1280
+ level: y = je,
1281
+ bgColor: x = Me,
1282
+ fgColor: r = Re,
1283
+ includeMargin: n = Se,
1284
+ minVersion: a = Le,
1571
1285
  boostLevel: l,
1572
- title: c,
1573
- marginSize: w,
1574
- imageSettings: u
1575
- } = d, p = Qe(d, [
1286
+ title: d,
1287
+ marginSize: g,
1288
+ imageSettings: h
1289
+ } = i, m = ce(i, [
1576
1290
  "value",
1577
1291
  "size",
1578
1292
  "level",
@@ -1584,126 +1298,230 @@ var At = B.forwardRef(
1584
1298
  "title",
1585
1299
  "marginSize",
1586
1300
  "imageSettings"
1587
- ]), { margin: v, cells: T, numCells: N, calculatedImageSettings: x } = Ct({
1588
- value: h,
1589
- level: b,
1590
- minVersion: r,
1301
+ ]), { margin: f, cells: k, numCells: w, calculatedImageSettings: p } = Ue({
1302
+ value: c,
1303
+ level: y,
1304
+ minVersion: a,
1591
1305
  boostLevel: l,
1592
- includeMargin: s,
1593
- marginSize: w,
1594
- imageSettings: u,
1595
- size: m
1306
+ includeMargin: n,
1307
+ marginSize: g,
1308
+ imageSettings: h,
1309
+ size: u
1596
1310
  });
1597
- let D = T, I = null;
1598
- u != null && x != null && (x.excavation != null && (D = Tt(
1599
- T,
1600
- x.excavation
1601
- )), I = /* @__PURE__ */ B.createElement(
1311
+ let T = k, C = null;
1312
+ h != null && p != null && (p.excavation != null && (T = De(
1313
+ k,
1314
+ p.excavation
1315
+ )), C = /* @__PURE__ */ L.createElement(
1602
1316
  "image",
1603
1317
  {
1604
- href: u.src,
1605
- height: x.h,
1606
- width: x.w,
1607
- x: x.x + v,
1608
- y: x.y + v,
1318
+ href: h.src,
1319
+ height: p.h,
1320
+ width: p.w,
1321
+ x: p.x + f,
1322
+ y: p.y + f,
1609
1323
  preserveAspectRatio: "none",
1610
- opacity: x.opacity,
1611
- crossOrigin: x.crossOrigin
1324
+ opacity: p.opacity,
1325
+ crossOrigin: p.crossOrigin
1612
1326
  }
1613
1327
  ));
1614
- const Z = Rt(D, v);
1615
- return /* @__PURE__ */ B.createElement(
1328
+ const q = Pe(T, f);
1329
+ return /* @__PURE__ */ L.createElement(
1616
1330
  "svg",
1617
- ze({
1618
- height: m,
1619
- width: m,
1620
- viewBox: `0 0 ${N} ${N}`,
1621
- ref: n,
1331
+ le({
1332
+ height: u,
1333
+ width: u,
1334
+ viewBox: `0 0 ${w} ${w}`,
1335
+ ref: e,
1622
1336
  role: "img"
1623
- }, p),
1624
- !!c && /* @__PURE__ */ B.createElement("title", null, c),
1625
- /* @__PURE__ */ B.createElement(
1337
+ }, m),
1338
+ !!d && /* @__PURE__ */ L.createElement("title", null, d),
1339
+ /* @__PURE__ */ L.createElement(
1626
1340
  "path",
1627
1341
  {
1628
- fill: y,
1629
- d: `M0,0 h${N}v${N}H0z`,
1342
+ fill: x,
1343
+ d: `M0,0 h${w}v${w}H0z`,
1630
1344
  shapeRendering: "crispEdges"
1631
1345
  }
1632
1346
  ),
1633
- /* @__PURE__ */ B.createElement("path", { fill: t, d: Z, shapeRendering: "crispEdges" }),
1634
- I
1347
+ /* @__PURE__ */ L.createElement("path", { fill: r, d: q, shapeRendering: "crispEdges" }),
1348
+ C
1635
1349
  );
1636
1350
  }
1637
1351
  );
1638
- At.displayName = "QRCodeSVG";
1639
- const Kr = ({
1640
- walletAddress: o,
1641
- amount: a,
1642
- currency: n,
1643
- theme: d = "light",
1644
- size: h = 200
1352
+ Oe.displayName = "QRCodeSVG";
1353
+ const Rt = ({
1354
+ walletAddress: s,
1355
+ amount: t,
1356
+ currency: e,
1357
+ network: i,
1358
+ theme: c = "light",
1359
+ size: u = 200
1645
1360
  }) => {
1646
- const [m, b] = H(""), [y, t] = H(null);
1647
- je(() => {
1648
- if (!o) {
1649
- t("No wallet address provided");
1361
+ const [y, x] = D(""), [r, n] = D(null);
1362
+ Z(() => {
1363
+ if (!s || s === "No address configured") {
1364
+ n("No wallet address configured for this network");
1650
1365
  return;
1651
1366
  }
1652
1367
  try {
1653
- let c;
1654
- n === "SOL" || n === "USDC_SOL" ? c = `solana:${o}?amount=${a}&spl-token=USDC` : n === "USDT" || n === "USDC" ? c = `ethereum:${s(n)}/transfer?address=${o}&uint256=${r(a, n)}` : c = `ethereum:${o}@1?value=${l(a)}`, b(c), t(null);
1655
- } catch (c) {
1656
- console.error("Error generating QR code:", c), t("Error generating payment QR code");
1657
- }
1658
- }, [o, a, n]);
1659
- const s = (c) => ({
1660
- USDT: "0xdAC17F958D2ee523a2206206994597C13D831ec7",
1661
- USDC: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
1662
- BNB: "0xB8c77482e45F1F44dE1745F52C74426C631bDD52"
1663
- })[c] || "", r = (c, w) => {
1664
- const u = w === "USDT" || w === "USDC" ? 6 : 18;
1665
- return Math.floor(parseFloat(c) * Math.pow(10, u)).toString();
1666
- }, l = (c) => Math.floor(parseFloat(c) * 1e18).toString();
1667
- return /* @__PURE__ */ i.jsxs("div", { className: "flex flex-col items-center", children: [
1668
- y ? /* @__PURE__ */ i.jsx("div", { className: "p-4 rounded-lg bg-red-100 mb-3 text-red-700", children: y }) : /* @__PURE__ */ i.jsx("div", { className: "p-4 rounded-lg bg-white mb-3", children: m && /* @__PURE__ */ i.jsx(
1669
- At,
1368
+ let m;
1369
+ switch (i) {
1370
+ case "tron":
1371
+ e === "TRX" ? m = `tronlink://transfer?to=${s}&amount=${t}` : m = s;
1372
+ break;
1373
+ case "algorand":
1374
+ m = `algorand://${s}?amount=${Math.floor(parseFloat(t) * 1e6)}`;
1375
+ break;
1376
+ case "bsc":
1377
+ if (e === "BNB")
1378
+ m = `ethereum:${s}@56?value=${d(t)}`;
1379
+ else {
1380
+ const f = a(e, "bsc");
1381
+ f ? m = `ethereum:${f}/transfer?address=${s}&uint256=${l(t, e)}@56` : m = s;
1382
+ }
1383
+ break;
1384
+ case "ethereum":
1385
+ default:
1386
+ if (e === "ETH")
1387
+ m = `ethereum:${s}@1?value=${d(t)}`;
1388
+ else {
1389
+ const f = a(e, "ethereum");
1390
+ f ? m = `ethereum:${f}/transfer?address=${s}&uint256=${l(t, e)}` : m = s;
1391
+ }
1392
+ break;
1393
+ }
1394
+ x(m), n(null);
1395
+ } catch (m) {
1396
+ console.error("Error generating QR code:", m), n("Error generating payment QR code");
1397
+ }
1398
+ }, [s, t, e, i]);
1399
+ const a = (m, f) => {
1400
+ var w;
1401
+ return ((w = {
1402
+ ethereum: {
1403
+ USDT: "0xdAC17F958D2ee523a2206206994597C13D831ec7",
1404
+ USDC: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
1405
+ },
1406
+ bsc: {
1407
+ USDT: "0x55d398326f99059fF775485246999027B3197955",
1408
+ USDC: "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d"
1409
+ },
1410
+ tron: {
1411
+ USDT: "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
1412
+ USDC: "TEkxiTehnzSmSe2XqrBj4w32RUN966rdz8"
1413
+ }
1414
+ }[f]) == null ? void 0 : w[m]) || "";
1415
+ }, l = (m, f) => {
1416
+ const k = f === "USDT" || f === "USDC" ? 6 : 18;
1417
+ return Math.floor(parseFloat(m) * Math.pow(10, k)).toString();
1418
+ }, d = (m) => Math.floor(parseFloat(m) * 1e18).toString(), g = (m) => ({
1419
+ ethereum: "Ethereum",
1420
+ bsc: "BSC",
1421
+ tron: "Tron",
1422
+ algorand: "Algorand"
1423
+ })[m] || m, h = (m) => ({
1424
+ ethereum: ["MetaMask", "Trust Wallet", "Coinbase Wallet"],
1425
+ bsc: ["MetaMask", "Trust Wallet", "SafePal"],
1426
+ tron: ["TronLink", "Trust Wallet"],
1427
+ algorand: ["Pera Wallet", "MyAlgo Wallet"]
1428
+ })[m] || ["MetaMask", "Trust Wallet"];
1429
+ return /* @__PURE__ */ o.jsxs("div", { className: "flex flex-col items-center", children: [
1430
+ r ? /* @__PURE__ */ o.jsxs("div", { className: "p-4 rounded-lg bg-red-100 mb-3 text-red-700 text-center", children: [
1431
+ /* @__PURE__ */ o.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-8 w-8 mx-auto mb-2", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ o.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" }) }),
1432
+ /* @__PURE__ */ o.jsx("p", { className: "font-medium", children: r })
1433
+ ] }) : /* @__PURE__ */ o.jsx("div", { className: "p-4 rounded-lg bg-white mb-3 shadow-sm border", children: y && /* @__PURE__ */ o.jsx(
1434
+ Oe,
1670
1435
  {
1671
- value: m,
1672
- size: h,
1673
- bgColor: d === "dark" ? "#374151" : "#FFFFFF",
1674
- fgColor: d === "dark" ? "#FFFFFF" : "#000000",
1436
+ value: y,
1437
+ size: u,
1438
+ bgColor: c === "dark" ? "#374151" : "#FFFFFF",
1439
+ fgColor: c === "dark" ? "#FFFFFF" : "#000000",
1675
1440
  level: "H",
1676
1441
  includeMargin: !0
1677
1442
  }
1678
1443
  ) }),
1679
- /* @__PURE__ */ i.jsxs("div", { className: "text-center text-sm text-gray-700", children: [
1680
- /* @__PURE__ */ i.jsx("p", { className: "font-semibold text-gray-800", children: "Pay with QR Code" }),
1681
- "Scan with your wallet app to pay"
1444
+ /* @__PURE__ */ o.jsxs("div", { className: "text-center text-sm text-gray-700 mb-4", children: [
1445
+ /* @__PURE__ */ o.jsxs("p", { className: "font-semibold text-gray-800 flex items-center justify-center", children: [
1446
+ /* @__PURE__ */ o.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-4 w-4 mr-1", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ o.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 4v1m6 11h2m-6 0h-2v4m0-11v3m0 0h.01M12 12h4.01M12 12h-4.01M12 12V8.01" }) }),
1447
+ "Scan to Pay with ",
1448
+ e
1449
+ ] }),
1450
+ /* @__PURE__ */ o.jsxs("p", { className: "text-xs text-gray-500 mt-1", children: [
1451
+ "Scan with your ",
1452
+ g(i),
1453
+ " wallet app"
1454
+ ] })
1682
1455
  ] }),
1683
- /* @__PURE__ */ i.jsx("div", { className: "mt-3 w-full" }),
1684
- /* @__PURE__ */ i.jsx("div", { className: "mt-4 w-full", children: /* @__PURE__ */ i.jsxs("div", { className: "p-3 rounded bg-gray-100", children: [
1685
- /* @__PURE__ */ i.jsx("h4", { className: "text-sm font-medium mb-2 text-gray-800", children: "Payment Instructions" }),
1686
- /* @__PURE__ */ i.jsxs("ol", { className: "text-xs space-y-2 text-gray-600", children: [
1687
- /* @__PURE__ */ i.jsx("li", { children: "1. Open your crypto wallet app (MetaMask, Trust Wallet, etc.)" }),
1688
- /* @__PURE__ */ i.jsx("li", { children: "2. Scan the QR code above" }),
1689
- /* @__PURE__ */ i.jsxs("li", { children: [
1690
- "3. Confirm the payment amount (",
1691
- a,
1456
+ /* @__PURE__ */ o.jsxs("div", { className: "w-full mb-4 p-3 bg-gray-50 rounded-lg", children: [
1457
+ /* @__PURE__ */ o.jsxs("div", { className: "flex justify-between items-center", children: [
1458
+ /* @__PURE__ */ o.jsx("span", { className: "text-sm font-medium text-gray-700", children: "Amount to Pay:" }),
1459
+ /* @__PURE__ */ o.jsxs("span", { className: "text-lg font-bold text-[#7042D2]", children: [
1460
+ t,
1692
1461
  " ",
1693
- n,
1462
+ e
1463
+ ] })
1464
+ ] }),
1465
+ /* @__PURE__ */ o.jsxs("div", { className: "flex justify-between items-center mt-1", children: [
1466
+ /* @__PURE__ */ o.jsx("span", { className: "text-xs text-gray-500", children: "Network:" }),
1467
+ /* @__PURE__ */ o.jsx("span", { className: "text-xs font-medium text-gray-700", children: g(i) })
1468
+ ] })
1469
+ ] }),
1470
+ !r && /* @__PURE__ */ o.jsxs("div", { className: "w-full mb-4", children: [
1471
+ /* @__PURE__ */ o.jsx("p", { className: "text-xs text-gray-500 mb-1 text-center", children: "Or copy wallet address:" }),
1472
+ /* @__PURE__ */ o.jsx(
1473
+ "div",
1474
+ {
1475
+ className: "text-xs font-mono p-2 rounded bg-gray-100 text-gray-700 break-all text-center select-all cursor-pointer border",
1476
+ onClick: () => {
1477
+ var m;
1478
+ return (m = navigator.clipboard) == null ? void 0 : m.writeText(s);
1479
+ },
1480
+ title: "Click to copy",
1481
+ children: s
1482
+ }
1483
+ )
1484
+ ] }),
1485
+ /* @__PURE__ */ o.jsx("div", { className: "w-full", children: /* @__PURE__ */ o.jsxs("div", { className: "p-3 rounded bg-blue-50 border border-blue-200", children: [
1486
+ /* @__PURE__ */ o.jsxs("h4", { className: "text-sm font-medium mb-2 text-blue-800 flex items-center", children: [
1487
+ /* @__PURE__ */ o.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-4 w-4 mr-1", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ o.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }),
1488
+ "Payment Instructions"
1489
+ ] }),
1490
+ /* @__PURE__ */ o.jsxs("ol", { className: "text-xs space-y-1 text-blue-700", children: [
1491
+ /* @__PURE__ */ o.jsxs("li", { children: [
1492
+ "1. Open your crypto wallet app (",
1493
+ h(i).join(", "),
1694
1494
  ")"
1695
1495
  ] }),
1696
- /* @__PURE__ */ i.jsx("li", { children: '4. Click "Pay Now" button below after sending the payment' })
1697
- ] })
1496
+ /* @__PURE__ */ o.jsx("li", { children: "2. Scan the QR code above or copy the wallet address" }),
1497
+ /* @__PURE__ */ o.jsxs("li", { children: [
1498
+ "3. Send exactly ",
1499
+ /* @__PURE__ */ o.jsxs("strong", { children: [
1500
+ t,
1501
+ " ",
1502
+ e
1503
+ ] }),
1504
+ " on ",
1505
+ g(i),
1506
+ " network"
1507
+ ] }),
1508
+ /* @__PURE__ */ o.jsx("li", { children: '4. Click "I have sent the payment" button below after sending' })
1509
+ ] }),
1510
+ /* @__PURE__ */ o.jsx("div", { className: "mt-3 p-2 bg-yellow-50 border border-yellow-200 rounded", children: /* @__PURE__ */ o.jsxs("p", { className: "text-xs text-yellow-800", children: [
1511
+ /* @__PURE__ */ o.jsx("strong", { children: "Important:" }),
1512
+ " Make sure you're sending on the correct network (",
1513
+ g(i),
1514
+ ") and using the exact amount shown above."
1515
+ ] }) })
1698
1516
  ] }) })
1699
1517
  ] });
1700
- }, We = ({ status: o, message: a, theme: n = "light" }) => {
1701
- const d = () => {
1702
- switch (o) {
1518
+ }, ie = ({ status: s, message: t, theme: e = "light" }) => {
1519
+ const i = () => {
1520
+ switch (s) {
1703
1521
  case "processing":
1704
- return /* @__PURE__ */ i.jsx("div", { className: "animate-spin rounded-full h-12 w-12 border-4 border-t-blue-500 border-blue-500/20" });
1522
+ return /* @__PURE__ */ o.jsx("div", { className: "animate-spin rounded-full h-12 w-12 border-4 border-t-blue-500 border-blue-500/20" });
1705
1523
  case "success":
1706
- return /* @__PURE__ */ i.jsx("div", { className: "rounded-full h-12 w-12 bg-green-100 flex items-center justify-center", children: /* @__PURE__ */ i.jsx(
1524
+ return /* @__PURE__ */ o.jsx("div", { className: "rounded-full h-12 w-12 bg-green-100 flex items-center justify-center", children: /* @__PURE__ */ o.jsx(
1707
1525
  "svg",
1708
1526
  {
1709
1527
  xmlns: "http://www.w3.org/2000/svg",
@@ -1712,11 +1530,11 @@ const Kr = ({
1712
1530
  viewBox: "0 0 24 24",
1713
1531
  stroke: "currentColor",
1714
1532
  strokeWidth: 2,
1715
- children: /* @__PURE__ */ i.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" })
1533
+ children: /* @__PURE__ */ o.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" })
1716
1534
  }
1717
1535
  ) });
1718
1536
  case "error":
1719
- return /* @__PURE__ */ i.jsx("div", { className: "rounded-full h-12 w-12 bg-red-100 flex items-center justify-center", children: /* @__PURE__ */ i.jsx(
1537
+ return /* @__PURE__ */ o.jsx("div", { className: "rounded-full h-12 w-12 bg-red-100 flex items-center justify-center", children: /* @__PURE__ */ o.jsx(
1720
1538
  "svg",
1721
1539
  {
1722
1540
  xmlns: "http://www.w3.org/2000/svg",
@@ -1725,14 +1543,14 @@ const Kr = ({
1725
1543
  viewBox: "0 0 24 24",
1726
1544
  stroke: "currentColor",
1727
1545
  strokeWidth: 2,
1728
- children: /* @__PURE__ */ i.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" })
1546
+ children: /* @__PURE__ */ o.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" })
1729
1547
  }
1730
1548
  ) });
1731
1549
  default:
1732
1550
  return null;
1733
1551
  }
1734
- }, h = () => {
1735
- switch (o) {
1552
+ }, c = () => {
1553
+ switch (s) {
1736
1554
  case "processing":
1737
1555
  return "Processing Payment";
1738
1556
  case "success":
@@ -1742,622 +1560,499 @@ const Kr = ({
1742
1560
  default:
1743
1561
  return "Unknown Status";
1744
1562
  }
1745
- }, m = () => {
1746
- switch (o) {
1563
+ }, u = () => {
1564
+ switch (s) {
1747
1565
  case "processing":
1748
- return n === "dark" ? "text-blue-300" : "text-blue-600";
1566
+ return e === "dark" ? "text-blue-300" : "text-blue-600";
1749
1567
  case "success":
1750
- return n === "dark" ? "text-green-300" : "text-green-600";
1568
+ return e === "dark" ? "text-green-300" : "text-green-600";
1751
1569
  case "error":
1752
- return n === "dark" ? "text-red-300" : "text-red-600";
1570
+ return e === "dark" ? "text-red-300" : "text-red-600";
1753
1571
  default:
1754
- return n === "dark" ? "text-gray-300" : "text-gray-600";
1572
+ return e === "dark" ? "text-gray-300" : "text-gray-600";
1755
1573
  }
1756
1574
  };
1757
- return /* @__PURE__ */ i.jsxs("div", { className: "flex flex-col items-center justify-center py-6", children: [
1758
- /* @__PURE__ */ i.jsx("div", { className: "mb-4", children: d() }),
1759
- /* @__PURE__ */ i.jsx("h3", { className: `text-xl font-bold mb-2 ${n === "dark" ? "text-white" : "text-gray-900"}`, children: h() }),
1760
- /* @__PURE__ */ i.jsx("p", { className: `text-center ${m()}`, children: a }),
1761
- o === "processing" && /* @__PURE__ */ i.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." }),
1762
- o === "success" && /* @__PURE__ */ i.jsx("div", { className: `mt-4 p-2 rounded ${n === "dark" ? "bg-gray-700" : "bg-gray-100"}`, children: /* @__PURE__ */ i.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." }) })
1575
+ return /* @__PURE__ */ o.jsxs("div", { className: "flex flex-col items-center justify-center py-6", children: [
1576
+ /* @__PURE__ */ o.jsx("div", { className: "mb-4", children: i() }),
1577
+ /* @__PURE__ */ o.jsx("h3", { className: `text-xl font-bold mb-2 ${e === "dark" ? "text-white" : "text-gray-900"}`, children: c() }),
1578
+ /* @__PURE__ */ o.jsx("p", { className: `text-center ${u()}`, children: t }),
1579
+ s === "processing" && /* @__PURE__ */ o.jsx("div", { className: `mt-4 text-xs ${e === "dark" ? "text-gray-400" : "text-gray-500"}`, children: "This may take a few moments. Please do not close this window." }),
1580
+ s === "success" && /* @__PURE__ */ o.jsx("div", { className: `mt-4 p-2 rounded ${e === "dark" ? "bg-gray-700" : "bg-gray-100"}`, children: /* @__PURE__ */ o.jsx("p", { className: `text-xs ${e === "dark" ? "text-gray-300" : "text-gray-600"}`, children: "Your payment has been successfully processed. You will receive a confirmation shortly." }) })
1763
1581
  ] });
1764
- }, k = {
1765
- ETHEREUM: "ethereum",
1766
- BSC: "bsc",
1767
- TRON: "tron",
1768
- ALGORAND: "algorand"
1769
- }, C = {
1770
- METAMASK: "metamask",
1771
- TRONLINK: "tronlink",
1772
- TRUST_WALLET: "trust_wallet",
1773
- LUTE: "lute"
1774
- }, Ge = {
1775
- [k.ETHEREUM]: {
1776
- chainId: "0x1",
1777
- chainName: "Ethereum Mainnet",
1778
- nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
1779
- rpcUrls: ["https://mainnet.infura.io/v3/"],
1780
- blockExplorerUrls: ["https://etherscan.io/"],
1781
- supportedWallets: [C.METAMASK, C.TRUST_WALLET]
1782
- },
1783
- [k.BSC]: {
1784
- chainId: "0x38",
1785
- chainName: "BNB Smart Chain",
1786
- nativeCurrency: { name: "BNB", symbol: "BNB", decimals: 18 },
1787
- rpcUrls: ["https://bsc-dataseed.binance.org/"],
1788
- blockExplorerUrls: ["https://bscscan.com/"],
1789
- supportedWallets: [C.METAMASK, C.TRUST_WALLET]
1790
- },
1791
- [k.TRON]: {
1792
- fullHost: "https://api.trongrid.io",
1793
- explorerUrl: "https://tronscan.org",
1794
- supportedWallets: [C.TRONLINK]
1795
- },
1796
- [k.ALGORAND]: {
1797
- network: "mainnet",
1798
- explorerUrl: "https://algoexplorer.io",
1799
- supportedWallets: [C.LUTE]
1800
- }
1801
- }, br = {
1802
- USDT: {
1803
- [k.ETHEREUM]: {
1804
- address: "0xdAC17F958D2ee523a2206206994597C13D831ec7",
1805
- decimals: 6
1806
- },
1807
- [k.BSC]: {
1808
- address: "0x55d398326f99059fF775485246999027B3197955",
1809
- decimals: 18
1810
- },
1811
- [k.TRON]: {
1812
- address: "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
1813
- decimals: 6
1814
- }
1815
- },
1816
- USDC: {
1817
- [k.ETHEREUM]: {
1818
- address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
1819
- decimals: 6
1820
- },
1821
- [k.BSC]: {
1822
- address: "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d",
1823
- decimals: 18
1824
- },
1825
- [k.TRON]: {
1826
- address: "TEkxiTehnzSmSe2XqrBj4w32RUN966rdz8",
1827
- decimals: 6
1828
- }
1829
- },
1830
- ALGO: {
1831
- [k.ALGORAND]: {
1832
- address: "native",
1833
- decimals: 6
1834
- }
1835
- }
1836
- };
1837
- let ke = null;
1838
- const Nr = () => G(void 0, null, function* () {
1839
- if (ke)
1840
- return ke;
1841
- try {
1842
- const o = yield import("web3");
1843
- return ke = o.default || o, ke;
1844
- } catch (o) {
1845
- throw console.error("Failed to import Web3:", o), new Error("Web3 is required for EVM transactions. Please install web3 package.");
1846
- }
1847
- }), He = () => {
1848
- const o = {
1849
- [C.METAMASK]: !1,
1850
- [C.TRUST_WALLET]: !1,
1851
- [C.TRONLINK]: !1,
1852
- [C.LUTE]: !1
1853
- };
1854
- return typeof window != "undefined" && (o[C.METAMASK] = !!(window.ethereum && window.ethereum.isMetaMask), o[C.TRONLINK] = !!(window.tronWeb && window.tronWeb.ready), o[C.TRUST_WALLET] = !!(window.ethereum && window.ethereum.isTrust), o[C.LUTE] = !!(window.algorand && window.algorand.isLute)), o;
1855
- }, jt = (o) => {
1856
- const a = Ge[o];
1857
- if (!a)
1858
- return [];
1859
- const n = He();
1860
- return a.supportedWallets.filter((d) => n[d]);
1861
- }, Rr = (o, a) => G(void 0, null, function* () {
1862
- switch (o) {
1863
- case C.METAMASK:
1864
- return yield Tr(a);
1865
- case C.TRONLINK:
1866
- return yield Cr();
1867
- case C.TRUST_WALLET:
1868
- return yield Ar(a);
1869
- case C.LUTE:
1870
- return yield jr();
1871
- default:
1872
- throw new Error(`Unsupported wallet type: ${o}`);
1873
- }
1874
- }), Tr = (o) => G(void 0, null, function* () {
1875
- if (!window.ethereum || !window.ethereum.isMetaMask)
1876
- throw new Error("MetaMask is not installed");
1877
- try {
1878
- const a = yield window.ethereum.request({
1879
- method: "eth_requestAccounts"
1880
- }), n = Ge[o];
1881
- return n && n.chainId && (yield St(n)), {
1882
- address: a[0],
1883
- network: o,
1884
- walletType: C.METAMASK
1885
- };
1886
- } catch (a) {
1887
- throw new Error(`Failed to connect MetaMask: ${a.message}`);
1888
- }
1889
- }), Cr = () => G(void 0, null, function* () {
1890
- if (!window.tronWeb)
1891
- throw new Error("TronLink is not installed");
1892
- let o = 0;
1893
- for (; !window.tronWeb.ready && o < 10; )
1894
- yield new Promise((n) => setTimeout(n, 1e3)), o++;
1895
- if (!window.tronWeb.ready)
1896
- throw new Error("Please unlock your TronLink wallet");
1897
- const a = window.tronWeb.defaultAddress.base58;
1898
- if (!a)
1899
- throw new Error("No account found in TronLink");
1900
- return {
1901
- address: a,
1902
- network: k.TRON,
1903
- walletType: C.TRONLINK
1904
- };
1905
- }), Ar = (o) => G(void 0, null, function* () {
1906
- if (!window.ethereum || !window.ethereum.isTrust)
1907
- throw new Error("Trust Wallet is not installed");
1908
- try {
1909
- const a = yield window.ethereum.request({
1910
- method: "eth_requestAccounts"
1911
- }), n = Ge[o];
1912
- return n && n.chainId && (yield St(n)), {
1913
- address: a[0],
1914
- network: o,
1915
- walletType: C.TRUST_WALLET
1916
- };
1917
- } catch (a) {
1918
- throw new Error(`Failed to connect Trust Wallet: ${a.message}`);
1919
- }
1920
- }), jr = () => G(void 0, null, function* () {
1921
- if (!window.algorand || !window.algorand.isLute)
1922
- throw new Error("Lute wallet is not installed");
1923
- try {
1924
- return {
1925
- address: (yield window.algorand.connect())[0],
1926
- network: k.ALGORAND,
1927
- walletType: C.LUTE
1928
- };
1929
- } catch (o) {
1930
- throw new Error(`Failed to connect Lute wallet: ${o.message}`);
1931
- }
1932
- }), St = (o) => G(void 0, null, function* () {
1933
- try {
1934
- yield window.ethereum.request({
1935
- method: "wallet_switchEthereumChain",
1936
- params: [{ chainId: o.chainId }]
1937
- });
1938
- } catch (a) {
1939
- if (a.code === 4902)
1940
- yield window.ethereum.request({
1941
- method: "wallet_addEthereumChain",
1942
- params: [o]
1943
- });
1944
- else
1945
- throw a;
1946
- }
1947
- }), Sr = (o, a) => G(void 0, null, function* () {
1948
- const { walletType: n, network: d, address: h } = o, { to: m, amount: b, tokenAddress: y, tokenDecimals: t } = a;
1949
- switch (n) {
1950
- case C.METAMASK:
1951
- case C.TRUST_WALLET:
1952
- return yield kr(h, m, b, y, t);
1953
- case C.TRONLINK:
1954
- return yield Mr(m, b, y, t);
1955
- case C.LUTE:
1956
- return yield Pr(h, m, b);
1957
- default:
1958
- throw new Error(`Unsupported wallet type: ${n}`);
1959
- }
1960
- }), kr = (o, a, n, d, h) => G(void 0, null, function* () {
1961
- const m = yield Nr();
1962
- if (!window.ethereum)
1963
- throw new Error("No Ethereum provider found");
1964
- const b = new m(window.ethereum), y = b.utils.toBN(
1965
- Math.floor(parseFloat(n) * Math.pow(10, h || 18))
1966
- );
1967
- if (d && d !== "native") {
1968
- const t = [
1969
- {
1970
- constant: !1,
1971
- inputs: [
1972
- { name: "_to", type: "address" },
1973
- { name: "_value", type: "uint256" }
1974
- ],
1975
- name: "transfer",
1976
- outputs: [{ name: "", type: "bool" }],
1977
- payable: !1,
1978
- stateMutability: "nonpayable",
1979
- type: "function"
1980
- }
1981
- ];
1982
- return (yield new b.eth.Contract(t, d).methods.transfer(a, y).send({ from: o })).transactionHash;
1983
- } else
1984
- return (yield b.eth.sendTransaction({
1985
- from: o,
1986
- to: a,
1987
- value: y
1988
- })).transactionHash;
1989
- }), Mr = (o, a, n, d) => G(void 0, null, function* () {
1990
- if (!window.tronWeb || !window.tronWeb.ready)
1991
- throw new Error("TronLink is not ready");
1992
- const h = Math.floor(parseFloat(a) * Math.pow(10, d || 6));
1993
- return n && n !== "native" ? yield (yield window.tronWeb.contract().at(n)).transfer(o, h).send({
1994
- feeLimit: 1e8,
1995
- callValue: 0
1996
- }) : (yield window.tronWeb.trx.sendTransaction(o, h)).txid;
1997
- }), Pr = (o, a, n) => G(void 0, null, function* () {
1998
- if (!window.algorand)
1999
- throw new Error("Lute wallet is not available");
2000
- const d = Math.floor(parseFloat(n) * 1e6), h = {
2001
- from: o,
2002
- to: a,
2003
- amount: d,
2004
- type: "pay"
2005
- }, m = yield window.algorand.signTransaction(h);
2006
- return (yield window.algorand.sendTransaction(m)).txId;
2007
- }), Or = (o) => ({
2008
- [C.METAMASK]: "https://metamask.io/",
2009
- [C.TRONLINK]: "https://www.tronlink.org/",
2010
- [C.TRUST_WALLET]: "https://trustwallet.com/",
2011
- [C.LUTE]: "https://lute.app/"
2012
- })[o] || "", Lr = ({ onSelect: o, selected: a, theme: n = "light", supportedNetworks: d = [] }) => {
2013
- const [h, m] = H({}), [b, y] = H(k.ETHEREUM);
2014
- je(() => {
2015
- m(He());
1582
+ }, St = ({ onSelect: s, selected: t, theme: e = "light", supportedNetworks: i = [] }) => {
1583
+ const [c, u] = D(b.ETHEREUM), [y, x] = D({}), [r, n] = D(!1);
1584
+ Z(() => {
1585
+ x(ue());
2016
1586
  }, []);
2017
- const t = [
2018
- {
2019
- id: "USDT",
2020
- name: "USDT",
2021
- description: "Tether USD",
2022
- logo: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSj0euZAOXsLTJFQxgiKzlX7z8xbfBk-7kmJA&s",
2023
- networks: [k.ETHEREUM, k.BSC, k.TRON]
2024
- },
1587
+ const a = [
2025
1588
  {
2026
- id: "USDC",
2027
- name: "USDC",
2028
- description: "USD Coin",
2029
- logo: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQ43MuDqq54iD1ZCRL_uthAPkfwSSL-J5qI_Q&s",
2030
- networks: [k.ETHEREUM, k.BSC, k.TRON]
1589
+ id: b.ETHEREUM,
1590
+ name: "Ethereum",
1591
+ description: "ERC-20 tokens"
2031
1592
  },
2032
1593
  {
2033
- id: "BNB",
2034
- name: "BNB",
2035
- description: "Binance Coin",
2036
- logo: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRHSjyW2sSnBhwztCwVW97i1BtV40g7heMMxg&s",
2037
- networks: [k.BSC]
1594
+ id: b.BSC,
1595
+ name: "BSC (Binance Smart Chain)",
1596
+ description: "BEP-20 tokens"
2038
1597
  },
2039
1598
  {
2040
- id: "ETH",
2041
- name: "ETH",
2042
- description: "Ethereum",
2043
- logo: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTcyJyRKN0dRJWVZqoLzYgkRHdJsxKGq8nHUw&s",
2044
- networks: [k.ETHEREUM]
1599
+ id: b.TRON,
1600
+ name: "Tron",
1601
+ description: "TRC-20 tokens"
2045
1602
  },
2046
1603
  {
2047
- id: "TRX",
2048
- name: "TRX",
2049
- description: "Tron",
2050
- logo: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQKLpLNsGRHbZfCUXAjZLPSp_YFZvX5dMnAoA&s",
2051
- networks: [k.TRON]
2052
- },
2053
- {
2054
- id: "ALGO",
2055
- name: "ALGO",
2056
- description: "Algorand",
2057
- logo: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR0Yx1Vp8qPQI5XZoJuKfQS8bj_FNiMZGCHqA&s",
2058
- networks: [k.ALGORAND]
2059
- }
2060
- ], s = t.filter((u) => d.length === 0 ? !0 : u.networks.some((p) => d.includes(p))), r = (u) => {
2061
- const p = t.find((v) => v.id === u);
2062
- return p ? p.networks : [];
2063
- }, l = (u) => ({
2064
- [k.ETHEREUM]: "Ethereum",
2065
- [k.BSC]: "BSC",
2066
- [k.TRON]: "Tron",
2067
- [k.ALGORAND]: "Algorand"
2068
- })[u] || u, c = (u) => jt(u).length > 0, w = (u, p) => {
2069
- var v;
2070
- y(p), o({
2071
- currency: u,
2072
- network: p,
2073
- tokenConfig: (v = br[u]) == null ? void 0 : v[p]
2074
- });
2075
- };
2076
- return /* @__PURE__ */ i.jsxs("div", { children: [
2077
- /* @__PURE__ */ i.jsx("h3", { className: `text-lg font-medium mb-3 ${n === "dark" ? "text-white" : "text-gray-800"}`, children: "Select Payment Method" }),
2078
- /* @__PURE__ */ i.jsx("div", { className: "space-y-3", children: s.map((u) => {
2079
- const p = r(u.id), v = (a == null ? void 0 : a.currency) === u.id;
2080
- return /* @__PURE__ */ i.jsxs("div", { className: "space-y-2", children: [
2081
- /* @__PURE__ */ i.jsxs("div", { className: `flex items-center p-3 rounded-lg border-2 transition-colors ${v ? n === "dark" ? "bg-blue-900/30 border-[#7042D2]" : "bg-blue-50 border-[#7042D2]" : n === "dark" ? "bg-gray-700 border-gray-700" : "bg-white border-gray-200"}`, children: [
2082
- /* @__PURE__ */ i.jsx("div", { className: "flex-shrink-0 h-10 w-10 bg-white rounded-full flex items-center justify-center mr-3", children: /* @__PURE__ */ i.jsx("img", { src: u.logo, alt: u.name, className: "h-6 w-6" }) }),
2083
- /* @__PURE__ */ i.jsxs("div", { className: "flex-1", children: [
2084
- /* @__PURE__ */ i.jsx("h4", { className: `font-medium ${n === "dark" ? "text-white" : "text-gray-900"}`, children: u.name }),
2085
- /* @__PURE__ */ i.jsx("p", { className: `text-sm ${n === "dark" ? "text-gray-300" : "text-gray-500"}`, children: u.description })
2086
- ] })
2087
- ] }),
2088
- p.length > 1 && /* @__PURE__ */ i.jsxs("div", { className: "ml-4 space-y-2", children: [
2089
- /* @__PURE__ */ i.jsx("p", { className: `text-sm font-medium ${n === "dark" ? "text-gray-300" : "text-gray-700"}`, children: "Select Network:" }),
2090
- /* @__PURE__ */ i.jsx("div", { className: "grid grid-cols-2 gap-2", children: p.map((T) => {
2091
- const N = v && (a == null ? void 0 : a.network) === T, x = c(T);
2092
- return /* @__PURE__ */ i.jsx(
2093
- "button",
2094
- {
2095
- onClick: () => w(u.id, T),
2096
- disabled: !x,
2097
- className: `p-2 rounded-md text-sm font-medium transition-colors ${N ? "bg-[#7042D2] text-white" : x ? n === "dark" ? "bg-gray-600 text-gray-200 hover:bg-gray-500" : "bg-gray-100 text-gray-700 hover:bg-gray-200" : n === "dark" ? "bg-gray-800 text-gray-500 cursor-not-allowed" : "bg-gray-50 text-gray-400 cursor-not-allowed"}`,
2098
- children: /* @__PURE__ */ i.jsxs("div", { className: "flex items-center justify-center space-x-1", children: [
2099
- /* @__PURE__ */ i.jsx("span", { children: l(T) }),
2100
- !x && /* @__PURE__ */ i.jsx("span", { className: "text-xs", children: "(No wallet)" })
2101
- ] })
2102
- },
2103
- T
2104
- );
2105
- }) })
2106
- ] }),
2107
- p.length === 1 && /* @__PURE__ */ i.jsx("div", { className: "ml-4", children: /* @__PURE__ */ i.jsx(
2108
- "button",
1604
+ id: b.ALGORAND,
1605
+ name: "Algorand",
1606
+ description: "ASA tokens"
1607
+ }
1608
+ ], l = (w) => {
1609
+ const p = [];
1610
+ switch (w) {
1611
+ case b.ETHEREUM:
1612
+ p.push(
2109
1613
  {
2110
- onClick: () => w(u.id, p[0]),
2111
- disabled: !c(p[0]),
2112
- className: `w-full p-2 rounded-md text-sm font-medium transition-colors ${v ? "bg-[#7042D2] text-white" : c(p[0]) ? n === "dark" ? "bg-gray-600 text-gray-200 hover:bg-gray-500" : "bg-gray-100 text-gray-700 hover:bg-gray-200" : n === "dark" ? "bg-gray-800 text-gray-500 cursor-not-allowed" : "bg-gray-50 text-gray-400 cursor-not-allowed"}`,
2113
- children: /* @__PURE__ */ i.jsxs("div", { className: "flex items-center justify-between", children: [
2114
- /* @__PURE__ */ i.jsx("span", { children: l(p[0]) }),
2115
- !c(p[0]) && /* @__PURE__ */ i.jsx("span", { className: "text-xs", children: "No wallet detected" }),
2116
- v && /* @__PURE__ */ i.jsx(
2117
- "svg",
2118
- {
2119
- xmlns: "http://www.w3.org/2000/svg",
2120
- className: "h-4 w-4",
2121
- viewBox: "0 0 20 20",
2122
- fill: "currentColor",
2123
- children: /* @__PURE__ */ i.jsx(
2124
- "path",
2125
- {
2126
- fillRule: "evenodd",
2127
- d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",
2128
- clipRule: "evenodd"
2129
- }
2130
- )
2131
- }
2132
- )
2133
- ] })
1614
+ id: "USDT",
1615
+ name: "USDT",
1616
+ description: "Tether USD",
1617
+ logo: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSj0euZAOXsLTJFQxgiKzlX7z8xbfBk-7kmJA&s",
1618
+ network: b.ETHEREUM
1619
+ },
1620
+ {
1621
+ id: "USDC",
1622
+ name: "USDC",
1623
+ description: "USD Coin",
1624
+ logo: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQ43MuDqq54iD1ZCRL_uthAPkfwSSL-J5qI_Q&s",
1625
+ network: b.ETHEREUM
1626
+ },
1627
+ {
1628
+ id: "ETH",
1629
+ name: "ETH",
1630
+ description: "Ethereum",
1631
+ logo: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTcyJyRKN0dRJWVZqoLzYgkRHdJsxKGq8nHUw&s",
1632
+ network: b.ETHEREUM
2134
1633
  }
2135
- ) })
2136
- ] }, u.id);
2137
- }) }),
2138
- /* @__PURE__ */ i.jsxs("div", { className: "mt-4 p-3 rounded-lg bg-gray-50 dark:bg-gray-800", children: [
2139
- /* @__PURE__ */ i.jsx("h4", { className: `text-sm font-medium mb-2 ${n === "dark" ? "text-white" : "text-gray-800"}`, children: "Detected Wallets:" }),
2140
- /* @__PURE__ */ i.jsx("div", { className: "space-y-1", children: Object.entries(h).map(([u, p]) => /* @__PURE__ */ i.jsxs("div", { className: "flex items-center justify-between text-xs", children: [
2141
- /* @__PURE__ */ i.jsx("span", { className: `capitalize ${n === "dark" ? "text-gray-300" : "text-gray-600"}`, children: u.replace("_", " ") }),
2142
- /* @__PURE__ */ i.jsx("span", { className: `px-2 py-1 rounded-full ${p ? "bg-green-100 text-green-800" : "bg-red-100 text-red-800"}`, children: p ? "Available" : "Not detected" })
2143
- ] }, u)) })
2144
- ] })
1634
+ );
1635
+ break;
1636
+ case b.BSC:
1637
+ p.push(
1638
+ {
1639
+ id: "USDT",
1640
+ name: "USDT",
1641
+ description: "Tether USD",
1642
+ logo: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSj0euZAOXsLTJFQxgiKzlX7z8xbfBk-7kmJA&s",
1643
+ network: b.BSC
1644
+ },
1645
+ {
1646
+ id: "USDC",
1647
+ name: "USDC",
1648
+ description: "USD Coin",
1649
+ logo: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQ43MuDqq54iD1ZCRL_uthAPkfwSSL-J5qI_Q&s",
1650
+ network: b.BSC
1651
+ },
1652
+ {
1653
+ id: "BNB",
1654
+ name: "BNB",
1655
+ description: "Binance Coin",
1656
+ logo: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRHSjyW2sSnBhwztCwVW97i1BtV40g7heMMxg&s",
1657
+ network: b.BSC
1658
+ }
1659
+ );
1660
+ break;
1661
+ case b.TRON:
1662
+ p.push(
1663
+ {
1664
+ id: "USDT",
1665
+ name: "USDT",
1666
+ description: "Tether USD",
1667
+ logo: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSj0euZAOXsLTJFQxgiKzlX7z8xbfBk-7kmJA&s",
1668
+ network: b.TRON
1669
+ },
1670
+ {
1671
+ id: "USDC",
1672
+ name: "USDC",
1673
+ description: "USD Coin",
1674
+ logo: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQ43MuDqq54iD1ZCRL_uthAPkfwSSL-J5qI_Q&s",
1675
+ network: b.TRON
1676
+ },
1677
+ {
1678
+ id: "TRX",
1679
+ name: "TRX",
1680
+ description: "Tron",
1681
+ logo: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQKLpLNsGRHbZfCUXAjZLPSp_YFZvX5dMnAoA&s",
1682
+ network: b.TRON
1683
+ }
1684
+ );
1685
+ break;
1686
+ case b.ALGORAND:
1687
+ p.push(
1688
+ {
1689
+ id: "ALGO",
1690
+ name: "ALGO",
1691
+ description: "Algorand",
1692
+ logo: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR0Yx1Vp8qPQI5XZoJuKfQS8bj_FNiMZGCHqA&s",
1693
+ network: b.ALGORAND
1694
+ }
1695
+ );
1696
+ break;
1697
+ }
1698
+ return p;
1699
+ }, d = (w) => {
1700
+ u(w), n(!1), (t == null ? void 0 : t.network) !== w && s(null);
1701
+ }, g = (w) => {
1702
+ var p;
1703
+ s({
1704
+ currency: w.id,
1705
+ network: c,
1706
+ tokenConfig: (p = Ye[w.id]) == null ? void 0 : p[c],
1707
+ method: w
1708
+ });
1709
+ }, h = l(c), m = r ? h : h.slice(0, 4);
1710
+ return /* @__PURE__ */ o.jsxs("div", { children: [
1711
+ /* @__PURE__ */ o.jsx("h3", { className: `text-lg font-medium mb-4 ${e === "dark" ? "text-white" : "text-gray-800"}`, children: "Select Payment Method" }),
1712
+ /* @__PURE__ */ o.jsxs("div", { className: "mb-6", children: [
1713
+ /* @__PURE__ */ o.jsx("label", { className: `block text-sm font-medium mb-2 ${e === "dark" ? "text-white" : "text-gray-700"}`, children: "Blockchain Network" }),
1714
+ /* @__PURE__ */ o.jsx(
1715
+ "select",
1716
+ {
1717
+ value: c,
1718
+ onChange: (w) => d(w.target.value),
1719
+ className: `w-full p-3 rounded-lg border transition-colors ${e === "dark" ? "bg-gray-700 border-gray-600 text-white focus:border-[#7042D2]" : "bg-white border-gray-300 text-gray-900 focus:border-[#7042D2]"} focus:outline-none focus:ring-2 focus:ring-[#7042D2] focus:ring-opacity-50`,
1720
+ children: a.filter((w) => i.length === 0 || i.includes(w.id)).map((w) => /* @__PURE__ */ o.jsxs("option", { value: w.id, children: [
1721
+ w.name,
1722
+ " - ",
1723
+ w.description
1724
+ ] }, w.id))
1725
+ }
1726
+ )
1727
+ ] }),
1728
+ /* @__PURE__ */ o.jsxs("div", { className: "mb-4", children: [
1729
+ /* @__PURE__ */ o.jsx("label", { className: `block text-sm font-medium mb-3 ${e === "dark" ? "text-white" : "text-gray-700"}`, children: "Choose Cryptocurrency" }),
1730
+ /* @__PURE__ */ o.jsx("div", { className: "grid grid-cols-2 gap-3 mb-4", children: m.map((w) => /* @__PURE__ */ o.jsx(
1731
+ "button",
1732
+ {
1733
+ onClick: () => g(w),
1734
+ className: `p-4 rounded-lg transition-all duration-200 border-2 ${(t == null ? void 0 : t.currency) === w.id && (t == null ? void 0 : t.network) === c ? e === "dark" ? "bg-blue-900/30 border-[#7042D2] ring-2 ring-[#7042D2] ring-opacity-50" : "bg-blue-50 border-[#7042D2] ring-2 ring-[#7042D2] ring-opacity-50" : e === "dark" ? "bg-gray-700 hover:bg-gray-600 border-gray-600 hover:border-gray-500" : "bg-white hover:bg-gray-50 border-gray-200 hover:border-gray-300"}`,
1735
+ children: /* @__PURE__ */ o.jsxs("div", { className: "flex flex-col items-center text-center", children: [
1736
+ /* @__PURE__ */ o.jsx("div", { className: "flex-shrink-0 h-10 w-10 bg-white rounded-full flex items-center justify-center mb-2 shadow-sm", children: /* @__PURE__ */ o.jsx("img", { src: w.logo, alt: w.name, className: "h-6 w-6" }) }),
1737
+ /* @__PURE__ */ o.jsxs("div", { children: [
1738
+ /* @__PURE__ */ o.jsx("h4", { className: `font-medium text-sm ${e === "dark" ? "text-white" : "text-gray-900"}`, children: w.name }),
1739
+ /* @__PURE__ */ o.jsx("p", { className: `text-xs ${e === "dark" ? "text-gray-300" : "text-gray-500"}`, children: w.description })
1740
+ ] }),
1741
+ (t == null ? void 0 : t.currency) === w.id && (t == null ? void 0 : t.network) === c && /* @__PURE__ */ o.jsx("div", { className: "mt-2", children: /* @__PURE__ */ o.jsx(
1742
+ "svg",
1743
+ {
1744
+ xmlns: "http://www.w3.org/2000/svg",
1745
+ className: "h-4 w-4 text-[#7042D2]",
1746
+ viewBox: "0 0 20 20",
1747
+ fill: "currentColor",
1748
+ children: /* @__PURE__ */ o.jsx(
1749
+ "path",
1750
+ {
1751
+ fillRule: "evenodd",
1752
+ d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",
1753
+ clipRule: "evenodd"
1754
+ }
1755
+ )
1756
+ }
1757
+ ) })
1758
+ ] })
1759
+ },
1760
+ `${w.id}-${w.network}`
1761
+ )) }),
1762
+ h.length > 4 && /* @__PURE__ */ o.jsx(
1763
+ "button",
1764
+ {
1765
+ onClick: () => n(!r),
1766
+ className: `w-full py-2 px-4 rounded-lg text-sm font-medium transition-colors ${e === "dark" ? "bg-gray-700 text-gray-300 hover:bg-gray-600" : "bg-gray-100 text-gray-600 hover:bg-gray-200"}`,
1767
+ children: r ? "Show Less" : `Show More (${h.length - 4} more)`
1768
+ }
1769
+ )
1770
+ ] }),
1771
+ /* @__PURE__ */ o.jsx("div", { className: `p-3 rounded-lg text-sm ${e === "dark" ? "bg-gray-800 text-gray-300" : "bg-gray-50 text-gray-600"}`, children: /* @__PURE__ */ o.jsxs("div", { className: "flex items-center", children: [
1772
+ /* @__PURE__ */ o.jsx("div", { className: `w-2 h-2 rounded-full mr-2 ${y[f(c)] ? "bg-green-500" : "bg-red-500"}` }),
1773
+ /* @__PURE__ */ o.jsx("span", { className: "text-xs", children: k(c) })
1774
+ ] }) })
2145
1775
  ] });
2146
- }, Dr = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJQAAAAkCAYAAABv9hOhAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAmVSURBVHgB7Vzdcdu4Fv5I+X2VCoK83pkb2xVc2ikgTgVWKog8twDJBexYrsBKBXYKWJtbQWRnZl+NrWC172txcQBQBA8B/kiKV87qm4FFgMAhAX48ODg4dISOGB4/XKsfObl9e+Y9n3wViHt3QHY5ud2fYId1caDSJyc/V+kMW4q4S2VFFurcCR0Oj+/H3kq9vSv1VyDDKX5s0Fh8VSlTifrcx/cByR046QRbjE6EQmnQok9aGzlQ+QRZluDHh1BJaWFNKsJApQvs0JlQc+e4jzgelqX1HNUczfHjQqCqkRLsUCWU0jL94buHE659LGQ5G51SfafAUcfZn572Sv63hKZL1u6lYeYpk9jBo6HieKysgmulbR6VAX7lEmuSHpLWkU5tIoVW+3q6cxEhdbOaqMcPF4gzNVVEI2VsJXi5oHE4d/JSpY/YwUOoRYkwA1qxWWPcIvtSlhDbc/FBWc5i+RbblR8ZsGaKzDIJPKV42Rir9EqlNzZJ7OCzoRZTlG0lTYalBlosbsr1o33zg4JQijBKm6V0WLgRtN1hm+DSaruXDq6x//XY4wX0oJWNo9R5VF61xL1rRY4jIsrw6F4iioQuz7JX5nz8Wh2bulGU0o+2kziZMqSTu7X9UwLGCBZOGWnEFOWXoQk0ZZ945FCS+D4QKN873W8Kv122Kv6Jfmns+QrJITl89+09cwH0LakOkS3OEPWuS42yrHiQiydjX8Q9IqVw6kjVdh1bI1FphPoV1RTGvpFryklVulTpJnD+jrX/aK9NeET5YR7Z+7lC+Jr0sD9gvQeeoF2/PjrXIfI9orxqpfEboxmkGFyn6yzsNnj664MiAH9rBLkKlJa6IU+4LsnyNyu7t7/n6rxUBvgAxj9jizWZSMNJdAd1lgjMH6IPA5gBGgXOX7SUk9hrbsK/JFpcM3eUruq47NIvd3xIEVyyOp/QDu9Z/nJJKL0K4ys6RYAlcZaItAdcabGh0kSHk3R/rIsXi4nO39p8FBU3paa5NclEA9V1oMeokoo0xBDdMLTt1oHZPWhGv0NdLr9rv8YoxmfiuY8E9aDzgpWle+RzUiu7T8pQpgq0V0dkmJmVGL6oPTu1zfJA+ZG2m3I7CZp0M+eYmF5otCyji821xlrPZqI378BTnqr0qz2mAXjv6eBYJdKcNG3R4A1q5Ejb/n+oDia128QemoTRBtLKy/fphFOH+jJEe4JcoNovaa+T2uuIwLXGMH1PbUqccyNbFgLfWpvq6yqyZA3p0U5f2tfU1iG5IcflAGavzE00LYia+o9O3T9smfDIoXpJQI5gcvLk1r9j5wbOOV/bKfz7fX0Ue4LufedIPPft3ie/zgThfUWqfx2Ql3hk1T1D3kc9g8T5iqwGQqWr4fG3Ea3w2i73N+QWGLG8RGHg+jCFMWzz4zf2NyQnDcgJXWeE1SBRaDkOKuMLFXqQr9EMfj8pjGab19yHa5ATBAwZUlTHI6Ql+QpSwi5eYmt8f0YjsvH/j39r08lNgVS0YGX0kJuIStPuIczAUd18t95F0yoQ8Hu/E6wWVdA0vr7l/Bs0Y8Dy5y3a+Izw3Ljm90lTpK+/3BhP84M9q0kGaoqa2s1dv/GrbKqf7/7zO54PguVTtF9Su6tTbn9JFMv7JqQobKscCcKuhDo5TZDoZownLD8PlPswD8iawthkOYly49ztb+7jcrEk8tIPZT3bqbV9DhS5hGKRUAa7uvhilnu+nxGcCPdYDYLlJbrhVyZDYDvQ9+TvsBqEc0zay51KScm4hDph1y5p15IfypBpj8hEKu29dhH04lOVPw1EHzwnNmGTESTWwyYWG5vA97qPCcpjnaCs9U5Z/dL0WfihlNFNEQYmGkAbY8bwyjLSFAO7n/ecg8kJtCn77aBj/Z9YXmI7sKkXjMuiY25L5VOcQHVKTd1MTJpHbbN8JaMb9ax/7jdTsvwJVsOM5QW69SVheYntAO8XEYH2VaMV0ismi9uIpJVye8rFFGw8YqV5RlYLNUBvqWzyrWhCCh4h2t7ZN0BhF8w8ctou/0cok2+Odgb2c0Bi9fFpQopyP/OVMp/uvvCG8TJqIATtMc8o+uD18Ojh7uzdt1b7PMMkGPXZFr6HRw+4ifxU5wrl/Sq+TKaBP22QQ+fHrKzr6u57w7cHJ9AMqtdEvnNPm8TJS3jGg/xQHz3OTao8VcpQOQkjaSIsFUPV9kyWZZNW/qg4O9DBebS1szpoq4O/heRVpvsRrG4Cs8oZO2V0TJ2eoDpVTeHfN6NrXKDqWpBo5+d5TnADOl/pDQL1875N7O9jTd0UPC6uer6CyM2QRsk3cL2BcTkWT+RgnKnzVxSqQnt6tv6Fyp8tZRzdf1VkVRolGk9u/7vqw6A3KbTjL+1vH367iAbk0NZLEF5W59OiQPgNJw+8+0Z2DV9JUQ8uL2+ToHzfEmWnJ72w1x55VC9f0vdR7Of1PfVCTtQxwubBITwxXCW3gUOmfpBMeTSmiXU6QRwnVtSJzke9q6Lu4oOdMsd6Fbka6G0KkVEgbGQTQdztkxThuG8a6ARhMlG7bZvuctB9+cZHwH5DCaOFEvjJdIQwuAbMMUMgINAfD8UD41yo6dHaRgNb0reSzK+aFvNwYU1QIpWJOliHVGNU96DqkML/Bk3RLf6b6h2hvWf9n8IY9XucPhARDxva+FwIhMtQg0rEJiNLGSZI7lyvDMsXhbG1LKLeMvTBTodH9vN0IhVWnP6mNg1gDOaEnc+N+DxsIwQJQ6qBlcOnAZJDRPyMeiJ9QflhSHbuJyazCVze3JE79ZRzpCj6RY7pBH6NRNe5QfvVqgxcy4uIF5hPzCO/JlG2k44pP36g8Ip+qYyM78yZyxdPr1w3g/5yJoqv9apSGfuTX95uYgoRzrHE6hAbkrNtcG3LOVZzhnLbboqaT8aqU17mnermS+KY6Yzv5QBP7LOoOB64WR2MRxGgWsvhakNed+mkbZCzbSACSVR9Vm3BXQWEz3UNqoSquhCmJtTXbg4vjXDQFDjLtZD+pUjPQtA+F0021eRu/40NKz7ADtuMkB8urWtU/Yzq9u1UaQ+pow0WTzdV77hDlGgZgmuQLdT8HBmi1Hjfl3HnO2wbEhT2qWDniAeNIdD+z6jqQlXcuHL6MMHFYpEuDfYo2sSUtsPzQiDs6CQySTQgRldkWU6UKf+KRROxOaR4h5cF0kzk+pm2qdydUJF2D8yXH3NyPP21tf9dbYdOkDAOU3JFtF6R76EraO9PrfJC39hZv5NidG835b085Eb3qi4G/A2inrQKnVgMFAAAAABJRU5ErkJggg==", Ir = ({
2147
- isOpen: o,
2148
- onClose: a,
2149
- payment: n,
2150
- paymentStatus: d,
2151
- selectedPaymentMethod: h,
2152
- onPaymentMethodSelect: m,
2153
- onPayment: b,
2154
- onBack: y,
2155
- error: t,
2156
- theme: s = "light",
2157
- merchantName: r,
1776
+ function f(w) {
1777
+ switch (w) {
1778
+ case b.ETHEREUM:
1779
+ case b.BSC:
1780
+ return "metamask";
1781
+ case b.TRON:
1782
+ return "tronlink";
1783
+ case b.ALGORAND:
1784
+ return "lute";
1785
+ default:
1786
+ return "metamask";
1787
+ }
1788
+ }
1789
+ function k(w) {
1790
+ const p = f(w), T = y[p], C = {
1791
+ metamask: "MetaMask",
1792
+ tronlink: "TronLink",
1793
+ lute: "Lute Wallet"
1794
+ };
1795
+ return T ? `${C[p]} detected - Ready to pay` : `${C[p]} required - Please install to continue`;
1796
+ }
1797
+ }, Lt = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJQAAAAkCAYAAABv9hOhAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAmVSURBVHgB7Vzdcdu4Fv5I+X2VCoK83pkb2xVc2ikgTgVWKog8twDJBexYrsBKBXYKWJtbQWRnZl+NrWC172txcQBQBA8B/kiKV87qm4FFgMAhAX48ODg4dISOGB4/XKsfObl9e+Y9n3wViHt3QHY5ud2fYId1caDSJyc/V+kMW4q4S2VFFurcCR0Oj+/H3kq9vSv1VyDDKX5s0Fh8VSlTifrcx/cByR046QRbjE6EQmnQok9aGzlQ+QRZluDHh1BJaWFNKsJApQvs0JlQc+e4jzgelqX1HNUczfHjQqCqkRLsUCWU0jL94buHE659LGQ5G51SfafAUcfZn572Sv63hKZL1u6lYeYpk9jBo6HieKysgmulbR6VAX7lEmuSHpLWkU5tIoVW+3q6cxEhdbOaqMcPF4gzNVVEI2VsJXi5oHE4d/JSpY/YwUOoRYkwA1qxWWPcIvtSlhDbc/FBWc5i+RbblR8ZsGaKzDIJPKV42Rir9EqlNzZJ7OCzoRZTlG0lTYalBlosbsr1o33zg4JQijBKm6V0WLgRtN1hm+DSaruXDq6x//XY4wX0oJWNo9R5VF61xL1rRY4jIsrw6F4iioQuz7JX5nz8Wh2bulGU0o+2kziZMqSTu7X9UwLGCBZOGWnEFOWXoQk0ZZ945FCS+D4QKN873W8Kv122Kv6Jfmns+QrJITl89+09cwH0LakOkS3OEPWuS42yrHiQiydjX8Q9IqVw6kjVdh1bI1FphPoV1RTGvpFryklVulTpJnD+jrX/aK9NeET5YR7Z+7lC+Jr0sD9gvQeeoF2/PjrXIfI9orxqpfEboxmkGFyn6yzsNnj664MiAH9rBLkKlJa6IU+4LsnyNyu7t7/n6rxUBvgAxj9jizWZSMNJdAd1lgjMH6IPA5gBGgXOX7SUk9hrbsK/JFpcM3eUruq47NIvd3xIEVyyOp/QDu9Z/nJJKL0K4ys6RYAlcZaItAdcabGh0kSHk3R/rIsXi4nO39p8FBU3paa5NclEA9V1oMeokoo0xBDdMLTt1oHZPWhGv0NdLr9rv8YoxmfiuY8E9aDzgpWle+RzUiu7T8pQpgq0V0dkmJmVGL6oPTu1zfJA+ZG2m3I7CZp0M+eYmF5otCyji821xlrPZqI378BTnqr0qz2mAXjv6eBYJdKcNG3R4A1q5Ejb/n+oDia128QemoTRBtLKy/fphFOH+jJEe4JcoNovaa+T2uuIwLXGMH1PbUqccyNbFgLfWpvq6yqyZA3p0U5f2tfU1iG5IcflAGavzE00LYia+o9O3T9smfDIoXpJQI5gcvLk1r9j5wbOOV/bKfz7fX0Ue4LufedIPPft3ie/zgThfUWqfx2Ql3hk1T1D3kc9g8T5iqwGQqWr4fG3Ea3w2i73N+QWGLG8RGHg+jCFMWzz4zf2NyQnDcgJXWeE1SBRaDkOKuMLFXqQr9EMfj8pjGab19yHa5ATBAwZUlTHI6Ql+QpSwi5eYmt8f0YjsvH/j39r08lNgVS0YGX0kJuIStPuIczAUd18t95F0yoQ8Hu/E6wWVdA0vr7l/Bs0Y8Dy5y3a+Izw3Ljm90lTpK+/3BhP84M9q0kGaoqa2s1dv/GrbKqf7/7zO54PguVTtF9Su6tTbn9JFMv7JqQobKscCcKuhDo5TZDoZownLD8PlPswD8iawthkOYly49ztb+7jcrEk8tIPZT3bqbV9DhS5hGKRUAa7uvhilnu+nxGcCPdYDYLlJbrhVyZDYDvQ9+TvsBqEc0zay51KScm4hDph1y5p15IfypBpj8hEKu29dhH04lOVPw1EHzwnNmGTESTWwyYWG5vA97qPCcpjnaCs9U5Z/dL0WfihlNFNEQYmGkAbY8bwyjLSFAO7n/ecg8kJtCn77aBj/Z9YXmI7sKkXjMuiY25L5VOcQHVKTd1MTJpHbbN8JaMb9ax/7jdTsvwJVsOM5QW69SVheYntAO8XEYH2VaMV0ismi9uIpJVye8rFFGw8YqV5RlYLNUBvqWzyrWhCCh4h2t7ZN0BhF8w8ctou/0cok2+Odgb2c0Bi9fFpQopyP/OVMp/uvvCG8TJqIATtMc8o+uD18Ojh7uzdt1b7PMMkGPXZFr6HRw+4ifxU5wrl/Sq+TKaBP22QQ+fHrKzr6u57w7cHJ9AMqtdEvnNPm8TJS3jGg/xQHz3OTao8VcpQOQkjaSIsFUPV9kyWZZNW/qg4O9DBebS1szpoq4O/heRVpvsRrG4Cs8oZO2V0TJ2eoDpVTeHfN6NrXKDqWpBo5+d5TnADOl/pDQL1875N7O9jTd0UPC6uer6CyM2QRsk3cL2BcTkWT+RgnKnzVxSqQnt6tv6Fyp8tZRzdf1VkVRolGk9u/7vqw6A3KbTjL+1vH367iAbk0NZLEF5W59OiQPgNJw+8+0Z2DV9JUQ8uL2+ToHzfEmWnJ72w1x55VC9f0vdR7Of1PfVCTtQxwubBITwxXCW3gUOmfpBMeTSmiXU6QRwnVtSJzke9q6Lu4oOdMsd6Fbka6G0KkVEgbGQTQdztkxThuG8a6ARhMlG7bZvuctB9+cZHwH5DCaOFEvjJdIQwuAbMMUMgINAfD8UD41yo6dHaRgNb0reSzK+aFvNwYU1QIpWJOliHVGNU96DqkML/Bk3RLf6b6h2hvWf9n8IY9XucPhARDxva+FwIhMtQg0rEJiNLGSZI7lyvDMsXhbG1LKLeMvTBTodH9vN0IhVWnP6mNg1gDOaEnc+N+DxsIwQJQ6qBlcOnAZJDRPyMeiJ9QflhSHbuJyazCVze3JE79ZRzpCj6RY7pBH6NRNe5QfvVqgxcy4uIF5hPzCO/JlG2k44pP36g8Ip+qYyM78yZyxdPr1w3g/5yJoqv9apSGfuTX95uYgoRzrHE6hAbkrNtcG3LOVZzhnLbboqaT8aqU17mnermS+KY6Yzv5QBP7LOoOB64WR2MRxGgWsvhakNed+mkbZCzbSACSVR9Vm3BXQWEz3UNqoSquhCmJtTXbg4vjXDQFDjLtZD+pUjPQtA+F0021eRu/40NKz7ADtuMkB8urWtU/Yzq9u1UaQ+pow0WTzdV77hDlGgZgmuQLdT8HBmi1Hjfl3HnO2wbEhT2qWDniAeNIdD+z6jqQlXcuHL6MMHFYpEuDfYo2sSUtsPzQiDs6CQySTQgRldkWU6UKf+KRROxOaR4h5cF0kzk+pm2qdydUJF2D8yXH3NyPP21tf9dbYdOkDAOU3JFtF6R76EraO9PrfJC39hZv5NidG835b085Eb3qi4G/A2inrQKnVgMFAAAAABJRU5ErkJggg==", Pt = ({
1798
+ isOpen: s,
1799
+ onClose: t,
1800
+ payment: e,
1801
+ paymentStatus: i,
1802
+ selectedPaymentMethod: c,
1803
+ onPaymentMethodSelect: u,
1804
+ onPayment: y,
1805
+ onBack: x,
1806
+ error: r,
1807
+ theme: n = "light",
1808
+ merchantName: a,
2158
1809
  transactionHash: l,
2159
- walletConnection: c,
2160
- onConnectWallet: w,
2161
- testMode: u = !1,
2162
- supportedNetworks: p = [],
2163
- availableWallets: v = {},
2164
- supportedWallets: T = [],
2165
- step: N = "select-currency"
1810
+ walletConnection: d,
1811
+ onConnectWallet: g,
1812
+ testMode: h = !1,
1813
+ supportedNetworks: m = [],
1814
+ availableWallets: f = {},
1815
+ supportedWallets: k = [],
1816
+ step: w = "select-currency"
2166
1817
  }) => {
2167
- const x = (R) => parseFloat(R).toFixed(2), D = (R) => R ? R.length <= 14 ? R : `${R.slice(0, 8)}...${R.slice(-6)}` : "", I = (R) => ({
1818
+ const [p, T] = D("wallet"), C = (v) => parseFloat(v).toFixed(2), q = (v) => v ? v.length <= 14 ? v : `${v.slice(0, 8)}...${v.slice(-6)}` : "", H = (v) => ({
2168
1819
  ethereum: "Ethereum",
2169
1820
  bsc: "BSC",
2170
1821
  tron: "Tron",
2171
1822
  algorand: "Algorand"
2172
- })[R] || R, Z = (R) => ({
2173
- [C.METAMASK]: "MetaMask",
2174
- [C.TRONLINK]: "TronLink",
2175
- [C.TRUST_WALLET]: "Trust Wallet",
2176
- [C.LUTE]: "Lute Wallet"
2177
- })[R] || R, ae = (R) => ({
2178
- [C.METAMASK]: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcT3ymr3UNKopfI0NmUY95Dr-0589vG-91KuAA&s",
2179
- [C.TRONLINK]: "https://www.tronlink.org/images/logo.png",
2180
- [C.TRUST_WALLET]: "https://trustwallet.com/assets/images/trust_logotype.svg",
2181
- [C.LUTE]: "https://lute.app/logo.png"
2182
- })[R] || "";
2183
- return o ? /* @__PURE__ */ i.jsx("div", { className: "fixed inset-0 z-50 overflow-y-auto bg-black/50", children: /* @__PURE__ */ i.jsx("div", { className: "flex min-h-screen items-center justify-center p-4", children: /* @__PURE__ */ i.jsxs("div", { className: "relative p-6 w-full max-w-md mx-auto rounded-lg shadow-xl bg-white text-gray-800", children: [
2184
- /* @__PURE__ */ i.jsxs("div", { className: "flex justify-between items-center mb-6 bg-[#F1ECFB] p-3 rounded-xl", children: [
2185
- /* @__PURE__ */ i.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ i.jsx("h2", { className: "text-xl font-bold text-gray-900", children: /* @__PURE__ */ i.jsx("img", { src: Dr, className: "w-32", alt: "Coinley Logo" }) }) }),
2186
- /* @__PURE__ */ i.jsx(
1823
+ })[v] || v, O = (v) => ({
1824
+ [N.METAMASK]: "MetaMask",
1825
+ [N.TRONLINK]: "TronLink",
1826
+ [N.TRUST_WALLET]: "Trust Wallet",
1827
+ [N.LUTE]: "Lute Wallet"
1828
+ })[v] || v, M = (v) => ({
1829
+ [N.METAMASK]: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcT3ymr3UNKopfI0NmUY95Dr-0589vG-91KuAA&s",
1830
+ [N.TRONLINK]: "https://www.tronlink.org/images/logo.png",
1831
+ [N.TRUST_WALLET]: "https://trustwallet.com/assets/images/trust_logotype.svg",
1832
+ [N.LUTE]: "https://lute.app/logo.png"
1833
+ })[v] || "";
1834
+ return s ? /* @__PURE__ */ o.jsx("div", { className: "fixed inset-0 z-50 overflow-y-auto bg-black/50", children: /* @__PURE__ */ o.jsx("div", { className: "flex min-h-screen items-center justify-center p-4", children: /* @__PURE__ */ o.jsxs("div", { className: "relative p-6 w-full max-w-md mx-auto rounded-lg shadow-xl bg-white text-gray-800", children: [
1835
+ /* @__PURE__ */ o.jsxs("div", { className: "flex justify-between items-center mb-6 bg-[#F1ECFB] p-3 rounded-xl", children: [
1836
+ /* @__PURE__ */ o.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ o.jsx("h2", { className: "text-xl font-bold text-gray-900", children: /* @__PURE__ */ o.jsx("img", { src: Lt, className: "w-32", alt: "Coinley Logo" }) }) }),
1837
+ /* @__PURE__ */ o.jsx(
2187
1838
  "button",
2188
1839
  {
2189
- onClick: a,
1840
+ onClick: t,
2190
1841
  className: "text-gray-500 hover:text-gray-700 focus:outline-none",
2191
- children: /* @__PURE__ */ i.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__ */ i.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) })
1842
+ children: /* @__PURE__ */ o.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__ */ o.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) })
2192
1843
  }
2193
1844
  )
2194
1845
  ] }),
2195
- /* @__PURE__ */ i.jsxs("div", { className: "mb-6 bg-[#F1ECFB] p-3 rounded-xl", children: [
2196
- n && /* @__PURE__ */ i.jsxs("div", { className: "mb-6 p-4 rounded-lg", children: [
2197
- /* @__PURE__ */ i.jsxs("p", { className: "text-lg text-gray-800 font-semibold", children: [
1846
+ /* @__PURE__ */ o.jsxs("div", { className: "mb-6 bg-[#F1ECFB] p-3 rounded-xl", children: [
1847
+ e && /* @__PURE__ */ o.jsxs("div", { className: "mb-6 p-4 rounded-lg", children: [
1848
+ /* @__PURE__ */ o.jsxs("p", { className: "text-lg text-gray-800 font-semibold", children: [
2198
1849
  "PAY: ",
2199
- r
1850
+ a
2200
1851
  ] }),
2201
- /* @__PURE__ */ i.jsxs("div", { className: "flex justify-between items-center mt-2 bg-gray-100 px-3 rounded-lg", children: [
2202
- /* @__PURE__ */ i.jsx("span", { className: "font-medium text-gray-700", children: "Amount:" }),
2203
- /* @__PURE__ */ i.jsxs("span", { className: "font-bold text-xl text-[#7042D2]", children: [
1852
+ /* @__PURE__ */ o.jsxs("div", { className: "flex justify-between items-center mt-2 bg-gray-100 px-3 rounded-lg", children: [
1853
+ /* @__PURE__ */ o.jsx("span", { className: "font-medium text-gray-700", children: "Amount:" }),
1854
+ /* @__PURE__ */ o.jsxs("span", { className: "font-bold text-xl text-[#7042D2]", children: [
2204
1855
  "$",
2205
- x(n.totalAmount || n.amount)
1856
+ C(e.totalAmount || e.amount)
2206
1857
  ] })
2207
1858
  ] }),
2208
- /* @__PURE__ */ i.jsx("div", { className: "text-xs mt-1 text-right", children: /* @__PURE__ */ i.jsxs("span", { className: "text-gray-500", children: [
1859
+ /* @__PURE__ */ o.jsx("div", { className: "text-xs mt-1 text-right", children: /* @__PURE__ */ o.jsxs("span", { className: "text-gray-500", children: [
2209
1860
  "Payment ID: ",
2210
- n.id ? n.id.slice(0, 8) : "",
1861
+ e.id ? e.id.slice(0, 8) : "",
2211
1862
  "..."
2212
1863
  ] }) })
2213
1864
  ] }),
2214
- N === "select-currency" && /* @__PURE__ */ i.jsx(
2215
- Lr,
2216
- {
2217
- onSelect: m,
2218
- selected: h,
2219
- theme: s,
2220
- supportedNetworks: p
2221
- }
2222
- ),
2223
- N === "confirm" && h && n && /* @__PURE__ */ i.jsxs("div", { children: [
2224
- /* @__PURE__ */ i.jsxs("div", { className: "p-4 rounded-lg mb-4 bg-gray-100", children: [
2225
- /* @__PURE__ */ i.jsx("h3", { className: "text-lg font-medium mb-2 text-gray-800", children: "Payment Details" }),
2226
- /* @__PURE__ */ i.jsxs("div", { className: "space-y-2", children: [
2227
- /* @__PURE__ */ i.jsxs("div", { className: "flex justify-between", children: [
2228
- /* @__PURE__ */ i.jsx("span", { className: "text-[#7042D2] font-semibold", children: "Currency:" }),
2229
- /* @__PURE__ */ i.jsx("span", { className: "font-medium", children: h.currency })
1865
+ w === "select-currency" && /* @__PURE__ */ o.jsxs("div", { children: [
1866
+ /* @__PURE__ */ o.jsx(
1867
+ St,
1868
+ {
1869
+ onSelect: u,
1870
+ selected: c,
1871
+ theme: n,
1872
+ supportedNetworks: m
1873
+ }
1874
+ ),
1875
+ c && /* @__PURE__ */ o.jsx("div", { className: "mt-6", children: /* @__PURE__ */ o.jsxs(
1876
+ "button",
1877
+ {
1878
+ onClick: () => u(c),
1879
+ className: "w-full py-3 px-4 bg-[#7042D2] hover:bg-[#7042D2] text-white font-medium rounded-lg transition-colors",
1880
+ children: [
1881
+ "Proceed with ",
1882
+ c.currency,
1883
+ " on ",
1884
+ H(c.network)
1885
+ ]
1886
+ }
1887
+ ) })
1888
+ ] }),
1889
+ w === "confirm" && c && e && /* @__PURE__ */ o.jsxs("div", { children: [
1890
+ /* @__PURE__ */ o.jsxs("div", { className: "p-4 rounded-lg mb-4 bg-gray-100", children: [
1891
+ /* @__PURE__ */ o.jsx("h3", { className: "text-lg font-medium mb-2 text-gray-800", children: "Payment Details" }),
1892
+ /* @__PURE__ */ o.jsxs("div", { className: "space-y-2", children: [
1893
+ /* @__PURE__ */ o.jsxs("div", { className: "flex justify-between", children: [
1894
+ /* @__PURE__ */ o.jsx("span", { className: "text-[#7042D2] font-semibold", children: "Currency:" }),
1895
+ /* @__PURE__ */ o.jsx("span", { className: "font-medium", children: c.currency })
2230
1896
  ] }),
2231
- /* @__PURE__ */ i.jsxs("div", { className: "flex justify-between", children: [
2232
- /* @__PURE__ */ i.jsx("span", { className: "text-[#7042D2] font-semibold", children: "Network:" }),
2233
- /* @__PURE__ */ i.jsx("span", { className: "font-medium", children: I(h.network) })
1897
+ /* @__PURE__ */ o.jsxs("div", { className: "flex justify-between", children: [
1898
+ /* @__PURE__ */ o.jsx("span", { className: "text-[#7042D2] font-semibold", children: "Network:" }),
1899
+ /* @__PURE__ */ o.jsx("span", { className: "font-medium", children: H(c.network) })
2234
1900
  ] }),
2235
- /* @__PURE__ */ i.jsxs("div", { className: "flex justify-between", children: [
2236
- /* @__PURE__ */ i.jsx("span", { className: "text-[#7042D2] font-semibold", children: "Fee:" }),
2237
- /* @__PURE__ */ i.jsx("span", { className: "font-medium", children: "1.75%" })
1901
+ /* @__PURE__ */ o.jsxs("div", { className: "flex justify-between", children: [
1902
+ /* @__PURE__ */ o.jsx("span", { className: "text-[#7042D2] font-semibold", children: "Fee:" }),
1903
+ /* @__PURE__ */ o.jsx("span", { className: "font-medium", children: "1.75%" })
2238
1904
  ] })
2239
1905
  ] })
2240
1906
  ] }),
2241
- u ? (
1907
+ /* @__PURE__ */ o.jsx("div", { className: "mb-4", children: /* @__PURE__ */ o.jsxs("div", { className: "flex border-b border-gray-200", children: [
1908
+ /* @__PURE__ */ o.jsx(
1909
+ "button",
1910
+ {
1911
+ onClick: () => T("wallet"),
1912
+ className: `py-2 px-4 text-sm font-medium ${p === "wallet" ? "border-b-2 border-[#7042D2] text-[#7042D2]" : "text-gray-500 hover:text-gray-700"}`,
1913
+ children: "Connect Wallet"
1914
+ }
1915
+ ),
1916
+ /* @__PURE__ */ o.jsx(
1917
+ "button",
1918
+ {
1919
+ onClick: () => T("qrcode"),
1920
+ className: `py-2 px-4 text-sm font-medium ${p === "qrcode" ? "border-b-2 border-[#7042D2] text-[#7042D2]" : "text-gray-500 hover:text-gray-700"}`,
1921
+ children: "QR Code"
1922
+ }
1923
+ )
1924
+ ] }) }),
1925
+ h ? (
2242
1926
  // Test mode payment option
2243
- /* @__PURE__ */ i.jsx("div", { className: "p-4 rounded-lg mb-4 bg-blue-50", children: /* @__PURE__ */ i.jsxs("div", { className: "flex items-center", children: [
2244
- /* @__PURE__ */ i.jsx("div", { className: "bg-[#7042D2] rounded-full p-2 mr-3", children: /* @__PURE__ */ i.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__ */ i.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13 10V3L4 14h7v7l9-11h-7z" }) }) }),
2245
- /* @__PURE__ */ i.jsxs("div", { children: [
2246
- /* @__PURE__ */ i.jsx("h3", { className: "font-medium text-gray-800", children: "Test Mode Payment" }),
2247
- /* @__PURE__ */ i.jsx("p", { className: "text-sm text-gray-600", children: 'Click "Pay Now" to simulate a successful payment' })
1927
+ /* @__PURE__ */ o.jsx("div", { className: "p-4 rounded-lg mb-4 bg-blue-50", children: /* @__PURE__ */ o.jsxs("div", { className: "flex items-center", children: [
1928
+ /* @__PURE__ */ o.jsx("div", { className: "bg-[#7042D2] rounded-full p-2 mr-3", children: /* @__PURE__ */ o.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__ */ o.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13 10V3L4 14h7v7l9-11h-7z" }) }) }),
1929
+ /* @__PURE__ */ o.jsxs("div", { children: [
1930
+ /* @__PURE__ */ o.jsx("h3", { className: "font-medium text-gray-800", children: "Test Mode Payment" }),
1931
+ /* @__PURE__ */ o.jsx("p", { className: "text-sm text-gray-600", children: 'Click "Pay Now" to simulate a successful payment' })
2248
1932
  ] })
2249
1933
  ] }) })
1934
+ ) : p === "qrcode" ? (
1935
+ // QR Code payment option
1936
+ /* @__PURE__ */ o.jsx("div", { className: "mb-4", children: /* @__PURE__ */ o.jsx(
1937
+ Rt,
1938
+ {
1939
+ walletAddress: e.recipientWallet || "No address configured",
1940
+ amount: e.totalAmount || e.amount,
1941
+ currency: c.currency,
1942
+ network: c.network,
1943
+ theme: n
1944
+ }
1945
+ ) })
2250
1946
  ) : (
2251
- // Real wallet connection
2252
- /* @__PURE__ */ i.jsxs("div", { className: "space-y-3", children: [
2253
- /* @__PURE__ */ i.jsx("h4", { className: "font-medium text-gray-800", children: "Select Wallet:" }),
2254
- T.length === 0 ? /* @__PURE__ */ i.jsx("div", { className: "p-4 rounded-lg bg-yellow-50", children: /* @__PURE__ */ i.jsxs("div", { className: "flex items-center", children: [
2255
- /* @__PURE__ */ i.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__ */ i.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" }) }),
2256
- /* @__PURE__ */ i.jsxs("div", { children: [
2257
- /* @__PURE__ */ i.jsx("h3", { className: "font-medium text-gray-800", children: "No Compatible Wallets" }),
2258
- /* @__PURE__ */ i.jsxs("p", { className: "text-sm text-gray-600", children: [
1947
+ // Wallet connection option
1948
+ /* @__PURE__ */ o.jsxs("div", { className: "space-y-3 mb-4", children: [
1949
+ k.length === 0 ? /* @__PURE__ */ o.jsx("div", { className: "p-4 rounded-lg bg-yellow-50", children: /* @__PURE__ */ o.jsxs("div", { className: "flex items-center", children: [
1950
+ /* @__PURE__ */ o.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__ */ o.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" }) }),
1951
+ /* @__PURE__ */ o.jsxs("div", { children: [
1952
+ /* @__PURE__ */ o.jsx("h3", { className: "font-medium text-gray-800", children: "No Compatible Wallets" }),
1953
+ /* @__PURE__ */ o.jsxs("p", { className: "text-sm text-gray-600", children: [
2259
1954
  "No wallets detected for ",
2260
- I(h.network),
1955
+ H(c.network),
2261
1956
  " network"
2262
1957
  ] })
2263
1958
  ] })
2264
- ] }) }) : T.map((R) => /* @__PURE__ */ i.jsx("div", { className: "p-4 rounded-lg bg-blue-50", children: /* @__PURE__ */ i.jsxs("div", { className: "flex items-center justify-between", children: [
2265
- /* @__PURE__ */ i.jsxs("div", { className: "flex items-center", children: [
2266
- /* @__PURE__ */ i.jsx(
1959
+ ] }) }) : k.map((v) => /* @__PURE__ */ o.jsx("div", { className: "p-4 rounded-lg bg-blue-50", children: /* @__PURE__ */ o.jsxs("div", { className: "flex items-center justify-between", children: [
1960
+ /* @__PURE__ */ o.jsxs("div", { className: "flex items-center", children: [
1961
+ /* @__PURE__ */ o.jsx(
2267
1962
  "img",
2268
1963
  {
2269
- src: ae(R),
2270
- alt: Z(R),
2271
- className: "w-8 h-8 mr-2",
2272
- onError: (P) => {
2273
- P.target.style.display = "none";
1964
+ src: M(v),
1965
+ alt: O(v),
1966
+ className: "w-8 h-8 mr-3",
1967
+ onError: (S) => {
1968
+ S.target.style.display = "none";
2274
1969
  }
2275
1970
  }
2276
1971
  ),
2277
- /* @__PURE__ */ i.jsxs("div", { children: [
2278
- /* @__PURE__ */ i.jsx("h3", { className: "font-medium text-gray-800", children: Z(R) }),
2279
- /* @__PURE__ */ i.jsxs("p", { className: "text-sm text-gray-600", children: [
1972
+ /* @__PURE__ */ o.jsxs("div", { children: [
1973
+ /* @__PURE__ */ o.jsx("h3", { className: "font-medium text-gray-800", children: O(v) }),
1974
+ /* @__PURE__ */ o.jsxs("p", { className: "text-sm text-gray-600", children: [
2280
1975
  "Pay with ",
2281
- Z(R)
1976
+ O(v)
2282
1977
  ] })
2283
1978
  ] })
2284
1979
  ] }),
2285
- (c == null ? void 0 : c.walletType) === R ? /* @__PURE__ */ i.jsxs("div", { className: "flex items-center space-x-2", children: [
2286
- /* @__PURE__ */ i.jsx("div", { className: "w-2 h-2 bg-green-500 rounded-full" }),
2287
- /* @__PURE__ */ i.jsx("span", { className: "text-sm text-green-600", children: "Connected" })
2288
- ] }) : /* @__PURE__ */ i.jsx(
1980
+ (d == null ? void 0 : d.walletType) === v ? /* @__PURE__ */ o.jsxs("div", { className: "flex items-center space-x-2", children: [
1981
+ /* @__PURE__ */ o.jsx("div", { className: "w-2 h-2 bg-green-500 rounded-full" }),
1982
+ /* @__PURE__ */ o.jsx("span", { className: "text-sm text-green-600", children: "Connected" })
1983
+ ] }) : /* @__PURE__ */ o.jsx(
2289
1984
  "button",
2290
1985
  {
2291
- onClick: () => w(R),
2292
- className: "py-2 px-4 bg-[#7042D2] hover:bg-[#7042D2] text-white font-medium rounded-md",
1986
+ onClick: () => g(v),
1987
+ className: "py-2 px-4 bg-[#7042D2] hover:bg-[#7042D2] text-white font-medium rounded-md text-sm",
2293
1988
  children: "Connect"
2294
1989
  }
2295
1990
  )
2296
- ] }) }, R)),
2297
- /* @__PURE__ */ i.jsx("div", { className: "space-y-2", children: Object.entries(v).filter(([R, P]) => !P).map(([R]) => /* @__PURE__ */ i.jsx("div", { className: "p-3 rounded-lg bg-gray-50", children: /* @__PURE__ */ i.jsxs("div", { className: "flex items-center justify-between", children: [
2298
- /* @__PURE__ */ i.jsxs("span", { className: "text-sm text-gray-600", children: [
2299
- Z(R),
1991
+ ] }) }, v)),
1992
+ /* @__PURE__ */ o.jsx("div", { className: "space-y-2", children: Object.entries(f).filter(([v, S]) => !S).map(([v]) => /* @__PURE__ */ o.jsx("div", { className: "p-3 rounded-lg bg-gray-50", children: /* @__PURE__ */ o.jsxs("div", { className: "flex items-center justify-between", children: [
1993
+ /* @__PURE__ */ o.jsxs("span", { className: "text-sm text-gray-600", children: [
1994
+ O(v),
2300
1995
  " not detected"
2301
1996
  ] }),
2302
- /* @__PURE__ */ i.jsx(
1997
+ /* @__PURE__ */ o.jsx(
2303
1998
  "a",
2304
1999
  {
2305
- href: Or(R),
2000
+ href: ct(v),
2306
2001
  target: "_blank",
2307
2002
  rel: "noopener noreferrer",
2308
2003
  className: "text-sm text-[#7042D2] hover:underline",
2309
2004
  children: "Install"
2310
2005
  }
2311
2006
  )
2312
- ] }) }, R)) })
2007
+ ] }) }, v)) })
2313
2008
  ] })
2314
2009
  ),
2315
- /* @__PURE__ */ i.jsxs("div", { className: "mt-6 grid grid-cols-2 gap-3", children: [
2316
- /* @__PURE__ */ i.jsx(
2010
+ /* @__PURE__ */ o.jsxs("div", { className: "grid grid-cols-2 gap-3", children: [
2011
+ /* @__PURE__ */ o.jsx(
2317
2012
  "button",
2318
2013
  {
2319
2014
  type: "button",
2320
- onClick: y,
2015
+ onClick: x,
2321
2016
  className: "w-full py-2 px-4 bg-gray-200 hover:bg-gray-300 text-[#7042D2] font-medium rounded-md",
2322
2017
  children: "Back"
2323
2018
  }
2324
2019
  ),
2325
- /* @__PURE__ */ i.jsx(
2020
+ /* @__PURE__ */ o.jsx(
2326
2021
  "button",
2327
2022
  {
2328
2023
  type: "button",
2329
- onClick: b,
2024
+ onClick: () => y(p === "qrcode"),
2330
2025
  className: "w-full py-2 px-4 bg-[#7042D2] hover:bg-[#7042D2] text-white font-medium rounded-md",
2331
- disabled: !u && !c,
2332
- children: "Pay Now"
2026
+ disabled: !h && p === "wallet" && !d,
2027
+ children: p === "qrcode" ? "I have sent the payment" : "Pay Now"
2333
2028
  }
2334
2029
  )
2335
2030
  ] })
2336
2031
  ] }),
2337
- N === "processing" && /* @__PURE__ */ i.jsx(
2338
- We,
2032
+ w === "processing" && /* @__PURE__ */ o.jsx(
2033
+ ie,
2339
2034
  {
2340
2035
  status: "processing",
2341
- theme: s,
2036
+ theme: n,
2342
2037
  message: "Processing your payment..."
2343
2038
  }
2344
2039
  ),
2345
- N === "success" && /* @__PURE__ */ i.jsxs("div", { children: [
2346
- /* @__PURE__ */ i.jsx(
2347
- We,
2040
+ w === "success" && /* @__PURE__ */ o.jsxs("div", { children: [
2041
+ /* @__PURE__ */ o.jsx(
2042
+ ie,
2348
2043
  {
2349
2044
  status: "success",
2350
- theme: s,
2045
+ theme: n,
2351
2046
  message: "Payment successful!"
2352
2047
  }
2353
2048
  ),
2354
- l && /* @__PURE__ */ i.jsxs("div", { className: "mt-4 p-3 rounded-lg bg-gray-100", children: [
2355
- /* @__PURE__ */ i.jsx("p", { className: "text-xs text-gray-600 mb-1", children: "Transaction Hash:" }),
2356
- /* @__PURE__ */ i.jsx("p", { className: "text-sm font-mono break-all text-gray-800", children: D(l) }),
2357
- h && /* @__PURE__ */ i.jsx(
2049
+ l && /* @__PURE__ */ o.jsxs("div", { className: "mt-4 p-3 rounded-lg bg-gray-100", children: [
2050
+ /* @__PURE__ */ o.jsx("p", { className: "text-xs text-gray-600 mb-1", children: "Transaction Hash:" }),
2051
+ /* @__PURE__ */ o.jsx("p", { className: "text-sm font-mono break-all text-gray-800", children: q(l) }),
2052
+ c && /* @__PURE__ */ o.jsx(
2358
2053
  "a",
2359
2054
  {
2360
- href: `${Fr(h.network)}/tx/${l}`,
2055
+ href: `${Dt(c.network)}/${Ut(c.network)}/${l}`,
2361
2056
  target: "_blank",
2362
2057
  rel: "noopener noreferrer",
2363
2058
  className: "text-xs text-[#7042D2] mt-2 inline-block",
@@ -2366,207 +2061,225 @@ const Nr = () => G(void 0, null, function* () {
2366
2061
  )
2367
2062
  ] })
2368
2063
  ] }),
2369
- N === "error" && /* @__PURE__ */ i.jsxs("div", { children: [
2370
- /* @__PURE__ */ i.jsx(
2371
- We,
2064
+ w === "error" && /* @__PURE__ */ o.jsxs("div", { children: [
2065
+ /* @__PURE__ */ o.jsx(
2066
+ ie,
2372
2067
  {
2373
2068
  status: "error",
2374
- theme: s,
2375
- message: t || "An error occurred while processing your payment."
2069
+ theme: n,
2070
+ message: r || "An error occurred while processing your payment."
2376
2071
  }
2377
2072
  ),
2378
- /* @__PURE__ */ i.jsx(
2073
+ /* @__PURE__ */ o.jsx(
2379
2074
  "button",
2380
2075
  {
2381
2076
  type: "button",
2382
- onClick: y,
2077
+ onClick: x,
2383
2078
  className: "mt-4 w-full py-2 px-4 bg-gray-200 hover:bg-gray-300 text-gray-800 font-medium rounded-md",
2384
2079
  children: "Try Again"
2385
2080
  }
2386
2081
  )
2387
2082
  ] })
2388
2083
  ] }),
2389
- /* @__PURE__ */ i.jsx("div", { className: "text-center text-xs text-gray-500", children: /* @__PURE__ */ i.jsxs("p", { children: [
2084
+ /* @__PURE__ */ o.jsx("div", { className: "text-center text-xs text-gray-500", children: /* @__PURE__ */ o.jsxs("p", { children: [
2390
2085
  "Powered by ",
2391
- /* @__PURE__ */ i.jsx("span", { className: "text-[#7042D2]", children: "Coinley" }),
2086
+ /* @__PURE__ */ o.jsx("span", { className: "text-[#7042D2]", children: "Coinley" }),
2392
2087
  " - Secure Cryptocurrency Payments"
2393
2088
  ] }) })
2394
2089
  ] }) }) }) : null;
2395
- }, Fr = (o) => ({
2090
+ }, Dt = (s) => ({
2396
2091
  ethereum: "https://etherscan.io",
2397
2092
  bsc: "https://bscscan.com",
2398
2093
  tron: "https://tronscan.org",
2399
2094
  algorand: "https://algoexplorer.io"
2400
- })[o] || "https://etherscan.io", Ur = nr(({
2401
- apiKey: o,
2402
- apiSecret: a,
2403
- apiUrl: n,
2404
- customerEmail: d,
2405
- merchantName: h = "Merchant",
2406
- merchantWalletAddresses: m = {},
2095
+ })[s] || "https://etherscan.io", Ut = (s) => ({
2096
+ ethereum: "tx",
2097
+ bsc: "tx",
2098
+ tron: "transaction",
2099
+ algorand: "tx"
2100
+ })[s] || "tx", Ot = _e(({
2101
+ apiKey: s,
2102
+ apiSecret: t,
2103
+ apiUrl: e,
2104
+ customerEmail: i,
2105
+ merchantName: c = "Merchant",
2106
+ merchantWalletAddresses: u = {},
2407
2107
  // Object with network-specific addresses
2408
- onSuccess: b,
2409
- onError: y,
2410
- onClose: t,
2411
- theme: s,
2412
- autoOpen: r = !1,
2108
+ onSuccess: y,
2109
+ onError: x,
2110
+ onClose: r,
2111
+ theme: n,
2112
+ autoOpen: a = !1,
2413
2113
  debug: l = !1,
2414
- testMode: c = !1,
2415
- supportedNetworks: w = [],
2114
+ testMode: d = !1,
2115
+ supportedNetworks: g = [],
2416
2116
  // Array of supported networks
2417
- preferredNetwork: u = k.ETHEREUM,
2418
- preferredWallet: p = C.METAMASK
2419
- }, v) => {
2420
- const T = fr(), { theme: N } = dr(), [x, D] = H(r), [I, Z] = H(null), [ae, R] = H("idle"), [P, oe] = H(null), [K, $] = H(null), [Y, Q] = H(null), [F, se] = H(null), [ne, ue] = H({}), [ie, ee] = H("select-currency");
2421
- o || (T == null || T.apiKey), a || (T == null || T.apiSecret), n || (T == null || T.apiUrl);
2422
- const me = s || N, de = l || (T == null ? void 0 : T.debug), ge = w.length > 0 ? w : [k.ETHEREUM, k.BSC, k.TRON, k.ALGORAND];
2423
- sr(v, () => ({
2424
- open: (O) => {
2425
- Pe(O);
2117
+ preferredNetwork: h = b.ETHEREUM,
2118
+ preferredWallet: m = N.METAMASK
2119
+ }, f) => {
2120
+ const k = bt(), { theme: w } = yt(), [p, T] = D(a), [C, q] = D(null), [H, O] = D("idle"), [M, v] = D(null), [S, B] = D(null), [ee, W] = D(null), [I, V] = D(null), [$, te] = D({}), [X, G] = D("select-currency");
2121
+ s || (k == null || k.apiKey), t || (k == null || k.apiSecret), e || (k == null || k.apiUrl);
2122
+ const oe = n || w, re = l || (k == null ? void 0 : k.debug), ae = g.length > 0 ? g : [b.ETHEREUM, b.BSC, b.TRON, b.ALGORAND];
2123
+ Je(f, () => ({
2124
+ open: (A) => {
2125
+ Ie(A);
2426
2126
  },
2427
2127
  close: () => {
2428
- pe();
2128
+ he();
2429
2129
  },
2430
- getPayment: () => I,
2431
- getWalletConnection: () => F
2130
+ getPayment: () => C,
2131
+ getWalletConnection: () => I
2432
2132
  }));
2433
- const _ = (O, V) => {
2434
- de && console.log(`[Coinley SDK] ${O}`, V);
2133
+ const P = (A, F) => {
2134
+ re && console.log(`[Coinley SDK] ${A}`, F);
2435
2135
  };
2436
- je(() => {
2136
+ Z(() => {
2437
2137
  if (typeof window != "undefined") {
2438
- const O = He();
2439
- ue(O), _("Available wallets detected:", O);
2138
+ const A = ue();
2139
+ te(A), P("Available wallets detected:", A);
2440
2140
  }
2441
- }, [de]);
2442
- const Pe = (O) => G(void 0, null, function* () {
2443
- if (!O || !O.amount) {
2444
- $("Payment amount is required"), y && y(new Error("Payment amount is required"));
2141
+ }, [re]);
2142
+ const Ie = (A) => R(void 0, null, function* () {
2143
+ if (!A || !A.amount) {
2144
+ B("Payment amount is required"), x && x(new Error("Payment amount is required"));
2445
2145
  return;
2446
2146
  }
2447
- R("loading"), D(!0), ee("select-currency");
2147
+ O("loading"), T(!0), G("select-currency");
2448
2148
  try {
2449
- _("Creating payment with details:", O);
2450
- const V = yield or({
2451
- amount: O.amount,
2452
- currency: O.currency || "USDT",
2453
- network: O.network || u,
2454
- customerEmail: O.customerEmail || d,
2455
- callbackUrl: O.callbackUrl,
2456
- metadata: O.metadata || {},
2457
- merchantWalletAddresses: ce(ce({}, m), O.merchantWalletAddresses)
2149
+ P("Creating payment with details:", A);
2150
+ const F = yield ut({
2151
+ amount: A.amount,
2152
+ currency: A.currency || "USDT",
2153
+ network: A.network || h,
2154
+ customerEmail: A.customerEmail || i,
2155
+ callbackUrl: A.callbackUrl,
2156
+ metadata: A.metadata || {},
2157
+ merchantWalletAddresses: z(z({}, u), A.merchantWalletAddresses)
2458
2158
  });
2459
- _("Payment created:", V), Z(V.payment), R("idle"), $(null), _("Payment created and state updated");
2460
- } catch (V) {
2461
- _("Error creating payment:", V), $(V.message || "Failed to create payment"), R("error"), y && y(V);
2462
- }
2463
- }), pe = () => {
2464
- D(!1), Q(null), se(null), oe(null), ee("select-currency"), t && t();
2465
- }, Ne = (O) => {
2466
- _("Payment method selected:", O), oe(O), ee("confirm");
2467
- }, we = () => {
2468
- ie === "confirm" && (ee("select-currency"), se(null));
2469
- }, Re = (O) => G(void 0, null, function* () {
2470
- if (!P) {
2471
- $("Please select a payment method first");
2159
+ P("Payment created:", F), q(F.payment), O("idle"), B(null), P("Payment created and state updated");
2160
+ } catch (F) {
2161
+ P("Error creating payment:", F), B(F.message || "Failed to create payment"), O("error"), x && x(F);
2162
+ }
2163
+ }), he = () => {
2164
+ T(!1), W(null), V(null), v(null), G("select-currency"), r && r();
2165
+ }, Fe = (A) => {
2166
+ P("Payment method selected:", A), v(A), G("confirm");
2167
+ }, Be = () => {
2168
+ X === "confirm" && (G("select-currency"), V(null));
2169
+ }, We = (A) => R(void 0, null, function* () {
2170
+ if (!M) {
2171
+ B("Please select a payment method first");
2472
2172
  return;
2473
2173
  }
2474
2174
  try {
2475
- _("Connecting wallet:", { walletType: O, network: P.network });
2476
- const V = yield Rr(O, P.network);
2477
- se(V), $(null), _("Wallet connected successfully:", V);
2478
- } catch (V) {
2479
- _("Wallet connection error:", V), $(V.message || "Failed to connect wallet");
2480
- }
2481
- }), ye = () => G(void 0, null, function* () {
2482
- var O, V;
2483
- if (!I || !P) {
2484
- $("Missing payment information");
2175
+ P("Connecting wallet:", { walletType: A, network: M.network });
2176
+ const F = yield et(A, M.network);
2177
+ V(F), B(null), P("Wallet connected successfully:", F);
2178
+ } catch (F) {
2179
+ P("Wallet connection error:", F), B(F.message || "Failed to connect wallet");
2180
+ }
2181
+ }), Qe = () => R(void 0, null, function* () {
2182
+ var A, F;
2183
+ if (!C || !M) {
2184
+ B("Missing payment information");
2485
2185
  return;
2486
2186
  }
2487
- if (!F && !c) {
2488
- $("Please connect your wallet first");
2187
+ if (!I && !d) {
2188
+ B("Please connect your wallet first");
2489
2189
  return;
2490
2190
  }
2491
- _("Starting payment process..."), R("loading"), Q(null);
2191
+ P("Starting payment process..."), O("loading"), W(null);
2492
2192
  try {
2493
- let te;
2494
- if (c)
2495
- _("Test mode: Generating mock transaction..."), te = `test_${Date.now().toString(16)}_${Math.random().toString(16).substring(2, 10)}`;
2193
+ let Q;
2194
+ if (d)
2195
+ P("Test mode: Generating mock transaction..."), Q = `test_${Date.now().toString(16)}_${Math.random().toString(16).substring(2, 10)}`;
2496
2196
  else {
2497
- const le = m[P.network];
2498
- if (!le)
2499
- throw new Error(`No merchant wallet address configured for ${P.network}`);
2500
- _("Sending transaction through wallet..."), te = yield Sr(F, {
2501
- to: le,
2502
- amount: I.amount,
2503
- tokenAddress: (O = P.tokenConfig) == null ? void 0 : O.address,
2504
- tokenDecimals: (V = P.tokenConfig) == null ? void 0 : V.decimals
2197
+ const me = u[M.network];
2198
+ if (!me)
2199
+ throw new Error(`No merchant wallet address configured for ${M.network}`);
2200
+ P("Sending transaction through wallet..."), Q = yield ot(I, {
2201
+ to: me,
2202
+ amount: C.amount,
2203
+ tokenAddress: (A = M.tokenConfig) == null ? void 0 : A.address,
2204
+ tokenDecimals: (F = M.tokenConfig) == null ? void 0 : F.decimals
2505
2205
  });
2506
2206
  }
2507
- _("Transaction hash:", te), Q(te), _("Processing payment with backend...");
2508
- const ve = yield ir({
2509
- paymentId: I.id,
2510
- transactionHash: te,
2511
- network: P.network,
2512
- currency: P.currency,
2513
- senderAddress: F == null ? void 0 : F.address
2207
+ P("Transaction hash:", Q), W(Q), P("Processing payment with backend...");
2208
+ const Ge = yield ht({
2209
+ paymentId: C.id,
2210
+ transactionHash: Q,
2211
+ network: M.network,
2212
+ currency: M.currency,
2213
+ senderAddress: I == null ? void 0 : I.address
2514
2214
  });
2515
- _("Payment processed successfully:", ve), R("success"), ee("success"), b && (_("Calling onSuccess callback..."), b(I.id, te, {
2516
- network: P.network,
2517
- currency: P.currency,
2518
- amount: I.amount
2215
+ P("Payment processed successfully:", Ge), O("success"), G("success"), y && (P("Calling onSuccess callback..."), y(C.id, Q, {
2216
+ network: M.network,
2217
+ currency: M.currency,
2218
+ amount: C.amount
2519
2219
  }));
2520
- } catch (te) {
2521
- _("Payment error:", te), $(te.message || "Failed to process payment"), R("error"), ee("error"), y && y(te);
2220
+ } catch (Q) {
2221
+ P("Payment error:", Q), B(Q.message || "Failed to process payment"), O("error"), G("error"), x && x(Q);
2522
2222
  }
2523
- }), Oe = () => P ? jt(P.network) : [];
2524
- return /* @__PURE__ */ i.jsx(i.Fragment, { children: x && /* @__PURE__ */ i.jsx(
2525
- Ir,
2223
+ }), ze = () => M ? Ze(M.network) : [];
2224
+ return /* @__PURE__ */ o.jsx(o.Fragment, { children: p && /* @__PURE__ */ o.jsx(
2225
+ Pt,
2526
2226
  {
2527
- isOpen: x,
2528
- onClose: pe,
2529
- payment: I,
2530
- paymentStatus: ae,
2531
- selectedPaymentMethod: P,
2532
- onPaymentMethodSelect: Ne,
2533
- onPayment: ye,
2534
- onBack: we,
2535
- error: K,
2536
- theme: me,
2537
- merchantName: h,
2538
- transactionHash: Y,
2539
- walletConnection: F,
2540
- onConnectWallet: Re,
2541
- testMode: c,
2542
- supportedNetworks: ge,
2543
- availableWallets: ne,
2544
- supportedWallets: Oe(),
2545
- step: ie
2227
+ isOpen: p,
2228
+ onClose: he,
2229
+ payment: C,
2230
+ paymentStatus: H,
2231
+ selectedPaymentMethod: M,
2232
+ onPaymentMethodSelect: Fe,
2233
+ onPayment: Qe,
2234
+ onBack: Be,
2235
+ error: S,
2236
+ theme: oe,
2237
+ merchantName: c,
2238
+ transactionHash: ee,
2239
+ walletConnection: I,
2240
+ onConnectWallet: We,
2241
+ testMode: d,
2242
+ supportedNetworks: ae,
2243
+ availableWallets: $,
2244
+ supportedWallets: ze(),
2245
+ step: X
2546
2246
  }
2547
2247
  ) });
2548
2248
  });
2549
- Ur.displayName = "CoinleyCheckout";
2550
- const Yr = {
2551
- apiUrl: "https://coinleyserver-production.up.railway.app",
2249
+ Ot.displayName = "CoinleyCheckout";
2250
+ const Vt = {
2251
+ apiUrl: "http://localhost:9000",
2552
2252
  debug: !1,
2553
2253
  testMode: !1,
2554
- theme: "light"
2555
- }, qr = "0.3.0";
2254
+ theme: "light",
2255
+ supportedNetworks: ["ethereum", "bsc", "tron", "algorand"]
2256
+ }, _t = "0.3.2";
2556
2257
  export {
2557
- Ur as CoinleyCheckout,
2558
- Ir as CoinleyModal,
2559
- Vr as CoinleyProvider,
2560
- Yr as DEFAULT_CONFIG,
2561
- Lr as PaymentMethods,
2562
- We as PaymentStatus,
2563
- Kr as QRCode,
2564
- Qr as ThemeProvider,
2565
- qr as VERSION,
2566
- zr as connectWallet,
2567
- or as createPayment,
2568
- Br as getPayment,
2569
- lr as isMetaMaskInstalled,
2570
- ir as processPayment
2258
+ Ot as CoinleyCheckout,
2259
+ Pt as CoinleyModal,
2260
+ Ht as CoinleyProvider,
2261
+ Vt as DEFAULT_CONFIG,
2262
+ de as NETWORK_CONFIG,
2263
+ b as NETWORK_TYPES,
2264
+ St as PaymentMethods,
2265
+ ie as PaymentStatus,
2266
+ Rt as QRCode,
2267
+ Ye as TOKEN_CONFIG,
2268
+ qt as ThemeProvider,
2269
+ _t as VERSION,
2270
+ N as WALLET_TYPES,
2271
+ et as connectWallet,
2272
+ ut as createPayment,
2273
+ ue as detectWallets,
2274
+ Gt as generateMockTransactionHash,
2275
+ Qt as getMerchantProfile,
2276
+ Bt as getPayment,
2277
+ Wt as getSupportedNetworks,
2278
+ Ze as getSupportedWalletsForNetwork,
2279
+ ct as getWalletInstallUrl,
2280
+ ht as processPayment,
2281
+ ot as sendTransaction,
2282
+ bt as useCoinley,
2283
+ zt as validateWalletAddress
2571
2284
  };
2572
2285
  //# sourceMappingURL=coinley-checkout.es.js.map