@nexus-cross/dapp-ui 1.3.16 → 1.3.17
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 +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
function Rd(e){try{return import.meta.env?.[e]}catch{return}}function Sd(e){if(!(typeof process>"u"))return process.env?.[e]}function tt(e){if(e)return Cd(e);let t=Rd("VITE_CROSSX_ENVIRONMENT")??Rd("NEXT_PUBLIC_CROSSX_ENVIRONMENT")??Sd("NEXT_PUBLIC_CROSSX_ENVIRONMENT")??Sd("CROSSX_ENVIRONMENT");return Cd(t)}function Cd(e){switch(e?.toLowerCase()){case"dev":case"development":return"dev";case"stage":case"staging":case"stg":return"stage";default:return"production"}}import*as nn from"react";var Ng={dev:"https://stg-contents.crosstoken.io/frontend/common/app-launcher",stage:"https://stg-contents.crosstoken.io/frontend/common/app-launcher",production:"https://contents.crosstoken.io/frontend/common/app-launcher"},Tg=3e3;function Ir(e,t){if(e!=null)return typeof e=="object"&&!Array.isArray(e)&&("dev"in e||"stage"in e||"production"in e)?e[t]:e}var Us=new Map;function Jn(e,t){let r=`${Ng[t]}/${e}`,n=Us.get(r);return n||(n=(async()=>{let o=new AbortController,a=setTimeout(()=>o.abort(),Tg);try{let i=await fetch(r,{cache:"no-store",signal:o.signal});return i.ok?await i.json():null}catch{return null}finally{clearTimeout(a)}})().then(o=>(o===null&&Us.delete(r),o)),Us.set(r,n)),n}function Ig(e){return typeof e=="string"&&e.startsWith("https://")}async function Ne(e,t){let r=await Jn("endpoints.json",t),n=Ir(r?.apis?.[e],t);if(!Ig(n))throw new Error(`[remote-config] endpoints.json missing or invalid api base: ${e} (${t})`);return n}function Ha(e,t){let r=Ir(e?.relay?.forwarderFactories,t),n=[r?.standingForwarderFactory,r?.depositorForwarderFactory].filter(o=>typeof o=="string");return n.length>0?n:void 0}var Qa="chains.json";async function Eg(e,t){return(await Jn(Qa,t))?.chains?.[String(e)]??{}}function $o(e,t){let[r,n]=nn.useState({});return nn.useEffect(()=>{if(e==null){n({});return}let o=!0;return Jn(Qa,t).then(a=>{o&&n(a?.chains?.[String(e)]??{})}),()=>{o=!1}},[e,t]),r}function Mg(e){let[t,r]=nn.useState({});return nn.useEffect(()=>{let n=!0;return Jn(Qa,e).then(o=>{n&&r(o?.chains??{})}),()=>{n=!1}},[e]),t}function Zt(e,t,r){let[n,o]=nn.useState(void 0),a=nn.useRef(r);return a.current=r,nn.useEffect(()=>{let i=!0;return Jn(e,t).then(s=>{if(!i)return;let l=a.current(s);l!==void 0&&o(l)}),()=>{i=!1}},[e,t]),n}var $n="1.3.16";var Va="__nexusCrossAppLauncherRuntime";function Ag(){if(typeof window>"u")return null;let e=window;return e[Va]??(e[Va]={mode:"dapp-ui"}),e[Va]}function Lg(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 r=e.connectKitVersion??"unknown";console.info(`[CROSSx App Launcher] connect-kit-react v${r} \uCD08\uAE30\uD654 \uC644\uB8CC (dapp-ui v${$n}, \uC0AC\uC6A9 \uBAA8\uB4DC: connect-kit)`)}else console.info(`[CROSSx App Launcher] dapp-ui v${$n} \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 js(e){let t=Ag();t&&(e?.mode==="connect-kit-react"?t.mode="connect-kit-react":t.mode||(t.mode="dapp-ui"),e?.connectKitVersion&&(t.connectKitVersion=e.connectKitVersion),Lg(t))}import{BrowserClient as Dg,Scope as Pg,defaultStackParser as Og,linkedErrorsIntegration as Bg,makeFetchTransport as zg}from"@sentry/react";var Fg="https://5c82aeb32da33b5a0a14b7c5393992ca@o4511668907081728.ingest.de.sentry.io/4511705324126289",Ug=`dapp-ui@${$n}`,vo=null,Nd=.1;function Td(){return Nd}function jg(e){switch(e){case"dev":return"dev";case"stage":return"stg";default:return"prod"}}function ea(e){if(vo)return vo;if(typeof window>"u")return null;let t=jg(tt(e?.environment));typeof e?.analyticsSampleRate=="number"&&(Nd=Math.min(1,Math.max(0,e.analyticsSampleRate)));let r=new Dg({dsn:e?.dsn??Fg,transport:zg,stackParser:Og,integrations:[Bg()],environment:t,release:Ug,enabled:e?.enabled??t==="prod"}),n=new Pg;return n.setClient(r),n.setTags({package:"dapp-ui",framework:"react",source:"dapp-ui"}),r.init(),vo=n,vo}function qa(){return vo}function Ya(e,t){let r=vo??ea();if(r)return r.captureException(e,t?{captureContext:{extra:t}}:void 0)}import{Component as Wg}from"react";var Ka=class extends Wg{constructor(){super(...arguments);this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(r,n){Ya(r,{componentStack:n.componentStack??void 0,boundary:this.props.name??"dapp-ui"})}render(){return this.state.hasError?this.props.fallback??null:this.props.children}};function Ee(...e){return e.filter(Boolean).join(" ")}var Gg=/CROSSx|ONE\s?wallet|ONE\s?pocket/i;function ko(){return typeof window>"u"?!1:Gg.test(window.navigator.userAgent)}var Id="__nexus_dapp_ui_uid",Ws=null;function _g(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():Array.from({length:32},()=>Math.floor(Math.random()*16).toString(16)).join("")}function Gs(){if(Ws)return Ws;let e=null;try{e=window.localStorage.getItem(Id)}catch{}if(!e||!e.startsWith("anon_")){e=`anon_${_g()}`;try{window.localStorage.setItem(Id,e)}catch{}}return Ws=e,e}async function Ed(e){if(typeof crypto>"u"||!crypto.subtle)return null;try{let t=new TextEncoder().encode(e.trim().toLowerCase()),r=await crypto.subtle.digest("SHA-256",t);return`wallet_${Array.from(new Uint8Array(r),o=>o.toString(16).padStart(2,"0")).join("").slice(0,16)}`}catch{return null}}function Hg(){let e=window.navigator.userAgent;return/ipad|tablet|(android(?!.*mobile))/i.test(e)?"tablet":/mobile|iphone|ipod|android/i.test(e)?"mobile":"desktop"}function Ld(){return{host:window.location.hostname,device_type:Hg(),is_cross_inapp:String(ko())}}var Md=!1;function _s(){if(typeof window>"u")return null;let e=qa()??ea();return e?(Md||(Md=!0,e.setUser({id:Gs()})),e):null}function Dd(){return Math.random()>=Td()}var Ad=0;function Ro(e){let t=_s();if(!t)return;let r=++Ad;if(!e){t.setUser({id:Gs()});return}Ed(e).then(n=>{n&&r===Ad&&t.setUser({id:n})})}function Za(e,t,r){let n=_s();!n||Dd()||n.captureMessage(`ui: ${e}_${t}`,"info",{captureContext:{tags:{...Ld(),feature:e,action:t,...r}}})}function He(e,t,r){let n=_s();if(!n||Dd())return;let o=r?.status??"success";n.captureMessage(`funnel: ${e}_${t}`,"info",{captureContext:{tags:{...Ld(),flow:e,funnel_step:`${e}_${t}`,funnel_status:o,...o==="failure"?{failure_reason:r?.reason??"unknown"}:{},...r?.tags}}})}function xr(e){let t=e,r=String((t&&typeof t=="object"&&"message"in t?t.message:e)??"").toLowerCase();return t?.code===4001||/reject|denied|declin|cancel/i.test(r)?"user-rejected":/insufficient (funds|gas|balance)|exceeds balance/i.test(r)?"insufficient-gas":/timeout|timed out|deadline/i.test(r)?"timeout":/revert|execution failed/i.test(r)?"contract-reverted":/network|fetch|connection|disconnected|offline/i.test(r)?"network":"unknown"}import{useCallback as Qg}from"react";import{jsx as Vg}from"react/jsx-runtime";function ge({feature:e,children:t}){let r=Qg(n=>{let o=n.nativeEvent;if(o.__dappUiTracked)return;let i=n.target?.closest?.("[data-track]");if(!i)return;let s=i.getAttribute("data-track");if(!s)return;o.__dappUiTracked=!0;let l=i.getAttribute("data-track-id");Za(e,s,l?{item_id:l}:void 0)},[e]);return Vg("div",{style:{display:"contents"},onClick:r,children:t})}import*as No from"react";import*as Od from"@radix-ui/react-popover";import{Drawer as th}from"vaul";import{createContext as qg,useContext as Yg}from"react";var Hs=qg(null);function Xa(){let e=Yg(Hs);if(!e)throw new Error("AppLauncher compound components must be used within <AppLauncher>");return e}import*as $a from"react";var Kg="__dappUiOverlay",eo=[],So=0,Vs=0,Ja=!1,Qs=!1;function Pd(){if(Vs>0){Vs-=1;return}So=Math.max(0,So-1),eo.pop()?.close(),qs()}function Zg(){Ja||(window.addEventListener("popstate",Pd),Ja=!0)}function qs(){eo.length>0||!Ja||(window.removeEventListener("popstate",Pd),Ja=!1)}function Xg(){Qs||(Qs=!0,queueMicrotask(()=>{Qs=!1;let e=So-eo.length;if(e<=0){qs();return}So-=e,Vs+=1,window.history.go(-e),qs()}))}function In(e,t){let r=$a.useRef(t);r.current=t,$a.useEffect(()=>{if(!(!e||typeof window>"u"))return Jg(()=>r.current())},[e])}function Jg(e){let t={close:e};return eo.push(t),So<eo.length&&(window.history.pushState({[Kg]:!0},""),So+=1),Zg(),()=>{let r=eo.lastIndexOf(t);r!==-1&&(eo.splice(r,1),Xg())}}import{useState as $g,useEffect as eh}from"react";function Co(e){let[t,r]=$g(!1);return eh(()=>{let n=window.matchMedia(e);r(n.matches);let o=a=>r(a.matches);return n.addEventListener("change",o),()=>n.removeEventListener("change",o)},[e]),t}function de(e,{insertAt:t}={}){if(!e||typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t==="top"&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}de(`[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-primary: #f3742e;--al-primary-hover: #ff8a4a;--al-primary-soft: #3a261f;--al-new-ribbon-bg: #ed0a72;--al-badge-bg: var(--ds-accent-primary-low, #123235);--al-badge-text: var(--ds-accent-primary-default, #00ceb2);--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-primary: #f3742e;--al-primary-hover: #ff8a4a;--al-primary-soft: #fff1eb;--al-new-ribbon-bg: #ed0a72;--al-badge-bg: var(--ds-accent-primary-low, #e7f9f8);--al-badge-text: var(--ds-accent-primary-default, #00b4b7);--al-drawer-overlay: var(--ds-overlay-dim, #00000080)}
|
|
1
|
+
function Rd(e){try{return import.meta.env?.[e]}catch{return}}function Sd(e){if(!(typeof process>"u"))return process.env?.[e]}function tt(e){if(e)return Cd(e);let t=Rd("VITE_CROSSX_ENVIRONMENT")??Rd("NEXT_PUBLIC_CROSSX_ENVIRONMENT")??Sd("NEXT_PUBLIC_CROSSX_ENVIRONMENT")??Sd("CROSSX_ENVIRONMENT");return Cd(t)}function Cd(e){switch(e?.toLowerCase()){case"dev":case"development":return"dev";case"stage":case"staging":case"stg":return"stage";default:return"production"}}import*as nn from"react";var Ng={dev:"https://stg-contents.crosstoken.io/frontend/common/app-launcher",stage:"https://stg-contents.crosstoken.io/frontend/common/app-launcher",production:"https://contents.crosstoken.io/frontend/common/app-launcher"},Tg=3e3;function Ir(e,t){if(e!=null)return typeof e=="object"&&!Array.isArray(e)&&("dev"in e||"stage"in e||"production"in e)?e[t]:e}var Us=new Map;function Jn(e,t){let r=`${Ng[t]}/${e}`,n=Us.get(r);return n||(n=(async()=>{let o=new AbortController,a=setTimeout(()=>o.abort(),Tg);try{let i=await fetch(r,{cache:"no-store",signal:o.signal});return i.ok?await i.json():null}catch{return null}finally{clearTimeout(a)}})().then(o=>(o===null&&Us.delete(r),o)),Us.set(r,n)),n}function Ig(e){return typeof e=="string"&&e.startsWith("https://")}async function Ne(e,t){let r=await Jn("endpoints.json",t),n=Ir(r?.apis?.[e],t);if(!Ig(n))throw new Error(`[remote-config] endpoints.json missing or invalid api base: ${e} (${t})`);return n}function Ha(e,t){let r=Ir(e?.relay?.forwarderFactories,t),n=[r?.standingForwarderFactory,r?.depositorForwarderFactory].filter(o=>typeof o=="string");return n.length>0?n:void 0}var Qa="chains.json";async function Eg(e,t){return(await Jn(Qa,t))?.chains?.[String(e)]??{}}function $o(e,t){let[r,n]=nn.useState({});return nn.useEffect(()=>{if(e==null){n({});return}let o=!0;return Jn(Qa,t).then(a=>{o&&n(a?.chains?.[String(e)]??{})}),()=>{o=!1}},[e,t]),r}function Mg(e){let[t,r]=nn.useState({});return nn.useEffect(()=>{let n=!0;return Jn(Qa,e).then(o=>{n&&r(o?.chains??{})}),()=>{n=!1}},[e]),t}function Zt(e,t,r){let[n,o]=nn.useState(void 0),a=nn.useRef(r);return a.current=r,nn.useEffect(()=>{let i=!0;return Jn(e,t).then(s=>{if(!i)return;let l=a.current(s);l!==void 0&&o(l)}),()=>{i=!1}},[e,t]),n}var $n="1.3.17";var Va="__nexusCrossAppLauncherRuntime";function Ag(){if(typeof window>"u")return null;let e=window;return e[Va]??(e[Va]={mode:"dapp-ui"}),e[Va]}function Lg(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 r=e.connectKitVersion??"unknown";console.info(`[CROSSx App Launcher] connect-kit-react v${r} \uCD08\uAE30\uD654 \uC644\uB8CC (dapp-ui v${$n}, \uC0AC\uC6A9 \uBAA8\uB4DC: connect-kit)`)}else console.info(`[CROSSx App Launcher] dapp-ui v${$n} \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 js(e){let t=Ag();t&&(e?.mode==="connect-kit-react"?t.mode="connect-kit-react":t.mode||(t.mode="dapp-ui"),e?.connectKitVersion&&(t.connectKitVersion=e.connectKitVersion),Lg(t))}import{BrowserClient as Dg,Scope as Pg,defaultStackParser as Og,linkedErrorsIntegration as Bg,makeFetchTransport as zg}from"@sentry/react";var Fg="https://5c82aeb32da33b5a0a14b7c5393992ca@o4511668907081728.ingest.de.sentry.io/4511705324126289",Ug=`dapp-ui@${$n}`,vo=null,Nd=.1;function Td(){return Nd}function jg(e){switch(e){case"dev":return"dev";case"stage":return"stg";default:return"prod"}}function ea(e){if(vo)return vo;if(typeof window>"u")return null;let t=jg(tt(e?.environment));typeof e?.analyticsSampleRate=="number"&&(Nd=Math.min(1,Math.max(0,e.analyticsSampleRate)));let r=new Dg({dsn:e?.dsn??Fg,transport:zg,stackParser:Og,integrations:[Bg()],environment:t,release:Ug,enabled:e?.enabled??t==="prod"}),n=new Pg;return n.setClient(r),n.setTags({package:"dapp-ui",framework:"react",source:"dapp-ui"}),r.init(),vo=n,vo}function qa(){return vo}function Ya(e,t){let r=vo??ea();if(r)return r.captureException(e,t?{captureContext:{extra:t}}:void 0)}import{Component as Wg}from"react";var Ka=class extends Wg{constructor(){super(...arguments);this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(r,n){Ya(r,{componentStack:n.componentStack??void 0,boundary:this.props.name??"dapp-ui"})}render(){return this.state.hasError?this.props.fallback??null:this.props.children}};function Ee(...e){return e.filter(Boolean).join(" ")}var Gg=/CROSSx|ONE\s?wallet|ONE\s?pocket/i;function ko(){return typeof window>"u"?!1:Gg.test(window.navigator.userAgent)}var Id="__nexus_dapp_ui_uid",Ws=null;function _g(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():Array.from({length:32},()=>Math.floor(Math.random()*16).toString(16)).join("")}function Gs(){if(Ws)return Ws;let e=null;try{e=window.localStorage.getItem(Id)}catch{}if(!e||!e.startsWith("anon_")){e=`anon_${_g()}`;try{window.localStorage.setItem(Id,e)}catch{}}return Ws=e,e}async function Ed(e){if(typeof crypto>"u"||!crypto.subtle)return null;try{let t=new TextEncoder().encode(e.trim().toLowerCase()),r=await crypto.subtle.digest("SHA-256",t);return`wallet_${Array.from(new Uint8Array(r),o=>o.toString(16).padStart(2,"0")).join("").slice(0,16)}`}catch{return null}}function Hg(){let e=window.navigator.userAgent;return/ipad|tablet|(android(?!.*mobile))/i.test(e)?"tablet":/mobile|iphone|ipod|android/i.test(e)?"mobile":"desktop"}function Ld(){return{host:window.location.hostname,device_type:Hg(),is_cross_inapp:String(ko())}}var Md=!1;function _s(){if(typeof window>"u")return null;let e=qa()??ea();return e?(Md||(Md=!0,e.setUser({id:Gs()})),e):null}function Dd(){return Math.random()>=Td()}var Ad=0;function Ro(e){let t=_s();if(!t)return;let r=++Ad;if(!e){t.setUser({id:Gs()});return}Ed(e).then(n=>{n&&r===Ad&&t.setUser({id:n})})}function Za(e,t,r){let n=_s();!n||Dd()||n.captureMessage(`ui: ${e}_${t}`,"info",{captureContext:{tags:{...Ld(),feature:e,action:t,...r}}})}function He(e,t,r){let n=_s();if(!n||Dd())return;let o=r?.status??"success";n.captureMessage(`funnel: ${e}_${t}`,"info",{captureContext:{tags:{...Ld(),flow:e,funnel_step:`${e}_${t}`,funnel_status:o,...o==="failure"?{failure_reason:r?.reason??"unknown"}:{},...r?.tags}}})}function xr(e){let t=e,r=String((t&&typeof t=="object"&&"message"in t?t.message:e)??"").toLowerCase();return t?.code===4001||/reject|denied|declin|cancel/i.test(r)?"user-rejected":/insufficient (funds|gas|balance)|exceeds balance/i.test(r)?"insufficient-gas":/timeout|timed out|deadline/i.test(r)?"timeout":/revert|execution failed/i.test(r)?"contract-reverted":/network|fetch|connection|disconnected|offline/i.test(r)?"network":"unknown"}import{useCallback as Qg}from"react";import{jsx as Vg}from"react/jsx-runtime";function ge({feature:e,children:t}){let r=Qg(n=>{let o=n.nativeEvent;if(o.__dappUiTracked)return;let i=n.target?.closest?.("[data-track]");if(!i)return;let s=i.getAttribute("data-track");if(!s)return;o.__dappUiTracked=!0;let l=i.getAttribute("data-track-id");Za(e,s,l?{item_id:l}:void 0)},[e]);return Vg("div",{style:{display:"contents"},onClick:r,children:t})}import*as No from"react";import*as Od from"@radix-ui/react-popover";import{Drawer as th}from"vaul";import{createContext as qg,useContext as Yg}from"react";var Hs=qg(null);function Xa(){let e=Yg(Hs);if(!e)throw new Error("AppLauncher compound components must be used within <AppLauncher>");return e}import*as $a from"react";var Kg="__dappUiOverlay",eo=[],So=0,Vs=0,Ja=!1,Qs=!1;function Pd(){if(Vs>0){Vs-=1;return}So=Math.max(0,So-1),eo.pop()?.close(),qs()}function Zg(){Ja||(window.addEventListener("popstate",Pd),Ja=!0)}function qs(){eo.length>0||!Ja||(window.removeEventListener("popstate",Pd),Ja=!1)}function Xg(){Qs||(Qs=!0,queueMicrotask(()=>{Qs=!1;let e=So-eo.length;if(e<=0){qs();return}So-=e,Vs+=1,window.history.go(-e),qs()}))}function In(e,t){let r=$a.useRef(t);r.current=t,$a.useEffect(()=>{if(!(!e||typeof window>"u"))return Jg(()=>r.current())},[e])}function Jg(e){let t={close:e};return eo.push(t),So<eo.length&&(window.history.pushState({[Kg]:!0},""),So+=1),Zg(),()=>{let r=eo.lastIndexOf(t);r!==-1&&(eo.splice(r,1),Xg())}}import{useState as $g,useEffect as eh}from"react";function Co(e){let[t,r]=$g(!1);return eh(()=>{let n=window.matchMedia(e);r(n.matches);let o=a=>r(a.matches);return n.addEventListener("change",o),()=>n.removeEventListener("change",o)},[e]),t}function de(e,{insertAt:t}={}){if(!e||typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t==="top"&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}de(`[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-primary: #f3742e;--al-primary-hover: #ff8a4a;--al-primary-soft: #3a261f;--al-new-ribbon-bg: #ed0a72;--al-badge-bg: var(--ds-accent-primary-low, #123235);--al-badge-text: var(--ds-accent-primary-default, #00ceb2);--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-primary: #f3742e;--al-primary-hover: #ff8a4a;--al-primary-soft: #fff1eb;--al-new-ribbon-bg: #ed0a72;--al-badge-bg: var(--ds-accent-primary-low, #e7f9f8);--al-badge-text: var(--ds-accent-primary-default, #00b4b7);--al-drawer-overlay: var(--ds-overlay-dim, #00000080)}
|
|
2
2
|
`);de(`.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
3
|
`);de(`@keyframes al-fade-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}
|
|
4
4
|
`);de(`.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-menu{display:flex;flex-direction:column;width:424px;max-width:calc(100vw - 32px);padding:0 12px;box-sizing:border-box}.al-popover-content .al-grid{display:grid;grid-template-columns:repeat(4,100px);row-gap:12px;column-gap:0;justify-content:center;align-items:start}.al-popover-content .al-grid-item{position:relative;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:visible}.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-text{flex-direction:column;align-items:center;justify-content:center;gap:2px;max-width:100%;min-height:26px}.al-popover-content .al-grid-item-status-text{font-size:10px;line-height:1.1}.al-popover-content .al-badge-list{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-menu{display:flex;flex-direction:column;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;overflow:visible}.al-drawer-content .al-grid-item-icon{width:32px;height:32px;border-radius:6.75px;overflow:visible}.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(--al-text-secondary);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:flex-start;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:var(--al-bg-hover)!important}.al-grid-item-left{display:flex;align-items:center;gap:8px;min-width:0;overflow:visible}.al-grid-item-text{display:flex;flex-direction:column;align-items:flex-start;gap:1px;max-width:100%;min-width:0}.al-grid-item-icon{display:flex;align-items:center;justify-content:center;position:relative;width:24px;height:24px;overflow:visible;border-radius:5px;flex-shrink:0}.al-grid-item-icon img{width:100%;height:100%;object-fit:contain;border-radius:inherit}.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-grid-item-status-text{font-family:Inter,sans-serif;font-size:12px;font-weight:400;line-height:1.15;letter-spacing:0;color:var(--al-text);white-space:nowrap}.al-status-ribbon{position:absolute;top:-6px;right:-6px;display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;box-sizing:border-box;border-radius:999px;color:#fff;font-family:Pretendard,Inter,sans-serif;font-size:12px;font-weight:800;line-height:1;pointer-events:none;box-shadow:0 1px 3px #0000002e}.al-status-ribbon-new{background:var(--al-new-ribbon-bg)}.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}
|
|
5
|
-
`);de("");import{jsx as Ys}from"react/jsx-runtime";function Bd({env:e,theme:t="dark",mobileBreakpoint:r=768,domain:n,children:o}){let a=Co(`(max-width: ${r}px)`),[i,s]=No.useState(!1),l=No.useCallback(()=>s(!1),[]),d=tt(e);In(i,l);let c=No.useMemo(()=>({env:d,theme:t,isMobile:a,open:i,domain:n,close:l}),[d,t,a,i,n,l]);return Ys(Hs.Provider,{value:c,children:a?Ys(th.Root,{direction:"right",open:i,onOpenChange:s,noBodyStyles:!0,children:o},"drawer"):Ys(Od.Root,{open:i,onOpenChange:s,children:o},"popover")})}import*as jd from"@radix-ui/react-popover";import{Drawer as nh}from"vaul";import{jsx as vr,jsxs as rh}from"react/jsx-runtime";function zd({size:e=18}){return rh("svg",{className:"al-trigger-icon",width:e,height:e,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[vr("rect",{width:"4",height:"4",rx:"2",fill:"currentColor"}),vr("rect",{x:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),vr("rect",{x:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),vr("rect",{y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),vr("rect",{x:"7",y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),vr("rect",{x:"14",y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),vr("rect",{y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),vr("rect",{x:"7",y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),vr("rect",{x:"14",y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"})]})}function Fd(){return vr("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:vr("path",{d:"M12 19L5 12M5 12L12 5M5 12H19",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ud(){return vr("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:vr("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}import{jsx as To}from"react/jsx-runtime";function Wd({asChild:e,children:t,className:r,style:n}){let{isMobile:o,theme:a}=Xa(),i=t!=null,s=e??!0,l=r?`al-trigger-btn ${r}`:"al-trigger-btn",d=i?t:To("button",{type:"button",className:l,"data-theme":a,"data-track":"open",style:n,children:To(zd,{size:18})});return o?To(ge,{feature:"app_launcher",children:To(nh.Trigger,{asChild:s,children:d})}):To(ge,{feature:"app_launcher",children:To(jd.Trigger,{asChild:s,children:d})})}import*as on from"react";import*as ti from"@radix-ui/react-popover";import{Drawer as Io}from"vaul";import{useQuery as ih}from"@tanstack/react-query";var Gd={dev:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/app-launcher-v2.json",stage:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/app-launcher-v2.json",production:"https://contents.crosstoken.io/frontend/common/app-launcher/app-launcher-v2.json"};var oh="https://stg-contents.crosstoken.io/frontend/common/app-launcher/icons",ah="https://contents.crosstoken.io/frontend/common/app-launcher/icons";function qr(e,t){return`${e==="production"?ah:oh}/${t}.png`}function _d(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://stg.onechain.nexus/gametoken",stage:"https://stg.onechain.nexus/gametoken",production:"https://www.onechain.nexus/gametoken"},iconUrl:qr(t,"game-token"),order:1e3,type:"gametoken",badge:null,isNew:!1,serviceStatus:"available"},{id:"forge",label:"Forge",description:"Launch Your Game, Ignite the Market",url:{dev:"https://stg.onechain.nexus/forge",stage:"https://stg.onechain.nexus/forge",production:"https://onechain.nexus/forge"},iconUrl:qr(t,"forge"),order:4e3,type:"forge",badge:null,isNew:!0,serviceStatus:"available"},{id:"crossd",label:"Bridge",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:qr(t,"crossd"),order:5e3,type:"crossd",badge:null,isNew:!1,serviceStatus:"ending"},{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:qr(t,"prediction"),order:6e3,type:"prediction",badge:null,isNew:!0,serviceStatus:"available"},{id:"rewards",label:"Rewards",description:"Deposit CROSS and earn rewards. Grow together.",url:{dev:"https://stg.onechain.nexus/rewards",stage:"https://stg.onechain.nexus/rewards",production:"https://onechain.nexus/rewards"},iconUrl:qr(t,"reward"),order:7e3,type:"rewards",badge:null,isNew:!1,serviceStatus:"ending"},{id:"cross-staking",label:"Staking",description:"Stake CROSS and earn rewards.",url:{dev:"https://stg-stake.ogfcorp.com",stage:"https://stg-stake.ogfcorp.com",production:"https://stake.ogfcorp.com"},iconUrl:qr(t,"cross-staking"),order:7500,type:"cross-staking",badge:null,isNew:!0,serviceStatus:"available"},{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:qr(t,"nft"),order:8e3,type:"nft",badge:null,isNew:!1,serviceStatus:"available"},{id:"play",label:"Quest",description:"Discover and play games on CROSS.",url:{dev:"https://stg.onechain.nexus/quest",stage:"https://stg.onechain.nexus/quest",production:"https://www.onechain.nexus/quest"},iconUrl:qr(t,"play"),order:8500,type:"play",badge:null,isNew:!0,serviceStatus:"available"},{id:"shop",label:"Shop",description:"Game Payment Platform & In-Game Currency Store.",url:{dev:"https://stg.onechain.nexus/shop",stage:"https://stg.onechain.nexus/shop",production:"https://www.onechain.nexus/shop"},iconUrl:qr(t,"shop"),order:9e3,type:"shop",badge:null,isNew:!1,serviceStatus:"available"},{id:"explorer",label:"Explorer",description:"View transactions, blocks, and token data on the CROSS network.",url:{dev:"https://stg-explorer.onechain.nexus",stage:"https://stg-explorer.onechain.nexus",production:"https://explorer.onechain.nexus"},iconUrl:qr(t,"explorer"),order:12e3,type:"explorer",badge:null,isNew:!1,serviceStatus:"available"},{id:"wave",label:"Wave",description:"Stream, support, and earn in the CROSS ecosystem.",url:{dev:"https://stg.onechain.nexus/wave",stage:"https://stg.onechain.nexus/wave",production:"https://www.onechain.nexus/wave"},iconUrl:qr(t,"wave"),order:11e4,type:"wave",badge:null,isNew:!1,serviceStatus:"available"}]}}function ei(e){let t=tt(e);return ih({queryKey:["global-menu",t],queryFn:async()=>{try{let r=await fetch(Gd[t],{cache:"no-store"});if(!r.ok)throw new Error(`Failed to fetch global menu: ${r.status}`);return r.json()}catch{return _d(t)}},staleTime:300*1e3,gcTime:600*1e3,retry:!1,refetchOnMount:!0})}function Ks(e){return e.serviceStatus==="ending"||e.serviceStatus==="comingSoon"?e.serviceStatus:"available"}function Qd(e,t){return typeof e=="string"?e:e[t]??e.production??e.stage??e.dev}function Vd(e){return[...e].sort((t,r)=>{let n=Hd(t)-Hd(r);return n!==0?n:t.order-r.order})}function Hd(e){let t=Ks(e);return t==="comingSoon"?0:t==="ending"?2:1}import{jsx as Lt,jsxs as Eo}from"react/jsx-runtime";function sh(e){return e.id==="cross-staking"||e.type==="cross-staking"}function Yd({align:e="end",sideOffset:t=8,className:r}){let{env:n,theme:o,isMobile:a,domain:i,close:s}=Xa(),{data:l}=ei(n),d=on.useMemo(()=>Vd(l?.items??[]),[l?.items]),c=24,h=on.useRef(null),u=on.useRef(!1),m=on.useCallback(x=>{h.current={x:x.clientX,y:x.clientY},u.current=!1},[]),y=on.useCallback(x=>{let k=h.current;h.current=null,k&&(u.current=Math.abs(x.clientX-k.x)>c||Math.abs(x.clientY-k.y)>c)},[]),b=on.useCallback(()=>{h.current=null,u.current=!0},[]),f=typeof window<"u"?window.location.pathname:"",p=on.useCallback((x,k)=>{let R=u.current;if(u.current=!1,R&&x.detail!==0)return;let E=k.url[n]??k.url.production,S=qd(E,i);if(!S)try{let C=new URL(E);if(C.pathname===window.location.pathname&&C.search===window.location.search&&C.hash===window.location.hash){s();return}}catch{}if(S&&window.open(E,"_blank","noopener,noreferrer")){s();return}window.location.href=E},[n,i,s]),w=x=>{let k=x.url[n]??x.url.production,R=qd(k,i),E=Ks(x),S=E==="ending",C=Qd(x.iconUrl,n),I=!1;if(!R)try{let M=new URL(k).pathname;I=f===M||f.startsWith(M+"/")}catch{I=!1}return Lt("button",{type:"button",className:"al-grid-item","data-track":"menu_item_click","data-track-id":x.id,"data-active":I||void 0,"data-service-status":E,onPointerDown:m,onPointerUp:y,onPointerCancel:b,onClick:M=>p(M,x),children:Eo("div",{className:"al-grid-item-left",children:[Eo("div",{className:"al-grid-item-icon",children:[Lt("img",{src:C,alt:x.label,width:24,height:24,loading:"lazy"}),x.isNew&&Lt("span",{className:"al-status-ribbon al-status-ribbon-new",children:"N"})]}),Eo("span",{className:"al-grid-item-text",children:[Lt("span",{className:"al-grid-item-label",children:x.label}),S&&Lt("span",{className:"al-grid-item-status-text",children:"(End Soon)"}),x.badge&&!sh(x)&&Lt("span",{className:"al-badge al-badge-list",children:x.badge})]})]})},x.id)},g=Lt("div",{className:"al-menu","data-theme":o,children:Lt("div",{className:"al-grid",children:d.map(w)})});return a?Lt(ge,{feature:"app_launcher",children:Eo(Io.Portal,{children:[Lt(Io.Overlay,{className:"al-drawer-overlay"}),Eo(Io.Content,{className:Ee("al-drawer-content",r),"data-theme":o,children:[Eo("div",{className:"al-drawer-header",children:[Lt(Io.Close,{className:"al-drawer-close","data-track":"close",children:Lt(Fd,{})}),Lt(Io.Title,{className:"al-drawer-title",children:"CROSS Services"}),Lt(Io.Close,{className:"al-drawer-close","data-track":"close",children:Lt(Ud,{})})]}),Lt("div",{className:"al-drawer-body",children:g})]})]})}):Lt(ge,{feature:"app_launcher",children:Lt(ti.Portal,{children:Lt(ti.Content,{align:e,sideOffset:t,className:Ee("al-popover-content",r),"data-theme":o,children:g})})})}function qd(e,t){try{let r=new URL(e).hostname;return typeof window>"u"?!0:r!==(t??window.location.hostname)}catch{return!1}}import*as Vt from"react";import*as yf from"@radix-ui/react-popover";import{Drawer as zy}from"vaul";import{createContext as lh,useContext as dh}from"react";var Zs=lh(null);function En(){let e=dh(Zs);if(!e)throw new Error("WalletInfo compound components must be used within <WalletInfo>");return e}import{WALLET_LABELS as ch}from"@nexus-cross/crossx-design-system";var Xs=(n=>(n.CROSSx="crossx",n.MetaMask="io.metamask",n.Binance="com.binance.wallet",n))(Xs||{}),ri={crossx:{name:ch.default,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"}};import*as Wc from"react";import{jsx as _e,jsxs as ta}from"react/jsx-runtime";function Kd({size:e=16,className:t}){return ta("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[_e("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"}),_e("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 to({size:e=16,className:t}){return _e("svg",{width:e,height:e,viewBox:"4 4 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:_e("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 gn({size:e=16,className:t}){return _e("svg",{width:e,height:e,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:_e("path",{d:"M11.6667 3.5L5.25 9.91667L2.33334 7",stroke:"currentColor",strokeWidth:1.16667,strokeLinecap:"round",strokeLinejoin:"round"})})}function Yr({size:e=24,className:t}){return _e("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:_e("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function Zd({size:e=20,className:t}){return ta("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[_e("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"}),_e("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 ni({size:e=20,className:t}){return _e("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,children:_e("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 hn({size:e=20,className:t}){return _e("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:_e("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:1.67,strokeLinecap:"round",strokeLinejoin:"round"})})}function Er({size:e=20,className:t}){return _e("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:_e("path",{d:"M5 8L10 13L15 8",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function Xd({size:e=16,className:t}){return ta("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[_e("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"}),_e("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 Jd({size:e=16,className:t}){return ta("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[_e("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"}),_e("path",{d:"M1.667 1.667l16.666 16.666",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}var ph='<svg width="100%" height="100%" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_72837_24069)"><mask id="mask0_72837_24069" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="0" width="100" height="100"><path d="M50 0C10.5289 0 0 10.5289 0 50C0 89.4711 10.5289 100 50 100C89.4711 100 100 89.4711 100 50C100 10.5289 89.4711 0 50 0Z" fill="white"/></mask><g mask="url(#mask0_72837_24069)"><path d="M99.9501 0.0499268H0V100H99.9501V0.0499268Z" fill="url(#paint0_linear_72837_24069)"/><path d="M34.9302 100H99.9751V19.0619L34.9302 60.7286V100Z" fill="url(#paint1_linear_72837_24069)"/><path d="M34.9301 100H0V23.8024L34.9301 60.7285V100Z" fill="url(#paint2_linear_72837_24069)"/></g><g filter="url(#filter0_d_72837_24069)"><path d="M49.9503 21.4821L31.9862 31.8613C28.8176 33.6827 27.7198 37.7745 29.5411 40.9432C31.3625 44.1118 35.4543 45.2096 38.623 43.3883L53.8176 34.6058L46.582 42.3653V72.8044C46.582 76.4721 49.576 79.4661 53.2437 79.4661C56.9114 79.4661 59.9054 76.4721 59.9054 72.8044V27.2455C59.9054 25.9731 59.5062 24.7256 59.0072 23.9022C57.1359 20.7585 53.094 19.6358 49.9254 21.4571L49.9503 21.4821Z" fill="white"/></g></g><defs><filter id="filter0_d_72837_24069" x="7.4286" y="-0.650014" width="87.831" height="115.47" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/><feOffset dx="7.06088" dy="7.06088"/><feGaussianBlur stdDeviation="14.1467"/><feColorMatrix type="matrix" values="0 0 0 0 0.831373 0 0 0 0 0.113725 0 0 0 0 0.356863 0 0 0 0.3 0"/><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_72837_24069"/><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_72837_24069" result="shape"/></filter><linearGradient id="paint0_linear_72837_24069" x1="-11.5768" y1="-12.001" x2="106.562" y2="106.986" gradientUnits="userSpaceOnUse"><stop stop-color="#F3752D"/><stop offset="1" stop-color="#EC1272"/></linearGradient><linearGradient id="paint1_linear_72837_24069" x1="24.9501" y1="23.004" x2="73.6278" y2="64.8453" gradientUnits="userSpaceOnUse"><stop stop-color="white" stop-opacity="0.5"/><stop offset="1" stop-color="white" stop-opacity="0"/></linearGradient><linearGradient id="paint2_linear_72837_24069" x1="62.3503" y1="3.46804" x2="16.3423" y2="63.3732" gradientUnits="userSpaceOnUse"><stop stop-color="white" stop-opacity="0.5"/><stop offset="1" stop-color="white" stop-opacity="0"/></linearGradient><clipPath id="clip0_72837_24069"><rect width="100" height="100" fill="white"/></clipPath></defs></svg>',uh=`data:image/svg+xml,${encodeURIComponent(ph)}`;function $d({size:e=42,className:t}){return _e("img",{src:uh,width:e,height:e,alt:"",className:t,style:{display:"block"}})}function ec({size:e=20,className:t}){return _e("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:_e("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 tc({size:e=20,className:t}){return _e("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:_e("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 rc({size:e=20,className:t}){return _e("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:_e("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 nc({size:e=20,className:t}){return _e("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:_e("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 oc({size:e=20,className:t}){return ta("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[_e("circle",{cx:"10",cy:"10",r:"10",fill:"currentColor"}),_e("path",{d:"M6 10.2L8.6 12.8L14 7.2",stroke:"var(--ds-accent-primary-on, #ffffff)",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round"})]})}import*as ie from"react";import ro from"bignumber.js";function fh(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 Mn(e,t){if(!e||e==="0")return"0.00";let r=new ro(e).shiftedBy(-t),n=r.isGreaterThanOrEqualTo(1)?2:4;return r.toFormat(n,ro.ROUND_DOWN)}function Xt(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}function no(e){let t=typeof e=="string"?parseFloat(e):e;if(Number.isNaN(t)||t===0)return"$0.00";let r=t>=1?2:4,n=Math.pow(10,r);return`$${(Math.floor(t*n)/n).toLocaleString("en-US",{minimumFractionDigits:r,maximumFractionDigits:r})}`}function oi(e,t,r){let o=new ro(e).shiftedBy(-t).multipliedBy(new ro(r));return o.isZero()||o.isNaN()?"$0.00":`$${(o.integerValue(ro.ROUND_DOWN).isGreaterThanOrEqualTo(1)?o.decimalPlaces(2,ro.ROUND_DOWN):o.decimalPlaces(4,ro.ROUND_DOWN)).toFormat()}`}function ac(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 r=t;if(r.includes("e")||r.includes("E")){let i=Number(r);if(!Number.isFinite(i)||i===0)return{displayValue:"0",isLowerBound:!1};r=fh(i.toFixed(18))}let[n="0",o=""]=r.split(".");if(Number(n)>=1){let i=o.slice(0,2).padEnd(2,"0");return{displayValue:`${Number(n).toLocaleString("en-US")}.${i}`,isLowerBound:!1}}return o.length<4?{displayValue:`${n}.${o}`,isLowerBound:!1}:o.slice(0,4)==="0000"?{displayValue:"0.0001",isLowerBound:!0}:{displayValue:`0.${o.slice(0,4)}`,isLowerBound:!1}}import{useMemo as sc}from"react";import{useQuery as mh}from"@tanstack/react-query";var vt={dev:{cross:612044,bsc:97},stage:{cross:612044,bsc:97},production:{cross:612055,bsc:56}},ai="https://terms.onechain.nexus/docs/terms-july-23-2026",ii="https://terms.onechain.nexus/docs/pp-july-23-2026",ic="https://contents.crossdefi.io/Terms/terms/tos-26-07-09-oneusd.html";var gh="send:chain-info";function hh(e){if("data"in e&&e.data!==void 0){let t=e.data;if(Array.isArray(t)){let r=t[0];if(!r)throw new Error("Chain info payload is empty.");return r}return t}return e}function Js(e,...t){let r=e.replace(/\/+$/,""),n=t.map(o=>o.replace(/^\/+|\/+$/g,"")).filter(Boolean);return[r,...n].join("/")}function lc(e,t,r,n){if(n)return t===vt[e].cross?dc(t,n):r?.explorer_url?Js(r.explorer_url,r.explorer_postfix?.transaction??"tx",n):bh(e,t,n)}function dc(e,t){return Js("https://explorer.onechain.nexus",String(e),"tx",t)}function bh(e,t,r){let n=vt[e];if(t===n.cross)return dc(t,r);if(t===n.bsc)return Js(e==="production"?"https://bscscan.com":"https://testnet.bscscan.com","tx",r)}function ra(e,t,r,n=!0){let o=mh({queryKey:[gh,e,t],queryFn:async({signal:s})=>{let l=await Ne("walletServer",e),d=await fetch(`${l}/v1/public/chain/info/${t}`,{cache:"no-store",signal:s});if(!d.ok)throw new Error(`Failed to fetch chain info: ${d.status}`);let c=await d.json();if("code"in c&&c.code!==void 0&&c.code!==200)throw new Error(`Chain info API error: ${c.code}`);return hh(c)},enabled:n,staleTime:3e5}),a=o.data;return{transactionUrl:sc(()=>lc(e,t,a,r),[t,a,e,r]),chainInfo:a,...o}}function cc(e,t,r=!0){let{chainInfo:n}=ra(e,t,void 0,r);return{buildTxUrl:sc(()=>a=>lc(e,t,n,a),[e,t,n]),chainInfo:n}}var pc="0x0000000000000000000000000000000000000001";var wh="0xa9059cbb",yh=/^0x[a-fA-F0-9]{40}$/,xh="nexus-cross:dapp-ui:send:recent:",uc=10;function vh(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===48;)t--;return e.slice(0,t)}function na(e){return e.toLowerCase()}function an(e){return yh.test(e)}function An(e){return na(e.address)===pc}function $s(e){return`${xh}${e.toLowerCase()}`}function Mo(e){if(typeof window>"u")return[];try{let t=window.localStorage.getItem($s(e));if(!t)return[];let r=JSON.parse(t);return Array.isArray(r)?r.filter(n=>n!==null&&typeof n=="object"&&an(n.address)&&typeof n.updatedAt=="number").slice(0,uc):[]}catch{return[]}}function el(e,t){if(typeof window>"u")return[];let r=na(t),n=[{address:r,updatedAt:Date.now()},...Mo(e).filter(o=>o.address!==r)].slice(0,uc);try{window.localStorage.setItem($s(e),JSON.stringify(n))}catch{return Mo(e)}return n}function tl(e){if(!(typeof window>"u"))try{window.localStorage.removeItem($s(e))}catch{}}function oo(e,t){let r=e.trim();if(!r)return{error:"Enter an amount."};if(!/^\d+(\.\d*)?$/.test(r))return{error:"Enter a valid amount."};let[n="0",o=""]=r.split(".");if(o.length>t)return{error:`Max ${t} decimal places.`};let a=BigInt(n||"0"),i=o.padEnd(t,"0"),s=i?BigInt(i):0n,l=10n**BigInt(t),d=a*l+s;return d<=0n?{error:"Amount must be greater than 0."}:{value:d}}function Ao(e,t){let r=BigInt(e||"0"),n=10n**BigInt(t),o=r/n,a=r%n;if(a===0n)return o.toString();let i=vh(a.toString().padStart(t,"0"));return`${o.toString()}.${i}`}function rl(e,t){let r=e.replace(/^0x/,"").toLowerCase().padStart(64,"0"),n=t.toString(16).padStart(64,"0");return`${wh}${r}${n}`}function si(e,t,r=10){if(t<=0)return e.toString();let n=10n**BigInt(t),o=e/n,a=e%n;if(a===0n)return o.toString();let s=a.toString().padStart(t,"0").slice(0,Math.max(0,Math.min(r,t)));return s=s.replace(/0+$/,""),s?`${o.toString()}.${s}`:o.toString()}function nl(e,t){return si(e,t,6)}function fc(e){return si(e,9,2)}function mc(e){return e.toLocaleString("en-US")}function li(e){return e===56||e===97}function di(e){return e.gasPrice??e.maxFeePerGas}function gc(e,t=!1){return t?di(e)!==void 0?"legacy":null:e.maxFeePerGas!==void 0?"dynamic":e.gasPrice!==void 0?"legacy":null}function ci(e,t=!1){if(t){let r=di(e);return r!==void 0?e.gasLimit*r:null}return e.maxFeePerGas!==void 0?e.gasLimit*e.maxFeePerGas:e.gasPrice!==void 0?e.gasLimit*e.gasPrice:null}function pi(e){return!Number.isFinite(e)||e<=0?"$0.00":`$${e.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}function hc(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 r=e,n=[];return typeof r.name=="string"&&n.push(r.name),typeof r.shortMessage=="string"&&n.push(r.shortMessage),typeof r.message=="string"&&n.push(r.message),typeof r.details=="string"&&n.push(r.details),r.cause!==void 0&&n.push(hc(r.cause,t+1)),n.join(`
|
|
5
|
+
`);de("");import{jsx as Ys}from"react/jsx-runtime";function Bd({env:e,theme:t="dark",mobileBreakpoint:r=768,domain:n,children:o}){let a=Co(`(max-width: ${r}px)`),[i,s]=No.useState(!1),l=No.useCallback(()=>s(!1),[]),d=tt(e);In(i,l);let c=No.useMemo(()=>({env:d,theme:t,isMobile:a,open:i,domain:n,close:l}),[d,t,a,i,n,l]);return Ys(Hs.Provider,{value:c,children:a?Ys(th.Root,{direction:"right",open:i,onOpenChange:s,noBodyStyles:!0,children:o},"drawer"):Ys(Od.Root,{open:i,onOpenChange:s,children:o},"popover")})}import*as jd from"@radix-ui/react-popover";import{Drawer as nh}from"vaul";import{jsx as vr,jsxs as rh}from"react/jsx-runtime";function zd({size:e=18}){return rh("svg",{className:"al-trigger-icon",width:e,height:e,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[vr("rect",{width:"4",height:"4",rx:"2",fill:"currentColor"}),vr("rect",{x:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),vr("rect",{x:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),vr("rect",{y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),vr("rect",{x:"7",y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),vr("rect",{x:"14",y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),vr("rect",{y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),vr("rect",{x:"7",y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),vr("rect",{x:"14",y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"})]})}function Fd(){return vr("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:vr("path",{d:"M12 19L5 12M5 12L12 5M5 12H19",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ud(){return vr("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:vr("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}import{jsx as To}from"react/jsx-runtime";function Wd({asChild:e,children:t,className:r,style:n}){let{isMobile:o,theme:a}=Xa(),i=t!=null,s=e??!0,l=r?`al-trigger-btn ${r}`:"al-trigger-btn",d=i?t:To("button",{type:"button",className:l,"data-theme":a,"data-track":"open",style:n,children:To(zd,{size:18})});return o?To(ge,{feature:"app_launcher",children:To(nh.Trigger,{asChild:s,children:d})}):To(ge,{feature:"app_launcher",children:To(jd.Trigger,{asChild:s,children:d})})}import*as on from"react";import*as ti from"@radix-ui/react-popover";import{Drawer as Io}from"vaul";import{useQuery as ih}from"@tanstack/react-query";var Gd={dev:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/app-launcher-v2.json",stage:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/app-launcher-v2.json",production:"https://contents.crosstoken.io/frontend/common/app-launcher/app-launcher-v2.json"};var oh="https://stg-contents.crosstoken.io/frontend/common/app-launcher/icons",ah="https://contents.crosstoken.io/frontend/common/app-launcher/icons";function qr(e,t){return`${e==="production"?ah:oh}/${t}.png`}function _d(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://stg.onechain.nexus/gametoken",stage:"https://stg.onechain.nexus/gametoken",production:"https://www.onechain.nexus/gametoken"},iconUrl:qr(t,"game-token"),order:1e3,type:"gametoken",badge:null,isNew:!1,serviceStatus:"available"},{id:"forge",label:"Forge",description:"Launch Your Game, Ignite the Market",url:{dev:"https://stg.onechain.nexus/forge",stage:"https://stg.onechain.nexus/forge",production:"https://onechain.nexus/forge"},iconUrl:qr(t,"forge"),order:4e3,type:"forge",badge:null,isNew:!0,serviceStatus:"available"},{id:"crossd",label:"Bridge",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:qr(t,"crossd"),order:5e3,type:"crossd",badge:null,isNew:!1,serviceStatus:"ending"},{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:qr(t,"prediction"),order:6e3,type:"prediction",badge:null,isNew:!0,serviceStatus:"available"},{id:"rewards",label:"Rewards",description:"Deposit CROSS and earn rewards. Grow together.",url:{dev:"https://stg.onechain.nexus/rewards",stage:"https://stg.onechain.nexus/rewards",production:"https://onechain.nexus/rewards"},iconUrl:qr(t,"reward"),order:7e3,type:"rewards",badge:null,isNew:!1,serviceStatus:"ending"},{id:"cross-staking",label:"Staking",description:"Stake CROSS and earn rewards.",url:{dev:"https://stg-stake.ogfcorp.com",stage:"https://stg-stake.ogfcorp.com",production:"https://stake.ogfcorp.com"},iconUrl:qr(t,"cross-staking"),order:7500,type:"cross-staking",badge:null,isNew:!0,serviceStatus:"available"},{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:qr(t,"nft"),order:8e3,type:"nft",badge:null,isNew:!1,serviceStatus:"available"},{id:"play",label:"Quest",description:"Discover and play games on CROSS.",url:{dev:"https://stg.onechain.nexus/quest",stage:"https://stg.onechain.nexus/quest",production:"https://www.onechain.nexus/quest"},iconUrl:qr(t,"play"),order:8500,type:"play",badge:null,isNew:!0,serviceStatus:"available"},{id:"shop",label:"Shop",description:"Game Payment Platform & In-Game Currency Store.",url:{dev:"https://stg.onechain.nexus/shop",stage:"https://stg.onechain.nexus/shop",production:"https://www.onechain.nexus/shop"},iconUrl:qr(t,"shop"),order:9e3,type:"shop",badge:null,isNew:!1,serviceStatus:"available"},{id:"explorer",label:"Explorer",description:"View transactions, blocks, and token data on the CROSS network.",url:{dev:"https://stg-explorer.onechain.nexus",stage:"https://stg-explorer.onechain.nexus",production:"https://explorer.onechain.nexus"},iconUrl:qr(t,"explorer"),order:12e3,type:"explorer",badge:null,isNew:!1,serviceStatus:"available"},{id:"wave",label:"Wave",description:"Stream, support, and earn in the CROSS ecosystem.",url:{dev:"https://stg.onechain.nexus/wave",stage:"https://stg.onechain.nexus/wave",production:"https://www.onechain.nexus/wave"},iconUrl:qr(t,"wave"),order:11e4,type:"wave",badge:null,isNew:!1,serviceStatus:"available"}]}}function ei(e){let t=tt(e);return ih({queryKey:["global-menu",t],queryFn:async()=>{try{let r=await fetch(Gd[t],{cache:"no-store"});if(!r.ok)throw new Error(`Failed to fetch global menu: ${r.status}`);return r.json()}catch{return _d(t)}},staleTime:300*1e3,gcTime:600*1e3,retry:!1,refetchOnMount:!0})}function Ks(e){return e.serviceStatus==="ending"||e.serviceStatus==="comingSoon"?e.serviceStatus:"available"}function Qd(e,t){return typeof e=="string"?e:e[t]??e.production??e.stage??e.dev}function Vd(e){return[...e].sort((t,r)=>{let n=Hd(t)-Hd(r);return n!==0?n:t.order-r.order})}function Hd(e){let t=Ks(e);return t==="comingSoon"?0:t==="ending"?2:1}import{jsx as Lt,jsxs as Eo}from"react/jsx-runtime";function sh(e){return e.id==="cross-staking"||e.type==="cross-staking"}function Yd({align:e="end",sideOffset:t=8,className:r}){let{env:n,theme:o,isMobile:a,domain:i,close:s}=Xa(),{data:l}=ei(n),d=on.useMemo(()=>Vd(l?.items??[]),[l?.items]),c=24,h=on.useRef(null),u=on.useRef(!1),m=on.useCallback(x=>{h.current={x:x.clientX,y:x.clientY},u.current=!1},[]),y=on.useCallback(x=>{let k=h.current;h.current=null,k&&(u.current=Math.abs(x.clientX-k.x)>c||Math.abs(x.clientY-k.y)>c)},[]),b=on.useCallback(()=>{h.current=null,u.current=!0},[]),f=typeof window<"u"?window.location.pathname:"",p=on.useCallback((x,k)=>{let R=u.current;if(u.current=!1,R&&x.detail!==0)return;let E=k.url[n]??k.url.production,S=qd(E,i);if(!S)try{let C=new URL(E);if(C.pathname===window.location.pathname&&C.search===window.location.search&&C.hash===window.location.hash){s();return}}catch{}if(S){let C=window.open(E,"_blank");if(C){C.opener=null,s();return}}window.location.href=E},[n,i,s]),w=x=>{let k=x.url[n]??x.url.production,R=qd(k,i),E=Ks(x),S=E==="ending",C=Qd(x.iconUrl,n),I=!1;if(!R)try{let M=new URL(k).pathname;I=f===M||f.startsWith(M+"/")}catch{I=!1}return Lt("button",{type:"button",className:"al-grid-item","data-track":"menu_item_click","data-track-id":x.id,"data-active":I||void 0,"data-service-status":E,onPointerDown:m,onPointerUp:y,onPointerCancel:b,onClick:M=>p(M,x),children:Eo("div",{className:"al-grid-item-left",children:[Eo("div",{className:"al-grid-item-icon",children:[Lt("img",{src:C,alt:x.label,width:24,height:24,loading:"lazy"}),x.isNew&&Lt("span",{className:"al-status-ribbon al-status-ribbon-new",children:"N"})]}),Eo("span",{className:"al-grid-item-text",children:[Lt("span",{className:"al-grid-item-label",children:x.label}),S&&Lt("span",{className:"al-grid-item-status-text",children:"(End Soon)"}),x.badge&&!sh(x)&&Lt("span",{className:"al-badge al-badge-list",children:x.badge})]})]})},x.id)},g=Lt("div",{className:"al-menu","data-theme":o,children:Lt("div",{className:"al-grid",children:d.map(w)})});return a?Lt(ge,{feature:"app_launcher",children:Eo(Io.Portal,{children:[Lt(Io.Overlay,{className:"al-drawer-overlay"}),Eo(Io.Content,{className:Ee("al-drawer-content",r),"data-theme":o,children:[Eo("div",{className:"al-drawer-header",children:[Lt(Io.Close,{className:"al-drawer-close","data-track":"close",children:Lt(Fd,{})}),Lt(Io.Title,{className:"al-drawer-title",children:"CROSS Services"}),Lt(Io.Close,{className:"al-drawer-close","data-track":"close",children:Lt(Ud,{})})]}),Lt("div",{className:"al-drawer-body",children:g})]})]})}):Lt(ge,{feature:"app_launcher",children:Lt(ti.Portal,{children:Lt(ti.Content,{align:e,sideOffset:t,className:Ee("al-popover-content",r),"data-theme":o,children:g})})})}function qd(e,t){try{let r=new URL(e).hostname;return typeof window>"u"?!0:r!==(t??window.location.hostname)}catch{return!1}}import*as Vt from"react";import*as yf from"@radix-ui/react-popover";import{Drawer as zy}from"vaul";import{createContext as lh,useContext as dh}from"react";var Zs=lh(null);function En(){let e=dh(Zs);if(!e)throw new Error("WalletInfo compound components must be used within <WalletInfo>");return e}import{WALLET_LABELS as ch}from"@nexus-cross/crossx-design-system";var Xs=(n=>(n.CROSSx="crossx",n.MetaMask="io.metamask",n.Binance="com.binance.wallet",n))(Xs||{}),ri={crossx:{name:ch.default,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"}};import*as Wc from"react";import{jsx as _e,jsxs as ta}from"react/jsx-runtime";function Kd({size:e=16,className:t}){return ta("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[_e("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"}),_e("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 to({size:e=16,className:t}){return _e("svg",{width:e,height:e,viewBox:"4 4 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:_e("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 gn({size:e=16,className:t}){return _e("svg",{width:e,height:e,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:_e("path",{d:"M11.6667 3.5L5.25 9.91667L2.33334 7",stroke:"currentColor",strokeWidth:1.16667,strokeLinecap:"round",strokeLinejoin:"round"})})}function Yr({size:e=24,className:t}){return _e("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:_e("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function Zd({size:e=20,className:t}){return ta("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[_e("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"}),_e("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 ni({size:e=20,className:t}){return _e("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,children:_e("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 hn({size:e=20,className:t}){return _e("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:_e("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:1.67,strokeLinecap:"round",strokeLinejoin:"round"})})}function Er({size:e=20,className:t}){return _e("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:_e("path",{d:"M5 8L10 13L15 8",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function Xd({size:e=16,className:t}){return ta("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[_e("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"}),_e("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 Jd({size:e=16,className:t}){return ta("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[_e("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"}),_e("path",{d:"M1.667 1.667l16.666 16.666",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}var ph='<svg width="100%" height="100%" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_72837_24069)"><mask id="mask0_72837_24069" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="0" width="100" height="100"><path d="M50 0C10.5289 0 0 10.5289 0 50C0 89.4711 10.5289 100 50 100C89.4711 100 100 89.4711 100 50C100 10.5289 89.4711 0 50 0Z" fill="white"/></mask><g mask="url(#mask0_72837_24069)"><path d="M99.9501 0.0499268H0V100H99.9501V0.0499268Z" fill="url(#paint0_linear_72837_24069)"/><path d="M34.9302 100H99.9751V19.0619L34.9302 60.7286V100Z" fill="url(#paint1_linear_72837_24069)"/><path d="M34.9301 100H0V23.8024L34.9301 60.7285V100Z" fill="url(#paint2_linear_72837_24069)"/></g><g filter="url(#filter0_d_72837_24069)"><path d="M49.9503 21.4821L31.9862 31.8613C28.8176 33.6827 27.7198 37.7745 29.5411 40.9432C31.3625 44.1118 35.4543 45.2096 38.623 43.3883L53.8176 34.6058L46.582 42.3653V72.8044C46.582 76.4721 49.576 79.4661 53.2437 79.4661C56.9114 79.4661 59.9054 76.4721 59.9054 72.8044V27.2455C59.9054 25.9731 59.5062 24.7256 59.0072 23.9022C57.1359 20.7585 53.094 19.6358 49.9254 21.4571L49.9503 21.4821Z" fill="white"/></g></g><defs><filter id="filter0_d_72837_24069" x="7.4286" y="-0.650014" width="87.831" height="115.47" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/><feOffset dx="7.06088" dy="7.06088"/><feGaussianBlur stdDeviation="14.1467"/><feColorMatrix type="matrix" values="0 0 0 0 0.831373 0 0 0 0 0.113725 0 0 0 0 0.356863 0 0 0 0.3 0"/><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_72837_24069"/><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_72837_24069" result="shape"/></filter><linearGradient id="paint0_linear_72837_24069" x1="-11.5768" y1="-12.001" x2="106.562" y2="106.986" gradientUnits="userSpaceOnUse"><stop stop-color="#F3752D"/><stop offset="1" stop-color="#EC1272"/></linearGradient><linearGradient id="paint1_linear_72837_24069" x1="24.9501" y1="23.004" x2="73.6278" y2="64.8453" gradientUnits="userSpaceOnUse"><stop stop-color="white" stop-opacity="0.5"/><stop offset="1" stop-color="white" stop-opacity="0"/></linearGradient><linearGradient id="paint2_linear_72837_24069" x1="62.3503" y1="3.46804" x2="16.3423" y2="63.3732" gradientUnits="userSpaceOnUse"><stop stop-color="white" stop-opacity="0.5"/><stop offset="1" stop-color="white" stop-opacity="0"/></linearGradient><clipPath id="clip0_72837_24069"><rect width="100" height="100" fill="white"/></clipPath></defs></svg>',uh=`data:image/svg+xml,${encodeURIComponent(ph)}`;function $d({size:e=42,className:t}){return _e("img",{src:uh,width:e,height:e,alt:"",className:t,style:{display:"block"}})}function ec({size:e=20,className:t}){return _e("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:_e("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 tc({size:e=20,className:t}){return _e("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:_e("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 rc({size:e=20,className:t}){return _e("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:_e("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 nc({size:e=20,className:t}){return _e("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:_e("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 oc({size:e=20,className:t}){return ta("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[_e("circle",{cx:"10",cy:"10",r:"10",fill:"currentColor"}),_e("path",{d:"M6 10.2L8.6 12.8L14 7.2",stroke:"var(--ds-accent-primary-on, #ffffff)",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round"})]})}import*as ie from"react";import ro from"bignumber.js";function fh(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 Mn(e,t){if(!e||e==="0")return"0.00";let r=new ro(e).shiftedBy(-t),n=r.isGreaterThanOrEqualTo(1)?2:4;return r.toFormat(n,ro.ROUND_DOWN)}function Xt(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}function no(e){let t=typeof e=="string"?parseFloat(e):e;if(Number.isNaN(t)||t===0)return"$0.00";let r=t>=1?2:4,n=Math.pow(10,r);return`$${(Math.floor(t*n)/n).toLocaleString("en-US",{minimumFractionDigits:r,maximumFractionDigits:r})}`}function oi(e,t,r){let o=new ro(e).shiftedBy(-t).multipliedBy(new ro(r));return o.isZero()||o.isNaN()?"$0.00":`$${(o.integerValue(ro.ROUND_DOWN).isGreaterThanOrEqualTo(1)?o.decimalPlaces(2,ro.ROUND_DOWN):o.decimalPlaces(4,ro.ROUND_DOWN)).toFormat()}`}function ac(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 r=t;if(r.includes("e")||r.includes("E")){let i=Number(r);if(!Number.isFinite(i)||i===0)return{displayValue:"0",isLowerBound:!1};r=fh(i.toFixed(18))}let[n="0",o=""]=r.split(".");if(Number(n)>=1){let i=o.slice(0,2).padEnd(2,"0");return{displayValue:`${Number(n).toLocaleString("en-US")}.${i}`,isLowerBound:!1}}return o.length<4?{displayValue:`${n}.${o}`,isLowerBound:!1}:o.slice(0,4)==="0000"?{displayValue:"0.0001",isLowerBound:!0}:{displayValue:`0.${o.slice(0,4)}`,isLowerBound:!1}}import{useMemo as sc}from"react";import{useQuery as mh}from"@tanstack/react-query";var vt={dev:{cross:612044,bsc:97},stage:{cross:612044,bsc:97},production:{cross:612055,bsc:56}},ai="https://terms.onechain.nexus/docs/terms-july-23-2026",ii="https://terms.onechain.nexus/docs/pp-july-23-2026",ic="https://contents.crossdefi.io/Terms/terms/tos-26-07-09-oneusd.html";var gh="send:chain-info";function hh(e){if("data"in e&&e.data!==void 0){let t=e.data;if(Array.isArray(t)){let r=t[0];if(!r)throw new Error("Chain info payload is empty.");return r}return t}return e}function Js(e,...t){let r=e.replace(/\/+$/,""),n=t.map(o=>o.replace(/^\/+|\/+$/g,"")).filter(Boolean);return[r,...n].join("/")}function lc(e,t,r,n){if(n)return t===vt[e].cross?dc(t,n):r?.explorer_url?Js(r.explorer_url,r.explorer_postfix?.transaction??"tx",n):bh(e,t,n)}function dc(e,t){return Js("https://explorer.onechain.nexus",String(e),"tx",t)}function bh(e,t,r){let n=vt[e];if(t===n.cross)return dc(t,r);if(t===n.bsc)return Js(e==="production"?"https://bscscan.com":"https://testnet.bscscan.com","tx",r)}function ra(e,t,r,n=!0){let o=mh({queryKey:[gh,e,t],queryFn:async({signal:s})=>{let l=await Ne("walletServer",e),d=await fetch(`${l}/v1/public/chain/info/${t}`,{cache:"no-store",signal:s});if(!d.ok)throw new Error(`Failed to fetch chain info: ${d.status}`);let c=await d.json();if("code"in c&&c.code!==void 0&&c.code!==200)throw new Error(`Chain info API error: ${c.code}`);return hh(c)},enabled:n,staleTime:3e5}),a=o.data;return{transactionUrl:sc(()=>lc(e,t,a,r),[t,a,e,r]),chainInfo:a,...o}}function cc(e,t,r=!0){let{chainInfo:n}=ra(e,t,void 0,r);return{buildTxUrl:sc(()=>a=>lc(e,t,n,a),[e,t,n]),chainInfo:n}}var pc="0x0000000000000000000000000000000000000001";var wh="0xa9059cbb",yh=/^0x[a-fA-F0-9]{40}$/,xh="nexus-cross:dapp-ui:send:recent:",uc=10;function vh(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===48;)t--;return e.slice(0,t)}function na(e){return e.toLowerCase()}function an(e){return yh.test(e)}function An(e){return na(e.address)===pc}function $s(e){return`${xh}${e.toLowerCase()}`}function Mo(e){if(typeof window>"u")return[];try{let t=window.localStorage.getItem($s(e));if(!t)return[];let r=JSON.parse(t);return Array.isArray(r)?r.filter(n=>n!==null&&typeof n=="object"&&an(n.address)&&typeof n.updatedAt=="number").slice(0,uc):[]}catch{return[]}}function el(e,t){if(typeof window>"u")return[];let r=na(t),n=[{address:r,updatedAt:Date.now()},...Mo(e).filter(o=>o.address!==r)].slice(0,uc);try{window.localStorage.setItem($s(e),JSON.stringify(n))}catch{return Mo(e)}return n}function tl(e){if(!(typeof window>"u"))try{window.localStorage.removeItem($s(e))}catch{}}function oo(e,t){let r=e.trim();if(!r)return{error:"Enter an amount."};if(!/^\d+(\.\d*)?$/.test(r))return{error:"Enter a valid amount."};let[n="0",o=""]=r.split(".");if(o.length>t)return{error:`Max ${t} decimal places.`};let a=BigInt(n||"0"),i=o.padEnd(t,"0"),s=i?BigInt(i):0n,l=10n**BigInt(t),d=a*l+s;return d<=0n?{error:"Amount must be greater than 0."}:{value:d}}function Ao(e,t){let r=BigInt(e||"0"),n=10n**BigInt(t),o=r/n,a=r%n;if(a===0n)return o.toString();let i=vh(a.toString().padStart(t,"0"));return`${o.toString()}.${i}`}function rl(e,t){let r=e.replace(/^0x/,"").toLowerCase().padStart(64,"0"),n=t.toString(16).padStart(64,"0");return`${wh}${r}${n}`}function si(e,t,r=10){if(t<=0)return e.toString();let n=10n**BigInt(t),o=e/n,a=e%n;if(a===0n)return o.toString();let s=a.toString().padStart(t,"0").slice(0,Math.max(0,Math.min(r,t)));return s=s.replace(/0+$/,""),s?`${o.toString()}.${s}`:o.toString()}function nl(e,t){return si(e,t,6)}function fc(e){return si(e,9,2)}function mc(e){return e.toLocaleString("en-US")}function li(e){return e===56||e===97}function di(e){return e.gasPrice??e.maxFeePerGas}function gc(e,t=!1){return t?di(e)!==void 0?"legacy":null:e.maxFeePerGas!==void 0?"dynamic":e.gasPrice!==void 0?"legacy":null}function ci(e,t=!1){if(t){let r=di(e);return r!==void 0?e.gasLimit*r:null}return e.maxFeePerGas!==void 0?e.gasLimit*e.maxFeePerGas:e.gasPrice!==void 0?e.gasLimit*e.gasPrice:null}function pi(e){return!Number.isFinite(e)||e<=0?"$0.00":`$${e.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}function hc(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 r=e,n=[];return typeof r.name=="string"&&n.push(r.name),typeof r.shortMessage=="string"&&n.push(r.shortMessage),typeof r.message=="string"&&n.push(r.message),typeof r.details=="string"&&n.push(r.details),r.cause!==void 0&&n.push(hc(r.cause,t+1)),n.join(`
|
|
6
6
|
`).toLowerCase()}function kh(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 ol(e,t={},r="Failed to send transaction."){let n=hc(e);if(!n)return r;let o=t.nativeSymbol?.trim()||"gas token",a=t.networkName?.trim();if(n.includes("user rejected")||n.includes("userrejected")||n.includes("user denied")||n.includes("user cancelled")||n.includes("user canceled")||n.includes("action_rejected")||n.includes("rejected by user"))return"Transaction was cancelled.";if(n.includes("insufficientfunds")||n.includes("insufficient funds")||n.includes("exceeds the balance of the account")||n.includes("insufficient balance for transfer")){let i=a?` on ${a}`:"";return`Not enough ${o} to cover the gas fee.Please top up your ${o} balance and try again.`}return n.includes("transaction underpriced")||n.includes("replacement transaction underpriced")||n.includes("fee too low")?"Gas fee was too low for the network. Please try again.":n.includes("nonce too low")||n.includes("nonce has already been used")||n.includes("nonce too high")?"Pending transactions are out of order. Refresh the page and try again.":n.includes("execution reverted")||n.includes("contractfunctionrevertederror")||n.includes("contractfunctionexecutionerror")?"The transaction was rejected by the contract. The recipient or token may be invalid.":n.match(/chain \d+ is not configured/)?"This network is not registered in the app. Contact support.":n.includes("http request failed")||n.includes("failed to fetch")||n.includes("network request failed")||n.includes("timeout")||n.includes("econnreset")||n.includes("rpc error")||n.includes("429")?"Network connection failed. Check your internet and try again.":n.includes("estimategas")||n.includes("gas estimation failed")?"Could not estimate the gas fee. The recipient address or amount may be invalid.":kh(e)||r}var Rh=2000000000n,Sh=1000000000n;async function ui(e,t,r){let n=new AbortController,o=setTimeout(()=>n.abort(),8e3),a=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:t,params:r}),signal:n.signal}).finally(()=>clearTimeout(o));if(!a.ok)throw new Error(`RPC ${t} HTTP ${a.status}`);let i=await a.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 fi(e){return BigInt(e)}function Ch(e){return`0x${e.toString(16)}`}function Nh(e){let t={to:e.to};return e.from&&(t.from=e.from),e.value!==void 0&&e.value>0n&&(t.value=Ch(e.value)),e.data&&(t.data=e.data),t}function Th(e){return e===56||e===97}async function bc(e){try{let t=await ui(e,"eth_gasPrice",[]);return{gasPrice:fi(t)}}catch{return{gasPrice:Rh}}}async function Ih(e,t){let r=Sh;try{let n=await ui(e,"eth_maxPriorityFeePerGas",[]);r=fi(n)}catch{}return{maxFeePerGas:t+r,maxPriorityFeePerGas:r}}async function Eh(e,t){if(t)return bc(e);let r;try{r=(await ui(e,"eth_getBlockByNumber",["latest",!1]))?.baseFeePerGas}catch{}return r?Ih(e,fi(r)):bc(e)}async function wc(e,t){let r=Th(t.chainId),n=Nh(t),[o,a]=await Promise.all([ui(e,"eth_estimateGas",[n]),Eh(e,r)]);return{gasLimit:fi(o),gasPrice:a.gasPrice,maxFeePerGas:a.maxFeePerGas,maxPriorityFeePerGas:a.maxPriorityFeePerGas}}function yc(e){let{estimateGas:t,sendTransaction:r,getTransactionReceipt:n}=e;return{canSend:!!r,canEstimateGas(o){return!!t||!!o},async estimateGas(o,a){if(t)return t(o);if(a)return wc(a,o);throw new Error("Gas estimation is not available.")},async sendTransaction(o){if(!r)throw new Error("Sending is not available for this wallet.");return r(o)},getTransactionReceipt:n}}var Mh=1500,Ah=120;function xc(e){return!!(e.token||e.recipient||e.amount)}function al({recipient:e,amount:t,token:r,balanceRaw:n}){let o={},a=e.trim(),i=oo(t,r.quantity.decimals),s;return a?an(a)||(o.recipient="Enter a valid EVM recipient address."):o.recipient="Enter a recipient address.","error"in i?o.amount=i.error:(s=i.value,s>n&&(o.amount="Amount exceeds available balance.")),!An(r)&&!an(r.address)&&(o.token="Token contract address is invalid."),{errors:o,rawAmount:o.amount?void 0:s,recipient:a&&an(a)?a:void 0}}function il({token:e,walletAddress:t,recipient:r,rawAmount:n}){let o=t;return An(e)?{to:r,value:n,chainId:e.chainId,from:o}:{to:na(e.address),data:rl(r,n),value:0n,chainId:e.chainId,from:o}}function Lh(e){let{status:t}=e;return t==="reverted"||t==="0x0"||t===0||t===0n||t===!1}var Dh=e=>new Promise(t=>setTimeout(t,e));async function vc({repository:e,args:t,chainId:r,onSubmitted:n,pollIntervalMs:o=Mh,pollMaxAttempts:a=Ah}){let i=await e.sendTransaction(t);n(i);let{getTransactionReceipt:s}=e;if(!s)return"success";for(let l=0;l<a;l+=1){let d=await s({hash:i,chainId:r}).catch(()=>null);if(d)return Lh(d)?"reverted":"success";await Dh(o)}return"timeout"}var kc=["token","recipient","amount","review"];function Rc(e){let{env:t,walletAddress:r,accountName:n,accounts:o=[],initialStep:a="recipient",token:i,tokens:s=[],onTokenChange:l,sendTransaction:d,getTransactionReceipt:c,estimateGas:h,getTokenPriceUsd:u,onSubmitted:m,onSuccess:y,onFailed:b,onExit:f,onOutlink:p}=e,w=ie.useMemo(()=>yc({sendTransaction:d,getTransactionReceipt:c,estimateGas:h}),[d,c,h]),[g,x]=ie.useState(i);ie.useEffect(()=>{x(i)},[i.address,i.chainId]);let[k,R]=ie.useState(a),[E,S]=ie.useState(""),[C,I]=ie.useState(""),[M,F]=ie.useState({}),[L,U]=ie.useState("idle"),[A,O]=ie.useState(""),[te,Y]=ie.useState(""),[G,H]=ie.useState(null),[re,K]=ie.useState(!1),[B,Z]=ie.useState(""),_=ie.useRef(0),[le,we]=ie.useState(null),[J,pe]=ie.useState(""),[Be,ye]=ie.useState(()=>Mo(r)),st=ie.useRef(new Set),fe=ie.useCallback((P,ae)=>{st.current.has(P)||(st.current.add(P),He("send",P,ae))},[]);ie.useEffect(()=>{fe("opened"),a!=="token"&&fe("token_selected",{tags:{item_id:i.symbol}})},[fe,a,i.symbol]);let me=ie.useMemo(()=>tt(t),[t]),{transactionUrl:rt,chainInfo:ze}=ra(me,g.chainId,A||void 0,!0),Ie=$o(g.chainId,me),Ae=Ie.nativeSymbol??ze?.currency_symbol??"",$e=Ie.name??ze?.name??`Chain ID ${g.chainId}`,Mt=ie.useRef({nativeSymbol:Ae||void 0,networkName:$e,tokenSymbol:g.symbol});Mt.current={nativeSymbol:Ae||void 0,networkName:$e,tokenSymbol:g.symbol};let gt=ie.useMemo(()=>BigInt(g.quantity.numeric||"0"),[g.quantity.numeric]),Nt=ie.useMemo(()=>Mn(g.quantity.numeric,g.quantity.decimals),[g.quantity.numeric,g.quantity.decimals]),Re=u?.(g),Tt=ie.useMemo(()=>{if(Re===void 0)return;let P=parseFloat(C.replace(/,/g,""));return Number.isFinite(P)?P*Re:0},[C,Re]);ie.useEffect(()=>{I(""),F({})},[g.address,g.chainId]),ie.useEffect(()=>{_.current+=1,H(null),Z(""),K(!1)},[g.address,g.chainId,E,C]),ie.useEffect(()=>{ye(Mo(r))},[r]);let et=ie.useCallback(P=>{S(P),F(ae=>({...ae,recipient:void 0}))},[]),wt=ie.useCallback(P=>{I(P),F(ae=>({...ae,amount:void 0}))},[]),qe=ie.useCallback(()=>{I(Nt.replace(/,/g,"")),F(P=>({...P,amount:void 0}))},[Nt]),Le=ie.useCallback(P=>{x(P),l?.(P),fe("token_selected",{tags:{item_id:P.symbol}}),R("recipient")},[l,fe]),tr=ie.useCallback(()=>R("token"),[]),Bt=ie.useCallback(()=>{R(P=>{if(P==="result")return"review";if(P===a)return f?.(),P;let ae=kc.indexOf(P);return ae<=0?(f?.(),P):kc[ae-1]})},[a,f]),nt=ie.useCallback(()=>{let{errors:P}=al({recipient:E,amount:"1",token:g,balanceRaw:gt});if(P.recipient){F(ae=>({...ae,recipient:P.recipient}));return}F(ae=>({...ae,recipient:void 0})),fe("recipient_entered"),R("amount")},[E,g,gt,fe]),yt=ie.useCallback(P=>{S(P),F(ae=>({...ae,recipient:void 0})),fe("recipient_entered"),R("amount")},[fe]),Ye=ie.useCallback(()=>{let P=al({recipient:E,amount:C,token:g,balanceRaw:gt});F(P.errors),!(xc(P.errors)||P.rawAmount===void 0||!P.recipient)&&(we(P.rawAmount),pe(P.recipient),H(null),Z(""),U("idle"),fe("amount_entered"),R("review"))},[E,C,g,gt,fe]);ie.useEffect(()=>{if(k!=="review"||!J||le===null||G!==null||re||B||!w.canEstimateGas(ze?.rpc))return;let P=++_.current;K(!0),Z(""),(async()=>{try{let ae=il({token:g,walletAddress:r,recipient:J,rawAmount:le}),ue=await w.estimateGas(ae,ze?.rpc);if(_.current!==P)return;H(ue)}catch(ae){if(_.current!==P)return;Z(ol(ae,Mt.current,"Failed to estimate gas."))}finally{_.current===P&&K(!1)}})()},[k,J,le,G,re,B,w,ze?.rpc,g,r]);let je=ie.useMemo(()=>{if(!An(g)||!G||le===null)return!1;let P=ci(G,li(g.chainId));return P===null?!1:le+P>gt},[g,G,le,gt]),Je=ie.useCallback(async()=>{if(!(!J||le===null)&&!je){Y(""),O(""),U("submitting"),fe("submitted");try{let P="",ae=await vc({repository:w,args:il({token:g,walletAddress:r,recipient:J,rawAmount:le}),chainId:g.chainId,onSubmitted:ue=>{P=ue,O(ue),U("confirming"),ye(el(r,J)),m?.({txHash:ue,chainId:g.chainId,amount:C,tokenSymbol:g.symbol,recipient:J})}});if(ae==="success")U("success"),fe("confirmed"),P&&y?y?.(P):R("result");else if(ae==="reverted"){let ue="Transaction reverted on-chain.";U("error"),Y(ue),fe("confirmed",{status:"failure",reason:xr(new Error(ue))}),P&&b?b({txHash:P,chainId:g.chainId,message:ue}):R("result")}else{let ue="Transaction receipt was not found. Please check again later.";U("error"),Y(ue),fe("confirmed",{status:"failure",reason:"timeout"}),P&&b?b({txHash:P,chainId:g.chainId,message:ue}):R("result")}}catch(P){U("error"),fe("confirmed",{status:"failure",reason:xr(P)}),Y(ol(P,{nativeSymbol:Ae||void 0,networkName:$e,tokenSymbol:g.symbol})),R("result")}}},[w,J,le,je,g,C,r,m,y,b,Ae,$e,fe]),[xt,We]=ie.useState(!1),pt=ie.useRef(void 0);ie.useEffect(()=>()=>clearTimeout(pt.current),[]);let ht=ie.useCallback(async()=>{if(A)try{await navigator.clipboard.writeText(A),We(!0),clearTimeout(pt.current),pt.current=setTimeout(()=>We(!1),2e3)}catch{}},[A]),z=ie.useCallback(()=>{if(!rt||!A)return;let P=he=>{typeof window<"u"&&window.open(he,"_blank","noopener,noreferrer")};if(!p){P(rt);return}let ae=p(rt,{category:"send",origin:"send-transaction",payload:{chainId:g.chainId,txHash:A}});if(ae&&typeof ae.then=="function"){let he=typeof window<"u"?window.open("","_blank","noopener,noreferrer"):null;ae.then(lt=>{if(lt===null){he?.close();return}let Gt=lt??rt;if(he)try{he.location.href=Gt}catch{he.close(),P(Gt)}else P(Gt)});return}let ue=ae;ue!==null&&P(ue??rt)},[p,g.chainId,rt,A]),Fe=ie.useCallback(()=>{Y(""),O(""),U("idle"),H(null),Z(""),st.current.delete("submitted"),st.current.delete("confirmed"),R("review")},[]);return{step:k,status:L,token:g,tokens:s.length>0?s:[g],recipient:E,amount:C,amountUsd:Tt,fieldErrors:M,error:te,txHash:A,gasEstimate:G,gasLoading:re,gasError:B,insufficientGas:je,reviewRawAmount:le,reviewRecipient:J,recentAddresses:Be,accounts:o,accountName:n,walletAddress:r,resolvedEnv:me,transactionUrl:rt,networkName:$e,nativeSymbol:Ae,nativeDecimals:ze?.currency_decimals??g.quantity.decimals,balanceRaw:gt,balanceText:Nt,priceUsd:Re,canSelectToken:(s.length>0?s:[g]).length>1,canSend:w.canSend,getTokenPriceUsd:u,setRecipient:et,setAmount:wt,setMax:qe,selectToken:Le,goToTokenSelect:tr,selectRecipient:yt,submitRecipient:nt,submitAmount:Ye,confirmSend:Je,retry:Fe,back:Bt,hashCopied:xt,copyHash:ht,openTransaction:z}}import*as Kr from"react";import{jsx as oa,jsxs as sl}from"react/jsx-runtime";function Sc({flow:e}){let{amount:t,setAmount:r,amountUsd:n,balanceText:o,balanceRaw:a,token:i,setMax:s}=e,l=Kr.useRef(null),d=Kr.useCallback(()=>{requestAnimationFrame(()=>{let b=l.current;if(!b)return;let f=b.value.length;b.setSelectionRange(f,f)})},[]);Kr.useEffect(()=>{l.current?.focus(),d()},[d]),Kr.useEffect(()=>{t===""&&(u(!1),d())},[t,d]);let c=Kr.useMemo(()=>{let b=oo(t,i.quantity.decimals);return"value"in b&&b.value>a},[t,i.quantity.decimals,a]),[h,u]=Kr.useState(!1),m=!h&&t===""?"0.00":t,y=t.trim()===""||t.trim()==="0";return oa("div",{className:"sf-body sf-amount",children:sl("div",{className:"sf-amount-center",children:[oa("span",{className:"sf-amount-usd",children:n!==void 0?pi(n):"\xA0"}),oa("div",{className:"sf-amount-input-wrap","data-over":c||void 0,"data-empty":y||void 0,onClick:()=>l.current?.focus(),children:oa("input",{ref:l,className:"sf-amount-input",value:m,onChange:b=>{let f=b.target.value;if(h)r(f);else if(t===""){if(f.length<4)return;u(!0);let p=f.startsWith("0.00")?f.slice(4):f;r(p)}else u(!0),r(f)},placeholder:"0.00",inputMode:"decimal",autoComplete:"off","aria-label":`Amount in ${i.symbol}`,size:1})}),sl("div",{className:"sf-amount-balance",children:[oa("span",{children:"Balance:"}),sl("button",{type:"button",className:"sf-amount-max",onClick:s,"data-track":"amount_max",children:[o," ",i.symbol]})]})]})})}import*as Zr from"react";var Oh=new Set(["0xff42c13d927a6b9265236619161accb227b6d452","0x9364ea6790f6e0ecfaa5164085f2a7de34ec55fb"].map(e=>e.toLowerCase()));function Nc(e){return Oh.has(e.toLowerCase())}var Cc={cross:"https://contents.crosstoken.io/wallet/token/images/CROSS.svg",bsc:"https://contents.crosstoken.io/wallet/token/images/BSC.svg"};function aa(e,t){let r=vt[e];if(t===r.cross)return Cc.cross;if(t===r.bsc)return Cc.bsc}var Bh={dev:"https://dev-portrait.crosstoken.io",stage:"https://dev-portrait.crosstoken.io",production:"https://portrait.crosstoken.io"};function bn(e,t,r={}){if(!t||!t.startsWith("0x"))return;let{size:n=120,bg:o,format:a="png"}=r,i=Bh[e],s=o?`&bg=${o}`:"";return`${i}/portrait/evm/${t}.${a}?size=${n}${s}`}import{jsx as Mr,jsxs as mi}from"react/jsx-runtime";function Tc({size:e=20,className:t}){return mi("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,"aria-hidden":"true",children:[Mr("circle",{cx:"9",cy:"9",r:"6",stroke:"currentColor",strokeWidth:"1.7"}),Mr("path",{d:"m17 17-3.2-3.2",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function Ic({size:e=20,className:t}){return Mr("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",className:t,"aria-hidden":"true",children:Mr("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 Ec({size:e=20,className:t}){return mi("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,"aria-hidden":"true",children:[Mr("circle",{cx:"10",cy:"10",r:"10",fill:"currentColor",opacity:"0.12"}),Mr("path",{d:"M7 7l6 6M13 7l-6 6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})]})}function Mc({size:e=16,className:t}){return Mr("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",className:t,"aria-hidden":"true",children:Mr("path",{d:"M8 3v10m0 0 4-4m-4 4-4-4",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ac({size:e=56,className:t}){return mi("svg",{width:e,height:e,viewBox:"0 0 56 56",fill:"none",className:t,"aria-hidden":"true",children:[Mr("circle",{cx:"28",cy:"28",r:"28",fill:"var(--ds-accent-primary-default, #00b4b7)"}),Mr("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 Lc({size:e=56,className:t}){return mi("svg",{width:e,height:e,viewBox:"0 0 56 56",fill:"none",className:t,"aria-hidden":"true",children:[Mr("circle",{cx:"28",cy:"28",r:"28",fill:"var(--ds-system-red-default, #da0b2e)"}),Mr("path",{d:"M20 20 36 36m0-16L20 36",stroke:"#ffffff",strokeWidth:"4",strokeLinecap:"round"})]})}import{jsx as Dt,jsxs as sn}from"react/jsx-runtime";function Dc(e,t){return e.name||`Account ${(e.index??t)+1}`}function Pc(e){return e.trim().slice(0,1).toUpperCase()||"A"}function Oc(e){return e.toLowerCase()}function Bc({flow:e}){let{recipient:t,setRecipient:r,fieldErrors:n,recentAddresses:o,accounts:a,walletAddress:i,resolvedEnv:s,selectRecipient:l}=e,d=Zr.useMemo(()=>a.filter(g=>g.address.toLowerCase()!==i.toLowerCase()),[a,i]),c=d.length>0,h=Zr.useMemo(()=>new Map(d.map((g,x)=>[Oc(g.address),{account:g,index:x}])),[d]),[u,m]=Zr.useState("recent"),y=Zr.useRef(null);Zr.useEffect(()=>{y.current?.focus()},[]);let b="1A1A2E",f=Zr.useCallback(async()=>{try{let g=await navigator.clipboard.readText();g&&r(g.trim())}catch{}},[r]),p=t.trim().length>0,w=an(t.trim());return sn("div",{className:"sf-recipient",children:[sn("div",{className:"sf-recipient-top",children:[sn("div",{className:"sf-address-field","data-filled":p||void 0,"data-invalid":n.recipient||void 0,children:[Dt("textarea",{ref:y,className:"sf-address-input",value:t,onChange:g=>r(g.target.value),placeholder:"Enter the recipient's address",autoComplete:"off",spellCheck:!1,"aria-label":"Recipient address",rows:p?2:1}),p?Dt("button",{type:"button",className:"sf-address-action",onClick:()=>r(""),"aria-label":"Clear","data-track":"recipient_clear",children:Dt(Ec,{size:20})}):Dt("button",{type:"button",className:"sf-address-action",onClick:f,"aria-label":"Paste from clipboard","data-track":"recipient_paste",children:Dt(Ic,{size:20})})]}),n.recipient&&Dt("p",{className:"sf-field-error",role:"alert",children:n.recipient}),sn("div",{className:"sf-tabs",role:"tablist",children:[Dt("button",{type:"button",role:"tab",className:"sf-tab","data-active":u==="recent"||void 0,"aria-selected":u==="recent",onClick:()=>m("recent"),"data-track":"recipient_tab","data-track-id":"recent",children:"Recent"}),c&&Dt("button",{type:"button",role:"tab",className:"sf-tab","data-active":u==="account"||void 0,"aria-selected":u==="account",onClick:()=>m("account"),"data-track":"recipient_tab","data-track-id":"account",children:"My Account"})]})]}),Dt("div",{className:"sf-address-list",children:u==="account"&&c?d.map((g,x)=>{let k=Dc(g,x),R=bn(s,g.address,{size:56,bg:b});return sn("button",{type:"button",className:"sf-address-row",onClick:()=>l(g.address),"data-track":"recipient_item",children:[sn("span",{className:"sf-address-avatar",children:[R&&Dt("img",{src:R,alt:"",width:40,height:40,draggable:!1,onError:E=>{E.currentTarget.style.display="none"}}),Dt("span",{className:"sf-address-avatar-fallback",children:Pc(k)})]}),sn("span",{className:"sf-address-meta",children:[Dt("span",{className:"sf-address-name",children:k}),Dt("span",{className:"sf-address-value",children:Xt(g.address)})]})]},g.address)}):o.length>0?o.map(g=>{let x=h.get(Oc(g.address)),k=x?Dc(x.account,x.index):Xt(g.address),R=bn(s,g.address,{size:56,bg:b});return sn("button",{type:"button",className:"sf-address-row",onClick:()=>l(g.address),"data-track":"recipient_item",children:[sn("span",{className:"sf-address-avatar",children:[R&&Dt("img",{src:R,alt:"",width:40,height:40,draggable:!1,onError:E=>{E.currentTarget.style.display="none"}}),Dt("span",{className:"sf-address-avatar-fallback",children:Pc(k)})]}),sn("span",{className:"sf-address-meta",children:[Dt("span",{className:"sf-address-name",children:k}),Dt("span",{className:"sf-address-value",children:Xt(g.address)})]})]},g.address)}):Dt("div",{className:"sf-empty",children:"No send history"})}),p&&!w&&!n.recipient&&Dt("p",{className:"sf-field-error",role:"alert",children:"Enter a valid EVM recipient address."})]})}import{jsx as or,jsxs as Lo}from"react/jsx-runtime";function Fc({flow:e}){let{status:t,txHash:r,error:n,copyHash:o,hashCopied:a,openTransaction:i}=e,s=t==="error",l=t==="success";return s?Lo("div",{className:"sf-body sf-result sf-result--error",children:[or("span",{className:"sf-result-icon",children:or(Lc,{size:56})}),Lo("div",{className:"sf-result-copy",children:[or("h3",{className:"sf-result-title",children:"Transaction Failed"}),or("p",{className:"sf-result-desc",children:n||"Something went wrong. Please try again."})]}),r&&or(zc,{txHash:r,hashCopied:a,onCopy:o,onOpen:i})]}):Lo("div",{className:"sf-body sf-result",children:[or("span",{className:"sf-result-icon","data-pending":!l||void 0,children:l?or(Ac,{size:56}):or("span",{className:"sf-result-spinner"})}),Lo("div",{className:"sf-result-copy",children:[or("h3",{className:"sf-result-title",children:l?"Transaction Complete":"Transaction in Progress"}),or("p",{className:"sf-result-desc",children:l?"Your transfer was sent successfully.":"Transfer in progress. Waiting for confirmation."})]}),r&&or(zc,{txHash:r,hashCopied:a,onCopy:o,onOpen:i})]})}function zc({txHash:e,hashCopied:t,onCopy:r,onOpen:n}){return Lo("div",{className:"sf-result-hash-card",children:[or("span",{className:"sf-result-hash-label",children:"Transaction Hash"}),Lo("div",{className:"sf-result-hash-row",children:[or("button",{type:"button",className:"sf-result-hash-link",onClick:n,"aria-label":"Open transaction in explorer","data-track":"tx_link_open",children:Xt(e)}),or("button",{type:"button",className:"sf-result-copy-btn",onClick:r,"aria-label":"Copy transaction hash","data-track":"tx_hash_copy",children:t?or(gn,{size:16}):"Copy"})]})]})}import{jsx as kt,jsxs as ar}from"react/jsx-runtime";var gi="\u2014";function Uc({flow:e}){let{token:t,reviewRawAmount:r,reviewRecipient:n,accountName:o,accounts:a,walletAddress:i,networkName:s,nativeSymbol:l,nativeDecimals:d,gasEstimate:c,gasLoading:h,gasError:u,insufficientGas:m,error:y,resolvedEnv:b}=e,f=An(t),p=r!==null?si(r,t.quantity.decimals):"",w=o?.trim()||`Account ${(a[0]?.index??0)+1}`,g=bn(b,i,{size:56,bg:"1A1A2E"}),x=l||(f?t.symbol:""),k=li(t.chainId),R=c?gc(c,k):null,E=c?ci(c,k):null,S=L=>L!==null&&x?`${nl(L,d)} ${x}`:gi,C=L=>L!==void 0?`${fc(L)} Gwei`:gi,I=(()=>{if(!f||!c||E===null||r===null)return gi;let L=r+E;return`${nl(L,d)} ${x||t.symbol}`})(),M=L=>h?"\u2026":L,F=[{label:"Est. Tx Fee",value:M(S(E))},...R==="dynamic"?[{label:"Max Priority Fee",value:M(C(c?.maxPriorityFeePerGas))},{label:"Max Gas Fee",value:M(C(c?.maxFeePerGas))}]:R==="legacy"?[{label:"Gas Price",value:M(C(c?di(c):void 0))}]:[],{label:"Gas Limit",value:M(c?mc(c.gasLimit):gi)}];return ar("div",{className:"sf-body sf-review",children:[ar("div",{className:"sf-review-amount",children:[kt("img",{className:"sf-review-amount-icon",src:t.icon_url,alt:"",width:40,height:40,draggable:!1,onError:L=>{L.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),ar("span",{className:"sf-review-amount-value",children:[p,kt("span",{className:"sf-review-amount-symbol",children:t.symbol})]})]}),ar("div",{className:"sf-review-parties",children:[ar("div",{className:"sf-review-card sf-review-party",children:[kt("span",{className:"sf-review-party-label",children:"From"}),ar("div",{className:"sf-review-party-head",children:[kt("span",{className:"sf-review-party-avatar",children:g&&kt("img",{src:g,alt:"",width:28,height:28,draggable:!1,onError:L=>{L.currentTarget.style.display="none"}})}),kt("span",{className:"sf-review-party-name",children:w})]}),kt("span",{className:"sf-review-party-addr",children:i})]}),kt("span",{className:"sf-review-arrow","aria-hidden":!0,children:kt(Mc,{size:16})}),ar("div",{className:"sf-review-card sf-review-party",children:[kt("span",{className:"sf-review-party-label",children:"To"}),kt("span",{className:"sf-review-party-addr",children:n})]})]}),ar("section",{className:"sf-review-card",children:[kt("h3",{className:"sf-review-section-title",children:"Summary"}),ar("div",{className:"sf-review-row",children:[kt("span",{className:"sf-review-row-label",children:"Network"}),kt("span",{className:"sf-review-row-value",children:s})]}),F.map(L=>ar("div",{className:"sf-review-row",children:[kt("span",{className:"sf-review-row-label",children:L.label}),kt("span",{className:"sf-review-row-value",children:L.value})]},L.label))]}),ar("section",{className:"sf-review-card",children:[kt("h3",{className:"sf-review-section-title",children:"Total"}),ar("div",{className:"sf-review-row",children:[kt("span",{className:"sf-review-row-label",children:"Total Amount"}),ar("span",{className:"sf-review-row-value",children:[p," ",t.symbol]})]}),f&&ar("div",{className:"sf-review-row",children:[kt("span",{className:"sf-review-row-label",children:"Max. Total Amount"}),kt("span",{className:"sf-review-row-value",children:M(I)})]})]}),m&&!u&&!y&&ar("div",{className:"sf-message sf-message--error",role:"alert",children:["Not enough ",x||t.symbol," to cover the amount plus the network fee. Reduce the amount and try again."]}),(u||y)&&kt("div",{className:"sf-message sf-message--error",role:"alert",children:u||y})]})}import*as hi from"react";import{jsx as Ln,jsxs as ao}from"react/jsx-runtime";function jc({flow:e}){let[t,r]=hi.useState(""),n=t.trim().toLowerCase(),o=hi.useMemo(()=>n?e.tokens.filter(a=>a.symbol.toLowerCase().includes(n)||a.name.toLowerCase().includes(n)):e.tokens,[e.tokens,n]);return ao("div",{className:"sf-body sf-token-select",children:[ao("div",{className:"sf-search",children:[Ln(Tc,{size:20}),Ln("input",{className:"sf-search-input",value:t,onChange:a=>r(a.target.value),placeholder:"Search Tokens",autoComplete:"off",spellCheck:!1,"aria-label":"Search tokens"})]}),ao("div",{className:"sf-token-list",children:[o.map(a=>{let i=`${a.chainId}:${a.address.toLowerCase()}`,s=aa(e.resolvedEnv,a.chainId),l=e.getTokenPriceUsd?.(a);return ao("button",{type:"button",className:"sf-token-row",onClick:()=>e.selectToken(a),"data-track":"token_item","data-track-id":a.symbol,children:[ao("span",{className:"sf-token-left",children:[ao("span",{className:"sf-token-icon-wrap",children:[Ln("img",{className:"sf-token-icon",src:a.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"}}),s&&Ln("img",{className:"sf-token-chain-badge",src:s,alt:"","aria-hidden":!0,width:16,height:16,loading:"lazy",draggable:!1,onError:d=>{d.currentTarget.style.display="none"}})]}),Ln("span",{className:"sf-token-name",children:a.symbol})]}),ao("span",{className:"sf-token-right",children:[Ln("span",{className:"sf-token-balance",children:Mn(a.quantity.numeric,a.quantity.decimals)}),l!==void 0&&Ln("span",{className:"sf-token-price",children:pi(l)})]})]},i)}),o.length===0&&Ln("div",{className:"sf-empty",children:"No tokens found"})]})]})}de(`.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-gradient, linear-gradient(196deg, #ff2589 16%, #ff823d 84%));color:#fff}.sf-btn--primary:hover:not(:disabled):not([data-disabled]){filter:brightness(1.05)}.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-gradient, linear-gradient(196deg, #ff2589 16%, #ff823d 84%));color:#fff;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-system-orange-default, #f0640d)}.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;flex-shrink:0;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-system-orange-default, #f0640d)}.sf-address-field[data-filled]{border-color:var(--ds-system-orange-default, #f0640d)}.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-system-orange-high, #e56f00)}.sf-tab[data-active]:after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:3px;border-radius:9999px;background:var(--ds-system-orange-high, #e56f00)}.sf-address-list{display:flex;flex-direction:column;flex:1;min-height:0;width:100%;margin-top:8px;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.15) transparent}[data-theme=light] .sf-address-list{scrollbar-color:rgba(0,0,0,.12) transparent}.sf-address-list::-webkit-scrollbar{width:4px}.sf-address-list::-webkit-scrollbar-track{background:transparent}.sf-address-list::-webkit-scrollbar-thumb{border-radius:4px;background:#ffffff26}[data-theme=light] .sf-address-list::-webkit-scrollbar-thumb{background:#0000001f}.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;z-index:1;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-system-orange-default, #f0640d);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-system-orange-high, #e56f00)}.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
7
|
`);import{jsx as Ft,jsxs as bi}from"react/jsx-runtime";var zh={token:"Send",recipient:"Send",amount:"Send",review:"Sign Transaction",result:""};function wi({onClose:e,onBackToWallet:t,onConfirmSuccess:r,onSuccess:n,className:o,...a}){let i=Wc.useCallback(p=>{n?.(p),r?.(p)},[r,n]),l=Rc({...a,onSuccess:n||r?i:void 0,onExit:t}),{step:d,status:c}=l,h=an(l.recipient.trim()),u=oo(l.amount,l.token.quantity.decimals),m="value"in u&&u.value<=l.balanceRaw,y=c==="submitting"||c==="confirming",b=d!=="result",f=zh[d]??"";return Ft(ge,{feature:"send",children:bi("div",{className:Ee("sf-root",o),"data-step":d,children:[bi("header",{className:"sf-header",children:[b?Ft("button",{type:"button",className:"sf-header-btn",onClick:l.back,"aria-label":"Back","data-track":"back",children:Ft(hn,{size:24})}):Ft("span",{className:"sf-header-btn","aria-hidden":!0}),Ft("span",{className:"sf-header-title",children:f}),Ft("button",{type:"button",className:"sf-header-btn",onClick:e,"aria-label":"Close","data-track":"close",children:Ft(Yr,{size:24})})]}),d==="token"&&Ft(jc,{flow:l}),d==="recipient"&&Ft(Bc,{flow:l}),d==="amount"&&Ft(Sc,{flow:l}),d==="review"&&Ft(Uc,{flow:l}),d==="result"&&Ft(Fc,{flow:l}),bi("footer",{className:"sf-footer","data-step":d,children:[d==="recipient"&&Ft("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:l.submitRecipient,"data-disabled":!h||void 0,"aria-disabled":!h,"data-track":"recipient_next",children:"Next"}),d==="amount"&&Ft("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:l.submitAmount,"data-disabled":!m||void 0,"aria-disabled":!m,"data-track":"amount_next",children:"Next"}),d==="review"&&bi("div",{className:"sf-footer-row",children:[Ft("button",{type:"button",className:"sf-btn sf-btn--secondary",onClick:l.back,disabled:y,"data-track":"review_cancel",children:"Cancel"}),Ft("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:l.confirmSend,disabled:y||!l.canSend||l.insufficientGas,"data-track":"review_send",children:y?"Sending...":"Send"})]}),d==="result"&&c==="success"&&Ft("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:()=>r?.(l.txHash||void 0),"data-track":"result_ok",children:"All done"}),d==="result"&&c==="error"&&Ft("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:l.retry,"data-track":"result_retry",children:"Try Again"})]})]})})}import*as Gc from"@radix-ui/react-popover";import{Drawer as Fh}from"vaul";import{jsx as yi,jsxs as Uh}from"react/jsx-runtime";function _c({asChild:e,className:t,children:r}){let{isMobile:n,theme:o,walletAddress:a}=En(),i=r!=null,s=e??!0,l=i?r:Uh("button",{type:"button",className:Ee("wi-trigger-btn",t),"data-theme":o,"data-mobile":n||void 0,children:[yi(Kd,{size:n?14:16}),yi("span",{className:"wi-trigger-address",children:Xt(a)})]});return n?yi(Fh.Trigger,{asChild:s,children:l}):yi(Gc.Trigger,{asChild:s,children:l})}import*as $ from"react";import*as Xi from"@radix-ui/react-popover";import{Drawer as Zi}from"vaul";import va from"bignumber.js";import ll from"bignumber.js";var jh=/^[+-]?(\d+\.?\d*|\.\d+)(e[+-]?\d+)?$/i;function ot(e){if(e==null)return null;if(e instanceof ll)return e.isFinite()?e:null;if(typeof e=="number")return Number.isFinite(e)?new ll(e):null;let t=String(e).replace(/[,%\s]/g,"");if(!jh.test(t))return null;let r=new ll(t);return r.isFinite()?r:null}import{useQueries as Wh}from"@tanstack/react-query";import{useMemo as Gh}from"react";var dl="user-balance";async function _h(e,t,r,n){let o=new URLSearchParams({networkId:`eip155:${t}`,account:r}),a=await fetch(`${e}/v1/public/token/balance?${o}`,{cache:"no-store",signal:n});if(!a.ok)throw new Error(`Failed to fetch token balance: ${a.status}`);let i=await a.json();if(i.code!==200)throw new Error(`Token balance API error: ${i.code}`);return i.data}function Dn(e,t,r=!0){let n=vt[e],o=[n.cross,n.bsc],a=Wh({queries:o.map(d=>({queryKey:[dl,e,t,d],queryFn:async({signal:c})=>_h(await Ne("walletServer",e),d,t,c),enabled:!!t&&r,staleTime:0,refetchInterval:r?5e3:!1}))}),i=a.some(d=>d.isLoading),s=a.some(d=>d.isError);return{tokens:Gh(()=>{let d=[];for(let c of a)c.data&&d.push(...c.data);return d},[a]),isLoading:i,isError:s}}import{useQuery as Hh,useQueries as Qh}from"@tanstack/react-query";import{useMemo as Vh}from"react";var qh="forge-holdings",Yh="forge-token-image";async function Kh(e,t,r){let n=await fetch(`${e}/v1/users/${t}/holdings`,{cache:"no-store",signal:r});if(!n.ok)throw new Error(`Failed to fetch forge holdings: ${n.status}`);let o=await n.json();if(!o.success)throw new Error("Forge holdings API error");return o.data.items}async function Zh(e,t,r){let n=await fetch(`${e}/v1/tokens/${t}`,{cache:"no-store",signal:r});if(!n.ok)return{address:t,image_url:""};let o=await n.json();return o.success?{address:t,image_url:o.data.token.image_url}:{address:t,image_url:""}}function Hc(e,t,r=!0){let{data:n,...o}=Hh({queryKey:[qh,e,t],queryFn:async({signal:a})=>Kh(await Ne("bondingCurve",e),t,a),enabled:!!t&&r,staleTime:0,refetchInterval:r?5e3:!1});return{holdings:n??[],...o}}function Qc(e,t,r=!0){let n=Qh({queries:t.map(a=>({queryKey:[Yh,e,a],queryFn:async({signal:i})=>Zh(await Ne("bondingCurve",e),a,i),enabled:r,staleTime:1/0}))});return{imageMap:Vh(()=>{let a=new Map;for(let i of n)i.data&&a.set(i.data.address,i.data.image_url);return a},[n])}}import{useQuery as Xh}from"@tanstack/react-query";import{useMemo as Jh}from"react";var cl="token-stats";function Ar(e,t){return`${e}:${t.toLowerCase()}`}function Pn(e,t=!0){let{data:r,...n}=Xh({queryKey:[cl,e],queryFn:async({signal:a})=>{let i=await Ne("walletServer",e),s=await fetch(`${i}/v1/public/token/stats`,{cache:"no-store",signal:a});if(!s.ok)throw new Error(`Failed to fetch token stats: ${s.status}`);let l=await s.json();if(l.code!==200)throw new Error(`Token stats API error: ${l.code}`);return l},enabled:t,staleTime:3e4});return{statsMap:Jh(()=>{let a=new Map;if(!r?.data)return a;for(let i of r.data){let s=Ar(i.chain_id,i.address);a.set(s,i)}return a},[r]),...n}}import{useQuery as $h}from"@tanstack/react-query";var eb="crossd-apr",Vc=6e4,tb="https://crossd-dashboard-api.crossdefi.io/api/v1/overview",xi,ia;function pl(){return xi&&xi.expiresAt>Date.now()?Promise.resolve(xi.value):ia||(ia=(async()=>{let e=await fetch(tb,{cache:"no-store"});if(!e.ok)throw new Error(`Failed to fetch CROSSD overview: ${e.status}`);let t=await e.json();if(t.code!==200)throw new Error(`CROSSD overview API error: ${t.code}`);let r=parseFloat(t.data.est_last_epoch_apy);if(!Number.isFinite(r))throw new Error("CROSSD overview returned a non-numeric APR");let n=r*100;return xi={value:n,expiresAt:Date.now()+Vc},n})().finally(()=>{ia=void 0}),ia)}function vi(e){let t=Math.abs(e),r=(e>=0?Math.floor:Math.ceil)(t*100)/100;return`APR ${e>=0?"+":"-"}${r}%`}function qc(){let{data:e,...t}=$h({queryKey:[eb],queryFn:pl,staleTime:Vc});return{aprPercent:e??null,...t}}import{useQuery as rb}from"@tanstack/react-query";import{useMemo as Yc}from"react";var nb="token-info";function sa(e,t){return`${t.toLowerCase()}_${e}`}function Kc(e,t=!0){let{data:r,...n}=rb({queryKey:[nb,e],queryFn:async({signal:i})=>{let s=await Ne("walletServer",e),l=await fetch(`${s}/v1/public/token/info`,{cache:"no-store",signal:i});if(!l.ok)throw new Error(`Failed to fetch token info: ${l.status}`);let d=await l.json();if(d.code!==200)throw new Error(`Token info API error: ${d.code}`);return d},enabled:t,staleTime:1/0}),o=Yc(()=>{let i=new Map;if(!r?.data)return i;for(let s of r.data){let l=sa(s.chain_id,s.address);i.set(l,s.category)}return i},[r]),a=Yc(()=>{let i=new Map;if(!r?.data)return i;for(let s of r.data)i.set(sa(s.chain_id,s.address),s);return i},[r]);return{categoryMap:o,infoMap:a,...n}}import{useMemo as ob}from"react";import ab from"bignumber.js";function Zc(e,t,r){let{tokens:n,isLoading:o}=Dn(e,t,r),{statsMap:a}=Pn(e,r);return ob(()=>{let i=new ab(0);for(let c of n){let h=a.get(Ar(c.chainId,c.address));if(!h)continue;let u=ot(c.quantity.numeric),m=ot(h.price);if(!u||!m)continue;let y=u.shiftedBy(-c.quantity.decimals).multipliedBy(m);y.isNaN()||(i=i.plus(y))}let s=i.toFixed(),{displayValue:l,isLowerBound:d}=ac(s);return{totalUsd:s,displayValue:l,isLowerBound:d,isLoading:o}},[n,a,o])}import{QRCodeSVG as Ey}from"qrcode.react";import{WALLET_LABELS as My}from"@nexus-cross/crossx-design-system";import{WALLET_LABELS as lb}from"@nexus-cross/crossx-design-system";import{WALLET_LABELS as ul}from"@nexus-cross/crossx-design-system";import{jsx as De,jsxs as io}from"react/jsx-runtime";var ib='<svg width="100%" height="100%" viewBox="0 0 640 640" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_75048_28969)"><rect width="640" height="640" rx="100" fill="white"/><path d="M640.092 -0.18042H0.0917969V639.82H640.092V-0.18042Z" fill="#CE3E35"/><path d="M43.6074 104.484C43.6074 71.3473 70.4703 44.4844 103.607 44.4844H536.393C569.53 44.4844 596.393 71.3473 596.393 104.484V346.514H43.6074V104.484Z" fill="white"/><g filter="url(#filter0_d_75048_28969)"><path d="M639.908 639.822H0.0917969V158.676C0.0917969 136.585 18.0004 118.676 40.0918 118.676H218.544C237.426 118.676 252.868 132.846 264.251 147.912C277.196 165.045 297.355 176.058 319.999 176.058C342.644 176.058 362.803 165.045 375.748 147.912C387.131 132.846 402.573 118.676 421.455 118.676H599.908C622 118.676 639.908 136.585 639.908 158.676V639.822Z" fill="url(#paint0_linear_75048_28969)"/></g><path d="M223.621 639.503H639.909V181.499L223.621 448.166V639.503Z" fill="url(#paint1_linear_75048_28969)"/><path d="M223.645 639.819H0.0917969V212.869L223.645 449.197V639.819Z" fill="url(#paint2_linear_75048_28969)"/><g filter="url(#filter1_d_75048_28969)"><path d="M317.103 250.341L228.024 301.829C212.311 310.864 206.867 331.162 215.899 346.881C224.93 362.6 245.221 368.046 260.933 359.01L336.28 315.444L300.401 353.936V504.934C300.401 523.129 315.247 537.981 333.434 537.981C351.621 537.981 366.468 523.129 366.468 504.934V278.932C366.468 272.62 364.489 266.431 362.014 262.347C352.735 246.752 332.692 241.182 316.979 250.217L317.103 250.341Z" fill="white"/></g></g><defs><filter id="filter0_d_75048_28969" x="-19.9082" y="93.6763" width="679.816" height="561.146" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/><feOffset dy="-5"/><feGaussianBlur stdDeviation="10"/><feComposite in2="hardAlpha" operator="out"/><feColorMatrix type="matrix" values="0 0 0 0 0.892803 0 0 0 0 0.220099 0 0 0 0 0.293135 0 0 0 0.5 0"/><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_75048_28969"/><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_75048_28969" result="shape"/></filter><filter id="filter1_d_75048_28969" x="190.367" y="224.71" width="211.348" height="348.518" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/><feOffset dx="7.03953" dy="7.03953"/><feGaussianBlur stdDeviation="14.1039"/><feColorMatrix type="matrix" values="0 0 0 0 0.831373 0 0 0 0 0.113725 0 0 0 0 0.356863 0 0 0 0.3 0"/><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_75048_28969"/><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_75048_28969" result="shape"/></filter><linearGradient id="paint0_linear_75048_28969" x1="-74.0158" y1="54.6376" x2="542.251" y2="802.323" gradientUnits="userSpaceOnUse"><stop stop-color="#F3752D"/><stop offset="1" stop-color="#EC1272"/></linearGradient><linearGradient id="paint1_linear_75048_28969" x1="159.749" y1="206.729" x2="471.286" y2="474.513" gradientUnits="userSpaceOnUse"><stop stop-color="white" stop-opacity="0.5"/><stop offset="1" stop-color="white" stop-opacity="0"/></linearGradient><linearGradient id="paint2_linear_75048_28969" x1="399.134" y1="82.7297" x2="104.683" y2="466.123" gradientUnits="userSpaceOnUse"><stop stop-color="white" stop-opacity="0.5"/><stop offset="1" stop-color="white" stop-opacity="0"/></linearGradient><clipPath id="clip0_75048_28969"><rect width="640" height="640" rx="100" fill="white"/></clipPath></defs></svg>',sb=`data:image/svg+xml,${encodeURIComponent(ib)}`;function ki(){return De("img",{src:sb,width:40,height:40,alt:"",style:{display:"block"}})}function Xc(){return io("svg",{xmlns:"http://www.w3.org/2000/svg",width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",children:[io("g",{clipPath:"url(#clip0_1331_27065)",children:[De("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"}),De("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"}),De("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"}),De("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"}),De("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"}),De("path",{d:"M22.1857 36.1951V39.831H17.6699V36.1951H22.1857Z",fill:"#C0C4CD"}),De("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"})]}),De("defs",{children:De("clipPath",{id:"clip0_1331_27065",children:De("rect",{width:"40",height:"40",fill:"white"})})})]})}function Jc(){return io("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[De("path",{d:"M12.23 16.81L20 9.04L27.77 16.81L32.29 12.29L20 0L7.71 12.29L12.23 16.81Z",fill:"#F3BA2F"}),De("path",{d:"M9.04 20L4.52 15.48L0 20L4.52 24.52L9.04 20Z",fill:"#F3BA2F"}),De("path",{d:"M12.23 23.19L20 30.96L27.77 23.19L32.29 27.71L20 40L7.71 27.71L12.23 23.19Z",fill:"#F3BA2F"}),De("path",{d:"M35.48 24.52L40 20L35.48 15.48L30.96 20L35.48 24.52Z",fill:"#F3BA2F"}),De("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 $c(){return io("svg",{xmlns:"http://www.w3.org/2000/svg",width:"247",height:"246",viewBox:"0 0 247 246",fill:"none",children:[De("rect",{width:"247.005",height:"245.105",rx:"36",fill:"#121212"}),De("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"}),De("path",{d:"M59.8364 99.8915V59.7551H12.0414L30.4787 77.8377V99.8915H59.8364Z",fill:"#2FD7FF"}),De("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 ep(){return io("svg",{width:"40",height:"40",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[io("g",{clipPath:"url(#clip0_1185_7785)",children:[De("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"}),De("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"})]}),De("defs",{children:De("clipPath",{id:"clip0_1185_7785",children:De("rect",{width:"28",height:"28",fill:"white"})})})]})}function tp(){return io("svg",{width:"40",height:"40",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg",children:[De("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"}),De("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"}),De("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"}),De("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 rp(){return De("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:De("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 np(){return De("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:De("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}var la={cross_embedded:{id:"cross_embedded",name:ul.social,description:"Sign in with Google or Apple",icon:ki},cross_wallet:{id:"cross_wallet",name:ul.app,description:"App approval is required",icon:ki,featured:!0},cross_extension:{id:"cross_extension",name:ul.extension,description:"Browser extension approval is required",icon:ki,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:Xc,rdns:"io.metamask"},binance:{id:"binance",name:"Binance",description:"Mobile app only \u2014 Add CROSS network first",icon:Jc},verse8:{id:"verse8",name:"Verse8 Wallet",description:"Optimized for Forge and Verse8 ecosystem",icon:$c,badge:"For Forge"},tron:{id:"tron",name:"Tron Wallet",description:"Dedicated for Tron-based transactions and assets",icon:ep,badge:"For SHOP"}};function fl(e){return la[e]}var ml={google:{id:"google",name:"Google",icon:tp},apple:{id:"apple",name:"Apple",icon:rp}};function op(e){return ml[e]}var ap="dappui.wcm.last-selected",db=new Set(["google","apple"]);function ip(e){try{window.localStorage.setItem(ap,e)}catch{}}function sp(){let e=null;try{e=window.localStorage.getItem(ap)}catch{return}if(e)return db.has(e)?lb.default:la[e]?.name}function Pt(e,t,r,n){if(!n||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.defaultPrevented)return;e.preventDefault();let o;try{o=n(t,r)}catch(d){console.error("[dapp-ui] onOutlink threw:",d);return}let a=d=>{typeof window>"u"||window.open(d,"_blank","noopener,noreferrer")};if((d=>!!d&&(typeof d=="object"||typeof d=="function")&&typeof d.then=="function")(o)){let d=typeof window<"u"?window.open("","_blank","noopener,noreferrer"):null,c=h=>{if(h===null){d?.close();return}let u=h??t;if(d)try{d.location.href=u}catch{d.close(),a(u)}else a(u)};o.then(c,h=>{console.error("[dapp-ui] onOutlink rejected:",h),d?.close()});return}let s=o;if(s===null)return;a(s??t)}import*as co from"react";import{Drawer as iw}from"vaul";import{createContext as fb,useContext as mb,useMemo as gb}from"react";import Lr from"bignumber.js";var cb=/^(\d{4}-\d{2}-\d{2})/;function lp(e){if(!e||e.length===0)return;let t=new Map,r;for(let{key:o,cumulative:a}of e.map(i=>({key:cb.exec(i.reference_date)?.[1],cumulative:i.cumulative_earned})).filter(i=>!!i.key&&i.cumulative!=null).sort((i,s)=>i.key<s.key?-1:i.key>s.key?1:0))t.set(o,a),r=o;if(r===void 0)return;let n=new Date().toISOString().slice(0,10);return t.get(n)??t.get(r)}function dp(e){return e.poolType==="Unknown"}function Ri(e){return e.length<=12?e:`${e.slice(0,6)}...${e.slice(-4)}`}function Si(e){return e.length<=13?e:`${e.slice(0,6)}...${e.slice(-4)}`}function da(e,t){let r=e.length+t.length;if(r>32)return"xs";if(r>24)return"sm"}function gl(e){return e?.toUpperCase()==="WONE"?"ONE":e}var pb=["Request Arguments:","Details:","Docs:","Version:","Contract Call:"];function ca(e,t){console.error("[wallet-portfolio] withdraw failed:",e);let n=e instanceof Error?e.message:"";for(let a of pb){let i=n.indexOf(a);i>=0&&(n=n.slice(0,i))}return n.split(`
|
|
8
8
|
`).map(a=>a.trim()).find(a=>a.length>0)||t}var ub="0xe00e8bf3";function cp(e,t){let r=typeof e=="bigint"?e:BigInt(e);if(r<0n)throw new Error("poolId must be non-negative");if(t<0n)throw new Error("amount must be non-negative");let n=r.toString(16).padStart(64,"0"),o=t.toString(16).padStart(64,"0");return`${ub}${n}${o}`}function Do(e){return!e||e<=0n?"0":new Lr(e.toString()).shiftedBy(-9).toFormat(2,Lr.ROUND_DOWN).replace(/(\.\d*?[1-9])0+$/,"$1").replace(/\.0+$/,"")}function Ci(e){return!e||e<=0n?"0":new Lr(e.toString()).toFormat(0,Lr.ROUND_DOWN)}function Ni(e){if(!e||e<=0n)return"0";let t=new Lr(e.toString()).shiftedBy(-18),r=t.isLessThan(1e-4)?7:4;return t.toFormat(r,Lr.ROUND_DOWN).replace(/(\.\d*?[1-9])0+$/,"$1").replace(/\.0+$/,"")}function ln(e,t){let r=new Lr(e).shiftedBy(-t);return!r.isFinite()||r.isZero()?"0":r.isGreaterThanOrEqualTo(1)?r.toFormat(2,Lr.ROUND_DOWN):r.toFormat(4,Lr.ROUND_DOWN)}function hl(e){return ln(e,0)}var pa={rate:1,symbol:"$"};function so(e,t=pa){let r=Number.isFinite(t.rate)&&t.rate>0?t.rate:1;return`${t.symbol||"$"}${e.times(r).toFormat(2,Lr.ROUND_DOWN)}`}function On(e,t,r,n=pa){let o=new Lr(r||"0");if(!o.isFinite()||o.isLessThanOrEqualTo(0))return null;let a=new Lr(e||"0").shiftedBy(-t).times(o);return a.isFinite()?so(a,n):null}var ua=fb(null);function Rt(){let e=mb(ua);if(!e)throw new Error("WalletPortfolio compound components must be used within <WalletPortfolio>");return e}function Dr(){let{conversionRatio:e,currencySymbol:t}=Rt();return gb(()=>({rate:typeof e=="number"&&e>0?e:pa.rate,symbol:t||pa.symbol}),[e,t])}import{Drawer as hb}from"vaul";import{jsx as pp}from"react/jsx-runtime";function up({asChild:e,children:t}){let{walletAddress:r}=Rt(),n=t!=null,o=e??!0,a=n?t:pp("button",{type:"button",children:Xt(r)});return pp(hb.Trigger,{asChild:o,children:a})}import{Drawer as zi}from"vaul";import*as Ct from"react";import{useQueryClient as nw}from"@tanstack/react-query";import{createContext as bb,useContext as wb}from"react";var bl=bb(null);function fp(){return wb(bl)}import{jsx as ir,jsxs as Mi}from"react/jsx-runtime";function mp({size:e=22,className:t}){return ir("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:ir("path",{d:"M14 4L7 11L14 18",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function gp({size:e=22,className:t}){return Mi("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[ir("path",{d:"M18.333 3.667v5.5h-5.5",stroke:"currentColor",strokeWidth:1.833,strokeLinecap:"round",strokeLinejoin:"round"}),ir("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 hp({size:e=12,className:t}){return ir("svg",{width:e,height:e,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:ir("path",{d:"M6 11A5 5 0 106 1a5 5 0 000 10zM6 8V6M6 4h.005",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})})}function Ti({size:e=16,className:t}){return Mi("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[ir("path",{d:"M5.333 5.333V4a1.333 1.333 0 011.334-1.333h5.333A1.333 1.333 0 0113.333 4v5.333a1.333 1.333 0 01-1.333 1.334h-1.333",stroke:"currentColor",strokeWidth:1.333,strokeLinecap:"round",strokeLinejoin:"round"}),ir("path",{d:"M4 5.333h5.333c.737 0 1.334.597 1.334 1.334V12c0 .736-.597 1.333-1.334 1.333H4A1.333 1.333 0 012.667 12V6.667C2.667 5.93 3.263 5.333 4 5.333z",stroke:"currentColor",strokeWidth:1.333,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Ii({size:e=16,className:t}){return ir("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:ir("path",{d:"M13.333 4L6 11.333 2.667 8",stroke:"currentColor",strokeWidth:1.667,strokeLinecap:"round",strokeLinejoin:"round"})})}function Ei({size:e=48,className:t}){return Mi("svg",{width:e,height:e,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[ir("circle",{cx:"24",cy:"24",r:"24",fill:"currentColor"}),ir("path",{d:"M14 24.5l6.6 6.6L34.5 17.5",stroke:"var(--wp-claim-success-mark, #ffffff)",strokeWidth:4,strokeLinecap:"round",strokeLinejoin:"round"})]})}function kr({size:e=12,className:t}){return Mi("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:[ir("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"}),ir("path",{d:"M7 1H11V5",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"}),ir("path",{d:"M11 1L6 6",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"})]})}import{useQuery as yb}from"@tanstack/react-query";import{useMemo as bp}from"react";var xb="wp:reward-pools";function Po(e,t=!0){let{data:r,...n}=yb({queryKey:[xb,e],queryFn:async({signal:i})=>{let s=await Ne("gameReward",e),l=await fetch(`${s}/v1/pools`,{cache:"no-store",signal:i});if(!l.ok)throw new Error(`Failed to fetch pools: ${l.status}`);let d=await l.json();if(d.code!==200)throw new Error(`Pools API error: ${d.code}`);return d},enabled:t,staleTime:0}),o=bp(()=>r?.data.pools.filter(i=>i.pool_type==="CrossPool")??[],[r]),a=bp(()=>r?.data.pools.filter(i=>i.pool_type==="GamePool")??[],[r]);return{crossPools:o,gamePools:a,allPools:r?.data.pools??[],...n}}import{useQuery as vb}from"@tanstack/react-query";import{useMemo as kb}from"react";var Rb="wp:user-deposits";function Ai(e,t,r=!0){let n=r&&!!t,{data:o,...a}=vb({queryKey:[Rb,e,t],queryFn:async({signal:s})=>{let l=await Ne("gameReward",e),d=await fetch(`${l}/v1/users/${t}/deposits`,{cache:"no-store",signal:s});if(!d.ok)throw new Error(`Deposits fetch failed: ${d.status}`);let c=await d.json();if(c.code!==200)throw new Error(`Deposits API error: ${c.code}`);return c},enabled:n,staleTime:0});return{depositMap:kb(()=>{let s=new Map;if(!o?.data.user_deposits)return s;for(let l of o.data.user_deposits)s.set(l.pool_address.toLowerCase(),l);return s},[o]),deposits:o?.data.user_deposits??[],...a}}import{useQuery as Sb}from"@tanstack/react-query";import{useMemo as Cb}from"react";var wp={dev:"https://stg.onechain.nexus",stage:"https://stg.onechain.nexus",production:"https://onechain.nexus"},yp={dev:"https://stg.onechain.nexus/points",stage:"https://stg.onechain.nexus/points",production:"https://www.onechain.nexus/points"};var xp={dev:"https://stg.onechain.nexus",stage:"https://stg.onechain.nexus",production:"https://onechain.nexus"};var wl={dev:"https://dev-stake.ogfcorp.com",stage:"https://stg-stake.ogfcorp.com",production:"https://stake.ogfcorp.com"},vp={dev:`${wl.dev}/portfolio`,stage:`${wl.stage}/portfolio`,production:`${wl.production}/portfolio`};var kp={dev:"https://stg.onechain.nexus",stage:"https://stg.onechain.nexus",production:"https://onechain.nexus"},Pr={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"},Li={dev:"https://stg-swap-api.crossdefi.io",stage:"https://stg-swap-api.crossdefi.io",production:"https://swap-api.crossdefi.io"},Rp={dev:"https://stg.crossdefi.io",stage:"https://stg.crossdefi.io",production:"https://www.crossdefi.io"},Sp={dev:"0x1Fa8C0bc5B754E82d55D60f0d6151903FD995b1B",stage:"0x1Fa8C0bc5B754E82d55D60f0d6151903FD995b1B",production:"0xEFd871aF7D695A0c1709e46b565761F4cd1Ef5ba"},Cp={dev:"0xda37a3B60E6b97E8CB44b460130d40331efc566b",stage:"0xda37a3B60E6b97E8CB44b460130d40331efc566b",production:"0x731a104a4461ae45bfef520468b43c262d35e682"};var Nb="wp:token-info",Tb="0x0000000000000000000000000000000000000001";function dn(e,t=!0){let r=vt[e].cross,{data:n,...o}=Sb({queryKey:[Nb,e],queryFn:async({signal:c})=>{let h=await Ne("walletServer",e),u=await fetch(`${h}/v1/public/token/info`,{cache:"no-store",signal:c});if(!u.ok)throw new Error(`Failed to fetch token info: ${u.status}`);let m=await u.json();if(m.code!==200)throw new Error(`Token info API error: ${m.code}`);return m},enabled:t,staleTime:300*1e3}),{byChainAddr:a,byChainSym:i}=Cb(()=>{let c=new Map,h=new Map;if(!n?.data)return{byChainAddr:c,byChainSym:h};for(let u of n.data){let m=u.address.toLowerCase();c.set(`${u.chain_id}:${m}`,u),c.set(m,u);let y=u.symbol.replace(/^t/,"").toUpperCase(),b=`${u.chain_id}:${y}`;h.has(b)||h.set(b,u),h.has(y)||h.set(y,u)}return{byChainAddr:c,byChainSym:h}},[n]);return{getTokenImage:(c,h,u)=>{let m=c.toLowerCase(),y=!!u?.chainOnly,b=a.get(`${r}:${m}`);if(b?.image)return b.image;if(!y){let f=a.get(m);if(f?.image)return f.image}if(h){let f=h.replace(/^t/,"").toUpperCase(),p=i.get(`${r}:${f}`);if(p?.image)return p.image;if(!y){let w=i.get(f);if(w?.image)return w.image}}return""},getTokenSymbol:(c,h,u)=>{let m=c.toLowerCase();return(a.get(`${r}:${m}`)??(u?.chainOnly?void 0:a.get(m)))?.symbol||h},getNativeToken:()=>a.get(`${r}:${Tb}`),...o}}import*as xl from"react";import{jsx as yl,jsxs as Np}from"react/jsx-runtime";function Or({sectionKey:e,title:t,icon:r,iconFit:n="cover",isEmpty:o,loading:a=!1,children:i}){let s=fp();return xl.useEffect(()=>{s?.report(e,{loading:a,empty:o})},[s,e,a,o]),xl.useEffect(()=>()=>s?.unregister(e),[s,e]),o?null:Np("div",{className:"wp-svc-card",children:[Np("div",{className:"wp-svc-card-head",children:[yl("img",{className:"wp-svc-card-icon",src:r,alt:"",style:{objectFit:n}}),yl("span",{className:"wp-svc-card-title",children:t})]}),yl("div",{className:"wp-svc-items",children:i})]})}import vl from"bignumber.js";import{jsx as Jt,jsxs as sr}from"react/jsx-runtime";var Ib="ONErewards";function Eb(e){return new vl(e||"0").isGreaterThan(0)}function Tp(){let{env:e,walletAddress:t,onOutlink:r}=Rt(),n=Dr(),o=!!t,{allPools:a,isLoading:i}=Po(e,o),{depositMap:s,isLoading:l}=Ai(e,t,o),{getTokenImage:d}=dn(e,o),c=(m,y)=>`${wp[e]}/gametoken/tokens/${m.deposit_token.address}?mode=rewards${y==="withdraw"?"&trade=withdraw":""}`,h=`${Pr[e]}/reward.png`,u=a.filter(m=>{let y=s.get(m.pool_address.toLowerCase()),b=y?.deposited_amount??"0",f=y?.claimable_reward??"0";return!(new vl(b).isZero()&&new vl(f).isZero())});return Jt(Or,{sectionKey:"rewards",title:Ib,icon:h,isEmpty:u.length===0,loading:i||l,children:u.map(m=>{let y=s.get(m.pool_address.toLowerCase()),b=y?.deposited_amount??"0",f=y?.claimable_reward??"0",p=c(m,"withdraw"),w=c(m,"claim"),g=d(m.deposit_token.address,m.deposit_token.symbol),x=m.reward_tokens[0],k=x?d(x.address,x.symbol):"",R=m.reward_tokens.map(L=>L.symbol),E=R.length>0?`${m.deposit_token.symbol}-${R.join("/")}`:m.deposit_token.symbol,S=x?ln(f,x.decimals):"0",C=x?.symbol??"Reward",I=On(b,m.deposit_token.decimals,m.deposit_token.price,n),M=x?On(f,x.decimals,x.price,n):null,F=!!y&&Eb(f);return sr("article",{className:"wp-item","data-side":"reward",children:[sr("div",{className:"wp-item-body",children:[sr("div",{className:"wp-item-line",children:[Jt("span",{className:"wp-item-label",children:"Pool (Deposit - Earn)"}),sr("div",{className:"wp-svc-token",children:[sr("span",{className:"wp-token-stack","aria-hidden":!0,children:[g&&Jt("img",{className:"wp-svc-token-icon",src:g,alt:""}),k&&Jt("img",{className:"wp-svc-token-icon",src:k,alt:""})]}),Jt("span",{children:E})]})]}),sr("div",{className:"wp-item-line",children:[Jt("span",{className:"wp-item-label",children:"Deposited"}),sr("div",{className:"wp-svc-token wp-svc-token--amount",children:[g&&Jt("img",{className:"wp-svc-token-icon",src:g,alt:""}),sr("div",{className:"wp-svc-amount",children:[Jt("span",{className:"wp-svc-amount-main",children:ln(b,m.deposit_token.decimals)}),I&&Jt("span",{className:"wp-item-usd",children:I})]})]})]}),sr("div",{className:"wp-item-line",children:[sr("span",{className:"wp-item-label",children:["Claimable (",C,")"]}),sr("div",{className:"wp-svc-token wp-svc-token--amount",children:[k&&Jt("img",{className:"wp-svc-token-icon",src:k,alt:""}),sr("div",{className:"wp-svc-amount",children:[Jt("span",{className:"wp-svc-amount-main",children:S}),M&&Jt("span",{className:"wp-item-usd",children:M})]})]})]})]}),sr("div",{className:"wp-item-tags",children:[sr("a",{className:"wp-tag wp-tag--muted",href:p,target:"_blank",rel:"noopener noreferrer","data-track":"rewards_withdraw_open",onClick:L=>Pt(L,p,{category:"portfolio",origin:"portfolio-rewards",payload:{pool:m,userDeposit:y}},r),children:[Jt("span",{className:"wp-tag-label",children:"Withdraw"}),Jt(kr,{size:12,className:"wp-tag-icon"})]}),sr("a",{className:"wp-tag wp-tag--mint","data-disabled":!F||void 0,"aria-disabled":!F||void 0,href:F?w:void 0,target:F?"_blank":void 0,rel:F?"noopener noreferrer":void 0,onClick:L=>{if(!F){L.preventDefault();return}Pt(L,w,{category:"portfolio",origin:"portfolio-rewards",payload:{pool:m,userDeposit:y}},r)},children:[Jt("span",{className:"wp-tag-label",children:"Claim"}),Jt(kr,{size:12,className:"wp-tag-icon"})]})]})]},m.pool_address)})})}import*as Op from"react";import{useQuery as zb}from"@tanstack/react-query";import{useMemo as Di}from"react";var Mb="0x70a08231",Ab="0x18160ddd",Lb="0x313ce567",Db=8e3;async function Pb(e,t,r,n){let o=new AbortController,a=setTimeout(()=>o.abort(),Db);n&&n.addEventListener("abort",()=>o.abort(),{once:!0});let i=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:t,params:r}),signal:o.signal}).finally(()=>clearTimeout(a));if(!i.ok)throw new Error(`RPC ${t} HTTP ${i.status}`);let s=await i.json();if(s.error)throw new Error(`RPC ${t}: ${s.error.message}`);if(s.result===void 0)throw new Error(`RPC ${t}: empty result`);return s.result}function Ob(e){return e.toLowerCase().replace(/^0x/,"").padStart(64,"0")}function fa(e){if(!(!e||e==="0x"))try{return BigInt(e)}catch{return}}async function wn(e,t,r,n,o){try{return await Pb(e,"eth_call",[o?{from:o,to:t,data:r}:{to:t,data:r},"latest"],n)}catch{return}}async function Bb(e,t,r,n){let[o,a,i]=await Promise.all([wn(e,r,Mb+Ob(t),n),wn(e,r,Ab,n),wn(e,r,Lb,n)]),s=fa(o);if(s===void 0)return null;let l=fa(i);return{balance:s,totalSupply:fa(a),decimals:l!==void 0?Number(l):void 0}}async function ma(e,t){let r=vt[e].cross,n=await Ne("walletServer",e),o=await fetch(`${n}/v1/public/chain/info/${r}`,{cache:"no-store",signal:t});if(!o.ok)return;let a=await o.json();return("data"in a&&a.data!==void 0?Array.isArray(a.data)?a.data[0]:a.data:a)?.rpc||void 0}async function Ip(e,t,r,n){if(!t||r.length===0)return{};let o;try{o=await ma(e,n)}catch{o=void 0}if(!o)return{};let a=await Promise.all(r.map(async s=>[s.toLowerCase(),await Bb(o,t,s,n)])),i={};for(let[s,l]of a)l&&(i[s]=l);return i}var Fb="wp:withdraw-token-meta",Ub="0xc89039c5",jb="0x95d89b41",Wb="0x313ce567";function Gb(e){if(!(!e||e==="0x"))try{let t=e.replace(/^0x/,""),r=Number(BigInt("0x"+t.slice(64,128)));if(!Number.isFinite(r)||r<=0||r>64)return;let n=t.slice(128,128+r*2),o="";for(let a=0;a<n.length;a+=2)o+=String.fromCharCode(parseInt(n.slice(a,a+2),16));return o||void 0}catch{return}}function _b(e){if(!e||e==="0x")return;let r="0x"+e.replace(/^0x/,"").padStart(64,"0").slice(24,64);return/^0x[a-f0-9]{40}$/.test(r)&&r!=="0x0000000000000000000000000000000000000000"?r:void 0}async function Hb(e,t,r){if(t.length===0)return{};let n;try{n=await ma(e,r)}catch{n=void 0}if(!n)return{};let o=await Promise.all(t.map(async i=>{let s=_b(await wn(n,i,Ub,r));if(!s)return[i.toLowerCase(),null];let[l,d]=await Promise.all([wn(n,s,jb,r),wn(n,s,Wb,r)]),c=Gb(l),h=fa(d);return c?[i.toLowerCase(),{tokenAddress:s,symbol:c,decimals:h!==void 0?Number(h):18}]:[i.toLowerCase(),null]})),a={};for(let[i,s]of o)s&&(a[i]=s);return a}function Ep(e,t,r=!0){let o=r&&!!t,{allPools:a,isLoading:i}=Po(e,o),{deposits:s,isLoading:l}=Ai(e,t,o),d=Di(()=>{let f=new Map;for(let p of a)f.set(p.pool_address.toLowerCase(),p);return f},[a]),c=Di(()=>s.filter(f=>{try{return BigInt(f.deposited_amount||"0")>0n}catch{return!1}}),[s]),h=Di(()=>c.map(f=>f.pool_address.toLowerCase()).filter(f=>!d.has(f)).sort(),[c,d]),{data:u,isLoading:m}=zb({queryKey:[Fb,e,h],queryFn:({signal:f})=>Hb(e,h,f),enabled:o&&h.length>0,staleTime:1440*60*1e3});return{positions:Di(()=>{let f=[];for(let p of c){let w=p.pool_address.toLowerCase(),g=d.get(w);if(g){f.push({poolId:p.pool_id,poolAddress:p.pool_address,poolType:g.pool_type,tokenSymbol:g.deposit_token.symbol,tokenAddress:g.deposit_token.address,decimals:g.deposit_token.decimals,price:g.deposit_token.price,depositedRaw:p.deposited_amount});continue}let x=u?.[w];x&&f.push({poolId:p.pool_id,poolAddress:p.pool_address,poolType:"Unknown",tokenSymbol:x.symbol,tokenAddress:x.tokenAddress,decimals:x.decimals,depositedRaw:p.deposited_amount})}return f},[c,d,u]),isLoading:i||l||m}}import*as _t from"react";import{Fragment as Mp,jsx as Te,jsxs as It}from"react/jsx-runtime";var Qb=400;function Vb(e,t,r){if(t==="loading")return"Estimating...";if(!e||t==="error"||t==="unavailable")return"Wallet estimate";let n=e.maxFeePerGas??e.gasPrice;return!n||n<=0n||e.gasLimit<=0n?"Wallet estimate":`${Ni(e.gasLimit*n)} ${r??""}`.trim()}function kl(e,t,r){return r==="loading"?"Estimating...":r==="error"||r==="unavailable"?"-":`${e} ${t}`.trim()}function qb({position:e,size:t}){return e.icon?Te("img",{src:e.icon,alt:"",width:t,height:t}):Te("span",{children:e.tokenSymbol.slice(0,1)})}function Ap({open:e,status:t,positions:r,initialPoolAddress:n,walletAddress:o,txHash:a,error:i,copied:s=!1,estimateWithdraw:l,onClose:d,onConfirm:c,onCopyHash:h,trackFunnel:u,nativeSymbol:m}){let[y,b]=_t.useState(null),[f,p]=_t.useState("idle"),w=_t.useRef(0),g=_t.useRef(void 0),x=_t.useRef(null);_t.useEffect(()=>()=>clearTimeout(g.current),[]);let k=_t.useMemo(()=>{let U=n?.toLowerCase();return r.find(A=>A.poolAddress.toLowerCase()===U)??r[0]??null},[r,n]),R=_t.useMemo(()=>{try{return BigInt(k?.depositedRaw??"0")}catch{return 0n}},[k?.depositedRaw]),E=k?.decimals??18;_t.useEffect(()=>{!e||!k||u?.("position_selected")},[e,k,u]);let S=_t.useCallback(()=>{b(null),p(l?"idle":"unavailable"),w.current+=1,x.current=null},[]);if(_t.useEffect(()=>{e&&S()},[e,S]),_t.useEffect(()=>{if(!e||t!=="confirm"){clearTimeout(g.current);return}if(!l||!k){clearTimeout(g.current),p("unavailable");return}if(R<=0n){clearTimeout(g.current),w.current+=1,x.current=null,b(null),p("idle");return}let U=`${k.poolAddress.toLowerCase()}:${R.toString()}`;if(x.current===U)return;x.current=U,clearTimeout(g.current);let A=w.current+1;w.current=A,p("loading"),g.current=setTimeout(()=>{l(k,R).then(O=>{w.current===A&&(b(O??null),p(O?"ready":"unavailable"))}).catch(()=>{w.current===A&&(b(null),p("error"))})},Qb)},[e,t,R,l,k]),!e||!k)return null;let C=t==="submitting",I=Do(y?.maxPriorityFeePerGas),M=Do(y?.maxFeePerGas??y?.gasPrice),F=Ci(y?.gasLimit),L=ln(k.depositedRaw,E);return Te("div",{className:"wp-claim-overlay",role:"presentation",onMouseDown:U=>{U.target===U.currentTarget&&!C&&d()},children:It("section",{className:"wp-claim-sheet",role:"dialog","aria-modal":"true","aria-labelledby":"wp-withdraw-title","aria-label":"Withdraw","data-status":t,"data-vaul-no-drag":!0,children:[Te("div",{className:"wp-claim-grabber","aria-hidden":!0,children:Te("span",{})}),It("div",{className:"wp-claim-content wp-withdraw-content",children:[t==="success"&&a?It(Mp,{children:[Te("span",{className:"wp-claim-icon wp-claim-icon--success","aria-hidden":!0,children:Te(Ei,{})}),It("div",{className:"wp-claim-copy",children:[Te("h3",{id:"wp-withdraw-title",className:"wp-claim-title",children:"Withdraw Submitted!"}),Te("p",{className:"wp-claim-desc",children:"Your withdrawal request has been submitted. Balances will update shortly after the transaction settles."})]}),Te("div",{className:"wp-claim-list","aria-label":"Withdraw transaction",children:It("div",{className:"wp-claim-list-item",children:[Te("span",{children:"Tx Hash"}),It("button",{type:"button",className:"wp-claim-hash",onClick:h,"aria-label":"Copy transaction hash","data-track":"withdraw_hash_copy",children:[Te("strong",{children:Si(a)}),s?Te(Ii,{}):Te(Ti,{})]})]})})]}):It(Mp,{children:[t==="error"&&It("div",{className:"wp-claim-heading",children:[Te("h3",{id:"wp-withdraw-title",className:"wp-claim-title",children:"Withdraw Failed"}),Te("p",{className:"wp-claim-error-message",children:i||"The withdraw request could not be completed."})]}),It("div",{className:"wp-claim-reward-card","data-fit":da(k.tokenSymbol,L),"aria-label":"Deposited balance",children:[Te("span",{className:"wp-claim-reward-token","aria-hidden":!0,children:Te(qb,{position:k,size:28})}),Te("strong",{className:"wp-claim-reward-symbol",children:k.tokenSymbol}),Te("strong",{className:"wp-claim-reward-amount",children:L})]}),It("div",{className:"wp-claim-account-card","aria-label":"Withdraw gas fee",children:[It("div",{className:"wp-claim-account-row",children:[It("div",{className:"wp-claim-account",children:[Te("span",{className:"wp-claim-account-avatar","aria-hidden":!0}),It("strong",{children:[k.tokenSymbol," Pool"]})]}),Te("span",{children:Ri(o)})]}),Te("span",{className:"wp-claim-divider","aria-hidden":!0}),It("div",{className:"wp-claim-detail-list",children:[It("div",{className:"wp-claim-detail-row",children:[Te("span",{children:"Est. Tx Fee"}),Te("strong",{children:Vb(y,f,m)})]}),It("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[Te("span",{children:"Priority Fee Per Gas"}),Te("strong",{children:kl(I,"Gwei",f)})]}),It("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[Te("span",{children:"Max Fee Per Gas"}),Te("strong",{children:kl(M,"Gwei",f)})]}),It("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[Te("span",{children:"Gas Limit"}),Te("strong",{children:kl(F,"",f)})]})]})]})]}),It("div",{className:"wp-claim-actions","data-count":t==="confirm"||t==="error"?2:1,children:[(t==="confirm"||t==="error")&&Te("button",{type:"button",className:"wp-claim-secondary","data-track":"withdraw_cancel",onClick:d,children:t==="error"?"Close":"Cancel"}),It("button",{type:"button",className:"wp-claim-primary","data-track":"withdraw_confirm",onClick:()=>{if(t==="success"){d();return}k&&R>0n&&c(k,R,y)},disabled:C||(t==="confirm"||t==="error")&&R<=0n,children:[t==="success"&&"Done",t==="submitting"&&Te("span",{className:"wp-claim-button-spinner","aria-label":"Waiting"}),t==="error"&&"Try Again",t==="confirm"&&"Withdraw Now"]})]})]}),Te("div",{className:"wp-claim-home-indicator","aria-hidden":!0,children:Te("span",{})})]})})}import*as St from"react";import{useQueryClient as Zb}from"@tanstack/react-query";import{useQuery as Yb}from"@tanstack/react-query";var Kb="wp:reward-factory-info";function Lp(e,t=!0){let{data:r,...n}=Yb({queryKey:[Kb,e],queryFn:async({signal:o})=>{let a=await Ne("gameReward",e),i=await fetch(`${a}/v1/factory/info`,{cache:"no-store",signal:o});if(!i.ok)throw new Error(`Factory info fetch failed: ${i.status}`);let s=await i.json();if(s.code!==200)throw new Error(`Factory info API error: ${s.code}`);return s},enabled:t,staleTime:0});return{factoryInfo:r?.data??null,routerAddress:r?.data.router_address??"",...n}}var Xb="wp:";function Dp(e){return/^0x[a-fA-F0-9]{40}$/.test(e)?e:null}function Pp(e){let{env:t,walletAddress:r,sendTransaction:n,estimateGas:o}=Rt(),a=!!r,i=!!n,s=Zb(),{routerAddress:l}=Lp(t,a&&i),d=Dp(l),[c,h]=St.useState(!1),[u,m]=St.useState(void 0),[y,b]=St.useState("confirm"),[f,p]=St.useState(),[w,g]=St.useState(""),[x,k]=St.useState(!1),R=St.useRef(void 0);St.useEffect(()=>()=>clearTimeout(R.current),[]);let E=St.useRef(new Set),S=St.useCallback((O,te)=>{E.current.has(O)||(E.current.add(O),He("withdraw",O,{...te,tags:{section:e,...te?.tags}}))},[e]),C=St.useCallback((O,te)=>d?{to:d,value:0n,data:cp(O,te),chainId:vt[t].cross}:null,[t,d]),I=St.useCallback(()=>{s.invalidateQueries({predicate:O=>typeof O.queryKey[0]=="string"&&O.queryKey[0].startsWith(Xb)})},[s]),M=St.useCallback(O=>{m(O),h(!0),b("confirm"),p(void 0),g(""),k(!1),E.current=new Set,S("opened")},[S]),F=St.useCallback(()=>{y!=="submitting"&&(h(!1),m(void 0),b("confirm"),p(void 0),g(""),k(!1),y==="success"&&I())},[y,I]),L=St.useCallback(async(O,te)=>{if(!o)return null;let Y=C(O.poolId,te),G=Dp(r);return!Y||!G?null:o({...Y,from:G})},[C,o,r]),U=St.useCallback(async()=>{if(!(!f||typeof navigator>"u"||!navigator.clipboard))try{await navigator.clipboard.writeText(f),k(!0),clearTimeout(R.current),R.current=setTimeout(()=>k(!1),1400)}catch{k(!1)}},[f]),A=St.useCallback(async(O,te,Y)=>{if(!n){b("error"),g("Withdraw is not available for this wallet.");return}if(!d){b("error"),g("Withdraw contract address is not available.");return}try{b("submitting"),g("");let G=C(O.poolId,te);if(!G){b("error"),g("Withdraw contract address is not available.");return}S("submitted");let H=await n({...G,gas:Y?.gasLimit&&Y.gasLimit>0n?Y.gasLimit:void 0,maxFeePerGas:Y?.maxFeePerGas&&Y.maxFeePerGas>0n?Y.maxFeePerGas:void 0,maxPriorityFeePerGas:Y?.maxPriorityFeePerGas&&Y.maxPriorityFeePerGas>0n?Y.maxPriorityFeePerGas:void 0});p(H),b("success"),S("confirmed"),I()}catch(G){b("error"),g(ca(G,"Failed to request withdraw.")),S("confirmed",{status:"failure",reason:xr(G)})}},[C,I,d,n,S]);return{canWithdrawInline:i,isOpen:c,initialPoolAddress:u,status:y,txHash:f,error:w,copied:x,hasEstimator:!!o,openWithdraw:M,closeWithdraw:F,estimateWithdraw:L,confirmWithdraw:A,copyHash:U,trackFunnelOnce:S}}import{Fragment as $b,jsx as fr,jsxs as yn}from"react/jsx-runtime";var Jb="ONEpoints";function Bp(){let{env:e,walletAddress:t,onOutlink:r}=Rt(),n=Dr(),o=!!t,{getTokenImage:a,getNativeToken:i}=dn(e,o),s=Pp("points"),{positions:l,isLoading:d}=Ep(e,t,o),c=Op.useMemo(()=>l.filter(dp).map(m=>({...m,icon:a(m.tokenAddress,m.tokenSymbol)})),[l,a]),h=`${Pr[e]}/point.png`,u=yp[e];return yn($b,{children:[fr(Or,{sectionKey:"points",title:Jb,icon:h,isEmpty:c.length===0,loading:d,children:c.map(m=>{let y=m.price?On(m.depositedRaw,m.decimals,m.price,n):null;return yn("article",{className:"wp-item","data-side":"reward",children:[yn("div",{className:"wp-item-body",children:[yn("div",{className:"wp-item-line",children:[fr("span",{className:"wp-item-label",children:"Token"}),yn("div",{className:"wp-svc-token",children:[m.icon&&fr("img",{className:"wp-svc-token-icon",src:m.icon,alt:""}),fr("span",{children:m.tokenSymbol})]})]}),yn("div",{className:"wp-item-line",children:[fr("span",{className:"wp-item-label",children:"Deposited"}),yn("div",{className:"wp-svc-token wp-svc-token--amount",children:[m.icon&&fr("img",{className:"wp-svc-token-icon",src:m.icon,alt:""}),yn("div",{className:"wp-svc-amount",children:[fr("span",{className:"wp-svc-amount-main",children:ln(m.depositedRaw,m.decimals)}),y&&fr("span",{className:"wp-item-usd",children:y})]})]})]})]}),fr("div",{className:"wp-item-tags",children:s.canWithdrawInline?fr("button",{type:"button",className:"wp-tag wp-tag--muted","data-track":"points_withdraw_open",onClick:()=>s.openWithdraw(m.poolAddress),children:fr("span",{className:"wp-tag-label",children:"Withdraw"})}):yn("a",{className:"wp-tag wp-tag--muted",href:u,target:"_blank",rel:"noopener noreferrer","data-track":"points_withdraw_open",onClick:b=>Pt(b,u,{category:"portfolio",origin:"portfolio-points",payload:{position:m}},r),children:[fr("span",{className:"wp-tag-label",children:"Withdraw"}),fr(kr,{size:12,className:"wp-tag-icon"})]})})]},m.poolAddress)})}),fr(Ap,{open:s.isOpen,status:s.status,positions:c,initialPoolAddress:s.initialPoolAddress,walletAddress:t,txHash:s.txHash,error:s.error,copied:s.copied,estimateWithdraw:s.hasEstimator?s.estimateWithdraw:void 0,onClose:s.closeWithdraw,onConfirm:s.confirmWithdraw,onCopyHash:s.copyHash,trackFunnel:s.trackFunnelOnce,nativeSymbol:i()?.symbol})]})}import*as Rl from"react";import{useQuery as e0}from"@tanstack/react-query";var t0="wp:stake-info";function zp(e,t,r=!0){let n=r&&!!t,{data:o,...a}=e0({queryKey:[t0,e,t],queryFn:async({signal:s})=>{let l=await Ne("posa",e),d=await fetch(`${l}/stake/${t}`,{cache:"no-store",signal:s});if(!d.ok)throw new Error(`Stake info fetch failed: ${d.status}`);let c=await d.json();if(c.code!==0&&c.code!==200)throw new Error(`Stake info API error: ${c.code}`);return c},enabled:n,staleTime:0});return{stakeInfo:o?.data,...a}}import{useQuery as r0}from"@tanstack/react-query";var n0="wp:stake-rewards",o0=31;function Fp(e,t,r=!0){let n=r&&!!t,{data:o,...a}=r0({queryKey:[n0,e,t],queryFn:async({signal:i})=>{let s=await Ne("posa",e),l=await fetch(`${s}/rewards/${t}?limit=${o0}`,{cache:"no-store",signal:i});if(!l.ok)throw new Error(`Stake rewards fetch failed: ${l.status}`);let d=await l.json();if(d.code!==0&&d.code!==200)throw new Error(`Stake rewards API error: ${d.code}`);return d.data?.data??[]},enabled:n,staleTime:0});return{latestReward:o?.[0]??null,aprAccrued:lp(o),...a}}import{useQuery as a0}from"@tanstack/react-query";var i0="wp:staking-onchain";function Up(e,t,r=!0){let n=r&&!!t&&!!e,{data:o,...a}=a0({queryKey:[i0,e],queryFn:async()=>{if(!t)throw new Error("stakingRewardsReader not provided");return t(e)},enabled:n,staleTime:0});return{onchain:o,...a}}import{useMemo as jp}from"react";import s0 from"bignumber.js";function Wp(e){return e?.trim().toUpperCase()==="ONE"}function Gp(e){return new s0(e||"0").isGreaterThan(0)}function Pi(e,t,r=!0){let{allPools:n}=Po(e,r),o=jp(()=>{for(let d of n)for(let c of[d.deposit_token,...d.reward_tokens])if(Wp(c?.symbol)&&Gp(c.price))return c.price},[n]),a=r&&o===void 0,{tokens:i}=Dn(e,t,a),{statsMap:s}=Pn(e,a),l=vt[e].cross;return jp(()=>{if(o)return o;let d=i.find(c=>c.chainId===l&&Wp(c.symbol));if(d){let c=s.get(Ar(d.chainId,d.address));if(c&&Gp(c.price))return c.price}return"0"},[o,i,s,l])}import zn from"bignumber.js";import{jsx as Br,jsxs as Bn}from"react/jsx-runtime";function l0(e){if(!e)return"\u2014";let t=new zn(e);return t.isFinite()?`${t.toFormat(2,zn.ROUND_DOWN)}%`:"\u2014"}function _p(){let{env:e,walletAddress:t,onOutlink:r,stakingRewardsReader:n}=Rt(),o=Dr(),a=!!t,{stakeInfo:i,isLoading:s}=zp(e,t,a),{latestReward:l,aprAccrued:d,isLoading:c}=Fp(e,t,a),{onchain:h}=Up(t,n,a),u=Pi(e,t,a),{getNativeToken:m}=dn(e,a),y=m()?.symbol,b="ONEstaking",f=`${Pr[e]}/cross-staking.png`,p=vp[e],w=i?.total_stake??"0",g=Rl.useMemo(()=>h?new zn(h.earnedWei.toString()).shiftedBy(-18).toString(10):l?.cumulative_earned??i?.rewards_earned??"0",[h,l,i]),x=Rl.useMemo(()=>h?new zn(h.stakedWei.toString()).shiftedBy(-18):new zn(w),[h,w]),k=d!==void 0?new zn(d):void 0,R=i?.days_since_first_stake,E=k!==void 0&&k.isFinite()&&x.isGreaterThan(0)&&R!==null&&R!==void 0?k.div(x).times(365).div(Math.max(1,R)).times(100):void 0,S=!(new zn(w).isZero()&&new zn(g).isZero()),C=On(w,0,u,o),I=On(g,0,u,o);return Br(Or,{sectionKey:"staking",title:b,icon:f,iconFit:"contain",isEmpty:!S,loading:s||c,children:Bn("article",{className:"wp-item","data-side":"stake",children:[Bn("div",{className:"wp-item-body",children:[Bn("div",{className:"wp-item-line",children:[Br("span",{className:"wp-item-label",children:"Staked"}),Bn("div",{className:"wp-svc-amount",children:[Br("span",{className:"wp-svc-amount-main",children:`${hl(w)} ${y??""}`.trim()}),C&&Br("span",{className:"wp-item-usd",children:C})]})]}),Bn("div",{className:"wp-item-line",children:[Br("span",{className:"wp-item-label",children:"Rewards Earned"}),Bn("div",{className:"wp-svc-amount",children:[Br("span",{className:"wp-svc-amount-main",children:`${hl(g)} ${y??""}`.trim()}),I&&Br("span",{className:"wp-item-usd",children:I})]})]}),Bn("div",{className:"wp-item-line",children:[Br("span",{className:"wp-item-label",children:"My APR"}),Br("span",{children:l0(E?.toString(10))})]})]}),Br("div",{className:"wp-item-tags",children:Bn("a",{className:"wp-tag wp-tag--mint",href:p,target:"_blank",rel:"noopener noreferrer","data-track":"stake_outlink",onClick:M=>Pt(M,p,{category:"portfolio",origin:"portfolio-stake",payload:{stakeInfo:i}},r),children:[Br("span",{className:"wp-tag-label",children:"Manage"}),Br(kr,{size:12,className:"wp-tag-icon"})]})})]})})}import*as Sl from"react";import{useQuery as d0}from"@tanstack/react-query";var c0="wp:game-swap-pools";function Hp(e,t,r=!0){let n=r&&!!t,{data:o,...a}=d0({queryKey:[c0,e,t],queryFn:async({signal:i})=>{let s=await Ne("gameSwap",e),l=await fetch(`${s}/addresses/${t}/portfolio`,{cache:"no-store",signal:i});if(!l.ok)throw new Error(`Game-swap portfolio fetch failed: ${l.status}`);return(await l.json()).pools??[]},enabled:n,staleTime:0});return{pools:o??[],...a}}import{useQuery as p0}from"@tanstack/react-query";var u0="wp:game-swap-lp-balances";function Qp(e,t,r,n){let o=[...r].map(l=>l.toLowerCase()).sort(),a=!!t&&o.length>0,{data:i,...s}=p0({queryKey:[u0,e,t,o,!!n],queryFn:async({signal:l})=>{let d=n?await n(o):await Ip(e,t,o,l),c={};for(let[h,u]of Object.entries(d))c[h.toLowerCase()]=u;return c},enabled:a,staleTime:0});return{balances:i??{},...s}}import xn from"bignumber.js";import{jsx as zr,jsxs as Xr}from"react/jsx-runtime";var f0="Gametoken LP",qp=18,m0=new xn("0.0001");function Vp(e){return e?.trim().toUpperCase()==="ONE"}function g0(e){return e&&e>0?e:qp}function h0(e){let t=Vp(e.token_a?.symbol)&&!Vp(e.token_b?.symbol),r=t?e.reserve_a:e.reserve_b,n=g0(t?e.token_a?.decimals:e.token_b?.decimals),o=new xn(r||"0").shiftedBy(-n);return!o.isFinite()||o.isLessThanOrEqualTo(0)?new xn(0):o.times(2)}function b0(e,t,r,n){let o=e.token_a?.symbol?.trim()||"TOKEN",a=e.token_b?.symbol?.trim()||n||"?",i=t?.decimals??qp,s,l;if(t&&t.totalSupply&&t.totalSupply>BigInt(0)){let d=new xn(t.balance.toString()),c=new xn(t.totalSupply.toString()),h=d.div(c);s=h.times(100);let u=h.times(h0(e));if(u.isGreaterThan(0)){let m=new xn(e.quote_usd??e.cross_usd??"0");l=m.isGreaterThan(0)?so(u.times(m),r):`${u.toFormat(4,xn.ROUND_DOWN)} ${n??""}`.trim()}}return{pool:e,tokenASymbol:o,tokenBSymbol:a,info:t,lpAmountRaw:t?.balance.toString(),lpDecimals:i,sharePercent:s,valueText:l}}function Yp(){let{env:e,walletAddress:t,onOutlink:r,lpBalanceReader:n}=Rt(),o=Dr(),a=!!t,{pools:i,isLoading:s}=Hp(e,t,a),l=Sl.useMemo(()=>i.map(p=>p.pair_address).filter(Boolean),[i]),{balances:d,isLoading:c}=Qp(e,t,l,n),{getNativeToken:h}=dn(e,a),u=h()?.symbol,m=`${Pr[e]}/game-token.png`,y=Object.keys(d).length>0,b=Sl.useMemo(()=>{let p=i.map(w=>b0(w,d[w.pair_address?.toLowerCase()],o,u));return y?p.filter(w=>w.lpAmountRaw?new xn(w.lpAmountRaw).shiftedBy(-w.lpDecimals).isGreaterThanOrEqualTo(m0):!1):p},[i,d,y,o,u]),f=p=>{let w=p.token_a?.address??p.pair_address;return`${kp[e]}/gametoken/tokens/${w}?trade=deposit`};return zr(Or,{sectionKey:"gameSwap",title:f0,icon:m,iconFit:"contain",isEmpty:b.length===0,loading:s||c,children:b.map(p=>{let{pool:w}=p,g=f(w),x=`${p.tokenASymbol} / ${p.tokenBSymbol}`,k=w.token_a?.logo_url,R=w.token_b?.logo_url;return Xr("article",{className:"wp-item","data-side":"game-swap",children:[Xr("div",{className:"wp-item-body",children:[Xr("div",{className:"wp-item-line",children:[zr("span",{className:"wp-item-label",children:"Pool"}),Xr("div",{className:"wp-svc-token",children:[Xr("span",{className:"wp-token-stack","aria-hidden":!0,children:[k&&zr("img",{className:"wp-svc-token-icon",src:k,alt:""}),R&&zr("img",{className:"wp-svc-token-icon",src:R,alt:""})]}),zr("span",{children:x})]})]}),p.lpAmountRaw!==void 0&&Xr("div",{className:"wp-item-line",children:[zr("span",{className:"wp-item-label",children:"My LP"}),Xr("span",{children:[ln(p.lpAmountRaw,p.lpDecimals)," LP"]})]}),p.sharePercent!==void 0&&Xr("div",{className:"wp-item-line",children:[zr("span",{className:"wp-item-label",children:"Pool Share"}),Xr("span",{children:[p.sharePercent.toFormat(2,xn.ROUND_DOWN),"%"]})]}),p.valueText!==void 0&&Xr("div",{className:"wp-item-line",children:[zr("span",{className:"wp-item-label",children:"Value"}),zr("span",{children:p.valueText})]})]}),zr("div",{className:"wp-item-tags",children:Xr("a",{className:"wp-tag wp-tag--mint",href:g,target:"_blank",rel:"noopener noreferrer","data-track":"gameswap_outlink","data-track-id":x,onClick:E=>Pt(E,g,{category:"portfolio",origin:"portfolio-game-swap",payload:{pool:w}},r),children:[zr("span",{className:"wp-tag-label",children:"Manage"}),zr(kr,{size:12,className:"wp-tag-icon"})]})})]},w.pair_address)})})}import lo from"bignumber.js";import{useMemo as S0}from"react";import{useQuery as w0}from"@tanstack/react-query";var y0="wp:forge-pools";function Kp(e,t,r=!0){let n=r&&!!t,{data:o,...a}=w0({queryKey:[y0,e,t],queryFn:async()=>{let s=await Ne("bondingCurve",e),l=await fetch(`${s}/v1/users/${t}/pools`,{cache:"no-store"});if(!l.ok)throw new Error(`forge pools fetch failed: ${l.status}`);return(await l.json()).data?.items??[]},enabled:n,staleTime:0}),i=o??[];return{pools:i,isEmpty:i.length===0,...a}}import{useQueries as x0}from"@tanstack/react-query";import{useMemo as v0}from"react";var k0="wp:forge-token-detail";async function R0(e,t){let r=await fetch(`${e}/v1/tokens/${t}`,{cache:"no-store"});return r.ok?(await r.json())?.data?.token??null:null}function Zp(e,t,r=!0){let n=x0({queries:t.map(i=>({queryKey:[k0,e,i],queryFn:async()=>R0(await Ne("bondingCurve",e),i),enabled:r&&!!i,staleTime:3e4}))}),o=v0(()=>{let i=new Map;for(let s=0;s<n.length;s++){let l=n[s]?.data,d=t[s];l&&d&&i.set(d.toLowerCase(),l)}return i},[n,t]),a=n.some(i=>i.isLoading);return{detailMap:o,isLoading:a}}import{jsx as mr,jsxs as Fn}from"react/jsx-runtime";var C0="ONEforge",Xp=18,N0="https://contents.crosstoken.io/wallet/token/images/FT.png";function T0(e){if(!e||e==="0")return"0";let t=new lo(e).shiftedBy(-Xp);return t.isZero()?"0":t.isGreaterThanOrEqualTo(1)?t.toFormat(2,lo.ROUND_DOWN):t.toFormat(4,lo.ROUND_DOWN)}function I0(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 E0(e,t,r,n){let o=new lo(r||"0");if(!o.isGreaterThan(0))return null;let a=new lo(e.total_supply||"0"),i=new lo(e.lp_balance||"0"),s=new lo(t?.reserve_b||"0").shiftedBy(-Xp);if(!a.isGreaterThan(0)||!i.isGreaterThan(0)||!s.isGreaterThan(0))return null;let l=s.times(2),c=i.div(a).times(l).times(o);return c.isFinite()?so(c,n):null}function Jp(){let{env:e,walletAddress:t,onOutlink:r}=Rt(),n=Dr(),o=!!t,{pools:a,isEmpty:i,isLoading:s}=Kp(e,t,o),l=S0(()=>a.map(m=>m.token.address),[a]),{detailMap:d}=Zp(e,l,o&&l.length>0),c=Pi(e,t,o),h=m=>`${xp[e]}/forge/token/${m.token.address}`,u=`${Pr[e]}/forge.png`;return mr(Or,{sectionKey:"forge",title:C0,icon:u,iconFit:"contain",isEmpty:i,loading:s,children:a.map(m=>{let y=d.get(m.token.address.toLowerCase()),b=y?.image_url||y?.image||m.token.image||N0,f=y?.symbol||m.token.symbol,p=h(m),w=E0(m,y,c,n);return Fn("a",{className:"wp-item","data-side":"lp",href:p,target:"_blank",rel:"noopener noreferrer","data-track":"forge_outlink","data-track-id":f,onClick:g=>Pt(g,p,{category:"portfolio",origin:"portfolio-forge",payload:{pool:m,tokenDetail:y}},r),children:[Fn("div",{className:"wp-item-body",children:[Fn("div",{className:"wp-item-line",children:[mr("span",{className:"wp-item-label",children:"Asset"}),Fn("div",{className:"wp-svc-token",children:[mr("img",{className:"wp-svc-token-icon",src:b,alt:""}),mr("span",{children:f}),y?.name&&mr("span",{className:"wp-token-subtle",children:y.name})]})]}),Fn("div",{className:"wp-item-line",children:[mr("span",{className:"wp-item-label",children:"LP Balance"}),mr("div",{className:"wp-svc-token wp-svc-token--amount",children:Fn("div",{className:"wp-svc-amount",children:[mr("span",{className:"wp-svc-amount-main",children:T0(m.lp_balance)}),w&&mr("span",{className:"wp-item-usd",children:w})]})})]}),Fn("div",{className:"wp-item-line",children:[mr("span",{className:"wp-item-label",children:"Ownership"}),mr("span",{className:"wp-line-value",children:I0(m.pool_ownership)})]})]}),mr("div",{className:"wp-item-tags",children:Fn("span",{className:"wp-tag wp-tag--muted",children:[mr("span",{className:"wp-tag-label",children:"Withdraw"}),mr(kr,{size:12,className:"wp-tag-icon"})]})})]},m.pair_address)})})}import{useMemo as pu}from"react";import ew from"bignumber.js";import{useQuery as M0}from"@tanstack/react-query";var A0="wp:crossd-positions";function L0(e){let t=e??{};return(t.positions??t.data?.positions??[]).filter(n=>{if(!n?.token_id||!n.liquidity)return!1;try{return BigInt(n.liquidity)>0n}catch{return!1}})}function $p(e,t,r=!0){let n=r&&!!t,{data:o,...a}=M0({queryKey:[A0,e,t],queryFn:async()=>{let s=await fetch(`${Li[e]}/api/v1/positions?owner=${t}`,{cache:"no-store"});if(!s.ok)throw new Error(`crossd positions fetch failed: ${s.status}`);return L0(await s.json())},enabled:n,staleTime:0}),i=o??[];return{positions:i,isEmpty:i.length===0,...a}}import{useQueries as D0}from"@tanstack/react-query";import{useMemo as P0}from"react";var O0="wp:crossd-position-details";function B0(e){let t=e??{},r=t.data??t;return r?.token_id||r?.pool?r:null}function eu(e,t,r=!0){let n=D0({queries:t.map(a=>({queryKey:[O0,e,a],queryFn:async()=>{let i=await fetch(`${Li[e]}/api/v1/positions/${a}`,{cache:"no-store"});if(!i.ok)throw new Error(`crossd position detail failed: ${i.status}`);return B0(await i.json())},enabled:r&&!!a,staleTime:6e4}))});return{detailMap:P0(()=>{let a=new Map;return n.forEach((i,s)=>{let l=i.data,d=t[s];l&&d&&a.set(d,l)}),a},[n,t])}}import*as vn from"react";import{Fragment as ru,jsx as Ce,jsxs as Ht}from"react/jsx-runtime";var z0=300*1e3,tu="https://contents.crosstoken.io/wallet/token/images/Cross.svg";function F0(e,t,r){if(t)return"Estimating...";if(!e)return"Wallet estimate";let n=e.maxFeePerGas??e.gasPrice;return!n||n<=0n||e.gasLimit<=0n?"Wallet estimate":`${Ni(e.gasLimit*n)} ${r??""}`.trim()}function Cl(e,t,r){return r?"Estimating...":`${e} ${t}`.trim()}function nu({open:e,status:t,target:r,token0Icon:n,token1Icon:o,token0Symbol:a,token1Symbol:i,nativeSymbol:s,txHash:l,error:d,copied:c=!1,hasEstimator:h,prepareWithdraw:u,confirmWithdraw:m,onClose:y,onCopyHash:b,trackFunnel:f}){let[p,w]=vn.useState(null),[g,x]=vn.useState(null),k=vn.useRef(0);vn.useEffect(()=>{if(!e||!r)return;let _=++k.current;w(null),x(null),f?.("dialog_opened"),u().then(le=>{k.current===_&&(w(le),x(le?Date.now():null))})},[e,r]);let R=t==="submitting",E=t==="estimating"||t==="confirm"&&!p,S=vn.useCallback(async()=>{let _=p,le=!g||Date.now()-g>z0;if(!_||le){let we=++k.current;if(_=await u(),k.current!==we)return;w(_),x(_?Date.now():null)}_&&await m(_)},[p,g,u,m]);if(!e||!r)return null;let{position:C,detail:I}=r,M=I.pool?.token0,F=I.pool?.token1,L=a||M?.symbol||C.pool?.token0_symbol||"?",U=i||F?.symbol||C.pool?.token1_symbol||"?",A=M?.decimals??18,O=F?.decimals??18,te=n||M?.logo_url||tu,Y=o||F?.logo_url||tu,G=`${L}/${U}`,H=p?Ao(p.expectedAmount0.toString(),A):null,re=p?Ao(p.expectedAmount1.toString(),O):null,K=Do(p?.estimate?.maxPriorityFeePerGas),B=Do(p?.estimate?.maxFeePerGas??p?.estimate?.gasPrice),Z=Ci(p?.estimate?.gasLimit);return Ce("div",{className:"wp-claim-overlay",role:"presentation",onMouseDown:_=>{_.target===_.currentTarget&&!R&&y()},children:Ht("section",{className:"wp-claim-sheet",role:"dialog","aria-modal":"true","aria-labelledby":"wp-crossd-withdraw-title","aria-label":"Withdraw position","data-status":t,"data-vaul-no-drag":!0,children:[Ce("div",{className:"wp-claim-grabber","aria-hidden":!0,children:Ce("span",{})}),Ht("div",{className:"wp-claim-content wp-withdraw-content",children:[t==="success"&&l?Ht(ru,{children:[Ce("span",{className:"wp-claim-icon wp-claim-icon--success","aria-hidden":!0,children:Ce(Ei,{})}),Ht("div",{className:"wp-claim-copy",children:[Ce("h3",{id:"wp-crossd-withdraw-title",className:"wp-claim-title",children:"Withdraw Submitted!"}),Ht("p",{className:"wp-claim-desc",children:["Your ",G," position withdrawal has been submitted. Balances will update shortly after the transaction settles."]})]}),Ce("div",{className:"wp-claim-list","aria-label":"Withdraw transaction",children:Ht("div",{className:"wp-claim-list-item",children:[Ce("span",{children:"Tx Hash"}),Ht("button",{type:"button",className:"wp-claim-hash",onClick:b,"aria-label":"Copy transaction hash","data-track":"crossd_withdraw_hash_copy",children:[Ce("strong",{children:Si(l)}),c?Ce(Ii,{}):Ce(Ti,{})]})]})})]}):Ht(ru,{children:[t==="error"&&Ht("div",{className:"wp-claim-heading",children:[Ce("h3",{id:"wp-crossd-withdraw-title",className:"wp-claim-title",children:"Withdraw Failed"}),Ce("p",{className:"wp-claim-error-message",children:d||"The withdraw request could not be completed."})]}),Ht("div",{className:"wp-claim-reward-card","data-fit":da(L,H??""),"aria-label":`Expected ${L}`,children:[Ce("span",{className:"wp-claim-reward-token","aria-hidden":!0,children:Ce("img",{src:te,alt:"",width:28,height:28})}),Ce("strong",{className:"wp-claim-reward-symbol",children:L}),Ce("strong",{className:"wp-claim-reward-amount",children:H??"Estimating..."})]}),Ht("div",{className:"wp-claim-reward-card","data-fit":da(U,re??""),"aria-label":`Expected ${U}`,children:[Ce("span",{className:"wp-claim-reward-token","aria-hidden":!0,children:Ce("img",{src:Y,alt:"",width:28,height:28})}),Ce("strong",{className:"wp-claim-reward-symbol",children:U}),Ce("strong",{className:"wp-claim-reward-amount",children:re??"Estimating..."})]}),h&&Ce("div",{className:"wp-claim-account-card","aria-label":"Withdraw gas fee",children:Ht("div",{className:"wp-claim-detail-list",children:[Ht("div",{className:"wp-claim-detail-row",children:[Ce("span",{children:"Est. Tx Fee"}),Ce("strong",{children:F0(p?.estimate,E,s)})]}),Ht("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[Ce("span",{children:"Priority Fee Per Gas"}),Ce("strong",{children:Cl(K,"Gwei",E)})]}),Ht("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[Ce("span",{children:"Max Fee Per Gas"}),Ce("strong",{children:Cl(B,"Gwei",E)})]}),Ht("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[Ce("span",{children:"Gas Limit"}),Ce("strong",{children:Cl(Z,"",E)})]})]})})]}),Ht("div",{className:"wp-claim-actions","data-count":t==="confirm"||t==="error"?2:1,children:[(t==="confirm"||t==="error")&&Ce("button",{type:"button",className:"wp-claim-secondary","data-track":"crossd_withdraw_cancel",onClick:y,children:t==="error"?"Close":"Cancel"}),Ce("button",{type:"button",className:"wp-claim-primary","data-track":"crossd_withdraw_confirm",onClick:()=>{if(t==="success"){y();return}R||E||(f?.("confirm_clicked"),S())},disabled:R||E,children:t==="success"?"Done":R?Ce("span",{className:"wp-claim-button-spinner","aria-label":"Waiting"}):E?Ce("span",{className:"wp-claim-button-spinner","aria-label":"Estimating"}):t==="error"?"Retry":"Withdraw"})]})]}),Ce("div",{className:"wp-claim-home-indicator","aria-hidden":!0,children:Ce("span",{})})]})})}import*as bt from"react";import{useQueryClient as Z0}from"@tanstack/react-query";var U0="0x0c49ccbe",j0="0xfc6f7865",W0="0x49404b7c",G0="0xdf2ab5bb",_0="0xac9650d8",ou=(1n<<128n)-1n,iu=600n,H0=99n,Q0=100n;function Nl(e){return e*H0/Q0}function au(e,t){return!!e&&!!t&&e.toLowerCase()===t.toLowerCase()}function gr(e,t){if(e<0n)throw new Error(`${t} must be non-negative`);let r=e.toString(16);if(r.length>64)throw new Error(`${t} exceeds uint256`);return r.padStart(64,"0")}function Oi(e,t){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`${t} is not a valid address`);return e.toLowerCase().replace(/^0x/,"").padStart(64,"0")}function Tl(e){return U0+gr(e.tokenId,"tokenId")+gr(e.liquidity,"liquidity")+gr(e.amount0Min,"amount0Min")+gr(e.amount1Min,"amount1Min")+gr(e.deadline,"deadline")}function V0(e){return j0+gr(e.tokenId,"tokenId")+Oi(e.recipient,"recipient")+gr(e.amount0Max,"amount0Max")+gr(e.amount1Max,"amount1Max")}function q0(e,t){return W0+gr(e,"amountMinimum")+Oi(t,"recipient")}function Y0(e,t,r){return G0+Oi(e,"token")+gr(t,"amountMinimum")+Oi(r,"recipient")}function K0(e){if(e.length===0)throw new Error("multicall requires at least one call");let t=e.map(o=>{let a=o.replace(/^0x/,"");if(a.length%2!==0||!/^[0-9a-fA-F]*$/.test(a))throw new Error("multicall element must be valid hex bytes");let i=a.length%64===0?a:a.padEnd(a.length+(64-a.length%64),"0");return gr(BigInt(a.length/2),"callLength")+i.toLowerCase()}),r=BigInt(e.length)*32n,n=[];for(let o of t)n.push(gr(r,"callOffset")),r+=BigInt(o.length/2);return _0+gr(0x20n,"arrayOffset")+gr(BigInt(e.length),"arrayLength")+n.join("")+t.join("")}function su(e){if(!e||e==="0x")return null;let t=e.replace(/^0x/,"");return t.length<128||!/^[0-9a-fA-F]+$/.test(t)?null:{amount0:BigInt(`0x${t.slice(0,64)}`),amount1:BigInt(`0x${t.slice(64,128)}`)}}function lu(e){let t=au(e.token0,e.wcrossAddress),r=au(e.token1,e.wcrossAddress),n=t||r,o=[Tl({tokenId:e.tokenId,liquidity:e.liquidity,amount0Min:e.amount0Min,amount1Min:e.amount1Min,deadline:e.deadline}),V0({tokenId:e.tokenId,recipient:n?e.positionManagerAddress:e.owner,amount0Max:ou,amount1Max:ou})];return n&&(o.push(q0(0n,e.owner)),o.push(Y0(t?e.token1:e.token0,0n,e.owner))),K0(o)}async function du(e,t,r){let n;try{n=await ma(e,r)}catch{n=void 0}if(!n)return null;let o=Tl({tokenId:t.tokenId,liquidity:t.liquidity,amount0Min:0n,amount1Min:0n,deadline:t.deadline}),a=await wn(n,t.positionManager,o,r,t.owner);return su(a)}var X0="wp:",J0=[1500,3e3,4500,6e3];function $0(e){return/^0x[a-fA-F0-9]{40}$/.test(e)?e:null}function cu(){let{env:e,walletAddress:t,sendTransaction:r,estimateGas:n}=Rt(),o=!!r,a=Z0(),[i,s]=bt.useState(!1),[l,d]=bt.useState(null),[c,h]=bt.useState("confirm"),[u,m]=bt.useState(),[y,b]=bt.useState(""),[f,p]=bt.useState(!1),[w,g]=bt.useState(new Set),x=bt.useRef(void 0),k=bt.useRef([]),R=bt.useRef(0);bt.useEffect(()=>()=>{clearTimeout(x.current),k.current.forEach(clearTimeout)},[]);let E=bt.useRef(new Set),S=bt.useCallback((A,O)=>{E.current.has(A)||(E.current.add(A),He("withdraw",A,{...O,tags:{section:"crossdPool",...O?.tags}}))},[]),C=bt.useCallback(()=>{let A=()=>a.invalidateQueries({predicate:O=>typeof O.queryKey[0]=="string"&&O.queryKey[0].startsWith(X0)});A(),k.current.forEach(clearTimeout),k.current=J0.map(O=>setTimeout(A,O))},[a]),I=bt.useCallback(A=>{R.current+=1,d(A),s(!0),h("confirm"),m(void 0),b(""),p(!1),E.current=new Set,S("opened")},[S]),M=bt.useCallback(()=>{c!=="submitting"&&(R.current+=1,s(!1),d(null),h("confirm"),m(void 0),b(""),p(!1))},[c]),F=bt.useCallback(async()=>{let A=R.current,O=$0(t),te=l?.position.token_id,Y=l?.position.liquidity,G=l?.detail.pool?.token0?.address,H=l?.detail.pool?.token1?.address;if(!O||!te||!Y||!G||!H)return h("error"),b("Position data is incomplete. Please refresh and retry."),null;try{h("estimating"),b("");let re=BigInt(te),K=BigInt(Y),B=BigInt(Math.floor(Date.now()/1e3))+iu,Z=Sp[e],_=await du(e,{owner:O,positionManager:Z,tokenId:re,liquidity:K,deadline:B});if(R.current!==A)return null;if(!_)return h("error"),b("Failed to estimate withdrawal amounts. Please retry."),null;let le=lu({tokenId:re,liquidity:K,amount0Min:Nl(_.amount0),amount1Min:Nl(_.amount1),deadline:B,owner:O,positionManagerAddress:Z,token0:G,token1:H,wcrossAddress:Cp[e]}),we={to:Z,value:0n,data:le,chainId:vt[e].cross},J=null;if(n){try{J=await n({...we,from:O})}catch{J=null}if(R.current!==A)return null}return h("confirm"),{tx:we,estimate:J,expectedAmount0:_.amount0,expectedAmount1:_.amount1}}catch(re){return R.current!==A||(h("error"),b(ca(re,"Failed to prepare withdraw."))),null}},[e,n,l,t]),L=bt.useCallback(async A=>{if(!r){h("error"),b("Withdraw is not available for this wallet.");return}try{h("submitting"),b(""),S("submitted");let O=await r({...A.tx,gas:A.estimate?.gasLimit&&A.estimate.gasLimit>0n?A.estimate.gasLimit:void 0,maxFeePerGas:A.estimate?.maxFeePerGas&&A.estimate.maxFeePerGas>0n?A.estimate.maxFeePerGas:void 0,maxPriorityFeePerGas:A.estimate?.maxPriorityFeePerGas&&A.estimate.maxPriorityFeePerGas>0n?A.estimate.maxPriorityFeePerGas:void 0});m(O),h("success");let te=l?.position.token_id;te&&g(Y=>{let G=new Set(Y);return G.add(te),G}),S("confirmed"),C()}catch(O){h("error"),b(ca(O,"Failed to request withdraw.")),S("confirmed",{status:"failure",reason:xr(O)})}},[C,r,l,S]),U=bt.useCallback(async()=>{if(!(!u||typeof navigator>"u"||!navigator.clipboard))try{await navigator.clipboard.writeText(u),p(!0),clearTimeout(x.current),x.current=setTimeout(()=>p(!1),1400)}catch{p(!1)}},[u]);return{canWithdrawInline:o,isOpen:i,target:l,withdrawnTokenIds:w,status:c,txHash:u,error:y,copied:f,hasEstimator:!!n,openWithdraw:I,closeWithdraw:M,prepareWithdraw:F,confirmWithdraw:L,copyHash:U,trackFunnelOnce:S}}import{Fragment as rw,jsx as hr,jsxs as Un}from"react/jsx-runtime";var tw="ONEusd Pool",uu="https://contents.crosstoken.io/wallet/token/images/Cross.svg";function fu(){let{env:e,walletAddress:t,onOutlink:r}=Rt(),n=Dr(),o=!!t,{positions:a,isLoading:i}=$p(e,t,o),s=cu(),l=pu(()=>a.filter(S=>!S.token_id||!s.withdrawnTokenIds.has(S.token_id)),[a,s.withdrawnTokenIds]),d=pu(()=>l.map(S=>S.token_id).filter(S=>!!S),[l]),{detailMap:c}=eu(e,d,o&&d.length>0),h=`${Rp[e]}/pool`,{getTokenImage:u,getTokenSymbol:m,getNativeToken:y}=dn(e,o),b=u("","ONEUSD",{chainOnly:!0})||`${Pr[e]}/crossd.png`,f={chainOnly:!0},p=(S,C)=>{let I=gl(m(S?.address??"",S?.symbol??C,f));return I==="ONE"?y()?.symbol??"?":I??"?"},w=(S,C)=>{let I=S?.symbol??C,M=gl(I);return M==="ONE"?y()?.image||uu:u(S?.address??"",M,f)||S?.logo_url||uu},g=s.target?.detail.pool,x=w(g?.token0,s.target?.position.pool?.token0_symbol),k=w(g?.token1,s.target?.position.pool?.token1_symbol),R=p(g?.token0,s.target?.position.pool?.token0_symbol),E=p(g?.token1,s.target?.position.pool?.token1_symbol);return Un(rw,{children:[hr(Or,{sectionKey:"crossdPool",title:tw,icon:b,iconFit:"contain",isEmpty:l.length===0,loading:i,children:l.map(S=>{let C=S.token_id?c.get(S.token_id):void 0,I=`${p(C?.pool?.token0,S.pool?.token0_symbol)}/${p(C?.pool?.token1,S.pool?.token1_symbol)}`,M=S.pool?.fee_tier_percentage,F=w(C?.pool?.token0,S.pool?.token0_symbol),L=w(C?.pool?.token1,S.pool?.token1_symbol),U=so(new ew(S.position_value_usd??"0"),n),A=s.canWithdrawInline&&!!C?.pool?.token0?.address&&!!C?.pool?.token1?.address;return Un("article",{className:"wp-item","data-side":"crossd",children:[Un("div",{className:"wp-item-body",children:[Un("div",{className:"wp-item-line",children:[hr("span",{className:"wp-item-label",children:"Pool"}),Un("div",{className:"wp-svc-token",children:[Un("span",{className:"wp-token-stack","aria-hidden":!0,children:[hr("img",{className:"wp-svc-token-icon",src:F,alt:""}),hr("img",{className:"wp-svc-token-icon",src:L,alt:""})]}),hr("span",{children:I}),M&&hr("span",{className:"wp-token-subtle",children:M})]})]}),Un("div",{className:"wp-item-line",children:[hr("span",{className:"wp-item-label",children:"Position Value"}),hr("span",{className:"wp-line-value",children:U})]})]}),hr("div",{className:"wp-item-tags",children:A?hr("button",{type:"button",className:"wp-tag wp-tag--muted","data-track":"crossd_pool_withdraw_open","data-track-id":I,onClick:()=>{C&&s.openWithdraw({position:S,detail:C})},children:hr("span",{className:"wp-tag-label",children:"Withdraw"})}):Un("a",{className:"wp-tag wp-tag--muted",href:h,target:"_blank",rel:"noopener noreferrer","data-track":"crossd_pool_outlink","data-track-id":I,onClick:O=>Pt(O,h,{category:"portfolio",origin:"portfolio-crossd-pool",payload:{position:S,detail:C}},r),children:[hr("span",{className:"wp-tag-label",children:"Withdraw"}),hr(kr,{size:12,className:"wp-tag-icon"})]})})]},S.token_id)})}),hr(nu,{open:s.isOpen,status:s.status,target:s.target,token0Icon:x,token1Icon:k,token0Symbol:R,token1Symbol:E,nativeSymbol:y()?.symbol,txHash:s.txHash,error:s.error,copied:s.copied,hasEstimator:s.hasEstimator,prepareWithdraw:s.prepareWithdraw,confirmWithdraw:s.confirmWithdraw,onClose:s.closeWithdraw,onCopyHash:s.copyHash,trackFunnel:s.trackFunnelOnce})]})}var Bi=["rewards","points","staking","gameSwap","forge","crossdPool"];de(`.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-system-orange-default, #f0640d);--wp-green: var(--ds-accent-primary-default, #00a0a2);--wp-accent-soft: var(--ds-system-orange-lowest, #2e2820);--wp-red: var(--ds-system-red-default, #e70077);--wp-blue: #0488fc;--wp-purple: #7346f3;--wp-orange: #ff9d00;--wp-claim-primary: #ed0a72;--wp-claim-primary-text: #ffffff;--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-system-orange-default, #f0640d);--wp-green: var(--ds-accent-primary-default, #00a0a2);--wp-accent-soft: var(--ds-system-orange-low, #fff5ee);--wp-red: var(--ds-system-red-default, #e70077);--wp-blue: #0488fc;--wp-purple: #7346f3;--wp-orange: #ff9d00;--wp-claim-primary: #ed0a72;--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;inset:0!important;width:100%!important;height:100dvh!important;max-height:100dvh!important;z-index:50;background:var(--wp-bg);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:center;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-fullscreen .wp-header{height:60px;min-height:60px;padding:11px 20px;border-bottom:none;background:transparent}.wp-fullscreen .wp-header-btn{width:22px;height:22px;color:var(--wp-chrome-text)}.wp-fullscreen .wp-header-btn:hover{color:var(--wp-chrome-text)}.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-account-meta{display:flex;flex-direction:column;justify-content:center;min-width:0;gap:2px}.wp-header-wallet-name{min-width:0;font-family:inherit;font-size:15px;font-weight:600;line-height:1.4;letter-spacing:0;color:var(--wp-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wp-header-address-btn{display:inline-flex;align-items:center;gap:4px;align-self:flex-start;max-width:100%;padding:0;border:0;background:transparent;cursor:pointer;font:inherit}.wp-header-address{min-width:0;font-size:12px;font-weight:400;line-height:1.4;letter-spacing:0;color:var(--wp-text-40);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wp-header-address-copy{display:inline-flex;align-items:center;flex-shrink:0;color:var(--wp-text-40);transition:color .15s ease}.wp-header-address-btn:hover .wp-header-address-copy{color:var(--wp-text-60)}.wp-header-address-copy[data-copied=true]{color:var(--wp-mint)}.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-fullscreen .wp-body-inner{padding-top:8px;gap:24px}.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{position:relative;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{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);left:0;right:auto;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-item[data-side=reward] .wp-svc-token-icon{border-radius:0;object-fit:contain}.wp-svc-token--amount{align-items:flex-start}.wp-svc-token--amount>.wp-svc-token-icon{margin-top:2.5px}.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-svc-amount{display:flex;flex-direction:column;align-items:flex-end;justify-content:center;gap:1px;min-width:0}.wp-svc-amount-main{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;max-width:100%}.wp-svc-amount .wp-item-usd{font-size:12px;font-weight:500;line-height:1.35}.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-body-inner[data-empty]{min-height:100%;box-sizing:border-box;justify-content:center}.wp-portfolio-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;min-height:280px;padding:32px 24px;text-align:center}.wp-portfolio-empty-icon{display:flex;align-items:center;justify-content:center;width:56px;height:56px;margin-bottom:6px;border-radius:50%;background:var(--wp-card);box-shadow:var(--wp-card-shadow, none);color:var(--wp-text-30)}.wp-portfolio-empty-title{margin:0;font-size:15px;font-weight:600;line-height:1.3;color:var(--wp-text-60)}.wp-portfolio-empty-desc{margin:0;font-size:13px;font-weight:400;line-height:1.4;color:var(--wp-text-30)}.wp-portfolio-loading{display:flex;align-items:center;justify-content:center;min-height:280px;padding:32px 24px}.wp-portfolio-spinner{width:22px;height:22px;border:2px solid var(--wp-border);border-top-color:var(--wp-mint);border-radius:50%;animation:wp-claim-spin .8s linear infinite}.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-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}}.wi-popover-content .wp-claim-sheet{min-height:min(600px,calc(100% - 24px))}.wi-popover-content .wp-claim-content{flex:1 1 auto}.wi-popover-content .wp-claim-actions{margin-top:auto}.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:6px;width:100%;min-height:60px;padding:16px 8px;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-reward-card[data-fit=sm] .wp-claim-reward-symbol{font-size:14px}.wp-claim-reward-card[data-fit=sm] .wp-claim-reward-amount{font-size:16px}.wp-claim-reward-card[data-fit=xs] .wp-claim-reward-symbol{font-size:12px}.wp-claim-reward-card[data-fit=xs] .wp-claim-reward-amount{font-size:13px}.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}.wp-withdraw-amount-card{display:flex;flex-direction:column;gap:12px;width:100%;padding:16px;border-radius:8px;background:var(--wp-card);box-sizing:border-box}.wp-withdraw-amount-row{display:flex;align-items:center;gap:8px;width:100%}.wp-withdraw-input{flex:1 1 auto;min-width:0;padding:0;border:none;background:transparent;color:var(--wp-text);font-family:inherit;font-size:24px;font-weight:600;line-height:1.3;letter-spacing:0;text-align:left;outline:none}.wp-withdraw-input::placeholder{color:var(--wp-text-30)}.wp-withdraw-input[aria-invalid=true]{color:var(--wp-claim-error)}.wp-withdraw-input-symbol{flex-shrink:0;color:var(--wp-text-40);font-size:15px;font-weight:600;line-height:1.3}.wp-withdraw-quick-row{display:flex;align-items:center;gap:8px;width:100%}.wp-withdraw-quick{appearance:none;flex:1 1 0;min-width:0;height:32px;padding:0 10px;border:1px solid var(--wp-border);border-radius:999px;background:transparent;color:var(--wp-text-60);font-family:inherit;font-size:13px;font-weight:600;line-height:1;white-space:nowrap;cursor:pointer}.wp-withdraw-quick:hover:not(:disabled){border-color:var(--wp-claim-primary);color:var(--wp-claim-primary)}.wp-withdraw-quick:disabled{cursor:default;opacity:.5}.wp-withdraw-content{overflow-y:auto}.wp-withdraw-token-list{display:flex;flex-direction:column;gap:8px;width:100%;max-height:216px;overflow-y:auto}.wp-withdraw-token{appearance:none;display:flex;align-items:center;gap:10px;width:100%;min-height:52px;padding:10px 12px;border:1px solid var(--wp-border);border-radius:8px;background:var(--wp-card);color:var(--wp-text);font-family:inherit;text-align:left;cursor:pointer;box-sizing:border-box}.wp-withdraw-token[data-selected]{border-color:var(--wp-claim-primary);box-shadow:inset 0 0 0 1px var(--wp-claim-primary)}.wp-withdraw-token:disabled{cursor:default;opacity:.6}.wp-withdraw-token-icon{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-withdraw-token-icon img{width:28px;height:28px;object-fit:cover}.wp-withdraw-token-icon 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-withdraw-token-symbol{flex:1 1 auto;min-width:0;overflow:hidden;font-size:15px;font-weight:600;line-height:1.3;text-overflow:ellipsis;white-space:nowrap}.wp-withdraw-token-amount{flex-shrink:0;color:var(--wp-text-40);font-size:13px;font-weight:500;line-height:1.3;white-space:nowrap}
|