@txnlab/use-wallet 4.3.0 → 4.3.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.
- package/dist/index.cjs +347 -465
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -24
- package/dist/index.d.ts +2 -24
- package/dist/index.js +345 -462
- package/dist/index.js.map +1 -1
- package/package.json +10 -15
package/dist/index.cjs
CHANGED
|
@@ -30,43 +30,43 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
30
30
|
));
|
|
31
31
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
32
|
|
|
33
|
-
// ../../node_modules/.pnpm/@magic-sdk+types@24.
|
|
34
|
-
var m, v, u, _, f, g, Z, E,
|
|
33
|
+
// ../../node_modules/.pnpm/@magic-sdk+types@24.21.0/node_modules/@magic-sdk/types/dist/es/index.mjs
|
|
34
|
+
var m, v, u, _, f, g, Z, E, y, x, A, R, I, N, h, T, O, S, b, C, F, U, k, L, w, D, V, G, H, q, W, J, Y, B, P, j, Q, X, z;
|
|
35
35
|
var init_es = __esm({
|
|
36
|
-
"../../node_modules/.pnpm/@magic-sdk+types@24.
|
|
36
|
+
"../../node_modules/.pnpm/@magic-sdk+types@24.21.0/node_modules/@magic-sdk/types/dist/es/index.mjs"() {
|
|
37
37
|
"use strict";
|
|
38
|
-
m = ((
|
|
39
|
-
v = ((
|
|
38
|
+
m = ((o) => (o.MissingApiKey = "MISSING_API_KEY", o.ModalNotReady = "MODAL_NOT_READY", o.ConnectionLost = "CONNECTION_WAS_LOST", o.MalformedResponse = "MALFORMED_RESPONSE", o.InvalidArgument = "INVALID_ARGUMENT", o.ExtensionNotInitialized = "EXTENSION_NOT_INITIALIZED", o.IncompatibleExtensions = "INCOMPATIBLE_EXTENSIONS", o))(m || {});
|
|
39
|
+
v = ((s) => (s.SyncWeb3Method = "SYNC_WEB3_METHOD", s.DuplicateIframe = "DUPLICATE_IFRAME", s.ReactNativeEndpointConfiguration = "REACT_NATIVE_ENDPOINT_CONFIGURATION", s.DeprecationNotice = "DEPRECATION_NOTICE", s.ProductAnnouncement = "ANNOUNCEMENT", s))(v || {});
|
|
40
40
|
u = ((i) => (i[i.ParseError = -32700] = "ParseError", i[i.InvalidRequest = -32600] = "InvalidRequest", i[i.MethodNotFound = -32601] = "MethodNotFound", i[i.InvalidParams = -32602] = "InvalidParams", i[i.InternalError = -32603] = "InternalError", i[i.MagicLinkFailedVerification = -1e4] = "MagicLinkFailedVerification", i[i.MagicLinkExpired = -10001] = "MagicLinkExpired", i[i.MagicLinkRateLimited = -10002] = "MagicLinkRateLimited", i[i.MagicLinkInvalidRedirectURL = -10006] = "MagicLinkInvalidRedirectURL", i[i.UserAlreadyLoggedIn = -10003] = "UserAlreadyLoggedIn", i[i.UpdateEmailFailed = -10004] = "UpdateEmailFailed", i[i.UserRequestEditEmail = -10005] = "UserRequestEditEmail", i[i.InactiveRecipient = -10010] = "InactiveRecipient", i[i.AccessDeniedToUser = -10011] = "AccessDeniedToUser", i[i.RedirectLoginComplete = -10015] = "RedirectLoginComplete", i[i.DpopInvalidated = -10019] = "DpopInvalidated", i))(u || {});
|
|
41
41
|
_ = ((t) => (t.PROVIDER = "magic_3pw_provider", t.ADDRESS = "magic_3pw_address", t.CHAIN_ID = "magic_3pw_chainId", t))(_ || {});
|
|
42
42
|
f = ((t) => (t.WalletConnected = "wallet_connected", t.WalletRejected = "wallet_rejected", t.Web3ModalSelected = "web3modal_selected", t))(f || {});
|
|
43
43
|
g = ((e) => (e.LoginWithSms = "magic_auth_login_with_sms", e.LoginWithEmailOTP = "magic_auth_login_with_email_otp", e.LoginWithMagicLink = "magic_auth_login_with_magic_link", e.LoginWithCredential = "magic_auth_login_with_credential", e.SetAuthorizationToken = "magic_auth_set_authorization_token", e.GetIdToken = "magic_auth_get_id_token", e.GenerateIdToken = "magic_auth_generate_id_token", e.GetMetadata = "magic_auth_get_metadata", e.IsLoggedIn = "magic_is_logged_in", e.Logout = "magic_auth_logout", e.UpdateEmail = "magic_auth_update_email", e.UserSettings = "magic_auth_settings", e.UserSettingsTestMode = "magic_auth_settings_testing_mode", e.LoginWithSmsTestMode = "magic_auth_login_with_sms_testing_mode", e.LoginWithEmailOTPTestMode = "magic_auth_login_with_email_otp_testing_mode", e.LoginWithMagicLinkTestMode = "magic_login_with_magic_link_testing_mode", e.LoginWithCredentialTestMode = "magic_auth_login_with_credential_testing_mode", e.GetIdTokenTestMode = "magic_auth_get_id_token_testing_mode", e.GenerateIdTokenTestMode = "magic_auth_generate_id_token_testing_mode", e.GetMetadataTestMode = "magic_auth_get_metadata_testing_mode", e.IsLoggedInTestMode = "magic_auth_is_logged_in_testing_mode", e.LogoutTestMode = "magic_auth_logout_testing_mode", e.UpdateEmailTestMode = "magic_auth_update_email_testing_mode", e.IntermediaryEvent = "magic_intermediary_event", e.RequestAccounts = "eth_requestAccounts", e.GetInfo = "magic_get_info", e.ShowUI = "magic_wallet", e.NFTPurchase = "magic_nft_purchase", e.NFTCheckout = "magic_nft_checkout", e.NFTTransfer = "magic_nft_transfer", e.RequestUserInfoWithUI = "mc_request_user_info", e.Disconnect = "mc_disconnect", e.RecoverAccount = "magic_auth_recover_account", e.RecoverAccountTestMode = "magic_auth_recover_account_testing_mode", e.MagicBoxHeartBeat = "magic_box_heart_beat", e.AutoConnect = "mc_auto_connect", e.Login = "mc_login", e.EncryptV1 = "magic_auth_encrypt_v1", e.DecryptV1 = "magic_auth_decrypt_v1", e.ShowNFTs = "magic_show_nfts", e.ShowOnRamp = "magic_show_fiat_onramp", e.ShowSendTokensUI = "magic_show_send_tokens_ui", e.ShowAddress = "magic_show_address", e.ShowBalances = "magic_show_balances", e.SendGaslessTransaction = "eth_sendGaslessTransaction", e.RevealPK = "magic_reveal_key", e.EnableMFA = "magic_auth_enable_mfa_flow", e.DisableMFA = "magic_auth_disable_mfa_flow", e))(g || {});
|
|
44
44
|
Z = ["magic_intermediary_event", "magic_nft_checkout", "mc_login"];
|
|
45
|
-
E = ((
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
E = ((c) => (c.MAGIC_HANDLE_RESPONSE = "MAGIC_HANDLE_RESPONSE", c.MAGIC_OVERLAY_READY = "MAGIC_OVERLAY_READY", c.MAGIC_SHOW_OVERLAY = "MAGIC_SHOW_OVERLAY", c.MAGIC_HIDE_OVERLAY = "MAGIC_HIDE_OVERLAY", c.MAGIC_HANDLE_EVENT = "MAGIC_HANDLE_EVENT", c.MAGIC_MG_BOX_SEND_RECEIPT = "MAGIC_MG_BOX_SEND_RECEIPT", c.MAGIC_SEND_PRODUCT_ANNOUNCEMENT = "MAGIC_SEND_PRODUCT_ANNOUNCEMENT", c.MAGIC_PONG = "MAGIC_PONG", c.MAGIC_POPUP_RESPONSE = "MAGIC_POPUP_RESPONSE", c.MAGIC_POPUP_OAUTH_VERIFY_RESPONSE = "MAGIC_POPUP_OAUTH_VERIFY_RESPONSE", c))(E || {});
|
|
46
|
+
y = ((l) => (l.MAGIC_HANDLE_REQUEST = "MAGIC_HANDLE_REQUEST", l.MAGIC_PING = "MAGIC_PING", l))(y || {});
|
|
47
|
+
x = ((t) => (t.UpdateEmail = "update-email", t.MFA = "mfa", t.Recovery = "recovery", t))(x || {});
|
|
48
48
|
A = ((r10) => (r10.Retry = "retry", r10))(A || {});
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
R = ((l) => (l.EmailSent = "email-sent", l.EmailNotDeliverable = "email-not-deliverable", l))(R || {});
|
|
50
|
+
I = ((s) => (s.VerifyEmailOtp = "verify-email-otp", s.VerifyMFACode = "verify-mfa-code", s.LostDevice = "lost-device", s.VerifyRecoveryCode = "verify-recovery-code", s.Cancel = "cancel", s))(I || {});
|
|
51
51
|
N = ((t) => (t.VerifySmsOtp = "verify-sms-otp", t.Cancel = "cancel", t.Retry = "retry", t))(N || {});
|
|
52
52
|
h = ((t) => (t.SmsOTPSent = "sms-otp-sent", t.InvalidSmsOtp = "invalid-sms-otp", t.ExpiredSmsOtp = "expired-sms-otp", t))(h || {});
|
|
53
|
-
T = ((
|
|
53
|
+
T = ((d) => (d.EmailOTPSent = "email-otp-sent", d.InvalidEmailOtp = "invalid-email-otp", d.InvalidMfaOtp = "invalid-mfa-otp", d.ExpiredEmailOtp = "expired-email-otp", d.MfaSentHandle = "mfa-sent-handle", d.RecoveryCodeSentHandle = "recovery-code-sent-handle", d.InvalidRecoveryCode = "invalid-recovery-code", d.RecoveryCodeSuccess = "recovery-code-success", d.LoginThrottled = "login-throttled", d))(T || {});
|
|
54
54
|
O = ((r10) => (r10.Retry = "device-retry", r10))(O || {});
|
|
55
55
|
S = ((n) => (n.DeviceApproved = "device-approved", n.DeviceNeedsApproval = "device-needs-approval", n.DeviceVerificationLinkExpired = "device-verification-link-expired", n.DeviceVerificationEmailSent = "device-verification-email-sent", n))(S || {});
|
|
56
56
|
b = ((n) => (n.Retry = "Recency/auth-factor-retry", n.Cancel = "Recency/auth-factor-verification-cancel", n.VerifyEmailOtp = "Recency/auth-factor-verify-email-otp", n.VerifyMFACode = "Recency/verify-mfa-code", n))(b || {});
|
|
57
57
|
C = ((a) => (a.PrimaryAuthFactorNeedsVerification = "Recency/auth-factor-needs-verification", a.PrimaryAuthFactorVerified = "Recency/auth-factor-verified", a.InvalidEmailOtp = "Recency/auth-factor-invalid-email-otp", a.EmailExpired = "Recency/auth-factor-verification-email-expired", a.EmailSent = "Recency/auth-factor-verification-email-sent", a.EmailNotDeliverable = "Recency/auth-factor-verification-email-not-deliverable", a))(C || {});
|
|
58
58
|
F = ((t) => (t.RetryWithNewEmail = "UpdateEmail/retry-with-new-email", t.Cancel = "UpdateEmail/new-email-verification-cancel", t.VerifyEmailOtp = "UpdateEmail/new-email-verify-otp", t))(F || {});
|
|
59
|
-
U = ((
|
|
59
|
+
U = ((p2) => (p2.NewAuthFactorNeedsVerification = "UpdateEmail/new-email-needs-verification", p2.EmailUpdated = "UpdateEmail/email-updated", p2.InvalidEmailOtp = "UpdateEmail/new-email-invalid-email-otp", p2.EmailExpired = "UpdateEmail/new-email-verification-email-expired", p2.EmailSent = "UpdateEmail/new-email-verification-email-sent", p2.EmailNotDeliverable = "UpdateEmail/new-email-verification-email-not-deliverable", p2.InvalidEmail = "UpdateEmail/new-email-invalid", p2.EmailAlreadyExists = "UpdateEmail/new-email-already-exists", p2))(U || {});
|
|
60
60
|
k = ((r10) => (r10.IDTokenCreated = "Auth/id-token-created", r10))(k || {});
|
|
61
61
|
L = ((r10) => (r10.Cancel = "Farcaster/cancel", r10))(L || {});
|
|
62
62
|
w = ((t) => (t.MFASecretGenerated = "mfa-secret-generated", t.InvalidMFAOtp = "invalid-mfa-otp", t.MFARecoveryCodes = "mfa-recovery-codes", t))(w || {});
|
|
63
|
-
D = ((
|
|
63
|
+
D = ((l) => (l.VerifyMFACode = "verify-mfa-code", l.Cancel = "cancel-mfa-setup", l))(D || {});
|
|
64
64
|
V = ((t) => (t.MFACodeRequested = "mfa-code-requested", t.InvalidMFAOtp = "invalid-mfa-otp", t.InvalidRecoveryCode = "invalid-recovery-code", t))(V || {});
|
|
65
65
|
G = ((t) => (t.VerifyMFACode = "verify-mfa-code", t.LostDevice = "lost-device", t.Cancel = "cancel-mfa-disable", t))(G || {});
|
|
66
66
|
H = ((r10) => (r10.Harmony = "HARMONY", r10))(H || {});
|
|
67
67
|
q = ((r10) => (r10.ClosedByUser = "closed-by-user", r10))(q || {});
|
|
68
68
|
W = ((r10) => (r10.ClosedByUser = "closed-by-user-on-received", r10))(W || {});
|
|
69
|
-
J = ((o) => (o.EnterNewPhoneNumber = "enter-new-phone-number", o.EnterOtpCode = "enter-otp-code", o.RecoveryFactorAlreadyExists = "recovery-factor-already-exists", o.MalformedPhoneNumber = "malformed-phone-number", o.InvalidOtpCode = "invalid-otp-code", o))(J || {});
|
|
69
|
+
J = ((o) => (o.EnterNewPhoneNumber = "enter-new-phone-number", o.EnterOtpCode = "enter-otp-code", o.RecoveryFactorAlreadyExists = "recovery-factor-already-exists", o.MalformedPhoneNumber = "malformed-phone-number", o.InvalidOtpCode = "invalid-otp-code", o.RecoveryFactorUpdated = "recovery-factor-updated", o.RecoveryFactorDeleted = "recovery-factor-deleted", o))(J || {});
|
|
70
70
|
Y = ((n) => (n.SendNewPhoneNumber = "send-new-phone-number", n.SendOtpCode = "send-otp-code", n.Cancel = "cancel", n.StartEditPhoneNumber = "start-edit-phone-number", n))(Y || {});
|
|
71
71
|
B = ((r10) => (r10.PhoneNumber = "phone_number", r10))(B || {});
|
|
72
72
|
P = ((a) => (a.SmsOtpSent = "sms-otp-sent", a.LoginThrottled = "login-throttled", a.InvalidSmsOtp = "invalid-sms-otp", a.SmsVerified = "sms-verified", a.AccountRecovered = "account-recovered", a.UpdateEmailRequired = "update-email-required", a))(P || {});
|
|
@@ -77,7 +77,7 @@ var init_es = __esm({
|
|
|
77
77
|
}
|
|
78
78
|
});
|
|
79
79
|
|
|
80
|
-
// ../../node_modules/.pnpm/@magic-sdk+provider@29.
|
|
80
|
+
// ../../node_modules/.pnpm/@magic-sdk+provider@29.4.2_localforage@1.10.0/node_modules/@magic-sdk/provider/dist/es/index.mjs
|
|
81
81
|
function or(r10) {
|
|
82
82
|
let e = { exports: {} };
|
|
83
83
|
return r10(e, e.exports), e.exports;
|
|
@@ -94,28 +94,28 @@ function Gr(r10) {
|
|
|
94
94
|
function Kr(r10) {
|
|
95
95
|
return decodeURIComponent(Array.from(atob(r10), Jr).join(""));
|
|
96
96
|
}
|
|
97
|
-
function
|
|
97
|
+
function ce(r10) {
|
|
98
98
|
return Gr(JSON.stringify(r10));
|
|
99
99
|
}
|
|
100
100
|
function at(r10) {
|
|
101
101
|
return JSON.parse(Kr(r10));
|
|
102
102
|
}
|
|
103
|
-
function
|
|
103
|
+
function N2(r10) {
|
|
104
104
|
return typeof r10 > "u";
|
|
105
105
|
}
|
|
106
106
|
function Br(r10) {
|
|
107
107
|
return r10 === null;
|
|
108
108
|
}
|
|
109
|
-
function
|
|
110
|
-
return Br(r10) ||
|
|
109
|
+
function le(r10) {
|
|
110
|
+
return Br(r10) || N2(r10);
|
|
111
111
|
}
|
|
112
112
|
function ct(r10) {
|
|
113
|
-
return
|
|
113
|
+
return le(r10) ? false : !N2(r10.jsonrpc) && !N2(r10.id) && (!N2(r10.result) || !N2(r10.error));
|
|
114
114
|
}
|
|
115
115
|
function lt(r10) {
|
|
116
|
-
return
|
|
116
|
+
return le(r10) ? false : typeof r10 == "number" && Object.values(u).includes(r10);
|
|
117
117
|
}
|
|
118
|
-
function
|
|
118
|
+
function ee(r10) {
|
|
119
119
|
if (!r10) return true;
|
|
120
120
|
for (let e in r10) if (Object.hasOwnProperty.call(r10, e)) return false;
|
|
121
121
|
return true;
|
|
@@ -170,11 +170,11 @@ function* zr() {
|
|
|
170
170
|
let r10 = 0;
|
|
171
171
|
for (; ; ) r10 < Number.MAX_SAFE_INTEGER ? yield ++r10 : r10 = 0;
|
|
172
172
|
}
|
|
173
|
-
function
|
|
173
|
+
function $e() {
|
|
174
174
|
return Yr.next().value;
|
|
175
175
|
}
|
|
176
176
|
function O2(r10) {
|
|
177
|
-
return async (...e) => (
|
|
177
|
+
return async (...e) => (pe || (pe = await m2.configureStorage()), await pe.ready(), pe[r10](...e));
|
|
178
178
|
}
|
|
179
179
|
function vt() {
|
|
180
180
|
let r10 = window.crypto.getRandomValues(new Uint8Array(16));
|
|
@@ -182,12 +182,12 @@ function vt() {
|
|
|
182
182
|
let e = "";
|
|
183
183
|
return e += r10[0].toString(16), e += r10[1].toString(16), e += r10[2].toString(16), e += r10[3].toString(16), e += "-", e += r10[4].toString(16), e += r10[5].toString(16), e += "-", e += r10[6].toString(16), e += r10[7].toString(16), e += "-", e += r10[8].toString(16), e += r10[9].toString(16), e += "-", e += r10[10].toString(16), e += r10[11].toString(16), e += r10[12].toString(16), e += r10[13].toString(16), e += r10[14].toString(16), e += r10[15].toString(16), e;
|
|
184
184
|
}
|
|
185
|
-
function
|
|
185
|
+
function re() {
|
|
186
186
|
let r10 = typeof window < "u" && !!window.crypto, e = r10 && !!window.crypto.subtle;
|
|
187
187
|
return r10 && e;
|
|
188
188
|
}
|
|
189
189
|
function bt() {
|
|
190
|
-
A2(
|
|
190
|
+
A2(he), A2(Oe);
|
|
191
191
|
}
|
|
192
192
|
async function Pt() {
|
|
193
193
|
let r10 = await sn();
|
|
@@ -195,7 +195,7 @@ async function Pt() {
|
|
|
195
195
|
console.info("unable to create public key or webcrypto is unsupported");
|
|
196
196
|
return;
|
|
197
197
|
}
|
|
198
|
-
let { subtle: e } = window.crypto, t = await R2(
|
|
198
|
+
let { subtle: e } = window.crypto, t = await R2(Oe);
|
|
199
199
|
if (!t || !e) {
|
|
200
200
|
console.info("unable to find private key or webcrypto unsupported");
|
|
201
201
|
return;
|
|
@@ -204,15 +204,15 @@ async function Pt() {
|
|
|
204
204
|
return `${o.protected}.${o.claims}.${c}`;
|
|
205
205
|
}
|
|
206
206
|
async function sn() {
|
|
207
|
-
if (!
|
|
207
|
+
if (!re()) {
|
|
208
208
|
console.info("webcrypto is not supported");
|
|
209
209
|
return;
|
|
210
210
|
}
|
|
211
|
-
return await R2(
|
|
211
|
+
return await R2(he) || await on(), R2(he);
|
|
212
212
|
}
|
|
213
213
|
async function on() {
|
|
214
214
|
let { subtle: r10 } = window.crypto, e = await r10.generateKey(nn, false, ["sign"]), t = await r10.exportKey("jwk", e.publicKey);
|
|
215
|
-
await S2(
|
|
215
|
+
await S2(Oe, e.privateKey), await S2(he, t);
|
|
216
216
|
}
|
|
217
217
|
function Tt(r10) {
|
|
218
218
|
return wt(cn(r10));
|
|
@@ -239,20 +239,20 @@ function un(r10) {
|
|
|
239
239
|
return !!r10[St];
|
|
240
240
|
}
|
|
241
241
|
function F2(r10) {
|
|
242
|
-
return un(r10) || (r10.jsonrpc = r10.jsonrpc ?? "2.0", r10.id =
|
|
242
|
+
return un(r10) || (r10.jsonrpc = r10.jsonrpc ?? "2.0", r10.id = $e(), r10.method = r10.method ?? "noop", r10.params = r10.params ?? [], xt(r10)), r10;
|
|
243
243
|
}
|
|
244
244
|
function p(r10, e = []) {
|
|
245
|
-
return xt({ params: e, method: r10, jsonrpc: "2.0", id:
|
|
245
|
+
return xt({ params: e, method: r10, jsonrpc: "2.0", id: $e() });
|
|
246
246
|
}
|
|
247
|
-
function
|
|
248
|
-
let r10 = new
|
|
247
|
+
function fe() {
|
|
248
|
+
let r10 = new ke();
|
|
249
249
|
return { emitter: r10, createChainingEmitterMethod: (s, n) => (...o) => (r10[s].apply(r10, o), n), createBoundEmitterMethod: (s) => (...n) => r10[s].apply(r10, n) };
|
|
250
250
|
}
|
|
251
251
|
function $t(r10) {
|
|
252
252
|
return !!r10[At];
|
|
253
253
|
}
|
|
254
254
|
function b2(r10) {
|
|
255
|
-
let e =
|
|
255
|
+
let e = De(r10), { createBoundEmitterMethod: t, createChainingEmitterMethod: s } = fe(), n = Symbol("Promise.then"), o = Symbol("Promise.catch"), i = Symbol("Promise.finally"), a = (l, u2) => (...P2) => {
|
|
256
256
|
let w2 = u2[l].apply(u2, P2);
|
|
257
257
|
return c(w2);
|
|
258
258
|
}, c = (l) => Object.assign(l, { [At]: true, [n]: l[n] || l.then, [o]: l[o] || l.catch, [i]: l[i] || l.finally, then: a(n, l), catch: a(o, l), finally: a(i, l), on: s("on", l), once: s("once", l), addListener: s("addListener", l), off: s("off", l), removeListener: s("removeListener", l), removeAllListeners: s("removeAllListeners", l), emit: t("emit"), eventNames: t("eventNames"), listeners: t("listeners"), listenerCount: t("listenerCount") }), d = c(e.then((l) => (d.emit("done", l), d.emit("settled"), l), (l) => {
|
|
@@ -262,7 +262,7 @@ function b2(r10) {
|
|
|
262
262
|
d.emit(q.ClosedByUser);
|
|
263
263
|
}), d;
|
|
264
264
|
}
|
|
265
|
-
function
|
|
265
|
+
function De(r10) {
|
|
266
266
|
return new Promise((e, t) => {
|
|
267
267
|
let s = r10(e, t);
|
|
268
268
|
Promise.resolve(s).catch(t);
|
|
@@ -272,10 +272,10 @@ function Lt(r10, e) {
|
|
|
272
272
|
let [t] = r10.split(".").map(Number);
|
|
273
273
|
return t >= e;
|
|
274
274
|
}
|
|
275
|
-
async function
|
|
275
|
+
async function Re() {
|
|
276
276
|
let r10 = [];
|
|
277
|
-
await
|
|
278
|
-
t.startsWith(`${
|
|
277
|
+
await Le((e, t, s) => {
|
|
278
|
+
t.startsWith(`${qe}_`) && r10.push(t);
|
|
279
279
|
});
|
|
280
280
|
for (let e of r10) await A2(e);
|
|
281
281
|
}
|
|
@@ -290,72 +290,67 @@ function kt(r10) {
|
|
|
290
290
|
return s.buffer;
|
|
291
291
|
}
|
|
292
292
|
async function In() {
|
|
293
|
-
if (!
|
|
293
|
+
if (!re()) {
|
|
294
294
|
console.info("webcrypto is not supported");
|
|
295
295
|
return;
|
|
296
296
|
}
|
|
297
|
-
let { crypto: r10 } = window, e = await R2(
|
|
297
|
+
let { crypto: r10 } = window, e = await R2(Fe);
|
|
298
298
|
return e || r10.getRandomValues(new Uint8Array(12));
|
|
299
299
|
}
|
|
300
300
|
async function bn() {
|
|
301
|
-
if (!
|
|
301
|
+
if (!re()) {
|
|
302
302
|
console.info("webcrypto is not supported");
|
|
303
303
|
return;
|
|
304
304
|
}
|
|
305
|
-
let { subtle: r10 } = window.crypto, e = await R2(
|
|
306
|
-
return e || await r10.generateKey({ name:
|
|
305
|
+
let { subtle: r10 } = window.crypto, e = await R2(Ue);
|
|
306
|
+
return e || await r10.generateKey({ name: We, length: Tn }, false, ["encrypt", "decrypt"]);
|
|
307
307
|
}
|
|
308
308
|
async function Dt(r10, e) {
|
|
309
309
|
let t = await In(), s = await bn();
|
|
310
310
|
if (!t || !s || !r10) return;
|
|
311
|
-
let n = kt(r10), { subtle: o } = window.crypto, i = await o.encrypt({ name:
|
|
312
|
-
await S2(`${
|
|
311
|
+
let n = kt(r10), { subtle: o } = window.crypto, i = await o.encrypt({ name: We, iv: t }, s, n), a = _t(i);
|
|
312
|
+
await S2(`${qe}_${e}`, a), await S2(Ue, s), await S2(Fe, t);
|
|
313
313
|
}
|
|
314
314
|
async function qt(r10) {
|
|
315
|
-
let e = await R2(`${
|
|
316
|
-
if (!t || !e || !s || !
|
|
317
|
-
let { subtle: n } = window.crypto, o = await n.decrypt({ name:
|
|
315
|
+
let e = await R2(`${qe}_${r10}`), t = await R2(Fe), s = await R2(Ue);
|
|
316
|
+
if (!t || !e || !s || !re()) return;
|
|
317
|
+
let { subtle: n } = window.crypto, o = await n.decrypt({ name: We, iv: t }, s, kt(e));
|
|
318
318
|
return _t(o);
|
|
319
319
|
}
|
|
320
|
-
function
|
|
320
|
+
function Je(r10, e) {
|
|
321
321
|
return e ? new URL(r10, e) : new URL(r10);
|
|
322
322
|
}
|
|
323
|
-
function
|
|
324
|
-
let e = Object.getPrototypeOf(r10), t = [e];
|
|
325
|
-
for (; e !== f2.prototype; ) e = Object.getPrototypeOf(e), t.push(e);
|
|
326
|
-
return t;
|
|
327
|
-
}
|
|
328
|
-
function Jt(r10) {
|
|
323
|
+
function Wt(r10) {
|
|
329
324
|
return r10.compat && r10.compat[m2.sdkName] != null ? typeof r10.compat[m2.sdkName] == "string" ? ot(it(m2.version), r10.compat[m2.sdkName]) : !!r10.compat[m2.sdkName] : true;
|
|
330
325
|
}
|
|
331
|
-
function
|
|
326
|
+
function wn(r10, e, t) {
|
|
332
327
|
return !e && !t ? `${r10}_eth_mainnet` : t ? `${r10}_${JSON.stringify(t)}` : e ? typeof e == "string" ? `${r10}_eth_${e}` : `${r10}_${e.rpcUrl}_${e.chainId}_${e.chainType}` : `${r10}_unknown`;
|
|
333
328
|
}
|
|
334
|
-
function
|
|
329
|
+
function Sn(r10) {
|
|
335
330
|
let e = r10?.extensions ?? [], t = {}, s = [];
|
|
336
331
|
if (Array.isArray(e) ? e.forEach((n) => {
|
|
337
|
-
|
|
332
|
+
Wt(n) ? (n.init(this), n.name && (this[n.name] = n), ee(n.config) || (t[n.name] = n.config)) : s.push(n);
|
|
338
333
|
}) : Object.keys(e).forEach((n) => {
|
|
339
|
-
if (
|
|
334
|
+
if (Wt(e[n])) {
|
|
340
335
|
e[n].init(this);
|
|
341
336
|
let o = e[n];
|
|
342
|
-
this[n] = o,
|
|
337
|
+
this[n] = o, ee(o.config) || (t[e[n].name] = o.config);
|
|
343
338
|
} else s.push(e[n]);
|
|
344
339
|
}), s.length) throw Et(s);
|
|
345
340
|
return t;
|
|
346
341
|
}
|
|
347
|
-
function
|
|
342
|
+
function xn(r10, e) {
|
|
348
343
|
return e && Array.isArray(r10) ? r10.find((t) => t.id === e) : r10;
|
|
349
344
|
}
|
|
350
|
-
function
|
|
351
|
-
let t = e.data.response?.id, s =
|
|
345
|
+
function Jt(r10, e) {
|
|
346
|
+
let t = e.data.response?.id, s = xn(r10, t);
|
|
352
347
|
if (t && s) {
|
|
353
348
|
let n = new K(s).applyResult(e.data.response.result).applyError(e.data.response.error);
|
|
354
349
|
return { id: t, response: n };
|
|
355
350
|
}
|
|
356
351
|
return {};
|
|
357
352
|
}
|
|
358
|
-
async function
|
|
353
|
+
async function Gt(r10, e, t) {
|
|
359
354
|
let s = await R2("rt"), n;
|
|
360
355
|
if (m2.platform === "web") try {
|
|
361
356
|
n = await R2("jwt") ?? await Pt();
|
|
@@ -367,10 +362,10 @@ async function Kt(r10, e, t) {
|
|
|
367
362
|
let i = await qt(t);
|
|
368
363
|
return i && (o.deviceShare = i), o;
|
|
369
364
|
}
|
|
370
|
-
async function
|
|
365
|
+
async function Kt(r10) {
|
|
371
366
|
r10.data.rt && await S2("rt", r10.data.rt);
|
|
372
367
|
}
|
|
373
|
-
function
|
|
368
|
+
function jt(r10, e) {
|
|
374
369
|
let t = null;
|
|
375
370
|
return function(...s) {
|
|
376
371
|
t && clearTimeout(t), t = setTimeout(() => {
|
|
@@ -378,9 +373,14 @@ function Vt(r10, e) {
|
|
|
378
373
|
}, e);
|
|
379
374
|
};
|
|
380
375
|
}
|
|
381
|
-
|
|
376
|
+
function $n(r10) {
|
|
377
|
+
let e = Object.getPrototypeOf(r10), t = [e];
|
|
378
|
+
for (; e !== f2.prototype; ) e = Object.getPrototypeOf(e), t.push(e);
|
|
379
|
+
return t;
|
|
380
|
+
}
|
|
381
|
+
var zt, Ce, Yt, Qt, Zt, er, tr, rr, nr, sr, Ct, ir, Ae, ar, h2, Z2, Xe, st, cr, lr, ze, oe, Ye, Qe, X2, M, dr, J2, ur, pr, mr, hr, Er, fr, gr, yr, Rr, vr, Tr, Ir, br, Ne, z2, Y2, Ze, et, Q2, y2, E2, Pr, wr, Sr, tt, xr, T2, Mr, Cr, Nr, Ar, $r, Lr, Or, _r, kr, Dr, ot, qr, rt, nt, Ur, Fr, ie, ae, it, m2, dt, $, U2, L2, de, te, Yr, me, pe, R2, S2, A2, Qr, Zr, en, tn, Le, Oe, he, It, rn, nn, St, K, Nt, ke, At, f2, vn, ye, qe, Ue, Fe, We, Tn, Te, Ie, Pe, we, H2, Se, Me, Ke, Nn, Bt, Vt, An, je, Ht, Ve, Be, He;
|
|
382
382
|
var init_es2 = __esm({
|
|
383
|
-
"../../node_modules/.pnpm/@magic-sdk+provider@29.
|
|
383
|
+
"../../node_modules/.pnpm/@magic-sdk+provider@29.4.2_localforage@1.10.0/node_modules/@magic-sdk/provider/dist/es/index.mjs"() {
|
|
384
384
|
"use strict";
|
|
385
385
|
init_es();
|
|
386
386
|
init_es();
|
|
@@ -409,12 +409,12 @@ var init_es2 = __esm({
|
|
|
409
409
|
return r10;
|
|
410
410
|
};
|
|
411
411
|
sr = (r10, e, t) => (t = r10 != null ? zt(Zt(r10)) : {}, nr(e || !r10 || !r10.__esModule ? Ce(t, "default", { value: r10, enumerable: true }) : t, r10));
|
|
412
|
-
|
|
412
|
+
Ct = tr((ls, _e) => {
|
|
413
413
|
"use strict";
|
|
414
414
|
var pn = Object.prototype.hasOwnProperty, I2 = "~";
|
|
415
|
-
function
|
|
415
|
+
function ne() {
|
|
416
416
|
}
|
|
417
|
-
Object.create && (
|
|
417
|
+
Object.create && (ne.prototype = /* @__PURE__ */ Object.create(null), new ne().__proto__ || (I2 = false));
|
|
418
418
|
function mn(r10, e, t) {
|
|
419
419
|
this.fn = r10, this.context = e, this.once = t || false;
|
|
420
420
|
}
|
|
@@ -423,11 +423,11 @@ var init_es2 = __esm({
|
|
|
423
423
|
var o = new mn(t, s || r10, n), i = I2 ? I2 + e : e;
|
|
424
424
|
return r10._events[i] ? r10._events[i].fn ? r10._events[i] = [r10._events[i], o] : r10._events[i].push(o) : (r10._events[i] = o, r10._eventsCount++), r10;
|
|
425
425
|
}
|
|
426
|
-
function
|
|
427
|
-
--r10._eventsCount === 0 ? r10._events = new
|
|
426
|
+
function Ee(r10, e) {
|
|
427
|
+
--r10._eventsCount === 0 ? r10._events = new ne() : delete r10._events[e];
|
|
428
428
|
}
|
|
429
429
|
function v2() {
|
|
430
|
-
this._events = new
|
|
430
|
+
this._events = new ne(), this._eventsCount = 0;
|
|
431
431
|
}
|
|
432
432
|
v2.prototype.eventNames = function() {
|
|
433
433
|
var e = [], t, s;
|
|
@@ -498,32 +498,32 @@ var init_es2 = __esm({
|
|
|
498
498
|
v2.prototype.removeListener = function(e, t, s, n) {
|
|
499
499
|
var o = I2 ? I2 + e : e;
|
|
500
500
|
if (!this._events[o]) return this;
|
|
501
|
-
if (!t) return
|
|
501
|
+
if (!t) return Ee(this, o), this;
|
|
502
502
|
var i = this._events[o];
|
|
503
|
-
if (i.fn) i.fn === t && (!n || i.once) && (!s || i.context === s) &&
|
|
503
|
+
if (i.fn) i.fn === t && (!n || i.once) && (!s || i.context === s) && Ee(this, o);
|
|
504
504
|
else {
|
|
505
505
|
for (var a = 0, c = [], d = i.length; a < d; a++) (i[a].fn !== t || n && !i[a].once || s && i[a].context !== s) && c.push(i[a]);
|
|
506
|
-
c.length ? this._events[o] = c.length === 1 ? c[0] : c :
|
|
506
|
+
c.length ? this._events[o] = c.length === 1 ? c[0] : c : Ee(this, o);
|
|
507
507
|
}
|
|
508
508
|
return this;
|
|
509
509
|
};
|
|
510
510
|
v2.prototype.removeAllListeners = function(e) {
|
|
511
511
|
var t;
|
|
512
|
-
return e ? (t = I2 ? I2 + e : e, this._events[t] &&
|
|
512
|
+
return e ? (t = I2 ? I2 + e : e, this._events[t] && Ee(this, t)) : (this._events = new ne(), this._eventsCount = 0), this;
|
|
513
513
|
};
|
|
514
514
|
v2.prototype.off = v2.prototype.removeListener;
|
|
515
515
|
v2.prototype.addListener = v2.prototype.on;
|
|
516
516
|
v2.prefixed = I2;
|
|
517
517
|
v2.EventEmitter = v2;
|
|
518
|
-
typeof
|
|
518
|
+
typeof _e < "u" && (_e.exports = v2);
|
|
519
519
|
});
|
|
520
520
|
ir = Number.MAX_SAFE_INTEGER || 9007199254740991;
|
|
521
|
-
|
|
521
|
+
Ae = { SEMVER_SPEC_VERSION: "2.0.0", MAX_LENGTH: 256, MAX_SAFE_INTEGER: ir, MAX_SAFE_COMPONENT_LENGTH: 16 };
|
|
522
522
|
ar = typeof process == "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...r10) => console.error("SEMVER", ...r10) : () => {
|
|
523
523
|
};
|
|
524
524
|
h2 = ar;
|
|
525
|
-
|
|
526
|
-
let { MAX_SAFE_COMPONENT_LENGTH: t } =
|
|
525
|
+
Z2 = or(function(r10, e) {
|
|
526
|
+
let { MAX_SAFE_COMPONENT_LENGTH: t } = Ae, s = (e = r10.exports = {}).re = [], n = e.src = [], o = e.t = {}, i = 0, a = (c, d, l) => {
|
|
527
527
|
let u2 = i++;
|
|
528
528
|
h2(u2, d), o[c] = u2, n[u2] = d, s[u2] = new RegExp(d, l ? "g" : void 0);
|
|
529
529
|
};
|
|
@@ -536,9 +536,9 @@ var init_es2 = __esm({
|
|
|
536
536
|
};
|
|
537
537
|
cr = (r10, e) => st(e, r10);
|
|
538
538
|
lr = { compareIdentifiers: st, rcompareIdentifiers: cr };
|
|
539
|
-
({ MAX_LENGTH: ze, MAX_SAFE_INTEGER:
|
|
540
|
-
({ re: Ye, t: Qe } =
|
|
541
|
-
({ compareIdentifiers:
|
|
539
|
+
({ MAX_LENGTH: ze, MAX_SAFE_INTEGER: oe } = Ae);
|
|
540
|
+
({ re: Ye, t: Qe } = Z2);
|
|
541
|
+
({ compareIdentifiers: X2 } = lr);
|
|
542
542
|
M = class r {
|
|
543
543
|
constructor(e, t) {
|
|
544
544
|
if (t && typeof t == "object" || (t = { loose: !!t, includePrerelease: false }), e instanceof r) {
|
|
@@ -549,13 +549,13 @@ var init_es2 = __esm({
|
|
|
549
549
|
h2("SemVer", e, t), this.options = t, this.loose = !!t.loose, this.includePrerelease = !!t.includePrerelease;
|
|
550
550
|
let s = e.trim().match(t.loose ? Ye[Qe.LOOSE] : Ye[Qe.FULL]);
|
|
551
551
|
if (!s) throw new TypeError(`Invalid Version: ${e}`);
|
|
552
|
-
if (this.raw = e, this.major = +s[1], this.minor = +s[2], this.patch = +s[3], this.major >
|
|
553
|
-
if (this.minor >
|
|
554
|
-
if (this.patch >
|
|
552
|
+
if (this.raw = e, this.major = +s[1], this.minor = +s[2], this.patch = +s[3], this.major > oe || this.major < 0) throw new TypeError("Invalid major version");
|
|
553
|
+
if (this.minor > oe || this.minor < 0) throw new TypeError("Invalid minor version");
|
|
554
|
+
if (this.patch > oe || this.patch < 0) throw new TypeError("Invalid patch version");
|
|
555
555
|
s[4] ? this.prerelease = s[4].split(".").map((n) => {
|
|
556
556
|
if (/^[0-9]+$/.test(n)) {
|
|
557
557
|
let o = +n;
|
|
558
|
-
if (o >= 0 && o <
|
|
558
|
+
if (o >= 0 && o < oe) return o;
|
|
559
559
|
}
|
|
560
560
|
return n;
|
|
561
561
|
}) : this.prerelease = [], this.build = s[5] ? s[5].split(".") : [], this.format();
|
|
@@ -574,7 +574,7 @@ var init_es2 = __esm({
|
|
|
574
574
|
return e.version === this.version ? 0 : this.compareMain(e) || this.comparePre(e);
|
|
575
575
|
}
|
|
576
576
|
compareMain(e) {
|
|
577
|
-
return e instanceof r || (e = new r(e, this.options)),
|
|
577
|
+
return e instanceof r || (e = new r(e, this.options)), X2(this.major, e.major) || X2(this.minor, e.minor) || X2(this.patch, e.patch);
|
|
578
578
|
}
|
|
579
579
|
comparePre(e) {
|
|
580
580
|
if (e instanceof r || (e = new r(e, this.options)), this.prerelease.length && !e.prerelease.length) return -1;
|
|
@@ -586,7 +586,7 @@ var init_es2 = __esm({
|
|
|
586
586
|
if (h2("prerelease compare", t, s, n), s === void 0 && n === void 0) return 0;
|
|
587
587
|
if (n === void 0) return 1;
|
|
588
588
|
if (s === void 0) return -1;
|
|
589
|
-
if (s !== n) return
|
|
589
|
+
if (s !== n) return X2(s, n);
|
|
590
590
|
} while (++t);
|
|
591
591
|
}
|
|
592
592
|
compareBuild(e) {
|
|
@@ -597,7 +597,7 @@ var init_es2 = __esm({
|
|
|
597
597
|
if (h2("prerelease compare", t, s, n), s === void 0 && n === void 0) return 0;
|
|
598
598
|
if (n === void 0) return 1;
|
|
599
599
|
if (s === void 0) return -1;
|
|
600
|
-
if (s !== n) return
|
|
600
|
+
if (s !== n) return X2(s, n);
|
|
601
601
|
} while (++t);
|
|
602
602
|
}
|
|
603
603
|
inc(e, t) {
|
|
@@ -676,49 +676,49 @@ var init_es2 = __esm({
|
|
|
676
676
|
throw new TypeError(`Invalid operator: ${e}`);
|
|
677
677
|
}
|
|
678
678
|
};
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
679
|
+
Ne = br;
|
|
680
|
+
z2 = Symbol("SemVer ANY");
|
|
681
|
+
Y2 = class r2 {
|
|
682
682
|
static get ANY() {
|
|
683
|
-
return
|
|
683
|
+
return z2;
|
|
684
684
|
}
|
|
685
685
|
constructor(e, t) {
|
|
686
686
|
if (t && typeof t == "object" || (t = { loose: !!t, includePrerelease: false }), e instanceof r2) {
|
|
687
687
|
if (e.loose === !!t.loose) return e;
|
|
688
688
|
e = e.value;
|
|
689
689
|
}
|
|
690
|
-
h2("comparator", e, t), this.options = t, this.loose = !!t.loose, this.parse(e), this.semver ===
|
|
690
|
+
h2("comparator", e, t), this.options = t, this.loose = !!t.loose, this.parse(e), this.semver === z2 ? this.value = "" : this.value = this.operator + this.semver.version, h2("comp", this);
|
|
691
691
|
}
|
|
692
692
|
parse(e) {
|
|
693
693
|
let t = this.options.loose ? Ze[et.COMPARATORLOOSE] : Ze[et.COMPARATOR], s = e.match(t);
|
|
694
694
|
if (!s) throw new TypeError(`Invalid comparator: ${e}`);
|
|
695
|
-
this.operator = s[1] !== void 0 ? s[1] : "", this.operator === "=" && (this.operator = ""), s[2] ? this.semver = new M(s[2], this.options.loose) : this.semver =
|
|
695
|
+
this.operator = s[1] !== void 0 ? s[1] : "", this.operator === "=" && (this.operator = ""), s[2] ? this.semver = new M(s[2], this.options.loose) : this.semver = z2;
|
|
696
696
|
}
|
|
697
697
|
toString() {
|
|
698
698
|
return this.value;
|
|
699
699
|
}
|
|
700
700
|
test(e) {
|
|
701
|
-
if (h2("Comparator.test", e, this.options.loose), this.semver ===
|
|
701
|
+
if (h2("Comparator.test", e, this.options.loose), this.semver === z2 || e === z2) return true;
|
|
702
702
|
if (typeof e == "string") try {
|
|
703
703
|
e = new M(e, this.options);
|
|
704
704
|
} catch {
|
|
705
705
|
return false;
|
|
706
706
|
}
|
|
707
|
-
return
|
|
707
|
+
return Ne(e, this.operator, this.semver, this.options);
|
|
708
708
|
}
|
|
709
709
|
intersects(e, t) {
|
|
710
710
|
if (!(e instanceof r2)) throw new TypeError("a Comparator is required");
|
|
711
|
-
if (t && typeof t == "object" || (t = { loose: !!t, includePrerelease: false }), this.operator === "") return this.value === "" || new
|
|
712
|
-
if (e.operator === "") return e.value === "" || new
|
|
713
|
-
let s = !(this.operator !== ">=" && this.operator !== ">" || e.operator !== ">=" && e.operator !== ">"), n = !(this.operator !== "<=" && this.operator !== "<" || e.operator !== "<=" && e.operator !== "<"), o = this.semver.version === e.semver.version, i = !(this.operator !== ">=" && this.operator !== "<=" || e.operator !== ">=" && e.operator !== "<="), a =
|
|
711
|
+
if (t && typeof t == "object" || (t = { loose: !!t, includePrerelease: false }), this.operator === "") return this.value === "" || new Q2(e.value, t).test(this.value);
|
|
712
|
+
if (e.operator === "") return e.value === "" || new Q2(this.value, t).test(e.semver);
|
|
713
|
+
let s = !(this.operator !== ">=" && this.operator !== ">" || e.operator !== ">=" && e.operator !== ">"), n = !(this.operator !== "<=" && this.operator !== "<" || e.operator !== "<=" && e.operator !== "<"), o = this.semver.version === e.semver.version, i = !(this.operator !== ">=" && this.operator !== "<=" || e.operator !== ">=" && e.operator !== "<="), a = Ne(this.semver, "<", e.semver, t) && (this.operator === ">=" || this.operator === ">") && (e.operator === "<=" || e.operator === "<"), c = Ne(this.semver, ">", e.semver, t) && (this.operator === "<=" || this.operator === "<") && (e.operator === ">=" || e.operator === ">");
|
|
714
714
|
return s || n || o && i || a || c;
|
|
715
715
|
}
|
|
716
716
|
};
|
|
717
|
-
({ re: Ze, t: et } =
|
|
718
|
-
|
|
717
|
+
({ re: Ze, t: et } = Z2);
|
|
718
|
+
Q2 = class r3 {
|
|
719
719
|
constructor(e, t) {
|
|
720
720
|
if (t && typeof t == "object" || (t = { loose: !!t, includePrerelease: false }), e instanceof r3) return e.loose === !!t.loose && e.includePrerelease === !!t.includePrerelease ? e : new r3(e.raw, t);
|
|
721
|
-
if (e instanceof
|
|
721
|
+
if (e instanceof Y2) return this.raw = e.value, this.set = [[e]], this.format(), this;
|
|
722
722
|
if (this.options = t, this.loose = !!t.loose, this.includePrerelease = !!t.includePrerelease, this.raw = e, this.set = e.split(/\s*\|\|\s*/).map((s) => this.parseRange(s.trim())).filter((s) => s.length), !this.set.length) throw new TypeError(`Invalid SemVer Range: ${e}`);
|
|
723
723
|
this.format();
|
|
724
724
|
}
|
|
@@ -734,7 +734,7 @@ var init_es2 = __esm({
|
|
|
734
734
|
let s = t ? y2[E2.HYPHENRANGELOOSE] : y2[E2.HYPHENRANGE];
|
|
735
735
|
e = e.replace(s, kr(this.options.includePrerelease)), h2("hyphen replace", e), e = e.replace(y2[E2.COMPARATORTRIM], Pr), h2("comparator trim", e, y2[E2.COMPARATORTRIM]), e = (e = (e = e.replace(y2[E2.TILDETRIM], wr)).replace(y2[E2.CARETTRIM], Sr)).split(/\s+/).join(" ");
|
|
736
736
|
let n = t ? y2[E2.COMPARATORLOOSE] : y2[E2.COMPARATOR];
|
|
737
|
-
return e.split(" ").map((o) => xr(o, this.options)).join(" ").split(/\s+/).map((o) => _r(o, this.options)).filter(this.options.loose ? (o) => !!o.match(n) : () => true).map((o) => new
|
|
737
|
+
return e.split(" ").map((o) => xr(o, this.options)).join(" ").split(/\s+/).map((o) => _r(o, this.options)).filter(this.options.loose ? (o) => !!o.match(n) : () => true).map((o) => new Y2(o, this.options));
|
|
738
738
|
}
|
|
739
739
|
intersects(e, t) {
|
|
740
740
|
if (!(e instanceof r3)) throw new TypeError("a Range is required");
|
|
@@ -751,23 +751,23 @@ var init_es2 = __esm({
|
|
|
751
751
|
return false;
|
|
752
752
|
}
|
|
753
753
|
};
|
|
754
|
-
({ re: y2, t: E2, comparatorTrimReplace: Pr, tildeTrimReplace: wr, caretTrimReplace: Sr } =
|
|
754
|
+
({ re: y2, t: E2, comparatorTrimReplace: Pr, tildeTrimReplace: wr, caretTrimReplace: Sr } = Z2);
|
|
755
755
|
tt = (r10, e) => {
|
|
756
756
|
let t = true, s = r10.slice(), n = s.pop();
|
|
757
757
|
for (; t && s.length; ) t = s.every((o) => n.intersects(o, e)), n = s.pop();
|
|
758
758
|
return t;
|
|
759
759
|
};
|
|
760
|
-
xr = (r10, e) => (h2("comp", r10, e), r10 =
|
|
760
|
+
xr = (r10, e) => (h2("comp", r10, e), r10 = Nr(r10, e), h2("caret", r10), r10 = Mr(r10, e), h2("tildes", r10), r10 = $r(r10, e), h2("xrange", r10), r10 = Or(r10, e), h2("stars", r10), r10);
|
|
761
761
|
T2 = (r10) => !r10 || r10.toLowerCase() === "x" || r10 === "*";
|
|
762
|
-
Mr = (r10, e) => r10.trim().split(/\s+/).map((t) =>
|
|
763
|
-
|
|
762
|
+
Mr = (r10, e) => r10.trim().split(/\s+/).map((t) => Cr(t, e)).join(" ");
|
|
763
|
+
Cr = (r10, e) => {
|
|
764
764
|
let t = e.loose ? y2[E2.TILDELOOSE] : y2[E2.TILDE];
|
|
765
765
|
return r10.replace(t, (s, n, o, i, a) => {
|
|
766
766
|
let c;
|
|
767
767
|
return h2("tilde", r10, s, n, o, i, a), T2(n) ? c = "" : T2(o) ? c = `>=${n}.0.0 <${+n + 1}.0.0-0` : T2(i) ? c = `>=${n}.${o}.0 <${n}.${+o + 1}.0-0` : a ? (h2("replaceTilde pr", a), c = `>=${n}.${o}.${i}-${a} <${n}.${+o + 1}.0-0`) : c = `>=${n}.${o}.${i} <${n}.${+o + 1}.0-0`, h2("tilde return", c), c;
|
|
768
768
|
});
|
|
769
769
|
};
|
|
770
|
-
|
|
770
|
+
Nr = (r10, e) => r10.trim().split(/\s+/).map((t) => Ar(t, e)).join(" ");
|
|
771
771
|
Ar = (r10, e) => {
|
|
772
772
|
h2("caret", r10, e);
|
|
773
773
|
let t = e.loose ? y2[E2.CARETLOOSE] : y2[E2.CARET], s = e.includePrerelease ? "-0" : "";
|
|
@@ -792,7 +792,7 @@ var init_es2 = __esm({
|
|
|
792
792
|
Dr = (r10, e, t) => {
|
|
793
793
|
for (let s = 0; s < r10.length; s++) if (!r10[s].test(e)) return false;
|
|
794
794
|
if (e.prerelease.length && !t.includePrerelease) {
|
|
795
|
-
for (let s = 0; s < r10.length; s++) if (h2(r10[s].semver), r10[s].semver !==
|
|
795
|
+
for (let s = 0; s < r10.length; s++) if (h2(r10[s].semver), r10[s].semver !== Y2.ANY && r10[s].semver.prerelease.length > 0) {
|
|
796
796
|
let n = r10[s].semver;
|
|
797
797
|
if (n.major === e.major && n.minor === e.minor && n.patch === e.patch) return true;
|
|
798
798
|
}
|
|
@@ -802,14 +802,14 @@ var init_es2 = __esm({
|
|
|
802
802
|
};
|
|
803
803
|
ot = (r10, e, t) => {
|
|
804
804
|
try {
|
|
805
|
-
e = new
|
|
805
|
+
e = new Q2(e, t);
|
|
806
806
|
} catch {
|
|
807
807
|
return false;
|
|
808
808
|
}
|
|
809
809
|
return e.test(r10);
|
|
810
810
|
};
|
|
811
|
-
({ MAX_LENGTH: qr } =
|
|
812
|
-
({ re: rt, t: nt } =
|
|
811
|
+
({ MAX_LENGTH: qr } = Ae);
|
|
812
|
+
({ re: rt, t: nt } = Z2);
|
|
813
813
|
Ur = (r10, e) => {
|
|
814
814
|
if (e && typeof e == "object" || (e = { loose: !!e, includePrerelease: false }), r10 instanceof M) return r10;
|
|
815
815
|
if (typeof r10 != "string" || r10.length > qr || !(e.loose ? rt[nt.LOOSE] : rt[nt.FULL]).test(r10)) return null;
|
|
@@ -820,16 +820,16 @@ var init_es2 = __esm({
|
|
|
820
820
|
}
|
|
821
821
|
};
|
|
822
822
|
Fr = Ur;
|
|
823
|
-
({ re:
|
|
823
|
+
({ re: ie, t: ae } = Z2);
|
|
824
824
|
it = (r10, e) => {
|
|
825
825
|
if (r10 instanceof M) return r10;
|
|
826
826
|
if (typeof r10 == "number" && (r10 = String(r10)), typeof r10 != "string") return null;
|
|
827
827
|
let t = null;
|
|
828
828
|
if ((e = e || {}).rtl) {
|
|
829
829
|
let s;
|
|
830
|
-
for (; (s = ae
|
|
831
|
-
ae
|
|
832
|
-
} else t = r10.match(ae
|
|
830
|
+
for (; (s = ie[ae.COERCERTL].exec(r10)) && (!t || t.index + t[0].length !== r10.length); ) t && s.index + s[0].length === t.index + t[0].length || (t = s), ie[ae.COERCERTL].lastIndex = s.index + s[1].length + s[2].length;
|
|
831
|
+
ie[ae.COERCERTL].lastIndex = -1;
|
|
832
|
+
} else t = r10.match(ie[ae.COERCE]);
|
|
833
833
|
return t === null ? null : Fr(`${t[2]}.${t[3] || "0"}.${t[4] || "0"}`, e);
|
|
834
834
|
};
|
|
835
835
|
m2 = {};
|
|
@@ -865,7 +865,7 @@ var init_es2 = __esm({
|
|
|
865
865
|
console.warn(this.message);
|
|
866
866
|
}
|
|
867
867
|
};
|
|
868
|
-
|
|
868
|
+
de = class r6 extends Error {
|
|
869
869
|
constructor(t, s, n, o) {
|
|
870
870
|
super(`Magic Extension Error (${t.name}): [${s}] ${n}`);
|
|
871
871
|
this.code = s;
|
|
@@ -875,7 +875,7 @@ var init_es2 = __esm({
|
|
|
875
875
|
}
|
|
876
876
|
__proto__ = Error;
|
|
877
877
|
};
|
|
878
|
-
|
|
878
|
+
te = class {
|
|
879
879
|
constructor(e, t, s) {
|
|
880
880
|
this.code = t;
|
|
881
881
|
this.rawMessage = s;
|
|
@@ -887,8 +887,8 @@ var init_es2 = __esm({
|
|
|
887
887
|
}
|
|
888
888
|
};
|
|
889
889
|
Yr = zr();
|
|
890
|
-
|
|
891
|
-
rr(
|
|
890
|
+
me = {};
|
|
891
|
+
rr(me, { clear: () => Qr, getItem: () => R2, iterate: () => Le, key: () => en, keys: () => tn, length: () => Zr, removeItem: () => A2, setItem: () => S2 });
|
|
892
892
|
R2 = O2("getItem");
|
|
893
893
|
S2 = O2("setItem");
|
|
894
894
|
A2 = O2("removeItem");
|
|
@@ -896,9 +896,9 @@ var init_es2 = __esm({
|
|
|
896
896
|
Zr = O2("length");
|
|
897
897
|
en = O2("key");
|
|
898
898
|
tn = O2("keys");
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
899
|
+
Le = O2("iterate");
|
|
900
|
+
Oe = "STORE_KEY_PRIVATE_KEY";
|
|
901
|
+
he = "STORE_KEY_PUBLIC_JWK";
|
|
902
902
|
It = "ECDSA";
|
|
903
903
|
rn = "P-256";
|
|
904
904
|
nn = { name: It, namedCurve: rn };
|
|
@@ -927,8 +927,8 @@ var init_es2 = __esm({
|
|
|
927
927
|
return { jsonrpc: this._jsonrpc, id: this._id, result: this._result, error: this._error };
|
|
928
928
|
}
|
|
929
929
|
};
|
|
930
|
-
|
|
931
|
-
|
|
930
|
+
Nt = sr(Ct());
|
|
931
|
+
ke = class extends Nt.default {
|
|
932
932
|
};
|
|
933
933
|
At = Symbol("isPromiEvent");
|
|
934
934
|
f2 = class {
|
|
@@ -942,7 +942,7 @@ var init_es2 = __esm({
|
|
|
942
942
|
if (this.sdk.thirdPartyWallets.isConnected && !Z.includes(e.method)) return b2((i, a) => {
|
|
943
943
|
this.sdk.thirdPartyWallets.requestOverride(e).then(i).catch(a);
|
|
944
944
|
});
|
|
945
|
-
let t = this.overlay.post(
|
|
945
|
+
let t = this.overlay.post(y.MAGIC_HANDLE_REQUEST, F2(e)), s = b2((o, i) => {
|
|
946
946
|
t.then((a) => {
|
|
947
947
|
if (n(), a.hasError) i(new U2(a.payload.error));
|
|
948
948
|
else if (a.hasResult) o(a.payload.result);
|
|
@@ -967,10 +967,10 @@ var init_es2 = __esm({
|
|
|
967
967
|
}
|
|
968
968
|
};
|
|
969
969
|
vn = { "magic-sdk": "v18.0.0", "@magic-sdk/react-native": "v14.0.0", "@magic-sdk/react-native-bare": "v19.0.0", "@magic-sdk/react-native-expo": "v19.0.0" };
|
|
970
|
-
|
|
970
|
+
ye = class extends f2 {
|
|
971
971
|
loginWithMagicLink(e) {
|
|
972
972
|
let t = m2.sdkName === "@magic-sdk/react-native" || m2.sdkName === "@magic-sdk/react-native-bare" || m2.sdkName === "@magic-sdk/react-native-expo";
|
|
973
|
-
if (t && Lt(m2.version, 19)) throw new Error("loginWithMagicLink() is deprecated for this package, please
|
|
973
|
+
if (t && Lt(m2.version, 19)) throw new Error("loginWithMagicLink() is deprecated for this package, please utilize a passcode method like loginWithSMS or loginWithEmailOTP instead.");
|
|
974
974
|
t && Rt({ method: "auth.loginWithMagicLink()", removalVersions: vn, useInstead: "auth.loginWithEmailOTP()" }).log();
|
|
975
975
|
let { email: s, showUI: n = true, redirectURI: o, overrides: i, lifespan: a } = e, c = p(this.sdk.testMode ? g.LoginWithMagicLinkTestMode : g.LoginWithMagicLink, [{ email: s, showUI: n, redirectURI: o, overrides: i, lifespan: a }]);
|
|
976
976
|
return this.request(c);
|
|
@@ -987,16 +987,16 @@ var init_es2 = __esm({
|
|
|
987
987
|
let { email: t, showUI: s, deviceCheckUI: n, overrides: o, lifespan: i } = e, a = p(this.sdk.testMode ? g.LoginWithEmailOTPTestMode : g.LoginWithEmailOTP, [{ email: t, showUI: s, deviceCheckUI: n, overrides: o, lifespan: i }]), c = this.request(a);
|
|
988
988
|
return !n && c && c.on(O.Retry, () => {
|
|
989
989
|
this.createIntermediaryEvent(O.Retry, a.id)();
|
|
990
|
-
}), !s && c && (c.on(
|
|
991
|
-
this.createIntermediaryEvent(
|
|
992
|
-
}), c.on(
|
|
993
|
-
this.createIntermediaryEvent(
|
|
994
|
-
}), c.on(
|
|
995
|
-
this.createIntermediaryEvent(
|
|
996
|
-
}), c.on(
|
|
997
|
-
this.createIntermediaryEvent(
|
|
998
|
-
}), c.on(
|
|
999
|
-
this.createIntermediaryEvent(
|
|
990
|
+
}), !s && c && (c.on(I.VerifyEmailOtp, (d) => {
|
|
991
|
+
this.createIntermediaryEvent(I.VerifyEmailOtp, a.id)(d);
|
|
992
|
+
}), c.on(I.VerifyMFACode, (d) => {
|
|
993
|
+
this.createIntermediaryEvent(I.VerifyMFACode, a.id)(d);
|
|
994
|
+
}), c.on(I.LostDevice, () => {
|
|
995
|
+
this.createIntermediaryEvent(I.LostDevice, a.id)();
|
|
996
|
+
}), c.on(I.VerifyRecoveryCode, (d) => {
|
|
997
|
+
this.createIntermediaryEvent(I.VerifyRecoveryCode, a.id)(d);
|
|
998
|
+
}), c.on(I.Cancel, () => {
|
|
999
|
+
this.createIntermediaryEvent(I.Cancel, a.id)();
|
|
1000
1000
|
})), c;
|
|
1001
1001
|
}
|
|
1002
1002
|
loginWithCredential(e) {
|
|
@@ -1032,12 +1032,12 @@ var init_es2 = __esm({
|
|
|
1032
1032
|
})), o;
|
|
1033
1033
|
}
|
|
1034
1034
|
};
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1035
|
+
qe = "ds";
|
|
1036
|
+
Ue = "ek";
|
|
1037
|
+
Fe = "iv";
|
|
1038
|
+
We = "AES-GCM";
|
|
1039
1039
|
Tn = 256;
|
|
1040
|
-
|
|
1040
|
+
Te = class extends f2 {
|
|
1041
1041
|
getIdToken(e) {
|
|
1042
1042
|
let t = p(this.sdk.testMode ? g.GetIdTokenTestMode : g.GetIdToken, [e]);
|
|
1043
1043
|
return this.request(t);
|
|
@@ -1063,7 +1063,7 @@ var init_es2 = __esm({
|
|
|
1063
1063
|
});
|
|
1064
1064
|
}
|
|
1065
1065
|
logout() {
|
|
1066
|
-
return A2(this.localForageIsLoggedInKey),
|
|
1066
|
+
return A2(this.localForageIsLoggedInKey), Re(), b2(async (e, t) => {
|
|
1067
1067
|
try {
|
|
1068
1068
|
let s = p(this.sdk.testMode ? g.LogoutTestMode : g.Logout), n = await this.request(s);
|
|
1069
1069
|
this.sdk.useStorageCache && this.emitUserLoggedOut(n), e(n);
|
|
@@ -1141,7 +1141,7 @@ var init_es2 = __esm({
|
|
|
1141
1141
|
localForageIsLoggedInKey = "magic_auth_is_logged_in";
|
|
1142
1142
|
userLoggedOutCallbacks = [];
|
|
1143
1143
|
};
|
|
1144
|
-
|
|
1144
|
+
Ie = class extends f2 {
|
|
1145
1145
|
connectWithUI(e) {
|
|
1146
1146
|
let t = b2(async (s, n) => {
|
|
1147
1147
|
try {
|
|
@@ -1181,7 +1181,7 @@ var init_es2 = __esm({
|
|
|
1181
1181
|
return this.request(p(g.SendGaslessTransaction, [e, t]));
|
|
1182
1182
|
}
|
|
1183
1183
|
};
|
|
1184
|
-
|
|
1184
|
+
Pe = class extends f2 {
|
|
1185
1185
|
eventListeners = [];
|
|
1186
1186
|
enabledWallets = {};
|
|
1187
1187
|
isConnected = false;
|
|
@@ -1265,12 +1265,12 @@ var init_es2 = __esm({
|
|
|
1265
1265
|
});
|
|
1266
1266
|
}
|
|
1267
1267
|
};
|
|
1268
|
-
({ createBoundEmitterMethod:
|
|
1269
|
-
|
|
1268
|
+
({ createBoundEmitterMethod: we, createChainingEmitterMethod: H2 } = fe());
|
|
1269
|
+
Se = class extends f2 {
|
|
1270
1270
|
isMagic = true;
|
|
1271
1271
|
sendAsync(e, t) {
|
|
1272
1272
|
if (!t) throw ft({ procedure: "Magic.rpcProvider.sendAsync", argument: 1, expected: "function", received: t === null ? "null" : typeof t });
|
|
1273
|
-
if (Array.isArray(e)) this.overlay.post(
|
|
1273
|
+
if (Array.isArray(e)) this.overlay.post(y.MAGIC_HANDLE_REQUEST, e.map((s) => {
|
|
1274
1274
|
let n = F2(s);
|
|
1275
1275
|
return this.prefixPayloadMethodForTestMode(n), n;
|
|
1276
1276
|
})).then((s) => {
|
|
@@ -1278,7 +1278,7 @@ var init_es2 = __esm({
|
|
|
1278
1278
|
});
|
|
1279
1279
|
else {
|
|
1280
1280
|
let s = F2(e);
|
|
1281
|
-
this.prefixPayloadMethodForTestMode(s), this.overlay.post(
|
|
1281
|
+
this.prefixPayloadMethodForTestMode(s), this.overlay.post(y.MAGIC_HANDLE_REQUEST, s).then((n) => {
|
|
1282
1282
|
t(n.hasError ? new U2(n.payload.error) : null, n.payload);
|
|
1283
1283
|
});
|
|
1284
1284
|
}
|
|
@@ -1312,52 +1312,12 @@ var init_es2 = __esm({
|
|
|
1312
1312
|
off = H2("off", this);
|
|
1313
1313
|
removeListener = H2("removeListener", this);
|
|
1314
1314
|
removeAllListeners = H2("removeAllListeners", this);
|
|
1315
|
-
emit =
|
|
1316
|
-
eventNames =
|
|
1317
|
-
listeners =
|
|
1318
|
-
listenerCount =
|
|
1319
|
-
};
|
|
1320
|
-
Wt = ["request", "overlay", "sdk"];
|
|
1321
|
-
Ke = class extends f2 {
|
|
1322
|
-
compat;
|
|
1323
|
-
__sdk_access_field_descriptors__ = /* @__PURE__ */ new Map();
|
|
1324
|
-
__is_initialized__ = false;
|
|
1325
|
-
utils = { createPromiEvent: b2, isPromiEvent: $t, encodeJSON: le, decodeJSON: at, createJsonRpcRequestPayload: p, standardizeJsonRpcRequestPayload: F2, storage: he };
|
|
1326
|
-
constructor() {
|
|
1327
|
-
super(void 0);
|
|
1328
|
-
let e = [this, ...wn(this)];
|
|
1329
|
-
Wt.forEach((t) => {
|
|
1330
|
-
let s = e.map((a) => Object.getOwnPropertyDescriptor(a, t)), n = s.findIndex((a) => !!a), o = n > 0, i = s[n];
|
|
1331
|
-
i && (this.__sdk_access_field_descriptors__.set(t, { descriptor: i, isPrototypeField: o }), Object.defineProperty(this, t, { configurable: true, get: () => {
|
|
1332
|
-
throw ht(t);
|
|
1333
|
-
} }));
|
|
1334
|
-
});
|
|
1335
|
-
}
|
|
1336
|
-
init(e) {
|
|
1337
|
-
this.__is_initialized__ || (Wt.forEach((t) => {
|
|
1338
|
-
if (this.__sdk_access_field_descriptors__.has(t)) {
|
|
1339
|
-
let { descriptor: s, isPrototypeField: n } = this.__sdk_access_field_descriptors__.get(t);
|
|
1340
|
-
n ? delete this[t] : Object.defineProperty(this, t, s);
|
|
1341
|
-
}
|
|
1342
|
-
}), this.sdk = e, this.__is_initialized__ = true);
|
|
1343
|
-
}
|
|
1344
|
-
createDeprecationWarning(e) {
|
|
1345
|
-
let { method: t, removalVersion: s, useInstead: n } = e, o = n ? ` Use \`${n}\` instead.` : "", i = `\`${t}\` will be removed from this Extension in version \`${s}\`.${o}`;
|
|
1346
|
-
return new re(this, "DEPRECATION_NOTICE", i);
|
|
1347
|
-
}
|
|
1348
|
-
createWarning(e, t) {
|
|
1349
|
-
return new re(this, e, t);
|
|
1350
|
-
}
|
|
1351
|
-
createError(e, t, s) {
|
|
1352
|
-
return new ue(this, e, t, s);
|
|
1353
|
-
}
|
|
1354
|
-
};
|
|
1355
|
-
je = class extends Ke {
|
|
1315
|
+
emit = we("emit");
|
|
1316
|
+
eventNames = we("eventNames");
|
|
1317
|
+
listeners = we("listeners");
|
|
1318
|
+
listenerCount = we("listenerCount");
|
|
1356
1319
|
};
|
|
1357
|
-
|
|
1358
|
-
static Internal = je;
|
|
1359
|
-
};
|
|
1360
|
-
Ne = class extends f2 {
|
|
1320
|
+
Me = class extends f2 {
|
|
1361
1321
|
purchase(e) {
|
|
1362
1322
|
let t = p(g.NFTPurchase, [e]);
|
|
1363
1323
|
return this.request(t);
|
|
@@ -1380,15 +1340,15 @@ var init_es2 = __esm({
|
|
|
1380
1340
|
return this.request(t);
|
|
1381
1341
|
}
|
|
1382
1342
|
};
|
|
1383
|
-
|
|
1343
|
+
Ke = class r8 {
|
|
1384
1344
|
constructor(e, t) {
|
|
1385
1345
|
this.apiKey = e;
|
|
1386
1346
|
if (!e) throw ut();
|
|
1387
1347
|
m2.platform === "react-native" && t?.endpoint && yt().log();
|
|
1388
1348
|
let { defaultEndpoint: s, version: n } = m2;
|
|
1389
|
-
this.testMode = !!t?.testMode, this.useStorageCache = !!t?.useStorageCache, this.endpoint =
|
|
1390
|
-
let o =
|
|
1391
|
-
this.parameters =
|
|
1349
|
+
this.testMode = !!t?.testMode, this.useStorageCache = !!t?.useStorageCache, this.endpoint = Je(t?.endpoint ?? s).origin, this.auth = new ye(this), this.user = new Te(this), this.wallet = new Ie(this), this.nft = new Me(this), this.thirdPartyWallets = new Pe(this), this.rpcProvider = new Se(this);
|
|
1350
|
+
let o = Sn.call(this, t);
|
|
1351
|
+
this.parameters = ce({ API_KEY: this.apiKey, DOMAIN_ORIGIN: typeof window < "u" && window?.location ? window?.location.origin : "", ETH_NETWORK: t?.network, host: Je(this.endpoint).host, sdk: dt[m2.sdkName], version: n, ext: ee(o) ? void 0 : o, locale: t?.locale || "en_US", authConfig: t?.authConfig ? { ...t.authConfig } : void 0, ...m2.bundleId ? { bundleId: m2.bundleId } : {}, meta: t?.meta }), this.networkHash = wn(this.apiKey, t?.network, ee(o) ? void 0 : o), t?.deferPreload || this.preload();
|
|
1392
1352
|
}
|
|
1393
1353
|
static __overlays__ = /* @__PURE__ */ new Map();
|
|
1394
1354
|
endpoint;
|
|
@@ -1413,11 +1373,11 @@ var init_es2 = __esm({
|
|
|
1413
1373
|
await this.overlay.waitForReady();
|
|
1414
1374
|
}
|
|
1415
1375
|
};
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1376
|
+
Nn = 1e3;
|
|
1377
|
+
Bt = 60 * Nn;
|
|
1378
|
+
Vt = 5 * Bt;
|
|
1379
|
+
An = 60 * Bt;
|
|
1380
|
+
je = class {
|
|
1421
1381
|
constructor(e, t, s) {
|
|
1422
1382
|
this.endpoint = e;
|
|
1423
1383
|
this.parameters = t;
|
|
@@ -1429,21 +1389,21 @@ var init_es2 = __esm({
|
|
|
1429
1389
|
isConnectedToInternet = true;
|
|
1430
1390
|
lastPongTime = null;
|
|
1431
1391
|
heartbeatIntervalTimer = null;
|
|
1432
|
-
heartbeatDebounce =
|
|
1392
|
+
heartbeatDebounce = jt(() => {
|
|
1433
1393
|
this.endpoint === "https://auth.magic.link/" && this.heartBeatCheck();
|
|
1434
|
-
},
|
|
1394
|
+
}, An);
|
|
1435
1395
|
async post(e, t) {
|
|
1436
|
-
return
|
|
1396
|
+
return De(async (s, n) => {
|
|
1437
1397
|
if (!this.isConnectedToInternet) {
|
|
1438
1398
|
let l = pt();
|
|
1439
1399
|
n(l);
|
|
1440
1400
|
}
|
|
1441
1401
|
await this.checkRelayerExistsInDOM() || (this.isReadyForRequest = false, await this.reloadRelayer()), this.isReadyForRequest || await this.waitForReady();
|
|
1442
|
-
let o = [], i = Array.isArray(t) ? t.map((l) => l.id) : [], a = await
|
|
1402
|
+
let o = [], i = Array.isArray(t) ? t.map((l) => l.id) : [], a = await Gt(`${e}-${this.parameters}`, t, this.networkHash);
|
|
1443
1403
|
await this._post(a);
|
|
1444
1404
|
let c = (l) => (u2) => {
|
|
1445
|
-
let { id: P2, response: w2 } =
|
|
1446
|
-
if (
|
|
1405
|
+
let { id: P2, response: w2 } = Jt(t, u2);
|
|
1406
|
+
if (Kt(u2), w2?.payload.error?.message === "User denied account access.") Re();
|
|
1447
1407
|
else if (u2.data.deviceShare) {
|
|
1448
1408
|
let { deviceShare: Xt } = u2.data;
|
|
1449
1409
|
Dt(Xt, this.networkHash);
|
|
@@ -1476,12 +1436,12 @@ var init_es2 = __esm({
|
|
|
1476
1436
|
}
|
|
1477
1437
|
heartBeatCheck() {
|
|
1478
1438
|
let e = true, t = async () => {
|
|
1479
|
-
let s = { msgType: `${
|
|
1439
|
+
let s = { msgType: `${y.MAGIC_PING}-${this.parameters}`, payload: [] };
|
|
1480
1440
|
await this._post(s);
|
|
1481
1441
|
};
|
|
1482
1442
|
this.heartbeatIntervalTimer = setInterval(async () => {
|
|
1483
1443
|
if (this.lastPongTime) {
|
|
1484
|
-
if (Date.now() - this.lastPongTime >
|
|
1444
|
+
if (Date.now() - this.lastPongTime > Vt * 2) {
|
|
1485
1445
|
this.reloadRelayer(), e = true;
|
|
1486
1446
|
return;
|
|
1487
1447
|
}
|
|
@@ -1490,29 +1450,69 @@ var init_es2 = __esm({
|
|
|
1490
1450
|
return;
|
|
1491
1451
|
}
|
|
1492
1452
|
await t(), e = false;
|
|
1493
|
-
},
|
|
1453
|
+
}, Vt);
|
|
1494
1454
|
}
|
|
1495
1455
|
stopHeartBeat() {
|
|
1496
1456
|
this.heartbeatDebounce(), this.lastPongTime = null, this.heartbeatIntervalTimer && (clearInterval(this.heartbeatIntervalTimer), this.heartbeatIntervalTimer = null);
|
|
1497
1457
|
}
|
|
1498
1458
|
};
|
|
1459
|
+
Ht = ["request", "overlay", "sdk"];
|
|
1460
|
+
Ve = class extends f2 {
|
|
1461
|
+
compat;
|
|
1462
|
+
__sdk_access_field_descriptors__ = /* @__PURE__ */ new Map();
|
|
1463
|
+
__is_initialized__ = false;
|
|
1464
|
+
utils = { createPromiEvent: b2, isPromiEvent: $t, encodeJSON: ce, decodeJSON: at, createJsonRpcRequestPayload: p, standardizeJsonRpcRequestPayload: F2, storage: me };
|
|
1465
|
+
constructor() {
|
|
1466
|
+
super(void 0);
|
|
1467
|
+
let e = [this, ...$n(this)];
|
|
1468
|
+
Ht.forEach((t) => {
|
|
1469
|
+
let s = e.map((a) => Object.getOwnPropertyDescriptor(a, t)), n = s.findIndex((a) => !!a), o = n > 0, i = s[n];
|
|
1470
|
+
i && (this.__sdk_access_field_descriptors__.set(t, { descriptor: i, isPrototypeField: o }), Object.defineProperty(this, t, { configurable: true, get: () => {
|
|
1471
|
+
throw ht(t);
|
|
1472
|
+
} }));
|
|
1473
|
+
});
|
|
1474
|
+
}
|
|
1475
|
+
init(e) {
|
|
1476
|
+
this.__is_initialized__ || (Ht.forEach((t) => {
|
|
1477
|
+
if (this.__sdk_access_field_descriptors__.has(t)) {
|
|
1478
|
+
let { descriptor: s, isPrototypeField: n } = this.__sdk_access_field_descriptors__.get(t);
|
|
1479
|
+
n ? delete this[t] : Object.defineProperty(this, t, s);
|
|
1480
|
+
}
|
|
1481
|
+
}), this.sdk = e, this.__is_initialized__ = true);
|
|
1482
|
+
}
|
|
1483
|
+
createDeprecationWarning(e) {
|
|
1484
|
+
let { method: t, removalVersion: s, useInstead: n } = e, o = n ? ` Use \`${n}\` instead.` : "", i = `\`${t}\` will be removed from this Extension in version \`${s}\`.${o}`;
|
|
1485
|
+
return new te(this, "DEPRECATION_NOTICE", i);
|
|
1486
|
+
}
|
|
1487
|
+
createWarning(e, t) {
|
|
1488
|
+
return new te(this, e, t);
|
|
1489
|
+
}
|
|
1490
|
+
createError(e, t, s) {
|
|
1491
|
+
return new de(this, e, t, s);
|
|
1492
|
+
}
|
|
1493
|
+
};
|
|
1494
|
+
Be = class extends Ve {
|
|
1495
|
+
};
|
|
1496
|
+
He = class {
|
|
1497
|
+
static Internal = Be;
|
|
1498
|
+
};
|
|
1499
1499
|
}
|
|
1500
1500
|
});
|
|
1501
1501
|
|
|
1502
|
-
// ../../node_modules/.pnpm/@magic-sdk+commons@25.
|
|
1502
|
+
// ../../node_modules/.pnpm/@magic-sdk+commons@25.4.2_@magic-sdk+provider@29.4.2_localforage@1.10.0__@magic-sdk+types@24.21.0/node_modules/@magic-sdk/commons/dist/es/index.mjs
|
|
1503
1503
|
var init_es3 = __esm({
|
|
1504
|
-
"../../node_modules/.pnpm/@magic-sdk+commons@25.
|
|
1504
|
+
"../../node_modules/.pnpm/@magic-sdk+commons@25.4.2_@magic-sdk+provider@29.4.2_localforage@1.10.0__@magic-sdk+types@24.21.0/node_modules/@magic-sdk/commons/dist/es/index.mjs"() {
|
|
1505
1505
|
"use strict";
|
|
1506
1506
|
init_es2();
|
|
1507
1507
|
init_es();
|
|
1508
1508
|
}
|
|
1509
1509
|
});
|
|
1510
1510
|
|
|
1511
|
-
// ../../node_modules/.pnpm/magic-sdk@29.
|
|
1511
|
+
// ../../node_modules/.pnpm/magic-sdk@29.4.2/node_modules/magic-sdk/dist/es/index.mjs
|
|
1512
1512
|
var es_exports = {};
|
|
1513
1513
|
__export(es_exports, {
|
|
1514
1514
|
AuthEventOnReceived: () => k,
|
|
1515
|
-
DeepLinkPage: () =>
|
|
1515
|
+
DeepLinkPage: () => x,
|
|
1516
1516
|
DeviceVerificationEventEmit: () => O,
|
|
1517
1517
|
DeviceVerificationEventOnReceived: () => S,
|
|
1518
1518
|
DisableMFAEventEmit: () => G,
|
|
@@ -1520,20 +1520,20 @@ __export(es_exports, {
|
|
|
1520
1520
|
EnableMFAEventEmit: () => D,
|
|
1521
1521
|
EnableMFAEventOnReceived: () => w,
|
|
1522
1522
|
EthChainType: () => H,
|
|
1523
|
-
Extension: () =>
|
|
1524
|
-
ExtensionError: () =>
|
|
1525
|
-
ExtensionWarning: () =>
|
|
1523
|
+
Extension: () => He,
|
|
1524
|
+
ExtensionError: () => de,
|
|
1525
|
+
ExtensionWarning: () => te,
|
|
1526
1526
|
FarcasterLoginEventEmit: () => L,
|
|
1527
1527
|
LocalStorageKeys: () => _,
|
|
1528
|
-
LoginWithEmailOTPEventEmit: () =>
|
|
1528
|
+
LoginWithEmailOTPEventEmit: () => I,
|
|
1529
1529
|
LoginWithEmailOTPEventOnReceived: () => T,
|
|
1530
1530
|
LoginWithMagicLinkEventEmit: () => A,
|
|
1531
|
-
LoginWithMagicLinkEventOnReceived: () =>
|
|
1531
|
+
LoginWithMagicLinkEventOnReceived: () => R,
|
|
1532
1532
|
LoginWithSmsOTPEventEmit: () => N,
|
|
1533
1533
|
LoginWithSmsOTPEventOnReceived: () => h,
|
|
1534
1534
|
Magic: () => wt2,
|
|
1535
1535
|
MagicIncomingWindowMessage: () => E,
|
|
1536
|
-
MagicOutgoingWindowMessage: () =>
|
|
1536
|
+
MagicOutgoingWindowMessage: () => y,
|
|
1537
1537
|
MagicPayloadMethod: () => g,
|
|
1538
1538
|
NftCheckoutIntermediaryEvents: () => Q,
|
|
1539
1539
|
RPCError: () => U2,
|
|
@@ -1565,9 +1565,9 @@ function ft2(_2) {
|
|
|
1565
1565
|
function st2(_2) {
|
|
1566
1566
|
return !![].slice.call(document.querySelectorAll(".magic-iframe")).find((O3) => O3.src.includes(_2));
|
|
1567
1567
|
}
|
|
1568
|
-
var $r2, Qe2, Zr2, qr2, kr2, et2, de2, Je2, rt2, $e2, qe2, er2,
|
|
1568
|
+
var $r2, Qe2, Zr2, qr2, kr2, et2, de2, Je2, rt2, $e2, qe2, er2, pe2, Te2, at2, ye2, wt2;
|
|
1569
1569
|
var init_es4 = __esm({
|
|
1570
|
-
"../../node_modules/.pnpm/magic-sdk@29.
|
|
1570
|
+
"../../node_modules/.pnpm/magic-sdk@29.4.2/node_modules/magic-sdk/dist/es/index.mjs"() {
|
|
1571
1571
|
"use strict";
|
|
1572
1572
|
init_es2();
|
|
1573
1573
|
init_es2();
|
|
@@ -1584,8 +1584,8 @@ var init_es4 = __esm({
|
|
|
1584
1584
|
throw Error('Dynamic require of "' + _2 + '" is not supported');
|
|
1585
1585
|
});
|
|
1586
1586
|
Je2 = (_2, y3) => () => (y3 || _2((y3 = { exports: {} }).exports, y3), y3.exports);
|
|
1587
|
-
rt2 = (_2, y3, O3,
|
|
1588
|
-
if (y3 && typeof y3 == "object" || typeof y3 == "function") for (let W2 of qr2(y3)) !et2.call(_2, W2) && W2 !== O3 && Qe2(_2, W2, { get: () => y3[W2], enumerable: !(
|
|
1587
|
+
rt2 = (_2, y3, O3, C2) => {
|
|
1588
|
+
if (y3 && typeof y3 == "object" || typeof y3 == "function") for (let W2 of qr2(y3)) !et2.call(_2, W2) && W2 !== O3 && Qe2(_2, W2, { get: () => y3[W2], enumerable: !(C2 = Zr2(y3, W2)) || C2.enumerable });
|
|
1589
1589
|
return _2;
|
|
1590
1590
|
};
|
|
1591
1591
|
$e2 = (_2, y3, O3) => (O3 = _2 != null ? $r2(kr2(_2)) : {}, rt2(y3 || !_2 || !_2.__esModule ? Qe2(O3, "default", { value: _2, enumerable: true }) : O3, _2));
|
|
@@ -1600,7 +1600,7 @@ var init_es4 = __esm({
|
|
|
1600
1600
|
}
|
|
1601
1601
|
})(function() {
|
|
1602
1602
|
var _2, y3, O3;
|
|
1603
|
-
return function
|
|
1603
|
+
return (function C2(W2, Z3, L3) {
|
|
1604
1604
|
function V2(K2, J3) {
|
|
1605
1605
|
if (!Z3[K2]) {
|
|
1606
1606
|
if (!W2[K2]) {
|
|
@@ -1614,13 +1614,13 @@ var init_es4 = __esm({
|
|
|
1614
1614
|
W2[K2][0].call(T3.exports, function(F3) {
|
|
1615
1615
|
var $2 = W2[K2][1][F3];
|
|
1616
1616
|
return V2($2 || F3);
|
|
1617
|
-
}, T3, T3.exports,
|
|
1617
|
+
}, T3, T3.exports, C2, W2, Z3, L3);
|
|
1618
1618
|
}
|
|
1619
1619
|
return Z3[K2].exports;
|
|
1620
1620
|
}
|
|
1621
1621
|
for (var D2 = typeof de2 == "function" && de2, z3 = 0; z3 < L3.length; z3++) V2(L3[z3]);
|
|
1622
1622
|
return V2;
|
|
1623
|
-
}({ 1: [function(
|
|
1623
|
+
})({ 1: [function(C2, W2, Z3) {
|
|
1624
1624
|
(function(L3) {
|
|
1625
1625
|
"use strict";
|
|
1626
1626
|
var V2 = L3.MutationObserver || L3.WebKitMutationObserver, D2;
|
|
@@ -1656,9 +1656,9 @@ var init_es4 = __esm({
|
|
|
1656
1656
|
T3.push(P2) === 1 && !w2 && D2();
|
|
1657
1657
|
}
|
|
1658
1658
|
}).call(this, typeof global < "u" ? global : typeof self < "u" ? self : typeof window < "u" ? window : {});
|
|
1659
|
-
}, {}], 2: [function(
|
|
1659
|
+
}, {}], 2: [function(C2, W2, Z3) {
|
|
1660
1660
|
"use strict";
|
|
1661
|
-
var L3 =
|
|
1661
|
+
var L3 = C2(1);
|
|
1662
1662
|
function V2() {
|
|
1663
1663
|
}
|
|
1664
1664
|
var D2 = {}, z3 = ["REJECTED"], K2 = ["FULFILLED"], J3 = ["PENDING"];
|
|
@@ -1673,8 +1673,8 @@ var init_es4 = __esm({
|
|
|
1673
1673
|
if (typeof h3 != "function" && this.state === K2 || typeof A3 != "function" && this.state === z3) return this;
|
|
1674
1674
|
var E3 = new this.constructor(V2);
|
|
1675
1675
|
if (this.state !== J3) {
|
|
1676
|
-
var
|
|
1677
|
-
T3(E3,
|
|
1676
|
+
var N3 = this.state === K2 ? h3 : A3;
|
|
1677
|
+
T3(E3, N3, this.outcome);
|
|
1678
1678
|
} else this.queue.push(new w2(E3, h3, A3));
|
|
1679
1679
|
return E3;
|
|
1680
1680
|
};
|
|
@@ -1692,20 +1692,20 @@ var init_es4 = __esm({
|
|
|
1692
1692
|
};
|
|
1693
1693
|
function T3(h3, A3, E3) {
|
|
1694
1694
|
L3(function() {
|
|
1695
|
-
var
|
|
1695
|
+
var N3;
|
|
1696
1696
|
try {
|
|
1697
|
-
|
|
1697
|
+
N3 = A3(E3);
|
|
1698
1698
|
} catch (H3) {
|
|
1699
1699
|
return D2.reject(h3, H3);
|
|
1700
1700
|
}
|
|
1701
|
-
|
|
1701
|
+
N3 === h3 ? D2.reject(h3, new TypeError("Cannot resolve promise with itself")) : D2.resolve(h3, N3);
|
|
1702
1702
|
});
|
|
1703
1703
|
}
|
|
1704
1704
|
D2.resolve = function(h3, A3) {
|
|
1705
1705
|
var E3 = P2(F3, A3);
|
|
1706
1706
|
if (E3.status === "error") return D2.reject(h3, E3.value);
|
|
1707
|
-
var
|
|
1708
|
-
if (
|
|
1707
|
+
var N3 = E3.value;
|
|
1708
|
+
if (N3) $2(h3, N3);
|
|
1709
1709
|
else {
|
|
1710
1710
|
h3.state = K2, h3.outcome = A3;
|
|
1711
1711
|
for (var H3 = -1, j2 = h3.queue.length; ++H3 < j2; ) h3.queue[H3].callFulfilled(A3);
|
|
@@ -1713,7 +1713,7 @@ var init_es4 = __esm({
|
|
|
1713
1713
|
return h3;
|
|
1714
1714
|
}, D2.reject = function(h3, A3) {
|
|
1715
1715
|
h3.state = z3, h3.outcome = A3;
|
|
1716
|
-
for (var E3 = -1,
|
|
1716
|
+
for (var E3 = -1, N3 = h3.queue.length; ++E3 < N3; ) h3.queue[E3].callRejected(A3);
|
|
1717
1717
|
return h3;
|
|
1718
1718
|
};
|
|
1719
1719
|
function F3(h3) {
|
|
@@ -1724,24 +1724,24 @@ var init_es4 = __esm({
|
|
|
1724
1724
|
}
|
|
1725
1725
|
function $2(h3, A3) {
|
|
1726
1726
|
var E3 = false;
|
|
1727
|
-
function
|
|
1727
|
+
function N3(Q3) {
|
|
1728
1728
|
E3 || (E3 = true, D2.reject(h3, Q3));
|
|
1729
1729
|
}
|
|
1730
1730
|
function H3(Q3) {
|
|
1731
1731
|
E3 || (E3 = true, D2.resolve(h3, Q3));
|
|
1732
1732
|
}
|
|
1733
1733
|
function j2() {
|
|
1734
|
-
A3(H3,
|
|
1734
|
+
A3(H3, N3);
|
|
1735
1735
|
}
|
|
1736
1736
|
var X3 = P2(j2);
|
|
1737
|
-
X3.status === "error" &&
|
|
1737
|
+
X3.status === "error" && N3(X3.value);
|
|
1738
1738
|
}
|
|
1739
1739
|
function P2(h3, A3) {
|
|
1740
1740
|
var E3 = {};
|
|
1741
1741
|
try {
|
|
1742
1742
|
E3.value = h3(A3), E3.status = "success";
|
|
1743
|
-
} catch (
|
|
1744
|
-
E3.status = "error", E3.value =
|
|
1743
|
+
} catch (N3) {
|
|
1744
|
+
E3.status = "error", E3.value = N3;
|
|
1745
1745
|
}
|
|
1746
1746
|
return E3;
|
|
1747
1747
|
}
|
|
@@ -1758,16 +1758,16 @@ var init_es4 = __esm({
|
|
|
1758
1758
|
function ae2(h3) {
|
|
1759
1759
|
var A3 = this;
|
|
1760
1760
|
if (Object.prototype.toString.call(h3) !== "[object Array]") return this.reject(new TypeError("must be an array"));
|
|
1761
|
-
var E3 = h3.length,
|
|
1761
|
+
var E3 = h3.length, N3 = false;
|
|
1762
1762
|
if (!E3) return this.resolve([]);
|
|
1763
1763
|
for (var H3 = new Array(E3), j2 = 0, X3 = -1, Q3 = new this(V2); ++X3 < E3; ) ee2(h3[X3], X3);
|
|
1764
1764
|
return Q3;
|
|
1765
|
-
function ee2(
|
|
1766
|
-
A3.resolve(
|
|
1767
|
-
|
|
1765
|
+
function ee2(oe2, a) {
|
|
1766
|
+
A3.resolve(oe2).then(u2, function(v2) {
|
|
1767
|
+
N3 || (N3 = true, D2.reject(Q3, v2));
|
|
1768
1768
|
});
|
|
1769
1769
|
function u2(v2) {
|
|
1770
|
-
H3[a] = v2, ++j2 === E3 && !
|
|
1770
|
+
H3[a] = v2, ++j2 === E3 && !N3 && (N3 = true, D2.resolve(Q3, H3));
|
|
1771
1771
|
}
|
|
1772
1772
|
}
|
|
1773
1773
|
}
|
|
@@ -1775,24 +1775,24 @@ var init_es4 = __esm({
|
|
|
1775
1775
|
function re2(h3) {
|
|
1776
1776
|
var A3 = this;
|
|
1777
1777
|
if (Object.prototype.toString.call(h3) !== "[object Array]") return this.reject(new TypeError("must be an array"));
|
|
1778
|
-
var E3 = h3.length,
|
|
1778
|
+
var E3 = h3.length, N3 = false;
|
|
1779
1779
|
if (!E3) return this.resolve([]);
|
|
1780
1780
|
for (var H3 = -1, j2 = new this(V2); ++H3 < E3; ) X3(h3[H3]);
|
|
1781
1781
|
return j2;
|
|
1782
1782
|
function X3(Q3) {
|
|
1783
1783
|
A3.resolve(Q3).then(function(ee2) {
|
|
1784
|
-
|
|
1784
|
+
N3 || (N3 = true, D2.resolve(j2, ee2));
|
|
1785
1785
|
}, function(ee2) {
|
|
1786
|
-
|
|
1786
|
+
N3 || (N3 = true, D2.reject(j2, ee2));
|
|
1787
1787
|
});
|
|
1788
1788
|
}
|
|
1789
1789
|
}
|
|
1790
|
-
}, { 1: 1 }], 3: [function(
|
|
1790
|
+
}, { 1: 1 }], 3: [function(C2, W2, Z3) {
|
|
1791
1791
|
(function(L3) {
|
|
1792
1792
|
"use strict";
|
|
1793
|
-
typeof L3.Promise != "function" && (L3.Promise =
|
|
1793
|
+
typeof L3.Promise != "function" && (L3.Promise = C2(2));
|
|
1794
1794
|
}).call(this, typeof global < "u" ? global : typeof self < "u" ? self : typeof window < "u" ? window : {});
|
|
1795
|
-
}, { 2: 2 }], 4: [function(
|
|
1795
|
+
}, { 2: 2 }], 4: [function(C2, W2, Z3) {
|
|
1796
1796
|
"use strict";
|
|
1797
1797
|
var L3 = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
1798
1798
|
return typeof e;
|
|
@@ -1833,7 +1833,7 @@ var init_es4 = __esm({
|
|
|
1833
1833
|
return o.getBlob(t.type);
|
|
1834
1834
|
}
|
|
1835
1835
|
}
|
|
1836
|
-
typeof Promise > "u" &&
|
|
1836
|
+
typeof Promise > "u" && C2(3);
|
|
1837
1837
|
var m3 = Promise;
|
|
1838
1838
|
function w2(e, t) {
|
|
1839
1839
|
t && e.then(function(r10) {
|
|
@@ -1869,7 +1869,7 @@ var init_es4 = __esm({
|
|
|
1869
1869
|
return false;
|
|
1870
1870
|
});
|
|
1871
1871
|
}
|
|
1872
|
-
function
|
|
1872
|
+
function N3(e) {
|
|
1873
1873
|
return typeof k2 == "boolean" ? m3.resolve(k2) : E3(e).then(function(t) {
|
|
1874
1874
|
return k2 = t, k2;
|
|
1875
1875
|
});
|
|
@@ -1918,7 +1918,7 @@ var init_es4 = __esm({
|
|
|
1918
1918
|
function ee2(e) {
|
|
1919
1919
|
return Q3(e, false);
|
|
1920
1920
|
}
|
|
1921
|
-
function
|
|
1921
|
+
function oe2(e) {
|
|
1922
1922
|
return Q3(e, true);
|
|
1923
1923
|
}
|
|
1924
1924
|
function a(e, t) {
|
|
@@ -1963,7 +1963,7 @@ var init_es4 = __esm({
|
|
|
1963
1963
|
i._dbInfo.db && (i._dbInfo.db.close(), i._dbInfo.db = null);
|
|
1964
1964
|
}
|
|
1965
1965
|
return e.db = null, ee2(e).then(function(n) {
|
|
1966
|
-
return e.db = n, a(e) ?
|
|
1966
|
+
return e.db = n, a(e) ? oe2(e) : n;
|
|
1967
1967
|
}).then(function(n) {
|
|
1968
1968
|
e.db = t.db = n;
|
|
1969
1969
|
for (var f3 = 0; f3 < r10.length; f3++) r10[f3]._dbInfo.db = n;
|
|
@@ -1978,7 +1978,7 @@ var init_es4 = __esm({
|
|
|
1978
1978
|
r10(null, i);
|
|
1979
1979
|
} catch (n) {
|
|
1980
1980
|
if (o > 0 && (!e.db || n.name === "InvalidStateError" || n.name === "NotFoundError")) return m3.resolve().then(function() {
|
|
1981
|
-
if (!e.db || n.name === "NotFoundError" && !e.db.objectStoreNames.contains(e.storeName) && e.version <= e.db.version) return e.db && (e.version = e.db.version + 1),
|
|
1981
|
+
if (!e.db || n.name === "NotFoundError" && !e.db.objectStoreNames.contains(e.storeName) && e.version <= e.db.version) return e.db && (e.version = e.db.version + 1), oe2(e);
|
|
1982
1982
|
}).then(function() {
|
|
1983
1983
|
return I2(e).then(function() {
|
|
1984
1984
|
R3(e, t, r10, o - 1);
|
|
@@ -1990,7 +1990,7 @@ var init_es4 = __esm({
|
|
|
1990
1990
|
function G2() {
|
|
1991
1991
|
return { forages: [], db: null, dbReady: null, deferredOperations: [] };
|
|
1992
1992
|
}
|
|
1993
|
-
function
|
|
1993
|
+
function fe2(e) {
|
|
1994
1994
|
var t = this, r10 = { db: null };
|
|
1995
1995
|
if (e) for (var o in e) r10[o] = e[o];
|
|
1996
1996
|
var i = M2[r10.name];
|
|
@@ -2007,7 +2007,7 @@ var init_es4 = __esm({
|
|
|
2007
2007
|
return m3.all(n).then(function() {
|
|
2008
2008
|
return r10.db = i.db, ee2(r10);
|
|
2009
2009
|
}).then(function(d) {
|
|
2010
|
-
return r10.db = d, a(r10, t._defaultConfig.version) ?
|
|
2010
|
+
return r10.db = d, a(r10, t._defaultConfig.version) ? oe2(r10) : d;
|
|
2011
2011
|
}).then(function(d) {
|
|
2012
2012
|
r10.db = i.db = d, t._dbInfo = r10;
|
|
2013
2013
|
for (var p2 = 0; p2 < l.length; p2++) {
|
|
@@ -2039,7 +2039,7 @@ var init_es4 = __esm({
|
|
|
2039
2039
|
});
|
|
2040
2040
|
return w2(o, t), o;
|
|
2041
2041
|
}
|
|
2042
|
-
function
|
|
2042
|
+
function ue(e, t) {
|
|
2043
2043
|
var r10 = this, o = new m3(function(i, n) {
|
|
2044
2044
|
r10.ready().then(function() {
|
|
2045
2045
|
R3(r10._dbInfo, re2, function(f3, s) {
|
|
@@ -2071,7 +2071,7 @@ var init_es4 = __esm({
|
|
|
2071
2071
|
var i = new m3(function(n, f3) {
|
|
2072
2072
|
var s;
|
|
2073
2073
|
o.ready().then(function() {
|
|
2074
|
-
return s = o._dbInfo, ae2.call(t) === "[object Blob]" ?
|
|
2074
|
+
return s = o._dbInfo, ae2.call(t) === "[object Blob]" ? N3(s.db).then(function(c) {
|
|
2075
2075
|
return c ? t : u2(t);
|
|
2076
2076
|
}) : t;
|
|
2077
2077
|
}).then(function(c) {
|
|
@@ -2296,11 +2296,11 @@ var init_es4 = __esm({
|
|
|
2296
2296
|
}
|
|
2297
2297
|
return w2(i, t), i;
|
|
2298
2298
|
}
|
|
2299
|
-
var ur2 = { _driver: "asyncStorage", _initStorage:
|
|
2299
|
+
var ur2 = { _driver: "asyncStorage", _initStorage: fe2, _support: K2(), iterate: ue, getItem: ie2, setItem: tr2, removeItem: nr2, clear: or2, length: ir2, key: ar2, keys: fr2, dropInstance: sr2 };
|
|
2300
2300
|
function cr2() {
|
|
2301
2301
|
return typeof openDatabase == "function";
|
|
2302
2302
|
}
|
|
2303
|
-
var te2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", lr2 = "~~local_forage_type~", Be2 = /^~~local_forage_type~([^~]+)~/,
|
|
2303
|
+
var te2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", lr2 = "~~local_forage_type~", Be2 = /^~~local_forage_type~([^~]+)~/, ve = "__lfsc__:", ge = ve.length, be = "arbf", _e = "blob", Ne2 = "si08", xe = "ui08", Oe2 = "uic8", Ce2 = "si16", Le2 = "si32", Pe2 = "ur16", Me2 = "ui32", Fe2 = "fl32", Ue2 = "fl64", We2 = ge + be.length, ze2 = Object.prototype.toString;
|
|
2304
2304
|
function Ye2(e) {
|
|
2305
2305
|
var t = e.length * 0.75, r10 = e.length, o, i = 0, n, f3, s, c;
|
|
2306
2306
|
e[e.length - 1] === "=" && (t--, e[e.length - 2] === "=" && t--);
|
|
@@ -2316,13 +2316,13 @@ var init_es4 = __esm({
|
|
|
2316
2316
|
function dr2(e, t) {
|
|
2317
2317
|
var r10 = "";
|
|
2318
2318
|
if (e && (r10 = ze2.call(e)), e && (r10 === "[object ArrayBuffer]" || e.buffer && ze2.call(e.buffer) === "[object ArrayBuffer]")) {
|
|
2319
|
-
var o, i =
|
|
2320
|
-
e instanceof ArrayBuffer ? (o = e, i +=
|
|
2319
|
+
var o, i = ve;
|
|
2320
|
+
e instanceof ArrayBuffer ? (o = e, i += be) : (o = e.buffer, r10 === "[object Int8Array]" ? i += Ne2 : r10 === "[object Uint8Array]" ? i += xe : r10 === "[object Uint8ClampedArray]" ? i += Oe2 : r10 === "[object Int16Array]" ? i += Ce2 : r10 === "[object Uint16Array]" ? i += Pe2 : r10 === "[object Int32Array]" ? i += Le2 : r10 === "[object Uint32Array]" ? i += Me2 : r10 === "[object Float32Array]" ? i += Fe2 : r10 === "[object Float64Array]" ? i += Ue2 : t(new Error("Failed to get type for BinaryArray"))), t(i + we2(o));
|
|
2321
2321
|
} else if (r10 === "[object Blob]") {
|
|
2322
2322
|
var n = new FileReader();
|
|
2323
2323
|
n.onload = function() {
|
|
2324
2324
|
var f3 = lr2 + e.type + "~" + we2(this.result);
|
|
2325
|
-
t(
|
|
2325
|
+
t(ve + _e + f3);
|
|
2326
2326
|
}, n.readAsArrayBuffer(e);
|
|
2327
2327
|
} else try {
|
|
2328
2328
|
t(JSON.stringify(e));
|
|
@@ -2331,31 +2331,31 @@ var init_es4 = __esm({
|
|
|
2331
2331
|
}
|
|
2332
2332
|
}
|
|
2333
2333
|
function vr2(e) {
|
|
2334
|
-
if (e.substring(0,
|
|
2335
|
-
var t = e.substring(We2), r10 = e.substring(
|
|
2336
|
-
if (r10 ===
|
|
2334
|
+
if (e.substring(0, ge) !== ve) return JSON.parse(e);
|
|
2335
|
+
var t = e.substring(We2), r10 = e.substring(ge, We2), o;
|
|
2336
|
+
if (r10 === _e && Be2.test(t)) {
|
|
2337
2337
|
var i = t.match(Be2);
|
|
2338
2338
|
o = i[1], t = t.substring(i[0].length);
|
|
2339
2339
|
}
|
|
2340
2340
|
var n = Ye2(t);
|
|
2341
2341
|
switch (r10) {
|
|
2342
|
-
case
|
|
2342
|
+
case be:
|
|
2343
2343
|
return n;
|
|
2344
|
-
case
|
|
2344
|
+
case _e:
|
|
2345
2345
|
return J3([n], { type: o });
|
|
2346
2346
|
case Ne2:
|
|
2347
2347
|
return new Int8Array(n);
|
|
2348
|
-
case
|
|
2348
|
+
case xe:
|
|
2349
2349
|
return new Uint8Array(n);
|
|
2350
2350
|
case Oe2:
|
|
2351
2351
|
return new Uint8ClampedArray(n);
|
|
2352
2352
|
case Ce2:
|
|
2353
2353
|
return new Int16Array(n);
|
|
2354
|
-
case
|
|
2354
|
+
case Pe2:
|
|
2355
2355
|
return new Uint16Array(n);
|
|
2356
2356
|
case Le2:
|
|
2357
2357
|
return new Int32Array(n);
|
|
2358
|
-
case
|
|
2358
|
+
case Me2:
|
|
2359
2359
|
return new Uint32Array(n);
|
|
2360
2360
|
case Fe2:
|
|
2361
2361
|
return new Float32Array(n);
|
|
@@ -2388,7 +2388,7 @@ var init_es4 = __esm({
|
|
|
2388
2388
|
});
|
|
2389
2389
|
return r10.serializer = Ie2, i;
|
|
2390
2390
|
}
|
|
2391
|
-
function
|
|
2391
|
+
function ne(e, t, r10, o, i, n) {
|
|
2392
2392
|
e.executeSql(r10, o, i, function(f3, s) {
|
|
2393
2393
|
s.code === s.SYNTAX_ERR ? f3.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?", [t.storeName], function(c, l) {
|
|
2394
2394
|
l.rows.length ? n(c, s) : Ke2(c, t, function() {
|
|
@@ -2404,7 +2404,7 @@ var init_es4 = __esm({
|
|
|
2404
2404
|
r10.ready().then(function() {
|
|
2405
2405
|
var f3 = r10._dbInfo;
|
|
2406
2406
|
f3.db.transaction(function(s) {
|
|
2407
|
-
|
|
2407
|
+
ne(s, f3, "SELECT * FROM " + f3.storeName + " WHERE key = ? LIMIT 1", [e], function(c, l) {
|
|
2408
2408
|
var d = l.rows.length ? l.rows.item(0).value : null;
|
|
2409
2409
|
d && (d = f3.serializer.deserialize(d)), i(d);
|
|
2410
2410
|
}, function(c, l) {
|
|
@@ -2420,7 +2420,7 @@ var init_es4 = __esm({
|
|
|
2420
2420
|
r10.ready().then(function() {
|
|
2421
2421
|
var f3 = r10._dbInfo;
|
|
2422
2422
|
f3.db.transaction(function(s) {
|
|
2423
|
-
|
|
2423
|
+
ne(s, f3, "SELECT * FROM " + f3.storeName, [], function(c, l) {
|
|
2424
2424
|
for (var d = l.rows, p2 = d.length, S3 = 0; S3 < p2; S3++) {
|
|
2425
2425
|
var B2 = d.item(S3), x2 = B2.value;
|
|
2426
2426
|
if (x2 && (x2 = f3.serializer.deserialize(x2)), x2 = e(x2, B2.key, S3 + 1), x2 !== void 0) {
|
|
@@ -2446,7 +2446,7 @@ var init_es4 = __esm({
|
|
|
2446
2446
|
var c = t, l = i._dbInfo;
|
|
2447
2447
|
l.serializer.serialize(t, function(d, p2) {
|
|
2448
2448
|
p2 ? s(p2) : l.db.transaction(function(S3) {
|
|
2449
|
-
|
|
2449
|
+
ne(S3, l, "INSERT OR REPLACE INTO " + l.storeName + " (key, value) VALUES (?, ?)", [e, d], function() {
|
|
2450
2450
|
f3(c);
|
|
2451
2451
|
}, function(B2, x2) {
|
|
2452
2452
|
s(x2);
|
|
@@ -2475,7 +2475,7 @@ var init_es4 = __esm({
|
|
|
2475
2475
|
r10.ready().then(function() {
|
|
2476
2476
|
var f3 = r10._dbInfo;
|
|
2477
2477
|
f3.db.transaction(function(s) {
|
|
2478
|
-
|
|
2478
|
+
ne(s, f3, "DELETE FROM " + f3.storeName + " WHERE key = ?", [e], function() {
|
|
2479
2479
|
i();
|
|
2480
2480
|
}, function(c, l) {
|
|
2481
2481
|
n(l);
|
|
@@ -2490,7 +2490,7 @@ var init_es4 = __esm({
|
|
|
2490
2490
|
t.ready().then(function() {
|
|
2491
2491
|
var n = t._dbInfo;
|
|
2492
2492
|
n.db.transaction(function(f3) {
|
|
2493
|
-
|
|
2493
|
+
ne(f3, n, "DELETE FROM " + n.storeName, [], function() {
|
|
2494
2494
|
o();
|
|
2495
2495
|
}, function(s, c) {
|
|
2496
2496
|
i(c);
|
|
@@ -2505,7 +2505,7 @@ var init_es4 = __esm({
|
|
|
2505
2505
|
t.ready().then(function() {
|
|
2506
2506
|
var n = t._dbInfo;
|
|
2507
2507
|
n.db.transaction(function(f3) {
|
|
2508
|
-
|
|
2508
|
+
ne(f3, n, "SELECT COUNT(key) as c FROM " + n.storeName, [], function(s, c) {
|
|
2509
2509
|
var l = c.rows.item(0).c;
|
|
2510
2510
|
o(l);
|
|
2511
2511
|
}, function(s, c) {
|
|
@@ -2521,7 +2521,7 @@ var init_es4 = __esm({
|
|
|
2521
2521
|
r10.ready().then(function() {
|
|
2522
2522
|
var f3 = r10._dbInfo;
|
|
2523
2523
|
f3.db.transaction(function(s) {
|
|
2524
|
-
|
|
2524
|
+
ne(s, f3, "SELECT key FROM " + f3.storeName + " WHERE id = ? LIMIT 1", [e + 1], function(c, l) {
|
|
2525
2525
|
var d = l.rows.length ? l.rows.item(0).key : null;
|
|
2526
2526
|
i(d);
|
|
2527
2527
|
}, function(c, l) {
|
|
@@ -2537,7 +2537,7 @@ var init_es4 = __esm({
|
|
|
2537
2537
|
t.ready().then(function() {
|
|
2538
2538
|
var n = t._dbInfo;
|
|
2539
2539
|
n.db.transaction(function(f3) {
|
|
2540
|
-
|
|
2540
|
+
ne(f3, n, "SELECT key FROM " + n.storeName, [], function(s, c) {
|
|
2541
2541
|
for (var l = [], d = 0; d < c.rows.length; d++) l.push(c.rows.item(d).key);
|
|
2542
2542
|
o(l);
|
|
2543
2543
|
}, function(s, c) {
|
|
@@ -2602,7 +2602,7 @@ var init_es4 = __esm({
|
|
|
2602
2602
|
return false;
|
|
2603
2603
|
}
|
|
2604
2604
|
}
|
|
2605
|
-
function
|
|
2605
|
+
function Ve2(e, t) {
|
|
2606
2606
|
var r10 = e.name + "/";
|
|
2607
2607
|
return e.storeName !== t.storeName && (r10 += e.storeName + "/"), r10;
|
|
2608
2608
|
}
|
|
@@ -2620,7 +2620,7 @@ var init_es4 = __esm({
|
|
|
2620
2620
|
function Br2(e) {
|
|
2621
2621
|
var t = this, r10 = {};
|
|
2622
2622
|
if (e) for (var o in e) r10[o] = e[o];
|
|
2623
|
-
return r10.keyPrefix =
|
|
2623
|
+
return r10.keyPrefix = Ve2(e, t._defaultConfig), Tr2() ? (t._dbInfo = r10, r10.serializer = Ie2, m3.resolve()) : m3.reject();
|
|
2624
2624
|
}
|
|
2625
2625
|
function Nr2(e) {
|
|
2626
2626
|
var t = this, r10 = t.ready().then(function() {
|
|
@@ -2716,7 +2716,7 @@ var init_es4 = __esm({
|
|
|
2716
2716
|
}
|
|
2717
2717
|
var o = this, i;
|
|
2718
2718
|
return e.name ? i = new m3(function(n) {
|
|
2719
|
-
e.storeName ? n(
|
|
2719
|
+
e.storeName ? n(Ve2(e, o._defaultConfig)) : n(e.name + "/");
|
|
2720
2720
|
}).then(function(n) {
|
|
2721
2721
|
for (var f3 = localStorage.length - 1; f3 >= 0; f3--) {
|
|
2722
2722
|
var s = localStorage.key(f3);
|
|
@@ -2732,9 +2732,9 @@ var init_es4 = __esm({
|
|
|
2732
2732
|
i++;
|
|
2733
2733
|
}
|
|
2734
2734
|
return false;
|
|
2735
|
-
},
|
|
2735
|
+
}, Ge = Array.isArray || function(e) {
|
|
2736
2736
|
return Object.prototype.toString.call(e) === "[object Array]";
|
|
2737
|
-
}, ce2 = {}, je2 = {}, se = { INDEXEDDB: ur2, WEBSQL: Ar2, LOCALSTORAGE: Wr2 }, Kr2 = [se.INDEXEDDB._driver, se.WEBSQL._driver, se.LOCALSTORAGE._driver], he2 = ["dropInstance"],
|
|
2737
|
+
}, ce2 = {}, je2 = {}, se = { INDEXEDDB: ur2, WEBSQL: Ar2, LOCALSTORAGE: Wr2 }, Kr2 = [se.INDEXEDDB._driver, se.WEBSQL._driver, se.LOCALSTORAGE._driver], he2 = ["dropInstance"], Ee = ["clear", "getItem", "iterate", "key", "keys", "length", "removeItem", "setItem"].concat(he2), Hr2 = { description: "", driver: Kr2.slice(), name: "localforage", size: 4980736, storeName: "keyvaluepairs", version: 1 };
|
|
2738
2738
|
function Vr(e, t) {
|
|
2739
2739
|
e[t] = function() {
|
|
2740
2740
|
var r10 = arguments;
|
|
@@ -2746,11 +2746,11 @@ var init_es4 = __esm({
|
|
|
2746
2746
|
function Se2() {
|
|
2747
2747
|
for (var e = 1; e < arguments.length; e++) {
|
|
2748
2748
|
var t = arguments[e];
|
|
2749
|
-
if (t) for (var r10 in t) t.hasOwnProperty(r10) && (
|
|
2749
|
+
if (t) for (var r10 in t) t.hasOwnProperty(r10) && (Ge(t[r10]) ? arguments[0][r10] = t[r10].slice() : arguments[0][r10] = t[r10]);
|
|
2750
2750
|
}
|
|
2751
2751
|
return arguments[0];
|
|
2752
2752
|
}
|
|
2753
|
-
var Gr2 = function() {
|
|
2753
|
+
var Gr2 = (function() {
|
|
2754
2754
|
function e(t) {
|
|
2755
2755
|
V2(this, e);
|
|
2756
2756
|
for (var r10 in se) if (se.hasOwnProperty(r10)) {
|
|
@@ -2777,7 +2777,7 @@ var init_es4 = __esm({
|
|
|
2777
2777
|
s(l);
|
|
2778
2778
|
return;
|
|
2779
2779
|
}
|
|
2780
|
-
for (var d =
|
|
2780
|
+
for (var d = Ee.concat("_initStorage"), p2 = 0, S3 = d.length; p2 < S3; p2++) {
|
|
2781
2781
|
var B2 = d[p2], x2 = !Yr2(he2, B2);
|
|
2782
2782
|
if ((x2 || r10[B2]) && typeof r10[B2] != "function") {
|
|
2783
2783
|
s(l);
|
|
@@ -2820,7 +2820,7 @@ var init_es4 = __esm({
|
|
|
2820
2820
|
return T3(i, r10, r10), i;
|
|
2821
2821
|
}, e.prototype.setDriver = function(r10, o, i) {
|
|
2822
2822
|
var n = this;
|
|
2823
|
-
|
|
2823
|
+
Ge(r10) || (r10 = [r10]);
|
|
2824
2824
|
var f3 = this._getSupportedDrivers(r10);
|
|
2825
2825
|
function s() {
|
|
2826
2826
|
n._config.driver = n.driver();
|
|
@@ -2867,19 +2867,19 @@ var init_es4 = __esm({
|
|
|
2867
2867
|
}
|
|
2868
2868
|
return o;
|
|
2869
2869
|
}, e.prototype._wrapLibraryMethodsWithReady = function() {
|
|
2870
|
-
for (var r10 = 0, o =
|
|
2870
|
+
for (var r10 = 0, o = Ee.length; r10 < o; r10++) Vr(this, Ee[r10]);
|
|
2871
2871
|
}, e.prototype.createInstance = function(r10) {
|
|
2872
2872
|
return new e(r10);
|
|
2873
2873
|
}, e;
|
|
2874
|
-
}(), jr = new Gr2();
|
|
2874
|
+
})(), jr = new Gr2();
|
|
2875
2875
|
W2.exports = jr;
|
|
2876
2876
|
}, { 3: 3 }] }, {}, [4])(4);
|
|
2877
2877
|
});
|
|
2878
2878
|
});
|
|
2879
|
-
er2 = Je2((me2,
|
|
2879
|
+
er2 = Je2((me2, ke2) => {
|
|
2880
2880
|
"use strict";
|
|
2881
2881
|
(function(_2, y3) {
|
|
2882
|
-
typeof me2 == "object" && typeof
|
|
2882
|
+
typeof me2 == "object" && typeof ke2 < "u" ? y3(me2) : typeof define == "function" && define.amd ? define("localforage-driver-memory", ["exports"], y3) : y3(_2.LocalforageDriverMemory = {});
|
|
2883
2883
|
})(typeof self < "u" ? self : me2, function(_2) {
|
|
2884
2884
|
"use strict";
|
|
2885
2885
|
var y3 = "localforage-driver-memory";
|
|
@@ -2889,7 +2889,7 @@ var init_es4 = __esm({
|
|
|
2889
2889
|
return a && v2 >= a.length && (a = void 0), { value: a && a[v2++], done: !a };
|
|
2890
2890
|
} };
|
|
2891
2891
|
}
|
|
2892
|
-
function
|
|
2892
|
+
function C2(a, u2) {
|
|
2893
2893
|
a = a || [], u2 = u2 || {};
|
|
2894
2894
|
try {
|
|
2895
2895
|
return new Blob(a, u2);
|
|
@@ -2904,8 +2904,8 @@ var init_es4 = __esm({
|
|
|
2904
2904
|
var u2 = a.length * 0.75, v2 = a.length;
|
|
2905
2905
|
a[a.length - 1] === "=" && (u2--, a[a.length - 2] === "=" && u2--);
|
|
2906
2906
|
for (var g2 = new ArrayBuffer(u2), b3 = new Uint8Array(g2), I2 = 0, R3 = 0; I2 < v2; I2 += 4) {
|
|
2907
|
-
var G2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(a[I2]),
|
|
2908
|
-
b3[R3++] = G2 << 2 |
|
|
2907
|
+
var G2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(a[I2]), fe2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(a[I2 + 1]), ie2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(a[I2 + 2]), ue = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(a[I2 + 3]);
|
|
2908
|
+
b3[R3++] = G2 << 2 | fe2 >> 4, b3[R3++] = (fe2 & 15) << 4 | ie2 >> 2, b3[R3++] = (ie2 & 3) << 6 | ue & 63;
|
|
2909
2909
|
}
|
|
2910
2910
|
return g2;
|
|
2911
2911
|
}
|
|
@@ -2942,7 +2942,7 @@ var init_es4 = __esm({
|
|
|
2942
2942
|
case "arbf":
|
|
2943
2943
|
return I2;
|
|
2944
2944
|
case "blob":
|
|
2945
|
-
return
|
|
2945
|
+
return C2([I2], { type: g2 });
|
|
2946
2946
|
case "si08":
|
|
2947
2947
|
return new Int8Array(I2);
|
|
2948
2948
|
case "ui08":
|
|
@@ -3013,7 +3013,7 @@ var init_es4 = __esm({
|
|
|
3013
3013
|
function P2(a) {
|
|
3014
3014
|
return typeof a != "string" && (console.warn(a + " used as a key, but it is not a string."), a = String(a)), a;
|
|
3015
3015
|
}
|
|
3016
|
-
var k2 = { bufferToString: z3, deserialize: J3, serialize: K2, stringToBuffer: D2 }, M2 = {}, ae2 = function() {
|
|
3016
|
+
var k2 = { bufferToString: z3, deserialize: J3, serialize: K2, stringToBuffer: D2 }, M2 = {}, ae2 = (function() {
|
|
3017
3017
|
function a(u2) {
|
|
3018
3018
|
this.kp = u2, this.data = {};
|
|
3019
3019
|
}
|
|
@@ -3034,7 +3034,7 @@ var init_es4 = __esm({
|
|
|
3034
3034
|
}, a.prototype.set = function(u2, v2) {
|
|
3035
3035
|
this.data[u2] = v2;
|
|
3036
3036
|
}, a;
|
|
3037
|
-
}();
|
|
3037
|
+
})();
|
|
3038
3038
|
function re2(a) {
|
|
3039
3039
|
var u2 = a ? m3(a) : {}, v2 = w2(u2, this._defaultConfig), g2 = ae2.resolve(v2);
|
|
3040
3040
|
return this._dbInfo = u2, this._dbInfo.serializer = k2, this._dbInfo.keyPrefix = v2, this._dbInfo.mStore = g2, Promise.resolve();
|
|
@@ -3060,7 +3060,7 @@ var init_es4 = __esm({
|
|
|
3060
3060
|
});
|
|
3061
3061
|
return T3(g2, u2), g2;
|
|
3062
3062
|
}
|
|
3063
|
-
function
|
|
3063
|
+
function N3(a, u2) {
|
|
3064
3064
|
var v2 = this, g2 = this.ready().then(function() {
|
|
3065
3065
|
for (var b3 = v2._dbInfo.mStore, I2 = b3.keys(), R3 = 0; R3 < I2.length; R3++) {
|
|
3066
3066
|
var G2 = b3.get(I2[R3]);
|
|
@@ -3108,36 +3108,36 @@ var init_es4 = __esm({
|
|
|
3108
3108
|
u2 === void 0 && (u2 = null);
|
|
3109
3109
|
var I2 = u2;
|
|
3110
3110
|
return new Promise(function(R3, G2) {
|
|
3111
|
-
g2._dbInfo.serializer.serialize(u2, function(
|
|
3111
|
+
g2._dbInfo.serializer.serialize(u2, function(fe2, ie2) {
|
|
3112
3112
|
if (ie2) G2(ie2);
|
|
3113
3113
|
else try {
|
|
3114
|
-
g2._dbInfo.mStore.set(a,
|
|
3115
|
-
} catch (
|
|
3116
|
-
G2(
|
|
3114
|
+
g2._dbInfo.mStore.set(a, fe2), R3(I2);
|
|
3115
|
+
} catch (ue) {
|
|
3116
|
+
G2(ue);
|
|
3117
3117
|
}
|
|
3118
3118
|
});
|
|
3119
3119
|
});
|
|
3120
3120
|
});
|
|
3121
3121
|
return T3(b3, v2), b3;
|
|
3122
3122
|
}
|
|
3123
|
-
var
|
|
3124
|
-
_2._support =
|
|
3123
|
+
var oe2 = true;
|
|
3124
|
+
_2._support = oe2, _2._driver = y3, _2._initStorage = re2, _2.clear = h3, _2.dropInstance = A3, _2.getItem = E3, _2.iterate = N3, _2.key = H3, _2.keys = j2, _2.length = X3, _2.removeItem = Q3, _2.setItem = ee2, Object.defineProperty(_2, "__esModule", { value: true });
|
|
3125
3125
|
});
|
|
3126
3126
|
});
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
at2 = { display: "
|
|
3130
|
-
|
|
3127
|
+
pe2 = $e2(qe2());
|
|
3128
|
+
Te2 = $e2(er2());
|
|
3129
|
+
at2 = { display: "none", position: "fixed", top: "0", right: "0", width: "100%", height: "100%", borderRadius: "0", border: "none", opacity: "0", zIndex: "-1" };
|
|
3130
|
+
ye2 = class extends je {
|
|
3131
3131
|
activeElement = null;
|
|
3132
3132
|
iframe;
|
|
3133
|
-
relayerSrc =
|
|
3133
|
+
relayerSrc = Je(`/send?params=${encodeURIComponent(this.parameters)}`, this.endpoint).href;
|
|
3134
3134
|
init() {
|
|
3135
3135
|
this.test = "hello", this.iframe = new Promise((y3) => {
|
|
3136
3136
|
let O3 = () => {
|
|
3137
3137
|
if (st2(encodeURIComponent(this.parameters))) Bn().log();
|
|
3138
3138
|
else {
|
|
3139
|
-
let
|
|
3140
|
-
|
|
3139
|
+
let C2 = document.createElement("iframe");
|
|
3140
|
+
C2.classList.add("magic-iframe"), C2.dataset.magicIframeLabel = Je(this.endpoint).host, C2.title = "Secure Modal", C2.src = this.relayerSrc, C2.allow = "clipboard-read; clipboard-write", ft2(C2), document.body.appendChild(C2), y3(C2);
|
|
3141
3141
|
}
|
|
3142
3142
|
};
|
|
3143
3143
|
["loaded", "interactive", "complete"].includes(document.readyState) ? O3() : window.addEventListener("load", O3, false);
|
|
@@ -3156,11 +3156,11 @@ var init_es4 = __esm({
|
|
|
3156
3156
|
}
|
|
3157
3157
|
async showOverlay() {
|
|
3158
3158
|
let y3 = await this.iframe;
|
|
3159
|
-
y3.style.
|
|
3159
|
+
y3.style.display = "block", y3.style.zIndex = "2147483647", y3.style.opacity = "1", this.activeElement = document.activeElement, y3.focus();
|
|
3160
3160
|
}
|
|
3161
3161
|
async hideOverlay() {
|
|
3162
3162
|
let y3 = await this.iframe;
|
|
3163
|
-
y3.style.
|
|
3163
|
+
y3.style.display = "none", y3.style.zIndex = "-1", y3.style.opacity = "0", this.activeElement?.focus && this.activeElement.focus(), this.activeElement = null;
|
|
3164
3164
|
}
|
|
3165
3165
|
async _post(y3) {
|
|
3166
3166
|
let O3 = await this.iframe;
|
|
@@ -3169,7 +3169,7 @@ var init_es4 = __esm({
|
|
|
3169
3169
|
}
|
|
3170
3170
|
async checkRelayerExistsInDOM() {
|
|
3171
3171
|
let y3 = await this.iframe;
|
|
3172
|
-
return !y3 || !y3.contentWindow ? false : !![].slice.call(document.querySelectorAll(".magic-iframe")).find((
|
|
3172
|
+
return !y3 || !y3.contentWindow ? false : !![].slice.call(document.querySelectorAll(".magic-iframe")).find((C2) => C2.src.includes(encodeURIComponent(this.parameters)));
|
|
3173
3173
|
}
|
|
3174
3174
|
async reloadRelayer() {
|
|
3175
3175
|
let y3 = await this.iframe;
|
|
@@ -3184,28 +3184,28 @@ var init_es4 = __esm({
|
|
|
3184
3184
|
y3 && (y3.src = this.relayerSrc);
|
|
3185
3185
|
}
|
|
3186
3186
|
};
|
|
3187
|
-
wt2 = Hr(
|
|
3188
|
-
let _2 =
|
|
3189
|
-
return await _2.defineDriver(
|
|
3187
|
+
wt2 = Hr(Ke, { platform: "web", sdkName: "magic-sdk", version: "29.4.2", defaultEndpoint: "https://auth.magic.link/", ViewController: ye2, configureStorage: async () => {
|
|
3188
|
+
let _2 = pe2.default.createInstance({ name: "MagicAuthLocalStorageDB", storeName: "MagicAuthLocalStorage" });
|
|
3189
|
+
return await _2.defineDriver(Te2), await _2.setDriver([pe2.default.INDEXEDDB, pe2.default.LOCALSTORAGE, Te2._driver]), _2;
|
|
3190
3190
|
} });
|
|
3191
3191
|
}
|
|
3192
3192
|
});
|
|
3193
3193
|
|
|
3194
|
-
// ../../node_modules/.pnpm/@magic-ext+algorand@24.
|
|
3194
|
+
// ../../node_modules/.pnpm/@magic-ext+algorand@24.4.2/node_modules/@magic-ext/algorand/dist/es/index.mjs
|
|
3195
3195
|
var es_exports2 = {};
|
|
3196
3196
|
__export(es_exports2, {
|
|
3197
3197
|
AlgorandExtension: () => r9
|
|
3198
3198
|
});
|
|
3199
3199
|
var r9;
|
|
3200
3200
|
var init_es5 = __esm({
|
|
3201
|
-
"../../node_modules/.pnpm/@magic-ext+algorand@24.
|
|
3201
|
+
"../../node_modules/.pnpm/@magic-ext+algorand@24.4.2/node_modules/@magic-ext/algorand/dist/es/index.mjs"() {
|
|
3202
3202
|
"use strict";
|
|
3203
3203
|
init_es3();
|
|
3204
|
-
r9 = class extends
|
|
3204
|
+
r9 = class extends He.Internal {
|
|
3205
3205
|
constructor(n) {
|
|
3206
3206
|
super();
|
|
3207
3207
|
this.algorandConfig = n;
|
|
3208
|
-
this.config = { rpcUrl: n.rpcUrl, chainType: "
|
|
3208
|
+
this.config = { rpcUrl: n.rpcUrl, chainType: "ALGOD" };
|
|
3209
3209
|
}
|
|
3210
3210
|
name = "algod";
|
|
3211
3211
|
config = {};
|
|
@@ -3245,7 +3245,6 @@ __export(index_exports, {
|
|
|
3245
3245
|
KibisisWallet: () => KibisisWallet,
|
|
3246
3246
|
KmdWallet: () => KmdWallet,
|
|
3247
3247
|
LOCAL_STORAGE_MNEMONIC_KEY: () => LOCAL_STORAGE_MNEMONIC_KEY,
|
|
3248
|
-
LiquidWallet: () => LiquidWallet,
|
|
3249
3248
|
LogLevel: () => LogLevel,
|
|
3250
3249
|
LuteWallet: () => LuteWallet,
|
|
3251
3250
|
MagicAuth: () => MagicAuth,
|
|
@@ -3336,7 +3335,7 @@ var Logger = class _Logger {
|
|
|
3336
3335
|
var logger = Logger.getInstance();
|
|
3337
3336
|
|
|
3338
3337
|
// src/manager.ts
|
|
3339
|
-
var
|
|
3338
|
+
var import_store13 = require("@tanstack/store");
|
|
3340
3339
|
var import_algosdk13 = __toESM(require("algosdk"), 1);
|
|
3341
3340
|
|
|
3342
3341
|
// src/network.ts
|
|
@@ -3539,7 +3538,6 @@ var WalletId = /* @__PURE__ */ ((WalletId2) => {
|
|
|
3539
3538
|
WalletId2["EXODUS"] = "exodus";
|
|
3540
3539
|
WalletId2["KIBISIS"] = "kibisis";
|
|
3541
3540
|
WalletId2["KMD"] = "kmd";
|
|
3542
|
-
WalletId2["LIQUID"] = "liquid";
|
|
3543
3541
|
WalletId2["LUTE"] = "lute";
|
|
3544
3542
|
WalletId2["MAGIC"] = "magic";
|
|
3545
3543
|
WalletId2["MNEMONIC"] = "mnemonic";
|
|
@@ -5523,119 +5521,6 @@ var KmdWallet = class extends BaseWallet {
|
|
|
5523
5521
|
}
|
|
5524
5522
|
};
|
|
5525
5523
|
|
|
5526
|
-
// src/wallets/liquid.ts
|
|
5527
|
-
var ICON9 = `data:image/svg+xml;base64,${btoa(`
|
|
5528
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="249" height="249" viewBox="0 0 249 249" xml:space="preserve">
|
|
5529
|
-
<g transform="matrix(2.52 0 0 2.52 124.74 124.74)">
|
|
5530
|
-
<circle style="stroke: rgb(0,0,0); stroke-width: 19; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(0,0,0); fill-rule: nonzero; opacity: 1;" cx="0" cy="0" r="40"/>
|
|
5531
|
-
</g>
|
|
5532
|
-
<g transform="matrix(-1.16 -0.01 0.01 -0.97 125.63 187.7)">
|
|
5533
|
-
<path style="stroke: rgb(0,0,0); stroke-width: 0; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(170,0,255); fill-rule: nonzero; opacity: 1;" transform=" translate(-57.95, -28.98)" d="m 0 57.952755 l 0 0 c 0 -32.006424 25.946333 -57.952755 57.952755 -57.952755 c 32.006428 0 57.952755 25.946333 57.952755 57.952755 l -28.97638 0 c 0 -16.003212 -12.97316 -28.976377 -28.976376 -28.976377 c -16.003212 0 -28.976377 12.9731655 -28.976377 28.976377 z" stroke-linecap="round"/>
|
|
5534
|
-
</g>
|
|
5535
|
-
<g transform="matrix(1.16 0 0 2.21 126.06 96.74)">
|
|
5536
|
-
<path style="stroke: rgb(255,4,233); stroke-width: 0; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(170,0,255); fill-rule: nonzero; opacity: 1;" transform=" translate(-57.95, -28.98)" d="m 0 57.952755 l 0 0 c 0 -32.006424 25.946333 -57.952755 57.952755 -57.952755 c 32.006428 0 57.952755 25.946333 57.952755 57.952755 l -28.97638 0 c 0 -16.003212 -12.97316 -28.976377 -28.976376 -28.976377 c -16.003212 0 -28.976377 12.9731655 -28.976377 28.976377 z" stroke-linecap="round"/>
|
|
5537
|
-
</g>
|
|
5538
|
-
</svg>
|
|
5539
|
-
`)}`;
|
|
5540
|
-
var LiquidWallet = class extends BaseWallet {
|
|
5541
|
-
store;
|
|
5542
|
-
authClient;
|
|
5543
|
-
options;
|
|
5544
|
-
constructor({
|
|
5545
|
-
id,
|
|
5546
|
-
store,
|
|
5547
|
-
subscribe,
|
|
5548
|
-
getAlgodClient,
|
|
5549
|
-
options,
|
|
5550
|
-
metadata = {}
|
|
5551
|
-
}) {
|
|
5552
|
-
super({ id, metadata, getAlgodClient, store, subscribe });
|
|
5553
|
-
this.store = store;
|
|
5554
|
-
this.options = options ?? {
|
|
5555
|
-
RTC_config_username: "username",
|
|
5556
|
-
RTC_config_credential: "credential"
|
|
5557
|
-
};
|
|
5558
|
-
}
|
|
5559
|
-
static defaultMetadata = {
|
|
5560
|
-
name: "Liquid",
|
|
5561
|
-
icon: ICON9
|
|
5562
|
-
};
|
|
5563
|
-
async initializeClient() {
|
|
5564
|
-
this.logger.info("Initializing client...");
|
|
5565
|
-
const { LiquidAuthClient } = await import("@algorandfoundation/liquid-auth-use-wallet-client");
|
|
5566
|
-
const client = new LiquidAuthClient(this.options);
|
|
5567
|
-
this.authClient = client;
|
|
5568
|
-
this.logger.info("Client initialized");
|
|
5569
|
-
return client;
|
|
5570
|
-
}
|
|
5571
|
-
connect = async (_args) => {
|
|
5572
|
-
this.logger.info("Connecting...");
|
|
5573
|
-
const authClient = this.authClient || await this.initializeClient();
|
|
5574
|
-
const account = await authClient.connect();
|
|
5575
|
-
if (!account || account.length === 0) {
|
|
5576
|
-
this.logger.error("No accounts found!");
|
|
5577
|
-
throw new Error("No accounts found!");
|
|
5578
|
-
}
|
|
5579
|
-
const walletAccounts = [
|
|
5580
|
-
{
|
|
5581
|
-
name: `${this.metadata.name} Account 1`,
|
|
5582
|
-
address: account.toString()
|
|
5583
|
-
}
|
|
5584
|
-
];
|
|
5585
|
-
const walletState = {
|
|
5586
|
-
accounts: walletAccounts,
|
|
5587
|
-
activeAccount: walletAccounts[0]
|
|
5588
|
-
};
|
|
5589
|
-
addWallet(this.store, {
|
|
5590
|
-
walletId: this.id,
|
|
5591
|
-
wallet: walletState
|
|
5592
|
-
});
|
|
5593
|
-
this.logger.info("Connected successfully", walletState);
|
|
5594
|
-
authClient.hideModal();
|
|
5595
|
-
return Promise.resolve(walletAccounts);
|
|
5596
|
-
};
|
|
5597
|
-
disconnect = async () => {
|
|
5598
|
-
this.logger.info("Disconnecting...");
|
|
5599
|
-
if (!this.authClient) {
|
|
5600
|
-
throw new Error("No auth client to disconnect");
|
|
5601
|
-
}
|
|
5602
|
-
await this.authClient.disconnect();
|
|
5603
|
-
this.onDisconnect();
|
|
5604
|
-
this.logger.info("Disconnected.");
|
|
5605
|
-
this.authClient = null;
|
|
5606
|
-
};
|
|
5607
|
-
resumeSession = async () => {
|
|
5608
|
-
try {
|
|
5609
|
-
const state = this.store.state;
|
|
5610
|
-
const walletState = state.wallets[this.id];
|
|
5611
|
-
if (walletState) {
|
|
5612
|
-
await this.disconnect();
|
|
5613
|
-
}
|
|
5614
|
-
} catch (error) {
|
|
5615
|
-
this.logger.error("Error resuming session", error);
|
|
5616
|
-
this.onDisconnect();
|
|
5617
|
-
throw error;
|
|
5618
|
-
}
|
|
5619
|
-
};
|
|
5620
|
-
signTransactions = async (txnGroup, indexesToSign) => {
|
|
5621
|
-
try {
|
|
5622
|
-
if (!this.activeAddress) {
|
|
5623
|
-
throw new Error("No active account");
|
|
5624
|
-
}
|
|
5625
|
-
this.logger.debug("Signing transactions...", { txnGroup, indexesToSign });
|
|
5626
|
-
const authClient = this.authClient || await this.initializeClient();
|
|
5627
|
-
if (!authClient.client.peerClient) {
|
|
5628
|
-
await authClient.connect();
|
|
5629
|
-
authClient.hideModal();
|
|
5630
|
-
}
|
|
5631
|
-
return authClient.signTransactions(txnGroup, this.activeAddress, indexesToSign);
|
|
5632
|
-
} catch (error) {
|
|
5633
|
-
this.logger.error("Error signing transactions", error);
|
|
5634
|
-
throw error;
|
|
5635
|
-
}
|
|
5636
|
-
};
|
|
5637
|
-
};
|
|
5638
|
-
|
|
5639
5524
|
// src/wallets/lute.ts
|
|
5640
5525
|
var import_algosdk7 = __toESM(require("algosdk"), 1);
|
|
5641
5526
|
function isSignTxnsError(error) {
|
|
@@ -5644,7 +5529,7 @@ function isSignTxnsError(error) {
|
|
|
5644
5529
|
function isSignDataError(error) {
|
|
5645
5530
|
return error instanceof Error && "code" in error;
|
|
5646
5531
|
}
|
|
5647
|
-
var
|
|
5532
|
+
var ICON9 = `data:image/svg+xml;base64,${btoa(`
|
|
5648
5533
|
<svg viewBox="0 0 400 400" xmlns="http://www.w3.org/2000/svg">
|
|
5649
5534
|
<path fill="#AB47BC" d="M283.7,263.6c-0.6,0-1.3-0.1-1.8-0.4c-0.6-0.3-1.1-0.8-1.5-1.3c-0.4-0.6-0.7-1.3-0.8-2 c-0.1-0.8-0.1-1.7,0.1-2.5c0.2-0.9,0.6-1.8,1.2-2.6c0.6-0.8,1.4-1.7,2.2-2.3c0.9-0.7,2.1-1.2,3.2-1.6c1.2-0.4,2.7-0.5,4-0.5 c1.4,0,3,0.3,4.4,0.8c1.5,0.5,3.1,1.4,4.3,2.3c1.4,1,2.8,2.4,3.8,3.7c1.1,1.5,2.1,3.3,2.8,5.1c0.7,1.9,1.2,4.1,1.3,6.1 c0.2,2.1,0,4.6-0.4,6.7c-0.5,2.2-1.4,4.7-2.4,6.7c-1.1,2.1-2.8,4.4-4.4,6.2c-1.8,1.9-4.1,3.7-6.3,5c-2.3,1.4-5.2,2.6-7.9,3.3 c-2.8,0.7-6.1,1.1-8.9,1.1c-3,0-6.5-0.6-9.3-1.4c-3-0.9-6.4-2.4-9.1-4c-2.8-1.7-5.8-4.2-8-6.6c-2.3-2.5-4.6-5.8-6.2-8.9 c-1.7-3.2-3.1-7.1-3.8-10.7c-0.8-3.7-1.1-8-0.9-11.8c0.2-3.9,1.1-8.3,2.3-12c1.3-3.8,3.4-8.1,5.7-11.4c2.3-3.5,5.6-7.1,8.8-9.9 c3.3-2.8,7.5-5.6,11.5-7.5c4.1-1.9,9-3.5,13.5-4.3c4.6-0.8,10-1.1,14.6-0.7c4.8,0.4,10.2,1.6,14.7,3.3c4.7,1.7,9.7,4.4,13.8,7.3 c4.2,3,8.5,7,11.7,10.9c3.3,4.1,6.5,9.2,8.7,14c2.2,4.9,4,10.9,4.9,16.3c0.9,5.5,1,11.9,0.4,17.5c-0.6,5.7-2.2,12.1-4.3,17.4 c-2.1,5.5-5.4,11.4-8.9,16.1c-3.6,4.8-8.4,9.8-13.1,13.6c-4.8,3.8-11,7.5-16.6,9.9c-5.8,2.5-12.8,4.5-19.1,5.4 c-6.4,0.9-13.9,1-20.3,0.2c-6.6-0.8-14-2.7-20.1-5.2c-6.3-2.5-13.1-6.4-18.5-10.5c-5.5-4.2-11.2-9.8-15.4-15.3 c-4.3-5.6-8.4-12.7-11.2-19.2c-2.8-6.7-4.9-14.7-5.9-21.9c-0.9-5.9-2.8-12.6-5.2-18.1c-2.3-5.4-5.9-11.2-9.5-15.8 c-3.6-4.5-8.3-9-13-12.4c-4.5-3.3-10.1-6.4-15.3-8.3c-5-1.9-11.1-3.4-16.5-3.9c-5.2-0.5-11.3-0.3-16.5,0.5c-5,0.8-10.7,2.6-15.3,4.7 c-4.5,2.1-9.4,5.1-13.2,8.3c-3.7,3.1-7.5,7.2-10.2,11.1c-2.7,3.8-5.2,8.6-6.7,13c-1.5,4.2-2.6,9.3-3,13.8c-0.3,4.3-0.1,9.4,0.7,13.7 c0.8,4.1,2.3,8.8,4.2,12.5c1.8,3.6,4.4,7.6,7.1,10.6c2.6,2.9,6,5.9,9.3,8.1c3.1,2.1,7.1,4,10.6,5.1c3.4,1.1,7.5,1.9,11.1,2 c3.5,0.2,7.4-0.2,10.8-1c3.2-0.7,6.8-2.1,9.7-3.6c2.8-1.5,5.7-3.6,8-5.8c2.2-2.1,4.3-4.8,5.9-7.4c1.5-2.5,2.8-5.5,3.5-8.3 c0.7-2.6,1.1-5.7,1.1-8.5c0-2.6-0.5-5.5-1.2-8c-0.7-2.3-1.8-4.9-3.1-6.9c-1.2-1.9-2.9-3.9-4.6-5.4c-1.6-1.4-3.6-2.8-5.5-3.7 c-1.8-0.9-4-1.6-5.9-1.9c-1.8-0.3-3.9-0.4-5.8-0.1c-1.7,0.2-3.6,0.7-5.1,1.4c-1.4,0.6-2.9,1.6-4.1,2.6c-1.1,0.9-2.1,2.2-2.9,3.4 c-0.7,1.1-1.2,2.5-1.5,3.7c-0.3,1.1-0.4,2.4-0.3,3.6c0.1,1,0.4,2.2,0.8,3.1c0.4,0.8,1,1.7,1.6,2.3c0.6,0.5,1.3,1,2.1,1.3 c0.6,0.2,1.5,0.4,2.1,0.3c0.6-0.1,1.3-0.3,1.8-0.6c0.5-0.3,1-0.8,1.2-1.4c0.3-0.5,0.7-1,1.2-1.4c0.5-0.3,1.2-0.6,1.8-0.6 c0.7-0.1,1.5,0.1,2.1,0.3c0.7,0.3,1.5,0.8,2.1,1.3c0.6,0.6,1.3,1.5,1.6,2.3c0.4,0.9,0.7,2.1,0.8,3.1c0.1,1.1,0,2.5-0.3,3.6 c-0.3,1.2-0.9,2.6-1.5,3.7c-0.7,1.2-1.8,2.4-2.9,3.4c-1.2,1-2.7,2-4.1,2.6c-1.5,0.7-3.4,1.2-5.1,1.4c-1.8,0.2-4,0.2-5.8-0.1 c-2-0.3-4.1-1-5.9-1.9c-1.9-0.9-4-2.3-5.5-3.7c-1.7-1.5-3.4-3.5-4.6-5.4c-1.3-2-2.4-4.6-3.1-6.9c-0.7-2.5-1.2-5.4-1.2-8 c0-2.7,0.4-5.8,1.1-8.5c0.7-2.8,2-5.8,3.5-8.3c1.5-2.6,3.7-5.3,5.9-7.4c2.3-2.2,5.2-4.3,8-5.8c2.9-1.6,6.5-2.9,9.7-3.6 c3.4-0.8,7.4-1.1,10.8-1c3.6,0.2,7.7,0.9,11.1,2c3.6,1.2,7.5,3.1,10.6,5.1c3.3,2.1,6.7,5.1,9.3,8.1c2.7,3,5.3,7,7.1,10.6 c1.8,3.8,3.4,8.4,4.2,12.5c0.8,4.3,1.1,9.3,0.7,13.7c-0.4,4.5-1.5,9.6-3,13.8c-1.6,4.4-4.1,9.2-6.7,13c-2.8,3.9-6.5,8-10.2,11.1 c-3.8,3.2-8.7,6.2-13.2,8.3c-4.6,2.1-10.3,3.8-15.3,4.7c-5.2,0.9-11.3,1-16.5,0.5c-5.4-0.5-11.5-2-16.5-3.9 c-5.2-2-10.8-5.1-15.3-8.3c-4.6-3.4-9.4-7.9-13-12.4c-3.7-4.6-7.2-10.4-9.5-15.8c-2.4-5.5-4.3-12.2-5.2-18.1 c-0.9-6.1-1-13.2-0.3-19.3c0.7-6.3,2.5-13.4,4.9-19.2c2.4-6,6.1-12.5,10-17.7c4-5.3,9.3-10.7,14.6-14.8c5.3-4.2,12.1-8.1,18.3-10.7 c6.4-2.7,14.1-4.8,21-5.7c7-1,15.2-1,22.2-0.1c7.2,0.9,15.2,3.1,21.9,5.8c5.6,2.2,12.3,3.9,18.3,4.6c5.8,0.7,12.6,0.5,18.4-0.4 c5.6-0.9,12-2.7,17.2-5c5.1-2.3,10.6-5.6,14.9-9.1c4.2-3.4,8.5-8,11.7-12.3c3.1-4.3,6-9.6,7.8-14.5c1.8-4.8,3.1-10.5,3.6-15.6 c0.5-4.9,0.3-10.7-0.6-15.6c-0.8-4.7-2.5-10.1-4.5-14.4c-2-4.2-4.9-8.8-7.9-12.3c-2.9-3.4-6.8-6.9-10.5-9.5 c-3.6-2.5-8.1-4.8-12.2-6.2c-4-1.4-8.7-2.4-12.9-2.7c-4-0.3-8.7,0-12.7,0.8c-3.8,0.8-8.1,2.2-11.6,4c-3.4,1.7-7,4.1-9.7,6.6 c-2.7,2.4-5.4,5.6-7.3,8.6c-1.9,2.9-3.6,6.5-4.6,9.8c-1,3.2-1.6,6.9-1.7,10.2c-0.1,3.2,0.3,6.8,1,9.9c0.7,2.9,2,6.2,3.5,8.8 c1.4,2.5,3.4,5.1,5.4,7.2c1.9,1.9,4.4,3.8,6.8,5.2c2.2,1.3,5,2.4,7.5,3c2.3,0.6,5.1,0.9,7.6,0.8c2.3-0.1,4.9-0.5,7-1.3 c2-0.7,4.2-1.7,6-2.9c1.6-1.1,3.3-2.7,4.6-4.2c1.2-1.4,2.3-3.2,3-4.9c0.7-1.6,1.2-3.5,1.3-5.1c0.2-1.5,0.1-3.3-0.2-4.9 c-0.3-1.4-0.8-2.9-1.5-4.2c-0.6-1.1-1.5-2.3-2.4-3.2c-0.8-0.8-1.9-1.5-3-2c-0.9-0.4-2.1-0.7-3.1-0.8c-0.9-0.1-1.9,0-2.8,0.3 c-0.7,0.2-1.6,0.6-2.2,1.1c-0.5,0.4-1,1.1-1.3,1.7c-0.3,0.6-0.4,1.3-0.4,1.9c0,0.6,0.2,1.2,0.6,1.7c0.3,0.5,0.5,1.2,0.6,1.7 c0,0.6-0.1,1.3-0.4,1.9c-0.3,0.6-0.8,1.3-1.3,1.7c-0.6,0.5-1.4,0.9-2.2,1.1c-0.9,0.3-1.9,0.3-2.8,0.3c-1-0.1-2.2-0.4-3.1-0.8 c-1-0.5-2.1-1.2-3-2c-0.9-0.9-1.8-2.1-2.4-3.2c-0.7-1.2-1.2-2.8-1.5-4.2c-0.3-1.5-0.4-3.3-0.2-4.9c0.2-1.7,0.7-3.6,1.3-5.1 c0.7-1.7,1.8-3.5,3-4.9c1.3-1.5,3-3.1,4.6-4.2c1.8-1.2,4-2.3,6-2.9c2.2-0.7,4.8-1.2,7-1.3c2.4-0.1,5.2,0.2,7.6,0.8 c2.5,0.6,5.3,1.7,7.5,3c2.4,1.3,4.9,3.2,6.8,5.2c2,2,4,4.7,5.4,7.2c1.5,2.6,2.7,5.9,3.5,8.8c0.8,3.1,1.1,6.7,1,9.9 c-0.1,3.3-0.7,7.1-1.7,10.2c-1,3.3-2.7,6.9-4.6,9.8c-1.9,3-4.7,6.2-7.3,8.6c-2.8,2.5-6.4,5-9.7,6.6c-3.5,1.8-7.8,3.2-11.6,4 c-4,0.8-8.7,1.1-12.7,0.8c-4.2-0.3-9-1.3-12.9-2.7c-4.1-1.4-8.6-3.7-12.2-6.2c-3.7-2.6-7.6-6.1-10.5-9.5c-3-3.6-5.9-8.1-7.9-12.3 c-2-4.4-3.7-9.7-4.5-14.4c-0.8-4.9-1.1-10.6-0.6-15.6c0.5-5.1,1.8-10.8,3.6-15.6c1.8-4.9,4.7-10.3,7.8-14.5 c3.2-4.4,7.5-8.9,11.7-12.3c4.3-3.5,9.8-6.9,14.9-9.1c5.2-2.3,11.6-4.2,17.2-5c5.8-0.9,12.6-1,18.4-0.4c6,0.7,12.7,2.4,18.3,4.6 c5.7,2.3,12,5.7,16.9,9.4c5.1,3.8,10.3,8.9,14.2,13.8c4,5.1,7.8,11.5,10.3,17.5c2.6,6.1,4.6,13.5,5.5,20c0.9,6.7,1,14.5,0.1,21.2 c-0.9,6.9-2.9,14.6-5.5,21c-2.7,6.5-6.8,13.6-11,19.3c-4.4,5.7-10.3,11.7-16,16c-4.7,3.7-9.5,8.7-13.1,13.6 c-3.5,4.7-6.8,10.7-8.9,16.1c-2.1,5.3-3.6,11.7-4.3,17.4c-0.6,5.5-0.4,12,0.4,17.5c0.9,5.3,2.6,11.3,4.9,16.3c2.2,4.8,5.4,10,8.7,14 c3.2,3.9,7.6,8,11.7,10.9c4,2.9,9.1,5.6,13.8,7.3c4.5,1.7,9.9,2.9,14.7,3.3c4.6,0.4,10,0.2,14.6-0.7c4.4-0.8,9.4-2.4,13.5-4.3 c3.9-1.9,8.2-4.6,11.5-7.5c3.2-2.7,6.4-6.4,8.8-9.9c2.3-3.4,4.4-7.6,5.7-11.4c1.2-3.7,2.1-8.1,2.3-12c0.2-3.7-0.1-8.1-0.9-11.8 c-0.8-3.5-2.2-7.5-3.8-10.7c-1.6-3.1-3.9-6.3-6.2-8.9c-2.2-2.4-5.2-4.9-8-6.6c-2.7-1.7-6-3.2-9.1-4c-2.9-0.8-6.3-1.4-9.3-1.4 c-2.9,0-6.2,0.4-8.9,1.1c-2.6,0.7-5.5,1.9-7.9,3.3c-2.2,1.3-4.5,3.2-6.3,5c-1.7,1.8-3.3,4-4.4,6.2c-1.1,2-2,4.5-2.4,6.7 c-0.4,2.1-0.6,4.5-0.4,6.7c0.2,2,0.6,4.2,1.3,6.1c0.6,1.7,1.7,3.6,2.8,5.1c1,1.3,2.4,2.7,3.8,3.7c1.3,0.9,2.8,1.8,4.3,2.3 c1.3,0.5,2.9,0.8,4.4,0.8c1.3,0,2.7-0.1,4-0.5c1.1-0.3,2.3-0.9,3.2-1.6c0.8-0.6,1.7-1.4,2.2-2.3c0.5-0.7,0.9-1.7,1.2-2.6 c0.2-0.8,0.2-1.7,0.1-2.5c-0.1-0.7-0.4-1.4-0.8-2c-0.4-0.5-0.9-1-1.5-1.3C285,263.7,284.3,263.6,283.7,263.6L283.7,263.6z" />
|
|
5650
5535
|
</svg>
|
|
@@ -5667,7 +5552,7 @@ var LuteWallet = class extends BaseWallet {
|
|
|
5667
5552
|
}
|
|
5668
5553
|
static defaultMetadata = {
|
|
5669
5554
|
name: "Lute",
|
|
5670
|
-
icon:
|
|
5555
|
+
icon: ICON9
|
|
5671
5556
|
};
|
|
5672
5557
|
async initializeClient() {
|
|
5673
5558
|
this.logger.info("Initializing client...");
|
|
@@ -5815,7 +5700,7 @@ var LuteWallet = class extends BaseWallet {
|
|
|
5815
5700
|
|
|
5816
5701
|
// src/wallets/magic.ts
|
|
5817
5702
|
var import_algosdk8 = __toESM(require("algosdk"), 1);
|
|
5818
|
-
var
|
|
5703
|
+
var ICON10 = `data:image/svg+xml;base64,${btoa(`
|
|
5819
5704
|
<svg viewBox="0 0 47 47" xmlns="http://www.w3.org/2000/svg">
|
|
5820
5705
|
<path fill="#6851FF" d="M 23.960861 1.80769 C 25.835077 4.103153 27.902216 6.23489 30.137539 8.178169 C 28.647968 13.009323 27.846092 18.142094 27.846092 23.462154 C 27.846092 28.782307 28.648062 33.915169 30.13763 38.746368 C 27.902216 40.689724 25.835077 42.821476 23.960861 45.116985 C 22.086554 42.821476 20.019415 40.689632 17.783998 38.746368 C 19.273476 33.915169 20.075445 28.7824 20.075445 23.462337 C 20.075445 18.142277 19.273476 13.009506 17.783998 8.178318 C 20.019415 6.235001 22.086554 4.10321 23.960861 1.80769 Z M 13.511427 35.406403 C 11.145139 33.747814 8.633816 32.282063 6.000269 31.031937 C 6.730776 28.637476 7.123754 26.095783 7.123754 23.462429 C 7.123754 20.828892 6.730762 18.287201 6.000235 15.892738 C 8.633816 14.642616 11.145175 13.176861 13.511501 11.518276 C 14.416311 15.352554 14.895074 19.351414 14.895074 23.462154 C 14.895074 27.572985 14.416283 31.571938 13.511427 35.406403 Z M 33.027046 23.462337 C 33.027046 27.572985 33.505753 31.571846 34.410553 35.406124 C 36.776859 33.747631 39.288094 32.281876 41.921539 31.031845 C 41.191017 28.637384 40.798061 26.095692 40.798061 23.462246 C 40.798061 20.8288 41.191017 18.287201 41.921539 15.89283 C 39.288094 14.642708 36.776768 13.177048 34.410553 11.518555 C 33.505753 15.352831 33.027046 19.351692 33.027046 23.462337 Z" />
|
|
5821
5706
|
</svg>
|
|
@@ -5843,7 +5728,7 @@ var MagicAuth = class extends BaseWallet {
|
|
|
5843
5728
|
}
|
|
5844
5729
|
static defaultMetadata = {
|
|
5845
5730
|
name: "Magic",
|
|
5846
|
-
icon:
|
|
5731
|
+
icon: ICON10
|
|
5847
5732
|
};
|
|
5848
5733
|
async initializeClient() {
|
|
5849
5734
|
this.logger.info("Initializing client...");
|
|
@@ -6025,7 +5910,7 @@ var MagicAuth = class extends BaseWallet {
|
|
|
6025
5910
|
// src/wallets/mnemonic.ts
|
|
6026
5911
|
var import_algosdk9 = __toESM(require("algosdk"), 1);
|
|
6027
5912
|
var LOCAL_STORAGE_MNEMONIC_KEY = `${LOCAL_STORAGE_KEY}_mnemonic`;
|
|
6028
|
-
var
|
|
5913
|
+
var ICON11 = `data:image/svg+xml;base64,${btoa(`
|
|
6029
5914
|
<svg viewBox="0 0 400 400" xmlns="http://www.w3.org/2000/svg">
|
|
6030
5915
|
<rect fill="#525252" width="400" height="400" />
|
|
6031
5916
|
<path fill="#FFFFFF" d="M309.2,309.3H275l-22.2-82.7l-47.9,82.7h-38.3l73.9-128l-11.9-44.5l-99.6,172.6H90.8L217.1,90.6 h33.5l14.7,54.3h34.6l-23.6,41L309.2,309.3z" />
|
|
@@ -6058,7 +5943,7 @@ var MnemonicWallet = class extends BaseWallet {
|
|
|
6058
5943
|
}
|
|
6059
5944
|
static defaultMetadata = {
|
|
6060
5945
|
name: "Mnemonic",
|
|
6061
|
-
icon:
|
|
5946
|
+
icon: ICON11
|
|
6062
5947
|
};
|
|
6063
5948
|
loadMnemonicFromStorage() {
|
|
6064
5949
|
return StorageAdapter.getItem(LOCAL_STORAGE_MNEMONIC_KEY);
|
|
@@ -6201,7 +6086,7 @@ var MnemonicWallet = class extends BaseWallet {
|
|
|
6201
6086
|
|
|
6202
6087
|
// src/wallets/pera.ts
|
|
6203
6088
|
var import_algosdk10 = __toESM(require("algosdk"), 1);
|
|
6204
|
-
var
|
|
6089
|
+
var ICON12 = `data:image/svg+xml;base64,${btoa(`
|
|
6205
6090
|
<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
|
|
6206
6091
|
<rect fill="#FFEE55" width="200" height="200" />
|
|
6207
6092
|
<path fill="#1C1C1C" d="M106.1,64.3c2.2,9.1,1.5,17-1.7,17.8c-3.1,0.8-7.4-6-9.6-15c-2.2-9.1-1.5-17,1.7-17.8 C99.6,48.5,103.9,55.2,106.1,64.3z" />
|
|
@@ -6230,7 +6115,7 @@ var PeraWallet = class extends BaseWallet {
|
|
|
6230
6115
|
}
|
|
6231
6116
|
static defaultMetadata = {
|
|
6232
6117
|
name: "Pera",
|
|
6233
|
-
icon:
|
|
6118
|
+
icon: ICON12
|
|
6234
6119
|
};
|
|
6235
6120
|
async initializeClient() {
|
|
6236
6121
|
this.logger.info("Initializing client...");
|
|
@@ -6416,7 +6301,7 @@ var PeraWallet = class extends BaseWallet {
|
|
|
6416
6301
|
|
|
6417
6302
|
// src/wallets/w3wallet.ts
|
|
6418
6303
|
var import_algosdk11 = __toESM(require("algosdk"), 1);
|
|
6419
|
-
var
|
|
6304
|
+
var ICON13 = `data:image/svg+xml;base64,${btoa(`
|
|
6420
6305
|
<svg width="860" height="860" viewBox="0 0 860 860" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
6421
6306
|
<rect width="860" height="860" rx="30" fill="#151923"/>
|
|
6422
6307
|
<path d="M766 207L496.627 623.406C463.521 675.336 382.014 652.248 382.014 590.941V432.568L260.638 623.28C227.559 675.255 146 652.186 146 590.854V274.844H234.646V499.761L356.022 309.049C389.101 257.074 470.66 280.143 470.66 341.475V499.978L660.146 207L766 207Z" fill="#4BB7D1"/>
|
|
@@ -6437,7 +6322,7 @@ var W3Wallet = class extends BaseWallet {
|
|
|
6437
6322
|
}
|
|
6438
6323
|
static defaultMetadata = {
|
|
6439
6324
|
name: "W3 Wallet",
|
|
6440
|
-
icon:
|
|
6325
|
+
icon: ICON13
|
|
6441
6326
|
};
|
|
6442
6327
|
async initializeClient() {
|
|
6443
6328
|
this.logger.info("Initializing client...");
|
|
@@ -6565,7 +6450,6 @@ function createWalletMap() {
|
|
|
6565
6450
|
["exodus" /* EXODUS */]: ExodusWallet,
|
|
6566
6451
|
["kibisis" /* KIBISIS */]: KibisisWallet,
|
|
6567
6452
|
["kmd" /* KMD */]: KmdWallet,
|
|
6568
|
-
["liquid" /* LIQUID */]: LiquidWallet,
|
|
6569
6453
|
["lute" /* LUTE */]: LuteWallet,
|
|
6570
6454
|
["magic" /* MAGIC */]: MagicAuth,
|
|
6571
6455
|
["mnemonic" /* MNEMONIC */]: MnemonicWallet,
|
|
@@ -6688,7 +6572,7 @@ var WalletManager = class {
|
|
|
6688
6572
|
activeNetwork,
|
|
6689
6573
|
algodClient
|
|
6690
6574
|
};
|
|
6691
|
-
this.store = new
|
|
6575
|
+
this.store = new import_store13.Store(initialState, {
|
|
6692
6576
|
onUpdate: () => this.savePersistedState()
|
|
6693
6577
|
});
|
|
6694
6578
|
this.savePersistedState();
|
|
@@ -6998,7 +6882,6 @@ var WalletManager = class {
|
|
|
6998
6882
|
// src/webpack.ts
|
|
6999
6883
|
var webpackFallback = {
|
|
7000
6884
|
"@agoralabs-sh/avm-web-provider": false,
|
|
7001
|
-
"@algorandfoundation/liquid-auth-use-wallet-client": false,
|
|
7002
6885
|
"@blockshake/defly-connect": false,
|
|
7003
6886
|
"@magic-ext/algorand": false,
|
|
7004
6887
|
"@perawallet/connect": false,
|
|
@@ -7023,7 +6906,6 @@ var webpackFallback = {
|
|
|
7023
6906
|
KibisisWallet,
|
|
7024
6907
|
KmdWallet,
|
|
7025
6908
|
LOCAL_STORAGE_MNEMONIC_KEY,
|
|
7026
|
-
LiquidWallet,
|
|
7027
6909
|
LogLevel,
|
|
7028
6910
|
LuteWallet,
|
|
7029
6911
|
MagicAuth,
|