@pollar/react 0.10.1-rc.9 → 0.10.1

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.mjs CHANGED
@@ -1033,7 +1033,7 @@ var PollarModalFooter = () => {
1033
1033
  /* @__PURE__ */ jsx("span", { className: "pollar-footer-name", children: "Pollar" }),
1034
1034
  /* @__PURE__ */ jsxs("span", { className: "pollar-footer-version", children: [
1035
1035
  "v",
1036
- "0.10.1-rc.9"
1036
+ "0.10.1"
1037
1037
  ] })
1038
1038
  ] })
1039
1039
  ] });
@@ -1158,7 +1158,10 @@ function RuleCard({
1158
1158
  validity
1159
1159
  ] })
1160
1160
  ] }),
1161
- /* @__PURE__ */ jsx("div", { className: "pollar-dist-item-action", children: isClaimed ? /* @__PURE__ */ jsx("span", { className: "pollar-dist-item-status", "data-kind": "claimed", children: "Claimed" }) : effectivelyClaimable ? /* @__PURE__ */ jsx("button", { type: "button", className: "pollar-btn-primary pollar-dist-claim-btn", onClick: onClaim, disabled: isClaiming, children: isClaiming ? "Claiming\u2026" : "Claim" }) : /* @__PURE__ */ jsx("span", { className: "pollar-dist-item-status", "data-kind": "unavailable", children: reasonLabel(rule.reason) }) }),
1161
+ /* @__PURE__ */ jsx("div", { className: "pollar-dist-item-action", children: isClaimed ? /* @__PURE__ */ jsx("span", { className: "pollar-dist-item-status", "data-kind": "claimed", children: "Claimed" }) : effectivelyClaimable ? /* @__PURE__ */ jsx("button", { type: "button", className: "pollar-btn-primary pollar-dist-claim-btn", onClick: onClaim, disabled: isClaiming, children: isClaiming ? /* @__PURE__ */ jsxs(Fragment, { children: [
1162
+ /* @__PURE__ */ jsx("span", { className: "pollar-spinner pollar-spinner-sm" }),
1163
+ "Claiming\u2026"
1164
+ ] }) : "Claim" }) : /* @__PURE__ */ jsx("span", { className: "pollar-dist-item-status", "data-kind": "unavailable", children: reasonLabel(rule.reason) }) }),
1162
1165
  errorMessage && /* @__PURE__ */ jsx("div", { className: "pollar-dist-item-error", children: errorMessage })
1163
1166
  ] });
1164
1167
  }
@@ -1204,29 +1207,46 @@ function DistributionRulesModalTemplate({
1204
1207
  /* @__PURE__ */ jsxs("div", { className: "pollar-modal-header", children: [
1205
1208
  /* @__PURE__ */ jsx("h2", { className: "pollar-modal-title", children: "Distribution Rules" }),
1206
1209
  /* @__PURE__ */ jsxs("div", { className: "pollar-modal-header-actions", children: [
1207
- /* @__PURE__ */ jsxs("button", { className: "pollar-modal-refresh-btn", onClick: onRefresh, disabled: isLoading, children: [
1208
- /* @__PURE__ */ jsxs(
1209
- "svg",
1210
- {
1211
- className: `pollar-modal-refresh-icon${isLoading ? " spinning" : ""}`,
1212
- width: "13",
1213
- height: "13",
1214
- viewBox: "0 0 13 13",
1215
- fill: "none",
1216
- "aria-hidden": true,
1217
- children: [
1218
- /* @__PURE__ */ jsx("path", { d: "M11.5 6.5a5 5 0 11-1.5-3.536", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }),
1219
- /* @__PURE__ */ jsx("path", { d: "M10 1v3h-3", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
1220
- ]
1221
- }
1222
- ),
1223
- "Refresh"
1224
- ] }),
1210
+ /* @__PURE__ */ jsx(
1211
+ "button",
1212
+ {
1213
+ type: "button",
1214
+ className: "pollar-modal-close",
1215
+ onClick: onRefresh,
1216
+ disabled: isLoading,
1217
+ "aria-label": "Refresh",
1218
+ title: "Refresh",
1219
+ children: /* @__PURE__ */ jsx(
1220
+ "svg",
1221
+ {
1222
+ className: isLoading ? "pollar-modal-refresh-icon pollar-spinning" : "pollar-modal-refresh-icon",
1223
+ width: "16",
1224
+ height: "16",
1225
+ viewBox: "0 0 16 16",
1226
+ fill: "none",
1227
+ "aria-hidden": true,
1228
+ children: /* @__PURE__ */ jsx(
1229
+ "path",
1230
+ {
1231
+ d: "M13.5 8a5.5 5.5 0 1 1-1.6-3.9M13.5 2v3h-3",
1232
+ stroke: "currentColor",
1233
+ strokeWidth: "1.6",
1234
+ strokeLinecap: "round",
1235
+ strokeLinejoin: "round"
1236
+ }
1237
+ )
1238
+ }
1239
+ )
1240
+ }
1241
+ ),
1225
1242
  /* @__PURE__ */ jsx("button", { className: "pollar-modal-close", onClick: onClose, "aria-label": "Close", children: /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "M2 2l12 12M14 2L2 14", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) }) })
1226
1243
  ] })
1227
1244
  ] }),
1228
1245
  /* @__PURE__ */ jsxs("div", { className: "pollar-dist-list", children: [
1229
- isLoading && /* @__PURE__ */ jsx("div", { className: "pollar-modal-empty", children: "Loading\u2026" }),
1246
+ isLoading && /* @__PURE__ */ jsxs("div", { className: "pollar-loading-block", children: [
1247
+ /* @__PURE__ */ jsx("div", { className: "pollar-spinner" }),
1248
+ /* @__PURE__ */ jsx("span", { children: "Loading\u2026" })
1249
+ ] }),
1230
1250
  state.step === "error" && /* @__PURE__ */ jsx("div", { className: "pollar-modal-error", children: state.message }),
1231
1251
  state.step === "loaded" && rules.length === 0 && /* @__PURE__ */ jsx("div", { className: "pollar-modal-empty", children: "No distribution rules available." }),
1232
1252
  rules.map((rule) => /* @__PURE__ */ jsx(
@@ -1351,14 +1371,14 @@ function AssetItem({
1351
1371
  !isNative && record.enabledInApp && /* @__PURE__ */ jsx("span", { className: "pollar-asset-sponsor", children: record.sponsored ? "Reserve sponsored by the app" : "You pay the reserve (~0.5 XLM)" })
1352
1372
  ] }),
1353
1373
  /* @__PURE__ */ jsxs("div", { className: "pollar-asset-actions", children: [
1354
- /* @__PURE__ */ jsx("span", { className: `pollar-asset-trustline${established ? " established" : ""}`, children: established ? "Trustline active" : "Needs trustline" }),
1374
+ /* @__PURE__ */ jsx("span", { className: `pollar-asset-trustline${established ? " pollar-established" : ""}`, children: established ? "Trustline active" : "Needs trustline" }),
1355
1375
  !isNative && /* @__PURE__ */ jsx(
1356
1376
  "button",
1357
1377
  {
1358
- className: `pollar-asset-btn${established ? " danger" : ""}`,
1378
+ className: `pollar-asset-btn${established ? " pollar-danger" : ""}`,
1359
1379
  onClick: () => onToggle(record),
1360
1380
  disabled: busy || disabled,
1361
- children: busy ? "\u2026" : established ? "Disable" : "Enable"
1381
+ children: busy ? /* @__PURE__ */ jsx("span", { className: "pollar-spinner pollar-spinner-sm pollar-spinner-current" }) : established ? "Disable" : "Enable"
1362
1382
  }
1363
1383
  )
1364
1384
  ] })
@@ -1391,29 +1411,46 @@ function EnabledAssetsModalTemplate({
1391
1411
  /* @__PURE__ */ jsxs("div", { className: "pollar-modal-header", children: [
1392
1412
  /* @__PURE__ */ jsx("h2", { className: "pollar-modal-title", children: "Trustlines" }),
1393
1413
  /* @__PURE__ */ jsxs("div", { className: "pollar-modal-header-actions", children: [
1394
- /* @__PURE__ */ jsxs("button", { className: "pollar-modal-refresh-btn", onClick: onRefresh, disabled: isLoading || busy, children: [
1395
- /* @__PURE__ */ jsxs(
1396
- "svg",
1397
- {
1398
- className: `pollar-modal-refresh-icon${isLoading ? " spinning" : ""}`,
1399
- width: "13",
1400
- height: "13",
1401
- viewBox: "0 0 13 13",
1402
- fill: "none",
1403
- "aria-hidden": true,
1404
- children: [
1405
- /* @__PURE__ */ jsx("path", { d: "M11.5 6.5a5 5 0 11-1.5-3.536", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }),
1406
- /* @__PURE__ */ jsx("path", { d: "M10 1v3h-3", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
1407
- ]
1408
- }
1409
- ),
1410
- "Refresh"
1411
- ] }),
1414
+ /* @__PURE__ */ jsx(
1415
+ "button",
1416
+ {
1417
+ type: "button",
1418
+ className: "pollar-modal-close",
1419
+ onClick: onRefresh,
1420
+ disabled: isLoading || busy,
1421
+ "aria-label": "Refresh",
1422
+ title: "Refresh",
1423
+ children: /* @__PURE__ */ jsx(
1424
+ "svg",
1425
+ {
1426
+ className: isLoading ? "pollar-modal-refresh-icon pollar-spinning" : "pollar-modal-refresh-icon",
1427
+ width: "16",
1428
+ height: "16",
1429
+ viewBox: "0 0 16 16",
1430
+ fill: "none",
1431
+ "aria-hidden": true,
1432
+ children: /* @__PURE__ */ jsx(
1433
+ "path",
1434
+ {
1435
+ d: "M13.5 8a5.5 5.5 0 1 1-1.6-3.9M13.5 2v3h-3",
1436
+ stroke: "currentColor",
1437
+ strokeWidth: "1.6",
1438
+ strokeLinecap: "round",
1439
+ strokeLinejoin: "round"
1440
+ }
1441
+ )
1442
+ }
1443
+ )
1444
+ }
1445
+ ),
1412
1446
  /* @__PURE__ */ jsx("button", { className: "pollar-modal-close", onClick: onClose, "aria-label": "Close", children: /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "M2 2l12 12M14 2L2 14", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) }) })
1413
1447
  ] })
1414
1448
  ] }),
1415
1449
  walletAddress && /* @__PURE__ */ jsx("div", { className: "pollar-asset-address", children: cropAddress(walletAddress) }),
1416
- isLoading && /* @__PURE__ */ jsx("div", { className: "pollar-modal-empty", children: "Loading\u2026" }),
1450
+ isLoading && /* @__PURE__ */ jsxs("div", { className: "pollar-loading-block", children: [
1451
+ /* @__PURE__ */ jsx("div", { className: "pollar-spinner" }),
1452
+ /* @__PURE__ */ jsx("span", { children: "Loading\u2026" })
1453
+ ] }),
1417
1454
  enabledAssets.step === "error" && /* @__PURE__ */ jsx("div", { className: "pollar-modal-error", children: enabledAssets.message }),
1418
1455
  actionError && /* @__PURE__ */ jsx("div", { className: "pollar-modal-action-error", children: actionError }),
1419
1456
  data && !data.exists && /* @__PURE__ */ jsxs("div", { className: "pollar-modal-empty", children: [
@@ -1472,7 +1509,7 @@ function CustomTrustlineModalTemplate({
1472
1509
  children: [
1473
1510
  /* @__PURE__ */ jsxs("div", { className: "pollar-modal-header", children: [
1474
1511
  /* @__PURE__ */ jsxs("div", { className: "pollar-modal-header-actions", children: [
1475
- /* @__PURE__ */ jsx("button", { className: "pollar-modal-back", onClick: onBack, disabled: busy, "aria-label": "Back", children: /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "M10 3L5 8l5 5", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }) }),
1512
+ /* @__PURE__ */ jsx("button", { className: "pollar-modal-close", onClick: onBack, disabled: busy, "aria-label": "Back", children: /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "M10 3L5 8l5 5", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }) }),
1476
1513
  /* @__PURE__ */ jsx("h2", { className: "pollar-modal-title", children: "Add custom trustline" })
1477
1514
  ] }),
1478
1515
  /* @__PURE__ */ jsx("button", { className: "pollar-modal-close", onClick: onClose, "aria-label": "Close", children: /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "M2 2l12 12M14 2L2 14", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) }) })
@@ -1533,7 +1570,10 @@ function CustomTrustlineModalTemplate({
1533
1570
  )
1534
1571
  ] }),
1535
1572
  actionError && /* @__PURE__ */ jsx("div", { className: "pollar-modal-action-error", children: actionError }),
1536
- /* @__PURE__ */ jsx("button", { className: "pollar-asset-submit", onClick: submit, disabled: !canSubmit, children: busy ? "Enabling\u2026" : "Enable trustline" }),
1573
+ /* @__PURE__ */ jsx("div", { className: "pollar-modal-actions", children: /* @__PURE__ */ jsx("button", { type: "button", className: "pollar-btn-primary", onClick: submit, disabled: !canSubmit, children: busy ? /* @__PURE__ */ jsxs(Fragment, { children: [
1574
+ /* @__PURE__ */ jsx("span", { className: "pollar-spinner pollar-spinner-sm" }),
1575
+ "Enabling\u2026"
1576
+ ] }) : "Enable trustline" }) }),
1537
1577
  /* @__PURE__ */ jsx(PollarModalFooter, {})
1538
1578
  ]
1539
1579
  }
@@ -1654,6 +1694,7 @@ function KycModalTemplate({
1654
1694
  isLoading,
1655
1695
  onSelectProvider,
1656
1696
  onDoneVerifying,
1697
+ onRefresh,
1657
1698
  onClose
1658
1699
  }) {
1659
1700
  const isDark = theme === "dark";
@@ -1678,16 +1719,56 @@ function KycModalTemplate({
1678
1719
  "--pollar-modal-subtitle-size": "0.9rem"
1679
1720
  };
1680
1721
  return /* @__PURE__ */ jsxs("div", { className: "pollar-modal-card pollar-kyc-modal", style: cssVars, onClick: (e) => e.stopPropagation(), children: [
1681
- /* @__PURE__ */ jsxs("div", { className: "pollar-kyc-header", children: [
1682
- /* @__PURE__ */ jsx("h2", { className: "pollar-kyc-title", children: "Identity verification" }),
1683
- /* @__PURE__ */ jsxs("p", { className: "pollar-kyc-subtitle", children: [
1684
- step === "select_provider" && "Choose your verification provider",
1685
- step === "verifying" && `Verifying with ${selectedProvider?.name}`,
1686
- step === "polling" && "Waiting for verification result",
1687
- step === "done" && "Verification complete"
1722
+ /* @__PURE__ */ jsxs("div", { className: "pollar-modal-header", children: [
1723
+ /* @__PURE__ */ jsxs("div", { className: "pollar-kyc-header-text", children: [
1724
+ /* @__PURE__ */ jsx("h2", { className: "pollar-modal-title", children: "Identity verification" }),
1725
+ /* @__PURE__ */ jsxs("p", { className: "pollar-kyc-subtitle", children: [
1726
+ step === "select_provider" && "Choose your verification provider",
1727
+ step === "verifying" && `Verifying with ${selectedProvider?.name}`,
1728
+ step === "polling" && "Waiting for verification result",
1729
+ step === "done" && "Verification complete"
1730
+ ] })
1731
+ ] }),
1732
+ /* @__PURE__ */ jsxs("div", { className: "pollar-modal-header-actions", children: [
1733
+ step === "select_provider" && /* @__PURE__ */ jsx(
1734
+ "button",
1735
+ {
1736
+ type: "button",
1737
+ className: "pollar-modal-close",
1738
+ onClick: onRefresh,
1739
+ disabled: isLoading,
1740
+ "aria-label": "Refresh",
1741
+ title: "Refresh providers",
1742
+ children: /* @__PURE__ */ jsx(
1743
+ "svg",
1744
+ {
1745
+ className: isLoading ? "pollar-modal-refresh-icon pollar-spinning" : "pollar-modal-refresh-icon",
1746
+ width: "16",
1747
+ height: "16",
1748
+ viewBox: "0 0 16 16",
1749
+ fill: "none",
1750
+ "aria-hidden": true,
1751
+ children: /* @__PURE__ */ jsx(
1752
+ "path",
1753
+ {
1754
+ d: "M13.5 8a5.5 5.5 0 1 1-1.6-3.9M13.5 2v3h-3",
1755
+ stroke: "currentColor",
1756
+ strokeWidth: "1.6",
1757
+ strokeLinecap: "round",
1758
+ strokeLinejoin: "round"
1759
+ }
1760
+ )
1761
+ }
1762
+ )
1763
+ }
1764
+ ),
1765
+ /* @__PURE__ */ jsx("button", { type: "button", className: "pollar-modal-close", onClick: onClose, "aria-label": "Close", children: /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "M2 2l12 12M14 2L2 14", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) }) })
1688
1766
  ] })
1689
1767
  ] }),
1690
- step === "select_provider" && /* @__PURE__ */ jsxs("div", { className: "pollar-kyc-providers", children: [
1768
+ step === "select_provider" && (isLoading && providers.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "pollar-loading-block", children: [
1769
+ /* @__PURE__ */ jsx("div", { className: "pollar-spinner" }),
1770
+ /* @__PURE__ */ jsx("span", { children: "Loading providers\u2026" })
1771
+ ] }) : /* @__PURE__ */ jsxs("div", { className: "pollar-kyc-providers", children: [
1691
1772
  providers.length === 0 && /* @__PURE__ */ jsx("p", { style: { color: "var(--pollar-muted)", textAlign: "center" }, children: "No providers available for your country." }),
1692
1773
  providers.map((p) => /* @__PURE__ */ jsxs(
1693
1774
  "button",
@@ -1703,7 +1784,7 @@ function KycModalTemplate({
1703
1784
  },
1704
1785
  p.id
1705
1786
  ))
1706
- ] }),
1787
+ ] })),
1707
1788
  step === "verifying" && selectedProvider && /* @__PURE__ */ jsxs(Fragment, { children: [
1708
1789
  /* @__PURE__ */ jsx("div", { className: "pollar-kyc-iframe-wrap", children: session?.kycUrl ? /* @__PURE__ */ jsx("iframe", { className: "pollar-kyc-iframe", src: session.kycUrl, title: "KYC verification", allow: "camera; microphone" }) : /* @__PURE__ */ jsxs("div", { className: "pollar-kyc-iframe-mock", children: [
1709
1790
  /* @__PURE__ */ jsx("span", { children: "\u{1F512}" }),
@@ -1736,10 +1817,13 @@ function KycModal({ onClose, country = "MX", level = "basic", onApproved }) {
1736
1817
  const [isLoading, setIsLoading] = useState(false);
1737
1818
  const client = getClient();
1738
1819
  const { theme = "light", accentColor = "#005DB4" } = styles;
1739
- useEffect(() => {
1820
+ const loadProviders = useCallback(() => {
1740
1821
  setIsLoading(true);
1741
- getClient().getKycProviders(country).then((result) => setProviders(result.providers)).catch(() => setProviders([])).finally(() => setIsLoading(false));
1822
+ return getClient().getKycProviders(country).then((result) => setProviders(result.providers)).catch(() => setProviders([])).finally(() => setIsLoading(false));
1742
1823
  }, [getClient, country]);
1824
+ useEffect(() => {
1825
+ void loadProviders();
1826
+ }, [loadProviders]);
1743
1827
  async function handleSelectProvider(provider) {
1744
1828
  setSelectedProvider(provider);
1745
1829
  setIsLoading(true);
@@ -1785,6 +1869,7 @@ function KycModal({ onClose, country = "MX", level = "basic", onApproved }) {
1785
1869
  isLoading,
1786
1870
  onSelectProvider: handleSelectProvider,
1787
1871
  onDoneVerifying: handleDoneVerifying,
1872
+ onRefresh: () => void loadProviders(),
1788
1873
  onClose
1789
1874
  }
1790
1875
  ) });
@@ -1840,8 +1925,8 @@ function EmailCodeInput({ email, onSubmit }) {
1840
1925
  ] });
1841
1926
  }
1842
1927
  var GithubButton = ({ disabled, onClick }) => {
1843
- return /* @__PURE__ */ jsxs("button", { className: "github-button", disabled, onClick, children: [
1844
- /* @__PURE__ */ jsx("svg", { className: "github-button-icon", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": true, children: /* @__PURE__ */ jsx(
1928
+ return /* @__PURE__ */ jsxs("button", { className: "pollar-github-button", disabled, onClick, children: [
1929
+ /* @__PURE__ */ jsx("svg", { className: "pollar-github-button-icon", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": true, children: /* @__PURE__ */ jsx(
1845
1930
  "path",
1846
1931
  {
1847
1932
  fillRule: "evenodd",
@@ -1849,14 +1934,14 @@ var GithubButton = ({ disabled, onClick }) => {
1849
1934
  clipRule: "evenodd"
1850
1935
  }
1851
1936
  ) }),
1852
- /* @__PURE__ */ jsx("span", { className: "github-button-contents", children: "GitHub" })
1937
+ /* @__PURE__ */ jsx("span", { className: "pollar-github-button-contents", children: "GitHub" })
1853
1938
  ] });
1854
1939
  };
1855
1940
  var GoogleButton = ({ disabled, onClick }) => {
1856
- return /* @__PURE__ */ jsxs("button", { className: "gsi-material-button", disabled, onClick, children: [
1857
- /* @__PURE__ */ jsx("div", { className: "gsi-material-button-state" }),
1858
- /* @__PURE__ */ jsxs("div", { className: "gsi-material-button-content-wrapper", children: [
1859
- /* @__PURE__ */ jsx("div", { className: "gsi-material-button-icon", children: /* @__PURE__ */ jsxs("svg", { version: "1.1", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 48 48", style: { display: "block" }, children: [
1941
+ return /* @__PURE__ */ jsxs("button", { className: "pollar-gsi-material-button", disabled, onClick, children: [
1942
+ /* @__PURE__ */ jsx("div", { className: "pollar-gsi-material-button-state" }),
1943
+ /* @__PURE__ */ jsxs("div", { className: "pollar-gsi-material-button-content-wrapper", children: [
1944
+ /* @__PURE__ */ jsx("div", { className: "pollar-gsi-material-button-icon", children: /* @__PURE__ */ jsxs("svg", { version: "1.1", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 48 48", style: { display: "block" }, children: [
1860
1945
  /* @__PURE__ */ jsx(
1861
1946
  "path",
1862
1947
  {
@@ -1887,7 +1972,7 @@ var GoogleButton = ({ disabled, onClick }) => {
1887
1972
  ),
1888
1973
  /* @__PURE__ */ jsx("path", { fill: "none", d: "M0 0h48v48H0z" })
1889
1974
  ] }) }),
1890
- /* @__PURE__ */ jsx("span", { className: "gsi-material-button-contents", children: "Google" }),
1975
+ /* @__PURE__ */ jsx("span", { className: "pollar-gsi-material-button-contents", children: "Google" }),
1891
1976
  /* @__PURE__ */ jsx("span", { style: { display: "none" }, children: "Google" })
1892
1977
  ] })
1893
1978
  ] });
@@ -2093,7 +2178,7 @@ function LoginModalTemplate({
2093
2178
  placeholder: "you@email.com",
2094
2179
  value: email,
2095
2180
  disabled: isLoading,
2096
- className: "pollar-email-input",
2181
+ className: "pollar-input",
2097
2182
  onChange: (e) => onEmailChange?.(e.target.value),
2098
2183
  onKeyDown: (e) => e.key === "Enter" && onEmailSubmit?.()
2099
2184
  }
@@ -2322,7 +2407,7 @@ function PrivyLoginSubmodal({
2322
2407
  placeholder: "you@email.com",
2323
2408
  value: email,
2324
2409
  disabled: isLoading,
2325
- className: "pollar-email-input",
2410
+ className: "pollar-input",
2326
2411
  onChange: (e) => setEmail(e.target.value),
2327
2412
  onKeyDown: (e) => e.key === "Enter" && handleEmailSubmit()
2328
2413
  }
@@ -2572,7 +2657,7 @@ function flattenInstructions(instr) {
2572
2657
  }
2573
2658
  continue;
2574
2659
  }
2575
- let value = "";
2660
+ let value;
2576
2661
  if (typeof v === "string" || typeof v === "number") value = String(v);
2577
2662
  else if (Array.isArray(v)) value = v.filter((x) => typeof x === "string" || typeof x === "number").join(", ");
2578
2663
  else continue;
@@ -2667,7 +2752,7 @@ function RampWidgetTemplate({
2667
2752
  /* @__PURE__ */ jsx("button", { type: "button", className: "pollar-modal-close", onClick: onRefresh, disabled: refreshing, "aria-label": "Refresh", children: /* @__PURE__ */ jsx(
2668
2753
  "svg",
2669
2754
  {
2670
- className: refreshing ? "pollar-modal-refresh-icon spinning" : "pollar-modal-refresh-icon",
2755
+ className: refreshing ? "pollar-modal-refresh-icon pollar-spinning" : "pollar-modal-refresh-icon",
2671
2756
  width: "16",
2672
2757
  height: "16",
2673
2758
  viewBox: "0 0 16 16",
@@ -2689,12 +2774,12 @@ function RampWidgetTemplate({
2689
2774
  ] })
2690
2775
  ] }),
2691
2776
  step === "input" && /* @__PURE__ */ jsxs(Fragment, { children: [
2692
- /* @__PURE__ */ jsxs("div", { className: "pollar-ramp-tabs", children: [
2777
+ /* @__PURE__ */ jsxs("div", { className: "pollar-tabs", children: [
2693
2778
  /* @__PURE__ */ jsx(
2694
2779
  "button",
2695
2780
  {
2696
2781
  type: "button",
2697
- className: "pollar-ramp-tab",
2782
+ className: "pollar-tab",
2698
2783
  "data-active": direction === "onramp",
2699
2784
  onClick: () => onDirectionChange("onramp"),
2700
2785
  children: "Buy"
@@ -2704,7 +2789,7 @@ function RampWidgetTemplate({
2704
2789
  "button",
2705
2790
  {
2706
2791
  type: "button",
2707
- className: "pollar-ramp-tab",
2792
+ className: "pollar-tab",
2708
2793
  "data-active": direction === "offramp",
2709
2794
  onClick: () => onDirectionChange("offramp"),
2710
2795
  children: "Sell"
@@ -2713,7 +2798,10 @@ function RampWidgetTemplate({
2713
2798
  ] }),
2714
2799
  /* @__PURE__ */ jsxs("div", { className: "pollar-ramp-field", children: [
2715
2800
  /* @__PURE__ */ jsx("label", { className: "pollar-ramp-label", children: "Country" }),
2716
- countriesLoading ? /* @__PURE__ */ jsx("div", { className: "pollar-ramp-input pollar-ramp-input-loading", children: "Loading countries\u2026" }) : countries.length === 0 ? /* @__PURE__ */ jsx("div", { className: "pollar-modal-error", children: "No ramp providers available on this network yet." }) : /* @__PURE__ */ jsx("select", { className: "pollar-ramp-input", value: country, onChange: (e) => onCountryChange(e.target.value), children: countries.map((c) => /* @__PURE__ */ jsxs("option", { value: c.code, children: [
2801
+ countriesLoading ? /* @__PURE__ */ jsxs("div", { className: "pollar-ramp-input pollar-select-loading", children: [
2802
+ /* @__PURE__ */ jsx("span", { className: "pollar-spinner pollar-spinner-sm" }),
2803
+ /* @__PURE__ */ jsx("span", { children: "Loading countries\u2026" })
2804
+ ] }) : countries.length === 0 ? /* @__PURE__ */ jsx("div", { className: "pollar-modal-error", children: "No ramp providers available on this network yet." }) : /* @__PURE__ */ jsx("select", { className: "pollar-ramp-input", value: country, onChange: (e) => onCountryChange(e.target.value), children: countries.map((c) => /* @__PURE__ */ jsxs("option", { value: c.code, children: [
2717
2805
  flagEmoji(c.code),
2718
2806
  " ",
2719
2807
  c.code,
@@ -2751,10 +2839,13 @@ function RampWidgetTemplate({
2751
2839
  )
2752
2840
  ] })
2753
2841
  ] }),
2754
- step === "loading_quote" && /* @__PURE__ */ jsx("div", { className: "pollar-ramp-loading", children: LOADING_STEPS.map((text, i) => /* @__PURE__ */ jsxs("div", { className: "pollar-ramp-loading-row", children: [
2755
- /* @__PURE__ */ jsx("div", { className: "pollar-ramp-loading-dot" }),
2756
- /* @__PURE__ */ jsx("span", { children: text })
2757
- ] }, i)) }),
2842
+ step === "loading_quote" && /* @__PURE__ */ jsxs("div", { className: "pollar-ramp-loading", children: [
2843
+ /* @__PURE__ */ jsx("div", { className: "pollar-spinner pollar-ramp-loading-spinner" }),
2844
+ LOADING_STEPS.map((text, i) => /* @__PURE__ */ jsxs("div", { className: "pollar-ramp-loading-row", children: [
2845
+ /* @__PURE__ */ jsx("div", { className: "pollar-ramp-loading-dot" }),
2846
+ /* @__PURE__ */ jsx("span", { children: text })
2847
+ ] }, i))
2848
+ ] }),
2758
2849
  step === "select_route" && /* @__PURE__ */ jsxs(Fragment, { children: [
2759
2850
  /* @__PURE__ */ jsx("div", { className: "pollar-ramp-route-list", children: quotes.map((q, i) => /* @__PURE__ */ jsx(RouteDisplay, { quote: q, onSelect: onSelectQuote }, i)) }),
2760
2851
  /* @__PURE__ */ jsx("button", { type: "button", className: "pollar-btn-secondary", onClick: onClose, children: "Cancel" })
@@ -2794,7 +2885,10 @@ function RampWidgetTemplate({
2794
2885
  className: "pollar-btn-primary",
2795
2886
  disabled: requiredFields.some((f) => !isFieldValid(f, fieldValues[f.key])) || isLoading,
2796
2887
  onClick: onContactContinue,
2797
- children: isLoading ? "Starting\u2026" : "Continue"
2888
+ children: isLoading ? /* @__PURE__ */ jsxs(Fragment, { children: [
2889
+ /* @__PURE__ */ jsx("span", { className: "pollar-spinner pollar-spinner-sm" }),
2890
+ "Starting\u2026"
2891
+ ] }) : "Continue"
2798
2892
  }
2799
2893
  )
2800
2894
  ] })
@@ -2806,7 +2900,10 @@ function RampWidgetTemplate({
2806
2900
  ] }),
2807
2901
  /* @__PURE__ */ jsxs("div", { className: "pollar-ramp-payment-field", children: [
2808
2902
  /* @__PURE__ */ jsx("span", { className: "pollar-ramp-payment-label", children: "Status" }),
2809
- /* @__PURE__ */ jsx("div", { className: "pollar-ramp-payment-value", children: /* @__PURE__ */ jsx("code", { style: { color: txStatus === "completed" ? "var(--pollar-success-text)" : void 0 }, children: txStatus ? STATUS_LABEL[txStatus] : "Processing" }) })
2903
+ /* @__PURE__ */ jsxs("div", { className: "pollar-ramp-payment-value", children: [
2904
+ /* @__PURE__ */ jsx("code", { style: { color: txStatus === "completed" ? "var(--pollar-success-text)" : void 0 }, children: txStatus ? STATUS_LABEL[txStatus] : "Processing" }),
2905
+ txStatus !== "completed" && txStatus !== "failed" && /* @__PURE__ */ jsx("span", { className: "pollar-spinner pollar-spinner-sm", "aria-label": "Checking status" })
2906
+ ] })
2810
2907
  ] }),
2811
2908
  stellarTxHash && /* @__PURE__ */ jsxs("div", { className: "pollar-ramp-payment-field", children: [
2812
2909
  /* @__PURE__ */ jsx("span", { className: "pollar-ramp-payment-label", children: "Stellar tx" }),
@@ -2827,8 +2924,26 @@ function RampWidgetTemplate({
2827
2924
  "aria-label": "View on Stellar Expert",
2828
2925
  title: "View on Stellar Expert",
2829
2926
  children: /* @__PURE__ */ jsxs("svg", { width: "13", height: "13", viewBox: "0 0 14 14", fill: "none", "aria-hidden": true, children: [
2830
- /* @__PURE__ */ jsx("path", { d: "M6 3H3v8h8V8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }),
2831
- /* @__PURE__ */ jsx("path", { d: "M8.5 2.5h3v3M11 3L6.5 7.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
2927
+ /* @__PURE__ */ jsx(
2928
+ "path",
2929
+ {
2930
+ d: "M6 3H3v8h8V8",
2931
+ stroke: "currentColor",
2932
+ strokeWidth: "1.5",
2933
+ strokeLinecap: "round",
2934
+ strokeLinejoin: "round"
2935
+ }
2936
+ ),
2937
+ /* @__PURE__ */ jsx(
2938
+ "path",
2939
+ {
2940
+ d: "M8.5 2.5h3v3M11 3L6.5 7.5",
2941
+ stroke: "currentColor",
2942
+ strokeWidth: "1.5",
2943
+ strokeLinecap: "round",
2944
+ strokeLinejoin: "round"
2945
+ }
2946
+ )
2832
2947
  ] })
2833
2948
  }
2834
2949
  )
@@ -2856,7 +2971,10 @@ function RampWidgetTemplate({
2856
2971
  "Continue at ",
2857
2972
  provider
2858
2973
  ] }),
2859
- canComplete && /* @__PURE__ */ jsx("button", { type: "button", className: "pollar-btn-primary", disabled: completing, onClick: onCompleteWithdraw, children: completing ? "Submitting\u2026" : "I've completed KYC \u2014 withdraw" }),
2974
+ canComplete && /* @__PURE__ */ jsx("button", { type: "button", className: "pollar-btn-primary", disabled: completing, onClick: onCompleteWithdraw, children: completing ? /* @__PURE__ */ jsxs(Fragment, { children: [
2975
+ /* @__PURE__ */ jsx("span", { className: "pollar-spinner pollar-spinner-sm" }),
2976
+ "Submitting\u2026"
2977
+ ] }) : "I've completed KYC \u2014 withdraw" }),
2860
2978
  errorMsg && /* @__PURE__ */ jsx("p", { className: "pollar-ramp-payment-note", style: { color: "var(--pollar-error-text)" }, children: errorMsg }),
2861
2979
  /* @__PURE__ */ jsx("button", { type: "button", className: "pollar-btn-secondary", onClick: onClose, children: txStatus === "completed" ? "Done" : "Close" })
2862
2980
  ] }),
@@ -3309,6 +3427,7 @@ function AssetSelect({
3309
3427
  options,
3310
3428
  onChange,
3311
3429
  loading = false,
3430
+ loadingLabel,
3312
3431
  disabled = false,
3313
3432
  appGroupLabel = "App assets",
3314
3433
  otherGroupLabel = "Other assets",
@@ -3318,7 +3437,10 @@ function AssetSelect({
3318
3437
  const otherAssets = options.filter((o) => !o.enabledInApp);
3319
3438
  return /* @__PURE__ */ jsxs("div", { className: "pollar-send-field", children: [
3320
3439
  /* @__PURE__ */ jsx("label", { className: "pollar-send-label", children: label }),
3321
- loading ? /* @__PURE__ */ jsx("div", { className: "pollar-send-skeleton" }) : /* @__PURE__ */ jsxs(
3440
+ loading ? loadingLabel ? /* @__PURE__ */ jsxs("div", { className: "pollar-input pollar-select-loading", children: [
3441
+ /* @__PURE__ */ jsx("span", { className: "pollar-spinner pollar-spinner-sm" }),
3442
+ /* @__PURE__ */ jsx("span", { children: loadingLabel })
3443
+ ] }) : /* @__PURE__ */ jsx("div", { className: "pollar-send-skeleton" }) : /* @__PURE__ */ jsxs(
3322
3444
  "select",
3323
3445
  {
3324
3446
  className: "pollar-input pollar-send-select",
@@ -3559,6 +3681,7 @@ function SendModalTemplate({
3559
3681
  isInProgress,
3560
3682
  onClose,
3561
3683
  onBack,
3684
+ onRefresh,
3562
3685
  onSelectAsset,
3563
3686
  onAmountChange,
3564
3687
  onDestinationChange,
@@ -3603,7 +3726,41 @@ function SendModalTemplate({
3603
3726
  showBack && /* @__PURE__ */ jsx("button", { type: "button", className: "pollar-modal-close", onClick: onBack, "aria-label": "Back", children: /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "M10 3L5 8l5 5", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }) }),
3604
3727
  /* @__PURE__ */ jsx("h2", { className: "pollar-modal-title", children: title })
3605
3728
  ] }),
3606
- !isInProgress && /* @__PURE__ */ jsx("div", { className: "pollar-modal-header-actions", children: /* @__PURE__ */ jsx("button", { type: "button", className: "pollar-modal-close", onClick: onClose, "aria-label": "Close", children: /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "M2 2l12 12M14 2L2 14", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) }) }) })
3729
+ !isInProgress && /* @__PURE__ */ jsxs("div", { className: "pollar-modal-header-actions", children: [
3730
+ step === "form" && /* @__PURE__ */ jsx(
3731
+ "button",
3732
+ {
3733
+ type: "button",
3734
+ className: "pollar-modal-close",
3735
+ onClick: onRefresh,
3736
+ disabled: isLoadingBalance,
3737
+ "aria-label": "Refresh",
3738
+ title: "Refresh balances",
3739
+ children: /* @__PURE__ */ jsx(
3740
+ "svg",
3741
+ {
3742
+ className: isLoadingBalance ? "pollar-modal-refresh-icon pollar-spinning" : "pollar-modal-refresh-icon",
3743
+ width: "16",
3744
+ height: "16",
3745
+ viewBox: "0 0 16 16",
3746
+ fill: "none",
3747
+ "aria-hidden": true,
3748
+ children: /* @__PURE__ */ jsx(
3749
+ "path",
3750
+ {
3751
+ d: "M13.5 8a5.5 5.5 0 1 1-1.6-3.9M13.5 2v3h-3",
3752
+ stroke: "currentColor",
3753
+ strokeWidth: "1.6",
3754
+ strokeLinecap: "round",
3755
+ strokeLinejoin: "round"
3756
+ }
3757
+ )
3758
+ }
3759
+ )
3760
+ }
3761
+ ),
3762
+ /* @__PURE__ */ jsx("button", { type: "button", className: "pollar-modal-close", onClick: onClose, "aria-label": "Close", children: /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "M2 2l12 12M14 2L2 14", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) }) })
3763
+ ] })
3607
3764
  ] }),
3608
3765
  step === "form" && /* @__PURE__ */ jsxs(Fragment, { children: [
3609
3766
  /* @__PURE__ */ jsx(
@@ -3612,6 +3769,7 @@ function SendModalTemplate({
3612
3769
  label: "Asset",
3613
3770
  value: selectedKey,
3614
3771
  loading: isLoadingBalance,
3772
+ loadingLabel: "Loading assets\u2026",
3615
3773
  options: assets.map((a) => ({
3616
3774
  key: assetKey3(a),
3617
3775
  code: a.code,
@@ -3813,6 +3971,7 @@ function SendModal({ onClose }) {
3813
3971
  isInProgress,
3814
3972
  onClose,
3815
3973
  onBack: handleBack,
3974
+ onRefresh: () => void refreshWalletBalance(),
3816
3975
  onSelectAsset: setSelectedAsset,
3817
3976
  onAmountChange: setAmount,
3818
3977
  onDestinationChange: setDestination,
@@ -3955,7 +4114,6 @@ function SwapModalTemplate({
3955
4114
  /* @__PURE__ */ jsx("button", { type: "button", className: "pollar-modal-close", onClick: onClose, "aria-label": "Close", children: /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "M2 2l12 12M14 2L2 14", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) }) })
3956
4115
  ] })
3957
4116
  ] }),
3958
- step === "form" && configLoading && /* @__PURE__ */ jsx("div", { className: "pollar-send-hint", children: "Loading swap options\u2026" }),
3959
4117
  step === "form" && !configLoading && swapUnavailable && /* @__PURE__ */ jsx("div", { className: "pollar-modal-error", children: "Swap is not available for this app." }),
3960
4118
  step === "form" && !swapUnavailable && /* @__PURE__ */ jsxs(Fragment, { children: [
3961
4119
  smartUnsupported && /* @__PURE__ */ jsx("div", { className: "pollar-modal-error", children: "Swaps are not yet available for smart (passkey) wallets." }),
@@ -3964,7 +4122,8 @@ function SwapModalTemplate({
3964
4122
  {
3965
4123
  label: "You pay",
3966
4124
  value: sellKey,
3967
- loading: isLoadingData,
4125
+ loading: isLoadingData || configLoading,
4126
+ loadingLabel: "Loading assets\u2026",
3968
4127
  disabled: configLoading,
3969
4128
  options: sellOptions.map((o) => ({
3970
4129
  key: assetOptionKey(o),
@@ -4006,7 +4165,8 @@ function SwapModalTemplate({
4006
4165
  {
4007
4166
  label: "You receive",
4008
4167
  value: buyKey,
4009
- loading: isLoadingData,
4168
+ loading: isLoadingData || configLoading,
4169
+ loadingLabel: "Loading assets\u2026",
4010
4170
  disabled: configLoading,
4011
4171
  options: buyOptions.map((o) => ({
4012
4172
  key: assetOptionKey(o),
@@ -4068,18 +4228,24 @@ function SwapModalTemplate({
4068
4228
  ),
4069
4229
  /* @__PURE__ */ jsxs("div", { className: "pollar-send-field", children: [
4070
4230
  /* @__PURE__ */ jsx("label", { className: "pollar-send-label", children: "Route" }),
4071
- /* @__PURE__ */ jsx(
4231
+ configLoading ? /* @__PURE__ */ jsxs("div", { className: "pollar-input pollar-select-loading", children: [
4232
+ /* @__PURE__ */ jsx("span", { className: "pollar-spinner pollar-spinner-sm" }),
4233
+ /* @__PURE__ */ jsx("span", { children: "Loading routes\u2026" })
4234
+ ] }) : /* @__PURE__ */ jsx(
4072
4235
  "select",
4073
4236
  {
4074
4237
  className: "pollar-input pollar-send-select",
4075
4238
  value: provider,
4076
- disabled: configLoading || providers.length === 0,
4239
+ disabled: providers.length === 0,
4077
4240
  onChange: (e) => onProviderChange(e.target.value),
4078
- children: providers.length === 0 ? /* @__PURE__ */ jsx("option", { value: provider, children: configLoading ? "Loading\u2026" : PROVIDER_LABELS[provider] }) : providers.map((p) => /* @__PURE__ */ jsx("option", { value: p, children: PROVIDER_LABELS[p] }, p))
4241
+ children: providers.length === 0 ? /* @__PURE__ */ jsx("option", { value: provider, children: PROVIDER_LABELS[provider] }) : providers.map((p) => /* @__PURE__ */ jsx("option", { value: p, children: PROVIDER_LABELS[p] }, p))
4079
4242
  }
4080
4243
  )
4081
4244
  ] }),
4082
- quoteLoading && /* @__PURE__ */ jsx("div", { className: "pollar-send-hint", children: "Fetching best price\u2026" }),
4245
+ quoteLoading && /* @__PURE__ */ jsxs("div", { className: "pollar-send-hint pollar-inline-loading", children: [
4246
+ /* @__PURE__ */ jsx("span", { className: "pollar-spinner pollar-spinner-sm" }),
4247
+ "Fetching best price\u2026"
4248
+ ] }),
4083
4249
  !quoteLoading && quoteError && /* @__PURE__ */ jsx("div", { className: "pollar-modal-error", children: quoteError }),
4084
4250
  !quoteLoading && !quoteError && quote && selectedBuy && /* @__PURE__ */ jsxs("div", { className: "pollar-swap-quote", children: [
4085
4251
  /* @__PURE__ */ jsxs("div", { className: "pollar-swap-quote-row", children: [
@@ -4413,7 +4579,14 @@ var PROVIDER_LABELS2 = {
4413
4579
  blend: "Blend",
4414
4580
  defindex: "DeFindex"
4415
4581
  };
4416
- var IN_FLIGHT_STEPS2 = ["building", "signing", "submitting", "submitted", "signing-submitting", "building-signing-submitting"];
4582
+ var IN_FLIGHT_STEPS2 = [
4583
+ "building",
4584
+ "signing",
4585
+ "submitting",
4586
+ "submitted",
4587
+ "signing-submitting",
4588
+ "building-signing-submitting"
4589
+ ];
4417
4590
  function formatAmount4(value) {
4418
4591
  const n = parseFloat(value);
4419
4592
  return isNaN(n) ? value : n.toLocaleString(void 0, { maximumFractionDigits: 7 });
@@ -4427,6 +4600,11 @@ function EarnModal({ onClose }) {
4427
4600
  earnWithdraw,
4428
4601
  tx: transaction,
4429
4602
  wallet,
4603
+ walletBalance,
4604
+ refreshWalletBalance,
4605
+ enabledAssets,
4606
+ refreshAssets,
4607
+ setTrustline,
4430
4608
  network,
4431
4609
  styles
4432
4610
  } = usePollar();
@@ -4444,6 +4622,7 @@ function EarnModal({ onClose }) {
4444
4622
  const [amount, setAmount] = useState("");
4445
4623
  const [loadingOpps, setLoadingOpps] = useState(false);
4446
4624
  const [formError, setFormError] = useState("");
4625
+ const [refreshing, setRefreshing] = useState(false);
4447
4626
  const [showXdr, setShowXdr] = useState(false);
4448
4627
  const [copied, setCopied] = useState(false);
4449
4628
  const copyTimerRef = useRef(null);
@@ -4457,6 +4636,10 @@ function EarnModal({ onClose }) {
4457
4636
  useEffect(() => {
4458
4637
  void loadProviders();
4459
4638
  }, [loadProviders]);
4639
+ useEffect(() => {
4640
+ void refreshWalletBalance();
4641
+ void refreshAssets();
4642
+ }, [refreshWalletBalance, refreshAssets]);
4460
4643
  useEffect(() => {
4461
4644
  if (!provider) return;
4462
4645
  let cancelled = false;
@@ -4500,6 +4683,22 @@ function EarnModal({ onClose }) {
4500
4683
  const withdrawUnit = position?.withdrawUnit ?? "asset";
4501
4684
  const assetCode = selectedOpportunity?.asset.code ?? "";
4502
4685
  const amountUnitLabel = tab === "deposit" ? assetCode : withdrawUnit === "shares" ? "shares" : assetCode;
4686
+ const walletAvailable = (() => {
4687
+ if (!selectedOpportunity) return null;
4688
+ const balances = walletBalance.step === "loaded" ? walletBalance.data.balances : [];
4689
+ const issuer = selectedOpportunity.asset.issuer;
4690
+ const rec = balances.find(
4691
+ (b) => issuer === null ? b.type === "native" : b.code === assetCode && b.issuer === issuer
4692
+ );
4693
+ return rec ? rec.available : null;
4694
+ })();
4695
+ const depositAssetRecord = (() => {
4696
+ if (!selectedOpportunity?.asset.issuer || enabledAssets.step !== "loaded") return void 0;
4697
+ return enabledAssets.data.assets.find(
4698
+ (a) => a.code === assetCode && a.issuer === selectedOpportunity.asset.issuer
4699
+ );
4700
+ })();
4701
+ const depositNeedsTrustline = tab === "deposit" && !smartUnsupported && !!selectedOpportunity?.asset.issuer && !depositAssetRecord?.trustlineEstablished;
4503
4702
  const hash = transaction.step === "success" ? transaction.hash : null;
4504
4703
  const buildData = "buildData" in transaction ? transaction.buildData : null;
4505
4704
  const explorerNetwork = buildData?.summary.network?.toLowerCase().includes("testnet") ? "testnet" : buildData ? "public" : network === "testnet" ? "testnet" : "public";
@@ -4507,7 +4706,9 @@ function EarnModal({ onClose }) {
4507
4706
  const isInProgress = IN_FLIGHT_STEPS2.includes(transaction.step);
4508
4707
  const showBack = step === "tx" && (transaction.step === "error" || transaction.step === "success") && !isInProgress;
4509
4708
  const txTitle = isInProgress ? tab === "deposit" ? "Depositing\u2026" : "Withdrawing\u2026" : transaction.step === "success" ? "Done!" : transaction.step === "error" ? tab === "deposit" ? "Deposit failed" : "Withdraw failed" : "Confirm";
4510
- const canSubmit = !smartUnsupported && !!provider && !!opportunityId && !!amount && parseFloat(amount) > 0 && !providersLoading && !loadingOpps;
4709
+ const parsedAmount = parseFloat(amount);
4710
+ const exceedsAvailable = tab === "deposit" ? walletAvailable != null && parsedAmount > parseFloat(walletAvailable) : position != null && parsedAmount > parseFloat(position.withdrawable);
4711
+ const canSubmit = !smartUnsupported && !!provider && !!opportunityId && !!amount && parsedAmount > 0 && !exceedsAvailable && !providersLoading && !loadingOpps;
4511
4712
  const cssVars = {
4512
4713
  "--pollar-accent": accentColor,
4513
4714
  "--pollar-bg": isDark ? "#1a1a1a" : "#ffffff",
@@ -4540,11 +4741,27 @@ function EarnModal({ onClose }) {
4540
4741
  setFormError("Enter a valid amount");
4541
4742
  return;
4542
4743
  }
4744
+ if (tab === "deposit" && walletAvailable != null && parsed > parseFloat(walletAvailable)) {
4745
+ setFormError("Amount exceeds your wallet balance");
4746
+ return;
4747
+ }
4543
4748
  if (tab === "withdraw" && position && parsed > parseFloat(position.withdrawable)) {
4544
4749
  setFormError("Amount exceeds your position");
4545
4750
  return;
4546
4751
  }
4547
4752
  setStep("tx");
4753
+ if (tab === "deposit" && depositNeedsTrustline && selectedOpportunity?.asset.issuer) {
4754
+ const tl = await setTrustline(
4755
+ { code: assetCode, issuer: selectedOpportunity.asset.issuer },
4756
+ depositAssetRecord?.sponsored ? { sponsored: true } : void 0
4757
+ );
4758
+ if (tl.status === "error") {
4759
+ setFormError(`Trustline for ${assetCode} failed: ${tl.details ?? "unknown error"}`);
4760
+ setStep("form");
4761
+ return;
4762
+ }
4763
+ await refreshAssets();
4764
+ }
4548
4765
  const params = { provider, opportunity: opportunityId, amount };
4549
4766
  const outcome = tab === "deposit" ? await earnDeposit(params) : await earnWithdraw(params);
4550
4767
  if (outcome.status === "success" || outcome.status === "pending") {
@@ -4575,146 +4792,217 @@ function EarnModal({ onClose }) {
4575
4792
  setCopied(false);
4576
4793
  refreshPosition();
4577
4794
  }
4795
+ async function handleRefresh() {
4796
+ if (refreshing || !provider) return;
4797
+ setRefreshing(true);
4798
+ try {
4799
+ void refreshWalletBalance();
4800
+ const opps = await getEarnOpportunities(provider);
4801
+ setOpportunities(opps);
4802
+ setOpportunityId((cur) => opps.some((o) => o.id === cur) ? cur : opps[0]?.id ?? "");
4803
+ refreshPosition();
4804
+ } catch {
4805
+ } finally {
4806
+ setRefreshing(false);
4807
+ }
4808
+ }
4578
4809
  const title = step === "form" ? "Earn" : txTitle;
4579
- return /* @__PURE__ */ jsx("div", { className: "pollar-overlay", onClick: !isInProgress ? onClose : void 0, children: /* @__PURE__ */ jsxs("div", { className: "pollar-modal-card pollar-send-modal", "data-theme": theme, style: cssVars, onClick: (e) => e.stopPropagation(), children: [
4580
- /* @__PURE__ */ jsxs("div", { className: "pollar-modal-header", children: [
4581
- /* @__PURE__ */ jsxs("div", { className: "pollar-send-header-left", children: [
4582
- showBack && /* @__PURE__ */ jsx("button", { type: "button", className: "pollar-modal-close", onClick: handleBack, "aria-label": "Back", children: /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "M10 3L5 8l5 5", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }) }),
4583
- /* @__PURE__ */ jsx("h2", { className: "pollar-modal-title", children: title })
4584
- ] }),
4585
- !isInProgress && /* @__PURE__ */ jsx("button", { type: "button", className: "pollar-modal-close", onClick: onClose, "aria-label": "Close", children: /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "M2 2l12 12M14 2L2 14", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) }) })
4586
- ] }),
4587
- step === "form" && providersLoading && /* @__PURE__ */ jsx("div", { className: "pollar-send-hint", children: "Loading Earn options\u2026" }),
4588
- step === "form" && earnUnavailable && /* @__PURE__ */ jsx("div", { className: "pollar-modal-error", children: "Earn is not available for this app." }),
4589
- step === "form" && !earnUnavailable && /* @__PURE__ */ jsxs(Fragment, { children: [
4590
- smartUnsupported && /* @__PURE__ */ jsx("div", { className: "pollar-modal-error", children: "Earn is not yet available for smart (passkey) wallets." }),
4591
- /* @__PURE__ */ jsxs("div", { className: "pollar-earn-tabs", children: [
4592
- /* @__PURE__ */ jsx(
4593
- "button",
4594
- {
4595
- type: "button",
4596
- className: `pollar-earn-tab${tab === "deposit" ? " pollar-earn-tab-active" : ""}`,
4597
- onClick: () => {
4598
- setTab("deposit");
4599
- setFormError("");
4600
- },
4601
- children: "Deposit"
4602
- }
4603
- ),
4604
- /* @__PURE__ */ jsx(
4605
- "button",
4606
- {
4607
- type: "button",
4608
- className: `pollar-earn-tab${tab === "withdraw" ? " pollar-earn-tab-active" : ""}`,
4609
- onClick: () => {
4610
- setTab("withdraw");
4611
- setFormError("");
4612
- },
4613
- children: "Withdraw"
4614
- }
4615
- )
4616
- ] }),
4617
- providers && providers.length > 1 && /* @__PURE__ */ jsxs("div", { className: "pollar-send-field", children: [
4618
- /* @__PURE__ */ jsx("label", { className: "pollar-send-label", children: "Provider" }),
4619
- /* @__PURE__ */ jsx(
4620
- "select",
4621
- {
4622
- className: "pollar-input pollar-send-select",
4623
- value: provider ?? "",
4624
- onChange: (e) => setProvider(e.target.value),
4625
- children: providers.map((p) => /* @__PURE__ */ jsx("option", { value: p, children: PROVIDER_LABELS2[p] }, p))
4626
- }
4627
- )
4628
- ] }),
4629
- /* @__PURE__ */ jsxs("div", { className: "pollar-send-field", children: [
4630
- /* @__PURE__ */ jsx("label", { className: "pollar-send-label", children: provider === "defindex" ? "Vault" : "Pool" }),
4631
- /* @__PURE__ */ jsx(
4632
- "select",
4633
- {
4634
- className: "pollar-input pollar-send-select",
4635
- value: opportunityId,
4636
- disabled: loadingOpps || opportunities.length === 0,
4637
- onChange: (e) => setOpportunityId(e.target.value),
4638
- children: opportunities.length === 0 ? /* @__PURE__ */ jsx("option", { value: "", children: loadingOpps ? "Loading\u2026" : "None available" }) : opportunities.map((o) => /* @__PURE__ */ jsxs("option", { value: o.id, children: [
4639
- o.name,
4640
- " \xB7 ",
4641
- o.apy.toFixed(2),
4642
- "% APY"
4643
- ] }, o.id))
4644
- }
4645
- )
4646
- ] }),
4647
- selectedOpportunity && /* @__PURE__ */ jsxs("div", { className: "pollar-swap-quote", children: [
4648
- /* @__PURE__ */ jsxs("div", { className: "pollar-swap-quote-row", children: [
4649
- /* @__PURE__ */ jsx("span", { className: "pollar-send-hint", children: "Your position" }),
4650
- /* @__PURE__ */ jsxs("span", { children: [
4651
- position ? formatAmount4(position.balance) : "\u2026",
4652
- " ",
4653
- assetCode
4810
+ return /* @__PURE__ */ jsx("div", { className: "pollar-overlay", onClick: !isInProgress ? onClose : void 0, children: /* @__PURE__ */ jsxs(
4811
+ "div",
4812
+ {
4813
+ className: "pollar-modal-card pollar-send-modal",
4814
+ "data-theme": theme,
4815
+ style: cssVars,
4816
+ onClick: (e) => e.stopPropagation(),
4817
+ children: [
4818
+ /* @__PURE__ */ jsxs("div", { className: "pollar-modal-header", children: [
4819
+ /* @__PURE__ */ jsxs("div", { className: "pollar-send-header-left", children: [
4820
+ showBack && /* @__PURE__ */ jsx("button", { type: "button", className: "pollar-modal-close", onClick: handleBack, "aria-label": "Back", children: /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "M10 3L5 8l5 5", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }) }),
4821
+ /* @__PURE__ */ jsx("h2", { className: "pollar-modal-title", children: title })
4822
+ ] }),
4823
+ /* @__PURE__ */ jsxs("div", { className: "pollar-modal-header-actions", children: [
4824
+ step === "form" && !earnUnavailable && !smartUnsupported && /* @__PURE__ */ jsx(
4825
+ "button",
4826
+ {
4827
+ type: "button",
4828
+ className: "pollar-modal-close",
4829
+ onClick: () => void handleRefresh(),
4830
+ disabled: refreshing || providersLoading,
4831
+ "aria-label": "Refresh",
4832
+ children: /* @__PURE__ */ jsx(
4833
+ "svg",
4834
+ {
4835
+ className: refreshing ? "pollar-modal-refresh-icon pollar-spinning" : "pollar-modal-refresh-icon",
4836
+ width: "16",
4837
+ height: "16",
4838
+ viewBox: "0 0 16 16",
4839
+ fill: "none",
4840
+ "aria-hidden": true,
4841
+ children: /* @__PURE__ */ jsx(
4842
+ "path",
4843
+ {
4844
+ d: "M13.5 8a5.5 5.5 0 1 1-1.6-3.9M13.5 2v3h-3",
4845
+ stroke: "currentColor",
4846
+ strokeWidth: "1.6",
4847
+ strokeLinecap: "round",
4848
+ strokeLinejoin: "round"
4849
+ }
4850
+ )
4851
+ }
4852
+ )
4853
+ }
4854
+ ),
4855
+ !isInProgress && /* @__PURE__ */ jsx("button", { type: "button", className: "pollar-modal-close", onClick: onClose, "aria-label": "Close", children: /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "M2 2l12 12M14 2L2 14", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) }) })
4654
4856
  ] })
4655
4857
  ] }),
4656
- /* @__PURE__ */ jsxs("div", { className: "pollar-swap-quote-row", children: [
4657
- /* @__PURE__ */ jsx("span", { className: "pollar-send-hint", children: "APY" }),
4658
- /* @__PURE__ */ jsxs("span", { className: "pollar-earn-live", children: [
4659
- selectedOpportunity.apy.toFixed(2),
4660
- "%"
4661
- ] })
4662
- ] })
4663
- ] }),
4664
- /* @__PURE__ */ jsxs("div", { className: "pollar-send-field", children: [
4665
- /* @__PURE__ */ jsxs("div", { className: "pollar-send-label-row", children: [
4666
- /* @__PURE__ */ jsx("label", { className: "pollar-send-label", children: tab === "deposit" ? "Amount" : "Withdraw amount" }),
4667
- tab === "withdraw" && position && /* @__PURE__ */ jsxs(
4668
- "button",
4669
- {
4670
- type: "button",
4671
- className: "pollar-swap-custom-toggle",
4672
- onClick: () => setAmount(position.withdrawable),
4673
- children: [
4858
+ step === "form" && earnUnavailable && /* @__PURE__ */ jsx("div", { className: "pollar-modal-error", children: "Earn is not available for this app." }),
4859
+ step === "form" && !earnUnavailable && /* @__PURE__ */ jsxs(Fragment, { children: [
4860
+ smartUnsupported && /* @__PURE__ */ jsx("div", { className: "pollar-modal-error", children: "Earn is not yet available for smart (passkey) wallets." }),
4861
+ /* @__PURE__ */ jsxs("div", { className: "pollar-tabs", children: [
4862
+ /* @__PURE__ */ jsx(
4863
+ "button",
4864
+ {
4865
+ type: "button",
4866
+ className: "pollar-tab",
4867
+ "data-active": tab === "deposit",
4868
+ onClick: () => {
4869
+ setTab("deposit");
4870
+ setFormError("");
4871
+ },
4872
+ children: "Deposit"
4873
+ }
4874
+ ),
4875
+ /* @__PURE__ */ jsx(
4876
+ "button",
4877
+ {
4878
+ type: "button",
4879
+ className: "pollar-tab",
4880
+ "data-active": tab === "withdraw",
4881
+ onClick: () => {
4882
+ setTab("withdraw");
4883
+ setFormError("");
4884
+ },
4885
+ children: "Withdraw"
4886
+ }
4887
+ )
4888
+ ] }),
4889
+ providers && providers.length > 1 && /* @__PURE__ */ jsxs("div", { className: "pollar-send-field", children: [
4890
+ /* @__PURE__ */ jsx("label", { className: "pollar-send-label", children: "Provider" }),
4891
+ /* @__PURE__ */ jsx(
4892
+ "select",
4893
+ {
4894
+ className: "pollar-input pollar-send-select",
4895
+ value: provider ?? "",
4896
+ onChange: (e) => setProvider(e.target.value),
4897
+ children: providers.map((p) => /* @__PURE__ */ jsx("option", { value: p, children: PROVIDER_LABELS2[p] }, p))
4898
+ }
4899
+ )
4900
+ ] }),
4901
+ /* @__PURE__ */ jsxs("div", { className: "pollar-send-field", children: [
4902
+ /* @__PURE__ */ jsx("label", { className: "pollar-send-label", children: provider === "defindex" ? "Vault" : "Pool" }),
4903
+ loadingOpps || providersLoading ? /* @__PURE__ */ jsxs("div", { className: "pollar-input pollar-select-loading", children: [
4904
+ /* @__PURE__ */ jsx("span", { className: "pollar-spinner pollar-spinner-sm" }),
4905
+ /* @__PURE__ */ jsx("span", { children: "Loading options\u2026" })
4906
+ ] }) : /* @__PURE__ */ jsx(
4907
+ "select",
4908
+ {
4909
+ className: "pollar-input pollar-send-select",
4910
+ value: opportunityId,
4911
+ disabled: opportunities.length === 0,
4912
+ onChange: (e) => setOpportunityId(e.target.value),
4913
+ children: opportunities.length === 0 ? /* @__PURE__ */ jsx("option", { value: "", children: "None available" }) : opportunities.map((o) => /* @__PURE__ */ jsxs("option", { value: o.id, children: [
4914
+ o.name,
4915
+ " \xB7 ",
4916
+ o.apy.toFixed(2),
4917
+ "% APY"
4918
+ ] }, o.id))
4919
+ }
4920
+ )
4921
+ ] }),
4922
+ selectedOpportunity && /* @__PURE__ */ jsxs("div", { className: "pollar-swap-quote", children: [
4923
+ tab === "deposit" && /* @__PURE__ */ jsxs("div", { className: "pollar-swap-quote-row", children: [
4924
+ /* @__PURE__ */ jsx("span", { className: "pollar-send-hint", children: "In your wallet" }),
4925
+ /* @__PURE__ */ jsxs("span", { children: [
4926
+ walletAvailable != null ? formatAmount4(walletAvailable) : "\u2026",
4927
+ " ",
4928
+ assetCode
4929
+ ] })
4930
+ ] }),
4931
+ /* @__PURE__ */ jsxs("div", { className: "pollar-swap-quote-row", children: [
4932
+ /* @__PURE__ */ jsx("span", { className: "pollar-send-hint", children: "Your position" }),
4933
+ /* @__PURE__ */ jsxs("span", { children: [
4934
+ position ? formatAmount4(position.balance) : "\u2026",
4935
+ " ",
4936
+ assetCode
4937
+ ] })
4938
+ ] }),
4939
+ /* @__PURE__ */ jsxs("div", { className: "pollar-swap-quote-row", children: [
4940
+ /* @__PURE__ */ jsx("span", { className: "pollar-send-hint", children: "APY" }),
4941
+ /* @__PURE__ */ jsxs("span", { className: "pollar-earn-live", children: [
4942
+ selectedOpportunity.apy.toFixed(2),
4943
+ "%"
4944
+ ] })
4945
+ ] })
4946
+ ] }),
4947
+ /* @__PURE__ */ jsxs("div", { className: "pollar-send-field", children: [
4948
+ /* @__PURE__ */ jsxs("div", { className: "pollar-send-label-row", children: [
4949
+ /* @__PURE__ */ jsx("label", { className: "pollar-send-label", children: tab === "deposit" ? "Amount" : "Withdraw amount" }),
4950
+ tab === "deposit" && walletAvailable != null && /* @__PURE__ */ jsxs("button", { type: "button", className: "pollar-swap-custom-toggle", onClick: () => setAmount(walletAvailable), children: [
4951
+ "Max: ",
4952
+ formatAmount4(walletAvailable),
4953
+ " ",
4954
+ amountUnitLabel
4955
+ ] }),
4956
+ tab === "withdraw" && position && /* @__PURE__ */ jsxs("button", { type: "button", className: "pollar-swap-custom-toggle", onClick: () => setAmount(position.withdrawable), children: [
4674
4957
  "Max: ",
4675
4958
  formatAmount4(position.withdrawable),
4676
4959
  " ",
4677
4960
  amountUnitLabel
4678
- ]
4679
- }
4680
- )
4961
+ ] })
4962
+ ] }),
4963
+ /* @__PURE__ */ jsxs("div", { className: "pollar-earn-amount", children: [
4964
+ /* @__PURE__ */ jsx(
4965
+ "input",
4966
+ {
4967
+ className: "pollar-input",
4968
+ type: "text",
4969
+ inputMode: "decimal",
4970
+ placeholder: "0.00",
4971
+ value: amount,
4972
+ onChange: (e) => setAmount(e.target.value)
4973
+ }
4974
+ ),
4975
+ amountUnitLabel && /* @__PURE__ */ jsx("span", { className: "pollar-earn-amount-unit", children: amountUnitLabel })
4976
+ ] })
4977
+ ] }),
4978
+ formError && /* @__PURE__ */ jsx("div", { className: "pollar-modal-error", children: formError }),
4979
+ depositNeedsTrustline && selectedOpportunity && /* @__PURE__ */ jsxs("div", { className: "pollar-swap-trustline-notice", children: [
4980
+ "To deposit ",
4981
+ assetCode,
4982
+ " your wallet needs a trustline. This will create it first (~0.5 XLM reserve, refundable if you later remove it), then deposit \u2014 two signatures."
4983
+ ] }),
4984
+ /* @__PURE__ */ jsx("div", { className: "pollar-modal-actions", children: /* @__PURE__ */ jsx("button", { className: "pollar-btn-primary", onClick: () => void handleSubmit(), disabled: !canSubmit, children: tab === "deposit" ? depositNeedsTrustline ? "Enable trustline & deposit" : "Deposit" : "Withdraw" }) })
4681
4985
  ] }),
4682
- /* @__PURE__ */ jsxs("div", { className: "pollar-earn-amount", children: [
4683
- /* @__PURE__ */ jsx(
4684
- "input",
4685
- {
4686
- className: "pollar-input",
4687
- type: "text",
4688
- inputMode: "decimal",
4689
- placeholder: "0.00",
4690
- value: amount,
4691
- onChange: (e) => setAmount(e.target.value)
4692
- }
4693
- ),
4694
- amountUnitLabel && /* @__PURE__ */ jsx("span", { className: "pollar-earn-amount-unit", children: amountUnitLabel })
4695
- ] })
4696
- ] }),
4697
- formError && /* @__PURE__ */ jsx("div", { className: "pollar-modal-error", children: formError }),
4698
- /* @__PURE__ */ jsx("div", { className: "pollar-modal-actions", children: /* @__PURE__ */ jsx("button", { className: "pollar-btn-primary", onClick: () => void handleSubmit(), disabled: !canSubmit, children: tab === "deposit" ? "Deposit" : "Withdraw" }) })
4699
- ] }),
4700
- step === "tx" && /* @__PURE__ */ jsx(
4701
- TxStatusView,
4702
- {
4703
- transaction,
4704
- showXdr,
4705
- copied,
4706
- explorerUrl,
4707
- walletType,
4708
- onSignAndSend: () => {
4709
- },
4710
- onToggleXdr: () => setShowXdr((v) => !v),
4711
- onCopyHash: handleCopyHash,
4712
- onRetry: () => void handleRetry(),
4713
- onDone: onClose
4714
- }
4715
- ),
4716
- /* @__PURE__ */ jsx(PollarModalFooter, {})
4717
- ] }) });
4986
+ step === "tx" && /* @__PURE__ */ jsx(
4987
+ TxStatusView,
4988
+ {
4989
+ transaction,
4990
+ showXdr,
4991
+ copied,
4992
+ explorerUrl,
4993
+ walletType,
4994
+ onSignAndSend: () => {
4995
+ },
4996
+ onToggleXdr: () => setShowXdr((v) => !v),
4997
+ onCopyHash: handleCopyHash,
4998
+ onRetry: () => void handleRetry(),
4999
+ onDone: onClose
5000
+ }
5001
+ ),
5002
+ /* @__PURE__ */ jsx(PollarModalFooter, {})
5003
+ ]
5004
+ }
5005
+ ) });
4718
5006
  }
4719
5007
  function describeDevice(s) {
4720
5008
  if (s.deviceLabel) return s.deviceLabel;
@@ -4807,30 +5095,46 @@ function SessionsModalTemplate({
4807
5095
  /* @__PURE__ */ jsxs("div", { className: "pollar-modal-header", children: [
4808
5096
  /* @__PURE__ */ jsx("h2", { className: "pollar-modal-title", children: "Active sessions" }),
4809
5097
  /* @__PURE__ */ jsxs("div", { className: "pollar-modal-header-actions", children: [
4810
- /* @__PURE__ */ jsxs("button", { className: "pollar-modal-refresh-btn", onClick: onRefresh, disabled: isLoading, children: [
4811
- /* @__PURE__ */ jsxs(
4812
- "svg",
4813
- {
4814
- className: `pollar-modal-refresh-icon${isLoading ? " spinning" : ""}`,
4815
- width: "13",
4816
- height: "13",
4817
- viewBox: "0 0 13 13",
4818
- fill: "none",
4819
- "aria-hidden": true,
4820
- children: [
4821
- /* @__PURE__ */ jsx("path", { d: "M11.5 6.5a5 5 0 11-1.5-3.536", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }),
4822
- /* @__PURE__ */ jsx("path", { d: "M10 1v3h-3", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
4823
- ]
4824
- }
4825
- ),
4826
- "Refresh"
4827
- ] }),
5098
+ /* @__PURE__ */ jsx(
5099
+ "button",
5100
+ {
5101
+ type: "button",
5102
+ className: "pollar-modal-close",
5103
+ onClick: onRefresh,
5104
+ disabled: isLoading,
5105
+ "aria-label": "Refresh",
5106
+ title: "Refresh",
5107
+ children: /* @__PURE__ */ jsx(
5108
+ "svg",
5109
+ {
5110
+ className: isLoading ? "pollar-modal-refresh-icon pollar-spinning" : "pollar-modal-refresh-icon",
5111
+ width: "16",
5112
+ height: "16",
5113
+ viewBox: "0 0 16 16",
5114
+ fill: "none",
5115
+ "aria-hidden": true,
5116
+ children: /* @__PURE__ */ jsx(
5117
+ "path",
5118
+ {
5119
+ d: "M13.5 8a5.5 5.5 0 1 1-1.6-3.9M13.5 2v3h-3",
5120
+ stroke: "currentColor",
5121
+ strokeWidth: "1.6",
5122
+ strokeLinecap: "round",
5123
+ strokeLinejoin: "round"
5124
+ }
5125
+ )
5126
+ }
5127
+ )
5128
+ }
5129
+ ),
4828
5130
  /* @__PURE__ */ jsx("button", { className: "pollar-modal-close", onClick: onClose, "aria-label": "Close", children: /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "M2 2l12 12M14 2L2 14", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) }) })
4829
5131
  ] })
4830
5132
  ] }),
4831
5133
  /* @__PURE__ */ jsxs("div", { className: "pollar-sessions-list", children: [
4832
- state.step === "idle" && /* @__PURE__ */ jsx("div", { className: "pollar-modal-empty", children: "Loading\u2026" }),
4833
- isLoading && /* @__PURE__ */ jsx("div", { className: "pollar-modal-empty", children: "Loading\u2026" }),
5134
+ (state.step === "idle" || isLoading) && /* @__PURE__ */ jsxs("div", { className: "pollar-loading-block", children: [
5135
+ /* @__PURE__ */ jsx("div", { className: "pollar-spinner" }),
5136
+ /* @__PURE__ */ jsx("span", { children: "Loading\u2026" })
5137
+ ] }),
4834
5138
  state.step === "error" && /* @__PURE__ */ jsx("div", { className: "pollar-modal-empty", children: state.message }),
4835
5139
  state.step === "loaded" && sessions.length === 0 && /* @__PURE__ */ jsx("div", { className: "pollar-modal-empty", children: "No active sessions." }),
4836
5140
  sessions.map((s) => {
@@ -4859,7 +5163,10 @@ function SessionsModalTemplate({
4859
5163
  className: "pollar-sessions-item-revoke",
4860
5164
  onClick: () => onRevoke(s.familyId),
4861
5165
  disabled: isRevoking || signingOutEverywhere,
4862
- children: isRevoking ? "Revoking\u2026" : "Revoke"
5166
+ children: isRevoking ? /* @__PURE__ */ jsxs(Fragment, { children: [
5167
+ /* @__PURE__ */ jsx("span", { className: "pollar-spinner pollar-spinner-sm pollar-spinner-current" }),
5168
+ "Revoking\u2026"
5169
+ ] }) : "Revoke"
4863
5170
  }
4864
5171
  )
4865
5172
  ] }, s.familyId);
@@ -4872,7 +5179,10 @@ function SessionsModalTemplate({
4872
5179
  onClick: onLogoutEverywhere,
4873
5180
  disabled: signingOutEverywhere || otherCount === 0,
4874
5181
  title: otherCount === 0 ? "No other devices to sign out" : void 0,
4875
- children: signingOutEverywhere ? "Signing out\u2026" : "Sign out everywhere"
5182
+ children: signingOutEverywhere ? /* @__PURE__ */ jsxs(Fragment, { children: [
5183
+ /* @__PURE__ */ jsx("span", { className: "pollar-spinner pollar-spinner-sm pollar-spinner-current" }),
5184
+ "Signing out\u2026"
5185
+ ] }) : "Sign out everywhere"
4876
5186
  }
4877
5187
  ) }),
4878
5188
  /* @__PURE__ */ jsx(PollarModalFooter, {})
@@ -5089,7 +5399,7 @@ function renderSummary(summary) {
5089
5399
  last = m.index + address.length;
5090
5400
  }
5091
5401
  if (parts.length === 0) return /* @__PURE__ */ jsx("span", { className: "pollar-hist-item-title", children: summary });
5092
- if (last < summary.length) parts.push(/* @__PURE__ */ jsx("span", { children: summary.slice(last) }, key++));
5402
+ if (last < summary.length) parts.push(/* @__PURE__ */ jsx("span", { children: summary.slice(last) }, key));
5093
5403
  return parts;
5094
5404
  }
5095
5405
  function TxHistoryModalTemplate({
@@ -5137,30 +5447,47 @@ function TxHistoryModalTemplate({
5137
5447
  /* @__PURE__ */ jsxs("div", { className: "pollar-modal-header", children: [
5138
5448
  /* @__PURE__ */ jsx("h2", { className: "pollar-modal-title", children: "Transaction History" }),
5139
5449
  /* @__PURE__ */ jsxs("div", { className: "pollar-modal-header-actions", children: [
5140
- /* @__PURE__ */ jsxs("button", { className: "pollar-modal-refresh-btn", onClick: onRefresh, disabled: isLoading, children: [
5141
- /* @__PURE__ */ jsxs(
5142
- "svg",
5143
- {
5144
- className: `pollar-modal-refresh-icon${isLoading ? " spinning" : ""}`,
5145
- width: "13",
5146
- height: "13",
5147
- viewBox: "0 0 13 13",
5148
- fill: "none",
5149
- "aria-hidden": true,
5150
- children: [
5151
- /* @__PURE__ */ jsx("path", { d: "M11.5 6.5a5 5 0 11-1.5-3.536", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }),
5152
- /* @__PURE__ */ jsx("path", { d: "M10 1v3h-3", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
5153
- ]
5154
- }
5155
- ),
5156
- "Refresh"
5157
- ] }),
5450
+ /* @__PURE__ */ jsx(
5451
+ "button",
5452
+ {
5453
+ type: "button",
5454
+ className: "pollar-modal-close",
5455
+ onClick: onRefresh,
5456
+ disabled: isLoading,
5457
+ "aria-label": "Refresh",
5458
+ title: "Refresh",
5459
+ children: /* @__PURE__ */ jsx(
5460
+ "svg",
5461
+ {
5462
+ className: isLoading ? "pollar-modal-refresh-icon pollar-spinning" : "pollar-modal-refresh-icon",
5463
+ width: "16",
5464
+ height: "16",
5465
+ viewBox: "0 0 16 16",
5466
+ fill: "none",
5467
+ "aria-hidden": true,
5468
+ children: /* @__PURE__ */ jsx(
5469
+ "path",
5470
+ {
5471
+ d: "M13.5 8a5.5 5.5 0 1 1-1.6-3.9M13.5 2v3h-3",
5472
+ stroke: "currentColor",
5473
+ strokeWidth: "1.6",
5474
+ strokeLinecap: "round",
5475
+ strokeLinejoin: "round"
5476
+ }
5477
+ )
5478
+ }
5479
+ )
5480
+ }
5481
+ ),
5158
5482
  /* @__PURE__ */ jsx("button", { className: "pollar-modal-close", onClick: onClose, "aria-label": "Close", children: /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "M2 2l12 12M14 2L2 14", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) }) })
5159
5483
  ] })
5160
5484
  ] }),
5161
5485
  /* @__PURE__ */ jsxs("div", { className: "pollar-hist-list", children: [
5162
5486
  txHistory.step === "idle" && /* @__PURE__ */ jsx("div", { className: "pollar-modal-empty", children: "Click Refresh to load transactions." }),
5163
- isLoading && /* @__PURE__ */ jsx("div", { className: "pollar-modal-empty", children: "Loading\u2026" }),
5487
+ isLoading && /* @__PURE__ */ jsxs("div", { className: "pollar-loading-block", children: [
5488
+ /* @__PURE__ */ jsx("div", { className: "pollar-spinner" }),
5489
+ /* @__PURE__ */ jsx("span", { children: "Loading\u2026" })
5490
+ ] }),
5164
5491
  txHistory.step === "error" && /* @__PURE__ */ jsx("div", { className: "pollar-modal-empty", children: txHistory.message }),
5165
5492
  txHistory.step === "loaded" && records.length === 0 && /* @__PURE__ */ jsx("div", { className: "pollar-modal-empty", children: "No transactions yet." }),
5166
5493
  records.map((record) => {
@@ -5353,24 +5680,38 @@ function WalletBalanceModalTemplate({
5353
5680
  /* @__PURE__ */ jsxs("div", { className: "pollar-modal-header", children: [
5354
5681
  /* @__PURE__ */ jsx("h2", { className: "pollar-modal-title", children: "Wallet Balance" }),
5355
5682
  /* @__PURE__ */ jsxs("div", { className: "pollar-modal-header-actions", children: [
5356
- /* @__PURE__ */ jsxs("button", { className: "pollar-modal-refresh-btn", onClick: onRefresh, disabled: isLoading, children: [
5357
- /* @__PURE__ */ jsxs(
5358
- "svg",
5359
- {
5360
- className: `pollar-modal-refresh-icon${isLoading ? " spinning" : ""}`,
5361
- width: "13",
5362
- height: "13",
5363
- viewBox: "0 0 13 13",
5364
- fill: "none",
5365
- "aria-hidden": true,
5366
- children: [
5367
- /* @__PURE__ */ jsx("path", { d: "M11.5 6.5a5 5 0 11-1.5-3.536", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }),
5368
- /* @__PURE__ */ jsx("path", { d: "M10 1v3h-3", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
5369
- ]
5370
- }
5371
- ),
5372
- "Refresh"
5373
- ] }),
5683
+ /* @__PURE__ */ jsx(
5684
+ "button",
5685
+ {
5686
+ type: "button",
5687
+ className: "pollar-modal-close",
5688
+ onClick: onRefresh,
5689
+ disabled: isLoading,
5690
+ "aria-label": "Refresh",
5691
+ title: "Refresh",
5692
+ children: /* @__PURE__ */ jsx(
5693
+ "svg",
5694
+ {
5695
+ className: isLoading ? "pollar-modal-refresh-icon pollar-spinning" : "pollar-modal-refresh-icon",
5696
+ width: "16",
5697
+ height: "16",
5698
+ viewBox: "0 0 16 16",
5699
+ fill: "none",
5700
+ "aria-hidden": true,
5701
+ children: /* @__PURE__ */ jsx(
5702
+ "path",
5703
+ {
5704
+ d: "M13.5 8a5.5 5.5 0 1 1-1.6-3.9M13.5 2v3h-3",
5705
+ stroke: "currentColor",
5706
+ strokeWidth: "1.6",
5707
+ strokeLinecap: "round",
5708
+ strokeLinejoin: "round"
5709
+ }
5710
+ )
5711
+ }
5712
+ )
5713
+ }
5714
+ ),
5374
5715
  /* @__PURE__ */ jsx("button", { className: "pollar-modal-close", onClick: onClose, "aria-label": "Close", children: /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "M2 2l12 12M14 2L2 14", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) }) })
5375
5716
  ] })
5376
5717
  ] }),
@@ -5378,7 +5719,10 @@ function WalletBalanceModalTemplate({
5378
5719
  /* @__PURE__ */ jsx("span", { className: "pollar-bal-address", children: cropAddress2(walletAddress) }),
5379
5720
  /* @__PURE__ */ jsx(CopyButton, { value: walletAddress, label: "Copy wallet address" })
5380
5721
  ] }),
5381
- isLoading && /* @__PURE__ */ jsx("div", { className: "pollar-modal-empty", children: "Loading\u2026" }),
5722
+ isLoading && /* @__PURE__ */ jsxs("div", { className: "pollar-loading-block", children: [
5723
+ /* @__PURE__ */ jsx("div", { className: "pollar-spinner" }),
5724
+ /* @__PURE__ */ jsx("span", { children: "Loading\u2026" })
5725
+ ] }),
5382
5726
  walletBalance.step === "error" && /* @__PURE__ */ jsx("div", { className: "pollar-modal-error", children: walletBalance.message }),
5383
5727
  data && !data.exists && /* @__PURE__ */ jsxs("div", { className: "pollar-modal-empty", children: [
5384
5728
  "Account not found on ",
@@ -5589,6 +5933,9 @@ function PollarProvider({
5589
5933
  const [sendModalOpen, setSendModalOpen] = useState(false);
5590
5934
  const [swapModalOpen, setSwapModalOpen] = useState(false);
5591
5935
  const [earnModalOpen, setEarnModalOpen] = useState(false);
5936
+ const [sendModalKey, setSendModalKey] = useState(0);
5937
+ const [swapModalKey, setSwapModalKey] = useState(0);
5938
+ const [earnModalKey, setEarnModalKey] = useState(0);
5592
5939
  const [receiveModalOpen, setReceiveModalOpen] = useState(false);
5593
5940
  const [sessionsModalOpen, setSessionsModalOpen] = useState(false);
5594
5941
  const [distributionRulesModalOpen, setDistributionRulesModalOpen] = useState(false);
@@ -5631,21 +5978,33 @@ function PollarProvider({
5631
5978
  setTrustline: (asset, opts) => pollarClient.setTrustline(asset, opts),
5632
5979
  openEnabledAssetsModal: () => setEnabledAssetsModalOpen(true),
5633
5980
  // send / receive
5634
- openSendModal: () => setSendModalOpen(true),
5981
+ openSendModal: () => {
5982
+ pollarClient.resetTransactionState();
5983
+ setSendModalKey((k) => k + 1);
5984
+ setSendModalOpen(true);
5985
+ },
5635
5986
  openReceiveModal: () => setReceiveModalOpen(true),
5636
5987
  // swap
5637
5988
  getSwapConfig: () => pollarClient.getSwapConfig(),
5638
5989
  getSwapTokens: () => pollarClient.getSwapTokens(),
5639
5990
  getSwapQuote: (params) => pollarClient.getSwapQuote(params),
5640
5991
  swap: (quote, opts) => pollarClient.swap(quote, opts),
5641
- openSwapModal: () => setSwapModalOpen(true),
5992
+ openSwapModal: () => {
5993
+ pollarClient.resetTransactionState();
5994
+ setSwapModalKey((k) => k + 1);
5995
+ setSwapModalOpen(true);
5996
+ },
5642
5997
  // earn
5643
5998
  getEarnProviders: () => pollarClient.getEarnProviders(),
5644
5999
  getEarnOpportunities: (provider) => pollarClient.getEarnOpportunities(provider),
5645
6000
  getEarnPosition: (params) => pollarClient.getEarnPosition(params),
5646
6001
  earnDeposit: (params) => pollarClient.earnDeposit(params),
5647
6002
  earnWithdraw: (params) => pollarClient.earnWithdraw(params),
5648
- openEarnModal: () => setEarnModalOpen(true),
6003
+ openEarnModal: () => {
6004
+ pollarClient.resetTransactionState();
6005
+ setEarnModalKey((k) => k + 1);
6006
+ setEarnModalOpen(true);
6007
+ },
5649
6008
  // sessions
5650
6009
  sessions,
5651
6010
  openSessionsModal: () => setSessionsModalOpen(true),
@@ -5699,9 +6058,9 @@ function PollarProvider({
5699
6058
  txHistoryModalOpen && /* @__PURE__ */ jsx(ModalErrorBoundary, { onClose: () => setTxHistoryModalOpen(false), children: /* @__PURE__ */ jsx(TxHistoryModal, { onClose: () => setTxHistoryModalOpen(false) }) }),
5700
6059
  walletBalanceModalOpen && /* @__PURE__ */ jsx(ModalErrorBoundary, { onClose: () => setWalletBalanceModalOpen(false), children: /* @__PURE__ */ jsx(WalletBalanceModal, { onClose: () => setWalletBalanceModalOpen(false) }) }),
5701
6060
  enabledAssetsModalOpen && /* @__PURE__ */ jsx(ModalErrorBoundary, { onClose: () => setEnabledAssetsModalOpen(false), children: /* @__PURE__ */ jsx(EnabledAssetsModal, { onClose: () => setEnabledAssetsModalOpen(false) }) }),
5702
- sendModalOpen && /* @__PURE__ */ jsx(ModalErrorBoundary, { onClose: () => setSendModalOpen(false), children: /* @__PURE__ */ jsx(SendModal, { onClose: () => setSendModalOpen(false) }) }),
5703
- swapModalOpen && /* @__PURE__ */ jsx(ModalErrorBoundary, { onClose: () => setSwapModalOpen(false), children: /* @__PURE__ */ jsx(SwapModal, { onClose: () => setSwapModalOpen(false) }) }),
5704
- earnModalOpen && /* @__PURE__ */ jsx(ModalErrorBoundary, { onClose: () => setEarnModalOpen(false), children: /* @__PURE__ */ jsx(EarnModal, { onClose: () => setEarnModalOpen(false) }) }),
6061
+ sendModalOpen && /* @__PURE__ */ jsx(ModalErrorBoundary, { onClose: () => setSendModalOpen(false), children: /* @__PURE__ */ jsx(SendModal, { onClose: () => setSendModalOpen(false) }) }, sendModalKey),
6062
+ swapModalOpen && /* @__PURE__ */ jsx(ModalErrorBoundary, { onClose: () => setSwapModalOpen(false), children: /* @__PURE__ */ jsx(SwapModal, { onClose: () => setSwapModalOpen(false) }) }, swapModalKey),
6063
+ earnModalOpen && /* @__PURE__ */ jsx(ModalErrorBoundary, { onClose: () => setEarnModalOpen(false), children: /* @__PURE__ */ jsx(EarnModal, { onClose: () => setEarnModalOpen(false) }) }, earnModalKey),
5705
6064
  receiveModalOpen && /* @__PURE__ */ jsx(ModalErrorBoundary, { onClose: () => setReceiveModalOpen(false), children: /* @__PURE__ */ jsx(ReceiveModal, { onClose: () => setReceiveModalOpen(false) }) }),
5706
6065
  sessionsModalOpen && /* @__PURE__ */ jsx(ModalErrorBoundary, { onClose: () => setSessionsModalOpen(false), children: /* @__PURE__ */ jsx(SessionsModal, { onClose: () => setSessionsModalOpen(false) }) }),
5707
6066
  distributionRulesModalOpen && /* @__PURE__ */ jsx(ModalErrorBoundary, { onClose: () => setDistributionRulesModalOpen(false), children: /* @__PURE__ */ jsx(DistributionRulesModal, { onClose: () => setDistributionRulesModalOpen(false) }) })
@@ -5735,7 +6094,7 @@ function createPollarAdapterHook(key) {
5735
6094
  };
5736
6095
  }
5737
6096
  function ButtonLogo() {
5738
- return /* @__PURE__ */ jsx("img", { src: LOGO_POLLAR, alt: "Pollar", width: 22, height: 22, className: "wallet-btn-logo" });
6097
+ return /* @__PURE__ */ jsx("img", { src: LOGO_POLLAR, alt: "Pollar", width: 22, height: 22, className: "pollar-wallet-btn-logo" });
5739
6098
  }
5740
6099
  function cropWallet(address) {
5741
6100
  if (address.length <= 12) return address;
@@ -5768,23 +6127,23 @@ function WalletButtonTemplate({
5768
6127
  onLogin
5769
6128
  }) {
5770
6129
  if (!walletAddress) {
5771
- return /* @__PURE__ */ jsxs("button", { type: "button", className: "wallet-login-btn", style: { backgroundColor: accentColor }, onClick: onLogin, children: [
6130
+ return /* @__PURE__ */ jsxs("button", { type: "button", className: "pollar-wallet-login-btn", style: { backgroundColor: accentColor }, onClick: onLogin, children: [
5772
6131
  /* @__PURE__ */ jsx(ButtonLogo, {}),
5773
6132
  "Login with Pollar"
5774
6133
  ] });
5775
6134
  }
5776
- return /* @__PURE__ */ jsxs("div", { className: "wallet-wrapper", ref: wrapperRef, children: [
6135
+ return /* @__PURE__ */ jsxs("div", { className: "pollar-wallet-wrapper", ref: wrapperRef, children: [
5777
6136
  /* @__PURE__ */ jsxs(
5778
6137
  "button",
5779
6138
  {
5780
- className: "wallet-btn",
6139
+ className: "pollar-wallet-btn",
5781
6140
  style: { backgroundColor: accentColor },
5782
6141
  onClick: isInProgress ? void 0 : onToggleOpen,
5783
6142
  disabled: isInProgress,
5784
6143
  "aria-busy": isInProgress,
5785
6144
  children: [
5786
- /* @__PURE__ */ jsx("span", { className: "wallet-btn-label", children: cropWallet(walletAddress) }),
5787
- isInProgress ? /* @__PURE__ */ jsxs("svg", { className: "wallet-btn-spinner", viewBox: "0 0 12 12", width: "12", height: "12", fill: "none", "aria-hidden": true, children: [
6145
+ /* @__PURE__ */ jsx("span", { className: "pollar-wallet-btn-label", children: cropWallet(walletAddress) }),
6146
+ isInProgress ? /* @__PURE__ */ jsxs("svg", { className: "pollar-wallet-btn-spinner", viewBox: "0 0 12 12", width: "12", height: "12", fill: "none", "aria-hidden": true, children: [
5788
6147
  /* @__PURE__ */ jsx("circle", { cx: "6", cy: "6", r: "4.5", stroke: "rgba(255,255,255,0.35)", strokeWidth: "1.5" }),
5789
6148
  /* @__PURE__ */ jsx(
5790
6149
  "circle",
@@ -5802,7 +6161,7 @@ function WalletButtonTemplate({
5802
6161
  ] }) : /* @__PURE__ */ jsx(
5803
6162
  "svg",
5804
6163
  {
5805
- className: `wallet-chevron${open ? " open" : ""}`,
6164
+ className: `pollar-wallet-chevron${open ? " pollar-open" : ""}`,
5806
6165
  viewBox: "0 0 12 12",
5807
6166
  fill: "none",
5808
6167
  stroke: "currentColor",
@@ -5815,12 +6174,12 @@ function WalletButtonTemplate({
5815
6174
  ]
5816
6175
  }
5817
6176
  ),
5818
- open && /* @__PURE__ */ jsxs("div", { className: "wallet-dropdown", style: { backgroundColor: dropdownBg, borderColor: dropdownBorder }, children: [
6177
+ open && /* @__PURE__ */ jsxs("div", { className: "pollar-wallet-dropdown", style: { backgroundColor: dropdownBg, borderColor: dropdownBorder }, children: [
5819
6178
  showCreateAccount && /* @__PURE__ */ jsxs(Fragment, { children: [
5820
6179
  /* @__PURE__ */ jsxs(
5821
6180
  "button",
5822
6181
  {
5823
- className: "wallet-dropdown-item",
6182
+ className: "pollar-wallet-dropdown-item",
5824
6183
  style: { color: itemColor },
5825
6184
  onClick: onCreateAccount,
5826
6185
  disabled: creatingAccount,
@@ -5848,9 +6207,9 @@ function WalletButtonTemplate({
5848
6207
  ]
5849
6208
  }
5850
6209
  ),
5851
- /* @__PURE__ */ jsx("div", { className: "wallet-dropdown-divider" })
6210
+ /* @__PURE__ */ jsx("div", { className: "pollar-wallet-dropdown-divider" })
5852
6211
  ] }),
5853
- /* @__PURE__ */ jsxs("button", { className: "wallet-dropdown-item", style: { color: itemColor }, onClick: onSend, children: [
6212
+ /* @__PURE__ */ jsxs("button", { className: "pollar-wallet-dropdown-item", style: { color: itemColor }, onClick: onSend, children: [
5854
6213
  /* @__PURE__ */ jsxs(
5855
6214
  "svg",
5856
6215
  {
@@ -5870,7 +6229,7 @@ function WalletButtonTemplate({
5870
6229
  ),
5871
6230
  "Send"
5872
6231
  ] }),
5873
- /* @__PURE__ */ jsxs("button", { className: "wallet-dropdown-item", style: { color: itemColor }, onClick: onReceive, children: [
6232
+ /* @__PURE__ */ jsxs("button", { className: "pollar-wallet-dropdown-item", style: { color: itemColor }, onClick: onReceive, children: [
5874
6233
  /* @__PURE__ */ jsxs(
5875
6234
  "svg",
5876
6235
  {
@@ -5891,8 +6250,8 @@ function WalletButtonTemplate({
5891
6250
  ),
5892
6251
  "Receive"
5893
6252
  ] }),
5894
- /* @__PURE__ */ jsx("div", { className: "wallet-dropdown-divider" }),
5895
- /* @__PURE__ */ jsxs("button", { className: "wallet-dropdown-item", style: { color: itemColor }, onClick: onCopy, children: [
6253
+ /* @__PURE__ */ jsx("div", { className: "pollar-wallet-dropdown-divider" }),
6254
+ /* @__PURE__ */ jsxs("button", { className: "pollar-wallet-dropdown-item", style: { color: itemColor }, onClick: onCopy, children: [
5896
6255
  /* @__PURE__ */ jsxs(
5897
6256
  "svg",
5898
6257
  {
@@ -5912,7 +6271,7 @@ function WalletButtonTemplate({
5912
6271
  ),
5913
6272
  copied ? "Copied!" : "Copy address"
5914
6273
  ] }),
5915
- /* @__PURE__ */ jsxs("button", { className: "wallet-dropdown-item", style: { color: itemColor }, onClick: onWalletBalance, children: [
6274
+ /* @__PURE__ */ jsxs("button", { className: "pollar-wallet-dropdown-item", style: { color: itemColor }, onClick: onWalletBalance, children: [
5916
6275
  /* @__PURE__ */ jsxs(
5917
6276
  "svg",
5918
6277
  {
@@ -5933,7 +6292,7 @@ function WalletButtonTemplate({
5933
6292
  ),
5934
6293
  "Wallet balance"
5935
6294
  ] }),
5936
- /* @__PURE__ */ jsxs("button", { className: "wallet-dropdown-item", style: { color: itemColor }, onClick: onTxHistory, children: [
6295
+ /* @__PURE__ */ jsxs("button", { className: "pollar-wallet-dropdown-item", style: { color: itemColor }, onClick: onTxHistory, children: [
5937
6296
  /* @__PURE__ */ jsxs(
5938
6297
  "svg",
5939
6298
  {
@@ -5956,8 +6315,8 @@ function WalletButtonTemplate({
5956
6315
  ),
5957
6316
  "Transaction history"
5958
6317
  ] }),
5959
- /* @__PURE__ */ jsx("div", { className: "wallet-dropdown-divider" }),
5960
- /* @__PURE__ */ jsxs("button", { className: "wallet-dropdown-item", style: { color: itemColor }, onClick: onRamp, children: [
6318
+ /* @__PURE__ */ jsx("div", { className: "pollar-wallet-dropdown-divider" }),
6319
+ /* @__PURE__ */ jsxs("button", { className: "pollar-wallet-dropdown-item", style: { color: itemColor }, onClick: onRamp, children: [
5961
6320
  /* @__PURE__ */ jsxs(
5962
6321
  "svg",
5963
6322
  {
@@ -5979,7 +6338,7 @@ function WalletButtonTemplate({
5979
6338
  ),
5980
6339
  "Buy / Sell"
5981
6340
  ] }),
5982
- /* @__PURE__ */ jsxs("button", { className: "wallet-dropdown-item", style: { color: itemColor }, onClick: onKyc, children: [
6341
+ /* @__PURE__ */ jsxs("button", { className: "pollar-wallet-dropdown-item", style: { color: itemColor }, onClick: onKyc, children: [
5983
6342
  /* @__PURE__ */ jsxs(
5984
6343
  "svg",
5985
6344
  {
@@ -6000,7 +6359,7 @@ function WalletButtonTemplate({
6000
6359
  ),
6001
6360
  "Identity verification"
6002
6361
  ] }),
6003
- /* @__PURE__ */ jsxs("button", { className: "wallet-dropdown-item", style: { color: itemColor }, onClick: onDistributionRules, children: [
6362
+ /* @__PURE__ */ jsxs("button", { className: "pollar-wallet-dropdown-item", style: { color: itemColor }, onClick: onDistributionRules, children: [
6004
6363
  /* @__PURE__ */ jsxs(
6005
6364
  "svg",
6006
6365
  {
@@ -6023,7 +6382,7 @@ function WalletButtonTemplate({
6023
6382
  ),
6024
6383
  "Distribution rules"
6025
6384
  ] }),
6026
- /* @__PURE__ */ jsxs("button", { className: "wallet-dropdown-item", style: { color: itemColor }, onClick: onSessions, children: [
6385
+ /* @__PURE__ */ jsxs("button", { className: "pollar-wallet-dropdown-item", style: { color: itemColor }, onClick: onSessions, children: [
6027
6386
  /* @__PURE__ */ jsxs(
6028
6387
  "svg",
6029
6388
  {
@@ -6044,8 +6403,8 @@ function WalletButtonTemplate({
6044
6403
  ),
6045
6404
  "Active sessions"
6046
6405
  ] }),
6047
- /* @__PURE__ */ jsx("div", { className: "wallet-dropdown-divider" }),
6048
- /* @__PURE__ */ jsxs("button", { className: "wallet-dropdown-item danger", onClick: onLogout, children: [
6406
+ /* @__PURE__ */ jsx("div", { className: "pollar-wallet-dropdown-divider" }),
6407
+ /* @__PURE__ */ jsxs("button", { className: "pollar-wallet-dropdown-item pollar-danger", onClick: onLogout, children: [
6049
6408
  /* @__PURE__ */ jsxs(
6050
6409
  "svg",
6051
6410
  {