@unifold/connect-react 0.1.9 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1190 -1094
- package/dist/index.mjs +1147 -1051
- package/dist/styles.css +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -1221,7 +1221,7 @@ function useUnifold() {
|
|
|
1221
1221
|
}
|
|
1222
1222
|
|
|
1223
1223
|
// ../ui-react/dist/index.mjs
|
|
1224
|
-
import { useState as
|
|
1224
|
+
import { useState as useState72, useEffect as useEffect62 } from "react";
|
|
1225
1225
|
|
|
1226
1226
|
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
|
|
1227
1227
|
import { forwardRef, createElement } from "react";
|
|
@@ -1265,25 +1265,12 @@ var createLucideIcon = (iconName, iconNode) => {
|
|
|
1265
1265
|
return Component;
|
|
1266
1266
|
};
|
|
1267
1267
|
|
|
1268
|
-
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/arrow-down-circle.js
|
|
1269
|
-
var ArrowDownCircle = createLucideIcon("ArrowDownCircle", [
|
|
1270
|
-
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
1271
|
-
["path", { d: "M12 8v8", key: "napkw2" }],
|
|
1272
|
-
["path", { d: "m8 12 4 4 4-4", key: "k98ssh" }]
|
|
1273
|
-
]);
|
|
1274
|
-
|
|
1275
1268
|
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/arrow-left.js
|
|
1276
1269
|
var ArrowLeft = createLucideIcon("ArrowLeft", [
|
|
1277
1270
|
["path", { d: "m12 19-7-7 7-7", key: "1l729n" }],
|
|
1278
1271
|
["path", { d: "M19 12H5", key: "x3x0zl" }]
|
|
1279
1272
|
]);
|
|
1280
1273
|
|
|
1281
|
-
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/check-circle.js
|
|
1282
|
-
var CheckCircle = createLucideIcon("CheckCircle", [
|
|
1283
|
-
["path", { d: "M22 11.08V12a10 10 0 1 1-5.93-9.14", key: "g774vq" }],
|
|
1284
|
-
["path", { d: "m9 11 3 3L22 4", key: "1pflzl" }]
|
|
1285
|
-
]);
|
|
1286
|
-
|
|
1287
1274
|
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/check.js
|
|
1288
1275
|
var Check = createLucideIcon("Check", [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]]);
|
|
1289
1276
|
|
|
@@ -1306,12 +1293,6 @@ var Clock = createLucideIcon("Clock", [
|
|
|
1306
1293
|
["polyline", { points: "12 6 12 12 16 14", key: "68esgv" }]
|
|
1307
1294
|
]);
|
|
1308
1295
|
|
|
1309
|
-
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/copy.js
|
|
1310
|
-
var Copy = createLucideIcon("Copy", [
|
|
1311
|
-
["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
|
|
1312
|
-
["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
|
|
1313
|
-
]);
|
|
1314
|
-
|
|
1315
1296
|
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/credit-card.js
|
|
1316
1297
|
var CreditCard = createLucideIcon("CreditCard", [
|
|
1317
1298
|
["rect", { width: "20", height: "14", x: "2", y: "5", rx: "2", key: "ynyp8z" }],
|
|
@@ -5957,16 +5938,234 @@ var twMerge = /* @__PURE__ */ createTailwindMerge(getDefaultConfig);
|
|
|
5957
5938
|
import * as React37 from "react";
|
|
5958
5939
|
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
5959
5940
|
import { jsx as jsx23, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
5960
|
-
import { useState as
|
|
5941
|
+
import { useState as useState42, useEffect as useEffect42 } from "react";
|
|
5961
5942
|
var import_qr_code_styling = __toESM(require_qr_code_styling(), 1);
|
|
5962
5943
|
import { useEffect as useEffect18, useRef as useRef16 } from "react";
|
|
5963
5944
|
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
5964
|
-
import { useEffect as
|
|
5945
|
+
import { useEffect as useEffect32, useState as useState22 } from "react";
|
|
5965
5946
|
import { jsx as jsx42, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
5947
|
+
|
|
5948
|
+
// ../core/dist/index.mjs
|
|
5949
|
+
import { useQuery } from "@tanstack/react-query";
|
|
5950
|
+
var API_BASE_URL = process.env.NEXT_PUBLIC_API_BASE_URL || "https://api.unifold.io";
|
|
5951
|
+
var DEFAULT_PUBLISHABLE_KEY = "pk_test_123";
|
|
5952
|
+
var DEFAULT_CONFIG = {};
|
|
5953
|
+
function validatePublishableKey(key) {
|
|
5954
|
+
if (!key || key.trim() === "") {
|
|
5955
|
+
throw new Error(
|
|
5956
|
+
"Unifold SDK: No publishable key configured. Please provide a valid publishable key via setApiConfig() or pass it directly to the API function."
|
|
5957
|
+
);
|
|
5958
|
+
}
|
|
5959
|
+
if (key === "pk_test_123") {
|
|
5960
|
+
console.warn(
|
|
5961
|
+
'Unifold SDK: Using default test key "pk_test_123". This should only be used for local development. Please use a real publishable key in production.'
|
|
5962
|
+
);
|
|
5963
|
+
}
|
|
5964
|
+
}
|
|
5965
|
+
function getIconUrl(iconPath) {
|
|
5966
|
+
const normalizedPath = iconPath.startsWith("/") ? iconPath : `/${iconPath}`;
|
|
5967
|
+
return `${API_BASE_URL}/api/public${normalizedPath}`;
|
|
5968
|
+
}
|
|
5969
|
+
function getIconUrlWithCdn(iconPath, assetCdnUrl) {
|
|
5970
|
+
if (!assetCdnUrl) {
|
|
5971
|
+
return getIconUrl(iconPath);
|
|
5972
|
+
}
|
|
5973
|
+
const normalizedPath = iconPath.startsWith("/") ? iconPath : `/${iconPath}`;
|
|
5974
|
+
const baseUrl = assetCdnUrl.endsWith("/") ? assetCdnUrl.slice(0, -1) : assetCdnUrl;
|
|
5975
|
+
return `${baseUrl}/api/public${normalizedPath}`;
|
|
5976
|
+
}
|
|
5977
|
+
async function createDepositAddress(overrides, publishableKey) {
|
|
5978
|
+
if (!overrides?.external_user_id) {
|
|
5979
|
+
throw new Error("external_user_id is required");
|
|
5980
|
+
}
|
|
5981
|
+
const payload = {
|
|
5982
|
+
external_user_id: overrides.external_user_id,
|
|
5983
|
+
destination_chain_type: overrides?.destination_chain_type || "ethereum",
|
|
5984
|
+
destination_chain_id: overrides?.destination_chain_id || DEFAULT_CONFIG.destinationChainId || "8453",
|
|
5985
|
+
destination_token_address: overrides?.destination_token_address || DEFAULT_CONFIG.destinationTokenAddress || "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
|
|
5986
|
+
recipient_address: overrides?.recipient_address || DEFAULT_CONFIG.recipientAddress || "0x309a4154a2CD4153Da886E780890C9cb5161553C",
|
|
5987
|
+
client_metadata: overrides?.client_metadata || {}
|
|
5988
|
+
};
|
|
5989
|
+
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
5990
|
+
validatePublishableKey(pk);
|
|
5991
|
+
const response = await fetch(`${API_BASE_URL}/v1/public/deposit_addresses`, {
|
|
5992
|
+
method: "POST",
|
|
5993
|
+
headers: {
|
|
5994
|
+
accept: "application/json",
|
|
5995
|
+
"x-publishable-key": pk,
|
|
5996
|
+
"Content-Type": "application/json"
|
|
5997
|
+
},
|
|
5998
|
+
body: JSON.stringify(payload)
|
|
5999
|
+
});
|
|
6000
|
+
if (!response.ok) {
|
|
6001
|
+
throw new Error(`Failed to create EOA: ${response.statusText}`);
|
|
6002
|
+
}
|
|
6003
|
+
return response.json();
|
|
6004
|
+
}
|
|
6005
|
+
function getWalletByChainType(wallets, chainType) {
|
|
6006
|
+
return wallets.find((wallet) => wallet.chain_type === chainType);
|
|
6007
|
+
}
|
|
6008
|
+
var ExecutionStatus = /* @__PURE__ */ ((ExecutionStatus2) => {
|
|
6009
|
+
ExecutionStatus2["DELAYED"] = "delayed";
|
|
6010
|
+
ExecutionStatus2["FAILED"] = "failed";
|
|
6011
|
+
ExecutionStatus2["PENDING"] = "pending";
|
|
6012
|
+
ExecutionStatus2["REFUNDED"] = "refunded";
|
|
6013
|
+
ExecutionStatus2["SUCCEEDED"] = "succeeded";
|
|
6014
|
+
ExecutionStatus2["WAITING"] = "waiting";
|
|
6015
|
+
return ExecutionStatus2;
|
|
6016
|
+
})(ExecutionStatus || {});
|
|
6017
|
+
async function queryExecutions(externalUserId, publishableKey) {
|
|
6018
|
+
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
6019
|
+
validatePublishableKey(pk);
|
|
6020
|
+
const response = await fetch(
|
|
6021
|
+
`${API_BASE_URL}/v1/public/direct_executions/query`,
|
|
6022
|
+
{
|
|
6023
|
+
method: "POST",
|
|
6024
|
+
headers: {
|
|
6025
|
+
accept: "application/json",
|
|
6026
|
+
"x-publishable-key": pk,
|
|
6027
|
+
"Content-Type": "application/json"
|
|
6028
|
+
},
|
|
6029
|
+
body: JSON.stringify({
|
|
6030
|
+
external_user_id: externalUserId
|
|
6031
|
+
})
|
|
6032
|
+
}
|
|
6033
|
+
);
|
|
6034
|
+
if (!response.ok) {
|
|
6035
|
+
throw new Error(`Failed to query executions: ${response.statusText}`);
|
|
6036
|
+
}
|
|
6037
|
+
return response.json();
|
|
6038
|
+
}
|
|
6039
|
+
async function getSupportedDepositTokens(publishableKey) {
|
|
6040
|
+
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
6041
|
+
validatePublishableKey(pk);
|
|
6042
|
+
const response = await fetch(
|
|
6043
|
+
`${API_BASE_URL}/v1/public/tokens/supported_deposit_tokens`,
|
|
6044
|
+
{
|
|
6045
|
+
method: "GET",
|
|
6046
|
+
headers: {
|
|
6047
|
+
accept: "application/json",
|
|
6048
|
+
"x-publishable-key": pk
|
|
6049
|
+
}
|
|
6050
|
+
}
|
|
6051
|
+
);
|
|
6052
|
+
if (!response.ok) {
|
|
6053
|
+
throw new Error(
|
|
6054
|
+
`Failed to fetch supported deposit tokens: ${response.statusText}`
|
|
6055
|
+
);
|
|
6056
|
+
}
|
|
6057
|
+
return response.json();
|
|
6058
|
+
}
|
|
6059
|
+
async function getMeldQuotes(request, publishableKey) {
|
|
6060
|
+
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
6061
|
+
validatePublishableKey(pk);
|
|
6062
|
+
const response = await fetch(
|
|
6063
|
+
`${API_BASE_URL}/v1/public/onramps/meld/quotes`,
|
|
6064
|
+
{
|
|
6065
|
+
method: "POST",
|
|
6066
|
+
headers: {
|
|
6067
|
+
accept: "application/json",
|
|
6068
|
+
"x-publishable-key": pk,
|
|
6069
|
+
"Content-Type": "application/json"
|
|
6070
|
+
},
|
|
6071
|
+
body: JSON.stringify(request)
|
|
6072
|
+
}
|
|
6073
|
+
);
|
|
6074
|
+
if (!response.ok) {
|
|
6075
|
+
throw new Error(`Failed to fetch Meld quotes: ${response.statusText}`);
|
|
6076
|
+
}
|
|
6077
|
+
return response.json();
|
|
6078
|
+
}
|
|
6079
|
+
async function createMeldSession(request, publishableKey) {
|
|
6080
|
+
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
6081
|
+
validatePublishableKey(pk);
|
|
6082
|
+
const response = await fetch(
|
|
6083
|
+
`${API_BASE_URL}/v1/public/onramps/meld/sessions`,
|
|
6084
|
+
{
|
|
6085
|
+
method: "POST",
|
|
6086
|
+
headers: {
|
|
6087
|
+
accept: "application/json",
|
|
6088
|
+
"x-publishable-key": pk,
|
|
6089
|
+
"Content-Type": "application/json"
|
|
6090
|
+
},
|
|
6091
|
+
body: JSON.stringify(request)
|
|
6092
|
+
}
|
|
6093
|
+
);
|
|
6094
|
+
if (!response.ok) {
|
|
6095
|
+
throw new Error(`Failed to create Meld session: ${response.statusText}`);
|
|
6096
|
+
}
|
|
6097
|
+
return response.json();
|
|
6098
|
+
}
|
|
6099
|
+
function getPreferredIconUrl(iconUrls, preferredFormat = "svg") {
|
|
6100
|
+
if (!iconUrls || iconUrls.length === 0) {
|
|
6101
|
+
return void 0;
|
|
6102
|
+
}
|
|
6103
|
+
const preferred = iconUrls.find((icon) => icon.format === preferredFormat);
|
|
6104
|
+
if (preferred) {
|
|
6105
|
+
return preferred.url;
|
|
6106
|
+
}
|
|
6107
|
+
return iconUrls[0]?.url;
|
|
6108
|
+
}
|
|
6109
|
+
async function getFiatCurrencies(publishableKey) {
|
|
6110
|
+
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
6111
|
+
validatePublishableKey(pk);
|
|
6112
|
+
const response = await fetch(
|
|
6113
|
+
`${API_BASE_URL}/v1/public/onramps/fiat_currencies`,
|
|
6114
|
+
{
|
|
6115
|
+
method: "GET",
|
|
6116
|
+
headers: {
|
|
6117
|
+
accept: "application/json",
|
|
6118
|
+
"x-publishable-key": pk
|
|
6119
|
+
}
|
|
6120
|
+
}
|
|
6121
|
+
);
|
|
6122
|
+
if (!response.ok) {
|
|
6123
|
+
throw new Error(`Failed to fetch fiat currencies: ${response.statusText}`);
|
|
6124
|
+
}
|
|
6125
|
+
return response.json();
|
|
6126
|
+
}
|
|
6127
|
+
async function getTokenChains() {
|
|
6128
|
+
const response = await fetch(`${API_BASE_URL}/v1/public/tokens/chains`, {
|
|
6129
|
+
method: "GET",
|
|
6130
|
+
headers: {
|
|
6131
|
+
accept: "application/json"
|
|
6132
|
+
}
|
|
6133
|
+
});
|
|
6134
|
+
if (!response.ok) {
|
|
6135
|
+
throw new Error(`Failed to fetch token chains: ${response.statusText}`);
|
|
6136
|
+
}
|
|
6137
|
+
return response.json();
|
|
6138
|
+
}
|
|
6139
|
+
function getChainName(chains, chainType, chainId) {
|
|
6140
|
+
const byId = chains.find((c) => c.chain_id === chainId);
|
|
6141
|
+
if (byId) return byId.chain_name;
|
|
6142
|
+
const byType = chains.find((c) => c.chain_type === chainType);
|
|
6143
|
+
if (byType) return byType.chain_name;
|
|
6144
|
+
return chainType.charAt(0).toUpperCase() + chainType.slice(1);
|
|
6145
|
+
}
|
|
6146
|
+
async function getProjectConfig(publishableKey) {
|
|
6147
|
+
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
6148
|
+
validatePublishableKey(pk);
|
|
6149
|
+
const response = await fetch(`${API_BASE_URL}/v1/public/projects/config`, {
|
|
6150
|
+
method: "GET",
|
|
6151
|
+
headers: {
|
|
6152
|
+
accept: "application/json",
|
|
6153
|
+
"x-publishable-key": pk
|
|
6154
|
+
}
|
|
6155
|
+
});
|
|
6156
|
+
if (!response.ok) {
|
|
6157
|
+
throw new Error(`Failed to fetch project config: ${response.statusText}`);
|
|
6158
|
+
}
|
|
6159
|
+
return response.json();
|
|
6160
|
+
}
|
|
6161
|
+
|
|
6162
|
+
// ../ui-react/dist/index.mjs
|
|
5966
6163
|
import { jsx as jsx52, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
6164
|
+
import { useEffect as useEffect22, useState as useState16 } from "react";
|
|
5967
6165
|
import { jsx as jsx62, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
5968
6166
|
import { Fragment as Fragment8, jsx as jsx72, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
5969
|
-
import {
|
|
6167
|
+
import { useState as useState32 } from "react";
|
|
6168
|
+
import { Fragment as Fragment23, jsx as jsx82, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
5970
6169
|
import * as React38 from "react";
|
|
5971
6170
|
|
|
5972
6171
|
// ../../node_modules/.pnpm/@radix-ui+react-select@2.2.6_@types+react-dom@18.3.7_@types+react@18.3.27__@types+react@18.3._paqmzknjxz7bmndehagaq3tw4m/node_modules/@radix-ui/react-select/dist/index.mjs
|
|
@@ -9461,202 +9660,55 @@ var Separator = SelectSeparator;
|
|
|
9461
9660
|
import { jsx as jsx92, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
9462
9661
|
import * as React42 from "react";
|
|
9463
9662
|
|
|
9464
|
-
// ../../node_modules/.pnpm/@radix-ui+react-
|
|
9663
|
+
// ../../node_modules/.pnpm/@radix-ui+react-tooltip@1.2.8_@types+react-dom@18.3.7_@types+react@18.3.27__@types+react@18.3_hd4qp76o7ebwsrfrhqb6isuuvy/node_modules/@radix-ui/react-tooltip/dist/index.mjs
|
|
9465
9664
|
import * as React35 from "react";
|
|
9466
|
-
import {
|
|
9467
|
-
var
|
|
9468
|
-
|
|
9469
|
-
|
|
9470
|
-
|
|
9471
|
-
|
|
9472
|
-
|
|
9473
|
-
|
|
9474
|
-
|
|
9475
|
-
|
|
9476
|
-
|
|
9477
|
-
|
|
9478
|
-
|
|
9479
|
-
|
|
9480
|
-
|
|
9481
|
-
|
|
9482
|
-
|
|
9483
|
-
|
|
9484
|
-
|
|
9485
|
-
|
|
9486
|
-
|
|
9487
|
-
|
|
9488
|
-
|
|
9489
|
-
|
|
9490
|
-
|
|
9491
|
-
|
|
9492
|
-
|
|
9493
|
-
|
|
9494
|
-
|
|
9495
|
-
|
|
9496
|
-
|
|
9497
|
-
|
|
9498
|
-
|
|
9499
|
-
|
|
9500
|
-
|
|
9501
|
-
|
|
9502
|
-
|
|
9503
|
-
|
|
9504
|
-
|
|
9505
|
-
|
|
9506
|
-
|
|
9507
|
-
|
|
9508
|
-
|
|
9509
|
-
|
|
9510
|
-
|
|
9511
|
-
|
|
9512
|
-
|
|
9513
|
-
if (children.type !== React35.Fragment) {
|
|
9514
|
-
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
9515
|
-
}
|
|
9516
|
-
return React35.cloneElement(children, props2);
|
|
9517
|
-
}
|
|
9518
|
-
return React35.Children.count(children) > 1 ? React35.Children.only(null) : null;
|
|
9519
|
-
});
|
|
9520
|
-
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
9521
|
-
return SlotClone;
|
|
9522
|
-
}
|
|
9523
|
-
var SLOTTABLE_IDENTIFIER2 = /* @__PURE__ */ Symbol("radix.slottable");
|
|
9524
|
-
function isSlottable2(child) {
|
|
9525
|
-
return React35.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER2;
|
|
9526
|
-
}
|
|
9527
|
-
function mergeProps2(slotProps, childProps) {
|
|
9528
|
-
const overrideProps = { ...childProps };
|
|
9529
|
-
for (const propName in childProps) {
|
|
9530
|
-
const slotPropValue = slotProps[propName];
|
|
9531
|
-
const childPropValue = childProps[propName];
|
|
9532
|
-
const isHandler = /^on[A-Z]/.test(propName);
|
|
9533
|
-
if (isHandler) {
|
|
9534
|
-
if (slotPropValue && childPropValue) {
|
|
9535
|
-
overrideProps[propName] = (...args) => {
|
|
9536
|
-
const result = childPropValue(...args);
|
|
9537
|
-
slotPropValue(...args);
|
|
9538
|
-
return result;
|
|
9539
|
-
};
|
|
9540
|
-
} else if (slotPropValue) {
|
|
9541
|
-
overrideProps[propName] = slotPropValue;
|
|
9542
|
-
}
|
|
9543
|
-
} else if (propName === "style") {
|
|
9544
|
-
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
|
|
9545
|
-
} else if (propName === "className") {
|
|
9546
|
-
overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
|
|
9547
|
-
}
|
|
9548
|
-
}
|
|
9549
|
-
return { ...slotProps, ...overrideProps };
|
|
9550
|
-
}
|
|
9551
|
-
function getElementRef3(element) {
|
|
9552
|
-
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
|
9553
|
-
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
9554
|
-
if (mayWarn) {
|
|
9555
|
-
return element.ref;
|
|
9556
|
-
}
|
|
9557
|
-
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
|
|
9558
|
-
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
9559
|
-
if (mayWarn) {
|
|
9560
|
-
return element.props.ref;
|
|
9561
|
-
}
|
|
9562
|
-
return element.props.ref || element.ref;
|
|
9563
|
-
}
|
|
9564
|
-
|
|
9565
|
-
// ../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.mjs
|
|
9566
|
-
var falsyToString = (value) => typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value;
|
|
9567
|
-
var cx = clsx;
|
|
9568
|
-
var cva = (base, config) => (props) => {
|
|
9569
|
-
var _config_compoundVariants;
|
|
9570
|
-
if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
|
|
9571
|
-
const { variants, defaultVariants } = config;
|
|
9572
|
-
const getVariantClassNames = Object.keys(variants).map((variant) => {
|
|
9573
|
-
const variantProp = props === null || props === void 0 ? void 0 : props[variant];
|
|
9574
|
-
const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];
|
|
9575
|
-
if (variantProp === null) return null;
|
|
9576
|
-
const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);
|
|
9577
|
-
return variants[variant][variantKey];
|
|
9578
|
-
});
|
|
9579
|
-
const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param) => {
|
|
9580
|
-
let [key, value] = param;
|
|
9581
|
-
if (value === void 0) {
|
|
9582
|
-
return acc;
|
|
9583
|
-
}
|
|
9584
|
-
acc[key] = value;
|
|
9585
|
-
return acc;
|
|
9586
|
-
}, {});
|
|
9587
|
-
const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (_config_compoundVariants = config.compoundVariants) === null || _config_compoundVariants === void 0 ? void 0 : _config_compoundVariants.reduce((acc, param) => {
|
|
9588
|
-
let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param;
|
|
9589
|
-
return Object.entries(compoundVariantOptions).every((param2) => {
|
|
9590
|
-
let [key, value] = param2;
|
|
9591
|
-
return Array.isArray(value) ? value.includes({
|
|
9592
|
-
...defaultVariants,
|
|
9593
|
-
...propsWithoutUndefined
|
|
9594
|
-
}[key]) : {
|
|
9595
|
-
...defaultVariants,
|
|
9596
|
-
...propsWithoutUndefined
|
|
9597
|
-
}[key] === value;
|
|
9598
|
-
}) ? [
|
|
9599
|
-
...acc,
|
|
9600
|
-
cvClass,
|
|
9601
|
-
cvClassName
|
|
9602
|
-
] : acc;
|
|
9603
|
-
}, []);
|
|
9604
|
-
return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
|
|
9605
|
-
};
|
|
9606
|
-
|
|
9607
|
-
// ../ui-react/dist/index.mjs
|
|
9608
|
-
import { jsx as jsx102 } from "react/jsx-runtime";
|
|
9609
|
-
import * as React52 from "react";
|
|
9610
|
-
|
|
9611
|
-
// ../../node_modules/.pnpm/@radix-ui+react-tooltip@1.2.8_@types+react-dom@18.3.7_@types+react@18.3.27__@types+react@18.3_hd4qp76o7ebwsrfrhqb6isuuvy/node_modules/@radix-ui/react-tooltip/dist/index.mjs
|
|
9612
|
-
import * as React36 from "react";
|
|
9613
|
-
import { jsx as jsx16, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
9614
|
-
var [createTooltipContext, createTooltipScope] = createContextScope("Tooltip", [
|
|
9615
|
-
createPopperScope
|
|
9616
|
-
]);
|
|
9617
|
-
var usePopperScope2 = createPopperScope();
|
|
9618
|
-
var PROVIDER_NAME = "TooltipProvider";
|
|
9619
|
-
var DEFAULT_DELAY_DURATION = 700;
|
|
9620
|
-
var TOOLTIP_OPEN = "tooltip.open";
|
|
9621
|
-
var [TooltipProviderContextProvider, useTooltipProviderContext] = createTooltipContext(PROVIDER_NAME);
|
|
9622
|
-
var TooltipProvider = (props) => {
|
|
9623
|
-
const {
|
|
9624
|
-
__scopeTooltip,
|
|
9625
|
-
delayDuration = DEFAULT_DELAY_DURATION,
|
|
9626
|
-
skipDelayDuration = 300,
|
|
9627
|
-
disableHoverableContent = false,
|
|
9628
|
-
children
|
|
9629
|
-
} = props;
|
|
9630
|
-
const isOpenDelayedRef = React36.useRef(true);
|
|
9631
|
-
const isPointerInTransitRef = React36.useRef(false);
|
|
9632
|
-
const skipDelayTimerRef = React36.useRef(0);
|
|
9633
|
-
React36.useEffect(() => {
|
|
9634
|
-
const skipDelayTimer = skipDelayTimerRef.current;
|
|
9635
|
-
return () => window.clearTimeout(skipDelayTimer);
|
|
9636
|
-
}, []);
|
|
9637
|
-
return /* @__PURE__ */ jsx16(
|
|
9638
|
-
TooltipProviderContextProvider,
|
|
9639
|
-
{
|
|
9640
|
-
scope: __scopeTooltip,
|
|
9641
|
-
isOpenDelayedRef,
|
|
9642
|
-
delayDuration,
|
|
9643
|
-
onOpen: React36.useCallback(() => {
|
|
9644
|
-
window.clearTimeout(skipDelayTimerRef.current);
|
|
9645
|
-
isOpenDelayedRef.current = false;
|
|
9646
|
-
}, []),
|
|
9647
|
-
onClose: React36.useCallback(() => {
|
|
9648
|
-
window.clearTimeout(skipDelayTimerRef.current);
|
|
9649
|
-
skipDelayTimerRef.current = window.setTimeout(
|
|
9650
|
-
() => isOpenDelayedRef.current = true,
|
|
9651
|
-
skipDelayDuration
|
|
9652
|
-
);
|
|
9653
|
-
}, [skipDelayDuration]),
|
|
9654
|
-
isPointerInTransitRef,
|
|
9655
|
-
onPointerInTransitChange: React36.useCallback((inTransit) => {
|
|
9656
|
-
isPointerInTransitRef.current = inTransit;
|
|
9657
|
-
}, []),
|
|
9658
|
-
disableHoverableContent,
|
|
9659
|
-
children
|
|
9665
|
+
import { jsx as jsx15, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
9666
|
+
var [createTooltipContext, createTooltipScope] = createContextScope("Tooltip", [
|
|
9667
|
+
createPopperScope
|
|
9668
|
+
]);
|
|
9669
|
+
var usePopperScope2 = createPopperScope();
|
|
9670
|
+
var PROVIDER_NAME = "TooltipProvider";
|
|
9671
|
+
var DEFAULT_DELAY_DURATION = 700;
|
|
9672
|
+
var TOOLTIP_OPEN = "tooltip.open";
|
|
9673
|
+
var [TooltipProviderContextProvider, useTooltipProviderContext] = createTooltipContext(PROVIDER_NAME);
|
|
9674
|
+
var TooltipProvider = (props) => {
|
|
9675
|
+
const {
|
|
9676
|
+
__scopeTooltip,
|
|
9677
|
+
delayDuration = DEFAULT_DELAY_DURATION,
|
|
9678
|
+
skipDelayDuration = 300,
|
|
9679
|
+
disableHoverableContent = false,
|
|
9680
|
+
children
|
|
9681
|
+
} = props;
|
|
9682
|
+
const isOpenDelayedRef = React35.useRef(true);
|
|
9683
|
+
const isPointerInTransitRef = React35.useRef(false);
|
|
9684
|
+
const skipDelayTimerRef = React35.useRef(0);
|
|
9685
|
+
React35.useEffect(() => {
|
|
9686
|
+
const skipDelayTimer = skipDelayTimerRef.current;
|
|
9687
|
+
return () => window.clearTimeout(skipDelayTimer);
|
|
9688
|
+
}, []);
|
|
9689
|
+
return /* @__PURE__ */ jsx15(
|
|
9690
|
+
TooltipProviderContextProvider,
|
|
9691
|
+
{
|
|
9692
|
+
scope: __scopeTooltip,
|
|
9693
|
+
isOpenDelayedRef,
|
|
9694
|
+
delayDuration,
|
|
9695
|
+
onOpen: React35.useCallback(() => {
|
|
9696
|
+
window.clearTimeout(skipDelayTimerRef.current);
|
|
9697
|
+
isOpenDelayedRef.current = false;
|
|
9698
|
+
}, []),
|
|
9699
|
+
onClose: React35.useCallback(() => {
|
|
9700
|
+
window.clearTimeout(skipDelayTimerRef.current);
|
|
9701
|
+
skipDelayTimerRef.current = window.setTimeout(
|
|
9702
|
+
() => isOpenDelayedRef.current = true,
|
|
9703
|
+
skipDelayDuration
|
|
9704
|
+
);
|
|
9705
|
+
}, [skipDelayDuration]),
|
|
9706
|
+
isPointerInTransitRef,
|
|
9707
|
+
onPointerInTransitChange: React35.useCallback((inTransit) => {
|
|
9708
|
+
isPointerInTransitRef.current = inTransit;
|
|
9709
|
+
}, []),
|
|
9710
|
+
disableHoverableContent,
|
|
9711
|
+
children
|
|
9660
9712
|
}
|
|
9661
9713
|
);
|
|
9662
9714
|
};
|
|
@@ -9675,12 +9727,12 @@ var Tooltip = (props) => {
|
|
|
9675
9727
|
} = props;
|
|
9676
9728
|
const providerContext = useTooltipProviderContext(TOOLTIP_NAME, props.__scopeTooltip);
|
|
9677
9729
|
const popperScope = usePopperScope2(__scopeTooltip);
|
|
9678
|
-
const [trigger, setTrigger] =
|
|
9730
|
+
const [trigger, setTrigger] = React35.useState(null);
|
|
9679
9731
|
const contentId = useId();
|
|
9680
|
-
const openTimerRef =
|
|
9732
|
+
const openTimerRef = React35.useRef(0);
|
|
9681
9733
|
const disableHoverableContent = disableHoverableContentProp ?? providerContext.disableHoverableContent;
|
|
9682
9734
|
const delayDuration = delayDurationProp ?? providerContext.delayDuration;
|
|
9683
|
-
const wasOpenDelayedRef =
|
|
9735
|
+
const wasOpenDelayedRef = React35.useRef(false);
|
|
9684
9736
|
const [open, setOpen] = useControllableState({
|
|
9685
9737
|
prop: openProp,
|
|
9686
9738
|
defaultProp: defaultOpen ?? false,
|
|
@@ -9695,21 +9747,21 @@ var Tooltip = (props) => {
|
|
|
9695
9747
|
},
|
|
9696
9748
|
caller: TOOLTIP_NAME
|
|
9697
9749
|
});
|
|
9698
|
-
const stateAttribute =
|
|
9750
|
+
const stateAttribute = React35.useMemo(() => {
|
|
9699
9751
|
return open ? wasOpenDelayedRef.current ? "delayed-open" : "instant-open" : "closed";
|
|
9700
9752
|
}, [open]);
|
|
9701
|
-
const handleOpen =
|
|
9753
|
+
const handleOpen = React35.useCallback(() => {
|
|
9702
9754
|
window.clearTimeout(openTimerRef.current);
|
|
9703
9755
|
openTimerRef.current = 0;
|
|
9704
9756
|
wasOpenDelayedRef.current = false;
|
|
9705
9757
|
setOpen(true);
|
|
9706
9758
|
}, [setOpen]);
|
|
9707
|
-
const handleClose =
|
|
9759
|
+
const handleClose = React35.useCallback(() => {
|
|
9708
9760
|
window.clearTimeout(openTimerRef.current);
|
|
9709
9761
|
openTimerRef.current = 0;
|
|
9710
9762
|
setOpen(false);
|
|
9711
9763
|
}, [setOpen]);
|
|
9712
|
-
const handleDelayedOpen =
|
|
9764
|
+
const handleDelayedOpen = React35.useCallback(() => {
|
|
9713
9765
|
window.clearTimeout(openTimerRef.current);
|
|
9714
9766
|
openTimerRef.current = window.setTimeout(() => {
|
|
9715
9767
|
wasOpenDelayedRef.current = true;
|
|
@@ -9717,7 +9769,7 @@ var Tooltip = (props) => {
|
|
|
9717
9769
|
openTimerRef.current = 0;
|
|
9718
9770
|
}, delayDuration);
|
|
9719
9771
|
}, [delayDuration, setOpen]);
|
|
9720
|
-
|
|
9772
|
+
React35.useEffect(() => {
|
|
9721
9773
|
return () => {
|
|
9722
9774
|
if (openTimerRef.current) {
|
|
9723
9775
|
window.clearTimeout(openTimerRef.current);
|
|
@@ -9725,7 +9777,7 @@ var Tooltip = (props) => {
|
|
|
9725
9777
|
}
|
|
9726
9778
|
};
|
|
9727
9779
|
}, []);
|
|
9728
|
-
return /* @__PURE__ */
|
|
9780
|
+
return /* @__PURE__ */ jsx15(Root22, { ...popperScope, children: /* @__PURE__ */ jsx15(
|
|
9729
9781
|
TooltipContextProvider,
|
|
9730
9782
|
{
|
|
9731
9783
|
scope: __scopeTooltip,
|
|
@@ -9734,11 +9786,11 @@ var Tooltip = (props) => {
|
|
|
9734
9786
|
stateAttribute,
|
|
9735
9787
|
trigger,
|
|
9736
9788
|
onTriggerChange: setTrigger,
|
|
9737
|
-
onTriggerEnter:
|
|
9789
|
+
onTriggerEnter: React35.useCallback(() => {
|
|
9738
9790
|
if (providerContext.isOpenDelayedRef.current) handleDelayedOpen();
|
|
9739
9791
|
else handleOpen();
|
|
9740
9792
|
}, [providerContext.isOpenDelayedRef, handleDelayedOpen, handleOpen]),
|
|
9741
|
-
onTriggerLeave:
|
|
9793
|
+
onTriggerLeave: React35.useCallback(() => {
|
|
9742
9794
|
if (disableHoverableContent) {
|
|
9743
9795
|
handleClose();
|
|
9744
9796
|
} else {
|
|
@@ -9755,21 +9807,21 @@ var Tooltip = (props) => {
|
|
|
9755
9807
|
};
|
|
9756
9808
|
Tooltip.displayName = TOOLTIP_NAME;
|
|
9757
9809
|
var TRIGGER_NAME3 = "TooltipTrigger";
|
|
9758
|
-
var TooltipTrigger =
|
|
9810
|
+
var TooltipTrigger = React35.forwardRef(
|
|
9759
9811
|
(props, forwardedRef) => {
|
|
9760
9812
|
const { __scopeTooltip, ...triggerProps } = props;
|
|
9761
9813
|
const context = useTooltipContext(TRIGGER_NAME3, __scopeTooltip);
|
|
9762
9814
|
const providerContext = useTooltipProviderContext(TRIGGER_NAME3, __scopeTooltip);
|
|
9763
9815
|
const popperScope = usePopperScope2(__scopeTooltip);
|
|
9764
|
-
const ref =
|
|
9816
|
+
const ref = React35.useRef(null);
|
|
9765
9817
|
const composedRefs = useComposedRefs(forwardedRef, ref, context.onTriggerChange);
|
|
9766
|
-
const isPointerDownRef =
|
|
9767
|
-
const hasPointerMoveOpenedRef =
|
|
9768
|
-
const handlePointerUp =
|
|
9769
|
-
|
|
9818
|
+
const isPointerDownRef = React35.useRef(false);
|
|
9819
|
+
const hasPointerMoveOpenedRef = React35.useRef(false);
|
|
9820
|
+
const handlePointerUp = React35.useCallback(() => isPointerDownRef.current = false, []);
|
|
9821
|
+
React35.useEffect(() => {
|
|
9770
9822
|
return () => document.removeEventListener("pointerup", handlePointerUp);
|
|
9771
9823
|
}, [handlePointerUp]);
|
|
9772
|
-
return /* @__PURE__ */
|
|
9824
|
+
return /* @__PURE__ */ jsx15(Anchor, { asChild: true, ...popperScope, children: /* @__PURE__ */ jsx15(
|
|
9773
9825
|
Primitive.button,
|
|
9774
9826
|
{
|
|
9775
9827
|
"aria-describedby": context.open ? context.contentId : void 0,
|
|
@@ -9811,32 +9863,32 @@ var [PortalProvider2, usePortalContext2] = createTooltipContext(PORTAL_NAME4, {
|
|
|
9811
9863
|
var TooltipPortal = (props) => {
|
|
9812
9864
|
const { __scopeTooltip, forceMount, children, container } = props;
|
|
9813
9865
|
const context = useTooltipContext(PORTAL_NAME4, __scopeTooltip);
|
|
9814
|
-
return /* @__PURE__ */
|
|
9866
|
+
return /* @__PURE__ */ jsx15(PortalProvider2, { scope: __scopeTooltip, forceMount, children: /* @__PURE__ */ jsx15(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx15(Portal, { asChild: true, container, children }) }) });
|
|
9815
9867
|
};
|
|
9816
9868
|
TooltipPortal.displayName = PORTAL_NAME4;
|
|
9817
9869
|
var CONTENT_NAME4 = "TooltipContent";
|
|
9818
|
-
var TooltipContent =
|
|
9870
|
+
var TooltipContent = React35.forwardRef(
|
|
9819
9871
|
(props, forwardedRef) => {
|
|
9820
9872
|
const portalContext = usePortalContext2(CONTENT_NAME4, props.__scopeTooltip);
|
|
9821
9873
|
const { forceMount = portalContext.forceMount, side = "top", ...contentProps } = props;
|
|
9822
9874
|
const context = useTooltipContext(CONTENT_NAME4, props.__scopeTooltip);
|
|
9823
|
-
return /* @__PURE__ */
|
|
9875
|
+
return /* @__PURE__ */ jsx15(Presence, { present: forceMount || context.open, children: context.disableHoverableContent ? /* @__PURE__ */ jsx15(TooltipContentImpl, { side, ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx15(TooltipContentHoverable, { side, ...contentProps, ref: forwardedRef }) });
|
|
9824
9876
|
}
|
|
9825
9877
|
);
|
|
9826
|
-
var TooltipContentHoverable =
|
|
9878
|
+
var TooltipContentHoverable = React35.forwardRef((props, forwardedRef) => {
|
|
9827
9879
|
const context = useTooltipContext(CONTENT_NAME4, props.__scopeTooltip);
|
|
9828
9880
|
const providerContext = useTooltipProviderContext(CONTENT_NAME4, props.__scopeTooltip);
|
|
9829
|
-
const ref =
|
|
9881
|
+
const ref = React35.useRef(null);
|
|
9830
9882
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
9831
|
-
const [pointerGraceArea, setPointerGraceArea] =
|
|
9883
|
+
const [pointerGraceArea, setPointerGraceArea] = React35.useState(null);
|
|
9832
9884
|
const { trigger, onClose } = context;
|
|
9833
9885
|
const content = ref.current;
|
|
9834
9886
|
const { onPointerInTransitChange } = providerContext;
|
|
9835
|
-
const handleRemoveGraceArea =
|
|
9887
|
+
const handleRemoveGraceArea = React35.useCallback(() => {
|
|
9836
9888
|
setPointerGraceArea(null);
|
|
9837
9889
|
onPointerInTransitChange(false);
|
|
9838
9890
|
}, [onPointerInTransitChange]);
|
|
9839
|
-
const handleCreateGraceArea =
|
|
9891
|
+
const handleCreateGraceArea = React35.useCallback(
|
|
9840
9892
|
(event, hoverTarget) => {
|
|
9841
9893
|
const currentTarget = event.currentTarget;
|
|
9842
9894
|
const exitPoint = { x: event.clientX, y: event.clientY };
|
|
@@ -9849,10 +9901,10 @@ var TooltipContentHoverable = React36.forwardRef((props, forwardedRef) => {
|
|
|
9849
9901
|
},
|
|
9850
9902
|
[onPointerInTransitChange]
|
|
9851
9903
|
);
|
|
9852
|
-
|
|
9904
|
+
React35.useEffect(() => {
|
|
9853
9905
|
return () => handleRemoveGraceArea();
|
|
9854
9906
|
}, [handleRemoveGraceArea]);
|
|
9855
|
-
|
|
9907
|
+
React35.useEffect(() => {
|
|
9856
9908
|
if (trigger && content) {
|
|
9857
9909
|
const handleTriggerLeave = (event) => handleCreateGraceArea(event, content);
|
|
9858
9910
|
const handleContentLeave = (event) => handleCreateGraceArea(event, trigger);
|
|
@@ -9864,7 +9916,7 @@ var TooltipContentHoverable = React36.forwardRef((props, forwardedRef) => {
|
|
|
9864
9916
|
};
|
|
9865
9917
|
}
|
|
9866
9918
|
}, [trigger, content, handleCreateGraceArea, handleRemoveGraceArea]);
|
|
9867
|
-
|
|
9919
|
+
React35.useEffect(() => {
|
|
9868
9920
|
if (pointerGraceArea) {
|
|
9869
9921
|
const handleTrackPointerGrace = (event) => {
|
|
9870
9922
|
const target = event.target;
|
|
@@ -9882,11 +9934,11 @@ var TooltipContentHoverable = React36.forwardRef((props, forwardedRef) => {
|
|
|
9882
9934
|
return () => document.removeEventListener("pointermove", handleTrackPointerGrace);
|
|
9883
9935
|
}
|
|
9884
9936
|
}, [trigger, content, pointerGraceArea, onClose, handleRemoveGraceArea]);
|
|
9885
|
-
return /* @__PURE__ */
|
|
9937
|
+
return /* @__PURE__ */ jsx15(TooltipContentImpl, { ...props, ref: composedRefs });
|
|
9886
9938
|
});
|
|
9887
9939
|
var [VisuallyHiddenContentContextProvider, useVisuallyHiddenContentContext] = createTooltipContext(TOOLTIP_NAME, { isInside: false });
|
|
9888
9940
|
var Slottable = createSlottable("TooltipContent");
|
|
9889
|
-
var TooltipContentImpl =
|
|
9941
|
+
var TooltipContentImpl = React35.forwardRef(
|
|
9890
9942
|
(props, forwardedRef) => {
|
|
9891
9943
|
const {
|
|
9892
9944
|
__scopeTooltip,
|
|
@@ -9899,11 +9951,11 @@ var TooltipContentImpl = React36.forwardRef(
|
|
|
9899
9951
|
const context = useTooltipContext(CONTENT_NAME4, __scopeTooltip);
|
|
9900
9952
|
const popperScope = usePopperScope2(__scopeTooltip);
|
|
9901
9953
|
const { onClose } = context;
|
|
9902
|
-
|
|
9954
|
+
React35.useEffect(() => {
|
|
9903
9955
|
document.addEventListener(TOOLTIP_OPEN, onClose);
|
|
9904
9956
|
return () => document.removeEventListener(TOOLTIP_OPEN, onClose);
|
|
9905
9957
|
}, [onClose]);
|
|
9906
|
-
|
|
9958
|
+
React35.useEffect(() => {
|
|
9907
9959
|
if (context.trigger) {
|
|
9908
9960
|
const handleScroll2 = (event) => {
|
|
9909
9961
|
const target = event.target;
|
|
@@ -9913,7 +9965,7 @@ var TooltipContentImpl = React36.forwardRef(
|
|
|
9913
9965
|
return () => window.removeEventListener("scroll", handleScroll2, { capture: true });
|
|
9914
9966
|
}
|
|
9915
9967
|
}, [context.trigger, onClose]);
|
|
9916
|
-
return /* @__PURE__ */
|
|
9968
|
+
return /* @__PURE__ */ jsx15(
|
|
9917
9969
|
DismissableLayer,
|
|
9918
9970
|
{
|
|
9919
9971
|
asChild: true,
|
|
@@ -9941,8 +9993,8 @@ var TooltipContentImpl = React36.forwardRef(
|
|
|
9941
9993
|
}
|
|
9942
9994
|
},
|
|
9943
9995
|
children: [
|
|
9944
|
-
/* @__PURE__ */
|
|
9945
|
-
/* @__PURE__ */
|
|
9996
|
+
/* @__PURE__ */ jsx15(Slottable, { children }),
|
|
9997
|
+
/* @__PURE__ */ jsx15(VisuallyHiddenContentContextProvider, { scope: __scopeTooltip, isInside: true, children: /* @__PURE__ */ jsx15(Root3, { id: context.contentId, role: "tooltip", children: ariaLabel || children }) })
|
|
9946
9998
|
]
|
|
9947
9999
|
}
|
|
9948
10000
|
)
|
|
@@ -9952,7 +10004,7 @@ var TooltipContentImpl = React36.forwardRef(
|
|
|
9952
10004
|
);
|
|
9953
10005
|
TooltipContent.displayName = CONTENT_NAME4;
|
|
9954
10006
|
var ARROW_NAME3 = "TooltipArrow";
|
|
9955
|
-
var TooltipArrow =
|
|
10007
|
+
var TooltipArrow = React35.forwardRef(
|
|
9956
10008
|
(props, forwardedRef) => {
|
|
9957
10009
|
const { __scopeTooltip, ...arrowProps } = props;
|
|
9958
10010
|
const popperScope = usePopperScope2(__scopeTooltip);
|
|
@@ -9960,7 +10012,7 @@ var TooltipArrow = React36.forwardRef(
|
|
|
9960
10012
|
ARROW_NAME3,
|
|
9961
10013
|
__scopeTooltip
|
|
9962
10014
|
);
|
|
9963
|
-
return visuallyHiddenContentContext.isInside ? null : /* @__PURE__ */
|
|
10015
|
+
return visuallyHiddenContentContext.isInside ? null : /* @__PURE__ */ jsx15(Arrow2, { ...popperScope, ...arrowProps, ref: forwardedRef });
|
|
9964
10016
|
}
|
|
9965
10017
|
);
|
|
9966
10018
|
TooltipArrow.displayName = ARROW_NAME3;
|
|
@@ -10086,93 +10138,240 @@ var Portal4 = TooltipPortal;
|
|
|
10086
10138
|
var Content23 = TooltipContent;
|
|
10087
10139
|
|
|
10088
10140
|
// ../ui-react/dist/index.mjs
|
|
10089
|
-
import { jsx as
|
|
10090
|
-
import {
|
|
10091
|
-
import { jsx as
|
|
10092
|
-
import { useState as
|
|
10093
|
-
import { useState as
|
|
10094
|
-
import { jsx as
|
|
10095
|
-
import { Fragment as Fragment32, jsx as
|
|
10096
|
-
import { jsx as
|
|
10097
|
-
import { useQuery } from "@tanstack/react-query";
|
|
10098
|
-
import { jsx as
|
|
10099
|
-
import { jsx as
|
|
10100
|
-
import { jsx as
|
|
10101
|
-
import { jsx as
|
|
10102
|
-
import { Fragment as Fragment42, jsx as
|
|
10103
|
-
import { jsx as
|
|
10104
|
-
|
|
10105
|
-
|
|
10141
|
+
import { jsx as jsx102 } from "react/jsx-runtime";
|
|
10142
|
+
import { jsx as jsx112, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
10143
|
+
import { jsx as jsx122 } from "react/jsx-runtime";
|
|
10144
|
+
import { useState as useState62, useEffect as useEffect52 } from "react";
|
|
10145
|
+
import { useState as useState52 } from "react";
|
|
10146
|
+
import { jsx as jsx132, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
10147
|
+
import { Fragment as Fragment32, jsx as jsx142, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
10148
|
+
import { jsx as jsx152, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
10149
|
+
import { useQuery as useQuery2 } from "@tanstack/react-query";
|
|
10150
|
+
import { jsx as jsx162, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
10151
|
+
import { jsx as jsx172, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
10152
|
+
import { jsx as jsx18, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
10153
|
+
import { jsx as jsx19, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
10154
|
+
import { Fragment as Fragment42, jsx as jsx20, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
10155
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
10156
|
+
import * as React52 from "react";
|
|
10157
|
+
|
|
10158
|
+
// ../../node_modules/.pnpm/@radix-ui+react-slot@1.2.4_@types+react@18.3.27_react@18.3.1/node_modules/@radix-ui/react-slot/dist/index.mjs
|
|
10159
|
+
import * as React36 from "react";
|
|
10160
|
+
import { Fragment as Fragment22, jsx as jsx16 } from "react/jsx-runtime";
|
|
10161
|
+
var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
|
|
10162
|
+
var use = React36[" use ".trim().toString()];
|
|
10163
|
+
function isPromiseLike(value) {
|
|
10164
|
+
return typeof value === "object" && value !== null && "then" in value;
|
|
10106
10165
|
}
|
|
10107
|
-
|
|
10108
|
-
|
|
10109
|
-
children,
|
|
10110
|
-
themeClass
|
|
10111
|
-
}) {
|
|
10112
|
-
return /* @__PURE__ */ jsx17(ThemeContext.Provider, { value: { themeClass }, children });
|
|
10166
|
+
function isLazyComponent(element) {
|
|
10167
|
+
return element != null && typeof element === "object" && "$$typeof" in element && element.$$typeof === REACT_LAZY_TYPE && "_payload" in element && isPromiseLike(element._payload);
|
|
10113
10168
|
}
|
|
10114
|
-
|
|
10115
|
-
|
|
10169
|
+
// @__NO_SIDE_EFFECTS__
|
|
10170
|
+
function createSlot2(ownerName) {
|
|
10171
|
+
const SlotClone = /* @__PURE__ */ createSlotClone2(ownerName);
|
|
10172
|
+
const Slot22 = React36.forwardRef((props, forwardedRef) => {
|
|
10173
|
+
let { children, ...slotProps } = props;
|
|
10174
|
+
if (isLazyComponent(children) && typeof use === "function") {
|
|
10175
|
+
children = use(children._payload);
|
|
10176
|
+
}
|
|
10177
|
+
const childrenArray = React36.Children.toArray(children);
|
|
10178
|
+
const slottable = childrenArray.find(isSlottable2);
|
|
10179
|
+
if (slottable) {
|
|
10180
|
+
const newElement = slottable.props.children;
|
|
10181
|
+
const newChildren = childrenArray.map((child) => {
|
|
10182
|
+
if (child === slottable) {
|
|
10183
|
+
if (React36.Children.count(newElement) > 1) return React36.Children.only(null);
|
|
10184
|
+
return React36.isValidElement(newElement) ? newElement.props.children : null;
|
|
10185
|
+
} else {
|
|
10186
|
+
return child;
|
|
10187
|
+
}
|
|
10188
|
+
});
|
|
10189
|
+
return /* @__PURE__ */ jsx16(SlotClone, { ...slotProps, ref: forwardedRef, children: React36.isValidElement(newElement) ? React36.cloneElement(newElement, void 0, newChildren) : null });
|
|
10190
|
+
}
|
|
10191
|
+
return /* @__PURE__ */ jsx16(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
10192
|
+
});
|
|
10193
|
+
Slot22.displayName = `${ownerName}.Slot`;
|
|
10194
|
+
return Slot22;
|
|
10116
10195
|
}
|
|
10117
|
-
var
|
|
10118
|
-
|
|
10119
|
-
|
|
10120
|
-
const
|
|
10121
|
-
|
|
10122
|
-
|
|
10123
|
-
|
|
10124
|
-
ref,
|
|
10125
|
-
className: cn(
|
|
10126
|
-
themeClass,
|
|
10127
|
-
"uf-fixed uf-inset-0 uf-z-50 uf-bg-black/40 data-[state=open]:uf-animate-in data-[state=closed]:uf-animate-out data-[state=closed]:uf-fade-out-0 data-[state=open]:uf-fade-in-0",
|
|
10128
|
-
className
|
|
10129
|
-
),
|
|
10130
|
-
...props
|
|
10196
|
+
var Slot3 = /* @__PURE__ */ createSlot2("Slot");
|
|
10197
|
+
// @__NO_SIDE_EFFECTS__
|
|
10198
|
+
function createSlotClone2(ownerName) {
|
|
10199
|
+
const SlotClone = React36.forwardRef((props, forwardedRef) => {
|
|
10200
|
+
let { children, ...slotProps } = props;
|
|
10201
|
+
if (isLazyComponent(children) && typeof use === "function") {
|
|
10202
|
+
children = use(children._payload);
|
|
10131
10203
|
}
|
|
10132
|
-
|
|
10133
|
-
|
|
10134
|
-
|
|
10135
|
-
|
|
10136
|
-
|
|
10137
|
-
|
|
10138
|
-
|
|
10139
|
-
{
|
|
10140
|
-
ref,
|
|
10141
|
-
className: cn(
|
|
10142
|
-
// Mobile: bottom-aligned, full-width
|
|
10143
|
-
"uf-fixed uf-bottom-0 uf-left-0 uf-right-0 uf-z-50 uf-grid uf-w-full uf-max-w-full",
|
|
10144
|
-
// Mobile: rounded top corners only
|
|
10145
|
-
"uf-rounded-t-3xl",
|
|
10146
|
-
// Desktop: centered modal (no default max-width, let parent specify)
|
|
10147
|
-
"sm:uf-left-[50%] sm:uf-top-[50%] sm:uf-bottom-auto sm:uf-right-auto sm:uf-translate-x-[-50%] sm:uf-translate-y-[-50%]",
|
|
10148
|
-
// Desktop: rounded all corners
|
|
10149
|
-
"sm:uf-rounded-3xl",
|
|
10150
|
-
// Common styles
|
|
10151
|
-
"uf-gap-4 uf-border uf-bg-background uf-p-6 uf-shadow-lg uf-duration-200",
|
|
10152
|
-
// Animations - mobile slides from bottom
|
|
10153
|
-
"data-[state=open]:uf-animate-in data-[state=closed]:uf-animate-out",
|
|
10154
|
-
"data-[state=closed]:uf-fade-out-0 data-[state=open]:uf-fade-in-0",
|
|
10155
|
-
"data-[state=closed]:uf-slide-out-to-bottom data-[state=open]:uf-slide-in-from-bottom",
|
|
10156
|
-
// Desktop animations - center zoom
|
|
10157
|
-
"sm:data-[state=closed]:uf-zoom-out-95 sm:data-[state=open]:uf-zoom-in-95",
|
|
10158
|
-
"sm:data-[state=closed]:uf-slide-out-to-left-1/2 sm:data-[state=closed]:uf-slide-out-to-top-[48%]",
|
|
10159
|
-
"sm:data-[state=open]:uf-slide-in-from-left-1/2 sm:data-[state=open]:uf-slide-in-from-top-[48%]",
|
|
10160
|
-
className
|
|
10161
|
-
),
|
|
10162
|
-
...props,
|
|
10163
|
-
children: [
|
|
10164
|
-
children,
|
|
10165
|
-
/* @__PURE__ */ jsxs4(Close, { className: "uf-absolute uf-right-6 uf-top-6 uf-rounded-sm uf-opacity-70 uf-ring-offset-background uf-transition-opacity hover:uf-opacity-100 focus:uf-outline-none focus:uf-ring-2 focus:uf-ring-ring focus:uf-ring-offset-2 disabled:uf-pointer-events-none data-[state=open]:uf-bg-accent data-[state=open]:uf-text-muted-foreground", children: [
|
|
10166
|
-
/* @__PURE__ */ jsx23(X, { className: "uf-h-6 uf-w-6" }),
|
|
10167
|
-
/* @__PURE__ */ jsx23("span", { className: "uf-sr-only", children: "Close" })
|
|
10168
|
-
] })
|
|
10169
|
-
]
|
|
10204
|
+
if (React36.isValidElement(children)) {
|
|
10205
|
+
const childrenRef = getElementRef3(children);
|
|
10206
|
+
const props2 = mergeProps2(slotProps, children.props);
|
|
10207
|
+
if (children.type !== React36.Fragment) {
|
|
10208
|
+
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
10209
|
+
}
|
|
10210
|
+
return React36.cloneElement(children, props2);
|
|
10170
10211
|
}
|
|
10171
|
-
|
|
10172
|
-
|
|
10173
|
-
|
|
10174
|
-
|
|
10175
|
-
|
|
10212
|
+
return React36.Children.count(children) > 1 ? React36.Children.only(null) : null;
|
|
10213
|
+
});
|
|
10214
|
+
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
10215
|
+
return SlotClone;
|
|
10216
|
+
}
|
|
10217
|
+
var SLOTTABLE_IDENTIFIER2 = /* @__PURE__ */ Symbol("radix.slottable");
|
|
10218
|
+
function isSlottable2(child) {
|
|
10219
|
+
return React36.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER2;
|
|
10220
|
+
}
|
|
10221
|
+
function mergeProps2(slotProps, childProps) {
|
|
10222
|
+
const overrideProps = { ...childProps };
|
|
10223
|
+
for (const propName in childProps) {
|
|
10224
|
+
const slotPropValue = slotProps[propName];
|
|
10225
|
+
const childPropValue = childProps[propName];
|
|
10226
|
+
const isHandler = /^on[A-Z]/.test(propName);
|
|
10227
|
+
if (isHandler) {
|
|
10228
|
+
if (slotPropValue && childPropValue) {
|
|
10229
|
+
overrideProps[propName] = (...args) => {
|
|
10230
|
+
const result = childPropValue(...args);
|
|
10231
|
+
slotPropValue(...args);
|
|
10232
|
+
return result;
|
|
10233
|
+
};
|
|
10234
|
+
} else if (slotPropValue) {
|
|
10235
|
+
overrideProps[propName] = slotPropValue;
|
|
10236
|
+
}
|
|
10237
|
+
} else if (propName === "style") {
|
|
10238
|
+
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
|
|
10239
|
+
} else if (propName === "className") {
|
|
10240
|
+
overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
|
|
10241
|
+
}
|
|
10242
|
+
}
|
|
10243
|
+
return { ...slotProps, ...overrideProps };
|
|
10244
|
+
}
|
|
10245
|
+
function getElementRef3(element) {
|
|
10246
|
+
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
|
10247
|
+
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
10248
|
+
if (mayWarn) {
|
|
10249
|
+
return element.ref;
|
|
10250
|
+
}
|
|
10251
|
+
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
|
|
10252
|
+
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
10253
|
+
if (mayWarn) {
|
|
10254
|
+
return element.props.ref;
|
|
10255
|
+
}
|
|
10256
|
+
return element.props.ref || element.ref;
|
|
10257
|
+
}
|
|
10258
|
+
|
|
10259
|
+
// ../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.mjs
|
|
10260
|
+
var falsyToString = (value) => typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value;
|
|
10261
|
+
var cx = clsx;
|
|
10262
|
+
var cva = (base, config) => (props) => {
|
|
10263
|
+
var _config_compoundVariants;
|
|
10264
|
+
if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
|
|
10265
|
+
const { variants, defaultVariants } = config;
|
|
10266
|
+
const getVariantClassNames = Object.keys(variants).map((variant) => {
|
|
10267
|
+
const variantProp = props === null || props === void 0 ? void 0 : props[variant];
|
|
10268
|
+
const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];
|
|
10269
|
+
if (variantProp === null) return null;
|
|
10270
|
+
const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);
|
|
10271
|
+
return variants[variant][variantKey];
|
|
10272
|
+
});
|
|
10273
|
+
const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param) => {
|
|
10274
|
+
let [key, value] = param;
|
|
10275
|
+
if (value === void 0) {
|
|
10276
|
+
return acc;
|
|
10277
|
+
}
|
|
10278
|
+
acc[key] = value;
|
|
10279
|
+
return acc;
|
|
10280
|
+
}, {});
|
|
10281
|
+
const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (_config_compoundVariants = config.compoundVariants) === null || _config_compoundVariants === void 0 ? void 0 : _config_compoundVariants.reduce((acc, param) => {
|
|
10282
|
+
let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param;
|
|
10283
|
+
return Object.entries(compoundVariantOptions).every((param2) => {
|
|
10284
|
+
let [key, value] = param2;
|
|
10285
|
+
return Array.isArray(value) ? value.includes({
|
|
10286
|
+
...defaultVariants,
|
|
10287
|
+
...propsWithoutUndefined
|
|
10288
|
+
}[key]) : {
|
|
10289
|
+
...defaultVariants,
|
|
10290
|
+
...propsWithoutUndefined
|
|
10291
|
+
}[key] === value;
|
|
10292
|
+
}) ? [
|
|
10293
|
+
...acc,
|
|
10294
|
+
cvClass,
|
|
10295
|
+
cvClassName
|
|
10296
|
+
] : acc;
|
|
10297
|
+
}, []);
|
|
10298
|
+
return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
|
|
10299
|
+
};
|
|
10300
|
+
|
|
10301
|
+
// ../ui-react/dist/index.mjs
|
|
10302
|
+
import { jsx as jsx222 } from "react/jsx-runtime";
|
|
10303
|
+
function cn(...inputs) {
|
|
10304
|
+
return twMerge(clsx(inputs));
|
|
10305
|
+
}
|
|
10306
|
+
var ThemeContext = React37.createContext({ themeClass: "" });
|
|
10307
|
+
function ThemeProvider({
|
|
10308
|
+
children,
|
|
10309
|
+
themeClass
|
|
10310
|
+
}) {
|
|
10311
|
+
return /* @__PURE__ */ jsx17(ThemeContext.Provider, { value: { themeClass }, children });
|
|
10312
|
+
}
|
|
10313
|
+
function useTheme() {
|
|
10314
|
+
return React37.useContext(ThemeContext);
|
|
10315
|
+
}
|
|
10316
|
+
var Dialog2 = Root;
|
|
10317
|
+
var DialogPortal2 = Portal2;
|
|
10318
|
+
var DialogOverlay2 = React210.forwardRef(({ className, ...props }, ref) => {
|
|
10319
|
+
const { themeClass } = useTheme();
|
|
10320
|
+
return /* @__PURE__ */ jsx23(
|
|
10321
|
+
Overlay,
|
|
10322
|
+
{
|
|
10323
|
+
ref,
|
|
10324
|
+
className: cn(
|
|
10325
|
+
themeClass,
|
|
10326
|
+
"uf-fixed uf-inset-0 uf-z-50 uf-bg-black/40 data-[state=open]:uf-animate-in data-[state=closed]:uf-animate-out data-[state=closed]:uf-fade-out-0 data-[state=open]:uf-fade-in-0",
|
|
10327
|
+
className
|
|
10328
|
+
),
|
|
10329
|
+
...props
|
|
10330
|
+
}
|
|
10331
|
+
);
|
|
10332
|
+
});
|
|
10333
|
+
DialogOverlay2.displayName = Overlay.displayName;
|
|
10334
|
+
var DialogContent2 = React210.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs4(DialogPortal2, { children: [
|
|
10335
|
+
/* @__PURE__ */ jsx23(DialogOverlay2, {}),
|
|
10336
|
+
/* @__PURE__ */ jsxs4(
|
|
10337
|
+
Content,
|
|
10338
|
+
{
|
|
10339
|
+
ref,
|
|
10340
|
+
className: cn(
|
|
10341
|
+
// Mobile: bottom-aligned, full-width
|
|
10342
|
+
"uf-fixed uf-bottom-0 uf-left-0 uf-right-0 uf-z-50 uf-grid uf-w-full uf-max-w-full",
|
|
10343
|
+
// Mobile: rounded top corners only
|
|
10344
|
+
"uf-rounded-t-3xl",
|
|
10345
|
+
// Desktop: centered modal (no default max-width, let parent specify)
|
|
10346
|
+
"sm:uf-left-[50%] sm:uf-top-[50%] sm:uf-bottom-auto sm:uf-right-auto sm:uf-translate-x-[-50%] sm:uf-translate-y-[-50%]",
|
|
10347
|
+
// Desktop: rounded all corners
|
|
10348
|
+
"sm:uf-rounded-3xl",
|
|
10349
|
+
// Common styles
|
|
10350
|
+
"uf-gap-4 uf-border uf-bg-background uf-p-6 uf-shadow-lg uf-duration-200",
|
|
10351
|
+
// Animations - mobile slides from bottom
|
|
10352
|
+
"data-[state=open]:uf-animate-in data-[state=closed]:uf-animate-out",
|
|
10353
|
+
"data-[state=closed]:uf-fade-out-0 data-[state=open]:uf-fade-in-0",
|
|
10354
|
+
"data-[state=closed]:uf-slide-out-to-bottom data-[state=open]:uf-slide-in-from-bottom",
|
|
10355
|
+
// Desktop animations - center zoom
|
|
10356
|
+
"sm:data-[state=closed]:uf-zoom-out-95 sm:data-[state=open]:uf-zoom-in-95",
|
|
10357
|
+
"sm:data-[state=closed]:uf-slide-out-to-left-1/2 sm:data-[state=closed]:uf-slide-out-to-top-[48%]",
|
|
10358
|
+
"sm:data-[state=open]:uf-slide-in-from-left-1/2 sm:data-[state=open]:uf-slide-in-from-top-[48%]",
|
|
10359
|
+
className
|
|
10360
|
+
),
|
|
10361
|
+
...props,
|
|
10362
|
+
children: [
|
|
10363
|
+
children,
|
|
10364
|
+
/* @__PURE__ */ jsxs4(Close, { className: "uf-absolute uf-right-6 uf-top-6 uf-rounded-sm uf-opacity-70 uf-ring-offset-background uf-transition-opacity hover:uf-opacity-100 focus:uf-outline-none focus:uf-ring-2 focus:uf-ring-ring focus:uf-ring-offset-2 disabled:uf-pointer-events-none data-[state=open]:uf-bg-accent data-[state=open]:uf-text-muted-foreground", children: [
|
|
10365
|
+
/* @__PURE__ */ jsx23(X, { className: "uf-h-6 uf-w-6" }),
|
|
10366
|
+
/* @__PURE__ */ jsx23("span", { className: "uf-sr-only", children: "Close" })
|
|
10367
|
+
] })
|
|
10368
|
+
]
|
|
10369
|
+
}
|
|
10370
|
+
)
|
|
10371
|
+
] }));
|
|
10372
|
+
DialogContent2.displayName = Content.displayName;
|
|
10373
|
+
var DialogHeader = ({
|
|
10374
|
+
className,
|
|
10176
10375
|
...props
|
|
10177
10376
|
}) => /* @__PURE__ */ jsx23(
|
|
10178
10377
|
"div",
|
|
@@ -10339,175 +10538,11 @@ function DepositHeader({
|
|
|
10339
10538
|
) : /* @__PURE__ */ jsx42("div", { className: "uf-w-5 uf-h-5 uf-invisible" })
|
|
10340
10539
|
] });
|
|
10341
10540
|
}
|
|
10342
|
-
var API_BASE_URL = process.env.NEXT_PUBLIC_API_BASE_URL || "https://api.unifold.io";
|
|
10343
|
-
var DEFAULT_PUBLISHABLE_KEY = "pk_test_123";
|
|
10344
|
-
var DEFAULT_CONFIG = {};
|
|
10345
|
-
function getIconUrl(iconPath) {
|
|
10346
|
-
const normalizedPath = iconPath.startsWith("/") ? iconPath : `/${iconPath}`;
|
|
10347
|
-
return `${API_BASE_URL}/api/public${normalizedPath}`;
|
|
10348
|
-
}
|
|
10349
|
-
function getIconUrlWithCdn(iconPath, assetCdnUrl) {
|
|
10350
|
-
if (!assetCdnUrl) {
|
|
10351
|
-
return getIconUrl(iconPath);
|
|
10352
|
-
}
|
|
10353
|
-
const normalizedPath = iconPath.startsWith("/") ? iconPath : `/${iconPath}`;
|
|
10354
|
-
const baseUrl = assetCdnUrl.endsWith("/") ? assetCdnUrl.slice(0, -1) : assetCdnUrl;
|
|
10355
|
-
return `${baseUrl}/api/public${normalizedPath}`;
|
|
10356
|
-
}
|
|
10357
|
-
async function createEOA(overrides, publishableKey) {
|
|
10358
|
-
if (!overrides?.user_id) {
|
|
10359
|
-
throw new Error("user_id is required");
|
|
10360
|
-
}
|
|
10361
|
-
const payload = {
|
|
10362
|
-
user_id: overrides.user_id,
|
|
10363
|
-
destination_chain_type: overrides?.destination_chain_type || "ethereum",
|
|
10364
|
-
destination_chain_id: overrides?.destination_chain_id || DEFAULT_CONFIG.destinationChainId || "8453",
|
|
10365
|
-
destination_token_address: overrides?.destination_token_address || DEFAULT_CONFIG.destinationTokenAddress || "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
|
|
10366
|
-
recipient_address: overrides?.recipient_address || DEFAULT_CONFIG.recipientAddress || "0x309a4154a2CD4153Da886E780890C9cb5161553C",
|
|
10367
|
-
client_metadata: overrides?.client_metadata || {}
|
|
10368
|
-
};
|
|
10369
|
-
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
10370
|
-
const response = await fetch(`${API_BASE_URL}/v1/public/deposit_addresses`, {
|
|
10371
|
-
method: "POST",
|
|
10372
|
-
headers: {
|
|
10373
|
-
accept: "application/json",
|
|
10374
|
-
"x-publishable-key": pk,
|
|
10375
|
-
"Content-Type": "application/json"
|
|
10376
|
-
},
|
|
10377
|
-
body: JSON.stringify(payload)
|
|
10378
|
-
});
|
|
10379
|
-
if (!response.ok) {
|
|
10380
|
-
throw new Error(`Failed to create EOA: ${response.statusText}`);
|
|
10381
|
-
}
|
|
10382
|
-
return response.json();
|
|
10383
|
-
}
|
|
10384
|
-
function getWalletByChainType(wallets, chainType) {
|
|
10385
|
-
return wallets.find((wallet) => wallet.chain_type === chainType);
|
|
10386
|
-
}
|
|
10387
|
-
async function queryExecutions(externalUserId, publishableKey) {
|
|
10388
|
-
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
10389
|
-
const response = await fetch(
|
|
10390
|
-
`${API_BASE_URL}/v1/public/direct_executions/query`,
|
|
10391
|
-
{
|
|
10392
|
-
method: "POST",
|
|
10393
|
-
headers: {
|
|
10394
|
-
accept: "application/json",
|
|
10395
|
-
"x-publishable-key": pk,
|
|
10396
|
-
"Content-Type": "application/json"
|
|
10397
|
-
},
|
|
10398
|
-
body: JSON.stringify({
|
|
10399
|
-
external_user_id: externalUserId
|
|
10400
|
-
})
|
|
10401
|
-
}
|
|
10402
|
-
);
|
|
10403
|
-
if (!response.ok) {
|
|
10404
|
-
throw new Error(`Failed to query executions: ${response.statusText}`);
|
|
10405
|
-
}
|
|
10406
|
-
return response.json();
|
|
10407
|
-
}
|
|
10408
|
-
async function getSupportedDepositTokens(publishableKey) {
|
|
10409
|
-
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
10410
|
-
const response = await fetch(
|
|
10411
|
-
`${API_BASE_URL}/v1/public/tokens/supported_deposit_tokens`,
|
|
10412
|
-
{
|
|
10413
|
-
method: "GET",
|
|
10414
|
-
headers: {
|
|
10415
|
-
accept: "application/json",
|
|
10416
|
-
"x-publishable-key": pk
|
|
10417
|
-
}
|
|
10418
|
-
}
|
|
10419
|
-
);
|
|
10420
|
-
if (!response.ok) {
|
|
10421
|
-
throw new Error(
|
|
10422
|
-
`Failed to fetch supported deposit tokens: ${response.statusText}`
|
|
10423
|
-
);
|
|
10424
|
-
}
|
|
10425
|
-
return response.json();
|
|
10426
|
-
}
|
|
10427
|
-
async function getMeldQuotes(request, publishableKey) {
|
|
10428
|
-
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
10429
|
-
const response = await fetch(
|
|
10430
|
-
`${API_BASE_URL}/v1/public/onramps/meld/quotes`,
|
|
10431
|
-
{
|
|
10432
|
-
method: "POST",
|
|
10433
|
-
headers: {
|
|
10434
|
-
accept: "application/json",
|
|
10435
|
-
"x-publishable-key": pk,
|
|
10436
|
-
"Content-Type": "application/json"
|
|
10437
|
-
},
|
|
10438
|
-
body: JSON.stringify(request)
|
|
10439
|
-
}
|
|
10440
|
-
);
|
|
10441
|
-
if (!response.ok) {
|
|
10442
|
-
throw new Error(`Failed to fetch Meld quotes: ${response.statusText}`);
|
|
10443
|
-
}
|
|
10444
|
-
return response.json();
|
|
10445
|
-
}
|
|
10446
|
-
async function createMeldSession(request, publishableKey) {
|
|
10447
|
-
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
10448
|
-
const response = await fetch(
|
|
10449
|
-
`${API_BASE_URL}/v1/public/onramps/meld/sessions`,
|
|
10450
|
-
{
|
|
10451
|
-
method: "POST",
|
|
10452
|
-
headers: {
|
|
10453
|
-
accept: "application/json",
|
|
10454
|
-
"x-publishable-key": pk,
|
|
10455
|
-
"Content-Type": "application/json"
|
|
10456
|
-
},
|
|
10457
|
-
body: JSON.stringify(request)
|
|
10458
|
-
}
|
|
10459
|
-
);
|
|
10460
|
-
if (!response.ok) {
|
|
10461
|
-
throw new Error(`Failed to create Meld session: ${response.statusText}`);
|
|
10462
|
-
}
|
|
10463
|
-
return response.json();
|
|
10464
|
-
}
|
|
10465
|
-
function getPreferredIconUrl(iconUrls, preferredFormat = "svg") {
|
|
10466
|
-
if (!iconUrls || iconUrls.length === 0) {
|
|
10467
|
-
return void 0;
|
|
10468
|
-
}
|
|
10469
|
-
const preferred = iconUrls.find((icon) => icon.format === preferredFormat);
|
|
10470
|
-
if (preferred) {
|
|
10471
|
-
return preferred.url;
|
|
10472
|
-
}
|
|
10473
|
-
return iconUrls[0]?.url;
|
|
10474
|
-
}
|
|
10475
|
-
async function getFiatCurrencies(publishableKey) {
|
|
10476
|
-
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
10477
|
-
const response = await fetch(
|
|
10478
|
-
`${API_BASE_URL}/v1/public/onramps/fiat_currencies`,
|
|
10479
|
-
{
|
|
10480
|
-
method: "GET",
|
|
10481
|
-
headers: {
|
|
10482
|
-
accept: "application/json",
|
|
10483
|
-
"x-publishable-key": pk
|
|
10484
|
-
}
|
|
10485
|
-
}
|
|
10486
|
-
);
|
|
10487
|
-
if (!response.ok) {
|
|
10488
|
-
throw new Error(`Failed to fetch fiat currencies: ${response.statusText}`);
|
|
10489
|
-
}
|
|
10490
|
-
return response.json();
|
|
10491
|
-
}
|
|
10492
|
-
async function getProjectConfig(publishableKey) {
|
|
10493
|
-
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
10494
|
-
const response = await fetch(`${API_BASE_URL}/v1/public/projects/config`, {
|
|
10495
|
-
method: "GET",
|
|
10496
|
-
headers: {
|
|
10497
|
-
accept: "application/json",
|
|
10498
|
-
"x-publishable-key": pk
|
|
10499
|
-
}
|
|
10500
|
-
});
|
|
10501
|
-
if (!response.ok) {
|
|
10502
|
-
throw new Error(`Failed to fetch project config: ${response.statusText}`);
|
|
10503
|
-
}
|
|
10504
|
-
return response.json();
|
|
10505
|
-
}
|
|
10506
10541
|
function DepositExecutionItem({
|
|
10507
10542
|
execution,
|
|
10508
10543
|
onClick
|
|
10509
10544
|
}) {
|
|
10510
|
-
const isPending = execution.status ===
|
|
10545
|
+
const isPending = execution.status === ExecutionStatus.PENDING || execution.status === ExecutionStatus.WAITING || execution.status === ExecutionStatus.DELAYED;
|
|
10511
10546
|
const formatDateTime = (timestamp) => {
|
|
10512
10547
|
try {
|
|
10513
10548
|
const date = new Date(timestamp);
|
|
@@ -10574,7 +10609,7 @@ function DepositExecutionItem({
|
|
|
10574
10609
|
}
|
|
10575
10610
|
)
|
|
10576
10611
|
}
|
|
10577
|
-
) }) : /* @__PURE__ */ jsx52("div", { className: "uf-absolute -uf-bottom-0.5 -uf-right-0.5 uf-bg-
|
|
10612
|
+
) }) : /* @__PURE__ */ jsx52("div", { className: "uf-absolute -uf-bottom-0.5 -uf-right-0.5 uf-bg-green-500 uf-rounded-full uf-p-0.5", children: /* @__PURE__ */ jsx52("svg", { width: "10", height: "10", viewBox: "0 0 12 12", fill: "none", className: "uf-block", children: /* @__PURE__ */ jsx52(
|
|
10578
10613
|
"path",
|
|
10579
10614
|
{
|
|
10580
10615
|
d: "M10 3L4.5 8.5L2 6",
|
|
@@ -10586,7 +10621,7 @@ function DepositExecutionItem({
|
|
|
10586
10621
|
) }) })
|
|
10587
10622
|
] }),
|
|
10588
10623
|
/* @__PURE__ */ jsxs32("div", { className: "uf-flex-1 uf-min-w-0", children: [
|
|
10589
|
-
/* @__PURE__ */ jsx52("h3", { className: "uf-text-foreground uf-font-medium uf-text-sm uf-leading-tight", children: isPending ? "Deposit
|
|
10624
|
+
/* @__PURE__ */ jsx52("h3", { className: "uf-text-foreground uf-font-medium uf-text-sm uf-leading-tight", children: isPending ? "Deposit processing" : "Deposit completed" }),
|
|
10590
10625
|
/* @__PURE__ */ jsx52("p", { className: "uf-text-muted-foreground uf-text-xs uf-leading-tight", children: formatDateTime(execution.created_at || (/* @__PURE__ */ new Date()).toISOString()) })
|
|
10591
10626
|
] }),
|
|
10592
10627
|
/* @__PURE__ */ jsx52("span", { className: "uf-text-foreground uf-font-medium uf-text-sm uf-flex-shrink-0", children: formatUsdAmount(execution.source_amount_base_unit) }),
|
|
@@ -10595,27 +10630,24 @@ function DepositExecutionItem({
|
|
|
10595
10630
|
}
|
|
10596
10631
|
);
|
|
10597
10632
|
}
|
|
10598
|
-
|
|
10599
|
-
|
|
10600
|
-
|
|
10601
|
-
|
|
10602
|
-
|
|
10603
|
-
|
|
10604
|
-
|
|
10605
|
-
|
|
10606
|
-
|
|
10607
|
-
|
|
10608
|
-
|
|
10609
|
-
|
|
10610
|
-
|
|
10611
|
-
|
|
10612
|
-
|
|
10613
|
-
|
|
10614
|
-
execution
|
|
10615
|
-
|
|
10616
|
-
}) {
|
|
10617
|
-
if (!execution) return null;
|
|
10618
|
-
const isPending = execution.status === "pending" || execution.status === "waiting" || execution.status === "delayed";
|
|
10633
|
+
function formatCurrency(currency) {
|
|
10634
|
+
if (!currency) return "";
|
|
10635
|
+
const dotIndex = currency.indexOf(".");
|
|
10636
|
+
if (dotIndex === -1) {
|
|
10637
|
+
return currency.toUpperCase();
|
|
10638
|
+
}
|
|
10639
|
+
return currency.slice(0, dotIndex).toUpperCase() + currency.slice(dotIndex);
|
|
10640
|
+
}
|
|
10641
|
+
function DepositDetailContent({ execution }) {
|
|
10642
|
+
const [chains, setChains] = useState16([]);
|
|
10643
|
+
const [showNetworkDetails, setShowNetworkDetails] = useState16(false);
|
|
10644
|
+
useEffect22(() => {
|
|
10645
|
+
getTokenChains().then((response) => setChains(response.data)).catch((err) => console.error("Failed to fetch chains:", err));
|
|
10646
|
+
}, []);
|
|
10647
|
+
useEffect22(() => {
|
|
10648
|
+
setShowNetworkDetails(false);
|
|
10649
|
+
}, [execution?.id]);
|
|
10650
|
+
const isPending = execution.status === ExecutionStatus.PENDING || execution.status === ExecutionStatus.WAITING || execution.status === ExecutionStatus.DELAYED;
|
|
10619
10651
|
const formatDateTime = (timestamp) => {
|
|
10620
10652
|
try {
|
|
10621
10653
|
const date = new Date(timestamp);
|
|
@@ -10670,170 +10702,161 @@ function DepositDetailModal({
|
|
|
10670
10702
|
return "$0.00";
|
|
10671
10703
|
};
|
|
10672
10704
|
const getNetworkName = (chainType, chainId) => {
|
|
10673
|
-
return
|
|
10674
|
-
};
|
|
10675
|
-
const getSourceTokenSymbol = () => {
|
|
10676
|
-
return "USDC";
|
|
10705
|
+
return getChainName(chains, chainType, chainId);
|
|
10677
10706
|
};
|
|
10678
|
-
const
|
|
10679
|
-
return
|
|
10707
|
+
const formatTransactionHash = (hash) => {
|
|
10708
|
+
if (!hash || hash.length < 12) return hash;
|
|
10709
|
+
return `${hash.slice(0, 12)}...${hash.slice(-4)}`;
|
|
10680
10710
|
};
|
|
10681
|
-
|
|
10682
|
-
|
|
10683
|
-
|
|
10684
|
-
|
|
10685
|
-
|
|
10686
|
-
|
|
10687
|
-
|
|
10688
|
-
|
|
10689
|
-
|
|
10690
|
-
|
|
10691
|
-
|
|
10692
|
-
|
|
10693
|
-
|
|
10694
|
-
|
|
10695
|
-
|
|
10696
|
-
|
|
10697
|
-
|
|
10698
|
-
|
|
10699
|
-
|
|
10700
|
-
|
|
10701
|
-
|
|
10702
|
-
|
|
10703
|
-
|
|
10704
|
-
"svg",
|
|
10705
|
-
{
|
|
10706
|
-
width: "16",
|
|
10707
|
-
height: "16",
|
|
10708
|
-
viewBox: "0 0 12 12",
|
|
10709
|
-
fill: "none",
|
|
10710
|
-
className: "uf-animate-spin uf-block",
|
|
10711
|
-
children: /* @__PURE__ */ jsx62(
|
|
10712
|
-
"path",
|
|
10713
|
-
{
|
|
10714
|
-
d: "M6 1V3M6 9V11M1 6H3M9 6H11M2.5 2.5L4 4M8 8L9.5 9.5M2.5 9.5L4 8M8 4L9.5 2.5",
|
|
10715
|
-
stroke: "white",
|
|
10716
|
-
strokeWidth: "2",
|
|
10717
|
-
strokeLinecap: "round"
|
|
10718
|
-
}
|
|
10719
|
-
)
|
|
10720
|
-
}
|
|
10721
|
-
) }) : /* @__PURE__ */ jsx62("div", { className: "uf-absolute -uf-bottom-1 -uf-right-1 uf-bg-blue-500 uf-rounded-full uf-p-1", children: /* @__PURE__ */ jsx62(
|
|
10722
|
-
"svg",
|
|
10723
|
-
{
|
|
10724
|
-
width: "16",
|
|
10725
|
-
height: "16",
|
|
10726
|
-
viewBox: "0 0 12 12",
|
|
10727
|
-
fill: "none",
|
|
10728
|
-
className: "uf-block",
|
|
10729
|
-
children: /* @__PURE__ */ jsx62(
|
|
10730
|
-
"path",
|
|
10731
|
-
{
|
|
10732
|
-
d: "M10 3L4.5 8.5L2 6",
|
|
10733
|
-
stroke: "white",
|
|
10734
|
-
strokeWidth: "2",
|
|
10735
|
-
strokeLinecap: "round",
|
|
10736
|
-
strokeLinejoin: "round"
|
|
10737
|
-
}
|
|
10738
|
-
)
|
|
10739
|
-
}
|
|
10740
|
-
) })
|
|
10741
|
-
] }),
|
|
10742
|
-
/* @__PURE__ */ jsxs42("div", { className: "uf-flex uf-items-center uf-gap-1.5 uf-mb-1", children: [
|
|
10743
|
-
/* @__PURE__ */ jsx62(
|
|
10744
|
-
"div",
|
|
10745
|
-
{
|
|
10746
|
-
className: `uf-w-2 uf-h-2 uf-rounded-full ${isPending ? "uf-bg-yellow-500" : "uf-bg-green-500"}`
|
|
10747
|
-
}
|
|
10748
|
-
),
|
|
10749
|
-
/* @__PURE__ */ jsx62("span", { className: "uf-text-foreground uf-font-medium", children: isPending ? "Pending" : "Completed" })
|
|
10750
|
-
] }),
|
|
10751
|
-
/* @__PURE__ */ jsx62("span", { className: "uf-text-muted-foreground uf-text-sm", children: formatDateTime(execution.created_at || (/* @__PURE__ */ new Date()).toISOString()) })
|
|
10752
|
-
] }),
|
|
10753
|
-
/* @__PURE__ */ jsxs42("div", { className: "uf-bg-secondary uf-rounded-xl uf-overflow-hidden uf-mb-3", children: [
|
|
10754
|
-
/* @__PURE__ */ jsxs42("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3 uf-border-b uf-border-border/50", children: [
|
|
10755
|
-
/* @__PURE__ */ jsx62("span", { className: "uf-text-muted-foreground uf-text-sm", children: "Amount Sent" }),
|
|
10756
|
-
/* @__PURE__ */ jsxs42("span", { className: "uf-text-foreground uf-font-medium", children: [
|
|
10757
|
-
formatAmount(execution.source_amount_base_unit),
|
|
10758
|
-
" ",
|
|
10759
|
-
getSourceTokenSymbol()
|
|
10760
|
-
] })
|
|
10761
|
-
] }),
|
|
10762
|
-
/* @__PURE__ */ jsxs42("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3 uf-border-b uf-border-border/50", children: [
|
|
10763
|
-
/* @__PURE__ */ jsx62("span", { className: "uf-text-muted-foreground uf-text-sm", children: "Amount Received" }),
|
|
10764
|
-
/* @__PURE__ */ jsxs42("span", { className: "uf-text-foreground uf-font-medium", children: [
|
|
10765
|
-
formatAmount(execution.destination_amount_base_unit),
|
|
10766
|
-
" ",
|
|
10767
|
-
getDestinationTokenSymbol()
|
|
10768
|
-
] })
|
|
10769
|
-
] }),
|
|
10770
|
-
/* @__PURE__ */ jsxs42("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3", children: [
|
|
10771
|
-
/* @__PURE__ */ jsx62("span", { className: "uf-text-muted-foreground uf-text-sm", children: "USD Value" }),
|
|
10772
|
-
/* @__PURE__ */ jsx62("span", { className: "uf-text-foreground uf-font-medium", children: formatUsdAmount(execution.source_amount_usd, execution.source_amount_base_unit) })
|
|
10773
|
-
] })
|
|
10774
|
-
] }),
|
|
10775
|
-
/* @__PURE__ */ jsxs42("div", { className: "uf-bg-secondary uf-rounded-xl uf-overflow-hidden uf-mb-4", children: [
|
|
10776
|
-
/* @__PURE__ */ jsxs42("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3 uf-border-b uf-border-border/50", children: [
|
|
10777
|
-
/* @__PURE__ */ jsx62("span", { className: "uf-text-muted-foreground uf-text-sm", children: "Source Network" }),
|
|
10778
|
-
/* @__PURE__ */ jsx62("span", { className: "uf-text-foreground uf-font-medium", children: getNetworkName(execution.source_chain_type, execution.source_chain_id) })
|
|
10779
|
-
] }),
|
|
10780
|
-
/* @__PURE__ */ jsxs42("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3", children: [
|
|
10781
|
-
/* @__PURE__ */ jsx62("span", { className: "uf-text-muted-foreground uf-text-sm", children: "Destination Network" }),
|
|
10782
|
-
/* @__PURE__ */ jsx62("span", { className: "uf-text-foreground uf-font-medium", children: getNetworkName(execution.destination_chain_type, execution.destination_chain_id) })
|
|
10783
|
-
] })
|
|
10784
|
-
] }),
|
|
10785
|
-
/* @__PURE__ */ jsxs42("div", { className: "uf-space-y-2", children: [
|
|
10786
|
-
execution.explorer_url && /* @__PURE__ */ jsxs42(
|
|
10787
|
-
"a",
|
|
10711
|
+
return /* @__PURE__ */ jsxs42("div", { className: "uf-px-2", children: [
|
|
10712
|
+
/* @__PURE__ */ jsxs42("div", { className: "uf-flex uf-flex-col uf-items-center uf-py-6", children: [
|
|
10713
|
+
/* @__PURE__ */ jsxs42("div", { className: "uf-relative uf-mb-3", children: [
|
|
10714
|
+
/* @__PURE__ */ jsx62(
|
|
10715
|
+
"img",
|
|
10716
|
+
{
|
|
10717
|
+
src: execution.destination_token_metadata?.icon_url || getIconUrl("/icons/tokens/svg/usdc.svg"),
|
|
10718
|
+
alt: "Token",
|
|
10719
|
+
width: 64,
|
|
10720
|
+
height: 64,
|
|
10721
|
+
className: "uf-rounded-full"
|
|
10722
|
+
}
|
|
10723
|
+
),
|
|
10724
|
+
isPending ? /* @__PURE__ */ jsx62("div", { className: "uf-absolute -uf-bottom-1 -uf-right-1 uf-bg-yellow-500 uf-rounded-full uf-p-1", children: /* @__PURE__ */ jsx62(
|
|
10725
|
+
"svg",
|
|
10726
|
+
{
|
|
10727
|
+
width: "16",
|
|
10728
|
+
height: "16",
|
|
10729
|
+
viewBox: "0 0 24 24",
|
|
10730
|
+
fill: "none",
|
|
10731
|
+
className: "uf-animate-spin uf-block",
|
|
10732
|
+
children: /* @__PURE__ */ jsx62(
|
|
10733
|
+
"path",
|
|
10788
10734
|
{
|
|
10789
|
-
|
|
10790
|
-
|
|
10791
|
-
|
|
10792
|
-
|
|
10793
|
-
children: [
|
|
10794
|
-
/* @__PURE__ */ jsxs42("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
10795
|
-
/* @__PURE__ */ jsx62(ArrowDownCircle, { className: "uf-w-5 uf-h-5" }),
|
|
10796
|
-
/* @__PURE__ */ jsx62("span", { className: "uf-font-medium", children: "View Deposit Transaction" })
|
|
10797
|
-
] }),
|
|
10798
|
-
/* @__PURE__ */ jsx62(ExternalLink, { className: "uf-w-4 uf-h-4" })
|
|
10799
|
-
]
|
|
10735
|
+
d: "M21 12a9 9 0 1 1-6.22-8.56",
|
|
10736
|
+
stroke: "white",
|
|
10737
|
+
strokeWidth: "3",
|
|
10738
|
+
strokeLinecap: "round"
|
|
10800
10739
|
}
|
|
10801
|
-
)
|
|
10802
|
-
|
|
10803
|
-
|
|
10740
|
+
)
|
|
10741
|
+
}
|
|
10742
|
+
) }) : /* @__PURE__ */ jsx62("div", { className: "uf-absolute -uf-bottom-1 -uf-right-1 uf-bg-green-500 uf-rounded-full uf-p-1", children: /* @__PURE__ */ jsx62(
|
|
10743
|
+
"svg",
|
|
10744
|
+
{
|
|
10745
|
+
width: "16",
|
|
10746
|
+
height: "16",
|
|
10747
|
+
viewBox: "0 0 12 12",
|
|
10748
|
+
fill: "none",
|
|
10749
|
+
className: "uf-block",
|
|
10750
|
+
children: /* @__PURE__ */ jsx62(
|
|
10751
|
+
"path",
|
|
10804
10752
|
{
|
|
10805
|
-
|
|
10806
|
-
|
|
10807
|
-
|
|
10808
|
-
|
|
10809
|
-
|
|
10810
|
-
/* @__PURE__ */ jsxs42("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
10811
|
-
/* @__PURE__ */ jsx62(CheckCircle, { className: "uf-w-5 uf-h-5" }),
|
|
10812
|
-
/* @__PURE__ */ jsx62("span", { className: "uf-font-medium", children: "View Completion Transaction" })
|
|
10813
|
-
] }),
|
|
10814
|
-
/* @__PURE__ */ jsx62(ExternalLink, { className: "uf-w-4 uf-h-4" })
|
|
10815
|
-
]
|
|
10753
|
+
d: "M10 3L4.5 8.5L2 6",
|
|
10754
|
+
stroke: "white",
|
|
10755
|
+
strokeWidth: "2",
|
|
10756
|
+
strokeLinecap: "round",
|
|
10757
|
+
strokeLinejoin: "round"
|
|
10816
10758
|
}
|
|
10817
10759
|
)
|
|
10818
|
-
|
|
10819
|
-
|
|
10760
|
+
}
|
|
10761
|
+
) })
|
|
10762
|
+
] }),
|
|
10763
|
+
/* @__PURE__ */ jsxs42("div", { className: "uf-flex uf-items-center uf-gap-1.5 uf-mb-1", children: [
|
|
10764
|
+
/* @__PURE__ */ jsx62(
|
|
10765
|
+
"div",
|
|
10766
|
+
{
|
|
10767
|
+
className: `uf-w-2 uf-h-2 uf-rounded-full ${isPending ? "uf-bg-yellow-500" : "uf-bg-green-500"}`
|
|
10768
|
+
}
|
|
10769
|
+
),
|
|
10770
|
+
/* @__PURE__ */ jsx62("span", { className: "uf-text-foreground uf-font-medium", children: isPending ? "Processing" : "Completed" })
|
|
10771
|
+
] }),
|
|
10772
|
+
/* @__PURE__ */ jsx62("span", { className: "uf-text-muted-foreground uf-text-sm", children: formatDateTime(execution.created_at || (/* @__PURE__ */ new Date()).toISOString()) })
|
|
10773
|
+
] }),
|
|
10774
|
+
/* @__PURE__ */ jsxs42("div", { className: "uf-bg-secondary uf-rounded-xl uf-overflow-hidden uf-mb-3", children: [
|
|
10775
|
+
/* @__PURE__ */ jsxs42("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3 uf-border-b uf-border-border/50", children: [
|
|
10776
|
+
/* @__PURE__ */ jsx62("span", { className: "uf-text-muted-foreground uf-text-sm", children: "Amount Sent" }),
|
|
10777
|
+
/* @__PURE__ */ jsxs42("span", { className: "uf-text-foreground uf-font-medium", children: [
|
|
10778
|
+
formatAmount(execution.source_amount_base_unit),
|
|
10779
|
+
" ",
|
|
10780
|
+
formatCurrency(execution.source_currency)
|
|
10820
10781
|
] })
|
|
10821
|
-
]
|
|
10822
|
-
|
|
10823
|
-
|
|
10782
|
+
] }),
|
|
10783
|
+
/* @__PURE__ */ jsxs42("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3 uf-border-b uf-border-border/50", children: [
|
|
10784
|
+
/* @__PURE__ */ jsx62("span", { className: "uf-text-muted-foreground uf-text-sm", children: "Amount Received" }),
|
|
10785
|
+
/* @__PURE__ */ jsxs42("span", { className: "uf-text-foreground uf-font-medium", children: [
|
|
10786
|
+
formatAmount(execution.destination_amount_base_unit),
|
|
10787
|
+
" ",
|
|
10788
|
+
formatCurrency(execution.destination_currency)
|
|
10789
|
+
] })
|
|
10790
|
+
] }),
|
|
10791
|
+
/* @__PURE__ */ jsxs42("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3 uf-border-b uf-border-border/50", children: [
|
|
10792
|
+
/* @__PURE__ */ jsx62("span", { className: "uf-text-muted-foreground uf-text-sm", children: "USD Value" }),
|
|
10793
|
+
/* @__PURE__ */ jsx62("span", { className: "uf-text-foreground uf-font-medium", children: formatUsdAmount(execution.source_amount_usd, execution.source_amount_base_unit) })
|
|
10794
|
+
] }),
|
|
10795
|
+
/* @__PURE__ */ jsxs42("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3 uf-border-b uf-border-border/50", children: [
|
|
10796
|
+
/* @__PURE__ */ jsx62("span", { className: "uf-text-muted-foreground uf-text-sm", children: "Source Network" }),
|
|
10797
|
+
/* @__PURE__ */ jsx62("span", { className: "uf-text-foreground uf-font-medium", children: getNetworkName(execution.source_chain_type, execution.source_chain_id) })
|
|
10798
|
+
] }),
|
|
10799
|
+
/* @__PURE__ */ jsxs42("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3", children: [
|
|
10800
|
+
/* @__PURE__ */ jsx62("span", { className: "uf-text-muted-foreground uf-text-sm", children: "Destination Network" }),
|
|
10801
|
+
/* @__PURE__ */ jsx62("span", { className: "uf-text-foreground uf-font-medium", children: getNetworkName(execution.destination_chain_type, execution.destination_chain_id) })
|
|
10802
|
+
] })
|
|
10803
|
+
] }),
|
|
10804
|
+
/* @__PURE__ */ jsxs42(
|
|
10805
|
+
"button",
|
|
10806
|
+
{
|
|
10807
|
+
type: "button",
|
|
10808
|
+
onClick: () => setShowNetworkDetails(!showNetworkDetails),
|
|
10809
|
+
className: "uf-flex uf-justify-between uf-items-center uf-w-full uf-px-3 uf-pb-3 uf-text-muted-foreground uf-text-sm hover:uf-text-foreground uf-transition-colors",
|
|
10810
|
+
children: [
|
|
10811
|
+
/* @__PURE__ */ jsx62("span", { children: showNetworkDetails ? "See less" : "See more details" }),
|
|
10812
|
+
showNetworkDetails ? /* @__PURE__ */ jsx62(ChevronUp, { className: "uf-w-4 uf-h-4" }) : /* @__PURE__ */ jsx62(ChevronDown, { className: "uf-w-4 uf-h-4" })
|
|
10813
|
+
]
|
|
10814
|
+
}
|
|
10815
|
+
),
|
|
10816
|
+
showNetworkDetails && /* @__PURE__ */ jsxs42("div", { className: "uf-bg-secondary uf-rounded-xl uf-overflow-hidden uf-mb-4", children: [
|
|
10817
|
+
execution.transaction_hash && execution.explorer_url && /* @__PURE__ */ jsxs42(
|
|
10818
|
+
"a",
|
|
10819
|
+
{
|
|
10820
|
+
href: execution.explorer_url,
|
|
10821
|
+
target: "_blank",
|
|
10822
|
+
rel: "noopener noreferrer",
|
|
10823
|
+
className: "uf-grid uf-grid-cols-[auto_1fr_auto] uf-items-center uf-gap-2 uf-px-4 uf-py-3 uf-border-b uf-border-border/50 hover:uf-bg-card/50 uf-transition-colors",
|
|
10824
|
+
children: [
|
|
10825
|
+
/* @__PURE__ */ jsx62("div", { className: "uf-text-muted-foreground uf-text-sm", children: "Deposit Tx" }),
|
|
10826
|
+
/* @__PURE__ */ jsx62("div", { className: "uf-text-sm uf-text-foreground uf-text-right", children: formatTransactionHash(execution.transaction_hash) }),
|
|
10827
|
+
/* @__PURE__ */ jsx62(ExternalLink, { className: "uf-w-3.5 uf-h-3.5 uf-text-muted-foreground uf-block" })
|
|
10828
|
+
]
|
|
10829
|
+
}
|
|
10830
|
+
),
|
|
10831
|
+
!isPending && execution.destination_transaction_hashes?.length > 0 && execution.destination_explorer_url && /* @__PURE__ */ jsxs42(
|
|
10832
|
+
"a",
|
|
10833
|
+
{
|
|
10834
|
+
href: execution.destination_explorer_url,
|
|
10835
|
+
target: "_blank",
|
|
10836
|
+
rel: "noopener noreferrer",
|
|
10837
|
+
className: "uf-grid uf-grid-cols-[auto_1fr_auto] uf-items-center uf-gap-2 uf-px-4 uf-py-3 hover:uf-bg-card/50 uf-transition-colors",
|
|
10838
|
+
children: [
|
|
10839
|
+
/* @__PURE__ */ jsx62("div", { className: "uf-text-muted-foreground uf-text-sm", children: "Completion Tx" }),
|
|
10840
|
+
/* @__PURE__ */ jsx62("div", { className: "uf-text-sm uf-text-foreground uf-text-right", children: formatTransactionHash(execution.destination_transaction_hashes[0]) }),
|
|
10841
|
+
/* @__PURE__ */ jsx62(ExternalLink, { className: "uf-w-3.5 uf-h-3.5 uf-text-muted-foreground uf-block" })
|
|
10842
|
+
]
|
|
10843
|
+
}
|
|
10844
|
+
)
|
|
10845
|
+
] })
|
|
10846
|
+
] });
|
|
10824
10847
|
}
|
|
10825
10848
|
function DepositsModal({
|
|
10826
10849
|
open,
|
|
10827
10850
|
onOpenChange,
|
|
10851
|
+
onCloseAll,
|
|
10828
10852
|
executions: sessionExecutions,
|
|
10829
10853
|
userId,
|
|
10830
10854
|
publishableKey,
|
|
10831
10855
|
themeClass = ""
|
|
10832
10856
|
}) {
|
|
10833
|
-
const [allExecutions, setAllExecutions] =
|
|
10834
|
-
const [selectedExecution, setSelectedExecution] =
|
|
10835
|
-
|
|
10836
|
-
useEffect22(() => {
|
|
10857
|
+
const [allExecutions, setAllExecutions] = useState22(sessionExecutions);
|
|
10858
|
+
const [selectedExecution, setSelectedExecution] = useState22(null);
|
|
10859
|
+
useEffect32(() => {
|
|
10837
10860
|
if (!open || !userId) return;
|
|
10838
10861
|
const fetchExecutions = async () => {
|
|
10839
10862
|
try {
|
|
@@ -10855,35 +10878,55 @@ function DepositsModal({
|
|
|
10855
10878
|
clearInterval(pollInterval);
|
|
10856
10879
|
};
|
|
10857
10880
|
}, [open, userId, publishableKey, sessionExecutions]);
|
|
10881
|
+
useEffect32(() => {
|
|
10882
|
+
if (!open) {
|
|
10883
|
+
setSelectedExecution(null);
|
|
10884
|
+
}
|
|
10885
|
+
}, [open]);
|
|
10886
|
+
const handleBack = () => {
|
|
10887
|
+
if (selectedExecution) {
|
|
10888
|
+
setSelectedExecution(null);
|
|
10889
|
+
} else {
|
|
10890
|
+
onOpenChange(false);
|
|
10891
|
+
}
|
|
10892
|
+
};
|
|
10858
10893
|
const handleClose = () => {
|
|
10859
10894
|
onOpenChange(false);
|
|
10895
|
+
onCloseAll?.();
|
|
10860
10896
|
};
|
|
10861
10897
|
const handleExecutionClick = (execution) => {
|
|
10862
10898
|
setSelectedExecution(execution);
|
|
10863
|
-
setDetailModalOpen(true);
|
|
10864
10899
|
};
|
|
10865
|
-
return /* @__PURE__ */ jsxs5(Fragment8, { children: [
|
|
10866
|
-
/* @__PURE__ */ jsx72(Dialog2, { open, onOpenChange, children: /* @__PURE__ */ jsxs5(DialogContent2, { className: `sm:uf-max-w-[400px] !uf-bg-card uf-border-secondary uf-text-foreground uf-p-0 uf-gap-0 [&>button]:uf-hidden ${themeClass}`, children: [
|
|
10867
|
-
/* @__PURE__ */ jsx72(DepositHeader, { title: "Deposit Tracker", onClose: handleClose }),
|
|
10868
|
-
/* @__PURE__ */ jsx72("div", { className: "uf-max-h-[500px] uf-overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:uf-hidden uf-pb-4", children: /* @__PURE__ */ jsx72("div", { className: "uf-space-y-2", children: allExecutions.length === 0 ? /* @__PURE__ */ jsx72("div", { className: "uf-py-8 uf-px-4 uf-text-center", children: /* @__PURE__ */ jsx72("div", { className: "uf-text-muted-foreground uf-text-sm", children: "No deposits yet" }) }) : /* @__PURE__ */ jsx72(Fragment8, { children: allExecutions.map((execution) => /* @__PURE__ */ jsx72(
|
|
10869
|
-
DepositExecutionItem,
|
|
10870
|
-
{
|
|
10871
|
-
execution,
|
|
10872
|
-
onClick: () => handleExecutionClick(execution)
|
|
10873
|
-
},
|
|
10874
|
-
execution.id
|
|
10875
|
-
)) }) }) })
|
|
10876
|
-
] }) }),
|
|
10900
|
+
return /* @__PURE__ */ jsx72(Dialog2, { open, onOpenChange, children: /* @__PURE__ */ jsx72(DialogContent2, { className: `sm:uf-max-w-[400px] !uf-bg-card uf-border-secondary uf-text-foreground uf-p-0 uf-gap-0 [&>button]:uf-hidden ${themeClass}`, children: selectedExecution ? /* @__PURE__ */ jsxs5(Fragment8, { children: [
|
|
10877
10901
|
/* @__PURE__ */ jsx72(
|
|
10878
|
-
|
|
10902
|
+
DepositHeader,
|
|
10879
10903
|
{
|
|
10880
|
-
|
|
10881
|
-
|
|
10882
|
-
|
|
10883
|
-
|
|
10904
|
+
title: "Deposit Details",
|
|
10905
|
+
showBack: true,
|
|
10906
|
+
onBack: () => setSelectedExecution(null),
|
|
10907
|
+
onClose: handleClose
|
|
10884
10908
|
}
|
|
10885
|
-
)
|
|
10886
|
-
|
|
10909
|
+
),
|
|
10910
|
+
/* @__PURE__ */ jsx72(DepositDetailContent, { execution: selectedExecution })
|
|
10911
|
+
] }) : /* @__PURE__ */ jsxs5(Fragment8, { children: [
|
|
10912
|
+
/* @__PURE__ */ jsx72(
|
|
10913
|
+
DepositHeader,
|
|
10914
|
+
{
|
|
10915
|
+
title: "Deposit Tracker",
|
|
10916
|
+
showBack: true,
|
|
10917
|
+
onBack: handleBack,
|
|
10918
|
+
onClose: handleClose
|
|
10919
|
+
}
|
|
10920
|
+
),
|
|
10921
|
+
/* @__PURE__ */ jsx72("div", { className: "uf-max-h-[400px] uf-overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:uf-hidden", children: /* @__PURE__ */ jsx72("div", { className: "uf-space-y-2", children: allExecutions.length === 0 ? /* @__PURE__ */ jsx72("div", { className: "uf-py-8 uf-px-4 uf-text-center", children: /* @__PURE__ */ jsx72("div", { className: "uf-text-muted-foreground uf-text-sm", children: "No deposits yet" }) }) : /* @__PURE__ */ jsx72(Fragment8, { children: allExecutions.map((execution) => /* @__PURE__ */ jsx72(
|
|
10922
|
+
DepositExecutionItem,
|
|
10923
|
+
{
|
|
10924
|
+
execution,
|
|
10925
|
+
onClick: () => handleExecutionClick(execution)
|
|
10926
|
+
},
|
|
10927
|
+
execution.id
|
|
10928
|
+
)) }) }) })
|
|
10929
|
+
] }) }) });
|
|
10887
10930
|
}
|
|
10888
10931
|
function DepositSuccessToast({
|
|
10889
10932
|
depositTx,
|
|
@@ -10891,9 +10934,12 @@ function DepositSuccessToast({
|
|
|
10891
10934
|
status,
|
|
10892
10935
|
tokenIconUrl,
|
|
10893
10936
|
sourceAmountBaseUnit = "0",
|
|
10894
|
-
onClose
|
|
10937
|
+
onClose,
|
|
10938
|
+
execution
|
|
10895
10939
|
}) {
|
|
10896
|
-
const
|
|
10940
|
+
const [detailModalOpen, setDetailModalOpen] = useState32(false);
|
|
10941
|
+
const { themeClass } = useTheme();
|
|
10942
|
+
const isPending = status === ExecutionStatus.PENDING || status === ExecutionStatus.WAITING || status === ExecutionStatus.DELAYED;
|
|
10897
10943
|
const formatDateTime = (timestamp) => {
|
|
10898
10944
|
try {
|
|
10899
10945
|
const date = new Date(timestamp);
|
|
@@ -10925,61 +10971,124 @@ function DepositSuccessToast({
|
|
|
10925
10971
|
return "$0.00";
|
|
10926
10972
|
}
|
|
10927
10973
|
};
|
|
10928
|
-
return /* @__PURE__ */
|
|
10929
|
-
/* @__PURE__ */
|
|
10930
|
-
|
|
10931
|
-
|
|
10932
|
-
|
|
10933
|
-
|
|
10934
|
-
|
|
10935
|
-
|
|
10936
|
-
|
|
10937
|
-
className: "uf-rounded-full"
|
|
10938
|
-
}
|
|
10939
|
-
),
|
|
10940
|
-
isPending ? /* @__PURE__ */ jsx82("div", { className: "uf-absolute uf--bottom-0.5 uf--right-0.5 uf-bg-yellow-500 uf-rounded-full uf-p-0.5", children: /* @__PURE__ */ jsx82(
|
|
10974
|
+
return /* @__PURE__ */ jsxs6(Fragment23, { children: [
|
|
10975
|
+
isPending && /* @__PURE__ */ jsx82("style", { children: `
|
|
10976
|
+
@keyframes border-travel {
|
|
10977
|
+
from { stroke-dashoffset: 0; }
|
|
10978
|
+
to { stroke-dashoffset: -1000; }
|
|
10979
|
+
}
|
|
10980
|
+
` }),
|
|
10981
|
+
/* @__PURE__ */ jsx82("div", { className: "uf-w-full uf-animate-in uf-slide-in-from-bottom-2 uf-duration-300", children: /* @__PURE__ */ jsxs6("div", { className: "uf-relative uf-rounded-xl", children: [
|
|
10982
|
+
isPending && /* @__PURE__ */ jsx82(
|
|
10941
10983
|
"svg",
|
|
10942
10984
|
{
|
|
10943
|
-
|
|
10944
|
-
|
|
10945
|
-
viewBox: "0 0 12 12",
|
|
10946
|
-
fill: "none",
|
|
10947
|
-
className: "uf-animate-spin",
|
|
10985
|
+
className: "uf-absolute uf-inset-0 uf-w-full uf-h-full uf-pointer-events-none uf-z-[1]",
|
|
10986
|
+
style: { overflow: "visible" },
|
|
10948
10987
|
children: /* @__PURE__ */ jsx82(
|
|
10949
|
-
"
|
|
10988
|
+
"rect",
|
|
10950
10989
|
{
|
|
10951
|
-
|
|
10952
|
-
|
|
10953
|
-
|
|
10954
|
-
|
|
10990
|
+
x: "5",
|
|
10991
|
+
y: "2",
|
|
10992
|
+
rx: "10",
|
|
10993
|
+
ry: "10",
|
|
10994
|
+
fill: "none",
|
|
10995
|
+
stroke: "#ecc94b",
|
|
10996
|
+
strokeWidth: "3",
|
|
10997
|
+
strokeDasharray: "120 880",
|
|
10998
|
+
strokeLinecap: "round",
|
|
10999
|
+
pathLength: "1000",
|
|
11000
|
+
style: {
|
|
11001
|
+
width: "calc(100% - 10px)",
|
|
11002
|
+
height: "calc(100% - 4px)",
|
|
11003
|
+
animation: "border-travel 2.5s linear infinite"
|
|
11004
|
+
}
|
|
10955
11005
|
}
|
|
10956
11006
|
)
|
|
10957
11007
|
}
|
|
10958
|
-
)
|
|
10959
|
-
|
|
11008
|
+
),
|
|
11009
|
+
/* @__PURE__ */ jsxs6(
|
|
11010
|
+
"div",
|
|
10960
11011
|
{
|
|
10961
|
-
|
|
10962
|
-
|
|
10963
|
-
|
|
10964
|
-
|
|
10965
|
-
|
|
11012
|
+
onClick: () => execution && setDetailModalOpen(true),
|
|
11013
|
+
className: `uf-relative uf-bg-white dark:uf-bg-black hover:uf-opacity-90 uf-rounded-xl uf-p-3 uf-mx-1 uf-flex uf-items-center uf-gap-3 uf-transition-all uf-cursor-pointer ${isPending ? "" : "uf-border uf-border-zinc-300 dark:uf-border-zinc-700"}`,
|
|
11014
|
+
children: [
|
|
11015
|
+
/* @__PURE__ */ jsxs6("div", { className: "uf-relative uf-flex-shrink-0", children: [
|
|
11016
|
+
/* @__PURE__ */ jsx82(
|
|
11017
|
+
"img",
|
|
11018
|
+
{
|
|
11019
|
+
src: tokenIconUrl || getIconUrl("/icons/tokens/svg/usdc.svg"),
|
|
11020
|
+
alt: "Token",
|
|
11021
|
+
width: 36,
|
|
11022
|
+
height: 36,
|
|
11023
|
+
className: "uf-rounded-full"
|
|
11024
|
+
}
|
|
11025
|
+
),
|
|
11026
|
+
isPending ? /* @__PURE__ */ jsx82("div", { className: "uf-absolute uf--bottom-0.5 uf--right-0.5 uf-bg-yellow-500 uf-rounded-full uf-p-0.5", children: /* @__PURE__ */ jsx82(
|
|
11027
|
+
"svg",
|
|
11028
|
+
{
|
|
11029
|
+
width: "10",
|
|
11030
|
+
height: "10",
|
|
11031
|
+
viewBox: "0 0 24 24",
|
|
11032
|
+
fill: "none",
|
|
11033
|
+
className: "uf-animate-spin",
|
|
11034
|
+
children: /* @__PURE__ */ jsx82(
|
|
11035
|
+
"path",
|
|
11036
|
+
{
|
|
11037
|
+
d: "M21 12a9 9 0 1 1-6.22-8.56",
|
|
11038
|
+
stroke: "white",
|
|
11039
|
+
strokeWidth: "3",
|
|
11040
|
+
strokeLinecap: "round"
|
|
11041
|
+
}
|
|
11042
|
+
)
|
|
11043
|
+
}
|
|
11044
|
+
) }) : /* @__PURE__ */ jsx82("div", { className: "uf-absolute uf--bottom-0.5 uf--right-0.5 uf-bg-green-500 uf-rounded-full uf-p-0.5", children: /* @__PURE__ */ jsx82("svg", { width: "10", height: "10", viewBox: "0 0 12 12", fill: "none", children: /* @__PURE__ */ jsx82(
|
|
11045
|
+
"path",
|
|
11046
|
+
{
|
|
11047
|
+
d: "M10 3L4.5 8.5L2 6",
|
|
11048
|
+
stroke: "white",
|
|
11049
|
+
strokeWidth: "2",
|
|
11050
|
+
strokeLinecap: "round",
|
|
11051
|
+
strokeLinejoin: "round"
|
|
11052
|
+
}
|
|
11053
|
+
) }) })
|
|
11054
|
+
] }),
|
|
11055
|
+
/* @__PURE__ */ jsxs6("div", { className: "uf-flex-1 uf-min-w-0", children: [
|
|
11056
|
+
/* @__PURE__ */ jsx82("h3", { className: "uf-text-black dark:uf-text-white uf-font-medium uf-text-sm", children: isPending ? "Deposit processing" : "Deposit completed" }),
|
|
11057
|
+
/* @__PURE__ */ jsx82("p", { className: "uf-text-zinc-600 dark:uf-text-zinc-400 uf-text-xs", children: formatDateTime(orderSubmittedAt) })
|
|
11058
|
+
] }),
|
|
11059
|
+
/* @__PURE__ */ jsx82("div", { className: "uf-text-black dark:uf-text-white uf-font-medium uf-text-sm uf-flex-shrink-0", children: formatUsdAmount(sourceAmountBaseUnit) }),
|
|
11060
|
+
/* @__PURE__ */ jsx82(
|
|
11061
|
+
"button",
|
|
11062
|
+
{
|
|
11063
|
+
onClick: (e) => {
|
|
11064
|
+
e.stopPropagation();
|
|
11065
|
+
onClose();
|
|
11066
|
+
},
|
|
11067
|
+
className: "uf-text-zinc-600 dark:uf-text-zinc-400 hover:uf-text-black dark:hover:uf-text-white uf-transition-colors uf-p-0.5 uf-flex-shrink-0",
|
|
11068
|
+
children: /* @__PURE__ */ jsx82(X, { className: "uf-w-4 uf-h-4" })
|
|
11069
|
+
}
|
|
11070
|
+
)
|
|
11071
|
+
]
|
|
10966
11072
|
}
|
|
10967
|
-
)
|
|
10968
|
-
] }),
|
|
10969
|
-
/* @__PURE__ */ jsxs6(
|
|
10970
|
-
/* @__PURE__ */
|
|
10971
|
-
|
|
10972
|
-
|
|
10973
|
-
|
|
10974
|
-
|
|
10975
|
-
|
|
10976
|
-
|
|
10977
|
-
|
|
10978
|
-
|
|
10979
|
-
|
|
10980
|
-
|
|
10981
|
-
|
|
10982
|
-
|
|
11073
|
+
)
|
|
11074
|
+
] }) }),
|
|
11075
|
+
execution && /* @__PURE__ */ jsx82(Dialog2, { open: detailModalOpen, onOpenChange: setDetailModalOpen, children: /* @__PURE__ */ jsxs6(DialogContent2, { className: `sm:uf-max-w-[400px] !uf-bg-card uf-border-secondary uf-text-foreground uf-p-0 uf-mt-8 uf-gap-0 [&>button]:uf-hidden ${themeClass}`, children: [
|
|
11076
|
+
/* @__PURE__ */ jsxs6("div", { className: "uf-flex uf-items-center uf-justify-between uf-px-4", children: [
|
|
11077
|
+
/* @__PURE__ */ jsx82("div", { className: "uf-w-8" }),
|
|
11078
|
+
" ",
|
|
11079
|
+
/* @__PURE__ */ jsx82("h2", { className: "uf-text-lg uf-font-semibold uf-text-foreground", children: "Deposit Details" }),
|
|
11080
|
+
/* @__PURE__ */ jsx82(
|
|
11081
|
+
"button",
|
|
11082
|
+
{
|
|
11083
|
+
onClick: () => setDetailModalOpen(false),
|
|
11084
|
+
className: "uf-text-muted-foreground hover:uf-text-foreground uf-transition-colors uf-w-8 uf-flex uf-justify-end",
|
|
11085
|
+
children: /* @__PURE__ */ jsx82(X, { className: "uf-w-5 uf-h-5" })
|
|
11086
|
+
}
|
|
11087
|
+
)
|
|
11088
|
+
] }),
|
|
11089
|
+
/* @__PURE__ */ jsx82(DepositDetailContent, { execution })
|
|
11090
|
+
] }) })
|
|
11091
|
+
] });
|
|
10983
11092
|
}
|
|
10984
11093
|
var Select2 = Root23;
|
|
10985
11094
|
var SelectValue2 = Value;
|
|
@@ -11091,51 +11200,12 @@ var SelectSeparator2 = React38.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
11091
11200
|
}
|
|
11092
11201
|
));
|
|
11093
11202
|
SelectSeparator2.displayName = Separator.displayName;
|
|
11094
|
-
var buttonVariants = cva(
|
|
11095
|
-
"uf-inline-flex uf-items-center uf-justify-center uf-whitespace-nowrap uf-rounded-md uf-text-sm uf-font-medium uf-ring-offset-background uf-transition-colors focus-visible:uf-outline-none focus-visible:uf-ring-2 focus-visible:uf-ring-ring focus-visible:uf-ring-offset-2 disabled:uf-pointer-events-none disabled:uf-opacity-50",
|
|
11096
|
-
{
|
|
11097
|
-
variants: {
|
|
11098
|
-
variant: {
|
|
11099
|
-
default: "uf-bg-primary uf-text-primary-foreground hover:uf-bg-primary/90",
|
|
11100
|
-
destructive: "uf-bg-destructive uf-text-destructive-foreground hover:uf-bg-destructive/90",
|
|
11101
|
-
outline: "uf-border uf-border-input uf-bg-background hover:uf-bg-accent hover:uf-text-accent-foreground",
|
|
11102
|
-
secondary: "uf-bg-secondary uf-text-secondary-foreground hover:uf-bg-secondary/80",
|
|
11103
|
-
ghost: "hover:uf-bg-accent hover:uf-text-accent-foreground",
|
|
11104
|
-
link: "uf-text-primary uf-underline-offset-4 hover:uf-underline"
|
|
11105
|
-
},
|
|
11106
|
-
size: {
|
|
11107
|
-
default: "uf-h-10 uf-px-4 uf-py-2",
|
|
11108
|
-
sm: "uf-h-9 uf-rounded-md uf-px-3",
|
|
11109
|
-
lg: "uf-h-11 uf-rounded-md uf-px-8",
|
|
11110
|
-
icon: "uf-h-10 uf-w-10"
|
|
11111
|
-
}
|
|
11112
|
-
},
|
|
11113
|
-
defaultVariants: {
|
|
11114
|
-
variant: "default",
|
|
11115
|
-
size: "default"
|
|
11116
|
-
}
|
|
11117
|
-
}
|
|
11118
|
-
);
|
|
11119
|
-
var Button = React42.forwardRef(
|
|
11120
|
-
({ className, variant, size: size4, asChild = false, ...props }, ref) => {
|
|
11121
|
-
const Comp = asChild ? Slot3 : "button";
|
|
11122
|
-
return /* @__PURE__ */ jsx102(
|
|
11123
|
-
Comp,
|
|
11124
|
-
{
|
|
11125
|
-
className: cn(buttonVariants({ variant, size: size4, className })),
|
|
11126
|
-
ref,
|
|
11127
|
-
...props
|
|
11128
|
-
}
|
|
11129
|
-
);
|
|
11130
|
-
}
|
|
11131
|
-
);
|
|
11132
|
-
Button.displayName = "Button";
|
|
11133
11203
|
var TooltipProvider2 = Provider;
|
|
11134
11204
|
var Tooltip2 = Root32;
|
|
11135
11205
|
var TooltipTrigger2 = Trigger2;
|
|
11136
|
-
var TooltipContent2 =
|
|
11206
|
+
var TooltipContent2 = React42.forwardRef(({ className, sideOffset = 4, ...props }, ref) => {
|
|
11137
11207
|
const { themeClass } = useTheme();
|
|
11138
|
-
return /* @__PURE__ */
|
|
11208
|
+
return /* @__PURE__ */ jsx102(Portal4, { children: /* @__PURE__ */ jsx102(
|
|
11139
11209
|
Content23,
|
|
11140
11210
|
{
|
|
11141
11211
|
ref,
|
|
@@ -11214,8 +11284,8 @@ var en_default = {
|
|
|
11214
11284
|
}
|
|
11215
11285
|
}
|
|
11216
11286
|
};
|
|
11217
|
-
var
|
|
11218
|
-
var t =
|
|
11287
|
+
var i18n2 = en_default;
|
|
11288
|
+
var t = i18n2.transferCrypto;
|
|
11219
11289
|
var getChainKey = (chainId, chainType) => {
|
|
11220
11290
|
return `${chainType}:${chainId}`;
|
|
11221
11291
|
};
|
|
@@ -11230,7 +11300,6 @@ function TransferCryptoBase({
|
|
|
11230
11300
|
destinationChainType,
|
|
11231
11301
|
destinationChainId,
|
|
11232
11302
|
destinationTokenAddress,
|
|
11233
|
-
copyButtonMode = "compact",
|
|
11234
11303
|
layoutVariant = "horizontal",
|
|
11235
11304
|
showDetailedDropdowns = false,
|
|
11236
11305
|
onExecutionsChange,
|
|
@@ -11240,20 +11309,20 @@ function TransferCryptoBase({
|
|
|
11240
11309
|
}) {
|
|
11241
11310
|
const { themeClass } = useTheme();
|
|
11242
11311
|
const isDarkMode = themeClass.includes("uf-dark");
|
|
11243
|
-
const [token, setToken] =
|
|
11244
|
-
const [chain, setChain] =
|
|
11245
|
-
const [copied, setCopied] =
|
|
11246
|
-
const [internalWallets, setInternalWallets] =
|
|
11247
|
-
const [loading, setLoading] =
|
|
11312
|
+
const [token, setToken] = useState42("USDC");
|
|
11313
|
+
const [chain, setChain] = useState42("solana:mainnet");
|
|
11314
|
+
const [copied, setCopied] = useState42(false);
|
|
11315
|
+
const [internalWallets, setInternalWallets] = useState42([]);
|
|
11316
|
+
const [loading, setLoading] = useState42(!externalWallets?.length);
|
|
11248
11317
|
const wallets = externalWallets?.length ? externalWallets : internalWallets;
|
|
11249
|
-
const [error, setError] =
|
|
11250
|
-
const [depositExecutions, setDepositExecutions] =
|
|
11251
|
-
const [trackedExecutions, setTrackedExecutions] =
|
|
11252
|
-
const [modalOpenedAt, setModalOpenedAt] =
|
|
11253
|
-
const [supportedTokens, setSupportedTokens] =
|
|
11254
|
-
const [tokensLoading, setTokensLoading] =
|
|
11255
|
-
const [detailsExpanded, setDetailsExpanded] =
|
|
11256
|
-
const [depositsModalOpen, setDepositsModalOpen] =
|
|
11318
|
+
const [error, setError] = useState42(null);
|
|
11319
|
+
const [depositExecutions, setDepositExecutions] = useState42([]);
|
|
11320
|
+
const [trackedExecutions, setTrackedExecutions] = useState42(/* @__PURE__ */ new Map());
|
|
11321
|
+
const [modalOpenedAt, setModalOpenedAt] = useState42(null);
|
|
11322
|
+
const [supportedTokens, setSupportedTokens] = useState42([]);
|
|
11323
|
+
const [tokensLoading, setTokensLoading] = useState42(true);
|
|
11324
|
+
const [detailsExpanded, setDetailsExpanded] = useState42(false);
|
|
11325
|
+
const [depositsModalOpen, setDepositsModalOpen] = useState42(false);
|
|
11257
11326
|
const allChainsMap = /* @__PURE__ */ new Map();
|
|
11258
11327
|
supportedTokens.forEach((t4) => {
|
|
11259
11328
|
t4.chains.forEach((c) => {
|
|
@@ -11271,10 +11340,10 @@ function TransferCryptoBase({
|
|
|
11271
11340
|
const currentChainType = currentChainData?.chain_type || "ethereum";
|
|
11272
11341
|
const currentWallet = getWalletByChainType(wallets, currentChainType);
|
|
11273
11342
|
const depositAddress = currentWallet?.address || "";
|
|
11274
|
-
|
|
11343
|
+
useEffect42(() => {
|
|
11275
11344
|
setModalOpenedAt(/* @__PURE__ */ new Date());
|
|
11276
11345
|
}, []);
|
|
11277
|
-
|
|
11346
|
+
useEffect42(() => {
|
|
11278
11347
|
async function fetchSupportedTokens() {
|
|
11279
11348
|
try {
|
|
11280
11349
|
setTokensLoading(true);
|
|
@@ -11303,25 +11372,29 @@ function TransferCryptoBase({
|
|
|
11303
11372
|
}
|
|
11304
11373
|
fetchSupportedTokens();
|
|
11305
11374
|
}, [publishableKey, chain]);
|
|
11306
|
-
|
|
11375
|
+
useEffect42(() => {
|
|
11307
11376
|
if (onExecutionsChange) {
|
|
11308
11377
|
onExecutionsChange(depositExecutions);
|
|
11309
11378
|
}
|
|
11310
11379
|
}, [depositExecutions, onExecutionsChange]);
|
|
11311
|
-
|
|
11380
|
+
useEffect42(() => {
|
|
11312
11381
|
if (externalWallets?.length) {
|
|
11313
11382
|
setLoading(false);
|
|
11314
11383
|
return;
|
|
11315
11384
|
}
|
|
11385
|
+
if (internalWallets.length > 0) {
|
|
11386
|
+
setLoading(false);
|
|
11387
|
+
return;
|
|
11388
|
+
}
|
|
11316
11389
|
let retryTimeout = null;
|
|
11317
11390
|
let isCancelled = false;
|
|
11318
11391
|
const fetchWallets = async () => {
|
|
11319
11392
|
if (isCancelled) return;
|
|
11320
11393
|
setLoading(true);
|
|
11321
11394
|
try {
|
|
11322
|
-
const response = await
|
|
11395
|
+
const response = await createDepositAddress(
|
|
11323
11396
|
{
|
|
11324
|
-
|
|
11397
|
+
external_user_id: userId,
|
|
11325
11398
|
recipient_address: recipientAddress,
|
|
11326
11399
|
destination_chain_type: destinationChainType,
|
|
11327
11400
|
destination_chain_id: destinationChainId,
|
|
@@ -11359,7 +11432,7 @@ function TransferCryptoBase({
|
|
|
11359
11432
|
publishableKey,
|
|
11360
11433
|
externalWallets
|
|
11361
11434
|
]);
|
|
11362
|
-
|
|
11435
|
+
useEffect42(() => {
|
|
11363
11436
|
if (!supportedTokens.length) return;
|
|
11364
11437
|
const currentToken = supportedTokens.find((t4) => t4.symbol === token);
|
|
11365
11438
|
if (!currentToken || currentToken.chains.length === 0) return;
|
|
@@ -11373,7 +11446,7 @@ function TransferCryptoBase({
|
|
|
11373
11446
|
setChain(newChain);
|
|
11374
11447
|
}
|
|
11375
11448
|
}, [token, supportedTokens, chain]);
|
|
11376
|
-
|
|
11449
|
+
useEffect42(() => {
|
|
11377
11450
|
if (!userId || !modalOpenedAt) return;
|
|
11378
11451
|
const pollInterval = setInterval(async () => {
|
|
11379
11452
|
try {
|
|
@@ -11390,12 +11463,11 @@ function TransferCryptoBase({
|
|
|
11390
11463
|
break;
|
|
11391
11464
|
}
|
|
11392
11465
|
const inProgressStatuses = [
|
|
11393
|
-
|
|
11394
|
-
|
|
11395
|
-
|
|
11396
|
-
/* DELAYED */
|
|
11466
|
+
ExecutionStatus.PENDING,
|
|
11467
|
+
ExecutionStatus.WAITING,
|
|
11468
|
+
ExecutionStatus.DELAYED
|
|
11397
11469
|
];
|
|
11398
|
-
if (inProgressStatuses.includes(trackedStatus) && execution.status ===
|
|
11470
|
+
if (inProgressStatuses.includes(trackedStatus) && execution.status === ExecutionStatus.SUCCEEDED) {
|
|
11399
11471
|
executionToShow = execution;
|
|
11400
11472
|
break;
|
|
11401
11473
|
}
|
|
@@ -11418,7 +11490,7 @@ function TransferCryptoBase({
|
|
|
11418
11490
|
return updated;
|
|
11419
11491
|
});
|
|
11420
11492
|
if (onDepositSuccess) {
|
|
11421
|
-
const isCompleted = execution.status ===
|
|
11493
|
+
const isCompleted = execution.status === ExecutionStatus.SUCCEEDED;
|
|
11422
11494
|
if (isCompleted) {
|
|
11423
11495
|
onDepositSuccess({
|
|
11424
11496
|
message: "Deposit completed successfully",
|
|
@@ -11482,7 +11554,7 @@ function TransferCryptoBase({
|
|
|
11482
11554
|
const minDepositUsd = currentChainFromBackend?.minimum_deposit_amount_usd ?? 3;
|
|
11483
11555
|
const renderTokenItem = (tokenData) => {
|
|
11484
11556
|
return /* @__PURE__ */ jsxs8("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
11485
|
-
/* @__PURE__ */
|
|
11557
|
+
/* @__PURE__ */ jsx112(
|
|
11486
11558
|
"img",
|
|
11487
11559
|
{
|
|
11488
11560
|
src: tokenData.icon_url,
|
|
@@ -11492,13 +11564,13 @@ function TransferCryptoBase({
|
|
|
11492
11564
|
className: "uf-rounded-full uf-flex-shrink-0"
|
|
11493
11565
|
}
|
|
11494
11566
|
),
|
|
11495
|
-
/* @__PURE__ */
|
|
11496
|
-
showDetailedDropdowns && /* @__PURE__ */
|
|
11567
|
+
/* @__PURE__ */ jsx112("span", { className: "uf-text-xs uf-font-normal", children: tokenData.symbol }),
|
|
11568
|
+
showDetailedDropdowns && /* @__PURE__ */ jsx112("span", { className: "uf-text-xs uf-text-muted-foreground", children: tokenData.name })
|
|
11497
11569
|
] });
|
|
11498
11570
|
};
|
|
11499
11571
|
const renderChainItem = (chainData) => {
|
|
11500
11572
|
return /* @__PURE__ */ jsxs8("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
11501
|
-
/* @__PURE__ */
|
|
11573
|
+
/* @__PURE__ */ jsx112(
|
|
11502
11574
|
"img",
|
|
11503
11575
|
{
|
|
11504
11576
|
src: chainData.icon_url,
|
|
@@ -11508,15 +11580,15 @@ function TransferCryptoBase({
|
|
|
11508
11580
|
className: "uf-rounded-full uf-flex-shrink-0"
|
|
11509
11581
|
}
|
|
11510
11582
|
),
|
|
11511
|
-
/* @__PURE__ */
|
|
11512
|
-
showDetailedDropdowns && /* @__PURE__ */
|
|
11583
|
+
/* @__PURE__ */ jsx112("span", { className: "uf-text-xs uf-font-normal", children: chainData.chain_name }),
|
|
11584
|
+
showDetailedDropdowns && /* @__PURE__ */ jsx112("span", { className: "uf-text-xs uf-text-muted-foreground uf-capitalize", children: chainData.chain_type })
|
|
11513
11585
|
] });
|
|
11514
11586
|
};
|
|
11515
11587
|
const selectContainerClass = layoutVariant === "horizontal" ? "uf-grid uf-grid-cols-2 uf-gap-2.5" : "uf-space-y-3";
|
|
11516
|
-
return /* @__PURE__ */
|
|
11588
|
+
return /* @__PURE__ */ jsx112(TooltipProvider2, { delayDuration: 0, skipDelayDuration: 0, children: /* @__PURE__ */ jsxs8("div", { className: "uf-space-y-3", children: [
|
|
11517
11589
|
/* @__PURE__ */ jsxs8("div", { className: selectContainerClass, children: [
|
|
11518
11590
|
/* @__PURE__ */ jsxs8("div", { children: [
|
|
11519
|
-
/* @__PURE__ */
|
|
11591
|
+
/* @__PURE__ */ jsx112("div", { className: "uf-text-xs uf-text-muted-foreground uf-mb-2 uf-flex uf-items-center uf-gap-1", children: t.supportedToken }),
|
|
11520
11592
|
/* @__PURE__ */ jsxs8(
|
|
11521
11593
|
Select2,
|
|
11522
11594
|
{
|
|
@@ -11524,8 +11596,8 @@ function TransferCryptoBase({
|
|
|
11524
11596
|
onValueChange: setToken,
|
|
11525
11597
|
disabled: tokensLoading || supportedTokens.length === 0,
|
|
11526
11598
|
children: [
|
|
11527
|
-
/* @__PURE__ */
|
|
11528
|
-
/* @__PURE__ */
|
|
11599
|
+
/* @__PURE__ */ jsx112(SelectTrigger2, { className: "uf-bg-secondary uf-border-none uf-rounded-lg uf-h-10 hover:uf-bg-accent uf-text-foreground focus:uf-ring-1 focus:uf-ring-ring disabled:uf-opacity-50", children: /* @__PURE__ */ jsx112(SelectValue2, { children: tokensLoading ? /* @__PURE__ */ jsx112("div", { className: "uf-flex uf-items-center uf-gap-2", children: /* @__PURE__ */ jsx112("span", { className: "uf-text-xs uf-font-light uf-text-muted-foreground", children: t.loading }) }) : selectedToken ? renderTokenItem(selectedToken) : /* @__PURE__ */ jsx112("div", { className: "uf-flex uf-items-center uf-gap-2", children: /* @__PURE__ */ jsx112("span", { className: "uf-text-xs uf-font-normal", children: token }) }) }) }),
|
|
11600
|
+
/* @__PURE__ */ jsx112(SelectContent2, { className: "uf-bg-secondary uf-border uf-text-foreground uf-max-h-[300px]", children: supportedTokens.map((tokenData) => /* @__PURE__ */ jsx112(
|
|
11529
11601
|
SelectItem2,
|
|
11530
11602
|
{
|
|
11531
11603
|
value: tokenData.symbol,
|
|
@@ -11548,23 +11620,23 @@ function TransferCryptoBase({
|
|
|
11548
11620
|
t.minDeposit.label
|
|
11549
11621
|
] }),
|
|
11550
11622
|
/* @__PURE__ */ jsxs8(Tooltip2, { children: [
|
|
11551
|
-
/* @__PURE__ */
|
|
11623
|
+
/* @__PURE__ */ jsx112(TooltipTrigger2, { asChild: true, children: /* @__PURE__ */ jsx112(
|
|
11552
11624
|
"span",
|
|
11553
11625
|
{
|
|
11554
11626
|
className: "uf-inline-flex uf-cursor-pointer uf-transition-colors hover:uf-text-foreground",
|
|
11555
11627
|
tabIndex: 0,
|
|
11556
11628
|
role: "button",
|
|
11557
11629
|
"aria-label": "Minimum deposit information",
|
|
11558
|
-
children: /* @__PURE__ */
|
|
11630
|
+
children: /* @__PURE__ */ jsx112(Info, { className: "uf-w-3 uf-h-3" })
|
|
11559
11631
|
}
|
|
11560
11632
|
) }),
|
|
11561
|
-
/* @__PURE__ */
|
|
11633
|
+
/* @__PURE__ */ jsx112(
|
|
11562
11634
|
TooltipContent2,
|
|
11563
11635
|
{
|
|
11564
11636
|
side: "left",
|
|
11565
11637
|
align: "center",
|
|
11566
11638
|
className: "uf-max-w-[200px]",
|
|
11567
|
-
children: /* @__PURE__ */
|
|
11639
|
+
children: /* @__PURE__ */ jsx112("p", { children: t.minDeposit.tooltip })
|
|
11568
11640
|
}
|
|
11569
11641
|
)
|
|
11570
11642
|
] })
|
|
@@ -11576,13 +11648,13 @@ function TransferCryptoBase({
|
|
|
11576
11648
|
onValueChange: setChain,
|
|
11577
11649
|
disabled: tokensLoading || availableChainsForToken.length === 0,
|
|
11578
11650
|
children: [
|
|
11579
|
-
/* @__PURE__ */
|
|
11580
|
-
/* @__PURE__ */
|
|
11651
|
+
/* @__PURE__ */ jsx112(SelectTrigger2, { className: "uf-bg-secondary uf-border-none uf-rounded-lg uf-h-10 hover:uf-bg-accent uf-text-foreground focus:uf-ring-1 focus:uf-ring-ring disabled:uf-opacity-50", children: /* @__PURE__ */ jsx112(SelectValue2, { children: tokensLoading ? /* @__PURE__ */ jsx112("div", { className: "uf-flex uf-items-center uf-gap-2", children: /* @__PURE__ */ jsx112("span", { className: "uf-text-xs uf-font-light uf-text-muted-foreground", children: t.loading }) }) : currentChainFromBackend ? renderChainItem(currentChainFromBackend) : currentChainData ? renderChainItem(currentChainData) : /* @__PURE__ */ jsx112("div", { className: "uf-flex uf-items-center uf-gap-2", children: /* @__PURE__ */ jsx112("span", { className: "uf-text-xs uf-font-normal", children: chain }) }) }) }),
|
|
11652
|
+
/* @__PURE__ */ jsx112(SelectContent2, { className: "uf-bg-secondary uf-border uf-text-foreground uf-max-h-[300px]", children: availableChainsForToken.length === 0 ? /* @__PURE__ */ jsx112("div", { className: "uf-px-2 uf-py-3 uf-text-xs uf-text-muted-foreground uf-text-center", children: t.noChainsAvailable }) : availableChainsForToken.map((chainData) => {
|
|
11581
11653
|
const chainKey = getChainKey(
|
|
11582
11654
|
chainData.chain_id,
|
|
11583
11655
|
chainData.chain_type
|
|
11584
11656
|
);
|
|
11585
|
-
return /* @__PURE__ */
|
|
11657
|
+
return /* @__PURE__ */ jsx112(
|
|
11586
11658
|
SelectItem2,
|
|
11587
11659
|
{
|
|
11588
11660
|
value: chainKey,
|
|
@@ -11597,14 +11669,14 @@ function TransferCryptoBase({
|
|
|
11597
11669
|
)
|
|
11598
11670
|
] })
|
|
11599
11671
|
] }),
|
|
11600
|
-
/* @__PURE__ */
|
|
11672
|
+
/* @__PURE__ */ jsx112("div", { className: "uf-flex uf-justify-center uf-py-2", children: /* @__PURE__ */ jsx112("div", { className: "uf-bg-card uf-p-4 uf-rounded-2xl uf-shadow-lg uf-border uf-border-border", children: loading ? /* @__PURE__ */ jsx112(
|
|
11601
11673
|
"div",
|
|
11602
11674
|
{
|
|
11603
11675
|
className: "uf-flex uf-items-center uf-justify-center",
|
|
11604
11676
|
style: { width: 180, height: 180 },
|
|
11605
|
-
children: /* @__PURE__ */
|
|
11677
|
+
children: /* @__PURE__ */ jsx112("div", { className: "uf-text-foreground uf-text-sm", children: t.loadingQRCode })
|
|
11606
11678
|
}
|
|
11607
|
-
) : depositAddress ? /* @__PURE__ */
|
|
11679
|
+
) : depositAddress ? /* @__PURE__ */ jsx112(
|
|
11608
11680
|
StyledQRCode,
|
|
11609
11681
|
{
|
|
11610
11682
|
value: depositAddress,
|
|
@@ -11614,12 +11686,12 @@ function TransferCryptoBase({
|
|
|
11614
11686
|
darkMode: isDarkMode
|
|
11615
11687
|
},
|
|
11616
11688
|
`qr-${depositAddress}-${chain}`
|
|
11617
|
-
) : /* @__PURE__ */
|
|
11689
|
+
) : /* @__PURE__ */ jsx112(
|
|
11618
11690
|
"div",
|
|
11619
11691
|
{
|
|
11620
11692
|
className: "uf-flex uf-items-center uf-justify-center",
|
|
11621
11693
|
style: { width: 180, height: 180 },
|
|
11622
|
-
children: /* @__PURE__ */
|
|
11694
|
+
children: /* @__PURE__ */ jsx112("div", { className: "uf-text-red-400 uf-text-sm", children: t.noAddressAvailable })
|
|
11623
11695
|
}
|
|
11624
11696
|
) }) }),
|
|
11625
11697
|
/* @__PURE__ */ jsxs8("div", { children: [
|
|
@@ -11627,60 +11699,42 @@ function TransferCryptoBase({
|
|
|
11627
11699
|
/* @__PURE__ */ jsxs8("div", { className: "uf-flex uf-items-center uf-gap-1", children: [
|
|
11628
11700
|
t.depositAddress.label,
|
|
11629
11701
|
/* @__PURE__ */ jsxs8(Tooltip2, { children: [
|
|
11630
|
-
/* @__PURE__ */
|
|
11702
|
+
/* @__PURE__ */ jsx112(TooltipTrigger2, { asChild: true, children: /* @__PURE__ */ jsx112(
|
|
11631
11703
|
"span",
|
|
11632
11704
|
{
|
|
11633
11705
|
className: "uf-inline-flex uf-cursor-pointer uf-transition-colors hover:uf-text-foreground",
|
|
11634
11706
|
tabIndex: 0,
|
|
11635
11707
|
role: "button",
|
|
11636
11708
|
"aria-label": "Deposit address information",
|
|
11637
|
-
children: /* @__PURE__ */
|
|
11709
|
+
children: /* @__PURE__ */ jsx112(Info, { className: "uf-w-3 uf-h-3" })
|
|
11638
11710
|
}
|
|
11639
11711
|
) }),
|
|
11640
|
-
/* @__PURE__ */
|
|
11712
|
+
/* @__PURE__ */ jsx112(
|
|
11641
11713
|
TooltipContent2,
|
|
11642
11714
|
{
|
|
11643
11715
|
side: "top",
|
|
11644
11716
|
align: "center",
|
|
11645
11717
|
className: "uf-max-w-[240px]",
|
|
11646
|
-
children: /* @__PURE__ */
|
|
11718
|
+
children: /* @__PURE__ */ jsx112("p", { children: t.depositAddress.tooltip.replace("{{token}}", token) })
|
|
11647
11719
|
}
|
|
11648
11720
|
)
|
|
11649
11721
|
] })
|
|
11650
11722
|
] }),
|
|
11651
|
-
|
|
11652
|
-
"
|
|
11653
|
-
{
|
|
11654
|
-
onClick: handleCopyAddress,
|
|
11655
|
-
disabled: loading || !depositAddress,
|
|
11656
|
-
className: "uf-flex uf-items-center uf-gap-1 uf-text-xs uf-text-muted-foreground hover:uf-text-foreground uf-transition-colors disabled:uf-opacity-50 disabled:uf-cursor-not-allowed",
|
|
11657
|
-
children: copied ? /* @__PURE__ */ jsxs8(Fragment23, { children: [
|
|
11658
|
-
/* @__PURE__ */ jsx122(Check, { className: "uf-w-3 uf-h-3" }),
|
|
11659
|
-
/* @__PURE__ */ jsx122("span", { children: t.copied })
|
|
11660
|
-
] }) : /* @__PURE__ */ jsxs8(Fragment23, { children: [
|
|
11661
|
-
/* @__PURE__ */ jsx122(Copy, { className: "uf-w-3 uf-h-3" }),
|
|
11662
|
-
/* @__PURE__ */ jsx122("span", { children: t.copyAddress })
|
|
11663
|
-
] })
|
|
11664
|
-
}
|
|
11665
|
-
)
|
|
11666
|
-
] }),
|
|
11667
|
-
loading ? /* @__PURE__ */ jsx122("div", { className: "uf-bg-secondary uf-rounded-lg uf-px-3 uf-py-2.5 uf-text-xs uf-text-muted-foreground uf-animate-pulse", children: t.loading }) : error ? /* @__PURE__ */ jsx122("div", { className: "uf-bg-secondary uf-rounded-lg uf-px-3 uf-py-2.5 uf-text-xs uf-text-red-400", children: error }) : /* @__PURE__ */ jsx122("div", { className: "uf-bg-secondary uf-rounded-lg uf-px-3 uf-py-2.5 uf-text-xs uf-font-mono uf-break-all", children: depositAddress || t.noAddressAvailable })
|
|
11668
|
-
] }),
|
|
11669
|
-
copyButtonMode === "fullWidth" && /* @__PURE__ */ jsx122(
|
|
11670
|
-
Button,
|
|
11671
|
-
{
|
|
11672
|
-
onClick: handleCopyAddress,
|
|
11673
|
-
disabled: loading || !depositAddress,
|
|
11674
|
-
className: "uf-w-full uf-bg-secondary hover:uf-bg-accent uf-text-foreground uf-rounded-lg uf-h-9 uf-text-sm uf-font-medium disabled:uf-opacity-50 disabled:uf-cursor-not-allowed",
|
|
11675
|
-
children: copied ? /* @__PURE__ */ jsxs8(Fragment23, { children: [
|
|
11676
|
-
/* @__PURE__ */ jsx122(Check, { className: "uf-w-4 uf-h-4 uf-mr-2" }),
|
|
11723
|
+
/* @__PURE__ */ jsxs8("span", { className: `uf-flex uf-items-center uf-gap-1 uf-text-green-500 uf-transition-opacity uf-duration-200 ${copied ? "uf-opacity-100" : "uf-opacity-0"}`, children: [
|
|
11724
|
+
/* @__PURE__ */ jsx112(Check, { className: "uf-w-3 uf-h-3" }),
|
|
11677
11725
|
t.copied
|
|
11678
|
-
] }) : /* @__PURE__ */ jsxs8(Fragment23, { children: [
|
|
11679
|
-
/* @__PURE__ */ jsx122(Copy, { className: "uf-w-4 uf-h-4 uf-mr-2" }),
|
|
11680
|
-
t.copyAddress
|
|
11681
11726
|
] })
|
|
11682
|
-
}
|
|
11683
|
-
|
|
11727
|
+
] }),
|
|
11728
|
+
loading ? /* @__PURE__ */ jsx112("div", { className: "uf-bg-secondary uf-rounded-lg uf-px-3 uf-py-2.5 uf-text-xs uf-text-muted-foreground uf-animate-pulse", children: t.loading }) : error ? /* @__PURE__ */ jsx112("div", { className: "uf-bg-secondary uf-rounded-lg uf-px-3 uf-py-2.5 uf-text-xs uf-text-red-400", children: error }) : /* @__PURE__ */ jsx112(
|
|
11729
|
+
"button",
|
|
11730
|
+
{
|
|
11731
|
+
onClick: handleCopyAddress,
|
|
11732
|
+
disabled: !depositAddress,
|
|
11733
|
+
className: "uf-w-full uf-bg-secondary hover:uf-bg-accent uf-rounded-lg uf-px-3 uf-py-2.5 uf-text-xs uf-font-mono uf-break-all uf-text-left uf-transition-colors uf-cursor-pointer disabled:uf-opacity-50 disabled:uf-cursor-not-allowed",
|
|
11734
|
+
children: depositAddress || t.noAddressAvailable
|
|
11735
|
+
}
|
|
11736
|
+
)
|
|
11737
|
+
] }),
|
|
11684
11738
|
/* @__PURE__ */ jsxs8("div", { className: "uf-bg-secondary uf-rounded-xl uf-px-3", children: [
|
|
11685
11739
|
/* @__PURE__ */ jsxs8(
|
|
11686
11740
|
"button",
|
|
@@ -11689,7 +11743,7 @@ function TransferCryptoBase({
|
|
|
11689
11743
|
className: "uf-w-full uf-flex uf-items-center uf-justify-between uf-py-2.5",
|
|
11690
11744
|
children: [
|
|
11691
11745
|
/* @__PURE__ */ jsxs8("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
11692
|
-
/* @__PURE__ */
|
|
11746
|
+
/* @__PURE__ */ jsx112("div", { className: "uf-bg-card uf-rounded-full uf-p-1", children: /* @__PURE__ */ jsx112(DollarSign, { className: "uf-w-3 uf-h-3" }) }),
|
|
11693
11747
|
/* @__PURE__ */ jsxs8("span", { className: "uf-text-xs", children: [
|
|
11694
11748
|
t.priceImpact.label,
|
|
11695
11749
|
":",
|
|
@@ -11700,7 +11754,7 @@ function TransferCryptoBase({
|
|
|
11700
11754
|
] })
|
|
11701
11755
|
] }),
|
|
11702
11756
|
/* @__PURE__ */ jsxs8(Tooltip2, { children: [
|
|
11703
|
-
/* @__PURE__ */
|
|
11757
|
+
/* @__PURE__ */ jsx112(TooltipTrigger2, { asChild: true, children: /* @__PURE__ */ jsx112(
|
|
11704
11758
|
"span",
|
|
11705
11759
|
{
|
|
11706
11760
|
className: "uf-inline-flex uf-cursor-pointer uf-text-muted-foreground uf-transition-colors hover:uf-text-foreground",
|
|
@@ -11713,27 +11767,27 @@ function TransferCryptoBase({
|
|
|
11713
11767
|
tabIndex: 0,
|
|
11714
11768
|
role: "button",
|
|
11715
11769
|
"aria-label": "Price impact information",
|
|
11716
|
-
children: /* @__PURE__ */
|
|
11770
|
+
children: /* @__PURE__ */ jsx112(Info, { className: "uf-w-3 uf-h-3" })
|
|
11717
11771
|
}
|
|
11718
11772
|
) }),
|
|
11719
|
-
/* @__PURE__ */
|
|
11773
|
+
/* @__PURE__ */ jsx112(
|
|
11720
11774
|
TooltipContent2,
|
|
11721
11775
|
{
|
|
11722
11776
|
side: "top",
|
|
11723
11777
|
align: "center",
|
|
11724
11778
|
className: "uf-max-w-[240px]",
|
|
11725
|
-
children: /* @__PURE__ */
|
|
11779
|
+
children: /* @__PURE__ */ jsx112("p", { children: t.priceImpact.tooltip })
|
|
11726
11780
|
}
|
|
11727
11781
|
)
|
|
11728
11782
|
] })
|
|
11729
11783
|
] }),
|
|
11730
|
-
detailsExpanded ? /* @__PURE__ */
|
|
11784
|
+
detailsExpanded ? /* @__PURE__ */ jsx112(ChevronUp, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground" }) : /* @__PURE__ */ jsx112(ChevronDown, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground" })
|
|
11731
11785
|
]
|
|
11732
11786
|
}
|
|
11733
11787
|
),
|
|
11734
11788
|
detailsExpanded && /* @__PURE__ */ jsxs8("div", { className: "uf-pb-3 uf-space-y-2.5", children: [
|
|
11735
11789
|
/* @__PURE__ */ jsxs8("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
11736
|
-
/* @__PURE__ */
|
|
11790
|
+
/* @__PURE__ */ jsx112("div", { className: "uf-bg-card uf-rounded-full uf-p-1", children: /* @__PURE__ */ jsx112(ShieldCheck, { className: "uf-w-3 uf-h-3" }) }),
|
|
11737
11791
|
/* @__PURE__ */ jsxs8("span", { className: "uf-text-xs", children: [
|
|
11738
11792
|
t.slippage.label,
|
|
11739
11793
|
":",
|
|
@@ -11746,42 +11800,42 @@ function TransferCryptoBase({
|
|
|
11746
11800
|
] })
|
|
11747
11801
|
] }),
|
|
11748
11802
|
/* @__PURE__ */ jsxs8(Tooltip2, { children: [
|
|
11749
|
-
/* @__PURE__ */
|
|
11803
|
+
/* @__PURE__ */ jsx112(TooltipTrigger2, { asChild: true, children: /* @__PURE__ */ jsx112(
|
|
11750
11804
|
"span",
|
|
11751
11805
|
{
|
|
11752
11806
|
className: "uf-inline-flex uf-cursor-pointer uf-text-muted-foreground uf-transition-colors hover:uf-text-foreground",
|
|
11753
11807
|
tabIndex: 0,
|
|
11754
11808
|
role: "button",
|
|
11755
11809
|
"aria-label": "Slippage information",
|
|
11756
|
-
children: /* @__PURE__ */
|
|
11810
|
+
children: /* @__PURE__ */ jsx112(Info, { className: "uf-w-3 uf-h-3" })
|
|
11757
11811
|
}
|
|
11758
11812
|
) }),
|
|
11759
|
-
/* @__PURE__ */
|
|
11813
|
+
/* @__PURE__ */ jsx112(
|
|
11760
11814
|
TooltipContent2,
|
|
11761
11815
|
{
|
|
11762
11816
|
side: "top",
|
|
11763
11817
|
align: "center",
|
|
11764
11818
|
className: "uf-max-w-[240px]",
|
|
11765
|
-
children: /* @__PURE__ */
|
|
11819
|
+
children: /* @__PURE__ */ jsx112("p", { children: t.slippage.tooltip })
|
|
11766
11820
|
}
|
|
11767
11821
|
)
|
|
11768
11822
|
] })
|
|
11769
11823
|
] }),
|
|
11770
11824
|
/* @__PURE__ */ jsxs8("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
11771
|
-
/* @__PURE__ */
|
|
11825
|
+
/* @__PURE__ */ jsx112("div", { className: "uf-bg-card uf-rounded-full uf-p-1", children: /* @__PURE__ */ jsx112(Clock, { className: "uf-w-3 uf-h-3" }) }),
|
|
11772
11826
|
/* @__PURE__ */ jsxs8("span", { className: "uf-text-xs", children: [
|
|
11773
11827
|
t.processingTime.label,
|
|
11774
11828
|
":",
|
|
11775
11829
|
" ",
|
|
11776
|
-
/* @__PURE__ */
|
|
11830
|
+
/* @__PURE__ */ jsx112("span", { className: "uf-text-foreground", children: formatProcessingTime(processingTime) })
|
|
11777
11831
|
] })
|
|
11778
11832
|
] }),
|
|
11779
11833
|
/* @__PURE__ */ jsxs8("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
11780
|
-
/* @__PURE__ */
|
|
11834
|
+
/* @__PURE__ */ jsx112("div", { className: "uf-bg-card uf-rounded-full uf-p-1", children: /* @__PURE__ */ jsx112(FileText, { className: "uf-w-3 uf-h-3" }) }),
|
|
11781
11835
|
/* @__PURE__ */ jsxs8("span", { className: "uf-text-xs", children: [
|
|
11782
11836
|
t.help.needHelp,
|
|
11783
11837
|
" ",
|
|
11784
|
-
/* @__PURE__ */
|
|
11838
|
+
/* @__PURE__ */ jsx112(
|
|
11785
11839
|
"a",
|
|
11786
11840
|
{
|
|
11787
11841
|
href: "#",
|
|
@@ -11794,7 +11848,7 @@ function TransferCryptoBase({
|
|
|
11794
11848
|
] })
|
|
11795
11849
|
] }),
|
|
11796
11850
|
/* @__PURE__ */ jsxs8("div", { className: "uf-flex uf-items-center uf-justify-between uf-text-xs uf-pt-2", children: [
|
|
11797
|
-
/* @__PURE__ */
|
|
11851
|
+
/* @__PURE__ */ jsx112(
|
|
11798
11852
|
"a",
|
|
11799
11853
|
{
|
|
11800
11854
|
href: "https://unifold.io/terms",
|
|
@@ -11809,16 +11863,16 @@ function TransferCryptoBase({
|
|
|
11809
11863
|
onClick: () => setDepositsModalOpen(true),
|
|
11810
11864
|
className: "uf-flex uf-items-center uf-gap-1 uf-text-muted-foreground hover:uf-text-foreground uf-transition-colors uf-animate-in uf-fade-in uf-slide-in-from-right-8 uf-duration-1000",
|
|
11811
11865
|
children: [
|
|
11812
|
-
/* @__PURE__ */
|
|
11866
|
+
/* @__PURE__ */ jsx112(Clock, { className: "uf-w-3.5 uf-h-3.5" }),
|
|
11813
11867
|
"Track deposits (",
|
|
11814
11868
|
depositExecutions.length,
|
|
11815
11869
|
")",
|
|
11816
|
-
/* @__PURE__ */
|
|
11870
|
+
/* @__PURE__ */ jsx112(ChevronRight, { className: "uf-w-3 uf-h-3" })
|
|
11817
11871
|
]
|
|
11818
11872
|
}
|
|
11819
11873
|
)
|
|
11820
11874
|
] }),
|
|
11821
|
-
depositExecutions.length === 1 && /* @__PURE__ */
|
|
11875
|
+
depositExecutions.length === 1 && /* @__PURE__ */ jsx112("div", { className: "uf-fixed uf-bottom-4 uf-left-1/2 uf--translate-x-1/2 uf-w-[360px] uf-max-w-[calc(100vw-2rem)] uf-z-[100]", children: /* @__PURE__ */ jsx112(
|
|
11822
11876
|
DepositSuccessToast,
|
|
11823
11877
|
{
|
|
11824
11878
|
depositTx: depositExecutions[0].transaction_hash,
|
|
@@ -11828,11 +11882,12 @@ function TransferCryptoBase({
|
|
|
11828
11882
|
status: depositExecutions[0].status,
|
|
11829
11883
|
tokenIconUrl: depositExecutions[0].destination_token_metadata?.icon_url,
|
|
11830
11884
|
sourceAmountBaseUnit: depositExecutions[0].source_amount_base_unit,
|
|
11831
|
-
onClose: () => setDepositExecutions([])
|
|
11885
|
+
onClose: () => setDepositExecutions([]),
|
|
11886
|
+
execution: depositExecutions[0]
|
|
11832
11887
|
},
|
|
11833
11888
|
depositExecutions[0].id
|
|
11834
11889
|
) }),
|
|
11835
|
-
/* @__PURE__ */
|
|
11890
|
+
/* @__PURE__ */ jsx112(
|
|
11836
11891
|
DepositsModal,
|
|
11837
11892
|
{
|
|
11838
11893
|
open: depositsModalOpen,
|
|
@@ -11846,7 +11901,7 @@ function TransferCryptoBase({
|
|
|
11846
11901
|
] }) });
|
|
11847
11902
|
}
|
|
11848
11903
|
function TransferCrypto(props) {
|
|
11849
|
-
return /* @__PURE__ */
|
|
11904
|
+
return /* @__PURE__ */ jsx122(
|
|
11850
11905
|
TransferCryptoBase,
|
|
11851
11906
|
{
|
|
11852
11907
|
...props,
|
|
@@ -11868,7 +11923,7 @@ function CurrencyListItem({
|
|
|
11868
11923
|
className: "uf-w-full uf-bg-secondary hover:uf-bg-accent uf-transition-colors uf-rounded-xl uf-p-3 uf-flex uf-items-center uf-justify-between uf-group",
|
|
11869
11924
|
children: [
|
|
11870
11925
|
/* @__PURE__ */ jsxs9("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
11871
|
-
/* @__PURE__ */
|
|
11926
|
+
/* @__PURE__ */ jsx132(
|
|
11872
11927
|
"img",
|
|
11873
11928
|
{
|
|
11874
11929
|
src: iconUrl,
|
|
@@ -11877,11 +11932,11 @@ function CurrencyListItem({
|
|
|
11877
11932
|
}
|
|
11878
11933
|
),
|
|
11879
11934
|
/* @__PURE__ */ jsxs9("div", { className: "uf-text-left", children: [
|
|
11880
|
-
/* @__PURE__ */
|
|
11881
|
-
/* @__PURE__ */
|
|
11935
|
+
/* @__PURE__ */ jsx132("div", { className: "uf-text-sm uf-font-normal uf-text-foreground", children: currency.name }),
|
|
11936
|
+
/* @__PURE__ */ jsx132("div", { className: "uf-text-xs uf-text-muted-foreground uf-font-light", children: currency.currency_code.toUpperCase() })
|
|
11882
11937
|
] })
|
|
11883
11938
|
] }),
|
|
11884
|
-
isSelected && /* @__PURE__ */
|
|
11939
|
+
isSelected && /* @__PURE__ */ jsx132(Check, { className: "uf-w-4 uf-h-4 uf-text-foreground" })
|
|
11885
11940
|
]
|
|
11886
11941
|
}
|
|
11887
11942
|
);
|
|
@@ -11894,8 +11949,8 @@ function CurrencyListSection({
|
|
|
11894
11949
|
}) {
|
|
11895
11950
|
if (currencies.length === 0) return null;
|
|
11896
11951
|
return /* @__PURE__ */ jsxs10(Fragment32, { children: [
|
|
11897
|
-
/* @__PURE__ */
|
|
11898
|
-
currencies.map((currency) => /* @__PURE__ */
|
|
11952
|
+
/* @__PURE__ */ jsx142("div", { className: "uf-px-1 uf-pb-2", children: /* @__PURE__ */ jsx142("h3", { className: "uf-text-xs uf-font-light uf-text-muted-foreground", children: title }) }),
|
|
11953
|
+
currencies.map((currency) => /* @__PURE__ */ jsx142(
|
|
11899
11954
|
CurrencyListItem,
|
|
11900
11955
|
{
|
|
11901
11956
|
currency,
|
|
@@ -11915,7 +11970,7 @@ function CurrencyModal({
|
|
|
11915
11970
|
onSelectCurrency,
|
|
11916
11971
|
themeClass = ""
|
|
11917
11972
|
}) {
|
|
11918
|
-
const [searchQuery, setSearchQuery] =
|
|
11973
|
+
const [searchQuery, setSearchQuery] = useState52("");
|
|
11919
11974
|
const preferredCurrencies = preferredCurrencyCodes.map(
|
|
11920
11975
|
(code) => currencies.find(
|
|
11921
11976
|
(currency) => currency.currency_code.toLowerCase() === code.toLowerCase()
|
|
@@ -11942,8 +11997,8 @@ function CurrencyModal({
|
|
|
11942
11997
|
onOpenChange(false);
|
|
11943
11998
|
setSearchQuery("");
|
|
11944
11999
|
};
|
|
11945
|
-
return /* @__PURE__ */
|
|
11946
|
-
/* @__PURE__ */
|
|
12000
|
+
return /* @__PURE__ */ jsx152(Dialog2, { open, onOpenChange, children: /* @__PURE__ */ jsxs11(DialogContent2, { className: `sm:uf-max-w-[400px] !uf-bg-card uf-border-secondary uf-text-foreground uf-p-0 uf-gap-0 [&>button]:uf-hidden ${themeClass}`, children: [
|
|
12001
|
+
/* @__PURE__ */ jsx152(
|
|
11947
12002
|
DepositHeader,
|
|
11948
12003
|
{
|
|
11949
12004
|
title: "Currency",
|
|
@@ -11952,9 +12007,9 @@ function CurrencyModal({
|
|
|
11952
12007
|
onClose: handleClose
|
|
11953
12008
|
}
|
|
11954
12009
|
),
|
|
11955
|
-
/* @__PURE__ */
|
|
11956
|
-
/* @__PURE__ */
|
|
11957
|
-
/* @__PURE__ */
|
|
12010
|
+
/* @__PURE__ */ jsx152("div", { children: /* @__PURE__ */ jsxs11("div", { className: "uf-relative", children: [
|
|
12011
|
+
/* @__PURE__ */ jsx152(Search, { className: "uf-absolute uf-left-4 uf-top-1/2 uf--translate-y-1/2 uf-w-4 uf-h-4 uf-text-muted-foreground" }),
|
|
12012
|
+
/* @__PURE__ */ jsx152(
|
|
11958
12013
|
"input",
|
|
11959
12014
|
{
|
|
11960
12015
|
type: "text",
|
|
@@ -11965,8 +12020,8 @@ function CurrencyModal({
|
|
|
11965
12020
|
}
|
|
11966
12021
|
)
|
|
11967
12022
|
] }) }),
|
|
11968
|
-
/* @__PURE__ */
|
|
11969
|
-
/* @__PURE__ */
|
|
12023
|
+
/* @__PURE__ */ jsx152("div", { className: "uf-max-h-[500px] uf-overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:uf-hidden", children: /* @__PURE__ */ jsxs11("div", { className: "uf-space-y-2", children: [
|
|
12024
|
+
/* @__PURE__ */ jsx152(
|
|
11970
12025
|
CurrencyListSection,
|
|
11971
12026
|
{
|
|
11972
12027
|
title: "Popular currencies",
|
|
@@ -11975,8 +12030,8 @@ function CurrencyModal({
|
|
|
11975
12030
|
onSelect: handleSelect
|
|
11976
12031
|
}
|
|
11977
12032
|
),
|
|
11978
|
-
filteredPreferred.length > 0 && filteredOther.length > 0 && /* @__PURE__ */
|
|
11979
|
-
/* @__PURE__ */
|
|
12033
|
+
filteredPreferred.length > 0 && filteredOther.length > 0 && /* @__PURE__ */ jsx152("div", { className: "uf-h-2" }),
|
|
12034
|
+
/* @__PURE__ */ jsx152(
|
|
11980
12035
|
CurrencyListSection,
|
|
11981
12036
|
{
|
|
11982
12037
|
title: "All currencies",
|
|
@@ -11985,7 +12040,7 @@ function CurrencyModal({
|
|
|
11985
12040
|
onSelect: handleSelect
|
|
11986
12041
|
}
|
|
11987
12042
|
),
|
|
11988
|
-
filteredPreferred.length === 0 && filteredOther.length === 0 && /* @__PURE__ */
|
|
12043
|
+
filteredPreferred.length === 0 && filteredOther.length === 0 && /* @__PURE__ */ jsx152("div", { className: "uf-text-center uf-py-8 uf-text-muted-foreground uf-text-sm", children: "No currencies found" })
|
|
11989
12044
|
] }) })
|
|
11990
12045
|
] }) });
|
|
11991
12046
|
}
|
|
@@ -12001,12 +12056,12 @@ async function getIpViaIpApi() {
|
|
|
12001
12056
|
state: data.region_code?.toLowerCase()
|
|
12002
12057
|
};
|
|
12003
12058
|
}
|
|
12004
|
-
function
|
|
12059
|
+
function useUserIp2() {
|
|
12005
12060
|
const {
|
|
12006
12061
|
data: userIpInfo,
|
|
12007
12062
|
isLoading,
|
|
12008
12063
|
error
|
|
12009
|
-
} =
|
|
12064
|
+
} = useQuery2({
|
|
12010
12065
|
queryKey: ["getUserIpInfo"],
|
|
12011
12066
|
queryFn: async () => {
|
|
12012
12067
|
try {
|
|
@@ -12034,7 +12089,7 @@ function useUserIp() {
|
|
|
12034
12089
|
error
|
|
12035
12090
|
};
|
|
12036
12091
|
}
|
|
12037
|
-
var t2 =
|
|
12092
|
+
var t2 = i18n2.buyWithCard;
|
|
12038
12093
|
var QUICK_AMOUNTS = [100, 500, 1e3];
|
|
12039
12094
|
function getCurrencySymbol(currencyCode) {
|
|
12040
12095
|
try {
|
|
@@ -12064,21 +12119,21 @@ function BuyWithCard({
|
|
|
12064
12119
|
wallets: externalWallets,
|
|
12065
12120
|
assetCdnUrl
|
|
12066
12121
|
}) {
|
|
12067
|
-
const [amount, setAmount] =
|
|
12068
|
-
const [currency, setCurrency] =
|
|
12069
|
-
const [showCurrencyModal, setShowCurrencyModal] =
|
|
12070
|
-
const [quotes, setQuotes] =
|
|
12071
|
-
const [quotesLoading, setQuotesLoading] =
|
|
12072
|
-
const [quotesError, setQuotesError] =
|
|
12073
|
-
const [internalView, setInternalView] =
|
|
12074
|
-
const { userIpInfo, isLoading: isLoadingIp } =
|
|
12075
|
-
const [onrampSession, setOnrampSession] =
|
|
12122
|
+
const [amount, setAmount] = useState62("500.00");
|
|
12123
|
+
const [currency, setCurrency] = useState62("usd");
|
|
12124
|
+
const [showCurrencyModal, setShowCurrencyModal] = useState62(false);
|
|
12125
|
+
const [quotes, setQuotes] = useState62([]);
|
|
12126
|
+
const [quotesLoading, setQuotesLoading] = useState62(false);
|
|
12127
|
+
const [quotesError, setQuotesError] = useState62(null);
|
|
12128
|
+
const [internalView, setInternalView] = useState62("amount");
|
|
12129
|
+
const { userIpInfo, isLoading: isLoadingIp } = useUserIp2();
|
|
12130
|
+
const [onrampSession, setOnrampSession] = useState62(
|
|
12076
12131
|
null
|
|
12077
12132
|
);
|
|
12078
12133
|
const currentView = externalView ?? internalView;
|
|
12079
12134
|
const showQuotesView = currentView === "quotes";
|
|
12080
12135
|
const showOnrampView = currentView === "onramp";
|
|
12081
|
-
|
|
12136
|
+
useEffect52(() => {
|
|
12082
12137
|
if (externalView) {
|
|
12083
12138
|
setInternalView(externalView);
|
|
12084
12139
|
}
|
|
@@ -12091,20 +12146,20 @@ function BuyWithCard({
|
|
|
12091
12146
|
onViewChange?.(newView);
|
|
12092
12147
|
}
|
|
12093
12148
|
};
|
|
12094
|
-
const [selectedProvider, setSelectedProvider] =
|
|
12149
|
+
const [selectedProvider, setSelectedProvider] = useState62(
|
|
12095
12150
|
null
|
|
12096
12151
|
);
|
|
12097
|
-
const [isAutoSelected, setIsAutoSelected] =
|
|
12098
|
-
const [autoSelectedProvider, setAutoSelectedProvider] =
|
|
12099
|
-
const [hasManualSelection, setHasManualSelection] =
|
|
12100
|
-
const [internalWallets, setInternalWallets] =
|
|
12101
|
-
const [walletsLoading, setWalletsLoading] =
|
|
12152
|
+
const [isAutoSelected, setIsAutoSelected] = useState62(true);
|
|
12153
|
+
const [autoSelectedProvider, setAutoSelectedProvider] = useState62(null);
|
|
12154
|
+
const [hasManualSelection, setHasManualSelection] = useState62(false);
|
|
12155
|
+
const [internalWallets, setInternalWallets] = useState62([]);
|
|
12156
|
+
const [walletsLoading, setWalletsLoading] = useState62(!externalWallets?.length);
|
|
12102
12157
|
const wallets = externalWallets?.length ? externalWallets : internalWallets;
|
|
12103
|
-
const [countdown, setCountdown] =
|
|
12104
|
-
const [fiatCurrencies, setFiatCurrencies] =
|
|
12105
|
-
const [preferredCurrencyCodes, setPreferredCurrencyCodes] =
|
|
12106
|
-
const [currenciesLoading, setCurrenciesLoading] =
|
|
12107
|
-
const [supportedTokens, setSupportedTokens] =
|
|
12158
|
+
const [countdown, setCountdown] = useState62(60);
|
|
12159
|
+
const [fiatCurrencies, setFiatCurrencies] = useState62([]);
|
|
12160
|
+
const [preferredCurrencyCodes, setPreferredCurrencyCodes] = useState62([]);
|
|
12161
|
+
const [currenciesLoading, setCurrenciesLoading] = useState62(true);
|
|
12162
|
+
const [supportedTokens, setSupportedTokens] = useState62([]);
|
|
12108
12163
|
const destinationWallet = getWalletByChainType(wallets, "ethereum");
|
|
12109
12164
|
const walletDestinationChainId = destinationWallet?.destination_chain_id;
|
|
12110
12165
|
const resolvedDestinationChainId = destinationChainId || walletDestinationChainId;
|
|
@@ -12113,7 +12168,7 @@ function BuyWithCard({
|
|
|
12113
12168
|
const destinationChain = destinationToken?.chains.find(
|
|
12114
12169
|
(c) => c.chain_id === resolvedDestinationChainId
|
|
12115
12170
|
);
|
|
12116
|
-
|
|
12171
|
+
useEffect52(() => {
|
|
12117
12172
|
async function fetchFiatCurrencies() {
|
|
12118
12173
|
try {
|
|
12119
12174
|
const response = await getFiatCurrencies(publishableKey);
|
|
@@ -12127,20 +12182,24 @@ function BuyWithCard({
|
|
|
12127
12182
|
}
|
|
12128
12183
|
fetchFiatCurrencies();
|
|
12129
12184
|
}, [publishableKey]);
|
|
12130
|
-
|
|
12185
|
+
useEffect52(() => {
|
|
12131
12186
|
if (externalWallets?.length) {
|
|
12132
12187
|
setWalletsLoading(false);
|
|
12133
12188
|
return;
|
|
12134
12189
|
}
|
|
12190
|
+
if (internalWallets.length > 0) {
|
|
12191
|
+
setWalletsLoading(false);
|
|
12192
|
+
return;
|
|
12193
|
+
}
|
|
12135
12194
|
let retryTimeout = null;
|
|
12136
12195
|
let isCancelled = false;
|
|
12137
12196
|
const fetchWallets = async () => {
|
|
12138
12197
|
if (isCancelled) return;
|
|
12139
12198
|
setWalletsLoading(true);
|
|
12140
12199
|
try {
|
|
12141
|
-
const response = await
|
|
12200
|
+
const response = await createDepositAddress(
|
|
12142
12201
|
{
|
|
12143
|
-
|
|
12202
|
+
external_user_id: userId,
|
|
12144
12203
|
recipient_address: recipientAddress,
|
|
12145
12204
|
destination_chain_type: destinationChainType,
|
|
12146
12205
|
destination_chain_id: destinationChainId,
|
|
@@ -12168,7 +12227,7 @@ function BuyWithCard({
|
|
|
12168
12227
|
}
|
|
12169
12228
|
};
|
|
12170
12229
|
}, [userId, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, publishableKey, externalWallets]);
|
|
12171
|
-
|
|
12230
|
+
useEffect52(() => {
|
|
12172
12231
|
async function fetchSupportedTokens() {
|
|
12173
12232
|
try {
|
|
12174
12233
|
const response = await getSupportedDepositTokens(publishableKey);
|
|
@@ -12179,7 +12238,7 @@ function BuyWithCard({
|
|
|
12179
12238
|
}
|
|
12180
12239
|
fetchSupportedTokens();
|
|
12181
12240
|
}, [publishableKey]);
|
|
12182
|
-
|
|
12241
|
+
useEffect52(() => {
|
|
12183
12242
|
const amountNum = parseFloat(amount);
|
|
12184
12243
|
if (isNaN(amountNum) || amountNum <= 0) {
|
|
12185
12244
|
setQuotes([]);
|
|
@@ -12259,7 +12318,7 @@ function BuyWithCard({
|
|
|
12259
12318
|
setQuotesLoading(false);
|
|
12260
12319
|
}
|
|
12261
12320
|
};
|
|
12262
|
-
|
|
12321
|
+
useEffect52(() => {
|
|
12263
12322
|
if (quotes.length === 0) return;
|
|
12264
12323
|
const timer = setInterval(() => {
|
|
12265
12324
|
setCountdown((prev) => {
|
|
@@ -12338,17 +12397,17 @@ function BuyWithCard({
|
|
|
12338
12397
|
/* @__PURE__ */ jsxs12(
|
|
12339
12398
|
"div",
|
|
12340
12399
|
{
|
|
12341
|
-
className: `uf-transition-all uf-duration-300 ${showQuotesView || showOnrampView ? "uf-opacity-0 uf-pointer-events-none uf-absolute uf-inset-0" : "uf-opacity-100"}`,
|
|
12400
|
+
className: `uf-transition-all uf-duration-300 uf-min-h-[420px] ${showQuotesView || showOnrampView ? "uf-opacity-0 uf-pointer-events-none uf-absolute uf-inset-0" : "uf-opacity-100"}`,
|
|
12342
12401
|
children: [
|
|
12343
12402
|
/* @__PURE__ */ jsxs12("div", { className: "uf-mb-6 uf-pt-4", children: [
|
|
12344
|
-
/* @__PURE__ */
|
|
12403
|
+
/* @__PURE__ */ jsx162("div", { className: "uf-flex uf-justify-center uf-mb-4", children: /* @__PURE__ */ jsxs12(
|
|
12345
12404
|
"button",
|
|
12346
12405
|
{
|
|
12347
12406
|
onClick: () => setShowCurrencyModal(true),
|
|
12348
12407
|
disabled: currenciesLoading,
|
|
12349
12408
|
className: "uf-flex uf-items-center uf-gap-1.5 uf-px-3 uf-py-1.5 uf-rounded-lg uf-bg-secondary hover:uf-bg-accent uf-transition-colors disabled:uf-opacity-50 disabled:uf-cursor-not-allowed",
|
|
12350
12409
|
children: [
|
|
12351
|
-
selectedCurrencyData && /* @__PURE__ */
|
|
12410
|
+
selectedCurrencyData && /* @__PURE__ */ jsx162(
|
|
12352
12411
|
"img",
|
|
12353
12412
|
{
|
|
12354
12413
|
src: getPreferredIconUrl(selectedCurrencyData.icon_urls, "png") || selectedCurrencyData.icon_url,
|
|
@@ -12356,14 +12415,14 @@ function BuyWithCard({
|
|
|
12356
12415
|
className: "uf-w-4 uf-h-4"
|
|
12357
12416
|
}
|
|
12358
12417
|
),
|
|
12359
|
-
/* @__PURE__ */
|
|
12360
|
-
/* @__PURE__ */
|
|
12418
|
+
/* @__PURE__ */ jsx162("span", { className: "uf-text-sm uf-text-foreground uf-font-medium", children: currency.toUpperCase() }),
|
|
12419
|
+
/* @__PURE__ */ jsx162(ChevronDown, { className: "uf-w-3.5 uf-h-3.5 uf-text-muted-foreground" })
|
|
12361
12420
|
]
|
|
12362
12421
|
}
|
|
12363
12422
|
) }),
|
|
12364
12423
|
/* @__PURE__ */ jsxs12("div", { className: "uf-text-center uf-mb-4", children: [
|
|
12365
|
-
/* @__PURE__ */
|
|
12366
|
-
/* @__PURE__ */
|
|
12424
|
+
/* @__PURE__ */ jsx162("div", { className: "uf-flex uf-items-center uf-justify-center uf-mb-2 uf-px-8", children: /* @__PURE__ */ jsxs12("div", { className: "uf-flex uf-items-center uf-max-w-full", children: [
|
|
12425
|
+
/* @__PURE__ */ jsx162(
|
|
12367
12426
|
"span",
|
|
12368
12427
|
{
|
|
12369
12428
|
className: "uf-font-normal uf-text-foreground uf-flex-shrink-0 uf-mr-1",
|
|
@@ -12373,7 +12432,7 @@ function BuyWithCard({
|
|
|
12373
12432
|
children: currencySymbol
|
|
12374
12433
|
}
|
|
12375
12434
|
),
|
|
12376
|
-
/* @__PURE__ */
|
|
12435
|
+
/* @__PURE__ */ jsx162(
|
|
12377
12436
|
"input",
|
|
12378
12437
|
{
|
|
12379
12438
|
type: "text",
|
|
@@ -12389,12 +12448,12 @@ function BuyWithCard({
|
|
|
12389
12448
|
}
|
|
12390
12449
|
)
|
|
12391
12450
|
] }) }),
|
|
12392
|
-
quotesLoading ? /* @__PURE__ */
|
|
12451
|
+
quotesLoading ? /* @__PURE__ */ jsx162("div", { className: "uf-flex uf-justify-center", children: /* @__PURE__ */ jsx162("div", { className: "uf-h-4 uf-bg-muted uf-rounded uf-w-40 uf-animate-pulse" }) }) : /* @__PURE__ */ jsxs12("div", { className: "uf-text-sm uf-text-muted-foreground uf-font-normal", children: [
|
|
12393
12452
|
calculateUSDC(),
|
|
12394
12453
|
" USDC (Perps)"
|
|
12395
12454
|
] })
|
|
12396
12455
|
] }),
|
|
12397
|
-
/* @__PURE__ */
|
|
12456
|
+
/* @__PURE__ */ jsx162("div", { className: "uf-flex uf-gap-3 uf-justify-center", children: QUICK_AMOUNTS.map((quickAmount) => /* @__PURE__ */ jsxs12(
|
|
12398
12457
|
"button",
|
|
12399
12458
|
{
|
|
12400
12459
|
onClick: () => handleQuickAmount(quickAmount),
|
|
@@ -12409,29 +12468,29 @@ function BuyWithCard({
|
|
|
12409
12468
|
] }),
|
|
12410
12469
|
/* @__PURE__ */ jsxs12("div", { className: "uf-mb-6", children: [
|
|
12411
12470
|
/* @__PURE__ */ jsxs12("div", { className: "uf-flex uf-items-center uf-justify-between uf-text-xs uf-font-medium uf-mb-2 uf-px-1", children: [
|
|
12412
|
-
/* @__PURE__ */
|
|
12471
|
+
/* @__PURE__ */ jsx162("span", { className: "uf-text-foreground", children: "Provider" }),
|
|
12413
12472
|
quotes.length > 0 && !quotesLoading && /* @__PURE__ */ jsxs12("span", { className: "uf-text-[10px] uf-text-foreground uf-font-normal", children: [
|
|
12414
12473
|
"Refreshing in ",
|
|
12415
12474
|
countdown,
|
|
12416
12475
|
"s"
|
|
12417
12476
|
] })
|
|
12418
12477
|
] }),
|
|
12419
|
-
/* @__PURE__ */
|
|
12478
|
+
/* @__PURE__ */ jsx162(
|
|
12420
12479
|
"button",
|
|
12421
12480
|
{
|
|
12422
12481
|
onClick: () => handleViewChange("quotes"),
|
|
12423
12482
|
disabled: quotesLoading || quotes.length === 0,
|
|
12424
12483
|
className: "uf-w-full uf-bg-secondary hover:uf-bg-accent uf-transition-colors uf-rounded-xl uf-p-4 uf-group disabled:uf-opacity-50 disabled:uf-cursor-not-allowed",
|
|
12425
12484
|
children: quotesLoading ? /* @__PURE__ */ jsxs12("div", { className: "uf-text-left uf-w-full uf-animate-pulse", children: [
|
|
12426
|
-
/* @__PURE__ */
|
|
12485
|
+
/* @__PURE__ */ jsx162("div", { className: "uf-h-3 uf-bg-muted uf-rounded uf-w-28 uf-mb-3" }),
|
|
12427
12486
|
/* @__PURE__ */ jsxs12("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
12428
|
-
/* @__PURE__ */
|
|
12429
|
-
/* @__PURE__ */
|
|
12487
|
+
/* @__PURE__ */ jsx162("div", { className: "uf-w-8 uf-h-8 uf-bg-muted uf-rounded-full" }),
|
|
12488
|
+
/* @__PURE__ */ jsx162("div", { className: "uf-h-4 uf-bg-muted uf-rounded uf-w-32" })
|
|
12430
12489
|
] })
|
|
12431
12490
|
] }) : /* @__PURE__ */ jsxs12("div", { className: "uf-w-full uf-text-left", children: [
|
|
12432
|
-
isAutoSelected && /* @__PURE__ */
|
|
12491
|
+
isAutoSelected && /* @__PURE__ */ jsx162("div", { className: "uf-text-xs uf-text-muted-foreground uf-font-normal uf-mb-2", children: "Auto-picked for you" }),
|
|
12433
12492
|
selectedProvider && /* @__PURE__ */ jsxs12("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
12434
|
-
/* @__PURE__ */
|
|
12493
|
+
/* @__PURE__ */ jsx162(
|
|
12435
12494
|
"img",
|
|
12436
12495
|
{
|
|
12437
12496
|
src: selectedProvider.icon_url,
|
|
@@ -12442,21 +12501,21 @@ function BuyWithCard({
|
|
|
12442
12501
|
}
|
|
12443
12502
|
),
|
|
12444
12503
|
/* @__PURE__ */ jsxs12("div", { className: "uf-flex-1 uf-min-w-0", children: [
|
|
12445
|
-
/* @__PURE__ */
|
|
12504
|
+
/* @__PURE__ */ jsx162("div", { className: "uf-text-sm uf-text-foreground uf-font-medium", children: selectedProvider.service_provider_display_name }),
|
|
12446
12505
|
/* @__PURE__ */ jsxs12("div", { className: "uf-flex uf-items-center uf-gap-1.5 uf-mt-0.5", children: [
|
|
12447
|
-
isAutoSelected && /* @__PURE__ */
|
|
12448
|
-
isAutoSelected && selectedProvider.low_kyc === false && /* @__PURE__ */
|
|
12449
|
-
selectedProvider.low_kyc === false && /* @__PURE__ */
|
|
12506
|
+
isAutoSelected && /* @__PURE__ */ jsx162("span", { className: "uf-text-[10px] uf-text-green-400 uf-font-normal", children: "Best price" }),
|
|
12507
|
+
isAutoSelected && selectedProvider.low_kyc === false && /* @__PURE__ */ jsx162("span", { className: "uf-text-[10px] uf-text-muted-foreground", children: "\u2022" }),
|
|
12508
|
+
selectedProvider.low_kyc === false && /* @__PURE__ */ jsx162("span", { className: "uf-text-[10px] uf-text-muted-foreground uf-font-normal", children: "No document upload" })
|
|
12450
12509
|
] })
|
|
12451
12510
|
] }),
|
|
12452
|
-
quotes.length > 0 && /* @__PURE__ */
|
|
12511
|
+
quotes.length > 0 && /* @__PURE__ */ jsx162(ChevronRight, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground group-hover:uf-text-foreground uf-transition-colors uf-flex-shrink-0" })
|
|
12453
12512
|
] })
|
|
12454
12513
|
] })
|
|
12455
12514
|
}
|
|
12456
12515
|
),
|
|
12457
|
-
quotesError && /* @__PURE__ */
|
|
12516
|
+
quotesError && /* @__PURE__ */ jsx162("div", { className: "uf-text-xs uf-text-red-400 uf-mt-2 uf-px-1", children: quotesError })
|
|
12458
12517
|
] }),
|
|
12459
|
-
/* @__PURE__ */
|
|
12518
|
+
/* @__PURE__ */ jsx162(
|
|
12460
12519
|
"button",
|
|
12461
12520
|
{
|
|
12462
12521
|
onClick: handleContinue,
|
|
@@ -12471,11 +12530,11 @@ function BuyWithCard({
|
|
|
12471
12530
|
]
|
|
12472
12531
|
}
|
|
12473
12532
|
),
|
|
12474
|
-
/* @__PURE__ */
|
|
12533
|
+
/* @__PURE__ */ jsx162(
|
|
12475
12534
|
"div",
|
|
12476
12535
|
{
|
|
12477
|
-
className: `uf-transition-all uf-duration-300 ${showQuotesView && !showOnrampView ? "uf-opacity-100" : "uf-opacity-0 uf-pointer-events-none uf-absolute uf-inset-0"}`,
|
|
12478
|
-
children: /* @__PURE__ */
|
|
12536
|
+
className: `uf-transition-all uf-duration-300 uf-min-h-[420px] ${showQuotesView && !showOnrampView ? "uf-opacity-100" : "uf-opacity-0 uf-pointer-events-none uf-absolute uf-inset-0"}`,
|
|
12537
|
+
children: /* @__PURE__ */ jsx162("div", { className: "uf-space-y-2 uf-pt-2", children: sortedQuotes.map((quote, index2) => {
|
|
12479
12538
|
const badges = getProviderBadges(quote, sortedQuotes);
|
|
12480
12539
|
const displayName = quote.service_provider_display_name;
|
|
12481
12540
|
const isSelected = selectedProvider?.service_provider === quote.service_provider;
|
|
@@ -12493,7 +12552,7 @@ function BuyWithCard({
|
|
|
12493
12552
|
className: `uf-w-full uf-bg-secondary hover:uf-bg-accent uf-transition-colors uf-rounded-xl uf-p-3 uf-flex uf-items-center uf-justify-between uf-group ${isSelected ? "uf-ring-2 uf-ring-inset uf-ring-primary" : ""}`,
|
|
12494
12553
|
children: [
|
|
12495
12554
|
/* @__PURE__ */ jsxs12("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
12496
|
-
/* @__PURE__ */
|
|
12555
|
+
/* @__PURE__ */ jsx162("div", { className: "uf-w-10 uf-h-10 uf-flex uf-items-center uf-justify-center uf-flex-shrink-0", children: /* @__PURE__ */ jsx162(
|
|
12497
12556
|
"img",
|
|
12498
12557
|
{
|
|
12499
12558
|
src: quote.icon_url,
|
|
@@ -12504,7 +12563,7 @@ function BuyWithCard({
|
|
|
12504
12563
|
}
|
|
12505
12564
|
) }),
|
|
12506
12565
|
/* @__PURE__ */ jsxs12("div", { className: "uf-text-left", children: [
|
|
12507
|
-
/* @__PURE__ */
|
|
12566
|
+
/* @__PURE__ */ jsx162("div", { className: "uf-text-sm uf-font-medium uf-text-foreground", children: displayName }),
|
|
12508
12567
|
/* @__PURE__ */ jsxs12("div", { className: "uf-flex uf-items-center uf-gap-1.5 uf-mt-0.5", children: [
|
|
12509
12568
|
badges.map((badge, i) => /* @__PURE__ */ jsxs12(
|
|
12510
12569
|
"span",
|
|
@@ -12517,8 +12576,8 @@ function BuyWithCard({
|
|
|
12517
12576
|
},
|
|
12518
12577
|
i
|
|
12519
12578
|
)),
|
|
12520
|
-
quote.low_kyc === false && badges.length > 0 && /* @__PURE__ */
|
|
12521
|
-
quote.low_kyc === false && /* @__PURE__ */
|
|
12579
|
+
quote.low_kyc === false && badges.length > 0 && /* @__PURE__ */ jsx162("span", { className: "uf-text-[10px] uf-text-muted-foreground", children: "\u2022" }),
|
|
12580
|
+
quote.low_kyc === false && /* @__PURE__ */ jsx162("span", { className: "uf-text-[10px] uf-text-muted-foreground uf-font-normal", children: "No document upload" })
|
|
12522
12581
|
] })
|
|
12523
12582
|
] })
|
|
12524
12583
|
] }),
|
|
@@ -12540,12 +12599,12 @@ function BuyWithCard({
|
|
|
12540
12599
|
}) })
|
|
12541
12600
|
}
|
|
12542
12601
|
),
|
|
12543
|
-
/* @__PURE__ */
|
|
12602
|
+
/* @__PURE__ */ jsx162(
|
|
12544
12603
|
"div",
|
|
12545
12604
|
{
|
|
12546
12605
|
className: `uf-transition-all uf-duration-300 ${showOnrampView ? "uf-opacity-100" : "uf-opacity-0 uf-pointer-events-none uf-absolute uf-inset-0"}`,
|
|
12547
12606
|
children: onrampSession && /* @__PURE__ */ jsxs12("div", { className: "uf-flex uf-flex-col uf-items-center uf-pt-6 uf-pb-4 uf-px-2", children: [
|
|
12548
|
-
/* @__PURE__ */
|
|
12607
|
+
/* @__PURE__ */ jsx162("div", { className: "uf-mb-6", children: /* @__PURE__ */ jsx162(
|
|
12549
12608
|
"img",
|
|
12550
12609
|
{
|
|
12551
12610
|
src: onrampSession.provider.icon_url,
|
|
@@ -12555,14 +12614,14 @@ function BuyWithCard({
|
|
|
12555
12614
|
className: "uf-rounded-2xl"
|
|
12556
12615
|
}
|
|
12557
12616
|
) }),
|
|
12558
|
-
/* @__PURE__ */
|
|
12617
|
+
/* @__PURE__ */ jsx162("h2", { className: "uf-text-xl uf-font-medium uf-text-foreground uf-mb-2", children: t2.onramp.completeTransaction.replace(
|
|
12559
12618
|
"{{provider}}",
|
|
12560
12619
|
onrampSession.provider.service_provider_display_name
|
|
12561
12620
|
) }),
|
|
12562
|
-
/* @__PURE__ */
|
|
12563
|
-
/* @__PURE__ */
|
|
12621
|
+
/* @__PURE__ */ jsx162("p", { className: "uf-text-sm uf-text-muted-foreground uf-mb-8", children: t2.onramp.canCloseModal }),
|
|
12622
|
+
/* @__PURE__ */ jsx162("div", { className: "uf-w-full uf-bg-secondary uf-rounded-xl uf-p-4 uf-mb-4", children: /* @__PURE__ */ jsxs12("div", { className: "uf-flex uf-items-center uf-justify-center", children: [
|
|
12564
12623
|
/* @__PURE__ */ jsxs12("div", { className: "uf-flex uf-flex-col uf-items-center uf-min-w-[72px]", children: [
|
|
12565
|
-
/* @__PURE__ */
|
|
12624
|
+
/* @__PURE__ */ jsx162("div", { className: "uf-h-8 uf-flex uf-items-center uf-justify-center uf-mb-1.5", children: /* @__PURE__ */ jsx162(
|
|
12566
12625
|
"img",
|
|
12567
12626
|
{
|
|
12568
12627
|
src: getIconUrlWithCdn(
|
|
@@ -12573,13 +12632,13 @@ function BuyWithCard({
|
|
|
12573
12632
|
className: "uf-w-7 uf-h-7 uf-rounded-full"
|
|
12574
12633
|
}
|
|
12575
12634
|
) }),
|
|
12576
|
-
/* @__PURE__ */
|
|
12577
|
-
/* @__PURE__ */
|
|
12635
|
+
/* @__PURE__ */ jsx162("span", { className: "uf-text-[10px] uf-text-muted-foreground uf-text-center", children: t2.onramp.youUse }),
|
|
12636
|
+
/* @__PURE__ */ jsx162("span", { className: "uf-text-sm uf-font-medium uf-text-foreground uf-text-center", children: onrampSession.sourceCurrency.toUpperCase() })
|
|
12578
12637
|
] }),
|
|
12579
|
-
/* @__PURE__ */
|
|
12638
|
+
/* @__PURE__ */ jsx162("div", { className: "uf-text-muted-foreground uf-px-1 uf-self-start uf-pt-2", children: /* @__PURE__ */ jsx162(ChevronRight, { className: "uf-w-4 uf-h-4" }) }),
|
|
12580
12639
|
/* @__PURE__ */ jsxs12("div", { className: "uf-flex uf-flex-col uf-items-center uf-min-w-[72px]", children: [
|
|
12581
|
-
/* @__PURE__ */
|
|
12582
|
-
/* @__PURE__ */
|
|
12640
|
+
/* @__PURE__ */ jsx162("div", { className: "uf-h-8 uf-flex uf-items-center uf-justify-center uf-mb-1.5", children: /* @__PURE__ */ jsxs12("div", { className: "uf-relative", children: [
|
|
12641
|
+
/* @__PURE__ */ jsx162(
|
|
12583
12642
|
"img",
|
|
12584
12643
|
{
|
|
12585
12644
|
src: getIconUrlWithCdn("/icons/tokens/png/usdc.png", assetCdnUrl),
|
|
@@ -12587,7 +12646,7 @@ function BuyWithCard({
|
|
|
12587
12646
|
className: "uf-w-7 uf-h-7 uf-rounded-full"
|
|
12588
12647
|
}
|
|
12589
12648
|
),
|
|
12590
|
-
/* @__PURE__ */
|
|
12649
|
+
/* @__PURE__ */ jsx162(
|
|
12591
12650
|
"img",
|
|
12592
12651
|
{
|
|
12593
12652
|
src: getIconUrlWithCdn("/icons/networks/png/polygon.png", assetCdnUrl),
|
|
@@ -12596,13 +12655,13 @@ function BuyWithCard({
|
|
|
12596
12655
|
}
|
|
12597
12656
|
)
|
|
12598
12657
|
] }) }),
|
|
12599
|
-
/* @__PURE__ */
|
|
12600
|
-
/* @__PURE__ */
|
|
12658
|
+
/* @__PURE__ */ jsx162("span", { className: "uf-text-[10px] uf-text-muted-foreground uf-text-center", children: t2.onramp.youBuy }),
|
|
12659
|
+
/* @__PURE__ */ jsx162("span", { className: "uf-text-sm uf-font-medium uf-text-foreground uf-text-center", children: "USDC" })
|
|
12601
12660
|
] }),
|
|
12602
|
-
/* @__PURE__ */
|
|
12661
|
+
/* @__PURE__ */ jsx162("div", { className: "uf-text-muted-foreground uf-px-1 uf-self-start uf-pt-2", children: /* @__PURE__ */ jsx162(ChevronRight, { className: "uf-w-4 uf-h-4" }) }),
|
|
12603
12662
|
/* @__PURE__ */ jsxs12("div", { className: "uf-flex uf-flex-col uf-items-center uf-min-w-[72px]", children: [
|
|
12604
|
-
/* @__PURE__ */
|
|
12605
|
-
/* @__PURE__ */
|
|
12663
|
+
/* @__PURE__ */ jsx162("div", { className: "uf-h-8 uf-flex uf-items-center uf-justify-center uf-mb-1.5", children: /* @__PURE__ */ jsxs12("div", { className: "uf-relative", children: [
|
|
12664
|
+
/* @__PURE__ */ jsx162(
|
|
12606
12665
|
"img",
|
|
12607
12666
|
{
|
|
12608
12667
|
src: destinationToken?.icon_url || getIconUrlWithCdn("/icons/tokens/png/usdc.png", assetCdnUrl),
|
|
@@ -12610,7 +12669,7 @@ function BuyWithCard({
|
|
|
12610
12669
|
className: "uf-w-7 uf-h-7 uf-rounded-full"
|
|
12611
12670
|
}
|
|
12612
12671
|
),
|
|
12613
|
-
destinationChain?.icon_url && /* @__PURE__ */
|
|
12672
|
+
destinationChain?.icon_url && /* @__PURE__ */ jsx162(
|
|
12614
12673
|
"img",
|
|
12615
12674
|
{
|
|
12616
12675
|
src: destinationChain.icon_url,
|
|
@@ -12619,15 +12678,15 @@ function BuyWithCard({
|
|
|
12619
12678
|
}
|
|
12620
12679
|
)
|
|
12621
12680
|
] }) }),
|
|
12622
|
-
/* @__PURE__ */
|
|
12623
|
-
/* @__PURE__ */
|
|
12681
|
+
/* @__PURE__ */ jsx162("span", { className: "uf-text-[10px] uf-text-muted-foreground uf-text-center", children: t2.onramp.youReceive }),
|
|
12682
|
+
/* @__PURE__ */ jsx162("span", { className: "uf-text-sm uf-font-medium uf-text-foreground uf-text-center", children: displayTokenSymbol })
|
|
12624
12683
|
] })
|
|
12625
12684
|
] }) }),
|
|
12626
|
-
/* @__PURE__ */
|
|
12685
|
+
/* @__PURE__ */ jsx162("div", { className: "uf-w-full uf-bg-secondary uf-rounded-xl uf-p-4", children: /* @__PURE__ */ jsx162("p", { className: "uf-text-xs uf-text-muted-foreground uf-leading-relaxed", children: t2.onramp.intentAddressNote }) })
|
|
12627
12686
|
] })
|
|
12628
12687
|
}
|
|
12629
12688
|
),
|
|
12630
|
-
/* @__PURE__ */
|
|
12689
|
+
/* @__PURE__ */ jsx162(
|
|
12631
12690
|
CurrencyModal,
|
|
12632
12691
|
{
|
|
12633
12692
|
open: showCurrencyModal,
|
|
@@ -12657,16 +12716,16 @@ function TransferCryptoButton({
|
|
|
12657
12716
|
className: "uf-w-full uf-bg-secondary hover:uf-bg-accent uf-transition-colors uf-rounded-xl uf-p-3 uf-flex uf-items-center uf-justify-between uf-group",
|
|
12658
12717
|
children: [
|
|
12659
12718
|
/* @__PURE__ */ jsxs13("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
12660
|
-
/* @__PURE__ */
|
|
12719
|
+
/* @__PURE__ */ jsx172("div", { className: "uf-bg-muted uf-rounded-lg uf-p-2", children: /* @__PURE__ */ jsx172(Zap, { className: "uf-w-5 uf-h-5" }) }),
|
|
12661
12720
|
/* @__PURE__ */ jsxs13("div", { className: "uf-text-left", children: [
|
|
12662
|
-
/* @__PURE__ */
|
|
12663
|
-
/* @__PURE__ */
|
|
12721
|
+
/* @__PURE__ */ jsx172("div", { className: "uf-text-sm uf-font-light uf-mb-0.5 uf-text-foreground", children: title }),
|
|
12722
|
+
/* @__PURE__ */ jsx172("div", { className: "uf-text-muted-foreground uf-text-xs uf-font-light", children: subtitle })
|
|
12664
12723
|
] })
|
|
12665
12724
|
] }),
|
|
12666
12725
|
/* @__PURE__ */ jsxs13("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
12667
|
-
/* @__PURE__ */
|
|
12726
|
+
/* @__PURE__ */ jsx172("div", { className: "uf-flex uf--space-x-2", children: sortedTokens.map((token) => {
|
|
12668
12727
|
const iconUrl = token.icon_urls.find((u) => u.format === "svg")?.url || token.icon_urls.find((u) => u.format === "png")?.url;
|
|
12669
|
-
return /* @__PURE__ */
|
|
12728
|
+
return /* @__PURE__ */ jsx172(
|
|
12670
12729
|
"img",
|
|
12671
12730
|
{
|
|
12672
12731
|
src: iconUrl,
|
|
@@ -12678,7 +12737,7 @@ function TransferCryptoButton({
|
|
|
12678
12737
|
token.name
|
|
12679
12738
|
);
|
|
12680
12739
|
}) }),
|
|
12681
|
-
/* @__PURE__ */
|
|
12740
|
+
/* @__PURE__ */ jsx172(ChevronRight, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground group-hover:uf-text-foreground uf-transition-colors" })
|
|
12682
12741
|
] })
|
|
12683
12742
|
]
|
|
12684
12743
|
}
|
|
@@ -12697,16 +12756,16 @@ function DepositWithCardButton({
|
|
|
12697
12756
|
className: "uf-w-full uf-bg-secondary hover:uf-bg-accent uf-transition-colors uf-rounded-xl uf-p-3 uf-flex uf-items-center uf-justify-between uf-group",
|
|
12698
12757
|
children: [
|
|
12699
12758
|
/* @__PURE__ */ jsxs14("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
12700
|
-
/* @__PURE__ */
|
|
12759
|
+
/* @__PURE__ */ jsx18("div", { className: "uf-bg-muted uf-rounded-lg uf-p-2", children: /* @__PURE__ */ jsx18(CreditCard, { className: "uf-w-5 uf-h-5" }) }),
|
|
12701
12760
|
/* @__PURE__ */ jsxs14("div", { className: "uf-text-left", children: [
|
|
12702
|
-
/* @__PURE__ */
|
|
12703
|
-
/* @__PURE__ */
|
|
12761
|
+
/* @__PURE__ */ jsx18("div", { className: "uf-text-sm uf-font-light uf-mb-0.5 uf-text-foreground", children: title }),
|
|
12762
|
+
/* @__PURE__ */ jsx18("div", { className: "uf-text-muted-foreground uf-text-xs uf-font-light", children: subtitle })
|
|
12704
12763
|
] })
|
|
12705
12764
|
] }),
|
|
12706
12765
|
/* @__PURE__ */ jsxs14("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
12707
|
-
/* @__PURE__ */
|
|
12766
|
+
/* @__PURE__ */ jsx18("div", { className: "uf-flex uf-items-center uf-gap-1.5", children: paymentNetworks?.map((network) => {
|
|
12708
12767
|
const iconUrl = network.icon_urls.find((u) => u.format === "svg")?.url || network.icon_urls.find((u) => u.format === "png")?.url;
|
|
12709
|
-
return /* @__PURE__ */
|
|
12768
|
+
return /* @__PURE__ */ jsx18(
|
|
12710
12769
|
"img",
|
|
12711
12770
|
{
|
|
12712
12771
|
src: iconUrl,
|
|
@@ -12718,7 +12777,7 @@ function DepositWithCardButton({
|
|
|
12718
12777
|
network.name
|
|
12719
12778
|
);
|
|
12720
12779
|
}) }),
|
|
12721
|
-
/* @__PURE__ */
|
|
12780
|
+
/* @__PURE__ */ jsx18(ChevronRight, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground group-hover:uf-text-foreground uf-transition-colors" })
|
|
12722
12781
|
] })
|
|
12723
12782
|
]
|
|
12724
12783
|
}
|
|
@@ -12738,15 +12797,15 @@ function DepositTrackerButton({
|
|
|
12738
12797
|
children: [
|
|
12739
12798
|
/* @__PURE__ */ jsxs15("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
12740
12799
|
/* @__PURE__ */ jsxs15("div", { className: "uf-bg-muted uf-rounded-lg uf-p-2 uf-relative", children: [
|
|
12741
|
-
/* @__PURE__ */
|
|
12742
|
-
badge !== void 0 && badge > 0 && /* @__PURE__ */
|
|
12800
|
+
/* @__PURE__ */ jsx19(Clock, { className: "uf-w-5 uf-h-5" }),
|
|
12801
|
+
badge !== void 0 && badge > 0 && /* @__PURE__ */ jsx19("div", { className: "uf-absolute -uf-top-1 -uf-right-1 uf-bg-blue-500 uf-text-primary-foreground uf-text-[10px] uf-font-semibold uf-rounded-full uf-min-w-[18px] uf-h-[18px] uf-flex uf-items-center uf-justify-center uf-px-1", children: badge > 99 ? "99+" : badge })
|
|
12743
12802
|
] }),
|
|
12744
12803
|
/* @__PURE__ */ jsxs15("div", { className: "uf-text-left", children: [
|
|
12745
|
-
/* @__PURE__ */
|
|
12746
|
-
/* @__PURE__ */
|
|
12804
|
+
/* @__PURE__ */ jsx19("div", { className: "uf-text-sm uf-font-light uf-mb-0.5 uf-text-foreground", children: title }),
|
|
12805
|
+
/* @__PURE__ */ jsx19("div", { className: "uf-text-muted-foreground uf-text-xs uf-font-light", children: subtitle })
|
|
12747
12806
|
] })
|
|
12748
12807
|
] }),
|
|
12749
|
-
/* @__PURE__ */
|
|
12808
|
+
/* @__PURE__ */ jsx19(ChevronRight, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground group-hover:uf-text-foreground uf-transition-colors" })
|
|
12750
12809
|
]
|
|
12751
12810
|
}
|
|
12752
12811
|
);
|
|
@@ -12754,19 +12813,19 @@ function DepositTrackerButton({
|
|
|
12754
12813
|
function SkeletonButton({ variant = "default" }) {
|
|
12755
12814
|
return /* @__PURE__ */ jsxs16("div", { className: "uf-w-full uf-bg-secondary uf-rounded-xl uf-p-3 uf-flex uf-items-center uf-justify-between uf-animate-pulse", children: [
|
|
12756
12815
|
/* @__PURE__ */ jsxs16("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
12757
|
-
/* @__PURE__ */
|
|
12816
|
+
/* @__PURE__ */ jsx20("div", { className: "uf-bg-muted uf-rounded-lg uf-w-9 uf-h-9" }),
|
|
12758
12817
|
/* @__PURE__ */ jsxs16("div", { className: "uf-space-y-1.5", children: [
|
|
12759
|
-
/* @__PURE__ */
|
|
12760
|
-
/* @__PURE__ */
|
|
12818
|
+
/* @__PURE__ */ jsx20("div", { className: "uf-h-3.5 uf-w-24 uf-bg-muted uf-rounded" }),
|
|
12819
|
+
/* @__PURE__ */ jsx20("div", { className: "uf-h-3 uf-w-32 uf-bg-muted uf-rounded" })
|
|
12761
12820
|
] })
|
|
12762
12821
|
] }),
|
|
12763
12822
|
/* @__PURE__ */ jsxs16("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
12764
|
-
variant === "with-icons" && /* @__PURE__ */
|
|
12765
|
-
/* @__PURE__ */
|
|
12823
|
+
variant === "with-icons" && /* @__PURE__ */ jsx20("div", { className: "uf-flex uf--space-x-1", children: [1, 2, 3].map((i) => /* @__PURE__ */ jsx20("div", { className: "uf-w-5 uf-h-5 uf-rounded-full uf-bg-muted uf-border-2 uf-border-secondary" }, i)) }),
|
|
12824
|
+
/* @__PURE__ */ jsx20(ChevronRight, { className: "uf-w-4 uf-h-4 uf-text-muted" })
|
|
12766
12825
|
] })
|
|
12767
12826
|
] });
|
|
12768
12827
|
}
|
|
12769
|
-
var t3 =
|
|
12828
|
+
var t3 = i18n2.depositModal;
|
|
12770
12829
|
function DepositModal({
|
|
12771
12830
|
open,
|
|
12772
12831
|
onOpenChange,
|
|
@@ -12783,24 +12842,24 @@ function DepositModal({
|
|
|
12783
12842
|
onDepositError,
|
|
12784
12843
|
theme = "dark"
|
|
12785
12844
|
}) {
|
|
12786
|
-
const [view, setView] =
|
|
12787
|
-
const [cardView, setCardView] =
|
|
12845
|
+
const [view, setView] = useState72("main");
|
|
12846
|
+
const [cardView, setCardView] = useState72(
|
|
12788
12847
|
"amount"
|
|
12789
12848
|
);
|
|
12790
|
-
const [quotesCount, setQuotesCount] =
|
|
12791
|
-
const [depositsModalOpen, setDepositsModalOpen] =
|
|
12792
|
-
const [depositExecutions, setDepositExecutions] =
|
|
12793
|
-
const [projectConfig, setProjectConfig] =
|
|
12794
|
-
const [wallets, setWallets] =
|
|
12795
|
-
const [walletsLoading, setWalletsLoading] =
|
|
12796
|
-
|
|
12849
|
+
const [quotesCount, setQuotesCount] = useState72(0);
|
|
12850
|
+
const [depositsModalOpen, setDepositsModalOpen] = useState72(false);
|
|
12851
|
+
const [depositExecutions, setDepositExecutions] = useState72([]);
|
|
12852
|
+
const [projectConfig, setProjectConfig] = useState72(null);
|
|
12853
|
+
const [wallets, setWallets] = useState72([]);
|
|
12854
|
+
const [walletsLoading, setWalletsLoading] = useState72(false);
|
|
12855
|
+
useEffect62(() => {
|
|
12797
12856
|
setProjectConfig(null);
|
|
12798
12857
|
}, [publishableKey]);
|
|
12799
|
-
|
|
12858
|
+
useEffect62(() => {
|
|
12800
12859
|
setWallets([]);
|
|
12801
12860
|
}, [userId, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, publishableKey]);
|
|
12802
|
-
const [resolvedTheme, setResolvedTheme] =
|
|
12803
|
-
|
|
12861
|
+
const [resolvedTheme, setResolvedTheme] = useState72(theme === "auto" ? "dark" : theme);
|
|
12862
|
+
useEffect62(() => {
|
|
12804
12863
|
if (theme === "auto") {
|
|
12805
12864
|
const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
12806
12865
|
setResolvedTheme(mediaQuery.matches ? "dark" : "light");
|
|
@@ -12813,12 +12872,12 @@ function DepositModal({
|
|
|
12813
12872
|
setResolvedTheme(theme);
|
|
12814
12873
|
}
|
|
12815
12874
|
}, [theme]);
|
|
12816
|
-
|
|
12875
|
+
useEffect62(() => {
|
|
12817
12876
|
if (open && !projectConfig) {
|
|
12818
12877
|
getProjectConfig(publishableKey).then(setProjectConfig).catch(console.error);
|
|
12819
12878
|
}
|
|
12820
12879
|
}, [open, publishableKey, projectConfig]);
|
|
12821
|
-
|
|
12880
|
+
useEffect62(() => {
|
|
12822
12881
|
if (!open || wallets.length > 0) return;
|
|
12823
12882
|
let retryTimeout = null;
|
|
12824
12883
|
let isCancelled = false;
|
|
@@ -12826,9 +12885,9 @@ function DepositModal({
|
|
|
12826
12885
|
if (isCancelled) return;
|
|
12827
12886
|
setWalletsLoading(true);
|
|
12828
12887
|
try {
|
|
12829
|
-
const response = await
|
|
12888
|
+
const response = await createDepositAddress(
|
|
12830
12889
|
{
|
|
12831
|
-
|
|
12890
|
+
external_user_id: userId,
|
|
12832
12891
|
recipient_address: recipientAddress,
|
|
12833
12892
|
destination_chain_type: destinationChainType,
|
|
12834
12893
|
destination_chain_id: destinationChainId,
|
|
@@ -12880,27 +12939,27 @@ function DepositModal({
|
|
|
12880
12939
|
setQuotesCount(count3);
|
|
12881
12940
|
}
|
|
12882
12941
|
};
|
|
12883
|
-
return /* @__PURE__ */
|
|
12884
|
-
/* @__PURE__ */
|
|
12942
|
+
return /* @__PURE__ */ jsx20(ThemeProvider, { themeClass, children: /* @__PURE__ */ jsxs16(Dialog2, { open, onOpenChange: handleClose, children: [
|
|
12943
|
+
/* @__PURE__ */ jsx20(
|
|
12885
12944
|
DialogContent2,
|
|
12886
12945
|
{
|
|
12887
12946
|
className: `sm:uf-max-w-[400px] !uf-bg-card uf-border-secondary uf-text-foreground uf-p-0 uf-gap-0 uf-overflow-visible [&>button]:uf-hidden ${themeClass}`,
|
|
12888
12947
|
onPointerDownOutside: (e) => e.preventDefault(),
|
|
12889
12948
|
onInteractOutside: (e) => e.preventDefault(),
|
|
12890
12949
|
children: view === "main" ? /* @__PURE__ */ jsxs16(Fragment42, { children: [
|
|
12891
|
-
/* @__PURE__ */
|
|
12950
|
+
/* @__PURE__ */ jsx20(
|
|
12892
12951
|
DepositHeader,
|
|
12893
12952
|
{
|
|
12894
12953
|
title: modalTitle || "Deposit",
|
|
12895
12954
|
onClose: handleClose
|
|
12896
12955
|
}
|
|
12897
12956
|
),
|
|
12898
|
-
/* @__PURE__ */
|
|
12899
|
-
/* @__PURE__ */
|
|
12900
|
-
/* @__PURE__ */
|
|
12901
|
-
!hideDepositTracker && /* @__PURE__ */
|
|
12957
|
+
/* @__PURE__ */ jsx20("div", { className: "uf-pb-4 uf-space-y-3", children: !projectConfig ? /* @__PURE__ */ jsxs16(Fragment42, { children: [
|
|
12958
|
+
/* @__PURE__ */ jsx20(SkeletonButton, { variant: "with-icons" }),
|
|
12959
|
+
/* @__PURE__ */ jsx20(SkeletonButton, { variant: "with-icons" }),
|
|
12960
|
+
!hideDepositTracker && /* @__PURE__ */ jsx20(SkeletonButton, {})
|
|
12902
12961
|
] }) : /* @__PURE__ */ jsxs16(Fragment42, { children: [
|
|
12903
|
-
/* @__PURE__ */
|
|
12962
|
+
/* @__PURE__ */ jsx20(
|
|
12904
12963
|
TransferCryptoButton,
|
|
12905
12964
|
{
|
|
12906
12965
|
onClick: () => setView("transfer"),
|
|
@@ -12909,7 +12968,7 @@ function DepositModal({
|
|
|
12909
12968
|
featuredTokens: projectConfig.transfer_crypto.networks
|
|
12910
12969
|
}
|
|
12911
12970
|
),
|
|
12912
|
-
/* @__PURE__ */
|
|
12971
|
+
/* @__PURE__ */ jsx20(
|
|
12913
12972
|
DepositWithCardButton,
|
|
12914
12973
|
{
|
|
12915
12974
|
onClick: () => setView("card"),
|
|
@@ -12918,7 +12977,7 @@ function DepositModal({
|
|
|
12918
12977
|
paymentNetworks: projectConfig.payment_networks.networks
|
|
12919
12978
|
}
|
|
12920
12979
|
),
|
|
12921
|
-
!hideDepositTracker && /* @__PURE__ */
|
|
12980
|
+
!hideDepositTracker && /* @__PURE__ */ jsx20(
|
|
12922
12981
|
DepositTrackerButton,
|
|
12923
12982
|
{
|
|
12924
12983
|
onClick: () => setDepositsModalOpen(true),
|
|
@@ -12929,7 +12988,7 @@ function DepositModal({
|
|
|
12929
12988
|
)
|
|
12930
12989
|
] }) })
|
|
12931
12990
|
] }) : view === "transfer" ? /* @__PURE__ */ jsxs16(Fragment42, { children: [
|
|
12932
|
-
/* @__PURE__ */
|
|
12991
|
+
/* @__PURE__ */ jsx20(
|
|
12933
12992
|
DepositHeader,
|
|
12934
12993
|
{
|
|
12935
12994
|
title: t3.transferCrypto.title,
|
|
@@ -12938,7 +12997,7 @@ function DepositModal({
|
|
|
12938
12997
|
onClose: handleClose
|
|
12939
12998
|
}
|
|
12940
12999
|
),
|
|
12941
|
-
/* @__PURE__ */
|
|
13000
|
+
/* @__PURE__ */ jsx20(
|
|
12942
13001
|
TransferCrypto,
|
|
12943
13002
|
{
|
|
12944
13003
|
userId,
|
|
@@ -12954,17 +13013,17 @@ function DepositModal({
|
|
|
12954
13013
|
}
|
|
12955
13014
|
)
|
|
12956
13015
|
] }) : /* @__PURE__ */ jsxs16(Fragment42, { children: [
|
|
12957
|
-
/* @__PURE__ */
|
|
13016
|
+
/* @__PURE__ */ jsx20(
|
|
12958
13017
|
DepositHeader,
|
|
12959
13018
|
{
|
|
12960
|
-
title: cardView === "quotes" ? t3.quotes :
|
|
13019
|
+
title: cardView === "quotes" ? t3.quotes : t3.depositWithCard.title,
|
|
12961
13020
|
showBack: true,
|
|
12962
13021
|
onBack: handleBack,
|
|
12963
13022
|
onClose: handleClose,
|
|
12964
13023
|
badge: cardView === "quotes" ? { count: quotesCount } : void 0
|
|
12965
13024
|
}
|
|
12966
13025
|
),
|
|
12967
|
-
/* @__PURE__ */
|
|
13026
|
+
/* @__PURE__ */ jsx20(
|
|
12968
13027
|
BuyWithCard,
|
|
12969
13028
|
{
|
|
12970
13029
|
userId,
|
|
@@ -12986,11 +13045,12 @@ function DepositModal({
|
|
|
12986
13045
|
] })
|
|
12987
13046
|
}
|
|
12988
13047
|
),
|
|
12989
|
-
/* @__PURE__ */
|
|
13048
|
+
/* @__PURE__ */ jsx20(
|
|
12990
13049
|
DepositsModal,
|
|
12991
13050
|
{
|
|
12992
13051
|
open: depositsModalOpen,
|
|
12993
13052
|
onOpenChange: setDepositsModalOpen,
|
|
13053
|
+
onCloseAll: handleClose,
|
|
12994
13054
|
executions: depositExecutions,
|
|
12995
13055
|
userId,
|
|
12996
13056
|
publishableKey,
|
|
@@ -12999,6 +13059,45 @@ function DepositModal({
|
|
|
12999
13059
|
)
|
|
13000
13060
|
] }) });
|
|
13001
13061
|
}
|
|
13062
|
+
var buttonVariants = cva(
|
|
13063
|
+
"uf-inline-flex uf-items-center uf-justify-center uf-whitespace-nowrap uf-rounded-md uf-text-sm uf-font-medium uf-ring-offset-background uf-transition-colors focus-visible:uf-outline-none focus-visible:uf-ring-2 focus-visible:uf-ring-ring focus-visible:uf-ring-offset-2 disabled:uf-pointer-events-none disabled:uf-opacity-50",
|
|
13064
|
+
{
|
|
13065
|
+
variants: {
|
|
13066
|
+
variant: {
|
|
13067
|
+
default: "uf-bg-primary uf-text-primary-foreground hover:uf-bg-primary/90",
|
|
13068
|
+
destructive: "uf-bg-destructive uf-text-destructive-foreground hover:uf-bg-destructive/90",
|
|
13069
|
+
outline: "uf-border uf-border-input uf-bg-background hover:uf-bg-accent hover:uf-text-accent-foreground",
|
|
13070
|
+
secondary: "uf-bg-secondary uf-text-secondary-foreground hover:uf-bg-secondary/80",
|
|
13071
|
+
ghost: "hover:uf-bg-accent hover:uf-text-accent-foreground",
|
|
13072
|
+
link: "uf-text-primary uf-underline-offset-4 hover:uf-underline"
|
|
13073
|
+
},
|
|
13074
|
+
size: {
|
|
13075
|
+
default: "uf-h-10 uf-px-4 uf-py-2",
|
|
13076
|
+
sm: "uf-h-9 uf-rounded-md uf-px-3",
|
|
13077
|
+
lg: "uf-h-11 uf-rounded-md uf-px-8",
|
|
13078
|
+
icon: "uf-h-10 uf-w-10"
|
|
13079
|
+
}
|
|
13080
|
+
},
|
|
13081
|
+
defaultVariants: {
|
|
13082
|
+
variant: "default",
|
|
13083
|
+
size: "default"
|
|
13084
|
+
}
|
|
13085
|
+
}
|
|
13086
|
+
);
|
|
13087
|
+
var Button = React52.forwardRef(
|
|
13088
|
+
({ className, variant, size: size4, asChild = false, ...props }, ref) => {
|
|
13089
|
+
const Comp = asChild ? Slot3 : "button";
|
|
13090
|
+
return /* @__PURE__ */ jsx222(
|
|
13091
|
+
Comp,
|
|
13092
|
+
{
|
|
13093
|
+
className: cn(buttonVariants({ variant, size: size4, className })),
|
|
13094
|
+
ref,
|
|
13095
|
+
...props
|
|
13096
|
+
}
|
|
13097
|
+
);
|
|
13098
|
+
}
|
|
13099
|
+
);
|
|
13100
|
+
Button.displayName = "Button";
|
|
13002
13101
|
|
|
13003
13102
|
// src/provider.tsx
|
|
13004
13103
|
import { jsx as jsx24, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
@@ -13100,7 +13199,7 @@ function UnifoldProvider2({
|
|
|
13100
13199
|
{
|
|
13101
13200
|
open: isOpen,
|
|
13102
13201
|
onOpenChange: closeDeposit,
|
|
13103
|
-
userId: depositConfig.
|
|
13202
|
+
userId: depositConfig.externalUserId,
|
|
13104
13203
|
publishableKey,
|
|
13105
13204
|
modalTitle: config?.modalTitle,
|
|
13106
13205
|
destinationTokenSymbol: depositConfig.destinationTokenSymbol,
|
|
@@ -13146,15 +13245,12 @@ export {
|
|
|
13146
13245
|
|
|
13147
13246
|
lucide-react/dist/esm/defaultAttributes.js:
|
|
13148
13247
|
lucide-react/dist/esm/createLucideIcon.js:
|
|
13149
|
-
lucide-react/dist/esm/icons/arrow-down-circle.js:
|
|
13150
13248
|
lucide-react/dist/esm/icons/arrow-left.js:
|
|
13151
|
-
lucide-react/dist/esm/icons/check-circle.js:
|
|
13152
13249
|
lucide-react/dist/esm/icons/check.js:
|
|
13153
13250
|
lucide-react/dist/esm/icons/chevron-down.js:
|
|
13154
13251
|
lucide-react/dist/esm/icons/chevron-right.js:
|
|
13155
13252
|
lucide-react/dist/esm/icons/chevron-up.js:
|
|
13156
13253
|
lucide-react/dist/esm/icons/clock.js:
|
|
13157
|
-
lucide-react/dist/esm/icons/copy.js:
|
|
13158
13254
|
lucide-react/dist/esm/icons/credit-card.js:
|
|
13159
13255
|
lucide-react/dist/esm/icons/dollar-sign.js:
|
|
13160
13256
|
lucide-react/dist/esm/icons/external-link.js:
|