@directcryptopay/sdk 0.2.4 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +51 -87
- package/dist/core/config.d.ts +9 -46
- package/dist/core/iframe.d.ts +16 -0
- package/dist/dcp-sdk.umd.js +1 -12811
- package/dist/dcp.d.ts +12 -5
- package/dist/index.d.ts +1 -1
- package/dist/index.js +219 -2
- package/dist/types.d.ts +26 -164
- package/package.json +3 -13
- package/dist/ExchangeController-CbO41bcH.js +0 -217
- package/dist/HelpersUtil-DHm6EVSE.js +0 -120
- package/dist/NavigationUtil-kj9LEOOd.js +0 -8
- package/dist/PhArrowCircleDown-lsK25DCk.js +0 -73
- package/dist/PhArrowClockwise-NeKHZ1co.js +0 -73
- package/dist/PhArrowDown-C9AkNvLs.js +0 -73
- package/dist/PhArrowLeft-RNfIQP1X.js +0 -73
- package/dist/PhArrowRight-DM1tna0G.js +0 -73
- package/dist/PhArrowSquareOut-S5XYbAZj.js +0 -73
- package/dist/PhArrowUp-DmktzOWy.js +0 -73
- package/dist/PhArrowUpRight-BkNeW_5i.js +0 -73
- package/dist/PhArrowsClockwise-CQ4pG76b.js +0 -73
- package/dist/PhArrowsDownUp-H6gxaNM6.js +0 -73
- package/dist/PhArrowsLeftRight-DZSsfMR6.js +0 -73
- package/dist/PhBank-4_9QzqIB.js +0 -73
- package/dist/PhBrowser-B-JSznId.js +0 -73
- package/dist/PhCaretDown-vV5oHMNi.js +0 -73
- package/dist/PhCaretLeft-BLo6Y_f4.js +0 -73
- package/dist/PhCaretRight-CqQN4TT3.js +0 -73
- package/dist/PhCaretUp-Df7UCAHy.js +0 -73
- package/dist/PhCheck-gtpfK4ed.js +0 -73
- package/dist/PhCircleHalf-Uq7dwDYw.js +0 -73
- package/dist/PhClock-SDCW-NmF.js +0 -73
- package/dist/PhCompass-B7hgtdx-.js +0 -73
- package/dist/PhCopy-BcnhyXCy.js +0 -73
- package/dist/PhCreditCard-BJjByVgu.js +0 -73
- package/dist/PhCurrencyDollar-B7ZXqXBy.js +0 -73
- package/dist/PhDesktop-B3VKPuJx.js +0 -73
- package/dist/PhDeviceMobile-Bnd0TYEH.js +0 -73
- package/dist/PhDotsThree-yyMWyZ-R.js +0 -73
- package/dist/PhEnvelope-67uzHbI9.js +0 -73
- package/dist/PhFunnelSimple-B-DCsloI.js +0 -73
- package/dist/PhGlobe-TMm_6qGk.js +0 -73
- package/dist/PhIdentificationCard-CePPD2xc.js +0 -73
- package/dist/PhImage-gY96WtHR.js +0 -73
- package/dist/PhInfo-DRQM_ZDP.js +0 -73
- package/dist/PhLightbulb-B0TxPfZ1.js +0 -73
- package/dist/PhMagnifyingGlass-B8si5_6W.js +0 -73
- package/dist/PhPaperPlaneRight-DVu5PLYd.js +0 -73
- package/dist/PhPlus-BfTsQnUz.js +0 -73
- package/dist/PhPower-CxYUGOWn.js +0 -73
- package/dist/PhPuzzlePiece-CQ4wh0gV.js +0 -73
- package/dist/PhQrCode-BuJ97NYJ.js +0 -73
- package/dist/PhQuestion-kJoP8Mja.js +0 -73
- package/dist/PhQuestionMark-C46ZkFpu.js +0 -73
- package/dist/PhSealCheck-Eh8jVqSN.js +0 -73
- package/dist/PhSignOut-jk97OSVt.js +0 -73
- package/dist/PhSpinner-CiYOhwMg.js +0 -73
- package/dist/PhTrash-pxerMqzd.js +0 -73
- package/dist/PhUser-BMg0VV4A.js +0 -73
- package/dist/PhVault-DYQvx5A-.js +0 -73
- package/dist/PhWarning-NLC5Mj87.js +0 -73
- package/dist/PhWarningCircle-Ch2jU9fA.js +0 -73
- package/dist/PhX-Bx4wpwm3.js +0 -73
- package/dist/SwapController-Ch0FFTEt.js +0 -457
- package/dist/ccip-BrGhNXIM.js +0 -150
- package/dist/core/api.d.ts +0 -39
- package/dist/core/logic.d.ts +0 -2
- package/dist/core/wallet.d.ts +0 -55
- package/dist/data-capture-CpafmuCb.js +0 -490
- package/dist/email-Dcg4jlai.js +0 -344
- package/dist/embedded-wallet-DeoRdAPw.js +0 -820
- package/dist/features-B9Nde43h.js +0 -274
- package/dist/hashTypedData-a7b8tdkO.js +0 -197
- package/dist/if-defined-k21LutCn.js +0 -10
- package/dist/index-9vLw53Xl.js +0 -228
- package/dist/index-B5wUyynz.js +0 -107
- package/dist/index-B8LkUrww.js +0 -86
- package/dist/index-BA0VwKg0.js +0 -8189
- package/dist/index-BB9JJ24N.js +0 -125
- package/dist/index-BCkEvPQ6.js +0 -172
- package/dist/index-BDeO_csr.js +0 -171
- package/dist/index-Bb7babLF.js +0 -1281
- package/dist/index-BjOhprVS.js +0 -199
- package/dist/index-BjyMgZsf.js +0 -218
- package/dist/index-BkThIDLX.js +0 -159
- package/dist/index-BmFs6nb7.js +0 -209
- package/dist/index-C1QEJL-2.js +0 -572
- package/dist/index-C4qc4PdD.js +0 -387
- package/dist/index-CAPvUh14.js +0 -1750
- package/dist/index-CBMU3PTE.js +0 -65
- package/dist/index-CGwPkJLF.js +0 -355
- package/dist/index-CNGEqX3D.js +0 -153
- package/dist/index-CRlCq6IB.js +0 -7981
- package/dist/index-Cg_o-i9X.js +0 -118
- package/dist/index-D1BvhCbI.js +0 -62
- package/dist/index-DFi8TiHc.js +0 -128
- package/dist/index-DLwuveL9.js +0 -555
- package/dist/index-DMn7ktUQ.js +0 -56
- package/dist/index-DOXwtuwa.js +0 -117
- package/dist/index-DPPOW_Tp.js +0 -118
- package/dist/index-DQpzHpW-.js +0 -517
- package/dist/index-DXHg5C-W.js +0 -276
- package/dist/index-DcYjZV4H.js +0 -110
- package/dist/index-DeL88Lwc.js +0 -41655
- package/dist/index-DrWVlf8b.js +0 -46
- package/dist/index-Dsfuc4rB.js +0 -123
- package/dist/index-DuTny38n.js +0 -1175
- package/dist/index-Nfjb6bV0.js +0 -21991
- package/dist/index-WwwdQSN2.js +0 -85
- package/dist/index-Yha9Afch.js +0 -174
- package/dist/index-cbQHN7GC.js +0 -100
- package/dist/index-hyG3cYsv.js +0 -1083
- package/dist/index-qLxmmPaL.js +0 -257
- package/dist/localBatchGatewayRequest-vfcvRH0G.js +0 -91
- package/dist/onramp-BSiyOX4L.js +0 -855
- package/dist/parseSignature-CdCMAPZN.js +0 -3304
- package/dist/pay-with-exchange-CduNoMEz.js +0 -525
- package/dist/property-Bd8U3_QP.js +0 -618
- package/dist/receive-CrmptJlq.js +0 -232
- package/dist/ref-SOwYtCZb.js +0 -107
- package/dist/send-oMcHMEr6.js +0 -1166
- package/dist/socials-C0A4-FbY.js +0 -620
- package/dist/swaps-CbJJ9Ciu.js +0 -1760
- package/dist/transactions-BDfCoBS5.js +0 -37
- package/dist/ui/Modal.d.ts +0 -9
- package/dist/ui/index.d.ts +0 -6
- package/dist/w3m-modal-BjsTkny7.js +0 -1706
|
@@ -1,1706 +0,0 @@
|
|
|
1
|
-
import { df as x, dK as ae, d0 as c, d1 as de, cU as C, cV as L, cX as y, cY as d, d6 as _, cW as ue, cZ as D, cE as g, dh as j, dH as he, dg as V, cF as U, cM as R, d8 as F, c_ as pe, cH as O, dw as z, di as me, dL as fe, dM as we } from "./index-DeL88Lwc.js";
|
|
2
|
-
import { c as w, n as l, r as u, U as ne } from "./index-DuTny38n.js";
|
|
3
|
-
import { o as W } from "./if-defined-k21LutCn.js";
|
|
4
|
-
import "./index-BCkEvPQ6.js";
|
|
5
|
-
import "./index-DFi8TiHc.js";
|
|
6
|
-
import { H as ee } from "./HelpersUtil-DHm6EVSE.js";
|
|
7
|
-
import "./index-B8LkUrww.js";
|
|
8
|
-
import "./index-Cg_o-i9X.js";
|
|
9
|
-
import "./index-BkThIDLX.js";
|
|
10
|
-
import "./index-DLwuveL9.js";
|
|
11
|
-
import { S as be } from "./SwapController-Ch0FFTEt.js";
|
|
12
|
-
import "./index-BmFs6nb7.js";
|
|
13
|
-
const se = {
|
|
14
|
-
isUnsupportedChainView() {
|
|
15
|
-
return c.state.view === "UnsupportedChain" || c.state.view === "SwitchNetwork" && c.state.history.includes("UnsupportedChain");
|
|
16
|
-
},
|
|
17
|
-
async safeClose() {
|
|
18
|
-
if (this.isUnsupportedChainView()) {
|
|
19
|
-
x.shake();
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
if (await ae.isSIWXCloseDisabled()) {
|
|
23
|
-
x.shake();
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
(c.state.view === "DataCapture" || c.state.view === "DataCaptureOtpConfirm") && de.disconnect(), x.close();
|
|
27
|
-
}
|
|
28
|
-
}, ge = C`
|
|
29
|
-
:host {
|
|
30
|
-
display: block;
|
|
31
|
-
border-radius: clamp(0px, ${({ borderRadius: e }) => e[8]}, 44px);
|
|
32
|
-
box-shadow: 0 0 0 1px ${({ tokens: e }) => e.theme.foregroundPrimary};
|
|
33
|
-
overflow: hidden;
|
|
34
|
-
}
|
|
35
|
-
`;
|
|
36
|
-
var ye = function(e, t, i, r) {
|
|
37
|
-
var a = arguments.length, o = a < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, n;
|
|
38
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o = Reflect.decorate(e, t, i, r);
|
|
39
|
-
else for (var s = e.length - 1; s >= 0; s--) (n = e[s]) && (o = (a < 3 ? n(o) : a > 3 ? n(t, i, o) : n(t, i)) || o);
|
|
40
|
-
return a > 3 && o && Object.defineProperty(t, i, o), o;
|
|
41
|
-
};
|
|
42
|
-
let K = class extends y {
|
|
43
|
-
render() {
|
|
44
|
-
return d`<slot></slot>`;
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
K.styles = [L, ge];
|
|
48
|
-
K = ye([
|
|
49
|
-
w("wui-card")
|
|
50
|
-
], K);
|
|
51
|
-
const ve = C`
|
|
52
|
-
:host {
|
|
53
|
-
width: 100%;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
:host > wui-flex {
|
|
57
|
-
width: 100%;
|
|
58
|
-
display: flex;
|
|
59
|
-
align-items: center;
|
|
60
|
-
justify-content: center;
|
|
61
|
-
gap: ${({ spacing: e }) => e[2]};
|
|
62
|
-
padding: ${({ spacing: e }) => e[3]};
|
|
63
|
-
border-radius: ${({ borderRadius: e }) => e[6]};
|
|
64
|
-
border: 1px solid ${({ tokens: e }) => e.theme.borderPrimary};
|
|
65
|
-
box-sizing: border-box;
|
|
66
|
-
background-color: ${({ tokens: e }) => e.theme.foregroundPrimary};
|
|
67
|
-
box-shadow: 0px 0px 16px 0px rgba(0, 0, 0, 0.25);
|
|
68
|
-
color: ${({ tokens: e }) => e.theme.textPrimary};
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
:host > wui-flex[data-type='info'] {
|
|
72
|
-
.icon-box {
|
|
73
|
-
background-color: ${({ tokens: e }) => e.theme.foregroundSecondary};
|
|
74
|
-
|
|
75
|
-
wui-icon {
|
|
76
|
-
color: ${({ tokens: e }) => e.theme.iconDefault};
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
:host > wui-flex[data-type='success'] {
|
|
81
|
-
.icon-box {
|
|
82
|
-
background-color: ${({ tokens: e }) => e.core.backgroundSuccess};
|
|
83
|
-
|
|
84
|
-
wui-icon {
|
|
85
|
-
color: ${({ tokens: e }) => e.core.borderSuccess};
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
:host > wui-flex[data-type='warning'] {
|
|
90
|
-
.icon-box {
|
|
91
|
-
background-color: ${({ tokens: e }) => e.core.backgroundWarning};
|
|
92
|
-
|
|
93
|
-
wui-icon {
|
|
94
|
-
color: ${({ tokens: e }) => e.core.borderWarning};
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
:host > wui-flex[data-type='error'] {
|
|
99
|
-
.icon-box {
|
|
100
|
-
background-color: ${({ tokens: e }) => e.core.backgroundError};
|
|
101
|
-
|
|
102
|
-
wui-icon {
|
|
103
|
-
color: ${({ tokens: e }) => e.core.borderError};
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
wui-flex {
|
|
109
|
-
width: 100%;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
wui-text {
|
|
113
|
-
word-break: break-word;
|
|
114
|
-
flex: 1;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
.close {
|
|
118
|
-
cursor: pointer;
|
|
119
|
-
color: ${({ tokens: e }) => e.theme.iconDefault};
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
.icon-box {
|
|
123
|
-
height: 40px;
|
|
124
|
-
width: 40px;
|
|
125
|
-
border-radius: ${({ borderRadius: e }) => e[2]};
|
|
126
|
-
background-color: var(--local-icon-bg-value);
|
|
127
|
-
}
|
|
128
|
-
`;
|
|
129
|
-
var X = function(e, t, i, r) {
|
|
130
|
-
var a = arguments.length, o = a < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, n;
|
|
131
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o = Reflect.decorate(e, t, i, r);
|
|
132
|
-
else for (var s = e.length - 1; s >= 0; s--) (n = e[s]) && (o = (a < 3 ? n(o) : a > 3 ? n(t, i, o) : n(t, i)) || o);
|
|
133
|
-
return a > 3 && o && Object.defineProperty(t, i, o), o;
|
|
134
|
-
};
|
|
135
|
-
const xe = {
|
|
136
|
-
info: "info",
|
|
137
|
-
success: "checkmark",
|
|
138
|
-
warning: "warningCircle",
|
|
139
|
-
error: "warning"
|
|
140
|
-
};
|
|
141
|
-
let N = class extends y {
|
|
142
|
-
constructor() {
|
|
143
|
-
super(...arguments), this.message = "", this.type = "info";
|
|
144
|
-
}
|
|
145
|
-
render() {
|
|
146
|
-
return d`
|
|
147
|
-
<wui-flex
|
|
148
|
-
data-type=${W(this.type)}
|
|
149
|
-
flexDirection="row"
|
|
150
|
-
justifyContent="space-between"
|
|
151
|
-
alignItems="center"
|
|
152
|
-
gap="2"
|
|
153
|
-
>
|
|
154
|
-
<wui-flex columnGap="2" flexDirection="row" alignItems="center">
|
|
155
|
-
<wui-flex
|
|
156
|
-
flexDirection="row"
|
|
157
|
-
alignItems="center"
|
|
158
|
-
justifyContent="center"
|
|
159
|
-
class="icon-box"
|
|
160
|
-
>
|
|
161
|
-
<wui-icon color="inherit" size="md" name=${xe[this.type]}></wui-icon>
|
|
162
|
-
</wui-flex>
|
|
163
|
-
<wui-text variant="md-medium" color="inherit" data-testid="wui-alertbar-text"
|
|
164
|
-
>${this.message}</wui-text
|
|
165
|
-
>
|
|
166
|
-
</wui-flex>
|
|
167
|
-
<wui-icon
|
|
168
|
-
class="close"
|
|
169
|
-
color="inherit"
|
|
170
|
-
size="sm"
|
|
171
|
-
name="close"
|
|
172
|
-
@click=${this.onClose}
|
|
173
|
-
></wui-icon>
|
|
174
|
-
</wui-flex>
|
|
175
|
-
`;
|
|
176
|
-
}
|
|
177
|
-
onClose() {
|
|
178
|
-
_.close();
|
|
179
|
-
}
|
|
180
|
-
};
|
|
181
|
-
N.styles = [L, ve];
|
|
182
|
-
X([
|
|
183
|
-
l()
|
|
184
|
-
], N.prototype, "message", void 0);
|
|
185
|
-
X([
|
|
186
|
-
l()
|
|
187
|
-
], N.prototype, "type", void 0);
|
|
188
|
-
N = X([
|
|
189
|
-
w("wui-alertbar")
|
|
190
|
-
], N);
|
|
191
|
-
const ke = C`
|
|
192
|
-
:host {
|
|
193
|
-
display: block;
|
|
194
|
-
position: absolute;
|
|
195
|
-
top: ${({ spacing: e }) => e[3]};
|
|
196
|
-
left: ${({ spacing: e }) => e[4]};
|
|
197
|
-
right: ${({ spacing: e }) => e[4]};
|
|
198
|
-
opacity: 0;
|
|
199
|
-
pointer-events: none;
|
|
200
|
-
}
|
|
201
|
-
`;
|
|
202
|
-
var le = function(e, t, i, r) {
|
|
203
|
-
var a = arguments.length, o = a < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, n;
|
|
204
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o = Reflect.decorate(e, t, i, r);
|
|
205
|
-
else for (var s = e.length - 1; s >= 0; s--) (n = e[s]) && (o = (a < 3 ? n(o) : a > 3 ? n(t, i, o) : n(t, i)) || o);
|
|
206
|
-
return a > 3 && o && Object.defineProperty(t, i, o), o;
|
|
207
|
-
};
|
|
208
|
-
const Ce = {
|
|
209
|
-
info: {
|
|
210
|
-
backgroundColor: "fg-350",
|
|
211
|
-
iconColor: "fg-325",
|
|
212
|
-
icon: "info"
|
|
213
|
-
},
|
|
214
|
-
success: {
|
|
215
|
-
backgroundColor: "success-glass-reown-020",
|
|
216
|
-
iconColor: "success-125",
|
|
217
|
-
icon: "checkmark"
|
|
218
|
-
},
|
|
219
|
-
warning: {
|
|
220
|
-
backgroundColor: "warning-glass-reown-020",
|
|
221
|
-
iconColor: "warning-100",
|
|
222
|
-
icon: "warningCircle"
|
|
223
|
-
},
|
|
224
|
-
error: {
|
|
225
|
-
backgroundColor: "error-glass-reown-020",
|
|
226
|
-
iconColor: "error-125",
|
|
227
|
-
icon: "warning"
|
|
228
|
-
}
|
|
229
|
-
};
|
|
230
|
-
let H = class extends y {
|
|
231
|
-
constructor() {
|
|
232
|
-
super(), this.unsubscribe = [], this.open = _.state.open, this.onOpen(!0), this.unsubscribe.push(_.subscribeKey("open", (t) => {
|
|
233
|
-
this.open = t, this.onOpen(!1);
|
|
234
|
-
}));
|
|
235
|
-
}
|
|
236
|
-
disconnectedCallback() {
|
|
237
|
-
this.unsubscribe.forEach((t) => t());
|
|
238
|
-
}
|
|
239
|
-
render() {
|
|
240
|
-
const { message: t, variant: i } = _.state, r = Ce[i];
|
|
241
|
-
return d`
|
|
242
|
-
<wui-alertbar
|
|
243
|
-
message=${t}
|
|
244
|
-
backgroundColor=${r == null ? void 0 : r.backgroundColor}
|
|
245
|
-
iconColor=${r == null ? void 0 : r.iconColor}
|
|
246
|
-
icon=${r == null ? void 0 : r.icon}
|
|
247
|
-
type=${i}
|
|
248
|
-
></wui-alertbar>
|
|
249
|
-
`;
|
|
250
|
-
}
|
|
251
|
-
onOpen(t) {
|
|
252
|
-
this.open ? (this.animate([
|
|
253
|
-
{ opacity: 0, transform: "scale(0.85)" },
|
|
254
|
-
{ opacity: 1, transform: "scale(1)" }
|
|
255
|
-
], {
|
|
256
|
-
duration: 150,
|
|
257
|
-
fill: "forwards",
|
|
258
|
-
easing: "ease"
|
|
259
|
-
}), this.style.cssText = "pointer-events: auto") : t || (this.animate([
|
|
260
|
-
{ opacity: 1, transform: "scale(1)" },
|
|
261
|
-
{ opacity: 0, transform: "scale(0.85)" }
|
|
262
|
-
], {
|
|
263
|
-
duration: 150,
|
|
264
|
-
fill: "forwards",
|
|
265
|
-
easing: "ease"
|
|
266
|
-
}), this.style.cssText = "pointer-events: none");
|
|
267
|
-
}
|
|
268
|
-
};
|
|
269
|
-
H.styles = ke;
|
|
270
|
-
le([
|
|
271
|
-
u()
|
|
272
|
-
], H.prototype, "open", void 0);
|
|
273
|
-
H = le([
|
|
274
|
-
w("w3m-alertbar")
|
|
275
|
-
], H);
|
|
276
|
-
const $e = C`
|
|
277
|
-
button {
|
|
278
|
-
display: block;
|
|
279
|
-
display: flex;
|
|
280
|
-
align-items: center;
|
|
281
|
-
padding: ${({ spacing: e }) => e[1]};
|
|
282
|
-
transition: background-color ${({ durations: e }) => e.lg}
|
|
283
|
-
${({ easings: e }) => e["ease-out-power-2"]};
|
|
284
|
-
will-change: background-color;
|
|
285
|
-
border-radius: ${({ borderRadius: e }) => e[32]};
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
wui-image {
|
|
289
|
-
border-radius: 100%;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
wui-text {
|
|
293
|
-
padding-left: ${({ spacing: e }) => e[1]};
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
.left-icon-container,
|
|
297
|
-
.right-icon-container {
|
|
298
|
-
width: 24px;
|
|
299
|
-
height: 24px;
|
|
300
|
-
justify-content: center;
|
|
301
|
-
align-items: center;
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
wui-icon {
|
|
305
|
-
color: ${({ tokens: e }) => e.theme.iconDefault};
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
/* -- Sizes --------------------------------------------------- */
|
|
309
|
-
button[data-size='lg'] {
|
|
310
|
-
height: 32px;
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
button[data-size='md'] {
|
|
314
|
-
height: 28px;
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
button[data-size='sm'] {
|
|
318
|
-
height: 24px;
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
button[data-size='lg'] wui-image {
|
|
322
|
-
width: 24px;
|
|
323
|
-
height: 24px;
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
button[data-size='md'] wui-image {
|
|
327
|
-
width: 20px;
|
|
328
|
-
height: 20px;
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
button[data-size='sm'] wui-image {
|
|
332
|
-
width: 16px;
|
|
333
|
-
height: 16px;
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
button[data-size='lg'] .left-icon-container {
|
|
337
|
-
width: 24px;
|
|
338
|
-
height: 24px;
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
button[data-size='md'] .left-icon-container {
|
|
342
|
-
width: 20px;
|
|
343
|
-
height: 20px;
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
button[data-size='sm'] .left-icon-container {
|
|
347
|
-
width: 16px;
|
|
348
|
-
height: 16px;
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
/* -- Variants --------------------------------------------------------- */
|
|
352
|
-
button[data-type='filled-dropdown'] {
|
|
353
|
-
background-color: ${({ tokens: e }) => e.theme.foregroundPrimary};
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
button[data-type='text-dropdown'] {
|
|
357
|
-
background-color: transparent;
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
/* -- Focus states --------------------------------------------------- */
|
|
361
|
-
button:focus-visible:enabled {
|
|
362
|
-
background-color: ${({ tokens: e }) => e.theme.foregroundSecondary};
|
|
363
|
-
box-shadow: 0 0 0 4px ${({ tokens: e }) => e.core.foregroundAccent040};
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
/* -- Hover & Active states ----------------------------------------------------------- */
|
|
367
|
-
@media (hover: hover) and (pointer: fine) {
|
|
368
|
-
button:hover:enabled,
|
|
369
|
-
button:active:enabled {
|
|
370
|
-
background-color: ${({ tokens: e }) => e.theme.foregroundSecondary};
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
/* -- Disabled states --------------------------------------------------- */
|
|
375
|
-
button:disabled {
|
|
376
|
-
background-color: ${({ tokens: e }) => e.theme.foregroundSecondary};
|
|
377
|
-
opacity: 0.5;
|
|
378
|
-
}
|
|
379
|
-
`;
|
|
380
|
-
var A = function(e, t, i, r) {
|
|
381
|
-
var a = arguments.length, o = a < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, n;
|
|
382
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o = Reflect.decorate(e, t, i, r);
|
|
383
|
-
else for (var s = e.length - 1; s >= 0; s--) (n = e[s]) && (o = (a < 3 ? n(o) : a > 3 ? n(t, i, o) : n(t, i)) || o);
|
|
384
|
-
return a > 3 && o && Object.defineProperty(t, i, o), o;
|
|
385
|
-
};
|
|
386
|
-
const Se = {
|
|
387
|
-
lg: "lg-regular",
|
|
388
|
-
md: "md-regular",
|
|
389
|
-
sm: "sm-regular"
|
|
390
|
-
}, We = {
|
|
391
|
-
lg: "lg",
|
|
392
|
-
md: "md",
|
|
393
|
-
sm: "sm"
|
|
394
|
-
};
|
|
395
|
-
let I = class extends y {
|
|
396
|
-
constructor() {
|
|
397
|
-
super(...arguments), this.imageSrc = "", this.text = "", this.size = "lg", this.type = "text-dropdown", this.disabled = !1;
|
|
398
|
-
}
|
|
399
|
-
render() {
|
|
400
|
-
return d`<button ?disabled=${this.disabled} data-size=${this.size} data-type=${this.type}>
|
|
401
|
-
${this.imageTemplate()} ${this.textTemplate()}
|
|
402
|
-
<wui-flex class="right-icon-container">
|
|
403
|
-
<wui-icon name="chevronBottom"></wui-icon>
|
|
404
|
-
</wui-flex>
|
|
405
|
-
</button>`;
|
|
406
|
-
}
|
|
407
|
-
textTemplate() {
|
|
408
|
-
const t = Se[this.size];
|
|
409
|
-
return this.text ? d`<wui-text color="primary" variant=${t}>${this.text}</wui-text>` : null;
|
|
410
|
-
}
|
|
411
|
-
imageTemplate() {
|
|
412
|
-
if (this.imageSrc)
|
|
413
|
-
return d`<wui-image src=${this.imageSrc} alt="select visual"></wui-image>`;
|
|
414
|
-
const t = We[this.size];
|
|
415
|
-
return d` <wui-flex class="left-icon-container">
|
|
416
|
-
<wui-icon size=${t} name="networkPlaceholder"></wui-icon>
|
|
417
|
-
</wui-flex>`;
|
|
418
|
-
}
|
|
419
|
-
};
|
|
420
|
-
I.styles = [L, ue, $e];
|
|
421
|
-
A([
|
|
422
|
-
l()
|
|
423
|
-
], I.prototype, "imageSrc", void 0);
|
|
424
|
-
A([
|
|
425
|
-
l()
|
|
426
|
-
], I.prototype, "text", void 0);
|
|
427
|
-
A([
|
|
428
|
-
l()
|
|
429
|
-
], I.prototype, "size", void 0);
|
|
430
|
-
A([
|
|
431
|
-
l()
|
|
432
|
-
], I.prototype, "type", void 0);
|
|
433
|
-
A([
|
|
434
|
-
l({ type: Boolean })
|
|
435
|
-
], I.prototype, "disabled", void 0);
|
|
436
|
-
I = A([
|
|
437
|
-
w("wui-select")
|
|
438
|
-
], I);
|
|
439
|
-
const Ie = C`
|
|
440
|
-
:host {
|
|
441
|
-
height: 60px;
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
:host > wui-flex {
|
|
445
|
-
box-sizing: border-box;
|
|
446
|
-
background-color: var(--local-header-background-color);
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
wui-text {
|
|
450
|
-
background-color: var(--local-header-background-color);
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
wui-flex.w3m-header-title {
|
|
454
|
-
transform: translateY(0);
|
|
455
|
-
opacity: 1;
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
wui-flex.w3m-header-title[view-direction='prev'] {
|
|
459
|
-
animation:
|
|
460
|
-
slide-down-out 120ms forwards ${({ easings: e }) => e["ease-out-power-2"]},
|
|
461
|
-
slide-down-in 120ms forwards ${({ easings: e }) => e["ease-out-power-2"]};
|
|
462
|
-
animation-delay: 0ms, 200ms;
|
|
463
|
-
}
|
|
464
|
-
|
|
465
|
-
wui-flex.w3m-header-title[view-direction='next'] {
|
|
466
|
-
animation:
|
|
467
|
-
slide-up-out 120ms forwards ${({ easings: e }) => e["ease-out-power-2"]},
|
|
468
|
-
slide-up-in 120ms forwards ${({ easings: e }) => e["ease-out-power-2"]};
|
|
469
|
-
animation-delay: 0ms, 200ms;
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
wui-icon-button[data-hidden='true'] {
|
|
473
|
-
opacity: 0 !important;
|
|
474
|
-
pointer-events: none;
|
|
475
|
-
}
|
|
476
|
-
|
|
477
|
-
@keyframes slide-up-out {
|
|
478
|
-
from {
|
|
479
|
-
transform: translateY(0px);
|
|
480
|
-
opacity: 1;
|
|
481
|
-
}
|
|
482
|
-
to {
|
|
483
|
-
transform: translateY(3px);
|
|
484
|
-
opacity: 0;
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
@keyframes slide-up-in {
|
|
489
|
-
from {
|
|
490
|
-
transform: translateY(-3px);
|
|
491
|
-
opacity: 0;
|
|
492
|
-
}
|
|
493
|
-
to {
|
|
494
|
-
transform: translateY(0);
|
|
495
|
-
opacity: 1;
|
|
496
|
-
}
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
@keyframes slide-down-out {
|
|
500
|
-
from {
|
|
501
|
-
transform: translateY(0px);
|
|
502
|
-
opacity: 1;
|
|
503
|
-
}
|
|
504
|
-
to {
|
|
505
|
-
transform: translateY(-3px);
|
|
506
|
-
opacity: 0;
|
|
507
|
-
}
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
@keyframes slide-down-in {
|
|
511
|
-
from {
|
|
512
|
-
transform: translateY(3px);
|
|
513
|
-
opacity: 0;
|
|
514
|
-
}
|
|
515
|
-
to {
|
|
516
|
-
transform: translateY(0);
|
|
517
|
-
opacity: 1;
|
|
518
|
-
}
|
|
519
|
-
}
|
|
520
|
-
`;
|
|
521
|
-
var E = function(e, t, i, r) {
|
|
522
|
-
var a = arguments.length, o = a < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, n;
|
|
523
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o = Reflect.decorate(e, t, i, r);
|
|
524
|
-
else for (var s = e.length - 1; s >= 0; s--) (n = e[s]) && (o = (a < 3 ? n(o) : a > 3 ? n(t, i, o) : n(t, i)) || o);
|
|
525
|
-
return a > 3 && o && Object.defineProperty(t, i, o), o;
|
|
526
|
-
};
|
|
527
|
-
const Ee = ["SmartSessionList"], Re = {
|
|
528
|
-
PayWithExchange: D.tokens.theme.foregroundPrimary
|
|
529
|
-
};
|
|
530
|
-
function te() {
|
|
531
|
-
var m, b, P, G, q, Z, J, Q;
|
|
532
|
-
const e = (b = (m = c.state.data) == null ? void 0 : m.connector) == null ? void 0 : b.name, t = (G = (P = c.state.data) == null ? void 0 : P.wallet) == null ? void 0 : G.name, i = (Z = (q = c.state.data) == null ? void 0 : q.network) == null ? void 0 : Z.name, r = t ?? e, a = F.getConnectors(), o = a.length === 1 && ((J = a[0]) == null ? void 0 : J.id) === "w3m-email", n = (Q = g.getAccountData()) == null ? void 0 : Q.socialProvider, s = n ? n.charAt(0).toUpperCase() + n.slice(1) : "Connect Social";
|
|
533
|
-
return {
|
|
534
|
-
Connect: `Connect ${o ? "Email" : ""} Wallet`,
|
|
535
|
-
Create: "Create Wallet",
|
|
536
|
-
ChooseAccountName: void 0,
|
|
537
|
-
Account: void 0,
|
|
538
|
-
AccountSettings: void 0,
|
|
539
|
-
AllWallets: "All Wallets",
|
|
540
|
-
ApproveTransaction: "Approve Transaction",
|
|
541
|
-
BuyInProgress: "Buy",
|
|
542
|
-
UsageExceeded: "Usage Exceeded",
|
|
543
|
-
ConnectingExternal: r ?? "Connect Wallet",
|
|
544
|
-
ConnectingWalletConnect: r ?? "WalletConnect",
|
|
545
|
-
ConnectingWalletConnectBasic: "WalletConnect",
|
|
546
|
-
ConnectingSiwe: "Sign In",
|
|
547
|
-
Convert: "Convert",
|
|
548
|
-
ConvertSelectToken: "Select token",
|
|
549
|
-
ConvertPreview: "Preview Convert",
|
|
550
|
-
Downloads: r ? `Get ${r}` : "Downloads",
|
|
551
|
-
EmailLogin: "Email Login",
|
|
552
|
-
EmailVerifyOtp: "Confirm Email",
|
|
553
|
-
EmailVerifyDevice: "Register Device",
|
|
554
|
-
GetWallet: "Get a Wallet",
|
|
555
|
-
Networks: "Choose Network",
|
|
556
|
-
OnRampProviders: "Choose Provider",
|
|
557
|
-
OnRampActivity: "Activity",
|
|
558
|
-
OnRampTokenSelect: "Select Token",
|
|
559
|
-
OnRampFiatSelect: "Select Currency",
|
|
560
|
-
Pay: "How you pay",
|
|
561
|
-
ProfileWallets: "Wallets",
|
|
562
|
-
SwitchNetwork: i ?? "Switch Network",
|
|
563
|
-
Transactions: "Activity",
|
|
564
|
-
UnsupportedChain: "Switch Network",
|
|
565
|
-
UpgradeEmailWallet: "Upgrade Your Wallet",
|
|
566
|
-
UpdateEmailWallet: "Edit Email",
|
|
567
|
-
UpdateEmailPrimaryOtp: "Confirm Current Email",
|
|
568
|
-
UpdateEmailSecondaryOtp: "Confirm New Email",
|
|
569
|
-
WhatIsABuy: "What is Buy?",
|
|
570
|
-
RegisterAccountName: "Choose Name",
|
|
571
|
-
RegisterAccountNameSuccess: "",
|
|
572
|
-
WalletReceive: "Receive",
|
|
573
|
-
WalletCompatibleNetworks: "Compatible Networks",
|
|
574
|
-
Swap: "Swap",
|
|
575
|
-
SwapSelectToken: "Select Token",
|
|
576
|
-
SwapPreview: "Preview Swap",
|
|
577
|
-
WalletSend: "Send",
|
|
578
|
-
WalletSendPreview: "Review Send",
|
|
579
|
-
WalletSendSelectToken: "Select Token",
|
|
580
|
-
WalletSendConfirmed: "Confirmed",
|
|
581
|
-
WhatIsANetwork: "What is a network?",
|
|
582
|
-
WhatIsAWallet: "What is a Wallet?",
|
|
583
|
-
ConnectWallets: "Connect Wallet",
|
|
584
|
-
ConnectSocials: "All Socials",
|
|
585
|
-
ConnectingSocial: s,
|
|
586
|
-
ConnectingMultiChain: "Select Chain",
|
|
587
|
-
ConnectingFarcaster: "Farcaster",
|
|
588
|
-
SwitchActiveChain: "Switch Chain",
|
|
589
|
-
SmartSessionCreated: void 0,
|
|
590
|
-
SmartSessionList: "Smart Sessions",
|
|
591
|
-
SIWXSignMessage: "Sign In",
|
|
592
|
-
PayLoading: "Payment in Progress",
|
|
593
|
-
DataCapture: "Profile",
|
|
594
|
-
DataCaptureOtpConfirm: "Confirm Email",
|
|
595
|
-
FundWallet: "Fund Wallet",
|
|
596
|
-
PayWithExchange: "Deposit from Exchange",
|
|
597
|
-
PayWithExchangeSelectAsset: "Select Asset",
|
|
598
|
-
SmartAccountSettings: "Smart Account Settings"
|
|
599
|
-
};
|
|
600
|
-
}
|
|
601
|
-
let k = class extends y {
|
|
602
|
-
constructor() {
|
|
603
|
-
super(), this.unsubscribe = [], this.heading = te()[c.state.view], this.network = g.state.activeCaipNetwork, this.networkImage = j.getNetworkImage(this.network), this.showBack = !1, this.prevHistoryLength = 1, this.view = c.state.view, this.viewDirection = "", this.unsubscribe.push(he.subscribeNetworkImages(() => {
|
|
604
|
-
this.networkImage = j.getNetworkImage(this.network);
|
|
605
|
-
}), c.subscribeKey("view", (t) => {
|
|
606
|
-
setTimeout(() => {
|
|
607
|
-
this.view = t, this.heading = te()[t];
|
|
608
|
-
}, V.ANIMATION_DURATIONS.HeaderText), this.onViewChange(), this.onHistoryChange();
|
|
609
|
-
}), g.subscribeKey("activeCaipNetwork", (t) => {
|
|
610
|
-
this.network = t, this.networkImage = j.getNetworkImage(this.network);
|
|
611
|
-
}));
|
|
612
|
-
}
|
|
613
|
-
disconnectCallback() {
|
|
614
|
-
this.unsubscribe.forEach((t) => t());
|
|
615
|
-
}
|
|
616
|
-
render() {
|
|
617
|
-
const t = Re[c.state.view] ?? D.tokens.theme.backgroundPrimary;
|
|
618
|
-
return this.style.setProperty("--local-header-background-color", t), d`
|
|
619
|
-
<wui-flex
|
|
620
|
-
.padding=${["0", "4", "0", "4"]}
|
|
621
|
-
justifyContent="space-between"
|
|
622
|
-
alignItems="center"
|
|
623
|
-
>
|
|
624
|
-
${this.leftHeaderTemplate()} ${this.titleTemplate()} ${this.rightHeaderTemplate()}
|
|
625
|
-
</wui-flex>
|
|
626
|
-
`;
|
|
627
|
-
}
|
|
628
|
-
onWalletHelp() {
|
|
629
|
-
U.sendEvent({ type: "track", event: "CLICK_WALLET_HELP" }), c.push("WhatIsAWallet");
|
|
630
|
-
}
|
|
631
|
-
async onClose() {
|
|
632
|
-
await se.safeClose();
|
|
633
|
-
}
|
|
634
|
-
rightHeaderTemplate() {
|
|
635
|
-
var i, r, a;
|
|
636
|
-
const t = (a = (r = (i = R) == null ? void 0 : i.state) == null ? void 0 : r.features) == null ? void 0 : a.smartSessions;
|
|
637
|
-
return c.state.view !== "Account" || !t ? this.closeButtonTemplate() : d`<wui-flex>
|
|
638
|
-
<wui-icon-button
|
|
639
|
-
icon="clock"
|
|
640
|
-
size="lg"
|
|
641
|
-
iconSize="lg"
|
|
642
|
-
type="neutral"
|
|
643
|
-
variant="primary"
|
|
644
|
-
@click=${() => c.push("SmartSessionList")}
|
|
645
|
-
data-testid="w3m-header-smart-sessions"
|
|
646
|
-
></wui-icon-button>
|
|
647
|
-
${this.closeButtonTemplate()}
|
|
648
|
-
</wui-flex> `;
|
|
649
|
-
}
|
|
650
|
-
closeButtonTemplate() {
|
|
651
|
-
return d`
|
|
652
|
-
<wui-icon-button
|
|
653
|
-
icon="close"
|
|
654
|
-
size="lg"
|
|
655
|
-
type="neutral"
|
|
656
|
-
variant="primary"
|
|
657
|
-
iconSize="lg"
|
|
658
|
-
@click=${this.onClose.bind(this)}
|
|
659
|
-
data-testid="w3m-header-close"
|
|
660
|
-
></wui-icon-button>
|
|
661
|
-
`;
|
|
662
|
-
}
|
|
663
|
-
titleTemplate() {
|
|
664
|
-
const t = Ee.includes(this.view);
|
|
665
|
-
return d`
|
|
666
|
-
<wui-flex
|
|
667
|
-
view-direction="${this.viewDirection}"
|
|
668
|
-
class="w3m-header-title"
|
|
669
|
-
alignItems="center"
|
|
670
|
-
gap="2"
|
|
671
|
-
>
|
|
672
|
-
<wui-text
|
|
673
|
-
display="inline"
|
|
674
|
-
variant="lg-regular"
|
|
675
|
-
color="primary"
|
|
676
|
-
data-testid="w3m-header-text"
|
|
677
|
-
>
|
|
678
|
-
${this.heading}
|
|
679
|
-
</wui-text>
|
|
680
|
-
${t ? d`<wui-tag variant="accent" size="md">Beta</wui-tag>` : null}
|
|
681
|
-
</wui-flex>
|
|
682
|
-
`;
|
|
683
|
-
}
|
|
684
|
-
leftHeaderTemplate() {
|
|
685
|
-
var b;
|
|
686
|
-
const { view: t } = c.state, i = t === "Connect", r = R.state.enableEmbedded, a = t === "ApproveTransaction", o = t === "ConnectingSiwe", n = t === "Account", s = R.state.enableNetworkSwitch, m = a || o || i && r;
|
|
687
|
-
return n && s ? d`<wui-select
|
|
688
|
-
id="dynamic"
|
|
689
|
-
data-testid="w3m-account-select-network"
|
|
690
|
-
active-network=${W((b = this.network) == null ? void 0 : b.name)}
|
|
691
|
-
@click=${this.onNetworks.bind(this)}
|
|
692
|
-
imageSrc=${W(this.networkImage)}
|
|
693
|
-
></wui-select>` : this.showBack && !m ? d`<wui-icon-button
|
|
694
|
-
data-testid="header-back"
|
|
695
|
-
id="dynamic"
|
|
696
|
-
icon="chevronLeft"
|
|
697
|
-
size="lg"
|
|
698
|
-
iconSize="lg"
|
|
699
|
-
type="neutral"
|
|
700
|
-
variant="primary"
|
|
701
|
-
@click=${this.onGoBack.bind(this)}
|
|
702
|
-
></wui-icon-button>` : d`<wui-icon-button
|
|
703
|
-
data-hidden=${!i}
|
|
704
|
-
id="dynamic"
|
|
705
|
-
icon="helpCircle"
|
|
706
|
-
size="lg"
|
|
707
|
-
iconSize="lg"
|
|
708
|
-
type="neutral"
|
|
709
|
-
variant="primary"
|
|
710
|
-
@click=${this.onWalletHelp.bind(this)}
|
|
711
|
-
></wui-icon-button>`;
|
|
712
|
-
}
|
|
713
|
-
onNetworks() {
|
|
714
|
-
this.isAllowedNetworkSwitch() && (U.sendEvent({ type: "track", event: "CLICK_NETWORKS" }), c.push("Networks"));
|
|
715
|
-
}
|
|
716
|
-
isAllowedNetworkSwitch() {
|
|
717
|
-
const t = g.getAllRequestedCaipNetworks(), i = t ? t.length > 1 : !1, r = t == null ? void 0 : t.find(({ id: a }) => {
|
|
718
|
-
var o;
|
|
719
|
-
return a === ((o = this.network) == null ? void 0 : o.id);
|
|
720
|
-
});
|
|
721
|
-
return i || !r;
|
|
722
|
-
}
|
|
723
|
-
onViewChange() {
|
|
724
|
-
const { history: t } = c.state;
|
|
725
|
-
let i = V.VIEW_DIRECTION.Next;
|
|
726
|
-
t.length < this.prevHistoryLength && (i = V.VIEW_DIRECTION.Prev), this.prevHistoryLength = t.length, this.viewDirection = i;
|
|
727
|
-
}
|
|
728
|
-
async onHistoryChange() {
|
|
729
|
-
var r;
|
|
730
|
-
const { history: t } = c.state, i = (r = this.shadowRoot) == null ? void 0 : r.querySelector("#dynamic");
|
|
731
|
-
t.length > 1 && !this.showBack && i ? (await i.animate([{ opacity: 1 }, { opacity: 0 }], {
|
|
732
|
-
duration: 200,
|
|
733
|
-
fill: "forwards",
|
|
734
|
-
easing: "ease"
|
|
735
|
-
}).finished, this.showBack = !0, i.animate([{ opacity: 0 }, { opacity: 1 }], {
|
|
736
|
-
duration: 200,
|
|
737
|
-
fill: "forwards",
|
|
738
|
-
easing: "ease"
|
|
739
|
-
})) : t.length <= 1 && this.showBack && i && (await i.animate([{ opacity: 1 }, { opacity: 0 }], {
|
|
740
|
-
duration: 200,
|
|
741
|
-
fill: "forwards",
|
|
742
|
-
easing: "ease"
|
|
743
|
-
}).finished, this.showBack = !1, i.animate([{ opacity: 0 }, { opacity: 1 }], {
|
|
744
|
-
duration: 200,
|
|
745
|
-
fill: "forwards",
|
|
746
|
-
easing: "ease"
|
|
747
|
-
}));
|
|
748
|
-
}
|
|
749
|
-
onGoBack() {
|
|
750
|
-
c.goBack();
|
|
751
|
-
}
|
|
752
|
-
};
|
|
753
|
-
k.styles = Ie;
|
|
754
|
-
E([
|
|
755
|
-
u()
|
|
756
|
-
], k.prototype, "heading", void 0);
|
|
757
|
-
E([
|
|
758
|
-
u()
|
|
759
|
-
], k.prototype, "network", void 0);
|
|
760
|
-
E([
|
|
761
|
-
u()
|
|
762
|
-
], k.prototype, "networkImage", void 0);
|
|
763
|
-
E([
|
|
764
|
-
u()
|
|
765
|
-
], k.prototype, "showBack", void 0);
|
|
766
|
-
E([
|
|
767
|
-
u()
|
|
768
|
-
], k.prototype, "prevHistoryLength", void 0);
|
|
769
|
-
E([
|
|
770
|
-
u()
|
|
771
|
-
], k.prototype, "view", void 0);
|
|
772
|
-
E([
|
|
773
|
-
u()
|
|
774
|
-
], k.prototype, "viewDirection", void 0);
|
|
775
|
-
k = E([
|
|
776
|
-
w("w3m-header")
|
|
777
|
-
], k);
|
|
778
|
-
const Oe = C`
|
|
779
|
-
:host {
|
|
780
|
-
display: flex;
|
|
781
|
-
align-items: center;
|
|
782
|
-
gap: ${({ spacing: e }) => e[1]};
|
|
783
|
-
padding: ${({ spacing: e }) => e[2]} ${({ spacing: e }) => e[3]}
|
|
784
|
-
${({ spacing: e }) => e[2]} ${({ spacing: e }) => e[2]};
|
|
785
|
-
border-radius: ${({ borderRadius: e }) => e[20]};
|
|
786
|
-
background-color: ${({ tokens: e }) => e.theme.foregroundPrimary};
|
|
787
|
-
box-shadow:
|
|
788
|
-
0px 0px 8px 0px rgba(0, 0, 0, 0.1),
|
|
789
|
-
inset 0 0 0 1px ${({ tokens: e }) => e.theme.borderPrimary};
|
|
790
|
-
max-width: 320px;
|
|
791
|
-
}
|
|
792
|
-
|
|
793
|
-
wui-icon-box {
|
|
794
|
-
border-radius: ${({ borderRadius: e }) => e.round} !important;
|
|
795
|
-
overflow: hidden;
|
|
796
|
-
}
|
|
797
|
-
|
|
798
|
-
wui-loading-spinner {
|
|
799
|
-
padding: ${({ spacing: e }) => e[1]};
|
|
800
|
-
background-color: ${({ tokens: e }) => e.core.foregroundAccent010};
|
|
801
|
-
border-radius: ${({ borderRadius: e }) => e.round} !important;
|
|
802
|
-
}
|
|
803
|
-
`;
|
|
804
|
-
var Y = function(e, t, i, r) {
|
|
805
|
-
var a = arguments.length, o = a < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, n;
|
|
806
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o = Reflect.decorate(e, t, i, r);
|
|
807
|
-
else for (var s = e.length - 1; s >= 0; s--) (n = e[s]) && (o = (a < 3 ? n(o) : a > 3 ? n(t, i, o) : n(t, i)) || o);
|
|
808
|
-
return a > 3 && o && Object.defineProperty(t, i, o), o;
|
|
809
|
-
};
|
|
810
|
-
let T = class extends y {
|
|
811
|
-
constructor() {
|
|
812
|
-
super(...arguments), this.message = "", this.variant = "success";
|
|
813
|
-
}
|
|
814
|
-
render() {
|
|
815
|
-
return d`
|
|
816
|
-
${this.templateIcon()}
|
|
817
|
-
<wui-text variant="lg-regular" color="primary" data-testid="wui-snackbar-message"
|
|
818
|
-
>${this.message}</wui-text
|
|
819
|
-
>
|
|
820
|
-
`;
|
|
821
|
-
}
|
|
822
|
-
templateIcon() {
|
|
823
|
-
const t = {
|
|
824
|
-
success: "success",
|
|
825
|
-
error: "error",
|
|
826
|
-
warning: "warning",
|
|
827
|
-
info: "default"
|
|
828
|
-
}, i = {
|
|
829
|
-
success: "checkmark",
|
|
830
|
-
error: "warning",
|
|
831
|
-
warning: "warningCircle",
|
|
832
|
-
info: "info"
|
|
833
|
-
};
|
|
834
|
-
return this.variant === "loading" ? d`<wui-loading-spinner size="md" color="accent-primary"></wui-loading-spinner>` : d`<wui-icon-box
|
|
835
|
-
size="md"
|
|
836
|
-
color=${t[this.variant]}
|
|
837
|
-
icon=${i[this.variant]}
|
|
838
|
-
></wui-icon-box>`;
|
|
839
|
-
}
|
|
840
|
-
};
|
|
841
|
-
T.styles = [L, Oe];
|
|
842
|
-
Y([
|
|
843
|
-
l()
|
|
844
|
-
], T.prototype, "message", void 0);
|
|
845
|
-
Y([
|
|
846
|
-
l()
|
|
847
|
-
], T.prototype, "variant", void 0);
|
|
848
|
-
T = Y([
|
|
849
|
-
w("wui-snackbar")
|
|
850
|
-
], T);
|
|
851
|
-
const Ae = pe`
|
|
852
|
-
:host {
|
|
853
|
-
display: block;
|
|
854
|
-
position: absolute;
|
|
855
|
-
opacity: 0;
|
|
856
|
-
pointer-events: none;
|
|
857
|
-
top: 11px;
|
|
858
|
-
left: 50%;
|
|
859
|
-
width: max-content;
|
|
860
|
-
}
|
|
861
|
-
`;
|
|
862
|
-
var ce = function(e, t, i, r) {
|
|
863
|
-
var a = arguments.length, o = a < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, n;
|
|
864
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o = Reflect.decorate(e, t, i, r);
|
|
865
|
-
else for (var s = e.length - 1; s >= 0; s--) (n = e[s]) && (o = (a < 3 ? n(o) : a > 3 ? n(t, i, o) : n(t, i)) || o);
|
|
866
|
-
return a > 3 && o && Object.defineProperty(t, i, o), o;
|
|
867
|
-
};
|
|
868
|
-
let B = class extends y {
|
|
869
|
-
constructor() {
|
|
870
|
-
super(), this.unsubscribe = [], this.timeout = void 0, this.open = O.state.open, this.unsubscribe.push(O.subscribeKey("open", (t) => {
|
|
871
|
-
this.open = t, this.onOpen();
|
|
872
|
-
}));
|
|
873
|
-
}
|
|
874
|
-
disconnectedCallback() {
|
|
875
|
-
clearTimeout(this.timeout), this.unsubscribe.forEach((t) => t());
|
|
876
|
-
}
|
|
877
|
-
render() {
|
|
878
|
-
const { message: t, variant: i } = O.state;
|
|
879
|
-
return d` <wui-snackbar message=${t} variant=${i}></wui-snackbar> `;
|
|
880
|
-
}
|
|
881
|
-
onOpen() {
|
|
882
|
-
clearTimeout(this.timeout), this.open ? (this.animate([
|
|
883
|
-
{ opacity: 0, transform: "translateX(-50%) scale(0.85)" },
|
|
884
|
-
{ opacity: 1, transform: "translateX(-50%) scale(1)" }
|
|
885
|
-
], {
|
|
886
|
-
duration: 150,
|
|
887
|
-
fill: "forwards",
|
|
888
|
-
easing: "ease"
|
|
889
|
-
}), this.timeout && clearTimeout(this.timeout), O.state.autoClose && (this.timeout = setTimeout(() => O.hide(), 2500))) : this.animate([
|
|
890
|
-
{ opacity: 1, transform: "translateX(-50%) scale(1)" },
|
|
891
|
-
{ opacity: 0, transform: "translateX(-50%) scale(0.85)" }
|
|
892
|
-
], {
|
|
893
|
-
duration: 150,
|
|
894
|
-
fill: "forwards",
|
|
895
|
-
easing: "ease"
|
|
896
|
-
});
|
|
897
|
-
}
|
|
898
|
-
};
|
|
899
|
-
B.styles = Ae;
|
|
900
|
-
ce([
|
|
901
|
-
u()
|
|
902
|
-
], B.prototype, "open", void 0);
|
|
903
|
-
B = ce([
|
|
904
|
-
w("w3m-snackbar")
|
|
905
|
-
], B);
|
|
906
|
-
const Pe = C`
|
|
907
|
-
:host {
|
|
908
|
-
z-index: ${({ tokens: e }) => e.core.zIndex};
|
|
909
|
-
display: block;
|
|
910
|
-
backface-visibility: hidden;
|
|
911
|
-
will-change: opacity;
|
|
912
|
-
position: fixed;
|
|
913
|
-
top: 0;
|
|
914
|
-
left: 0;
|
|
915
|
-
right: 0;
|
|
916
|
-
bottom: 0;
|
|
917
|
-
pointer-events: none;
|
|
918
|
-
opacity: 0;
|
|
919
|
-
background-color: ${({ tokens: e }) => e.theme.overlay};
|
|
920
|
-
backdrop-filter: blur(0px);
|
|
921
|
-
transition:
|
|
922
|
-
opacity ${({ durations: e }) => e.lg} ${({ easings: e }) => e["ease-out-power-2"]},
|
|
923
|
-
backdrop-filter ${({ durations: e }) => e.lg}
|
|
924
|
-
${({ easings: e }) => e["ease-out-power-2"]};
|
|
925
|
-
will-change: opacity;
|
|
926
|
-
}
|
|
927
|
-
|
|
928
|
-
:host(.open) {
|
|
929
|
-
opacity: 1;
|
|
930
|
-
backdrop-filter: blur(8px);
|
|
931
|
-
}
|
|
932
|
-
|
|
933
|
-
:host(.appkit-modal) {
|
|
934
|
-
position: relative;
|
|
935
|
-
pointer-events: unset;
|
|
936
|
-
background: none;
|
|
937
|
-
width: 100%;
|
|
938
|
-
opacity: 1;
|
|
939
|
-
}
|
|
940
|
-
|
|
941
|
-
wui-card {
|
|
942
|
-
max-width: var(--apkt-modal-width);
|
|
943
|
-
width: 100%;
|
|
944
|
-
position: relative;
|
|
945
|
-
outline: none;
|
|
946
|
-
transform: translateY(4px);
|
|
947
|
-
box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.05);
|
|
948
|
-
transition:
|
|
949
|
-
transform ${({ durations: e }) => e.lg}
|
|
950
|
-
${({ easings: e }) => e["ease-out-power-2"]},
|
|
951
|
-
border-radius ${({ durations: e }) => e.lg}
|
|
952
|
-
${({ easings: e }) => e["ease-out-power-1"]},
|
|
953
|
-
background-color ${({ durations: e }) => e.lg}
|
|
954
|
-
${({ easings: e }) => e["ease-out-power-1"]},
|
|
955
|
-
box-shadow ${({ durations: e }) => e.lg}
|
|
956
|
-
${({ easings: e }) => e["ease-out-power-1"]};
|
|
957
|
-
will-change: border-radius, background-color, transform, box-shadow;
|
|
958
|
-
background-color: ${({ tokens: e }) => e.theme.backgroundPrimary};
|
|
959
|
-
padding: var(--local-modal-padding);
|
|
960
|
-
box-sizing: border-box;
|
|
961
|
-
}
|
|
962
|
-
|
|
963
|
-
:host(.open) wui-card {
|
|
964
|
-
transform: translateY(0px);
|
|
965
|
-
}
|
|
966
|
-
|
|
967
|
-
wui-card::before {
|
|
968
|
-
z-index: 1;
|
|
969
|
-
pointer-events: none;
|
|
970
|
-
content: '';
|
|
971
|
-
position: absolute;
|
|
972
|
-
inset: 0;
|
|
973
|
-
border-radius: clamp(0px, var(--apkt-borderRadius-8), 44px);
|
|
974
|
-
transition: box-shadow ${({ durations: e }) => e.lg}
|
|
975
|
-
${({ easings: e }) => e["ease-out-power-2"]};
|
|
976
|
-
transition-delay: ${({ durations: e }) => e.md};
|
|
977
|
-
will-change: box-shadow;
|
|
978
|
-
}
|
|
979
|
-
|
|
980
|
-
:host([data-mobile-fullscreen='true']) wui-card::before {
|
|
981
|
-
border-radius: 0px;
|
|
982
|
-
}
|
|
983
|
-
|
|
984
|
-
:host([data-border='true']) wui-card::before {
|
|
985
|
-
box-shadow: inset 0px 0px 0px 4px ${({ tokens: e }) => e.theme.foregroundSecondary};
|
|
986
|
-
}
|
|
987
|
-
|
|
988
|
-
:host([data-border='false']) wui-card::before {
|
|
989
|
-
box-shadow: inset 0px 0px 0px 1px ${({ tokens: e }) => e.theme.borderPrimaryDark};
|
|
990
|
-
}
|
|
991
|
-
|
|
992
|
-
:host([data-border='true']) wui-card {
|
|
993
|
-
animation:
|
|
994
|
-
fade-in ${({ durations: e }) => e.lg} ${({ easings: e }) => e["ease-out-power-2"]},
|
|
995
|
-
card-background-border var(--apkt-duration-dynamic)
|
|
996
|
-
${({ easings: e }) => e["ease-out-power-2"]};
|
|
997
|
-
animation-fill-mode: backwards, both;
|
|
998
|
-
animation-delay: var(--apkt-duration-dynamic);
|
|
999
|
-
}
|
|
1000
|
-
|
|
1001
|
-
:host([data-border='false']) wui-card {
|
|
1002
|
-
animation:
|
|
1003
|
-
fade-in ${({ durations: e }) => e.lg} ${({ easings: e }) => e["ease-out-power-2"]},
|
|
1004
|
-
card-background-default var(--apkt-duration-dynamic)
|
|
1005
|
-
${({ easings: e }) => e["ease-out-power-2"]};
|
|
1006
|
-
animation-fill-mode: backwards, both;
|
|
1007
|
-
animation-delay: 0s;
|
|
1008
|
-
}
|
|
1009
|
-
|
|
1010
|
-
:host(.appkit-modal) wui-card {
|
|
1011
|
-
max-width: var(--apkt-modal-width);
|
|
1012
|
-
}
|
|
1013
|
-
|
|
1014
|
-
wui-card[shake='true'] {
|
|
1015
|
-
animation:
|
|
1016
|
-
fade-in ${({ durations: e }) => e.lg} ${({ easings: e }) => e["ease-out-power-2"]},
|
|
1017
|
-
w3m-shake ${({ durations: e }) => e.xl}
|
|
1018
|
-
${({ easings: e }) => e["ease-out-power-2"]};
|
|
1019
|
-
}
|
|
1020
|
-
|
|
1021
|
-
wui-flex {
|
|
1022
|
-
overflow-x: hidden;
|
|
1023
|
-
overflow-y: auto;
|
|
1024
|
-
display: flex;
|
|
1025
|
-
align-items: center;
|
|
1026
|
-
justify-content: center;
|
|
1027
|
-
width: 100%;
|
|
1028
|
-
height: 100%;
|
|
1029
|
-
}
|
|
1030
|
-
|
|
1031
|
-
@media (max-height: 700px) and (min-width: 431px) {
|
|
1032
|
-
wui-flex {
|
|
1033
|
-
align-items: flex-start;
|
|
1034
|
-
}
|
|
1035
|
-
|
|
1036
|
-
wui-card {
|
|
1037
|
-
margin: var(--apkt-spacing-6) 0px;
|
|
1038
|
-
}
|
|
1039
|
-
}
|
|
1040
|
-
|
|
1041
|
-
@media (max-width: 430px) {
|
|
1042
|
-
:host([data-mobile-fullscreen='true']) {
|
|
1043
|
-
height: 100dvh;
|
|
1044
|
-
}
|
|
1045
|
-
:host([data-mobile-fullscreen='true']) wui-flex {
|
|
1046
|
-
align-items: stretch;
|
|
1047
|
-
}
|
|
1048
|
-
:host([data-mobile-fullscreen='true']) wui-card {
|
|
1049
|
-
max-width: 100%;
|
|
1050
|
-
height: 100%;
|
|
1051
|
-
border-radius: 0;
|
|
1052
|
-
border: none;
|
|
1053
|
-
}
|
|
1054
|
-
:host(:not([data-mobile-fullscreen='true'])) wui-flex {
|
|
1055
|
-
align-items: flex-end;
|
|
1056
|
-
}
|
|
1057
|
-
|
|
1058
|
-
:host(:not([data-mobile-fullscreen='true'])) wui-card {
|
|
1059
|
-
max-width: 100%;
|
|
1060
|
-
border-bottom: none;
|
|
1061
|
-
}
|
|
1062
|
-
|
|
1063
|
-
:host(:not([data-mobile-fullscreen='true'])) wui-card[data-embedded='true'] {
|
|
1064
|
-
border-bottom-left-radius: clamp(0px, var(--apkt-borderRadius-8), 44px);
|
|
1065
|
-
border-bottom-right-radius: clamp(0px, var(--apkt-borderRadius-8), 44px);
|
|
1066
|
-
}
|
|
1067
|
-
|
|
1068
|
-
:host(:not([data-mobile-fullscreen='true'])) wui-card:not([data-embedded='true']) {
|
|
1069
|
-
border-bottom-left-radius: 0px;
|
|
1070
|
-
border-bottom-right-radius: 0px;
|
|
1071
|
-
}
|
|
1072
|
-
|
|
1073
|
-
wui-card[shake='true'] {
|
|
1074
|
-
animation: w3m-shake 0.5s ${({ easings: e }) => e["ease-out-power-2"]};
|
|
1075
|
-
}
|
|
1076
|
-
}
|
|
1077
|
-
|
|
1078
|
-
@keyframes fade-in {
|
|
1079
|
-
0% {
|
|
1080
|
-
transform: scale(0.99) translateY(4px);
|
|
1081
|
-
}
|
|
1082
|
-
100% {
|
|
1083
|
-
transform: scale(1) translateY(0);
|
|
1084
|
-
}
|
|
1085
|
-
}
|
|
1086
|
-
|
|
1087
|
-
@keyframes w3m-shake {
|
|
1088
|
-
0% {
|
|
1089
|
-
transform: scale(1) rotate(0deg);
|
|
1090
|
-
}
|
|
1091
|
-
20% {
|
|
1092
|
-
transform: scale(1) rotate(-1deg);
|
|
1093
|
-
}
|
|
1094
|
-
40% {
|
|
1095
|
-
transform: scale(1) rotate(1.5deg);
|
|
1096
|
-
}
|
|
1097
|
-
60% {
|
|
1098
|
-
transform: scale(1) rotate(-1.5deg);
|
|
1099
|
-
}
|
|
1100
|
-
80% {
|
|
1101
|
-
transform: scale(1) rotate(1deg);
|
|
1102
|
-
}
|
|
1103
|
-
100% {
|
|
1104
|
-
transform: scale(1) rotate(0deg);
|
|
1105
|
-
}
|
|
1106
|
-
}
|
|
1107
|
-
|
|
1108
|
-
@keyframes card-background-border {
|
|
1109
|
-
from {
|
|
1110
|
-
background-color: ${({ tokens: e }) => e.theme.backgroundPrimary};
|
|
1111
|
-
}
|
|
1112
|
-
to {
|
|
1113
|
-
background-color: ${({ tokens: e }) => e.theme.foregroundSecondary};
|
|
1114
|
-
}
|
|
1115
|
-
}
|
|
1116
|
-
|
|
1117
|
-
@keyframes card-background-default {
|
|
1118
|
-
from {
|
|
1119
|
-
background-color: ${({ tokens: e }) => e.theme.foregroundSecondary};
|
|
1120
|
-
}
|
|
1121
|
-
to {
|
|
1122
|
-
background-color: ${({ tokens: e }) => e.theme.backgroundPrimary};
|
|
1123
|
-
}
|
|
1124
|
-
}
|
|
1125
|
-
`;
|
|
1126
|
-
var $ = function(e, t, i, r) {
|
|
1127
|
-
var a = arguments.length, o = a < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, n;
|
|
1128
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o = Reflect.decorate(e, t, i, r);
|
|
1129
|
-
else for (var s = e.length - 1; s >= 0; s--) (n = e[s]) && (o = (a < 3 ? n(o) : a > 3 ? n(t, i, o) : n(t, i)) || o);
|
|
1130
|
-
return a > 3 && o && Object.defineProperty(t, i, o), o;
|
|
1131
|
-
};
|
|
1132
|
-
const ie = "scroll-lock", Ne = {
|
|
1133
|
-
PayWithExchange: "0",
|
|
1134
|
-
PayWithExchangeSelectAsset: "0"
|
|
1135
|
-
};
|
|
1136
|
-
class v extends y {
|
|
1137
|
-
constructor() {
|
|
1138
|
-
super(), this.unsubscribe = [], this.abortController = void 0, this.hasPrefetched = !1, this.enableEmbedded = R.state.enableEmbedded, this.open = x.state.open, this.caipAddress = g.state.activeCaipAddress, this.caipNetwork = g.state.activeCaipNetwork, this.shake = x.state.shake, this.filterByNamespace = F.state.filterByNamespace, this.padding = D.spacing[1], this.mobileFullScreen = R.state.enableMobileFullScreen, this.initializeTheming(), z.prefetchAnalyticsConfig(), this.unsubscribe.push(x.subscribeKey("open", (t) => t ? this.onOpen() : this.onClose()), x.subscribeKey("shake", (t) => this.shake = t), g.subscribeKey("activeCaipNetwork", (t) => this.onNewNetwork(t)), g.subscribeKey("activeCaipAddress", (t) => this.onNewAddress(t)), R.subscribeKey("enableEmbedded", (t) => this.enableEmbedded = t), F.subscribeKey("filterByNamespace", (t) => {
|
|
1139
|
-
var i;
|
|
1140
|
-
this.filterByNamespace !== t && !((i = g.getAccountData(t)) != null && i.caipAddress) && (z.fetchRecommendedWallets(), this.filterByNamespace = t);
|
|
1141
|
-
}), c.subscribeKey("view", () => {
|
|
1142
|
-
this.dataset.border = ee.hasFooter() ? "true" : "false", this.padding = Ne[c.state.view] ?? D.spacing[1];
|
|
1143
|
-
}));
|
|
1144
|
-
}
|
|
1145
|
-
firstUpdated() {
|
|
1146
|
-
if (this.dataset.border = ee.hasFooter() ? "true" : "false", this.mobileFullScreen && this.setAttribute("data-mobile-fullscreen", "true"), this.caipAddress) {
|
|
1147
|
-
if (this.enableEmbedded) {
|
|
1148
|
-
x.close(), this.prefetch();
|
|
1149
|
-
return;
|
|
1150
|
-
}
|
|
1151
|
-
this.onNewAddress(this.caipAddress);
|
|
1152
|
-
}
|
|
1153
|
-
this.open && this.onOpen(), this.enableEmbedded && this.prefetch();
|
|
1154
|
-
}
|
|
1155
|
-
disconnectedCallback() {
|
|
1156
|
-
this.unsubscribe.forEach((t) => t()), this.onRemoveKeyboardListener();
|
|
1157
|
-
}
|
|
1158
|
-
render() {
|
|
1159
|
-
return this.style.setProperty("--local-modal-padding", this.padding), this.enableEmbedded ? d`${this.contentTemplate()}
|
|
1160
|
-
<w3m-tooltip></w3m-tooltip> ` : this.open ? d`
|
|
1161
|
-
<wui-flex @click=${this.onOverlayClick.bind(this)} data-testid="w3m-modal-overlay">
|
|
1162
|
-
${this.contentTemplate()}
|
|
1163
|
-
</wui-flex>
|
|
1164
|
-
<w3m-tooltip></w3m-tooltip>
|
|
1165
|
-
` : null;
|
|
1166
|
-
}
|
|
1167
|
-
contentTemplate() {
|
|
1168
|
-
return d` <wui-card
|
|
1169
|
-
shake="${this.shake}"
|
|
1170
|
-
data-embedded="${W(this.enableEmbedded)}"
|
|
1171
|
-
role="alertdialog"
|
|
1172
|
-
aria-modal="true"
|
|
1173
|
-
tabindex="0"
|
|
1174
|
-
data-testid="w3m-modal-card"
|
|
1175
|
-
>
|
|
1176
|
-
<w3m-header></w3m-header>
|
|
1177
|
-
<w3m-router></w3m-router>
|
|
1178
|
-
<w3m-footer></w3m-footer>
|
|
1179
|
-
<w3m-snackbar></w3m-snackbar>
|
|
1180
|
-
<w3m-alertbar></w3m-alertbar>
|
|
1181
|
-
</wui-card>`;
|
|
1182
|
-
}
|
|
1183
|
-
async onOverlayClick(t) {
|
|
1184
|
-
if (t.target === t.currentTarget) {
|
|
1185
|
-
if (this.mobileFullScreen)
|
|
1186
|
-
return;
|
|
1187
|
-
await this.handleClose();
|
|
1188
|
-
}
|
|
1189
|
-
}
|
|
1190
|
-
async handleClose() {
|
|
1191
|
-
await se.safeClose();
|
|
1192
|
-
}
|
|
1193
|
-
initializeTheming() {
|
|
1194
|
-
const { themeVariables: t, themeMode: i } = me.state, r = ne.getColorTheme(i);
|
|
1195
|
-
fe(t, r);
|
|
1196
|
-
}
|
|
1197
|
-
onClose() {
|
|
1198
|
-
this.open = !1, this.classList.remove("open"), this.onScrollUnlock(), O.hide(), this.onRemoveKeyboardListener();
|
|
1199
|
-
}
|
|
1200
|
-
onOpen() {
|
|
1201
|
-
this.open = !0, this.classList.add("open"), this.onScrollLock(), this.onAddKeyboardListener();
|
|
1202
|
-
}
|
|
1203
|
-
onScrollLock() {
|
|
1204
|
-
const t = document.createElement("style");
|
|
1205
|
-
t.dataset.w3m = ie, t.textContent = `
|
|
1206
|
-
body {
|
|
1207
|
-
touch-action: none;
|
|
1208
|
-
overflow: hidden;
|
|
1209
|
-
overscroll-behavior: contain;
|
|
1210
|
-
}
|
|
1211
|
-
w3m-modal {
|
|
1212
|
-
pointer-events: auto;
|
|
1213
|
-
}
|
|
1214
|
-
`, document.head.appendChild(t);
|
|
1215
|
-
}
|
|
1216
|
-
onScrollUnlock() {
|
|
1217
|
-
const t = document.head.querySelector(`style[data-w3m="${ie}"]`);
|
|
1218
|
-
t && t.remove();
|
|
1219
|
-
}
|
|
1220
|
-
onAddKeyboardListener() {
|
|
1221
|
-
var i;
|
|
1222
|
-
this.abortController = new AbortController();
|
|
1223
|
-
const t = (i = this.shadowRoot) == null ? void 0 : i.querySelector("wui-card");
|
|
1224
|
-
t == null || t.focus(), window.addEventListener("keydown", (r) => {
|
|
1225
|
-
if (r.key === "Escape")
|
|
1226
|
-
this.handleClose();
|
|
1227
|
-
else if (r.key === "Tab") {
|
|
1228
|
-
const { tagName: a } = r.target;
|
|
1229
|
-
a && !a.includes("W3M-") && !a.includes("WUI-") && (t == null || t.focus());
|
|
1230
|
-
}
|
|
1231
|
-
}, this.abortController);
|
|
1232
|
-
}
|
|
1233
|
-
onRemoveKeyboardListener() {
|
|
1234
|
-
var t;
|
|
1235
|
-
(t = this.abortController) == null || t.abort(), this.abortController = void 0;
|
|
1236
|
-
}
|
|
1237
|
-
async onNewAddress(t) {
|
|
1238
|
-
const i = g.state.isSwitchingNamespace, r = c.state.view === "ProfileWallets";
|
|
1239
|
-
!t && !i && !r && x.close(), await ae.initializeIfEnabled(t), this.caipAddress = t, g.setIsSwitchingNamespace(!1);
|
|
1240
|
-
}
|
|
1241
|
-
onNewNetwork(t) {
|
|
1242
|
-
var b, P;
|
|
1243
|
-
const i = this.caipNetwork, r = (b = i == null ? void 0 : i.caipNetworkId) == null ? void 0 : b.toString(), a = (P = t == null ? void 0 : t.caipNetworkId) == null ? void 0 : P.toString(), o = r !== a, n = c.state.view === "UnsupportedChain", s = x.state.open;
|
|
1244
|
-
let m = !1;
|
|
1245
|
-
this.enableEmbedded && c.state.view === "SwitchNetwork" && (m = !0), o && be.resetState(), s && n && (m = !0), m && c.state.view !== "SIWXSignMessage" && c.goBack(), this.caipNetwork = t;
|
|
1246
|
-
}
|
|
1247
|
-
prefetch() {
|
|
1248
|
-
this.hasPrefetched || (z.prefetch(), z.fetchWalletsByPage({ page: 1 }), this.hasPrefetched = !0);
|
|
1249
|
-
}
|
|
1250
|
-
}
|
|
1251
|
-
v.styles = Pe;
|
|
1252
|
-
$([
|
|
1253
|
-
l({ type: Boolean })
|
|
1254
|
-
], v.prototype, "enableEmbedded", void 0);
|
|
1255
|
-
$([
|
|
1256
|
-
u()
|
|
1257
|
-
], v.prototype, "open", void 0);
|
|
1258
|
-
$([
|
|
1259
|
-
u()
|
|
1260
|
-
], v.prototype, "caipAddress", void 0);
|
|
1261
|
-
$([
|
|
1262
|
-
u()
|
|
1263
|
-
], v.prototype, "caipNetwork", void 0);
|
|
1264
|
-
$([
|
|
1265
|
-
u()
|
|
1266
|
-
], v.prototype, "shake", void 0);
|
|
1267
|
-
$([
|
|
1268
|
-
u()
|
|
1269
|
-
], v.prototype, "filterByNamespace", void 0);
|
|
1270
|
-
$([
|
|
1271
|
-
u()
|
|
1272
|
-
], v.prototype, "padding", void 0);
|
|
1273
|
-
$([
|
|
1274
|
-
u()
|
|
1275
|
-
], v.prototype, "mobileFullScreen", void 0);
|
|
1276
|
-
let oe = class extends v {
|
|
1277
|
-
};
|
|
1278
|
-
oe = $([
|
|
1279
|
-
w("w3m-modal")
|
|
1280
|
-
], oe);
|
|
1281
|
-
let re = class extends v {
|
|
1282
|
-
};
|
|
1283
|
-
re = $([
|
|
1284
|
-
w("appkit-modal")
|
|
1285
|
-
], re);
|
|
1286
|
-
const Te = C`
|
|
1287
|
-
.icon-box {
|
|
1288
|
-
width: 64px;
|
|
1289
|
-
height: 64px;
|
|
1290
|
-
border-radius: ${({ borderRadius: e }) => e[5]};
|
|
1291
|
-
background-color: ${({ colors: e }) => e.semanticError010};
|
|
1292
|
-
}
|
|
1293
|
-
`;
|
|
1294
|
-
var ze = function(e, t, i, r) {
|
|
1295
|
-
var a = arguments.length, o = a < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, n;
|
|
1296
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o = Reflect.decorate(e, t, i, r);
|
|
1297
|
-
else for (var s = e.length - 1; s >= 0; s--) (n = e[s]) && (o = (a < 3 ? n(o) : a > 3 ? n(t, i, o) : n(t, i)) || o);
|
|
1298
|
-
return a > 3 && o && Object.defineProperty(t, i, o), o;
|
|
1299
|
-
};
|
|
1300
|
-
let M = class extends y {
|
|
1301
|
-
constructor() {
|
|
1302
|
-
super();
|
|
1303
|
-
}
|
|
1304
|
-
render() {
|
|
1305
|
-
return d`
|
|
1306
|
-
<wui-flex
|
|
1307
|
-
flexDirection="column"
|
|
1308
|
-
alignItems="center"
|
|
1309
|
-
gap="4"
|
|
1310
|
-
.padding="${["1", "3", "4", "3"]}"
|
|
1311
|
-
>
|
|
1312
|
-
<wui-flex justifyContent="center" alignItems="center" class="icon-box">
|
|
1313
|
-
<wui-icon size="xxl" color="error" name="warningCircle"></wui-icon>
|
|
1314
|
-
</wui-flex>
|
|
1315
|
-
|
|
1316
|
-
<wui-text variant="lg-medium" color="primary" align="center">
|
|
1317
|
-
The app isn't responding as expected
|
|
1318
|
-
</wui-text>
|
|
1319
|
-
<wui-text variant="md-regular" color="secondary" align="center">
|
|
1320
|
-
Try again or reach out to the app team for help.
|
|
1321
|
-
</wui-text>
|
|
1322
|
-
|
|
1323
|
-
<wui-button
|
|
1324
|
-
variant="neutral-secondary"
|
|
1325
|
-
size="md"
|
|
1326
|
-
@click=${this.onTryAgainClick.bind(this)}
|
|
1327
|
-
data-testid="w3m-usage-exceeded-button"
|
|
1328
|
-
>
|
|
1329
|
-
<wui-icon color="inherit" slot="iconLeft" name="refresh"></wui-icon>
|
|
1330
|
-
Try Again
|
|
1331
|
-
</wui-button>
|
|
1332
|
-
</wui-flex>
|
|
1333
|
-
`;
|
|
1334
|
-
}
|
|
1335
|
-
onTryAgainClick() {
|
|
1336
|
-
c.goBack();
|
|
1337
|
-
}
|
|
1338
|
-
};
|
|
1339
|
-
M.styles = Te;
|
|
1340
|
-
M = ze([
|
|
1341
|
-
w("w3m-usage-exceeded-view")
|
|
1342
|
-
], M);
|
|
1343
|
-
const _e = C`
|
|
1344
|
-
:host {
|
|
1345
|
-
width: 100%;
|
|
1346
|
-
}
|
|
1347
|
-
`;
|
|
1348
|
-
var p = function(e, t, i, r) {
|
|
1349
|
-
var a = arguments.length, o = a < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, n;
|
|
1350
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o = Reflect.decorate(e, t, i, r);
|
|
1351
|
-
else for (var s = e.length - 1; s >= 0; s--) (n = e[s]) && (o = (a < 3 ? n(o) : a > 3 ? n(t, i, o) : n(t, i)) || o);
|
|
1352
|
-
return a > 3 && o && Object.defineProperty(t, i, o), o;
|
|
1353
|
-
};
|
|
1354
|
-
let h = class extends y {
|
|
1355
|
-
constructor() {
|
|
1356
|
-
super(...arguments), this.hasImpressionSent = !1, this.walletImages = [], this.imageSrc = "", this.name = "", this.size = "md", this.tabIdx = void 0, this.disabled = !1, this.showAllWallets = !1, this.loading = !1, this.loadingSpinnerColor = "accent-100", this.rdnsId = "", this.displayIndex = void 0, this.walletRank = void 0, this.namespaces = [];
|
|
1357
|
-
}
|
|
1358
|
-
connectedCallback() {
|
|
1359
|
-
super.connectedCallback();
|
|
1360
|
-
}
|
|
1361
|
-
disconnectedCallback() {
|
|
1362
|
-
super.disconnectedCallback(), this.cleanupIntersectionObserver();
|
|
1363
|
-
}
|
|
1364
|
-
updated(t) {
|
|
1365
|
-
super.updated(t), (t.has("name") || t.has("imageSrc") || t.has("walletRank")) && (this.hasImpressionSent = !1), t.has("walletRank") && this.walletRank && !this.intersectionObserver && this.setupIntersectionObserver();
|
|
1366
|
-
}
|
|
1367
|
-
setupIntersectionObserver() {
|
|
1368
|
-
this.intersectionObserver = new IntersectionObserver((t) => {
|
|
1369
|
-
t.forEach((i) => {
|
|
1370
|
-
i.isIntersecting && !this.loading && !this.hasImpressionSent && this.sendImpressionEvent();
|
|
1371
|
-
});
|
|
1372
|
-
}, { threshold: 0.1 }), this.intersectionObserver.observe(this);
|
|
1373
|
-
}
|
|
1374
|
-
cleanupIntersectionObserver() {
|
|
1375
|
-
this.intersectionObserver && (this.intersectionObserver.disconnect(), this.intersectionObserver = void 0);
|
|
1376
|
-
}
|
|
1377
|
-
sendImpressionEvent() {
|
|
1378
|
-
!this.name || this.hasImpressionSent || !this.walletRank || (this.hasImpressionSent = !0, (this.rdnsId || this.name) && U.sendWalletImpressionEvent({
|
|
1379
|
-
name: this.name,
|
|
1380
|
-
walletRank: this.walletRank,
|
|
1381
|
-
rdnsId: this.rdnsId,
|
|
1382
|
-
view: c.state.view,
|
|
1383
|
-
displayIndex: this.displayIndex
|
|
1384
|
-
}));
|
|
1385
|
-
}
|
|
1386
|
-
handleGetWalletNamespaces() {
|
|
1387
|
-
return Object.keys(we.state.adapters).length > 1 ? this.namespaces : [];
|
|
1388
|
-
}
|
|
1389
|
-
render() {
|
|
1390
|
-
return d`
|
|
1391
|
-
<wui-list-wallet
|
|
1392
|
-
.walletImages=${this.walletImages}
|
|
1393
|
-
imageSrc=${W(this.imageSrc)}
|
|
1394
|
-
name=${this.name}
|
|
1395
|
-
size=${W(this.size)}
|
|
1396
|
-
tagLabel=${W(this.tagLabel)}
|
|
1397
|
-
.tagVariant=${this.tagVariant}
|
|
1398
|
-
.walletIcon=${this.walletIcon}
|
|
1399
|
-
.tabIdx=${this.tabIdx}
|
|
1400
|
-
.disabled=${this.disabled}
|
|
1401
|
-
.showAllWallets=${this.showAllWallets}
|
|
1402
|
-
.loading=${this.loading}
|
|
1403
|
-
loadingSpinnerColor=${this.loadingSpinnerColor}
|
|
1404
|
-
.namespaces=${this.handleGetWalletNamespaces()}
|
|
1405
|
-
></wui-list-wallet>
|
|
1406
|
-
`;
|
|
1407
|
-
}
|
|
1408
|
-
};
|
|
1409
|
-
h.styles = _e;
|
|
1410
|
-
p([
|
|
1411
|
-
l({ type: Array })
|
|
1412
|
-
], h.prototype, "walletImages", void 0);
|
|
1413
|
-
p([
|
|
1414
|
-
l()
|
|
1415
|
-
], h.prototype, "imageSrc", void 0);
|
|
1416
|
-
p([
|
|
1417
|
-
l()
|
|
1418
|
-
], h.prototype, "name", void 0);
|
|
1419
|
-
p([
|
|
1420
|
-
l()
|
|
1421
|
-
], h.prototype, "size", void 0);
|
|
1422
|
-
p([
|
|
1423
|
-
l()
|
|
1424
|
-
], h.prototype, "tagLabel", void 0);
|
|
1425
|
-
p([
|
|
1426
|
-
l()
|
|
1427
|
-
], h.prototype, "tagVariant", void 0);
|
|
1428
|
-
p([
|
|
1429
|
-
l()
|
|
1430
|
-
], h.prototype, "walletIcon", void 0);
|
|
1431
|
-
p([
|
|
1432
|
-
l()
|
|
1433
|
-
], h.prototype, "tabIdx", void 0);
|
|
1434
|
-
p([
|
|
1435
|
-
l({ type: Boolean })
|
|
1436
|
-
], h.prototype, "disabled", void 0);
|
|
1437
|
-
p([
|
|
1438
|
-
l({ type: Boolean })
|
|
1439
|
-
], h.prototype, "showAllWallets", void 0);
|
|
1440
|
-
p([
|
|
1441
|
-
l({ type: Boolean })
|
|
1442
|
-
], h.prototype, "loading", void 0);
|
|
1443
|
-
p([
|
|
1444
|
-
l({ type: String })
|
|
1445
|
-
], h.prototype, "loadingSpinnerColor", void 0);
|
|
1446
|
-
p([
|
|
1447
|
-
l()
|
|
1448
|
-
], h.prototype, "rdnsId", void 0);
|
|
1449
|
-
p([
|
|
1450
|
-
l()
|
|
1451
|
-
], h.prototype, "displayIndex", void 0);
|
|
1452
|
-
p([
|
|
1453
|
-
l()
|
|
1454
|
-
], h.prototype, "walletRank", void 0);
|
|
1455
|
-
p([
|
|
1456
|
-
l({ type: Array })
|
|
1457
|
-
], h.prototype, "namespaces", void 0);
|
|
1458
|
-
h = p([
|
|
1459
|
-
w("w3m-list-wallet")
|
|
1460
|
-
], h);
|
|
1461
|
-
const De = C`
|
|
1462
|
-
:host {
|
|
1463
|
-
--local-duration-height: 0s;
|
|
1464
|
-
--local-duration: ${({ durations: e }) => e.lg};
|
|
1465
|
-
--local-transition: ${({ easings: e }) => e["ease-out-power-2"]};
|
|
1466
|
-
}
|
|
1467
|
-
|
|
1468
|
-
.container {
|
|
1469
|
-
display: block;
|
|
1470
|
-
overflow: hidden;
|
|
1471
|
-
overflow: hidden;
|
|
1472
|
-
position: relative;
|
|
1473
|
-
height: var(--local-container-height);
|
|
1474
|
-
transition: height var(--local-duration-height) var(--local-transition);
|
|
1475
|
-
will-change: height, padding-bottom;
|
|
1476
|
-
}
|
|
1477
|
-
|
|
1478
|
-
.container[data-mobile-fullscreen='true'] {
|
|
1479
|
-
overflow: scroll;
|
|
1480
|
-
}
|
|
1481
|
-
|
|
1482
|
-
.page {
|
|
1483
|
-
position: absolute;
|
|
1484
|
-
top: 0;
|
|
1485
|
-
left: 0;
|
|
1486
|
-
right: 0;
|
|
1487
|
-
width: 100%;
|
|
1488
|
-
height: auto;
|
|
1489
|
-
width: inherit;
|
|
1490
|
-
box-sizing: border-box;
|
|
1491
|
-
display: flex;
|
|
1492
|
-
flex-direction: column;
|
|
1493
|
-
background-color: ${({ tokens: e }) => e.theme.backgroundPrimary};
|
|
1494
|
-
border-bottom-left-radius: var(--local-border-bottom-radius);
|
|
1495
|
-
border-bottom-right-radius: var(--local-border-bottom-radius);
|
|
1496
|
-
transition: border-bottom-left-radius var(--local-duration) var(--local-transition);
|
|
1497
|
-
}
|
|
1498
|
-
|
|
1499
|
-
.page[data-mobile-fullscreen='true'] {
|
|
1500
|
-
height: 100%;
|
|
1501
|
-
}
|
|
1502
|
-
|
|
1503
|
-
.page-content {
|
|
1504
|
-
display: flex;
|
|
1505
|
-
flex-direction: column;
|
|
1506
|
-
min-height: 100%;
|
|
1507
|
-
}
|
|
1508
|
-
|
|
1509
|
-
.footer {
|
|
1510
|
-
height: var(--apkt-footer-height);
|
|
1511
|
-
}
|
|
1512
|
-
|
|
1513
|
-
div.page[view-direction^='prev-'] .page-content {
|
|
1514
|
-
animation:
|
|
1515
|
-
slide-left-out var(--local-duration) forwards var(--local-transition),
|
|
1516
|
-
slide-left-in var(--local-duration) forwards var(--local-transition);
|
|
1517
|
-
animation-delay: 0ms, var(--local-duration, ${({ durations: e }) => e.lg});
|
|
1518
|
-
}
|
|
1519
|
-
|
|
1520
|
-
div.page[view-direction^='next-'] .page-content {
|
|
1521
|
-
animation:
|
|
1522
|
-
slide-right-out var(--local-duration) forwards var(--local-transition),
|
|
1523
|
-
slide-right-in var(--local-duration) forwards var(--local-transition);
|
|
1524
|
-
animation-delay: 0ms, var(--local-duration, ${({ durations: e }) => e.lg});
|
|
1525
|
-
}
|
|
1526
|
-
|
|
1527
|
-
@keyframes slide-left-out {
|
|
1528
|
-
from {
|
|
1529
|
-
transform: translateX(0px) scale(1);
|
|
1530
|
-
opacity: 1;
|
|
1531
|
-
filter: blur(0px);
|
|
1532
|
-
}
|
|
1533
|
-
to {
|
|
1534
|
-
transform: translateX(8px) scale(0.99);
|
|
1535
|
-
opacity: 0;
|
|
1536
|
-
filter: blur(4px);
|
|
1537
|
-
}
|
|
1538
|
-
}
|
|
1539
|
-
|
|
1540
|
-
@keyframes slide-left-in {
|
|
1541
|
-
from {
|
|
1542
|
-
transform: translateX(-8px) scale(0.99);
|
|
1543
|
-
opacity: 0;
|
|
1544
|
-
filter: blur(4px);
|
|
1545
|
-
}
|
|
1546
|
-
to {
|
|
1547
|
-
transform: translateX(0) translateY(0) scale(1);
|
|
1548
|
-
opacity: 1;
|
|
1549
|
-
filter: blur(0px);
|
|
1550
|
-
}
|
|
1551
|
-
}
|
|
1552
|
-
|
|
1553
|
-
@keyframes slide-right-out {
|
|
1554
|
-
from {
|
|
1555
|
-
transform: translateX(0px) scale(1);
|
|
1556
|
-
opacity: 1;
|
|
1557
|
-
filter: blur(0px);
|
|
1558
|
-
}
|
|
1559
|
-
to {
|
|
1560
|
-
transform: translateX(-8px) scale(0.99);
|
|
1561
|
-
opacity: 0;
|
|
1562
|
-
filter: blur(4px);
|
|
1563
|
-
}
|
|
1564
|
-
}
|
|
1565
|
-
|
|
1566
|
-
@keyframes slide-right-in {
|
|
1567
|
-
from {
|
|
1568
|
-
transform: translateX(8px) scale(0.99);
|
|
1569
|
-
opacity: 0;
|
|
1570
|
-
filter: blur(4px);
|
|
1571
|
-
}
|
|
1572
|
-
to {
|
|
1573
|
-
transform: translateX(0) translateY(0) scale(1);
|
|
1574
|
-
opacity: 1;
|
|
1575
|
-
filter: blur(0px);
|
|
1576
|
-
}
|
|
1577
|
-
}
|
|
1578
|
-
`;
|
|
1579
|
-
var S = function(e, t, i, r) {
|
|
1580
|
-
var a = arguments.length, o = a < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, n;
|
|
1581
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o = Reflect.decorate(e, t, i, r);
|
|
1582
|
-
else for (var s = e.length - 1; s >= 0; s--) (n = e[s]) && (o = (a < 3 ? n(o) : a > 3 ? n(t, i, o) : n(t, i)) || o);
|
|
1583
|
-
return a > 3 && o && Object.defineProperty(t, i, o), o;
|
|
1584
|
-
};
|
|
1585
|
-
const He = 60;
|
|
1586
|
-
let f = class extends y {
|
|
1587
|
-
constructor() {
|
|
1588
|
-
super(...arguments), this.resizeObserver = void 0, this.transitionDuration = "0.15s", this.transitionFunction = "", this.history = "", this.view = "", this.setView = void 0, this.viewDirection = "", this.historyState = "", this.previousHeight = "0px", this.mobileFullScreen = R.state.enableMobileFullScreen, this.onViewportResize = () => {
|
|
1589
|
-
this.updateContainerHeight();
|
|
1590
|
-
};
|
|
1591
|
-
}
|
|
1592
|
-
updated(t) {
|
|
1593
|
-
if (t.has("history")) {
|
|
1594
|
-
const i = this.history;
|
|
1595
|
-
this.historyState !== "" && this.historyState !== i && this.onViewChange(i);
|
|
1596
|
-
}
|
|
1597
|
-
t.has("transitionDuration") && this.style.setProperty("--local-duration", this.transitionDuration), t.has("transitionFunction") && this.style.setProperty("--local-transition", this.transitionFunction);
|
|
1598
|
-
}
|
|
1599
|
-
firstUpdated() {
|
|
1600
|
-
var t;
|
|
1601
|
-
this.transitionFunction && this.style.setProperty("--local-transition", this.transitionFunction), this.style.setProperty("--local-duration", this.transitionDuration), this.historyState = this.history, this.resizeObserver = new ResizeObserver((i) => {
|
|
1602
|
-
var r;
|
|
1603
|
-
for (const a of i)
|
|
1604
|
-
if (a.target === this.getWrapper()) {
|
|
1605
|
-
let o = a.contentRect.height;
|
|
1606
|
-
const n = parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--apkt-footer-height") || "0");
|
|
1607
|
-
if (this.mobileFullScreen) {
|
|
1608
|
-
const s = ((r = window.visualViewport) == null ? void 0 : r.height) || window.innerHeight, m = this.getHeaderHeight();
|
|
1609
|
-
o = s - m - n, this.style.setProperty("--local-border-bottom-radius", "0px");
|
|
1610
|
-
} else
|
|
1611
|
-
o = o + n, this.style.setProperty("--local-border-bottom-radius", n ? "var(--apkt-borderRadius-5)" : "0px");
|
|
1612
|
-
this.style.setProperty("--local-container-height", `${o}px`), this.previousHeight !== "0px" && this.style.setProperty("--local-duration-height", this.transitionDuration), this.previousHeight = `${o}px`;
|
|
1613
|
-
}
|
|
1614
|
-
}), this.resizeObserver.observe(this.getWrapper()), this.updateContainerHeight(), window.addEventListener("resize", this.onViewportResize), (t = window.visualViewport) == null || t.addEventListener("resize", this.onViewportResize);
|
|
1615
|
-
}
|
|
1616
|
-
disconnectedCallback() {
|
|
1617
|
-
var i;
|
|
1618
|
-
const t = this.getWrapper();
|
|
1619
|
-
t && this.resizeObserver && this.resizeObserver.unobserve(t), window.removeEventListener("resize", this.onViewportResize), (i = window.visualViewport) == null || i.removeEventListener("resize", this.onViewportResize);
|
|
1620
|
-
}
|
|
1621
|
-
render() {
|
|
1622
|
-
return d`
|
|
1623
|
-
<div class="container" data-mobile-fullscreen="${W(this.mobileFullScreen)}">
|
|
1624
|
-
<div
|
|
1625
|
-
class="page"
|
|
1626
|
-
data-mobile-fullscreen="${W(this.mobileFullScreen)}"
|
|
1627
|
-
view-direction="${this.viewDirection}"
|
|
1628
|
-
>
|
|
1629
|
-
<div class="page-content">
|
|
1630
|
-
<slot></slot>
|
|
1631
|
-
</div>
|
|
1632
|
-
</div>
|
|
1633
|
-
</div>
|
|
1634
|
-
`;
|
|
1635
|
-
}
|
|
1636
|
-
onViewChange(t) {
|
|
1637
|
-
const i = t.split(",").filter(Boolean), r = this.historyState.split(",").filter(Boolean), a = r.length, o = i.length, n = i[i.length - 1] || "", s = ne.cssDurationToNumber(this.transitionDuration);
|
|
1638
|
-
let m = "";
|
|
1639
|
-
o > a ? m = "next" : o < a ? m = "prev" : o === a && i[o - 1] !== r[a - 1] && (m = "next"), this.viewDirection = `${m}-${n}`, setTimeout(() => {
|
|
1640
|
-
var b;
|
|
1641
|
-
this.historyState = t, (b = this.setView) == null || b.call(this, n);
|
|
1642
|
-
}, s), setTimeout(() => {
|
|
1643
|
-
this.viewDirection = "";
|
|
1644
|
-
}, s * 2);
|
|
1645
|
-
}
|
|
1646
|
-
getWrapper() {
|
|
1647
|
-
var t;
|
|
1648
|
-
return (t = this.shadowRoot) == null ? void 0 : t.querySelector("div.page");
|
|
1649
|
-
}
|
|
1650
|
-
updateContainerHeight() {
|
|
1651
|
-
var a;
|
|
1652
|
-
const t = this.getWrapper();
|
|
1653
|
-
if (!t)
|
|
1654
|
-
return;
|
|
1655
|
-
const i = parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--apkt-footer-height") || "0");
|
|
1656
|
-
let r = 0;
|
|
1657
|
-
if (this.mobileFullScreen) {
|
|
1658
|
-
const o = ((a = window.visualViewport) == null ? void 0 : a.height) || window.innerHeight, n = this.getHeaderHeight();
|
|
1659
|
-
r = o - n - i, this.style.setProperty("--local-border-bottom-radius", "0px");
|
|
1660
|
-
} else
|
|
1661
|
-
r = t.getBoundingClientRect().height + i, this.style.setProperty("--local-border-bottom-radius", i ? "var(--apkt-borderRadius-5)" : "0px");
|
|
1662
|
-
this.style.setProperty("--local-container-height", `${r}px`), this.previousHeight !== "0px" && this.style.setProperty("--local-duration-height", this.transitionDuration), this.previousHeight = `${r}px`;
|
|
1663
|
-
}
|
|
1664
|
-
getHeaderHeight() {
|
|
1665
|
-
return He;
|
|
1666
|
-
}
|
|
1667
|
-
};
|
|
1668
|
-
f.styles = [De];
|
|
1669
|
-
S([
|
|
1670
|
-
l({ type: String })
|
|
1671
|
-
], f.prototype, "transitionDuration", void 0);
|
|
1672
|
-
S([
|
|
1673
|
-
l({ type: String })
|
|
1674
|
-
], f.prototype, "transitionFunction", void 0);
|
|
1675
|
-
S([
|
|
1676
|
-
l({ type: String })
|
|
1677
|
-
], f.prototype, "history", void 0);
|
|
1678
|
-
S([
|
|
1679
|
-
l({ type: String })
|
|
1680
|
-
], f.prototype, "view", void 0);
|
|
1681
|
-
S([
|
|
1682
|
-
l({ attribute: !1 })
|
|
1683
|
-
], f.prototype, "setView", void 0);
|
|
1684
|
-
S([
|
|
1685
|
-
u()
|
|
1686
|
-
], f.prototype, "viewDirection", void 0);
|
|
1687
|
-
S([
|
|
1688
|
-
u()
|
|
1689
|
-
], f.prototype, "historyState", void 0);
|
|
1690
|
-
S([
|
|
1691
|
-
u()
|
|
1692
|
-
], f.prototype, "previousHeight", void 0);
|
|
1693
|
-
S([
|
|
1694
|
-
u()
|
|
1695
|
-
], f.prototype, "mobileFullScreen", void 0);
|
|
1696
|
-
f = S([
|
|
1697
|
-
w("w3m-router-container")
|
|
1698
|
-
], f);
|
|
1699
|
-
export {
|
|
1700
|
-
re as AppKitModal,
|
|
1701
|
-
h as W3mListWallet,
|
|
1702
|
-
oe as W3mModal,
|
|
1703
|
-
v as W3mModalBase,
|
|
1704
|
-
f as W3mRouterContainer,
|
|
1705
|
-
M as W3mUsageExceededView
|
|
1706
|
-
};
|