UNPKG

@leapwallet/embedded-wallet-sdk-react

Version:

A react library for integrating metamask snaps on a cosmos dApp

1,452 lines 2.57 MB
var UC = Object.defineProperty; var KC = (C, m, I) => m in C ? UC(C, m, { enumerable: !0, configurable: !0, writable: !0, value: I }) : C[m] = I; var tn = (C, m, I) => (KC(C, typeof m != "symbol" ? m + "" : m, I), I); import { jsx as De, Fragment as es, jsxs as PA } from "react/jsx-runtime"; import Dn, { useRef as ba, useCallback as wa, useEffect as Po, createContext as Q2, useMemo as En, useContext as pr, useState as yr } from "react"; import { useInfiniteQuery as HC, QueryClient as Yl, QueryClientProvider as jl } from "@tanstack/react-query"; import { createPortal as qC } from "react-dom"; import { motion as Qc, AnimatePresence as As } from "framer-motion"; import { cn as Zc, Button as Kn } from "@leapwallet/react-ui"; import { useConnect as YC, useDisconnect as jC, useAccount as zl, defineChainInfo as zC, GrazProvider as JC } from "graz"; import { WalletType as eI } from "graz"; import { formatAmount as M1, getChains as RC, SkipAPI as Jl, getDenoms as LC, getNMSRestURLs as TC, fetchTransactions as x1, getActivityCardContent as OC, fetchBalance as Rl, LeapApi as Ll, getTokenData as VC, getEcosystemPrices as Zh, getAlternateKey as XC, convertAddress as Tl, sliceAddress as Ol, sliceDenom as $h, cachedRemoteDataWithLastModified as WC } from "@leapwallet/embedded-wallet-sdk-core"; import { TransactionParser as ZC } from "@leapwallet/parser-parfait"; import Eo, { unstable_serialize as is } from "swr"; import xo from "bignumber.js"; import { defineChain as $C } from "viem"; import { Virtuoso as Vl } from "react-virtuoso"; import { X as Xl, Wallet as Wl, CaretRight as e4, SignIn as A4, SignOut as i4, CaretDown as n4 } from "@phosphor-icons/react"; import "long"; import "@cosmjs/cosmwasm-stargate"; import "@cosmjs/stargate"; import "@cosmjs/tendermint-rpc"; const o4 = ({ children: C, onClick: m, isOpen: I }) => /* @__PURE__ */ De( Qc.div, { className: `fixed inset-0 bg-gray-400 bg-opacity-30 z-50 backdrop-blur-[var(--modal-overlay-blur)] leap-embedded-sdk ${I ? "" : "hidden"}`, initial: { opacity: 0 }, animate: { opacity: I ? 1 : 0 }, transition: { duration: 0.3 }, onClick: m, children: C } ), c4 = ({ children: C, onClose: m, isOpen: I, closeOnBackdropClick: _ = !0, closeOnEscape: M = !0, size: v = "md" }) => { const b = ba(null), a0 = wa((M0) => { M0.stopPropagation(); }, []), I0 = wa(() => { _ && m(); }, [_, m]); return Po(() => { const M0 = b.current; if (!M0 || !M) return; const v0 = (B) => { B.key === "Escape" && (B.stopPropagation(), m()); }; return M0.addEventListener("keydown", v0), document.addEventListener("keydown", v0), () => { M0.removeEventListener("keydown", v0), document.removeEventListener("keydown", v0); }; }, [M, m]), /* @__PURE__ */ De(es, { children: I && qC( /* @__PURE__ */ De(o4, { onClick: I0, isOpen: I, children: /* @__PURE__ */ De( "div", { ref: b, className: "fixed inset-0 top-0 right-0 h-full flex items-center justify-center", children: /* @__PURE__ */ De( "div", { className: `w-full flex justify-center overflow-hidden ${v === "sm" ? "max-w-[24rem]" : "max-w-[54rem]"}`, onClick: a0, children: C } ) } ) }), document.body ) }); }, a4 = () => /* @__PURE__ */ De( "svg", { xmlns: "http://www.w3.org/2000/svg", width: "32", height: "32", viewBox: "0 0 256 256", style: { color: "currentcolor" }, children: /* @__PURE__ */ De( "path", { fill: "currentColor", d: "M120,136V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0ZM232,91.55v72.9a15.86,15.86,0,0,1-4.69,11.31l-51.55,51.55A15.86,15.86,0,0,1,164.45,232H91.55a15.86,15.86,0,0,1-11.31-4.69L28.69,175.76A15.86,15.86,0,0,1,24,164.45V91.55a15.86,15.86,0,0,1,4.69-11.31L80.24,28.69A15.86,15.86,0,0,1,91.55,24h72.9a15.86,15.86,0,0,1,11.31,4.69l51.55,51.55A15.86,15.86,0,0,1,232,91.55Zm-16,0L164.45,40H91.55L40,91.55v72.9L91.55,216h72.9L216,164.45ZM128,160a12,12,0,1,0,12,12A12,12,0,0,0,128,160Z" } ) } ); class Zl extends Dn.Component { constructor(m) { super(m), this.state = { hasError: !1 }; } static getDerivedStateFromError(m) { return console.error(m), { hasError: !0 }; } componentDidCatch(m, I) { console.error(m, I); } render() { const { style: m, theme: I } = this.props; return this.state.hasError ? /* @__PURE__ */ PA( "div", { className: Zc("w-[28rem] h-[44rem] flex flex-col items-center justify-center gap-6 rounded-[1rem] p-2 border leap-ui", { "leap-ui": I === "light", "leap-ui dark": I === "dark" }), style: m, children: [ /* @__PURE__ */ De("div", { className: "rounded-full p-4 flex justify-center", children: /* @__PURE__ */ De(a4, {}) }), /* @__PURE__ */ De("div", { className: "font-bold text-xl mt-8 text-center", children: "Something went wrong" }), /* @__PURE__ */ De("div", { className: "text-sm mt-1 text-center", children: "It's not you, it's us. Please try again." }), /* @__PURE__ */ De( Kn, { variant: "outline", size: "xs", onClick: () => { this.setState({ hasError: !1 }); }, className: "max-w-[40%] mt-8 border-none py-4 px-8 rounded-md font-bold text-base cursor-pointer", children: "Try Again" } ) ] } ) : this.props.children; } } const $l = Q2(null), eg = ({ primaryChainId: C = "cosmoshub-4", connectWallet: m, disconnectWallet: I, connectedWalletType: _, chains: M, children: v }) => { const b = ba(!1), { connect: a0 } = YC(), { disconnect: I0 } = jC(); Po(() => { _ || I0(); }, [_]); const { data: M0, isDisconnected: v0 } = zl({ chainId: C ?? "cosmoshub-4" }); Po(() => { _ && !M0 && !b.current && (b.current = !0, a0({ chainId: C ?? "cosmoshub-4", walletType: _ })); }, [_, M0, a0, C]); const B = _ ? M0 == null ? void 0 : M0.bech32Address : void 0, $0 = _ ? M0 == null ? void 0 : M0.name : void 0, Ae = _ ? !!(M0 != null && M0.isNanoLedger) : !1; Po(() => { v0 && b.current && (b.current = !1); }, [v0]); const le = En(() => ({ walletName: $0, primaryChainId: C, connectedWalletType: _, connectWallet: m, disconnectWallet: I, isMainnet: !0, userAddress: B, isLedgerWallet: Ae, chains: M }), [ B, $0, Ae, C, _, M, m, I ]); return /* @__PURE__ */ De($l.Provider, { value: le, children: v }); }, ns = () => { const C = Dn.useContext($l); if (!C) throw new Error( "useWalletClientContext must be used within a WalletProvider, check if you are using EmbeddedWalletProvider in your app" ); return C; }, Ag = Q2(null), ig = ({ children: C, chainData: m, enableWalletConnect: I, connectedWalletList: _ }) => { const M = ns(), { data: v } = zl({ multiChain: !0 }), b = En(() => { if (!I) return m; const a0 = {}; if (v) for (const [I0, M0] of Object.entries(v)) M0 != null && M0.bech32Address && (M.chains === void 0 || M.chains.includes(I0)) && (a0[I0] = { address: M0.bech32Address }); return a0; }, [I, m, v, M.chains]); return /* @__PURE__ */ De(Ag.Provider, { value: { chainData: b, enableWalletConnect: !!I, connectedWalletList: _ }, children: C }); }, Br = () => { const C = pr(Ag); if (!C) throw new Error("useAccountContext must be used within an AccountContextProvider"); return C; }, t4 = () => /* @__PURE__ */ De( "svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", style: { color: "currentColor" }, children: /* @__PURE__ */ De( "path", { d: "M18 13H13V18C13 18.55 12.55 19 12 19C11.45 19 11 18.55 11 18V13H6C5.45 13 5 12.55 5 12C5 11.45 5.45 11 6 11H11V6C11 5.45 11.45 5 12 5C12.55 5 13 5.45 13 6V11H18C18.55 11 19 11.45 19 12C19 12.55 18.55 13 18 13Z", fill: "currentColor" } ) } ), r4 = () => /* @__PURE__ */ PA( "svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", style: { color: "currentColor" }, children: [ /* @__PURE__ */ De("g", { clipPath: "url(#clip0_35_799)", children: /* @__PURE__ */ De( "path", { d: "M3.99117 11.3981L0.194608 15.2083C-0.0648694 15.4814 -0.0648694 15.9048 0.194608 16.1779L3.99117 19.9881C4.41453 20.4251 5.152 20.111 5.152 19.5101V17.0519H13.3597C14.1108 17.0519 14.7254 16.4374 14.7254 15.6863C14.7254 14.9351 14.1108 14.3206 13.3597 14.3206H5.152V11.876C5.152 11.2615 4.41453 10.961 3.99117 11.3981ZM23.8071 7.01425L20.0105 3.20402C19.5871 2.76701 18.8497 3.08111 18.8497 3.68201V6.12656H10.6283C9.87722 6.12656 9.26267 6.74111 9.26267 7.49223C9.26267 8.24335 9.87722 8.8579 10.6283 8.8579H18.836V11.3025C18.836 11.917 19.5735 12.2175 19.9968 11.7804L23.7934 7.97022C24.0665 7.71074 24.0665 7.27372 23.8071 7.01425Z", fill: "currentColor" } ) }), /* @__PURE__ */ De("defs", { children: /* @__PURE__ */ De("clipPath", { id: "clip0_35_799", children: /* @__PURE__ */ De("rect", { width: "24", height: "24", fill: "white" }) }) }) ] } ), s4 = () => /* @__PURE__ */ De( "svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", style: { color: "currentColor" }, children: /* @__PURE__ */ De( "path", { d: "M19 15.18V7C19 4.79 17.21 3 15 3C12.79 3 11 4.79 11 7V17C11 18.1 10.1 19 9 19C7.9 19 7 18.1 7 17V8.82C8.16 8.4 9 7.3 9 6C9 4.34 7.66 3 6 3C4.34 3 3 4.34 3 6C3 7.3 3.84 8.4 5 8.82V17C5 19.21 6.79 21 9 21C11.21 21 13 19.21 13 17V7C13 5.9 13.9 5 15 5C16.1 5 17 5.9 17 7V15.18C15.84 15.59 15 16.69 15 18C15 19.66 16.34 21 18 21C19.66 21 21 19.66 21 18C21 16.7 20.16 15.6 19 15.18Z", fill: "currentColor" } ) } ), h4 = () => /* @__PURE__ */ De( "svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", style: { color: "currentColor" }, children: /* @__PURE__ */ De( "path", { d: "M10 16.2963H14C14.55 16.2963 15 15.8463 15 15.2963V10.2963H16.59C17.48 10.2963 17.93 9.21625 17.3 8.58625L12.71 3.99625C12.32 3.60625 11.69 3.60625 11.3 3.99625L6.71 8.58625C6.08 9.21625 6.52 10.2963 7.41 10.2963H9V15.2963C9 15.8463 9.45 16.2963 10 16.2963ZM6 18.2963H18C18.55 18.2963 19 18.7463 19 19.2963C19 19.8463 18.55 20.2963 18 20.2963H6C5.45 20.2963 5 19.8463 5 19.2963C5 18.7463 5.45 18.2963 6 18.2963Z", fill: "currentColor" } ) } ), l4 = () => /* @__PURE__ */ De( "svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", style: { color: "currentColor" }, children: /* @__PURE__ */ De( "path", { d: "M11.9992 7.32626L18.3892 17.5563H5.60916L11.9992 7.32626ZM11.1492 4.91626L2.94916 18.0263C2.53916 18.6963 3.01916 19.5563 3.79916 19.5563H20.1992C20.9892 19.5563 21.4592 18.6963 21.0492 18.0263L12.8492 4.91626C12.4592 4.28626 11.5392 4.28626 11.1492 4.91626Z", fill: "currentColor" } ) } ), g4 = () => { window.open( "https://swapfast.app/", "_blank", "noopener noreferrer" ); }, m4 = () => { window.open( "https://swapfast.app/", "_blank", "noopener noreferrer" ); }, C4 = () => { window.open( "https://swapfast.app/", "_blank", "noopener noreferrer" ); }, el = () => { window.open( "https://swapfast.app/", "_blank", "noopener noreferrer" ); }; var f4 = /* @__PURE__ */ ((C) => (C.SEND = "send", C.IBC = "ibc", C.BUY = "buy", C.SWAP = "swap", C.BRIDGE = "bridge", C))(f4 || {}); const D4 = [ { id: "send", label: "Send", onClick: el, icon: /* @__PURE__ */ De(h4, {}) }, { id: "ibc", label: "IBC", onClick: el, icon: /* @__PURE__ */ De(l4, {}) }, { id: "buy", label: "Buy", onClick: g4, icon: /* @__PURE__ */ De(t4, {}) }, { id: "swap", label: "Swap", onClick: m4, icon: /* @__PURE__ */ De(r4, {}) }, { id: "bridge", label: "Bridge", onClick: C4, icon: /* @__PURE__ */ De(s4, {}) } ], ng = Q2(null), og = ({ children: C, config: m, showActionButtons: I }) => { const _ = En(() => { const M = {}; return [...D4].sort((b, a0) => { var v0, B; const I0 = ((v0 = m == null ? void 0 : m[b.id]) == null ? void 0 : v0.order) ?? 0, M0 = ((B = m == null ? void 0 : m[a0.id]) == null ? void 0 : B.order) ?? 0; return I0 - M0; }).forEach(({ id: b, label: a0, onClick: I0, icon: M0 }) => { const v0 = m == null ? void 0 : m[b]; M[b] = { label: (v0 == null ? void 0 : v0.label) ?? a0, onClick: (v0 == null ? void 0 : v0.onClick) ?? I0, enabled: (v0 == null ? void 0 : v0.enabled) ?? !0, icon: M0 }; }), M; }, [m]); return /* @__PURE__ */ De(ng.Provider, { value: { actionRecords: _, showActionButtons: !!I }, children: C }); }, d4 = () => { const C = pr(ng); if (!C) throw new Error( "useActionListContext must be used within a ActionListProvider" ); return C; }, cg = Q2(null), u4 = ({ children: C }) => { const [m, I] = yr(0); return /* @__PURE__ */ De(cg.Provider, { value: { totalCurrencyValue: m, setTotalCurrencyValue: I }, children: C }); }, ag = () => { const C = pr(cg); if (!C) throw new Error( "useBalanceAmountContext must be used within a BalanceAmountProvider" ); return C; }, tg = Q2(null), rg = ({ children: C }) => { const [m, I] = yr(Sn.HOME); return /* @__PURE__ */ De( tg.Provider, { value: { currentPage: m, setCurrentPage: I }, children: C } ); }, os = () => { const C = pr(tg); if (!C) throw new Error("usePageContext must be used within PageContextProvider"); return C; }, p4 = ({ size: C = "20" }) => /* @__PURE__ */ PA( "svg", { xmlns: "http://www.w3.org/2000/svg", width: C, height: C, viewBox: "0 0 20 20", style: { color: "currentcolor" }, children: [ /* @__PURE__ */ De("g", { clipPath: "url(#clip0_122_165)", children: /* @__PURE__ */ De( "path", { d: "M5.59166 7.7418C5.91666 7.4168 6.44166 7.4168 6.76666 7.7418L10 10.9751L13.2333 7.7418C13.5583 7.4168 14.0833 7.4168 14.4083 7.7418C14.7333 8.0668 14.7333 8.5918 14.4083 8.9168L10.5833 12.7418C10.2583 13.0668 9.73333 13.0668 9.40833 12.7418L5.58333 8.9168C5.26666 8.60013 5.26666 8.0668 5.59166 7.7418Z", fill: "currentColor" } ) }), /* @__PURE__ */ De("defs", { children: /* @__PURE__ */ De("clipPath", { id: "clip0_122_165", children: /* @__PURE__ */ De("rect", { width: "20", height: "20", fill: "white" }) }) }) ] } ), y4 = ({ children: C, label: m, onClick: I }) => /* @__PURE__ */ PA("div", { className: "flex flex-col items-center gap-2", children: [ /* @__PURE__ */ De( Kn, { variant: "outline", size: "sm-icon", className: "border-none bg-secondary rounded-full flex items-center justify-center h-14 w-14", onClick: I, children: C } ), /* @__PURE__ */ De("span", { className: "text-base font-bold leading-5", children: m }) ] }), B4 = () => { const { actionRecords: C, showActionButtons: m } = d4(), { totalCurrencyValue: I } = ag(), { setCurrentPage: _ } = os(), M = Object.entries(C).filter( ([, { enabled: v }]) => v ); return /* @__PURE__ */ PA("div", { className: "flex flex-col items-center gap-4 pt-10 px-5", children: [ /* @__PURE__ */ PA("div", { className: "flex flex-col items-center gap-4", children: [ /* @__PURE__ */ De("p", { className: "text-center text-4xl font-bold leading-none", children: M1(I, !0) }), /* @__PURE__ */ PA( Kn, { variant: "outline", onClick: () => _(Sn.ADDRESSES), className: "bg-card border-none rounded-full flex flex-row gap-1 items-center", children: [ /* @__PURE__ */ De("p", { children: "View addresses" }), /* @__PURE__ */ De(p4, {}) ] } ) ] }), /* @__PURE__ */ De( "div", { className: "grid grid-cols-5 gap-2 w-full p-2 mb-4", style: { gridTemplateColumns: `repeat(${M.length}, 1fr)` }, children: m ? M.map(([v, { label: b, onClick: a0, icon: I0 }]) => /* @__PURE__ */ De( y4, { label: b, onClick: a0, children: I0 }, v )) : null } ) ] }); }; var cs = /* @__PURE__ */ ((C) => (C.DENOM_TRACE = "@leapwallet/embedded-wallet-sdk-core#0:denom-trace", C.DENOM_ORIGIN_TRACE = "@leapwallet/embedded-wallet-sdk-core#0:denom-origin-trace", C.COIN_PRICES = "@leapwallet/embedded-wallet-sdk-core#0:coin-prices", C.DENOM_DATA = "@leapwallet/embedded-wallet-sdk-core#0:denom-data", C.CHAIN_DATA = "@leapwallet/embedded-wallet-sdk-core#0:chain-data", C.NMS_REST_URLS = "@leapwallet/embedded-wallet-sdk-core#0:nms-rest-urls", C.NMS_RPC_URLS = "@leapwallet/embedded-wallet-sdk-core#0:nms-rpc-urls", C))(cs || {}), UA = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; function I4(C) { return C && C.__esModule && Object.prototype.hasOwnProperty.call(C, "default") ? C.default : C; } function E4(C) { if (C.__esModule) return C; var m = C.default; if (typeof m == "function") { var I = function _() { return this instanceof _ ? Reflect.construct(m, arguments, this.constructor) : m.apply(this, arguments); }; I.prototype = m.prototype; } else I = {}; return Object.defineProperty(I, "__esModule", { value: !0 }), Object.keys(C).forEach(function(_) { var M = Object.getOwnPropertyDescriptor(C, _); Object.defineProperty(I, _, M.get ? M : { enumerable: !0, get: function() { return C[_]; } }); }), I; } var va = {}; Object.defineProperty(va, "__esModule", { value: !0 }); va.bech32m = va.bech32 = void 0; const sr = "qpzry9x8gf2tvdw0s3jn54khce6mua7l", sg = {}; for (let C = 0; C < sr.length; C++) { const m = sr.charAt(C); sg[m] = C; } function o2(C) { const m = C >> 25; return (C & 33554431) << 5 ^ -(m >> 0 & 1) & 996825010 ^ -(m >> 1 & 1) & 642813549 ^ -(m >> 2 & 1) & 513874426 ^ -(m >> 3 & 1) & 1027748829 ^ -(m >> 4 & 1) & 705979059; } function Al(C) { let m = 1; for (let I = 0; I < C.length; ++I) { const _ = C.charCodeAt(I); if (_ < 33 || _ > 126) return "Invalid prefix (" + C + ")"; m = o2(m) ^ _ >> 5; } m = o2(m); for (let I = 0; I < C.length; ++I) { const _ = C.charCodeAt(I); m = o2(m) ^ _ & 31; } return m; } function as(C, m, I, _) { let M = 0, v = 0; const b = (1 << I) - 1, a0 = []; for (let I0 = 0; I0 < C.length; ++I0) for (M = M << m | C[I0], v += m; v >= I; ) v -= I, a0.push(M >> v & b); if (_) v > 0 && a0.push(M << I - v & b); else { if (v >= m) return "Excess padding"; if (M << I - v & b) return "Non-zero padding"; } return a0; } function _4(C) { return as(C, 8, 5, !0); } function b4(C) { const m = as(C, 5, 8, !1); if (Array.isArray(m)) return m; } function w4(C) { const m = as(C, 5, 8, !1); if (Array.isArray(m)) return m; throw new Error(m); } function hg(C) { let m; C === "bech32" ? m = 1 : m = 734539939; function I(b, a0, I0) { if (I0 = I0 || 90, b.length + 7 + a0.length > I0) throw new TypeError("Exceeds length limit"); b = b.toLowerCase(); let M0 = Al(b); if (typeof M0 == "string") throw new Error(M0); let v0 = b + "1"; for (let B = 0; B < a0.length; ++B) { const $0 = a0[B]; if ($0 >> 5) throw new Error("Non 5-bit word"); M0 = o2(M0) ^ $0, v0 += sr.charAt($0); } for (let B = 0; B < 6; ++B) M0 = o2(M0); M0 ^= m; for (let B = 0; B < 6; ++B) { const $0 = M0 >> (5 - B) * 5 & 31; v0 += sr.charAt($0); } return v0; } function _(b, a0) { if (a0 = a0 || 90, b.length < 8) return b + " too short"; if (b.length > a0) return "Exceeds length limit"; const I0 = b.toLowerCase(), M0 = b.toUpperCase(); if (b !== I0 && b !== M0) return "Mixed-case string " + b; b = I0; const v0 = b.lastIndexOf("1"); if (v0 === -1) return "No separator character for " + b; if (v0 === 0) return "Missing prefix for " + b; const B = b.slice(0, v0), $0 = b.slice(v0 + 1); if ($0.length < 6) return "Data too short"; let Ae = Al(B); if (typeof Ae == "string") return Ae; const le = []; for (let x0 = 0; x0 < $0.length; ++x0) { const ge = $0.charAt(x0), z0 = sg[ge]; if (z0 === void 0) return "Unknown character " + ge; Ae = o2(Ae) ^ z0, !(x0 + 6 >= $0.length) && le.push(z0); } return Ae !== m ? "Invalid checksum for " + b : { prefix: B, words: le }; } function M(b, a0) { const I0 = _(b, a0); if (typeof I0 == "object") return I0; } function v(b, a0) { const I0 = _(b, a0); if (typeof I0 == "object") return I0; throw new Error(I0); } return { decodeUnsafe: M, decode: v, encode: I, toWords: _4, fromWordsUnsafe: b4, fromWords: w4 }; } va.bech32 = hg("bech32"); va.bech32m = hg("bech32m"); class v4 { constructor() { tn(this, "storage"); tn(this, "length"); this.storage = {}, this.length = 0; } setItem(m, I) { this.storage[m] = I; } getItem(m) { return this.storage[m] || null; } clear() { this.storage = {}; } removeItem(m) { this.storage[m] = null; } key(m) { return this.storage[m]; } } class lg { constructor(m) { tn(this, "cache", {}); tn(this, "persistence"); tn(this, "persistenceKey"); typeof window < "u" ? this.persistence = localStorage : this.persistence = new v4(), this.persistenceKey = m; const I = this.persistence.getItem(this.persistenceKey); I && (this.cache = JSON.parse(I)); } get(m) { return this.cache[m]; } set(m, I) { this.cache[m] = I, this.persistence.setItem(this.persistenceKey, JSON.stringify(this.cache)); } clear() { this.cache = {}, this.persistence.setItem(this.persistenceKey, JSON.stringify(this.cache)); } } new lg(cs.DENOM_TRACE); const Q4 = "https://api.leapwallet.io"; class il extends Error { constructor(I, _, M) { const v = I.status || I.status === 0 ? I.status : "", b = I.statusText || "", a0 = `${v} ${b}`.trim(), I0 = a0 ? `status code ${a0}` : "an unknown error"; super(`Request failed with ${I0}: ${_.method} ${_.url}`); tn(this, "response"); tn(this, "request"); tn(this, "options"); this.name = "HTTPError", this.response = I, this.request = _, this.options = M; } } class gg extends Error { constructor(I) { super(`Request timed out: ${I.method} ${I.url}`); tn(this, "request"); this.name = "TimeoutError", this.request = I; } } const pa = (C) => C !== null && typeof C == "object", Rt = (...C) => { for (const m of C) if ((!pa(m) || Array.isArray(m)) && m !== void 0) throw new TypeError("The `options` argument must be an object"); return ts({}, ...C); }, mg = (C = {}, m = {}) => { const I = new globalThis.Headers(C), _ = m instanceof globalThis.Headers, M = new globalThis.Headers(m); for (const [v, b] of M.entries()) _ && b === "undefined" || b === void 0 ? I.delete(v) : I.set(v, b); return I; }; function Lt(C, m, I) { return Object.hasOwn(m, I) && m[I] === void 0 ? [] : ts(C[I] ?? [], m[I] ?? []); } const Cg = (C = {}, m = {}) => ({ beforeRequest: Lt(C, m, "beforeRequest"), beforeRetry: Lt(C, m, "beforeRetry"), afterResponse: Lt(C, m, "afterResponse"), beforeError: Lt(C, m, "beforeError") }), ts = (...C) => { let m = {}, I = {}, _ = {}; for (const M of C) if (Array.isArray(M)) Array.isArray(m) || (m = []), m = [...m, ...M]; else if (pa(M)) { for (let [v, b] of Object.entries(M)) pa(b) && v in m && (b = ts(m[v], b)), m = { ...m, [v]: b }; pa(M.hooks) && (_ = Cg(_, M.hooks), m.hooks = _), pa(M.headers) && (I = mg(I, M.headers), m.headers = I); } return m; }, k4 = (() => { let C = !1, m = !1; const I = typeof globalThis.ReadableStream == "function", _ = typeof globalThis.Request == "function"; if (I && _) try { m = new globalThis.Request("https://empty.invalid", { body: new globalThis.ReadableStream(), method: "POST", // @ts-expect-error - Types are outdated. get duplex() { return C = !0, "half"; } }).headers.has("Content-Type"); } catch (M) { if (M instanceof Error && M.message === "unsupported BodyInit type") return !1; throw M; } return C && !m; })(), F4 = typeof globalThis.AbortController == "function", M4 = typeof globalThis.ReadableStream == "function", x4 = typeof globalThis.FormData == "function", fg = ["get", "post", "put", "patch", "head", "delete"], S4 = { json: "application/json", text: "text/*", formData: "multipart/form-data", arrayBuffer: "*/*", blob: "*/*" }, h1 = 2147483647, Dg = Symbol("stop"), G4 = { json: !0, parseJson: !0, stringifyJson: !0, searchParams: !0, prefixUrl: !0, retry: !0, timeout: !0, hooks: !0, throwHttpErrors: !0, onDownloadProgress: !0, fetch: !0 }, P4 = { method: !0, headers: !0, body: !0, mode: !0, credentials: !0, cache: !0, redirect: !0, referrer: !0, referrerPolicy: !0, integrity: !0, keepalive: !0, signal: !0, window: !0, dispatcher: !0, duplex: !0, priority: !0 }, N4 = (C) => fg.includes(C) ? C.toUpperCase() : C, U4 = ["get", "put", "head", "delete", "options", "trace"], K4 = [408, 413, 429, 500, 502, 503, 504], H4 = [413, 429, 503], nl = { limit: 2, methods: U4, statusCodes: K4, afterStatusCodes: H4, maxRetryAfter: Number.POSITIVE_INFINITY, backoffLimit: Number.POSITIVE_INFINITY, delay: (C) => 0.3 * 2 ** (C - 1) * 1e3 }, q4 = (C = {}) => { if (typeof C == "number") return { ...nl, limit: C }; if (C.methods && !Array.isArray(C.methods)) throw new Error("retry.methods must be an array"); if (C.statusCodes && !Array.isArray(C.statusCodes)) throw new Error("retry.statusCodes must be an array"); return { ...nl, ...C }; }; async function Y4(C, m, I, _) { return new Promise((M, v) => { const b = setTimeout(() => { I && I.abort(), v(new gg(C)); }, _.timeout); _.fetch(C, m).then(M).catch(v).then(() => { clearTimeout(b); }); }); } async function j4(C, { signal: m }) { return new Promise((I, _) => { m && (m.throwIfAborted(), m.addEventListener("abort", M, { once: !0 })); function M() { clearTimeout(v), _(m.reason); } const v = setTimeout(() => { m == null || m.removeEventListener("abort", M), I(); }, C); }); } const z4 = (C, m) => { const I = {}; for (const _ in m) !(_ in P4) && !(_ in G4) && !(_ in C) && (I[_] = m[_]); return I; }; class hr { // eslint-disable-next-line complexity constructor(m, I = {}) { tn(this, "request"); tn(this, "abortController"); tn(this, "_retryCount", 0); tn(this, "_input"); tn(this, "_options"); var _, M; if (this._input = m, this._options = { ...I, headers: mg(this._input.headers, I.headers), hooks: Cg({ beforeRequest: [], beforeRetry: [], beforeError: [], afterResponse: [] }, I.hooks), method: N4(I.method ?? this._input.method), // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing prefixUrl: String(I.prefixUrl || ""), retry: q4(I.retry), throwHttpErrors: I.throwHttpErrors !== !1, timeout: I.timeout ?? 1e4, fetch: I.fetch ?? globalThis.fetch.bind(globalThis) }, typeof this._input != "string" && !(this._input instanceof URL || this._input instanceof globalThis.Request)) throw new TypeError("`input` must be a string, URL, or Request"); if (this._options.prefixUrl && typeof this._input == "string") { if (this._input.startsWith("/")) throw new Error("`input` must not begin with a slash when using `prefixUrl`"); this._options.prefixUrl.endsWith("/") || (this._options.prefixUrl += "/"), this._input = this._options.prefixUrl + this._input; } if (F4) { this.abortController = new globalThis.AbortController(); const v = this._options.signal ?? this._input.signal; v == null || v.addEventListener("abort", () => { this.abortController.abort(v.reason); }), this._options.signal = this.abortController.signal; } if (k4 && (this._options.duplex = "half"), this._options.json !== void 0 && (this._options.body = ((M = (_ = this._options).stringifyJson) == null ? void 0 : M.call(_, this._options.json)) ?? JSON.stringify(this._options.json), this._options.headers.set("content-type", this._options.headers.get("content-type") ?? "application/json")), this.request = new globalThis.Request(this._input, this._options), this._options.searchParams) { const b = "?" + (typeof this._options.searchParams == "string" ? this._options.searchParams.replace(/^\?/, "") : new URLSearchParams(this._options.searchParams).toString()), a0 = this.request.url.replace(/(?:\?.*?)?(?=#|$)/, b); (x4 && this._options.body instanceof globalThis.FormData || this._options.body instanceof URLSearchParams) && !(this._options.headers && this._options.headers["content-type"]) && this.request.headers.delete("content-type"), this.request = new globalThis.Request(new globalThis.Request(a0, { ...this.request }), this._options); } } static create(m, I) { const _ = new hr(m, I), M = async () => { if (typeof _._options.timeout == "number" && _._options.timeout > h1) throw new RangeError(`The \`timeout\` option cannot be greater than ${h1}`); await Promise.resolve(); let a0 = await _._fetch(); for (const I0 of _._options.hooks.afterResponse) { const M0 = await I0(_.request, _._options, _._decorateResponse(a0.clone())); M0 instanceof globalThis.Response && (a0 = M0); } if (_._decorateResponse(a0), !a0.ok && _._options.throwHttpErrors) { let I0 = new il(a0, _.request, _._options); for (const M0 of _._options.hooks.beforeError) I0 = await M0(I0); throw I0; } if (_._options.onDownloadProgress) { if (typeof _._options.onDownloadProgress != "function") throw new TypeError("The `onDownloadProgress` option must be a function"); if (!M4) throw new Error("Streams are not supported in your environment. `ReadableStream` is missing."); return _._stream(a0.clone(), _._options.onDownloadProgress); } return a0; }, b = _._options.retry.methods.includes(_.request.method.toLowerCase()) ? _._retry(M) : M(); for (const [a0, I0] of Object.entries(S4)) b[a0] = async () => { _.request.headers.set("accept", _.request.headers.get("accept") || I0); const v0 = (await b).clone(); if (a0 === "json") { if (v0.status === 204 || (await v0.clone().arrayBuffer()).byteLength === 0) return ""; if (I.parseJson) return I.parseJson(await v0.text()); } return v0[a0](); }; return b; } _calculateRetryDelay(m) { if (this._retryCount++, this._retryCount > this._options.retry.limit || m instanceof gg) throw m; if (m instanceof il) { if (!this._options.retry.statusCodes.includes(m.response.status)) throw m; const _ = m.response.headers.get("Retry-After") ?? m.response.headers.get("RateLimit-Reset") ?? m.response.headers.get("X-RateLimit-Reset") ?? m.response.headers.get("X-Rate-Limit-Reset"); if (_ && this._options.retry.afterStatusCodes.includes(m.response.status)) { let M = Number(_) * 1e3; Number.isNaN(M) ? M = Date.parse(_) - Date.now() : M >= Date.parse("2024-01-01") && (M -= Date.now()); const v = this._options.retry.maxRetryAfter ?? M; return M < v ? M : v; } if (m.response.status === 413) throw m; } const I = this._options.retry.delay(this._retryCount); return Math.min(this._options.retry.backoffLimit, I); } _decorateResponse(m) { return this._options.parseJson && (m.json = async () => this._options.parseJson(await m.text())), m; } async _retry(m) { try { return await m(); } catch (I) { const _ = Math.min(this._calculateRetryDelay(I), h1); if (this._retryCount < 1) throw I; await j4(_, { signal: this._options.signal }); for (const M of this._options.hooks.beforeRetry) if (await M({ request: this.request, options: this._options, error: I, retryCount: this._retryCount }) === Dg) return; return this._retry(m); } } async _fetch() { for (const _ of this._options.hooks.beforeRequest) { const M = await _(this.request, this._options); if (M instanceof Request) { this.request = M; break; } if (M instanceof Response) return M; } const m = z4(this.request, this._options), I = this.request; return this.request = I.clone(), this._options.timeout === !1 ? this._options.fetch(I, m) : Y4(I, m, this.abortController, this._options); } /* istanbul ignore next */ _stream(m, I) { const _ = Number(m.headers.get("content-length")) || 0; let M = 0; return m.status === 204 ? (I && I({ percent: 1, totalBytes: _, transferredBytes: M }, new Uint8Array()), new globalThis.Response(null, { status: m.status, statusText: m.statusText, headers: m.headers })) : new globalThis.Response(new globalThis.ReadableStream({ async start(v) { const b = m.body.getReader(); I && I({ percent: 0, transferredBytes: 0, totalBytes: _ }, new Uint8Array()); async function a0() { const { done: I0, value: M0 } = await b.read(); if (I0) { v.close(); return; } if (I) { M += M0.byteLength; const v0 = _ === 0 ? 0 : M / _; I({ percent: v0, transferredBytes: M, totalBytes: _ }, M0); } v.enqueue(M0), await a0(); } await a0(); } }), { status: m.status, statusText: m.statusText, headers: m.headers }); } } /*! MIT License © Sindre Sorhus */ const S1 = (C) => { const m = (I, _) => hr.create(I, Rt(C, _)); for (const I of fg) m[I] = (_, M) => hr.create(_, Rt(C, M, { method: I })); return m.create = (I) => S1(Rt(I)), m.extend = (I) => (typeof I == "function" && (I = I(C ?? {})), S1(Rt(C, I))), m.stop = Dg, m; }, J4 = S1(), R4 = J4; R4.create({ prefixUrl: Q4 }); new lg(cs.COIN_PRICES); var G1 = /* @__PURE__ */ ((C) => (C.NUMIA = "numia", C))(G1 || {}), Ho = /* @__PURE__ */ ((C) => (C.BALANCE = "balance", C.BALANCE_RICH = "balance-rich", C.CHAINS = "chains", C.DENOMS = "denoms", C.DENOM_TRACE = "denom-traces", C.TRANSACTIONS = "transactions", C.NMS_REST_URLS = "nms-rest-urls", C.LEAP_ASSETS = "leap-assets", C.SKIP_CHAINS = "skip-chains", C.SKIP_BALANCES = "skip-balances", C))(Ho || {}); const ol = { evm: 1, btc: 0, svm: 2, cosmos: 3 }, k2 = (C = {}) => Eo( Ho.CHAINS, async () => (await RC()).map((I) => I.privateInfra ? { ...I, chainType: "cosmos", restUrl: I.privateInfra[G1.NUMIA].restUrl, rpcUrl: I.privateInfra[G1.NUMIA].rpcUrl } : { ...I, chainType: "cosmos" }), { dedupingInterval: 1e3 * 60, // 1 minute ...C } ), dg = (C, m) => { const I = (C == null ? void 0 : C.includeEVM) ?? !1, _ = (C == null ? void 0 : C.includeSVM) ?? !1, M = (C == null ? void 0 : C.includeTestnets) ?? !1, v = (C == null ? void 0 : C.chainIds) ?? [], b = is([ Ho.SKIP_CHAINS, `includeEVM-${I}`, `includeSVM-${_}`, `includeTestnets-${M}`, `chainIds-${v.join("-")}` ]); return Eo( b, async () => { const a0 = await Jl.getSupportedChains({ chainIds: v, includeEVM: I, includeTestnets: M, includeSVM: _ }); if (a0.success) return a0.chains; throw new Error(`Failed: ${a0.error}`); }, { dedupingInterval: 1e3 * 60, // 1 minute ...m } ); }, ug = (C = {}) => Eo(Ho.DENOMS, LC, { dedupingInterval: 1e3 * 60, // 1 minute ...C }), Ir = (C, m = {}) => { var M, v; const { data: I, mutate: _ } = Eo(Ho.DENOMS, TC, m); return Po(() => { if (I) { const b = I == null ? void 0 : I[C]; if (!b) return; (async () => { const I0 = b.length; let M0 = 0, v0 = b[0], B = !1; const $0 = async () => { try { (await fetch( `${v0.nodeUrl}/cosmos/base/node/v1beta1/status` )).ok && (B = !0); } catch { } }; for (; !B && M0 < I0; ) await $0(), B || (M0++, b.push(b.shift()), v0 = b[0]); B && JSON.stringify(I[C]) !== JSON.stringify(b) && _({ ...I, [C]: b }); })(); } }, [I, C, _]), (v = (M = I == null ? void 0 : I[C]) == null ? void 0 : M[0]) == null ? void 0 : v.nodeUrl; }, L4 = new ZC(), cl = async (C, m, I, _, M) => { const v = C.map((a0) => L4.parse(a0)).map((a0) => a0.success ? a0.data : null).filter((a0) => a0 !== null); return v.sort((a0, I0) => { const M0 = new Date(a0.timestamp).getTime(); return new Date(I0.timestamp).getTime() - M0; }), (await Promise.allSettled( v.map( (a0) => OC({ parsedTx: a0, address: m, denoms: M, chainId: I, restUrl: _ }) ) )).map((a0) => a0.status === "fulfilled" ? a0.value : null).filter((a0) => a0 !== null); }; function xB(C, m, I) { const { data: _ } = k2(), { data: M } = ug(), v = Ir(m), b = ba(0), a0 = ba(0); return HC( ["activity", m, C], async ({ pageParam: I0 = 1 }) => { const M0 = I0; if (!_) throw new Error("Chains not loaded"); const v0 = _.find((x0) => x0.chainId === m); if (!v0) throw new Error("Chain not supported"); const [ { transactions: B, total: $0 }, { transactions: Ae, total: le } ] = await Promise.all([ x1(I ?? v ?? v0.restUrl, C, { pagination: { limit: 50, offset: (M0 - 1) * 50 }, transfer: "sender" }), x1(I ?? v ?? v0.restUrl, C, { pagination: { limit: 50, offset: (M0 - 1) * 50 }, transfer: "recipient" }) ]); return b.current = B.length, a0.current = Ae.length, { sender: { total: $0, activity: await cl( B, C, m, v0.restUrl, M ) }, recipient: { total: le, activity: await cl( Ae, C, m, v0.restUrl, M ) } }; }, { getNextPageParam: (I0, M0) => { if (I0.sender.activity.length !== 0 && (b.current < I0.sender.total || a0.current < I0.recipient.total)) return M0.length + 1; }, enabled: !!M && !!_, retry: 2, refetchOnMount: !1, refetchOnWindowFocus: !1 } ); } const SB = (C, m, I, _) => { const { data: M } = k2(), v = Ir(m); return Eo( M ? `${Ho.BALANCE}:${m}:${C}` : null, () => { const b = M.find((a0) => a0.chainId === m); if (!b) throw new Error("Chain not supported"); return Rl(I ?? v ?? b.restUrl, C); }, _ ); }, GB = (C, m) => { const [I, _] = yr(C); return Po(() => { const M = setTimeout(() => { _(C); }, m); return () => { clearTimeout(M); }; }, [C, m]), I; }; $C( { id: 984122, name: "Forma", testnet: !1, nativeCurrency: { name: "TIA", symbol: "TIA", decimals: 18 }, rpcUrls: { default: { http: ["https://rpc.forma.art"] }, public: { http: ["https://rpc.forma.art"] } }, blockExplorers: { default: { name: "Forma Explorer", url: "https://explorer.forma.art" } }, contracts: { multicall3: { address: "0xd53C6FFB123F7349A32980F87faeD8FfDc9ef079", blockCreated: 252705 } } } ); const T4 = (C) => { const m = (C == null ? void 0 : C.includeEVMAssets) ?? !0, I = (C == null ? void 0 : C.includeCW20Assets) ?? !0, _ = (C == null ? void 0 : C.includeNoMetadataAssets) ?? !1, M = (C == null ? void 0 : C.nativeOnly) ?? !1, v = (C == null ? void 0 : C.includeSVMAssets) ?? !0, b = is([ Ho.LEAP_ASSETS, `nativeOnly-${M}`, `includeEVMAssets-${m}`, `includeCW20Assets-${I}`, `includeSvmAssets-${v}`, `includeNoMetadataAssets-${_}` ]); return Eo( b, async () => { const a0 = await Ll.getAssets({ native_only: M, skip_assets_only: !0, include_evm: m, include_svm: v, include_cw20: I }); if (a0.success) return a0.assets; throw new Error(`Failed: ${a0.error} and ${a0.error}`); }, { revalidateOnFocus: !1, dedupingInterval: 60 * 1e3, // 1 minute, keepPreviousData: !0 } ); }; function O4(C) { return C.coin.denom.startsWith("ibc/"); } function V4(C) { return C.coin.denom.startsWith("factory/"); } function X4(C) { return C.coin.denom === C.denomData.coinMinimalDenom; } function Tt(C, m) { return C.amount.isEqualTo(m.amount) ? C.denomData.coinDenom.localeCompare(m.denomData.coinDenom) : C.amount.isGreaterThan(m.amount) ? -1 : 1; } function pg(C, m) { const I = C.usdValue ?? new xo(-1 / 0), _ = m.usdValue ?? new xo(-1 / 0); if (_.isGreaterThan(I)) return 1; if (_.isLessThan(I)) return -1; { const M = C.amount ?? new xo(-1 / 0); return (m.amount ?? new xo(-1 / 0)).minus(M).toNumber(); } } const PB = (C, m, I, _) => { const { data: M } = ug(), { data: v } = k2(), b = Ir(m); return Eo( M && v ? `balance:${m}:${C}` : null, async () => { if (!M || !v) throw new Error("Denoms or chains not loaded"); const a0 = v.find((x0) => x0.chainId === m); if (!a0) throw new Error("Chain not supported"); const I0 = await Rl( I ?? b ?? a0.restUrl, C ), v0 = (await Promise.allSettled( I0.map((x0) => VC(x0, a0, M)) )).map( (x0) => x0.status === "fulfilled" && x0.value !== void 0 ? x0.value : void 0 ).filter((x0) => x0 !== void 0), B = [], $0 = [], Ae = [], le = []; return v0.forEach((x0) => { O4(x0) ? $0.push(x0) : V4(x0) ? Ae.push(x0) : X4(x0) ? B.push(x0) : le.push(x0); }), [ ...B.sort(Tt), ...Ae.sort(Tt), ...$0.sort(Tt), ...le.sort(Tt) ]; }, _ ); }, W4 = (C) => { const m = T4({ includeCW20Assets: !0, includeSVMAssets: !1, includeEVMAssets: !0 }), I = is([ Ho.SKIP_BALANCES, Object.keys(C).join("-"), m.data ]); return Eo( I, async () => { const _ = {}, M = Object.keys(C).reduce((v0, B) => { var Ae, le; const $0 = C[B].address; return (le = (Ae = m.data) == null ? void 0 : Ae[B]) == null || le.forEach((x0) => (_[x0.denom] = x0, x0.denom)), v0[B] = { address: $0 }, v0; }, {}), [v, b, a0] = await Promise.all([Jl.getBalances(M), Zh("ethereum-ecosystem"), Zh("cosmos-ecosystem")]), I0 = { ...b, ...a0 }, M0 = []; if (v.success) { const v0 = v.response.chains; return Object.keys(C).forEach((B) => { Object.entries(v0[B].denoms).forEach(([$0, Ae]) => { const le = XC({ chainId: B, denom: $0 }), x0 = _[$0]; if (!x0) return; const ge = I0 ? I0[x0.coingeckoId ?? ""] ?? I0[le] : void 0, z0 = { coin: { denom: $0, amount: Ae.amount }, amount: new xo(Ae.formatted_amount), denomData: { chain: _[$0].chainId, coinDenom: _[$0].symbol, coinDecimals: Ae.decimals, coinMinimalDenom: $0, icon: _[$0].logoUri, coinGeckoId: _[$0].coingeckoId ?? "" }, chainName: "", chainId: B, usdPrice: ge ? new xo(ge) : void 0, usdValue: Ae.value_usd ? new xo(Ae.value_usd) : void 0 }; z0.amount.isZero() || M0.push({ ...z0, isIBC: !1 }); }); }), M0.sort(pg), M0; } else throw new Error(`Failed: ${v.error}`); }, { refreshInterval: 0, revalidateOnFocus: !1, revalidateOnReconnect: !1, revalidateOnMount: !0, dedupingInterval: 1e3, errorRetryCount: 5, errorRetryInterval: 1e3, focusThrottleInterval: 5e3 } ); }, NB = (C, m, I, _, M) => { const { data: v } = k2(), b = Ir(m); return Eo( v ? `${Ho.TRANSACTIONS}:${C}:${I}` : null, async () => { if (!v) throw new Error("Chains not loaded"); const a0 = v.find((I0) => I0.chainId === m); if (!a0) throw new Error("Chain not supported"); return x1(_ ?? b ?? a0.restUrl, C, { pagination: { limit: 100, offset: 0 }, transfer: I }); }, M ); }, yg = 'data:image/svg+xml,<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 20C0 8.95431 8.95431 0 20 0C31.0457 0 40 8.95431 40 20C40 31.0457 31.0457 40 20 40C8.95431 40 0 31.0457 0 20Z" fill="%23383838"/><path d="M10 14C10.55 14 11 13.55 11 13V12C11 11.45 11.45 11 12 11H13C13.55 11 14 10.55 14 10C14 9.45 13.55 9 13 9H12C10.34 9 9 10.34 9 12V13C9 13.55 9.45 14 10 14Z" fill="%23696969"/><path d="M13 29H12C11.45 29 11 28.55 11 28V27C11 26.45 10.55 26 10 26C9.45 26 9 26.45 9 27V28C9 29.66 10.34 31 12 31H13C13.55 31 14 30.55 14 30C14 29.45 13.55 29 13 29Z" fill="%23696969"/><path d="M28 9H27C26.45 9 26 9.45 26 10C26 10.55 26.45 11 27 11H28C28.55 11 29 11.45 29 12V13C29 13.55 29.45 14 30 14C30.55 14 31 13.55 31 13V12C31 10.34 29.66 9 28 9Z" fill="%23696969"/><path d="M30 26C29.45 26 29 26.45 29 27V28C29 28.55 28.55 29 28 29H27C26.45 29 26 29.45 26 30C26 30.55 26.45 31 27 31H28C29.66 31 31 29.66 31 28V27C31 26.45 30.55 26 30 26Z" fill="%23696969"/><path d="M27 22.87V17.13C27 16.41 26.62 15.75 26 15.4L21 12.52C20.69 12.34 20.35 12.25 20 12.25C19.65 12.25 19.31 12.34 19 12.52L14 15.39C13.38 15.75 13 16.41 13 17.13V22.87C13 23.59 13.38 24.25 14 24.6L19 27.48C19.31 27.66 19.65 27.75 20 27.75C20.35 27.75 20.69 27.66 21 27.48L26 24.6C26.62 24.25 27 23.59 27 22.87ZM19 25.17L15 22.87V18.24L19 20.57V25.17ZM20 18.84L16.04 16.53L20 14.25L23.96 16.53L20 18.84ZM25 22.87L21 25.17V20.57L25 18.24V22.87Z" fill="%23696969"/></svg>'; function Bg(C) { return function({ currentTarget: m }) { m.onerror = null, m.src = C; }; } const Z4 = () => /* @__PURE__ */ PA("div", { role: "status", children: [ /* @__PURE__ */ PA( "svg", { "aria-hidden": "true", className: "inline w-8 h-8 text-gray-200 animate-spin dark:text-gray-600 fill-green-500", viewBox: "0 0 100 101", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [ /* @__PURE__ */ De( "path", { d: "M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z", fill: "currentColor" } ), /* @__PURE__ */ De( "path", { d: "M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z", fill: "currentFill" } ) ] } ), /* @__PURE__ */ De("span", { className: "sr-only", children: "Loading..." }) ] }), $4 = ({ title: C }) => /* @__PURE__ */ PA("div", { className: "flex flex-col items-center justify-center mx-2 px-4 gap-6 h-60 bg-card rounded-xl", children: [ /* @__PURE__ */ De("p", { className: "font-bold text-lg", children: C }), "Please check if you're connected to the internet.", /* @__PURE__ */ De( Kn, { onClick: () => { window.location.reload(); }, variant: "outline", size: "xs", style: { color: "black" }, className: "leap-ui text-md font-bold px-4 py-3 rounded-full"