@prohetamine/redstone 0.0.1

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 (160) hide show
  1. package/dist/PhArrowCircleDown-BR-zH4LC.js +14 -0
  2. package/dist/PhArrowCircleDown-Sb38khBy.mjs +73 -0
  3. package/dist/PhArrowClockwise-BE5j9P0Z.mjs +73 -0
  4. package/dist/PhArrowClockwise-BRaehQGe.js +14 -0
  5. package/dist/PhArrowDown-B_WmmmY9.js +14 -0
  6. package/dist/PhArrowDown-CFEyR2dR.mjs +73 -0
  7. package/dist/PhArrowLeft-CYfU7NZj.mjs +73 -0
  8. package/dist/PhArrowLeft-CkEd70hm.js +14 -0
  9. package/dist/PhArrowRight-C07Qkx86.js +14 -0
  10. package/dist/PhArrowRight-EermNu0V.mjs +73 -0
  11. package/dist/PhArrowSquareOut-BjTBfzOP.js +14 -0
  12. package/dist/PhArrowSquareOut-DZwTtw54.mjs +73 -0
  13. package/dist/PhArrowUp-DB4CCSss.js +14 -0
  14. package/dist/PhArrowUp-xTpLFQkg.mjs +73 -0
  15. package/dist/PhArrowUpRight-CQbvn6NO.mjs +73 -0
  16. package/dist/PhArrowUpRight-GpCIMsAh.js +14 -0
  17. package/dist/PhArrowsClockwise-BgcIUg-Z.js +14 -0
  18. package/dist/PhArrowsClockwise-DnUYZTVx.mjs +73 -0
  19. package/dist/PhArrowsDownUp-C8KXUqtu.js +14 -0
  20. package/dist/PhArrowsDownUp-DgoprEe2.mjs +73 -0
  21. package/dist/PhArrowsLeftRight-CahChzCj.js +14 -0
  22. package/dist/PhArrowsLeftRight-FD4AZiLh.mjs +73 -0
  23. package/dist/PhBank-DIqIL4x_.js +14 -0
  24. package/dist/PhBank-DbQOQ9zJ.mjs +73 -0
  25. package/dist/PhBrowser-BCBXK2IM.mjs +73 -0
  26. package/dist/PhBrowser-laCKtn7T.js +14 -0
  27. package/dist/PhCaretDown-CnjP-QjZ.mjs +73 -0
  28. package/dist/PhCaretDown-DDe42xDU.js +14 -0
  29. package/dist/PhCaretLeft-Cskc5OY9.js +14 -0
  30. package/dist/PhCaretLeft-DkuXxjf_.mjs +73 -0
  31. package/dist/PhCaretRight-CBWpghxt.mjs +73 -0
  32. package/dist/PhCaretRight-DNgI5w_B.js +14 -0
  33. package/dist/PhCaretUp-CQ-OztBV.mjs +73 -0
  34. package/dist/PhCaretUp-CUZ4g_Me.js +14 -0
  35. package/dist/PhCheck-BVV_Dwfo.js +14 -0
  36. package/dist/PhCheck-t515emYS.mjs +73 -0
  37. package/dist/PhCircleHalf-BuQTmrKW.mjs +73 -0
  38. package/dist/PhCircleHalf-DDC7rige.js +14 -0
  39. package/dist/PhClock-BqynEKWl.js +14 -0
  40. package/dist/PhClock-D6XkTmM_.mjs +73 -0
  41. package/dist/PhCompass-2QeeX5Ad.mjs +73 -0
  42. package/dist/PhCompass-BsuJwXAE.js +14 -0
  43. package/dist/PhCopy-CO34-_xD.mjs +73 -0
  44. package/dist/PhCopy-MVqtRS6X.js +14 -0
  45. package/dist/PhCreditCard-Dq4kdjCw.js +14 -0
  46. package/dist/PhCreditCard-bfnqYflD.mjs +73 -0
  47. package/dist/PhCurrencyDollar-6k8UWxal.js +14 -0
  48. package/dist/PhCurrencyDollar-BekVYPtC.mjs +73 -0
  49. package/dist/PhDesktop-BkNzf3rT.mjs +73 -0
  50. package/dist/PhDesktop-CfsXQ0vC.js +14 -0
  51. package/dist/PhDeviceMobile-BT3Mg_b0.mjs +73 -0
  52. package/dist/PhDeviceMobile-BnrrDrwf.js +14 -0
  53. package/dist/PhDotsThree-6LRvhAcL.js +14 -0
  54. package/dist/PhDotsThree-kpf2OKxJ.mjs +73 -0
  55. package/dist/PhEnvelope-CHsfC2e0.js +14 -0
  56. package/dist/PhEnvelope-UFKpKtwf.mjs +73 -0
  57. package/dist/PhFunnelSimple-CdAqSIhK.mjs +73 -0
  58. package/dist/PhFunnelSimple-JAk7X9Wo.js +14 -0
  59. package/dist/PhGlobe-B3RYXl8h.mjs +73 -0
  60. package/dist/PhGlobe-Tfs4MfpG.js +14 -0
  61. package/dist/PhIdentificationCard-Dqmd6eY1.js +14 -0
  62. package/dist/PhIdentificationCard-rSq59Czm.mjs +73 -0
  63. package/dist/PhImage-aEryzfCi.js +14 -0
  64. package/dist/PhImage-ynsEnFd_.mjs +73 -0
  65. package/dist/PhInfo-B7lsWl6m.mjs +73 -0
  66. package/dist/PhInfo-D6oUrWpA.js +14 -0
  67. package/dist/PhLightbulb-FQDaMMqu.mjs +73 -0
  68. package/dist/PhLightbulb-qbEduhPa.js +14 -0
  69. package/dist/PhMagnifyingGlass-COdRH2k5.js +14 -0
  70. package/dist/PhMagnifyingGlass-_NXk13-0.mjs +73 -0
  71. package/dist/PhPaperPlaneRight-BYi7SorW.mjs +73 -0
  72. package/dist/PhPaperPlaneRight-DrpVAQOZ.js +14 -0
  73. package/dist/PhPlus-25KQTPHG.mjs +73 -0
  74. package/dist/PhPlus-BhUXef08.js +14 -0
  75. package/dist/PhPower-BKl7gzsB.mjs +73 -0
  76. package/dist/PhPower-BNJf1AGQ.js +14 -0
  77. package/dist/PhPuzzlePiece-BkZeF8CX.js +14 -0
  78. package/dist/PhPuzzlePiece-BqUI4GRs.mjs +73 -0
  79. package/dist/PhQrCode-C-tqZKPP.mjs +73 -0
  80. package/dist/PhQrCode-C0v0iXQN.js +14 -0
  81. package/dist/PhQuestion-BBAiRWgt.js +14 -0
  82. package/dist/PhQuestion-CtYvffyD.mjs +73 -0
  83. package/dist/PhQuestionMark-BNbtL2yx.mjs +73 -0
  84. package/dist/PhQuestionMark-BvGUBZ1h.js +14 -0
  85. package/dist/PhSealCheck-B0TEqWpq.mjs +73 -0
  86. package/dist/PhSealCheck-BwNkuF7G.js +14 -0
  87. package/dist/PhSignOut-C1rMSNaS.js +14 -0
  88. package/dist/PhSignOut-HX2_BVsD.mjs +73 -0
  89. package/dist/PhSpinner-CoDYLYOX.mjs +73 -0
  90. package/dist/PhSpinner-nmsGWDQl.js +14 -0
  91. package/dist/PhTrash-CALlKx3e.js +14 -0
  92. package/dist/PhTrash-DeQHS8ZP.mjs +73 -0
  93. package/dist/PhUser-CA0e5OPI.js +14 -0
  94. package/dist/PhUser-Cy5EY3vX.mjs +73 -0
  95. package/dist/PhVault-DdXjVOO9.mjs +73 -0
  96. package/dist/PhVault-DqxV75cz.js +14 -0
  97. package/dist/PhWallet-CeQrfGYc.mjs +73 -0
  98. package/dist/PhWallet-CyCuEs2U.js +14 -0
  99. package/dist/PhWarning-BKaHv_wT.mjs +73 -0
  100. package/dist/PhWarning-C7oj86bY.js +14 -0
  101. package/dist/PhWarningCircle-8MWw-QgE.mjs +73 -0
  102. package/dist/PhWarningCircle-CrNPXGj4.js +14 -0
  103. package/dist/PhX-9lsrXjyl.js +14 -0
  104. package/dist/PhX-DgXr_Fb0.mjs +73 -0
  105. package/dist/ReownAuthentication-Bfv31LzI.mjs +274 -0
  106. package/dist/ReownAuthentication-d8aYgGOq.js +5 -0
  107. package/dist/SwapController-4lzoYsYr.js +1 -0
  108. package/dist/SwapController-DjzUWRyQ.mjs +462 -0
  109. package/dist/ccip-CvwbEhki.js +1 -0
  110. package/dist/ccip-TuO68NeE.mjs +150 -0
  111. package/dist/data-capture-BwdjH2vc.mjs +489 -0
  112. package/dist/data-capture-xVUNZJ2T.js +242 -0
  113. package/dist/email-BCZObJCY.js +90 -0
  114. package/dist/email-m-wo60fN.mjs +338 -0
  115. package/dist/embedded-wallet-CGSri-4g.js +410 -0
  116. package/dist/embedded-wallet-DdZmv5qP.mjs +808 -0
  117. package/dist/features-BJ8kNaE8.js +1 -0
  118. package/dist/features-CJ34oImB.mjs +6 -0
  119. package/dist/index-4lfXeo30.js +132 -0
  120. package/dist/index-B6Mg114Z.mjs +69182 -0
  121. package/dist/index-BX7gAgT3.mjs +35 -0
  122. package/dist/index-BYQqNbCe.js +1 -0
  123. package/dist/index-BmdHwtJo.js +1 -0
  124. package/dist/index-BvUx3ULC.js +78 -0
  125. package/dist/index-CD-QGO70.mjs +196 -0
  126. package/dist/index-CJtXfdoM.mjs +29621 -0
  127. package/dist/index-CMzdgE-y.mjs +215 -0
  128. package/dist/index-CjZQCcwG.js +7203 -0
  129. package/dist/index-D7VuOaCI.js +19 -0
  130. package/dist/index-DV7SQwgn.mjs +2688 -0
  131. package/dist/index-DVf4BnNh.mjs +352 -0
  132. package/dist/index-DhN9vL4k.js +138 -0
  133. package/dist/index-DvllakY0.mjs +274 -0
  134. package/dist/index-Ho06VKh2.mjs +151 -0
  135. package/dist/index-a8mS2Eh1.js +1062 -0
  136. package/dist/index-aamBi9Tu.js +1 -0
  137. package/dist/index.cjs.js +1 -0
  138. package/dist/index.es.js +14 -0
  139. package/dist/onramp-DLlhSPQg.js +422 -0
  140. package/dist/onramp-k-EAEepC.mjs +842 -0
  141. package/dist/parseSignature-D1tZHglo.js +16 -0
  142. package/dist/parseSignature-DM0lwcDr.mjs +8883 -0
  143. package/dist/pay-with-exchange---G2M1Ag.js +280 -0
  144. package/dist/pay-with-exchange-CFIcUXUe.mjs +512 -0
  145. package/dist/property-Bd8U3_QP.mjs +618 -0
  146. package/dist/property-DissjCbZ.js +27 -0
  147. package/dist/receive-B9LCljO6.mjs +228 -0
  148. package/dist/receive-E8H6GDOX.js +131 -0
  149. package/dist/send-B-AooLph.js +554 -0
  150. package/dist/send-DZd_xhsd.mjs +1155 -0
  151. package/dist/socials-ChWFLEFe.mjs +611 -0
  152. package/dist/socials-YSUYSh8o.js +250 -0
  153. package/dist/swaps-DpR9W9Ld.js +1050 -0
  154. package/dist/swaps-Du7-Ui_V.mjs +1752 -0
  155. package/dist/transactions-DhsK5-QJ.mjs +35 -0
  156. package/dist/transactions-VPsz2OLe.js +16 -0
  157. package/dist/w3m-modal-DhomfjKU.js +891 -0
  158. package/dist/w3m-modal-KuYD-zqQ.mjs +1759 -0
  159. package/package.json +51 -0
  160. package/readme.md +1 -0
@@ -0,0 +1,352 @@
1
+ import { bR as C, bS as O, bT as P, bU as h, bV as w, bW as v, bX as l, c0 as E, cv as d, b$ as x, cw as g, c3 as S, ci as $, cc as R, c4 as T } from "./index-B6Mg114Z.mjs";
2
+ const L = C`
3
+ :host {
4
+ position: relative;
5
+ display: inline-block;
6
+ }
7
+
8
+ input {
9
+ width: 48px;
10
+ height: 48px;
11
+ background: ${({ tokens: n }) => n.theme.foregroundPrimary};
12
+ border-radius: ${({ borderRadius: n }) => n[4]};
13
+ border: 1px solid ${({ tokens: n }) => n.theme.borderPrimary};
14
+ font-family: ${({ fontFamily: n }) => n.regular};
15
+ font-size: ${({ textSize: n }) => n.large};
16
+ line-height: 18px;
17
+ letter-spacing: -0.16px;
18
+ text-align: center;
19
+ color: ${({ tokens: n }) => n.theme.textPrimary};
20
+ caret-color: ${({ tokens: n }) => n.core.textAccentPrimary};
21
+ transition:
22
+ background-color ${({ durations: n }) => n.lg}
23
+ ${({ easings: n }) => n["ease-out-power-2"]},
24
+ border-color ${({ durations: n }) => n.lg}
25
+ ${({ easings: n }) => n["ease-out-power-2"]},
26
+ box-shadow ${({ durations: n }) => n.lg}
27
+ ${({ easings: n }) => n["ease-out-power-2"]};
28
+ will-change: background-color, border-color, box-shadow;
29
+ box-sizing: border-box;
30
+ -webkit-appearance: none;
31
+ -moz-appearance: textfield;
32
+ padding: ${({ spacing: n }) => n[4]};
33
+ }
34
+
35
+ input::-webkit-outer-spin-button,
36
+ input::-webkit-inner-spin-button {
37
+ -webkit-appearance: none;
38
+ margin: 0;
39
+ }
40
+
41
+ input[type='number'] {
42
+ -moz-appearance: textfield;
43
+ }
44
+
45
+ input:disabled {
46
+ cursor: not-allowed;
47
+ opacity: 0.5;
48
+ }
49
+
50
+ input:focus-visible:enabled {
51
+ background-color: transparent;
52
+ border: 1px solid ${({ tokens: n }) => n.theme.borderSecondary};
53
+ box-shadow: 0px 0px 0px 4px ${({ tokens: n }) => n.core.foregroundAccent040};
54
+ }
55
+ `;
56
+ var y = function(n, t, e, i) {
57
+ var s = arguments.length, o = s < 3 ? t : i === null ? i = Object.getOwnPropertyDescriptor(t, e) : i, r;
58
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o = Reflect.decorate(n, t, e, i);
59
+ else for (var a = n.length - 1; a >= 0; a--) (r = n[a]) && (o = (s < 3 ? r(o) : s > 3 ? r(t, e, o) : r(t, e)) || o);
60
+ return s > 3 && o && Object.defineProperty(t, e, o), o;
61
+ };
62
+ let p = class extends v {
63
+ constructor() {
64
+ super(...arguments), this.disabled = !1, this.value = "";
65
+ }
66
+ render() {
67
+ return l`<input
68
+ type="number"
69
+ maxlength="1"
70
+ inputmode="numeric"
71
+ autofocus
72
+ ?disabled=${this.disabled}
73
+ value=${this.value}
74
+ /> `;
75
+ }
76
+ };
77
+ p.styles = [O, P, L];
78
+ y([
79
+ h({ type: Boolean })
80
+ ], p.prototype, "disabled", void 0);
81
+ y([
82
+ h({ type: String })
83
+ ], p.prototype, "value", void 0);
84
+ p = y([
85
+ w("wui-input-numeric")
86
+ ], p);
87
+ const _ = E`
88
+ :host {
89
+ position: relative;
90
+ display: block;
91
+ }
92
+ `;
93
+ var m = function(n, t, e, i) {
94
+ var s = arguments.length, o = s < 3 ? t : i === null ? i = Object.getOwnPropertyDescriptor(t, e) : i, r;
95
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o = Reflect.decorate(n, t, e, i);
96
+ else for (var a = n.length - 1; a >= 0; a--) (r = n[a]) && (o = (s < 3 ? r(o) : s > 3 ? r(t, e, o) : r(t, e)) || o);
97
+ return s > 3 && o && Object.defineProperty(t, e, o), o;
98
+ };
99
+ let c = class extends v {
100
+ constructor() {
101
+ 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) => {
102
+ const i = t.target, s = this.getInputElement(i), o = ["ArrowLeft", "ArrowRight", "Shift", "Delete"];
103
+ if (!s)
104
+ return;
105
+ o.includes(t.key) && t.preventDefault();
106
+ const r = s.selectionStart;
107
+ switch (t.key) {
108
+ case "ArrowLeft":
109
+ r && s.setSelectionRange(r + 1, r + 1), this.focusInputField("prev", e);
110
+ break;
111
+ case "ArrowRight":
112
+ this.focusInputField("next", e);
113
+ break;
114
+ case "Shift":
115
+ this.focusInputField("next", e);
116
+ break;
117
+ case "Delete":
118
+ s.value === "" ? this.focusInputField("prev", e) : this.updateInput(s, e, "");
119
+ break;
120
+ case "Backspace":
121
+ s.value === "" ? this.focusInputField("prev", e) : this.updateInput(s, e, "");
122
+ break;
123
+ }
124
+ }, this.focusInputField = (t, e) => {
125
+ if (t === "next") {
126
+ const i = e + 1;
127
+ if (!this.shouldInputBeEnabled(i))
128
+ return;
129
+ const s = this.numerics[i < this.length ? i : e], o = s ? this.getInputElement(s) : void 0;
130
+ o && (o.disabled = !1, o.focus());
131
+ }
132
+ if (t === "prev") {
133
+ const i = e - 1, s = this.numerics[i > -1 ? i : e], o = s ? this.getInputElement(s) : void 0;
134
+ o && o.focus();
135
+ }
136
+ };
137
+ }
138
+ firstUpdated() {
139
+ var e, i;
140
+ this.otp && (this.values = this.otp.split(""));
141
+ const t = (e = this.shadowRoot) == null ? void 0 : e.querySelectorAll("wui-input-numeric");
142
+ t && (this.numerics = Array.from(t)), (i = this.numerics[0]) == null || i.focus();
143
+ }
144
+ render() {
145
+ return l`
146
+ <wui-flex gap="1" data-testid="wui-otp-input">
147
+ ${Array.from({ length: this.length }).map((t, e) => l`
148
+ <wui-input-numeric
149
+ @input=${(i) => this.handleInput(i, e)}
150
+ @click=${(i) => this.selectInput(i)}
151
+ @keydown=${(i) => this.handleKeyDown(i, e)}
152
+ .disabled=${!this.shouldInputBeEnabled(e)}
153
+ .value=${this.values[e] || ""}
154
+ >
155
+ </wui-input-numeric>
156
+ `)}
157
+ </wui-flex>
158
+ `;
159
+ }
160
+ updateInput(t, e, i) {
161
+ const s = this.numerics[e], o = t || (s ? this.getInputElement(s) : void 0);
162
+ o && (o.value = i, this.values = this.values.map((r, a) => a === e ? i : r));
163
+ }
164
+ selectInput(t) {
165
+ const e = t.target;
166
+ if (e) {
167
+ const i = this.getInputElement(e);
168
+ i == null || i.select();
169
+ }
170
+ }
171
+ handleInput(t, e) {
172
+ const i = t.target, s = this.getInputElement(i);
173
+ if (s) {
174
+ const o = s.value;
175
+ t.inputType === "insertFromPaste" ? this.handlePaste(s, o, e) : x.isNumber(o) && t.data ? (this.updateInput(s, e, t.data), this.focusInputField("next", e)) : this.updateInput(s, e, "");
176
+ }
177
+ this.dispatchInputChangeEvent();
178
+ }
179
+ handlePaste(t, e, i) {
180
+ const s = e[0];
181
+ if (s && x.isNumber(s)) {
182
+ this.updateInput(t, i, s);
183
+ const r = e.substring(1);
184
+ if (i + 1 < this.length && r.length) {
185
+ const a = this.numerics[i + 1], I = a ? this.getInputElement(a) : void 0;
186
+ I && this.handlePaste(I, r, i + 1);
187
+ } else
188
+ this.focusInputField("next", i);
189
+ } else
190
+ this.updateInput(t, i, "");
191
+ }
192
+ getInputElement(t) {
193
+ var e;
194
+ return (e = t.shadowRoot) != null && e.querySelector("input") ? t.shadowRoot.querySelector("input") : null;
195
+ }
196
+ dispatchInputChangeEvent() {
197
+ const t = this.values.join("");
198
+ this.dispatchEvent(new CustomEvent("inputChange", {
199
+ detail: t,
200
+ bubbles: !0,
201
+ composed: !0
202
+ }));
203
+ }
204
+ };
205
+ c.styles = [O, _];
206
+ m([
207
+ h({ type: Number })
208
+ ], c.prototype, "length", void 0);
209
+ m([
210
+ h({ type: String })
211
+ ], c.prototype, "otp", void 0);
212
+ m([
213
+ d()
214
+ ], c.prototype, "values", void 0);
215
+ c = m([
216
+ w("wui-otp")
217
+ ], c);
218
+ const k = E`
219
+ wui-loading-spinner {
220
+ margin: 9px auto;
221
+ }
222
+
223
+ .email-display,
224
+ .email-display wui-text {
225
+ max-width: 100%;
226
+ }
227
+ `;
228
+ var f = function(n, t, e, i) {
229
+ var s = arguments.length, o = s < 3 ? t : i === null ? i = Object.getOwnPropertyDescriptor(t, e) : i, r;
230
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o = Reflect.decorate(n, t, e, i);
231
+ else for (var a = n.length - 1; a >= 0; a--) (r = n[a]) && (o = (s < 3 ? r(o) : s > 3 ? r(t, e, o) : r(t, e)) || o);
232
+ return s > 3 && o && Object.defineProperty(t, e, o), o;
233
+ }, b;
234
+ let u = b = class extends v {
235
+ firstUpdated() {
236
+ this.startOTPTimeout();
237
+ }
238
+ disconnectedCallback() {
239
+ clearTimeout(this.OTPTimeout);
240
+ }
241
+ constructor() {
242
+ var t;
243
+ 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 = $.getAuthConnector();
244
+ }
245
+ render() {
246
+ if (!this.email)
247
+ throw new Error("w3m-email-otp-widget: No email provided");
248
+ const t = !!this.timeoutTimeLeft, e = this.getFooterLabels(t);
249
+ return l`
250
+ <wui-flex
251
+ flexDirection="column"
252
+ alignItems="center"
253
+ .padding=${["4", "0", "4", "0"]}
254
+ gap="4"
255
+ >
256
+ <wui-flex
257
+ class="email-display"
258
+ flexDirection="column"
259
+ alignItems="center"
260
+ .padding=${["0", "5", "0", "5"]}
261
+ >
262
+ <wui-text variant="md-regular" color="primary" align="center">
263
+ Enter the code we sent to
264
+ </wui-text>
265
+ <wui-text variant="md-medium" color="primary" lineClamp="1" align="center">
266
+ ${this.email}
267
+ </wui-text>
268
+ </wui-flex>
269
+
270
+ <wui-text variant="sm-regular" color="secondary">The code expires in 20 minutes</wui-text>
271
+
272
+ ${this.loading ? l`<wui-loading-spinner size="xl" color="accent-primary"></wui-loading-spinner>` : l` <wui-flex flexDirection="column" alignItems="center" gap="2">
273
+ <wui-otp
274
+ dissabled
275
+ length="6"
276
+ @inputChange=${this.onOtpInputChange.bind(this)}
277
+ .otp=${this.otp}
278
+ ></wui-otp>
279
+ ${this.error ? l`
280
+ <wui-text variant="sm-regular" align="center" color="error">
281
+ ${this.error}. Try Again
282
+ </wui-text>
283
+ ` : null}
284
+ </wui-flex>`}
285
+
286
+ <wui-flex alignItems="center" gap="2">
287
+ <wui-text variant="sm-regular" color="secondary">${e.title}</wui-text>
288
+ <wui-link @click=${this.onResendCode.bind(this)} .disabled=${t}>
289
+ ${e.action}
290
+ </wui-link>
291
+ </wui-flex>
292
+ </wui-flex>
293
+ `;
294
+ }
295
+ startOTPTimeout() {
296
+ this.timeoutTimeLeft = g.getTimeToNextEmailLogin(), this.OTPTimeout = setInterval(() => {
297
+ this.timeoutTimeLeft > 0 ? this.timeoutTimeLeft = g.getTimeToNextEmailLogin() : clearInterval(this.OTPTimeout);
298
+ }, 1e3);
299
+ }
300
+ async onOtpInputChange(t) {
301
+ var e;
302
+ try {
303
+ this.loading || (this.otp = t.detail, this.shouldSubmitOnOtpChange() && (this.loading = !0, await ((e = this.onOtpSubmit) == null ? void 0 : e.call(this, this.otp))));
304
+ } catch (i) {
305
+ this.error = R.parseError(i), this.loading = !1;
306
+ }
307
+ }
308
+ async onResendCode() {
309
+ try {
310
+ if (this.onOtpResend) {
311
+ if (!this.loading && !this.timeoutTimeLeft) {
312
+ if (this.error = "", this.otp = "", !$.getAuthConnector() || !this.email)
313
+ throw new Error("w3m-email-otp-widget: Unable to resend email");
314
+ this.loading = !0, await this.onOtpResend(this.email), this.startOTPTimeout(), T.showSuccess("Code email resent");
315
+ }
316
+ } else this.onStartOver && this.onStartOver();
317
+ } catch (t) {
318
+ T.showError(t);
319
+ } finally {
320
+ this.loading = !1;
321
+ }
322
+ }
323
+ getFooterLabels(t) {
324
+ return this.onStartOver ? {
325
+ title: "Something wrong?",
326
+ action: `Try again ${t ? `in ${this.timeoutTimeLeft}s` : ""}`
327
+ } : {
328
+ title: "Didn't receive it?",
329
+ action: `Resend ${t ? `in ${this.timeoutTimeLeft}s` : "Code"}`
330
+ };
331
+ }
332
+ shouldSubmitOnOtpChange() {
333
+ return this.authConnector && this.otp.length === b.OTP_LENGTH;
334
+ }
335
+ };
336
+ u.OTP_LENGTH = 6;
337
+ u.styles = k;
338
+ f([
339
+ d()
340
+ ], u.prototype, "loading", void 0);
341
+ f([
342
+ d()
343
+ ], u.prototype, "timeoutTimeLeft", void 0);
344
+ f([
345
+ d()
346
+ ], u.prototype, "error", void 0);
347
+ u = b = f([
348
+ w("w3m-email-otp-widget")
349
+ ], u);
350
+ export {
351
+ u as W
352
+ };
@@ -0,0 +1,138 @@
1
+ "use strict";const t=require("./index-CjZQCcwG.js"),u=t.css`
2
+ button {
3
+ display: block;
4
+ display: flex;
5
+ align-items: center;
6
+ padding: ${({spacing:e})=>e[1]};
7
+ transition: background-color ${({durations:e})=>e.lg}
8
+ ${({easings:e})=>e["ease-out-power-2"]};
9
+ will-change: background-color;
10
+ background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
11
+ border-radius: ${({borderRadius:e})=>e[32]};
12
+ }
13
+
14
+ wui-image {
15
+ border-radius: ${({borderRadius:e})=>e[32]};
16
+ }
17
+
18
+ wui-text {
19
+ padding-left: ${({spacing:e})=>e[1]};
20
+ padding-right: ${({spacing:e})=>e[1]};
21
+ }
22
+
23
+ .left-icon-container {
24
+ width: 24px;
25
+ height: 24px;
26
+ justify-content: center;
27
+ align-items: center;
28
+ }
29
+
30
+ .left-image-container {
31
+ position: relative;
32
+ justify-content: center;
33
+ align-items: center;
34
+ }
35
+
36
+ .chain-image {
37
+ position: absolute;
38
+ border: 1px solid ${({tokens:e})=>e.theme.foregroundPrimary};
39
+ }
40
+
41
+ /* -- Sizes --------------------------------------------------- */
42
+ button[data-size='lg'] {
43
+ height: 32px;
44
+ }
45
+
46
+ button[data-size='md'] {
47
+ height: 28px;
48
+ }
49
+
50
+ button[data-size='sm'] {
51
+ height: 24px;
52
+ }
53
+
54
+ button[data-size='lg'] .token-image {
55
+ width: 24px;
56
+ height: 24px;
57
+ }
58
+
59
+ button[data-size='md'] .token-image {
60
+ width: 20px;
61
+ height: 20px;
62
+ }
63
+
64
+ button[data-size='sm'] .token-image {
65
+ width: 16px;
66
+ height: 16px;
67
+ }
68
+
69
+ button[data-size='lg'] .left-icon-container {
70
+ width: 24px;
71
+ height: 24px;
72
+ }
73
+
74
+ button[data-size='md'] .left-icon-container {
75
+ width: 20px;
76
+ height: 20px;
77
+ }
78
+
79
+ button[data-size='sm'] .left-icon-container {
80
+ width: 16px;
81
+ height: 16px;
82
+ }
83
+
84
+ button[data-size='lg'] .chain-image {
85
+ width: 12px;
86
+ height: 12px;
87
+ bottom: 2px;
88
+ right: -4px;
89
+ }
90
+
91
+ button[data-size='md'] .chain-image {
92
+ width: 10px;
93
+ height: 10px;
94
+ bottom: 2px;
95
+ right: -4px;
96
+ }
97
+
98
+ button[data-size='sm'] .chain-image {
99
+ width: 8px;
100
+ height: 8px;
101
+ bottom: 2px;
102
+ right: -3px;
103
+ }
104
+
105
+ /* -- Focus states --------------------------------------------------- */
106
+ button:focus-visible:enabled {
107
+ background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
108
+ box-shadow: 0 0 0 4px ${({tokens:e})=>e.core.foregroundAccent040};
109
+ }
110
+
111
+ /* -- Hover & Active states ----------------------------------------------------------- */
112
+ @media (hover: hover) {
113
+ button:hover:enabled,
114
+ button:active:enabled {
115
+ background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
116
+ }
117
+ }
118
+
119
+ /* -- Disabled states --------------------------------------------------- */
120
+ button:disabled {
121
+ background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
122
+ opacity: 0.5;
123
+ }
124
+ `;var a=function(e,i,r,s){var d=arguments.length,n=d<3?i:s===null?s=Object.getOwnPropertyDescriptor(i,r):s,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,i,r,s);else for(var l=e.length-1;l>=0;l--)(c=e[l])&&(n=(d<3?c(n):d>3?c(i,r,n):c(i,r))||n);return d>3&&n&&Object.defineProperty(i,r,n),n};const h={lg:"lg-regular",md:"lg-regular",sm:"md-regular"},g={lg:"lg",md:"md",sm:"sm"};let o=class extends t.i{constructor(){super(...arguments),this.size="md",this.disabled=!1,this.text="",this.loading=!1}render(){return this.loading?t.b` <wui-flex alignItems="center" gap="01" padding="01">
125
+ <wui-shimmer width="20px" height="20px"></wui-shimmer>
126
+ <wui-shimmer width="32px" height="18px" borderRadius="4xs"></wui-shimmer>
127
+ </wui-flex>`:t.b`
128
+ <button ?disabled=${this.disabled} data-size=${this.size}>
129
+ ${this.imageTemplate()} ${this.textTemplate()}
130
+ </button>
131
+ `}imageTemplate(){if(this.imageSrc&&this.chainImageSrc)return t.b`<wui-flex class="left-image-container">
132
+ <wui-image src=${this.imageSrc} class="token-image"></wui-image>
133
+ <wui-image src=${this.chainImageSrc} class="chain-image"></wui-image>
134
+ </wui-flex>`;if(this.imageSrc)return t.b`<wui-image src=${this.imageSrc} class="token-image"></wui-image>`;const i=g[this.size];return t.b`<wui-flex class="left-icon-container">
135
+ <wui-icon size=${i} name="networkPlaceholder"></wui-icon>
136
+ </wui-flex>`}textTemplate(){const i=h[this.size];return t.b`<wui-text color="primary" variant=${i}
137
+ >${this.text}</wui-text
138
+ >`}};o.styles=[t.resetStyles,t.elementStyles,u];a([t.n()],o.prototype,"size",void 0);a([t.n()],o.prototype,"imageSrc",void 0);a([t.n()],o.prototype,"chainImageSrc",void 0);a([t.n({type:Boolean})],o.prototype,"disabled",void 0);a([t.n()],o.prototype,"text",void 0);a([t.n({type:Boolean})],o.prototype,"loading",void 0);o=a([t.customElement("wui-token-button")],o);