@tonconnect/ui 2.1.1-beta.0 → 2.2.0-beta.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.
package/lib/index.mjs CHANGED
@@ -42,7 +42,7 @@ var __async = (__this, __arguments, generator) => {
42
42
  });
43
43
  };
44
44
  var _a, _b, _c, _d, _e, _f, _g, _h;
45
- import { TonConnectError, isWalletInfoCurrentlyInjected, toUserFriendlyAddress, CHAIN, TonConnect, isTelegramUrl, encodeTelegramUrlParameters, WalletMissingRequiredFeaturesError, isWalletInfoRemote, checkRequiredWalletFeatures, isWalletInfoCurrentlyEmbedded, createVersionInfo, BrowserEventDispatcher, createResponseVersionEvent, createRequestVersionEvent, createConnectionStartedEvent, createConnectionCompletedEvent, createConnectionErrorEvent, createConnectionRestoringStartedEvent, createConnectionRestoringCompletedEvent, createConnectionRestoringErrorEvent, createDisconnectionEvent, createTransactionSentForSignatureEvent, createTransactionSignedEvent, createTransactionSigningFailedEvent } from "@tonconnect/sdk";
45
+ import { TonConnectError, isWalletInfoCurrentlyInjected, toUserFriendlyAddress, CHAIN, TonConnect, isTelegramUrl, encodeTelegramUrlParameters, WalletMissingRequiredFeaturesError, isWalletInfoRemote, checkRequiredWalletFeatures, isWalletInfoCurrentlyEmbedded, createVersionInfo, BrowserEventDispatcher, createResponseVersionEvent, createRequestVersionEvent, createConnectionStartedEvent, createConnectionCompletedEvent, createConnectionErrorEvent, createConnectionRestoringStartedEvent, createConnectionRestoringCompletedEvent, createConnectionRestoringErrorEvent, createDisconnectionEvent, createTransactionSentForSignatureEvent, createTransactionSignedEvent, createTransactionSigningFailedEvent, createDataSentForSignatureEvent, createDataSignedEvent, createDataSigningFailedEvent, WalletNotSupportFeatureError } from "@tonconnect/sdk";
46
46
  export * from "@tonconnect/sdk";
47
47
  import UAParser from "ua-parser-js";
48
48
  import deepmerge from "deepmerge";
@@ -2049,6 +2049,12 @@ const notifications$1 = {
2049
2049
  transactionCanceled: {
2050
2050
  header: "Transaction canceled",
2051
2051
  text: "There will be no changes to\xA0your account."
2052
+ },
2053
+ dataSigned: {
2054
+ header: "Data signed"
2055
+ },
2056
+ signDataCanceled: {
2057
+ header: "Sign data canceled"
2052
2058
  }
2053
2059
  };
2054
2060
  const walletItem$1 = {
@@ -2106,9 +2112,41 @@ const walletModal$1 = {
2106
2112
  easilySend: "Easily send, receive, monitor your cryptocurrencies.\xA0Streamline your operations with\xA0decentralized applications.",
2107
2113
  getAWallet: "Get a Wallet"
2108
2114
  },
2115
+ restoreModal: {
2116
+ title: "Restore",
2117
+ step1: {
2118
+ title: "Find your current recovery phrase",
2119
+ text: "Open your wallet settings and locate the\xA0recovery\xA0phrase"
2120
+ },
2121
+ step2: {
2122
+ title: "Copy your recovery phrase",
2123
+ text: "Write it down or copy it to a safe place"
2124
+ },
2125
+ step3: {
2126
+ title: "Restore in a supported wallet",
2127
+ text: "Enter the recovery phrase to access your wallet"
2128
+ }
2129
+ },
2109
2130
  allWallets: {
2110
2131
  walletsBelowNotSupported: "The wallets below don\u2019t support all features of\xA0the connected service. You can use your recovery phrase in one of the supported wallets above.",
2111
2132
  walletNotSupportService: "{{ name }} doesn\u2019t support connected service"
2133
+ },
2134
+ featureNotSupported: {
2135
+ wallet: {
2136
+ title: "{{ name }} doesn\u2019t support the requested\xA0action",
2137
+ description: "Install a supported wallet from the list below, restore it with your recovery phrase, then connect it and try again.",
2138
+ info: "Learn how to restore your wallet"
2139
+ },
2140
+ version: {
2141
+ description: "Your current version of {{ name }} or wallet contract type doesn't support the required features. Please update it to continue.",
2142
+ updateButton: "Update {{ name }}",
2143
+ aboutW5: "About W5"
2144
+ },
2145
+ disconnect: {
2146
+ title: "Confirm Disconnect",
2147
+ description: "You will be disconnected from your current wallet and redirected to connect {{ name }}.",
2148
+ button: "Disconnect"
2149
+ }
2112
2150
  }
2113
2151
  };
2114
2152
  const actionModal$1 = {
@@ -2116,8 +2154,14 @@ const actionModal$1 = {
2116
2154
  header: "Confirm the\xA0transaction in\xA0{{ name }}",
2117
2155
  text: "It will only take a\xA0moment."
2118
2156
  },
2157
+ signData: {
2158
+ header: "Sign the\xA0data in\xA0{{ name }}",
2159
+ text: "It will only take a\xA0moment."
2160
+ },
2119
2161
  transactionSent: "$notifications.transactionSent",
2120
- transactionCanceled: "$notifications.transactionCanceled"
2162
+ transactionCanceled: "$notifications.transactionCanceled",
2163
+ dataSigned: "$notifications.dataSigned",
2164
+ signDataCanceled: "$notifications.signDataCanceled"
2121
2165
  };
2122
2166
  const en = {
2123
2167
  common: common$1,
@@ -2159,6 +2203,12 @@ const notifications = {
2159
2203
  transactionCanceled: {
2160
2204
  header: "\u0422\u0440\u0430\u043D\u0437\u0430\u043A\u0446\u0438\u044F \u043E\u0442\u043C\u0435\u043D\u0435\u043D\u0430",
2161
2205
  text: "\u0421\u043E\u0441\u0442\u043E\u044F\u043D\u0438\u0435 \u0432\u0430\u0448\u0435\u0433\u043E \u0441\u0447\u0451\u0442\u0430 \u043D\u0435\xA0\u0438\u0437\u043C\u0435\u043D\u0438\u0442\u0441\u044F."
2206
+ },
2207
+ dataSigned: {
2208
+ header: "\u0414\u0430\u043D\u043D\u044B\u0435 \u043F\u043E\u0434\u043F\u0438\u0441\u0430\u043D\u044B"
2209
+ },
2210
+ signDataCanceled: {
2211
+ header: "\u041F\u043E\u0434\u043F\u0438\u0441\u044C \u0434\u0430\u043D\u043D\u044B\u0445 \u043E\u0442\u043C\u0435\u043D\u0435\u043D\u0430"
2162
2212
  }
2163
2213
  };
2164
2214
  const walletItem = {
@@ -2216,9 +2266,41 @@ const walletModal = {
2216
2266
  easilySend: "\u041B\u0435\u0433\u043A\u043E \u043E\u0442\u043F\u0440\u0430\u0432\u043B\u044F\u0439\u0442\u0435, \u043F\u043E\u043B\u0443\u0447\u0430\u0439\u0442\u0435 \u0438\xA0\u043E\u0442\u0441\u043B\u0435\u0436\u0438\u0432\u0430\u0439\u0442\u0435 \u0441\u0432\u043E\u0438 \u043A\u0440\u0438\u043F\u0442\u043E\u0432\u0430\u043B\u044E\u0442\u044B. \u041E\u043F\u0442\u0438\u043C\u0438\u0437\u0438\u0440\u0443\u0439\u0442\u0435 \u0441\u0432\u043E\u0438 \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\xA0\u043F\u043E\u043C\u043E\u0449\u044C\u044E \u0434\u0435\u0446\u0435\u043D\u0442\u0440\u0430\u043B\u0438\u0437\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u0439.",
2217
2267
  getAWallet: "\u0421\u043A\u0430\u0447\u0430\u0442\u044C \u043A\u043E\u0448\u0435\u043B\u0451\u043A"
2218
2268
  },
2269
+ restoreModal: {
2270
+ title: "\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435",
2271
+ step1: {
2272
+ title: "\u041D\u0430\u0439\u0434\u0438\u0442\u0435 \u0432\u0430\u0448\u0443 \u0442\u0435\u043A\u0443\u0449\u0443\u044E \u0444\u0440\u0430\u0437\u0443 \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u044F",
2273
+ text: "\u041E\u0442\u043A\u0440\u043E\u0439\u0442\u0435 \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438 \u043A\u043E\u0448\u0435\u043B\u044C\u043A\u0430 \u0438 \u043D\u0430\u0439\u0434\u0438\u0442\u0435 \u0444\u0440\u0430\u0437\u0443\xA0\u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u044F"
2274
+ },
2275
+ step2: {
2276
+ title: "\u0421\u043A\u043E\u043F\u0438\u0440\u0443\u0439\u0442\u0435 \u0432\u0430\u0448\u0443 \u0444\u0440\u0430\u0437\u0443 \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u044F",
2277
+ text: "\u0417\u0430\u043F\u0438\u0448\u0438\u0442\u0435 \u0435\u0451 \u0438\u043B\u0438 \u0441\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u0435 \u0432 \u0431\u0435\u0437\u043E\u043F\u0430\u0441\u043D\u043E\u043C \u043C\u0435\u0441\u0442\u0435"
2278
+ },
2279
+ step3: {
2280
+ title: "\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u0435 \u0432 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043C\u043E\u043C \u043A\u043E\u0448\u0435\u043B\u044C\u043A\u0435",
2281
+ text: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0444\u0440\u0430\u0437\u0443 \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u044F \u0434\u043B\u044F \u0434\u043E\u0441\u0442\u0443\u043F\u0430\xA0\u043A\xA0\u0432\u0430\u0448\u0435\u043C\u0443\xA0\u043A\u043E\u0448\u0435\u043B\u044C\u043A\u0443"
2282
+ }
2283
+ },
2219
2284
  allWallets: {
2220
2285
  walletsBelowNotSupported: "\u041A\u043E\u0448\u0435\u043B\u044C\u043A\u0438 \u043D\u0438\u0436\u0435 \u043D\u0435 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044E\u0442 \u0432\u0441\u0435 \u0444\u0443\u043D\u043A\u0446\u0438\u0438 \u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0451\u043D\u043D\u043E\u0433\u043E \u0441\u0435\u0440\u0432\u0438\u0441\u0430. \u0412\u044B \u043C\u043E\u0436\u0435\u0442\u0435 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0441\u0432\u043E\u044E \u0444\u0440\u0430\u0437\u0443 \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u044F \u0432 \u043E\u0434\u043D\u043E\u043C \u0438\u0437 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043C\u044B\u0445 \u0432\u044B\u0448\u0435 \u043A\u043E\u0448\u0435\u043B\u044C\u043A\u043E\u0432.",
2221
2286
  walletNotSupportService: "{{ name }} \u043D\u0435 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0451\u043D\u043D\u044B\u0439 \u0441\u0435\u0440\u0432\u0438\u0441"
2287
+ },
2288
+ featureNotSupported: {
2289
+ wallet: {
2290
+ title: "{{ name }} \u043D\u0435 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0437\u0430\u043F\u0440\u043E\u0448\u0435\u043D\u043D\u043E\u0435\xA0\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435",
2291
+ description: "\u0423\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u0435 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043C\u044B\u0439 \u043A\u043E\u0448\u0435\u043B\u0451\u043A \u0438\u0437 \u0441\u043F\u0438\u0441\u043A\u0430 \u043D\u0438\u0436\u0435, \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u0435 \u0435\u0433\u043E \u0441 \u043F\u043E\u043C\u043E\u0449\u044C\u044E \u0444\u0440\u0430\u0437\u044B \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u044F, \u0437\u0430\u0442\u0435\u043C \u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0438\u0442\u0435\u0441\u044C \u0438 \u043F\u043E\u043F\u0440\u043E\u0431\u0443\u0439\u0442\u0435 \u0441\u043D\u043E\u0432\u0430.",
2292
+ info: "\u0423\u0437\u043D\u0430\u0442\u044C, \u043A\u0430\u043A \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u043A\u043E\u0448\u0435\u043B\u0451\u043A"
2293
+ },
2294
+ version: {
2295
+ description: "\u0422\u0435\u043A\u0443\u0449\u0430\u044F \u0432\u0435\u0440\u0441\u0438\u044F {{ name }} \u0438\u043B\u0438 \u0442\u0438\u043F \u043A\u043E\u043D\u0442\u0440\u0430\u043A\u0442\u0430 \u043A\u043E\u0448\u0435\u043B\u044C\u043A\u0430 \u043D\u0435 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u044B\u0435 \u0444\u0443\u043D\u043A\u0446\u0438\u0438. \u041E\u0431\u043D\u043E\u0432\u0438\u0442\u0435 \u043A\u043E\u0448\u0435\u043B\u0451\u043A, \u0447\u0442\u043E\u0431\u044B \u043F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u0442\u044C.",
2296
+ updateButton: "\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C {{ name }}",
2297
+ aboutW5: "\u041F\u0440\u043E W5"
2298
+ },
2299
+ disconnect: {
2300
+ title: "\u041F\u043E\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435 \u043E\u0442\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0435",
2301
+ description: "\u0412\u044B \u0431\u0443\u0434\u0435\u0442\u0435 \u043E\u0442\u043A\u043B\u044E\u0447\u0435\u043D\u044B \u043E\u0442 \u0442\u0435\u043A\u0443\u0449\u0435\u0433\u043E \u043A\u043E\u0448\u0435\u043B\u044C\u043A\u0430 \u0438 \u043F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u044B \u043D\u0430 \u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0435 {{ name }}.",
2302
+ button: "\u041E\u0442\u043A\u043B\u044E\u0447\u0438\u0442\u044C\u0441\u044F"
2303
+ }
2222
2304
  }
2223
2305
  };
2224
2306
  const actionModal = {
@@ -2226,8 +2308,14 @@ const actionModal = {
2226
2308
  header: "\u041F\u043E\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0432\xA0{{ name }}",
2227
2309
  text: "\u042D\u0442\u043E \u0437\u0430\u0439\u043C\u0435\u0442 \u043F\u0430\u0440\u0443 \u0441\u0435\u043A\u0443\u043D\u0434."
2228
2310
  },
2311
+ signData: {
2312
+ header: "\u041F\u043E\u0434\u043F\u0438\u0448\u0438\u0442\u0435 \u0434\u0430\u043D\u043D\u044B\u0435 \u0432\xA0{{ name }}",
2313
+ text: "\u042D\u0442\u043E \u0437\u0430\u0439\u043C\u0435\u0442 \u043F\u0430\u0440\u0443 \u0441\u0435\u043A\u0443\u043D\u0434."
2314
+ },
2229
2315
  transactionSent: "$notifications.transactionSent",
2230
- transactionCanceled: "$notifications.transactionCanceled"
2316
+ transactionCanceled: "$notifications.transactionCanceled",
2317
+ dataSigned: "$notifications.dataSigned",
2318
+ signDataCanceled: "$notifications.signDataCanceled"
2231
2319
  };
2232
2320
  const ru = {
2233
2321
  common,
@@ -2887,7 +2975,7 @@ function media(device) {
2887
2975
  }
2888
2976
  const mediaTouch = "@media (hover: none)";
2889
2977
  const mediaNotTouch = "@media not all and (hover: none)";
2890
- const borders$5 = {
2978
+ const borders$6 = {
2891
2979
  m: "100vh",
2892
2980
  s: "8px",
2893
2981
  none: "0"
@@ -2908,7 +2996,7 @@ const ButtonStyled$1 = styled.button`
2908
2996
  padding-left: ${(props) => props.leftIcon && props.appearance !== "flat" ? "12px" : "16px"};
2909
2997
  padding-right: ${(props) => props.rightIcon && props.appearance !== "flat" ? "12px" : "16px"};
2910
2998
  border: none;
2911
- border-radius: ${(props) => borders$5[props.theme.borderRadius]};
2999
+ border-radius: ${(props) => borders$6[props.theme.borderRadius]};
2912
3000
  cursor: ${(props) => props.disabled ? "not-allowed" : "pointer"};
2913
3001
 
2914
3002
  font-size: 14px;
@@ -3472,7 +3560,7 @@ const IconButton = (props) => {
3472
3560
  }
3473
3561
  }));
3474
3562
  };
3475
- const borders$4 = {
3563
+ const borders$5 = {
3476
3564
  m: "24px",
3477
3565
  s: "16px",
3478
3566
  none: "0"
@@ -3513,7 +3601,7 @@ const ModalBodyStyled = styled.div`
3513
3601
  box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.04);
3514
3602
 
3515
3603
  background-color: ${(props) => props.theme.colors.background.primary};
3516
- border-radius: ${(props) => borders$4[props.theme.borderRadius]};
3604
+ border-radius: ${(props) => borders$5[props.theme.borderRadius]};
3517
3605
 
3518
3606
  ${media("mobile")} {
3519
3607
  width: 100%;
@@ -3529,8 +3617,8 @@ const ModalFooterStyled = styled.div`
3529
3617
  justify-content: space-between;
3530
3618
  align-items: center;
3531
3619
  padding: 16px 16px 16px 18px;
3532
- border-radius: 0 0 ${(props) => borders$4[props.theme.borderRadius]}
3533
- ${(props) => borders$4[props.theme.borderRadius]};
3620
+ border-radius: 0 0 ${(props) => borders$5[props.theme.borderRadius]}
3621
+ ${(props) => borders$5[props.theme.borderRadius]};
3534
3622
  `;
3535
3623
  const QuestionButtonStyled = styled(IconButton)`
3536
3624
  background-color: ${(props) => rgba(props.theme.colors.icon.secondary, 0.12)};
@@ -3684,7 +3772,7 @@ const Modal = (props) => {
3684
3772
  }), null);
3685
3773
  insert(_el$, createComponent(Show, {
3686
3774
  get when() {
3687
- return props.onClickQuestion;
3775
+ return props.onClickQuestion && props.showFooter;
3688
3776
  },
3689
3777
  get children() {
3690
3778
  return createComponent(ModalFooterStyled, {
@@ -3700,12 +3788,12 @@ const Modal = (props) => {
3700
3788
  }
3701
3789
  }), null);
3702
3790
  createRenderEffect(() => className(_el$, cn(ModalWrapperClass, u`
3703
- border-radius: ${borders$4[theme.borderRadius]};
3791
+ border-radius: ${borders$5[theme.borderRadius]};
3704
3792
  background-color: ${theme.colors.background.tint};
3705
3793
 
3706
3794
  ${media("mobile")} {
3707
- border-radius: ${borders$4[theme.borderRadius]}
3708
- ${borders$4[theme.borderRadius]} 0 0;
3795
+ border-radius: ${borders$5[theme.borderRadius]}
3796
+ ${borders$5[theme.borderRadius]} 0 0;
3709
3797
  }
3710
3798
  `)));
3711
3799
  return _el$;
@@ -5779,7 +5867,7 @@ var createI18nContext = (init = {}, lang = navigator.language in init ? navigato
5779
5867
  };
5780
5868
  var I18nContext = createContext({});
5781
5869
  var useI18n = () => useContext(I18nContext);
5782
- const TextStyled$3 = styled.div`
5870
+ const TextStyled$4 = styled.div`
5783
5871
  font-style: normal;
5784
5872
  font-weight: ${(props) => props.fontWeight};
5785
5873
  font-size: ${(props) => props.fontSize};
@@ -5808,7 +5896,7 @@ const Text = (inputs) => {
5808
5896
  textRef.style.cursor = "default";
5809
5897
  }
5810
5898
  });
5811
- return createComponent(TextStyled$3, {
5899
+ return createComponent(TextStyled$4, {
5812
5900
  get fontSize() {
5813
5901
  return props.fontSize;
5814
5902
  },
@@ -5869,7 +5957,7 @@ const WalletImage = (props) => {
5869
5957
  }
5870
5958
  });
5871
5959
  };
5872
- const borders$3 = {
5960
+ const borders$4 = {
5873
5961
  m: "16px",
5874
5962
  s: "12px",
5875
5963
  none: "0"
@@ -5939,7 +6027,7 @@ const WalletItemStyled = styled.button`
5939
6027
  const ImageStyled$1 = styled(WalletImage)`
5940
6028
  width: 60px;
5941
6029
  height: 60px;
5942
- border-radius: ${(props) => borders$3[props.theme.borderRadius]};
6030
+ border-radius: ${(props) => borders$4[props.theme.borderRadius]};
5943
6031
  margin-bottom: 8px;
5944
6032
  position: relative;
5945
6033
  `;
@@ -6037,7 +6125,7 @@ const WalletItem = (props) => {
6037
6125
  }
6038
6126
  });
6039
6127
  };
6040
- const H1Styled$9 = styled.h1`
6128
+ const H1Styled$b = styled.h1`
6041
6129
  font-style: normal;
6042
6130
  font-weight: 590;
6043
6131
  font-size: 20px;
@@ -6054,7 +6142,7 @@ const H1Styled$9 = styled.h1`
6054
6142
  `;
6055
6143
  const H1 = (props) => {
6056
6144
  const [t2] = useI18n();
6057
- return createComponent(H1Styled$9, {
6145
+ return createComponent(H1Styled$b, {
6058
6146
  get ["class"]() {
6059
6147
  return props.class;
6060
6148
  },
@@ -6093,7 +6181,7 @@ const H2 = (props) => {
6093
6181
  }
6094
6182
  });
6095
6183
  };
6096
- const H3Styled$1 = styled.h3`
6184
+ const H3Styled$2 = styled.h3`
6097
6185
  font-style: normal;
6098
6186
  font-weight: 510;
6099
6187
  font-size: 16px;
@@ -6108,7 +6196,7 @@ const H3Styled$1 = styled.h3`
6108
6196
  `;
6109
6197
  const H3 = (props) => {
6110
6198
  const [t2] = useI18n();
6111
- return createComponent(H3Styled$1, {
6199
+ return createComponent(H3Styled$2, {
6112
6200
  "data-tc-h3": "true",
6113
6201
  get ["class"]() {
6114
6202
  return props.class;
@@ -6842,7 +6930,7 @@ const AccountButtonDropdown = (props) => {
6842
6930
  }
6843
6931
  });
6844
6932
  };
6845
- const borders$2 = {
6933
+ const borders$3 = {
6846
6934
  m: "16px",
6847
6935
  s: "8px",
6848
6936
  none: "0"
@@ -6855,7 +6943,7 @@ const NotificationStyled = styled.div`
6855
6943
 
6856
6944
  background-color: ${(props) => props.theme.colors.background.primary};
6857
6945
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.16);
6858
- border-radius: ${(props) => borders$2[props.theme.borderRadius]};
6946
+ border-radius: ${(props) => borders$3[props.theme.borderRadius]};
6859
6947
  `;
6860
6948
  const NotificationContentStyled = styled.div`
6861
6949
  width: 192px;
@@ -6864,7 +6952,7 @@ const NotificationContentStyled = styled.div`
6864
6952
  font-size: 15px;
6865
6953
  }
6866
6954
  `;
6867
- const TextStyled$2 = styled(Text)`
6955
+ const TextStyled$3 = styled(Text)`
6868
6956
  margin-top: 4px;
6869
6957
  color: ${(props) => props.theme.colors.text.secondary};
6870
6958
  `;
@@ -6894,7 +6982,7 @@ const Notification = (props) => {
6894
6982
  return props.text;
6895
6983
  },
6896
6984
  get children() {
6897
- return createComponent(TextStyled$2, {
6985
+ return createComponent(TextStyled$3, {
6898
6986
  get translationKey() {
6899
6987
  return props.text.translationKey;
6900
6988
  },
@@ -6935,7 +7023,7 @@ const ConfirmOperationNotification = (props) => {
6935
7023
  children: "Confirm operation in your wallet"
6936
7024
  });
6937
7025
  };
6938
- const ErrorIconStyled$2 = styled(ErrorIcon)`
7026
+ const ErrorIconStyled$4 = styled(ErrorIcon)`
6939
7027
  margin-top: 2px;
6940
7028
  `;
6941
7029
  const ErrorTransactionNotification = (props) => {
@@ -6947,7 +7035,7 @@ const ErrorTransactionNotification = (props) => {
6947
7035
  translationKey: "notifications.transactionCanceled.text"
6948
7036
  },
6949
7037
  get icon() {
6950
- return createComponent(ErrorIconStyled$2, {
7038
+ return createComponent(ErrorIconStyled$4, {
6951
7039
  size: "xs"
6952
7040
  });
6953
7041
  },
@@ -6993,19 +7081,26 @@ function useOpenedNotifications(config) {
6993
7081
  const [timeoutIds, setTimeoutIds] = createSignal([]);
6994
7082
  createEffect(
6995
7083
  on(action, (action2) => {
6996
- var _a2;
7084
+ var _a2, _b2;
6997
7085
  if (!action2 || !action2.showNotification) {
7086
+ setOpenedNotifications(
7087
+ (openedNotifications2) => openedNotifications2.filter((n2) => n2.action !== "confirm-transaction")
7088
+ );
6998
7089
  return;
6999
7090
  }
7000
7091
  if (latestAction() === action2) {
7001
7092
  return;
7002
7093
  }
7003
- if (((_a2 = latestAction()) == null ? void 0 : _a2.name) === "confirm-transaction" && action2.name === "confirm-transaction") {
7094
+ const isConfirmTransactionAction = ((_a2 = latestAction()) == null ? void 0 : _a2.name) === "confirm-transaction" && action2.name === "confirm-transaction";
7095
+ const isConfirmSignDataAction = ((_b2 = latestAction()) == null ? void 0 : _b2.name) === "confirm-sign-data" && action2.name === "confirm-sign-data";
7096
+ if (isConfirmTransactionAction || isConfirmSignDataAction) {
7004
7097
  return;
7005
7098
  }
7006
7099
  setLatestAction(action2);
7007
7100
  setOpenedNotifications(
7008
- (openedNotifications2) => openedNotifications2.filter((n2) => n2.action !== "confirm-transaction")
7101
+ (openedNotifications2) => openedNotifications2.filter(
7102
+ (n2) => n2.action !== "confirm-transaction" && n2.action !== "confirm-sign-data"
7103
+ )
7009
7104
  );
7010
7105
  const notification = { action: action2.name };
7011
7106
  setOpenedNotifications((openedNotifications2) => [...openedNotifications2, notification]);
@@ -7023,6 +7118,41 @@ function useOpenedNotifications(config) {
7023
7118
  });
7024
7119
  return openedNotifications;
7025
7120
  }
7121
+ const ErrorIconStyled$3 = styled(ErrorIcon)`
7122
+ margin-top: 2px;
7123
+ `;
7124
+ const ErrorSignDataNotification = (props) => {
7125
+ return createComponent(Notification, {
7126
+ header: {
7127
+ translationKey: "notifications.signDataCanceled.header"
7128
+ },
7129
+ get icon() {
7130
+ return createComponent(ErrorIconStyled$3, {
7131
+ size: "xs"
7132
+ });
7133
+ },
7134
+ get ["class"]() {
7135
+ return props.class;
7136
+ },
7137
+ "data-tc-notification-sign-data-cancelled": "true",
7138
+ children: "Sign data canceled"
7139
+ });
7140
+ };
7141
+ const SuccessSignDataNotification = (props) => {
7142
+ return createComponent(Notification, {
7143
+ header: {
7144
+ translationKey: "notifications.dataSigned.header"
7145
+ },
7146
+ get icon() {
7147
+ return createComponent(SuccessIconStyled, {});
7148
+ },
7149
+ get ["class"]() {
7150
+ return props.class;
7151
+ },
7152
+ "data-tc-notification-data-signed": "true",
7153
+ children: "Data signed"
7154
+ });
7155
+ };
7026
7156
  const _tmpl$$5 = /* @__PURE__ */ template$1(`<div data-tc-list-notifications="true"></div>`);
7027
7157
  const Notifications = (props) => {
7028
7158
  const openedNotifications = useOpenedNotifications();
@@ -7079,7 +7209,25 @@ const Notifications = (props) => {
7079
7209
  }
7080
7210
  }), createComponent(Match, {
7081
7211
  get when() {
7082
- return openedNotification.action === "confirm-transaction";
7212
+ return openedNotification.action === "data-signed";
7213
+ },
7214
+ get children() {
7215
+ return createComponent(SuccessSignDataNotification, {
7216
+ "class": NotificationClass
7217
+ });
7218
+ }
7219
+ }), createComponent(Match, {
7220
+ get when() {
7221
+ return openedNotification.action === "sign-data-canceled";
7222
+ },
7223
+ get children() {
7224
+ return createComponent(ErrorSignDataNotification, {
7225
+ "class": NotificationClass
7226
+ });
7227
+ }
7228
+ }), createComponent(Match, {
7229
+ get when() {
7230
+ return openedNotification.action === "confirm-transaction" || openedNotification.action === "confirm-sign-data";
7083
7231
  },
7084
7232
  get children() {
7085
7233
  return createComponent(ConfirmOperationNotification, {
@@ -8098,7 +8246,7 @@ const StyledModal = styled(Modal)`
8098
8246
  padding-right: 0;
8099
8247
  }
8100
8248
  `;
8101
- const H1Styled$8 = styled(H1)`
8249
+ const H1Styled$a = styled(H1)`
8102
8250
  margin-top: 12px;
8103
8251
 
8104
8252
  ${media("mobile")} {
@@ -8185,7 +8333,7 @@ const DesktopSelectWalletModalStyled = styled.div`
8185
8333
  flex-direction: column;
8186
8334
  align-items: center;
8187
8335
  `;
8188
- const H1Styled$7 = styled(H1)`
8336
+ const H1Styled$9 = styled(H1)`
8189
8337
  margin-bottom: 18px;
8190
8338
  `;
8191
8339
  styled.div`
@@ -8240,7 +8388,7 @@ styled(Button)`
8240
8388
  margin: 0 auto 1px;
8241
8389
  font-size: 15px;
8242
8390
  `;
8243
- const StyledIconButton$3 = styled(IconButton)`
8391
+ const StyledIconButton$5 = styled(IconButton)`
8244
8392
  position: absolute;
8245
8393
  top: 16px;
8246
8394
  left: 16px;
@@ -8343,7 +8491,7 @@ const AllWalletsListModal = (props) => {
8343
8491
  timeoutId = setTimeout(() => setErrorSupportOpened(null), 1500);
8344
8492
  };
8345
8493
  const handleSelectWallet = (wallet) => {
8346
- if (!wallet.isSupportRequiredFeatures) {
8494
+ if (!wallet.isSupportRequiredFeatures && props.featureCheckMode === "strict") {
8347
8495
  onErrorClick(wallet);
8348
8496
  return;
8349
8497
  }
@@ -8355,10 +8503,10 @@ const AllWalletsListModal = (props) => {
8355
8503
  return createComponent(DesktopSelectWalletModalStyled, {
8356
8504
  "data-tc-wallets-modal-list": "true",
8357
8505
  get children() {
8358
- return [createComponent(StyledIconButton$3, {
8506
+ return [createComponent(StyledIconButton$5, {
8359
8507
  icon: "arrow",
8360
8508
  onClick: () => props.onBack()
8361
- }), createComponent(H1Styled$7, {
8509
+ }), createComponent(H1Styled$9, {
8362
8510
  translationKey: "walletModal.wallets",
8363
8511
  children: "Wallets"
8364
8512
  }), createComponent(ScrollContainer, {
@@ -8384,7 +8532,7 @@ const AllWalletsListModal = (props) => {
8384
8532
  }
8385
8533
  }), createComponent(Show, {
8386
8534
  get when() {
8387
- return unsupportedWallets().length > 0;
8535
+ return unsupportedWallets().length > 0 && props.featureCheckMode !== "hide";
8388
8536
  },
8389
8537
  get children() {
8390
8538
  return [createComponent(WalletsNotSupportedNotifier, {
@@ -8407,7 +8555,9 @@ const AllWalletsListModal = (props) => {
8407
8555
  insert(_el$2, createComponent(WalletLabeledItemStyled, {
8408
8556
  wallet,
8409
8557
  onClick: () => handleSelectWallet(wallet),
8410
- withOpacity: true
8558
+ get withOpacity() {
8559
+ return props.featureCheckMode === "strict";
8560
+ }
8411
8561
  }));
8412
8562
  return _el$2;
8413
8563
  })()
@@ -8500,7 +8650,7 @@ const BodyStyled$1 = styled.div`
8500
8650
  const QRCodeStyled$1 = styled(QRCode)`
8501
8651
  margin-bottom: 24px;
8502
8652
  `;
8503
- const H1Styled$6 = styled(H1)`
8653
+ const H1Styled$8 = styled(H1)`
8504
8654
  max-width: 288px;
8505
8655
  margin: 0 auto 2px;
8506
8656
  `;
@@ -8509,18 +8659,18 @@ const H2Styled$4 = styled(H2)`
8509
8659
  text-align: center;
8510
8660
  margin: 0 auto 20px;
8511
8661
  `;
8512
- const StyledIconButton$2 = styled(IconButton)`
8662
+ const StyledIconButton$4 = styled(IconButton)`
8513
8663
  position: absolute;
8514
8664
  top: 16px;
8515
8665
  left: 16px;
8516
8666
  `;
8517
- const ButtonsContainerStyled$1 = styled.div`
8667
+ const ButtonsContainerStyled$2 = styled.div`
8518
8668
  display: flex;
8519
8669
  justify-content: center;
8520
8670
  gap: 8px;
8521
8671
  padding-bottom: 16px;
8522
8672
  `;
8523
- const BottomButtonsContainerStyled = styled(ButtonsContainerStyled$1)`
8673
+ const BottomButtonsContainerStyled = styled(ButtonsContainerStyled$2)`
8524
8674
  padding-bottom: 0;
8525
8675
  `;
8526
8676
  const FooterButton$1 = styled(Button)`
@@ -8530,10 +8680,10 @@ const LoaderStyled$1 = styled(LoaderIcon)`
8530
8680
  margin-bottom: 18px;
8531
8681
  margin-top: 2px;
8532
8682
  `;
8533
- const ErrorIconStyled$1 = styled(ErrorIcon)`
8683
+ const ErrorIconStyled$2 = styled(ErrorIcon)`
8534
8684
  margin-bottom: 16px;
8535
8685
  `;
8536
- const BodyTextStyled$1 = styled(H2)`
8686
+ const BodyTextStyled$2 = styled(H2)`
8537
8687
  color: ${(props) => props.theme.colors.text.secondary};
8538
8688
  text-align: center;
8539
8689
  margin-bottom: 20px;
@@ -9003,12 +9153,12 @@ const DesktopConnectionModal = (props) => {
9003
9153
  return !props.backDisabled;
9004
9154
  },
9005
9155
  get children() {
9006
- return createComponent(StyledIconButton$2, {
9156
+ return createComponent(StyledIconButton$4, {
9007
9157
  icon: "arrow",
9008
9158
  onClick: () => props.onBackClick()
9009
9159
  });
9010
9160
  }
9011
- }), createComponent(H1Styled$6, {
9161
+ }), createComponent(H1Styled$8, {
9012
9162
  get children() {
9013
9163
  return props.wallet.name;
9014
9164
  }
@@ -9041,7 +9191,7 @@ const DesktopConnectionModal = (props) => {
9041
9191
  return connectionErrored();
9042
9192
  },
9043
9193
  get children() {
9044
- return [createComponent(ErrorIconStyled$1, {
9194
+ return [createComponent(ErrorIconStyled$2, {
9045
9195
  size: "s"
9046
9196
  }), createComponent(Switch, {
9047
9197
  get children() {
@@ -9050,7 +9200,7 @@ const DesktopConnectionModal = (props) => {
9050
9200
  return connectionErrored() === "missing-features";
9051
9201
  },
9052
9202
  get children() {
9053
- return createComponent(BodyTextStyled$1, {
9203
+ return createComponent(BodyTextStyled$2, {
9054
9204
  translationKey: "walletModal.desktopConnectionModal.missingFeatures",
9055
9205
  get translationValues() {
9056
9206
  return {
@@ -9065,7 +9215,7 @@ const DesktopConnectionModal = (props) => {
9065
9215
  return connectionErrored() === "connection-declined";
9066
9216
  },
9067
9217
  get children() {
9068
- return createComponent(BodyTextStyled$1, {
9218
+ return createComponent(BodyTextStyled$2, {
9069
9219
  translationKey: "walletModal.desktopConnectionModal.connectionDeclined",
9070
9220
  children: "Connection declined"
9071
9221
  });
@@ -9075,7 +9225,7 @@ const DesktopConnectionModal = (props) => {
9075
9225
  return connectionErrored() === "not-supported";
9076
9226
  },
9077
9227
  get children() {
9078
- return createComponent(BodyTextStyled$1, {
9228
+ return createComponent(BodyTextStyled$2, {
9079
9229
  translationKey: "walletModal.desktopConnectionModal.notSupportedWallet",
9080
9230
  get translationValues() {
9081
9231
  return {
@@ -9089,7 +9239,7 @@ const DesktopConnectionModal = (props) => {
9089
9239
  }
9090
9240
  })];
9091
9241
  }
9092
- }), createComponent(ButtonsContainerStyled$1, {
9242
+ }), createComponent(ButtonsContainerStyled$2, {
9093
9243
  get children() {
9094
9244
  return [createComponent(Show, {
9095
9245
  get when() {
@@ -9189,7 +9339,7 @@ const DesktopConnectionModal = (props) => {
9189
9339
  get children() {
9190
9340
  return [createComponent(LoaderStyled$1, {
9191
9341
  size: "s"
9192
- }), createComponent(BodyTextStyled$1, {
9342
+ }), createComponent(BodyTextStyled$2, {
9193
9343
  translationKey: "walletModal.desktopConnectionModal.continueInExtension",
9194
9344
  get translationValues() {
9195
9345
  return {
@@ -9199,7 +9349,7 @@ const DesktopConnectionModal = (props) => {
9199
9349
  get children() {
9200
9350
  return ["Continue in ", createMemo(() => props.wallet.name), " browser extension\u2026"];
9201
9351
  }
9202
- }), createComponent(ButtonsContainerStyled$1, {
9352
+ }), createComponent(ButtonsContainerStyled$2, {
9203
9353
  get children() {
9204
9354
  return createComponent(Button, {
9205
9355
  get leftIcon() {
@@ -9221,7 +9371,7 @@ const DesktopConnectionModal = (props) => {
9221
9371
  return !isWalletInfoCurrentlyInjected(props.wallet);
9222
9372
  },
9223
9373
  get children() {
9224
- return [createComponent(BodyTextStyled$1, {
9374
+ return [createComponent(BodyTextStyled$2, {
9225
9375
  translationKey: "walletModal.desktopConnectionModal.dontHaveExtension",
9226
9376
  get translationValues() {
9227
9377
  return {
@@ -9231,7 +9381,7 @@ const DesktopConnectionModal = (props) => {
9231
9381
  get children() {
9232
9382
  return ["Seems you don't have installed ", createMemo(() => props.wallet.name), " browser extension"];
9233
9383
  }
9234
- }), createComponent(ButtonsContainerStyled$1, {
9384
+ }), createComponent(ButtonsContainerStyled$2, {
9235
9385
  get children() {
9236
9386
  return createComponent(Link, {
9237
9387
  get href() {
@@ -9272,7 +9422,7 @@ const DesktopConnectionModal = (props) => {
9272
9422
  get children() {
9273
9423
  return [createComponent(LoaderIcon, {
9274
9424
  size: "m"
9275
- }), createComponent(BodyTextStyled$1, {
9425
+ }), createComponent(BodyTextStyled$2, {
9276
9426
  translationKey: "walletModal.desktopConnectionModal.continueOnDesktop",
9277
9427
  get translationValues() {
9278
9428
  return {
@@ -9282,7 +9432,7 @@ const DesktopConnectionModal = (props) => {
9282
9432
  get children() {
9283
9433
  return ["Continue in ", createMemo(() => props.wallet.name), " on desktop\u2026"];
9284
9434
  }
9285
- }), createComponent(ButtonsContainerStyled$1, {
9435
+ }), createComponent(ButtonsContainerStyled$2, {
9286
9436
  get children() {
9287
9437
  return [createComponent(Button, {
9288
9438
  get leftIcon() {
@@ -9424,12 +9574,12 @@ const DesktopConnectionModal = (props) => {
9424
9574
  });
9425
9575
  };
9426
9576
  const InfoModalStyled = styled.div``;
9427
- const StyledIconButton$1 = styled(IconButton)`
9577
+ const StyledIconButton$3 = styled(IconButton)`
9428
9578
  position: absolute;
9429
9579
  top: 16px;
9430
9580
  left: 16px;
9431
9581
  `;
9432
- const H1Styled$5 = styled(H1)`
9582
+ const H1Styled$7 = styled(H1)`
9433
9583
  margin-bottom: 18px;
9434
9584
  `;
9435
9585
  const InfoBlock = styled.div`
@@ -9441,11 +9591,11 @@ const InfoBlock = styled.div`
9441
9591
  const InfoBlockIconClass = u`
9442
9592
  margin-bottom: 12px;
9443
9593
  `;
9444
- const H3Styled = styled(H3)`
9594
+ const H3Styled$1 = styled(H3)`
9445
9595
  text-align: center;
9446
9596
  margin-bottom: 4px;
9447
9597
  `;
9448
- const TextStyled$1 = styled(Text)`
9598
+ const TextStyled$2 = styled(Text)`
9449
9599
  text-align: center;
9450
9600
  max-width: 352px;
9451
9601
  color: ${(props) => props.theme.colors.text.secondary};
@@ -9464,10 +9614,10 @@ const InfoModal = (props) => {
9464
9614
  return createComponent(InfoModalStyled, {
9465
9615
  "data-tc-wallets-modal-info": "true",
9466
9616
  get children() {
9467
- return [createComponent(StyledIconButton$1, {
9617
+ return [createComponent(StyledIconButton$3, {
9468
9618
  icon: "arrow",
9469
9619
  onClick: () => props.onBackClick()
9470
- }), createComponent(H1Styled$5, {
9620
+ }), createComponent(H1Styled$7, {
9471
9621
  translationKey: "walletModal.infoModal.whatIsAWallet",
9472
9622
  children: "What is a wallet"
9473
9623
  }), createComponent(ScrollContainer, {
@@ -9476,10 +9626,10 @@ const InfoModal = (props) => {
9476
9626
  get children() {
9477
9627
  return [createComponent(SecurityIcon, {
9478
9628
  "class": InfoBlockIconClass
9479
- }), createComponent(H3Styled, {
9629
+ }), createComponent(H3Styled$1, {
9480
9630
  translationKey: "walletModal.infoModal.secureDigitalAssets",
9481
9631
  children: "Secure digital assets storage"
9482
- }), createComponent(TextStyled$1, {
9632
+ }), createComponent(TextStyled$2, {
9483
9633
  translationKey: "walletModal.infoModal.walletProtects",
9484
9634
  children: "A wallet protects and manages your digital assets including TON, tokens and collectables."
9485
9635
  })];
@@ -9488,10 +9638,10 @@ const InfoModal = (props) => {
9488
9638
  get children() {
9489
9639
  return [createComponent(PersonalityIcon, {
9490
9640
  "class": InfoBlockIconClass
9491
- }), createComponent(H3Styled, {
9641
+ }), createComponent(H3Styled$1, {
9492
9642
  translationKey: "walletModal.infoModal.controlIdentity",
9493
9643
  children: "Control your Web3 identity"
9494
- }), createComponent(TextStyled$1, {
9644
+ }), createComponent(TextStyled$2, {
9495
9645
  translationKey: "walletModal.infoModal.manageIdentity",
9496
9646
  children: "Manage your digital identity and access decentralized applications with ease. Maintain control over your data and engage securely in the blockchain ecosystem."
9497
9647
  })];
@@ -9500,10 +9650,10 @@ const InfoModal = (props) => {
9500
9650
  get children() {
9501
9651
  return [createComponent(SwapIcon, {
9502
9652
  "class": InfoBlockIconClass
9503
- }), createComponent(H3Styled, {
9653
+ }), createComponent(H3Styled$1, {
9504
9654
  translationKey: "walletModal.infoModal.effortlessCryptoTransactions",
9505
9655
  children: "Effortless crypto transactions"
9506
- }), createComponent(TextStyled$1, {
9656
+ }), createComponent(TextStyled$2, {
9507
9657
  translationKey: "walletModal.infoModal.easilySend",
9508
9658
  children: "Easily send, receive, monitor your cryptocurrencies. Streamline your operations with decentralized applications."
9509
9659
  })];
@@ -9546,11 +9696,11 @@ const BodyStyled = styled.div`
9546
9696
  justify-content: center;
9547
9697
  min-height: 232px;
9548
9698
  `;
9549
- const H1Styled$4 = styled(H1)`
9699
+ const H1Styled$6 = styled(H1)`
9550
9700
  max-width: 262px;
9551
9701
  margin: 0 auto 8px;
9552
9702
  `;
9553
- const StyledIconButton = styled(IconButton)`
9703
+ const StyledIconButton$2 = styled(IconButton)`
9554
9704
  position: absolute;
9555
9705
  top: 16px;
9556
9706
  left: 16px;
@@ -9574,15 +9724,15 @@ const LoaderStyled = styled(LoaderIcon)`
9574
9724
  margin-bottom: 18px;
9575
9725
  margin-top: 2px;
9576
9726
  `;
9577
- const ErrorIconStyled = styled(ErrorIcon)`
9727
+ const ErrorIconStyled$1 = styled(ErrorIcon)`
9578
9728
  margin-bottom: 16px;
9579
9729
  `;
9580
- const BodyTextStyled = styled(H2)`
9730
+ const BodyTextStyled$1 = styled(H2)`
9581
9731
  color: ${(props) => props.theme.colors.text.secondary};
9582
9732
  text-align: center;
9583
9733
  margin-bottom: 20px;
9584
9734
  `;
9585
- const ButtonsContainerStyled = styled.div`
9735
+ const ButtonsContainerStyled$1 = styled.div`
9586
9736
  display: flex;
9587
9737
  justify-content: center;
9588
9738
  gap: 8px;
@@ -9593,7 +9743,7 @@ const actionButtonBorderRadius$1 = {
9593
9743
  s: "8px",
9594
9744
  none: "0"
9595
9745
  };
9596
- const H1Styled$3 = styled(H1)`
9746
+ const H1Styled$5 = styled(H1)`
9597
9747
  margin-bottom: 2px;
9598
9748
  padding: 0 52px;
9599
9749
  `;
@@ -9623,7 +9773,7 @@ const ActionButton$1 = styled(Button)`
9623
9773
  padding: 17px 20px 19px 20px;
9624
9774
  `;
9625
9775
  const MobileConnectionQR = (props) => {
9626
- return [createComponent(H1Styled$3, {
9776
+ return [createComponent(H1Styled$5, {
9627
9777
  get children() {
9628
9778
  return props.walletInfo.name;
9629
9779
  }
@@ -9768,7 +9918,7 @@ const MobileConnectionModal = (props) => {
9768
9918
  return !props.backDisabled || showQR();
9769
9919
  },
9770
9920
  get children() {
9771
- return createComponent(StyledIconButton, {
9921
+ return createComponent(StyledIconButton$2, {
9772
9922
  icon: "arrow",
9773
9923
  onClick: onBack
9774
9924
  });
@@ -9797,7 +9947,7 @@ const MobileConnectionModal = (props) => {
9797
9947
  return !showQR();
9798
9948
  },
9799
9949
  get children() {
9800
- return [createComponent(H1Styled$4, {
9950
+ return [createComponent(H1Styled$6, {
9801
9951
  get children() {
9802
9952
  return props.wallet.name;
9803
9953
  }
@@ -9808,7 +9958,7 @@ const MobileConnectionModal = (props) => {
9808
9958
  return connectionErrored();
9809
9959
  },
9810
9960
  get children() {
9811
- return [createComponent(ErrorIconStyled, {
9961
+ return [createComponent(ErrorIconStyled$1, {
9812
9962
  size: "s"
9813
9963
  }), createComponent(Switch, {
9814
9964
  get children() {
@@ -9817,7 +9967,7 @@ const MobileConnectionModal = (props) => {
9817
9967
  return connectionErrored() === "missing-features";
9818
9968
  },
9819
9969
  get children() {
9820
- return createComponent(BodyTextStyled, {
9970
+ return createComponent(BodyTextStyled$1, {
9821
9971
  translationKey: "walletModal.mobileConnectionModal.missingFeatures",
9822
9972
  get translationValues() {
9823
9973
  return {
@@ -9832,7 +9982,7 @@ const MobileConnectionModal = (props) => {
9832
9982
  return connectionErrored() === "connection-declined";
9833
9983
  },
9834
9984
  get children() {
9835
- return createComponent(BodyTextStyled, {
9985
+ return createComponent(BodyTextStyled$1, {
9836
9986
  translationKey: "walletModal.mobileConnectionModal.connectionDeclined",
9837
9987
  children: "Connection declined"
9838
9988
  });
@@ -9842,7 +9992,7 @@ const MobileConnectionModal = (props) => {
9842
9992
  return connectionErrored() === "not-supported";
9843
9993
  },
9844
9994
  get children() {
9845
- return createComponent(BodyTextStyled, {
9995
+ return createComponent(BodyTextStyled$1, {
9846
9996
  translationKey: "walletModal.mobileConnectionModal.notSupportedWallet",
9847
9997
  get translationValues() {
9848
9998
  return {
@@ -9856,7 +10006,7 @@ const MobileConnectionModal = (props) => {
9856
10006
  }
9857
10007
  })];
9858
10008
  }
9859
- }), createComponent(ButtonsContainerStyled, {
10009
+ }), createComponent(ButtonsContainerStyled$1, {
9860
10010
  get children() {
9861
10011
  return createComponent(Switch, {
9862
10012
  get children() {
@@ -9964,7 +10114,7 @@ const MobileConnectionModal = (props) => {
9964
10114
  get children() {
9965
10115
  return [createComponent(LoaderStyled, {
9966
10116
  size: "s"
9967
- }), createComponent(BodyTextStyled, {
10117
+ }), createComponent(BodyTextStyled$1, {
9968
10118
  translationKey: "walletModal.mobileConnectionModal.continueIn",
9969
10119
  get translationValues() {
9970
10120
  return {
@@ -9974,7 +10124,7 @@ const MobileConnectionModal = (props) => {
9974
10124
  get children() {
9975
10125
  return ["Continue in ", createMemo(() => props.wallet.name), "\u2026"];
9976
10126
  }
9977
- }), createComponent(ButtonsContainerStyled, {
10127
+ }), createComponent(ButtonsContainerStyled$1, {
9978
10128
  get children() {
9979
10129
  return [createComponent(Button, {
9980
10130
  get leftIcon() {
@@ -10041,7 +10191,7 @@ const MobileConnectionModal = (props) => {
10041
10191
  }
10042
10192
  });
10043
10193
  };
10044
- const borders$1 = {
10194
+ const borders$2 = {
10045
10195
  m: "16px",
10046
10196
  s: "12px",
10047
10197
  none: "0"
@@ -10081,7 +10231,7 @@ styled.li`
10081
10231
  }
10082
10232
  }
10083
10233
  `;
10084
- const H1Styled$2 = styled(H1)`
10234
+ const H1Styled$4 = styled(H1)`
10085
10235
  margin-top: 38px;
10086
10236
  margin-bottom: 4px;
10087
10237
  padding: 0 24px;
@@ -10110,7 +10260,7 @@ styled(Button)`
10110
10260
  const TelegramButtonStyled = styled(Button)`
10111
10261
  margin: 0 28px 24px;
10112
10262
  width: calc(100% - 56px);
10113
- border-radius: ${(props) => borders$1[props.theme.borderRadius]};
10263
+ border-radius: ${(props) => borders$2[props.theme.borderRadius]};
10114
10264
  padding: 14px 16px 14px 14px;
10115
10265
  background-color: ${(props) => props.theme.colors.telegramButton};
10116
10266
 
@@ -10140,7 +10290,7 @@ const actionButtonBorderRadius = {
10140
10290
  s: "8px",
10141
10291
  none: "0"
10142
10292
  };
10143
- const H1Styled$1 = styled(H1)`
10293
+ const H1Styled$3 = styled(H1)`
10144
10294
  margin-bottom: 2px;
10145
10295
  padding: 0 52px;
10146
10296
  `;
@@ -10170,7 +10320,7 @@ const ActionButton = styled(Button)`
10170
10320
  padding: 17px 20px 19px 20px;
10171
10321
  `;
10172
10322
  const MobileUniversalQR = (props) => {
10173
- return [createComponent(H1Styled$1, {
10323
+ return [createComponent(H1Styled$3, {
10174
10324
  translationKey: "walletModal.mobileUniversalModal.connectYourWallet",
10175
10325
  children: "Connect your TON wallet"
10176
10326
  }), createComponent(H2Styled$1, {
@@ -10337,7 +10487,7 @@ const MobileUniversalModal = (props) => {
10337
10487
  return createComponent(QRIcon, {});
10338
10488
  },
10339
10489
  onClick: onOpenQR
10340
- }), createComponent(H1Styled$2, {
10490
+ }), createComponent(H1Styled$4, {
10341
10491
  translationKey: "walletModal.mobileUniversalModal.connectYourWallet",
10342
10492
  children: "Connect your TON wallet"
10343
10493
  }), createComponent(Show, {
@@ -10419,7 +10569,7 @@ const MobileUniversalModal = (props) => {
10419
10569
  return _el$;
10420
10570
  })();
10421
10571
  };
10422
- const borders = {
10572
+ const borders$1 = {
10423
10573
  m: "16px",
10424
10574
  s: "8px",
10425
10575
  none: "0"
@@ -10461,7 +10611,7 @@ styled(Button)`
10461
10611
  width: 100%;
10462
10612
  padding: 0 16px;
10463
10613
  height: 56px;
10464
- border-radius: ${(props) => borders[props.theme.borderRadius]};
10614
+ border-radius: ${(props) => borders$1[props.theme.borderRadius]};
10465
10615
 
10466
10616
  &:hover {
10467
10617
  ${(props) => props.disableEventsAnimation ? "transform: unset;" : ""}
@@ -10481,7 +10631,7 @@ styled.ul`
10481
10631
  transform: translateY(-16px);
10482
10632
 
10483
10633
  background-color: ${(props) => props.theme.colors.background.primary};
10484
- border-radius: ${(props) => borders[props.theme.borderRadius]};
10634
+ border-radius: ${(props) => borders$1[props.theme.borderRadius]};
10485
10635
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.16);
10486
10636
  `;
10487
10637
  styled.li`
@@ -10586,111 +10736,475 @@ const DesktopUniversalModal = (props) => {
10586
10736
  }
10587
10737
  });
10588
10738
  };
10589
- const WalletsModal = () => {
10590
- const {
10591
- locale
10592
- } = useI18n()[1];
10593
- createEffect(() => locale(appState.language));
10594
- createEffect(() => {
10595
- if (getWalletsModalIsOpened()) {
10596
- updateIsMobile();
10597
- } else {
10598
- setSelectedWalletInfo(null);
10599
- setSelectedTab("universal");
10600
- setInfoTab(false);
10601
- }
10602
- });
10603
- const connector = useContext(ConnectorContext);
10604
- const tonConnectUI = useContext(TonConnectUiContext);
10605
- const [fetchedWalletsList] = createResource(() => tonConnectUI.getWallets());
10606
- const [selectedWalletInfo, setSelectedWalletInfo] = createSignal(null);
10607
- const [selectedWalletError, setSelectedWalletError] = createSignal(null);
10608
- const [selectedTab, setSelectedTab] = createSignal("universal");
10609
- const [infoTab, setInfoTab] = createSignal(false);
10610
- const walletsList = createMemo(() => {
10611
- if (fetchedWalletsList.state !== "ready") {
10612
- return null;
10613
- }
10614
- let walletsList2 = applyWalletsListConfiguration(fetchedWalletsList(), appState.walletsListConfiguration);
10615
- const injectedWallets = walletsList2.filter(isWalletInfoCurrentlyInjected);
10616
- const notInjectedWallets = walletsList2.filter((w) => !isWalletInfoCurrentlyInjected(w));
10617
- walletsList2 = (injectedWallets || []).concat(notInjectedWallets);
10618
- const preferredWalletAppName = appState.preferredWalletAppName;
10619
- const preferredWallet = walletsList2.find((item) => eqWalletName(item, preferredWalletAppName));
10620
- const someWalletsWithSameName = walletsList2.filter((item) => eqWalletName(item, preferredWalletAppName)).length >= 2;
10621
- if (preferredWalletAppName && preferredWallet && !someWalletsWithSameName) {
10622
- walletsList2 = [__spreadProps(__spreadValues({}, preferredWallet), {
10623
- isPreferred: true
10624
- })].concat(walletsList2.filter((item) => !eqWalletName(item, preferredWalletAppName)));
10625
- }
10626
- const atWallet = walletsList2.find((item) => eqWalletName(item, AT_WALLET_APP_NAME));
10627
- if (atWallet) {
10628
- walletsList2 = [atWallet].concat(walletsList2.filter((item) => !eqWalletName(item, AT_WALLET_APP_NAME)));
10629
- }
10630
- const uiWallets = walletsList2.map((wallet) => {
10631
- var _a2;
10632
- return __spreadProps(__spreadValues({}, wallet), {
10633
- isSupportRequiredFeatures: (tonConnectUI == null ? void 0 : tonConnectUI.walletsRequiredFeatures) ? checkRequiredWalletFeatures((_a2 = wallet.features) != null ? _a2 : [], tonConnectUI.walletsRequiredFeatures) : true
10634
- });
10635
- });
10636
- return uiWallets;
10637
- });
10638
- const additionalRequestLoading = () => {
10639
- var _a2;
10640
- return ((_a2 = appState.connectRequestParameters) == null ? void 0 : _a2.state) === "loading";
10641
- };
10642
- const additionalRequest = createMemo(() => {
10643
- var _a2;
10644
- if (additionalRequestLoading()) {
10645
- return void 0;
10646
- }
10647
- return (_a2 = appState.connectRequestParameters) == null ? void 0 : _a2.value;
10648
- });
10649
- const onClose = (closeReason) => {
10650
- tonConnectUI.closeModal(closeReason);
10651
- };
10652
- const unsubscribe = connector.onStatusChange((wallet) => {
10653
- if (wallet) {
10654
- onClose("wallet-selected");
10655
- }
10656
- }, (err) => {
10657
- var _a2;
10658
- if (err instanceof WalletMissingRequiredFeaturesError) {
10659
- const errorAppName = err.cause.connectEvent.device.appName.toLowerCase();
10660
- const wallet = (_a2 = walletsList()) == null ? void 0 : _a2.find((w) => w.appName.toLowerCase() === errorAppName);
10661
- if (!wallet) {
10662
- throw new TonConnectError("Wallet not found");
10663
- }
10664
- const walletErrorType = wallet.isSupportRequiredFeatures ? "missing-features" : "not-supported";
10665
- setSelectedWalletError(walletErrorType);
10666
- setSelectedWalletInfo(wallet);
10667
- }
10668
- });
10669
- const onSelectAllWallets = () => {
10670
- setSelectedTab("all-wallets");
10671
- };
10672
- const onSelectUniversal = () => {
10673
- setSelectedTab("universal");
10674
- };
10675
- const clearSelectedWalletInfo = () => {
10676
- setSelectedWalletInfo(null);
10677
- setSelectedWalletError(null);
10678
- };
10679
- onCleanup(() => {
10680
- setSelectedWalletInfo(null);
10681
- setSelectedWalletError(null);
10682
- setInfoTab(false);
10683
- });
10684
- onCleanup(unsubscribe);
10685
- return createComponent(StyledModal, {
10686
- get opened() {
10687
- return getWalletsModalIsOpened();
10688
- },
10689
- get enableAndroidBackHandler() {
10690
- return appState.enableAndroidBackHandler;
10691
- },
10739
+ const borders = {
10740
+ m: "16px",
10741
+ s: "8px",
10742
+ none: "0"
10743
+ };
10744
+ const H1Styled$2 = styled(H1)`
10745
+ max-width: 288px;
10746
+ margin: 0 auto 38px;
10747
+ `;
10748
+ const DesktopFeatureNotSupportModalStyled = styled.div`
10749
+ display: flex;
10750
+ flex-direction: column;
10751
+ align-items: center;
10752
+ `;
10753
+ const StyledIconButton$1 = styled(IconButton)`
10754
+ position: absolute;
10755
+ top: 16px;
10756
+ left: 16px;
10757
+ `;
10758
+ const TitleStyled = styled(H1)`
10759
+ text-align: center;
10760
+ font-size: 20px;
10761
+ line-height: 28px;
10762
+ `;
10763
+ const DescriptionStyled = styled(Text)`
10764
+ margin-top: 12px;
10765
+ margin-bottom: 24px;
10766
+ text-align: center;
10767
+ max-width: 360px;
10768
+ font-weight: 400;
10769
+ color: ${(props) => props.theme.colors.text.secondary};
10770
+ `;
10771
+ styled.button`
10772
+ background: transparent;
10773
+ border: none;
10774
+ padding: 0;
10775
+ margin: 0;
10776
+ color: ${(props) => props.theme.colors.accent};
10777
+ text-decoration: underline;
10778
+ cursor: pointer;
10779
+ font: inherit;
10780
+ `;
10781
+ const Spacer = styled.div`
10782
+ margin-bottom: 46px;
10783
+ `;
10784
+ const ErrorIconStyled = styled(ErrorIcon)`
10785
+ margin-bottom: 16px;
10786
+ `;
10787
+ styled.ul`
10788
+ display: flex;
10789
+ gap: 8px;
10790
+ margin-bottom: 24px;
10791
+ list-style: none;
10792
+ padding: 0;
10793
+ `;
10794
+ const DisconnectButtonStyled = styled(Button)`
10795
+ max-width: 320px;
10796
+ width: 100%;
10797
+ height: 48px;
10798
+ font-size: 16px;
10799
+ line-height: 20px;
10800
+ border-radius: ${(props) => borders[props.theme.borderRadius]};
10801
+ margin-bottom: 28px;
10802
+ `;
10803
+ const BodyTextStyled = styled(H2)`
10804
+ color: ${(props) => props.theme.colors.text.secondary};
10805
+ text-align: center;
10806
+ margin-bottom: 20px;
10807
+ `;
10808
+ const ButtonsContainerStyled = styled.div`
10809
+ display: flex;
10810
+ justify-content: center;
10811
+ gap: 8px;
10812
+ padding-bottom: 31px;
10813
+ `;
10814
+ const RestoreInfoModalStyled = styled.div`
10815
+ margin: 0 8px 16px 8px;
10816
+ `;
10817
+ const StyledIconButton = styled(IconButton)`
10818
+ position: absolute;
10819
+ top: 16px;
10820
+ left: 16px;
10821
+ `;
10822
+ const H1Styled$1 = styled(H1)`
10823
+ margin-bottom: 18px;
10824
+ text-align: center;
10825
+ `;
10826
+ const StepBlock = styled.div`
10827
+ padding: 16px 0;
10828
+ display: flex;
10829
+ flex-direction: column;
10830
+ align-items: center;
10831
+ `;
10832
+ styled.div`
10833
+ margin-bottom: 12px;
10834
+ `;
10835
+ const H3Styled = styled(H3)`
10836
+ text-align: center;
10837
+ margin-bottom: 4px;
10838
+ `;
10839
+ const TextStyled$1 = styled(Text)`
10840
+ text-align: center;
10841
+ max-width: 352px;
10842
+ color: ${(props) => props.theme.colors.text.secondary};
10843
+ `;
10844
+ const CircleNumber = styled.div`
10845
+ width: 44px;
10846
+ height: 44px;
10847
+ border-radius: 20px;
10848
+ background-color: ${(props) => {
10849
+ var _a2;
10850
+ return (_a2 = props.theme) == null ? void 0 : _a2.colors.icon.secondary;
10851
+ }};
10852
+ display: flex;
10853
+ align-items: center;
10854
+ justify-content: center;
10855
+ margin-bottom: 12px;
10856
+ font-weight: 700;
10857
+ font-size: 22px;
10858
+ color: ${(props) => {
10859
+ var _a2;
10860
+ return (_a2 = props.theme) == null ? void 0 : _a2.colors.text.primary;
10861
+ }};
10862
+ `;
10863
+ const RestoreInfoModal = (props) => {
10864
+ return createComponent(RestoreInfoModalStyled, {
10865
+ "data-tc-wallets-modal-restore": "true",
10866
+ get children() {
10867
+ return [createComponent(StyledIconButton, {
10868
+ icon: "arrow",
10869
+ get onClick() {
10870
+ return props.onBackClick;
10871
+ }
10872
+ }), createComponent(H1Styled$1, {
10873
+ translationKey: "walletModal.restoreInfoModal.title",
10874
+ children: "Restore"
10875
+ }), createComponent(ScrollContainer, {
10876
+ get children() {
10877
+ return [createComponent(StepBlock, {
10878
+ get children() {
10879
+ return [createComponent(CircleNumber, {
10880
+ children: "1"
10881
+ }), createComponent(H3Styled, {
10882
+ translationKey: "walletModal.restoreModal.step1.title",
10883
+ children: "Find your current recovery phrase"
10884
+ }), createComponent(TextStyled$1, {
10885
+ translationKey: "walletModal.restoreModal.step1.text",
10886
+ children: "Open your wallet settings and locate the\xA0recovery\xA0phrase"
10887
+ })];
10888
+ }
10889
+ }), createComponent(StepBlock, {
10890
+ get children() {
10891
+ return [createComponent(CircleNumber, {
10892
+ children: "2"
10893
+ }), createComponent(H3Styled, {
10894
+ translationKey: "walletModal.restoreModal.step2.title",
10895
+ children: "Copy your recovery phrase"
10896
+ }), createComponent(TextStyled$1, {
10897
+ translationKey: "walletModal.restoreModal.step2.text",
10898
+ children: "Write it down or copy it to a safe place"
10899
+ })];
10900
+ }
10901
+ }), createComponent(StepBlock, {
10902
+ get children() {
10903
+ return [createComponent(CircleNumber, {
10904
+ children: "3"
10905
+ }), createComponent(H3Styled, {
10906
+ translationKey: "walletModal.restoreModal.step3.title",
10907
+ children: "Restore in a supported wallet from\xA0the\xA0list\xA0below"
10908
+ }), createComponent(TextStyled$1, {
10909
+ translationKey: "walletModal.restoreModal.step3.text",
10910
+ children: "Enter the recovery phrase to access your wallet"
10911
+ })];
10912
+ }
10913
+ })];
10914
+ }
10915
+ })];
10916
+ }
10917
+ });
10918
+ };
10919
+ const DesktopFeatureNotSupportModal = (props) => {
10920
+ const [selectedWallet, setSelectedWallet] = createSignal(null);
10921
+ const [infoModalOpen, setInfoModalOpen] = createSignal(false);
10922
+ const currentWalletUI = createMemo(() => props.walletsList.find((wallet) => wallet.appName === props.currentWallet.device.appName || wallet.name === props.currentWallet.device.appName));
10923
+ const currentWalletName = createMemo(() => {
10924
+ var _a2, _b2, _c2, _d2;
10925
+ const appName = (_b2 = (_a2 = currentWalletUI()) == null ? void 0 : _a2.appName) != null ? _b2 : props.currentWallet.device.appName;
10926
+ if (appName === AT_WALLET_APP_NAME) {
10927
+ return "Wallet in Telegram";
10928
+ }
10929
+ return (_d2 = (_c2 = currentWalletUI()) == null ? void 0 : _c2.name) != null ? _d2 : props.currentWallet.device.appName;
10930
+ });
10931
+ const currentWalletVersionNotSupported = createMemo(() => {
10932
+ const currentWalletUIVar = currentWalletUI();
10933
+ if (!(currentWalletUIVar == null ? void 0 : currentWalletUIVar.features)) {
10934
+ return false;
10935
+ }
10936
+ const requiredFeature = props.walletsModalState.requiredFeature;
10937
+ const requiredFeatures = requiredFeature ? {
10938
+ [requiredFeature.featureName]: requiredFeature.value
10939
+ } : {};
10940
+ const validInList = checkRequiredWalletFeatures(currentWalletUIVar.features, requiredFeatures);
10941
+ const validCurrentWallet = checkRequiredWalletFeatures(props.currentWallet.device.features, requiredFeatures);
10942
+ return validInList && !validCurrentWallet;
10943
+ });
10944
+ const handleDisconnect = () => __async(void 0, null, function* () {
10945
+ yield props.onDisconnect();
10946
+ props.onSelect(selectedWallet());
10947
+ });
10948
+ return createComponent(DesktopFeatureNotSupportModalStyled, {
10949
+ get children() {
10950
+ return createComponent(Switch, {
10951
+ get children() {
10952
+ return [createComponent(Match, {
10953
+ get when() {
10954
+ return infoModalOpen();
10955
+ },
10956
+ get children() {
10957
+ return createComponent(RestoreInfoModal, {
10958
+ onBackClick: () => setInfoModalOpen(false)
10959
+ });
10960
+ }
10961
+ }), createComponent(Match, {
10962
+ get when() {
10963
+ return selectedWallet();
10964
+ },
10965
+ get children() {
10966
+ return [createComponent(Spacer, {}), createComponent(DesktopFeatureNotSupportModalStyled, {
10967
+ get children() {
10968
+ return [createComponent(StyledIconButton$1, {
10969
+ icon: "arrow",
10970
+ onClick: () => setSelectedWallet(null)
10971
+ }), createComponent(TitleStyled, {
10972
+ translationKey: "walletModal.featureNotSupported.disconnect.title",
10973
+ children: "Confirm Disconnect"
10974
+ }), createComponent(DescriptionStyled, {
10975
+ translationKey: "walletModal.featureNotSupported.disconnect.description",
10976
+ get translationValues() {
10977
+ return {
10978
+ name: selectedWallet().name
10979
+ };
10980
+ },
10981
+ get children() {
10982
+ return ["You will be disconnected from your current wallet and redirected to connect ", createMemo(() => {
10983
+ var _a2;
10984
+ return (_a2 = selectedWallet()) == null ? void 0 : _a2.name;
10985
+ }), "."];
10986
+ }
10987
+ }), createComponent(DisconnectButtonStyled, {
10988
+ onClick: () => handleDisconnect(),
10989
+ get children() {
10990
+ return createComponent(Translation, {
10991
+ translationKey: "walletModal.featureNotSupported.disconnect.button",
10992
+ children: "Disconnect"
10993
+ });
10994
+ }
10995
+ })];
10996
+ }
10997
+ })];
10998
+ }
10999
+ }), createComponent(Match, {
11000
+ get when() {
11001
+ return currentWalletVersionNotSupported();
11002
+ },
11003
+ get children() {
11004
+ return [createComponent(H1Styled$2, {
11005
+ get children() {
11006
+ return currentWalletName();
11007
+ }
11008
+ }), createComponent(ErrorIconStyled, {
11009
+ size: "s"
11010
+ }), createComponent(BodyTextStyled, {
11011
+ translationKey: "walletModal.featureNotSupported.version.description",
11012
+ get translationValues() {
11013
+ return {
11014
+ name: currentWalletName()
11015
+ };
11016
+ },
11017
+ get children() {
11018
+ return ["Your current version of ", createMemo(() => currentWalletName()), " or wallet contract type doesn't support the required features. Please update it to continue."];
11019
+ }
11020
+ }), createComponent(ButtonsContainerStyled, {
11021
+ get children() {
11022
+ return [createComponent(Link, {
11023
+ get href() {
11024
+ return currentWalletUI().aboutUrl;
11025
+ },
11026
+ blank: true,
11027
+ get children() {
11028
+ return createComponent(Button, {
11029
+ get leftIcon() {
11030
+ return createComponent(LinkIcon, {});
11031
+ },
11032
+ get children() {
11033
+ return createComponent(Translation, {
11034
+ translationKey: "walletModal.featureNotSupported.version.updateButton",
11035
+ get translationValues() {
11036
+ return {
11037
+ name: currentWalletName()
11038
+ };
11039
+ },
11040
+ get children() {
11041
+ return ["Update ", createMemo(() => currentWalletName())];
11042
+ }
11043
+ });
11044
+ }
11045
+ });
11046
+ }
11047
+ }), createComponent(Link, {
11048
+ href: "https://tonkeeper.helpscoutdocs.com/article/102-w5",
11049
+ blank: true,
11050
+ get children() {
11051
+ return createComponent(Button, {
11052
+ get leftIcon() {
11053
+ return createComponent(LinkIcon, {});
11054
+ },
11055
+ get children() {
11056
+ return createComponent(Translation, {
11057
+ translationKey: "walletModal.featureNotSupported.version.aboutW5",
11058
+ children: "About W5"
11059
+ });
11060
+ }
11061
+ });
11062
+ }
11063
+ })];
11064
+ }
11065
+ })];
11066
+ }
11067
+ }), createComponent(Match, {
11068
+ when: true,
11069
+ get children() {
11070
+ return [createComponent(Spacer, {}), createComponent(ErrorIconStyled, {
11071
+ size: "s"
11072
+ }), createComponent(TitleStyled, {
11073
+ translationKey: "walletModal.featureNotSupported.wallet.title",
11074
+ get translationValues() {
11075
+ return {
11076
+ name: currentWalletName()
11077
+ };
11078
+ },
11079
+ get children() {
11080
+ return [createMemo(() => currentWalletName()), " doesn\u2019t support the requested\xA0action"];
11081
+ }
11082
+ }), createComponent(Spacer, {})];
11083
+ }
11084
+ })];
11085
+ }
11086
+ });
11087
+ }
11088
+ });
11089
+ };
11090
+ const WalletsModal = () => {
11091
+ const {
11092
+ locale
11093
+ } = useI18n()[1];
11094
+ createEffect(() => locale(appState.language));
11095
+ createEffect(() => {
11096
+ if (getWalletsModalIsOpened()) {
11097
+ updateIsMobile();
11098
+ } else {
11099
+ setSelectedWalletInfo(null);
11100
+ setSelectedTab("universal");
11101
+ setInfoTab(false);
11102
+ }
11103
+ });
11104
+ const connector = useContext(ConnectorContext);
11105
+ const tonConnectUI = useContext(TonConnectUiContext);
11106
+ const [fetchedWalletsList] = createResource(() => tonConnectUI.getWallets());
11107
+ const [selectedWalletInfo, setSelectedWalletInfo] = createSignal(null);
11108
+ const [selectedWalletError, setSelectedWalletError] = createSignal(null);
11109
+ const [selectedTab, setSelectedTab] = createSignal("universal");
11110
+ const [infoTab, setInfoTab] = createSignal(false);
11111
+ const walletsModalIsWalletNotSupportFeature = createMemo(() => {
11112
+ const state = walletsModalState();
11113
+ return "type" in state && state.type === "wallet-not-support-feature";
11114
+ });
11115
+ const walletsList = createMemo(() => {
11116
+ var _a2;
11117
+ if (fetchedWalletsList.state !== "ready") {
11118
+ return null;
11119
+ }
11120
+ let walletsList2 = applyWalletsListConfiguration(fetchedWalletsList(), appState.walletsListConfiguration);
11121
+ const injectedWallets = walletsList2.filter(isWalletInfoCurrentlyInjected);
11122
+ const notInjectedWallets = walletsList2.filter((w) => !isWalletInfoCurrentlyInjected(w));
11123
+ walletsList2 = (injectedWallets || []).concat(notInjectedWallets);
11124
+ const preferredWalletAppName = appState.preferredWalletAppName;
11125
+ const preferredWallet = walletsList2.find((item) => eqWalletName(item, preferredWalletAppName));
11126
+ const someWalletsWithSameName = walletsList2.filter((item) => eqWalletName(item, preferredWalletAppName)).length >= 2;
11127
+ if (preferredWalletAppName && preferredWallet && !someWalletsWithSameName) {
11128
+ walletsList2 = [__spreadProps(__spreadValues({}, preferredWallet), {
11129
+ isPreferred: true
11130
+ })].concat(walletsList2.filter((item) => !eqWalletName(item, preferredWalletAppName)));
11131
+ }
11132
+ const atWallet = walletsList2.find((item) => eqWalletName(item, AT_WALLET_APP_NAME));
11133
+ if (atWallet) {
11134
+ walletsList2 = [atWallet].concat(walletsList2.filter((item) => !eqWalletName(item, AT_WALLET_APP_NAME)));
11135
+ }
11136
+ const walletsFeaturesRequested = (_a2 = tonConnectUI == null ? void 0 : tonConnectUI.walletsRequiredFeatures) != null ? _a2 : tonConnectUI == null ? void 0 : tonConnectUI.walletsPreferredFeatures;
11137
+ const uiWallets = walletsList2.map((wallet) => {
11138
+ var _a3;
11139
+ return __spreadProps(__spreadValues({}, wallet), {
11140
+ isSupportRequiredFeatures: walletsFeaturesRequested ? checkRequiredWalletFeatures((_a3 = wallet.features) != null ? _a3 : [], walletsFeaturesRequested) : true
11141
+ });
11142
+ });
11143
+ return uiWallets;
11144
+ });
11145
+ const additionalRequestLoading = () => {
11146
+ var _a2;
11147
+ return ((_a2 = appState.connectRequestParameters) == null ? void 0 : _a2.state) === "loading";
11148
+ };
11149
+ const additionalRequest = createMemo(() => {
11150
+ var _a2;
11151
+ if (additionalRequestLoading()) {
11152
+ return void 0;
11153
+ }
11154
+ return (_a2 = appState.connectRequestParameters) == null ? void 0 : _a2.value;
11155
+ });
11156
+ const onClose = (closeReason) => {
11157
+ tonConnectUI.closeModal(closeReason);
11158
+ };
11159
+ const unsubscribe = connector.onStatusChange((wallet) => {
11160
+ if (wallet) {
11161
+ onClose("wallet-selected");
11162
+ }
11163
+ }, (err) => {
11164
+ var _a2;
11165
+ if (err instanceof WalletMissingRequiredFeaturesError) {
11166
+ const errorAppName = err.cause.connectEvent.device.appName.toLowerCase();
11167
+ const wallet = (_a2 = walletsList()) == null ? void 0 : _a2.find((w) => w.appName.toLowerCase() === errorAppName);
11168
+ if (!wallet) {
11169
+ throw new TonConnectError("Wallet not found");
11170
+ }
11171
+ const walletErrorType = wallet.isSupportRequiredFeatures ? "missing-features" : "not-supported";
11172
+ setSelectedWalletError(walletErrorType);
11173
+ setSelectedWalletInfo(wallet);
11174
+ }
11175
+ });
11176
+ const onSelectAllWallets = () => {
11177
+ setSelectedTab("all-wallets");
11178
+ };
11179
+ const onSelectUniversal = () => {
11180
+ setSelectedTab("universal");
11181
+ };
11182
+ const onSelectWallet = (wallet) => {
11183
+ setSelectedWalletInfo(wallet);
11184
+ widgetController.openWalletsModal();
11185
+ };
11186
+ const clearSelectedWalletInfo = () => {
11187
+ setSelectedWalletInfo(null);
11188
+ setSelectedWalletError(null);
11189
+ };
11190
+ onCleanup(() => {
11191
+ setSelectedWalletInfo(null);
11192
+ setSelectedWalletError(null);
11193
+ setInfoTab(false);
11194
+ });
11195
+ onCleanup(unsubscribe);
11196
+ return createComponent(StyledModal, {
11197
+ get opened() {
11198
+ return getWalletsModalIsOpened();
11199
+ },
11200
+ get enableAndroidBackHandler() {
11201
+ return appState.enableAndroidBackHandler;
11202
+ },
10692
11203
  onClose: () => onClose("action-cancelled"),
10693
11204
  onClickQuestion: () => setInfoTab((v) => !v),
11205
+ get showFooter() {
11206
+ return !walletsModalIsWalletNotSupportFeature();
11207
+ },
10694
11208
  "data-tc-wallets-modal-container": "true",
10695
11209
  get children() {
10696
11210
  return [createComponent(Show, {
@@ -10712,7 +11226,7 @@ const WalletsModal = () => {
10712
11226
  return additionalRequestLoading() || !walletsList();
10713
11227
  },
10714
11228
  get children() {
10715
- return [createComponent(H1Styled$8, {
11229
+ return [createComponent(H1Styled$a, {
10716
11230
  translationKey: "walletModal.loading",
10717
11231
  children: "Wallets list is loading"
10718
11232
  }), createComponent(LoaderContainerStyled, {
@@ -10731,6 +11245,27 @@ const WalletsModal = () => {
10731
11245
  return createComponent(Switch, {
10732
11246
  get children() {
10733
11247
  return [createComponent(Match, {
11248
+ get when() {
11249
+ return walletsModalIsWalletNotSupportFeature();
11250
+ },
11251
+ get children() {
11252
+ return createComponent(DesktopFeatureNotSupportModal, {
11253
+ get walletsList() {
11254
+ return walletsList();
11255
+ },
11256
+ get currentWallet() {
11257
+ return tonConnectUI == null ? void 0 : tonConnectUI.wallet;
11258
+ },
11259
+ onSelect: onSelectWallet,
11260
+ onSelectAllWallets,
11261
+ onDisconnect: () => connector.disconnect(),
11262
+ get walletsModalState() {
11263
+ return walletsModalState();
11264
+ },
11265
+ onClose: () => onClose("action-cancelled")
11266
+ });
11267
+ }
11268
+ }), createComponent(Match, {
10734
11269
  get when() {
10735
11270
  return selectedWalletInfo();
10736
11271
  },
@@ -10779,6 +11314,9 @@ const WalletsModal = () => {
10779
11314
  get walletsList() {
10780
11315
  return walletsList();
10781
11316
  },
11317
+ get featureCheckMode() {
11318
+ return (tonConnectUI == null ? void 0 : tonConnectUI.walletsRequiredFeatures) ? "strict" : "soft";
11319
+ },
10782
11320
  onBack: onSelectUniversal,
10783
11321
  onSelect: setSelectedWalletInfo
10784
11322
  });
@@ -10976,6 +11514,52 @@ const TransactionSentModal = (props) => {
10976
11514
  "data-tc-transaction-sent-modal": "true"
10977
11515
  });
10978
11516
  };
11517
+ const ConfirmSignDataModal = (props) => {
11518
+ const tonConnectUI = useContext(TonConnectUiContext);
11519
+ const [t2] = useI18n();
11520
+ const name = () => tonConnectUI.wallet && "name" in tonConnectUI.wallet ? tonConnectUI.wallet.name : t2("common.yourWallet", {}, "Your wallet");
11521
+ return createComponent(ActionModal, {
11522
+ headerTranslationKey: "actionModal.signData.header",
11523
+ get headerTranslationValues() {
11524
+ return {
11525
+ name: name()
11526
+ };
11527
+ },
11528
+ textTranslationKey: "actionModal.signData.text",
11529
+ get icon() {
11530
+ return createComponent(LoaderIcon, {
11531
+ size: "m"
11532
+ });
11533
+ },
11534
+ onClose: () => props.onClose(),
11535
+ showButton: "open-wallet",
11536
+ "data-tc-sign-data-confirm-modal": "true"
11537
+ });
11538
+ };
11539
+ const SignDataCanceledModal = (props) => {
11540
+ return createComponent(ActionModal, {
11541
+ headerTranslationKey: "actionModal.signDataCanceled.header",
11542
+ get icon() {
11543
+ return createComponent(ErrorIcon, {
11544
+ size: "m"
11545
+ });
11546
+ },
11547
+ onClose: () => props.onClose(),
11548
+ "data-tc-sign-data-canceled-modal": "true"
11549
+ });
11550
+ };
11551
+ const DataSignedModal = (props) => {
11552
+ return createComponent(ActionModal, {
11553
+ headerTranslationKey: "actionModal.dataSigned.header",
11554
+ get icon() {
11555
+ return createComponent(SuccessIcon, {
11556
+ size: "m"
11557
+ });
11558
+ },
11559
+ onClose: () => props.onClose(),
11560
+ "data-tc-data-signed-modal": "true"
11561
+ });
11562
+ };
10979
11563
  const ActionsModal = () => {
10980
11564
  return createComponent(Modal, {
10981
11565
  get opened() {
@@ -10986,6 +11570,7 @@ const ActionsModal = () => {
10986
11570
  return appState.enableAndroidBackHandler;
10987
11571
  },
10988
11572
  onClose: () => setAction(null),
11573
+ showFooter: false,
10989
11574
  "data-tc-actions-modal-container": "true",
10990
11575
  get children() {
10991
11576
  return createComponent(Switch, {
@@ -11017,6 +11602,33 @@ const ActionsModal = () => {
11017
11602
  onClose: () => setAction(null)
11018
11603
  });
11019
11604
  }
11605
+ }), createComponent(Match, {
11606
+ get when() {
11607
+ return action().name === "data-signed";
11608
+ },
11609
+ get children() {
11610
+ return createComponent(DataSignedModal, {
11611
+ onClose: () => setAction(null)
11612
+ });
11613
+ }
11614
+ }), createComponent(Match, {
11615
+ get when() {
11616
+ return action().name === "sign-data-canceled";
11617
+ },
11618
+ get children() {
11619
+ return createComponent(SignDataCanceledModal, {
11620
+ onClose: () => setAction(null)
11621
+ });
11622
+ }
11623
+ }), createComponent(Match, {
11624
+ get when() {
11625
+ return action().name === "confirm-sign-data";
11626
+ },
11627
+ get children() {
11628
+ return createComponent(ConfirmSignDataModal, {
11629
+ onClose: () => setAction(null)
11630
+ });
11631
+ }
11020
11632
  })];
11021
11633
  }
11022
11634
  });
@@ -11068,6 +11680,7 @@ const SingleWalletModal = () => {
11068
11680
  },
11069
11681
  onClose: () => onClose("action-cancelled"),
11070
11682
  onClickQuestion: () => setInfoTab((v) => !v),
11683
+ showFooter: true,
11071
11684
  "data-tc-wallets-modal-container": "true",
11072
11685
  get children() {
11073
11686
  return [createComponent(Show, {
@@ -11089,7 +11702,7 @@ const SingleWalletModal = () => {
11089
11702
  return additionalRequestLoading();
11090
11703
  },
11091
11704
  get children() {
11092
- return [createComponent(H1Styled$8, {
11705
+ return [createComponent(H1Styled$a, {
11093
11706
  translationKey: "walletModal.loading",
11094
11707
  children: "Wallets list is loading"
11095
11708
  }), createComponent(LoaderContainerStyled, {
@@ -11195,6 +11808,12 @@ const widgetController = {
11195
11808
  status: "closed",
11196
11809
  closeReason: reason
11197
11810
  })),
11811
+ openWalletNotSupportFeatureModal: (cause) => void setTimeout(() => setWalletsModalState({
11812
+ status: "opened",
11813
+ closeReason: null,
11814
+ type: "wallet-not-support-feature",
11815
+ requiredFeature: cause.requiredFeature
11816
+ })),
11198
11817
  setAction: (action2) => void setTimeout(() => setAction(action2)),
11199
11818
  clearAction: () => void setTimeout(() => setAction(null)),
11200
11819
  getSelectedWalletInfo: () => lastSelectedWalletInfo(),
@@ -11506,8 +12125,29 @@ class TonConnectUITracker {
11506
12125
  } catch (e2) {
11507
12126
  }
11508
12127
  }
12128
+ trackDataSentForSignature(...args) {
12129
+ try {
12130
+ const event = createDataSentForSignatureEvent(this.version, ...args);
12131
+ this.dispatchUserActionEvent(event);
12132
+ } catch (e2) {
12133
+ }
12134
+ }
12135
+ trackDataSigned(...args) {
12136
+ try {
12137
+ const event = createDataSignedEvent(this.version, ...args);
12138
+ this.dispatchUserActionEvent(event);
12139
+ } catch (e2) {
12140
+ }
12141
+ }
12142
+ trackDataSigningFailed(...args) {
12143
+ try {
12144
+ const event = createDataSigningFailedEvent(this.version, ...args);
12145
+ this.dispatchUserActionEvent(event);
12146
+ } catch (e2) {
12147
+ }
12148
+ }
11509
12149
  }
11510
- const tonConnectUiVersion = "2.1.1-beta.0";
12150
+ const tonConnectUiVersion = "2.2.0-beta.0";
11511
12151
  class TonConnectUI {
11512
12152
  constructor(options) {
11513
12153
  __publicField(this, "walletInfoStorage", new WalletInfoStorage());
@@ -11517,7 +12157,8 @@ class TonConnectUI {
11517
12157
  __publicField(this, "systemThemeChangeUnsubscribe", null);
11518
12158
  __publicField(this, "actionsConfiguration");
11519
12159
  __publicField(this, "walletsList");
11520
- __publicField(this, "walletsRequiredFeatures");
12160
+ __publicField(this, "_walletsRequiredFeatures");
12161
+ __publicField(this, "_walletsPreferredFeatures");
11521
12162
  __publicField(this, "connectRequestParametersCallback");
11522
12163
  __publicField(this, "connector");
11523
12164
  __publicField(this, "modal");
@@ -11558,7 +12199,8 @@ class TonConnectUI {
11558
12199
  this.transactionModal = new TransactionModalManager({
11559
12200
  connector: this.connector
11560
12201
  });
11561
- this.walletsRequiredFeatures = options.walletsRequiredFeatures;
12202
+ this._walletsRequiredFeatures = options.walletsRequiredFeatures;
12203
+ this._walletsPreferredFeatures = options.walletsPreferredFeatures;
11562
12204
  this.walletsList = this.getWallets();
11563
12205
  this.walletsList.then((list) => preloadImages(uniq(list.map((item) => item.imageUrl))));
11564
12206
  const rootId = this.normalizeWidgetRoot(options == null ? void 0 : options.widgetRootId);
@@ -11587,6 +12229,12 @@ class TonConnectUI {
11587
12229
  static getWallets() {
11588
12230
  return TonConnect.getWallets();
11589
12231
  }
12232
+ get walletsRequiredFeatures() {
12233
+ return this._walletsRequiredFeatures;
12234
+ }
12235
+ get walletsPreferredFeatures() {
12236
+ return this._walletsPreferredFeatures;
12237
+ }
11590
12238
  get connected() {
11591
12239
  return this.connector.connected;
11592
12240
  }
@@ -11603,6 +12251,12 @@ class TonConnectUI {
11603
12251
  var _a2, _b2, _c2, _d2, _e2;
11604
12252
  this.checkButtonRootExist(options.buttonRootId);
11605
12253
  this.actionsConfiguration = options.actionsConfiguration;
12254
+ if ("walletsRequiredFeatures" in options) {
12255
+ this._walletsRequiredFeatures = options.walletsRequiredFeatures;
12256
+ }
12257
+ if ("walletsPreferredFeatures" in options) {
12258
+ this._walletsPreferredFeatures = options.walletsPreferredFeatures;
12259
+ }
11606
12260
  if ((_a2 = options.uiPreferences) == null ? void 0 : _a2.theme) {
11607
12261
  if (((_b2 = options.uiPreferences) == null ? void 0 : _b2.theme) !== "SYSTEM") {
11608
12262
  (_c2 = this.systemThemeChangeUnsubscribe) == null ? void 0 : _c2.call(this);
@@ -11727,6 +12381,7 @@ class TonConnectUI {
11727
12381
  openModal: modals.includes("before"),
11728
12382
  sent: false
11729
12383
  });
12384
+ const abortController = new AbortController();
11730
12385
  const onRequestSent = () => {
11731
12386
  if (abortController.signal.aborted) {
11732
12387
  return;
@@ -11737,28 +12392,11 @@ class TonConnectUI {
11737
12392
  openModal: modals.includes("before"),
11738
12393
  sent: true
11739
12394
  });
11740
- if (this.walletInfo && "universalLink" in this.walletInfo && (this.walletInfo.openMethod === "universal-link" || this.walletInfo.openMethod === "custom-deeplink")) {
11741
- if (isTelegramUrl(this.walletInfo.universalLink)) {
11742
- redirectToTelegram(this.walletInfo.universalLink, {
11743
- returnStrategy,
11744
- twaReturnUrl: twaReturnUrl || appState.twaReturnUrl,
11745
- forceRedirect: false
11746
- });
11747
- } else {
11748
- redirectToWallet(
11749
- this.walletInfo.universalLink,
11750
- this.walletInfo.deepLink,
11751
- {
11752
- returnStrategy,
11753
- forceRedirect: false
11754
- },
11755
- () => {
11756
- }
11757
- );
11758
- }
11759
- }
12395
+ this.redirectAfterRequestSent({
12396
+ returnStrategy,
12397
+ twaReturnUrl
12398
+ });
11760
12399
  };
11761
- const abortController = new AbortController();
11762
12400
  const unsubscribe = this.onTransactionModalStateChange((action2) => {
11763
12401
  if (action2 == null ? void 0 : action2.openModal) {
11764
12402
  return;
@@ -11784,6 +12422,11 @@ class TonConnectUI {
11784
12422
  });
11785
12423
  return result;
11786
12424
  } catch (e2) {
12425
+ if (e2 instanceof WalletNotSupportFeatureError) {
12426
+ widgetController.clearAction();
12427
+ widgetController.openWalletNotSupportFeatureModal(e2.cause);
12428
+ throw e2;
12429
+ }
11787
12430
  widgetController.setAction({
11788
12431
  name: "transaction-canceled",
11789
12432
  showNotification: notifications2.includes("error"),
@@ -11800,6 +12443,110 @@ class TonConnectUI {
11800
12443
  }
11801
12444
  });
11802
12445
  }
12446
+ signData(data) {
12447
+ return __async(this, null, function* () {
12448
+ this.tracker.trackDataSentForSignature(this.wallet, data);
12449
+ if (!this.connected) {
12450
+ this.tracker.trackDataSigningFailed(this.wallet, data, "Wallet was not connected");
12451
+ throw new TonConnectUIError("Connect wallet to send a transaction.");
12452
+ }
12453
+ if (isInTMA()) {
12454
+ sendExpand();
12455
+ }
12456
+ const { notifications: notifications2, modals, returnStrategy, twaReturnUrl } = this.getModalsAndNotificationsConfiguration();
12457
+ widgetController.setAction({
12458
+ name: "confirm-sign-data",
12459
+ showNotification: notifications2.includes("before"),
12460
+ openModal: modals.includes("before"),
12461
+ signed: false
12462
+ });
12463
+ const abortController = new AbortController();
12464
+ const onRequestSent = () => {
12465
+ if (abortController.signal.aborted) {
12466
+ return;
12467
+ }
12468
+ widgetController.setAction({
12469
+ name: "confirm-sign-data",
12470
+ showNotification: notifications2.includes("before"),
12471
+ openModal: modals.includes("before"),
12472
+ signed: true
12473
+ });
12474
+ this.redirectAfterRequestSent({
12475
+ returnStrategy,
12476
+ twaReturnUrl
12477
+ });
12478
+ };
12479
+ const unsubscribe = this.onTransactionModalStateChange((action2) => {
12480
+ if (action2 == null ? void 0 : action2.openModal) {
12481
+ return;
12482
+ }
12483
+ unsubscribe();
12484
+ if (!action2) {
12485
+ abortController.abort();
12486
+ }
12487
+ });
12488
+ try {
12489
+ const result = yield this.waitForSignData(
12490
+ {
12491
+ data,
12492
+ signal: new AbortController().signal
12493
+ },
12494
+ onRequestSent
12495
+ );
12496
+ this.tracker.trackDataSigned(this.wallet, data, result);
12497
+ widgetController.setAction({
12498
+ name: "data-signed",
12499
+ showNotification: notifications2.includes("success"),
12500
+ openModal: modals.includes("success")
12501
+ });
12502
+ return result;
12503
+ } catch (e2) {
12504
+ if (e2 instanceof WalletNotSupportFeatureError) {
12505
+ widgetController.clearAction();
12506
+ widgetController.openWalletNotSupportFeatureModal(e2.cause);
12507
+ throw e2;
12508
+ }
12509
+ widgetController.setAction({
12510
+ name: "sign-data-canceled",
12511
+ showNotification: notifications2.includes("error"),
12512
+ openModal: modals.includes("error")
12513
+ });
12514
+ if (e2 instanceof TonConnectError) {
12515
+ throw e2;
12516
+ } else {
12517
+ console.error(e2);
12518
+ throw new TonConnectUIError("Unhandled error:" + e2);
12519
+ }
12520
+ } finally {
12521
+ unsubscribe();
12522
+ }
12523
+ });
12524
+ }
12525
+ redirectAfterRequestSent({
12526
+ returnStrategy,
12527
+ twaReturnUrl
12528
+ }) {
12529
+ if (this.walletInfo && "universalLink" in this.walletInfo && (this.walletInfo.openMethod === "universal-link" || this.walletInfo.openMethod === "custom-deeplink")) {
12530
+ if (isTelegramUrl(this.walletInfo.universalLink)) {
12531
+ redirectToTelegram(this.walletInfo.universalLink, {
12532
+ returnStrategy,
12533
+ twaReturnUrl: twaReturnUrl || appState.twaReturnUrl,
12534
+ forceRedirect: false
12535
+ });
12536
+ } else {
12537
+ redirectToWallet(
12538
+ this.walletInfo.universalLink,
12539
+ this.walletInfo.deepLink,
12540
+ {
12541
+ returnStrategy,
12542
+ forceRedirect: false
12543
+ },
12544
+ () => {
12545
+ }
12546
+ );
12547
+ }
12548
+ }
12549
+ }
11803
12550
  connectEmbeddedWallet(embeddedWallet) {
11804
12551
  return __async(this, null, function* () {
11805
12552
  const connect = (parameters) => {
@@ -11922,6 +12669,33 @@ class TonConnectUI {
11922
12669
  });
11923
12670
  });
11924
12671
  }
12672
+ waitForSignData(options, onRequestSent) {
12673
+ return __async(this, null, function* () {
12674
+ return new Promise((resolve, reject) => {
12675
+ const { data, signal } = options;
12676
+ if (signal.aborted) {
12677
+ this.tracker.trackDataSigningFailed(this.wallet, data, "SignData was cancelled");
12678
+ return reject(new TonConnectUIError("SignData was not sent"));
12679
+ }
12680
+ const onSignHandler = (data2) => __async(this, null, function* () {
12681
+ resolve(data2);
12682
+ });
12683
+ const onErrorsHandler = (reason) => {
12684
+ reject(reason);
12685
+ };
12686
+ const onCanceledHandler = () => {
12687
+ this.tracker.trackDataSigningFailed(this.wallet, data, "SignData was cancelled");
12688
+ reject(new TonConnectUIError("SignData was not sent"));
12689
+ };
12690
+ signal.addEventListener("abort", onCanceledHandler, { once: true });
12691
+ this.connector.signData(data, { onRequestSent, signal }).then((result) => {
12692
+ return onSignHandler(result);
12693
+ }).catch((reason) => {
12694
+ return onErrorsHandler(reason);
12695
+ });
12696
+ });
12697
+ });
12698
+ }
11925
12699
  onTransactionModalStateChange(onChange) {
11926
12700
  return this.transactionModal.onStateChange(onChange);
11927
12701
  }