@multiversx/sdk-dapp-liquidity 1.0.12 → 1.0.14

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 (302) hide show
  1. package/ConstantsUtil-BinYIDR2.mjs +8 -0
  2. package/ConstantsUtil-CbnVdQ5P.js +8 -0
  3. package/add-D-ECcdUh.mjs +19 -0
  4. package/add-Diz8heiY.js +20 -0
  5. package/all-wallets-_iOQf3bl.js +11 -0
  6. package/all-wallets-puIIQy3Y.mjs +10 -0
  7. package/app-store-BGTKFL27.js +22 -0
  8. package/app-store-Bsf7w3pv.mjs +21 -0
  9. package/apple-Cw8e8IGH.mjs +22 -0
  10. package/apple-DF7n_Yzl.js +23 -0
  11. package/arrow-bottom-Cp2C4fQv.mjs +12 -0
  12. package/arrow-bottom-DTvIR3s3.js +13 -0
  13. package/arrow-bottom-circle-CN6i5mHz.mjs +15 -0
  14. package/arrow-bottom-circle-CzPwiwWH.js +16 -0
  15. package/arrow-left-9VFYHQSW.js +13 -0
  16. package/arrow-left-BDQHoEvX.mjs +12 -0
  17. package/arrow-right-BxkuSpWU.mjs +12 -0
  18. package/arrow-right-DBLQ6w92.js +13 -0
  19. package/arrow-top-BiQd5Aey.js +13 -0
  20. package/arrow-top-BrLVX4Rj.mjs +12 -0
  21. package/bank-B7EC6Kdz.mjs +18 -0
  22. package/bank-CvPn9sfV.js +19 -0
  23. package/{bignumber-CKZkoo0g.mjs → bignumber-2Z7uapuD.mjs} +6 -6
  24. package/{bignumber-B8vjg9qn.js → bignumber-D1Wl54dL.js} +6 -6
  25. package/bin-BXO1kNZh.js +9 -0
  26. package/bin-CwiYVJ1L.mjs +8 -0
  27. package/bitcoin-C3kBVar_.mjs +17 -0
  28. package/bitcoin-DAvQGpeP.js +3251 -0
  29. package/bitcoin-dNBGbS2B.mjs +3251 -0
  30. package/bitcoin-k6bvmzMA.js +18 -0
  31. package/browser-ShRLuKKz.mjs +18 -0
  32. package/browser-t7nfT7HL.js +19 -0
  33. package/card-BJg5bdoM.mjs +18 -0
  34. package/card-hxUDXttT.js +19 -0
  35. package/checkmark-BpR0Yy93.mjs +15 -0
  36. package/checkmark-D9AVWgl5.js +16 -0
  37. package/checkmark-bold-D3Xcby1U.mjs +12 -0
  38. package/checkmark-bold-De02hde8.js +13 -0
  39. package/chevron-bottom-DcBf7T5F.js +13 -0
  40. package/chevron-bottom-DfGpWIz7.mjs +12 -0
  41. package/chevron-left-BKvYVnUo.js +13 -0
  42. package/chevron-left-DGSG9WJQ.mjs +12 -0
  43. package/chevron-right-BLgYIEeO.js +13 -0
  44. package/chevron-right-C2nsTx_Y.mjs +12 -0
  45. package/chevron-top-CwFOEFy8.js +13 -0
  46. package/chevron-top-vk-9DvUU.mjs +12 -0
  47. package/chrome-store-4H_ie3vA.mjs +65 -0
  48. package/chrome-store-BWarxVMl.js +66 -0
  49. package/circle-BtqWJU0_.mjs +8 -0
  50. package/circle-DYjG6o7-.js +9 -0
  51. package/clock-Ba5SM-pl.mjs +12 -0
  52. package/clock-DPzNREdU.js +13 -0
  53. package/close-CJHKFOyp.mjs +12 -0
  54. package/close-DDWnJdJe.js +13 -0
  55. package/coinPlaceholder-Cbba3D1H.mjs +12 -0
  56. package/coinPlaceholder-DdxQIc2D.js +13 -0
  57. package/compass-CugCxeSC.js +13 -0
  58. package/compass-DbN5DkTl.mjs +12 -0
  59. package/copy-CHSZprYJ.mjs +19 -0
  60. package/copy-En5h5Uhu.js +20 -0
  61. package/cursor-DCRkvEhr.mjs +7 -0
  62. package/cursor-DnEQtrUK.js +8 -0
  63. package/cursor-transparent-CU8lk-xg.js +17 -0
  64. package/cursor-transparent-CliETg4d.mjs +16 -0
  65. package/desktop-BgD7aypB.js +14 -0
  66. package/desktop-Cg5I32-p.mjs +13 -0
  67. package/disconnect-CCyMbAdw.js +13 -0
  68. package/disconnect-Cp2vRWB2.mjs +12 -0
  69. package/discord-B1d-qeSk.mjs +21 -0
  70. package/discord-BEB5klec.js +22 -0
  71. package/email-CorlePKz.js +873 -0
  72. package/email-Znno7H8_.mjs +878 -0
  73. package/embedded-wallet-B9ro9Tel.js +549 -0
  74. package/embedded-wallet-CnTWeseG.mjs +552 -0
  75. package/ethereum-BRcsRjUU.mjs +14 -0
  76. package/ethereum-CZ_xe09e.js +15 -0
  77. package/etherscan-BZKGpKp8.mjs +10 -0
  78. package/etherscan-DtLi-C3z.js +11 -0
  79. package/exclamation-triangle-BLNnBLEc.js +9 -0
  80. package/exclamation-triangle-CFThXxRT.mjs +8 -0
  81. package/extension-CwUepr-W.mjs +12 -0
  82. package/extension-DOD67G1k.js +13 -0
  83. package/external-link-CZkQS5XK.js +13 -0
  84. package/external-link-ClYNKSPt.mjs +12 -0
  85. package/facebook-CFjrd4my.mjs +30 -0
  86. package/facebook-CbE6K6AK.js +31 -0
  87. package/farcaster-Ba7_C-Vm.js +17 -0
  88. package/farcaster-DyVJtVS9.mjs +16 -0
  89. package/filters-CpHaFNjT.mjs +12 -0
  90. package/filters-w5LC-r6e.js +13 -0
  91. package/github-CeO70C3E.mjs +22 -0
  92. package/github-uLFBWAa5.js +23 -0
  93. package/google-CyOdUlbw.mjs +22 -0
  94. package/google-ILGK-opP.js +23 -0
  95. package/help-circle-Dh3dRNoB.mjs +16 -0
  96. package/help-circle-HUMbz_KN.js +17 -0
  97. package/id-Cy3Qkrvb.js +17 -0
  98. package/id-D-Q0uPFM.mjs +16 -0
  99. package/if-defined-CJ5EZLw2.js +815 -0
  100. package/if-defined-DjC5UMfF.mjs +815 -0
  101. package/image-BTGOf8bb.mjs +8 -0
  102. package/image-WFQO5bWa.js +9 -0
  103. package/index--O5ypTeK.mjs +70 -0
  104. package/index--Vg7VI9t.js +173 -0
  105. package/index-2iRSO1sa.mjs +9964 -0
  106. package/index-42Rpweo5.mjs +95 -0
  107. package/index-70kjE43k.mjs +90 -0
  108. package/index-8VyNYS01.js +273 -0
  109. package/index-B-dx8l0g.mjs +82 -0
  110. package/index-BB0nW9RB.mjs +198 -0
  111. package/index-BBwuv2SS.js +97 -0
  112. package/index-BIe-kofv.mjs +273 -0
  113. package/index-BQf6VHil.js +278 -0
  114. package/index-BWIZXhFv.mjs +630 -0
  115. package/index-BXkamf-I.js +337 -0
  116. package/index-BYTxCmKH.js +64 -0
  117. package/index-BYoOxo0S.js +218 -0
  118. package/index-Ba0tVdql.js +200 -0
  119. package/index-BdOAPWyt.mjs +210 -0
  120. package/index-BirWzf8c.mjs +71 -0
  121. package/index-BnCJUHtW.mjs +346 -0
  122. package/index-BuL2FC61.mjs +216 -0
  123. package/index-BxSUTfaY.js +88 -0
  124. package/index-C49C5Rxf.js +743 -0
  125. package/index-CNMDBpW7.js +346 -0
  126. package/index-CP0CGjqQ.mjs +263 -0
  127. package/index-CQaHcTZM.mjs +86 -0
  128. package/index-CRGXQei1.js +178 -0
  129. package/index-CSykUIfV.mjs +176 -0
  130. package/index-CWIHaLkQ.mjs +101 -0
  131. package/index-CZSDJd0P.mjs +1070 -0
  132. package/index-CZaV8JgR.mjs +49 -0
  133. package/index-CZjdy6QP.js +101 -0
  134. package/index-C_lIGGlC.js +632 -0
  135. package/index-CcgeRPs2.mjs +57 -0
  136. package/index-CeY_DRuc.js +566 -0
  137. package/index-ChFNkSxT.js +92 -0
  138. package/index-CkjZc20w.js +677 -0
  139. package/index-CtFcWwAd.js +72 -0
  140. package/index-D0mOfznC.mjs +362 -0
  141. package/index-DAtWLY21.js +84 -0
  142. package/index-DEs8H3w2.js +262 -0
  143. package/index-DLnxotbC.mjs +566 -0
  144. package/index-DN4fGDgg.mjs +743 -0
  145. package/index-DT_mc1hV.mjs +335 -0
  146. package/index-DZEwxUMS.js +59 -0
  147. package/index-DaRH_4bD.js +9939 -0
  148. package/index-Daok2ZKn.js +73 -0
  149. package/index-DomzHmwk.js +210 -0
  150. package/index-Dx7NyDyv.mjs +101 -0
  151. package/index-DyGir6_2.mjs +675 -0
  152. package/index-GglJmM2C.js +2237 -0
  153. package/index-H5b7UTeJ.mjs +173 -0
  154. package/index-NNZ1lNuc.mjs +168 -0
  155. package/index-RJd-gQcv.mjs +2235 -0
  156. package/index-dnFzVpGy.js +103 -0
  157. package/index-kwVLu8EV.js +168 -0
  158. package/index-miQwZPmn.js +51 -0
  159. package/index-oCj_SpOa.mjs +62 -0
  160. package/index-pNK-h_x9.js +1069 -0
  161. package/index-r6Kre1rx.js +362 -0
  162. package/index-xBD0nXoB.mjs +276 -0
  163. package/index.js +3 -3
  164. package/index.mjs +3 -3
  165. package/info-BKNAiN0k.js +8 -0
  166. package/info-DQE0s-A4.mjs +7 -0
  167. package/info-circle-C3uTocjH.js +17 -0
  168. package/info-circle-CIn6yeQo.mjs +16 -0
  169. package/lightbulb-CB-BmIop.js +8 -0
  170. package/lightbulb-Gv7IbnzO.mjs +7 -0
  171. package/mail-CFYm95wn.mjs +12 -0
  172. package/mail-GEwk-Fzr.js +13 -0
  173. package/mobile-CZ7ZBfa5.js +14 -0
  174. package/mobile-OIbnpFsU.mjs +13 -0
  175. package/more-C8N_RV55.mjs +15 -0
  176. package/more-CiQpPZwq.js +16 -0
  177. package/network-placeholder-CxEcczEx.mjs +18 -0
  178. package/network-placeholder-DwR8E8hP.js +19 -0
  179. package/nftPlaceholder-BFexVcGX.js +13 -0
  180. package/nftPlaceholder-MiYL110I.mjs +12 -0
  181. package/off-BNiMlpUU.mjs +8 -0
  182. package/off-iJHSK3Z7.js +9 -0
  183. package/onramp-Bs8HHFFY.js +1474 -0
  184. package/onramp-C6fuQfX7.mjs +1480 -0
  185. package/package.json +11 -11
  186. package/play-store-B4ssIYUA.js +37 -0
  187. package/play-store-D6nmQXhX.mjs +36 -0
  188. package/plus-Bh7z7Oc0.js +18 -0
  189. package/plus-C8ioZuCD.mjs +17 -0
  190. package/qr-code-CSVwaBLf.mjs +10 -0
  191. package/qr-code-YgtXPokK.js +11 -0
  192. package/react-BWxe90Ar.mjs +6342 -0
  193. package/react-BzZcQig5.js +6342 -0
  194. package/react-C_wTMVq_.js +23003 -0
  195. package/react-M-DnxvZl.mjs +23003 -0
  196. package/reactjs/components/BridgeForm/BridgeForm.js +2 -1
  197. package/reactjs/components/BridgeForm/BridgeForm.mjs +2 -1
  198. package/reactjs/components/Connect/BridgeAccountDisplay.js +3 -2
  199. package/reactjs/components/Connect/BridgeAccountDisplay.mjs +3 -2
  200. package/reactjs/components/Connect/CustomConnectButton.js +3 -2
  201. package/reactjs/components/Connect/CustomConnectButton.mjs +3 -2
  202. package/reactjs/components/Connect/SwitchChainButton.js +4 -3
  203. package/reactjs/components/Connect/SwitchChainButton.mjs +4 -3
  204. package/reactjs/components/DisplayAmount/DisplayAmount.js +1 -1
  205. package/reactjs/components/DisplayAmount/DisplayAmount.mjs +1 -1
  206. package/reactjs/components/TokenSelector/components/TokenItem.js +1 -1
  207. package/reactjs/components/TokenSelector/components/TokenItem.mjs +1 -1
  208. package/reactjs/hooks/useAccount.d.ts +4 -4
  209. package/reactjs/hooks/useAccount.js +3 -2
  210. package/reactjs/hooks/useAccount.mjs +3 -2
  211. package/reactjs/hooks/useGetChainId.js +1 -1
  212. package/reactjs/hooks/useGetChainId.mjs +1 -1
  213. package/reactjs/index.js +3 -3
  214. package/reactjs/index.mjs +3 -3
  215. package/reactjs/init/init.js +4 -3
  216. package/reactjs/init/init.mjs +4 -3
  217. package/reactjs/init/tests/init.spec.js +2 -2
  218. package/reactjs/init/tests/init.spec.mjs +2 -2
  219. package/reactjs/queries/useGetEvmTokensBalances.query.js +3 -2
  220. package/reactjs/queries/useGetEvmTokensBalances.query.mjs +3 -2
  221. package/reactjs/reexports.js +3 -3
  222. package/reactjs/reexports.mjs +3 -3
  223. package/reactjs/utils/getCleanStringAmount.js +1 -1
  224. package/reactjs/utils/getCleanStringAmount.mjs +1 -1
  225. package/reactjs/utils/hasEnoughFunds.js +1 -1
  226. package/reactjs/utils/hasEnoughFunds.mjs +1 -1
  227. package/reactjs/utils/isStringFloat.js +1 -1
  228. package/reactjs/utils/isStringFloat.mjs +1 -1
  229. package/reactjs/utils/roundAmount.js +1 -1
  230. package/reactjs/utils/roundAmount.mjs +1 -1
  231. package/receive-CK0hRQPr.js +212 -0
  232. package/receive-CQcD6bZf.mjs +212 -0
  233. package/recycle-horizontal--x5cMoTE.js +14 -0
  234. package/recycle-horizontal-QI0xtDHK.mjs +13 -0
  235. package/ref-CqxfRkBm.mjs +41 -0
  236. package/ref-FGI2cUQB.js +41 -0
  237. package/refresh-CFNHjhDi.js +13 -0
  238. package/refresh-CSOC1NUY.mjs +12 -0
  239. package/reown-logo-BfU5xFX5.js +17 -0
  240. package/reown-logo-CZAEp1jU.mjs +16 -0
  241. package/search-Do_rb-9-.mjs +12 -0
  242. package/search-V9CGMHkm.js +13 -0
  243. package/send-D-5G7tDL.mjs +1204 -0
  244. package/send-D4yYsIHV.mjs +19 -0
  245. package/send-DoiSHLsX.js +1202 -0
  246. package/send-_jfNFrys.js +20 -0
  247. package/socials-BL7-97fT.mjs +758 -0
  248. package/socials-DF0CK9cN.js +756 -0
  249. package/solana-BQ0Jh8lh.js +18 -0
  250. package/solana-YAkDp6j_.mjs +17 -0
  251. package/swapHorizontal-DOIo-Ccx.mjs +12 -0
  252. package/swapHorizontal-OHKtz4Gu.js +13 -0
  253. package/swapHorizontalBold-D7QmFj-c.js +13 -0
  254. package/swapHorizontalBold-DDroA0Af.mjs +12 -0
  255. package/swapHorizontalMedium-CU_v0kFz.mjs +20 -0
  256. package/swapHorizontalMedium-D-yMmtml.js +21 -0
  257. package/swapHorizontalRoundedBold-CHvbmnjw.js +13 -0
  258. package/swapHorizontalRoundedBold-DXMH0sgK.mjs +12 -0
  259. package/swapVertical-CH7fTK6w.js +13 -0
  260. package/swapVertical-HJZ6rFcr.mjs +12 -0
  261. package/swaps-CETflhdU.js +1952 -0
  262. package/swaps-DRUV6d3p.mjs +1954 -0
  263. package/telegram-CsCauOwj.mjs +20 -0
  264. package/telegram-DKEcF_Tq.js +21 -0
  265. package/three-dots-B-7hr8Nl.js +10 -0
  266. package/three-dots-LNZ_fjP7.mjs +9 -0
  267. package/transactions-BTTsGV2W.mjs +37 -0
  268. package/transactions-mpNNlClw.js +37 -0
  269. package/twitch-CCWVT2ij.js +23 -0
  270. package/twitch-Dg1CCQvd.mjs +22 -0
  271. package/twitterIcon-BjR09Cj9.mjs +10 -0
  272. package/twitterIcon-CeEs0iDJ.js +11 -0
  273. package/verify-B8WZq7kt.mjs +12 -0
  274. package/verify-filled-BeqC1imk.mjs +12 -0
  275. package/verify-filled-C-mv3ApD.js +13 -0
  276. package/verify-yATdPqt-.js +13 -0
  277. package/w3m-modal-3GziKj7h.js +1254 -0
  278. package/w3m-modal-81Z5PngE.mjs +1255 -0
  279. package/wallet-BMXEH23x.js +13 -0
  280. package/wallet-CNAVQCfm.mjs +12 -0
  281. package/wallet-placeholder-CQ-7CmVN.mjs +18 -0
  282. package/wallet-placeholder-CdoQy2e6.js +19 -0
  283. package/walletconnect-ACr-R1QZ.mjs +38 -0
  284. package/walletconnect-BWSkiS2F.js +39 -0
  285. package/warning-circle-CYnuYwpt.js +17 -0
  286. package/warning-circle-HV2lOiCj.mjs +16 -0
  287. package/x-CW5dozRj.js +17 -0
  288. package/x-Cgm2OFpL.mjs +16 -0
  289. package/x-mark-CR8SpZvu.js +8 -0
  290. package/x-mark-u0KJjUJ1.mjs +7 -0
  291. package/index-B4Eq5P3w.mjs +0 -91
  292. package/index-C4WV9nam.js +0 -329
  293. package/index-CWMcKi_X.js +0 -107
  294. package/index-D8E0O3qL.mjs +0 -68744
  295. package/index-DJ8CdHSw.mjs +0 -107
  296. package/index-nigVQYBu.js +0 -68665
  297. package/react-C43nEIqn.js +0 -3133
  298. package/react-DKUsVej7.js +0 -50
  299. package/react-Dp0H8q2z.mjs +0 -50
  300. package/react-wMhOUFOm.mjs +0 -3133
  301. package/w3m-modal-DLyg7Voy.js +0 -356
  302. package/w3m-modal-hC-B8qZP.mjs +0 -356
@@ -0,0 +1,756 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
+ const bitcoin = require("./bitcoin-DAvQGpeP.js");
5
+ const ifDefined = require("./if-defined-CJ5EZLw2.js");
6
+ const index$1 = require("./index-CNMDBpW7.js");
7
+ const index = require("./index-DomzHmwk.js");
8
+ const react = require("./react-BzZcQig5.js");
9
+ const react$1 = require("./react-C_wTMVq_.js");
10
+ require("./index-BBwuv2SS.js");
11
+ require("./index-Daok2ZKn.js");
12
+ require("./index-BXkamf-I.js");
13
+ require("./index-DZEwxUMS.js");
14
+ require("./index-GglJmM2C.js");
15
+ require("./index-DAtWLY21.js");
16
+ const styles$3 = bitcoin.i`
17
+ :host {
18
+ margin-top: var(--wui-spacing-3xs);
19
+ }
20
+ wui-separator {
21
+ margin: var(--wui-spacing-m) calc(var(--wui-spacing-m) * -1) var(--wui-spacing-xs)
22
+ calc(var(--wui-spacing-m) * -1);
23
+ width: calc(100% + var(--wui-spacing-s) * 2);
24
+ }
25
+ `;
26
+ var __decorate$3 = function(decorators, target, key, desc) {
27
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
28
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
29
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
30
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
31
+ };
32
+ let W3mSocialLoginList = class W3mSocialLoginList2 extends bitcoin.i$1 {
33
+ constructor() {
34
+ super();
35
+ this.unsubscribe = [];
36
+ this.tabIdx = void 0;
37
+ this.connectors = react.ConnectorController.state.connectors;
38
+ this.authConnector = this.connectors.find((c) => c.type === "AUTH");
39
+ this.remoteFeatures = react.OptionsController.state.remoteFeatures;
40
+ this.isPwaLoading = false;
41
+ this.unsubscribe.push(react.ConnectorController.subscribeKey("connectors", (val) => {
42
+ this.connectors = val;
43
+ this.authConnector = this.connectors.find((c) => c.type === "AUTH");
44
+ }), react.OptionsController.subscribeKey("remoteFeatures", (val) => this.remoteFeatures = val));
45
+ }
46
+ connectedCallback() {
47
+ super.connectedCallback();
48
+ this.handlePwaFrameLoad();
49
+ }
50
+ disconnectedCallback() {
51
+ this.unsubscribe.forEach((unsubscribe) => unsubscribe());
52
+ }
53
+ render() {
54
+ var _a;
55
+ let socials = ((_a = this.remoteFeatures) == null ? void 0 : _a.socials) || [];
56
+ const isAuthConnectorExist = Boolean(this.authConnector);
57
+ const isSocialsEnabled = socials == null ? void 0 : socials.length;
58
+ const isConnectSocialsView = react.RouterController.state.view === "ConnectSocials";
59
+ if ((!isAuthConnectorExist || !isSocialsEnabled) && !isConnectSocialsView) {
60
+ return null;
61
+ }
62
+ if (isConnectSocialsView && !isSocialsEnabled) {
63
+ socials = react.ConstantsUtil.DEFAULT_SOCIALS;
64
+ }
65
+ return bitcoin.x` <wui-flex flexDirection="column" gap="xs">
66
+ ${socials.map((social) => bitcoin.x`<wui-list-social
67
+ @click=${() => {
68
+ this.onSocialClick(social);
69
+ }}
70
+ data-testid=${`social-selector-${social}`}
71
+ name=${social}
72
+ logo=${social}
73
+ ?disabled=${this.isPwaLoading}
74
+ ></wui-list-social>`)}
75
+ </wui-flex>`;
76
+ }
77
+ async onSocialClick(socialProvider) {
78
+ if (socialProvider) {
79
+ await index.executeSocialLogin(socialProvider);
80
+ }
81
+ }
82
+ async handlePwaFrameLoad() {
83
+ var _a;
84
+ if (react.CoreHelperUtil.isPWA()) {
85
+ this.isPwaLoading = true;
86
+ try {
87
+ if (((_a = this.authConnector) == null ? void 0 : _a.provider) instanceof react$1.W3mFrameProvider) {
88
+ await this.authConnector.provider.init();
89
+ }
90
+ } catch (error) {
91
+ react.AlertController.open({
92
+ shortMessage: "Error loading embedded wallet in PWA",
93
+ longMessage: error.message
94
+ }, "error");
95
+ } finally {
96
+ this.isPwaLoading = false;
97
+ }
98
+ }
99
+ }
100
+ };
101
+ W3mSocialLoginList.styles = styles$3;
102
+ __decorate$3([
103
+ ifDefined.n()
104
+ ], W3mSocialLoginList.prototype, "tabIdx", void 0);
105
+ __decorate$3([
106
+ ifDefined.r()
107
+ ], W3mSocialLoginList.prototype, "connectors", void 0);
108
+ __decorate$3([
109
+ ifDefined.r()
110
+ ], W3mSocialLoginList.prototype, "authConnector", void 0);
111
+ __decorate$3([
112
+ ifDefined.r()
113
+ ], W3mSocialLoginList.prototype, "remoteFeatures", void 0);
114
+ __decorate$3([
115
+ ifDefined.r()
116
+ ], W3mSocialLoginList.prototype, "isPwaLoading", void 0);
117
+ W3mSocialLoginList = __decorate$3([
118
+ ifDefined.customElement("w3m-social-login-list")
119
+ ], W3mSocialLoginList);
120
+ const styles$2 = bitcoin.i`
121
+ wui-flex {
122
+ max-height: clamp(360px, 540px, 80vh);
123
+ overflow: scroll;
124
+ scrollbar-width: none;
125
+ transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md);
126
+ will-change: opacity;
127
+ }
128
+ wui-flex::-webkit-scrollbar {
129
+ display: none;
130
+ }
131
+ wui-flex.disabled {
132
+ opacity: 0.3;
133
+ pointer-events: none;
134
+ user-select: none;
135
+ }
136
+ `;
137
+ var __decorate$2 = function(decorators, target, key, desc) {
138
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
139
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
140
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
141
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
142
+ };
143
+ exports.W3mConnectSocialsView = class W3mConnectSocialsView extends bitcoin.i$1 {
144
+ constructor() {
145
+ super();
146
+ this.unsubscribe = [];
147
+ this.checked = index$1.OptionsStateController.state.isLegalCheckboxChecked;
148
+ this.unsubscribe.push(index$1.OptionsStateController.subscribeKey("isLegalCheckboxChecked", (val) => {
149
+ this.checked = val;
150
+ }));
151
+ }
152
+ disconnectedCallback() {
153
+ this.unsubscribe.forEach((unsubscribe) => unsubscribe());
154
+ }
155
+ render() {
156
+ var _a;
157
+ const { termsConditionsUrl, privacyPolicyUrl } = react.OptionsController.state;
158
+ const legalCheckbox = (_a = react.OptionsController.state.features) == null ? void 0 : _a.legalCheckbox;
159
+ const legalUrl = termsConditionsUrl || privacyPolicyUrl;
160
+ const showLegalCheckbox = Boolean(legalUrl) && Boolean(legalCheckbox);
161
+ const disabled = showLegalCheckbox && !this.checked;
162
+ const tabIndex = disabled ? -1 : void 0;
163
+ return bitcoin.x`
164
+ <w3m-legal-checkbox></w3m-legal-checkbox>
165
+ <wui-flex
166
+ flexDirection="column"
167
+ .padding=${showLegalCheckbox ? ["0", "s", "s", "s"] : "s"}
168
+ gap="xs"
169
+ class=${ifDefined.o(disabled ? "disabled" : void 0)}
170
+ >
171
+ <w3m-social-login-list tabIdx=${ifDefined.o(tabIndex)}></w3m-social-login-list>
172
+ </wui-flex>
173
+ <w3m-legal-footer></w3m-legal-footer>
174
+ `;
175
+ }
176
+ };
177
+ exports.W3mConnectSocialsView.styles = styles$2;
178
+ __decorate$2([
179
+ ifDefined.r()
180
+ ], exports.W3mConnectSocialsView.prototype, "checked", void 0);
181
+ exports.W3mConnectSocialsView = __decorate$2([
182
+ ifDefined.customElement("w3m-connect-socials-view")
183
+ ], exports.W3mConnectSocialsView);
184
+ const styles$1 = bitcoin.i`
185
+ wui-logo {
186
+ width: 80px;
187
+ height: 80px;
188
+ border-radius: var(--wui-border-radius-m);
189
+ }
190
+ @keyframes shake {
191
+ 0% {
192
+ transform: translateX(0);
193
+ }
194
+ 25% {
195
+ transform: translateX(3px);
196
+ }
197
+ 50% {
198
+ transform: translateX(-3px);
199
+ }
200
+ 75% {
201
+ transform: translateX(3px);
202
+ }
203
+ 100% {
204
+ transform: translateX(0);
205
+ }
206
+ }
207
+ wui-flex:first-child:not(:only-child) {
208
+ position: relative;
209
+ }
210
+ wui-loading-thumbnail {
211
+ position: absolute;
212
+ }
213
+ wui-icon-box {
214
+ position: absolute;
215
+ right: calc(var(--wui-spacing-3xs) * -1);
216
+ bottom: calc(var(--wui-spacing-3xs) * -1);
217
+ opacity: 0;
218
+ transform: scale(0.5);
219
+ transition: all var(--wui-ease-out-power-2) var(--wui-duration-lg);
220
+ }
221
+ wui-text[align='center'] {
222
+ width: 100%;
223
+ padding: 0px var(--wui-spacing-l);
224
+ }
225
+ [data-error='true'] wui-icon-box {
226
+ opacity: 1;
227
+ transform: scale(1);
228
+ }
229
+ [data-error='true'] > wui-flex:first-child {
230
+ animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
231
+ }
232
+ .capitalize {
233
+ text-transform: capitalize;
234
+ }
235
+ `;
236
+ var __decorate$1 = function(decorators, target, key, desc) {
237
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
238
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
239
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
240
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
241
+ };
242
+ exports.W3mConnectingSocialView = class W3mConnectingSocialView extends bitcoin.i$1 {
243
+ constructor() {
244
+ super();
245
+ this.unsubscribe = [];
246
+ this.socialProvider = react.AccountController.state.socialProvider;
247
+ this.socialWindow = react.AccountController.state.socialWindow;
248
+ this.error = false;
249
+ this.connecting = false;
250
+ this.message = "Connect in the provider window";
251
+ this.remoteFeatures = react.OptionsController.state.remoteFeatures;
252
+ this.address = react.AccountController.state.address;
253
+ this.connectionsByNamespace = react.ConnectionController.getConnections(react.ChainController.state.activeChain);
254
+ this.hasMultipleConnections = this.connectionsByNamespace.length > 0;
255
+ this.authConnector = react.ConnectorController.getAuthConnector();
256
+ this.handleSocialConnection = async (event) => {
257
+ var _a;
258
+ if ((_a = event.data) == null ? void 0 : _a.resultUri) {
259
+ if (event.origin === bitcoin.ConstantsUtil.SECURE_SITE_ORIGIN) {
260
+ window.removeEventListener("message", this.handleSocialConnection, false);
261
+ try {
262
+ if (this.authConnector && !this.connecting) {
263
+ if (this.socialWindow) {
264
+ this.socialWindow.close();
265
+ react.AccountController.setSocialWindow(void 0, react.ChainController.state.activeChain);
266
+ }
267
+ this.connecting = true;
268
+ this.updateMessage();
269
+ const uri = event.data.resultUri;
270
+ if (this.socialProvider) {
271
+ react.EventsController.sendEvent({
272
+ type: "track",
273
+ event: "SOCIAL_LOGIN_REQUEST_USER_DATA",
274
+ properties: { provider: this.socialProvider }
275
+ });
276
+ }
277
+ await react.ConnectionController.connectExternal({
278
+ id: this.authConnector.id,
279
+ type: this.authConnector.type,
280
+ socialUri: uri
281
+ }, this.authConnector.chain);
282
+ if (this.socialProvider) {
283
+ react.StorageUtil.setConnectedSocialProvider(this.socialProvider);
284
+ react.EventsController.sendEvent({
285
+ type: "track",
286
+ event: "SOCIAL_LOGIN_SUCCESS",
287
+ properties: { provider: this.socialProvider }
288
+ });
289
+ }
290
+ }
291
+ } catch (error) {
292
+ this.error = true;
293
+ this.updateMessage();
294
+ if (this.socialProvider) {
295
+ react.EventsController.sendEvent({
296
+ type: "track",
297
+ event: "SOCIAL_LOGIN_ERROR",
298
+ properties: { provider: this.socialProvider }
299
+ });
300
+ }
301
+ }
302
+ } else {
303
+ react.RouterController.goBack();
304
+ react.SnackController.showError("Untrusted Origin");
305
+ if (this.socialProvider) {
306
+ react.EventsController.sendEvent({
307
+ type: "track",
308
+ event: "SOCIAL_LOGIN_ERROR",
309
+ properties: { provider: this.socialProvider }
310
+ });
311
+ }
312
+ }
313
+ }
314
+ };
315
+ const abortController = react$1.ErrorUtil.EmbeddedWalletAbortController;
316
+ abortController.signal.addEventListener("abort", () => {
317
+ if (this.socialWindow) {
318
+ this.socialWindow.close();
319
+ react.AccountController.setSocialWindow(void 0, react.ChainController.state.activeChain);
320
+ }
321
+ });
322
+ this.unsubscribe.push(...[
323
+ react.AccountController.subscribe((val) => {
324
+ if (val.socialProvider) {
325
+ this.socialProvider = val.socialProvider;
326
+ }
327
+ if (val.socialWindow) {
328
+ this.socialWindow = val.socialWindow;
329
+ }
330
+ }),
331
+ react.OptionsController.subscribeKey("remoteFeatures", (val) => {
332
+ this.remoteFeatures = val;
333
+ }),
334
+ react.AccountController.subscribeKey("address", (val) => {
335
+ var _a;
336
+ const isMultiWalletEnabled = (_a = this.remoteFeatures) == null ? void 0 : _a.multiWallet;
337
+ if (val && val !== this.address) {
338
+ if (this.hasMultipleConnections && isMultiWalletEnabled) {
339
+ react.RouterController.replace("ProfileWallets");
340
+ react.SnackController.showSuccess("New Wallet Added");
341
+ } else if (react.ModalController.state.open || react.OptionsController.state.enableEmbedded) {
342
+ react.ModalController.close();
343
+ }
344
+ }
345
+ })
346
+ ]);
347
+ if (this.authConnector) {
348
+ this.connectSocial();
349
+ }
350
+ }
351
+ disconnectedCallback() {
352
+ var _a;
353
+ this.unsubscribe.forEach((unsubscribe) => unsubscribe());
354
+ window.removeEventListener("message", this.handleSocialConnection, false);
355
+ (_a = this.socialWindow) == null ? void 0 : _a.close();
356
+ react.AccountController.setSocialWindow(void 0, react.ChainController.state.activeChain);
357
+ }
358
+ render() {
359
+ return bitcoin.x`
360
+ <wui-flex
361
+ data-error=${ifDefined.o(this.error)}
362
+ flexDirection="column"
363
+ alignItems="center"
364
+ .padding=${["3xl", "xl", "xl", "xl"]}
365
+ gap="xl"
366
+ >
367
+ <wui-flex justifyContent="center" alignItems="center">
368
+ <wui-logo logo=${ifDefined.o(this.socialProvider)}></wui-logo>
369
+ ${this.error ? null : this.loaderTemplate()}
370
+ <wui-icon-box
371
+ backgroundColor="error-100"
372
+ background="opaque"
373
+ iconColor="error-100"
374
+ icon="close"
375
+ size="sm"
376
+ border
377
+ borderColor="wui-color-bg-125"
378
+ ></wui-icon-box>
379
+ </wui-flex>
380
+ <wui-flex flexDirection="column" alignItems="center" gap="xs">
381
+ <wui-text align="center" variant="paragraph-500" color="fg-100"
382
+ >Log in with
383
+ <span class="capitalize">${this.socialProvider ?? "Social"}</span></wui-text
384
+ >
385
+ <wui-text align="center" variant="small-400" color=${this.error ? "error-100" : "fg-200"}
386
+ >${this.message}</wui-text
387
+ ></wui-flex
388
+ >
389
+ </wui-flex>
390
+ `;
391
+ }
392
+ loaderTemplate() {
393
+ const borderRadiusMaster = react.ThemeController.state.themeVariables["--w3m-border-radius-master"];
394
+ const radius = borderRadiusMaster ? parseInt(borderRadiusMaster.replace("px", ""), 10) : 4;
395
+ return bitcoin.x`<wui-loading-thumbnail radius=${radius * 9}></wui-loading-thumbnail>`;
396
+ }
397
+ connectSocial() {
398
+ const interval = setInterval(() => {
399
+ var _a;
400
+ if ((_a = this.socialWindow) == null ? void 0 : _a.closed) {
401
+ if (!this.connecting && react.RouterController.state.view === "ConnectingSocial") {
402
+ if (this.socialProvider) {
403
+ react.EventsController.sendEvent({
404
+ type: "track",
405
+ event: "SOCIAL_LOGIN_CANCELED",
406
+ properties: { provider: this.socialProvider }
407
+ });
408
+ }
409
+ react.RouterController.goBack();
410
+ }
411
+ clearInterval(interval);
412
+ }
413
+ }, 1e3);
414
+ window.addEventListener("message", this.handleSocialConnection, false);
415
+ }
416
+ updateMessage() {
417
+ if (this.error) {
418
+ this.message = "Something went wrong";
419
+ } else if (this.connecting) {
420
+ this.message = "Retrieving user data";
421
+ } else {
422
+ this.message = "Connect in the provider window";
423
+ }
424
+ }
425
+ };
426
+ exports.W3mConnectingSocialView.styles = styles$1;
427
+ __decorate$1([
428
+ ifDefined.r()
429
+ ], exports.W3mConnectingSocialView.prototype, "socialProvider", void 0);
430
+ __decorate$1([
431
+ ifDefined.r()
432
+ ], exports.W3mConnectingSocialView.prototype, "socialWindow", void 0);
433
+ __decorate$1([
434
+ ifDefined.r()
435
+ ], exports.W3mConnectingSocialView.prototype, "error", void 0);
436
+ __decorate$1([
437
+ ifDefined.r()
438
+ ], exports.W3mConnectingSocialView.prototype, "connecting", void 0);
439
+ __decorate$1([
440
+ ifDefined.r()
441
+ ], exports.W3mConnectingSocialView.prototype, "message", void 0);
442
+ __decorate$1([
443
+ ifDefined.r()
444
+ ], exports.W3mConnectingSocialView.prototype, "remoteFeatures", void 0);
445
+ exports.W3mConnectingSocialView = __decorate$1([
446
+ ifDefined.customElement("w3m-connecting-social-view")
447
+ ], exports.W3mConnectingSocialView);
448
+ const styles = bitcoin.i`
449
+ @keyframes fadein {
450
+ from {
451
+ opacity: 0;
452
+ }
453
+ to {
454
+ opacity: 1;
455
+ }
456
+ }
457
+
458
+ wui-shimmer {
459
+ width: 100%;
460
+ aspect-ratio: 1 / 1;
461
+ border-radius: clamp(0px, var(--wui-border-radius-l), 40px) !important;
462
+ }
463
+
464
+ wui-qr-code {
465
+ opacity: 0;
466
+ animation-duration: 200ms;
467
+ animation-timing-function: ease;
468
+ animation-name: fadein;
469
+ animation-fill-mode: forwards;
470
+ }
471
+
472
+ wui-logo {
473
+ width: 80px;
474
+ height: 80px;
475
+ border-radius: var(--wui-border-radius-m);
476
+ }
477
+
478
+ wui-flex:first-child:not(:only-child) {
479
+ position: relative;
480
+ }
481
+ wui-loading-thumbnail {
482
+ position: absolute;
483
+ }
484
+ wui-icon-box {
485
+ position: absolute;
486
+ right: calc(var(--wui-spacing-3xs) * -1);
487
+ bottom: calc(var(--wui-spacing-3xs) * -1);
488
+ opacity: 0;
489
+ transform: scale(0.5);
490
+ transition: all var(--wui-ease-out-power-2) var(--wui-duration-lg);
491
+ }
492
+ `;
493
+ var __decorate = function(decorators, target, key, desc) {
494
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
495
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
496
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
497
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
498
+ };
499
+ exports.W3mConnectingFarcasterView = class W3mConnectingFarcasterView extends bitcoin.i$1 {
500
+ constructor() {
501
+ super();
502
+ this.unsubscribe = [];
503
+ this.timeout = void 0;
504
+ this.socialProvider = react.AccountController.state.socialProvider;
505
+ this.uri = react.AccountController.state.farcasterUrl;
506
+ this.ready = false;
507
+ this.loading = false;
508
+ this.remoteFeatures = react.OptionsController.state.remoteFeatures;
509
+ this.authConnector = react.ConnectorController.getAuthConnector();
510
+ this.forceUpdate = () => {
511
+ this.requestUpdate();
512
+ };
513
+ this.unsubscribe.push(...[
514
+ react.AccountController.subscribeKey("farcasterUrl", (val) => {
515
+ if (val) {
516
+ this.uri = val;
517
+ this.connectFarcaster();
518
+ }
519
+ }),
520
+ react.AccountController.subscribeKey("socialProvider", (val) => {
521
+ if (val) {
522
+ this.socialProvider = val;
523
+ }
524
+ }),
525
+ react.OptionsController.subscribeKey("remoteFeatures", (val) => {
526
+ this.remoteFeatures = val;
527
+ })
528
+ ]);
529
+ window.addEventListener("resize", this.forceUpdate);
530
+ }
531
+ disconnectedCallback() {
532
+ super.disconnectedCallback();
533
+ clearTimeout(this.timeout);
534
+ window.removeEventListener("resize", this.forceUpdate);
535
+ }
536
+ render() {
537
+ this.onRenderProxy();
538
+ return bitcoin.x`${this.platformTemplate()}`;
539
+ }
540
+ platformTemplate() {
541
+ if (react.CoreHelperUtil.isMobile()) {
542
+ return bitcoin.x`${this.mobileTemplate()}`;
543
+ }
544
+ return bitcoin.x`${this.desktopTemplate()}`;
545
+ }
546
+ desktopTemplate() {
547
+ if (this.loading) {
548
+ return bitcoin.x`${this.loadingTemplate()}`;
549
+ }
550
+ return bitcoin.x`${this.qrTemplate()}`;
551
+ }
552
+ qrTemplate() {
553
+ return bitcoin.x` <wui-flex
554
+ flexDirection="column"
555
+ alignItems="center"
556
+ .padding=${["0", "xl", "xl", "xl"]}
557
+ gap="xl"
558
+ >
559
+ <wui-shimmer borderRadius="l" width="100%"> ${this.qrCodeTemplate()} </wui-shimmer>
560
+
561
+ <wui-text variant="paragraph-500" color="fg-100">
562
+ Scan this QR Code with your phone
563
+ </wui-text>
564
+ ${this.copyTemplate()}
565
+ </wui-flex>`;
566
+ }
567
+ loadingTemplate() {
568
+ return bitcoin.x`
569
+ <wui-flex
570
+ flexDirection="column"
571
+ alignItems="center"
572
+ .padding=${["xl", "xl", "xl", "xl"]}
573
+ gap="xl"
574
+ >
575
+ <wui-flex justifyContent="center" alignItems="center">
576
+ <wui-logo logo="farcaster"></wui-logo>
577
+ ${this.loaderTemplate()}
578
+ <wui-icon-box
579
+ backgroundColor="error-100"
580
+ background="opaque"
581
+ iconColor="error-100"
582
+ icon="close"
583
+ size="sm"
584
+ border
585
+ borderColor="wui-color-bg-125"
586
+ ></wui-icon-box>
587
+ </wui-flex>
588
+ <wui-flex flexDirection="column" alignItems="center" gap="xs">
589
+ <wui-text align="center" variant="paragraph-500" color="fg-100">
590
+ Loading user data
591
+ </wui-text>
592
+ <wui-text align="center" variant="small-400" color="fg-200">
593
+ Please wait a moment while we load your data.
594
+ </wui-text>
595
+ </wui-flex>
596
+ </wui-flex>
597
+ `;
598
+ }
599
+ mobileTemplate() {
600
+ return bitcoin.x` <wui-flex
601
+ flexDirection="column"
602
+ alignItems="center"
603
+ .padding=${["3xl", "xl", "xl", "xl"]}
604
+ gap="xl"
605
+ >
606
+ <wui-flex justifyContent="center" alignItems="center">
607
+ <wui-logo logo="farcaster"></wui-logo>
608
+ ${this.loaderTemplate()}
609
+ <wui-icon-box
610
+ backgroundColor="error-100"
611
+ background="opaque"
612
+ iconColor="error-100"
613
+ icon="close"
614
+ size="sm"
615
+ border
616
+ borderColor="wui-color-bg-125"
617
+ ></wui-icon-box>
618
+ </wui-flex>
619
+ <wui-flex flexDirection="column" alignItems="center" gap="xs">
620
+ <wui-text align="center" variant="paragraph-500" color="fg-100"
621
+ >Continue in Farcaster</span></wui-text
622
+ >
623
+ <wui-text align="center" variant="small-400" color="fg-200"
624
+ >Accept connection request in the app</wui-text
625
+ ></wui-flex
626
+ >
627
+ ${this.mobileLinkTemplate()}
628
+ </wui-flex>`;
629
+ }
630
+ loaderTemplate() {
631
+ const borderRadiusMaster = react.ThemeController.state.themeVariables["--w3m-border-radius-master"];
632
+ const radius = borderRadiusMaster ? parseInt(borderRadiusMaster.replace("px", ""), 10) : 4;
633
+ return bitcoin.x`<wui-loading-thumbnail radius=${radius * 9}></wui-loading-thumbnail>`;
634
+ }
635
+ async connectFarcaster() {
636
+ var _a, _b;
637
+ if (this.authConnector) {
638
+ try {
639
+ await ((_a = this.authConnector) == null ? void 0 : _a.provider.connectFarcaster());
640
+ if (this.socialProvider) {
641
+ react.StorageUtil.setConnectedSocialProvider(this.socialProvider);
642
+ react.EventsController.sendEvent({
643
+ type: "track",
644
+ event: "SOCIAL_LOGIN_REQUEST_USER_DATA",
645
+ properties: { provider: this.socialProvider }
646
+ });
647
+ }
648
+ this.loading = true;
649
+ const connectionsByNamespace = react.ConnectionController.getConnections(this.authConnector.chain);
650
+ const hasConnections = connectionsByNamespace.length > 0;
651
+ await react.ConnectionController.connectExternal(this.authConnector, this.authConnector.chain);
652
+ const isMultiWalletEnabled = (_b = this.remoteFeatures) == null ? void 0 : _b.multiWallet;
653
+ if (this.socialProvider) {
654
+ react.EventsController.sendEvent({
655
+ type: "track",
656
+ event: "SOCIAL_LOGIN_SUCCESS",
657
+ properties: { provider: this.socialProvider }
658
+ });
659
+ }
660
+ this.loading = false;
661
+ if (hasConnections && isMultiWalletEnabled) {
662
+ react.RouterController.replace("ProfileWallets");
663
+ react.SnackController.showSuccess("New Wallet Added");
664
+ } else {
665
+ react.ModalController.close();
666
+ }
667
+ } catch (error) {
668
+ if (this.socialProvider) {
669
+ react.EventsController.sendEvent({
670
+ type: "track",
671
+ event: "SOCIAL_LOGIN_ERROR",
672
+ properties: { provider: this.socialProvider }
673
+ });
674
+ }
675
+ react.RouterController.goBack();
676
+ react.SnackController.showError(error);
677
+ }
678
+ }
679
+ }
680
+ mobileLinkTemplate() {
681
+ return bitcoin.x`<wui-button
682
+ size="md"
683
+ ?loading=${this.loading}
684
+ ?disabled=${!this.uri || this.loading}
685
+ @click=${() => {
686
+ if (this.uri) {
687
+ react.CoreHelperUtil.openHref(this.uri, "_blank");
688
+ }
689
+ }}
690
+ >
691
+ Open farcaster</wui-button
692
+ >`;
693
+ }
694
+ onRenderProxy() {
695
+ if (!this.ready && this.uri) {
696
+ this.timeout = setTimeout(() => {
697
+ this.ready = true;
698
+ }, 200);
699
+ }
700
+ }
701
+ qrCodeTemplate() {
702
+ if (!this.uri || !this.ready) {
703
+ return null;
704
+ }
705
+ const size = this.getBoundingClientRect().width - 40;
706
+ return bitcoin.x` <wui-qr-code
707
+ size=${size}
708
+ theme=${react.ThemeController.state.themeMode}
709
+ uri=${this.uri}
710
+ ?farcaster=${true}
711
+ data-testid="wui-qr-code"
712
+ color=${ifDefined.o(react.ThemeController.state.themeVariables["--w3m-qr-color"])}
713
+ ></wui-qr-code>`;
714
+ }
715
+ copyTemplate() {
716
+ const inactive = !this.uri || !this.ready;
717
+ return bitcoin.x`<wui-link
718
+ .disabled=${inactive}
719
+ @click=${this.onCopyUri}
720
+ color="fg-200"
721
+ data-testid="copy-wc2-uri"
722
+ >
723
+ <wui-icon size="xs" color="fg-200" slot="iconLeft" name="copy"></wui-icon>
724
+ Copy link
725
+ </wui-link>`;
726
+ }
727
+ onCopyUri() {
728
+ try {
729
+ if (this.uri) {
730
+ react.CoreHelperUtil.copyToClopboard(this.uri);
731
+ react.SnackController.showSuccess("Link copied");
732
+ }
733
+ } catch {
734
+ react.SnackController.showError("Failed to copy");
735
+ }
736
+ }
737
+ };
738
+ exports.W3mConnectingFarcasterView.styles = styles;
739
+ __decorate([
740
+ ifDefined.r()
741
+ ], exports.W3mConnectingFarcasterView.prototype, "socialProvider", void 0);
742
+ __decorate([
743
+ ifDefined.r()
744
+ ], exports.W3mConnectingFarcasterView.prototype, "uri", void 0);
745
+ __decorate([
746
+ ifDefined.r()
747
+ ], exports.W3mConnectingFarcasterView.prototype, "ready", void 0);
748
+ __decorate([
749
+ ifDefined.r()
750
+ ], exports.W3mConnectingFarcasterView.prototype, "loading", void 0);
751
+ __decorate([
752
+ ifDefined.r()
753
+ ], exports.W3mConnectingFarcasterView.prototype, "remoteFeatures", void 0);
754
+ exports.W3mConnectingFarcasterView = __decorate([
755
+ ifDefined.customElement("w3m-connecting-farcaster-view")
756
+ ], exports.W3mConnectingFarcasterView);