1import{r as n,j as e}from"./ui-vendor-efoDfjla.js";import{u as _e,t as Le,b as Pe,d as Oe,c as p}from"./index-SMBbCbVL.js";import{k as Me,p as $e}from"./subscription-DYm4fMbQ.js";import{a as Ue}from"./router-vendor-CSWcbrtA.js";import{L as x,h as ue,S as Je,y as ze,i as pe,ai as Ge,ao as Ie,ap as Re,k as Ye,E as L,aq as he,H as E}from"./utils-vendor-BXji2ymy.js";import"./query-vendor-BYBWvLyW.js";import"./dateUtils-DTOd2PGQ.js";function Xe(){var me;const h=Ue(),{user:r,loading:m,isAdmin:C}=_e(),{theme:P,toggleTheme:fe}=Le(),{mode:d,setMode:be,loading:O}=Pe(),[b,M]=n.useState(""),[$,U]=n.useState(!1),[J,D]=n.useState(!1),[c,z]=n.useState(null),{data:S}=Oe(!!localStorage.getItem("token")),g=S==null?void 0:S.access,[k,G]=n.useState(!1),[I,u]=n.useState(""),[ge,je]=n.useState(!1),[R,Y]=n.useState(!1),[B,j]=n.useState(!1),[q,f]=n.useState(""),[T,H]=n.useState([]),[V,Ne]=n.useState(null),[ve,Z]=n.useState(!1),[K,Q]=n.useState(""),[W,ye]=n.useState(null),[we,X]=n.useState(!1),[ee,te]=n.useState(""),[Fe,se]=n.useState(!1),[N,ae]=n.useState(""),[A,ne]=n.useState(!1),[re,v]=n.useState(""),[Ee,oe]=n.useState(!0);n.useEffect(()=>{const t=new URLSearchParams(window.location.search);if(t.get("tradovate_connected")==="1"&&(le(),window.history.replaceState({},"",window.location.pathname)),t.get("tradovate_error")==="1"){const s=t.get("message")||"Failed to connect Tradovate.";console.error("Tradovate OAuth error:",s),window.history.replaceState({},"",window.location.pathname)}},[]);const le=async()=>{try{const t=await p.apiCall.invoke({url:"/api/v1/tradovate/status",method:"GET"}),s=t==null?void 0:t.data,o=(s==null?void 0:s.connections)||[];if(H(o),o.length>0){Z(!0),Q("");try{const a=await p.apiCall.invoke({url:"/api/v1/tradovate/accounts",method:"GET"});Ne((a==null?void 0:a.data)??null)}catch(a){console.error("[Tradovate] Accounts fetch error:",a),Q((a==null?void 0:a.message)||"Failed to fetch accounts")}finally{Z(!1)}X(!0),te("");try{const a=await p.apiCall.invoke({url:"/api/v1/tradovate/trade-data",method:"GET"});ye((a==null?void 0:a.data)??null)}catch(a){console.error("[Tradovate] Trade data fetch error:",a),te((a==null?void 0:a.message)||"Failed to fetch trade data")}finally{X(!1)}}}catch(t){console.warn("[Tradovate] Status check failed:",t)}},ie=n.useCallback(async()=>{try{r!=null&&r.name&&M(r.name);const t=await Me();if(t){const o=t,a=o==null?void 0:o.stripe_subscription_id;z({plan:t.subscription_plan||"none",stripe_subscription_id:typeof a=="string"?a.trim():void 0})}else z({plan:"none"});const s=localStorage.getItem("extension-connected")==="true";Y(s),await le()}catch(t){console.error("Failed to fetch user data:",t)}finally{oe(!1)}},[r,C]);n.useEffect(()=>{!m&&r?ie():!m&&!r&&oe(!1)},[m,r,ie]),n.useEffect(()=>{!m&&!r&&h("/",{replace:!0})},[m,r,h]);const Ce=async()=>{if(b.trim()){U(!0),D(!1);try{(await fetch("/api/v1/users/profile",{method:"PUT",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:b.trim()})})).ok&&(D(!0),setTimeout(()=>D(!1),3e3))}catch(t){console.error("Failed to save name:",t)}finally{U(!1)}}},De=async()=>{var o;G(!0),u("");const t=window.open("","_blank");try{(o=t==null?void 0:t.document)==null||o.write("<title>Vaulticks</title><body style='background:#0D1117;color:#8B949E;font:14px system-ui;padding:24px'>Opening your billing portalâ¦</body>")}catch{}const s=a=>{t&&!t.closed?t.location.href=a:window.location.href=a};try{const a=window.location.origin,w=await fetch("/api/v1/payment/customer_portal",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json","App-Host":window.location.host},body:JSON.stringify({return_url:`${a}/settings`})});if(!w.ok){t&&!t.closed&&t.close();let l="";try{l=(await w.text()).toLowerCase()}catch{}if(w.status===404||l.includes("no active subscription")||l.includes("no subscription")){je(!0),u("");return}u("Couldn't open the billing portal. Please try again, or email [email protected].");return}{const l=await w.json();if(l!=null&&l.pending&&(l!=null&&l.checkout_id)){const Ae=Date.now()+2e4;let _="";for(;Date.now()<Ae;){try{const F=await fetch(`/api/v1/payment/payment_session_status/${l.checkout_id}`,{credentials:"include"});if(F.ok){const i=await F.json();if((i==null?void 0:i.status)==="ready"&&(i!=null&&i.checkout_url)){_=i.checkout_url;break}if((i==null?void 0:i.status)==="error"){console.error("Portal session failed:",i==null?void 0:i.error_detail);break}}}catch{}await new Promise(F=>setTimeout(F,500))}_?s(_):(t&&!t.closed&&t.close(),u("The billing portal took too long to open. Please try again."))}else l!=null&&l.url?s(l.url):(t&&!t.closed&&t.close(),u("The billing portal returned no link. Please try again."))}}catch(a){console.error("Failed to open portal:",a),t&&!t.closed&&t.close(),u("Couldn't reach the billing portal. Check your connection and try again.")}finally{G(!1)}},Se=()=>{localStorage.removeItem("extension-connected"),Y(!1)},ke=async()=>
1{if(r&&N.trim().toLowerCase()===r.email.trim().toLowerCase()){ne(!0),v("");try{const t=await fetch("/api/v1/account/delete",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({confirm_email:N.trim()})});if(t.ok){const s=await t.json();(s==null?void 0:s.status)==="deleted"&&(localStorage.clear(),window.location.href="/")}else{const s=await t.json().catch(()=>({}));v((s==null?void 0:s.detail)||"Failed to delete account.")}}catch(t){v((t==null?void 0:t.message)||"Failed to delete account.")}finally{ne(!1)}}},y=(c==null?void 0:c.plan)&&c.plan!=="none",ce=$e(c==null?void 0:c.plan),Be=typeof(c==null?void 0:c.stripe_subscription_id)=="string"&&c.stripe_subscription_id.length>0,de=g==="paid"&&Be&&!ge,xe=(()=>{if(de)return"";switch(g){case"admin":return"Admin access â no billing subscription to manage.";case"trial":return"You're in the trial period of your subscription.";case"trial_not_started":return"No subscription yet â start a free trial from Pricing.";case"expired":return"Your free trial has ended.";case"paid":return"No active subscription to manage.";default:return y?"No active subscription to manage.":"No active subscription."}})(),Te=r&&N.trim().toLowerCase()===(r.email||"").trim().toLowerCase();return Ee||m?e.jsx("div",{className:"min-h-screen bg-[#0D1117] flex items-center justify-center",children:e.jsx(x,{className:"w-6 h-6 text-[#8B949E] animate-spin"})}):r?e.jsx("div",{className:"min-h-screen bg-[#0D1117] text-[#F0F6FC]",children:e.jsxs("div",{className:"max-w-2xl mx-auto px-4 py-8 space-y-8",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("button",{onClick:()=>h(-1),className:"text-[#8B949E] hover:text-[#F0F6FC] transition-colors",children:e.jsx(ue,{className:"w-5 h-5"})}),e.jsx("h1",{className:"text-2xl font-extrabold",children:"Settings"})]}),C&&e.jsx("section",{className:"bg-[#161B22] rounded-xl p-4 border border-[#22C55E]/30",children:e.jsxs("button",{onClick:()=>h("/admin"),className:"w-full flex items-center justify-between group",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-9 h-9 rounded-lg bg-[#22C55E]/10 flex items-center justify-center",children:e.jsx(Je,{className:"w-4.5 h-4.5 text-[#22C55E]"})}),e.jsxs("div",{className:"text-left",children:[e.jsx("p",{className:"text-sm font-semibold text-[#F0F6FC] group-hover:text-[#22C55E] transition-colors",children:"Admin Dashboard"}),e.jsx("p",{className:"text-xs text-[#8B949E]",children:"Manage users, affiliates, and platform settings"})]})]}),e.jsx(ue,{className:"w-4 h-4 text-[#8B949E] rotate-180 group-hover:text-[#22C55E] transition-colors"})]})}),e.jsxs("section",{className:"bg-[#161B22] rounded-xl p-6 border border-[#21262D] space-y-5",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(ze,{className:"w-4 h-4 text-[#8B949E]"}),e.jsx("h2",{className:"text-sm font-bold text-[#8B949E] uppercase tracking-wider",children:"Profile"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-xs text-[#484F58] font-medium",children:"Email"}),e.jsx("div",{className:"px-3 py-2.5 rounded-lg bg-[#0D1117] border border-[#21262D] text-sm text-[#8B949E]",children:(r==null?void 0:r.email)||"â"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-xs text-[#484F58] font-medium",children:"Display Name"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{type:"text",value:b,onChange:t=>M(t.target.value),placeholder:"Enter your name",className:"flex-1 px-3 py-2.5 rounded-lg bg-[#0D1117] border border-[#21262D] text-sm text-[#F0F6FC] placeholder-[#484F58] focus:outline-none focus:border-[#22C55E]/50"}),e.jsxs("button",{onClick:Ce,disabled:$||!b.trim(),className:"px-4 py-2.5 rounded-lg bg-[#22C55E] hover:bg-[#16A34A] disabled:opacity-50 disabled:cursor-not-allowed text-[#0D1117] text-xs font-bold transition-colors flex items-center gap-1.5",children:[$?e.jsx(x,{className:"w-3.5 h-3.5 animate-spin"}):J?e.jsx(pe,{className:"w-3.5 h-3.5"}):null,J?"Saved":"Save"]})]})]}),e.jsxs("p",{className:"text-xs text-[#8B949E]",children:["Signed in via ",e.jsx("span",{className:"text-[#F0F6FC] font-medium",children:(r==null?void 0:r.email)||"â"})]})]}),e.jsxs("section",{className:"bg-[#161B22] rounded-xl p-6 border border-[#21262D] space-y-5",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(Ge,{className:"w-4 h-4 text-[#8B949E]"}),e.jsx("h2",{className:"text-sm font-bold text-[#8B949E] uppercase tracking-wider",children:"Subscription & Billing"})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-[#F0F6FC] font-semibold",children:"Current Plan"}),e.jsx("p",{className:"text-xs text-[#8B949E] mt-0.5",children:y?`${ce} â Active`:"Free tier"}),xe&&e.jsx("p",{className:"text-xs text-[#8B949E] mt-1",children:xe})]}),e.jsx("span",{className:`px-3 py-1 rounded-full text-xs font-bold ${y?"bg-[#22C55E]/10 text-[#22C55E] border border-[#22C55E]/20":"bg-[#484F58]/20 text-[#8B949E] border border-[#21262D]"}`,children:ce})]}),de?e.jsxs("button",{onClick:De,disabled:k,className:"inline-flex items-center gap-2 px-4 py-2.5 rounded-lg bg-[#21262D] hover:bg-[#30363D] border border-[#30363D] text-sm font-medium text-[#F0F6FC] transition-colors disabled:opacity-50",children:[k?e.jsx(x,{className:"w-4 h-4 animate-spin"}):e.jsx(Ie,{className:"w-4 h-4"}),k?"Opening portalâ¦":"Manage Subscription"]}):e.jsx("button",{onClick:()=>h("/pricing"),className:"inline-flex items-center gap-2 px-4 py-2.5 rounded-lg bg-[#22C55E] hover:bg-[#16A34A] text-[#0D1117] text-sm font-bold transition-colors",children:g==="admin"||g==="paid"||y?"View plans":"Upgrade to Auto Mode"}),I&&e.jsx("p",{className:"text-xs text-[#EF4444] mt-2",children:I})]}),e.jsxs("section",{className:"bg-[#161B22] rounded-xl p-6 border border-[#21262D] space-y-5",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(Re,{className:"w-4 h-4 text-[#8B949E]"}),e.jsx("h2",{className:"text-sm font-bold text-[#8B949E] uppercase tracking-wider",children:"Preferences"})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-[#F0F6FC] font-semibold",children:"Theme"}),e.jsx("p",{className:"text-xs text-[#8B949E] mt-0.5",children:"Switch between light and dark mode"})]}),e.jsx("button",{onClick:fe,className:`relative w-12 h-6 rounded-full transition-colors ${P==="dark"?"bg-[#22C55E]":"bg-[#484F58]"}`,children:e.jsx("span",{className:`absolute top-0.5 left-0.5 w-
15 h-5 rounded-full bg-white transition-transform ${P==="dark"?"translate-x-6":"translate-x-0"}`})})]})]}),e.jsxs("section",{className:"bg-[#161B22] rounded-xl p-6 border border-[#21262D] space-y-5",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(Ye,{className:"w-4 h-4 text-[#8B949E]"}),e.jsx("h2",{className:"text-sm font-bold text-[#8B949E] uppercase tracking-wider",children:"Trade Mode"})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-[#F0F6FC] font-semibold",children:d==="manual"?"Manual Mode":"Auto Mode"}),e.jsx("p",{className:"text-xs text-[#8B949E] mt-0.5 max-w-[280px]",children:d==="manual"?"You manage accounts, drawdown, and trade logging manually.":"Accounts, drawdown, and journal entries sync from connected Tradovate accounts."})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:`text-xs font-medium ${d==="manual"?"text-[#F0F6FC]":"text-[#484F58]"}`,children:"Manual"}),e.jsx("button",{onClick:()=>be(d==="manual"?"auto":"manual"),disabled:O,className:`relative w-12 h-6 rounded-full transition-colors ${d==="auto"?"bg-[#3B82F6]":"bg-[#484F58]"} ${O?"opacity-50 cursor-not-allowed":""}`,children:e.jsx("span",{className:`absolute top-0.5 left-0.5 w-5 h-5 rounded-full bg-white transition-transform ${d==="auto"?"translate-x-6":"translate-x-0"}`})}),e.jsx("span",{className:`text-xs font-medium ${d==="auto"?"text-[#F0F6FC]":"text-[#484F58]"}`,children:"Auto"})]})]}),d==="auto"&&e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-[#3B82F6]/10 border border-[#3B82F6]/20",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-[#3B82F6] animate-pulse"}),e.jsx("p",{className:"text-xs text-[#93C5FD]",children:"Auto mode active â manual trade logging and account creation are disabled."})]})]}),e.jsxs("section",{className:"bg-[#161B22] rounded-xl p-6 border border-[#21262D] space-y-5",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(L,{className:"w-4 h-4 text-[#8B949E]"}),e.jsx("h2",{className:"text-sm font-bold text-[#8B949E] uppercase tracking-wider",children:"Connected Accounts"})]}),e.jsxs("div",{className:"flex items-center justify-between py-2",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-[#F0F6FC] font-semibold",children:"Chrome Extension"}),e.jsx("p",{className:"text-xs text-[#8B949E] mt-0.5",children:R?"Connected and syncing":"Not connected"})]}),R?e.jsxs("button",{onClick:Se,className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium text-[#EF4444] bg-[#EF4444]/10 border border-[#EF4444]/20 hover:bg-[#EF4444]/20 transition-colors",children:[e.jsx(he,{className:"w-3.5 h-3.5"}),"Disconnect"]}):e.jsx("span",{className:"text-xs text-[#484F58] font-medium",children:"Not connected"})]}),e.jsxs("div",{className:"py-2 border-t border-[#21262D] space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-[#F0F6FC] font-semibold",children:"NinjaTrader / Tradovate"}),e.jsx("p",{className:"text-xs text-[#8B949E] mt-0.5",children:"Connect any prop account on the Tradovate platform."})]}),e.jsxs("div",{className:"flex flex-col items-end gap-1",children:[e.jsxs("button",{onClick:async()=>{j(!0),f("");try{const t=await p.apiCall.invoke({url:"/api/v1/tradovate/auth/start",method:"GET"}),s=t==null?void 0:t.data;s!=null&&s.authorize_url?window.location.href=s.authorize_url:f("No authorize_url in response")}catch(t){const s=(t==null?void 0:t.message)||(t==null?void 0:t.detail)||"Failed to connect";f(s)}finally{j(!1)}},disabled:B,className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-bold text-[#F0F6FC] bg-[#21262D] hover:bg-[#30363D] border border-[#30363D] transition-colors disabled:opacity-50",children:[B?e.jsx(x,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx(L,{className:"w-3.5 h-3.5"}),"Connect"]}),q&&e.jsx("p",{className:"text-xs text-[#EF4444] max-w-[200px] text-right",children:q})]})]}),T.length>0&&e.jsx("div",{className:"space-y-2 pl-1",children:T.map(t=>e.jsxs("div",{className:`flex items-center justify-between py-2 px-3 rounded-lg bg-[#0D1117] border ${t.status==="reconnect_needed"?"border-[#F59E0B]/40":"border-[#21262D]"}`,children:[e.jsxs("div",{className:"flex items-center gap-2",children:[t.status==="active"?e.jsx("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded text-xs font-bold text-[#22C55E] bg-[#22C55E]/10 border border-[#22C55E]/20",children:e.jsx(pe,{className:"w-3 h-3"})}):e.jsx("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded text-xs font-bold text-[#F59E0B] bg-[#F59E0B]/10 border border-[#F59E0B]/20",children:e.jsx(E,{className:"w-3 h-3"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-[#F0F6FC] font-medium",children:t.organization_name}),t.status==="active"?e.jsxs("p",{className:"text-xs text-[#8B949E]",children:[t.account_count," account",t.account_count!==1?"s":""]}):e.jsx("p",{className:"text-xs text-[#F59E0B]",children:"Session expired â reconnect required"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[t.status==="reconnect_needed"&&e.jsxs("button",{onClick:async()=>{j(!0),f("");try{const s=await p.apiCall.invoke({url:"/api/v1/tradovate/auth/start",method:"GET"}),o=s==null?void 0:s.data;o!=null&&o.authorize_url&&(window.location.href=o.authorize_url)}catch(s){f((s==null?void 0:s.message)||"Failed to reconnect")}finally{j(!1)}},disabled:B,className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-lg text-xs font-bold text-[#F59E0B] bg-[#F59E0B]/10 border border-[#F59E0B]/20 hover:bg-[#F59E0B]/20 transition-colors disabled:opacity-50",children:[e.jsx(L,{className:"w-3 h-3"}),"Reconnect"]}),e.jsxs("button",{onClick:async()=>{try{await p.apiCall.invoke({url:`/api/v1/tradovate/disconnect?connection_id=${t.id}`,method:"DELETE"}),H(s=>s.filter(o=>o.id!==t.id))}catch(s){console.error("[Tradovate] Disconnect error:",s)}},className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-lg text-xs font-medium text-[#EF4444] bg-[#EF4444]/10 border border-[#
1EF4444]/20 hover:bg-[#EF4444]/20 transition-colors",children:[e.jsx(he,{className:"w-3 h-3"}),"Disconnect"]})]})]},t.id))}),C&&T.length>0&&e.jsxs("div",{className:"pt-3 border-t border-[#21262D] space-y-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-[#484F58] font-medium mb-2",children:"ð Accounts & Risk Status (Raw JSON)"}),ve?e.jsxs("div",{className:"flex items-center gap-2 py-2",children:[e.jsx(x,{className:"w-3.5 h-3.5 text-[#8B949E] animate-spin"}),e.jsx("span",{className:"text-xs text-[#8B949E]",children:"Loading accounts & risk status..."})]}):K?e.jsx("p",{className:"text-xs text-[#EF4444]",children:K}):V?e.jsx("div",{className:"max-h-[400px] overflow-auto rounded-lg border border-[#21262D] bg-[#0D1117]",children:e.jsx("pre",{className:"p-4 text-xs text-[#E6EDF3] font-mono whitespace-pre-wrap break-words",children:e.jsx("code",{children:JSON.stringify(V,null,2)})})}):e.jsx("p",{className:"text-xs text-[#8B949E]",children:"No data returned"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-[#484F58] font-medium mb-2",children:"ð Trade Data â Fills, Executions, Orders, Positions (Raw JSON)"}),we?e.jsxs("div",{className:"flex items-center gap-2 py-2",children:[e.jsx(x,{className:"w-3.5 h-3.5 text-[#8B949E] animate-spin"}),e.jsx("span",{className:"text-xs text-[#8B949E]",children:"Loading fills, executions, orders & positions..."})]}):ee?e.jsx("p",{className:"text-xs text-[#EF4444]",children:ee}):W?e.jsx("div",{className:"space-y-3",children:(me=W.connections)==null?void 0:me.map((t,s)=>e.jsxs("div",{className:"space-y-2",children:[e.jsxs("p",{className:"text-xs text-[#8B949E] font-semibold",children:["Connection: ",t.organization_name," (ID: ",t.connection_id,")"]}),e.jsxs("div",{children:[e.jsxs("p",{className:"text-xs text-[#22C55E] font-medium mb-1",children:["/fill/list (",Array.isArray(t.fills)?t.fills.length:0," items)"]}),e.jsx("div",{className:"max-h-[300px] overflow-auto rounded-lg border border-[#21262D] bg-[#0D1117]",children:e.jsx("pre",{className:"p-3 text-xs text-[#E6EDF3] font-mono whitespace-pre-wrap break-words",children:e.jsx("code",{children:JSON.stringify(t.fills,null,2)})})})]}),e.jsxs("div",{children:[e.jsxs("p",{className:"text-xs text-[#A78BFA] font-medium mb-1",children:["/execution/list (",Array.isArray(t.executions)?t.executions.length:0," items)"]}),e.jsx("div",{className:"max-h-[300px] overflow-auto rounded-lg border border-[#21262D] bg-[#0D1117]",children:e.jsx("pre",{className:"p-3 text-xs text-[#E6EDF3] font-mono whitespace-pre-wrap break-words",children:e.jsx("code",{children:JSON.stringify(t.executions,null,2)})})})]}),e.jsxs("div",{children:[e.jsxs("p",{className:"text-xs text-[#F59E0B] font-medium mb-1",children:["/order/list (",Array.isArray(t.orders)?t.orders.length:0," items)"]}),e.jsx("div",{className:"max-h-[300px] overflow-auto rounded-lg border border-[#21262D] bg-[#0D1117]",children:e.jsx("pre",{className:"p-3 text-xs text-[#E6EDF3] font-mono whitespace-pre-wrap break-words",children:e.jsx("code",{children:JSON.stringify(t.orders,null,2)})})})]}),e.jsxs("div",{children:[e.jsxs("p",{className:"text-xs text-[#60A5FA] font-medium mb-1",children:["/position/list (",Array.isArray(t.positions)?t.positions.length:0," items)"]}),e.jsx("div",{className:"max-h-[300px] overflow-auto rounded-lg border border-[#21262D] bg-[#0D1117]",children:e.jsx("pre",{className:"p-3 text-xs text-[#E6EDF3] font-mono whitespace-pre-wrap break-words",children:e.jsx("code",{children:JSON.stringify(t.positions,null,2)})})})]})]},s))}):e.jsx("p",{className:"text-xs text-[#8B949E]",children:"No trade data returned"})]})]})]})]}),e.jsxs("section",{className:"bg-[#161B22] rounded-xl p-6 border border-[#EF4444]/30 space-y-5",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(E,{className:"w-4 h-4 text-[#EF4444]"}),e.jsx("h2",{className:"text-sm font-bold text-[#EF4444] uppercase tracking-wider",children:"Danger Zone"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-[#F0F6FC] font-semibold",children:"Delete Account"}),e.jsx("p",{className:"text-xs text-[#8B949E] mt-1 leading-relaxed",children:"Permanently delete your account and all associated data including trading accounts, trade history, evaluation accounts, and settings. This action cannot be undone."})]}),e.jsxs("button",{onClick:()=>se(!0),className:"inline-flex items-center gap-2 px-4 py-2.5 rounded-lg bg-[#EF4444]/10 hover:bg-[#
1EF4444]/20 border border-[#EF4444]/30 text-[#EF4444] text-sm font-bold transition-colors",children:[e.jsx(E,{className:"w-4 h-4"}),"Delete My Account"]})]}),Fe&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 px-4",children:e.jsxs("div",{className:"bg-[#161B22] rounded-xl border border-[#EF4444]/30 p-6 w-full max-w-md space-y-5",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(E,{className:"w-5 h-5 text-[#EF4444]"}),e.jsx("h3",{className:"text-lg font-bold text-[#F0F6FC]",children:"Delete Account Permanently"})]}),e.jsxs("p",{className:"text-sm text-[#8B949E] leading-relaxed",children:["This will permanently delete your account and"," ",e.jsx("span",{className:"text-[#EF4444] font-semibold",children:"all your data"}),", including trading accounts, trade history, evaluation accounts, and settings. This cannot be undone."]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("label",{className:"text-xs text-[#8B949E] font-medium",children:["Type your email address to confirm:"," ",e.jsx("span",{className:"text-[#F0F6FC] font-bold",children:r==null?void 0:r.email})]}),e.jsx("input",{type:"email",value:N,onChange:t=>ae(t.target.value),placeholder:"Enter your email",className:"w-full px-3 py-2.5 rounded-lg bg-[#0D1117] border border-[#21262D] text-sm text-[#F0F6FC] placeholder-[#484F58] focus:outline-none focus:border-[#EF4444]/50",autoComplete:"off"})]}),re&&e.jsx("p",{className:"text-xs text-[#EF4444] font-medium",children:re}),e.jsxs("div",{className:"flex gap-3 pt-2",children:[e.jsx("button",{onClick:()=>{se(!1),ae(""),v("")},className:"flex-1 px-4 py-2.5 rounded-lg bg-[#21262D] hover:bg-[#30363D] text-sm font-medium text-[#F0F6FC] transition-colors",children:"Cancel"}),e.jsxs("button",{onClick:ke,disabled:!Te||A,className:"flex-1 px-4 py-2.5 rounded-lg bg-[#EF4444] hover:bg-[#DC2626] disabled:opacity-30 disabled:cursor-not-allowed text-white text-sm font-bold transition-colors flex items-center justify-center gap-2",children:[A&&e.jsx(x,{className:"w-4 h-4 animate-spin"}),A?"Deleting...":"Delete Forever"]})]})]})})]})}):null}export{Xe 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.