PageSourceSearch

https://app.eagleailabs.com/assets/C9tnWdE_.js

js eagleailabs.com collected 2026-10-07 02:22:10 UTC 370,614 bytes, 1 lines download raw bytes

1import{d as e,C as t,D as a,F as s,J as l,H as r,E as o,W as n,K as i,M as d,j as c,r as u,o as f,a as p,L as v,B as h,w as b,v as m,Q as x,G as g,u as y,O as w,aa as k,k as S,R as T,T as _,S as M,X as C,I as D,P,a1 as U,a5 as L,Y as j,n as z,ab as A,N as O,Z as N}from"./DGa90K1v.js";import{a as B}from"./gunKTr2l.js";import{_ as F,m as E,a6 as Y,b as I,u as V,ab as H,i as R,s as $,a as W,d as q,ac as G,c as X,ad as Z,ae as K,l as J,af as Q,ag as ee,g as te,ah as ae,ai as se,aj as le,ak as re,al as oe,am as ne,w as ie,an as de}from"./4prz3O4y.js";import{_ as ce}from"./DrNNhYtl.js";import{_ as ue}from"./D4JdgRpd.js";import{a as fe,f as pe}from"./BTAPxjyv.js";import{u as ve}from"./BBOGjLIy.js";import{g as he}from"./B93k7I6L.js";import{n as be}from"./CilBNMv5.js";import{u as me}from"./BgQDOppw.js";import{a as xe}from"./fHa0IVTC.js";import{b as ge}from"./CmyOao70.js";import{c as ye}from"./Db2_v3Fn.js";import{u as we}from"./CYLL8ej3.js";import{u as ke,h as Se}from"./zIXjkD90.js";import{I as Te}from"./5c_tYSQe.js";import{R as _e}from"./BQWvIFJR.js";import{p as Me,o as Ce,q as De,_ as Pe}from"./BYTFuITp.js";import{u as Ue}from"./losQ_JUq.js";import{u as Le}from"./C4MqgHCX.js";import{p as je}from"./DfZJVdDr.js";import{C as ze}from"./zS0-0J7f.js";import{u as Ae}from"./C5MY0BRS.js";import Oe from"./CLmZIGv8.js";import{_ as Ne}from"./CitECtOd.js";import Be from"./CfDSef7g.js";import{e as Fe,L as Ee,u as Ye,a as Ie,f as Ve,g as He,c as Re,b as $e,h as We,j as qe,k as Ge}from"./Bi9H5AcD.js";import{u as Xe}from"./SM8sScM3.js";import{u as Ze}from"./D_aMFPsQ.js";import{_ as Ke}from"./34C4xYx6.js";import{d as Je}from"./SnoNHI7B.js";import Qe from"./BfnnmgGC.js";import{_ as et}from"./Cq8n2GbB.js";import{E as tt}from"./CZs74hLb.js";import{_ as at}from"./COZptHT_.js";import"./CxXS7KxG.js";import"./BbLqnI-s.js";import"./DxRZQ9uG.js";import"./xI5Yqauy.js";import"./w7SLEmYX.js";import"./BJ8pnspE.js";import"./DFkPvBEm.js";import"./C-Hfn8rm.js";import"./BXCfW_It.js";import"./C1OpzkNb.js";import"./BJIMNbo4.js";import"./D09l68Oa.js";const st={class:"fixed left-0 right-0 z-40 nav-bottom-position"},lt={class:"relative flex justify-around items-center h-10"},rt=["onClick","title"],ot={key:0,class:"absolute top-0 left-1/2 -translate-x-1/2 w-8 h-[2px] bg-[#00f6ff] rounded-b-full shadow-[0_0_6px_rgba(0,246,255,0.6)]"},nt={key:1,class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},it={key:2,class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},dt={key:3,class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},ct={key:4,class:"w-6 h-6",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},ut={key:5,class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},ft={key:6,class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},pt={class:"text-[10px] font-medium"},vt=F(e({__name:"MobileBottomNav",props:{modelValue:{}},emits:["update:modelValue"],setup(e,{emit:c}){const u=e,f=c,p=e=>"home"===e?["home","market","indicators","calendar"].includes(u.modelValue):u.modelValue===e,v=[{id:"home",label:"Home"},{id:"trade",label:"Trade"},{id:"ask-claw",label:"Ask Claw"},{id:"vault",label:"AutoTrade"},{id:"posttrade",label:"Post-Trade"},{id:"portfolio",label:"Account"}];return(e,c)=>(d(),t("div",st,[c[6]||(c[6]=a("div",{class:"absolute inset-0 bg-[#070b15] border-t border-white/[0.06]"},null,-1)),c[7]||(c[7]=a("div",{class:"absolute left-0 right-0 top-full h-screen bg-[#070b15]"},null,-1)),a("div",lt,[(d(),t(s,null,l(v,e=>a("button",{key:e.id,onClick:t=>f("update:modelValue",e.id),class:r(["flex flex-col items-center justify-center gap-0.5 flex-1 py-1.5 transition-all duration-200 relative",p(e.id)?"text-[#00f6ff]":"text-white/[0.42] hover:text-white/70"]),title:e.label},[p(e.id)?(d(),t("span",ot)):o("",!0),"home"===e.id?(d(),t("svg",nt,c[0]||(c[0]=[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"},null,-1)]))):"ask-claw"===e.id?(d(),t("svg",it,c[1]||(c[1]=[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 10V3L4 14h7v7l9-11h-7z"},null,-1)]))):"trade"===e.id?(d(),t("svg",dt,c[2]||(c[2]=[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 12l3-3 3 3 4-4M8 21l4-4 4 4M3 4h18M4 4h16v12a1 1 0 01-1 1H5a1 1 0 01-1-1V4z"},null,-1)]))):"vault"===e.id?(d(),t("svg",ct,c[3]||(c[3]=[n('<g fill="none" stroke="currentColor" stroke-width="1.5" data-v-4bc45e02><path stroke-linejoin="round" d="M19 16v-2c0-2.828 0-4.243-.879-5.12
11C17.243 8 15.828 8 13 8h-2c-2.828 0-4.243 0-5.121.879C5 9.757 5 11.172 5 14v2c0 2.828 0 4.243.879 5.121C6.757 22 8.172 22 11 22h2c2.828 0 4.243 0 5.121-.879C19 20.243 19 18.828 19 16Zm0 2c1.414 0 2.121 0 2.56-.44c.44-.439.44-1.146.44-2.56s0-2.121-.44-2.56C21.122 12 20.415 12 19 12M5 18c-1.414 0-2.121 0-2.56-.44C2 17.122 2 16.415 2 15s0-2.121.44-2.56C2.878 12 3.585 12 5 12" data-v-4bc45e02></path><path d="M13.5 3.5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0Z" data-v-4bc45e02></path><path stroke-linecap="round" stroke-linejoin="round" d="M12 5v3m-3 5v1m6-1v1" data-v-4bc45e02></path><path stroke-linecap="round" d="M10 17.5s.667.5 2 .5s2-.5 2-.5" data-v-4bc45e02></path></g>',1)]))):"posttrade"===e.id?(d(),t("svg",ut,c[4]||(c[4]=[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"},null,-1)]))):"portfolio"===e.id?(d(),t("svg",ft,c[5]||(c[5]=[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"},null,-1)]))):o("",!0),a("span",pt,i(e.label),1)],10,rt)),64))])]))}}),[["__scopeId","data-v-4bc45e02"]]),ht={class:"min-h-screen bg-[#0b1120] text-white flex flex-col overflow-hidden"},bt={class:"flex-1 overflow-y-auto pb-[120px]"},mt={class:"relative w-full text-center pt-14 px-6 pb-8 overflow-hidden"},xt={key:0,class:"relative z-10 inline-flex items-center gap-2 px-4 py-2 rounded-full bg-white/[0.04] border border-white/[0.08] text-[13px]"},gt={class:"text-white font-bold font-mono tabular-nums"},yt={key:1,class:"h-8 w-48 mx-auto rounded-full bg-white/[0.04] border border-white/[0.06] animate-pulse"},wt={key:0,class:"mx-4 mb-5 bg-amber-500/[0.07] border border-amber-500/25 rounded-[6px] p-4"},kt={class:"flex items-center gap-3"},St={class:"flex-1 min-w-0"},Tt={class:"text-white font-semibold text-sm"},_t={class:"px-4 mb-5"},Mt={class:"grid grid-cols-2 gap-2.5"},Ct=["innerHTML"],Dt={class:"text-[12px] font-semibold text-white"},Pt={class:"text-[10px] text-white/35 leading-relaxed mt-0.5"},Ut={class:"px-4 mb-5"},Lt={class:"bg-emerald-500/[0.05] border border-emerald-500/30 rounded-[6px] p-4 flex items-center gap-3"},jt={class:"px-4 mb-4"},zt={key:0,class:"mt-3 bg-[#060a12] border border-[#1d2742] rounded-[6px] p-4"},At={class:"fixed inset-x-0 bottom-0 z-50 bg-[#070b15]/95 backdrop-blur-md border-t border-white/[0.06] px-4 pt-4 pb-[calc(1.5rem+env(safe-area-inset-bottom,0px))]"},Ot={key:0,class:"space-y-3"},Nt={key:1,class:"space-y-2.5"},Bt={class:"text-center text-[13px] text-white/40"},Ft=e({__name:"MobileWelcome",props:{isLoggedIn:{type:Boolean},username:{}},emits:["try-chart","view-plans","login","signup"],setup(e){const h=e,b=c(()=>!0===h.isLoggedIn),m=[{name:"Pre-Trade",desc:"Live orderbook, AI signals, heatmaps",icon:'<path stroke-linecap="round" stroke-linejoin="round" d="M3 13.125C3 12.504 3.504 12 4.125 12h2.25c.621 0 1.125.504 1.125 1.125v6.75C7.5 20.496 6.996 21 6.375 21h-2.25A1.125 1.125 0 013 19.875v-6.75zM9.75 8.625c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125v11.25c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 01-1.125-1.125V8.625zM16.5 4.125c0-.621.504-1.125 1.125-1.125h2.25C20.496 3 21 3.504 21 4.125v15.75c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 01-1.125-1.125V4.125z"/>',bgClass:"bg-cyan-500/[0.04]",borderClass:"border-cyan-500/15",glow:"bg-gradient-to-r from-transparent via-cyan-500/60 to-transparent",iconBg:"bg-cyan-500/10",iconColor:"text-cyan-400"},{name:"Trade",desc:"Execute on ApeX Pro",icon:'<path stroke-linecap="round" stroke-linejoin="round" d="M7.5 21L3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5"/>',bgClass:"bg-blue-600/[0.04]",borderClass:"border-blue-600/15",glow:"bg-gradient-to-r from-transparent via-blue-500/60 to-transparent",iconBg:"bg-blue-600/10",iconColor:"text-blue-400"},{name:"Post-Trade",desc:"Equity curve & analytics",icon:'<path stroke-linecap="round" stroke-linejoin="round" d="M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/>',bgClass:"bg-purple-500/[0.04]",borderClass:"border-purple-500/15",glow:"bg-gradient-to-r from-transparent via-purple-500/60 to-transparent",iconBg:"bg-purple-500/10",iconColor:"text-purple-400"}
1,{name:"AutoTrade",desc:"Copy top traders & algos",icon:'<path stroke-linecap="round" stroke-linejoin="round" d="M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09z"/>',bgClass:"bg-amber-500/[0.04]",borderClass:"border-amber-500/15",glow:"bg-gradient-to-r from-transparent via-amber-500/60 to-transparent",iconBg:"bg-amber-500/10",iconColor:"text-amber-400"},{name:"Ask Claw",desc:"Eagle Stealth AI agent",icon:'<path stroke-linecap="round" stroke-linejoin="round" d="M9.75 3.104v5.714a2.25 2.25 0 01-.659 1.591L5 14.5M9.75 3.104c-.251.023-.501.05-.75.082m.75-.082a24.301 24.301 0 014.5 0m0 0v5.714a2.25 2.25 0 001.357 2.059l.538.239a2.25 2.25 0 001.962-.055l2.25-1.125M14.25 3.104c.251.023.501.05.75.082M19.5 7.336L18 7.75m-4.5-4.646A23.928 23.928 0 0112 3c-2.444 0-4.8.405-7 1.148m14 .082c.4-.016.795-.028 1.185-.036.5-.01.993.116 1.357.352m0 0l.307.215M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/>',bgClass:"bg-cyan-500/[0.04]",borderClass:"border-cyan-500/15",glow:"bg-gradient-to-r from-transparent via-cyan-500/60 to-transparent",iconBg:"bg-cyan-500/10",iconColor:"text-cyan-400"},{name:"Learn",desc:"Education & market news",icon:'<path stroke-linecap="round" stroke-linejoin="round" d="M4.26 10.147a60.436 60.436 0 00-.491 6.347A48.627 48.627 0 0112 20.904a48.627 48.627 0 018.232-4.41 60.46 60.46 0 00-.491-6.347m-15.482 0a50.57 50.57 0 00-2.658-.813A59.905 59.905 0 0112 3.493a59.902 59.902 0 0110.399 5.84c-.896.248-1.783.52-2.658.814m-15.482 0A50.697 50.697 0 0112 13.489a50.702 50.702 0 017.74-3.342M6.75 15a.75.75 0 100-1.5.75.75 0 000 1.5zm0 0v-3.675A55.378 55.378 0 0112 8.443m-7.007 11.55A5.981 5.981 0 006.75 15.75v-1.5"/>',bgClass:"bg-emerald-500/[0.04]",borderClass:"border-emerald-500/15",glow:"bg-gradient-to-r from-transparent via-emerald-500/60 to-transparent",iconBg:"bg-emerald-500/10",iconColor:"text-emerald-400"}],x=u(""),g=u(0);let y=null;async function w(){var e,t;try{const a=await fetch("https://api.bybit.com/v5/market/tickers?category=linear&symbol=BTCUSDT");if(!a.ok)return;const s=await a.json(),l=null==(t=null==(e=null==s?void 0:s.result)?void 0:e.list)?void 0:t[0];if(!l)return;x.value=new Intl.NumberFormat("en-US",{maximumFractionDigits:0}).format(parseFloat(l.lastPrice)),g.value=100*parseFloat(l.price24hPcnt)}catch{}}const k=u(!1),S=u(!1);let T=null;const _=e=>{e.preventDefault(),T=e,k.value=!0},M=async()=>{if(!T)return;T.prompt();const{outcome:e}=await T.userChoice;"accepted"===e&&(k.value=!1),T=null};return f(()=>{window.addEventListener("beforeinstallprompt",_),w(),y=setInterval(w,15e3)}),p(()=>{window.removeEventListener("beforeinstallprompt",_),y&&clearInterval(y)}),(e,c)=>(d(),t("div",ht,[a("div",bt,[a("section",mt,[c[7]||(c[7]=n('<div class="pointer-events-none absolute inset-0 overflow-hidden"><div class="absolute -top-24 left-1/2 -translate-x-1/2 w-[520px] h-[320px] rounded-full bg-cyan-500/[0.09] blur-3xl"></div><div class="absolute top-20 -right-20 w-[280px] h-[280px] rounded-full bg-blue-600/[0.07] blur-3xl"></div><div class="absolute inset-x-0 top-0 h-px bg-gradient-to-r from-transparent via-cyan-500/30 to-transparent"></div></div><div class="relative z-10 mb-6"><div class="w-20 h-20 mx-auto rounded-2xl bg-[#00f6ff]/[0.07] border border-[#00f6ff]/20 flex items-center justify-center shadow-[0_0_40px_rgba(0,246,255,0.15)]"><img src="/claw-logo.svg" alt="CLAW" class="w-12 h-12 object-contain drop-shadow-[0_0_16px_rgba(0,246,255,0.5)]"></div></div><h1 class="relative z-10 text-[2.1rem] font-black tracking-tight leading-tight bg-gradient-to-r from-white via-cyan-200 to-white bg-clip-text text-transparent mb-3"> Your Trading Advantage </h1><p class="relative z-10 text-white/45 text-[0.9rem] leading-relaxed mb-6"> Institutional-grade intelligence for crypto traders. </p>',4)),x.value?(d(),t("div",xt,[c[5]||(c[5]=a("span",{class:"w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse shrink-0"},null,-1)),c[6]||(c[6]=a("span",{class:"text-white/40 font-medium"},"BTC",-1)),a("span",gt,"$"+i(x.value),1),a("span",{class:r(["font-semibold px-1.5 py-0.5 rounded-md text-[11px]",g.value>=0?"text-emerald-400 bg-emerald-400/10":"text-red-400 bg-red-400/10"])},i(g.value>=0?"+":"")+i(g.value.toFixed(2))+"%",3)])):(d(),t("div",yt))]),b.value?(d(),t("div",wt,[a("div",kt,[c[9]||(c[9]=a("div",{class:"w-9 h-9 rounded-full bg-amber-500/20 flex items-center justify-center shrink-0"},[a("svg",{class:"w-4 h-4 text-amber-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})])],-1)),a("div",St,[a("p",Tt,"You're logged in"+i(e.username?`, ${e.username}`:""),1),c[8]||(c[8]=a("p",{class:"text-amber-200/60 text-xs mt-0.5"},"Verify your account to access CLAW — it's free.",-1))])])])):o("",!0),a("section",_t,[a("div",Mt,[(d(),t(s,null,l(m,e=>a("div",{key:e.name,class:r(["group relative overflow-hidden flex flex-col gap-2.5 p-3.5 rounded-xl border transition-all duration-200",[e.borderClass,e.bgClass]])},[a("div",{class:r(["absolute inset-x-0 top-0 h-px opacity-0 group-hover:opacity-100 transition-opacity",e.glow])},null,2),a("div",{class:r(["w-8 h-8 rounded-lg flex items-center justify-center shrink-0",e.iconBg])},[(d(),t("svg",{class:r(["w-4 h-4",e.iconColor]),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1.8",innerHTML:e.icon},null,10,Ct))],2),a("div",null,[a("p",Dt,i(e.name),1),a("p",Pt,i(e.desc),1)])],2)),64))])]),a("section",Ut,[a("div",Lt,[c[10]||(c[10]=n('<div class="w-9 h-9 rounded-[6px] bg-emerald-500/20 flex items-center justify-center shrink-0"><svg class="w-4 h-4 text-emerald-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
1<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 7h8m0 0v8m0-8l-8 8-4-4-6 6"></path></svg></div><div class="flex-1 min-w-0"><p class="text-white text-[13px] font-semibold">Try our free chart</p><p class="text-white/40 text-[11px] mt-0.5">No login needed</p></div>',2)),a("button",{onClick:c[0]||(c[0]=t=>e.$emit("try-chart")),class:"shrink-0 px-3 py-1.5 rounded-[6px] bg-emerald-500/20 hover:bg-emerald-500/30 text-emerald-400 text-[11px] font-semibold border border-emerald-500/30 transition-colors"}," Open → ")])]),a("section",jt,[a("button",{onClick:c[1]||(c[1]=e=>S.value=!S.value),class:"flex items-center gap-2 text-white/30 text-[12px] hover:text-white/50 transition-colors"},[(d(),t("svg",{class:r(["w-3.5 h-3.5 transition-transform",S.value?"rotate-90":""]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},c[11]||(c[11]=[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"},null,-1)]),2)),c[12]||(c[12]=v(" Add to home screen ",-1))]),S.value?(d(),t("div",zt,[k.value?(d(),t("button",{key:0,onClick:M,class:"w-full mb-3 bg-[#1870f6] hover:bg-[#1870f6]/80 text-white text-xs font-semibold py-2.5 px-4 rounded-[6px] transition-all flex items-center justify-center gap-2"},c[13]||(c[13]=[a("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})],-1),v(" Install App ",-1)]))):o("",!0),c[14]||(c[14]=n('<div class="space-y-3 text-[11px] text-white/50"><div class="flex items-center gap-3"><div class="w-7 h-7 rounded-[4px] bg-[#0d1424] flex items-center justify-center shrink-0"><svg class="w-4 h-4 text-white" viewBox="0 0 24 24" fill="currentColor"><path d="M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.81-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.13 1.17-.34 2.35-1.04 3.19-.69.85-1.83 1.51-2.95 1.42-.15-1.15.41-2.35 1.05-3.11z"></path></svg></div><span><span class="text-white/70 font-medium">iOS:</span> Tap Share → &quot;Add to Home Screen&quot;</span></div><div class="flex items-center gap-3"><div class="w-7 h-7 rounded-[4px] bg-[#0d1424] flex items-center justify-center shrink-0"><svg class="w-4 h-4 text-[#3DDC84]" viewBox="0 0 24 24" fill="currentColor"><path d="M17.6 9.48l1.84-3.18c.16-.31.04-.69-.26-.85-.29-.15-.65-.06-.83.22l-1.88 3.24a11.463 11.463 0 00-8.94 0L5.65 5.67c-.19-.29-.58-.38-.87-.2-.28.18-.37.54-.22.83L6.4 9.48A10.78 10.78 0 003 18h18a10.78 10.78 0 00-3.4-8.52zM7 15.25a1.25 1.25 0 110-2.5 1.25 1.25 0 010 2.5zm10 0a1.25 1.25 0 110-2.5 1.25 1.25 0 010 2.5z"></path></svg></div><span><span class="text-white/70 font-medium">Android:</span> Tap ⋮ Menu → &quot;Add to Home Screen&quot;</span></div></div>',1))])):o("",!0)])]),a("div",At,[b.value?(d(),t("div",Ot,[a("button",{onClick:c[2]||(c[2]=t=>e.$emit("view-plans")),class:"w-full bg-[#ff9500] hover:bg-[#ff9500]/85 text-[#0b1120] font-bold py-3.5 px-6 rounded-[6px] transition-all duration-200 text-[15px]"}," Get Verified "),c[15]||(c[15]=a("p",{class:"text-center text-white/35 text-[11px]"}," ApeX, BloFin, MEXC or Binance UID — free ",-1))])):(d(),t("div",Nt,[a("button",{onClick:c[3]||(c[3]=t=>e.$emit("login")),class:"w-full bg-[#00f6ff] hover:bg-[#00f6ff]/90 text-[#0b1120] font-bold py-3.5 px-6 rounded-[6px] transition-all duration-200 text-[15px]"}," Login "),a("p",Bt,[c[16]||(c[16]=v(" Don't have an account? ",-1)),a("button",{onClick:c[4]||(c[4]=t=>e.$emit("signup")),class:"text-[#00f6ff] font-semibold hover:text-[#00f6ff]/80 transition-colors"}," Sign Up ")])]))])]))}}),Et="/eai-image-for-app.png",Yt={class:"relative z-10"},It={class:"flex flex-col items-center"},Vt={class:"text-xs text-[#1870f6] mt-1"},Ht={key:1,class:"px-4 py-3 bg-red-500/10 border-b border-red-500/30"},Rt={class:"flex items-center gap-2"},$t={class:"text-sm text-red-400"},Wt={class:"relative overflow-hidden bg-[#070b15] px-4 py-4 border-b border-white/[0.06]"},qt={class:"relative z-10"},Gt={class:"flex items-center justify-between mb-3"},Xt={class:"relative"},Zt={class:"w-10 h-10 rounded-[6px] bg-gradient-to-br from-[#00f6ff]/20 to-[#066BF3]/20 p-[1px]"},Kt={class:"w-full h-full rounded-[6px] overflow-hidden bg-[#0a1020]"},Jt=["src"],Qt={class:"text-sm text-white font-semibold tracking-tight"},ea={class:"flex items-center gap-2"},ta={key:0,class:"w-4 h-4 text-white/[0.42]",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},aa={key:1,class:"w-4 h-4 text-white/[0.42]",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},sa={class:"flex items-center justify-between mb-3"},la={class:"flex flex-col gap-0.5"},ra={class:"flex items-baseline gap-1.5"},oa={key:0,class:"text-xl font-black text-white tracking-tight",style:{"font-feature-settings":"'tnum' 1"}},na={key:1,class:"text-xl font-black text-white/20"},ia={class:"flex items-baseline gap-1.5"},da={key:0,class:"text-2xl font-black text-[#00f6ff] tracking-tight",style:{"font-feature-settings":"'tnum' 1"}},ca={key:1,class:"text-2xl font-black text-[#00f6ff]/20"},ua={class:"flex items-center gap-2 px-3 py-2 rounded-[6px] bg-gradient-to-r from-[#00f6ff]/[0.08] to-[#066BF3]/[0.08] border border-[#00f6ff]/[0.15]"},fa={key:0,class:"text-sm font-bold text-[#00f6ff]",style:{"font-feature-settings":"'tnum' 1"}},pa={key:1,class:"text-sm font-bold text-[#00f6ff]/50"},va={class:"grid grid-cols-4 gap-2"},ha={class:"text-center p-2 rounded-[6px] bg-[#060a12] border border-[#1d2742]"},ba={key:1,class:"text-sm font-bold text-white/20"},ma={class:"text-center p-2 rounded-[6px] bg-[#060a12] border border-[#1d2742]"},xa={key:1,class:"text-sm font-bold text-white/20"},ga={class:"text-center p-2 rounded-[6px] bg-[#060a12] border border-[#1d2742]"},ya={key:1,class:"text-sm font-bold text-white/20"},wa={class:"text-center p-2 rounded-[6px] bg-[#060a12] border border-[#1d2742]"},ka={class:"text-sm font-bold text-[#00f6ff] tracking-tight"},Sa={class:"px-4 py-3 flex gap-2.5 overflow-x-auto scrollbar-hide"},Ta={key:2,class:"px-3 py-2"},_a={class:"flex items-center justify-between mb-1.5"},Ma={class:"flex items-center gap-1.5"},Ca={class:"px-1.5 py-0.5 bg-[#00f6ff]/[0.12] text-[#00f6ff] text-[9px] font-bold rounded"},Da={class:"flex gap-1.5 overflow-x-auto scrollbar-hide"},Pa={class:"flex items-center justify-between mb-1"},Ua={class:"text-[10px] font-bold text-white"},La={class:"flex items-center justify-between"},ja={key:1,class:"text-xs font-black text-white/20"},za={key:3,class:"px-3 py-2 text-scalable"},Aa={class:"flex gap-1.5 overflow-x-auto scrollbar-hide"},Oa=["onClick"],Na={class:"text-[9px] font-semibold text-white/80 block"},Ba={class:"px-3 py-2 pb-24"},Fa={class:"mb-3 text-scalable"},Ea={class:"flex items-center justify-between mb-1.5"},Ya={class:"flex gap-1.5 overflow-x-auto scrollbar-hide"},Ia=["onClick"],Va={class:"flex items-center gap-1 mb-0.5"},Ha={class:"text-[9px] font-bold text-white/90"},Ra={key:0,class:"text-[7px] text-amber-400 font-bold"},$a={class:"text-[10px] font-black text-[#00d26a]",style:{"font-feature-settings":"'tnum' 1"}},Wa=["onClick"],qa={class:"flex items-center gap-1 mb-0.5"},Ga={class:"text-[9px] font-bold text-white/90"},Xa={key:0,class:"text-[7px] text-amber-400 font-bold"},Za={class:"text-[10px] font-black text-[#ff4757]",style:{"font-feature-settings":"'tnum' 1"}},Ka={class:"mb-3 text-scalable"},Ja={class:"flex gap-1.5 overflow-x-auto scrollbar-hide"},Qa={class:"text-[9px] font-bold text-white/90 block mb-0.5"},es={class:"text-[10px] font-black text-[#00d26a]",style:{"font-feature-settings":"'tnum' 1"}},ts={class:"text-[9px] font-bold text-white/90 block mb-0.5"},as={class:"text-[10px] font-black text-[#ff4757]",style:{"font-feature-settings":"'tnum' 1"}},ss={class:"mb-3 text-scalable"},ls={key:0,class:"rounded-lg bg-[#060a12] border border-[#1d2742] p-3 text-center"},rs={key:1,class:"space-y-1"},os={class:"flex items-center gap-2"},ns={class:"text-[10px] font-bold text-white"},is={class:"text-[9px] text-white/30"},ds={class:"flex items-center gap-2"},cs={key:1,class:"text-[10px] font-bold text-white/20"},us=["onClick"],fs={class:"flex items-center gap-2 p-2 rounded-lg bg-[#060a12] border border-[#1d2742] mb-3 text-scalable"},ps={class:"flex-1 h-1 bg-white/[0.06] rounded-full overflow-hidden"},vs={class:"text-[9px] font-semibold",style:{"font-feature-settings":"'tnum' 1"}},hs={class:"text-[#00d26a]"},bs={class:"text-[#ff4757]"},ms={class:"mb-3 text-scalable"},xs={class:"flex items-center justify-between mb-1.5"},gs={key:0,class:"space-y-1"},ys={class:"flex-1 min-w-0"},ws={class:"flex items-center gap-1.5"},ks={class:"text-sm"},Ss={class:"text-[10px] font-semibold text-white truncate"},Ts={class:"flex items-center gap-2 mt-0.5"},_s={class:"text-[9px] text-white/40 font-mono"},Ms={class:"text-[9px] text-white/30"},Cs={key:1,class:"p-3 rounded-lg bg-[#060a12] border border-[#1d2742] text-center"},Ds={class:"mb-3"},Ps={class:"flex items-center justify-between mb-2 px-0.5"},Us={key:0,class:"flex items-center gap-1"},Ls={class:"text-[10px] text-white/40"},js={key:0,class:"flex items-center justify-center py-6"},zs={key:1,class:"space-y-2"},As=["href"],Os={class:"flex-1 min-w-0"},Ns={class:"flex items-center gap-1.5 mb-1"},Bs={class:"text-[10px] text-white/30"},Fs={class:"text-xs text-white font-medium leading-snug line-clamp-2"}
1,Es={key:0,class:"w-14 h-14 rounded-[4px] overflow-hidden flex-shrink-0 bg-white/5"},Ys=["src"],Is={key:2,class:"text-center py-6 text-white/30 text-xs"},Vs={key:0,class:"w-full max-h-[85vh] bg-[#060a12] rounded-t-[6px] overflow-hidden"},Hs={class:"relative px-4 py-4 border-b border-white/[0.06]"},Rs={class:"flex items-center justify-between mt-2"},$s={class:"flex items-center gap-2"},Ws={class:"text-[9px] text-white/40"},qs={class:"overflow-y-auto max-h-[70vh] p-4 space-y-4"},Gs={class:"p-3 rounded-[6px] bg-gradient-to-r from-[#8b5cf6]/[0.1] to-[#a855f7]/[0.1] border border-[#a855f7]/20"},Xs={class:"flex items-center gap-2 mb-1"},Zs={class:"text-xs font-bold text-white"},Ks={key:0,class:"px-1.5 py-0.5 bg-yellow-500/20 text-yellow-400 text-[8px] font-bold rounded"},Js={class:"text-[10px] text-white/60"},Qs={key:0,class:"text-[10px] text-[#00f6ff] mt-1"},el={key:0},tl={class:"space-y-1.5"},al={key:1,class:"flex-shrink-0 px-1.5 py-0.5 rounded text-[8px] font-bold uppercase bg-[#fbbf24]/30 text-[#fbbf24]"},sl={key:2,class:"w-4 h-4 text-[#00f6ff] flex-shrink-0 mt-0.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},ll={key:1},rl={class:"space-y-1"},ol={class:"flex items-center gap-1.5"},nl={class:"text-[10px] font-semibold text-white"},il={class:"grid grid-cols-2 gap-2"},dl={class:"space-y-1"},cl={class:"text-[10px] font-semibold text-white"},ul={class:"text-[10px] font-bold text-[#00d26a]"},fl={class:"space-y-1"},pl={class:"text-[10px] font-semibold text-white"},vl={class:"text-[10px] font-bold text-[#ff4757]"},hl={key:2},bl={class:"space-y-1"},ml={class:"flex items-center gap-1.5"},xl={class:"text-[10px] font-semibold text-white"},gl={class:"text-[9px] text-white/40"},yl={key:3},wl={class:"space-y-1"},kl={class:"flex-1 min-w-0"},Sl={class:"text-[10px] font-semibold text-white truncate block"},Tl={class:"text-[9px] text-white/40"},_l={key:0,class:"fixed inset-0 z-[9999] flex items-center justify-center",style:{padding:"16px"}},Ml={class:"relative bg-black rounded-[6px] border border-[#1d2742] shadow-2xl",style:{width:"320px","max-width":"calc(100vw - 32px)"}},Cl={class:"flex items-center justify-between p-4 border-b border-white/10"},Dl={class:"p-4 space-y-2"},Pl=["onClick"],Ul={class:"flex items-center gap-3"},Ll={key:0,class:"w-5 h-5 rounded-full bg-[#00f6ff] flex items-center justify-center"},jl={class:"mx-4 mb-4 p-3 rounded-[6px] bg-black/40 border border-white/10"},zl="@coinscreener.full",Al="@global-stocks",Ol="@newsarticles.full",Nl=e({__name:"MobileHome",emits:["navigate-to-trade","navigate-to-tab"],setup(e,{emit:p}){const{address:v}=ke(),P=C(),U=E(),L=Y(),j=ve(),z=I(),A=he(),O=V();me().ensureStarted();const N=u(null),F=u(!0),G=u(!1),X=u(!1),Z=u(!1),K=u(!1),J=[{value:"small",label:"Small",preview:"12px",scale:.85},{value:"normal",label:"Normal",preview:"14px",scale:1},{value:"large",label:"Large",preview:"16px",scale:1.15},{value:"xlarge",label:"Extra Large",preview:"18px",scale:1.3}],Q=u((()=>{try{return localStorage.getItem("mobile_text_size")||"normal"}catch{return"normal"}})()),ee=c(()=>{const e=J.find(e=>e.value===Q.value);return(null==e?void 0:e.preview)||"14px"}),te=e=>{const t=J.find(t=>t.value===e);t&&(document.documentElement.style.setProperty("--mobile-text-scale",String(t.scale)),window.dispatchEvent(new CustomEvent("mobile:textsize",{detail:{size:e,scale:t.scale}})))},ae=u([]),se=u(!1),le=u(Date.now());const re=e=>{const t=new Date(e),a=new Date,s=t.toDateString()===a.toDateString(),l=new Date(a);l.setDate(l.getDate()+1);const r=t.toDateString()===l.toDateString();if(s)return"Today";if(r)return"Tomorrow";const o=t.getDate(),n=1===o||21===o||31===o?"st":2===o||22===o?"nd":3===o||23===o?"rd":"th";return t.toLocaleDateString([],{weekday:"short"})+" "+o+n};let oe=null;f(()=>{(async function(){se.value=!0;try{const e="ultimate-economic-calendar.p.rapidapi.com",t="2c65f8afd7msh4693046fb627a8dp1b7463jsnb3c78d7f3fe2",a=(new Date).toISOString().slice(0,10),s=new Date;s.setDate(s.getDate()+7);const l=s.toISOString().slice(0,10),r=await fetch(`https://${e}/economic-events/tradingview?from=${a}&to=${l}&countries=US,EU,GB,JP,CN`,{headers:{"x-rapidapi-host":e,"x-rapidapi-key":t}}),o=await r.json(),n=(Array.isArray(o)?o:Array.isArray(null==o?void 0:o.result)?o.result:Array.isArray(null==o?void 0:o.data)?o.data:[]).map(e=>{const t=function(e){const t=`${e.title||""} ${e.indicator||""}`.toLowerCase();if(/(redbook|cleveland|api |soy|agricul|cotton|wheat|beef)/.test(t))return 1;const a=[/\bnon[-\s]?farm\b|\bnfp\b|\bunemployment/,/\bcpi\b|\bppi\b|\binflation/,/\bgdp\b|\bpmi\b/,/\bfomc\b|\bfed\b|\brate decision\b|\binterest rate\b|\becb\b|\bboe\b|\bboj\b/,/\bretail sales\b/,/\bjolts\b|\bjobs\b/];for(const l of a)if(l.test(t))return 3;const s=[/\bhousing\b/,/\bconfidence\b/,/\bsentiment\b/,/\btrade balance\b/,/\bmanufacturing\b/];for(const l of s)if(l.test(t))return 2;return Number(e.importance??1)}(e);return{id:String(e.id||Math.random()),event:e.title||e.indicator||"",country:e.country||"US",date:e.date||"",importance:t,impactLabel:t>=3?"HIGH":t>=2?"MED":"LOW",time:new Date(e.date).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1}),forecast:e.forecast,previous:e.previous}}).filter(e=>new Date(e.date).getTime()>Date.now()&&e.importance>=2).sort((e,t)=>
1new Date(e.date).getTime()-new Date(t.date).getTime());ae.value=n.slice(0,10)}catch(e){console.warn("Calendar fetch failed:",e)}finally{se.value=!1}})(),oe=setInterval(()=>{le.value=Date.now()},6e4),te(Q.value)}),h(()=>{oe&&clearInterval(oe)});const ne=B("mobileDefaultTab","home"),ie=u({unstaked:0,staked:0,vested:0,total:0}),de=p;function ce(){G.value=!G.value}const ue=()=>{sessionStorage.setItem("cameFromMobile","true"),localStorage.setItem("cameFromMobile","true"),P.push({name:"Account"})},pe=async()=>{try{const e=W("token"),{data:t}=await xe.get("https://stream.eagleailabs.com/p/v1/trades/apex/account-balance",{headers:{Authorization:`Bearer ${e}`}});U.updateBalance(t.data)}catch(e){console.error("Failed to fetch balance:",e)}},Pe=e=>{if(0===e)return"0.00";const t=Se(e);return"number"==typeof t?t.toString():t},Ue=async()=>{try{const e=W("token"),{data:t}=await xe.get("https://stream.eagleailabs.com/p/v1/trades/apex/account",{headers:{Authorization:`Bearer ${e}`}}),a=t.data.filter(e=>0!==Number(e.size||0));U.updatePositions(a)}catch(e){console.error("Failed to fetch positions:",e)}},Le=async()=>{try{const e=W("token"),{data:t}=await xe.get("https://stream.eagleailabs.com/p/v1/trades/apex/historical-pnl",{headers:{Authorization:`Bearer ${e}`}});U.updateHistoricalPnl(t.data)}catch(e){console.error("Failed to fetch historical PnL:",e)}},je=u(0),ze=u(!1),Ae=u(0),Oe=u(null),Ne=e=>{const t=e.target;Oe.value=t.closest(".overflow-y-auto")||document.documentElement,Ae.value=e.touches[0].clientY},Be=e=>{if(ze.value)return;const t=e.touches[0].clientY-Ae.value;t>0&&Oe.value&&0===Oe.value.scrollTop&&(je.value=Math.min(.5*t,100),je.value>10&&e.preventDefault())},Fe=async()=>{je.value>=80&&!ze.value&&(ze.value=!0,await Ee(),ze.value=!1),je.value=0,Ae.value=0},Ee=async()=>{try{A.sendMessage(zl,{action:"unsubscribe",channel:zl}),await new Promise(e=>setTimeout(e,300)),A.sendMessage(zl,{action:"subscribe",channel:zl}),await Promise.all([pe(),Ue(),Le()]),await new Promise(e=>setTimeout(e,500))}catch(e){console.error("Failed to refresh data:",e),N.value="Failed to refresh data"}};f(()=>{try{A.sendMessage(zl,{action:"subscribe",channel:zl}),pe(),Ue(),Le(),(async()=>{var e;try{let t=v.value;if(!t){const a=W("token"),{data:s}=await xe.get("https://stream.eagleailabs.com/api/v1/users/wallets",{headers:{Authorization:`Bearer ${a}`}});t=null==(e=s.data)?void 0:e[0]}if(!t)return void(ie.value={unstaked:0,staked:0,vested:0,total:0});const a=Me({chain:q,transport:Ce(ge)}),s=await a.readContract({address:ye.utils,abi:we,functionName:"getTier",args:[t]}),l=+De(s[1],18),r=+De(s[2],18),o=+De(s[3],18),n=+De(s[1],18)+ +De(s[2],18)+ +De(s[3],18);ie.value={unstaked:l,staked:r,vested:o,total:n}}catch(t){console.error("Failed to fetch EAI balance:",t)}})(),setTimeout(()=>{F.value=!1},1e3)}catch(e){console.error("Failed to subscribe to WebSocket:",e),N.value="Failed to connect to market data",F.value=!1}}),b(()=>z.token.label,()=>{pe(),Ue(),Le()}),h(()=>{try{A.sendMessage(zl,{action:"unsubscribe",channel:zl})}catch(e){console.error("Failed to unsubscribe from WebSocket:",e)}});const Ye=c(()=>{if(!U.balance)return"$0.00";const e=Number(U.balance.totalValueWithoutDiscount||0);return fe(e)}),Ie=c(()=>{if(!U.balance)return"$0.00";const e=Number(U.balance.availableBalance||0);return fe(e)}),Ve=c(()=>{var e;return(null==(e=U.positions)?void 0:e.filter(e=>0!==+e.size).length)||0}),He=c(()=>U.balance?Number(U.balance.unrealizedPnl||0):0),Re=c(()=>U.historicalPnl&&0!==U.historicalPnl.length?U.historicalPnl.reduce((e,t)=>e+Number(t.totalPnl||0),0):0),$e=c(()=>{if(!U.historicalPnl||0===U.historicalPnl.length)return 0;const e=U.historicalPnl.length;return U.historicalPnl.filter(e=>Number(e.totalPnl||0)>0).length/e*100}),We=c(()=>{var e;if(!U.positions||0===U.positions.length)return[];const t=new Map;return((null==(e=j.data)?void 0:e[zl])||[]).forEach(e=>{const a=String(e.symbol||""),s=Number(e.lastPrice??0);if(t.set(a,s),a.includes("USDT")){const e=a.replace("USDT","-USDT");t.set(e,s)}}),U.positions.filter(e=>0!==+e.size).slice(0,3).map(e=>{let a=t.get(e.symbol)||0;if(0===a&&e.symbol.includes("-")){const s=e.symbol.replace("-","");a=t.get(s)||0}const s=Number(e.entryPrice||0),l=Number(e.size||0);let r=0,o=0;return a>0&&s>0&&("LONG"===e.side?(r=(a-s)*l,o=(a-s)/s*100):(r=(s-a)*l,o=(s-a)/s*100)),{symbol:e.symbol,side:e.side,entryPrice:e.entryPrice,size:e.size,unrealizedPnl:r,unrealizedPnlPercent:o}})}),qe=c(()=>U.historicalPnl&&0!==U.historicalPnl.length?[...U.historicalPnl].sort((e,t)=>
1Number(t.createdAt)-Number(e.createdAt)).slice(0,3).map(e=>({symbol:e.symbol,side:e.side,createdAt:Number(e.createdAt),pnl:Number(e.totalPnl||0),pnlPercent:Ge(e),price:e.price,exitPrice:e.exitPrice,size:e.size})):[]),Ge=e=>{const t=Number(e.totalPnl||0),a=Number(e.price||0)*Number(e.size||0);return 0===a?0:t/(a/H(e.symbol,e.side))*100},Xe=e=>{const t=Date.now()-e,a=Math.floor(t/1e3),s=Math.floor(a/60),l=Math.floor(s/60),r=Math.floor(l/24);return r>0?`${r}d ago`:l>0?`${l}h ago`:s>0?`${s}m ago`:"Just now"},Ze=c(()=>{var e;return((null==(e=j.data)?void 0:e[zl])||[]).filter(e=>!R(String(e.symbol||""))).map(e=>{const t=String(e.symbol||"");return{symbol:t.replace("USDT","").replace("USDC",""),fullSymbol:t,dailyChange:be(t,e,!0),lastPrice:Number(e.lastPrice??0),fundingRate:Number(e.fundingRate??0),tradingVolume:Number(e.tradingVolume??0)}})}),Ke={BTCUSDT:100,ETHUSDT:100,SOLUSDT:50,XRPUSDT:50,DOGEUSDT:50,ADAUSDT:50,AVAXUSDT:50,LINKUSDT:50,MATICUSDT:50,DOTUSDT:50,UNIUSDT:50,ATOMUSDT:50,LTCUSDT:50,BCHUSDT:50,TRXUSDT:25,NEARUSDT:25,APTUSDT:25,ARBUSDT:25,OPUSDT:25},Je=e=>{const t=e.includes("USDT")?e:`${e}USDT`;return Ke[t]},Qe=c(()=>[...Ze.value].filter(e=>e.dailyChange>0).sort((e,t)=>t.dailyChange-e.dailyChange).slice(0,5)),et=c(()=>[...Ze.value].filter(e=>e.dailyChange<0).sort((e,t)=>e.dailyChange-t.dailyChange).slice(0,5)),tt=c(()=>{const e=[...Ze.value].filter(e=>0!==e.fundingRate).sort((e,t)=>t.fundingRate-e.fundingRate);return[...e.filter(e=>e.fundingRate>0).slice(0,3),...e.filter(e=>e.fundingRate<0).slice(-3).reverse()]}),at=c(()=>{var e;const t=new Date,a=t.getUTCHours(),s=t.getDay();let l="",r="",o="";a>=14&&a<21?(l="US Market Open",r="High volatility expected. Watch for momentum plays.",a<16&&(o="US/EU overlap - peak liquidity")):a>=13&&a<14?(l="US Pre-Market",r="Pre-market moves can signal the day's direction."):a>=21&&a<22?(l="US After-Hours",r="Lower liquidity. Be cautious with large positions."):a>=8&&a<16?(l="EU/London Session",r="Good liquidity for EUR pairs and European stocks.",a>=8&&a<9&&(o="EU/Asia overlap - watch JPY pairs")):a>=0&&a<8?(l="Asia Session",r="Watch JPY pairs and Asian indices."):(l="Markets Quiet",r="Lower volatility. Good time to plan tomorrow.");const n=0===s||6===s,i=n?"Weekend trading - lower liquidity, wider spreads, watch for manipulation":"",d=Qe.value.slice(0,3).map(e=>({symbol:e.symbol.replace("USDT",""),change:e.dailyChange,volume:e.tradingVolume})),c=et.value.slice(0,3).map(e=>({symbol:e.symbol.replace("USDT",""),change:e.dailyChange,volume:e.tradingVolume})),u=tt.value.slice(0,3).map(e=>({symbol:e.symbol.replace("USDT",""),rate:100*e.fundingRate,direction:e.fundingRate>0?"Short bias":"Long bias"})),f=tt.value.find(e=>Math.abs(100*e.fundingRate)>.05),p=ae.value.filter(e=>e.importance>=2).slice(0,3).map(e=>({event:e.event,country:e.country,time:e.time,impact:e.importance>=3?"HIGH":"MED"})),v=dt.value.length>ct.value.length,h=[...dt.value,...ct.value].reduce((e,t)=>e+t.changePercent,0)/Math.max(1,dt.value.length+ct.value.length),b=Math.abs(h)>.5?`Stocks ${v?"up":"down"} ${Math.abs(h).toFixed(1)}% avg - crypto may follow`:"",m=Ze.value.reduce((e,t)=>e+t.tradingVolume,0)/Math.max(1,Ze.value.length),x=Ze.value.filter(e=>e.tradingVolume>3*m&&0!==e.dailyChange).slice(0,2).map(e=>({symbol:e.symbol.replace("USDT",""),volume:e.tradingVolume,change:e.dailyChange})),g=(null==(e=U.positions)?void 0:e.filter(e=>0!==+e.size))||[],y=[];if(i&&y.push({text:i,type:"warning"}),o&&y.push({text:o,type:"info"}),f){const e=f.fundingRate>0?"short":"long";y.push({text:`${f.symbol.replace("USDT","")} funding ${(100*f.fundingRate).toFixed(3)}% - ${"short"===e?"SHORT opportunity":"LONG opportunity"}`,type:e})}b&&y.push({text:b,type:v?"long":"short"});const w=new Set;if(d.length&&d[0].change>5){const e=d[0];w.add(e.symbol),e.change>15?y.push({text:`${e.symbol} up ${e.change.toFixed(1)}% - extended, SHORT pullback opportunity`,type:"short"}):y.push({text:`${e.symbol} up ${e.change.toFixed(1)}% - LONG momentum play`,type:"long"})}if(c.length&&c[0].change<-5){const e=c[0];w.add(e.symbol),e.change<-10?y.push({text:`${e.symbol} down ${Math.abs(e.change).toFixed(1)}% - oversold, LONG bounce opportunity`,type:"long"}):y.push({text:`${e.symbol} down ${Math.abs(e.change).toFixed(1)}% - SHORT continuation`,type:"short"})}if(x.length){const e=x.find(e=>!w.has(e.symbol+"USDT")&&!w.has(e.symbol));e&&y.push({text:`${e.symbol} volume spike ${e.change>=0?"+":""}${e.change.toFixed(1)}% - unusual activity`,type:"info"})}return p.length&&y.push({text:`${p[0].event} coming up - reduce exposure`,type:"warning"}),g.length>0&&y.push({text:`You have ${g.length} open position${g.length>
11?"s":""} - manage risk`,type:"info"}),{marketStatus:l,marketAdvice:r,sessionOverlap:o,isWeekend:n,gainers:d,losers:c,fundingOpps:u,upcomingEvts:p,opportunities:y,volumeSpikes:x,generatedAt:t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}}),st=e=>{const t=100*e;return`${t>=0?"+":""}${t.toFixed(4)}%`},lt=e=>{const t=e.replace("USDT","").replace("USDC","").replace("-","").trim();z.setToken({icon:"",label:t,pair:`${t}/USDT`,value:`${t.toLowerCase()}_usd`}),de("navigate-to-tab","trade")},rt=c(()=>{if(0===Ze.value.length)return{label:"Neutral",percentage:50,color:"bg-[#ff9500]/20 text-[#ff9500]",barColor:"bg-[#ff9500]",gainers:0,losers:0};const e=Ze.value.filter(e=>e.dailyChange>0).length,t=Ze.value.filter(e=>e.dailyChange<0).length,a=e+t;if(0===a)return{label:"Neutral",percentage:50,color:"bg-[#ff9500]/20 text-[#ff9500]",barColor:"bg-[#ff9500]",gainers:0,losers:0};const s=Math.round(e/a*100);return s>=60?{label:"Bullish",percentage:s,color:"bg-[#5ec485]/20 text-[#5ec485]",barColor:"bg-[#5ec485]",gainers:e,losers:t}:s<=40?{label:"Bearish",percentage:s,color:"bg-[#eb5c57]/20 text-[#eb5c57]",barColor:"bg-[#eb5c57]",gainers:e,losers:t}:{label:"Neutral",percentage:s,color:"bg-[#ff9500]/20 text-[#ff9500]",barColor:"bg-[#ff9500]",gainers:e,losers:t}}),ot=u(!0),nt=u(null),it=c(()=>{var e;return(null==(e=nt.value)?void 0:e.main)?[{name:"S&P 500",ticker:"GSPC.INDX",market:"United States"},{name:"NASDAQ Composite",ticker:"IXIC.INDX",market:"United States"},{name:"Dow Jones Industrial",ticker:"DJI.INDX",market:"United States"},{name:"CAC 40",ticker:"FCHI.INDX",market:"Europe"},{name:"EURO STOXX 50",ticker:"STOXX50E.INDX",market:"Europe"},{name:"Nikkei 225",ticker:"N225.INDX",market:"Asia"},{name:"Hang Seng",ticker:"HSI.INDX",market:"Asia"},{name:"KOSPI",ticker:"KS11.INDX",market:"Asia"}].map(e=>{const t=nt.value.main[e.ticker];return t?{name:e.name,ticker:e.ticker.replace(".INDX",""),price:Number(t.close??0),change:Number(t.change??0),changePercent:Number(t.change_p??0),market:e.market}:null}).filter(e=>null!==e):[]}),dt=c(()=>[...it.value].filter(e=>e.changePercent>0).sort((e,t)=>t.changePercent-e.changePercent).slice(0,5)),ct=c(()=>[...it.value].filter(e=>e.changePercent<0).sort((e,t)=>e.changePercent-t.changePercent).slice(0,5)),ut=u([]),ft=u(!0),pt=["surge","rally","bull","gain","rise","soar","breakout","buy","adoption","approve","launch","record","high","positive","growth","recover"],vt=["crash","drop","bear","fall","decline","plunge","dump","sell","ban","hack","exploit","fraud","warning","fear","loss","collapse"];function ht(e){const t=`${e.headline} ${e.keywords||""}`.toLowerCase(),a=pt.filter(e=>t.includes(e)).length,s=vt.filter(e=>t.includes(e)).length;return a>s?"bullish":s>a?"bearish":"neutral"}const bt=e=>{const t=e.data;(null==t?void 0:t.channel)===Ol&&Array.isArray(t.data)&&(ut.value=t.data.slice(0,10),ft.value=!1)},mt=e=>{const{data:t}=e;(null==t?void 0:t.channel)===Al&&(ot.value=!1,nt.value=t.data)};return f(()=>{$.addEventListener("message",mt),$.addEventListener("message",bt),$.subscribe(Al),$.subscribe(Ol)}),h(()=>{$.removeEventListener("message",mt),$.removeEventListener("message",bt),$.unsubscribe(Al),$.unsubscribe(Ol)}),(e,c)=>(d(),t("div",{class:"w-full min-h-screen bg-transparent text-white relative overflow-hidden antialiased scrollbar-hide",style:{"-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale","text-rendering":"optimizeLegibility","font-feature-settings":"'kern' 1,\n        'liga' 1"},onTouchstart:Ne,onTouchmove:Be,onTouchend:Fe},[c[73]||(c[73]=n('<div class="fixed inset-0 pointer-events-none overflow-hidden z-0" data-v-d1fa65ca><div class="absolute inset-0 bg-gradient-to-b from-[#071220]/90 via-[#060a14] to-[#080d18]" data-v-d1fa65ca></div><div class="absolute -top-20 -right-20 w-80 h-80 bg-[#00f6ff]/[0.10] rounded-full blur-[100px] animate-float-slow" data-v-d1fa65ca></div><div class="absolute -bottom-32 -left-32 w-96 h-96 bg-[#1870f6]/[0.12] rounded-full blur-[120px] animate-float-slower" data-v-d1fa65ca></div><div class="absolute top-1/3 left-1/4 w-64 h-64 bg-[#ff9500]/[0.05] rounded-full blur-[90px] animate-float-medium" data-v-d1fa65ca></div><div class="absolute inset-0 opacity-[0.025] bg-[linear-gradient(rgba(0,246,255,0.5)_1px,transparent_1px),linear-gradient(90deg,rgba(0,246,255,0.5)_1px,transparent_1px)] bg-[length:60px_60px]" data-v-d1fa65ca></div><div class="absolute -top-1/4 left-1/2 -translate-x-1/2 w-full h-[600px] bg-gradient-radial from-[#00f6ff]/[0.06] to-transparent roun
1ded-full" data-v-d1fa65ca></div><div class="absolute bottom-0 right-0 w-72 h-72 bg-[#ff9500]/[0.04] rounded-full blur-[100px]" data-v-d1fa65ca></div><div class="absolute bottom-0 left-0 right-0 h-40 bg-gradient-to-t from-[#00f6ff]/[0.04] to-transparent" data-v-d1fa65ca></div><div class="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 opacity-[0.018] pointer-events-none select-none" data-v-d1fa65ca><img src="'+Et+'" alt="" class="w-80 h-80 object-contain" data-v-d1fa65ca></div></div>',1)),a("div",Yt,[je.value>0?(d(),t("div",{key:0,class:"absolute top-0 left-0 right-0 flex items-center justify-center transition-all duration-200 z-50",style:g({height:`${Math.min(je.value,80)}px`,opacity:je.value/80})},[a("div",It,[(d(),t("svg",{class:r(["w-6 h-6 text-[#1870f6] transition-transform duration-200",{"animate-spin":ze.value,"rotate-180":je.value>=80&&!ze.value}]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},c[18]||(c[18]=[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"},null,-1)]),2)),a("span",Vt,i(ze.value?"Refreshing...":je.value>=80?"Release to refresh":"Pull to refresh"),1)])],4)):o("",!0),N.value?(d(),t("div",Ht,[a("div",Rt,[c[20]||(c[20]=a("span",{class:"text-red-400"},"⚠️",-1)),a("span",$t,i(N.value),1),a("button",{onClick:c[0]||(c[0]=e=>N.value=null),class:"ml-auto text-red-400 hover:text-red-300"},c[19]||(c[19]=[a("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))])])):o("",!0),a("div",Wt,[c[35]||(c[35]=n('<div class="absolute top-0 right-0 w-64 h-64 bg-[#00f6ff]/20 rounded-full blur-3xl pointer-events-none" data-v-d1fa65ca></div><div class="absolute bottom-0 left-0 w-48 h-48 bg-blue-500/20 rounded-full blur-3xl pointer-events-none" data-v-d1fa65ca></div><div class="absolute inset-0 opacity-10 pointer-events-none" data-v-d1fa65ca><div class="absolute inset-0 bg-[linear-gradient(#00f6ff_1px,transparent_1px),linear-gradient(90deg,#00f6ff_1px,transparent_1px)] bg-[length:50px_50px]" data-v-d1fa65ca></div></div><div class="absolute inset-0 opacity-5 pointer-events-none" data-v-d1fa65ca><div class="absolute inset-0 bg-[repeating-linear-gradient(45deg,transparent,transparent_10px,#00f6ff_10px,#00f6ff_11px)]" data-v-d1fa65ca></div></div><div class="absolute top-0 left-0 right-0 h-1 bg-gradient-to-r from-transparent via-[#00f6ff] to-transparent" data-v-d1fa65ca></div>',5)),a("div",qt,[a("div",Gt,[a("div",{class:"flex items-center gap-3 cursor-pointer active:scale-[0.98] transition-transform",onClick:ue},[a("div",Xt,[a("div",Zt,[a("div",Kt,[a("img",{src:y(O).avatar_url||"/eagles/character 9 no bg.png",alt:"Profile",class:"w-full h-full object-cover"},null,8,Jt)])]),c[21]||(c[21]=a("div",{class:"absolute -bottom-0.5 -right-0.5 w-3 h-3 bg-[#00d26a] rounded-full border-2 border-[#0a1020] shadow-[0_0_8px_rgba(0,210,106,0.5)]"},null,-1))]),a("div",null,[c[22]||(c[22]=a("p",{class:"text-[10px] text-white/40 font-medium tracking-wide uppercase"}," Welcome back ",-1)),a("p",Qt,i(y(O).username||"Trader"),1)])]),a("div",ea,[a("button",{onClick:c[1]||(c[1]=e=>K.value=!0),class:"px-1.5 py-1 rounded-lg bg-white/[0.06] border border-white/[0.08] backdrop-blur-sm hover:bg-white/[0.1] transition-colors flex items-end gap-0",title:"Adjust Text Size"},c[23]||(c[23]=[a("span",{class:"text-white/60 font-bold text-sm leading-none"},"A",-1),a("span",{class:"text-white/40 font-bold text-[10px] leading-none"},"a",-1)])),w(a("select",{"onUpdate:modelValue":c[2]||(c[2]=e=>S(ne)?ne.value=e:null),title:"Open app on: (preference, sets default landing tab)",class:"px-2.5 py-1.5 rounded-lg bg-white/[0.06] border border-white/[0.08] text-white text-[11px] font-semibold focus:outline-none cursor-pointer appearance-none pr-5 bg-no-repeat bg-right backdrop-blur-sm",style:{"background-image":"url('data:image/svg+xml","background-size":"14px","background-position":"right 4px center"}},c[24]||(c[24]=[n('<option value="home" class="bg-[#0a1628]" data-v-d1fa65ca>Home</option><option value="market" class="bg-[#0a1628]" data-v-d1fa65ca>Market</option><option value="indicators" class="bg-[#0a1628]" data-v-d1fa65ca>Signals</option><option value="trade" class="bg-[#0a1628]" data-v-d1fa65ca>Trade</option><option value="vault" class="bg-[#0a1628]" data-v-d1fa65ca>Vault</option><option value="portfolio" class="bg-[#0a1628]" data-v-d1fa65ca>Portfolio</option>',6)]),512),[[k,y(ne)]]),a("button",{onClick:c[3]||(c[3]=e=>Z.value=!0),class:"p-2 rounded-lg bg-white/[0.06] border border-white/[0.08] backdrop-blur-sm hover:bg-white/[0.1] transition-colors"},[m(y(Te),{icon:"material-symbols:warning-outline-rounded",width:"16"})]),a("button",{onClick:ce,class:"p-2 rounded-lg bg-white/[0.06] border border-white/[0.08] backdrop-blur-sm hover:bg-white/[0.1] transition-colors"},[G.value?(d(),t("svg",aa,c[26]||(c[26]=[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21"},null,-1)]))):(d(),t("svg",ta,c[25]||(c[25]=[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"},null,-1),a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"},null,-1)])))])])]),a("div",sa,[a("div",null,[c[29]||(c[29]=a("p",{class:"text-[10px] text-white/30 uppercase tracking-widest font-medium mb-0.5"}," Portfolio ",-1)),a("div",la,[a("div",ra,[c[27]||(c[27]=a("span",{class:"text-[10px] text-white/40 w-10"},"USDT:",-1)),G.value?(d(),t("span",na,"•••••")):(d(),t("span",oa,i(Ie.value),1))]),a("div",ia,[c[28]||(c[28]=a("span",{class:"text-[10px] text-[#00f6ff]/70 w-10"},"All:",-1)),G.value?(d(),t("span",ca,"•••••")):(d(),t("span",da,i(Ye.value),1))])])]),a("div",ua,[c[30]||(c[30]=a("img",{src:Et,alt:"EAI",class:"w-5 h-5 object-contain"},null,-1)),G.value?(d(),t("span",pa,"•••")):(d(),t("span",fa,i(Pe(ie.value.total)),1))])]),a("div",va,[a("div",ha,[c[31]||(c[31]=a("p",{class:"text-[9px] text-white/40 font-medium uppercase tracking-wide mb-1"}," Unrealized ",-1)),G.value?(d(),t("p",ba,"•••")):(d(),t("p",{key:0,class:r(["text-sm font-bold tracking-tight",He.value>=0?"text-[#00d26a]":"text-[#ff4757]"]),style:{"font-feature-settings":"'tnum' 1"}},i(He.value>=0?"+":"")+"$"+i(Math.abs(He.value).toFixed(0)),3))]),a("div",ma,[c[32]||(c[32]=a("p",{class:"text-[9px] text-white/40 font-medium uppercase tracking-wide mb-1"}," Realized ",-1)),G.value?(d(),t("p",xa,"•••")):(d(),t("p",{key:0,class:r(["text-sm font-bold tracking-tight",Re.value>=0?"text-[#00d26a]":"text-[#ff4757]"]),style:{"font-feature-settings":"'tnum' 1"}},i(Re.value>=0?"+":"")+"$"+i(Math.abs(Re.value).toFixed(0)),3))]),a("div",ga,[c[33]||(c[33]=a("p",{class:"text-[9px] text-white/40 font-medium uppercase tracking-wide mb-1"}," Win Rate ",-1)),G.value?(d(),t("p",ya,"•••")):(d(),t("p",{key:0,class:r(["text-sm font-bold tracking-tight",$e.value>=50?"text-[#00d26a]":"text-[#ff4757]"])},i($e.value.toFixed(0))+"% ",3))]),a("div",wa,[c[34]||(c[34]=a("p",{class:"text-[9px] text-white/40 font-medium uppercase tracking-wide mb-1"}," Positions ",-1)),a("p",ka,i(Ve.value),1)])])])]),a("div",Sa,[a("button",{onClick:c[4]||(c[4]=e=>X.value=!0),class:"flex-shrink-0 flex items-center gap-2.5 px-3.5 py-2.5 rounded-[6px] bg-gradient-to-r from-[#8b5cf6]/[0.15] to-[#a855f7]/[0.15] border border-[#a855f7]/20 active:scale-[0.97] transition-all duration-150 shadow-[0_2px_8px_rgba(168,85,247,0.1)]"},c[36]||(c[36]=[n('<div class="w-8 h-8 rounded-lg bg-gradient-to-br from-[#8b5cf6] to-[#a855f7] flex items-center justify-center shadow-[0_2px_8px_rgba(168,85,247,0.3)]" data-v-d1fa65ca><svg class="w-4 h-4 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-d1fa65ca><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z" data-v-d1fa65ca></path></svg></div><div class="text-left" data-v-d1fa65ca><p class="text-[9px] text-white/40 font-medium uppercase tracking-wide" data-v-d1fa65ca>6hr</p><p class="text-xs text-white font-semibold" data-v-d1fa65ca>Summary</p></div>',2)])),a("button",{onClick:ue,class:"flex-shrink-0 flex items-center gap-2.5 px-3.5 py-2.5 rounded-[6px] bg-gradient-to-r from-[#066BF3]/[0.15] to-[#00f6ff]/[0.15] border border-[#00f6ff]/20 active:scale-[0.97] transition-all duration-150 shadow-[0_2px_8px_rgba(0,246,255,0.1)]"},c[37]||(c[37]=[n('<div class="w-8 h-8 rounded-lg bg-gradient-to-br from-[#066BF3] to-[#00f6ff] flex items-center justify-center shadow-[0_2px_8px_rgba(0,246,255,0.3)]" data-v-d1fa65ca><svg class="w-4 h-4 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-d1fa65ca><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z" data-v-d1fa65ca></path></svg></div><div class="text-left" data-v-d1fa65ca><p class="text-[9px] text-white/40 font-medium uppercase tracking-wide" data-v-d1fa65ca>ApeX</p><p class="text-xs text-white font-semibold" data-v-d1fa65ca>Deposit</p></div>',2)])),a("button",{onClick:c[5]||(c[5]=e=>de("navigate-to-tab","trade")),class:"flex-shrink-0 flex items-center gap-2.5 px-3.5 py-2.5 rounded-[6px] bg-[#00f6ff]/[0.08] border border-[#00f6ff]/[0.12] active:scale-[0.97] transition-all duration-150"},c[38]||(c[38]=[a("div",{class:"w-8 h-8 rounded-lg bg-[#00f6ff]/[0.15] flex items-center justify-center"},[a("svg",{class:"w-4 h-4 text-[#00f6ff]",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 7h8m0 0v8m0-8l-8 8-4-4-6 6"})])],-1),a("span",{class:"text-xs font-semibold text-[#00f6ff]"},"Trade",-1)])),a("button",{onClick:c[6]||(c[6]=e=>de("navigate-to-tab","indicators")),class:"flex-shrink-0 flex items-center gap-2.5 px-3.5 py-2.5 rounded-[6px] bg-[#1870f6]/[0.08] border border-[#1870f6]/[0.12] active:scale-[0.97] transition-all duration-150"},c[39]||(c[39]=[a("div",{class:"w-8 h-8 rounded-lg bg-[#1870f6]/[0.15] flex items-center justify-center"},[a("svg",{class:"w-4 h-4 text-[#1870f6]",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})])],-1),a("span",{class:"text-xs font-semibold text-[#1870f6]"},"Signals",-1)])),a("button",{onClick:c[7]||(c[7]=e=>de("navigate-to-tab","market")),class:"flex-shrink-0 flex items-center gap-2.5 px-3.5 py-2.5 rounded-[6px] bg-[#ff9500]/[0.08] border border-[#ff9500]/[0.12] active:scale-[0.97] transition-all duration-150"},c[40]||(c[40]=[a("div",{class:"w-8 h-8 rounded-lg bg-[#ff9500]/[0.15] flex items-center justify-center"},[a("svg",{class:"w-4 h-4 text-[#ff9500]",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 12l3-3 3 3 4-4M8 21l4-4 4 4M3 4h18M4 4h16v12a1 1 0 01-1 1H5a1 1 0 01-1-1V4z"})])],-1),a("span",{class:"text-xs font-semibold text-[#ff9500]"}
1,"Market",-1)])),a("button",{onClick:c[8]||(c[8]=e=>de("navigate-to-tab","calendar")),class:"flex-shrink-0 flex items-center gap-2.5 px-3.5 py-2.5 rounded-[6px] bg-[#ef4444]/[0.08] border border-[#ef4444]/[0.12] active:scale-[0.97] transition-all duration-150"},c[41]||(c[41]=[a("div",{class:"w-8 h-8 rounded-lg bg-[#ef4444]/[0.15] flex items-center justify-center"},[a("svg",{class:"w-4 h-4 text-[#ef4444]",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})])],-1),a("span",{class:"text-xs font-semibold text-[#ef4444]"},"Calendar",-1)]))]),Ve.value>0?(d(),t("div",Ta,[a("div",_a,[a("div",Ma,[c[42]||(c[42]=a("span",{class:"text-[10px] font-semibold text-white"},"Open Trades",-1)),a("span",Ca,i(Ve.value),1)]),a("button",{onClick:c[9]||(c[9]=e=>de("navigate-to-tab","portfolio")),class:"text-[9px] text-[#00f6ff] font-semibold"}," View All → ")]),a("div",Da,[(d(!0),t(s,null,l(We.value,(e,s)=>(d(),t("div",{key:s,class:r(["flex-shrink-0 w-[140px] rounded-lg p-2 border","LONG"===e.side?"bg-[#00d26a]/[0.06] border-[#00d26a]/[0.12]":"bg-[#ff4757]/[0.06] border-[#ff4757]/[0.12]"])},[a("div",Pa,[a("span",Ua,i(e.symbol.replace("-USDT","")),1),a("span",{class:r(["text-[8px] font-bold px-1 py-0.5 rounded","LONG"===e.side?"bg-[#00d26a]/20 text-[#00d26a]":"bg-[#ff4757]/20 text-[#ff4757]"])},i(e.side),3)]),a("div",La,[G.value?(d(),t("span",ja,"•••")):(d(),t("span",{key:0,class:r(["text-xs font-black",e.unrealizedPnl>=0?"text-[#00d26a]":"text-[#ff4757]"]),style:{"font-feature-settings":"'tnum' 1"}},i(e.unrealizedPnl>=0?"+":"")+"$"+i(Math.abs(e.unrealizedPnl).toFixed(2)),3)),G.value?o("",!0):(d(),t("span",{key:2,class:r(["text-[9px] font-bold",e.unrealizedPnlPercent>=0?"text-[#00d26a]":"text-[#ff4757]"])},i(e.unrealizedPnlPercent>=0?"+":"")+i(e.unrealizedPnlPercent.toFixed(1))+"% ",3))])],2))),128))])])):o("",!0),tt.value.length>0?(d(),t("div",za,[c[43]||(c[43]=n('<div class="flex items-center justify-between mb-1.5" data-v-d1fa65ca><div class="flex items-center gap-1.5" data-v-d1fa65ca><span class="text-[10px] font-semibold text-white" data-v-d1fa65ca>Funding</span><span class="text-[9px] text-white/30" data-v-d1fa65ca>/ ApeX</span></div><span class="text-[9px] text-white/30" data-v-d1fa65ca>Top 3 · 8h</span></div>',1)),a("div",Aa,[(d(!0),t(s,null,l(tt.value,e=>(d(),t("div",{key:"fr-"+e.symbol,onClick:t=>lt(e.symbol),class:r(["flex-shrink-0 px-2 py-1.5 rounded-lg border cursor-pointer active:scale-[0.97] transition-transform",e.fundingRate>=0?"bg-[#00d26a]/[0.08] border-[#00d26a]/[0.12]":"bg-[#ff4757]/[0.08] border-[#ff4757]/[0.12]"])},[a("span",Na,i(e.symbol),1),a("span",{class:r(["text-[10px] font-bold",e.fundingRate>=0?"text-[#00d26a]":"text-[#ff4757]"]),style:{"font-feature-settings":"'tnum' 1"}},i(st(e.fundingRate)),3)],10,Oa))),128))])])):o("",!0),a("div",Ba,[a("div",Fa,[a("div",Ea,[c[44]||(c[44]=a("span",{class:"text-[10px] font-semibold text-white"},"Crypto Movers",-1)),a("button",{onClick:c[10]||(c[10]=e=>de("navigate-to-tab","market")),class:"text-[9px] text-[#00f6ff] font-semibold"}," See All → ")]),a("div",Ya,[F.value?(d(),t(s,{key:0},l(5,e=>a("div",{key:e,class:"flex-shrink-0 w-[70px] h-[42px] rounded-lg bg-white/[0.03] animate-pulse"})),64)):(d(!0),t(s,{key:1},l(Qe.value,e=>(d(),t("div",{key:"g-"+e.symbol,onClick:t=>lt(e.symbol),class:"flex-shrink-0 px-2 py-1.5 rounded-lg bg-[#00d26a]/[0.06] border border-[#00d26a]/[0.12] cursor-pointer active:scale-[0.97] transition-transform"},[a("div",Va,[a("span",Ha,i(e.symbol),1),Je(e.fullSymbol)?(d(),t("span",Ra,i(Je(e.fullSymbol))+"x",1)):o("",!0)]),a("span",$a,"+"+i(e.dailyChange.toFixed(1))+"%",1)],8,Ia))),128)),(d(!0),t(s,null,l(et.value,e=>(d(),t("div",{key:"l-"+e.symbol,onClick:t=>lt(e.symbol),class:"flex-shrink-0 px-2 py-1.5 rounded-lg bg-[#ff4757]/[0.06] border border-[#ff4757]/[0.12] cursor-pointer active:scale-[0.97] transition-transform"},[a("div",qa,[a("span",Ga,i(e.symbol),1),Je(e.fullSymbol)?(d(),t("span",Xa,i(Je(e.fullSymbol))+"x",1)):o("",!0)]),a("span",Za,i(e.dailyChange.toFixed(1))+"%",1)],8,Wa))),128))])]),a("div",Ka,[c[45]||(c[45]=a("div",{class:"flex items-center justify-between mb-1.5"},[a("span",{class:"text-[10px] font-semibold text-white"},"Stock Movers")],-1)),a("div",Ja,[ot.value?(d(),t(s,{key:0},l(5,e=>a("div",{key:e,class:"flex-shrink-0 w-[70px] h-[42px] rounded-lg bg-white/[0.03] animate-pulse"})),64)):o("",!0),(d(!0),t(s,null,l(dt.value,e=>(d(),t("div",{key:"sg-"+e.ticker,class:"flex-shrink-0 px-2 py-1.5 rounded-lg bg-[#00d26a]/[0.06] border border-[#00d26a]/[0.12]"},[a("span",Qa,i(e.name),1),a("span",es,"+"+i(e.changePercent.toFixed(1))+"%",1)]))),128)),(d(!0),t(s,null,l(ct.value,e=>(d(),t("div",{key:"sl-"+e.ticker,class:"flex-shrink-0 px-2 py-1.5 rounded-lg bg-[#ff4757]/[0.06] border border-[#ff4757]/[0.12]"},[a("span",ts,i(e.name),1),a("span",as,i(e.changePercent.toFixed(1))+"%",1)]))),128))])]),a("div",ss,[c[48]||(c[48]=a("div",{class:"flex items-center justify-between mb-1.5"},[a("span",{class:"text-[10px] font-semibold text-white"},"Recent Trades"),a("span",{class:"text-[9px] text-white/30"},"Last 5")],-1)),0===qe.value.length?(d(),t("div",ls,c[46]||(c[46]=[a("p",{class:"text-[10px] text-white/30"},"No trades yet",-1)]))):(d(),t("div",rs,[(d(!0),t(s,null,l(qe.value,(e,s)=>(d(),t("div",{key:s,class:"flex items-center justify-between p-2 rounded-lg bg-[#060a12] border border-[#1d2742]"},[a("div",os,[a("span",ns,i(e.symbol.replace("-USDT","")),1),a("span",{class:r(["text-[8px] px-1 py-0.5 rounded font-bold","LONG"===e.side?"bg-[#00d26a]/[0.15] text-[#00d26a]":"bg-[#ff4757]/[0.15] text-[#ff4757]"])},i(e.side),3),a("span",is,i(Xe(e.createdAt)),1)]),a("div",ds,[G.value?(d(),t("span",cs,"•••")):(d(),t("span",{key:0,class:r(["text-[10px] font-bold",e.pnl>=0?"text-[#00d26a]":"text-[#ff4757]"]),style:{"font-feature-settings":"'tnum' 1"}},i(e.pnl>=0?"+":"")+"$"+i(Math.abs(e.pnl).toFixed(2)),3)),a("button",{onClick:t=>(e=>
1{L.updatePayload({symbol:e.symbol,side:e.side,entryPrice:e.price,lastPrice:Number(e.exitPrice),leverage:0,quantity:e.size,pnl:e.pnl,pnlPercent:e.pnlPercent}),L.onShareOpen()})(e),class:"p-1 rounded bg-[#00f6ff]/[0.08] text-[#00f6ff]"},c[47]||(c[47]=[a("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.368 2.684 3 3 0 00-5.368-2.684z"})],-1)]),8,us)])]))),128))]))]),a("div",fs,[c[50]||(c[50]=a("span",{class:"text-[9px] text-white/40 font-semibold uppercase"},"Sentiment",-1)),a("div",ps,[a("div",{class:r(["h-full transition-all duration-500 rounded-full",rt.value.barColor]),style:g({width:rt.value.percentage+"%"})},null,6)]),a("span",{class:r(["text-[10px] font-bold",rt.value.color])},i(rt.value.label),3),a("span",vs,[a("span",hs,i(rt.value.gainers),1),c[49]||(c[49]=a("span",{class:"text-white/20"},"/",-1)),a("span",bs,i(rt.value.losers),1)])]),a("div",ms,[a("div",xs,[c[51]||(c[51]=a("span",{class:"text-[10px] font-semibold text-white"},"Upcoming Events",-1)),a("button",{onClick:c[11]||(c[11]=e=>de("navigate-to-tab","calendar")),class:"text-[9px] text-[#00f6ff] font-semibold"}," See All → ")]),ae.value.length>0?(d(),t("div",gs,[(d(!0),t(s,null,l(ae.value.slice(0,3),e=>{return d(),t("div",{key:e.id,class:"flex items-center gap-2 p-2 rounded-lg bg-[#060a12] border border-[#1d2742]"},[a("div",{class:r(["w-1 h-8 rounded-full",e.importance>=3?"bg-red-500":e.importance>=2?"bg-yellow-500":"bg-green-500"])},null,2),a("div",ys,[a("div",ws,[a("span",ks,i((s=e.country,{US:"🇺🇸",USA:"🇺🇸","United States":"🇺🇸",EU:"🇪🇺",EMU:"🇪🇺",Eurozone:"🇪🇺",GB:"🇬🇧",UK:"🇬🇧","United Kingdom":"🇬🇧",JP:"🇯🇵",Japan:"🇯🇵",CN:"🇨🇳",China:"🇨🇳",AU:"🇦🇺",Australia:"🇦🇺",CA:"🇨🇦",Canada:"🇨🇦",CH:"🇨🇭",Switzerland:"🇨🇭",NZ:"🇳🇿","New Zealand":"🇳🇿",DE:"🇩🇪",Germany:"🇩🇪",FR:"🇫🇷",France:"🇫🇷"}[s]||"🌐")),1),a("span",Ss,i(e.event),1)]),a("div",Ts,[a("span",_s,i(re(e.date)),1),a("span",Ms,i(e.time),1)])])]);var s}),128))])):(d(),t("div",Cs,c[52]||(c[52]=[a("p",{class:"text-[10px] text-white/30"},"No upcoming events",-1)])))]),a("div",Ds,[a("div",Ps,[c[53]||(c[53]=a("p",{class:"text-xs font-semibold text-white/60 uppercase tracking-wider"},"Market Sentiment",-1)),ft.value?o("",!0):(d(),t("div",Us,[a("span",Ls,i(ut.value.length)+" articles",1)]))]),ft.value?(d(),t("div",js,c[54]||(c[54]=[a("div",{class:"animate-spin rounded-full h-5 w-5 border-b-2 border-[#00f6ff]"},null,-1)]))):ut.value.length>0?(d(),t("div",zs,[(d(!0),t(s,null,l(ut.value.slice(0,5),e=>(d(),t("a",{key:e.headline,href:e.url,target:"_blank",rel:"noopener",class:"flex gap-3 bg-black border border-[#1d2742] rounded-[6px] p-3 hover:border-[#00f6ff]/30 transition-colors"},[a("div",Os,[a("div",Ns,[a("span",{class:r(["text-[9px] font-bold px-1.5 py-0.5 rounded-[3px] uppercase tracking-wider","bullish"===ht(e)?"bg-[#5ec485]/20 text-[#5ec485]":"bearish"===ht(e)?"bg-[#eb5c57]/20 text-[#eb5c57]":"bg-white/10 text-white/40"])},i(ht(e)),3),a("span",Bs,i(new Date(e.date_published).toLocaleDateString()),1)]),a("p",Fs,i(e.headline),1)]),e.thumbnail_url?(d(),t("div",Es,[a("img",{src:e.thumbnail_url,class:"w-full h-full object-cover",loading:"lazy",onError:c[12]||(c[12]=e=>e.target.style.display="none")},null,40,Ys)])):o("",!0)],8,As))),128))])):(d(),t("div",Is,"No news available"))])]),c[72]||(c[72]=n('<div class="mx-3 mb-3 bg-black border border-[#1d2742] rounded-[6px] p-4" data-v-d1fa65ca><div class="flex items-center gap-2 mb-3" data-v-d1fa65ca><div class="w-8 h-8 rounded-lg bg-violet-500/20 border border-violet-500/20 flex items-center justify-center" data-v-d1fa65ca><svg class="w-4 h-4 text-violet-400" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-d1fa65ca><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 8h2a2 2 0 012 2v6a2 2 0 01-2 2h-2v4l-4-4H9a1.994 1.994 0 01-1.414-.586m0 0L11 14h4a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2v4l.586-.586z" data-v-d1fa65ca></path></svg></div><div data-v-d1fa65ca><p class="text-sm font-semibold text-white" data-v-d1fa65ca>Social Feed</p><p class="text-xs text-white/40" data-v-d1fa65ca>Trader community</p></div>
1<span class="ml-auto px-2 py-0.5 bg-violet-500/20 text-violet-400 text-[10px] font-bold rounded-full border border-violet-500/20" data-v-d1fa65ca>SOON</span></div><div class="flex flex-col items-center py-4 gap-2" data-v-d1fa65ca><svg class="w-8 h-8 text-white/15" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-d1fa65ca><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" data-v-d1fa65ca></path></svg><p class="text-white/30 text-xs text-center" data-v-d1fa65ca>Follow top traders, share signals,<br data-v-d1fa65ca>and copy their moves.</p></div></div><div class="mx-3 mb-4 bg-black border border-[#1d2742] rounded-[6px] p-4" data-v-d1fa65ca><div class="flex items-center gap-2 mb-1" data-v-d1fa65ca><div class="w-8 h-8 rounded-lg bg-amber-500/20 border border-amber-500/20 flex items-center justify-center" data-v-d1fa65ca><svg class="w-4 h-4 text-amber-400" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-d1fa65ca><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253" data-v-d1fa65ca></path></svg></div><div data-v-d1fa65ca><p class="text-sm font-semibold text-white" data-v-d1fa65ca>Learn</p><p class="text-xs text-white/40" data-v-d1fa65ca>Trading education</p></div><span class="ml-auto px-2 py-0.5 bg-amber-500/20 text-amber-400 text-[10px] font-bold rounded-full border border-amber-500/20" data-v-d1fa65ca>SOON</span></div></div>',2)),(d(),x(M,{to:"body"},[m(_,{name:"fade"},{default:T(()=>[X.value?(d(),t("div",{key:0,class:"fixed inset-0 z-[9999] flex items-end justify-center bg-black/60 backdrop-blur-sm",onClick:c[14]||(c[14]=D(e=>X.value=!1,["self"]))},[m(_,{name:"slide-up"},{default:T(()=>[X.value?(d(),t("div",Vs,[a("div",Hs,[c[58]||(c[58]=a("div",{class:"absolute top-2 left-1/2 -translate-x-1/2 w-10 h-1 bg-white/20 rounded-full"},null,-1)),a("div",Rs,[a("div",$s,[c[56]||(c[56]=a("div",{class:"w-8 h-8 rounded-lg bg-gradient-to-br from-[#8b5cf6] to-[#a855f7] flex items-center justify-center"},[a("svg",{class:"w-4 h-4 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 10V3L4 14h7v7l9-11h-7z"})])],-1)),a("div",null,[c[55]||(c[55]=a("p",{class:"text-xs font-bold text-white"},"Quick Summary",-1)),a("p",Ws," Updated "+i(at.value.generatedAt),1)])]),a("button",{onClick:c[13]||(c[13]=e=>X.value=!1),class:"p-2 rounded-lg bg-white/5 active:bg-white/10"},c[57]||(c[57]=[a("svg",{class:"w-5 h-5 text-white/60",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))])]),a("div",qs,[a("div",Gs,[a("div",Xs,[c[59]||(c[59]=a("div",{class:"w-2 h-2 rounded-full bg-[#a855f7] animate-pulse"},null,-1)),a("span",Zs,i(at.value.marketStatus),1),at.value.isWeekend?(d(),t("span",Ks,"WEEKEND")):o("",!0)]),a("p",Js,i(at.value.marketAdvice),1),at.value.sessionOverlap?(d(),t("p",Qs,i(at.value.sessionOverlap),1)):o("",!0)]),at.value.opportunities.length>0?(d(),t("div",el,[c[61]||(c[61]=a("p",{class:"text-[10px] font-semibold text-[#00f6ff] mb-2 uppercase tracking-wide"}," Key Insights ",-1)),a("div",tl,[(d(!0),t(s,null,l(at.value.opportunities,(e,s)=>(d(),t("div",{key:s,class:r(["flex items-start gap-2 p-2 rounded-lg border",{"bg-[#00d26a]/[0.08] border-[#00d26a]/20":"long"===e.type,"bg-[#ff4757]/[0.08] border-[#ff4757]/20":"short"===e.type,"bg-[#fbbf24]/[0.08] border-[#fbbf24]/20":"warning"===e.type,"bg-white/[0.03] border-white/[0.06]":"info"===e.type}])},["long"===e.type||"short"===e.type?(d(),t("span",{key:0,class:r(["flex-shrink-0 px-1.5 py-0.5 rounded text-[8px] font-bold uppercase","long"===e.type?"bg-[#00d26a]/30 text-[#00d26a]":"bg-[#ff4757]/30 text-[#ff4757]"])},i(e.type),3)):"warning"===e.type?(d(),t("span",al," ⚠️ ")):(d(),t("svg",sl,c[60]||(c[60]=[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)]))),a("span",{class:r(["text-[10px]",{"text-[#00d26a]":"long"===e.type,"text-[#ff4757]":"short"===e.type,"text-[#fbbf24]":"warning"===e.type,"text-white/80":"info"===e.type}])},i(e.text),3)],2))),128))])])):o("",!0),at.value.volumeSpikes.length>0?(d(),t("div",ll,[c[63]||(c[63]=a("p",{class:"text-[10px] font-semibold text-[#f472b6] mb-1.5 uppercase tracking-wide"}," Volume Spikes ",-1)),a("div",rl,[(d(!0),t(s,null,l(at.value.volumeSpikes,e=>(d(),t("div",{key:e.symbol,class:"flex items-center justify-between px-2 py-1.5 rounded-lg bg-[#f472b6]/[0.06] border border-[#f472b6]/[0.1]"},[a("div",ol,[a("span",nl,i(e.symbol),1),c[62]||(c[62]=a("span",{class:"text-[9px] text-white/40"},"unusual activity",-1))]),a("span",{class:r(["text-[10px] font-bold",e.change>=0?"text-[#00d26a]":"text-[#ff4757]"])},i(e.change>=0?"+":"")+i(e.change.toFixed(1))+"%",3)]))),128))])])):o("",!0),a("div",il,[a("div",null,[c[64]||(c[64]=a("p",{class:"text-[10px] font-semibold text-[#00d26a] mb-1.5 uppercase tracking-wide"}," Top Gainers ",-1)),a("div",dl,[(d(!0),t(s,null,l(at.value.gainers,e=>(d(),t("div",{key:e.symbol,class:"flex items-center justify-between px-2 py-1.5 rounded-lg bg-[#00d26a]/[0.06] border border-[#00d26a]/[0.1]"},[a("span",cl,i(e.symbol),1),a("span",ul,"+"+i(e.change.toFixed(1))+"%",1)]))),128))])]),a("div",null,[c[65]||(c[65]=a("p",{class:"text-[10px] font-semibold text-[#ff4757] mb-1.5 uppercase tracking-wide"}," Top Losers ",-1)),a("div",fl,[(d(!0),t(s,null,l(at.value.losers,e=>(d(),t("div",{key:e.symbol,class:"flex items-center justify-between px-2 py-1.5 rounded-lg bg-[#ff4757]/[0.06] border border-[#ff4757]/[0.1]"},[a("span",pl,i(e.symbol),1),a("span",vl,i(e.change.toFixed(1))+"%",1)]))),128))])])]),at.value.fundingOpps.length>0?(d(),t("div",hl,[c[66]||(c[66]=a("p",{class:"text-[10px] font-semibold text-[#fbbf24] mb-1.5 uppercase tracking-wide"}," Funding Rates ",-1)),a("div",bl,[(d(!0),t(s,null,l(at.value.fundingOpps,e=>(d(),t("div",{key:e.symbol,class:"flex items-center justify-between px-2 py-1.5 rounded-lg bg-[#fbbf24]/[0.06] border border-[#fbbf24]/[0.1]"},[a("div",ml,[a("span",xl,i(e.symbol),1),a("span",gl,i(e.direction),1)]),a("span",{class:r(["text-[10px] font-bold",e.rate>0?"text-[#00d26a]":"text-[#ff4757]"])},i(e.rate>0?"+":"")+i(e.rate.toFixed(4))+"%",3)]))),128))])])):o("",!0),at.value.upcomingEvts.length>0?(d(),t("div",yl,[c[67]||(c[67]=a("p",{class:"text-[10px] font-semibold text-[#ef4444] mb-1.5 uppercase tracking-wide"}," Upcoming Events ",-1)),a("div",wl,[(d(!0),t(s,null,l(at.value.upcomingEvts,e=>(d(),t("div",{key:e.event,class:"flex items-center gap-2 px-2 py-1.5 rounded-lg bg-white/[0.03] border border-white/[0.06]"},[a("div",{class:r(["w-1 h-6 rounded-full","HIGH"===e.impact?"bg-red-500":"bg-yellow-500"])},null,2),a("div",kl,[a("span",Sl,i(e.event),1),a("span",Tl,i(e.time),1)]),a("span",{class:r(["text-[8px] font-bold px-1.5 py-0.5 rounded","HIGH"===e.impact?"bg-red-500/20 text-red-400":"bg-yellow-500/20 text-yellow-400"])},i(e.impact),3)]))),128))])])):o("",!0)])])):o("",!0)]),_:1})])):o("",!0)]),_:1})])),(d(),x(M,{to:"body"},[K.value?(d(),t("div",_l,[a("div",{class:"absolute inset-0 bg-black/80",onClick:c[15]||(c[15]=e=>K.value=!1)}),a("div",Ml,[a("div",Cl,[c[69]||(c[69]=a("div",{class:"flex items-center gap-3"},[a("div",{class:"w-10 h-10 rounded-full bg-[#00f6ff]/20 flex items-center justify-center"},[a("span",{class:"text-lg font-bold text-[#00f6ff]"},"Aa")]),a("div",null,[a("div",{class:"text-white font-semibold"},"Text Size"),a("div",{class:"text-white/[0.42] text-xs"},"Adjust for readability")])],-1)),a("button",{onClick:c[16]||(c[16]=e=>K.value=!1),class:"p-2 rounded-lg hover:bg-white/10"},c[68]||(c[68]=[a("svg",{class:"w-5 h-5 text-white/[0.42]",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),a("div",Dl,[(d(),t(s,null,l(J,e=>a("button",{key:e.value,onClick:t=>(e=>{Q.value=e;try{localStorage.setItem("mobile_text_size",e)}catch(t){console.error("Failed to save text size:",t)}te(e),K.value=!1})(e.value),class:r(["w-full flex items-center justify-between p-3 rounded-[6px] border",Q.value===e.value?"bg-[#00f6ff]/15 border-[#00f6ff]/50":"bg-white/5 border-white/10"])},[a("div",Ul,[a("span",{class:r(["font-bold",Q.value===e.value?"text-[#00f6ff]":"text-white"]),style:g({fontSize:e.preview})},"Aa",6),a("span",{class:r(Q.value===e.value?"text-[#00f6ff]":"text-white/70")},i(e.label),3)]),Q.value===e.value?(d(),t("div",Ll,c[70]||(c[70]=[a("svg",{class:"w-3 h-3 text-black",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"3",d:"M5 13l4 4L19 7"})],-1)]))):o("",!0)],10,Pl)),64))]),a("div",jl,[c[71]||(c[71]=a("div",{class:"text-white/[0.42] text-xs mb-1"},"Preview",-1)),a("div",{class:"text-white",style:g({fontSize:ee.value})}," BTC/USDT +2.45% ",4)])])])):o("",!0)]))]),m(_e,{"is-open":Z.value,onClose:c[17]||(c[17]=e=>Z.value=!1)},null,8,["is-open"])],32))}}),Bl=F(Nl,[["__scopeId","data-v-d1fa65ca"]]),Fl={class:"flex flex-col items-center"},El={class:"text-xs text-[#00f6ff] mt-1"},Yl={class:"bg-[#070b15] border-b border-white/[0.06] px-3 py-2"},Il={class:"flex items-center gap-2"},Vl={class:"w-8 h-8 rounded-full flex items-center justify-center overflow-hidden flex-shrink-0 bg-white/20 backdrop-blur-sm border border-white/30"},Hl=["src","alt"],Rl={class:"text-left"},$l={class:"flex items-center gap-1 text-scalable"},Wl={class:"text-sm font-bold text-white"},ql={class:"flex gap-1.5 mt-2"},Gl=["onClick"],Xl={class:"relative px-4"},Zl={class:"relative"},Kl={class:"absolute left-0 right-0 top-0 w-full bg-[#060a12] border border-[#00f6ff]/30 rounded-[6px] shadow-lg shadow-black/50 max-h-[500px] overflow-hidden z-[100]"},Jl={class:"px-4 py-3 bg-[#090f1d] border-b border-[#00f6ff]/20 sticky top-0 z-10"},Ql={class:"relative"},er={class:"px-4 py-2 bg-[#090f1d] border-b border-[#00f6ff]/20 sticky top-[60
1px] z-10 flex items-center justify-between"},tr={class:"overflow-y-auto max-h-[280px] scrollbar-hide"},ar={class:"relative w-full px-4 py-2 hover:bg-[#0d1424]/50 transition-colors"},sr=["onClick"],lr={class:"relative grid grid-cols-12 gap-2 items-center pointer-events-none"},rr={class:"col-span-1 flex items-center justify-center pointer-events-auto"},or=["onClick"],nr={class:"col-span-4 flex items-center gap-2"},ir={class:"w-6 h-6 rounded-full flex items-center justify-center overflow-hidden flex-shrink-0 bg-white/10 backdrop-blur-sm border border-white/20"},dr=["src","alt","onError"],cr={class:"text-white text-sm font-bold"},ur={class:"col-span-4 text-right"},fr={class:"text-white/90 text-sm font-mono"},pr={class:"col-span-3 text-right"},vr={key:0,class:"px-4 py-8 text-center text-white/50 text-sm"},hr={class:"flex items-center gap-2"},br={class:"text-[10px] text-white/60"},mr={key:0},xr={key:1},gr={class:"flex w-full max-w-full h-[calc(100vh-200px)] overflow-hidden bg-transparent"},yr={class:"w-[35%] min-w-0 flex-shrink-0 border-r border-white/[0.06] flex flex-col bg-black/60"},wr={class:"flex-1 overflow-y-auto scrollbar-hide text-scalable"},kr=["onClick"],Sr={class:"text-[#eb5c57] relative z-10 w-[70px] font-mono font-semibold tabular-nums"},Tr={class:"text-white/50 relative z-10 flex-1 text-right text-[11px] font-mono tabular-nums"},_r={class:"px-2 py-2 border-y border-[#00f6ff]/20 bg-[#070b15]"},Mr={key:0,class:"w-4 h-4 flex-shrink-0",fill:"currentColor",viewBox:"0 0 20 20"},Cr={key:1,class:"w-4 h-4 flex-shrink-0",fill:"currentColor",viewBox:"0 0 20 20"},Dr={class:"text-[10px] text-white/40 flex items-center justify-center gap-1 mt-1"},Pr={class:"font-mono tabular-nums"},Ur={class:"flex-1 overflow-y-auto scrollbar-hide text-scalable"},Lr=["onClick"],jr={class:"text-[#5ec485] relative z-10 w-[70px] font-mono font-semibold tabular-nums"},zr={class:"text-white/50 relative z-10 flex-1 text-right text-[11px] font-mono tabular-nums"},Ar={class:"flex-1 min-w-0 flex flex-col overflow-hidden bg-black/60"},Or={class:"px-2 py-1.5 flex items-center gap-2 border-b border-[#00f6ff]/10 bg-[#0d1421]/80 backdrop-blur-sm relative z-10"},Nr={class:"relative"},Br={class:"text-orange-400 font-bold w-[30px] text-left"},Fr=["onClick","onTouchend"],Er={key:0,class:"w-3.5 h-3.5 text-orange-400",fill:"currentColor",viewBox:"0 0 20 20"},Yr={class:"flex items-center gap-1 px-2 py-1 bg-gradient-to-r from-green-500/10 to-green-600/10 border border-green-500/20 rounded-lg text-xs shadow-lg shadow-green-500/5"},Ir={class:"text-green-400 font-bold"},Vr={class:"flex border-b border-[#00f6ff]/10 bg-[#0a0f1a] relative z-0 h-[40px]"},Hr={key:0,class:"absolute inset-0 bg-gradient-to-t from-white/10 to-transparent"},Rr={key:0,class:"absolute inset-0 bg-gradient-to-t from-white/10 to-transparent"},$r={class:"flex-1 overflow-y-auto px-2 py-2 space-y-1.5 scrollbar-hide relative z-0"},Wr={class:"flex items-center gap-2"},qr={key:0,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Gr={key:1,class:"w-4 h-4",fill:"currentColor",viewBox:"0 0 24 24"},Xr={class:"flex items-center gap-2"},Zr={class:"text-[9px] text-white/50 font-medium flex items-center gap-1"},Kr={key:0,class:"text-emerald-400/60"},Jr={key:0,class:"flex items-center gap-1"},Qr={key:0,class:"text-yellow-400 text-[8px] opacity-80"},eo={key:2,class:"w-7 h-7 rounded-full flex items-center justify-center bg-emerald-500/20 flex-shrink-0"},to={class:"relative"},ao={class:"text-white font-semibold"},so={key:0,class:"absolute top-full left-0 right-0 mt-1 bg-[#060a12] border border-[#00f6ff]/20 rounded-[6px] shadow-2xl z-[99999] overflow-hidden"},lo={key:0,class:"w-3.5 h-3.5 text-[#00f6ff]",fill:"currentColor",viewBox:"0 0 20 20"},ro={key:0,class:"w-3.5 h-3.5 text-[#00f6ff]",fill:"currentColor",viewBox:"0 0 20 20"},oo={class:"px-3 py-2 text-center bg-[#060a12] border border-[#00f6ff]/10 rounded-[6px]"},no={class:"text-sm font-bold text-[#00f6ff]"},io={key:0,class:"flex flex-col gap-1"},co={class:"flex items-center gap-1 border border-[#00f6ff]/30 rounded-[6px] px-2.5 py-1.5 bg-[#060a12]"},uo={class:"relative"},fo={class:"flex gap-1.5 overflow-x-auto scrollbar-hide snap-x snap-mandatory pb-1 min-h-[32px]"},po=["onClick"],vo={class:"relative pr-16"},ho={class:"flex items-center justify-between mb-0.5"},bo={class:"px-2 py-0.5 bg-gradient-to-r from-[#00f6ff] to-[#1870f6] rounded text-[10px] font-bold text-black shadow-lg"},mo={class:"flex justify-between mt-0.5"},xo={class:"space-y-1.5 p-2 bg-[#060a12] border border-[#00f6ff]/10 rounded-[6px] mb-2"},go={class:"flex items-center gap-2 text-xs cursor-pointer group"},yo={class:"text-white/90 group-hover:text-white font-medium"},wo={class:"flex items-center gap-2 text-xs cursor-pointer group"},ko={class:"flex items-center gap-1 border border-green-400/30 rounded px-2 py-1 bg-green-500/5"},So={key:0,class:"grid grid-cols-2 gap-1 mt-0.5"},To={class:"bg-green-500/10 border border-green-500/30 py-1 px-2 rounded flex items-center justify-between"},_o={class:"text-green-400 font-semibold text-[10px]"},Mo={class:"bg-green-500/10 border border-green-500/30 py-1 px-2 rounded flex items-center justify-between"},Co={class:"text-green-400 font-semibold text-[10px]"},Do={class:"flex items-center gap-1 border border-red-400/30 rounded px-2 py-1 bg-red-500/5"},Po={key:0,class:"grid grid-cols-2 gap-1 mt-0.5"},Uo={class:"bg-red-500/10 border border-red-500/30 py-1 px-2 rounded flex items-center justify-between"},Lo={class:"text-red-400 font-semibold text-[10px]"},jo={class:"bg-red-500/10 border border-red-500/30 py-1 px-2 rounded flex items-center justify-between"},zo={class:"text-red-400 font-semibold text-[10px]"},Ao=["disabled"],Oo={key:0,class:"h-5 w-5 border-t-2 border-white animate-spin rounded-full"},No={key:0,class:"w-5 h-5 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Bo={key:1,class:"w-5 h-5 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Fo={key:0,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 7h8m0 0v8m0-8l-8 8-4-4-6 6"},Eo={key:1,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 17h8m0 0V9m0 8l-8-8-4 4-6-6"},Yo={class:"space-y-1 p-2 bg-[#060a12] border border-[#00f6ff]/10 rounded-[6px] text-scalable"},Io={class:"flex items-center justify-between text-[10px]"},Vo={class:"text-white font-bold"},Ho={class:"flex items-center justify-between text-[10px]"},Ro={class:"text-[#00f6ff] font-bold"},$o={class:"flex items-center justify-between text-[10px]"},Wo={class:"text-yellow-400 font-bold"},qo={class:"px-4 py-2.5 flex gap-3 border-b border-white/[0.06] bg-[#070b15]"},Go={key:0,class:"ml-1.5 px-1.5 py-0.5 bg-[#00f6ff] text-black rounded-full text-[9px] font-bold"},Xo={key:1,class:"px-4 py-3 pb-24 bg-transparent"},Zo={class:"grid grid-cols-3 gap-2 mb-3"},Ko={class:"bg-[#060a12] py-2 px-3 rounded-[6px] border border-[#1d2742] flex flex-col items-center justify-center"},Jo={class:"text-sm font-bold text-white"},Qo={class:"bg-[#060a12] py-2 px-3 rounded-[6px] border border-[#1d2742] flex flex-col items-center justify-center"},en={class:"text-sm font-bold text-white"},tn={class:"bg-[#060a12] py-2 px-3 rounded-[6px] border border-[#1d2742] flex flex-col items-center justify-center"},an={class:"flex items-center justify-between mb-3 p-2 bg-[#060a12] border border-[#1d2742] rounded-[6px]"},sn={class:"flex items-center gap-2 text-xs cursor-pointer group"},ln={key:0,class:"space-y-3"},rn=["onTouchstart","onTouchmove","onTouchend"],on={class:"flex items-center justify-between mb-3"},nn={class:"flex items-center gap-2"},dn={class:"font-bold text-sm text-white flex items-center gap-1"},cn={key:0,class:"text-[9px] px-1 py-0.5 bg-emerald-500/20 text-emerald-400 rounded"},un={class:"text-orange-400"},fn={class:"flex items-center justify-between text-xs mb-3 bg-[#0d1421]/50 rounded-lg p-2 border border-[#00f6ff]/10"},pn={class:"text-center"},vn={class:"text-white font-semibold"},hn={class:"text-center"},bn={class:"text-white font-semibold"},mn={class:"text-center"},xn={class:"text-white font-semibold"},gn={class:"text-center"},yn={class:"text-yellow-400 font-semibold"},wn={key:0,class:"flex gap-1.5 mb-3"},kn=["onClick"],Sn=["onClick"],Tn=["onClick"],_n={class:"grid grid-cols-3 gap-1.5"},Mn=["onClick"],Cn=["onClick"],Dn=["onClick"],Pn={key:1,class:"text-center text-white/50 py-8"},Un={class:"text-sm"},Ln={key:2,class:"px-4 py-4 pb-24"},jn={key:0,class:"mb-4"},zn={class:"text-xs text-emerald-400 font-semibold mb-2 flex items-center gap-1"},An={class:"space-y-2"},On={class:"flex items-center justify-between mb-2"},Nn={class:"font-semibold text-xs text-white flex items-center gap-1"},Bn={class:"flex items-center gap-2"},Fn={class:"text-right"},En={class:"text-xs text-white/50"},Yn=["onClick"],In={class:"grid grid-cols-3 gap-2 text-xs"},Vn={class:"text-white font-mono"},Hn={class:"text-center"},Rn={class:"text-white font-mono"},$n={class:"text-right"},Wn={class:"text-[#00f6ff] font-mono"},qn={key:1,class:"space-y-2"},Gn={class:"flex items-center justify-between mb-2"},Xn={class:"font-semibold text-xs text-white flex items-center gap-1"},Zn={class:"text-right"},Kn={class:"text-xs text-white/50"},Jn={class:"grid grid-cols-2 gap-2 text-xs"},Qn={class:"text-white"},ei={class:"text-right"},ti={class:"text-white"},ai={key:2,class:"text-center text-white/50 py-8"},si={key:0,class:"space-y-2"},li={class:"flex items-center justify-between mb-2"},ri={class:"font-semibold text-xs"},oi={class:"text-right"},ni={class:"text-xs text-white/50"},ii={class:"grid grid-cols-2 gap-2 text-xs"},di={class:"text-white"},ci={class:"text-right"},ui={class:"text-white"},fi={key:1,class:"text-center text-white/50 py-8"},pi={key:3,class:"px-4 py-4 pb-24"},vi={key:0,class:"space-y-2"},hi={class:"bg-gradient-to-br from-emerald-900/20 to-emerald-800/10 border border-emerald-500/20 rounded-lg p-4"},bi={class:"text-2xl font-bold text-emerald-400"},mi={class:"bg-gradient-to-br from-emerald-900/20 to-emerald-800/10 border border-emerald-500/20 rounded-lg p-4"},xi={class:"bg-gradient-to-br from-emerald-900/20 to-emerald-800/10 border border-emerald-500/20 rounded-lg p-4"},gi={class:"text-xl font-bold text-white"},yi={class:"bg-gradient-to-br from-emerald-900/20 to-emerald-800/10 border border-emerald-500/20 rounded-lg p-4"},wi={class:"grid grid-cols-2 gap-2 text-xs"},ki={class:"text-white font-bold"},Si={class:"text-white font-bold"},Ti={class:"text-red-400 font-bold"},_i={key:1,class:"space-y-2"},Mi={class:"bg-[#060a12] border border-[#00f6ff]/20 rounded-lg p-4"},Ci={class:"text-2xl font-bold text-green-400"},Di={class:"bg-[#060a12] border border-[#00f6ff]/30 rounded-[6px] p-4"},Pi={class:"text-2xl font-bold text-[#00f6ff]"},Ui={class:"bg-[#060a12] border border-[#00f6ff]/20 rounded-lg p-4"},Li={class:"text-xl font-bold text-white"},ji={class:"bg-[#060a12] border border-[#00f6ff]/20 rounded-lg p-4"},zi={class:"text-xl font-bold text-white"},Ai={class:"bg-[#060a12] border border-[#00f6ff]/20 rounded-lg p-4"},Oi={class:"w-full max-w-sm bg-[#060a12] rounded-[6px] border border-emerald-500/20 p-5"},Ni={class:"mb-4"},Bi={class:"flex gap-3"},Fi={class:"w-full max-w-sm bg-[#060a12] rounded-[6px] border border-emerald-500/20 p-5"},Ei={class:"mb-3"},Yi={class:"text-emerald-400 font-bold text-lg"},Ii={class:"mb-4"},Vi={class:"flex gap-2 mb-4"},Hi=["onClick"],Ri={class:"flex gap-3"},$i={class:"w-full bg-[#060a12] rounded-t-[6px] border-t border-[#00f6ff]/20 max-h-[80vh] overflow-y-auto"},Wi={class:"px-4 py-3 border-b border-[#00f6ff]/20 flex items-center justify-between sticky top-0 bg-[#060a12]"},qi={class:"text-lg font-bold text-white"},Gi={class:"px-4 py-4 space-y-3"},Xi={class:"flex items-center gap-2 bg-[#0d1424] rounded px-3 py-2"},Zi={class:"text-base font-bold text-white"},Ki={class:"grid grid-cols-2 gap-2"},Ji={class:"bg-[#0d1424] rounded px-3 py-2"},Qi={class:"text-sm font-semibold text-white"},ed={class:"bg-[#0d1424] rounded px-3 py-2"},td={class:"text-sm font-semibold text-white"},ad={key:0,class:"space-y-1"},sd={class:"flex items-center gap-2 bg-[#0d1424] border border-[#00f6ff]/20 rounded px-3 py-2"},ld={class:"space-y-2"},rd={class:"flex items-center justify-between text-sm"},od={class:"text-white font-semibold"}
1,nd=["max","step"],id={class:"grid grid-cols-5 gap-1"},dd=["onClick"],cd={class:"grid grid-cols-2 gap-2 pt-2"},ud=["disabled"],fd={key:0,class:"h-4 w-4 border-2 border-r-transparent border-[#0b1120] rounded-full animate-spin"},pd={key:1},vd={class:"w-full bg-[#060a12] rounded-t-[6px] border-t border-[#00f6ff]/20 max-h-[80vh] overflow-y-auto"},hd={class:"px-4 py-4 space-y-4"},bd={class:"flex items-center gap-2 bg-[#0d1424] rounded px-3 py-2"},md={class:"text-base font-bold text-white"},xd={class:"grid grid-cols-3 gap-2"},gd={class:"bg-[#0d1424] rounded px-3 py-2"},yd={class:"text-sm font-semibold text-white"},wd={class:"bg-[#0d1424] rounded px-3 py-2"},kd={class:"text-sm font-semibold text-white"},Sd={class:"bg-[#0d1424] rounded px-3 py-2"},Td={class:"text-sm font-semibold text-white"},_d={class:"space-y-2"},Md={class:"flex items-center justify-between"},Cd={key:0,class:"space-y-2"},Dd={class:"flex items-center gap-2 bg-[#0d1424] border border-green-500/30 rounded px-3 py-2"},Pd=["placeholder"],Ud={key:0,class:"bg-green-500/10 border border-green-500/30 rounded px-3 py-2"},Ld={class:"flex items-center justify-between text-xs"},jd={class:"text-green-400 font-semibold"},zd={class:"space-y-2"},Ad={class:"flex items-center justify-between"},Od={key:0,class:"space-y-2"},Nd={class:"flex items-center gap-2 bg-[#0d1424] border border-red-500/30 rounded px-3 py-2"},Bd=["placeholder"],Fd={key:0,class:"bg-red-500/10 border border-red-500/30 rounded px-3 py-2"},Ed={class:"flex items-center justify-between text-xs"},Yd={class:"text-red-400 font-semibold"},Id={class:"space-y-2"},Vd={class:"grid grid-cols-3 gap-2"},Hd=["onClick"],Rd={class:"grid grid-cols-2 gap-2 pt-2"},$d=["disabled"],Wd={key:0,class:"h-4 w-4 border-2 border-r-transparent border-white rounded-full animate-spin"},qd={key:1},Gd={key:0,class:"fixed inset-0 z-[9999] bg-[#090f1d]"},Xd={class:"w-full h-full"},Zd="@coinscreener.full",Kd=F(e({__name:"MobileTradeView",emits:["navigate-to-tab"],setup(e,{emit:p}){const k=I(),S=G(),C=E(),z=ve(),A=me(),O=Ue(),N=X(),B=Le(),F=c(()=>B.selectedExchange),Y=c(()=>"binance"===F.value||"mexc"===F.value);A.ensureStarted();const V=c(()=>N.isPaperMode),H=c(()=>N.virtualBalance),q=u(!1),le=u(!1),re=u(1e4),oe=u(0);function ne(){N.resetPaperAccount(re.value),q.value=!1,re.value=1e4}function ie(){if(oe.value>=0){const e=oe.value-N.virtualBalance;e>0?N.addBalance(e):e<0&&N.deductBalance(Math.abs(e)),J(`Balance set to $${oe.value.toFixed(2)}`,{type:"success",autoClose:2e3,position:"bottom-left"})}le.value=!1}function de(e){const t=e.replace("-",""),a=_e.value[t];return a?"$"+Se(a,2):"--"}const ce=c(()=>{let e=0;return N.paperPositions.forEach(t=>{const a=t.symbol.replace("-",""),s=+(_e.value[a]??0),l=t.size,r=t.entryPrice,o="LONG"===t.side?(s-r)*l:(r-s)*l;e+=o}),e}),fe=he(),pe=p,ge=u(!1),ye=W("token"),we=u(),ke=u({}),Te=c(()=>ke.value[k.token.label+"USDT"]),_e=u({}),Me=u(!1),Ce=c(()=>{var e;return(null==(e=k.token)?void 0:e.label)||"BTC"}),De=c(()=>{var e;return(null==(e=C.positions)?void 0:e.filter(e=>e.symbol===Ce.value))||[]}),Pe=u(!0),ze=e=>{const t=+e.leverage,a=+e.entryPrice;return t<=1?0:"LONG"===e.side?a*(1-1/t+.005):a*(1+1/t-.005)},Ae=c(()=>{if(V.value){const e=N.paperPositions.map(e=>({...e,entryPrice:String(e.entryPrice),size:String(e.size),leverage:String(e.leverage),isPaper:!0,liquidation:ze(e),fundingFee:"0",fee:"0",customInitialMarginRate:String(1/e.leverage)})).filter(e=>{const t=e.symbol.replace("-","");return+(_e.value[t]??0)>0});return Pe.value?e:e.filter(e=>e.symbol===Ce.value+"-USDT")}return((Pe.value?C.positions:De.value)||[]).filter(e=>{const t=e.symbol.replace("-","");return+(_e.value[t]??0)>0})}),Oe=e=>{const t=e.replace("-","");return+(_e.value[t]??0)},Ne=e=>{const t=Oe(e.symbol),a=+e.size,s=+e.entryPrice;return"LONG"===e.side?(t-s)*a:(s-t)*a},Be=e=>e.isPaper?+e.leverage:e.customInitialMarginRate?Math.round(1/+e.customInitialMarginRate):1,Fe=c(()=>{const e=Ae.value;let t=0,a=0;return e.forEach(e=>{const s=Oe(e.symbol),l=+e.size;t+=l*s,a+=Ne(e)}),{totalValue:t.toFixed(2),totalPnl:a}}),Ee=c(()=>{var e;return 100*+((null==(e=Te.value)?void 0:e.pr)??0)}),Ye=u("market"),Ie=u("position"),Ve=u(0),He=u("true"===localStorage.getItem("useAllBalances")),Re=c(()=>{var e,t;return V.value?H.value:He.value?Number((null==(e=C.balance)?void 0:e.totalValueWithoutDiscount)??0):Number((null==(t=C.balance)?void 0:t.availableBalance)??0)});b(He,e=>{localStorage.setItem("useAllBalances",e?"true":"false")});const $e=u(!1),We=u(0),qe=u(!1),Ge=u(!1),Xe=u(!1),Ze=u(!1),Ke=u(""),Je=u(!1),Qe=u(!1),{decide:et}=Z(),tt=u(et()),at=c(()=>{const e=tt.value;return"LONG_READY"===e.kind?"Long":"SHORT_READY"===e.kind?"Short":"Neutral"}),st=c(()=>{const e=tt.value;return(null==e?void 0:e.entry)??0}),lt=c(()=>{var e;const t=tt.value;return(null==(e=null==t?void 0:t.tps)?void 0:e[0])??0}),rt=c(()=>{const e=tt.value;return(null==e?void 0:e.stop)??0});b(()=>{var e,t,a;return[null==k?void 0:k.price,null==(e=null==k?void 0:k.ohlcv)?void 0:e[null==k?void 0:k.timeframe],null==(t=null==z?void 0:z.data)?void 0:t["@coinscreener.full"],null==(a=null==z?void 0:z.data)?void 0:a["@prices.500ms"],null==S?void 0:S.apexMinusBinanceSpread,null==S?void 0:S.candles]},()=>{const e=et();JSON.stringify(e)!==JSON.stringify(tt.value)&&(tt.value=e)},{deep:!0});const ot=[10,25,50,100],nt=()=>{const e=Re.value;Mt.value.size.quantity=e,Mt.value.size.quote="USDT",Ve.value=100},it=u(0),dt=u({}),ct=u(null),ut=e=>{Ye.value="limit",Mt.value.market="Limit",Mt.value.orderPrice=e,J(`Limit price set to ${e}`,{type:"info",autoClose:1500,position:"bottom-left"})},ft=async(e,t)=>{var a;const s=1===t?Number(e.size):oa(Number(e.size)*t);kt.value={type:"Market",position:e,closePrice:+((null==(a=Te.value)?void 0:a.p)??0),closeSize:s},await ea()}
1,pt=u(0),vt=u(!1),ht=u(0),bt=u(0),mt=e=>{const t=e.target.closest(".overflow-y-auto");bt.value=(null==t?void 0:t.scrollTop)||0,ht.value=e.touches[0].clientY},xt=e=>{if(bt.value>0)return;const t=e.touches[0].clientY-ht.value;t>0&&(pt.value=Math.min(t,100))},gt=async()=>{if(pt.value>=80&&!vt.value){vt.value=!0;try{await ua(),await ca()}catch(e){console.error("Refresh failed:",e)}setTimeout(()=>{vt.value=!1,pt.value=0},1e3)}else pt.value=0},yt=u(!1),wt=u(!1),kt=u({type:"Market",position:null,closePrice:0,closeSize:0}),St=u(!1),Tt=u(!1),_t=u({position:null,enableTp:!1,enableSl:!1,tpPrice:0,slPrice:0,triggerPriceType:"MARK"}),Mt=u({market:"Market",side:"Buy",size:{quantity:0,quote:"USDT"},tpsl:!1,tpPrice:0,slPrice:0,orderPrice:0,triggerPrice:0,triggerPriceType:"MARK",isPositionTpsl:!1,reduceOnly:!1}),Ct=c(()=>{var e,t,a,s,l,r;let o;C.positions.map(e=>{e.symbol==k.token.label+"-USDT"&&("Buy"==Mt.value.side&&"LONG"==e.side||"Sell"==Mt.value.side&&"SHORT"==e.side)&&(o=e)});const n=null==(e=we.value)?void 0:e.contractWallets.reduce((e,t)=>e+ +t.balance,0).toFixed(2),i=+((null==(t=Te.value)?void 0:t.p)??0),d=+((null==(a=C.symbol)?void 0:a.maintenanceMarginRate)??0),c=i*(1+("Buy"==Mt.value.side?-1:1)*(1/+C.leverage-d)),u="USDT"==Mt.value.size.quote?null==(s=Mt.value)?void 0:s.size.quantity:(null==(l=Mt.value)?void 0:l.size.quantity)*+((null==(r=Te.value)?void 0:r.p)??0)/+C.leverage;return{activePair:o,requiredMargin:u,totalEquity:n,liquidation:c}}),Dt=c(()=>{var e;const t=+((null==(e=Te.value)?void 0:e.p)??0),a=Mt.value.tpPrice,s=Mt.value.size.quantity,l=+C.leverage,r=Mt.value.side;if(!a||!s||!t)return{dollars:0,percentage:0};const o="Limit"===Mt.value.market&&Mt.value.orderPrice>0?Mt.value.orderPrice:t,n="USDT"===Mt.value.size.quote?s*l/o:s;let i=0;i="Buy"===r?(a-o)*n:(o-a)*n;const d="USDT"===Mt.value.size.quote?s:s*o/l;return{dollars:i,percentage:d>0?i/d*100:0}}),Pt=c(()=>{var e;const t=+((null==(e=Te.value)?void 0:e.p)??0),a=Mt.value.slPrice,s=Mt.value.size.quantity,l=+C.leverage,r=Mt.value.side;if(!a||!s||!t)return{dollars:0,percentage:0};const o="Limit"===Mt.value.market&&Mt.value.orderPrice>0?Mt.value.orderPrice:t,n="USDT"===Mt.value.size.quote?s*l/o:s;let i=0;i="Buy"===r?(a-o)*n:(o-a)*n;const d="USDT"===Mt.value.size.quote?s:s*o/l;return{dollars:i,percentage:d>0?i/d*100:0}}),Ut=u([]),Lt=u([]),jt=c(()=>`${Ce.value}[email protected]`),zt=e=>e>=1e3||e>=100?2:e>=10?3:e>=1?4:e>=.1?5:e>=.01?6:e>=.001?7:8,At=c(()=>{const e=Math.max(...Ut.value.slice(0,10).map(e=>e.available),1);return Ut.value.slice(0,10).reverse().map(t=>{const a=zt(t.price);return{price:t.price.toFixed(a),total:t.available.toFixed(3),width:`${Math.min(t.available/e*100,100)}%`}})}),Ot=c(()=>{const e=Math.max(...Lt.value.slice(0,10).map(e=>e.available),1);return Lt.value.slice(0,10).map(t=>{const a=zt(t.price);return{price:t.price.toFixed(a),total:t.available.toFixed(3),width:`${Math.min(t.available/e*100,100)}%`}})}),Nt=c(()=>{if(Lt.value.length>0){const e=Lt.value[0].price,t=zt(e);return e.toFixed(t)}return"0.00"}),Bt=u(!1),Ft=()=>{Bt.value=!0},Et=()=>{Bt.value=!1},Yt=e=>{We.value=e.touches[0].clientY,qe.value=!1},It=e=>{Math.abs(e.touches[0].clientY-We.value)>10&&(qe.value=!0)},Vt=async e=>{var t,a,s;try{$e.value=!1;const a=1/e,{data:s}=await xe.post("https://stream.eagleailabs.com/p/v1/trades/apex/set-initial-margin/",{symbol:(null==(t=C.symbol)?void 0:t.symbol)||k.token.label+"-USDT",rate:a.toString()},{headers:{Authorization:"Bearer "+ye}});C.updateLeverage(e),C.fireTrigger(),J(s.message,{type:"info",autoClose:1500,position:"bottom-left"})}catch(l){console.error("❌ Leverage error:",l),J((null==(s=null==(a=l.response)?void 0:a.data)?void 0:s.message)||l.message||"Failed to set leverage",{type:"error",autoClose:2500,position:"bottom-left"})}},Ht=c(()=>{var e;return((null==(e=z.data)?void 0:e[Zd])||[]).map(e=>({symbol:String(e.symbol||""),dailyChange:be(String(e.symbol||""),e,!0),lastPrice:Number(e.lastPrice??0),tradingVolume:Number(e.tradingVolume??0),marketCap:(()=>{const t=parseFloat(String(e.marketCap??e.market_cap??"NaN"));return Number.isFinite(t)?t:void 0})()}))}),Rt=c(()=>{let e=Ht.value;return e=e.filter(e=>!R(e.symbol)),e});function $t(e,t){const a=String(e||"").toUpperCase(),s=A.get(a),l=null==s?void 0:s.quote;return null!=l&&isFinite(l)?Number(l):Number(t||0)}const Wt=c(()=>{const e=Rt.value,t=new Map(e.map(e=>[e.symbol.toUpperCase(),e])),a=[],s=new Set,l=e=>{if(!e)return;const l=t.get(e.toUpperCase());l&&!s.has(l.symbol)&&(s.add(l.symbol),a.push(l))},r=[["BTCUSDT"],["ETHUSDT"],["SOLUSDT"],["XRPUSDT"],["DOGEUSDT"],["TRXUSDT"],["ADAUSDT"],["HYPEUSDT","HLPUSDT","HLUSDT","HYPE
1RLIQUIDUSDT"],["LINKUSDT"],["AVAXUSDT"],["BCHUSDT"],["HBARUSDT"]];for(const d of r){let e=!1;for(const a of d)if(t.has(a)){l(a),e=!0;break}}const o=e.filter(e=>!s.has(e.symbol)).sort((e,t)=>{const a=$t(e.symbol,e.tradingVolume);return $t(t.symbol,t.tradingVolume)-a}),n=o.slice(0,40),i=o.slice(40);return a.push(...n),a.push(...i),a.map(e=>{return{symbol:e.symbol.replace("USDT","").replace("USDC","").trim(),price:Number(e.lastPrice||0).toFixed(2),volume:(t=Number(e.tradingVolume||0),t>=1e9?`$${(t/1e9).toFixed(1)}B`:t>=1e6?`$${(t/1e6).toFixed(1)}M`:t>=1e3?`$${(t/1e3).toFixed(1)}K`:`$${t.toFixed(0)}`),change:e.dailyChange,dailyChange:e.dailyChange,lastPrice:e.lastPrice,tradingVolume:e.tradingVolume,marketCap:e.marketCap};var t})}),qt=c(()=>{let e=Wt.value;return Ze.value&&(e=e.sort((e,t)=>(t.change||0)-(e.change||0))),e}),Gt=(e,t)=>{e.target.style.display="none"},Xt=c(()=>qt.value.filter(e=>O.has(e.symbol+"USDT"))),Zt=c(()=>{let e=qt.value;if(Je.value&&(e=e.filter(e=>O.has(e.symbol+"USDT"))),Ke.value.trim()){const t=Ke.value.toLowerCase().trim();e=e.filter(e=>e.symbol.toLowerCase().includes(t))}return e}),Kt=e=>Math.abs(Number((null==e?void 0:e.size)??0)),Jt=(e,t)=>{var a;const s=Kt(t);kt.value={type:e,position:t,closePrice:+((null==(a=Te.value)?void 0:a.p)??0),closeSize:s},yt.value=!0},Qt=()=>{yt.value=!1,kt.value={type:"Market",position:null,closePrice:0,closeSize:0}},ea=async()=>{var e,t,a,s,l,r;try{wt.value=!0;const a=kt.value.position;if(!a)return;if(V.value&&a.isPaper){const t=+((null==(e=Te.value)?void 0:e.p)??0),s=kt.value.closeSize||a.size,l=s<a.size,r=je.closePosition(a.id,t,s);if(r.success){const e=l?`Partially closed ${Se(s,4)} with P&L: $${Se(r.pnl||0,2)}`:`Paper position closed with P&L: $${Se(r.pnl||0,2)}`;J(e,{type:"success",autoClose:2500,position:"bottom-left"})}else J(r.error||"Failed to close paper position",{type:"error",autoClose:2500,position:"bottom-left"});return void Qt()}const s=Math.abs(Number(kt.value.closeSize)),l={symbol:a.symbol,side:"LONG"===a.side?"SELL":"BUY",size:oa(s),type:kt.value.type.toUpperCase(),reduceOnly:!0};"Limit"===kt.value.type&&(l.price=na(kt.value.closePrice));const{data:r}=await xe.post("https://stream.eagleailabs.com/p/v1/trades/apex/new",l,{headers:{Authorization:"Bearer "+ye}});if(!1===r.status)return void J((null==(t=r.data)?void 0:t.msg)||r.message||"Failed to close position",{type:"info",autoClose:2500,position:"bottom-left"});J(r.message||"Position closed successfully",{type:"success",autoClose:2500,position:"bottom-left"});const o=C.positions.filter(e=>!(e.symbol===a.symbol&&e.side===a.side));C.updatePositions(o),C.fireTrigger(),Qt()}catch(o){console.error("❌ Close position error:",o);const e=(null==(s=null==(a=o.response)?void 0:a.data)?void 0:s.message)||(null==(r=null==(l=o.response)?void 0:l.data)?void 0:r.msg)||o.message||"Failed to close position";J(e,{type:"error",autoClose:2500,position:"bottom-left"})}finally{wt.value=!1}},ta=()=>{St.value=!1,_t.value={position:null,enableTp:!1,enableSl:!1,tpPrice:0,slPrice:0,triggerPriceType:"MARK"}},aa=e=>{const t=_t.value.position;if(!t)return 0;const a=Number(t.entryPrice),s=Number(t.size);let l=0;return l="LONG"===t.side?(e-a)*s:(a-e)*s,l},sa=e=>{const t=_t.value.position;if(!t)return 0;const a=Number(t.entryPrice),s=Number(C.leverage);let l=0;return l="LONG"===t.side?(e-a)/a*100:(a-e)/a*100,l*s},la=async()=>{var e,t,a,s,l,r,o,n,i,d;try{Tt.value=!0;const a=_t.value.position;if(!a)return;const s=[];if(V.value&&a.isPaper){const e=a.id;if(!e)return void J("Position not found",{type:"error",autoClose:2500,position:"bottom-left"});const t={};return _t.value.enableTp&&_t.value.tpPrice>0&&(t.tpPrice=_t.value.tpPrice,s.push("Take Profit")),_t.value.enableSl&&_t.value.slPrice>0&&(t.slPrice=_t.value.slPrice,s.push("Stop Loss")),void(Object.keys(t).length>0?(N.updatePosition(e,t),J(`📝 ${s.join(" & ")} set on paper position!`,{type:"success",autoClose:2500,position:"bottom-left"}),ta()):J("Please enable and set a price for TP or SL",{type:"info",autoClose:2500,position:"bottom-left"}))}const l={size:String(a.size),side:"LONG"===a.side?"SELL":"BUY",triggerPriceType:_t.value.triggerPriceType};_t.value.enableTp&&_t.value.tpPrice>0&&(l.tpPrice=na(_t.value.tpPrice)),_t.value.enableSl&&_t.value.slPrice>0&&(l.slPrice=na(_t.value.slPrice));const r="https://stream.eagleailabs.com/p/v1/trades/apex/"+a.symbol,{data:o}=await xe.put(r,l,{headers:{Authorization:"Bearer "+ye}});if(Array.isArray(null==(e=o.data)?void 0:e.message))o.data.message.forEach(e
1=>{J(e,{type:"info",position:"bottom-left",autoClose:3e3})}),C.fireTrigger(),ta();else{if(!1===o.status)throw new Error((null==(t=o.data)?void 0:t.message)||o.message||"Failed to set TP/SL");J("✅ TP/SL set successfully!",{type:"success",autoClose:2500,position:"bottom-left"}),C.fireTrigger(),ta()}}catch(c){console.error("❌ TP/SL error:",c),console.error("❌ TP/SL error response data:",null==(a=null==c?void 0:c.response)?void 0:a.data);const e=(null==(r=null==(l=null==(s=c.response)?void 0:s.data)?void 0:l.data)?void 0:r.msg)||(null==(n=null==(o=c.response)?void 0:o.data)?void 0:n.message)||(null==(d=null==(i=c.response)?void 0:i.data)?void 0:d.msg)||c.message||"Failed to set TP/SL";J(e,{type:"error",autoClose:5e3,position:"bottom-left"})}finally{Tt.value=!1}},ra=e=>Mt.value.side=e,oa=e=>{var t,a;const s=parseFloat((null==(t=C.symbol)?void 0:t.stepSize)||"0.01"),l=(null==(a=s.toString().split(".")[1])?void 0:a.length)||0,r=Math.pow(10,l),o=Math.floor(e*r),n=Math.floor(s*r);return Math.floor(o/n)*n/r},na=e=>{var t,a;if(!e||e<=0)return e;const s=parseFloat((null==(t=C.symbol)?void 0:t.tickSize)||"0.01"),l=(null==(a=s.toString().split(".")[1])?void 0:a.length)||0,r=Math.pow(10,l),o=Math.round(e*r),n=Math.round(s*r);return Math.round(o/n)*n/r},ia=e=>{Mt.value.size.quote="USDT";const t=e.target,a=Re.value,s=+C.leverage,l=a*(+(t.value??0)/100)/(1+5e-4*s);Mt.value.size.quantity=Math.round(100*l)/100};b(Ye,e=>{"market"===e?Mt.value.market="Market":"limit"===e&&(Mt.value.market="Limit")});const da=async()=>{var e,t,a,s,l,r,o,n,i,d,c,u,f,p,v;try{if(ge.value=!0,V.value){const{size:s,side:l,orderPrice:r,tpPrice:o,slPrice:n}=Mt.value,i=(null==(e=C.symbol)?void 0:e.symbol)||k.token.label+"-USDT",d=+((null==(t=Te.value)?void 0:t.p)??0),c=+C.leverage,u="USDT"===s.quote?s.quantity*c/d:s.quantity,f=oa(u);if(!f||f<=0)return J("Invalid order size",{type:"error",autoClose:2500,position:"bottom-left"});if("Limit"===Mt.value.market){if(!r||r<=0)return J("Please enter a limit price",{type:"error",autoClose:2500,position:"bottom-left"});const e=je.placeLimitOrder({symbol:i,side:"Buy"===l?"BUY":"SELL",size:f,price:r,leverage:c,reduceOnly:!1});e.success?J("Paper limit order placed!",{type:"success",autoClose:2500,position:"bottom-left"}):J(e.error||"Failed to place paper order",{type:"error",autoClose:2500,position:"bottom-left"})}else{const e=je.executeMarketOrder({symbol:i,side:"Buy"===l?"BUY":"SELL",size:f,currentPrice:d,leverage:c,tpPrice:o||void 0,slPrice:n||void 0});e.success?J(`Paper ${l.toLowerCase()} executed @ ${Se((null==(a=e.position)?void 0:a.entryPrice)||d,2)}`,{type:"success",autoClose:2500,position:"bottom-left"}):J(e.error||"Failed to execute paper order",{type:"error",autoClose:2500,position:"bottom-left"})}return Mt.value.size.quantity=0,Mt.value.orderPrice=0,Ve.value=0,void ae()}switch(J("Placing order...",{type:"info",autoClose:1500,position:"bottom-left"}),Mt.value.market){case"Limit":{const{size:e,side:t,orderPrice:a,tpPrice:i,slPrice:d,reduceOnly:c}=Mt.value;if(!e.quantity||!t||!a||a<=0)return J("Missing required fields (size, side, or price)",{type:"info",autoClose:2500,position:"bottom-left"});const u="USDT"===e.quote?e.quantity*+C.leverage/+((null==(s=Te.value)?void 0:s.p)??1):e.quantity,f=oa(u),p=na(a),v=i>0?na(i):void 0,h=d>0?na(d):void 0,b={symbol:(null==(l=C.symbol)?void 0:l.symbol)||k.token.label+"-USDT",side:t.toUpperCase(),size:f,type:"LIMIT",orderPrice:p,reduceOnly:c};v&&(b.tpPrice=v),h&&(b.slPrice=h);const{data:m}=await xe.post("https://stream.eagleailabs.com/p/v1/trades/apex/new/",b,{headers:{Authorization:"Bearer "+ye}});if(0==m.status){const e=(null==(r=m.data)?void 0:r.msg)||(null==(o=m.data)?void 0:o.key)||m.message||"Order failed";return J(e,{type:"info",autoClose:2500,position:"bottom-left"})}const x=(null==(n=C.symbol)?void 0:n.symbol)||k.token.label+"-USDT",g="BUY"===t.toUpperCase()?"LONG":"SHORT";se(x,g,+C.leverage),J(m.message,{type:"success",autoClose:2500,position:"bottom-left"}),C.fireTrigger(),Mt.value.size.quantity=0,Mt.value.orderPrice=0,Ve.value=0,ae();break}
1default:{const{size:e,side:t,tpPrice:a,slPrice:s,isPositionTpsl:l,reduceOnly:r}=Mt.value;if(!e.quantity||!t)return J("Missing required fields",{type:"info",autoClose:2500,position:"bottom-left"});const o="USDT"===e.quote?e.quantity*+C.leverage/+((null==(i=Te.value)?void 0:i.p)??1):e.quantity,n=oa(o),v=+((null==(d=Te.value)?void 0:d.p)??0),h=.05,b=na("Buy"===t?v*(1+h):v*(1-h)),m=a>0?na(a):a,x=s>0?na(s):s,{data:g}=await xe.post("https://stream.eagleailabs.com/p/v1/trades/apex/new/",{symbol:(null==(c=C.symbol)?void 0:c.symbol)||k.token.label+"-USDT",side:t.toUpperCase(),size:n,type:l?"TAKE_PROFIT_MARKET":"MARKET",price:b,tpPrice:m,slPrice:x,isPositionTpsl:l,reduceOnly:r},{headers:{Authorization:"Bearer "+ye}});if(0==g.status){const e=(null==(u=g.data)?void 0:u.msg)||(null==(f=g.data)?void 0:f.key)||g.message||"Order failed";return J(e,{type:"info",autoClose:2500,position:"bottom-left"})}const y=(null==(p=C.symbol)?void 0:p.symbol)||k.token.label+"-USDT",w="BUY"===t.toUpperCase()?"LONG":"SHORT";se(y,w,+C.leverage),J(g.message,{type:"success",autoClose:2500,position:"bottom-left"}),C.fireTrigger(),Mt.value.size.quantity=0,Ve.value=0,ae();break}}}catch(h){console.error("❌ Order placement error:",h);const e=null==(v=h.response)?void 0:v.data;if("connection pool exhausted"===(null==e?void 0:e.error))return console.warn("⚠️ Connection pool exhausted, but trade may have been placed. Refreshing positions..."),void C.fireTrigger();const t=(null==e?void 0:e.message)||(null==e?void 0:e.msg)||(null==e?void 0:e.error)||h.message||"Failed to place order";J(t,{type:"error",autoClose:2500,position:"bottom-left"})}finally{ge.value=!1}},ca=async()=>{try{if(!ye)return;const{data:e}=await xe.get("https://stream.eagleailabs.com/p/v1/trades/apex/account-balance",{headers:{Authorization:`Bearer ${ye}`}});C.updateBalance(e.data)}catch{}},ua=async()=>{if(!Y.value)try{if(!ye)return;const{data:e}=await xe.get("https://stream.eagleailabs.com/p/v1/trades/apex/open",{headers:{Authorization:`Bearer ${ye}`}}),t=e.data.filter(e=>{const t=parseFloat(e.size),a=parseFloat(e.entryPrice);return t>0&&a>0});C.updatePositions(t)}catch{}},fa=e=>{try{const t=e.data,a="@instrumental.500ms";if(t.channel===a){const e=t.data;ke.value=e}}catch(t){console.error("Error processing instrumental messages:",t)}},pa=e=>{try{const t=e.data;if(!t.data||"@prices.500ms"!==t.channel)return;if(_e.value=t.data,Me.value||(Me.value=!0),V.value){const e=t.data,a=new Map;Object.entries(e).forEach(([e,t])=>{const s=e.replace(/USDT$/,"-USDT"),l=parseFloat(t);isNaN(l)||a.set(s,l)}),a.size>0&&je.onPriceUpdate(a)}}catch(t){console.error("Error processing prices messages:",t)}},va=e=>{try{const t=e.data;if(!t.data)return;t.channel===jt.value&&(t.data.asks&&(Ut.value=t.data.asks),t.data.bids&&(Lt.value=t.data.bids))}catch(t){console.error("[Mobile Trade] Error processing orderbook message:",t)}},ha=()=>{const e=jt.value;Q.isSubscribed(e)||Q.subscribe(e)};b(Ce,(e,t)=>{if(e!==t){const e=`${t}[email protected]`;Q.isSubscribed(e)&&Q.unsubscribe(e),ha()}});const ba=e=>{var t,a,s,l;const r=e.target;if($e.value){const e=r.closest("button");(null==(t=null==e?void 0:e.textContent)?void 0:t.includes("x"))||($e.value=!1)}if(Ge.value){const e=r.closest("button");(null==(a=null==e?void 0:e.textContent)?void 0:a.includes("Order"))||(Ge.value=!1)}if(Xe.value){const e=null==(l=null==(s=r.closest("button"))?void 0:s.textContent)?void 0:l.includes("USDT"),t=r.closest(".scrollbar-hide");e||t||(Xe.value=!1)}};return f(()=>{N.reloadFromStorage();const e=K();if(e){Mt.value.side=e.side,Mt.value.market=e.market,Mt.value.size.quantity=e.quantity,Mt.value.size.quote=e.quote,Mt.value.tpPrice=e.tpPrice,Mt.value.slPrice=e.slPrice,Mt.value.orderPrice=e.orderPrice,Mt.value.isPositionTpsl=e.isPositionTpsl,Mt.value.reduceOnly=e.reduceOnly;const t=Re.value;t>0&&e.quantity>0&&(Ve.value=Math.min(100,Math.round(e.quantity/t*100))),Ye.value="Limit"===e.market?"limit":"market"}const t=sessionStorage.getItem("pendingTradeSide");if("Buy"===t||"Sell"===t){Mt.value.side=t,sessionStorage.removeItem("pendingTradeSide");const e=sessionStorage.getItem("pendingTradeTp"),a=sessionStorage.getItem("pendingTradeSl");e&&(Mt.value.tpPrice=parseFloat(e),Mt.value.isPositionTpsl=!0,sessionStorage.removeItem("pendingTradeTp")),a&&(Mt.value.slPrice=parseFloat(a),Mt.value.isPositionTpsl=!0,sessionStorage.removeItem("pendingTradeSl")),J(`Applied ${"Buy"===t?"LONG":"SHORT"} signal to trade form`,{type:"info",autoClose:2e3,position:"bottom-left"})}Q.addEventListener("message",va),ha(),$.subscribe("@prices.500ms"),$.subscribe("@instrumental.500ms"),$.addEventListener("message",fa),$.addEventListener("message",pa),fe.sendMessage(Zd,{action:"subscribe",channel:Zd}),document.addEventListener("click",ba)}),h(()=>{ee({side:Mt.value.side,market:Mt.value.market,quantity:Mt.value.size.quantity,quote:Mt.value.size.quote,tpPrice:Mt.value.tpPrice,slPrice:Mt.value.slPrice,orderPrice:Mt.value.orderPrice,isPositionTpsl:Mt.value.isPositionTpsl,reduceOnly:Mt.value.reduceOnly}),Q.removeEventListener("message",va),(()=>{const e=jt.value;Q.isSubscribed(e)&&Q.unsubscribe(e)})(),$.removeEventListener("message",fa),$.removeEventListener("message",pa),fe.sendMessage(Zd,{action:"unsubscribe",channel:Zd}),document.removeEventListener("click",ba)}),b(()=>[C.trigger,k.token.label],()=>{(async()=>{try{if(!ye)return;const{data:e}=await xe.get("https://stream.eagleailabs.com/p/v1/trades/apex/account",{headers:{Authorization:`Bearer ${ye}`}});we.value=e.data}catch{}})(),ca(),(async()=>{try{if(!ye)return;const{data:e}=await xe.get("https://stream.eagleailabs.com/p/v1/trades/apex/symbols",{headers:{Authorization:`Bearer ${ye}`}});C.updateSymbols(e.data)}catch{}})(),ua(),(async()=>{var e;if(!Y.value)try{if(!ye)return;const{data:t}=await xe.get("https://stream.eagleailabs.com/p/v1/trades/apex/",{headers:{Authorization:`Bearer ${ye}`}});C.updateHistoricalOrders(null==(e=t.data)?void 0:e.orders)}catch{}})()},{immediate:!0}),(e,c)=>{var u,f,p,h,b,S,z,A,E,Y,I,R,$,W,G,X,Z,K,Q,ee,ae,se,fe,ve;return d(),t("div",{class:"w-full max-w-full bg-transparent text-white relative overflow-x-hidden overflow-y-auto antialiased scrollbar-hide",style:{"-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale","text-rendering":"optimizeLegibility"},onTouchstart:mt,onTouchmove:xt,onTouchend:gt},[pt.value>0?(d(),t("div",{key:0,class:"absolute top-0 left-0 right-0 flex items-center justify-center transition-all duration-200 z-50",style:g({height:`${Math.min(pt.value,80)}px`,opacity:pt.value/80})},[a("div",Fl,[(d(),t("svg",{class:r(["w-6 h-6 text-[#00f6ff] transition-transform duration-200",{"animate-spin":vt.value,"rotate-180":pt.value>=80&&!vt.value}]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},c[48]||(c[48]=[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"},null,-1)]),2)),a("span",El,i(vt.value?"Refreshing...":pt.value>=80?"Release to refresh":"Pull to refresh"),1)])],4)):o("",!0),a("div",Yl,[a("div",null,[a("button",{onClick:c[1]||(c[1]=()=>{Xe.value=!Xe.value}),class:"w-full flex items-center justify-between p-2 rounded-lg bg-[#121a31] border border-[#1d2742] hover:bg-[#1a2540] transition-all"},[a("div",Il,[a("div",Vl,[a("img",{src:y(te)(Ce.value,32),alt:Ce.value,class:"w-full h-full object-cover",onError:c[0]||(c[0]=e=>Gt(e,Ce.value))}
1,null,40,Hl)]),a("div",Rl,[a("div",$l,[a("p",Wl,i(Ce.value)+"USDT",1),c[49]||(c[49]=a("span",{class:"px-1 py-0.5 bg-yellow-500/30 text-yellow-300 text-[8px] font-bold rounded backdrop-blur-sm"},"Perp",-1))]),a("p",{class:r(["text-xs font-semibold",Ee.value>=0?"text-[#5ec485]":"text-[#eb5c57]"])},i(Ee.value>=0?"+":"")+i(y(Se)(Ee.value,2))+"% ",3)])]),(d(),t("svg",{class:r(["w-4 h-4 text-white/70 transition-transform",{"rotate-180":Xe.value}]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},c[50]||(c[50]=[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"},null,-1)]),2))]),a("div",ql,[(d(),t(s,null,l([{id:"apex",label:"ApeX"},{id:"mexc",label:"MEXC"},{id:"binance",label:"Binance"}],e=>a("button",{key:e.id,onClick:t=>y(B).setExchange(e.id),class:r(["px-3 py-1 rounded-lg text-xs font-bold transition-all border",F.value===e.id?"apex"===e.id?"bg-[#00F6FF]/20 text-[#00F6FF] border-[#00F6FF]/40":"mexc"===e.id?"bg-[#00C087]/20 text-[#00C087] border-[#00C087]/40":"bg-[#F0B90B]/20 text-[#F0B90B] border-[#F0B90B]/40":"bg-white/5 text-white/40 border-white/10"])},i(e.label),11,Gl)),64))])])]),a("div",Xl,[a("div",Zl,[w(a("div",Kl,[a("div",Jl,[a("div",Ql,[w(a("input",{"onUpdate:modelValue":c[2]||(c[2]=e=>Ke.value=e),type:"text",placeholder:"Search tokens...",class:"w-full px-3 py-2 pl-9 bg-[#0a1628]/80 backdrop-blur-sm border border-[#00f6ff]/30 rounded-lg text-sm text-white placeholder-white/40 focus:outline-none focus:border-[#00f6ff]/60 transition-colors"},null,512),[[U,Ke.value]]),c[51]||(c[51]=a("svg",{class:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-white/40",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1))])]),a("div",er,[a("button",{onClick:c[3]||(c[3]=()=>{Je.value=!Je.value}),class:r(["flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs font-bold transition-all",Je.value?"bg-[#00f6ff]/20 text-[#00f6ff] border border-[#00f6ff]/30":"bg-[#0a1628]/50 text-white/70 border border-white/10 hover:border-[#00f6ff]/30"])},[(d(),t("svg",{class:r(["w-4 h-4",Je.value?"fill-[#00f6ff]":"fill-none"]),stroke:"currentColor",viewBox:"0 0 24 24"},c[52]||(c[52]=[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z"},null,-1)]),2)),v(" Favorites "+i(Je.value?`(${Xt.value.length})`:""),1)],2),a("button",{onClick:c[4]||(c[4]=()=>{Ze.value=!Ze.value}),class:r(["flex items-center gap-1 px-3 py-1.5 rounded-lg text-xs font-bold transition-all",Ze.value?"bg-[#5ec485]/20 text-[#5ec485] border border-[#5ec485]/30":"bg-[#0a1628]/50 text-white/70 border border-white/10 hover:border-[#00f6ff]/30"]),title:"Sort by 24h gain"},[c[54]||(c[54]=v(" 24h ",-1)),(d(),t("svg",{class:r(["w-3 h-3",Ze.value?"rotate-180":""]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},c[53]||(c[53]=[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"},null,-1)]),2))],2)]),c[57]||(c[57]=a("div",{class:"px-4 py-2 bg-[#090f1d] border-b border-[#00f6ff]/20 sticky top-[112px] z-10 text-xs text-[#00f6ff]/70 grid grid-cols-12 gap-2 font-bold"},[a("div",{class:"col-span-5"},"Symbol"),a("div",{class:"col-span-4 text-right"},"Price"),a("div",{class:"col-span-3 text-right"},"24h")],-1)),a("div",tr,[(d(!0),t(s,null,l(Zt.value,e=>{return d(),t("div",{key:e.symbol,class:"border-b border-[#00f6ff]/10 last:border-b-0"},[a("div",ar,[a("button",{onClick:t=>(e=>{const t=e.symbol.replace("USDT","").replace("USDC","").trim();k.setToken({icon:"",label:t,pair:`${t}/USD`,value:t.toLowerCase()}),Xe.value=!1})(e),class:"absolute inset-0 w-full h-full"},null,8,sr),a("div",lr,[a("div",rr,[a("button",{onClick:D(t=>{return a=e.symbol,void O.toggle(a+"USDT");var a},["stop"]),class:"p-1"},[(d(),t("svg",{class:r(["w-4 h-4 transition-colors",(s=e.symbol,O.has(s+"USDT")?"fill-[#ff9500] text-[#ff9500]":"fill-none text-white/30 hover:text-white/50")]),stroke:"currentColor",viewBox:"0 0 24 24"},c[55]||(c[55]=[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z"},null,-1)]),2))],8,or)]),a("div",nr,[a("div",ir,[a("img",{src:y(te)(e.symbol,32),alt:e.symbol,class:"w-full h-full object-cover",onError:t=>
1Gt(t,e.symbol)},null,40,dr)]),a("span",cr,i(e.symbol),1)]),a("div",ur,[a("span",fr,"$"+i(e.price),1)]),a("div",pr,[a("span",{class:r(["text-xs font-bold",e.change>=0?"text-[#5ec485]":"text-[#eb5c57]"])},i(e.change>=0?"+":"")+i(e.change.toFixed(2))+"% ",3)])])])]);var s}),128)),0===Zt.value.length?(d(),t("div",vr,c[56]||(c[56]=[a("svg",{class:"w-12 h-12 mx-auto mb-2 text-white/20",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1),a("p",null,"No tokens found",-1)]))):o("",!0)])],512),[[P,Xe.value]])])]),c[180]||(c[180]=n('<div class="px-4 py-2 bg-[#070b15] border-b border-white/[0.06] flex items-center justify-between" data-v-94067d7e><div class="flex items-center gap-2" data-v-94067d7e><div class="w-1.5 h-1.5 rounded-full bg-[#00f6ff] animate-pulse" data-v-94067d7e></div><span class="text-xs text-white/70 font-medium" data-v-94067d7e>Funding Rate</span></div><div class="flex items-center gap-2" data-v-94067d7e><div class="px-2 py-0.5 bg-green-500/10 border border-green-500/20 rounded" data-v-94067d7e><span class="text-xs text-green-400 font-semibold" data-v-94067d7e>+0.00125%</span></div><span class="text-xs text-white/50" data-v-94067d7e>/</span><div class="px-2 py-0.5 bg-[#00f6ff]/10 border border-[#00f6ff]/20 rounded" data-v-94067d7e><span class="text-xs text-[#00f6ff] font-mono" data-v-94067d7e>0:36:25</span></div></div></div>',1)),m(_,{name:"slide-down"},{default:T(()=>["Neutral"!==at.value?(d(),t("div",{key:0,class:r(["px-3 py-2 flex items-center justify-between gap-2 cursor-pointer transition-all","Long"===at.value?"bg-gradient-to-r from-green-900/40 to-green-800/20 border-b border-green-500/30":"bg-gradient-to-r from-red-900/40 to-red-800/20 border-b border-red-500/30"]),onClick:c[5]||(c[5]=()=>{var e;e=at.value.toLowerCase(),Mt.value.side="long"===e?"Buy":"Sell",lt.value>0&&(Mt.value.tpPrice=lt.value,Mt.value.isPositionTpsl=!0),rt.value>0&&(Mt.value.slPrice=rt.value,Mt.value.isPositionTpsl=!0),J(`Applied ${e.toUpperCase()} signal to trade form`,{type:"info",autoClose:2e3,position:"bottom-left"})})},[a("div",hr,[a("div",{class:r(["w-7 h-7 rounded-full flex items-center justify-center animate-pulse","Long"===at.value?"bg-green-500/30":"bg-red-500/30"])},[(d(),t("svg",{class:r(["w-4 h-4","Long"===at.value?"text-green-400":"text-red-400"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},c[58]||(c[58]=[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 10V3L4 14h7v7l9-11h-7z"},null,-1)]),2))],2),a("div",null,[a("p",{class:r(["text-xs font-bold","Long"===at.value?"text-green-400":"text-red-400"])},i(at.value.toUpperCase())+" SIGNAL ACTIVE ",3),a("p",br,[v(" Entry: "+i(st.value?y(Se)(st.value,2):"Market")+" ",1),rt.value?(d(),t("span",mr,"• SL: "+i(y(Se)(rt.value,2)),1)):o("",!0),lt.value?(d(),t("span",xr,"• TP: "+i(y(Se)(lt.value,2)),1)):o("",!0)])])]),a("button",{class:r(["px-3 py-1.5 rounded-lg font-bold text-xs flex items-center gap-1 transition-all active:scale-95","Long"===at.value?"bg-gradient-to-r from-green-500 to-green-600 text-white shadow-lg shadow-green-500/20":"bg-gradient-to-r from-red-500 to-red-600 text-white shadow-lg shadow-red-500/20"])},c[59]||(c[59]=[a("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 10V3L4 14h7v7l9-11h-7z"})],-1),v(" Trade ",-1)]),2)],2)):o("",!0)]),_:1}),a("div",gr,[a("div",yr,[c[62]||(c[62]=a("div",{class:"px-2 py-2 border-b border-[#00f6ff]/10 bg-[#0d1421]/80 backdrop-blur-sm text-scalable"},[a("div",{class:"flex items-center text-[10px] text-[#00f6ff]/70 font-semibold"},[a("span",{class:"flex-1"},"Price (USDT)"),a("span",{class:"text-right"},"Total (BTC)")])],-1)),a("div",wr,[(d(!0),t(s,null,l(At.value,(e,s)=>(d(),t("div",{key:"ask-"+s,class:"px-2 py-0.5 flex items-center text-[12px] relative hover:bg-red-500/10 active:bg-red-500/20 transition-colors cursor-pointer",onClick:()=>{ut(parseFloat(e.price.replace(",","")))}},[a("div",{class:"absolute inset-0 bg-gradient-to-r from-transparent to-red-500/10",style:g({width:e.width})},null,4),a("span",Sr,i(e.price),1),a("span",Tr,i(e.total),1)],8,kr))),128))]),a("div",_r,[a("div",{class:r(["text-2xl font-bold font-mono tabular-nums flex items-center justify-center gap-1.5",[+((null==(u=Te.value)?void 0:u.pr)??0)>=0?"text-[#5ec485]":"text-[#eb5c57]"]])},[+((null==(f=Te.value)?void 0:f.pr)??0)>=0?(d(),t("svg",Mr,c[60]||(c[60]=[a("path",{"fill-rule":"evenodd",d:"M5.293 9.707
1a1 1 0 010-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 01-1.414 1.414L11 7.414V15a1 1 0 11-2 0V7.414L6.707 9.707a1 1 0 01-1.414 0z","clip-rule":"evenodd"},null,-1)]))):(d(),t("svg",Cr,c[61]||(c[61]=[a("path",{"fill-rule":"evenodd",d:"M14.707 10.293a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 111.414-1.414L9 12.586V5a1 1 0 012 0v7.586l2.293-2.293a1 1 0 011.414 0z","clip-rule":"evenodd"},null,-1)]))),v(" "+i(Nt.value),1)],2),a("div",Dr,[a("span",Pr,"▶ "+i(Nt.value),1)])]),a("div",Ur,[(d(!0),t(s,null,l(Ot.value,(e,s)=>(d(),t("div",{key:"bid-"+s,class:"px-2 py-0.5 flex items-center text-[12px] relative hover:bg-green-500/10 active:bg-green-500/20 transition-colors cursor-pointer",onClick:()=>{ut(parseFloat(e.price.replace(",","")))}},[a("div",{class:"absolute inset-0 bg-gradient-to-r from-transparent to-green-500/10",style:g({width:e.width})},null,4),a("span",jr,i(e.price),1),a("span",zr,i(e.total),1)],8,Lr))),128))])]),a("div",Ar,[a("div",Or,[a("div",Nr,[a("button",{onClick:c[6]||(c[6]=D(e=>$e.value=!$e.value,["stop"])),onTouchend:c[7]||(c[7]=D(e=>$e.value=!$e.value,["stop","prevent"])),class:"w-[110px] px-2.5 py-3 rounded-lg text-xs border flex items-center gap-1.5 shadow-lg bg-gradient-to-r from-orange-500/20 to-orange-600/20 border-orange-500/30 shadow-orange-500/10 active:from-orange-500/40 active:to-orange-600/40 touch-manipulation"},[c[63]||(c[63]=a("span",{class:"text-white/90 font-medium"},"Cross",-1)),c[64]||(c[64]=a("span",{class:"text-[10px] text-white/40"},"|",-1)),a("span",Br,i(Math.round(y(C).leverage??1))+"x",1),c[65]||(c[65]=a("svg",{class:"w-3 h-3 ml-auto text-orange-400 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"})],-1))],32),$e.value?(d(),t("div",{key:0,class:"absolute top-full left-0 mt-1 bg-[#060a12] border border-[#00f6ff]/20 rounded-[6px] shadow-2xl z-[99999] w-40 max-h-56 overflow-y-auto scrollbar-hide overscroll-contain",onTouchstart:Yt,onTouchmove:It},[(d(!0),t(s,null,l(y(C).steps,e=>(d(),t("button",{key:e,onClick:D(t=>Vt(e),["stop"]),onTouchend:D(t=>(e=>{qe.value||Vt(e),qe.value=!1})(e),["stop"]),class:r(["w-full px-3 py-3 text-left text-xs active:bg-orange-500/20 transition-colors flex items-center justify-between border-b border-white/5 last:border-b-0",[Math.round(y(C).leverage)===Math.round(e)?"text-orange-400 font-bold bg-orange-500/10":"text-white/80"]])},[a("span",null,i(Math.round(e))+"x Leverage",1),Math.round(y(C).leverage)===Math.round(e)?(d(),t("svg",Er,c[66]||(c[66]=[a("path",{"fill-rule":"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z","clip-rule":"evenodd"},null,-1)]))):o("",!0)],42,Fr))),128))],32)):o("",!0)]),a("div",Yr,[c[67]||(c[67]=a("svg",{class:"w-3 h-3 text-green-400",fill:"currentColor",viewBox:"0 0 20 20"},[a("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z","clip-rule":"evenodd"})],-1)),a("span",Ir,i(y(Se)(100*+((null==(p=Te.value)?void 0:p.pr)??0),2))+"%",1)]),c[69]||(c[69]=a("div",{class:"flex-1"},null,-1)),a("button",{onClick:Ft,class:"px-2 py-1 hover:bg-[#00f6ff]/10 rounded-lg transition-colors group flex items-center gap-1"},c[68]||(c[68]=[a("span",{class:"text-[10px] text-[#00f6ff]/70 group-hover:text-[#00f6ff] font-semibold"},"Chart",-1),a("svg",{class:"w-4 h-4 text-[#00f6ff]/70 group-hover:text-[#00f6ff]",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})],-1)]))]),a("div",Vr,[a("button",{class:r(["flex-1 py-2 text-sm font-bold transition-colors relative overflow-hidden","Buy"===Mt.value.side?"bg-gradient-to-r from-green-500 to-green-600 text-white":"bg-[#0d1421] text-white/40 hover:text-white/60"]),onClick:c[8]||(c[8]=e=>ra("Buy"))},[c[70]||(c[70]=a("span",{class:"relative z-10"},"Buy / Long",-1)),"Buy"===Mt.value.side?(d(),t("div",Hr)):o("",!0)],2),a("button",{class:r(["flex-1 py-2 text-sm font-bold transition-colors relative overflow-hidden","Sell"===Mt.value.side?"bg-gradient-to-r from-[#eb5c57] to-red-600 text-white":"bg-[#0d1421] text-white/40 hover:text-white/60"]),onClick:c[9]||(c[9]=e=>ra("Sell"))},[c[71]||(c[71]=a("span",{class:"relative z-10"},"Sell / Short",-1)),"Sell"===Mt.value.side?(d(),t("div",Rr)):o("",!0)],2)]),a("div",$r,[a("button",{onClick:c[10]||(c[10]=D(e=>y(N).toggleTradingMode(),["stop"])),onTouchend:c[11]||(c[11]=D(e=>y(N).toggleTradingMode(),["stop","prevent"])),class:r(["w-full flex items-center justify-between p-3 rounded-lg touch-manipulation active:opacity-80 transition-opacity",V.value?"bg-emerald-500/10 border border-emerald-500/30":"bg-red-500/10 border border-red-500/30"])},[a("div",Wr,[a("span",{class:r(["w-3 h-3 rounded-full animate-pulse",V.value?"bg-emerald-400":"bg-red-500"])},null,2),a("span",{class:r(["text-sm font-bold flex items-center gap-1.5",V.value?"text-emerald-400":"text-red-400"])},[V.value?(d(),t("svg",qr,c[72]||(c[72]=[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"},null,-1)]))):(d(),t("svg",Gr,c[73]||(c[73]=[a("circle",{cx:"12",cy:"12",r:"8"},null,-1)]))),v(" "+i(V.value?"PAPER MODE":"LIVE MODE"),1)],2)]),c[74]||(c[74]=a("span",{class:"text-xs text-white/50"},"Tap to switch",-1))],34),a("div",{class:r(["flex items-center justify-between p-2 rounded-lg backdrop-blur-sm",[V.value?"bg-gradient-to-r from-emerald-900/30 to-emerald-800/20 border border-emerald-500/20":He.value?"bg-[#1870f6]/[0.15] border border-[#1870f6]/30":"bg-[#060a12] border border-[#1d2742]",V.value?"curs
1or-pointer active:scale-[0.98] transition-transform":""]]),onClick:c[14]||(c[14]=()=>{V.value&&(oe.value=N.virtualBalance,le.value=!0)})},[a("div",Xr,[a("div",{class:r(["w-6 h-6 rounded-full flex items-center justify-center",V.value?"bg-emerald-500/20":He.value?"bg-[#00f6ff]/20":"bg-[#00f6ff]/10"])},[(d(),t("svg",{class:r(["w-3.5 h-3.5",V.value?"text-emerald-400":(He.value,"text-[#00f6ff]")]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},c[75]||(c[75]=[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)]),2))],2),a("div",null,[a("p",Zr,[v(i(V.value?"Paper Balance":He.value?"All Assets":"USDT Only")+" ",1),V.value?(d(),t("span",Kr,"(tap to adjust)")):o("",!0)]),a("p",{class:r(["text-xs font-bold",V.value?"text-emerald-400":He.value?"text-[#00f6ff]":"text-white"])},i(y(Se)(Re.value,2))+" USDT ",3)])]),V.value?o("",!0):(d(),t("div",Jr,[He.value?o("",!0):(d(),t("span",Qr,"tap→")),a("button",{onClick:c[12]||(c[12]=D(e=>He.value=!He.value,["stop"])),class:r(["px-2 py-1 rounded-lg text-[9px] font-bold transition-all flex-shrink-0",He.value?"bg-[#00f6ff]/20 text-[#00f6ff] border border-[#00f6ff]/40":"bg-yellow-500/20 text-yellow-400 border border-yellow-500/40"])},i(He.value?"ALL":"USDT"),3)])),V.value?o("",!0):(d(),t("button",{key:1,onClick:c[13]||(c[13]=e=>pe("navigate-to-tab","portfolio")),class:"w-7 h-7 rounded-full flex items-center justify-center text-black font-bold text-sm shadow-lg flex-shrink-0 bg-gradient-to-r from-yellow-500 to-yellow-600 shadow-yellow-500/20 hover:brightness-110"}," + ")),V.value?(d(),t("div",eo,c[76]||(c[76]=[a("svg",{class:"w-3.5 h-3.5 text-emerald-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})],-1)]))):o("",!0)],2),a("div",to,[a("button",{onClick:c[15]||(c[15]=e=>Ge.value=!Ge.value),class:"w-full flex items-center justify-between px-2.5 py-1.5 bg-[#060a12] rounded-[6px] text-xs border border-[#00f6ff]/20 hover:border-[#00f6ff]/40 transition-all shadow-lg"},[a("span",ao,i("market"===Ye.value?"Market Order":"Limit Order"),1),c[77]||(c[77]=a("svg",{class:"w-3.5 h-3.5 text-[#00f6ff]",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"})],-1))]),Ge.value?(d(),t("div",so,[a("button",{onClick:c[16]||(c[16]=()=>{Ye.value="market",Ge.value=!1}),class:r(["w-full px-3 py-2 text-left text-xs hover:bg-[#00f6ff]/10 transition-colors flex items-center justify-between border-b border-white/5",["market"===Ye.value?"text-[#00f6ff] font-bold bg-[#00f6ff]/10":"text-white/80"]])},[c[79]||(c[79]=a("span",null,"Market Order",-1)),"market"===Ye.value?(d(),t("svg",lo,c[78]||(c[78]=[a("path",{"fill-rule":"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z","clip-rule":"evenodd"},null,-1)]))):o("",!0)],2),a("button",{onClick:c[17]||(c[17]=()=>{Ye.value="limit",Ge.value=!1}),class:r(["w-full px-3 py-2 text-left text-xs hover:bg-[#00f6ff]/10 transition-colors flex items-center justify-between",["limit"===Ye.value?"text-[#00f6ff] font-bold bg-[#00f6ff]/10":"text-white/80"]])},[c[81]||(c[81]=a("span",null,"Limit Order",-1)),"limit"===Ye.value?(d(),t("svg",ro,c[80]||(c[80]=[a("path",{"fill-rule":"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z","clip-rule":"evenodd"},null,-1)]))):o("",!0)],2)])):o("",!0)]),a("div",oo,[c[82]||(c[82]=a("p",{class:"text-[9px] text-white/50 mb-0.5"},"Market Price",-1)),a("p",no,i(Nt.value),1)]),"limit"===Ye.value?(d(),t("div",io,[c[84]||(c[84]=a("div",{class:"flex items-center justify-between"},[a("label",{class:"text-[10px] text-white/70 font-semibold"},"Limit Order Price"),a("span",{class:"text-[9px] text-[#00f6ff]/70"},"Set your entry price")],-1)),a("div",co,[w(a("input",{"onUpdate:modelValue":c[18]||(c[18]=e=>Mt.value.orderPrice=e),type:"number",placeholder:"Enter limit price",class:"border-0 outline-0 w-full bg-transparent text-[#00f6ff] text-sm placeholder-[#00f6ff]/30 font-mono [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",onKeypress:c[19]||(c[19]=e=>!/[0-9.]/.test(e.key)&&e.preventDefault())},null,544),[[U,Mt.value.orderPrice,void 0,{number:!0}]]),c[83]||(c[83]=a("span",{class:"text-white/70 text-xs font-semibold"},"USDT",-1))])])):o("",!0),a("div",null,[c[86]||(c[86]=a("div",{class:"flex items-center justify-between mb-0.5"},[a("label",{class:"text-[10px] text-white/70 font-semibold"},"Order Value")],-1)),a("div",uo,[w(a("input",{"onUpdate:modelValue":c[20]||(c[20]=e=>Mt.value.size.quantity=e),type:"number",placeholder:"0.00",class:"w-full bg-[#060a12] border border-[#00f6ff]/20 rounded-[6px] px-2.5 py-1.5 text-white text-sm placeholder-white/30 focus:outline-none focus:border-[#00f6ff] focus:shadow-lg focus:shadow-[#00f6ff]/10 transition-all font-mono [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none"},null,512),[[U,Mt.value.size.quantity,void 0,{number:!0}]]),c[85]||(c[85]=a("div",{class:"absolute right-2.5 top-1/2 -translate-y-1/2 text-xs text-white/50 font-semibold pointer-events-none"}," USDT ",-1))])]),a("div",fo,[(d(),t(s,null,l(ot,e=>a("button",{key:e,onClick:t=>(e=>{Mt.value.size.quantity=e,Mt.value.size.quote="USDT";const t=Re.value;t>0&&(Ve.value=Math.min(100,Math.round(e/t*100)))})(e),class:"flex-shrink-0 snap-start px-3 py-1.5 rounded-[6px] text-xs font-bold transition-colors bg-[#00f6ff]/[0.08] border border-[#00f6ff]/30 text-[#00f6ff] hover:bg-[#00f6ff]/20 active:bg-[#00f6ff]/30"}," $"+i(e),9,po)),64)),a("button",{onClick:nt,class:"flex-shrink-0 snap-start px-3 py-1.5 rounded-lg text-xs font-bold transition-colors bg-gradient-to-r from-orange-500/20 to-orange-600/20 border border-orange-500/30 text-orange-400 hover:bg-orange-500/30 active:bg-orange-500/40"}," MAX ")]),a("div",vo,[a("div",ho,[c[87]||(c[87]=a("label",{class:"text-[10px] text-white/70 font-semibold"},"Position Size",-1)),a("div",bo,i(Ve.value)+"% ",1)]),w(a("input",{"onUpdate:modelValue":c[21]||(c[21]=e=>Ve.value=e),type:"range",min:"0",max:"100",step:"1",class:"w-full h-2 bg-gradient-to-r from-[#00f6ff]/20 via-[#1870f6]/20 to-[#00f6ff]/20 rounded-lg appearance-none cursor-pointer slider-thumb",style:{"accent-color":"#00f6ff"},onInput:ia},null,544),[[U,Ve.value]]),a("div",mo,[(d(),t(s,null,l([0,25,50,75,100],e=>a("span",{key:e,class:"text-[9px] text-white/40 font-semibold"},i(e)+"%",1)),64))])]),a("button",{onClick:c[22]||(c[22]=e=>Qe.value=!Qe.value),class:"w-full flex items-center justify-between p-2 bg-[#060a12] border border-[#00f6ff]/10 rounded-[6px] hover:border-[#00f6ff]/30 transition-all"},[c[89]||(c[89]=a("span",{class:"text-xs text-white/70 font-semibold flex items-center gap-2"},[a("svg",{class:"w-3.5 h-3.5 text-[#00f6ff]",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]),v(" Advanced Options ")],-1)),(d(),t("svg",{class:r(["w-4 h-4 text-[#00f6ff] transition-transform duration-200",{"rotate-180":Qe.value}]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},c[88]||(c[88]=[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"},null,-1)]),2))]),a("div",{class:r(["overflow-hidden transition-all duration-300 ease-in-out",[Qe.value?"max-h-[500px] opacity-100":"max-h-0 opacity-0"]])},[a("div",xo,[a("label",go,[w(a("input",{"onUpdate:modelValue":c[23]||(c[23]=e=>Mt.value.isPositionTpsl=e),type:"checkbox",class:"w-3.5 h-3.5 rounded border-[#00f6ff]/30 bg-[#0d1424] checked:bg-[#00f6ff] checked:border-[#00f6ff] transition-all"},null,512),[[L,Mt.value.isPositionTpsl]]),a("span",yo,i(Mt.value.side)+" "+i("Buy"==Mt.value.side?"Long":"Short")+" with TP/SL",1)]),a("label",wo,[w(a("input",{"onUpdate:modelValue":c[24]||(c[24]=e=>Mt.value.reduceOnly=e),type:"checkbox",class:"w-3.5 h-3.5 rounded border-[#00f6ff]/30 bg-[#0d1424] checked:bg-[#00f6ff] checked:border-[#00f6ff] transition-all"},null,512),[[L,Mt.value.reduceOnly]]),c[90]||(c[90]=a("span",{class:"text-white/90 group-hover:text-white font-medium"},"Reduce-Only",-1))])]),a("div",{class:r(["flex flex-col gap-1 overflow-hidden transition-all ease-in-out duration-300 mb-2",[Mt.value.isPositionTpsl?"max-h-[200px] opacity-100":"max-h-0 opacity-0"]])},[c[94]||(c[94]=a("p",{class:"text-green-400 text-xs font-semibold"},"Take Profit Price",-1)),a("div",ko,[w(a("input",{"onUpdate:modelValue":c[25]||(c[25]=e=>Mt.value.tpPrice=e),type:"number",placeholder:"Take Profit",class:"border-0 outline-0 w-full bg-transparent text-green-400 text-xs placeholder-green-400/50",onKeypress:c[26]||(c[26]=e=>!/[0-9.]/.test(e.key)&&e.preventDefault())},null,544),[[U,Mt.value.tpPrice,void 0,{number:!0}]]),c[91]||(c[91]=a("span",{class:"text-green-400/70 text-xs"},"USDT",-1))]),Mt.value.tpPrice>0?(d(),t("div",So,[a("div",To,[c[92]||(c[92]=a("span",{class:"text-green-400/70 text-[10px]"},"Est. Profit",-1)),a("span",_o,i(Dt.value.dollars>=0?"+":"")+"$"+i(y(Se)(Dt.value.dollars,2)),1)]),a("div",Mo,[c[93]||(c[93]=a("span",{class:"text-green-400/70 text-[10px]"},"ROI",-1)),a("span",Co,i(Dt.value.percentage>=0?"+":"")+i(y(Se)(Dt.value.percentage,2))+"%",1)])])):o("",!0)],2),a("div",{class:r(["flex flex-col gap-1 overflow-hidden transition-all ease-in-out duration-300",[Mt.value.isPositionTpsl?"max-h-[200px] opacity-100":"max-h-0 opacity-0"]])},[c[98]||(c[98]=a("p",{class:"text-red-400 text-xs font-semibold"},"Stop Loss Price",-1)),a("div",Do,[w(a("input",{"onUpdate:modelValue":c[27]||(c[27]=e=>Mt.value.slPrice=e),type:"number",placeholder:"Stop Loss",class:"border-0 outline-0 w-full bg-transparent text-red-400 text-xs placeholder-red-400/50",onKeypress:c[28]||(c[28]=e=>!/[0-9.]/.test(e.key)&&e.preventDefault())},null,544),[[U,Mt.value.slPrice,void 0,{number:!0}]]),c[95]||(c[95]=a("span",{class:"text-red-400/70 text-xs"},"USDT",-1))]),Mt.value.slPrice>0?(d(),t("div",Po,[a("div",Uo,[c[96]||(c[96]=a("span",{class:"text-red-400/70 text-[10px]"},"Est. Loss",-1)),a("span",Lo,i(Pt.value.dollars>=0?"+":"")+"$"+i(y(Se)(Pt.value.dollars,2)),1)]),a("div",jo,[c[97]||(c[97]=a("span",{class:"text-red-400/70 text-[10px]"},"ROI",-1)),a("span",zo,i(Pt.value.percentage>=0?"+":"")+i(y(Se)(Pt.value.percentage,2))+"%",1)])])):o("",!0)],2)],2),a("button",{onClick:da,disabled:ge.value||!Mt.value.size.quantity,class:r(["w-full py-2.5 rounded-[6px] font-bold text-sm flex items-center justify-center gap-2 relative overflow-hidden",V.value?"bg-gradient-to-r from-emerald-500 to-emerald-600 shadow-lg shadow-emerald-500/20 text-white hover:brightness-110":"Buy"===Mt.value.side?"bg-gradient-to-r from-green-500 to-green-600 shadow-lg shadow-green-500/20 text-white hover:brightness-110":"bg-gradient-to-r from-[#eb5c57] to-red-600 shadow-lg shadow-red-500/20 text-white hover:brightness-110",(ge.value||!Mt.value.size.quantity)&&"opacity-50 cursor-not-allowed"])},[ge.value?(d(),t("span",Oo)):(d(),t(s,{key:1},[V.value?(d(),t("svg",No,c[99]||(c[99]=[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"},null,-1)]))):(d(),t("svg",Bo,["Buy"===Mt.value.side?(d(),t("path",Fo)):(d(),t("path",Eo))])),a("span",null,i(V.value?"Buy"===Mt.value.side?"Paper Long":"Paper Short":"Buy"===Mt.value.side?"Open Long Position":"Open Short Position"),1)],64))],10,Ao),a("div",Yo,[a("div",Io,[c[100]||(c[100]=a("span",{class:"text-white/60 font-medium"},"Required Margin",-1)),a("span",Vo,i(y(Se)(Ct.value.requiredMargin,2))+" USDT",1)]),a("div",Ho,[c[101]||(c[101]=a("span",{class:"text-white/60 font-medium"},"Max Position",-1)),a("span",Ro,"-- "+i(Ce.value),1)]),a("div",$o,[c[102]||(c[102]=a("span",{class:"text-white/50"},"Liq. Price",-1)),a("span",Wo,i(y(Se)(Ct.value.liquidation,2))+" USDT",1)]),c[103]||(c[103]=a("div",{class:"flex items-center justify-between text-[10px]"},[a("span",{class:"text-white/50"},"Fees"),a("span",{class:"text-white"},"0.0500% / 0.0200%")],-1))])])])]),a("div",qo,[a("button",{class:r(["px-3 py-1.5 text-xs font-semibold transition-all rounded-lg relative","position"===Ie.value?"text-[#00f6ff] bg-[#00f6ff]/10 border border-[#00f6ff]/30 shadow-lg shadow-[#00f6ff]/10":"text-white/50 hover:text-white/80 hover:bg-white/5"]),onClick:c[29]||(c[29]=e=>Ie.value="position")},[c[104]||(c[104]=a("span",null,"Positions",-1)),(null==(h=y(C).positions)?void 0:h.length)?(d(),t("span",Go,i(y(C).positions.length),1)):o("",!0)],2),a("button",{class:r(["px-3 py-1.5 text-xs font-semibold transition-all rounded-lg","order"===Ie.value?"text-[#00f6ff] bg-[#00f6ff]/10 border border-[#00f6ff]/30 shadow-lg shadow-[#00f6ff]/10":"text-white/50 hover:text-white/80 hover:bg-white/5"]),onClick:c[30]||(c[30]=e=>Ie.value="order")}," Orders ",2),a("button",{class:r(["px-3 py-1.5 text-xs font-semibold transition-all rounded-lg","assets"===Ie.value?"text-[#00f6ff] bg-[#00f6ff]/10 border border-[#00f6ff]/30 shadow-lg shadow-[#00f6ff]/10":"text-white/50 hover:text-white/80 hover:bg-white/5"]),onClick:c[31]||(c[31]=e=>Ie.value="assets")}," Assets ",2)]),"position"===Ie.value?(d(),t("div",Xo,[a("div",Zo,[a("div",Ko,[a("p",Jo,i(Ae.value.length),1),c[105]||(c[105]=a("span",{class:"text-[10px] text-white/60 uppercase"},"Positions",-1))]),a("div",Qo,[a("p",en,"$"+i(Fe.value.totalValue),1),c[106]||(c[106]=a("span",{class:"text-[10px] text-white/60 uppercase"},"Total Value",-1))]),a("div",tn,[a("p",{class:r(["text-sm font-bold",[Fe.value.totalPnl>=0?"text-green-400":"text-red-400"]])},i(Fe.value.totalPnl>=0?"+":"")+"$"+i(Math.abs(Fe.value.totalPnl).toFixed(2)),3),c[107]||(c[107]=a("span",{class:"text-[10px] text-white/60 uppercase"},"Total PnL",-1))])]),a("div",an,[a("label",sn,[w(a("input",{"onUpdate:modelValue":c[32]||(c[32]=e=>Pe.value=e),type:"checkbox",class:"w-4 h-4 rounded border-[#00f6ff]/30 bg-[#0d1424] checked:bg-[#00f6ff] checked:border-[#00f6ff] transition-all"},null,512),[[L,Pe.value]]),c[108]||(c[108]=a("span",{class:"text-[#00f6ff] font-semibold group-hover:text-[#00f6ff]/80"},"Show All Positions",-1))]),c[109]||(c[109]=a("button",{class:"text-[#00f6ff]/70 text-xs hover:text-[#00f6ff] font-semibold transition-colors"}," Collapse All ",-1))]),Ae.value.length>0?(d(),t("div",ln,[c[118]||(c[118]=a("p",{class:"text-[10px] text-white/40 text-center mb-1"}," ← Swipe left on a position to quick close ",-1)),(d(!0),t(s,null,l(Ae.value,e=>(d(),t("div",{key:`${e.symbol}-${e.side}`,class:"relative overflow-hidden rounded-[6px]",onTouchstart:t=>{return a=t,s=`${e.symbol}-${e.side}`,it.value=a.touches[0].clientX,void(ct.value=s);var a,s},onTouchmove:t=>((e,t)=>{if(ct.value!==t)return;const a=it.value-e.touches[0].clientX;a>0&&(dt.value[t]=Math.min(a,120))})(t,`${e.symbol}-${e.side}`),onTouchend:t=>(e=>{const t=`${e.symbol}-${e.side}`;(dt.value[t]||0)>80&&Jt("Market",e),dt.value[t]=0,ct.value=null})(e)},[c[117]||(c[117]=a("div",{class:"absolute inset-0 bg-gradient-to-r from-transparent via-red-500/30 to-red-600 flex items-center justify-end pr-4"},[a("div",{class:"text-white font-bold text-sm flex items-center gap-2"},[a("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linec
1ap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})]),v(" Close ")])],-1)),a("div",{class:"bg-[#060a12] border border-[#1d2742] p-3.5 shadow-xl relative z-10 transition-transform",style:g({transform:`translateX(-${dt.value[`${e.symbol}-${e.side}`]||0}px)`})},[a("div",on,[a("div",nn,[a("div",{class:r(["w-8 h-8 rounded-lg flex items-center justify-center font-bold text-xs","LONG"===e.side?"bg-gradient-to-br from-green-500/20 to-green-600/20 border border-green-500/30 text-green-400":"bg-gradient-to-br from-red-500/20 to-red-600/20 border border-red-500/30 text-red-400"])},i("LONG"===e.side?"↑":"↓"),3),a("div",null,[a("p",dn,[v(i(e.symbol)+" ",1),e.isPaper?(d(),t("span",cn,"PAPER")):o("",!0)]),a("p",{class:r(["text-xs font-bold flex items-center gap-1","LONG"===e.side?"text-green-400":"text-red-400"])},[a("span",null,i(e.side),1),a("span",un,i(Be(e))+"x",1)],2)])]),a("div",{class:r(["px-2 py-1 rounded-lg text-sm font-bold",Ne(e)>=0?"bg-green-500/20 text-green-400 border border-green-500/30":"bg-red-500/20 text-red-400 border border-red-500/30"])},i(Ne(e)>=0?"+":"")+"$"+i(Math.abs(Ne(e)).toFixed(2)),3)]),a("div",fn,[a("div",pn,[c[110]||(c[110]=a("p",{class:"text-white/50 text-[10px]"},"Size",-1)),a("p",vn,i(Number(e.size).toFixed(3)),1)]),c[114]||(c[114]=a("div",{class:"w-px h-6 bg-[#00f6ff]/20"},null,-1)),a("div",hn,[c[111]||(c[111]=a("p",{class:"text-white/50 text-[10px]"},"Entry",-1)),a("p",bn,i(Number(e.entryPrice).toFixed(2)),1)]),c[115]||(c[115]=a("div",{class:"w-px h-6 bg-[#00f6ff]/20"},null,-1)),a("div",mn,[c[112]||(c[112]=a("p",{class:"text-white/50 text-[10px]"},"Mark",-1)),a("p",xn,i(y(Se)(Oe(e.symbol),2)),1)]),c[116]||(c[116]=a("div",{class:"w-px h-6 bg-[#00f6ff]/20"},null,-1)),a("div",gn,[c[113]||(c[113]=a("p",{class:"text-white/50 text-[10px]"},"Liq",-1)),a("p",yn,i(0===e.liquidation||void 0===e.liquidation?"N/A":Number(e.liquidation).toFixed(0)),1)])]),V.value&&e.isPaper?(d(),t("div",wn,[a("button",{onClick:t=>ft(e,.25),class:"flex-1 py-1.5 text-[10px] font-bold bg-orange-500/10 border border-orange-500/30 text-orange-400 rounded-lg active:bg-orange-500/30 transition-all"}," Close 25% ",8,kn),a("button",{onClick:t=>ft(e,.5),class:"flex-1 py-1.5 text-[10px] font-bold bg-orange-500/10 border border-orange-500/30 text-orange-400 rounded-lg active:bg-orange-500/30 transition-all"}," Close 50% ",8,Sn),a("button",{onClick:t=>ft(e,.75),class:"flex-1 py-1.5 text-[10px] font-bold bg-orange-500/10 border border-orange-500/30 text-orange-400 rounded-lg active:bg-orange-500/30 transition-all"}," Close 75% ",8,Tn)])):o("",!0),a("div",_n,[a("button",{onClick:t=>(e=>{const t=e.tpPrice??0,a=e.slPrice??0;_t.value={position:e,enableTp:t>0,enableSl:a>0,tpPrice:t,slPrice:a,triggerPriceType:"MARK"},St.value=!0})(e),class:"py-1.5 px-2 bg-[#0d1424] hover:bg-[#131e33] text-[#1870f6] border border-[#1870f6]/30 rounded text-[10px] font-semibold transition-colors"}," TP/SL ",8,Mn),a("button",{onClick:t=>Jt("Limit",e),class:"py-1.5 px-2 bg-[#0d1424] hover:bg-[#131e33] text-white border border-[#1d2742] rounded text-[10px] font-semibold transition-colors"}," Limit ",8,Cn),a("button",{onClick:t=>Jt("Market",e),class:"py-1.5 px-2 bg-red-500/20 hover:bg-red-500/30 text-red-400 border border-red-500/30 rounded text-[10px] font-semibold transition-colors"}," Market Close ",8,Dn)])],4)],40,rn))),128))])):(d(),t("div",Pn,[a("p",Un,i(Pe.value?"No open positions":`No positions for ${Ce.value}`),1)]))])):o("",!0),"order"===Ie.value?(d(),t("div",Ln,[V.value?(d(),t(s,{key:0},[y(N).openOrders&&y(N).openOrders.length>0?(d(),t("div",jn,[a("p",zn,[c[119]||(c[119]=a("span",{class:"w-2 h-2 rounded-full bg-yellow-400 animate-pulse"},null,-1)),v(" Open Orders ("+i(y(N).openOrders.length)+") ",1)]),a("div",An,[(d(!0),t(s,null,l(y(N).openOrders,e=>(d(),t("div",{key:e.id,class:"bg-gradient-to-br from-yellow-900/20 to-yellow-800/10 border border-yellow-500/30 rounded-lg p-3"},[a("div",On,[a("div",null,[a("p",Nn,[v(i(e.symbol)+" ",1),c[120]||(c[120]=a("span",{class:"text-[9px] px-1 py-0.5 bg-emerald-500/20 text-emerald-400 rounded"},"PAPER",-1))]),a("p",{class:r(["text-xs font-semibold","BUY"===e.side?"text-green-400":"text-red-400"])},i(e.side)+" "+i("BUY"===e.side?"LONG":"SHORT"),3)]),a("div",Bn,[a("div",Fn,[a("p",En,i(e.type),1),c[121]||(c[121]=a("p",{class:"text-xs font-semibold text-yellow-400"},"PENDING",-1))]),a("button",{onClick:t=>
1{return a=e.id,void(N.cancelOrder(a)?J("Paper order cancelled",{type:"success",autoClose:2e3,position:"bottom-left"}):J("Failed to cancel order",{type:"error",autoClose:2e3,position:"bottom-left"}));var a},class:"p-1.5 bg-red-500/20 hover:bg-red-500/30 border border-red-500/30 rounded-lg transition-colors active:scale-95"},c[122]||(c[122]=[a("svg",{class:"w-4 h-4 text-red-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]),8,Yn)])]),a("div",In,[a("div",null,[c[123]||(c[123]=a("p",{class:"text-white/50"},"Limit Price",-1)),a("p",Vn,"$"+i(Number(e.price).toFixed(2)),1)]),a("div",Hn,[c[124]||(c[124]=a("p",{class:"text-white/50"},"Size",-1)),a("p",Rn,i(Number(e.size).toFixed(4)),1)]),a("div",$n,[c[125]||(c[125]=a("p",{class:"text-white/50"},"Current",-1)),a("p",Wn,i(de(e.symbol)),1)])])]))),128))])])):o("",!0),y(N).paperOrders&&y(N).paperOrders.filter(e=>"OPEN"!==e.status).length>0?(d(),t("div",qn,[c[129]||(c[129]=a("p",{class:"text-xs text-white/50 font-semibold mb-2"},"Order History",-1)),(d(!0),t(s,null,l(y(N).paperOrders.filter(e=>"OPEN"!==e.status),e=>(d(),t("div",{key:e.id,class:"bg-gradient-to-br from-emerald-900/20 to-emerald-800/10 border border-emerald-500/20 rounded-lg p-3"},[a("div",Gn,[a("div",null,[a("p",Xn,[v(i(e.symbol)+" ",1),c[126]||(c[126]=a("span",{class:"text-[9px] px-1 py-0.5 bg-emerald-500/20 text-emerald-400 rounded"},"PAPER",-1))]),a("p",{class:r(["text-xs font-semibold","BUY"===e.side?"text-green-400":"text-red-400"])},i(e.side)+" "+i("BUY"===e.side?"LONG":"SHORT"),3)]),a("div",Zn,[a("p",Kn,i(e.type),1),a("p",{class:r(["text-xs font-semibold","FILLED"===e.status?"text-green-400":"CANCELLED"===e.status?"text-red-400":"text-yellow-400"])},i(e.status),3)])]),a("div",Jn,[a("div",null,[c[127]||(c[127]=a("p",{class:"text-white/50"},"Price",-1)),a("p",Qn,"$"+i(Number(e.price).toFixed(2)),1)]),a("div",ei,[c[128]||(c[128]=a("p",{class:"text-white/50"},"Size",-1)),a("p",ti,i(Number(e.size).toFixed(4)),1)])])]))),128))])):o("",!0),y(N).paperOrders&&0!==y(N).paperOrders.length?o("",!0):(d(),t("div",ai,c[130]||(c[130]=[a("p",{class:"text-sm"},"No paper orders",-1)])))],64)):(d(),t(s,{key:1},[y(C).historicalOrders&&y(C).historicalOrders.length>0?(d(),t("div",si,[(d(!0),t(s,null,l(y(C).historicalOrders.slice(0,10),e=>(d(),t("div",{key:e.orderId,class:"bg-[#060a12] border border-[#00f6ff]/20 rounded-lg p-3"},[a("div",li,[a("div",null,[a("p",ri,i(e.symbol),1),a("p",{class:r(["text-xs font-semibold","BUY"===e.side?"text-green-400":"text-red-400"])},i(e.side)+" "+i("BUY"===e.side?"LONG":"SHORT"),3)]),a("div",oi,[a("p",ni,i(e.type),1),a("p",{class:r(["text-xs font-semibold","FILLED"===e.status?"text-green-400":"CANCELLED"===e.status?"text-red-400":"text-yellow-400"])},i(e.status),3)])]),a("div",ii,[a("div",null,[c[131]||(c[131]=a("p",{class:"text-white/50"},"Price",-1)),a("p",di,"$"+i(Number(e.price).toFixed(2)),1)]),a("div",ci,[c[132]||(c[132]=a("p",{class:"text-white/50"},"Size",-1)),a("p",ui,i(Number(e.size).toFixed(4)),1)])])]))),128))])):(d(),t("div",fi,c[133]||(c[133]=[a("p",{class:"text-sm"},"No orders",-1)])))],64))])):o("",!0),"assets"===Ie.value?(d(),t("div",pi,[V.value?(d(),t("div",vi,[a("div",hi,[c[134]||(c[134]=a("p",{class:"text-sm text-emerald-400/70 mb-2 flex items-center gap-1"},[a("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})]),v(" Paper Balance ")],-1)),a("p",bi,i(y(Se)(y(N).virtualBalance,2))+" USDT ",1)]),a("div",mi,[c[135]||(c[135]=a("p",{class:"text-sm text-emerald-400/70 mb-2"},"Paper Unrealized P&L",-1)),a("p",{class:r(["text-xl font-bold",ce.value>=0?"text-green-400":"text-red-400"])},i(ce.value>=0?"+":"")+i(y(Se)(ce.value,2))+" USDT ",3)]),a("div",xi,[c[136]||(c[136]=a("p",{class:"text-sm text-emerald-400/70 mb-2"},"Paper Total Equity",-1)),a("p",gi,i(y(Se)(y(N).virtualBalance+ce.value,2))+" USDT ",1)]),a("div",yi,[c[141]||(c[141]=a("p",{class:"text-sm text-emerald-400/70 mb
1-2"},"Paper Trading Stats",-1)),a("div",wi,[a("div",null,[c[137]||(c[137]=a("p",{class:"text-white/50"},"Total Trades",-1)),a("p",ki,i(y(N).stats.totalTrades),1)]),a("div",null,[c[138]||(c[138]=a("p",{class:"text-white/50"},"Win Rate",-1)),a("p",Si,i(y(N).stats.totalTrades>0?(y(N).stats.winCount/y(N).stats.totalTrades*100).toFixed(1):0)+"% ",1)]),a("div",null,[c[139]||(c[139]=a("p",{class:"text-white/50"},"Total P&L",-1)),a("p",{class:r(["font-bold",y(N).stats.totalPnL>=0?"text-green-400":"text-red-400"])},i(y(Se)(y(N).stats.totalPnL,2)),3)]),a("div",null,[c[140]||(c[140]=a("p",{class:"text-white/50"},"Total Fees",-1)),a("p",Ti," -"+i(y(Se)(y(N).stats.totalFees,2)),1)])])]),a("button",{onClick:c[33]||(c[33]=e=>q.value=!0),class:"w-full py-3 rounded-lg bg-gradient-to-r from-orange-500/20 to-red-500/20 border border-orange-500/30 text-orange-400 font-semibold text-sm hover:from-orange-500/30 hover:to-red-500/30 transition-all flex items-center justify-center gap-2"},c[142]||(c[142]=[a("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})],-1),v(" Reset Paper Account ",-1)]))])):(d(),t("div",_i,[a("div",Mi,[c[143]||(c[143]=a("p",{class:"text-sm text-white/50 mb-1"},"Available Balance",-1)),c[144]||(c[144]=a("p",{class:"text-[10px] text-white/40 mb-2"},"USDT only - used for margin calculations",-1)),a("p",Ci,i(y(Se)((null==(b=y(C).balance)?void 0:b.availableBalance)??0,2))+" USDT ",1)]),a("div",Di,[c[145]||(c[145]=a("p",{class:"text-sm text-[#00f6ff] mb-1"},"Total Balance (All Assets)",-1)),c[146]||(c[146]=a("p",{class:"text-[10px] text-white/40 mb-2"}," Includes all non-USDT assets in your account ",-1)),a("p",Pi,i(y(Se)((null==(S=y(C).balance)?void 0:S.totalValueWithoutDiscount)??0,2))+" USDT ",1)]),a("div",Ui,[c[147]||(c[147]=a("p",{class:"text-sm text-white/50 mb-2"},"Total Equity",-1)),a("p",Li,i(y(Se)(Number(Ct.value.totalEquity??0),2))+" USDT ",1)]),a("div",ji,[c[148]||(c[148]=a("p",{class:"text-sm text-white/50 mb-2"},"Wallet Balance",-1)),a("p",zi,i(y(Se)((null==(z=y(C).balance)?void 0:z.walletBalance)??0,2))+" USDT ",1)]),a("div",Ai,[c[149]||(c[149]=a("p",{class:"text-sm text-white/50 mb-2"},"Unrealized P&L",-1)),a("p",{class:r(["text-xl font-bold",Number((null==(A=y(C).balance)?void 0:A.unrealizedPnl)??0)>=0?"text-green-400":"text-red-400"])},i(Number((null==(E=y(C).balance)?void 0:E.unrealizedPnl)??0)>=0?"+":"")+i(y(Se)((null==(Y=y(C).balance)?void 0:Y.unrealizedPnl)??0,2))+" USDT ",3)])]))])):o("",!0),q.value?(d(),t("div",{key:4,class:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm flex items-center justify-center px-4",onClick:c[36]||(c[36]=D(e=>q.value=!1,["self"]))},[a("div",Oi,[c[151]||(c[151]=a("h3",{class:"text-lg font-bold text-white mb-3"},"Reset Paper Account",-1)),c[152]||(c[152]=a("p",{class:"text-white/60 text-sm mb-4"}," This will reset your paper trading account to the starting balance. All paper positions and trade history will be cleared. ",-1)),a("div",Ni,[c[150]||(c[150]=a("label",{class:"text-sm text-white/50 mb-1 block"},"Starting Balance (USDT)",-1)),w(a("input",{"onUpdate:modelValue":c[34]||(c[34]=e=>re.value=e),type:"number",min:"100",class:"w-full bg-black/50 border border-emerald-500/30 rounded-lg px-3 py-2.5 text-white focus:outline-none focus:border-emerald-500/60"},null,512),[[U,re.value,void 0,{number:!0}]])]),a("div",Bi,[a("button",{onClick:c[35]||(c[35]=e=>q.value=!1),class:"flex-1 px-4 py-2.5 rounded-lg border border-white/20 text-white hover:bg-white/10 transition-colors"}," Cancel "),a("button",{onClick:ne,class:"flex-1 px-4 py-2.5 rounded-lg bg-gradient-to-r from-emerald-500 to-emerald-600 text-white font-semibold hover:brightness-110 transition-all"}," Reset ")])])])):o("",!0),le.value?(d(),t("div",{key:5,class:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm flex items-center justify-center px-4",onClick:c[40]||(c[40]=D(e=>le.value=!1,["self"]))},[a("div",Fi,[c[155]||(c[155]=a("h3",{class:"text-lg font-bold text-white mb-3"},"Adjust Paper Balance",-1)),c[156]||(c[156]=a("p",{class:"text-white/60 text-sm mb-4"}," Set your paper trading balance. Your positions and trade history will be preserved. ",-1)),a("div",Ei,[c[153]||(c[153]=a("label",{class:"text-sm text-white/50 mb-1 block"},"Current Balance",-1)),a("p",Yi,i(y(Se)(H.value,2))+" USDT",1)]),a("div",Ii,[c[154]||(c[154]=a("label",{class:"text-sm text-white/50 mb-1 block"},"New Balance (USDT)",-1)),w(a("input",{"onUpdate:modelValue":c[37]||(c[37]=e=>oe.value=e),type:"number",min:"0",step:"100",class:"w-full bg-black/50 border border-emerald-500/30 rounded-lg px-3 py-2.5 text-white focus:outline-none focus:border-emerald-500/60"},null,512),[[U,oe.value,void 0,{number:!0}]])]),a("div",Vi,[(d(),t(s,null,l([1e3,5e3,1e4,5e4],e=>a("button",{key:e,onClick:t=>oe.value=e,class:r(["flex-1 py-2 rounded-lg text-xs font-semibold transition-colors",oe.value===e?"bg-emerald-500 text-white":"bg-emerald-500/20 text-emerald-400 hover:bg-emerald-500/30"])}," $"+i(e>=1e3?e/1e3+"k":e),11,Hi)),64))]),a("div",Ri,[a("button",{onClick:c[38]||(c[38]=e
1=>le.value=!1),class:"flex-1 px-4 py-2.5 rounded-lg border border-white/20 text-white hover:bg-white/10 transition-colors"}," Cancel "),a("button",{onClick:ie,class:"flex-1 px-4 py-2.5 rounded-lg bg-gradient-to-r from-emerald-500 to-emerald-600 text-white font-semibold hover:brightness-110 transition-all"}," Set Balance ")]),a("button",{onClick:c[39]||(c[39]=()=>{le.value=!1,q.value=!0}),class:"w-full mt-3 py-2 text-orange-400/80 text-xs font-medium hover:text-orange-400 transition-colors"}," Or reset entire paper account → ")])])):o("",!0),yt.value?(d(),t("div",{key:6,class:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm flex items-end justify-center",onClick:D(Qt,["self"])},[a("div",$i,[a("div",Wi,[a("h3",qi," Close "+i("Market"===kt.value.type?"Market":"Limit"),1),a("button",{onClick:Qt,class:"text-white/50 hover:text-white"},c[157]||(c[157]=[a("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),a("div",Gi,[a("div",Xi,[a("span",Zi,i(null==(I=kt.value.position)?void 0:I.symbol),1),c[158]||(c[158]=a("span",{class:"w-px h-4 bg-slate-600"},null,-1)),a("span",{class:r(["text-sm font-semibold px-2 py-0.5 rounded","LONG"===(null==(R=kt.value.position)?void 0:R.side)?"text-green-400 bg-green-500/10":"text-red-400 bg-red-500/10"])},i(null==($=kt.value.position)?void 0:$.side),3)]),a("div",Ki,[a("div",Ji,[c[159]||(c[159]=a("p",{class:"text-xs text-white/50"},"Entry Price",-1)),a("p",Qi," $"+i(Number(null==(W=kt.value.position)?void 0:W.entryPrice).toFixed(2)),1)]),a("div",ed,[c[160]||(c[160]=a("p",{class:"text-xs text-white/50"},"Last Price",-1)),a("p",td," $"+i(y(Se)(+((null==(G=Te.value)?void 0:G.p)??0),2)),1)])]),"Limit"===kt.value.type?(d(),t("div",ad,[c[162]||(c[162]=a("label",{class:"text-sm text-white/50"},"Close Price",-1)),a("div",sd,[w(a("input",{"onUpdate:modelValue":c[41]||(c[41]=e=>kt.value.closePrice=e),type:"number",placeholder:"Close Price",class:"flex-1 bg-transparent text-white text-sm outline-none"},null,512),[[U,kt.value.closePrice,void 0,{number:!0}]]),c[161]||(c[161]=a("span",{class:"text-white/50 text-sm"},"USDT",-1))])])):o("",!0),a("div",ld,[a("div",rd,[c[163]||(c[163]=a("label",{class:"text-white/50"},"Quantity",-1)),a("span",od,i(kt.value.closeSize)+" / "+i(Kt(kt.value.position).toFixed(4)),1)]),w(a("input",{"onUpdate:modelValue":c[42]||(c[42]=e=>kt.value.closeSize=e),type:"range",min:0,max:Kt(kt.value.position),step:parseFloat((null==(X=y(C).symbol)?void 0:X.stepSize)||"0.001"),class:"w-full h-2 bg-gradient-to-r from-[#00f6ff] to-[#1870f6] rounded-[3px] appearance-none cursor-pointer"},null,8,nd),[[U,kt.value.closeSize]]),c[164]||(c[164]=a("div",{class:"flex justify-between text-xs text-white/50"},[a("span",null,"0%"),a("span",null,"25%"),a("span",null,"50%"),a("span",null,"75%"),a("span",null,"100%")],-1)),a("div",id,[(d(),t(s,null,l([25,50,75,100],e=>a("button",{key:e,onClick:()=>{kt.value.closeSize=100===e?Kt(kt.value.position):oa(Kt(kt.value.position)*e/100)},class:"py-1 bg-[#0d1424] hover:bg-[#131e33] rounded text-xs text-white transition-colors"},i(e)+"% ",9,dd)),64)),a("button",{onClick:c[43]||(c[43]=e=>kt.value.closeSize=Kt(kt.value.position)),class:"py-1 bg-[#0d1424] hover:bg-[#131e33] rounded text-xs text-white transition-colors"}," Max ")])]),a("div",cd,[a("button",{onClick:Qt,class:"py-3 bg-[#0d1424] hover:bg-[#131e33] text-white rounded font-semibold transition-colors"}," Cancel "),a("button",{onClick:ea,disabled:wt.value||!kt.value.closeSize||kt.value.closeSize<=0,class:"py-3 bg-gradient-to-r from-yellow-500 to-amber-500 hover:from-yellow-400 hover:to-amber-400 text-slate-900 rounded font-bold transition-all disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2"},[wt.value?(d(),t("span",fd)):(d(),t("span",pd,"Confirm"))],8,ud)])])])])):o("",!0),St.value?(d(),t("div",{key:7,class:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm flex items-end justify-center",onClick:D(ta,["self"])},[a("div",vd,[a("div",{class:"px-4 py-3 border-b border-[#00f6ff]/20 flex items-center justify-between sticky top-0 bg-[#060a12]"},[c[166]||(c[166]=a("h3",{class:"text-lg font-bold text-white"},"Set TP/SL",-1)),a("button",{onClick:ta,class:"text-white/50 hover:text-white"},c[165]||(c[165]=[a("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),a("div",hd,[a("div",bd,[a("span",md,i(null==(Z=_t.value.position)?void 0:Z.symbol),1),c[167]||(c[167]=a("span",{class:"w-px h-4 bg-slate-600"},null,-1)),a("span",{class:r(["text-sm font-semibold px-2 py-0.5 rounded","LONG"===(null==(K=_t.value.position)?void 0:K.side)?"text-green-400 bg-green-500/10":"text-red-400 bg-red-500/10"])},i(null==(Q=_t.value.position)?void 0:Q.side),3)]),a("div",xd,[a("div",gd,[c[168]||(c[168]=a("p",{class:"text-xs text-white/50"},"Entry",-1)),a("p",yd," $"+i(Number(null==(ee=_t.value.position)?void 0:ee.entryPrice).toFixed(2)),1)]),a("div",wd,[c[169]||(c[169]=a("p",{class:"text-xs text-white/50"},"Mark",-1)),a("p",kd," $"+i(y(Se)(+((null==(ae=Te.value)?void 0:ae.p)??
10),2)),1)]),a("div",Sd,[c[170]||(c[170]=a("p",{class:"text-xs text-white/50"},"Size",-1)),a("p",Td,i(Number(null==(se=_t.value.position)?void 0:se.size).toFixed(4)),1)])]),a("div",_d,[a("div",Md,[c[171]||(c[171]=a("label",{class:"text-sm font-semibold text-green-400"},"Take Profit",-1)),a("button",{onClick:c[44]||(c[44]=e=>_t.value.enableTp=!_t.value.enableTp),class:r(["px-3 py-1 rounded text-xs font-semibold transition-all",_t.value.enableTp?"bg-green-500/20 text-green-400 border border-green-500/30":"bg-[#0d1424]/50 text-white/50 border border-[#1d2742]"])},i(_t.value.enableTp?"Enabled":"Disabled"),3)]),_t.value.enableTp?(d(),t("div",Cd,[a("div",Dd,[w(a("input",{"onUpdate:modelValue":c[45]||(c[45]=e=>_t.value.tpPrice=e),type:"number",placeholder:"LONG"===(null==(fe=_t.value.position)?void 0:fe.side)?"Above entry price":"Below entry price",class:"flex-1 bg-transparent text-green-400 text-sm outline-none",step:"0.01"},null,8,Pd),[[U,_t.value.tpPrice,void 0,{number:!0}]]),c[172]||(c[172]=a("span",{class:"text-white/50 text-sm"},"USDT",-1))]),_t.value.tpPrice>0?(d(),t("div",Ud,[a("div",Ld,[c[173]||(c[173]=a("span",{class:"text-white/50"},"Estimated P&L:",-1)),a("span",jd," +$"+i(aa(_t.value.tpPrice).toFixed(2))+" ("+i(sa(_t.value.tpPrice).toFixed(2))+"%) ",1)])])):o("",!0)])):o("",!0)]),a("div",zd,[a("div",Ad,[c[174]||(c[174]=a("label",{class:"text-sm font-semibold text-red-400"},"Stop Loss",-1)),a("button",{onClick:c[46]||(c[46]=e=>_t.value.enableSl=!_t.value.enableSl),class:r(["px-3 py-1 rounded text-xs font-semibold transition-all",_t.value.enableSl?"bg-red-500/20 text-red-400 border border-red-500/30":"bg-[#0d1424]/50 text-white/50 border border-[#1d2742]"])},i(_t.value.enableSl?"Enabled":"Disabled"),3)]),_t.value.enableSl?(d(),t("div",Od,[a("div",Nd,[w(a("input",{"onUpdate:modelValue":c[47]||(c[47]=e=>_t.value.slPrice=e),type:"number",placeholder:"LONG"===(null==(ve=_t.value.position)?void 0:ve.side)?"Below entry price":"Above entry price",class:"flex-1 bg-transparent text-red-400 text-sm outline-none",step:"0.01"},null,8,Bd),[[U,_t.value.slPrice,void 0,{number:!0}]]),c[175]||(c[175]=a("span",{class:"text-white/50 text-sm"},"USDT",-1))]),_t.value.slPrice>0?(d(),t("div",Fd,[a("div",Ed,[c[176]||(c[176]=a("span",{class:"text-white/50"},"Estimated P&L:",-1)),a("span",Yd," -$"+i(Math.abs(aa(_t.value.slPrice)).toFixed(2))+" ("+i(sa(_t.value.slPrice).toFixed(2))+"%) ",1)])])):o("",!0)])):o("",!0)]),a("div",Id,[c[177]||(c[177]=a("label",{class:"text-sm text-white/50"},"Trigger Price Type",-1)),a("div",Vd,[(d(),t(s,null,l(["MARK","LAST","INDEX"],e=>a("button",{key:e,onClick:()=>{_t.value.triggerPriceType=e},class:r(["py-2 rounded text-xs font-semibold transition-all",_t.value.triggerPriceType===e?"bg-[#00f6ff]/20 text-[#00f6ff] border border-[#00f6ff]/30":"bg-[#060a12] text-white/50 border border-[#1d2742]"])},i(e),11,Hd)),64))])]),a("div",Rd,[a("button",{onClick:ta,class:"py-3 bg-[#0d1424] hover:bg-[#131e33] text-white rounded font-semibold transition-colors"}," Cancel "),a("button",{onClick:la,disabled:Tt.value||!_t.value.enableTp&&!_t.value.enableSl,class:"py-3 bg-[#1870f6] hover:bg-[#1870f6]/80 text-white rounded-[6px] font-bold transition-all disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2"},[Tt.value?(d(),t("span",Wd)):(d(),t("span",qd,"Set TP/SL"))],8,$d)])])])])):o("",!0),(d(),x(M,{to:"body"},[m(_,{name:"slide-up"},{default:T(()=>[Bt.value?(d(),t("div",Gd,[a("button",{onClick:Et,class:"absolute bottom-20 left-4 z-[10000] p-3 bg-[#0d1421]/80 backdrop-blur-sm hover:bg-[#00f6ff]/20 rounded-lg transition-all active:scale-95 shadow-lg"},c[178]||(c[178]=[a("svg",{class:"w-6 h-6 text-[#00f6ff]",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])),a("div",Xd,[(d(),x(j,null,{default:T(()=>[(d(),x(ue,{key:`mobile-trade-chart-${Ce.value}`,"card-id":`mobile-trade-chart-${Ce.value}`,"symbol-label":Ce.value,timeframe:"15"},null,8,["card-id","symbol-label"]))]),fallback:T(()=>c[179]||(c[179]=[a("div",{class:"flex items-center justify-center h-full"},[a("div",{class:"text-center text-white/50"},[a("div",{class:"animate-spin rounded-full h-8 w-8 border-b-2 border-[#00f6ff] mx-auto mb-2"}),a("p",{class:"text-sm"},"Loading chart...")])],-1)])),_:1}))])])):o("",!0)]),_:1})]))],32)}}}),[["__scopeId","data-v-94067d7e"]]),Jd={class:"w-full min-h-screen bg-transparent text-white flex flex-col"},Qd={class:"flex-1 flex flex-col justify-center px-6 pb-20 gap-6"},ec={class:"flex flex-wrap gap-2 justify-center"},tc=e({__name:"MobileAgentChat",setup(e){const r=["Live market briefings","AI trade analysis","Portfolio insights","New product drops","Market intelligence"];return(e,o)=>(d(),t("div",Jd,[o[3]||(o[3]=n('<div class="bg-[#070b15] border-b border-white/[0.06] px-4 py-3 flex items-center gap-3"><div class="w-8 h-8 rounded-[6px] bg-[#00f6ff]/10 border border-[#00f6ff]/20 flex items-center justify-center"><svg class="w-4 h-4 text-[#00f6ff]" fill="none" stroke="currentColor" viewBox="0 0 24 24">
1<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"></path></svg></div><div><p class="text-sm font-bold text-white">Eagle Stealth</p><p class="text-[10px] text-white/40">AI Trading Intelligence</p></div></div>',1)),a("div",Qd,[o[0]||(o[0]=n('<div class="w-20 h-20 rounded-2xl bg-[#00f6ff]/10 border border-[#00f6ff]/20 flex items-center justify-center mx-auto"><svg class="w-10 h-10 text-[#00f6ff]" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M13 10V3L4 14h7v7l9-11h-7z"></path></svg></div><div class="text-center"><h1 class="text-2xl font-bold text-white mb-2">Eagle Stealth</h1><p class="text-white/50 text-sm leading-relaxed"> Your AI trading intelligence agent. Get live market analysis, trade ideas, and real-time insights — all in one place. </p></div>',2)),a("div",ec,[(d(),t(s,null,l(r,e=>a("span",{key:e,class:"px-3 py-1 bg-[#00f6ff]/10 border border-[#00f6ff]/20 rounded-full text-[11px] text-[#00f6ff] font-medium"},i(e),1)),64))]),o[1]||(o[1]=a("a",{href:"https://stealth.eagleailabs.com/briefing",target:"_blank",rel:"noopener",style:{display:"block",width:"100%","max-width":"20rem",margin:"0 auto"},class:"bg-[#00f6ff] hover:bg-[#00e0e8] text-[#0b1120] font-bold py-4 rounded-[6px] text-center text-sm transition-all shadow-lg shadow-[#00f6ff]/20"}," Open Eagle Stealth → ",-1)),o[2]||(o[2]=a("p",{class:"text-white/25 text-xs text-center"},"Opens in your browser · Free with your CLAW subscription",-1))])]))}}),ac=F(e({__name:"MobileVault",emits:["navigate-to-tab"],setup(e,{emit:a}){const s=a,l=Ae(),o=c(()=>l.getActiveSkin().cssClass);return f(()=>{l.applySkinClass(),"custom"===l.activeSkinId&&l.applyCustomColors()}),(e,a)=>(d(),t("div",{class:r(["mobile-autotrade-shell","claw-scope","claw-v2","claw-workspace-bg",o.value])},[m(ze,{onNavigateToTab:a[0]||(a[0]=e=>s("navigate-to-tab",e))})],2))}}),[["__scopeId","data-v-0a0b216c"]]),sc={class:"w-full min-h-screen bg-transparent text-white overflow-y-auto overflow-x-hidden antialiased scrollbar-hide pb-[calc(1.5rem+env(safe-area-inset-bottom,0px))]"},lc={class:"px-3 pt-3 space-y-3"},rc={class:"bg-black border border-[#1d2742] rounded-[6px] overflow-hidden",style:{"min-height":"320px"}},oc={class:"h-[280px]"},nc={class:"bg-black border border-[#1d2742] rounded-[6px] overflow-hidden",style:{"min-height":"280px"}},ic={class:"h-[240px]"},dc={class:"bg-black border border-[#1d2742] rounded-[6px] overflow-hidden",style:{"min-height":"280px"}},cc={class:"h-[240px]"},uc=F(e({__name:"MobilePostTrade",setup:e=>(e,s)=>(d(),t("div",sc,[s[6]||(s[6]=a("div",{class:"px-4 pt-4 pb-3 bg-[#070b15] border-b border-white/[0.06]"},[a("h1",{class:"text-lg font-bold text-white"},"Post-Trade"),a("p",{class:"text-xs text-white/40 mt-0.5"},"Performance analytics & equity curve")],-1)),a("div",lc,[a("div",rc,[s[1]||(s[1]=a("div",{class:"px-3 pt-2.5 pb-1 bg-[#060a12] border-b border-[#1d2742]"},[a("p",{class:"text-[10px] font-semibold text-white/[0.42] uppercase tracking-wider"},"Equity Curve")],-1)),a("div",oc,[(d(),x(j,null,{default:T(()=>[m(Oe)]),fallback:T(()=>s[0]||(s[0]=[a("div",{class:"flex items-center justify-center h-full"},[a("div",{class:"animate-spin rounded-full h-6 w-6 border-b-2 border-[#00f6ff]"})],-1)])),_:1}))])]),a("div",nc,[s[3]||(s[3]=a("div",{class:"px-3 pt-2.5 pb-1 bg-[#060a12] border-b border-[#1d2742]"},[a("p",{class:"text-[10px] font-semibold text-white/[0.42] uppercase tracking-wider"},"Performance Stats")],-1)),a("div",ic,[(d(),x(j,null,{default:T(()=>[m(Ne)]),fallback:T(()=>s[2]||(s[2]=[a("div",{class:"flex items-center justify-center h-full"},[a("div",{class:"animate-spin rounded-full h-6 w-6 border-b-2 border-[#00f6ff]"})],-1)])),_:1}))])]),a("div",dc,[s[5]||(s[5]=a("div",{class:"px-3 pt-2.5 pb-1 bg-[#060a12] border-b border-[#1d2742]"},[a("p",{class:"text-[10px] font-semibold text-white/[0.42] uppercase tracking-wider"},"Trade Activity")],-1)),a("div",cc,[(d(),x(j,null,{default:T(()=>[m(Be)]),fallback:T(()=>s[4]||(s[4]=[a("div",{class:"flex items-center justify-center h-full"},[a("div",{class:"animate-spin rounded-full h-6 w-6 border-b-2 border-[#00f6ff]"})],-1)])),_:1}))])])])]))}),[["__scopeId","data-v-8449666a"]]),fc="claw_custom_portfolios",pc=u([]);let vc=!1;function hc(){try{const e=JSON.stringify(pc.value);return localStorage.setItem(fc,e),localStorage.getItem(fc)===e||(console.error("localStorage verification failed - Safari may be in private mode"),alert("⚠️ Unable to save portfolio. Please disable private browsing mode."),!1)}catch(e){return console.error("Failed to save portfolios:",e),alert("⚠️ Unable to save portfolio. Check browser storage settings."),!1}}const bc="claw_price_history";function mc(){try{const e=localStorage.getItem(bc);if(e)return JSON.parse(e)}catch(e){console.error("Failed to load price history:",e)}return{}}function xc(e,t){const a=mc()[e];if(!a||0===a.length)return null;let s=a[0],l=Math.abs(a[0].timestamp-t);for(const r of a){const e=Math.abs(r.timestamp-t);if(e<l&&(s=r,l=e),r.timestamp>t)break}return l<72e5?s.price:null}const gc=Object.freeze(Object.defineProperty({__proto__:null,fetchAndCacheHistoricalPrices:async function(e,t=30,a="1h"){try{const l=`${e}USDT`;let r,o;r="1h"===a?Math.min(24*t,1e3):Math.min(t,1e3);
1try{const e=`https://api.binance.com/api/v3/klines?symbol=${l}&interval=${a}&limit=${r}`;if(o=await fetch(e,{signal:AbortSignal.timeout(5e3)}),!o.ok)throw new Error(`Binance.com API error: ${o.status}`)}catch(s){console.warn("[PriceHistory] Binance.com failed, trying Binance.US...",s);const e=`https://api.binance.us/api/v3/klines?symbol=${l}&interval=${a}&limit=${r}`;if(o=await fetch(e,{signal:AbortSignal.timeout(5e3)}),!o.ok)throw new Error(`Binance API error: ${o.status}`)}const n=await o.json();if(!Array.isArray(n)||0===n.length)throw new Error("Invalid response from Binance");const i=n.map(e=>({timestamp:e[0],price:parseFloat(e[4])}));if(0===i.length)return!1;const d=mc();d[e]||(d[e]=[]);const c=new Set(d[e].map(e=>e.timestamp));i.forEach(t=>{c.has(t.timestamp)||d[e].push(t)}),d[e].sort((e,t)=>e.timestamp-t.timestamp);const u=Date.now()-7776e6;return d[e]=d[e].filter(e=>e.timestamp>=u),function(e){try{localStorage.setItem(bc,JSON.stringify(e))}catch(t){console.error("Failed to save price history:",t)}}(d),!0}catch(l){return console.error("Failed to fetch price history:",l),!1}},getCachedPrice:xc},Symbol.toStringTag,{value:"Module"}));const yc={class:"w-full"},wc={class:"flex gap-2 mb-4 overflow-x-auto scrollbar-hide pb-2"},kc=["onClick"],Sc={class:"bg-gradient-to-br from-[#131328] to-[#1e273f] rounded-lg border border-[#00ffff]/20 p-4"},Tc={class:"mb-4"},_c={class:"flex items-center gap-2 mt-1"},Mc={class:"mt-4 text-xs text-[#00ffff]/60"},Cc={class:"text-white font-medium"},Dc=F(e({__name:"PortfolioPerformanceChart",props:{summary:{},snapshots:{}},emits:["range-change"],setup(e,{emit:o}){const n=e,p=u(null),m=u("24H"),x=[{value:"1H",label:"1h"},{value:"24H",label:"24h"},{value:"7D",label:"7d"},{value:"30D",label:"30d"},{value:"90D",label:"90d"},{value:"1Y",label:"1y"},{value:"ALL",label:"All"}];let g=null,y=null;const w=o;b(m,e=>{w("range-change",e)});const k=c(()=>{if(0===n.snapshots.length)return[];const e=Date.now();let t=0;switch(m.value){case"1H":t=e-36e5;break;case"24H":t=e-864e5;break;case"7D":t=e-6048e5;break;case"30D":t=e-2592e6;break;case"90D":t=e-7776e6;break;case"1Y":t=e-31536e6;break;case"ALL":return n.snapshots}return n.snapshots.filter(e=>e.timestamp>=t)}),S=e=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2}).format(e),T=()=>{if(!g)return;const e=k.value;if(0===e.length)return void g.setOption({title:{text:"Add transactions to see chart",left:"center",top:"center",textStyle:{color:"rgba(0, 255, 255, 0.4)",fontSize:11,fontWeight:"normal"}},grid:{left:10,right:10,top:10,bottom:25,containLabel:!0},xAxis:{type:"time",boundaryGap:!1,axisLine:{lineStyle:{color:"rgba(0, 255, 255, 0.1)"}},axisLabel:{color:"rgba(0, 255, 255, 0.3)",fontSize:9},splitLine:{show:!1}},yAxis:{type:"value",axisLine:{show:!1},axisLabel:{color:"rgba(0, 255, 255, 0.3)",fontSize:9},splitLine:{lineStyle:{color:"rgba(0, 255, 255, 0.05)"}}},series:[]});const t=e.map(e=>e.timestamp),a=e.map(e=>e.totalValue),s=e.map(e=>e.totalInvested),l=n.summary.totalPnl>=0,r=l?"#5ec485":"#eb5c57",o=l?"rgba(94, 196, 133, 0.1)":"rgba(235, 92, 87, 0.1)",i={backgroundColor:"transparent",title:{show:!1},tooltip:{trigger:"axis",backgroundColor:"rgba(19, 19, 40, 0.95)",borderColor:"#00ffff",borderWidth:1,textStyle:{color:"#fff",fontSize:11},formatter:e=>{const t=e[0],a=e[1];if(!t)return"";const s=new Date(t.axisValue).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"}),l=t.value,r=(null==a?void 0:a.value)||0,o=l-r,n=r>0?o/r*100:0,i=o>=0?"#5ec485":"#eb5c57";return`\n          <div style="padding: 4px;">\n            <div style="font-size: 10px; color: #00ffff; margin-bottom: 4px;">${s}</div>\n            <div style="font-weight: bold; font-size: 12px; margin-bottom: 2px;">\n              ${S(l)}\n            </div>\n            <div style="font-size: 10px; color: rgba(255,255,255,0.6);">\n              Invested: ${S(r)}\n            </div>\n            <div style="font-size: 11px; color: ${i}; font-weight: 600; margin-top: 2px;">\n              ${o>=0?"+":""}${S(o)} (${n.toFixed(2)}%)\n            </div>\n          </div>\n        `}},grid:{left:10,right:10,top:10,bottom:25,containLabel:!0}
1,xAxis:{type:"time",boundaryGap:!1,axisLine:{lineStyle:{color:"rgba(0, 255, 255, 0.1)"}},axisLabel:{color:"rgba(0, 255, 255, 0.5)",fontSize:9,formatter:e=>{const t=new Date(e),a=m.value;return"1H"===a||"24H"===a?t.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}):t.toLocaleDateString("en-US",{month:"short",day:"numeric"})}},splitLine:{show:!1}},yAxis:{type:"value",scale:!0,min:function(e){const t=(e.max+e.min)/2*.1;return e.min-t},max:function(e){const t=(e.max+e.min)/2*.1;return e.max+t},axisLine:{show:!1},axisLabel:{color:"rgba(0, 255, 255, 0.5)",fontSize:9,formatter:e=>e>=1e6?`$${(e/1e6).toFixed(1)}M`:e>=1e3?`$${(e/1e3).toFixed(1)}K`:`$${e.toFixed(0)}`},splitLine:{lineStyle:{color:"rgba(0, 255, 255, 0.05)"}}},series:[{name:"Portfolio Value",type:"line",data:t.map((e,t)=>[e,a[t]]),smooth:!0,symbol:"none",lineStyle:{color:r,width:2},areaStyle:{color:new Ee(0,0,0,1,[{offset:0,color:o},{offset:1,color:"transparent"}])},emphasis:{focus:"series",lineStyle:{width:3}}},{name:"Total Invested",type:"line",data:t.map((e,t)=>[e,s[t]]),smooth:!0,symbol:"none",lineStyle:{color:"rgba(0, 255, 255, 0.3)",width:1,type:"dashed"},emphasis:{focus:"none"}}]};g.setOption(i,!0),setTimeout(()=>{null==g||g.resize()},100)};return b(()=>[n.snapshots,n.summary,m.value],()=>{T()},{deep:!0,immediate:!1}),b(()=>n.snapshots.length,(e,t)=>{0===t&&e>0&&setTimeout(()=>{T(),null==g||g.resize()},150)}),f(()=>{(async()=>{await z();const e=p.value;e&&0!==e.clientWidth&&0!==e.clientHeight&&(g=Fe(e),T(),y=new ResizeObserver(()=>{null==g||g.resize()}),y.observe(e))})()}),h(()=>{null==y||y.disconnect(),y=null,null==g||g.dispose(),g=null}),(e,o)=>(d(),t("div",yc,[a("div",wc,[(d(),t(s,null,l(x,e=>a("button",{key:e.value,onClick:t=>m.value=e.value,class:r(["px-4 py-2 text-sm font-semibold rounded-xl transition-all whitespace-nowrap flex-shrink-0",m.value===e.value?"bg-white text-[#090f1d] shadow-lg":"bg-[#131328] text-[#00ffff]/70 hover:bg-[#1e273f]"])},i(e.label),11,kc)),64))]),a("div",Sc,[a("div",Tc,[a("div",{class:r(["text-2xl font-bold",e.summary.totalPnl>=0?"text-[#5ec485]":"text-[#eb5c57]"])},i(S(e.summary.totalValue)),3),a("div",_c,[o[0]||(o[0]=a("span",{class:"text-xs text-[#00ffff]/60"},"Total Value",-1)),a("span",{class:r(["text-xs font-semibold px-1.5 py-0.5 rounded",e.summary.totalPnl>=0?"bg-[#5ec485]/20 text-[#5ec485]":"bg-[#eb5c57]/20 text-[#eb5c57]"])},i(e.summary.totalPnl>=0?"+":"")+i(S(e.summary.totalPnl))+" ("+i(e.summary.totalPnlPercent.toFixed(2))+"%) ",3)])]),a("div",{ref_key:"chartRef",ref:p,class:"w-full h-48"},null,512),a("div",Mc,[o[1]||(o[1]=v(" Total Invested: ",-1)),a("span",Cc,i(S(e.summary.totalInvested)),1)])])]))}}),[["__scopeId","data-v-6aa4e3b9"]]),Pc={class:"w-full bg-[#090f1d] text-white pb-24"},Uc={key:0,class:"flex flex-col items-center justify-center py-16 px-4"},Lc={key:1,class:"px-4 py-4"},jc={class:"flex items-center justify-between mb-4"},zc={class:"space-y-3"},Ac=["onClick"],Oc={class:"flex items-start justify-between"},Nc={class:"flex-1"},Bc={class:"font-semibold text-white mb-1"},Fc={class:"text-xs text-[#00ffff]/60"},Ec=["onClick"],Yc={key:2,class:"pb-4"},Ic={class:"bg-gradient-to-br from-[#131328] to-[#1e273f] border-b border-[#00ffff]/20 px-4 py-4"},Vc={class:"flex items-center justify-between mb-4"},Hc={class:"text-lg font-bold text-[#00ffff]"},Rc={class:"bg-[#090f1d]/50 rounded-lg p-4 border border-[#00ffff]/10"},$c={class:"flex items-center gap-2 mt-2"},Wc={class:"text-xs"},qc={class:"text-white font-medium ml-1"},Gc={class:"px-4 py-4"},Xc={key:0,class:"px-4 py-4"},Zc={class:"space-y-2"},Kc={class:"flex items-start justify-between mb-2"},Jc={class:"flex-1"},Qc={class:"font-semibold text-white"},eu={class:"text-xs text-[#00ffff]/60 mt-0.5"},tu={class:"text-right"},au={class:"flex items-center justify-between text-xs"},su={class:"text-[#00ffff]/60"},lu={class:"text-white font-medium"},ru={class:"mt-2"},ou={class:"h-1 bg-[#1e273f] rounded-full overflow-hidden"},nu={class:"text-xs text-[#00ffff]/60 mt-1"},iu={key:1,class:"px-4 py-4"},du={class:"space-y-2"},cu={class:"flex-1"},uu={class:"flex items-center gap-2 mb-1"},fu={class:"font-medium text-white"},pu={class:"text-xs text-[#00ffff]/60"},vu={key:0,class:"text-xs text-[#00ffff]/40 mt-1 italic"},hu=["onClick"],bu={key:2,class:"flex flex-col items-center justify-center py-12 px-4"},mu={class:"bg-gradient-to-br from-[#131328] to-[#1e273f] rounded-xl border border-[#00ffff]/20 p-8 w-full max-w-full mx-2"},xu={class:"flex gap-3"},gu=["disabled"],yu={class:"bg-gradient-to-br from-[#131328] to-[#1e273f] rounded-t-2xl border-t border-x border-[#00ffff]/20 w-full max-w-full max-h-[90vh] flex flex-col"},wu={class:"flex items-center justify-between p-6 pb-4 flex-shrink-0"},ku={class:"px-6 pb-6 overflow-y-auto flex-1"},Su={class:"space-y-4"},Tu={class:"grid grid-cols-2 gap-2"},_u={class:"relative"},Mu={key:0,class:"absolute top-full left-0 right-0 mt-1 bg-[#131328] border border-[#00ffff]/30 rounded-lg shadow-xl overflow-hidden",style:{"z-index":"9999"}},Cu={class:"px-4 py-2 bg-[#090f1d]/50 border-b border-[#00ffff]/20 flex items-center justify-between sticky top-0"},Du={class:"text-xs text-[#00ffff]/70"},Pu={class:"max-h-56 overflow-y-auto"},Uu=["onMousedown"],Lu={class:"flex items-center gap-2"},ju={class:"text-white font-medium"}
1,zu={key:0,class:"text-xs px-2 py-0.5 rounded bg-[#5ec485]/20 text-[#5ec485]"},Au={key:1,class:"text-xs px-2 py-0.5 rounded bg-[#ff9500]/20 text-[#ff9500]"},Ou={key:1,class:"text-xs text-[#00ffff]/60 mt-1"},Nu={class:"bg-[#090f1d]/50 rounded-lg p-3 border border-[#00ffff]/10"},Bu={class:"flex items-center justify-between text-sm"},Fu={class:"font-semibold text-white"},Eu={class:"flex gap-2 px-6 pb-6 pt-4 flex-shrink-0 border-t border-[#00ffff]/10"},Yu=["disabled"],Iu=["disabled"],Vu={key:0,class:"w-4 h-4 animate-spin",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Hu="@coinscreener.full",Ru=F(e({__name:"CustomPortfolioTracker",setup(e){const p=(function(){if(!vc)try{const e=localStorage.getItem(fc);if(e){const t=JSON.parse(e);Array.isArray(t)&&(pc.value=t)}vc=!0}catch(e){console.error("Failed to load portfolios:",e),pc.value=[],vc=!0}}(),{portfolios:c(()=>pc.value),getPortfolio:e=>pc.value.find(t=>t.id===e),createPortfolio:e=>{const t={id:`portfolio_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,name:e,createdAt:Date.now(),updatedAt:Date.now(),transactions:[]};return pc.value.push(t),hc(),t},deletePortfolio:e=>{const t=pc.value.findIndex(t=>t.id===e);return-1!==t&&(pc.value.splice(t,1),hc(),!0)},addTransaction:(e,t)=>{const a=pc.value.find(t=>t.id===e);if(!a)return null;const s={id:`tx_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,portfolioId:e,...t};return a.transactions.push(s),a.updatedAt=Date.now(),hc(),s},deleteTransaction:(e,t)=>{const a=pc.value.find(t=>t.id===e);if(!a)return!1;const s=a.transactions.findIndex(e=>e.id===t);return-1!==s&&(a.transactions.splice(s,1),a.updatedAt=Date.now(),hc(),!0)}}),b=he(),x=u(null),y=u(!1),k=u(!1),S=u(""),T=u("24H"),_=u({type:"BUY",symbol:"",quantity:0,pricePerCoin:0,fee:0,datetime:(new Date).toISOString().slice(0,16),notes:""}),M=u(!1),C=u(!1),P=u([]),L=c(()=>p.portfolios.value),j=c(()=>x.value?p.getPortfolio(x.value):null),z=c(()=>j.value?function(e){const t=ve(),a=c(()=>{var e;const a=new Map;return((null==(e=t.data)?void 0:e["@coinscreener.full"])||[]).forEach(e=>{const t=String(e.symbol||""),s=Number(e.lastPrice??0);if(t.includes("USDT")){const e=t.replace("USDT","");a.set(e,s),a.set(t,s)}else if(t.includes("USDC")){const e=t.replace("USDC","");a.set(e,s),a.set(t,s)}}),a}),s=c(()=>{const t=new Map;[...e.transactions].sort((e,t)=>e.timestamp-t.timestamp).forEach(e=>{const a=t.get(e.symbol)||{totalQuantity:0,totalCost:0,transactions:0};if("BUY"===e.type)a.totalQuantity+=e.quantity,a.totalCost+=e.quantity*e.pricePerCoin+e.fee,a.transactions++;else if("SELL"===e.type){const t=a.totalQuantity>0?a.totalCost/a.totalQuantity:0;a.totalQuantity-=e.quantity,a.totalCost-=e.quantity*t,a.totalCost-=e.fee,a.transactions++}t.set(e.symbol,a)});const s=[];let l=0;return t.forEach((e,t)=>{if(e.totalQuantity<=0)return;const r=a.value.get(t)||0,o=e.totalQuantity*r,n=e.totalCost/e.totalQuantity,i=o-e.totalCost,d=e.totalCost>0?i/e.totalCost*100:0;l+=o,s.push({symbol:t,totalQuantity:e.totalQuantity,averageEntryPrice:n,totalInvested:e.totalCost,currentPrice:r,currentValue:o,unrealizedPnl:i,unrealizedPnlPercent:d,percentOfPortfolio:0})}),l>0&&s.forEach(e=>{e.percentOfPortfolio=e.currentValue/l*100}),s.sort((e,t)=>t.currentValue-e.currentValue)}),l=c(()=>{const e=s.value,t=e.reduce((e,t)=>e+t.currentValue,0),a=e.reduce((e,t)=>e+t.totalInvested,0),l=t-a,r=a>0?l/a*100:0,o=[...e].sort((e,t)=>t.unrealizedPnlPercent-e.unrealizedPnlPercent);return{totalValue:t,totalInvested:a,totalPnl:l,totalPnlPercent:r,holdings:e,bestPerformer:o[0],worstPerformer:o[o.length-1],snapshots:[]}});return{holdings:s,summary:l,marketPrices:a,getCurrentPrice:e=>a.value.get(e)||0,calculateHistoricalSnapshots:(t="ALL")=>{if(0===e.transactions.length)return[];const s=[],l=[...e.transactions].sort((e,t)=>e.timestamp-t.timestamp),r=new Map;l.forEach(e=>{e.currentMarketPrice&&e.currentMarketPrice>0&&(r.has(e.symbol)||r.set(e.symbol,new Map),r.get(e.symbol).set(e.timestamp,e.currentMarketPrice))});const o=l[0].timestamp,n=Date.now();let i=864e5,d=o;switch(t){case"1H":i=3e5,d=n-36e5;break;case"24H":i=36e5,d=n-864e5;break;case"7D":i=144e5,d=n-6048e5;break;case"30D":i=432e5,d=n-2592e6;break;case"90D":i=864e5,d=n-7776e6;break;case"1Y":i=6048e5,d=n-31536e6;break;case"ALL":const e=(n-o)/864e5;i=e<=1?36e5:e<=7?144e5:e<=30?432e5:e<=90?864e5:6048e5,d=o}const c=Math.max(o,d),u=new Set;
1l.forEach(e=>{e.timestamp>=c&&e.timestamp<=n&&u.add(e.timestamp)}),u.add(c),u.add(n);const f=Array.from(u).sort((e,t)=>e-t);if(f.length>=2){const e=f[0],t=f[f.length-1]-e;if(t>i){const a=Math.min(28,Math.floor(t/i));for(let s=1;s<=a;s++){const l=e+t*s/(a+1);u.add(Math.floor(l))}}}else if(1===f.length){const e=f[0];u.add(e-i),u.add(e+i)}return Array.from(u).sort((e,t)=>e-t).forEach(e=>{const t=new Map;l.forEach(a=>{if(a.timestamp>e)return;const s=t.get(a.symbol)||{quantity:0,cost:0};if("BUY"===a.type)s.quantity+=a.quantity,s.cost+=a.quantity*a.pricePerCoin+a.fee;else if("SELL"===a.type){const e=s.quantity>0?s.cost/s.quantity:0;s.quantity-=a.quantity,s.cost-=a.quantity*e,s.cost-=a.fee}t.set(a.symbol,s)});let o=0,n=0;t.forEach((t,s)=>{if(t.quantity<=0)return;const l=((e,t)=>{if(Date.now()-t<3e5)return a.value.get(e)||0;const s=xc(e,t);if(null!==s&&s>0)return s;const l=r.get(e);if(!l||0===l.size)return a.value.get(e)||0;const o=Array.from(l.entries()).sort((e,t)=>e[0]-t[0]);let n=o[0][1],i=Math.abs(o[0][0]-t);for(const[a,r]of o){const e=Math.abs(a-t);if(e<i&&(n=r,i=e),a>t)break}return n})(s,e);o+=t.quantity*l,n+=t.cost});const i=o-n,d=n>0?i/n*100:0;s.push({timestamp:e,totalValue:o,totalInvested:n,pnl:i,pnlPercent:d})}),s}}}(j.value):null),O=c(()=>{var e;return(null==(e=z.value)?void 0:e.summary.value)||{totalValue:0,totalInvested:0,totalPnl:0,totalPnlPercent:0,holdings:[],snapshots:[]}}),N=c(()=>z.value?z.value.calculateHistoricalSnapshots(T.value):[]),B=c(()=>j.value?[...j.value.transactions].sort((e,t)=>t.timestamp-e.timestamp):[]),F=c(()=>""!==_.value.symbol.trim()&&_.value.quantity>0&&_.value.pricePerCoin>0),E=()=>{if(!S.value.trim())return;const e=p.createPortfolio(S.value);x.value=e.id,S.value="",y.value=!1},Y=async()=>{var e;if(!x.value||!F.value)return;const t=new Date(_.value.datetime).getTime(),a=_.value.symbol.trim().toUpperCase();M.value=!0;try{const{isTokenAvailable:l}=await Pe(async()=>{const{isTokenAvailable:e}=await import("./BjJjQ7pC.js");return{isTokenAvailable:e}},[]);if(!(await l(a))&&!confirm(`⚠️ ${a} is not available on Binance.\n\nHistorical price data will be limited or unavailable.\n\nDo you want to continue anyway?`))return void(M.value=!1);const r=(null==(e=z.value)?void 0:e.getCurrentPrice(a))||0,{fetchAndCacheHistoricalPrices:o}=await Pe(async()=>{const{fetchAndCacheHistoricalPrices:e}=await Promise.resolve().then(()=>gc);return{fetchAndCacheHistoricalPrices:e}},void 0);try{await o(a,30,"1h"),await o(a,365,"1d")}catch(s){console.error("Price history fetch failed:",s)}p.addTransaction(x.value,{symbol:a,type:_.value.type,quantity:_.value.quantity,pricePerCoin:_.value.pricePerCoin,fee:_.value.fee||0,timestamp:t,notes:_.value.notes||void 0,currentMarketPrice:r>0?r:void 0}),_.value={type:"BUY",symbol:"",quantity:0,pricePerCoin:0,fee:0,datetime:(new Date).toISOString().slice(0,16),notes:""},k.value=!1}catch(s){console.error("Error adding transaction:",s),alert("Failed to add transaction. Please try again.")}finally{M.value=!1}},I=e=>{T.value=e},V=async()=>{try{const{clearTokenCache:e,fetchBinanceTokens:t}=await Pe(async()=>{const{clearTokenCache:e,fetchBinanceTokens:t}=await import("./BjJjQ7pC.js");return{clearTokenCache:e,fetchBinanceTokens:t}},[]);e();const a=await t();C.value&&(P.value=a)}catch(e){console.error("Failed to refresh token list:",e)}},H=async()=>{if(C.value=!0,0===_.value.symbol.trim().length)try{const{fetchBinanceTokens:e}=await Pe(async()=>{const{fetchBinanceTokens:e}=await import("./BjJjQ7pC.js");return{fetchBinanceTokens:e}},[]),t=await e();P.value=t}catch(e){console.error("Failed to load token list:",e),P.value=[{symbol:"BTC",fullSymbol:"BTCUSDT",available:!0},{symbol:"ETH",fullSymbol:"ETHUSDT",available:!0},{symbol:"BNB",fullSymbol:"BNBUSDT",available:!0},{symbol:"SOL",fullSymbol:"SOLUSDT",available:!0},{symbol:"XRP",fullSymbol:"XRPUSDT",available:!0},{symbol:"ADA",fullSymbol:"ADAUSDT",available:!0},{symbol:"AVAX",fullSymbol:"AVAXUSDT",available:!0},{symbol:"DOGE",fullSymbol:"DOGEUSDT",available:!0}]}else R()},R=async()=>{const e=_.value.symbol.trim();if(e.length<1)H();else{C.value=!0;try{const{searchTokens:t}=await Pe(async()=>{const{searchTokens:e}=await import("./BjJjQ7pC.js");return{searchTokens:e}},[]),a=await t(e);P.value=a}catch(t){console.error("Failed to search tokens:",t),P.value=[]}}},$=()=>{setTimeout(()=>{C.value=!1},200)},W=e=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2}).format(e);return f(async()=>{b.sendMessage(Hu,{action:"subscribe",channel:Hu});const{fetchBinanceTokens:e}=await Pe(async()=>{const{fetchBinanceTokens:e}=await import("./BjJjQ7pC.js");return{fetchBinanceTokens:e}},[]);
1e().catch(console.error)}),h(()=>{b.sendMessage(Hu,{action:"unsubscribe",channel:Hu})}),(e,c)=>{var u;return d(),t("div",Pc,[0===L.value.length?(d(),t("div",Uc,[c[19]||(c[19]=n('<div class="w-20 h-20 rounded-full bg-gradient-to-br from-[#00ffff]/20 to-[#1870f6]/20 flex items-center justify-center mb-4" data-v-cbc96d77><svg class="w-10 h-10 text-[#00ffff]" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-cbc96d77><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z" data-v-cbc96d77></path></svg></div><h3 class="text-xl font-bold text-[#00ffff] mb-2" data-v-cbc96d77>Create Your First Portfolio</h3><p class="text-sm text-[#00ffff]/60 text-center mb-6" data-v-cbc96d77>Track your crypto investments like CoinMarketCap.<br data-v-cbc96d77>All data is saved locally on your device.</p>',3)),a("button",{onClick:c[0]||(c[0]=e=>y.value=!0),class:"px-6 py-3 bg-gradient-to-r from-[#00ffff] to-[#1870f6] text-white font-semibold rounded-lg shadow-lg shadow-[#00ffff]/20 hover:shadow-[#00ffff]/40 transition-all"}," Create Portfolio ")])):x.value?(d(),t("div",Yc,[a("div",Ic,[a("div",Vc,[a("button",{onClick:c[2]||(c[2]=e=>x.value=null),class:"p-2 text-[#00ffff] hover:bg-[#00ffff]/10 rounded-lg transition-all"},c[22]||(c[22]=[a("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])),a("h2",Hc,i(null==(u=j.value)?void 0:u.name),1),a("button",{onClick:c[3]||(c[3]=e=>k.value=!0),class:"px-3 py-1.5 bg-gradient-to-r from-[#00ffff] to-[#1870f6] text-white text-sm font-medium rounded-lg shadow-lg shadow-[#00ffff]/20"}," + Add ")]),a("div",Rc,[c[24]||(c[24]=a("div",{class:"text-xs text-[#00ffff]/60 mb-1"},"Total Value",-1)),a("div",{class:r(["text-2xl font-bold",O.value.totalPnl>=0?"text-[#5ec485]":"text-[#eb5c57]"])},i(W(O.value.totalValue)),3),a("div",$c,[a("div",Wc,[c[23]||(c[23]=a("span",{class:"text-[#00ffff]/60"},"Invested:",-1)),a("span",qc,i(W(O.value.totalInvested)),1)]),a("div",{class:r(["text-xs font-semibold px-2 py-0.5 rounded",O.value.totalPnl>=0?"bg-[#5ec485]/20 text-[#5ec485]":"bg-[#eb5c57]/20 text-[#eb5c57]"])},i(O.value.totalPnl>=0?"+":"")+i(W(O.value.totalPnl))+" ("+i(O.value.totalPnlPercent.toFixed(2))+"%) ",3)])])]),a("div",Gc,[m(Dc,{summary:O.value,snapshots:N.value,onRangeChange:I},null,8,["summary","snapshots"])]),O.value.holdings.length>
10?(d(),t("div",Xc,[c[25]||(c[25]=a("h3",{class:"text-sm font-semibold text-[#00ffff] mb-3"},"Holdings",-1)),a("div",Zc,[(d(!0),t(s,null,l(O.value.holdings,e=>(d(),t("div",{key:e.symbol,class:"bg-gradient-to-br from-[#131328] to-[#1e273f] rounded-lg p-3 border border-[#00ffff]/20"},[a("div",Kc,[a("div",Jc,[a("div",Qc,i(e.symbol),1),a("div",eu,i(e.totalQuantity.toFixed(8))+" @ "+i(W(e.averageEntryPrice)),1)]),a("div",tu,[a("div",{class:r(["font-semibold",e.unrealizedPnl>=0?"text-[#5ec485]":"text-[#eb5c57]"])},i(e.unrealizedPnl>=0?"+":"")+i(W(e.unrealizedPnl)),3),a("div",{class:r(["text-xs",e.unrealizedPnlPercent>=0?"text-[#5ec485]":"text-[#eb5c57]"])},i(e.unrealizedPnlPercent>=0?"+":"")+i(e.unrealizedPnlPercent.toFixed(2))+"% ",3)])]),a("div",au,[a("span",su,"Current: "+i(W(e.currentPrice)),1),a("span",lu,i(W(e.currentValue)),1)]),a("div",ru,[a("div",ou,[a("div",{class:"h-full bg-gradient-to-r from-[#00ffff] to-[#1870f6]",style:g({width:`${e.percentOfPortfolio}%`})},null,4)]),a("div",nu,i(e.percentOfPortfolio.toFixed(1))+"% of portfolio",1)])]))),128))])])):o("",!0),j.value&&j.value.transactions.length>0?(d(),t("div",iu,[c[27]||(c[27]=a("h3",{class:"text-sm font-semibold text-[#00ffff] mb-3"},"Transaction History",-1)),a("div",du,[(d(!0),t(s,null,l(B.value,e=>{return d(),t("div",{key:e.id,class:"bg-gradient-to-br from-[#131328] to-[#1e273f] rounded-lg p-3 border border-[#00ffff]/20 flex items-center justify-between"},[a("div",cu,[a("div",uu,[a("span",{class:r(["text-xs px-2 py-0.5 rounded font-medium","BUY"===e.type?"bg-[#5ec485]/20 text-[#5ec485]":"bg-[#eb5c57]/20 text-[#eb5c57]"])},i(e.type),3),a("span",fu,i(e.symbol),1)]),a("div",pu,i(e.quantity)+" @ "+i(W(e.pricePerCoin))+" • "+i((s=e.timestamp,new Date(s).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"}))),1),e.notes?(d(),t("div",vu,' "'+i(e.notes)+'" ',1)):o("",!0)]),a("button",{onClick:t=>{return a=e.id,void(x.value&&confirm("Delete this transaction?")&&p.deleteTransaction(x.value,a));var a},class:"p-2 text-[#eb5c57] hover:bg-[#eb5c57]/10 rounded-lg transition-all ml-2"},c[26]||(c[26]=[a("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})],-1)]),8,hu)]);var s}),128))])])):o("",!0),j.value&&0===j.value.transactions.length?(d(),t("div",bu,[c[28]||(c[28]=a("svg",{class:"w-16 h-16 text-[#00ffff]/30 mb-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})],-1)),c[29]||(c[29]=a("p",{class:"text-[#00ffff]/70 text-sm mb-1"},"No transactions yet",-1)),c[30]||(c[30]=a("p",{class:"text-[#00ffff]/40 text-xs mb-4"},"Add your first transaction to start tracking",-1)),a("button",{onClick:c[4]||(c[4]=e=>k.value=!0),class:"px-4 py-2 bg-gradient-to-r from-[#00ffff] to-[#1870f6] text-white font-medium rounded-lg shadow-lg shadow-[#00ffff]/20"}," Add Transaction ")])):o("",!0)])):(d(),t("div",Lc,[a("div",jc,[c[20]||(c[20]=a("h2",{class:"text-xl font-bold text-[#00ffff]"},"My Portfolios",-1)),a("button",{onClick:c[1]||(c[1]=e=>y.value=!0),class:"px-4 py-2 bg-gradient-to-r from-[#00ffff]/20 to-[#1870f6]/20 text-[#00ffff] font-medium rounded-lg border border-[#00ffff]/30 hover:from-[#00ffff]/30 hover:to-[#1870f6]/30 transition-all"}," + New ")]),a("div",zc,[(d(!0),t(s,null,l(L.value,e=>{return d(),t("div",{key:e.id,onClick:t=>{return a=e.id,void(x.value=a);var a},class:"bg-gradient-to-br from-[#131328] to-[#1e273f] rounded-lg p-4 border border-[#00ffff]/20 hover:border-[#00ffff]/40 transition-all cursor-pointer"},[a("div",Oc,[a("div",Nc,[a("h3",Bc,i(e.name),1),a("p",Fc,i(e.transactions.length)+" transaction"+i(1!==e.transactions.length?"s":"")+" • "+i((s=e.updatedAt,new Date(s).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}))),1)]),a("button",{onClick:D(t=>{return a=e.id,void(confirm("Are you sure you want to delete this portfolio? This action cannot be undone.")&&(p.deletePortfolio(a),x.value===a&&(x.value=null)));var a},["stop"]),class:"p-2 text-[#eb5c57] hover:bg-[#eb5c57]/10 rounded-lg transition-all"},c[21]||(c[21]=[a("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})],-1)]),8,Ec)])],8,Ac);var s}),128))])])),y.value?(d(),t("div",{key:3,class:"fixed inset-0 bg-black/80 backdrop-blur-sm z-50 flex items-center justify-center px-4",onClick:c[7]||(c[7]=D(e=>y.value=!1,["self"]))},[a("div",mu,[c[31]||(c[31]=a("h3",{class:"text-xl font-bold text-[#00ffff] mb-6 text-center"},"Create New Portfolio",-1)),w(a("input",{"onUpdate:modelValue":c[5]||(c[5]=e=>S.value=e),type:"text",placeholder:"Enter portfolio name...",class:"w-full px-6 py-4 bg-[#090f1d] text-white text-lg rounded-xl border-2 border-[#00ffff]/30 focus:border-[#00ffff] focus:outline-none mb-6",onKeyup:A(E,["enter"]),maxlength:"50"},null,544),[[U,S.value]]),a("div",xu,[a("button",{onClick:c[6]||(c[6]=e=>y.value=!1),class:"flex-1 px-6 py-3.5 text-base bg-[#1e273f] text-[#00ffff]/70 rounded-xl hover:bg-[#2a3350] transition-all font-medium"}," Cancel "),a("button",{onClick:E,disabled:!S.value.trim(),class:"flex-1 px-6 py-3.5 text-base bg-gradient-to-r from-[#00ffff] to-[#1870f6] text-white font-semibold rounded-xl disabled:opacity-50 disabled:cursor-not-allowed hover:shadow-lg hover:shadow-[#00ffff]/20 transition-all"}," Create ",8,gu)])])])):o("",!0),k.value?(d(),t("div",{key:4,class:"fixed inset-0 bg-black/80 backdrop-blur-sm z-50 flex items-end justify-center px-2",onClick:c[18]||(c[18]=D(e=>k.value=!1,["self"]))},[a("div",yu,[a("div",wu,[c[33]||(c[33]=a("h3",{class:"text-lg font-bold text-[#00ffff]"},"Add Transaction",-1)),a("button",{onClick:c[8]||(c[8]=e=>k.value=!1),class:"text-[#00ffff]/70 hover:text-[#00ffff]"},c[32]||(c[32]=[a("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),a("div",ku,[a("div",Su,[a("div",null,[c[34]||(c[34]=a("label",{class:"block text-sm text-[#00ffff]/70 mb-2"},"Type",-1)),a("div",Tu,[a("button",{onClick:c[9]||(c[9]=e=>_.value.type="BUY"),class:r(["px-4 py-2 rounded-lg font-medium transition-all","BUY"===_.value.type?"bg-[#5ec485] text-white":"bg-[#1e273f] text-[#00ffff]/70 hover:bg-[#2a3350]"])}," Buy ",2),a("button",{onClick:c[10]||(c[10]=e=>_.value.type="SELL"),class:r(["px-4 py-2 rounded-lg font-medium transition-all","SELL"===_.value.type?"bg-[#eb5c57] text-white":"bg-[#1e273f] text-[#00ffff]/70 hover:bg-[#2a3350]"])}," Sell ",2)])]),a("div",_u,[a("div",{class:"flex items-center justify-between mb-2"},[c[36]||(c[36]=a("label",{class:"block text-sm text-[#00ffff]/70"},"Coin",-1)),a("button",{onClick:V,type:"button",class:"text-xs text-[#00ffff]/50 hover:text-[#00ffff] transition-all flex items-center gap-1"},c[35]||(c[35]=[a("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})],-1),v(" Refresh list ",-1)]))]),w(a("input",{"onUpdate:modelValue":c[11]||(c[11]=e=>_.value.symbol=e),type:"text",placeholder:"e.g., BTC, ETH, SOL",class:"w-full px-4 py-2 bg-[#090f1d] text-white rounded-lg border border-[#00ffff]/30 focus:border-[#00ffff] focus:outline-none uppercase",onInput:R,onFocus:H,onBlur:$},null,544),[[U,_.value.symbol]]),C.value&&P.value.length>0?(d(),t("div",Mu,[a("div",Cu,[a("span",Du,i(P.value.length)+" token"+i(1!==P.value.length?"s":"")+" available ",1),c[37]||(c[37]=a("span",{class:"text-xs text-[#00ffff]/50"},"Scroll to browse",-1))]),a("div",Pu,[(d(!0),t(s,null,l(P.value,e=>(d(),t("button",{key:e.symbol,onMousedown:D(t=>(async e=>{if(_.value.symbol=e.symbol,C.value=!1,P.value=[],e.available&&z.value){const t=z.value.getCurrentPrice(e.symbol);t>0&&0===_.value.pricePerCoin&&(_.value.pricePerCoin=t)}e.available||alert(`${e.symbol} is not available on Binance yet. Historical price data will be limited.`)})(e),["prevent"]),class:"w-full px-4 py-2.5 text-left hover:bg-[#1e273f] transition-all flex items-center justify-between group"},[a("div",Lu,[a("span",ju,i(e.symbol),1),e.available?(d(),t("span",zu," Available ")):(d(),t("span",Au," Coming Soon "))]),c[38]||(c[38]=a("svg",{class:"w-4 h-4 text-[#00ffff]/0 group-hover:text-[#00ffff]/70 transition-all",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})],-1))],40,Uu))),128))])])):o("",!0),_.value.symbol&&z.value?(d(),t("p",Ou," Current price: "+i(W(z.value.getCurrentPrice(_.value.symbol.trim().toUpperCase()))),1)):o("",!0)]),a("div",null,[c[39]||(c[39]=a("label",{class:"block text-sm text-[#00ffff]/70 mb-2"},"Quantity",-1)),w(a("input",{"onUpdate:modelValue":c[12]||(c[12]=e=>_.value.quantity=e),type:"number",step:"any",placeholder:"0.00",class:"w-full px-4 py-2 bg-[#090f1d] text-white rounded-lg border border-[#00ffff]/30 focus:border-[#00ffff] focus:outline-none"},null,512),[[U,_.value.quantity,void 0,{number:!0}]])]),a("div",null,[c[40]||(c[40]=a("label",{class:"block text-sm text-[#00ffff]/70 mb-2"},"Price Per Coin (USD)",-1)),w(a("input",{"onUpdate:modelValue":c[13]||(c[13]=e=>_.value.pricePerCoin=e),type:"number",step:"any",placeholder:"0.00",class:"w-full px-4 py-2 bg-[#090f1d] text-white rounded-lg border border-[#00ffff]/30 focus:border-[#00ffff] focus:outline-none"},null,512),[[U,_.value.pricePerCoin,void 0,{number:!0}]])]),a("div",null,[c[41]||(c[41]=a("label",{class:"block text-sm text-[#00ffff]/70 mb-2"},"Fee (USD)",-1)),w(a("input",{"onUpdate:modelValue":c[14]||(c[14]=e=>_.value.fee=e),type:"number",step:"any",placeholder:"0.00",class:"w-full px-4 py-2 bg-[#090f1d] text-white rounded-lg border border-[#00ffff]/30 focus:border-[#00ffff] focus:outline-none"},null,512),[[U,_.value.fee,void 0,{number:!0}]])]),a("div",null,[c[42]||(c[42]=a("label",{class:"block text-sm text-[#00ffff]/70 mb-2"},"Date & Time",-1)),w(a("input",{"onUpdate:modelValue":c[15]||(c[15]=e=>_.value.datetime=e),type:"datetime-local",class:"w-full px-4 py-2 bg-[#090f1d] text-white rounded-lg border border-[#00ffff]/30 focus:border-[#00ffff] focus:outline-none"},null,512),[[U,_.value.datetime]])]),a("div",null,[c[43]||(c[43]=a("label",{class:"block text-sm text-[#00ffff]/70 mb-2"},"Notes (Optional)",-1)),w(a("textarea",{"onUpdate:modelValue":c[16]||(c[16]=e=>_.value.notes=e),placeholder:"Add any notes...",rows:"2",class:"w-full px-4 py-2 bg-[#090f1d] text-white rounded-lg border border-[#00ffff]/30 focus:border-[#00ffff] focus:outline-none resize-none"},null,512),[[U,_.value.notes]])]),a("div",Nu,[a("div",Bu,[c[44]||(c[44]=a("span",{class:"text-[#00ffff]/60"},"Total:",-1)),a("span",Fu,i(W((_.value.quantity||0)*(_.value.pricePerCoin||0)+(_.value.fee||0))),1)])])])]),a("div",Eu,[a("button",{onClick:c[17]||(c[17]=e=>k.value=!1),disabled:M.value,class:"flex-1 px-4 py-2.5 bg-[#1e273f] text-[#00ffff]/70 rounded-lg hover:bg-[#2a3350] transition-all font-medium disabled:opacity-50"}," Cancel ",8,Yu),a("button",{onClick:Y,disabled:!F.value||M.value,class:"flex-1 px-4 py-2.5 bg-gradient-to-r from-[#00ffff] to-[#1870f6] text-white font-medium rounded-lg disabled:opacity-50 disabled:cursor-not-allowed hover:shadow-lg hover:shadow-[#00ffff]/20 transition-all flex items-center justify-center gap-2"},[M.value?(d(),t("svg",Vu,c[45]||(c[45]=[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"},null,-1)]))):o("",!0),a("span",null,i(M.value?"Fetching Price...":"Add Transaction"),1)],8,Iu)])])])):o("",!0)])}}}),[["__scopeId","data-v-cbc96d77"]]),$u={class:"w-full h-full bg-[#060a14] text-white flex flex-col antialiased scrollbar-hide overflow-hidden relative",style:{"-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale","text-rendering":"optimizeLegibility"}},Wu={class:"relative z-10 flex flex-col h-full overflow-y-auto scrollbar-hide"},qu={class:"relative bg-[#070b15] px-3 py-3 overflow-hidden flex-shrink-0"},Gu={class:"relative z-10"},Xu={class:"flex items-center justify-between"},Zu={class:"flex items-center gap-2"},Ku={class:"text-right"},Ju={class:"text-sm font-bold text-[#00f6ff]"},Qu={key:0},ef={key:1},tf={key:0,class:"w-4 h-4 text-white/70",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},af={key:1,class:"w-4 h-4 text-white/70",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},sf={class:"flex-shrink-0 px-3 py-2 bg-[#0a1020] border-b border-white/[0.05]"},lf={class:"bg-[#090f1d]/50 rounded-lg p-1 flex gap-1 border border-[#00f6ff]/20"},rf={key:0,class:"flex-1 overflow-y-auto scrollbar-hide pb-24"},of={class:"px-3 py-3 grid grid-cols-4 gap-2"},nf={class:"bg-[#131328]/80 rounded-lg p-2 border border-white/[0.05]"},df={class:"text-xs font-bold text-white"},cf={key:0},uf={key:1},ff={class:"bg-[#131328]/80 rounded-lg p-2 border border-white/[0.05]"},pf={key:0},vf={key:1},hf={class:"bg-[#131328]/80 rounded-lg p-2 border border-white/[0.05]"},bf={class:"text-xs font-bold text-yellow-400"},mf={key:0},xf={key:1},gf={class:"bg-[#131328]/80 rounded-lg p-2 border border-white/[0.05]"},yf={class:"text-xs font-bold text-[#00f6ff]"},wf={key:0,class:"px-3 pb-3"},kf={class:"flex items-center justify-between mb-2"},Sf={class:"text-[10px] text-[#00f6ff]/60"},Tf={class:"space-y-2"},_f={class:"flex items-center justify-between mb-2"},Mf={class:"flex items-center gap-2"},Cf={class:"text-sm font-bold text-white"},Df={class:"text-[10px] text-white/40"},Pf={class:"text-right"},Uf={class:"grid grid-cols-3 gap-2 text-[10px]"},Lf={class:"text-white font-medium"},jf={class:"text-white font-medium"},zf={class:"text-white font-medium"},Af={key:0,class:"grid grid-cols-2 gap-2 mt-2 text-[10px]"},Of={key:0,class:"bg-green-500/10 border border-green-500/20 rounded-lg px-2 py-1"},Nf={class:"text-green-400 font-semibold"},Bf={key:1,class:"bg-red-500/10 border border-red-500/20 rounded-lg px-2 py-1"},Ff={class:"text-red-400 font-semibold"},Ef={key:1,class:"mt-2 text-[10px] text-white/20 italic"},Yf={key:1,class:"px-3 pb-3"},If={key:2,class:"px-3 pb-3 flex gap-2 overflow-x-auto scrollbar-hide"},Vf=["onClick"],Hf={class:"px-3 pb-6 flex flex-col gap-2"},Rf={class:"flex items-center justify-between"},$f={class:"flex items-center gap-2.5"},Wf={key:0,class:"w-9 h-9 bg-gradient-to-br from-[#00f6ff]/20 to-[#1870f6]/20 rounded-lg border border-[#00f6ff]/30 flex items-center justify-center"},qf={key:1,class:"w-9 h-9 bg-[#00f6ff]/[0.08] rounded-lg border border-[#00f6ff]/20 flex items-center justify-center"},Gf={class:"font-semibold text-white text-sm"},Xf={class:"text-[10px] text-white/40"},Zf={class:"text-right"},Kf={class:"font-bold text-white text-sm"},Jf={key:0},Qf={key:1},ep={key:0,class:"flex flex-col items-center justify-center py-10"},tp={key:1,class:"flex-1 overflow-y-auto scrollbar-hide"},ap=F(e({__name:"MobilePortfolio",setup(e){const{isConnected:p,address:v}=ke(),b=E(),x=Xe(),g=u("Overview"),y=u("apex"),w=u(!1),k=["Overview"],S=u({}),T=()=>{w.value=!w.value},_=u({unstaked:0,staked:0,vested:0,total:0}),M=u("None"),C=c(()=>
1{if(!b.balance)return"$0.00";const e=Number(b.balance.totalEquityValue||0);return fe(e)}),D=c(()=>b.balance?fe(Number(b.balance.availableBalance||0)):"$0.00"),P=c(()=>{const e=[];return b.positions.forEach(t=>{if(0!==+t.size){const a=+(S.value[t.symbol.replace("-","")]??0),s=t.symbol.replace("-USDT",""),l="LONG"===t.side?(a-+t.entryPrice)*+t.size:(+t.entryPrice-a)*+t.size,r=Math.round(1/+(t.customInitialMarginRate??1)),o=+t.size*+t.entryPrice/r,n=o>0?l/o*100:0;e.push({symbol:t.symbol,side:t.side,size:t.size,entryPrice:t.entryPrice,mark:a,pnl:l,pnlPercent:n,label:s,leverage:r})}}),e}),U=c(()=>P.value.reduce((e,t)=>e+t.pnl,0)),L=c(()=>{if(!b.balance)return"0";const e=Number(b.balance.totalEquityValue||0),t=Number(b.balance.availableBalance||0);return 0===e?"0":((e-t)/e*100).toFixed(1)}),j=c(()=>P.value.length),z=e=>Math.abs(e)>=1e6?"$"+(e/1e6).toFixed(2)+"M":Math.abs(e)>=1e3?"$"+(e/1e3).toFixed(2)+"K":"$"+e.toFixed(2),A=e=>{if(!e)return"0.00";const t=Number(e);return t>=1e3?t.toFixed(2):t>=1?t.toFixed(4):t.toFixed(6)},O=e=>{if(!e)return"0";const t=Math.abs(Number(e));return t>=1e3?t.toFixed(2):t>=1?t.toFixed(4):t.toFixed(6)},N=c(()=>{const e=b.balance,t=e=>0===e?"0.00":Se(e);return[{name:"Perpetual",description:"Perpetual trading account",balance:fe(Number((null==e?void 0:e.totalEquityValue)||0))},{name:"Available",description:"Available USDT balance",balance:fe(Number((null==e?void 0:e.availableBalance)||0))},{name:"EAI Token",description:`Tier: ${M.value} • Total: ${t(_.value.total)} EAI`,balance:`Unstaked: ${t(_.value.unstaked)} • Staked: ${t(_.value.staked)}`}]}),B=c(()=>"Overview"===g.value?N.value:N.value.filter(e=>e.name===g.value)),F=u({});function Y(e){const t=Number(e.leverage)||10;return{symbol:e.symbol,side:e.side,size:String(e.size),entryPrice:String(e.entry_price),customInitialMarginRate:String(1/t)}}const I=async e=>{const t=W("token"),a=[...new Set(e)];await Promise.all(a.map(async e=>{try{const{data:a}=await xe.get(`https://stream.eagleailabs.com/p/v1/trades/apex/tp-sl/${e}/`,{headers:{Authorization:`Bearer ${t}`}});if(!(null==a?void 0:a.status)||!Array.isArray(a.data))return;const s={};for(const e of a.data){const t=(e.type||"").toUpperCase();t.includes("TAKE_PROFIT")&&e.triggerPrice?s.tp=e.triggerPrice:(t.includes("STOP")||t.includes("STOP_LOSS"))&&e.triggerPrice&&(s.sl=e.triggerPrice)}F.value[e]=s}catch{}}))},V=e=>{try{const t=e.data;if(!t.data||"@prices.500ms"!==t.channel)return;S.value=t.data}catch(t){console.error("Error processing prices messages:",t)}};return f(()=>{(async()=>{var e;try{let t=v.value;if(!t){const a=W("token"),{data:s}=await xe.get("https://stream.eagleailabs.com/api/v1/users/wallets",{headers:{Authorization:`Bearer ${a}`}});t=null==(e=s.data)?void 0:e[0]}if(!t)return _.value={unstaked:0,staked:0,vested:0,total:0},void(M.value="None");const a=Me({chain:q,transport:Ce(ge)}),s=await a.readContract({address:ye.utils,abi:we,functionName:"getTier",args:[t]}),l=s[0],r=+De(s[1],18),o=+De(s[2],18),n=+De(s[3],18),i=+De(s[1],18)+ +De(s[2],18)+ +De(s[3],18);_.value={unstaked:r,staked:o,vested:n,total:i},M.value=l.charAt(0).toUpperCase()+l.slice(1).toLowerCase()}catch(t){console.error("Failed to fetch EAI balance:",t)}})(),(async()=>{const e=W("token");let t=[];try{const{data:a}=await xe.get("https://stream.eagleailabs.com/p/v1/trades/apex/account",{headers:{Authorization:`Bearer ${e}`}});t=(a.data||[]).filter(e=>0!==Number(e.size||0))}catch(a){console.warn("Stream positions fetch failed, trying Copy Trade fallback:",a)}if(0===t.length)try{const e=await x.getPositions();e.length>0&&(t=e.map(Y),function(e){for(const t of e)t.mark_price>0&&(S.value[t.symbol.replace("-","")]=String(t.mark_price))}(e))}catch(a){console.warn("Copy Trade positions fallback failed:",a)}t.length>0?(b.updatePositions(t),I(t.map(e=>e.symbol))):b.updatePositions([])})(),$.subscribe("@prices.500ms"),$.addEventListener("message",V)}),h(()=>{$.unsubscribe("@prices.500ms"),$.removeEventListener("message",V)}),(e,c)=>(d(),t("div",$u,[c[23]||(c[23]=n('<div class="fixed inset-0 pointer-events-none overflow-hidden z-0" data-v-9ef4401c><div class="absolute inset-0 bg-gradient-to-b from-[#0a1628]/80 via-[#060a14] to-[#0a0f1
1a]" data-v-9ef4401c></div><div class="absolute -top-20 -right-20 w-80 h-80 bg-[#00f6ff]/[0.08] rounded-full blur-[100px] animate-float-slow" data-v-9ef4401c></div><div class="absolute -bottom-32 -left-32 w-96 h-96 bg-[#066BF3]/[0.1] rounded-full blur-[120px] animate-float-slower" data-v-9ef4401c></div><div class="absolute top-1/3 left-1/4 w-64 h-64 bg-[#8b5cf6]/[0.06] rounded-full blur-[80px] animate-float-medium" data-v-9ef4401c></div><div class="absolute inset-0 opacity-[0.03] bg-[linear-gradient(rgba(0,255,255,0.5)_1px,transparent_1px),linear-gradient(90deg,rgba(0,255,255,0.5)_1px,transparent_1px)] bg-[length:60px_60px]" data-v-9ef4401c></div></div>',1)),a("div",Wu,[a("div",qu,[c[6]||(c[6]=a("div",{class:"absolute top-0 right-0 w-48 h-48 bg-[#00f6ff]/20 rounded-full blur-3xl pointer-events-none"},null,-1)),c[7]||(c[7]=a("div",{class:"absolute top-0 left-0 right-0 h-0.5 bg-gradient-to-r from-transparent via-[#00f6ff] to-transparent pointer-events-none"},null,-1)),a("div",Gu,[a("div",Xu,[c[5]||(c[5]=n('<div class="flex items-center gap-2" data-v-9ef4401c><div class="w-8 h-8 rounded-lg bg-white/20 backdrop-blur-md flex items-center justify-center border border-white/30 p-1.5" data-v-9ef4401c><svg class="w-full h-full text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-9ef4401c><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z" data-v-9ef4401c></path></svg></div><div data-v-9ef4401c><p class="text-[10px] text-white/60 font-medium" data-v-9ef4401c>CLAW</p><p class="text-sm text-white font-bold" data-v-9ef4401c>Portfolio</p></div></div>',1)),a("div",Zu,[a("div",Ku,[c[2]||(c[2]=a("p",{class:"text-[10px] text-white/40"},"Total Value",-1)),a("p",Ju,[w.value?(d(),t("span",ef,"•••••")):(d(),t("span",Qu,i(C.value),1))])]),a("button",{onClick:T,class:"p-1.5 rounded-lg bg-white/10 border border-white/20"},[w.value?(d(),t("svg",af,c[4]||(c[4]=[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21"},null,-1)]))):(d(),t("svg",tf,c[3]||(c[3]=[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"},null,-1),a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"},null,-1)])))])])])])]),a("div",sf,[a("div",lf,[a("button",{onClick:c[0]||(c[0]=e=>y.value="apex"),class:r(["flex-1 px-3 py-2 rounded-md text-xs font-semibold transition-colors","apex"===y.value?"bg-gradient-to-r from-[#00f6ff] to-[#1870f6] text-white":"text-[#00f6ff]/60"])}," ApeX Account ",2),a("button",{onClick:c[1]||(c[1]=e=>y.value="custom"),class:r(["flex-1 px-3 py-2 rounded-md text-xs font-semibold transition-colors","custom"===y.value?"bg-gradient-to-r from-[#00f6ff] to-[#1870f6] text-white":"text-[#00f6ff]/60"])}," Real-Time Portfolio ",2)])]),"apex"===y.value?(d(),t("div",rf,[a("div",of,[a("div",nf,[c[8]||(c[8]=a("p",{class:"text-[10px] text-white/40"},"Available",-1)),a("p",df,[w.value?(d(),t("span",uf,"•••")):(d(),t("span",cf,i(D.value),1))])]),a("div",ff,[c[9]||(c[9]=a("p",{class:"text-[10px] text-white/40"},"Unrealized",-1)),a("p",{class:r(["text-xs font-bold",U.value>=0?"text-green-400":"text-red-400"])},[w.value?(d(),t("span",vf,"•••")):(d(),t("span",pf,i(U.value>=0?"+":"")+i(z(U.value)),1))],2)]),a("div",hf,[c[10]||(c[10]=a("p",{class:"text-[10px] text-white/40"},"Margin",-1)),a("p",bf,[w.value?(d(),t("span",xf,"•••")):(d(),t("span",mf,i(L.value)+"%",1))])]),a("div",gf,[c[11]||(c[11]=a("p",{class:"text-[10px] text-white/40"},"Positions",-1)),a("p",yf,i(j.value),1)])]),P.value.length>0?(d(),t("div",wf,[a("div",kf,[c[12]||(c[12]=a("p",{class:"text-xs font-semibold text-white/70"},"Open Positions",-1)),a("span",Sf,i(P.value.length)+" active",1)]),a("div",Tf,[(d(!0),t(s,null,l(P.value,e=>{var s,l,n,u;return d(),t("div",{key:e.symbol+e.side,class:"bg-[#060a12] rounded-[6px] p-3 border border-white/[0.08]"},[a("div",_f,[a("div",Mf,[a("span",Cf,i(e.label),1),a("span",{class:r(["px-1.5 py-0.5 rounded text-[9px] font-bold","LONG"===e.side?"bg-green-500/20 text-green-400":"bg-red-500/20 text-red-400"])},i(e.side),3),a("span",Df,i(e.leverage)+"x",1)]),a("div",Pf,[a("p",{class:r(["text-sm font-bold",e.pnl>=0?"text-green-400":"text-red-400"])},i(e.pnl>=0?"+":"")+i(z(e.pnl)),3)])]),a("div",Uf,[a("div",null,[c[13]||(c[13]=a("p",{class:"text-white/40"},"Entry",-1)),a("p",Lf,"$"+i(A(e.entryPrice)),1)]),a("div",null,[c[14]||(c[14]=a("p",{class:"text-white/40"}
1,"Mark",-1)),a("p",jf,"$"+i(A(e.mark)),1)]),a("div",null,[c[15]||(c[15]=a("p",{class:"text-white/40"},"Size",-1)),a("p",zf,i(O(e.size)),1)])]),(null==(s=F.value[e.symbol])?void 0:s.tp)||(null==(l=F.value[e.symbol])?void 0:l.sl)?(d(),t("div",Af,[(null==(n=F.value[e.symbol])?void 0:n.tp)?(d(),t("div",Of,[c[16]||(c[16]=a("p",{class:"text-green-400/60"},"Take Profit",-1)),a("p",Nf,"$"+i(A(F.value[e.symbol].tp)),1)])):o("",!0),(null==(u=F.value[e.symbol])?void 0:u.sl)?(d(),t("div",Bf,[c[17]||(c[17]=a("p",{class:"text-red-400/60"},"Stop Loss",-1)),a("p",Ff,"$"+i(A(F.value[e.symbol].sl)),1)])):o("",!0)])):(d(),t("div",Ef,"No TP / SL set"))])}),128))])])):(d(),t("div",Yf,c[18]||(c[18]=[n('<div class="bg-[#131328]/50 rounded-[6px] p-4 border border-white/[0.05] text-center" data-v-9ef4401c><svg class="w-8 h-8 mx-auto text-white/20 mb-2" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-9ef4401c><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z" data-v-9ef4401c></path></svg><p class="text-xs text-white/40" data-v-9ef4401c>No open positions</p><p class="text-[10px] text-white/30 mt-1" data-v-9ef4401c>Start trading on the Trade tab</p></div>',1)]))),c[22]||(c[22]=n('<div class="px-3 pb-2" data-v-9ef4401c><div class="flex items-center gap-2" data-v-9ef4401c><div class="flex-1 h-px bg-gradient-to-r from-transparent via-white/10 to-transparent" data-v-9ef4401c></div><p class="text-[10px] text-white/30 font-medium" data-v-9ef4401c>ASSETS</p><div class="flex-1 h-px bg-gradient-to-r from-transparent via-white/10 to-transparent" data-v-9ef4401c></div></div></div>',1)),k.length>1?(d(),t("div",If,[(d(),t(s,null,l(k,e=>a("button",{key:e,onClick:t=>g.value=e,class:r(["px-3 py-1.5 text-xs font-semibold whitespace-nowrap transition-colors rounded-lg border",g.value===e?"bg-gradient-to-r from-[#00f6ff]/20 to-[#1870f6]/20 text-[#00f6ff] border-[#00f6ff]/30":"bg-[#131328]/50 text-white/50 border-white/[0.05]"])},i(e),11,Vf)),64))])):o("",!0),a("div",Hf,[(d(!0),t(s,null,l(B.value,e=>(d(),t("div",{key:e.name,class:"bg-[#060a12] border border-white/[0.08] rounded-[6px] p-3"},[a("div",Rf,[a("div",$f,["EAI Token"===e.name?(d(),t("div",Wf,c[19]||(c[19]=[a("img",{src:Et,alt:"EAI",class:"w-6 h-6 object-contain"},null,-1)]))):(d(),t("div",qf,c[20]||(c[20]=[a("svg",{class:"w-4 h-4 text-[#00f6ff]",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)]))),a("div",null,[a("p",Gf,i(e.name),1),a("p",Xf,i(e.description),1)])]),a("div",Zf,[a("p",Kf,[w.value?(d(),t("span",Qf,"•••••")):(d(),t("span",Jf,i(e.balance),1))])])])]))),128)),0===B.value.length?(d(),t("div",ep,c[21]||(c[21]=[a("svg",{class:"w-10 h-10 text-white/20 mb-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1),a("p",{class:"text-xs text-white/40"},"No assets in this category",-1)]))):o("",!0)])])):(d(),t("div",tp,[m(Ru)]))])]))}}),[["__scopeId","data-v-9ef4401c"]]),sp={class:"w-full h-full bg-[#090f1d] text-white relative flex flex-col antialiased scrollbar-hide",style:{"-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale","text-rendering":"optimizeLegibility"}},lp={class:"relative overflow-hidden bg-[#070b15] px-4 py-4"},rp={class:"relative z-10"},op={class:"flex items-center gap-3"},np={class:"flex-1 overflow-y-auto p-4"},ip=F(e({__name:"MobileCalendar",emits:["navigate-to-tab"],setup(e,{emit:s}){const l=s;
1return(e,s)=>(d(),t("div",sp,[a("div",lp,[s[3]||(s[3]=n('<div class="absolute top-0 right-0 w-64 h-64 bg-[#00f6ff]/20 rounded-full blur-3xl pointer-events-none" data-v-e8f78a37></div><div class="absolute bottom-0 left-0 w-48 h-48 bg-blue-500/20 rounded-full blur-3xl pointer-events-none" data-v-e8f78a37></div><div class="absolute inset-0 opacity-10 pointer-events-none" data-v-e8f78a37><div class="absolute inset-0 bg-[linear-gradient(#00f6ff_1px,transparent_1px),linear-gradient(90deg,#00f6ff_1px,transparent_1px)] bg-[length:50px_50px]" data-v-e8f78a37></div></div><div class="absolute top-0 left-0 right-0 h-1 bg-gradient-to-r from-transparent via-cyan-400 to-transparent" data-v-e8f78a37></div>',4)),a("div",rp,[a("div",op,[a("button",{onClick:s[0]||(s[0]=e=>l("navigate-to-tab","home")),class:"p-2 rounded-lg bg-white/10 backdrop-blur-sm border border-white/20 active:scale-95 transition-transform"},s[1]||(s[1]=[a("svg",{class:"w-5 h-5 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])),s[2]||(s[2]=n('<div class="flex items-center gap-2" data-v-e8f78a37><div class="w-10 h-10 rounded-lg bg-white/20 backdrop-blur-md flex items-center justify-center border border-white/30 p-1.5" data-v-e8f78a37><svg class="w-full h-full text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-e8f78a37><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" data-v-e8f78a37></path></svg></div><div data-v-e8f78a37><p class="text-xs text-white/80 font-medium" data-v-e8f78a37>CLAW</p><p class="text-sm text-white font-bold" data-v-e8f78a37>Economic Calendar</p></div></div>',1))])])]),a("div",np,[m(Ke)])]))}}),[["__scopeId","data-v-e8f78a37"]]),dp={class:"relative z-10 flex flex-col h-full"},cp={class:"flex flex-col items-center"},up={class:"text-xs text-[#00f6ff] mt-1"},fp={key:1,class:"px-4 py-3 bg-[#eb5c57]/10 border-b border-[#eb5c57]/30"},pp={class:"flex items-center gap-2"},vp={class:"text-sm text-[#eb5c57]"},hp={class:"relative overflow-hidden bg-[#070b15] px-3 py-3"},bp={class:"relative z-10"},mp={class:"flex items-center gap-2 mb-2"},xp={class:"flex-1 relative"},gp={class:"flex gap-1.5 overflow-x-auto pb-1 scrollbar-hide"},yp=["onClick"],wp={class:"px-3 py-2 bg-[#0a1020] border-b border-white/[0.05] text-[10px] text-white/40 flex items-center sticky top-0 z-10"},kp={class:"flex-1 overflow-y-auto scrollbar-hide pb-20 px-3 pt-1"},Sp={key:0,class:"flex flex-col items-center justify-center py-16 text-white/50"},Tp={key:1,class:"flex flex-col items-center justify-center py-12 text-white/50"},_p=["onClick"],Mp={class:"flex items-center gap-2 flex-1 min-w-0"},Cp={class:"w-8 h-8 rounded-full flex items-center justify-center overflow-hidden flex-shrink-0 bg-white/[0.08]"},Dp=["src","alt","onError"],Pp={class:"min-w-0"},Up={class:"flex items-center gap-1"},Lp={class:"text-sm font-bold text-white"},jp=["onClick"],zp=["fill"],Ap={key:0,class:"px-1 py-0.5 bg-yellow-500/20 text-yellow-400 text-[8px] font-bold rounded"},Op={key:1,class:"px-1 py-0.5 bg-orange-500/20 text-orange-400 text-[8px] font-bold rounded"},Np={key:2,class:"px-1 py-0.5 bg-green-500/20 text-green-400 text-[8px] font-bold rounded"},Bp={class:"text-[10px] text-white/40 truncate"},Fp={class:"text-right px-2"},Ep={class:"text-sm font-semibold text-white tabular-nums"},Yp={class:"text-right min-w-[60px]"},Ip="@coinscreener.full",Vp=F(e({__name:"MobileMarket",emits:["navigate-to-trade"],setup(e,{emit:p}){const v=p,m=u(""),x=u(""),k=Je(e=>{x.value=e},300);b(m,e=>{k(e)});const S=u(!1),T=u("All"),_=["All","MEME","L1","L2","DEFI","AI","GAME","INFRA"],M=ve(),C=I(),P=Ue(),L=me();L.ensureStarted();const j=he(),z=u(null),A=u(!0),O=u(0),N=u(!1),B=u(0),F=u(null),E=e=>{const t=e.target;F.value=t.closest(".overflow-y-auto")||document.documentElement,0===F.value.scrollTop&&(B.value=e.touches[0].clientY)},Y=e=>{if(0===B.value||N.value)return;const t=e.touches[0].clientY-B.value;t>0&&F.value&&0===F.value.scrollTop&&(O.value=Math.min(.5*t,100),O.value>10&&e.preventDefault())},V=async()=>{O.value>=80&&!N.value&&(N.value=!0,await H(),N.value=!1),O.value=0,B.value=0},H=async()=>{try{j.sendMessage(Ip,{action:"unsubscribe",channel:Ip}),await new Promise(e=>
1setTimeout(e,300)),j.sendMessage(Ip,{action:"subscribe",channel:Ip}),await new Promise(e=>setTimeout(e,500))}catch(e){console.error("Failed to refresh data:",e),z.value="Failed to refresh data"}};f(()=>{try{j.sendMessage(Ip,{action:"subscribe",channel:Ip}),setTimeout(()=>{A.value=!1},1e3)}catch(e){console.error("Failed to subscribe to WebSocket:",e),z.value="Failed to connect to market data",A.value=!1}}),h(()=>{try{j.sendMessage(Ip,{action:"unsubscribe",channel:Ip})}catch(e){console.error("Failed to unsubscribe from WebSocket:",e)}});const $=u(null),W=u("desc"),q=e=>{$.value===e?W.value="asc"===W.value?"desc":"asc":($.value=e,W.value="symbol"===e?"asc":"desc")},G=c(()=>{var e;return((null==(e=M.data)?void 0:e[Ip])||[]).map(e=>({symbol:String(e.symbol||""),dailyChange:be(String(e.symbol||""),e,!0),lastPrice:Number(e.lastPrice??0),tradingVolume:Number(e.tradingVolume??0),marketCap:(()=>{const t=parseFloat(String(e.marketCap??e.market_cap??"NaN"));return Number.isFinite(t)?t:void 0})()}))}),X={BTCUSDT:100,ETHUSDT:100,SOLUSDT:50,XRPUSDT:50,DOGEUSDT:50,ADAUSDT:50,AVAXUSDT:50,LINKUSDT:50,MATICUSDT:50,DOTUSDT:50,UNIUSDT:50,ATOMUSDT:50,LTCUSDT:50,BCHUSDT:50,TRXUSDT:25,NEARUSDT:25,APTUSDT:25,ARBUSDT:25,OPUSDT:25},Z=new Set(["BTCUSDT","ETHUSDT","SOLUSDT","XRPUSDT","DOGEUSDT"]),K=new Set(["HYPEUSDT","MOVEUSDT","MEUSDT","PENGUUSDT","VIRTUALUSDT","AIUSDT","GRIFFAINUSDT","SCRUSDT","ZEUSUSDT","PNUTUSDT"]),J={MEME:new Set(["DOGEUSDT","SHIBUSDT","PEPEUSDT","FLOKIUSDT","BONKUSDT","WIFUSDT","BOMEUSDT","MEMEUSDT","MOGUSDT","POPUSDT","TRUMPUSDT","PENGUUSDT","PNUTUSDT","ACTUSDT","GOATUSDT"]),L1:new Set(["BTCUSDT","ETHUSDT","SOLUSDT","BNBUSDT","ADAUSDT","AVAXUSDT","DOTUSDT","MATICUSDT","ATOMUSDT","NEARUSDT","APTUSDT","SUIUSDT","INJUSDT","SEIUSDT","FTMUSDT","ALGOUSDT","HBARUSDT","VETUSDT","ICPUSDT","FILUSDT","TONUSDT","TRXUSDT","XLMUSDT","XRPUSDT","LTCUSDT"]),L2:new Set(["ARBUSDT","OPUSDT","MATICUSDT","IMXUSDT","STRKUSDT","METISUSDT","MANTAUSDT","BLASTUSDT","SCROLLUSDT","ZKUSDT","LINAUSDT","LDOUSDT","POLYXUSDT"]),DEFI:new Set(["UNIUSDT","AAVEUSDT","LINKUSDT","MKRUSDT","CRVUSDT","COMPUSDT","SNXUSDT","SUSHIUSDT","1INCHUSDT","YFIUSDT","BALUSDT","LDOUSDT","RPLUSDT","PENDLEUSDT","JUPUSDT","DYDXUSDT","GMXUSDT","CAKEUSDT","RADUSDT"]),AI:new Set(["FETUSDT","AGIXUSDT","RENDERUSDT","RNDERUSDT","OCEANUSDT","NMRUSDT","GRTUSDT","THETAUSDT","AIUSDT","ARKMUSDT","PHBUSDT","WLDUSDT","IQUSDT","VIRTUALUSDT","AIOZUSDT"]),GAME:new Set(["AXSUSDT","SANDUSDT","MANAUSDT","ENJUSDT","GALAUSDT","IMXUSDT","GMTUSDT","FLOWUSDT","APUSDT","ILVUSDT","YGGUSDT","MAGICUSDT","MCUSDT","PIXELUSDT","PORTALUSDT","XAIUSDT","BEAMUSDT","PRIMEUSDT","NFTUSDT","ACEUSDT"]),INFRA:new Set(["LINKUSDT","GRTUSDT","FILUSDT","ARUSDT","STORJUSDT","OCEANUSDT","BANDUSDT","ANKRUSDT","IOTAUSDT","IOTXUSDT","HNTUSDT","JASMYUSDT","MASKUSDT","LPTUSDT","POKTUSDT"])},Q=c(()=>{let e=G.value;if(e=e.filter(e=>!R(e.symbol)),S.value&&(e=e.filter(e=>P.has(e.symbol))),"All"!==T.value){const t=J[T.value];t&&(e=e.filter(e=>t.has(e.symbol)))}return e}),ee=c(()=>{const e=Q.value,t=new Map(e.map(e=>[e.symbol.toUpperCase(),e])),a=[],s=new Set,l=e=>{if(!e)return;const l=t.get(e.toUpperCase());l&&!s.has(l.symbol)&&(s.add(l.symbol),a.push(l))},r=[["BTCUSDT"],["ETHUSDT"],["SOLUSDT"],["XRPUSDT"],["DOGEUSDT"],["TRXUSDT"],["ADAUSDT"],["HYPEUSDT","HLPUSDT","HLUSDT","HYPERLIQUIDUSDT"],["LINKUSDT"],["AVAXUSDT"],["BCHUSDT"],["HBARUSDT"]];for(const d of r){let e=!1;for(const a of d)if(t.has(a)){l(a),e=!0;break}}const o=e.filter(e=>!s.has(e.symbol)).sort((e,t)=>{const a=oe(e.symbol,e.tradingVolume);return oe(t.symbol,t.tradingVolume)-a}),n=o.slice(0,40),i=o.slice(40);return a.push(...n),a.push(...i),a.map(e=>{const t=e.symbol;return{symbol:e.symbol.replace("USDT","").replace("USDC","").trim(),price:Number(e.lastPrice||0).toFixed(2),volume:re(t,Number(e.tradingVolume||0)),change:e.dailyChange,dailyChange:e.dailyChange,lastPrice:e.lastPrice,tradingVolume:e.tradingVolume,marketCap:(a=e.marketCap,a&&Number.isFinite(a)?a>=1e9?`$${(a/1e9).toFixed(2)}B`:a>=1e6?`$${(a/1e6).toFixed(2)}M`:a>=1e3?`$${(a/1e3).toFixed(2)}K`:`$${a.toFixed(0)}`:"N/A"),leverage:X[t],isHot:Z.has(t),isNew:K.has(t)};var a})}),ae=c(()=>{let e=ee.value;const t=x.value.trim().toLowerCase();return t&&(e=e.filter(e=>e.symbol.toLowerCase().includes(t))),e}),se=c(()=>{const e=[...ae.value];return null===$.value||("symbol"===$.value?e.sort((e,t)=>
1{const a=e.symbol.localeCompare(t.symbol);return"asc"===W.value?a:-a}):"price"===$.value?e.sort((e,t)=>{const a=e.lastPrice-t.lastPrice;return"asc"===W.value?a:-a}):"change"===$.value&&e.sort((e,t)=>{const a=e.change-t.change;return"asc"===W.value?a:-a})),e});function re(e,t){const a=String(e||"").toUpperCase(),s=L.get(a),l=null!=(null==s?void 0:s.quote)&&isFinite(s.quote)?s.quote:t,r=Number(l||0);return r>=1e9?`$${(r/1e9).toFixed(1)}b`:r>=1e6?`$${(r/1e6).toFixed(1)}m`:r>=1e3?`$${(r/1e3).toFixed(1)}k`:`$${Math.round(r)}`}function oe(e,t){const a=String(e||"").toUpperCase(),s=L.get(a),l=null==s?void 0:s.quote;return null!=l&&isFinite(l)?Number(l):Number(t||0)}return(e,c)=>(d(),t("div",{class:"w-full h-full bg-transparent text-white relative flex flex-col antialiased scrollbar-hide",style:{"-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale","text-rendering":"optimizeLegibility"},onTouchstart:E,onTouchmove:Y,onTouchend:V},[c[24]||(c[24]=n('<div class="fixed inset-0 pointer-events-none overflow-hidden z-0" data-v-18196394><div class="absolute inset-0 bg-[#070b15]/80" data-v-18196394></div><div class="absolute -top-20 -right-20 w-80 h-80 bg-[#00f6ff]/[0.08] rounded-full blur-[100px] animate-float-slow" data-v-18196394></div><div class="absolute -bottom-32 -left-32 w-96 h-96 bg-[#066BF3]/[0.1] rounded-full blur-[120px] animate-float-slower" data-v-18196394></div><div class="absolute top-1/3 left-1/4 w-64 h-64 bg-[#8b5cf6]/[0.06] rounded-full blur-[80px] animate-float-medium" data-v-18196394></div><div class="absolute inset-0 opacity-[0.03] bg-[linear-gradient(rgba(0,246,255,0.5)_1px,transparent_1px),linear-gradient(90deg,rgba(0,246,255,0.5)_1px,transparent_1px)] bg-[length:60px_60px]" data-v-18196394></div><div class="absolute -top-1/4 left-1/2 -translate-x-1/2 w-full h-[600px] bg-gradient-radial from-[#00f6ff]/[0.05] to-transparent rounded-full" data-v-18196394></div></div>',1)),a("div",dp,[O.value>0?(d(),t("div",{key:0,class:"absolute top-0 left-0 right-0 flex items-center justify-center transition-all duration-200 z-50",style:g({height:`${Math.min(O.value,80)}px`,opacity:O.value/80})},[a("div",cp,[(d(),t("svg",{class:r(["w-6 h-6 text-[#00f6ff] transition-transform duration-200",{"animate-spin":N.value,"rotate-180":O.value>=80&&!N.value}]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},c[7]||(c[7]=[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"},null,-1)]),2)),a("span",up,i(N.value?"Refreshing...":O.value>=80?"Release to refresh":"Pull to refresh"),1)])],4)):o("",!0),z.value?(d(),t("div",fp,[a("div",pp,[c[9]||(c[9]=a("span",{class:"text-[#eb5c57]"},"⚠️",-1)),a("span",vp,i(z.value),1),a("button",{onClick:c[0]||(c[0]=e=>z.value=null),class:"ml-auto text-[#eb5c57] hover:text-[#eb5c57]/80"},c[8]||(c[8]=[a("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))])])):o("",!0),a("div",hp,[c[14]||(c[14]=n('<div class="absolute top-0 right-0 w-48 h-48 bg-[#00f6ff]/20 rounded-full blur-3xl pointer-events-none" data-v-18196394></div><div class="absolute bottom-0 left-0 w-32 h-32 bg-blue-500/20 rounded-full blur-3xl pointer-events-none" data-v-18196394></div><div class="absolute inset-0 opacity-10 pointer-events-none" data-v-18196394><div class="absolute inset-0 bg-[linear-gradient(#00f6ff_1px,transparent_1px),linear-gradient(90deg,#00f6ff_1px,transparent_1px)] bg-[length:50px_50px]" data-v-18196394></div></div><div class="absolute top-0 left-0 right-0 h-0.5 bg-gradient-to-r from-transparent via-[#00f6ff] to-transparent" data-v-18196394></div>',4)),a("div",bp,[c[13]||(c[13]=n('<div class="flex items-center gap-2 mb-2" data-v-18196394><div class="w-8 h-8 rounded-lg bg-white/20 backdrop-blur-md flex items-center justify-center border border-white/30 p-1.5" data-v-18196394><svg class="w-full h-full text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-18196394><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 7h8m0 0v8m0-8l-8 8-4-4-6 6" data-v-18196394></path></svg></div><div data-v-18196394><p class="text-[10px] text-white/60 font-medium" data-v-18196394>CLAW</p><p class="text-sm text-white font-bold" data-v-18196394>Market</p></div></div>',1)),a("div",mp,[a("div",xp,[w(a("input",{"onUpdate:modelValue":c[1]||(c[1]=e=>m.value=e),type:"search",placeholder:"Search tokens...",class:"w-full bg-[#0a1628]/80 backdrop-blur-sm border border-white/10 rounded-lg px-3 py-1.5 pl-8 text-xs text-white placeholder-white/40 focus:outline-none focus:border-[#00f6ff]/50 transition-colors"},null,512),[[U,m.value]]),c[11]||(c[11]=a("svg",{class:"absolute left-2.5 top-2 w-3.5 h-3.5 text-white/40",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1)),m.value?(d(),t("button",{key:0,onClick:c[2]||(c[2]=e=>m.value=""),class:"absolute right-2.5 top-2 text-white/40 hover:text-white"},c[10]||(c[10]=[a("svg",{class:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))):o("",!0)]),a("button",{onClick:c[3]||(c[3]=e=>
1S.value=!S.value),class:r(["p-1.5 rounded-lg transition-all border",S.value?"bg-[#00f6ff] text-[#090f1d] border-[#00f6ff]":"bg-[#0a1628]/80 text-white/50 border-white/10 hover:text-[#00f6ff]"])},c[12]||(c[12]=[a("svg",{class:"w-4 h-4",fill:"currentColor",viewBox:"0 0 24 24"},[a("path",{d:"M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2l-2.81 6.63L2 9.24l5.46 4.73L5.82 21z"})],-1)]),2)]),a("div",gp,[(d(),t(s,null,l(_,e=>a("button",{key:e,onClick:t=>T.value=e,class:r(["px-2 py-1 text-[10px] font-bold whitespace-nowrap transition-all rounded-md",T.value===e?"bg-[#00f6ff] text-[#090f1d]":"bg-white/[0.06] text-white/60 hover:text-white hover:bg-white/[0.1]"])},i(e),11,yp)),64))])])]),a("div",wp,[a("button",{onClick:c[4]||(c[4]=e=>q("symbol")),class:"flex-1 flex items-center gap-1 hover:text-white/60 transition-colors font-semibold"},[c[16]||(c[16]=a("span",null,"Token / Vol",-1)),"symbol"===$.value?(d(),t("svg",{key:0,class:r(["w-2.5 h-2.5",{"rotate-180":"desc"===W.value}]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},c[15]||(c[15]=[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 15l7-7 7 7"},null,-1)]),2)):o("",!0)]),a("button",{onClick:c[5]||(c[5]=e=>q("price")),class:"px-2 text-right flex items-center justify-end gap-1 hover:text-white/60 transition-colors font-semibold"},[c[18]||(c[18]=a("span",null,"Price",-1)),"price"===$.value?(d(),t("svg",{key:0,class:r(["w-2.5 h-2.5",{"rotate-180":"desc"===W.value}]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},c[17]||(c[17]=[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 15l7-7 7 7"},null,-1)]),2)):o("",!0)]),a("button",{onClick:c[6]||(c[6]=e=>q("change")),class:"min-w-[60px] text-right flex items-center justify-end gap-1 hover:text-white/60 transition-colors font-semibold"},[c[20]||(c[20]=a("span",null,"24h %",-1)),"change"===$.value?(d(),t("svg",{key:0,class:r(["w-2.5 h-2.5",{"rotate-180":"desc"===W.value}]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},c[19]||(c[19]=[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 15l7-7 7 7"},null,-1)]),2)):o("",!0)])]),a("div",kp,[A.value?(d(),t("div",Sp,c[21]||(c[21]=[a("div",{class:"animate-spin rounded-full h-6 w-6 border-b-2 border-[#00f6ff] mb-3"},null,-1),a("p",{class:"text-xs"},"Loading market data...",-1)]))):0===ae.value.length?(d(),t("div",Tp,c[22]||(c[22]=[a("svg",{class:"w-10 h-10 mb-2 opacity-50",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9.172 16.172a4 4 0 015.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1),a("p",{class:"text-xs"},"No tokens found",-1)]))):(d(!0),t(s,{key:2},l(se.value,e=>(d(),t("div",{key:e.symbol,class:"flex items-center py-2.5 px-2 border-b border-white/[0.05] active:bg-white/[0.03] transition-colors cursor-pointer text-scalable",onClick:t=>(e=>{const t=e.symbol.trim();C.setToken({icon:"",label:t,pair:`${t}/USDT`,value:`${t.toLowerCase()}_usd`}),v("navigate-to-trade")})(e)},[a("div",Mp,[a("div",Cp,[a("img",{src:y(te)(e.symbol,32),alt:e.symbol,class:"w-full h-full object-cover",onError:t=>((e,t)=>{const a=e.target,s=a.parentElement;if(s){const e=document.createElement("div");e.className="w-full h-full flex items-center justify-center text-sm font-bold text-white",e.style.background=le(t),e.textContent=t.charAt(0).toUpperCase(),s.replaceChild(e,a)}})(t,e.symbol)},null,40,Dp)]),a("div",Pp,[a("div",Up,[a("span",Lp,i(e.symbol),1),a("button",{onClick:D(t=>{return a=e.symbol+"USDT",void P.toggle(a);var a},["stop"]),class:"flex-shrink-0"},[(d(),t("svg",{class:r(["w-3.5 h-3.5 transition-colors",y(P).has(e.symbol+"USDT")?"text-[#00f6ff] fill-current":"text-white/30"]),fill:y(P).has(e.symbol+"USDT")?"currentColor":"none",stroke:"currentColor",viewBox:"0 0 24 24"},c[23]||(c[23]=[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z"},null,-1)]),10,zp))],8,jp),e.leverage?(d(),t("span",Ap,i(e.leverage)+"x ",1)):o("",!0),e.isHot?(d(),t("span",Op,"🔥")):o("",!0),e.isNew?(d(),t("span",Np,"NEW")):o("",!0)]),a("p",Bp,"Vol: "+i(e.volume),1)])]),a("div",Fp,[a("p",Ep,"$"+i(e.price),1)]),a("div",Yp,[a("span",{class:r(["inline-block px-1.5 py-0.5 rounded text-xs font-bold tabular-nums",e.change>=0?"bg-[#00d26a]/15 text-[#00d26a]":"bg-[#ff4757]/15 text-[#ff4757]"])},i(e.change>=0?"+":"")+i(e.change.toFixed(2))+"% ",3)])],8,_p))),128))])])],32))}}),[["__scopeId","data-v-18196394"]]);var Hp,Rp;function $p(){return Hp.apply(null,arguments)}function Wp(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function qp(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function Gp(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Xp(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(Gp(e,t))return!1;return!0}function Zp(e){return void 0===e}function Kp(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function Jp(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function Qp(e,t){var a,s=[],l=e.length;for(a=0;a<l;++a)s.push(t(e[a],a));return s}function ev(e,t){for(var a in t)Gp(t,a)&&(e[a]=t[a]);return Gp(t,"toString")&&(e.toString=t.toString),Gp(t,"valueOf")&&(e.valueOf=t.valueOf),e}function tv(e,t,a,s){return kb(e,t,a,s,!0).utc()}function av(e){return null==e._pf&&(e._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invali
vendor: 5,121 bytes, line 1
1dMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}),e._pf}function sv(e){var t=null,a=!1,s=e._d&&!isNaN(e._d.getTime());return s&&(t=av(e),a=Rp.call(t.parsedDateParts,function(e){return null!=e}),s=t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&a),e._strict&&(s=s&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour)),null!=Object.isFrozen&&Object.isFrozen(e)?s:(e._isValid=s,e._isValid)}function lv(e){var t=tv(NaN);return null!=e?ev(av(t),e):av(t).userInvalidated=!0,t}Rp=Array.prototype.some?Array.prototype.some:function(e){var t,a=Object(this),s=a.length>>>0;for(t=0;t<s;t++)if(t in a&&e.call(this,a[t],t,a))return!0;return!1};var rv=$p.momentProperties=[],ov=!1;function nv(e,t){var a,s,l,r=rv.length;if(Zp(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),Zp(t._i)||(e._i=t._i),Zp(t._f)||(e._f=t._f),Zp(t._l)||(e._l=t._l),Zp(t._strict)||(e._strict=t._strict),Zp(t._tzm)||(e._tzm=t._tzm),Zp(t._isUTC)||(e._isUTC=t._isUTC),Zp(t._offset)||(e._offset=t._offset),Zp(t._pf)||(e._pf=av(t)),Zp(t._locale)||(e._locale=t._locale),r>0)for(a=0;a<r;a++)Zp(l=t[s=rv[a]])||(e[s]=l);return e}function iv(e){nv(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===ov&&(ov=!0,$p.updateOffset(this),ov=!1)}function dv(e){return e instanceof iv||null!=e&&null!=e._isAMomentObject}function cv(e){!1===$p.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function uv(e,t){var a=!0;return ev(function(){if(null!=$p.deprecationHandler&&$p.deprecationHandler(null,e),a){var s,l,r,o=[],n=arguments.length;for(l=0;l<n;l++){if(s="","object"==typeof arguments[l]){for(r in s+="\n["+l+"] ",arguments[0])Gp(arguments[0],r)&&(s+=r+": "+arguments[0][r]+", ");s=s.slice(0,-2)}else s=arguments[l];o.push(s)}cv(e+"\nArguments: "+Array.prototype.slice.call(o).join("")+"\n"+(new Error).stack),a=!1}return t.apply(this,arguments)},t)}var fv,pv={};function vv(e,t){null!=$p.deprecationHandler&&$p.deprecationHandler(e,t),pv[e]||(cv(t),pv[e]=!0)}function hv(e){return"undefined"!=typeof Function&&e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function bv(e,t){var a,s=ev({},e);for(a in t)Gp(t,a)&&(qp(e[a])&&qp(t[a])?(s[a]={},ev(s[a],e[a]),ev(s[a],t[a])):null!=t[a]?s[a]=t[a]:delete s[a]);for(a in e)Gp(e,a)&&!Gp(t,a)&&qp(e[a])&&(s[a]=ev({},s[a]));return s}function mv(e){null!=e&&this.set(e)}function xv(e,t,a){var s=""+Math.abs(e),l=t-s.length;return(e>=0?a?"+":"":"-")+Math.pow(10,Math.max(0,l)).toString().substr(1)+s}$p.suppressDeprecationWarnings=!1,$p.deprecationHandler=null,fv=Object.keys?Object.keys:function(e){var t,a=[];for(t in e)Gp(e,t)&&a.push(t);return a};var gv=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,yv=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,wv={},kv={};function Sv(e,t,a,s){var l=s;"string"==typeof s&&(l=function(){return this[s]()}),e&&(kv[e]=l),t&&(kv[t[0]]=function(){return xv(l.apply(this,arguments),t[1],t[2])}),a&&(kv[a]=function(){return this.localeData().ordinal(l.apply(this,arguments),e)})}function Tv(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function _v(e,t){return e.isValid()?(t=Mv(t,e.localeData()),wv[t]=wv[t]||function(e){var t,a,s=e.match(gv);for(t=0,a=s.length;t<a;t++)kv[s[t]]?s[t]=kv[s[t]]:s[t]=Tv(s[t]);return function(t){var l,r="";for(l=0;l<a;l++)r+=hv(s[l])?s[l].call(t,e):s[l];return r}}(t),wv[t](e)):e.localeData().invalidDate()}function Mv(e,t){var a=5;function s(e){return t.longDateFormat(e)||e}for(yv.lastIndex=0;a>=0&&yv.test(e);)e=e.replace(yv,s),yv.lastIndex=0,a-=1;return e}var Cv={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function Dv(e){return"string"==typeof e?Cv[e]||Cv[e.toLowerCase()]:void 0}function Pv(e){var t,a,s={};for(a in e)Gp(e,a)&&(t=Dv(a))&&(s[t]=e[a]);return s}var Uv,Lv={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1},jv=/\d/,zv=/\d\d/,Av=/\d{3}/,Ov=/\d{4}/,Nv=/[+-]?\d{6}
vendor: 6,201 bytes, line 1
1/,Bv=/\d\d?/,Fv=/\d\d\d\d?/,Ev=/\d\d\d\d\d\d?/,Yv=/\d{1,3}/,Iv=/\d{1,4}/,Vv=/[+-]?\d{1,6}/,Hv=/\d+/,Rv=/[+-]?\d+/,$v=/Z|[+-]\d\d:?\d\d/gi,Wv=/Z|[+-]\d\d(?::?\d\d)?/gi,qv=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Gv=/^[1-9]\d?/,Xv=/^([1-9]\d|\d)/;function Zv(e,t,a){Uv[e]=hv(t)?t:function(e,s){return e&&a?a:t}}function Kv(e,t){return Gp(Uv,e)?Uv[e](t._strict,t._locale):new RegExp(Jv(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,a,s,l){return t||a||s||l})))}function Jv(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Qv(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function eh(e){var t=+e,a=0;return 0!==t&&isFinite(t)&&(a=Qv(t)),a}Uv={};var th={};function ah(e,t){var a,s,l=t;for("string"==typeof e&&(e=[e]),Kp(t)&&(l=function(e,a){a[t]=eh(e)}),s=e.length,a=0;a<s;a++)th[e[a]]=l}function sh(e,t){ah(e,function(e,a,s,l){s._w=s._w||{},t(e,s._w,s,l)})}function lh(e,t,a){null!=t&&Gp(th,e)&&th[e](t,a._a,a,e)}function rh(e){return e%4==0&&e%100!=0||e%400==0}var oh=0,nh=1,ih=2,dh=3,ch=4,uh=5,fh=6,ph=7,vh=8;function hh(e){return rh(e)?366:365}Sv("Y",0,0,function(){var e=this.year();return e<=9999?xv(e,4):"+"+e}),Sv(0,["YY",2],0,function(){return this.year()%100}),Sv(0,["YYYY",4],0,"year"),Sv(0,["YYYYY",5],0,"year"),Sv(0,["YYYYYY",6,!0],0,"year"),Zv("Y",Rv),Zv("YY",Bv,zv),Zv("YYYY",Iv,Ov),Zv("YYYYY",Vv,Nv),Zv("YYYYYY",Vv,Nv),ah(["YYYYY","YYYYYY"],oh),ah("YYYY",function(e,t){t[oh]=2===e.length?$p.parseTwoDigitYear(e):eh(e)}),ah("YY",function(e,t){t[oh]=$p.parseTwoDigitYear(e)}),ah("Y",function(e,t){t[oh]=parseInt(e,10)}),$p.parseTwoDigitYear=function(e){return eh(e)+(eh(e)>68?1900:2e3)};var bh,mh=xh("FullYear",!0);function xh(e,t){return function(a){return null!=a?(yh(this,e,a),$p.updateOffset(this,t),this):gh(this,e)}}function gh(e,t){if(!e.isValid())return NaN;var a=e._d,s=e._isUTC;switch(t){case"Milliseconds":return s?a.getUTCMilliseconds():a.getMilliseconds();case"Seconds":return s?a.getUTCSeconds():a.getSeconds();case"Minutes":return s?a.getUTCMinutes():a.getMinutes();case"Hours":return s?a.getUTCHours():a.getHours();case"Date":return s?a.getUTCDate():a.getDate();case"Day":return s?a.getUTCDay():a.getDay();case"Month":return s?a.getUTCMonth():a.getMonth();case"FullYear":return s?a.getUTCFullYear():a.getFullYear();default:return NaN}}function yh(e,t,a){var s,l,r,o,n;if(e.isValid()&&!isNaN(a)){switch(s=e._d,l=e._isUTC,t){case"Milliseconds":return void(l?s.setUTCMilliseconds(a):s.setMilliseconds(a));case"Seconds":return void(l?s.setUTCSeconds(a):s.setSeconds(a));case"Minutes":return void(l?s.setUTCMinutes(a):s.setMinutes(a));case"Hours":return void(l?s.setUTCHours(a):s.setHours(a));case"Date":return void(l?s.setUTCDate(a):s.setDate(a));case"FullYear":break;default:return}r=a,o=e.month(),n=29!==(n=e.date())||1!==o||rh(r)?n:28,l?s.setUTCFullYear(r,o,n):s.setFullYear(r,o,n)}}function wh(e,t){if(isNaN(e)||isNaN(t))return NaN;var a=(t%12+12)%12;return e+=(t-a)/12,1===a?rh(e)?29:28:31-a%7%2}bh=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},Sv("M",["MM",2],"Mo",function(){return this.month()+1}),Sv("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),Sv("MMMM",0,0,function(e){return this.localeData().months(this,e)}),Zv("M",Bv,Gv),Zv("MM",Bv,zv),Zv("MMM",function(e,t){return t.monthsShortRegex(e)}),Zv("MMMM",function(e,t){return t.monthsRegex(e)}),ah(["M","MM"],function(e,t){t[nh]=eh(e)-1}),ah(["MMM","MMMM"],function(e,t,a,s){var l=a._locale.monthsParse(e,s,a._strict);null!=l?t[nh]=l:av(a).invalidMonth=e});var kh="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Sh="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Th=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,_h=qv,Mh=qv;function Ch(e,t,a){var s,l,r,o=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],s=0;s<12;++s)r=tv([2e3,s]),this._shortMonthsParse[s]=this.monthsShort(r,"").toLocaleLowerCase(),this._longMonthsParse[s]=this.months(r,"").toLocaleLowerCase();return a?"MMM"===t?-1!==(l=bh.call(this._shortMonthsParse,o))?l:null:-1!==(l=bh.call(this._longMonthsParse,o))?l:null:"MMM"===t?-1!==(l=bh.call(this._shortMonthsParse,o))||-1!==(l=bh.call(this._longMonthsParse,o))?l:null:-1!==(l=bh.call(this._longMonthsParse,o))||-1!==(l=bh.call(this._shortMonthsParse,o))?l:null}function Dh(e,t){if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=eh(t);else if(!Kp(t=e.localeData().monthsParse(t)))return e;var a=t,s=e.date();return s=s<29?s:Math.min(s,wh(e.year(),a)),e._isUTC?e._d.setUTCMonth(a,s):e._d.setMonth(a,s),e}function Ph(e){return null!=e?(Dh(this,e),$p.updateOffset(this,!0),this):gh(this,"Month")}function Uh(){function e(e,t){return t.length-e.length}var t,a,s,l,r=[],o=[],n=[];for(t=0;t<12;t++)a=tv([2e3,t]),s=Jv(this.monthsShort(a,"")),l=Jv(this.months(a,"")),r.push(s),o.push(l),n.push(l),n.push(s);r.sort(e),o.sort(e),n.sort(e),this._monthsRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+r.join("|")+")","i")}function Lh(e,t,a,s,l,r,o){var n;return e<100&&e>=0?(n=new Date(e+400,t,a,s,l,r,o),isFinite(n.getFullYear())&&n.setFullYear(e)):n=new Date(e,t,a,s,l,r,o),n}function jh(e){var t,a;return e<100&&e>=0?((a=Array.prototype.slice.call(arguments))[0]=e+400,t=new Date(Date.UTC.apply(null,a)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function zh(e,t,a){var s=7+t-a;return-(7+jh(e,0,s).getUTCDay()-t)%7+s-1}function Ah(e,t,a,s,l){var r,o,n=1+7*(t-1)+(7+a-s)%7+zh(e,s,l);return n<=0?o=hh(r=e-1)+n:n>hh(e)?(r=e+1,o=n-hh(e)):(r=e,o=n),{year:r,dayOfYear:o}}function Oh(e,t,a){var s,l,r=zh(e.year(),t,a),o=Math.floor((e.dayOfYear()-r-1)/7)+1;return o<1?s=o+Nh(l=e.year()-1,t,a):o>Nh(e.year(),t,a)?(s=o-Nh(e.year(),t,a),l=e.year()+1):(l=e.year(),s=o),{week:s,year:l}}function Nh(e,t,a){var s=zh(e,t,a),l=zh(e+1,t,a);
1return(hh(e)-s+l)/7}function Bh(e,t){return e.slice(t,7).concat(e.slice(0,t))}Sv("w",["ww",2],"wo","week"),Sv("W",["WW",2],"Wo","isoWeek"),Zv("w",Bv,Gv),Zv("ww",Bv,zv),Zv("W",Bv,Gv),Zv("WW",Bv,zv),sh(["w","ww","W","WW"],function(e,t,a,s){t[s.substr(0,1)]=eh(e)}),Sv("d",0,"do","day"),Sv("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),Sv("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),Sv("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),Sv("e",0,0,"weekday"),Sv("E",0,0,"isoWeekday"),Zv("d",Bv),Zv("e",Bv),Zv("E",Bv),Zv("dd",function(e,t){return t.weekdaysMinRegex(e)}),Zv("ddd",function(e,t){return t.weekdaysShortRegex(e)}),Zv("dddd",function(e,t){return t.weekdaysRegex(e)}),sh(["dd","ddd","dddd"],function(e,t,a,s){var l=a._locale.weekdaysParse(e,s,a._strict);null!=l?t.d=l:av(a).invalidWeekday=e}),sh(["d","e","E"],function(e,t,a,s){t[s]=eh(e)});var Fh="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Eh="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Yh="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Ih=qv,Vh=qv,Hh=qv;function Rh(e,t,a){var s,l,r,o=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],s=0;s<7;++s)r=tv([2e3,1]).day(s),this._minWeekdaysParse[s]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[s]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[s]=this.weekdays(r,"").toLocaleLowerCase();return a?"dddd"===t?-1!==(l=bh.call(this._weekdaysParse,o))?l:null:"ddd"===t?-1!==(l=bh.call(this._shortWeekdaysParse,o))?l:null:-1!==(l=bh.call(this._minWeekdaysParse,o))?l:null:"dddd"===t?-1!==(l=bh.call(this._weekdaysParse,o))||-1!==(l=bh.call(this._shortWeekdaysParse,o))||-1!==(l=bh.call(this._minWeekdaysParse,o))?l:null:"ddd"===t?-1!==(l=bh.call(this._shortWeekdaysParse,o))||-1!==(l=bh.call(this._weekdaysParse,o))||-1!==(l=bh.call(this._minWeekdaysParse,o))?l:null:-1!==(l=bh.call(this._minWeekdaysParse,o))||-1!==(l=bh.call(this._weekdaysParse,o))||-1!==(l=bh.call(this._shortWeekdaysParse,o))?l:null}function $h(){function e(e,t){return t.length-e.length}var t,a,s,l,r,o=[],n=[],i=[],d=[];for(t=0;t<7;t++)a=tv([2e3,1]).day(t),s=Jv(this.weekdaysMin(a,"")),l=Jv(this.weekdaysShort(a,"")),r=Jv(this.weekdays(a,"")),o.push(s),n.push(l),i.push(r),d.push(s),d.push(l),d.push(r);o.sort(e),n.sort(e),i.sort(e),d.sort(e),this._weekdaysRegex=new RegExp("^("+d.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+o.join("|")+")","i")}function Wh(){return this.hours()%12||12}function qh(e,t){Sv(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function Gh(e,t){return t._meridiemParse}Sv("H",["HH",2],0,"hour"),Sv("h",["hh",2],0,Wh),Sv("k",["kk",2],0,function(){return this.hours()||24}),Sv("hmm",0,0,function(){return""+Wh.apply(this)+xv(this.minutes(),2)}),Sv("hmmss",0,0,function(){return""+Wh.apply(this)+xv(this.minutes(),2)+xv(this.seconds(),2)}),Sv("Hmm",0,0,function(){return""+this.hours()+xv(this.minutes(),2)}),Sv("Hmmss",0,0,function(){return""+this.hours()+xv(this.minutes(),2)+xv(this.seconds(),2)}),qh("a",!0),qh("A",!1),Zv("a",Gh),Zv("A",Gh),Zv("H",Bv,Xv),Zv("h",Bv,Gv),Zv("k",Bv,Gv),Zv("HH",Bv,zv),Zv("hh",Bv,zv),Zv("kk",Bv,zv),Zv("hmm",Fv),Zv("hmmss",Ev),Zv("Hmm",Fv),Zv("Hmmss",Ev),ah(["H","HH"],dh),ah(["k","kk"],function(e,t,a){var s=eh(e);t[dh]=24===s?0:s}),ah(["a","A"],function(e,t,a){a._isPm=a._locale.isPM(e),a._meridiem=e}),ah(["h","hh"],function(e,t,a){t[dh]=eh(e),av(a).bigHour=!0}),ah("hmm",function(e,t,a){var s=e.length-2;t[dh]=eh(e.substr(0,s)),t[ch]=eh(e.substr(s)),av(a).bigHour=!0}),ah("hmmss",function(e,t,a){var s=e.length-4,l=e.length-2;t[dh]=eh(e.substr(0,s)),t[ch]=eh(e.substr(s,2)),t[uh]=eh(e.substr(l)),av(a).bigHour=!0}),ah("Hmm",function(e,t,a){var s=e.length-2;t[dh]=eh(e.substr(0,s)),t[ch]=eh(e.substr(s))}),ah("Hmmss",function(e,t,a){var s=e.length-4,l=e.length-2;t[dh]=eh(e.substr(0,s)),t[ch]=eh(e.substr(s,2)),t[uh]=eh(e.substr(l))});var Xh,Zh=xh("Hours",!0),Kh={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:kh,monthsShort:Sh,week:{dow:0,doy:6},weekdays:Fh,weekdaysMin:Yh,weekdaysShort:Eh,meridiemParse:/[ap]\.?m?\.?/i},Jh={},Qh={};function eb(e,t){var a,s=Math.min(e.length,t.length);for(a=0;a<s;a+=1)if(e[a]!==t[a])return a;return s}function tb(e){return e?e.toLowerCase().replace("_","-"):e}function ab(e){var t=null;if(void 0===Jh[e]&&"undefined"!=typeof module&&module&&module.exports&&function(e){return!(!e||!e.match("^[^/\\\\]*$"))}(e))try{t=Xh._abbr,require("./locale/"+e),sb(t)}catch(a){Jh[e]=null}return Jh[e]}
vendor: 7,146 bytes, line 1
1function sb(e,t){var a;return e&&((a=Zp(t)?rb(e):lb(e,t))?Xh=a:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),Xh._abbr}function lb(e,t){if(null!==t){var a,s=Kh;if(t.abbr=e,null!=Jh[e])vv("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),s=Jh[e]._config;else if(null!=t.parentLocale)if(null!=Jh[t.parentLocale])s=Jh[t.parentLocale]._config;else{if(null==(a=ab(t.parentLocale)))return Qh[t.parentLocale]||(Qh[t.parentLocale]=[]),Qh[t.parentLocale].push({name:e,config:t}),null;s=a._config}return Jh[e]=new mv(bv(s,t)),Qh[e]&&Qh[e].forEach(function(e){lb(e.name,e.config)}),sb(e),Jh[e]}return delete Jh[e],null}function rb(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return Xh;if(!Wp(e)){if(t=ab(e))return t;e=[e]}return function(e){for(var t,a,s,l,r=0;r<e.length;){for(t=(l=tb(e[r]).split("-")).length,a=(a=tb(e[r+1]))?a.split("-"):null;t>0;){if(s=ab(l.slice(0,t).join("-")))return s;if(a&&a.length>=t&&eb(l,a)>=t-1)break;t--}r++}return Xh}(e)}function ob(e){var t,a=e._a;return a&&-2===av(e).overflow&&(t=a[nh]<0||a[nh]>11?nh:a[ih]<1||a[ih]>wh(a[oh],a[nh])?ih:a[dh]<0||a[dh]>24||24===a[dh]&&(0!==a[ch]||0!==a[uh]||0!==a[fh])?dh:a[ch]<0||a[ch]>59?ch:a[uh]<0||a[uh]>59?uh:a[fh]<0||a[fh]>999?fh:-1,av(e)._overflowDayOfYear&&(t<oh||t>ih)&&(t=ih),av(e)._overflowWeeks&&-1===t&&(t=ph),av(e)._overflowWeekday&&-1===t&&(t=vh),av(e).overflow=t),e}var nb=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ib=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,db=/Z|[+-]\d\d(?::?\d\d)?/,cb=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],ub=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],fb=/^\/?Date\((-?\d+)/i,pb=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,vb={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function hb(e){var t,a,s,l,r,o,n=e._i,i=nb.exec(n)||ib.exec(n),d=cb.length,c=ub.length;if(i){for(av(e).iso=!0,t=0,a=d;t<a;t++)if(cb[t][1].exec(i[1])){l=cb[t][0],s=!1!==cb[t][2];break}if(null==l)return void(e._isValid=!1);if(i[3]){for(t=0,a=c;t<a;t++)if(ub[t][1].exec(i[3])){r=(i[2]||" ")+ub[t][0];break}if(null==r)return void(e._isValid=!1)}if(!s&&null!=r)return void(e._isValid=!1);if(i[4]){if(!db.exec(i[4]))return void(e._isValid=!1);o="Z"}e._f=l+(r||"")+(o||""),yb(e)}else e._isValid=!1}function bb(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}function mb(e){var t,a,s,l,r,o,n,i,d=pb.exec(e._i.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,""));if(d){if(a=d[4],s=d[3],l=d[2],r=d[5],o=d[6],n=d[7],i=[bb(a),Sh.indexOf(s),parseInt(l,10),parseInt(r,10),parseInt(o,10)],n&&i.push(parseInt(n,10)),t=i,!function(e,t,a){return!e||Eh.indexOf(e)===new Date(t[0],t[1],t[2]).getDay()||(av(a).weekdayMismatch=!0,a._isValid=!1,!1)}(d[1],t,e))return;e._a=t,e._tzm=function(e,t,a){if(e)return vb[e];if(t)return 0;var s=parseInt(a,10),l=s%100;return(s-l)/100*60+l}(d[8],d[9],d[10]),e._d=jh.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),av(e).rfc2822=!0}else e._isValid=!1}function xb(e,t,a){return null!=e?e:null!=t?t:a}function gb(e){var t,a,s,l,r,o=[];if(!e._d){for(s=function(e){var t=new Date($p.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}(e),e._w&&null==e._a[ih]&&null==e._a[nh]&&function(e){var t,a,s,l,r,o,n,i,d;null!=(t=e._w).GG||null!=t.W||null!=t.E?(r=1,o=4,a=xb(t.GG,e._a[oh],Oh(Sb(),1,4).year),s=xb(t.W,1),((l=xb(t.E,1))<1||l>7)&&(i=!0)):(r=e._locale._week.dow,o=e._locale._week.doy,d=Oh(Sb(),r,o),a=xb(t.gg,e._a[oh],d.year),s=xb(t.w,d.week),null!=t.d?((l=t.d)<0||l>6)&&(i=!0):null!=t.e?(l=t.e+r,(t.e<0||t.e>6)&&(i=!0)):l=r),s<1||s>Nh(a,r,o)?av(e)._overflowWeeks=!0:null!=i?av(e)._overflowWeekday=!0:(n=Ah(a,s,l,r,o),e._a[oh]=n.year,e._dayOfYear=n.dayOfYear)}(e),null!=e._dayOfYear&&(r=xb(e._a[oh],s[oh]),(e._dayOfYear>hh(r)||0===e._dayOfYear)&&(av(e)._overflowDayOfYear=!0),a=jh(r,0,e._dayOfYear),e._a[nh]=a.getUTCMonth(),e._a[ih]=a.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=o[t]=s[t];for(;t<7;t++)e._a[t]=o[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[dh]&&0===e._a[ch]&&0===e._a[uh]&&0===e._a[fh]&&(e._nextDay=!0,e._a[dh]=0),e._d=(e._useUTC?jh:Lh).apply(null,o),l=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[dh]=24),e._w&&void 0!==e._w.d&&e._w.d!==l&&(av(e).weekdayMismatch=!0)}}function yb(e){if(e._f!==$p.ISO_8601)if(e._f!==$p.RFC_2822){e._a=[],av(e).empty=!0;var t,a,s,l,r,o,n,i=""+e._i,d=i.length,c=0;for(n=(s=Mv(e._f,e._locale).match(gv)||[]).length,t=0;t<n;t++)l=s[t],(a=(i.match(Kv(l,e))||[])[0])&&((r=i.substr(0,i.indexOf(a))).length>0&&av(e).unusedInput.push(r),i=i.slice(i.indexOf(a)+a.length),c+=a.length),kv[l]?(a?av(e).empty=!1:av(e).unusedTokens.push(l),lh(l,a,e)):e._strict&&!a&&av(e).unusedTokens.push(l);av(e).charsLeftOver=d-c,i.length>0&&av(e).unusedInput.push(i),e._a[dh]<=12&&!0===av(e).bigHour&&e._a[dh]>0&&(av(e).bigHour=void 0),av(e).parsedDateParts=e._a.slice(0),av(e).meridiem=e._meridiem,e._a[dh]=(u=e._locale,f=e._a[dh],null==(p=e._meridiem)?f:null!=u.meridiemHour?u.meridiemHour(f,p):null!=u.isPM?((v=u.isPM(p))&&f<12&&(f+=12),v||12!==f||(f=0),f):f),null!==(o=av(e).era)&&(e._a[oh]=e._locale.erasConvertYear(o,e._a[oh])),gb(e),ob(e)}else mb(e);else hb(e);var u,f,p,v}function wb(e){var t=e._i,a=e._f;return e._locale=e._locale||rb(e._l),null===t||void 0===a&&""===t?lv({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),dv(t)?new iv(ob(t)):(Jp(t)?e._d=t:Wp(a)?function(e){var t,a,s,l,r,o,n=!1,i=e._f.length;if(0===i)return av(e).invalidFormat=!0,void(e._d=new Date(NaN));for(l=0;l<i;l++)r=0,o=!1,t=nv({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[l],yb(t),sv(t)&&(o=!0),r+=av(t).charsLeftOver,r+=10*av(t).unusedTokens.length,av(t).score=r,n?r<s&&(s=r,a=t):(null==s||r<s||o)&&(s=r,a=t,o&&(n=!0));ev(e,a||t)}(e):a?yb(e):function(e){var t=e._i;Zp(t)?e._d=new Date($p.now()):Jp(t)?e._d=new Date(t.valueOf()):"string"==typeof t?function(e){var t=fb.exec(e._i);
vendor: 22,667 bytes, line 1
1null===t?(hb(e),!1===e._isValid&&(delete e._isValid,mb(e),!1===e._isValid&&(delete e._isValid,e._strict?e._isValid=!1:$p.createFromInputFallback(e)))):e._d=new Date(+t[1])}(e):Wp(t)?(e._a=Qp(t.slice(0),function(e){return parseInt(e,10)}),gb(e)):qp(t)?function(e){if(!e._d){var t=Pv(e._i),a=void 0===t.day?t.date:t.day;e._a=Qp([t.year,t.month,a,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),gb(e)}}(e):Kp(t)?e._d=new Date(t):$p.createFromInputFallback(e)}(e),sv(e)||(e._d=null),e))}function kb(e,t,a,s,l){var r,o={};return!0!==t&&!1!==t||(s=t,t=void 0),!0!==a&&!1!==a||(s=a,a=void 0),(qp(e)&&Xp(e)||Wp(e)&&0===e.length)&&(e=void 0),o._isAMomentObject=!0,o._useUTC=o._isUTC=l,o._l=a,o._i=e,o._f=t,o._strict=s,(r=new iv(ob(wb(o))))._nextDay&&(r.add(1,"d"),r._nextDay=void 0),r}function Sb(e,t,a,s){return kb(e,t,a,s,!1)}$p.createFromInputFallback=uv("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),$p.ISO_8601=function(){},$p.RFC_2822=function(){};var Tb=uv("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Sb.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:lv()}),_b=uv("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Sb.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:lv()});function Mb(e,t){var a,s;if(1===t.length&&Wp(t[0])&&(t=t[0]),!t.length)return Sb();for(a=t[0],s=1;s<t.length;++s)t[s].isValid()&&!t[s][e](a)||(a=t[s]);return a}var Cb=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Db(e){var t=Pv(e),a=t.year||0,s=t.quarter||0,l=t.month||0,r=t.week||t.isoWeek||0,o=t.day||0,n=t.hour||0,i=t.minute||0,d=t.second||0,c=t.millisecond||0;this._isValid=function(e){var t,a,s=!1,l=Cb.length;for(t in e)if(Gp(e,t)&&(-1===bh.call(Cb,t)||null!=e[t]&&isNaN(e[t])))return!1;for(a=0;a<l;++a)if(e[Cb[a]]){if(s)return!1;parseFloat(e[Cb[a]])!==eh(e[Cb[a]])&&(s=!0)}return!0}(t),this._milliseconds=+c+1e3*d+6e4*i+1e3*n*60*60,this._days=+o+7*r,this._months=+l+3*s+12*a,this._data={},this._locale=rb(),this._bubble()}function Pb(e){return e instanceof Db}function Ub(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function Lb(e,t){Sv(e,0,0,function(){var e=this.utcOffset(),a="+";return e<0&&(e=-e,a="-"),a+xv(~~(e/60),2)+t+xv(~~e%60,2)})}Lb("Z",":"),Lb("ZZ",""),Zv("Z",Wv),Zv("ZZ",Wv),ah(["Z","ZZ"],function(e,t,a){a._useUTC=!0,a._tzm=zb(Wv,e)});var jb=/([\+\-]|\d\d)/gi;function zb(e,t){var a,s,l=(t||"").match(e);return null===l?null:0===(s=60*(a=((l[l.length-1]||[])+"").match(jb)||["-",0,0])[1]+eh(a[2]))?0:"+"===a[0]?s:-s}function Ab(e,t){var a,s;return t._isUTC?(a=t.clone(),s=(dv(e)||Jp(e)?e.valueOf():Sb(e).valueOf())-a.valueOf(),a._d.setTime(a._d.valueOf()+s),$p.updateOffset(a,!1),a):Sb(e).local()}function Ob(e){return-Math.round(e._d.getTimezoneOffset())}function Nb(){return!!this.isValid()&&this._isUTC&&0===this._offset}$p.updateOffset=function(){};var Bb=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Fb=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Eb(e,t){var a,s,l,r,o,n,i=e,d=null;return Pb(e)?i={ms:e._milliseconds,d:e._days,M:e._months}:Kp(e)||!isNaN(+e)?(i={},t?i[t]=+e:i.milliseconds=+e):(d=Bb.exec(e))?(a="-"===d[1]?-1:1,i={y:0,d:eh(d[ih])*a,h:eh(d[dh])*a,m:eh(d[ch])*a,s:eh(d[uh])*a,ms:eh(Ub(1e3*d[fh]))*a}):(d=Fb.exec(e))?(a="-"===d[1]?-1:1,i={y:Yb(d[2],a),M:Yb(d[3],a),w:Yb(d[4],a),d:Yb(d[5],a),h:Yb(d[6],a),m:Yb(d[7],a),s:Yb(d[8],a)}):null==i?i={}:"object"==typeof i&&("from"in i||"to"in i)&&(r=Sb(i.from),o=Sb(i.to),l=r.isValid()&&o.isValid()?(o=Ab(o,r),r.isBefore(o)?n=Ib(r,o):((n=Ib(o,r)).milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0},(i={}).ms=l.milliseconds,i.M=l.months),s=new Db(i),Pb(e)&&Gp(e,"_locale")&&(s._locale=e._locale),Pb(e)&&Gp(e,"_isValid")&&(s._isValid=e._isValid),s}function Yb(e,t){var a=e&&parseFloat(e.replace(",","."));return(isNaN(a)?0:a)*t}function Ib(e,t){var a={};return a.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(a.months,"M").isAfter(t)&&--a.months,a.milliseconds=+t-+e.clone().add(a.months,"M"),a}function Vb(e,t){return function(a,s){var l;return null===s||isNaN(+s)||(vv(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),l=a,a=s,s=l),Hb(this,Eb(a,s),e),this}}function Hb(e,t,a,s){var l=t._milliseconds,r=Ub(t._days),o=Ub(t._months);e.isValid()&&(s=null==s||s,o&&Dh(e,gh(e,"Month")+o*a),r&&yh(e,"Date",gh(e,"Date")+r*a),l&&e._d.setTime(e._d.valueOf()+l*a),s&&$p.updateOffset(e,r||o))}Eb.fn=Db.prototype,Eb.invalid=function(){return Eb(NaN)};var Rb=Vb(1,"add"),$b=Vb(-1,"subtract");function Wb(e){return"string"==typeof e||e instanceof String}function qb(e,t){if(e.date()<t.date())return-qb(t,e);var a=12*(t.year()-e.year())+(t.month()-e.month()),s=e.clone().add(a,"months");return-(a+(t-s<0?(t-s)/(s-e.clone().add(a-1,"months")):(t-s)/(e.clone().add(a+1,"months")-s)))||0}function Gb(e){var t;return void 0===e?this._locale._abbr:(null!=(t=rb(e))&&(this._locale=t),this)}$p.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",$p.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var Xb=uv("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});function Zb(){return this._locale}var Kb=1e3,Jb=6e4,Qb=36e5,em=126227808e5;function tm(e,t){return(e%t+t)%t}function am(e,t,a){return e<100&&e>=0?new Date(e+400,t,a)-em:new Date(e,t,a).valueOf()}function sm(e,t,a){return e<100&&e>=0?Date.UTC(e+400,t,a)-em:Date.UTC(e,t,a)}function lm(e,t){return t.erasAbbrRegex(e)}function rm(){var e,t,a,s,l,r=[],o=[],n=[],i=[],d=this.eras();for(e=0,t=d.length;e<t;++e)a=Jv(d[e].name),s=Jv(d[e].abbr),l=Jv(d[e].narrow),o.push(a),r.push(s),n.push(l),i.push(a),i.push(s),i.push(l);this._erasRegex=new RegExp("^("+i.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+o.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+r.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+n.join("|")+")","i")}function om(e,t){Sv(0,[e,e.length],0,t)}function nm(e,t,a,s,l){var r;return null==e?Oh(this,s,l).year:(t>(r=Nh(e,s,l))&&(t=r),im.call(this,e,t,a,s,l))}function im(e,t,a,s,l){var r=Ah(e,t,a,s,l),o=jh(r.year,0,r.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}Sv("N",0,0,"eraAbbr"),Sv("NN",0,0,"eraAbbr"),Sv("NNN",0,0,"eraAbbr"),Sv("NNNN",0,0,"eraName"),Sv("NNNNN",0,0,"eraNarrow"),Sv("y",["y",1],"yo","eraYear"),Sv("y",["yy",2],0,"eraYear"),Sv("y",["yyy",3],0,"eraYear"),Sv("y",["yyyy",4],0,"eraYear"),Zv("N",lm),Zv("NN",lm),Zv("NNN",lm),Zv("NNNN",function(e,t){return t.erasNameRegex(e)}),Zv("NNNNN",function(e,t){return t.erasNarrowRegex(e)}),ah(["N","NN","NNN","NNNN","NNNNN"],function(e,t,a,s){var l=a._locale.erasParse(e,s,a._strict);l?av(a).era=l:av(a).invalidEra=e}),Zv("y",Hv),Zv("yy",Hv),Zv("yyy",Hv),Zv("yyyy",Hv),Zv("yo",function(e,t){return t._eraYearOrdinalRegex||Hv}),ah(["y","yy","yyy","yyyy"],oh),ah(["yo"],function(e,t,a,s){var l;a._locale._eraYearOrdinalRegex&&(l=e.match(a._locale._eraYearOrdinalRegex)),a._locale.eraYearOrdinalParse?t[oh]=a._locale.eraYearOrdinalParse(e,l):t[oh]=parseInt(e,10)}),Sv(0,["gg",2],0,function(){return this.weekYear()%100}),Sv(0,["GG",2],0,function(){return this.isoWeekYear()%100}),om("gggg","weekYear"),om("ggggg","weekYear"),om("GGGG","isoWeekYear"),om("GGGGG","isoWeekYear"),Zv("G",Rv),Zv("g",Rv),Zv("GG",Bv,zv),Zv("gg",Bv,zv),Zv("GGGG",Iv,Ov),Zv("gggg",Iv,Ov),Zv("GGGGG",Vv,Nv),Zv("ggggg",Vv,Nv),sh(["gggg","ggggg","GGGG","GGGGG"],function(e,t,a,s){t[s.substr(0,2)]=eh(e)}),sh(["gg","GG"],function(e,t,a,s){t[s]=$p.parseTwoDigitYear(e)}),Sv("Q",0,"Qo","quarter"),Zv("Q",jv),ah("Q",function(e,t){t[nh]=3*(eh(e)-1)}),Sv("D",["DD",2],"Do","date"),Zv("D",Bv,Gv),Zv("DD",Bv,zv),Zv("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),ah(["D","DD"],ih),ah("Do",function(e,t){t[ih]=eh(e.match(Bv)[0])});var dm=xh("Date",!0);Sv("DDD",["DDDD",3],"DDDo","dayOfYear"),Zv("DDD",Yv),Zv("DDDD",Av),ah(["DDD","DDDD"],function(e,t,a){a._dayOfYear=eh(e)}),Sv("m",["mm",2],0,"minute"),Zv("m",Bv,Xv),Zv("mm",Bv,zv),ah(["m","mm"],ch);var cm=xh("Minutes",!1);Sv("s",["ss",2],0,"second"),Zv("s",Bv,Xv),Zv("ss",Bv,zv),ah(["s","ss"],uh);var um,fm,pm=xh("Seconds",!1);for(Sv("S",0,0,function(){return~~(this.millisecond()/100)}),Sv(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),Sv(0,["SSS",3],0,"millisecond"),Sv(0,["SSSS",4],0,function(){return 10*this.millisecond()}),Sv(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),Sv(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),Sv(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),Sv(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),Sv(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),Zv("S",Yv,jv),Zv("SS",Yv,zv),Zv("SSS",Yv,Av),um="SSSS";um.length<=9;um+="S")Zv(um,Hv);function vm(e,t){t[fh]=eh(1e3*("0."+e))}for(um="S";um.length<=9;um+="S")ah(um,vm);fm=xh("Milliseconds",!1),Sv("z",0,0,"zoneAbbr"),Sv("zz",0,0,"zoneName");var hm=iv.prototype;function bm(e){return e}hm.add=Rb,hm.calendar=function(e,t){var a;1===arguments.length&&(arguments[0]?dv(a=arguments[0])||Jp(a)||Wb(a)||Kp(a)||function(e){var t=Wp(e),a=!1;return t&&(a=0===e.filter(function(t){return!Kp(t)&&Wb(e)}).length),t&&a}(a)||function(e){var t,a=qp(e)&&!Xp(e),s=!1,l=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],r=l.length;for(t=0;t<r;t+=1)s=s||Gp(e,l[t]);return a&&s}(a)||null==a?(e=arguments[0],t=void 0):function(e){var t,a=qp(e)&&!Xp(e),s=!1,l=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"];for(t=0;t<l.length;t+=1)s=s||Gp(e,l[t]);return a&&s}(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var s=e||Sb(),l=Ab(s,this).startOf("day"),r=$p.calendarFormat(this,l)||"sameElse",o=t&&(hv(t[r])?t[r].call(this,s):t[r]);return this.format(o||this.localeData().calendar(r,this,Sb(s)))},hm.clone=function(){return new iv(this)},hm.diff=function(e,t,a){var s,l,r;if(!this.isValid())return NaN;if(!(s=Ab(e,this)).isValid())return NaN;switch(l=6e4*(s.utcOffset()-this.utcOffset()),t=Dv(t)){case"year":r=qb(this,s)/12;break;case"month":r=qb(this,s);break;case"quarter":r=qb(this,s)/3;break;case"second":r=(this-s)/1e3;break;case"minute":r=(this-s)/6e4;break;case"hour":r=(this-s)/36e5;break;case"day":r=(this-s-l)/864e5;break;case"week":r=(this-s-l)/6048e5;break;default:r=this-s}return a?r:Qv(r)},hm.endOf=function(e){var t,a;if(void 0===(e=Dv(e))||"millisecond"===e||!this.isValid())return this;switch(a=this._isUTC?sm:am,e){case"year":t=a(this.year()+1,0,1)-1;break;case"quarter":t=a(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=a(this.year(),this.month()+1,1)-1;break;case"week":t=a(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=a(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=a(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=Qb-tm(t+(this._isUTC?0:this.utcOffset()*Jb),Qb)-1;break;case"minute":t=this._d.valueOf(),t+=Jb-tm(t,Jb)-1;break;case"second":t=this._d.valueOf(),t+=Kb-tm(t,Kb)-1}return this._d.setTime(t),$p.updateOffset(this,!0),this},hm.format=function(e){e||(e=this.isUtc()?$p.defaultFormatUtc:$p.defaultFormat);var t=_v(this,e);return this.localeData().postformat(t)},hm.from=function(e,t){return this.isValid()&&(dv(e)&&e.isValid()||Sb(e).isValid())?Eb({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},hm.fromNow=function(e){return this.from(Sb(),e)},hm.to=function(e,t){return this.isValid()&&(dv(e)&&e.isValid()||Sb(e).isValid())?Eb({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},hm.toNow=function(e){return this.to(Sb(),e)},hm.get=function(e){return hv(this[e=Dv(e)])?this[e]():this},hm.invalidAt=function(){return av(this).overflow},hm.isAfter=function(e,t){var a=dv(e)?e:Sb(e);return!(!this.isValid()||!a.isValid())&&("millisecond"===(t=Dv(t)||"millisecond")?this.valueOf()>a.valueOf():a.valueOf()<this.clone().startOf(t).valueOf())},hm.isBefore=function(e,t){var a=dv(e)?e:Sb(e);return!(!this.isValid()||!a.isValid())&&("millisecond"===(t=Dv(t)||"millisecond")?this.valueOf()<a.valueOf():this.clone().endOf(t).valueOf()<a.valueOf())},hm.isBetween=function(e,t,a,s){var l=dv(e)?e:Sb(e),r=dv(t)?t:Sb(t);return!!(this.isValid()&&l.isValid()&&r.isValid())&&("("===(s=s||"()")[0]?this.isAfter(l,a):!this.isBefore(l,a))&&(")"===s[1]?this.isBefore(r,a):!this.isAfter(r,a))},hm.isSame=function(e,t){var a,s=dv(e)?e:Sb(e);return!(!this.isValid()||!s.isValid())&&("millisecond"===(t=Dv(t)||"millisecond")?this.valueOf()===s.valueOf():(a=s.valueOf(),this.clone().startOf(t).valueOf()<=a&&a<=this.clone().endOf(t).valueOf()))},hm.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},hm.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},hm.isValid=function(){return sv(this)},hm.lang=Xb,hm.locale=Gb,hm.localeData=Zb,hm.max=_b,hm.min=Tb,hm.parsingFlags=function(){return ev({},av(this))},hm.set=function(e,t){if("object"==typeof e){var a,s=function(e){var t,a=[];for(t in e)Gp(e,t)&&a.push({unit:t,priority:Lv[t]});return a.sort(function(e,t){return e.priority-t.priority}),a}(e=Pv(e)),l=s.length;for(a=0;a<l;a++)this[s[a].unit](e[s[a].unit])}else if(hv(this[e=Dv(e)]))return this[e](t);return this},hm.startOf=function(e){var t,a;if(void 0===(e=Dv(e))||"millisecond"===e||!this.isValid())return this;switch(a=this._isUTC?sm:am,e){case"year":t=a(this.year(),0,1);break;case"quarter":t=a(this.year(),this.month()-this.month()%3,1);break;case"month":t=a(this.year(),this.month(),1);break;case"week":t=a(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=a(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=a(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=tm(t+(this._isUTC?0:this.utcOffset()*Jb),Qb);break;case"minute":t=this._d.valueOf(),t-=tm(t,Jb);break;case"second":t=this._d.valueOf(),t-=tm(t,Kb)}return this._d.setTime(t),$p.updateOffset(this,!0),this},hm.subtract=$b,hm.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},hm.toObject=function(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}},hm.toDate=function(){return new Date(this.valueOf())},hm.toISOString=function(e){if(!this.isValid())return null;var t=!0!==e,a=t?this.clone().utc():this;return a.year()<0||a.year()>9999?_v(a,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):hv(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",_v(a,"Z")):_v(a,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},hm.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e,t,a,s="moment",l="";return this.isLocal()||(s=0===this.utcOffset()?"moment.utc":"moment.parseZone",l="Z"),e="["+s+'("]',t=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",a=l+'[")]',this.format(e+t+"-MM-DD[T]HH:mm:ss.SSS"+a)},"undefined"!=typeof Symbol&&null!=Symbol.for&&(hm[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),hm.toJSON=function(){return this.isValid()?this.toISOString():null},hm.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},hm.unix=function(){return Math.floor(this.valueOf()/1e3)},hm.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},hm.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},hm.eraName=function(){var e,t,a,s=this.localeData().eras();for(e=0,t=s.length;e<t;++e){if(a=this.clone().startOf("day").valueOf(),s[e].since<=a&&a<=s[e].until)return s[e].name;if(s[e].until<=a&&a<=s[e].since)return s[e].name}return""},hm.eraNarrow=function(){var e,t,a,s=this.localeData().eras();for(e=0,t=s.length;e<t;++e){if(a=this.clone().startOf("day").valueOf(),s[e].since<=a&&a<=s[e].until)return s[e].narrow;if(s[e].until<=a&&a<=s[e].since)return s[e].narrow}return""},hm.eraAbbr=function(){var e,t,a,s=this.localeData().eras();for(e=0,t=s.length;e<t;++e){if(a=this.clone().startOf("day").valueOf(),s[e].since<=a&&a<=s[e].until)return s[e].abbr;if(s[e].until<=a&&a<=s[e].since)return s[e].abbr}return""},hm.eraYear=function(){var e,t,a,s,l=this.localeData().eras();for(e=0,t=l.length;e<t;++e)if(a=l[e].since<=l[e].until?1:-1,s=this.clone().startOf("day").valueOf(),l[e].since<=s&&s<=l[e].until||l[e].until<=s&&s<=l[e].since)return(this.year()-$p(l[e].since).year())*a+l[e].offset;return this.year()},hm.year=mh,hm.isLeapYear=function(){return rh(this.year())},hm.weekYear=function(e){return nm.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)},hm.isoWeekYear=function(e){return nm.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},hm.quarter=hm.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},hm.month=Ph,hm.daysInMonth=function(){return wh(this.year(),this.month())},hm.week=hm.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},hm.isoWeek=hm.isoWeeks=function(e){var t=Oh(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},hm.weeksInYear=function(){var e=this.localeData()._week;return Nh(this.year(),e.dow,e.doy)},hm.weeksInWeekYear=function(){var e=this.localeData()._week;return Nh(this.weekYear(),e.dow,e.doy)},hm.isoWeeksInYear=function(){return Nh(this.year(),1,4)},hm.isoWeeksInISOWeekYear=function(){return Nh(this.isoWeekYear(),1,4)},hm.date=dm,hm.day=hm.days=function(e){if(!this.isValid())return null!=e?this:NaN;var t=gh(this,"Day");return null!=e?(e=function(e,t){return"string"!=typeof e?e:isNaN(e)?"number"==typeof(e=t.weekdaysParse(e))?e:null:parseInt(e,10)}(e,this.localeData()),this.add(e-t,"d")):t},hm.weekday=function(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")},hm.isoWeekday=function(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=function(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7},hm.dayOfYear=function(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},hm.hour=hm.hours=Zh,hm.minute=hm.minutes=cm,hm.second=hm.seconds=pm,hm.millisecond=hm.milliseconds=fm,hm.utcOffset=function(e,t,a){var s,l=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null!=e){if("string"==typeof e){if(null===(e=zb(Wv,e)))return this}else Math.abs(e)<16&&!a&&(e*=60);return!this._isUTC&&t&&(s=Ob(this)),this._offset=e,this._isUTC=!0,null!=s&&this.add(s,"m"),l!==e&&(!t||this._changeInProgress?Hb(this,Eb(e-l,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,$p.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?l:Ob(this)},hm.utc=function(e){return this.utcOffset(0,e)},hm.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Ob(this),"m")),this},hm.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=zb($v,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this},hm.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?Sb(e).utcOffset():0,(this.utcOffset()-e)%60==0)},hm.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},hm.isLocal=function(){return!!this.isValid()&&!this._isUTC},hm.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},hm.isUtc=Nb,hm.isUTC=Nb,hm.zoneAbbr=function(){return this._isUTC?"UTC":""},hm.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},hm.dates=uv("dates accessor is deprecated. Use date instead.",dm),hm.months=uv("months accessor is deprecated. Use month instead",Ph),hm.years=uv("years accessor is deprecated. Use year instead",mh),hm.zone=uv("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}),hm.isDSTShifted=uv("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!Zp(this._isDSTShifted))return this._isDSTShifted;var e,t={};return nv(t,this),(t=wb(t))._a?(e=t._isUTC?tv(t._a):Sb(t._a),this._isDSTShifted=this.isValid()&&function(e,t){var a,s=Math.min(e.length,t.length),l=Math.abs(e.length-t.length),r=0;for(a=0;a<s;a++)eh(e[a])!==eh(t[a])&&r++;return r+l}(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted});var mm=mv.prototype;function xm(e,t,a,s){var l=rb(),r=tv().set(s,t);return l[a](r,e)}function gm(e,t,a){if(Kp(e)&&(t=e,e=void 0),e=e||"",null!=t)return xm(e,t,a,"month");var s,l=[];for(s=0;s<12;s++)l[s]=xm(e,s,a,"month");return l}function ym(e,t,a,s){"boolean"==typeof e?(Kp(t)&&(a=t,t=void 0),t=t||""):(a=t=e,e=!1,Kp(t)&&(a=t,t=void 0),t=t||"");var l,r=rb(),o=e?r._week.dow:0,n=[];if(null!=a)return xm(t,(a+o)%7,s,"day");for(l=0;l<7;l++)n[l]=xm(t,(l+o)%7,s,"day");return n}mm.calendar=function(e,t,a){var s=this._calendar[e]||this._calendar.sameElse;return hv(s)?s.call(t,a):s},mm.longDateFormat=function(e){var t=this._longDateFormat[e],a=this._longDateFormat[e.toUpperCase()];return t||!a?t:(this._longDateFormat[e]=a.match(gv).map(function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e}).join(""),this._longDateFormat[e])}
vendor: 4,168 bytes, line 1
1,mm.invalidDate=function(){return this._invalidDate},mm.ordinal=function(e){return this._ordinal.replace("%d",e)},mm.preparse=bm,mm.postformat=bm,mm.relativeTime=function(e,t,a,s){var l=this._relativeTime[a];return hv(l)?l(e,t,a,s):l.replace(/%d/i,e)},mm.pastFuture=function(e,t){var a=this._relativeTime[e>0?"future":"past"];return hv(a)?a(t):a.replace(/%s/i,t)},mm.set=function(e){var t,a;for(a in e)Gp(e,a)&&(hv(t=e[a])?this[a]=t:this["_"+a]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},mm.eras=function(e,t){var a,s,l,r=this._eras||rb("en")._eras;for(a=0,s=r.length;a<s;++a)switch("string"==typeof r[a].since&&(l=$p(r[a].since).startOf("day"),r[a].since=l.valueOf()),typeof r[a].until){case"undefined":r[a].until=1/0;break;case"string":l=$p(r[a].until).startOf("day").valueOf(),r[a].until=l.valueOf()}return r},mm.erasParse=function(e,t,a){var s,l,r,o,n,i=this.eras();for(e=e.toUpperCase(),s=0,l=i.length;s<l;++s)if(r=i[s].name.toUpperCase(),o=i[s].abbr.toUpperCase(),n=i[s].narrow.toUpperCase(),a)switch(t){case"N":case"NN":case"NNN":if(o===e)return i[s];break;case"NNNN":if(r===e)return i[s];break;case"NNNNN":if(n===e)return i[s]}else if([r,o,n].indexOf(e)>=0)return i[s]},mm.erasConvertYear=function(e,t){var a=e.since<=e.until?1:-1;return void 0===t?$p(e.since).year():$p(e.since).year()+(t-e.offset)*a},mm.erasAbbrRegex=function(e){return Gp(this,"_erasAbbrRegex")||rm.call(this),e?this._erasAbbrRegex:this._erasRegex},mm.erasNameRegex=function(e){return Gp(this,"_erasNameRegex")||rm.call(this),e?this._erasNameRegex:this._erasRegex},mm.erasNarrowRegex=function(e){return Gp(this,"_erasNarrowRegex")||rm.call(this),e?this._erasNarrowRegex:this._erasRegex},mm.months=function(e,t){return e?Wp(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||Th).test(t)?"format":"standalone"][e.month()]:Wp(this._months)?this._months:this._months.standalone},mm.monthsShort=function(e,t){return e?Wp(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Th.test(t)?"format":"standalone"][e.month()]:Wp(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},mm.monthsParse=function(e,t,a){var s,l,r;if(this._monthsParseExact)return Ch.call(this,e,t,a);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),s=0;s<12;s++){if(l=tv([2e3,s]),a&&!this._longMonthsParse[s]&&(this._longMonthsParse[s]=new RegExp("^"+this.months(l,"").replace(".","")+"$","i"),this._shortMonthsParse[s]=new RegExp("^"+this.monthsShort(l,"").replace(".","")+"$","i")),a||this._monthsParse[s]||(r="^"+this.months(l,"")+"|^"+this.monthsShort(l,""),this._monthsParse[s]=new RegExp(r.replace(".",""),"i")),a&&"MMMM"===t&&this._longMonthsParse[s].test(e))return s;if(a&&"MMM"===t&&this._shortMonthsParse[s].test(e))return s;if(!a&&this._monthsParse[s].test(e))return s}},mm.monthsRegex=function(e){return this._monthsParseExact?(Gp(this,"_monthsRegex")||Uh.call(this),e?this._monthsStrictRegex:this._monthsRegex):(Gp(this,"_monthsRegex")||(this._monthsRegex=Mh),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},mm.monthsShortRegex=function(e){return this._monthsParseExact?(Gp(this,"_monthsRegex")||Uh.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(Gp(this,"_monthsShortRegex")||(this._monthsShortRegex=_h),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},mm.week=function(e){return Oh(e,this._week.dow,this._week.doy).week},mm.firstDayOfYear=function(){return this._week.doy},mm.firstDayOfWeek=function(){return this._week.dow},mm.weekdays=function(e,t){var a=Wp(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?Bh(a,this._week.dow):e?a[e.day()]:a},mm.weekdaysMin=function(e){return!0===e?Bh(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin},mm.weekdaysShort=function(e){return!0===e?Bh(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort},mm.weekdaysParse=function(e,t,a){var s,l,r;
vendor: 6,061 bytes, line 1
1if(this._weekdaysParseExact)return Rh.call(this,e,t,a);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),s=0;s<7;s++){if(l=tv([2e3,1]).day(s),a&&!this._fullWeekdaysParse[s]&&(this._fullWeekdaysParse[s]=new RegExp("^"+this.weekdays(l,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[s]=new RegExp("^"+this.weekdaysShort(l,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[s]=new RegExp("^"+this.weekdaysMin(l,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[s]||(r="^"+this.weekdays(l,"")+"|^"+this.weekdaysShort(l,"")+"|^"+this.weekdaysMin(l,""),this._weekdaysParse[s]=new RegExp(r.replace(".",""),"i")),a&&"dddd"===t&&this._fullWeekdaysParse[s].test(e))return s;if(a&&"ddd"===t&&this._shortWeekdaysParse[s].test(e))return s;if(a&&"dd"===t&&this._minWeekdaysParse[s].test(e))return s;if(!a&&this._weekdaysParse[s].test(e))return s}},mm.weekdaysRegex=function(e){return this._weekdaysParseExact?(Gp(this,"_weekdaysRegex")||$h.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(Gp(this,"_weekdaysRegex")||(this._weekdaysRegex=Ih),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},mm.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(Gp(this,"_weekdaysRegex")||$h.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(Gp(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Vh),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},mm.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(Gp(this,"_weekdaysRegex")||$h.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(Gp(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Hh),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},mm.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},mm.meridiem=function(e,t,a){return e>11?a?"pm":"PM":a?"am":"AM"},sb("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===eh(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),$p.lang=uv("moment.lang is deprecated. Use moment.locale instead.",sb),$p.langData=uv("moment.langData is deprecated. Use moment.localeData instead.",rb);var wm=Math.abs;function km(e,t,a,s){var l=Eb(t,a);return e._milliseconds+=s*l._milliseconds,e._days+=s*l._days,e._months+=s*l._months,e._bubble()}function Sm(e){return e<0?Math.floor(e):Math.ceil(e)}function Tm(e){return 4800*e/146097}function _m(e){return 146097*e/4800}function Mm(e){return function(){return this.as(e)}}var Cm=Mm("ms"),Dm=Mm("s"),Pm=Mm("m"),Um=Mm("h"),Lm=Mm("d"),jm=Mm("w"),zm=Mm("M"),Am=Mm("Q"),Om=Mm("y"),Nm=Cm;function Bm(e){return function(){return this.isValid()?this._data[e]:NaN}}var Fm=Bm("milliseconds"),Em=Bm("seconds"),Ym=Bm("minutes"),Im=Bm("hours"),Vm=Bm("days"),Hm=Bm("months"),Rm=Bm("years"),$m=Math.round,Wm={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function qm(e,t,a,s,l){return l.relativeTime(t||1,!!a,e,s)}var Gm=Math.abs;function Xm(e){return(e>0)-(e<0)||+e}function Zm(){if(!this.isValid())return this.localeData().invalidDate();var e,t,a,s,l,r,o,n,i=Gm(this._milliseconds)/1e3,d=Gm(this._days),c=Gm(this._months),u=this.asSeconds();return u?(e=Qv(i/60),t=Qv(e/60),i%=60,e%=60,a=Qv(c/12),c%=12,s=i?i.toFixed(3).replace(/\.?0+$/,""):"",l=u<0?"-":"",r=Xm(this._months)!==Xm(u)?"-":"",o=Xm(this._days)!==Xm(u)?"-":"",n=Xm(this._milliseconds)!==Xm(u)?"-":"",l+"P"+(a?r+a+"Y":"")+(c?r+c+"M":"")+(d?o+d+"D":"")+(t||e||i?"T":"")+(t?n+t+"H":"")+(e?n+e+"M":"")+(i?n+s+"S":"")):"P0D"}var Km=Db.prototype;Km.isValid=function(){return this._isValid},Km.abs=function(){var e=this._data;return this._milliseconds=wm(this._milliseconds),this._days=wm(this._days),this._months=wm(this._months),e.milliseconds=wm(e.milliseconds),e.seconds=wm(e.seconds),e.minutes=wm(e.minutes),e.hours=wm(e.hours),e.months=wm(e.months),e.years=wm(e.years),this},Km.add=function(e,t){return km(this,e,t,1)},Km.subtract=function(e,t){return km(this,e,t,-1)},Km.as=function(e){if(!this.isValid())return NaN;var t,a,s=this._milliseconds;if("month"===(e=Dv(e))||"quarter"===e||"year"===e)switch(t=this._days+s/864e5,a=this._months+Tm(t),e){case"month":return a;case"quarter":return a/3;case"year":return a/12}else switch(t=this._days+Math.round(_m(this._months)),e){case"week":return t/7+s/6048e5;case"day":return t+s/864e5;case"hour":return 24*t+s/36e5;case"minute":return 1440*t+s/6e4;case"second":return 86400*t+s/1e3;case"millisecond":return Math.floor(864e5*t)+s;default:throw new Error("Unknown unit "+e)}},Km.asMilliseconds=Cm,Km.asSeconds=Dm,Km.asMinutes=Pm,Km.asHours=Um,Km.asDays=Lm,Km.asWeeks=jm,Km.asMonths=zm,Km.asQuarters=Am,Km.asYears=Om,Km.valueOf=Nm,Km._bubble=function(){var e,t,a,s,l,r=this._milliseconds,o=this._days,n=this._months,i=this._data;return r>=0&&o>=0&&n>=0||r<=0&&o<=0&&n<=0||(r+=864e5*Sm(_m(n)+o),o=0,n=0),i.milliseconds=r%1e3,e=Qv(r/1e3),i.seconds=e%60,t=Qv(e/60),i.minutes=t%60,a=Qv(t/60),i.hours=a%24,o+=Qv(a/24),n+=l=Qv(Tm(o)),o-=Sm(_m(l)),s=Qv(n/12),n%=12,i.days=o,i.months=n,i.years=s,this},Km.clone=function(){return Eb(this)},Km.get=function(e){return e=Dv(e),this.isValid()?this[e+"s"]():NaN},Km.milliseconds=Fm,Km.seconds=Em,Km.minutes=Ym,Km.hours=Im,Km.days=Vm,Km.weeks=function(){return Qv(this.days()/7)},Km.months=Hm,Km.years=Rm,Km.humanize=function(e,t){if(!this.isValid())return this.localeData().invalidDate();var a,s,l=!1,r=Wm;return"object"==typeof e&&(t=e,e=!1),"boolean"==typeof e&&(l=e),"object"==typeof t&&(r=Object.assign({},Wm,t),null!=t.s&&null==t.ss&&(r.ss=t.s-1)),s=function(e,t,a,s){var l=Eb(e).abs(),r=$m(l.as("s")),o=$m(l.as("m")),n=$m(l.as("h")),i=$m(l.as("d")),d=$m(l.as("M")),c=$m(l.as("w")),u=$m(l.as("y")),f=r<=a.ss&&["s",r]||r<a.s&&["ss",r]||o<=1&&["m"]||o<a.m&&["mm",o]||n<=1&&["h"]||n<a.h&&["hh",n]||i<=1&&["d"]||i<a.d&&["dd",i];
1return null!=a.w&&(f=f||c<=1&&["w"]||c<a.w&&["ww",c]),(f=f||d<=1&&["M"]||d<a.M&&["MM",d]||u<=1&&["y"]||["yy",u])[2]=t,f[3]=+e>0,f[4]=s,qm.apply(null,f)}(this,!l,r,a=this.localeData()),l&&(s=a.pastFuture(+this,s)),a.postformat(s)},Km.toISOString=Zm,Km.toString=Zm,Km.toJSON=Zm,Km.locale=Gb,Km.localeData=Zb,Km.toIsoString=uv("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Zm),Km.lang=Xb,Sv("X",0,0,"unix"),Sv("x",0,0,"valueOf"),Zv("x",Rv),Zv("X",/[+-]?\d+(\.\d{1,3})?/),ah("X",function(e,t,a){a._d=new Date(1e3*parseFloat(e))}),ah("x",function(e,t,a){a._d=new Date(eh(e))}),$p.version="2.30.1",Hp=Sb,$p.fn=hm,$p.min=function(){return Mb("isBefore",[].slice.call(arguments,0))},$p.max=function(){return Mb("isAfter",[].slice.call(arguments,0))},$p.now=function(){return Date.now?Date.now():+new Date},$p.utc=tv,$p.unix=function(e){return Sb(1e3*e)},$p.months=function(e,t){return gm(e,t,"months")},$p.isDate=Jp,$p.locale=sb,$p.invalid=lv,$p.duration=Eb,$p.isMoment=dv,$p.weekdays=function(e,t,a){return ym(e,t,a,"weekdays")},$p.parseZone=function(){return Sb.apply(null,arguments).parseZone()},$p.localeData=rb,$p.isDuration=Pb,$p.monthsShort=function(e,t){return gm(e,t,"monthsShort")},$p.weekdaysMin=function(e,t,a){return ym(e,t,a,"weekdaysMin")},$p.defineLocale=lb,$p.updateLocale=function(e,t){if(null!=t){var a,s,l=Kh;null!=Jh[e]&&null!=Jh[e].parentLocale?Jh[e].set(bv(Jh[e]._config,t)):(null!=(s=ab(e))&&(l=s._config),t=bv(l,t),null==s&&(t.abbr=e),(a=new mv(t)).parentLocale=Jh[e],Jh[e]=a),sb(e)}else null!=Jh[e]&&(null!=Jh[e].parentLocale?(Jh[e]=Jh[e].parentLocale,e===sb()&&sb(e)):null!=Jh[e]&&delete Jh[e]);return Jh[e]},$p.locales=function(){return fv(Jh)},$p.weekdaysShort=function(e,t,a){return ym(e,t,a,"weekdaysShort")},$p.normalizeUnits=Dv,$p.relativeTimeRounding=function(e){return void 0===e?$m:"function"==typeof e&&($m=e,!0)},$p.relativeTimeThreshold=function(e,t){return void 0!==Wm[e]&&(void 0===t?Wm[e]:(Wm[e]=t,"s"===e&&(Wm.ss=t-1),!0))},$p.calendarFormat=function(e,t){var a=e.diff(t,"days",!0);return a<-6?"sameElse":a<-1?"lastWeek":a<0?"lastDay":a<1?"sameDay":a<2?"nextDay":a<7?"nextWeek":"sameElse"},$p.prototype=hm,$p.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};const Jm={class:"w-full h-full min-h-0 bg-[#46035c] relative"},Qm={key:1,class:"w-full h-full min-h-0 flex items-center justify-center text-white/40 text-sm"},ex={key:2,class:"absolute bottom-4 left-4 flex flex-col gap-2 z-10"},tx="#00F6A9",ax="#FF4D4F",sx=e({__name:"HeatMapComponent",props:{candlesticks:{default:()=>[]},liquidationLeverage:{default:()=>[]},isExpanded:{type:Boolean,default:!1},candlestickInteractivity:{type:Boolean,default:!1},activeDuration:{default:"12h"},y_axis:{default:()=>[]},isMobile:{type:Boolean,default:!1},compact:{type:Boolean,default:!1}},setup(e,{expose:s}){const l=e,r=u(null);Ye([Ie,Ve,He,Re,$e,We,qe,Ge]);const n=c(()=>l.y_axis.length>0&&l.candlesticks.length>0&&l.liquidationLeverage.length>0);function i(){var e;return(null==(e=r.value)?void 0:e.chart)??null}function f(){var e,t,a,s;const l=i();if(!l)return;const r=l.getOption(),o=(null==(t=null==(e=r.dataZoom)?void 0:e[0])?void 0:t.start)??0,n=(null==(s=null==(a=r.dataZoom)?void 0:a[0])?void 0:s.end)??100,d=n-o,c=Math.max(d-10,10),u=(o+n)/2;l.dispatchAction({type:"dataZoom",start:Math.max(u-c/2,0),end:Math.min(u+c/2,100)})}function p(){var e,t,a,s;const l=i();if(!l)return;const r=l.getOption(),o=(null==(t=null==(e=r.dataZoom)?void 0:e[0])?void 0:t.start)??0,n=(null==(s=null==(a=r.dataZoom)?void 0:a[0])?void 0:s.end)??100,d=n-o,c=Math.min(d+10,100),u=(o+n)/2;l.dispatchAction({type:"dataZoom",start:Math.max(u-c/2,0),end:Math.min(u+c/2,100)})}function v(){var e;null==(e=i())||e.dispatchAction({type:"dataZoom",start:0,end:100})}function b(e,t){if(!t.length)return 0;let a=0,s=Math.abs(t[0]-e);for(let l=1;l<t.length;l++){const r=Math.abs(t[l]-e);r<s&&(s=r,a=l)}return a}function m(e){return["12h","24h"].includes(l.activeDuration)?$p(1e3*e).format("HH:mm"):$p(1e3*e).format("DD-MM-YY HH:mm")}const g=c(()=>{const e=l.y_axis??[],t=l.candlesticks??[],a=t.map(e=>Number(e[0])),s=(o=l.liquidationLeverage??[],n=e.length,o.map(e=>function(e,t){const[a,s,l]=e;if(!Number.isFinite(a)||!Number.isFinite(s)||!Number.isFinite(l)||l<=0)return null;const r=Math.round(a);let o=Math.round(s);return o>=t&&(o=t-1),o<0&&(o=0),[r,o,l]}(e,n)).filter(e=>null!==e)),r=Math.max(...s.map(e=>e[2]),10);var o,n;return{backgroundColor:"#46035c",grid:{top:4,left:4,right:l.isMobile?36:80,bottom:l.isMobile?28:18},tooltip:{trigger:"item",confine:!1,appendToBody:!0,backgroundColor:"rgba(0,0,0,0.8)",borderColor:"#666",borderWidth:1,borderRadius:4,textStyle:{color:"#cbcbcb",fontSize:12},extraCssText:"z-index: 99999; pointer-events: none;",formatter:s=>{const l=Array.isArray(s)?s[0]:s;if(!l)return"";if("Liquidation Volume"===l.seriesName){const t=l.data[0],s=l.data[1],r=l.data[2],o=a[t],n=e[s];return`\n        <div style="padding: 8px; background: rgba(0,0,0,0.8); border: 1px solid #666; border-radius: 4px;">\n          <div style="color: white; font-weight: bold; margin-bottom: 4px;">
1Liquidation Volume</div>\n          <div style="color: #cbcbcb;">Time: ${m(o)}</div>\n          <div style="color: #cbcbcb;">Price: $${Number(n).toLocaleString()}</div>\n          <div style="color: #fde725;">Volume: ${Number(r).toLocaleString()}</div>\n        </div>\n      `}if("Price"===l.seriesName){const e=t[l.dataIndex];if(!e)return"";const a=parseFloat(String(e[1])),s=parseFloat(String(e[2])),r=parseFloat(String(e[3])),o=parseFloat(String(e[4])),n=o>=a,i=n?tx:ax;return`\n        <div style="padding: 8px; background: rgba(0,0,0,0.8); border: 1px solid #666; border-radius: 4px;">\n          <div style="color: white; font-weight: bold; margin-bottom: 4px;">Price Data</div>\n          <div style="color: #cbcbcb;">Time: ${m(Number(e[0]))}</div>\n          <div style="color: #cbcbcb;">Open: $${a.toLocaleString()}</div>\n          <div style="color: #cbcbcb;">High: $${s.toLocaleString()}</div>\n          <div style="color: #cbcbcb;">Low: $${r.toLocaleString()}</div>\n          <div style="color: ${i};">Close: $${o.toLocaleString()}</div>\n          <div style="color: ${i};">Change: ${n?"+":""}${((o-a)/a*100).toFixed(2)}%</div>\n        </div>\n      `}return""}},xAxis:[{show:!0,type:"category",data:a.map(e=>m(e)),boundaryGap:!0,splitLine:{show:!1},axisTick:{show:!1},axisLabel:{color:"#8b949e",fontSize:10,hideOverlap:!0,interval:"auto"},axisLine:{lineStyle:{color:"#2b2b2f"}}}],yAxis:[{type:"category",show:!0,position:"right",data:e,splitArea:{show:!1},splitLine:{show:!1},axisTick:{show:!1},axisLabel:{color:"#8b949e",fontSize:11,formatter:e=>function(e){const t=Math.abs(e);let a=0;return t<1?a=4:t<10?a=3:t<100?a=2:t<1e3&&(a=1),Number(e).toLocaleString("en-US",{minimumFractionDigits:a,maximumFractionDigits:a})}(Number(e))},axisLine:{lineStyle:{color:"#2b2b2f"}}}],visualMap:{show:!1,min:0,max:r,seriesIndex:0,dimension:2,inRange:{color:["#440154","#3b528b","#21918c","#5ec962","#fde725"]}},dataZoom:[{type:"inside",start:0,end:100,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1},...l.isMobile?[{type:"slider",show:!0,xAxisIndex:0,start:0,end:100,bottom:0,height:15,handleSize:"80%",handleStyle:{color:"#5ec962",borderColor:"#5ec962"},textStyle:{color:"#8b949e",fontSize:10},borderColor:"#2b2b2f",fillerColor:"rgba(94, 201, 98, 0.2)",backgroundColor:"rgba(43, 43, 47, 0.5)",showDetail:!1,zoomLock:!1,brushSelect:!1}]:[]],series:[{name:"Liquidation Volume",type:"heatmap",data:s,large:!0,progressive:2e3,itemStyle:{borderWidth:0},emphasis:{itemStyle:{borderColor:"rgba(255,255,255,0.35)",borderWidth:1}},z:2},{name:"Price",type:"custom",data:t.map((e,t)=>t),renderItem:(a,s)=>{var l;const r=t[a.dataIndex];if(!r||!e.length)return;const o=parseFloat(String(r[1])),n=parseFloat(String(r[2])),i=parseFloat(String(r[3])),d=parseFloat(String(r[4])),c=s.coord([a.dataIndex,b(d,e)])[0],u=(null==(l=s.size)?void 0:l.call(s,[1,0]))??[4,4],f=Math.max(.55*(Array.isArray(u)?u[0]:4),2),p=c-f/2,v=s.coord([a.dataIndex,b(n,e)])[1],h=s.coord([a.dataIndex,b(i,e)])[1],m=s.coord([a.dataIndex,b(o,e)])[1],x=s.coord([a.dataIndex,b(d,e)])[1],g=Math.min(v,h),y=Math.max(v,h),w=Math.min(m,x),k=Math.max(m,x),S=d>=o,T=S?tx:ax,_=S?"#00C08A":"#D7393B",M=Math.max(.12*f,1),C=Math.max(k-w,1.5);return{type:"group",children:[{type:"rect",shape:{x:c-M/2,y:g,width:M,height:Math.max(y-g,1)},style:{fill:T}},{type:"rect",shape:{x:p,y:w,width:f,height:C},style:{fill:T,stroke:_,lineWidth:1}}]}},clip:!0,z:10}]}});return h(()=>{r.value=null}),s({zoomIn:f,zoomOut:p,resetZoom:v}),(e,s)=>(d(),t("div",Jm,[n.value?(d(),x(y(tt),{key:0,ref_key:"chartRef",ref:r,class:"w-full h-full min-h-0",option:g.value,autoresize:!0,"update-options":{lazyUpdate:!0}},null,8,["option"])):(d(),t("div",Qm," No heatmap data ")),e.isMobile&&n.value?(d(),t("div",ex,[a("button",{onClick:f,class:"w-10 h-10 bg-slate-700/90 hover:bg-slate-600 rounded-lg flex items-center justify-center transition-colors shadow-lg border border-slate-600",title:"Zoom In"},s[0]||(s[0]=[a("svg",{class:"w-5 h-5 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m8-8H4"})],-1)])),a("button",{onClick:p,class:"w-10 h-10 bg-slate-700/90 hover:bg-slate-600 rounded-lg flex items-center justify-center transition-colors shadow-lg border border-slate-600",title:"Zoom Out"}
1,s[1]||(s[1]=[a("svg",{class:"w-5 h-5 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 12H4"})],-1)])),a("button",{onClick:v,class:"w-10 h-10 bg-slate-700/90 hover:bg-slate-600 rounded-lg flex items-center justify-center transition-colors shadow-lg border border-slate-600",title:"Reset Zoom"},s[2]||(s[2]=[a("svg",{class:"w-5 h-5 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4"})],-1)]))])):o("",!0)]))}}),lx={class:"w-full flex flex-col gap-4"},rx={class:"flex justify-end gap-2 pr-4"},ox={class:"relative"},nx={key:0,class:"absolute right-0 mt-2 w-20 bg-slate-700 border border-slate-600 rounded-lg shadow-lg z-50"},ix=["onClick"],dx={key:0,class:"flex items-center justify-center py-12"},cx={key:1,class:"w-full flex flex-col gap-3"},ux={class:"w-full h-[400px] bg-slate-800 rounded-lg border border-slate-700 overflow-hidden"},fx={class:"w-full flex items-center gap-3 px-2"},px={class:"text-xs text-slate-400 whitespace-nowrap"},vx={class:"w-full mt-4"},hx={class:"bg-gradient-to-br from-[#0f172a] to-[#131328] p-4 rounded-b-xl border-x border-b border-[#ff9500]/20 space-y-3"},bx={key:0,class:"relative"},mx={class:"p-[1px] rounded-lg bg-gradient-to-r from-[#eb5c57]/40 to-[#eb5c57]/20"},xx={class:"bg-[#0a1628] rounded-lg px-4 py-3"},gx={class:"flex items-center justify-between mb-2"},yx={class:"flex items-center gap-2"},wx={class:"flex items-baseline gap-2 mb-1"},kx={class:"text-xl font-bold text-[#eb5c57]"},Sx={class:"text-xs text-white/50"},Tx={class:"flex items-center justify-between"},_x={class:"flex items-center gap-2"},Mx={class:"text-sm font-bold text-[#eb5c57]"},Cx={class:"flex items-center gap-1"},Dx={key:1,class:"relative"},Px={class:"p-[1px] rounded-lg bg-gradient-to-r from-[#5ec485]/40 to-[#5ec485]/20"},Ux={class:"bg-[#0a1628] rounded-lg px-4 py-3"},Lx={class:"flex items-center justify-between mb-2"},jx={class:"flex items-center gap-2"},zx={class:"flex items-baseline gap-2 mb-1"},Ax={class:"text-xl font-bold text-[#5ec485]"},Ox={class:"text-xs text-white/50"},Nx={class:"flex items-center justify-between"},Bx={class:"flex items-center gap-2"},Fx={class:"text-sm font-bold text-[#5ec485]"},Ex={class:"flex items-center gap-1"},Yx=3e5,Ix=e({__name:"MobileLiquidationHeatmap",setup(e){const r=I(),p=G(),x=me(),w=u(!0),k=u([]),S=u([]),T=u(0),_=u([]),M=u(!1),C=u(re),D=[...oe];let P,U;const L=c(()=>{if(!k.value||0===k.value.length)return 0;const e=k.value[k.value.length-1];return e?parseFloat(e[4]):0}),j=c(()=>{if(!S.value||0===S.value.length||!_.value||0===_.value.length)return null;const e=L.value;if(!e)return null;const t=new Map;for(const[l,r,o]of S.value){const a=_.value[r];if(a&&a>e){const e=t.get(a)||0;t.set(a,e+o)}}let a=0,s=0;for(const[l,r]of t.entries())r>a&&(a=r,s=l);return s?{price:s,size:a,distance:(s-e)/e*100}:null}),z=c(()=>
1{if(!S.value||0===S.value.length||!_.value||0===_.value.length)return null;const e=L.value;if(!e)return null;const t=new Map;for(const[l,r,o]of S.value){const a=_.value[r];if(a&&a<e){const e=t.get(a)||0;t.set(a,e+o)}}let a=0,s=0;for(const[l,r]of t.entries())r>a&&(a=r,s=l);return s?{price:s,size:a,distance:(e-s)/e*100}:null}),A=c(()=>S.value&&0!==S.value.length?S.value.reduce((e,[,,t])=>e+t,0):0),N=c(()=>{var e;const t=(null==(e=r.token)?void 0:e.label)||"";return t?`${t.toUpperCase()}USDT`:""}),B=c(()=>(x.ensureStarted(),x.get(N.value))),F=c(()=>{const e=B.value;if(!e||!e.quote)return 5;const t=e.quote;return t>=1e10?10:t>=5e9?9:t>=2e9?8:t>=1e9?7:t>=5e8?6:t>=2e8?5:t>=1e8?4:3}),E=c(()=>{const e=B.value;if(!e||!e.updatedAt)return 3;const t=(Date.now()-e.updatedAt)/6e4;return t<=1?5:t<=2?4:t<=5?3:t<=10?2:1}),Y=c(()=>{var e;const t=j.value;if(!t||0===A.value)return 0;const a=t.size/A.value,s=Math.min(100*a,35),l=Math.abs(t.distance);let r=0;r=l<=1?30:l<=2?26:l<=3?22:l<=5?18:l<=10?14:Math.max(10-.5*(l-10),0);const o=(null==(e=z.value)?void 0:e.size)||0;let n=0;if(0===o)n=20;else{const e=t.size/o;n=e>=2?20:e>=1.5?16:e>=1.2?12:e>=.8?8:4}const i=s+r+n+F.value+E.value;return Math.min(Math.max(Math.round(i),0),100)}),V=c(()=>{var e;const t=z.value;if(!t||0===A.value)return 0;const a=t.size/A.value,s=Math.min(100*a,35),l=Math.abs(t.distance);let r=0;r=l<=1?30:l<=2?26:l<=3?22:l<=5?18:l<=10?14:Math.max(10-.5*(l-10),0);const o=(null==(e=j.value)?void 0:e.size)||0;let n=0;if(0===o)n=20;else{const e=t.size/o;n=e>=2?20:e>=1.5?16:e>=1.2?12:e>=.8?8:4}const i=s+r+n+F.value+E.value;return Math.min(Math.max(Math.round(i),0),100)});function H(e){return e>=70?"HIGH":e>=50?"MEDIUM":e>=30?"LOW":"VERY LOW"}function R(e){return e>=70?"#5ec485":e>=50?"#00ffff":e>=30?"#ff9500":"#eb5c57"}function $(e){return e>=1e3?e.toFixed(0).replace(/\B(?=(\d{3})+(?!\d))/g,","):e>=1?e.toFixed(2):e.toFixed(4)}function W(e){return`${e>0?"+":""}${e.toFixed(2)}%`}async function q(){var e;w.value=!0;try{const{data:t}=await ne({symbol:r.token.label,range:C.value,exchange:"Binance"});k.value=t.price_candlesticks,S.value=t.liquidation_leverage_data,T.value=function(e){let t=0;for(let a of e)a[2]>t&&(t=a[2]);return t}(t.liquidation_leverage_data),_.value=t.y_axis;try{p.setFromResponse(t,null==(e=r.token)?void 0:e.label)}catch{}}catch(t){console.error("Failed to fetch heatmap:",t)}finally{w.value=!1}}return f(()=>{try{p.ensureStarted(re,"Binance")}catch{}q(),(()=>{U&&(window.clearTimeout(U),U=void 0),P&&(window.clearInterval(P),P=void 0);const e=function(){const e=Date.now();return Yx-e%Yx}();U=window.setTimeout(()=>{q(),P=window.setInterval(q,Yx)},e)})()}),h(()=>{U&&window.clearTimeout(U),P&&window.clearInterval(P)}),b(O(r).token,q),(e,r)=>(d(),t("div",lx,[a("div",rx,[a("button",{onClick:q,class:"p-2 bg-slate-700 hover:bg-slate-600 rounded transition-colors"},r[1]||(r[1]=[a("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})],-1)])),a("div",ox,[a("button",{onClick:r[0]||(r[0]=e=>M.value=!M.value),class:"px-3 py-2 bg-slate-700 hover:bg-slate-600 rounded text-sm font-semibold flex items-center gap-2 transition-colors min-w-[70px]"},[v(i(C.value)+" ",1),r[2]||(r[2]=a("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"})],-1))]),M.value?(d(),t("div",nx,[(d(),t(s,null,l(D,e=>a("button",{key:e,onClick:t=>function(e){C.value=e,M.value=!1,q()}(e),class:"w-full px-3 py-2 text-left text-sm hover:bg-slate-600 transition-colors first:rounded-t-lg last:rounded-b-lg"},i(e),9,ix)),64))])):o("",!0)]),r[3]||(r[3]=a("span",{class:"px-3 py-2 bg-slate-800 border border-amber-500/40 rounded text-sm font-semibold text-amber-400",title:"Coinglass liquidation heatmap (Binance)"}," BIN ",-1))]),w.value?(d(),t("div",dx,r[4]||(r[4]=[a("div",{class:"text-center text-slate-400"},[a("div",{class:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-400 mx-auto mb-2"}),a("p",{class:"text-sm"},"Loading heatmap...")],-1)]))):(d(),t("div",cx,[a("div",ux,[m(sx,{y_axis:_.value,"active-duration":C.value,candlesticks:k.value,"liquidation-leverage":S.value,compact:!0,"is-mobile":!0},null,8,["y_axis","active-duration","candlesticks","liquidation-leverage"])]),a("div",fx,[r[5]||(r[5]=a("span",{class:"text-xs text-slate-400 whitespace-nowrap"},"0",-1)),r[6]||(r[6]=a("div",{class:"flex-1 h-6 rounded-md bg-gradient-to-r from-purple-800 via-blue-500 via-teal-500 via-green-400 to-yellow-400"},null,-1)),a("span",px,i(y(pe)(T.value)),1)]),a("div",vx,[r[16]||(r[16]=n('<div class="p-[1px] bg-gradient-to-r from-[#eb5c57]/30 via-[#ff9500]/30 to-[#eb5c57]/30 rounded-t-xl"><div class="bg-gradient-to-br from-[#131328] to-[#1e273f] px-4 py-3 rounded-t-xl"><div class="flex items-center gap-2"><svg class="w-5 h-5 text-[#ff9500]" fill="none" stroke="currentColor" viewBox="0 0 24 24">
1<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"></path></svg><h3 class="text-base font-bold text-white">Market Maker Targets</h3></div><p class="text-xs text-white/60 mt-1">Where the thieves are going next 🎯</p></div></div>',1)),a("div",hx,[j.value?(d(),t("div",bx,[a("div",mx,[a("div",xx,[a("div",gx,[r[8]||(r[8]=a("div",{class:"flex items-center gap-2"},[a("svg",{class:"w-4 h-4 text-[#eb5c57]",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 7h8m0 0v8m0-8l-8 8-4-4-6 6"})]),a("span",{class:"text-xs text-white/70 font-medium"},"LONG LIQUIDATION WALL")],-1)),a("div",yx,[r[7]||(r[7]=a("span",{class:"text-xs px-2 py-1 rounded bg-[#eb5c57]/20 text-[#eb5c57] font-bold"},"ABOVE",-1)),a("span",{class:"text-xs px-2 py-1 rounded font-bold",style:g({backgroundColor:`${R(Y.value)}20`,color:R(Y.value)})},i(Y.value)+"% ",5)])]),a("div",wx,[a("span",kx,"$"+i($(j.value.price)),1),a("span",Sx,i(W(j.value.distance)),1)]),a("div",Tx,[a("div",_x,[r[9]||(r[9]=a("span",{class:"text-xs text-white/60"},"Liquidity:",-1)),a("span",Mx,i(y(pe)(j.value.size)),1)]),a("div",Cx,[r[10]||(r[10]=a("span",{class:"text-xs text-white/50"},"Confidence:",-1)),a("span",{class:"text-xs font-bold",style:g({color:R(Y.value)})},i(H(Y.value)),5)])])])])])):o("",!0),z.value?(d(),t("div",Dx,[a("div",Px,[a("div",Ux,[a("div",Lx,[r[12]||(r[12]=a("div",{class:"flex items-center gap-2"},[a("svg",{class:"w-4 h-4 text-[#5ec485] rotate-180",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 7h8m0 0v8m0-8l-8 8-4-4-6 6"})]),a("span",{class:"text-xs text-white/70 font-medium"},"SHORT LIQUIDATION WALL")],-1)),a("div",jx,[r[11]||(r[11]=a("span",{class:"text-xs px-2 py-1 rounded bg-[#5ec485]/20 text-[#5ec485] font-bold"},"BELOW",-1)),a("span",{class:"text-xs px-2 py-1 rounded font-bold",style:g({backgroundColor:`${R(V.value)}20`,color:R(V.value)})},i(V.value)+"% ",5)])]),a("div",zx,[a("span",Ax,"$"+i($(z.value.price)),1),a("span",Ox,i(W(z.value.distance)),1)]),a("div",Nx,[a("div",Bx,[r[13]||(r[13]=a("span",{class:"text-xs text-white/60"},"Liquidity:",-1)),a("span",Fx,i(y(pe)(z.value.size)),1)]),a("div",Ex,[r[14]||(r[14]=a("span",{class:"text-xs text-white/50"},"Confidence:",-1)),a("span",{class:"text-xs font-bold",style:g({color:R(V.value)})},i(H(V.value)),5)])])])])])):o("",!0),r[15]||(r[15]=a("div",{class:"pt-2 border-t border-white/10"},[a("p",{class:"text-xs text-white/50 leading-relaxed"},[v(" 💡 "),a("span",{class:"text-white/70 font-medium"},"Probability Algorithm:"),v(" Based on liquidation size (35%), distance from current price (30%), relative strength (20%), 24h volume momentum (10%), and data freshness (5%). Market makers actively hunt these clusters to trigger cascading liquidations. ")])],-1))])])]))]))}}),Vx={class:"w-full bg-gradient-to-br from-[#131328] to-[#1e273f] border border-[#00ffff]/20 rounded-lg p-4"},Hx={class:"flex items-center justify-between mb-2"},Rx={class:"flex items-center gap-2"},$x={class:"text-xs text-[#00ffff]/60"},Wx={class:"flex items-center gap-2"},qx={key:0,class:"flex items-center gap-1 px-2 py-1 bg-orange-500/20 border border-orange-500/40 rounded text-xs font-bold text-orange-400"},Gx={class:"text-right"},Xx={class:"text-sm font-bold text-[#00ffff]"},Zx={key:0,class:"mb-3 p-3 bg-[#0a1628] border border-[#00ffff]/30 rounded-lg text-xs text-white/80 space-y-2"},Kx={class:"flex items-center justify-between"},Jx={class:"flex gap-1 mb-4 overflow-x-auto scrollbar-hide"},Qx=["onClick"],eg={key:0,class:"absolute inset-0 flex items-center justify-center"},tg={key:1,class:"h-full flex items-center justify-center"},ag={key:2,class:"h-full w-full flex"},sg={class:"w-8 flex flex-col justify-between text-[10px] text-slate-500 pr-1"},lg=["onClick"],rg={key:0,class:"absolute bottom-full mb-2 left-1/2 -translate-x-1/2 bg-[#090f1d] border border-[#00ffff]/40 rounded px-2 py-1 text-xs whitespace-nowrap z-10 shadow-lg"},og={class:"text-[#00ffff] font-bold"},ng={class:"text-slate-400"},ig={key:1,class:"text-[9px] text-slate-500 mt-1 truncate w-full text-center absolute top-full"},dg={class:"grid grid-cols-3 gap-2 mt-4"},cg={class:"bg-[#090f1d]/50 rounded p-2 border border-[#00ffff]/10"},ug={class:"text-xs font-bold text-white"},fg={class:"bg-[#090f1d]/50 rounded p-2 border border-[#00ffff]/10"},pg={class:"text-xs font-bold text-[#5ec485]"},vg={class:"bg-[#090f1d]/50 rounded p-2 border border-[#00ffff]/10"},hg=F(e({__name:"MobileVolumeChart",setup(e){const p=I(),v=me();v.ensureStarted();const m=u("1h"),x=u(null),y=u(!1),w=u([]),k=u(!1),S=[{label:"1m",value:"1m",interval:1,bars:30},{label:"5m",value:"5m",interval:5,bars:24},{label:"1h",value:"1h",interval:60,bars:24},{label:"4h",value:"4h",interval:240,bars:12},{label:"8h",value:"8h",interval:480,bars:12},{label:"12h",value:"12h",interval:720,bars:14},{label:"24h",value:"24h",interval:1440,bars:14}],T=c(()=>{var e;return(null==(e=p.token)?void 0:e.label)||"BTC"}),_=c(()=>`${T.value}USDT`),M=c(()=>{const e=v.get(_.value);return(null==e?void 0:e.quote)||0});let C;const P=async()=>{var e,t,a;try{y.value=!0;const s=S.find(e=>e.value===m.value),l=(null==s?void 0:s.interval)||5,r=(null==s?void 0:s.bars)||24,o=e=>e>=1440?"D":e>=720?"720":e>=480?"480":e>=240?"240":e>=60?"60":e>=30?"30":e>=15?"15":e>=5?"5":"1",n=(a=l)>=1440?"1d":a>=720?"12h":a>=480?"8h":a>=240?"4h":a>=60?"1h":a>=30?"30m":a>=15?"15m":a>=5?"5m":"1m",i=o(l),[d,c]=await Promise.all([(async()=>
1{try{const e=await fetch(`https://api.binance.com/api/v3/klines?symbol=${_.value}&interval=${n}&limit=${r}`,{signal:AbortSignal.timeout(5e3)});if(e.ok)return await e.json();throw new Error("Binance.com failed")}catch(e){console.warn("[VolumeChart] Binance.com failed, trying Binance.US...",e);try{const e=await fetch(`https://api.binance.us/api/v3/klines?symbol=${_.value}&interval=${n}&limit=${r}`,{signal:AbortSignal.timeout(5e3)});if(e.ok)return await e.json()}catch{}return[]}})(),fetch(`https://api.bybit.com/v5/market/kline?category=spot&symbol=${_.value}&interval=${i}&limit=${r}`).then(e=>e.json()).catch(()=>({result:{list:[]}}))]),u=new Map;Array.isArray(d)&&d.length>0&&d.forEach(e=>{const t=e[0],a=parseFloat(e[7]||"0");u.set(t,(u.get(t)||0)+a)}),(null==(t=null==(e=null==c?void 0:c.result)?void 0:e.list)?void 0:t.length)>0&&c.result.list.forEach(e=>{const t=parseInt(e[0]),a=parseFloat(e[6]||"0");u.set(t,(u.get(t)||0)+a)}),w.value=Array.from(u.entries()).map(([e,t])=>({timestamp:e,volume:t})).sort((e,t)=>e.timestamp-t.timestamp)}catch(s){console.error("Error fetching volume data:",s)}finally{y.value=!1}};f(()=>{P(),C=window.setInterval(P,3e4)}),h(()=>{C&&window.clearInterval(C)}),b([_,m],()=>{w.value=[],P()});const U=(e,t)=>t?e.toLocaleDateString("en-US",{month:"short",day:"numeric"})+" "+e.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit"}):e.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),L=(e,t)=>t>=240?e.toLocaleDateString("en-US",{month:"short",day:"numeric"}):t>=60?e.toLocaleDateString("en-US",{month:"short",day:"numeric"})+" "+e.toLocaleTimeString("en-US",{hour:"numeric"}):e.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit"}),j=c(()=>{if(0===w.value.length)return[];const e=S.find(e=>e.value===m.value),t=(null==e?void 0:e.interval)||60,a=t>=60,s=w.value.map(e=>{const s=new Date(e.timestamp);return{volume:e.volume,time:U(s,a),timeLabel:L(s,t),heightPercent:0,color:"#00ffff"}}),l=Math.max(...s.map(e=>e.volume),1),r=s.reduce((e,t)=>e+t.volume,0)/s.length;return s.map(e=>({...e,heightPercent:Math.max(e.volume/l*100,5),color:e.volume>1.5*r?"linear-gradient(to top, #f59e0b, #fbbf24)":e.volume>r?"linear-gradient(to top, #00ffff, #06b6d4)":"linear-gradient(to top, #475569, #64748b)"}))}),z=c(()=>Math.max(...j.value.map(e=>e.volume),1)),A=c(()=>0===j.value.length?0:j.value.reduce((e,t)=>e+t.volume,0)/j.value.length),O=c(()=>{var e;return 0===A.value||0===j.value.length?1:((null==(e=j.value[j.value.length-1])?void 0:e.volume)||0)/A.value}),N=c(()=>{if(j.value.length<4)return 0;const e=Math.floor(j.value.length/2),t=j.value.slice(0,e),a=j.value.slice(e),s=t.reduce((e,t)=>e+t.volume,0)/t.length,l=a.reduce((e,t)=>e+t.volume,0)/a.length;return 0===s?0:(l-s)/s*100});function B(e){return e>=1e9?`$${(e/1e9).toFixed(2)}B`:e>=1e6?`$${(e/1e6).toFixed(1)}M`:e>=1e3?`$${(e/1e3).toFixed(1)}K`:`$${Math.round(e)}`}return(e,c)=>(d(),t("div",Vx,[a("div",Hx,[a("div",Rx,[a("div",null,[c[4]||(c[4]=a("h3",{class:"text-sm font-bold text-white"},"Volume Analysis",-1)),a("p",$x,i(T.value)+" • Real-time",1)]),a("button",{onClick:c[0]||(c[0]=e=>k.value=!k.value),class:"p-1.5 rounded-lg bg-[#00ffff]/10 hover:bg-[#00ffff]/20 border border-[#00ffff]/30 transition-colors",title:"How to use Volume Analysis"},c[5]||(c[5]=[a("svg",{class:"w-4 h-4 text-[#00ffff]",fill:"currentColor",viewBox:"0 0 24 24"},[a("path",{d:"M11 17h2v-6h-2v6zm1-15C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zM11 9h2V7h-2v2z"})],-1)]))]),a("div",Wx,[O.value>1.5?(d(),t("div",qx," 🔥 "+i(O.value.toFixed(1))+"x ",1)):o("",!0),a("div",Gx,[c[6]||(c[6]=a("p",{class:"text-xs text-slate-400"},"24h Volume",-1)),a("p",Xx,i(B(M.value)),1)])])]),k.value?(d(),t("div",Zx,[a("div",Kx,[c[7]||(c[7]=a("span",{class:"font-bold text-[#00ffff]"},"How to Use Volume Analysis",-1)),a("button",{onClick:c[1]||(c[1]=e=>k.value=!1),class:"text-white/50 hover:text-white"},"✕")]),c[8]||(c[8]=n('<ul class="space-y-1.5 text-white/70" data-v-91541bec><li data-v-91541bec>• <span class="text-orange-400 font-medium" data-v-91541bec>Orange bars</span> = Volume spike (1.5x+ above average) - potential breakout</li><li data-v-91541bec>• <span class="text-[#00ffff] font-medium" data-v-91541bec>Cyan bars</span> = Above average volume - increased interest</li><li data-v-91541bec>• <span class="text-slate-400 font-medium" data-v-91541bec>Gray bars</span> = Below average volume - quiet period</li><li data-v-91541bec>• Select timeframe to see volume distribution over that period</li><li data-v-91541bec>• Use with price action: high volume + breakout = stronger move</li></ul>',1))])):o("",!0),c[15]||(c[15]=a("div",{class:"mb-3 flex items-center gap-1 text-xs text-slate-500"}
1,[a("svg",{class:"w-3 h-3",fill:"currentColor",viewBox:"0 0 20 20"},[a("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z","clip-rule":"evenodd"})]),a("span",null,"Binance + Bybit combined • Real volume, no fake-outs")],-1)),a("div",Jx,[(d(),t(s,null,l(S,e=>a("button",{key:e.value,onClick:t=>m.value=e.value,class:r(["px-2 py-1 text-xs font-medium whitespace-nowrap transition-colors rounded",m.value===e.value?"bg-[#00ffff] text-[#090f1d]":"bg-[#1e273f] text-slate-400 hover:text-white"])},i(e.label),11,Qx)),64))]),a("div",{class:"relative h-48 bg-[#090f1d]/50 rounded border border-[#00ffff]/10 p-2",onClick:c[3]||(c[3]=D(e=>x.value=null,["self"]))},[y.value?(d(),t("div",eg,c[9]||(c[9]=[a("div",{class:"text-center"},[a("div",{class:"animate-spin rounded-full h-8 w-8 border-b-2 border-[#00ffff] mx-auto mb-2"}),a("p",{class:"text-xs text-slate-400"},"Loading volume data...")],-1)]))):0===j.value.length?(d(),t("div",tg,c[10]||(c[10]=[a("p",{class:"text-xs text-slate-400"},"No volume data available",-1)]))):(d(),t("div",ag,[a("div",sg,[a("span",null,i(B(z.value)),1),a("span",null,i(B(z.value/2)),1),c[11]||(c[11]=a("span",null,"0",-1))]),a("div",{class:"flex-1 flex items-end justify-between gap-0.5",onClick:c[2]||(c[2]=D(e=>x.value=null,["self"]))},[(d(!0),t(s,null,l(j.value,(e,s)=>(d(),t("div",{key:s,class:"flex-1 flex flex-col items-center justify-end relative min-w-[2px] h-full"},[a("div",{class:"w-full rounded-t transition-all duration-300 cursor-pointer",style:g({height:`${e.heightPercent}%`,background:e.color,minHeight:"4px"}),onClick:e=>x.value=s},null,12,lg),x.value===s?(d(),t("div",rg,[a("p",og,i(B(e.volume)),1),a("p",ng,i(e.time),1)])):o("",!0),s%Math.ceil(j.value.length/4)===0?(d(),t("p",ig,i(e.timeLabel),1)):o("",!0)]))),128))])]))]),a("div",dg,[a("div",cg,[c[12]||(c[12]=a("p",{class:"text-[9px] text-slate-400 mb-1"},"Avg Volume",-1)),a("p",ug,i(B(A.value)),1)]),a("div",fg,[c[13]||(c[13]=a("p",{class:"text-[9px] text-slate-400 mb-1"},"Peak Volume",-1)),a("p",pg,i(B(z.value)),1)]),a("div",vg,[c[14]||(c[14]=a("p",{class:"text-[9px] text-slate-400 mb-1"},"Trend",-1)),a("p",{class:r(["text-xs font-bold",N.value>0?"text-[#5ec485]":"text-[#eb5c57]"])},i(N.value>0?"↑":"↓")+" "+i(Math.abs(N.value).toFixed(1))+"% ",3)])])]))}}),[["__scopeId","data-v-91541bec"]]),bg={class:"relative z-10 flex flex-col h-full"},mg={class:"sticky top-0 z-50 bg-[#060a14]"},xg={class:"flex flex-col items-center"},gg={class:"text-xs text-[#00f6ff] mt-1"},yg={key:1,class:"px-4 py-3 bg-[#eb5c57]/10 border-b border-[#eb5c57]/30"},wg={class:"flex items-center gap-2"},kg={class:"text-sm text-[#eb5c57]"},Sg={class:"relative bg-[#070b15] px-3 py-3 overflow-hidden"},Tg={class:"relative z-10"},_g={class:"flex items-center justify-between"},Mg={class:"flex items-center gap-1.5"},Cg={class:"px-3 py-2 bg-[#0a1020] border-b border-white/[0.05]"},Dg={class:"flex items-center justify-between gap-2"},Pg={class:"flex items-center gap-3"},Ug={class:"text-[10px] text-white/40"},Lg={class:"text-sm font-bold text-white tabular-nums"},jg={class:"flex flex-col items-end gap-1"},zg={class:"flex items-center gap-2"},Ag={class:"relative w-24 h-2 rounded-full overflow-hidden bg-gradient-to-r from-[#ff4757] via-[#ffa502] via-50% to-[#00d26a]"},Og={class:"text-[8px] text-white/50"},Ng={key:2,class:"absolute right-3 top-24 z-[100]"},Bg={class:"w-72 bg-[#060a12] border border-[#00f6ff]/30 rounded-lg shadow-lg shadow-black/50 max-h-[400px] overflow-hidden"},Fg={class:"px-4 py-3 bg-[#090f1d] border-b border-[#00f6ff]/20 sticky top-0 z-10"},Eg={class:"relative"},Yg={class:"px-4 py-2 bg-[#090f1d] border-b border-[#00f6ff]/20 sticky top-[60px] z-10 flex items-center justify-between"},Ig={class:"overflow-y-auto max-h-[280px] scrollbar-hide"},Vg={class:"relative w-full px-4 py-2 hover:bg-[#1e273f]/50 transition-colors"},Hg=["onClick"],Rg={class:"relative grid grid-cols-12 gap-2 items-center pointer-events-none"},$g={class:"col-span-1 flex items-center justify-center pointer-events-auto"},Wg=["onClick"],qg={class:"col-span-4 flex items-center gap-2"},Gg={class:"w-6 h-6 rounded-full flex items-center justify-center overflow-hidden flex-shrink-0 bg-white/10 backdrop-blur-sm border border-white/20"},Xg=["src","alt","onError"],Zg={class:"text-left"},Kg={class:"text-sm font-bold text-white"},Jg={class:"text-xs text-white/50"},Qg={class:"col-span-4 text-right"},ey={class:"text-sm font-bold text-white"},ty={class:"col-span-3 text-right"}
1,ay={key:0,class:"px-4 py-8 text-center text-white/50 text-sm"},sy={class:"px-3 py-2 flex gap-1.5 border-b border-white/[0.05] bg-[#0a1020] overflow-x-auto scrollbar-hide"},ly=["onClick"],ry={class:"flex-1 overflow-y-auto pb-24"},oy={key:0,class:"flex flex-col items-center justify-center py-16 text-white/50"},ny={class:"p-3"},iy={class:"p-3"},dy={class:"flex items-center gap-2 mb-3"},cy={class:"p-3"},uy={class:"p-3"},fy={class:"p-3"},py={key:0,class:"fixed inset-0 z-[9999] bg-[#090f1d]"},vy={class:"w-full h-full"},hy={class:"bg-black border border-rose-500/30 rounded-[6px] w-[95vw] sm:w-[90vw] max-w-lg max-h-[90vh] overflow-hidden shadow-2xl"},by={class:"px-4 py-3 border-b border-rose-500/20 flex items-center justify-between bg-rose-500/10"},my={class:"px-4 py-3 border-t border-rose-500/20 bg-white/5"},xy="@coinscreener.full",gy=F(e({__name:"MobileIndicators",emits:["navigate-to-tab"],setup(e,{emit:p}){const b=p,k=I(),S=ve(),C=me(),L=Ue(),z=G();C.ensureStarted();const A=e=>{var t;const a=e,{side:s,plan:l}=a.detail;sessionStorage.setItem("pendingTradeSide","long"===s?"Buy":"Sell"),(null==(t=null==l?void 0:l.tps)?void 0:t[0])&&sessionStorage.setItem("pendingTradeTp",l.tps[0].toString()),(null==l?void 0:l.stop)&&sessionStorage.setItem("pendingTradeSl",l.stop.toString()),b("navigate-to-tab","trade")},O=he(),N=u("BreakoutBot"),B=["BreakoutBot","Predictions","Heatmap","Liquidity Magnet","Volume Analysis"],F=u(!1),E=u(!1),Y=u(""),V=u(!1),H=u(!1),$=u({value:50,label:"Neutral"}),W=c(()=>{const e=$.value.value;return e<=25?"text-[#ff4757]":e<=45?"text-[#ffa502]":e<=55?"text-white":e<=75?"text-[#7bed9f]":"text-[#00d26a]"}),q=u(null),X=u(!0),Z=u(0),K=u(!1),J=u(0),Q=u(null),ee=e=>{const t=e.target;Q.value=t.closest(".overflow-y-auto")||document.documentElement,0===Q.value.scrollTop&&(J.value=e.touches[0].clientY)},ae=e=>{if(0===J.value||K.value)return;const t=e.touches[0].clientY-J.value;t>0&&Q.value&&0===Q.value.scrollTop&&(Z.value=Math.min(.5*t,100),Z.value>10&&e.preventDefault())},se=async()=>{Z.value>=80&&!K.value&&(K.value=!0,await re(),K.value=!1),Z.value=0,J.value=0},re=async()=>{var e;try{O.sendMessage(xy,{action:"unsubscribe",channel:xy}),await new Promise(e=>setTimeout(e,300)),O.sendMessage(xy,{action:"subscribe",channel:xy});try{await(null==(e=z.fetchAndPublish)?void 0:e.call(z,"12h","Binance"))}catch(t){console.warn("Heatmap refresh failed:",t)}await new Promise(e=>setTimeout(e,500))}catch(a){console.error("Failed to refresh data:",a),q.value="Failed to refresh data"}},oe=u(!1),ne=()=>{oe.value=!0},ie=()=>{oe.value=!1};f(()=>{var e;try{O.sendMessage(xy,{action:"subscribe",channel:xy}),setTimeout(()=>{X.value=!1},1e3),(async()=>{var e;try{const t=await fetch("https://api.alternative.me/fng/?limit=1"),a=await t.json();(null==(e=null==a?void 0:a.data)?void 0:e[0])&&($.value={value:parseInt(a.data[0].value),label:a.data[0].value_classification})}catch(t){console.error("Failed to fetch Fear & Greed:",t)}})();try{null==(e=null==z?void 0:z.ensureStarted)||e.call(z,"12h","Binance")}catch(t){console.debug("Heatmap store ensureStarted failed:",t)}window.addEventListener("claw:signalbot:trade",A)}catch(t){console.error("Failed to subscribe to WebSocket:",t),q.value="Failed to load indicator data",X.value=!1}}),h(()=>{try{O.sendMessage(xy,{action:"unsubscribe",channel:xy})}catch(e){console.error("Failed to unsubscribe from WebSocket:",e)}window.removeEventListener("claw:signalbot:trade",A)});const de=c(()=>{var e;return(null==(e=k.token)?void 0:e.label)||"BTC"}),ce=c(()=>{var e;const t=de.value+"USDT",a=((null==(e=S.data)?void 0:e[xy])||[]).find(e=>e.symbol===t);return a?{price:Number(a.lastPrice??0).toFixed(2),change:be(t,a,!0)}:{price:"0.00",change:0}}),fe=c(()=>{var e;return((null==(e=S.data)?void 0:e[xy])||[]).map(e=>({symbol:String(e.symbol||""),dailyChange:be(String(e.symbol||""),e,!0),lastPrice:Number(e.lastPrice??0),tradingVolume:Number(e.tradingVolume??0),marketCap:(()=>{const t=parseFloat(String(e.marketCap??e.market_cap??"NaN"));return Number.isFinite(t)?t:void 0})()}))}),pe=c(()=>{let e=fe.value;return e=e.filter(e=>!R(e.symbol)),e});function xe(e,t){const a=String(e||"").toUpperCase(),s=C.get(a),l=null==s?void 0:s.quote;return null!=l&&isFinite(l)?Number(l):Number(t||0)}const ge=c(()=>{const e=pe.value,t=new Map(e.map(e=>[e.symbol.toUpperCase(),e])),a=[],s=new Set,l=e=>{if(!e)return;const l=t.get(e.toUpperCase());l&&!s.has(l.symbol)&&(s.add(l.symbol),a.push(l))},r=[["BTCUSDT"],["ETHUSDT"],["SOLUSDT"],["XRPUSDT"],["DOGEUSDT"],["TRXUSDT"],["ADAUSDT"],["HYPEUSDT","HLPUSDT","HLUSDT","HYPE
1RLIQUIDUSDT"],["LINKUSDT"],["AVAXUSDT"],["BCHUSDT"],["HBARUSDT"]];for(const d of r)for(const e of d)if(t.has(e)){l(e);break}const o=e.filter(e=>!s.has(e.symbol)).sort((e,t)=>{const a=xe(e.symbol,e.tradingVolume);return xe(t.symbol,t.tradingVolume)-a}),n=o.slice(0,40),i=o.slice(40);return a.push(...n),a.push(...i),a.map(e=>{return{symbol:e.symbol.replace("USDT","").replace("USDC","").trim(),price:Number(e.lastPrice||0).toFixed(2),volume:(t=Number(e.tradingVolume||0),t>=1e9?`$${(t/1e9).toFixed(1)}B`:t>=1e6?`$${(t/1e6).toFixed(1)}M`:t>=1e3?`$${(t/1e3).toFixed(1)}K`:`$${t.toFixed(0)}`),change:e.dailyChange,dailyChange:e.dailyChange,lastPrice:e.lastPrice,tradingVolume:e.tradingVolume,marketCap:e.marketCap};var t})}),ye=c(()=>{let e=ge.value;return E.value&&(e=e.sort((e,t)=>(t.change||0)-(e.change||0))),e}),we=c(()=>ye.value.filter(e=>L.has(e.symbol+"USDT"))),ke=c(()=>{let e=ye.value;if(V.value&&(e=e.filter(e=>L.has(e.symbol+"USDT"))),Y.value.trim()){const t=Y.value.toLowerCase().trim();e=e.filter(e=>e.symbol.toLowerCase().includes(t))}return e});return(e,c)=>(d(),t("div",{class:"w-full h-full bg-transparent text-white relative overflow-hidden antialiased scrollbar-hide flex flex-col",style:{"-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale","text-rendering":"optimizeLegibility"},onTouchstart:ee,onTouchmove:ae,onTouchend:se},[c[42]||(c[42]=n('<div class="fixed inset-0 pointer-events-none overflow-hidden z-0" data-v-89fea26d><div class="absolute inset-0 bg-[#070b15]/80" data-v-89fea26d></div><div class="absolute -top-20 -right-20 w-80 h-80 bg-[#00f6ff]/[0.08] rounded-full blur-[100px] animate-float-slow" data-v-89fea26d></div><div class="absolute -bottom-32 -left-32 w-96 h-96 bg-[#066BF3]/[0.1] rounded-full blur-[120px] animate-float-slower" data-v-89fea26d></div><div class="absolute top-1/3 left-1/4 w-64 h-64 bg-[#8b5cf6]/[0.06] rounded-full blur-[80px] animate-float-medium" data-v-89fea26d></div><div class="absolute inset-0 opacity-[0.03] bg-[linear-gradient(rgba(0,246,255,0.5)_1px,transparent_1px),linear-gradient(90deg,rgba(0,246,255,0.5)_1px,transparent_1px)] bg-[length:60px_60px]" data-v-89fea26d></div></div>',1)),a("div",bg,[a("div",mg,[Z.value>0?(d(),t("div",{key:0,class:"absolute top-0 left-0 right-0 flex items-center justify-center transition-all duration-200 z-50",style:g({height:`${Math.min(Z.value,80)}px`,opacity:Z.value/80})},[a("div",xg,[(d(),t("svg",{class:r(["w-6 h-6 text-[#00f6ff] transition-transform duration-200",{"animate-spin":K.value,"rotate-180":Z.value>=80&&!K.value}]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},c[9]||(c[9]=[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"},null,-1)]),2)),a("span",gg,i(K.value?"Refreshing...":Z.value>=80?"Release to refresh":"Pull to refresh"),1)])],4)):o("",!0),q.value?(d(),t("div",yg,[a("div",wg,[c[11]||(c[11]=a("span",{class:"text-[#eb5c57]"},"⚠️",-1)),a("span",kg,i(q.value),1),a("button",{onClick:c[0]||(c[0]=e=>q.value=null),class:"ml-auto text-[#eb5c57] hover:text-[#eb5c57]/80"},c[10]||(c[10]=[a("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))])])):o("",!0),a("div",Sg,[c[15]||(c[15]=a("div",{class:"absolute top-0 right-0 w-48 h-48 bg-[#00f6ff]/20 rounded-full blur-3xl pointer-events-none"},null,-1)),c[16]||(c[16]=a("div",{class:"absolute top-0 left-0 right-0 h-0.5 bg-gradient-to-r from-transparent via-[#00f6ff] to-transparent pointer-events-none"},null,-1)),a("div",Tg,[a("div",_g,[c[14]||(c[14]=n('<div class="flex items-center gap-2" data-v-89fea26d><div class="w-8 h-8 rounded-lg bg-white/20 backdrop-blur-md flex items-center justify-center border border-white/30 p-1.5" data-v-89fea26d><svg class="w-full h-full text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-89fea26d><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z" data-v-89fea26d></path></svg></div><div data-v-89fea26d><p class="text-[10px] text-white/60 font-medium" data-v-89fea26d>CLAW</p><p class="text-sm text-white font-bold" data-v-89fea26d>Indicators</p></div></div>',1)),a("div",Mg,[a("button",{onClick:ne,class:"px-2 py-1 bg-[#00f6ff]/10 rounded-md text-xs font-bold flex items-center gap-1 border border-[#00f6ff]/30 text-[#00f6ff]"},c[12]||(c[12]=[a("svg",{class:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 12l3-3 3 3 4-4M8 21l4-4 4 4M3 4h18M4 4h16v12a1 1 0 01-1 1H5a1 1 0 01-1-1V4z"})],-1),v(" Chart ",-1)])),a("button",{onClick:c[1]||(c[1]=e=>
1F.value=!F.value),class:"px-2 py-1 bg-white/[0.08] rounded-md text-xs font-bold flex items-center gap-1 border border-white/10 text-white"},[v(i(de.value)+" ",1),c[13]||(c[13]=a("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"})],-1))])])])])]),a("div",Cg,[a("div",Dg,[a("div",Pg,[a("div",null,[a("p",Ug,i(de.value)+"/USDT",1),a("p",Lg," $"+i(ce.value.price),1)]),a("div",{class:r(["px-1.5 py-0.5 rounded text-xs font-bold",ce.value.change>=0?"bg-[#00d26a]/15 text-[#00d26a]":"bg-[#ff4757]/15 text-[#ff4757]"])},i(ce.value.change>=0?"+":"")+i(ce.value.change.toFixed(2))+"% ",3)]),a("div",jg,[a("div",zg,[c[17]||(c[17]=a("p",{class:"text-[10px] text-white/40"},"Fear & Greed",-1)),a("p",{class:r(["text-sm font-bold tabular-nums",W.value])},i($.value.value),3)]),a("div",Ag,[a("div",{class:"absolute top-0 w-1 h-2 bg-white rounded-full shadow-lg shadow-black/50 transition-all duration-500",style:g({left:`calc(${$.value.value}% - 2px)`})},null,4)]),a("p",Og,i($.value.label),1)])])]),F.value?(d(),t("div",Ng,[a("div",Bg,[a("div",Fg,[a("div",Eg,[w(a("input",{"onUpdate:modelValue":c[2]||(c[2]=e=>Y.value=e),type:"text",placeholder:"Search tokens...",class:"w-full px-3 py-2 pl-9 bg-[#0a1628]/80 backdrop-blur-sm border border-[#00f6ff]/30 rounded-lg text-sm text-white placeholder-white/40 focus:outline-none focus:border-[#00f6ff]/60 transition-colors"},null,512),[[U,Y.value]]),c[18]||(c[18]=a("svg",{class:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-white/40",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1))])]),a("div",Yg,[a("button",{onClick:c[3]||(c[3]=e=>V.value=!V.value),class:r(["flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs font-bold transition-all",V.value?"bg-[#00f6ff]/20 text-[#00f6ff] border border-[#00f6ff]/30":"bg-[#0a1628]/50 text-white/70 border border-white/10 hover:border-[#00f6ff]/30"])},[(d(),t("svg",{class:r(["w-4 h-4",V.value?"fill-[#00f6ff]":"fill-none"]),stroke:"currentColor",viewBox:"0 0 24 24"},c[19]||(c[19]=[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z"},null,-1)]),2)),v(" Favorites "+i(V.value?`(${we.value.length})`:""),1)],2),a("button",{onClick:c[4]||(c[4]=e=>E.value=!E.value),class:r(["flex items-center gap-1 px-3 py-1.5 rounded-lg text-xs font-bold transition-all",E.value?"bg-[#5ec485]/20 text-[#5ec485] border border-[#5ec485]/30":"bg-[#0a1628]/50 text-white/70 border border-white/10 hover:border-[#00f6ff]/30"]),title:"Sort by 24h gain"},[c[21]||(c[21]=v(" 24h ",-1)),(d(),t("svg",{class:r(["w-3 h-3",E.value?"rotate-180":""]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},c[20]||(c[20]=[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"},null,-1)]),2))],2)]),c[24]||(c[24]=a("div",{class:"px-4 py-2 bg-[#090f1d] border-b border-[#00f6ff]/20 sticky top-[112px] z-10 text-xs text-[#00f6ff]/70 grid grid-cols-12 gap-2 font-bold"},[a("div",{class:"col-span-5"},"Symbol"),a("div",{class:"col-span-4 text-right"},"Price"),a("div",{class:"col-span-3 text-right"},"24h")],-1)),a("div",Ig,[(d(!0),t(s,null,l(ke.value,e=>{return d(),t("div",{key:e.symbol,class:"border-b border-[#00f6ff]/10 last:border-b-0"},[a("div",Vg,[a("button",{onClick:t=>(e=>{const t=e.symbol.replace("USDT","").replace("USDC","").trim();k.setToken({icon:"",label:t,pair:`${t}/USD`,value:t.toLowerCase()}),F.value=!1})(e),class:"absolute inset-0 w-full h-full"},null,8,Hg),a("div",Rg,[a("div",$g,[a("button",{onClick:D(t=>{return a=e.symbol,void L.toggle(a+"USDT");var a},["stop"]),class:"p-1"},[(d(),t("svg",{class:r(["w-4 h-4 transition-colors",(s=e.symbol,L.has(s+"USDT")?"fill-[#ff9500] text-[#ff9500]":"fill-none text-white/30 hover:text-white/50")]),stroke:"currentColor",viewBox:"0 0 24 24"},c[22]||(c[22]=[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z"},null,-1)]),2))],8,Wg)]),a("div",qg,[a("div",Gg,[a("img",{src:y(te)(e.symbol,32),alt:e.symbol,class:"w-full h-full object-cover",onError:t=>((e,t)=>{const a=e.target,s=a.parentElement;if(s){const e=document.createElement("div");e.className="w-full h-full flex items-center justify-center text-xs font-semibold text-white",e.style.background=le(t),e.textContent=t.charAt(0).toUpperCase(),s.replaceChild(e,a)}})(t,e.symbol)},null,40,Xg)]),a("div",Zg,[a("p",Kg,i(e.symbol),1),a("p",Jg,i(e.volume),1)])]),a("div",Qg,[a("p",ey,"$"+i(e.price),1)]),a("div",ty,[a("p",{class:r(["text-xs font-black",e.change>=0?"text-[#5ec485]":"text-[#eb5c57]"])},i(e.change>=0?"+":"")+i(e.change.toFixed(2))+"% ",3)])])])]);var s}),128)),0===ke.value.length?(d(),t("div",ay,c[23]||(c[23]=[a("svg",{class:"w-12 h-12 mx-auto mb-2 text-white/20",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1),a("p",null,"No tokens found",-1)]))):o("",!0)])])])):o("",!0),a("div",sy,[(d(),t(s,null,l(B,e=>a("button",{key:e,onClick:t=>N.value=e,class:r(["px-2.5 py-1 text-[10px] font-bold whitespace-nowrap transition-all rounded-md",N.value===e?"bg-[#00f6ff] text-[#090f1d]":"bg-white/[0.06] text-white/60 hover:text-white hover:bg-white/[0.1]"])},i(e),11,ly)),64))])]),a("div",ry,[X.value?(d(),t("div",oy,c[25]||(c[25]=[a("div",{class:"animate-spin rounded-full h-6 w-6 border-b-2 border-[#00f6ff] mb-3"},null,-1),a("p",{class:"text-xs"},"Loading indicators...",-1)]))):o("",!0),w(a("div",ny,[c[26]||(c[26]=n('<div class="flex items-center gap-2 mb-3" data-v-89fea26d><svg class="w-4 h-4 text-[#00f6ff]" fill="currentColor" viewBox="0 0 24 24" data-v-89fea26d><path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7 14l-5-5 1.41-1.41L12 14.17l4.59-4.58L18 11l-6 6z" data-v-89fea26d></path></svg><h3 class="text-sm font-bold text-white" data-v-89fea26d>AI Predictions</h3><span class="text-[10px] text-white/40" data-v-89fea26d>ML price forecasts</span></div>',1)),m(at,{"card-id":"mobile-predictions"})],512),[[P,"Predictions"===N.value]]),w(a("div",iy,[a("div",dy,[c[28]||(c[28]=a("svg",{class:"w-4 h-4 text-rose-400",fill:"currentColor",viewBox:"0 0 24 24"},[a("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z"})],-1)),c[29]||(c[29]=a("h3",{class:"text-sm font-bold text-white"},"Liquidation Heatmap",-1)),c[30]||(c[30]=a("span",{class:"text-[10px] text-white/40"},"Where liquidations cluster",-1)),a("button",{class:"ml-auto text-[#00f6ff] hover:text-[#00f6ff]/80 transition-colors",onClick:c[5]||(c[5]=e=>H.value=!0),title:"View glossary"}
1,c[27]||(c[27]=[a("svg",{class:"w-4 h-4",fill:"currentColor",viewBox:"0 0 24 24"},[a("path",{d:"M11 17h2v-6h-2v6zm1-15C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zM11 9h2V7h-2v2z"})],-1)]))]),(d(),x(j,null,{default:T(()=>[m(Ix)]),fallback:T(()=>c[31]||(c[31]=[a("div",{class:"flex items-center justify-center py-8"},[a("div",{class:"text-center text-white/50"},[a("div",{class:"animate-spin rounded-full h-8 w-8 border-b-2 border-[#00f6ff] mx-auto mb-2"}),a("p",{class:"text-sm"},"Loading signals...")])],-1)])),_:1}))],512),[[P,"Heatmap"===N.value]]),w(a("div",cy,[c[33]||(c[33]=n('<div class="flex items-center gap-2 mb-3" data-v-89fea26d><svg class="w-4 h-4 text-purple-400" fill="currentColor" viewBox="0 0 24 24" data-v-89fea26d><path d="M12 2C8.14 2 5 5.14 5 9c0 2.38 1.19 4.47 3 5.74V17c0 .55.45 1 1 1h6c.55 0 1-.45 1-1v-2.26c1.81-1.27 3-3.36 3-5.74 0-3.86-3.14-7-7-7zm2 15h-4v-1h4v1zm0-2h-4v-1h4v1zm-1-3.17V13h-2v-1.17a5.02 5.02 0 01-3-4.58C8 4.92 9.79 3 12 3s4 1.92 4 4.25c0 1.83-.78 3.53-2 4.58zM12 20c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2z" data-v-89fea26d></path></svg><h3 class="text-sm font-bold text-white" data-v-89fea26d>Liquidity Magnet</h3><span class="text-[10px] text-white/40" data-v-89fea26d>Sweep reversal signals</span></div>',1)),(d(),x(j,null,{default:T(()=>[m(et,{"card-id":"mobile-magnet"})]),fallback:T(()=>c[32]||(c[32]=[a("div",{class:"flex items-center justify-center py-12"},[a("div",{class:"text-center text-white/50"},[a("div",{class:"animate-spin rounded-full h-8 w-8 border-b-2 border-[#00f6ff] mx-auto mb-2"}),a("p",{class:"text-sm"},"Loading magnet...")])],-1)])),_:1}))],512),[[P,"Liquidity Magnet"===N.value]]),w(a("div",uy,[c[34]||(c[34]=n('<div class="flex items-center gap-2 mb-3" data-v-89fea26d><svg class="w-4 h-4 text-amber-400" fill="currentColor" viewBox="0 0 24 24" data-v-89fea26d><path d="M4 9h4v11H4zm6-5h4v16h-4zm6 8h4v8h-4z" data-v-89fea26d></path></svg><h3 class="text-sm font-bold text-white" data-v-89fea26d>Volume Analysis</h3><span class="text-[10px] text-white/40" data-v-89fea26d>Market activity</span></div>',1)),m(hg)],512),[[P,"Volume Analysis"===N.value]]),w(a("div",fy,[c[36]||(c[36]=n('<div class="flex items-center gap-2 mb-3" data-v-89fea26d><svg class="w-4 h-4 text-[#00f6ff]" fill="currentColor" viewBox="0 0 24 24" data-v-89fea26d><path d="M16 6l2.29 2.29-4.88 4.88-4-4L2 16.59 3.41 18l6-6 4 4 6.3-6.29L22 12V6z" data-v-89fea26d></path></svg><h3 class="text-sm font-bold text-white" data-v-89fea26d>Breakout Bot</h3><span class="text-[10px] text-white/40" data-v-89fea26d>Range breakout signals</span></div>',1)),(d(),x(j,null,{default:T(()=>[m(Qe,{"card-id":"mobile-signals"})]),fallback:T(()=>c[35]||(c[35]=[a("div",{class:"flex items-center justify-center py-12"},[a("div",{class:"text-center text-white/50"},[a("div",{class:"animate-spin rounded-full h-8 w-8 border-b-2 border-[#00f6ff] mx-auto mb-2"}),a("p",{class:"text-sm"},"Loading signals...")])],-1)])),_:1}))],512),[[P,"BreakoutBot"===N.value]])])]),(d(),x(M,{to:"body"},[m(_,{name:"slide-up"},{default:T(()=>[oe.value?(d(),t("div",py,[a("button",{onClick:ie,class:"absolute bottom-20 left-4 z-[10000] p-3 bg-[#0d1421]/80 backdrop-blur-sm hover:bg-[#00f6ff]/20 rounded-lg transition-all active:scale-95 shadow-lg"},c[37]||(c[37]=[a("svg",{class:"w-6 h-6 text-[#00f6ff]",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])),a("div",vy,[(d(),x(j,null,{default:T(()=>[(d(),x(ue,{key:`mobile-indicators-chart-${de.value}`,"card-id":`mobile-indicators-chart-${de.value}`,"symbol-label":de.value,timeframe:"15"},null,8,["card-id","symbol-label"]))]),fallback:T(()=>c[38]||(c[38]=[a("div",{class:"flex items-center justify-center h-full"},[a("div",{class:"text-center text-white/[0.42]"},[a("div",{class:"animate-spin rounded-full h-8 w-8 border-b-2 border-[#00f6ff] mx-auto mb-2"}),a("p",{class:"text-sm"},"Loading chart...")])],-1)])),_:1}))])])):o("",!0)]),_:1})])),(d(),x(M,{to:"body"},[H.value?(d(),t("div",{key:0,class:"fixed inset-0 bg-black/80 flex items-center justify-center z-[9999] p-2 sm:p-4",onClick:c[8]||(c[8]=D(e=>H.value=!1,["self"]))},[a("div",hy,[a("div",by,[c[40]||(c[40]=a("div",{class:"flex items-center gap-2"},[a("svg",{class:"w-5 h-5 text-rose-400",fill:"currentColor",viewBox:"0 0 24 24"},[a("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z"})]),a("h3",{class:"text-base font-bold text-white"},"Liquidation Heatmap Glossary")],-1)),a("button",{class:"text-white/70 hover:text-white transition-colors p-1",onClick:c[6]||(c[6]=e=>H.value=!1)},c[39]||(c[39]=[a("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),c[41]||(c[41]=a("div",{class:"px-4 py-4 overflow-y-auto max-h-[calc(85vh-100px)] space-y-3 text-sm"},[a("div",{class:"bg-white/5 rounded-[6px] p-3 border border-white/10"},[a("h4",{class:"font-bold text-rose-400 mb-2 flex items-center gap-2"}
1,[a("svg",{class:"w-4 h-4",fill:"currentColor",viewBox:"0 0 24 24"},[a("path",{d:"M11 17h2v-6h-2v6zm1-15C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zM11 9h2V7h-2v2z"})]),v(" What is a Liquidation Heatmap? ")]),a("p",{class:"text-white/80 text-xs"}," A visual map showing where leveraged traders have their stop losses and liquidation prices. Bright/hot zones = many positions will be liquidated if price reaches there. ")]),a("div",{class:"space-y-2"},[a("h4",{class:"font-bold text-white text-xs uppercase tracking-wider"},"Key Terms"),a("div",{class:"bg-white/5 rounded-[6px] p-2.5 border border-white/10"},[a("span",{class:"font-bold text-amber-400"},"Liquidation Wall"),a("p",{class:"text-white/70 text-xs mt-0.5"}," A price level with concentrated liquidations. When price reaches these, a cascade of forced selling/buying occurs. ")]),a("div",{class:"bg-white/5 rounded-[6px] p-2.5 border border-white/10"},[a("span",{class:"font-bold text-rose-400"},"Long Liquidations (Red)"),a("p",{class:"text-white/70 text-xs mt-0.5"}," Positions that get liquidated when price drops. These appear BELOW current price. ")]),a("div",{class:"bg-white/5 rounded-[6px] p-2.5 border border-white/10"},[a("span",{class:"font-bold text-emerald-400"},"Short Liquidations (Green)"),a("p",{class:"text-white/70 text-xs mt-0.5"}," Positions that get liquidated when price rises. These appear ABOVE current price. ")]),a("div",{class:"bg-white/5 rounded-[6px] p-2.5 border border-white/10"},[a("span",{class:"font-bold text-purple-400"},"Intensity"),a("p",{class:"text-white/70 text-xs mt-0.5"}," Brighter colors = more liquidations at that level. Market makers target the brightest zones. ")])]),a("div",{class:"bg-emerald-500/20 rounded-[6px] p-3 border border-emerald-500/30"},[a("h4",{class:"font-bold text-emerald-400 mb-2 flex items-center gap-2"},[a("svg",{class:"w-4 h-4",fill:"currentColor",viewBox:"0 0 24 24"},[a("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1.41 16.09V20h-2.67v-1.93c-1.71-.36-3.16-1.46-3.27-3.4h1.96c.1 1.05.82 1.87 2.65 1.87 1.96 0 2.4-.98 2.4-1.59 0-.83-.44-1.61-2.67-2.14-2.48-.6-4.18-1.62-4.18-3.67 0-1.72 1.39-2.84 3.11-3.21V4h2.67v1.95c1.86.45 2.79 1.86 2.85 3.39H14.3c-.05-1.11-.64-1.87-2.22-1.87-1.5 0-2.4.68-2.4 1.64 0 .84.65 1.39 2.67 1.91s4.18 1.39 4.18 3.91c-.01 1.83-1.38 2.83-3.12 3.16z"})]),v(" How to Make Money ")]),a("ul",{class:"text-white/80 text-xs space-y-1.5 ml-4 list-disc"},[a("li",null,[a("strong",null,"Identify bright walls"),v(' — these are "magnets" for price')]),a("li",null,[a("strong",null,"Watch for sweeps"),v(" — price often wicks into walls then reverses ")]),a("li",null,[a("strong",null,"Trade the reversal"),v(" — after sweep, fade the move back")]),a("li",null,[a("strong",null,"Use walls as targets"),v(" — price is attracted to liquidation clusters ")])])]),a("div",{class:"bg-[#00f6ff]/20 rounded-[6px] p-3 border border-[#00f6ff]/30"},[a("h4",{class:"font-bold text-[#00f6ff] mb-2 flex items-center gap-2"},[a("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})]),v(" Pro Tips ")]),a("ul",{class:"text-white/80 text-xs space-y-1.5 ml-4 list-disc"},[a("li",null,"Bigger walls = stronger reversals when swept"),a("li",null,"Multiple walls at similar levels = extra confluence"),a("li",null,'Walls "refresh" over time as new positions are opened'),a("li",null,"Avoid trading during major news — walls can be blown through")])])],-1)),a("div",my,[a("button",{class:"w-full px-4 py-2 bg-rose-500 hover:bg-rose-500/90 text-white font-bold rounded-lg transition-colors text-sm",onClick:c[7]||(c[7]=e=>H.value=!1)}," Got it! ")])])])):o("",!0)]))],32))}}),[["__scopeId","data-v-89fea26d"]]),yy={class:"h-screen w-screen flex flex-col bg-[#0b1120] overflow-hidden safe-area-top antialiased scrollbar-hide claw-scope claw-v2 claw-workspace-bg",style:{"-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale","text-rendering":"optimizeLegibility"}},wy={key:0,class:"fixed inset-0 bg-[#0b1120] z-[9999] flex items-center justify-center"},ky={class:"bg-gradient-to-br from-[#0d1424] to-[#0b1120] border border-[#00f6ff]/30 rounded-[6px] p-8 max-w-sm w-full shadow-2xl"},Sy={class:"text-center"},Ty={key:0,class:"fixed inset-0 z-[200] bg-[#0b1120] overflow-y-auto"},_y={key:0,class:"bg-yellow-500/90 text-slate-900 px-4 py-2 text-center text-sm font-medium flex items-center justify-center gap-2 z-50"},My={class:"flex-1 overflow-y-auto overflow-x-hidden scrollbar-hide pb-[44px] pt-safe-responsive"},Cy={key:0,class:"fixed inset-0 z-[9999] bg-[#090f1d]"},Dy={class:"w-full h-full pt-14"},Py=F(e({__name:"MobileMainLayout",setup(e){const s=C(),{isOnline:l}=function(){const e=u(navigator.onLine),t=()=>{e.value=navigator.onLine};return f(()=>{window.addEventListener("online",t),window.addEventListener("offline",t)}),h(()=>{window.removeEventListener("online",t),window.removeEventListener("offline",t)}),{isOnline:e}}(),r=ie(),n=Ze(),i=B("token",""),v=c(()=>{try{const e=localStorage.getItem("user");if(e){const t=JSON.parse(e);return t.username||t.first_name||""}}catch(e){console.error("Error parsing user from localStorage:",e)}return""}),g=u(!0),w=c(()=>Boolean(i.value)||n.isVerified.value);c(()=>n.subscriptionTierDisplay.value);const k=u(!1),S=c(()=>!(g.value||i.value&&w.value||k.value)),D=u(!1),P=()=>{k.value=!0,D.value=!0},U=()=>{sessionStorage.setItem("cameFromMobile","true"),localStorage.setItem("cameFromMobile","true"),s.push("/account/subscriptions")},L=()=>{s.push({path:"/auth/login",query:{to:s.currentRoute.value.fullPath}})},z=()=>{sessionStorage.setItem("mobileSignupFlow","true"),s.push("/auth/signup")},A=()=>{D.value=!1,i.value&&w.value||(k.value=!1)},O=async()=>
1{if(i.value)try{g.value=!0,await r.triggerRefresh()}catch(e){console.error("[Mobile] Error checking subscription:",e)}finally{g.value=!1}else g.value=!1},F=B("mobileDefaultTab","home"),E=u(F.value);b(E,e=>{de(e)});const Y=u(!1);b(i,(e,t)=>{t&&!e&&(Y.value||(J("You have been logged out. Please log in again.",{type:"warning",position:"top-center",autoClose:3e3}),Y.value=!0))});const I=u(1),V=e=>{const t=e;I.value=t.detail.scale};f(()=>{O(),(()=>{try{const e=localStorage.getItem("mobile_text_size")||"normal",t={small:.85,normal:1,large:1.15,xlarge:1.3};I.value=t[e]||1,document.documentElement.style.setProperty("--mobile-text-scale",String(I.value))}catch(e){console.error("Error loading text size:",e)}})(),window.addEventListener("mobile:textsize",V),window.addEventListener("storage",H);const e=sessionStorage.getItem("pendingMobileTab");e&&(E.value=e,sessionStorage.removeItem("pendingMobileTab"))}),b(i,e=>{e?O():g.value=!1}),p(()=>{window.removeEventListener("storage",H),window.removeEventListener("mobile:textsize",V)});const H=e=>{"token"!==e.key||e.newValue||Y.value||(J("You have been logged out. Please log in again.",{type:"warning",position:"top-center",autoClose:3e3}),Y.value=!0)};function R(){E.value="trade"}function $(e){E.value=e}const W={home:Bl,trade:Kd,"ask-claw":tc,vault:ac,posttrade:uc,portfolio:ap,calendar:ip,market:Vp,indicators:gy},q=c(()=>W[E.value]||Bl);return(e,r)=>(d(),t("div",yy,[m(_,{name:"fade"},{default:T(()=>[g.value?(d(),t("div",wy,[a("div",ky,[a("div",Sy,[r[2]||(r[2]=a("div",{class:"w-16 h-16 bg-[#00f6ff]/20 rounded-full flex items-center justify-center mx-auto mb-4"},[a("svg",{class:"w-8 h-8 text-[#00f6ff]",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})])],-1)),r[3]||(r[3]=a("h2",{class:"text-xl font-bold text-white mb-2"},"Login Required",-1)),r[4]||(r[4]=a("p",{class:"text-slate-400 text-sm mb-6"}," Please log in to access CLAW ",-1)),a("button",{onClick:r[0]||(r[0]=e=>y(s).push({path:"/auth/login",query:{to:y(s).currentRoute.value.fullPath}})),class:"w-full bg-gradient-to-r from-[#00f6ff] to-[#1870f6] hover:from-[#00f6ff]/80 hover:to-[#1870f6]/80 text-white font-semibold py-3 px-6 rounded-lg transition-all duration-300 shadow-lg shadow-[#00f6ff]/30"}," Go to Login ")])])])):o("",!0)]),_:1}),m(_,{name:"fade"},{default:T(()=>
1[S.value?(d(),t("div",Ty,[m(Ft,{"is-logged-in":!!y(i),username:v.value,onTryChart:P,onViewPlans:U,onLogin:L,onSignup:z},null,8,["is-logged-in","username"])])):o("",!0)]),_:1}),m(_,{name:"slide-down"},{default:T(()=>[y(l)?o("",!0):(d(),t("div",_y,r[5]||(r[5]=[a("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18.364 5.636a9 9 0 010 12.728m0 0l-2.829-2.829m2.829 2.829L21 21M15.536 8.464a5 5 0 010 7.072m0 0l-2.829-2.829m-4.243 2.829a4.978 4.978 0 01-1.414-2.83m-1.414 5.658a9 9 0 01-2.167-9.238m7.824 2.167a1 1 0 111.414 1.414m-1.414-1.414L3 3m8.293 8.293l1.414 1.414"})],-1),a("span",null,"You're offline. Some features may be unavailable.",-1)])))]),_:1}),a("div",My,[(d(),x(j,null,{default:T(()=>[(d(),x(N(q.value),{onNavigateToTrade:R,onNavigateToTab:$},null,32))]),fallback:T(()=>r[6]||(r[6]=[a("div",{class:"flex items-center justify-center h-full"},[a("div",{class:"text-center"},[a("div",{class:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-400 mx-auto mb-4"}),a("p",{class:"text-slate-400"},"Loading...")])],-1)])),_:1}))]),S.value||k.value&&!w.value?o("",!0):(d(),x(vt,{key:0,modelValue:E.value,"onUpdate:modelValue":r[1]||(r[1]=e=>E.value=e)},null,8,["modelValue"])),(d(),x(M,{to:"body"},[m(_,{name:"slide-up"},{default:T(()=>[D.value?(d(),t("div",Cy,[a("div",{class:"absolute top-0 left-0 right-0 z-[10000] bg-gradient-to-r from-[#0b1120]/95 to-[#0d1424]/95 backdrop-blur-sm border-b border-[#00f6ff]/20 px-4 py-3 flex items-center justify-between safe-area-top-padding"},[a("button",{onClick:A,class:"flex items-center gap-2 text-[#00f6ff] hover:text-[#00f6ff]/80 transition-colors"},r[7]||(r[7]=[a("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1),a("span",{class:"text-sm font-medium"},"Back",-1)])),a("div",{class:"flex items-center gap-2"},[a("button",{onClick:L,class:"text-xs bg-[#00f6ff]/20 text-[#00f6ff] px-3 py-1.5 rounded-lg font-medium hover:bg-[#00f6ff]/30 transition-colors"}," Login "),a("button",{onClick:U,class:"text-xs bg-amber-500/20 text-amber-400 px-3 py-1.5 rounded-lg font-medium hover:bg-amber-500/30 transition-colors"}," Subscribe ")])]),a("div",Dy,[(d(),x(j,null,{default:T(()=>[m(ue,{key:"free-chart-btc","card-id":"free-chart-btc","symbol-label":"BTC",timeframe:"15"})]),fallback:T(()=>r[8]||(r[8]=[a("div",{class:"flex items-center justify-center h-full"},[a("div",{class:"text-center text-slate-400"},[a("div",{class:"animate-spin rounded-full h-8 w-8 border-b-2 border-[#00ffff] mx-auto mb-2"}),a("p",{class:"text-sm"},"Loading chart...")])],-1)])),_:1}))])])):o("",!0)]),_:1})])),m(ce)]))}}),[["__scopeId","data-v-91ad435a"]]);export{Py as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.