"use strict"; var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __esm = (fn2, res) => function __init() { return fn2 && (res = (0, fn2[__getOwnPropNames(fn2)[0]])(fn2 = 0)), res; }; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // ../../node_modules/.pnpm/@magic-sdk+types@24.8.0/node_modules/@magic-sdk/types/dist/es/index.mjs var p, m, d, _, u, v, f, g, E, x, A, I, y, R, N, T, h, O, b, S, k, F, L, w, U, D, V, C, G, H, q, W, J, Y; var init_es = __esm({ "../../node_modules/.pnpm/@magic-sdk+types@24.8.0/node_modules/@magic-sdk/types/dist/es/index.mjs"() { "use strict"; p = ((a2) => (a2.MissingApiKey = "MISSING_API_KEY", a2.ModalNotReady = "MODAL_NOT_READY", a2.MalformedResponse = "MALFORMED_RESPONSE", a2.InvalidArgument = "INVALID_ARGUMENT", a2.ExtensionNotInitialized = "EXTENSION_NOT_INITIALIZED", a2.IncompatibleExtensions = "INCOMPATIBLE_EXTENSIONS", a2))(p || {}); m = ((o) => (o.SyncWeb3Method = "SYNC_WEB3_METHOD", o.DuplicateIframe = "DUPLICATE_IFRAME", o.ReactNativeEndpointConfiguration = "REACT_NATIVE_ENDPOINT_CONFIGURATION", o.DeprecationNotice = "DEPRECATION_NOTICE", o.ProductAnnouncement = "ANNOUNCEMENT", o))(m || {}); d = ((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))(d || {}); _ = ((s) => (s.MetaMask = "metamask", s.CoinbaseWallet = "coinbase_wallet", s))(_ || {}); u = ((t) => (t.WalletSelected = "wallet_selected", t.WalletConnected = "wallet_connected", t.WalletRejected = "wallet_rejected", t))(u || {}); v = ((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))(v || {}); f = ((l) => (l.MAGIC_HANDLE_RESPONSE = "MAGIC_HANDLE_RESPONSE", l.MAGIC_OVERLAY_READY = "MAGIC_OVERLAY_READY", l.MAGIC_SHOW_OVERLAY = "MAGIC_SHOW_OVERLAY", l.MAGIC_HIDE_OVERLAY = "MAGIC_HIDE_OVERLAY", l.MAGIC_HANDLE_EVENT = "MAGIC_HANDLE_EVENT", l.MAGIC_MG_BOX_SEND_RECEIPT = "MAGIC_MG_BOX_SEND_RECEIPT", l.MAGIC_SEND_PRODUCT_ANNOUNCEMENT = "MAGIC_SEND_PRODUCT_ANNOUNCEMENT", l))(f || {}); g = ((n) => (n.MAGIC_HANDLE_REQUEST = "MAGIC_HANDLE_REQUEST", n))(g || {}); E = ((t) => (t.UpdateEmail = "update-email", t.MFA = "mfa", t.Recovery = "recovery", t))(E || {}); x = ((n) => (n.Retry = "retry", n))(x || {}); A = ((s) => (s.EmailSent = "email-sent", s.EmailNotDeliverable = "email-not-deliverable", s))(A || {}); I = ((t) => (t.VerifyEmailOtp = "verify-email-otp", t.VerifyMFACode = "verify-mfa-code", t.Cancel = "cancel", t))(I || {}); y = ((t) => (t.VerifySmsOtp = "verify-sms-otp", t.Cancel = "cancel", t.Retry = "retry", t))(y || {}); R = ((t) => (t.SmsOTPSent = "sms-otp-sent", t.InvalidSmsOtp = "invalid-sms-otp", t.ExpiredSmsOtp = "expired-sms-otp", t))(R || {}); N = ((o) => (o.EmailOTPSent = "email-otp-sent", o.InvalidEmailOtp = "invalid-email-otp", o.InvalidMfaOtp = "invalid-mfa-otp", o.ExpiredEmailOtp = "expired-email-otp", o.MfaSentHandle = "mfa-sent-handle", o))(N || {}); T = ((n) => (n.Retry = "device-retry", n))(T || {}); h = ((r) => (r.DeviceApproved = "device-approved", r.DeviceNeedsApproval = "device-needs-approval", r.DeviceVerificationLinkExpired = "device-verification-link-expired", r.DeviceVerificationEmailSent = "device-verification-email-sent", r))(h || {}); O = ((r) => (r.Retry = "Recency/auth-factor-retry", r.Cancel = "Recency/auth-factor-verification-cancel", r.VerifyEmailOtp = "Recency/auth-factor-verify-email-otp", r.VerifyMFACode = "Recency/verify-mfa-code", r))(O || {}); b = ((a2) => (a2.PrimaryAuthFactorNeedsVerification = "Recency/auth-factor-needs-verification", a2.PrimaryAuthFactorVerified = "Recency/auth-factor-verified", a2.InvalidEmailOtp = "Recency/auth-factor-invalid-email-otp", a2.EmailExpired = "Recency/auth-factor-verification-email-expired", a2.EmailSent = "Recency/auth-factor-verification-email-sent", a2.EmailNotDeliverable = "Recency/auth-factor-verification-email-not-deliverable", a2))(b || {}); S = ((t) => (t.RetryWithNewEmail = "UpdateEmail/retry-with-new-email", t.Cancel = "UpdateEmail/new-email-verification-cancel", t.VerifyEmailOtp = "UpdateEmail/new-email-verify-otp", t))(S || {}); k = ((c2) => (c2.NewAuthFactorNeedsVerification = "UpdateEmail/new-email-needs-verification", c2.EmailUpdated = "UpdateEmail/email-updated", c2.InvalidEmailOtp = "UpdateEmail/new-email-invalid-email-otp", c2.EmailExpired = "UpdateEmail/new-email-verification-email-expired", c2.EmailSent = "UpdateEmail/new-email-verification-email-sent", c2.EmailNotDeliverable = "UpdateEmail/new-email-verification-email-not-deliverable", c2.InvalidEmail = "UpdateEmail/new-email-invalid", c2.EmailAlreadyExists = "UpdateEmail/new-email-already-exists", c2))(k || {}); F = ((n) => (n.IDTokenCreated = "Auth/id-token-created", n))(F || {}); L = ((n) => (n.SuccessSignIn = "Farcaster/success_sign_in", n))(L || {}); w = ((t) => (t.MFASecretGenerated = "mfa-secret-generated", t.InvalidMFAOtp = "invalid-mfa-otp", t.MFARecoveryCodes = "mfa-recovery-codes", t))(w || {}); U = ((s) => (s.VerifyMFACode = "verify-mfa-code", s.Cancel = "cancel-mfa-setup", s))(U || {}); D = ((t) => (t.MFACodeRequested = "mfa-code-requested", t.InvalidMFAOtp = "invalid-mfa-otp", t.InvalidRecoveryCode = "invalid-recovery-code", t))(D || {}); V = ((t) => (t.VerifyMFACode = "verify-mfa-code", t.LostDevice = "lost-device", t.Cancel = "cancel-mfa-disable", t))(V || {}); C = ((n) => (n.Harmony = "HARMONY", n))(C || {}); G = ((n) => (n.ClosedByUser = "closed-by-user", n))(G || {}); H = ((n) => (n.ClosedByUser = "closed-by-user-on-received", n))(H || {}); q = ((n) => (n.PhoneNumber = "phone_number", n))(q || {}); W = ((r) => (r.Success = "nft-checkout-success", r.Failure = "nft-checkout-failure", r.Initiated = "nft-checkout-initiated", r.Disconnect = "disconnect", r))(W || {}); J = ((n) => (n.WalletInfoFetched = "Wallet/wallet-info-fetched", n))(J || {}); Y = ((n) => (n.CloseMagicWindow = "close-magic-window", n))(Y || {}); } }); // ../../node_modules/.pnpm/@magic-sdk+provider@28.6.0_localforage@1.10.0/node_modules/@magic-sdk/provider/dist/es/index.mjs function tn(n) { let t = { exports: {} }; return n(t, t.exports), t.exports; } function Dn(n) { return String.fromCharCode(parseInt(n.slice(1), 16)); } function Un(n) { return `%${`00${n.charCodeAt(0).toString(16)}`.slice(-2)}`; } function Wn(n) { return btoa(encodeURIComponent(n).replace(/%[0-9A-F]{2}/g, Dn)); } function Fn(n) { return decodeURIComponent(Array.from(atob(n), Un).join("")); } function fe(n) { return Wn(JSON.stringify(n)); } function dt(n) { return JSON.parse(Fn(n)); } function O2(n) { return typeof n == "undefined"; } function Kn(n) { return n === null; } function Ee(n) { return Kn(n) || O2(n); } function ut(n) { return Ee(n) ? false : !O2(n.jsonrpc) && !O2(n.id) && (!O2(n.result) || !O2(n.error)); } function pt(n) { return Ee(n) ? false : typeof n == "number" && Object.values(d).includes(n); } function se(n) { if (!n) return true; for (let t in n) if (Object.hasOwnProperty.call(n, t)) return false; return true; } function jn(n, t) { return Object.assign(h2, t), n; } function mt() { return new S2(p.MissingApiKey, "Please provide an API key that you acquired from the Magic developer dashboard."); } function ft() { return new S2(p.ModalNotReady, "Modal is not ready."); } function Et() { return new S2(p.MalformedResponse, "Response from the Magic iframe is malformed."); } function yt(n) { return new S2(p.ExtensionNotInitialized, `Extensions must be initialized with a Magic SDK instance before \`Extension.${n}\` can be accessed. Do not invoke \`Extension.${n}\` inside an extension constructor.`); } function gt(n) { let t = `Some extensions are incompatible with \`${h2.sdkName}@${h2.version}\`:`; return n.filter((e) => typeof e.compat != "undefined" && e.compat !== null).forEach((e) => { let r = e.compat[h2.sdkName]; typeof r == "string" ? t += ` - Extension \`${e.name}\` supports version(s) \`${r}\`` : r || (t += ` - Extension \`${e.name}\` does not support ${h2.platform} environments.`); }), new S2(p.IncompatibleExtensions, t); } function Rt(n) { let t = (e) => { let r = e + 1, o = r % 10, s = r % 100; return o === 1 && s !== 11 ? `${r}st` : o === 2 && s !== 12 ? `${r}nd` : o === 3 && s !== 13 ? `${r}rd` : `${r}th`; }; return new S2(p.InvalidArgument, `Invalid ${t(n.argument)} argument given to \`${n.procedure}\`. Expected: \`${n.expected}\` Received: \`${n.received}\``); } function Wr() { return new U2(m.DuplicateIframe, "Duplicate iframes found."); } function vt() { return new U2(m.SyncWeb3Method, "Non-async web3 methods are deprecated in web3 > 1.0 and are not supported by the Magic web3 provider. Please use an async method instead."); } function Tt() { return new U2(m.ReactNativeEndpointConfiguration, `CUSTOM DOMAINS ARE NOT SUPPORTED WHEN USING MAGIC SDK WITH REACT NATIVE! The \`endpoint\` parameter SHOULD NOT be provided. The Magic \`