@blockend/widget 1.0.31 → 1.0.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (161) hide show
  1. package/dist/AllRoutes-B04uZfaa.js +2209 -0
  2. package/dist/Box-BWDJCGbI.js +55 -0
  3. package/dist/EstGas-QSPrdq3Y.js +12863 -0
  4. package/dist/Grow-37t11tle.js +1656 -0
  5. package/dist/InputComp-bKVjlcbT.js +106 -0
  6. package/dist/LoadRoute-C3vokLk0.js +126 -0
  7. package/dist/QuotesProgress-DlgLQ2zo.js +28 -0
  8. package/dist/SwapAsset-tD6wSJDD.js +64 -0
  9. package/dist/Tooltip-BqYgFn1F.js +572 -0
  10. package/dist/TxnButton-DefErcCE.js +207 -0
  11. package/dist/WidgetForm.module-QHJ0-m5f.js +9 -0
  12. package/dist/{add-B8AfyNIx.js → add-D32G_xKI.js} +3 -3
  13. package/dist/{all-wallets-BaLLU39i.js → all-wallets-LjjqiTnJ.js} +3 -3
  14. package/dist/{app-store-DNpoABj1.js → app-store-S7C23kTz.js} +3 -3
  15. package/dist/{apple-DzzHtaL4.js → apple-DMd4RArz.js} +3 -3
  16. package/dist/{arrow-bottom-D2c13c51.js → arrow-bottom-C0cVMl2n.js} +3 -3
  17. package/dist/{arrow-bottom-circle-ls9OCLx1.js → arrow-bottom-circle-veMvHYVR.js} +3 -3
  18. package/dist/{arrow-left-BI3rQkNI.js → arrow-left-B6VdOxSY.js} +3 -3
  19. package/dist/{arrow-right-rnMzhVod.js → arrow-right-CyrokJyU.js} +3 -3
  20. package/dist/{arrow-top-CfA6PVMz.js → arrow-top-S8qh5z92.js} +3 -3
  21. package/dist/{bank-CmpAmHgg.js → bank-B9ySjxm-.js} +3 -3
  22. package/dist/basic-BXha5sM_.js +5783 -0
  23. package/dist/{browser-mEcjgS1H.js → browser-CWmyZDF1.js} +3 -3
  24. package/dist/{card-DkgIWcMc.js → card-TzoSVbiE.js} +3 -3
  25. package/dist/ccip-B97isPV8.js +228 -0
  26. package/dist/{checkmark-B_A013n2.js → checkmark-Be4tNZY8.js} +3 -3
  27. package/dist/{checkmark-bold-DestuG2T.js → checkmark-bold-sAoooMoy.js} +3 -3
  28. package/dist/{chevron-bottom-Di3S86dj.js → chevron-bottom-Cdd52Yir.js} +3 -3
  29. package/dist/{chevron-left-A9Wj-3tj.js → chevron-left-Dp8rM2qD.js} +3 -3
  30. package/dist/{chevron-right-UFxJogOZ.js → chevron-right-kH3Pgt8h.js} +3 -3
  31. package/dist/{chevron-top-BbZs3eaC.js → chevron-top-lx-9iWm1.js} +3 -3
  32. package/dist/{chrome-store-B4F6hJmy.js → chrome-store-BGxPgdkC.js} +3 -3
  33. package/dist/{clock-BbAQ09uV.js → clock-B3r9UiFY.js} +3 -3
  34. package/dist/clockIcon-C2W5xvyt.js +76 -0
  35. package/dist/{close-CY3oZP_D.js → close-Cc6SJ0A9.js} +3 -3
  36. package/dist/{coinPlaceholder-DpfsobZT.js → coinPlaceholder-DqH2n2v1.js} +3 -3
  37. package/dist/{compass-CHS7RZFk.js → compass-CiKYczAi.js} +3 -3
  38. package/dist/{copy-CEd4nGhs.js → copy-DR0dlbF5.js} +3 -3
  39. package/dist/core-D9oRINim.js +14967 -0
  40. package/dist/{cursor-transparent-Tm6k6Ws4.js → cursor-transparent-BABlb938.js} +3 -3
  41. package/dist/cursor-vv-pXAzC.js +7 -0
  42. package/dist/{desktop-CrSyXZkL.js → desktop-aFWdAU4O.js} +3 -3
  43. package/dist/{disconnect-BooT10E1.js → disconnect-Cz0MwjuJ.js} +3 -3
  44. package/dist/{discord-B982Qaml.js → discord-BkNiORDh.js} +3 -3
  45. package/dist/down-BAe_uoMx.js +606 -0
  46. package/dist/{etherscan-CFL0IcNl.js → etherscan-4wT3rhj5.js} +3 -3
  47. package/dist/ethertousd-CC_ezooz.js +6 -0
  48. package/dist/{exclamation-triangle-BBeGXYgt.js → exclamation-triangle-CSv7sjYs.js} +3 -3
  49. package/dist/{extension-C5WqJw73.js → extension-B4acJb16.js} +3 -3
  50. package/dist/{external-link-CcSxVDcd.js → external-link-zFdRyGh8.js} +3 -3
  51. package/dist/{facebook-DF0v9ED8.js → facebook-D2h4REjy.js} +3 -3
  52. package/dist/{farcaster-Boq7M4VK.js → farcaster-acRwWMSn.js} +3 -3
  53. package/dist/{filters-DfeymbPx.js → filters-DE1yHCJy.js} +3 -3
  54. package/dist/getChainIds-B4BLdhKd.js +1888 -0
  55. package/dist/getCosmosAddress-BfMdDDaH.js +9565 -0
  56. package/dist/{github-DQ8FV4bD.js → github-BrCBPjDS.js} +3 -3
  57. package/dist/{google-Dm8FDDZR.js → google-DYC6Um96.js} +3 -3
  58. package/dist/hamburger-sg42nvNd.js +3915 -0
  59. package/dist/{help-circle-CbgiAebR.js → help-circle-CKvIeM4J.js} +3 -3
  60. package/dist/{id-CzqxUksI.js → id-FXzF1V3L.js} +3 -3
  61. package/dist/{image-CsCGTIN-.js → image-rOZMtN9o.js} +3 -3
  62. package/dist/index-B0E-rGOh.js +159 -0
  63. package/dist/index-B5gV3APh.js +992 -0
  64. package/dist/index-CDq3vNnP.js +22 -0
  65. package/dist/index-CIjTGwYH.js +9 -0
  66. package/dist/index-Cmj3dp3U.js +473 -0
  67. package/dist/index-DEovHqJS.js +3010 -0
  68. package/dist/index-DOcwHfd3.js +13583 -0
  69. package/dist/index-DSlXIHtr.js +28701 -0
  70. package/dist/index-DTish3yr.js +1014 -0
  71. package/dist/index-PIAjHNgG.js +18613 -0
  72. package/dist/index-SiMIoFT9.js +331 -0
  73. package/dist/index-Y94UWILI.js +1460 -0
  74. package/dist/index-baetUfmH.js +252 -0
  75. package/dist/index.es-D6RvS0tB.js +366 -0
  76. package/dist/index.es-TLoHC_Sf.js +11678 -0
  77. package/dist/index.es.js +4 -4
  78. package/dist/{info-circle-Bt350Yzj.js → info-circle-BYfEprqC.js} +3 -3
  79. package/dist/{info-fKCfLW0k.js → info-dh7qmm_R.js} +3 -3
  80. package/dist/{lightbulb-BL9YBxiA.js → lightbulb-3S8w5B31.js} +3 -3
  81. package/dist/{mail-_g6CHQeQ.js → mail-DgcPoOPs.js} +3 -3
  82. package/dist/{mobile-B-EQ4IcH.js → mobile-C8egRR0V.js} +3 -3
  83. package/dist/{more-C3rpOdUy.js → more-CU_oPwwY.js} +3 -3
  84. package/dist/{network-placeholder-D9Ak7Xj_.js → network-placeholder-CqjaxlS7.js} +3 -3
  85. package/dist/{nftPlaceholder-CIIm2V_o.js → nftPlaceholder-D6mZlZmz.js} +3 -3
  86. package/dist/{off-DZjgI0eE.js → off-DHeUICx6.js} +3 -3
  87. package/dist/{play-store-DvRnagoF.js → play-store-DyGxjYv5.js} +3 -3
  88. package/dist/{plus-C2jN2huZ.js → plus-k4hEdLAH.js} +3 -3
  89. package/dist/{qr-code-B64HnZgi.js → qr-code-CkavLc0Z.js} +3 -3
  90. package/dist/{recycle-horizontal-CovcJGa_.js → recycle-horizontal-YzkyX2fY.js} +3 -3
  91. package/dist/{refresh-J1Vw6QMA.js → refresh-E1vpdqCO.js} +3 -3
  92. package/dist/{reown-logo-BsXoZ3KT.js → reown-logo-BZbc_-R6.js} +3 -3
  93. package/dist/{search-BC86wYXR.js → search-B9vQkIsQ.js} +3 -3
  94. package/dist/{send-BPA1bK5G.js → send-C9ROxhya.js} +3 -3
  95. package/dist/shareicon-CLveBf8l.js +262 -0
  96. package/dist/{sortDown-cDA6MpOw.js → sortDown-CjBaDQTU.js} +13 -13
  97. package/dist/{swapHorizontal-47_8ePle.js → swapHorizontal-BhLDDuiL.js} +3 -3
  98. package/dist/{swapHorizontalBold-CJ7TzeQP.js → swapHorizontalBold-B1IxJLem.js} +3 -3
  99. package/dist/{swapHorizontalMedium-CTACgUR9.js → swapHorizontalMedium--fvn_6KH.js} +3 -3
  100. package/dist/{swapHorizontalRoundedBold-Ht3_LABp.js → swapHorizontalRoundedBold-fZowAp5m.js} +3 -3
  101. package/dist/{swapVertical-DlS0V6DD.js → swapVertical-CDwndQ4s.js} +3 -3
  102. package/dist/{telegram-UZ00kvIE.js → telegram-BLbguJ3E.js} +3 -3
  103. package/dist/{three-dots-D9zVXr1j.js → three-dots-DyIG0Aiq.js} +3 -3
  104. package/dist/truncate-D9t92mVX.js +7 -0
  105. package/dist/{twitch-CP6rpz4m.js → twitch-054mPrps.js} +3 -3
  106. package/dist/{twitterIcon-Cm3I3FRU.js → twitterIcon-DrlgKmas.js} +3 -3
  107. package/dist/unsupportedProp-Dr6Tadlk.js +10 -0
  108. package/dist/useRegisterError-C52MuupC.js +9857 -0
  109. package/dist/validError-CDlJpg_f.js +6 -0
  110. package/dist/{verify-filled-CfgydKPa.js → verify-filled-Dw1_4VEj.js} +3 -3
  111. package/dist/{verify-DuUE85WT.js → verify-uz7q7EMX.js} +3 -3
  112. package/dist/w3m-modal-CJM8um8G.js +1471 -0
  113. package/dist/{wallet-BC2LSDlF.js → wallet-a9cCMI05.js} +3 -3
  114. package/dist/{wallet-placeholder-DugEJ7xM.js → wallet-placeholder-Cqiz2_rA.js} +3 -3
  115. package/dist/{walletconnect-wayCaYfk.js → walletconnect-96twp7MP.js} +7 -9
  116. package/dist/{warning-circle-Cy9YuvwU.js → warning-circle-C4mV6fIZ.js} +3 -3
  117. package/dist/{x-jggPFiy-.js → x-vRe7FHUS.js} +3 -3
  118. package/package.json +7 -19
  119. package/dist/AllRoutes-Bdi5ZW8W.js +0 -2604
  120. package/dist/Box-e4gA-y_H.js +0 -60
  121. package/dist/EstGas-C5ihS0Mw.js +0 -17108
  122. package/dist/Grow-B4K-I-E-.js +0 -2212
  123. package/dist/InputComp-C_UUZxNU.js +0 -114
  124. package/dist/LoadRoute-CnDhVKdh.js +0 -142
  125. package/dist/QuotesProgress-DxgPgPJE.js +0 -29
  126. package/dist/SwapAsset-CmmuxeQF.js +0 -65
  127. package/dist/Tooltip-D8YjOOKU.js +0 -718
  128. package/dist/TxnButton-CF-TLZrD.js +0 -302
  129. package/dist/WidgetForm.module-DhUUlwZP.js +0 -13
  130. package/dist/basic-Cx2xxgd9.js +0 -7109
  131. package/dist/ccip-BKpquA5i.js +0 -250
  132. package/dist/clockIcon-jSNFFrLy.js +0 -76
  133. package/dist/core-C-gr9X18.js +0 -17217
  134. package/dist/cursor-BTtIlTHP.js +0 -7
  135. package/dist/down-DDk8OoJG.js +0 -809
  136. package/dist/ethertousd-BOknTgU4.js +0 -7
  137. package/dist/getChainIds-6iugk2h0.js +0 -2431
  138. package/dist/getCosmosAddress-BgD5iV6f.js +0 -13998
  139. package/dist/hamburger-BYe_G11E.js +0 -4562
  140. package/dist/index-BAmjBHYR.js +0 -1087
  141. package/dist/index-BxHeZ9IF.js +0 -543
  142. package/dist/index-C7cb2O7r.js +0 -16078
  143. package/dist/index-CF9p4S_X.js +0 -11
  144. package/dist/index-C_vo1L7p.js +0 -24384
  145. package/dist/index-Ch7w83dW.js +0 -4217
  146. package/dist/index-Crhenmgw.js +0 -188
  147. package/dist/index-Cz5Dosd2.js +0 -412
  148. package/dist/index-D5OnT-__.js +0 -35858
  149. package/dist/index-DArR1lwi.js +0 -1759
  150. package/dist/index-hEJSpZe-.js +0 -308
  151. package/dist/index-m2O0cbD8.js +0 -1883
  152. package/dist/index-sLx4Edw4.js +0 -22
  153. package/dist/index.es-DIbGJsfa.js +0 -475
  154. package/dist/index.es-t6sHlseh.js +0 -12916
  155. package/dist/secp256k1-BkBK0mD5.js +0 -1681
  156. package/dist/shareicon-C88Wx-AM.js +0 -314
  157. package/dist/truncate-DSxFWEga.js +0 -7
  158. package/dist/unsupportedProp-DkeDzLfM.js +0 -14
  159. package/dist/useRegisterError-W_UfecIN.js +0 -19288
  160. package/dist/validError-rariWQ7G.js +0 -14
  161. package/dist/w3m-modal-Bl-DPlah.js +0 -1721
@@ -1,114 +0,0 @@
1
- import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
- import { u as useStore } from "./index-D5OnT-__.js";
3
- import { useState, useRef } from "react";
4
- import { u as useWalletDetails, i as images, W as WalletIcon, F as FormatCryptoValue, f as formatNumber, j as fixString, O as formatNumberWithGrouping } from "./useRegisterError-W_UfecIN.js";
5
- import { useAccount, useBalance } from "wagmi";
6
- import "@dynamic-labs/sdk-react-core";
7
- import { c as convertNative, r as restrictChars } from "./index-m2O0cbD8.js";
8
- import { a as Skeleton } from "./shareicon-C88Wx-AM.js";
9
- function InputComp({ amount, setAmount, fetchBalance, getCoinBalance, isBalanceLoading }) {
10
- var _a, _b;
11
- const configuration = useStore((state) => state.configuration);
12
- const fromCoin = useStore((state) => state.fromCoin);
13
- const fromChain = useStore((state) => state.fromChain);
14
- const { isAnyWalletConnected } = useWalletDetails({ chainData: fromChain });
15
- const [inputWidth, setInputWidth] = useState(40);
16
- const { address } = useAccount();
17
- const inputContainerRef = useRef();
18
- const { defaultCoin } = images;
19
- useBalance({
20
- address,
21
- token: convertNative((fromCoin == null ? void 0 : fromCoin.address) || ""),
22
- chainId: Number((fromChain == null ? void 0 : fromChain.chainId) || 0),
23
- enabled: (fromChain == null ? void 0 : fromChain.networkType) == "evm" ? true : false
24
- });
25
- const inputRef = useRef();
26
- const selectedCoinbalance = getCoinBalance;
27
- return /* @__PURE__ */ jsxs("div", { className: " bw-mb-5 bw-mt-4", children: [
28
- /* @__PURE__ */ jsxs("p", { className: "bw-text-sm bw-text-left bw-font-medium bw-mb-1 bw-text-text-secondary", children: [
29
- "Give ",
30
- (fromCoin == null ? void 0 : fromCoin.name) || ""
31
- ] }),
32
- /* @__PURE__ */ jsxs(
33
- "div",
34
- {
35
- style: {
36
- boxShadow: configuration && configuration.customTheme && ((_b = (_a = configuration.customTheme) == null ? void 0 : _a.shadow) == null ? void 0 : _b.boxShadow) || "1px 1px 7px rgba(0, 0, 0, 0.15)"
37
- },
38
- className: "bw-w-full bw-h-[80px] bw-flex bw-gap-x-1 bw-items-center bw-px-2 bw-bg-background-card bw-rounded-md bw-border bw-border-border-primary",
39
- children: [
40
- /* @__PURE__ */ jsxs("div", { className: "bw-w-full bw-flex bw-gap-x-2 bw-mt-5 bw-items-start bw-h-full", children: [
41
- /* @__PURE__ */ jsx("div", { className: " bw-flex bw-items-center", children: (fromCoin == null ? void 0 : fromCoin.image) ? /* @__PURE__ */ jsx("div", { className: "bw-rounded-[50%] bw-bg-background-coin bw-min-w-[40px] bw-w-[40px] bw-min-h-[40px] bw-flex bw-justify-center bw-items-center bw-border bw-border-border-primary", children: /* @__PURE__ */ jsx("img", { src: fromCoin == null ? void 0 : fromCoin.image, width: 39, height: 39, alt: "img", className: "bw-rounded-[50%] bw-max-w-[39px] bw-max-h-[39px] bw-object-contain bw-min-w-[39px] bw-min-h-[39px]" }) }) : /* @__PURE__ */ jsx("div", { className: "bw-min-w-[40px] bw-w-[40px] bw-border bw-border-border-primary bw-min-h-[40px] bw-rounded-[50%] ", children: /* @__PURE__ */ jsx("img", { src: defaultCoin, width: 39, height: 39, alt: "img", className: "bw-rounded-[50%] bw-min-w-[38px] bw-min-h-[39px]" }) }) }),
42
- /* @__PURE__ */ jsxs("div", { className: "bw-w-full", children: [
43
- /* @__PURE__ */ jsx(
44
- "div",
45
- {
46
- onClick: () => {
47
- inputRef.current.focus();
48
- },
49
- className: " ",
50
- children: /* @__PURE__ */ jsxs("div", { children: [
51
- /* @__PURE__ */ jsxs("span", { className: "bw-invisible bw-absolute", ref: inputContainerRef, children: [
52
- amount,
53
- "0"
54
- ] }),
55
- /* @__PURE__ */ jsx(
56
- "input",
57
- {
58
- ref: inputRef,
59
- pattern: "[0-9]*",
60
- inputMode: "decimal",
61
- autoFocus: true,
62
- onWheel: (e) => e.target.blur(),
63
- type: "number",
64
- value: amount,
65
- onChange: (e) => {
66
- let val = e.target.value;
67
- if (val.length <= 11) setAmount(val);
68
- },
69
- onKeyDown: (e) => {
70
- restrictChars(e);
71
- },
72
- placeholder: "0.0",
73
- className: "bw-text-3xl bw-border-none focus:bw-placeholder:bw-opacity-0 placeholder:bw-text-left bw-h-[36px] bw-ml-auto bw-mb-1 bw-pl-1 bw-min-w-[45px] bw-max-w-[200px] bw-font-medium placeholder:bw-text-text-placeholder bw-text-text-primary bw-bg-transparent"
74
- }
75
- )
76
- ] })
77
- }
78
- ),
79
- /* @__PURE__ */ jsx("div", { children: fromCoin.coin.length && isAnyWalletConnected ? isBalanceLoading ? /* @__PURE__ */ jsx(Skeleton, { className: "bw-bg-background-loaderbar bw-rounded-md bw-h-[18px] bw-w-[100px]" }) : /* @__PURE__ */ jsxs("div", { className: "bw-flex bw-items-center bw-gap-x-1", children: [
80
- /* @__PURE__ */ jsx(WalletIcon, { fill: "var(--tw-text-secondary)" }),
81
- /* @__PURE__ */ jsx("p", { className: "bw-text-xs bw-font-medium bw-text-text-secondary", children: /* @__PURE__ */ jsx(
82
- FormatCryptoValue,
83
- {
84
- value: formatNumber(selectedCoinbalance),
85
- options: {
86
- maxDecimals: 10
87
- }
88
- }
89
- ) }),
90
- /* @__PURE__ */ jsx(
91
- "button",
92
- {
93
- className: "bw-text-xs bw-font-normal bw-min-w-[37px] bw-h-[18px] bw-rounded-[4px] bw-px-1 bw-border bw-border-border-primary bw-text-text-secondary",
94
- onClick: () => {
95
- setAmount(fixString(formatNumber(selectedCoinbalance), 10));
96
- },
97
- children: "MAX"
98
- }
99
- )
100
- ] }) : /* @__PURE__ */ jsx(Fragment, {}) })
101
- ] })
102
- ] }),
103
- /* @__PURE__ */ jsx("div", { className: "bw-flex bw-justify-between bw-items-center", children: /* @__PURE__ */ jsx("div", { className: "bw-flex bw-items-center bw-gap-x-1", children: /* @__PURE__ */ jsxs("p", { className: ` bw-font-normal bw-pl-2 ${amount.length ? "bw-text-text-secondary bw-text-sm" : "bw-text-text-placeholder bw-text-[10px]"}`, children: [
104
- "$",
105
- fixString(formatNumberWithGrouping(amount * (fromCoin == null ? void 0 : fromCoin.lastPrice)), 10)
106
- ] }) }) })
107
- ]
108
- }
109
- )
110
- ] });
111
- }
112
- export {
113
- InputComp as default
114
- };
@@ -1,142 +0,0 @@
1
- import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
- import { t as truncate } from "./truncate-DSxFWEga.js";
3
- import { u as useStore, l as lodashExports } from "./index-D5OnT-__.js";
4
- import { useState, useEffect } from "react";
5
- import { s as styles } from "./WidgetForm.module-DhUUlwZP.js";
6
- import { G as Gas, C as ClockIcon, S as Step } from "./clockIcon-jSNFFrLy.js";
7
- import { S as Spinner } from "./down-DDk8OoJG.js";
8
- import { e as ethertousd } from "./ethertousd-BOknTgU4.js";
9
- import { O as OutputValueComp } from "./index-CF9p4S_X.js";
10
- import { O as formatNumberWithGrouping, F as FormatCryptoValue, i as images } from "./useRegisterError-W_UfecIN.js";
11
- import { a as Skeleton } from "./shareicon-C88Wx-AM.js";
12
- function B({ fill }) {
13
- return /* @__PURE__ */ jsx(
14
- "svg",
15
- {
16
- width: "14",
17
- height: "13",
18
- viewBox: "0 0 14 13",
19
- fill: "none",
20
- xmlns: "http://www.w3.org/2000/svg",
21
- children: /* @__PURE__ */ jsx(
22
- "path",
23
- {
24
- d: "M8.96762 0.608257C9.75204 0.81844 10.4162 1.32448 10.8223 2.02798C11.1795 2.64657 11.3164 3.35994 11.2014 4.05707C11.8556 4.29389 12.405 4.76918 12.7621 5.38777L12.7691 5.3999C13.1753 6.10339 13.2814 6.93156 13.0713 7.71597C12.8611 8.50039 12.355 9.16451 11.6515 9.57067L6.18127 12.7289C5.64759 13.0371 4.95884 12.8525 4.65071 12.3188C4.34259 11.7851 4.52714 11.0964 5.06083 10.7883L10.5311 7.63C10.9192 7.40591 11.0525 6.90848 10.8284 6.52034L10.8214 6.50821C10.5973 6.12008 10.0999 5.98679 9.71177 6.21088L4.2415 9.36915C3.70781 9.67727 3.01906 9.49272 2.71094 8.95903C2.39581 8.41322 2.58736 7.7366 3.12105 7.42847L8.59132 4.27021C8.97946 4.04612 9.11274 3.54869 8.88165 3.14842C8.65756 2.76029 8.16013 2.627 7.77199 2.85109L2.30172 6.00936C1.76804 6.31748 1.08629 6.14506 0.771161 5.59924C0.463038 5.06556 0.647589 4.37681 1.18127 4.06868L6.65155 0.910419C7.35504 0.504257 8.18321 0.398074 8.96762 0.608257Z",
25
- fill,
26
- "fill-opacity": "1"
27
- }
28
- )
29
- }
30
- );
31
- }
32
- function LoadRoute({ routes, handleShowAllRoutes, routesData, price, amount, isRoutesEnabled }) {
33
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
34
- const data = routes.data;
35
- const [gasData, setGasData] = useState();
36
- const gradient = useStore((state) => state.gradient);
37
- const configuration = useStore((state) => state.configuration);
38
- const fromChain = useStore((state) => state.fromChain);
39
- const fromCoin = useStore((state) => state.fromCoin);
40
- const toChain = useStore((state) => state.toChain);
41
- const toCoin = useStore((state) => state.toCoin);
42
- const { defaultCoin } = images;
43
- useEffect(() => {
44
- var _a2;
45
- if (routesData) {
46
- let tempGasObj = { amountInUSD: 0, amountInNative: 0 };
47
- let token = {};
48
- (_a2 = routesData == null ? void 0 : routesData.fee) == null ? void 0 : _a2.forEach((item) => {
49
- if (item.source == "FROM_SOURCE_WALLET") {
50
- tempGasObj.amountInUSD += Number(item.amountInUSD);
51
- tempGasObj.amountInNative += Number(ethertousd(item.amountInToken, item.token.decimals));
52
- token = { ...item };
53
- }
54
- });
55
- setGasData({ tempGasObj, token });
56
- }
57
- }, [routesData]);
58
- let outputVal = (routesData == null ? void 0 : routesData.outputAmountDisplay) || "";
59
- let formatedPrice = formatNumberWithGrouping(price);
60
- let logoUrl = ((_b = (_a = routesData == null ? void 0 : routesData.providerDetails) == null ? void 0 : _a.logoUrl) == null ? void 0 : _b.length) ? (_c = routesData == null ? void 0 : routesData.providerDetails) == null ? void 0 : _c.logoUrl : defaultCoin;
61
- return /* @__PURE__ */ jsx("div", { className: "bw-mt-2", children: !(((_d = fromChain == null ? void 0 : fromChain.chain) == null ? void 0 : _d.length) && ((_e = fromCoin == null ? void 0 : fromCoin.coin) == null ? void 0 : _e.length) && ((_f = toChain == null ? void 0 : toChain.chain) == null ? void 0 : _f.length) && ((_g = toCoin == null ? void 0 : toCoin.coin) == null ? void 0 : _g.length) && amount.length && isRoutesEnabled) ? /* @__PURE__ */ jsx(Fragment, {}) : routes.isSuccess && !((_j = (_i = (_h = routes.data) == null ? void 0 : _h.data) == null ? void 0 : _i.quotes) == null ? void 0 : _j.length) ? /* @__PURE__ */ jsx("div", { className: "bw-bg-background-container bw-text-text-secondary bw-flex bw-justify-center bw-items-center bw-h-[80px] bw-relative bw-flex-col bw-border bw-border-border-primary", children: "No Routes Available" }) : routes.isSuccess || routes.isLoading || routes.isFetching ? /* @__PURE__ */ jsxs("div", { children: [
62
- /* @__PURE__ */ jsxs("div", { className: "bw-flex bw-items-center bw-justify-between", children: [
63
- " ",
64
- /* @__PURE__ */ jsxs("p", { className: "bw-text-sm bw-font-medium bw-text-text-secondary", children: [
65
- "Get ",
66
- toCoin.name
67
- ] }),
68
- !routes.isFetching ? /* @__PURE__ */ jsx("div", { onClick: handleShowAllRoutes, style: { ...configuration.gradientStyle }, className: `bw-w-[130px] bw-cursor-pointer bw-relative bw-p-[1px] bw-text-transparent bw-text-sm bw-font-normal bw-h-[18px] bw-rounded-xl ${gradient ? gradient : `${styles.overlayshow} ${!((_k = configuration.gradientStyle) == null ? void 0 : _k.background) ? "bw-bg-gradient-to-r bw-from-[#A45EFF] bw-to-[#2CFFE4]" : ""}`}`, children: /* @__PURE__ */ jsx("div", { className: " bw-w-full bw-h-full bw-text-text-secondary bw-relative bw-z-10 bw-bg-background-container bw-flex bw-justify-center bw-items-center bw-text-xs bw-font-normal bw-rounded-xl", children: "Show All Routes" }) }) : /* @__PURE__ */ jsx(Fragment, {})
69
- ] }),
70
- /* @__PURE__ */ jsxs("div", { className: " bw-mt-2", children: [
71
- /* @__PURE__ */ jsxs("div", { style: !routes.isFetching ? { ...configuration.gradientStyle } : {}, className: ` ${routes.isFetching ? "bw-bg-background-secondary" : ` ${gradient ? gradient : `${!((_l = configuration.gradientStyle) == null ? void 0 : _l.background) ? "bw-bg-gradient-to-r bw-from-[#A45EFF] bw-to-[#2CFFE4]" : ""} ${styles.overlay}`} `} bw-relative bw-flex bw-justify-center bw-rounded-[8px] bw-w-full bw-p-[1px] bw-h-[86px] `, children: [
72
- /* @__PURE__ */ jsxs("div", { className: "bw-w-full bw-h-full bw-flex bw-px-2 bw-pb-3 bw-items-center bw-justify-between bw-bg-background-card rbw-elative bw-z-10 bw-rounded-[8px]", children: [
73
- /* @__PURE__ */ jsxs("div", { className: "bw-flex bw-items-start bw-gap-x-2", children: [
74
- (toCoin == null ? void 0 : toCoin.image) && !routes.isFetching ? /* @__PURE__ */ jsx("img", { src: toCoin.image, width: 30, height: 30, className: "bw-mt-1 bw-max-w-[30px] bw-max-h-[30px] bw-object-contain bw-bg-background-coin bw-rounded-[50%]" }) : /* @__PURE__ */ jsx(Fragment, {}),
75
- /* @__PURE__ */ jsxs("div", { children: [
76
- !routes.isFetching ? /* @__PURE__ */ jsx("p", { className: "bw-text-3xl bw-mb-1 bw-font-medium bw-text-text-primary", children: /* @__PURE__ */ jsx(OutputValueComp, { value: outputVal, decimal: 12 }) }) : /* @__PURE__ */ jsx(Skeleton, { className: "bw-bg-background-loaderbar bw-mt-3 bw-rounded-sm bw-h-[36px] bw-min-h-[36px]", animation: "wave", variant: "rectangular", height: 36, width: 250 }),
77
- !routes.isFetching ? /* @__PURE__ */ jsxs("div", { className: "bw-flex bw-items-center bw-gap-x-1", children: [
78
- /* @__PURE__ */ jsx(Gas, { fill: "var(--tw-text-primary)" }),
79
- /* @__PURE__ */ jsxs("p", { className: "bw-text-sm bw-font-medium bw-text-text-primary", children: [
80
- "Total Fee:",
81
- ` $`,
82
- /* @__PURE__ */ jsx(FormatCryptoValue, { value: ((_m = gasData == null ? void 0 : gasData.tempGasObj) == null ? void 0 : _m.amountInUSD) || 0, options: { maxDecimals: 8 } }),
83
- ` (`,
84
- /* @__PURE__ */ jsx(FormatCryptoValue, { value: ((_n = gasData == null ? void 0 : gasData.tempGasObj) == null ? void 0 : _n.amountInNative) || 0, options: { maxDecimals: 8 } }),
85
- ` ${((_p = (_o = gasData == null ? void 0 : gasData.token) == null ? void 0 : _o.token) == null ? void 0 : _p.symbol) || ""})`
86
- ] })
87
- ] }) : /* @__PURE__ */ jsx(Skeleton, { className: "bw-bg-background-loaderbar bw-mt-2 bw-rounded-sm bw-h-[20px] bw-w-[100px] bw-min-h-[20px]", variant: "rectangular", animation: "wave", height: 20, width: 100 })
88
- ] })
89
- ] }),
90
- /* @__PURE__ */ jsxs("div", { className: " bw-text-sm bw-font-medium bw-mt-2 bw-text-text-loaderbar ", children: [
91
- !routes.isFetching ? /* @__PURE__ */ jsxs("p", { className: "bw-text-text-secondary bw-font-medium bw-text-sm", children: [
92
- "$",
93
- /* @__PURE__ */ jsx(OutputValueComp, { value: formatedPrice, decimal: 8 })
94
- ] }) : /* @__PURE__ */ jsx(Skeleton, { className: "bw-bg-background-loaderbar bw-w-[50px] bw-rounded-sm bw-h-[20px] bw-min-h-[20px]", variant: "rectangular", animation: "wave", height: 20, width: 50 }),
95
- !routes.isFetching ? ((_s = (_r = (_q = data == null ? void 0 : data.data) == null ? void 0 : _q.quotes) == null ? void 0 : _r[0]) == null ? void 0 : _s._id) === routesData._id ? /* @__PURE__ */ jsx("div", { style: { ...configuration.gradientStyle }, className: `${gradient ? gradient : `${!((_t = configuration.gradientStyle) == null ? void 0 : _t.background) ? "bw-bg-gradient-to-r bw-from-[#A45EFF] bw-to-[#2CFFE4]" : ""} `} bw-mt-3 bw-text-right bw-text-transparent bw-text-[10px] bw-font-bold bw-bg-clip-text ${styles.gradienttext}`, children: "BEST" }) : /* @__PURE__ */ jsx(Fragment, {}) : /* @__PURE__ */ jsx(Skeleton, { className: "bw-bg-background-loaderbar bw-w-[50px] bw-mt-2 bw-rounded-sm bw-h-[20px] bw-min-h-[20px] ", variant: "rectangular", animation: "wave", height: 20, width: 50 })
96
- ] })
97
- ] }),
98
- routes.isFetching ? /* @__PURE__ */ jsx("div", { className: "bw-absolute bw-w-[40px] bw-h-[40px] bw-bottom-[-35%] bw-z-20 ", children: /* @__PURE__ */ jsx(Spinner, {}) }) : /* @__PURE__ */ jsx(Fragment, {}),
99
- /* @__PURE__ */ jsxs("div", { className: "bw-h-[18px] bw-w-max bw-z-10 bw-min-w-[200px] bw-bg-background-card bw-flex bw-items-center bw-absolute bw-bottom-[-10%]", children: [
100
- !routes.isFetching && !lodashExports.isEmpty(routesData) ? /* @__PURE__ */ jsxs("div", { className: "bw-flex bw-w-full bw-px-6 bw-items-center bw-gap-x-1", children: [
101
- " ",
102
- /* @__PURE__ */ jsxs("p", { className: "bw-text-sm bw-w-full bw-text-center bw-flex bw-justify-center bw-items-center bw-font-normal bw-my-1 bw-text-text-secondary", children: [
103
- /* @__PURE__ */ jsx("span", { className: "bw-text-sm bw-font-light", children: "via" }),
104
- " ",
105
- /* @__PURE__ */ jsx("img", { src: logoUrl, className: "bw-rounded-[50%] bw-mx-[4px] bw-min-w-[18px] bw-max-h-[18px] bw-min-h-[18px]", width: 18, height: 18 }),
106
- ((_u = routesData == null ? void 0 : routesData.providerDetails) == null ? void 0 : _u.name) || "",
107
- ": ",
108
- routesData == null ? void 0 : routesData.protocolsUsed[0],
109
- ((_v = routesData == null ? void 0 : routesData.protocolsUsed) == null ? void 0 : _v.length) <= 1 ? "" : /* @__PURE__ */ jsxs("span", { className: "bw-ml-1 bw-text-xs bw-font-normal", children: [
110
- `+${((_w = routesData == null ? void 0 : routesData.protocolsUsed) == null ? void 0 : _w.length) - 1}`,
111
- " More"
112
- ] }),
113
- " "
114
- ] }),
115
- " "
116
- ] }) : /* @__PURE__ */ jsx(Fragment, {}),
117
- /* @__PURE__ */ jsx("div", { style: !routes.isFetching ? { ...configuration.gradientStyle } : {}, className: ` ${routes.isFetching ? "bw-bg-background-secondary" : ` ${gradient ? gradient : ` ${styles.overlay} ${!((_x = configuration == null ? void 0 : configuration.gradientStyle) == null ? void 0 : _x.background) ? "bw-bg-gradient-to-r bw-from-[#A45EFF] bw-to-[#2CFFE4]" : ""}`}`} bw-absolute bw-right-0 bw-rounded-[50%] bw-w-[4px] bw-h-[4px] ` }),
118
- /* @__PURE__ */ jsx("div", { style: !routes.isFetching ? { ...configuration.gradientStyle } : {}, className: ` ${routes.isFetching ? "bw-bg-background-secondary" : ` ${gradient ? gradient : ` ${styles.overlay} ${!((_y = configuration == null ? void 0 : configuration.gradientStyle) == null ? void 0 : _y.background) ? "bw-bg-gradient-to-r bw-from-[#A45EFF] bw-to-[#2CFFE4]" : ""}`}`} bw-absolute bw-rounded-[50%] bw-w-[4px] bw-h-[4px] ` })
119
- ] })
120
- ] }),
121
- /* @__PURE__ */ jsx("div", { className: "bw-bg-background-card bw-flex bw-items-center bw-w-[85%] bw-mx-auto bw-rounded-b-md bw-justify-center bw-h-[60px]", children: !routes.isFetching ? /* @__PURE__ */ jsxs("div", { className: "bw-flex bw-items-center bw-gap-x-4 bw-mt-2 bw-bg-background-card bw-justify-center ", children: [
122
- /* @__PURE__ */ jsxs("div", { className: "bw-flex bw-items-center bw-gap-x-1", children: [
123
- /* @__PURE__ */ jsx(B, { fill: "var(--tw-text-secondary)" }),
124
- /* @__PURE__ */ jsx("p", { className: "bw-text-sm bw-font-medium bw-text-text-secondary", children: "Fee" }),
125
- /* @__PURE__ */ jsx("p", { className: "bw-text-sm bw-line-through bw-font-medium bw-text-text-secondary", children: "0.1%" }),
126
- /* @__PURE__ */ jsx("p", { className: "bw-text-sm bw-font-medium bw-text-text-secondary", children: "0" })
127
- ] }),
128
- /* @__PURE__ */ jsxs("div", { className: "bw-flex bw-items-center bw-gap-x-1", children: [
129
- /* @__PURE__ */ jsx(ClockIcon, { fill: "var(--tw-text-secondary)" }),
130
- /* @__PURE__ */ jsx("p", { className: "bw-text-sm bw-font-medium bw-text-text-secondary", children: (routesData == null ? void 0 : routesData.estimatedTimeInSeconds) >= 90 ? `${Math.round(truncate(((routesData == null ? void 0 : routesData.estimatedTimeInSeconds) || 60) / 60, 2) || 0)}min` : `${(routesData == null ? void 0 : routesData.estimatedTimeInSeconds) || 60} secs` })
131
- ] }),
132
- /* @__PURE__ */ jsxs("div", { className: " bw-gap-x-1 bw-flex bw-items-center bw-text-xs bw-font-normal bw-text-text-primary", children: [
133
- /* @__PURE__ */ jsx(Step, { fill: "var(--tw-text-secondary)" }),
134
- /* @__PURE__ */ jsx("p", { className: "bw-text-sm bw-font-medium bw-text-text-secondary", children: `${((_z = routesData == null ? void 0 : routesData.steps) == null ? void 0 : _z.length) || ""} step` })
135
- ] })
136
- ] }) : /* @__PURE__ */ jsx("div", { className: "bw-mt-6 bw-w-full bw-h-[20px]" }) })
137
- ] })
138
- ] }) : isRoutesEnabled ? /* @__PURE__ */ jsx("div", { className: "bw-bg-background-container bw-text-text-secondary bw-justify-center bw-items-center bw-h-[80px] bw-relative bw-flex bw-flex-col bw-border bw-border-border-primary", children: "Failed to load routes" }) : /* @__PURE__ */ jsx(Fragment, {}) });
139
- }
140
- export {
141
- LoadRoute as default
142
- };
@@ -1,29 +0,0 @@
1
- import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
- import { s as styles } from "./WidgetForm.module-DhUUlwZP.js";
3
- import { u as useStore, l as lodashExports } from "./index-D5OnT-__.js";
4
- function QuotesProgress({ routesData, routes, quoteTimer }) {
5
- var _a;
6
- const configuration = useStore((state) => state.configuration);
7
- const gradient = useStore((state) => state.gradient);
8
- return !lodashExports.isEmpty(routesData) && !routes.isFetching && routes.isSuccess ? /* @__PURE__ */ jsxs("div", { className: "bw-flex bw-items-center bw-gap-x-2 bw-justify-between", children: [
9
- /* @__PURE__ */ jsx("p", { className: "bw-text-sm bw-font-medium bw-text-text-secondary", children: "New Quote in" }),
10
- /* @__PURE__ */ jsx("div", { className: " bw-w-[250px] bw-flex-1 bw-bg-border-primary bw-h-[3px] bw-overflow-x-hidden", children: /* @__PURE__ */ jsx(
11
- "div",
12
- {
13
- style: {
14
- height: "100%",
15
- ...configuration.gradientStyle,
16
- width: `${100 - quoteTimer / routesData.deadline * 100}%`
17
- },
18
- className: ` ${gradient ? gradient : `${!((_a = configuration.gradientStyle) == null ? void 0 : _a.background) ? "bw-bg-gradient-to-r bw-from-[#A45EFF] bw-to-[#2CFFE4]" : ""} ${styles.overlay}`} bw-relative `
19
- }
20
- ) }),
21
- /* @__PURE__ */ jsxs("div", { style: { ...configuration.gradientStyle }, className: `${gradient ? `${gradient} bw-bg-clip-text bw-text-transparent` : styles.gradienttext} bw-relative bw-text-right bw-w-max bw-text-2xl bw-font-semibold bw-text-transparent `, children: [
22
- quoteTimer,
23
- "s"
24
- ] })
25
- ] }) : /* @__PURE__ */ jsx(Fragment, {});
26
- }
27
- export {
28
- QuotesProgress as default
29
- };
@@ -1,65 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import { u as useStore } from "./index-D5OnT-__.js";
3
- function SwapIcon({ fill1, fill2 }) {
4
- return /* @__PURE__ */ jsxs(
5
- "svg",
6
- {
7
- width: "37",
8
- height: "37",
9
- viewBox: "0 0 37 37",
10
- fill: "none",
11
- xmlns: "http://www.w3.org/2000/svg",
12
- children: [
13
- /* @__PURE__ */ jsx(
14
- "circle",
15
- {
16
- cx: "18.5027",
17
- cy: "18.6207",
18
- r: "18.2551",
19
- transform: "rotate(90 18.5027 18.6207)",
20
- fill: fill1
21
- }
22
- ),
23
- /* @__PURE__ */ jsx(
24
- "path",
25
- {
26
- d: "M14.3655 7.6488L7.58782 16.5705L28.9581 16.5705L28.9581 12.7663L14.3655 12.7663L14.3655 7.6488Z",
27
- fill: fill2,
28
- "fill-opacity": "1"
29
- }
30
- ),
31
- /* @__PURE__ */ jsx(
32
- "path",
33
- {
34
- d: "M22.2517 29.0189L29.0294 20.0972L7.65911 20.0972L7.65911 23.9014L22.2517 23.9014L22.2517 29.0189Z",
35
- fill: fill2,
36
- "fill-opacity": "1"
37
- }
38
- )
39
- ]
40
- }
41
- );
42
- }
43
- function SwapAsset({ handleSwap }) {
44
- var _a, _b;
45
- const fromCoin = useStore((state) => state.fromCoin);
46
- const toCoin = useStore((state) => state.toCoin);
47
- let isCoins = ((_a = fromCoin == null ? void 0 : fromCoin.coin) == null ? void 0 : _a.length) && ((_b = toCoin.coin) == null ? void 0 : _b.length);
48
- return /* @__PURE__ */ jsx(
49
- "div",
50
- {
51
- onClick: handleSwap,
52
- className: `${!isCoins ? "bw-pointer-events-none" : ""} bw-absolute hover:bw-scale-[0.95] bw-border bw-border-border-primary bw-rounded-[50%] bw-cursor-pointer bw-bg-background-container bw-top-[33%] bw-right-[45%] `,
53
- children: /* @__PURE__ */ jsx(
54
- SwapIcon,
55
- {
56
- fill1: "var(--tw-background-card)",
57
- fill2: isCoins ? "var(--tw-text-primary)" : "var(--tw-text-secondary)"
58
- }
59
- )
60
- }
61
- );
62
- }
63
- export {
64
- SwapAsset as default
65
- };