@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
@@ -0,0 +1,355 @@
1
+ import { cU as C, cV as O, cW as P, cX as b, cY as l, c_ as E, dq as g, d0 as S, d8 as I, cG as R, cH as $ } from "./index-D_8VUmn1.js";
2
+ import { n as h, c as v, r as d, U as T } from "./index-CEqcN8QP.js";
3
+ import "./index-X8zir_1j.js";
4
+ import "./index-CmAv0Tzr.js";
5
+ const L = C`
6
+ :host {
7
+ position: relative;
8
+ display: inline-block;
9
+ }
10
+
11
+ input {
12
+ width: 48px;
13
+ height: 48px;
14
+ background: ${({ tokens: n }) => n.theme.foregroundPrimary};
15
+ border-radius: ${({ borderRadius: n }) => n[4]};
16
+ border: 1px solid ${({ tokens: n }) => n.theme.borderPrimary};
17
+ font-family: ${({ fontFamily: n }) => n.regular};
18
+ font-size: ${({ textSize: n }) => n.large};
19
+ line-height: 18px;
20
+ letter-spacing: -0.16px;
21
+ text-align: center;
22
+ color: ${({ tokens: n }) => n.theme.textPrimary};
23
+ caret-color: ${({ tokens: n }) => n.core.textAccentPrimary};
24
+ transition:
25
+ background-color ${({ durations: n }) => n.lg}
26
+ ${({ easings: n }) => n["ease-out-power-2"]},
27
+ border-color ${({ durations: n }) => n.lg}
28
+ ${({ easings: n }) => n["ease-out-power-2"]},
29
+ box-shadow ${({ durations: n }) => n.lg}
30
+ ${({ easings: n }) => n["ease-out-power-2"]};
31
+ will-change: background-color, border-color, box-shadow;
32
+ box-sizing: border-box;
33
+ -webkit-appearance: none;
34
+ -moz-appearance: textfield;
35
+ padding: ${({ spacing: n }) => n[4]};
36
+ }
37
+
38
+ input::-webkit-outer-spin-button,
39
+ input::-webkit-inner-spin-button {
40
+ -webkit-appearance: none;
41
+ margin: 0;
42
+ }
43
+
44
+ input[type='number'] {
45
+ -moz-appearance: textfield;
46
+ }
47
+
48
+ input:disabled {
49
+ cursor: not-allowed;
50
+ opacity: 0.5;
51
+ }
52
+
53
+ input:focus-visible:enabled {
54
+ background-color: transparent;
55
+ border: 1px solid ${({ tokens: n }) => n.theme.borderSecondary};
56
+ box-shadow: 0px 0px 0px 4px ${({ tokens: n }) => n.core.foregroundAccent040};
57
+ }
58
+ `;
59
+ var y = function(n, t, e, i) {
60
+ var r = arguments.length, o = r < 3 ? t : i === null ? i = Object.getOwnPropertyDescriptor(t, e) : i, s;
61
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o = Reflect.decorate(n, t, e, i);
62
+ else for (var a = n.length - 1; a >= 0; a--) (s = n[a]) && (o = (r < 3 ? s(o) : r > 3 ? s(t, e, o) : s(t, e)) || o);
63
+ return r > 3 && o && Object.defineProperty(t, e, o), o;
64
+ };
65
+ let p = class extends b {
66
+ constructor() {
67
+ super(...arguments), this.disabled = !1, this.value = "";
68
+ }
69
+ render() {
70
+ return l`<input
71
+ type="number"
72
+ maxlength="1"
73
+ inputmode="numeric"
74
+ autofocus
75
+ ?disabled=${this.disabled}
76
+ value=${this.value}
77
+ /> `;
78
+ }
79
+ };
80
+ p.styles = [O, P, L];
81
+ y([
82
+ h({ type: Boolean })
83
+ ], p.prototype, "disabled", void 0);
84
+ y([
85
+ h({ type: String })
86
+ ], p.prototype, "value", void 0);
87
+ p = y([
88
+ v("wui-input-numeric")
89
+ ], p);
90
+ const _ = E`
91
+ :host {
92
+ position: relative;
93
+ display: block;
94
+ }
95
+ `;
96
+ var m = function(n, t, e, i) {
97
+ var r = arguments.length, o = r < 3 ? t : i === null ? i = Object.getOwnPropertyDescriptor(t, e) : i, s;
98
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o = Reflect.decorate(n, t, e, i);
99
+ else for (var a = n.length - 1; a >= 0; a--) (s = n[a]) && (o = (r < 3 ? s(o) : r > 3 ? s(t, e, o) : s(t, e)) || o);
100
+ return r > 3 && o && Object.defineProperty(t, e, o), o;
101
+ };
102
+ let c = class extends b {
103
+ constructor() {
104
+ super(...arguments), this.length = 6, this.otp = "", this.values = Array.from({ length: this.length }).map(() => ""), this.numerics = [], this.shouldInputBeEnabled = (t) => this.values.slice(0, t).every((i) => i !== ""), this.handleKeyDown = (t, e) => {
105
+ const i = t.target, r = this.getInputElement(i), o = ["ArrowLeft", "ArrowRight", "Shift", "Delete"];
106
+ if (!r)
107
+ return;
108
+ o.includes(t.key) && t.preventDefault();
109
+ const s = r.selectionStart;
110
+ switch (t.key) {
111
+ case "ArrowLeft":
112
+ s && r.setSelectionRange(s + 1, s + 1), this.focusInputField("prev", e);
113
+ break;
114
+ case "ArrowRight":
115
+ this.focusInputField("next", e);
116
+ break;
117
+ case "Shift":
118
+ this.focusInputField("next", e);
119
+ break;
120
+ case "Delete":
121
+ r.value === "" ? this.focusInputField("prev", e) : this.updateInput(r, e, "");
122
+ break;
123
+ case "Backspace":
124
+ r.value === "" ? this.focusInputField("prev", e) : this.updateInput(r, e, "");
125
+ break;
126
+ }
127
+ }, this.focusInputField = (t, e) => {
128
+ if (t === "next") {
129
+ const i = e + 1;
130
+ if (!this.shouldInputBeEnabled(i))
131
+ return;
132
+ const r = this.numerics[i < this.length ? i : e], o = r ? this.getInputElement(r) : void 0;
133
+ o && (o.disabled = !1, o.focus());
134
+ }
135
+ if (t === "prev") {
136
+ const i = e - 1, r = this.numerics[i > -1 ? i : e], o = r ? this.getInputElement(r) : void 0;
137
+ o && o.focus();
138
+ }
139
+ };
140
+ }
141
+ firstUpdated() {
142
+ var e, i;
143
+ this.otp && (this.values = this.otp.split(""));
144
+ const t = (e = this.shadowRoot) == null ? void 0 : e.querySelectorAll("wui-input-numeric");
145
+ t && (this.numerics = Array.from(t)), (i = this.numerics[0]) == null || i.focus();
146
+ }
147
+ render() {
148
+ return l`
149
+ <wui-flex gap="1" data-testid="wui-otp-input">
150
+ ${Array.from({ length: this.length }).map((t, e) => l`
151
+ <wui-input-numeric
152
+ @input=${(i) => this.handleInput(i, e)}
153
+ @click=${(i) => this.selectInput(i)}
154
+ @keydown=${(i) => this.handleKeyDown(i, e)}
155
+ .disabled=${!this.shouldInputBeEnabled(e)}
156
+ .value=${this.values[e] || ""}
157
+ >
158
+ </wui-input-numeric>
159
+ `)}
160
+ </wui-flex>
161
+ `;
162
+ }
163
+ updateInput(t, e, i) {
164
+ const r = this.numerics[e], o = t || (r ? this.getInputElement(r) : void 0);
165
+ o && (o.value = i, this.values = this.values.map((s, a) => a === e ? i : s));
166
+ }
167
+ selectInput(t) {
168
+ const e = t.target;
169
+ if (e) {
170
+ const i = this.getInputElement(e);
171
+ i == null || i.select();
172
+ }
173
+ }
174
+ handleInput(t, e) {
175
+ const i = t.target, r = this.getInputElement(i);
176
+ if (r) {
177
+ const o = r.value;
178
+ t.inputType === "insertFromPaste" ? this.handlePaste(r, o, e) : T.isNumber(o) && t.data ? (this.updateInput(r, e, t.data), this.focusInputField("next", e)) : this.updateInput(r, e, "");
179
+ }
180
+ this.dispatchInputChangeEvent();
181
+ }
182
+ handlePaste(t, e, i) {
183
+ const r = e[0];
184
+ if (r && T.isNumber(r)) {
185
+ this.updateInput(t, i, r);
186
+ const s = e.substring(1);
187
+ if (i + 1 < this.length && s.length) {
188
+ const a = this.numerics[i + 1], x = a ? this.getInputElement(a) : void 0;
189
+ x && this.handlePaste(x, s, i + 1);
190
+ } else
191
+ this.focusInputField("next", i);
192
+ } else
193
+ this.updateInput(t, i, "");
194
+ }
195
+ getInputElement(t) {
196
+ var e;
197
+ return (e = t.shadowRoot) != null && e.querySelector("input") ? t.shadowRoot.querySelector("input") : null;
198
+ }
199
+ dispatchInputChangeEvent() {
200
+ const t = this.values.join("");
201
+ this.dispatchEvent(new CustomEvent("inputChange", {
202
+ detail: t,
203
+ bubbles: !0,
204
+ composed: !0
205
+ }));
206
+ }
207
+ };
208
+ c.styles = [O, _];
209
+ m([
210
+ h({ type: Number })
211
+ ], c.prototype, "length", void 0);
212
+ m([
213
+ h({ type: String })
214
+ ], c.prototype, "otp", void 0);
215
+ m([
216
+ d()
217
+ ], c.prototype, "values", void 0);
218
+ c = m([
219
+ v("wui-otp")
220
+ ], c);
221
+ const k = E`
222
+ wui-loading-spinner {
223
+ margin: 9px auto;
224
+ }
225
+
226
+ .email-display,
227
+ .email-display wui-text {
228
+ max-width: 100%;
229
+ }
230
+ `;
231
+ var f = function(n, t, e, i) {
232
+ var r = arguments.length, o = r < 3 ? t : i === null ? i = Object.getOwnPropertyDescriptor(t, e) : i, s;
233
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o = Reflect.decorate(n, t, e, i);
234
+ else for (var a = n.length - 1; a >= 0; a--) (s = n[a]) && (o = (r < 3 ? s(o) : r > 3 ? s(t, e, o) : s(t, e)) || o);
235
+ return r > 3 && o && Object.defineProperty(t, e, o), o;
236
+ }, w;
237
+ let u = w = class extends b {
238
+ firstUpdated() {
239
+ this.startOTPTimeout();
240
+ }
241
+ disconnectedCallback() {
242
+ clearTimeout(this.OTPTimeout);
243
+ }
244
+ constructor() {
245
+ var t;
246
+ super(), this.loading = !1, this.timeoutTimeLeft = g.getTimeToNextEmailLogin(), this.error = "", this.otp = "", this.email = (t = S.state.data) == null ? void 0 : t.email, this.authConnector = I.getAuthConnector();
247
+ }
248
+ render() {
249
+ if (!this.email)
250
+ throw new Error("w3m-email-otp-widget: No email provided");
251
+ const t = !!this.timeoutTimeLeft, e = this.getFooterLabels(t);
252
+ return l`
253
+ <wui-flex
254
+ flexDirection="column"
255
+ alignItems="center"
256
+ .padding=${["4", "0", "4", "0"]}
257
+ gap="4"
258
+ >
259
+ <wui-flex
260
+ class="email-display"
261
+ flexDirection="column"
262
+ alignItems="center"
263
+ .padding=${["0", "5", "0", "5"]}
264
+ >
265
+ <wui-text variant="md-regular" color="primary" align="center">
266
+ Enter the code we sent to
267
+ </wui-text>
268
+ <wui-text variant="md-medium" color="primary" lineClamp="1" align="center">
269
+ ${this.email}
270
+ </wui-text>
271
+ </wui-flex>
272
+
273
+ <wui-text variant="sm-regular" color="secondary">The code expires in 20 minutes</wui-text>
274
+
275
+ ${this.loading ? l`<wui-loading-spinner size="xl" color="accent-primary"></wui-loading-spinner>` : l` <wui-flex flexDirection="column" alignItems="center" gap="2">
276
+ <wui-otp
277
+ dissabled
278
+ length="6"
279
+ @inputChange=${this.onOtpInputChange.bind(this)}
280
+ .otp=${this.otp}
281
+ ></wui-otp>
282
+ ${this.error ? l`
283
+ <wui-text variant="sm-regular" align="center" color="error">
284
+ ${this.error}. Try Again
285
+ </wui-text>
286
+ ` : null}
287
+ </wui-flex>`}
288
+
289
+ <wui-flex alignItems="center" gap="2">
290
+ <wui-text variant="sm-regular" color="secondary">${e.title}</wui-text>
291
+ <wui-link @click=${this.onResendCode.bind(this)} .disabled=${t}>
292
+ ${e.action}
293
+ </wui-link>
294
+ </wui-flex>
295
+ </wui-flex>
296
+ `;
297
+ }
298
+ startOTPTimeout() {
299
+ this.timeoutTimeLeft = g.getTimeToNextEmailLogin(), this.OTPTimeout = setInterval(() => {
300
+ this.timeoutTimeLeft > 0 ? this.timeoutTimeLeft = g.getTimeToNextEmailLogin() : clearInterval(this.OTPTimeout);
301
+ }, 1e3);
302
+ }
303
+ async onOtpInputChange(t) {
304
+ var e;
305
+ try {
306
+ this.loading || (this.otp = t.detail, this.shouldSubmitOnOtpChange() && (this.loading = !0, await ((e = this.onOtpSubmit) == null ? void 0 : e.call(this, this.otp))));
307
+ } catch (i) {
308
+ this.error = R.parseError(i), this.loading = !1;
309
+ }
310
+ }
311
+ async onResendCode() {
312
+ try {
313
+ if (this.onOtpResend) {
314
+ if (!this.loading && !this.timeoutTimeLeft) {
315
+ if (this.error = "", this.otp = "", !I.getAuthConnector() || !this.email)
316
+ throw new Error("w3m-email-otp-widget: Unable to resend email");
317
+ this.loading = !0, await this.onOtpResend(this.email), this.startOTPTimeout(), $.showSuccess("Code email resent");
318
+ }
319
+ } else this.onStartOver && this.onStartOver();
320
+ } catch (t) {
321
+ $.showError(t);
322
+ } finally {
323
+ this.loading = !1;
324
+ }
325
+ }
326
+ getFooterLabels(t) {
327
+ return this.onStartOver ? {
328
+ title: "Something wrong?",
329
+ action: `Try again ${t ? `in ${this.timeoutTimeLeft}s` : ""}`
330
+ } : {
331
+ title: "Didn't receive it?",
332
+ action: `Resend ${t ? `in ${this.timeoutTimeLeft}s` : "Code"}`
333
+ };
334
+ }
335
+ shouldSubmitOnOtpChange() {
336
+ return this.authConnector && this.otp.length === w.OTP_LENGTH;
337
+ }
338
+ };
339
+ u.OTP_LENGTH = 6;
340
+ u.styles = k;
341
+ f([
342
+ d()
343
+ ], u.prototype, "loading", void 0);
344
+ f([
345
+ d()
346
+ ], u.prototype, "timeoutTimeLeft", void 0);
347
+ f([
348
+ d()
349
+ ], u.prototype, "error", void 0);
350
+ u = w = f([
351
+ v("w3m-email-otp-widget")
352
+ ], u);
353
+ export {
354
+ u as W
355
+ };
@@ -0,0 +1,172 @@
1
+ import { cU as l, cV as p, cW as h, cX as b, cY as y } from "./index-D_8VUmn1.js";
2
+ import { n as r, c as f } from "./index-CEqcN8QP.js";
3
+ import { o as v } from "./if-defined-CdZSZ6UL.js";
4
+ const m = l`
5
+ :host {
6
+ position: relative;
7
+ }
8
+
9
+ button {
10
+ display: flex;
11
+ justify-content: center;
12
+ align-items: center;
13
+ background-color: transparent;
14
+ padding: ${({ spacing: t }) => t[1]};
15
+ }
16
+
17
+ /* -- Colors --------------------------------------------------- */
18
+ button[data-type='accent'] wui-icon {
19
+ color: ${({ tokens: t }) => t.core.iconAccentPrimary};
20
+ }
21
+
22
+ button[data-type='neutral'][data-variant='primary'] wui-icon {
23
+ color: ${({ tokens: t }) => t.theme.iconInverse};
24
+ }
25
+
26
+ button[data-type='neutral'][data-variant='secondary'] wui-icon {
27
+ color: ${({ tokens: t }) => t.theme.iconDefault};
28
+ }
29
+
30
+ button[data-type='success'] wui-icon {
31
+ color: ${({ tokens: t }) => t.core.iconSuccess};
32
+ }
33
+
34
+ button[data-type='error'] wui-icon {
35
+ color: ${({ tokens: t }) => t.core.iconError};
36
+ }
37
+
38
+ /* -- Sizes --------------------------------------------------- */
39
+ button[data-size='xs'] {
40
+ width: 16px;
41
+ height: 16px;
42
+
43
+ border-radius: ${({ borderRadius: t }) => t[1]};
44
+ }
45
+
46
+ button[data-size='sm'] {
47
+ width: 20px;
48
+ height: 20px;
49
+ border-radius: ${({ borderRadius: t }) => t[1]};
50
+ }
51
+
52
+ button[data-size='md'] {
53
+ width: 24px;
54
+ height: 24px;
55
+ border-radius: ${({ borderRadius: t }) => t[2]};
56
+ }
57
+
58
+ button[data-size='lg'] {
59
+ width: 28px;
60
+ height: 28px;
61
+ border-radius: ${({ borderRadius: t }) => t[2]};
62
+ }
63
+
64
+ button[data-size='xs'] wui-icon {
65
+ width: 8px;
66
+ height: 8px;
67
+ }
68
+
69
+ button[data-size='sm'] wui-icon {
70
+ width: 12px;
71
+ height: 12px;
72
+ }
73
+
74
+ button[data-size='md'] wui-icon {
75
+ width: 16px;
76
+ height: 16px;
77
+ }
78
+
79
+ button[data-size='lg'] wui-icon {
80
+ width: 20px;
81
+ height: 20px;
82
+ }
83
+
84
+ /* -- Hover --------------------------------------------------- */
85
+ @media (hover: hover) {
86
+ button[data-type='accent']:hover:enabled {
87
+ background-color: ${({ tokens: t }) => t.core.foregroundAccent010};
88
+ }
89
+
90
+ button[data-variant='primary'][data-type='neutral']:hover:enabled {
91
+ background-color: ${({ tokens: t }) => t.theme.foregroundSecondary};
92
+ }
93
+
94
+ button[data-variant='secondary'][data-type='neutral']:hover:enabled {
95
+ background-color: ${({ tokens: t }) => t.theme.foregroundSecondary};
96
+ }
97
+
98
+ button[data-type='success']:hover:enabled {
99
+ background-color: ${({ tokens: t }) => t.core.backgroundSuccess};
100
+ }
101
+
102
+ button[data-type='error']:hover:enabled {
103
+ background-color: ${({ tokens: t }) => t.core.backgroundError};
104
+ }
105
+ }
106
+
107
+ /* -- Focus --------------------------------------------------- */
108
+ button:focus-visible {
109
+ box-shadow: 0 0 0 4px ${({ tokens: t }) => t.core.foregroundAccent020};
110
+ }
111
+
112
+ /* -- Properties --------------------------------------------------- */
113
+ button[data-full-width='true'] {
114
+ width: 100%;
115
+ }
116
+
117
+ :host([fullWidth]) {
118
+ width: 100%;
119
+ }
120
+
121
+ button[disabled] {
122
+ opacity: 0.5;
123
+ cursor: not-allowed;
124
+ }
125
+ `;
126
+ var i = function(t, a, n, d) {
127
+ var c = arguments.length, o = c < 3 ? a : d === null ? d = Object.getOwnPropertyDescriptor(a, n) : d, s;
128
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o = Reflect.decorate(t, a, n, d);
129
+ else for (var u = t.length - 1; u >= 0; u--) (s = t[u]) && (o = (c < 3 ? s(o) : c > 3 ? s(a, n, o) : s(a, n)) || o);
130
+ return c > 3 && o && Object.defineProperty(a, n, o), o;
131
+ };
132
+ let e = class extends b {
133
+ constructor() {
134
+ super(...arguments), this.icon = "card", this.variant = "primary", this.type = "accent", this.size = "md", this.iconSize = void 0, this.fullWidth = !1, this.disabled = !1;
135
+ }
136
+ render() {
137
+ return y`<button
138
+ data-variant=${this.variant}
139
+ data-type=${this.type}
140
+ data-size=${this.size}
141
+ data-full-width=${this.fullWidth}
142
+ ?disabled=${this.disabled}
143
+ >
144
+ <wui-icon color="inherit" name=${this.icon} size=${v(this.iconSize)}></wui-icon>
145
+ </button>`;
146
+ }
147
+ };
148
+ e.styles = [p, h, m];
149
+ i([
150
+ r()
151
+ ], e.prototype, "icon", void 0);
152
+ i([
153
+ r()
154
+ ], e.prototype, "variant", void 0);
155
+ i([
156
+ r()
157
+ ], e.prototype, "type", void 0);
158
+ i([
159
+ r()
160
+ ], e.prototype, "size", void 0);
161
+ i([
162
+ r()
163
+ ], e.prototype, "iconSize", void 0);
164
+ i([
165
+ r({ type: Boolean })
166
+ ], e.prototype, "fullWidth", void 0);
167
+ i([
168
+ r({ type: Boolean })
169
+ ], e.prototype, "disabled", void 0);
170
+ e = i([
171
+ f("wui-icon-button")
172
+ ], e);
@@ -0,0 +1,118 @@
1
+ import { cU as h, cV as m, cW as f, cX as g, cY as a } from "./index-D_8VUmn1.js";
2
+ import { n as i, c as b } from "./index-CEqcN8QP.js";
3
+ import { o as p } from "./if-defined-CdZSZ6UL.js";
4
+ import "./index-CmAv0Tzr.js";
5
+ const y = h`
6
+ :host {
7
+ width: 100%;
8
+ }
9
+
10
+ button {
11
+ display: flex;
12
+ align-items: center;
13
+ justify-content: space-between;
14
+ padding: ${({ spacing: e }) => e[3]};
15
+ width: 100%;
16
+ background-color: ${({ tokens: e }) => e.theme.backgroundPrimary};
17
+ border-radius: ${({ borderRadius: e }) => e[4]};
18
+ transition:
19
+ background-color ${({ durations: e }) => e.lg}
20
+ ${({ easings: e }) => e["ease-out-power-2"]},
21
+ scale ${({ durations: e }) => e.lg} ${({ easings: e }) => e["ease-out-power-2"]};
22
+ will-change: background-color, scale;
23
+ }
24
+
25
+ wui-text {
26
+ text-transform: capitalize;
27
+ }
28
+
29
+ wui-image {
30
+ color: ${({ tokens: e }) => e.theme.textPrimary};
31
+ }
32
+
33
+ @media (hover: hover) {
34
+ button:hover:enabled {
35
+ background-color: ${({ tokens: e }) => e.theme.foregroundPrimary};
36
+ }
37
+ }
38
+
39
+ button:disabled {
40
+ opacity: 0.5;
41
+ cursor: not-allowed;
42
+ }
43
+ `;
44
+ var o = function(e, n, l, s) {
45
+ var d = arguments.length, r = d < 3 ? n : s === null ? s = Object.getOwnPropertyDescriptor(n, l) : s, u;
46
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") r = Reflect.decorate(e, n, l, s);
47
+ else for (var c = e.length - 1; c >= 0; c--) (u = e[c]) && (r = (d < 3 ? u(r) : d > 3 ? u(n, l, r) : u(n, l)) || r);
48
+ return d > 3 && r && Object.defineProperty(n, l, r), r;
49
+ };
50
+ let t = class extends g {
51
+ constructor() {
52
+ super(...arguments), this.imageSrc = "google", this.loading = !1, this.disabled = !1, this.rightIcon = !0, this.rounded = !1, this.fullSize = !1;
53
+ }
54
+ render() {
55
+ return this.dataset.rounded = this.rounded ? "true" : "false", a`
56
+ <button
57
+ ?disabled=${this.loading ? !0 : !!this.disabled}
58
+ data-loading=${this.loading}
59
+ tabindex=${p(this.tabIdx)}
60
+ >
61
+ <wui-flex gap="2" alignItems="center">
62
+ ${this.templateLeftIcon()}
63
+ <wui-flex gap="1">
64
+ <slot></slot>
65
+ </wui-flex>
66
+ </wui-flex>
67
+ ${this.templateRightIcon()}
68
+ </button>
69
+ `;
70
+ }
71
+ templateLeftIcon() {
72
+ return this.icon ? a`<wui-image
73
+ icon=${this.icon}
74
+ iconColor=${p(this.iconColor)}
75
+ ?boxed=${!0}
76
+ ?rounded=${this.rounded}
77
+ ></wui-image>` : a`<wui-image
78
+ ?boxed=${!0}
79
+ ?rounded=${this.rounded}
80
+ ?fullSize=${this.fullSize}
81
+ src=${this.imageSrc}
82
+ ></wui-image>`;
83
+ }
84
+ templateRightIcon() {
85
+ return this.rightIcon ? this.loading ? a`<wui-loading-spinner size="md" color="accent-primary"></wui-loading-spinner>` : a`<wui-icon name="chevronRight" size="lg" color="default"></wui-icon>` : null;
86
+ }
87
+ };
88
+ t.styles = [m, f, y];
89
+ o([
90
+ i()
91
+ ], t.prototype, "imageSrc", void 0);
92
+ o([
93
+ i()
94
+ ], t.prototype, "icon", void 0);
95
+ o([
96
+ i()
97
+ ], t.prototype, "iconColor", void 0);
98
+ o([
99
+ i({ type: Boolean })
100
+ ], t.prototype, "loading", void 0);
101
+ o([
102
+ i()
103
+ ], t.prototype, "tabIdx", void 0);
104
+ o([
105
+ i({ type: Boolean })
106
+ ], t.prototype, "disabled", void 0);
107
+ o([
108
+ i({ type: Boolean })
109
+ ], t.prototype, "rightIcon", void 0);
110
+ o([
111
+ i({ type: Boolean })
112
+ ], t.prototype, "rounded", void 0);
113
+ o([
114
+ i({ type: Boolean })
115
+ ], t.prototype, "fullSize", void 0);
116
+ t = o([
117
+ b("wui-list-item")
118
+ ], t);