@aurora-is-near/intents-swap-widget 3.19.1 → 3.21.0

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 (111) hide show
  1. package/dist/components/BaseContainer.d.ts +2 -0
  2. package/dist/components/BaseContainer.js +23 -0
  3. package/dist/components/BaseContainer.js.map +1 -0
  4. package/dist/components/WidgetContainer.js +17 -18
  5. package/dist/components/WidgetContainer.js.map +1 -1
  6. package/dist/{config-CpXS2LPZ.js → config-CyBNYvb1.js} +833 -820
  7. package/dist/{config-CpXS2LPZ.js.map → config-CyBNYvb1.js.map} +1 -1
  8. package/dist/config.js +1 -1
  9. package/dist/errors.js +1 -1
  10. package/dist/ext/alchemy/index.js +1 -1
  11. package/dist/ext/index.js +1 -1
  12. package/dist/features/BalanceRpcLoader/TokenBalanceLoader.js +1 -1
  13. package/dist/features/BalanceRpcLoader/index.js +1 -1
  14. package/dist/features/BalanceRpcLoader/useTokenBalanceRpc.js +1 -1
  15. package/dist/features/ChainsDropdown/index.js +1 -1
  16. package/dist/features/ChainsSelector/index.js +1 -1
  17. package/dist/features/DepositMethodSwitcher.js +1 -1
  18. package/dist/features/ErrorBoundary.js +1 -1
  19. package/dist/features/ExternalDeposit.js +1 -1
  20. package/dist/features/SendAddress/index.js +1 -1
  21. package/dist/features/SendAddress/useNotification.js +1 -1
  22. package/dist/features/SubmitButton/index.js +1 -1
  23. package/dist/features/SuccessScreen/index.js +1 -1
  24. package/dist/features/SuccessScreen/useSummaryItemsCount.js +1 -1
  25. package/dist/features/SwapDirectionSwitcher.js +1 -1
  26. package/dist/features/SwapQuote/SwapQuote.js +1 -1
  27. package/dist/features/SwapQuote/index.js +1 -1
  28. package/dist/features/TokenInput/TokenInput.js +1 -1
  29. package/dist/features/TokenInput/TokenInputEmpty.js +1 -1
  30. package/dist/features/TokenInput/TokenInputSource.js +1 -1
  31. package/dist/features/TokenInput/TokenInputTarget.js +1 -1
  32. package/dist/features/TokenInput/WalletBalance.js +1 -1
  33. package/dist/features/TokenInput/hooks/index.js +1 -1
  34. package/dist/features/TokenInput/hooks/useTokenInputBalance.js +1 -1
  35. package/dist/features/TokenInput/index.js +1 -1
  36. package/dist/features/TokensList/TokenItem.js +1 -1
  37. package/dist/features/TokensList/TokensList.js +1 -1
  38. package/dist/features/TokensList/index.js +1 -1
  39. package/dist/features/TokensModal.js +1 -1
  40. package/dist/features/WalletCompatibilityCheck/WalletCompatibilityModal.js +1 -1
  41. package/dist/features/WalletCompatibilityCheck/index.js +1 -1
  42. package/dist/features/index.js +1 -1
  43. package/dist/hooks/index.js +1 -1
  44. package/dist/hooks/useAllTokens.js +1 -1
  45. package/dist/hooks/useChains.js +1 -1
  46. package/dist/hooks/useCompatibilityCheck.js +1 -1
  47. package/dist/hooks/useDefaultToken.js +1 -1
  48. package/dist/hooks/useExternalDepositStatus/index.js +1 -1
  49. package/dist/hooks/useExternalDepositStatus/usePoaExternalDepositStatus.js +1 -1
  50. package/dist/hooks/useIntentsBalance.js +1 -1
  51. package/dist/hooks/useIsCompatibilityCheckRequired.js +1 -1
  52. package/dist/hooks/useMakeDepositAddress.js +1 -1
  53. package/dist/hooks/useMakeIntentsTransfer.js +1 -1
  54. package/dist/hooks/useMakeNEARFtTransferCall.js +1 -1
  55. package/dist/hooks/useMakeQuote.js +1 -1
  56. package/dist/hooks/useMakeQuoteTransfer.js +1 -1
  57. package/dist/hooks/useMakeTransfer.js +1 -1
  58. package/dist/hooks/useMergedBalance.js +1 -1
  59. package/dist/hooks/useSwitchChain.js +1 -1
  60. package/dist/hooks/useTheme.js +1 -1
  61. package/dist/hooks/useTokenInputPair.js +1 -1
  62. package/dist/hooks/useTokens.js +1 -1
  63. package/dist/hooks/useTokensFiltered.js +1 -1
  64. package/dist/hooks/useTokensIntentsUnique.js +1 -1
  65. package/dist/index.js +1 -1
  66. package/dist/machine/effects/index.js +1 -1
  67. package/dist/machine/effects/useAlchemyBalanceEffect.js +1 -1
  68. package/dist/machine/effects/useBalancesUpdateEffect.js +1 -1
  69. package/dist/machine/effects/useMakeQuoteEffect.js +1 -1
  70. package/dist/machine/effects/useSelectedTokensEffect.js +1 -1
  71. package/dist/machine/effects/useSetTokenBalanceEffect.js +1 -1
  72. package/dist/machine/effects/useSetTokenIntentsTargetEffect.js +1 -1
  73. package/dist/machine/effects/useWalletConnEffect.js +1 -1
  74. package/dist/machine/events/index.js +1 -1
  75. package/dist/machine/events/tokenSelect.js +1 -1
  76. package/dist/machine/events/validateInputAndMoveTo.js +1 -1
  77. package/dist/machine/events/validateInputs.js +1 -1
  78. package/dist/machine/index.js +1 -1
  79. package/dist/machine/snap.js +1 -1
  80. package/dist/machine/subscriptions/checkers/isSendAddressAsConnected.js +1 -1
  81. package/dist/machine/subscriptions/index.js +1 -1
  82. package/dist/styles.css +1 -1
  83. package/dist/tailwind.css +3 -1
  84. package/dist/theme/ThemeProvider.js +1 -1
  85. package/dist/theme.css +10 -5
  86. package/dist/types/theme.d.ts +6 -0
  87. package/dist/utils/intents/signers/near.js +1 -1
  88. package/dist/utils/intents/signers/privy.js +1 -1
  89. package/dist/utils/near/getNearNep141StorageBalance.js +1 -1
  90. package/dist/widgets/WidgetDeposit/WidgetDepositContent.js +1 -1
  91. package/dist/widgets/WidgetDeposit/WidgetDepositSkeleton.js +1 -1
  92. package/dist/widgets/WidgetDeposit/index.js +15 -14
  93. package/dist/widgets/WidgetDeposit/index.js.map +1 -1
  94. package/dist/widgets/WidgetSwap/WidgetSwapContent.js +1 -1
  95. package/dist/widgets/WidgetSwap/WidgetSwapSkeleton.js +1 -1
  96. package/dist/widgets/WidgetSwap/index.js +15 -14
  97. package/dist/widgets/WidgetSwap/index.js.map +1 -1
  98. package/dist/widgets/WidgetWithdraw/WidgetWithdrawContent.js +1 -1
  99. package/dist/widgets/WidgetWithdraw/WidgetWithdrawSkeleton.js +1 -1
  100. package/dist/widgets/WidgetWithdraw/index.js +13 -12
  101. package/dist/widgets/WidgetWithdraw/index.js.map +1 -1
  102. package/package.json +1 -1
  103. package/src/components/BaseContainer.tsx +19 -0
  104. package/src/components/WidgetContainer.tsx +0 -1
  105. package/src/tailwind.css +3 -1
  106. package/src/theme/ThemeProvider.tsx +52 -8
  107. package/src/theme.css +10 -5
  108. package/src/types/theme.ts +8 -0
  109. package/src/widgets/WidgetDeposit/index.tsx +10 -7
  110. package/src/widgets/WidgetSwap/index.tsx +10 -7
  111. package/src/widgets/WidgetWithdraw/index.tsx +10 -7
@@ -1,88 +1,88 @@
1
- import { p as lt } from "./index-xuotMAFm.js";
2
- import { jsx as o, jsxs as T, Fragment as Ht } from "react/jsx-runtime";
3
- import Gt from "i18next";
4
- import { deepClone as ke } from "valtio/utils";
5
- import { snapshot as Ee, useSnapshot as me, proxy as dt } from "valtio";
6
- import { HelmetProvider as jt, Helmet as zt } from "react-helmet-async";
7
- import { memo as Yt, useEffect as R, useMemo as L, useRef as Z, useCallback as ce, useState as ne, useId as Xt, createContext as ut, useContext as Zt } from "react";
8
- import { useQuery as Re, useInfiniteQuery as Jt, useQueryClient as en, QueryClient as tn, QueryClientProvider as nn } from "@tanstack/react-query";
9
- import { Trans as rn, I18nextProvider as sn } from "react-i18next";
10
- import { useTypedTranslation as K, initLocalisation as an } from "./localisation.js";
1
+ import { p as dt } from "./index-xuotMAFm.js";
2
+ import { jsx as o, jsxs as T, Fragment as Gt } from "react/jsx-runtime";
3
+ import jt from "i18next";
4
+ import { deepClone as Se } from "valtio/utils";
5
+ import { snapshot as Re, useSnapshot as fe, proxy as ut } from "valtio";
6
+ import { HelmetProvider as zt, Helmet as Yt } from "react-helmet-async";
7
+ import { memo as Xt, useEffect as C, useMemo as L, useRef as Z, useCallback as ce, useState as re, useId as Zt, createContext as mt, useContext as Jt } from "react";
8
+ import { useQuery as ve, useInfiniteQuery as en, useQueryClient as tn, QueryClient as nn, QueryClientProvider as rn } from "@tanstack/react-query";
9
+ import { Trans as sn, I18nextProvider as an } from "react-i18next";
10
+ import { useTypedTranslation as K, initLocalisation as on } from "./localisation.js";
11
11
  import { logger as E } from "./logger.js";
12
- import { getTonTokenBalance as on } from "./utils/ton/getTonTokenBalance.js";
12
+ import { getTonTokenBalance as ln } from "./utils/ton/getTonTokenBalance.js";
13
13
  import { getSolanaTokenBalance as cn } from "./utils/solana/getSolanaTokenBalance.js";
14
- import { useWalletAddressForToken as mt } from "./hooks/useWalletAddressForToken.js";
14
+ import { useWalletAddressForToken as ft } from "./hooks/useWalletAddressForToken.js";
15
15
  import "@headlessui/react";
16
16
  import "@material-symbols-svg/react-rounded/icons/chevron-left";
17
17
  import "framer-motion";
18
18
  import "./features/ChainsDropdown/ChainItem.js";
19
19
  import { cn as H } from "./utils/cn.js";
20
- import { OneClickService as ln, QuoteRequest as W, GetExecutionStatusResponse as te } from "@defuse-protocol/one-click-sdk-typescript";
21
- import { CHAINS_LIST as ft, DEFAULT_CHAINS_ORDER as pt, CHAIN_POA_MAP as ht, POA_EVM_CHAIN_ID as Tt, CHAIN_BASE_TOKENS as dn, EVM_CHAIN_IDS_MAP as Ae, CHAIN_IDS_MAP as un, EVM_CHAINS as mn } from "./constants/chains.js";
20
+ import { OneClickService as dn, QuoteRequest as W, GetExecutionStatusResponse as te } from "@defuse-protocol/one-click-sdk-typescript";
21
+ import { CHAINS_LIST as pt, DEFAULT_CHAINS_ORDER as ht, CHAIN_POA_MAP as Tt, POA_EVM_CHAIN_ID as gt, CHAIN_BASE_TOKENS as un, EVM_CHAIN_IDS_MAP as Ne, CHAIN_IDS_MAP as mn, EVM_CHAINS as fn } from "./constants/chains.js";
22
22
  import "use-debounce";
23
23
  import "@material-symbols-svg/react-rounded/icons/wand-shine";
24
- import { derive as fn } from "derive-valtio";
25
- import { getIsNativeNearDeposit as pn } from "./machine/computed/getIsNativeNearDeposit.js";
26
- import { getIsDirectTokenOnNearDeposit as hn } from "./machine/computed/getIsDirectTokenOnNearDeposit.js";
24
+ import { derive as pn } from "derive-valtio";
25
+ import { getIsNativeNearDeposit as hn } from "./machine/computed/getIsNativeNearDeposit.js";
26
+ import { getIsDirectTokenOnNearDeposit as Tn } from "./machine/computed/getIsDirectTokenOnNearDeposit.js";
27
27
  import "ethers";
28
28
  import { moveTo as F, machine as ee } from "./machine/machine.js";
29
- import Tn from "lodash.once";
29
+ import gn from "lodash.once";
30
30
  import { guardStates as O } from "./machine/guards/index.js";
31
- import { parse as gn } from "./ext/alchemy/parse.js";
32
- import { createLoader as In } from "./ext/alchemy/load.js";
33
- import { isAlchemySupportedChain as wn } from "./ext/alchemy/types.js";
31
+ import { parse as In } from "./ext/alchemy/parse.js";
32
+ import { createLoader as wn } from "./ext/alchemy/load.js";
33
+ import { isAlchemySupportedChain as kn } from "./ext/alchemy/types.js";
34
34
  import { fireEvent as h } from "./machine/events/utils/fireEvent.js";
35
- import { NATIVE_NEAR_DUMB_ASSET_ID as j, TOKENS_DATA as Ce, WNEAR_ASSET_ID as Se } from "./constants/tokens.js";
36
- import { isValidChain as kn } from "./utils/checkers/isValidChain.js";
37
- import { useWalletBalance as ve } from "./hooks/useWalletBalance.js";
38
- import { getIntentsAccountId as re } from "./utils/intents/getIntentsAccountId.js";
39
- import { getIntentsBalances as An } from "./utils/intents/getIntentsBalance.js";
40
- import { notReachable as De } from "./utils/notReachable.js";
35
+ import { NATIVE_NEAR_DUMB_ASSET_ID as j, TOKENS_DATA as De, WNEAR_ASSET_ID as _e } from "./constants/tokens.js";
36
+ import { isValidChain as An } from "./utils/checkers/isValidChain.js";
37
+ import { useWalletBalance as xe } from "./hooks/useWalletBalance.js";
38
+ import { getIntentsAccountId as se } from "./utils/intents/getIntentsAccountId.js";
39
+ import { getIntentsBalances as Sn } from "./utils/intents/getIntentsBalance.js";
40
+ import { notReachable as Oe } from "./utils/notReachable.js";
41
41
  import { getTokenBalanceKey as Y } from "./utils/intents/getTokenBalanceKey.js";
42
- import { isDryQuote as xe } from "./machine/guards/checks/isDryQuote.js";
43
- import { snakeCase as gt } from "change-case";
44
- import Sn, { CanceledError as It, AxiosError as wt } from "axios";
45
- import { oneClickApi as Ne, bridgeApi as kt } from "./network.js";
42
+ import { isDryQuote as Fe } from "./machine/guards/checks/isDryQuote.js";
43
+ import { snakeCase as It } from "change-case";
44
+ import Nn, { CanceledError as wt, AxiosError as kt } from "axios";
45
+ import { oneClickApi as ye, bridgeApi as At } from "./network.js";
46
46
  import { formatBigToHuman as X } from "./utils/formatters/formatBigToHuman.js";
47
- import { getDryQuoteAddress as Ge } from "./utils/getDryQuoteAddress.js";
47
+ import { getDryQuoteAddress as ze } from "./utils/getDryQuoteAddress.js";
48
48
  import { isEvmChain as G } from "./utils/evm/isEvmChain.js";
49
- import { checkNearAccountExists as Nn } from "./utils/near/checkNearAccountExists.js";
50
- import { isNotEmptyAmount as se } from "./utils/checkers/isNotEmptyAmount.js";
51
- import { isValidBigint as At } from "./utils/checkers/isValidBigint.js";
52
- import { isNearAddress as St } from "./utils/near/isNearAddress.js";
53
- import { isBalanceSufficient as Oe } from "./machine/guards/checks/isBalanceSufficient.js";
54
- import { isQuoteError as Fe, isTransferError as Le, isAsyncSendAddressValidationError as _n } from "./machine/errors.js";
55
- import { isSolanaAddress as Nt } from "./utils/solana/isSolanaAddress.js";
56
- import { isEvmAddress as _t } from "./utils/evm/isEvmAddress.js";
57
- import { getMainTokenByChain as yn } from "./utils/tokens/getMainTokenByChain.js";
58
- import { getDefaultIntentsToken as bn } from "./utils/tokens/getDefaultIntentsToken.js";
59
- import { getTokenWithHighBalance as En } from "./utils/tokens/getTokenWithHighBalance.js";
49
+ import { checkNearAccountExists as _n } from "./utils/near/checkNearAccountExists.js";
50
+ import { isNotEmptyAmount as ae } from "./utils/checkers/isNotEmptyAmount.js";
51
+ import { isValidBigint as St } from "./utils/checkers/isValidBigint.js";
52
+ import { isNearAddress as Nt } from "./utils/near/isNearAddress.js";
53
+ import { isBalanceSufficient as Le } from "./machine/guards/checks/isBalanceSufficient.js";
54
+ import { isQuoteError as Be, isTransferError as qe, isAsyncSendAddressValidationError as yn } from "./machine/errors.js";
55
+ import { isSolanaAddress as _t } from "./utils/solana/isSolanaAddress.js";
56
+ import { isEvmAddress as yt } from "./utils/evm/isEvmAddress.js";
57
+ import { getMainTokenByChain as bn } from "./utils/tokens/getMainTokenByChain.js";
58
+ import { getDefaultIntentsToken as En } from "./utils/tokens/getDefaultIntentsToken.js";
59
+ import { getTokenWithHighBalance as Cn } from "./utils/tokens/getTokenWithHighBalance.js";
60
60
  import { isQuoteIdle as Rn } from "./machine/subscriptions/checkers/isQuoteIdle.js";
61
- import { isInputChanged as Cn } from "./machine/subscriptions/checkers/isInputChanged.js";
62
- import { isErrorChanged as vn } from "./machine/subscriptions/checkers/isErrorChanged.js";
63
- import { isOnlyErrorChanged as Dn } from "./machine/subscriptions/checkers/isOnlyErrorChanged.js";
64
- import { isValidInitialState as xn } from "./machine/subscriptions/checkers/isValidInitialState.js";
65
- import { isWalletDisconnected as On } from "./machine/subscriptions/checkers/isWalletDisconnected.js";
66
- import { isSendAddressForbidden as Fn } from "./machine/subscriptions/checkers/isSendAddressForbidden.js";
67
- import { isAmountChangedFromQuote as Ln } from "./machine/subscriptions/checkers/isAmountChangedFromQuote.js";
68
- import { reset as Bn } from "./machine/events/reset.js";
69
- import { tokenSelectRotate as _e } from "./machine/events/tokenSelectRotate.js";
70
- import { errorSet as qn } from "./machine/events/errorSet.js";
71
- import { quoteSet as Un } from "./machine/events/quoteSet.js";
72
- import { addressSet as Pn } from "./machine/events/addressSet.js";
73
- import { tokenSetAmount as Wn } from "./machine/events/tokenSetAmount.js";
74
- import { quoteSetStatus as Vn } from "./machine/events/quoteSetStatus.js";
75
- import { depositTypeSet as Mn } from "./machine/events/depositTypeSet.js";
76
- import { externalDepositTxSet as Qn } from "./machine/events/externalDepositTxSet.js";
77
- import { setInputsValidating as $n } from "./machine/events/setInputsValidating.js";
78
- import { walletAddressSet as Kn } from "./machine/events/walletAddressSet.js";
79
- import { tokenSetBalance as Hn } from "./machine/events/tokenSetBalance.js";
80
- import { transferSetStatus as Gn } from "./machine/events/transferSetStatus.js";
81
- import { getUsdTradeDelta as jn } from "./machine/computed/getUsdTradeDelta.js";
82
- import { getIsDirectNonNearWithdrawal as zn } from "./machine/computed/getIsDirectNonNearWithdrawal.js";
83
- import { getIsDirectTokenOnNearTransfer as Yn } from "./machine/computed/getIsDirectTokenOnNearTransfer.js";
84
- import { getIsDirectNearTokenWithdrawal as Xn } from "./machine/computed/getIsDirectNearTokenWithdrawal.js";
85
- import { getIsSameAssetDiffChainWithdrawal as Zn } from "./machine/computed/getIsSameAssetDiffChainWithdrawal.js";
61
+ import { isInputChanged as vn } from "./machine/subscriptions/checkers/isInputChanged.js";
62
+ import { isErrorChanged as Dn } from "./machine/subscriptions/checkers/isErrorChanged.js";
63
+ import { isOnlyErrorChanged as xn } from "./machine/subscriptions/checkers/isOnlyErrorChanged.js";
64
+ import { isValidInitialState as On } from "./machine/subscriptions/checkers/isValidInitialState.js";
65
+ import { isWalletDisconnected as Fn } from "./machine/subscriptions/checkers/isWalletDisconnected.js";
66
+ import { isSendAddressForbidden as Ln } from "./machine/subscriptions/checkers/isSendAddressForbidden.js";
67
+ import { isAmountChangedFromQuote as Bn } from "./machine/subscriptions/checkers/isAmountChangedFromQuote.js";
68
+ import { reset as qn } from "./machine/events/reset.js";
69
+ import { tokenSelectRotate as be } from "./machine/events/tokenSelectRotate.js";
70
+ import { errorSet as Un } from "./machine/events/errorSet.js";
71
+ import { quoteSet as Pn } from "./machine/events/quoteSet.js";
72
+ import { addressSet as Wn } from "./machine/events/addressSet.js";
73
+ import { tokenSetAmount as Vn } from "./machine/events/tokenSetAmount.js";
74
+ import { quoteSetStatus as Mn } from "./machine/events/quoteSetStatus.js";
75
+ import { depositTypeSet as Qn } from "./machine/events/depositTypeSet.js";
76
+ import { externalDepositTxSet as $n } from "./machine/events/externalDepositTxSet.js";
77
+ import { setInputsValidating as Kn } from "./machine/events/setInputsValidating.js";
78
+ import { walletAddressSet as Hn } from "./machine/events/walletAddressSet.js";
79
+ import { tokenSetBalance as Gn } from "./machine/events/tokenSetBalance.js";
80
+ import { transferSetStatus as jn } from "./machine/events/transferSetStatus.js";
81
+ import { getUsdTradeDelta as zn } from "./machine/computed/getUsdTradeDelta.js";
82
+ import { getIsDirectNonNearWithdrawal as Yn } from "./machine/computed/getIsDirectNonNearWithdrawal.js";
83
+ import { getIsDirectTokenOnNearTransfer as Xn } from "./machine/computed/getIsDirectTokenOnNearTransfer.js";
84
+ import { getIsDirectNearTokenWithdrawal as Zn } from "./machine/computed/getIsDirectNearTokenWithdrawal.js";
85
+ import { getIsSameAssetDiffChainWithdrawal as Jn } from "./machine/computed/getIsSameAssetDiffChainWithdrawal.js";
86
86
  import "./components/Input.js";
87
87
  import "@material-symbols-svg/react-rounded/icons/close";
88
88
  import "@material-symbols-svg/react-rounded/icons/emergency";
@@ -90,183 +90,183 @@ import "@material-symbols-svg/react-rounded/icons/error";
90
90
  import "@material-symbols-svg/react-rounded/icons/verified";
91
91
  import "viem";
92
92
  import { Button as A } from "./components/Button.js";
93
- import { TinyNumber as Be } from "./components/TinyNumber.js";
93
+ import { TinyNumber as Ue } from "./components/TinyNumber.js";
94
94
  import { ErrorMessage as z } from "./components/ErrorMessage.js";
95
- import { FT_DEPOSIT_GAS as je, FT_TRANSFER_GAS as ze } from "./utils/near/config.js";
96
- import { a as qe } from "./index-DEq3oXQF.js";
97
- import { z as oe } from "zod";
98
- import { decodeQueryResult as Jn } from "./utils/near/decodeQueryResult.js";
99
- import { nearRpcClient as er } from "./utils/near/rpc.js";
100
- import { getNearNep141MinStorageBalance as tr } from "./utils/near/getNearNep141MinStorageBalance.js";
101
- import { isErrorLikeObject as le } from "./utils/isErrorLikeObject.js";
102
- import { isUserDeniedSigning as de } from "./utils/checkers/isUserDeniedSigning.js";
103
- import { INTENTS_CONTRACT as ye } from "./constants/intents.js";
104
- import { isEvmBaseToken as yt } from "./utils/evm/isEvmBaseToken.js";
105
- import { useMakeEvmTransfer as nr } from "./hooks/useMakeEvmTransfer.js";
106
- import { useMakeSolanaTransfer as rr } from "./hooks/useMakeSolanaTransfer.js";
107
- import { createIntentSignerNEP413 as sr, IntentsSDK as ar, createNearWithdrawalRoute as or, createInternalTransferRoute as ir, MinWithdrawalAmountError as cr, FeeExceedsAmountError as lr } from "@defuse-protocol/intents-sdk";
108
- import { generateRandomBytes as dr } from "./utils/near/getRandomBytes.js";
109
- import { IntentSignerSolana as ur } from "./utils/intents/signers/solana.js";
110
- import { localStorageTyped as Ye } from "./utils/localstorage.js";
111
- import { queryContract as mr } from "./utils/near/queryContract.js";
112
- import { utils as Xe } from "@defuse-protocol/internal-utils";
113
- import { getTransactionLink as fr } from "./utils/formatters/getTransactionLink.js";
114
- import { switchEthereumChain as pr } from "./utils/evm/switchEthereumChain.js";
95
+ import { FT_DEPOSIT_GAS as Ye, FT_TRANSFER_GAS as Xe } from "./utils/near/config.js";
96
+ import { a as Pe } from "./index-DEq3oXQF.js";
97
+ import { z as ie } from "zod";
98
+ import { decodeQueryResult as er } from "./utils/near/decodeQueryResult.js";
99
+ import { nearRpcClient as tr } from "./utils/near/rpc.js";
100
+ import { getNearNep141MinStorageBalance as nr } from "./utils/near/getNearNep141MinStorageBalance.js";
101
+ import { isErrorLikeObject as de } from "./utils/isErrorLikeObject.js";
102
+ import { isUserDeniedSigning as ue } from "./utils/checkers/isUserDeniedSigning.js";
103
+ import { INTENTS_CONTRACT as Ee } from "./constants/intents.js";
104
+ import { isEvmBaseToken as bt } from "./utils/evm/isEvmBaseToken.js";
105
+ import { useMakeEvmTransfer as rr } from "./hooks/useMakeEvmTransfer.js";
106
+ import { useMakeSolanaTransfer as sr } from "./hooks/useMakeSolanaTransfer.js";
107
+ import { createIntentSignerNEP413 as ar, IntentsSDK as or, createNearWithdrawalRoute as ir, createInternalTransferRoute as lr, MinWithdrawalAmountError as cr, FeeExceedsAmountError as dr } from "@defuse-protocol/intents-sdk";
108
+ import { generateRandomBytes as ur } from "./utils/near/getRandomBytes.js";
109
+ import { IntentSignerSolana as mr } from "./utils/intents/signers/solana.js";
110
+ import { localStorageTyped as Ze } from "./utils/localstorage.js";
111
+ import { queryContract as fr } from "./utils/near/queryContract.js";
112
+ import { utils as Je } from "@defuse-protocol/internal-utils";
113
+ import { getTransactionLink as pr } from "./utils/formatters/getTransactionLink.js";
114
+ import { switchEthereumChain as hr } from "./utils/evm/switchEthereumChain.js";
115
115
  import "@material-symbols-svg/react-rounded/w700";
116
116
  import "copy-text-to-clipboard";
117
117
  import "@material-symbols-svg/react-rounded/icons/content-copy";
118
- import { Notes as Te } from "./components/Notes.js";
118
+ import { Notes as ge } from "./components/Notes.js";
119
119
  import "@material-symbols-svg/react-rounded/icons/progress-activity";
120
120
  import "bs58";
121
121
  import "viem/chains";
122
122
  import "browser-or-node";
123
- import { SwapQuoteSkeleton as bt } from "./features/SwapQuote/SwapQuoteSkeleton.js";
124
- import { Accordion as hr } from "./components/Accordion.js";
125
- import { formatUsdAmount as Ze } from "./utils/formatters/formatUsdAmount.js";
126
- import { formatTinyNumber as Tr } from "./utils/formatters/formatTinyNumber.js";
127
- import gr from "clsx";
128
- import { Skeleton as Ir } from "./components/Skeleton.js";
129
- import { getBalancePortion as wr } from "./features/TokenInput/utils/getBalancePortion.js";
130
- import { getUsdDisplayAmount as kr } from "./features/TokenInput/utils/getUsdDisplayAmount.js";
131
- import { TokenInputHeading as Et } from "./features/TokenInput/TokenInputHeading.js";
132
- import { noop as Ar } from "./utils/noop.js";
133
- import { Card as fe } from "./components/Card.js";
134
- import { Badge as Je } from "./components/Badge.js";
123
+ import { SwapQuoteSkeleton as Et } from "./features/SwapQuote/SwapQuoteSkeleton.js";
124
+ import { Accordion as Tr } from "./components/Accordion.js";
125
+ import { formatUsdAmount as et } from "./utils/formatters/formatUsdAmount.js";
126
+ import { formatTinyNumber as gr } from "./utils/formatters/formatTinyNumber.js";
127
+ import Ir from "clsx";
128
+ import { Skeleton as wr } from "./components/Skeleton.js";
129
+ import { getBalancePortion as kr } from "./features/TokenInput/utils/getBalancePortion.js";
130
+ import { getUsdDisplayAmount as Ar } from "./features/TokenInput/utils/getUsdDisplayAmount.js";
131
+ import { TokenInputHeading as Ct } from "./features/TokenInput/TokenInputHeading.js";
132
+ import { noop as Sr } from "./utils/noop.js";
133
+ import { Card as pe } from "./components/Card.js";
134
+ import { Badge as tt } from "./components/Badge.js";
135
135
  import { TokenIcon as Rt } from "./components/TokenIcon.js";
136
- import { InputAmount as Sr } from "./components/InputAmount.js";
137
- import { TokenInputSkeleton as Nr } from "./features/TokenInput/TokenInputSkeleton.js";
138
- import { getUsdDisplayBalance as _r } from "./utils/formatters/getUsdDisplayBalance.js";
139
- import { VList as yr } from "virtua";
140
- import { useFocusOnList as br } from "./features/TokensList/hooks/useFocusOnList.js";
141
- import { TokensListPlaceholder as be } from "./features/TokensList/TokensListPlaceholder.js";
142
- import { MAX_LIST_VIEW_AREA_HEIGHT as Er, TOKEN_ITEM_HEIGHT as Rr, LIST_CONTAINER_ID as Cr } from "./features/TokensList/constants.js";
143
- import { getGroupHeadersTotalIndexes as vr } from "./features/TokensList/utils/getGroupHeadersTotalIndexes.js";
144
- import { getFirstGroupItemTotalIndex as Dr } from "./features/TokensList/utils/getFirstGroupItemTotalIndex.js";
145
- import { getListItemsTotalCount as xr } from "./features/TokensList/utils/getListItemsTotalCount.js";
146
- import { getTokenByTotalIndex as Or } from "./features/TokensList/utils/getTokenByTotalIndex.js";
147
- import { getListTotalHeight as Fr } from "./features/TokensList/utils/getListTotalHeight.js";
148
- import { getListState as Lr } from "./features/TokensList/utils/getListState.js";
149
- import { Hr as Br } from "./components/Hr.js";
150
- import { createTokenSorter as qr } from "./utils/tokens/sort.js";
151
- import { createFilterByIntents as et } from "./utils/tokens/filterByIntents.js";
152
- import { createFilterBySearch as Ur } from "./utils/tokens/filterBySearchString.js";
153
- import { createFilterBySelectedChain as Pr } from "./utils/tokens/filterBySelectedChain.js";
136
+ import { InputAmount as Nr } from "./components/InputAmount.js";
137
+ import { TokenInputSkeleton as _r } from "./features/TokenInput/TokenInputSkeleton.js";
138
+ import { getUsdDisplayBalance as yr } from "./utils/formatters/getUsdDisplayBalance.js";
139
+ import { VList as br } from "virtua";
140
+ import { useFocusOnList as Er } from "./features/TokensList/hooks/useFocusOnList.js";
141
+ import { TokensListPlaceholder as Ce } from "./features/TokensList/TokensListPlaceholder.js";
142
+ import { MAX_LIST_VIEW_AREA_HEIGHT as Cr, TOKEN_ITEM_HEIGHT as Rr, LIST_CONTAINER_ID as vr } from "./features/TokensList/constants.js";
143
+ import { getGroupHeadersTotalIndexes as Dr } from "./features/TokensList/utils/getGroupHeadersTotalIndexes.js";
144
+ import { getFirstGroupItemTotalIndex as xr } from "./features/TokensList/utils/getFirstGroupItemTotalIndex.js";
145
+ import { getListItemsTotalCount as Or } from "./features/TokensList/utils/getListItemsTotalCount.js";
146
+ import { getTokenByTotalIndex as Fr } from "./features/TokensList/utils/getTokenByTotalIndex.js";
147
+ import { getListTotalHeight as Lr } from "./features/TokensList/utils/getListTotalHeight.js";
148
+ import { getListState as Br } from "./features/TokensList/utils/getListState.js";
149
+ import { Hr as qr } from "./components/Hr.js";
150
+ import { createTokenSorter as Ur } from "./utils/tokens/sort.js";
151
+ import { createFilterByIntents as nt } from "./utils/tokens/filterByIntents.js";
152
+ import { createFilterBySearch as Pr } from "./utils/tokens/filterBySearchString.js";
153
+ import { createFilterBySelectedChain as Wr } from "./utils/tokens/filterBySelectedChain.js";
154
154
  import "@material-symbols-svg/react-rounded/icons/search";
155
155
  import "./components/ChainShortcut.js";
156
156
  import "@material-symbols-svg/react-rounded/icons/arrow-downward";
157
157
  import "qrcode.react";
158
158
  import "@material-symbols-svg/react-rounded/icons/cached";
159
- import { CheckCircleFillW700 as Wr } from "@material-symbols-svg/react-rounded/icons/check-circle";
160
- import { createColorPalette as Vr } from "./theme/createColorPalette.js";
159
+ import { CheckCircleFillW700 as Vr } from "@material-symbols-svg/react-rounded/icons/check-circle";
160
+ import { createColorPalette as Mr } from "./theme/createColorPalette.js";
161
161
  import "@material-symbols-svg/react-rounded/icons/qr-code";
162
162
  import "@material-symbols-svg/react-rounded/icons/wallet";
163
- import { AccountBalanceWalletFillW700 as Mr } from "@material-symbols-svg/react-rounded/icons/account-balance-wallet";
164
- import { ArmingCountdownFillW700 as Qr } from "@material-symbols-svg/react-rounded/icons/arming-countdown";
165
- import { BeenhereFillW700 as $r } from "@material-symbols-svg/react-rounded/icons/beenhere";
166
- import { EncryptedFillW700 as Kr } from "@material-symbols-svg/react-rounded/icons/encrypted";
167
- import { GppBadFillW700 as Hr } from "@material-symbols-svg/react-rounded/icons/gpp-bad";
168
- import { useTimer as Gr } from "use-timer";
169
- import { useHandleKeyDown as Ct } from "./hooks/useHandleKeyDown.js";
170
- import { CloseButton as vt } from "./components/CloseButton.js";
171
- import { DEFAULT_RPCS as jr } from "./rpcs.js";
172
- import { useAddClassToPortal as zr } from "./hooks/useAddClassToPortal.js";
173
- import { ErrorBoundary as Yr } from "react-error-boundary";
174
- import { isEvmToken as Xr } from "./utils/evm/isEvmToken.js";
175
- import { getEvmMainTokenBalance as Zr } from "./utils/evm/getEvmMainTokenBalance.js";
176
- import { getNativeNearBalance as Jr } from "./utils/near/getNativeNearBalance.js";
177
- import { getNearTokenBalance as es } from "./utils/near/getNearTokenBalance.js";
178
- import { getEvmTokenBalance as ts } from "./utils/evm/getEvmTokenBalance.js";
179
- function ns({ rpcs: e, token: t, connectedWallets: s }) {
180
- const { walletSupportedChains: r, tonCenterApiKey: n, alchemyApiKey: a } = y(), { walletAddress: l } = mt(s, t);
181
- return Re({
163
+ import { AccountBalanceWalletFillW700 as Qr } from "@material-symbols-svg/react-rounded/icons/account-balance-wallet";
164
+ import { ArmingCountdownFillW700 as $r } from "@material-symbols-svg/react-rounded/icons/arming-countdown";
165
+ import { BeenhereFillW700 as Kr } from "@material-symbols-svg/react-rounded/icons/beenhere";
166
+ import { EncryptedFillW700 as Hr } from "@material-symbols-svg/react-rounded/icons/encrypted";
167
+ import { GppBadFillW700 as Gr } from "@material-symbols-svg/react-rounded/icons/gpp-bad";
168
+ import { useTimer as jr } from "use-timer";
169
+ import { useHandleKeyDown as vt } from "./hooks/useHandleKeyDown.js";
170
+ import { CloseButton as Dt } from "./components/CloseButton.js";
171
+ import { DEFAULT_RPCS as zr } from "./rpcs.js";
172
+ import { useAddClassToPortal as Yr } from "./hooks/useAddClassToPortal.js";
173
+ import { ErrorBoundary as Xr } from "react-error-boundary";
174
+ import { isEvmToken as Zr } from "./utils/evm/isEvmToken.js";
175
+ import { getEvmMainTokenBalance as Jr } from "./utils/evm/getEvmMainTokenBalance.js";
176
+ import { getNativeNearBalance as es } from "./utils/near/getNativeNearBalance.js";
177
+ import { getNearTokenBalance as ts } from "./utils/near/getNearTokenBalance.js";
178
+ import { getEvmTokenBalance as ns } from "./utils/evm/getEvmTokenBalance.js";
179
+ function rs({ rpcs: e, token: t, connectedWallets: s }) {
180
+ const { walletSupportedChains: r, tonCenterApiKey: n, alchemyApiKey: a } = y(), { walletAddress: c } = ft(s, t);
181
+ return ve({
182
182
  retry: 2,
183
- enabled: !!l && Object.keys(e).includes(t.blockchain),
183
+ enabled: !!c && Object.keys(e).includes(t.blockchain),
184
184
  queryKey: ["tokenBalance", t.assetId, s],
185
185
  queryFn: async () => {
186
- if (!l)
186
+ if (!c)
187
187
  return null;
188
188
  if (t.blockchain === "near" && r.includes(t.blockchain))
189
- return !e.near || e.near.length === 0 ? null : t.assetId === j ? Jr(l, e.near) : es(t, l, e.near);
189
+ return !e.near || e.near.length === 0 ? null : t.assetId === j ? es(c, e.near) : ts(t, c, e.near);
190
190
  if (!r.includes("eth") && G(t.blockchain))
191
191
  return null;
192
- if (G(t.blockchain) && yt(t)) {
193
- const c = e[t.blockchain] ?? [];
194
- return c.length > 0 ? Zr(l, c[0]) : null;
192
+ if (G(t.blockchain) && bt(t)) {
193
+ const l = e[t.blockchain] ?? [];
194
+ return l.length > 0 ? Jr(c, l[0]) : null;
195
195
  }
196
- if (Xr(t) || G(t.blockchain)) {
197
- const c = e[t.blockchain] ?? [];
198
- return c.length > 0 ? ts(t, l, c[0]) : null;
196
+ if (Zr(t) || G(t.blockchain)) {
197
+ const l = e[t.blockchain] ?? [];
198
+ return l.length > 0 ? ns(t, c, l[0]) : null;
199
199
  }
200
- return t.blockchain === "ton" ? on(t, l, n) : t.blockchain === "sol" && r.includes(t.blockchain) ? cn(t, l, a) : (E.warn(
200
+ return t.blockchain === "ton" ? ln(t, c, n) : t.blockchain === "sol" && r.includes(t.blockchain) ? cn(t, c, a) : (E.warn(
201
201
  `Failed to fetch token balance for ${t.symbol} on ${t.blockchain}`
202
202
  ), null);
203
203
  }
204
204
  });
205
205
  }
206
- const rs = ({
206
+ const ss = ({
207
207
  rpcs: e,
208
208
  token: t,
209
209
  onBalancesLoaded: s
210
- }) => (R(() => {
210
+ }) => (C(() => {
211
211
  t.isIntent || !Object.keys(e).includes(t.blockchain) || s({ [t.assetId]: "0" });
212
- }, [t.assetId]), null), Dt = Yt(
212
+ }, [t.assetId]), null), xt = Xt(
213
213
  ({ rpcs: e, token: t, connectedWallets: s, onBalancesLoaded: r }) => {
214
- const { data: n } = ns({
214
+ const { data: n } = rs({
215
215
  rpcs: e,
216
216
  token: t,
217
217
  connectedWallets: s
218
218
  });
219
- return R(() => {
219
+ return C(() => {
220
220
  !t.isIntent && n != null && r({ [t.assetId]: n });
221
221
  }, [t, n, r]), null;
222
222
  },
223
223
  (e, t) => e.token.assetId === t.token.assetId && e.connectedWallets === t.connectedWallets
224
224
  );
225
- Dt.displayName = "TokenBalanceLoader";
226
- const tt = Object.assign(Dt, {
227
- Zero: rs
228
- }), ss = (e) => {
225
+ xt.displayName = "TokenBalanceLoader";
226
+ const rt = Object.assign(xt, {
227
+ Zero: ss
228
+ }), as = (e) => {
229
229
  const t = e.toLowerCase();
230
- return Ce[t]?.icon ?? "";
231
- }, as = (e) => `${e?.charAt(0).toUpperCase()}${e?.slice(1)}`, os = (e) => Ce[e]?.name ?? e, V = (e) => {
230
+ return De[t]?.icon ?? "";
231
+ }, os = (e) => `${e?.charAt(0).toUpperCase()}${e?.slice(1)}`, is = (e) => De[e]?.name ?? e, V = (e) => {
232
232
  const {
233
233
  showIntentTokens: t,
234
234
  allowedTokensList: s,
235
235
  allowedSourceTokensList: r,
236
236
  allowedTargetTokensList: n,
237
237
  filterTokens: a,
238
- fetchSourceTokens: l,
239
- fetchTargetTokens: c
240
- } = y(), { data: d, ...m } = Re({
238
+ fetchSourceTokens: c,
239
+ fetchTargetTokens: l
240
+ } = y(), { data: d, ...u } = ve({
241
241
  queryKey: ["tokens", e].filter(Boolean),
242
- queryFn: async () => e === "source" && l ? l() : e === "target" && c ? c() : ln.getTokens()
242
+ queryFn: async () => e === "source" && c ? c() : e === "target" && l ? l() : dn.getTokens()
243
243
  }), i = L(() => {
244
244
  if (!d)
245
245
  return [];
246
- const u = d.map((f) => {
246
+ const m = d.map((f) => {
247
247
  const g = f.blockchain.toLowerCase();
248
- return !kn(g) || s && !s.includes(f.assetId) || e === "source" && r && !r.includes(f.assetId) || e === "target" && n && !n.includes(f.assetId) ? null : {
248
+ return !An(g) || s && !s.includes(f.assetId) || e === "source" && r && !r.includes(f.assetId) || e === "target" && n && !n.includes(f.assetId) ? null : {
249
249
  assetId: f.assetId,
250
250
  symbol: f.symbol,
251
251
  decimals: f.decimals,
252
252
  price: f.price,
253
253
  blockchain: g,
254
254
  isIntent: !1,
255
- icon: f.icon ?? ss(f.symbol),
256
- name: os(f.symbol),
257
- chainName: ft[f.blockchain]?.label ?? as(f.blockchain),
255
+ icon: f.icon ?? as(f.symbol),
256
+ name: is(f.symbol),
257
+ chainName: pt[f.blockchain]?.label ?? os(f.blockchain),
258
258
  contractAddress: f.contractAddress
259
259
  };
260
- }).filter((f) => !!f).filter(a ?? (() => !0)), p = u.filter(
260
+ }).filter((f) => !!f).filter(a ?? (() => !0)), p = m.filter(
261
261
  (f) => f.symbol.toLowerCase() !== "wnear"
262
- ), w = u.find((f) => f.symbol.toLowerCase() === "wnear");
262
+ ), w = m.find((f) => f.symbol.toLowerCase() === "wnear");
263
263
  return w && p.push({
264
264
  name: "NEAR",
265
265
  symbol: "NEAR",
266
266
  chainName: "Near",
267
267
  blockchain: "near",
268
268
  assetId: j,
269
- icon: Ce.near?.icon ?? "",
269
+ icon: De.near?.icon ?? "",
270
270
  price: w?.price ?? 0,
271
271
  contractAddress: w?.contractAddress,
272
272
  isIntent: !1,
@@ -274,16 +274,16 @@ const tt = Object.assign(Dt, {
274
274
  }), t ? [
275
275
  ...p,
276
276
  // add intents tokens to the full list
277
- ...u.map(
277
+ ...m.map(
278
278
  (f) => f.symbol.toLowerCase() === "wnear" ? { ...f, symbol: "NEAR", name: "NEAR", isIntent: !0 } : { ...f, isIntent: !0 }
279
279
  )
280
280
  ] : p;
281
281
  }, [d, t, a]);
282
282
  return {
283
- ...m,
283
+ ...u,
284
284
  tokens: i
285
285
  };
286
- }, is = () => {
286
+ }, ls = () => {
287
287
  const { tokens: e } = V(), { tokens: t } = V("source"), { tokens: s } = V("target");
288
288
  return { tokens: L(() => {
289
289
  const n = {};
@@ -292,56 +292,56 @@ const tt = Object.assign(Dt, {
292
292
  ...t || [],
293
293
  ...s || []
294
294
  ].forEach((a) => {
295
- const l = `${a.assetId}-${a.isIntent}`;
296
- n[l] = a;
295
+ const c = `${a.assetId}-${a.isIntent}`;
296
+ n[c] = a;
297
297
  }), Object.values(n);
298
298
  }, [e, t, s]) };
299
- }, ge = [
299
+ }, Ie = [
300
300
  { eth: ["ETH", "USDT", "USDC", "AURORA"] },
301
301
  { near: ["USDT", "USDC", "AURORA"] },
302
302
  { arb: ["ARB", "ETH", "USDT", "USDC"] },
303
303
  { btc: ["BTC"] }
304
304
  ], cs = (e) => [...e].sort((t, s) => {
305
- const r = ge.findIndex(
305
+ const r = Ie.findIndex(
306
306
  (d) => Object.keys(d)[0] === t.blockchain
307
- ), n = ge.findIndex(
307
+ ), n = Ie.findIndex(
308
308
  (d) => Object.keys(d)[0] === s.blockchain
309
309
  );
310
310
  if (r !== n)
311
311
  return r === -1 ? 1 : n === -1 ? -1 : r - n;
312
- const a = ge[r]?.[t.blockchain] ?? [], l = a.indexOf(t.symbol), c = a.indexOf(s.symbol);
313
- return l === -1 && c === -1 ? 0 : l === -1 ? 1 : c === -1 ? -1 : l - c;
314
- }), ls = ({ rpcs: e, connectedWallets: t }) => {
315
- const { tokens: s } = is(), { walletSupportedChains: r } = y(), { setWalletBalance: n } = ve(t);
316
- return L(() => cs(s), [s]).map((l) => r.includes(l.blockchain) ? /* @__PURE__ */ o(
317
- tt,
312
+ const a = Ie[r]?.[t.blockchain] ?? [], c = a.indexOf(t.symbol), l = a.indexOf(s.symbol);
313
+ return c === -1 && l === -1 ? 0 : c === -1 ? 1 : l === -1 ? -1 : c - l;
314
+ }), ds = ({ rpcs: e, connectedWallets: t }) => {
315
+ const { tokens: s } = ls(), { walletSupportedChains: r } = y(), { setWalletBalance: n } = xe(t);
316
+ return L(() => cs(s), [s]).map((c) => r.includes(c.blockchain) ? /* @__PURE__ */ o(
317
+ rt,
318
318
  {
319
319
  rpcs: e,
320
- token: l,
320
+ token: c,
321
321
  connectedWallets: t,
322
- onBalancesLoaded: (c) => n(t, c)
322
+ onBalancesLoaded: (l) => n(t, l)
323
323
  },
324
- Y(l)
324
+ Y(c)
325
325
  ) : /* @__PURE__ */ o(
326
- tt.Zero,
326
+ rt.Zero,
327
327
  {
328
328
  rpcs: e,
329
- token: l,
330
- onBalancesLoaded: (c) => n(t, c)
329
+ token: c,
330
+ onBalancesLoaded: (l) => n(t, l)
331
331
  },
332
- Y(l)
332
+ Y(c)
333
333
  ));
334
334
  };
335
- function ds(e, t) {
335
+ function us(e, t) {
336
336
  const s = Array.from(
337
- /* @__PURE__ */ new Set([...t ?? [], ...pt])
337
+ /* @__PURE__ */ new Set([...t ?? [], ...ht])
338
338
  ), r = new Map(s.map((n, a) => [n, a]));
339
339
  return [...e].sort((n, a) => {
340
- const l = r.has(n.id) ? r.get(n.id) : 1 / 0, c = r.has(a.id) ? r.get(a.id) : 1 / 0;
341
- return l !== c ? l - c : n.id.localeCompare(a.id, void 0, { sensitivity: "base" });
340
+ const c = r.has(n.id) ? r.get(n.id) : 1 / 0, l = r.has(a.id) ? r.get(a.id) : 1 / 0;
341
+ return c !== l ? c - l : n.id.localeCompare(a.id, void 0, { sensitivity: "base" });
342
342
  });
343
343
  }
344
- const us = (e) => {
344
+ const ms = (e) => {
345
345
  const {
346
346
  chainsOrder: t,
347
347
  allowedChainsList: s,
@@ -349,106 +349,106 @@ const us = (e) => {
349
349
  allowedTargetChainsList: n
350
350
  } = y(), { tokens: a } = V();
351
351
  return L(() => {
352
- const l = Array.from(
353
- new Set(a.map((c) => ft[c.blockchain]))
354
- ).filter((c) => !(s && !s.includes(c.id) || e === "source" && r && !r.includes(c.id) || e === "target" && n && !n.includes(c.id)));
355
- return ds(l, t);
352
+ const c = Array.from(
353
+ new Set(a.map((l) => pt[l.blockchain]))
354
+ ).filter((l) => !(s && !s.includes(l.id) || e === "source" && r && !r.includes(l.id) || e === "target" && n && !n.includes(l.id)));
355
+ return us(c, t);
356
356
  }, [a, t, s]);
357
- }, nt = 3, xt = ({
357
+ }, st = 3, Ot = ({
358
358
  connectedWallets: e,
359
359
  alchemyApiKey: t,
360
360
  ...s
361
361
  }) => {
362
- const { ctx: r } = _(), { tokens: n } = V(), { walletSupportedChains: a } = y(), { setWalletBalance: l } = ve(e), c = s.isEnabled && !!Object.values(e).length && a.length > 0, d = Jt({
362
+ const { ctx: r } = _(), { tokens: n } = V(), { walletSupportedChains: a } = y(), { setWalletBalance: c } = xe(e), l = s.isEnabled && !!Object.values(e).length && a.length > 0, d = en({
363
363
  initialPageParam: null,
364
- enabled: !!c && !!t,
364
+ enabled: !!l && !!t,
365
365
  queryKey: ["walletTokensBalance", e],
366
- queryFn: async ({ pageParam: i }) => In({ alchemyApiKey: t })({
366
+ queryFn: async ({ pageParam: i }) => wn({ alchemyApiKey: t })({
367
367
  pageParam: i ? `${i}` : null,
368
368
  connectedWallets: e,
369
369
  walletSupportedChains: a
370
370
  }),
371
- getNextPageParam: (i, u) => {
372
- if (i.pageKey && !(u.length >= nt))
371
+ getNextPageParam: (i, m) => {
372
+ if (i.pageKey && !(m.length >= st))
373
373
  return i.pageKey;
374
374
  }
375
375
  });
376
- R(() => {
377
- c && d.data && d.hasNextPage && d.data.pages.length < nt && !d.isFetchingNextPage && d.fetchNextPage();
378
- }, [c, d]);
379
- const m = L(() => {
376
+ C(() => {
377
+ l && d.data && d.hasNextPage && d.data.pages.length < st && !d.isFetchingNextPage && d.fetchNextPage();
378
+ }, [l, d]);
379
+ const u = L(() => {
380
380
  if (!d.data?.pages)
381
381
  return {};
382
- const i = gn(
382
+ const i = In(
383
383
  n,
384
- d.data.pages.flatMap((u) => u.data)
384
+ d.data.pages.flatMap((m) => m.data)
385
385
  );
386
- return n.forEach((u) => {
387
- wn(u.blockchain) && !(u.assetId in i) && (i[u.assetId] = "0");
386
+ return n.forEach((m) => {
387
+ kn(m.blockchain) && !(m.assetId in i) && (i[m.assetId] = "0");
388
388
  }), i;
389
389
  }, [d.data, n]);
390
- return R(() => {
391
- O(r, ["initial_wallet"]) && (l(e, m), r.sourceToken && Object.keys(m).includes(r.sourceToken.assetId) && h("tokenSetBalance", m[r.sourceToken.assetId]));
392
- }, [m]), {
390
+ return C(() => {
391
+ O(r, ["initial_wallet"]) && (c(e, u), r.sourceToken && Object.keys(u).includes(r.sourceToken.assetId) && h("tokenSetBalance", u[r.sourceToken.assetId]));
392
+ }, [u]), {
393
393
  status: d.status,
394
394
  refetch: d.refetch,
395
- balances: m
395
+ balances: u
396
396
  };
397
- }, pe = () => {
397
+ }, he = () => {
398
398
  const { intentsAccountType: e } = y(), {
399
399
  ctx: { walletAddress: t }
400
- } = _(), { tokens: s } = V(), r = s.filter((c) => c.isIntent).map((c) => c.assetId), n = re({
400
+ } = _(), { tokens: s } = V(), r = s.filter((l) => l.isIntent).map((l) => l.assetId), n = se({
401
401
  walletAddress: t,
402
402
  addressType: e
403
- }), a = Re({
403
+ }), a = ve({
404
404
  enabled: !!t && !!n && s.length > 0,
405
405
  queryKey: ["intentsBalances", n],
406
- queryFn: async () => n ? await An(n, r) : {}
407
- }), l = L(() => {
406
+ queryFn: async () => n ? await Sn(n, r) : {}
407
+ }), c = L(() => {
408
408
  switch (a.status) {
409
409
  case "error":
410
410
  return E.error("Unable to load intents balances:", a.error), {};
411
411
  case "success":
412
412
  return Object.fromEntries(
413
- Object.entries(a.data).map(([c, d]) => [
414
- `intent-${c}`,
413
+ Object.entries(a.data).map(([l, d]) => [
414
+ `intent-${l}`,
415
415
  d
416
416
  ])
417
417
  );
418
418
  case "pending":
419
419
  return {};
420
420
  default:
421
- return De(a, { throwError: !1 }), {};
421
+ return Oe(a, { throwError: !1 }), {};
422
422
  }
423
423
  }, [a]) ?? {};
424
424
  return {
425
425
  ...a,
426
- intentBalances: l
426
+ intentBalances: c
427
427
  };
428
- }, ms = ({
428
+ }, fs = ({
429
429
  isEnabled: e,
430
430
  alchemyApiKey: t
431
431
  }) => {
432
- const { connectedWallets: s } = y(), { ctx: r } = _(), n = en(), { refetch: a } = pe(), { refetch: l } = xt({
432
+ const { connectedWallets: s } = y(), { ctx: r } = _(), n = tn(), { refetch: a } = he(), { refetch: c } = Ot({
433
433
  isEnabled: e,
434
434
  connectedWallets: s,
435
435
  alchemyApiKey: t ?? ""
436
436
  });
437
- R(() => {
438
- const c = O(r, ["transfer_success"]);
439
- !e || !c || (async () => (await a(), t && (await new Promise((d) => {
437
+ C(() => {
438
+ const l = O(r, ["transfer_success"]);
439
+ !e || !l || (async () => (await a(), t && (await new Promise((d) => {
440
440
  setTimeout(d, 1e4);
441
- }), await l()), await n.invalidateQueries({ queryKey: ["tokenBalance"] })))();
441
+ }), await c()), await n.invalidateQueries({ queryKey: ["tokenBalance"] })))();
442
442
  }, [r.state, e, t]);
443
- }, he = () => {
444
- const { connectedWallets: e } = y(), { intentBalances: t } = pe(), { walletBalance: s } = ve(e);
443
+ }, Te = () => {
444
+ const { connectedWallets: e } = y(), { intentBalances: t } = he(), { walletBalance: s } = xe(e);
445
445
  return { mergedBalance: L(
446
446
  () => ({ ...s, ...t }),
447
447
  [s, t]
448
448
  ) };
449
- }, fs = ({ isEnabled: e }) => {
450
- const { ctx: t } = _(), { mergedBalance: s } = he();
451
- R(() => {
449
+ }, ps = ({ isEnabled: e }) => {
450
+ const { ctx: t } = _(), { mergedBalance: s } = Te();
451
+ C(() => {
452
452
  if (!e)
453
453
  return;
454
454
  if (!t.sourceToken || !t.walletAddress) {
@@ -458,7 +458,7 @@ const us = (e) => {
458
458
  const r = Y(t.sourceToken);
459
459
  h("tokenSetBalance", s[r]);
460
460
  }, [s, t.sourceToken]);
461
- }, rt = {
461
+ }, at = {
462
462
  // cbBTC (eth)
463
463
  "nep141:eth-0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf.omft.near": "nep141:nbtc.bridge.near",
464
464
  // cbBTC (base)
@@ -473,11 +473,11 @@ const us = (e) => {
473
473
  "nep245:v2_1.omni.hot.tg:56_SZzgw3HSudhZcTwPWUTi2RJB19t": "nep141:wrap.near",
474
474
  // BTC (near)
475
475
  "nep141:btc.omft.near": "nep141:nbtc.bridge.near"
476
- }, ps = ({
476
+ }, hs = ({
477
477
  isEnabled: e
478
478
  }) => {
479
479
  const { ctx: t } = _(), { tokens: s } = V();
480
- R(() => {
480
+ C(() => {
481
481
  if (!e)
482
482
  return;
483
483
  if (!t.sourceToken) {
@@ -485,65 +485,65 @@ const us = (e) => {
485
485
  return;
486
486
  }
487
487
  const { sourceToken: r } = t;
488
- if (t.sourceToken.assetId in rt) {
489
- const c = s.find(
490
- (d) => d.isIntent && d.assetId === rt[r.assetId]
488
+ if (t.sourceToken.assetId in at) {
489
+ const l = s.find(
490
+ (d) => d.isIntent && d.assetId === at[r.assetId]
491
491
  );
492
492
  h("tokenSelect", {
493
493
  variant: "target",
494
- token: c
494
+ token: l
495
495
  });
496
496
  return;
497
497
  }
498
498
  const n = s.find(
499
- (c) => c.isIntent && c.symbol === r.symbol && c.blockchain === "near"
499
+ (l) => l.isIntent && l.symbol === r.symbol && l.blockchain === "near"
500
500
  );
501
501
  if (n) {
502
502
  h("tokenSelect", { variant: "target", token: n });
503
503
  return;
504
504
  }
505
505
  const a = s.find(
506
- (c) => c.isIntent && c.assetId === r.assetId
507
- ), l = s.find(
508
- (c) => c.isIntent && c.symbol === "USDC" && c.blockchain === "near"
506
+ (l) => l.isIntent && l.assetId === r.assetId
507
+ ), c = s.find(
508
+ (l) => l.isIntent && l.symbol === "USDC" && l.blockchain === "near"
509
509
  );
510
510
  h("tokenSelect", {
511
511
  variant: "target",
512
- token: a ?? l
512
+ token: a ?? c
513
513
  });
514
514
  }, [s, t.sourceToken]);
515
- }, hs = ({ isEnabled: e }) => {
516
- const { connectedWallets: t } = y(), { ctx: s, state: r } = _(), { walletAddress: n } = mt(
515
+ }, Ts = ({ isEnabled: e }) => {
516
+ const { connectedWallets: t } = y(), { ctx: s, state: r } = _(), { walletAddress: n } = ft(
517
517
  t,
518
518
  s.sourceToken
519
519
  );
520
- R(() => {
520
+ C(() => {
521
521
  if (!e)
522
522
  return;
523
523
  h("walletAddressSet", n), O(s, ["initial_dry", "initial_wallet"]) && (r === "initial_wallet" && !n ? F("initial_dry") : r === "initial_dry" && n && F("initial_wallet"));
524
524
  }, [e, n, s, r]);
525
- }, Ts = (e) => (["depositAddress"].forEach((t) => {
525
+ }, gs = (e) => (["depositAddress"].forEach((t) => {
526
526
  if (!(t in e))
527
527
  return E.error(`Missing ${t} in quote response`), !1;
528
- }), !0), gs = () => {
528
+ }), !0), Is = () => {
529
529
  const { ctx: e } = _(), {
530
530
  walletSupportedChains: t,
531
531
  intentsAccountType: s,
532
532
  appName: r,
533
533
  appFees: n,
534
534
  fetchQuote: a,
535
- slippageTolerance: l
536
- } = y(), c = xe(e), d = Z(null), m = Z(new AbortController()), i = L(() => async (p, w) => {
537
- const { signal: f } = m.current;
535
+ slippageTolerance: c
536
+ } = y(), l = Fe(e), d = Z(null), u = Z(new AbortController()), i = L(() => async (p, w) => {
537
+ const { signal: f } = u.current;
538
538
  return a ? a(p, {
539
539
  ...w,
540
540
  signal: f
541
- }) : (await Ne.post(
541
+ }) : (await ye.post(
542
542
  "https://1click.chaindefuser.com/v0/quote",
543
543
  p,
544
544
  { signal: f }
545
545
  )).data.quote;
546
- }, [Ne]);
546
+ }, [ye]);
547
547
  return {
548
548
  make: async ({
549
549
  message: p,
@@ -560,16 +560,16 @@ const us = (e) => {
560
560
  const S = `Unable to run quote in current state ${e.state}`;
561
561
  throw E.error(`[WIDGET] ${S}`), new q({
562
562
  code: "QUOTE_INVALID_INITIAL",
563
- meta: { isDry: c, message: S }
563
+ meta: { isDry: l, message: S }
564
564
  });
565
565
  }
566
- const k = re({
566
+ const k = se({
567
567
  addressType: s,
568
- walletAddress: c ? (
568
+ walletAddress: l ? (
569
569
  // address on the target chain should be a dry quote recipient
570
- Ge(e.targetToken.blockchain)
570
+ ze(e.targetToken.blockchain)
571
571
  ) : e.walletAddress ?? ""
572
- }), b = k && (e.sourceToken.isIntent || !t.includes(e.sourceToken.blockchain)), B = () => c ? Ge(
572
+ }), b = k && (e.sourceToken.isIntent || !t.includes(e.sourceToken.blockchain)), B = () => l ? ze(
573
573
  e.sourceToken.blockchain,
574
574
  e.sourceToken.isIntent
575
575
  ) : b ? k : e.walletAddress ?? "";
@@ -577,31 +577,31 @@ const us = (e) => {
577
577
  const S = "No corresponding intents account to run a quote";
578
578
  throw E.error(`[WIDGET] ${S}`), new q({
579
579
  code: "QUOTE_INVALID_INITIAL",
580
- meta: { isDry: c, message: S }
580
+ meta: { isDry: l, message: S }
581
581
  });
582
582
  }
583
- d.current && (m.current.abort("Abort previous quote (auto)"), m.current = new AbortController());
583
+ d.current && (u.current.abort("Abort previous quote (auto)"), u.current = new AbortController());
584
584
  let D;
585
- const C = {
585
+ const R = {
586
586
  // Settings
587
- dry: c,
588
- slippageTolerance: l,
587
+ dry: l,
588
+ slippageTolerance: c,
589
589
  deadline: new Date(Date.now() + 3600 * 1e3).toISOString(),
590
590
  // 1 hour
591
591
  swapType: w === "exact_out" ? W.swapType.EXACT_OUTPUT : W.swapType.EXACT_INPUT,
592
592
  // Target
593
- destinationAsset: e.targetToken.assetId === j ? Se : e.targetToken.assetId,
593
+ destinationAsset: e.targetToken.assetId === j ? _e : e.targetToken.assetId,
594
594
  // Source
595
- originAsset: e.sourceToken.assetId === j ? Se : e.sourceToken.assetId,
595
+ originAsset: e.sourceToken.assetId === j ? _e : e.sourceToken.assetId,
596
596
  amount: w === "exact_out" ? e.targetTokenAmount : e.sourceTokenAmount,
597
597
  // Experimental
598
598
  quoteWaitingTimeMs: 0
599
599
  };
600
- p && (C.customRecipientMsg = p), r && (C.referral = gt(r)), n && (C.appFees = [...n]);
600
+ p && (R.customRecipientMsg = p), r && (R.referral = It(r)), n && (R.appFees = [...n]);
601
601
  try {
602
602
  e.sourceToken.isIntent && e.targetToken.isIntent && (d.current = i(
603
603
  {
604
- ...C,
604
+ ...R,
605
605
  recipient: k,
606
606
  recipientType: W.recipientType.INTENTS,
607
607
  depositType: W.depositType.INTENTS,
@@ -612,7 +612,7 @@ const us = (e) => {
612
612
  f
613
613
  ), D = await d.current), d.current = i(
614
614
  {
615
- ...C,
615
+ ...R,
616
616
  recipient: !e.targetToken.isIntent && e.sendAddress ? e.sendAddress : k,
617
617
  recipientType: e.targetToken.isIntent ? W.recipientType.INTENTS : W.recipientType.DESTINATION_CHAIN,
618
618
  depositType: e.sourceToken.isIntent ? W.depositType.INTENTS : W.depositType.ORIGIN_CHAIN,
@@ -623,17 +623,17 @@ const us = (e) => {
623
623
  f
624
624
  ), D = await d.current;
625
625
  } catch (S) {
626
- if (S instanceof It)
626
+ if (S instanceof wt)
627
627
  return;
628
628
  E.error("Quote error: ", S);
629
629
  let U = S instanceof Error ? S.message : "";
630
- if (S instanceof wt) {
630
+ if (S instanceof kt) {
631
631
  if (U = S.response?.data.message || U, U.includes("Amount is too low")) {
632
- const Q = U.match(/\d+/), ae = Q ? Q[0] : void 0;
632
+ const Q = U.match(/\d+/), oe = Q ? Q[0] : void 0;
633
633
  throw new q({
634
634
  code: "QUOTE_AMOUNT_IS_TOO_LOW",
635
635
  meta: {
636
- minAmount: (ae && X(ae, e.sourceToken.decimals)) ?? "0"
636
+ minAmount: (oe && X(oe, e.sourceToken.decimals)) ?? "0"
637
637
  }
638
638
  });
639
639
  }
@@ -650,12 +650,12 @@ const us = (e) => {
650
650
  }
651
651
  });
652
652
  }
653
- return c ? {
653
+ return l ? {
654
654
  dry: !0,
655
655
  ...D,
656
656
  deadline: void 0,
657
657
  depositAddress: void 0
658
- } : (Ts(D), {
658
+ } : (gs(D), {
659
659
  dry: !1,
660
660
  ...D,
661
661
  deadline: D.deadline,
@@ -663,14 +663,14 @@ const us = (e) => {
663
663
  });
664
664
  },
665
665
  cancel: () => {
666
- m.current.abort("Abort quote manually"), m.current = new AbortController();
666
+ u.current.abort("Abort quote manually"), u.current = new AbortController();
667
667
  }
668
668
  };
669
- }, Is = () => {
670
- const { ctx: e } = _(), { intentsAccountType: t } = y(), { isNativeNearDeposit: s } = J(), r = re({
669
+ }, ws = () => {
670
+ const { ctx: e } = _(), { intentsAccountType: t } = y(), { isNativeNearDeposit: s } = J(), r = se({
671
671
  addressType: t,
672
672
  walletAddress: e.walletAddress ?? ""
673
- }), n = Z(null), a = Z(new AbortController()), l = L(() => async (d) => kt.post(
673
+ }), n = Z(null), a = Z(new AbortController()), c = L(() => async (d) => At.post(
674
674
  "",
675
675
  {
676
676
  id: 1,
@@ -686,7 +686,7 @@ const us = (e) => {
686
686
  {
687
687
  signal: a.current.signal
688
688
  }
689
- ), [Ne]);
689
+ ), [ye]);
690
690
  return {
691
691
  make: async () => {
692
692
  if (!O(e, [
@@ -734,18 +734,18 @@ const us = (e) => {
734
734
  });
735
735
  }
736
736
  n.current && (a.current.abort("Abort previous quote (auto)"), a.current = new AbortController());
737
- let m = ht[e.targetToken.blockchain];
738
- if (!m)
737
+ let u = Tt[e.targetToken.blockchain];
738
+ if (!u)
739
739
  if (G(e.targetToken.blockchain))
740
- m = Tt;
740
+ u = gt;
741
741
  else
742
742
  throw new q({
743
743
  code: "QUOTE_INVALID_INITIAL",
744
744
  meta: { isDry: !1, message: "Chain is not supported by POA" }
745
745
  });
746
746
  try {
747
- return n.current = l({
748
- chain: m,
747
+ return n.current = c({
748
+ chain: u,
749
749
  accountId: r
750
750
  }), {
751
751
  depositAddress: (await n.current).data.result.address,
@@ -767,14 +767,14 @@ const us = (e) => {
767
767
  dry: !1
768
768
  };
769
769
  } catch (i) {
770
- if (i instanceof It)
770
+ if (i instanceof wt)
771
771
  return;
772
- if (E.error(i), i instanceof wt) {
773
- const u = i.response?.data.message || i.message;
772
+ if (E.error(i), i instanceof kt) {
773
+ const m = i.response?.data.message || i.message;
774
774
  throw new q({
775
775
  code: "QUOTE_FAILED",
776
776
  meta: {
777
- message: u ?? "Failed to fetch quote. Please try again."
777
+ message: m ?? "Failed to fetch quote. Please try again."
778
778
  }
779
779
  });
780
780
  }
@@ -784,60 +784,60 @@ const us = (e) => {
784
784
  a.current.abort("Abort quote manually"), a.current = new AbortController();
785
785
  }
786
786
  };
787
- }, st = (e) => {
787
+ }, ot = (e) => {
788
788
  h("errorSet", e), h("quoteSet", void 0), h("quoteSetStatus", "idle"), h("transferSetStatus", { status: "idle" });
789
- }, at = async (e) => {
789
+ }, it = async (e) => {
790
790
  if (!e.sendAddress)
791
791
  return;
792
792
  let t = !1;
793
793
  try {
794
- h("setInputsValidating", !0), t = await Nn(e.sendAddress);
794
+ h("setInputsValidating", !0), t = await _n(e.sendAddress);
795
795
  } catch {
796
- st({
796
+ ot({
797
797
  code: "SEND_ADDRESS_IS_NOT_VERIFIED",
798
798
  meta: { address: e.sendAddress, chain: "near" }
799
799
  }), h("setInputsValidating", !1), F("initial_wallet");
800
800
  return;
801
801
  }
802
802
  if (h("setInputsValidating", !1), !t) {
803
- st({
803
+ ot({
804
804
  code: "SEND_ADDRESS_IS_NOT_FOUND",
805
805
  meta: { address: e.sendAddress, chain: "near" }
806
806
  }), F("initial_wallet");
807
807
  return;
808
808
  }
809
- e.error ? _n(e.error) && (h("errorSet", null), F("input_valid_external")) : F("input_valid_external");
810
- }, Ot = (e) => {
809
+ e.error ? yn(e.error) && (h("errorSet", null), F("input_valid_external")) : F("input_valid_external");
810
+ }, Ft = (e) => {
811
811
  const t = O(e, ["initial_dry"]), s = O(e, ["input_valid_dry"]);
812
812
  if (!t && !s)
813
813
  return;
814
814
  let r;
815
- return t && (e.sourceToken ? e.targetToken ? se(e.sourceTokenAmount) ? e.walletAddress && !Oe(e) && (r = { code: "SOURCE_BALANCE_INSUFFICIENT" }) : r = { code: "SOURCE_TOKEN_AMOUNT_IS_EMPTY" } : r = { code: "TARGET_TOKEN_IS_EMPTY" } : r = { code: "SOURCE_TOKEN_IS_EMPTY" }), !s && r ? h("errorSet", r) : e.error && !Fe(e.error) && !Le(e.error) && h("errorSet", null), s && r?.code === "SOURCE_BALANCE_INSUFFICIENT" && h("errorSet", r), s;
816
- }, Ft = (e) => {
815
+ return t && (e.sourceToken ? e.targetToken ? ae(e.sourceTokenAmount) ? e.walletAddress && !Le(e) && (r = { code: "SOURCE_BALANCE_INSUFFICIENT" }) : r = { code: "SOURCE_TOKEN_AMOUNT_IS_EMPTY" } : r = { code: "TARGET_TOKEN_IS_EMPTY" } : r = { code: "SOURCE_TOKEN_IS_EMPTY" }), !s && r ? h("errorSet", r) : e.error && !Be(e.error) && !qe(e.error) && h("errorSet", null), s && r?.code === "SOURCE_BALANCE_INSUFFICIENT" && h("errorSet", r), s;
816
+ }, Lt = (e) => {
817
817
  const t = O(e, ["initial_wallet"]), s = O(e, ["input_valid_external"]);
818
818
  if (!t && !s)
819
819
  return;
820
820
  const r = e.sourceTokenBalance;
821
821
  let n;
822
- return t && (e.sourceToken ? e.targetToken ? e.targetToken.isIntent ? n = { code: "SOURCE_TOKEN_IS_INTENT" } : se(e.sourceTokenAmount) ? e.sendAddress ? e.targetToken.blockchain === "near" ? St(e.sendAddress) ? at(e) : n = {
822
+ return t && (e.sourceToken ? e.targetToken ? e.targetToken.isIntent ? n = { code: "SOURCE_TOKEN_IS_INTENT" } : ae(e.sourceTokenAmount) ? e.sendAddress ? e.targetToken.blockchain === "near" ? Nt(e.sendAddress) ? it(e) : n = {
823
823
  code: "SEND_ADDRESS_IS_INVALID",
824
824
  meta: { address: e.sendAddress, chain: "near" }
825
- } : e.isDepositFromExternalWallet || (!r || !At(r) ? n = { code: "INVALID_SOURCE_BALANCE" } : Oe(e) || (n = { code: "SOURCE_BALANCE_INSUFFICIENT" })) : n = { code: "SEND_ADDRESS_IS_EMPTY" } : n = { code: "SOURCE_TOKEN_AMOUNT_IS_EMPTY" } : n = { code: "TARGET_TOKEN_IS_EMPTY" } : n = { code: "SOURCE_TOKEN_IS_EMPTY" }), s && e.targetToken.blockchain === "near" && at(e), !s && n ? h("errorSet", n) : e.error && !Fe(e.error) && !Le(e.error) && h("errorSet", null), s;
826
- }, Lt = (e) => {
825
+ } : e.isDepositFromExternalWallet || (!r || !St(r) ? n = { code: "INVALID_SOURCE_BALANCE" } : Le(e) || (n = { code: "SOURCE_BALANCE_INSUFFICIENT" })) : n = { code: "SEND_ADDRESS_IS_EMPTY" } : n = { code: "SOURCE_TOKEN_AMOUNT_IS_EMPTY" } : n = { code: "TARGET_TOKEN_IS_EMPTY" } : n = { code: "SOURCE_TOKEN_IS_EMPTY" }), s && e.targetToken.blockchain === "near" && it(e), !s && n ? h("errorSet", n) : e.error && !Be(e.error) && !qe(e.error) && h("errorSet", null), s;
826
+ }, Bt = (e) => {
827
827
  const t = O(e, ["initial_wallet"]), s = O(e, ["input_valid_internal"]);
828
828
  if (!t && !s)
829
829
  return;
830
830
  const r = e.sourceTokenBalance;
831
831
  let n;
832
- return t && (e.sourceToken ? e.targetToken ? e.targetToken.isIntent ? se(e.sourceTokenAmount) ? e.isDepositFromExternalWallet || (!r || !At(r) ? n = { code: "INVALID_SOURCE_BALANCE" } : Oe(e) || (n = { code: "SOURCE_BALANCE_INSUFFICIENT" })) : n = { code: "SOURCE_TOKEN_AMOUNT_IS_EMPTY" } : n = { code: "SOURCE_TOKEN_NOT_INTENT" } : n = { code: "TARGET_TOKEN_IS_EMPTY" } : n = { code: "SOURCE_TOKEN_IS_EMPTY" }), !s && n ? h("errorSet", n) : e.error && !Fe(e.error) && !Le(e.error) && h("errorSet", null), s;
833
- }, Bt = (e) => {
834
- const t = xe(e), s = !t && e.targetToken?.isIntent === !0, r = !t && e.targetToken?.isIntent === !1;
832
+ return t && (e.sourceToken ? e.targetToken ? e.targetToken.isIntent ? ae(e.sourceTokenAmount) ? e.isDepositFromExternalWallet || (!r || !St(r) ? n = { code: "INVALID_SOURCE_BALANCE" } : Le(e) || (n = { code: "SOURCE_BALANCE_INSUFFICIENT" })) : n = { code: "SOURCE_TOKEN_AMOUNT_IS_EMPTY" } : n = { code: "SOURCE_TOKEN_NOT_INTENT" } : n = { code: "TARGET_TOKEN_IS_EMPTY" } : n = { code: "SOURCE_TOKEN_IS_EMPTY" }), !s && n ? h("errorSet", n) : e.error && !Be(e.error) && !qe(e.error) && h("errorSet", null), s;
833
+ }, qt = (e) => {
834
+ const t = Fe(e), s = !t && e.targetToken?.isIntent === !0, r = !t && e.targetToken?.isIntent === !1;
835
835
  if (t) {
836
- const n = Ot(e);
836
+ const n = Ft(e);
837
837
  return F(n ? "input_valid_dry" : "initial_dry");
838
838
  }
839
- r && Ft(e) ? F("input_valid_external") : s && Lt(e) ? F("input_valid_internal") : F("initial_wallet");
840
- }, ws = ({
839
+ r && Lt(e) ? F("input_valid_external") : s && Bt(e) ? F("input_valid_internal") : F("initial_wallet");
840
+ }, ks = ({
841
841
  isEnabled: e,
842
842
  message: t,
843
843
  type: s = "exact_in",
@@ -845,31 +845,31 @@ const us = (e) => {
845
845
  }) => {
846
846
  const { ctx: n } = _(), {
847
847
  isNativeNearDeposit: a,
848
- isDirectNonNearWithdrawal: l,
849
- isDirectTokenOnNearDeposit: c,
848
+ isDirectNonNearWithdrawal: c,
849
+ isDirectTokenOnNearDeposit: l,
850
850
  isDirectNearTokenWithdrawal: d,
851
- isDirectTokenOnNearTransfer: m,
851
+ isDirectTokenOnNearTransfer: u,
852
852
  isSameAssetDiffChainWithdrawal: i
853
- } = J(), u = xe(n), p = e && !n.areInputsValidating && (i || (c || a) && n.isDepositFromExternalWallet || !d && !l && !c && !m), { make: w, cancel: f } = gs(), { make: g, cancel: k } = Is(), b = Z(null), B = () => {
853
+ } = J(), m = Fe(n), p = e && !n.areInputsValidating && (i || (l || a) && n.isDepositFromExternalWallet || !d && !c && !l && !u), { make: w, cancel: f } = Is(), { make: g, cancel: k } = ws(), b = Z(null), B = () => {
854
854
  f(), k();
855
855
  };
856
- R(() => {
857
- const C = O(n, ["input_valid_dry"]), S = O(n, ["input_valid_external"]), U = O(n, ["input_valid_internal"]);
858
- (u && !C || !u && n.targetToken?.isIntent && !U || !u && !n.targetToken?.isIntent && !S || n.areInputsValidating) && B();
859
- }, [B, u, n]);
856
+ C(() => {
857
+ const R = O(n, ["input_valid_dry"]), S = O(n, ["input_valid_external"]), U = O(n, ["input_valid_internal"]);
858
+ (m && !R || !m && n.targetToken?.isIntent && !U || !m && !n.targetToken?.isIntent && !S || n.areInputsValidating) && B();
859
+ }, [B, m, n]);
860
860
  const D = ce(
861
- async (C) => {
861
+ async (R) => {
862
862
  try {
863
863
  let S;
864
864
  if (n.sourceToken?.assetId === n.targetToken?.assetId || a && n.isDepositFromExternalWallet) {
865
- if (u)
865
+ if (m)
866
866
  return;
867
867
  h("quoteSetStatus", "pending"), S = await g();
868
868
  } else
869
- h("quoteSetStatus", "pending"), S = await w({ message: t, quoteType: s, options: C });
869
+ h("quoteSetStatus", "pending"), S = await w({ message: t, quoteType: s, options: R });
870
870
  if (!S)
871
871
  return;
872
- if (h("quoteSetStatus", "success"), h("quoteSet", S), !u && n.error?.code !== "SOURCE_BALANCE_INSUFFICIENT" && h("errorSet", null), h("tokenSetAmount", {
872
+ if (h("quoteSetStatus", "success"), h("quoteSet", S), !m && n.error?.code !== "SOURCE_BALANCE_INSUFFICIENT" && h("errorSet", null), h("tokenSetAmount", {
873
873
  variant: "target",
874
874
  amount: S.amountOut
875
875
  }), n.state === "input_valid_dry") {
@@ -883,7 +883,7 @@ const us = (e) => {
883
883
  h("quoteSetStatus", "idle"), h("quoteSet", void 0), h("errorSet", null);
884
884
  return;
885
885
  }
886
- h("quoteSetStatus", "error"), h("quoteSet", void 0), h("errorSet", S.data), Bt(n);
886
+ h("quoteSetStatus", "error"), h("quoteSet", void 0), h("errorSet", S.data), qt(n);
887
887
  return;
888
888
  }
889
889
  E.error("Unhandled error in useMakeQuoteEffect:", S), h("quoteSetStatus", "error"), h("quoteSet", void 0), h("errorSet", {
@@ -892,34 +892,34 @@ const us = (e) => {
892
892
  });
893
893
  }
894
894
  },
895
- [n, u, g, w, t, s, p]
895
+ [n, m, g, w, t, s, p]
896
896
  );
897
- R(() => {
898
- !p || !(u ? n.state === "input_valid_dry" : n.state === "input_valid_external" && !n.targetToken?.isIntent || n.state === "input_valid_internal" && n.targetToken?.isIntent) || n.quoteStatus !== "error" && (a && !n.isDepositFromExternalWallet || D({ isRefetch: !1 }));
899
- }, [p, D, B, n.sourceToken, n.targetToken]), R(() => {
900
- const C = () => {
897
+ C(() => {
898
+ !p || !(m ? n.state === "input_valid_dry" : n.state === "input_valid_external" && !n.targetToken?.isIntent || n.state === "input_valid_internal" && n.targetToken?.isIntent) || n.quoteStatus !== "error" && (a && !n.isDepositFromExternalWallet || D({ isRefetch: !1 }));
899
+ }, [p, D, B, n.sourceToken, n.targetToken]), C(() => {
900
+ const R = () => {
901
901
  b.current && (clearInterval(b.current), b.current = null);
902
902
  };
903
903
  return n.state !== "quote_success_internal" && n.state !== "quote_success_external" || !r || (b.current = setInterval(async () => {
904
904
  await D({ isRefetch: !0 });
905
- }, r)), C;
905
+ }, r)), R;
906
906
  }, [p, D, B, n.state]);
907
- }, Ie = {
907
+ }, we = {
908
908
  sol: "sol",
909
909
  evm: "eth",
910
910
  near: "near"
911
- }, ks = ({
911
+ }, As = ({
912
912
  isEnabled: e,
913
913
  skipIntents: t = !1,
914
914
  target: s = "none"
915
915
  }) => {
916
- const { tokens: r } = V(), { ctx: n, state: a } = _(), { intentBalances: l } = pe(), { walletSupportedChains: c, chainsFilter: d, intentsAccountType: m } = y(), i = En({
916
+ const { tokens: r } = V(), { ctx: n, state: a } = _(), { intentBalances: c } = he(), { walletSupportedChains: l, chainsFilter: d, intentsAccountType: u } = y(), i = Cn({
917
917
  tokens: r,
918
- walletSupportedChains: c,
919
- balances: l,
918
+ walletSupportedChains: l,
919
+ balances: c,
920
920
  across: "intents"
921
- }), [u, p] = L(() => !n.walletAddress && !t ? [
922
- { token: bn({ tokens: r }), status: "loaded" },
921
+ }), [m, p] = L(() => !n.walletAddress && !t ? [
922
+ { token: En({ tokens: r }), status: "loaded" },
923
923
  { token: void 0, status: "loaded" }
924
924
  ] : d.source.intents !== "none" && !t ? i ? [
925
925
  { token: i, status: "loaded" },
@@ -928,9 +928,9 @@ const us = (e) => {
928
928
  { token: void 0, status: "loading" },
929
929
  { token: void 0, status: "loading" }
930
930
  ] : [
931
- { token: yn({
931
+ { token: bn({
932
932
  tokens: r,
933
- walletSupportedChains: c
933
+ walletSupportedChains: l
934
934
  }), status: "loaded" },
935
935
  { token: void 0, status: "loaded" }
936
936
  ], [
@@ -939,25 +939,25 @@ const us = (e) => {
939
939
  d,
940
940
  n.walletAddress,
941
941
  i,
942
- c,
942
+ l,
943
943
  a
944
944
  ]);
945
- R(() => {
945
+ C(() => {
946
946
  if (!e)
947
947
  return;
948
- if (O(n, ["initial_dry", "initial_wallet"]) && (u.status === "loaded" && !n.sourceToken && h("tokenSelect", {
948
+ if (O(n, ["initial_dry", "initial_wallet"]) && (m.status === "loaded" && !n.sourceToken && h("tokenSelect", {
949
949
  variant: "source",
950
- token: u.token
951
- }), p.status === "loaded" && u.status === "loaded" && !n.targetToken)) {
950
+ token: m.token
951
+ }), p.status === "loaded" && m.status === "loaded" && !n.targetToken)) {
952
952
  let g = p.token;
953
953
  if (s === "same-asset")
954
- if (u.token?.isIntent) {
955
- if (!m)
954
+ if (m.token?.isIntent) {
955
+ if (!u)
956
956
  throw new Error(
957
957
  "Intents account type is required to select same-asset target token"
958
958
  );
959
959
  g = r.find(
960
- (k) => !k.isIntent && k.symbol === n.sourceToken?.symbol && k.blockchain === Ie[m]
960
+ (k) => !k.isIntent && k.symbol === n.sourceToken?.symbol && k.blockchain === we[u]
961
961
  );
962
962
  } else
963
963
  g = r.find(
@@ -968,82 +968,82 @@ const us = (e) => {
968
968
  token: g
969
969
  });
970
970
  }
971
- }, [n, u, p, e]);
971
+ }, [n, m, p, e]);
972
972
  const w = (f, g) => {
973
973
  const k = r.find(
974
- (b) => !b.isIntent && b.blockchain === Ie[f] && b.symbol.toLowerCase() === dn[Ie[f]]?.toLowerCase()
974
+ (b) => !b.isIntent && b.blockchain === we[f] && b.symbol.toLowerCase() === un[we[f]]?.toLowerCase()
975
975
  ) ?? g;
976
976
  h("tokenSelect", {
977
977
  variant: "source",
978
978
  token: k
979
979
  });
980
980
  };
981
- return R(() => {
981
+ return C(() => {
982
982
  const f = O(n, ["initial_dry", "initial_wallet"]);
983
983
  if (!e || !f)
984
984
  return;
985
985
  const g = r.find(
986
986
  (b) => b.isIntent && b.symbol === "AURORA" && b.blockchain === "near"
987
987
  ), k = setTimeout(() => {
988
- u.token || (!t && i ? h("tokenSelect", {
988
+ m.token || (!t && i ? h("tokenSelect", {
989
989
  variant: "source",
990
990
  token: i
991
- }) : c.length && m ? w(m, g) : n.walletAddress && Nt(n.walletAddress) ? w("sol", g) : n.walletAddress && _t(n.walletAddress) ? w("evm", g) : n.walletAddress && St(n.walletAddress) ? w("near", g) : h("tokenSelect", {
991
+ }) : l.length && u ? w(u, g) : n.walletAddress && _t(n.walletAddress) ? w("sol", g) : n.walletAddress && yt(n.walletAddress) ? w("evm", g) : n.walletAddress && Nt(n.walletAddress) ? w("near", g) : h("tokenSelect", {
992
992
  variant: "source",
993
993
  token: g
994
994
  }));
995
995
  }, 3e3);
996
996
  return () => clearTimeout(k);
997
- }, [r, u, t]), { source: n.sourceToken, target: n.targetToken };
998
- }, As = ({
997
+ }, [r, m, t]), { source: n.sourceToken, target: n.targetToken };
998
+ }, Ss = ({
999
999
  isEnabled: e,
1000
1000
  alchemyApiKey: t
1001
1001
  }) => {
1002
1002
  const { connectedWallets: s } = y();
1003
- xt({
1003
+ Ot({
1004
1004
  isEnabled: e,
1005
1005
  connectedWallets: s,
1006
1006
  alchemyApiKey: t ?? ""
1007
1007
  });
1008
- }, Ss = (e, t) => {
1009
- const { config: s } = Ee(Ve);
1008
+ }, Ns = (e, t) => {
1009
+ const { config: s } = Re(Qe);
1010
1010
  return e.targetToken && !e.sendAddress && !!e.walletAddress && !e.targetToken.isIntent && !t.find((r) => r?.key === "sendAddress") && s.walletSupportedChains.includes(e.targetToken.blockchain);
1011
- }, Ns = ({ debug: e }) => {
1011
+ }, _s = ({ debug: e }) => {
1012
1012
  ee.onContextChange((t, s) => {
1013
1013
  const r = s;
1014
- if (e && E.debug("[WIDGET] Context changed", r), e && t.error && vn(r) && E.debug(`[WIDGET] Error set to ${t.error.code}`), Dn(r) || Ln(t, r, e))
1014
+ if (e && E.debug("[WIDGET] Context changed", r), e && t.error && Dn(r) && E.debug(`[WIDGET] Error set to ${t.error.code}`), xn(r) || Bn(t, r, e))
1015
1015
  return;
1016
- if (On(t, r)) {
1016
+ if (Fn(t, r)) {
1017
1017
  h("reset", { clearWalletAddress: !0 }), F("initial_dry");
1018
1018
  return;
1019
1019
  }
1020
- const { isChanged: n, isDry: a } = Cn(t, r);
1020
+ const { isChanged: n, isDry: a } = vn(t, r);
1021
1021
  if (n) {
1022
- if (xn(t)) {
1023
- const l = a ? "initial_dry" : "initial_wallet";
1024
- F(l, {
1022
+ if (On(t)) {
1023
+ const c = a ? "initial_dry" : "initial_wallet";
1024
+ F(c, {
1025
1025
  onMoved: () => {
1026
1026
  e && E.debug(
1027
- `[WIDGET] Inputs changed. State moved to ${l}`
1027
+ `[WIDGET] Inputs changed. State moved to ${c}`
1028
1028
  );
1029
1029
  }
1030
1030
  });
1031
1031
  }
1032
- Rn(t) || (t.quote = void 0, t.quoteStatus = "idle", t.transferStatus = { status: "idle" }), Fn(t) && (t.sendAddress = void 0), Ss(t, r) && (t.sendAddress = t.walletAddress), Bt(t);
1032
+ Rn(t) || (t.quote = void 0, t.quoteStatus = "idle", t.transferStatus = { status: "idle" }), Ln(t) && (t.sendAddress = void 0), Ns(t, r) && (t.sendAddress = t.walletAddress), qt(t);
1033
1033
  }
1034
1034
  });
1035
- }, _s = ({ debug: e }) => {
1035
+ }, ys = ({ debug: e }) => {
1036
1036
  ee.onTransition((t, s) => {
1037
1037
  e && E.debug(`===> [WIDGET] State moved from ${t} to ${s}`);
1038
1038
  });
1039
- }, ys = (e, t) => {
1040
- const { variant: s, token: r } = t, { config: n } = Ee(Ve);
1039
+ }, bs = (e, t) => {
1040
+ const { variant: s, token: r } = t, { config: n } = Re(Qe);
1041
1041
  switch (s) {
1042
1042
  case "source":
1043
1043
  if (r && r.assetId === e.targetToken?.assetId && r.isIntent === e.targetToken.isIntent && n.enableAutoTokensSwitching) {
1044
1044
  if (!e.sourceToken)
1045
1045
  return;
1046
- _e(e);
1046
+ be(e);
1047
1047
  return;
1048
1048
  }
1049
1049
  if (r && !e.sourceToken && r.assetId === e.targetToken?.assetId && r.isIntent === e.targetToken.isIntent && n.enableAutoTokensSwitching)
@@ -1054,26 +1054,26 @@ const us = (e) => {
1054
1054
  if (r && r.assetId === e.sourceToken?.assetId && r.isIntent === e.sourceToken.isIntent && n.enableAutoTokensSwitching) {
1055
1055
  if (!e.targetToken)
1056
1056
  return;
1057
- _e(e);
1057
+ be(e);
1058
1058
  return;
1059
1059
  }
1060
1060
  e.targetToken = r;
1061
1061
  break;
1062
1062
  default:
1063
- De(s, { throwError: !1 });
1063
+ Oe(s, { throwError: !1 });
1064
1064
  }
1065
1065
  }, x = (e, t) => ee.on(
1066
1066
  e,
1067
1067
  (s, r) => t(s, r, ee)
1068
- ), bs = () => {
1069
- x("quoteSetStatus", Vn), x("walletAddressSet", Kn), x("transferSetStatus", Gn), x("tokenSelectRotate", _e), x("tokenSetBalance", Hn), x("tokenSetAmount", Wn), x("depositTypeSet", Mn), x("setInputsValidating", $n), x("externalDepositTxSet", Qn), x("tokenSelect", ys), x("addressSet", Pn), x("errorSet", qn), x("quoteSet", Un), x("reset", Bn), x("validateDryInputs", Ot), x("validateExternalInputs", Ft), x("validateInternalInputs", Lt);
1070
- }, Es = Tn(({ debug: e }) => {
1068
+ ), Es = () => {
1069
+ x("quoteSetStatus", Mn), x("walletAddressSet", Hn), x("transferSetStatus", jn), x("tokenSelectRotate", be), x("tokenSetBalance", Gn), x("tokenSetAmount", Vn), x("depositTypeSet", Qn), x("setInputsValidating", Kn), x("externalDepositTxSet", $n), x("tokenSelect", bs), x("addressSet", Wn), x("errorSet", Un), x("quoteSet", Pn), x("reset", qn), x("validateDryInputs", Ft), x("validateExternalInputs", Lt), x("validateInternalInputs", Bt);
1070
+ }, Cs = gn(({ debug: e }) => {
1071
1071
  e && E.debug(
1072
- "[WIDGET] Debug mode is enabled (package version: 3.19.1)"
1073
- ), bs(), _s({ debug: e }), Ns({ debug: e });
1074
- }), Dc = ({ listenTo: e, debug: t = !1 }) => {
1075
- R(() => {
1076
- Es({ debug: t });
1072
+ "[WIDGET] Debug mode is enabled (package version: 3.21.0)"
1073
+ ), Es(), ys({ debug: e }), _s({ debug: e });
1074
+ }), Ol = ({ listenTo: e, debug: t = !1 }) => {
1075
+ C(() => {
1076
+ Cs({ debug: t });
1077
1077
  }, [t]);
1078
1078
  const s = e.find(
1079
1079
  (a) => Array.isArray(a) && a[0] === "setBalancesUsingAlchemyExt"
@@ -1082,25 +1082,25 @@ const us = (e) => {
1082
1082
  ), n = e.find(
1083
1083
  (a) => Array.isArray(a) && a[0] === "makeQuote"
1084
1084
  );
1085
- As({
1085
+ Ss({
1086
1086
  isEnabled: !!s,
1087
1087
  alchemyApiKey: s?.[1].alchemyApiKey
1088
- }), ks({
1088
+ }), As({
1089
1089
  isEnabled: !!r,
1090
1090
  skipIntents: r?.[1].skipIntents,
1091
1091
  target: r?.[1].target
1092
- }), ws({
1092
+ }), ks({
1093
1093
  isEnabled: !!n,
1094
1094
  message: n?.[1].message,
1095
1095
  type: n?.[1].type,
1096
1096
  refetchQuoteInterval: n?.[1].refetchQuoteInterval
1097
- }), hs({
1097
+ }), Ts({
1098
1098
  isEnabled: e.includes("checkWalletConnection")
1099
- }), fs({
1100
- isEnabled: e.includes("setSourceTokenBalance")
1101
1099
  }), ps({
1100
+ isEnabled: e.includes("setSourceTokenBalance")
1101
+ }), hs({
1102
1102
  isEnabled: e.includes("setSourceTokenIntentsTarget")
1103
- }), ms({
1103
+ }), fs({
1104
1104
  isEnabled: e.includes("updateBalances"),
1105
1105
  alchemyApiKey: s?.[1].alchemyApiKey
1106
1106
  });
@@ -1109,70 +1109,70 @@ class M extends Error {
1109
1109
  context;
1110
1110
  _is_widget_error = !0;
1111
1111
  constructor(t, s) {
1112
- super(t), this.name = "WidgetError", this.cause = s?.cause, this.context = Ee(Rs).context;
1112
+ super(t), this.name = "WidgetError", this.cause = s?.cause, this.context = Re(Rs).context;
1113
1113
  }
1114
1114
  }
1115
- class qt extends M {
1115
+ class Ut extends M {
1116
1116
  data;
1117
1117
  constructor(t) {
1118
1118
  super(t.code), this.data = t, this.name = "MachineError";
1119
1119
  }
1120
1120
  }
1121
- class q extends qt {
1121
+ class q extends Ut {
1122
1122
  constructor(t) {
1123
1123
  super(t), this.name = "QuoteError";
1124
1124
  }
1125
1125
  }
1126
- class I extends qt {
1126
+ class I extends Ut {
1127
1127
  constructor(t) {
1128
1128
  super(t), this.name = "TransferError";
1129
1129
  }
1130
1130
  }
1131
- const xc = (e) => typeof e == "object" && e !== null && "_is_widget_error" in e && !!e._is_widget_error, $ = ee.getStore(), Cs = fn({
1132
- usdTradeDelta: (e) => jn(e($.context)),
1133
- isDirectNearTokenWithdrawal: (e) => Xn(e($.context)),
1134
- isDirectNonNearWithdrawal: (e) => zn(e($.context)),
1135
- isDirectTokenOnNearDeposit: (e) => hn(e($.context)),
1136
- isNativeNearDeposit: (e) => pn(e($.context)),
1137
- isSameAssetDiffChainWithdrawal: (e) => Zn(e($.context)),
1138
- isDirectTokenOnNearTransfer: (e) => Yn(e($.context))
1139
- }), J = () => me(Cs), _ = () => {
1140
- const e = me($);
1131
+ const Fl = (e) => typeof e == "object" && e !== null && "_is_widget_error" in e && !!e._is_widget_error, $ = ee.getStore(), vs = pn({
1132
+ usdTradeDelta: (e) => zn(e($.context)),
1133
+ isDirectNearTokenWithdrawal: (e) => Zn(e($.context)),
1134
+ isDirectNonNearWithdrawal: (e) => Yn(e($.context)),
1135
+ isDirectTokenOnNearDeposit: (e) => Tn(e($.context)),
1136
+ isNativeNearDeposit: (e) => hn(e($.context)),
1137
+ isSameAssetDiffChainWithdrawal: (e) => Jn(e($.context)),
1138
+ isDirectTokenOnNearTransfer: (e) => Xn(e($.context))
1139
+ }), J = () => fe(vs), _ = () => {
1140
+ const e = fe($);
1141
1141
  return {
1142
1142
  state: e.state,
1143
1143
  ctx: e.context
1144
1144
  };
1145
- }, Oc = (e) => {
1146
- const t = me($);
1145
+ }, Ll = (e) => {
1146
+ const t = fe($);
1147
1147
  if (!O(t.context, [e]))
1148
1148
  throw new M(
1149
1149
  `[WIDGET] Attempt to access snapshot for ${e} state while context does not match`
1150
1150
  );
1151
1151
  return t.context;
1152
- }, vs = async ({
1152
+ }, Ds = async ({
1153
1153
  contractId: e,
1154
1154
  accountId: t
1155
1155
  }) => {
1156
1156
  try {
1157
- const s = { account_id: t }, r = qe.from(JSON.stringify(s)).toString("base64"), n = await er.query({
1157
+ const s = { account_id: t }, r = Pe.from(JSON.stringify(s)).toString("base64"), n = await tr.query({
1158
1158
  request_type: "call_function",
1159
1159
  method_name: "storage_balance_of",
1160
1160
  account_id: e,
1161
1161
  args_base64: r,
1162
1162
  finality: "optimistic"
1163
- }), a = Jn(
1163
+ }), a = er(
1164
1164
  n,
1165
- oe.union([oe.null(), oe.object({ total: oe.string() })])
1165
+ ie.union([ie.null(), ie.object({ total: ie.string() })])
1166
1166
  );
1167
1167
  return BigInt(a?.total ?? "0");
1168
1168
  } catch (s) {
1169
1169
  throw new M("Error fetching balance", { cause: s });
1170
1170
  }
1171
1171
  };
1172
- function Ds(e) {
1172
+ function xs(e) {
1173
1173
  const { ctx: t } = _(), { isNativeNearDeposit: s } = J(), r = t.sourceToken?.contractAddress, n = t.quote?.amountIn ?? t.sourceTokenAmount;
1174
1174
  return {
1175
- make: async (l, c) => {
1175
+ make: async (c, l) => {
1176
1176
  if (!e)
1177
1177
  throw new I({
1178
1178
  code: "TRANSFER_INVALID_INITIAL",
@@ -1183,7 +1183,7 @@ function Ds(e) {
1183
1183
  code: "TRANSFER_INVALID_INITIAL",
1184
1184
  meta: { message: "No token selected to transfer." }
1185
1185
  });
1186
- if (!l)
1186
+ if (!c)
1187
1187
  throw new I({
1188
1188
  code: "TRANSFER_INVALID_INITIAL",
1189
1189
  meta: { message: "No recipient address to transfer." }
@@ -1194,12 +1194,12 @@ function Ds(e) {
1194
1194
  meta: { message: "No amount to transfer." }
1195
1195
  });
1196
1196
  const d = e();
1197
- if (t.sourceToken.assetId === j && t.targetToken?.assetId !== Se) {
1197
+ if (t.sourceToken.assetId === j && t.targetToken?.assetId !== _e) {
1198
1198
  const i = await d.signAndSendTransactions({
1199
1199
  transactions: [
1200
1200
  {
1201
1201
  signerId: t.walletAddress,
1202
- receiverId: l,
1202
+ receiverId: c,
1203
1203
  actions: [
1204
1204
  {
1205
1205
  type: "Transfer",
@@ -1222,28 +1222,28 @@ function Ds(e) {
1222
1222
  intent: void 0
1223
1223
  };
1224
1224
  }
1225
- const m = [];
1225
+ const u = [];
1226
1226
  if (t.targetToken && s)
1227
1227
  try {
1228
- m.push({
1228
+ u.push({
1229
1229
  type: "FunctionCall",
1230
1230
  params: {
1231
1231
  methodName: "near_deposit",
1232
- gas: je,
1232
+ gas: Ye,
1233
1233
  deposit: n,
1234
1234
  args: {}
1235
1235
  }
1236
- }), m.push({
1236
+ }), u.push({
1237
1237
  type: "FunctionCall",
1238
1238
  params: {
1239
1239
  methodName: "ft_transfer_call",
1240
1240
  deposit: "1",
1241
1241
  // 1 yocto required by NEP-141
1242
- gas: ze,
1242
+ gas: Xe,
1243
1243
  args: {
1244
1244
  amount: n,
1245
- receiver_id: l,
1246
- msg: c ?? ""
1245
+ receiver_id: c,
1246
+ msg: l ?? ""
1247
1247
  }
1248
1248
  }
1249
1249
  });
@@ -1251,7 +1251,7 @@ function Ds(e) {
1251
1251
  transactions: [
1252
1252
  {
1253
1253
  receiverId: "wrap.near",
1254
- actions: m
1254
+ actions: u
1255
1255
  }
1256
1256
  ]
1257
1257
  });
@@ -1265,7 +1265,7 @@ function Ds(e) {
1265
1265
  code: "NO_DEPOSIT_RESULT"
1266
1266
  });
1267
1267
  } catch (i) {
1268
- if (le(i) && de(i))
1268
+ if (de(i) && ue(i))
1269
1269
  return;
1270
1270
  throw E.error("[TRANSFER ERROR]", i), new I({
1271
1271
  code: "DIRECT_TRANSFER_ERROR"
@@ -1277,33 +1277,33 @@ function Ds(e) {
1277
1277
  meta: { message: "No token selected to transfer." }
1278
1278
  });
1279
1279
  try {
1280
- const [i, u] = await Promise.all([
1281
- tr({
1280
+ const [i, m] = await Promise.all([
1281
+ nr({
1282
1282
  contractId: r
1283
1283
  }),
1284
- vs({
1284
+ Ds({
1285
1285
  contractId: r,
1286
- accountId: l
1286
+ accountId: c
1287
1287
  })
1288
- ]), p = i - u;
1289
- p > 0n && m.push({
1288
+ ]), p = i - m;
1289
+ p > 0n && u.push({
1290
1290
  type: "FunctionCall",
1291
1291
  params: {
1292
1292
  methodName: "storage_deposit",
1293
- args: { account_id: l },
1294
- gas: je,
1293
+ args: { account_id: c },
1294
+ gas: Ye,
1295
1295
  deposit: p.toString()
1296
1296
  }
1297
- }), m.push({
1297
+ }), u.push({
1298
1298
  type: "FunctionCall",
1299
1299
  params: {
1300
1300
  methodName: "ft_transfer_call",
1301
1301
  args: {
1302
- receiver_id: l,
1302
+ receiver_id: c,
1303
1303
  amount: n,
1304
- msg: c ?? ""
1304
+ msg: l ?? ""
1305
1305
  },
1306
- gas: ze,
1306
+ gas: Xe,
1307
1307
  deposit: "1"
1308
1308
  }
1309
1309
  });
@@ -1311,7 +1311,7 @@ function Ds(e) {
1311
1311
  transactions: [
1312
1312
  {
1313
1313
  receiverId: r,
1314
- actions: m
1314
+ actions: u
1315
1315
  }
1316
1316
  ]
1317
1317
  });
@@ -1325,7 +1325,7 @@ function Ds(e) {
1325
1325
  code: "NO_DEPOSIT_RESULT"
1326
1326
  });
1327
1327
  } catch (i) {
1328
- if (le(i) && de(i))
1328
+ if (de(i) && ue(i))
1329
1329
  return;
1330
1330
  throw E.error("[TRANSFER ERROR]", i), new I({
1331
1331
  code: "DIRECT_TRANSFER_ERROR"
@@ -1334,21 +1334,21 @@ function Ds(e) {
1334
1334
  }
1335
1335
  };
1336
1336
  }
1337
- const xs = ({
1337
+ const Os = ({
1338
1338
  makeTransfer: e,
1339
1339
  providers: t
1340
1340
  }) => {
1341
- const { ctx: s } = _(), { alchemyApiKey: r } = y(), { make: n } = nr({
1341
+ const { ctx: s } = _(), { alchemyApiKey: r } = y(), { make: n } = rr({
1342
1342
  provider: t?.evm
1343
- }), { make: a } = rr({
1343
+ }), { make: a } = sr({
1344
1344
  provider: t?.sol,
1345
1345
  alchemyApiKey: r
1346
- }), l = (d) => {
1346
+ }), c = (d) => {
1347
1347
  if (e)
1348
1348
  return e;
1349
- if (_t(d))
1349
+ if (yt(d))
1350
1350
  return n;
1351
- if (Nt(d))
1351
+ if (_t(d))
1352
1352
  return a;
1353
1353
  throw new I({
1354
1354
  code: "TRANSFER_INVALID_INITIAL",
@@ -1382,14 +1382,14 @@ const xs = ({
1382
1382
  decimals: s.sourceToken.decimals,
1383
1383
  address: s.quote.depositAddress,
1384
1384
  chain: s.sourceToken.blockchain,
1385
- evmChainId: G(s.sourceToken.blockchain) ? Ae[s.sourceToken.blockchain] : null,
1386
- isNativeEvmTokenTransfer: !!s.sourceToken && yt(s.sourceToken),
1385
+ evmChainId: G(s.sourceToken.blockchain) ? Ne[s.sourceToken.blockchain] : null,
1386
+ isNativeEvmTokenTransfer: !!s.sourceToken && bt(s.sourceToken),
1387
1387
  tokenAddress: s.sourceToken.assetId === j ? j : s.sourceToken.contractAddress,
1388
1388
  sourceAssetId: s.sourceToken.assetId,
1389
1389
  targetAssetId: s.targetToken.assetId
1390
- }, m = l(d.address);
1390
+ }, u = c(d.address);
1391
1391
  try {
1392
- const i = await m(d);
1392
+ const i = await u(d);
1393
1393
  if (!i) {
1394
1394
  if (e)
1395
1395
  return;
@@ -1404,14 +1404,14 @@ const xs = ({
1404
1404
  };
1405
1405
  } catch (i) {
1406
1406
  E.error("[TRANSFER ERROR]", i, { error: i });
1407
- let u = "Failed to make a transfer. Please try again.";
1408
- const p = le(i) && de(i);
1407
+ let m = "Failed to make a transfer. Please try again.";
1408
+ const p = de(i) && ue(i);
1409
1409
  if (p)
1410
1410
  return;
1411
- throw Sn.isAxiosError(i) ? (u = i.response?.data?.detail ?? i.message ?? "Failed to make deposit. Please try again.", new I({
1411
+ throw Nn.isAxiosError(i) ? (m = i.response?.data?.detail ?? i.message ?? "Failed to make deposit. Please try again.", new I({
1412
1412
  code: "QUOTE_ERROR",
1413
- meta: { message: u }
1414
- })) : u === "No quotes found" ? new I({
1413
+ meta: { message: m }
1414
+ })) : m === "No quotes found" ? new I({
1415
1415
  code: "NO_QUOTE_FOUND"
1416
1416
  }) : i instanceof Error && !p ? new I({
1417
1417
  code: "QUOTE_ERROR",
@@ -1423,7 +1423,7 @@ const xs = ({
1423
1423
  }
1424
1424
  } };
1425
1425
  };
1426
- class Os {
1426
+ class Fs {
1427
1427
  constructor(t, s) {
1428
1428
  this.account = t, this.provider = s;
1429
1429
  }
@@ -1433,7 +1433,7 @@ class Os {
1433
1433
  deadline: t.deadline,
1434
1434
  nonce: t.nonce,
1435
1435
  intents: t.intents,
1436
- signer_id: t.signer_id ?? Xe.authHandleToIntentsUserId({
1436
+ signer_id: t.signer_id ?? Je.authHandleToIntentsUserId({
1437
1437
  identifier: this.account.walletAddress,
1438
1438
  method: "evm"
1439
1439
  })
@@ -1448,14 +1448,14 @@ class Os {
1448
1448
  return {
1449
1449
  payload: s,
1450
1450
  standard: "erc191",
1451
- signature: Xe.transformERC191Signature(a)
1451
+ signature: Je.transformERC191Signature(a)
1452
1452
  };
1453
1453
  }
1454
1454
  }
1455
- const Fs = ({
1455
+ const Ls = ({
1456
1456
  walletAddress: e,
1457
1457
  getProvider: t
1458
- }) => sr({
1458
+ }) => ar({
1459
1459
  accountId: e,
1460
1460
  signMessage: async (s) => {
1461
1461
  const r = t();
@@ -1465,7 +1465,7 @@ const Fs = ({
1465
1465
  try {
1466
1466
  n = await r.signMessage({
1467
1467
  ...s,
1468
- nonce: qe.from(s.nonce)
1468
+ nonce: Pe.from(s.nonce)
1469
1469
  });
1470
1470
  } catch (a) {
1471
1471
  throw new M("Near wallet failed to sign a message", {
@@ -1479,7 +1479,7 @@ const Fs = ({
1479
1479
  signature: n.signature
1480
1480
  };
1481
1481
  }
1482
- }), Ls = (e, t) => {
1482
+ }), Bs = (e, t) => {
1483
1483
  if (t) {
1484
1484
  if (e.sendAddress)
1485
1485
  return e.sendAddress;
@@ -1494,8 +1494,8 @@ const Fs = ({
1494
1494
  meta: { message: "Quote is required for intents non-direct transfer" }
1495
1495
  });
1496
1496
  return e.quote.depositAddress;
1497
- }, Bs = async (e, t) => {
1498
- let s = Ye.getItem("nearWalletsPk")[t];
1497
+ }, qs = async (e, t) => {
1498
+ let s = Ze.getItem("nearWalletsPk")[t];
1499
1499
  if (!e.signMessage)
1500
1500
  throw new I({
1501
1501
  code: "DIRECT_TRANSFER_ERROR",
@@ -1506,14 +1506,14 @@ const Fs = ({
1506
1506
  const a = await e.signMessage({
1507
1507
  message: "Authenticate",
1508
1508
  recipient: "intents.near",
1509
- nonce: qe.from(dr(32))
1509
+ nonce: Pe.from(ur(32))
1510
1510
  });
1511
1511
  if (!a)
1512
1512
  throw new I({
1513
1513
  code: "DIRECT_TRANSFER_ERROR",
1514
1514
  meta: { message: "Signing message failed" }
1515
1515
  });
1516
- s = a.publicKey, Ye.setItem("nearWalletsPk", {
1516
+ s = a.publicKey, Ze.setItem("nearWalletsPk", {
1517
1517
  [t]: a.publicKey
1518
1518
  });
1519
1519
  } catch {
@@ -1522,12 +1522,12 @@ const Fs = ({
1522
1522
  meta: { message: "Your wallet doesn't support signing messages" }
1523
1523
  });
1524
1524
  }
1525
- const r = re({
1525
+ const r = se({
1526
1526
  walletAddress: t,
1527
1527
  addressType: "near"
1528
1528
  });
1529
- if (!await mr({
1530
- contractId: ye,
1529
+ if (!await fr({
1530
+ contractId: Ee,
1531
1531
  methodName: "has_public_key",
1532
1532
  args: {
1533
1533
  account_id: r,
@@ -1538,7 +1538,7 @@ const Fs = ({
1538
1538
  await e.signAndSendTransactions({
1539
1539
  transactions: [
1540
1540
  {
1541
- receiverId: ye,
1541
+ receiverId: Ee,
1542
1542
  signerId: t,
1543
1543
  actions: [
1544
1544
  {
@@ -1560,15 +1560,15 @@ const Fs = ({
1560
1560
  meta: { message: "Unable to add public key to intents account" }
1561
1561
  });
1562
1562
  }
1563
- }, qs = ({ providers: e }) => {
1563
+ }, Us = ({ providers: e }) => {
1564
1564
  const { ctx: t } = _(), { appName: s, intentsAccountType: r } = y(), {
1565
1565
  isNativeNearDeposit: n,
1566
1566
  isDirectNearTokenWithdrawal: a,
1567
- isDirectNonNearWithdrawal: l
1567
+ isDirectNonNearWithdrawal: c
1568
1568
  } = J();
1569
1569
  return { make: async ({
1570
1570
  message: d,
1571
- onPending: m
1571
+ onPending: u
1572
1572
  }) => {
1573
1573
  if (!t.walletAddress)
1574
1574
  throw new I({
@@ -1600,7 +1600,7 @@ const Fs = ({
1600
1600
  code: "TRANSFER_INVALID_INITIAL",
1601
1601
  meta: { message: "No EVM provider configured" }
1602
1602
  });
1603
- i = new Os(
1603
+ i = new Fs(
1604
1604
  { walletAddress: t.walletAddress },
1605
1605
  e.evm
1606
1606
  );
@@ -1611,7 +1611,7 @@ const Fs = ({
1611
1611
  code: "TRANSFER_INVALID_INITIAL",
1612
1612
  meta: { message: "No SOL provider configured" }
1613
1613
  });
1614
- i = new ur(
1614
+ i = new mr(
1615
1615
  { walletAddress: t.walletAddress },
1616
1616
  e.sol
1617
1617
  );
@@ -1622,40 +1622,40 @@ const Fs = ({
1622
1622
  code: "TRANSFER_INVALID_INITIAL",
1623
1623
  meta: { message: "No NEAR provider configured" }
1624
1624
  });
1625
- await Bs(e.near(), t.walletAddress), i = Fs({
1625
+ await qs(e.near(), t.walletAddress), i = Ls({
1626
1626
  walletAddress: t.walletAddress,
1627
1627
  getProvider: e.near
1628
1628
  });
1629
1629
  break;
1630
1630
  }
1631
1631
  default:
1632
- De(r);
1632
+ Oe(r);
1633
1633
  }
1634
- const u = new ar({ referral: gt(s) });
1635
- u.setIntentSigner(i);
1634
+ const m = new or({ referral: It(s) });
1635
+ m.setIntentSigner(i);
1636
1636
  let p;
1637
- n ? p = void 0 : a ? p = or(d ?? void 0) : l ? p = void 0 : p = ir();
1637
+ n ? p = void 0 : a ? p = ir(d ?? void 0) : c ? p = void 0 : p = lr();
1638
1638
  const w = {
1639
1639
  assetId: t.sourceToken.assetId,
1640
1640
  amount: BigInt(t.sourceTokenAmount),
1641
- destinationAddress: Ls(
1641
+ destinationAddress: Bs(
1642
1642
  t,
1643
- a || l
1643
+ a || c
1644
1644
  ),
1645
1645
  destinationMemo: void 0,
1646
1646
  feeInclusive: !0,
1647
1647
  routeConfig: p
1648
1648
  };
1649
- m("WAITING_CONFIRMATION");
1649
+ u("WAITING_CONFIRMATION");
1650
1650
  try {
1651
- const f = await u.estimateWithdrawalFee({
1651
+ const f = await m.estimateWithdrawalFee({
1652
1652
  withdrawalParams: w
1653
- }), { intentHash: g } = await u.signAndSendWithdrawalIntent({
1653
+ }), { intentHash: g } = await m.signAndSendWithdrawalIntent({
1654
1654
  withdrawalParams: w,
1655
1655
  feeEstimation: f
1656
1656
  });
1657
- m("PROCESSING");
1658
- const k = await u.waitForIntentSettlement({ intentHash: g }), b = await u.waitForWithdrawalCompletion({
1657
+ u("PROCESSING");
1658
+ const k = await m.waitForIntentSettlement({ intentHash: g }), b = await m.waitForWithdrawalCompletion({
1659
1659
  withdrawalParams: w,
1660
1660
  intentTx: k
1661
1661
  });
@@ -1663,8 +1663,8 @@ const Fs = ({
1663
1663
  intent: k.hash,
1664
1664
  // no hash means completion not trackable for this bridge
1665
1665
  hash: b.hash ?? "",
1666
- transactionLink: b.hash ? fr(
1667
- un[t.targetToken.blockchain],
1666
+ transactionLink: b.hash ? pr(
1667
+ mn[t.targetToken.blockchain],
1668
1668
  b.hash
1669
1669
  ) : ""
1670
1670
  };
@@ -1679,17 +1679,17 @@ const Fs = ({
1679
1679
  )
1680
1680
  }
1681
1681
  });
1682
- if (f instanceof lr)
1682
+ if (f instanceof dr)
1683
1683
  throw new I({
1684
1684
  code: "TRANSFER_INVALID_INITIAL",
1685
1685
  meta: { message: "Fee is above the maximum allowed" }
1686
1686
  });
1687
- if (le(f)) {
1687
+ if (de(f)) {
1688
1688
  if (f.message.includes("Fee is not estimated"))
1689
1689
  throw new I({
1690
1690
  code: "FEES_NOT_ESTIMATED"
1691
1691
  });
1692
- if (de(f))
1692
+ if (ue(f))
1693
1693
  return;
1694
1694
  }
1695
1695
  throw new I({
@@ -1697,7 +1697,7 @@ const Fs = ({
1697
1697
  });
1698
1698
  }
1699
1699
  } };
1700
- }, Us = ({
1700
+ }, Ps = ({
1701
1701
  message: e,
1702
1702
  providers: t,
1703
1703
  makeTransfer: s
@@ -1705,23 +1705,23 @@ const Fs = ({
1705
1705
  const { ctx: r } = _(), {
1706
1706
  isDirectTokenOnNearDeposit: n,
1707
1707
  isDirectTokenOnNearTransfer: a,
1708
- isNativeNearDeposit: l
1709
- } = J(), { make: c } = qs({ providers: t }), { make: d } = xs({
1708
+ isNativeNearDeposit: c
1709
+ } = J(), { make: l } = Us({ providers: t }), { make: d } = Os({
1710
1710
  makeTransfer: s,
1711
1711
  providers: t
1712
- }), { make: m } = Ds(
1712
+ }), { make: u } = xs(
1713
1713
  t?.near
1714
1714
  );
1715
1715
  return { make: async () => {
1716
1716
  if (!r.targetToken)
1717
1717
  return;
1718
- let u;
1718
+ let m;
1719
1719
  try {
1720
1720
  if (h("transferSetStatus", {
1721
1721
  status: "pending",
1722
1722
  reason: "WAITING_CONFIRMATION"
1723
1723
  }), r.sourceToken?.isIntent)
1724
- u = await c({
1724
+ m = await l({
1725
1725
  message: e,
1726
1726
  onPending: (p) => {
1727
1727
  h("transferSetStatus", {
@@ -1730,9 +1730,9 @@ const Fs = ({
1730
1730
  });
1731
1731
  }
1732
1732
  });
1733
- else if ((l || n) && !r.isDepositFromExternalWallet)
1734
- u = await m(
1735
- r.sendAddress ?? ye,
1733
+ else if ((c || n) && !r.isDepositFromExternalWallet)
1734
+ m = await u(
1735
+ r.sendAddress ?? Ee,
1736
1736
  e
1737
1737
  );
1738
1738
  else if (a) {
@@ -1741,64 +1741,64 @@ const Fs = ({
1741
1741
  code: "TRANSFER_INVALID_INITIAL",
1742
1742
  meta: { message: "No recipient address to transfer" }
1743
1743
  });
1744
- u = await m(
1744
+ m = await u(
1745
1745
  r.sendAddress,
1746
1746
  e
1747
1747
  );
1748
1748
  } else
1749
- u = await d();
1749
+ m = await d();
1750
1750
  } catch (p) {
1751
1751
  p instanceof I && (E.error(p.data), h("transferSetStatus", { status: "error" }), h("errorSet", p.data));
1752
1752
  }
1753
- if (!u) {
1753
+ if (!m) {
1754
1754
  h("transferSetStatus", { status: "idle" });
1755
1755
  return;
1756
1756
  }
1757
- return h("transferSetStatus", { status: "success" }), F("transfer_success"), u;
1757
+ return h("transferSetStatus", { status: "success" }), F("transfer_success"), m;
1758
1758
  } };
1759
- }, Ps = async (e) => {
1759
+ }, Ws = async (e) => {
1760
1760
  if (!e)
1761
1761
  return;
1762
1762
  const t = await e.request({
1763
1763
  method: "eth_chainId"
1764
1764
  });
1765
1765
  return parseInt(t, 16);
1766
- }, Ws = ({ providers: e }) => {
1767
- const { ctx: t } = _(), [s, r] = ne(!1), [n, a] = ne(!1), l = ce(async () => {
1766
+ }, Vs = ({ providers: e }) => {
1767
+ const { ctx: t } = _(), [s, r] = re(!1), [n, a] = re(!1), c = ce(async () => {
1768
1768
  const d = typeof e?.evm == "function" ? await e.evm() : e?.evm;
1769
1769
  if (!t.sourceToken || !d)
1770
1770
  return !1;
1771
- const m = await Ps(d);
1771
+ const u = await Ws(d);
1772
1772
  if (!G(t.sourceToken.blockchain))
1773
1773
  return !1;
1774
- const i = Ae[t.sourceToken.blockchain];
1775
- return !i || !m ? !1 : m !== i;
1776
- }, [t.sourceToken, e]), c = ce(async () => {
1774
+ const i = Ne[t.sourceToken.blockchain];
1775
+ return !i || !u ? !1 : u !== i;
1776
+ }, [t.sourceToken, e]), l = ce(async () => {
1777
1777
  const d = typeof e?.evm == "function" ? await e.evm() : e?.evm;
1778
1778
  if (!t.sourceToken || !d || !G(t.sourceToken.blockchain))
1779
1779
  return !1;
1780
- const m = Ae[t.sourceToken.blockchain];
1781
- if (!m)
1780
+ const u = Ne[t.sourceToken.blockchain];
1781
+ if (!u)
1782
1782
  return !1;
1783
1783
  try {
1784
- return r(!0), await pr(m, d), !0;
1784
+ return r(!0), await hr(u, d), !0;
1785
1785
  } catch (i) {
1786
1786
  return E.error("Failed to switch chain:", i), !1;
1787
1787
  } finally {
1788
1788
  r(!1);
1789
1789
  }
1790
1790
  }, [t.sourceToken, e]);
1791
- return R(() => {
1792
- l().then(a);
1793
- }, [l]), {
1791
+ return C(() => {
1792
+ c().then(a);
1793
+ }, [c]), {
1794
1794
  isSwitchingChainRequired: n,
1795
- switchChain: c,
1795
+ switchChain: l,
1796
1796
  isSwitchingChain: s
1797
1797
  };
1798
1798
  }, N = {
1799
1799
  size: "lg",
1800
1800
  variant: "primary"
1801
- }, Ue = (e) => {
1801
+ }, We = (e) => {
1802
1802
  const { t } = K();
1803
1803
  if (e.error?.code === "TOKEN_IS_NOT_SUPPORTED")
1804
1804
  return /* @__PURE__ */ o(A, { state: "error", ...N, children: t("submit.error.invalidAddress", "Invalid address") });
@@ -1817,12 +1817,12 @@ const Fs = ({
1817
1817
  if (e.error?.code === "QUOTE_AMOUNT_IS_TOO_LOW" || e.error?.code === "MIN_WITHDRAWAL_AMOUNT_ERROR")
1818
1818
  return /* @__PURE__ */ T("div", { className: "gap-sw-md flex flex-col", children: [
1819
1819
  /* @__PURE__ */ o(A, { state: "error", ...N, children: t("submit.error.amountTooLow.label", "Amount is too low") }),
1820
- /* @__PURE__ */ o(z, { children: /* @__PURE__ */ T(rn, { i18nKey: "submit.error.amountTooLow.message", children: [
1820
+ /* @__PURE__ */ o(z, { children: /* @__PURE__ */ T(sn, { i18nKey: "submit.error.amountTooLow.message", children: [
1821
1821
  "Amount you entered is very low. Please try increasing it",
1822
1822
  " ",
1823
1823
  /* @__PURE__ */ T("span", { className: "text-nowrap", children: [
1824
1824
  "above ",
1825
- /* @__PURE__ */ o(Be, { value: e.error.meta.minAmount ?? "0" }),
1825
+ /* @__PURE__ */ o(Ue, { value: e.error.meta.minAmount ?? "0" }),
1826
1826
  " ",
1827
1827
  e.sourceToken?.symbol ?? "",
1828
1828
  "."
@@ -1867,33 +1867,33 @@ const Fs = ({
1867
1867
  ] });
1868
1868
  if (e.error?.code === "SOURCE_BALANCE_INSUFFICIENT")
1869
1869
  return /* @__PURE__ */ o(A, { state: "error", ...N, children: t("submit.error.insufficientBalance", "Insufficient balance") });
1870
- }, Vs = ({ onClick: e }) => {
1870
+ }, Ms = ({ onClick: e }) => {
1871
1871
  const { t } = K();
1872
1872
  return /* @__PURE__ */ o(A, { state: "disabled", ...N, onClick: e, children: t("submit.error.connectWallet", "Connect wallet") });
1873
- }, Ms = () => {
1873
+ }, Qs = () => {
1874
1874
  const { ctx: e } = _();
1875
- return Ue(e) ?? null;
1876
- }, Qs = (e) => {
1875
+ return We(e) ?? null;
1876
+ }, $s = (e) => {
1877
1877
  const { providers: t, makeTransfer: s, onSuccess: r } = e, { ctx: n } = _(), { t: a } = K(), {
1878
- isNativeNearDeposit: l,
1879
- isDirectNonNearWithdrawal: c,
1878
+ isNativeNearDeposit: c,
1879
+ isDirectNonNearWithdrawal: l,
1880
1880
  isDirectTokenOnNearDeposit: d,
1881
- isDirectNearTokenWithdrawal: m
1882
- } = J(), { make: i } = Us({ providers: t, makeTransfer: s }), { isSwitchingChainRequired: u, switchChain: p, isSwitchingChain: w } = Ws({ providers: t }), f = Ue(n), g = async () => {
1883
- if (u && !await p())
1881
+ isDirectNearTokenWithdrawal: u
1882
+ } = J(), { make: i } = Ps({ providers: t, makeTransfer: s }), { isSwitchingChainRequired: m, switchChain: p, isSwitchingChain: w } = Vs({ providers: t }), f = We(n), g = async () => {
1883
+ if (m && !await p())
1884
1884
  return;
1885
1885
  const k = await i();
1886
1886
  k && r(k);
1887
1887
  };
1888
1888
  if (!n.targetToken)
1889
1889
  return /* @__PURE__ */ o(A, { ...N, state: "disabled", children: a("submit.disabled.selectTokenToReceive", "Select token to receive") });
1890
- if (!se(n.sourceTokenAmount))
1890
+ if (!ae(n.sourceTokenAmount))
1891
1891
  return /* @__PURE__ */ o(A, { ...N, state: "disabled", children: a("submit.disabled.enterAmount", "Enter amount") });
1892
1892
  if (n.areInputsValidating)
1893
1893
  return /* @__PURE__ */ o(A, { state: "loading", ...N, children: a("submit.pending.validating", "Validating...") });
1894
1894
  if (w)
1895
1895
  return /* @__PURE__ */ o(A, { state: "loading", ...N, children: a("submit.pending.switchingChain", "Switching network...") });
1896
- if (!u && f)
1896
+ if (!m && f)
1897
1897
  return f;
1898
1898
  if (n.transferStatus.status === "pending")
1899
1899
  switch (n.transferStatus.reason) {
@@ -1919,16 +1919,16 @@ const Fs = ({
1919
1919
  );
1920
1920
  }
1921
1921
  })() })
1922
- ] }) : n.quoteStatus === "pending" ? /* @__PURE__ */ o(A, { state: "loading", ...N, children: n.quote ? a("submit.pending.quote.refreshing", "Refreshing quote") : a("submit.pending.quote.finalizing", "Finalizing quote") }) : n.error ? /* @__PURE__ */ o(A, { state: "disabled", ...N, children: e.label }) : !n.quote && !c && !d && !m && !l ? /* @__PURE__ */ o(A, { state: "disabled", ...N, children: e.label }) : /* @__PURE__ */ o(A, { ...N, onClick: g, children: e.label });
1923
- }, $s = (e) => {
1924
- const { t } = K(), { ctx: s } = _(), r = Ue(s);
1925
- return s.isDepositFromExternalWallet ? se(s.sourceTokenAmount) ? s.externalDepositTxReceived ? /* @__PURE__ */ o(A, { state: "loading", ...N, children: t("submit.pending.externalDeposit.processing", "Processing") }) : /* @__PURE__ */ o(A, { state: "loading", ...N, children: t("submit.pending.externalDeposit.waiting", "Waiting for transaction") }) : /* @__PURE__ */ o(A, { ...N, state: "disabled", children: t("submit.disabled.enterAmount", "Enter amount") }) : r || /* @__PURE__ */ o(Qs, { ...e });
1922
+ ] }) : n.quoteStatus === "pending" ? /* @__PURE__ */ o(A, { state: "loading", ...N, children: n.quote ? a("submit.pending.quote.refreshing", "Refreshing quote") : a("submit.pending.quote.finalizing", "Finalizing quote") }) : n.error ? /* @__PURE__ */ o(A, { state: "disabled", ...N, children: e.label }) : !n.quote && !l && !d && !u && !c ? /* @__PURE__ */ o(A, { state: "disabled", ...N, children: e.label }) : /* @__PURE__ */ o(A, { ...N, onClick: g, children: e.label });
1926
1923
  }, Ks = (e) => {
1924
+ const { t } = K(), { ctx: s } = _(), r = We(s);
1925
+ return s.isDepositFromExternalWallet ? ae(s.sourceTokenAmount) ? s.externalDepositTxReceived ? /* @__PURE__ */ o(A, { state: "loading", ...N, children: t("submit.pending.externalDeposit.processing", "Processing") }) : /* @__PURE__ */ o(A, { state: "loading", ...N, children: t("submit.pending.externalDeposit.waiting", "Waiting for transaction") }) : /* @__PURE__ */ o(A, { ...N, state: "disabled", children: t("submit.disabled.enterAmount", "Enter amount") }) : r || /* @__PURE__ */ o($s, { ...e });
1926
+ }, Hs = (e) => {
1927
1927
  const { ctx: t } = _(), s = y();
1928
- return t.walletAddress ? /* @__PURE__ */ o($s, { ...e }) : /* @__PURE__ */ o(Vs, { onClick: s.onWalletSignin });
1928
+ return t.walletAddress ? /* @__PURE__ */ o(Ks, { ...e }) : /* @__PURE__ */ o(Ms, { onClick: s.onWalletSignin });
1929
1929
  };
1930
- Ks.Error = Ms;
1931
- const ot = [
1930
+ Hs.Error = Qs;
1931
+ const lt = [
1932
1932
  "nep141:eth-0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf.omft.near",
1933
1933
  // cbBTC (eth)
1934
1934
  "nep141:base-0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf.omft.near",
@@ -1941,17 +1941,17 @@ const ot = [
1941
1941
  // NEAR (bsc)
1942
1942
  "nep141:eth-0xe0f63a424a4439cbe457d80e4f4b51ad25b2c56c.omft.near"
1943
1943
  // SPX (eth)
1944
- ], Hs = () => {
1944
+ ], Gs = () => {
1945
1945
  const { tokens: e } = V();
1946
1946
  return {
1947
1947
  uniqueIntentsTokens: L(() => {
1948
1948
  const t = e.filter(
1949
- (n) => n.isIntent && n.blockchain === "near" && !ot.includes(n.assetId)
1950
- ), s = t.map((n) => n.isIntent && n.symbol), r = e.filter((n) => n.isIntent && n.blockchain !== "near" && !s.includes(n.symbol) && !ot.includes(n.assetId));
1949
+ (n) => n.isIntent && n.blockchain === "near" && !lt.includes(n.assetId)
1950
+ ), s = t.map((n) => n.isIntent && n.symbol), r = e.filter((n) => n.isIntent && n.blockchain !== "near" && !s.includes(n.symbol) && !lt.includes(n.assetId));
1951
1951
  return [...t, ...r];
1952
1952
  }, [e])
1953
1953
  };
1954
- }, Gs = ({
1954
+ }, js = ({
1955
1955
  variant: e,
1956
1956
  search: t,
1957
1957
  selectedChain: s,
@@ -1959,67 +1959,67 @@ const ot = [
1959
1959
  walletSupportedChains: n,
1960
1960
  priorityAssets: a
1961
1961
  }) => {
1962
- us(e);
1963
- const { tokens: l } = V(e), { mergedBalance: c } = he(), { intentBalances: d } = pe(), { uniqueIntentsTokens: m } = Hs(), i = qr(
1964
- c,
1962
+ ms(e);
1963
+ const { tokens: c } = V(e), { mergedBalance: l } = Te(), { intentBalances: d } = he(), { uniqueIntentsTokens: u } = Gs(), i = Ur(
1964
+ l,
1965
1965
  n,
1966
1966
  t,
1967
1967
  a
1968
- ), u = l.filter(Ur({ search: t })).filter(
1969
- Pr({
1968
+ ), m = c.filter(Pr({ search: t })).filter(
1969
+ Wr({
1970
1970
  selectedChain: s,
1971
1971
  chainsFilter: r,
1972
1972
  walletSupportedChains: n,
1973
1973
  intentBalances: d,
1974
- uniqueIntentTokenIds: m.map((p) => p.assetId)
1974
+ uniqueIntentTokenIds: u.map((p) => p.assetId)
1975
1975
  })
1976
1976
  );
1977
1977
  return {
1978
- all: u.sort(i),
1979
- intents: u.filter(et({ isIntent: !0 })).sort(i),
1980
- wallet: u.filter(et({ isIntent: !1 })).sort(i)
1978
+ all: m.sort(i),
1979
+ intents: m.filter(nt({ isIntent: !0 })).sort(i),
1980
+ wallet: m.filter(nt({ isIntent: !1 })).sort(i)
1981
1981
  };
1982
- }, js = (e, t) => {
1982
+ }, zs = (e, t) => {
1983
1983
  const s = t.assetId.substring(t.assetId.indexOf(":") + 1), r = (a) => {
1984
- const l = (m) => m.replace(/(\.\d*?[1-9])0+$/, "$1").replace(/\.0+$/, ""), c = l(t.amount), d = l(
1984
+ const c = (u) => u.replace(/(\.\d*?[1-9])0+$/, "$1").replace(/\.0+$/, ""), l = c(t.amount), d = c(
1985
1985
  a.amount.toLocaleString("en-US", {
1986
1986
  useGrouping: !1,
1987
1987
  maximumFractionDigits: 20
1988
1988
  })
1989
1989
  );
1990
- return c.startsWith(d) || d.startsWith(c);
1990
+ return l.startsWith(d) || d.startsWith(l);
1991
1991
  }, n = (a) => new Date(a.created_at) >= new Date(t.initiatedAtDate);
1992
1992
  return (e.result.deposits || []).find(
1993
1993
  (a) => a.chain === t.chainId && a.account_id === t.intentsAccountId && a.address === t.depositAddress && a.near_token_id === s && n(a) && r(a)
1994
1994
  );
1995
- }, zs = {
1995
+ }, Ys = {
1996
1996
  CREDITED: te.status.PROCESSING,
1997
1997
  PENDING: te.status.PROCESSING,
1998
1998
  COMPLETED: te.status.SUCCESS,
1999
1999
  FAILED: te.status.FAILED
2000
- }, Fc = ({ depositAddress: e }) => {
2001
- const { ctx: t } = _(), { intentsAccountType: s } = y(), [r, n] = ne(null), a = re({
2000
+ }, Bl = ({ depositAddress: e }) => {
2001
+ const { ctx: t } = _(), { intentsAccountType: s } = y(), [r, n] = re(null), a = se({
2002
2002
  addressType: s,
2003
2003
  walletAddress: t.walletAddress
2004
2004
  });
2005
2005
  return { pollDepositStatus: async ({
2006
- blockchain: c,
2006
+ blockchain: l,
2007
2007
  amount: d,
2008
- assetId: m
2008
+ assetId: u
2009
2009
  }) => {
2010
2010
  if (!a)
2011
2011
  throw new M("Unknown intents account for POA deposit check");
2012
- let i = ht[c];
2012
+ let i = Tt[l];
2013
2013
  if (!i)
2014
- if (G(c))
2015
- i = Tt;
2014
+ if (G(l))
2015
+ i = gt;
2016
2016
  else
2017
2017
  throw new M(
2018
- `Unknown chain for POA deposit check ${c}`
2018
+ `Unknown chain for POA deposit check ${l}`
2019
2019
  );
2020
- const u = r ?? (/* @__PURE__ */ new Date()).toUTCString();
2021
- r || n(u);
2022
- const p = await kt.post("", {
2020
+ const m = r ?? (/* @__PURE__ */ new Date()).toUTCString();
2021
+ r || n(m);
2022
+ const p = await At.post("", {
2023
2023
  id: 1,
2024
2024
  jsonrpc: "2.0",
2025
2025
  method: "recent_deposits",
@@ -2029,16 +2029,16 @@ const ot = [
2029
2029
  chain: i
2030
2030
  }
2031
2031
  ]
2032
- }), w = js(p.data, {
2032
+ }), w = zs(p.data, {
2033
2033
  intentsAccountId: a,
2034
- initiatedAtDate: u,
2034
+ initiatedAtDate: m,
2035
2035
  depositAddress: e,
2036
2036
  chainId: i,
2037
- assetId: m,
2037
+ assetId: u,
2038
2038
  amount: d
2039
2039
  });
2040
2040
  return w ? {
2041
- status: zs[w.status],
2041
+ status: Ys[w.status],
2042
2042
  swapDetails: {
2043
2043
  intentHashes: [""],
2044
2044
  destinationChainTxHashes: [{ hash: w.tx_hash ?? "" }]
@@ -2051,10 +2051,10 @@ const ot = [
2051
2051
  }
2052
2052
  };
2053
2053
  } };
2054
- }, Ys = ({ className: e }) => {
2054
+ }, Xs = ({ className: e }) => {
2055
2055
  const { t } = K(), { slippageTolerance: s } = y(), { ctx: r } = _(), n = r.sourceToken && r.targetToken && r.sourceToken.price / r.targetToken.price;
2056
2056
  return r.sourceToken ? /* @__PURE__ */ o(
2057
- hr,
2057
+ Tr,
2058
2058
  {
2059
2059
  expandedByDefault: !1,
2060
2060
  expandedHeightPx: r.walletAddress ? 80 : 50,
@@ -2064,26 +2064,26 @@ const ot = [
2064
2064
  title: r.sourceToken && r.targetToken ? /* @__PURE__ */ T("span", { style: { borderBottomWidth: "2px", borderStyle: "dotted" }, children: [
2065
2065
  `1 ${r.sourceToken.symbol} ≈ `,
2066
2066
  " ",
2067
- Tr(n ?? 0),
2067
+ gr(n ?? 0),
2068
2068
  " ",
2069
2069
  `${r.targetToken.symbol}`,
2070
- /* @__PURE__ */ o("span", { className: "text-sw-gray-50", children: ` (${Ze(r.sourceToken.price)})` })
2070
+ /* @__PURE__ */ o("span", { className: "text-sw-gray-50", children: ` (${et(r.sourceToken.price)})` })
2071
2071
  ] }) : /* @__PURE__ */ T("span", { style: { borderBottomWidth: "2px", borderStyle: "dotted" }, children: [
2072
2072
  `1 ${r.sourceToken.symbol} ≈ `,
2073
2073
  " ",
2074
- Ze(r.sourceToken.price),
2074
+ et(r.sourceToken.price),
2075
2075
  " USD"
2076
2076
  ] }),
2077
- children: /* @__PURE__ */ T(Te, { children: [
2077
+ children: /* @__PURE__ */ T(ge, { children: [
2078
2078
  /* @__PURE__ */ o(
2079
- Te.Item,
2079
+ ge.Item,
2080
2080
  {
2081
2081
  label: t("quote.result.maxSlippage.label", "Max slippage"),
2082
2082
  value: `${(s / 100).toFixed(2)}%`
2083
2083
  }
2084
2084
  ),
2085
2085
  !!r.walletAddress && /* @__PURE__ */ o(
2086
- Te.Item,
2086
+ ge.Item,
2087
2087
  {
2088
2088
  isLoading: r.quoteStatus === "pending",
2089
2089
  label: t("quote.result.processingTime.label", "Processing time"),
@@ -2092,28 +2092,28 @@ const ot = [
2092
2092
  )
2093
2093
  ] })
2094
2094
  }
2095
- ) : /* @__PURE__ */ o(bt, {});
2096
- }, Lc = Object.assign(Ys, {
2097
- Skeleton: bt
2098
- }), Xs = ({
2095
+ ) : /* @__PURE__ */ o(Et, {});
2096
+ }, ql = Object.assign(Xs, {
2097
+ Skeleton: Et
2098
+ }), Zs = ({
2099
2099
  token: e,
2100
2100
  balance: t,
2101
2101
  isNotSufficient: s = !1,
2102
2102
  onClick: r
2103
2103
  }) => {
2104
2104
  const n = y();
2105
- return !e.isIntent && !n.walletSupportedChains.includes(e.blockchain) ? /* @__PURE__ */ o("span", {}) : t === void 0 ? /* @__PURE__ */ o(Ir, { width: 100 }) : /* @__PURE__ */ o(
2105
+ return !e.isIntent && !n.walletSupportedChains.includes(e.blockchain) ? /* @__PURE__ */ o("span", {}) : t === void 0 ? /* @__PURE__ */ o(wr, { width: 100 }) : /* @__PURE__ */ o(
2106
2106
  "span",
2107
2107
  {
2108
2108
  onClick: t ? r : void 0,
2109
2109
  style: t ? { borderBottomWidth: "2px", borderStyle: "dotted" } : void 0,
2110
- className: gr("text-sw-label-sm", {
2110
+ className: Ir("text-sw-label-sm", {
2111
2111
  "text-sw-status-error": s,
2112
2112
  "text-sw-gray-100": !s,
2113
2113
  "cursor-pointer": !!t && !!r
2114
2114
  }),
2115
2115
  children: /* @__PURE__ */ o(
2116
- Be,
2116
+ Ue,
2117
2117
  {
2118
2118
  decimals: e.decimals,
2119
2119
  value: t === void 0 ? "0" : `${t}`
@@ -2121,26 +2121,26 @@ const ot = [
2121
2121
  )
2122
2122
  }
2123
2123
  );
2124
- }, Pe = ({
2124
+ }, Ve = ({
2125
2125
  token: e,
2126
2126
  balance: t,
2127
2127
  value: s = "",
2128
2128
  quoteUsdDelta: r,
2129
2129
  quoteUsdValue: n,
2130
2130
  state: a = "default",
2131
- showBalance: l = !0,
2132
- showQuickBalanceActions: c = !0,
2131
+ showBalance: c = !0,
2132
+ showQuickBalanceActions: l = !0,
2133
2133
  heading: d,
2134
- onMsg: m
2134
+ onMsg: u
2135
2135
  }) => {
2136
- const i = Xt(), { ctx: u } = _(), { t: p } = K(), { hideTokenInputHeadings: w } = y(), f = kr(e, s, n), g = (k) => {
2137
- m({
2136
+ const i = Zt(), { ctx: m } = _(), { t: p } = K(), { hideTokenInputHeadings: w } = y(), f = Ar(e, s, n), g = (k) => {
2137
+ u({
2138
2138
  type: "on_change_amount",
2139
- amount: wr(t, e.decimals, k)
2139
+ amount: kr(t, e.decimals, k)
2140
2140
  });
2141
2141
  };
2142
- return /* @__PURE__ */ T(fe, { className: "flex flex-col", "aria-label": d, children: [
2143
- !w && /* @__PURE__ */ o(Et, { children: d }),
2142
+ return /* @__PURE__ */ T(pe, { className: "flex flex-col", "aria-label": d, children: [
2143
+ !w && /* @__PURE__ */ o(Ct, { children: d }),
2144
2144
  /* @__PURE__ */ T(
2145
2145
  "div",
2146
2146
  {
@@ -2150,15 +2150,15 @@ const ot = [
2150
2150
  ),
2151
2151
  children: [
2152
2152
  /* @__PURE__ */ o(
2153
- Sr,
2153
+ Nr,
2154
2154
  {
2155
2155
  value: s,
2156
2156
  name: i,
2157
- setValue: Ar,
2157
+ setValue: Sr,
2158
2158
  placeholder: "0",
2159
2159
  state: a === "default" || a === "disabled" ? a : "error",
2160
2160
  onChange: (k) => {
2161
- m({ type: "on_change_amount", amount: k.target.value });
2161
+ u({ type: "on_change_amount", amount: k.target.value });
2162
2162
  }
2163
2163
  }
2164
2164
  ),
@@ -2166,7 +2166,7 @@ const ot = [
2166
2166
  "button",
2167
2167
  {
2168
2168
  type: "button",
2169
- onClick: a === "disabled" ? void 0 : () => m({ type: "on_click_select_token" }),
2169
+ onClick: a === "disabled" ? void 0 : () => u({ type: "on_click_select_token" }),
2170
2170
  className: H(
2171
2171
  "gap-sw-md pl-sw-sm pr-sw-md flex h-[36px] min-w-[80px] shrink-0 items-center rounded-sw-md transition-colors bg-sw-gray-800 hover:bg-sw-gray-700 group",
2172
2172
  {
@@ -2207,8 +2207,8 @@ const ot = [
2207
2207
  ) : null
2208
2208
  ] }),
2209
2209
  /* @__PURE__ */ T("div", { className: "gap-sw-sm flex items-center", children: [
2210
- e && !!u.walletAddress && l && /* @__PURE__ */ o(
2211
- Xs,
2210
+ e && !!m.walletAddress && c && /* @__PURE__ */ o(
2211
+ Zs,
2212
2212
  {
2213
2213
  token: e,
2214
2214
  balance: t,
@@ -2216,9 +2216,9 @@ const ot = [
2216
2216
  onClick: () => g(1)
2217
2217
  }
2218
2218
  ),
2219
- !!t && l && c && /* @__PURE__ */ T(Ht, { children: [
2219
+ !!t && c && l && /* @__PURE__ */ T(Gt, { children: [
2220
2220
  /* @__PURE__ */ o(
2221
- Je,
2221
+ tt,
2222
2222
  {
2223
2223
  isClickable: a !== "disabled",
2224
2224
  onClick: () => g(2),
@@ -2226,7 +2226,7 @@ const ot = [
2226
2226
  }
2227
2227
  ),
2228
2228
  /* @__PURE__ */ o(
2229
- Je,
2229
+ tt,
2230
2230
  {
2231
2231
  isClickable: a !== "disabled",
2232
2232
  onClick: () => g(1),
@@ -2234,20 +2234,20 @@ const ot = [
2234
2234
  }
2235
2235
  )
2236
2236
  ] }),
2237
- !l && /* @__PURE__ */ o("div", { className: "rounded-full bg-sw-gray-700 py-sw-xs px-sw-sm flex items-center justify-center", children: /* @__PURE__ */ o("span", { className: "text-sw-gray-100 text-sw-label-sm", children: p("tokens.input.externalBalance.label", "External balance") }) })
2237
+ !c && /* @__PURE__ */ o("div", { className: "rounded-full bg-sw-gray-700 py-sw-xs px-sw-sm flex items-center justify-center", children: /* @__PURE__ */ o("span", { className: "text-sw-gray-100 text-sw-label-sm", children: p("tokens.input.externalBalance.label", "External balance") }) })
2238
2238
  ] })
2239
2239
  ] })
2240
2240
  ] });
2241
- }, We = ({ onMsg: e, heading: t }) => {
2241
+ }, Me = ({ onMsg: e, heading: t }) => {
2242
2242
  const { hideTokenInputHeadings: s } = y();
2243
2243
  return /* @__PURE__ */ T(
2244
- fe,
2244
+ pe,
2245
2245
  {
2246
2246
  isClickable: !0,
2247
2247
  className: "flex flex-col",
2248
2248
  onClick: () => e({ type: "on_click_select_token" }),
2249
2249
  children: [
2250
- !s && /* @__PURE__ */ o(Et, { children: t }),
2250
+ !s && /* @__PURE__ */ o(Ct, { children: t }),
2251
2251
  /* @__PURE__ */ T(
2252
2252
  "div",
2253
2253
  {
@@ -2280,11 +2280,11 @@ const ot = [
2280
2280
  ]
2281
2281
  }
2282
2282
  );
2283
- }, Ut = (e) => {
2284
- const { mergedBalance: t } = he(), [s, r] = ne(
2283
+ }, Pt = (e) => {
2284
+ const { mergedBalance: t } = Te(), [s, r] = re(
2285
2285
  e ? t[Y(e)] : void 0
2286
2286
  );
2287
- return R(() => {
2287
+ return C(() => {
2288
2288
  let n;
2289
2289
  if (e) {
2290
2290
  const a = t[Y(e)];
@@ -2300,23 +2300,23 @@ const ot = [
2300
2300
  n && clearTimeout(n);
2301
2301
  };
2302
2302
  }, [e, t]), s;
2303
- }, Pt = (e, t) => {
2303
+ }, Wt = (e, t) => {
2304
2304
  const { tokens: s } = V(e), r = Array.from(
2305
2305
  new Set(s.map((n) => n.assetId))
2306
2306
  );
2307
- R(() => {
2307
+ C(() => {
2308
2308
  const n = r.length === 1 ? s[0] : null;
2309
2309
  n && t({ type: "on_select_token", token: n });
2310
2310
  }, [s]);
2311
- }, Zs = ({
2311
+ }, Js = ({
2312
2312
  onMsg: e,
2313
2313
  isChanging: t = !0,
2314
2314
  showBalance: s = !0,
2315
2315
  heading: r
2316
2316
  }) => {
2317
- const { ctx: n } = _(), a = Ut(n.sourceToken);
2318
- Pt("source", e);
2319
- const l = L(() => {
2317
+ const { ctx: n } = _(), a = Pt(n.sourceToken);
2318
+ Wt("source", e);
2319
+ const c = L(() => {
2320
2320
  if (!t && n.quoteStatus === "pending")
2321
2321
  return "disabled";
2322
2322
  if (!n.error)
@@ -2327,28 +2327,28 @@ const ot = [
2327
2327
  return "error-balance";
2328
2328
  }, [t, n.error, n.quoteStatus]);
2329
2329
  return n.sourceToken ? /* @__PURE__ */ o(
2330
- Pe,
2330
+ Ve,
2331
2331
  {
2332
2332
  heading: r,
2333
2333
  token: n.sourceToken,
2334
- state: l,
2334
+ state: c,
2335
2335
  balance: a,
2336
2336
  showBalance: s,
2337
2337
  showQuickBalanceActions: !0,
2338
2338
  value: X(n.sourceTokenAmount, n.sourceToken?.decimals),
2339
2339
  onMsg: e
2340
2340
  }
2341
- ) : /* @__PURE__ */ o(We, { heading: r, onMsg: e });
2342
- }, Js = ({
2341
+ ) : /* @__PURE__ */ o(Me, { heading: r, onMsg: e });
2342
+ }, ea = ({
2343
2343
  isChanging: e = !1,
2344
2344
  onMsg: t,
2345
2345
  heading: s
2346
2346
  }) => {
2347
- const { ctx: r } = _(), { usdTradeDelta: n } = J(), a = Ut(r.targetToken);
2348
- Pt("target", t);
2349
- const l = L(() => !e && r.quoteStatus === "pending" ? "disabled" : "default", [e, r.quoteStatus]);
2347
+ const { ctx: r } = _(), { usdTradeDelta: n } = J(), a = Pt(r.targetToken);
2348
+ Wt("target", t);
2349
+ const c = L(() => !e && r.quoteStatus === "pending" ? "disabled" : "default", [e, r.quoteStatus]);
2350
2350
  return r.targetToken ? /* @__PURE__ */ o(
2351
- Pe,
2351
+ Ve,
2352
2352
  {
2353
2353
  heading: s,
2354
2354
  token: r.targetToken,
@@ -2356,26 +2356,26 @@ const ot = [
2356
2356
  quoteUsdDelta: n?.percentage,
2357
2357
  quoteUsdValue: r.quote && parseFloat(r.quote.amountOutUsd),
2358
2358
  value: X(r.targetTokenAmount, r.targetToken?.decimals),
2359
- state: l,
2359
+ state: c,
2360
2360
  showQuickBalanceActions: !1,
2361
2361
  showBalance: !0,
2362
2362
  onMsg: t
2363
2363
  }
2364
- ) : /* @__PURE__ */ o(We, { heading: s, onMsg: t });
2365
- }, ea = ({ token: e, heading: t, ...s }) => e ? /* @__PURE__ */ o(Pe, { ...s, token: e, heading: t }) : /* @__PURE__ */ o(We, { onMsg: s.onMsg, heading: t }), Bc = Object.assign(ea, {
2366
- Skeleton: Nr,
2367
- Source: Zs,
2368
- Target: Js
2369
- }), Wt = ({
2364
+ ) : /* @__PURE__ */ o(Me, { heading: s, onMsg: t });
2365
+ }, ta = ({ token: e, heading: t, ...s }) => e ? /* @__PURE__ */ o(Ve, { ...s, token: e, heading: t }) : /* @__PURE__ */ o(Me, { onMsg: s.onMsg, heading: t }), Ul = Object.assign(ta, {
2366
+ Skeleton: _r,
2367
+ Source: Js,
2368
+ Target: ea
2369
+ }), Vt = ({
2370
2370
  token: e,
2371
2371
  balance: t,
2372
2372
  showBalance: s = !0,
2373
2373
  isNotSelectable: r,
2374
2374
  isFocused: n,
2375
2375
  className: a,
2376
- onMsg: l
2376
+ onMsg: c
2377
2377
  }) => {
2378
- const { ctx: c } = _(), { walletSupportedChains: d, appName: m } = y(), i = _r(t, e), u = d.includes(e.blockchain) || e.isIntent, p = t !== "0" && t !== 0 && t !== void 0;
2378
+ const { ctx: l } = _(), { walletSupportedChains: d, appName: u } = y(), i = yr(t, e), m = d.includes(e.blockchain) || e.isIntent, p = t !== "0" && t !== 0 && t !== void 0;
2379
2379
  return /* @__PURE__ */ o("li", { className: "list-none group", children: /* @__PURE__ */ T(
2380
2380
  "div",
2381
2381
  {
@@ -2388,7 +2388,7 @@ const ot = [
2388
2388
  },
2389
2389
  a
2390
2390
  ),
2391
- onClick: () => !r && l({ type: "on_select_token", token: e }),
2391
+ onClick: () => !r && c({ type: "on_select_token", token: e }),
2392
2392
  children: [
2393
2393
  /* @__PURE__ */ o(
2394
2394
  Rt,
@@ -2406,16 +2406,16 @@ const ot = [
2406
2406
  e.isIntent ? /* @__PURE__ */ T("div", { className: "flex items-center gap-sw-xs", children: [
2407
2407
  /* @__PURE__ */ o("span", { className: "text-sw-label-md text-sw-gray-300", children: e.symbol }),
2408
2408
  " ",
2409
- /* @__PURE__ */ o("span", { className: "text-sw-label-sm text-sw-gray-300", children: `on ${m} ${e.chainName.toLowerCase() !== "near" && p ? `(${e.chainName})` : ""}` })
2409
+ /* @__PURE__ */ o("span", { className: "text-sw-label-sm text-sw-gray-300", children: `on ${u} ${e.chainName.toLowerCase() !== "near" && p ? `(${e.chainName})` : ""}` })
2410
2410
  ] }) : /* @__PURE__ */ T("div", { className: "flex items-center gap-sw-xs", children: [
2411
2411
  /* @__PURE__ */ o("span", { className: "text-sw-label-md text-sw-gray-300", children: e.symbol }),
2412
2412
  " ",
2413
2413
  /* @__PURE__ */ o("span", { className: "text-sw-label-sm text-sw-gray-300", children: `on ${e.chainName}` })
2414
2414
  ] })
2415
2415
  ] }),
2416
- u && !!c.walletAddress && s && /* @__PURE__ */ T("div", { className: "gap-sw-xs flex flex-col items-end", children: [
2416
+ m && !!l.walletAddress && s && /* @__PURE__ */ T("div", { className: "gap-sw-xs flex flex-col items-end", children: [
2417
2417
  t === void 0 && !e.isIntent ? /* @__PURE__ */ o("span", { className: "h-[16px] w-[60px] animate-pulse rounded-full bg-sw-gray-700" }) : /* @__PURE__ */ o("span", { className: "h-[16px] text-sw-label-md text-sw-gray-50", children: p && /* @__PURE__ */ o(
2418
- Be,
2418
+ Ue,
2419
2419
  {
2420
2420
  decimals: e.decimals,
2421
2421
  value: t === void 0 ? "0" : `${t}`
@@ -2426,25 +2426,25 @@ const ot = [
2426
2426
  ]
2427
2427
  }
2428
2428
  ) });
2429
- }, ta = ({
2429
+ }, na = ({
2430
2430
  variant: e,
2431
2431
  search: t,
2432
2432
  className: s,
2433
2433
  groupTokens: r,
2434
2434
  showBalances: n,
2435
2435
  chainsFilter: a,
2436
- selectedChain: l,
2437
- chainIsNotSupported: c,
2436
+ selectedChain: c,
2437
+ chainIsNotSupported: l,
2438
2438
  onMsg: d
2439
2439
  }) => {
2440
- const { t: m } = K(), { ctx: i } = _(), { walletSupportedChains: u, appName: p, priorityAssets: w = [] } = y(), { mergedBalance: f } = he(), g = Gs({
2440
+ const { t: u } = K(), { ctx: i } = _(), { walletSupportedChains: m, appName: p, priorityAssets: w = [] } = y(), { mergedBalance: f } = Te(), g = js({
2441
2441
  variant: e,
2442
2442
  search: t,
2443
2443
  chainsFilter: a,
2444
- selectedChain: l,
2445
- walletSupportedChains: u,
2444
+ selectedChain: c,
2445
+ walletSupportedChains: m,
2446
2446
  priorityAssets: w
2447
- }), k = i.walletAddress ? r : !1, b = Lr(g.all, t), B = Z(null), [D, C] = ne(-1), S = L(
2447
+ }), k = i.walletAddress ? r : !1, b = Br(g.all, t), B = Z(null), [D, R] = re(-1), S = L(
2448
2448
  () => [{ tokens: g.all }],
2449
2449
  [g.all]
2450
2450
  ), U = L(() => [
@@ -2454,29 +2454,29 @@ const ot = [
2454
2454
  ] : [],
2455
2455
  ...g.wallet.length > 0 ? [
2456
2456
  {
2457
- label: c ? null : "Connected wallet",
2457
+ label: l ? null : "Connected wallet",
2458
2458
  count: g.wallet.length
2459
2459
  },
2460
2460
  { tokens: g.wallet }
2461
2461
  ] : []
2462
- ].filter(Boolean), [g.wallet, g.intents, c]), Q = k ? U : S, ae = Fr(Q), Mt = xr(Q), Me = vr(Q), Qt = ce(() => {
2463
- C(-1);
2462
+ ].filter(Boolean), [g.wallet, g.intents, l]), Q = k ? U : S, oe = Lr(Q), Qt = Or(Q), $e = Dr(Q), $t = ce(() => {
2463
+ R(-1);
2464
2464
  }, []);
2465
- switch (br({
2465
+ switch (Er({
2466
2466
  listRef: B.current,
2467
2467
  initialFocusedIndex: k ? 1 : 0,
2468
- onFocus: (P) => C(P),
2469
- onBlur: Qt
2468
+ onFocus: (P) => R(P),
2469
+ onBlur: $t
2470
2470
  }), b) {
2471
2471
  case "EMPTY_SEARCH":
2472
2472
  return /* @__PURE__ */ o(
2473
- be,
2473
+ Ce,
2474
2474
  {
2475
2475
  hasAction: !0,
2476
2476
  actionType: "outlined",
2477
- actionLabel: m("tokens.list.searchReset.label", "Clear search"),
2478
- heading: m("tokens.list.searchEmpty.label", "No results"),
2479
- subHeading: m(
2477
+ actionLabel: u("tokens.list.searchReset.label", "Clear search"),
2478
+ heading: u("tokens.list.searchEmpty.label", "No results"),
2479
+ subHeading: u(
2480
2480
  "tokens.list.searchEmpty.subLabel",
2481
2481
  "Try another search or check if a specific network is selected."
2482
2482
  ),
@@ -2486,17 +2486,17 @@ const ot = [
2486
2486
  );
2487
2487
  case "HAS_TOKENS":
2488
2488
  return /* @__PURE__ */ o("div", { className: H("gap-sw-lg flex flex-col", s), children: /* @__PURE__ */ o(
2489
- yr,
2489
+ br,
2490
2490
  {
2491
2491
  ref: B,
2492
2492
  tabIndex: 0,
2493
- id: Cr,
2493
+ id: vr,
2494
2494
  itemSize: Rr,
2495
2495
  className: "hide-scrollbar",
2496
2496
  style: {
2497
2497
  minHeight: 200,
2498
- height: ae,
2499
- maxHeight: Er,
2498
+ height: oe,
2499
+ maxHeight: Cr,
2500
2500
  overflowAnchor: "none",
2501
2501
  outline: "none"
2502
2502
  },
@@ -2506,7 +2506,7 @@ const ot = [
2506
2506
  case "ArrowUp": {
2507
2507
  P.preventDefault();
2508
2508
  let v = Math.max(D - 1, 0);
2509
- k && Me.includes(v) && (v = v === 0 ? 1 : v - 1), C(v), B.current?.scrollToIndex(v, {
2509
+ k && $e.includes(v) && (v = v === 0 ? 1 : v - 1), R(v), B.current?.scrollToIndex(v, {
2510
2510
  align: "center",
2511
2511
  smooth: !0
2512
2512
  });
@@ -2514,8 +2514,8 @@ const ot = [
2514
2514
  }
2515
2515
  case "ArrowDown": {
2516
2516
  P.preventDefault();
2517
- let v = Math.min(D + 1, Mt - 1);
2518
- k && Me.includes(v) && (v = v === 0 ? 1 : v + 1), C(v), B.current?.scrollToIndex(v, {
2517
+ let v = Math.min(D + 1, Qt - 1);
2518
+ k && $e.includes(v) && (v = v === 0 ? 1 : v + 1), R(v), B.current?.scrollToIndex(v, {
2519
2519
  align: "center",
2520
2520
  smooth: !0
2521
2521
  });
@@ -2523,41 +2523,41 @@ const ot = [
2523
2523
  }
2524
2524
  case "Enter": {
2525
2525
  P.preventDefault();
2526
- const v = Or(Q, D);
2526
+ const v = Fr(Q, D);
2527
2527
  v && d({ type: "on_select_token", token: v });
2528
2528
  break;
2529
2529
  }
2530
2530
  }
2531
2531
  },
2532
2532
  children: Q.map(
2533
- ({ label: P, count: v, tokens: Qe }, $e) => {
2534
- const $t = Dr(
2533
+ ({ label: P, count: v, tokens: Ke }, He) => {
2534
+ const Kt = xr(
2535
2535
  Q,
2536
- $e
2536
+ He
2537
2537
  );
2538
2538
  return P !== void 0 ? P ? /* @__PURE__ */ T(
2539
2539
  "header",
2540
2540
  {
2541
2541
  className: "pb-sw-lg pt-sw-sm flex flex-col",
2542
2542
  children: [
2543
- /* @__PURE__ */ o(Br, {}),
2543
+ /* @__PURE__ */ o(qr, {}),
2544
2544
  /* @__PURE__ */ o("span", { className: "text-sw-label-sm pt-sw-xl text-sw-gray-100", children: `${P} — ${v}` })
2545
2545
  ]
2546
2546
  },
2547
2547
  P
2548
- ) : /* @__PURE__ */ o("header", {}, $e) : Qe ? Qe.map((Ke, Kt) => {
2549
- const He = Y(Ke);
2548
+ ) : /* @__PURE__ */ o("header", {}, He) : Ke ? Ke.map((Ge, Ht) => {
2549
+ const je = Y(Ge);
2550
2550
  return /* @__PURE__ */ o(
2551
- Wt,
2551
+ Vt,
2552
2552
  {
2553
- token: Ke,
2553
+ token: Ge,
2554
2554
  showBalance: n,
2555
- balance: f[He],
2556
- isFocused: D === $t + Kt,
2557
- isNotSelectable: c && !!i.walletAddress,
2555
+ balance: f[je],
2556
+ isFocused: D === Kt + Ht,
2557
+ isNotSelectable: l && !!i.walletAddress,
2558
2558
  onMsg: d
2559
2559
  },
2560
- He
2560
+ je
2561
2561
  );
2562
2562
  }) : null;
2563
2563
  }
@@ -2567,52 +2567,65 @@ const ot = [
2567
2567
  case "NO_TOKENS":
2568
2568
  default:
2569
2569
  return /* @__PURE__ */ o(
2570
- be,
2570
+ Ce,
2571
2571
  {
2572
2572
  className: "pt-sw-5xl pb-sw-5xl",
2573
- subHeading: m(
2573
+ subHeading: u(
2574
2574
  "tokens.list.noBalanceOnApp.subLabel",
2575
2575
  "Deposit funds to get started"
2576
2576
  ),
2577
- heading: m("tokens.list.noBalanceOnApp.label", {
2577
+ heading: u("tokens.list.noBalanceOnApp.label", {
2578
2578
  defaultValue: "You have no balances on {{appName}}",
2579
2579
  appName: p
2580
2580
  })
2581
2581
  }
2582
2582
  );
2583
2583
  }
2584
- }, qc = Object.assign(ta, {
2585
- Placeholder: be,
2586
- Item: Wt
2587
- }), ie = (e, t, s) => {
2584
+ }, Pl = Object.assign(na, {
2585
+ Placeholder: Ce,
2586
+ Item: Vt
2587
+ }), le = (e, t, s) => {
2588
2588
  let r = document.body;
2589
- s instanceof HTMLElement && (r = s), r.style.setProperty(`--c-sw-${e}`, t);
2590
- }, na = (e, t, s) => {
2589
+ s instanceof HTMLElement && (r = s), r.style.setProperty(e, t);
2590
+ }, ne = (e, t, s) => {
2591
+ le(`--c-sw-${e}`, t, s);
2592
+ }, ra = (e, t, s) => {
2591
2593
  Object.entries(e).forEach(([r, n]) => {
2592
- ie(`${t}-${r}`, n, s);
2594
+ ne(`${t}-${r}`, n, s);
2593
2595
  });
2594
- }, it = (e, t, s, r, n) => {
2595
- const a = Vr(r, n, t);
2596
- a && na(a, e, s);
2597
- }, ra = (e, t) => {
2596
+ }, ke = (e, t, s, r, n) => {
2597
+ const a = Mr(r, n, t);
2598
+ a && ra(a, e, s);
2599
+ }, sa = (e, t) => {
2600
+ const s = {
2601
+ none: { sm: 0, md: 0, lg: 0 },
2602
+ sm: { sm: 4, md: 6, lg: 10 },
2603
+ md: { sm: 6, md: 10, lg: 16 },
2604
+ lg: { sm: 8, md: 24, lg: 24 }
2605
+ };
2606
+ le("--r-sw-sm", `${s[e].sm}px`, t), le("--r-sw-md", `${s[e].md}px`, t), le("--r-sw-lg", `${s[e].lg}px`, t);
2607
+ }, aa = (e, t) => {
2598
2608
  const {
2599
2609
  primaryColor: s,
2600
2610
  surfaceColor: r,
2601
- successColor: n,
2602
- warningColor: a,
2611
+ containerColor: n,
2612
+ successColor: a,
2613
+ warningColor: c,
2603
2614
  errorColor: l,
2604
- colorScheme: c = "dark"
2615
+ colorScheme: d = "dark",
2616
+ borderRadius: u = "md",
2617
+ stylePreset: i = "clean"
2605
2618
  } = t;
2606
- s && it("accent", 500, e, s, c), r && it("gray", 950, e, r, c), n && ie("status-success", n, e), a && ie("status-warning", a, e), l && ie("status-error", l, e);
2607
- }, sa = ut(void 0), aa = ({ children: e, theme: t }) => {
2619
+ s && (ke("accent", 500, e, s, d), i === "bold" && ke("gray", 50, e, s, d)), r && i === "clean" && ke("gray", 950, e, r, d), n && ne("container", n, e), a && ne("status-success", a, e), c && ne("status-warning", c, e), l && ne("status-error", l, e), u && sa(u, e);
2620
+ }, oa = mt(void 0), ia = ({ children: e, theme: t }) => {
2608
2621
  const { themeParentElementSelector: s } = y(), r = L(() => t, [t]);
2609
- return R(() => {
2622
+ return C(() => {
2610
2623
  if (t) {
2611
2624
  const n = s ? document.querySelector(s) : null;
2612
- ra(n, t);
2625
+ aa(n, t);
2613
2626
  }
2614
- }, [t]), /* @__PURE__ */ o(sa.Provider, { value: r, children: /* @__PURE__ */ o("div", { className: "sw", children: e }) });
2615
- }, we = ({
2627
+ }, [t]), /* @__PURE__ */ o(oa.Provider, { value: r, children: /* @__PURE__ */ o("div", { className: "sw", children: e }) });
2628
+ }, Ae = ({
2616
2629
  text: e,
2617
2630
  icon: t
2618
2631
  }) => /* @__PURE__ */ T("li", { className: "flex items-center gap-sw-md", children: [
@@ -2634,27 +2647,27 @@ const ot = [
2634
2647
  /* @__PURE__ */ o("span", { className: "text-sw-label-md", children: e })
2635
2648
  ]
2636
2649
  }
2637
- ), oa = ({ isSigned: e, isSigning: t, onMsg: s }) => {
2650
+ ), la = ({ isSigned: e, isSigning: t, onMsg: s }) => {
2638
2651
  const { t: r } = K(), n = () => s({ type: "on_close" });
2639
- Ct("Escape", n);
2640
- const a = Gr({
2652
+ vt("Escape", n);
2653
+ const a = jr({
2641
2654
  endTime: 0,
2642
2655
  autostart: !1,
2643
2656
  timerType: "DECREMENTAL",
2644
2657
  initialTime: 7,
2645
2658
  onTimeOver: n
2646
2659
  });
2647
- return R(() => {
2660
+ return C(() => {
2648
2661
  e ? a.start() : a.reset();
2649
- }, [e]), /* @__PURE__ */ T(fe, { className: "relative w-full gap-sw-2xl flex flex-col", children: [
2662
+ }, [e]), /* @__PURE__ */ T(pe, { className: "relative w-full gap-sw-2xl flex flex-col", children: [
2650
2663
  /* @__PURE__ */ o(
2651
- vt,
2664
+ Dt,
2652
2665
  {
2653
2666
  onClick: n,
2654
2667
  className: "absolute top-sw-2xl right-sw-2xl"
2655
2668
  }
2656
2669
  ),
2657
- /* @__PURE__ */ o(Qr, { size: 48, className: "text-sw-status-warning" }),
2670
+ /* @__PURE__ */ o($r, { size: 48, className: "text-sw-status-warning" }),
2658
2671
  /* @__PURE__ */ T("header", { className: "flex flex-col gap-sw-lg", children: [
2659
2672
  /* @__PURE__ */ o("h1", { className: "text-sw-label-lg text-sw-gray-50", children: r(
2660
2673
  "walletCompatibility.modal.title.initial",
@@ -2667,33 +2680,33 @@ const ot = [
2667
2680
  ] }),
2668
2681
  /* @__PURE__ */ T("ul", { className: "flex flex-col gap-sw-xl", children: [
2669
2682
  /* @__PURE__ */ o(
2670
- we,
2683
+ Ae,
2671
2684
  {
2672
2685
  text: r(
2673
2686
  "walletCompatibility.modal.feature.secureTransactions",
2674
2687
  "Read-only signature – no gas required."
2675
2688
  ),
2676
- icon: $r
2689
+ icon: Kr
2677
2690
  }
2678
2691
  ),
2679
2692
  /* @__PURE__ */ o(
2680
- we,
2693
+ Ae,
2681
2694
  {
2682
2695
  text: r(
2683
2696
  "walletCompatibility.modal.feature.fullAccess",
2684
2697
  "No access to your funds, no hidden permissions."
2685
2698
  ),
2686
- icon: Kr
2699
+ icon: Hr
2687
2700
  }
2688
2701
  ),
2689
2702
  /* @__PURE__ */ o(
2690
- we,
2703
+ Ae,
2691
2704
  {
2692
2705
  text: r(
2693
2706
  "walletCompatibility.modal.feature.fundProtection",
2694
2707
  "Only checks whether your wallet is supported."
2695
2708
  ),
2696
- icon: Mr
2709
+ icon: Qr
2697
2710
  }
2698
2711
  )
2699
2712
  ] }),
@@ -2706,7 +2719,7 @@ const ot = [
2706
2719
  "Wallet verified"
2707
2720
  ),
2708
2721
  className: "bg-sw-status-success text-sw-gray-950",
2709
- icon: Wr
2722
+ icon: Vr
2710
2723
  }
2711
2724
  ),
2712
2725
  a.status === "RUNNING" && /* @__PURE__ */ o(
@@ -2744,17 +2757,17 @@ const ot = [
2744
2757
  )
2745
2758
  ] })
2746
2759
  ] });
2747
- }, ia = ({ onMsg: e }) => {
2760
+ }, ca = ({ onMsg: e }) => {
2748
2761
  const { t } = K(), s = () => e({ type: "on_close" });
2749
- return Ct("Escape", s), /* @__PURE__ */ T(fe, { className: "relative w-full gap-sw-2xl flex flex-col", children: [
2762
+ return vt("Escape", s), /* @__PURE__ */ T(pe, { className: "relative w-full gap-sw-2xl flex flex-col", children: [
2750
2763
  /* @__PURE__ */ o(
2751
- vt,
2764
+ Dt,
2752
2765
  {
2753
2766
  onClick: s,
2754
2767
  className: "absolute top-sw-2xl right-sw-2xl"
2755
2768
  }
2756
2769
  ),
2757
- /* @__PURE__ */ o(Hr, { size: 48, className: "text-sw-status-error" }),
2770
+ /* @__PURE__ */ o(Gr, { size: 48, className: "text-sw-status-error" }),
2758
2771
  /* @__PURE__ */ T("header", { className: "flex flex-col gap-sw-lg", children: [
2759
2772
  /* @__PURE__ */ o("h1", { className: "text-sw-label-lg text-sw-gray-50", children: t(
2760
2773
  "walletCompatibility.modal.title.error",
@@ -2790,9 +2803,9 @@ const ot = [
2790
2803
  )
2791
2804
  ] })
2792
2805
  ] });
2793
- }, Uc = Object.assign(oa, {
2794
- Error: ia
2795
- }), ca = (e) => null, la = (e) => (t) => {
2806
+ }, Wl = Object.assign(la, {
2807
+ Error: ca
2808
+ }), da = (e) => null, ua = (e) => (t) => {
2796
2809
  if (t instanceof M)
2797
2810
  throw t;
2798
2811
  const s = new M(
@@ -2800,34 +2813,34 @@ const ot = [
2800
2813
  { cause: t }
2801
2814
  );
2802
2815
  throw s.context = e, s;
2803
- }, da = ({ children: e }) => {
2816
+ }, ma = ({ children: e }) => {
2804
2817
  const { ctx: t } = _();
2805
2818
  return /* @__PURE__ */ o(
2806
- Yr,
2819
+ Xr,
2807
2820
  {
2808
- FallbackComponent: ca,
2809
- onError: la(t),
2821
+ FallbackComponent: da,
2822
+ onError: ua(t),
2810
2823
  children: e
2811
2824
  }
2812
2825
  );
2813
- }, ua = new tn({
2826
+ }, fa = new nn({
2814
2827
  defaultOptions: {
2815
2828
  queries: {
2816
2829
  staleTime: 2e3 * 60,
2817
- retry: lt.env.NODE_ENV === "test" ? !1 : 3
2830
+ retry: dt.env.NODE_ENV === "test" ? !1 : 3
2818
2831
  }
2819
2832
  }
2820
- }), ma = ["fms", "abg", "stjack", "noear", "testnebula"], ue = {
2833
+ }), pa = ["fms", "abg", "stjack", "noear", "testnebula"], me = {
2821
2834
  appName: "Unknown",
2822
2835
  slippageTolerance: 100,
2823
2836
  // 1%
2824
2837
  intentsAccountType: "evm",
2825
- walletSupportedChains: mn,
2838
+ walletSupportedChains: fn,
2826
2839
  connectedWallets: {},
2827
2840
  enableAutoTokensSwitching: !0,
2828
2841
  showIntentTokens: !0,
2829
- chainsOrder: pt,
2830
- filterTokens: (e) => !ma.includes(e.symbol.toLocaleLowerCase()),
2842
+ chainsOrder: ht,
2843
+ filterTokens: (e) => !pa.includes(e.symbol.toLocaleLowerCase()),
2831
2844
  chainsFilter: {
2832
2845
  source: { external: "wallet-supported", intents: "none" },
2833
2846
  target: { external: "all", intents: "none" }
@@ -2844,16 +2857,16 @@ const ot = [
2844
2857
  return ["eth", "btc", "sol", "near"];
2845
2858
  }
2846
2859
  }
2847
- }, Vt = ut({
2848
- config: ue
2849
- }), Ve = dt({
2850
- config: ue
2860
+ }, Mt = mt({
2861
+ config: me
2862
+ }), Qe = ut({
2863
+ config: me
2851
2864
  }), y = () => {
2852
- const e = Zt(Vt);
2853
- return me(e).config;
2854
- }, fa = (e) => {
2855
- Ve.config = ke(e);
2856
- }, Pc = ({
2865
+ const e = Jt(Mt);
2866
+ return fe(e).config;
2867
+ }, ha = (e) => {
2868
+ Qe.config = Se(e);
2869
+ }, Vl = ({
2857
2870
  children: e,
2858
2871
  config: t,
2859
2872
  balanceViaRpc: s = !0,
@@ -2862,109 +2875,109 @@ const ot = [
2862
2875
  rpcs: n,
2863
2876
  theme: a
2864
2877
  }) => {
2865
- const l = Z(
2866
- dt({
2867
- config: ke({
2868
- ...ue,
2878
+ const c = Z(
2879
+ ut({
2880
+ config: Se({
2881
+ ...me,
2869
2882
  ...t
2870
2883
  })
2871
2884
  })
2872
2885
  );
2873
- return R(() => {
2874
- const c = ke({
2875
- ...ue,
2886
+ return C(() => {
2887
+ const l = Se({
2888
+ ...me,
2876
2889
  ...t
2877
2890
  });
2878
- Object.assign(l.current.config, c), fa(c);
2879
- }, [t]), an(r ?? {}), zr("headlessui-portal-root", "sw"), /* @__PURE__ */ o(nn, { client: ua, children: /* @__PURE__ */ o(sn, { i18n: Gt, children: /* @__PURE__ */ T(Vt.Provider, { value: l.current, children: [
2880
- /* @__PURE__ */ T(jt, { children: [
2881
- /* @__PURE__ */ T(zt, { children: [
2891
+ Object.assign(c.current.config, l), ha(l);
2892
+ }, [t]), on(r ?? {}), Yr("headlessui-portal-root", "sw"), /* @__PURE__ */ o(rn, { client: fa, children: /* @__PURE__ */ o(an, { i18n: jt, children: /* @__PURE__ */ T(Mt.Provider, { value: c.current, children: [
2893
+ /* @__PURE__ */ T(zt, { children: [
2894
+ /* @__PURE__ */ T(Yt, { children: [
2882
2895
  /* @__PURE__ */ o("link", { rel: "preconnect", href: "https://rsms.me/" }),
2883
2896
  /* @__PURE__ */ o("link", { rel: "stylesheet", href: "https://rsms.me/inter/inter.css" })
2884
2897
  ] }),
2885
- /* @__PURE__ */ o(aa, { theme: a, children: lt.env.NODE_ENV === "test" ? e : /* @__PURE__ */ o(da, { children: e }) })
2898
+ /* @__PURE__ */ o(ia, { theme: a, children: dt.env.NODE_ENV === "test" ? e : /* @__PURE__ */ o(ma, { children: e }) })
2886
2899
  ] }),
2887
2900
  s && /* @__PURE__ */ o(
2888
- ls,
2901
+ ds,
2889
2902
  {
2890
- rpcs: n ?? jr,
2903
+ rpcs: n ?? zr,
2891
2904
  connectedWallets: t.connectedWallets ?? {}
2892
2905
  }
2893
2906
  )
2894
2907
  ] }) }) });
2895
2908
  };
2896
2909
  export {
2897
- vs as $,
2898
- Fc as A,
2899
- ls as B,
2900
- sa as C,
2901
- ns as D,
2902
- tt as E,
2903
- ms as F,
2904
- fs as G,
2905
- ps as H,
2906
- hs as I,
2907
- Is as J,
2908
- Ot as K,
2909
- Ft as L,
2910
- qt as M,
2911
- Lt as N,
2912
- Bt as O,
2913
- ws as P,
2910
+ Ds as $,
2911
+ Bl as A,
2912
+ ds as B,
2913
+ oa as C,
2914
+ rs as D,
2915
+ rt as E,
2916
+ fs as F,
2917
+ ps as G,
2918
+ hs as H,
2919
+ Ts as I,
2920
+ ws as J,
2921
+ Ft as K,
2922
+ Lt as L,
2923
+ Ut as M,
2924
+ Bt as N,
2925
+ qt as O,
2926
+ ks as P,
2914
2927
  q as Q,
2915
- ks as R,
2916
- Ks as S,
2917
- ea as T,
2918
- As as U,
2919
- Ss as V,
2920
- Pc as W,
2921
- Ns as X,
2922
- _s as Y,
2923
- ys as Z,
2924
- bs as _,
2925
- Oc as a,
2926
- Ds as a0,
2927
- Os as a1,
2928
- Fs as a2,
2929
- Hs as a3,
2930
- Ys as a4,
2931
- Xs as a5,
2932
- Pe as a6,
2933
- We as a7,
2934
- Pt as a8,
2935
- Zs as a9,
2936
- Js as aa,
2937
- Wt as ab,
2938
- ta as ac,
2939
- aa as ad,
2940
- oa as ae,
2941
- ia as af,
2942
- da as ag,
2943
- Ve as ah,
2928
+ As as R,
2929
+ Hs as S,
2930
+ ta as T,
2931
+ Ss as U,
2932
+ Ns as V,
2933
+ Vl as W,
2934
+ _s as X,
2935
+ ys as Y,
2936
+ bs as Z,
2937
+ Es as _,
2938
+ Ll as a,
2939
+ xs as a0,
2940
+ Fs as a1,
2941
+ Ls as a2,
2942
+ Gs as a3,
2943
+ Xs as a4,
2944
+ Zs as a5,
2945
+ Ve as a6,
2946
+ Me as a7,
2947
+ Wt as a8,
2948
+ Js as a9,
2949
+ ea as aa,
2950
+ Vt as ab,
2951
+ na as ac,
2952
+ ia as ad,
2953
+ la as ae,
2954
+ ca as af,
2955
+ ma as ag,
2956
+ Qe as ah,
2944
2957
  _ as b,
2945
- Dc as c,
2946
- us as d,
2947
- is as e,
2948
- pe as f,
2949
- qs as g,
2950
- gs as h,
2951
- Us as i,
2952
- xs as j,
2953
- he as k,
2954
- Ws as l,
2955
- Gs as m,
2958
+ Ol as c,
2959
+ ms as d,
2960
+ ls as e,
2961
+ he as f,
2962
+ Us as g,
2963
+ Is as h,
2964
+ Ps as i,
2965
+ Os as j,
2966
+ Te as k,
2967
+ Vs as l,
2968
+ js as m,
2956
2969
  V as n,
2957
- Lc as o,
2958
- Bc as p,
2959
- qc as q,
2960
- Es as r,
2961
- Ut as s,
2962
- xt as t,
2970
+ ql as o,
2971
+ Ul as p,
2972
+ Pl as q,
2973
+ Cs as r,
2974
+ Pt as s,
2975
+ Ot as t,
2963
2976
  J as u,
2964
2977
  M as v,
2965
2978
  I as w,
2966
- xc as x,
2979
+ Fl as x,
2967
2980
  y,
2968
- Uc as z
2981
+ Wl as z
2969
2982
  };
2970
- //# sourceMappingURL=config-CpXS2LPZ.js.map
2983
+ //# sourceMappingURL=config-CyBNYvb1.js.map