@directcryptopay/sdk 0.2.2 → 0.2.3

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 (228) hide show
  1. package/dist/ExchangeController-CPMQq6Q-.js +217 -0
  2. package/dist/HelpersUtil-DfMFC7Bf.js +120 -0
  3. package/dist/NavigationUtil-kj9LEOOd.js +8 -0
  4. package/dist/PhArrowCircleDown-lsK25DCk.js +73 -0
  5. package/dist/PhArrowClockwise-NeKHZ1co.js +73 -0
  6. package/dist/PhArrowDown-C9AkNvLs.js +73 -0
  7. package/dist/PhArrowLeft-RNfIQP1X.js +73 -0
  8. package/dist/PhArrowRight-DM1tna0G.js +73 -0
  9. package/dist/PhArrowSquareOut-S5XYbAZj.js +73 -0
  10. package/dist/PhArrowUp-DmktzOWy.js +73 -0
  11. package/dist/PhArrowUpRight-BkNeW_5i.js +73 -0
  12. package/dist/PhArrowsClockwise-CQ4pG76b.js +73 -0
  13. package/dist/PhArrowsDownUp-H6gxaNM6.js +73 -0
  14. package/dist/PhArrowsLeftRight-DZSsfMR6.js +73 -0
  15. package/dist/PhBank-4_9QzqIB.js +73 -0
  16. package/dist/PhBrowser-B-JSznId.js +73 -0
  17. package/dist/PhCaretDown-vV5oHMNi.js +73 -0
  18. package/dist/PhCaretLeft-BLo6Y_f4.js +73 -0
  19. package/dist/PhCaretRight-CqQN4TT3.js +73 -0
  20. package/dist/PhCaretUp-Df7UCAHy.js +73 -0
  21. package/dist/PhCheck-gtpfK4ed.js +73 -0
  22. package/dist/PhCircleHalf-Uq7dwDYw.js +73 -0
  23. package/dist/PhClock-SDCW-NmF.js +73 -0
  24. package/dist/PhCompass-B7hgtdx-.js +73 -0
  25. package/dist/PhCopy-BcnhyXCy.js +73 -0
  26. package/dist/PhCreditCard-BJjByVgu.js +73 -0
  27. package/dist/PhCurrencyDollar-B7ZXqXBy.js +73 -0
  28. package/dist/PhDesktop-B3VKPuJx.js +73 -0
  29. package/dist/PhDeviceMobile-Bnd0TYEH.js +73 -0
  30. package/dist/PhDotsThree-yyMWyZ-R.js +73 -0
  31. package/dist/PhEnvelope-67uzHbI9.js +73 -0
  32. package/dist/PhFunnelSimple-B-DCsloI.js +73 -0
  33. package/dist/PhGlobe-TMm_6qGk.js +73 -0
  34. package/dist/PhIdentificationCard-CePPD2xc.js +73 -0
  35. package/dist/PhImage-gY96WtHR.js +73 -0
  36. package/dist/PhInfo-DRQM_ZDP.js +73 -0
  37. package/dist/PhLightbulb-B0TxPfZ1.js +73 -0
  38. package/dist/PhMagnifyingGlass-B8si5_6W.js +73 -0
  39. package/dist/PhPaperPlaneRight-DVu5PLYd.js +73 -0
  40. package/dist/PhPlus-BfTsQnUz.js +73 -0
  41. package/dist/PhPower-CxYUGOWn.js +73 -0
  42. package/dist/PhPuzzlePiece-CQ4wh0gV.js +73 -0
  43. package/dist/PhQrCode-BuJ97NYJ.js +73 -0
  44. package/dist/PhQuestion-kJoP8Mja.js +73 -0
  45. package/dist/PhQuestionMark-C46ZkFpu.js +73 -0
  46. package/dist/PhSealCheck-Eh8jVqSN.js +73 -0
  47. package/dist/PhSignOut-jk97OSVt.js +73 -0
  48. package/dist/PhSpinner-CiYOhwMg.js +73 -0
  49. package/dist/PhTrash-pxerMqzd.js +73 -0
  50. package/dist/PhUser-BMg0VV4A.js +73 -0
  51. package/dist/PhVault-DYQvx5A-.js +73 -0
  52. package/dist/PhWarning-NLC5Mj87.js +73 -0
  53. package/dist/PhWarningCircle-Ch2jU9fA.js +73 -0
  54. package/dist/PhX-Bx4wpwm3.js +73 -0
  55. package/dist/SwapController-Cti0Cyxa.js +457 -0
  56. package/dist/{ccip-BIGqktC1.js → ccip-CKZd2XJ7.js} +4 -4
  57. package/dist/data-capture-7D5CL385.js +490 -0
  58. package/dist/dcp-sdk.umd.js +7400 -6589
  59. package/dist/email-AmK0INbZ.js +344 -0
  60. package/dist/embedded-wallet-Pn0I_XLn.js +820 -0
  61. package/dist/features-x8XNprEe.js +274 -0
  62. package/dist/{hashTypedData-ZH9ZnWu3.js → hashTypedData-B50-z0AA.js} +6 -6
  63. package/dist/if-defined-CdZSZ6UL.js +10 -0
  64. package/dist/index-4ewUtPPp.js +7981 -0
  65. package/dist/{index-D6h-qfpt.js → index-51l86yqx.js} +5 -5
  66. package/dist/index-B6K56LF_.js +85 -0
  67. package/dist/index-BAmv9PxJ.js +257 -0
  68. package/dist/index-BEswjY9r.js +117 -0
  69. package/dist/index-BSKRq56S.js +355 -0
  70. package/dist/index-BaygXQxx.js +172 -0
  71. package/dist/index-BcPxaHr5.js +118 -0
  72. package/dist/index-Bjt7nGaJ.js +199 -0
  73. package/dist/{index-D5r0iSq4.js → index-BkTSyAJb.js} +1 -1
  74. package/dist/index-Bmnl7l2U.js +555 -0
  75. package/dist/index-BvPvouSq.js +56 -0
  76. package/dist/index-C-6iznUO.js +174 -0
  77. package/dist/index-C4M5s_AM.js +228 -0
  78. package/dist/index-CEqcN8QP.js +1175 -0
  79. package/dist/{index-CPTcEPbD.js → index-CM3YaYca.js} +296 -298
  80. package/dist/{index-f3LXSfM5.js → index-CclBLA5r.js} +56 -142
  81. package/dist/index-ChTxJOiF.js +46 -0
  82. package/dist/index-CmAv0Tzr.js +86 -0
  83. package/dist/index-CmvoKY4x.js +125 -0
  84. package/dist/{index-BdSIrl-R.js → index-D7PmdQ9B.js} +578 -570
  85. package/dist/{index-DobBVPe4.js → index-D7k2Pc4e.js} +481 -236
  86. package/dist/index-D7lmgqUR.js +153 -0
  87. package/dist/index-DG_-qYze.js +107 -0
  88. package/dist/{index-Dy4NyE6l.js → index-DHot9Fdb.js} +7 -7
  89. package/dist/index-DV2LrPtU.js +123 -0
  90. package/dist/index-DYBaJQ2W.js +65 -0
  91. package/dist/{index-BJ7cbG3N.js → index-D_8VUmn1.js} +36688 -40208
  92. package/dist/index-D_gLn3rT.js +100 -0
  93. package/dist/index-DqcVUSC9.js +62 -0
  94. package/dist/index-I7VDqINw.js +128 -0
  95. package/dist/index-Oz72I9VP.js +209 -0
  96. package/dist/index-UclsHkJ0.js +118 -0
  97. package/dist/index-X8zir_1j.js +110 -0
  98. package/dist/index-XvlWKGCu.js +1281 -0
  99. package/dist/index-dO97xPlt.js +171 -0
  100. package/dist/{index-5mp7WkhV.js → index-uBeF6OAB.js} +2 -2
  101. package/dist/index-zeA_RiCV.js +159 -0
  102. package/dist/index.js +1 -1
  103. package/dist/{localBatchGatewayRequest-CjGcn5nM.js → localBatchGatewayRequest-BUZHGdjw.js} +1 -1
  104. package/dist/onramp-CdnBuF0r.js +855 -0
  105. package/dist/{parseSignature-S8VEpRHC.js → parseSignature-CcyTNGr4.js} +2312 -2313
  106. package/dist/pay-with-exchange-CSM6WCOV.js +525 -0
  107. package/dist/property-Bd8U3_QP.js +618 -0
  108. package/dist/receive-DooMu4Dx.js +232 -0
  109. package/dist/ref-CpgjXAw7.js +107 -0
  110. package/dist/send-3T7CyYic.js +1166 -0
  111. package/dist/socials-Dt-iHL17.js +620 -0
  112. package/dist/swaps-CjA9Es42.js +1760 -0
  113. package/dist/{transactions-DujFkB-M.js → transactions-nRm9DVzn.js} +10 -10
  114. package/dist/w3m-modal-NV25AXhM.js +1706 -0
  115. package/package.json +3 -3
  116. package/dist/ConstantsUtil-B-_-u8aQ.js +0 -6
  117. package/dist/add-sji6scSD.js +0 -19
  118. package/dist/all-wallets-B4H-890E.js +0 -10
  119. package/dist/app-store-Z433s97G.js +0 -21
  120. package/dist/apple-b8Lxj7nb.js +0 -22
  121. package/dist/arrow-bottom-M9oWWo_9.js +0 -12
  122. package/dist/arrow-bottom-circle-N9c4CXY1.js +0 -15
  123. package/dist/arrow-left-Dw8AKfwf.js +0 -12
  124. package/dist/arrow-right-DwLQZSC_.js +0 -12
  125. package/dist/arrow-top-zhUjkBe1.js +0 -12
  126. package/dist/bank-CbQdnILK.js +0 -18
  127. package/dist/browser-xAqNwt7z.js +0 -18
  128. package/dist/card-Dr1QBmWp.js +0 -18
  129. package/dist/checkmark-BhT1dTgG.js +0 -15
  130. package/dist/checkmark-bold-CPB29wqQ.js +0 -12
  131. package/dist/chevron-bottom-BhNyx2II.js +0 -12
  132. package/dist/chevron-left-CGuEjQlY.js +0 -12
  133. package/dist/chevron-right-CvIRRsqZ.js +0 -12
  134. package/dist/chevron-top-RSzCqjBd.js +0 -12
  135. package/dist/chrome-store-Cs8dAgs0.js +0 -65
  136. package/dist/clock-fhZO5otC.js +0 -12
  137. package/dist/close-BPuztrdR.js +0 -12
  138. package/dist/coinPlaceholder-C8X2i7Kh.js +0 -12
  139. package/dist/compass-WMc5huk0.js +0 -12
  140. package/dist/copy-DVAeT17y.js +0 -19
  141. package/dist/cursor-BJ4YLXfy.js +0 -7
  142. package/dist/cursor-transparent-DN2fLQN4.js +0 -16
  143. package/dist/desktop-6avxisBw.js +0 -13
  144. package/dist/disconnect-AReVI8Gk.js +0 -12
  145. package/dist/discord-CxrI30BZ.js +0 -21
  146. package/dist/email-B8dIIaay.js +0 -696
  147. package/dist/embedded-wallet-C_5hF7rM.js +0 -468
  148. package/dist/etherscan-BnAy8cIF.js +0 -10
  149. package/dist/exclamation-triangle-Bu7nHwx9.js +0 -8
  150. package/dist/extension-F0LIhvcf.js +0 -12
  151. package/dist/external-link-CP6phyaM.js +0 -12
  152. package/dist/facebook-BtQ-Io2y.js +0 -30
  153. package/dist/farcaster-BmaN1ugd.js +0 -16
  154. package/dist/filters-DpEwoOmy.js +0 -12
  155. package/dist/github-q7qO9V-b.js +0 -22
  156. package/dist/google-DH_ZE8bW.js +0 -22
  157. package/dist/help-circle-BAQVmKas.js +0 -16
  158. package/dist/id-Cj68Zwgo.js +0 -16
  159. package/dist/if-defined-CNte9B3N.js +0 -744
  160. package/dist/image-BKJDw6N-.js +0 -8
  161. package/dist/index-7toZMdtG.js +0 -573
  162. package/dist/index-B1uKzdvN.js +0 -170
  163. package/dist/index-BHFZVF-b.js +0 -257
  164. package/dist/index-BKwa5JSA.js +0 -559
  165. package/dist/index-BP4B9VUt.js +0 -54
  166. package/dist/index-BVdzXHpO.js +0 -181
  167. package/dist/index-BYND0GJ9.js +0 -146
  168. package/dist/index-BaJ0zEbh.js +0 -97
  169. package/dist/index-Bh0MPFwP.js +0 -58
  170. package/dist/index-Bsh7_qTp.js +0 -511
  171. package/dist/index-BwnXTNNg.js +0 -199
  172. package/dist/index-C0kPDbg_.js +0 -77
  173. package/dist/index-CKikVKe2.js +0 -75
  174. package/dist/index-ChVh0Hkp.js +0 -243
  175. package/dist/index-Cle_NnnS.js +0 -305
  176. package/dist/index-CmWdvIFT.js +0 -51
  177. package/dist/index-D2AMA8Bu.js +0 -65
  178. package/dist/index-DAUM8CO4.js +0 -65
  179. package/dist/index-DGjZW6uR.js +0 -78
  180. package/dist/index-DQe94z7X.js +0 -265
  181. package/dist/index-DTo6w99t.js +0 -7864
  182. package/dist/index-DYdXjap2.js +0 -320
  183. package/dist/index-DceCxNV5.js +0 -181
  184. package/dist/index-Uw9cSw0q.js +0 -294
  185. package/dist/index-qiuyrukh.js +0 -45
  186. package/dist/index-zddvaohA.js +0 -78
  187. package/dist/info-RfPsmroW.js +0 -7
  188. package/dist/info-circle-DFKHB_ZN.js +0 -16
  189. package/dist/lightbulb-B-Bykj9X.js +0 -7
  190. package/dist/mail-mBAgGuw5.js +0 -12
  191. package/dist/mobile-Dhh3ndkf.js +0 -13
  192. package/dist/more-D1h7UTvg.js +0 -15
  193. package/dist/network-placeholder-Dqynvc-t.js +0 -18
  194. package/dist/nftPlaceholder-Df7MW4MM.js +0 -12
  195. package/dist/off-BmG3cHTX.js +0 -12
  196. package/dist/onramp-C401Aenb.js +0 -1279
  197. package/dist/play-store-4q1fzL_P.js +0 -36
  198. package/dist/plus-603Gs3yG.js +0 -17
  199. package/dist/qr-code-Dgwhf6M1.js +0 -10
  200. package/dist/receive-CYXbbEUR.js +0 -186
  201. package/dist/recycle-horizontal-Bu8zZ563.js +0 -13
  202. package/dist/ref-DpmKRWBK.js +0 -41
  203. package/dist/refresh-BMZFu0mu.js +0 -12
  204. package/dist/reown-logo-BXph7ThY.js +0 -16
  205. package/dist/search-Cm_V42Y_.js +0 -12
  206. package/dist/secp256k1-C0iX1TUr.js +0 -1510
  207. package/dist/secp256k1-DOQBqE4Z.js +0 -1302
  208. package/dist/send-BSMYxDuP.js +0 -19
  209. package/dist/send-C8EeIzRB.js +0 -1038
  210. package/dist/socials-DQrHQajs.js +0 -574
  211. package/dist/swapHorizontal-98rnJewS.js +0 -12
  212. package/dist/swapHorizontalBold-C299FjEt.js +0 -12
  213. package/dist/swapHorizontalMedium-Cqm6i4WJ.js +0 -20
  214. package/dist/swapHorizontalRoundedBold-De7hFfqZ.js +0 -12
  215. package/dist/swapVertical-DSL75l8L.js +0 -12
  216. package/dist/swaps-BuTNp65Y.js +0 -1637
  217. package/dist/telegram-cJP7hgUb.js +0 -20
  218. package/dist/three-dots-DHnEh28O.js +0 -9
  219. package/dist/twitch-CR2iGcBo.js +0 -22
  220. package/dist/twitterIcon-E5TAQjOn.js +0 -10
  221. package/dist/verify-DEukUJp0.js +0 -12
  222. package/dist/verify-filled-BXsx1i_p.js +0 -12
  223. package/dist/w3m-modal-Bm7BqVng.js +0 -1037
  224. package/dist/wallet-CzyyvdrT.js +0 -12
  225. package/dist/wallet-placeholder-BrcmyGEe.js +0 -18
  226. package/dist/walletconnect-BSYogWiE.js +0 -36
  227. package/dist/warning-circle-Cgp2BW3m.js +0 -16
  228. package/dist/x-BJinLpTw.js +0 -16
@@ -1,1037 +0,0 @@
1
- import { cS as w, dP as Z, cJ as c, cE as v, cH as L, cF as y, cG as l, d9 as P, cI as se, cL as re, cY as p, c_ as j, dQ as ce, cK as U, d8 as G, di as N, dc as H, cX as q, cZ as $, dR as R, c$ as le, dS as de, d1 as ue, dd as pe } from "./index-BJ7cbG3N.js";
2
- import { c as f, n as u, r as d, o as z, U as he } from "./if-defined-CNte9B3N.js";
3
- import "./index-D2AMA8Bu.js";
4
- import "./index-CmWdvIFT.js";
5
- import "./index-CKikVKe2.js";
6
- import "./index-DGjZW6uR.js";
7
- import "./index-BaJ0zEbh.js";
8
- import "./index-BYND0GJ9.js";
9
- import "./index-ChVh0Hkp.js";
10
- const ee = {
11
- isUnsupportedChainView() {
12
- return c.state.view === "UnsupportedChain" || c.state.view === "SwitchNetwork" && c.state.history.includes("UnsupportedChain");
13
- },
14
- async safeClose() {
15
- if (this.isUnsupportedChainView()) {
16
- w.shake();
17
- return;
18
- }
19
- if (await Z.isSIWXCloseDisabled()) {
20
- w.shake();
21
- return;
22
- }
23
- w.close();
24
- }
25
- }, we = v`
26
- :host {
27
- display: block;
28
- border-radius: clamp(0px, var(--wui-border-radius-l), 44px);
29
- box-shadow: 0 0 0 1px var(--wui-color-gray-glass-005);
30
- background-color: var(--wui-color-modal-bg);
31
- overflow: hidden;
32
- }
33
-
34
- :host([data-embedded='true']) {
35
- box-shadow:
36
- 0 0 0 1px var(--wui-color-gray-glass-005),
37
- 0px 4px 12px 4px var(--w3m-card-embedded-shadow-color);
38
- }
39
- `;
40
- var me = function(s, e, t, i) {
41
- var a = arguments.length, o = a < 3 ? e : i === null ? i = Object.getOwnPropertyDescriptor(e, t) : i, n;
42
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o = Reflect.decorate(s, e, t, i);
43
- else for (var r = s.length - 1; r >= 0; r--) (n = s[r]) && (o = (a < 3 ? n(o) : a > 3 ? n(e, t, o) : n(e, t)) || o);
44
- return a > 3 && o && Object.defineProperty(e, t, o), o;
45
- };
46
- let M = class extends y {
47
- render() {
48
- return l`<slot></slot>`;
49
- }
50
- };
51
- M.styles = [L, we];
52
- M = me([
53
- f("wui-card")
54
- ], M);
55
- const fe = v`
56
- :host {
57
- display: flex;
58
- align-items: center;
59
- justify-content: center;
60
- padding: var(--wui-spacing-s);
61
- border-radius: var(--wui-border-radius-s);
62
- border: 1px solid var(--wui-color-dark-glass-100);
63
- box-sizing: border-box;
64
- background-color: var(--wui-color-bg-325);
65
- box-shadow: 0px 0px 16px 0px rgba(0, 0, 0, 0.25);
66
- }
67
-
68
- wui-flex {
69
- width: 100%;
70
- }
71
-
72
- wui-text {
73
- word-break: break-word;
74
- flex: 1;
75
- }
76
-
77
- .close {
78
- cursor: pointer;
79
- }
80
-
81
- .icon-box {
82
- height: 40px;
83
- width: 40px;
84
- border-radius: var(--wui-border-radius-3xs);
85
- background-color: var(--local-icon-bg-value);
86
- }
87
- `;
88
- var W = function(s, e, t, i) {
89
- var a = arguments.length, o = a < 3 ? e : i === null ? i = Object.getOwnPropertyDescriptor(e, t) : i, n;
90
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o = Reflect.decorate(s, e, t, i);
91
- else for (var r = s.length - 1; r >= 0; r--) (n = s[r]) && (o = (a < 3 ? n(o) : a > 3 ? n(e, t, o) : n(e, t)) || o);
92
- return a > 3 && o && Object.defineProperty(e, t, o), o;
93
- };
94
- let k = class extends y {
95
- constructor() {
96
- super(...arguments), this.message = "", this.backgroundColor = "accent-100", this.iconColor = "accent-100", this.icon = "info";
97
- }
98
- render() {
99
- return this.style.cssText = `
100
- --local-icon-bg-value: var(--wui-color-${this.backgroundColor});
101
- `, l`
102
- <wui-flex flexDirection="row" justifyContent="space-between" alignItems="center">
103
- <wui-flex columnGap="xs" flexDirection="row" alignItems="center">
104
- <wui-flex
105
- flexDirection="row"
106
- alignItems="center"
107
- justifyContent="center"
108
- class="icon-box"
109
- >
110
- <wui-icon color=${this.iconColor} size="md" name=${this.icon}></wui-icon>
111
- </wui-flex>
112
- <wui-text variant="small-500" color="bg-350" data-testid="wui-alertbar-text"
113
- >${this.message}</wui-text
114
- >
115
- </wui-flex>
116
- <wui-icon
117
- class="close"
118
- color="bg-350"
119
- size="sm"
120
- name="close"
121
- @click=${this.onClose}
122
- ></wui-icon>
123
- </wui-flex>
124
- `;
125
- }
126
- onClose() {
127
- P.close();
128
- }
129
- };
130
- k.styles = [L, fe];
131
- W([
132
- u()
133
- ], k.prototype, "message", void 0);
134
- W([
135
- u()
136
- ], k.prototype, "backgroundColor", void 0);
137
- W([
138
- u()
139
- ], k.prototype, "iconColor", void 0);
140
- W([
141
- u()
142
- ], k.prototype, "icon", void 0);
143
- k = W([
144
- f("wui-alertbar")
145
- ], k);
146
- const ge = v`
147
- :host {
148
- display: block;
149
- position: absolute;
150
- top: var(--wui-spacing-s);
151
- left: var(--wui-spacing-l);
152
- right: var(--wui-spacing-l);
153
- opacity: 0;
154
- pointer-events: none;
155
- }
156
- `;
157
- var te = function(s, e, t, i) {
158
- var a = arguments.length, o = a < 3 ? e : i === null ? i = Object.getOwnPropertyDescriptor(e, t) : i, n;
159
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o = Reflect.decorate(s, e, t, i);
160
- else for (var r = s.length - 1; r >= 0; r--) (n = s[r]) && (o = (a < 3 ? n(o) : a > 3 ? n(e, t, o) : n(e, t)) || o);
161
- return a > 3 && o && Object.defineProperty(e, t, o), o;
162
- };
163
- const be = {
164
- info: {
165
- backgroundColor: "fg-350",
166
- iconColor: "fg-325",
167
- icon: "info"
168
- },
169
- success: {
170
- backgroundColor: "success-glass-reown-020",
171
- iconColor: "success-125",
172
- icon: "checkmark"
173
- },
174
- warning: {
175
- backgroundColor: "warning-glass-reown-020",
176
- iconColor: "warning-100",
177
- icon: "warningCircle"
178
- },
179
- error: {
180
- backgroundColor: "error-glass-reown-020",
181
- iconColor: "error-125",
182
- icon: "exclamationTriangle"
183
- }
184
- };
185
- let _ = class extends y {
186
- constructor() {
187
- super(), this.unsubscribe = [], this.open = P.state.open, this.onOpen(!0), this.unsubscribe.push(P.subscribeKey("open", (e) => {
188
- this.open = e, this.onOpen(!1);
189
- }));
190
- }
191
- disconnectedCallback() {
192
- this.unsubscribe.forEach((e) => e());
193
- }
194
- render() {
195
- const { message: e, variant: t } = P.state, i = be[t];
196
- return l`
197
- <wui-alertbar
198
- message=${e}
199
- backgroundColor=${i == null ? void 0 : i.backgroundColor}
200
- iconColor=${i == null ? void 0 : i.iconColor}
201
- icon=${i == null ? void 0 : i.icon}
202
- ></wui-alertbar>
203
- `;
204
- }
205
- onOpen(e) {
206
- this.open ? (this.animate([
207
- { opacity: 0, transform: "scale(0.85)" },
208
- { opacity: 1, transform: "scale(1)" }
209
- ], {
210
- duration: 150,
211
- fill: "forwards",
212
- easing: "ease"
213
- }), this.style.cssText = "pointer-events: auto") : e || (this.animate([
214
- { opacity: 1, transform: "scale(1)" },
215
- { opacity: 0, transform: "scale(0.85)" }
216
- ], {
217
- duration: 150,
218
- fill: "forwards",
219
- easing: "ease"
220
- }), this.style.cssText = "pointer-events: none");
221
- }
222
- };
223
- _.styles = ge;
224
- te([
225
- d()
226
- ], _.prototype, "open", void 0);
227
- _ = te([
228
- f("w3m-alertbar")
229
- ], _);
230
- const ve = v`
231
- button {
232
- display: block;
233
- display: flex;
234
- align-items: center;
235
- padding: var(--wui-spacing-xxs);
236
- gap: var(--wui-spacing-xxs);
237
- transition: all var(--wui-ease-out-power-1) var(--wui-duration-md);
238
- border-radius: var(--wui-border-radius-xxs);
239
- }
240
-
241
- wui-image {
242
- border-radius: 100%;
243
- width: var(--wui-spacing-xl);
244
- height: var(--wui-spacing-xl);
245
- }
246
-
247
- wui-icon-box {
248
- width: var(--wui-spacing-xl);
249
- height: var(--wui-spacing-xl);
250
- }
251
-
252
- button:hover {
253
- background-color: var(--wui-color-gray-glass-002);
254
- }
255
-
256
- button:active {
257
- background-color: var(--wui-color-gray-glass-005);
258
- }
259
- `;
260
- var oe = function(s, e, t, i) {
261
- var a = arguments.length, o = a < 3 ? e : i === null ? i = Object.getOwnPropertyDescriptor(e, t) : i, n;
262
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o = Reflect.decorate(s, e, t, i);
263
- else for (var r = s.length - 1; r >= 0; r--) (n = s[r]) && (o = (a < 3 ? n(o) : a > 3 ? n(e, t, o) : n(e, t)) || o);
264
- return a > 3 && o && Object.defineProperty(e, t, o), o;
265
- };
266
- let B = class extends y {
267
- constructor() {
268
- super(...arguments), this.imageSrc = "";
269
- }
270
- render() {
271
- return l`<button>
272
- ${this.imageTemplate()}
273
- <wui-icon size="xs" color="fg-200" name="chevronBottom"></wui-icon>
274
- </button>`;
275
- }
276
- imageTemplate() {
277
- return this.imageSrc ? l`<wui-image src=${this.imageSrc} alt="select visual"></wui-image>` : l`<wui-icon-box
278
- size="xxs"
279
- iconColor="fg-200"
280
- backgroundColor="fg-100"
281
- background="opaque"
282
- icon="networkPlaceholder"
283
- ></wui-icon-box>`;
284
- }
285
- };
286
- B.styles = [L, se, re, ve];
287
- oe([
288
- u()
289
- ], B.prototype, "imageSrc", void 0);
290
- B = oe([
291
- f("wui-select")
292
- ], B);
293
- const ye = v`
294
- :host {
295
- height: 64px;
296
- }
297
-
298
- wui-text {
299
- text-transform: capitalize;
300
- }
301
-
302
- wui-flex.w3m-header-title {
303
- transform: translateY(0);
304
- opacity: 1;
305
- }
306
-
307
- wui-flex.w3m-header-title[view-direction='prev'] {
308
- animation:
309
- slide-down-out 120ms forwards var(--wui-ease-out-power-2),
310
- slide-down-in 120ms forwards var(--wui-ease-out-power-2);
311
- animation-delay: 0ms, 200ms;
312
- }
313
-
314
- wui-flex.w3m-header-title[view-direction='next'] {
315
- animation:
316
- slide-up-out 120ms forwards var(--wui-ease-out-power-2),
317
- slide-up-in 120ms forwards var(--wui-ease-out-power-2);
318
- animation-delay: 0ms, 200ms;
319
- }
320
-
321
- wui-icon-link[data-hidden='true'] {
322
- opacity: 0 !important;
323
- pointer-events: none;
324
- }
325
-
326
- @keyframes slide-up-out {
327
- from {
328
- transform: translateY(0px);
329
- opacity: 1;
330
- }
331
- to {
332
- transform: translateY(3px);
333
- opacity: 0;
334
- }
335
- }
336
-
337
- @keyframes slide-up-in {
338
- from {
339
- transform: translateY(-3px);
340
- opacity: 0;
341
- }
342
- to {
343
- transform: translateY(0);
344
- opacity: 1;
345
- }
346
- }
347
-
348
- @keyframes slide-down-out {
349
- from {
350
- transform: translateY(0px);
351
- opacity: 1;
352
- }
353
- to {
354
- transform: translateY(-3px);
355
- opacity: 0;
356
- }
357
- }
358
-
359
- @keyframes slide-down-in {
360
- from {
361
- transform: translateY(3px);
362
- opacity: 0;
363
- }
364
- to {
365
- transform: translateY(0);
366
- opacity: 1;
367
- }
368
- }
369
- `;
370
- var g = function(s, e, t, i) {
371
- var a = arguments.length, o = a < 3 ? e : i === null ? i = Object.getOwnPropertyDescriptor(e, t) : i, n;
372
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o = Reflect.decorate(s, e, t, i);
373
- else for (var r = s.length - 1; r >= 0; r--) (n = s[r]) && (o = (a < 3 ? n(o) : a > 3 ? n(e, t, o) : n(e, t)) || o);
374
- return a > 3 && o && Object.defineProperty(e, t, o), o;
375
- };
376
- const Ce = ["SmartSessionList"];
377
- function K() {
378
- var n, r, A, x, T, E, I;
379
- const s = (r = (n = c.state.data) == null ? void 0 : n.connector) == null ? void 0 : r.name, e = (x = (A = c.state.data) == null ? void 0 : A.wallet) == null ? void 0 : x.name, t = (E = (T = c.state.data) == null ? void 0 : T.network) == null ? void 0 : E.name, i = e ?? s, a = H.getConnectors();
380
- return {
381
- Connect: `Connect ${a.length === 1 && ((I = a[0]) == null ? void 0 : I.id) === "w3m-email" ? "Email" : ""} Wallet`,
382
- Create: "Create Wallet",
383
- ChooseAccountName: void 0,
384
- Account: void 0,
385
- AccountSettings: void 0,
386
- AllWallets: "All Wallets",
387
- ApproveTransaction: "Approve Transaction",
388
- BuyInProgress: "Buy",
389
- ConnectingExternal: i ?? "Connect Wallet",
390
- ConnectingWalletConnect: i ?? "WalletConnect",
391
- ConnectingWalletConnectBasic: "WalletConnect",
392
- ConnectingSiwe: "Sign In",
393
- Convert: "Convert",
394
- ConvertSelectToken: "Select token",
395
- ConvertPreview: "Preview convert",
396
- Downloads: i ? `Get ${i}` : "Downloads",
397
- EmailLogin: "Email Login",
398
- EmailVerifyOtp: "Confirm Email",
399
- EmailVerifyDevice: "Register Device",
400
- GetWallet: "Get a wallet",
401
- Networks: "Choose Network",
402
- OnRampProviders: "Choose Provider",
403
- OnRampActivity: "Activity",
404
- OnRampTokenSelect: "Select Token",
405
- OnRampFiatSelect: "Select Currency",
406
- Pay: "How you pay",
407
- Profile: void 0,
408
- SwitchNetwork: t ?? "Switch Network",
409
- SwitchAddress: "Switch Address",
410
- Transactions: "Activity",
411
- UnsupportedChain: "Switch Network",
412
- UpgradeEmailWallet: "Upgrade your Wallet",
413
- UpdateEmailWallet: "Edit Email",
414
- UpdateEmailPrimaryOtp: "Confirm Current Email",
415
- UpdateEmailSecondaryOtp: "Confirm New Email",
416
- WhatIsABuy: "What is Buy?",
417
- RegisterAccountName: "Choose name",
418
- RegisterAccountNameSuccess: "",
419
- WalletReceive: "Receive",
420
- WalletCompatibleNetworks: "Compatible Networks",
421
- Swap: "Swap",
422
- SwapSelectToken: "Select token",
423
- SwapPreview: "Preview swap",
424
- WalletSend: "Send",
425
- WalletSendPreview: "Review send",
426
- WalletSendSelectToken: "Select Token",
427
- WhatIsANetwork: "What is a network?",
428
- WhatIsAWallet: "What is a wallet?",
429
- ConnectWallets: "Connect wallet",
430
- ConnectSocials: "All socials",
431
- ConnectingSocial: q.state.socialProvider ? q.state.socialProvider : "Connect Social",
432
- ConnectingMultiChain: "Select chain",
433
- ConnectingFarcaster: "Farcaster",
434
- SwitchActiveChain: "Switch chain",
435
- SmartSessionCreated: void 0,
436
- SmartSessionList: "Smart Sessions",
437
- SIWXSignMessage: "Sign In",
438
- PayLoading: "Payment in progress"
439
- };
440
- }
441
- let h = class extends y {
442
- constructor() {
443
- super(), this.unsubscribe = [], this.heading = K()[c.state.view], this.network = p.state.activeCaipNetwork, this.networkImage = j.getNetworkImage(this.network), this.showBack = !1, this.prevHistoryLength = 1, this.view = c.state.view, this.viewDirection = "", this.headerText = K()[c.state.view], this.unsubscribe.push(ce.subscribeNetworkImages(() => {
444
- this.networkImage = j.getNetworkImage(this.network);
445
- }), c.subscribeKey("view", (e) => {
446
- setTimeout(() => {
447
- this.view = e, this.headerText = K()[e];
448
- }, U.ANIMATION_DURATIONS.HeaderText), this.onViewChange(), this.onHistoryChange();
449
- }), p.subscribeKey("activeCaipNetwork", (e) => {
450
- this.network = e, this.networkImage = j.getNetworkImage(this.network);
451
- }));
452
- }
453
- disconnectCallback() {
454
- this.unsubscribe.forEach((e) => e());
455
- }
456
- render() {
457
- return l`
458
- <wui-flex .padding=${this.getPadding()} justifyContent="space-between" alignItems="center">
459
- ${this.leftHeaderTemplate()} ${this.titleTemplate()} ${this.rightHeaderTemplate()}
460
- </wui-flex>
461
- `;
462
- }
463
- onWalletHelp() {
464
- G.sendEvent({ type: "track", event: "CLICK_WALLET_HELP" }), c.push("WhatIsAWallet");
465
- }
466
- async onClose() {
467
- await ee.safeClose();
468
- }
469
- rightHeaderTemplate() {
470
- var t, i, a;
471
- const e = (a = (i = (t = N) == null ? void 0 : t.state) == null ? void 0 : i.features) == null ? void 0 : a.smartSessions;
472
- return c.state.view !== "Account" || !e ? this.closeButtonTemplate() : l`<wui-flex>
473
- <wui-icon-link
474
- icon="clock"
475
- @click=${() => c.push("SmartSessionList")}
476
- data-testid="w3m-header-smart-sessions"
477
- ></wui-icon-link>
478
- ${this.closeButtonTemplate()}
479
- </wui-flex> `;
480
- }
481
- closeButtonTemplate() {
482
- return l`
483
- <wui-icon-link
484
- icon="close"
485
- @click=${this.onClose.bind(this)}
486
- data-testid="w3m-header-close"
487
- ></wui-icon-link>
488
- `;
489
- }
490
- titleTemplate() {
491
- const e = Ce.includes(this.view);
492
- return l`
493
- <wui-flex
494
- view-direction="${this.viewDirection}"
495
- class="w3m-header-title"
496
- alignItems="center"
497
- gap="xs"
498
- >
499
- <wui-text variant="paragraph-700" color="fg-100" data-testid="w3m-header-text"
500
- >${this.headerText}</wui-text
501
- >
502
- ${e ? l`<wui-tag variant="main">Beta</wui-tag>` : null}
503
- </wui-flex>
504
- `;
505
- }
506
- leftHeaderTemplate() {
507
- var x;
508
- const { view: e } = c.state, t = e === "Connect", i = N.state.enableEmbedded, a = e === "ApproveTransaction", o = e === "ConnectingSiwe", n = e === "Account", r = N.state.enableNetworkSwitch, A = a || o || t && i;
509
- return n && r ? l`<wui-select
510
- id="dynamic"
511
- data-testid="w3m-account-select-network"
512
- active-network=${z((x = this.network) == null ? void 0 : x.name)}
513
- @click=${this.onNetworks.bind(this)}
514
- imageSrc=${z(this.networkImage)}
515
- ></wui-select>` : this.showBack && !A ? l`<wui-icon-link
516
- data-testid="header-back"
517
- id="dynamic"
518
- icon="chevronLeft"
519
- @click=${this.onGoBack.bind(this)}
520
- ></wui-icon-link>` : l`<wui-icon-link
521
- data-hidden=${!t}
522
- id="dynamic"
523
- icon="helpCircle"
524
- @click=${this.onWalletHelp.bind(this)}
525
- ></wui-icon-link>`;
526
- }
527
- onNetworks() {
528
- this.isAllowedNetworkSwitch() && (G.sendEvent({ type: "track", event: "CLICK_NETWORKS" }), c.push("Networks"));
529
- }
530
- isAllowedNetworkSwitch() {
531
- const e = p.getAllRequestedCaipNetworks(), t = e ? e.length > 1 : !1, i = e == null ? void 0 : e.find(({ id: a }) => {
532
- var o;
533
- return a === ((o = this.network) == null ? void 0 : o.id);
534
- });
535
- return t || !i;
536
- }
537
- getPadding() {
538
- return this.heading ? ["l", "2l", "l", "2l"] : ["0", "2l", "0", "2l"];
539
- }
540
- onViewChange() {
541
- const { history: e } = c.state;
542
- let t = U.VIEW_DIRECTION.Next;
543
- e.length < this.prevHistoryLength && (t = U.VIEW_DIRECTION.Prev), this.prevHistoryLength = e.length, this.viewDirection = t;
544
- }
545
- async onHistoryChange() {
546
- var i;
547
- const { history: e } = c.state, t = (i = this.shadowRoot) == null ? void 0 : i.querySelector("#dynamic");
548
- e.length > 1 && !this.showBack && t ? (await t.animate([{ opacity: 1 }, { opacity: 0 }], {
549
- duration: 200,
550
- fill: "forwards",
551
- easing: "ease"
552
- }).finished, this.showBack = !0, t.animate([{ opacity: 0 }, { opacity: 1 }], {
553
- duration: 200,
554
- fill: "forwards",
555
- easing: "ease"
556
- })) : e.length <= 1 && this.showBack && t && (await t.animate([{ opacity: 1 }, { opacity: 0 }], {
557
- duration: 200,
558
- fill: "forwards",
559
- easing: "ease"
560
- }).finished, this.showBack = !1, t.animate([{ opacity: 0 }, { opacity: 1 }], {
561
- duration: 200,
562
- fill: "forwards",
563
- easing: "ease"
564
- }));
565
- }
566
- onGoBack() {
567
- c.goBack();
568
- }
569
- };
570
- h.styles = ye;
571
- g([
572
- d()
573
- ], h.prototype, "heading", void 0);
574
- g([
575
- d()
576
- ], h.prototype, "network", void 0);
577
- g([
578
- d()
579
- ], h.prototype, "networkImage", void 0);
580
- g([
581
- d()
582
- ], h.prototype, "showBack", void 0);
583
- g([
584
- d()
585
- ], h.prototype, "prevHistoryLength", void 0);
586
- g([
587
- d()
588
- ], h.prototype, "view", void 0);
589
- g([
590
- d()
591
- ], h.prototype, "viewDirection", void 0);
592
- g([
593
- d()
594
- ], h.prototype, "headerText", void 0);
595
- h = g([
596
- f("w3m-header")
597
- ], h);
598
- const xe = v`
599
- :host {
600
- display: flex;
601
- column-gap: var(--wui-spacing-s);
602
- align-items: center;
603
- padding: var(--wui-spacing-xs) var(--wui-spacing-m) var(--wui-spacing-xs) var(--wui-spacing-xs);
604
- border-radius: var(--wui-border-radius-s);
605
- border: 1px solid var(--wui-color-gray-glass-005);
606
- box-sizing: border-box;
607
- background-color: var(--wui-color-bg-175);
608
- box-shadow:
609
- 0px 14px 64px -4px rgba(0, 0, 0, 0.15),
610
- 0px 8px 22px -6px rgba(0, 0, 0, 0.15);
611
-
612
- max-width: 300px;
613
- }
614
-
615
- :host wui-loading-spinner {
616
- margin-left: var(--wui-spacing-3xs);
617
- }
618
- `;
619
- var S = function(s, e, t, i) {
620
- var a = arguments.length, o = a < 3 ? e : i === null ? i = Object.getOwnPropertyDescriptor(e, t) : i, n;
621
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o = Reflect.decorate(s, e, t, i);
622
- else for (var r = s.length - 1; r >= 0; r--) (n = s[r]) && (o = (a < 3 ? n(o) : a > 3 ? n(e, t, o) : n(e, t)) || o);
623
- return a > 3 && o && Object.defineProperty(e, t, o), o;
624
- };
625
- let m = class extends y {
626
- constructor() {
627
- super(...arguments), this.backgroundColor = "accent-100", this.iconColor = "accent-100", this.icon = "checkmark", this.message = "", this.loading = !1, this.iconType = "default";
628
- }
629
- render() {
630
- return l`
631
- ${this.templateIcon()}
632
- <wui-text variant="paragraph-500" color="fg-100" data-testid="wui-snackbar-message"
633
- >${this.message}</wui-text
634
- >
635
- `;
636
- }
637
- templateIcon() {
638
- return this.loading ? l`<wui-loading-spinner size="md" color="accent-100"></wui-loading-spinner>` : this.iconType === "default" ? l`<wui-icon size="xl" color=${this.iconColor} name=${this.icon}></wui-icon>` : l`<wui-icon-box
639
- size="sm"
640
- iconSize="xs"
641
- iconColor=${this.iconColor}
642
- backgroundColor=${this.backgroundColor}
643
- icon=${this.icon}
644
- background="opaque"
645
- ></wui-icon-box>`;
646
- }
647
- };
648
- m.styles = [L, xe];
649
- S([
650
- u()
651
- ], m.prototype, "backgroundColor", void 0);
652
- S([
653
- u()
654
- ], m.prototype, "iconColor", void 0);
655
- S([
656
- u()
657
- ], m.prototype, "icon", void 0);
658
- S([
659
- u()
660
- ], m.prototype, "message", void 0);
661
- S([
662
- u()
663
- ], m.prototype, "loading", void 0);
664
- S([
665
- u()
666
- ], m.prototype, "iconType", void 0);
667
- m = S([
668
- f("wui-snackbar")
669
- ], m);
670
- const ke = v`
671
- :host {
672
- display: block;
673
- position: absolute;
674
- opacity: 0;
675
- pointer-events: none;
676
- top: 11px;
677
- left: 50%;
678
- width: max-content;
679
- }
680
- `;
681
- var ie = function(s, e, t, i) {
682
- var a = arguments.length, o = a < 3 ? e : i === null ? i = Object.getOwnPropertyDescriptor(e, t) : i, n;
683
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o = Reflect.decorate(s, e, t, i);
684
- else for (var r = s.length - 1; r >= 0; r--) (n = s[r]) && (o = (a < 3 ? n(o) : a > 3 ? n(e, t, o) : n(e, t)) || o);
685
- return a > 3 && o && Object.defineProperty(e, t, o), o;
686
- };
687
- const Se = {
688
- loading: void 0,
689
- success: {
690
- backgroundColor: "success-100",
691
- iconColor: "success-100",
692
- icon: "checkmark"
693
- },
694
- error: {
695
- backgroundColor: "error-100",
696
- iconColor: "error-100",
697
- icon: "close"
698
- }
699
- };
700
- let D = class extends y {
701
- constructor() {
702
- super(), this.unsubscribe = [], this.timeout = void 0, this.open = $.state.open, this.unsubscribe.push($.subscribeKey("open", (e) => {
703
- this.open = e, this.onOpen();
704
- }));
705
- }
706
- disconnectedCallback() {
707
- clearTimeout(this.timeout), this.unsubscribe.forEach((e) => e());
708
- }
709
- render() {
710
- const { message: e, variant: t, svg: i } = $.state, a = Se[t], { icon: o, iconColor: n } = i ?? a ?? {};
711
- return l`
712
- <wui-snackbar
713
- message=${e}
714
- backgroundColor=${a == null ? void 0 : a.backgroundColor}
715
- iconColor=${n}
716
- icon=${o}
717
- .loading=${t === "loading"}
718
- ></wui-snackbar>
719
- `;
720
- }
721
- onOpen() {
722
- clearTimeout(this.timeout), this.open ? (this.animate([
723
- { opacity: 0, transform: "translateX(-50%) scale(0.85)" },
724
- { opacity: 1, transform: "translateX(-50%) scale(1)" }
725
- ], {
726
- duration: 150,
727
- fill: "forwards",
728
- easing: "ease"
729
- }), this.timeout && clearTimeout(this.timeout), $.state.autoClose && (this.timeout = setTimeout(() => $.hide(), 2500))) : this.animate([
730
- { opacity: 1, transform: "translateX(-50%) scale(1)" },
731
- { opacity: 0, transform: "translateX(-50%) scale(0.85)" }
732
- ], {
733
- duration: 150,
734
- fill: "forwards",
735
- easing: "ease"
736
- });
737
- }
738
- };
739
- D.styles = ke;
740
- ie([
741
- d()
742
- ], D.prototype, "open", void 0);
743
- D = ie([
744
- f("w3m-snackbar")
745
- ], D);
746
- const $e = v`
747
- :host {
748
- z-index: var(--w3m-z-index);
749
- display: block;
750
- backface-visibility: hidden;
751
- will-change: opacity;
752
- position: fixed;
753
- top: 0;
754
- left: 0;
755
- right: 0;
756
- bottom: 0;
757
- pointer-events: none;
758
- opacity: 0;
759
- background-color: var(--wui-cover);
760
- transition: opacity 0.2s var(--wui-ease-out-power-2);
761
- will-change: opacity;
762
- }
763
-
764
- :host(.open) {
765
- opacity: 1;
766
- }
767
-
768
- :host(.appkit-modal) {
769
- position: relative;
770
- pointer-events: unset;
771
- background: none;
772
- width: 100%;
773
- opacity: 1;
774
- }
775
-
776
- wui-card {
777
- max-width: var(--w3m-modal-width);
778
- width: 100%;
779
- position: relative;
780
- animation: zoom-in 0.2s var(--wui-ease-out-power-2);
781
- animation-fill-mode: backwards;
782
- outline: none;
783
- transition:
784
- border-radius var(--wui-duration-lg) var(--wui-ease-out-power-1),
785
- background-color var(--wui-duration-lg) var(--wui-ease-out-power-1);
786
- will-change: border-radius, background-color;
787
- }
788
-
789
- :host(.appkit-modal) wui-card {
790
- max-width: 400px;
791
- }
792
-
793
- wui-card[shake='true'] {
794
- animation:
795
- zoom-in 0.2s var(--wui-ease-out-power-2),
796
- w3m-shake 0.5s var(--wui-ease-out-power-2);
797
- }
798
-
799
- wui-flex {
800
- overflow-x: hidden;
801
- overflow-y: auto;
802
- display: flex;
803
- align-items: center;
804
- justify-content: center;
805
- width: 100%;
806
- height: 100%;
807
- }
808
-
809
- @media (max-height: 700px) and (min-width: 431px) {
810
- wui-flex {
811
- align-items: flex-start;
812
- }
813
-
814
- wui-card {
815
- margin: var(--wui-spacing-xxl) 0px;
816
- }
817
- }
818
-
819
- @media (max-width: 430px) {
820
- wui-flex {
821
- align-items: flex-end;
822
- }
823
-
824
- wui-card {
825
- max-width: 100%;
826
- border-bottom-left-radius: var(--local-border-bottom-mobile-radius);
827
- border-bottom-right-radius: var(--local-border-bottom-mobile-radius);
828
- border-bottom: none;
829
- animation: slide-in 0.2s var(--wui-ease-out-power-2);
830
- }
831
-
832
- wui-card[shake='true'] {
833
- animation:
834
- slide-in 0.2s var(--wui-ease-out-power-2),
835
- w3m-shake 0.5s var(--wui-ease-out-power-2);
836
- }
837
- }
838
-
839
- @keyframes zoom-in {
840
- 0% {
841
- transform: scale(0.95) translateY(0);
842
- }
843
- 100% {
844
- transform: scale(1) translateY(0);
845
- }
846
- }
847
-
848
- @keyframes slide-in {
849
- 0% {
850
- transform: scale(1) translateY(50px);
851
- }
852
- 100% {
853
- transform: scale(1) translateY(0);
854
- }
855
- }
856
-
857
- @keyframes w3m-shake {
858
- 0% {
859
- transform: scale(1) rotate(0deg);
860
- }
861
- 20% {
862
- transform: scale(1) rotate(-1deg);
863
- }
864
- 40% {
865
- transform: scale(1) rotate(1.5deg);
866
- }
867
- 60% {
868
- transform: scale(1) rotate(-1.5deg);
869
- }
870
- 80% {
871
- transform: scale(1) rotate(1deg);
872
- }
873
- 100% {
874
- transform: scale(1) rotate(0deg);
875
- }
876
- }
877
-
878
- @keyframes w3m-view-height {
879
- from {
880
- height: var(--prev-height);
881
- }
882
- to {
883
- height: var(--new-height);
884
- }
885
- }
886
- `;
887
- var C = function(s, e, t, i) {
888
- var a = arguments.length, o = a < 3 ? e : i === null ? i = Object.getOwnPropertyDescriptor(e, t) : i, n;
889
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o = Reflect.decorate(s, e, t, i);
890
- else for (var r = s.length - 1; r >= 0; r--) (n = s[r]) && (o = (a < 3 ? n(o) : a > 3 ? n(e, t, o) : n(e, t)) || o);
891
- return a > 3 && o && Object.defineProperty(e, t, o), o;
892
- };
893
- const F = "scroll-lock";
894
- class b extends y {
895
- constructor() {
896
- super(), this.unsubscribe = [], this.abortController = void 0, this.hasPrefetched = !1, this.enableEmbedded = N.state.enableEmbedded, this.open = w.state.open, this.caipAddress = p.state.activeCaipAddress, this.caipNetwork = p.state.activeCaipNetwork, this.shake = w.state.shake, this.filterByNamespace = H.state.filterByNamespace, this.initializeTheming(), R.prefetchAnalyticsConfig(), this.unsubscribe.push(w.subscribeKey("open", (e) => e ? this.onOpen() : this.onClose()), w.subscribeKey("shake", (e) => this.shake = e), p.subscribeKey("activeCaipNetwork", (e) => this.onNewNetwork(e)), p.subscribeKey("activeCaipAddress", (e) => this.onNewAddress(e)), N.subscribeKey("enableEmbedded", (e) => this.enableEmbedded = e), H.subscribeKey("filterByNamespace", (e) => {
897
- var t;
898
- this.filterByNamespace !== e && !((t = p.getAccountData(e)) != null && t.caipAddress) && (R.fetchRecommendedWallets(), this.filterByNamespace = e);
899
- }));
900
- }
901
- firstUpdated() {
902
- if (this.caipAddress) {
903
- if (this.enableEmbedded) {
904
- w.close(), this.prefetch();
905
- return;
906
- }
907
- this.onNewAddress(this.caipAddress);
908
- }
909
- this.open && this.onOpen(), this.enableEmbedded && this.prefetch();
910
- }
911
- disconnectedCallback() {
912
- this.unsubscribe.forEach((e) => e()), this.onRemoveKeyboardListener();
913
- }
914
- render() {
915
- return this.style.cssText = `
916
- --local-border-bottom-mobile-radius: ${this.enableEmbedded ? "clamp(0px, var(--wui-border-radius-l), 44px)" : "0px"};
917
- `, this.enableEmbedded ? l`${this.contentTemplate()}
918
- <w3m-tooltip></w3m-tooltip> ` : this.open ? l`
919
- <wui-flex @click=${this.onOverlayClick.bind(this)} data-testid="w3m-modal-overlay">
920
- ${this.contentTemplate()}
921
- </wui-flex>
922
- <w3m-tooltip></w3m-tooltip>
923
- ` : null;
924
- }
925
- contentTemplate() {
926
- return l` <wui-card
927
- shake="${this.shake}"
928
- data-embedded="${z(this.enableEmbedded)}"
929
- role="alertdialog"
930
- aria-modal="true"
931
- tabindex="0"
932
- data-testid="w3m-modal-card"
933
- >
934
- <w3m-header></w3m-header>
935
- <w3m-router></w3m-router>
936
- <w3m-snackbar></w3m-snackbar>
937
- <w3m-alertbar></w3m-alertbar>
938
- </wui-card>`;
939
- }
940
- async onOverlayClick(e) {
941
- e.target === e.currentTarget && await this.handleClose();
942
- }
943
- async handleClose() {
944
- await ee.safeClose();
945
- }
946
- initializeTheming() {
947
- const { themeVariables: e, themeMode: t } = le.state, i = he.getColorTheme(t);
948
- de(e, i);
949
- }
950
- onClose() {
951
- this.open = !1, this.classList.remove("open"), this.onScrollUnlock(), $.hide(), this.onRemoveKeyboardListener();
952
- }
953
- onOpen() {
954
- this.open = !0, this.classList.add("open"), this.onScrollLock(), this.onAddKeyboardListener();
955
- }
956
- onScrollLock() {
957
- const e = document.createElement("style");
958
- e.dataset.w3m = F, e.textContent = `
959
- body {
960
- touch-action: none;
961
- overflow: hidden;
962
- overscroll-behavior: contain;
963
- }
964
- w3m-modal {
965
- pointer-events: auto;
966
- }
967
- `, document.head.appendChild(e);
968
- }
969
- onScrollUnlock() {
970
- const e = document.head.querySelector(`style[data-w3m="${F}"]`);
971
- e && e.remove();
972
- }
973
- onAddKeyboardListener() {
974
- var t;
975
- this.abortController = new AbortController();
976
- const e = (t = this.shadowRoot) == null ? void 0 : t.querySelector("wui-card");
977
- e == null || e.focus(), window.addEventListener("keydown", (i) => {
978
- if (i.key === "Escape")
979
- this.handleClose();
980
- else if (i.key === "Tab") {
981
- const { tagName: a } = i.target;
982
- a && !a.includes("W3M-") && !a.includes("WUI-") && (e == null || e.focus());
983
- }
984
- }, this.abortController);
985
- }
986
- onRemoveKeyboardListener() {
987
- var e;
988
- (e = this.abortController) == null || e.abort(), this.abortController = void 0;
989
- }
990
- async onNewAddress(e) {
991
- const t = p.state.isSwitchingNamespace, i = ue.getPlainAddress(e);
992
- !i && !t ? w.close() : t && i && c.goBack(), await Z.initializeIfEnabled(), this.caipAddress = e, p.setIsSwitchingNamespace(!1);
993
- }
994
- onNewNetwork(e) {
995
- var Y, V, X;
996
- const t = this.caipNetwork, i = (Y = t == null ? void 0 : t.caipNetworkId) == null ? void 0 : Y.toString(), a = t == null ? void 0 : t.chainNamespace, o = (V = e == null ? void 0 : e.caipNetworkId) == null ? void 0 : V.toString(), n = e == null ? void 0 : e.chainNamespace, r = i !== o, x = r && !(a !== n), T = (t == null ? void 0 : t.name) === pe.UNSUPPORTED_NETWORK_NAME, E = c.state.view === "ConnectingExternal", I = !((X = p.getAccountData(e == null ? void 0 : e.chainNamespace)) != null && X.caipAddress), ae = c.state.view === "UnsupportedChain", ne = w.state.open;
997
- let O = !1;
998
- ne && !E && (I ? r && (O = !0) : (ae || x && !T) && (O = !0)), O && c.state.view !== "SIWXSignMessage" && c.goBack(), this.caipNetwork = e;
999
- }
1000
- prefetch() {
1001
- this.hasPrefetched || (R.prefetch(), R.fetchWalletsByPage({ page: 1 }), this.hasPrefetched = !0);
1002
- }
1003
- }
1004
- b.styles = $e;
1005
- C([
1006
- u({ type: Boolean })
1007
- ], b.prototype, "enableEmbedded", void 0);
1008
- C([
1009
- d()
1010
- ], b.prototype, "open", void 0);
1011
- C([
1012
- d()
1013
- ], b.prototype, "caipAddress", void 0);
1014
- C([
1015
- d()
1016
- ], b.prototype, "caipNetwork", void 0);
1017
- C([
1018
- d()
1019
- ], b.prototype, "shake", void 0);
1020
- C([
1021
- d()
1022
- ], b.prototype, "filterByNamespace", void 0);
1023
- let J = class extends b {
1024
- };
1025
- J = C([
1026
- f("w3m-modal")
1027
- ], J);
1028
- let Q = class extends b {
1029
- };
1030
- Q = C([
1031
- f("appkit-modal")
1032
- ], Q);
1033
- export {
1034
- Q as AppKitModal,
1035
- J as W3mModal,
1036
- b as W3mModalBase
1037
- };