PageSourceSearch

https://cradermind.com/assets/Dashboard-CWbH6lQ_.js

js cradermind.com collected 2026-10-02 01:26:34 UTC 276,929 bytes, 7 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-s4pQ6CCP.css"])))=>i.map(i=>d[i]);
2import{r as s,j as e,b as Ge,R as Ve,a as vr,L as Ot,f as jr,_ as He}from"./vendor-react-BPv6TnFg.js";import{f as kr,s as v,X as Re,u as Ze,h as nr,d as yt,L as gt,i as $t,c as ft,j as Ut,k as wr,M as Wt,l as Xe,C as Vt}from"./index-CjMpuxY_.js";import{C as Nr}from"./ChartImageModal-s28Sn0wc.js";import{C as vt}from"./chevron-left-DgzP6gvr.js";import{B as lr}from"./bell-BYFTqvsp.js";import{T as wt}from"./trending-up-E0ZxCj4S.js";import{T as or}from"./trending-down-Bsub037_.js";import{C as De}from"./chevron-right-D1krafTt.js";import{L as _r}from"./layers-BvJVS3PJ.js";import{C as Gt}from"./chart-no-axes-column-DF9dEdKW.js";import{S as Cr}from"./send-D6bX1xJB.js";import{P as Sr}from"./pen-line-B2z5kfrs.js";import{C as Ir}from"./circle-check-big-WQ8c21bC.js";import{C as Er}from"./circle-plus-C0PJOYb9.js";import{T as ir}from"./target-BYhCgQGT.js";import{S as Ar}from"./shield-CizWUd_J.js";import{C as Tr}from"./circle-x-DmlWxEwt.js";import{T as zr}from"./trophy-7owhF6ZY.js";import{u as Qe}from"./useIsFreeUser-BxzC4pLv.js";import{T as cr,r as qt,a as Lr,m as lt,s as ot,t as dr,c as gr,b as mr,h as Mt,d as xr,e as Ke,D as Pr}from"./DailyReportModal-kxZq5ahU.js";import{S as it}from"./star-DtHeAobR.js";import{S as ct}from"./save-DjynxUFd.js";import{S as dt}from"./square-pen-CKfoKclF.js";import{T as ur}from"./trash-pBF6ZdnJ.js";import{T as Dr}from"./trash-2-DG4kpofm.js";import{C as Mr}from"./circle-question-mark-B3CG5l3y.js";import{V as hr}from"./video-91vWeBbo.js";import{u as Or}from"./useCoreTradePrices-Cut3H9f-.js";import{E as pr}from"./EntryDistanceBadge-DAUbMwGG.js";import{L as $r}from"./lightbulb-DVOptFIH.js";import{S as br}from"./sparkles-DQMHwkeS.js";import{P as qr}from"./play-DmC2bzUf.js";import{u as Fr}from"./useLivePrices-C83Uwmg1.js";import{F as Br}from"./flame-BjhunUvl.js";import{T as Rr}from"./ticket-DsOwJk2U.js";import{r as Ur}from"./stripePortal-BcRgzTTD.js";import{P as Lt}from"./ProOverlay-CHYw1Kim.js";import{S as Wr}from"./SEO-COr7ut9T.js";import{a as Vr}from"./telegram-CcaKIj7Z.js";import{C as Ht}from"./chart-column-C4kY0q3o.js";import{D as Gr}from"./dollar-sign-DHvG2mwn.js";import{R as Hr}from"./repeat-BuqUvGhf.js";import{C as Xt}from"./calculator-BtUf9Sxc.js";import{N as Xr}from"./newspaper-BDy3rpe2.js";import{B as Jr}from"./book-open-B7y7RQZl.js";import{C as Yr}from"./clock-XjjXrK8y.js";import{F as Kr}from"./funnel-Oxh7D9tC.js";import{S as Zr}from"./search-Dx_Vf7QJ.js";import{T as Pt}from"./triangle-alert-DciQAs-Z.js";import"./check-Bw1x4fK5.js";import"./copy-D-EwS5Ki.js";import"./CommentsSection-DrZwEWpP.js";import"./ReportModal-_tjB7Ptr.js";import"./user-DBCLKGPG.js";import"./flag-Qm7xmD0J.js";import"./heart-Dgl_4QBx.js";import"./reply-D_f_RyDV.js";import"./LikeButton-BSsw5P_M.js";import"./index-l0sNRNKZ.js";import"./UpgradePromoModal-Dw2TzShs.js";import"./loader-circle-BeFOVUOQ.js";import"./arrow-right-xPl6LD6m.js";/**
3 * @license lucide-react v0.525.0 - ISC
4 *
5 * This source code is licensed under the ISC license.
6 * See the LICENSE file in the root directory of this source tree.
7 */const Qr=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742",key:"178tsu"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05",key:"1hqiys"}]],ea=kr("bell-off",Qr),ta=[{key:"custom",label:"Eigene Nachricht",icon:e.jsx(Sr,{className:"w-5 h-5"}),color:"text-gray-500",defaultMessage:""},{key:"entry_picked",label:"Entry Abgeholt",icon:e.jsx(Ir,{className:"w-5 h-5"}),color:"text-green-500",defaultMessage:"Entry abgeholt"},{key:"rebuy",label:"Rebuy Abgeholt",icon:e.jsx(Er,{className:"w-5 h-5"}),color:"text-bronze-500",defaultMessage:"Rebuy {n} abgeholt"},{key:"tp",label:"TP Erreicht",icon:e.jsx(ir,{className:"w-5 h-5"}),color:"text-green-500",defaultMessage:"Take Profit {n} erreicht"},{key:"sl_adjusted",label:"SL Angepasst",icon:e.jsx(Ar,{className:"w-5 h-5"}),color:"text-yellow-500",defaultMessage:"Stop Loss angepasst"},{key:"sl_hit",label:"SL Erreicht",icon:e.jsx(Tr,{className:"w-5 h-5"}),color:"text-red-500",defaultMessage:"Stop Loss erreicht"},{key:"trade_ended",label:"Trade Beendet",icon:e.jsx(zr,{className:"w-5 h-5"}),color:"text-bronze-500",defaultMessage:"Trade erfolgreich beendet - Gratulation!"}],Jt=[1,2,3,4,5,6,7,8,9];function Ft({isOpen:n,onClose:c,asset:o}){const[g,b]=s.useState("select_target"),[w,R]=s.useState([]),[G,u]=s.useState([]),[U,N]=s.useState(!0),[C,T]=s.useState(null),[Y,W]=s.useState(null),[L,M]=s.useState(!1),[S,me]=s.useState(null),[be,xe]=s.useState(null),[V,k]=s.useState(Jt),[P,_]=s.useState(""),[F,D]=s.useState(!1);s.useEffect(()=>{n&&(j(),I(),b("select_target"),T(null),W(null),M(!1),me(null),xe(null),k(Jt),_(""))},[n,o.symbol]);const j=async()=>{N(!0);try{const{data:m,error:J}=await v.from("trading_ideas").select("*").eq("coin_symbol",o.symbol).eq("status","ACTIVE").order("created_at",{ascending:!1});if(J)throw J;R(m||[])}catch(m){console.error("Error loading trading ideas:",m),R([])}finally{N(!1)}},I=async()=>{try{const{data:m,error:J}=await v.from("compounding_trades").select("id, symbol, name, entry_price, phase_view, chart_link, status").eq("symbol",o.symbol).eq("status","active").order("sort_order",{ascending:!0});if(J)throw J;u(m||[])}catch(m){console.error("Error loading compounding trades:",m),u([])}},q=m=>{T(m),W(null),M(!1),b("select_template")},oe=m=>{W(m),T(null),M(!1),b("select_template")},ue=()=>{T(null),M(!0),me({key:"livechart",label:"Live Chart Update",icon:e.jsx(Gt,{className:"w-5 h-5"}),color:"text-yellow-500",defaultMessage:"Live Chart updated"}),_("Live Chart bei ".concat(o.symbol," updated")),b("edit_message")},h=m=>{me(m),m.key==="rebuy"||m.key==="tp"?(xe(null),b("edit_message")):(_(m.defaultMessage||""),b("edit_message"))},O=m=>{xe(m);const J=(S==null?void 0:S.defaultMessage.replace("{n}",m.toString()))||"";_(J)},Q=()=>{g==="edit_message"?b(L?"select_target":"select_template"):g==="select_template"&&b("select_target")},K=async()=>
7{if(!P.trim()){alert("Please enter a message");return}D(!0);try{if(C){const m={entry_picked:"entry_picked",rebuy:"rebuy_picked",tp:"tp_reached",sl_adjusted:"sl_adjusted",sl_hit:"sl_hit",trade_ended:"trade_ended",custom:"custom_message"},J=S!=null&&S.key&&m[S.key]||"idea_adjusted",{error:he}=await v.from("trading_idea_notification_queue").insert({trading_idea_id:C.id,notification_type:J,level_value:P.trim()});if(he)throw console.error("Error inserting into queue:",he),new Error("Failed to queue notification: ".concat(he.message));if((S==null?void 0:S.key)==="entry_picked"){const{error:fe}=await v.from("trading_ideas").update({is_triggered:!0,triggered_at:new Date().toISOString()}).eq("id",C.id);fe&&console.error("Error marking idea as triggered:",fe)}const{data:{session:le}}=await v.auth.getSession();le&&await fetch("https://bsmvcmmwkmaqpgrmvjql.supabase.co/functions/v1/process-notification-queue",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(le.access_token)}})}else if(Y){const m={entry_picked:"entry_picked",rebuy:"rebuy_picked",tp:"tp_reached",sl_adjusted:"sl_adjusted",sl_hit:"sl_hit",trade_ended:"trade_ended",custom:"custom_message"},J=S!=null&&S.key&&m[S.key]||"custom_message",{error:he}=await v.from("trading_idea_notification_queue").insert({compounding_trade_id:Y.id,notification_type:J,level_value:P.trim()});if(he)throw console.error("Error inserting into notification queue:",he),new Error("Failed to queue notification: ".concat(he.message));const{data:{session:le}}=await v.auth.getSession();le&&await fetch("https://bsmvcmmwkmaqpgrmvjql.supabase.co/functions/v1/process-notification-queue",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(le.access_token)}})}else if(L){const{data:{session:m}}=await v.auth.getSession();if(m){const J=await fetch("https://bsmvcmmwkmaqpgrmvjql.supabase.co/functions/v1/send-unified-notification",{method:"POST",headers:{"Content-Type":"application/json",apikey:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImJzbXZjbW13a21hcXBncm12anFsIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDQ3MTQyMjUsImV4cCI6MjA2MDI5MDIyNX0.KyPuN_OCKx10MjCqve_4cPjzouAzG7ONt4mcPFUU-Ks",Authorization:"Bearer ".concat(m.access_token)},body:JSON.stringify({type:"livechart",message:P.trim(),symbol:o.symbol,link:o.live_charts||null})});if(!J.ok){const he=await J.json().catch(()=>({}));throw new Error(he.error||"Server error: ".concat(J.status))}}}alert("Notification sent to all platforms!"),c()}catch(m){console.error("Error sending notification:",m),alert("Failed to send notification")}finally{D(!1)}};return n?e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4",children:e.jsxs("div",{className:"bg-white dark:bg-surface-elevated rounded-xl shadow-xl max-w-lg w-full max-h-[85vh] flex flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-gray-200 dark:border-gray-700",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[g!=="select_target"&&e.jsx("button",{onClick:Q,className:"p-1 hover:bg-gray-100 dark:hover:bg-surface-elevated rounded-lg transition-colors",children:e.jsx(vt,{className:"w-5 h-5 text-gray-500"})}),e.jsx(lr,{className:"w-6 h-6 text-yellow-500"}),e.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:"Send Notification"})]}),e.jsx("button",{onClick:c,className:"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200",children:e.jsx(Re,{className:"w-6 h-6"})})]}),e.jsx("div",{className:"px-6 py-4 bg-surface-elevated dark:bg-surface-elevated border-b border-gray-200 dark:border-gray-700",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-lg font-bold text-bronze-600 dark:text-bronze-400",children:o.symbol}),e.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:o.name})]})}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-6",children:[g==="select_target"&&e.jsxs(e.Fragment,{children:[e.jsx("h3",{className:"text-sm font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wide mb-4",children:"Trading Ideas"}),U?e.jsx("div",{className:"flex justify-center py-8",children:e.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-bronze-500"})}):w.length===0?e.jsxs("p",{className:"text-gray-500 dark:text-gray-400 text-center py-4",children:["No active trading ideas for ",o.symbol]}):e.jsx("div",{className:"space-y-2 mb-6",children:w.map(m=>{var J;return e.jsxs("button",{onClick:()=>q(m),className:"w-full flex items-center gap-4 p-4 bg-gray-50 dark:bg-surface-elevated hover:bg-gray-100 dark:hover:bg-gray-700 rounded-xl transition-colors",children:[e.jsx("div",{className:"p-2 rounded-full ".concat(m.entry_type==="LONG"?"bg-green-100 dark:bg-green-900/30":"bg-red-100 dark:bg-red-900/30"),children:m.entry_type==="LONG"?e.jsx(wt,{className:"w-5 h-5 text-green-500"}):e.jsx(or,{className:"w-5 h-5 text-red-500"})}),e.jsxs("div",{className:"flex-1 text-left",children:[e.jsxs("p",{className:"font-medium text-gray-900 dark:text-white",children:[o.symbol," ",m.entry_type]}),e.jsxs("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:["Entry: $",((J=m.entry_price)==null?void 0:J.toLocaleStr
7ing())||"N/A"]})]}),e.jsx(De,{className:"w-5 h-5 text-gray-400"})]},m.id)})}),G.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("h3",{className:"text-sm font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wide mb-4 mt-6",children:"Compounding Trades"}),e.jsx("div",{className:"space-y-2 mb-6",children:G.map(m=>{var J;return e.jsxs("button",{onClick:()=>oe(m),className:"w-full flex items-center gap-4 p-4 bg-gray-50 dark:bg-surface-elevated hover:bg-gray-100 dark:hover:bg-gray-700 rounded-xl transition-colors",children:[e.jsx("div",{className:"p-2 rounded-full bg-surface-elevated dark:bg-surface-elevated",children:e.jsx(_r,{className:"w-5 h-5 text-bronze-500"})}),e.jsxs("div",{className:"flex-1 text-left",children:[e.jsxs("p",{className:"font-medium text-gray-900 dark:text-white",children:[m.symbol," Compounding"]}),e.jsxs("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:[m.phase_view?m.phase_view.charAt(0).toUpperCase()+m.phase_view.slice(1):"Active"," • Entry: $",((J=m.entry_price)==null?void 0:J.toLocaleString())||"N/A"]})]}),e.jsx(De,{className:"w-5 h-5 text-gray-400"})]},m.id)})})]}),e.jsx("h3",{className:"text-sm font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wide mb-4 mt-6",children:"Other"}),e.jsxs("button",{onClick:ue,className:"w-full flex items-center gap-4 p-4 bg-gray-50 dark:bg-surface-elevated hover:bg-gray-100 dark:hover:bg-gray-700 rounded-xl transition-colors",children:[e.jsx("div",{className:"p-2 rounded-full bg-surface-elevated dark:bg-surface-elevated",children:e.jsx(Gt,{className:"w-5 h-5 text-yellow-500"})}),e.jsxs("div",{className:"flex-1 text-left",children:[e.jsx("p",{className:"font-medium text-gray-900 dark:text-white",children:"Live Chart Update"}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"General chart notification"})]}),e.jsx(De,{className:"w-5 h-5 text-gray-400"})]})]}),g==="select_template"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-6 p-3 bg-gray-50 dark:bg-surface-elevated rounded-lg",children:[e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Sending for:"}),e.jsx("p",{className:"font-medium text-gray-900 dark:text-white",children:Y?"".concat(o.symbol," Compounding"):"".concat(o.symbol," ").concat(C==null?void 0:C.entry_type)})]}),e.jsx("h3",{className:"text-sm font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wide mb-4",children:"Choose Notification Type"}),e.jsx("div",{className:"space-y-2",children:ta.map(m=>e.jsxs("button",{onClick:()=>h(m),className:"w-full flex items-center gap-4 p-4 bg-gray-50 dark:bg-surface-elevated hover:bg-gray-100 dark:hover:bg-gray-700 rounded-xl transition-colors",children:[e.jsx("div",{className:"".concat(m.color),children:m.icon}),e.jsx("span",{className:"flex-1 text-left font-medium text-gray-900 dark:text-white",children:m.label}),e.jsx(De,{className:"w-5 h-5 text-gray-400"})]},m.key))})]}),g==="edit_message"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-3 mb-6",children:[e.jsxs("div",{className:"p-3 bg-gray-50 dark:bg-surface-elevated rounded-lg",children:[e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Sending for:"}),e.jsx("p",{className:"font-medium text-gray-900 dark:text-white",children:Y?"".concat(o.symbol," Compounding"):L?"".concat(o.symbol," Live Chart"):"".concat(o.symbol," ").concat(C==null?void 0:C.entry_type)})]}),(S==null?void 0:S.key)!=="custom"&&!Y&&e.jsxs("div",{className:"p-3 bg-gray-50 dark:bg-surface-elevated rounded-lg",children:[e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Type:"}),e.jsx("p",{className:"font-medium text-gray-900 dark:text-white",children:S==null?void 0:S.label})]})]}),((S==null?void 0:S.key)==="rebuy"||(S==null?void 0:S.key)==="tp")&&e.jsxs(e.Fragment,{children:[e.jsx("h3",{className:"text-sm font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wide mb-4",children:S.key==="rebuy"?"Rebuy Nummer":"TP Nummer"}),e.jsxs("div",{className:"grid grid-cols-5 gap-2 mb-6",children:[V.map(m=>e.jsx("button",{onClick:()=>O(m),className:"p-3 rounded-lg font-medium transition-colors ".concat(be===m?"bg-surface-elevated text-white":"bg-gray-100 dark:bg-surface-elevated text-gray-900 dark:text-white hover:bg-gray-200 dark:hover:bg-gray-700"),children:m},m)),e.jsx("button",{onClick:()=>k(m=>[...m,m.length+1]),className:"p-3 rounded-lg font-medium transition-colors bg-gray-100 dark:bg-surface-elevated text-gray-500 dark:text-gray-400 hover:bg-gray-200 dark:hover:bg-gray-700 border-2 border-dashed border-gray-300 dark:border-gray-600",children:"+"})]})]}),e.jsx("h3",{className:"text-sm font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wide mb-4",children:"Message"}),e.jsx("textarea",{value:P,onChange:m=>_(m.target.value),placeholder:"Enter notification message...",rows:4,className:"w-full px-4 py-3 border border-gray-300 dark:border-gray-600 rounded-xl focus:ring-2 focus:ring-bronze-500 focus:border-transparent bg-white dark:bg-surface-elevated text-gray-900 dark:text-white resize-none"}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 mt-2",children:"This message will be sent to web, mobile, and Telegram"}),e.jsx("button",{onClick:K,disabled:!P.trim()||F||((S==null?void 0:S.key)==="rebuy"||(S==null?void 0:S.key)==="tp")&&!be,className:"w-full mt-6 flex items-center justify-center gap-2 px-4 py-3 bg-green-500 hover:bg-green-600 disabled:bg-gray-400 disabled:cursor-not-allowed text-white rounded-xl transition-colors font-medium",children:F?e.jsx("div",{className:"animate-spin rounded-full h-5 w-5 border-b-2 border-white"}):e.jsxs(e.Fragment,{children:[e.jsx(Cr,{className:"w-5 h-5"}),"Send Notification"]})})]})]})]})}):null}const ra=s.forwardRef(({view:n,searchTerm:c,setSearchTerm:o,showFilters:g,setShowFilters:b},w)=>{const R=Ge(),G=Qe(),[u,U]=s.useState([]),[N,C]=s.useState(!0),[T,Y]=s.useState({}),[W,L]=s.useState([]),[M,S]=s.useState([]),[me,be]=s.useState(!0),[xe,V]=s.useState(null),{t:k}=Ze(),{coins:P,loading:_}=nr(),F=s.useMemo(()=>{const t={};return P.forEach(p=>{t[p.symbol]=p.current_price}),t},[P]),D=s.useMemo(()=>{const t={};return P.forEach(p=>{p.price_change_percent_24h!==void 0&&(t[p.symbol]=p.price_change_percent_24h)}),t},[P]),[j,I]=s.useState([]),[q,oe]=s.useState(new Set),[ue,h]=s.useState(!1),[O,Q]=s.useState(null),[K,m]=s.useState(""),[J,he]=s.useState(""),[le,fe]=s.useState(!1),[ae,re]=s.useState(null),[B,_e]=s.useState(!1),[ie,A]=s.useState(null),[pe,Te]=s.useState(!1),[ce,ee]=s.useState([]),[Ce,ve]=s.useState(null),[Ne,X]=s.useState(""),[de,f]=s.useState(""),[te,je]=s.useState(null),[Fe,Me]=s.useState(null),[Je,Ye]=s.useState(!1),[Se,et]=s.useState(null),[ye,Ie]=s.useState({url:"",symbol
7:"",title:"",description:"",entry_price:"",entry_type:"",trade_strategy:""}),[at,Ue]=s.useState(!1),[$,ke]=s.useState({name:"",symbol:"",risk:"",project_analysis:"",marketcap:"",holding_period:"",bullrun:"",market_structure:"","4h_sentiment":"",trader_grade:"",compund_worth:"",live_charts:"",buy_sell_levels:"",portfolio_percentage:"",ath_goal:""});s.useImperativeHandle(w,()=>({openAddModal:()=>Ue(!0)}));const[tt,Oe]=s.useState(!1),[Ee,mt]=s.useState(null),[st,nt]=s.useState(!1),[rt,$e]=s.useState(null),{isAdmin:r,user:i}=yt(),l=t=>{$e({symbol:t.symbol||"",name:t.name||"",live_charts:t.live_charts}),nt(!0)},H=async()=>{if(!i){be(!1);return}try{const{data:t,error:p}=await v.from("user_favorites").select("coin_id, view_type").eq("user_id",i.id);if(p)throw p;const d=(t==null?void 0:t.filter(Z=>Z.view_type==="trader").map(Z=>Z.coin_id))||[],x=(t==null?void 0:t.filter(Z=>Z.view_type==="investor").map(Z=>Z.coin_id))||[];L(d),S(x)}catch(t){console.error("Error fetching favorites:",t)}finally{be(!1)}};s.useEffect(()=>{ge(),H(),Be(),se()},[i]);const se=async()=>{try{const{data:t,error:p}=await v.from("coin_levels").select("coin_symbol");if(p)throw p;const d=new Set((t==null?void 0:t.map(x=>x.coin_symbol))||[]);oe(d)}catch(t){console.error("Error fetching coins with levels:",t)}},ge=async()=>{try{const{data:t,error:p}=await v.from("CryptoDashboard").select("*").order("ID",{ascending:!0});if(p)throw console.error("Supabase error:",p),p;const d=t==null?void 0:t.map(x=>({...x,symbol:x.name?x.name.split(" ").slice(-1)[0]:"UNKNOWN",isEditing:!1}));U(d||[])}catch(t){console.error("Error fetching data:",t)}finally{C(!1)}},xt=async()=>{if(!$.name||!$.symbol){alert("Name und Symbol sind erforderlich!");return}try{const{error:t}=await v.from("CryptoDashboard").insert({name:$.name,symbol:$.symbol,risk:$.risk?parseInt($.risk):null,project_analysis:$.project_analysis||null,marketcap:$.marketcap||null,holding_period:$.holding_period||null,bullrun:$.bullrun||null,market_structure:$.market_structure||null,"4h_sentiment":$["4h_sentiment"]||null,trader_grade:$.trader_grade||null,compund_worth:$.compund_worth||null,live_charts:$.live_charts||null,buy_sell_levels:$.buy_sell_levels||null,portfolio_percentage:$.portfolio_percentage||null,ath_goal:$.ath_goal||null,status:"NEW!",invested:"Not Invested"});if(t){console.error("Error adding coin:",t),alert("Fehler beim Hinzufügen des Coins!");return}await ge(),Ue(!1),ke({name:"",symbol:"",risk:"",project_analysis:"",marketcap:"",holding_period:"",bullrun:"",market_structure:"","4h_sentiment":"",trader_grade:"",compund_worth:"",live_charts:"",buy_sell_levels:"",portfolio_percentage:"",ath_goal:""}),console.log("✅ Coin added successfully")}catch(t){console.error("Error adding coin:",t),alert("Fehler beim Hinzufügen des Coins!")}},Be=async()=>{try{const{data:t,error:p}=await v.from("trading_ideas_gated").select("*").eq("status","ACTIVE").order("created_at",{ascending:!1});if(p)throw p;I(t||[])}catch(t){console.error("Error fetching trading ideas:",t)}},ut=t=>{document.activeElement&&document.activeElement instanceof HTMLInputElement&&document.activeElement.blur(),U(p=>p.map(d=>({...d,isEditing:d.ID===t}))),setTimeout(()=>{const p=document.querySelector('[data-item-id="'.concat(t,'"]'));if(p){const d=p.querySelector("input, select");d instanceof HTMLElement&&d.focus()}},100)},jt=async t=>{const p=u.findIndex(d=>d.ID===t);if(p!==-1){console.log("handleSave gestartet für ID:",t,u[p]);try{const d={...u[p]},x=u[p];console.log("Vor Update CryptoDashboard");const{error:Z}=await v.from("CryptoDashboard").update({status:x.status,name:x.name,risk:x.risk,project_analysis:x.project_analysis,invested:x.invested,marketcap:x.marketcap,holding_period:x.holding_period,bullrun:x.bullrun,portfolio_percentage:x.portfolio_percentage,ath_goal:x.ath_goal,buy_sell_levels:x.buy_sell_levels,market_structure:x.market_structure,"4h_sentiment":x["4h_sentiment"],trader_grade:x.trader_grade,compund_worth:x.compund_worth,live_charts:x.live_charts,m_structure_timestamp:x.m_structure_timestamp||null,"4h_sentiment_timestamp":x["4h_sentiment_timestamp"]||null}).eq("ID",x.ID);if(Z){console.error("Update-Fehler:",Z);return}U(we=>we.map(Le=>({...Le,isEditing:Le.ID===t?!1:Le.isEditing})))}catch(d){console.error("Exception in handleSave:",d)}}},kt=t=>{U(p=>p.map(d=>({...d,isEditing:d.ID===t?!1:d.isEditing})))},Ct=async()=>
7{if(!(!ye.url||!Se))try{const{error:t}=await v.from("trading_ideas").insert({coin_symbol:ye.symbol||Se.symbol,coin_name:Se.name,trading_idea_url:ye.url,title:ye.title||null,description:ye.description||null,entry_price:ye.entry_price?parseFloat(ye.entry_price):null,entry_type:ye.entry_type||null,trade_strategy:ye.trade_strategy||null,status:"ACTIVE"});if(t){console.error("Error inserting trading idea:",t),alert("Failed to add trading idea");return}const{data:{session:p}}=await v.auth.getSession();p&&await fetch("https://bsmvcmmwkmaqpgrmvjql.supabase.co/functions/v1/process-notification-queue",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(p.access_token)}}),await Be(),Ye(!1),Ie({url:"",symbol:"",title:"",description:"",entry_price:"",entry_type:"",trade_strategy:""}),et(null),console.log("✅ Trading idea added successfully")}catch(t){console.error("Error adding trading idea:",t),alert("Failed to add trading idea")}},St=async()=>{if(!(!O||!K))try{const{error:t}=await v.from("recent_trades").insert({symbol:O.coin_symbol,name:O.coin_name,trading_idea_url:O.trading_idea_url,pnl_percentage:parseFloat(K),exit_chart_image_url:J||null,status:"CLOSED"});if(t){console.error("Error inserting into recent_trades:",t);return}const{error:p}=await v.from("trading_ideas").update({status:"CLOSED",closed_at:new Date().toISOString(),pnl_percentage:parseFloat(K)}).eq("id",O.id);if(p){console.error("Error updating trading idea:",p);return}await Be(),h(!1),Q(null),m(""),he("")}catch(t){console.error("Error closing trading idea:",t)}},It=()=>{h(!1),Q(null),m(""),he("")},Et=async()=>{if(ae)try{const{error:t}=await v.from("trading_ideas").delete().eq("id",ae.id);if(t){console.error("Error deleting trading idea:",t);return}await Be(),fe(!1),re(null)}catch(t){console.error("Error deleting trading idea:",t)}},At=()=>{fe(!1),re(null)},ht=async()=>{if(ie)try{const{error:t}=await v.from("recent_trades").insert({symbol:ie.coin_symbol,name:ie.coin_name,trading_idea_url:ie.trading_idea_url,pnl_percentage:null,status:"INACTIVE"});if(t){console.error("Error inserting into recent_trades:",t);return}const{error:p}=await v.from("trading_ideas").update({status:"INACTIVE",closed_at:new Date().toISOString()}).eq("id",ie.id);if(p){console.error("Error updating trading idea:",p);return}await Be(),_e(!1),A(null)}catch(t){console.error("Error marking trading idea as inactive:",t)}},a=()=>{_e(!1),A(null)},y=async t=>{if(!i){console.error("No user logged in");return}const d=(String(n)==="trader"?W:M).includes(t);try{if(d){const{error:x}=await v.from("user_favorites").delete().eq("user_id",i.id).eq("coin_id",t).eq("view_type",n);if(x)throw x;String(n)==="trader"?L(Z=>Z.filter(we=>we!==t)):S(Z=>Z.filter(we=>we!==t))}else{const{error:x}=await v.from("user_favorites").insert({user_id:i.id,coin_id:t,view_type:n});if(x)throw x;String(n)==="trader"?L(Z=>[...Z,t]):S(Z=>[...Z,t])}}catch(x){console.error("Error updating favorites:",x)}},E=(t,p,d)=>{U(x=>x.map(Z=>{if(Z.ID!==t)return Z;let we={...Z,[p]:d};return(p==="market_structure"||p==="4h_sentiment")&&d!==Z[p]&&(we.status="M-Structure",we.m_structure_timestamp=new Date().toISOString()),p==="4h_sentiment"&&d!==Z[p]&&(we["4h_sentiment_timestamp"]=new Date().toISOString()),we}))},z=t=>Array.from(new Set(u.map(p=>p[t]))).filter(Boolean).sort(),ne=Ve.useMemo(()=>{const t=u.filter(d=>{var Z;return!(!d||!d.ID||!Object.values(d).some(we=>we==null?void 0:we.toString().toLowerCase().includes(c.toLowerCase()))||T.marketStructure&&d.market_structure!==T.marketStructure||T.sentiment4h&&d["4h_sentiment"]!==T.sentiment4h||T.traderGrade&&d.trader_grade!==T.traderGrade||T.compoundWorthy&&d.compund_worth!==T.compoundWorthy||T.risk&&((Z=d.risk)==null?void 0:Z.toString())!==T.risk||T.liveChart==="yes"&&!d.live_charts||T.tradingIdea==="yes"&&!j.some(Le=>Le.coin_symbol===d.symbol))}),p=String(n)==="trader"?W:M;return[...t].sort((d,x)=>{if(!d||!x||typeof d.ID!="number"||typeof x.ID!="number")return 0;const Z=p.includes(d.ID),we=p.includes(x.ID);return Z&&!we?-1:!Z&&we?1:d.ID-x.ID})},[u,c,T,n,W,M,j]),qe=()=>{if(!g)return null;const t=String(n)==="trader"?[{key:"marketStructure",label:"Market Structure",field:"market_structure"},{key:"sentiment4h",label:"4h Sentiment",field:"4h_sentiment"},{key:"traderGrade",label:"Trader Grade",field:"trader_grade"},{key:"compoundWorthy",label:"Compound Worthy",field:"compund_worth"},{key:"liveChart",label:"Live Chart",field:"live_charts"},{key:"tradingIdea",label:"Trading Idea",field:"trading_ideas"}]:[{key:"risk",label:"Risk",field:"risk"}];return e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-6",children:t.map(({key:p,label:d,field:x})=>{var Z,we;return["liveChart","tradingIdea"].includes(p)?e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:d}),e.jsxs("select",{value:String((Z=T[p])!=null?Z:""),onChange:Le=>Y(zt=>({...zt,[p]:Le.target.value||void 0})),className:"w-full bg-white dark:bg-[#1A1714] border border-gray-200 dark:border-gray-700 rounded-lg px-3 py-2 text-gray-900 dark:text-white focus:outline-none focus:ring-2 focus:ring-bronze-500",children:[e.jsx("option",{value:"",children:"Alle"}),e.jsx("option",{value:"yes",children:"Nur mit"})]})]},p):e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:d}),e.jsxs("select",{value:String((we=T[p])!=null?we:""),onChange:Le=>Y(zt=>({...zt,[p]:Le.target.value||void 0})),className:"w-full bg-white dark:bg-[#1A1714] border border-gray-200 dark:border-gray-700 rounded-lg px-3 py-2 text-gray-900 dark:text-white focus:outline-none focus:ring-2 focus:ring-bronze-500",children:[e.jsx("option",{value:"",children:"All"}),z(x).map(Le=>e.jsx("option",{value:String(Le),children:String(Le)},Le))]})]},p)})})},pt=t=>{if(!t.name)return e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:"w-6 h-6 mr-2 bg-gray-200 dark:bg-gray-700 rounded-full"}),e.jsx("span",{className:"text-responsive-sm text-gray-500 dark:text-gray-400",children:"Unknown"})]});if(t.isEditing&&r)return e.jsx("input",{type:"text",value:t.name,onChange:Z=>E(t.ID,"name",Z.target.value),onClick:Z=>Z.stopPropagation(),className:"w-full px-2 py-1 bg-gray-100 dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded"});const p=t.name.split(" "),d=p.pop(),x=p.join(" ");return e.jsxs("div",{className:"flex items-center",children:[e.jsx("img",{src:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/coins/Coin_Icons/".concat(t.symbol,".png"),alt:t.name,className:"w-6 h-6 mr-2",onError:Z=>{const we=Z.target;we.src="https://placehold.co/24x24?text=?"}}),e.jsxs("div",{className:"text-responsive-sm font-medium text-gray-900 dark:text-gray-100",children:[x," ",e.jsx("span",{className:"text-responsive-sm text-gray-500 dark:text-gray-400",children:d})]})]})},bt=(t,p,d)=>e.jsxs("select",{value:t||"",onChange:x=>d(x.target.value),onClick:x=>x.stopPropagation(),className:"w-full px-2 py-1 bg-gray-100 dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded",children:[e.jsx("option",{value:"",children:"Select..."}),p.map(x=>e.jsx("option",{value:x,children:x},x))]}),We=t=>{if(t.isEditing&&r)return bt(t.market_structure||"",lt,d=>E(t.ID,"market_structure",d));const p=e.jsxs("div",{className:"flex flex-col",children:[e.jsx("div",{className:"flex items-center flex-shrink-0",children:Ke(t.market_structure,"market_structure","marketStructure")}),t.m_structure_timestamp&&e.jsxs("div",{className:"text-xs text-gray-400 dark:text-gray-500 mt-0.5",children:["Updated: ",new Date(t.m_structure_timestamp).toLocaleStr
7ing()]})]});return G?e.jsx("div",{className:"blur-[6px] select-none pointer-events-none",children:p}):p},Tt=t=>{if(t.isEditing&&r)return bt(t["4h_sentiment"]||"",ot,d=>E(t.ID,"4h_sentiment",d));const p=e.jsxs("div",{className:"flex flex-col",children:[e.jsx("div",{className:"flex items-center flex-shrink-0",children:Ke(t["4h_sentiment"],"sentiment","sentiment4h")}),t["4h_sentiment_timestamp"]&&e.jsxs("div",{className:"text-xs text-gray-400 dark:text-gray-500 mt-0.5",children:["Updated: ",new Date(t["4h_sentiment_timestamp"]).toLocaleString()]})]});return G?e.jsx("div",{className:"blur-[6px] select-none pointer-events-none",children:p}):p};return s.useEffect(()=>{const t=Date.now(),p=u.map(d=>d.status==="M-Structure"&&d.m_structure_timestamp&&typeof d.m_structure_timestamp=="number"&&t-d.m_structure_timestamp>1440*60*1e3?(v.from("CryptoDashboard").update({status:"Same",m_structure_timestamp:null}).eq("ID",d.ID),{...d,status:"Same",m_structure_timestamp:null}):d);JSON.stringify(p)!==JSON.stringify(u)&&U(p)},[u]),e.jsxs(e.Fragment,{children:[e.jsx(cr,{}),qe(),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"rounded-lg border border-gray-200 dark:border-gray-700 bg-white dark:bg-[#0f0d0a] max-h-[900px] overflow-y-auto",children:String(n)==="trader"?e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{className:"sticky top-0 bg-gray-50/80 dark:bg-[#1A1714]/95 backdrop-blur-sm z-10",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-2 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"#"}),e.jsx("th",{className:"px-2 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Name"}),e.jsx("th",{className:"px-2 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Live Price"}),e.jsx("th",{className:"px-2 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Market Structure"}),e.jsx("th",{className:"px-2 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"4h Sentiment"}),e.jsx("th",{className:"px-2 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"ATH Goal"}),e.jsx("th",{className:"px-2 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Buy & Sell Levels"}),e.jsx("th",{className:"px-2 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Live Chart"}),e.jsx("th",{className:"px-2 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Trading Ideas"}),r&&e.jsx("th",{className:"px-2 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Actions"})]})}),e.jsx("tbody",{className:"bg-white dark:bg-[#0f0d0a] divide-y divide-gray-200 dark:divide-gray-700",children:N||me?e.jsx("tr",{children:e.jsx("td",{colSpan:r?11:10,className:"px-2 py-3 text-center text-gray-500 dark:text-gray-400",children:"Loading..."})}):ne.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:r?11:10,className:"px-2 py-3 text-center text-gray-500 dark:text-gray-400",children:"No data found"})}):ne.map((t,p)=>e.jsxs("tr",{"data-item-id":t.ID,className:"hover:bg-gray-50 dark:hover:bg-[#1A1714] transition-colors cursor-pointer",onClick:()=>window.location.href="/coin/".concat(t.symbol),children:[e.jsx("td",{className:"px-2 py-3 whitespace-nowrap",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx(it,{className:"h-4 w-4 cursor-pointer transition-colors ".concat((String(n)==="trader"?W:M).includes(t.ID)?"text-yellow-500 fill-yellow-500":"text-gray-400 hover:text-yellow-500"," ").concat(i?"":"opacity-50 cursor-not-allowed"),onClick:d=>{d.stopPropagation(),i&&y(t.ID)}}),e.jsx("span",{className:"ml-2 text-base text-gray-500 dark:text-gray-400",children:t.ID})]})}),e.jsx("td",{className:"px-2 py-3 whitespace-nowrap",children:pt(t)}),e.jsx("td",{className:"px-2 py-3 whitespace-nowrap",children:F[t.symbol]?e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("span",{className:"text-sm font-medium text-gray-900 dark:text-white",children:["$",F[t.symbol]>
7=1?F[t.symbol].toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2}):F[t.symbol].toFixed(6)]}),D[t.symbol]!==void 0&&e.jsxs("span",{className:"text-xs ".concat(D[t.symbol]>=0?"text-green-500":"text-red-500"),children:[D[t.symbol]>=0?"+":"",D[t.symbol].toFixed(2),"%"]})]}):_?e.jsx("span",{className:"text-xs text-gray-400",children:"Loading..."}):e.jsx("span",{className:"text-xs text-gray-400",children:"N/A"})}),e.jsx("td",{className:"px-2 py-3 whitespace-nowrap align-top",children:We(t)}),e.jsx("td",{className:"px-2 py-3 whitespace-nowrap align-top",children:Tt(t)}),e.jsx("td",{className:"px-2 py-3 whitespace-nowrap",children:t.isEditing&&r?e.jsx("input",{type:"text",value:t.ath_goal,onChange:d=>E(t.ID,"ath_goal",d.target.value),onClick:d=>d.stopPropagation(),className:"w-full px-2 py-1 bg-gray-100 dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded"}):e.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300 ".concat(G?"blur-sm select-none":""),children:t.ath_goal})}),e.jsx("td",{className:"px-2 py-3 whitespace-nowrap",children:t.isEditing&&r?e.jsx("input",{type:"text",value:t.buy_sell_levels,onChange:d=>E(t.ID,"buy_sell_levels",d.target.value),onClick:d=>d.stopPropagation(),className:"w-full px-2 py-1 bg-gray-100 dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded"}):G?e.jsx("span",{className:"text-sm text-gray-500 blur-sm select-none",children:"Locked"}):q.has(t.symbol)?e.jsx("button",{onClick:d=>{d.preventDefault(),d.stopPropagation(),R("/coin/".concat(t.symbol,"#levels"))},className:"text-bronze-600 dark:text-bronze-400 hover:text-bronze-500 dark:hover:text-bronze-300 text-sm underline",children:"View Levels"}):e.jsx("span",{className:"text-sm text-gray-500",children:"No"})}),e.jsx("td",{className:"px-2 py-3 whitespace-nowrap",children:t.isEditing&&r?e.jsx("input",{type:"text",value:t.live_charts,onChange:d=>E(t.ID,"live_charts",d.target.value),onClick:d=>d.stopPropagation(),className:"w-full px-2 py-1 bg-gray-100 dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded"}):G?e.jsx("div",{className:"blur-[6px] select-none pointer-events-none",children:e.jsx("span",{className:"live-badge pl-4 text-bronze-600 dark:text-bronze-400 text-sm",children:"View Chart"})}):t.live_charts?e.jsx("a",{href:"#",onClick:d=>{d.preventDefault(),d.stopPropagation(),window.open(t.live_charts,"_blank")},className:"live-badge pl-4 text-bronze-600 dark:text-bronze-400 hover:text-bronze-500 dark:hover:text-bronze-300 text-sm",children:"View Chart"}):e.jsx("span",{className:"text-sm text-gray-500",children:"No"})}),e.jsx("td",{className:"px-2 py-3 whitespace-nowrap",children:t.isEditing&&r?e.jsx("button",{onClick:d=>{d.stopPropagation(),et(t),Ie({url:"",symbol:t.symbol,title:"",description:""}),Ye(!0)},className:"p-2 bg-surface-elevated hover:bg-surface-elevated text-white rounded-lg transition-colors flex items-center justify-center",title:"Add Trading Idea",children:e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})})}):G?e.jsx("div",{className:"blur-[6px] select-none pointer-events-none",children:e.jsx("span",{className:"text-bronze-600 dark:text-bronze-400 text-sm",children:"1 Idea(s)"})}):j.filter(x=>x.coin_symbol===t.symbol).length>0?e.jsxs("span",{className:"text-bronze-600 dark:text-bronze-400 text-sm cursor-pointer hover:text-bronze-500",onClick:d=>{d.stopPropagation();const x=j.filter(Z=>Z.coin_symbol===t.symbol);x.length>0&&(ee(x),Te(!0))},children:[j.filter(d=>d.coin_symbol===t.symbol).length," Idea(s)"]}):e.jsx("span",{className:"text-sm text-gray-500",children:"No"})}),r&&e.jsx("td",{className:"px-2 py-3 whitespace-nowrap",children:e.jsx("div",{className:"flex items-center space-x-2",children:t.isEditing?e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:d=>{d.stopPropagation(),jt(t.ID)},className:"text-green-600 hover:text-green-700 transition-colors",children:e.jsx(ct,{className:"h-5 w-5"})}),e.jsx("button",{onClick:d=>{d.stopPropagation(),kt(t.ID)},className:"text-gray-600 hover:text-gray-700 transition-colors",children:e.jsx(Re,{className:"h-5 w-5"})})]}):e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:d=>{d.stopPropagation(),ut(t.ID)},className:"text-bronze-600 hover:text-bronze-700 transition-colors",children:e.jsx(dt,{className:"h-5 w-5"})}),r&&!t.isEditing&&e.jsx("button",{onClick:d=>{d.stopPropagation(),l(t)},className:"text-yellow-600 hover:text-yellow-800",title:"Benachrichtigung auslösen",children:"🔔"})]})})})]},"".concat(t.ID,"-").concat(p)))})]}):e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{className:"sticky top-0 bg-gray-50/80 dark:bg-[#1A1714]/95 backdrop-blur-sm z-10",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-2 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"#"}),e.jsx("th",{className:"px-2 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Name"}),e.jsx("th",{className:"px-2 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Live Price"}),e.jsx("th",{className:"px-2 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Risk"}),e.jsx("th",{className:"px-2 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Project Analysis"}),e.jsx("th",{className:"px-2 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Portfolio %"}),e.jsx("th",{className:"px-2 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"ATH Goal"}),e.jsx("th",{className:"px-2 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Buy & Sell Levels"}),r&&e.jsx("th",{className:"px-2 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Actions"})]})}
7),e.jsx("tbody",{className:"bg-white dark:bg-[#0f0d0a] divide-y divide-gray-200 dark:divide-gray-700",children:N||me?e.jsx("tr",{children:e.jsx("td",{colSpan:r?9:8,className:"px-2 py-3 text-center text-gray-500 dark:text-gray-400",children:"Loading..."})}):ne.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:r?9:8,className:"px-2 py-3 text-center text-gray-500 dark:text-gray-400",children:"No data found"})}):ne.map((t,p)=>{var d;return e.jsxs("tr",{"data-item-id":t.ID,className:"hover:bg-gray-50 dark:hover:bg-[#1A1714] transition-colors cursor-pointer",onClick:()=>window.location.href="/coin/".concat(t.symbol),children:[e.jsx("td",{className:"px-2 py-3 whitespace-nowrap",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx(it,{className:"h-4 w-4 cursor-pointer transition-colors ".concat((String(n)==="trader"?W:M).includes(t.ID)?"text-yellow-500 fill-yellow-500":"text-gray-400 hover:text-yellow-500"," ").concat(i?"":"opacity-50 cursor-not-allowed"),onClick:x=>{x.stopPropagation(),i&&y(t.ID)}}),e.jsx("span",{className:"ml-2 text-base text-gray-500 dark:text-gray-400",children:t.ID})]})}),e.jsx("td",{className:"px-2 py-3 whitespace-nowrap",children:pt(t)}),e.jsx("td",{className:"px-2 py-3 whitespace-nowrap",children:F[t.symbol]?e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("span",{className:"text-sm font-medium text-gray-900 dark:text-white",children:["$",F[t.symbol]>=1?F[t.symbol].toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2}):F[t.symbol].toFixed(6)]}),D[t.symbol]!==void 0&&e.jsxs("span",{className:"text-xs ".concat(D[t.symbol]>=0?"text-green-500":"text-red-500"),children:[D[t.symbol]>=0?"+":"",D[t.symbol].toFixed(2),"%"]})]}):_?e.jsx("span",{className:"text-xs text-gray-400",children:"Loading..."}):e.jsx("span",{className:"text-xs text-gray-400",children:"N/A"})}),e.jsx("td",{className:"px-3 py-4 min-w-[150px]",children:t.isEditing&&r?e.jsx("input",{type:"number",value:String((d=t.risk)!=null?d:""),onChange:x=>E(t.ID,"risk",parseInt(x.target.value)),onClick:x=>x.stopPropagation(),className:"w-full px-2 py-1 bg-gray-100 dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded",min:"1",max:"10"}):qt(Number(t.risk))}),e.jsx("td",{className:"px-3 py-4",children:t.isEditing&&r?e.jsx("input",{type:"text",value:t.project_analysis,onChange:x=>E(t.ID,"project_analysis",x.target.value),onClick:x=>x.stopPropagation(),className:"w-full px-2 py-1 bg-gray-100 dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded"}):Lr(t.project_analysis)}),e.jsx("td",{className:"px-2 py-3 whitespace-nowrap",children:t.isEditing&&r?e.jsx("input",{type:"text",value:t.portfolio_percentage,onChange:x=>E(t.ID,"portfolio_percentage",x.target.value),onClick:x=>x.stopPropagation(),className:"w-full px-2 py-1 bg-gray-100 dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded"}):e.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300 ".concat(G?"blur-sm select-none":""),children:t.portfolio_percentage})}),e.jsx("td",{className:"px-2 py-3 whitespace-nowrap",children:t.isEditing&&r?e.jsx("input",{type:"text",value:t.ath_goal,onChange:x=>E(t.ID,"ath_goal",x.target.value),onClick:x=>x.stopPropagation(),className:"w-full px-2 py-1 bg-gray-100 dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded"}):e.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300 ".concat(G?"blur-sm select-none":""),children:t.ath_goal})}),e.jsx("td",{className:"px-2 py-3 whitespace-nowrap",children:t.isEditing&&r?e.jsx("input",{type:"text",value:t.buy_sell_levels,onChange:x=>E(t.ID,"buy_sell_levels",x.target.value),onClick:x=>x.stopPropagation(),className:"w-full px-2 py-1 bg-gray-100 dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded"}):G?e.jsx("span",{className:"text-sm text-gray-500 blur-sm select-none",children:"Locked"}):q.has(t.symbol)?e.jsx("button",{onClick:x=>{x.preventDefault(),x.stopPropagation(),R("/coin/".concat(t.symbol,"#levels"))},className:"text-bronze-600 dark:text-bronze-400 hover:text-bronze-500 dark:hover:text-bronze-300 text-sm underline",children:"View Levels"}):e.jsx("span",{className:"text-sm text-gray-500",children:"No"})}),r&&e.jsx("td",{className:"px-2 py-3 whitespace-nowrap",children:e.jsx("div",{className:"flex items-center space-x-2",children:t.isEditing?e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:x=>{x.stopPropagation(),jt(t.ID)},className:"text-green-600 hover:text-green-700 transition-colors",children:e.jsx(ct,{className:"h-5 w-5"})}),e.jsx("button",{onClick:x=>{x.stopPropagation(),kt(t.ID)},className:"text-gray-600 hover:text-gray-700 transition-colors",children:e.jsx(Re,{className:"h-5 w-5"})})]}):e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:x=>{x.stopPropagation(),ut(t.ID)},className:"text-bronze-600 hover:text-bronze-700 transition-colors",children:e.jsx(dt,{className:"h-5 w-5"})}),r&&!t.isEditing&&e.jsx("button",{onClick:x=>{x.stopPropagation(),l(t)},className:"text-yellow-600 hover:text-yellow-800",title:"Benachrichtigung auslösen",children:"🔔"})]})})})]},"".concat(t.ID,"-").concat(p))})})]})}),G&&e.jsx("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 z-20 pointer-events-none",children:e.jsxs("div",{className:"flex items-center gap-2 px-5 py-2 rounded-full shadow-lg pointer-events-auto cursor-pointer",style:{background:"linear-gradient(135deg, #C9A96E, #A8864A)"},onClick:()=>R("/pricing"),children:[e.jsx(gt,{className:"w-4 h-4 text-white"}),e.jsx("span",{className:"text-white text-sm font-bold tracking-wider",children:"PRO"})]})})]}),xe&&e.jsxs("div",{className:"fixed bottom-4 right-4 bg-surface-elevated text-white p-4 rounded-lg shadow-lg",children:[e.jsx("p",{children:xe.msg}),e.jsx("button",{onClick:()=>V(null),className:"mt-2 px-3 py-1 bg-white/20 rounded text-sm",children:"Close"})]}),ue&&e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:e.jsxs("div",{className:"bg-white dark:bg-surface-elevated p-6 rounded-lg shadow-xl max-w-md w-full mx-4",children:[e.jsx("h3",{className:"text-lg font-semibold mb-4 text-gray-900 dark:text-white",children:"Close Trade"}),e.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-4",children:["Closing trade for ",e.jsx("strong",{children:O==null?void 0:O.symbol})," - ",O==null?void 0:O.name]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"PnL Percentage"}),e.jsx("input",{type:"number",step:"0.1",value:K,onChange:t=>m(t.target.value),placeholder:"Enter PnL % (e.g., 23.5 for +23.5%)",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-bronze-500 dark:bg-gray-700 dark:text-white"})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Exit Chart URL (TradingView)"}),e.jsx("input",{type:"text",value:J,onChange:t=>he(t.target.value),placeholder:"Enter TradingView chart URL for trade exit",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-bronze-500 dark:bg-gray-700 dark:text-white"})]}),e.jsxs("div",{className:"flex justify-end space-x-3",children:[e.jsx("button",{onClick:It,className:"px-4 py-2 text-gray-700 dark:text-gray-300 bg-gray-200 dark:bg-gray-600 rounded-md hover:bg-gray-300 dark:hover:bg-gray-500 transition-colors",children:"Cancel"}),e.jsx("button",{onClick:St,disabled:!K,className:"px-4 py-2 bg-red-500 text-white rounded-md hover:bg-red-600 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:"Close Trade"})]})]})}),le&&e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:e.jsxs("div",{className:"bg-white dark:bg-surface-elevated p-6 rounded-lg shadow-xl max-w-md w-full mx-4",children:[e.jsx("h3",{className:"text-lg font-semibold mb-4 text-gray-900 dark:text-white",children:"Delete Trading Idea"}),e.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-6",children:["Are you sure you want to delete the trading idea for ",e.jsx("strong",{children:ae==null?void 0:ae.symbol})," - ",ae==null?void 0:ae.name,"?"]}),e.jsx("p",{className:"text-sm text-red-600 dark:text-red-400 mb-6",children:"This action cannot be undone and will permanently remove the trading idea from the dashboard."}),e.jsxs("div",{className:"flex justify-end space-x-3",children:[e.jsx("button",{onClick:At,className:"px-4 py-2 text-gray-700 dark:text-gray-300 bg-gray-200 dark:bg-gray-600 rounded-md hover:bg-gray-300 dark:hover:bg-gray-500 transition-colors",children:"Cancel"}),e.jsx("button",{onClick:Et,className:"px-4 py-2 bg-red-500 text-white rounded-md hover:bg-red-600 transition-colors",children:"Delete"})]})]})}),B&&e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:e.jsxs("div",{className:"bg-white dark:bg-surface-elevated p-6 rounded-lg shadow-xl max-w-md w-full mx-4",children:[e.jsx("h3",{className:"text-lg font-semibold mb-4 text-gray-900 dark:text-white",children:"Mark Trading Idea as Inactive"}),e.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-6",children:["Are you sure you want to mark the trading idea for ",e.jsx("strong",{children:ie==null?void 0:ie.symbol})," - ",ie==null?void 0:ie.name," as inactive?"]}
7),e.jsx("p",{className:"text-sm text-orange-600 dark:text-orange-400 mb-6",children:'This will remove the trading idea from the dashboard and move it to the recent trades section with an "INACTIVE" status.'}),e.jsxs("div",{className:"flex justify-end space-x-3",children:[e.jsx("button",{onClick:a,className:"px-4 py-2 text-gray-700 dark:text-gray-300 bg-gray-200 dark:bg-gray-600 rounded-md hover:bg-gray-300 dark:hover:bg-gray-500 transition-colors",children:"Cancel"}),e.jsx("button",{onClick:ht,className:"px-4 py-2 bg-surface-elevated text-white rounded-md hover:bg-surface-elevated transition-colors",children:"Mark as Inactive"})]})]})}),at&&e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4 overflow-y-auto",children:e.jsxs("div",{className:"bg-white dark:bg-surface-elevated rounded-xl shadow-xl max-w-2xl w-full max-h-[90vh] flex flex-col my-8",children:[e.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-gray-200 dark:border-gray-700",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:"Neuen Coin hinzufügen"}),e.jsx("button",{onClick:()=>{Ue(!1),ke({name:"",symbol:"",risk:"",project_analysis:"",marketcap:"",holding_period:"",bullrun:"",market_structure:"","4h_sentiment":"",trader_grade:"",compund_worth:"",live_charts:"",buy_sell_levels:"",portfolio_percentage:"",ath_goal:""})},className:"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200",children:e.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Name *"}),e.jsx("input",{type:"text",value:$.name,onChange:t=>ke({...$,name:t.target.value}),placeholder:"z.B. Bitcoin",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 focus:border-transparent bg-white dark:bg-surface-elevated text-gray-900 dark:text-white",required:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Symbol *"}),e.jsx("input",{type:"text",value:$.symbol,onChange:t=>ke({...$,symbol:t.target.value.toUpperCase()}),placeholder:"z.B. BTC",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 focus:border-transparent bg-white dark:bg-surface-elevated text-gray-900 dark:text-white uppercase",required:!0})]})]}),e.jsxs("div",{className:"border-t border-gray-200 dark:border-gray-700 pt-4 mt-4",children:[e.jsx("h3",{className:"text-lg font-semibold mb-4 text-gray-900 dark:text-white",children:"Trader View"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Market Structure"}),e.jsxs("select",{value:$.market_structure,onChange:t=>ke({...$,market_structure:t.target.value}),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 bg-white dark:bg-surface-elevated text-gray-900 dark:text-white",children:[e.jsx("option",{value:"",children:"Select..."}),lt.map(t=>e.jsx("option",{value:t,children:t},t))]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"4H Sentiment"}),e.jsxs("select",{value:$["4h_sentiment"],onChange:t=>ke({...$,"4h_sentiment":t.target.value}),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 bg-white dark:bg-surface-elevated text-gray-900 dark:text-white",children:[e.jsx("option",{value:"",children:"Select..."}),ot.map(t=>e.jsx("option",{value:t,children:t},t))]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Trader Grade"}
7),e.jsxs("select",{value:$.trader_grade,onChange:t=>ke({...$,trader_grade:t.target.value}),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 bg-white dark:bg-surface-elevated text-gray-900 dark:text-white",children:[e.jsx("option",{value:"",children:"Select..."}),dr.map(t=>e.jsx("option",{value:t,children:t},t))]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Compound Worthy"}),e.jsxs("select",{value:$.compund_worth,onChange:t=>ke({...$,compund_worth:t.target.value}),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 bg-white dark:bg-surface-elevated text-gray-900 dark:text-white",children:[e.jsx("option",{value:"",children:"Select..."}),gr.map(t=>e.jsx("option",{value:t,children:t},t))]})]}),e.jsxs("div",{className:"md:col-span-2",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Live Chart URL"}),e.jsx("input",{type:"url",value:$.live_charts,onChange:t=>ke({...$,live_charts:t.target.value}),placeholder:"https://www.tradingview.com/chart/...",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 bg-white dark:bg-surface-elevated text-gray-900 dark:text-white"})]})]})]}),e.jsxs("div",{className:"border-t border-gray-200 dark:border-gray-700 pt-4 mt-4",children:[e.jsx("h3",{className:"text-lg font-semibold mb-4 text-gray-900 dark:text-white",children:"Investor View"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Risk (1-10)"}),e.jsx("input",{type:"number",min:"1",max:"10",value:$.risk,onChange:t=>ke({...$,risk:t.target.value}),placeholder:"1-10",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 bg-white dark:bg-surface-elevated text-gray-900 dark:text-white"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Project Analysis"}),e.jsx("input",{type:"text",value:$.project_analysis,onChange:t=>ke({...$,project_analysis:t.target.value}),placeholder:"z.B. Layer 1, DeFi",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 bg-white dark:bg-surface-elevated text-gray-900 dark:text-white"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Market Cap"}),e.jsxs("select",{value:$.marketcap,onChange:t=>ke({...$,marketcap:t.target.value}),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 bg-white dark:bg-surface-elevated text-gray-900 dark:text-white",children:[e.jsx("option",{value:"",children:"Select..."}),mr.map(t=>e.jsx("option",{value:t,children:t},t))]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Holding Period"}),e.jsxs("select",{value:$.holding_period,onChange:t=>ke({...$,holding_period:t.target.value}),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 bg-white dark:bg-surface-elevated text-gray-900 dark:text-white",children:[e.jsx("option",{value:"",children:"Select..."}),Mt.map(t=>e.jsx("option",{value:t,children:t},t))]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Bullrun"}),e.jsxs("select",{value:$.bullrun,onChange:t=>ke({...$,bullrun:t.target.value}),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 bg-white dark:bg-surface-elevated text-gray-900 dark:text-white",children:[e.jsx("option",{value:"",children:"Select..."}),xr.map(t=>e.jsx("option",{value:t,children:t},t))]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Portfolio %"}),e.jsx("input",{type:"text",value:$.portfolio_percentage,onChange:t=>ke({...$,portfolio_percentage:t.target.value}),placeholder:"z.B. 5%",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 bg-white dark:bg-surface-elevated text-gray-900 dark:text-white"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"ATH Goal"}
7),e.jsx("input",{type:"text",value:$.ath_goal,onChange:t=>ke({...$,ath_goal:t.target.value}),placeholder:"z.B. $200k",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 bg-white dark:bg-surface-elevated text-gray-900 dark:text-white"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Buy & Sell Levels URL"}),e.jsx("input",{type:"url",value:$.buy_sell_levels,onChange:t=>ke({...$,buy_sell_levels:t.target.value}),placeholder:"https://www.tradingview.com/chart/...",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 bg-white dark:bg-surface-elevated text-gray-900 dark:text-white"})]})]})]})]})}),e.jsxs("div",{className:"px-6 py-4 border-t border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-surface-elevated flex justify-end space-x-3",children:[e.jsx("button",{onClick:()=>{Ue(!1),ke({name:"",symbol:"",risk:"",project_analysis:"",marketcap:"",holding_period:"",bullrun:"",market_structure:"","4h_sentiment":"",trader_grade:"",compund_worth:"",live_charts:"",buy_sell_levels:"",portfolio_percentage:"",ath_goal:""})},className:"px-4 py-2 text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 rounded-lg hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors",children:"Abbrechen"}),e.jsx("button",{onClick:xt,disabled:!$.name||!$.symbol,className:"px-4 py-2 bg-surface-elevated hover:bg-surface-elevated disabled:bg-gray-400 disabled:cursor-not-allowed text-white rounded-lg transition-colors",children:"Coin hinzufügen"})]})]})}),Je&&e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4",children:e.jsxs("div",{className:"bg-white dark:bg-surface-elevated rounded-xl shadow-xl max-w-md w-full",children:[e.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-gray-200 dark:border-gray-700",children:[e.jsxs("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:["Add Trading Idea for ",Se==null?void 0:Se.symbol]}),e.jsx("button",{onClick:()=>{Ye(!1),Ie({url:"",symbol:"",title:"",description:"",entry_price:"",entry_type:"",trade_strategy:""})},className:"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200",children:e.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),e.jsxs("div",{className:"p-6 space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"TradingView URL *"}),e.jsx("input",{type:"url",value:ye.url,onChange:t=>Ie({...ye,url:t.target.value}),placeholder:"https://www.tradingview.com/chart/...",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 focus:border-transparent bg-white dark:bg-surface-elevated text-gray-900 dark:text-white",required:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Title (optional)"}),e.jsx("input",{type:"text",value:ye.title,onChange:t=>Ie({...ye,title:t.target.value}),placeholder:"Brief title for the trading idea...",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 focus:border-transparent bg-white dark:bg-surface-elevated text-gray-900 dark:text-white"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Description (optional)"}),e.jsx("textarea",{value:ye.description,onChange:t=>Ie({...ye,description:t.target.value}),placeholder:"Brief description of the trading idea...",rows:4,className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 focus:border-transparent bg-white dark:bg-surface-elevated text-gray-900 dark:text-white resize-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Entry Price (optional)"}),e.jsx("input",{type:"number",step:"0.00000001",value:ye.entry_price,onChange:t=>Ie({...ye,entry_price:t.target.value}),placeholder:"e.g., 95000",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 focus:border-transparent bg-white dark:bg-surface-elevated text-gray-900 dark:text-white"}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:"The price at which the trade should be entered"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Entry Type (optional)"}
7),e.jsxs("select",{value:ye.entry_type,onChange:t=>Ie({...ye,entry_type:t.target.value}),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 focus:border-transparent bg-white dark:bg-surface-elevated text-gray-900 dark:text-white",children:[e.jsx("option",{value:"",children:"Select direction..."}),e.jsx("option",{value:"LONG",children:"LONG"}),e.jsx("option",{value:"SHORT",children:"SHORT"})]}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:"Trade direction (LONG or SHORT)"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Trade Strategy (optional)"}),e.jsxs("select",{value:ye.trade_strategy,onChange:t=>Ie({...ye,trade_strategy:t.target.value}),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 focus:border-transparent bg-white dark:bg-surface-elevated text-gray-900 dark:text-white",children:[e.jsx("option",{value:"",children:"Select strategy..."}),e.jsx("option",{value:"BOX",children:"BOX (Enter at support/resistance)"}),e.jsx("option",{value:"BREAKOUT",children:"BREAKOUT (Enter on breakout through level)"})]}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:"BOX: Entry when price reaches level | BREAKOUT: Entry when price breaks through level"})]})]}),e.jsxs("div",{className:"px-6 py-4 border-t border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-surface-elevated flex justify-end space-x-3",children:[e.jsx("button",{onClick:()=>{Ye(!1),Ie({url:"",symbol:"",title:"",description:"",entry_price:"",entry_type:"",trade_strategy:""})},className:"px-4 py-2 text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 rounded-lg hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors",children:"Cancel"}),e.jsx("button",{onClick:Ct,disabled:!ye.url,className:"px-4 py-2 bg-surface-elevated hover:bg-surface-elevated disabled:bg-gray-400 disabled:cursor-not-allowed text-white rounded-lg transition-colors",children:"Add Trading Idea"})]})]})}),pe&&e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4",children:e.jsxs("div",{className:"bg-white dark:bg-surface-elevated rounded-xl shadow-xl max-w-4xl w-full max-h-[90vh] flex flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-gray-200 dark:border-gray-700",children:[e.jsxs("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:["Trading Ideas (",ce.length,")"]}),e.jsx("button",{onClick:()=>{Te(!1),ve(null),X("")},className:"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200",children:e.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsxs("div",{className:"p-6",children:[e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:ce.map((t,p)=>e.jsx("div",{className:"group relative bg-gradient-to-r from-[#1A1714] to-[#2A2520] p-[2px] rounded-xl shadow-lg cursor-pointer hover:scale-[1.02] transition-transform",onClick:()=>window.open(t.trading_idea_url,"_blank"),children:e.jsxs("div",{className:"bg-white dark:bg-surface-elevated rounded-xl overflow-hidden h-auto min-h-[200px] flex flex-col",children:[e.jsx("div",{className:"relative overflow-hidden",children:e.jsxs("div",{className:"aspect-w-16 aspect-h-9 bg-gray-100 dark:bg-[#0D1117]",children:[e.jsx("div",{className:"absolute top-2 left-2 z-10",children:e.jsx("span",{className:"text-xs bg-black bg-opacity-70 text-white px-2 py-1 rounded",children:"Open Chart"})}),e.jsx("img",{src:t.trading_idea_url,alt:"".concat(t.coin_symbol," trading chart"),className:"w-full h-full object-cover",onError:d=>{const x=d.target;x.src="https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/coins/Coin_Icons/default.png"}})]})}),e.jsxs("div",{className:"p-4 flex-grow",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("img",{src:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/coins/Coin_Icons/".concat(t.coin_symbol,".png"),alt:t.coin_symbol,className:"w-6 h-6",onError:d=>{const x=d.target;x.src="https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/coins/Coin_Icons/default.png"}}),e.jsx("span",{className:"font-bold text-lg text-gray-900 dark:text-white",children:t.coin_symbol})]}),e.jsx("span",{className:"text-sm bg-surface-elevated dark:bg-surface-elevated text-bronze-700 dark:text-bronze-400 px-3 py-1 rounded-full font-medium",children:t.status||"ACTIVE"})]}),e.jsxs("div",{className:"text-sm text-gray-600 dark:text-gray-400 mb-3",children:["Added: ",new Date(t.created_at).toLocaleDateString()]}),e.jsx("button",{onClick:d=>{d.stopPropagation(),window.open(t.trading_idea_url,"_blank")}
7,className:"text-sm font-medium text-bronze-600 dark:text-bronze-400 hover:text-bronze-500 dark:hover:text-bronze-300 transition-colors",children:"View Chart →"}),r&&e.jsxs("div",{className:"mt-4 pt-3 border-t border-gray-200 dark:border-gray-700 flex flex-col gap-2",children:[e.jsxs("button",{onClick:d=>{d.stopPropagation(),ve(t.id),X(""),f("")},className:"w-full px-3 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 rounded-md flex items-center justify-center space-x-2",children:[e.jsx("span",{children:"📈"}),e.jsx("span",{children:"Close with P&L"})]}),e.jsxs("button",{onClick:d=>{d.stopPropagation(),je(t.id),ve(null),Me(null)},className:"w-full px-3 py-2 text-sm font-medium text-orange-600 dark:text-orange-400 bg-surface-elevated dark:bg-surface-elevated hover:bg-surface-elevated dark:hover:bg-surface-elevated rounded-md flex items-center justify-center space-x-2",children:[e.jsx("span",{children:"⏸️"}),e.jsx("span",{children:"Mark Inactive"})]}),e.jsxs("button",{onClick:d=>{d.stopPropagation(),Me(t.id),ve(null),je(null)},className:"w-full px-3 py-2 text-sm font-medium text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-900/20 hover:bg-red-100 dark:hover:bg-red-900/30 rounded-md flex items-center justify-center space-x-2",children:[e.jsx(ur,{className:"w-4 h-4"}),e.jsx("span",{children:"Delete"})]})]})]})]})},"".concat(t.id,"-").concat(p)))}),Ce&&e.jsxs("div",{className:"mt-6 p-4 bg-surface-elevated dark:bg-surface-elevated border border-gray-200 dark:border-gray-700 rounded-lg",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4",children:"Close Trading Idea"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"P&L Percentage *"}),e.jsx("input",{type:"number",value:Ne,onChange:t=>X(t.target.value),placeholder:"Enter P&L percentage (e.g., 15.5 or -8.2)",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 focus:border-transparent bg-white dark:bg-surface-elevated text-gray-900 dark:text-white",step:"0.1",required:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Exit Chart URL (TradingView)"}),e.jsx("input",{type:"text",value:de,onChange:t=>f(t.target.value),placeholder:"Enter TradingView chart URL for trade exit",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 focus:border-transparent bg-white dark:bg-surface-elevated text-gray-900 dark:text-white"})]}),e.jsxs("div",{className:"flex space-x-3",children:[e.jsx("button",{onClick:()=>{ve(null),X(""),f("")},className:"px-4 py-2 text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 rounded-lg hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors",children:"Cancel"}),e.jsx("button",{onClick:async()=>{if(!Ne||!Ce)return;const t=ce.find(p=>p.id===Ce);if(t)try{await v.from("recent_trades").insert({symbol:t.coin_symbol,name:t.coin_name,trading_idea_url:t.trading_idea_url,pnl_percentage:parseFloat(Ne),exit_chart_image_url:de||null,status:"CLOSED"}),await v.from("trading_ideas").update({status:"CLOSED",closed_at:new Date().toISOString(),pnl_percentage:parseFloat(Ne)}).eq("id",Ce),await Be(),ve(null),X(""),f("");const p=t.coin_symbol,d=j.filter(x=>x.coin_symbol===p);ee(d)}catch(p){console.error("Error closing trade:",p)}},disabled:!Ne,className:"px-4 py-2 bg-green-500 hover:bg-green-600 disabled:bg-gray-400 disabled:cursor-not-allowed text-white rounded-lg transition-colors",children:"Close Trade"})]})]})]}),te&&e.jsxs("div",{className:"mt-6 p-4 bg-surface-elevated dark:bg-surface-elevated border border-gray-200 dark:border-gray-700 rounded-lg",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4",children:"Mark Trading Idea as Inactive"}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-4",children:"Are you sure you want to mark this trading idea as inactive? The idea will no longer appear in the active ideas list."}),e.jsxs("div",{className:"flex space-x-3",children:[e.jsx("button",{onClick:()=>je(null),className:"px-4 py-2 text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 rounded-lg hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors",children:"Cancel"}),e.jsx("button",{onClick:async()=>
7{if(te)try{await v.from("trading_ideas").update({status:"INACTIVE"}).eq("id",te),await Be();const t=ce.map(p=>p.id===te?{...p,status:"INACTIVE"}:p);ee(t),je(null)}catch(t){console.error("Error marking idea as inactive:",t)}},className:"px-4 py-2 bg-surface-elevated hover:bg-surface-elevated text-white rounded-lg transition-colors",children:"Mark Inactive"})]})]}),Fe&&e.jsxs("div",{className:"mt-6 p-4 bg-red-50 dark:bg-red-900/20 border border-gray-200 dark:border-gray-700 rounded-lg",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4",children:"Delete Trading Idea"}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-2",children:"Are you sure you want to permanently delete this trading idea?"}),e.jsx("p",{className:"text-sm text-red-600 dark:text-red-400 mb-4",children:"This action cannot be undone and will permanently remove the trading idea."}),e.jsxs("div",{className:"flex space-x-3",children:[e.jsx("button",{onClick:()=>Me(null),className:"px-4 py-2 text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 rounded-lg hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors",children:"Cancel"}),e.jsx("button",{onClick:async()=>{if(Fe)try{await v.from("trading_ideas").delete().eq("id",Fe),await Be();const t=ce.filter(p=>p.id!==Fe);ee(t),Me(null),t.length===0&&Te(!1)}catch(t){console.error("Error deleting trading idea:",t)}},className:"px-4 py-2 bg-red-500 hover:bg-red-600 text-white rounded-lg transition-colors",children:"Delete Permanently"})]})]})]})}),e.jsx("div",{className:"px-6 py-4 border-t border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-surface-elevated",children:e.jsx("button",{onClick:()=>{Te(!1),ve(null),X(""),je(null),Me(null)},className:"px-4 py-2 bg-gray-500 hover:bg-gray-600 text-white rounded-lg transition-colors",children:"Close"})})]})}),rt&&e.jsx(Ft,{isOpen:st,onClose:()=>{nt(!1),$e(null)},asset:rt}),Ee&&e.jsx(Nr,{isOpen:tt,onClose:()=>{Oe(!1),mt(null)},chartUrl:Ee.url,coinSymbol:Ee.symbol,coinName:Ee.name})]})}),aa=s.forwardRef(({view:n},c)=>{const o=Qe(),g=Ge(),[b,w]=s.useState([]),[R,G]=s.useState(!0),[u,U]=s.useState(null),[N,C]=s.useState(null),[T,Y]=s.useState(null),[W,L]=s.useState(!1),[M,S]=s.useState(null),[me,be]=s.useState(""),[xe,V]=s.useState(""),[k,P]=s.useState(!1),[_,F]=s.useState(null),[D,j]=s.useState(!1),[I,q]=s.useState(null),[oe,ue]=s.useState([]),[h,O]=s.useState(!1),[Q,K]=s.useState([]),[m,J]=s.useState(null),[he,le]=s.useState(""),[fe,ae]=s.useState(""),[re,B]=s.useState(null),[_e,ie]=s.useState(null),[A,pe]=s.useState(!1),[Te,ce]=s.useState(null),[ee,Ce]=s.useState({url:"",title:"",description:"",entry_price:"",entry_type:"",trade_strategy:""}),{isAdmin:ve,user:Ne}=yt(),[X,de]=s.useState(!1),[f,te]=s.useState({name:"",symbol:"",risk:"",holding_period:"",market_structure:"","4h_sentiment":"",live_charts:"",portfolio_percentage:"",ath_goal:""});s.useImperativeHandle(c,()=>({openAddModal:()=>de(!0)}));const[je,Fe]=s.useState([]),[Me,Je]=s.useState([]),[Ye,Se]=s.useState(!0),[et,ye]=s.useState(new Set),[Ie,at]=s.useState(!1),[Ue,$]=s.useState(null),{stocks:ke,loading:tt}=$t(),Oe=s.useMemo(()=>{const a={};return ke.forEach(y=>{a[y.symbol]=y.current_price}),a},[ke]),[Ee,mt]=s.useState({}),st=async()=>{try{const y=window.location.hostname==="localhost"?"https://cradermind.com/.netlify/functions/stocks-commodities-change":"/.netlify/functions/stocks-commodities-change",z=await(await fetch(y)).json();z.success&&z.data&&mt(z.data)}catch(a){console.error("Error fetching price changes:",a)}},nt=async()=>{if(!Ne){Se(!1);return}try{const{data:a,error:y}=await v.from("user_favorites").select("coin_id, view_type").eq("user_id",Ne.id);if(y)throw y;const E=(a==null?void 0:a.filter(ne=>ne.view_type==="trader").map(ne=>ne.coin_id))||[],z=(a==null?void 0:a.filter(ne=>ne.view_type==="investor").map(ne=>ne.coin_id))||[];Fe(E),Je(z)}catch(a){console.error("Error fetching favorites:",a)}finally{Se(!1)}},rt=async a=>{if(!Ne){console.error("No user logged in");return}const E=(n==="trader"?je:Me).includes(a);try{if(E){const{error:z}=await v.from("user_favorites").delete().eq("user_id",Ne.id).eq("coin_id",a).eq("view_type",n);if(z)throw z;n==="trader"?Fe(ne=>ne.filter(qe=>qe!==a)):Je(ne=>ne.filter(qe=>qe!==a))}else{const{error:z}=await v.from("user_favorites").insert({user_id:Ne.id,coin_id:a,view_type:n});if(z)throw z;n==="trader"?Fe(ne=>[...ne,a]):Je(ne=>[...ne,a])}}catch(z){console.error("Error updating favorites:",z)}},$e=async()=>{try{const{data:a,error:y}=await v.from("trading_ideas_gated").select("*").eq("status","ACTIVE").order("created_at",{ascending:!1});if(y)throw y;ue(a||[])}catch(a){console.error("Error fetching trading ideas:",a)}},r=async()=>{try{const{data:a}=await v.from("commodity_levels").select("commodity_symbol");ye(new Set((a==null?void 0:a.map(y=>y.commodity_symbol))||[]))}catch(a){console.error("Error fetching commodities with levels:",a)}};s.useEffect(()=>{(async()=>{const{data:E,error:z}=await v.from("commodities").select("*");z||w(E||[]),G(!1)})(),$e(),st(),nt(),r();const y=setInterval(()=>{st()},6e4);return()=>{clearInterval(y)}},[Ne]);const i=async()=>
7{if(!f.name||!f.symbol){alert("Name und Symbol sind erforderlich!");return}try{const{error:a}=await v.from("commodities").insert({name:f.name,symbol:f.symbol,risk:f.risk?parseInt(f.risk):null,holding_period:f.holding_period||null,market_structure:f.market_structure||null,"4h_sentiment":f["4h_sentiment"]||null,live_charts:f.live_charts||null,portfolio_percentage:f.portfolio_percentage||null,ath_goal:f.ath_goal||null});if(a){console.error("Error adding commodity:",a),alert("Fehler beim Hinzufügen des Rohstoffs!");return}const{data:y,error:E}=await v.from("commodities").select("*");E||w(y||[]),de(!1),te({name:"",symbol:"",risk:"",holding_period:"",market_structure:"","4h_sentiment":"",live_charts:"",portfolio_percentage:"",ath_goal:""}),console.log("✅ Commodity added successfully")}catch(a){console.error("Error adding commodity:",a),alert("Fehler beim Hinzufügen des Rohstoffs!")}},l=a=>{U(a),C({...ht[a]})},H=()=>{U(null),C(null)},se=async a=>{var ne,qe,pt;if(!N)return;const{id:y,...E}=N,{error:z}=await v.from("commodities").update(E).eq("id",y);if(!z){const bt=b.findIndex(We=>We.id===y);if(bt!==-1){const We=[...b];We[bt]={...N},w(We)}if(N.trading_ideas&&N.trading_ideas.trim()!==""){const We=N.symbol==="XAU"?"Gold":N.symbol==="XAG"?"Silber":N.symbol||((ne=N.name)==null?void 0:ne.toUpperCase()),Tt={type:"trading_idea",message:"Neue Trading Idee bei ".concat(We),link:N.trading_ideas,symbol:N.symbol||((qe=N.name)==null?void 0:qe.toUpperCase())};try{const{data:t,error:p}=await v.from("notifications").insert([Tt]).select();if(p)console.error("❌ Insert Trading-Idee fehlgeschlagen:",p);else{console.log("✅ Trading-Idee erfolgreich eingefügt");try{const d=(pt=t==null?void 0:t[0])==null?void 0:pt.id,x="Neue Trading Idee bei ".concat(We);(await fetch("/.netlify/functions/send-telegram-notification",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:x,type:"trading_idea",notificationId:d})})).ok?console.log("Telegram notification sent successfully"):console.error("Failed to send Telegram notification")}catch(d){console.error("Error sending Telegram notification:",d)}}}catch(t){console.error("Exception beim Insert:",t)}}U(null),C(null)}},ge=(a,y,E)=>e.jsxs("select",{value:a||"",onChange:z=>E(z.target.value),className:"w-full px-2 py-1 bg-gray-100 dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded",children:[e.jsx("option",{value:"",children:"Select..."}),y.map(z=>e.jsx("option",{value:z,children:z},z))]}),xt=(a,y)=>{if(u===y)return ge(N.market_structure,lt,z=>{const ne={...N,market_structure:z};z!==a.market_structure&&(ne.m_structure_timestamp=new Date().toISOString()),C(ne)});const E=e.jsxs("div",{className:"flex flex-col",children:[e.jsx("div",{className:"min-h-[32px] flex items-center flex-shrink-0",children:Ke(a.market_structure,"market_structure","marketStructure")}),a.m_structure_timestamp&&e.jsxs("div",{className:"text-xs text-gray-400 dark:text-gray-500 mt-0.5",children:["Updated: ",new Date(a.m_structure_timestamp).toLocaleString()]})]});return o?e.jsx("div",{className:"blur-[6px] select-none pointer-events-none",children:E}):E},Be=(a,y)=>{if(u===y)return ge(N["4h_sentiment"],ot,z=>{const ne={...N,"4h_sentiment":z};z!==a["4h_sentiment"]&&(ne["4h_sentiment_timestamp"]=new Date().toISOString()),C(ne)});const E=e.jsxs("div",{className:"flex flex-col",children:[e.jsx("div",{className:"min-h-[32px] flex items-center flex-shrink-0",children:Ke(a["4h_sentiment"],"sentiment","sentiment4h")}),a["4h_sentiment_timestamp"]&&e.jsxs("div",{className:"text-xs text-gray-400 dark:text-gray-500 mt-0.5",children:["Updated: ",new Date(a["4h_sentiment_timestamp"]).toLocaleString()]})]});return o?e.jsx("div",{className:"blur-[6px] select-none pointer-events-none",children:E}):E},ut=a=>{$({symbol:a.symbol||a.name,name:a.name,live_charts:a.live_charts}),at(!0)},jt=async()=>{if(!(!M||!me))try{const{error:a}=await v.from("recent_trades").insert({symbol:M.symbol||M.name,name:M.name,trading_idea_url:M.trading_ideas,pnl_percentage:parseFloat(me),exit_chart_image_url:xe||null,status:"CLOSED"});if(a){console.error("Error inserting into recent_trades:",a);return}const{error:y}=await v.from("commodities").update({trading_ideas:null}).eq("id",M.id);if(y){console.error("Error clearing trading_ideas:",y);return}w(E=>E.map(z=>z.id===M.id?{...z,trading_ideas:null}:z)),L(!1),S(null),be(""),console.log("✅ Trade closed successfully")}catch(a){console.error("Error closing trade:",a)}},kt=()=>{L(!1),S(null),be(""),V("")},Ct=async()=>
7{if(_)try{const{error:a}=await v.from("commodities").update({trading_ideas:null}).eq("id",_.id);if(a){console.error("Error updating commodity:",a);return}w(y=>y.map(E=>E.id===_.id?{...E,trading_ideas:null}:E)),P(!1),F(null)}catch(a){console.error("Error deleting trade:",a)}},St=()=>{P(!1),F(null)},It=async()=>{if(I)try{const{error:a}=await v.from("recent_trades").insert({symbol:I.symbol||I.name,name:I.name,trading_idea_url:I.trading_ideas,pnl_percentage:null,status:"INACTIVE"});if(a){console.error("Error inserting into recent_trades:",a);return}const{error:y}=await v.from("commodities").update({trading_ideas:null}).eq("id",I.id);if(y){console.error("Error clearing trading_ideas:",y);return}w(E=>E.map(z=>z.id===I.id?{...z,trading_ideas:null}:z)),j(!1),q(null),console.log("✅ Trade marked as inactive successfully")}catch(a){console.error("Error marking trade as inactive:",a)}},Et=()=>{j(!1),q(null)},At=async()=>{var a;if(!(!ee.url||!Te))try{const{error:y}=await v.from("trading_ideas").insert({coin_symbol:Te.symbol||((a=Te.name)==null?void 0:a.toUpperCase()),coin_name:Te.name,trading_idea_url:ee.url,title:ee.title||null,description:ee.description||null,entry_price:ee.entry_price?parseFloat(ee.entry_price):null,entry_type:ee.entry_type||null,trade_strategy:ee.trade_strategy||null,status:"ACTIVE"});
7if(y){console.error("Error inserting trading idea:",y),alert("Failed to add trading idea");return}const{data:{session:E}}=await v.auth.getSession();E&&await fetch("https://bsmvcmmwkmaqpgrmvjql.supabase.co/functions/v1/process-notification-queue",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(E.access_token)}}),await $e(),pe(!1),Ce({url:"",title:"",description:"",entry_price:"",entry_type:"",trade_strategy:""}),ce(null),console.log("✅ Trading idea added successfully")}catch(y){console.error("Error adding trading idea:",y),alert("Failed to add trading idea")}};if(R)return e.jsx("div",{children:"Lade Rohstoffe..."});const ht=[...b].sort((a,y)=>a.id-y.id);return e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"rounded-lg border border-gray-200 dark:border-gray-700 bg-white dark:bg-[#0f0d0a] max-h-[900px] overflow-y-auto",children:n==="trader"?e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{className:"sticky top-0 bg-gray-50/80 dark:bg-[#1A1714]/95 backdrop-blur-sm z-10",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-2 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"#"}),e.jsx("th",{className:"px-2 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Name"}),e.jsx("th",{className:"px-2 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Price"}),e.jsx("th",{className:"px-2 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Market Structure"}),e.jsx("th",{className:"px-2 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"4h Sentiment"}),e.jsx("th",{className:"px-2 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Live Chart"}),e.jsx("th",{className:"px-2 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Trading Ideas"}),ve&&e.jsx("th",{className:"px-2 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Actions"})]})}),e.jsx("tbody",{className:"bg-white dark:bg-[#0f0d0a] divide-y divide-gray-200 dark:divide-gray-700",children:ht.map((a,y)=>e.jsxs("tr",{className:"hover:bg-gray-50 dark:hover:bg-[#1A1714] transition-colors cursor-pointer",onClick:()=>{u!==y&&(window.location.href="/commodity/".concat(a.symbol))},children:[e.jsx("td",{className:"px-2 py-3 whitespace-nowrap",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx(it,{className:"h-4 w-4 cursor-pointer transition-colors ".concat(je.includes(a.id)?"text-yellow-500 fill-yellow-500":"text-gray-400 hover:text-yellow-500"," ").concat(Ne?"":"opacity-50 cursor-not-allowed"),onClick:E=>{E.stopPropagation(),Ne&&rt(a.id)}}),e.jsx("span",{className:"ml-2 text-base text-gray-500 dark:text-gray-400",children:y+1})]})}),e.jsx("td",{className:"px-2 py-3 whitespace-nowrap text-gray-900 dark:text-gray-100",children:u===y?e.jsx("input",{type:"text",value:N.name,onChange:E=>C({...N,name:E.target.value}),className:"w-full px-2 py-1 bg-gray-100 dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded text-gray-900 dark:text-gray-100"}):e.jsxs("div",{className:"flex items-center gap-2",children:[a.name==="Gold"&&e.jsx("img",{src:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/coins/Coin_Icons/XAU.png",alt:"Gold Icon",className:"w-5 h-5 inline-block mr-1"}),(a.name==="Silber"||a.symbol==="XAG")&&e.jsx("img",{src:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/coins/Coin_Icons/XAG.png",alt:"Silber Icon",className:"w-5 h-5 inline-block mr-1"}),(a.name==="Natural Gas"||a.symbol==="NATGAS")&&e.jsx("img",{src:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/coins/Coin_Icons/GAS%20(1).png",alt:"Natural Gas Icon",className:"w-5 h-5 inline-block mr-1"}),(a.name==="Brent Oil"||a.symbol==="BRENT")&&e.jsx("img",{src:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/coins/Coin_Icons/Brent%20Oil.png",alt:"Brent Oil Icon",className:"w-5 h-5 inline-block mr-1"}),(a.name==="Crude Oil"||a.symbol==="WTI")&&e.jsx("img",{src:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/coins/Coin_Icons/WTI.jpeg",alt:"Crude Oil Icon",className:"w-5 h-5 inline-block mr-1"}),(a.name==="Coffee"||a.symbol==="COFFEE")&&e.jsx("img",{src:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/images/coffee.png",alt:"Coffee Icon",className:"w-5 h-5 inline-block mr-1"}),(a.name==="Gasoline"||a.symbol==="GASOLINE")&&e.jsx("img",{src:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/images/gasoline.png",alt:"Gasoline Icon",className:"w-5 h-5 inline-block mr-1"}),e.jsxs("span",{className:"text-responsive-sm font-medium text-gray-900 dark:text-gray-100",children:[a.name," ",e.jsx("span",{className:"text-responsive-sm text-gray-500 dark:text-gray-400",children:a.symbol})]})]})}),e.jsx("td",{className:"px-2 py-3 whitespace-nowrap text-gray-900 dark:text-gray-100",children:tt&&Object.keys(Oe).length===0?e.jsx("span",{className:"text-sm text-gray-500",children:"Loading..."}):Oe[a.symbol]?e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("span",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:["$",Oe[a.symbol].toLocaleStr
7ing("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})]}),Ee[a.symbol]!==void 0&&e.jsxs("span",{className:"text-xs ".concat(Ee[a.symbol]>=0?"text-green-500":"text-red-500"),children:[Ee[a.symbol]>=0?"+":"",Ee[a.symbol].toFixed(2),"%"]})]}):a.price?e.jsxs("span",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:["$",parseFloat(a.price).toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})]}):e.jsx("span",{className:"text-sm text-gray-500",children:"-"})}),e.jsx("td",{className:"px-2 py-3 whitespace-nowrap text-gray-900 dark:text-gray-100",children:xt(a,y)}),e.jsx("td",{className:"px-2 py-3 whitespace-nowrap text-gray-900 dark:text-gray-100",children:Be(a,y)}),e.jsx("td",{className:"px-2 py-3 whitespace-nowrap text-gray-900 dark:text-gray-100",children:u===y?e.jsx("input",{type:"text",value:N.live_charts,onChange:E=>C({...N,live_charts:E.target.value}),className:"w-full px-2 py-1 bg-gray-100 dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded"}):o?e.jsx("div",{className:"blur-[6px] select-none pointer-events-none",children:e.jsx("span",{className:"live-badge pl-4 text-bronze-600 dark:text-bronze-400 text-sm",children:"View Chart"})}):a.live_charts?e.jsx("a",{href:a.live_charts,target:"_blank",rel:"noopener noreferrer",onClick:E=>{E.stopPropagation(),window.open(a.live_charts,"_blank")},className:"live-badge pl-4 text-bronze-600 dark:text-bronze-400 hover:text-bronze-500 dark:hover:text-bronze-300 text-sm",children:"View Chart"}):e.jsx("span",{className:"text-sm text-gray-500",children:"No"})}),e.jsx("td",{className:"px-2 py-3 whitespace-nowrap text-gray-900 dark:text-gray-100",children:u===y&&ve?e.jsx("button",{onClick:E=>{E.stopPropagation(),ce(a),Ce({url:"",description:""}),pe(!0)},className:"p-2 bg-surface-elevated hover:bg-surface-elevated text-white rounded-lg transition-colors flex items-center justify-center",title:"Add Trading Idea",children:e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})})}):o?e.jsx("div",{className:"blur-[6px] select-none pointer-events-none",children:e.jsx("span",{className:"text-bronze-600 dark:text-bronze-400 text-sm",children:"1 Idea(s)"})}):oe.filter(z=>{var ne;return z.coin_symbol===(a.symbol||((ne=a.name)==null?void 0:ne.toUpperCase()))||z.coin_name===a.name}).length>0?e.jsxs("span",{className:"text-bronze-600 dark:text-bronze-400 text-sm cursor-pointer hover:text-bronze-500",onClick:E=>{E.stopPropagation();const z=oe.filter(ne=>{var qe;return ne.coin_symbol===(a.symbol||((qe=a.name)==null?void 0:qe.toUpperCase()))||ne.coin_name===a.name});z.length>0&&(K(z),O(!0))},children:[oe.filter(E=>{var z;return E.coin_symbol===(a.symbol||((z=a.name)==null?void 0:z.toUpperCase()))||E.coin_name===a.name}).length," Idea(s)"]}):e.jsx("span",{className:"text-sm text-gray-500",children:"No"})}),ve&&e.jsx("td",{className:"px-2 py-3 whitespace-nowrap",children:e.jsx("div",{className:"flex items-center space-x-2",children:u===y?e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:()=>se(),className:"text-green-600 hover:text-green-700 transition-colors",children:e.jsx(ct,{className:"h-5 w-5"})}),e.jsx("button",{onClick:H,className:"text-gray-600 hover:text-gray-700 transition-colors",children:e.jsx(Re,{className:"h-5 w-5"})})]}):e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:E=>{E.stopPropagation(),l(y)},className:"text-bronze-600 hover:text-bronze-700 transition-colors",children:e.jsx(dt,{className:"h-5 w-5"})}),e.jsx("button",{onClick:E=>{E.stopPropagation(),ut(a)},className:"text-yellow-600 hover:text-yellow-800",title:"Alarm auslösen",children:e.jsx("span",{role:"img","aria-label":"Alarm",children:"🔔"})})]})})})]},a.id))})]}):e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{className:"sticky top-0 bg-gray-50/80 dark:bg-[#1A1714]/95 backdrop-blur-sm z-10",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-2 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"#"}),e.jsx("th",{className:"px-2 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Name"}),e.jsx("th",{className:"px-2 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Price"}),e.jsx("th",{className:"px-2 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Risk"}),e.jsx("th",{className:"px-2 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Holding Perio
7d"}),e.jsx("th",{className:"px-2 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Portfolio%"}),e.jsx("th",{className:"px-2 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"ATH Goal"}),e.jsx("th",{className:"px-2 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Buy&Sell Levels"}),ve&&e.jsx("th",{className:"px-2 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Actions"})]})}),e.jsx("tbody",{className:"bg-white dark:bg-[#0f0d0a] divide-y divide-gray-200 dark:divide-gray-700",children:ht.map((a,y)=>{var E;return e.jsxs("tr",{className:"hover:bg-gray-50 dark:hover:bg-[#1A1714] transition-colors cursor-pointer",onClick:()=>{u!==y&&(window.location.href="/commodity/".concat(a.symbol))},children:[e.jsx("td",{className:"px-2 py-3 whitespace-nowrap",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx(it,{className:"h-4 w-4 cursor-pointer transition-colors ".concat(Me.includes(a.id)?"text-yellow-500 fill-yellow-500":"text-gray-400 hover:text-yellow-500"," ").concat(Ne?"":"opacity-50 cursor-not-allowed"),onClick:z=>{z.stopPropagation(),Ne&&rt(a.id)}}),e.jsx("span",{className:"ml-2 text-base text-gray-500 dark:text-gray-400",children:y+1})]})}),e.jsxs("td",{className:"px-2 py-3 whitespace-nowrap text-gray-900 dark:text-gray-100 flex items-center gap-2",children:[a.name==="Gold"&&e.jsx("img",{src:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/coins/Coin_Icons/XAU.png",alt:"Gold Icon",className:"w-5 h-5 inline-block mr-1"}),(a.name==="Silber"||a.symbol==="XAG")&&e.jsx("img",{src:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/coins/Coin_Icons/XAG.png",alt:"Silber Icon",className:"w-5 h-5 inline-block mr-1"}),(a.name==="Natural Gas"||a.symbol==="NATGAS")&&e.jsx("img",{src:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/coins/Coin_Icons/GAS%20(1).png",alt:"Natural Gas Icon",className:"w-5 h-5 inline-block mr-1"}),(a.name==="Brent Oil"||a.symbol==="BRENT")&&e.jsx("img",{src:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/coins/Coin_Icons/Brent%20Oil.png",alt:"Brent Oil Icon",className:"w-5 h-5 inline-block mr-1"}),(a.name==="Crude Oil"||a.symbol==="WTI")&&e.jsx("img",{src:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/coins/Coin_Icons/WTI.jpeg",alt:"Crude Oil Icon",className:"w-5 h-5 inline-block mr-1"}),(a.name==="Coffee"||a.symbol==="COFFEE")&&e.jsx("img",{src:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/images/coffee.png",alt:"Coffee Icon",className:"w-5 h-5 inline-block mr-1"}),(a.name==="Gasoline"||a.symbol==="GASOLINE")&&e.jsx("img",{src:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/images/gasoline.png",alt:"Gasoline Icon",className:"w-5 h-5 inline-block mr-1"}),ve&&u===y?e.jsx("input",{type:"text",className:"w-full px-2 py-1 bg-gray-100 dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded text-gray-900 dark:text-gray-100",value:N.name,onChange:z=>C({...N,name:z.target.value})}):e.jsxs("span",{children:[a.name," ",e.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:a.symbol})]})]}),e.jsx("td",{className:"px-2 py-3 whitespace-nowrap text-gray-900 dark:text-gray-100",children:tt&&Object.keys(Oe).length===0?e.jsx("span",{className:"text-sm text-gray-500",children:"Loading..."}):Oe[a.symbol]?e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("span",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:["$",Oe[a.symbol].toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})]}),Ee[a.symbol]!==void 0&&e.jsxs("span",{className:"text-xs ".concat(Ee[a.symbol]>=0?"text-green-500":"text-red-500"),children:[Ee[a.symbol]>=0?"+":"",Ee[a.symbol].toFixed(2),"%"]})]}):a.price?e.jsxs("span",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:["$",parseFloat(a.price).toLocaleStr
7ing("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})]}):e.jsx("span",{className:"text-sm text-gray-500",children:"-"})}),e.jsx("td",{className:"px-2 py-3 min-w-[150px]",children:ve&&u===y?e.jsx("input",{type:"number",value:String((E=N.risk)!=null?E:""),onChange:z=>C({...N,risk:parseInt(z.target.value)}),className:"w-full px-2 py-1 bg-gray-100 dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded",min:"1",max:"10"}):qt(Number(a.risk))}),e.jsx("td",{className:"px-2 py-3 whitespace-nowrap text-gray-900 dark:text-gray-100",children:ve&&u===y?e.jsx("input",{type:"text",value:N.holding_period,onChange:z=>C({...N,holding_period:z.target.value}),className:"w-full px-2 py-1 bg-gray-100 dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded"}):Ke(a.holding_period,"holding_period","holdingPeriod")}),e.jsx("td",{className:"px-2 py-3 whitespace-nowrap text-gray-900 dark:text-gray-100",children:ve&&u===y?e.jsx("input",{type:"text",value:N.portfolio_percentage,onChange:z=>C({...N,portfolio_percentage:z.target.value}),className:"w-full px-2 py-1 bg-gray-100 dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded"}):e.jsxs("span",{className:"text-sm text-gray-700 dark:text-gray-300 ".concat(o?"blur-sm select-none":""),children:[a.portfolio_percentage,a.portfolio_percentage?" %":""]})}),e.jsx("td",{className:"px-2 py-3 whitespace-nowrap text-gray-900 dark:text-gray-100",children:ve&&u===y?e.jsx("input",{type:"text",value:N.ath_goal,onChange:z=>C({...N,ath_goal:z.target.value}),className:"w-full px-2 py-1 bg-gray-100 dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded"}):e.jsxs("span",{className:"text-sm text-gray-700 dark:text-gray-300 ".concat(o?"blur-sm select-none":""),children:[a.ath_goal,a.ath_goal?" $":""]})}),e.jsx("td",{className:"px-2 py-3 whitespace-nowrap text-gray-900 dark:text-gray-100",children:o?e.jsx("span",{className:"text-sm text-gray-500 blur-sm select-none",children:"Locked"}):et.has(a.symbol)?e.jsx("button",{onClick:z=>{z.preventDefault(),z.stopPropagation(),window.location.href="/commodity/".concat(a.symbol,"#levels")},className:"text-bronze-600 dark:text-bronze-400 hover:text-bronze-500 dark:hover:text-bronze-300 text-sm underline",children:"View Levels"}):e.jsx("span",{className:"text-sm text-gray-500",children:"No"})}),ve&&e.jsx("td",{className:"px-2 py-3 whitespace-nowrap",children:e.jsx("div",{className:"flex items-center space-x-2",children:u===y?e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:()=>se(),className:"text-green-600 hover:text-green-700 transition-colors",children:e.jsx(ct,{className:"h-5 w-5"})}),e.jsx("button",{onClick:H,className:"text-gray-600 hover:text-gray-700 transition-colors",children:e.jsx(Re,{className:"h-5 w-5"})})]}):e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:z=>{z.stopPropagation(),l(y)},className:"text-bronze-600 hover:text-bronze-700 transition-colors",children:e.jsx(dt,{className:"h-5 w-5"})}),e.jsx("button",{onClick:z=>{z.stopPropagation(),ut(a)},className:"text-yellow-600 hover:text-yellow-800",title:"Alarm auslösen",children:e.jsx("span",{role:"img","aria-label":"Alarm",children:"🔔"})})]})})})]},a.id)})})]})}),o&&e.jsx("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 z-20 pointer-events-none",children:e.jsxs("div",{className:"flex items-center gap-2 px-5 py-2 rounded-full shadow-lg pointer-events-auto cursor-pointer",style:{background:"linear-gradient(135deg, #C9A96E, #A8864A)"},onClick:()=>g("/pricing"),children:[e.jsx(gt,{className:"w-4 h-4 text-white"}),e.jsx("span",{className:"text-white text-sm font-bold tracking-wider",children:"PRO"})]})}),W&&e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:e.jsxs("div",{className:"bg-white dark:bg-surface-elevated rounded-lg p-6 max-w-md w-full mx-4",children:[e.jsx("h3",{className:"text-lg font-semibold mb-4 text-gray-900 dark:text-white",children:"Trade schließen"}),e.jsxs("p",{className:"mb-4 text-gray-700 dark:text-gray-300",children:["Möchtest du den Trade für ",(M==null?void 0:M.symbol)||(M==null?void 0:M.name)," wirklich schließen?"]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"PnL Prozent (%)"}),e.jsx("input",{type:"number",step:"0.1",value:me,onChange:a=>be(a.target.value),placeholder:"Enter PnL % (e.g., 23.5 for +23.5%)",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-bronze-500 dark:bg-gray-700 dark:text-white"})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Exit Chart URL (TradingView)"}),e.jsx("input",{type:"text",value:xe,onChange:a=>V(a.target.value),placeholder:"Enter TradingView chart URL for trade exit",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-bronze-500 dark:bg-gray-700 dark:text-white"})]}),e.jsxs("div",{className:"flex justify-end space-x-3",children:[e.jsx("button",{onClick:kt,className:"px-4 py-2 text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200",children:"Abbrechen"}),e.jsx("button",{onClick:jt,disabled:!me,className:"px-4 py-2 bg-green-600 text-white rounded-md hover:bg-green-700 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:"Schließen"})]})]})}),k&&e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:e.jsxs("div",{className:"bg-white dark:bg-surface-elevated rounded-lg p-6 max-w-md w-full mx-4",children:[e.jsx("h3",{className:"text-lg font-semibold mb-4 text-gray-900 dark:text-white",children:"Trade löschen"}),e.jsxs("p",{className:"mb-4 text-gray-700 dark:text-gray-300",children:["Möchtest du den Trade für ",(_==null?void 0:_.symbol)||(_==null?void 0:_.name)," wirklich löschen?"]}),e.jsxs("div",{className:"flex justify-end space-x-3",children:[e.jsx("button",{onClick:St,className:"px-4 py-2 text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200",children:"Abbrechen"}),e.jsx("button",{onClick:Ct,className:"px-4 py-2 bg-red-600 text-white rounded-md hover:bg-red-700",children:"Löschen"})]})]})}),D&&e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:e.jsxs("div",{className:"bg-white dark:bg-surface-elevated rounded-lg p-6 max-w-md w-full mx-4",children:[e.jsx("h3",{className:"text-lg font-semibold mb-4 text-gray-900 dark:text-white",children:"Trade inaktiv setzen"}),e.jsxs("p",{className:"mb-4 text-gray-700 dark:text-gray-300",children:["Möchtest du den Trade für ",(I==null?void 0:I.symbol)||(I==null?void 0:I.name)," wirklich inaktiv setzen?"]}),e.jsxs("div",{className:"flex justify-end space-x-3",children:[e.jsx("button",{onClick:Et,className:"px-4 py-2 text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200",children:"Abbrechen"}),e.jsx("button",{onClick:It,className:"px-4 py-2 bg-surface-elevated text-white rounded-md hover:bg-surface-elevated",children:"Inaktiv setzen"})]})]})}),A&&e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4",children:e.jsxs("div",{className:"bg-white dark:bg-surface-elevated rounded-xl shadow-xl max-w-md w-full max-h-[90vh] overflow-y-auto",children:[e.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-gray-200 dark:border-gray-700",children:[e.jsxs("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:["Add Trading Idea for ",Te==null?void 0:Te.name]}),e.jsx("button",{onClick:()=>{pe(!1),Ce({url:"",title:"",description:"",entry_price:"",entry_type:"",trade_strategy:""}),ce(null)},className:"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200",children:e.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),e.jsxs("div",{className:"p-6 space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"TradingView 
7URL *"}),e.jsx("input",{type:"url",value:ee.url,onChange:a=>Ce({...ee,url:a.target.value}),placeholder:"https://www.tradingview.com/chart/...",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 focus:border-transparent bg-white dark:bg-surface-elevated text-gray-900 dark:text-white",required:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Title (optional)"}),e.jsx("input",{type:"text",value:ee.title,onChange:a=>Ce({...ee,title:a.target.value}),placeholder:"Brief title for the trading idea...",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 focus:border-transparent bg-white dark:bg-surface-elevated text-gray-900 dark:text-white"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Description (optional)"}),e.jsx("textarea",{value:ee.description,onChange:a=>Ce({...ee,description:a.target.value}),placeholder:"Brief description of the trading idea...",rows:3,className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 focus:border-transparent bg-white dark:bg-surface-elevated text-gray-900 dark:text-white resize-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Entry Price (optional)"}),e.jsx("input",{type:"number",step:"0.00000001",value:ee.entry_price,onChange:a=>Ce({...ee,entry_price:a.target.value}),placeholder:"e.g., 2650",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 focus:border-transparent bg-white dark:bg-surface-elevated text-gray-900 dark:text-white"}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:"The price at which the trade should be entered"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Entry Type (optional)"}),e.jsxs("select",{value:ee.entry_type,onChange:a=>Ce({...ee,entry_type:a.target.value}),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 focus:border-transparent bg-white dark:bg-surface-elevated text-gray-900 dark:text-white",children:[e.jsx("option",{value:"",children:"Select direction..."}),e.jsx("option",{value:"LONG",children:"LONG"}),e.jsx("option",{value:"SHORT",children:"SHORT"})]}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:"Trade direction (LONG or SHORT)"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Trade Strategy (optional)"}),e.jsxs("select",{value:ee.trade_strategy,onChange:a=>Ce({...ee,trade_strategy:a.target.value}),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 focus:border-transparent bg-white dark:bg-surface-elevated text-gray-900 dark:text-white",children:[e.jsx("option",{value:"",children:"Select strategy..."}),e.jsx("option",{value:"BOX",children:"BOX (Enter at support/resistance)"}),e.jsx("option",{value:"BREAKOUT",children:"BREAKOUT (Enter on breakout through level)"})]}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:"BOX: Entry when price reaches level | BREAKOUT: Entry when price breaks through level"})]})]}),e.jsxs("div",{className:"px-6 py-4 border-t border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-surface-elevated flex justify-end space-x-3",children:[e.jsx("button",{onClick:()=>{pe(!1),Ce({url:"",title:"",description:"",entry_price:"",entry_type:"",trade_strategy:""}),ce(null)},className:"px-4 py-2 text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 rounded-lg hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors",children:"Cancel"}),e.jsx("button",{onClick:At,disabled:!ee.url,className:"px-4 py-2 bg-surface-elevated hover:bg-surface-elevated disabled:bg-gray-400 disabled:cursor-not-allowed text-white rounded-lg transition-colors",children:"Add Trading Idea"})]})]})}),h&&e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4",children:e.jsx("div",{className:"bg-white dark:bg-surface-elevated rounded-lg max-w-6xl w-full max-h-[90vh] overflow-y-auto",children:e.jsxs("div",{className:"p-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsxs("h3",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:["Trading Ideas (",Q.length,")"]}),e.jsx("button",{onClick:()=>{O(!1),K([]),J(null),le(""),ae(""),B(null),ie(null)},className:"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200",children:e.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:Q.map(a=>e.jsx("div",{className:"group relative bg-gradient-to-r from-[#1A1714] to-[#2A2520] p-[2px] rounded-lg shadow-lg cursor-pointer hover:scale-[1.02] transition-transform",onClick:()=>window.open(a.trading_idea_url,"_blank"),children:e.jsxs("div",{className:"bg-white dark:bg-surface-elevated rounded-lg overflow-hidden h-auto min-h-[300px] flex flex-col",children:[e.jsxs("div",{className:"relative h-44 flex-shrink-0",children:[e.jsx("div",{className:"absolute top-2 left-2 z-10",children:e.jsx("span",{className:"text-xs bg-black bg-opacity-70 text-white px-2 py-1 rounded",children:"Open Chart"})}),e.jsx("img",{src:a.trading_idea_url,alt:"".concat(a.coin_symbol," trading chart"),className:"w-full h-full object-contain",onError:y=>{const E=y.target;E.src="https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/coins/Coin_Icons/default.png"}})]}),e.jsxs("div",{className:"p-3 flex-grow",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("img",{src:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/coins/Coin_Icons/".concat(a.coin_symbol,".png"),alt:a.coin_symbol,className:"w-5 h-5",onError:y=>{const E=y.target;E.src="https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/coins/Coin_Icons/default.png"}}),e.jsx("span",{className:"font-semibold text-gray-900 dark:text-white",children:a.coin_symbol})]}),e.jsx("span",{className:"text-xs bg-surface-elevated dark:bg-surface-elevated text-bronze-700 dark:text-bronze-400 px-2 py-1 rounded",children:a.status||"ACTIVE"})]}),e.jsxs("div",{className:"text-xs text-gray-500 dark:text-gray-400 mb-2",children:["Added: ",new Date(a.created_at).toLocaleDateString()]}),a.description&&e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 mb-3 line-clamp-2",children:a.description}),ve&&e.jsxs("div",{className:"mt-4 pt-3 border-t border-gray-200 dark:border-gray-700 flex flex-col gap-2",children:[e.jsxs("button",{onClick:y=>{y.stopPropagation(),J(a.id),le(""),ae("")},className:"w-full px-3 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 rounded-md flex items-center justify-center space-x-2",children:[e.jsx("span",{children:"📈"}),e.jsx("span",{children:"Close with P&L"})]}),e.jsxs("button",{onClick:y=>{y.stopPropagation(),B(a.id),J(null),ie(null)},className:"w-full px-3 py-2 text-sm font-medium text-orange-600 dar
7k:text-orange-400 bg-surface-elevated dark:bg-surface-elevated hover:bg-surface-elevated dark:hover:bg-surface-elevated rounded-md flex items-center justify-center space-x-2",children:[e.jsx("span",{children:"⏸️"}),e.jsx("span",{children:"Mark Inactive"})]}),e.jsxs("button",{onClick:y=>{y.stopPropagation(),ie(a.id),J(null),B(null)},className:"w-full px-3 py-2 text-sm font-medium text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-900/20 hover:bg-red-100 dark:hover:bg-red-900/30 rounded-md flex items-center justify-center space-x-2",children:[e.jsx(Dr,{className:"w-4 h-4"}),e.jsx("span",{children:"Delete"})]})]}),m===a.id&&e.jsxs("div",{className:"mt-3 p-3 bg-gray-50 dark:bg-gray-700 rounded border",children:[e.jsx("label",{className:"block text-xs font-medium text-gray-700 dark:text-gray-300 mb-1",children:"PnL % (e.g., 15.5 for +15.5%)"}),e.jsx("div",{className:"flex space-x-2",children:e.jsx("input",{type:"number",step:"0.1",value:he,onChange:y=>le(y.target.value),placeholder:"15.5",className:"flex-1 px-2 py-1 text-xs border border-gray-300 dark:border-gray-600 rounded focus:ring-1 focus:ring-bronze-500 bg-white dark:bg-surface-elevated text-gray-900 dark:text-white",autoFocus:!0})}),e.jsx("label",{className:"block text-xs font-medium text-gray-700 dark:text-gray-300 mb-1 mt-2",children:"Exit Chart URL (optional)"}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx("input",{type:"text",value:fe,onChange:y=>ae(y.target.value),placeholder:"TradingView chart URL",className:"flex-1 px-2 py-1 text-xs border border-gray-300 dark:border-gray-600 rounded focus:ring-1 focus:ring-bronze-500 bg-white dark:bg-surface-elevated text-gray-900 dark:text-white"}),e.jsx("button",{onClick:async y=>{if(y.stopPropagation(),!!he)try{await v.from("recent_trades").insert({symbol:a.coin_symbol,name:a.coin_name,trading_idea_url:a.trading_idea_url,pnl_percentage:parseFloat(he),exit_chart_image_url:fe||null,status:"CLOSED"}),await v.from("trading_ideas").update({status:"CLOSED"}).eq("id",a.id),await $e(),O(!1),K([]),J(null),le(""),ae(""),console.log("✅ Trading idea closed with PnL")}catch(E){console.error("Error closing trading idea:",E),alert("Failed to close trading idea")}},disabled:!he,className:"px-2 py-1 bg-green-600 hover:bg-green-700 text-white text-xs rounded transition-colors disabled:opacity-50",children:"Close"}),e.jsx("button",{onClick:y=>{y.stopPropagation(),J(null),le(""),ae("")},className:"px-2 py-1 bg-gray-600 hover:bg-gray-700 text-white text-xs rounded transition-colors",children:"Cancel"})]})]})]})]})},a.id))}),re&&e.jsxs("div",{className:"mt-6 p-4 bg-surface-elevated dark:bg-surface-elevated border border-gray-200 dark:border-gray-700 rounded-lg",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4",children:"Mark Trading Idea as Inactive"}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-4",children:"Are you sure you want to mark this trading idea as inactive? The idea will no longer appear in the active ideas list."}),e.jsxs("div",{className:"flex space-x-3",children:[e.jsx("button",{onClick:()=>B(null),className:"px-4 py-2 text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 rounded-lg hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors",children:"Cancel"}),e.jsx("button",{onClick:async()=>{if(re)try{await v.from("trading_ideas").update({status:"INACTIVE"}).eq("id",re),await $e();const a=Q.map(y=>y.id===re?{...y,status:"INACTIVE"}:y);K(a),B(null)}catch(a){console.error("Error marking idea as inactive:",a)}},className:"px-4 py-2 bg-surface-elevated hover:bg-surface-elevated text-white rounded-lg transition-colors",children:"Mark Inactive"})]})]}),_e&&e.jsxs("div",{className:"mt-6 p-4 bg-red-50 dark:bg-red-900/20 border border-gray-200 dark:border-gray-700 rounded-lg",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4",children:"Delete Trading Idea"}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-2",children:"Are you sure you want to permanently delete this trading idea?"}),e.jsx("p",{className:"text-sm text-red-600 dark:text-red-400 mb-4",children:"This action cannot be undone and will permanently remove the trading idea."}),e.jsxs("div",{className:"flex space-x-3",children:[e.jsx("button",{onClick:()=>ie(null),className:"px-4 py-2 text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 rounded-lg hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors",children:"Cancel"}),e.jsx("button",{onClick:async()=>
7{if(_e)try{await v.from("trading_ideas").delete().eq("id",_e),await $e();const a=Q.filter(y=>y.id!==_e);K(a),ie(null),a.length===0&&O(!1)}catch(a){console.error("Error deleting trading idea:",a)}},className:"px-4 py-2 bg-red-500 hover:bg-red-600 text-white rounded-lg transition-colors",children:"Delete Permanently"})]})]})]})})}),Ue&&e.jsx(Ft,{isOpen:Ie,onClose:()=>{at(!1),$(null)},asset:Ue}),X&&e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4 overflow-y-auto",children:e.jsxs("div",{className:"bg-white dark:bg-surface-elevated rounded-xl shadow-xl max-w-2xl w-full max-h-[90vh] flex flex-col my-8",children:[e.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-gray-200 dark:border-gray-700",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:"Neuen Rohstoff hinzufügen"}),e.jsx("button",{onClick:()=>{de(!1),te({name:"",symbol:"",risk:"",holding_period:"",market_structure:"","4h_sentiment":"",live_charts:"",portfolio_percentage:"",ath_goal:""})},className:"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200",children:e.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Name *"}),e.jsx("input",{type:"text",value:f.name,onChange:a=>te({...f,name:a.target.value}),placeholder:"z.B. Kupfer",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 focus:border-transparent bg-white dark:bg-surface-elevated text-gray-900 dark:text-white",required:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Symbol *"}),e.jsx("input",{type:"text",value:f.symbol,onChange:a=>te({...f,symbol:a.target.value.toUpperCase()}),placeholder:"z.B. HG=F",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 focus:border-transparent bg-white dark:bg-surface-elevated text-gray-900 dark:text-white uppercase",required:!0}),e.jsx("p",{className:"mt-1 text-xs text-gray-500 dark:text-gray-400",children:"Muss das echte Yahoo-Finance-Ticker-Symbol sein (z.B. HG=F für Kupfer) – wird für den Live-Preis verwendet."})]})]}),e.jsxs("div",{className:"border-t border-gray-200 dark:border-gray-700 pt-4 mt-4",children:[e.jsx("h3",{className:"text-lg font-semibold mb-4 text-gray-900 dark:text-white",children:"Trader View"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Market Structure"}),e.jsxs("select",{value:f.market_structure,onChange:a=>te({...f,market_structure:a.target.value}),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 bg-white dark:bg-surface-elevated text-gray-900 dark:text-white",children:[e.jsx("option",{value:"",children:"Select..."}),lt.map(a=>e.jsx("option",{value:a,children:a},a))]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"4H Sentiment"}),e.jsxs("select",{value:f["4h_sentiment"],onChange:a=>te({...f,"4h_sentiment":a.target.value}),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 bg-white dark:bg-surface-elevated text-gray-900 dark:text-white",children:[e.jsx("option",{value:"",children:"Select..."}),ot.map(a=>e.jsx("option",{value:a,children:a},a))]})]}),e.jsxs("div",{className:"md:col-span-2",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Live Chart URL"}),e.jsx("input",{type:"url",value:f.live_charts,onChange:a=>te({...f,live_charts:a.target.value}),placeholder:"https://www.tradingview.com/chart/...",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 bg-white dark:bg-surface-elevated text-gray-900 dark:text-white"})]})]})]}),e.jsxs("div",{className:"border-t border-gray-200 dark:border-gray-700 pt-4 mt-4",children:[e.jsx("h3",{className:"text-lg font-semibold mb-4 text-gray-900 dark:text-white",children:"Investor View"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Risk (1-10)"}),e.jsx("input",{type:"number",min:"1",max:"10",value:f.risk,onChange:a=>te({...f,risk:a.target.value}),placeholder:"1-10",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 bg-white dark:bg-surface-elevated text-gray-900 dark:text-white"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Holding Perio
7d"}),e.jsx("input",{type:"text",value:f.holding_period,onChange:a=>te({...f,holding_period:a.target.value}),placeholder:"z.B. Long Term Hodl",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 bg-white dark:bg-surface-elevated text-gray-900 dark:text-white"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Portfolio %"}),e.jsx("input",{type:"text",value:f.portfolio_percentage,onChange:a=>te({...f,portfolio_percentage:a.target.value}),placeholder:"z.B. 5",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 bg-white dark:bg-surface-elevated text-gray-900 dark:text-white"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"ATH Goal"}),e.jsx("input",{type:"text",value:f.ath_goal,onChange:a=>te({...f,ath_goal:a.target.value}),placeholder:"z.B. 3000",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 bg-white dark:bg-surface-elevated text-gray-900 dark:text-white"})]})]})]})]})}),e.jsxs("div",{className:"px-6 py-4 border-t border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-surface-elevated flex justify-end space-x-3",children:[e.jsx("button",{onClick:()=>{de(!1),te({name:"",symbol:"",risk:"",holding_period:"",market_structure:"","4h_sentiment":"",live_charts:"",portfolio_percentage:"",ath_goal:""})},className:"px-4 py-2 text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 rounded-lg hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors",children:"Abbrechen"}),e.jsx("button",{onClick:i,disabled:!f.name||!f.symbol,className:"px-4 py-2 bg-surface-elevated hover:bg-surface-elevated disabled:bg-gray-400 disabled:cursor-not-allowed text-white rounded-lg transition-colors",children:"Rohstoff hinzufügen"})]})]})})]})}),sa=s.forwardRef(({view:n,searchTerm:c,setSearchTerm:o,showFilters:g,setShowFilters:b},w)=>{const R=Qe(),G=Ge(),[u,U]=s.useState([]),[N,C]=s.useState(!0),[T,Y]=s.useState({}),[W,L]=s.useState([]),[M,S]=s.useState([]),[me,be]=s.useState(!0),[xe,V]=s.useState(new Set),[k,P]=s.useState([]),[_,F]=s.useState(!1),[D,j]=s.useState([]),[I,q]=s.useState(null),[oe,ue]=s.useState(""),[h,O]=s.useState(""),[Q,K]=s.useState(null),[m,J]=s.useState(null),[he,le]=s.useState(!1),[fe,ae]=s.useState(null),[re,B]=s.useState({url:"",symbol:"",title:"",description:"",entry_price:"",entry_type:"",trade_strategy:""}),[_e,ie]=s.useState(!1),[A,pe]=s.useState({name:"",symbol:"",risk:"",project_analysis:"",marketcap:"",holding_period:"",bullrun:"",market_structure:"","4h_sentiment":"",trader_grade:"",compund_worth:"",live_charts:"",buy_sell_levels:"",portfolio_percentage:"",ath_goal:""}),{t:Te}=Ze(),{isAdmin:ce,user:ee}=yt();s.useImperativeHandle(w,()=>({openAddModal:()=>ie(!0)}));const[Ce,ve]=s.useState(!1),[Ne,X]=s.useState(null),{stocks:de,loading:f}=$t(),te=s.useMemo(()=>{const r={};return de.forEach(i=>{r[i.symbol]=i.current_price}),r},[de]),[je,Fe]=s.useState({}),Me=r=>{document.activeElement&&document.activeElement instanceof HTMLInputElement&&document.activeElement.blur(),U(i=>i.map(l=>({...l,isEditing:l.ID===r}))),setTimeout(()=>{const i=document.querySelector('[data-item-id="'.concat(r,'"]'));if(i){const l=i.querySelector("input, select");l instanceof HTMLElement&&l.focus()}},100)},Je=async r=>{const i=u.findIndex(l=>l.ID===r);if(i!==-1)try{const l=u[i],{error:H}=await v.from("stocks").update({status:l.status,name:l.name,symbol:l.symbol,risk:l.risk,project_analysis:l.project_analysis,invested:l.invested,marketcap:l.marketcap,holding_period:l.holding_period,bullrun:l.bullrun,portfolio_percentage:l.portfolio_percentage,ath_goal:l.ath_goal,buy_sell_levels:l.buy_sell_levels,market_structure:l.market_structure,"4h_sentiment":l["4h_sentiment"],trader_grade:l.trader_grade,compund_worth:l.compund_worth,live_charts:l.live_charts,m_structure_timestamp:l.m_structure_timestamp||null,"4h_sentiment_timestamp":l["4h_sentiment_timestamp"]||null}).eq("id",l.ID);if(H){console.error("Update-Fehler:",H);return}U(se=>se.map(ge=>({...ge,isEditing:ge.ID===r?!1:ge.isEditing})))}catch(l){console.error("Exception in handleSave:",l)}},Ye=r=>{U(i=>i.map(l=>({...l,isEditing:l.ID===r?!1:l.isEditing})))},Se=(r,i,l)=>{U(H=>H.map(se=>{if(se.ID!==r)return se;let ge={...se,[i]:l};return(i==="market_structure"||i==="4h_sentiment")&&l!==se[i]&&(ge.status="M-Structure",ge.m_structure_timestamp=new Date().toISOString()),i==="4h_sentiment"&&l!==se[i]&&(ge["4h_sentiment_timestamp"]=new Date().toISOString()),ge}))},et=r=>
7{X({symbol:r.symbol||r.name,name:r.name,live_charts:r.live_charts}),ve(!0)},ye=async()=>{if(!A.name||!A.symbol){alert("Name und Symbol sind erforderlich!");return}try{const{error:r}=await v.from("stocks").insert({name:A.name,symbol:A.symbol,risk:A.risk?parseInt(A.risk):null,project_analysis:A.project_analysis||null,marketcap:A.marketcap||null,holding_period:A.holding_period||null,bullrun:A.bullrun||null,market_structure:A.market_structure||null,"4h_sentiment":A["4h_sentiment"]||null,trader_grade:A.trader_grade||null,compund_worth:A.compund_worth||null,live_charts:A.live_charts||null,buy_sell_levels:A.buy_sell_levels||null,portfolio_percentage:A.portfolio_percentage||null,ath_goal:A.ath_goal||null,status:"NEW!",invested:"Not Invested"});if(r){console.error("Error adding stock:",r),alert("Fehler beim Hinzufügen der Aktie!");return}await tt(),ie(!1),pe({name:"",symbol:"",risk:"",project_analysis:"",marketcap:"",holding_period:"",bullrun:"",market_structure:"","4h_sentiment":"",trader_grade:"",compund_worth:"",live_charts:"",buy_sell_levels:"",portfolio_percentage:"",ath_goal:""}),console.log("✅ Stock added successfully")}catch(r){console.error("Error adding stock:",r),alert("Fehler beim Hinzufügen der Aktie!")}},Ie=async()=>{try{const{data:r,error:i}=await v.from("trading_ideas_gated").select("*").eq("status","ACTIVE").order("created_at",{ascending:!1});if(i)throw i;P(r||[])}catch(r){console.error("Error fetching trading ideas:",r)}},at=async()=>{if(!(!re.url||!fe))try{const{error:r}=await v.from("trading_ideas").insert({coin_symbol:re.symbol||fe.symbol,coin_name:fe.name,trading_idea_url:re.url,title:re.title||null,description:re.description||null,entry_price:re.entry_price?parseFloat(re.entry_price):null,entry_type:re.entry_type||null,trade_strategy:re.trade_strategy||null,status:"ACTIVE"});if(r){console.error("Error inserting trading idea:",r),alert("Failed to add trading idea");return}const{data:{session:i}}=await v.auth.getSession();i&&await fetch("https://bsmvcmmwkmaqpgrmvjql.supabase.co/functions/v1/process-notification-queue",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(i.access_token)}}),await Ie(),le(!1),B({url:"",symbol:"",title:"",description:"",entry_price:"",entry_type:"",trade_strategy:""}),ae(null),console.log("✅ Trading idea added successfully")}catch(r){console.error("Error adding trading idea:",r),alert("Failed to add trading idea")}},Ue=async()=>{if(!ee){be(!1);return}try{const{data:r,error:i}=await v.from("user_favorites").select("coin_id, view_type").eq("user_id",ee.id);if(i)throw i;const l=(r==null?void 0:r.filter(se=>se.view_type==="trader").map(se=>se.coin_id))||[],H=(r==null?void 0:r.filter(se=>se.view_type==="investor").map(se=>se.coin_id))||[];L(l),S(H)}catch(r){console.error("Error fetching favorites:",r)}finally{be(!1)}},$=async()=>{try{const i=window.location.hostname==="localhost"?"https://cradermind.com/.netlify/functions/stocks-commodities-change":"/.netlify/functions/stocks-commodities-change",H=await(await fetch(i)).json();H.success&&H.data&&Fe(H.data)}catch(r){console.error("Error fetching price changes:",r)}};s.useEffect(()=>{tt(),Ue(),Ie(),$(),ke();const r=setInterval(()=>{$()},6e4);return()=>{clearInterval(r)}},[ee]);const ke=async()=>{try{const{data:r}=await v.from("stock_levels").select("stock_symbol");V(new Set((r==null?void 0:r.map(i=>i.stock_symbol))||[]))}catch(r){console.error("Error fetching stocks with levels:",r)}},tt=async()=>{try{const{data:r,error:i}=await v.from("stocks").select("*").order("id",{ascending:!0});if(i)console.error("Error fetching stocks:",i),U([]);else{console.log("Fetched stocks data:",r);const l=r==null?void 0:r.map(H=>({...H,ID:H.id||H.ID,symbol:H.symbol||(H.name?H.name.split(" ").slice(-1)[0]:"UNKNOWN"),isEditing:!1}));U(l||[])}}catch(r){console.error("Error fetching stocks data:",r),U([])}finally{C(!1)}},Oe=async r=>{if(!ee){console.error("No user logged in");return}const l=(String(n)==="trader"?W:M).includes(r);try{if(l){const{error:H}=await v.from("user_favorites").delete().eq("user_id",ee.id).eq("coin_id",r).eq("view_type",n);if(H)throw H;String(n)==="trader"?L(se=>se.filter(ge=>ge!==r)):S(se=>se.filter(ge=>ge!==r))}else{const{error:H}=await v.from("user_favorites").insert({user_id:ee.id,coin_id:r,view_type:n});if(H)throw H;String(n)==="trader"?L(se=>[...se,r]):S(se=>[...se,r])}}catch(H){console.error("Error updating favorites:",H)}},Ee=Ve.useMemo(()=>{const r=u.filter(l=>{var se;return!(!l||!l.ID||!Object.values(l).some(ge=>ge==null?void 0:ge.toString().toLowerCase().includes(c.toLowerCase()))||T.marketStructure&&l.market_structure!==T.marketStructure||T.sentiment4h&&l["4h_sentiment"]!==T.sentiment4h||T.traderGrade&&l.trader_grade!==T.traderGrade||T.compoundWorthy&&l.compund_worth!==T.compoundWorthy||T.risk&&((se=l.risk)==null?void 0:se.toString())!==T.risk||T.holdingPerio
7d&&l.holding_period!==T.holdingPeriod||T.bullrun&&l.bullrun!==T.bullrun)}),i=String(n)==="trader"?W:M;return[...r].sort((l,H)=>{if(!l||!H||typeof l.ID!="number"||typeof H.ID!="number")return 0;const se=i.includes(l.ID),ge=i.includes(H.ID);return se&&!ge?-1:!se&&ge?1:l.ID-H.ID})},[u,c,T,n,W,M]),mt=r=>Array.from(new Set(u.map(i=>i[r]))).filter(Boolean).sort(),st=()=>{if(!g)return null;const r=String(n)==="trader"?[{key:"marketStructure",label:"Market Structure",field:"market_structure"},{key:"sentiment4h",label:"4h Sentiment",field:"4h_sentiment"},{key:"traderGrade",label:"Trader Grade",field:"trader_grade"},{key:"compoundWorthy",label:"Compound Worthy",field:"compund_worth"}]:[{key:"risk",label:"Risk",field:"risk"},{key:"holdingPeriod",label:"Holding Period",field:"holding_period"},{key:"bullrun",label:"Bullrun",field:"bullrun"}];return e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-6",children:r.map(({key:i,label:l,field:H})=>{var se;return e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:l}),e.jsxs("select",{value:String((se=T[i])!=null?se:""),onChange:ge=>Y(xt=>({...xt,[i]:ge.target.value||void 0})),className:"w-full bg-white dark:bg-[#1A1714] border border-gray-200 dark:border-gray-700 rounded-lg px-3 py-2 text-gray-900 dark:text-white focus:outline-none focus:ring-2 focus:ring-bronze-500",children:[e.jsx("option",{value:"",children:"All"}),mt(H).map(ge=>e.jsx("option",{value:String(ge),children:String(ge)},ge))]})]},i)})})},nt=r=>{const i=e.jsxs("div",{className:"flex flex-col",children:[e.jsx("div",{className:"min-h-[32px] flex items-center flex-shrink-0",children:Ke(r.market_structure,"market_structure","marketStructure")}),r.m_structure_timestamp&&e.jsxs("div",{className:"text-xs text-gray-400 dark:text-gray-500 mt-0.5",children:["Updated: ",new Date(r.m_structure_timestamp).toLocaleString()]})]});return R?e.jsx("div",{className:"blur-[6px] select-none pointer-events-none",children:i}):i},rt=r=>{const i=e.jsxs("div",{className:"flex flex-col",children:[e.jsx("div",{className:"min-h-[32px] flex items-center flex-shrink-0",children:Ke(r["4h_sentiment"],"sentiment","sentiment4h")}),r["4h_sentiment_timestamp"]&&e.jsxs("div",{className:"text-xs text-gray-400 dark:text-gray-500 mt-0.5",children:["Updated: ",new Date(r["4h_sentiment_timestamp"]).toLocaleString()]})]});return R?e.jsx("div",{className:"blur-[6px] select-none pointer-events-none",children:i}):i},$e=r=>{if(!r.name)return e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:"w-6 h-6 mr-2 bg-gray-200 dark:bg-gray-700 rounded-full"}),e.jsx("span",{className:"text-responsive-sm text-gray-500 dark:text-gray-400",children:"Unknown"})]});const i=l=>l?{SPX:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/images/34.svg",NDX:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/images/35.svg",COIN:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/coins/Coin_Icons/coinbase.png",META:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/coins/Coin_Icons/meta.jpg",HOOD:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/coins/Coin_Icons/robinhood.png",AMZN:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/images/amzn.png",ARM:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/images/arm.png",GOOGL:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/images/googl.webp",INTC:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/images/intel.jpg",MSFT:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/images/msft.png",TSLA:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/images/tsla.png",APP:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/images/APP_LOVIN.png",MCD:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/coins/Coin_Icons/MCD.png",MS:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/coins/Coin_Icons/MS.png",XOM:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/coins/Coin_Icons/XOM.png"}[l]||"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/coins/Coin_Icons/".concat(l,".png"):"https://placehold.co/24x24?text=?";return e.jsxs("div",{className:"flex items-center",children:[e.jsx("img",{src:i(r.symbol),alt:r.name,className:"w-6 h-6 mr-2",onError:l=>{const H=l.target;H.src="https://placehold.co/24x24?text=?"}}),e.jsxs("div",{className:"text-responsive-sm font-medium text-gray-900 dark:text-gray-100",children:[r.name," ",e.jsx("span",{className:"text-responsive-sm text-gray-500 dark:text-gray-400",children:r.symbol})]})]})};return e.jsxs(e.Fragment,{children:[e.jsx(cr,{}),st(),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"rounded-lg border border-gray-200 dark:border-gray-700 bg-white dark:bg-[#0f0d0a] max-h-[900px] overflow-y-auto",children:String(n)==="trader"?e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{className:"sticky top-0 bg-gray-50/80 dark:bg-[#1A1714]/95 backdrop-blur-sm z-10",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-2 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"#"}),e.jsx("th",{className:"px-2 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Name"}),e.jsx("th",{className:"px-2 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Price"}),e.jsx("th",{className:"px-2 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Market Structure"}),e.jsx("th",{className:"px-2 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"4h Sentiment"}),e.jsx("th",{className:"px-2 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Live Chart"}),e.jsx("th",{className:"px-2 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Trading Ideas"}),ce&&e.jsx("th",{className:"px-2 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Actions"})]})}
7),e.jsx("tbody",{className:"bg-white dark:bg-[#0f0d0a] divide-y divide-gray-200 dark:divide-gray-700",children:N||me?e.jsx("tr",{children:e.jsx("td",{colSpan:ce?8:7,className:"px-2 py-3 text-center text-gray-500 dark:text-gray-400",children:"Loading..."})}):Ee.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:ce?8:7,className:"px-2 py-10 text-center",children:e.jsxs("div",{className:"flex flex-col items-center justify-center space-y-3",children:[e.jsx("div",{className:"text-4xl",children:"📊"}),e.jsx("div",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Noch keine Stocks verfügbar"}),e.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Stocks werden bald hinzugefügt"})]})})}):Ee.map(r=>e.jsxs("tr",{"data-item-id":r.ID,className:"hover:bg-gray-50 dark:hover:bg-[#1A1714] transition-colors cursor-pointer",onClick:()=>window.location.href="/stock/".concat(r.symbol),children:[e.jsx("td",{className:"px-2 py-3 whitespace-nowrap",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx(it,{className:"h-4 w-4 cursor-pointer transition-colors ".concat((String(n)==="trader"?W:M).includes(r.ID)?"text-yellow-500 fill-yellow-500":"text-gray-400 hover:text-yellow-500"," ").concat(ee?"":"opacity-50 cursor-not-allowed"),onClick:i=>{i.stopPropagation(),ee&&Oe(r.ID)}}),e.jsx("span",{className:"ml-2 text-base text-gray-500 dark:text-gray-400",children:r.ID})]})}),e.jsx("td",{className:"px-2 py-3 whitespace-nowrap",children:r.isEditing&&ce?e.jsx("input",{type:"text",value:r.name,onChange:i=>Se(r.ID,"name",i.target.value),onClick:i=>i.stopPropagation(),className:"w-full px-2 py-1 bg-gray-100 dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded"}):$e(r)}),e.jsx("td",{className:"px-2 py-3 whitespace-nowrap",children:f&&Object.keys(te).length===0?e.jsx("span",{className:"text-sm text-gray-500",children:"Loading..."}):r.symbol&&te[r.symbol]?e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("span",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:["$",te[r.symbol].toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})]}),je[r.symbol]!==void 0&&e.jsxs("span",{className:"text-xs ".concat(je[r.symbol]>=0?"text-green-500":"text-red-500"),children:[je[r.symbol]>=0?"+":"",je[r.symbol].toFixed(2),"%"]})]}):r.price?e.jsxs("span",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:["$",parseFloat(r.price).toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})]}):e.jsx("span",{className:"text-sm text-gray-500",children:"-"})}),e.jsx("td",{className:"px-2 py-3 whitespace-nowrap",children:r.isEditing&&ce?e.jsxs("select",{value:r.market_structure||"",onChange:i=>Se(r.ID,"market_structure",i.target.value),onClick:i=>i.stopPropagation(),className:"w-full px-2 py-1 bg-gray-100 dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded",children:[e.jsx("option",{value:"",children:"Select..."}),lt.map(i=>e.jsx("option",{value:i,children:i},i))]}):nt(r)}),e.jsx("td",{className:"px-2 py-3 whitespace-nowrap",children:r.isEditing&&ce?e.jsxs("select",{value:r["4h_sentiment"]||"",onChange:i=>Se(r.ID,"4h_sentiment",i.target.value),onClick:i=>i.stopPropagation(),className:"w-full px-2 py-1 bg-gray-100 dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded",children:[e.jsx("option",{value:"",children:"Select..."}),ot.map(i=>e.jsx("option",{value:i,children:i},i))]}):rt(r)}),e.jsx("td",{className:"px-2 py-3 whitespace-nowrap",children:r.isEditing&&ce?e.jsx("input",{type:"text",value:r.live_charts||"",onChange:i=>Se(r.ID,"live_charts",i.target.value),onClick:i=>i.stopPropagation(),className:"w-full px-2 py-1 bg-gray-100 dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded"}):R?e.jsx("div",{className:"blur-[6px] select-none pointer-events-none",children:e.jsx("span",{className:"live-badge pl-4 text-bronze-600 dark:text-bronze-400 text-sm",children:"View Chart"})}):r.live_charts?e.jsx("a",{href:"#",onClick:i=>{i.preventDefault(),i.stopPropagation(),window.open(r.live_charts,"_blank")}
7,className:"live-badge pl-4 text-bronze-600 dark:text-bronze-400 hover:text-bronze-500 dark:hover:text-bronze-300 text-sm",children:"View Chart"}):e.jsx("span",{className:"text-sm text-gray-500",children:"No"})}),e.jsx("td",{className:"px-2 py-3 whitespace-nowrap",children:r.isEditing&&ce?e.jsx("button",{onClick:i=>{i.stopPropagation(),ae(r),B({url:"",symbol:r.symbol||"",title:"",description:""}),le(!0)},className:"p-2 bg-surface-elevated hover:bg-surface-elevated text-white rounded-lg transition-colors flex items-center justify-center",title:"Add Trading Idea",children:e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})})}):R?e.jsx("div",{className:"blur-[6px] select-none pointer-events-none",children:e.jsx("span",{className:"text-bronze-600 dark:text-bronze-400 text-sm",children:"1 Idea(s)"})}):k.filter(l=>l.coin_symbol===r.symbol).length>0?e.jsxs("span",{className:"text-bronze-600 dark:text-bronze-400 text-sm cursor-pointer hover:text-bronze-500",onClick:i=>{i.stopPropagation();const l=k.filter(H=>H.coin_symbol===r.symbol);l.length>0&&(j(l),F(!0))},children:[k.filter(i=>i.coin_symbol===r.symbol).length," Idea(s)"]}):e.jsx("span",{className:"text-sm text-gray-500",children:"No"})}),ce&&e.jsx("td",{className:"px-2 py-3 whitespace-nowrap",children:e.jsx("div",{className:"flex items-center space-x-2",children:r.isEditing?e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:i=>{i.stopPropagation(),Je(r.ID)},className:"text-green-600 hover:text-green-700 transition-colors",children:e.jsx(ct,{className:"h-5 w-5"})}),e.jsx("button",{onClick:i=>{i.stopPropagation(),Ye(r.ID)},className:"text-gray-600 hover:text-gray-700 transition-colors",children:e.jsx(Re,{className:"h-5 w-5"})})]}):e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:i=>{i.stopPropagation(),Me(r.ID)},className:"text-bronze-600 hover:text-bronze-700 transition-colors",children:e.jsx(dt,{className:"h-5 w-5"})}),e.jsx("button",{onClick:i=>{i.stopPropagation(),et(r)},className:"text-yellow-600 hover:text-yellow-800",title:"Benachrichtigung auslösen",children:"🔔"})]})})})]},r.ID))})]}):e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{className:"sticky top-0 bg-gray-50/80 dark:bg-[#1A1714]/95 backdrop-blur-sm z-10",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-2 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"#"}),e.jsx("th",{className:"px-2 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Name"}),e.jsx("th",{className:"px-2 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Price"}),e.jsx("th",{className:"px-2 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Risk"}),e.jsx("th",{className:"px-2 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Holding Period"}),e.jsx("th",{className:"px-2 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Portfolio %"}),e.jsx("th",{className:"px-2 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"ATH Goal"}),e.jsx("th",{className:"px-2 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Buy & Sell Levels"}),ce&&e.jsx("th",{className:"px-2 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:"Actions"})]})}),e.jsx("tbody",{className:"bg-white dark:bg-[#0f0d0a] divide-y divide-gray-200 dark:divide-gray-700",children:N||me?e.jsx("tr",{children:e.jsx("td",{colSpan:ce?9:8,className:"px-2 py-3 text-center text-gray-500 dark:text-gray-400",children:"Loading..."})}):Ee.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:ce?9:8,className:"px-2 py-10 text-center",children:e.jsxs("div",{className:"flex flex-col items-center justify-center space-y-3",children:[e.jsx("div",{className:"text-4xl",children:"📊"}),e.jsx("div",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Noch keine Stocks verfügbar"}),e.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Stocks werden bald hinzugefügt"})]})})}):Ee.map(r=>{var i;return e.jsxs("tr",{"data-item-id":r.ID,className:"hover:bg-gray-50 dark:hover:bg-[#1A1714] transition-colors cursor-pointer",onClick:()=>window.location.href="/stock/".concat(r.symbol),children:[e.jsx("td",{className:"px-2 py-3 whitespace-nowrap",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx(it,{className:"h-4 w-4 cursor-pointer transition-colors ".concat((String(n)==="trader"?W:M).includes(r.ID)?"text-yellow-500 fill-yellow-500":"text-gray-400 hover:text-yellow-500"," ").concat(ee?"":"opacity-50 cursor-not-allowed"),onClick:l=>{l.stopPropagation(),ee&&Oe(r.ID)}}),e.jsx("span",{className:"ml-2 text-base text-gray-500 dark:text-gray-400",children:r.ID})]})}),e.jsx("td",{className:"px-2 py-3 whitespace-nowrap",children:r.isEditing&&ce?e.jsx("input",{type:"text",value:r.name,onChange:l=>Se(r.ID,"name",l.target.value),onClick:l=>l.stopPropagation(),className:"w-full px-2 py-1 bg-gray-100 dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded"}):$e(r)}),e.jsx("td",{className:"px-2 py-3 whitespace-nowrap",children:f&&Object.keys(te).length===0?e.jsx("span",{className:"text-sm text-gray-500",children:"Loading..."}):r.symbol&&te[r.symbol]?e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("span",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:["$",te[r.symbol].toLocaleStr
7ing("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})]}),je[r.symbol]!==void 0&&e.jsxs("span",{className:"text-xs ".concat(je[r.symbol]>=0?"text-green-500":"text-red-500"),children:[je[r.symbol]>=0?"+":"",je[r.symbol].toFixed(2),"%"]})]}):r.price?e.jsxs("span",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:["$",parseFloat(r.price).toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})]}):e.jsx("span",{className:"text-sm text-gray-500",children:"-"})}),e.jsx("td",{className:"px-3 py-4 min-w-[150px]",children:r.isEditing&&ce?e.jsx("input",{type:"number",value:String((i=r.risk)!=null?i:""),onChange:l=>Se(r.ID,"risk",parseInt(l.target.value)),onClick:l=>l.stopPropagation(),className:"w-full px-2 py-1 bg-gray-100 dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded",min:"1",max:"10"}):qt(Number(r.risk))}),e.jsx("td",{className:"px-2 py-3 whitespace-nowrap",children:r.isEditing&&ce?e.jsxs("select",{value:r.holding_period||"",onChange:l=>Se(r.ID,"holding_period",l.target.value),onClick:l=>l.stopPropagation(),className:"w-full px-2 py-1 bg-gray-100 dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded",children:[e.jsx("option",{value:"",children:"Select..."}),Mt.map(l=>e.jsx("option",{value:l,children:l},l))]}):Ke(r.holding_period,"holding_period","holdingPeriod")}),e.jsx("td",{className:"px-2 py-3 whitespace-nowrap",children:r.isEditing&&ce?e.jsx("input",{type:"text",value:r.portfolio_percentage||"",onChange:l=>Se(r.ID,"portfolio_percentage",l.target.value),onClick:l=>l.stopPropagation(),className:"w-full px-2 py-1 bg-gray-100 dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded"}):e.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300 ".concat(R?"blur-sm select-none":""),children:r.portfolio_percentage})}),e.jsx("td",{className:"px-2 py-3 whitespace-nowrap",children:r.isEditing&&ce?e.jsx("input",{type:"text",value:r.ath_goal||"",onChange:l=>Se(r.ID,"ath_goal",l.target.value),onClick:l=>l.stopPropagation(),className:"w-full px-2 py-1 bg-gray-100 dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded"}):e.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300 ".concat(R?"blur-sm select-none":""),children:r.ath_goal})}),e.jsx("td",{className:"px-2 py-3 whitespace-nowrap",children:R?e.jsx("span",{className:"text-sm text-gray-500 blur-sm select-none",children:"Locked"}):xe.has(r.symbol)?e.jsx("button",{onClick:l=>{l.preventDefault(),l.stopPropagation(),window.location.href="/stock/".concat(r.symbol,"#levels")},className:"text-bronze-600 dark:text-bronze-400 hover:text-bronze-500 dark:hover:text-bronze-300 text-sm underline",children:"View Levels"}):e.jsx("span",{className:"text-sm text-gray-500",children:"No"})}),ce&&e.jsx("td",{className:"px-2 py-3 whitespace-nowrap",children:e.jsx("div",{className:"flex items-center space-x-2",children:r.isEditing?e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:l=>{l.stopPropagation(),Je(r.ID)},className:"text-green-600 hover:text-green-700 transition-colors",children:e.jsx(ct,{className:"h-5 w-5"})}),e.jsx("button",{onClick:l=>{l.stopPropagation(),Ye(r.ID)},className:"text-gray-600 hover:text-gray-700 transition-colors",children:e.jsx(Re,{className:"h-5 w-5"})})]}):e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:l=>{l.stopPropagation(),Me(r.ID)},className:"text-bronze-600 hover:text-bronze-700 transition-colors",children:e.jsx(dt,{className:"h-5 w-5"})}),e.jsx("button",{onClick:l=>{l.stopPropagation(),et(r)},className:"text-yellow-600 hover:text-yellow-800",title:"Benachrichtigung auslösen",children:"🔔"})]})})})]},r.ID)})})]})}),R&&e.jsx("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 z-20 pointer-events-none",children:e.jsxs("div",{className:"flex items-center gap-2 px-5 py-2 rounded-full shadow-lg pointer-events-auto cursor-pointer",style:{background:"linear-gradient(135deg, #C9A96E, #A8864A)"},onClick:()=>G("/pricing"),children:[e.jsx(gt,{className:"w-4 h-4 text-white"}),e.jsx("span",{className:"text-white text-sm font-bold tracking-wider",children:"PRO"})]})})]}),_e&&e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4 overflow-y-auto",children:e.jsxs("div",{className:"bg-white dark:bg-surface-elevated rounded-xl shadow-xl max-w-2xl w-full max-h-[90vh] flex flex-col my-8",children:[e.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-gray-200 dark:border-gray-700",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:"Neue X-Stock hinzufügen"}),e.jsx("button",{onClick:()=>
7{ie(!1),pe({name:"",symbol:"",risk:"",project_analysis:"",marketcap:"",holding_period:"",bullrun:"",market_structure:"","4h_sentiment":"",trader_grade:"",compund_worth:"",live_charts:"",buy_sell_levels:"",portfolio_percentage:"",ath_goal:""})},className:"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200",children:e.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Name *"}),e.jsx("input",{type:"text",value:A.name,onChange:r=>pe({...A,name:r.target.value}),placeholder:"z.B. NVIDIA Corporation",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 focus:border-transparent bg-white dark:bg-surface-elevated text-gray-900 dark:text-white",required:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Symbol *"}),e.jsx("input",{type:"text",value:A.symbol,onChange:r=>pe({...A,symbol:r.target.value.toUpperCase()}),placeholder:"z.B. NVDA",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 focus:border-transparent bg-white dark:bg-surface-elevated text-gray-900 dark:text-white uppercase",required:!0})]})]}),e.jsxs("div",{className:"border-t border-gray-200 dark:border-gray-700 pt-4 mt-4",children:[e.jsx("h3",{className:"text-lg font-semibold mb-4 text-gray-900 dark:text-white",children:"Trader View"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Market Structure"}),e.jsxs("select",{value:A.market_structure,onChange:r=>pe({...A,market_structure:r.target.value}),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 bg-white dark:bg-surface-elevated text-gray-900 dark:text-white",children:[e.jsx("option",{value:"",children:"Select..."}),lt.map(r=>e.jsx("option",{value:r,children:r},r))]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"4H Sentiment"}),e.jsxs("select",{value:A["4h_sentiment"],onChange:r=>pe({...A,"4h_sentiment":r.target.value}),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 bg-white dark:bg-surface-elevated text-gray-900 dark:text-white",children:[e.jsx("option",{value:"",children:"Select..."}),ot.map(r=>e.jsx("option",{value:r,children:r},r))]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Trader Grade"}),e.jsxs("select",{value:A.trader_grade,onChange:r=>pe({...A,trader_grade:r.target.value}),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 bg-white dark:bg-surface-elevated text-gray-900 dark:text-white",children:[e.jsx("option",{value:"",children:"Select..."}),dr.map(r=>e.jsx("option",{value:r,children:r},r))]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Compound Worthy"}),e.jsxs("select",{value:A.compund_worth,onChange:r=>pe({...A,compund_worth:r.target.value}),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 bg-white dark:bg-surface-elevated text-gray-900 dark:text-white",children:[e.jsx("option",{value:"",children:"Select..."}),gr.map(r=>e.jsx("option",{value:r,children:r},r))]})]}),e.jsxs("div",{className:"md:col-span-2",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Live Chart URL"}),e.jsx("input",{type:"url",value:A.live_charts,onChange:r=>pe({...A,live_charts:r.target.value}),placeholder:"https://www.tradingview.com/chart/...",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 bg-white dark:bg-surface-elevated text-gray-900 dark:text-white"})]})]})]}),e.jsxs("div",{className:"border-t border-gray-200 dark:border-gray-700 pt-4 mt-4",children:[e.jsx("h3",{className:"text-lg font-semibold mb-4 text-gray-900 dark:text-white",children:"Investor View"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Risk (1-10)"}),e.jsx("input",{type:"number",min:"1",max:"10",value:A.risk,onChange:r=>pe({...A,risk:r.target.value}),placeholder:"1-10",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 bg-white dark:bg-surface-elevated text-gray-900 dark:text-white"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Project Analysis"}),e.jsx("input",{type:"text",value:A.project_analysis,onChange:r=>pe({...A,project_analysis:r.target.value}),placeholder:"z.B. Tech, AI",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 bg-white dark:bg-surface-elevated text-gray-900 dark:text-white"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Market Cap"}),e.jsxs("select",{value:A.marketcap,onChange:r=>pe({...A,marketcap:r.target.value}),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 bg-white dark:bg-surface-elevated text-gray-900 dark:text-white",children:[e.jsx("option",{value:"",children:"Select..."}),mr.map(r=>e.jsx("option",{value:r,children:r},r))]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Holding Perio
7d"}),e.jsxs("select",{value:A.holding_period,onChange:r=>pe({...A,holding_period:r.target.value}),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 bg-white dark:bg-surface-elevated text-gray-900 dark:text-white",children:[e.jsx("option",{value:"",children:"Select..."}),Mt.map(r=>e.jsx("option",{value:r,children:r},r))]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Bullrun"}),e.jsxs("select",{value:A.bullrun,onChange:r=>pe({...A,bullrun:r.target.value}),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 bg-white dark:bg-surface-elevated text-gray-900 dark:text-white",children:[e.jsx("option",{value:"",children:"Select..."}),xr.map(r=>e.jsx("option",{value:r,children:r},r))]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Portfolio %"}),e.jsx("input",{type:"text",value:A.portfolio_percentage,onChange:r=>pe({...A,portfolio_percentage:r.target.value}),placeholder:"z.B. 5%",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 bg-white dark:bg-surface-elevated text-gray-900 dark:text-white"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"ATH Goal"}),e.jsx("input",{type:"text",value:A.ath_goal,onChange:r=>pe({...A,ath_goal:r.target.value}),placeholder:"z.B. $200",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 bg-white dark:bg-surface-elevated text-gray-900 dark:text-white"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Buy & Sell Levels URL"}),e.jsx("input",{type:"url",value:A.buy_sell_levels,onChange:r=>pe({...A,buy_sell_levels:r.target.value}),placeholder:"https://www.tradingview.com/chart/...",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 bg-white dark:bg-surface-elevated text-gray-900 dark:text-white"})]})]})]})]})}),e.jsxs("div",{className:"px-6 py-4 border-t border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-surface-elevated flex justify-end space-x-3",children:[e.jsx("button",{onClick:()=>{ie(!1),pe({name:"",symbol:"",risk:"",project_analysis:"",marketcap:"",holding_period:"",bullrun:"",market_structure:"","4h_sentiment":"",trader_grade:"",compund_worth:"",live_charts:"",buy_sell_levels:"",portfolio_percentage:"",ath_goal:""})},className:"px-4 py-2 text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 rounded-lg hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors",children:"Abbrechen"}),e.jsx("button",{onClick:ye,disabled:!A.name||!A.symbol,className:"px-4 py-2 bg-surface-elevated hover:bg-surface-elevated disabled:bg-gray-400 disabled:cursor-not-allowed text-white rounded-lg transition-colors",children:"X-Stock hinzufügen"})]})]})}),he&&e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4",children:e.jsxs("div",{className:"bg-white dark:bg-surface-elevated rounded-xl shadow-xl max-w-md w-full max-h-[90vh] overflow-y-auto",children:[e.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-gray-200 dark:border-gray-700",children:[e.jsxs("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:["Add Trading Idea for ",fe==null?void 0:fe.symbol]}),e.jsx("button",{onClick:()=>{le(!1),B({url:"",symbol:"",title:"",description:"",entry_price:"",entry_type:"",trade_strategy:""}),ae(null)},className:"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200",children:e.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),e.jsxs("div",{className:"p-6 space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"TradingView 
7URL *"}),e.jsx("input",{type:"url",value:re.url,onChange:r=>B({...re,url:r.target.value}),placeholder:"https://www.tradingview.com/chart/...",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 focus:border-transparent bg-white dark:bg-surface-elevated text-gray-900 dark:text-white",required:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Title (optional)"}),e.jsx("input",{type:"text",value:re.title,onChange:r=>B({...re,title:r.target.value}),placeholder:"Brief title for the trading idea...",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 focus:border-transparent bg-white dark:bg-surface-elevated text-gray-900 dark:text-white"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Description (optional)"}),e.jsx("textarea",{value:re.description,onChange:r=>B({...re,description:r.target.value}),placeholder:"Brief description of the trading idea...",rows:3,className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 focus:border-transparent bg-white dark:bg-surface-elevated text-gray-900 dark:text-white resize-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Entry Price (optional)"}),e.jsx("input",{type:"number",step:"0.00000001",value:re.entry_price,onChange:r=>B({...re,entry_price:r.target.value}),placeholder:"e.g., 150",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 focus:border-transparent bg-white dark:bg-surface-elevated text-gray-900 dark:text-white"}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:"The price at which the trade should be entered"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Entry Type (optional)"}),e.jsxs("select",{value:re.entry_type,onChange:r=>B({...re,entry_type:r.target.value}),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 focus:border-transparent bg-white dark:bg-surface-elevated text-gray-900 dark:text-white",children:[e.jsx("option",{value:"",children:"Select direction..."}),e.jsx("option",{value:"LONG",children:"LONG"}),e.jsx("option",{value:"SHORT",children:"SHORT"})]}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:"Trade direction (LONG or SHORT)"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Trade Strategy (optional)"}),e.jsxs("select",{value:re.trade_strategy,onChange:r=>B({...re,trade_strategy:r.target.value}),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 focus:border-transparent bg-white dark:bg-surface-elevated text-gray-900 dark:text-white",children:[e.jsx("option",{value:"",children:"Select strategy..."}),e.jsx("option",{value:"BOX",children:"BOX (Enter at support/resistance)"}),e.jsx("option",{value:"BREAKOUT",children:"BREAKOUT (Enter on breakout through level)"})]}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:"BOX: Entry when price reaches level | BREAKOUT: Entry when price breaks through level"})]})]}),e.jsxs("div",{className:"px-6 py-4 border-t border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-surface-elevated flex justify-end space-x-3",children:[e.jsx("button",{onClick:()=>{le(!1),B({url:"",symbol:"",title:"",description:"",entry_price:"",entry_type:"",trade_strategy:""}),ae(null)},className:"px-4 py-2 text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 rounded-lg hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors",children:"Cancel"}),e.jsx("button",{onClick:at,disabled:!re.url,className:"px-4 py-2 bg-surface-elevated hover:bg-surface-elevated disabled:bg-gray-400 disabled:cursor-not-allowed text-white rounded-lg transition-colors",children:"Add Trading Idea"})]})]})}),_&&e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4",children:e.jsxs("div",{className:"bg-white dark:bg-surface-elevated rounded-xl shadow-xl max-w-4xl w-full max-h-[90vh] flex flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-gray-200 dark:border-gray-700",children:[e.jsxs("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:["Trading Ideas (",D.length,")"]}),e.jsx("button",{onClick:()=>{F(!1),q(null),ue("")},className:"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200",children:e.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsxs("div",{className:"p-6",children:[e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:D.map((r,i)=>e.jsx("div",{className:"group relative bg-gradient-to-r from-[#1A1714] to-[#2A2520] p-[2px] rounded-xl shadow-lg cursor-pointer hover:scale-[1.02] transition-transform",onClick:()=>window.open(r.trading_idea_url,"_blank"),children:e.jsxs("div",{className:"bg-white dark:bg-surface-elevated rounded-xl overflow-hidden h-auto min-h-[200px] flex flex-col",children:[e.jsx("div",{className:"relative overflow-hidden",children:e.jsxs("div",{className:"aspect-w-16 aspect-h-9 bg-gray-100 dark:bg-[#0D1117]",children:[e.jsx("div",{className:"absolute top-2 left-2 z-10",children:e.jsx("span",{className:"text-xs bg-black bg-opacity-70 text-white px-2 py-1 rounded",children:"Open Chart"})}),e.jsx("img",{src:r.trading_idea_url,alt:"".concat(r.coin_symbol," trading chart"),className:"w-full h-full object-cover",onError:l=>{const H=l.target;H.src="https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/coins/Coin_Icons/default.png"}})]})}),e.jsxs("div",{className:"p-4 flex-grow",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("img",{src:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/coins/Coin_Icons/".concat(r.coin_symbol,".png"),alt:r.coin_symbol,className:"w-6 h-6",onError:l=>{const H=l.target;H.src="https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/coins/Coin_Icons/default.png"}}),e.jsx("span",{className:"font-bold text-lg text-gray-900 dark:text-white",children:r.coin_symbol})]}),e.jsx("span",{className:"text-sm bg-surface-elevated dark:bg-surface-elevated text-bronze-700 dark:text-bronze-400 px-3 py-1 rounded-full font-medium",children:r.status||"ACTIVE"})]}),e.jsxs("div",{className:"text-sm text-gray-600 dark:text-gray-400 mb-3",children:["Added: ",new Date(r.created_at).toLocaleDateString()]}),e.jsx("button",{onClick:l=>{l.stopPropagation(),window.open(r.trading_idea_url,"_blank")}
7,className:"text-sm font-medium text-bronze-600 dark:text-bronze-400 hover:text-bronze-500 dark:hover:text-bronze-300 transition-colors",children:"View Chart →"}),ce&&e.jsxs("div",{className:"mt-4 pt-3 border-t border-gray-200 dark:border-gray-700 flex flex-col gap-2",children:[e.jsxs("button",{onClick:l=>{l.stopPropagation(),q(r.id),ue(""),O("")},className:"w-full px-3 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 rounded-md flex items-center justify-center space-x-2",children:[e.jsx("span",{children:"📈"}),e.jsx("span",{children:"Close with P&L"})]}),e.jsxs("button",{onClick:l=>{l.stopPropagation(),K(r.id),q(null),J(null)},className:"w-full px-3 py-2 text-sm font-medium text-orange-600 dark:text-orange-400 bg-surface-elevated dark:bg-surface-elevated hover:bg-surface-elevated dark:hover:bg-surface-elevated rounded-md flex items-center justify-center space-x-2",children:[e.jsx("span",{children:"⏸️"}),e.jsx("span",{children:"Mark Inactive"})]}),e.jsxs("button",{onClick:l=>{l.stopPropagation(),J(r.id),q(null),K(null)},className:"w-full px-3 py-2 text-sm font-medium text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-900/20 hover:bg-red-100 dark:hover:bg-red-900/30 rounded-md flex items-center justify-center space-x-2",children:[e.jsx(ur,{className:"w-4 h-4"}),e.jsx("span",{children:"Delete"})]})]})]})]})},"".concat(r.id,"-").concat(i)))}),I&&e.jsxs("div",{className:"mt-6 p-4 bg-surface-elevated dark:bg-surface-elevated border border-gray-200 dark:border-gray-700 rounded-lg",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4",children:"Close Trading Idea"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"P&L Percentage *"}),e.jsx("input",{type:"number",value:oe,onChange:r=>ue(r.target.value),placeholder:"Enter P&L percentage (e.g., 15.5 or -8.2)",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 focus:border-transparent bg-white dark:bg-surface-elevated text-gray-900 dark:text-white",step:"0.1",required:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Exit Chart URL (TradingView)"}),e.jsx("input",{type:"text",value:h,onChange:r=>O(r.target.value),placeholder:"Enter TradingView chart URL for trade exit",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-bronze-500 focus:border-transparent bg-white dark:bg-surface-elevated text-gray-900 dark:text-white"})]}),e.jsxs("div",{className:"flex space-x-3",children:[e.jsx("button",{onClick:()=>{q(null),ue(""),O("")},className:"px-4 py-2 text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 rounded-lg hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors",children:"Cancel"}),e.jsx("button",{onClick:async()=>{if(!oe||!I)return;const r=D.find(i=>i.id===I);if(r)try{await v.from("recent_trades").insert({symbol:r.coin_symbol,name:r.coin_name,trading_idea_url:r.trading_idea_url,pnl_percentage:parseFloat(oe),exit_chart_image_url:h||null,status:"CLOSED"}),await v.from("trading_ideas").update({status:"CLOSED",closed_at:new Date().toISOString(),pnl_percentage:parseFloat(oe)}).eq("id",I),await Ie(),q(null),ue(""),O("");const i=r.coin_symbol,l=k.filter(H=>H.coin_symbol===i);j(l)}catch(i){console.error("Error closing trade:",i)}},disabled:!oe,className:"px-4 py-2 bg-green-500 hover:bg-green-600 disabled:bg-gray-400 disabled:cursor-not-allowed text-white rounded-lg transition-colors",children:"Close Trade"})]})]})]}),Q&&e.jsxs("div",{className:"mt-6 p-4 bg-surface-elevated dark:bg-surface-elevated border border-gray-200 dark:border-gray-700 rounded-lg",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4",children:"Mark Trading Idea as Inactive"}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-4",children:"Are you sure you want to mark this trading idea as inactive?"}),e.jsxs("div",{className:"flex space-x-3",children:[e.jsx("button",{onClick:()=>K(null),className:"px-4 py-2 text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 rounded-lg hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors",children:"Cancel"}),e.jsx("button",{onClick:async()=>
7{if(Q)try{await v.from("trading_ideas").update({status:"INACTIVE"}).eq("id",Q),await Ie();const r=D.map(i=>i.id===Q?{...i,status:"INACTIVE"}:i);j(r),K(null)}catch(r){console.error("Error marking idea as inactive:",r)}},className:"px-4 py-2 bg-surface-elevated hover:bg-surface-elevated text-white rounded-lg transition-colors",children:"Mark Inactive"})]})]}),m&&e.jsxs("div",{className:"mt-6 p-4 bg-red-50 dark:bg-red-900/20 border border-gray-200 dark:border-gray-700 rounded-lg",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4",children:"Delete Trading Idea"}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-2",children:"Are you sure you want to permanently delete this trading idea?"}),e.jsx("p",{className:"text-sm text-red-600 dark:text-red-400 mb-4",children:"This action cannot be undone."}),e.jsxs("div",{className:"flex space-x-3",children:[e.jsx("button",{onClick:()=>J(null),className:"px-4 py-2 text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 rounded-lg hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors",children:"Cancel"}),e.jsx("button",{onClick:async()=>{if(m)try{await v.from("trading_ideas").delete().eq("id",m),await Ie();const r=D.filter(i=>i.id!==m);j(r),J(null),r.length===0&&F(!1)}catch(r){console.error("Error deleting trading idea:",r)}},className:"px-4 py-2 bg-red-500 hover:bg-red-600 text-white rounded-lg transition-colors",children:"Delete Permanently"})]})]})]})}),e.jsx("div",{className:"px-6 py-4 border-t border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-surface-elevated",children:e.jsx("button",{onClick:()=>{F(!1),q(null),ue(""),K(null),J(null)},className:"px-4 py-2 bg-gray-500 hover:bg-gray-600 text-white rounded-lg transition-colors",children:"Close"})})]})}),Ne&&e.jsx(Ft,{isOpen:Ce,onClose:()=>{ve(!1),X(null)},asset:Ne})]})});var yr={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Yt=Ve.createContext&&Ve.createContext(yr),na=["attr","size","title"];function la(n,c){if(n==null)return{};var o=oa(n,c),g,b;if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(n);for(b=0;b<w.length;b++)g=w[b],!(c.indexOf(g)>=0)&&Object.prototype.propertyIsEnumerable.call(n,g)&&(o[g]=n[g])}return o}function oa(n,c){if(n==null)return{};var o={};for(var g in n)if(Object.prototype.hasOwnProperty.call(n,g)){if(c.indexOf(g)>=0)continue;o[g]=n[g]}return o}function Nt(){return Nt=Object.assign?Object.assign.bind():function(n){for(var c=1;c<arguments.length;c++){var o=arguments[c];for(var g in o)Object.prototype.hasOwnProperty.call(o,g)&&(n[g]=o[g])}return n},Nt.apply(this,arguments)}function Kt(n,c){var o=Object.keys(n);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(n);c&&(g=g.filter(function(b){return Object.getOwnPropertyDescriptor(n,b).enumerable})),o.push.apply(o,g)}return o}function _t(n){for(var c=1;c<arguments.length;c++){var o=arguments[c]!=null?arguments[c]:{};c%2?Kt(Object(o),!0).forEach(function(g){ia(n,g,o[g])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Kt(Object(o)).forEach(function(g){Object.defineProperty(n,g,Object.getOwnPropertyDescriptor(o,g))})}return n}function ia(n,c,o){return c=ca(c),c in n?Object.defineProperty(n,c,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[c]=o,n}function ca(n){var c=da(n,"string");return typeof c=="symbol"?c:c+""}function da(n,c){if(typeof n!="object"||!n)return n;var o=n[Symbol.toPrimitive];if(o!==void 0){var g=o.call(n,c);if(typeof g!="object")return g;throw new TypeError("@@toPrimitive must return a primitive value.")}return(c==="string"?String:Number)(n)}function fr(n){return n&&n.map((c,o)=>Ve.createElement(c.tag,_t({key:o},c.attr),fr(c.child)))}function Bt(n){return c=>Ve.createElement(ga,Nt({attr:_t({},n.attr)},c),fr(n.child))}function ga(n){var c=o=>{var{attr:g,size:b,title:w}=n,R=la(n,na),G=b||o.size||"1em",u;return o.className&&(u=o.className),n.className&&(u=(u?u+" ":"")+n.className),Ve.createElement("svg",Nt({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},o.attr,g,R,{className:u,style:_t(_t({color:n.color||o.color},o.style),n.style),height:G,width:G,xmlns:"http://www.w3.org/2000/svg"}),w&&Ve.createElement("title",null,w),n.children)};return Yt!==void 0?Ve.createElement(Yt.Consumer,null,o=>c(o)):c(yr)}function ma(n){return Bt({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zm-141.651-35.33c4.937-32.999-20.191-50.739-54.55-62.573l11.146-44.702-27.213-6.781-10.851 43.524c-7.154-1.783-14.502-3.464-21.803-5.13l10.929-43.81-27.198-6.781-11.153 44.686c-5.922-1.349-11.735-2.682-17.377-4.084l.031-.14-37.53-9.37-7.239 29.062s20.191 4.627 19.765 4.913c11.022 2.751 13.014 10.044 12.68 15.825l-12.696 50.925c.76.194 1.744.473 2.829.907-.907-.225-1.876-.473-2.876-.713l-17.796 71.338c-1.349 3.348-4.767 8.37-12.471 6.464.271.395-19.78-4.937-19.78-4.937l-13.51 31.147 35.414 8.827c6.588 1.651 13.045 3.379 19.4 5.006l-11.262 45.213 27.182 6.781 11.153-44.733a1038.209 1038.209 0 0 0 21.687 5.627l-11.115 44.523 27.213 6.781 11.262-45.128c46.404 8.781 81.299 5.239 95.986-36.727 11.836-33.79-.589-53.281-25.004-65.991 17.78-4.098 31.174-15.792 34.747-39.949zm-62.177 87.179c-8.41 33.79-65.308 15.523-83.755 10.943l14.944-59.899c18.446 4.603 77.6 13.717 68.811 48.956zm8.417-87.667c-7.673 30.736-55.031 15.12-70.393 11.292l13.548-54.327c15.363 3.828 64.836 10.973 56.845 43.035z"},child:[]}]})(n)}function xa(n){return Bt({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M496 384H64V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-32c0-8.84-7.16-16-16-16zM464 96H345.94c-21.38 0-32.09 25.85-16.97 40.97l32.4 32.4L288 242.75l-73.37-73.37c-12.5-12.5-32.76-12.5-45.25 0l-68.69 68.69c-6.25 6.25-6.25 16.38 0 22.63l22.62 22.62c6.25 6.25 16.38 6.25 22.63 0L192 237.25l73.37 73.37c12.5 12.5 32.76 12.5 45.25 0l96-96 32.4 32.4c15.12 15.12 40.97 4.41 40.97-16.97V112c.01-8.84-7.15-16-15.99-16z"},child:[]}]})(n)}function ua(n){return Bt({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M341.28 22.78L254 123.75l63.156-33.656 4.438-2.375 4.437 2.405 18.314 9.938-3.063-77.282zM129.814 46.563l24.375 130.407 88.718-47.282-113.094-83.125zM321.53 108.97L83.345 235.905 192.156 293.5l237.47-125.75-108.095-58.78zm42.75 44.686l25.595 13.03-197.313 103.94-66.875-35.688 25.344-13.407 41.532 22.19 171.72-90.064zm92.19 18.22l9.092 24.03 26.22-22.656-35.313-1.375zm-15.783 11.155L199.47 310.78l-5.782 83.376L465.75 249.344l-25.063-66.313zm-334.562 19.564L16.562 226.78l36.876 19.564 6.093-16.28 1.25-3.314 3.126-1.656 42.22-22.5zm-34.438 48.312l-28.812 77 131.844 70.156 6.155-89.375-109.188-57.78zm335.344 50.875l-174.25 92.75 54.907 103.44L325.5 358.093l142.47 26.625-60.94-82.94zm-300.717 81.064l-19.438 44.812L144 402.876l-37.688-20.032z"},child:[]}]})(n)}function Rt({title:n,description:c}){const[o,g]=s.useState(!1);return s.useEffect(()=>{if(!o)return;const b=w=>{w.key==="Escape"&&g(!1)};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[o]),e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:b=>{b.preventDefault(),b.stopPropagation(),g(!0)},"aria-label":n,className:"flex items-center justify-center h-5 w-5 rounded-full text-gray-500 hover:text-[#C9A96E] hover:bg-white/5 transition-colors flex-shrink-0",children:e.jsx(Mr,{className:"h-3.5 w-3.5"})}),o&&vr.createPortal(e.jsxs("div",{className:"fixed inset-0 z-[9999] flex items-end md:items-center justify-center p-4",onClick:()=>g(!1),children:[e.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-[2px]"}),e.jsxs("div",{className:"relative w-full max-w-sm bg-[#141414] rounded-2xl border border-white/10 shadow-2xl shadow-black/40 overflow-hidden",onClick:b=>b.stopPropagation(),children:[e.jsx("div",{className:"h-[2px] w-full bg-gradient-to-r from-transparent via-[#C9A96E] to-transparent"}),e.jsxs("div",{className:"p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3 mb-3",children:[e.jsx("p",{className:"font-semibold text-white text-base leading-tight",children:n}),e.jsx("button",{onClick:()=>g(!1),className:"w-7 h-7 rounded-full flex items-center justify-center text-gray-400 hover:text-white hover:bg-white/10 transition-colors flex-shrink-0 -mt-0.5 -mr-1",children:e.jsx(Re,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"text-sm leading-relaxed text-gray-400 space-y-3",children:c})]})]})]}),document.body)]})}const Ae="https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/images",ha={BNB:"".concat(Ae,"/BNB_live.png"),XAG:"".concat(Ae,"/SILBER.png"),S:"".concat(Ae,"/SONIC.png"),SONIC:"".concat(Ae,"/SONIC.png"),TRX:"".concat(Ae,"/TRON.png"),GOLD:"".concat(Ae,"/GOLD.png"),XAU:"".concat(Ae,"/GOLD.png"),NVDA:"".concat(Ae,"/14.png"),SPX:"".concat(Ae,"/SPX.png"),NDX:"".concat(Ae,"/NDX.png"),TSLA:"".concat(Ae,"/live_TSLA.png"),APP:"".concat(Ae,"/LOVINAPP.png"),HYPE:"".concat(Ae,"/liveHype.png"),MSFT:"".concat(Ae,"/liveMicrosoft.png"),AMZN:"".concat(Ae,"/liveAmazon.png"),MCD:"".concat(Ae,"/MCDlive.png"),XOM:"".concat(Ae,"/live_exxon.png")};function pa(n){return ha[n]||"".concat(Ae,"/live").concat(n,".png")}const ba=({chart:n,language:c})=>{const[o,g]=s.useState(!1);return o?e.jsx("div",{className:"w-full h-[195px] bg-[#1A1714] flex items-center justify-center",children:e.jsx("span",{className:"text-gray-500 text-xs",children:c==="en"?"Chart Preview":"Chart-Vorschau"})}):e.jsx("img",{src:pa(n.symbol),alt:"".concat(n.name," chart"),className:"w-full h-auto block",onError:()=>g(!0)})},ya=n=>{const c=["BTC","ETH"];return[...n.filter(o=>o.symbol==="BTC"),...n.filter(o=>o.symbol==="ETH"),...n.filter(o=>!c.includes(o.symbol))]},fa=()=>{const{theme:n}=ft(),{language:c}=Ze(),o=Qe(),g=Ge(),[b,w]=s.useState([]),[R,G]=s.useState(!0),[u,U]=s.useState(!1),[N,C]=s.useState(0),[T,Y]=s.useState(!1),W=s.useRef(null),L=s.useRef(null),M=s.useRef(null),S=s.useRef(0);s.useEffect(()=>{me()},[]);const me=async()=>{try{G(!0);const{data:k,error:P}=await v.from("CryptoDashboard").select("symbol, name, live_charts"),{data:_,error:F}=await v.from("commodities").select("name, symbol, live_charts"),{data:D,error:j}=await v.from("stocks").select("name, symbol, live_charts");if(P)throw P;if(F)throw F;if(j)throw j;const I=(k==null?void 0:k.filter(h=>h.live_charts).map(h=>
7({symbol:h.symbol,name:h.name,live_charts:h.live_charts,lastUpdated:"Watch Now"})))||[],q=(_==null?void 0:_.filter(h=>h.live_charts).map(h=>{var O;return{symbol:h.symbol||((O=h.name)==null?void 0:O.toUpperCase())||"COMMODITY",name:h.name,live_charts:h.live_charts,lastUpdated:"Watch Now"}}))||[],oe=(D==null?void 0:D.filter(h=>h.live_charts).map(h=>{var O;return{symbol:h.symbol||((O=h.name)==null?void 0:O.toUpperCase())||"STOCK",name:h.name,live_charts:h.live_charts,lastUpdated:"Watch Now"}}))||[],ue=ya([...I,...q,...oe]);w(ue)}catch(k){console.error("Error fetching live charts:",k)}finally{G(!1)}};s.useEffect(()=>{const k=P=>{if(!u&&W.current&&b.length>2){S.current||(S.current=P);const _=P-S.current,F=30/1e3,D=_*F;if(_>=16){const q=b.length*366;C(oe=>{const ue=oe-D;return ue<=-q?ue+q:ue}),S.current=P}}else u&&(S.current=0);u||(M.current=requestAnimationFrame(k))};return!u&&b.length>2&&!R&&(M.current=requestAnimationFrame(k)),()=>{M.current&&(cancelAnimationFrame(M.current),S.current=0)}},[u,b.length,R]);const be=()=>{U(!0),L.current&&clearTimeout(L.current),L.current=setTimeout(()=>{U(!1)},4e3)},xe=k=>{if(!W.current)return;const P=366,_=P*2,D=b.length*P;be(),Y(!0),C(j=>{var O,Q;let I=k==="right"?j-_:j+_;const ue=(((Q=(O=W.current)==null?void 0:O.parentElement)==null?void 0:Q.clientWidth)||600)/2-358,h=Math.round((I-ue)/P)*P+ue;return setTimeout(()=>{Math.abs(h)>2*D&&C(K=>-((K%D+D)%D))},400),h}),setTimeout(()=>Y(!1),300)},V=b.length>2;return s.useEffect(()=>()=>{L.current&&clearTimeout(L.current),M.current&&cancelAnimationFrame(M.current)},[]),R?e.jsxs("div",{className:"cm-card-surface cm-card-surface-hover p-6",children:[e.jsx("div",{className:"h-8 w-48 bg-gray-300 dark:bg-gray-700 rounded mb-6 animate-pulse"}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx("div",{className:"h-40 bg-gray-300 dark:bg-gray-700 rounded animate-pulse"}),e.jsx("div",{className:"h-40 bg-gray-300 dark:bg-gray-700 rounded animate-pulse"})]})]}):e.jsx("div",{className:"cm-card-flat",children:e.jsxs("div",{className:"cm-card-flat-inner p-3 sm:p-4 relative",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"h-8 w-8 rounded-lg flex items-center justify-center",style:{background:"rgba(153,125,65,0.15)"},children:e.jsx(hr,{className:"h-4 w-4 text-[#C9A96E]"})}),e.jsx("h2",{className:"text-lg font-semibold text-white",children:c==="en"?"Live Charts":"Live-Charts"}),e.jsx(Rt,{title:c==="en"?"Live Charts":"Live-Charts",description:c==="en"?"Live TradingView charts for the most important coins, updated in real time so you always have the current price action in view.":"Live-TradingView-Charts für die wichtigsten Coins, die in Echtzeit aktualisiert werden, damit du immer das aktuelle Kursgeschehen im Blick hast."})]}),e.jsxs(Ot,{to:o?"/pricing":"/live-charts",className:"flex items-center text-sm text-gray-400 hover:text-[#C9A96E] transition-colors",children:[c==="en"?"View All":"Alle anzeigen"," ",e.jsx(De,{className:"h-4 w-4 ml-1"})]})]}),e.jsxs("div",{className:"relative",children:[o&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center z-20 pointer-events-none",children:e.jsxs("div",{className:"flex items-center gap-2 px-5 py-2 rounded-full shadow-lg pointer-events-auto cursor-pointer",style:{background:"linear-gradient(135deg, #C9A96E, #A8864A)"},onClick:()=>g("/pricing"),children:[e.jsx(gt,{className:"w-4 h-4 text-white"}),e.jsx("span",{className:"text-white text-sm font-bold tracking-wider",children:"PRO"})]})}),V&&e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:()=>xe("left"),className:"absolute left-2 top-1/2 transform -translate-y-1/2 ".concat(n==="dark"?"bg-[#1A1714] hover:bg-[#1A1714]/90":"bg-white hover:bg-gray-100"," rounded-full p-2 shadow-lg z-10"),style:{boxShadow:"0 4px 10px rgba(0,0,0,0.2)",border:"1px solid rgba(0,0,0,0.1)",width:"36px",height:"36px",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(vt,{className:"h-5 w-5 ".concat(n==="dark"?"text-gray-400":"text-gray-600")})}),e.jsx("button",{onClick:()=>xe("right"),className:"absolute right-2 top-1/2 transform -translate-y-1/2 ".concat(n==="dark"?"bg-[#1A1714] hover:bg-[#1A1714]/90":"bg-white hover:bg-gray-100"," rounded-full p-2 shadow-lg z-10"),style:{boxShadow:"0 4px 10px rgba(0,0,0,0.2)",border:"1px solid rgba(0,0,0,0.1)",width:"36px",height:"36px",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(De,{className:"h-5 w-5 ".concat(n==="dark"?"text-gray-400":"text-gray-600")})})]}),e.jsx("div",{className:"overflow-x-hidden w-full",style:{paddingTop:"0px",paddingBottom:"0px"},children:e.jsx("div",{ref:W,className:"flex gap-4 items-start",style:{width:"max-content",transform:"translateX(".concat(N,"px)"),transition:T?"transform 0.3s ease-out":"none",paddingTop:"4px",paddingBottom:"4px"},onMouseEnter:()=>U(!0),onMouseLeave:()=>U(!1),children:b.length===0?e.jsx("div",{className:"flex items-center justify-center h-40 text-gray-500 dark:text-gray-400 w-full",children:c==="en"?"No live charts available":"Keine Live-Charts verfügbar"}):[...b,...b,...b].map((k,P)=>e.jsx("div",{className:"flex-shrink-0 rounded-lg overflow-hidden border border-white/10 hover:border-[#C9A96E]/40 transition-all hover:scale-[1.02] cursor-pointer",style:{width:"350px",background:"#1A1714"},children:e.jsx("div",{className:"rounded-lg overflow-hidden h-full flex flex-col",children:e.jsx("a",{href:o?void 0:k.live_charts,target:o?void 0:"_blank",rel:o?void 0:"noopener noreferrer",onClick:o?_=>{_.preventDefault(),g("/pricing")}:void 0,className:"block cursor-pointer",children:e.jsx("div",{className:"relative w-full bg-[#0A0A0A]",children:e.jsx(ba,{chart:k,language:c})})})})},"chart-".concat(P)))})})]})]})})},Pe="https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/coins/Coin_Icons",ze="https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/images",va={SPX:"".concat(ze,"/34.svg"),SP500:"".concat(ze,"/34.svg"),NDX:"".concat(ze,"/35.svg"),NASDAQ:"".concat(ze,"/35.svg"),COIN:"".concat(Pe,"/coinbase.png"),META:"".concat(Pe,"/meta.jpg"),HOOD:"".concat(Pe,"/robinh
7ood.png"),AMZN:"".concat(ze,"/amzn.png"),ARM:"".concat(ze,"/arm.png"),GOOGL:"".concat(ze,"/googl.webp"),INTC:"".concat(ze,"/intel.jpg"),MSFT:"".concat(ze,"/msft.png"),TSLA:"".concat(ze,"/tsla.png"),APP:"".concat(ze,"/APP_LOVIN.png"),APPLOVIN:"".concat(ze,"/APP_LOVIN.png"),XOM:"".concat(Pe,"/XOM.png"),BE:"".concat(Pe,"/BE.png"),GOLD:"".concat(Pe,"/XAU.png"),XAU:"".concat(Pe,"/XAU.png"),XAG:"".concat(Pe,"/XAG.png"),NATGAS:"".concat(Pe,"/GAS%20(1).png"),BRENT:"".concat(Pe,"/Brent%20Oil.png"),WTI:"".concat(Pe,"/WTI.jpeg"),COFFEE:"".concat(ze,"/coffee.png"),GASOLINE:"".concat(ze,"/gasoline.png"),DXY:"".concat(Pe,"/DXY.png")};function Zt(n){const c=n.toUpperCase();return va[c]||"".concat(Pe,"/").concat(n,".png")}const ja=()=>{const{theme:n}=ft(),{language:c}=Ze(),{prices:o}=Or(),g=Qe(),b=Ge(),[w,R]=s.useState([]),[G,u]=s.useState(!0),[U,N]=s.useState(!1),C=s.useRef(0),T=s.useRef(null),Y=s.useRef(null),W=s.useRef(null),L=s.useRef(0),M=h=>{T.current&&(T.current.style.transition=h||"none",T.current.style.transform="translateX(".concat(C.current,"px)"))},S=h=>{if(!h)return!1;const O=new Date(h);return(new Date().getTime()-O.getTime())/(1e3*60*60)<24},[me,be]=s.useState(!1),[xe,V]=s.useState(null),k=[{id:"boxen",title:c==="en"?"Box Trading Tutorial":"Boxen Trading Tutorial",url:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/sign/video/Boxen%20Trading%20Tutorial.mp4?token=eyJraWQiOiJzdG9yYWdlLXVybC1zaWduaW5nLWtleV8wMDBlZmYxOC02ZTRmLTRiMmItYWJhYi01N2ZjMzU0YjFlM2QiLCJhbGciOiJIUzI1NiJ9.eyJ1cmwiOiJ2aWRlby9Cb3hlbiBUcmFkaW5nIFR1dG9yaWFsLm1wNCIsImlhdCI6MTc1NTM2NzE4OCwiZXhwIjozMzI1OTgzMTE4OH0.tLYK-5xjzWazOTuFIbJTj3Kt1v9oDdmaR-DcpAasmEk"},{id:"breakout",title:"Breakout Trading Tutorial",url:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/sign/video/Breakout%20Trading%20Tutorial.mp4?token=eyJraWQiOiJzdG9yYWdlLXVybC1zaWduaW5nLWtleV8wMDBlZmYxOC02ZTRmLTRiMmItYWJhYi01N2ZjMzU0YjFlM2QiLCJhbGciOiJIUzI1NiJ9.eyJ1cmwiOiJ2aWRlby9CcmVha291dCBUcmFkaW5nIFR1dG9yaWFsLm1wNCIsImlhdCI6MTc1NTM2NzI3MSwiZXhwIjozMzI1OTgzMTI3MX0.-Z94hMF2ZLmy4JcEbPegN9fJ192fqeDa9gyZrV4W4Xc"},{id:"swing",title:"Swing Trading Tutorial",url:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/sign/video/Swing%20Trading%20Tutorial.mp4?token=eyJraWQiOiJzdG9yYWdlLXVybC1zaWduaW5nLWtleV8wMDBlZmYxOC02ZTRmLTRiMmItYWJhYi01N2ZjMzU0YjFlM2QiLCJhbGciOiJIUzI1NiJ9.eyJ1cmwiOiJ2aWRlby9Td2luZyBUcmFkaW5nIFR1dG9yaWFsLm1wNCIsImlhdCI6MTc1NTM2NzMxMywiZXhwIjozMzI1OTgzMTMxM30.1Fv70ZourH52sadMolWAoKgnYx2kCabdM7A_XGppAto"}],[P,_]=s.useState({}),[F,D]=s.useState({});s.useEffect(()=>{j(),I()},[]);const j=async()=>{try{u(!0);const{data:h,error:O}=await v.from("trading_ideas_gated").select("*").eq("status","ACTIVE").order("created_at",{ascending:!1});let Q=[];if(!O&&h&&h.length>0)Q=h;else{console.log("Using legacy system for trading ideas");const{data:K,error:m}=await v.from("CryptoDashboard").select("symbol, name, trading_ideas, market_structure"),{data:J,error:he}=await v.from("commodities").select("name, symbol, trading_ideas, market_structure");if(m)throw m;if(he)throw he;const le=(K==null?void 0:K.filter(B=>B.trading_ideas).map(B=>
7({symbol:B.symbol,coin_symbol:B.symbol,name:B.name,coin_name:B.name,trading_ideas:B.trading_ideas,trading_idea_url:B.trading_ideas,market_structure:B.market_structure})))||[],fe=(J==null?void 0:J.filter(B=>B.trading_ideas).map(B=>{var _e,ie;return{symbol:B.symbol||((_e=B.name)==null?void 0:_e.toUpperCase())||"COMMODITY",coin_symbol:B.symbol||((ie=B.name)==null?void 0:ie.toUpperCase())||"COMMODITY",name:B.name,coin_name:B.name,trading_ideas:B.trading_ideas,trading_idea_url:B.trading_ideas,market_structure:B.market_structure}}))||[],ae=new Set,re=[];h&&h.length>0&&h.forEach(B=>{B.trading_idea_url&&!ae.has(B.trading_idea_url)&&(ae.add(B.trading_idea_url),re.push(B))}),[...le,...fe].forEach(B=>{const _e=B.trading_idea_url||B.trading_ideas;_e&&!ae.has(_e)&&(ae.add(_e),re.push(B))}),Q=re}R(Q)}catch(h){console.error("Error fetching trading ideas:",h)}finally{u(!1)}},I=async()=>{const{data:h,error:O}=await v.from("notifications").select("trading_idea_id, symbol, created_at, type").eq("type","trading_idea").order("created_at",{ascending:!1});if(!O&&h){const Q={},K={};h.forEach(m=>{m.trading_idea_id&&!Q[m.trading_idea_id]&&(Q[m.trading_idea_id]={created_at:m.created_at}),m.symbol&&!K[m.symbol]&&(K[m.symbol]={created_at:m.created_at},K[m.symbol.toUpperCase()]={created_at:m.created_at})}),_(Q),D(K)}};s.useEffect(()=>{const h=O=>{if(!U&&T.current&&w.length>2){L.current||(L.current=O);const Q=O-L.current,K=40/1e3,m=Q*K;if(Q>=16){const le=w.length*366;let fe=C.current-m;fe<=-le&&(fe+=le),C.current=fe,M(),L.current=O}}else U&&(L.current=0);U||(W.current=requestAnimationFrame(h))};return!U&&w.length>2&&!G&&(W.current=requestAnimationFrame(h)),()=>{W.current&&(cancelAnimationFrame(W.current),L.current=0)}},[U,w.length,G]);const q=()=>{N(!0),Y.current&&clearTimeout(Y.current),Y.current=setTimeout(()=>{N(!1)},4e3)},oe=h=>{var B,_e;if(!T.current)return;const O=366,Q=O*2,m=w.length*O;q();const J=C.current;let he=h==="right"?J-Q:J+Q;const ae=(((_e=(B=T.current)==null?void 0:B.parentElement)==null?void 0:_e.clientWidth)||600)/2-358,re=Math.round((he-ae)/O)*O+ae;C.current=re,M("transform 0.3s ease-out"),setTimeout(()=>{if(Math.abs(C.current)>2*m){const A=(C.current%m+m)%m;C.current=-A,M()}},400)},ue=w.length>2;return s.useEffect(()=>()=>{Y.current&&clearTimeout(Y.current),W.current&&cancelAnimationFrame(W.current)},[]),G?e.jsxs("div",{className:"cm-card-surface cm-card-surface-hover p-6",children:[e.jsx("div",{className:"h-8 w-48 bg-gray-300 dark:bg-gray-700 rounded mb-6 animate-pulse"}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx("div",{className:"h-40 bg-gray-300 dark:bg-gray-700 rounded animate-pulse"}),e.jsx("div",{className:"h-40 bg-gray-300 dark:bg-gray-700 rounded animate-pulse"})]})]}):e.jsxs("div",{className:"cm-card-flat",children:[e.jsxs("div",{className:"cm-card-flat-inner p-3 sm:p-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"h-8 w-8 rounded-lg flex items-center justify-center",style:{background:"rgba(153,125,65,0.15)"},children:e.jsx($r,{className:"h-4 w-4 text-[#C9A96E]"})}),e.jsx("h2",{className:"text-lg font-semibold text-white",children:"Core Trades"}),e.jsxs("button",{onClick:()=>be(!0),className:"flex items-center gap-1 px-2 py-0.5 rounded-full text-[11px] font-semibold text-white bg-red-600 hover:bg-red-700 border border-red-500 transition-colors",children:[e.jsx(hr,{className:"w-3 h-3"}),c==="en"?"Tutorial":"Anleitung"]}),e.jsx(Rt,{title:"Core Trades",description:c==="en"?"Our core trading ideas — lower-risk setups with clear entries, targets and stop-loss, suited for building longer-term positions.":"Unsere Core Trades — Trading-Ideen mit geringerem Risiko und klaren Einstiegen, Zielen und Stop-Loss, geeignet für den Aufbau längerfristiger Positionen."})]}),e.jsxs(Ot,{to:g?"/pricing":"/trading-ideas",className:"flex items-center text-sm text-gray-400 hover:text-[#C9A96E] transition-colors",children:[c==="en"?"View All":"Alle anzeigen"," ",e.jsx(De,{className:"h-4 w-4 ml-1"})]})]}),e.jsxs("div",{className:"relative",children:[ue&&e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:()=>oe("left"),className:"absolute left-2 top-1/2 transform -translate-y-1/2 ".concat(n==="dark"?"bg-[#1A1714] hover:bg-[#1A1714]/90":"bg-white hover:bg-gray-100"," rounded-full p-2 shadow-lg z-10"),style:{boxShadow:"0 4px 10px rgba(0,0,0,0.2)",border:"1px solid rgba(0,0,0,0.1)",width:"36px",height:"36px",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(vt,{className:"h-5 w-5 ".concat(n==="dark"?"text-gray-400":"text-gray-600")})}),e.jsx("button",{onClick:()=>oe("right"),className:"absolute right-2 top-1/2 transform -translate-y-1/2 ".concat(n==="dark"?"bg-[#1A1714] hover:bg-[#1A1714]/90":"bg-white hover:bg-gray-100"," rounded-full p-2 shadow-lg z-10"),style:{boxShadow:"0 4px 10px rgba(0,0,0,0.2)",border:"1px solid rgba(0,0,0,0.1)",width:"36px",height:"36px",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(De,{className:"h-5 w-5 ".concat(n==="dark"?"text-gray-400":"text-gray-600")})})]}),e.jsx("div",{className:"overflow-x-hidden w-full",style:{paddingTop:"0px",paddingBottom:"0px"},children:e.jsx("div",{ref:T,className:"flex gap-4 items-start",style:{width:"max-content",willChange:"transform",paddingTop:"4px",paddingBottom:"4px"},onMouseEnter:()=>N(!0),onMouseLeave:()=>N(!1),children:w.length===0?e.jsx("div",{className:"flex items-center justify-center h-40 text-gray-500 dark:text-gray-400 w-full",children:c==="en"?"No trading ideas available":"Keine Trading-Ideen verfügbar"}):[...w,...w,...w].map((h,O)=>{const Q="idea-".concat(h.id||O,"-").concat(O);return e.jsxs("div",{className:"group relative flex-shrink-0 rounded-lg overflow-hidden border border-white/10 hover:border-[#C9A96E]/40 transition-all hover:scale-[1.02] cursor-pointer",style:{width:"350px",background:"#1A1714"},onClick:()=>g?b("/pricing"):window.open(h.trading_idea_url||h.trading_ideas,"_blank"),children:[g&&e.jsxs("div",{className:"absolute inset-0 z-30",children:[e.jsx("div",{className:"absolute inset-0 backdrop-blur-sm bg-black/30"}),e.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-3",children:[e.jsx("img",{src:Zt(h.coin_symbol||h.symbol||""),alt:h.coin_symbol||h.symbol||"asset",className:"w-16 h-16 drop-shadow-lg",onError:K=>{const m=K.target;m.style.display="none"}}),e.jsxs("div",{className:"flex items-center gap-2 px-5 py-2 rounded-full shadow-lg",style:{background:"linear-gradient(135deg, #C9A96E, #A8864A)"},children:[e.jsx(gt,{className:"w-4 h-4 text-white"}),e.jsx("span",{className:"text-white text-sm font-bold tracking-wider",children:"PRO"})]})]})]}),e.jsxs("div",{className:"relative w-full bg-[#0A0A0A] ".concat(g?"blur-[6px]":""),style:{height:"195px"},children:[g?e.jsx("div",{className:"w-full h-full bg-gradient-to-br from-[#1A1714] to-[#0A0A0A]"}):e.jsx("img",{src:h.trading_idea_url||h.trading_ideas,alt:"".concat(h.coin_symbol||h.symbol," trading chart"),className:"w-full h-full object-cover block",loading:"lazy",decoding:"async",onError:K=>{const m=K.target;m.src="https://placehold.co/600x400?text=No+Preview"}}),!g&&e.jsx("div",{className:"absolute top-0 left-0 right-0 z-10 bg-gradient-to-b from-black/90 via-black/55 to-transparent pb-6 pt-2.5 px-3",children:e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("img",{src:Zt(h.coin_symbol||h.symbol||""),alt:h.coin_symbol||h.symbol||"asset",className:"w-6 h-6 flex-shrink-0",onError:K=>{const m=K.target;m.style.display="none"}}),e.jsx("span",{className:"font-bold text-base text-white",children:h.coin_symbol||h.symbol}),h.entry_type&&e.jsx("span",{className:"text-xs font-bold px-2 py-0.5 rounded ".concat(h.entry_type==="LONG"?"bg-green-500/25 text-green-400":"bg-red-500/25 text-red-400"),children:h.entry_type}),h.created_at&&e.jsx("span",{className:"text-xs bg-white/10 text-gray-200 px-2 py-0.5 rounded whitespace-nowrap",children:new Date(h.created_at).toLocaleDateString(c==="de"?"de-DE":"en-US",{day:"numeric",month:"short"})})]})}),!g&&e.jsx("div",{className:"absolute bottom-2 right-2 z-10",children:e.jsx(pr,{symbol:h.coin_symbol||h.symbol||"",entryPrice:h.entry_price,entryType:h.entry_type,tradeStrategy:h.trade_strategy,currentPrice:o.get(h.coin_symbol||h.symbol||""),alreadyTriggered:h.is_triggered,size:"medium"})}),!g&&S(h.created_at)&&e.jsxs("div",{className:"absolute bottom-3 left-3 z-20 flex items-center gap-1 bg-gradient-to-r from-green-500 to-green-600 text-white px-2 py-1 rounded-full text-xs font-bold shadow-lg",children:[e.jsx(br,{className:"w-3 h-3"}),c==="en"?"NEW":"NEU"]})]})]},Q)})})})]})]}),me&&e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-75 flex items-center justify-center z-50 p-4",children:e.jsxs("div",{className:"bg-white dark:bg-[#0f0d0a] rounded-2xl shadow-2xl max-w-4xl w-full max-h-[90vh] overflow-y-auto",children:[e.jsxs("div",{className:"p-6 border-b border-gray-200 dark:border-[#1A1714] flex items-center justify-between",children:[e.jsx("h2",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:c==="en"?"Trading Tutorials":"Trading Anleitungen"}),e.jsx("button",{onClick:()=>be(!1),className:"p-2 hover:bg-gray-100 dark:hover:bg-[#1A1714] rounded-lg transition-colors",children:e.jsx(Re,{className:"w-6 h-6 text-gray-500 dark:text-gray-400"})})]}),e.jsx("div",{className:"p-6",children:e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:k.map(h=>e.jsxs("div",{onClick:()=>V(h.url),className:"group cursor-pointer bg-gray-100 dark:bg-[#1A1714] rounded-xl overflow-hidden hover:shadow-lg transition-all duration-300 transform hover:scale-105",children:[e.jsxs("div",{className:"relative aspect-video bg-gradient-to-br from-red-500 to-red-600 flex items-center justify-center",children:[e.jsx("div",{className:"absolute inset-0 bg-black bg-opacity-20"}),e.jsxs("div",{className:"relative z-10 flex flex-col items-center text-white",children:[e.jsx("div",{className:"w-16 h-16 bg-white bg-opacity-20 rounded-full flex items-center justify-center mb-3 group-hover:bg-opacity-30 transition-all",children:e.jsx(qr,{className:"w-8 h-8 ml-1"})}),e.jsx("span",{className:"text-lg font-medium",children:c==="en"?"Watch Now":"Jetzt Ansehen"})]})]}),e.jsxs("div",{className:"p-4",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-2",children:h.title}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:c==="en"?"Learn professional trading strategies":"Lerne professionelle Trading-Strategien"})]})]}
7,h.id))})})]})}),xe&&e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-90 flex items-center justify-center z-[60] p-4",children:e.jsxs("div",{className:"relative w-full max-w-6xl",children:[e.jsx("button",{onClick:()=>V(null),className:"absolute -top-12 right-0 p-3 bg-white bg-opacity-20 hover:bg-opacity-30 rounded-lg transition-all text-white",children:e.jsx(Re,{className:"w-6 h-6"})}),e.jsx("div",{className:"bg-black rounded-lg overflow-hidden shadow-2xl",children:e.jsx("video",{src:xe,controls:!0,autoPlay:!0,className:"w-full h-auto max-h-[80vh]",onLoadStart:()=>console.log("Video loading started"),onError:h=>console.error("Video error:",h),children:c==="en"?"Your browser does not support the video tag.":"Ihr Browser unterstützt das Video-Tag nicht."})})]})})]})},ka="https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/coins/Coin_Icons";function Qt(n){return"".concat(ka,"/").concat(n,".png")}const wa=n=>n?(Date.now()-new Date(n).getTime())/(1e3*60*60)<24:!1,Na=()=>{const{theme:n}=ft(),{language:c}=Ze(),{prices:o}=Fr(),g=Qe(),b=Ge(),[w,R]=s.useState([]),[G,u]=s.useState(!0),[U,N]=s.useState(!1),C=s.useRef(0),T=s.useRef(null),Y=s.useRef(null),W=s.useRef(null),L=s.useRef(0),M=k=>{T.current&&(T.current.style.transition=k||"none",T.current.style.transform="translateX(".concat(C.current,"px)"))};s.useEffect(()=>{(async()=>{try{u(!0);const{data:P,error:_}=await v.from("active_trades_gated").select("*").eq("status","ACTIVE").order("created_at",{ascending:!1});if(_)throw _;R(P||[])}catch(P){console.error("Error fetching active trades:",P)}finally{u(!1)}})()},[]),s.useEffect(()=>{const k=P=>{if(!U&&T.current&&w.length>2){L.current||(L.current=P);const _=P-L.current,F=40/1e3,D=_*F;if(_>=16){const q=w.length*366;let oe=C.current-D;oe<=-q&&(oe+=q),C.current=oe,M(),L.current=P}}else U&&(L.current=0);U||(W.current=requestAnimationFrame(k))};return!U&&w.length>2&&!G&&(W.current=requestAnimationFrame(k)),()=>{W.current&&(cancelAnimationFrame(W.current),L.current=0)}},[U,w.length,G]);const S=()=>{N(!0),Y.current&&clearTimeout(Y.current),Y.current=setTimeout(()=>N(!1),4e3)},me=k=>{var O,Q;if(!T.current)return;const P=366,_=P*2,D=w.length*P;S();const j=C.current;let I=k==="right"?j-_:j+_;const ue=(((Q=(O=T.current)==null?void 0:O.parentElement)==null?void 0:Q.clientWidth)||600)/2-358,h=Math.round((I-ue)/P)*P+ue;C.current=h,M("transform 0.3s ease-out"),setTimeout(()=>{if(Math.abs(C.current)>2*D){const m=(C.current%D+D)%D;C.current=-m,M()}},400)},be=w.length>2;s.useEffect(()=>()=>{Y.current&&clearTimeout(Y.current),W.current&&cancelAnimationFrame(W.current)},[]);const xe=Ut.colors.activeTradeAccent,V=Ut.colors.activeTradeWarning;return G?e.jsxs("div",{className:"cm-card-surface cm-card-surface-hover p-6",children:[e.jsx("div",{className:"h-8 w-48 bg-gray-300 dark:bg-gray-700 rounded mb-6 animate-pulse"}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx("div",{className:"h-40 bg-gray-300 dark:bg-gray-700 rounded animate-pulse"}),e.jsx("div",{className:"h-40 bg-gray-300 dark:bg-gray-700 rounded animate-pulse"})]})]}):e.jsx("div",{className:"cm-card-flat",children:e.jsxs("div",{className:"cm-card-flat-inner p-3 sm:p-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"h-8 w-8 rounded-lg flex items-center justify-center",style:{background:"".concat(V,"26")},children:e.jsx(Br,{className:"h-4 w-4",style:{color:V}})}),e.jsx("h2",{className:"text-lg font-semibold text-white",children:"High-Risk Trades"}),e.jsx("span",{className:"text-[10px] font-bold uppercase tracking-widest px-2 py-0.5 rounded-full text-white",style:{background:V},children:"BETA"}),e.jsx(Rt,{title:"High-Risk Trades",description:c==="en"?e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:["Our focus is fundamentally on our ",e.jsx("strong",{className:"text-white font-semibold",children:"Core Trades"}),". The ",e.jsx("strong",{className:"text-white font-semibold",children:"High-Risk Trades"})," are an additional, optional feature in ",e.jsx("strong",{className:"text-white font-semibold",children:"BETA phase"})," and are aimed exclusively at experienced traders."]}),e.jsxs("p",{children:["These are short-term, dynamic trading setups with a ",e.jsx("strong",{className:"text-white font-semibold",children:"significantly elevated risk of loss"}),". Due to the higher volatility and speculative nature, only capital whose total loss you can financially bear should be used."]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:["Unser Fokus liegt grundsätzlich auf unseren ",e.jsx("strong",{className:"text-white font-semibold",children:"Core Trades"}),". Die ",e.jsx("strong",{className:"text-white font-semibold",children:"High-Risk Trades"})," sind ein zusätzliches, optionales Feature in der ",e.jsx("strong",{className:"text-white font-semibold",children:"BETA-Phase"})," und richten sich ausschließlich an erfahrene Trader."]}),e.jsxs("p",{children:["Dabei handelt es sich um kurzfristige, dynamische Trading-Setups mit einem ",e.jsx("strong",{className:"text-white font-semibold",children:"deutlich erhöhten Verlustr
7isiko"}),". Aufgrund der höheren Volatilität und des spekulativen Charakters sollte ausschließlich Kapital eingesetzt werden, dessen vollständigen Verlust man finanziell verkraften kann."]})]})})]}),e.jsxs(Ot,{to:g?"/pricing":"/active-trades",className:"flex items-center text-sm text-gray-400 transition-colors hover:opacity-80",style:{color:xe},children:[c==="en"?"View All":"Alle anzeigen"," ",e.jsx(De,{className:"h-4 w-4 ml-1"})]})]}),e.jsxs("div",{className:"relative",children:[be&&e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:()=>me("left"),className:"absolute left-2 top-1/2 transform -translate-y-1/2 ".concat(n==="dark"?"bg-[#1A1714] hover:bg-[#1A1714]/90":"bg-white hover:bg-gray-100"," rounded-full p-2 shadow-lg z-10"),style:{boxShadow:"0 4px 10px rgba(0,0,0,0.2)",border:"1px solid rgba(0,0,0,0.1)",width:"36px",height:"36px",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(vt,{className:"h-5 w-5 ".concat(n==="dark"?"text-gray-400":"text-gray-600")})}),e.jsx("button",{onClick:()=>me("right"),className:"absolute right-2 top-1/2 transform -translate-y-1/2 ".concat(n==="dark"?"bg-[#1A1714] hover:bg-[#1A1714]/90":"bg-white hover:bg-gray-100"," rounded-full p-2 shadow-lg z-10"),style:{boxShadow:"0 4px 10px rgba(0,0,0,0.2)",border:"1px solid rgba(0,0,0,0.1)",width:"36px",height:"36px",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(De,{className:"h-5 w-5 ".concat(n==="dark"?"text-gray-400":"text-gray-600")})})]}),e.jsx("div",{className:"overflow-x-hidden w-full",style:{paddingTop:"0px",paddingBottom:"0px"},children:e.jsx("div",{ref:T,className:"flex gap-4 items-start",style:{width:"max-content",willChange:"transform",paddingTop:"4px",paddingBottom:"4px"},onMouseEnter:()=>N(!0),onMouseLeave:()=>N(!1),children:w.length===0?e.jsx("div",{className:"flex items-center justify-center h-40 text-gray-500 dark:text-gray-400 w-full",children:c==="en"?"No high-risk trades available":"Keine High-Risk Trades verfügbar"}):[...w,...w,...w].map((k,P)=>{var F;const _="active-trade-".concat((F=k.id)!=null?F:P,"-").concat(P);return e.jsxs("div",{className:"group relative flex-shrink-0 rounded-lg overflow-hidden border hover:scale-[1.02] transition-all cursor-pointer",style:{width:"350px",background:"#1A1714",borderColor:"".concat(V,"40")},onClick:()=>b(g?"/pricing":"/active-trades"),children:[g&&e.jsxs("div",{className:"absolute inset-0 z-30",children:[e.jsx("div",{className:"absolute inset-0 backdrop-blur-sm bg-black/30"}),e.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-3",children:[e.jsx("img",{src:Qt(k.coin_symbol||""),alt:k.coin_symbol||"asset",className:"w-16 h-16 drop-shadow-lg",onError:D=>{D.target.style.display="none"}}),e.jsxs("div",{className:"flex items-center gap-2 px-5 py-2 rounded-full shadow-lg",style:{background:"linear-gradient(135deg, ".concat(xe,", ").concat(V,")")},children:[e.jsx(gt,{className:"w-4 h-4 text-white"}),e.jsx("span",{className:"text-white text-sm font-bold tracking-wider",children:"PRO"})]})]})]}),e.jsxs("div",{className:"relative w-full bg-[#0A0A0A] ".concat(g?"blur-[6px]":""),style:{height:"195px"},children:[g?e.jsx("div",{className:"w-full h-full bg-gradient-to-br from-[#1A1714] to-[#0A0A0A]"}):k.trading_idea_url?e.jsx("img",{src:k.trading_idea_url,alt:"".concat(k.coin_symbol," chart"),className:"w-full h-full object-cover block",loading:"lazy",decoding:"async",onError:D=>{D.target.src="https://placehold.co/600x400?text=No+Preview"}}):e.jsx("div",{className:"w-full h-full bg-gradient-to-br from-[#1A1714] to-[#0A0A0A]"}),!g&&e.jsx("div",{className:"absolute top-0 left-0 right-0 z-10 bg-gradient-to-b from-black/90 via-black/55 to-transparent pb-6 pt-2.5 px-3",children:e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("img",{src:Qt(k.coin_symbol||""),alt:k.coin_symbol||"asset",className:"w-6 h-6 flex-shrink-0",onError:D=>{D.target.style.display="none"}}),e.jsx("span",{className:"font-bold text-base text-white",children:k.coin_symbol}),k.entry_type&&e.jsx("span",{className:"text-xs font-bold px-2 py-0.5 rounded ".concat(k.entry_type==="LONG"?"bg-green-500/25 text-green-400":"bg-red-500/25 text-red-400"),children:k.entry_type}),k.created_at&&e.jsx("span",{className:"text-xs bg-white/10 text-gray-200 px-2 py-0.5 rounded whitespace-nowrap",children:new Date(k.created_at).toLocaleDateString(c==="de"?"de-DE":"en-US",{day:"numeric",month:"short"})})]})}),!g&&e.jsx("div",{className:"absolute bottom-2 right-2 z-10",children:e.jsx(pr,{symbol:k.coin_symbol||"",entryPrice:k.entry_price,entryType:k.entry_type,tradeStrategy:k.trade_strategy,currentPrice:o.get(k.coin_symbol||""),alreadyTriggered:k.is_triggered,size:"medium"})}),!g&&wa(k.created_at)&&e.jsxs("div",{className:"absolute bottom-3 left-3 z-20 flex items-center gap-1 text-white px-2 py-1 rounded-full text-xs font-bold shadow-lg",style:{background:"linear-gradient(135deg, ".concat(V,", ").concat(xe,")")},children:[e.jsx(br,{className:"w-3 h-3"}),c==="en"?"NEW":"NEU"]})]})]},_)})})})]})]})})},_a={crypto:"coin_levels",stock:"stock_levels",commodity:"commodity_levels"},Ca={crypto:"coin_symbol",stock:"stock_symbol",commodity:"commodity_symbol"},Sa={crypto:"/coin",stock:"/stock",commodity:"/commodity"},Ia={SPX:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/images/34.svg",
7NDX:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/images/35.svg",COIN:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/coins/Coin_Icons/coinbase.png",META:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/coins/Coin_Icons/meta.jpg",HOOD:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/coins/Coin_Icons/robinhood.png",AMZN:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/images/amzn.png",ARM:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/images/arm.png",GOOGL:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/images/googl.webp",INTC:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/images/intel.jpg",MSFT:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/images/msft.png",TSLA:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/images/tsla.png",APP:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/images/APP_LOVIN.png",XOM:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/coins/Coin_Icons/XOM.png",BE:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/coins/Coin_Icons/BE.png"},Ea=n=>Ia[n]||"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/coins/Coin_Icons/".concat(n,".png"),Dt=({assetType:n="crypto"})=>{const{language:c}=Ze(),o=Ge(),g=Qe(),{priceMap:b,loading:w}=nr(),{priceMap:R,loading:G}=$t(),u=n==="crypto"?b:R,U=n==="crypto"?w:G,[N,C]=s.useState([]),[T,Y]=s.useState([]),[W,L]=s.useState(null),M=_a[n],S=Ca[n],me=Sa[n];s.useEffect(()=>{let _=!1;const F=async()=>{const{data:j,error:I}=await v.from(M).select("*");_||!I&&j&&L(j.map(q=>({id:q.id,symbol:q[S],buy_level:q.buy_level,buy_status:q.buy_status,sell_level:q.sell_level,sell_status:q.sell_status})))};F();const D=setInterval(F,6e4);return()=>{_=!0,clearInterval(D)}},[M,S]),s.useEffect(()=>{if(U||u.size===0||!W)return;const _=W,F=[],D=[];_.forEach(j=>{const I=u.get(j.symbol);if(I){if(j.buy_level&&(!j.buy_status||j.buy_status.trim()==="")){const q=parseFloat(j.buy_level.replace(/[^0-9.]/g,""));!isNaN(q)&&I>q&&F.push({symbol:j.symbol,distance:(I-q)/I*100,targetPrice:q,currentPrice:I,type:"buy"})}if(j.sell_level&&(!j.sell_status||j.sell_status.trim()==="")){const q=parseFloat(j.sell_level.replace(/[^0-9.]/g,""));!isNaN(q)&&I<q&&D.push({symbol:j.symbol,distance:(q-I)/I*100,targetPrice:q,currentPrice:I,type:"sell"})}}}),F.sort((j,I)=>j.distance-I.distance),D.sort((j,I)=>j.distance-I.distance),C(F.slice(0,4)),Y(D.slice(0,4))},[u,U,W]);const be=_=>_<1?_.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:6}):_<100?_.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:4}):_.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2}),xe=_=>{o("".concat(me,"/").concat(_))},V={crypto:{de:"Krypto",en:"Crypto"},stock:{de:"Aktien",en:"Stocks"},commodity:{de:"Rohstoffe",en:"Commodities"}},k=c==="de"?V[n].de:V[n].en,P=(_,F)=>{const D=F==="buy"?"text-emerald-400":"text-red-400",j=F==="buy"?c==="de"?"Keine nahe am Kauflevel":"None close to buy level":c==="de"?"Keine nahe am Verkaufslevel":"None close to sell level";return _.length===0?e.jsx("p",{className:"text-[11px] text-gray-500 px-1",children:j}):e.jsx("div",{className:"space-y-0.5",children:_.map((I,q)=>e.jsx("button",{onClick:()=>xe(I.symbol),className:"w-full px-1.5 py-1 rounded-md transition-colors hover:bg-white/5 text-left",children:e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[e.jsx("img",{src:Ea(I.symbol),alt:I.symbol,className:"w-4 h-4 rounded-full flex-shrink-0 object-cover",onError:oe=>{oe.target.src="https://placehold.co/16x16?text="+I.symbol.charAt(0)}}),e.jsx("span",{className:"font-bold text-[11px] text-white truncate",children:I.symbol})]}),e.jsxs("div",{className:"text-right flex-shrink-0",children:[e.jsxs("div",{className:"".concat(D," font-bold text-[11px] leading-none"),children:[I.distance.toFixed(2),"%"]}),e.jsxs("div",{className:"text-[9px] text-gray-500 leading-none mt-0.5",children:["$",be(I.targetPrice)]})]})]})},"".concat(F,"-").concat(I.symbol,"-").concat(q)))})};return e.jsx("div",{className:"cm-card-flat w-full h-full",children:e.jsxs("div",{className:"cm-card-flat-inner p-3 relative",children:[e.jsx("div",{className:"flex items-center gap-2 mb-2",children:e.jsx("h3",{className:"text-sm font-semibold text-white",children:k})}),e.jsxs("div",{className:"relative ".concat(g?"cursor-pointer":""),onClick:g?()=>o("/pricing"):void 0,children:[g&&e.jsx("div",{className:"absolute inset-0 z-10"}),e.jsx("div",{className:g?"blur-sm select-none pointer-events-none":"",children:e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1 mb-1.5",children:[e.jsx("div",{className:"h-4 w-4 roun
7ded flex items-center justify-center",style:{background:"rgba(16,185,129,0.15)"},children:e.jsx(or,{className:"h-2.5 w-2.5 text-emerald-400"})}),e.jsx("span",{className:"text-[10px] font-semibold text-gray-300 uppercase tracking-wider",children:c==="de"?"Kauflevel":"Buy Level"})]}),P(N,"buy")]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1 mb-1.5",children:[e.jsx("div",{className:"h-4 w-4 rounded flex items-center justify-center",style:{background:"rgba(239,68,68,0.15)"},children:e.jsx(wt,{className:"h-2.5 w-2.5 text-red-400"})}),e.jsx("span",{className:"text-[10px] font-semibold text-gray-300 uppercase tracking-wider",children:c==="de"?"Verkaufslevel":"Sell Level"})]}),P(T,"sell")]})]})})]})]})})};function er(){const n=Ge(),{user:c,hasActivePlan:o}=yt(),{language:g}=Ze(),{theme:b}=ft(),[w,R]=s.useState(null),[G,u]=s.useState(""),[U,N]=s.useState(!0),[C,T]=s.useState(!1),[Y,W]=s.useState(!1);s.useEffect(()=>{L(),new URLSearchParams(window.location.search).get("purchase")==="success"&&setTimeout(()=>{L()},2e3)},[c]),s.useEffect(()=>{if(!w)return;const V=setInterval(()=>{const k=new Date().getTime(),_=new Date(w.start_time).getTime()-k;if(_<0)u(g==="de"?"Läuft gerade":"Happening now"),clearInterval(V);else{const F=Math.floor(_/864e5),D=Math.floor(_%(1e3*60*60*24)/(1e3*60*60)),j=Math.floor(_%(1e3*60*60)/(1e3*60));F>0?u("".concat(F,"d ").concat(D,"h ").concat(j,"m")):D>0?u("".concat(D,"h ").concat(j,"m")):u("".concat(j,"m"))}},1e3);return()=>clearInterval(V)},[w,g]);const L=async()=>{try{const{data:V,error:k}=await v.rpc("get_upcoming_events").limit(1).single();if(k){console.error("Error fetching events:",k),N(!1);return}if(!V){N(!1);return}if(R(V),c){const{data:P}=await v.from("event_tickets").select("id").eq("event_id",V.id).eq("user_id",c.id).eq("status","confirmed").single();W(!!P)}}catch(V){console.error("Error fetching event:",V)}finally{N(!1)}},M=async()=>{if(!c){n("/pricing");return}if(w){T(!0);try{const{data:V,error:k}=await v.functions.invoke("create-event-checkout",{body:{eventId:w.id,userId:c.id}});k?(console.error("Function error:",k),alert(g==="de"?"Fehler beim Erstellen der Checkout-Session":"Error creating checkout session")):V&&V.url?window.open(V.url,"_blank"):(console.error("No checkout URL received"),alert(g==="de"?"Fehler beim Erstellen der Checkout-Session":"Error creating checkout session"))}catch(V){console.error("Checkout error:",V),alert(g==="de"?"Fehler beim Checkout":"Error during checkout")}finally{T(!1)}}};if(U)return e.jsx("div",{className:"h-full flex items-center justify-center",children:e.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-t-2 border-b-2 border-[#C9A96E]"})});if(!w)return e.jsx("div",{className:"h-full relative",children:e.jsxs("div",{className:"h-full relative overflow-hidden rounded-lg border-2 border-dashed",style:{background:b==="dark"?"linear-gradient(135deg, #1a1510 0%, #252015 25%, rgba(153,125,65,0.4) 50%, #252015 75%, #1a1510 100%)":"linear-gradient(135deg, #fffbeb 0%, #fef3c7 25%, #fde68a 50%, #fef3c7 75%, #fffbeb 100%)",boxShadow:b==="dark"?"0 20px 40px rgba(0,0,0,0.3), inset 0 0 40px rgba(255,255,255,0.05)":"0 4px 14px rgba(251,191,36,0.15), inset 0 1px 0 rgba(255,255,255,0.8)",borderColor:b==="dark"?"rgba(201,168,76,0.5)":"rgba(251,191,36,0.5)"},children:[e.jsx("div",{className:"absolute inset-0 opacity-30",style:{background:"linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.5) 50%, transparent 70%)",animation:"shimmer 6s infinite"}}),e.jsxs("div",{className:"relative h-full flex flex-col items-center justify-center text-center px-6",children:[e.jsx(Rr,{className:"w-16 h-16 text-white dark:text-amber-200 mb-4 opacity-80",strokeWidth:1.5}),e.jsx("h3",{className:"text-lg font-bold text-gray-900 dark:text-white",children:"Events coming soon"})]})]})});const S=o?49:99,me=w.max_attendees?w.max_attendees-w.tickets_sold:null,be=me!==null&&me<=0,xe=()=>{n("/profile/".concat(w.host_handle))};return e.jsx("div",{className:"h-full relative",children:e.jsxs("div",{className:"h-full relative overflow-hidden rounded-lg border-2 border-dashed",style:{background:b==="dark"?"linear-gradient(135deg, #1a1510 0%, #252015 25%, rgba(153,125,65,0.4) 50%, #252015 75%, #1a1510 100%)":"linear-gradient(135deg, #fffbeb 0%, #fef3c7 25%, #fde68a 50%, #fef3c7 75%, #fffbeb 100%)",boxShadow:b==="dark"?"0 20px 40px rgba(0,0,0,0.3), inset 0 0 40px rgba(255,255,255,0.05)":"0 4px 14px rgba(251,191,36,0.15), inset 0 1px 0 rgba(255,255,255,0.8)",borderColor:b==="dark"?"rgba(201,168,76,0.5)":"rgba(251,191,36,0.5)"},children:[e.jsx("div",{className:"absolute inset-0 opacity-30",style:{background:"linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.5) 50%, transparent 70%)",animation:"shimmer 6s infinite"}}),e.jsxs("div",{className:"relative h-full px-6 py-3 flex items-center",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsxs("div",{className:"font-sans text-xs font-bold text-white uppercase tracking-wider",children:["🎫 ","TRADING SEMINAR"]}),e.jsxs("button",{onClick:()=>n("/events"),className:"text-sm text-white hover:text-gray-200 flex items-center gap-1",children:[g==="de"?"Alle Events":"All Events"," ",e.jsx(De,{className:"h-4 w-4 ml-1"})]})]}),e.jsx("h3",{onClick:()=>n("/events"),className:"font-sans text-lg font-bold text-gray-900 dark:text-white uppercase tracking-tight mb-2 leading-tight cursor-pointer hover:text-[#C9A96E] transition-colors",children:w.title}),e.jsxs("div",{className:"flex gap-6 text-sm items-start",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"text-xs font-bold text-slate-600 dar
7k:text-slate-400 uppercase",children:"HOST"}),e.jsxs("div",{className:"flex items-center gap-2 cursor-pointer hover:opacity-80 transition-opacity h-8",onClick:xe,children:[w.host_avatar&&e.jsx("img",{src:w.host_avatar,alt:w.host_name,className:"w-8 h-8 rounded-full border-2 border-slate-300 dark:border-slate-600 hover:border-amber-400 dark:hover:border-amber-400 transition-colors"}),e.jsx("div",{className:"font-bold text-gray-900 dark:text-white hover:text-amber-500 dark:hover:text-amber-400 transition-colors",children:w.host_name})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"text-xs font-bold text-slate-600 dark:text-slate-400 uppercase",children:"DATE"}),e.jsx("div",{className:"flex items-center h-8 font-bold text-gray-900 dark:text-white",children:new Date(w.start_time).toLocaleDateString(g==="de"?"de-DE":"en-US",{day:"2-digit",month:"short",year:"numeric"})})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"text-xs font-bold text-slate-600 dark:text-slate-400 uppercase",children:"TIME"}),e.jsx("div",{className:"flex items-center h-8 font-bold text-gray-900 dark:text-white",children:new Date(w.start_time).toLocaleTimeString(g==="de"?"de-DE":"en-US",{hour:"2-digit",minute:"2-digit"})})]})]})]}),e.jsx("div",{className:"relative h-full mx-3 w-px",style:{backgroundImage:"repeating-linear-gradient(to bottom, transparent, transparent 4px, rgba(255,255,255,0.5) 4px, rgba(255,255,255,0.5) 8px)"}}),e.jsx("div",{className:"text-center min-w-[100px]",children:Y?e.jsxs("div",{className:"w-full text-center py-2.5 px-2 bg-gradient-to-r from-green-500 to-emerald-600 text-white rounded-lg font-bold text-sm shadow-lg",children:[e.jsx("div",{className:"flex justify-center mb-1",children:e.jsx("div",{className:"w-8 h-8 rounded-full bg-white flex items-center justify-center",children:e.jsx("span",{className:"text-green-600 text-xl font-bold",children:"✓"})})}),e.jsx("div",{children:g==="de"?"Du bist dabei!":"You're in!"})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mb-2",children:e.jsxs("div",{className:"text-2xl font-black text-gray-900 dark:text-white",children:["€",S]})}),be?e.jsx("div",{className:"bg-red-600 text-white px-2 py-1.5 rounded text-xs font-bold uppercase",children:"SOLD OUT"}):e.jsxs("button",{onClick:M,disabled:C,className:"relative w-full overflow-hidden px-3 py-2 rounded font-black text-sm uppercase shadow-lg hover:shadow-xl transition-all duration-300 disabled:opacity-50 group",style:{background:"linear-gradient(135deg, #10b981, #059669, #047857)",color:"white",border:"2px solid #34d399",transform:C?"scale(0.95)":"scale(1)"},children:[e.jsx("div",{className:"absolute inset-0 opacity-0 group-hover:opacity-100 transition-opacity duration-300",style:{background:"linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.4) 50%, transparent 70%)",animation:"shimmer 1.5s infinite"}}),e.jsx("span",{className:"relative z-10 drop-shadow-lg",children:C?"...":g==="de"?"KAUFEN":"BUY"}),e.jsx("div",{className:"absolute inset-0 rounded animate-ping opacity-20",style:{background:"linear-gradient(135deg, #10b981, #059669, #047857)"}})]})]})})]})]})})}const Aa=[{id:"frankfurt",name:"Xetra",city:"Frankfurt",tz:"Europe/Berlin",tzAbbrev:"CET",sessions:[{openMin:540,closeMin:1050}]},{id:"newyork",name:"NYSE",city:"New York",tz:"America/New_York",tzAbbrev:"ET",sessions:[{openMin:570,closeMin:960}]},{id:"tokyo",name:"JPX",city:"Tokyo",tz:"Asia/Tokyo",tzAbbrev:"JST",sessions:[{openMin:540,closeMin:690},{openMin:750,closeMin:900}]}];function Ta(n,c){var G;const g=new Intl.DateTimeFormat("en-US",{timeZone:c,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1,weekday:"short"}).formatToParts(n),b=u=>{var U,N;return(N=(U=g.find(C=>C.type===u))==null?void 0:U.value)!=null?N:"0"},w={Sun:0,Mon:1,Tue:2,Wed:3,Thu:4,Fri:5,Sat:6};let R=parseInt(b("hour"),10);return R===24&&(R=0),{year:parseInt(b("year"),10),month:parseInt(b("month"),10),day:parseInt(b("day"),10),hour:R,minute:parseInt(b("minute"),10),second:parseInt(b("second"),10),weekday:(G=w[b("weekday")])!=null?G:0}}function za(n,c){const o=n.hour*60+n.minute+n.second/60;if(n.weekday>=1&&n.weekday<=5){for(const w of c.sessions)if(o>=w.openMin&&o<w.closeMin){const R=w.closeMin-o;return{isOpen:!0,label:"OPEN",sublabel:"Closes in ".concat(tr(R)),nextChangeMinutes:R}}}const b=La(n,c);return{isOpen:!1,label:"CLOSED",sublabel:"Opens in ".concat(tr(b)),nextChangeMinutes:b}}function La(n,c){const o=n.hour*60+n.minute+n.second/60;for(let g=0;g<8;g++){const b=(n.weekday+g)%7;if(b>=1&&b<=5)for(const R of c.sessions){const G=g*1440+R.openMin;if(G>o)return G-o}}return 0}function tr(n){if(n<1)return"< 1m";const c=Math.floor(n),o=Math.floor(c/1440),g=Math.floor(c%1440/60),b=c%60;return o>0?"".concat(o,"d ").concat(g,"h"):g>0?"".concat(g,"h ").concat(b,"m"):"".concat(b,"m")}function Pa({exchange:n,now:c}){const o=Ta(c,n.tz),g=za(o,n),b=o.second/60*360,w=(o.minute+o.second/60)/60*360,R=(o.hour%12+o.minute/60)/12*360,G=96,u=G/2,U=43,N=40,C=g.isOpen,T="face-".concat(n.id),Y="glow-".concat(n.id),W="".concat(String(o.hour).padStart(2,"0"),":").concat(String(o.minute).padStart(2,"0")),L=C?"#C9A96E":"#2A2520",M=C?2:1,S=C?"#C9A96E":"#3D3530",me=C?"#F5F0E8":"#6B6560",be=C?"#F5F0E8":"#6B6560",xe=C?"#C9A96E":"#3D3530";return e.jsxs("div",{className:"flex flex-col items-center gap-1",children:[e.jsx("div",{className:"relative",children:e.jsxs("svg",{width:G,height:G,viewBox:"0 0 ".concat(G," ").concat(G),className:"transition-all duration-500",style:{filter:C?"drop-shadow(0 0 12px rgba(201, 169, 110, 0.35))":"none"},children:[e.jsxs("defs",{children:[e.jsx("radialGradient",{id:T,cx:"50%",cy:"50%",r:"50%",children:C?e.jsxs(e.Fragment,{children:[e.jsx("stop",{offset:"0%",stopColor:"#1A1714"}),e.jsx("stop",{offset:"70%",stopColor:"#111111"}),e.jsx("stop",{offset:"100%",stopColor:"#0A0A0A"})]}):e.jsxs(e.Fragment,{children:[e.jsx("stop",{offset:"0%",stopColor:"#111111"}),e.jsx("stop",{offset:"100%",stopColor:"#0A0A0A"})]})}),e.jsxs("filter",{id:Y,x:"-50%",y:"-50%",width:"200%",height:"200%",children:[e.jsx("feGaussianBlur",{stdDeviation:"2",result:"blur"}),e.jsxs("feMerge",{children:[e.jsx("feMergeNode",{in:"blur"}),e.jsx("feMergeNode",{in:"SourceGraphic"})]})]})]}),e.jsx("circle",{cx:u,cy:u,r:U,fill:"url(#".concat(T,")"),stroke:L,strokeWidth:M}),n.sessions.map((V,k)=>{const P=V.openMin%720/720*360-90,_=V.closeMin%720/720*360-90;return e.jsx("path",{d:Da(u,u,N,P,_),fill:"none",stroke:C?"#C9A96E":"#3D3530",strokeWidth:C?3:2,strokeLinecap:"round",opacity:C?.9:.45},k)}),Array.from({length:12}).map((V,k)=>{const P=(k*30-90)*(Math.PI/180),_=k%3===0,F=_?U-6:U-4,D=U-1.5,j=u+Math.cos(P)*F,I=u+Math.sin(P)*F,q=u+Math.cos(P)*D,oe=u+Math.sin(P)*D;return e.jsx("line",{x1:j,y1:I,x2:q,y2:oe,stroke:S,strokeWidth:_?1.6:.9,strokeLinecap:"round",opacity:_?1:.55},k)}
7),e.jsx("line",{x1:u,y1:u,x2:u,y2:u-20,stroke:me,strokeWidth:2.6,strokeLinecap:"round",transform:"rotate(".concat(R," ").concat(u," ").concat(u,")"),style:{transition:"transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1)"}}),e.jsx("line",{x1:u,y1:u,x2:u,y2:u-28,stroke:be,strokeWidth:1.8,strokeLinecap:"round",transform:"rotate(".concat(w," ").concat(u," ").concat(u,")"),style:{transition:"transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1)"}}),e.jsx("line",{x1:u,y1:u+5,x2:u,y2:u-33,stroke:xe,strokeWidth:.9,strokeLinecap:"round",transform:"rotate(".concat(b," ").concat(u," ").concat(u,")")}),e.jsx("circle",{cx:u,cy:u,r:2.2,fill:C?"#C9A96E":"#6B6560"}),e.jsx("circle",{cx:u,cy:u,r:.8,fill:"#0A0A0A"})]})}),e.jsxs("div",{className:"flex flex-col items-center leading-none",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-1 h-1 rounded-full ".concat(C?"bg-[#22C55E] animate-pulse":"bg-[#EF4444]")}),e.jsx("span",{className:"text-[10px] font-bold tracking-wide ".concat(C?"text-[#F5F0E8]":"text-[#9C9585]"),children:n.city}),e.jsx("span",{className:"text-[9px] font-mono text-[#6B6560] tabular-nums",children:W})]}),e.jsx("div",{className:"text-[9px] font-medium tabular-nums mt-0.5 ".concat(C?"text-[#C9A96E]":"text-[#6B6560]"),children:g.sublabel})]})]})}function rr(n,c,o,g){const b=g*Math.PI/180;return{x:n+o*Math.cos(b),y:c+o*Math.sin(b)}}function Da(n,c,o,g,b){const w=rr(n,c,o,g),R=rr(n,c,o,b),u=b-g<=180?0:1;return"M ".concat(w.x," ").concat(w.y," A ").concat(o," ").concat(o," 0 ").concat(u," 1 ").concat(R.x," ").concat(R.y)}function Ma(){const[n,c]=s.useState(()=>new Date);s.useEffect(()=>{const g=setInterval(()=>c(new Date),1e3);return()=>clearInterval(g)},[]);const o=s.useMemo(()=>Aa,[]);return e.jsx("div",{className:"hidden xl:flex items-start gap-8",children:o.map(g=>e.jsx(Pa,{exchange:g,now:n},g.id))})}const Oa=Xe(()=>He(()=>import("./MarketOverview-BL0wdQNm.js"),__vite__mapDeps([0]))),ar=Xe(()=>He(()=>import("./Community-Y6SQAefx.js"),__vite__mapDeps([0]))),sr=Xe(()=>He(()=>import("./Tools-BIvMWQLv.js"),__vite__mapDeps([0]))),$a=Xe(()=>He(()=>import("./News-DNJERp-g.js"),__vite__mapDeps([0]))),qa=Xe(()=>He(()=>import("./Education-BuObb2hW.js"),__vite__mapDeps([0]))),Fa=Xe(()=>He(()=>import("./Timeframes-DBuI09oa.js"),__vite__mapDeps([0]))),Ba=Xe(()=>He(()=>import("./Compounding-D94Co0A1.js"),__vite__mapDeps([0]))),Ra=Xe(()=>He(()=>import("./ETF-DgUejf1x.js"),__vite__mapDeps([0]))),Ua=Xe(()=>He(()=>import("./Spot-zipqkAKa.js"),__vite__mapDeps([0]))),Zs=()=>{var Ne;const[n,c]=s.useState(null),[o,g]=s.useState(null),[b,w]=s.useState(null),[R,G]=jr();s.useEffect(()=>{wr("dashboard"),(async()=>{var te;const{data:de,error:f}=await v.auth.getUser();if(de!=null&&de.user){c(de.user),g(((te=de.user.user_metadata)==null?void 0:te.plan)||null);const{data:je}=await v.from("profiles").select("username, handle, profile_picture_url").eq("id",de.user.id).single();je&&w(je)}})()},[]);const[u,U]=s.useState(!0),[N]=s.useState("trader"),[C,T]=s.useState(null),Y=C,W=Ge(),{language:L,t:M}=Ze(),{theme:S}=ft(),[me,be]=s.useState(!1),{isEmailVerified:xe,isAdmin:V}=yt(),k=Qe(),[P,_]=s.useState(""),[F,D]=s.useState(!1),[j,I]=s.useState("trading"),[q,oe]=s.useState(!0),[ue,h]=s.useState(!1),[O,Q]=s.useState("news"),[K,m]=s.useState("live"),[J,he]=s.useState(!1),[le,fe]=s.useState([]),[ae,re]=s.useState(0);s.useEffect(()=>{let X=!1;return(async()=>{const{data:de}=await v.from("daily_reports").select("id, banner_image_url, banner_title, report_date").order("report_date",{ascending:!1}).limit(10);X||de&&fe(de.filter(f=>f.banner_image_url).slice(0,3).map(f=>{var te,je;return{id:f.id,banner_image_url:f.banner_image_url,banner_title:(te=f.banner_title)!=null?te:null,report_date:(je=f.report_date)!=null?je:null}}))})(),()=>{X=!0}},[]);const B="190cb1f3-52b2-43e0-9b5c-d956c2483644";s.useEffect(()=>{const X=R.get("newsId");R.get("tab")==="news"&&I("news"),X&&(I("news"),setTimeout(()=>{window.dispatchEvent(new CustomEvent("openNewsById",{detail:X})),G({})},500))},[R,G]),s.useEffect(()=>{const X=R.get("view");if(X==="investor"||X==="trader"){localStorage.setItem("dashboardView",X);return}localStorage.getItem("dashboardView")},[]),s.useEffect(()=>{const X=R.get("view");(X==="investor"||X==="trader")&&localStorage.setItem("dashboardView",X)},[R]);const _e=async()=>
7{if(V){h(!0);try{const X=!q,{error:de}=await v.rpc("update_spot_notification_setting",{key:"spot_level_notifications_enabled",value:X});if(de){console.error("Error updating notification setting:",de),alert("Failed to update notification settings");return}oe(X)}catch(X){console.error("Error in handleToggleSpotNotifications:",X),alert("Failed to update notification settings")}finally{h(!1)}}};s.useEffect(()=>{o&&(o.startsWith("spot")?localStorage.setItem("dashboardView","investor"):localStorage.setItem("dashboardView","trader"))},[o]),s.useEffect(()=>{(async()=>{try{const{data:f,error:te}=await v.from("Volatility").select("*").order("timestamp",{ascending:!1}).limit(1);te?console.error("Supabase fetch error:",te):f&&f.length>0&&T(f[0])}catch(f){console.error("Unexpected fetchVolatility error:",f)}finally{U(!1)}})();const de=v.channel("volatility_changes").on("postgres_changes",{event:"*",schema:"public",table:"Volatility"},f=>{const te=f.new;T(te)}).subscribe();return()=>{de.unsubscribe()}},[]),s.useEffect(()=>{const X=(n==null?void 0:n.id)===B;n&&!V&&!X&&(!o||o==="none"||o==="unpaid")&&W("/payment-required")},[n,o,V,W]),s.useEffect(()=>{if(!V)return;(async()=>{try{const{data:de,error:f}=await v.from("spot_notification_settings").select("setting_value").eq("setting_key","spot_level_notifications_enabled").single();if(f){console.error("Error fetching notification setting:",f);return}de&&oe(de.setting_value)}catch(de){console.error("Error in fetchNotificationSetting:",de)}})()},[V]);const ie=(X,de)=>{const f=de==="dark",te=X.toLowerCase();return te.includes("extreme")?{containerClasses:"border",containerStyle:f?{background:"linear-gradient(90deg, rgba(239,68,68,0.28), rgba(245,158,11,0.22), rgba(239,68,68,0.28))",borderColor:"rgba(239,68,68,0.55)"}:void 0,iconBg:"from-red-500/30 to-amber-500/30",iconColor:f?"text-red-400":"text-red-700",titleColor:f?"text-red-400":"text-red-700 font-semibold",textColor:f?"text-red-300/90":"text-red-700 font-semibold",timeColor:f?"text-red-400/60":"text-red-700/70 font-semibold",icon:Pt}:te.includes("low")?{containerClasses:"border",containerStyle:f?{background:"linear-gradient(90deg, rgba(34,211,238,0.28), rgba(59,130,246,0.22), rgba(34,211,238,0.28))",borderColor:"rgba(34,211,238,0.55)"}:void 0,iconBg:"from-cyan-500/30 to-blue-500/30",iconColor:f?"text-cyan-400":"text-cyan-700",titleColor:f?"text-cyan-400":"text-cyan-700 font-semibold",textColor:f?"text-cyan-300/90":"text-cyan-700 font-semibold",timeColor:f?"text-cyan-400/60":"text-cyan-700/70 font-semibold",icon:Vt}:te.includes("heavy")?{containerClasses:"border",containerStyle:f?{background:"linear-gradient(90deg, rgba(250,204,21,0.28), rgba(251,146,60,0.22), rgba(250,204,21,0.28))",borderColor:"rgba(250,204,21,0.55)"}:void 0,iconBg:"from-yellow-400/30 to-orange-400/30",iconColor:f?"text-yellow-500":"text-yellow-700",titleColor:f?"text-yellow-500":"text-yellow-700 font-semibold",textColor:f?"text-yellow-400/90":"text-yellow-700 font-semibold",timeColor:f?"text-yellow-400/60":"text-yellow-700/70 font-semibold",icon:Pt}:te.includes("squeeze")?{containerClasses:"border",containerStyle:f?{background:"linear-gradient(90deg, rgba(249,115,22,0.28), rgba(245,158,11,0.22), rgba(249,115,22,0.28))",borderColor:"rgba(249,115,22,0.55)"}:void 0,iconBg:"from-orange-500/30 to-amber-500/30",iconColor:f?"text-orange-400":"text-orange-700",titleColor:f?"text-orange-400":"text-orange-700 font-semibold",textColor:f?"text-orange-300/90":"text-orange-700 font-semibold",timeColor:f?"text-orange-400/60":"text-orange-700/70 font-semibold",icon:Pt}:{containerClasses:"border",containerStyle:f?{background:"linear-gradient(90deg, rgba(107,114,128,0.22), rgba(156,163,175,0.18), rgba(107,114,128,0.22))",borderColor:"rgba(107,114,128,0.50)"}:void 0,iconBg:"from-gray-400/20 to-gray-400/20",iconColor:f?"text-gray-400":"text-gray-700",titleColor:f?"text-gray-400":"text-gray-700 font-semibold",textColor:f?"text-gray-300/90":"text-gray-700 font-semibold",timeColor:f?"text-gray-400/60":"text-gray-700/70 font-semibold",icon:Vt}},[A,pe]=s.useState("crypto"),Te=s.useRef(null),ce=s.useRef(null),ee=s.useRef(null),Ce={crypto:Te,commodities:ce,stocks:ee},ve={crypto:"Neuen Coin hinzufügen",commodities:"Neuen Rohstoff hinzufügen",stocks:"Neue Aktie hinzufügen"};return xe?u?e.jsx("div",{className:"flex items-center justify-center min-h-screen bg-[#0A0A0A]",children:e.jsx("img",{src:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/images/download%20(1).gif",alt:"Loading...",className:"w-32 h-32"})}):e.jsxs(e.Fragment,{children:[e.jsx(Wr,{title:"Dashboard – CraderMind",description:L==="en"?"Your CraderMind dashboard: live market overview, trading ideas, and tools.":"Dein CraderMind-Dashboard: Marktübersicht, Trading-Ideen und Tools in 
7Echtzeit.",noindex:!0}),e.jsxs("div",{className:"min-h-screen transition-colors duration-300",children:[e.jsx("div",{className:"h-20"}),e.jsxs("div",{className:"container-responsive pb-8 relative z-10",children:[e.jsx("div",{className:"bg-[#111111] border border-[#2A2520] rounded-xl p-3 mb-4 relative min-h-[144px] w-full flex items-center overflow-hidden",children:e.jsx("div",{className:"relative z-10 w-full",children:e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[e.jsxs("div",{className:"flex items-start gap-4",children:[n&&b&&e.jsx("button",{onClick:()=>W("/profile/".concat(n.id)),className:"cursor-pointer hover:opacity-80 transition-opacity relative",children:e.jsx("div",{className:"relative",children:b.profile_picture_url?e.jsx("img",{src:b.profile_picture_url,alt:b.username||"User",className:"w-16 h-16 rounded-full border-3 border-bronze-400/30 object-cover transition-all duration-200"}):e.jsx("div",{className:"w-16 h-16 rounded-full border-3 border-bronze-400/30 bg-gradient-to-br from-[#1A1714] to-[#2A2520] flex items-center justify-center text-white font-semibold text-xl transition-all duration-200",children:(b.username||"U")[0].toUpperCase()})})}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("h1",{className:"text-2xl sm:text-4xl font-bold tracking-tight bg-gradient-to-r from-[#C9A96E] via-[#C9A96E] to-[#C9A96E] bg-clip-text text-transparent mb-2",children:"Dashboard"}),n&&b&&e.jsx("button",{onClick:()=>W("/profile/".concat(n.id)),className:"text-left cursor-pointer hover:opacity-80 transition-opacity",children:e.jsxs("h3",{className:"font-semibold text-lg ".concat(S==="dark"?"text-white":"text-gray-900"),children:[L==="de"?"Willkommen, ":"Welcome, ",b.username||"Anonymous","!"]})})]})]}),j==="trading"&&e.jsx("div",{className:"hidden xl:flex items-center pl-6",children:e.jsx(Ma,{})}),j==="trading"&&e.jsxs("div",{className:"flex items-center gap-3 sm:ml-auto",children:[le.length>0&&le[ae]&&e.jsxs("div",{className:"relative h-[120px] w-[380px] xl:w-[310px] 2xl:w-[420px] hover:scale-[1.02] transition-transform duration-300",children:[e.jsxs("button",{onClick:()=>he(!0),className:"relative h-full w-full rounded-2xl overflow-hidden border border-[#2A2520] hover:border-[#C9A96E]/40 transition-colors duration-300 cursor-pointer",children:[e.jsx("img",{src:le[ae].banner_image_url,alt:"Daily Report",className:"absolute inset-0 w-full h-full object-cover"}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/90 via-black/60 to-black/30"}),le[ae].report_date&&e.jsxs("div",{className:"absolute top-2 right-2 z-10 flex items-center gap-1.5 px-2.5 py-1 rounded-full bg-[#0A0A0A]/80 backdrop-blur-sm border border-[#C9A96E]/50",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#C9A96E] animate-pulse"}),e.jsx("span",{className:"font-sans text-xs font-bold text-white tracking-wider",children:new Date(le[ae].report_date).toLocaleDateString(L==="de"?"de-DE":"en-US",{day:"numeric",month:"short",year:"numeric"})})]}),e.jsxs("div",{className:"relative z-10 flex flex-col justify-between h-full p-3 text-left",children:[e.jsx("span",{className:"text-3xl font-bold tracking-tight text-white leading-none",children:"Daily Report"}),e.jsx("div",{children:le[ae].banner_title&&e.jsx("h4",{className:"text-sm font-bold text-white leading-tight line-clamp-1 drop-shadow",children:le[ae].banner_title})})]})]}),ae>0&&e.jsx("button",{onClick:()=>re(X=>X-1),"aria-label":"Previous report",className:"absolute left-1.5 top-1/2 -translate-y-1/2 z-20 p-1 rounded-full bg-black/60 hover:bg-black/85 border border-white/25 text-white transition-colors",children:e.jsx(vt,{className:"w-4 h-4"})}),ae<le.length-1&&e.jsx("button",{onClick:()=>re(X=>X+1),"aria-label":"Next report",className:"absolute right-1.5 top-1/2 -translate-y-1/2 z-20 p-1 rounded-full bg-black/60 hover:bg-black/85 border border-white/25 text-white transition-colors",children:e.jsx(De,{className:"w-4 h-4"})})]}),e.jsxs("button",{onClick:()=>W("/akademie"),className:"relative h-[120px] w-[380px] xl:w-[310px] 2xl:w-[420px] rounded-2xl overflow-hidden border border-[#2A2520] hover:border-[#C9A96E]/40 hover:scale-[1.02] transition-all duration-300 cursor-pointer",children:[e.jsx("img",{src:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/render/image/public/images/start.jpg?width=1284&height=360&resize=cover&qual
7ity=85",alt:L==="de"?"Starte hier – Akademie":"Start here – Academy",className:"absolute inset-0 w-full h-full object-cover"}),e.jsxs("div",{className:"absolute top-2 right-2 z-10 flex items-center gap-1.5 px-2.5 py-1 rounded-full bg-[#0A0A0A]/80 backdrop-blur-sm border border-[#C9A96E]/50",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#C9A96E] animate-pulse"}),e.jsx("span",{className:"font-sans text-xs font-bold text-white tracking-wider",children:"VIDEOS"})]})]})]}),j==="compounding"&&e.jsxs("div",{className:"flex items-center justify-center sm:justify-end gap-3",children:[e.jsxs("button",{onClick:()=>window.dispatchEvent(new CustomEvent("openCompoundingInfo")),className:"flex items-center gap-2 px-3 sm:px-4 py-1 rounded-lg transition-all duration-300 text-xs sm:text-sm bg-white/5 backdrop-blur-md border border-dashboard-light dark:border-white/10 text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white hover:bg-white/10",children:[e.jsx(Ht,{className:"w-3 h-3 sm:w-4 sm:h-4"}),e.jsx("span",{className:"hidden sm:inline",children:L==="de"?"Was ist Compounding?":"What is Compounding?"}),e.jsx("span",{className:"sm:hidden",children:"Info"})]}),e.jsxs("div",{className:"flex items-center space-x-1 sm:space-x-2 p-1 bg-white/5 backdrop-blur-md rounded-xl border border-dashboard-light dark:border-white/10",children:[e.jsx("button",{onClick:()=>{m("live"),window.dispatchEvent(new CustomEvent("compoundingViewChange",{detail:"live"}))},className:"px-3 sm:px-4 py-1 rounded-lg transition-all duration-300 text-xs sm:text-sm ".concat(K==="live"?"bg-[#C9A96E] text-[#0A0A0A] shadow-lg":"text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white hover:bg-white/5"),children:"Live Trading"}),e.jsx("button",{onClick:()=>{m("performance"),window.dispatchEvent(new CustomEvent("compoundingViewChange",{detail:"performance"}))},className:"px-3 sm:px-4 py-1 rounded-lg transition-all duration-300 text-xs sm:text-sm ".concat(K==="performance"?"bg-[#C9A96E] text-[#0A0A0A] shadow-lg":"text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white hover:bg-white/5"),children:"Performance"})]})]}),j==="news"&&e.jsx("div",{className:"flex items-center justify-center sm:justify-end",children:e.jsxs("div",{className:"flex items-center space-x-1 sm:space-x-2 p-1 bg-white/5 backdrop-blur-md rounded-xl border border-dashboard-light dark:border-white/10",children:[e.jsx("button",{onClick:()=>{Q("news"),window.dispatchEvent(new CustomEvent("newsTabChange",{detail:"news"}))},className:"px-3 sm:px-4 py-1 rounded-lg transition-all duration-300 text-xs sm:text-sm ".concat(O==="news"?"bg-[#C9A96E] text-[#0A0A0A] shadow-lg":"text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white hover:bg-white/5"),children:L==="de"?"Wichtige Nachrichten":"Important News"}),e.jsx("button",{onClick:()=>{Q("conditions"),window.dispatchEvent(new CustomEvent("newsTabChange",{detail:"conditions"}))},className:"px-3 sm:px-4 py-1 rounded-lg transition-all duration-300 text-xs sm:text-sm ".concat(O==="conditions"?"bg-[#C9A96E] text-[#0A0A0A] shadow-lg":"text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white hover:bg-white/5"),children:L==="de"?"Externe Bedingungen":"External Conditions"})]})})]})})}),e.jsx("div",{className:"cm-card-flat mb-4",children:e.jsx("div",{className:"cm-card-flat-inner px-6 sm:px-10",children:e.jsxs("nav",{className:"flex justify-between gap-2 sm:gap-4 lg:gap-6 overflow-x-auto scrollbar-hide","aria-label":"Tabs",children:[e.jsx("button",{onClick:()=>I("trading"),className:"\n                      py-3 sm:py-4 px-2 sm:px-1 border-b-2 font-medium text-sm sm:text-responsive-base transition whitespace-nowrap flex-shrink-0\n                      ".concat(j==="trading"?"border-[#C9A96E] text-[#C9A96E]":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 dark:text-gray-200 dark:hover:text-white","\n                    "),children:e.jsxs("div",{className:"flex items-center space-x-1 sm:space-x-2",children:[e.jsx(Gr,{className:"w-3 h-3 sm:w-4 sm:h-4"}),e.jsx("span",{className:"hidden sm:inline",children:N==="investor"?"Investing":"Trading"}),e.jsx("span",{className:"sm:hidden",children:N==="investor"?"Invest":"Trade"})]})}),e.jsx("button",{onClick:()=>I("spot"),className:"\n                      py-3 sm:py-4 px-2 sm:px-1 border-b-2 font-medium text-sm sm:text-responsive-base transition whitespace-nowrap flex-shrink-0\n                      ".concat(j==="spot"?"border-[#C9A96E] text-[#C9A96E]":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 dark:text-gray-200 dark:hover:text-white","\n                    "),children:e.jsxs("div",{className:"flex items-center space-x-1 sm:space-x-2",children:[e.jsx(ir,{className:"w-3 h-3 sm:w-4 sm:h-4"}),e.jsx("span",{children:"Spot"})]})}),N==="trader"&&e.jsx("button",{onClick:()=>I("compounding"),className:"\n                        py-3 sm:py-4 px-2 sm:px-1 border-b-2 font-medium text-sm sm:text-responsive-base transition whitespace-nowrap flex-shrink-0\n                        ".concat(j==="compounding"?"border-[#C9A96E] text-[#C9A96E]":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 dark:text-gray-200 dark:hover:text-white","\n                      "),children:e.jsxs("div",{className:"flex items-center space-x-1 sm:space-x-2",children:[e.jsx(Hr,{className:"w-3 h-3 sm:w-4 sm:h-4"}),e.jsx("span",{className:"hidden sm:inline",children:"Compounding"}),e.jsx("span",{className:"sm:hidden",children:"Compound"})]})}),e.jsx("button",{onClick:()=>I("market-overview"),className:"\n                      py-3 sm:py-4 px-2 sm:px-1 border-b-2 font-medium text-sm sm:text-responsive-base transition whitespace-nowrap flex-shrink-0\n                      ".concat(j==="market-overview"?"border-[#C9A96E] text-[#C9A96E]":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 dark:text-gray-200 dark:hover:text-white","\n                    "),children:e.jsxs("div",{className:"flex items-center space-x-1 sm:space-x-2",children:[e.jsx(Ht,{className:"w-3 h-3 sm:w-4 sm:h-4"}),e.jsx("span",{className:"hidden sm:inline",children:L==="de"?"Marktüberblick":"Market Overview"}),e.jsx("span",{className:"sm:hidden",children:L==="de"?"Markt":"Market"})]})}),e.jsx("button",{onClick:()=>I("chat"),className:"\n                      py-3 sm:py-4 px-2 sm:px-1 border-b-2 font-medium text-sm sm:text-responsive-base transition whitespace-nowrap flex-shrink-0\n                      ".concat(j==="chat"?"border-[#C9A96E] text-[#C9A96E]":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 dark:text-gray-200 dark:hover:text-white","\n                    "),children:e.jsxs("div",{className:"flex items-center space-x-1 sm:space-x-2",children:[e.jsx(Wt,{className:"w-3 h-3 sm:w-4 sm:h-4"}),e.jsx("span",{children:"Chat"})]})}),N==="trader"&&e.jsx("button",{onClick:()=>I("tools"),className:"\n                        py-3 sm:py-4 px-2 sm:px-1 border-b-2 font-medium text-sm sm:text-responsive-base transition whitespace-nowrap flex-shrink-0\n                        ".concat(j==="tools"?"border-[#C9A96E] text-[#C9A96E]":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 dark:text-gray-200 dark:hover:text-white","\n                      "),children:e.jsxs("div",{className:"flex items-center space-x-1 sm:space-x-2",children:[e.jsx(Xt,{className:"w-3 h-3 sm:w-4 sm:h-4"}),e.jsx("span",{children:M("dashboard.tools")})]})}),e.jsx("button",{onClick:()=>I("news"),className:"\n                      py-3 sm:py-4 px-2 sm:px-1 border-b-2 font-medium text-sm sm:text-responsive-base transition whitespace-nowrap flex-shrink-0\n                      ".concat(j==="news"?"border-[#C9A96E] text-[#C9A96E]":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 dark:text-gray-200 dark:hover:text-white","\n                    "),children:e.jsxs("div",{className:"flex items-center space-x-1 sm:space-x-2",children:[e.jsx(Xr,{className:"w-3 h-3 sm:w-4 sm:h-4"}),e.jsx("span",{children:M("dashboard.news")})]})}),e.jsx("button",{onClick:()=>I("education"),className:"\n                      py-3 sm:py-4 px-2 sm:px-1 border-b-2 font-medium text-sm sm:text-responsive-base transition whitespace-nowrap flex-shrink-0\n                      ".concat(j==="education"?"border-[#C9A96E] text-[#C9A96E]":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 dark:text-gray-200 dark:hover:text-white","\n                    "),children:e.jsxs("div",{className:"flex items-center space-x-1 sm:space-x-2",children:[e.jsx(Jr,{className:"w-3 h-3 sm:w-4 sm:h-4"}),e.jsx("span",{children:M("dashboard.education")})]})}),N==="trader"&&e.jsx("button",{onClick:()=>I("strategies"),className:"\n                        py-3 sm:py-4 px-2 sm:px-1 border-b-2 font-medium text-sm sm:text-responsive-base transition whitespace-nowrap flex-shrink-0\n                        ".concat(j==="strategies"?"border-[#C9A96E] text-[#C9A96E]":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 dark:text-gray-200 dark:hover:text-white","\n                      "),children:e.jsxs("div",{className:"flex items-center space-x-1 sm:space-x-2",children:[e.jsx(Yr,{className:"w-3 h-3 sm:w-4 sm:h-4"}),e.jsx("span",{className:"hidden sm:inline",children:L==="de"?"Strategien":"Strategies"}),e.jsx("span",{className:"sm:hidden",children:L==="de"?"Strategien":"Strategy"})]})}),e.jsx("button",{onClick:()=>I("etf"),className:"\n                      py-3 sm:py-4 px-2 sm:px-1 border-b-2 font-medium text-sm sm:text-responsive-base transition whitespace-nowrap flex-shrink-0\n                      ".concat(j==="etf"?"border-[#C9A96E] text-[#C9A96E]":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 dark:text-gray-200 dark:hover:text-white","\n                    "),children:e.jsxs("div",{className:"flex items-center space-x-1 sm:space-x-2",children:[e.jsx("svg",{className:"w-3 h-3 sm:w-4 sm:h-4",fill:"
7currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{d:"M3 13h8V3H3v10zm0 8h8v-6H3v6zm10 0h8V11h-8v10zm0-18v6h8V3h-8z"})}),e.jsx("span",{children:"ETF"})]})})]})})}),e.jsxs("div",{children:[j==="trading"&&e.jsxs(e.Fragment,{children:[N==="trader"&&e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6 mb-4 items-stretch",children:[Y&&e.jsx(Lt,{isLocked:k,children:e.jsx("div",{className:"\n                          rounded-xl backdrop-blur-md transition-all duration-300 hover:shadow-lg h-[140px]\n                          ".concat(ie(Y.event_type,S).containerClasses,"\n                        "),style:ie(Y.event_type,S).containerStyle,children:e.jsx("div",{className:"p-4 h-full flex flex-col",children:e.jsxs("div",{className:"flex items-start justify-between gap-3 flex-1",children:[e.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[e.jsx("div",{className:"\n                                w-8 h-8 rounded-lg flex items-center justify-center bg-gradient-to-br flex-shrink-0\n                                ".concat(ie(Y.event_type,S).iconBg,"\n                              "),children:e.jsx(wt,{className:"w-4 h-4 ".concat(ie(Y.event_type,S).iconColor)})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("h3",{className:"\n                                    text-lg font-bold truncate\n                                    ".concat(ie(Y.event_type,S).titleColor,"\n                                  "),children:L==="de"?"Marktvolatilität":"Market Volatility"}),e.jsx("span",{className:"\n                                    px-2 py-0.5 rounded text-xs font-bold uppercase flex-shrink-0\n                                    ".concat(ie(Y.event_type,S).titleColor,"\n                                    ").concat(S==="dark"?"bg-black/20":"bg-white/30","\n                                  "),children:Y.event_type})]}),e.jsx("p",{className:"\n                                  text-sm leading-relaxed line-clamp-3\n                                  ".concat(S==="dark"?"text-gray-300":"text-gray-700","\n                                "),children:L==="de"?Y.description_de||Y.description_en:Y.description_en||Y.description_de})]})]}),e.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 flex-shrink-0",children:new Date(Y.timestamp).toLocaleTimeString()})]})})})}),e.jsx("div",{className:"h-[140px]",children:e.jsx(er,{})})]}),N==="investor"&&e.jsx("div",{className:"mb-4",children:e.jsx("div",{className:"max-w-2xl",children:e.jsx("div",{className:"h-[140px]",children:e.jsx(er,{})})})}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-4 items-stretch",children:[e.jsx(Dt,{assetType:"crypto"}),e.jsx(Dt,{assetType:"stock"}),e.jsx(Dt,{assetType:"commodity"})]}),N==="trader"&&e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 mb-4",children:[e.jsx(fa,{}),e.jsx(ja,{}),e.jsx(Na,{})]}),!1,e.jsxs("div",{className:"rounded-xl sm:rounded-2xl shadow-lg sm:shadow-xl transition-all duration-300 bg-gradient-to-br from-white to-[#0A0A0A] dark:from-[#1A1714] dark:to-[#1A1714] hover:from-[#0A0A0A] hover:to-white dark:hover:from-[#1A1714] dark:hover:to-[#1A1714] border border-[#2A2520] dark:border-[#2A2520] shadow-[0_4px_16px_rgba(153,125,65,0.12)] hover:shadow-[0_8px_32px_rgba(153,125,65,0.18)] p-3 sm:p-4 mt-4",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between mb-4 gap-3",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:"h-6 w-6 sm:h-8 sm:w-8 bg-gradient-to-br from-[#C9A96E]/20 to-[#C9A96E]/20 rounded-lg flex items-center justify-center mr-2",children:e.jsx(wt,{className:"h-3 w-3 sm:h-4 sm:w-4 ".concat(S==="dark"?"text-white":"text-gray-900")})}),e.jsx("h2",{className:"text-lg sm:text-xl md:text-2xl font-semibold text-gray-900 dark:text-white",children:L==="de"?"Asset Überblick":"Asset Overview"})]}),e.jsxs("div",{className:"flex items-center gap-2 sm:gap-3",children:[V&&e.jsxs("button",{onClick:()=>{var X;
7return(X=Ce[A].current)==null?void 0:X.openAddModal()},className:"inline-flex items-center px-3 sm:px-5 py-1 sm:py-1.5 text-sm rounded-lg shadow-lg transition-all duration-200 bg-gradient-to-r from-[#1A1714] to-[#2A2520] hover:from-[#1A1714] hover:to-[#2A2520] text-white gap-1 sm:gap-2 justify-center",children:[e.jsx("svg",{className:"w-3.5 h-3.5 sm:w-4 sm:h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),e.jsx("span",{children:ve[A]})]}),e.jsxs("a",{href:k?"/pricing":Vr,target:k?void 0:"_blank",rel:k?void 0:"noopener noreferrer",onClick:k?X=>{X.preventDefault(),W("/pricing")}:void 0,className:"inline-flex items-center px-3 sm:px-5 py-1 sm:py-1.5 text-sm rounded-lg shadow-lg transition-all duration-200 bg-[#C9A96E] hover:bg-[#E6C88A] text-[#0A0A0A] gap-1 sm:gap-2 justify-center",children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",className:"sm:w-4 sm:h-4",children:e.jsx("path",{d:"M21.426 2.574a2.5 2.5 0 0 0-2.5-.41L3.5 8.5A2.5 2.5 0 0 0 3.6 13.1l3.9 1.3 2.1 6.3a2.5 2.5 0 0 0 2.4 1.7h.1a2.5 2.5 0 0 0 2.4-1.8l1.2-3.7 3.7 2.5a2.5 2.5 0 0 0 3.9-1.5l2.3-13.1a2.5 2.5 0 0 0-1.214-2.486zM10.5 17.5l-1.7-5.1 8.7-8.7-7 13.8zm2.7 2.1a.5.5 0 0 1-.5.4h-.1a.5.5 0 0 1-.5-.3l-2.1-6.3 8.7-8.7-5.5 15zm7.6-2.1a.5.5 0 0 1-.8.3l-3.7-2.5 5.5-15a.5.5 0 0 1 .7.5l-2.3 13.1a.5.5 0 0 1-.4.4z",fill:"#0A0A0A"})}),e.jsx("span",{className:"hidden sm:inline",children:"Telegram Notifications"}),e.jsx("span",{className:"sm:hidden",children:"Telegram"})]}),V&&N==="investor"&&e.jsxs("button",{onClick:_e,disabled:ue,className:"inline-flex items-center px-3 sm:px-5 py-1 sm:py-1.5 text-sm rounded-lg shadow-lg transition-all duration-200 gap-1 sm:gap-2 justify-center ".concat(q?"bg-gradient-to-r from-green-500 to-green-700 hover:from-green-600 hover:to-green-800 text-white":"bg-gradient-to-r from-gray-500 to-gray-700 hover:from-gray-600 hover:to-gray-800 text-white"," ").concat(ue?"opacity-50 cursor-not-allowed":""),title:q?"Spot Notifications: ON":"Spot Notifications: OFF",children:[q?e.jsx(lr,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"}):e.jsx(ea,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"}),e.jsx("span",{className:"hidden sm:inline",children:q?"Spot Alerts ON":"Spot Alerts OFF"}),e.jsx("span",{className:"sm:hidden",children:q?"ON":"OFF"})]})]})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between mb-4 gap-2 sm:gap-4",children:[e.jsxs("div",{className:"flex items-center space-x-1 sm:space-x-2 p-1 bg-white/5 backdrop-blur-md rounded-xl border border-dashboard-light dark:border-white/10 w-fit overflow-x-auto scrollbar-hide",children:[e.jsxs("button",{onClick:()=>pe("crypto"),className:"px-2 sm:px-4 py-1.5 sm:py-2 rounded-lg transition-all duration-300 text-sm flex items-center gap-1 sm:gap-2 whitespace-nowrap flex-shrink-0 ".concat(A==="crypto"?"bg-[#C9A96E] text-[#0A0A0A] shadow-lg":"text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white hover:bg-white/5"),children:[e.jsx(ma,{className:"w-3 h-3 sm:w-4 sm:h-4"}),e.jsx("span",{className:"hidden sm:inline",children:M("dashboard.tabCrypto")||"Kryptowährungen"}),e.jsx("span",{className:"sm:hidden",children:"Crypto"})]}),e.jsxs("button",{onClick:()=>pe("commodities"),className:"px-2 sm:px-4 py-1.5 sm:py-2 rounded-lg transition-all duration-300 text-sm flex items-center gap-1 sm:gap-2 whitespace-nowrap flex-shrink-0 ".concat(A==="commodities"?"bg-[#C9A96E] text-[#0A0A0A] shadow-lg":"text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white hover:bg-white/5"),children:[e.jsx(ua,{className:"w-3 h-3 sm:w-4 sm:h-4"}),e.jsx("span",{className:"hidden sm:inline",children:M("dashboard.tabCommodities")||"Rohstoffe"}),e.jsx("span",{className:"sm:hidden",children:"Rohstoff"})]}),e.jsxs("button",{onClick:()=>pe("stocks"),className:"px-2 sm:px-4 py-1.5 sm:py-2 rounded-lg transition-all duration-300 text-sm flex items-center gap-1 sm:gap-2 whitespace-nowrap flex-shrink-0 ".concat(A==="stocks"?"bg-[#C9A96E] text-[#0A0A0A] shadow-lg":"text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white hover:bg-white/5"),children:[e.jsx(xa,{
7className:"w-3 h-3 sm:w-4 sm:h-4"}),e.jsx("span",{children:"Stocks & Indizes"})]})]}),(A==="crypto"||A==="stocks")&&e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 sm:gap-4 w-full sm:w-auto",children:[e.jsxs("button",{onClick:()=>D(!F),className:"flex items-center justify-center sm:justify-start px-3 sm:px-4 py-2 rounded-lg transition-colors text-sm ".concat(F?"bg-surface-elevated text-white":"bg-white dark:bg-[#1A1714] text-gray-700 dark:text-gray-300 border border-[#2A2520] dark:border-[#2A2520] hover:bg-surface-elevated dark:hover:bg-surface-elevated"),children:[e.jsx(Kr,{className:"h-4 w-4 sm:h-5 sm:w-5 mr-2"}),"Filters"]}),e.jsxs("div",{className:"relative w-full sm:w-auto",children:[e.jsx(Zr,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 h-4 w-4 sm:h-5 sm:w-5"}),e.jsx("input",{type:"text",placeholder:M("dashboard.searchPairPlaceholder")||"Suche nach Pair",value:P,onChange:X=>_(X.target.value),className:"pl-9 sm:pl-10 pr-4 py-2 w-full sm:w-56 bg-white dark:bg-[#1A1714] border border-[#2A2520] dark:border-[#2A2520] rounded-lg text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-bronze-500 focus:border-transparent text-sm"})]})]})]}),e.jsxs("div",{children:[A==="crypto"&&e.jsx(ra,{ref:Te,view:N,searchTerm:P,setSearchTerm:_,showFilters:F,setShowFilters:D}),A==="commodities"&&e.jsx(aa,{ref:ce,view:N}),A==="stocks"&&e.jsx(sa,{ref:ee,view:N,searchTerm:P,setSearchTerm:_,showFilters:F,setShowFilters:D})]})]})]}),j==="market-overview"&&e.jsx(s.Suspense,{fallback:e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx("img",{src:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/images/download%20(1).gif",alt:"Loading...",className:"w-16 h-16"})}),children:e.jsx(Oa,{embedded:!0})}),j==="chat"&&(k?e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center mb-4",children:[e.jsx(Wt,{className:"h-6 w-6 mr-3 text-[#C9A96E]"}),e.jsx("h2",{className:"text-2xl font-bold text-black dark:text-white",children:"Community Chat"})]}),e.jsx(Lt,{isLocked:!0,children:e.jsx(s.Suspense,{fallback:e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx("img",{src:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/images/download%20(1).gif",alt:"Loading...",className:"w-16 h-16"})}),children:e.jsx(ar,{embedded:!0})})})]}):e.jsx(s.Suspense,{fallback:e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx("img",{src:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/images/download%20(1).gif",alt:"Loading...",className:"w-16 h-16"})}),children:e.jsx(ar,{embedded:!0})})),j==="tools"&&N==="trader"&&(k?e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center mb-4",children:[e.jsx(Xt,{className:"h-6 w-6 mr-3 text-[#C9A96E]"}),e.jsx("h2",{className:"text-2xl font-bold text-black dark:text-white",children:"Trading Calculator"})]}),e.jsx(Lt,{isLocked:!0,children:e.jsx(s.Suspense,{fallback:e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx("img",{src:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/images/download%20(1).gif",alt:"Loading...",className:"w-16 h-16"})}),children:e.jsx(sr,{embedded:!0})})})]}):e.jsx(s.Suspense,{fallback:e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx("img",{src:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/images/download%20(1).gif",alt:"Loading...",className:"w-16 h-16"})}),children:e.jsx(sr,{embedded:!0})})),j==="news"&&e.jsx(s.Suspense,{fallback:e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx("img",{src:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/images/download%20(1).gif",alt:"Loading...",className:"w-16 h-16"})}),children:e.jsx($a,{embedded:!0})}),j==="education"&&e.jsx(s.Suspense,{fallback:e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx("img",{src:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/images/download%20(1).gif",alt:"Loading...",className:"w-16 h-16"})}),children:e.jsx(qa,{embedded:!0})}),j==="strategies"&&N==="trader"&&e.jsx(s.Suspense,{fallback:e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx("img",{src:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/images/download%20(1).gif",alt:"Loading...",className:"w-16 h-16"})}),children:e.jsx(Fa,{embedded:!0})}),j==="compounding"&&N==="trader"&&e.jsx(s.Suspense,{fallback:e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx("img",{src:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/images/download%20(1).gif",alt:"Loading...",className:"w-16 h-16"})}),children:e.jsx(Ba,{embedded:!0})}),j==="etf"&&e.jsx(s.Suspense,{fallback:e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx("img",{src:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/images/download%20(1).gif",alt:"Loading...",className:"w-16 h-16"})}),children:e.jsx(Ra,{})}),j==="spot"&&e.jsx(s.Suspense,{fallback:e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx("img",{src:"https://bsmvcmmwkmaqpgrmvjql.supabase.co/storage/v1/object/public/images/download%20(1).gif",alt:"Loading...",className:"w-16 h-16"})}),children:e.jsx(Ua,{embedded:!0})})]}),me&&e.jsx("div",{className:"fixed inset-0 flex items-center justify-center bg-black bg-opacity-50 z-50",children:e.jsxs("div",{className:"bg-white dark:bg-surface-elevated rounded-lg p-8 shadow-xl max-w-sm w-full text-center",children:[e.jsx("h2",{className:"text-h3 font-bold mb-4 text-gray-900 dark:text-white",children:"Upgrade erforderlich"}),e.jsx("p",{className:"text-body mb-6 text-gray-700 dark:text-gray-300",children:"Um den Trader-Bereich zu nutzen, benötigst du das Pro-Paket."}),e.jsx("button",{onClick:()=>{be(!1),Ur()},className:"px-6 py-2 bg-gradient-to-r from-[var(--color-accent-from)] to-[var(--color-accent-to)] text-white text-button-primary rounded-lg shadow hover:opacity-90 transition-all duration-200",children:"Jetzt upgraden"}),e.jsx("button",{onClick:()=>be(!1),className:"ml-4 px-4 py-2 text-button-secondary text-gray-500 dark:text-gray-300 border border-gray-300 dark:border-gray-700 rounded-lg hover:bg-gray-100 dark:hover:bg-surface-elevated transition-all duration-200",children:"Schließen"})]})}),e.jsx(Pr,{isOpen:J,onClose:()=>he(!1),reportId:(Ne=le[ae])==null?void 0:Ne.id})]})]})]}):e.jsx("div",{className:"min-h-screen flex flex-col items-center justify-center bg-white dark:bg-[#0A0A0A]",children:e.jsxs("div",{className:"bg-surface-elevated border-l-4 border-[#2A2520] text-yellow-900 p-8 rounded-xl max-w-xl mx-auto text-center",children:[e.jsx("h2",{className:"text-h2 font-bold mb-2",children:L==="en"?"Verify your email":"E-Mail bestätigen"}),e.jsx("p",{className:"text-body mb-4",children:L==="en"?"Please check your email and click the verification link to activate your account. You can log in after verifying.":"Bitte prüfe deine E-Mails und klicke auf den Bestätigungslink, um deinen Account zu aktivieren. Du kannst dich nach der Bestätigung einloggen."}),e.jsx("button",{className:"px-6 py-2 bg-gradient-to-r from-[var(--color-accent-from)] to-[var(--color-accent-to)] text-white text-button-primary rounded-lg shadow hover:opacity-90 transition-all duration-200",onClick:async()=>{n&&(await v.auth.resend({type:"signup",email:n.email,options:{emailRedirectTo:"".concat(window.location.origin,"/dashboard")}}),alert(L==="en"?"Verification email resent!":"Bestätigungs-E-Mail erneut gesendet!"))},children:L==="en"?"Resend verification email":"Bestätigungs-E-Mail erneut senden"})]})})};export{Zs 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.