@nexus-cross/dapp-ui 1.3.0 → 1.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 CHANGED
@@ -1,21 +1,21 @@
1
- "use strict";var fl=Object.create;var Vn=Object.defineProperty;var ul=Object.getOwnPropertyDescriptor;var ml=Object.getOwnPropertyNames;var gl=Object.getPrototypeOf,hl=Object.prototype.hasOwnProperty;var bl=(e,t)=>{for(var n in t)Vn(e,n,{get:t[n],enumerable:!0})},Dr=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of ml(t))!hl.call(e,r)&&r!==n&&Vn(e,r,{get:()=>t[r],enumerable:!(o=ul(t,r))||o.enumerable});return e};var O=(e,t,n)=>(n=e!=null?fl(gl(e)):{},Dr(t||!e||!e.__esModule?Vn(n,"default",{value:e,enumerable:!0}):n,e)),wl=e=>Dr(Vn({},"__esModule",{value:!0}),e);var Ld={};bl(Ld,{APPLE_ICON:()=>Hn,AppLauncher:()=>jo,AppLauncherContent:()=>qo,AppLauncherTrigger:()=>Vo,BINANCE_ICON:()=>Wn,BridgeFlow:()=>An,CONNECTOR_REGISTRY:()=>yn,CROSSX_ICON:()=>On,ConnectButton:()=>Nr,ConnectorId:()=>to,DEFAULT_SKILLS_HREF:()=>Bo,GOOGLE_ICON:()=>Dn,METAMASK_ICON:()=>zn,SOCIAL_REGISTRY:()=>Po,SendFlow:()=>Tn,SkillsButton:()=>Tr,TOKEN_STATS_QUERY_KEY:()=>uo,USER_BALANCE_QUERY_KEY:()=>po,WALLET_REGISTRY:()=>Ao,WalletConnectModal:()=>Cr,WalletInfo:()=>on,WalletPortfolio:()=>br,WalletPortfolioBody:()=>Jt,announceAppLauncherUsage:()=>Kn,resolveEnvironment:()=>Ie,useGlobalMenu:()=>vn,useTokenBalance:()=>Zt,useTokenStats:()=>Yt,useWalletDetect:()=>Fn});module.exports=wl(Ld);var xl={};function Hr(e){try{return xl.env?.[e]}catch{return}}function Gr(e){if(!(typeof process>"u"))return process.env?.[e]}function Ie(e){if(e)return Ur(e);let t=Hr("VITE_CROSSX_ENVIRONMENT")??Hr("NEXT_PUBLIC_CROSSX_ENVIRONMENT")??Gr("NEXT_PUBLIC_CROSSX_ENVIRONMENT")??Gr("CROSSX_ENVIRONMENT");return Ur(t)}function Ur(e){switch(e?.toLowerCase()){case"dev":case"development":return"dev";case"stage":case"staging":case"stg":return"stage";default:return"production"}}var Uo="1.3.0";var qn="__nexusCrossAppLauncherRuntime";function vl(){if(typeof window>"u")return null;let e=window;return e[qn]??(e[qn]={mode:"dapp-ui"}),e[qn]}function yl(e){if(e.scheduled)return;e.scheduled=!0;let t=()=>{if(e.scheduled=!1,e.loggedMode!==e.mode){if(e.mode==="connect-kit-react"){let n=e.connectKitVersion??"unknown";console.info(`[CROSSx App Launcher] connect-kit-react v${n} \uCD08\uAE30\uD654 \uC644\uB8CC (dapp-ui v${Uo}, \uC0AC\uC6A9 \uBAA8\uB4DC: connect-kit)`)}else console.info(`[CROSSx App Launcher] dapp-ui v${Uo} \uCD08\uAE30\uD654 \uC644\uB8CC (\uC0AC\uC6A9 \uBAA8\uB4DC: dapp-ui only)`);e.loggedMode=e.mode}};typeof queueMicrotask=="function"?queueMicrotask(t):Promise.resolve().then(t)}function Kn(e){let t=vl();t&&(e?.mode==="connect-kit-react"?t.mode="connect-kit-react":t.mode||(t.mode="dapp-ui"),e?.connectKitVersion&&(t.connectKitVersion=e.connectKitVersion),yl(t))}var ln=O(require("react"),1),$r=O(require("@radix-ui/react-popover"),1),jr=require("vaul");var Qn=require("react"),$o=(0,Qn.createContext)(null);function Zn(){let e=(0,Qn.useContext)($o);if(!e)throw new Error("AppLauncher compound components must be used within <AppLauncher>");return e}var Yn=require("react");function sn(e){let[t,n]=(0,Yn.useState)(!1);return(0,Yn.useEffect)(()=>{let o=window.matchMedia(e);n(o.matches);let r=s=>n(s.matches);return o.addEventListener("change",r),()=>o.removeEventListener("change",r)},[e]),t}function z(e,{insertAt:t}={}){if(!e||typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",t==="top"&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}z(`[data-theme=dark]{--al-bg: var(--ds-surface-default, #1e232e);--al-bg-hover: var(--ds-surface-medium, #252b39);--al-text: var(--ds-content-highest, #ffffff);--al-text-secondary: var(--ds-content-medium, #ffffffa6);--al-border: var(--ds-border-default, #ffffff12);--al-shadow: var(--ds-shadow-modal, 0px 4px 30px -1px rgba(0, 0, 0, .7));--al-badge-bg: var(--ds-accent-primary-low, #123235);--al-badge-text: var(--ds-accent-primary-default, #00ceb2);--al-badge-new-text: var(--ds-system-purple-on, #ffffff);--al-drawer-overlay: var(--ds-overlay-dim, #000000b3)}[data-theme=light]{--al-bg: var(--ds-surface-default, #ffffff);--al-bg-hover: var(--ds-surface-medium, #f5f7fa);--al-text: var(--ds-content-highest, #000000);--al-text-secondary: var(--ds-content-medium, #000000a6);--al-border: var(--ds-border-default, #00000012);--al-shadow: var(--ds-shadow-modal, 0px 4px 30px -1px rgba(0, 0, 0, .15));--al-badge-bg: var(--ds-accent-primary-low, #e7f9f8);--al-badge-text: var(--ds-accent-primary-default, #00b4b7);--al-badge-new-text: var(--ds-system-purple-on, #ffffff);--al-drawer-overlay: var(--ds-overlay-dim, #00000080)}
2
- `);z(`.al-trigger-btn{--at-bg: transparent;--at-bg-hover: #eaedf1;--at-color: var(--ds-content-high, rgba(0, 0, 0, .85));--at-border: none;--at-border-radius: 8px;--at-size: 36px;--at-padding: 0;--at-press-scale: .95;--at-transition: background-color .15s ease;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:var(--at-size);height:var(--at-size);padding:var(--at-padding);border:var(--at-border);background:var(--at-bg);border-radius:var(--at-border-radius);color:var(--at-color);cursor:pointer;transition:var(--at-transition)}.al-trigger-btn:hover,.al-trigger-btn[data-state=open]{background:var(--at-bg-hover)}.al-trigger-btn:active:not(:disabled){background:var(--at-bg-hover);transform:scale(var(--at-press-scale))}.al-trigger-btn[data-theme=dark]{--at-color: var(--ds-content-high, rgba(255, 255, 255, .85));--at-bg-hover: #252b39}.al-trigger-btn[data-theme=light]{--at-color: var(--ds-content-high, rgba(0, 0, 0, .85))}
3
- `);z(`@keyframes al-fade-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}
4
- `);z(`.al-popover-content{-webkit-font-smoothing:antialiased;z-index:100001;border-radius:24px;background:var(--al-bg);border:1px solid var(--al-popover-border, var(--al-border));box-shadow:var(--al-popover-shadow, var(--al-shadow));animation:al-fade-in .15s ease-out;max-height:80vh;overflow-x:hidden;overflow-y:auto;padding:20px 4px;box-sizing:border-box}.al-popover-content .al-grid{grid-template-columns:repeat(4,100px);row-gap:16px;column-gap:0;padding:0;justify-content:center;align-items:start}.al-popover-content .al-grid-item{flex-direction:column;justify-content:flex-start;align-items:center;gap:6px;padding:12px 0;width:100px;min-width:0;border-radius:10px}.al-popover-content .al-grid-item-left{flex-direction:column;align-items:center;gap:8px;width:100%;overflow:visible}.al-popover-content .al-grid-item-icon{width:50px;height:50px;border-radius:10.125px;overflow:hidden}.al-popover-content .al-grid-item-icon img{object-fit:cover}.al-popover-content .al-grid-item-label{font-family:Inter,sans-serif;font-size:12px;font-weight:500;line-height:1.1;letter-spacing:0;text-align:center;color:var(--al-text);max-width:100%;white-space:normal;overflow-wrap:anywhere}.al-popover-content .al-grid-item-right,.al-popover-content .al-badge-new{display:none}.al-drawer-overlay{position:fixed;inset:0;z-index:100000;background:var(--al-drawer-overlay)}.al-drawer-content{-webkit-font-smoothing:antialiased;position:fixed;top:0;right:0;bottom:0;z-index:100001;width:100vw;background:var(--al-bg);overflow-x:hidden;overflow-y:hidden;display:flex;flex-direction:column;box-sizing:border-box}.al-drawer-body{flex:1;overflow-y:auto;overscroll-behavior-y:contain;min-height:0}.al-drawer-content .al-grid{display:flex;flex-direction:column;grid-template-columns:none;max-width:100%;overflow:hidden;flex-shrink:0;gap:0;row-gap:0;column-gap:0;padding:8px 16px}.al-drawer-content .al-grid-item{width:100%;max-width:100%;gap:8px;padding:16px 12px;border-radius:8px;overflow:hidden;background:transparent}.al-drawer-content .al-grid-item:hover,.al-drawer-content .al-grid-item[data-active=true]{background:var(--al-bg-hover)}.al-drawer-content .al-grid-item-left{gap:8px;flex:1 1 auto;min-width:0}.al-drawer-content .al-grid-item-icon{width:32px;height:32px;border-radius:6.75px;overflow:hidden}.al-drawer-content .al-grid-item-icon img{width:100%;height:100%;object-fit:cover;border-radius:6.75px}.al-drawer-content .al-grid-item-label{font-size:16px;line-height:1.35;letter-spacing:0;font-weight:400}.al-drawer-content .al-grid-item[data-active=true] .al-grid-item-label{font-weight:500}.al-drawer-header{display:flex;align-items:center;justify-content:space-between;padding:16px;flex-shrink:0}.al-drawer-title{font-family:Inter,sans-serif;font-size:16px;font-weight:500;line-height:1.5;letter-spacing:0;color:var(--al-text);margin:0}.al-drawer-close{display:inline-flex;align-items:center;justify-content:center;padding:4px;border:none;background:transparent;border-radius:4px;cursor:pointer;color:var(--ds-content-low, #00000066);transition:opacity .15s ease}.al-drawer-close:hover{opacity:.7}.al-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:4px;padding:8px}.al-grid-item{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:16px 12px;border:none;background:var(--al-bg);border-radius:8px;cursor:pointer;transition:none;color:var(--al-text);text-align:left;font-family:Inter,sans-serif;flex-shrink:0}.al-grid-item:hover,.al-grid-item[data-active=true]{background:#252b39!important}:root[data-ds-theme=light] .al-grid-item:hover,:root[data-ds-theme=light] .al-grid-item[data-active=true]{background:#eff3f8!important}.al-grid-item-left{display:flex;align-items:center;gap:8px;min-width:0;overflow:hidden}.al-grid-item-right{display:flex;align-items:center;gap:6px;flex-shrink:0}.al-grid-item-icon{display:flex;align-items:center;justify-content:center;width:24px;height:24px;flex-shrink:0}.al-grid-item-icon img{width:100%;height:100%;object-fit:contain}.al-grid-item-label{font-family:Inter,sans-serif;font-size:16px;font-weight:500;line-height:150%;letter-spacing:0;color:var(--al-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.al-badge{display:flex;padding:1px 4px 2px;justify-content:center;align-items:center;gap:2px;border-radius:3px;background:var(--al-badge-bg);color:var(--al-badge-text);font-family:Pretendard,Inter,sans-serif;font-size:10px;font-weight:600;line-height:150%;letter-spacing:0;white-space:nowrap;flex-shrink:0}.al-badge-new{display:flex;width:16px;height:16px;justify-content:center;align-items:center;aspect-ratio:1/1;border-radius:12px;background:var(--ds-system-purple-high, #7346f3);color:var(--al-badge-new-text);font-family:Pretendard,Inter,sans-serif;font-size:9px;font-weight:700;flex-shrink:0}
5
- `);z("");var Xn=require("react/jsx-runtime");function jo({env:e,theme:t="dark",mobileBreakpoint:n=768,domain:o,children:r}){let s=sn(`(max-width: ${n}px)`),[i,l]=ln.useState(!1),p=ln.useCallback(()=>l(!1),[]),c=Ie(e),f=ln.useMemo(()=>({env:c,theme:t,isMobile:s,open:i,domain:o,close:p}),[c,t,s,i,o,p]);return(0,Xn.jsx)($o.Provider,{value:f,children:s?(0,Xn.jsx)(jr.Drawer.Root,{direction:"right",open:i,onOpenChange:l,noBodyStyles:!0,children:r},"drawer"):(0,Xn.jsx)($r.Root,{open:i,onOpenChange:l,children:r},"popover")})}var Qr=O(require("@radix-ui/react-popover"),1),Zr=require("vaul");var Le=require("react/jsx-runtime");function Vr({size:e=18}){return(0,Le.jsxs)("svg",{className:"al-trigger-icon",width:e,height:e,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,Le.jsx)("rect",{width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Le.jsx)("rect",{x:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Le.jsx)("rect",{x:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Le.jsx)("rect",{y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Le.jsx)("rect",{x:"7",y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Le.jsx)("rect",{x:"14",y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Le.jsx)("rect",{y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Le.jsx)("rect",{x:"7",y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Le.jsx)("rect",{x:"14",y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"})]})}function qr(){return(0,Le.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Le.jsx)("path",{d:"M12 19L5 12M5 12L12 5M5 12H19",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Kr(){return(0,Le.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Le.jsx)("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}var xn=require("react/jsx-runtime");function Vo({asChild:e,children:t,className:n,style:o}){let{isMobile:r,theme:s}=Zn(),i=t!=null,l=e??!0,p=n?`al-trigger-btn ${n}`:"al-trigger-btn",c=i?t:(0,xn.jsx)("button",{type:"button",className:p,"data-theme":s,style:o,children:(0,xn.jsx)(Vr,{size:18})});return r?(0,xn.jsx)(Zr.Drawer.Trigger,{asChild:l,children:c}):(0,xn.jsx)(Qr.Trigger,{asChild:l,children:c})}var jt=O(require("react"),1),Jn=O(require("@radix-ui/react-popover"),1),$t=require("vaul");var Jr=require("@tanstack/react-query");var Yr={dev:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/app-launcher.json",stage:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/app-launcher.json",production:"https://contents.crosstoken.io/frontend/common/app-launcher/app-launcher.json"};var kl="https://stg-contents.crosstoken.io/frontend/common/app-launcher/icons",Sl="https://contents.crosstoken.io/frontend/common/app-launcher/icons";function dt(e,t){return`${e==="production"?Sl:kl}/${t}.png`}function Xr(e){let t=e==="production"?"production":"stage";return{version:"0.0.1-fallback",items:[{id:"gametoken-cross",label:"Gametoken",description:"Trade game tokens easily using CROSS.",url:{dev:"https://dev-x.crosstoken.io/gametoken/CROSS",stage:"https://stg-x.crosstoken.io/gametoken/CROSS",production:"https://x.crosstoken.io/gametoken/CROSS"},iconUrl:dt(t,"dex"),order:1e3,type:"gametoken",badge:null,isNew:!1},{id:"forge",label:"Forge",description:"Launch Your Game, Ignite the Market",url:{dev:"https://stg-x.crosstoken.io/forge",stage:"https://stg-x.crosstoken.io/forge",production:"https://x.crosstoken.io/forge"},iconUrl:dt(t,"forge"),order:4e3,type:"forge",badge:null,isNew:!0},{id:"crossd",label:"Bridge (CROSSD)",description:"The first decentralized exchange on the CROSS network.",url:{dev:"https://stg.crossdefi.io/swap-bridge",stage:"https://stg.crossdefi.io/swap-bridge",production:"https://www.crossdefi.io/swap-bridge"},iconUrl:dt(t,"crossd"),order:5e3,type:"crossd",badge:null,isNew:!1},{id:"prediction",label:"Prediction",description:"Prediction market",url:{dev:"https://stg-prediction.crossdefi.io",stage:"https://stg-prediction.crossdefi.io",production:"https://prediction.crossdefi.io/"},iconUrl:dt(t,"prediction"),order:6e3,type:"prediction",badge:null,isNew:!0},{id:"rewards",label:"Rewards",description:"Deposit CROSS and earn rewards. Grow together.",url:{dev:"https://stg-x.crosstoken.io/rewards",stage:"https://stg-x.crosstoken.io/rewards",production:"https://x.crosstoken.io/rewards"},iconUrl:dt(t,"reward"),order:7e3,type:"rewards",badge:null,isNew:!1},{id:"nft",label:"NFT",description:"Trade and collect NFTs in the CROSS ecosystem.",url:{dev:"https://stg.crossnft.io/",stage:"https://stg.crossnft.io/",production:"https://www.crossnft.io/"},iconUrl:dt(t,"nft"),order:8e3,type:"nft",badge:null,isNew:!1},{id:"play",label:"Play",description:"Discover and play games on CROSS.",url:{dev:"https://stg-play.cross.nexus",stage:"https://stg-play.cross.nexus",production:"https://play.cross.nexus"},iconUrl:dt(t,"play"),order:8500,type:"play",badge:null,isNew:!0},{id:"shop",label:"Shop",description:"Game Payment Platform & In-Game Currency Store.",url:{dev:"https://www.dev.cross.shop/",stage:"https://www.stage.cross.shop/",production:"https://www.cross.shop/"},iconUrl:dt(t,"shop"),order:9e3,type:"shop",badge:null,isNew:!1},{id:"points",label:"Points",description:"Dive into CROSS World, Earn CROSS Points",url:{dev:"https://stg-x.crosstoken.io/points",stage:"https://stg-x.crosstoken.io/points",production:"https://x.crosstoken.io/points"},iconUrl:dt(t,"point"),order:1e4,type:"points",badge:null,isNew:!1},{id:"wave",label:"Wave",description:"Stream, support, and earn in the CROSS ecosystem.",url:{dev:"https://stg-wave.crosstoken.io/en",stage:"https://stg-wave.crosstoken.io/en",production:"https://wave.crosstoken.io/en"},iconUrl:dt(t,"wave"),order:11e4,type:"wave",badge:null,isNew:!1},{id:"explorer",label:"Explorer",description:"View transactions, blocks, and token data on the CROSS network.",url:{dev:"https://stg-explorer.crosstoken.io/612055",stage:"https://stg-explorer.crosstoken.io/612055",production:"https://explorer.crosstoken.io/612055"},iconUrl:dt(t,"explorer"),order:12e3,type:"explorer",badge:null,isNew:!1}]}}function vn(e){let t=Ie(e);return(0,Jr.useQuery)({queryKey:["global-menu",t],queryFn:async({signal:n})=>{try{let o=await fetch(Yr[t],{cache:"no-store",signal:n});if(!o.ok)throw new Error(`Failed to fetch global menu: ${o.status}`);return o.json()}catch(o){if(n.aborted)throw o;return Xr(t)}},staleTime:0,gcTime:0,retry:!1,refetchOnMount:!0})}function X(...e){return e.filter(Boolean).join(" ")}var ae=require("react/jsx-runtime");function Cl(e){return e.id==="cross-staking"||e.type==="cross-staking"}function qo({align:e="end",sideOffset:t=8,className:n}){let{env:o,theme:r,isMobile:s,domain:i,close:l}=Zn(),{data:p}=vn(o),c=jt.useMemo(()=>(p?.items??[]).sort((b,y)=>b.order-y.order),[p]),f=8,g=jt.useRef(null),u=jt.useCallback(b=>{g.current={x:b.clientX,y:b.clientY}},[]),m=typeof window<"u"?window.location.pathname:"",v=jt.useCallback((b,y)=>{if(g.current){let P=b.clientX-g.current.x,T=b.clientY-g.current.y;if(g.current=null,Math.abs(P)>f||Math.abs(T)>f)return}let L=y.url[o]??y.url.production,h=ei(L,i);if(!h)try{let P=new URL(L).pathname;if(m===P||m.startsWith(P+"/")){l();return}}catch{}h?window.open(L,"_blank","noopener,noreferrer"):window.location.href=L,l()},[o,i,l,m]),x=(0,ae.jsx)("div",{className:"al-grid","data-theme":r,children:c.map(b=>{let y=b.url[o]??b.url.production,L=ei(y,i),h=!1;if(!L)try{let P=new URL(y).pathname;h=m===P||m.startsWith(P+"/")}catch{h=!1}return(0,ae.jsxs)("button",{type:"button",className:"al-grid-item","data-active":h||void 0,onPointerDown:u,onClick:P=>v(P,b),children:[(0,ae.jsxs)("div",{className:"al-grid-item-left",children:[(0,ae.jsx)("div",{className:"al-grid-item-icon",children:(0,ae.jsx)("img",{src:b.iconUrl,alt:b.label,width:24,height:24,loading:"lazy"})}),(0,ae.jsx)("span",{className:"al-grid-item-label",children:b.label}),b.isNew&&(0,ae.jsx)("span",{className:"al-badge-new",children:"N"})]}),(0,ae.jsx)("div",{className:"al-grid-item-right",children:b.badge&&!Cl(b)&&(0,ae.jsx)("span",{className:"al-badge",children:b.badge})})]},b.id)})});return s?(0,ae.jsxs)($t.Drawer.Portal,{children:[(0,ae.jsx)($t.Drawer.Overlay,{className:"al-drawer-overlay"}),(0,ae.jsxs)($t.Drawer.Content,{className:X("al-drawer-content",n),"data-theme":r,children:[(0,ae.jsxs)("div",{className:"al-drawer-header",children:[(0,ae.jsx)($t.Drawer.Close,{className:"al-drawer-close",children:(0,ae.jsx)(qr,{})}),(0,ae.jsx)($t.Drawer.Title,{className:"al-drawer-title",children:"CROSS Services"}),(0,ae.jsx)($t.Drawer.Close,{className:"al-drawer-close",children:(0,ae.jsx)(Kr,{})})]}),(0,ae.jsx)("div",{className:"al-drawer-body",children:x})]})]}):(0,ae.jsx)(Jn.Portal,{children:(0,ae.jsx)(Jn.Content,{align:e,sideOffset:t,className:X("al-popover-content",n),"data-theme":r,children:x})})}function ei(e,t){try{let n=new URL(e).hostname;return typeof window>"u"?!0:n!==(t??window.location.hostname)}catch{return!1}}var Fe=O(require("react"),1),Ps=O(require("@radix-ui/react-popover"),1),Bs=require("vaul");var eo=require("react"),Ko=(0,eo.createContext)(null);function Mt(){let e=(0,eo.useContext)(Ko);if(!e)throw new Error("WalletInfo compound components must be used within <WalletInfo>");return e}var to=(o=>(o.CROSSx="crossx",o.MetaMask="io.metamask",o.Binance="com.binance.wallet",o))(to||{}),yn={crossx:{name:"CROSSx",iconUrl:"https://contents.crosstoken.io/wallet/token/images/tCROSS.svg"},"io.metamask":{name:"MetaMask",iconUrl:"https://upload.wikimedia.org/wikipedia/commons/3/36/MetaMask_Fox.svg"},"com.binance.wallet":{name:"Binance Wallet",iconUrl:"https://public.bnbstatic.com/static/images/common/favicon.ico"}};var qi=O(require("react"),1);var W=require("react/jsx-runtime");function ti({size:e=16,className:t}){return(0,W.jsxs)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,W.jsx)("path",{d:"M12.6667 4.66667V2.66667C12.6667 2.48986 12.5964 2.32029 12.4714 2.19526C12.3464 2.07024 12.1768 2 12 2H3.33333C2.97971 2 2.64057 2.14048 2.39052 2.39052C2.14048 2.64057 2 2.97971 2 3.33333C2 3.68696 2.14048 4.02609 2.39052 4.27614C2.64057 4.52619 2.97971 4.66667 3.33333 4.66667H13.3333C13.5101 4.66667 13.6797 4.7369 13.8047 4.86193C13.9298 4.98695 14 5.15652 14 5.33333V8M14 8H12C11.6464 8 11.3072 8.14048 11.0572 8.39052C10.8071 8.64057 10.6667 8.97971 10.6667 9.33333C10.6667 9.68696 10.8071 10.0261 11.0572 10.2761C11.3072 10.5262 11.6464 10.6667 12 10.6667H14C14.1768 10.6667 14.3464 10.5964 14.4714 10.4714C14.5964 10.3464 14.6667 10.1768 14.6667 10V8.66667C14.6667 8.48986 14.5964 8.32029 14.4714 8.19526C14.3464 8.07024 14.1768 8 14 8Z",stroke:"currentColor",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"}),(0,W.jsx)("path",{d:"M2 3.33325V12.6666C2 13.0202 2.14048 13.3593 2.39052 13.6094C2.64057 13.8594 2.97971 13.9999 3.33333 13.9999H13.3333C13.5101 13.9999 13.6797 13.9297 13.8047 13.8047C13.9298 13.6796 14 13.5101 14 13.3333V10.6666",stroke:"currentColor",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Qo({size:e=16,className:t}){return(0,W.jsx)("svg",{width:e,height:e,viewBox:"4 4 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,W.jsx)("path",{d:"M9.40284 17.0647H4.85156V4.84656H17.0697V9.39783H15.4407V6.47565H6.48066V15.4356H9.40284V17.0647ZM21.5192 12.5644H12.5592V21.5244H21.5192V12.5644ZM23.1483 10.9353V23.1535H10.9301V10.9353H23.1483Z",fill:"currentColor"})})}function kn({size:e=16,className:t}){return(0,W.jsx)("svg",{width:e,height:e,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,W.jsx)("path",{d:"M11.6667 3.5L5.25 9.91667L2.33334 7",stroke:"currentColor",strokeWidth:1.16667,strokeLinecap:"round",strokeLinejoin:"round"})})}function vt({size:e=24,className:t}){return(0,W.jsx)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,W.jsx)("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function ni({size:e=20,className:t}){return(0,W.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,W.jsx)("path",{d:"M7.5 17.5H4.167A1.667 1.667 0 012.5 15.833V4.167A1.667 1.667 0 014.167 2.5H7.5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),(0,W.jsx)("path",{d:"M13.333 14.167L17.5 10l-4.167-4.167M17.5 10H7.5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Zo({size:e=20,className:t}){return(0,W.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,children:(0,W.jsx)("path",{d:"M7.91305 10.8327C8.60341 10.8327 9.16305 11.3924 9.16305 12.0827V16.2458C9.16305 16.9361 8.60341 17.4958 7.91305 17.4958H3.75C3.05964 17.4958 2.5 16.9361 2.5 16.2458L2.5 12.0827C2.5 11.3924 3.05964 10.8327 3.75 10.8327H7.91305ZM14.1685 17.4958H12.5027V15.83H14.1685V17.4958ZM17.5 17.4958H15.8342V15.83H17.5V17.4958ZM4.16576 12.4985V15.83H7.49729V12.4985H4.16576ZM12.5027 15.83H10.8369V14.1642H12.5027V15.83ZM15.8342 15.83H14.1685V14.1642H15.8342V15.83ZM14.1685 14.1642H12.5027V12.4985H14.1685V14.1642ZM17.5 14.1642H15.8342V12.4985H17.5V14.1642ZM12.5027 12.4985H10.8369V10.8327H12.5027V12.4985ZM15.8342 12.4985H14.1685V10.8327H15.8342V12.4985ZM7.91305 2.50391C8.60341 2.50391 9.16305 3.06355 9.16305 3.75391V7.91696C9.16305 8.60731 8.60341 9.16696 7.91305 9.16696H3.75C3.05964 9.16696 2.5 8.60731 2.5 7.91696L2.5 3.75391C2.5 3.06355 3.05964 2.50391 3.75 2.50391L7.91305 2.50391ZM16.2419 2.50391C16.9322 2.50391 17.4919 3.06355 17.4919 3.75391V7.91696C17.4919 8.60731 16.9322 9.16696 16.2419 9.16696H12.0788C11.3885 9.16696 10.8288 8.60731 10.8288 7.91696V3.75391C10.8288 3.06355 11.3885 2.50391 12.0788 2.50391L16.2419 2.50391ZM4.16576 4.16967L4.16576 7.50119L7.49729 7.50119L7.49729 4.16967L4.16576 4.16967ZM12.4946 4.16967V7.50119H15.8261V4.16967H12.4946Z",fill:"currentColor",fillOpacity:1})})}function Lt({size:e=20,className:t}){return(0,W.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,W.jsx)("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:1.67,strokeLinecap:"round",strokeLinejoin:"round"})})}function Vt({size:e=20,className:t}){return(0,W.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,W.jsx)("path",{d:"M5 8L10 13L15 8",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function oi({size:e=16,className:t}){return(0,W.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,W.jsx)("path",{d:"M1.667 10S4.167 4.167 10 4.167 18.333 10 18.333 10 15.833 15.833 10 15.833 1.667 10 1.667 10z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),(0,W.jsx)("path",{d:"M10 12.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}function ri({size:e=16,className:t}){return(0,W.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,W.jsx)("path",{d:"M14.95 14.95A8.283 8.283 0 0110 16.667c-5.833 0-8.333-5.833-8.333-5.833a15.238 15.238 0 014.183-4.884m3.267-1.55A7.55 7.55 0 0110 4.167c5.833 0 8.333 5.833 8.333 5.833a15.28 15.28 0 01-1.783 2.633M11.767 11.767a2.5 2.5 0 11-3.534-3.534",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),(0,W.jsx)("path",{d:"M1.667 1.667l16.666 16.666",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}function ii({size:e=42,className:t}){return(0,W.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 42 42",fill:"none",className:t,children:(0,W.jsx)("path",{d:"M20.7314 2C31.0766 2 39.4628 10.3863 39.4629 20.7314C39.4629 31.0766 31.0766 39.4629 20.7314 39.4629C10.3863 39.4628 2 31.0766 2 20.7314C2.00007 10.3864 10.3864 2.00007 20.7314 2ZM20.5938 30.0586L21.1084 30.5732L21.623 30.0586V25.2471H21.1084C20.9344 25.2471 20.7626 25.235 20.5938 25.2158V30.0586ZM16.4834 24.6611L14.6514 26.4922L15.3799 27.2207L17.1797 25.4209L18.3193 24.2803C18.0487 24.0673 17.8025 23.8251 17.5869 23.5566L16.4834 24.6611ZM26.8691 27.2207L27.5967 26.4922L26.3516 25.2471H24.8955L26.8691 27.2207ZM11.2666 20.7314L11.7822 21.2471H16.624C16.6048 21.0781 16.5938 20.9065 16.5938 20.7324C16.5938 20.5585 16.6049 20.3866 16.624 20.2178H11.7812L11.2666 20.7314ZM20.5938 11.4053V16.2471C20.7626 16.2279 20.9345 16.2178 21.1084 16.2178H21.623V11.4053L21.1084 10.8906L20.5938 11.4053ZM14.6514 15.0029L16.4521 16.8027L17.5732 17.9238C17.7874 17.6546 18.0315 17.4104 18.3008 17.1963L15.3799 14.2754L14.6514 15.0029ZM25.0371 16.1074L24.9268 16.2178H26.3818L27.5957 15.0029L26.8682 14.2754L25.0371 16.1074Z",fill:"#019D92",stroke:"white",strokeWidth:4})})}function ai({size:e=20,className:t}){return(0,W.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,W.jsx)("path",{d:"M9.19133 10.8077C9.04905 10.6657 8.87947 10.554 8.69283 10.4792L2.78881 8.11167C2.71832 8.08338 2.65816 8.03421 2.61642 7.97075C2.57468 7.90729 2.55335 7.83258 2.5553 7.75665C2.55724 7.68072 2.58237 7.6072 2.6273 7.54596C2.67224 7.48472 2.73483 7.4387 2.80668 7.41406L16.9525 2.5747C17.0185 2.55087 17.0899 2.54632 17.1583 2.56159C17.2268 2.57685 17.2895 2.6113 17.3391 2.66089C17.3887 2.71049 17.4231 2.77319 17.4384 2.84165C17.4536 2.9101 17.4491 2.9815 17.4253 3.04746L12.5859 17.1933C12.5613 17.2651 12.5152 17.3277 12.454 17.3727C12.3928 17.4176 12.3192 17.4427 12.2433 17.4447C12.1674 17.4466 12.0927 17.4253 12.0292 17.3835C11.9658 17.3418 11.9166 17.2817 11.8883 17.2112L9.52073 11.3056C9.44567 11.1191 9.33362 10.9498 9.19133 10.8077ZM9.19133 10.8077L17.3367 2.66404",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})})}function si({size:e=20,className:t}){return(0,W.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,W.jsx)("path",{d:"M10.8333 14.1667V7.5M15 14.1667V4.16667M2.5 2.5V15.8333C2.5 16.2754 2.67559 16.6993 2.98816 17.0118C3.30072 17.3244 3.72464 17.5 4.16667 17.5H17.5M6.66667 14.1667V11.6667",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})})}function li({size:e=20,className:t}){return(0,W.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,W.jsx)("path",{d:"M6.6665 9.99984H13.3332M9.99984 6.6665V13.3332M18.3332 9.99984C18.3332 14.6022 14.6022 18.3332 9.99984 18.3332C5.39746 18.3332 1.6665 14.6022 1.6665 9.99984C1.6665 5.39746 5.39746 1.6665 9.99984 1.6665C14.6022 1.6665 18.3332 5.39746 18.3332 9.99984Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})})}function ci({size:e=20,className:t}){return(0,W.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,W.jsx)("path",{d:"M6.667 2.5 3.333 5.833 6.667 9.167M3.333 5.833h13.334M13.333 17.5l3.334-3.333-3.334-3.334M16.667 14.167H3.333",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})})}function di({size:e=20,className:t}){return(0,W.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,W.jsx)("circle",{cx:"10",cy:"10",r:"10",fill:"currentColor"}),(0,W.jsx)("path",{d:"M6 10.2L8.6 12.8L14 7.2",stroke:"var(--ds-accent-primary-on, #ffffff)",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round"})]})}var E=O(require("react"),1);var _t=O(require("bignumber.js"),1);function Nl(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===48;)t--;return t>0&&e.charCodeAt(t-1)===46&&t--,e.slice(0,t)}function Ot(e,t){if(!e||e==="0")return"0.00";let n=new _t.default(e).shiftedBy(-t),o=n.isGreaterThanOrEqualTo(1)?2:4;return n.toFormat(o,_t.default.ROUND_DOWN)}function Ze(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}function Yo(e){let t=typeof e=="string"?parseFloat(e):e;if(Number.isNaN(t)||t===0)return"$0.00";let n=t>=1?2:4,o=Math.pow(10,n);return`$${(Math.floor(t*o)/o).toLocaleString("en-US",{minimumFractionDigits:n,maximumFractionDigits:n})}`}function pi(e,t,n){let r=new _t.default(e).shiftedBy(-t).multipliedBy(new _t.default(n));return r.isZero()||r.isNaN()?"$0.00":`$${(r.integerValue(_t.default.ROUND_DOWN).isGreaterThanOrEqualTo(1)?r.decimalPlaces(2,_t.default.ROUND_DOWN):r.decimalPlaces(4,_t.default.ROUND_DOWN)).toFormat()}`}function fi(e){if(e===""||e===null||e===void 0)return{displayValue:"0",isLowerBound:!1};let t=typeof e=="number"?e.toString():e;if(t==="0"||t==="0.0")return{displayValue:"0",isLowerBound:!1};let n=t;if(n.includes("e")||n.includes("E")){let i=Number(n);if(!Number.isFinite(i)||i===0)return{displayValue:"0",isLowerBound:!1};n=Nl(i.toFixed(18))}let[o="0",r=""]=n.split(".");if(Number(o)>=1){let i=r.slice(0,2).padEnd(2,"0");return{displayValue:`${Number(o).toLocaleString("en-US")}.${i}`,isLowerBound:!1}}return r.length<4?{displayValue:`${o}.${r}`,isLowerBound:!1}:r.slice(0,4)==="0000"?{displayValue:"0.0001",isLowerBound:!0}:{displayValue:`0.${r.slice(0,4)}`,isLowerBound:!1}}var ui=require("react"),mi=require("@tanstack/react-query");var at={dev:"https://stg-wallet-server.crosstoken.io/api",stage:"https://stg-wallet-server.crosstoken.io/api",production:"https://wallet-server.crosstoken.io/api"},ze={dev:{cross:612044,bsc:97},stage:{cross:612044,bsc:97},production:{cross:612055,bsc:56}};var Tl="send:chain-info";function Rl(e){if("data"in e&&e.data!==void 0){let t=e.data;if(Array.isArray(t)){let n=t[0];if(!n)throw new Error("Chain info payload is empty.");return n}return t}return e}function Xo(e,...t){let n=e.replace(/\/+$/,""),o=t.map(r=>r.replace(/^\/+|\/+$/g,"")).filter(Boolean);return[n,...o].join("/")}function Il(e,t,n,o){if(o)return t===ze[e].cross?gi(t,o):n?.explorer_url?Xo(n.explorer_url,n.explorer_postfix?.transaction??"tx",o):Ll(e,t,o)}function gi(e,t){return Xo("https://explorer.crosstoken.io",String(e),"tx",t)}function Ll(e,t,n){let o=ze[e];if(t===o.cross)return gi(t,n);if(t===o.bsc)return Xo(e==="production"?"https://bscscan.com":"https://testnet.bscscan.com","tx",n)}function no(e,t,n,o=!0){let r=at[e],s=(0,mi.useQuery)({queryKey:[Tl,e,t],queryFn:async({signal:p})=>{let c=await fetch(`${r}/v1/public/chain/info/${t}`,{cache:"no-store",signal:p});if(!c.ok)throw new Error(`Failed to fetch chain info: ${c.status}`);let f=await c.json();if("code"in f&&f.code!==void 0&&f.code!==200)throw new Error(`Chain info API error: ${f.code}`);return Rl(f)},enabled:o,staleTime:300*1e3}),i=s.data;return{transactionUrl:(0,ui.useMemo)(()=>Il(e,t,i,n),[t,i,e,n]),chainInfo:i,...s}}var hi="0x0000000000000000000000000000000000000001";var El="0xa9059cbb",Al=/^0x[a-fA-F0-9]{40}$/,Pl="nexus-cross:dapp-ui:send:recent:",bi=10;function Bl(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===48;)t--;return e.slice(0,t)}function Sn(e){return e.toLowerCase()}function yt(e){return Al.test(e)}function dn(e){return Sn(e.address)===hi}function Jo(e){return`${Pl}${e.toLowerCase()}`}function cn(e){if(typeof window>"u")return[];try{let t=window.localStorage.getItem(Jo(e));if(!t)return[];let n=JSON.parse(t);return Array.isArray(n)?n.filter(o=>o!==null&&typeof o=="object"&&yt(o.address)&&typeof o.updatedAt=="number").slice(0,bi):[]}catch{return[]}}function er(e,t){if(typeof window>"u")return[];let n=Sn(t),o=[{address:n,updatedAt:Date.now()},...cn(e).filter(r=>r.address!==n)].slice(0,bi);try{window.localStorage.setItem(Jo(e),JSON.stringify(o))}catch{return cn(e)}return o}function tr(e){if(!(typeof window>"u"))try{window.localStorage.removeItem(Jo(e))}catch{}}function qt(e,t){let n=e.trim();if(!n)return{error:"Enter an amount."};if(!/^\d+(\.\d*)?$/.test(n))return{error:"Enter a valid amount."};let[o="0",r=""]=n.split(".");if(r.length>t)return{error:`Max ${t} decimal places.`};let s=BigInt(o||"0"),i=r.padEnd(t,"0"),l=i?BigInt(i):0n,p=10n**BigInt(t),c=s*p+l;return c<=0n?{error:"Amount must be greater than 0."}:{value:c}}function Cn(e,t){let n=BigInt(e||"0"),o=10n**BigInt(t),r=n/o,s=n%o;if(s===0n)return r.toString();let i=Bl(s.toString().padStart(t,"0"));return`${r.toString()}.${i}`}function nr(e,t){let n=e.replace(/^0x/,"").toLowerCase().padStart(64,"0"),o=t.toString(16).padStart(64,"0");return`${El}${n}${o}`}function wi(e,t=0){if(t>4||e===null||e===void 0)return"";if(typeof e=="string")return e.toLowerCase();if(typeof e!="object")return"";let n=e,o=[];return typeof n.name=="string"&&o.push(n.name),typeof n.shortMessage=="string"&&o.push(n.shortMessage),typeof n.message=="string"&&o.push(n.message),typeof n.details=="string"&&o.push(n.details),n.cause!==void 0&&o.push(wi(n.cause,t+1)),o.join(`
6
- `).toLowerCase()}function Fl(e){if(e instanceof Error)return e.message;if(typeof e=="string")return e;if(e&&typeof e=="object"){let t=e;if(typeof t.shortMessage=="string")return t.shortMessage;if(typeof t.message=="string")return t.message}return""}function or(e,t={},n="Failed to send transaction."){let o=wi(e);if(!o)return n;let r=t.nativeSymbol?.trim()||"gas token",s=t.networkName?.trim();if(o.includes("user rejected")||o.includes("userrejected")||o.includes("user denied")||o.includes("user cancelled")||o.includes("user canceled")||o.includes("action_rejected")||o.includes("rejected by user"))return"Transaction was cancelled.";if(o.includes("insufficientfunds")||o.includes("insufficient funds")||o.includes("exceeds the balance of the account")||o.includes("insufficient balance for transfer")){let i=s?` on ${s}`:"";return`Not enough ${r} to cover the gas fee.Please top up your ${r} balance and try again.`}return o.includes("transaction underpriced")||o.includes("replacement transaction underpriced")||o.includes("fee too low")?"Gas fee was too low for the network. Please try again.":o.includes("nonce too low")||o.includes("nonce has already been used")||o.includes("nonce too high")?"Pending transactions are out of order. Refresh the page and try again.":o.includes("execution reverted")||o.includes("contractfunctionrevertederror")||o.includes("contractfunctionexecutionerror")?"The transaction was rejected by the contract. The recipient or token may be invalid.":o.match(/chain \d+ is not configured/)?"This network is not registered in the app. Contact support.":o.includes("http request failed")||o.includes("failed to fetch")||o.includes("network request failed")||o.includes("timeout")||o.includes("econnreset")||o.includes("rpc error")||o.includes("429")?"Network connection failed. Check your internet and try again.":o.includes("estimategas")||o.includes("gas estimation failed")?"Could not estimate the gas fee. The recipient address or amount may be invalid.":Fl(e)||n}var Ml=2000000000n,_l=1000000000n;async function oo(e,t,n){let o=new AbortController,r=setTimeout(()=>o.abort(),8e3),s=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:t,params:n}),signal:o.signal}).finally(()=>clearTimeout(r));if(!s.ok)throw new Error(`RPC ${t} HTTP ${s.status}`);let i=await s.json();if(i.error)throw new Error(`RPC ${t}: ${i.error.message}`);if(i.result===void 0)throw new Error(`RPC ${t}: empty result`);return i.result}function ro(e){return BigInt(e)}function Ol(e){return`0x${e.toString(16)}`}function zl(e){let t={to:e.to};return e.from&&(t.from=e.from),e.value!==void 0&&e.value>0n&&(t.value=Ol(e.value)),e.data&&(t.data=e.data),t}function Wl(e){return e===56||e===97}async function xi(e){try{let t=await oo(e,"eth_gasPrice",[]);return{gasPrice:ro(t)}}catch{return{gasPrice:Ml}}}async function Dl(e,t){let n=_l;try{let o=await oo(e,"eth_maxPriorityFeePerGas",[]);n=ro(o)}catch{}return{maxFeePerGas:t+n,maxPriorityFeePerGas:n}}async function Hl(e,t){if(t)return xi(e);let n;try{n=(await oo(e,"eth_getBlockByNumber",["latest",!1]))?.baseFeePerGas}catch{}return n?Dl(e,ro(n)):xi(e)}async function vi(e,t){let n=Wl(t.chainId),o=zl(t),[r,s]=await Promise.all([oo(e,"eth_estimateGas",[o]),Hl(e,n)]);return{gasLimit:ro(r),gasPrice:s.gasPrice,maxFeePerGas:s.maxFeePerGas,maxPriorityFeePerGas:s.maxPriorityFeePerGas}}function yi(e){let{estimateGas:t,sendTransaction:n,getTransactionReceipt:o}=e;return{canSend:!!n,canEstimateGas(r){return!!t||!!r},async estimateGas(r,s){if(t)return t(r);if(s)return vi(s,r);throw new Error("Gas estimation is not available.")},async sendTransaction(r){if(!n)throw new Error("Sending is not available for this wallet.");return n(r)},getTransactionReceipt:o}}var Gl=1500,Ul=120;function ki(e){return!!(e.token||e.recipient||e.amount)}function rr({recipient:e,amount:t,token:n,balanceRaw:o}){let r={},s=e.trim(),i=qt(t,n.quantity.decimals),l;return s?yt(s)||(r.recipient="Enter a valid EVM recipient address."):r.recipient="Enter a recipient address.","error"in i?r.amount=i.error:(l=i.value,l>o&&(r.amount="Amount exceeds available balance.")),!dn(n)&&!yt(n.address)&&(r.token="Token contract address is invalid."),{errors:r,rawAmount:r.amount?void 0:l,recipient:s&&yt(s)?s:void 0}}function ir({token:e,walletAddress:t,recipient:n,rawAmount:o}){let r=t;return dn(e)?{to:n,value:o,chainId:e.chainId,from:r}:{to:Sn(e.address),data:nr(n,o),value:0n,chainId:e.chainId,from:r}}function $l(e){let{status:t}=e;return t==="reverted"||t==="0x0"||t===0||t===0n||t===!1}var jl=e=>new Promise(t=>setTimeout(t,e));async function Si({repository:e,args:t,chainId:n,onSubmitted:o,pollIntervalMs:r=Gl,pollMaxAttempts:s=Ul}){let i=await e.sendTransaction(t);o(i);let{getTransactionReceipt:l}=e;if(!l)return"success";for(let p=0;p<s;p+=1){let c=await l({hash:i,chainId:n}).catch(()=>null);if(c)return $l(c)?"reverted":"success";await jl(r)}return"timeout"}var Ci=["token","recipient","amount","review"];function Ni(e){let{env:t,walletAddress:n,accountName:o,accounts:r=[],initialStep:s="recipient",token:i,tokens:l=[],onTokenChange:p,sendTransaction:c,getTransactionReceipt:f,estimateGas:g,getTokenPriceUsd:u,onSubmitted:m,onSuccess:v,onFailed:x,onExit:b,onOutlink:y}=e,L=E.useMemo(()=>yi({sendTransaction:c,getTransactionReceipt:f,estimateGas:g}),[c,f,g]),[h,P]=E.useState(i);E.useEffect(()=>{P(i)},[i.address,i.chainId]);let[T,B]=E.useState(s),[R,$]=E.useState(""),[G,ee]=E.useState(""),[V,D]=E.useState({}),[he,ye]=E.useState("idle"),[fe,ue]=E.useState(""),[De,ie]=E.useState(""),[j,ne]=E.useState(null),[Te,te]=E.useState(!1),[He,Ge]=E.useState(""),Re=E.useRef(0),[Ee,gt]=E.useState(null),[be,Nt]=E.useState(""),[Je,et]=E.useState(()=>cn(n)),Ae=E.useMemo(()=>Ie(t),[t]),{transactionUrl:Me,chainInfo:ke}=no(Ae,h.chainId,fe||void 0,!0),pe=ke?.currency_symbol??"",Se=ke?.name??`Chain ID ${h.chainId}`,Tt=E.useRef({nativeSymbol:pe||void 0,networkName:Se,tokenSymbol:h.symbol});Tt.current={nativeSymbol:pe||void 0,networkName:Se,tokenSymbol:h.symbol};let tt=E.useMemo(()=>BigInt(h.quantity.numeric||"0"),[h.quantity.numeric]),ht=E.useMemo(()=>Ot(h.quantity.numeric,h.quantity.decimals),[h.quantity.numeric,h.quantity.decimals]),Ce=u?.(h),Ue=E.useMemo(()=>{if(Ce===void 0)return;let C=parseFloat(G.replace(/,/g,""));return Number.isFinite(C)?C*Ce:0},[G,Ce]);E.useEffect(()=>{ee(""),D({})},[h.address,h.chainId]),E.useEffect(()=>{Re.current+=1,ne(null),Ge(""),te(!1)},[h.address,h.chainId,R,G]),E.useEffect(()=>{et(cn(n))},[n]);let bt=E.useCallback(C=>{$(C),D(q=>({...q,recipient:void 0}))},[]),_e=E.useCallback(C=>{ee(C),D(q=>({...q,amount:void 0}))},[]),nt=E.useCallback(()=>{ee(Cn(h.quantity.numeric,h.quantity.decimals)),D(C=>({...C,amount:void 0}))},[h.quantity.numeric,h.quantity.decimals]),ot=E.useCallback(C=>{P(C),p?.(C),B("recipient")},[p]),$e=E.useCallback(()=>B("token"),[]),we=E.useCallback(()=>{B(C=>{if(C==="result")return"review";if(C===s)return b?.(),C;let q=Ci.indexOf(C);return q<=0?(b?.(),C):Ci[q-1]})},[s,b]),je=E.useCallback(()=>{let{errors:C}=rr({recipient:R,amount:"1",token:h,balanceRaw:tt});if(C.recipient){D(q=>({...q,recipient:C.recipient}));return}D(q=>({...q,recipient:void 0})),B("amount")},[R,h,tt]),lt=E.useCallback(C=>{$(C),D(q=>({...q,recipient:void 0})),B("amount")},[]),wt=E.useCallback(()=>{let C=rr({recipient:R,amount:G,token:h,balanceRaw:tt});D(C.errors),!(ki(C.errors)||C.rawAmount===void 0||!C.recipient)&&(gt(C.rawAmount),Nt(C.recipient),ne(null),Ge(""),ye("idle"),B("review"))},[R,G,h,tt]);E.useEffect(()=>{if(T!=="review"||!be||Ee===null||j!==null||Te||He||!L.canEstimateGas(ke?.rpc))return;let C=++Re.current;te(!0),Ge(""),(async()=>{try{let q=ir({token:h,walletAddress:n,recipient:be,rawAmount:Ee}),re=await L.estimateGas(q,ke?.rpc);if(Re.current!==C)return;ne(re)}catch(q){if(Re.current!==C)return;Ge(or(q,Tt.current,"Failed to estimate gas."))}finally{Re.current===C&&te(!1)}})()},[T,be,Ee,j,Te,He,L,ke?.rpc,h,n]);let Ve=E.useCallback(async()=>{if(!(!be||Ee===null)){ie(""),ue(""),ye("submitting");try{let C="",q=await Si({repository:L,args:ir({token:h,walletAddress:n,recipient:be,rawAmount:Ee}),chainId:h.chainId,onSubmitted:re=>{C=re,ue(re),ye("confirming"),et(er(n,be)),m?.({txHash:re,chainId:h.chainId,amount:G,tokenSymbol:h.symbol,recipient:be})}});if(q==="success")ye("success"),C&&v?v?.(C):B("result");else if(q==="reverted"){let re="Transaction reverted on-chain.";ye("error"),ie(re),C&&x?x({txHash:C,chainId:h.chainId,message:re}):B("result")}else{let re="Transaction receipt was not found. Please check again later.";ye("error"),ie(re),C&&x?x({txHash:C,chainId:h.chainId,message:re}):B("result")}}catch(C){ye("error"),ie(or(C,{nativeSymbol:pe||void 0,networkName:Se,tokenSymbol:h.symbol})),B("result")}}},[L,be,Ee,h,G,n,m,v,x,pe,Se]),[Rt,It]=E.useState(!1),rt=E.useRef(void 0);E.useEffect(()=>()=>clearTimeout(rt.current),[]);let xt=E.useCallback(async()=>{if(fe)try{await navigator.clipboard.writeText(fe),It(!0),clearTimeout(rt.current),rt.current=setTimeout(()=>It(!1),2e3)}catch{}},[fe]),Oe=E.useCallback(()=>{if(!Me||!fe)return;let C=qe=>{typeof window<"u"&&window.open(qe,"_blank","noopener,noreferrer")};if(!y){C(Me);return}let q=y(Me,{category:"send",origin:"send-transaction",payload:{chainId:h.chainId,txHash:fe}});if(q&&typeof q.then=="function"){let qe=typeof window<"u"?window.open("","_blank","noopener,noreferrer"):null;q.then(Ke=>{if(Ke===null){qe?.close();return}let Bt=Ke??Me;if(qe)try{qe.location.href=Bt}catch{qe.close(),C(Bt)}else C(Bt)});return}let re=q;re!==null&&C(re??Me)},[y,h.chainId,Me,fe]),ct=E.useCallback(()=>{ie(""),ue(""),ye("idle"),ne(null),Ge(""),B("review")},[]);return{step:T,status:he,token:h,tokens:l.length>0?l:[h],recipient:R,amount:G,amountUsd:Ue,fieldErrors:V,error:De,txHash:fe,gasEstimate:j,gasLoading:Te,gasError:He,reviewRawAmount:Ee,reviewRecipient:be,recentAddresses:Je,accounts:r,accountName:o,walletAddress:n,resolvedEnv:Ae,transactionUrl:Me,networkName:Se,nativeSymbol:pe,nativeDecimals:ke?.currency_decimals??h.quantity.decimals,balanceRaw:tt,balanceText:ht,priceUsd:Ce,canSelectToken:(l.length>0?l:[h]).length>1,canSend:L.canSend,getTokenPriceUsd:u,setRecipient:bt,setAmount:_e,setMax:nt,selectToken:ot,goToTokenSelect:$e,selectRecipient:lt,submitRecipient:je,submitAmount:wt,confirmSend:Ve,retry:ct,back:we,hashCopied:Rt,copyHash:xt,openTransaction:Oe}}var pt=O(require("react"),1);function io(e,t,n=10){if(t<=0)return e.toString();let o=10n**BigInt(t),r=e/o,s=e%o;if(s===0n)return r.toString();let l=s.toString().padStart(t,"0").slice(0,Math.max(0,Math.min(n,t)));return l=l.replace(/0+$/,""),l?`${r.toString()}.${l}`:r.toString()}function ar(e,t){return io(e,t,6)}function Ti(e){return io(e,9,2)}function Ri(e){return e.toLocaleString("en-US")}function Ii(e){return e===56||e===97}function ao(e){return e.gasPrice??e.maxFeePerGas}function Li(e,t=!1){return t?ao(e)!==void 0?"legacy":null:e.maxFeePerGas!==void 0?"dynamic":e.gasPrice!==void 0?"legacy":null}function Ei(e,t=!1){if(t){let n=ao(e);return n!==void 0?e.gasLimit*n:null}return e.maxFeePerGas!==void 0?e.gasLimit*e.maxFeePerGas:e.gasPrice!==void 0?e.gasLimit*e.gasPrice:null}function so(e){return!Number.isFinite(e)||e<=0?"$0.00":`$${e.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}var kt=require("react/jsx-runtime");function Ai({flow:e}){let{amount:t,setAmount:n,amountUsd:o,balanceText:r,balanceRaw:s,token:i,setMax:l}=e,p=pt.useRef(null),c=pt.useCallback(()=>{requestAnimationFrame(()=>{let x=p.current;if(!x)return;let b=x.value.length;x.setSelectionRange(b,b)})},[]);pt.useEffect(()=>{p.current?.focus(),c()},[c]),pt.useEffect(()=>{t===""&&(u(!1),c())},[t,c]);let f=pt.useMemo(()=>{let x=qt(t,i.quantity.decimals);return"value"in x&&x.value>s},[t,i.quantity.decimals,s]),[g,u]=pt.useState(!1),m=!g&&t===""?"0.00":t,v=t.trim()===""||t.trim()==="0";return(0,kt.jsx)("div",{className:"sf-body sf-amount",children:(0,kt.jsxs)("div",{className:"sf-amount-center",children:[(0,kt.jsx)("span",{className:"sf-amount-usd",children:o!==void 0?so(o):"\xA0"}),(0,kt.jsx)("div",{className:"sf-amount-input-wrap","data-over":f||void 0,"data-empty":v||void 0,onClick:()=>p.current?.focus(),children:(0,kt.jsx)("input",{ref:p,className:"sf-amount-input",value:m,onChange:x=>{let b=x.target.value;if(g)n(b);else if(t===""){if(b.length<4)return;u(!0);let y=b.startsWith("0.00")?b.slice(4):b;n(y)}else u(!0),n(b)},placeholder:"0.00",inputMode:"decimal",autoComplete:"off","aria-label":`Amount in ${i.symbol}`,size:1})}),(0,kt.jsxs)("div",{className:"sf-amount-balance",children:[(0,kt.jsx)("span",{children:"Balance:"}),(0,kt.jsxs)("button",{type:"button",className:"sf-amount-max",onClick:l,children:[r," ",i.symbol]})]})]})})}var ft=O(require("react"),1);var sr={dev:"https://stg-bonding-curve-api.crosstoken.io/api",stage:"https://stg-bonding-curve-api.crosstoken.io/api",production:"https://bonding-curve-api.crosstoken.io/api"},Pi={cross:"https://contents.crosstoken.io/wallet/token/images/CROSS.svg",bsc:"https://contents.crosstoken.io/wallet/token/images/BSC.svg"};function Nn(e,t){let n=ze[e];if(t===n.cross)return Pi.cross;if(t===n.bsc)return Pi.bsc}var Vl={dev:"https://dev-portrait.crosstoken.io",stage:"https://dev-portrait.crosstoken.io",production:"https://portrait.crosstoken.io"};function Kt(e,t,n={}){if(!t||!t.startsWith("0x"))return;let{size:o=120,bg:r,format:s="png"}=n,i=Vl[e],l=r?`&bg=${r}`:"";return`${i}/portrait/evm/${t}.${s}?size=${o}${l}`}var ve=require("react/jsx-runtime");function Bi({size:e=20,className:t}){return(0,ve.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,"aria-hidden":"true",children:[(0,ve.jsx)("circle",{cx:"9",cy:"9",r:"6",stroke:"currentColor",strokeWidth:"1.7"}),(0,ve.jsx)("path",{d:"m17 17-3.2-3.2",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function Fi({size:e=20,className:t}){return(0,ve.jsx)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",className:t,"aria-hidden":"true",children:(0,ve.jsx)("path",{d:"M9 2h6a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1zM8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2h-2M12 11v6M9 14h6",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"})})}function Mi({size:e=20,className:t}){return(0,ve.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,"aria-hidden":"true",children:[(0,ve.jsx)("circle",{cx:"10",cy:"10",r:"10",fill:"currentColor",opacity:"0.12"}),(0,ve.jsx)("path",{d:"M7 7l6 6M13 7l-6 6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})]})}function _i({size:e=16,className:t}){return(0,ve.jsx)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",className:t,"aria-hidden":"true",children:(0,ve.jsx)("path",{d:"M8 3v10m0 0 4-4m-4 4-4-4",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function Oi({size:e=56,className:t}){return(0,ve.jsxs)("svg",{width:e,height:e,viewBox:"0 0 56 56",fill:"none",className:t,"aria-hidden":"true",children:[(0,ve.jsx)("circle",{cx:"28",cy:"28",r:"28",fill:"var(--ds-accent-primary-default, #00b4b7)"}),(0,ve.jsx)("path",{d:"M17 28.5 24.2 35.5 39 20.5",stroke:"var(--ds-accent-primary-on, #ffffff)",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})]})}function zi({size:e=56,className:t}){return(0,ve.jsxs)("svg",{width:e,height:e,viewBox:"0 0 56 56",fill:"none",className:t,"aria-hidden":"true",children:[(0,ve.jsx)("circle",{cx:"28",cy:"28",r:"28",fill:"var(--ds-system-red-default, #da0b2e)"}),(0,ve.jsx)("path",{d:"M20 20 36 36m0-16L20 36",stroke:"#ffffff",strokeWidth:"4",strokeLinecap:"round"})]})}var Q=require("react/jsx-runtime");function Wi(e,t){return e.name||`Account ${(e.index??t)+1}`}function Di(e){return e.trim().slice(0,1).toUpperCase()||"A"}function Hi(e){return e.toLowerCase()}function Gi({flow:e}){let{recipient:t,setRecipient:n,fieldErrors:o,recentAddresses:r,accounts:s,walletAddress:i,resolvedEnv:l,selectRecipient:p}=e,c=ft.useMemo(()=>s.filter(h=>h.address.toLowerCase()!==i.toLowerCase()),[s,i]),f=c.length>0,g=ft.useMemo(()=>new Map(c.map((h,P)=>[Hi(h.address),{account:h,index:P}])),[c]),[u,m]=ft.useState("recent"),v=ft.useRef(null);ft.useEffect(()=>{v.current?.focus()},[]);let x="1A1A2E",b=ft.useCallback(async()=>{try{let h=await navigator.clipboard.readText();h&&n(h.trim())}catch{}},[n]),y=t.trim().length>0,L=yt(t.trim());return(0,Q.jsxs)("div",{className:"sf-recipient",children:[(0,Q.jsxs)("div",{className:"sf-recipient-top",children:[(0,Q.jsxs)("div",{className:"sf-address-field","data-filled":y||void 0,"data-invalid":o.recipient||void 0,children:[(0,Q.jsx)("textarea",{ref:v,className:"sf-address-input",value:t,onChange:h=>n(h.target.value),placeholder:"Enter the recipient's address",autoComplete:"off",spellCheck:!1,"aria-label":"Recipient address",rows:y?2:1}),y?(0,Q.jsx)("button",{type:"button",className:"sf-address-action",onClick:()=>n(""),"aria-label":"Clear",children:(0,Q.jsx)(Mi,{size:20})}):(0,Q.jsx)("button",{type:"button",className:"sf-address-action",onClick:b,"aria-label":"Paste from clipboard",children:(0,Q.jsx)(Fi,{size:20})})]}),o.recipient&&(0,Q.jsx)("p",{className:"sf-field-error",role:"alert",children:o.recipient}),(0,Q.jsxs)("div",{className:"sf-tabs",role:"tablist",children:[(0,Q.jsx)("button",{type:"button",role:"tab",className:"sf-tab","data-active":u==="recent"||void 0,"aria-selected":u==="recent",onClick:()=>m("recent"),children:"Recent"}),f&&(0,Q.jsx)("button",{type:"button",role:"tab",className:"sf-tab","data-active":u==="account"||void 0,"aria-selected":u==="account",onClick:()=>m("account"),children:"My Account"})]})]}),(0,Q.jsx)("div",{className:"sf-address-list",children:u==="account"&&f?c.map((h,P)=>{let T=Wi(h,P),B=Kt(l,h.address,{size:56,bg:x});return(0,Q.jsxs)("button",{type:"button",className:"sf-address-row",onClick:()=>p(h.address),children:[(0,Q.jsxs)("span",{className:"sf-address-avatar",children:[B&&(0,Q.jsx)("img",{src:B,alt:"",width:40,height:40,draggable:!1,onError:R=>{R.currentTarget.style.display="none"}}),(0,Q.jsx)("span",{className:"sf-address-avatar-fallback",children:Di(T)})]}),(0,Q.jsxs)("span",{className:"sf-address-meta",children:[(0,Q.jsx)("span",{className:"sf-address-name",children:T}),(0,Q.jsx)("span",{className:"sf-address-value",children:Ze(h.address)})]})]},h.address)}):r.length>0?r.map(h=>{let P=g.get(Hi(h.address)),T=P?Wi(P.account,P.index):Ze(h.address),B=Kt(l,h.address,{size:56,bg:x});return(0,Q.jsxs)("button",{type:"button",className:"sf-address-row",onClick:()=>p(h.address),children:[(0,Q.jsxs)("span",{className:"sf-address-avatar",children:[B&&(0,Q.jsx)("img",{src:B,alt:"",width:40,height:40,draggable:!1,onError:R=>{R.currentTarget.style.display="none"}}),(0,Q.jsx)("span",{className:"sf-address-avatar-fallback",children:Di(T)})]}),(0,Q.jsxs)("span",{className:"sf-address-meta",children:[(0,Q.jsx)("span",{className:"sf-address-name",children:T}),(0,Q.jsx)("span",{className:"sf-address-value",children:Ze(h.address)})]})]},h.address)}):(0,Q.jsx)("div",{className:"sf-empty",children:"No send history"})}),y&&!L&&!o.recipient&&(0,Q.jsx)("p",{className:"sf-field-error",role:"alert",children:"Enter a valid EVM recipient address."})]})}var se=require("react/jsx-runtime");function $i({flow:e}){let{status:t,txHash:n,error:o,copyHash:r,hashCopied:s,openTransaction:i}=e,l=t==="error",p=t==="success";return l?(0,se.jsxs)("div",{className:"sf-body sf-result sf-result--error",children:[(0,se.jsx)("span",{className:"sf-result-icon",children:(0,se.jsx)(zi,{size:56})}),(0,se.jsxs)("div",{className:"sf-result-copy",children:[(0,se.jsx)("h3",{className:"sf-result-title",children:"Transaction Failed"}),(0,se.jsx)("p",{className:"sf-result-desc",children:o||"Something went wrong. Please try again."})]}),n&&(0,se.jsx)(Ui,{txHash:n,hashCopied:s,onCopy:r,onOpen:i})]}):(0,se.jsxs)("div",{className:"sf-body sf-result",children:[(0,se.jsx)("span",{className:"sf-result-icon","data-pending":!p||void 0,children:p?(0,se.jsx)(Oi,{size:56}):(0,se.jsx)("span",{className:"sf-result-spinner"})}),(0,se.jsxs)("div",{className:"sf-result-copy",children:[(0,se.jsx)("h3",{className:"sf-result-title",children:p?"Transaction Complete":"Transaction in Progress"}),(0,se.jsx)("p",{className:"sf-result-desc",children:p?"Your transfer was sent successfully.":"Transfer in progress. Waiting for confirmation."})]}),n&&(0,se.jsx)(Ui,{txHash:n,hashCopied:s,onCopy:r,onOpen:i})]})}function Ui({txHash:e,hashCopied:t,onCopy:n,onOpen:o}){return(0,se.jsxs)("div",{className:"sf-result-hash-card",children:[(0,se.jsx)("span",{className:"sf-result-hash-label",children:"Transaction Hash"}),(0,se.jsxs)("div",{className:"sf-result-hash-row",children:[(0,se.jsx)("button",{type:"button",className:"sf-result-hash-link",onClick:o,"aria-label":"Open transaction in explorer",children:Ze(e)}),(0,se.jsx)("button",{type:"button",className:"sf-result-copy-btn",onClick:n,"aria-label":"Copy transaction hash",children:t?(0,se.jsx)(kn,{size:16}):"Copy"})]})]})}var U=require("react/jsx-runtime"),lo="\u2014";function ji({flow:e}){let{token:t,reviewRawAmount:n,reviewRecipient:o,accountName:r,accounts:s,walletAddress:i,networkName:l,nativeSymbol:p,nativeDecimals:c,gasEstimate:f,gasLoading:g,gasError:u,error:m,resolvedEnv:v}=e,x=dn(t),b=n!==null?io(n,t.quantity.decimals):"",y=r?.trim()||`Account ${(s[0]?.index??0)+1}`,L=Kt(v,i,{size:56,bg:"1A1A2E"}),h=p||(x?t.symbol:""),P=Ii(t.chainId),T=f?Li(f,P):null,B=f?Ei(f,P):null,R=D=>D!==null&&h?`${ar(D,c)} ${h}`:lo,$=D=>D!==void 0?`${Ti(D)} Gwei`:lo,G=(()=>{if(!x||!f||B===null||n===null)return lo;let D=n+B;return`${ar(D,c)} ${h||t.symbol}`})(),ee=D=>g?"\u2026":D,V=[{label:"Est. Tx Fee",value:ee(R(B))},...T==="dynamic"?[{label:"Max Priority Fee",value:ee($(f?.maxPriorityFeePerGas))},{label:"Max Gas Fee",value:ee($(f?.maxFeePerGas))}]:T==="legacy"?[{label:"Gas Price",value:ee($(f?ao(f):void 0))}]:[],{label:"Gas Limit",value:ee(f?Ri(f.gasLimit):lo)}];return(0,U.jsxs)("div",{className:"sf-body sf-review",children:[(0,U.jsxs)("div",{className:"sf-review-amount",children:[(0,U.jsx)("img",{className:"sf-review-amount-icon",src:t.icon_url,alt:"",width:40,height:40,draggable:!1,onError:D=>{D.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),(0,U.jsxs)("span",{className:"sf-review-amount-value",children:[b,(0,U.jsx)("span",{className:"sf-review-amount-symbol",children:t.symbol})]})]}),(0,U.jsxs)("div",{className:"sf-review-parties",children:[(0,U.jsxs)("div",{className:"sf-review-card sf-review-party",children:[(0,U.jsx)("span",{className:"sf-review-party-label",children:"From"}),(0,U.jsxs)("div",{className:"sf-review-party-head",children:[(0,U.jsx)("span",{className:"sf-review-party-avatar",children:L&&(0,U.jsx)("img",{src:L,alt:"",width:28,height:28,draggable:!1,onError:D=>{D.currentTarget.style.display="none"}})}),(0,U.jsx)("span",{className:"sf-review-party-name",children:y})]}),(0,U.jsx)("span",{className:"sf-review-party-addr",children:i})]}),(0,U.jsx)("span",{className:"sf-review-arrow","aria-hidden":!0,children:(0,U.jsx)(_i,{size:16})}),(0,U.jsxs)("div",{className:"sf-review-card sf-review-party",children:[(0,U.jsx)("span",{className:"sf-review-party-label",children:"To"}),(0,U.jsx)("span",{className:"sf-review-party-addr",children:o})]})]}),(0,U.jsxs)("section",{className:"sf-review-card",children:[(0,U.jsx)("h3",{className:"sf-review-section-title",children:"Summary"}),(0,U.jsxs)("div",{className:"sf-review-row",children:[(0,U.jsx)("span",{className:"sf-review-row-label",children:"Network"}),(0,U.jsx)("span",{className:"sf-review-row-value",children:l})]}),V.map(D=>(0,U.jsxs)("div",{className:"sf-review-row",children:[(0,U.jsx)("span",{className:"sf-review-row-label",children:D.label}),(0,U.jsx)("span",{className:"sf-review-row-value",children:D.value})]},D.label))]}),(0,U.jsxs)("section",{className:"sf-review-card",children:[(0,U.jsx)("h3",{className:"sf-review-section-title",children:"Total"}),(0,U.jsxs)("div",{className:"sf-review-row",children:[(0,U.jsx)("span",{className:"sf-review-row-label",children:"Total Amount"}),(0,U.jsxs)("span",{className:"sf-review-row-value",children:[b," ",t.symbol]})]}),x&&(0,U.jsxs)("div",{className:"sf-review-row",children:[(0,U.jsx)("span",{className:"sf-review-row-label",children:"Max. Total Amount"}),(0,U.jsx)("span",{className:"sf-review-row-value",children:ee(G)})]})]}),(u||m)&&(0,U.jsx)("div",{className:"sf-message sf-message--error",role:"alert",children:u||m})]})}var co=O(require("react"),1);var Ne=require("react/jsx-runtime");function Vi({flow:e}){let[t,n]=co.useState(""),o=t.trim().toLowerCase(),r=co.useMemo(()=>o?e.tokens.filter(s=>s.symbol.toLowerCase().includes(o)||s.name.toLowerCase().includes(o)):e.tokens,[e.tokens,o]);return(0,Ne.jsxs)("div",{className:"sf-body sf-token-select",children:[(0,Ne.jsxs)("div",{className:"sf-search",children:[(0,Ne.jsx)(Bi,{size:20}),(0,Ne.jsx)("input",{className:"sf-search-input",value:t,onChange:s=>n(s.target.value),placeholder:"Search Tokens",autoComplete:"off",spellCheck:!1,"aria-label":"Search tokens"})]}),(0,Ne.jsxs)("div",{className:"sf-token-list",children:[r.map(s=>{let i=`${s.chainId}:${s.address.toLowerCase()}`,l=Nn(e.resolvedEnv,s.chainId),p=e.getTokenPriceUsd?.(s);return(0,Ne.jsxs)("button",{type:"button",className:"sf-token-row",onClick:()=>e.selectToken(s),children:[(0,Ne.jsxs)("span",{className:"sf-token-left",children:[(0,Ne.jsxs)("span",{className:"sf-token-icon-wrap",children:[(0,Ne.jsx)("img",{className:"sf-token-icon",src:s.icon_url,alt:"",width:40,height:40,loading:"lazy",draggable:!1,onError:c=>{c.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),l&&(0,Ne.jsx)("img",{className:"sf-token-chain-badge",src:l,alt:"","aria-hidden":!0,width:16,height:16,loading:"lazy",draggable:!1,onError:c=>{c.currentTarget.style.display="none"}})]}),(0,Ne.jsx)("span",{className:"sf-token-name",children:s.symbol})]}),(0,Ne.jsxs)("span",{className:"sf-token-right",children:[(0,Ne.jsx)("span",{className:"sf-token-balance",children:Ot(s.quantity.numeric,s.quantity.decimals)}),p!==void 0&&(0,Ne.jsx)("span",{className:"sf-token-price",children:so(p)})]})]},i)}),r.length===0&&(0,Ne.jsx)("div",{className:"sf-empty",children:"No tokens found"})]})]})}z(`.sf-root{display:flex;flex-direction:column;flex:1;min-height:0;font-family:inherit}.sf-header{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:24px;flex-shrink:0;position:relative;border-bottom:1px solid var(--ds-border-default, rgba(0, 0, 0, .07))}.sf-header .sf-header-btn:last-child{position:absolute;top:24px;right:24px}.sf-header-btn{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;flex-shrink:0;padding:0;border:none;background:transparent;color:var(--ds-content-low, rgba(0, 0, 0, .4));cursor:pointer;filter:none;transition:color .15s ease}.sf-header-btn:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85));filter:none}.sf-header-title{position:absolute;left:50%;transform:translate(-50%);text-align:center;font-family:inherit;font-size:18px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-highest, #000000);pointer-events:none}.sf-body{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.15) transparent;overscroll-behavior:contain}[data-theme=light] .sf-body{scrollbar-color:rgba(0,0,0,.12) transparent}.sf-body::-webkit-scrollbar{width:4px;height:4px}.sf-body::-webkit-scrollbar-track,.sf-body::-webkit-scrollbar-corner{background:transparent}.sf-body::-webkit-scrollbar-thumb{border-radius:4px;background:#ffffff26}.sf-body::-webkit-scrollbar-thumb:hover{background:#ffffff40}[data-theme=light] .sf-body::-webkit-scrollbar-thumb{background:#0000001f}[data-theme=light] .sf-body::-webkit-scrollbar-thumb:hover{background:#0003}.sf-empty{padding:32px 0;text-align:center;font-family:inherit;font-size:14px;color:var(--ds-content-low, rgba(0, 0, 0, .4))}.sf-field-error{margin:8px 24px 0;font-family:inherit;font-size:12px;line-height:1.5;color:var(--ds-system-red-default, #da0b2e)}.sf-message--error{margin:16px 0 0;padding:12px 16px;background:var(--ds-system-red-low, #ffeeee);color:var(--ds-system-red-high, #d20609);font-family:inherit;font-size:13px;line-height:1.5;border-radius:12px;width:100%;box-sizing:border-box}.sf-footer{display:flex;flex-shrink:0;padding:16px 24px 24px}.sf-footer:empty{display:none}.sf-footer-row{display:flex;gap:8px;width:100%}.sf-footer-row .sf-btn,.sf-footer-row .sf-btn--secondary{flex:1 1 0;min-width:0}.sf-footer>.sf-btn{width:100%}.sf-btn{appearance:none;display:inline-flex;align-items:center;justify-content:center;flex:1;height:48px;padding:0 24px;border:none;border-radius:12px;font-family:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer;transition:background-color .15s ease,transform .1s ease}.sf-btn--primary{background:var(--ds-accent-primary-default, #00b4b7);color:var(--ds-accent-primary-on, #ffffff)}.sf-btn--primary:hover:not(:disabled):not([data-disabled]){background:var(--ds-accent-primary-high, #00a0a2)}.sf-btn--primary:active:not(:disabled):not([data-disabled]){transform:scale(.97)}.sf-btn--primary[data-disabled],.sf-btn--primary:disabled{background:var(--ds-accent-primary-default, #00b4b7);color:var(--ds-accent-primary-on, #ffffff);cursor:default;opacity:.5}.sf-btn--secondary{flex:0 0 120px;background:var(--ds-surface-default, #ffffff);border:1px solid var(--ds-border-default, rgba(0, 0, 0, .07));color:var(--ds-content-high, rgba(0, 0, 0, .85))}.sf-token-select{padding:0;display:flex;flex-direction:column}.sf-token-select .sf-search{margin:16px 24px}.sf-token-select .sf-token-list{width:100%;margin-top:0}.sf-search{display:flex;align-items:center;gap:8px;padding:12px 16px;border-radius:12px;border:1.5px solid transparent;background:var(--ds-surface-medium, #f5f7fa);color:var(--ds-content-low, rgba(0, 0, 0, .4));box-sizing:border-box;transition:border-color .15s ease}.sf-search:hover{border-color:var(--ds-border-medium, rgba(0, 0, 0, .18))}.sf-search:focus-within{border-color:var(--ds-accent-primary-default, #00b4b7)}.sf-search-input{flex:1;min-width:0;border:none;background:transparent;outline:none;font-family:inherit;font-size:16px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85))}.sf-search-input::placeholder{color:var(--ds-content-low, rgba(0, 0, 0, .4))}.sf-token-list{display:flex;flex-direction:column;margin-top:8px}.sf-token-row{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;padding:12px 24px;border:none;background:transparent;cursor:pointer;text-align:left;font-family:inherit;border-radius:0;box-sizing:border-box;transition:background-color .15s ease}.sf-token-row:hover{background:var(--ds-surface-medium, rgba(0, 0, 0, .04))}.sf-token-left{display:flex;align-items:center;gap:16px;min-width:0}.sf-token-icon-wrap{position:relative;width:40px;height:40px;flex-shrink:0}.sf-token-icon{width:40px;height:40px;border-radius:0;object-fit:contain}.sf-token-chain-badge{position:absolute;right:-2px;bottom:-2px;width:16px;height:16px;border-radius:50%;object-fit:cover}.sf-token-name{font-family:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));white-space:nowrap}.sf-token-right{display:flex;flex-direction:column;align-items:flex-end;flex-shrink:0}.sf-token-balance{font-family:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-highest, #000000);white-space:nowrap}.sf-token-price{font-family:inherit;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4));white-space:nowrap}.sf-recipient{display:flex;flex-direction:column;flex:1;min-height:0}.sf-recipient-top{display:flex;flex-direction:column;padding:16px 24px 0}.sf-address-field{display:flex;align-items:center;gap:8px;padding:12px;border-radius:12px;border:1.5px solid transparent;background:var(--ds-surface-medium, #f5f7fa);transition:border-color .15s ease;box-sizing:border-box}.sf-address-field:hover{border-color:var(--ds-border-medium, rgba(0, 0, 0, .18))}.sf-address-field:focus-within{border-color:var(--ds-accent-primary-default, #00b4b7)}.sf-address-field[data-filled]{border-color:var(--ds-accent-primary-default, #00b4b7)}.sf-address-field[data-invalid]{border-color:var(--ds-system-red-default, #da0b2e)}.sf-address-input{flex:1;min-width:0;border:none;background:transparent;outline:none;resize:none;overflow:hidden;font-family:inherit;font-size:16px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));word-break:break-word;overflow-wrap:anywhere}.sf-address-input::placeholder{color:var(--ds-content-low, rgba(0, 0, 0, .4))}.sf-address-action{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;flex-shrink:0;padding:0;border:none;background:transparent;border-radius:6px;color:var(--ds-content-low, rgba(0, 0, 0, .4));cursor:pointer;transition:color .15s ease}.sf-address-action:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.sf-address-field[data-filled] .sf-address-action{border-radius:9999px}.sf-tabs{display:flex;gap:0;margin:16px 0 0}.sf-tab{position:relative;padding:8px 12px;border:none;background:transparent;cursor:pointer;font-family:inherit;font-size:16px;font-weight:600;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4))}.sf-tab[data-active]{color:var(--ds-accent-primary-high, #00a0a2)}.sf-tab[data-active]:after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:3px;border-radius:9999px;background:var(--ds-accent-primary-high, #00a0a2)}.sf-address-list{display:flex;flex-direction:column;width:100%;margin-top:8px}.sf-address-row{display:flex;align-items:center;gap:16px;width:100%;padding:12px 24px;border:none;background:transparent;cursor:pointer;text-align:left;font-family:inherit;border-radius:0;box-sizing:border-box;transition:background-color .15s ease}.sf-address-row:hover{background:var(--ds-surface-medium, rgba(0, 0, 0, .04))}.sf-address-avatar{position:relative;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;flex-shrink:0;border-radius:50%;overflow:hidden;background:var(--ds-surface-high, #edf1f2);color:var(--ds-content-medium, rgba(0, 0, 0, .65));font-size:14px;font-weight:600}.sf-address-avatar img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}.sf-address-avatar-fallback{position:relative;z-index:0}.sf-address-meta{display:flex;flex-direction:column;min-width:0}.sf-address-name{font-family:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sf-address-value{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4))}.wi-drawer-content .sf-header{padding:16px}.wi-drawer-content .sf-header .sf-header-btn:last-child{top:16px;right:16px}.wi-drawer-content .sf-token-select{padding:0}.wi-drawer-content .sf-token-select .sf-search{margin:16px}.wi-drawer-content .sf-token-row{padding:12px 16px}.wi-drawer-content .sf-recipient-top{padding:16px 16px 0}.wi-drawer-content .sf-address-row{padding:12px 16px}.wi-drawer-content .sf-footer{padding:12px 16px 24px}.wi-drawer-content .sf-field-error,.wi-drawer-content .sf-message--error{margin:16px 0 0;width:auto}.sf-amount{display:flex;flex-direction:column}.sf-amount-center{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:8px;padding:64px 24px 48px;text-align:center}.sf-amount-usd{font-family:inherit;font-size:14px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4));min-height:21px}.sf-amount-input-wrap{display:flex;justify-content:center;max-width:100%}.sf-amount-input{width:auto;max-width:100%;border:none;background:transparent;outline:none;text-align:center;font-family:inherit;font-size:40px;font-weight:700;line-height:1.25;letter-spacing:-.01em;color:var(--ds-content-highest, #000000);field-sizing:content}.sf-amount-input-wrap[data-empty] .sf-amount-input,.sf-amount-input::placeholder{color:var(--ds-content-low, rgba(0, 0, 0, .4))}.sf-amount-input-wrap[data-over] .sf-amount-input{color:var(--ds-system-red-default, #da0b2e)}.sf-amount-balance{display:inline-flex;align-items:center;gap:4px;font-family:inherit;font-size:14px;font-weight:400;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4))}.sf-amount-max{border:none;background:transparent;padding:0;cursor:pointer;font:inherit;color:var(--ds-content-medium, rgba(0, 0, 0, .65));text-decoration:underline;text-underline-offset:2px;transition:color .15s ease}.sf-amount-max:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-drawer-content .sf-amount-center{padding:64px 16px 48px}.sf-review{display:flex;flex-direction:column;gap:16px;padding:24px}.sf-review-amount{display:flex;align-items:center;gap:12px;padding:0;background:transparent}.sf-review-amount-icon{width:40px;height:40px;border-radius:0;object-fit:contain;flex-shrink:0}.sf-review-amount-value{display:inline-flex;flex-direction:column;align-items:flex-start;gap:0;font-family:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-highest, #000000);word-break:break-all}.sf-review-amount-symbol{font-size:12px;font-weight:400;line-height:1.5;color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.sf-review-parties{position:relative;display:flex;flex-direction:column;gap:0}.sf-review-arrow{position:relative;z-index:1;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;margin:-4px auto;border-radius:50%;background:var(--ds-surface-default, #ffffff);border:1px solid var(--ds-border-medium, rgba(0, 0, 0, .18));color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.sf-review-card{display:flex;flex-direction:column;gap:8px;padding:16px;border-radius:12px;background:var(--ds-surface-medium, #f5f7fa)}.sf-review-party-label{font-family:inherit;font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.sf-review-party-head{display:flex;align-items:center;gap:8px}.sf-review-party-avatar{display:inline-flex;width:24px;height:24px;border-radius:50%;overflow:hidden;background:var(--ds-surface-high, #edf1f2);flex-shrink:0}.sf-review-party-avatar img{width:100%;height:100%;object-fit:cover}.sf-review-party-name{font-family:inherit;font-size:14px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85))}.sf-review-party-addr{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:12px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65));word-break:break-all}.sf-review-section-title{margin:0 0 4px;font-family:inherit;font-size:16px;font-weight:600;letter-spacing:-.01em;color:var(--ds-content-highest, #000000)}.sf-review-row{display:flex;flex-direction:column;align-items:flex-start;gap:4px}.sf-review-row-label{font-family:inherit;font-size:12px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.sf-review-row-value{font-family:inherit;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));text-align:left;word-break:break-all}.wi-drawer-content .sf-review{padding:16px}.sf-result{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:20px;padding:48px 24px;text-align:center}.sf-result-icon{display:inline-flex;align-items:center;justify-content:center;width:56px;height:56px}.sf-result-spinner{width:56px;height:56px;border-radius:50%;border:4px solid var(--ds-border-medium, rgba(0, 0, 0, .18));border-top-color:var(--ds-accent-primary-default, #00b4b7);animation:sf-spin .8s linear infinite}@keyframes sf-spin{to{transform:rotate(360deg)}}.sf-result-copy{display:flex;flex-direction:column;gap:8px}.sf-result-title{margin:0;font-family:inherit;font-size:18px;font-weight:600;letter-spacing:-.01em;color:var(--ds-content-highest, #000000)}.sf-result-desc{margin:0;font-family:inherit;font-size:14px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.sf-result-hash-card{display:flex;flex-direction:column;gap:8px;width:100%;padding:16px;border-radius:12px;background:var(--ds-surface-medium, #f5f7fa);text-align:left}.sf-result-hash-label{font-family:inherit;font-size:12px;font-weight:500;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.sf-result-hash-row{display:flex;align-items:center;justify-content:space-between;gap:8px}.sf-result-hash-link{border:none;background:transparent;padding:0;cursor:pointer;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:14px;color:var(--ds-accent-primary-high, #00a0a2)}.sf-result-copy-btn{display:inline-flex;align-items:center;justify-content:center;min-width:44px;height:28px;padding:0 10px;border:1px solid var(--ds-border-default, rgba(0, 0, 0, .07));border-radius:8px;background:var(--ds-surface-default, #ffffff);cursor:pointer;font-family:inherit;font-size:12px;font-weight:500;color:var(--ds-content-high, rgba(0, 0, 0, .85))}
7
- `);var le=require("react/jsx-runtime"),ql={token:"Send",recipient:"Send",amount:"Send",review:"Sign Transaction",result:""};function Tn({onClose:e,onBackToWallet:t,onConfirmSuccess:n,onSuccess:o,className:r,...s}){let i=qi.useCallback(y=>{o?.(y),n?.(y)},[n,o]),p=Ni({...s,onSuccess:o||n?i:void 0,onExit:t}),{step:c,status:f}=p,g=yt(p.recipient.trim()),u=qt(p.amount,p.token.quantity.decimals),m="value"in u&&u.value<=p.balanceRaw,v=f==="submitting"||f==="confirming",x=c!=="result",b=ql[c]??"";return(0,le.jsxs)("div",{className:X("sf-root",r),"data-step":c,children:[(0,le.jsxs)("header",{className:"sf-header",children:[x?(0,le.jsx)("button",{type:"button",className:"sf-header-btn",onClick:p.back,"aria-label":"Back",children:(0,le.jsx)(Lt,{size:24})}):(0,le.jsx)("span",{className:"sf-header-btn","aria-hidden":!0}),(0,le.jsx)("span",{className:"sf-header-title",children:b}),(0,le.jsx)("button",{type:"button",className:"sf-header-btn",onClick:e,"aria-label":"Close",children:(0,le.jsx)(vt,{size:24})})]}),c==="token"&&(0,le.jsx)(Vi,{flow:p}),c==="recipient"&&(0,le.jsx)(Gi,{flow:p}),c==="amount"&&(0,le.jsx)(Ai,{flow:p}),c==="review"&&(0,le.jsx)(ji,{flow:p}),c==="result"&&(0,le.jsx)($i,{flow:p}),(0,le.jsxs)("footer",{className:"sf-footer","data-step":c,children:[c==="recipient"&&(0,le.jsx)("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:p.submitRecipient,"data-disabled":!g||void 0,"aria-disabled":!g,children:"Next"}),c==="amount"&&(0,le.jsx)("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:p.submitAmount,"data-disabled":!m||void 0,"aria-disabled":!m,children:"Next"}),c==="review"&&(0,le.jsxs)("div",{className:"sf-footer-row",children:[(0,le.jsx)("button",{type:"button",className:"sf-btn sf-btn--secondary",onClick:p.back,disabled:v,children:"Cancel"}),(0,le.jsx)("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:p.confirmSend,disabled:v||!p.canSend,children:v?"Sending...":"Send"})]}),c==="result"&&f==="success"&&(0,le.jsx)("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:()=>n?.(p.txHash||void 0),children:"All done"}),c==="result"&&f==="error"&&(0,le.jsx)("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:p.retry,children:"Try Again"})]})]})}var Ki=O(require("@radix-ui/react-popover"),1),Qi=require("vaul");var Qt=require("react/jsx-runtime");function Zi({asChild:e,className:t,children:n}){let{isMobile:o,theme:r,walletAddress:s}=Mt(),i=n!=null,l=e??!0,p=i?n:(0,Qt.jsxs)("button",{type:"button",className:X("wi-trigger-btn",t),"data-theme":r,"data-mobile":o||void 0,children:[(0,Qt.jsx)(ti,{size:o?14:16}),(0,Qt.jsx)("span",{className:"wi-trigger-address",children:Ze(s)})]});return o?(0,Qt.jsx)(Qi.Drawer.Trigger,{asChild:l,children:p}):(0,Qt.jsx)(Ki.Trigger,{asChild:l,children:p})}var A=O(require("react"),1),To=O(require("@radix-ui/react-popover"),1),Pn=require("vaul");var gn=O(require("bignumber.js"),1);var Yi=require("@tanstack/react-query"),Xi=require("react");var po="user-balance";async function Kl(e,t,n,o){let r=new URLSearchParams({networkId:`eip155:${t}`,account:n}),s=await fetch(`${e}/v1/public/token/balance?${r}`,{cache:"no-store",signal:o});if(!s.ok)throw new Error(`Failed to fetch token balance: ${s.status}`);let i=await s.json();if(i.code!==200)throw new Error(`Token balance API error: ${i.code}`);return i.data}function Zt(e,t,n=!0){let o=at[e],r=ze[e],s=[r.cross,r.bsc],i=(0,Yi.useQueries)({queries:s.map(f=>({queryKey:[po,e,t,f],queryFn:({signal:g})=>Kl(o,f,t,g),enabled:!!t&&n,staleTime:0,refetchInterval:n?5e3:!1}))}),l=i.some(f=>f.isLoading),p=i.some(f=>f.isError);return{tokens:(0,Xi.useMemo)(()=>{let f=[];for(let g of i)g.data&&f.push(...g.data);return f},[i]),isLoading:l,isError:p}}var fo=require("@tanstack/react-query"),Ji=require("react");var Ql="forge-holdings",Zl="forge-token-image";async function Yl(e,t,n){let o=await fetch(`${e}/v1/users/${t}/holdings`,{cache:"no-store",signal:n});if(!o.ok)throw new Error(`Failed to fetch forge holdings: ${o.status}`);let r=await o.json();if(!r.success)throw new Error("Forge holdings API error");return r.data.items}async function Xl(e,t,n){let o=await fetch(`${e}/v1/tokens/${t}`,{cache:"no-store",signal:n});if(!o.ok)return{address:t,image_url:""};let r=await o.json();return r.success?{address:t,image_url:r.data.token.image_url}:{address:t,image_url:""}}function ea(e,t,n=!0){let o=sr[e],{data:r,...s}=(0,fo.useQuery)({queryKey:[Ql,e,t],queryFn:({signal:i})=>Yl(o,t,i),enabled:!!t&&n,staleTime:0,refetchInterval:n?5e3:!1});return{holdings:r??[],...s}}function ta(e,t,n=!0){let o=sr[e],r=(0,fo.useQueries)({queries:t.map(i=>({queryKey:[Zl,e,i],queryFn:({signal:l})=>Xl(o,i,l),enabled:n,staleTime:1/0}))});return{imageMap:(0,Ji.useMemo)(()=>{let i=new Map;for(let l of r)l.data&&i.set(l.data.address,l.data.image_url);return i},[r])}}var na=require("@tanstack/react-query"),oa=require("react");var uo="token-stats";function Et(e,t){return`${e}:${t.toLowerCase()}`}function Yt(e,t=!0){let n=at[e],{data:o,...r}=(0,na.useQuery)({queryKey:[uo,e],queryFn:async({signal:i})=>{let l=await fetch(`${n}/v1/public/token/stats`,{cache:"no-store",signal:i});if(!l.ok)throw new Error(`Failed to fetch token stats: ${l.status}`);let p=await l.json();if(p.code!==200)throw new Error(`Token stats API error: ${p.code}`);return p},enabled:t,staleTime:3e4});return{statsMap:(0,oa.useMemo)(()=>{let i=new Map;if(!o?.data)return i;for(let l of o.data){let p=Et(l.chain_id,l.address);i.set(p,l)}return i},[o]),...r}}var ra=require("@tanstack/react-query"),ia=require("react");var Jl="token-info";function lr(e,t){return`${t.toLowerCase()}_${e}`}function aa(e,t=!0){let n=at[e],{data:o,...r}=(0,ra.useQuery)({queryKey:[Jl,e],queryFn:async({signal:i})=>{let l=await fetch(`${n}/v1/public/token/info`,{cache:"no-store",signal:i});if(!l.ok)throw new Error(`Failed to fetch token info: ${l.status}`);let p=await l.json();if(p.code!==200)throw new Error(`Token info API error: ${p.code}`);return p},enabled:t,staleTime:1/0});return{categoryMap:(0,ia.useMemo)(()=>{let i=new Map;if(!o?.data)return i;for(let l of o.data){let p=lr(l.chain_id,l.address);i.set(p,l.category)}return i},[o]),...r}}var sa=require("react"),mo=O(require("bignumber.js"),1);function la(e,t,n){let{tokens:o,isLoading:r}=Zt(e,t,n),{statsMap:s}=Yt(e,n);return(0,sa.useMemo)(()=>{let i=new mo.default(0);for(let f of o){let g=s.get(Et(f.chainId,f.address));if(!g)continue;let m=new mo.default(f.quantity.numeric).shiftedBy(-f.quantity.decimals).multipliedBy(new mo.default(g.price));m.isNaN()||(i=i.plus(m))}let l=i.toFixed(),{displayValue:p,isLowerBound:c}=fi(l);return{totalUsd:l,displayValue:p,isLowerBound:c,isLoading:r}},[o,s,r])}var Ts=require("qrcode.react");function Ye(e,t,n,o){if(!o||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.defaultPrevented)return;e.preventDefault();let r;try{r=o(t,n)}catch(c){console.error("[dapp-ui] onOutlink threw:",c);return}let s=c=>{typeof window>"u"||window.open(c,"_blank","noopener,noreferrer")};if((c=>!!c&&(typeof c=="object"||typeof c=="function")&&typeof c.then=="function")(r)){let c=typeof window<"u"?window.open("","_blank","noopener,noreferrer"):null,f=g=>{if(g===null){c?.close();return}let u=g??t;if(c)try{c.location.href=u}catch{c.close(),s(u)}else s(u)};r.then(f,g=>{console.error("[dapp-ui] onOutlink rejected:",g),c?.close()});return}let l=r;if(l===null)return;s(l??t)}var tn=O(require("react"),1),ts=require("vaul");var go=require("react"),Rn=(0,go.createContext)(null);function st(){let e=(0,go.useContext)(Rn);if(!e)throw new Error("WalletPortfolio compound components must be used within <WalletPortfolio>");return e}var ca=require("vaul");var cr=require("react/jsx-runtime");function da({asChild:e,children:t}){let{walletAddress:n}=st(),o=t!=null,r=e??!0,s=o?t:(0,cr.jsx)("button",{type:"button",children:Ze(n)});return(0,cr.jsx)(ca.Drawer.Trigger,{asChild:r,children:s})}var Ln=require("vaul");var Xe=O(require("react"),1),Ja=require("@tanstack/react-query");var ya=require("react"),vo=O(require("bignumber.js"),1);var ha=require("@tanstack/react-query"),dr=require("react");var ho={dev:"https://stg-cross-game-reward-api.crosstoken.io/api",stage:"https://stg-cross-game-reward-api.crosstoken.io/api",production:"https://cross-game-reward-api.crosstoken.io/api"},pa={dev:"https://stg-x.crosstoken.io",stage:"https://stg-x.crosstoken.io",production:"https://x.crosstoken.io"},bo={dev:"https://stg-bonding-curve-api.crosstoken.io/api",stage:"https://stg-bonding-curve-api.crosstoken.io/api",production:"https://bonding-curve-api.crosstoken.io/api"},fa={dev:"https://stg-x.crosstoken.io",stage:"https://stg-x.crosstoken.io",production:"https://x.crosstoken.io"},pn={dev:"https://stg-posa-api.crosstoken.io/api/v1",stage:"https://stg-posa-api.crosstoken.io/api/v1",production:"https://posa-api.crosstoken.io/api/v1"},In={dev:"https://dev-stake.ogfcorp.com",stage:"https://stg-stake.ogfcorp.com",production:"https://stake.ogfcorp.com"},ua={dev:`${In.dev}/portfolio`,stage:`${In.stage}/portfolio`,production:`${In.production}/portfolio`},ma={dev:"https://stg-game-swap-api.cross.nexus/v1",stage:"https://stg-game-swap-api.cross.nexus/v1",production:"https://game-swap-api.cross.nexus/v1"},ga={dev:"https://stg-x.crosstoken.io",stage:"https://stg-x.crosstoken.io",production:"https://x.crosstoken.io"},zt={dev:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/icons",stage:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/icons",production:"https://contents.crosstoken.io/frontend/common/app-launcher/icons"};var ec="wp:reward-pools";function wo(e,t=!0){let n=ho[e],{data:o,...r}=(0,ha.useQuery)({queryKey:[ec,e],queryFn:async({signal:l})=>{let p=await fetch(`${n}/v1/pools`,{cache:"no-store",signal:l});if(!p.ok)throw new Error(`Failed to fetch pools: ${p.status}`);let c=await p.json();if(c.code!==200)throw new Error(`Pools API error: ${c.code}`);return c},enabled:t,staleTime:0}),s=(0,dr.useMemo)(()=>o?.data.pools.filter(l=>l.pool_type==="CrossPool")??[],[o]),i=(0,dr.useMemo)(()=>o?.data.pools.filter(l=>l.pool_type==="GamePool")??[],[o]);return{crossPools:s,gamePools:i,allPools:o?.data.pools??[],...r}}var ba=require("@tanstack/react-query"),wa=require("react");var tc="wp:user-deposits";function xo(e,t,n=!0){let o=ho[e],r=n&&!!t,{data:s,...i}=(0,ba.useQuery)({queryKey:[tc,e,t],queryFn:async({signal:p})=>{let c=await fetch(`${o}/v1/users/${t}/deposits`,{cache:"no-store",signal:p});if(!c.ok)throw new Error(`Deposits fetch failed: ${c.status}`);let f=await c.json();if(f.code!==200)throw new Error(`Deposits API error: ${f.code}`);return f},enabled:r,staleTime:0});return{depositMap:(0,wa.useMemo)(()=>{let p=new Map;if(!s?.data.user_deposits)return p;for(let c of s.data.user_deposits)p.set(c.pool_address.toLowerCase(),c);return p},[s]),deposits:s?.data.user_deposits??[],...i}}var nc=["var(--wp-blue)","var(--wp-purple)","var(--wp-red)","var(--wp-orange)"],xa="var(--wp-green)",va=4;function ka(e,t,n=!0){let o=n&&!!t,{allPools:r}=wo(e,o),{depositMap:s}=xo(e,t,o);return(0,ya.useMemo)(()=>{let i=new Map,l=new Map,p=(u,m)=>{!Number.isFinite(m)||m<=0||l.set(u,(l.get(u)??0)+m)};for(let u of r){let m=Number(u.deposit_token.price);m>0&&i.set(u.deposit_token.symbol,m);for(let v of u.reward_tokens){let x=Number(v.price);x>0&&i.set(v.symbol,x)}}for(let u of r){let m=s.get(u.pool_address.toLowerCase());if(!m)continue;let v=new vo.default(m.deposited_amount).shiftedBy(-u.deposit_token.decimals).toNumber();if(p(u.deposit_token.symbol,v),u.reward_tokens.length>0){let x=u.reward_tokens[0],b=new vo.default(m.claimable_reward).shiftedBy(-x.decimals).toNumber();p(x.symbol,b)}}let c=[],f=0;for(let[u,m]of l){let v=i.get(u)??0,x=m*v;x>0&&(c.push({symbol:u,usdValue:x}),f+=x)}c.sort((u,m)=>m.usdValue-u.usdValue);let g=[];if(f>0){let u=c.slice(0,va),m=c.slice(va);for(let x=0;x<u.length;x++)g.push({symbol:u[x].symbol,usdValue:u[x].usdValue,percentage:Math.round(u[x].usdValue/f*100),color:nc[x]??xa});if(m.length>0){let x=m.reduce((b,y)=>b+y.usdValue,0);g.push({symbol:"Others",usdValue:x,percentage:Math.round(x/f*100),color:xa})}let v=g.reduce((x,b)=>x+b.percentage,0);v!==100&&g.length>0&&(g[0].percentage+=100-v)}return{totalUsd:f,formattedTotal:f>0?`$${new vo.default(f).toFormat(2)}`:"$0.00",segments:g}},[r,s])}var We=require("react/jsx-runtime");function Sa({size:e=22,className:t}){return(0,We.jsxs)("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,We.jsx)("path",{d:"M18.333 3.667v5.5h-5.5",stroke:"currentColor",strokeWidth:1.833,strokeLinecap:"round",strokeLinejoin:"round"}),(0,We.jsx)("path",{d:"M16.17 13.75a7.333 7.333 0 11-1.54-7.59L18.333 9.167",stroke:"currentColor",strokeWidth:1.833,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Ca({size:e=24,className:t}){return(0,We.jsx)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,"aria-hidden":"true",children:(0,We.jsx)("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})})}function pr({size:e=16,className:t}){return(0,We.jsxs)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,"aria-hidden":"true",children:[(0,We.jsx)("path",{d:"M1.333 8s2.424-4.667 6.667-4.667S14.667 8 14.667 8 12.243 12.667 8 12.667 1.333 8 1.333 8z",stroke:"currentColor",strokeWidth:1.333,strokeLinecap:"round",strokeLinejoin:"round"}),(0,We.jsx)("path",{d:"M8 10a2 2 0 100-4 2 2 0 000 4z",stroke:"currentColor",strokeWidth:1.333,strokeLinecap:"round",strokeLinejoin:"round"})]})}function At({size:e=12,className:t}){return(0,We.jsxs)("svg",{width:e,height:e,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,"aria-hidden":"true",children:[(0,We.jsx)("path",{d:"M5 2H2.5A1.5 1.5 0 0 0 1 3.5V9.5A1.5 1.5 0 0 0 2.5 11H8.5A1.5 1.5 0 0 0 10 9.5V7",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"}),(0,We.jsx)("path",{d:"M7 1H11V5",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"}),(0,We.jsx)("path",{d:"M11 1L6 6",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"})]})}var yo=O(require("bignumber.js"),1),fr={included:["CROSS Rewards deposited assets","CROSS Rewards claimable rewards"],excluded:["Forge LP value","CROSS staking value","Game Swap LP value","Wallet balances outside Portfolio"]};function Na(e){return e!=="production"}function fn(e,t){let n=new yo.default(e).shiftedBy(-t);return!n.isFinite()||n.isZero()?"0":n.isGreaterThanOrEqualTo(1)?n.toFormat(2,yo.default.ROUND_DOWN):n.toFormat(4,yo.default.ROUND_DOWN)}function ur(e){return fn(e,0)}var Ta=require("@tanstack/react-query"),Ra=require("react");var oc="wp:token-info";function Ia(e,t=!0){let n=at[e],o=ze[e].cross,{data:r,...s}=(0,Ta.useQuery)({queryKey:[oc,e],queryFn:async({signal:c})=>{let f=await fetch(`${n}/v1/public/token/info`,{cache:"no-store",signal:c});if(!f.ok)throw new Error(`Failed to fetch token info: ${f.status}`);let g=await f.json();if(g.code!==200)throw new Error(`Token info API error: ${g.code}`);return g},enabled:t,staleTime:300*1e3}),{byChainAddr:i,byChainSym:l}=(0,Ra.useMemo)(()=>{let c=new Map,f=new Map;if(!r?.data)return{byChainAddr:c,byChainSym:f};for(let g of r.data){let u=g.address.toLowerCase();c.set(`${g.chain_id}:${u}`,g),c.set(u,g);let m=g.symbol.replace(/^t/,"").toUpperCase(),v=`${g.chain_id}:${m}`;f.has(v)||f.set(v,g),f.has(m)||f.set(m,g)}return{byChainAddr:c,byChainSym:f}},[r]);return{getTokenImage:(c,f)=>{let g=c.toLowerCase(),u=i.get(`${o}:${g}`);if(u?.image)return u.image;let m=i.get(g);if(m?.image)return m.image;if(f){let v=f.replace(/^t/,"").toUpperCase(),x=l.get(`${o}:${v}`);if(x?.image)return x.image;let b=l.get(v);if(b?.image)return b.image}return""},...s}}var Wt=require("react/jsx-runtime");function Dt({title:e,icon:t,iconFit:n="cover",isEmpty:o,children:r}){return(0,Wt.jsxs)("div",{className:"wp-svc-card",children:[(0,Wt.jsxs)("div",{className:"wp-svc-card-head",children:[(0,Wt.jsx)("img",{className:"wp-svc-card-icon",src:t,alt:"",style:{objectFit:n}}),(0,Wt.jsx)("span",{className:"wp-svc-card-title",children:e})]}),o?(0,Wt.jsx)("div",{className:"wp-svc-empty",children:"No assets yet"}):(0,Wt.jsx)("div",{className:"wp-svc-items",children:r})]})}var un=O(require("bignumber.js"),1),Z=require("react/jsx-runtime"),rc="CROSS Rewards";function ic(e){return new un.default(e||"0").isGreaterThan(0)}function ac(e,t,n){let o=new un.default(e||"0").shiftedBy(-t).times(n||"0");return!o.isFinite()||o.isZero()?"$0.00":`$${o.toFormat(2,un.default.ROUND_DOWN)}`}function La(){let{env:e,walletAddress:t,onOutlink:n}=st(),o=!!t,{allPools:r}=wo(e,o),{depositMap:s}=xo(e,t,o),{getTokenImage:i}=Ia(e,o),l=(f,g)=>`${pa[e]}/rewards/${f.pool_address}?action=${g}`,p=`${zt[e]}/reward.png`,c=r.filter(f=>{let g=s.get(f.pool_address.toLowerCase()),u=g?.deposited_amount??"0",m=g?.claimable_reward??"0";return!(new un.default(u).isZero()&&new un.default(m).isZero())});return(0,Z.jsx)(Dt,{title:rc,icon:p,isEmpty:c.length===0,children:c.map(f=>{let g=s.get(f.pool_address.toLowerCase()),u=g?.deposited_amount??"0",m=g?.claimable_reward??"0",v=l(f,"withdraw"),x=l(f,"claim"),b=i(f.deposit_token.address,f.deposit_token.symbol),y=f.reward_tokens[0],L=y?i(y.address,y.symbol):"",h=f.reward_tokens.map(G=>G.symbol),P=h.length>0?`${f.deposit_token.symbol}-${h.join("/")}`:f.deposit_token.symbol,T=y?fn(m,y.decimals):"0",B=y?.symbol??"Reward",R=y?ac(m,y.decimals,y.price):"$0.00",$=!!g&&ic(m);return(0,Z.jsxs)("article",{className:"wp-item","data-side":"reward",children:[(0,Z.jsxs)("div",{className:"wp-item-body",children:[(0,Z.jsxs)("div",{className:"wp-item-line",children:[(0,Z.jsx)("span",{className:"wp-item-label",children:"Pool (Deposit - Earn)"}),(0,Z.jsxs)("div",{className:"wp-svc-token",children:[(0,Z.jsxs)("span",{className:"wp-token-stack","aria-hidden":!0,children:[b&&(0,Z.jsx)("img",{className:"wp-svc-token-icon",src:b,alt:""}),L&&(0,Z.jsx)("img",{className:"wp-svc-token-icon",src:L,alt:""})]}),(0,Z.jsx)("span",{children:P})]})]}),(0,Z.jsxs)("div",{className:"wp-item-line",children:[(0,Z.jsx)("span",{className:"wp-item-label",children:"Deposited"}),(0,Z.jsxs)("div",{className:"wp-svc-token",children:[b&&(0,Z.jsx)("img",{className:"wp-svc-token-icon",src:b,alt:""}),(0,Z.jsx)("span",{children:fn(u,f.deposit_token.decimals)})]})]}),(0,Z.jsxs)("div",{className:"wp-item-line",children:[(0,Z.jsxs)("span",{className:"wp-item-label",children:["Claimable (",B,")"]}),(0,Z.jsxs)("div",{className:"wp-svc-token",children:[L&&(0,Z.jsx)("img",{className:"wp-svc-token-icon",src:L,alt:""}),(0,Z.jsx)("span",{children:T}),(0,Z.jsx)("span",{className:"wp-item-usd",children:R})]})]})]}),(0,Z.jsxs)("div",{className:"wp-item-tags",children:[(0,Z.jsxs)("a",{className:"wp-tag wp-tag--muted",href:v,target:"_blank",rel:"noopener noreferrer",onClick:G=>Ye(G,v,{category:"portfolio",origin:"portfolio-rewards",payload:{pool:f,userDeposit:g}},n),children:[(0,Z.jsx)("span",{className:"wp-tag-label",children:"Withdraw"}),(0,Z.jsx)(At,{size:12,className:"wp-tag-icon"})]}),(0,Z.jsxs)("a",{className:"wp-tag wp-tag--mint","data-disabled":!$||void 0,"aria-disabled":!$||void 0,href:$?x:void 0,target:$?"_blank":void 0,rel:$?"noopener noreferrer":void 0,onClick:G=>{if(!$){G.preventDefault();return}Ye(G,x,{category:"portfolio",origin:"portfolio-rewards",payload:{pool:f,userDeposit:g}},n)},children:[(0,Z.jsx)("span",{className:"wp-tag-label",children:"Claim"}),(0,Z.jsx)(At,{size:12,className:"wp-tag-icon"})]})]})]},f.pool_address)})})}var Oa=O(require("react"),1);var Ea=require("@tanstack/react-query");var sc="wp:stake-info";function Aa(e,t,n=!0){let o=pn[e],r=n&&!!t,{data:s,...i}=(0,Ea.useQuery)({queryKey:[sc,e,t],queryFn:async({signal:p})=>{let c=await fetch(`${o}/stake/${t}`,{cache:"no-store",signal:p});if(!c.ok)throw new Error(`Stake info fetch failed: ${c.status}`);let f=await c.json();if(f.code!==0&&f.code!==200)throw new Error(`Stake info API error: ${f.code}`);return f},enabled:r,staleTime:0});return{stakeInfo:s?.data,...i}}var Pa=require("@tanstack/react-query");var lc="wp:stake-rewards";function Ba(e,t,n=!0){let o=pn[e],r=n&&!!t,{data:s,...i}=(0,Pa.useQuery)({queryKey:[lc,e,t],queryFn:async({signal:l})=>{let p=await fetch(`${o}/rewards/${t}?limit=1`,{cache:"no-store",signal:l});if(!p.ok)throw new Error(`Stake rewards fetch failed: ${p.status}`);let c=await p.json();if(c.code!==0&&c.code!==200)throw new Error(`Stake rewards API error: ${c.code}`);return c.data?.data?.[0]??null},enabled:r,staleTime:0});return{latestReward:s??null,...i}}var Fa=require("@tanstack/react-query");var cc="wp:network-stats";function Ma(e,t=!0){let n=pn[e],{data:o,...r}=(0,Fa.useQuery)({queryKey:[cc,e],queryFn:async({signal:i})=>{let l=await fetch(`${n}/network/stats`,{cache:"no-store",signal:i});if(!l.ok)throw new Error(`Network stats fetch failed: ${l.status}`);let p=await l.json();if(p.code!==0&&p.code!==200)throw new Error(`Network stats API error: ${p.code}`);return p},enabled:t,staleTime:0});return{networkStats:o?.data,...r}}var Xt=O(require("bignumber.js"),1),J=require("react/jsx-runtime"),dc="CROSS Staking";function _a(e){if(!e)return"\u2014";let t=new Xt.default(e);return t.isFinite()?`${t.toFormat(2,Xt.default.ROUND_DOWN)}%`:"\u2014"}function za(){let{env:e,walletAddress:t,onOutlink:n}=st(),o=!!t,{stakeInfo:r}=Aa(e,t,o),{latestReward:s}=Ba(e,t,o),{networkStats:i}=Ma(e,o),l=`${zt[e]}/cross-staking.png`,p=ua[e],c=r?.total_stake??"0",f=r?.delegations??0,g=Oa.useMemo(()=>{let L=s?.cumulative_earned;if(!L)return;let h=new Xt.default(L);return h.isFinite()?h:void 0},[s]),u=g?.toString(10)??r?.rewards_earned??"0",m=new Xt.default(c),v=r?.days_since_first_stake,x=g!==void 0&&m.isGreaterThan(0)&&v!==null&&v!==void 0?g.div(m).times(365).div(Math.max(1,v)).times(100):void 0,b=!(new Xt.default(c).isZero()&&new Xt.default(u).isZero()),y=In[e];return(0,J.jsx)(Dt,{title:dc,icon:l,iconFit:"contain",isEmpty:!1,children:(0,J.jsxs)("article",{className:"wp-item","data-side":"stake",children:[(0,J.jsx)("div",{className:"wp-item-body",children:b?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)("div",{className:"wp-item-line",children:[(0,J.jsx)("span",{className:"wp-item-label",children:"Staked"}),(0,J.jsxs)("span",{children:[ur(c)," CROSS"]})]}),(0,J.jsxs)("div",{className:"wp-item-line",children:[(0,J.jsx)("span",{className:"wp-item-label",children:"Rewards Earned"}),(0,J.jsxs)("span",{children:[ur(u)," CROSS"]})]}),(0,J.jsxs)("div",{className:"wp-item-line",children:[(0,J.jsx)("span",{className:"wp-item-label",children:"Delegations"}),(0,J.jsx)("span",{children:f})]}),(0,J.jsxs)("div",{className:"wp-item-line",children:[(0,J.jsx)("span",{className:"wp-item-label",children:"My APR"}),(0,J.jsx)("span",{children:_a(x?.toString(10))})]})]}):(0,J.jsxs)("div",{className:"wp-item-line",children:[(0,J.jsx)("span",{className:"wp-item-label",children:"Delegation APR"}),(0,J.jsx)("span",{children:_a(i?.apr)})]})}),(0,J.jsx)("div",{className:"wp-item-tags",children:(0,J.jsxs)("a",{className:"wp-tag wp-tag--mint",href:b?p:y,target:"_blank",rel:"noopener noreferrer",onClick:L=>Ye(L,b?p:y,{category:"portfolio",origin:"portfolio-stake",payload:{stakeInfo:r,networkStats:i}},n),children:[(0,J.jsx)("span",{className:"wp-tag-label",children:b?"Manage":"Stake Now"}),(0,J.jsx)(At,{size:12,className:"wp-tag-icon"})]})})]})})}var mr=O(require("react"),1);var Wa=require("@tanstack/react-query");var pc="wp:game-swap-pools";function Da(e,t,n=!0){let o=ma[e],r=n&&!!t,{data:s,...i}=(0,Wa.useQuery)({queryKey:[pc,e,t],queryFn:async({signal:l})=>{let p=await fetch(`${o}/addresses/${t}/portfolio`,{cache:"no-store",signal:l});if(!p.ok)throw new Error(`Game-swap portfolio fetch failed: ${p.status}`);return(await p.json()).pools??[]},enabled:r,staleTime:0});return{pools:s??[],...i}}var Ha=require("@tanstack/react-query"),fc="wp:game-swap-lp-balances";function Ga(e,t,n,o){let r=[...n].map(p=>p.toLowerCase()).sort(),s=!!o&&!!t&&r.length>0,{data:i,...l}=(0,Ha.useQuery)({queryKey:[fc,e,t,r],queryFn:async()=>{if(!o)return{};let p=await o(r),c={};for(let[f,g]of Object.entries(p))c[f.toLowerCase()]=g;return c},enabled:s,staleTime:0});return{balances:i??{},...l}}var ut=O(require("bignumber.js"),1),oe=require("react/jsx-runtime"),uc="Game Swap LP",$a=18,mc=new ut.default("0.0001");function Ua(e){return e?.trim().toUpperCase()==="CROSS"}function gc(e){return e&&e>0?e:$a}function hc(e){let t=Ua(e.token_a?.symbol)&&!Ua(e.token_b?.symbol),n=t?e.reserve_a:e.reserve_b,o=gc(t?e.token_a?.decimals:e.token_b?.decimals),r=new ut.default(n||"0").shiftedBy(-o);return!r.isFinite()||r.isLessThanOrEqualTo(0)?new ut.default(0):r.times(2)}function bc(e,t){let n=e.token_a?.symbol?.trim()||"TOKEN",o=e.token_b?.symbol?.trim()||"CROSS",r=t?.decimals??$a,s,i;if(t&&t.totalSupply&&t.totalSupply>BigInt(0)){let l=new ut.default(t.balance.toString()),p=new ut.default(t.totalSupply.toString()),c=l.div(p);s=c.times(100);let f=c.times(hc(e));if(f.isGreaterThan(0)){let g=new ut.default(e.cross_usd||"0");i=g.isGreaterThan(0)?`$${f.times(g).toFormat(2,ut.default.ROUND_DOWN)}`:`${f.toFormat(4,ut.default.ROUND_DOWN)} CROSS`}}return{pool:e,tokenASymbol:n,tokenBSymbol:o,info:t,lpAmountRaw:t?.balance.toString(),lpDecimals:r,sharePercent:s,valueText:i}}function ja(){let{env:e,walletAddress:t,onOutlink:n,lpBalanceReader:o}=st(),r=!!t,{pools:s}=Da(e,t,r),i=mr.useMemo(()=>s.map(u=>u.pair_address).filter(Boolean),[s]),{balances:l}=Ga(e,t,i,o),p=`${zt[e]}/dex.png`,c=!!o,f=mr.useMemo(()=>{let u=s.map(m=>bc(m,l[m.pair_address?.toLowerCase()]));return c?u.filter(m=>m.lpAmountRaw?new ut.default(m.lpAmountRaw).shiftedBy(-m.lpDecimals).isGreaterThanOrEqualTo(mc):!1):u},[s,l,c]),g=u=>{let m=u.token_a?.address??u.pair_address;return`${ga[e]}/tokens/${m}?trade=deposit`};return(0,oe.jsx)(Dt,{title:uc,icon:p,iconFit:"contain",isEmpty:f.length===0,children:f.map(u=>{let{pool:m}=u,v=g(m),x=`${u.tokenASymbol} / ${u.tokenBSymbol}`,b=m.token_a?.logo_url,y=m.token_b?.logo_url;return(0,oe.jsxs)("article",{className:"wp-item","data-side":"game-swap",children:[(0,oe.jsxs)("div",{className:"wp-item-body",children:[(0,oe.jsxs)("div",{className:"wp-item-line",children:[(0,oe.jsx)("span",{className:"wp-item-label",children:"Pool"}),(0,oe.jsxs)("div",{className:"wp-svc-token",children:[(0,oe.jsxs)("span",{className:"wp-token-stack","aria-hidden":!0,children:[b&&(0,oe.jsx)("img",{className:"wp-svc-token-icon",src:b,alt:""}),y&&(0,oe.jsx)("img",{className:"wp-svc-token-icon",src:y,alt:""})]}),(0,oe.jsx)("span",{children:x})]})]}),u.lpAmountRaw!==void 0&&(0,oe.jsxs)("div",{className:"wp-item-line",children:[(0,oe.jsx)("span",{className:"wp-item-label",children:"My LP"}),(0,oe.jsxs)("span",{children:[fn(u.lpAmountRaw,u.lpDecimals)," LP"]})]}),u.sharePercent!==void 0&&(0,oe.jsxs)("div",{className:"wp-item-line",children:[(0,oe.jsx)("span",{className:"wp-item-label",children:"Pool Share"}),(0,oe.jsxs)("span",{children:[u.sharePercent.toFormat(2,ut.default.ROUND_DOWN),"%"]})]}),u.valueText!==void 0&&(0,oe.jsxs)("div",{className:"wp-item-line",children:[(0,oe.jsx)("span",{className:"wp-item-label",children:"Value"}),(0,oe.jsx)("span",{children:u.valueText})]})]}),(0,oe.jsx)("div",{className:"wp-item-tags",children:(0,oe.jsxs)("a",{className:"wp-tag wp-tag--mint",href:v,target:"_blank",rel:"noopener noreferrer",onClick:L=>Ye(L,v,{category:"portfolio",origin:"portfolio-game-swap",payload:{pool:m}},n),children:[(0,oe.jsx)("span",{className:"wp-tag-label",children:"Manage"}),(0,oe.jsx)(At,{size:12,className:"wp-tag-icon"})]})})]},m.pair_address)})})}var ko=O(require("bignumber.js"),1),Ya=require("react");var Va=require("@tanstack/react-query");var wc="wp:forge-pools";function qa(e,t,n=!0){let o=bo[e],r=n&&!!t,{data:s,...i}=(0,Va.useQuery)({queryKey:[wc,e,t],queryFn:async()=>{let p=await fetch(`${o}/v1/users/${t}/pools`,{cache:"no-store"});if(!p.ok)throw new Error(`forge pools fetch failed: ${p.status}`);return(await p.json()).data?.items??[]},enabled:r,staleTime:0}),l=s??[];return{pools:l,isEmpty:l.length===0,...i}}var Ka=require("@tanstack/react-query"),Qa=require("react");var xc="wp:forge-token-detail";async function vc(e,t){let n=await fetch(`${e}/v1/tokens/${t}`,{cache:"no-store"});return n.ok?(await n.json())?.data?.token??null:null}function Za(e,t,n=!0){let o=bo[e],r=(0,Ka.useQueries)({queries:t.map(l=>({queryKey:[xc,e,l],queryFn:()=>vc(o,l),enabled:n&&!!l,staleTime:3e4}))}),s=(0,Qa.useMemo)(()=>{let l=new Map;for(let p=0;p<r.length;p++){let c=r[p]?.data,f=t[p];c&&f&&l.set(f.toLowerCase(),c)}return l},[r,t]),i=r.some(l=>l.isLoading);return{detailMap:s,isLoading:i}}var de=require("react/jsx-runtime"),yc="Forge",kc=18,Sc="https://contents.crosstoken.io/wallet/token/images/FT.png";function Cc(e){if(!e||e==="0")return"0";let t=new ko.default(e).shiftedBy(-kc);return t.isZero()?"0":t.isGreaterThanOrEqualTo(1)?t.toFormat(2,ko.default.ROUND_DOWN):t.toFormat(4,ko.default.ROUND_DOWN)}function Nc(e){let t=Number(e);return!Number.isFinite(t)||t<=0?"0%":t>=1?`${(Math.floor(t*100)/100).toFixed(2)}%`:`${(Math.floor(t*1e4)/1e4).toFixed(4)}%`}function Xa(){let{env:e,walletAddress:t,onOutlink:n}=st(),o=!!t,{pools:r,isEmpty:s}=qa(e,t,o),i=(0,Ya.useMemo)(()=>r.map(f=>f.token.address),[r]),{detailMap:l}=Za(e,i,o&&i.length>0),p=f=>`${fa[e]}/forge/token/${f.token.address}`,c=`${zt[e]}/forge.png`;return(0,de.jsx)(Dt,{title:yc,icon:c,iconFit:"contain",isEmpty:s,children:r.map(f=>{let g=l.get(f.token.address.toLowerCase()),u=g?.image_url||g?.image||f.token.image||Sc,m=g?.symbol||f.token.symbol,v=p(f);return(0,de.jsxs)("a",{className:"wp-item","data-side":"lp",href:v,target:"_blank",rel:"noopener noreferrer",onClick:x=>Ye(x,v,{category:"portfolio",origin:"portfolio-forge",payload:{pool:f,tokenDetail:g}},n),children:[(0,de.jsxs)("div",{className:"wp-item-body",children:[(0,de.jsxs)("div",{className:"wp-item-line",children:[(0,de.jsx)("span",{className:"wp-item-label",children:"Asset"}),(0,de.jsxs)("div",{className:"wp-svc-token",children:[(0,de.jsx)("img",{className:"wp-svc-token-icon",src:u,alt:""}),(0,de.jsx)("span",{children:m}),g?.name&&(0,de.jsx)("span",{className:"wp-token-subtle",children:g.name})]})]}),(0,de.jsxs)("div",{className:"wp-item-line",children:[(0,de.jsx)("span",{className:"wp-item-label",children:"LP Balance"}),(0,de.jsx)("div",{className:"wp-svc-token",children:(0,de.jsx)("span",{children:Cc(f.lp_balance)})})]}),(0,de.jsxs)("div",{className:"wp-item-line",children:[(0,de.jsx)("span",{className:"wp-item-label",children:"Ownership"}),(0,de.jsx)("span",{className:"wp-line-value",children:Nc(f.pool_ownership)})]})]}),(0,de.jsx)("div",{className:"wp-item-tags",children:(0,de.jsxs)("span",{className:"wp-tag wp-tag--muted",children:[(0,de.jsx)("span",{className:"wp-tag-label",children:"Withdraw"}),(0,de.jsx)(At,{size:12,className:"wp-tag-icon"})]})})]},f.pair_address)})})}z(`.wp-fullscreen[data-theme=dark],.wp-embed[data-theme=dark]{--wp-bg: var(--ds-bg-default, #202530);--wp-header-bg: var(--ds-surface-default, #252b39);--wp-card: var(--ds-surface-medium, #252b39);--wp-control: #292f40;--wp-border: var(--ds-border-default, #292f40);--wp-panel-border: var(--ds-border-medium, rgba(255, 255, 255, .18));--wp-panel-shadow: 0px 4px 30px -1px rgba(0, 0, 0, .28);--wp-text: var(--ds-content-highest, #ffffff);--wp-text-60: var(--ds-content-high, rgba(255, 255, 255, .85));--wp-text-40: var(--ds-content-medium, rgba(255, 255, 255, .65));--wp-text-30: var(--ds-content-low, rgba(255, 255, 255, .4));--wp-chrome-text: #ffffff;--wp-tooltip-bg: #151a23;--wp-tooltip-text: #ffffff;--wp-mint: var(--ds-accent-primary-default, #00a0a2);--wp-green: var(--ds-accent-primary-default, #00a0a2);--wp-accent-soft: var(--ds-accent-primary-low, rgba(0, 160, 162, .14));--wp-red: var(--ds-system-red-default, #e70077);--wp-blue: #0488fc;--wp-purple: #7346f3;--wp-orange: #ff9d00;--wp-claim-primary: #9b8cef;--wp-claim-primary-text: #202530;--wp-claim-secondary-bg: var(--wp-control);--wp-claim-success: #00d4aa;--wp-claim-success-soft: rgba(0, 212, 170, .18);--wp-claim-error: #ff3aa3;--wp-claim-error-soft: rgba(255, 58, 163, .16)}.wp-fullscreen[data-theme=light],.wp-embed[data-theme=light]{--wp-bg: var(--ds-bg-dim, #f5f7fa);--wp-header-bg: var(--ds-surface-default, #ffffff);--wp-card: var(--ds-surface-default, #ffffff);--wp-control: var(--ds-surface-medium, #f5f7fa);--wp-border: var(--ds-border-default, rgba(0, 0, 0, .07));--wp-panel-border: var(--ds-border-medium, rgba(0, 0, 0, .18));--wp-panel-shadow: 0px 4px 30px -1px rgba(0, 0, 0, .15);--wp-text: var(--ds-content-highest, #000000);--wp-text-60: var(--ds-content-high, rgba(0, 0, 0, .85));--wp-text-40: var(--ds-content-medium, rgba(0, 0, 0, .65));--wp-text-30: var(--ds-content-low, rgba(0, 0, 0, .4));--wp-chrome-text: var(--ds-content-high, rgba(0, 0, 0, .85));--wp-card-shadow: none;--wp-tooltip-bg: #192023;--wp-tooltip-text: #ffffff;--wp-mint: var(--ds-accent-primary-default, #00a0a2);--wp-green: var(--ds-accent-primary-default, #00a0a2);--wp-accent-soft: var(--ds-accent-primary-low, #e7f9f8);--wp-red: var(--ds-system-red-default, #e70077);--wp-blue: #0488fc;--wp-purple: #7346f3;--wp-orange: #ff9d00;--wp-claim-primary: #7346f3;--wp-claim-primary-text: #ffffff;--wp-claim-secondary-bg: #ffffff;--wp-claim-success: #019d92;--wp-claim-success-soft: rgba(1, 157, 146, .15);--wp-claim-error: #e70077;--wp-claim-error-soft: rgba(231, 0, 119, .12)}.wp-fullscreen{position:fixed!important;top:12px!important;left:max(12px,calc((100vw - 393px)/2))!important;right:max(12px,calc((100vw - 393px)/2))!important;bottom:12px!important;width:auto!important;height:calc(100dvh - 24px)!important;max-height:calc(100dvh - 24px)!important;z-index:50;background:var(--wp-bg);border:1px solid var(--wp-panel-border);border-radius:24px;box-shadow:var(--wp-panel-shadow);display:flex;flex-direction:column;overflow:hidden;font-family:inherit;font-feature-settings:"calt" 0,"lnum" 1,"pnum" 1;box-sizing:border-box;-webkit-font-smoothing:antialiased;color:var(--wp-chrome-text)}.wp-embed{width:100%;height:100%;min-height:0;background:var(--wp-bg);display:flex;flex-direction:column;overflow:hidden;position:relative;font-family:inherit;font-feature-settings:"calt" 0,"lnum" 1,"pnum" 1;box-sizing:border-box;-webkit-font-smoothing:antialiased;color:var(--wp-chrome-text)}.wp-overlay{position:fixed;inset:0;z-index:49;background:#0009}.wp-header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;min-height:73px;padding:24px;position:relative;border-bottom:1px solid var(--wp-border);background:var(--wp-header-bg);color:var(--wp-chrome-text);flex-shrink:0;box-sizing:border-box}.wp-header-btn{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:none;background:transparent;cursor:pointer;color:var(--ds-content-low, rgba(0, 0, 0, .4));flex-shrink:0;transition:color .15s ease}.wp-header-btn:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wp-header-edge{display:flex;align-items:center;width:24px;min-width:24px}.wp-header-edge--right{justify-content:flex-end}.wp-header-edge--right .wp-header-btn{position:absolute;top:24px;right:24px}.wp-header-spacer{display:block;width:24px;height:24px}.wp-header-avatar{width:38px;height:38px;flex-shrink:0;border-radius:50%;overflow:hidden;display:inline-flex;align-items:center;justify-content:center;background:var(--wp-header-avatar-bg)}.wp-header-avatar-img{width:30px;height:30px;object-fit:cover;display:block}.wp-fullscreen[data-theme=dark] .wp-header-avatar,.wp-embed[data-theme=dark] .wp-header-avatar{--wp-header-avatar-bg: hsl(221.3 24.6% 25.5%)}.wp-fullscreen[data-theme=light] .wp-header-avatar,.wp-embed[data-theme=light] .wp-header-avatar{--wp-header-avatar-bg: rgba(18, 18, 18, .1)}.wp-refresh-btn{position:relative}.wp-refresh-badge{position:absolute;top:-6px;right:-8px;min-width:16px;height:16px;padding:0 4px;border-radius:8px;background:var(--wp-mint);color:#fff;font-size:10px;font-weight:600;line-height:16px;text-align:center}.wp-spin-once{animation:wp-spin-once .6s ease-in-out}@keyframes wp-spin-once{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.wp-header-title{flex:1;font-family:inherit;font-size:18px;font-weight:600;line-height:1.5;letter-spacing:-.01em;text-align:center;color:var(--ds-content-highest, #000000);margin:0}.wp-header-account{flex:1;display:flex;align-items:center;gap:12px;min-width:0}.wp-header-wallet-name{flex:1;min-width:0;font-family:inherit;font-size:15px;font-weight:600;line-height:160%;letter-spacing:0;color:var(--wp-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wp-top{flex-shrink:0;padding:0 16px 16px;display:flex;flex-direction:column;gap:16px}.wp-identity{display:flex;flex-direction:column;gap:8px}.wp-address{display:inline-flex;align-items:center;gap:8px}.wp-address-label{font-size:12px;font-weight:400;line-height:1.4;color:var(--wp-text-40)}.wp-address-chevron{display:inline-flex;align-items:center;color:var(--wp-text-40)}.wp-total{font-size:28px;font-weight:600;line-height:1.3;color:var(--wp-text);margin:0}.wp-asset{display:flex;flex-direction:column;gap:8px}.wp-asset-head{display:flex;align-items:center;gap:4px}.wp-asset-head-label{font-size:12px;font-weight:400;line-height:1.4;color:var(--wp-text-40)}.wp-asset-head-icon{display:inline-flex;color:var(--wp-text-40)}.wp-bar{display:flex;height:20px;border-radius:4px;overflow:hidden}.wp-bar-seg{display:flex;align-items:center;justify-content:center;min-width:8px}.wp-bar-seg-pct{font-size:10px;font-weight:400;line-height:1.3;color:#fff;white-space:nowrap}.wp-legend{display:flex;align-items:center;justify-content:center;gap:16px;flex-wrap:wrap}.wp-legend-item{display:flex;align-items:center;gap:4px}.wp-legend-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}.wp-legend-label{font-size:12px;font-weight:400;line-height:1.4;color:var(--wp-text-40)}.wp-tabs{flex-shrink:0;padding:8px 16px}.wp-tabs-inner{display:flex;align-items:center;padding:0 2px}.wp-tabs-list{display:flex;gap:20px;flex:1}.wp-tab{display:flex;flex-direction:column;align-items:center;justify-content:space-between;height:44px;padding-top:12px;background:transparent;border:none;cursor:pointer}.wp-tab-text{font-size:14px;font-weight:600;line-height:1.4;color:var(--wp-text-30);white-space:nowrap}.wp-tab[data-active=true] .wp-tab-text{color:var(--wp-mint)}.wp-tab-bar{width:20px;height:4px;border-radius:2px;background:var(--wp-mint);opacity:0}.wp-tab[data-active=true] .wp-tab-bar{opacity:1}.wp-tabs-filter-wrap{position:relative;display:flex;align-items:center;width:44px;height:44px;flex-shrink:0}.wp-tabs-filter-grad{position:absolute;inset:0;background:linear-gradient(to left,var(--wp-bg) 74%,transparent);pointer-events:none}.wp-tabs-filter{position:relative;display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;padding:0;border:none;background:transparent;cursor:pointer;color:var(--wp-text-40)}.wp-body{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--wp-border) transparent}.wp-body::-webkit-scrollbar{width:4px}.wp-body::-webkit-scrollbar-track{background:transparent}.wp-body::-webkit-scrollbar-thumb{background:var(--wp-border);border-radius:4px}.wp-body-inner{padding:16px 16px 32px;display:flex;flex-direction:column;gap:32px}.wp-summary-card{display:flex;flex-direction:column;gap:8px;width:100%;padding:0;border-radius:0;background:transparent;box-shadow:none;box-sizing:border-box}.wp-summary-head{display:flex;align-items:center;justify-content:flex-start;gap:4px}.wp-summary-label{font-size:14px;font-weight:400;line-height:1.5;letter-spacing:0;color:var(--wp-text-40);white-space:nowrap}.wp-address{display:inline-flex;align-items:center;gap:8px;min-width:0}.wp-address-avatar{width:16px;height:16px;border-radius:50%;flex-shrink:0;background:radial-gradient(circle at 68% 34%,#ff78d1 0 18%,transparent 19%),radial-gradient(circle at 34% 66%,#00d4aa 0 20%,transparent 21%),linear-gradient(135deg,#7346f3,#0488fc)}.wp-address-label{font-size:12px;font-weight:400;line-height:1.4;letter-spacing:0;color:var(--wp-text-40);white-space:nowrap}.wp-address-chevron{display:inline-flex;align-items:center;color:var(--wp-text-40);flex-shrink:0}.wp-summary-badge{display:inline-flex;align-items:center;justify-content:center;padding:4px 8px;border-radius:999px;background:#019d921a;color:var(--wp-mint);font-size:12px;font-weight:400;line-height:1.4;letter-spacing:0;white-space:nowrap}.wp-summary-estimate{position:relative;display:inline-flex;align-items:center;gap:6px;flex-shrink:0}.wp-estimate-info{position:relative;display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;padding:0;border:0;border-radius:50%;background:transparent;color:var(--wp-text-40);cursor:help}.wp-estimate-tooltip{position:absolute;top:calc(100% + 8px);right:0;z-index:3;display:flex;flex-direction:column;gap:8px;width:min(280px,calc(100vw - 48px));padding:12px;border-radius:8px;background:var(--wp-tooltip-bg);box-shadow:0 12px 32px #0000003d;color:var(--wp-tooltip-text);font-size:12px;font-weight:400;line-height:1.4;letter-spacing:0;text-align:left;white-space:normal;opacity:0;pointer-events:none;transform:translateY(-4px);visibility:hidden;transition:opacity .15s ease,transform .15s ease,visibility .15s ease}.wp-estimate-tooltip-title{display:block;font-size:12px;font-weight:600;line-height:1.3}.wp-estimate-tooltip-group{display:flex;flex-direction:column;gap:4px}.wp-estimate-tooltip-item{display:block;color:#ffffffc7}.wp-estimate-tooltip-item:before{content:"- "}.wp-estimate-info:hover .wp-estimate-tooltip,.wp-estimate-info:focus .wp-estimate-tooltip,.wp-estimate-info:focus-visible .wp-estimate-tooltip{opacity:1;transform:translateY(0);visibility:visible}.wp-total{font-family:var( --wp-total-font-family, Sora, Inter, system-ui, -apple-system, sans-serif );font-size:36px;font-weight:600;line-height:1.25;letter-spacing:0;color:var(--wp-text);margin:0}.wp-svc-card{display:flex;flex-direction:column;gap:12px;width:100%}.wp-svc-card-head{display:flex;align-items:center;gap:6px}.wp-svc-card-icon{width:24px;height:24px;border-radius:4px;flex-shrink:0;object-fit:cover}.wp-svc-card-title{font-size:16px;font-weight:600;line-height:1.5;letter-spacing:0;color:var(--wp-text-60);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wp-svc-items{display:flex;flex-direction:column;gap:8px;width:100%;padding:0;border-radius:0;background:transparent;box-shadow:none;box-sizing:border-box}.wp-item{position:relative;display:flex;flex-direction:column;gap:20px;width:100%;padding:12px;border-radius:12px;background:var(--wp-card);box-shadow:var(--wp-card-shadow, none);box-sizing:border-box;color:inherit;text-decoration:none;cursor:pointer;outline:none;transition:opacity .15s ease}.wp-item+.wp-item{padding-top:12px;border-top:0}.wp-item:hover{opacity:.88}.wp-item-body{display:flex;flex-direction:column;gap:12px;min-width:0}.wp-order-head{display:flex;align-items:center;width:100%}.wp-item-line{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:21px;min-width:0}.wp-item-label{flex-shrink:0;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:0;color:var(--wp-text-30);white-space:nowrap}.wp-line-value,.wp-order-side{min-width:0;overflow:hidden;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:0;color:var(--wp-text-60);text-align:right;text-overflow:ellipsis;white-space:nowrap}.wp-order-side--buy{color:var(--wp-mint)}.wp-order-side--sell{color:var(--wp-red)}.wp-svc-token{display:flex;align-items:center;justify-content:flex-end;gap:6px;min-width:0;min-height:21px}.wp-svc-token>span{font-size:14px;font-weight:500;line-height:1.5;letter-spacing:0;color:var(--wp-text-60);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wp-svc-token-icon{width:16px;height:16px;border-radius:50%;flex-shrink:0;object-fit:cover}.wp-token-stack{display:inline-flex;align-items:center;justify-content:flex-end;width:29px;min-width:29px;overflow:visible}.wp-token-stack .wp-svc-token-icon+.wp-svc-token-icon{margin-left:-3.5px}.wp-token-subtle,.wp-item-usd{color:var(--wp-text-30)!important}.wp-order-token{display:flex;align-items:center;gap:8px;min-width:0}.wp-order-token .wp-svc-token-icon{width:32px;height:32px}.wp-order-token-meta{display:flex;min-width:0;flex-direction:column;justify-content:center}.wp-order-token-symbol{overflow:hidden;color:var(--wp-text-60);font-size:14px;font-weight:500;line-height:1.5;text-overflow:ellipsis;white-space:nowrap}.wp-order-token-pair{overflow:hidden;color:var(--wp-text-30);font-size:12px;font-weight:500;line-height:1.5;text-overflow:ellipsis;white-space:nowrap}.wp-item-tags{display:flex;align-items:stretch;gap:8px;width:100%}.wp-tag{appearance:none;display:inline-flex;flex:1 1 0;align-items:center;justify-content:center;gap:0;min-width:0;min-height:33px;padding:6px 10px;border-radius:6px;border:0;background:var(--wp-control);font-family:inherit;font-size:14px;font-weight:600;line-height:1.5;letter-spacing:0;color:var(--wp-text-40);text-align:center;text-decoration:none;white-space:nowrap;box-sizing:border-box;transition:background-color .15s ease,border-color .15s ease,color .15s ease,transform .15s ease}a.wp-tag,button.wp-tag{cursor:pointer}.wp-tag:hover{background:var(--wp-control);transform:none}.wp-tag:focus-visible{outline:2px solid var(--wp-mint);outline-offset:2px}.wp-tag[aria-disabled=true],.wp-tag[data-disabled]{cursor:default;opacity:.48;pointer-events:none}.wp-tag-label{display:inline-flex;align-items:center}.wp-tag-icon{display:none}.wp-tag:hover .wp-tag-icon{transform:none}.wp-tag--mint{color:var(--wp-mint);background:var(--wp-accent-soft)}.wp-tag--mint:hover{background:var(--wp-accent-soft)}.wp-tag--muted{color:var(--wp-text-40)}.wp-svc-empty{display:flex;align-items:center;justify-content:center;min-height:74px;padding:20px 16px;background:var(--wp-card);border-radius:12px;box-shadow:var(--wp-card-shadow, none);font-size:13px;font-weight:400;line-height:1.3;letter-spacing:0;color:var(--wp-text-30);box-sizing:border-box}.wp-claim-overlay{position:absolute;inset:0;z-index:8;display:flex;align-items:flex-end;justify-content:center;background:#00000094;box-sizing:border-box}.wp-claim-sheet{display:flex;flex-direction:column;width:100%;max-width:375px;max-height:calc(100% - 24px);overflow:hidden;border-radius:24px 24px 0 0;background:var(--wp-bg);color:var(--wp-text);box-shadow:0 -18px 48px #00000042;animation:wp-claim-slide-up .22s ease-out}@keyframes wp-claim-slide-up{0%{transform:translateY(18px);opacity:0}to{transform:translateY(0);opacity:1}}.wp-claim-grabber{display:flex;align-items:flex-start;justify-content:center;height:38px;min-height:38px;padding-top:12px;box-sizing:border-box}.wp-claim-grabber span{display:block;width:52px;height:5px;border-radius:999px;background:var(--wp-control)}.wp-claim-content{display:flex;flex-direction:column;align-items:center;gap:16px;width:100%;padding:20px;box-sizing:border-box}.wp-claim-icon{display:inline-flex;align-items:center;justify-content:center;width:64px;height:64px;border-radius:50%;flex-shrink:0}.wp-claim-icon--success{background:var(--wp-claim-success-soft);color:var(--wp-claim-success)}.wp-claim-icon--pending{background:#9b8cef29;color:var(--wp-claim-primary)}.wp-claim-icon--error{background:var(--wp-claim-error-soft);color:var(--wp-claim-error);font-size:30px;font-weight:600;line-height:1}.wp-claim-icon--token{background:#00d4aa29}.wp-claim-icon--token img{width:48px;height:48px;border-radius:50%;object-fit:cover}.wp-claim-icon--token span{display:inline-flex;align-items:center;justify-content:center;width:48px;height:48px;border-radius:50%;background:var(--wp-mint);color:#101820;font-size:18px;font-weight:600}.wp-claim-spinner{width:36px;height:36px;border-radius:50%;border:3px solid rgba(155,140,239,.28);border-top-color:var(--wp-claim-primary);animation:wp-claim-spin .8s linear infinite}@keyframes wp-claim-spin{to{transform:rotate(360deg)}}.wp-claim-copy{display:flex;flex-direction:column;align-items:center;gap:16px;width:100%;text-align:center}.wp-claim-title{margin:0;font-size:20px;font-weight:600;line-height:1.3;letter-spacing:0;color:var(--wp-text)}.wp-claim-desc{max-width:335px;margin:0;font-size:13px;font-weight:400;line-height:1.3;letter-spacing:0;color:var(--wp-text-40)}.wp-claim-heading{display:flex;flex-direction:column;align-items:flex-start;gap:8px;width:100%}.wp-claim-error-message{margin:0;color:var(--wp-claim-error);font-size:13px;font-weight:400;line-height:1.3;letter-spacing:0}.wp-claim-reward-card{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;min-height:60px;padding:16px;border-radius:8px;background:var(--wp-card);box-sizing:border-box}.wp-claim-reward-token{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:50%;flex-shrink:0;overflow:hidden;background:var(--wp-control)}.wp-claim-reward-token img{width:28px;height:28px;object-fit:cover}.wp-claim-reward-token span{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;background:var(--wp-mint);color:#101820;font-size:13px;font-weight:600;line-height:1}.wp-claim-reward-symbol{flex:1 1 auto;min-width:0;overflow:hidden;color:var(--wp-text);font-size:18px;font-weight:600;line-height:1.3;letter-spacing:0;text-overflow:ellipsis;white-space:nowrap}.wp-claim-reward-amount{flex-shrink:0;color:var(--wp-text);font-size:20px;font-weight:600;line-height:1.3;letter-spacing:0;white-space:nowrap}.wp-claim-account-card{display:flex;flex-direction:column;gap:12px;width:100%;padding:16px;border-radius:8px;background:var(--wp-card);box-sizing:border-box}.wp-claim-account-row{display:flex;align-items:center;justify-content:space-between;gap:4px;width:100%;min-height:40px}.wp-claim-account-row>span{flex-shrink:0;color:var(--wp-text-40);font-size:14px;font-weight:400;line-height:1.3;letter-spacing:0;white-space:nowrap}.wp-claim-account{display:flex;align-items:center;gap:8px;min-width:0}.wp-claim-account strong{overflow:hidden;color:var(--wp-text);font-size:15px;font-weight:600;line-height:1.6;letter-spacing:0;text-overflow:ellipsis;white-space:nowrap}.wp-claim-account-avatar{width:32px;height:32px;border-radius:50%;flex-shrink:0;background:radial-gradient(circle at 30% 28%,#d87aff 0 12%,transparent 13%),radial-gradient(circle at 68% 28%,#f0a1ff 0 12%,transparent 13%),radial-gradient(circle at 32% 70%,#b561e7 0 13%,transparent 14%),radial-gradient(circle at 70% 70%,#d4a2ff 0 13%,transparent 14%),radial-gradient(circle at 50% 50%,#8c4fc4 0 18%,transparent 19%),#4a315f;box-shadow:inset 0 0 0 3.37px var(--wp-control)}.wp-claim-divider{display:block;width:100%;height:1px;background:var(--wp-border)}.wp-claim-detail-list{display:flex;flex-direction:column;gap:8px;width:100%}.wp-claim-detail-row{display:flex;align-items:center;justify-content:space-between;gap:20px;width:100%;min-height:20px}.wp-claim-detail-row>span{min-width:0;color:var(--wp-text-40);font-size:13px;font-weight:400;line-height:1.3;letter-spacing:0;white-space:nowrap}.wp-claim-detail-row--sub>span:before{content:"";display:inline-block;width:3px;height:3px;margin:0 8px 3px;background:currentColor}.wp-claim-detail-row strong{min-width:0;overflow:hidden;color:var(--wp-text);font-size:13px;font-weight:400;line-height:1.3;letter-spacing:0;text-align:right;text-overflow:ellipsis;white-space:nowrap}.wp-claim-list{display:flex;flex-direction:column;gap:8px;width:100%;padding-bottom:8px}.wp-claim-list-item{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:56px;padding:8px 16px;border-radius:8px;background:var(--wp-card);box-sizing:border-box}.wp-claim-list-item>span{flex-shrink:0;font-size:14px;font-weight:400;line-height:1.3;color:var(--wp-text-40);white-space:nowrap}.wp-claim-list-item strong{display:inline-flex;align-items:center;justify-content:flex-end;gap:4px;min-width:0;overflow:hidden;color:var(--wp-text);font-size:14px;font-weight:400;line-height:1.3;text-align:right;text-overflow:ellipsis;white-space:nowrap}.wp-claim-list-item img{width:16px;height:16px;border-radius:50%;flex-shrink:0}.wp-claim-hash{appearance:none;display:inline-flex;align-items:center;justify-content:flex-end;gap:4px;min-width:0;padding:0;border:none;background:transparent;color:var(--wp-text);cursor:pointer;font:inherit}.wp-claim-hash svg{flex-shrink:0;color:var(--wp-text-60)}.wp-claim-gas-card{display:flex;flex-direction:column;gap:4px;width:100%;padding:14px 16px;border-radius:8px;border:1px solid var(--wp-border);background:var(--wp-card);box-sizing:border-box}.wp-claim-gas-row{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:28px}.wp-claim-gas-row>span{min-width:0;font-size:12px;font-weight:400;line-height:1.3;color:var(--wp-text-40)}.wp-claim-gas-row strong{min-width:0;overflow:hidden;color:var(--wp-text);font-size:12px;font-weight:400;line-height:1.3;text-align:right;text-overflow:ellipsis;white-space:nowrap}.wp-claim-gas-row--primary{min-height:32px}.wp-claim-gas-row--primary>span,.wp-claim-gas-row--primary strong{font-size:14px;color:var(--wp-text)}.wp-claim-fee-label{position:relative;display:inline-flex;align-items:center;text-decoration:underline dotted;text-underline-offset:3px;cursor:help;overflow:visible!important}.wp-claim-fee-tooltip{position:absolute;left:0;bottom:calc(100% + 8px);z-index:2;width:min(260px,calc(100vw - 64px));padding:10px 12px;border-radius:8px;background:var(--wp-tooltip-bg);color:var(--wp-tooltip-text);box-shadow:0 12px 32px #0000003d;font-size:11px;font-weight:400;line-height:1.4;text-align:left;text-decoration:none;white-space:normal;opacity:0;pointer-events:none;transform:translateY(4px);visibility:hidden;transition:opacity .15s ease,transform .15s ease,visibility .15s ease}.wp-claim-fee-label:hover .wp-claim-fee-tooltip,.wp-claim-fee-label:focus .wp-claim-fee-tooltip,.wp-claim-fee-label:focus-visible .wp-claim-fee-tooltip{opacity:1;transform:translateY(0);visibility:visible}.wp-claim-actions{display:flex;align-items:center;gap:8px;width:100%}.wp-claim-primary,.wp-claim-secondary{appearance:none;display:inline-flex;align-items:center;justify-content:center;width:100%;min-width:0;height:52px;padding:0 24px;border:none;border-radius:40px;font-family:inherit;font-size:15px;font-weight:600;line-height:1.3;letter-spacing:0;white-space:nowrap;cursor:pointer}.wp-claim-primary{background:var(--wp-claim-primary);color:var(--wp-claim-primary-text)}.wp-claim-primary:disabled{cursor:default;opacity:.72}.wp-claim-secondary{background:var(--wp-claim-secondary-bg, var(--wp-control));color:var(--wp-claim-primary)}.wp-claim-actions[data-count="2"] .wp-claim-primary{flex:1 1 0}.wp-claim-actions[data-count="2"] .wp-claim-secondary{flex:0 0 120px}.wp-claim-button-spinner{width:16px;height:16px;border-radius:50%;border:2px solid rgba(32,37,48,.28);border-top-color:var(--wp-claim-primary-text);animation:wp-claim-spin .8s linear infinite}.wp-claim-home-indicator{display:flex;align-items:flex-end;justify-content:center;height:34px;min-height:34px;padding-bottom:8px;box-sizing:border-box}.wp-claim-home-indicator span{display:block;width:134px;height:5px;border-radius:16px;background:var(--wp-text-40)}@media(max-width:359px){.wp-header{gap:12px;padding:0 12px}.wp-total{font-size:24px}.wp-body-inner{padding:0 12px 128px;gap:20px}.wp-svc-items,.wp-claim-content{padding:18px 14px}.wp-item-line{gap:10px}.wp-svc-token>span{max-width:168px}}.wp-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.wi-drawer-content .wp-header,.wi-portfolio-body .wp-header{padding:16px}.wi-drawer-content .wp-header-edge--right .wp-header-btn,.wi-portfolio-body .wp-header-edge--right .wp-header-btn{top:16px;right:16px}
8
- `);var H=require("react/jsx-runtime"),gr=5,Tc="wp:";function Jt({env:e,theme:t="light",walletAddress:n,onBack:o,showHeader:r=!0,variant:s="embed",className:i,onOutlink:l,lpBalanceReader:p}){let c=Ie(e),f=!!n,g=(0,Ja.useQueryClient)(),u=Xe.useId(),m=Na(c),{formattedTotal:v}=ka(c,n,f),[,x]=Xe.useState(gr),[b,y]=Xe.useState(!1),L=Xe.useCallback(()=>{g.invalidateQueries({predicate:R=>typeof R.queryKey[0]=="string"&&R.queryKey[0].startsWith(Tc)})},[g]),h=Xe.useCallback(()=>{L(),y(!0),setTimeout(()=>y(!1),600),x(gr)},[L]);Xe.useEffect(()=>{if(!f)return;let R=setInterval(()=>{x($=>$<=1?(h(),gr):$-1)},1e3);return()=>clearInterval(R)},[f,h]);let P=Xe.useCallback(()=>{o?.()},[o]),T=Xe.useMemo(()=>({env:c,theme:t,open:!0,walletAddress:n,close:P,onOutlink:l,lpBalanceReader:p}),[c,t,n,P,l,p]),B=(0,H.jsxs)(H.Fragment,{children:[r&&(0,H.jsxs)("div",{className:"wp-header",children:[(0,H.jsx)("div",{className:"wp-header-edge wp-header-edge--left",children:o?(0,H.jsx)("button",{type:"button",className:"wp-header-btn","aria-label":"Back",onClick:o,children:(0,H.jsx)(Lt,{size:24})}):(0,H.jsx)("span",{className:"wp-header-spacer","aria-hidden":!0})}),(0,H.jsx)("h2",{className:"wp-header-title",children:"Portfolio"}),(0,H.jsx)("div",{className:"wp-header-edge wp-header-edge--right",children:(0,H.jsx)("button",{type:"button",className:X("wp-header-btn",o?void 0:"wp-refresh-btn"),"aria-label":o?"Close portfolio":"Refresh portfolio",onClick:o??h,children:o?(0,H.jsx)(Ca,{}):(0,H.jsx)(Sa,{className:b?"wp-spin-once":void 0})})})]}),(0,H.jsx)("div",{className:"wp-body",children:(0,H.jsxs)("div",{className:"wp-body-inner",children:[(0,H.jsxs)("section",{className:"wp-summary-card","aria-label":"Estimated portfolio value",children:[(0,H.jsxs)("div",{className:"wp-summary-head",children:[(0,H.jsx)("span",{className:"wp-summary-label",children:"Total Assets USD (Estimated)"}),m?(0,H.jsxs)("button",{type:"button",className:"wp-estimate-info","aria-label":"USD estimate details","aria-describedby":u,children:[(0,H.jsx)(pr,{}),(0,H.jsxs)("span",{id:u,role:"tooltip",className:"wp-estimate-tooltip",children:[(0,H.jsx)("span",{className:"wp-estimate-tooltip-title",children:"USD estimate includes"}),(0,H.jsx)("span",{className:"wp-estimate-tooltip-group",children:fr.included.map(R=>(0,H.jsx)("span",{className:"wp-estimate-tooltip-item",children:R},R))}),(0,H.jsx)("span",{className:"wp-estimate-tooltip-title",children:"Not included"}),(0,H.jsx)("span",{className:"wp-estimate-tooltip-group",children:fr.excluded.map(R=>(0,H.jsx)("span",{className:"wp-estimate-tooltip-item",children:R},R))})]})]}):(0,H.jsx)("span",{className:"wp-estimate-info","aria-hidden":!0,children:(0,H.jsx)(pr,{})})]}),(0,H.jsx)("p",{className:"wp-total",children:v})]}),(0,H.jsx)(La,{}),(0,H.jsx)(za,{}),(0,H.jsx)(ja,{}),(0,H.jsx)(Xa,{})]})})]});return(0,H.jsx)(Rn.Provider,{value:T,children:s==="none"?B:(0,H.jsx)("div",{className:X(s==="fullscreen"?"wp-fullscreen":"wp-embed",i),"data-theme":t,children:B})})}var en=require("react/jsx-runtime");function es({className:e}){let{env:t,theme:n,walletAddress:o,close:r,onOutlink:s,lpBalanceReader:i}=st();return(0,en.jsxs)(Ln.Drawer.Portal,{children:[(0,en.jsx)(Ln.Drawer.Overlay,{className:"wp-overlay"}),(0,en.jsxs)(Ln.Drawer.Content,{className:X("wp-fullscreen",e),"data-theme":n,children:[(0,en.jsx)(Ln.Drawer.Title,{className:"wp-sr-only",children:"Portfolio"}),(0,en.jsx)(Jt,{env:t,theme:n,walletAddress:o,onBack:r,variant:"none",onOutlink:s,lpBalanceReader:i})]})]})}var hr=require("react/jsx-runtime");function Rc({env:e,theme:t="light",walletAddress:n,open:o,onOpenChange:r,onOutlink:s,lpBalanceReader:i,children:l}){let p=Ie(e),c=o!==void 0,[f,g]=tn.useState(!1),u=c?o:f,m=tn.useCallback(b=>{c||g(b),r?.(b)},[c,r]),v=tn.useCallback(()=>m(!1),[m]),x=tn.useMemo(()=>({env:p,theme:t,open:u,walletAddress:n,close:v,onOutlink:s,lpBalanceReader:i}),[p,t,u,n,v,s,i]);return(0,hr.jsx)(Rn.Provider,{value:x,children:(0,hr.jsx)(ts.Drawer.Root,{direction:"bottom",open:u,onOpenChange:m,noBodyStyles:!0,children:l})})}var br=Object.assign(Rc,{Trigger:da,Content:es});var k=O(require("react"),1),nn=require("react-dom"),Pt=O(require("bignumber.js"),1);var Be=require("react/jsx-runtime");function ns({size:e=20,className:t}){return(0,Be.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,"aria-hidden":"true",children:[(0,Be.jsx)("circle",{cx:"9",cy:"9",r:"6",stroke:"currentColor",strokeWidth:1.7}),(0,Be.jsx)("path",{d:"m17 17-3.2-3.2",stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round"})]})}function os({size:e=16,className:t}){return(0,Be.jsx)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,Be.jsx)("path",{d:"M2.667 8a5.333 5.333 0 1 0 1.562-3.771L2.667 5.79M2.667 2.667v3.124h3.124M8 5.333V8l1.667 1",stroke:"currentColor",strokeWidth:1.333,strokeLinecap:"round",strokeLinejoin:"round"})})}function rs({size:e=16,className:t}){return(0,Be.jsx)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,Be.jsx)("path",{d:"M2.667 4h4M9.333 4h4M6.667 2.667v2.666M2.667 12h4M9.333 12h4M9.333 10.667v2.666M2.667 8h1.666M7 8h6.333M4.333 6.667v2.666",stroke:"currentColor",strokeWidth:1.333,strokeLinecap:"round",strokeLinejoin:"round"})})}function is({size:e=20,className:t}){return(0,Be.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,Be.jsx)("path",{d:"M10 4.167v11.666M4.167 10 10 15.833 15.833 10",stroke:"currentColor",strokeWidth:1.667,strokeLinecap:"round",strokeLinejoin:"round"})})}function as({size:e=16,className:t}){return(0,Be.jsx)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,"aria-hidden":"true",children:(0,Be.jsx)("path",{d:"M3.333 8h9.334M8.667 4l4 4-4 4",stroke:"currentColor",strokeWidth:1.333,strokeLinecap:"round",strokeLinejoin:"round"})})}function ss({size:e=12,className:t}){return(0,Be.jsx)("svg",{width:e,height:e,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,Be.jsx)("path",{d:"M3.5 2 1.5 4l2 2M1.5 4h9M8.5 10l2-2-2-2M10.5 8h-9",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"})})}var N=O(require("react"),1);var wr=O(require("bignumber.js"),1);function ls(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function cs(e){return!e.isFinite()||e.isNaN()||e.lte(0)?"":e.decimalPlaces(6,wr.default.ROUND_DOWN).toFixed()}function Ic(e){return e.fromToken.symbol.toLowerCase()===e.toToken.symbol.toLowerCase()||e.fromToken.chainId===e.toToken.chainId&&e.fromToken.address.toLowerCase()===e.toToken.address.toLowerCase()}function Lc(e){let t=e.fromToken.priceUsd,n=e.toToken.priceUsd,o=e.lastChangedBy==="to"?e.toAmount:e.fromAmount,r=new wr.default(o||"0");return!r.isFinite()||r.isNaN()||r.lte(0)?{fromAmount:e.fromAmount,toAmount:e.toAmount}:ls(t)&&ls(n)?e.lastChangedBy==="to"?{fromAmount:cs(r.multipliedBy(n).dividedBy(t))}:{toAmount:cs(r.multipliedBy(t).dividedBy(n))}:Ic(e)?e.lastChangedBy==="to"?{fromAmount:e.toAmount}:{toAmount:e.fromAmount}:{fromAmount:e.lastChangedBy==="to"?"":e.fromAmount,toAmount:e.lastChangedBy==="from"?"":e.toAmount}}function ds({getQuote:e,submitBridge:t}){return{canQuote:!!e,canSubmit:!!t,async getQuote(n){return e?e(n):Lc(n)},async submitBridge(n){if(!t)throw new Error("Bridge submit handler is not configured.");return t(n)}}}function mt(e,t){return!!e&&!!t&&e.chainId===t.chainId&&e.address.toLowerCase()===t.address.toLowerCase()}function So(e){return e[0]}function xr(e,t,n,o){if(n&&!mt(n,t))return n;let r=t?o?.(t,e):void 0;if(r?.length)return r[0];if(!t)return e[1]??So(e);let s=e.findIndex(l=>mt(l,t)),i=s>=0?e[s+1]:void 0;return i&&!mt(i,t)?i:e.find(l=>!mt(l,t))??t}function ps({fromToken:e,toToken:t,fromAmount:n,toAmount:o,lastChangedBy:r,slippage:s}){return{fromToken:e,toToken:t,fromAmount:n,toAmount:o,lastChangedBy:r,slippage:s}}function fs(e,t){let n=e instanceof Error?e.message:typeof e=="string"?e:"",o=e&&typeof e=="object"&&"code"in e?String(e.code):"",r=n.toLowerCase();return o==="4001"||r.includes("user rejected")||r.includes("user denied")||r.includes("rejected the request")||r.includes("request rejected")?"Transaction request was rejected.":n.split(`
9
- `)[0]?.trim()||t}function us(e){let{tokens:t,initialFromToken:n,initialToToken:o,getToTokens:r,getApproval:s,approveBridge:i,history:l=[],initialSlippage:p="0.5",termsUrl:c,getQuote:f,submitBridge:g,onSubmitted:u,onSuccess:m,onFailed:v,onExit:x}=e,b=N.useMemo(()=>ds({getQuote:f,submitBridge:g}),[f,g]),[y,L]=N.useState("form"),[h,P]=N.useState(n??So(t)),[T,B]=N.useState(()=>xr(t,n??So(t),o,r)),[R,$]=N.useState(""),[G,ee]=N.useState(""),[V,D]=N.useState("from"),[he,ye]=N.useState(p),[fe,ue]=N.useState(null),[De,ie]=N.useState(""),[j,ne]=N.useState("idle"),[Te,te]=N.useState(""),[He,Ge]=N.useState(null),[Re,Ee]=N.useState([]),[gt,be]=N.useState(!1),[Nt,Je]=N.useState(!1),[et,Ae]=N.useState(null),[Me,ke]=N.useState(!1),[pe,Se]=N.useState(null),[Tt,tt]=N.useState(null),[ht,Ce]=N.useState(!1),[Ue,bt]=N.useState(!1),_e=N.useRef(0),nt=N.useRef(null),ot=N.useCallback(()=>{nt.current&&(clearTimeout(nt.current),nt.current=null)},[]),$e=N.useCallback(M=>{ot(),tt(M)},[ot]);N.useEffect(()=>ot,[ot]),N.useEffect(()=>{let M=t.find(me=>mt(me,h))??So(t),ce=M?r?.(M,t):void 0,_=ce?.find(me=>mt(me,T))??(ce?void 0:t.find(me=>mt(me,T)))??xr(t,M,void 0,r);P(M),B(_)},[r,t,h,T]);let we=N.useCallback((M,ce)=>{let _=M.replace(/[^\d.]/g,"");ce==="from"?$(_):ee(_),D(ce),ie("")},[]),je=N.useCallback(()=>{_e.current+=1,$(""),ee(""),D("from"),ue(null),ie(""),te(""),ne("idle"),Ae(null),ke(!1),Se(null),Ce(!1),$e(null)},[$e]),lt=N.useCallback(M=>{mt(M,h)||(P(M),B(xr(t,M,void 0,r)),je())},[h,r,je,t]),wt=N.useCallback(M=>{mt(M,T)||mt(M,h)||(B(M),je())},[h,je,T]),Ve=N.useMemo(()=>h?r?.(h,t)??t.filter(M=>!mt(M,h)):[],[h,r,t]),Rt=N.useCallback(()=>{h?.balance&&we(h.balance,"from")},[h?.balance,we]),It=N.useCallback(()=>{!h||!T||(P(T),B(h),$(G),ee(R),D(V==="from"?"to":"from"),ie(""))},[R,h,V,G,T]),rt=N.useCallback(()=>{_e.current+=1,$(""),ee(""),D("from"),ue(null),ie(""),te("")},[]);N.useEffect(()=>{if(!h||!T)return;if(!R&&!G){ue(null),ie(""),ne("idle");return}let M=++_e.current,ce=ps({fromToken:h,toToken:T,fromAmount:R,toAmount:G,lastChangedBy:V,slippage:he});ne(b.canQuote?"quoting":"idle"),(async()=>{try{let _=await b.getQuote(ce);if(_e.current!==M)return;_.fromAmount!==void 0&&V==="to"&&$(_.fromAmount),_.toAmount!==void 0&&V==="from"&&ee(_.toAmount),ue(_.summary??null),ie(_.error??"")}catch(_){if(_e.current!==M)return;ie(_ instanceof Error?_.message:"Failed to quote bridge.")}finally{_e.current===M&&ne("idle")}})()},[R,h,V,b,he,G,T]);let xt=N.useCallback(()=>!h||!T?null:ps({fromToken:h,toToken:T,fromAmount:R,toAmount:G,lastChangedBy:V,slippage:he}),[R,h,V,he,G,T]),Oe=N.useCallback(async(M,ce)=>{te(""),Ce(!1),ke(!1),ne("submitting");try{if(!ce?.skipApprovalCheck&&s){let me=await s(M);if(me){Ae(me),Se(M),ne("idle");return}}Ae(null),Se(null),$e("processing");let _=await b.submitBridge(M);Ge(_),ne("success"),Ee(me=>[{id:_.txHash,timestamp:new Date().toISOString(),txHash:_.txHash,fromToken:_.fromToken,toToken:_.toToken,fromAmount:_.fromAmount,toAmount:_.toAmount,summary:fe??void 0,status:"pending"},...me.filter(Ft=>Ft.txHash!==_.txHash)]),rt(),bt(!0),$e(null),Ce(!0),u?.(_),m?.(_)}catch(_){let me=fs(_,"Failed to submit bridge.");$e(null),te(me),ne("error"),v?.({message:me})}},[s,v,u,m,b,rt,$e,fe]),ct=N.useCallback(async()=>{if(De)return;let M=xt();if(M){if(!Nt){Se(M),be(!0);return}await Oe(M)}},[xt,De,Oe,Nt]),C=N.useCallback(async()=>{let M=pe??xt();M&&(Je(!0),be(!1),await Oe(M))},[xt,pe,Oe]),q=N.useCallback(()=>{be(!1),Se(null)},[]),re=N.useCallback(async()=>{if(!(j==="submitting"||!et||!pe||!i)){te(""),ne("submitting");try{await i(pe,et),Ae(null),ne("idle"),ke(!0)}catch(M){let ce=fs(M,"Failed to approve token.");te(ce),ne("error"),v?.({message:ce})}}},[et,i,v,pe,Oe,j]),qe=N.useCallback(()=>{j!=="submitting"&&(Ae(null),ke(!1),Se(null),ne("idle"))},[j]),Ke=N.useCallback(async()=>{j==="submitting"||!pe||(ke(!1),await Oe(pe,{skipApprovalCheck:!0}))},[pe,Oe,j]),Bt=N.useCallback(()=>{Ce(!1)},[]),bn=N.useCallback(M=>{L(M),M==="history"&&bt(!1)},[]),Fo=N.useCallback(()=>{if(y==="history"){bn("form");return}x?.()},[x,bn,y]),it=N.useMemo(()=>[...l,...Re.filter(M=>!l.some(ce=>ce.txHash===M.txHash))],[l,Re]);return{step:y,setStep:bn,status:j,error:Te,quoteError:De,fromToken:h,toToken:T,tokens:t,availableToTokens:Ve,fromAmount:R,toAmount:G,lastChangedBy:V,slippage:he,setSlippage:ye,summary:fe,history:it,submitted:He,canSubmit:b.canSubmit,termsOpen:gt,approvalInfo:et,approvalSuccessOpen:Me,approveBridge:i,pendingSubmitInput:pe,submitToast:Tt,successDialogOpen:ht,dismissSuccessDialog:Bt,hasNewHistory:Ue,termsUrl:c,setFromToken:P,setToToken:B,selectFromToken:lt,selectToToken:wt,setAmount:we,setMax:Rt,swapTokens:It,submit:ct,confirmTerms:C,cancelTerms:q,confirmApproval:re,cancelApproval:qe,continueAfterApproval:Ke,back:Fo}}z(`.bf-root{--bf-bg: var(--ds-bg-default, #1e232e);--bf-surface: var(--ds-surface-medium, rgba(255, 255, 255, .05));--bf-surface-hover: var(--ds-surface-high, rgba(255, 255, 255, .08));--bf-border: var(--ds-border-default, rgba(255, 255, 255, .07));--bf-text-high: var(--ds-content-high, rgba(255, 255, 255, .85));--bf-text-medium: var(--ds-content-medium, rgba(255, 255, 255, .65));--bf-text-low: var(--ds-content-low, rgba(255, 255, 255, .4));--bf-toast-bg: #1e232e;--bf-toast-color: rgba(255, 255, 255, .85);position:relative;display:flex;flex:1;min-height:0;flex-direction:column;overflow:hidden;background:var(--bf-bg);color:var(--ds-content-highest, #ffffff);font-family:inherit}[data-theme=dark].wi-popover-content .bf-root,[data-theme=dark].wi-drawer-content .bf-root{--bf-bg: var(--ds-bg-default, #121212);--bf-surface: var(--ds-surface-medium, rgba(255, 255, 255, .05));--bf-surface-hover: var(--ds-surface-high, rgba(255, 255, 255, .1));--bf-border: var(--ds-border-default, rgba(255, 255, 255, .05));--bf-text-high: var(--ds-content-high, rgba(255, 255, 255, .85));--bf-text-medium: var(--ds-content-medium, rgba(255, 255, 255, .7));--bf-text-low: var(--ds-content-low, rgba(255, 255, 255, .5))}[data-theme=light].wi-popover-content .bf-root,[data-theme=light].wi-drawer-content .bf-root{--bf-bg: var(--ds-bg-default, #ffffff);--bf-surface: var(--ds-surface-medium, rgba(18, 18, 18, .05));--bf-surface-hover: var(--ds-surface-high, rgba(18, 18, 18, .1));--bf-border: var(--ds-border-default, rgba(18, 18, 18, .05));--bf-text-high: var(--ds-content-high, rgba(18, 18, 18, .85));--bf-text-medium: var(--ds-content-medium, rgba(18, 18, 18, .7));--bf-text-low: var(--ds-content-low, rgba(18, 18, 18, .5))}.bf-root[data-view=history]{background:var(--ds-bg-dim, #f5f7fa);color:var(--ds-content-high, rgba(0, 0, 0, .85))}.bf-header{position:relative;display:flex;flex-shrink:0;align-items:center;justify-content:space-between;padding:24px;border-bottom:1px solid var(--bf-border);background:var(--ds-bg-default, var(--bf-bg));box-sizing:border-box}.bf-root[data-view=history] .bf-header{padding:24px;border-bottom-color:var(--ds-border-default, rgba(0, 0, 0, .07));background:var(--ds-surface-default, #ffffff)}.bf-header-btn{display:inline-flex;width:24px;height:24px;flex-shrink:0;align-items:center;justify-content:center;padding:0;border:0;background:transparent;color:var(--ds-content-low, rgba(0, 0, 0, .4));cursor:pointer;transition:color .15s ease}.bf-header-btn:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.bf-header .bf-header-btn:last-child{position:absolute;top:24px;right:24px}.bf-header-title{position:absolute;left:50%;transform:translate(-50%);font-size:18px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--bf-text-high);white-space:nowrap}.bf-root[data-view=history] .bf-header-title{color:var(--ds-content-highest, #000000)}.bf-body,.bf-history-body{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;box-sizing:border-box}.bf-body{padding:24px}.bf-history-body{display:flex;flex-direction:column;gap:12px;padding:24px;background:var(--ds-bg-dim, #f5f7fa)}.bf-toolbar{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:12px}.bf-chip{display:inline-flex;align-items:center;gap:4px;min-height:33px;padding:6px 8px;border:0;border-radius:12px;background:var(--bf-surface);color:var(--bf-text-medium);font:inherit;font-size:14px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer}.bf-chip:hover{color:var(--bf-text-high);background:var(--bf-surface-hover)}.bf-chip-history{position:relative}.bf-chip-dot{position:absolute;top:4px;right:4px;width:6px;height:6px;border-radius:999px;background:var(--ds-system-red-default, #da0b2e)}.bf-swap-card{position:relative;display:flex;flex-direction:column;gap:12px;margin-bottom:12px}.bf-field-error{margin-top:-4px;color:var(--ds-system-red-default, #ff2b5f);font-size:13px;font-weight:500;line-height:1.5;letter-spacing:0}.bf-amount-panel{display:flex;min-height:110px;flex-direction:column;gap:8px;padding:16px;border:1px solid transparent;border-radius:12px;background:var(--bf-surface);box-sizing:border-box;transition:border-color .2s ease}.bf-amount-panel:hover{border-color:var(--bf-border)}.bf-amount-head{display:flex;align-items:center;justify-content:space-between;gap:8px;color:var(--bf-text-high);font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-balance{display:inline-flex;align-items:center;justify-content:flex-end;gap:4px;min-width:0;color:var(--bf-text-low);font-size:12px;white-space:nowrap}.bf-max-btn{padding:0;border:0;background:transparent;color:var(--bf-text-medium);font:inherit;font-size:12px;text-decoration:underline;cursor:pointer}.bf-amount-main{display:flex;align-items:center;justify-content:space-between;gap:12px}.bf-amount-input-wrap{display:flex;min-width:0;flex:1;flex-direction:column;gap:4px}.bf-amount-input{width:100%;min-width:0;padding:0;border:0;background:transparent;color:var(--bf-text-high);font:inherit;font-size:18px;font-weight:600;line-height:1.5;letter-spacing:-.01em;outline:none}.bf-amount-input::placeholder{color:var(--ds-content-lowest, rgba(0, 0, 0, .25))}.bf-amount-usd{color:var(--bf-text-low);font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-token-pill{display:inline-flex;flex-shrink:0;align-items:center;gap:6px;min-height:33px;padding:6px 8px 6px 6px;border:1px solid var(--bf-border);border-radius:9999px;background:var(--bf-bg);color:var(--bf-text-high);font:inherit;font-size:14px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer}.bf-token-pill:hover:not(:disabled){background:var(--bf-surface-hover)}.bf-token-pill:disabled{cursor:default;opacity:.6}.bf-token-icon{position:relative;display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;overflow:hidden;border-radius:0;background:var(--ds-accent-primary-default, #00ceb2);color:var(--ds-accent-primary-on, #000000);font-size:11px;font-weight:700}.bf-token-icon[data-has-image=true]{background:transparent}.bf-token-icon img{width:100%;height:100%;border-radius:0;object-fit:cover}.bf-token-fallback{line-height:1}.bf-token-picker-overlay{--bf-bg: #1e232e;--bf-surface: rgba(255, 255, 255, .05);--bf-surface-hover: rgba(255, 255, 255, .08);--bf-border: rgba(255, 255, 255, .07);--bf-text-high: rgba(255, 255, 255, .85);--bf-text-medium: rgba(255, 255, 255, .65);--bf-text-low: rgba(255, 255, 255, .4);position:fixed;inset:0;z-index:100002;display:flex;align-items:center;justify-content:center;padding:24px;background:#00000085;pointer-events:auto;box-sizing:border-box}.bf-token-picker-overlay[data-theme=light]{--bf-bg: #ffffff;--bf-surface: rgba(18, 18, 18, .05);--bf-surface-hover: rgba(18, 18, 18, .08);--bf-border: rgba(18, 18, 18, .07);--bf-text-high: rgba(18, 18, 18, .85);--bf-text-medium: rgba(18, 18, 18, .65);--bf-text-low: rgba(18, 18, 18, .4)}.bf-token-picker{display:flex;width:min(480px,calc(100vw - 48px));height:min(466px,calc(100dvh - 48px));max-height:calc(100dvh - 48px);min-height:0;flex-direction:column;overflow:hidden;border:1px solid var(--bf-border);border-radius:24px;background:var(--bf-bg);color:var(--bf-text-high);box-shadow:0 24px 80px #0006;box-sizing:border-box}.bf-token-picker-handle{display:none}.bf-token-picker-head{position:relative;display:flex;min-height:73px;flex-shrink:0;align-items:center;justify-content:flex-start;padding:24px 56px 24px 24px;border-bottom:1px solid var(--bf-border);box-sizing:border-box}.bf-token-picker-head h3{margin:0;color:var(--bf-text-high);font-size:20px;font-weight:600;line-height:1.25;letter-spacing:0}.bf-token-picker-close{position:absolute;top:24px;right:24px;display:inline-flex;width:24px;height:24px;align-items:center;justify-content:center;padding:0;border:0;background:transparent;color:var(--bf-text-medium);cursor:pointer}.bf-token-picker-close:hover{color:var(--bf-text-high)}.bf-token-search{display:flex;min-height:48px;flex-shrink:0;align-items:center;gap:8px;margin:16px 24px;padding:12px 16px;border:1px solid transparent;border-radius:12px;background:var(--ds-surface-medium, rgba(18, 18, 18, .05));color:var(--bf-text-low);box-sizing:border-box}.bf-token-search:focus-within{border-color:var(--ds-accent-primary-default, #00ceb2)}.bf-token-search input{width:100%;min-width:0;padding:0;border:0;outline:0;background:transparent;color:var(--bf-text-high);font:inherit;font-size:16px;font-weight:500;line-height:1.5;letter-spacing:0}.bf-token-search input::placeholder{color:var(--bf-text-low)}.bf-token-list{display:flex;min-height:0;flex:1;flex-direction:column;gap:0;overflow-y:auto;overflow-x:hidden;padding:0 24px 24px;scrollbar-width:thin;box-sizing:border-box}.bf-token-row{position:relative;display:flex;width:100%;min-height:69px;align-items:center;justify-content:space-between;gap:12px;padding:12px;border:1px solid transparent;border-radius:12px;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer;box-sizing:border-box}.bf-token-row:hover:not([data-selected=true]){background:var(--ds-surface-medium, rgba(18, 18, 18, .05))}.bf-token-row[data-selected=true]{border-color:var(--ds-accent-primary-default, #00b4b7);background:var(--ds-surface-medium, rgba(18, 18, 18, .05))}.bf-token-row-left{display:inline-flex;min-width:0;align-items:center;gap:16px}.bf-token-meta{display:flex;min-width:0;flex-direction:column}.bf-token-symbol{overflow:hidden;color:var(--bf-text-high);font-size:16px;font-weight:600;line-height:1.5;letter-spacing:0;text-overflow:ellipsis;white-space:nowrap}.bf-token-name{overflow:hidden;color:var(--bf-text-low);font-size:12px;font-weight:500;line-height:1.5;letter-spacing:0;text-overflow:ellipsis;white-space:nowrap}.bf-token-row-right{display:flex;min-width:86px;max-width:42%;flex-shrink:0;flex-direction:column;align-items:flex-end}.bf-token-balance,.bf-token-price{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bf-token-balance{color:var(--bf-text-high);font-size:14px;font-weight:600;line-height:1.5;letter-spacing:0}.bf-token-price{color:var(--bf-text-low);font-size:12px;font-weight:500;line-height:1.5;letter-spacing:0}.bf-token-row[data-selected=true] .bf-token-symbol{color:var(--bf-text-high)}.bf-token-row[data-selected=true] .bf-token-balance{color:var(--bf-text-high);font-size:16px}.bf-token-row[data-selected=true] .bf-token-price{color:var(--bf-text-low);font-size:14px}.bf-token-empty{padding:32px 16px;color:var(--bf-text-low);font-size:14px;font-weight:500;line-height:1.5;text-align:center}.bf-slippage-overlay{position:fixed;inset:0;z-index:100002;display:flex;align-items:center;justify-content:center;padding:24px;background:#00000085;pointer-events:auto;box-sizing:border-box}.bf-slippage-dialog{display:flex;width:min(480px,calc(100vw - 48px));height:min(316px,calc(100dvh - 48px));max-height:calc(100dvh - 48px);min-height:0;flex-direction:column;overflow:hidden;border:1px solid var(--ds-border-medium, rgba(0, 0, 0, .18));border-radius:24px;background:var(--ds-surface-default, #ffffff);color:var(--ds-content-highest, #000000);box-shadow:var(--ds-shadow-modal, 0 4px 30px -1px rgba(0, 0, 0, .15));box-sizing:border-box}.bf-slippage-head{position:relative;display:flex;min-height:73px;flex-shrink:0;align-items:center;justify-content:flex-start;padding:24px 56px 24px 24px;border-bottom:1px solid var(--ds-border-default, rgba(0, 0, 0, .07));background:var(--ds-surface-default, #ffffff);box-sizing:border-box}.bf-slippage-head h3{margin:0;color:var(--ds-content-highest, #000000);font-size:20px;font-weight:600;line-height:1.25;letter-spacing:0}.bf-slippage-close{position:absolute;top:24px;right:24px;display:inline-flex;width:24px;height:24px;align-items:center;justify-content:center;padding:0;border:0;background:transparent;color:var(--ds-content-low, rgba(0, 0, 0, .4));cursor:pointer}.bf-slippage-close:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.bf-slippage-body{display:flex;flex:1;min-height:0;flex-direction:column;gap:24px;padding:24px;box-sizing:border-box}.bf-slippage-desc{margin:0;color:var(--ds-content-medium, rgba(0, 0, 0, .65));font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-slippage-controls{display:flex;flex-direction:column;gap:12px;width:100%}.bf-slippage-presets{display:flex;gap:8px;width:100%}.bf-slippage-preset{appearance:none;display:inline-flex;flex:1 1 0;min-width:0;min-height:48px;align-items:center;justify-content:center;padding:12px 8px;border:1px solid transparent;border-radius:12px;background:var(--ds-surface-medium, #f5f7fa);color:var(--ds-content-medium, rgba(0, 0, 0, .65));font:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer;box-sizing:border-box}.bf-slippage-preset:hover,.bf-slippage-preset[data-selected=true]{border-color:var(--ds-accent-primary-default, #00b4b7);background:var(--ds-accent-primary-low, #e7f9f8)}.bf-slippage-custom{display:flex;min-height:48px;align-items:center;gap:8px;padding:12px;border:1px solid transparent;border-radius:12px;background:var(--ds-surface-medium, #f5f7fa);color:var(--ds-content-high, rgba(0, 0, 0, .85));box-sizing:border-box}.bf-slippage-custom:focus-within,.bf-slippage-custom[data-selected=true]{border-color:var(--ds-accent-primary-default, #00b4b7)}.bf-slippage-custom input{width:100%;min-width:0;padding:0;border:0;outline:0;background:transparent;color:var(--ds-content-high, rgba(0, 0, 0, .85));font:inherit;font-size:16px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-slippage-custom input::placeholder{color:var(--ds-content-lowest, rgba(0, 0, 0, .25))}.bf-slippage-custom span:not(.bf-sr-only){flex-shrink:0;color:var(--ds-content-high, rgba(0, 0, 0, .85));font-size:16px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-slippage-apply{appearance:none;margin-top:auto;width:100%;min-height:48px;padding:12px;border:0;border-radius:12px;background:var(--ds-accent-primary-default, #00b4b7);color:var(--ds-accent-primary-on-primary, #ffffff);font:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer;box-sizing:border-box}.bf-slippage-apply:hover{filter:brightness(.96)}.bf-action-modal-overlay{--bf-bg: var(--ds-bg-default, #1e232e);--bf-surface: var(--ds-surface-medium, rgba(255, 255, 255, .05));--bf-surface-hover: var(--ds-surface-high, rgba(255, 255, 255, .08));--bf-border: var(--ds-border-default, rgba(255, 255, 255, .12));--bf-text-high: var(--ds-content-high, rgba(255, 255, 255, .92));--bf-text-medium: var(--ds-content-medium, rgba(255, 255, 255, .65));--bf-text-low: var(--ds-content-low, rgba(255, 255, 255, .4));position:fixed;inset:0;z-index:100003;display:flex;align-items:center;justify-content:center;padding:24px;background:#040912b8;pointer-events:auto;box-sizing:border-box}.bf-action-modal-overlay[data-theme=light]{--bf-bg: var(--ds-bg-default, #ffffff);--bf-surface: var(--ds-surface-medium, rgba(18, 18, 18, .05));--bf-surface-hover: var(--ds-surface-high, rgba(18, 18, 18, .1));--bf-border: var(--ds-border-default, rgba(18, 18, 18, .08));--bf-text-high: var(--ds-content-high, rgba(18, 18, 18, .85));--bf-text-medium: var(--ds-content-medium, rgba(18, 18, 18, .65));--bf-text-low: var(--ds-content-low, rgba(18, 18, 18, .4))}.bf-action-modal{display:flex;width:min(480px,calc(100vw - 48px));flex-direction:column;align-items:center;gap:24px;padding:48px 24px 24px;border:1px solid var(--bf-border);border-radius:24px;background:var(--bf-bg);color:#fff;box-shadow:0 24px 80px #00000073;box-sizing:border-box}.bf-action-modal h3{width:100%;margin:0;color:var(--bf-text-high);font-size:24px;font-weight:700;line-height:1.25;text-align:center;letter-spacing:0}.bf-action-modal-desc{max-width:380px;margin:0;color:var(--bf-text-low);font-size:15px;font-weight:500;line-height:1.45;text-align:center;letter-spacing:0}.bf-terms-check-row{display:grid;width:100%;min-height:56px;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:12px;padding:14px 16px;border:none;border-radius:12px;background:var(--bf-surface);color:var(--bf-text-medium);font-size:16px;font-weight:700;line-height:1.4;box-sizing:border-box;cursor:pointer;touch-action:manipulation;user-select:none}.bf-terms-check-button{appearance:none;display:grid;min-width:0;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:12px;padding:0;border:0;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer;touch-action:manipulation}.bf-terms-check-button:focus-visible .bf-terms-checkbox{outline:2px solid var(--ds-accent-primary-default, #00ceb2);outline-offset:2px}.bf-terms-checkbox{position:relative;display:inline-flex;width:20px;height:20px;align-items:center;justify-content:center;border:1px solid rgba(124,143,180,.72);border-radius:5px;background:transparent;box-sizing:border-box}.bf-terms-checkbox[data-checked=true]{border-color:var(--ds-accent-primary-default, #00ceb2);background:var(--ds-accent-primary-default, #00ceb2)}.bf-terms-checkbox[data-checked=true]:after{width:8px;height:4px;border:solid var(--ds-accent-primary-on, #000000);border-width:0 0 2px 2px;content:"";transform:rotate(-45deg) translate(1px,-1px)}.bf-terms-check-row a{position:relative;z-index:1;color:var(--ds-accent-primary-default, #00ceb2);font-size:14px;font-weight:700;text-decoration:none;white-space:nowrap}.bf-terms-privacy{max-width:380px;margin:0;color:var(--bf-text-low);font-size:15px;font-weight:500;line-height:1.45;text-align:center;letter-spacing:0}.bf-action-primary,.bf-action-secondary{display:inline-flex;width:100%;min-height:56px;align-items:center;justify-content:center;padding:14px 16px;border:0;border-radius:12px;font:inherit;font-size:18px;font-weight:700;line-height:1.4;letter-spacing:0;cursor:pointer}.bf-action-primary{background:var(--ds-accent-primary-default, #00ceb2);color:var(--ds-accent-primary-on, #000000)}.bf-action-primary:disabled{cursor:not-allowed;opacity:.35}.bf-action-primary[aria-busy=true]{gap:8px;opacity:1}.bf-action-button-spinner{width:18px;height:18px;border:2px solid rgba(0,0,0,.22);border-top-color:currentColor;border-right-color:currentColor;border-radius:999px;animation:bf-loading-spin .9s linear infinite}.bf-action-secondary{background:var(--bf-surface);color:var(--bf-text-low)}.bf-action-secondary:disabled{cursor:not-allowed;opacity:.5}.bf-approve-address-box{display:flex;width:100%;flex-direction:column;gap:10px;padding:16px;border:1px solid var(--bf-border);border-radius:12px;background:var(--bf-surface);box-sizing:border-box}.bf-approve-address-box>span{color:var(--bf-text-low);font-size:14px;font-weight:700;line-height:1.4}.bf-approve-address-box>div{display:flex;min-width:0;align-items:center;justify-content:space-between;gap:12px}.bf-approve-address-box strong{min-width:0;overflow:hidden;color:var(--bf-text-high);font-size:15px;font-weight:500;line-height:1.5;text-overflow:ellipsis;white-space:nowrap}.bf-copy-button{flex-shrink:0;min-width:48px;min-height:32px;padding:6px 10px;border:1px solid rgba(0,206,178,.65);border-radius:8px;background:transparent;color:var(--ds-accent-primary-default, #00ceb2);font:inherit;font-size:12px;font-weight:700;line-height:1.2;cursor:pointer}.bf-copy-button:disabled{cursor:not-allowed;opacity:.45}.bf-action-buttons{display:grid;width:100%;grid-template-columns:1fr 1fr;gap:12px}.bf-approval-success-modal{gap:28px}.bf-success-mark{position:relative;display:inline-flex;width:96px;height:96px;flex-shrink:0;align-items:center;justify-content:center;border:12px solid rgba(0,206,178,.12);border-radius:999px;background:#00ceb2a8;box-shadow:0 0 0 10px #00ceb20f;box-sizing:border-box}.bf-success-mark:after{width:34px;height:18px;border:solid #ffffff;border-width:0 0 6px 6px;content:"";transform:rotate(-45deg) translate(2px,-3px)}.bf-status-toast{position:absolute;right:16px;bottom:14px;left:16px;z-index:5;display:flex;align-items:center;gap:12px;min-height:52px;padding:12px;border-radius:12px;background:var(--bf-toast-bg, #1e232e);color:var(--bf-toast-color, rgba(255, 255, 255, .85));box-shadow:0 8px 24px #0000003d;box-sizing:border-box}.bf-status-toast-icon{display:inline-flex;width:28px;height:28px;flex-shrink:0;align-items:center;justify-content:center;border-radius:999px}.bf-status-spinner{width:20px;height:20px;border:3px solid rgba(255,255,255,.18);border-top-color:var(--ds-accent-primary-default, #00ceb2);border-right-color:var(--ds-accent-primary-default, #00ceb2);border-radius:999px;animation:bf-loading-spin .9s linear infinite}.bf-status-check{position:relative;width:20px;height:20px;border-radius:999px;background:var(--ds-accent-primary-default, #00ceb2)}.bf-status-check:after{position:absolute;top:6px;left:5px;width:8px;height:4px;border:solid var(--ds-accent-primary-on, #000000);border-width:0 0 2px 2px;content:"";transform:rotate(-45deg)}.bf-status-toast-copy{display:flex;min-width:0;flex:1;flex-direction:column}.bf-status-toast-copy strong,.bf-status-toast-copy span{overflow:hidden;text-overflow:ellipsis}.bf-status-toast-copy strong{color:var(--ds-content-inverted, #ffffff);font-size:14px;font-weight:600;line-height:1.5;letter-spacing:-.01em}.bf-status-toast-copy span{color:var(--ds-content-inverted, #ffffff);font-size:12px;font-weight:400;line-height:1.5;letter-spacing:-.01em}.bf-status-toast[data-variant=success] .bf-status-toast-copy span{color:var(--ds-accent-primary-on-inverted, #00e8c9)}.bf-status-toast[data-variant=error]{border:1px solid rgba(255,43,95,.28);background:var(--bf-toast-bg, #1e232e)}.bf-status-toast[data-variant=error] .bf-status-toast-copy strong{color:#fff}.bf-status-error-mark{display:inline-flex;width:24px;height:24px;align-items:center;justify-content:center;border-radius:999px;background:var(--ds-system-red-default, #ff2b5f);color:#fff;font-size:14px;font-weight:700;line-height:1}.bf-status-toast[data-variant=error] .bf-status-toast-copy span{color:#ffffffe0}.bf-success-overlay{--bf-bg: var(--ds-bg-default, #1e232e);--bf-border: var(--ds-border-default, rgba(255, 255, 255, .12));--bf-text-high: var(--ds-content-high, rgba(255, 255, 255, .92));--bf-text-medium: var(--ds-content-medium, rgba(255, 255, 255, .65));position:fixed;inset:0;z-index:100003;display:flex;align-items:center;justify-content:center;padding:24px;background:#000000b8;pointer-events:auto;box-sizing:border-box}.bf-success-overlay[data-theme=light]{--bf-bg: #ffffff;--bf-border: rgba(18, 18, 18, .08);--bf-text-high: rgba(18, 18, 18, .85);--bf-text-medium: rgba(18, 18, 18, .65);--bf-text-low: rgba(18, 18, 18, .4)}.bf-success-modal{display:flex;width:min(480px,calc(100vw - 48px));flex-direction:column;overflow:hidden;border:1px solid var(--bf-border);border-radius:24px;background:var(--bf-bg);color:var(--bf-text-high);box-shadow:0 24px 80px #00000073;box-sizing:border-box}.bf-success-head{display:flex;min-height:73px;align-items:center;justify-content:space-between;gap:16px;padding:24px;border-bottom:1px solid var(--ds-border-default, rgba(0, 0, 0, .07));box-sizing:border-box}.bf-success-head h3{min-width:0;margin:0;overflow:hidden;color:var(--ds-content-highest, #000000);font-size:20px;font-weight:600;line-height:1.25;text-overflow:ellipsis;white-space:nowrap}.bf-success-close{display:inline-flex;width:24px;height:24px;flex-shrink:0;align-items:center;justify-content:center;padding:0;border:0;background:transparent;color:var(--ds-content-low, rgba(0, 0, 0, .4));cursor:pointer}.bf-success-close:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.bf-success-body{display:flex;flex-direction:column;align-items:center;gap:24px;padding:40px 24px 24px;box-sizing:border-box}.bf-success-copy{display:flex;width:100%;flex-direction:column;align-items:center;gap:4px;color:var(--bf-text-medium);text-align:center}.bf-success-copy strong{color:var(--bf-text-high);font-size:24px;font-weight:700;line-height:1.25;letter-spacing:0}.bf-success-copy span{color:var(--bf-text-medium);font-size:15px;font-weight:500;line-height:1.5;letter-spacing:0}.bf-success-route{display:flex;align-items:center;justify-content:center;gap:12px}.bf-success-route .bf-token-icon{width:48px!important;height:48px!important;background:transparent;font-size:18px}.bf-success-route-arrow{color:var(--bf-text-low);font-size:24px;font-weight:500;line-height:1}.bf-success-ok{display:inline-flex;width:100%;min-height:48px;align-items:center;justify-content:center;padding:12px;border:0;border-radius:12px;background:#00b4b7e0;color:#fff;font:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer}@media(max-width:767px){.bf-success-body{padding:40px 24px 24px}.bf-success-copy strong{font-size:22px}.bf-success-copy span{font-size:14px}.bf-success-mark{width:88px;height:88px}.bf-success-route .bf-token-icon{width:44px!important;height:44px!important}}@keyframes bf-loading-spin{to{transform:rotate(360deg)}}.bf-swap-toggle{position:absolute;top:100px;left:50%;z-index:1;display:inline-flex;width:32px;height:32px;align-items:center;justify-content:center;padding:0;border:0;border-radius:9999px;background:var(--ds-accent-primary-default, #00ceb2);color:var(--ds-accent-primary-on, #000000);box-shadow:0 1px 5px #0000001f;cursor:pointer}.bf-swap-card[data-has-from-error=true] .bf-swap-toggle{top:132px}.bf-details{display:flex;flex-direction:column;gap:24px}.bf-exchange-rate{display:flex;width:100%;align-items:center;justify-content:center;gap:4px;padding:0 0 24px;border:0;background:transparent;color:var(--bf-text-low);font:inherit;font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em;cursor:pointer}.bf-exchange-rate:hover{color:var(--bf-text-medium)}.bf-detail-section,.bf-history-card{display:flex;flex-direction:column;gap:12px;padding:0;border-radius:12px;background:transparent;box-sizing:border-box}.bf-liquidity{display:flex;flex-direction:column;gap:12px;padding:16px;border-radius:12px;background:var(--bf-surface);box-sizing:border-box}.bf-root[data-view=history] .bf-liquidity,.bf-root[data-view=history] .bf-detail-section,.bf-root[data-view=history] .bf-history-card{background:var(--ds-surface-default, #ffffff)}.bf-detail-section h3{margin:0;color:var(--bf-text-high);font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em}.bf-tx-fee-section{gap:12px}.bf-tx-fee-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.bf-collapse-head{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;margin:0;padding:0;background:none;border:none;color:inherit;font:inherit;text-align:left;cursor:pointer}.bf-detail-section[data-open=true] .bf-collapse-head{padding-bottom:12px;border-bottom:1px solid var(--bf-border)}.bf-collapse-chevron{flex-shrink:0;color:var(--bf-text-low);transition:transform .2s ease}.bf-detail-section[data-open=true] .bf-collapse-chevron{transform:rotate(180deg)}.bf-collapse-body{display:flex;flex-direction:column;gap:14px}.bf-root[data-view=history] .bf-detail-section[data-open=true] .bf-collapse-head{border-bottom-color:var(--ds-border-default, rgba(0, 0, 0, .07))}.bf-root[data-view=history] .bf-collapse-chevron{color:var(--ds-content-low, rgba(0, 0, 0, .4))}.bf-tx-fee-total{display:inline-flex;align-items:center;justify-content:flex-end;gap:8px;min-width:0;color:var(--bf-text-medium);font-size:14px;font-weight:600;line-height:1.4;text-align:right}.bf-tx-fee-total>span:last-child[data-delegated=true]{text-decoration:line-through;text-decoration-thickness:2px;text-decoration-color:currentColor}.bf-fee-delegated{display:inline-flex;align-items:center;justify-content:center;min-height:24px;padding:2px 8px;border-radius:6px;background:#379cff2e;color:#4eb3ff;font-size:10px;font-weight:500;line-height:1.3;white-space:nowrap}.bf-tx-fee-token{width:16px;height:16px;flex-shrink:0;border-radius:999px;object-fit:cover}.bf-info-card{gap:14px}.bf-info-section{display:flex;flex-direction:column;gap:10px}.bf-info-section+.bf-info-section{padding-top:2px}.bf-info-section h4{margin:0;color:var(--bf-text-high);font-size:14px;font-weight:600;line-height:1.5}.bf-root[data-view=history] .bf-detail-section h3,.bf-root[data-view=history] .bf-info-section h4{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.bf-info-rows{display:flex;flex-direction:column;gap:8px}.bf-info-row{display:flex;align-items:center;justify-content:space-between;gap:12px;min-width:0;font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-liquidity-head{display:flex;align-items:center;justify-content:space-between;gap:12px;min-width:0;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-info-label{display:inline-flex;align-items:center;gap:6px;min-width:0;color:var(--bf-text-low)}.bf-tree-marker{width:10px;flex-shrink:0;color:var(--bf-text-low)}.bf-info-value{min-width:0;color:var(--bf-text-medium);text-align:right}.bf-info-route,.bf-info-value-token{display:inline-flex;align-items:center;gap:4px}.bf-info-route .bf-token-icon,.bf-info-value-token .bf-token-icon{flex-shrink:0}.bf-info-route-arrow{color:var(--bf-text-medium)}.bf-root[data-view=history] .bf-info-route-arrow{color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.bf-info-value[data-tone=accent]{color:var(--ds-accent-primary-high, #00a0a2)}.bf-info-value[data-tone=warning]{color:var(--ds-system-orange-high, #e56f00)}.bf-root[data-view=history] .bf-info-label,.bf-root[data-view=history] .bf-liquidity-head,.bf-root[data-view=history] .bf-tree-marker{color:var(--ds-content-low, rgba(0, 0, 0, .4))}.bf-root[data-view=history] .bf-info-value{color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.bf-root[data-view=history] .bf-info-value[data-tone=accent]{color:var(--ds-accent-primary-high, #00a0a2)}.bf-root[data-view=history] .bf-info-value[data-tone=warning]{color:var(--ds-system-orange-high, #e56f00)}.bf-liquidity-status{display:inline-flex;align-items:center;gap:6px;padding:4px 12px;border-radius:999px;font-size:13px;font-weight:600;line-height:1.4;white-space:nowrap}.bf-liquidity-status:before{content:"";display:inline-block;width:7px;height:7px;border-radius:50%;flex-shrink:0}.bf-liquidity-status[data-status=normal],.bf-liquidity-status:not([data-status]){background:#00ceb21f;color:var(--ds-accent-primary-default, #00ceb2)}.bf-liquidity-status[data-status=normal]:before,.bf-liquidity-status:not([data-status]):before{background:var(--ds-accent-primary-default, #00ceb2)}.bf-liquidity-status[data-status=low]{background:#e56f001f;color:#e56f00}.bf-liquidity-status[data-status=low]:before{background:#e56f00}.bf-liquidity-status[data-status=rebalancing]{background:#da0b2e1a;color:#da0b2e}.bf-liquidity-status[data-status=rebalancing]:before{background:#da0b2e}.bf-liquidity-track{height:8px;overflow:hidden;border-radius:999px;background:var(--bf-surface-hover)}.bf-liquidity-track span{display:block;height:100%;border-radius:inherit;background:var(--ds-accent-primary-default, #00ceb2)}.bf-liquidity-value{color:var(--bf-text-low);font-size:12px}.bf-error{padding:12px;border-radius:12px;background:#da0b2e1f;color:var(--ds-system-red-default, #da0b2e);font-size:13px;line-height:1.4}.bf-footer{display:flex;flex-shrink:0;flex-direction:column;align-items:center;gap:10px;padding:12px 24px 24px;background:var(--ds-bg-default, var(--bf-bg))}.bf-next{width:100%;min-height:48px;padding:12px;border:0;border-radius:12px;background:var(--ds-accent-primary-default, #00ceb2);color:var(--ds-accent-primary-on, #000000);font:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer}.bf-next:disabled{cursor:default;opacity:.6}.bf-powered{display:inline-flex;align-items:center;gap:3px;color:var(--bf-text-low);font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em;text-decoration:none}.bf-powered:focus-visible{border-radius:4px;outline:2px solid var(--ds-accent-primary-default, #00ceb2);outline-offset:2px}.bf-powered-brand{text-decoration:underline;text-underline-offset:2px}.bf-history-tabs{display:flex;align-items:center;gap:4px;width:100%}.bf-history-tab{position:relative;display:inline-flex;min-height:37px;align-items:center;justify-content:center;padding:8px 12px;border:0;background:transparent;color:var(--ds-content-lowest, rgba(0, 0, 0, .25));font:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:0;cursor:pointer}.bf-history-tab[data-active=true]{color:var(--ds-accent-primary-high, #00a0a2)}.bf-history-tab[data-active=true]:after{position:absolute;right:8px;bottom:0;left:8px;height:3px;border-radius:999px;background:var(--ds-accent-primary-high, #00a0a2);content:""}.bf-history-tab-dot{position:absolute;top:8px;right:4px;width:6px;height:6px;border-radius:999px;background:var(--ds-system-red-default, #da0b2e)}.bf-history-list{display:flex;flex-direction:column;gap:12px}.bf-history-item{display:flex;flex-direction:column;gap:8px;padding:12px;border-radius:12px;background:var(--ds-surface-default, #ffffff);box-sizing:border-box}.bf-history-item-head,.bf-history-meta,.bf-history-route,.bf-history-route-token{display:inline-flex;align-items:center}.bf-history-item-head{justify-content:space-between;gap:12px;width:100%}.bf-history-status{display:inline-flex;min-height:24px;align-items:center;justify-content:center;padding:3px 8px;border-radius:4px;background:var(--ds-system-orange-low, #fcf5e9);color:var(--ds-system-orange-high, #e56f00);font-size:12px;font-weight:500;line-height:1.5;letter-spacing:0;white-space:nowrap}.bf-history-status[data-status=completed]{background:var(--ds-system-green-low, #e7f9f8);color:var(--ds-system-green-high, #00a0a2)}.bf-history-status[data-status=failed]{background:var(--ds-system-red-low, rgba(218, 11, 46, .12));color:var(--ds-system-red-default, #da0b2e)}.bf-history-time{min-width:0;color:var(--ds-content-low, rgba(0, 0, 0, .4));font-size:12px;font-weight:500;line-height:1.5;letter-spacing:0;text-align:right;white-space:nowrap}.bf-history-item-body{display:flex;flex-direction:column;gap:4px}.bf-history-amount{color:var(--ds-content-high, rgba(0, 0, 0, .85));font-size:16px;font-weight:600;line-height:1.5;letter-spacing:0}.bf-history-meta{justify-content:space-between;gap:12px;min-width:0}.bf-history-usd{min-width:0;color:var(--ds-content-low, rgba(0, 0, 0, .4));font-size:12px;font-weight:500;line-height:1.5;letter-spacing:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bf-history-route{justify-content:flex-end;gap:4px;min-width:0;color:var(--ds-content-high, rgba(0, 0, 0, .85));font-size:12px;font-weight:600;line-height:1.5;letter-spacing:0}.bf-history-route-token{gap:4px;min-width:0}.bf-history-route-token span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bf-history-route-arrow{flex-shrink:0;color:var(--ds-content-low, rgba(0, 0, 0, .4))}.bf-empty{padding:32px 16px;text-align:center;color:var(--ds-content-low, rgba(0, 0, 0, .4));font-size:14px}.bf-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}@media(max-width:767px){.bf-token-picker-overlay{align-items:flex-end;padding:0}.bf-token-picker{width:100%;max-height:82dvh;min-height:min(520px,82dvh);border-right:0;border-bottom:0;border-left:0;border-radius:24px 24px 0 0}.bf-token-picker-handle{display:block;width:40px;height:4px;flex-shrink:0;align-self:center;margin:10px 0 0;border-radius:999px;background:#ffffff38}.bf-token-picker-head{min-height:55px;padding:12px 56px 16px 24px;border-bottom:0}.bf-token-picker-close{top:13px}.bf-token-search{margin:0 16px 12px}.bf-token-list{padding:0 16px 16px}.bf-slippage-overlay{align-items:flex-end;padding:0}.bf-slippage-dialog{width:100%;height:auto;min-height:316px;max-height:82dvh;border-right:0;border-bottom:0;border-left:0;border-radius:24px 24px 0 0}}.wi-drawer-content .bf-header{padding:16px}.wi-drawer-content .bf-header .bf-header-btn:last-child{top:16px;right:16px}.wi-drawer-content .bf-body,.wi-drawer-content .bf-history-body{padding:16px}
10
- `);var a=require("react/jsx-runtime"),xs=k.createContext(void 0);function mn(){return k.useContext(xs)}function Ec(e){let[t,n]=k.useState(void 0);return k.useEffect(()=>{let o=e.current;if(!o)return;let r=()=>{let i=o.closest("[data-theme]");n(i?.getAttribute("data-theme")??void 0)};r();let s=new MutationObserver(r);return s.observe(document.documentElement,{attributes:!0,subtree:!0,attributeFilter:["data-theme"]}),()=>s.disconnect()},[e]),t}var ms=[{value:"auto",label:"Auto"},{value:"0.1",label:"0.1%"},{value:"0.5",label:"0.5%"},{value:"1",label:"1%"}],Ac={dev:"https://dev.crossdefi.io",stage:"https://stg.crossdefi.io",production:"https://crossdefi.io"},Pc=[{value:"all",label:"ALL"},{value:"completed",label:"Completed"},{value:"pending",label:"Pending"}];function Bc(e){return e==="auto"?"Auto":e?`${e}%`:"0.5%"}function gs(e){let t=e.replace(/[^\d.]/g,""),[n="",...o]=t.split("."),r=o.join("");return o.length===0?n:`${n}.${r.slice(0,2)}`}function Fc(e){return`${e.chainId}:${e.address.toLowerCase()}`}function vs(e){let t=Number(e);return Number.isFinite(t)?t.toLocaleString("en-US",{maximumFractionDigits:t>=1?2:6}):e||"0"}function hs(e,t){let n=Number(e||"0"),o=t?.priceUsd??0;return`\u2248 $${(Number.isFinite(n)?n*o:0).toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})} USD`}function Mc(e){if(e.priceUsd===void 0)return null;let t=new Pt.default(e.balance||"0");return t.isFinite()?`\u2248 $${t.multipliedBy(e.priceUsd).toFormat(2)} USD`:null}function _c(e){if(e.priceUsd===void 0)return null;let t=new Pt.default(e.priceUsd);return t.isFinite()?`$${t.toFormat(t.isLessThan(1)?4:2)}`:null}function ys(e){if(!e.isFinite()||e.isNaN())return"0";let n=e.decimalPlaces(6,Pt.default.ROUND_DOWN).toFixed(6).replace(/\.?0+$/,""),[o="0",r]=n.split("."),s=new Pt.default(o||"0").toFormat(0);return r?`${s}.${r}`:s}function Oc(e){return e.length<=14?e:`${e.slice(0,6)}...${e.slice(-6)}`}function zc(e){let t=new Date(e);if(Number.isNaN(t.getTime()))return e;let n=o=>o.toString().padStart(2,"0");return[`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}`,`${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`].join(" ")}function Wc(e){let t=new Pt.default(e||"0");return!t.isFinite()||t.isNaN()?e||"0":ys(t)}function Dc(e,t){if(t?.priceUsd===void 0)return null;let n=new Pt.default(e||"0").multipliedBy(t.priceUsd);return!n.isFinite()||n.isNaN()?null:`$${n.toFormat(2)}`}function No(e){return e.status==="success"?"completed":e.status==="failed"?"failed":"pending"}function Hc(e,t){return t==="all"?!0:No(e)===t}function Gc(e){return e==="completed"?"Completed":e==="failed"?"Failed":"Pending"}function bs(e){return e===56||e===97?"BSC":e===612044||e===5555?"CROSS":`Chain ${e}`}function ks(e,t){return!!e&&!!t&&e.chainId===t.chainId&&e.address.toLowerCase()===t.address.toLowerCase()}function Ss(e,t){if(!(!e||!t))return e.chainId===t.chainId?"swap":ks(e,t)||e.symbol.toLowerCase()===t.symbol.toLowerCase()?"bridge":"swap-bridge"}function Cs(e){return e==="swap"||e==="deposit-swap"||e==="swap-withdraw"}function Co(e){return!e||e==="0"||Number(e)===0}function Uc(e){let t=e.trim().toLowerCase();return t?t.startsWith("minimum ")?{from:e}:t.startsWith("available ")&&t.includes("or more")?{to:e}:t.includes("insufficient balance")||t.includes("not enough balance")||t.includes("exceeds balance")?{from:e}:t.includes("insufficient liquidity")||t.includes("not enough liquidity")?{to:e}:{}:{}}function $c(e){let t=e.fromToken,n=e.toToken,o=Ss(t,n),r=e.fromAmount||"0",s=e.toAmount||"0",i=o!==void 0&&!Cs(o),l=o!==void 0&&o!=="bridge";return{pathType:o,bridgeInfo:i?[{label:"Route",value:t&&n?`${bs(t.chainId)} \u2192 ${bs(n.chainId)}`:"-"},{label:"Validator Fee",value:Co(r)?"0":"Free",tone:Co(r)?"default":"accent"},{label:"Network Fee",value:Co(r)?"0":"Free",tone:Co(r)?"default":"accent"}]:void 0,swapInfo:l?[t&&n?{label:"Route",value:"",routeTokens:[{symbol:t.symbol,iconUrl:t.iconUrl},{symbol:n.symbol,iconUrl:n.iconUrl}]}:{label:"Route",value:"-"},{label:"Price Impact",value:"0%"},{label:"In Amount",value:r,valueToken:t?{symbol:t.symbol,iconUrl:t.iconUrl}:void 0},{label:"Swap Fee",value:"0",valueToken:t?{symbol:t.symbol,iconUrl:t.iconUrl}:void 0},{label:"Out Amount",value:s,valueToken:n?{symbol:n.symbol,iconUrl:n.iconUrl}:void 0}]:void 0,txFee:[{label:"Priority Fee Per Gas",value:"0 Gwei"},{label:"Max Fee Per Gas",value:"0 Gwei"},{label:"Gas Limit",value:"0"}],txFeeInfo:{estTxFee:"0",isDelegateFee:!1}}}function En({token:e,size:t=20}){let n=e?.iconUrl;return(0,a.jsx)("span",{className:"bf-token-icon","data-has-image":!!n?"true":"false",style:{width:t,height:t},children:n?(0,a.jsx)("img",{src:n,alt:"",width:t,height:t,draggable:!1}):(0,a.jsx)("span",{className:"bf-token-fallback",children:e?.symbol?.slice(0,1)??"?"})})}function ws({label:e,token:t,amount:n,usd:o,onAmountChange:r,onTokenClick:s,onMax:i}){return(0,a.jsxs)("section",{className:"bf-amount-panel",children:[(0,a.jsxs)("div",{className:"bf-amount-head",children:[(0,a.jsx)("span",{children:e}),(0,a.jsxs)("span",{className:"bf-balance",children:[vs(t?.balance??"0")," ",t?.symbol??"",i&&(0,a.jsx)("button",{type:"button",className:"bf-max-btn",onClick:i,children:"MAX"})]})]}),(0,a.jsxs)("div",{className:"bf-amount-main",children:[(0,a.jsxs)("label",{className:"bf-amount-input-wrap",children:[(0,a.jsxs)("span",{className:"bf-sr-only",children:[e," amount"]}),(0,a.jsx)("input",{type:"text",inputMode:"decimal",value:n,onChange:l=>r(l.target.value),placeholder:"0",className:"bf-amount-input"}),(0,a.jsx)("span",{className:"bf-amount-usd",children:o})]}),(0,a.jsxs)("button",{type:"button",className:"bf-token-pill",onClick:s,disabled:!s,"aria-label":`Select ${e.toLowerCase()} token`,children:[(0,a.jsx)(En,{token:t}),(0,a.jsx)("span",{children:t?.symbol??"Select"}),(0,a.jsx)(Vt,{size:16})]})]})]})}function jc({flow:e,side:t,onClose:n}){let o=k.useId(),[r,s]=k.useState(""),[i,l]=k.useState(null),p=t==="from"?e.fromToken:e.toToken;k.useEffect(()=>{l(document.body)},[]),k.useEffect(()=>{let m=v=>{v.key==="Escape"&&n()};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[n]);let c=k.useMemo(()=>t==="from"?e.tokens:e.availableToTokens,[e.availableToTokens,e.tokens,t]),f=k.useMemo(()=>{let m=r.trim().toLowerCase();return m?c.filter(v=>v.symbol.toLowerCase().includes(m)||v.name.toLowerCase().includes(m)):c},[r,c]),g=k.useCallback(m=>{t==="from"?e.selectFromToken(m):e.selectToToken(m),n()},[e,n,t]);if(!i)return null;let u=mn();return(0,nn.createPortal)((0,a.jsx)("div",{className:"bf-token-picker-overlay","data-theme":u,role:"presentation",onMouseDown:m=>{m.target===m.currentTarget&&n()},children:(0,a.jsxs)("section",{className:"bf-token-picker",role:"dialog","aria-modal":"true","aria-labelledby":o,children:[(0,a.jsx)("span",{className:"bf-token-picker-handle","aria-hidden":"true"}),(0,a.jsxs)("header",{className:"bf-token-picker-head",children:[(0,a.jsx)("h3",{id:o,children:"Select a token"}),(0,a.jsx)("button",{type:"button",className:"bf-token-picker-close",onClick:n,"aria-label":"Close token selector",children:(0,a.jsx)(vt,{size:24})})]}),(0,a.jsxs)("label",{className:"bf-token-search",children:[(0,a.jsx)(ns,{size:20}),(0,a.jsx)("span",{className:"bf-sr-only",children:"Search tokens"}),(0,a.jsx)("input",{value:r,onChange:m=>s(m.target.value),placeholder:"Search Tokens",autoComplete:"off",spellCheck:!1})]}),(0,a.jsxs)("div",{className:"bf-token-list",children:[f.map(m=>{let v=ks(m,p),x=v?_c(m):Mc(m);return(0,a.jsxs)("button",{type:"button",className:"bf-token-row","data-selected":v?"true":"false",onClick:()=>g(m),children:[(0,a.jsxs)("span",{className:"bf-token-row-left",children:[(0,a.jsx)(En,{token:m,size:40}),(0,a.jsxs)("span",{className:"bf-token-meta",children:[(0,a.jsx)("span",{className:"bf-token-symbol",children:m.symbol}),!v&&(0,a.jsx)("span",{className:"bf-token-name",children:m.name})]})]}),(0,a.jsxs)("span",{className:"bf-token-row-right",children:[(0,a.jsxs)("span",{className:"bf-token-balance",children:[vs(m.balance),v?null:` ${m.symbol}`]}),x&&(0,a.jsx)("span",{className:"bf-token-price",children:x})]})]},Fc(m))}),f.length===0&&(0,a.jsx)("div",{className:"bf-token-empty",children:"No tokens found"})]})]})}),i)}function Vc({flow:e,onClose:t}){let n=k.useId(),[o,r]=k.useState(null),s=ms.find(u=>u.value===e.slippage),[i,l]=k.useState(e.slippage&&!s?e.slippage:""),p=i.trim()!==""&&i.trim()!==".",c=u=>{e.setSlippage(u),t()},f=()=>{p&&(e.setSlippage(gs(i)),t())};if(k.useEffect(()=>{r(document.body)},[]),k.useEffect(()=>{let u=m=>{m.key==="Escape"&&t()};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[t]),!o)return null;let g=mn();return(0,nn.createPortal)((0,a.jsx)("div",{className:"bf-slippage-overlay","data-theme":g,role:"presentation",onMouseDown:u=>{u.target===u.currentTarget&&t()},children:(0,a.jsxs)("section",{className:"bf-slippage-dialog",role:"dialog","aria-modal":"true","aria-labelledby":n,children:[(0,a.jsxs)("header",{className:"bf-slippage-head",children:[(0,a.jsx)("h3",{id:n,children:"Slippage Settings"}),(0,a.jsx)("button",{type:"button",className:"bf-slippage-close",onClick:t,"aria-label":"Close slippage settings",children:(0,a.jsx)(vt,{size:24})})]}),(0,a.jsxs)("div",{className:"bf-slippage-body",children:[(0,a.jsx)("p",{className:"bf-slippage-desc",children:"The maximum price difference you are willing to accept before the transaction is reverted. Higher slippage increases the chance of execution but may result in a worse price."}),(0,a.jsxs)("div",{className:"bf-slippage-controls",children:[(0,a.jsx)("div",{className:"bf-slippage-presets",children:ms.map(u=>(0,a.jsx)("button",{type:"button",className:"bf-slippage-preset","data-selected":!p&&e.slippage===u.value?"true":"false",onClick:()=>c(u.value),children:u.label},u.value))}),(0,a.jsxs)("label",{className:"bf-slippage-custom","data-selected":p?"true":"false",children:[(0,a.jsx)("span",{className:"bf-sr-only",children:"Custom slippage percent"}),(0,a.jsx)("input",{value:i,onChange:u=>{l(gs(u.target.value))},onKeyDown:u=>{u.key==="Enter"&&(u.preventDefault(),f())},inputMode:"decimal",placeholder:"Enter custom slippage",autoComplete:"off",spellCheck:!1}),(0,a.jsx)("span",{"aria-hidden":"true",children:"%"})]})]}),p&&(0,a.jsx)("button",{type:"button",className:"bf-slippage-apply",onClick:f,children:"Apply"})]})]})}),o)}function qc({flow:e}){let t=k.useId(),[n,o]=k.useState(!1),[r,s]=k.useState(null),i=mn();return k.useEffect(()=>{s(document.body)},[]),k.useEffect(()=>{let l=p=>{p.key==="Escape"&&e.cancelTerms()};return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[e]),!r||!e.termsOpen?null:(0,nn.createPortal)((0,a.jsx)("div",{className:"bf-action-modal-overlay","data-theme":i,role:"presentation",onPointerDown:l=>{l.target===l.currentTarget&&e.cancelTerms()},children:(0,a.jsxs)("section",{className:"bf-action-modal bf-terms-modal",role:"dialog","aria-modal":"true","aria-labelledby":t,children:[(0,a.jsx)("h3",{id:t,children:"Agree to Terms of Service"}),(0,a.jsx)("p",{className:"bf-action-modal-desc",children:"Please make sure to review the Terms of Service before using CROSSD."}),(0,a.jsxs)("div",{className:"bf-terms-check-row","data-checked":n?"true":"false",children:[(0,a.jsxs)("button",{type:"button",className:"bf-terms-check-button",role:"checkbox","aria-checked":n,onClick:()=>o(l=>!l),children:[(0,a.jsx)("span",{className:"bf-terms-checkbox","data-checked":n?"true":"false","aria-hidden":"true"}),(0,a.jsx)("span",{children:"Agree to Terms of Use"})]}),e.termsUrl&&(0,a.jsx)("a",{href:e.termsUrl,target:"_blank",rel:"noreferrer",children:"Terms of Service"})]}),(0,a.jsx)("p",{className:"bf-terms-privacy",children:"I have read and acknowledged the Privacy Policy to use CROSSD"}),(0,a.jsx)("button",{type:"button",className:"bf-action-primary",disabled:!n||e.status==="submitting",onClick:e.confirmTerms,children:"Confirm"})]})}),r)}function Kc({value:e,disabled:t=!1}){let[n,o]=k.useState(!1);return(0,a.jsx)("button",{type:"button",className:"bf-copy-button","aria-label":"Copy token address",disabled:t,onClick:()=>{t||navigator.clipboard?.writeText(e).then(()=>{o(!0),window.setTimeout(()=>o(!1),1200)})},children:n?"OK":"Copy"})}function Qc({flow:e,approval:t}){let n=k.useId(),[o,r]=k.useState(null),s=mn();if(k.useEffect(()=>{r(document.body)},[]),k.useEffect(()=>{let p=c=>{e.status!=="submitting"&&c.key==="Escape"&&e.cancelApproval()};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[e]),!o)return null;let i=e.status==="submitting"||!e.approveBridge,l=e.status==="submitting";return(0,nn.createPortal)((0,a.jsx)("div",{className:"bf-action-modal-overlay","data-theme":s,role:"presentation",children:(0,a.jsxs)("section",{className:"bf-action-modal bf-approve-modal",role:"dialog","aria-modal":"true","aria-labelledby":n,children:[(0,a.jsxs)("h3",{id:n,children:["Approve ",t.token.symbol]}),(0,a.jsx)(En,{token:t.token,size:72}),(0,a.jsxs)("div",{className:"bf-approve-address-box",children:[(0,a.jsx)("span",{children:"Token Address"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("strong",{children:t.tokenAddress}),(0,a.jsx)(Kc,{value:t.tokenAddress,disabled:l})]})]}),(0,a.jsxs)("div",{className:"bf-action-buttons",children:[(0,a.jsx)("button",{type:"button",className:"bf-action-secondary",onClick:e.cancelApproval,disabled:e.status==="submitting",children:"Cancel"}),(0,a.jsxs)("button",{type:"button",className:"bf-action-primary",onClick:e.confirmApproval,disabled:i,"aria-busy":l,children:[l&&(0,a.jsx)("span",{className:"bf-action-button-spinner","aria-hidden":"true"}),(0,a.jsx)("span",{children:l?"Approving...":"Approve"})]})]})]})}),o)}function Zc({flow:e}){let t=k.useId(),[n,o]=k.useState(null),r=mn();return k.useEffect(()=>{o(document.body)},[]),k.useEffect(()=>{if(!e.approvalSuccessOpen)return;let s=i=>{i.key==="Escape"&&e.cancelApproval()};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[e]),!n||!e.approvalSuccessOpen?null:(0,nn.createPortal)((0,a.jsx)("div",{className:"bf-action-modal-overlay","data-theme":r,role:"presentation",children:(0,a.jsxs)("section",{className:"bf-action-modal bf-approval-success-modal",role:"dialog","aria-modal":"true","aria-labelledby":t,children:[(0,a.jsx)("h3",{id:t,children:"Approval Success"}),(0,a.jsx)("span",{className:"bf-success-mark","aria-hidden":"true"}),(0,a.jsxs)("p",{className:"bf-action-modal-desc",children:["Token approval confirmed successfully.",(0,a.jsx)("br",{}),"Please continue to the next step."]}),(0,a.jsxs)("div",{className:"bf-action-buttons",children:[(0,a.jsx)("button",{type:"button",className:"bf-action-secondary",onClick:e.cancelApproval,children:"Cancel"}),(0,a.jsx)("button",{type:"button",className:"bf-action-primary",onClick:e.continueAfterApproval,children:"Continue"})]})]})}),n)}function Yc({fromAmount:e,toAmount:t,fromToken:n,toToken:o}){let[r,s]=k.useState(!1),i=k.useMemo(()=>{let c=new Pt.default(e||"0"),f=new Pt.default(t||"0");return!c.isFinite()||!f.isFinite()||c.lte(0)||f.lte(0)?null:r?c.dividedBy(f):f.dividedBy(c)},[e,r,t]);if(!i||!n||!o)return null;let l=r?o.symbol:n.symbol,p=r?n.symbol:o.symbol;return(0,a.jsxs)("button",{type:"button",className:"bf-exchange-rate",onClick:()=>s(c=>!c),children:[(0,a.jsxs)("span",{children:["1 ",l]}),(0,a.jsx)(ss,{size:12}),(0,a.jsxs)("span",{children:[ys(i)," ",p]})]})}function Xc({flow:e}){return e.submitToast?(0,a.jsxs)("div",{className:"bf-status-toast","data-variant":"processing",role:"status","aria-live":"polite",children:[(0,a.jsx)("span",{className:"bf-status-toast-icon","aria-hidden":"true",children:(0,a.jsx)("span",{className:"bf-status-spinner"})}),(0,a.jsxs)("span",{className:"bf-status-toast-copy",children:[(0,a.jsx)("strong",{children:"Transaction Processing"}),(0,a.jsx)("span",{children:"Your transaction is being processed on the blockchain"})]})]}):null}function Jc({message:e}){let[t,n]=k.useState(!1);return k.useEffect(()=>{if(!e){n(!1);return}n(!0);let o=window.setTimeout(()=>{n(!1)},3500);return()=>window.clearTimeout(o)},[e]),!e||!t?null:(0,a.jsxs)("div",{className:"bf-status-toast","data-variant":"error",role:"alert","aria-live":"assertive",children:[(0,a.jsx)("span",{className:"bf-status-toast-icon","aria-hidden":"true",children:(0,a.jsx)("span",{className:"bf-status-error-mark",children:"!"})}),(0,a.jsxs)("span",{className:"bf-status-toast-copy",children:[(0,a.jsx)("strong",{children:"Error"}),(0,a.jsx)("span",{children:e})]})]})}function ed(e){switch(e){case"swap":case"deposit-swap":case"swap-withdraw":return"Swap Transaction Sent";case"bridge":return"Bridge Transaction Sent";case"swap-bridge":return"Swap & Bridge Transaction Sent";case"bridge-swap":return"Bridge & Swap Transaction Sent";default:return"Transaction Sent"}}function td({flow:e}){let t=k.useId(),[n,o]=k.useState(null),r=e.submitted,s=mn();return k.useEffect(()=>{o(document.body)},[]),k.useEffect(()=>{if(!e.successDialogOpen)return;let i=l=>{l.key==="Escape"&&e.dismissSuccessDialog()};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[e]),!n||!e.successDialogOpen||!r?null:(0,nn.createPortal)((0,a.jsx)("div",{className:"bf-success-overlay","data-theme":s,role:"presentation",children:(0,a.jsx)("section",{className:"bf-success-modal",role:"dialog","aria-modal":"true","aria-labelledby":t,children:(0,a.jsxs)("div",{className:"bf-success-body",children:[(0,a.jsx)("span",{className:"bf-success-mark","aria-hidden":"true"}),(0,a.jsxs)("div",{className:"bf-success-copy",children:[(0,a.jsx)("strong",{id:t,children:ed(r.pathType)}),(0,a.jsx)("span",{children:"Please check the results in the history."})]}),(0,a.jsx)("div",{className:"bf-success-route","aria-hidden":"true",children:(r.routeTokens&&r.routeTokens.length>0?r.routeTokens:[{symbol:r.fromToken.symbol,iconUrl:r.fromToken.iconUrl},{symbol:r.toToken.symbol,iconUrl:r.toToken.iconUrl}]).map((i,l)=>(0,a.jsxs)(k.Fragment,{children:[l>0&&(0,a.jsx)("span",{className:"bf-success-route-arrow",children:"\u2192"}),(0,a.jsx)(vr,{token:i,size:43})]},`${i.symbol}-${l}`))}),(0,a.jsx)("button",{type:"button",className:"bf-success-ok",onClick:e.dismissSuccessDialog,children:"OK"})]})})}),n)}function vr({token:e,size:t=16}){let n=!!e.iconUrl;return(0,a.jsx)("span",{className:"bf-token-icon","data-has-image":n?"true":"false",style:{width:t,height:t},children:e.iconUrl?(0,a.jsx)("img",{src:e.iconUrl,alt:"",width:t,height:t,draggable:!1}):(0,a.jsx)("span",{className:"bf-token-fallback",children:e.symbol?.slice(0,1)??"?"})})}function nd({row:e}){return e.routeTokens&&e.routeTokens.length>0?(0,a.jsx)("span",{className:"bf-info-route",children:e.routeTokens.map((t,n)=>(0,a.jsxs)(k.Fragment,{children:[n>0&&(0,a.jsx)("span",{className:"bf-info-route-arrow","aria-hidden":"true",children:"\u2192"}),(0,a.jsx)(vr,{token:t})]},`${t.symbol}-${n}`))}):e.valueToken?(0,a.jsxs)("span",{className:"bf-info-value-token",children:[(0,a.jsx)(vr,{token:e.valueToken}),(0,a.jsx)("span",{children:e.value})]}):(0,a.jsx)(a.Fragment,{children:e.value})}function Ns({rows:e}){return!e||e.length===0?null:(0,a.jsx)("div",{className:"bf-info-rows",children:e.map((t,n)=>(0,a.jsxs)("div",{className:"bf-info-row",children:[(0,a.jsxs)("span",{className:"bf-info-label",children:[(0,a.jsx)("span",{className:"bf-tree-marker",children:n===e.length-1?"\u2514":"\u251C"}),(0,a.jsx)("span",{children:t.label})]}),(0,a.jsx)("span",{className:"bf-info-value","data-tone":t.tone??"default",children:(0,a.jsx)(nd,{row:t})})]},`${t.label}-${t.value}`))})}function od(e,t,n){return e.pathType==="bridge"?"Bridge Info":Cs(e.pathType)?"Swap Info":t&&n?"Swap & Bridge Info":t?"Bridge Info":"Swap Info"}function rd({summary:e}){let t=!!e.bridgeInfo?.length,n=!!e.swapInfo?.length,o=t&&n,r=e.pathType==="bridge-swap"?["bridge","swap"]:["swap","bridge"];return(0,a.jsx)(a.Fragment,{children:r.map(s=>{let i=s==="swap"?e.swapInfo:e.bridgeInfo;return i?.length?(0,a.jsxs)("div",{className:"bf-info-section",children:[o&&(0,a.jsx)("h4",{children:s==="swap"?"Swap Info":"Bridge Info"}),(0,a.jsx)(Ns,{rows:i})]},s):null})})}function id({summary:e}){let t=!!e.bridgeInfo?.length,n=!!e.swapInfo?.length,o=!!e.txFee?.length,r=od(e,t,n),[s,i]=k.useState(!0),[l,p]=k.useState(!0);return(0,a.jsxs)("div",{className:"bf-details",children:[e.liquidity&&(0,a.jsxs)("section",{className:"bf-liquidity",children:[(0,a.jsxs)("div",{className:"bf-liquidity-head",children:[(0,a.jsx)("span",{children:e.liquidity.label??"Available Liquidity"}),(0,a.jsx)("span",{className:"bf-liquidity-status","data-status":e.liquidity.status,children:e.liquidity.status??"Normal"})]}),(0,a.jsx)("div",{className:"bf-liquidity-track",children:(0,a.jsx)("span",{style:{width:`${e.liquidity.percentage??50}%`}})}),(0,a.jsx)("span",{className:"bf-liquidity-value",children:e.liquidity.value})]}),(t||n)&&(0,a.jsxs)("section",{className:"bf-detail-section bf-info-card","data-open":s?"true":"false",children:[(0,a.jsxs)("button",{type:"button",className:"bf-collapse-head","aria-expanded":s,onClick:()=>i(c=>!c),children:[(0,a.jsx)("h3",{children:r}),(0,a.jsx)(Vt,{size:16,className:"bf-collapse-chevron"})]}),s&&(0,a.jsx)("div",{className:"bf-collapse-body",children:(0,a.jsx)(rd,{summary:e})})]}),o&&(0,a.jsxs)("section",{className:"bf-detail-section bf-tx-fee-section","data-open":l?"true":"false",children:[(0,a.jsxs)("button",{type:"button",className:"bf-collapse-head bf-tx-fee-head","aria-expanded":l,onClick:()=>p(c=>!c),children:[(0,a.jsx)("h3",{children:"Est. Tx Fee"}),(0,a.jsxs)("div",{className:"bf-tx-fee-total",children:[e.txFeeInfo?.isDelegateFee&&(0,a.jsx)("span",{className:"bf-fee-delegated",children:"Fee Delegated"}),e.txFeeInfo?.tokenIconUrl&&(0,a.jsx)("img",{className:"bf-tx-fee-token",src:e.txFeeInfo.tokenIconUrl,alt:e.txFeeInfo.tokenSymbol??"",width:16,height:16,draggable:!1}),(0,a.jsx)("span",{"data-delegated":e.txFeeInfo?.isDelegateFee||void 0,children:e.txFeeInfo?.estTxFee??"0"}),(0,a.jsx)(Vt,{size:16,className:"bf-collapse-chevron"})]})]}),l&&(0,a.jsx)("div",{className:"bf-collapse-body",children:(0,a.jsx)(Ns,{rows:e.txFee})})]})]})}function ad({item:e}){let t=No(e),n=Dc(e.fromAmount,e.fromToken);return(0,a.jsxs)("article",{className:"bf-history-item",children:[(0,a.jsxs)("div",{className:"bf-history-item-head",children:[(0,a.jsx)("span",{className:"bf-history-status","data-status":t,children:Gc(t)}),(0,a.jsx)("time",{className:"bf-history-time",dateTime:e.timestamp,children:zc(e.timestamp)})]}),(0,a.jsxs)("div",{className:"bf-history-item-body",children:[(0,a.jsxs)("strong",{className:"bf-history-amount",children:[Wc(e.fromAmount)," ",e.fromToken.symbol]}),(0,a.jsxs)("div",{className:"bf-history-meta",children:[(0,a.jsx)("span",{className:"bf-history-usd",children:n??Oc(e.txHash)}),(0,a.jsxs)("span",{className:"bf-history-route",children:[(0,a.jsxs)("span",{className:"bf-history-route-token",children:[(0,a.jsx)(En,{token:e.fromToken,size:16}),(0,a.jsx)("span",{children:e.fromToken.symbol})]}),(0,a.jsx)(as,{size:16,className:"bf-history-route-arrow"}),(0,a.jsxs)("span",{className:"bf-history-route-token",children:[(0,a.jsx)(En,{token:e.toToken,size:16}),(0,a.jsx)("span",{children:e.toToken.symbol})]})]})]})]})]})}function sd({flow:e}){let[t,n]=k.useState("all"),o=e.history.some(i=>No(i)==="pending"),r=e.history.filter(i=>Hc(i,t)),s=t==="all"?"No bridge history yet.":`No ${t} bridge history.`;return(0,a.jsxs)("main",{className:"bf-history-body",children:[(0,a.jsx)("nav",{className:"bf-history-tabs","aria-label":"Bridge history filters",children:Pc.map(i=>(0,a.jsxs)("button",{type:"button",className:"bf-history-tab","data-active":t===i.value?"true":"false",onClick:()=>n(i.value),children:[(0,a.jsx)("span",{children:i.label}),i.value==="pending"&&o&&(0,a.jsx)("span",{className:"bf-history-tab-dot","aria-hidden":"true"})]},i.value))}),r.length>0?(0,a.jsx)("div",{className:"bf-history-list",children:r.map(i=>(0,a.jsx)(ad,{item:i},i.id||i.txHash))}):(0,a.jsx)("div",{className:"bf-empty",children:s})]})}function ld({flow:e,env:t}){let[n,o]=k.useState(null),[r,s]=k.useState(!1),[i,l]=k.useState(0),c=!!(e.fromAmount.trim()||e.toAmount.trim())?e.summary??$c(e):null,f=Ac[t],g=Uc(e.quoteError),u=e.quoteError&&!g.from&&!g.to?e.quoteError:"",m=e.error||u,v=e.history.some(y=>No(y)==="pending"),b=(c?.pathType??Ss(e.fromToken,e.toToken))!=="bridge";return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("main",{className:"bf-body",children:[(0,a.jsxs)("div",{className:"bf-toolbar",children:[(0,a.jsxs)("button",{type:"button",className:"bf-chip bf-chip-history",onClick:()=>e.setStep("history"),children:[(0,a.jsx)(os,{}),(0,a.jsx)("span",{children:"History"}),(v||e.hasNewHistory)&&(0,a.jsx)("span",{className:"bf-chip-dot","aria-hidden":"true"})]}),b&&(0,a.jsxs)("button",{type:"button",className:"bf-chip",onClick:()=>s(!0),"aria-haspopup":"dialog","aria-expanded":r,children:[(0,a.jsx)(rs,{}),(0,a.jsx)("span",{children:Bc(e.slippage)})]})]}),(0,a.jsxs)("div",{className:"bf-swap-card","data-has-from-error":g.from?"true":"false",children:[(0,a.jsx)(ws,{label:"From",token:e.fromToken,amount:e.fromAmount,usd:hs(e.fromAmount,e.fromToken),onAmountChange:y=>e.setAmount(y,"from"),onTokenClick:()=>o("from"),onMax:e.setMax}),g.from&&(0,a.jsx)("div",{className:"bf-field-error",children:g.from}),(0,a.jsx)("button",{type:"button",className:"bf-swap-toggle",onClick:()=>{e.swapTokens(),l(y=>y+360)},style:{transform:`translateX(-50%) rotate(${i}deg)`,transition:"transform 0.2s ease"},children:(0,a.jsx)(is,{size:22})}),(0,a.jsx)(ws,{label:"To",token:e.toToken,amount:e.toAmount,usd:hs(e.toAmount,e.toToken),onAmountChange:y=>e.setAmount(y,"to"),onTokenClick:()=>o("to")}),g.to&&(0,a.jsx)("div",{className:"bf-field-error",children:g.to})]}),(0,a.jsx)(Yc,{fromAmount:e.fromAmount,toAmount:e.toAmount,fromToken:e.fromToken,toToken:e.toToken}),c&&(0,a.jsx)(id,{summary:c})]}),(0,a.jsxs)("footer",{className:"bf-footer",children:[(0,a.jsx)("button",{type:"button",className:"bf-next",onClick:e.submit,disabled:e.status==="submitting"||!!e.quoteError,children:e.status==="submitting"?"Processing...":"Next"}),(0,a.jsxs)("a",{className:"bf-powered",href:f,target:"_blank",rel:"noreferrer",children:["Powered by ",(0,a.jsx)("span",{className:"bf-powered-brand",children:"CROSS DeFi"})]})]}),n&&(0,a.jsx)(jc,{flow:e,side:n,onClose:()=>o(null)}),r&&(0,a.jsx)(Vc,{flow:e,onClose:()=>s(!1)}),(0,a.jsx)(qc,{flow:e}),e.approvalInfo&&(0,a.jsx)(Qc,{flow:e,approval:e.approvalInfo}),(0,a.jsx)(Zc,{flow:e}),(0,a.jsx)(Xc,{flow:e}),(0,a.jsx)(Jc,{message:e.submitToast?"":m}),(0,a.jsx)(td,{flow:e})]})}function An({onClose:e,onBackToWallet:t,env:n,className:o,...r}){let s=k.useMemo(()=>Ie(n),[n]),i=us({...r,onExit:t}),l=k.useRef(null),p=Ec(l),c=i.step==="history"?"History":"Swap & Bridge";return(0,a.jsx)(xs.Provider,{value:p,children:(0,a.jsxs)("div",{ref:l,className:X("bf-root",o),"data-view":i.step,"data-status":i.status,children:[(0,a.jsxs)("header",{className:"bf-header",children:[(0,a.jsx)("button",{type:"button",className:"bf-header-btn",onClick:i.back,"aria-label":"Back",children:(0,a.jsx)(Lt,{size:24})}),(0,a.jsx)("span",{className:"bf-header-title",children:c}),(0,a.jsx)("button",{type:"button",className:"bf-header-btn",onClick:e,"aria-label":"Close",children:(0,a.jsx)(vt,{size:24})})]}),i.step==="history"?(0,a.jsx)(sd,{flow:i}):(0,a.jsx)(ld,{flow:i,env:s})]})})}var d=require("react/jsx-runtime");function yr(e,t,n){let o=ze[e],r=n.toUpperCase();if(t===o.cross&&r.includes("CROSSD"))return 0;if(t===o.cross&&r==="CROSS")return 1;if(t===o.bsc&&r==="CROSS")return 2}function cd(e){return parseInt(e.split(":")[1],10)}function dd(e){let t=e.lastIndexOf(".");return t===-1?{main:e,decimal:""}:{main:e.slice(0,t),decimal:e.slice(t)}}function pd(e){let t=e.toLowerCase().replace(/^0x/,""),n=t.length>=8?t.slice(0,8):t.padEnd(8,"0"),o=parseInt(n.slice(0,4),16)%360,r=(o+60+parseInt(n.slice(4,8),16)%120)%360;return`linear-gradient(135deg, hsl(${o} 85% 65%), hsl(${r} 80% 55%))`}function Rs({align:e="end",sideOffset:t=12,className:n,children:o}){let{env:r,theme:s,isMobile:i,open:l,drawerDirection:p,modal:c,showBalance:f,showForgeToken:g,showGameToken:u,showQR:m,showBridge:v,qrLogoSrc:x,walletAddress:b,accountName:y,sendAccounts:L,profileImageUrl:h,preferredTokens:P,close:T,onSelectWallet:B,onCopyAddress:R,onBuy:$,onDisconnect:G,disconnectLabel:ee,termsUrl:V,termsLabel:D,privacyUrl:he,privacyLabel:ye,portalStyle:fe,navContent:ue,navPosition:De,footerContent:ie,view:j,setView:ne,selectedSendToken:Te,setSelectedSendToken:te,showPortfolio:He,portfolioTitle:Ge,showTotalAssets:Re,totalAssetsLabel:Ee,sendTransaction:gt,getTransactionReceipt:be,estimateGas:Nt,onOutlink:Je,lpBalanceReader:et,bridgeTokens:Ae,bridgeHistory:Me,getBridgeQuote:ke,getBridgeToTokens:pe,getBridgeApproval:Se,approveBridge:Tt,submitBridge:tt,onReceive:ht,onBridge:Ce,onSend:Ue,onBuyDisabledMessage:bt}=Mt(),[_e,nt]=A.useState(null),ot=A.useRef(void 0),$e=A.useCallback(w=>{nt(w),clearTimeout(ot.current),ot.current=setTimeout(()=>nt(null),4e3)},[]);A.useEffect(()=>()=>clearTimeout(ot.current),[]);let we=!!bt,je=A.useCallback(()=>{if(we){$e(bt);return}$?.()},[we,bt,$,$e]),{tokens:lt,isLoading:wt}=Zt(r,b,l&&f),{statsMap:Ve}=Yt(r,f),{categoryMap:Rt}=aa(r,f),It=f&&Re,{displayValue:rt,isLowerBound:xt,isLoading:Oe}=la(r,b,l&&It),[ct,C]=A.useState(!1),q=A.useRef(null),[re,qe]=A.useState(0),{holdings:Ke,isLoading:Bt}=ea(r,b,l&&f&&g),bn=A.useMemo(()=>Ke.map(w=>w.token),[Ke]),{imageMap:Fo}=ta(r,bn,g&&Ke.length>0),it=A.useMemo(()=>{let w=[],I=[],K=[],Pe=new Map((P??[]).map((Y,xe)=>[`${cd(Y.chainId)}:${Y.address.toLowerCase()}`,xe]));for(let Y of lt){let xe=yr(r,Y.chainId,Y.symbol)!==void 0,Gt=`${Y.chainId}:${Y.address.toLowerCase()}`,Ut=Pe.get(Gt),Go=new gn.default(Y.quantity.numeric).shiftedBy(-Y.quantity.decimals);if(xe)w.push(Y);else if(Ut!==void 0)I.push(Y);else if(Go.isGreaterThan(0)){if(!u&&Rt.get(lr(Y.chainId,Y.address))==="game")continue;K.push(Y)}}return w.sort((Y,xe)=>{let Gt=yr(r,Y.chainId,Y.symbol)??99,Ut=yr(r,xe.chainId,xe.symbol)??99;return Gt-Ut}),I.sort((Y,xe)=>{let Gt=Pe.get(`${Y.chainId}:${Y.address.toLowerCase()}`)??99,Ut=Pe.get(`${xe.chainId}:${xe.address.toLowerCase()}`)??99;return Gt-Ut}),K.sort((Y,xe)=>{let Gt=Ve.get(Et(Y.chainId,Y.address)),Ut=Ve.get(Et(xe.chainId,xe.address)),Go=new gn.default(Y.quantity.numeric).shiftedBy(-Y.quantity.decimals).multipliedBy(Gt?.price??0);return new gn.default(xe.quantity.numeric).shiftedBy(-xe.quantity.decimals).multipliedBy(Ut?.price??0).minus(Go).toNumber()}),[...w,...I,...K]},[lt,r,Ve,u,Rt,P]),M=A.useMemo(()=>{if(!g)return[];let w=new Set(lt.map(I=>I.address.toLowerCase()));return[...Ke].filter(I=>!w.has(I.token.toLowerCase())).sort((I,K)=>{let Pe=new gn.default(I.value);return new gn.default(K.value).minus(Pe).toNumber()})},[Ke,g,lt]),ce=A.useRef(!1),[_,me]=A.useState(null),Ft=A.useRef(void 0),Rr=_?.chainId??Te?.chainId??it[0]?.chainId??0,{transactionUrl:Mo}=no(r,Rr,_?.txHash,!!(_?.txHash&&Rr)),Qe=A.useCallback(w=>{ce.current=!0,ne(w)},[ne]),[Xs,_o]=A.useState("recipient"),Gn=A.useCallback(()=>{te(null),_o("recipient"),Qe("wallet")},[te,Qe]),Oo=A.useCallback((w,I="recipient")=>{_o(I),te(w),Qe("send")},[te,Qe]),Js=A.useCallback(()=>{if(Ce){Ce();return}Qe("bridge")},[Ce,Qe]),el=A.useCallback(w=>{clearTimeout(Ft.current),te(null),Qe("wallet"),me({status:"pending",txHash:w.txHash,chainId:w.chainId,description:`${w.amount} ${w.tokenSymbol} to ${Ze(w.recipient)}`})},[te,Qe]),tl=A.useCallback(w=>{let I=Te?.chainId;te(null),Qe("wallet"),!(!w||!I)&&(me(K=>({status:"success",txHash:w,chainId:I,description:K?.txHash===w?K.description:"Tap to see your transaction"})),clearTimeout(Ft.current),Ft.current=setTimeout(()=>me(null),5e3))},[Te?.chainId,te,Qe]),nl=A.useCallback(w=>{let I=w.txHash;I&&(me({status:"error",txHash:I,chainId:w.chainId,description:w.message}),clearTimeout(Ft.current),Ft.current=setTimeout(()=>me(null),5e3))},[]),zo=A.useMemo(()=>{if(ht)return ht;if(m)return()=>Qe("qr")},[ht,m,Qe]),Ir=A.useMemo(()=>{if(Ue)return Ue;if(it.length===0)return;let w=it[0];return()=>Oo(w,"token")},[Ue,it,Oo]);A.useEffect(()=>{l||(ce.current=!1,_o("recipient"))},[l]);let Lr=A.useRef(null);A.useEffect(()=>{let w=Lr.current;if(!w||!i)return;let I=K=>{K.pointerType==="touch"&&K.stopPropagation()};return w.addEventListener("pointerdown",I),()=>w.removeEventListener("pointerdown",I)},[i]);let[an,Er]=A.useState(!1),Wo=A.useRef(void 0),[wn,Un]=A.useState(!1);A.useEffect(()=>{if(!wn)return;let w=()=>Un(!1),I=Pe=>{Pe.key==="Escape"&&Un(!1)},K=setTimeout(()=>{document.addEventListener("mousedown",w,!0),document.addEventListener("keydown",I,!0)},0);return()=>{clearTimeout(K),document.removeEventListener("mousedown",w,!0),document.removeEventListener("keydown",I,!0)}},[wn]),A.useEffect(()=>()=>clearTimeout(Wo.current),[]),A.useEffect(()=>()=>clearTimeout(Ft.current),[]),A.useEffect(()=>{let w=q.current;if(!w||ie===null){qe(0);return}let I=()=>{qe(w.offsetHeight)};if(I(),typeof ResizeObserver>"u")return;let K=new ResizeObserver(I);return K.observe(w),()=>K.disconnect()},[ie]);let Ar=A.useCallback(async()=>{if(!an)try{await navigator.clipboard.writeText(b),Er(!0),clearTimeout(Wo.current),Wo.current=setTimeout(()=>Er(!1),2e3),R?.(b,!0)}catch{R?.(b,!1)}},[b,R,an]),$n=A.useCallback(w=>{w.currentTarget.setAttribute("data-loaded","true")},[]),Pr=A.useMemo(()=>({background:pd(b)}),[b]),jn=A.useMemo(()=>h||Kt(r,b,{size:120,bg:s==="dark"?"1A1A2E":"F3F6F8"}),[h,r,b,s]),Do=A.useMemo(()=>dd(rt),[rt]),Br=V||he?(0,d.jsxs)("div",{className:"wi-legal-links",children:[V&&(0,d.jsx)("a",{className:"wi-legal-link",href:V,target:"_blank",rel:"noopener noreferrer",onClick:w=>Ye(w,V,{category:"terms",origin:"terms"},Je),children:D}),V&&he&&(0,d.jsx)("span",{className:"wi-legal-sep","aria-hidden":!0,children:"\xB7"}),he&&(0,d.jsx)("a",{className:"wi-legal-link",href:he,target:"_blank",rel:"noopener noreferrer",onClick:w=>Ye(w,he,{category:"privacy",origin:"privacy"},Je),children:ye})]}):null,Fr=G?(0,d.jsxs)("button",{type:"button",className:"wi-disconnect-btn",onClick:()=>{G(),T()},children:[(0,d.jsx)(ni,{size:16}),(0,d.jsx)("span",{className:"wi-disconnect-label",children:ee})]}):null,ol=f&&!ue?(0,d.jsxs)("div",{className:"wi-action-row","aria-label":"Wallet actions",children:[(0,d.jsxs)("button",{type:"button",className:X("wi-action-card",we&&"wi-action-card--dimmed"),onClick:je,disabled:!$&&!we,"aria-disabled":we||void 0,"aria-label":"Buy",children:[(0,d.jsx)(li,{size:20}),(0,d.jsx)("span",{children:"Buy"})]}),v?(0,d.jsxs)("button",{type:"button",className:"wi-action-card",onClick:Js,"aria-label":"Bridge",children:[(0,d.jsx)(ci,{size:20}),(0,d.jsx)("span",{children:"Bridge"})]}):(0,d.jsxs)("button",{type:"button",className:"wi-action-card",onClick:zo,disabled:!zo,"aria-label":"Receive",children:[(0,d.jsx)(Zo,{size:20}),(0,d.jsx)("span",{children:"Receive"})]}),(0,d.jsxs)("button",{type:"button",className:"wi-action-card",onClick:Ir,disabled:!Ir,"aria-label":"Send",children:[(0,d.jsx)(ai,{size:20}),(0,d.jsx)("span",{children:"Send"})]}),(0,d.jsxs)("button",{type:"button",className:"wi-action-card",onClick:()=>Qe("portfolio"),disabled:!He,"aria-label":"View portfolio",children:[(0,d.jsx)(si,{size:20}),(0,d.jsx)("span",{children:"Portfolio"})]})]}):null,rl=(0,d.jsxs)("div",{className:X("wi-view-inner",ce.current&&"wi-view-wallet"),children:[It&&(0,d.jsxs)("div",{className:"wi-total-section",children:[(0,d.jsxs)("div",{className:"wi-total-head",children:[(0,d.jsx)("span",{className:"wi-total-label",children:Ee}),(0,d.jsx)("span",{role:"button",tabIndex:0,className:"wi-total-eye",onClick:w=>{w.stopPropagation(),C(I=>!I)},onKeyDown:w=>{(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),w.stopPropagation(),C(I=>!I))},"aria-label":ct?"Show balance":"Hide balance",children:ct?(0,d.jsx)(ri,{}):(0,d.jsx)(oi,{})})]}),(0,d.jsx)("div",{className:"wi-total-body",children:Oe?(0,d.jsx)("div",{className:"wi-skeleton-block wi-total-skeleton",style:{width:160,height:42}}):(0,d.jsx)("div",{className:"wi-total-value","data-hidden":ct||void 0,children:ct?(0,d.jsx)("span",{className:"wi-total-mask",children:"\u2022\u2022\u2022\u2022\u2022\u2022"}):(0,d.jsxs)(d.Fragment,{children:[xt&&(0,d.jsx)("span",{className:"wi-total-lte",children:"\u2264"}),(0,d.jsx)("span",{className:"wi-total-currency",children:"$"}),(0,d.jsx)("span",{className:"wi-total-amount",children:Do.main}),Do.decimal&&(0,d.jsx)("span",{className:"wi-total-decimal",children:Do.decimal})]})})})]}),De==="top"&&(ue?(0,d.jsx)("div",{className:"wi-nav-fixed",children:ue}):ol),f&&(0,d.jsx)("div",{ref:Lr,className:"wi-scrollable-body","data-vaul-no-drag":!0,children:(0,d.jsxs)("div",{className:"wi-token-list",children:[wt&&Array.from({length:5},(w,I)=>(0,d.jsxs)("div",{className:"wi-skeleton-item",children:[(0,d.jsxs)("div",{className:"wi-skeleton-left",children:[(0,d.jsx)("div",{className:"wi-skeleton-block wi-skeleton-icon"}),(0,d.jsxs)("div",{className:"wi-skeleton-lines",children:[(0,d.jsx)("div",{className:"wi-skeleton-block",style:{width:64,height:14}}),(0,d.jsx)("div",{className:"wi-skeleton-block",style:{width:80,height:12}})]})]}),(0,d.jsxs)("div",{className:"wi-skeleton-right",children:[(0,d.jsx)("div",{className:"wi-skeleton-block",style:{width:72,height:14}}),(0,d.jsx)("div",{className:"wi-skeleton-block",style:{width:48,height:12}})]})]},I)),!wt&&it.length===0&&!g&&(0,d.jsx)("div",{className:"wi-empty",children:"No Tokens Found"}),it.map(w=>{let I=Ve.get(Et(w.chainId,w.address)),K=I?parseFloat(I.percent_change_24h):null,Pe=K!==null&&K>=0,Y=Nn(r,w.chainId);return(0,d.jsxs)("button",{type:"button",className:"wi-token-item wi-token-item--button",onClick:()=>Oo(w),"aria-label":`Send ${w.symbol}`,children:[(0,d.jsxs)("div",{className:"wi-token-left",children:[(0,d.jsxs)("div",{className:"wi-token-icon-wrap",children:[(0,d.jsx)("img",{src:w.icon_url,alt:w.symbol,className:"wi-token-icon",width:32,height:32,loading:"lazy",draggable:!1,onLoad:$n,onError:xe=>{xe.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),Y&&(0,d.jsx)("img",{src:Y,alt:"","aria-hidden":!0,className:"wi-token-chain-badge",width:14,height:14,loading:"lazy",draggable:!1,onError:xe=>{xe.currentTarget.style.display="none"}})]}),(0,d.jsxs)("div",{className:"wi-token-info",children:[(0,d.jsx)("span",{className:"wi-token-name",children:w.symbol}),I&&(0,d.jsxs)("div",{className:"wi-token-price-row",children:[(0,d.jsx)("span",{className:"wi-token-price",children:Yo(I.price)}),(0,d.jsx)("span",{className:"wi-token-change","data-positive":Pe,"data-zero":K===0||void 0,children:K!==null&&(K===0?"0%":`${Pe?"+":"-"}${(Pe?Math.floor:Math.ceil)(Math.abs(K)*100)/100}%`)})]})]})]}),(0,d.jsxs)("div",{className:"wi-token-right",children:[(0,d.jsx)("span",{className:"wi-token-balance",children:Ot(w.quantity.numeric,w.quantity.decimals)}),I&&(0,d.jsx)("span",{className:"wi-token-value",children:pi(w.quantity.numeric,w.quantity.decimals,I.price)})]})]},`${w.address}-${w.chainId}`)}),g&&Bt&&Array.from({length:3},(w,I)=>(0,d.jsxs)("div",{className:"wi-skeleton-item",children:[(0,d.jsxs)("div",{className:"wi-skeleton-left",children:[(0,d.jsx)("div",{className:"wi-skeleton-block wi-skeleton-icon"}),(0,d.jsxs)("div",{className:"wi-skeleton-lines",children:[(0,d.jsx)("div",{className:"wi-skeleton-block",style:{width:64,height:14}}),(0,d.jsx)("div",{className:"wi-skeleton-block",style:{width:80,height:12}})]})]}),(0,d.jsxs)("div",{className:"wi-skeleton-right",children:[(0,d.jsx)("div",{className:"wi-skeleton-block",style:{width:72,height:14}}),(0,d.jsx)("div",{className:"wi-skeleton-block",style:{width:48,height:12}})]})]},`forge-sk-${I}`)),g&&!Bt&&!wt&&it.length===0&&M.length===0&&(0,d.jsx)("div",{className:"wi-empty",children:"No Tokens Found"}),g&&M.map(w=>{let I=Fo.get(w.token)||"",K=Nn(r,ze[r].cross);return(0,d.jsxs)("div",{className:"wi-token-item",children:[(0,d.jsxs)("div",{className:"wi-token-left",children:[(0,d.jsxs)("div",{className:"wi-token-icon-wrap",children:[(0,d.jsx)("img",{src:I||"https://contents.crosstoken.io/wallet/token/images/FT.png",alt:w.token_name,className:"wi-token-icon",width:32,height:32,loading:"lazy",draggable:!1,onLoad:$n,onError:Pe=>{Pe.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),K&&(0,d.jsx)("img",{src:K,alt:"","aria-hidden":!0,className:"wi-token-chain-badge",width:14,height:14,loading:"lazy",draggable:!1,onError:Pe=>{Pe.currentTarget.style.display="none"}})]}),(0,d.jsxs)("div",{className:"wi-token-info",children:[(0,d.jsx)("span",{className:"wi-token-name",children:w.token_name}),(0,d.jsx)("div",{className:"wi-token-price-row",children:(0,d.jsxs)("span",{className:"wi-token-price",children:[Ot(w.current_price,18)," CROSS"]})})]})]}),(0,d.jsxs)("div",{className:"wi-token-right",children:[(0,d.jsx)("span",{className:"wi-token-balance",children:Ot(w.balance,18)}),(0,d.jsx)("span",{className:"wi-token-value",children:Yo(w.current_value_usd)})]})]},`forge-${w.token}`)})]})}),De==="bottom"&&ue&&(0,d.jsx)("div",{className:"wi-nav-fixed",children:ue}),Fr&&(0,d.jsx)("div",{className:"wi-wallet-disconnect-row",children:Fr})]},"wallet"),il=He?(0,d.jsx)("div",{className:X("wi-view-inner wi-portfolio-body",ce.current&&"wi-view-portfolio"),children:(0,d.jsx)(Jt,{env:r,theme:s,walletAddress:b,showHeader:!1,onOutlink:Je,lpBalanceReader:et})},"portfolio"):null,al=Te?(0,d.jsx)("div",{className:X("wi-view-inner wi-send-body",ce.current&&"wi-view-send"),children:(0,d.jsx)(Tn,{env:r,theme:s,walletAddress:b,accountName:y,accounts:L,initialStep:Xs,token:Te,tokens:it,onTokenChange:te,sendTransaction:gt,getTransactionReceipt:be,estimateGas:Nt,getTokenPriceUsd:w=>{let I=Ve.get(Et(w.chainId,w.address));if(!I?.price)return;let K=parseFloat(I.price);return Number.isFinite(K)?K:void 0},onClose:T,onBackToWallet:Gn,onSubmitted:el,onSuccess:tl,onFailed:nl,onOutlink:Je})},"send"):null,sl=A.useMemo(()=>Ae||it.map(w=>{let I=Ve.get(Et(w.chainId,w.address)),K=I?.price?parseFloat(I.price):void 0;return{name:w.name,symbol:w.symbol,chainId:w.chainId,address:w.address,decimals:w.quantity.decimals,balance:Cn(w.quantity.numeric,w.quantity.decimals),iconUrl:w.icon_url,priceUsd:Number.isFinite(K)?K:void 0}}),[Ae,Ve,it]),ll=(0,d.jsx)("div",{className:X("wi-view-inner wi-bridge-body",ce.current&&"wi-view-send"),children:(0,d.jsx)(An,{env:r,walletAddress:b,tokens:sl,history:Me,termsUrl:V,getQuote:ke,getToTokens:pe,getApproval:Se,approveBridge:Tt,submitBridge:tt,onClose:T,onBackToWallet:Gn})},"bridge"),Ho=!!B&&y?.trim().toLowerCase()!=="my wallet",Mr=(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("span",{className:"wi-receive-avatar",children:[(0,d.jsx)("span",{className:"wi-avatar-fallback",style:Pr}),jn&&(0,d.jsx)("img",{src:jn,alt:"",className:"wi-avatar-img",width:24,height:24,draggable:!1,onLoad:$n,onError:w=>{w.currentTarget.style.display="none"}})]}),(0,d.jsx)("span",{className:"wi-receive-account-name",children:y??"Account 1"}),Ho&&(0,d.jsx)("span",{className:"wi-receive-chevron","data-open":wn,"aria-hidden":"true",children:(0,d.jsx)(Vt,{size:16})})]}),cl=(0,d.jsxs)("div",{className:X("wi-view-inner wi-qr-body",ce.current&&"wi-view-qr"),children:[(0,d.jsxs)("div",{className:"wi-receive-section",children:[Ho?(0,d.jsx)("button",{type:"button",className:"wi-receive-account wi-receive-account--btn",onClick:()=>{Un(!0),B?.()},"aria-label":"Switch account",children:Mr}):(0,d.jsx)("div",{className:"wi-receive-account",children:Mr}),(0,d.jsxs)("div",{className:"wi-qr-block",children:[(0,d.jsxs)("div",{className:"wi-qr-box",children:[(0,d.jsx)(Ts.QRCodeSVG,{value:b,size:180,level:"H",marginSize:2,...x&&{imageSettings:{src:x,height:33,width:33,excavate:!0}}}),!x&&(0,d.jsx)("div",{className:"wi-qr-logo",children:(0,d.jsx)(ii,{size:33})})]}),(0,d.jsx)("p",{className:"wi-qr-address",children:b})]}),(0,d.jsxs)("button",{type:"button",className:"wi-qr-copy-btn",onClick:Ar,children:[(0,d.jsx)("span",{className:"wi-qr-copy-icon",children:an?(0,d.jsx)(kn,{size:16}):(0,d.jsx)(Qo,{size:16})}),(0,d.jsx)("span",{className:"wi-qr-copy-text",children:an?"Copied!":"Copy address"})]})]}),Br&&(0,d.jsx)("div",{className:"wi-receive-footer",children:Br})]},"qr"),dl=j==="qr"||j==="portfolio"||j==="send"||j==="bridge",_r=ie!==null?(0,d.jsx)("div",{className:"wi-builtin-footer",children:ie}):null,Or=(0,d.jsxs)("div",{className:"wi-account-text",children:[Ho?(0,d.jsxs)("button",{type:"button",className:"wi-account-row wi-account-row--btn",onClick:()=>{Un(!0),B?.()},"aria-label":"Switch account","aria-expanded":wn,children:[(0,d.jsx)("span",{className:"wi-account-name",children:y??"Account 1"}),(0,d.jsx)("span",{className:"wi-account-switch","data-open":wn,"aria-hidden":"true",children:(0,d.jsx)(Vt,{size:20})})]}):(0,d.jsx)("div",{className:"wi-account-row",children:(0,d.jsx)("span",{className:"wi-account-name",children:y??"Account 1"})}),(0,d.jsxs)("button",{type:"button",className:"wi-address-row-btn",onClick:Ar,"aria-label":"Copy address",children:[(0,d.jsx)("span",{className:"wi-account-address",children:Ze(b)}),(0,d.jsx)("span",{className:"wi-account-copy","data-copied":an,children:an?(0,d.jsx)(kn,{size:12}):(0,d.jsx)(Qo,{size:12})})]})]}),zr=(0,d.jsxs)(d.Fragment,{children:[o,j==="qr"?(0,d.jsx)("div",{className:"wi-sticky-header",children:(0,d.jsxs)("div",{className:"wi-header wi-header--receive",children:[(0,d.jsx)("button",{type:"button",className:"wi-header-back",onClick:Gn,"aria-label":"Back",children:(0,d.jsx)(Lt,{size:24})}),(0,d.jsx)("span",{className:"wi-receive-title",children:"Receive"}),(0,d.jsx)("button",{type:"button",className:"wi-header-action",onClick:T,"aria-label":"Close",children:(0,d.jsx)(vt,{size:24})})]})}):j==="send"||j==="bridge"?null:dl?(0,d.jsxs)("div",{className:"wi-sticky-header",children:[(0,d.jsxs)("div",{className:"wi-header wi-header--wallet wi-header--sub-account",children:[(0,d.jsx)("button",{type:"button",className:"wi-header-back",onClick:Gn,"aria-label":"Back",children:(0,d.jsx)(Lt,{size:24})}),(0,d.jsx)("div",{className:"wi-account-block wi-account-block--sub-account",children:Or}),(0,d.jsx)("button",{type:"button",className:"wi-header-action",onClick:T,"aria-label":"Close",children:(0,d.jsx)(vt,{size:24})})]}),(0,d.jsx)("hr",{className:"wi-divider"})]}):(0,d.jsxs)("div",{className:"wi-sticky-header",children:[(0,d.jsxs)("div",{className:"wi-header wi-header--wallet",children:[(0,d.jsxs)("div",{className:"wi-account-block",children:[(0,d.jsxs)("div",{className:"wi-avatar",children:[(0,d.jsx)("div",{className:"wi-avatar-fallback",style:Pr}),jn&&(0,d.jsx)("img",{src:jn,alt:"",className:"wi-avatar-img",width:28,height:28,draggable:!1,onLoad:$n,onError:w=>{w.currentTarget.style.display="none"}})]}),Or]}),(0,d.jsxs)("div",{className:"wi-header-actions",children:[m&&v&&(0,d.jsx)("button",{type:"button",className:"wi-header-action wi-header-action--qr",onClick:zo,"aria-label":"Show QR code",children:(0,d.jsx)(Zo,{size:20})}),(0,d.jsx)("button",{type:"button",className:"wi-header-action",onClick:T,"aria-label":"Close",children:(0,d.jsx)(vt,{size:24})})]})]}),(0,d.jsx)("hr",{className:"wi-divider"})]}),(0,d.jsxs)("div",{className:"wi-view-container",children:[j==="wallet"&&rl,j==="qr"&&cl,j==="portfolio"&&il,j==="send"&&al,j==="bridge"&&ll]}),j==="wallet"&&_e&&(0,d.jsx)("div",{className:"wi-action-toast",role:"status","aria-live":"polite",children:_e}),j==="wallet"&&_&&(0,d.jsxs)("a",{className:"wi-send-toast",href:Mo??"#",target:"_blank",rel:"noopener noreferrer",onClick:w=>{if(!Mo){w.preventDefault();return}Ye(w,Mo,{category:"send",origin:"send-transaction",payload:{chainId:_.chainId,txHash:_.txHash}},Je)},children:[(0,d.jsx)("span",{className:"wi-send-toast-icon","data-status":_.status,"aria-hidden":!0,children:_.status==="pending"?(0,d.jsx)("span",{className:"wi-send-toast-spinner"}):_.status==="error"?(0,d.jsx)("span",{className:"wi-send-toast-error-dot"}):(0,d.jsx)(di,{size:20})}),(0,d.jsxs)("span",{className:"wi-send-toast-copy",children:[(0,d.jsx)("span",{className:"wi-send-toast-title",children:_.status==="pending"?"Sending...":_.status==="error"?"Send failed":"Send complete"}),(0,d.jsx)("span",{className:"wi-send-toast-desc",children:_.status==="pending"||_.status==="error"?_.description:"Tap to see your transaction"})]})]}),_r&&j!=="portfolio"&&j!=="send"&&(0,d.jsx)("div",{className:"wi-sticky-footer",children:(0,d.jsx)("div",{className:"wi-footer",ref:q,children:_r})})]}),Wr={...fe,...re>0?{"--wi-footer-height":`${re}px`}:null};return i?(0,d.jsxs)(Pn.Drawer.Portal,{children:[c&&(0,d.jsx)(Pn.Drawer.Overlay,{className:"wi-drawer-overlay"}),(0,d.jsxs)(Pn.Drawer.Content,{className:X("wi-drawer-content",n),"data-theme":s,"data-vaul-no-drag":p==="left"||p==="right"?!0:void 0,style:Wr,"data-direction":p,"data-no-balance":!f||void 0,"data-has-footer":re>0||void 0,"data-view":j,children:[(0,d.jsx)(Pn.Drawer.Title,{className:"wi-sr-only",children:"My Wallet"}),zr]})]}):(0,d.jsxs)(d.Fragment,{children:[c&&l&&(0,d.jsx)("div",{className:"wi-drawer-overlay",onClick:T}),(0,d.jsx)(To.Portal,{children:(0,d.jsx)(To.Content,{align:e,sideOffset:t,className:X("wi-popover-content",n),"data-theme":s,style:Wr,"data-no-balance":!f||void 0,"data-has-footer":re>0||void 0,"data-view":j,children:zr})})]})}var Is=O(require("react"),1);function Ls({position:e="top",children:t}){let{setNavContent:n,setNavPosition:o}=Mt();return Is.useEffect(()=>(n(t),o(e),()=>n(null)),[t,e,n,o]),null}var Es=O(require("react"),1);function As({children:e}){let{setFooterContent:t}=Mt();return Es.useEffect(()=>(t(e),()=>t(null)),[e,t]),null}z(`[data-theme=dark].wi-popover-content,[data-theme=dark].wi-drawer-content{--wi-primary: var(--ds-accent-primary-default, #019d92);--wi-secondary: var(--ds-system-red-default, #e70077);--wi-surface-bg: var(--ds-bg-default, #121212);--wi-surface-default: var(--ds-surface-medium, rgba(255, 255, 255, .05));--wi-surface-subtle: var(--ds-surface-high, rgba(255, 255, 255, .1));--wi-border-default: var(--ds-border-default, rgba(255, 255, 255, .05));--wi-border-subtle: var(--ds-border-medium, rgba(255, 255, 255, .1));--wi-texticon-primary: var(--ds-content-highest, #ffffff);--wi-texticon-secondary: var(--ds-content-medium, rgba(255, 255, 255, .7));--wi-texticon-tertiary: var(--ds-content-low, rgba(255, 255, 255, .5));--wi-on-primary: var(--ds-accent-primary-on, #ffffff);--wi-error: var(--ds-system-red-default, #e70077);--wi-shadow: 0 2px 16px -2px rgba(0, 0, 0, .4)}[data-theme=light].wi-popover-content,[data-theme=light].wi-drawer-content{--wi-primary: var(--ds-accent-primary-default, #019d92);--wi-secondary: var(--ds-system-red-default, #e70077);--wi-surface-bg: var(--ds-bg-default, #ffffff);--wi-surface-default: var(--ds-surface-medium, rgba(18, 18, 18, .05));--wi-surface-subtle: var(--ds-surface-high, rgba(18, 18, 18, .1));--wi-border-default: var(--ds-border-default, rgba(18, 18, 18, .05));--wi-border-subtle: var(--ds-border-medium, rgba(18, 18, 18, .1));--wi-texticon-primary: var(--ds-content-highest, #121212);--wi-texticon-secondary: var(--ds-content-medium, rgba(18, 18, 18, .7));--wi-texticon-tertiary: var(--ds-content-low, rgba(18, 18, 18, .5));--wi-on-primary: var(--ds-accent-primary-on, #ffffff);--wi-error: var(--ds-system-red-default, #e70077);--wi-shadow: 0 2px 16px -2px rgba(0, 0, 0, .15)}
11
- `);z(`.wi-trigger-btn{display:inline-flex;align-items:center;gap:8px;padding:8px 16px;border:1px solid rgba(255,255,255,.2);background:#1a2332;border-radius:9999px;cursor:pointer;color:#fff;font-family:inherit;font-size:16px;font-weight:500;line-height:24px;letter-spacing:-.3125px;transition:opacity .15s ease}.wi-trigger-btn:hover{opacity:.85}.wi-trigger-btn[data-theme=light]{background:#f3f6f8;border-color:#1212121a;color:#121212}.wi-trigger-btn[data-mobile]{font-size:14px;padding:6px 12px;gap:6px;line-height:20px}.wi-trigger-address{white-space:nowrap}.wi-divider{height:1px;background:var(--wi-border-default);margin:0;border:none;flex-shrink:0}[data-theme=light] .wi-divider{background:#1212121a}[data-theme=dark] .wi-divider{background:#ffffff1a}
12
- `);z(`@keyframes wi-fade-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}@keyframes wi-shimmer{0%{transform:translate(-100%)}to{transform:translate(100%)}}@keyframes wi-slide-in-right{0%{transform:translate(40px);opacity:0}to{transform:translate(0);opacity:1}}@keyframes wi-slide-in-left{0%{transform:translate(-40px);opacity:0}to{transform:translate(0);opacity:1}}
13
- `);z(`.wi-popover-content{-webkit-font-smoothing:antialiased;z-index:100001;width:393px;border-radius:24px;border:1px solid var(--ds-border-default, rgba(0, 0, 0, .07));background:var(--wi-surface-bg);box-shadow:var(--ds-shadow-modal, var(--wi-shadow));animation:wi-fade-in .15s ease-out;height:600px;overflow:hidden;display:flex;flex-direction:column}.wi-popover-content[data-no-balance]{height:auto}.wi-popover-content[data-has-footer]:not([data-no-balance]){height:min(calc(600px + var(--wi-footer-height, 0px)),calc(100dvh - 32px))}.wi-drawer-overlay{position:fixed;inset:0;z-index:100000;background:#0009}.wi-drawer-content{-webkit-font-smoothing:antialiased;position:fixed;top:0;right:0;bottom:0;z-index:100001;width:100vw;max-height:100vh;background:var(--wi-surface-bg);overflow:hidden;display:flex;flex-direction:column;box-sizing:border-box}.wi-drawer-content[data-no-balance]{bottom:auto;max-height:none}.wi-drawer-content[data-no-balance][data-direction=bottom]{bottom:0;top:auto;border-radius:24px 24px 0 0}.wi-drawer-content[data-direction=left]{right:auto;left:0}.wi-drawer-content[data-direction=bottom]{top:0;left:0;right:0;width:100%;max-height:100dvh;margin:0 auto}.wi-drawer-content[data-direction=bottom][data-view=qr]{max-height:100dvh}.wi-popover-content[data-view=qr]{max-height:calc(100dvh - 32px)}.wi-sticky-header{flex-shrink:0;position:relative}.wi-header{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:24px}.wi-header--wallet{align-items:flex-start;border-bottom:1px solid var(--ds-border-default, rgba(0, 0, 0, .07))}.wi-header--wallet+.wi-divider{display:none}.wi-header--sub-account{align-items:center}.wi-header--sub-account .wi-header-back{width:32px;height:38px}.wi-header--sub-account .wi-header-action{flex-shrink:0}.wi-account-block{display:flex;align-items:center;gap:8px;flex:1;min-width:0}.wi-account-block--sub-account{align-items:center}.wi-avatar{flex-shrink:0;position:relative;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;border-radius:50%;background:var(--wi-surface-bg);box-sizing:border-box;overflow:hidden}.wi-avatar-fallback{position:absolute;inset:0;border-radius:50%;z-index:0}.wi-avatar-img{position:relative;z-index:1;width:32px;height:32px;border-radius:50%;object-fit:cover;background:transparent}.wi-account-text{display:flex;flex-direction:column;gap:2px;min-width:0}.wi-account-row{display:flex;align-items:center;gap:8px;min-width:0}.wi-account-row--btn{padding:2px;margin:0;width:fit-content;border:none;background:transparent;cursor:pointer;color:inherit;font:inherit;border-radius:6px;transition:background-color .15s ease,opacity .15s ease}.wi-account-row--btn:hover{background:var(--wi-surface-subtle, rgba(255, 255, 255, .06))}.wi-account-row--btn:focus-visible{outline:2px solid var(--wi-primary, #00d5aa);outline-offset:2px}.wi-account-name{font-family:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wi-account-switch{display:inline-flex;align-items:center;justify-content:center;padding:2px 0;border:none;background:transparent;color:var(--ds-content-low, rgba(0, 0, 0, .4));border-radius:4px;flex-shrink:0;transition:color .15s ease,transform .2s ease}.wi-account-switch[data-open=true]{transform:rotate(180deg)}.wi-account-row--btn:hover .wi-account-switch{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-address-row-btn{display:inline-flex;align-items:center;gap:4px;padding:0;border:none;background:transparent;cursor:pointer;color:var(--ds-content-medium, rgba(0, 0, 0, .65));font:inherit;text-align:left;min-width:0;transition:color .15s ease}.wi-address-row-btn:hover .wi-account-address,.wi-address-row-btn:hover .wi-account-copy{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-account-address{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:12px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wi-account-copy{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;color:var(--wi-texticon-tertiary);flex-shrink:0;transition:color .15s ease}.wi-account-copy[data-copied=true]{color:var(--ds-system-green-high, #00a869)}.wi-header-actions{display:flex;align-items:center;gap:16px;flex-shrink:0;margin-top:-4px}.wi-header-action{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:none;background:transparent;border-radius:0;cursor:pointer;color:var(--ds-content-low, rgba(0, 0, 0, .4));flex-shrink:0;transition:color .15s ease}.wi-header-action:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-header-action--qr{width:32px;height:32px;border-radius:8px;background:var(--ds-surface-medium, #f5f7fa);color:var(--ds-content-medium, rgba(0, 0, 0, .65));transition:background-color .15s ease,color .15s ease}.wi-header-action--qr:hover{background:var(--ds-surface-high, rgba(0, 0, 0, .08));color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-header--receive{align-items:center;border-bottom:1px solid var(--ds-border-default, rgba(0, 0, 0, .07))}.wi-header--receive .wi-header-action,.wi-header--sub-account .wi-header-action{position:absolute;top:24px;right:24px}.wi-receive-title{position:absolute;left:50%;transform:translate(-50%);font-family:inherit;font-size:18px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-highest, #000000);text-align:center;pointer-events:none}.wi-header-info{flex:1;display:flex;flex-direction:column;gap:8px;min-width:0}.wi-header-title{font-family:inherit;font-size:16px;font-weight:600;line-height:1.3;color:var(--wi-texticon-primary);margin:0}.wi-header-close{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;padding:0;border:none;background:var(--wi-surface-default);border-radius:8px;cursor:pointer;color:var(--ds-content-low, #00000066);transition:opacity .15s ease}.wi-header-close:hover{opacity:.7}.wi-total-section{margin:24px 24px 0;padding:0;flex-shrink:0;display:flex;flex-direction:column;gap:8px;border:none;background:transparent;border-radius:12px;color:inherit;font:inherit;text-align:left;width:auto}.wi-action-row{display:flex;align-items:flex-start;gap:8px;width:auto;margin:24px 24px 0}.wi-action-card{appearance:none;display:flex;flex:1 1 0;min-width:0;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:10px 8px;border:none;border-radius:12px;background:var(--ds-surface-medium, #f5f7fa);color:var(--ds-content-high, rgba(0, 0, 0, .85));font-family:inherit;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em;text-align:center;cursor:pointer;transition:background-color .15s ease,color .15s ease}.wi-action-card:hover:not(:disabled){background:#2e3544!important;color:var(--ds-content-high, rgba(0, 0, 0, .85))}:root[data-ds-theme=light] .wi-action-card:hover:not(:disabled){background:#e4e8ef!important;color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-action-card:disabled{cursor:default}.wi-action-card>svg{flex-shrink:0}.wi-action-card:not(:disabled){transition:background-color .15s ease,transform .1s ease}.wi-action-card:active:not(:disabled){transform:scale(.93)}.wi-total-head{display:flex;align-items:center;gap:4px}.wi-total-body{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0}.wi-total-label{font-family:inherit;font-size:14px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.wi-total-eye{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;padding:0;color:var(--ds-content-low, rgba(0, 0, 0, .4));cursor:pointer;transition:color .15s ease;border-radius:4px}.wi-total-eye:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-total-eye:focus-visible{outline:1px solid var(--wi-texticon-secondary);outline-offset:2px}.wi-total-value{display:flex;align-items:baseline;gap:0;font-family:inherit;font-weight:600;line-height:1.25;color:var(--ds-content-highest, #000000);font-variant-numeric:tabular-nums;min-height:45px;white-space:nowrap}.wi-total-currency,.wi-total-amount,.wi-total-decimal{font-size:36px;color:var(--ds-content-highest, #000000)}.wi-total-lte{margin-right:2px;font-weight:500;font-size:22px;color:var(--wi-texticon-secondary)}.wi-total-mask{letter-spacing:2px;font-size:32px;color:var(--wi-texticon-secondary)}.wi-total-skeleton{border-radius:6px}.wi-scrollable-body{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;padding:8px 0 0;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.15) transparent;overscroll-behavior:contain}.wi-drawer-content .wi-scrollable-body{touch-action:pan-y}[data-theme=light] .wi-scrollable-body{scrollbar-color:rgba(0,0,0,.12) transparent}.wi-scrollable-body::-webkit-scrollbar{width:4px}.wi-scrollable-body::-webkit-scrollbar-track{background:transparent}.wi-scrollable-body::-webkit-scrollbar-thumb{background:#ffffff26;border-radius:4px}.wi-scrollable-body::-webkit-scrollbar-thumb:hover{background:#ffffff40}[data-theme=light] .wi-scrollable-body::-webkit-scrollbar-thumb{background:#0000001f}[data-theme=light] .wi-scrollable-body::-webkit-scrollbar-thumb:hover{background:#0003}.wi-nav-fixed{flex-shrink:0;padding:0 24px}.wi-token-list{display:flex;flex-direction:column;gap:0;padding:8px 0}.wi-token-item{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:12px 24px;border:none;background:transparent;text-align:left;font-family:inherit;width:100%;box-sizing:border-box}.wi-token-item--button{cursor:pointer;background:var(--ds-surface-default, #ffffff);transition:none}.wi-token-item--button:hover{background:#252b39!important}:root[data-ds-theme=light] .wi-token-item--button:hover{background:#eff3f8!important}button.wi-token-item:focus-visible{outline:2px solid var(--wi-primary);outline-offset:2px;border-radius:4px}.wi-token-left{display:flex;align-items:center;gap:16px;min-width:0}.wi-token-icon-wrap{position:relative;width:40px;height:40px;flex-shrink:0}.wi-token-icon{width:40px;height:40px;border-radius:0;object-fit:contain;opacity:0;transition:opacity .2s ease}.wi-token-icon[data-loaded=true]{opacity:1}.wi-token-chain-badge{position:absolute;right:0;bottom:0;width:14px;height:14px;border-radius:50%;background:var(--wi-surface-bg);box-shadow:0 0 0 1.5px var(--wi-surface-bg);object-fit:contain}.wi-token-info{display:flex;flex-direction:column;min-width:0}.wi-token-name{font-family:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));white-space:nowrap}.wi-token-price-row{display:flex;align-items:center;gap:8px}.wi-token-price{font-family:inherit;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4));white-space:nowrap}.wi-token-change{font-family:inherit;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em;white-space:nowrap}.wi-token-change[data-positive=true]{color:var(--ds-system-green-high, #00a0a2)}.wi-token-change[data-positive=false]{color:var(--ds-system-red-high, #a80927)}.wi-token-change[data-zero]{color:var(--ds-content-low, rgba(0, 0, 0, .4))}.wi-token-right{display:flex;flex-direction:column;align-items:flex-end;flex-shrink:0}.wi-token-balance{font-family:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-highest, #000000);white-space:nowrap}.wi-token-value{font-family:inherit;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4));white-space:nowrap}.wi-sticky-footer{flex-shrink:0}.wi-footer{padding:16px 24px 24px}.wi-builtin-footer{display:flex;flex-direction:column;gap:8px;align-items:stretch}.wi-wallet-disconnect-row{display:flex;justify-content:flex-end;flex-shrink:0;padding:16px 24px;border-top:1px solid var(--ds-border-default, rgba(0, 0, 0, .07))}.wi-send-toast{position:absolute;left:15px;right:15px;bottom:20px;z-index:2;display:flex;align-items:center;gap:12px;min-height:52px;padding:12px;border-radius:12px;background:var(--ds-surface-inverted, #1e232e);color:var(--ds-content-inverted, #ffffff);box-sizing:border-box;text-decoration:none}.wi-action-toast{position:absolute;left:15px;right:15px;bottom:20px;z-index:3;padding:12px 14px;border-radius:12px;background:var(--ds-surface-inverted, #1e232e);color:var(--ds-content-inverted, #ffffff);font-size:14px;line-height:1.4;text-align:center;box-sizing:border-box;animation:wi-action-toast-in .18s ease-out}.wi-popover-content:has(.wi-wallet-disconnect-row) .wi-action-toast,.wi-drawer-content:has(.wi-wallet-disconnect-row) .wi-action-toast{bottom:72px}@keyframes wi-action-toast-in{0%{transform:translateY(8px);opacity:0}to{transform:translateY(0);opacity:1}}.wi-action-card--dimmed{opacity:.4;cursor:pointer}.wi-action-card--dimmed:hover{opacity:.5}.wi-popover-content:has(.wi-wallet-disconnect-row) .wi-send-toast,.wi-drawer-content:has(.wi-wallet-disconnect-row) .wi-send-toast{bottom:72px}.wi-send-toast:hover{opacity:.92}.wi-send-toast-icon{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;flex-shrink:0;color:var(--ds-accent-primary-default, #00b4b7)}.wi-send-toast-spinner{width:18px;height:18px;border:2px solid rgba(0,232,201,.22);border-top-color:var(--ds-accent-primary-on-inverted, #00e8c9);border-radius:50%;animation:wi-send-toast-spin .8s linear infinite}.wi-send-toast-error-dot{width:18px;height:18px;border-radius:50%;background:var(--ds-system-red-default, #ff3358)}@keyframes wi-send-toast-spin{to{transform:rotate(360deg)}}.wi-send-toast-copy{display:flex;min-width:0;flex-direction:column}.wi-send-toast-title{font-family:inherit;font-size:14px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-inverted, #ffffff)}.wi-send-toast-desc{font-family:inherit;font-size:12px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ds-accent-primary-on-inverted, #00e8c9)}.wi-send-toast-icon[data-status=error]+.wi-send-toast-copy .wi-send-toast-desc{color:var(--ds-system-red-default, #ff3358)}.wi-disconnect-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:16px;padding:0;border:none;background:transparent;color:var(--ds-content-low, rgba(0, 0, 0, .4));font-family:inherit;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em;cursor:pointer;transition:color .15s ease}.wi-disconnect-btn:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-disconnect-label{white-space:nowrap}.wi-legal-links{display:inline-flex;align-items:center;justify-content:center;gap:6px;width:100%;flex-shrink:0;font-family:inherit;font-size:14px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4))}.wi-receive-avatar .wi-avatar-fallback{position:absolute;inset:0;border-radius:50%;z-index:0}.wi-receive-avatar .wi-avatar-img{width:24px;height:24px}.wi-legal-link{color:var(--ds-content-low, rgba(0, 0, 0, .4));text-decoration:underline;text-underline-offset:2px;transition:color .15s ease}.wi-legal-link:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-legal-sep{color:inherit}.wi-empty{display:flex;align-items:center;justify-content:center;padding:32px 0;font-family:inherit;font-size:16px;color:var(--wi-texticon-secondary)}.wi-skeleton-item{display:flex;align-items:center;justify-content:space-between;padding:4px 0}.wi-skeleton-left{display:flex;align-items:center;gap:12px}.wi-skeleton-block{border-radius:6px;background:var(--wi-border-default);position:relative;overflow:hidden}.wi-skeleton-block:after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,transparent 0%,rgba(255,255,255,.06) 50%,transparent 100%);animation:wi-shimmer 1.5s ease-in-out infinite}[data-theme=light] .wi-skeleton-block:after{background:linear-gradient(90deg,transparent 0%,rgba(0,0,0,.04) 50%,transparent 100%)}.wi-skeleton-icon{width:32px;height:32px;border-radius:50%;flex-shrink:0}.wi-skeleton-lines{display:flex;flex-direction:column;gap:6px}.wi-skeleton-right{display:flex;flex-direction:column;align-items:flex-end;gap:6px}.wi-header-back{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:none;background:transparent;cursor:pointer;color:var(--ds-content-low, rgba(0, 0, 0, .4));flex-shrink:0;transition:color .15s ease}.wi-header-back:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-view-container{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.wi-popover-content[data-view=qr] .wi-view-container,.wi-drawer-content[data-view=qr] .wi-view-container{flex:1;min-height:0}.wi-view-inner{display:flex;flex-direction:column;flex:1;min-height:0}.wi-view-wallet{animation:wi-slide-in-left .25s ease-out}.wi-view-qr,.wi-view-portfolio{animation:wi-slide-in-right .25s ease-out}.wi-qr-body{flex:1;min-height:0;display:flex;flex-direction:column}.wi-portfolio-body{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.wi-portfolio-body>.wp-embed{flex:1;min-height:0}.wi-portfolio-body .wp-body-inner{padding:16px 16px 32px;gap:32px}.wi-receive-section{flex:1;min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;padding:24px}.wi-receive-account{display:inline-flex;align-items:center;gap:8px;padding:4px 8px 4px 4px;border:0;background:var(--ds-surface-high, #edf1f2);border-radius:9999px;font-family:inherit;color:inherit}.wi-receive-account--btn{cursor:pointer;transition:none}.wi-receive-account--btn:hover{background:#2e3544}:root[data-ds-theme=light] .wi-receive-account--btn:hover{background:#e4e8ef}.wi-receive-avatar{position:relative;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:50%;overflow:hidden;flex-shrink:0}.wi-receive-account-name{font-family:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));white-space:nowrap}.wi-receive-account>svg{color:var(--ds-content-medium, rgba(0, 0, 0, .65));flex-shrink:0}.wi-receive-chevron{display:inline-flex;align-items:center;color:var(--ds-content-medium, rgba(0, 0, 0, .65));flex-shrink:0;transition:transform .2s ease}.wi-receive-chevron[data-open=true]{transform:rotate(180deg)}.wi-qr-block{display:flex;flex-direction:column;align-items:center;gap:16px}.wi-qr-box{position:relative;display:flex;align-items:center;justify-content:center;padding:10px;background:#fff;border-radius:6px;overflow:hidden}.wi-qr-logo{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);pointer-events:none}.wi-qr-address{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:16px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65));text-align:center;word-break:break-all;max-width:281px;margin:0}.wi-qr-copy-btn{display:inline-flex;align-items:center;justify-content:center;gap:9px;padding:12px 16px;border:1px solid var(--ds-border-default, rgba(0, 0, 0, .07));background:var(--ds-surface-default, #ffffff);border-radius:12px;cursor:pointer;transition:border-color .15s ease}.wi-qr-copy-btn:hover{border-color:var(--ds-border-medium, rgba(0, 0, 0, .18))}.wi-qr-copy-icon{display:inline-flex;color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-qr-copy-text{font-family:inherit;font-size:16px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));white-space:nowrap}.wi-receive-footer{flex-shrink:0;display:flex;align-items:center;justify-content:center;padding:16px 24px;border-top:1px solid var(--ds-border-default, rgba(0, 0, 0, .07))}.wi-drawer-content .wi-header{padding:16px}.wi-drawer-content .wi-header--receive .wi-header-action,.wi-drawer-content .wi-header--sub-account .wi-header-action{top:16px;right:16px}.wi-drawer-content .wi-total-section,.wi-drawer-content .wi-action-row{margin:16px 16px 0}.wi-drawer-content .wi-nav-fixed{padding:0 16px}.wi-drawer-content .wi-token-item{padding:12px 16px}.wi-drawer-content .wi-wallet-disconnect-row{padding:16px}
14
- `);z(`.wi-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}
15
- `);var Ro=require("react/jsx-runtime"),fd="https://terms.crosstoken.io/docs/cross-terms-of-use",ud="https://terms.crosstoken.io/docs/nexus-privacy-policy";function md({env:e,theme:t="dark",mobileBreakpoint:n=768,drawerDirection:o,modal:r,showBalance:s=!1,showForgeToken:i=!1,showGameToken:l=!0,showQR:p=!0,showBridge:c=!0,qrLogoSrc:f,walletAddress:g,accountName:u,sendAccounts:m,profileImageUrl:v,connectorId:x,connectorName:b,connectorIconUrl:y,preferredTokens:L=[],onSelectWallet:h,onCopyAddress:P,onBuy:T,onBuyDisabledMessage:B,onDisconnect:R,disconnectLabel:$="Disconnect",termsUrl:G=fd,termsLabel:ee="Terms of Service",privacyUrl:V=ud,privacyLabel:D="Privacy Policy",open:he,onOpenChange:ye,showPortfolio:fe=!1,portfolioTitle:ue="My Portfolio",showTotalAssets:De=!0,totalAssetsLabel:ie="Total Assets USD",sendTransaction:j,getTransactionReceipt:ne,estimateGas:Te,onOutlink:te,lpBalanceReader:He,bridgeTokens:Ge,bridgeHistory:Re,getBridgeQuote:Ee,getBridgeToTokens:gt,getBridgeApproval:be,approveBridge:Nt,submitBridge:Je,onReceive:et,onBridge:Ae,onSend:Me,style:ke,children:pe}){let Se=Ie(e),Tt=x?yn[x]:void 0,tt=b??Tt?.name,ht=y??Tt?.iconUrl,Ce=sn(`(max-width: ${n}px)`),Ue=o??(s?"right":"bottom"),bt=Ue==="left"||Ue==="right",_e=r??!1,nt=he!==void 0,[ot,$e]=Fe.useState(!1),we=nt?he:ot,je=Fe.useCallback(Ke=>{nt||$e(Ke),ye?.(Ke)},[nt,ye]),lt=Fe.useCallback(()=>je(!1),[je]),[wt,Ve]=Fe.useState(null),[Rt,It]=Fe.useState("top"),[rt,xt]=Fe.useState(null),[Oe,ct]=Fe.useState("wallet"),[C,q]=Fe.useState(null);Fe.useEffect(()=>{we||(ct("wallet"),q(null))},[we]);let re=Fe.useCallback(()=>{tr(g),R?.()},[R,g]),qe=Fe.useMemo(()=>({env:Se,theme:t,isMobile:Ce,open:we,drawerDirection:Ue,modal:_e,showBalance:s,showForgeToken:i,showGameToken:l,showQR:p,showBridge:c,qrLogoSrc:f,walletAddress:g,accountName:u,sendAccounts:m,profileImageUrl:v,connectorName:tt,connectorIconUrl:ht,preferredTokens:L,close:lt,onSelectWallet:h,onCopyAddress:P,onBuy:T,onBuyDisabledMessage:B,onDisconnect:R?re:void 0,disconnectLabel:$,termsUrl:G,termsLabel:ee,privacyUrl:V,privacyLabel:D,portalStyle:ke,navContent:wt,navPosition:Rt,setNavContent:Ve,setNavPosition:It,footerContent:rt,setFooterContent:xt,view:Oe,setView:ct,selectedSendToken:C,setSelectedSendToken:q,showPortfolio:fe,portfolioTitle:ue,showTotalAssets:De,totalAssetsLabel:ie,sendTransaction:j,getTransactionReceipt:ne,estimateGas:Te,onOutlink:te,lpBalanceReader:He,bridgeTokens:Ge,bridgeHistory:Re,getBridgeQuote:Ee,getBridgeToTokens:gt,getBridgeApproval:be,approveBridge:Nt,submitBridge:Je,onReceive:et,onBridge:Ae,onSend:Me}),[Se,t,Ce,we,Ue,_e,s,i,l,p,c,f,g,u,m,v,tt,ht,L,lt,h,P,T,B,R,re,$,G,ee,V,D,ke,wt,Rt,rt,Oe,C,fe,ue,De,ie,j,ne,Te,te,He,Ge,Re,Ee,gt,be,Nt,Je,et,Ae,Me]);return(0,Ro.jsx)(Ko.Provider,{value:qe,children:Ce?(0,Ro.jsx)(Bs.Drawer.Root,{direction:Ue,open:we,onOpenChange:je,handleOnly:bt,noBodyStyles:!0,repositionInputs:!1,children:pe},"drawer"):(0,Ro.jsx)(Ps.Root,{open:we,onOpenChange:je,children:pe},"popover")})}var on=Object.assign(md,{Trigger:Zi,Content:Rs,Nav:Ls,Footer:As});var Ct=O(require("react"),1),Ks=O(require("@radix-ui/react-dialog"),1),Qs=require("vaul");var Io=require("react"),Lo=(0,Io.createContext)(null);function Bn(){let e=(0,Io.useContext)(Lo);if(!e)throw new Error("WalletConnectModal compound components must be used within <WalletConnectModal>");return e}var rn=require("react");function Fn(){let[e,t]=(0,rn.useState)([]),[n,o]=(0,rn.useState)(!0);(0,rn.useEffect)(()=>{if(typeof window>"u"){o(!1);return}let s=[],i=p=>{let{info:c}=p.detail;c?.rdns&&!s.some(f=>f.rdns===c.rdns)&&(s.push({rdns:c.rdns,name:c.name,icon:c.icon}),t([...s]))};window.addEventListener("eip6963:announceProvider",i),window.addEventListener("eip6963:crossAnnounceProvider",i),window.dispatchEvent(new Event("eip6963:requestProvider")),window.dispatchEvent(new Event("eip6963:crossRequestProvider"));let l=setTimeout(()=>o(!1),500);return()=>{window.removeEventListener("eip6963:announceProvider",i),window.removeEventListener("eip6963:crossAnnounceProvider",i),clearTimeout(l)}},[]);let r=(0,rn.useCallback)(s=>e.some(i=>i.rdns===s),[e]);return{wallets:e,isDetected:r,isLoading:n}}var Fs=O(require("@radix-ui/react-dialog"),1),Ms=require("vaul");var kr=require("react/jsx-runtime");function _s({asChild:e,children:t}){let{isMobile:n}=Bn(),o=n?Ms.Drawer.Trigger:Fs.Trigger;return(0,kr.jsx)(o,{asChild:e??t!=null,children:t??(0,kr.jsx)("button",{type:"button",children:"Connect Wallet"})})}var St=O(require("@radix-ui/react-dialog"),1),Mn=require("vaul");var F=require("react/jsx-runtime");function Eo(){return(0,F.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,F.jsx)("circle",{cx:"20",cy:"20",r:"20",fill:"#00D5AA"}),(0,F.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.3225 2.85742L23.7249 6.25982V11.8301L28.1175 7.43757L32.9292 12.2493L28.5806 16.5979H20.3225C18.4435 16.5979 16.9201 18.1212 16.9201 20.0003C16.9201 21.8794 18.4434 23.4027 20.3225 23.4027H28.5372L32.9293 27.7948L28.1176 32.6066L23.7249 28.2139V33.7407L20.3225 37.1431L16.9201 33.7407V28.2584L12.5719 32.6066L7.76022 27.7948L12.1524 23.4027H6.58209L3.17969 20.0003L6.58209 16.5979H12.1089L7.76035 12.2493L12.5721 7.43757L16.9201 11.7857V6.25982L20.3225 2.85742Z",fill:"black"})]})}function Os(){return(0,F.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",children:[(0,F.jsxs)("g",{clipPath:"url(#clip0_1331_27065)",children:[(0,F.jsx)("path",{d:"M37.2488 38.4674L28.6626 35.8175L22.1876 39.8295L17.6699 39.8274L11.191 35.8175L2.60875 38.4674L-0.00195312 29.3328L2.60875 19.1947L-0.00195312 10.6234L2.60875 0L16.0192 8.30453H23.838L37.2488 0L39.8595 10.6234L37.2488 19.1947L39.8595 29.3328L37.2488 38.4674Z",fill:"#FF5C16"}),(0,F.jsx)("path",{d:"M2.60938 0L16.0201 8.31037L15.4868 14.0137L2.60938 0ZM11.1919 29.3366L17.0925 33.9956L11.1919 35.8175V29.3366ZM16.6209 21.6342L15.4868 14.0175L8.22768 19.1971L8.22374 19.195V19.1988L8.24628 24.5302L11.1899 21.6345L16.6209 21.6342ZM37.2477 0L23.837 8.31037L24.3685 14.0137L37.2477 0ZM28.6654 29.3366L22.7646 33.9956L28.6654 35.8175V29.3366ZM31.6313 19.1985V19.1947L31.6297 19.1968L24.3705 14.0175L23.2364 21.6342H28.6651L31.6108 24.5296L31.6313 19.1985Z",fill:"#FF5C16"}),(0,F.jsx)("path",{d:"M11.191 35.8175L2.60875 38.4674L-0.00195312 29.3366H11.191V35.8175ZM16.62 21.6321L18.2595 32.6435L15.9873 26.5208L8.24368 24.5296L11.189 21.6324H16.62V21.6321ZM28.6662 35.8175L37.2488 38.4674L39.8595 29.3366H28.6662V35.8175ZM23.2375 21.6321L21.598 32.6435L23.8699 26.5208L31.6138 24.5296L28.6665 21.6324H23.2375V21.6321Z",fill:"#E34807"}),(0,F.jsx)("path",{d:"M-0.00195312 29.3328L2.60875 19.1947H8.22284L8.2434 24.5278L15.9876 26.519L18.2595 32.6414L17.0916 33.9897L11.191 29.3307H-0.00195312V29.3328ZM39.8595 29.3328L37.2488 19.1947H31.6344L31.6138 24.5278L23.8702 26.519L21.598 32.6414L22.7657 33.9897L28.6665 29.3307H39.8595V29.3328ZM23.838 8.30444H16.0192L15.4882 14.0078L18.2597 32.6355H21.598L24.3713 14.0078L23.838 8.30444Z",fill:"#FF8D5D"}),(0,F.jsx)("path",{d:"M2.60875 0L-0.00195312 10.6234L2.60875 19.1947H8.22284L15.4859 14.0137L2.60875 0ZM14.9975 23.8438H12.4541L11.0693 25.2508L15.9893 26.515L14.9975 23.842V23.8438ZM37.2488 0L39.8595 10.6234L37.2488 19.1947H31.6344L24.3716 14.0137L37.2488 0ZM24.8637 23.8438H27.4107L28.7955 25.2526L23.8699 26.5191L24.8637 23.8418V23.8438ZM22.1857 36.1956L22.7659 33.9936L21.598 32.6453H18.2572L17.0896 33.9936L17.6696 36.1956",fill:"#661800"}),(0,F.jsx)("path",{d:"M22.1857 36.1951V39.831H17.6699V36.1951H22.1857Z",fill:"#C0C4CD"}),(0,F.jsx)("path",{d:"M11.1914 35.8131L17.672 39.8289V36.193L17.0917 33.9912L11.1914 35.8131ZM28.6649 35.8131L22.1841 39.8289V36.193L22.7644 33.9912L28.6649 35.8131Z",fill:"#E7EBF6"})]}),(0,F.jsx)("defs",{children:(0,F.jsx)("clipPath",{id:"clip0_1331_27065",children:(0,F.jsx)("rect",{width:"40",height:"40",fill:"white"})})})]})}function zs(){return(0,F.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,F.jsx)("path",{d:"M12.23 16.81L20 9.04L27.77 16.81L32.29 12.29L20 0L7.71 12.29L12.23 16.81Z",fill:"#F3BA2F"}),(0,F.jsx)("path",{d:"M9.04 20L4.52 15.48L0 20L4.52 24.52L9.04 20Z",fill:"#F3BA2F"}),(0,F.jsx)("path",{d:"M12.23 23.19L20 30.96L27.77 23.19L32.29 27.71L20 40L7.71 27.71L12.23 23.19Z",fill:"#F3BA2F"}),(0,F.jsx)("path",{d:"M35.48 24.52L40 20L35.48 15.48L30.96 20L35.48 24.52Z",fill:"#F3BA2F"}),(0,F.jsx)("path",{d:"M24.58 20L20 15.41L16.61 18.8L16.22 19.19L15.42 19.99L20 24.59L24.59 20L24.58 20Z",fill:"#F3BA2F"})]})}function Ws(){return(0,F.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"247",height:"246",viewBox:"0 0 247 246",fill:"none",children:[(0,F.jsx)("rect",{width:"247.005",height:"245.105",rx:"36",fill:"#121212"}),(0,F.jsx)("path",{d:"M89.1233 136.695V59.7551H118.481V140.524L74.5862 184.774L30.4787 140.524V107.55H59.9073V136.695L74.5862 151.303L89.1233 136.695Z",fill:"white"}),(0,F.jsx)("path",{d:"M59.8364 99.8915V59.7551H12.0414L30.4787 77.8377V99.8915H59.8364Z",fill:"#2FD7FF"}),(0,F.jsx)("path",{d:"M199.534 59.9334C202.562 60.0484 208.427 60.4824 212.031 63.6902C215.635 66.898 216.937 71.0498 216.937 73.1199V104.017L198.767 114.828L216.937 125.561V172.713C216.937 174.511 216.405 178.276 211.034 181.377C205.664 184.477 202.613 184.969 201.758 184.827H143.949C141.879 184.904 136.712 184.182 132.602 180.686C128.493 177.19 128.462 175.216 128.462 173.515V125.561L146.173 114.828L128.462 104.017V71.1268C128.462 69.721 130.109 65.7781 133.237 63.5701C137.147 60.8101 141.112 59.9334 144.409 59.9334H199.534ZM158.3 122.264V166.221H187.033V122.264H158.3ZM158.3 107.794H187.033V78.5272H158.3V107.794Z",fill:"white"})]})}function Ds(){return(0,F.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,F.jsxs)("g",{clipPath:"url(#clip0_1185_7785)",children:[(0,F.jsx)("path",{d:"M14 28C21.75 28 28 21.75 28 14C28 6.25 21.75 0 14 0C6.25 0 0 6.25 0 14C0 21.75 6.25 28 14 28Z",fill:"#EB0029"}),(0,F.jsx)("path",{d:"M19.4975 8.36232L6 6L13.103 23L23 11.5311L19.4975 8.36232ZM19.2801 9.4034L21.3449 11.27L15.6975 12.2424L19.2801 9.4034ZM14.4714 12.0479L8.51876 7.35252L18.247 9.05524L14.4714 12.0479ZM14.0467 12.8782L13.0765 20.5098L7.84385 7.98492L14.0467 12.8782ZM14.9454 13.2835L21.1983 12.2064L14.026 20.518L14.9454 13.2835Z",fill:"white"})]}),(0,F.jsx)("defs",{children:(0,F.jsx)("clipPath",{id:"clip0_1185_7785",children:(0,F.jsx)("rect",{width:"28",height:"28",fill:"white"})})})]})}function Hs(){return(0,F.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg",children:[(0,F.jsx)("path",{fill:"#FFC107",d:"M43.6 20.5H42V20H24v8h11.3A12 12 0 1 1 24 12c3 0 5.8 1.2 7.9 3l5.7-5.7A20 20 0 1 0 44 24c0-1.2-.1-2.4-.4-3.5z"}),(0,F.jsx)("path",{fill:"#FF3D00",d:"M6.3 14.7l6.6 4.8A12 12 0 0 1 24 12c3 0 5.8 1.2 7.9 3l5.7-5.7A20 20 0 0 0 6.3 14.7z"}),(0,F.jsx)("path",{fill:"#4CAF50",d:"M24 44c5.2 0 10-2 13.6-5.2l-6.3-5.3A12 12 0 0 1 12.7 28l-6.5 5A20 20 0 0 0 24 44z"}),(0,F.jsx)("path",{fill:"#1976D2",d:"M43.6 20.5H42V20H24v8h11.3a12 12 0 0 1-4.1 5.5l6.3 5.3C41 35.7 44 30.3 44 24c0-1.2-.1-2.4-.4-3.5z"})]})}function Gs(){return(0,F.jsx)("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:(0,F.jsx)("path",{d:"M17.05 20.28c-.98.95-2.05.8-3.08.35-1.09-.46-2.09-.48-3.24 0-1.44.62-2.2.44-3.06-.35C2.79 15.25 3.51 7.59 9.05 7.31c1.35.07 2.29.74 3.08.8 1.18-.24 2.31-.93 3.57-.84 1.51.12 2.65.72 3.4 1.8-3.12 1.87-2.38 5.98.48 7.13-.57 1.5-1.31 2.99-2.53 4.08zM12.03 7.25c-.15-2.23 1.66-4.07 3.74-4.25.29 2.58-2.34 4.5-3.74 4.25z"})})}function Us(){return(0,F.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,F.jsx)("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}var Ao={cross_embedded:{id:"cross_embedded",name:"CROSSx with Social",description:"Sign in with Google or Apple",icon:Eo},cross_wallet:{id:"cross_wallet",name:"CROSSx",description:"App approval is required",icon:Eo,featured:!0},cross_extension:{id:"cross_extension",name:"CROSSx Extension",description:"Browser extension approval is required",icon:Eo,rdns:"nexus.to.crosswallet.desktop",installUrl:"https://chromewebstore.google.com/detail/crossx/nninbdadmocnokibpaaohnoepbnpdgcg",visibility:"desktop-only"},metamask:{id:"metamask",name:"MetaMask",description:"Browser extension approval is required",icon:Os,rdns:"io.metamask"},binance:{id:"binance",name:"Binance",description:"Mobile app only \u2014 Add CROSS network first",icon:zs},verse8:{id:"verse8",name:"Verse8 Wallet",description:"Optimized for Forge and Verse8 ecosystem",icon:Ws,badge:"For Forge"},tron:{id:"tron",name:"Tron Wallet",description:"Dedicated for Tron-based transactions and assets",icon:Ds,badge:"For SHOP"}};function Sr(e){return Ao[e]}var Po={google:{id:"google",name:"Google",icon:Hs},apple:{id:"apple",name:"Apple",icon:Gs}};function $s(e){return Po[e]}var S=require("react/jsx-runtime");function gd({wallet:e,detected:t,onConnect:n}){let o=()=>{if(e.installUrl&&!t){window.open(e.installUrl,"_blank","noopener,noreferrer");return}n()},r=e.icon,s=e.featured===!0;return(0,S.jsxs)("button",{type:"button",className:X("wcm-wallet-item",s&&"wcm-wallet-item--featured"),onClick:o,children:[(0,S.jsxs)("div",{className:"wcm-wallet-item-left",children:[(0,S.jsx)("div",{className:"wcm-wallet-icon",children:(0,S.jsx)(r,{})}),(0,S.jsxs)("div",{className:"wcm-wallet-name-row",children:[(0,S.jsx)("span",{className:"wcm-wallet-name",children:e.name}),e.badge&&(0,S.jsx)("span",{className:"wcm-wallet-badge",children:e.badge})]})]}),e.installUrl&&(t?(0,S.jsx)("span",{className:"wcm-installed-label",children:"Installed"}):(0,S.jsx)("span",{className:"wcm-install-btn",children:"Install"}))]})}function hd({social:e,onSignIn:t}){let n=e.icon,o=`Sign in with ${e.name}`;return(0,S.jsxs)("button",{type:"button",className:"wcm-social-item","data-provider":e.id,onClick:t,"aria-label":o,children:[(0,S.jsx)("span",{className:"wcm-social-icon",children:(0,S.jsx)(n,{})}),(0,S.jsx)("span",{className:"wcm-social-name",children:o})]})}function js(){let{wallets:e,activeWalletIds:t,socialProviders:n,activeSocialIds:o,termsUrl:r,privacyUrl:s,isDetected:i,close:l,isMobile:p}=Bn(),c=t.filter(u=>{let m=Sr(u).visibility;return!m||m==="always"?!0:m==="desktop-only"?!p:m==="mobile-only"?p:!0}),f=o.length>0,g=c.length>0;return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)("div",{className:"wcm-header",children:[(0,S.jsxs)("div",{className:"wcm-header-text",children:[(0,S.jsx)("h2",{className:"wcm-title",children:"CROSS Wallet"}),!p&&(0,S.jsx)("p",{className:"wcm-subtitle",children:"Sign in instantly with your social account"})]}),(0,S.jsx)("button",{type:"button",className:"wcm-close-btn",onClick:l,"aria-label":"Close",children:(0,S.jsx)(Us,{})})]}),(0,S.jsxs)("div",{className:"wcm-body",children:[f&&(0,S.jsxs)(S.Fragment,{children:[!p&&(0,S.jsxs)("div",{className:"wcm-section-header",children:[(0,S.jsx)("span",{className:"wcm-section-title",children:"Social Account Wallet Connect"}),(0,S.jsx)("span",{className:"wcm-recommended-badge",children:"Recommended"})]}),(0,S.jsx)("div",{className:"wcm-social-grid",children:o.map(u=>{let m=$s(u);return(0,S.jsx)(hd,{social:m,onSignIn:()=>{n[u]?.(),l()}},u)})}),g&&(0,S.jsxs)("div",{className:"wcm-separator",children:[(0,S.jsx)("div",{className:"wcm-separator-line"}),(0,S.jsx)("span",{className:"wcm-separator-text",children:"Other Wallets"}),(0,S.jsx)("div",{className:"wcm-separator-line"})]})]}),g&&(0,S.jsx)("div",{className:"wcm-wallet-list",children:c.map(u=>{let m=Sr(u),v=m.rdns?i(m.rdns):!1;return(0,S.jsx)(gd,{wallet:m,detected:v,onConnect:()=>{e[u]?.(),l()}},u)})}),(0,S.jsxs)("p",{className:"wcm-terms",children:["By continuing, you agree to NEXUS"," ",(0,S.jsx)(Vs,{href:r,children:"Terms of Service"})," and consent to its ",(0,S.jsx)(Vs,{href:s,children:"Privacy Policy"}),"."]})]})]})}function Vs({href:e,children:t}){return e?(0,S.jsx)("a",{className:"wcm-terms-link",href:e,target:"_blank",rel:"noopener noreferrer",children:t}):(0,S.jsx)("span",{className:"wcm-terms-link",children:t})}function qs({className:e}){let{isMobile:t,theme:n,portalStyle:o}=Bn();return t?(0,S.jsxs)(Mn.Drawer.Portal,{children:[(0,S.jsx)(Mn.Drawer.Overlay,{className:"wcm-overlay"}),(0,S.jsxs)(Mn.Drawer.Content,{className:X("wcm-drawer-content",e),"data-theme":n,style:o,children:[(0,S.jsx)(Mn.Drawer.Title,{className:"wcm-sr-only",children:"Connect Wallet"}),(0,S.jsx)("div",{className:"wcm-drawer-handle"}),(0,S.jsx)("div",{className:"wcm-drawer-body",children:(0,S.jsx)(js,{})})]})]}):(0,S.jsxs)(St.Portal,{children:[(0,S.jsx)(St.Overlay,{className:"wcm-overlay"}),(0,S.jsxs)(St.Content,{className:X("wcm-dialog-content",e),"data-theme":n,style:o,children:[(0,S.jsx)(St.Title,{className:"wcm-sr-only",children:"Connect Wallet"}),(0,S.jsx)(St.Description,{className:"wcm-sr-only",children:"Sign in with a social provider or pick a wallet to connect."}),(0,S.jsx)("div",{className:"wcm-dialog-body",children:(0,S.jsx)(js,{})})]})]})}z(`.wcm-overlay{position:fixed;inset:0;z-index:100000;background:var(--ds-overlay-dim, rgba(0, 0, 0, .5));-webkit-backdrop-filter:var(--ds-bg-blur-7, blur(3.5px));backdrop-filter:var(--ds-bg-blur-7, blur(3.5px))}.wcm-dialog-content{-webkit-font-smoothing:antialiased;position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);z-index:100001;width:var(--wcm-dialog-width, 480px);max-height:90vh;overflow:hidden;display:flex;flex-direction:column;background:var(--ds-surface-default, #ffffff);border:1px solid var(--ds-border-default, #00000012);border-radius:24px;box-shadow:var(--ds-shadow-modal, 0 4px 30px -1px rgba(0, 0, 0, .15));outline:none;animation:wcm-dialog-show .2s ease-out;font-family:inherit}.wcm-dialog-content[data-state=closed]{animation:wcm-dialog-hide .15s ease-in}.wcm-dialog-body,.wcm-drawer-body{scrollbar-width:thin;scrollbar-color:var(--ds-border-medium, rgba(0, 0, 0, .18)) transparent}.wcm-dialog-body::-webkit-scrollbar,.wcm-drawer-body::-webkit-scrollbar{width:4px}.wcm-dialog-body::-webkit-scrollbar-track,.wcm-drawer-body::-webkit-scrollbar-track{background:transparent}.wcm-dialog-body::-webkit-scrollbar-thumb,.wcm-drawer-body::-webkit-scrollbar-thumb{background:var(--ds-border-medium, rgba(0, 0, 0, .18));border-radius:4px}.wcm-drawer-content{-webkit-font-smoothing:antialiased;position:fixed;bottom:0;left:0;right:0;z-index:100001;width:100%;max-width:var(--wcm-drawer-max-width, none);min-width:var(--wcm-drawer-min-width, 0);max-height:85dvh;margin:0 auto;display:flex;flex-direction:column;background:var(--ds-surface-default, #ffffff);border:1px solid var(--ds-border-default, #00000012);border-top-left-radius:16px;border-top-right-radius:16px;outline:none;font-family:inherit;box-sizing:border-box}.wcm-drawer-content[data-vaul-drawer-direction=right]{inset:0 0 0 auto;max-height:100vh;width:var(--wcm-drawer-max-width, 400px);max-width:100vw;border-radius:16px 0 0 16px}.wcm-drawer-content[data-vaul-drawer-direction=left]{inset:0 auto 0 0;max-height:100vh;width:var(--wcm-drawer-max-width, 400px);max-width:100vw;border-radius:0 16px 16px 0}.wcm-drawer-content[data-vaul-drawer-direction=top]{inset:0 0 auto;border-radius:0 0 16px 16px}.wcm-drawer-handle{width:60px;height:4px;border-radius:999px;background:var(--ds-border-medium, rgba(0, 0, 0, .18));margin:12px auto 8px;flex-shrink:0}.wcm-drawer-content[data-vaul-drawer-direction=left] .wcm-drawer-handle,.wcm-drawer-content[data-vaul-drawer-direction=right] .wcm-drawer-handle{display:none}.wcm-dialog-body,.wcm-drawer-body{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden}.wcm-drawer-body{overscroll-behavior:contain}.wcm-header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:24px;border-bottom:1px solid var(--ds-border-default, rgba(0, 0, 0, .07))}.wcm-header-text{display:flex;flex-direction:column;gap:4px;min-width:0}.wcm-title{font-family:Inter,sans-serif;font-weight:600;font-size:20px;line-height:1.25;letter-spacing:0;color:var(--ds-content-highest, #000000);margin:0}.wcm-subtitle{font-family:Inter,sans-serif;font-weight:400;font-size:14px;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65));margin:0}.wcm-close-btn{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;flex-shrink:0;border:none;background:transparent;color:var(--ds-content-low, #00000066);cursor:pointer;padding:0;transition:opacity .15s ease}.wcm-close-btn:hover{opacity:.6}.wcm-close-btn>svg{width:24px;height:24px}.wcm-divider{display:none}.wcm-body{display:flex;flex-direction:column;gap:16px;padding:24px}.wcm-section-header{display:flex;align-items:center;gap:8px;width:100%}.wcm-section-title{font-family:Inter,sans-serif;font-weight:600;font-size:16px;line-height:1;letter-spacing:0;color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wcm-recommended-badge{display:inline-flex;align-items:center;justify-content:center;padding:4px 8px;background:var(--ds-accent-primary-low, #e7f9f8);border-radius:9999px;font-family:Inter,sans-serif;font-weight:500;font-size:12px;line-height:1;letter-spacing:0;color:var(--ds-accent-primary-high, #00a0a2);white-space:nowrap}.wcm-social-grid{display:grid;gap:8px;width:100%}.wcm-dialog-body .wcm-social-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.wcm-drawer-body .wcm-social-grid{grid-template-columns:1fr}.wcm-social-item{display:flex;background:var(--ds-surface-medium, #f5f7fa);border:none;border-radius:12px;cursor:pointer;transition:none;font-family:inherit;color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wcm-social-item:hover{background:#2e3544!important}:root[data-ds-theme=light] .wcm-social-item:hover{background:#eff3f8!important}.wcm-social-item[data-provider=apple] .wcm-social-icon{color:#000}[data-theme=dark] .wcm-social-item[data-provider=apple] .wcm-social-icon{color:#fff}.wcm-dialog-body .wcm-social-item{flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:16px}.wcm-drawer-body .wcm-social-item{flex-direction:row;align-items:center;justify-content:flex-start;gap:12px;padding:16px}.wcm-social-icon{flex-shrink:0;width:32px;height:32px;display:flex;align-items:center;justify-content:center}.wcm-social-icon>svg{width:32px;height:32px}.wcm-social-name{font-family:Inter,sans-serif;font-weight:600;font-size:14px;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));white-space:nowrap}.wcm-separator{display:flex;align-items:center;gap:12px;width:100%}.wcm-separator-line{flex:1;height:1px;background:var(--ds-border-default, rgba(0, 0, 0, .07))}.wcm-separator-text{font-family:Inter,sans-serif;font-weight:500;font-size:12px;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4));white-space:nowrap}.wcm-wallet-list{display:flex;flex-direction:column;gap:8px}.wcm-wallet-item{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;padding:20px 16px;background:var(--ds-surface-medium, #f5f7fa);border:none;border-radius:12px;cursor:pointer;text-align:left;transition:none;font-family:inherit}.wcm-wallet-item:hover{background:#2e3544!important}:root[data-ds-theme=light] .wcm-wallet-item:hover{background:#eff3f8!important}.wcm-wallet-item-left{display:flex;align-items:center;gap:8px;flex:1;min-width:0}.wcm-wallet-icon{flex-shrink:0;width:28px;height:28px;display:flex;align-items:center;justify-content:center}.wcm-wallet-icon>svg,.wcm-wallet-icon>img{width:28px;height:28px;border-radius:0;object-fit:cover}.wcm-wallet-name-row{display:flex;align-items:center;gap:8px;min-width:0}.wcm-wallet-name{font-family:Inter,sans-serif;font-weight:600;font-size:16px;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));white-space:nowrap}.wcm-wallet-badge{display:inline-flex;align-items:center;justify-content:center;padding:4px 8px;background:var(--ds-system-purple-low, #f5f3ff);border:.5px solid var(--ds-system-purple-default, #7e54f4);border-radius:9999px;font-family:Inter,sans-serif;font-weight:500;font-size:12px;line-height:1;letter-spacing:0;color:var(--ds-system-purple-high, #7346f3);white-space:nowrap}.wcm-install-btn{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;padding:4px 8px;background:var(--ds-accent-primary-default, #00b4b7);border-radius:6px;font-family:Inter,sans-serif;font-weight:500;font-size:12px;line-height:1;letter-spacing:0;color:var(--ds-accent-primary-on, #ffffff);white-space:nowrap}.wcm-installed-label{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;font-family:Inter,sans-serif;font-weight:500;font-size:12px;line-height:1;letter-spacing:0;color:var(--ds-content-low, rgba(0, 0, 0, .4));white-space:nowrap}.wcm-terms{font-family:Inter,sans-serif;font-weight:400;font-size:12px;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65));text-align:center;margin:0}.wcm-terms-link{color:var(--ds-accent-primary-high, #00a0a2);text-decoration:none}.wcm-terms-link:hover{text-decoration:underline}.wcm-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}
16
- `);z(`@keyframes wcm-overlay-show{0%{opacity:0}to{opacity:1}}@keyframes wcm-overlay-hide{0%{opacity:1}to{opacity:0}}@keyframes wcm-dialog-show{0%{opacity:0;transform:translate(-50%,-48%) scale(.96)}to{opacity:1;transform:translate(-50%,-50%) scale(1)}}@keyframes wcm-dialog-hide{0%{opacity:1;transform:translate(-50%,-50%) scale(1)}to{opacity:0;transform:translate(-50%,-48%) scale(.96)}}
17
- `);var hn=require("react/jsx-runtime"),bd={};function wd({wallets:e,socialProviders:t=bd,termsUrl:n,privacyUrl:o,theme:r="dark",mobileBreakpoint:s=768,drawerDirection:i="bottom",dialogWidth:l,drawerMaxWidth:p,drawerMinWidth:c,style:f,open:g,onOpenChange:u,children:m}){let v=sn(`(max-width: ${s}px)`),[x,b]=Ct.useState(!1),y=g!==void 0,L=y?g:x,h=Ct.useCallback(V=>{y||b(V),u?.(V)},[y,u]),P=Ct.useCallback(()=>h(!1),[h]),{isDetected:T}=Fn(),B=Ct.useMemo(()=>Object.keys(e),[e]),R=Ct.useMemo(()=>Object.keys(t),[t]),$=Ct.useMemo(()=>{let V={};return l&&(V["--wcm-dialog-width"]=l),p&&(V["--wcm-drawer-max-width"]=p),c&&(V["--wcm-drawer-min-width"]=c),{...V,...f}},[l,p,c,f]),G=Ct.useMemo(()=>({theme:r,isMobile:v,open:L,setOpen:h,close:P,wallets:e,activeWalletIds:B,socialProviders:t,activeSocialIds:R,termsUrl:n,privacyUrl:o,isDetected:T,portalStyle:$}),[r,v,L,h,P,e,B,t,R,n,o,T,$]),ee=(0,hn.jsx)("div",{"data-theme":r,style:$,children:m});return v?(0,hn.jsx)(Lo.Provider,{value:G,children:(0,hn.jsx)(Qs.Drawer.Root,{direction:i,open:L,onOpenChange:h,noBodyStyles:!0,children:ee},"drawer")}):(0,hn.jsx)(Lo.Provider,{value:G,children:(0,hn.jsx)(Ks.Root,{open:L,onOpenChange:h,children:ee})})}var Cr=Object.assign(wd,{Trigger:_s,Content:qs});z(`.cb-button{--cb-bg: var(--ds-accent-primary-default, #00b4b7);--cb-bg-hover: var(--cb-bg);--cb-color: var(--ds-accent-primary-on-primary, #ffffff);--cb-border: none;--cb-radius: 8px;--cb-height: 36px;--cb-padding: 8px 16px;--cb-font-family: Inter, system-ui, -apple-system, sans-serif;--cb-font-size: 14px;--cb-font-weight: 500;--cb-line-height: 1.5;--cb-letter-spacing: -.01em;--cb-gap: 8px;--cb-transition: opacity .15s;--cb-loading-opacity: .7;--cb-press-scale: .95;--cb-icon-size: 18px;--cb-spinner-size: 18px;--cb-spinner-thumb: currentColor;--cb-spinner-track: color-mix(in srgb, currentColor 20%, transparent)}.cb-pill{--cb-pill-bg: var(--ds-surface-default, #ffffff);--cb-pill-bg-hover: var(--cb-pill-bg);--cb-pill-color: var(--ds-content-high, rgba(0, 0, 0, .85));--cb-pill-border: 1px solid var(--ds-border-default, rgba(0, 0, 0, .07));--cb-pill-border-hover: 1px solid var(--ds-border-medium, rgba(0, 0, 0, .18));--cb-pill-radius: 8px;--cb-pill-height: 36px;--cb-pill-padding: 1px 13px;--cb-pill-press-scale: .95;--cb-pill-font-family: Inter, system-ui, -apple-system, sans-serif;--cb-pill-font-size: 14px;--cb-pill-font-weight: 500;--cb-pill-line-height: 1.5;--cb-pill-gap: 8px;--cb-pill-icon-size: 18px;--cb-pill-icon-placeholder-bg: var(--ds-surface-medium, #f5f7fa);--cb-pill-address-font: Inter, system-ui, -apple-system, sans-serif;--cb-pill-address-font-size: 14px;--cb-pill-address-letter-spacing: -.01em}
18
- `);z(`.cb-button{-webkit-font-smoothing:antialiased;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;height:var(--cb-height);gap:var(--cb-gap);padding:var(--cb-padding);border-radius:var(--cb-radius);border:var(--cb-border);background:var(--cb-bg);color:var(--cb-color);font-family:var(--cb-font-family);font-size:var(--cb-font-size);font-weight:var(--cb-font-weight);line-height:var(--cb-line-height);letter-spacing:var(--cb-letter-spacing);cursor:pointer;transition:var(--cb-transition)}.cb-button:hover:not(:disabled){background:var(--cb-bg-hover)}.cb-button:active:not(:disabled){transform:scale(var(--cb-press-scale))}.cb-button:disabled,.cb-button[aria-busy=true]{cursor:default;opacity:var(--cb-loading-opacity)}.cb-spinner{display:inline-block;width:var(--cb-spinner-size);height:var(--cb-spinner-size);border:2px solid var(--cb-spinner-track);border-top-color:var(--cb-spinner-thumb);border-radius:50%;animation:cb-spin .6s linear infinite;flex-shrink:0}.cb-button-icon{width:var(--cb-icon-size);height:var(--cb-icon-size);flex-shrink:0}.cb-button-label{white-space:nowrap}.cb-pill{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;height:var(--cb-pill-height);gap:var(--cb-pill-gap);padding:var(--cb-pill-padding);border-radius:var(--cb-pill-radius);border:var(--cb-pill-border);background:var(--cb-pill-bg);color:var(--cb-pill-color);font-family:var(--cb-pill-font-family);font-size:var(--cb-pill-font-size);font-weight:var(--cb-pill-font-weight);line-height:var(--cb-pill-line-height);cursor:pointer}.cb-pill:hover{background:var(--cb-pill-bg-hover)}.cb-pill:active:not(:disabled){transform:scale(var(--cb-pill-press-scale))}.cb-pill-icon{width:var(--cb-pill-icon-size);height:var(--cb-pill-icon-size);border-radius:50%;object-fit:contain;flex-shrink:0;background:transparent}[data-theme=dark] .cb-pill-icon[data-provider=apple]{filter:invert(1)}.cb-pill-icon-placeholder{display:inline-block;width:var(--cb-pill-icon-size);height:var(--cb-pill-icon-size);border-radius:50%;background:var(--cb-pill-icon-placeholder-bg);flex-shrink:0}.cb-pill-address{font-family:var(--cb-pill-address-font);font-size:var(--cb-pill-address-font-size);letter-spacing:var(--cb-pill-address-letter-spacing);white-space:nowrap}@media(max-width:767.98px){.cb-button,.cb-pill{width:36px;min-width:36px;padding:0}.cb-button{height:36px}.cb-button-label,.cb-pill-address{display:none}}@keyframes cb-spin{to{transform:rotate(360deg)}}
19
- `);var xd='<svg preserveAspectRatio="none" width="100%" height="100%" overflow="visible" style="display: block;" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#c0)"><path d="M18 36C27.9411 36 36 27.9411 36 18C36 8.05887 27.9411 0 18 0C8.05887 0 0 8.05887 0 18C0 27.9411 8.05887 36 18 36Z" fill="#00D5AA"/><path fill-rule="evenodd" clip-rule="evenodd" d="M18.2903 2.57169L21.3525 5.63385V10.6471L25.3058 6.69381L29.6364 11.0244L25.7226 14.9381H18.2903C16.5992 14.9381 15.2283 16.309 15.2283 18.0003C15.2283 19.6915 16.5992 21.0624 18.2903 21.0624H25.6836L29.6365 25.0154L25.3059 29.3459L21.3525 25.3925V30.3666L18.2903 33.4288L15.2283 30.3666V25.4326L11.3148 29.3459L6.98426 25.0154L10.9372 21.0624H5.92394L2.86178 18.0003L5.92394 14.9381H10.8981L6.98437 11.0244L11.3149 6.69383L15.2283 10.6071V5.63385L18.2903 2.57169Z" fill="#000"/></g><defs><clipPath id="c0"><rect width="36" height="36" fill="#fff"/></clipPath></defs></svg>',vd='<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 28 28" fill="none"><g clip-path="url(#m0)"><path d="M26.07 26.93L20.06 25.07L15.53 27.88L12.37 27.88L7.83 25.07L1.83 26.93L0 20.53L1.83 13.44L0 7.44L1.83 0L11.21 5.81H16.69L26.07 0L27.9 7.44L26.07 13.44L27.9 20.53Z" fill="#FF5C16"/><path d="M7.83 20.54L11.96 23.8L7.83 25.07V20.54Z" fill="#FF5C16"/><path d="M20.06 20.54L15.93 23.8L20.06 25.07L20.06 20.54Z" fill="#FF5C16"/><path d="M11.63 15.14L12.78 22.85L11.19 18.56L5.77 17.17L7.83 15.14H11.63Z" fill="#E34807"/><path d="M16.27 15.14L15.12 22.85L16.71 18.56L22.13 17.17L20.07 15.14H16.27Z" fill="#E34807"/><path d="M0 20.53L1.83 13.44H5.76L5.77 17.17L11.19 18.56L12.78 22.85L11.96 23.79L7.83 20.53H0Z" fill="#FF8D5D"/><path d="M27.9 20.53L26.07 13.44H22.14L22.13 17.17L16.71 18.56L15.12 22.85L15.94 23.79L20.07 20.53H27.9Z" fill="#FF8D5D"/><path d="M16.69 5.81H11.21L10.84 9.81L12.78 22.85H15.12L17.06 9.81L16.69 5.81Z" fill="#FF8D5D"/><path d="M15.53 25.34V27.88H12.37V25.34H15.53Z" fill="#C0C4CD"/><path d="M7.83 25.07L12.37 27.88V25.34L11.96 23.79L7.83 25.07Z" fill="#E7EBF6"/><path d="M20.07 25.07L15.53 27.88V25.34L15.94 23.79L20.07 25.07Z" fill="#E7EBF6"/></g><defs><clipPath id="m0"><rect width="28" height="28" fill="#fff"/></clipPath></defs></svg>',yd='<svg width="100%" height="100%" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.23 16.81L20 9.04L27.77 16.81L32.29 12.29L20 0L7.71 12.29L12.23 16.81Z" fill="#F3BA2F"/><path d="M9.04 20L4.52 15.48L0 20L4.52 24.52L9.04 20Z" fill="#F3BA2F"/><path d="M12.23 23.19L20 30.96L27.77 23.19L32.29 27.71L20 40L7.71 27.71L12.23 23.19Z" fill="#F3BA2F"/><path d="M35.48 24.52L40 20L35.48 15.48L30.96 20L35.48 24.52Z" fill="#F3BA2F"/><path d="M24.58 20L20 15.41L16.61 18.8L16.22 19.19L15.42 19.99L20 24.59L24.59 20L24.58 20Z" fill="#F3BA2F"/></svg>',kd='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><path fill="#FFC107" d="M43.6 20.5H42V20H24v8h11.3A12 12 0 1 1 24 12c3 0 5.8 1.2 7.9 3l5.7-5.7A20 20 0 1 0 44 24c0-1.2-.1-2.4-.4-3.5z"/><path fill="#FF3D00" d="M6.3 14.7l6.6 4.8A12 12 0 0 1 24 12c3 0 5.8 1.2 7.9 3l5.7-5.7A20 20 0 0 0 6.3 14.7z"/><path fill="#4CAF50" d="M24 44c5.2 0 10-2 13.6-5.2l-6.3-5.3A12 12 0 0 1 12.7 28l-6.5 5A20 20 0 0 0 24 44z"/><path fill="#1976D2" d="M43.6 20.5H42V20H24v8h11.3a12 12 0 0 1-4.1 5.5l6.3 5.3C41 35.7 44 30.3 44 24c0-1.2-.1-2.4-.4-3.5z"/></svg>',Sd='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#000"><path d="M17.05 20.28c-.98.95-2.05.8-3.08.35-1.09-.46-2.09-.48-3.24 0-1.44.62-2.2.44-3.06-.35C2.79 15.25 3.51 7.59 9.05 7.31c1.35.07 2.29.74 3.08.8 1.18-.24 2.31-.93 3.57-.84 1.51.12 2.65.72 3.4 1.8-3.12 1.87-2.38 5.98.48 7.13-.57 1.5-1.31 2.99-2.53 4.08zM12.03 7.25c-.15-2.23 1.66-4.07 3.74-4.25.29 2.58-2.34 4.5-3.74 4.25z"/></svg>';function _n(e){return`data:image/svg+xml,${encodeURIComponent(e)}`}var On=_n(xd),zn=_n(vd),Wn=_n(yd),Dn=_n(kd),Hn=_n(Sd);var ge=require("react/jsx-runtime");function Nr({isConnecting:e,address:t,provider:n,providerName:o,accountName:r,sendAccounts:s,onConnect:i,onDisconnect:l,onCopy:p,onSelectWallet:c,onBuy:f,onBuyDisabledMessage:g,label:u="Connect Wallet",connectingLabel:m="Connecting...",disconnectLabel:v,className:x,theme:b="dark",env:y,showBalance:L=!0,showPortfolio:h,drawerDirection:P,modal:T,connectorId:B,style:R,walletInfoStyle:$,sendTransaction:G,getTransactionReceipt:ee,estimateGas:V,onReceive:D,onBridge:he,onSend:ye,bridgeTokens:fe,bridgeHistory:ue,getBridgeQuote:De,getBridgeToTokens:ie,getBridgeApproval:j,approveBridge:ne,submitBridge:Te}){let te=x?`cb-button ${x}`:"cb-button",He=x?`cb-pill ${x}`:"cb-pill";if(e)return(0,ge.jsxs)("button",{type:"button",disabled:!0,className:te,style:R,"aria-busy":"true",children:[(0,ge.jsx)("span",{className:"cb-spinner","aria-hidden":"true"}),(0,ge.jsx)("span",{className:"cb-button-label",children:m})]});if(t){let Ge=o??Rd(n),Re=n?Nd[n]:void 0;return(0,ge.jsxs)(on,{env:y,theme:b,drawerDirection:P,modal:T,showBalance:L,showPortfolio:h,walletAddress:t,accountName:r,sendAccounts:s,connectorId:B,onSelectWallet:c,onCopyAddress:p?(Ee,gt)=>{gt&&p()}:void 0,onDisconnect:l,disconnectLabel:v,style:$,sendTransaction:G,getTransactionReceipt:ee,estimateGas:V,onReceive:D,onBridge:he,onBuy:f,onBuyDisabledMessage:g,onSend:ye,bridgeTokens:fe,bridgeHistory:ue,getBridgeQuote:De,getBridgeToTokens:ie,getBridgeApproval:j,approveBridge:ne,submitBridge:Te,children:[(0,ge.jsx)(on.Trigger,{asChild:!0,children:(0,ge.jsxs)("button",{type:"button",className:He,style:R,"aria-label":`Connected with ${Ge}: ${Zs(t)}`,children:[Re?(0,ge.jsx)("img",{src:Re,alt:"",width:18,height:18,className:"cb-pill-icon","data-provider":n}):(0,ge.jsx)("span",{className:"cb-pill-icon-placeholder","aria-hidden":"true"}),(0,ge.jsx)("span",{className:"cb-pill-address",children:Zs(t)})]})}),(0,ge.jsx)(on.Content,{align:"end",sideOffset:8})]})}return(0,ge.jsxs)("button",{type:"button",onClick:i,className:te,style:R,"aria-label":typeof u=="string"?u:"Connect Wallet",children:[(0,ge.jsx)(Cd,{}),(0,ge.jsx)("span",{className:"cb-button-label",children:u})]})}function Cd(){return(0,ge.jsxs)("svg",{className:"cb-button-icon",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[(0,ge.jsx)("path",{d:"M3.75 5.25H14.25C15.0784 5.25 15.75 5.92157 15.75 6.75V13.5C15.75 14.3284 15.0784 15 14.25 15H3.75C2.92157 15 2.25 14.3284 2.25 13.5V4.5C2.25 3.67157 2.92157 3 3.75 3H13.5",stroke:"currentColor",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round"}),(0,ge.jsx)("path",{d:"M12 9.75H15.75V12.75H12C11.1716 12.75 10.5 12.0784 10.5 11.25C10.5 10.4216 11.1716 9.75 12 9.75Z",stroke:"currentColor",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round"}),(0,ge.jsx)("path",{d:"M12.75 11.25H12.7575",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}var Nd={google:Dn,apple:Hn,cross:On,metamask:zn,binance:Wn},Td={google:"Google",apple:"Apple",cross:"CROSSx",metamask:"MetaMask",binance:"Binance Wallet"};function Rd(e){return e?Td[e]:"Wallet"}function Zs(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}var Ys=O(require("react"),1);z(`.sb-button{--sb-bg: var(--ds-surface-default, #ffffff);--sb-border: var(--ds-border-default, rgba(0, 0, 0, .07));--sb-border-hover: var(--ds-border-default, rgba(0, 0, 0, .07));--sb-color: var(--ds-content-medium, rgba(0, 0, 0, .65));--sb-color-hover: var(--ds-content-high, rgba(0, 0, 0, .85));--sb-radius: 8px;--sb-height: 36px;--sb-padding: 1px 11px;--sb-gap: 4px;--sb-font-size: 14px;--sb-font-weight: 500;--sb-line-height: 21px;--sb-letter-spacing: 0;--sb-blur: 0px;--sb-border-width: 1px;--sb-icon-size: 18px;--sb-icon-hover-rotation: 180deg;--sb-spinner-size: 18px;--sb-spinner-thumb: currentColor;--sb-spinner-track: color-mix(in srgb, currentColor 20%, transparent);--sb-disabled-opacity: .6;--sb-press-scale: .95;--sb-hover-duration: .2s;--sb-icon-duration: .3s;--sb-easing: ease}.sb-button[data-theme=dark]{--sb-bg: var(--ds-surface-default, #1e232e);--sb-border: var(--ds-border-default, #ffffff12);--sb-border-hover: var(--ds-border-medium, #ffffff2e);--sb-color: var(--ds-content-medium, #ffffffa6);--sb-color-hover: var(--ds-content-high, #ffffffd9)}.sb-button[data-theme=light]{--sb-bg: var(--ds-surface-default, #ffffff);--sb-border: var(--ds-border-default, #00000012);--sb-border-hover: var(--ds-border-medium, #0000002e);--sb-color: var(--ds-content-medium, #000000a6);--sb-color-hover: var(--ds-content-high, #000000d9)}
20
- `);z(`.sb-button{-webkit-font-smoothing:antialiased;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;height:var(--sb-height);gap:var(--sb-gap);padding:var(--sb-padding);border-radius:var(--sb-radius);border:var(--sb-border-width) solid var(--sb-border);background:var(--sb-bg);backdrop-filter:blur(var(--sb-blur));-webkit-backdrop-filter:blur(var(--sb-blur));color:var(--sb-color);font-family:Inter,system-ui,-apple-system,sans-serif;font-weight:var(--sb-font-weight);font-size:var(--sb-font-size);line-height:var(--sb-line-height);letter-spacing:var(--sb-letter-spacing);cursor:pointer;transition:border-color var(--sb-hover-duration) var(--sb-easing),color var(--sb-hover-duration) var(--sb-easing)}@media(hover:hover){.sb-button:hover:not(:disabled){border-color:var(--sb-border-hover);color:var(--sb-color-hover)}.sb-button:hover:not(:disabled) .sb-button-icon{transform:rotate(var(--sb-icon-hover-rotation))}}.sb-button:active:not(:disabled){transform:scale(var(--sb-press-scale))}.sb-button:disabled,.sb-button[aria-busy=true]{cursor:default;opacity:var(--sb-disabled-opacity)}.sb-button-icon{width:var(--sb-icon-size);height:var(--sb-icon-size);flex-shrink:0;color:inherit;transition:transform var(--sb-icon-duration) var(--sb-easing),color var(--sb-icon-duration) var(--sb-easing)}.sb-spinner{display:inline-block;width:var(--sb-spinner-size);height:var(--sb-spinner-size);border:2px solid var(--sb-spinner-track);border-top-color:var(--sb-spinner-thumb);border-radius:50%;animation:sb-spin .6s linear infinite;flex-shrink:0}.sb-label{white-space:nowrap}@keyframes sb-spin{to{transform:rotate(360deg)}}
21
- `);var Ht=require("react/jsx-runtime"),Bo="https://skills.cross.nexus";function Tr({label:e="Skills",href:t=Bo,onClick:n,className:o,style:r,theme:s,disabled:i=!1,isLoading:l=!1,loadingLabel:p="Loading...",openInNewTab:c=!1,type:f="button"}){let[g,u]=Ys.useState(!1),m=async L=>{if(t&&!n){c?window.open(t,"_blank","noopener,noreferrer"):window.location.href=t;return}if(n)try{u(!0),await n()}finally{u(!1)}},v=i||l||g,x=l||g,b=x?p:e,y=o?`sb-button ${o}`:"sb-button";return(0,Ht.jsxs)("button",{type:f,onClick:m,disabled:v,className:y,"data-theme":s,style:r,"aria-busy":x,children:[x?(0,Ht.jsx)("span",{className:"sb-spinner","aria-hidden":"true"}):(0,Ht.jsx)(Id,{}),(0,Ht.jsx)("span",{className:"sb-label",children:b})]})}function Id(){return(0,Ht.jsx)("svg",{className:"sb-button-icon",viewBox:"0 0 34 34",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,Ht.jsx)("path",{d:"M15.5879 3.95142C16.0211 2.78097 17.6761 2.78099 18.1094 3.95142L19.6221 8.03833C20.6569 10.8348 22.8618 13.0396 25.6582 14.0745L29.7451 15.5872C30.9157 16.0204 30.9157 17.6754 29.7451 18.1086L25.6582 19.6213C22.8618 20.6562 20.657 22.861 19.6221 25.6575L18.1094 29.7444C17.6762 30.9149 16.0211 30.9149 15.5879 29.7444L14.0752 25.6575C13.0403 22.861 10.8355 20.6562 8.03906 19.6213L3.95215 18.1086C2.78172 17.6754 2.7817 16.0204 3.95215 15.5872L8.03906 14.0745C10.8355 13.0396 13.0403 10.8348 14.0752 8.03833L15.5879 3.95142Z",stroke:"currentColor",strokeWidth:"1.93556"})})}Kn({mode:"dapp-ui"});0&&(module.exports={APPLE_ICON,AppLauncher,AppLauncherContent,AppLauncherTrigger,BINANCE_ICON,BridgeFlow,CONNECTOR_REGISTRY,CROSSX_ICON,ConnectButton,ConnectorId,DEFAULT_SKILLS_HREF,GOOGLE_ICON,METAMASK_ICON,SOCIAL_REGISTRY,SendFlow,SkillsButton,TOKEN_STATS_QUERY_KEY,USER_BALANCE_QUERY_KEY,WALLET_REGISTRY,WalletConnectModal,WalletInfo,WalletPortfolio,WalletPortfolioBody,announceAppLauncherUsage,resolveEnvironment,useGlobalMenu,useTokenBalance,useTokenStats,useWalletDetect});
1
+ "use strict";var rl=Object.create;var Vn=Object.defineProperty;var il=Object.getOwnPropertyDescriptor;var al=Object.getOwnPropertyNames;var sl=Object.getPrototypeOf,ll=Object.prototype.hasOwnProperty;var cl=(e,t)=>{for(var n in t)Vn(e,n,{get:t[n],enumerable:!0})},Mr=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of al(t))!ll.call(e,r)&&r!==n&&Vn(e,r,{get:()=>t[r],enumerable:!(o=il(t,r))||o.enumerable});return e};var D=(e,t,n)=>(n=e!=null?rl(sl(e)):{},Mr(t||!e||!e.__esModule?Vn(n,"default",{value:e,enumerable:!0}):n,e)),dl=e=>Mr(Vn({},"__esModule",{value:!0}),e);var vd={};cl(vd,{APPLE_ICON:()=>Hn,AppLauncher:()=>Go,AppLauncherContent:()=>$o,AppLauncherTrigger:()=>Uo,BINANCE_ICON:()=>Wn,BridgeFlow:()=>An,CONNECTOR_REGISTRY:()=>yn,CROSSX_ICON:()=>On,ConnectButton:()=>vr,ConnectorId:()=>to,DEFAULT_SKILLS_HREF:()=>Eo,GOOGLE_ICON:()=>Dn,METAMASK_ICON:()=>zn,SOCIAL_REGISTRY:()=>Lo,SendFlow:()=>Tn,SkillsButton:()=>yr,TOKEN_STATS_QUERY_KEY:()=>uo,USER_BALANCE_QUERY_KEY:()=>po,WALLET_REGISTRY:()=>Io,WalletConnectModal:()=>xr,WalletInfo:()=>on,WalletPortfolio:()=>fr,WalletPortfolioBody:()=>Jt,announceAppLauncherUsage:()=>Kn,resolveEnvironment:()=>Ie,useGlobalMenu:()=>vn,useTokenBalance:()=>Zt,useTokenStats:()=>Yt,useWalletDetect:()=>Fn});module.exports=dl(vd);var pl={};function _r(e){try{return pl.env?.[e]}catch{return}}function Or(e){if(!(typeof process>"u"))return process.env?.[e]}function Ie(e){if(e)return zr(e);let t=_r("VITE_CROSSX_ENVIRONMENT")??_r("NEXT_PUBLIC_CROSSX_ENVIRONMENT")??Or("NEXT_PUBLIC_CROSSX_ENVIRONMENT")??Or("CROSSX_ENVIRONMENT");return zr(t)}function zr(e){switch(e?.toLowerCase()){case"dev":case"development":return"dev";case"stage":case"staging":case"stg":return"stage";default:return"production"}}var Do="1.3.1";var qn="__nexusCrossAppLauncherRuntime";function fl(){if(typeof window>"u")return null;let e=window;return e[qn]??(e[qn]={mode:"dapp-ui"}),e[qn]}function ul(e){if(e.scheduled)return;e.scheduled=!0;let t=()=>{if(e.scheduled=!1,e.loggedMode!==e.mode){if(e.mode==="connect-kit-react"){let n=e.connectKitVersion??"unknown";console.info(`[CROSSx App Launcher] connect-kit-react v${n} \uCD08\uAE30\uD654 \uC644\uB8CC (dapp-ui v${Do}, \uC0AC\uC6A9 \uBAA8\uB4DC: connect-kit)`)}else console.info(`[CROSSx App Launcher] dapp-ui v${Do} \uCD08\uAE30\uD654 \uC644\uB8CC (\uC0AC\uC6A9 \uBAA8\uB4DC: dapp-ui only)`);e.loggedMode=e.mode}};typeof queueMicrotask=="function"?queueMicrotask(t):Promise.resolve().then(t)}function Kn(e){let t=fl();t&&(e?.mode==="connect-kit-react"?t.mode="connect-kit-react":t.mode||(t.mode="dapp-ui"),e?.connectKitVersion&&(t.connectKitVersion=e.connectKitVersion),ul(t))}var ln=D(require("react"),1),Wr=D(require("@radix-ui/react-popover"),1),Dr=require("vaul");var Qn=require("react"),Ho=(0,Qn.createContext)(null);function Zn(){let e=(0,Qn.useContext)(Ho);if(!e)throw new Error("AppLauncher compound components must be used within <AppLauncher>");return e}var Yn=require("react");function sn(e){let[t,n]=(0,Yn.useState)(!1);return(0,Yn.useEffect)(()=>{let o=window.matchMedia(e);n(o.matches);let r=s=>n(s.matches);return o.addEventListener("change",r),()=>o.removeEventListener("change",r)},[e]),t}function O(e,{insertAt:t}={}){if(!e||typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",t==="top"&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}O(`[data-theme=dark]{--al-bg: var(--ds-surface-default, #1e232e);--al-bg-hover: var(--ds-surface-medium, #252b39);--al-text: var(--ds-content-highest, #ffffff);--al-text-secondary: var(--ds-content-medium, #ffffffa6);--al-border: var(--ds-border-default, #ffffff12);--al-shadow: var(--ds-shadow-modal, 0px 4px 30px -1px rgba(0, 0, 0, .7));--al-badge-bg: var(--ds-accent-primary-low, #123235);--al-badge-text: var(--ds-accent-primary-default, #00ceb2);--al-badge-new-text: var(--ds-system-purple-on, #ffffff);--al-drawer-overlay: var(--ds-overlay-dim, #000000b3)}[data-theme=light]{--al-bg: var(--ds-surface-default, #ffffff);--al-bg-hover: var(--ds-surface-medium, #f5f7fa);--al-text: var(--ds-content-highest, #000000);--al-text-secondary: var(--ds-content-medium, #000000a6);--al-border: var(--ds-border-default, #00000012);--al-shadow: var(--ds-shadow-modal, 0px 4px 30px -1px rgba(0, 0, 0, .15));--al-badge-bg: var(--ds-accent-primary-low, #e7f9f8);--al-badge-text: var(--ds-accent-primary-default, #00b4b7);--al-badge-new-text: var(--ds-system-purple-on, #ffffff);--al-drawer-overlay: var(--ds-overlay-dim, #00000080)}
2
+ `);O(`.al-trigger-btn{--at-bg: transparent;--at-bg-hover: #eaedf1;--at-color: var(--ds-content-high, rgba(0, 0, 0, .85));--at-border: none;--at-border-radius: 8px;--at-size: 36px;--at-padding: 0;--at-press-scale: .95;--at-transition: background-color .15s ease;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:var(--at-size);height:var(--at-size);padding:var(--at-padding);border:var(--at-border);background:var(--at-bg);border-radius:var(--at-border-radius);color:var(--at-color);cursor:pointer;transition:var(--at-transition)}.al-trigger-btn:hover,.al-trigger-btn[data-state=open]{background:var(--at-bg-hover)}.al-trigger-btn:active:not(:disabled){background:var(--at-bg-hover);transform:scale(var(--at-press-scale))}.al-trigger-btn[data-theme=dark]{--at-color: var(--ds-content-high, rgba(255, 255, 255, .85));--at-bg-hover: #252b39}.al-trigger-btn[data-theme=light]{--at-color: var(--ds-content-high, rgba(0, 0, 0, .85))}
3
+ `);O(`@keyframes al-fade-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}
4
+ `);O(`.al-popover-content{-webkit-font-smoothing:antialiased;z-index:100001;border-radius:24px;background:var(--al-bg);border:1px solid var(--al-popover-border, var(--al-border));box-shadow:var(--al-popover-shadow, var(--al-shadow));animation:al-fade-in .15s ease-out;max-height:80vh;overflow-x:hidden;overflow-y:auto;padding:20px 4px;box-sizing:border-box}.al-popover-content .al-grid{grid-template-columns:repeat(4,100px);row-gap:16px;column-gap:0;padding:0;justify-content:center;align-items:start}.al-popover-content .al-grid-item{flex-direction:column;justify-content:flex-start;align-items:center;gap:6px;padding:12px 0;width:100px;min-width:0;border-radius:10px}.al-popover-content .al-grid-item-left{flex-direction:column;align-items:center;gap:8px;width:100%;overflow:visible}.al-popover-content .al-grid-item-icon{width:50px;height:50px;border-radius:10.125px;overflow:hidden}.al-popover-content .al-grid-item-icon img{object-fit:cover}.al-popover-content .al-grid-item-label{font-family:Inter,sans-serif;font-size:12px;font-weight:500;line-height:1.1;letter-spacing:0;text-align:center;color:var(--al-text);max-width:100%;white-space:normal;overflow-wrap:anywhere}.al-popover-content .al-grid-item-right,.al-popover-content .al-badge-new{display:none}.al-drawer-overlay{position:fixed;inset:0;z-index:100000;background:var(--al-drawer-overlay)}.al-drawer-content{-webkit-font-smoothing:antialiased;position:fixed;top:0;right:0;bottom:0;z-index:100001;width:100vw;background:var(--al-bg);overflow-x:hidden;overflow-y:hidden;display:flex;flex-direction:column;box-sizing:border-box}.al-drawer-body{flex:1;overflow-y:auto;overscroll-behavior-y:contain;min-height:0}.al-drawer-content .al-grid{display:flex;flex-direction:column;grid-template-columns:none;max-width:100%;overflow:hidden;flex-shrink:0;gap:0;row-gap:0;column-gap:0;padding:8px 16px}.al-drawer-content .al-grid-item{width:100%;max-width:100%;gap:8px;padding:16px 12px;border-radius:8px;overflow:hidden;background:transparent}.al-drawer-content .al-grid-item:hover,.al-drawer-content .al-grid-item[data-active=true]{background:var(--al-bg-hover)}.al-drawer-content .al-grid-item-left{gap:8px;flex:1 1 auto;min-width:0}.al-drawer-content .al-grid-item-icon{width:32px;height:32px;border-radius:6.75px;overflow:hidden}.al-drawer-content .al-grid-item-icon img{width:100%;height:100%;object-fit:cover;border-radius:6.75px}.al-drawer-content .al-grid-item-label{font-size:16px;line-height:1.35;letter-spacing:0;font-weight:400}.al-drawer-content .al-grid-item[data-active=true] .al-grid-item-label{font-weight:500}.al-drawer-header{display:flex;align-items:center;justify-content:space-between;padding:16px;flex-shrink:0}.al-drawer-title{font-family:Inter,sans-serif;font-size:16px;font-weight:500;line-height:1.5;letter-spacing:0;color:var(--al-text);margin:0}.al-drawer-close{display:inline-flex;align-items:center;justify-content:center;padding:4px;border:none;background:transparent;border-radius:4px;cursor:pointer;color:var(--ds-content-low, #00000066);transition:opacity .15s ease}.al-drawer-close:hover{opacity:.7}.al-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:4px;padding:8px}.al-grid-item{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:16px 12px;border:none;background:var(--al-bg);border-radius:8px;cursor:pointer;transition:none;color:var(--al-text);text-align:left;font-family:Inter,sans-serif;flex-shrink:0}.al-grid-item:hover,.al-grid-item[data-active=true]{background:#252b39!important}:root[data-ds-theme=light] .al-grid-item:hover,:root[data-ds-theme=light] .al-grid-item[data-active=true]{background:#eff3f8!important}.al-grid-item-left{display:flex;align-items:center;gap:8px;min-width:0;overflow:hidden}.al-grid-item-right{display:flex;align-items:center;gap:6px;flex-shrink:0}.al-grid-item-icon{display:flex;align-items:center;justify-content:center;width:24px;height:24px;flex-shrink:0}.al-grid-item-icon img{width:100%;height:100%;object-fit:contain}.al-grid-item-label{font-family:Inter,sans-serif;font-size:16px;font-weight:500;line-height:150%;letter-spacing:0;color:var(--al-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.al-badge{display:flex;padding:1px 4px 2px;justify-content:center;align-items:center;gap:2px;border-radius:3px;background:var(--al-badge-bg);color:var(--al-badge-text);font-family:Pretendard,Inter,sans-serif;font-size:10px;font-weight:600;line-height:150%;letter-spacing:0;white-space:nowrap;flex-shrink:0}.al-badge-new{display:flex;width:16px;height:16px;justify-content:center;align-items:center;aspect-ratio:1/1;border-radius:12px;background:var(--ds-system-purple-high, #7346f3);color:var(--al-badge-new-text);font-family:Pretendard,Inter,sans-serif;font-size:9px;font-weight:700;flex-shrink:0}
5
+ `);O("");var Xn=require("react/jsx-runtime");function Go({env:e,theme:t="dark",mobileBreakpoint:n=768,domain:o,children:r}){let s=sn(`(max-width: ${n}px)`),[a,l]=ln.useState(!1),p=ln.useCallback(()=>l(!1),[]),d=Ie(e),f=ln.useMemo(()=>({env:d,theme:t,isMobile:s,open:a,domain:o,close:p}),[d,t,s,a,o,p]);return(0,Xn.jsx)(Ho.Provider,{value:f,children:s?(0,Xn.jsx)(Dr.Drawer.Root,{direction:"right",open:a,onOpenChange:l,noBodyStyles:!0,children:r},"drawer"):(0,Xn.jsx)(Wr.Root,{open:a,onOpenChange:l,children:r},"popover")})}var $r=D(require("@radix-ui/react-popover"),1),jr=require("vaul");var Le=require("react/jsx-runtime");function Hr({size:e=18}){return(0,Le.jsxs)("svg",{className:"al-trigger-icon",width:e,height:e,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,Le.jsx)("rect",{width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Le.jsx)("rect",{x:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Le.jsx)("rect",{x:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Le.jsx)("rect",{y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Le.jsx)("rect",{x:"7",y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Le.jsx)("rect",{x:"14",y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Le.jsx)("rect",{y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Le.jsx)("rect",{x:"7",y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Le.jsx)("rect",{x:"14",y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"})]})}function Gr(){return(0,Le.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Le.jsx)("path",{d:"M12 19L5 12M5 12L12 5M5 12H19",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ur(){return(0,Le.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Le.jsx)("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}var xn=require("react/jsx-runtime");function Uo({asChild:e,children:t,className:n,style:o}){let{isMobile:r,theme:s}=Zn(),a=t!=null,l=e??!0,p=n?`al-trigger-btn ${n}`:"al-trigger-btn",d=a?t:(0,xn.jsx)("button",{type:"button",className:p,"data-theme":s,style:o,children:(0,xn.jsx)(Hr,{size:18})});return r?(0,xn.jsx)(jr.Drawer.Trigger,{asChild:l,children:d}):(0,xn.jsx)($r.Trigger,{asChild:l,children:d})}var jt=D(require("react"),1),Jn=D(require("@radix-ui/react-popover"),1),$t=require("vaul");var Kr=require("@tanstack/react-query");var Vr={dev:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/app-launcher.json",stage:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/app-launcher.json",production:"https://contents.crosstoken.io/frontend/common/app-launcher/app-launcher.json"};var ml="https://stg-contents.crosstoken.io/frontend/common/app-launcher/icons",gl="https://contents.crosstoken.io/frontend/common/app-launcher/icons";function lt(e,t){return`${e==="production"?gl:ml}/${t}.png`}function qr(e){let t=e==="production"?"production":"stage";return{version:"0.0.1-fallback",items:[{id:"gametoken-cross",label:"Gametoken",description:"Trade game tokens easily using CROSS.",url:{dev:"https://dev-x.crosstoken.io/gametoken/CROSS",stage:"https://stg-x.crosstoken.io/gametoken/CROSS",production:"https://x.crosstoken.io/gametoken/CROSS"},iconUrl:lt(t,"dex"),order:1e3,type:"gametoken",badge:null,isNew:!1},{id:"forge",label:"Forge",description:"Launch Your Game, Ignite the Market",url:{dev:"https://stg-x.crosstoken.io/forge",stage:"https://stg-x.crosstoken.io/forge",production:"https://x.crosstoken.io/forge"},iconUrl:lt(t,"forge"),order:4e3,type:"forge",badge:null,isNew:!0},{id:"crossd",label:"Bridge (CROSSD)",description:"The first decentralized exchange on the CROSS network.",url:{dev:"https://stg.crossdefi.io/swap-bridge",stage:"https://stg.crossdefi.io/swap-bridge",production:"https://www.crossdefi.io/swap-bridge"},iconUrl:lt(t,"crossd"),order:5e3,type:"crossd",badge:null,isNew:!1},{id:"prediction",label:"Prediction",description:"Prediction market",url:{dev:"https://stg-prediction.crossdefi.io",stage:"https://stg-prediction.crossdefi.io",production:"https://prediction.crossdefi.io/"},iconUrl:lt(t,"prediction"),order:6e3,type:"prediction",badge:null,isNew:!0},{id:"rewards",label:"Rewards",description:"Deposit CROSS and earn rewards. Grow together.",url:{dev:"https://stg-x.crosstoken.io/rewards",stage:"https://stg-x.crosstoken.io/rewards",production:"https://x.crosstoken.io/rewards"},iconUrl:lt(t,"reward"),order:7e3,type:"rewards",badge:null,isNew:!1},{id:"nft",label:"NFT",description:"Trade and collect NFTs in the CROSS ecosystem.",url:{dev:"https://stg.crossnft.io/",stage:"https://stg.crossnft.io/",production:"https://www.crossnft.io/"},iconUrl:lt(t,"nft"),order:8e3,type:"nft",badge:null,isNew:!1},{id:"play",label:"Play",description:"Discover and play games on CROSS.",url:{dev:"https://stg-play.cross.nexus",stage:"https://stg-play.cross.nexus",production:"https://play.cross.nexus"},iconUrl:lt(t,"play"),order:8500,type:"play",badge:null,isNew:!0},{id:"shop",label:"Shop",description:"Game Payment Platform & In-Game Currency Store.",url:{dev:"https://www.dev.cross.shop/",stage:"https://www.stage.cross.shop/",production:"https://www.cross.shop/"},iconUrl:lt(t,"shop"),order:9e3,type:"shop",badge:null,isNew:!1},{id:"points",label:"Points",description:"Dive into CROSS World, Earn CROSS Points",url:{dev:"https://stg-x.crosstoken.io/points",stage:"https://stg-x.crosstoken.io/points",production:"https://x.crosstoken.io/points"},iconUrl:lt(t,"point"),order:1e4,type:"points",badge:null,isNew:!1},{id:"wave",label:"Wave",description:"Stream, support, and earn in the CROSS ecosystem.",url:{dev:"https://stg-wave.crosstoken.io/en",stage:"https://stg-wave.crosstoken.io/en",production:"https://wave.crosstoken.io/en"},iconUrl:lt(t,"wave"),order:11e4,type:"wave",badge:null,isNew:!1},{id:"explorer",label:"Explorer",description:"View transactions, blocks, and token data on the CROSS network.",url:{dev:"https://stg-explorer.crosstoken.io/612055",stage:"https://stg-explorer.crosstoken.io/612055",production:"https://explorer.crosstoken.io/612055"},iconUrl:lt(t,"explorer"),order:12e3,type:"explorer",badge:null,isNew:!1}]}}function vn(e){let t=Ie(e);return(0,Kr.useQuery)({queryKey:["global-menu",t],queryFn:async({signal:n})=>{try{let o=await fetch(Vr[t],{cache:"no-store",signal:n});if(!o.ok)throw new Error(`Failed to fetch global menu: ${o.status}`);return o.json()}catch(o){if(n.aborted)throw o;return qr(t)}},staleTime:0,gcTime:0,retry:!1,refetchOnMount:!0})}function Y(...e){return e.filter(Boolean).join(" ")}var ie=require("react/jsx-runtime");function hl(e){return e.id==="cross-staking"||e.type==="cross-staking"}function $o({align:e="end",sideOffset:t=8,className:n}){let{env:o,theme:r,isMobile:s,domain:a,close:l}=Zn(),{data:p}=vn(o),d=jt.useMemo(()=>(p?.items??[]).sort((w,v)=>w.order-v.order),[p]),f=8,m=jt.useRef(null),g=jt.useCallback(w=>{m.current={x:w.clientX,y:w.clientY}},[]),h=typeof window<"u"?window.location.pathname:"",x=jt.useCallback((w,v)=>{if(m.current){let E=w.clientX-m.current.x,T=w.clientY-m.current.y;if(m.current=null,Math.abs(E)>f||Math.abs(T)>f)return}let I=v.url[o]??v.url.production,u=Qr(I,a);if(!u)try{let E=new URL(I).pathname;if(h===E||h.startsWith(E+"/")){l();return}}catch{}u?window.open(I,"_blank","noopener,noreferrer"):window.location.href=I,l()},[o,a,l,h]),y=(0,ie.jsx)("div",{className:"al-grid","data-theme":r,children:d.map(w=>{let v=w.url[o]??w.url.production,I=Qr(v,a),u=!1;if(!I)try{let E=new URL(v).pathname;u=h===E||h.startsWith(E+"/")}catch{u=!1}return(0,ie.jsxs)("button",{type:"button",className:"al-grid-item","data-active":u||void 0,onPointerDown:g,onClick:E=>x(E,w),children:[(0,ie.jsxs)("div",{className:"al-grid-item-left",children:[(0,ie.jsx)("div",{className:"al-grid-item-icon",children:(0,ie.jsx)("img",{src:w.iconUrl,alt:w.label,width:24,height:24,loading:"lazy"})}),(0,ie.jsx)("span",{className:"al-grid-item-label",children:w.label}),w.isNew&&(0,ie.jsx)("span",{className:"al-badge-new",children:"N"})]}),(0,ie.jsx)("div",{className:"al-grid-item-right",children:w.badge&&!hl(w)&&(0,ie.jsx)("span",{className:"al-badge",children:w.badge})})]},w.id)})});return s?(0,ie.jsxs)($t.Drawer.Portal,{children:[(0,ie.jsx)($t.Drawer.Overlay,{className:"al-drawer-overlay"}),(0,ie.jsxs)($t.Drawer.Content,{className:Y("al-drawer-content",n),"data-theme":r,children:[(0,ie.jsxs)("div",{className:"al-drawer-header",children:[(0,ie.jsx)($t.Drawer.Close,{className:"al-drawer-close",children:(0,ie.jsx)(Gr,{})}),(0,ie.jsx)($t.Drawer.Title,{className:"al-drawer-title",children:"CROSS Services"}),(0,ie.jsx)($t.Drawer.Close,{className:"al-drawer-close",children:(0,ie.jsx)(Ur,{})})]}),(0,ie.jsx)("div",{className:"al-drawer-body",children:y})]})]}):(0,ie.jsx)(Jn.Portal,{children:(0,ie.jsx)(Jn.Content,{align:e,sideOffset:t,className:Y("al-popover-content",n),"data-theme":r,children:y})})}function Qr(e,t){try{let n=new URL(e).hostname;return typeof window>"u"?!0:n!==(t??window.location.hostname)}catch{return!1}}var Fe=D(require("react"),1),Cs=D(require("@radix-ui/react-popover"),1),Ns=require("vaul");var eo=require("react"),jo=(0,eo.createContext)(null);function Mt(){let e=(0,eo.useContext)(jo);if(!e)throw new Error("WalletInfo compound components must be used within <WalletInfo>");return e}var to=(o=>(o.CROSSx="crossx",o.MetaMask="io.metamask",o.Binance="com.binance.wallet",o))(to||{}),yn={crossx:{name:"CROSSx",iconUrl:"https://contents.crosstoken.io/wallet/token/images/tCROSS.svg"},"io.metamask":{name:"MetaMask",iconUrl:"https://upload.wikimedia.org/wikipedia/commons/3/36/MetaMask_Fox.svg"},"com.binance.wallet":{name:"Binance Wallet",iconUrl:"https://public.bnbstatic.com/static/images/common/favicon.ico"}};var Gi=D(require("react"),1);var z=require("react/jsx-runtime");function Zr({size:e=16,className:t}){return(0,z.jsxs)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,z.jsx)("path",{d:"M12.6667 4.66667V2.66667C12.6667 2.48986 12.5964 2.32029 12.4714 2.19526C12.3464 2.07024 12.1768 2 12 2H3.33333C2.97971 2 2.64057 2.14048 2.39052 2.39052C2.14048 2.64057 2 2.97971 2 3.33333C2 3.68696 2.14048 4.02609 2.39052 4.27614C2.64057 4.52619 2.97971 4.66667 3.33333 4.66667H13.3333C13.5101 4.66667 13.6797 4.7369 13.8047 4.86193C13.9298 4.98695 14 5.15652 14 5.33333V8M14 8H12C11.6464 8 11.3072 8.14048 11.0572 8.39052C10.8071 8.64057 10.6667 8.97971 10.6667 9.33333C10.6667 9.68696 10.8071 10.0261 11.0572 10.2761C11.3072 10.5262 11.6464 10.6667 12 10.6667H14C14.1768 10.6667 14.3464 10.5964 14.4714 10.4714C14.5964 10.3464 14.6667 10.1768 14.6667 10V8.66667C14.6667 8.48986 14.5964 8.32029 14.4714 8.19526C14.3464 8.07024 14.1768 8 14 8Z",stroke:"currentColor",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"}),(0,z.jsx)("path",{d:"M2 3.33325V12.6666C2 13.0202 2.14048 13.3593 2.39052 13.6094C2.64057 13.8594 2.97971 13.9999 3.33333 13.9999H13.3333C13.5101 13.9999 13.6797 13.9297 13.8047 13.8047C13.9298 13.6796 14 13.5101 14 13.3333V10.6666",stroke:"currentColor",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Vo({size:e=16,className:t}){return(0,z.jsx)("svg",{width:e,height:e,viewBox:"4 4 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,z.jsx)("path",{d:"M9.40284 17.0647H4.85156V4.84656H17.0697V9.39783H15.4407V6.47565H6.48066V15.4356H9.40284V17.0647ZM21.5192 12.5644H12.5592V21.5244H21.5192V12.5644ZM23.1483 10.9353V23.1535H10.9301V10.9353H23.1483Z",fill:"currentColor"})})}function kn({size:e=16,className:t}){return(0,z.jsx)("svg",{width:e,height:e,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,z.jsx)("path",{d:"M11.6667 3.5L5.25 9.91667L2.33334 7",stroke:"currentColor",strokeWidth:1.16667,strokeLinecap:"round",strokeLinejoin:"round"})})}function vt({size:e=24,className:t}){return(0,z.jsx)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,z.jsx)("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function Yr({size:e=20,className:t}){return(0,z.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,z.jsx)("path",{d:"M7.5 17.5H4.167A1.667 1.667 0 012.5 15.833V4.167A1.667 1.667 0 014.167 2.5H7.5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),(0,z.jsx)("path",{d:"M13.333 14.167L17.5 10l-4.167-4.167M17.5 10H7.5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}function qo({size:e=20,className:t}){return(0,z.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,children:(0,z.jsx)("path",{d:"M7.91305 10.8327C8.60341 10.8327 9.16305 11.3924 9.16305 12.0827V16.2458C9.16305 16.9361 8.60341 17.4958 7.91305 17.4958H3.75C3.05964 17.4958 2.5 16.9361 2.5 16.2458L2.5 12.0827C2.5 11.3924 3.05964 10.8327 3.75 10.8327H7.91305ZM14.1685 17.4958H12.5027V15.83H14.1685V17.4958ZM17.5 17.4958H15.8342V15.83H17.5V17.4958ZM4.16576 12.4985V15.83H7.49729V12.4985H4.16576ZM12.5027 15.83H10.8369V14.1642H12.5027V15.83ZM15.8342 15.83H14.1685V14.1642H15.8342V15.83ZM14.1685 14.1642H12.5027V12.4985H14.1685V14.1642ZM17.5 14.1642H15.8342V12.4985H17.5V14.1642ZM12.5027 12.4985H10.8369V10.8327H12.5027V12.4985ZM15.8342 12.4985H14.1685V10.8327H15.8342V12.4985ZM7.91305 2.50391C8.60341 2.50391 9.16305 3.06355 9.16305 3.75391V7.91696C9.16305 8.60731 8.60341 9.16696 7.91305 9.16696H3.75C3.05964 9.16696 2.5 8.60731 2.5 7.91696L2.5 3.75391C2.5 3.06355 3.05964 2.50391 3.75 2.50391L7.91305 2.50391ZM16.2419 2.50391C16.9322 2.50391 17.4919 3.06355 17.4919 3.75391V7.91696C17.4919 8.60731 16.9322 9.16696 16.2419 9.16696H12.0788C11.3885 9.16696 10.8288 8.60731 10.8288 7.91696V3.75391C10.8288 3.06355 11.3885 2.50391 12.0788 2.50391L16.2419 2.50391ZM4.16576 4.16967L4.16576 7.50119L7.49729 7.50119L7.49729 4.16967L4.16576 4.16967ZM12.4946 4.16967V7.50119H15.8261V4.16967H12.4946Z",fill:"currentColor",fillOpacity:1})})}function Lt({size:e=20,className:t}){return(0,z.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,z.jsx)("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:1.67,strokeLinecap:"round",strokeLinejoin:"round"})})}function Vt({size:e=20,className:t}){return(0,z.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,z.jsx)("path",{d:"M5 8L10 13L15 8",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function Xr({size:e=16,className:t}){return(0,z.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,z.jsx)("path",{d:"M1.667 10S4.167 4.167 10 4.167 18.333 10 18.333 10 15.833 15.833 10 15.833 1.667 10 1.667 10z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),(0,z.jsx)("path",{d:"M10 12.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Jr({size:e=16,className:t}){return(0,z.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,z.jsx)("path",{d:"M14.95 14.95A8.283 8.283 0 0110 16.667c-5.833 0-8.333-5.833-8.333-5.833a15.238 15.238 0 014.183-4.884m3.267-1.55A7.55 7.55 0 0110 4.167c5.833 0 8.333 5.833 8.333 5.833a15.28 15.28 0 01-1.783 2.633M11.767 11.767a2.5 2.5 0 11-3.534-3.534",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),(0,z.jsx)("path",{d:"M1.667 1.667l16.666 16.666",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}function ei({size:e=42,className:t}){return(0,z.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 42 42",fill:"none",className:t,children:(0,z.jsx)("path",{d:"M20.7314 2C31.0766 2 39.4628 10.3863 39.4629 20.7314C39.4629 31.0766 31.0766 39.4629 20.7314 39.4629C10.3863 39.4628 2 31.0766 2 20.7314C2.00007 10.3864 10.3864 2.00007 20.7314 2ZM20.5938 30.0586L21.1084 30.5732L21.623 30.0586V25.2471H21.1084C20.9344 25.2471 20.7626 25.235 20.5938 25.2158V30.0586ZM16.4834 24.6611L14.6514 26.4922L15.3799 27.2207L17.1797 25.4209L18.3193 24.2803C18.0487 24.0673 17.8025 23.8251 17.5869 23.5566L16.4834 24.6611ZM26.8691 27.2207L27.5967 26.4922L26.3516 25.2471H24.8955L26.8691 27.2207ZM11.2666 20.7314L11.7822 21.2471H16.624C16.6048 21.0781 16.5938 20.9065 16.5938 20.7324C16.5938 20.5585 16.6049 20.3866 16.624 20.2178H11.7812L11.2666 20.7314ZM20.5938 11.4053V16.2471C20.7626 16.2279 20.9345 16.2178 21.1084 16.2178H21.623V11.4053L21.1084 10.8906L20.5938 11.4053ZM14.6514 15.0029L16.4521 16.8027L17.5732 17.9238C17.7874 17.6546 18.0315 17.4104 18.3008 17.1963L15.3799 14.2754L14.6514 15.0029ZM25.0371 16.1074L24.9268 16.2178H26.3818L27.5957 15.0029L26.8682 14.2754L25.0371 16.1074Z",fill:"#019D92",stroke:"white",strokeWidth:4})})}function ti({size:e=20,className:t}){return(0,z.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,z.jsx)("path",{d:"M9.19133 10.8077C9.04905 10.6657 8.87947 10.554 8.69283 10.4792L2.78881 8.11167C2.71832 8.08338 2.65816 8.03421 2.61642 7.97075C2.57468 7.90729 2.55335 7.83258 2.5553 7.75665C2.55724 7.68072 2.58237 7.6072 2.6273 7.54596C2.67224 7.48472 2.73483 7.4387 2.80668 7.41406L16.9525 2.5747C17.0185 2.55087 17.0899 2.54632 17.1583 2.56159C17.2268 2.57685 17.2895 2.6113 17.3391 2.66089C17.3887 2.71049 17.4231 2.77319 17.4384 2.84165C17.4536 2.9101 17.4491 2.9815 17.4253 3.04746L12.5859 17.1933C12.5613 17.2651 12.5152 17.3277 12.454 17.3727C12.3928 17.4176 12.3192 17.4427 12.2433 17.4447C12.1674 17.4466 12.0927 17.4253 12.0292 17.3835C11.9658 17.3418 11.9166 17.2817 11.8883 17.2112L9.52073 11.3056C9.44567 11.1191 9.33362 10.9498 9.19133 10.8077ZM9.19133 10.8077L17.3367 2.66404",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})})}function ni({size:e=20,className:t}){return(0,z.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,z.jsx)("path",{d:"M10.8333 14.1667V7.5M15 14.1667V4.16667M2.5 2.5V15.8333C2.5 16.2754 2.67559 16.6993 2.98816 17.0118C3.30072 17.3244 3.72464 17.5 4.16667 17.5H17.5M6.66667 14.1667V11.6667",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})})}function oi({size:e=20,className:t}){return(0,z.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,z.jsx)("path",{d:"M6.6665 9.99984H13.3332M9.99984 6.6665V13.3332M18.3332 9.99984C18.3332 14.6022 14.6022 18.3332 9.99984 18.3332C5.39746 18.3332 1.6665 14.6022 1.6665 9.99984C1.6665 5.39746 5.39746 1.6665 9.99984 1.6665C14.6022 1.6665 18.3332 5.39746 18.3332 9.99984Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})})}function ri({size:e=20,className:t}){return(0,z.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,z.jsx)("path",{d:"M6.667 2.5 3.333 5.833 6.667 9.167M3.333 5.833h13.334M13.333 17.5l3.334-3.333-3.334-3.334M16.667 14.167H3.333",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})})}function ii({size:e=20,className:t}){return(0,z.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,z.jsx)("circle",{cx:"10",cy:"10",r:"10",fill:"currentColor"}),(0,z.jsx)("path",{d:"M6 10.2L8.6 12.8L14 7.2",stroke:"var(--ds-accent-primary-on, #ffffff)",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round"})]})}var L=D(require("react"),1);var _t=D(require("bignumber.js"),1);function bl(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===48;)t--;return t>0&&e.charCodeAt(t-1)===46&&t--,e.slice(0,t)}function Ot(e,t){if(!e||e==="0")return"0.00";let n=new _t.default(e).shiftedBy(-t),o=n.isGreaterThanOrEqualTo(1)?2:4;return n.toFormat(o,_t.default.ROUND_DOWN)}function Qe(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}function Ko(e){let t=typeof e=="string"?parseFloat(e):e;if(Number.isNaN(t)||t===0)return"$0.00";let n=t>=1?2:4,o=Math.pow(10,n);return`$${(Math.floor(t*o)/o).toLocaleString("en-US",{minimumFractionDigits:n,maximumFractionDigits:n})}`}function ai(e,t,n){let r=new _t.default(e).shiftedBy(-t).multipliedBy(new _t.default(n));return r.isZero()||r.isNaN()?"$0.00":`$${(r.integerValue(_t.default.ROUND_DOWN).isGreaterThanOrEqualTo(1)?r.decimalPlaces(2,_t.default.ROUND_DOWN):r.decimalPlaces(4,_t.default.ROUND_DOWN)).toFormat()}`}function si(e){if(e===""||e===null||e===void 0)return{displayValue:"0",isLowerBound:!1};let t=typeof e=="number"?e.toString():e;if(t==="0"||t==="0.0")return{displayValue:"0",isLowerBound:!1};let n=t;if(n.includes("e")||n.includes("E")){let a=Number(n);if(!Number.isFinite(a)||a===0)return{displayValue:"0",isLowerBound:!1};n=bl(a.toFixed(18))}let[o="0",r=""]=n.split(".");if(Number(o)>=1){let a=r.slice(0,2).padEnd(2,"0");return{displayValue:`${Number(o).toLocaleString("en-US")}.${a}`,isLowerBound:!1}}return r.length<4?{displayValue:`${o}.${r}`,isLowerBound:!1}:r.slice(0,4)==="0000"?{displayValue:"0.0001",isLowerBound:!0}:{displayValue:`0.${r.slice(0,4)}`,isLowerBound:!1}}var li=require("react"),ci=require("@tanstack/react-query");var rt={dev:"https://stg-wallet-server.crosstoken.io/api",stage:"https://stg-wallet-server.crosstoken.io/api",production:"https://wallet-server.crosstoken.io/api"},ze={dev:{cross:612044,bsc:97},stage:{cross:612044,bsc:97},production:{cross:612055,bsc:56}};var wl="send:chain-info";function xl(e){if("data"in e&&e.data!==void 0){let t=e.data;if(Array.isArray(t)){let n=t[0];if(!n)throw new Error("Chain info payload is empty.");return n}return t}return e}function Qo(e,...t){let n=e.replace(/\/+$/,""),o=t.map(r=>r.replace(/^\/+|\/+$/g,"")).filter(Boolean);return[n,...o].join("/")}function vl(e,t,n,o){if(o)return t===ze[e].cross?di(t,o):n?.explorer_url?Qo(n.explorer_url,n.explorer_postfix?.transaction??"tx",o):yl(e,t,o)}function di(e,t){return Qo("https://explorer.crosstoken.io",String(e),"tx",t)}function yl(e,t,n){let o=ze[e];if(t===o.cross)return di(t,n);if(t===o.bsc)return Qo(e==="production"?"https://bscscan.com":"https://testnet.bscscan.com","tx",n)}function no(e,t,n,o=!0){let r=rt[e],s=(0,ci.useQuery)({queryKey:[wl,e,t],queryFn:async({signal:p})=>{let d=await fetch(`${r}/v1/public/chain/info/${t}`,{cache:"no-store",signal:p});if(!d.ok)throw new Error(`Failed to fetch chain info: ${d.status}`);let f=await d.json();if("code"in f&&f.code!==void 0&&f.code!==200)throw new Error(`Chain info API error: ${f.code}`);return xl(f)},enabled:o,staleTime:300*1e3}),a=s.data;return{transactionUrl:(0,li.useMemo)(()=>vl(e,t,a,n),[t,a,e,n]),chainInfo:a,...s}}var pi="0x0000000000000000000000000000000000000001";var kl="0xa9059cbb",Sl=/^0x[a-fA-F0-9]{40}$/,Cl="nexus-cross:dapp-ui:send:recent:",fi=10;function Nl(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===48;)t--;return e.slice(0,t)}function Sn(e){return e.toLowerCase()}function yt(e){return Sl.test(e)}function dn(e){return Sn(e.address)===pi}function Zo(e){return`${Cl}${e.toLowerCase()}`}function cn(e){if(typeof window>"u")return[];try{let t=window.localStorage.getItem(Zo(e));if(!t)return[];let n=JSON.parse(t);return Array.isArray(n)?n.filter(o=>o!==null&&typeof o=="object"&&yt(o.address)&&typeof o.updatedAt=="number").slice(0,fi):[]}catch{return[]}}function Yo(e,t){if(typeof window>"u")return[];let n=Sn(t),o=[{address:n,updatedAt:Date.now()},...cn(e).filter(r=>r.address!==n)].slice(0,fi);try{window.localStorage.setItem(Zo(e),JSON.stringify(o))}catch{return cn(e)}return o}function Xo(e){if(!(typeof window>"u"))try{window.localStorage.removeItem(Zo(e))}catch{}}function qt(e,t){let n=e.trim();if(!n)return{error:"Enter an amount."};if(!/^\d+(\.\d*)?$/.test(n))return{error:"Enter a valid amount."};let[o="0",r=""]=n.split(".");if(r.length>t)return{error:`Max ${t} decimal places.`};let s=BigInt(o||"0"),a=r.padEnd(t,"0"),l=a?BigInt(a):0n,p=10n**BigInt(t),d=s*p+l;return d<=0n?{error:"Amount must be greater than 0."}:{value:d}}function Cn(e,t){let n=BigInt(e||"0"),o=10n**BigInt(t),r=n/o,s=n%o;if(s===0n)return r.toString();let a=Nl(s.toString().padStart(t,"0"));return`${r.toString()}.${a}`}function Jo(e,t){let n=e.replace(/^0x/,"").toLowerCase().padStart(64,"0"),o=t.toString(16).padStart(64,"0");return`${kl}${n}${o}`}function ui(e,t=0){if(t>4||e===null||e===void 0)return"";if(typeof e=="string")return e.toLowerCase();if(typeof e!="object")return"";let n=e,o=[];return typeof n.name=="string"&&o.push(n.name),typeof n.shortMessage=="string"&&o.push(n.shortMessage),typeof n.message=="string"&&o.push(n.message),typeof n.details=="string"&&o.push(n.details),n.cause!==void 0&&o.push(ui(n.cause,t+1)),o.join(`
6
+ `).toLowerCase()}function Tl(e){if(e instanceof Error)return e.message;if(typeof e=="string")return e;if(e&&typeof e=="object"){let t=e;if(typeof t.shortMessage=="string")return t.shortMessage;if(typeof t.message=="string")return t.message}return""}function er(e,t={},n="Failed to send transaction."){let o=ui(e);if(!o)return n;let r=t.nativeSymbol?.trim()||"gas token",s=t.networkName?.trim();if(o.includes("user rejected")||o.includes("userrejected")||o.includes("user denied")||o.includes("user cancelled")||o.includes("user canceled")||o.includes("action_rejected")||o.includes("rejected by user"))return"Transaction was cancelled.";if(o.includes("insufficientfunds")||o.includes("insufficient funds")||o.includes("exceeds the balance of the account")||o.includes("insufficient balance for transfer")){let a=s?` on ${s}`:"";return`Not enough ${r} to cover the gas fee.Please top up your ${r} balance and try again.`}return o.includes("transaction underpriced")||o.includes("replacement transaction underpriced")||o.includes("fee too low")?"Gas fee was too low for the network. Please try again.":o.includes("nonce too low")||o.includes("nonce has already been used")||o.includes("nonce too high")?"Pending transactions are out of order. Refresh the page and try again.":o.includes("execution reverted")||o.includes("contractfunctionrevertederror")||o.includes("contractfunctionexecutionerror")?"The transaction was rejected by the contract. The recipient or token may be invalid.":o.match(/chain \d+ is not configured/)?"This network is not registered in the app. Contact support.":o.includes("http request failed")||o.includes("failed to fetch")||o.includes("network request failed")||o.includes("timeout")||o.includes("econnreset")||o.includes("rpc error")||o.includes("429")?"Network connection failed. Check your internet and try again.":o.includes("estimategas")||o.includes("gas estimation failed")?"Could not estimate the gas fee. The recipient address or amount may be invalid.":Tl(e)||n}var Rl=2000000000n,Il=1000000000n;async function oo(e,t,n){let o=new AbortController,r=setTimeout(()=>o.abort(),8e3),s=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:t,params:n}),signal:o.signal}).finally(()=>clearTimeout(r));if(!s.ok)throw new Error(`RPC ${t} HTTP ${s.status}`);let a=await s.json();if(a.error)throw new Error(`RPC ${t}: ${a.error.message}`);if(a.result===void 0)throw new Error(`RPC ${t}: empty result`);return a.result}function ro(e){return BigInt(e)}function Ll(e){return`0x${e.toString(16)}`}function El(e){let t={to:e.to};return e.from&&(t.from=e.from),e.value!==void 0&&e.value>0n&&(t.value=Ll(e.value)),e.data&&(t.data=e.data),t}function Al(e){return e===56||e===97}async function mi(e){try{let t=await oo(e,"eth_gasPrice",[]);return{gasPrice:ro(t)}}catch{return{gasPrice:Rl}}}async function Pl(e,t){let n=Il;try{let o=await oo(e,"eth_maxPriorityFeePerGas",[]);n=ro(o)}catch{}return{maxFeePerGas:t+n,maxPriorityFeePerGas:n}}async function Bl(e,t){if(t)return mi(e);let n;try{n=(await oo(e,"eth_getBlockByNumber",["latest",!1]))?.baseFeePerGas}catch{}return n?Pl(e,ro(n)):mi(e)}async function gi(e,t){let n=Al(t.chainId),o=El(t),[r,s]=await Promise.all([oo(e,"eth_estimateGas",[o]),Bl(e,n)]);return{gasLimit:ro(r),gasPrice:s.gasPrice,maxFeePerGas:s.maxFeePerGas,maxPriorityFeePerGas:s.maxPriorityFeePerGas}}function hi(e){let{estimateGas:t,sendTransaction:n,getTransactionReceipt:o}=e;return{canSend:!!n,canEstimateGas(r){return!!t||!!r},async estimateGas(r,s){if(t)return t(r);if(s)return gi(s,r);throw new Error("Gas estimation is not available.")},async sendTransaction(r){if(!n)throw new Error("Sending is not available for this wallet.");return n(r)},getTransactionReceipt:o}}var Fl=1500,Ml=120;function bi(e){return!!(e.token||e.recipient||e.amount)}function tr({recipient:e,amount:t,token:n,balanceRaw:o}){let r={},s=e.trim(),a=qt(t,n.quantity.decimals),l;return s?yt(s)||(r.recipient="Enter a valid EVM recipient address."):r.recipient="Enter a recipient address.","error"in a?r.amount=a.error:(l=a.value,l>o&&(r.amount="Amount exceeds available balance.")),!dn(n)&&!yt(n.address)&&(r.token="Token contract address is invalid."),{errors:r,rawAmount:r.amount?void 0:l,recipient:s&&yt(s)?s:void 0}}function nr({token:e,walletAddress:t,recipient:n,rawAmount:o}){let r=t;return dn(e)?{to:n,value:o,chainId:e.chainId,from:r}:{to:Sn(e.address),data:Jo(n,o),value:0n,chainId:e.chainId,from:r}}function _l(e){let{status:t}=e;return t==="reverted"||t==="0x0"||t===0||t===0n||t===!1}var Ol=e=>new Promise(t=>setTimeout(t,e));async function wi({repository:e,args:t,chainId:n,onSubmitted:o,pollIntervalMs:r=Fl,pollMaxAttempts:s=Ml}){let a=await e.sendTransaction(t);o(a);let{getTransactionReceipt:l}=e;if(!l)return"success";for(let p=0;p<s;p+=1){let d=await l({hash:a,chainId:n}).catch(()=>null);if(d)return _l(d)?"reverted":"success";await Ol(r)}return"timeout"}var xi=["token","recipient","amount","review"];function vi(e){let{env:t,walletAddress:n,accountName:o,accounts:r=[],initialStep:s="recipient",token:a,tokens:l=[],onTokenChange:p,sendTransaction:d,getTransactionReceipt:f,estimateGas:m,getTokenPriceUsd:g,onSubmitted:h,onSuccess:x,onFailed:y,onExit:w,onOutlink:v}=e,I=L.useMemo(()=>hi({sendTransaction:d,getTransactionReceipt:f,estimateGas:m}),[d,f,m]),[u,E]=L.useState(a);L.useEffect(()=>{E(a)},[a.address,a.chainId]);let[T,M]=L.useState(s),[_,j]=L.useState(""),[H,J]=L.useState(""),[$,W]=L.useState({}),[he,ye]=L.useState("idle"),[fe,ue]=L.useState(""),[We,re]=L.useState(""),[U,te]=L.useState(null),[Te,ee]=L.useState(!1),[De,He]=L.useState(""),Re=L.useRef(0),[Ee,gt]=L.useState(null),[be,Nt]=L.useState(""),[Ye,Xe]=L.useState(()=>cn(n)),Ae=L.useMemo(()=>Ie(t),[t]),{transactionUrl:Me,chainInfo:ke}=no(Ae,u.chainId,fe||void 0,!0),pe=ke?.currency_symbol??"",Se=ke?.name??`Chain ID ${u.chainId}`,Tt=L.useRef({nativeSymbol:pe||void 0,networkName:Se,tokenSymbol:u.symbol});Tt.current={nativeSymbol:pe||void 0,networkName:Se,tokenSymbol:u.symbol};let Je=L.useMemo(()=>BigInt(u.quantity.numeric||"0"),[u.quantity.numeric]),ht=L.useMemo(()=>Ot(u.quantity.numeric,u.quantity.decimals),[u.quantity.numeric,u.quantity.decimals]),Ce=g?.(u),Ge=L.useMemo(()=>{if(Ce===void 0)return;let C=parseFloat(H.replace(/,/g,""));return Number.isFinite(C)?C*Ce:0},[H,Ce]);L.useEffect(()=>{J(""),W({})},[u.address,u.chainId]),L.useEffect(()=>{Re.current+=1,te(null),He(""),ee(!1)},[u.address,u.chainId,_,H]),L.useEffect(()=>{Xe(cn(n))},[n]);let bt=L.useCallback(C=>{j(C),W(V=>({...V,recipient:void 0}))},[]),_e=L.useCallback(C=>{J(C),W(V=>({...V,amount:void 0}))},[]),et=L.useCallback(()=>{J(Cn(u.quantity.numeric,u.quantity.decimals)),W(C=>({...C,amount:void 0}))},[u.quantity.numeric,u.quantity.decimals]),tt=L.useCallback(C=>{E(C),p?.(C),M("recipient")},[p]),Ue=L.useCallback(()=>M("token"),[]),we=L.useCallback(()=>{M(C=>{if(C==="result")return"review";if(C===s)return w?.(),C;let V=xi.indexOf(C);return V<=0?(w?.(),C):xi[V-1]})},[s,w]),$e=L.useCallback(()=>{let{errors:C}=tr({recipient:_,amount:"1",token:u,balanceRaw:Je});if(C.recipient){W(V=>({...V,recipient:C.recipient}));return}W(V=>({...V,recipient:void 0})),M("amount")},[_,u,Je]),at=L.useCallback(C=>{j(C),W(V=>({...V,recipient:void 0})),M("amount")},[]),wt=L.useCallback(()=>{let C=tr({recipient:_,amount:H,token:u,balanceRaw:Je});W(C.errors),!(bi(C.errors)||C.rawAmount===void 0||!C.recipient)&&(gt(C.rawAmount),Nt(C.recipient),te(null),He(""),ye("idle"),M("review"))},[_,H,u,Je]);L.useEffect(()=>{if(T!=="review"||!be||Ee===null||U!==null||Te||De||!I.canEstimateGas(ke?.rpc))return;let C=++Re.current;ee(!0),He(""),(async()=>{try{let V=nr({token:u,walletAddress:n,recipient:be,rawAmount:Ee}),oe=await I.estimateGas(V,ke?.rpc);if(Re.current!==C)return;te(oe)}catch(V){if(Re.current!==C)return;He(er(V,Tt.current,"Failed to estimate gas."))}finally{Re.current===C&&ee(!1)}})()},[T,be,Ee,U,Te,De,I,ke?.rpc,u,n]);let je=L.useCallback(async()=>{if(!(!be||Ee===null)){re(""),ue(""),ye("submitting");try{let C="",V=await wi({repository:I,args:nr({token:u,walletAddress:n,recipient:be,rawAmount:Ee}),chainId:u.chainId,onSubmitted:oe=>{C=oe,ue(oe),ye("confirming"),Xe(Yo(n,be)),h?.({txHash:oe,chainId:u.chainId,amount:H,tokenSymbol:u.symbol,recipient:be})}});if(V==="success")ye("success"),C&&x?x?.(C):M("result");else if(V==="reverted"){let oe="Transaction reverted on-chain.";ye("error"),re(oe),C&&y?y({txHash:C,chainId:u.chainId,message:oe}):M("result")}else{let oe="Transaction receipt was not found. Please check again later.";ye("error"),re(oe),C&&y?y({txHash:C,chainId:u.chainId,message:oe}):M("result")}}catch(C){ye("error"),re(er(C,{nativeSymbol:pe||void 0,networkName:Se,tokenSymbol:u.symbol})),M("result")}}},[I,be,Ee,u,H,n,h,x,y,pe,Se]),[Rt,It]=L.useState(!1),nt=L.useRef(void 0);L.useEffect(()=>()=>clearTimeout(nt.current),[]);let xt=L.useCallback(async()=>{if(fe)try{await navigator.clipboard.writeText(fe),It(!0),clearTimeout(nt.current),nt.current=setTimeout(()=>It(!1),2e3)}catch{}},[fe]),Oe=L.useCallback(()=>{if(!Me||!fe)return;let C=Ve=>{typeof window<"u"&&window.open(Ve,"_blank","noopener,noreferrer")};if(!v){C(Me);return}let V=v(Me,{category:"send",origin:"send-transaction",payload:{chainId:u.chainId,txHash:fe}});if(V&&typeof V.then=="function"){let Ve=typeof window<"u"?window.open("","_blank","noopener,noreferrer"):null;V.then(qe=>{if(qe===null){Ve?.close();return}let Bt=qe??Me;if(Ve)try{Ve.location.href=Bt}catch{Ve.close(),C(Bt)}else C(Bt)});return}let oe=V;oe!==null&&C(oe??Me)},[v,u.chainId,Me,fe]),st=L.useCallback(()=>{re(""),ue(""),ye("idle"),te(null),He(""),M("review")},[]);return{step:T,status:he,token:u,tokens:l.length>0?l:[u],recipient:_,amount:H,amountUsd:Ge,fieldErrors:$,error:We,txHash:fe,gasEstimate:U,gasLoading:Te,gasError:De,reviewRawAmount:Ee,reviewRecipient:be,recentAddresses:Ye,accounts:r,accountName:o,walletAddress:n,resolvedEnv:Ae,transactionUrl:Me,networkName:Se,nativeSymbol:pe,nativeDecimals:ke?.currency_decimals??u.quantity.decimals,balanceRaw:Je,balanceText:ht,priceUsd:Ce,canSelectToken:(l.length>0?l:[u]).length>1,canSend:I.canSend,getTokenPriceUsd:g,setRecipient:bt,setAmount:_e,setMax:et,selectToken:tt,goToTokenSelect:Ue,selectRecipient:at,submitRecipient:$e,submitAmount:wt,confirmSend:je,retry:st,back:we,hashCopied:Rt,copyHash:xt,openTransaction:Oe}}var ct=D(require("react"),1);function io(e,t,n=10){if(t<=0)return e.toString();let o=10n**BigInt(t),r=e/o,s=e%o;if(s===0n)return r.toString();let l=s.toString().padStart(t,"0").slice(0,Math.max(0,Math.min(n,t)));return l=l.replace(/0+$/,""),l?`${r.toString()}.${l}`:r.toString()}function or(e,t){return io(e,t,6)}function yi(e){return io(e,9,2)}function ki(e){return e.toLocaleString("en-US")}function Si(e){return e===56||e===97}function ao(e){return e.gasPrice??e.maxFeePerGas}function Ci(e,t=!1){return t?ao(e)!==void 0?"legacy":null:e.maxFeePerGas!==void 0?"dynamic":e.gasPrice!==void 0?"legacy":null}function Ni(e,t=!1){if(t){let n=ao(e);return n!==void 0?e.gasLimit*n:null}return e.maxFeePerGas!==void 0?e.gasLimit*e.maxFeePerGas:e.gasPrice!==void 0?e.gasLimit*e.gasPrice:null}function so(e){return!Number.isFinite(e)||e<=0?"$0.00":`$${e.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}var kt=require("react/jsx-runtime");function Ti({flow:e}){let{amount:t,setAmount:n,amountUsd:o,balanceText:r,balanceRaw:s,token:a,setMax:l}=e,p=ct.useRef(null),d=ct.useCallback(()=>{requestAnimationFrame(()=>{let y=p.current;if(!y)return;let w=y.value.length;y.setSelectionRange(w,w)})},[]);ct.useEffect(()=>{p.current?.focus(),d()},[d]),ct.useEffect(()=>{t===""&&(g(!1),d())},[t,d]);let f=ct.useMemo(()=>{let y=qt(t,a.quantity.decimals);return"value"in y&&y.value>s},[t,a.quantity.decimals,s]),[m,g]=ct.useState(!1),h=!m&&t===""?"0.00":t,x=t.trim()===""||t.trim()==="0";return(0,kt.jsx)("div",{className:"sf-body sf-amount",children:(0,kt.jsxs)("div",{className:"sf-amount-center",children:[(0,kt.jsx)("span",{className:"sf-amount-usd",children:o!==void 0?so(o):"\xA0"}),(0,kt.jsx)("div",{className:"sf-amount-input-wrap","data-over":f||void 0,"data-empty":x||void 0,onClick:()=>p.current?.focus(),children:(0,kt.jsx)("input",{ref:p,className:"sf-amount-input",value:h,onChange:y=>{let w=y.target.value;if(m)n(w);else if(t===""){if(w.length<4)return;g(!0);let v=w.startsWith("0.00")?w.slice(4):w;n(v)}else g(!0),n(w)},placeholder:"0.00",inputMode:"decimal",autoComplete:"off","aria-label":`Amount in ${a.symbol}`,size:1})}),(0,kt.jsxs)("div",{className:"sf-amount-balance",children:[(0,kt.jsx)("span",{children:"Balance:"}),(0,kt.jsxs)("button",{type:"button",className:"sf-amount-max",onClick:l,children:[r," ",a.symbol]})]})]})})}var dt=D(require("react"),1);var rr={dev:"https://stg-bonding-curve-api.crosstoken.io/api",stage:"https://stg-bonding-curve-api.crosstoken.io/api",production:"https://bonding-curve-api.crosstoken.io/api"},Ri={cross:"https://contents.crosstoken.io/wallet/token/images/CROSS.svg",bsc:"https://contents.crosstoken.io/wallet/token/images/BSC.svg"};function Nn(e,t){let n=ze[e];if(t===n.cross)return Ri.cross;if(t===n.bsc)return Ri.bsc}var zl={dev:"https://dev-portrait.crosstoken.io",stage:"https://dev-portrait.crosstoken.io",production:"https://portrait.crosstoken.io"};function Kt(e,t,n={}){if(!t||!t.startsWith("0x"))return;let{size:o=120,bg:r,format:s="png"}=n,a=zl[e],l=r?`&bg=${r}`:"";return`${a}/portrait/evm/${t}.${s}?size=${o}${l}`}var ve=require("react/jsx-runtime");function Ii({size:e=20,className:t}){return(0,ve.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,"aria-hidden":"true",children:[(0,ve.jsx)("circle",{cx:"9",cy:"9",r:"6",stroke:"currentColor",strokeWidth:"1.7"}),(0,ve.jsx)("path",{d:"m17 17-3.2-3.2",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function Li({size:e=20,className:t}){return(0,ve.jsx)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",className:t,"aria-hidden":"true",children:(0,ve.jsx)("path",{d:"M9 2h6a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1zM8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2h-2M12 11v6M9 14h6",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ei({size:e=20,className:t}){return(0,ve.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,"aria-hidden":"true",children:[(0,ve.jsx)("circle",{cx:"10",cy:"10",r:"10",fill:"currentColor",opacity:"0.12"}),(0,ve.jsx)("path",{d:"M7 7l6 6M13 7l-6 6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})]})}function Ai({size:e=16,className:t}){return(0,ve.jsx)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",className:t,"aria-hidden":"true",children:(0,ve.jsx)("path",{d:"M8 3v10m0 0 4-4m-4 4-4-4",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function Pi({size:e=56,className:t}){return(0,ve.jsxs)("svg",{width:e,height:e,viewBox:"0 0 56 56",fill:"none",className:t,"aria-hidden":"true",children:[(0,ve.jsx)("circle",{cx:"28",cy:"28",r:"28",fill:"var(--ds-accent-primary-default, #00b4b7)"}),(0,ve.jsx)("path",{d:"M17 28.5 24.2 35.5 39 20.5",stroke:"var(--ds-accent-primary-on, #ffffff)",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})]})}function Bi({size:e=56,className:t}){return(0,ve.jsxs)("svg",{width:e,height:e,viewBox:"0 0 56 56",fill:"none",className:t,"aria-hidden":"true",children:[(0,ve.jsx)("circle",{cx:"28",cy:"28",r:"28",fill:"var(--ds-system-red-default, #da0b2e)"}),(0,ve.jsx)("path",{d:"M20 20 36 36m0-16L20 36",stroke:"#ffffff",strokeWidth:"4",strokeLinecap:"round"})]})}var K=require("react/jsx-runtime");function Fi(e,t){return e.name||`Account ${(e.index??t)+1}`}function Mi(e){return e.trim().slice(0,1).toUpperCase()||"A"}function _i(e){return e.toLowerCase()}function Oi({flow:e}){let{recipient:t,setRecipient:n,fieldErrors:o,recentAddresses:r,accounts:s,walletAddress:a,resolvedEnv:l,selectRecipient:p}=e,d=dt.useMemo(()=>s.filter(u=>u.address.toLowerCase()!==a.toLowerCase()),[s,a]),f=d.length>0,m=dt.useMemo(()=>new Map(d.map((u,E)=>[_i(u.address),{account:u,index:E}])),[d]),[g,h]=dt.useState("recent"),x=dt.useRef(null);dt.useEffect(()=>{x.current?.focus()},[]);let y="1A1A2E",w=dt.useCallback(async()=>{try{let u=await navigator.clipboard.readText();u&&n(u.trim())}catch{}},[n]),v=t.trim().length>0,I=yt(t.trim());return(0,K.jsxs)("div",{className:"sf-recipient",children:[(0,K.jsxs)("div",{className:"sf-recipient-top",children:[(0,K.jsxs)("div",{className:"sf-address-field","data-filled":v||void 0,"data-invalid":o.recipient||void 0,children:[(0,K.jsx)("textarea",{ref:x,className:"sf-address-input",value:t,onChange:u=>n(u.target.value),placeholder:"Enter the recipient's address",autoComplete:"off",spellCheck:!1,"aria-label":"Recipient address",rows:v?2:1}),v?(0,K.jsx)("button",{type:"button",className:"sf-address-action",onClick:()=>n(""),"aria-label":"Clear",children:(0,K.jsx)(Ei,{size:20})}):(0,K.jsx)("button",{type:"button",className:"sf-address-action",onClick:w,"aria-label":"Paste from clipboard",children:(0,K.jsx)(Li,{size:20})})]}),o.recipient&&(0,K.jsx)("p",{className:"sf-field-error",role:"alert",children:o.recipient}),(0,K.jsxs)("div",{className:"sf-tabs",role:"tablist",children:[(0,K.jsx)("button",{type:"button",role:"tab",className:"sf-tab","data-active":g==="recent"||void 0,"aria-selected":g==="recent",onClick:()=>h("recent"),children:"Recent"}),f&&(0,K.jsx)("button",{type:"button",role:"tab",className:"sf-tab","data-active":g==="account"||void 0,"aria-selected":g==="account",onClick:()=>h("account"),children:"My Account"})]})]}),(0,K.jsx)("div",{className:"sf-address-list",children:g==="account"&&f?d.map((u,E)=>{let T=Fi(u,E),M=Kt(l,u.address,{size:56,bg:y});return(0,K.jsxs)("button",{type:"button",className:"sf-address-row",onClick:()=>p(u.address),children:[(0,K.jsxs)("span",{className:"sf-address-avatar",children:[M&&(0,K.jsx)("img",{src:M,alt:"",width:40,height:40,draggable:!1,onError:_=>{_.currentTarget.style.display="none"}}),(0,K.jsx)("span",{className:"sf-address-avatar-fallback",children:Mi(T)})]}),(0,K.jsxs)("span",{className:"sf-address-meta",children:[(0,K.jsx)("span",{className:"sf-address-name",children:T}),(0,K.jsx)("span",{className:"sf-address-value",children:Qe(u.address)})]})]},u.address)}):r.length>0?r.map(u=>{let E=m.get(_i(u.address)),T=E?Fi(E.account,E.index):Qe(u.address),M=Kt(l,u.address,{size:56,bg:y});return(0,K.jsxs)("button",{type:"button",className:"sf-address-row",onClick:()=>p(u.address),children:[(0,K.jsxs)("span",{className:"sf-address-avatar",children:[M&&(0,K.jsx)("img",{src:M,alt:"",width:40,height:40,draggable:!1,onError:_=>{_.currentTarget.style.display="none"}}),(0,K.jsx)("span",{className:"sf-address-avatar-fallback",children:Mi(T)})]}),(0,K.jsxs)("span",{className:"sf-address-meta",children:[(0,K.jsx)("span",{className:"sf-address-name",children:T}),(0,K.jsx)("span",{className:"sf-address-value",children:Qe(u.address)})]})]},u.address)}):(0,K.jsx)("div",{className:"sf-empty",children:"No send history"})}),v&&!I&&!o.recipient&&(0,K.jsx)("p",{className:"sf-field-error",role:"alert",children:"Enter a valid EVM recipient address."})]})}var ae=require("react/jsx-runtime");function Wi({flow:e}){let{status:t,txHash:n,error:o,copyHash:r,hashCopied:s,openTransaction:a}=e,l=t==="error",p=t==="success";return l?(0,ae.jsxs)("div",{className:"sf-body sf-result sf-result--error",children:[(0,ae.jsx)("span",{className:"sf-result-icon",children:(0,ae.jsx)(Bi,{size:56})}),(0,ae.jsxs)("div",{className:"sf-result-copy",children:[(0,ae.jsx)("h3",{className:"sf-result-title",children:"Transaction Failed"}),(0,ae.jsx)("p",{className:"sf-result-desc",children:o||"Something went wrong. Please try again."})]}),n&&(0,ae.jsx)(zi,{txHash:n,hashCopied:s,onCopy:r,onOpen:a})]}):(0,ae.jsxs)("div",{className:"sf-body sf-result",children:[(0,ae.jsx)("span",{className:"sf-result-icon","data-pending":!p||void 0,children:p?(0,ae.jsx)(Pi,{size:56}):(0,ae.jsx)("span",{className:"sf-result-spinner"})}),(0,ae.jsxs)("div",{className:"sf-result-copy",children:[(0,ae.jsx)("h3",{className:"sf-result-title",children:p?"Transaction Complete":"Transaction in Progress"}),(0,ae.jsx)("p",{className:"sf-result-desc",children:p?"Your transfer was sent successfully.":"Transfer in progress. Waiting for confirmation."})]}),n&&(0,ae.jsx)(zi,{txHash:n,hashCopied:s,onCopy:r,onOpen:a})]})}function zi({txHash:e,hashCopied:t,onCopy:n,onOpen:o}){return(0,ae.jsxs)("div",{className:"sf-result-hash-card",children:[(0,ae.jsx)("span",{className:"sf-result-hash-label",children:"Transaction Hash"}),(0,ae.jsxs)("div",{className:"sf-result-hash-row",children:[(0,ae.jsx)("button",{type:"button",className:"sf-result-hash-link",onClick:o,"aria-label":"Open transaction in explorer",children:Qe(e)}),(0,ae.jsx)("button",{type:"button",className:"sf-result-copy-btn",onClick:n,"aria-label":"Copy transaction hash",children:t?(0,ae.jsx)(kn,{size:16}):"Copy"})]})]})}var G=require("react/jsx-runtime"),lo="\u2014";function Di({flow:e}){let{token:t,reviewRawAmount:n,reviewRecipient:o,accountName:r,accounts:s,walletAddress:a,networkName:l,nativeSymbol:p,nativeDecimals:d,gasEstimate:f,gasLoading:m,gasError:g,error:h,resolvedEnv:x}=e,y=dn(t),w=n!==null?io(n,t.quantity.decimals):"",v=r?.trim()||`Account ${(s[0]?.index??0)+1}`,I=Kt(x,a,{size:56,bg:"1A1A2E"}),u=p||(y?t.symbol:""),E=Si(t.chainId),T=f?Ci(f,E):null,M=f?Ni(f,E):null,_=W=>W!==null&&u?`${or(W,d)} ${u}`:lo,j=W=>W!==void 0?`${yi(W)} Gwei`:lo,H=(()=>{if(!y||!f||M===null||n===null)return lo;let W=n+M;return`${or(W,d)} ${u||t.symbol}`})(),J=W=>m?"\u2026":W,$=[{label:"Est. Tx Fee",value:J(_(M))},...T==="dynamic"?[{label:"Max Priority Fee",value:J(j(f?.maxPriorityFeePerGas))},{label:"Max Gas Fee",value:J(j(f?.maxFeePerGas))}]:T==="legacy"?[{label:"Gas Price",value:J(j(f?ao(f):void 0))}]:[],{label:"Gas Limit",value:J(f?ki(f.gasLimit):lo)}];return(0,G.jsxs)("div",{className:"sf-body sf-review",children:[(0,G.jsxs)("div",{className:"sf-review-amount",children:[(0,G.jsx)("img",{className:"sf-review-amount-icon",src:t.icon_url,alt:"",width:40,height:40,draggable:!1,onError:W=>{W.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),(0,G.jsxs)("span",{className:"sf-review-amount-value",children:[w,(0,G.jsx)("span",{className:"sf-review-amount-symbol",children:t.symbol})]})]}),(0,G.jsxs)("div",{className:"sf-review-parties",children:[(0,G.jsxs)("div",{className:"sf-review-card sf-review-party",children:[(0,G.jsx)("span",{className:"sf-review-party-label",children:"From"}),(0,G.jsxs)("div",{className:"sf-review-party-head",children:[(0,G.jsx)("span",{className:"sf-review-party-avatar",children:I&&(0,G.jsx)("img",{src:I,alt:"",width:28,height:28,draggable:!1,onError:W=>{W.currentTarget.style.display="none"}})}),(0,G.jsx)("span",{className:"sf-review-party-name",children:v})]}),(0,G.jsx)("span",{className:"sf-review-party-addr",children:a})]}),(0,G.jsx)("span",{className:"sf-review-arrow","aria-hidden":!0,children:(0,G.jsx)(Ai,{size:16})}),(0,G.jsxs)("div",{className:"sf-review-card sf-review-party",children:[(0,G.jsx)("span",{className:"sf-review-party-label",children:"To"}),(0,G.jsx)("span",{className:"sf-review-party-addr",children:o})]})]}),(0,G.jsxs)("section",{className:"sf-review-card",children:[(0,G.jsx)("h3",{className:"sf-review-section-title",children:"Summary"}),(0,G.jsxs)("div",{className:"sf-review-row",children:[(0,G.jsx)("span",{className:"sf-review-row-label",children:"Network"}),(0,G.jsx)("span",{className:"sf-review-row-value",children:l})]}),$.map(W=>(0,G.jsxs)("div",{className:"sf-review-row",children:[(0,G.jsx)("span",{className:"sf-review-row-label",children:W.label}),(0,G.jsx)("span",{className:"sf-review-row-value",children:W.value})]},W.label))]}),(0,G.jsxs)("section",{className:"sf-review-card",children:[(0,G.jsx)("h3",{className:"sf-review-section-title",children:"Total"}),(0,G.jsxs)("div",{className:"sf-review-row",children:[(0,G.jsx)("span",{className:"sf-review-row-label",children:"Total Amount"}),(0,G.jsxs)("span",{className:"sf-review-row-value",children:[w," ",t.symbol]})]}),y&&(0,G.jsxs)("div",{className:"sf-review-row",children:[(0,G.jsx)("span",{className:"sf-review-row-label",children:"Max. Total Amount"}),(0,G.jsx)("span",{className:"sf-review-row-value",children:J(H)})]})]}),(g||h)&&(0,G.jsx)("div",{className:"sf-message sf-message--error",role:"alert",children:g||h})]})}var co=D(require("react"),1);var Ne=require("react/jsx-runtime");function Hi({flow:e}){let[t,n]=co.useState(""),o=t.trim().toLowerCase(),r=co.useMemo(()=>o?e.tokens.filter(s=>s.symbol.toLowerCase().includes(o)||s.name.toLowerCase().includes(o)):e.tokens,[e.tokens,o]);return(0,Ne.jsxs)("div",{className:"sf-body sf-token-select",children:[(0,Ne.jsxs)("div",{className:"sf-search",children:[(0,Ne.jsx)(Ii,{size:20}),(0,Ne.jsx)("input",{className:"sf-search-input",value:t,onChange:s=>n(s.target.value),placeholder:"Search Tokens",autoComplete:"off",spellCheck:!1,"aria-label":"Search tokens"})]}),(0,Ne.jsxs)("div",{className:"sf-token-list",children:[r.map(s=>{let a=`${s.chainId}:${s.address.toLowerCase()}`,l=Nn(e.resolvedEnv,s.chainId),p=e.getTokenPriceUsd?.(s);return(0,Ne.jsxs)("button",{type:"button",className:"sf-token-row",onClick:()=>e.selectToken(s),children:[(0,Ne.jsxs)("span",{className:"sf-token-left",children:[(0,Ne.jsxs)("span",{className:"sf-token-icon-wrap",children:[(0,Ne.jsx)("img",{className:"sf-token-icon",src:s.icon_url,alt:"",width:40,height:40,loading:"lazy",draggable:!1,onError:d=>{d.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),l&&(0,Ne.jsx)("img",{className:"sf-token-chain-badge",src:l,alt:"","aria-hidden":!0,width:16,height:16,loading:"lazy",draggable:!1,onError:d=>{d.currentTarget.style.display="none"}})]}),(0,Ne.jsx)("span",{className:"sf-token-name",children:s.symbol})]}),(0,Ne.jsxs)("span",{className:"sf-token-right",children:[(0,Ne.jsx)("span",{className:"sf-token-balance",children:Ot(s.quantity.numeric,s.quantity.decimals)}),p!==void 0&&(0,Ne.jsx)("span",{className:"sf-token-price",children:so(p)})]})]},a)}),r.length===0&&(0,Ne.jsx)("div",{className:"sf-empty",children:"No tokens found"})]})]})}O(`.sf-root{display:flex;flex-direction:column;flex:1;min-height:0;font-family:inherit}.sf-header{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:24px;flex-shrink:0;position:relative;border-bottom:1px solid var(--ds-border-default, rgba(0, 0, 0, .07))}.sf-header .sf-header-btn:last-child{position:absolute;top:24px;right:24px}.sf-header-btn{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;flex-shrink:0;padding:0;border:none;background:transparent;color:var(--ds-content-low, rgba(0, 0, 0, .4));cursor:pointer;filter:none;transition:color .15s ease}.sf-header-btn:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85));filter:none}.sf-header-title{position:absolute;left:50%;transform:translate(-50%);text-align:center;font-family:inherit;font-size:18px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-highest, #000000);pointer-events:none}.sf-body{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.15) transparent;overscroll-behavior:contain}[data-theme=light] .sf-body{scrollbar-color:rgba(0,0,0,.12) transparent}.sf-body::-webkit-scrollbar{width:4px;height:4px}.sf-body::-webkit-scrollbar-track,.sf-body::-webkit-scrollbar-corner{background:transparent}.sf-body::-webkit-scrollbar-thumb{border-radius:4px;background:#ffffff26}.sf-body::-webkit-scrollbar-thumb:hover{background:#ffffff40}[data-theme=light] .sf-body::-webkit-scrollbar-thumb{background:#0000001f}[data-theme=light] .sf-body::-webkit-scrollbar-thumb:hover{background:#0003}.sf-empty{padding:32px 0;text-align:center;font-family:inherit;font-size:14px;color:var(--ds-content-low, rgba(0, 0, 0, .4))}.sf-field-error{margin:8px 24px 0;font-family:inherit;font-size:12px;line-height:1.5;color:var(--ds-system-red-default, #da0b2e)}.sf-message--error{margin:16px 0 0;padding:12px 16px;background:var(--ds-system-red-low, #ffeeee);color:var(--ds-system-red-high, #d20609);font-family:inherit;font-size:13px;line-height:1.5;border-radius:12px;width:100%;box-sizing:border-box}.sf-footer{display:flex;flex-shrink:0;padding:16px 24px 24px}.sf-footer:empty{display:none}.sf-footer-row{display:flex;gap:8px;width:100%}.sf-footer-row .sf-btn,.sf-footer-row .sf-btn--secondary{flex:1 1 0;min-width:0}.sf-footer>.sf-btn{width:100%}.sf-btn{appearance:none;display:inline-flex;align-items:center;justify-content:center;flex:1;height:48px;padding:0 24px;border:none;border-radius:12px;font-family:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer;transition:background-color .15s ease,transform .1s ease}.sf-btn--primary{background:var(--ds-accent-primary-default, #00b4b7);color:var(--ds-accent-primary-on, #ffffff)}.sf-btn--primary:hover:not(:disabled):not([data-disabled]){background:var(--ds-accent-primary-high, #00a0a2)}.sf-btn--primary:active:not(:disabled):not([data-disabled]){transform:scale(.97)}.sf-btn--primary[data-disabled],.sf-btn--primary:disabled{background:var(--ds-accent-primary-default, #00b4b7);color:var(--ds-accent-primary-on, #ffffff);cursor:default;opacity:.5}.sf-btn--secondary{flex:0 0 120px;background:var(--ds-surface-default, #ffffff);border:1px solid var(--ds-border-default, rgba(0, 0, 0, .07));color:var(--ds-content-high, rgba(0, 0, 0, .85))}.sf-token-select{padding:0;display:flex;flex-direction:column}.sf-token-select .sf-search{margin:16px 24px}.sf-token-select .sf-token-list{width:100%;margin-top:0}.sf-search{display:flex;align-items:center;gap:8px;padding:12px 16px;border-radius:12px;border:1.5px solid transparent;background:var(--ds-surface-medium, #f5f7fa);color:var(--ds-content-low, rgba(0, 0, 0, .4));box-sizing:border-box;transition:border-color .15s ease}.sf-search:hover{border-color:var(--ds-border-medium, rgba(0, 0, 0, .18))}.sf-search:focus-within{border-color:var(--ds-accent-primary-default, #00b4b7)}.sf-search-input{flex:1;min-width:0;border:none;background:transparent;outline:none;font-family:inherit;font-size:16px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85))}.sf-search-input::placeholder{color:var(--ds-content-low, rgba(0, 0, 0, .4))}.sf-token-list{display:flex;flex-direction:column;margin-top:8px}.sf-token-row{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;padding:12px 24px;border:none;background:transparent;cursor:pointer;text-align:left;font-family:inherit;border-radius:0;box-sizing:border-box;transition:background-color .15s ease}.sf-token-row:hover{background:var(--ds-surface-medium, rgba(0, 0, 0, .04))}.sf-token-left{display:flex;align-items:center;gap:16px;min-width:0}.sf-token-icon-wrap{position:relative;width:40px;height:40px;flex-shrink:0}.sf-token-icon{width:40px;height:40px;border-radius:0;object-fit:contain}.sf-token-chain-badge{position:absolute;right:-2px;bottom:-2px;width:16px;height:16px;border-radius:50%;object-fit:cover}.sf-token-name{font-family:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));white-space:nowrap}.sf-token-right{display:flex;flex-direction:column;align-items:flex-end;flex-shrink:0}.sf-token-balance{font-family:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-highest, #000000);white-space:nowrap}.sf-token-price{font-family:inherit;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4));white-space:nowrap}.sf-recipient{display:flex;flex-direction:column;flex:1;min-height:0}.sf-recipient-top{display:flex;flex-direction:column;padding:16px 24px 0}.sf-address-field{display:flex;align-items:center;gap:8px;padding:12px;border-radius:12px;border:1.5px solid transparent;background:var(--ds-surface-medium, #f5f7fa);transition:border-color .15s ease;box-sizing:border-box}.sf-address-field:hover{border-color:var(--ds-border-medium, rgba(0, 0, 0, .18))}.sf-address-field:focus-within{border-color:var(--ds-accent-primary-default, #00b4b7)}.sf-address-field[data-filled]{border-color:var(--ds-accent-primary-default, #00b4b7)}.sf-address-field[data-invalid]{border-color:var(--ds-system-red-default, #da0b2e)}.sf-address-input{flex:1;min-width:0;border:none;background:transparent;outline:none;resize:none;overflow:hidden;font-family:inherit;font-size:16px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));word-break:break-word;overflow-wrap:anywhere}.sf-address-input::placeholder{color:var(--ds-content-low, rgba(0, 0, 0, .4))}.sf-address-action{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;flex-shrink:0;padding:0;border:none;background:transparent;border-radius:6px;color:var(--ds-content-low, rgba(0, 0, 0, .4));cursor:pointer;transition:color .15s ease}.sf-address-action:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.sf-address-field[data-filled] .sf-address-action{border-radius:9999px}.sf-tabs{display:flex;gap:0;margin:16px 0 0}.sf-tab{position:relative;padding:8px 12px;border:none;background:transparent;cursor:pointer;font-family:inherit;font-size:16px;font-weight:600;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4))}.sf-tab[data-active]{color:var(--ds-accent-primary-high, #00a0a2)}.sf-tab[data-active]:after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:3px;border-radius:9999px;background:var(--ds-accent-primary-high, #00a0a2)}.sf-address-list{display:flex;flex-direction:column;width:100%;margin-top:8px}.sf-address-row{display:flex;align-items:center;gap:16px;width:100%;padding:12px 24px;border:none;background:transparent;cursor:pointer;text-align:left;font-family:inherit;border-radius:0;box-sizing:border-box;transition:background-color .15s ease}.sf-address-row:hover{background:var(--ds-surface-medium, rgba(0, 0, 0, .04))}.sf-address-avatar{position:relative;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;flex-shrink:0;border-radius:50%;overflow:hidden;background:var(--ds-surface-high, #edf1f2);color:var(--ds-content-medium, rgba(0, 0, 0, .65));font-size:14px;font-weight:600}.sf-address-avatar img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}.sf-address-avatar-fallback{position:relative;z-index:0}.sf-address-meta{display:flex;flex-direction:column;min-width:0}.sf-address-name{font-family:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sf-address-value{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4))}.wi-drawer-content .sf-header{padding:16px}.wi-drawer-content .sf-header .sf-header-btn:last-child{top:16px;right:16px}.wi-drawer-content .sf-token-select{padding:0}.wi-drawer-content .sf-token-select .sf-search{margin:16px}.wi-drawer-content .sf-token-row{padding:12px 16px}.wi-drawer-content .sf-recipient-top{padding:16px 16px 0}.wi-drawer-content .sf-address-row{padding:12px 16px}.wi-drawer-content .sf-footer{padding:12px 16px 24px}.wi-drawer-content .sf-field-error,.wi-drawer-content .sf-message--error{margin:16px 0 0;width:auto}.sf-amount{display:flex;flex-direction:column}.sf-amount-center{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:8px;padding:64px 24px 48px;text-align:center}.sf-amount-usd{font-family:inherit;font-size:14px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4));min-height:21px}.sf-amount-input-wrap{display:flex;justify-content:center;max-width:100%}.sf-amount-input{width:auto;max-width:100%;border:none;background:transparent;outline:none;text-align:center;font-family:inherit;font-size:40px;font-weight:700;line-height:1.25;letter-spacing:-.01em;color:var(--ds-content-highest, #000000);field-sizing:content}.sf-amount-input-wrap[data-empty] .sf-amount-input,.sf-amount-input::placeholder{color:var(--ds-content-low, rgba(0, 0, 0, .4))}.sf-amount-input-wrap[data-over] .sf-amount-input{color:var(--ds-system-red-default, #da0b2e)}.sf-amount-balance{display:inline-flex;align-items:center;gap:4px;font-family:inherit;font-size:14px;font-weight:400;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4))}.sf-amount-max{border:none;background:transparent;padding:0;cursor:pointer;font:inherit;color:var(--ds-content-medium, rgba(0, 0, 0, .65));text-decoration:underline;text-underline-offset:2px;transition:color .15s ease}.sf-amount-max:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-drawer-content .sf-amount-center{padding:64px 16px 48px}.sf-review{display:flex;flex-direction:column;gap:16px;padding:24px}.sf-review-amount{display:flex;align-items:center;gap:12px;padding:0;background:transparent}.sf-review-amount-icon{width:40px;height:40px;border-radius:0;object-fit:contain;flex-shrink:0}.sf-review-amount-value{display:inline-flex;flex-direction:column;align-items:flex-start;gap:0;font-family:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-highest, #000000);word-break:break-all}.sf-review-amount-symbol{font-size:12px;font-weight:400;line-height:1.5;color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.sf-review-parties{position:relative;display:flex;flex-direction:column;gap:0}.sf-review-arrow{position:relative;z-index:1;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;margin:-4px auto;border-radius:50%;background:var(--ds-surface-default, #ffffff);border:1px solid var(--ds-border-medium, rgba(0, 0, 0, .18));color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.sf-review-card{display:flex;flex-direction:column;gap:8px;padding:16px;border-radius:12px;background:var(--ds-surface-medium, #f5f7fa)}.sf-review-party-label{font-family:inherit;font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.sf-review-party-head{display:flex;align-items:center;gap:8px}.sf-review-party-avatar{display:inline-flex;width:24px;height:24px;border-radius:50%;overflow:hidden;background:var(--ds-surface-high, #edf1f2);flex-shrink:0}.sf-review-party-avatar img{width:100%;height:100%;object-fit:cover}.sf-review-party-name{font-family:inherit;font-size:14px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85))}.sf-review-party-addr{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:12px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65));word-break:break-all}.sf-review-section-title{margin:0 0 4px;font-family:inherit;font-size:16px;font-weight:600;letter-spacing:-.01em;color:var(--ds-content-highest, #000000)}.sf-review-row{display:flex;flex-direction:column;align-items:flex-start;gap:4px}.sf-review-row-label{font-family:inherit;font-size:12px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.sf-review-row-value{font-family:inherit;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));text-align:left;word-break:break-all}.wi-drawer-content .sf-review{padding:16px}.sf-result{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:20px;padding:48px 24px;text-align:center}.sf-result-icon{display:inline-flex;align-items:center;justify-content:center;width:56px;height:56px}.sf-result-spinner{width:56px;height:56px;border-radius:50%;border:4px solid var(--ds-border-medium, rgba(0, 0, 0, .18));border-top-color:var(--ds-accent-primary-default, #00b4b7);animation:sf-spin .8s linear infinite}@keyframes sf-spin{to{transform:rotate(360deg)}}.sf-result-copy{display:flex;flex-direction:column;gap:8px}.sf-result-title{margin:0;font-family:inherit;font-size:18px;font-weight:600;letter-spacing:-.01em;color:var(--ds-content-highest, #000000)}.sf-result-desc{margin:0;font-family:inherit;font-size:14px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.sf-result-hash-card{display:flex;flex-direction:column;gap:8px;width:100%;padding:16px;border-radius:12px;background:var(--ds-surface-medium, #f5f7fa);text-align:left}.sf-result-hash-label{font-family:inherit;font-size:12px;font-weight:500;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.sf-result-hash-row{display:flex;align-items:center;justify-content:space-between;gap:8px}.sf-result-hash-link{border:none;background:transparent;padding:0;cursor:pointer;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:14px;color:var(--ds-accent-primary-high, #00a0a2)}.sf-result-copy-btn{display:inline-flex;align-items:center;justify-content:center;min-width:44px;height:28px;padding:0 10px;border:1px solid var(--ds-border-default, rgba(0, 0, 0, .07));border-radius:8px;background:var(--ds-surface-default, #ffffff);cursor:pointer;font-family:inherit;font-size:12px;font-weight:500;color:var(--ds-content-high, rgba(0, 0, 0, .85))}
7
+ `);var se=require("react/jsx-runtime"),Wl={token:"Send",recipient:"Send",amount:"Send",review:"Sign Transaction",result:""};function Tn({onClose:e,onBackToWallet:t,onConfirmSuccess:n,onSuccess:o,className:r,...s}){let a=Gi.useCallback(v=>{o?.(v),n?.(v)},[n,o]),p=vi({...s,onSuccess:o||n?a:void 0,onExit:t}),{step:d,status:f}=p,m=yt(p.recipient.trim()),g=qt(p.amount,p.token.quantity.decimals),h="value"in g&&g.value<=p.balanceRaw,x=f==="submitting"||f==="confirming",y=d!=="result",w=Wl[d]??"";return(0,se.jsxs)("div",{className:Y("sf-root",r),"data-step":d,children:[(0,se.jsxs)("header",{className:"sf-header",children:[y?(0,se.jsx)("button",{type:"button",className:"sf-header-btn",onClick:p.back,"aria-label":"Back",children:(0,se.jsx)(Lt,{size:24})}):(0,se.jsx)("span",{className:"sf-header-btn","aria-hidden":!0}),(0,se.jsx)("span",{className:"sf-header-title",children:w}),(0,se.jsx)("button",{type:"button",className:"sf-header-btn",onClick:e,"aria-label":"Close",children:(0,se.jsx)(vt,{size:24})})]}),d==="token"&&(0,se.jsx)(Hi,{flow:p}),d==="recipient"&&(0,se.jsx)(Oi,{flow:p}),d==="amount"&&(0,se.jsx)(Ti,{flow:p}),d==="review"&&(0,se.jsx)(Di,{flow:p}),d==="result"&&(0,se.jsx)(Wi,{flow:p}),(0,se.jsxs)("footer",{className:"sf-footer","data-step":d,children:[d==="recipient"&&(0,se.jsx)("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:p.submitRecipient,"data-disabled":!m||void 0,"aria-disabled":!m,children:"Next"}),d==="amount"&&(0,se.jsx)("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:p.submitAmount,"data-disabled":!h||void 0,"aria-disabled":!h,children:"Next"}),d==="review"&&(0,se.jsxs)("div",{className:"sf-footer-row",children:[(0,se.jsx)("button",{type:"button",className:"sf-btn sf-btn--secondary",onClick:p.back,disabled:x,children:"Cancel"}),(0,se.jsx)("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:p.confirmSend,disabled:x||!p.canSend,children:x?"Sending...":"Send"})]}),d==="result"&&f==="success"&&(0,se.jsx)("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:()=>n?.(p.txHash||void 0),children:"All done"}),d==="result"&&f==="error"&&(0,se.jsx)("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:p.retry,children:"Try Again"})]})]})}var Ui=D(require("@radix-ui/react-popover"),1),$i=require("vaul");var Qt=require("react/jsx-runtime");function ji({asChild:e,className:t,children:n}){let{isMobile:o,theme:r,walletAddress:s}=Mt(),a=n!=null,l=e??!0,p=a?n:(0,Qt.jsxs)("button",{type:"button",className:Y("wi-trigger-btn",t),"data-theme":r,"data-mobile":o||void 0,children:[(0,Qt.jsx)(Zr,{size:o?14:16}),(0,Qt.jsx)("span",{className:"wi-trigger-address",children:Qe(s)})]});return o?(0,Qt.jsx)($i.Drawer.Trigger,{asChild:l,children:p}):(0,Qt.jsx)(Ui.Trigger,{asChild:l,children:p})}var A=D(require("react"),1),So=D(require("@radix-ui/react-popover"),1),Pn=require("vaul");var gn=D(require("bignumber.js"),1);var Vi=require("@tanstack/react-query"),qi=require("react");var po="user-balance";async function Dl(e,t,n,o){let r=new URLSearchParams({networkId:`eip155:${t}`,account:n}),s=await fetch(`${e}/v1/public/token/balance?${r}`,{cache:"no-store",signal:o});if(!s.ok)throw new Error(`Failed to fetch token balance: ${s.status}`);let a=await s.json();if(a.code!==200)throw new Error(`Token balance API error: ${a.code}`);return a.data}function Zt(e,t,n=!0){let o=rt[e],r=ze[e],s=[r.cross,r.bsc],a=(0,Vi.useQueries)({queries:s.map(f=>({queryKey:[po,e,t,f],queryFn:({signal:m})=>Dl(o,f,t,m),enabled:!!t&&n,staleTime:0,refetchInterval:n?5e3:!1}))}),l=a.some(f=>f.isLoading),p=a.some(f=>f.isError);return{tokens:(0,qi.useMemo)(()=>{let f=[];for(let m of a)m.data&&f.push(...m.data);return f},[a]),isLoading:l,isError:p}}var fo=require("@tanstack/react-query"),Ki=require("react");var Hl="forge-holdings",Gl="forge-token-image";async function Ul(e,t,n){let o=await fetch(`${e}/v1/users/${t}/holdings`,{cache:"no-store",signal:n});if(!o.ok)throw new Error(`Failed to fetch forge holdings: ${o.status}`);let r=await o.json();if(!r.success)throw new Error("Forge holdings API error");return r.data.items}async function $l(e,t,n){let o=await fetch(`${e}/v1/tokens/${t}`,{cache:"no-store",signal:n});if(!o.ok)return{address:t,image_url:""};let r=await o.json();return r.success?{address:t,image_url:r.data.token.image_url}:{address:t,image_url:""}}function Qi(e,t,n=!0){let o=rr[e],{data:r,...s}=(0,fo.useQuery)({queryKey:[Hl,e,t],queryFn:({signal:a})=>Ul(o,t,a),enabled:!!t&&n,staleTime:0,refetchInterval:n?5e3:!1});return{holdings:r??[],...s}}function Zi(e,t,n=!0){let o=rr[e],r=(0,fo.useQueries)({queries:t.map(a=>({queryKey:[Gl,e,a],queryFn:({signal:l})=>$l(o,a,l),enabled:n,staleTime:1/0}))});return{imageMap:(0,Ki.useMemo)(()=>{let a=new Map;for(let l of r)l.data&&a.set(l.data.address,l.data.image_url);return a},[r])}}var Yi=require("@tanstack/react-query"),Xi=require("react");var uo="token-stats";function Et(e,t){return`${e}:${t.toLowerCase()}`}function Yt(e,t=!0){let n=rt[e],{data:o,...r}=(0,Yi.useQuery)({queryKey:[uo,e],queryFn:async({signal:a})=>{let l=await fetch(`${n}/v1/public/token/stats`,{cache:"no-store",signal:a});if(!l.ok)throw new Error(`Failed to fetch token stats: ${l.status}`);let p=await l.json();if(p.code!==200)throw new Error(`Token stats API error: ${p.code}`);return p},enabled:t,staleTime:3e4});return{statsMap:(0,Xi.useMemo)(()=>{let a=new Map;if(!o?.data)return a;for(let l of o.data){let p=Et(l.chain_id,l.address);a.set(p,l)}return a},[o]),...r}}var Ji=require("@tanstack/react-query"),ea=require("react");var jl="token-info";function ir(e,t){return`${t.toLowerCase()}_${e}`}function ta(e,t=!0){let n=rt[e],{data:o,...r}=(0,Ji.useQuery)({queryKey:[jl,e],queryFn:async({signal:a})=>{let l=await fetch(`${n}/v1/public/token/info`,{cache:"no-store",signal:a});if(!l.ok)throw new Error(`Failed to fetch token info: ${l.status}`);let p=await l.json();if(p.code!==200)throw new Error(`Token info API error: ${p.code}`);return p},enabled:t,staleTime:1/0});return{categoryMap:(0,ea.useMemo)(()=>{let a=new Map;if(!o?.data)return a;for(let l of o.data){let p=ir(l.chain_id,l.address);a.set(p,l.category)}return a},[o]),...r}}var na=require("react"),mo=D(require("bignumber.js"),1);function oa(e,t,n){let{tokens:o,isLoading:r}=Zt(e,t,n),{statsMap:s}=Yt(e,n);return(0,na.useMemo)(()=>{let a=new mo.default(0);for(let f of o){let m=s.get(Et(f.chainId,f.address));if(!m)continue;let h=new mo.default(f.quantity.numeric).shiftedBy(-f.quantity.decimals).multipliedBy(new mo.default(m.price));h.isNaN()||(a=a.plus(h))}let l=a.toFixed(),{displayValue:p,isLowerBound:d}=si(l);return{totalUsd:l,displayValue:p,isLowerBound:d,isLoading:r}},[o,s,r])}var ws=require("qrcode.react");function Ze(e,t,n,o){if(!o||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.defaultPrevented)return;e.preventDefault();let r;try{r=o(t,n)}catch(d){console.error("[dapp-ui] onOutlink threw:",d);return}let s=d=>{typeof window>"u"||window.open(d,"_blank","noopener,noreferrer")};if((d=>!!d&&(typeof d=="object"||typeof d=="function")&&typeof d.then=="function")(r)){let d=typeof window<"u"?window.open("","_blank","noopener,noreferrer"):null,f=m=>{if(m===null){d?.close();return}let g=m??t;if(d)try{d.location.href=g}catch{d.close(),s(g)}else s(g)};r.then(f,m=>{console.error("[dapp-ui] onOutlink rejected:",m),d?.close()});return}let l=r;if(l===null)return;s(l??t)}var tn=D(require("react"),1),qa=require("vaul");var go=require("react"),Rn=(0,go.createContext)(null);function it(){let e=(0,go.useContext)(Rn);if(!e)throw new Error("WalletPortfolio compound components must be used within <WalletPortfolio>");return e}var ra=require("vaul");var ar=require("react/jsx-runtime");function ia({asChild:e,children:t}){let{walletAddress:n}=it(),o=t!=null,r=e??!0,s=o?t:(0,ar.jsx)("button",{type:"button",children:Qe(n)});return(0,ar.jsx)(ra.Drawer.Trigger,{asChild:r,children:s})}var Ln=require("vaul");var ut=D(require("react"),1),ja=require("@tanstack/react-query");var pt=require("react/jsx-runtime");function aa({size:e=22,className:t}){return(0,pt.jsxs)("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,pt.jsx)("path",{d:"M18.333 3.667v5.5h-5.5",stroke:"currentColor",strokeWidth:1.833,strokeLinecap:"round",strokeLinejoin:"round"}),(0,pt.jsx)("path",{d:"M16.17 13.75a7.333 7.333 0 11-1.54-7.59L18.333 9.167",stroke:"currentColor",strokeWidth:1.833,strokeLinecap:"round",strokeLinejoin:"round"})]})}function sa({size:e=24,className:t}){return(0,pt.jsx)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,"aria-hidden":"true",children:(0,pt.jsx)("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})})}function At({size:e=12,className:t}){return(0,pt.jsxs)("svg",{width:e,height:e,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,"aria-hidden":"true",children:[(0,pt.jsx)("path",{d:"M5 2H2.5A1.5 1.5 0 0 0 1 3.5V9.5A1.5 1.5 0 0 0 2.5 11H8.5A1.5 1.5 0 0 0 10 9.5V7",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"}),(0,pt.jsx)("path",{d:"M7 1H11V5",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"}),(0,pt.jsx)("path",{d:"M11 1L6 6",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"})]})}var ua=require("@tanstack/react-query"),sr=require("react");var ho={dev:"https://stg-cross-game-reward-api.crosstoken.io/api",stage:"https://stg-cross-game-reward-api.crosstoken.io/api",production:"https://cross-game-reward-api.crosstoken.io/api"},la={dev:"https://stg-x.crosstoken.io",stage:"https://stg-x.crosstoken.io",production:"https://x.crosstoken.io"},bo={dev:"https://stg-bonding-curve-api.crosstoken.io/api",stage:"https://stg-bonding-curve-api.crosstoken.io/api",production:"https://bonding-curve-api.crosstoken.io/api"},ca={dev:"https://stg-x.crosstoken.io",stage:"https://stg-x.crosstoken.io",production:"https://x.crosstoken.io"},pn={dev:"https://stg-posa-api.crosstoken.io/api/v1",stage:"https://stg-posa-api.crosstoken.io/api/v1",production:"https://posa-api.crosstoken.io/api/v1"},In={dev:"https://dev-stake.ogfcorp.com",stage:"https://stg-stake.ogfcorp.com",production:"https://stake.ogfcorp.com"},da={dev:`${In.dev}/portfolio`,stage:`${In.stage}/portfolio`,production:`${In.production}/portfolio`},pa={dev:"https://stg-game-swap-api.cross.nexus/v1",stage:"https://stg-game-swap-api.cross.nexus/v1",production:"https://game-swap-api.cross.nexus/v1"},fa={dev:"https://stg-x.crosstoken.io",stage:"https://stg-x.crosstoken.io",production:"https://x.crosstoken.io"},zt={dev:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/icons",stage:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/icons",production:"https://contents.crosstoken.io/frontend/common/app-launcher/icons"};var Vl="wp:reward-pools";function ma(e,t=!0){let n=ho[e],{data:o,...r}=(0,ua.useQuery)({queryKey:[Vl,e],queryFn:async({signal:l})=>{let p=await fetch(`${n}/v1/pools`,{cache:"no-store",signal:l});if(!p.ok)throw new Error(`Failed to fetch pools: ${p.status}`);let d=await p.json();if(d.code!==200)throw new Error(`Pools API error: ${d.code}`);return d},enabled:t,staleTime:0}),s=(0,sr.useMemo)(()=>o?.data.pools.filter(l=>l.pool_type==="CrossPool")??[],[o]),a=(0,sr.useMemo)(()=>o?.data.pools.filter(l=>l.pool_type==="GamePool")??[],[o]);return{crossPools:s,gamePools:a,allPools:o?.data.pools??[],...r}}var ga=require("@tanstack/react-query"),ha=require("react");var ql="wp:user-deposits";function ba(e,t,n=!0){let o=ho[e],r=n&&!!t,{data:s,...a}=(0,ga.useQuery)({queryKey:[ql,e,t],queryFn:async({signal:p})=>{let d=await fetch(`${o}/v1/users/${t}/deposits`,{cache:"no-store",signal:p});if(!d.ok)throw new Error(`Deposits fetch failed: ${d.status}`);let f=await d.json();if(f.code!==200)throw new Error(`Deposits API error: ${f.code}`);return f},enabled:r,staleTime:0});return{depositMap:(0,ha.useMemo)(()=>{let p=new Map;if(!s?.data.user_deposits)return p;for(let d of s.data.user_deposits)p.set(d.pool_address.toLowerCase(),d);return p},[s]),deposits:s?.data.user_deposits??[],...a}}var wa=require("@tanstack/react-query"),xa=require("react");var Kl="wp:token-info";function va(e,t=!0){let n=rt[e],o=ze[e].cross,{data:r,...s}=(0,wa.useQuery)({queryKey:[Kl,e],queryFn:async({signal:d})=>{let f=await fetch(`${n}/v1/public/token/info`,{cache:"no-store",signal:d});if(!f.ok)throw new Error(`Failed to fetch token info: ${f.status}`);let m=await f.json();if(m.code!==200)throw new Error(`Token info API error: ${m.code}`);return m},enabled:t,staleTime:300*1e3}),{byChainAddr:a,byChainSym:l}=(0,xa.useMemo)(()=>{let d=new Map,f=new Map;if(!r?.data)return{byChainAddr:d,byChainSym:f};for(let m of r.data){let g=m.address.toLowerCase();d.set(`${m.chain_id}:${g}`,m),d.set(g,m);let h=m.symbol.replace(/^t/,"").toUpperCase(),x=`${m.chain_id}:${h}`;f.has(x)||f.set(x,m),f.has(h)||f.set(h,m)}return{byChainAddr:d,byChainSym:f}},[r]);return{getTokenImage:(d,f)=>{let m=d.toLowerCase(),g=a.get(`${o}:${m}`);if(g?.image)return g.image;let h=a.get(m);if(h?.image)return h.image;if(f){let x=f.replace(/^t/,"").toUpperCase(),y=l.get(`${o}:${x}`);if(y?.image)return y.image;let w=l.get(x);if(w?.image)return w.image}return""},...s}}var wo=D(require("bignumber.js"),1);function fn(e,t){let n=new wo.default(e).shiftedBy(-t);return!n.isFinite()||n.isZero()?"0":n.isGreaterThanOrEqualTo(1)?n.toFormat(2,wo.default.ROUND_DOWN):n.toFormat(4,wo.default.ROUND_DOWN)}function lr(e){return fn(e,0)}var Wt=require("react/jsx-runtime");function Dt({title:e,icon:t,iconFit:n="cover",isEmpty:o,children:r}){return(0,Wt.jsxs)("div",{className:"wp-svc-card",children:[(0,Wt.jsxs)("div",{className:"wp-svc-card-head",children:[(0,Wt.jsx)("img",{className:"wp-svc-card-icon",src:t,alt:"",style:{objectFit:n}}),(0,Wt.jsx)("span",{className:"wp-svc-card-title",children:e})]}),o?(0,Wt.jsx)("div",{className:"wp-svc-empty",children:"No assets yet"}):(0,Wt.jsx)("div",{className:"wp-svc-items",children:r})]})}var un=D(require("bignumber.js"),1),Q=require("react/jsx-runtime"),Ql="CROSS Rewards";function Zl(e){return new un.default(e||"0").isGreaterThan(0)}function Yl(e,t,n){let o=new un.default(e||"0").shiftedBy(-t).times(n||"0");return!o.isFinite()||o.isZero()?"$0.00":`$${o.toFormat(2,un.default.ROUND_DOWN)}`}function ya(){let{env:e,walletAddress:t,onOutlink:n}=it(),o=!!t,{allPools:r}=ma(e,o),{depositMap:s}=ba(e,t,o),{getTokenImage:a}=va(e,o),l=(f,m)=>`${la[e]}/rewards/${f.pool_address}?action=${m}`,p=`${zt[e]}/reward.png`,d=r.filter(f=>{let m=s.get(f.pool_address.toLowerCase()),g=m?.deposited_amount??"0",h=m?.claimable_reward??"0";return!(new un.default(g).isZero()&&new un.default(h).isZero())});return(0,Q.jsx)(Dt,{title:Ql,icon:p,isEmpty:d.length===0,children:d.map(f=>{let m=s.get(f.pool_address.toLowerCase()),g=m?.deposited_amount??"0",h=m?.claimable_reward??"0",x=l(f,"withdraw"),y=l(f,"claim"),w=a(f.deposit_token.address,f.deposit_token.symbol),v=f.reward_tokens[0],I=v?a(v.address,v.symbol):"",u=f.reward_tokens.map(H=>H.symbol),E=u.length>0?`${f.deposit_token.symbol}-${u.join("/")}`:f.deposit_token.symbol,T=v?fn(h,v.decimals):"0",M=v?.symbol??"Reward",_=v?Yl(h,v.decimals,v.price):"$0.00",j=!!m&&Zl(h);return(0,Q.jsxs)("article",{className:"wp-item","data-side":"reward",children:[(0,Q.jsxs)("div",{className:"wp-item-body",children:[(0,Q.jsxs)("div",{className:"wp-item-line",children:[(0,Q.jsx)("span",{className:"wp-item-label",children:"Pool (Deposit - Earn)"}),(0,Q.jsxs)("div",{className:"wp-svc-token",children:[(0,Q.jsxs)("span",{className:"wp-token-stack","aria-hidden":!0,children:[w&&(0,Q.jsx)("img",{className:"wp-svc-token-icon",src:w,alt:""}),I&&(0,Q.jsx)("img",{className:"wp-svc-token-icon",src:I,alt:""})]}),(0,Q.jsx)("span",{children:E})]})]}),(0,Q.jsxs)("div",{className:"wp-item-line",children:[(0,Q.jsx)("span",{className:"wp-item-label",children:"Deposited"}),(0,Q.jsxs)("div",{className:"wp-svc-token",children:[w&&(0,Q.jsx)("img",{className:"wp-svc-token-icon",src:w,alt:""}),(0,Q.jsx)("span",{children:fn(g,f.deposit_token.decimals)})]})]}),(0,Q.jsxs)("div",{className:"wp-item-line",children:[(0,Q.jsxs)("span",{className:"wp-item-label",children:["Claimable (",M,")"]}),(0,Q.jsxs)("div",{className:"wp-svc-token",children:[I&&(0,Q.jsx)("img",{className:"wp-svc-token-icon",src:I,alt:""}),(0,Q.jsx)("span",{children:T}),(0,Q.jsx)("span",{className:"wp-item-usd",children:_})]})]})]}),(0,Q.jsxs)("div",{className:"wp-item-tags",children:[(0,Q.jsxs)("a",{className:"wp-tag wp-tag--muted",href:x,target:"_blank",rel:"noopener noreferrer",onClick:H=>Ze(H,x,{category:"portfolio",origin:"portfolio-rewards",payload:{pool:f,userDeposit:m}},n),children:[(0,Q.jsx)("span",{className:"wp-tag-label",children:"Withdraw"}),(0,Q.jsx)(At,{size:12,className:"wp-tag-icon"})]}),(0,Q.jsxs)("a",{className:"wp-tag wp-tag--mint","data-disabled":!j||void 0,"aria-disabled":!j||void 0,href:j?y:void 0,target:j?"_blank":void 0,rel:j?"noopener noreferrer":void 0,onClick:H=>{if(!j){H.preventDefault();return}Ze(H,y,{category:"portfolio",origin:"portfolio-rewards",payload:{pool:f,userDeposit:m}},n)},children:[(0,Q.jsx)("span",{className:"wp-tag-label",children:"Claim"}),(0,Q.jsx)(At,{size:12,className:"wp-tag-icon"})]})]})]},f.pool_address)})})}var La=D(require("react"),1);var ka=require("@tanstack/react-query");var Xl="wp:stake-info";function Sa(e,t,n=!0){let o=pn[e],r=n&&!!t,{data:s,...a}=(0,ka.useQuery)({queryKey:[Xl,e,t],queryFn:async({signal:p})=>{let d=await fetch(`${o}/stake/${t}`,{cache:"no-store",signal:p});if(!d.ok)throw new Error(`Stake info fetch failed: ${d.status}`);let f=await d.json();if(f.code!==0&&f.code!==200)throw new Error(`Stake info API error: ${f.code}`);return f},enabled:r,staleTime:0});return{stakeInfo:s?.data,...a}}var Ca=require("@tanstack/react-query");var Jl="wp:stake-rewards";function Na(e,t,n=!0){let o=pn[e],r=n&&!!t,{data:s,...a}=(0,Ca.useQuery)({queryKey:[Jl,e,t],queryFn:async({signal:l})=>{let p=await fetch(`${o}/rewards/${t}?limit=1`,{cache:"no-store",signal:l});if(!p.ok)throw new Error(`Stake rewards fetch failed: ${p.status}`);let d=await p.json();if(d.code!==0&&d.code!==200)throw new Error(`Stake rewards API error: ${d.code}`);return d.data?.data?.[0]??null},enabled:r,staleTime:0});return{latestReward:s??null,...a}}var Ta=require("@tanstack/react-query");var ec="wp:network-stats";function Ra(e,t=!0){let n=pn[e],{data:o,...r}=(0,Ta.useQuery)({queryKey:[ec,e],queryFn:async({signal:a})=>{let l=await fetch(`${n}/network/stats`,{cache:"no-store",signal:a});if(!l.ok)throw new Error(`Network stats fetch failed: ${l.status}`);let p=await l.json();if(p.code!==0&&p.code!==200)throw new Error(`Network stats API error: ${p.code}`);return p},enabled:t,staleTime:0});return{networkStats:o?.data,...r}}var Xt=D(require("bignumber.js"),1),X=require("react/jsx-runtime"),tc="CROSS Staking";function Ia(e){if(!e)return"\u2014";let t=new Xt.default(e);return t.isFinite()?`${t.toFormat(2,Xt.default.ROUND_DOWN)}%`:"\u2014"}function Ea(){let{env:e,walletAddress:t,onOutlink:n}=it(),o=!!t,{stakeInfo:r}=Sa(e,t,o),{latestReward:s}=Na(e,t,o),{networkStats:a}=Ra(e,o),l=`${zt[e]}/cross-staking.png`,p=da[e],d=r?.total_stake??"0",f=r?.delegations??0,m=La.useMemo(()=>{let I=s?.cumulative_earned;if(!I)return;let u=new Xt.default(I);return u.isFinite()?u:void 0},[s]),g=m?.toString(10)??r?.rewards_earned??"0",h=new Xt.default(d),x=r?.days_since_first_stake,y=m!==void 0&&h.isGreaterThan(0)&&x!==null&&x!==void 0?m.div(h).times(365).div(Math.max(1,x)).times(100):void 0,w=!(new Xt.default(d).isZero()&&new Xt.default(g).isZero()),v=In[e];return(0,X.jsx)(Dt,{title:tc,icon:l,iconFit:"contain",isEmpty:!1,children:(0,X.jsxs)("article",{className:"wp-item","data-side":"stake",children:[(0,X.jsx)("div",{className:"wp-item-body",children:w?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)("div",{className:"wp-item-line",children:[(0,X.jsx)("span",{className:"wp-item-label",children:"Staked"}),(0,X.jsxs)("span",{children:[lr(d)," CROSS"]})]}),(0,X.jsxs)("div",{className:"wp-item-line",children:[(0,X.jsx)("span",{className:"wp-item-label",children:"Rewards Earned"}),(0,X.jsxs)("span",{children:[lr(g)," CROSS"]})]}),(0,X.jsxs)("div",{className:"wp-item-line",children:[(0,X.jsx)("span",{className:"wp-item-label",children:"Delegations"}),(0,X.jsx)("span",{children:f})]}),(0,X.jsxs)("div",{className:"wp-item-line",children:[(0,X.jsx)("span",{className:"wp-item-label",children:"My APR"}),(0,X.jsx)("span",{children:Ia(y?.toString(10))})]})]}):(0,X.jsxs)("div",{className:"wp-item-line",children:[(0,X.jsx)("span",{className:"wp-item-label",children:"Delegation APR"}),(0,X.jsx)("span",{children:Ia(a?.apr)})]})}),(0,X.jsx)("div",{className:"wp-item-tags",children:(0,X.jsxs)("a",{className:"wp-tag wp-tag--mint",href:w?p:v,target:"_blank",rel:"noopener noreferrer",onClick:I=>Ze(I,w?p:v,{category:"portfolio",origin:"portfolio-stake",payload:{stakeInfo:r,networkStats:a}},n),children:[(0,X.jsx)("span",{className:"wp-tag-label",children:w?"Manage":"Stake Now"}),(0,X.jsx)(At,{size:12,className:"wp-tag-icon"})]})})]})})}var cr=D(require("react"),1);var Aa=require("@tanstack/react-query");var nc="wp:game-swap-pools";function Pa(e,t,n=!0){let o=pa[e],r=n&&!!t,{data:s,...a}=(0,Aa.useQuery)({queryKey:[nc,e,t],queryFn:async({signal:l})=>{let p=await fetch(`${o}/addresses/${t}/portfolio`,{cache:"no-store",signal:l});if(!p.ok)throw new Error(`Game-swap portfolio fetch failed: ${p.status}`);return(await p.json()).pools??[]},enabled:r,staleTime:0});return{pools:s??[],...a}}var Ba=require("@tanstack/react-query"),oc="wp:game-swap-lp-balances";function Fa(e,t,n,o){let r=[...n].map(p=>p.toLowerCase()).sort(),s=!!o&&!!t&&r.length>0,{data:a,...l}=(0,Ba.useQuery)({queryKey:[oc,e,t,r],queryFn:async()=>{if(!o)return{};let p=await o(r),d={};for(let[f,m]of Object.entries(p))d[f.toLowerCase()]=m;return d},enabled:s,staleTime:0});return{balances:a??{},...l}}var ft=D(require("bignumber.js"),1),ne=require("react/jsx-runtime"),rc="Game Swap LP",_a=18,ic=new ft.default("0.0001");function Ma(e){return e?.trim().toUpperCase()==="CROSS"}function ac(e){return e&&e>0?e:_a}function sc(e){let t=Ma(e.token_a?.symbol)&&!Ma(e.token_b?.symbol),n=t?e.reserve_a:e.reserve_b,o=ac(t?e.token_a?.decimals:e.token_b?.decimals),r=new ft.default(n||"0").shiftedBy(-o);return!r.isFinite()||r.isLessThanOrEqualTo(0)?new ft.default(0):r.times(2)}function lc(e,t){let n=e.token_a?.symbol?.trim()||"TOKEN",o=e.token_b?.symbol?.trim()||"CROSS",r=t?.decimals??_a,s,a;if(t&&t.totalSupply&&t.totalSupply>BigInt(0)){let l=new ft.default(t.balance.toString()),p=new ft.default(t.totalSupply.toString()),d=l.div(p);s=d.times(100);let f=d.times(sc(e));if(f.isGreaterThan(0)){let m=new ft.default(e.cross_usd||"0");a=m.isGreaterThan(0)?`$${f.times(m).toFormat(2,ft.default.ROUND_DOWN)}`:`${f.toFormat(4,ft.default.ROUND_DOWN)} CROSS`}}return{pool:e,tokenASymbol:n,tokenBSymbol:o,info:t,lpAmountRaw:t?.balance.toString(),lpDecimals:r,sharePercent:s,valueText:a}}function Oa(){let{env:e,walletAddress:t,onOutlink:n,lpBalanceReader:o}=it(),r=!!t,{pools:s}=Pa(e,t,r),a=cr.useMemo(()=>s.map(g=>g.pair_address).filter(Boolean),[s]),{balances:l}=Fa(e,t,a,o),p=`${zt[e]}/dex.png`,d=!!o,f=cr.useMemo(()=>{let g=s.map(h=>lc(h,l[h.pair_address?.toLowerCase()]));return d?g.filter(h=>h.lpAmountRaw?new ft.default(h.lpAmountRaw).shiftedBy(-h.lpDecimals).isGreaterThanOrEqualTo(ic):!1):g},[s,l,d]),m=g=>{let h=g.token_a?.address??g.pair_address;return`${fa[e]}/tokens/${h}?trade=deposit`};return(0,ne.jsx)(Dt,{title:rc,icon:p,iconFit:"contain",isEmpty:f.length===0,children:f.map(g=>{let{pool:h}=g,x=m(h),y=`${g.tokenASymbol} / ${g.tokenBSymbol}`,w=h.token_a?.logo_url,v=h.token_b?.logo_url;return(0,ne.jsxs)("article",{className:"wp-item","data-side":"game-swap",children:[(0,ne.jsxs)("div",{className:"wp-item-body",children:[(0,ne.jsxs)("div",{className:"wp-item-line",children:[(0,ne.jsx)("span",{className:"wp-item-label",children:"Pool"}),(0,ne.jsxs)("div",{className:"wp-svc-token",children:[(0,ne.jsxs)("span",{className:"wp-token-stack","aria-hidden":!0,children:[w&&(0,ne.jsx)("img",{className:"wp-svc-token-icon",src:w,alt:""}),v&&(0,ne.jsx)("img",{className:"wp-svc-token-icon",src:v,alt:""})]}),(0,ne.jsx)("span",{children:y})]})]}),g.lpAmountRaw!==void 0&&(0,ne.jsxs)("div",{className:"wp-item-line",children:[(0,ne.jsx)("span",{className:"wp-item-label",children:"My LP"}),(0,ne.jsxs)("span",{children:[fn(g.lpAmountRaw,g.lpDecimals)," LP"]})]}),g.sharePercent!==void 0&&(0,ne.jsxs)("div",{className:"wp-item-line",children:[(0,ne.jsx)("span",{className:"wp-item-label",children:"Pool Share"}),(0,ne.jsxs)("span",{children:[g.sharePercent.toFormat(2,ft.default.ROUND_DOWN),"%"]})]}),g.valueText!==void 0&&(0,ne.jsxs)("div",{className:"wp-item-line",children:[(0,ne.jsx)("span",{className:"wp-item-label",children:"Value"}),(0,ne.jsx)("span",{children:g.valueText})]})]}),(0,ne.jsx)("div",{className:"wp-item-tags",children:(0,ne.jsxs)("a",{className:"wp-tag wp-tag--mint",href:x,target:"_blank",rel:"noopener noreferrer",onClick:I=>Ze(I,x,{category:"portfolio",origin:"portfolio-game-swap",payload:{pool:h}},n),children:[(0,ne.jsx)("span",{className:"wp-tag-label",children:"Manage"}),(0,ne.jsx)(At,{size:12,className:"wp-tag-icon"})]})})]},h.pair_address)})})}var xo=D(require("bignumber.js"),1),Ua=require("react");var za=require("@tanstack/react-query");var cc="wp:forge-pools";function Wa(e,t,n=!0){let o=bo[e],r=n&&!!t,{data:s,...a}=(0,za.useQuery)({queryKey:[cc,e,t],queryFn:async()=>{let p=await fetch(`${o}/v1/users/${t}/pools`,{cache:"no-store"});if(!p.ok)throw new Error(`forge pools fetch failed: ${p.status}`);return(await p.json()).data?.items??[]},enabled:r,staleTime:0}),l=s??[];return{pools:l,isEmpty:l.length===0,...a}}var Da=require("@tanstack/react-query"),Ha=require("react");var dc="wp:forge-token-detail";async function pc(e,t){let n=await fetch(`${e}/v1/tokens/${t}`,{cache:"no-store"});return n.ok?(await n.json())?.data?.token??null:null}function Ga(e,t,n=!0){let o=bo[e],r=(0,Da.useQueries)({queries:t.map(l=>({queryKey:[dc,e,l],queryFn:()=>pc(o,l),enabled:n&&!!l,staleTime:3e4}))}),s=(0,Ha.useMemo)(()=>{let l=new Map;for(let p=0;p<r.length;p++){let d=r[p]?.data,f=t[p];d&&f&&l.set(f.toLowerCase(),d)}return l},[r,t]),a=r.some(l=>l.isLoading);return{detailMap:s,isLoading:a}}var de=require("react/jsx-runtime"),fc="Forge",uc=18,mc="https://contents.crosstoken.io/wallet/token/images/FT.png";function gc(e){if(!e||e==="0")return"0";let t=new xo.default(e).shiftedBy(-uc);return t.isZero()?"0":t.isGreaterThanOrEqualTo(1)?t.toFormat(2,xo.default.ROUND_DOWN):t.toFormat(4,xo.default.ROUND_DOWN)}function hc(e){let t=Number(e);return!Number.isFinite(t)||t<=0?"0%":t>=1?`${(Math.floor(t*100)/100).toFixed(2)}%`:`${(Math.floor(t*1e4)/1e4).toFixed(4)}%`}function $a(){let{env:e,walletAddress:t,onOutlink:n}=it(),o=!!t,{pools:r,isEmpty:s}=Wa(e,t,o),a=(0,Ua.useMemo)(()=>r.map(f=>f.token.address),[r]),{detailMap:l}=Ga(e,a,o&&a.length>0),p=f=>`${ca[e]}/forge/token/${f.token.address}`,d=`${zt[e]}/forge.png`;return(0,de.jsx)(Dt,{title:fc,icon:d,iconFit:"contain",isEmpty:s,children:r.map(f=>{let m=l.get(f.token.address.toLowerCase()),g=m?.image_url||m?.image||f.token.image||mc,h=m?.symbol||f.token.symbol,x=p(f);return(0,de.jsxs)("a",{className:"wp-item","data-side":"lp",href:x,target:"_blank",rel:"noopener noreferrer",onClick:y=>Ze(y,x,{category:"portfolio",origin:"portfolio-forge",payload:{pool:f,tokenDetail:m}},n),children:[(0,de.jsxs)("div",{className:"wp-item-body",children:[(0,de.jsxs)("div",{className:"wp-item-line",children:[(0,de.jsx)("span",{className:"wp-item-label",children:"Asset"}),(0,de.jsxs)("div",{className:"wp-svc-token",children:[(0,de.jsx)("img",{className:"wp-svc-token-icon",src:g,alt:""}),(0,de.jsx)("span",{children:h}),m?.name&&(0,de.jsx)("span",{className:"wp-token-subtle",children:m.name})]})]}),(0,de.jsxs)("div",{className:"wp-item-line",children:[(0,de.jsx)("span",{className:"wp-item-label",children:"LP Balance"}),(0,de.jsx)("div",{className:"wp-svc-token",children:(0,de.jsx)("span",{children:gc(f.lp_balance)})})]}),(0,de.jsxs)("div",{className:"wp-item-line",children:[(0,de.jsx)("span",{className:"wp-item-label",children:"Ownership"}),(0,de.jsx)("span",{className:"wp-line-value",children:hc(f.pool_ownership)})]})]}),(0,de.jsx)("div",{className:"wp-item-tags",children:(0,de.jsxs)("span",{className:"wp-tag wp-tag--muted",children:[(0,de.jsx)("span",{className:"wp-tag-label",children:"Withdraw"}),(0,de.jsx)(At,{size:12,className:"wp-tag-icon"})]})})]},f.pair_address)})})}O(`.wp-fullscreen[data-theme=dark],.wp-embed[data-theme=dark]{--wp-bg: var(--ds-bg-default, #202530);--wp-header-bg: var(--ds-surface-default, #252b39);--wp-card: var(--ds-surface-medium, #252b39);--wp-control: #292f40;--wp-border: var(--ds-border-default, #292f40);--wp-panel-border: var(--ds-border-medium, rgba(255, 255, 255, .18));--wp-panel-shadow: 0px 4px 30px -1px rgba(0, 0, 0, .28);--wp-text: var(--ds-content-highest, #ffffff);--wp-text-60: var(--ds-content-high, rgba(255, 255, 255, .85));--wp-text-40: var(--ds-content-medium, rgba(255, 255, 255, .65));--wp-text-30: var(--ds-content-low, rgba(255, 255, 255, .4));--wp-chrome-text: #ffffff;--wp-tooltip-bg: #151a23;--wp-tooltip-text: #ffffff;--wp-mint: var(--ds-accent-primary-default, #00a0a2);--wp-green: var(--ds-accent-primary-default, #00a0a2);--wp-accent-soft: var(--ds-accent-primary-low, rgba(0, 160, 162, .14));--wp-red: var(--ds-system-red-default, #e70077);--wp-blue: #0488fc;--wp-purple: #7346f3;--wp-orange: #ff9d00;--wp-claim-primary: #9b8cef;--wp-claim-primary-text: #202530;--wp-claim-secondary-bg: var(--wp-control);--wp-claim-success: #00d4aa;--wp-claim-success-soft: rgba(0, 212, 170, .18);--wp-claim-error: #ff3aa3;--wp-claim-error-soft: rgba(255, 58, 163, .16)}.wp-fullscreen[data-theme=light],.wp-embed[data-theme=light]{--wp-bg: var(--ds-bg-dim, #f5f7fa);--wp-header-bg: var(--ds-surface-default, #ffffff);--wp-card: var(--ds-surface-default, #ffffff);--wp-control: var(--ds-surface-medium, #f5f7fa);--wp-border: var(--ds-border-default, rgba(0, 0, 0, .07));--wp-panel-border: var(--ds-border-medium, rgba(0, 0, 0, .18));--wp-panel-shadow: 0px 4px 30px -1px rgba(0, 0, 0, .15);--wp-text: var(--ds-content-highest, #000000);--wp-text-60: var(--ds-content-high, rgba(0, 0, 0, .85));--wp-text-40: var(--ds-content-medium, rgba(0, 0, 0, .65));--wp-text-30: var(--ds-content-low, rgba(0, 0, 0, .4));--wp-chrome-text: var(--ds-content-high, rgba(0, 0, 0, .85));--wp-card-shadow: none;--wp-tooltip-bg: #192023;--wp-tooltip-text: #ffffff;--wp-mint: var(--ds-accent-primary-default, #00a0a2);--wp-green: var(--ds-accent-primary-default, #00a0a2);--wp-accent-soft: var(--ds-accent-primary-low, #e7f9f8);--wp-red: var(--ds-system-red-default, #e70077);--wp-blue: #0488fc;--wp-purple: #7346f3;--wp-orange: #ff9d00;--wp-claim-primary: #7346f3;--wp-claim-primary-text: #ffffff;--wp-claim-secondary-bg: #ffffff;--wp-claim-success: #019d92;--wp-claim-success-soft: rgba(1, 157, 146, .15);--wp-claim-error: #e70077;--wp-claim-error-soft: rgba(231, 0, 119, .12)}.wp-fullscreen{position:fixed!important;top:12px!important;left:max(12px,calc((100vw - 393px)/2))!important;right:max(12px,calc((100vw - 393px)/2))!important;bottom:12px!important;width:auto!important;height:calc(100dvh - 24px)!important;max-height:calc(100dvh - 24px)!important;z-index:50;background:var(--wp-bg);border:1px solid var(--wp-panel-border);border-radius:24px;box-shadow:var(--wp-panel-shadow);display:flex;flex-direction:column;overflow:hidden;font-family:inherit;font-feature-settings:"calt" 0,"lnum" 1,"pnum" 1;box-sizing:border-box;-webkit-font-smoothing:antialiased;color:var(--wp-chrome-text)}.wp-embed{width:100%;height:100%;min-height:0;background:var(--wp-bg);display:flex;flex-direction:column;overflow:hidden;position:relative;font-family:inherit;font-feature-settings:"calt" 0,"lnum" 1,"pnum" 1;box-sizing:border-box;-webkit-font-smoothing:antialiased;color:var(--wp-chrome-text)}.wp-overlay{position:fixed;inset:0;z-index:49;background:#0009}.wp-header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;min-height:73px;padding:24px;position:relative;border-bottom:1px solid var(--wp-border);background:var(--wp-header-bg);color:var(--wp-chrome-text);flex-shrink:0;box-sizing:border-box}.wp-header-btn{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:none;background:transparent;cursor:pointer;color:var(--ds-content-low, rgba(0, 0, 0, .4));flex-shrink:0;transition:color .15s ease}.wp-header-btn:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wp-header-edge{display:flex;align-items:center;width:24px;min-width:24px}.wp-header-edge--right{justify-content:flex-end}.wp-header-edge--right .wp-header-btn{position:absolute;top:24px;right:24px}.wp-header-spacer{display:block;width:24px;height:24px}.wp-header-avatar{width:38px;height:38px;flex-shrink:0;border-radius:50%;overflow:hidden;display:inline-flex;align-items:center;justify-content:center;background:var(--wp-header-avatar-bg)}.wp-header-avatar-img{width:30px;height:30px;object-fit:cover;display:block}.wp-fullscreen[data-theme=dark] .wp-header-avatar,.wp-embed[data-theme=dark] .wp-header-avatar{--wp-header-avatar-bg: hsl(221.3 24.6% 25.5%)}.wp-fullscreen[data-theme=light] .wp-header-avatar,.wp-embed[data-theme=light] .wp-header-avatar{--wp-header-avatar-bg: rgba(18, 18, 18, .1)}.wp-refresh-btn{position:relative}.wp-refresh-badge{position:absolute;top:-6px;right:-8px;min-width:16px;height:16px;padding:0 4px;border-radius:8px;background:var(--wp-mint);color:#fff;font-size:10px;font-weight:600;line-height:16px;text-align:center}.wp-spin-once{animation:wp-spin-once .6s ease-in-out}@keyframes wp-spin-once{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.wp-header-title{flex:1;font-family:inherit;font-size:18px;font-weight:600;line-height:1.5;letter-spacing:-.01em;text-align:center;color:var(--ds-content-highest, #000000);margin:0}.wp-header-account{flex:1;display:flex;align-items:center;gap:12px;min-width:0}.wp-header-wallet-name{flex:1;min-width:0;font-family:inherit;font-size:15px;font-weight:600;line-height:160%;letter-spacing:0;color:var(--wp-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wp-top{flex-shrink:0;padding:0 16px 16px;display:flex;flex-direction:column;gap:16px}.wp-identity{display:flex;flex-direction:column;gap:8px}.wp-address{display:inline-flex;align-items:center;gap:8px}.wp-address-label{font-size:12px;font-weight:400;line-height:1.4;color:var(--wp-text-40)}.wp-address-chevron{display:inline-flex;align-items:center;color:var(--wp-text-40)}.wp-total{font-size:28px;font-weight:600;line-height:1.3;color:var(--wp-text);margin:0}.wp-asset{display:flex;flex-direction:column;gap:8px}.wp-asset-head{display:flex;align-items:center;gap:4px}.wp-asset-head-label{font-size:12px;font-weight:400;line-height:1.4;color:var(--wp-text-40)}.wp-asset-head-icon{display:inline-flex;color:var(--wp-text-40)}.wp-bar{display:flex;height:20px;border-radius:4px;overflow:hidden}.wp-bar-seg{display:flex;align-items:center;justify-content:center;min-width:8px}.wp-bar-seg-pct{font-size:10px;font-weight:400;line-height:1.3;color:#fff;white-space:nowrap}.wp-legend{display:flex;align-items:center;justify-content:center;gap:16px;flex-wrap:wrap}.wp-legend-item{display:flex;align-items:center;gap:4px}.wp-legend-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}.wp-legend-label{font-size:12px;font-weight:400;line-height:1.4;color:var(--wp-text-40)}.wp-tabs{flex-shrink:0;padding:8px 16px}.wp-tabs-inner{display:flex;align-items:center;padding:0 2px}.wp-tabs-list{display:flex;gap:20px;flex:1}.wp-tab{display:flex;flex-direction:column;align-items:center;justify-content:space-between;height:44px;padding-top:12px;background:transparent;border:none;cursor:pointer}.wp-tab-text{font-size:14px;font-weight:600;line-height:1.4;color:var(--wp-text-30);white-space:nowrap}.wp-tab[data-active=true] .wp-tab-text{color:var(--wp-mint)}.wp-tab-bar{width:20px;height:4px;border-radius:2px;background:var(--wp-mint);opacity:0}.wp-tab[data-active=true] .wp-tab-bar{opacity:1}.wp-tabs-filter-wrap{position:relative;display:flex;align-items:center;width:44px;height:44px;flex-shrink:0}.wp-tabs-filter-grad{position:absolute;inset:0;background:linear-gradient(to left,var(--wp-bg) 74%,transparent);pointer-events:none}.wp-tabs-filter{position:relative;display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;padding:0;border:none;background:transparent;cursor:pointer;color:var(--wp-text-40)}.wp-body{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--wp-border) transparent}.wp-body::-webkit-scrollbar{width:4px}.wp-body::-webkit-scrollbar-track{background:transparent}.wp-body::-webkit-scrollbar-thumb{background:var(--wp-border);border-radius:4px}.wp-body-inner{padding:16px 16px 32px;display:flex;flex-direction:column;gap:32px}.wp-summary-card{display:flex;flex-direction:column;gap:8px;width:100%;padding:0;border-radius:0;background:transparent;box-shadow:none;box-sizing:border-box}.wp-summary-head{display:flex;align-items:center;justify-content:flex-start;gap:4px}.wp-summary-label{font-size:14px;font-weight:400;line-height:1.5;letter-spacing:0;color:var(--wp-text-40);white-space:nowrap}.wp-address{display:inline-flex;align-items:center;gap:8px;min-width:0}.wp-address-avatar{width:16px;height:16px;border-radius:50%;flex-shrink:0;background:radial-gradient(circle at 68% 34%,#ff78d1 0 18%,transparent 19%),radial-gradient(circle at 34% 66%,#00d4aa 0 20%,transparent 21%),linear-gradient(135deg,#7346f3,#0488fc)}.wp-address-label{font-size:12px;font-weight:400;line-height:1.4;letter-spacing:0;color:var(--wp-text-40);white-space:nowrap}.wp-address-chevron{display:inline-flex;align-items:center;color:var(--wp-text-40);flex-shrink:0}.wp-summary-badge{display:inline-flex;align-items:center;justify-content:center;padding:4px 8px;border-radius:999px;background:#019d921a;color:var(--wp-mint);font-size:12px;font-weight:400;line-height:1.4;letter-spacing:0;white-space:nowrap}.wp-summary-estimate{position:relative;display:inline-flex;align-items:center;gap:6px;flex-shrink:0}.wp-estimate-info{position:relative;display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;padding:0;border:0;border-radius:50%;background:transparent;color:var(--wp-text-40);cursor:help}.wp-estimate-tooltip{position:absolute;top:calc(100% + 8px);right:0;z-index:3;display:flex;flex-direction:column;gap:8px;width:min(280px,calc(100vw - 48px));padding:12px;border-radius:8px;background:var(--wp-tooltip-bg);box-shadow:0 12px 32px #0000003d;color:var(--wp-tooltip-text);font-size:12px;font-weight:400;line-height:1.4;letter-spacing:0;text-align:left;white-space:normal;opacity:0;pointer-events:none;transform:translateY(-4px);visibility:hidden;transition:opacity .15s ease,transform .15s ease,visibility .15s ease}.wp-estimate-tooltip-title{display:block;font-size:12px;font-weight:600;line-height:1.3}.wp-estimate-tooltip-group{display:flex;flex-direction:column;gap:4px}.wp-estimate-tooltip-item{display:block;color:#ffffffc7}.wp-estimate-tooltip-item:before{content:"- "}.wp-estimate-info:hover .wp-estimate-tooltip,.wp-estimate-info:focus .wp-estimate-tooltip,.wp-estimate-info:focus-visible .wp-estimate-tooltip{opacity:1;transform:translateY(0);visibility:visible}.wp-total{font-family:var( --wp-total-font-family, Sora, Inter, system-ui, -apple-system, sans-serif );font-size:36px;font-weight:600;line-height:1.25;letter-spacing:0;color:var(--wp-text);margin:0}.wp-svc-card{display:flex;flex-direction:column;gap:12px;width:100%}.wp-svc-card-head{display:flex;align-items:center;gap:6px}.wp-svc-card-icon{width:24px;height:24px;border-radius:4px;flex-shrink:0;object-fit:cover}.wp-svc-card-title{font-size:16px;font-weight:600;line-height:1.5;letter-spacing:0;color:var(--wp-text-60);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wp-svc-items{display:flex;flex-direction:column;gap:8px;width:100%;padding:0;border-radius:0;background:transparent;box-shadow:none;box-sizing:border-box}.wp-item{position:relative;display:flex;flex-direction:column;gap:20px;width:100%;padding:12px;border-radius:12px;background:var(--wp-card);box-shadow:var(--wp-card-shadow, none);box-sizing:border-box;color:inherit;text-decoration:none;cursor:pointer;outline:none;transition:opacity .15s ease}.wp-item+.wp-item{padding-top:12px;border-top:0}.wp-item:hover{opacity:.88}.wp-item-body{display:flex;flex-direction:column;gap:12px;min-width:0}.wp-order-head{display:flex;align-items:center;width:100%}.wp-item-line{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:21px;min-width:0}.wp-item-label{flex-shrink:0;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:0;color:var(--wp-text-30);white-space:nowrap}.wp-line-value,.wp-order-side{min-width:0;overflow:hidden;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:0;color:var(--wp-text-60);text-align:right;text-overflow:ellipsis;white-space:nowrap}.wp-order-side--buy{color:var(--wp-mint)}.wp-order-side--sell{color:var(--wp-red)}.wp-svc-token{display:flex;align-items:center;justify-content:flex-end;gap:6px;min-width:0;min-height:21px}.wp-svc-token>span{font-size:14px;font-weight:500;line-height:1.5;letter-spacing:0;color:var(--wp-text-60);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wp-svc-token-icon{width:16px;height:16px;border-radius:50%;flex-shrink:0;object-fit:cover}.wp-token-stack{display:inline-flex;align-items:center;justify-content:flex-end;width:29px;min-width:29px;overflow:visible}.wp-token-stack .wp-svc-token-icon+.wp-svc-token-icon{margin-left:-3.5px}.wp-token-subtle,.wp-item-usd{color:var(--wp-text-30)!important}.wp-order-token{display:flex;align-items:center;gap:8px;min-width:0}.wp-order-token .wp-svc-token-icon{width:32px;height:32px}.wp-order-token-meta{display:flex;min-width:0;flex-direction:column;justify-content:center}.wp-order-token-symbol{overflow:hidden;color:var(--wp-text-60);font-size:14px;font-weight:500;line-height:1.5;text-overflow:ellipsis;white-space:nowrap}.wp-order-token-pair{overflow:hidden;color:var(--wp-text-30);font-size:12px;font-weight:500;line-height:1.5;text-overflow:ellipsis;white-space:nowrap}.wp-item-tags{display:flex;align-items:stretch;gap:8px;width:100%}.wp-tag{appearance:none;display:inline-flex;flex:1 1 0;align-items:center;justify-content:center;gap:0;min-width:0;min-height:33px;padding:6px 10px;border-radius:6px;border:0;background:var(--wp-control);font-family:inherit;font-size:14px;font-weight:600;line-height:1.5;letter-spacing:0;color:var(--wp-text-40);text-align:center;text-decoration:none;white-space:nowrap;box-sizing:border-box;transition:background-color .15s ease,border-color .15s ease,color .15s ease,transform .15s ease}a.wp-tag,button.wp-tag{cursor:pointer}.wp-tag:hover{background:var(--wp-control);transform:none}.wp-tag:focus-visible{outline:2px solid var(--wp-mint);outline-offset:2px}.wp-tag[aria-disabled=true],.wp-tag[data-disabled]{cursor:default;opacity:.48;pointer-events:none}.wp-tag-label{display:inline-flex;align-items:center}.wp-tag-icon{display:none}.wp-tag:hover .wp-tag-icon{transform:none}.wp-tag--mint{color:var(--wp-mint);background:var(--wp-accent-soft)}.wp-tag--mint:hover{background:var(--wp-accent-soft)}.wp-tag--muted{color:var(--wp-text-40)}.wp-svc-empty{display:flex;align-items:center;justify-content:center;min-height:74px;padding:20px 16px;background:var(--wp-card);border-radius:12px;box-shadow:var(--wp-card-shadow, none);font-size:13px;font-weight:400;line-height:1.3;letter-spacing:0;color:var(--wp-text-30);box-sizing:border-box}.wp-claim-overlay{position:absolute;inset:0;z-index:8;display:flex;align-items:flex-end;justify-content:center;background:#00000094;box-sizing:border-box}.wp-claim-sheet{display:flex;flex-direction:column;width:100%;max-width:375px;max-height:calc(100% - 24px);overflow:hidden;border-radius:24px 24px 0 0;background:var(--wp-bg);color:var(--wp-text);box-shadow:0 -18px 48px #00000042;animation:wp-claim-slide-up .22s ease-out}@keyframes wp-claim-slide-up{0%{transform:translateY(18px);opacity:0}to{transform:translateY(0);opacity:1}}.wp-claim-grabber{display:flex;align-items:flex-start;justify-content:center;height:38px;min-height:38px;padding-top:12px;box-sizing:border-box}.wp-claim-grabber span{display:block;width:52px;height:5px;border-radius:999px;background:var(--wp-control)}.wp-claim-content{display:flex;flex-direction:column;align-items:center;gap:16px;width:100%;padding:20px;box-sizing:border-box}.wp-claim-icon{display:inline-flex;align-items:center;justify-content:center;width:64px;height:64px;border-radius:50%;flex-shrink:0}.wp-claim-icon--success{background:var(--wp-claim-success-soft);color:var(--wp-claim-success)}.wp-claim-icon--pending{background:#9b8cef29;color:var(--wp-claim-primary)}.wp-claim-icon--error{background:var(--wp-claim-error-soft);color:var(--wp-claim-error);font-size:30px;font-weight:600;line-height:1}.wp-claim-icon--token{background:#00d4aa29}.wp-claim-icon--token img{width:48px;height:48px;border-radius:50%;object-fit:cover}.wp-claim-icon--token span{display:inline-flex;align-items:center;justify-content:center;width:48px;height:48px;border-radius:50%;background:var(--wp-mint);color:#101820;font-size:18px;font-weight:600}.wp-claim-spinner{width:36px;height:36px;border-radius:50%;border:3px solid rgba(155,140,239,.28);border-top-color:var(--wp-claim-primary);animation:wp-claim-spin .8s linear infinite}@keyframes wp-claim-spin{to{transform:rotate(360deg)}}.wp-claim-copy{display:flex;flex-direction:column;align-items:center;gap:16px;width:100%;text-align:center}.wp-claim-title{margin:0;font-size:20px;font-weight:600;line-height:1.3;letter-spacing:0;color:var(--wp-text)}.wp-claim-desc{max-width:335px;margin:0;font-size:13px;font-weight:400;line-height:1.3;letter-spacing:0;color:var(--wp-text-40)}.wp-claim-heading{display:flex;flex-direction:column;align-items:flex-start;gap:8px;width:100%}.wp-claim-error-message{margin:0;color:var(--wp-claim-error);font-size:13px;font-weight:400;line-height:1.3;letter-spacing:0}.wp-claim-reward-card{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;min-height:60px;padding:16px;border-radius:8px;background:var(--wp-card);box-sizing:border-box}.wp-claim-reward-token{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:50%;flex-shrink:0;overflow:hidden;background:var(--wp-control)}.wp-claim-reward-token img{width:28px;height:28px;object-fit:cover}.wp-claim-reward-token span{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;background:var(--wp-mint);color:#101820;font-size:13px;font-weight:600;line-height:1}.wp-claim-reward-symbol{flex:1 1 auto;min-width:0;overflow:hidden;color:var(--wp-text);font-size:18px;font-weight:600;line-height:1.3;letter-spacing:0;text-overflow:ellipsis;white-space:nowrap}.wp-claim-reward-amount{flex-shrink:0;color:var(--wp-text);font-size:20px;font-weight:600;line-height:1.3;letter-spacing:0;white-space:nowrap}.wp-claim-account-card{display:flex;flex-direction:column;gap:12px;width:100%;padding:16px;border-radius:8px;background:var(--wp-card);box-sizing:border-box}.wp-claim-account-row{display:flex;align-items:center;justify-content:space-between;gap:4px;width:100%;min-height:40px}.wp-claim-account-row>span{flex-shrink:0;color:var(--wp-text-40);font-size:14px;font-weight:400;line-height:1.3;letter-spacing:0;white-space:nowrap}.wp-claim-account{display:flex;align-items:center;gap:8px;min-width:0}.wp-claim-account strong{overflow:hidden;color:var(--wp-text);font-size:15px;font-weight:600;line-height:1.6;letter-spacing:0;text-overflow:ellipsis;white-space:nowrap}.wp-claim-account-avatar{width:32px;height:32px;border-radius:50%;flex-shrink:0;background:radial-gradient(circle at 30% 28%,#d87aff 0 12%,transparent 13%),radial-gradient(circle at 68% 28%,#f0a1ff 0 12%,transparent 13%),radial-gradient(circle at 32% 70%,#b561e7 0 13%,transparent 14%),radial-gradient(circle at 70% 70%,#d4a2ff 0 13%,transparent 14%),radial-gradient(circle at 50% 50%,#8c4fc4 0 18%,transparent 19%),#4a315f;box-shadow:inset 0 0 0 3.37px var(--wp-control)}.wp-claim-divider{display:block;width:100%;height:1px;background:var(--wp-border)}.wp-claim-detail-list{display:flex;flex-direction:column;gap:8px;width:100%}.wp-claim-detail-row{display:flex;align-items:center;justify-content:space-between;gap:20px;width:100%;min-height:20px}.wp-claim-detail-row>span{min-width:0;color:var(--wp-text-40);font-size:13px;font-weight:400;line-height:1.3;letter-spacing:0;white-space:nowrap}.wp-claim-detail-row--sub>span:before{content:"";display:inline-block;width:3px;height:3px;margin:0 8px 3px;background:currentColor}.wp-claim-detail-row strong{min-width:0;overflow:hidden;color:var(--wp-text);font-size:13px;font-weight:400;line-height:1.3;letter-spacing:0;text-align:right;text-overflow:ellipsis;white-space:nowrap}.wp-claim-list{display:flex;flex-direction:column;gap:8px;width:100%;padding-bottom:8px}.wp-claim-list-item{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:56px;padding:8px 16px;border-radius:8px;background:var(--wp-card);box-sizing:border-box}.wp-claim-list-item>span{flex-shrink:0;font-size:14px;font-weight:400;line-height:1.3;color:var(--wp-text-40);white-space:nowrap}.wp-claim-list-item strong{display:inline-flex;align-items:center;justify-content:flex-end;gap:4px;min-width:0;overflow:hidden;color:var(--wp-text);font-size:14px;font-weight:400;line-height:1.3;text-align:right;text-overflow:ellipsis;white-space:nowrap}.wp-claim-list-item img{width:16px;height:16px;border-radius:50%;flex-shrink:0}.wp-claim-hash{appearance:none;display:inline-flex;align-items:center;justify-content:flex-end;gap:4px;min-width:0;padding:0;border:none;background:transparent;color:var(--wp-text);cursor:pointer;font:inherit}.wp-claim-hash svg{flex-shrink:0;color:var(--wp-text-60)}.wp-claim-gas-card{display:flex;flex-direction:column;gap:4px;width:100%;padding:14px 16px;border-radius:8px;border:1px solid var(--wp-border);background:var(--wp-card);box-sizing:border-box}.wp-claim-gas-row{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:28px}.wp-claim-gas-row>span{min-width:0;font-size:12px;font-weight:400;line-height:1.3;color:var(--wp-text-40)}.wp-claim-gas-row strong{min-width:0;overflow:hidden;color:var(--wp-text);font-size:12px;font-weight:400;line-height:1.3;text-align:right;text-overflow:ellipsis;white-space:nowrap}.wp-claim-gas-row--primary{min-height:32px}.wp-claim-gas-row--primary>span,.wp-claim-gas-row--primary strong{font-size:14px;color:var(--wp-text)}.wp-claim-fee-label{position:relative;display:inline-flex;align-items:center;text-decoration:underline dotted;text-underline-offset:3px;cursor:help;overflow:visible!important}.wp-claim-fee-tooltip{position:absolute;left:0;bottom:calc(100% + 8px);z-index:2;width:min(260px,calc(100vw - 64px));padding:10px 12px;border-radius:8px;background:var(--wp-tooltip-bg);color:var(--wp-tooltip-text);box-shadow:0 12px 32px #0000003d;font-size:11px;font-weight:400;line-height:1.4;text-align:left;text-decoration:none;white-space:normal;opacity:0;pointer-events:none;transform:translateY(4px);visibility:hidden;transition:opacity .15s ease,transform .15s ease,visibility .15s ease}.wp-claim-fee-label:hover .wp-claim-fee-tooltip,.wp-claim-fee-label:focus .wp-claim-fee-tooltip,.wp-claim-fee-label:focus-visible .wp-claim-fee-tooltip{opacity:1;transform:translateY(0);visibility:visible}.wp-claim-actions{display:flex;align-items:center;gap:8px;width:100%}.wp-claim-primary,.wp-claim-secondary{appearance:none;display:inline-flex;align-items:center;justify-content:center;width:100%;min-width:0;height:52px;padding:0 24px;border:none;border-radius:40px;font-family:inherit;font-size:15px;font-weight:600;line-height:1.3;letter-spacing:0;white-space:nowrap;cursor:pointer}.wp-claim-primary{background:var(--wp-claim-primary);color:var(--wp-claim-primary-text)}.wp-claim-primary:disabled{cursor:default;opacity:.72}.wp-claim-secondary{background:var(--wp-claim-secondary-bg, var(--wp-control));color:var(--wp-claim-primary)}.wp-claim-actions[data-count="2"] .wp-claim-primary{flex:1 1 0}.wp-claim-actions[data-count="2"] .wp-claim-secondary{flex:0 0 120px}.wp-claim-button-spinner{width:16px;height:16px;border-radius:50%;border:2px solid rgba(32,37,48,.28);border-top-color:var(--wp-claim-primary-text);animation:wp-claim-spin .8s linear infinite}.wp-claim-home-indicator{display:flex;align-items:flex-end;justify-content:center;height:34px;min-height:34px;padding-bottom:8px;box-sizing:border-box}.wp-claim-home-indicator span{display:block;width:134px;height:5px;border-radius:16px;background:var(--wp-text-40)}@media(max-width:359px){.wp-header{gap:12px;padding:0 12px}.wp-total{font-size:24px}.wp-body-inner{padding:0 12px 128px;gap:20px}.wp-svc-items,.wp-claim-content{padding:18px 14px}.wp-item-line{gap:10px}.wp-svc-token>span{max-width:168px}}.wp-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.wi-drawer-content .wp-header,.wi-portfolio-body .wp-header{padding:16px}.wi-drawer-content .wp-header-edge--right .wp-header-btn,.wi-portfolio-body .wp-header-edge--right .wp-header-btn{top:16px;right:16px}
8
+ `);var le=require("react/jsx-runtime"),dr=5,bc="wp:";function Jt({env:e,theme:t="light",walletAddress:n,onBack:o,showHeader:r=!0,variant:s="embed",className:a,onOutlink:l,lpBalanceReader:p}){let d=Ie(e),f=!!n,m=(0,ja.useQueryClient)(),[,g]=ut.useState(dr),[h,x]=ut.useState(!1),y=ut.useCallback(()=>{m.invalidateQueries({predicate:E=>typeof E.queryKey[0]=="string"&&E.queryKey[0].startsWith(bc)})},[m]),w=ut.useCallback(()=>{y(),x(!0),setTimeout(()=>x(!1),600),g(dr)},[y]);ut.useEffect(()=>{if(!f)return;let E=setInterval(()=>{g(T=>T<=1?(w(),dr):T-1)},1e3);return()=>clearInterval(E)},[f,w]);let v=ut.useCallback(()=>{o?.()},[o]),I=ut.useMemo(()=>({env:d,theme:t,open:!0,walletAddress:n,close:v,onOutlink:l,lpBalanceReader:p}),[d,t,n,v,l,p]),u=(0,le.jsxs)(le.Fragment,{children:[r&&(0,le.jsxs)("div",{className:"wp-header",children:[(0,le.jsx)("div",{className:"wp-header-edge wp-header-edge--left",children:o?(0,le.jsx)("button",{type:"button",className:"wp-header-btn","aria-label":"Back",onClick:o,children:(0,le.jsx)(Lt,{size:24})}):(0,le.jsx)("span",{className:"wp-header-spacer","aria-hidden":!0})}),(0,le.jsx)("h2",{className:"wp-header-title",children:"Portfolio"}),(0,le.jsx)("div",{className:"wp-header-edge wp-header-edge--right",children:(0,le.jsx)("button",{type:"button",className:Y("wp-header-btn",o?void 0:"wp-refresh-btn"),"aria-label":o?"Close portfolio":"Refresh portfolio",onClick:o??w,children:o?(0,le.jsx)(sa,{}):(0,le.jsx)(aa,{className:h?"wp-spin-once":void 0})})})]}),(0,le.jsx)("div",{className:"wp-body",children:(0,le.jsxs)("div",{className:"wp-body-inner",children:[(0,le.jsx)(ya,{}),(0,le.jsx)(Ea,{}),(0,le.jsx)(Oa,{}),(0,le.jsx)($a,{})]})})]});return(0,le.jsx)(Rn.Provider,{value:I,children:s==="none"?u:(0,le.jsx)("div",{className:Y(s==="fullscreen"?"wp-fullscreen":"wp-embed",a),"data-theme":t,children:u})})}var en=require("react/jsx-runtime");function Va({className:e}){let{env:t,theme:n,walletAddress:o,close:r,onOutlink:s,lpBalanceReader:a}=it();return(0,en.jsxs)(Ln.Drawer.Portal,{children:[(0,en.jsx)(Ln.Drawer.Overlay,{className:"wp-overlay"}),(0,en.jsxs)(Ln.Drawer.Content,{className:Y("wp-fullscreen",e),"data-theme":n,children:[(0,en.jsx)(Ln.Drawer.Title,{className:"wp-sr-only",children:"Portfolio"}),(0,en.jsx)(Jt,{env:t,theme:n,walletAddress:o,onBack:r,variant:"none",onOutlink:s,lpBalanceReader:a})]})]})}var pr=require("react/jsx-runtime");function wc({env:e,theme:t="light",walletAddress:n,open:o,onOpenChange:r,onOutlink:s,lpBalanceReader:a,children:l}){let p=Ie(e),d=o!==void 0,[f,m]=tn.useState(!1),g=d?o:f,h=tn.useCallback(w=>{d||m(w),r?.(w)},[d,r]),x=tn.useCallback(()=>h(!1),[h]),y=tn.useMemo(()=>({env:p,theme:t,open:g,walletAddress:n,close:x,onOutlink:s,lpBalanceReader:a}),[p,t,g,n,x,s,a]);return(0,pr.jsx)(Rn.Provider,{value:y,children:(0,pr.jsx)(qa.Drawer.Root,{direction:"bottom",open:g,onOpenChange:h,noBodyStyles:!0,children:l})})}var fr=Object.assign(wc,{Trigger:ia,Content:Va});var k=D(require("react"),1),nn=require("react-dom"),Pt=D(require("bignumber.js"),1);var Be=require("react/jsx-runtime");function Ka({size:e=20,className:t}){return(0,Be.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,"aria-hidden":"true",children:[(0,Be.jsx)("circle",{cx:"9",cy:"9",r:"6",stroke:"currentColor",strokeWidth:1.7}),(0,Be.jsx)("path",{d:"m17 17-3.2-3.2",stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round"})]})}function Qa({size:e=16,className:t}){return(0,Be.jsx)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,Be.jsx)("path",{d:"M2.667 8a5.333 5.333 0 1 0 1.562-3.771L2.667 5.79M2.667 2.667v3.124h3.124M8 5.333V8l1.667 1",stroke:"currentColor",strokeWidth:1.333,strokeLinecap:"round",strokeLinejoin:"round"})})}function Za({size:e=16,className:t}){return(0,Be.jsx)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,Be.jsx)("path",{d:"M2.667 4h4M9.333 4h4M6.667 2.667v2.666M2.667 12h4M9.333 12h4M9.333 10.667v2.666M2.667 8h1.666M7 8h6.333M4.333 6.667v2.666",stroke:"currentColor",strokeWidth:1.333,strokeLinecap:"round",strokeLinejoin:"round"})})}function Ya({size:e=20,className:t}){return(0,Be.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,Be.jsx)("path",{d:"M10 4.167v11.666M4.167 10 10 15.833 15.833 10",stroke:"currentColor",strokeWidth:1.667,strokeLinecap:"round",strokeLinejoin:"round"})})}function Xa({size:e=16,className:t}){return(0,Be.jsx)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,"aria-hidden":"true",children:(0,Be.jsx)("path",{d:"M3.333 8h9.334M8.667 4l4 4-4 4",stroke:"currentColor",strokeWidth:1.333,strokeLinecap:"round",strokeLinejoin:"round"})})}function Ja({size:e=12,className:t}){return(0,Be.jsx)("svg",{width:e,height:e,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,Be.jsx)("path",{d:"M3.5 2 1.5 4l2 2M1.5 4h9M8.5 10l2-2-2-2M10.5 8h-9",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"})})}var N=D(require("react"),1);var ur=D(require("bignumber.js"),1);function es(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function ts(e){return!e.isFinite()||e.isNaN()||e.lte(0)?"":e.decimalPlaces(6,ur.default.ROUND_DOWN).toFixed()}function xc(e){return e.fromToken.symbol.toLowerCase()===e.toToken.symbol.toLowerCase()||e.fromToken.chainId===e.toToken.chainId&&e.fromToken.address.toLowerCase()===e.toToken.address.toLowerCase()}function vc(e){let t=e.fromToken.priceUsd,n=e.toToken.priceUsd,o=e.lastChangedBy==="to"?e.toAmount:e.fromAmount,r=new ur.default(o||"0");return!r.isFinite()||r.isNaN()||r.lte(0)?{fromAmount:e.fromAmount,toAmount:e.toAmount}:es(t)&&es(n)?e.lastChangedBy==="to"?{fromAmount:ts(r.multipliedBy(n).dividedBy(t))}:{toAmount:ts(r.multipliedBy(t).dividedBy(n))}:xc(e)?e.lastChangedBy==="to"?{fromAmount:e.toAmount}:{toAmount:e.fromAmount}:{fromAmount:e.lastChangedBy==="to"?"":e.fromAmount,toAmount:e.lastChangedBy==="from"?"":e.toAmount}}function ns({getQuote:e,submitBridge:t}){return{canQuote:!!e,canSubmit:!!t,async getQuote(n){return e?e(n):vc(n)},async submitBridge(n){if(!t)throw new Error("Bridge submit handler is not configured.");return t(n)}}}function mt(e,t){return!!e&&!!t&&e.chainId===t.chainId&&e.address.toLowerCase()===t.address.toLowerCase()}function vo(e){return e[0]}function mr(e,t,n,o){if(n&&!mt(n,t))return n;let r=t?o?.(t,e):void 0;if(r?.length)return r[0];if(!t)return e[1]??vo(e);let s=e.findIndex(l=>mt(l,t)),a=s>=0?e[s+1]:void 0;return a&&!mt(a,t)?a:e.find(l=>!mt(l,t))??t}function os({fromToken:e,toToken:t,fromAmount:n,toAmount:o,lastChangedBy:r,slippage:s}){return{fromToken:e,toToken:t,fromAmount:n,toAmount:o,lastChangedBy:r,slippage:s}}function rs(e,t){let n=e instanceof Error?e.message:typeof e=="string"?e:"",o=e&&typeof e=="object"&&"code"in e?String(e.code):"",r=n.toLowerCase();return o==="4001"||r.includes("user rejected")||r.includes("user denied")||r.includes("rejected the request")||r.includes("request rejected")?"Transaction request was rejected.":n.split(`
9
+ `)[0]?.trim()||t}function is(e){let{tokens:t,initialFromToken:n,initialToToken:o,getToTokens:r,getApproval:s,approveBridge:a,history:l=[],initialSlippage:p="0.5",termsUrl:d,getQuote:f,submitBridge:m,onSubmitted:g,onSuccess:h,onFailed:x,onExit:y}=e,w=N.useMemo(()=>ns({getQuote:f,submitBridge:m}),[f,m]),[v,I]=N.useState("form"),[u,E]=N.useState(n??vo(t)),[T,M]=N.useState(()=>mr(t,n??vo(t),o,r)),[_,j]=N.useState(""),[H,J]=N.useState(""),[$,W]=N.useState("from"),[he,ye]=N.useState(p),[fe,ue]=N.useState(null),[We,re]=N.useState(""),[U,te]=N.useState("idle"),[Te,ee]=N.useState(""),[De,He]=N.useState(null),[Re,Ee]=N.useState([]),[gt,be]=N.useState(!1),[Nt,Ye]=N.useState(!1),[Xe,Ae]=N.useState(null),[Me,ke]=N.useState(!1),[pe,Se]=N.useState(null),[Tt,Je]=N.useState(null),[ht,Ce]=N.useState(!1),[Ge,bt]=N.useState(!1),_e=N.useRef(0),et=N.useRef(null),tt=N.useCallback(()=>{et.current&&(clearTimeout(et.current),et.current=null)},[]),Ue=N.useCallback(B=>{tt(),Je(B)},[tt]);N.useEffect(()=>tt,[tt]),N.useEffect(()=>{let B=t.find(me=>mt(me,u))??vo(t),ce=B?r?.(B,t):void 0,F=ce?.find(me=>mt(me,T))??(ce?void 0:t.find(me=>mt(me,T)))??mr(t,B,void 0,r);E(B),M(F)},[r,t,u,T]);let we=N.useCallback((B,ce)=>{let F=B.replace(/[^\d.]/g,"");ce==="from"?j(F):J(F),W(ce),re("")},[]),$e=N.useCallback(()=>{_e.current+=1,j(""),J(""),W("from"),ue(null),re(""),ee(""),te("idle"),Ae(null),ke(!1),Se(null),Ce(!1),Ue(null)},[Ue]),at=N.useCallback(B=>{mt(B,u)||(E(B),M(mr(t,B,void 0,r)),$e())},[u,r,$e,t]),wt=N.useCallback(B=>{mt(B,T)||mt(B,u)||(M(B),$e())},[u,$e,T]),je=N.useMemo(()=>u?r?.(u,t)??t.filter(B=>!mt(B,u)):[],[u,r,t]),Rt=N.useCallback(()=>{u?.balance&&we(u.balance,"from")},[u?.balance,we]),It=N.useCallback(()=>{!u||!T||(E(T),M(u),j(H),J(_),W($==="from"?"to":"from"),re(""))},[_,u,$,H,T]),nt=N.useCallback(()=>{_e.current+=1,j(""),J(""),W("from"),ue(null),re(""),ee("")},[]);N.useEffect(()=>{if(!u||!T)return;if(!_&&!H){ue(null),re(""),te("idle");return}let B=++_e.current,ce=os({fromToken:u,toToken:T,fromAmount:_,toAmount:H,lastChangedBy:$,slippage:he});te(w.canQuote?"quoting":"idle"),(async()=>{try{let F=await w.getQuote(ce);if(_e.current!==B)return;F.fromAmount!==void 0&&$==="to"&&j(F.fromAmount),F.toAmount!==void 0&&$==="from"&&J(F.toAmount),ue(F.summary??null),re(F.error??"")}catch(F){if(_e.current!==B)return;re(F instanceof Error?F.message:"Failed to quote bridge.")}finally{_e.current===B&&te("idle")}})()},[_,u,$,w,he,H,T]);let xt=N.useCallback(()=>!u||!T?null:os({fromToken:u,toToken:T,fromAmount:_,toAmount:H,lastChangedBy:$,slippage:he}),[_,u,$,he,H,T]),Oe=N.useCallback(async(B,ce)=>{ee(""),Ce(!1),ke(!1),te("submitting");try{if(!ce?.skipApprovalCheck&&s){let me=await s(B);if(me){Ae(me),Se(B),te("idle");return}}Ae(null),Se(null),Ue("processing");let F=await w.submitBridge(B);He(F),te("success"),Ee(me=>[{id:F.txHash,timestamp:new Date().toISOString(),txHash:F.txHash,fromToken:F.fromToken,toToken:F.toToken,fromAmount:F.fromAmount,toAmount:F.toAmount,summary:fe??void 0,status:"pending"},...me.filter(Ft=>Ft.txHash!==F.txHash)]),nt(),bt(!0),Ue(null),Ce(!0),g?.(F),h?.(F)}catch(F){let me=rs(F,"Failed to submit bridge.");Ue(null),ee(me),te("error"),x?.({message:me})}},[s,x,g,h,w,nt,Ue,fe]),st=N.useCallback(async()=>{if(We)return;let B=xt();if(B){if(!Nt){Se(B),be(!0);return}await Oe(B)}},[xt,We,Oe,Nt]),C=N.useCallback(async()=>{let B=pe??xt();B&&(Ye(!0),be(!1),await Oe(B))},[xt,pe,Oe]),V=N.useCallback(()=>{be(!1),Se(null)},[]),oe=N.useCallback(async()=>{if(!(U==="submitting"||!Xe||!pe||!a)){ee(""),te("submitting");try{await a(pe,Xe),Ae(null),te("idle"),ke(!0)}catch(B){let ce=rs(B,"Failed to approve token.");ee(ce),te("error"),x?.({message:ce})}}},[Xe,a,x,pe,Oe,U]),Ve=N.useCallback(()=>{U!=="submitting"&&(Ae(null),ke(!1),Se(null),te("idle"))},[U]),qe=N.useCallback(async()=>{U==="submitting"||!pe||(ke(!1),await Oe(pe,{skipApprovalCheck:!0}))},[pe,Oe,U]),Bt=N.useCallback(()=>{Ce(!1)},[]),bn=N.useCallback(B=>{I(B),B==="history"&&bt(!1)},[]),Ao=N.useCallback(()=>{if(v==="history"){bn("form");return}y?.()},[y,bn,v]),ot=N.useMemo(()=>[...l,...Re.filter(B=>!l.some(ce=>ce.txHash===B.txHash))],[l,Re]);return{step:v,setStep:bn,status:U,error:Te,quoteError:We,fromToken:u,toToken:T,tokens:t,availableToTokens:je,fromAmount:_,toAmount:H,lastChangedBy:$,slippage:he,setSlippage:ye,summary:fe,history:ot,submitted:De,canSubmit:w.canSubmit,termsOpen:gt,approvalInfo:Xe,approvalSuccessOpen:Me,approveBridge:a,pendingSubmitInput:pe,submitToast:Tt,successDialogOpen:ht,dismissSuccessDialog:Bt,hasNewHistory:Ge,termsUrl:d,setFromToken:E,setToToken:M,selectFromToken:at,selectToToken:wt,setAmount:we,setMax:Rt,swapTokens:It,submit:st,confirmTerms:C,cancelTerms:V,confirmApproval:oe,cancelApproval:Ve,continueAfterApproval:qe,back:Ao}}O(`.bf-root{--bf-bg: var(--ds-bg-default, #1e232e);--bf-surface: var(--ds-surface-medium, rgba(255, 255, 255, .05));--bf-surface-hover: var(--ds-surface-high, rgba(255, 255, 255, .08));--bf-border: var(--ds-border-default, rgba(255, 255, 255, .07));--bf-text-high: var(--ds-content-high, rgba(255, 255, 255, .85));--bf-text-medium: var(--ds-content-medium, rgba(255, 255, 255, .65));--bf-text-low: var(--ds-content-low, rgba(255, 255, 255, .4));--bf-toast-bg: #1e232e;--bf-toast-color: rgba(255, 255, 255, .85);position:relative;display:flex;flex:1;min-height:0;flex-direction:column;overflow:hidden;background:var(--bf-bg);color:var(--ds-content-highest, #ffffff);font-family:inherit}[data-theme=dark].wi-popover-content .bf-root,[data-theme=dark].wi-drawer-content .bf-root{--bf-bg: var(--ds-bg-default, #121212);--bf-surface: var(--ds-surface-medium, rgba(255, 255, 255, .05));--bf-surface-hover: var(--ds-surface-high, rgba(255, 255, 255, .1));--bf-border: var(--ds-border-default, rgba(255, 255, 255, .05));--bf-text-high: var(--ds-content-high, rgba(255, 255, 255, .85));--bf-text-medium: var(--ds-content-medium, rgba(255, 255, 255, .7));--bf-text-low: var(--ds-content-low, rgba(255, 255, 255, .5))}[data-theme=light].wi-popover-content .bf-root,[data-theme=light].wi-drawer-content .bf-root{--bf-bg: var(--ds-bg-default, #ffffff);--bf-surface: var(--ds-surface-medium, rgba(18, 18, 18, .05));--bf-surface-hover: var(--ds-surface-high, rgba(18, 18, 18, .1));--bf-border: var(--ds-border-default, rgba(18, 18, 18, .05));--bf-text-high: var(--ds-content-high, rgba(18, 18, 18, .85));--bf-text-medium: var(--ds-content-medium, rgba(18, 18, 18, .7));--bf-text-low: var(--ds-content-low, rgba(18, 18, 18, .5))}.bf-root[data-view=history]{background:var(--ds-bg-dim, #f5f7fa);color:var(--ds-content-high, rgba(0, 0, 0, .85))}.bf-header{position:relative;display:flex;flex-shrink:0;align-items:center;justify-content:space-between;padding:24px;border-bottom:1px solid var(--bf-border);background:var(--ds-bg-default, var(--bf-bg));box-sizing:border-box}.bf-root[data-view=history] .bf-header{padding:24px;border-bottom-color:var(--ds-border-default, rgba(0, 0, 0, .07));background:var(--ds-surface-default, #ffffff)}.bf-header-btn{display:inline-flex;width:24px;height:24px;flex-shrink:0;align-items:center;justify-content:center;padding:0;border:0;background:transparent;color:var(--ds-content-low, rgba(0, 0, 0, .4));cursor:pointer;transition:color .15s ease}.bf-header-btn:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.bf-header .bf-header-btn:last-child{position:absolute;top:24px;right:24px}.bf-header-title{position:absolute;left:50%;transform:translate(-50%);font-size:18px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--bf-text-high);white-space:nowrap}.bf-root[data-view=history] .bf-header-title{color:var(--ds-content-highest, #000000)}.bf-body,.bf-history-body{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;box-sizing:border-box}.bf-body{padding:24px}.bf-history-body{display:flex;flex-direction:column;gap:12px;padding:24px;background:var(--ds-bg-dim, #f5f7fa)}.bf-toolbar{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:12px}.bf-chip{display:inline-flex;align-items:center;gap:4px;min-height:33px;padding:6px 8px;border:0;border-radius:12px;background:var(--bf-surface);color:var(--bf-text-medium);font:inherit;font-size:14px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer}.bf-chip:hover{color:var(--bf-text-high);background:var(--bf-surface-hover)}.bf-chip-history{position:relative}.bf-chip-dot{position:absolute;top:4px;right:4px;width:6px;height:6px;border-radius:999px;background:var(--ds-system-red-default, #da0b2e)}.bf-swap-card{position:relative;display:flex;flex-direction:column;gap:12px;margin-bottom:12px}.bf-field-error{margin-top:-4px;color:var(--ds-system-red-default, #ff2b5f);font-size:13px;font-weight:500;line-height:1.5;letter-spacing:0}.bf-amount-panel{display:flex;min-height:110px;flex-direction:column;gap:8px;padding:16px;border:1px solid transparent;border-radius:12px;background:var(--bf-surface);box-sizing:border-box;transition:border-color .2s ease}.bf-amount-panel:hover{border-color:var(--bf-border)}.bf-amount-head{display:flex;align-items:center;justify-content:space-between;gap:8px;color:var(--bf-text-high);font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-balance{display:inline-flex;align-items:center;justify-content:flex-end;gap:4px;min-width:0;color:var(--bf-text-low);font-size:12px;white-space:nowrap}.bf-max-btn{padding:0;border:0;background:transparent;color:var(--bf-text-medium);font:inherit;font-size:12px;text-decoration:underline;cursor:pointer}.bf-amount-main{display:flex;align-items:center;justify-content:space-between;gap:12px}.bf-amount-input-wrap{display:flex;min-width:0;flex:1;flex-direction:column;gap:4px}.bf-amount-input{width:100%;min-width:0;padding:0;border:0;background:transparent;color:var(--bf-text-high);font:inherit;font-size:18px;font-weight:600;line-height:1.5;letter-spacing:-.01em;outline:none}.bf-amount-input::placeholder{color:var(--ds-content-lowest, rgba(0, 0, 0, .25))}.bf-amount-usd{color:var(--bf-text-low);font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-token-pill{display:inline-flex;flex-shrink:0;align-items:center;gap:6px;min-height:33px;padding:6px 8px 6px 6px;border:1px solid var(--bf-border);border-radius:9999px;background:var(--bf-bg);color:var(--bf-text-high);font:inherit;font-size:14px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer}.bf-token-pill:hover:not(:disabled){background:var(--bf-surface-hover)}.bf-token-pill:disabled{cursor:default;opacity:.6}.bf-token-icon{position:relative;display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;overflow:hidden;border-radius:0;background:var(--ds-accent-primary-default, #00ceb2);color:var(--ds-accent-primary-on, #000000);font-size:11px;font-weight:700}.bf-token-icon[data-has-image=true]{background:transparent}.bf-token-icon img{width:100%;height:100%;border-radius:0;object-fit:cover}.bf-token-fallback{line-height:1}.bf-token-picker-overlay{--bf-bg: #1e232e;--bf-surface: rgba(255, 255, 255, .05);--bf-surface-hover: rgba(255, 255, 255, .08);--bf-border: rgba(255, 255, 255, .07);--bf-text-high: rgba(255, 255, 255, .85);--bf-text-medium: rgba(255, 255, 255, .65);--bf-text-low: rgba(255, 255, 255, .4);position:fixed;inset:0;z-index:100002;display:flex;align-items:center;justify-content:center;padding:24px;background:#00000085;pointer-events:auto;box-sizing:border-box}.bf-token-picker-overlay[data-theme=light]{--bf-bg: #ffffff;--bf-surface: rgba(18, 18, 18, .05);--bf-surface-hover: rgba(18, 18, 18, .08);--bf-border: rgba(18, 18, 18, .07);--bf-text-high: rgba(18, 18, 18, .85);--bf-text-medium: rgba(18, 18, 18, .65);--bf-text-low: rgba(18, 18, 18, .4)}.bf-token-picker{display:flex;width:min(480px,calc(100vw - 48px));height:min(466px,calc(100dvh - 48px));max-height:calc(100dvh - 48px);min-height:0;flex-direction:column;overflow:hidden;border:1px solid var(--bf-border);border-radius:24px;background:var(--bf-bg);color:var(--bf-text-high);box-shadow:0 24px 80px #0006;box-sizing:border-box}.bf-token-picker-handle{display:none}.bf-token-picker-head{position:relative;display:flex;min-height:73px;flex-shrink:0;align-items:center;justify-content:flex-start;padding:24px 56px 24px 24px;border-bottom:1px solid var(--bf-border);box-sizing:border-box}.bf-token-picker-head h3{margin:0;color:var(--bf-text-high);font-size:20px;font-weight:600;line-height:1.25;letter-spacing:0}.bf-token-picker-close{position:absolute;top:24px;right:24px;display:inline-flex;width:24px;height:24px;align-items:center;justify-content:center;padding:0;border:0;background:transparent;color:var(--bf-text-medium);cursor:pointer}.bf-token-picker-close:hover{color:var(--bf-text-high)}.bf-token-search{display:flex;min-height:48px;flex-shrink:0;align-items:center;gap:8px;margin:16px 24px;padding:12px 16px;border:1px solid transparent;border-radius:12px;background:var(--ds-surface-medium, rgba(18, 18, 18, .05));color:var(--bf-text-low);box-sizing:border-box}.bf-token-search:focus-within{border-color:var(--ds-accent-primary-default, #00ceb2)}.bf-token-search input{width:100%;min-width:0;padding:0;border:0;outline:0;background:transparent;color:var(--bf-text-high);font:inherit;font-size:16px;font-weight:500;line-height:1.5;letter-spacing:0}.bf-token-search input::placeholder{color:var(--bf-text-low)}.bf-token-list{display:flex;min-height:0;flex:1;flex-direction:column;gap:0;overflow-y:auto;overflow-x:hidden;padding:0 24px 24px;scrollbar-width:thin;box-sizing:border-box}.bf-token-row{position:relative;display:flex;width:100%;min-height:69px;align-items:center;justify-content:space-between;gap:12px;padding:12px;border:1px solid transparent;border-radius:12px;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer;box-sizing:border-box}.bf-token-row:hover:not([data-selected=true]){background:var(--ds-surface-medium, rgba(18, 18, 18, .05))}.bf-token-row[data-selected=true]{border-color:var(--ds-accent-primary-default, #00b4b7);background:var(--ds-surface-medium, rgba(18, 18, 18, .05))}.bf-token-row-left{display:inline-flex;min-width:0;align-items:center;gap:16px}.bf-token-meta{display:flex;min-width:0;flex-direction:column}.bf-token-symbol{overflow:hidden;color:var(--bf-text-high);font-size:16px;font-weight:600;line-height:1.5;letter-spacing:0;text-overflow:ellipsis;white-space:nowrap}.bf-token-name{overflow:hidden;color:var(--bf-text-low);font-size:12px;font-weight:500;line-height:1.5;letter-spacing:0;text-overflow:ellipsis;white-space:nowrap}.bf-token-row-right{display:flex;min-width:86px;max-width:42%;flex-shrink:0;flex-direction:column;align-items:flex-end}.bf-token-balance,.bf-token-price{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bf-token-balance{color:var(--bf-text-high);font-size:14px;font-weight:600;line-height:1.5;letter-spacing:0}.bf-token-price{color:var(--bf-text-low);font-size:12px;font-weight:500;line-height:1.5;letter-spacing:0}.bf-token-row[data-selected=true] .bf-token-symbol{color:var(--bf-text-high)}.bf-token-row[data-selected=true] .bf-token-balance{color:var(--bf-text-high);font-size:16px}.bf-token-row[data-selected=true] .bf-token-price{color:var(--bf-text-low);font-size:14px}.bf-token-empty{padding:32px 16px;color:var(--bf-text-low);font-size:14px;font-weight:500;line-height:1.5;text-align:center}.bf-slippage-overlay{position:fixed;inset:0;z-index:100002;display:flex;align-items:center;justify-content:center;padding:24px;background:#00000085;pointer-events:auto;box-sizing:border-box}.bf-slippage-dialog{display:flex;width:min(480px,calc(100vw - 48px));height:min(316px,calc(100dvh - 48px));max-height:calc(100dvh - 48px);min-height:0;flex-direction:column;overflow:hidden;border:1px solid var(--ds-border-medium, rgba(0, 0, 0, .18));border-radius:24px;background:var(--ds-surface-default, #ffffff);color:var(--ds-content-highest, #000000);box-shadow:var(--ds-shadow-modal, 0 4px 30px -1px rgba(0, 0, 0, .15));box-sizing:border-box}.bf-slippage-head{position:relative;display:flex;min-height:73px;flex-shrink:0;align-items:center;justify-content:flex-start;padding:24px 56px 24px 24px;border-bottom:1px solid var(--ds-border-default, rgba(0, 0, 0, .07));background:var(--ds-surface-default, #ffffff);box-sizing:border-box}.bf-slippage-head h3{margin:0;color:var(--ds-content-highest, #000000);font-size:20px;font-weight:600;line-height:1.25;letter-spacing:0}.bf-slippage-close{position:absolute;top:24px;right:24px;display:inline-flex;width:24px;height:24px;align-items:center;justify-content:center;padding:0;border:0;background:transparent;color:var(--ds-content-low, rgba(0, 0, 0, .4));cursor:pointer}.bf-slippage-close:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.bf-slippage-body{display:flex;flex:1;min-height:0;flex-direction:column;gap:24px;padding:24px;box-sizing:border-box}.bf-slippage-desc{margin:0;color:var(--ds-content-medium, rgba(0, 0, 0, .65));font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-slippage-controls{display:flex;flex-direction:column;gap:12px;width:100%}.bf-slippage-presets{display:flex;gap:8px;width:100%}.bf-slippage-preset{appearance:none;display:inline-flex;flex:1 1 0;min-width:0;min-height:48px;align-items:center;justify-content:center;padding:12px 8px;border:1px solid transparent;border-radius:12px;background:var(--ds-surface-medium, #f5f7fa);color:var(--ds-content-medium, rgba(0, 0, 0, .65));font:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer;box-sizing:border-box}.bf-slippage-preset:hover,.bf-slippage-preset[data-selected=true]{border-color:var(--ds-accent-primary-default, #00b4b7);background:var(--ds-accent-primary-low, #e7f9f8)}.bf-slippage-custom{display:flex;min-height:48px;align-items:center;gap:8px;padding:12px;border:1px solid transparent;border-radius:12px;background:var(--ds-surface-medium, #f5f7fa);color:var(--ds-content-high, rgba(0, 0, 0, .85));box-sizing:border-box}.bf-slippage-custom:focus-within,.bf-slippage-custom[data-selected=true]{border-color:var(--ds-accent-primary-default, #00b4b7)}.bf-slippage-custom input{width:100%;min-width:0;padding:0;border:0;outline:0;background:transparent;color:var(--ds-content-high, rgba(0, 0, 0, .85));font:inherit;font-size:16px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-slippage-custom input::placeholder{color:var(--ds-content-lowest, rgba(0, 0, 0, .25))}.bf-slippage-custom span:not(.bf-sr-only){flex-shrink:0;color:var(--ds-content-high, rgba(0, 0, 0, .85));font-size:16px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-slippage-apply{appearance:none;margin-top:auto;width:100%;min-height:48px;padding:12px;border:0;border-radius:12px;background:var(--ds-accent-primary-default, #00b4b7);color:var(--ds-accent-primary-on-primary, #ffffff);font:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer;box-sizing:border-box}.bf-slippage-apply:hover{filter:brightness(.96)}.bf-action-modal-overlay{--bf-bg: var(--ds-bg-default, #1e232e);--bf-surface: var(--ds-surface-medium, rgba(255, 255, 255, .05));--bf-surface-hover: var(--ds-surface-high, rgba(255, 255, 255, .08));--bf-border: var(--ds-border-default, rgba(255, 255, 255, .12));--bf-text-high: var(--ds-content-high, rgba(255, 255, 255, .92));--bf-text-medium: var(--ds-content-medium, rgba(255, 255, 255, .65));--bf-text-low: var(--ds-content-low, rgba(255, 255, 255, .4));position:fixed;inset:0;z-index:100003;display:flex;align-items:center;justify-content:center;padding:24px;background:#040912b8;pointer-events:auto;box-sizing:border-box}.bf-action-modal-overlay[data-theme=light]{--bf-bg: var(--ds-bg-default, #ffffff);--bf-surface: var(--ds-surface-medium, rgba(18, 18, 18, .05));--bf-surface-hover: var(--ds-surface-high, rgba(18, 18, 18, .1));--bf-border: var(--ds-border-default, rgba(18, 18, 18, .08));--bf-text-high: var(--ds-content-high, rgba(18, 18, 18, .85));--bf-text-medium: var(--ds-content-medium, rgba(18, 18, 18, .65));--bf-text-low: var(--ds-content-low, rgba(18, 18, 18, .4))}.bf-action-modal{display:flex;width:min(480px,calc(100vw - 48px));flex-direction:column;align-items:center;gap:24px;padding:48px 24px 24px;border:1px solid var(--bf-border);border-radius:24px;background:var(--bf-bg);color:#fff;box-shadow:0 24px 80px #00000073;box-sizing:border-box}.bf-action-modal h3{width:100%;margin:0;color:var(--bf-text-high);font-size:24px;font-weight:700;line-height:1.25;text-align:center;letter-spacing:0}.bf-action-modal-desc{max-width:380px;margin:0;color:var(--bf-text-low);font-size:15px;font-weight:500;line-height:1.45;text-align:center;letter-spacing:0}.bf-terms-check-row{display:grid;width:100%;min-height:56px;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:12px;padding:14px 16px;border:none;border-radius:12px;background:var(--bf-surface);color:var(--bf-text-medium);font-size:16px;font-weight:700;line-height:1.4;box-sizing:border-box;cursor:pointer;touch-action:manipulation;user-select:none}.bf-terms-check-button{appearance:none;display:grid;min-width:0;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:12px;padding:0;border:0;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer;touch-action:manipulation}.bf-terms-check-button:focus-visible .bf-terms-checkbox{outline:2px solid var(--ds-accent-primary-default, #00ceb2);outline-offset:2px}.bf-terms-checkbox{position:relative;display:inline-flex;width:20px;height:20px;align-items:center;justify-content:center;border:1px solid rgba(124,143,180,.72);border-radius:5px;background:transparent;box-sizing:border-box}.bf-terms-checkbox[data-checked=true]{border-color:var(--ds-accent-primary-default, #00ceb2);background:var(--ds-accent-primary-default, #00ceb2)}.bf-terms-checkbox[data-checked=true]:after{width:8px;height:4px;border:solid var(--ds-accent-primary-on, #000000);border-width:0 0 2px 2px;content:"";transform:rotate(-45deg) translate(1px,-1px)}.bf-terms-check-row a{position:relative;z-index:1;color:var(--ds-accent-primary-default, #00ceb2);font-size:14px;font-weight:700;text-decoration:none;white-space:nowrap}.bf-terms-privacy{max-width:380px;margin:0;color:var(--bf-text-low);font-size:15px;font-weight:500;line-height:1.45;text-align:center;letter-spacing:0}.bf-action-primary,.bf-action-secondary{display:inline-flex;width:100%;min-height:56px;align-items:center;justify-content:center;padding:14px 16px;border:0;border-radius:12px;font:inherit;font-size:18px;font-weight:700;line-height:1.4;letter-spacing:0;cursor:pointer}.bf-action-primary{background:var(--ds-accent-primary-default, #00ceb2);color:var(--ds-accent-primary-on, #000000)}.bf-action-primary:disabled{cursor:not-allowed;opacity:.35}.bf-action-primary[aria-busy=true]{gap:8px;opacity:1}.bf-action-button-spinner{width:18px;height:18px;border:2px solid rgba(0,0,0,.22);border-top-color:currentColor;border-right-color:currentColor;border-radius:999px;animation:bf-loading-spin .9s linear infinite}.bf-action-secondary{background:var(--bf-surface);color:var(--bf-text-low)}.bf-action-secondary:disabled{cursor:not-allowed;opacity:.5}.bf-approve-address-box{display:flex;width:100%;flex-direction:column;gap:10px;padding:16px;border:1px solid var(--bf-border);border-radius:12px;background:var(--bf-surface);box-sizing:border-box}.bf-approve-address-box>span{color:var(--bf-text-low);font-size:14px;font-weight:700;line-height:1.4}.bf-approve-address-box>div{display:flex;min-width:0;align-items:center;justify-content:space-between;gap:12px}.bf-approve-address-box strong{min-width:0;overflow:hidden;color:var(--bf-text-high);font-size:15px;font-weight:500;line-height:1.5;text-overflow:ellipsis;white-space:nowrap}.bf-copy-button{flex-shrink:0;min-width:48px;min-height:32px;padding:6px 10px;border:1px solid rgba(0,206,178,.65);border-radius:8px;background:transparent;color:var(--ds-accent-primary-default, #00ceb2);font:inherit;font-size:12px;font-weight:700;line-height:1.2;cursor:pointer}.bf-copy-button:disabled{cursor:not-allowed;opacity:.45}.bf-action-buttons{display:grid;width:100%;grid-template-columns:1fr 1fr;gap:12px}.bf-approval-success-modal{gap:28px}.bf-success-mark{position:relative;display:inline-flex;width:96px;height:96px;flex-shrink:0;align-items:center;justify-content:center;border:12px solid rgba(0,206,178,.12);border-radius:999px;background:#00ceb2a8;box-shadow:0 0 0 10px #00ceb20f;box-sizing:border-box}.bf-success-mark:after{width:34px;height:18px;border:solid #ffffff;border-width:0 0 6px 6px;content:"";transform:rotate(-45deg) translate(2px,-3px)}.bf-status-toast{position:absolute;right:16px;bottom:14px;left:16px;z-index:5;display:flex;align-items:center;gap:12px;min-height:52px;padding:12px;border-radius:12px;background:var(--bf-toast-bg, #1e232e);color:var(--bf-toast-color, rgba(255, 255, 255, .85));box-shadow:0 8px 24px #0000003d;box-sizing:border-box}.bf-status-toast-icon{display:inline-flex;width:28px;height:28px;flex-shrink:0;align-items:center;justify-content:center;border-radius:999px}.bf-status-spinner{width:20px;height:20px;border:3px solid rgba(255,255,255,.18);border-top-color:var(--ds-accent-primary-default, #00ceb2);border-right-color:var(--ds-accent-primary-default, #00ceb2);border-radius:999px;animation:bf-loading-spin .9s linear infinite}.bf-status-check{position:relative;width:20px;height:20px;border-radius:999px;background:var(--ds-accent-primary-default, #00ceb2)}.bf-status-check:after{position:absolute;top:6px;left:5px;width:8px;height:4px;border:solid var(--ds-accent-primary-on, #000000);border-width:0 0 2px 2px;content:"";transform:rotate(-45deg)}.bf-status-toast-copy{display:flex;min-width:0;flex:1;flex-direction:column}.bf-status-toast-copy strong,.bf-status-toast-copy span{overflow:hidden;text-overflow:ellipsis}.bf-status-toast-copy strong{color:var(--ds-content-inverted, #ffffff);font-size:14px;font-weight:600;line-height:1.5;letter-spacing:-.01em}.bf-status-toast-copy span{color:var(--ds-content-inverted, #ffffff);font-size:12px;font-weight:400;line-height:1.5;letter-spacing:-.01em}.bf-status-toast[data-variant=success] .bf-status-toast-copy span{color:var(--ds-accent-primary-on-inverted, #00e8c9)}.bf-status-toast[data-variant=error]{border:1px solid rgba(255,43,95,.28);background:var(--bf-toast-bg, #1e232e)}.bf-status-toast[data-variant=error] .bf-status-toast-copy strong{color:#fff}.bf-status-error-mark{display:inline-flex;width:24px;height:24px;align-items:center;justify-content:center;border-radius:999px;background:var(--ds-system-red-default, #ff2b5f);color:#fff;font-size:14px;font-weight:700;line-height:1}.bf-status-toast[data-variant=error] .bf-status-toast-copy span{color:#ffffffe0}.bf-success-overlay{--bf-bg: var(--ds-bg-default, #1e232e);--bf-border: var(--ds-border-default, rgba(255, 255, 255, .12));--bf-text-high: var(--ds-content-high, rgba(255, 255, 255, .92));--bf-text-medium: var(--ds-content-medium, rgba(255, 255, 255, .65));position:fixed;inset:0;z-index:100003;display:flex;align-items:center;justify-content:center;padding:24px;background:#000000b8;pointer-events:auto;box-sizing:border-box}.bf-success-overlay[data-theme=light]{--bf-bg: #ffffff;--bf-border: rgba(18, 18, 18, .08);--bf-text-high: rgba(18, 18, 18, .85);--bf-text-medium: rgba(18, 18, 18, .65);--bf-text-low: rgba(18, 18, 18, .4)}.bf-success-modal{display:flex;width:min(480px,calc(100vw - 48px));flex-direction:column;overflow:hidden;border:1px solid var(--bf-border);border-radius:24px;background:var(--bf-bg);color:var(--bf-text-high);box-shadow:0 24px 80px #00000073;box-sizing:border-box}.bf-success-head{display:flex;min-height:73px;align-items:center;justify-content:space-between;gap:16px;padding:24px;border-bottom:1px solid var(--ds-border-default, rgba(0, 0, 0, .07));box-sizing:border-box}.bf-success-head h3{min-width:0;margin:0;overflow:hidden;color:var(--ds-content-highest, #000000);font-size:20px;font-weight:600;line-height:1.25;text-overflow:ellipsis;white-space:nowrap}.bf-success-close{display:inline-flex;width:24px;height:24px;flex-shrink:0;align-items:center;justify-content:center;padding:0;border:0;background:transparent;color:var(--ds-content-low, rgba(0, 0, 0, .4));cursor:pointer}.bf-success-close:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.bf-success-body{display:flex;flex-direction:column;align-items:center;gap:24px;padding:40px 24px 24px;box-sizing:border-box}.bf-success-copy{display:flex;width:100%;flex-direction:column;align-items:center;gap:4px;color:var(--bf-text-medium);text-align:center}.bf-success-copy strong{color:var(--bf-text-high);font-size:24px;font-weight:700;line-height:1.25;letter-spacing:0}.bf-success-copy span{color:var(--bf-text-medium);font-size:15px;font-weight:500;line-height:1.5;letter-spacing:0}.bf-success-route{display:flex;align-items:center;justify-content:center;gap:12px}.bf-success-route .bf-token-icon{width:48px!important;height:48px!important;background:transparent;font-size:18px}.bf-success-route-arrow{color:var(--bf-text-low);font-size:24px;font-weight:500;line-height:1}.bf-success-ok{display:inline-flex;width:100%;min-height:48px;align-items:center;justify-content:center;padding:12px;border:0;border-radius:12px;background:#00b4b7e0;color:#fff;font:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer}@media(max-width:767px){.bf-success-body{padding:40px 24px 24px}.bf-success-copy strong{font-size:22px}.bf-success-copy span{font-size:14px}.bf-success-mark{width:88px;height:88px}.bf-success-route .bf-token-icon{width:44px!important;height:44px!important}}@keyframes bf-loading-spin{to{transform:rotate(360deg)}}.bf-swap-toggle{position:absolute;top:100px;left:50%;z-index:1;display:inline-flex;width:32px;height:32px;align-items:center;justify-content:center;padding:0;border:0;border-radius:9999px;background:var(--ds-accent-primary-default, #00ceb2);color:var(--ds-accent-primary-on, #000000);box-shadow:0 1px 5px #0000001f;cursor:pointer}.bf-swap-card[data-has-from-error=true] .bf-swap-toggle{top:132px}.bf-details{display:flex;flex-direction:column;gap:24px}.bf-exchange-rate{display:flex;width:100%;align-items:center;justify-content:center;gap:4px;padding:0 0 24px;border:0;background:transparent;color:var(--bf-text-low);font:inherit;font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em;cursor:pointer}.bf-exchange-rate:hover{color:var(--bf-text-medium)}.bf-detail-section,.bf-history-card{display:flex;flex-direction:column;gap:12px;padding:0;border-radius:12px;background:transparent;box-sizing:border-box}.bf-liquidity{display:flex;flex-direction:column;gap:12px;padding:16px;border-radius:12px;background:var(--bf-surface);box-sizing:border-box}.bf-root[data-view=history] .bf-liquidity,.bf-root[data-view=history] .bf-detail-section,.bf-root[data-view=history] .bf-history-card{background:var(--ds-surface-default, #ffffff)}.bf-detail-section h3{margin:0;color:var(--bf-text-high);font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em}.bf-tx-fee-section{gap:12px}.bf-tx-fee-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.bf-collapse-head{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;margin:0;padding:0;background:none;border:none;color:inherit;font:inherit;text-align:left;cursor:pointer}.bf-detail-section[data-open=true] .bf-collapse-head{padding-bottom:12px;border-bottom:1px solid var(--bf-border)}.bf-collapse-chevron{flex-shrink:0;color:var(--bf-text-low);transition:transform .2s ease}.bf-detail-section[data-open=true] .bf-collapse-chevron{transform:rotate(180deg)}.bf-collapse-body{display:flex;flex-direction:column;gap:14px}.bf-root[data-view=history] .bf-detail-section[data-open=true] .bf-collapse-head{border-bottom-color:var(--ds-border-default, rgba(0, 0, 0, .07))}.bf-root[data-view=history] .bf-collapse-chevron{color:var(--ds-content-low, rgba(0, 0, 0, .4))}.bf-tx-fee-total{display:inline-flex;align-items:center;justify-content:flex-end;gap:8px;min-width:0;color:var(--bf-text-medium);font-size:14px;font-weight:600;line-height:1.4;text-align:right}.bf-tx-fee-total>span:last-child[data-delegated=true]{text-decoration:line-through;text-decoration-thickness:2px;text-decoration-color:currentColor}.bf-fee-delegated{display:inline-flex;align-items:center;justify-content:center;min-height:24px;padding:2px 8px;border-radius:6px;background:#379cff2e;color:#4eb3ff;font-size:10px;font-weight:500;line-height:1.3;white-space:nowrap}.bf-tx-fee-token{width:16px;height:16px;flex-shrink:0;border-radius:999px;object-fit:cover}.bf-info-card{gap:14px}.bf-info-section{display:flex;flex-direction:column;gap:10px}.bf-info-section+.bf-info-section{padding-top:2px}.bf-info-section h4{margin:0;color:var(--bf-text-high);font-size:14px;font-weight:600;line-height:1.5}.bf-root[data-view=history] .bf-detail-section h3,.bf-root[data-view=history] .bf-info-section h4{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.bf-info-rows{display:flex;flex-direction:column;gap:8px}.bf-info-row{display:flex;align-items:center;justify-content:space-between;gap:12px;min-width:0;font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-liquidity-head{display:flex;align-items:center;justify-content:space-between;gap:12px;min-width:0;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-info-label{display:inline-flex;align-items:center;gap:6px;min-width:0;color:var(--bf-text-low)}.bf-tree-marker{width:10px;flex-shrink:0;color:var(--bf-text-low)}.bf-info-value{min-width:0;color:var(--bf-text-medium);text-align:right}.bf-info-route,.bf-info-value-token{display:inline-flex;align-items:center;gap:4px}.bf-info-route .bf-token-icon,.bf-info-value-token .bf-token-icon{flex-shrink:0}.bf-info-route-arrow{color:var(--bf-text-medium)}.bf-root[data-view=history] .bf-info-route-arrow{color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.bf-info-value[data-tone=accent]{color:var(--ds-accent-primary-high, #00a0a2)}.bf-info-value[data-tone=warning]{color:var(--ds-system-orange-high, #e56f00)}.bf-root[data-view=history] .bf-info-label,.bf-root[data-view=history] .bf-liquidity-head,.bf-root[data-view=history] .bf-tree-marker{color:var(--ds-content-low, rgba(0, 0, 0, .4))}.bf-root[data-view=history] .bf-info-value{color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.bf-root[data-view=history] .bf-info-value[data-tone=accent]{color:var(--ds-accent-primary-high, #00a0a2)}.bf-root[data-view=history] .bf-info-value[data-tone=warning]{color:var(--ds-system-orange-high, #e56f00)}.bf-liquidity-status{display:inline-flex;align-items:center;gap:6px;padding:4px 12px;border-radius:999px;font-size:13px;font-weight:600;line-height:1.4;white-space:nowrap}.bf-liquidity-status:before{content:"";display:inline-block;width:7px;height:7px;border-radius:50%;flex-shrink:0}.bf-liquidity-status[data-status=normal],.bf-liquidity-status:not([data-status]){background:#00ceb21f;color:var(--ds-accent-primary-default, #00ceb2)}.bf-liquidity-status[data-status=normal]:before,.bf-liquidity-status:not([data-status]):before{background:var(--ds-accent-primary-default, #00ceb2)}.bf-liquidity-status[data-status=low]{background:#e56f001f;color:#e56f00}.bf-liquidity-status[data-status=low]:before{background:#e56f00}.bf-liquidity-status[data-status=rebalancing]{background:#da0b2e1a;color:#da0b2e}.bf-liquidity-status[data-status=rebalancing]:before{background:#da0b2e}.bf-liquidity-track{height:8px;overflow:hidden;border-radius:999px;background:var(--bf-surface-hover)}.bf-liquidity-track span{display:block;height:100%;border-radius:inherit;background:var(--ds-accent-primary-default, #00ceb2)}.bf-liquidity-value{color:var(--bf-text-low);font-size:12px}.bf-error{padding:12px;border-radius:12px;background:#da0b2e1f;color:var(--ds-system-red-default, #da0b2e);font-size:13px;line-height:1.4}.bf-footer{display:flex;flex-shrink:0;flex-direction:column;align-items:center;gap:10px;padding:12px 24px 24px;background:var(--ds-bg-default, var(--bf-bg))}.bf-next{width:100%;min-height:48px;padding:12px;border:0;border-radius:12px;background:var(--ds-accent-primary-default, #00ceb2);color:var(--ds-accent-primary-on, #000000);font:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer}.bf-next:disabled{cursor:default;opacity:.6}.bf-powered{display:inline-flex;align-items:center;gap:3px;color:var(--bf-text-low);font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em;text-decoration:none}.bf-powered:focus-visible{border-radius:4px;outline:2px solid var(--ds-accent-primary-default, #00ceb2);outline-offset:2px}.bf-powered-brand{text-decoration:underline;text-underline-offset:2px}.bf-history-tabs{display:flex;align-items:center;gap:4px;width:100%}.bf-history-tab{position:relative;display:inline-flex;min-height:37px;align-items:center;justify-content:center;padding:8px 12px;border:0;background:transparent;color:var(--ds-content-lowest, rgba(0, 0, 0, .25));font:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:0;cursor:pointer}.bf-history-tab[data-active=true]{color:var(--ds-accent-primary-high, #00a0a2)}.bf-history-tab[data-active=true]:after{position:absolute;right:8px;bottom:0;left:8px;height:3px;border-radius:999px;background:var(--ds-accent-primary-high, #00a0a2);content:""}.bf-history-tab-dot{position:absolute;top:8px;right:4px;width:6px;height:6px;border-radius:999px;background:var(--ds-system-red-default, #da0b2e)}.bf-history-list{display:flex;flex-direction:column;gap:12px}.bf-history-item{display:flex;flex-direction:column;gap:8px;padding:12px;border-radius:12px;background:var(--ds-surface-default, #ffffff);box-sizing:border-box}.bf-history-item-head,.bf-history-meta,.bf-history-route,.bf-history-route-token{display:inline-flex;align-items:center}.bf-history-item-head{justify-content:space-between;gap:12px;width:100%}.bf-history-status{display:inline-flex;min-height:24px;align-items:center;justify-content:center;padding:3px 8px;border-radius:4px;background:var(--ds-system-orange-low, #fcf5e9);color:var(--ds-system-orange-high, #e56f00);font-size:12px;font-weight:500;line-height:1.5;letter-spacing:0;white-space:nowrap}.bf-history-status[data-status=completed]{background:var(--ds-system-green-low, #e7f9f8);color:var(--ds-system-green-high, #00a0a2)}.bf-history-status[data-status=failed]{background:var(--ds-system-red-low, rgba(218, 11, 46, .12));color:var(--ds-system-red-default, #da0b2e)}.bf-history-time{min-width:0;color:var(--ds-content-low, rgba(0, 0, 0, .4));font-size:12px;font-weight:500;line-height:1.5;letter-spacing:0;text-align:right;white-space:nowrap}.bf-history-item-body{display:flex;flex-direction:column;gap:4px}.bf-history-amount{color:var(--ds-content-high, rgba(0, 0, 0, .85));font-size:16px;font-weight:600;line-height:1.5;letter-spacing:0}.bf-history-meta{justify-content:space-between;gap:12px;min-width:0}.bf-history-usd{min-width:0;color:var(--ds-content-low, rgba(0, 0, 0, .4));font-size:12px;font-weight:500;line-height:1.5;letter-spacing:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bf-history-route{justify-content:flex-end;gap:4px;min-width:0;color:var(--ds-content-high, rgba(0, 0, 0, .85));font-size:12px;font-weight:600;line-height:1.5;letter-spacing:0}.bf-history-route-token{gap:4px;min-width:0}.bf-history-route-token span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bf-history-route-arrow{flex-shrink:0;color:var(--ds-content-low, rgba(0, 0, 0, .4))}.bf-empty{padding:32px 16px;text-align:center;color:var(--ds-content-low, rgba(0, 0, 0, .4));font-size:14px}.bf-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}@media(max-width:767px){.bf-token-picker-overlay{align-items:flex-end;padding:0}.bf-token-picker{width:100%;max-height:82dvh;min-height:min(520px,82dvh);border-right:0;border-bottom:0;border-left:0;border-radius:24px 24px 0 0}.bf-token-picker-handle{display:block;width:40px;height:4px;flex-shrink:0;align-self:center;margin:10px 0 0;border-radius:999px;background:#ffffff38}.bf-token-picker-head{min-height:55px;padding:12px 56px 16px 24px;border-bottom:0}.bf-token-picker-close{top:13px}.bf-token-search{margin:0 16px 12px}.bf-token-list{padding:0 16px 16px}.bf-slippage-overlay{align-items:flex-end;padding:0}.bf-slippage-dialog{width:100%;height:auto;min-height:316px;max-height:82dvh;border-right:0;border-bottom:0;border-left:0;border-radius:24px 24px 0 0}}.wi-drawer-content .bf-header{padding:16px}.wi-drawer-content .bf-header .bf-header-btn:last-child{top:16px;right:16px}.wi-drawer-content .bf-body,.wi-drawer-content .bf-history-body{padding:16px}
10
+ `);var i=require("react/jsx-runtime"),ps=k.createContext(void 0);function mn(){return k.useContext(ps)}function yc(e){let[t,n]=k.useState(void 0);return k.useEffect(()=>{let o=e.current;if(!o)return;let r=()=>{let a=o.closest("[data-theme]");n(a?.getAttribute("data-theme")??void 0)};r();let s=new MutationObserver(r);return s.observe(document.documentElement,{attributes:!0,subtree:!0,attributeFilter:["data-theme"]}),()=>s.disconnect()},[e]),t}var as=[{value:"auto",label:"Auto"},{value:"0.1",label:"0.1%"},{value:"0.5",label:"0.5%"},{value:"1",label:"1%"}],kc={dev:"https://dev.crossdefi.io",stage:"https://stg.crossdefi.io",production:"https://crossdefi.io"},Sc=[{value:"all",label:"ALL"},{value:"completed",label:"Completed"},{value:"pending",label:"Pending"}];function Cc(e){return e==="auto"?"Auto":e?`${e}%`:"0.5%"}function ss(e){let t=e.replace(/[^\d.]/g,""),[n="",...o]=t.split("."),r=o.join("");return o.length===0?n:`${n}.${r.slice(0,2)}`}function Nc(e){return`${e.chainId}:${e.address.toLowerCase()}`}function fs(e){let t=Number(e);return Number.isFinite(t)?t.toLocaleString("en-US",{maximumFractionDigits:t>=1?2:6}):e||"0"}function ls(e,t){let n=Number(e||"0"),o=t?.priceUsd??0;return`\u2248 $${(Number.isFinite(n)?n*o:0).toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})} USD`}function Tc(e){if(e.priceUsd===void 0)return null;let t=new Pt.default(e.balance||"0");return t.isFinite()?`\u2248 $${t.multipliedBy(e.priceUsd).toFormat(2)} USD`:null}function Rc(e){if(e.priceUsd===void 0)return null;let t=new Pt.default(e.priceUsd);return t.isFinite()?`$${t.toFormat(t.isLessThan(1)?4:2)}`:null}function us(e){if(!e.isFinite()||e.isNaN())return"0";let n=e.decimalPlaces(6,Pt.default.ROUND_DOWN).toFixed(6).replace(/\.?0+$/,""),[o="0",r]=n.split("."),s=new Pt.default(o||"0").toFormat(0);return r?`${s}.${r}`:s}function Ic(e){return e.length<=14?e:`${e.slice(0,6)}...${e.slice(-6)}`}function Lc(e){let t=new Date(e);if(Number.isNaN(t.getTime()))return e;let n=o=>o.toString().padStart(2,"0");return[`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}`,`${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`].join(" ")}function Ec(e){let t=new Pt.default(e||"0");return!t.isFinite()||t.isNaN()?e||"0":us(t)}function Ac(e,t){if(t?.priceUsd===void 0)return null;let n=new Pt.default(e||"0").multipliedBy(t.priceUsd);return!n.isFinite()||n.isNaN()?null:`$${n.toFormat(2)}`}function ko(e){return e.status==="success"?"completed":e.status==="failed"?"failed":"pending"}function Pc(e,t){return t==="all"?!0:ko(e)===t}function Bc(e){return e==="completed"?"Completed":e==="failed"?"Failed":"Pending"}function cs(e){return e===56||e===97?"BSC":e===612044||e===5555?"CROSS":`Chain ${e}`}function ms(e,t){return!!e&&!!t&&e.chainId===t.chainId&&e.address.toLowerCase()===t.address.toLowerCase()}function gs(e,t){if(!(!e||!t))return e.chainId===t.chainId?"swap":ms(e,t)||e.symbol.toLowerCase()===t.symbol.toLowerCase()?"bridge":"swap-bridge"}function hs(e){return e==="swap"||e==="deposit-swap"||e==="swap-withdraw"}function yo(e){return!e||e==="0"||Number(e)===0}function Fc(e){let t=e.trim().toLowerCase();return t?t.startsWith("minimum ")?{from:e}:t.startsWith("available ")&&t.includes("or more")?{to:e}:t.includes("insufficient balance")||t.includes("not enough balance")||t.includes("exceeds balance")?{from:e}:t.includes("insufficient liquidity")||t.includes("not enough liquidity")?{to:e}:{}:{}}function Mc(e){let t=e.fromToken,n=e.toToken,o=gs(t,n),r=e.fromAmount||"0",s=e.toAmount||"0",a=o!==void 0&&!hs(o),l=o!==void 0&&o!=="bridge";return{pathType:o,bridgeInfo:a?[{label:"Route",value:t&&n?`${cs(t.chainId)} \u2192 ${cs(n.chainId)}`:"-"},{label:"Validator Fee",value:yo(r)?"0":"Free",tone:yo(r)?"default":"accent"},{label:"Network Fee",value:yo(r)?"0":"Free",tone:yo(r)?"default":"accent"}]:void 0,swapInfo:l?[t&&n?{label:"Route",value:"",routeTokens:[{symbol:t.symbol,iconUrl:t.iconUrl},{symbol:n.symbol,iconUrl:n.iconUrl}]}:{label:"Route",value:"-"},{label:"Price Impact",value:"0%"},{label:"In Amount",value:r,valueToken:t?{symbol:t.symbol,iconUrl:t.iconUrl}:void 0},{label:"Swap Fee",value:"0",valueToken:t?{symbol:t.symbol,iconUrl:t.iconUrl}:void 0},{label:"Out Amount",value:s,valueToken:n?{symbol:n.symbol,iconUrl:n.iconUrl}:void 0}]:void 0,txFee:[{label:"Priority Fee Per Gas",value:"0 Gwei"},{label:"Max Fee Per Gas",value:"0 Gwei"},{label:"Gas Limit",value:"0"}],txFeeInfo:{estTxFee:"0",isDelegateFee:!1}}}function En({token:e,size:t=20}){let n=e?.iconUrl;return(0,i.jsx)("span",{className:"bf-token-icon","data-has-image":!!n?"true":"false",style:{width:t,height:t},children:n?(0,i.jsx)("img",{src:n,alt:"",width:t,height:t,draggable:!1}):(0,i.jsx)("span",{className:"bf-token-fallback",children:e?.symbol?.slice(0,1)??"?"})})}function ds({label:e,token:t,amount:n,usd:o,onAmountChange:r,onTokenClick:s,onMax:a}){return(0,i.jsxs)("section",{className:"bf-amount-panel",children:[(0,i.jsxs)("div",{className:"bf-amount-head",children:[(0,i.jsx)("span",{children:e}),(0,i.jsxs)("span",{className:"bf-balance",children:[fs(t?.balance??"0")," ",t?.symbol??"",a&&(0,i.jsx)("button",{type:"button",className:"bf-max-btn",onClick:a,children:"MAX"})]})]}),(0,i.jsxs)("div",{className:"bf-amount-main",children:[(0,i.jsxs)("label",{className:"bf-amount-input-wrap",children:[(0,i.jsxs)("span",{className:"bf-sr-only",children:[e," amount"]}),(0,i.jsx)("input",{type:"text",inputMode:"decimal",value:n,onChange:l=>r(l.target.value),placeholder:"0",className:"bf-amount-input"}),(0,i.jsx)("span",{className:"bf-amount-usd",children:o})]}),(0,i.jsxs)("button",{type:"button",className:"bf-token-pill",onClick:s,disabled:!s,"aria-label":`Select ${e.toLowerCase()} token`,children:[(0,i.jsx)(En,{token:t}),(0,i.jsx)("span",{children:t?.symbol??"Select"}),(0,i.jsx)(Vt,{size:16})]})]})]})}function _c({flow:e,side:t,onClose:n}){let o=k.useId(),[r,s]=k.useState(""),[a,l]=k.useState(null),p=t==="from"?e.fromToken:e.toToken;k.useEffect(()=>{l(document.body)},[]),k.useEffect(()=>{let h=x=>{x.key==="Escape"&&n()};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[n]);let d=k.useMemo(()=>t==="from"?e.tokens:e.availableToTokens,[e.availableToTokens,e.tokens,t]),f=k.useMemo(()=>{let h=r.trim().toLowerCase();return h?d.filter(x=>x.symbol.toLowerCase().includes(h)||x.name.toLowerCase().includes(h)):d},[r,d]),m=k.useCallback(h=>{t==="from"?e.selectFromToken(h):e.selectToToken(h),n()},[e,n,t]);if(!a)return null;let g=mn();return(0,nn.createPortal)((0,i.jsx)("div",{className:"bf-token-picker-overlay","data-theme":g,role:"presentation",onMouseDown:h=>{h.target===h.currentTarget&&n()},children:(0,i.jsxs)("section",{className:"bf-token-picker",role:"dialog","aria-modal":"true","aria-labelledby":o,children:[(0,i.jsx)("span",{className:"bf-token-picker-handle","aria-hidden":"true"}),(0,i.jsxs)("header",{className:"bf-token-picker-head",children:[(0,i.jsx)("h3",{id:o,children:"Select a token"}),(0,i.jsx)("button",{type:"button",className:"bf-token-picker-close",onClick:n,"aria-label":"Close token selector",children:(0,i.jsx)(vt,{size:24})})]}),(0,i.jsxs)("label",{className:"bf-token-search",children:[(0,i.jsx)(Ka,{size:20}),(0,i.jsx)("span",{className:"bf-sr-only",children:"Search tokens"}),(0,i.jsx)("input",{value:r,onChange:h=>s(h.target.value),placeholder:"Search Tokens",autoComplete:"off",spellCheck:!1})]}),(0,i.jsxs)("div",{className:"bf-token-list",children:[f.map(h=>{let x=ms(h,p),y=x?Rc(h):Tc(h);return(0,i.jsxs)("button",{type:"button",className:"bf-token-row","data-selected":x?"true":"false",onClick:()=>m(h),children:[(0,i.jsxs)("span",{className:"bf-token-row-left",children:[(0,i.jsx)(En,{token:h,size:40}),(0,i.jsxs)("span",{className:"bf-token-meta",children:[(0,i.jsx)("span",{className:"bf-token-symbol",children:h.symbol}),!x&&(0,i.jsx)("span",{className:"bf-token-name",children:h.name})]})]}),(0,i.jsxs)("span",{className:"bf-token-row-right",children:[(0,i.jsxs)("span",{className:"bf-token-balance",children:[fs(h.balance),x?null:` ${h.symbol}`]}),y&&(0,i.jsx)("span",{className:"bf-token-price",children:y})]})]},Nc(h))}),f.length===0&&(0,i.jsx)("div",{className:"bf-token-empty",children:"No tokens found"})]})]})}),a)}function Oc({flow:e,onClose:t}){let n=k.useId(),[o,r]=k.useState(null),s=as.find(g=>g.value===e.slippage),[a,l]=k.useState(e.slippage&&!s?e.slippage:""),p=a.trim()!==""&&a.trim()!==".",d=g=>{e.setSlippage(g),t()},f=()=>{p&&(e.setSlippage(ss(a)),t())};if(k.useEffect(()=>{r(document.body)},[]),k.useEffect(()=>{let g=h=>{h.key==="Escape"&&t()};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[t]),!o)return null;let m=mn();return(0,nn.createPortal)((0,i.jsx)("div",{className:"bf-slippage-overlay","data-theme":m,role:"presentation",onMouseDown:g=>{g.target===g.currentTarget&&t()},children:(0,i.jsxs)("section",{className:"bf-slippage-dialog",role:"dialog","aria-modal":"true","aria-labelledby":n,children:[(0,i.jsxs)("header",{className:"bf-slippage-head",children:[(0,i.jsx)("h3",{id:n,children:"Slippage Settings"}),(0,i.jsx)("button",{type:"button",className:"bf-slippage-close",onClick:t,"aria-label":"Close slippage settings",children:(0,i.jsx)(vt,{size:24})})]}),(0,i.jsxs)("div",{className:"bf-slippage-body",children:[(0,i.jsx)("p",{className:"bf-slippage-desc",children:"The maximum price difference you are willing to accept before the transaction is reverted. Higher slippage increases the chance of execution but may result in a worse price."}),(0,i.jsxs)("div",{className:"bf-slippage-controls",children:[(0,i.jsx)("div",{className:"bf-slippage-presets",children:as.map(g=>(0,i.jsx)("button",{type:"button",className:"bf-slippage-preset","data-selected":!p&&e.slippage===g.value?"true":"false",onClick:()=>d(g.value),children:g.label},g.value))}),(0,i.jsxs)("label",{className:"bf-slippage-custom","data-selected":p?"true":"false",children:[(0,i.jsx)("span",{className:"bf-sr-only",children:"Custom slippage percent"}),(0,i.jsx)("input",{value:a,onChange:g=>{l(ss(g.target.value))},onKeyDown:g=>{g.key==="Enter"&&(g.preventDefault(),f())},inputMode:"decimal",placeholder:"Enter custom slippage",autoComplete:"off",spellCheck:!1}),(0,i.jsx)("span",{"aria-hidden":"true",children:"%"})]})]}),p&&(0,i.jsx)("button",{type:"button",className:"bf-slippage-apply",onClick:f,children:"Apply"})]})]})}),o)}function zc({flow:e}){let t=k.useId(),[n,o]=k.useState(!1),[r,s]=k.useState(null),a=mn();return k.useEffect(()=>{s(document.body)},[]),k.useEffect(()=>{let l=p=>{p.key==="Escape"&&e.cancelTerms()};return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[e]),!r||!e.termsOpen?null:(0,nn.createPortal)((0,i.jsx)("div",{className:"bf-action-modal-overlay","data-theme":a,role:"presentation",onPointerDown:l=>{l.target===l.currentTarget&&e.cancelTerms()},children:(0,i.jsxs)("section",{className:"bf-action-modal bf-terms-modal",role:"dialog","aria-modal":"true","aria-labelledby":t,children:[(0,i.jsx)("h3",{id:t,children:"Agree to Terms of Service"}),(0,i.jsx)("p",{className:"bf-action-modal-desc",children:"Please make sure to review the Terms of Service before using CROSSD."}),(0,i.jsxs)("div",{className:"bf-terms-check-row","data-checked":n?"true":"false",children:[(0,i.jsxs)("button",{type:"button",className:"bf-terms-check-button",role:"checkbox","aria-checked":n,onClick:()=>o(l=>!l),children:[(0,i.jsx)("span",{className:"bf-terms-checkbox","data-checked":n?"true":"false","aria-hidden":"true"}),(0,i.jsx)("span",{children:"Agree to Terms of Use"})]}),e.termsUrl&&(0,i.jsx)("a",{href:e.termsUrl,target:"_blank",rel:"noreferrer",children:"Terms of Service"})]}),(0,i.jsx)("p",{className:"bf-terms-privacy",children:"I have read and acknowledged the Privacy Policy to use CROSSD"}),(0,i.jsx)("button",{type:"button",className:"bf-action-primary",disabled:!n||e.status==="submitting",onClick:e.confirmTerms,children:"Confirm"})]})}),r)}function Wc({value:e,disabled:t=!1}){let[n,o]=k.useState(!1);return(0,i.jsx)("button",{type:"button",className:"bf-copy-button","aria-label":"Copy token address",disabled:t,onClick:()=>{t||navigator.clipboard?.writeText(e).then(()=>{o(!0),window.setTimeout(()=>o(!1),1200)})},children:n?"OK":"Copy"})}function Dc({flow:e,approval:t}){let n=k.useId(),[o,r]=k.useState(null),s=mn();if(k.useEffect(()=>{r(document.body)},[]),k.useEffect(()=>{let p=d=>{e.status!=="submitting"&&d.key==="Escape"&&e.cancelApproval()};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[e]),!o)return null;let a=e.status==="submitting"||!e.approveBridge,l=e.status==="submitting";return(0,nn.createPortal)((0,i.jsx)("div",{className:"bf-action-modal-overlay","data-theme":s,role:"presentation",children:(0,i.jsxs)("section",{className:"bf-action-modal bf-approve-modal",role:"dialog","aria-modal":"true","aria-labelledby":n,children:[(0,i.jsxs)("h3",{id:n,children:["Approve ",t.token.symbol]}),(0,i.jsx)(En,{token:t.token,size:72}),(0,i.jsxs)("div",{className:"bf-approve-address-box",children:[(0,i.jsx)("span",{children:"Token Address"}),(0,i.jsxs)("div",{children:[(0,i.jsx)("strong",{children:t.tokenAddress}),(0,i.jsx)(Wc,{value:t.tokenAddress,disabled:l})]})]}),(0,i.jsxs)("div",{className:"bf-action-buttons",children:[(0,i.jsx)("button",{type:"button",className:"bf-action-secondary",onClick:e.cancelApproval,disabled:e.status==="submitting",children:"Cancel"}),(0,i.jsxs)("button",{type:"button",className:"bf-action-primary",onClick:e.confirmApproval,disabled:a,"aria-busy":l,children:[l&&(0,i.jsx)("span",{className:"bf-action-button-spinner","aria-hidden":"true"}),(0,i.jsx)("span",{children:l?"Approving...":"Approve"})]})]})]})}),o)}function Hc({flow:e}){let t=k.useId(),[n,o]=k.useState(null),r=mn();return k.useEffect(()=>{o(document.body)},[]),k.useEffect(()=>{if(!e.approvalSuccessOpen)return;let s=a=>{a.key==="Escape"&&e.cancelApproval()};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[e]),!n||!e.approvalSuccessOpen?null:(0,nn.createPortal)((0,i.jsx)("div",{className:"bf-action-modal-overlay","data-theme":r,role:"presentation",children:(0,i.jsxs)("section",{className:"bf-action-modal bf-approval-success-modal",role:"dialog","aria-modal":"true","aria-labelledby":t,children:[(0,i.jsx)("h3",{id:t,children:"Approval Success"}),(0,i.jsx)("span",{className:"bf-success-mark","aria-hidden":"true"}),(0,i.jsxs)("p",{className:"bf-action-modal-desc",children:["Token approval confirmed successfully.",(0,i.jsx)("br",{}),"Please continue to the next step."]}),(0,i.jsxs)("div",{className:"bf-action-buttons",children:[(0,i.jsx)("button",{type:"button",className:"bf-action-secondary",onClick:e.cancelApproval,children:"Cancel"}),(0,i.jsx)("button",{type:"button",className:"bf-action-primary",onClick:e.continueAfterApproval,children:"Continue"})]})]})}),n)}function Gc({fromAmount:e,toAmount:t,fromToken:n,toToken:o}){let[r,s]=k.useState(!1),a=k.useMemo(()=>{let d=new Pt.default(e||"0"),f=new Pt.default(t||"0");return!d.isFinite()||!f.isFinite()||d.lte(0)||f.lte(0)?null:r?d.dividedBy(f):f.dividedBy(d)},[e,r,t]);if(!a||!n||!o)return null;let l=r?o.symbol:n.symbol,p=r?n.symbol:o.symbol;return(0,i.jsxs)("button",{type:"button",className:"bf-exchange-rate",onClick:()=>s(d=>!d),children:[(0,i.jsxs)("span",{children:["1 ",l]}),(0,i.jsx)(Ja,{size:12}),(0,i.jsxs)("span",{children:[us(a)," ",p]})]})}function Uc({flow:e}){return e.submitToast?(0,i.jsxs)("div",{className:"bf-status-toast","data-variant":"processing",role:"status","aria-live":"polite",children:[(0,i.jsx)("span",{className:"bf-status-toast-icon","aria-hidden":"true",children:(0,i.jsx)("span",{className:"bf-status-spinner"})}),(0,i.jsxs)("span",{className:"bf-status-toast-copy",children:[(0,i.jsx)("strong",{children:"Transaction Processing"}),(0,i.jsx)("span",{children:"Your transaction is being processed on the blockchain"})]})]}):null}function $c({message:e}){let[t,n]=k.useState(!1);return k.useEffect(()=>{if(!e){n(!1);return}n(!0);let o=window.setTimeout(()=>{n(!1)},3500);return()=>window.clearTimeout(o)},[e]),!e||!t?null:(0,i.jsxs)("div",{className:"bf-status-toast","data-variant":"error",role:"alert","aria-live":"assertive",children:[(0,i.jsx)("span",{className:"bf-status-toast-icon","aria-hidden":"true",children:(0,i.jsx)("span",{className:"bf-status-error-mark",children:"!"})}),(0,i.jsxs)("span",{className:"bf-status-toast-copy",children:[(0,i.jsx)("strong",{children:"Error"}),(0,i.jsx)("span",{children:e})]})]})}function jc(e){switch(e){case"swap":case"deposit-swap":case"swap-withdraw":return"Swap Transaction Sent";case"bridge":return"Bridge Transaction Sent";case"swap-bridge":return"Swap & Bridge Transaction Sent";case"bridge-swap":return"Bridge & Swap Transaction Sent";default:return"Transaction Sent"}}function Vc({flow:e}){let t=k.useId(),[n,o]=k.useState(null),r=e.submitted,s=mn();return k.useEffect(()=>{o(document.body)},[]),k.useEffect(()=>{if(!e.successDialogOpen)return;let a=l=>{l.key==="Escape"&&e.dismissSuccessDialog()};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[e]),!n||!e.successDialogOpen||!r?null:(0,nn.createPortal)((0,i.jsx)("div",{className:"bf-success-overlay","data-theme":s,role:"presentation",children:(0,i.jsx)("section",{className:"bf-success-modal",role:"dialog","aria-modal":"true","aria-labelledby":t,children:(0,i.jsxs)("div",{className:"bf-success-body",children:[(0,i.jsx)("span",{className:"bf-success-mark","aria-hidden":"true"}),(0,i.jsxs)("div",{className:"bf-success-copy",children:[(0,i.jsx)("strong",{id:t,children:jc(r.pathType)}),(0,i.jsx)("span",{children:"Please check the results in the history."})]}),(0,i.jsx)("div",{className:"bf-success-route","aria-hidden":"true",children:(r.routeTokens&&r.routeTokens.length>0?r.routeTokens:[{symbol:r.fromToken.symbol,iconUrl:r.fromToken.iconUrl},{symbol:r.toToken.symbol,iconUrl:r.toToken.iconUrl}]).map((a,l)=>(0,i.jsxs)(k.Fragment,{children:[l>0&&(0,i.jsx)("span",{className:"bf-success-route-arrow",children:"\u2192"}),(0,i.jsx)(gr,{token:a,size:43})]},`${a.symbol}-${l}`))}),(0,i.jsx)("button",{type:"button",className:"bf-success-ok",onClick:e.dismissSuccessDialog,children:"OK"})]})})}),n)}function gr({token:e,size:t=16}){let n=!!e.iconUrl;return(0,i.jsx)("span",{className:"bf-token-icon","data-has-image":n?"true":"false",style:{width:t,height:t},children:e.iconUrl?(0,i.jsx)("img",{src:e.iconUrl,alt:"",width:t,height:t,draggable:!1}):(0,i.jsx)("span",{className:"bf-token-fallback",children:e.symbol?.slice(0,1)??"?"})})}function qc({row:e}){return e.routeTokens&&e.routeTokens.length>0?(0,i.jsx)("span",{className:"bf-info-route",children:e.routeTokens.map((t,n)=>(0,i.jsxs)(k.Fragment,{children:[n>0&&(0,i.jsx)("span",{className:"bf-info-route-arrow","aria-hidden":"true",children:"\u2192"}),(0,i.jsx)(gr,{token:t})]},`${t.symbol}-${n}`))}):e.valueToken?(0,i.jsxs)("span",{className:"bf-info-value-token",children:[(0,i.jsx)(gr,{token:e.valueToken}),(0,i.jsx)("span",{children:e.value})]}):(0,i.jsx)(i.Fragment,{children:e.value})}function bs({rows:e}){return!e||e.length===0?null:(0,i.jsx)("div",{className:"bf-info-rows",children:e.map((t,n)=>(0,i.jsxs)("div",{className:"bf-info-row",children:[(0,i.jsxs)("span",{className:"bf-info-label",children:[(0,i.jsx)("span",{className:"bf-tree-marker",children:n===e.length-1?"\u2514":"\u251C"}),(0,i.jsx)("span",{children:t.label})]}),(0,i.jsx)("span",{className:"bf-info-value","data-tone":t.tone??"default",children:(0,i.jsx)(qc,{row:t})})]},`${t.label}-${t.value}`))})}function Kc(e,t,n){return e.pathType==="bridge"?"Bridge Info":hs(e.pathType)?"Swap Info":t&&n?"Swap & Bridge Info":t?"Bridge Info":"Swap Info"}function Qc({summary:e}){let t=!!e.bridgeInfo?.length,n=!!e.swapInfo?.length,o=t&&n,r=e.pathType==="bridge-swap"?["bridge","swap"]:["swap","bridge"];return(0,i.jsx)(i.Fragment,{children:r.map(s=>{let a=s==="swap"?e.swapInfo:e.bridgeInfo;return a?.length?(0,i.jsxs)("div",{className:"bf-info-section",children:[o&&(0,i.jsx)("h4",{children:s==="swap"?"Swap Info":"Bridge Info"}),(0,i.jsx)(bs,{rows:a})]},s):null})})}function Zc({summary:e}){let t=!!e.bridgeInfo?.length,n=!!e.swapInfo?.length,o=!!e.txFee?.length,r=Kc(e,t,n),[s,a]=k.useState(!0),[l,p]=k.useState(!0);return(0,i.jsxs)("div",{className:"bf-details",children:[e.liquidity&&(0,i.jsxs)("section",{className:"bf-liquidity",children:[(0,i.jsxs)("div",{className:"bf-liquidity-head",children:[(0,i.jsx)("span",{children:e.liquidity.label??"Available Liquidity"}),(0,i.jsx)("span",{className:"bf-liquidity-status","data-status":e.liquidity.status,children:e.liquidity.status??"Normal"})]}),(0,i.jsx)("div",{className:"bf-liquidity-track",children:(0,i.jsx)("span",{style:{width:`${e.liquidity.percentage??50}%`}})}),(0,i.jsx)("span",{className:"bf-liquidity-value",children:e.liquidity.value})]}),(t||n)&&(0,i.jsxs)("section",{className:"bf-detail-section bf-info-card","data-open":s?"true":"false",children:[(0,i.jsxs)("button",{type:"button",className:"bf-collapse-head","aria-expanded":s,onClick:()=>a(d=>!d),children:[(0,i.jsx)("h3",{children:r}),(0,i.jsx)(Vt,{size:16,className:"bf-collapse-chevron"})]}),s&&(0,i.jsx)("div",{className:"bf-collapse-body",children:(0,i.jsx)(Qc,{summary:e})})]}),o&&(0,i.jsxs)("section",{className:"bf-detail-section bf-tx-fee-section","data-open":l?"true":"false",children:[(0,i.jsxs)("button",{type:"button",className:"bf-collapse-head bf-tx-fee-head","aria-expanded":l,onClick:()=>p(d=>!d),children:[(0,i.jsx)("h3",{children:"Est. Tx Fee"}),(0,i.jsxs)("div",{className:"bf-tx-fee-total",children:[e.txFeeInfo?.isDelegateFee&&(0,i.jsx)("span",{className:"bf-fee-delegated",children:"Fee Delegated"}),e.txFeeInfo?.tokenIconUrl&&(0,i.jsx)("img",{className:"bf-tx-fee-token",src:e.txFeeInfo.tokenIconUrl,alt:e.txFeeInfo.tokenSymbol??"",width:16,height:16,draggable:!1}),(0,i.jsx)("span",{"data-delegated":e.txFeeInfo?.isDelegateFee||void 0,children:e.txFeeInfo?.estTxFee??"0"}),(0,i.jsx)(Vt,{size:16,className:"bf-collapse-chevron"})]})]}),l&&(0,i.jsx)("div",{className:"bf-collapse-body",children:(0,i.jsx)(bs,{rows:e.txFee})})]})]})}function Yc({item:e}){let t=ko(e),n=Ac(e.fromAmount,e.fromToken);return(0,i.jsxs)("article",{className:"bf-history-item",children:[(0,i.jsxs)("div",{className:"bf-history-item-head",children:[(0,i.jsx)("span",{className:"bf-history-status","data-status":t,children:Bc(t)}),(0,i.jsx)("time",{className:"bf-history-time",dateTime:e.timestamp,children:Lc(e.timestamp)})]}),(0,i.jsxs)("div",{className:"bf-history-item-body",children:[(0,i.jsxs)("strong",{className:"bf-history-amount",children:[Ec(e.fromAmount)," ",e.fromToken.symbol]}),(0,i.jsxs)("div",{className:"bf-history-meta",children:[(0,i.jsx)("span",{className:"bf-history-usd",children:n??Ic(e.txHash)}),(0,i.jsxs)("span",{className:"bf-history-route",children:[(0,i.jsxs)("span",{className:"bf-history-route-token",children:[(0,i.jsx)(En,{token:e.fromToken,size:16}),(0,i.jsx)("span",{children:e.fromToken.symbol})]}),(0,i.jsx)(Xa,{size:16,className:"bf-history-route-arrow"}),(0,i.jsxs)("span",{className:"bf-history-route-token",children:[(0,i.jsx)(En,{token:e.toToken,size:16}),(0,i.jsx)("span",{children:e.toToken.symbol})]})]})]})]})]})}function Xc({flow:e}){let[t,n]=k.useState("all"),o=e.history.some(a=>ko(a)==="pending"),r=e.history.filter(a=>Pc(a,t)),s=t==="all"?"No bridge history yet.":`No ${t} bridge history.`;return(0,i.jsxs)("main",{className:"bf-history-body",children:[(0,i.jsx)("nav",{className:"bf-history-tabs","aria-label":"Bridge history filters",children:Sc.map(a=>(0,i.jsxs)("button",{type:"button",className:"bf-history-tab","data-active":t===a.value?"true":"false",onClick:()=>n(a.value),children:[(0,i.jsx)("span",{children:a.label}),a.value==="pending"&&o&&(0,i.jsx)("span",{className:"bf-history-tab-dot","aria-hidden":"true"})]},a.value))}),r.length>0?(0,i.jsx)("div",{className:"bf-history-list",children:r.map(a=>(0,i.jsx)(Yc,{item:a},a.id||a.txHash))}):(0,i.jsx)("div",{className:"bf-empty",children:s})]})}function Jc({flow:e,env:t}){let[n,o]=k.useState(null),[r,s]=k.useState(!1),[a,l]=k.useState(0),d=!!(e.fromAmount.trim()||e.toAmount.trim())?e.summary??Mc(e):null,f=kc[t],m=Fc(e.quoteError),g=e.quoteError&&!m.from&&!m.to?e.quoteError:"",h=e.error||g,x=e.history.some(v=>ko(v)==="pending"),w=(d?.pathType??gs(e.fromToken,e.toToken))!=="bridge";return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("main",{className:"bf-body",children:[(0,i.jsxs)("div",{className:"bf-toolbar",children:[(0,i.jsxs)("button",{type:"button",className:"bf-chip bf-chip-history",onClick:()=>e.setStep("history"),children:[(0,i.jsx)(Qa,{}),(0,i.jsx)("span",{children:"History"}),(x||e.hasNewHistory)&&(0,i.jsx)("span",{className:"bf-chip-dot","aria-hidden":"true"})]}),w&&(0,i.jsxs)("button",{type:"button",className:"bf-chip",onClick:()=>s(!0),"aria-haspopup":"dialog","aria-expanded":r,children:[(0,i.jsx)(Za,{}),(0,i.jsx)("span",{children:Cc(e.slippage)})]})]}),(0,i.jsxs)("div",{className:"bf-swap-card","data-has-from-error":m.from?"true":"false",children:[(0,i.jsx)(ds,{label:"From",token:e.fromToken,amount:e.fromAmount,usd:ls(e.fromAmount,e.fromToken),onAmountChange:v=>e.setAmount(v,"from"),onTokenClick:()=>o("from"),onMax:e.setMax}),m.from&&(0,i.jsx)("div",{className:"bf-field-error",children:m.from}),(0,i.jsx)("button",{type:"button",className:"bf-swap-toggle",onClick:()=>{e.swapTokens(),l(v=>v+360)},style:{transform:`translateX(-50%) rotate(${a}deg)`,transition:"transform 0.2s ease"},children:(0,i.jsx)(Ya,{size:22})}),(0,i.jsx)(ds,{label:"To",token:e.toToken,amount:e.toAmount,usd:ls(e.toAmount,e.toToken),onAmountChange:v=>e.setAmount(v,"to"),onTokenClick:()=>o("to")}),m.to&&(0,i.jsx)("div",{className:"bf-field-error",children:m.to})]}),(0,i.jsx)(Gc,{fromAmount:e.fromAmount,toAmount:e.toAmount,fromToken:e.fromToken,toToken:e.toToken}),d&&(0,i.jsx)(Zc,{summary:d})]}),(0,i.jsxs)("footer",{className:"bf-footer",children:[(0,i.jsx)("button",{type:"button",className:"bf-next",onClick:e.submit,disabled:e.status==="submitting"||!!e.quoteError,children:e.status==="submitting"?"Processing...":"Next"}),(0,i.jsxs)("a",{className:"bf-powered",href:f,target:"_blank",rel:"noreferrer",children:["Powered by ",(0,i.jsx)("span",{className:"bf-powered-brand",children:"CROSS DeFi"})]})]}),n&&(0,i.jsx)(_c,{flow:e,side:n,onClose:()=>o(null)}),r&&(0,i.jsx)(Oc,{flow:e,onClose:()=>s(!1)}),(0,i.jsx)(zc,{flow:e}),e.approvalInfo&&(0,i.jsx)(Dc,{flow:e,approval:e.approvalInfo}),(0,i.jsx)(Hc,{flow:e}),(0,i.jsx)(Uc,{flow:e}),(0,i.jsx)($c,{message:e.submitToast?"":h}),(0,i.jsx)(Vc,{flow:e})]})}function An({onClose:e,onBackToWallet:t,env:n,className:o,...r}){let s=k.useMemo(()=>Ie(n),[n]),a=is({...r,onExit:t}),l=k.useRef(null),p=yc(l),d=a.step==="history"?"History":"Swap & Bridge";return(0,i.jsx)(ps.Provider,{value:p,children:(0,i.jsxs)("div",{ref:l,className:Y("bf-root",o),"data-view":a.step,"data-status":a.status,children:[(0,i.jsxs)("header",{className:"bf-header",children:[(0,i.jsx)("button",{type:"button",className:"bf-header-btn",onClick:a.back,"aria-label":"Back",children:(0,i.jsx)(Lt,{size:24})}),(0,i.jsx)("span",{className:"bf-header-title",children:d}),(0,i.jsx)("button",{type:"button",className:"bf-header-btn",onClick:e,"aria-label":"Close",children:(0,i.jsx)(vt,{size:24})})]}),a.step==="history"?(0,i.jsx)(Xc,{flow:a}):(0,i.jsx)(Jc,{flow:a,env:s})]})})}var c=require("react/jsx-runtime");function hr(e,t,n){let o=ze[e],r=n.toUpperCase();if(t===o.cross&&r.includes("CROSSD"))return 0;if(t===o.cross&&r==="CROSS")return 1;if(t===o.bsc&&r==="CROSS")return 2}function ed(e){return parseInt(e.split(":")[1],10)}function td(e){let t=e.lastIndexOf(".");return t===-1?{main:e,decimal:""}:{main:e.slice(0,t),decimal:e.slice(t)}}function nd(e){let t=e.toLowerCase().replace(/^0x/,""),n=t.length>=8?t.slice(0,8):t.padEnd(8,"0"),o=parseInt(n.slice(0,4),16)%360,r=(o+60+parseInt(n.slice(4,8),16)%120)%360;return`linear-gradient(135deg, hsl(${o} 85% 65%), hsl(${r} 80% 55%))`}function xs({align:e="end",sideOffset:t=12,className:n,children:o}){let{env:r,theme:s,isMobile:a,open:l,drawerDirection:p,modal:d,showBalance:f,showForgeToken:m,showGameToken:g,showQR:h,showBridge:x,qrLogoSrc:y,walletAddress:w,accountName:v,sendAccounts:I,profileImageUrl:u,preferredTokens:E,close:T,onSelectWallet:M,onCopyAddress:_,onBuy:j,onDisconnect:H,disconnectLabel:J,termsUrl:$,termsLabel:W,privacyUrl:he,privacyLabel:ye,portalStyle:fe,navContent:ue,navPosition:We,footerContent:re,view:U,setView:te,selectedSendToken:Te,setSelectedSendToken:ee,showPortfolio:De,portfolioTitle:He,showTotalAssets:Re,totalAssetsLabel:Ee,sendTransaction:gt,getTransactionReceipt:be,estimateGas:Nt,onOutlink:Ye,lpBalanceReader:Xe,bridgeTokens:Ae,bridgeHistory:Me,getBridgeQuote:ke,getBridgeToTokens:pe,getBridgeApproval:Se,approveBridge:Tt,submitBridge:Je,onReceive:ht,onBridge:Ce,onSend:Ge,onBuyDisabledMessage:bt}=Mt(),[_e,et]=A.useState(null),tt=A.useRef(void 0),Ue=A.useCallback(b=>{et(b),clearTimeout(tt.current),tt.current=setTimeout(()=>et(null),4e3)},[]);A.useEffect(()=>()=>clearTimeout(tt.current),[]);let we=!!bt,$e=A.useCallback(()=>{if(we){Ue(bt);return}j?.()},[we,bt,j,Ue]),{tokens:at,isLoading:wt}=Zt(r,w,l&&f),{statsMap:je}=Yt(r,f),{categoryMap:Rt}=ta(r,f),It=f&&Re,{displayValue:nt,isLowerBound:xt,isLoading:Oe}=oa(r,w,l&&It),[st,C]=A.useState(!1),V=A.useRef(null),[oe,Ve]=A.useState(0),{holdings:qe,isLoading:Bt}=Qi(r,w,l&&f&&m),bn=A.useMemo(()=>qe.map(b=>b.token),[qe]),{imageMap:Ao}=Zi(r,bn,m&&qe.length>0),ot=A.useMemo(()=>{let b=[],R=[],q=[],Pe=new Map((E??[]).map((Z,xe)=>[`${ed(Z.chainId)}:${Z.address.toLowerCase()}`,xe]));for(let Z of at){let xe=hr(r,Z.chainId,Z.symbol)!==void 0,Gt=`${Z.chainId}:${Z.address.toLowerCase()}`,Ut=Pe.get(Gt),Wo=new gn.default(Z.quantity.numeric).shiftedBy(-Z.quantity.decimals);if(xe)b.push(Z);else if(Ut!==void 0)R.push(Z);else if(Wo.isGreaterThan(0)){if(!g&&Rt.get(ir(Z.chainId,Z.address))==="game")continue;q.push(Z)}}return b.sort((Z,xe)=>{let Gt=hr(r,Z.chainId,Z.symbol)??99,Ut=hr(r,xe.chainId,xe.symbol)??99;return Gt-Ut}),R.sort((Z,xe)=>{let Gt=Pe.get(`${Z.chainId}:${Z.address.toLowerCase()}`)??99,Ut=Pe.get(`${xe.chainId}:${xe.address.toLowerCase()}`)??99;return Gt-Ut}),q.sort((Z,xe)=>{let Gt=je.get(Et(Z.chainId,Z.address)),Ut=je.get(Et(xe.chainId,xe.address)),Wo=new gn.default(Z.quantity.numeric).shiftedBy(-Z.quantity.decimals).multipliedBy(Gt?.price??0);return new gn.default(xe.quantity.numeric).shiftedBy(-xe.quantity.decimals).multipliedBy(Ut?.price??0).minus(Wo).toNumber()}),[...b,...R,...q]},[at,r,je,g,Rt,E]),B=A.useMemo(()=>{if(!m)return[];let b=new Set(at.map(R=>R.address.toLowerCase()));return[...qe].filter(R=>!b.has(R.token.toLowerCase())).sort((R,q)=>{let Pe=new gn.default(R.value);return new gn.default(q.value).minus(Pe).toNumber()})},[qe,m,at]),ce=A.useRef(!1),[F,me]=A.useState(null),Ft=A.useRef(void 0),kr=F?.chainId??Te?.chainId??ot[0]?.chainId??0,{transactionUrl:Po}=no(r,kr,F?.txHash,!!(F?.txHash&&kr)),Ke=A.useCallback(b=>{ce.current=!0,te(b)},[te]),[$s,Bo]=A.useState("recipient"),Gn=A.useCallback(()=>{ee(null),Bo("recipient"),Ke("wallet")},[ee,Ke]),Fo=A.useCallback((b,R="recipient")=>{Bo(R),ee(b),Ke("send")},[ee,Ke]),js=A.useCallback(()=>{if(Ce){Ce();return}Ke("bridge")},[Ce,Ke]),Vs=A.useCallback(b=>{clearTimeout(Ft.current),ee(null),Ke("wallet"),me({status:"pending",txHash:b.txHash,chainId:b.chainId,description:`${b.amount} ${b.tokenSymbol} to ${Qe(b.recipient)}`})},[ee,Ke]),qs=A.useCallback(b=>{let R=Te?.chainId;ee(null),Ke("wallet"),!(!b||!R)&&(me(q=>({status:"success",txHash:b,chainId:R,description:q?.txHash===b?q.description:"Tap to see your transaction"})),clearTimeout(Ft.current),Ft.current=setTimeout(()=>me(null),5e3))},[Te?.chainId,ee,Ke]),Ks=A.useCallback(b=>{let R=b.txHash;R&&(me({status:"error",txHash:R,chainId:b.chainId,description:b.message}),clearTimeout(Ft.current),Ft.current=setTimeout(()=>me(null),5e3))},[]),Mo=A.useMemo(()=>{if(ht)return ht;if(h)return()=>Ke("qr")},[ht,h,Ke]),Sr=A.useMemo(()=>{if(Ge)return Ge;if(ot.length===0)return;let b=ot[0];return()=>Fo(b,"token")},[Ge,ot,Fo]);A.useEffect(()=>{l||(ce.current=!1,Bo("recipient"))},[l]);let Cr=A.useRef(null);A.useEffect(()=>{let b=Cr.current;if(!b||!a)return;let R=q=>{q.pointerType==="touch"&&q.stopPropagation()};return b.addEventListener("pointerdown",R),()=>b.removeEventListener("pointerdown",R)},[a]);let[an,Nr]=A.useState(!1),_o=A.useRef(void 0),[wn,Un]=A.useState(!1);A.useEffect(()=>{if(!wn)return;let b=()=>Un(!1),R=Pe=>{Pe.key==="Escape"&&Un(!1)},q=setTimeout(()=>{document.addEventListener("mousedown",b,!0),document.addEventListener("keydown",R,!0)},0);return()=>{clearTimeout(q),document.removeEventListener("mousedown",b,!0),document.removeEventListener("keydown",R,!0)}},[wn]),A.useEffect(()=>()=>clearTimeout(_o.current),[]),A.useEffect(()=>()=>clearTimeout(Ft.current),[]),A.useEffect(()=>{let b=V.current;if(!b||re===null){Ve(0);return}let R=()=>{Ve(b.offsetHeight)};if(R(),typeof ResizeObserver>"u")return;let q=new ResizeObserver(R);return q.observe(b),()=>q.disconnect()},[re]);let Tr=A.useCallback(async()=>{if(!an)try{await navigator.clipboard.writeText(w),Nr(!0),clearTimeout(_o.current),_o.current=setTimeout(()=>Nr(!1),2e3),_?.(w,!0)}catch{_?.(w,!1)}},[w,_,an]),$n=A.useCallback(b=>{b.currentTarget.setAttribute("data-loaded","true")},[]),Rr=A.useMemo(()=>({background:nd(w)}),[w]),jn=A.useMemo(()=>u||Kt(r,w,{size:120,bg:s==="dark"?"1A1A2E":"F3F6F8"}),[u,r,w,s]),Oo=A.useMemo(()=>td(nt),[nt]),Ir=$||he?(0,c.jsxs)("div",{className:"wi-legal-links",children:[$&&(0,c.jsx)("a",{className:"wi-legal-link",href:$,target:"_blank",rel:"noopener noreferrer",onClick:b=>Ze(b,$,{category:"terms",origin:"terms"},Ye),children:W}),$&&he&&(0,c.jsx)("span",{className:"wi-legal-sep","aria-hidden":!0,children:"\xB7"}),he&&(0,c.jsx)("a",{className:"wi-legal-link",href:he,target:"_blank",rel:"noopener noreferrer",onClick:b=>Ze(b,he,{category:"privacy",origin:"privacy"},Ye),children:ye})]}):null,Lr=H?(0,c.jsxs)("button",{type:"button",className:"wi-disconnect-btn",onClick:()=>{H(),T()},children:[(0,c.jsx)(Yr,{size:16}),(0,c.jsx)("span",{className:"wi-disconnect-label",children:J})]}):null,Qs=f&&!ue?(0,c.jsxs)("div",{className:"wi-action-row","aria-label":"Wallet actions",children:[(0,c.jsxs)("button",{type:"button",className:Y("wi-action-card",we&&"wi-action-card--dimmed"),onClick:$e,disabled:!j&&!we,"aria-disabled":we||void 0,"aria-label":"Buy",children:[(0,c.jsx)(oi,{size:20}),(0,c.jsx)("span",{children:"Buy"})]}),x?(0,c.jsxs)("button",{type:"button",className:"wi-action-card",onClick:js,"aria-label":"Bridge",children:[(0,c.jsx)(ri,{size:20}),(0,c.jsx)("span",{children:"Bridge"})]}):(0,c.jsxs)("button",{type:"button",className:"wi-action-card",onClick:Mo,disabled:!Mo,"aria-label":"Receive",children:[(0,c.jsx)(qo,{size:20}),(0,c.jsx)("span",{children:"Receive"})]}),(0,c.jsxs)("button",{type:"button",className:"wi-action-card",onClick:Sr,disabled:!Sr,"aria-label":"Send",children:[(0,c.jsx)(ti,{size:20}),(0,c.jsx)("span",{children:"Send"})]}),(0,c.jsxs)("button",{type:"button",className:"wi-action-card",onClick:()=>Ke("portfolio"),disabled:!De,"aria-label":"View portfolio",children:[(0,c.jsx)(ni,{size:20}),(0,c.jsx)("span",{children:"Portfolio"})]})]}):null,Zs=(0,c.jsxs)("div",{className:Y("wi-view-inner",ce.current&&"wi-view-wallet"),children:[It&&(0,c.jsxs)("div",{className:"wi-total-section",children:[(0,c.jsxs)("div",{className:"wi-total-head",children:[(0,c.jsx)("span",{className:"wi-total-label",children:Ee}),(0,c.jsx)("span",{role:"button",tabIndex:0,className:"wi-total-eye",onClick:b=>{b.stopPropagation(),C(R=>!R)},onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),b.stopPropagation(),C(R=>!R))},"aria-label":st?"Show balance":"Hide balance",children:st?(0,c.jsx)(Jr,{}):(0,c.jsx)(Xr,{})})]}),(0,c.jsx)("div",{className:"wi-total-body",children:Oe?(0,c.jsx)("div",{className:"wi-skeleton-block wi-total-skeleton",style:{width:160,height:42}}):(0,c.jsx)("div",{className:"wi-total-value","data-hidden":st||void 0,children:st?(0,c.jsx)("span",{className:"wi-total-mask",children:"\u2022\u2022\u2022\u2022\u2022\u2022"}):(0,c.jsxs)(c.Fragment,{children:[xt&&(0,c.jsx)("span",{className:"wi-total-lte",children:"\u2264"}),(0,c.jsx)("span",{className:"wi-total-currency",children:"$"}),(0,c.jsx)("span",{className:"wi-total-amount",children:Oo.main}),Oo.decimal&&(0,c.jsx)("span",{className:"wi-total-decimal",children:Oo.decimal})]})})})]}),We==="top"&&(ue?(0,c.jsx)("div",{className:"wi-nav-fixed",children:ue}):Qs),f&&(0,c.jsx)("div",{ref:Cr,className:"wi-scrollable-body","data-vaul-no-drag":!0,children:(0,c.jsxs)("div",{className:"wi-token-list",children:[wt&&Array.from({length:5},(b,R)=>(0,c.jsxs)("div",{className:"wi-skeleton-item",children:[(0,c.jsxs)("div",{className:"wi-skeleton-left",children:[(0,c.jsx)("div",{className:"wi-skeleton-block wi-skeleton-icon"}),(0,c.jsxs)("div",{className:"wi-skeleton-lines",children:[(0,c.jsx)("div",{className:"wi-skeleton-block",style:{width:64,height:14}}),(0,c.jsx)("div",{className:"wi-skeleton-block",style:{width:80,height:12}})]})]}),(0,c.jsxs)("div",{className:"wi-skeleton-right",children:[(0,c.jsx)("div",{className:"wi-skeleton-block",style:{width:72,height:14}}),(0,c.jsx)("div",{className:"wi-skeleton-block",style:{width:48,height:12}})]})]},R)),!wt&&ot.length===0&&!m&&(0,c.jsx)("div",{className:"wi-empty",children:"No Tokens Found"}),ot.map(b=>{let R=je.get(Et(b.chainId,b.address)),q=R?parseFloat(R.percent_change_24h):null,Pe=q!==null&&q>=0,Z=Nn(r,b.chainId);return(0,c.jsxs)("button",{type:"button",className:"wi-token-item wi-token-item--button",onClick:()=>Fo(b),"aria-label":`Send ${b.symbol}`,children:[(0,c.jsxs)("div",{className:"wi-token-left",children:[(0,c.jsxs)("div",{className:"wi-token-icon-wrap",children:[(0,c.jsx)("img",{src:b.icon_url,alt:b.symbol,className:"wi-token-icon",width:32,height:32,loading:"lazy",draggable:!1,onLoad:$n,onError:xe=>{xe.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),Z&&(0,c.jsx)("img",{src:Z,alt:"","aria-hidden":!0,className:"wi-token-chain-badge",width:14,height:14,loading:"lazy",draggable:!1,onError:xe=>{xe.currentTarget.style.display="none"}})]}),(0,c.jsxs)("div",{className:"wi-token-info",children:[(0,c.jsx)("span",{className:"wi-token-name",children:b.symbol}),R&&(0,c.jsxs)("div",{className:"wi-token-price-row",children:[(0,c.jsx)("span",{className:"wi-token-price",children:Ko(R.price)}),(0,c.jsx)("span",{className:"wi-token-change","data-positive":Pe,"data-zero":q===0||void 0,children:q!==null&&(q===0?"0%":`${Pe?"+":"-"}${(Pe?Math.floor:Math.ceil)(Math.abs(q)*100)/100}%`)})]})]})]}),(0,c.jsxs)("div",{className:"wi-token-right",children:[(0,c.jsx)("span",{className:"wi-token-balance",children:Ot(b.quantity.numeric,b.quantity.decimals)}),R&&(0,c.jsx)("span",{className:"wi-token-value",children:ai(b.quantity.numeric,b.quantity.decimals,R.price)})]})]},`${b.address}-${b.chainId}`)}),m&&Bt&&Array.from({length:3},(b,R)=>(0,c.jsxs)("div",{className:"wi-skeleton-item",children:[(0,c.jsxs)("div",{className:"wi-skeleton-left",children:[(0,c.jsx)("div",{className:"wi-skeleton-block wi-skeleton-icon"}),(0,c.jsxs)("div",{className:"wi-skeleton-lines",children:[(0,c.jsx)("div",{className:"wi-skeleton-block",style:{width:64,height:14}}),(0,c.jsx)("div",{className:"wi-skeleton-block",style:{width:80,height:12}})]})]}),(0,c.jsxs)("div",{className:"wi-skeleton-right",children:[(0,c.jsx)("div",{className:"wi-skeleton-block",style:{width:72,height:14}}),(0,c.jsx)("div",{className:"wi-skeleton-block",style:{width:48,height:12}})]})]},`forge-sk-${R}`)),m&&!Bt&&!wt&&ot.length===0&&B.length===0&&(0,c.jsx)("div",{className:"wi-empty",children:"No Tokens Found"}),m&&B.map(b=>{let R=Ao.get(b.token)||"",q=Nn(r,ze[r].cross);return(0,c.jsxs)("div",{className:"wi-token-item",children:[(0,c.jsxs)("div",{className:"wi-token-left",children:[(0,c.jsxs)("div",{className:"wi-token-icon-wrap",children:[(0,c.jsx)("img",{src:R||"https://contents.crosstoken.io/wallet/token/images/FT.png",alt:b.token_name,className:"wi-token-icon",width:32,height:32,loading:"lazy",draggable:!1,onLoad:$n,onError:Pe=>{Pe.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),q&&(0,c.jsx)("img",{src:q,alt:"","aria-hidden":!0,className:"wi-token-chain-badge",width:14,height:14,loading:"lazy",draggable:!1,onError:Pe=>{Pe.currentTarget.style.display="none"}})]}),(0,c.jsxs)("div",{className:"wi-token-info",children:[(0,c.jsx)("span",{className:"wi-token-name",children:b.token_name}),(0,c.jsx)("div",{className:"wi-token-price-row",children:(0,c.jsxs)("span",{className:"wi-token-price",children:[Ot(b.current_price,18)," CROSS"]})})]})]}),(0,c.jsxs)("div",{className:"wi-token-right",children:[(0,c.jsx)("span",{className:"wi-token-balance",children:Ot(b.balance,18)}),(0,c.jsx)("span",{className:"wi-token-value",children:Ko(b.current_value_usd)})]})]},`forge-${b.token}`)})]})}),We==="bottom"&&ue&&(0,c.jsx)("div",{className:"wi-nav-fixed",children:ue}),Lr&&(0,c.jsx)("div",{className:"wi-wallet-disconnect-row",children:Lr})]},"wallet"),Ys=De?(0,c.jsx)("div",{className:Y("wi-view-inner wi-portfolio-body",ce.current&&"wi-view-portfolio"),children:(0,c.jsx)(Jt,{env:r,theme:s,walletAddress:w,showHeader:!1,onOutlink:Ye,lpBalanceReader:Xe})},"portfolio"):null,Xs=Te?(0,c.jsx)("div",{className:Y("wi-view-inner wi-send-body",ce.current&&"wi-view-send"),children:(0,c.jsx)(Tn,{env:r,theme:s,walletAddress:w,accountName:v,accounts:I,initialStep:$s,token:Te,tokens:ot,onTokenChange:ee,sendTransaction:gt,getTransactionReceipt:be,estimateGas:Nt,getTokenPriceUsd:b=>{let R=je.get(Et(b.chainId,b.address));if(!R?.price)return;let q=parseFloat(R.price);return Number.isFinite(q)?q:void 0},onClose:T,onBackToWallet:Gn,onSubmitted:Vs,onSuccess:qs,onFailed:Ks,onOutlink:Ye})},"send"):null,Js=A.useMemo(()=>Ae||ot.map(b=>{let R=je.get(Et(b.chainId,b.address)),q=R?.price?parseFloat(R.price):void 0;return{name:b.name,symbol:b.symbol,chainId:b.chainId,address:b.address,decimals:b.quantity.decimals,balance:Cn(b.quantity.numeric,b.quantity.decimals),iconUrl:b.icon_url,priceUsd:Number.isFinite(q)?q:void 0}}),[Ae,je,ot]),el=(0,c.jsx)("div",{className:Y("wi-view-inner wi-bridge-body",ce.current&&"wi-view-send"),children:(0,c.jsx)(An,{env:r,walletAddress:w,tokens:Js,history:Me,termsUrl:$,getQuote:ke,getToTokens:pe,getApproval:Se,approveBridge:Tt,submitBridge:Je,onClose:T,onBackToWallet:Gn})},"bridge"),zo=!!M&&v?.trim().toLowerCase()!=="my wallet",Er=(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("span",{className:"wi-receive-avatar",children:[(0,c.jsx)("span",{className:"wi-avatar-fallback",style:Rr}),jn&&(0,c.jsx)("img",{src:jn,alt:"",className:"wi-avatar-img",width:24,height:24,draggable:!1,onLoad:$n,onError:b=>{b.currentTarget.style.display="none"}})]}),(0,c.jsx)("span",{className:"wi-receive-account-name",children:v??"Account 1"}),zo&&(0,c.jsx)("span",{className:"wi-receive-chevron","data-open":wn,"aria-hidden":"true",children:(0,c.jsx)(Vt,{size:16})})]}),tl=(0,c.jsxs)("div",{className:Y("wi-view-inner wi-qr-body",ce.current&&"wi-view-qr"),children:[(0,c.jsxs)("div",{className:"wi-receive-section",children:[zo?(0,c.jsx)("button",{type:"button",className:"wi-receive-account wi-receive-account--btn",onClick:()=>{Un(!0),M?.()},"aria-label":"Switch account",children:Er}):(0,c.jsx)("div",{className:"wi-receive-account",children:Er}),(0,c.jsxs)("div",{className:"wi-qr-block",children:[(0,c.jsxs)("div",{className:"wi-qr-box",children:[(0,c.jsx)(ws.QRCodeSVG,{value:w,size:180,level:"H",marginSize:2,...y&&{imageSettings:{src:y,height:33,width:33,excavate:!0}}}),!y&&(0,c.jsx)("div",{className:"wi-qr-logo",children:(0,c.jsx)(ei,{size:33})})]}),(0,c.jsx)("p",{className:"wi-qr-address",children:w})]}),(0,c.jsxs)("button",{type:"button",className:"wi-qr-copy-btn",onClick:Tr,children:[(0,c.jsx)("span",{className:"wi-qr-copy-icon",children:an?(0,c.jsx)(kn,{size:16}):(0,c.jsx)(Vo,{size:16})}),(0,c.jsx)("span",{className:"wi-qr-copy-text",children:an?"Copied!":"Copy address"})]})]}),Ir&&(0,c.jsx)("div",{className:"wi-receive-footer",children:Ir})]},"qr"),nl=U==="qr"||U==="portfolio"||U==="send"||U==="bridge",Ar=re!==null?(0,c.jsx)("div",{className:"wi-builtin-footer",children:re}):null,Pr=(0,c.jsxs)("div",{className:"wi-account-text",children:[zo?(0,c.jsxs)("button",{type:"button",className:"wi-account-row wi-account-row--btn",onClick:()=>{Un(!0),M?.()},"aria-label":"Switch account","aria-expanded":wn,children:[(0,c.jsx)("span",{className:"wi-account-name",children:v??"Account 1"}),(0,c.jsx)("span",{className:"wi-account-switch","data-open":wn,"aria-hidden":"true",children:(0,c.jsx)(Vt,{size:20})})]}):(0,c.jsx)("div",{className:"wi-account-row",children:(0,c.jsx)("span",{className:"wi-account-name",children:v??"Account 1"})}),(0,c.jsxs)("button",{type:"button",className:"wi-address-row-btn",onClick:Tr,"aria-label":"Copy address",children:[(0,c.jsx)("span",{className:"wi-account-address",children:Qe(w)}),(0,c.jsx)("span",{className:"wi-account-copy","data-copied":an,children:an?(0,c.jsx)(kn,{size:12}):(0,c.jsx)(Vo,{size:12})})]})]}),Br=(0,c.jsxs)(c.Fragment,{children:[o,U==="qr"?(0,c.jsx)("div",{className:"wi-sticky-header",children:(0,c.jsxs)("div",{className:"wi-header wi-header--receive",children:[(0,c.jsx)("button",{type:"button",className:"wi-header-back",onClick:Gn,"aria-label":"Back",children:(0,c.jsx)(Lt,{size:24})}),(0,c.jsx)("span",{className:"wi-receive-title",children:"Receive"}),(0,c.jsx)("button",{type:"button",className:"wi-header-action",onClick:T,"aria-label":"Close",children:(0,c.jsx)(vt,{size:24})})]})}):U==="send"||U==="bridge"?null:nl?(0,c.jsxs)("div",{className:"wi-sticky-header",children:[(0,c.jsxs)("div",{className:"wi-header wi-header--wallet wi-header--sub-account",children:[(0,c.jsx)("button",{type:"button",className:"wi-header-back",onClick:Gn,"aria-label":"Back",children:(0,c.jsx)(Lt,{size:24})}),(0,c.jsx)("div",{className:"wi-account-block wi-account-block--sub-account",children:Pr}),(0,c.jsx)("button",{type:"button",className:"wi-header-action",onClick:T,"aria-label":"Close",children:(0,c.jsx)(vt,{size:24})})]}),(0,c.jsx)("hr",{className:"wi-divider"})]}):(0,c.jsxs)("div",{className:"wi-sticky-header",children:[(0,c.jsxs)("div",{className:"wi-header wi-header--wallet",children:[(0,c.jsxs)("div",{className:"wi-account-block",children:[(0,c.jsxs)("div",{className:"wi-avatar",children:[(0,c.jsx)("div",{className:"wi-avatar-fallback",style:Rr}),jn&&(0,c.jsx)("img",{src:jn,alt:"",className:"wi-avatar-img",width:28,height:28,draggable:!1,onLoad:$n,onError:b=>{b.currentTarget.style.display="none"}})]}),Pr]}),(0,c.jsxs)("div",{className:"wi-header-actions",children:[h&&x&&(0,c.jsx)("button",{type:"button",className:"wi-header-action wi-header-action--qr",onClick:Mo,"aria-label":"Show QR code",children:(0,c.jsx)(qo,{size:20})}),(0,c.jsx)("button",{type:"button",className:"wi-header-action",onClick:T,"aria-label":"Close",children:(0,c.jsx)(vt,{size:24})})]})]}),(0,c.jsx)("hr",{className:"wi-divider"})]}),(0,c.jsxs)("div",{className:"wi-view-container",children:[U==="wallet"&&Zs,U==="qr"&&tl,U==="portfolio"&&Ys,U==="send"&&Xs,U==="bridge"&&el]}),U==="wallet"&&_e&&(0,c.jsx)("div",{className:"wi-action-toast",role:"status","aria-live":"polite",children:_e}),U==="wallet"&&F&&(0,c.jsxs)("a",{className:"wi-send-toast",href:Po??"#",target:"_blank",rel:"noopener noreferrer",onClick:b=>{if(!Po){b.preventDefault();return}Ze(b,Po,{category:"send",origin:"send-transaction",payload:{chainId:F.chainId,txHash:F.txHash}},Ye)},children:[(0,c.jsx)("span",{className:"wi-send-toast-icon","data-status":F.status,"aria-hidden":!0,children:F.status==="pending"?(0,c.jsx)("span",{className:"wi-send-toast-spinner"}):F.status==="error"?(0,c.jsx)("span",{className:"wi-send-toast-error-dot"}):(0,c.jsx)(ii,{size:20})}),(0,c.jsxs)("span",{className:"wi-send-toast-copy",children:[(0,c.jsx)("span",{className:"wi-send-toast-title",children:F.status==="pending"?"Sending...":F.status==="error"?"Send failed":"Send complete"}),(0,c.jsx)("span",{className:"wi-send-toast-desc",children:F.status==="pending"||F.status==="error"?F.description:"Tap to see your transaction"})]})]}),Ar&&U!=="portfolio"&&U!=="send"&&(0,c.jsx)("div",{className:"wi-sticky-footer",children:(0,c.jsx)("div",{className:"wi-footer",ref:V,children:Ar})})]}),Fr={...fe,...oe>0?{"--wi-footer-height":`${oe}px`}:null};return a?(0,c.jsxs)(Pn.Drawer.Portal,{children:[d&&(0,c.jsx)(Pn.Drawer.Overlay,{className:"wi-drawer-overlay"}),(0,c.jsxs)(Pn.Drawer.Content,{className:Y("wi-drawer-content",n),"data-theme":s,"data-vaul-no-drag":p==="left"||p==="right"?!0:void 0,style:Fr,"data-direction":p,"data-no-balance":!f||void 0,"data-has-footer":oe>0||void 0,"data-view":U,children:[(0,c.jsx)(Pn.Drawer.Title,{className:"wi-sr-only",children:"My Wallet"}),Br]})]}):(0,c.jsxs)(c.Fragment,{children:[d&&l&&(0,c.jsx)("div",{className:"wi-drawer-overlay",onClick:T}),(0,c.jsx)(So.Portal,{children:(0,c.jsx)(So.Content,{align:e,sideOffset:t,className:Y("wi-popover-content",n),"data-theme":s,style:Fr,"data-no-balance":!f||void 0,"data-has-footer":oe>0||void 0,"data-view":U,children:Br})})]})}var vs=D(require("react"),1);function ys({position:e="top",children:t}){let{setNavContent:n,setNavPosition:o}=Mt();return vs.useEffect(()=>(n(t),o(e),()=>n(null)),[t,e,n,o]),null}var ks=D(require("react"),1);function Ss({children:e}){let{setFooterContent:t}=Mt();return ks.useEffect(()=>(t(e),()=>t(null)),[e,t]),null}O(`[data-theme=dark].wi-popover-content,[data-theme=dark].wi-drawer-content{--wi-primary: var(--ds-accent-primary-default, #019d92);--wi-secondary: var(--ds-system-red-default, #e70077);--wi-surface-bg: var(--ds-bg-default, #121212);--wi-surface-default: var(--ds-surface-medium, rgba(255, 255, 255, .05));--wi-surface-subtle: var(--ds-surface-high, rgba(255, 255, 255, .1));--wi-border-default: var(--ds-border-default, rgba(255, 255, 255, .05));--wi-border-subtle: var(--ds-border-medium, rgba(255, 255, 255, .1));--wi-texticon-primary: var(--ds-content-highest, #ffffff);--wi-texticon-secondary: var(--ds-content-medium, rgba(255, 255, 255, .7));--wi-texticon-tertiary: var(--ds-content-low, rgba(255, 255, 255, .5));--wi-on-primary: var(--ds-accent-primary-on, #ffffff);--wi-error: var(--ds-system-red-default, #e70077);--wi-shadow: 0 2px 16px -2px rgba(0, 0, 0, .4)}[data-theme=light].wi-popover-content,[data-theme=light].wi-drawer-content{--wi-primary: var(--ds-accent-primary-default, #019d92);--wi-secondary: var(--ds-system-red-default, #e70077);--wi-surface-bg: var(--ds-bg-default, #ffffff);--wi-surface-default: var(--ds-surface-medium, rgba(18, 18, 18, .05));--wi-surface-subtle: var(--ds-surface-high, rgba(18, 18, 18, .1));--wi-border-default: var(--ds-border-default, rgba(18, 18, 18, .05));--wi-border-subtle: var(--ds-border-medium, rgba(18, 18, 18, .1));--wi-texticon-primary: var(--ds-content-highest, #121212);--wi-texticon-secondary: var(--ds-content-medium, rgba(18, 18, 18, .7));--wi-texticon-tertiary: var(--ds-content-low, rgba(18, 18, 18, .5));--wi-on-primary: var(--ds-accent-primary-on, #ffffff);--wi-error: var(--ds-system-red-default, #e70077);--wi-shadow: 0 2px 16px -2px rgba(0, 0, 0, .15)}
11
+ `);O(`.wi-trigger-btn{display:inline-flex;align-items:center;gap:8px;padding:8px 16px;border:1px solid rgba(255,255,255,.2);background:#1a2332;border-radius:9999px;cursor:pointer;color:#fff;font-family:inherit;font-size:16px;font-weight:500;line-height:24px;letter-spacing:-.3125px;transition:opacity .15s ease}.wi-trigger-btn:hover{opacity:.85}.wi-trigger-btn[data-theme=light]{background:#f3f6f8;border-color:#1212121a;color:#121212}.wi-trigger-btn[data-mobile]{font-size:14px;padding:6px 12px;gap:6px;line-height:20px}.wi-trigger-address{white-space:nowrap}.wi-divider{height:1px;background:var(--wi-border-default);margin:0;border:none;flex-shrink:0}[data-theme=light] .wi-divider{background:#1212121a}[data-theme=dark] .wi-divider{background:#ffffff1a}
12
+ `);O(`@keyframes wi-fade-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}@keyframes wi-shimmer{0%{transform:translate(-100%)}to{transform:translate(100%)}}@keyframes wi-slide-in-right{0%{transform:translate(40px);opacity:0}to{transform:translate(0);opacity:1}}@keyframes wi-slide-in-left{0%{transform:translate(-40px);opacity:0}to{transform:translate(0);opacity:1}}
13
+ `);O(`.wi-popover-content{-webkit-font-smoothing:antialiased;z-index:100001;width:393px;border-radius:24px;border:1px solid var(--ds-border-default, rgba(0, 0, 0, .07));background:var(--wi-surface-bg);box-shadow:var(--ds-shadow-modal, var(--wi-shadow));animation:wi-fade-in .15s ease-out;height:600px;overflow:hidden;display:flex;flex-direction:column}.wi-popover-content[data-no-balance]{height:auto}.wi-popover-content[data-has-footer]:not([data-no-balance]){height:min(calc(600px + var(--wi-footer-height, 0px)),calc(100dvh - 32px))}.wi-drawer-overlay{position:fixed;inset:0;z-index:100000;background:#0009}.wi-drawer-content{-webkit-font-smoothing:antialiased;position:fixed;top:0;right:0;bottom:0;z-index:100001;width:100vw;max-height:100vh;background:var(--wi-surface-bg);overflow:hidden;display:flex;flex-direction:column;box-sizing:border-box}.wi-drawer-content[data-no-balance]{bottom:auto;max-height:none}.wi-drawer-content[data-no-balance][data-direction=bottom]{bottom:0;top:auto;border-radius:24px 24px 0 0}.wi-drawer-content[data-direction=left]{right:auto;left:0}.wi-drawer-content[data-direction=bottom]{top:0;left:0;right:0;width:100%;max-height:100dvh;margin:0 auto}.wi-drawer-content[data-direction=bottom][data-view=qr]{max-height:100dvh}.wi-popover-content[data-view=qr]{max-height:calc(100dvh - 32px)}.wi-sticky-header{flex-shrink:0;position:relative}.wi-header{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:24px}.wi-header--wallet{align-items:flex-start;border-bottom:1px solid var(--ds-border-default, rgba(0, 0, 0, .07))}.wi-header--wallet+.wi-divider{display:none}.wi-header--sub-account{align-items:center}.wi-header--sub-account .wi-header-back{width:32px;height:38px}.wi-header--sub-account .wi-header-action{flex-shrink:0}.wi-account-block{display:flex;align-items:center;gap:8px;flex:1;min-width:0}.wi-account-block--sub-account{align-items:center}.wi-avatar{flex-shrink:0;position:relative;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;border-radius:50%;background:var(--wi-surface-bg);box-sizing:border-box;overflow:hidden}.wi-avatar-fallback{position:absolute;inset:0;border-radius:50%;z-index:0}.wi-avatar-img{position:relative;z-index:1;width:32px;height:32px;border-radius:50%;object-fit:cover;background:transparent}.wi-account-text{display:flex;flex-direction:column;gap:2px;min-width:0}.wi-account-row{display:flex;align-items:center;gap:8px;min-width:0}.wi-account-row--btn{padding:2px;margin:0;width:fit-content;border:none;background:transparent;cursor:pointer;color:inherit;font:inherit;border-radius:6px;transition:background-color .15s ease,opacity .15s ease}.wi-account-row--btn:hover{background:var(--wi-surface-subtle, rgba(255, 255, 255, .06))}.wi-account-row--btn:focus-visible{outline:2px solid var(--wi-primary, #00d5aa);outline-offset:2px}.wi-account-name{font-family:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wi-account-switch{display:inline-flex;align-items:center;justify-content:center;padding:2px 0;border:none;background:transparent;color:var(--ds-content-low, rgba(0, 0, 0, .4));border-radius:4px;flex-shrink:0;transition:color .15s ease,transform .2s ease}.wi-account-switch[data-open=true]{transform:rotate(180deg)}.wi-account-row--btn:hover .wi-account-switch{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-address-row-btn{display:inline-flex;align-items:center;gap:4px;padding:0;border:none;background:transparent;cursor:pointer;color:var(--ds-content-medium, rgba(0, 0, 0, .65));font:inherit;text-align:left;min-width:0;transition:color .15s ease}.wi-address-row-btn:hover .wi-account-address,.wi-address-row-btn:hover .wi-account-copy{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-account-address{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:12px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wi-account-copy{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;color:var(--wi-texticon-tertiary);flex-shrink:0;transition:color .15s ease}.wi-account-copy[data-copied=true]{color:var(--ds-system-green-high, #00a869)}.wi-header-actions{display:flex;align-items:center;gap:16px;flex-shrink:0;margin-top:-4px}.wi-header-action{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:none;background:transparent;border-radius:0;cursor:pointer;color:var(--ds-content-low, rgba(0, 0, 0, .4));flex-shrink:0;transition:color .15s ease}.wi-header-action:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-header-action--qr{width:32px;height:32px;border-radius:8px;background:var(--ds-surface-medium, #f5f7fa);color:var(--ds-content-medium, rgba(0, 0, 0, .65));transition:background-color .15s ease,color .15s ease}.wi-header-action--qr:hover{background:var(--ds-surface-high, rgba(0, 0, 0, .08));color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-header--receive{align-items:center;border-bottom:1px solid var(--ds-border-default, rgba(0, 0, 0, .07))}.wi-header--receive .wi-header-action,.wi-header--sub-account .wi-header-action{position:absolute;top:24px;right:24px}.wi-receive-title{position:absolute;left:50%;transform:translate(-50%);font-family:inherit;font-size:18px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-highest, #000000);text-align:center;pointer-events:none}.wi-header-info{flex:1;display:flex;flex-direction:column;gap:8px;min-width:0}.wi-header-title{font-family:inherit;font-size:16px;font-weight:600;line-height:1.3;color:var(--wi-texticon-primary);margin:0}.wi-header-close{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;padding:0;border:none;background:var(--wi-surface-default);border-radius:8px;cursor:pointer;color:var(--ds-content-low, #00000066);transition:opacity .15s ease}.wi-header-close:hover{opacity:.7}.wi-total-section{margin:24px 24px 0;padding:0;flex-shrink:0;display:flex;flex-direction:column;gap:8px;border:none;background:transparent;border-radius:12px;color:inherit;font:inherit;text-align:left;width:auto}.wi-action-row{display:flex;align-items:flex-start;gap:8px;width:auto;margin:24px 24px 0}.wi-action-card{appearance:none;display:flex;flex:1 1 0;min-width:0;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:10px 8px;border:none;border-radius:12px;background:var(--ds-surface-medium, #f5f7fa);color:var(--ds-content-high, rgba(0, 0, 0, .85));font-family:inherit;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em;text-align:center;cursor:pointer;transition:background-color .15s ease,color .15s ease}.wi-action-card:hover:not(:disabled){background:#2e3544!important;color:var(--ds-content-high, rgba(0, 0, 0, .85))}:root[data-ds-theme=light] .wi-action-card:hover:not(:disabled){background:#e4e8ef!important;color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-action-card:disabled{cursor:default}.wi-action-card>svg{flex-shrink:0}.wi-action-card:not(:disabled){transition:background-color .15s ease,transform .1s ease}.wi-action-card:active:not(:disabled){transform:scale(.93)}.wi-total-head{display:flex;align-items:center;gap:4px}.wi-total-body{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0}.wi-total-label{font-family:inherit;font-size:14px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.wi-total-eye{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;padding:0;color:var(--ds-content-low, rgba(0, 0, 0, .4));cursor:pointer;transition:color .15s ease;border-radius:4px}.wi-total-eye:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-total-eye:focus-visible{outline:1px solid var(--wi-texticon-secondary);outline-offset:2px}.wi-total-value{display:flex;align-items:baseline;gap:0;font-family:inherit;font-weight:600;line-height:1.25;color:var(--ds-content-highest, #000000);font-variant-numeric:tabular-nums;min-height:45px;white-space:nowrap}.wi-total-currency,.wi-total-amount,.wi-total-decimal{font-size:36px;color:var(--ds-content-highest, #000000)}.wi-total-lte{margin-right:2px;font-weight:500;font-size:22px;color:var(--wi-texticon-secondary)}.wi-total-mask{letter-spacing:2px;font-size:32px;color:var(--wi-texticon-secondary)}.wi-total-skeleton{border-radius:6px}.wi-scrollable-body{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;padding:8px 0 0;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.15) transparent;overscroll-behavior:contain}.wi-drawer-content .wi-scrollable-body{touch-action:pan-y}[data-theme=light] .wi-scrollable-body{scrollbar-color:rgba(0,0,0,.12) transparent}.wi-scrollable-body::-webkit-scrollbar{width:4px}.wi-scrollable-body::-webkit-scrollbar-track{background:transparent}.wi-scrollable-body::-webkit-scrollbar-thumb{background:#ffffff26;border-radius:4px}.wi-scrollable-body::-webkit-scrollbar-thumb:hover{background:#ffffff40}[data-theme=light] .wi-scrollable-body::-webkit-scrollbar-thumb{background:#0000001f}[data-theme=light] .wi-scrollable-body::-webkit-scrollbar-thumb:hover{background:#0003}.wi-nav-fixed{flex-shrink:0;padding:0 24px}.wi-token-list{display:flex;flex-direction:column;gap:0;padding:8px 0}.wi-token-item{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:12px 24px;border:none;background:transparent;text-align:left;font-family:inherit;width:100%;box-sizing:border-box}.wi-token-item--button{cursor:pointer;background:var(--ds-surface-default, #ffffff);transition:none}.wi-token-item--button:hover{background:#252b39!important}:root[data-ds-theme=light] .wi-token-item--button:hover{background:#eff3f8!important}button.wi-token-item:focus-visible{outline:2px solid var(--wi-primary);outline-offset:2px;border-radius:4px}.wi-token-left{display:flex;align-items:center;gap:16px;min-width:0}.wi-token-icon-wrap{position:relative;width:40px;height:40px;flex-shrink:0}.wi-token-icon{width:40px;height:40px;border-radius:0;object-fit:contain;opacity:0;transition:opacity .2s ease}.wi-token-icon[data-loaded=true]{opacity:1}.wi-token-chain-badge{position:absolute;right:0;bottom:0;width:14px;height:14px;border-radius:50%;background:var(--wi-surface-bg);box-shadow:0 0 0 1.5px var(--wi-surface-bg);object-fit:contain}.wi-token-info{display:flex;flex-direction:column;min-width:0}.wi-token-name{font-family:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));white-space:nowrap}.wi-token-price-row{display:flex;align-items:center;gap:8px}.wi-token-price{font-family:inherit;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4));white-space:nowrap}.wi-token-change{font-family:inherit;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em;white-space:nowrap}.wi-token-change[data-positive=true]{color:var(--ds-system-green-high, #00a0a2)}.wi-token-change[data-positive=false]{color:var(--ds-system-red-high, #a80927)}.wi-token-change[data-zero]{color:var(--ds-content-low, rgba(0, 0, 0, .4))}.wi-token-right{display:flex;flex-direction:column;align-items:flex-end;flex-shrink:0}.wi-token-balance{font-family:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-highest, #000000);white-space:nowrap}.wi-token-value{font-family:inherit;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4));white-space:nowrap}.wi-sticky-footer{flex-shrink:0}.wi-footer{padding:16px 24px 24px}.wi-builtin-footer{display:flex;flex-direction:column;gap:8px;align-items:stretch}.wi-wallet-disconnect-row{display:flex;justify-content:flex-end;flex-shrink:0;padding:16px 24px;border-top:1px solid var(--ds-border-default, rgba(0, 0, 0, .07))}.wi-send-toast{position:absolute;left:15px;right:15px;bottom:20px;z-index:2;display:flex;align-items:center;gap:12px;min-height:52px;padding:12px;border-radius:12px;background:var(--ds-surface-inverted, #1e232e);color:var(--ds-content-inverted, #ffffff);box-sizing:border-box;text-decoration:none}.wi-action-toast{position:absolute;left:15px;right:15px;bottom:20px;z-index:3;padding:12px 14px;border-radius:12px;background:var(--ds-surface-inverted, #1e232e);color:var(--ds-content-inverted, #ffffff);font-size:14px;line-height:1.4;text-align:center;box-sizing:border-box;animation:wi-action-toast-in .18s ease-out}.wi-popover-content:has(.wi-wallet-disconnect-row) .wi-action-toast,.wi-drawer-content:has(.wi-wallet-disconnect-row) .wi-action-toast{bottom:72px}@keyframes wi-action-toast-in{0%{transform:translateY(8px);opacity:0}to{transform:translateY(0);opacity:1}}.wi-action-card--dimmed{opacity:.4;cursor:pointer}.wi-action-card--dimmed:hover{opacity:.5}.wi-popover-content:has(.wi-wallet-disconnect-row) .wi-send-toast,.wi-drawer-content:has(.wi-wallet-disconnect-row) .wi-send-toast{bottom:72px}.wi-send-toast:hover{opacity:.92}.wi-send-toast-icon{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;flex-shrink:0;color:var(--ds-accent-primary-default, #00b4b7)}.wi-send-toast-spinner{width:18px;height:18px;border:2px solid rgba(0,232,201,.22);border-top-color:var(--ds-accent-primary-on-inverted, #00e8c9);border-radius:50%;animation:wi-send-toast-spin .8s linear infinite}.wi-send-toast-error-dot{width:18px;height:18px;border-radius:50%;background:var(--ds-system-red-default, #ff3358)}@keyframes wi-send-toast-spin{to{transform:rotate(360deg)}}.wi-send-toast-copy{display:flex;min-width:0;flex-direction:column}.wi-send-toast-title{font-family:inherit;font-size:14px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-inverted, #ffffff)}.wi-send-toast-desc{font-family:inherit;font-size:12px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ds-accent-primary-on-inverted, #00e8c9)}.wi-send-toast-icon[data-status=error]+.wi-send-toast-copy .wi-send-toast-desc{color:var(--ds-system-red-default, #ff3358)}.wi-disconnect-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:16px;padding:0;border:none;background:transparent;color:var(--ds-content-low, rgba(0, 0, 0, .4));font-family:inherit;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em;cursor:pointer;transition:color .15s ease}.wi-disconnect-btn:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-disconnect-label{white-space:nowrap}.wi-legal-links{display:inline-flex;align-items:center;justify-content:center;gap:6px;width:100%;flex-shrink:0;font-family:inherit;font-size:14px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4))}.wi-receive-avatar .wi-avatar-fallback{position:absolute;inset:0;border-radius:50%;z-index:0}.wi-receive-avatar .wi-avatar-img{width:24px;height:24px}.wi-legal-link{color:var(--ds-content-low, rgba(0, 0, 0, .4));text-decoration:underline;text-underline-offset:2px;transition:color .15s ease}.wi-legal-link:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-legal-sep{color:inherit}.wi-empty{display:flex;align-items:center;justify-content:center;padding:32px 0;font-family:inherit;font-size:16px;color:var(--wi-texticon-secondary)}.wi-skeleton-item{display:flex;align-items:center;justify-content:space-between;padding:4px 0}.wi-skeleton-left{display:flex;align-items:center;gap:12px}.wi-skeleton-block{border-radius:6px;background:var(--wi-border-default);position:relative;overflow:hidden}.wi-skeleton-block:after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,transparent 0%,rgba(255,255,255,.06) 50%,transparent 100%);animation:wi-shimmer 1.5s ease-in-out infinite}[data-theme=light] .wi-skeleton-block:after{background:linear-gradient(90deg,transparent 0%,rgba(0,0,0,.04) 50%,transparent 100%)}.wi-skeleton-icon{width:32px;height:32px;border-radius:50%;flex-shrink:0}.wi-skeleton-lines{display:flex;flex-direction:column;gap:6px}.wi-skeleton-right{display:flex;flex-direction:column;align-items:flex-end;gap:6px}.wi-header-back{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:none;background:transparent;cursor:pointer;color:var(--ds-content-low, rgba(0, 0, 0, .4));flex-shrink:0;transition:color .15s ease}.wi-header-back:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-view-container{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.wi-popover-content[data-view=qr] .wi-view-container,.wi-drawer-content[data-view=qr] .wi-view-container{flex:1;min-height:0}.wi-view-inner{display:flex;flex-direction:column;flex:1;min-height:0}.wi-view-wallet{animation:wi-slide-in-left .25s ease-out}.wi-view-qr,.wi-view-portfolio{animation:wi-slide-in-right .25s ease-out}.wi-qr-body{flex:1;min-height:0;display:flex;flex-direction:column}.wi-portfolio-body{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.wi-portfolio-body>.wp-embed{flex:1;min-height:0}.wi-portfolio-body .wp-body-inner{padding:16px 16px 32px;gap:32px}.wi-receive-section{flex:1;min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;padding:24px}.wi-receive-account{display:inline-flex;align-items:center;gap:8px;padding:4px 8px 4px 4px;border:0;background:var(--ds-surface-high, #edf1f2);border-radius:9999px;font-family:inherit;color:inherit}.wi-receive-account--btn{cursor:pointer;transition:none}.wi-receive-account--btn:hover{background:#2e3544}:root[data-ds-theme=light] .wi-receive-account--btn:hover{background:#e4e8ef}.wi-receive-avatar{position:relative;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:50%;overflow:hidden;flex-shrink:0}.wi-receive-account-name{font-family:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));white-space:nowrap}.wi-receive-account>svg{color:var(--ds-content-medium, rgba(0, 0, 0, .65));flex-shrink:0}.wi-receive-chevron{display:inline-flex;align-items:center;color:var(--ds-content-medium, rgba(0, 0, 0, .65));flex-shrink:0;transition:transform .2s ease}.wi-receive-chevron[data-open=true]{transform:rotate(180deg)}.wi-qr-block{display:flex;flex-direction:column;align-items:center;gap:16px}.wi-qr-box{position:relative;display:flex;align-items:center;justify-content:center;padding:10px;background:#fff;border-radius:6px;overflow:hidden}.wi-qr-logo{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);pointer-events:none}.wi-qr-address{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:16px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65));text-align:center;word-break:break-all;max-width:281px;margin:0}.wi-qr-copy-btn{display:inline-flex;align-items:center;justify-content:center;gap:9px;padding:12px 16px;border:1px solid var(--ds-border-default, rgba(0, 0, 0, .07));background:var(--ds-surface-default, #ffffff);border-radius:12px;cursor:pointer;transition:border-color .15s ease}.wi-qr-copy-btn:hover{border-color:var(--ds-border-medium, rgba(0, 0, 0, .18))}.wi-qr-copy-icon{display:inline-flex;color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-qr-copy-text{font-family:inherit;font-size:16px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));white-space:nowrap}.wi-receive-footer{flex-shrink:0;display:flex;align-items:center;justify-content:center;padding:16px 24px;border-top:1px solid var(--ds-border-default, rgba(0, 0, 0, .07))}.wi-drawer-content .wi-header{padding:16px}.wi-drawer-content .wi-header--receive .wi-header-action,.wi-drawer-content .wi-header--sub-account .wi-header-action{top:16px;right:16px}.wi-drawer-content .wi-total-section,.wi-drawer-content .wi-action-row{margin:16px 16px 0}.wi-drawer-content .wi-nav-fixed{padding:0 16px}.wi-drawer-content .wi-token-item{padding:12px 16px}.wi-drawer-content .wi-wallet-disconnect-row{padding:16px}
14
+ `);O(`.wi-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}
15
+ `);var Co=require("react/jsx-runtime"),od="https://terms.crosstoken.io/docs/cross-terms-of-use",rd="https://terms.crosstoken.io/docs/nexus-privacy-policy";function id({env:e,theme:t="dark",mobileBreakpoint:n=768,drawerDirection:o,modal:r,showBalance:s=!1,showForgeToken:a=!1,showGameToken:l=!0,showQR:p=!0,showBridge:d=!0,qrLogoSrc:f,walletAddress:m,accountName:g,sendAccounts:h,profileImageUrl:x,connectorId:y,connectorName:w,connectorIconUrl:v,preferredTokens:I=[],onSelectWallet:u,onCopyAddress:E,onBuy:T,onBuyDisabledMessage:M,onDisconnect:_,disconnectLabel:j="Disconnect",termsUrl:H=od,termsLabel:J="Terms of Service",privacyUrl:$=rd,privacyLabel:W="Privacy Policy",open:he,onOpenChange:ye,showPortfolio:fe=!1,portfolioTitle:ue="My Portfolio",showTotalAssets:We=!0,totalAssetsLabel:re="Total Assets USD",sendTransaction:U,getTransactionReceipt:te,estimateGas:Te,onOutlink:ee,lpBalanceReader:De,bridgeTokens:He,bridgeHistory:Re,getBridgeQuote:Ee,getBridgeToTokens:gt,getBridgeApproval:be,approveBridge:Nt,submitBridge:Ye,onReceive:Xe,onBridge:Ae,onSend:Me,style:ke,children:pe}){let Se=Ie(e),Tt=y?yn[y]:void 0,Je=w??Tt?.name,ht=v??Tt?.iconUrl,Ce=sn(`(max-width: ${n}px)`),Ge=o??(s?"right":"bottom"),bt=Ge==="left"||Ge==="right",_e=r??!1,et=he!==void 0,[tt,Ue]=Fe.useState(!1),we=et?he:tt,$e=Fe.useCallback(qe=>{et||Ue(qe),ye?.(qe)},[et,ye]),at=Fe.useCallback(()=>$e(!1),[$e]),[wt,je]=Fe.useState(null),[Rt,It]=Fe.useState("top"),[nt,xt]=Fe.useState(null),[Oe,st]=Fe.useState("wallet"),[C,V]=Fe.useState(null);Fe.useEffect(()=>{we||(st("wallet"),V(null))},[we]);let oe=Fe.useCallback(()=>{Xo(m),_?.()},[_,m]),Ve=Fe.useMemo(()=>({env:Se,theme:t,isMobile:Ce,open:we,drawerDirection:Ge,modal:_e,showBalance:s,showForgeToken:a,showGameToken:l,showQR:p,showBridge:d,qrLogoSrc:f,walletAddress:m,accountName:g,sendAccounts:h,profileImageUrl:x,connectorName:Je,connectorIconUrl:ht,preferredTokens:I,close:at,onSelectWallet:u,onCopyAddress:E,onBuy:T,onBuyDisabledMessage:M,onDisconnect:_?oe:void 0,disconnectLabel:j,termsUrl:H,termsLabel:J,privacyUrl:$,privacyLabel:W,portalStyle:ke,navContent:wt,navPosition:Rt,setNavContent:je,setNavPosition:It,footerContent:nt,setFooterContent:xt,view:Oe,setView:st,selectedSendToken:C,setSelectedSendToken:V,showPortfolio:fe,portfolioTitle:ue,showTotalAssets:We,totalAssetsLabel:re,sendTransaction:U,getTransactionReceipt:te,estimateGas:Te,onOutlink:ee,lpBalanceReader:De,bridgeTokens:He,bridgeHistory:Re,getBridgeQuote:Ee,getBridgeToTokens:gt,getBridgeApproval:be,approveBridge:Nt,submitBridge:Ye,onReceive:Xe,onBridge:Ae,onSend:Me}),[Se,t,Ce,we,Ge,_e,s,a,l,p,d,f,m,g,h,x,Je,ht,I,at,u,E,T,M,_,oe,j,H,J,$,W,ke,wt,Rt,nt,Oe,C,fe,ue,We,re,U,te,Te,ee,De,He,Re,Ee,gt,be,Nt,Ye,Xe,Ae,Me]);return(0,Co.jsx)(jo.Provider,{value:Ve,children:Ce?(0,Co.jsx)(Ns.Drawer.Root,{direction:Ge,open:we,onOpenChange:$e,handleOnly:bt,noBodyStyles:!0,repositionInputs:!1,children:pe},"drawer"):(0,Co.jsx)(Cs.Root,{open:we,onOpenChange:$e,children:pe},"popover")})}var on=Object.assign(id,{Trigger:ji,Content:xs,Nav:ys,Footer:Ss});var Ct=D(require("react"),1),Ds=D(require("@radix-ui/react-dialog"),1),Hs=require("vaul");var No=require("react"),To=(0,No.createContext)(null);function Bn(){let e=(0,No.useContext)(To);if(!e)throw new Error("WalletConnectModal compound components must be used within <WalletConnectModal>");return e}var rn=require("react");function Fn(){let[e,t]=(0,rn.useState)([]),[n,o]=(0,rn.useState)(!0);(0,rn.useEffect)(()=>{if(typeof window>"u"){o(!1);return}let s=[],a=p=>{let{info:d}=p.detail;d?.rdns&&!s.some(f=>f.rdns===d.rdns)&&(s.push({rdns:d.rdns,name:d.name,icon:d.icon}),t([...s]))};window.addEventListener("eip6963:announceProvider",a),window.addEventListener("eip6963:crossAnnounceProvider",a),window.dispatchEvent(new Event("eip6963:requestProvider")),window.dispatchEvent(new Event("eip6963:crossRequestProvider"));let l=setTimeout(()=>o(!1),500);return()=>{window.removeEventListener("eip6963:announceProvider",a),window.removeEventListener("eip6963:crossAnnounceProvider",a),clearTimeout(l)}},[]);let r=(0,rn.useCallback)(s=>e.some(a=>a.rdns===s),[e]);return{wallets:e,isDetected:r,isLoading:n}}var Ts=D(require("@radix-ui/react-dialog"),1),Rs=require("vaul");var br=require("react/jsx-runtime");function Is({asChild:e,children:t}){let{isMobile:n}=Bn(),o=n?Rs.Drawer.Trigger:Ts.Trigger;return(0,br.jsx)(o,{asChild:e??t!=null,children:t??(0,br.jsx)("button",{type:"button",children:"Connect Wallet"})})}var St=D(require("@radix-ui/react-dialog"),1),Mn=require("vaul");var P=require("react/jsx-runtime");function Ro(){return(0,P.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,P.jsx)("circle",{cx:"20",cy:"20",r:"20",fill:"#00D5AA"}),(0,P.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.3225 2.85742L23.7249 6.25982V11.8301L28.1175 7.43757L32.9292 12.2493L28.5806 16.5979H20.3225C18.4435 16.5979 16.9201 18.1212 16.9201 20.0003C16.9201 21.8794 18.4434 23.4027 20.3225 23.4027H28.5372L32.9293 27.7948L28.1176 32.6066L23.7249 28.2139V33.7407L20.3225 37.1431L16.9201 33.7407V28.2584L12.5719 32.6066L7.76022 27.7948L12.1524 23.4027H6.58209L3.17969 20.0003L6.58209 16.5979H12.1089L7.76035 12.2493L12.5721 7.43757L16.9201 11.7857V6.25982L20.3225 2.85742Z",fill:"black"})]})}function Ls(){return(0,P.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",children:[(0,P.jsxs)("g",{clipPath:"url(#clip0_1331_27065)",children:[(0,P.jsx)("path",{d:"M37.2488 38.4674L28.6626 35.8175L22.1876 39.8295L17.6699 39.8274L11.191 35.8175L2.60875 38.4674L-0.00195312 29.3328L2.60875 19.1947L-0.00195312 10.6234L2.60875 0L16.0192 8.30453H23.838L37.2488 0L39.8595 10.6234L37.2488 19.1947L39.8595 29.3328L37.2488 38.4674Z",fill:"#FF5C16"}),(0,P.jsx)("path",{d:"M2.60938 0L16.0201 8.31037L15.4868 14.0137L2.60938 0ZM11.1919 29.3366L17.0925 33.9956L11.1919 35.8175V29.3366ZM16.6209 21.6342L15.4868 14.0175L8.22768 19.1971L8.22374 19.195V19.1988L8.24628 24.5302L11.1899 21.6345L16.6209 21.6342ZM37.2477 0L23.837 8.31037L24.3685 14.0137L37.2477 0ZM28.6654 29.3366L22.7646 33.9956L28.6654 35.8175V29.3366ZM31.6313 19.1985V19.1947L31.6297 19.1968L24.3705 14.0175L23.2364 21.6342H28.6651L31.6108 24.5296L31.6313 19.1985Z",fill:"#FF5C16"}),(0,P.jsx)("path",{d:"M11.191 35.8175L2.60875 38.4674L-0.00195312 29.3366H11.191V35.8175ZM16.62 21.6321L18.2595 32.6435L15.9873 26.5208L8.24368 24.5296L11.189 21.6324H16.62V21.6321ZM28.6662 35.8175L37.2488 38.4674L39.8595 29.3366H28.6662V35.8175ZM23.2375 21.6321L21.598 32.6435L23.8699 26.5208L31.6138 24.5296L28.6665 21.6324H23.2375V21.6321Z",fill:"#E34807"}),(0,P.jsx)("path",{d:"M-0.00195312 29.3328L2.60875 19.1947H8.22284L8.2434 24.5278L15.9876 26.519L18.2595 32.6414L17.0916 33.9897L11.191 29.3307H-0.00195312V29.3328ZM39.8595 29.3328L37.2488 19.1947H31.6344L31.6138 24.5278L23.8702 26.519L21.598 32.6414L22.7657 33.9897L28.6665 29.3307H39.8595V29.3328ZM23.838 8.30444H16.0192L15.4882 14.0078L18.2597 32.6355H21.598L24.3713 14.0078L23.838 8.30444Z",fill:"#FF8D5D"}),(0,P.jsx)("path",{d:"M2.60875 0L-0.00195312 10.6234L2.60875 19.1947H8.22284L15.4859 14.0137L2.60875 0ZM14.9975 23.8438H12.4541L11.0693 25.2508L15.9893 26.515L14.9975 23.842V23.8438ZM37.2488 0L39.8595 10.6234L37.2488 19.1947H31.6344L24.3716 14.0137L37.2488 0ZM24.8637 23.8438H27.4107L28.7955 25.2526L23.8699 26.5191L24.8637 23.8418V23.8438ZM22.1857 36.1956L22.7659 33.9936L21.598 32.6453H18.2572L17.0896 33.9936L17.6696 36.1956",fill:"#661800"}),(0,P.jsx)("path",{d:"M22.1857 36.1951V39.831H17.6699V36.1951H22.1857Z",fill:"#C0C4CD"}),(0,P.jsx)("path",{d:"M11.1914 35.8131L17.672 39.8289V36.193L17.0917 33.9912L11.1914 35.8131ZM28.6649 35.8131L22.1841 39.8289V36.193L22.7644 33.9912L28.6649 35.8131Z",fill:"#E7EBF6"})]}),(0,P.jsx)("defs",{children:(0,P.jsx)("clipPath",{id:"clip0_1331_27065",children:(0,P.jsx)("rect",{width:"40",height:"40",fill:"white"})})})]})}function Es(){return(0,P.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,P.jsx)("path",{d:"M12.23 16.81L20 9.04L27.77 16.81L32.29 12.29L20 0L7.71 12.29L12.23 16.81Z",fill:"#F3BA2F"}),(0,P.jsx)("path",{d:"M9.04 20L4.52 15.48L0 20L4.52 24.52L9.04 20Z",fill:"#F3BA2F"}),(0,P.jsx)("path",{d:"M12.23 23.19L20 30.96L27.77 23.19L32.29 27.71L20 40L7.71 27.71L12.23 23.19Z",fill:"#F3BA2F"}),(0,P.jsx)("path",{d:"M35.48 24.52L40 20L35.48 15.48L30.96 20L35.48 24.52Z",fill:"#F3BA2F"}),(0,P.jsx)("path",{d:"M24.58 20L20 15.41L16.61 18.8L16.22 19.19L15.42 19.99L20 24.59L24.59 20L24.58 20Z",fill:"#F3BA2F"})]})}function As(){return(0,P.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"247",height:"246",viewBox:"0 0 247 246",fill:"none",children:[(0,P.jsx)("rect",{width:"247.005",height:"245.105",rx:"36",fill:"#121212"}),(0,P.jsx)("path",{d:"M89.1233 136.695V59.7551H118.481V140.524L74.5862 184.774L30.4787 140.524V107.55H59.9073V136.695L74.5862 151.303L89.1233 136.695Z",fill:"white"}),(0,P.jsx)("path",{d:"M59.8364 99.8915V59.7551H12.0414L30.4787 77.8377V99.8915H59.8364Z",fill:"#2FD7FF"}),(0,P.jsx)("path",{d:"M199.534 59.9334C202.562 60.0484 208.427 60.4824 212.031 63.6902C215.635 66.898 216.937 71.0498 216.937 73.1199V104.017L198.767 114.828L216.937 125.561V172.713C216.937 174.511 216.405 178.276 211.034 181.377C205.664 184.477 202.613 184.969 201.758 184.827H143.949C141.879 184.904 136.712 184.182 132.602 180.686C128.493 177.19 128.462 175.216 128.462 173.515V125.561L146.173 114.828L128.462 104.017V71.1268C128.462 69.721 130.109 65.7781 133.237 63.5701C137.147 60.8101 141.112 59.9334 144.409 59.9334H199.534ZM158.3 122.264V166.221H187.033V122.264H158.3ZM158.3 107.794H187.033V78.5272H158.3V107.794Z",fill:"white"})]})}function Ps(){return(0,P.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,P.jsxs)("g",{clipPath:"url(#clip0_1185_7785)",children:[(0,P.jsx)("path",{d:"M14 28C21.75 28 28 21.75 28 14C28 6.25 21.75 0 14 0C6.25 0 0 6.25 0 14C0 21.75 6.25 28 14 28Z",fill:"#EB0029"}),(0,P.jsx)("path",{d:"M19.4975 8.36232L6 6L13.103 23L23 11.5311L19.4975 8.36232ZM19.2801 9.4034L21.3449 11.27L15.6975 12.2424L19.2801 9.4034ZM14.4714 12.0479L8.51876 7.35252L18.247 9.05524L14.4714 12.0479ZM14.0467 12.8782L13.0765 20.5098L7.84385 7.98492L14.0467 12.8782ZM14.9454 13.2835L21.1983 12.2064L14.026 20.518L14.9454 13.2835Z",fill:"white"})]}),(0,P.jsx)("defs",{children:(0,P.jsx)("clipPath",{id:"clip0_1185_7785",children:(0,P.jsx)("rect",{width:"28",height:"28",fill:"white"})})})]})}function Bs(){return(0,P.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg",children:[(0,P.jsx)("path",{fill:"#FFC107",d:"M43.6 20.5H42V20H24v8h11.3A12 12 0 1 1 24 12c3 0 5.8 1.2 7.9 3l5.7-5.7A20 20 0 1 0 44 24c0-1.2-.1-2.4-.4-3.5z"}),(0,P.jsx)("path",{fill:"#FF3D00",d:"M6.3 14.7l6.6 4.8A12 12 0 0 1 24 12c3 0 5.8 1.2 7.9 3l5.7-5.7A20 20 0 0 0 6.3 14.7z"}),(0,P.jsx)("path",{fill:"#4CAF50",d:"M24 44c5.2 0 10-2 13.6-5.2l-6.3-5.3A12 12 0 0 1 12.7 28l-6.5 5A20 20 0 0 0 24 44z"}),(0,P.jsx)("path",{fill:"#1976D2",d:"M43.6 20.5H42V20H24v8h11.3a12 12 0 0 1-4.1 5.5l6.3 5.3C41 35.7 44 30.3 44 24c0-1.2-.1-2.4-.4-3.5z"})]})}function Fs(){return(0,P.jsx)("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:(0,P.jsx)("path",{d:"M17.05 20.28c-.98.95-2.05.8-3.08.35-1.09-.46-2.09-.48-3.24 0-1.44.62-2.2.44-3.06-.35C2.79 15.25 3.51 7.59 9.05 7.31c1.35.07 2.29.74 3.08.8 1.18-.24 2.31-.93 3.57-.84 1.51.12 2.65.72 3.4 1.8-3.12 1.87-2.38 5.98.48 7.13-.57 1.5-1.31 2.99-2.53 4.08zM12.03 7.25c-.15-2.23 1.66-4.07 3.74-4.25.29 2.58-2.34 4.5-3.74 4.25z"})})}function Ms(){return(0,P.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,P.jsx)("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}var Io={cross_embedded:{id:"cross_embedded",name:"CROSSx with Social",description:"Sign in with Google or Apple",icon:Ro},cross_wallet:{id:"cross_wallet",name:"CROSSx",description:"App approval is required",icon:Ro,featured:!0},cross_extension:{id:"cross_extension",name:"CROSSx Extension",description:"Browser extension approval is required",icon:Ro,rdns:"nexus.to.crosswallet.desktop",installUrl:"https://chromewebstore.google.com/detail/crossx/nninbdadmocnokibpaaohnoepbnpdgcg",visibility:"desktop-only"},metamask:{id:"metamask",name:"MetaMask",description:"Browser extension approval is required",icon:Ls,rdns:"io.metamask"},binance:{id:"binance",name:"Binance",description:"Mobile app only \u2014 Add CROSS network first",icon:Es},verse8:{id:"verse8",name:"Verse8 Wallet",description:"Optimized for Forge and Verse8 ecosystem",icon:As,badge:"For Forge"},tron:{id:"tron",name:"Tron Wallet",description:"Dedicated for Tron-based transactions and assets",icon:Ps,badge:"For SHOP"}};function wr(e){return Io[e]}var Lo={google:{id:"google",name:"Google",icon:Bs},apple:{id:"apple",name:"Apple",icon:Fs}};function _s(e){return Lo[e]}var S=require("react/jsx-runtime");function ad({wallet:e,detected:t,onConnect:n}){let o=()=>{if(e.installUrl&&!t){window.open(e.installUrl,"_blank","noopener,noreferrer");return}n()},r=e.icon,s=e.featured===!0;return(0,S.jsxs)("button",{type:"button",className:Y("wcm-wallet-item",s&&"wcm-wallet-item--featured"),onClick:o,children:[(0,S.jsxs)("div",{className:"wcm-wallet-item-left",children:[(0,S.jsx)("div",{className:"wcm-wallet-icon",children:(0,S.jsx)(r,{})}),(0,S.jsxs)("div",{className:"wcm-wallet-name-row",children:[(0,S.jsx)("span",{className:"wcm-wallet-name",children:e.name}),e.badge&&(0,S.jsx)("span",{className:"wcm-wallet-badge",children:e.badge})]})]}),e.installUrl&&(t?(0,S.jsx)("span",{className:"wcm-installed-label",children:"Installed"}):(0,S.jsx)("span",{className:"wcm-install-btn",children:"Install"}))]})}function sd({social:e,onSignIn:t}){let n=e.icon,o=`Sign in with ${e.name}`;return(0,S.jsxs)("button",{type:"button",className:"wcm-social-item","data-provider":e.id,onClick:t,"aria-label":o,children:[(0,S.jsx)("span",{className:"wcm-social-icon",children:(0,S.jsx)(n,{})}),(0,S.jsx)("span",{className:"wcm-social-name",children:o})]})}function Os(){let{wallets:e,activeWalletIds:t,socialProviders:n,activeSocialIds:o,termsUrl:r,privacyUrl:s,isDetected:a,close:l,isMobile:p}=Bn(),d=t.filter(g=>{let h=wr(g).visibility;return!h||h==="always"?!0:h==="desktop-only"?!p:h==="mobile-only"?p:!0}),f=o.length>0,m=d.length>0;return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)("div",{className:"wcm-header",children:[(0,S.jsxs)("div",{className:"wcm-header-text",children:[(0,S.jsx)("h2",{className:"wcm-title",children:"CROSS Wallet"}),!p&&(0,S.jsx)("p",{className:"wcm-subtitle",children:"Sign in instantly with your social account"})]}),(0,S.jsx)("button",{type:"button",className:"wcm-close-btn",onClick:l,"aria-label":"Close",children:(0,S.jsx)(Ms,{})})]}),(0,S.jsxs)("div",{className:"wcm-body",children:[f&&(0,S.jsxs)(S.Fragment,{children:[!p&&(0,S.jsxs)("div",{className:"wcm-section-header",children:[(0,S.jsx)("span",{className:"wcm-section-title",children:"Social Account Wallet Connect"}),(0,S.jsx)("span",{className:"wcm-recommended-badge",children:"Recommended"})]}),(0,S.jsx)("div",{className:"wcm-social-grid",children:o.map(g=>{let h=_s(g);return(0,S.jsx)(sd,{social:h,onSignIn:()=>{n[g]?.(),l()}},g)})}),m&&(0,S.jsxs)("div",{className:"wcm-separator",children:[(0,S.jsx)("div",{className:"wcm-separator-line"}),(0,S.jsx)("span",{className:"wcm-separator-text",children:"Other Wallets"}),(0,S.jsx)("div",{className:"wcm-separator-line"})]})]}),m&&(0,S.jsx)("div",{className:"wcm-wallet-list",children:d.map(g=>{let h=wr(g),x=h.rdns?a(h.rdns):!1;return(0,S.jsx)(ad,{wallet:h,detected:x,onConnect:()=>{e[g]?.(),l()}},g)})}),(0,S.jsxs)("p",{className:"wcm-terms",children:["By continuing, you agree to NEXUS"," ",(0,S.jsx)(zs,{href:r,children:"Terms of Service"})," and consent to its ",(0,S.jsx)(zs,{href:s,children:"Privacy Policy"}),"."]})]})]})}function zs({href:e,children:t}){return e?(0,S.jsx)("a",{className:"wcm-terms-link",href:e,target:"_blank",rel:"noopener noreferrer",children:t}):(0,S.jsx)("span",{className:"wcm-terms-link",children:t})}function Ws({className:e}){let{isMobile:t,theme:n,portalStyle:o}=Bn();return t?(0,S.jsxs)(Mn.Drawer.Portal,{children:[(0,S.jsx)(Mn.Drawer.Overlay,{className:"wcm-overlay"}),(0,S.jsxs)(Mn.Drawer.Content,{className:Y("wcm-drawer-content",e),"data-theme":n,style:o,children:[(0,S.jsx)(Mn.Drawer.Title,{className:"wcm-sr-only",children:"Connect Wallet"}),(0,S.jsx)("div",{className:"wcm-drawer-handle"}),(0,S.jsx)("div",{className:"wcm-drawer-body",children:(0,S.jsx)(Os,{})})]})]}):(0,S.jsxs)(St.Portal,{children:[(0,S.jsx)(St.Overlay,{className:"wcm-overlay"}),(0,S.jsxs)(St.Content,{className:Y("wcm-dialog-content",e),"data-theme":n,style:o,children:[(0,S.jsx)(St.Title,{className:"wcm-sr-only",children:"Connect Wallet"}),(0,S.jsx)(St.Description,{className:"wcm-sr-only",children:"Sign in with a social provider or pick a wallet to connect."}),(0,S.jsx)("div",{className:"wcm-dialog-body",children:(0,S.jsx)(Os,{})})]})]})}O(`.wcm-overlay{position:fixed;inset:0;z-index:100000;background:var(--ds-overlay-dim, rgba(0, 0, 0, .5));-webkit-backdrop-filter:var(--ds-bg-blur-7, blur(3.5px));backdrop-filter:var(--ds-bg-blur-7, blur(3.5px))}.wcm-dialog-content{-webkit-font-smoothing:antialiased;position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);z-index:100001;width:var(--wcm-dialog-width, 480px);max-height:90vh;overflow:hidden;display:flex;flex-direction:column;background:var(--ds-surface-default, #ffffff);border:1px solid var(--ds-border-default, #00000012);border-radius:24px;box-shadow:var(--ds-shadow-modal, 0 4px 30px -1px rgba(0, 0, 0, .15));outline:none;animation:wcm-dialog-show .2s ease-out;font-family:inherit}.wcm-dialog-content[data-state=closed]{animation:wcm-dialog-hide .15s ease-in}.wcm-dialog-body,.wcm-drawer-body{scrollbar-width:thin;scrollbar-color:var(--ds-border-medium, rgba(0, 0, 0, .18)) transparent}.wcm-dialog-body::-webkit-scrollbar,.wcm-drawer-body::-webkit-scrollbar{width:4px}.wcm-dialog-body::-webkit-scrollbar-track,.wcm-drawer-body::-webkit-scrollbar-track{background:transparent}.wcm-dialog-body::-webkit-scrollbar-thumb,.wcm-drawer-body::-webkit-scrollbar-thumb{background:var(--ds-border-medium, rgba(0, 0, 0, .18));border-radius:4px}.wcm-drawer-content{-webkit-font-smoothing:antialiased;position:fixed;bottom:0;left:0;right:0;z-index:100001;width:100%;max-width:var(--wcm-drawer-max-width, none);min-width:var(--wcm-drawer-min-width, 0);max-height:85dvh;margin:0 auto;display:flex;flex-direction:column;background:var(--ds-surface-default, #ffffff);border:1px solid var(--ds-border-default, #00000012);border-top-left-radius:16px;border-top-right-radius:16px;outline:none;font-family:inherit;box-sizing:border-box}.wcm-drawer-content[data-vaul-drawer-direction=right]{inset:0 0 0 auto;max-height:100vh;width:var(--wcm-drawer-max-width, 400px);max-width:100vw;border-radius:16px 0 0 16px}.wcm-drawer-content[data-vaul-drawer-direction=left]{inset:0 auto 0 0;max-height:100vh;width:var(--wcm-drawer-max-width, 400px);max-width:100vw;border-radius:0 16px 16px 0}.wcm-drawer-content[data-vaul-drawer-direction=top]{inset:0 0 auto;border-radius:0 0 16px 16px}.wcm-drawer-handle{width:60px;height:4px;border-radius:999px;background:var(--ds-border-medium, rgba(0, 0, 0, .18));margin:12px auto 8px;flex-shrink:0}.wcm-drawer-content[data-vaul-drawer-direction=left] .wcm-drawer-handle,.wcm-drawer-content[data-vaul-drawer-direction=right] .wcm-drawer-handle{display:none}.wcm-dialog-body,.wcm-drawer-body{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden}.wcm-drawer-body{overscroll-behavior:contain}.wcm-header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:24px;border-bottom:1px solid var(--ds-border-default, rgba(0, 0, 0, .07))}.wcm-header-text{display:flex;flex-direction:column;gap:4px;min-width:0}.wcm-title{font-family:Inter,sans-serif;font-weight:600;font-size:20px;line-height:1.25;letter-spacing:0;color:var(--ds-content-highest, #000000);margin:0}.wcm-subtitle{font-family:Inter,sans-serif;font-weight:400;font-size:14px;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65));margin:0}.wcm-close-btn{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;flex-shrink:0;border:none;background:transparent;color:var(--ds-content-low, #00000066);cursor:pointer;padding:0;transition:opacity .15s ease}.wcm-close-btn:hover{opacity:.6}.wcm-close-btn>svg{width:24px;height:24px}.wcm-divider{display:none}.wcm-body{display:flex;flex-direction:column;gap:16px;padding:24px}.wcm-section-header{display:flex;align-items:center;gap:8px;width:100%}.wcm-section-title{font-family:Inter,sans-serif;font-weight:600;font-size:16px;line-height:1;letter-spacing:0;color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wcm-recommended-badge{display:inline-flex;align-items:center;justify-content:center;padding:4px 8px;background:var(--ds-accent-primary-low, #e7f9f8);border-radius:9999px;font-family:Inter,sans-serif;font-weight:500;font-size:12px;line-height:1;letter-spacing:0;color:var(--ds-accent-primary-high, #00a0a2);white-space:nowrap}.wcm-social-grid{display:grid;gap:8px;width:100%}.wcm-dialog-body .wcm-social-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.wcm-drawer-body .wcm-social-grid{grid-template-columns:1fr}.wcm-social-item{display:flex;background:var(--ds-surface-medium, #f5f7fa);border:none;border-radius:12px;cursor:pointer;transition:none;font-family:inherit;color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wcm-social-item:hover{background:#2e3544!important}:root[data-ds-theme=light] .wcm-social-item:hover{background:#eff3f8!important}.wcm-social-item[data-provider=apple] .wcm-social-icon{color:#000}[data-theme=dark] .wcm-social-item[data-provider=apple] .wcm-social-icon{color:#fff}.wcm-dialog-body .wcm-social-item{flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:16px}.wcm-drawer-body .wcm-social-item{flex-direction:row;align-items:center;justify-content:flex-start;gap:12px;padding:16px}.wcm-social-icon{flex-shrink:0;width:32px;height:32px;display:flex;align-items:center;justify-content:center}.wcm-social-icon>svg{width:32px;height:32px}.wcm-social-name{font-family:Inter,sans-serif;font-weight:600;font-size:14px;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));white-space:nowrap}.wcm-separator{display:flex;align-items:center;gap:12px;width:100%}.wcm-separator-line{flex:1;height:1px;background:var(--ds-border-default, rgba(0, 0, 0, .07))}.wcm-separator-text{font-family:Inter,sans-serif;font-weight:500;font-size:12px;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4));white-space:nowrap}.wcm-wallet-list{display:flex;flex-direction:column;gap:8px}.wcm-wallet-item{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;padding:20px 16px;background:var(--ds-surface-medium, #f5f7fa);border:none;border-radius:12px;cursor:pointer;text-align:left;transition:none;font-family:inherit}.wcm-wallet-item:hover{background:#2e3544!important}:root[data-ds-theme=light] .wcm-wallet-item:hover{background:#eff3f8!important}.wcm-wallet-item-left{display:flex;align-items:center;gap:8px;flex:1;min-width:0}.wcm-wallet-icon{flex-shrink:0;width:28px;height:28px;display:flex;align-items:center;justify-content:center}.wcm-wallet-icon>svg,.wcm-wallet-icon>img{width:28px;height:28px;border-radius:0;object-fit:cover}.wcm-wallet-name-row{display:flex;align-items:center;gap:8px;min-width:0}.wcm-wallet-name{font-family:Inter,sans-serif;font-weight:600;font-size:16px;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));white-space:nowrap}.wcm-wallet-badge{display:inline-flex;align-items:center;justify-content:center;padding:4px 8px;background:var(--ds-system-purple-low, #f5f3ff);border:.5px solid var(--ds-system-purple-default, #7e54f4);border-radius:9999px;font-family:Inter,sans-serif;font-weight:500;font-size:12px;line-height:1;letter-spacing:0;color:var(--ds-system-purple-high, #7346f3);white-space:nowrap}.wcm-install-btn{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;padding:4px 8px;background:var(--ds-accent-primary-default, #00b4b7);border-radius:6px;font-family:Inter,sans-serif;font-weight:500;font-size:12px;line-height:1;letter-spacing:0;color:var(--ds-accent-primary-on, #ffffff);white-space:nowrap}.wcm-installed-label{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;font-family:Inter,sans-serif;font-weight:500;font-size:12px;line-height:1;letter-spacing:0;color:var(--ds-content-low, rgba(0, 0, 0, .4));white-space:nowrap}.wcm-terms{font-family:Inter,sans-serif;font-weight:400;font-size:12px;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65));text-align:center;margin:0}.wcm-terms-link{color:var(--ds-accent-primary-high, #00a0a2);text-decoration:none}.wcm-terms-link:hover{text-decoration:underline}.wcm-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}
16
+ `);O(`@keyframes wcm-overlay-show{0%{opacity:0}to{opacity:1}}@keyframes wcm-overlay-hide{0%{opacity:1}to{opacity:0}}@keyframes wcm-dialog-show{0%{opacity:0;transform:translate(-50%,-48%) scale(.96)}to{opacity:1;transform:translate(-50%,-50%) scale(1)}}@keyframes wcm-dialog-hide{0%{opacity:1;transform:translate(-50%,-50%) scale(1)}to{opacity:0;transform:translate(-50%,-48%) scale(.96)}}
17
+ `);var hn=require("react/jsx-runtime"),ld={};function cd({wallets:e,socialProviders:t=ld,termsUrl:n,privacyUrl:o,theme:r="dark",mobileBreakpoint:s=768,drawerDirection:a="bottom",dialogWidth:l,drawerMaxWidth:p,drawerMinWidth:d,style:f,open:m,onOpenChange:g,children:h}){let x=sn(`(max-width: ${s}px)`),[y,w]=Ct.useState(!1),v=m!==void 0,I=v?m:y,u=Ct.useCallback($=>{v||w($),g?.($)},[v,g]),E=Ct.useCallback(()=>u(!1),[u]),{isDetected:T}=Fn(),M=Ct.useMemo(()=>Object.keys(e),[e]),_=Ct.useMemo(()=>Object.keys(t),[t]),j=Ct.useMemo(()=>{let $={};return l&&($["--wcm-dialog-width"]=l),p&&($["--wcm-drawer-max-width"]=p),d&&($["--wcm-drawer-min-width"]=d),{...$,...f}},[l,p,d,f]),H=Ct.useMemo(()=>({theme:r,isMobile:x,open:I,setOpen:u,close:E,wallets:e,activeWalletIds:M,socialProviders:t,activeSocialIds:_,termsUrl:n,privacyUrl:o,isDetected:T,portalStyle:j}),[r,x,I,u,E,e,M,t,_,n,o,T,j]),J=(0,hn.jsx)("div",{"data-theme":r,style:j,children:h});return x?(0,hn.jsx)(To.Provider,{value:H,children:(0,hn.jsx)(Hs.Drawer.Root,{direction:a,open:I,onOpenChange:u,noBodyStyles:!0,children:J},"drawer")}):(0,hn.jsx)(To.Provider,{value:H,children:(0,hn.jsx)(Ds.Root,{open:I,onOpenChange:u,children:J})})}var xr=Object.assign(cd,{Trigger:Is,Content:Ws});O(`.cb-button{--cb-bg: var(--ds-accent-primary-default, #00b4b7);--cb-bg-hover: var(--cb-bg);--cb-color: var(--ds-accent-primary-on-primary, #ffffff);--cb-border: none;--cb-radius: 8px;--cb-height: 36px;--cb-padding: 8px 16px;--cb-font-family: Inter, system-ui, -apple-system, sans-serif;--cb-font-size: 14px;--cb-font-weight: 500;--cb-line-height: 1.5;--cb-letter-spacing: -.01em;--cb-gap: 8px;--cb-transition: opacity .15s;--cb-loading-opacity: .7;--cb-press-scale: .95;--cb-icon-size: 18px;--cb-spinner-size: 18px;--cb-spinner-thumb: currentColor;--cb-spinner-track: color-mix(in srgb, currentColor 20%, transparent)}.cb-pill{--cb-pill-bg: var(--ds-surface-default, #ffffff);--cb-pill-bg-hover: var(--cb-pill-bg);--cb-pill-color: var(--ds-content-high, rgba(0, 0, 0, .85));--cb-pill-border: 1px solid var(--ds-border-default, rgba(0, 0, 0, .07));--cb-pill-border-hover: 1px solid var(--ds-border-medium, rgba(0, 0, 0, .18));--cb-pill-radius: 8px;--cb-pill-height: 36px;--cb-pill-padding: 1px 13px;--cb-pill-press-scale: .95;--cb-pill-font-family: Inter, system-ui, -apple-system, sans-serif;--cb-pill-font-size: 14px;--cb-pill-font-weight: 500;--cb-pill-line-height: 1.5;--cb-pill-gap: 8px;--cb-pill-icon-size: 18px;--cb-pill-icon-placeholder-bg: var(--ds-surface-medium, #f5f7fa);--cb-pill-address-font: Inter, system-ui, -apple-system, sans-serif;--cb-pill-address-font-size: 14px;--cb-pill-address-letter-spacing: -.01em}
18
+ `);O(`.cb-button{-webkit-font-smoothing:antialiased;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;height:var(--cb-height);gap:var(--cb-gap);padding:var(--cb-padding);border-radius:var(--cb-radius);border:var(--cb-border);background:var(--cb-bg);color:var(--cb-color);font-family:var(--cb-font-family);font-size:var(--cb-font-size);font-weight:var(--cb-font-weight);line-height:var(--cb-line-height);letter-spacing:var(--cb-letter-spacing);cursor:pointer;transition:var(--cb-transition)}.cb-button:hover:not(:disabled){background:var(--cb-bg-hover)}.cb-button:active:not(:disabled){transform:scale(var(--cb-press-scale))}.cb-button:disabled,.cb-button[aria-busy=true]{cursor:default;opacity:var(--cb-loading-opacity)}.cb-spinner{display:inline-block;width:var(--cb-spinner-size);height:var(--cb-spinner-size);border:2px solid var(--cb-spinner-track);border-top-color:var(--cb-spinner-thumb);border-radius:50%;animation:cb-spin .6s linear infinite;flex-shrink:0}.cb-button-icon{width:var(--cb-icon-size);height:var(--cb-icon-size);flex-shrink:0}.cb-button-label{white-space:nowrap}.cb-pill{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;height:var(--cb-pill-height);gap:var(--cb-pill-gap);padding:var(--cb-pill-padding);border-radius:var(--cb-pill-radius);border:var(--cb-pill-border);background:var(--cb-pill-bg);color:var(--cb-pill-color);font-family:var(--cb-pill-font-family);font-size:var(--cb-pill-font-size);font-weight:var(--cb-pill-font-weight);line-height:var(--cb-pill-line-height);cursor:pointer}.cb-pill:hover{background:var(--cb-pill-bg-hover)}.cb-pill:active:not(:disabled){transform:scale(var(--cb-pill-press-scale))}.cb-pill-icon{width:var(--cb-pill-icon-size);height:var(--cb-pill-icon-size);border-radius:50%;object-fit:contain;flex-shrink:0;background:transparent}[data-theme=dark] .cb-pill-icon[data-provider=apple]{filter:invert(1)}.cb-pill-icon-placeholder{display:inline-block;width:var(--cb-pill-icon-size);height:var(--cb-pill-icon-size);border-radius:50%;background:var(--cb-pill-icon-placeholder-bg);flex-shrink:0}.cb-pill-address{font-family:var(--cb-pill-address-font);font-size:var(--cb-pill-address-font-size);letter-spacing:var(--cb-pill-address-letter-spacing);white-space:nowrap}@media(max-width:767.98px){.cb-button,.cb-pill{width:36px;min-width:36px;padding:0}.cb-button{height:36px}.cb-button-label,.cb-pill-address{display:none}}@keyframes cb-spin{to{transform:rotate(360deg)}}
19
+ `);var dd='<svg preserveAspectRatio="none" width="100%" height="100%" overflow="visible" style="display: block;" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#c0)"><path d="M18 36C27.9411 36 36 27.9411 36 18C36 8.05887 27.9411 0 18 0C8.05887 0 0 8.05887 0 18C0 27.9411 8.05887 36 18 36Z" fill="#00D5AA"/><path fill-rule="evenodd" clip-rule="evenodd" d="M18.2903 2.57169L21.3525 5.63385V10.6471L25.3058 6.69381L29.6364 11.0244L25.7226 14.9381H18.2903C16.5992 14.9381 15.2283 16.309 15.2283 18.0003C15.2283 19.6915 16.5992 21.0624 18.2903 21.0624H25.6836L29.6365 25.0154L25.3059 29.3459L21.3525 25.3925V30.3666L18.2903 33.4288L15.2283 30.3666V25.4326L11.3148 29.3459L6.98426 25.0154L10.9372 21.0624H5.92394L2.86178 18.0003L5.92394 14.9381H10.8981L6.98437 11.0244L11.3149 6.69383L15.2283 10.6071V5.63385L18.2903 2.57169Z" fill="#000"/></g><defs><clipPath id="c0"><rect width="36" height="36" fill="#fff"/></clipPath></defs></svg>',pd='<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 28 28" fill="none"><g clip-path="url(#m0)"><path d="M26.07 26.93L20.06 25.07L15.53 27.88L12.37 27.88L7.83 25.07L1.83 26.93L0 20.53L1.83 13.44L0 7.44L1.83 0L11.21 5.81H16.69L26.07 0L27.9 7.44L26.07 13.44L27.9 20.53Z" fill="#FF5C16"/><path d="M7.83 20.54L11.96 23.8L7.83 25.07V20.54Z" fill="#FF5C16"/><path d="M20.06 20.54L15.93 23.8L20.06 25.07L20.06 20.54Z" fill="#FF5C16"/><path d="M11.63 15.14L12.78 22.85L11.19 18.56L5.77 17.17L7.83 15.14H11.63Z" fill="#E34807"/><path d="M16.27 15.14L15.12 22.85L16.71 18.56L22.13 17.17L20.07 15.14H16.27Z" fill="#E34807"/><path d="M0 20.53L1.83 13.44H5.76L5.77 17.17L11.19 18.56L12.78 22.85L11.96 23.79L7.83 20.53H0Z" fill="#FF8D5D"/><path d="M27.9 20.53L26.07 13.44H22.14L22.13 17.17L16.71 18.56L15.12 22.85L15.94 23.79L20.07 20.53H27.9Z" fill="#FF8D5D"/><path d="M16.69 5.81H11.21L10.84 9.81L12.78 22.85H15.12L17.06 9.81L16.69 5.81Z" fill="#FF8D5D"/><path d="M15.53 25.34V27.88H12.37V25.34H15.53Z" fill="#C0C4CD"/><path d="M7.83 25.07L12.37 27.88V25.34L11.96 23.79L7.83 25.07Z" fill="#E7EBF6"/><path d="M20.07 25.07L15.53 27.88V25.34L15.94 23.79L20.07 25.07Z" fill="#E7EBF6"/></g><defs><clipPath id="m0"><rect width="28" height="28" fill="#fff"/></clipPath></defs></svg>',fd='<svg width="100%" height="100%" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.23 16.81L20 9.04L27.77 16.81L32.29 12.29L20 0L7.71 12.29L12.23 16.81Z" fill="#F3BA2F"/><path d="M9.04 20L4.52 15.48L0 20L4.52 24.52L9.04 20Z" fill="#F3BA2F"/><path d="M12.23 23.19L20 30.96L27.77 23.19L32.29 27.71L20 40L7.71 27.71L12.23 23.19Z" fill="#F3BA2F"/><path d="M35.48 24.52L40 20L35.48 15.48L30.96 20L35.48 24.52Z" fill="#F3BA2F"/><path d="M24.58 20L20 15.41L16.61 18.8L16.22 19.19L15.42 19.99L20 24.59L24.59 20L24.58 20Z" fill="#F3BA2F"/></svg>',ud='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><path fill="#FFC107" d="M43.6 20.5H42V20H24v8h11.3A12 12 0 1 1 24 12c3 0 5.8 1.2 7.9 3l5.7-5.7A20 20 0 1 0 44 24c0-1.2-.1-2.4-.4-3.5z"/><path fill="#FF3D00" d="M6.3 14.7l6.6 4.8A12 12 0 0 1 24 12c3 0 5.8 1.2 7.9 3l5.7-5.7A20 20 0 0 0 6.3 14.7z"/><path fill="#4CAF50" d="M24 44c5.2 0 10-2 13.6-5.2l-6.3-5.3A12 12 0 0 1 12.7 28l-6.5 5A20 20 0 0 0 24 44z"/><path fill="#1976D2" d="M43.6 20.5H42V20H24v8h11.3a12 12 0 0 1-4.1 5.5l6.3 5.3C41 35.7 44 30.3 44 24c0-1.2-.1-2.4-.4-3.5z"/></svg>',md='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#000"><path d="M17.05 20.28c-.98.95-2.05.8-3.08.35-1.09-.46-2.09-.48-3.24 0-1.44.62-2.2.44-3.06-.35C2.79 15.25 3.51 7.59 9.05 7.31c1.35.07 2.29.74 3.08.8 1.18-.24 2.31-.93 3.57-.84 1.51.12 2.65.72 3.4 1.8-3.12 1.87-2.38 5.98.48 7.13-.57 1.5-1.31 2.99-2.53 4.08zM12.03 7.25c-.15-2.23 1.66-4.07 3.74-4.25.29 2.58-2.34 4.5-3.74 4.25z"/></svg>';function _n(e){return`data:image/svg+xml,${encodeURIComponent(e)}`}var On=_n(dd),zn=_n(pd),Wn=_n(fd),Dn=_n(ud),Hn=_n(md);var ge=require("react/jsx-runtime");function vr({isConnecting:e,address:t,provider:n,providerName:o,accountName:r,sendAccounts:s,onConnect:a,onDisconnect:l,onCopy:p,onSelectWallet:d,onBuy:f,onBuyDisabledMessage:m,label:g="Connect Wallet",connectingLabel:h="Connecting...",disconnectLabel:x,className:y,theme:w="dark",env:v,showBalance:I=!0,showPortfolio:u,drawerDirection:E,modal:T,connectorId:M,style:_,walletInfoStyle:j,sendTransaction:H,getTransactionReceipt:J,estimateGas:$,onReceive:W,onBridge:he,onSend:ye,bridgeTokens:fe,bridgeHistory:ue,getBridgeQuote:We,getBridgeToTokens:re,getBridgeApproval:U,approveBridge:te,submitBridge:Te}){let ee=y?`cb-button ${y}`:"cb-button",De=y?`cb-pill ${y}`:"cb-pill";if(e)return(0,ge.jsxs)("button",{type:"button",disabled:!0,className:ee,style:_,"aria-busy":"true",children:[(0,ge.jsx)("span",{className:"cb-spinner","aria-hidden":"true"}),(0,ge.jsx)("span",{className:"cb-button-label",children:h})]});if(t){let He=o??wd(n),Re=n?hd[n]:void 0;return(0,ge.jsxs)(on,{env:v,theme:w,drawerDirection:E,modal:T,showBalance:I,showPortfolio:u,walletAddress:t,accountName:r,sendAccounts:s,connectorId:M,onSelectWallet:d,onCopyAddress:p?(Ee,gt)=>{gt&&p()}:void 0,onDisconnect:l,disconnectLabel:x,style:j,sendTransaction:H,getTransactionReceipt:J,estimateGas:$,onReceive:W,onBridge:he,onBuy:f,onBuyDisabledMessage:m,onSend:ye,bridgeTokens:fe,bridgeHistory:ue,getBridgeQuote:We,getBridgeToTokens:re,getBridgeApproval:U,approveBridge:te,submitBridge:Te,children:[(0,ge.jsx)(on.Trigger,{asChild:!0,children:(0,ge.jsxs)("button",{type:"button",className:De,style:_,"aria-label":`Connected with ${He}: ${Gs(t)}`,children:[Re?(0,ge.jsx)("img",{src:Re,alt:"",width:18,height:18,className:"cb-pill-icon","data-provider":n}):(0,ge.jsx)("span",{className:"cb-pill-icon-placeholder","aria-hidden":"true"}),(0,ge.jsx)("span",{className:"cb-pill-address",children:Gs(t)})]})}),(0,ge.jsx)(on.Content,{align:"end",sideOffset:8})]})}return(0,ge.jsxs)("button",{type:"button",onClick:a,className:ee,style:_,"aria-label":typeof g=="string"?g:"Connect Wallet",children:[(0,ge.jsx)(gd,{}),(0,ge.jsx)("span",{className:"cb-button-label",children:g})]})}function gd(){return(0,ge.jsxs)("svg",{className:"cb-button-icon",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[(0,ge.jsx)("path",{d:"M3.75 5.25H14.25C15.0784 5.25 15.75 5.92157 15.75 6.75V13.5C15.75 14.3284 15.0784 15 14.25 15H3.75C2.92157 15 2.25 14.3284 2.25 13.5V4.5C2.25 3.67157 2.92157 3 3.75 3H13.5",stroke:"currentColor",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round"}),(0,ge.jsx)("path",{d:"M12 9.75H15.75V12.75H12C11.1716 12.75 10.5 12.0784 10.5 11.25C10.5 10.4216 11.1716 9.75 12 9.75Z",stroke:"currentColor",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round"}),(0,ge.jsx)("path",{d:"M12.75 11.25H12.7575",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}var hd={google:Dn,apple:Hn,cross:On,metamask:zn,binance:Wn},bd={google:"Google",apple:"Apple",cross:"CROSSx",metamask:"MetaMask",binance:"Binance Wallet"};function wd(e){return e?bd[e]:"Wallet"}function Gs(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}var Us=D(require("react"),1);O(`.sb-button{--sb-bg: var(--ds-surface-default, #ffffff);--sb-border: var(--ds-border-default, rgba(0, 0, 0, .07));--sb-border-hover: var(--ds-border-default, rgba(0, 0, 0, .07));--sb-color: var(--ds-content-medium, rgba(0, 0, 0, .65));--sb-color-hover: var(--ds-content-high, rgba(0, 0, 0, .85));--sb-radius: 8px;--sb-height: 36px;--sb-padding: 1px 11px;--sb-gap: 4px;--sb-font-size: 14px;--sb-font-weight: 500;--sb-line-height: 21px;--sb-letter-spacing: 0;--sb-blur: 0px;--sb-border-width: 1px;--sb-icon-size: 18px;--sb-icon-hover-rotation: 180deg;--sb-spinner-size: 18px;--sb-spinner-thumb: currentColor;--sb-spinner-track: color-mix(in srgb, currentColor 20%, transparent);--sb-disabled-opacity: .6;--sb-press-scale: .95;--sb-hover-duration: .2s;--sb-icon-duration: .3s;--sb-easing: ease}.sb-button[data-theme=dark]{--sb-bg: var(--ds-surface-default, #1e232e);--sb-border: var(--ds-border-default, #ffffff12);--sb-border-hover: var(--ds-border-medium, #ffffff2e);--sb-color: var(--ds-content-medium, #ffffffa6);--sb-color-hover: var(--ds-content-high, #ffffffd9)}.sb-button[data-theme=light]{--sb-bg: var(--ds-surface-default, #ffffff);--sb-border: var(--ds-border-default, #00000012);--sb-border-hover: var(--ds-border-medium, #0000002e);--sb-color: var(--ds-content-medium, #000000a6);--sb-color-hover: var(--ds-content-high, #000000d9)}
20
+ `);O(`.sb-button{-webkit-font-smoothing:antialiased;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;height:var(--sb-height);gap:var(--sb-gap);padding:var(--sb-padding);border-radius:var(--sb-radius);border:var(--sb-border-width) solid var(--sb-border);background:var(--sb-bg);backdrop-filter:blur(var(--sb-blur));-webkit-backdrop-filter:blur(var(--sb-blur));color:var(--sb-color);font-family:Inter,system-ui,-apple-system,sans-serif;font-weight:var(--sb-font-weight);font-size:var(--sb-font-size);line-height:var(--sb-line-height);letter-spacing:var(--sb-letter-spacing);cursor:pointer;transition:border-color var(--sb-hover-duration) var(--sb-easing),color var(--sb-hover-duration) var(--sb-easing)}@media(hover:hover){.sb-button:hover:not(:disabled){border-color:var(--sb-border-hover);color:var(--sb-color-hover)}.sb-button:hover:not(:disabled) .sb-button-icon{transform:rotate(var(--sb-icon-hover-rotation))}}.sb-button:active:not(:disabled){transform:scale(var(--sb-press-scale))}.sb-button:disabled,.sb-button[aria-busy=true]{cursor:default;opacity:var(--sb-disabled-opacity)}.sb-button-icon{width:var(--sb-icon-size);height:var(--sb-icon-size);flex-shrink:0;color:inherit;transition:transform var(--sb-icon-duration) var(--sb-easing),color var(--sb-icon-duration) var(--sb-easing)}.sb-spinner{display:inline-block;width:var(--sb-spinner-size);height:var(--sb-spinner-size);border:2px solid var(--sb-spinner-track);border-top-color:var(--sb-spinner-thumb);border-radius:50%;animation:sb-spin .6s linear infinite;flex-shrink:0}.sb-label{white-space:nowrap}@keyframes sb-spin{to{transform:rotate(360deg)}}
21
+ `);var Ht=require("react/jsx-runtime"),Eo="https://skills.cross.nexus";function yr({label:e="Skills",href:t=Eo,onClick:n,className:o,style:r,theme:s,disabled:a=!1,isLoading:l=!1,loadingLabel:p="Loading...",openInNewTab:d=!1,type:f="button"}){let[m,g]=Us.useState(!1),h=async I=>{if(t&&!n){d?window.open(t,"_blank","noopener,noreferrer"):window.location.href=t;return}if(n)try{g(!0),await n()}finally{g(!1)}},x=a||l||m,y=l||m,w=y?p:e,v=o?`sb-button ${o}`:"sb-button";return(0,Ht.jsxs)("button",{type:f,onClick:h,disabled:x,className:v,"data-theme":s,style:r,"aria-busy":y,children:[y?(0,Ht.jsx)("span",{className:"sb-spinner","aria-hidden":"true"}):(0,Ht.jsx)(xd,{}),(0,Ht.jsx)("span",{className:"sb-label",children:w})]})}function xd(){return(0,Ht.jsx)("svg",{className:"sb-button-icon",viewBox:"0 0 34 34",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,Ht.jsx)("path",{d:"M15.5879 3.95142C16.0211 2.78097 17.6761 2.78099 18.1094 3.95142L19.6221 8.03833C20.6569 10.8348 22.8618 13.0396 25.6582 14.0745L29.7451 15.5872C30.9157 16.0204 30.9157 17.6754 29.7451 18.1086L25.6582 19.6213C22.8618 20.6562 20.657 22.861 19.6221 25.6575L18.1094 29.7444C17.6762 30.9149 16.0211 30.9149 15.5879 29.7444L14.0752 25.6575C13.0403 22.861 10.8355 20.6562 8.03906 19.6213L3.95215 18.1086C2.78172 17.6754 2.7817 16.0204 3.95215 15.5872L8.03906 14.0745C10.8355 13.0396 13.0403 10.8348 14.0752 8.03833L15.5879 3.95142Z",stroke:"currentColor",strokeWidth:"1.93556"})})}Kn({mode:"dapp-ui"});0&&(module.exports={APPLE_ICON,AppLauncher,AppLauncherContent,AppLauncherTrigger,BINANCE_ICON,BridgeFlow,CONNECTOR_REGISTRY,CROSSX_ICON,ConnectButton,ConnectorId,DEFAULT_SKILLS_HREF,GOOGLE_ICON,METAMASK_ICON,SOCIAL_REGISTRY,SendFlow,SkillsButton,TOKEN_STATS_QUERY_KEY,USER_BALANCE_QUERY_KEY,WALLET_REGISTRY,WalletConnectModal,WalletInfo,WalletPortfolio,WalletPortfolioBody,announceAppLauncherUsage,resolveEnvironment,useGlobalMenu,useTokenBalance,useTokenStats,useWalletDetect});