PageSourceSearch

https://c1-weath-dashboard-p-c3mn.bolt.host/assets/UserDetailPage-BoUZkrUN.js

js c1-weath-dashboard-p-c3mn.bolt.host collected 2026-10-03 03:10:39 UTC 25,556 bytes, 1 lines download raw bytes

1import{E as e,b as t,j as s,s as a}from"./index-ViVXbGAn.js";import{u as r,r as n,h as l}from"./vendor-DVAKy3y5.js";import{aD as i,a7 as c,d,b0 as o,z as m}from"./ui-D69y38GO.js";import"./supabase-DaBE6CgA.js";const u=s=>{return a=null,r=null,n=function*(){const a=new e,r=a.internal.pageSize.getWidth();a.internal.pageSize.getHeight();let n=20;try{const e="/assets/c1-logo.png",t=new Image;if(t.src=e,yield new Promise((e,s)=>{t.onload=e,t.onerror=()=>e(null),setTimeout(s,3e3)}).catch(()=>null),t.complete&&0!==t.naturalHeight){const e=40,s=t.naturalHeight/t.naturalWidth*e;a.addImage(t,"PNG",r-e-15,10,e,s)}}catch(i){}if(a.setFontSize(20),a.setFont("helvetica","bold"),a.text("User Account Report",15,n),n+=10,a.setFontSize(10),a.setFont("helvetica","normal"),a.setTextColor(100,100,100),a.text(`Generated: ${(new Date).toLocaleString()}`,15,n),n+=15,a.setFontSize(14),a.setFont("helvetica","bold"),a.setTextColor(0,0,0),a.text("User Information",15,n),n+=7,a.setFontSize(10),a.setFont("helvetica","normal"),[`UID: ${s.user.uid||"—"}`,`Name: ${s.user.username||""} ${s.user.lastname||""}`,`Email: ${s.user.email||"—"}`,`Status: ${s.user.status||"—"}`,`KYC Status: ${s.user.kyc_status||"—"}`,`Joined: ${x(s.user.date_joined||s.user.created_at)}`].forEach(e=>{a.text(e,15,n),n+=6}),n+=5,s.walletBalances.length>0&&(a.setFontSize(14),a.setFont("helvetica","bold"),a.text("Wallet Balances",15,n),n+=7,a.setFontSize(10),a.setFont("helvetica","normal"),s.walletBalances.forEach(e=>{a.text(`${(e.currency||"").toUpperCase()}: ${h(e.balance,e.currency)}`,15,n),n+=6}),n+=5),s.accumulationPool.length>0&&(g(a,n,30),a.setFontSize(14),a.setFont("helvetica","bold"),a.text("Accumulation Pool Balances",15,n),n+=7,a.setFontSize(10),a.setFont("helvetica","normal"),s.accumulationPool.forEach(e=>{a.text(`${(e.currency||"").toUpperCase()}: ${h(e.amount,e.currency)}`,15,n),n+=6}),n+=5),s.deposits.length>0){n=g(a,n,40),a.setFontSize(14),a.setFont("helvetica","bold"),a.text("Deposits",15,n),n+=7;const e=s.deposits.map(e=>[h(e.amount,e.currency),(e.currency||"").toUpperCase(),x(e.date)]);t(a,{startY:n,head:[["Amount","Currency","Date"]],body:e,theme:"striped",headStyles:{fillColor:[41,128,185]},margin:{left:15,right:15}}),n=a.lastAutoTable.finalY+10;const r=p(s.deposits);a.setFontSize(10),a.setFont("helvetica","bold"),Object.entries(r).forEach(([e,t])=>{a.text(`Total ${e}: ${t.toFixed(2)}`,15,n),n+=6}),n+=5}if(s.completedWithdrawals.length>0){n=g(a,n,40),a.setFontSize(14),a.setFont("helvetica","bold"),a.text("Completed Withdrawals",15,n),n+=7;const e=s.completedWithdrawals.map(e=>[h(e.amount,e.currency),(e.currency||"").toUpperCase(),x(e.withdrawal_date),e.status||"—"]);t(a,{startY:n,head:[["Amount","Currency","Date","Status"]],body:e,theme:"striped",headStyles:{fillColor:[39,174,96]},margin:{left:15,right:15}}),n=a.lastAutoTable.finalY+10;const r=p(s.completedWithdrawals);a.setFontSize(10),a.setFont("helvetica","bold"),Object.entries(r).forEach(([e,t])=>{a.text(`Total ${e}: ${t.toFixed(2)}`,15,n),n+=6}),n+=5}if(s.pendingWithdrawals.length>0){n=g(a,n,40),a.setFontSize(14),a.setFont("helvetica","bold"),a.text("Pending Withdrawals",15,n),n+=7;const e=s.pendingWithdrawals.map(e=>[h(e.amount,e.currency),(e.currency||"").toUpperCase(),x(e.withdrawal_date),e.status||"—"]);t(a,{startY:n,head:[["Amount","Currency","Date","Status"]],body:e,theme:"striped",headStyles:{fillColor:[241,196,15]},margin:{left:15,right:15}}),n=a.lastAutoTable.finalY+10}if(s.activeProducts.length>0){n=g(a,n,40),a.setFontSize(14),a.setFont("helvetica","bold"),a.text("Active Product Investments",15,n),n+=7;const e=s.activeProducts.map(e=>[e.product_name||e.product_id||"—",h(e.amount||0,e.currency),(e.currency||"").toUpperCase(),x(e.invest_date),e.status||"active"]);t(a,{startY:n,head:[["Product","Amount","Currency","Invest Date","Status"]],body:e,theme:"striped",headStyles:{fillColor:[52,152,219]},margin:{left:15,right:15}}),n=a.lastAutoTable.finalY+10;const r=p(s.activeProducts);a.setFontSize(10),a.setFont("helvetica","bold"),Object.entries(r).forEach(([e,t])=>{a.text(`Total ${e}: ${t.toFixed(2)}`,15,n),n+=6}),n+=5}if(s.expiredProducts.length>0){n=g(a,n,40),a.setFontSize(14),a.setFont("helvetica","bold"),a.text("Expired/Matured Product Investments",15,n),n+=
17;const e=s.expiredProducts.map(e=>[e.product_name||e.product_id||"—",h(e.amount||0,e.currency),(e.currency||"").toUpperCase(),x(e.expire_date),e.status||"expired"]);t(a,{startY:n,head:[["Product","Amount","Currency","Expire Date","Status"]],body:e,theme:"striped",headStyles:{fillColor:[231,76,60]},margin:{left:15,right:15}}),n=a.lastAutoTable.finalY+10}if(s.returns.length>0){n=g(a,n,40),a.setFontSize(14),a.setFont("helvetica","bold"),a.text("Returns",15,n),n+=7;const e=s.returns.map(e=>[e.product||e.planid||"—",h(e.accumulation_portion||0,e.currency),h(e.wallet_portion||0,e.currency),(e.currency||"").toUpperCase()||"—",x(e.date)]);t(a,{startY:n,head:[["Product","Accumulation","Wallet Portion","Currency","Date"]],body:e,theme:"striped",headStyles:{fillColor:[155,89,182]},margin:{left:15,right:15}}),n=a.lastAutoTable.finalY+10}if(s.maturedTxs.length>0){n=g(a,n,40),a.setFontSize(14),a.setFont("helvetica","bold"),a.text("Matured Product Transactions",15,n),n+=7;const e=s.maturedTxs.map(e=>[e.product_name||"—",x(e.occurred_at,!0),h(e.principal,e.currency),h(e.accumulation,e.currency),h(e.amount,e.currency),(e.currency||"").toUpperCase()]);t(a,{startY:n,head:[["Product","Occurred At","Principal","Accumulation","Amount","Currency"]],body:e,theme:"striped",headStyles:{fillColor:[52,73,94]},margin:{left:15,right:15}}),n=a.lastAutoTable.finalY+10}if(s.exchangeHistory.length>0){n=g(a,n,40),a.setFontSize(14),a.setFont("helvetica","bold"),a.text("Exchange History",15,n),n+=7;const e=s.exchangeHistory.map(e=>[h(e.from_amount||0,e.from_currency),(e.from_currency||"").toUpperCase()||"—",h(e.to_amount||0,e.to_currency),(e.to_currency||"").toUpperCase()||"—",h(e.fee||0,e.from_currency),x(e.exchange_date),e.status||"—"]);t(a,{startY:n,head:[["From Amount","From Curr","To Amount","To Curr","Fee","Date","Status"]],body:e,theme:"striped",headStyles:{fillColor:[26,188,156]},margin:{left:15,right:15},styles:{fontSize:8}}),n=a.lastAutoTable.finalY+10}n=g(a,n,30),a.setFontSize(8),a.setTextColor(150,150,150),a.text("This is an official document generated by C1 Wealth Management System",15,n),a.text(`Report ID: ${s.user.uid}-${Date.now()}`,15,n+5);const l=`User_Report_${s.user.username}_${s.user.lastname}_${(new Date).toISOString().split("T")[0]}.pdf`;a.save(l)},new Promise((e,t)=>{var s=e=>{try{i(n.next(e))}catch(s){t(s)}},l=e=>{try{i(n.throw(e))}catch(s){t(s)}},i=t=>t.done?e(t.value):Promise.resolve(t.value).then(s,l);i((n=n.apply(a,r)).next())});var a,r,n},x=(e,t=!1)=>{if(!e)return"—";const s=new Date(e);return isNaN(s.getTime())?"—":t?s.toLocaleString():s.toLocaleDateString()},h=(e,t)=>{const s="BTC"===(t||"").toUpperCase(),a=Number(e||0);return new Intl.NumberFormat("en-US",{minimumFractionDigits:s?8:2,maximumFractionDigits:s?8:2}).format(a)},p=(e,t="amount")=>{const s={};return e.forEach(e=>{const a=(e.currency||"Unknown").toUpperCase(),r=parseFloat(e[t])||0;s[a]=(s[a]||0)+r}),s},g=(e,t,s)=>t+s>e.internal.pageSize.getHeight()-20?(e.addPage(),20):t;var y=Object.defineProperty,b=Object.defineProperties,j=Object.getOwnPropertyDescriptors,f=Object.getOwnPropertySymbols,N=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable,v=(e,t,s)=>t in e?y(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,_=(e,t,s)=>new Promise((a,r)=>{var n=e=>{try{i(s.next(e))}catch(t){r(t)}},l=e=>{try{i(s.throw(e))}catch(t){r(t)}},i=e=>e.done?a(e.value):Promise.resolve(e.value).then(n,l);i((s=s.apply(e,t)).next())});const F=({uid:e})=>{const t=r(),[l,x]=n.useState(!0),[h,p]=n.useState(null),[g,y]=n.useState([]),[F,S]=n.useState([]),[C,P]=n.useState([]),[U,D]=n.useState([]),[A,T]=n.useState([]),[k,z]=n.useState([]),[$,E]=n.useState([]),[I,O]=n.useState([]),[W,Y]=n.useState([]),[q,B]=n.useState([]),[H,L]=n.useState(null),[M,R]=n.useState(!1),[G,J]=n.useState(null);n.useEffect(()=>{_(null,null,function*(){x(!0);const{data:{user:t}}=yield a.auth.getUser();(null==t?void 0:t.email)&&J(t.email);const[s,r,n,l,i,c,d,o,m,u]=yield Promise.all([a.from("users").select("*").eq("uid",e).maybeSingle(),a.from("deposits").select("*").eq("uid",e).order("date",{ascending:!1}),a.from("all_withdrawals").select("*").eq("uid",e).order("withdrawal_date",{ascending:!1}),a.from("wallet_balances").select("*").eq("uid",e),a.from("accumulation_pool").select("*").eq("uid",e),a.from("product_investments").select("*").eq("uid",e).order("invest_date",{ascending:!1}),a.from("client_returns").select("*").eq("uid",e).order("date",{ascending:!1}),a.from("exchange_history").select("*").eq("uid",e).order("exchange_date",{ascending:!1}),a.from("matured_product_transactions").select("*").eq("uid",e).order("occurred_at",{ascending:!1}),a.from("user_product_access").select("*").eq("uid",e).eq("product_id","68").maybeSingle()]);if(s.error||p(s.data),r.error||y(r.data||[]),!n.error){const e=n.data||[],t=(e="")=>e.toLowerCase(),s=e.filter(e=>["completed","approved","paid","success"].includes(t(e.status))),a=e.filter(e=>["pending","processing","in_progress"].includes(t(e.status))),r=e.filter(e=>["cancelled","canceled","failed","rejected"].includes(t(e.status)));E(s),O(a),Y(r)}l.error||S(l.data||[]),i.error||P(i.data||[]),c.error||D(c.data||[]),d.error||T(d.data||[]),o.error||B(o.data||[]),m.error||z(m.data||[]),u.error||L(u.data),x(!1)})},[e]);const K=(e,t=!1)=>
1{if(!e)return"—";const s=new Date(e);return isNaN(s.getTime())?"—":t?s.toLocaleString():s.toLocaleDateString()},Q=e=>{const t=(e.status||"").toLowerCase();if(t){if(["expired","matured","closed","finished"].includes(t))return!0;if(["active","running","open","invested"].includes(t))return!1}if(e.expire_date){const t=new Date(e.expire_date);if(!isNaN(t.getTime()))return t.getTime()<Date.now()}return!1},V=n.useMemo(()=>U.filter(e=>!Q(e)),[U]),X=n.useMemo(()=>U.filter(e=>Q(e)),[U]),Z=(e,t="amount")=>{const s={};return e.forEach(e=>{const a=(e.currency||"Unknown").toUpperCase(),r=parseFloat(e[t])||0;s[a]=(s[a]||0)+r}),s},ee=e=>s.jsx("div",{className:"mt-2 text-sm font-semibold space-y-1",children:Object.entries(e).map(([e,t])=>s.jsxs("div",{children:["Total (",e,"): ",t.toFixed(2)]},e))}),te=(e,t)=>{const s="BTC"===(t||"").toUpperCase(),a=Number(e||0);return new Intl.NumberFormat("en-US",{minimumFractionDigits:s?8:2,maximumFractionDigits:s?8:2}).format(a)},se=()=>_(null,null,function*(){if(!G)return void m.error("Unable to identify admin user");const t=null==H?void 0:H.is_active,s=t?"disable":"enable",r=t?"Disable access to Commodity Arbitrage Fund? User will no longer see this product option.":"Enable Commodity Arbitrage Fund for this user? Minimum investment: $30,000";if(window.confirm(r)){R(!0);try{if(H){const{error:e}=yield a.from("user_product_access").update({is_active:!t,enabled_by_admin_email:G,enabled_at:(new Date).toISOString()}).eq("id",H.id);if(e)throw e;L((n=((e,t)=>{for(var s in t||(t={}))N.call(t,s)&&v(e,s,t[s]);if(f)for(var s of f(t))w.call(t,s)&&v(e,s,t[s]);return e})({},H),l={is_active:!t,enabled_by_admin_email:G,enabled_at:(new Date).toISOString()},b(n,j(l))))}else{const{data:t,error:s}=yield a.from("user_product_access").insert({uid:e,product_id:"68",enabled_by_admin_email:G,is_active:!0}).select().single();if(s)throw s;L(t)}m.success(`Commodity Arbitrage Fund ${s}d successfully!`)}catch(i){m.error(`Failed to ${s} product access: ${i.message}`)}finally{R(!1)}var n,l}});return l?s.jsx("div",{className:"text-center py-10",children:"Loading user data..."}):h?s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex gap-3 flex-wrap",children:[s.jsx("button",{onClick:()=>t("/admin"),className:"bg-blue-600 text-white px-4 py-2 rounded hover:bg-blue-700 transition",children:"← Back to Admin Dashboard"}),s.jsxs("button",{onClick:()=>_(null,null,function*(){try{m.loading("Generating PDF...",{id:"pdf-generation"}),yield u({user:h,deposits:g,completedWithdrawals:$,pendingWithdrawals:I,cancelledWithdrawals:W,walletBalances:F,accumulationPool:C,activeProducts:V,expiredProducts:X,returns:A,maturedTxs:k,exchangeHistory:q}),m.success("PDF generated successfully!",{id:"pdf-generation"})}catch(e){m.error("Failed to generate PDF",{id:"pdf-generation"})}}),className:"bg-green-600 text-white px-4 py-2 rounded hover:bg-green-700 transition flex items-center gap-2",children:[s.jsx(i,{size:18}),"Generate PDF Report"]})]}),s.jsxs("section",{className:"bg-gradient-to-r from-amber-50 to-orange-50 dark:bg-gradient-to-r dark:from-amber-900/20 dark:to-orange-900/20 p-6 rounded-xl shadow-lg border-2 border-amber-500",children:[s.jsxs("h2",{className:"text-xl font-bold mb-4 flex items-center text-amber-900 dark:text-amber-100",children:[s.jsx(c,{className:"h-6 w-6 mr-2 text-amber-600"}),"Special Products Access Control"]}),s.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg p-5 shadow-md",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx("h3",{className:"font-medium text-gray-900 dark:text-white",children:"Commodity Arbitrage Fund"}),s.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 mt-1",children:"Exclusive product - $30,000 minimum • 12 months • 100% wallet returns"}),(null==H?void 0:H.is_active)&&s.jsxs("div",{className:"mt-2 text-xs text-gray-500",children:[s.jsxs("p",{children:["Enabled: ",K(H.enabled_at,!0)]}),(H.enabled_by_admin_email||H.enabled_by_admin_uid)&&s.jsxs("p",{children:["By Admin: ",H.enabled_by_admin_email||H.enabled_by_admin_uid]})]}),(()=>{const e=V.filter(e=>"68"===e.product_id),t=e.reduce((e,t)=>
1e+parseFloat(String(t.amount||0)),0);return e.length>0?s.jsx("div",{className:"mt-2 bg-green-100 dark:bg-green-900/30 rounded px-2 py-1",children:s.jsxs("p",{className:"text-xs text-green-800 dark:text-green-300 font-medium",children:["Active Investments: ",e.length," | Total: ",te(t,"USDT")," USDT"]})}):null})()]}),s.jsx("div",{className:"ml-4 flex items-center gap-3",children:(null==H?void 0:H.is_active)?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-2 bg-green-100 dark:bg-green-900/30 px-4 py-2 rounded-lg",children:[s.jsx("div",{className:"h-2 w-2 rounded-full bg-green-600 animate-pulse"}),s.jsx("span",{className:"font-medium text-green-800 dark:text-green-300",children:"Enabled"})]}),s.jsx("button",{onClick:se,disabled:M,className:"px-4 py-2 rounded-lg font-medium transition-all duration-200 flex items-center gap-2 bg-red-600 hover:bg-red-700 text-white "+(M?"opacity-50 cursor-not-allowed":""),children:M?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-2 border-white border-t-transparent"}),"Processing..."]}):s.jsxs(s.Fragment,{children:[s.jsx(d,{className:"h-4 w-4"}),"Disable"]})})]}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-2 bg-gray-100 dark:bg-gray-700 px-4 py-2 rounded-lg",children:[s.jsx("div",{className:"h-2 w-2 rounded-full bg-gray-400"}),s.jsx("span",{className:"font-medium text-gray-600 dark:text-gray-400",children:"Disabled"})]}),s.jsx("button",{onClick:se,disabled:M,className:"px-4 py-2 rounded-lg font-medium transition-all duration-200 flex items-center gap-2 bg-green-600 hover:bg-green-700 text-white "+(M?"opacity-50 cursor-not-allowed":""),children:M?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-2 border-white border-t-transparent"}),"Processing..."]}):s.jsxs(s.Fragment,{children:[s.jsx(o,{className:"h-4 w-4"}),"Enable"]})})]})})]})})]}),s.jsxs("section",{className:"bg-white dark:bg-gray-800 p-4 rounded shadow",children:[s.jsx("h2",{className:"text-lg font-semibold mb-2",children:"User Information"}),s.jsxs("p",{children:[s.jsx("strong",{children:"UID:"})," ",h.uid]}),s.jsxs("p",{children:[s.jsx("strong",{children:"Name:"})," ",h.username," ",h.lastname]}),s.jsxs("p",{children:[s.jsx("strong",{children:"Email:"})," ",h.email]}),s.jsxs("p",{children:[s.jsx("strong",{children:"Status:"})," ",h.status]}),s.jsxs("p",{children:[s.jsx("strong",{children:"KYC:"})," ",h.kyc_status]}),s.jsxs("p",{children:[s.jsx("strong",{children:"Joined:"})," ",K(h.date_joined||h.created_at)]})]}),s.jsxs("section",{className:"bg-white dark:bg-gray-800 p-4 rounded shadow",children:[s.jsx("h2",{className:"text-lg font-semibold mb-2",children:"Wallet Balances"}),F.length>0?F.map(e=>s.jsxs("p",{children:[s.jsxs("strong",{children:[(e.currency||"").toUpperCase(),":"]})," ",te(e.balance,e.currency)]},e.id)):s.jsx("p",{className:"text-gray-500",children:"No wallet balances"})]}),s.jsxs("section",{className:"bg-white dark:bg-gray-800 p-4 rounded shadow",children:[s.jsx("h2",{className:"text-lg font-semibold mb-2",children:"Accumulation Pool Balances"}),C.length>0?C.map(e=>s.jsxs("p",{children:[s.jsxs("strong",{children:[(e.currency||"").toUpperCase(),":"]})," ",te(e.amount,e.currency)]},e.id)):s.jsx("p",{className:"text-gray-500",children:"No accumulation pool balances"})]}),s.jsxs("section",{className:"bg-white dark:bg-gray-800 p-4 rounded shadow",children:[s.jsx("h2",{className:"text-lg font-semibold mb-2",children:"Deposits"}),s.jsx("ul",{className:"list-disc list-inside",children:g.map(e=>s.jsxs("li",{children:[te(e.amount,e.currency)," ",(e.currency||"").toUpperCase()," - ",K(e.date)]},e.id))}),ee(Z(g))]}),s.jsxs("section",{className:"bg-white dark:bg-gray-800 p-4 rounded shadow",children:[s.jsx("h2",{className:"text-lg font-semibold mb-2",children:"Withdrawals"}),s.jsx("h3",{className:"text-md font-semibold mt-2",children:"Completed"}),$.length?s.jsxs(s.Fragment,{children:[s.jsx("ul",{className:"list-disc list-inside",children:$.map(e=>s.jsxs("li",{children:[te(e.amount,e.currency)," ",(e.currency||"").toUpperCase()," – ",K(e.withdrawal_date)," •"," ",s.jsx("span",{className:"text-green-600 capitalize",children:e.status})]},e.id))}),ee(Z($))]}):s.jsx("p",{className:"text-gray-500",children:"No completed withdrawals"}),s.jsx("h3",{className:"text-md font-semibold mt-4",children:"Pending / Processing"}),I.length?s.jsxs(s.Fragment,{children:[s.jsx("ul",{className:"list-disc list-inside",children:I.map(e=>s.jsxs("li",{children:[te(e.amount,e.currency)," ",(e.currency||"").toUpperCase()," – ",K(e.withdrawal_date)," •"," ",s.jsx("span",{className:"text-yellow-600 capitalize",children:e.status})]},e.id))}),ee(Z(I))]}):s.jsx("p",{className:"text-gray-500",children:"No pending withdrawals"}),s.jsx("h3",{className:"text-md font-semibold mt-4",children:"Cancelled / Failed"}),W.length?s.jsxs(s.Fragment,{children:[s.jsx("ul",{className:"list-disc list-inside",children:W.map(e=>s.jsxs("li",{children:[te(e.amount,e.currency)," ",(e.currency||"").toUpperCase()," – ",K(e.withdrawal_date)," •"," ",s.jsx("span",{className:"text-red-600 capitalize",children:e.status})]},e.id))}),ee(Z(W))]}):s.jsx("p",{className:"text-gray-500",children:"No cancelled/failed withdrawals"})]}),s.jsxs("section",{className:"bg-white dark:bg-gray-800 p-4 rounded shadow",children:[s.jsx("h2",{className:"text-lg font-semibold mb-2",children:"Product Investments"}),s.jsx("h3",{className:"text-md font-semibold mt-2",children:"Active"}),V.length?s.jsxs(s.Fragment,{children:[s.jsx("ul",{className:"list-disc list-inside",children:V.map(e=>s.jsxs("li",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx("div",{className:"font-medium",children:e.product_name||e.product_id||"—"}),s.jsxs("div",{className:"text-sm text-gray-500",children:[te(e.amount||0,e.currency)," ",(e.currency||"").toUpperCase()," • ",K(e.invest_date)]})]}),s.jsx("div",{children:s.jsx("span",{className:"px-2 py-1 text-xs rounded-full bg-green-100 text-green-800 capitalize",children:e.status||"active"})})]},e.id))}),ee(Z(V))]}):s.jsx("p",{className:"text-gray-500",children:"No active product investments"}),s.jsx("h3",{className:"text-md font-semibold mt-4",children:"Expired / Matured"}),X.length?s.jsxs(s.Fragment,{children:[s.jsx("ul",{className:"list-disc list-inside",children:X.map(e=>s.jsxs("li",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx("div",{className:"font-medium",children:e.product_name||e.product_id||"—"}),s.jsxs("div",{className:"text-sm text-gray-500",children:[te(e.amount||0,e.currency)," ",(e.currency||"").toUpperCase()," • Expires: ",K(e.expire_date)]})]}),s.jsx("div",{children:s.jsx("span",{className:"px-2 py-1 text-xs rounded-full bg-red-100 text-red-800 capitalize",children:e.status||"expired"})})]},e.id))}),ee(Z(X))]}):s.jsx("p",{className:"text-gray-500",children:"No expired/matured product investments"})]}),s.jsxs("section",{className:"bg-white dark:bg-gray-800 p-4 rounded shadow",children:[s.jsx("h2",{className:"text-lg font-semibold mb-2",children:"Returns"}),A.length?s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"min-w-full text-sm",children:[s.jsx("thead",{className:"bg-gray-50 dark:bg-gray-700",children:s.jsxs("tr",{children:[s.jsx("th",{className:"px-3 py-2 text-left",children:"Product"}),s.jsx("th",{className:"px-3 py-2 text-left",children:"Accumulation Portion"}),s.jsx("th",{className:"px-3 py-2 text-left",children:"Wallet Portion"}),s.jsx("th",{className:"px-3 py-2 text-left",children:"Currency"}),s.jsx("th",{className:"px-3 py-2 text-left",children:"Date"})]})}),s.jsx("tbody",{children:A.map(e=>s.jsxs("tr",{className:"border-t",children:[s.jsx("td",{className:"px-3 py-2",children:e.product||e.planid||"—"}),s.jsx("td",{className:"px-3 py-2",children:te(e.accumulation_portion||0,e.currency)}),s.jsx("td",{className:"px-3 py-2",children:te(e.wallet_portion||0,e.currency)}),s.jsx("td",{className:"px-3 py-2",children:(e.currency||"").toUpperCase()||"—"}),s.jsx("td",{className:"px-3 py-2",children:K(e.date)})]},e.id))})]})}):s.jsx("p",{className:"text-gray-500",children:"No returns found"})]}),s.jsxs("section",{className:"bg-white dark:bg-gray-800 p-4 rounded shadow",children:[s.jsx("h2",{className:"text-lg font-semibold mb-2",children:"Matured Product Transactions"}),k.length?s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"min-w-full text-sm",children:[s.jsx("thead",{className:"bg-gray-50 dark:bg-gray-700",children:s.jsxs("tr",{children:[s.jsx("th",{className:"px-3 py-2 text-left",children:"Product Name"}),s.jsx("th",{className:"px-3 py-2 text-left",children:"Occurred At"}),s.jsx("th",{className:"px-3 py-2 text-left",children:"Principal"}),s.jsx("th",{className:"px-3 py-2 text-left",children:"Accumulation"}),s.jsx("th",{className:"px-3 py-2 text-left",children:"Amount"}),s.jsx("th",{className:"px-3 py-2 text-left",children:"Currency"})]})}),s.jsx("tbody",{children:k.map(e=>s.jsxs("tr",{className:"border-t",children:[s.jsx("td",{className:"px-3 py-2",children:e.product_name||"—"}),s.jsx("td",{className:"px-3 py-2",children:K(e.occurred_at,!0)}),s.jsx("td",{className:"px-3 py-2",children:te(e.principal,e.currency)}),s.jsx("td",{className:"px-3 py-2",children:te(e.accumulation,e.currency)}),s.jsx("td",{className:"px-3 py-2",children:te(e.amount,e.currency)}),s.jsx("td",{className:"px-3 py-2",children:(e.currency||"").toUpperCase()})]},e.id))})]})}):s.jsx("p",{className:"text-gray-500",children:"No matured product transactions"})]}),s.jsxs("section",{className:"bg-white dark:bg-gray-800 p-4 rounded shadow",children:[s.jsx("h2",{className:"text-lg font-semibold mb-2",children:"Exchange History"}),q.length?s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"min-w-full text-sm",children:[s.jsx("thead",{className:"bg-gray-50 dark:bg-gray-700",children:s.jsxs("tr",{children:[s.jsx("th",{className:"px-3 py-2 text-left",children:"From Amount"}),s.jsx("th",{className:"px-3 py-2 text-left",children:"From Currency"}),s.jsx("th",{className:"px-3 py-2 text-left",children:"To Amount"}),s.jsx("th",{className:"px-3 py-2 text-left",children:"To Currency"}),s.jsx("th",{className:"px-3 py-2 text-left",children:"Fee"}),s.jsx("th",{className:"px-3 py-2 text-left",children:"Paid Out"}),s.jsx("th",{className:"px-3 py-2 text-left",children:"Exchange Date"}),s.jsx("th",{className:"px-3 py-2 text-left",children:"Status"})]})}),s.jsx("tbody",{children:q.map(e=>{var t,a;return s.jsxs("tr",{className:"border-t",children:[s.jsx("td",{className:"px-3 py-2",children:te(e.from_amount||0,e.from_currency)}),s.jsx("td",{className:"px-3 py-2",children:(e.from_currency||"").toUpperCase()||"—"}),s.jsx("td",{className:"px-3 py-2",children:te(e.to_amount||0,e.to_currency)}),s.jsx("td",{className:"px-3 py-2",children:(e.to_currency||"").toUpperCase()||"—"}),s.jsx("td",{className:"px-3 py-2",children:te(e.fee||0,e.from_currency)}),s.jsx("td",{className:"px-3 py-2",children:te(null!=(a=null!=(t=e.paid_out)?t:e.paid_out_amount)?a:0,e.to_currency)}),s.jsx("td",{className:"px-3 py-2",children:K(e.exchange_date)}),s.jsx("td",{className:"px-3 py-2 capitalize",children:e.status||"—"})]},e.id)})})]})}):s.jsx("p",{className:"text-gray-500",children:"No exchange history"})]})]}):s.jsx("div",{className:"text-red-500",children:"User not found"})},S=()=>{const{uid:e}=l();return e?s.jsxs("div",{className:"p-4",children:[s.jsx("h1",{className:"text-2xl font-semibold mb-4",children:"User Details"}),s.jsx(F,{uid:e})]}):s.jsx("div",{className:"p-4 text-red-600",children:"No UID provided"})};export{S 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.