1import{j as e,r as b,X as O,t as M,C as ue,e as se,u as re,d as ie,B as oe,k as xe,s as G}from"./index-EuY_-FAY.js";import{D as he}from"./DashboardLayout-Gw2TxiBJ.js";import{E as fe}from"./EventSettingsContent-DjtkJf4y.js";import{A as ve}from"./MentorApplicationsContent-Bm0qIoL7.js";import{C as T,a as $,b as R,d as W,c as z}from"./card-CIFW0qNz.js";import{B as S}from"./button-DwzNqib_.js";import{u as ge}from"./useRoleProfiles-C1cZoze_.js";import{I as B}from"./input-CwLsOgdz.js";import{T as je}from"./textarea-D6vuaKhs.js";import{L as C}from"./label-DHjRMKAW.js";import{S as q,a as K,b as H,c as Y,d as L}from"./select-Zkugu-mn.js";import{B as A}from"./badge-BiGl0epm.js";import{T as be,a as Ne,b as ye,c as _e}from"./tooltip-DhO4SW4a.js";import{S as J}from"./square-pen-DgtJmqsG.js";import{E as ee}from"./eye-DWMmm-eV.js";import{L as we}from"./lock-BAVbJQ92.js";import{E as Ce}from"./eye-off-Cp1ZERv1.js";import{T as Se}from"./trending-up-DfxLE4nH.js";import{D as ne}from"./dollar-sign-Lxv_EYwt.js";import{T as ke}from"./target-Cm-J7PgS.js";import{P as X,C as te}from"./plus-DP6EyEDe.js";import{B as Pe}from"./building-2-AqdBhrS9.js";import{P as Ee,M as Ie}from"./MediaGalleryContent-XJA4H3_o.js";import{A as Te}from"./arrow-left-lIwOt_N5.js";import{U as ze}from"./user-DuBvhp_O.js";import{I as De}from"./InvestorDashboard-JDZBR7Qe.js";import{R as Be}from"./ReviewsContent-BqM04mPl.js";import{u as Le,a as $e}from"./StartupDetailContent-CsXCRijV.js";import{B as Re}from"./shield-nL0KFzur.js";import{C as Ae}from"./clock-C9pzXbgT.js";import"./list-checks-XjZkVVNc.js";import"./circle-user-C6EVL7I0.js";import"./search-BN9ssjqw.js";import"./users-B7Eh8ycR.js";import"./award-CK-g5_KF.js";import"./calendar-TeXraZ6Q.js";import"./message-square-CX4ymtRO.js";import"./layout-dashboard-a4gKtYLw.js";import"./index-wQwPqDfP.js";import"./index-BMKRCHpo.js";import"./index-BJKYc_OV.js";import"./index-DKmrCAge.js";import"./chevron-down-D0i5abe3.js";import"./chevron-right-R-JJXQF-.js";import"./settings-DbY5cOJ-.js";import"./user-plus-tyTYVH-R.js";import"./rocket-D93ZlqmD.js";import"./users-round-B278ejjI.js";import"./ChatSystem-4zb8rVWu.js";import"./avatar-DmtcMqZM.js";import"./NotificationCenter-DHgRHZeL.js";import"./index-BccXDNaF.js";import"./index-BdQq_4o_.js";import"./DashboardHeader-qK3Qmy-e.js";import"./index-BSIHs9Yh.js";import"./index-C40cg7B2.js";import"./index-BONWbLIr.js";import"./index-BXTDk0Ug.js";import"./check-BFBMQrmy.js";import"./map-pin-CiJS0zpt.js";import"./mail-BVVKtkzs.js";import"./send-CxotHqOi.js";import"./star-DLxjevVK.js";import"./presentation-1PlbYjJw.js";import"./clipboard-list-DnNVBJ_L.js";import"./handshake-ChAu9QXI.js";import"./menu-QX_7UXmx.js";import"./Footer-DLYBYlrH.js";import"./FeedbackButton-84GpwsHz.js";import"./dialog-BshpMbXa.js";import"./index-Byc0C5HR.js";import"./tabs-BkjaH3fl.js";import"./cityCoordinates-BF9Pw5Lr.js";import"./index-CCnnvLwg.js";import"./switch-C1fACMOm.js";import"./index-90AI2Mcq.js";import"./quill.snow-Dj63gIbu.js";import"./separator-CP7aABc2.js";import"./checkbox-D-yVHPM-.js";import"./command-CJk2AU3Y.js";import"./format-BJatCrh1.js";import"./popover-C1CUfueU.js";import"./CityCountryInput-DzjN59o-.js";import"./useQuery-DeYV4IS5.js";import"./loader-circle-Caxve_ph.js";import"./chevrons-up-down-CWJDjV6L.js";import"./venueAddress-DVUbw9NQ.js";import"./filter-BX-yFJmx.js";import"./timezones-CsxV_3Uh.js";import"./image-rU_ppTuS.js";import"./list-DRGo6gHo.js";import"./save-B2VAfAIz.js";import"./index-DwFUDgNw.js";import"./index-Cb8UU1H3.js";import"./xlsx-DjuO7_Ju.js";import"./alert-dialog-Dzo3XCPR.js";import"./linkedin-CHWP1gWB.js";import"./globe-DmqLM4zl.js";import"./external-link-SoEG5yvx.js";import"./download-Gq_d9FhN.js";import"./circle-check-DZuRMJvy.js";import"./chevron-up-BGLh5JIr.js";import"./calendar-D4NNVj7-.js";import"./subDays-1Gd6-EPS.js";import"./isSameDay-D8qkwPfC.js";import"./chevron-left-nZrh3bY0.js";import"./index-h3IyJjLp.js";import"./parseISO-DmI85Ds7.js";import"./eachDayOfInterval-C6Nk_oxa.js";import"./differenceInMilliseconds-ycH2onZd.js";import"./mic-B2yxq-CM.js";import"./sparkles-CDimFECD.js";import"./useInfiniteScroll-CcPzzG0i.js";import"./play-BEepO1Dv.js";import"./ellipsis-vertical-eBvHTnN9.js";import"./NetworkingContent-Bb1EhX8P.js";import"./twitter-7bv0L9_e.js";import"./StartupsContent-C87fSNlC.js";import"./StartupContactModal-C5e0adbk.js";import"./index-DXqQCM1T.js";import"./table-B7IdTOLn.js";import"./sticky-note-DtyHP69G.js";import"./bookmark-DYmGZhVj.js";import"./hash-DFi8_KFc.js";import"./StartupNotesCard-TXGCFl6_.js";const Me=({status:s,visibility:h,className:d})=>{const r=(()=>
1{if(s==="Draft")return{variant:"secondary",icon:J,text:"Draft",color:"text-muted-foreground"};if(s==="Pending")return{variant:"outline",icon:ee,text:"Pending Approval",color:"text-orange-600"};switch(h){case"Public":return{variant:"default",icon:ee,text:"Public",color:"text-green-600",description:"Visible on main page under mentors"};case"Protected":return{variant:"outline",icon:Ce,text:"Members Only",color:"text-yellow-600",description:"Only visible for members"};case"Private":return{variant:"destructive",icon:we,text:"Private",color:"text-red-600",description:"Only visible to StartupLive team"};default:return{variant:"secondary",icon:J,text:"Draft",color:"text-muted-foreground",description:"Not yet published"}}})(),g=r.icon;return e.jsx(be,{children:e.jsxs(Ne,{children:[e.jsx(ye,{asChild:!0,children:e.jsxs(A,{variant:r.variant,className:`flex items-center gap-1 ${d}`,children:[e.jsx(g,{className:"h-3 w-3"}),r.text]})}),e.jsx(_e,{children:e.jsx("p",{children:r.description})})]})})},Fe=({profile:s,onSave:h,onCancel:d,loading:c=!1})=>{const[r,g]=b.useState({bio:"",investment_focus:[],investment_stage:[],ticket_size_min:void 0,ticket_size_max:void 0,geographic_focus:"",portfolio_companies:[],previous_investments:[],status:"Draft",visibility:"Public",...s}),[i,u]=b.useState(""),[w,N]=b.useState(""),[y,_]=b.useState(""),P=["B2B SaaS","Fintech","Healthcare","EdTech","Climate Tech","AI/ML","E-commerce","Marketplace","Consumer","Enterprise","Deep Tech","Hardware","Biotech","Energy","Transportation"],j=["Pre-Seed","Seed","Series A","Series B","Series C","Growth","Late Stage","Public Markets"];b.useEffect(()=>{s&&g(t=>({...t,...s}))},[s]);const m=(t,a)=>{g(k=>({...k,[t]:a}))},x=(t,a,k)=>{if(!a.trim())return;const E=r[t]||[];E.includes(a.trim())||m(t,[...E,a.trim()]),k("")},o=(t,a)=>{const k=r[t]||[];m(t,k.filter(E=>E!==a))},n=async t=>{t.preventDefault();try{await h(r),M.success({title:"Success",description:"Investor profile saved successfully"})}catch(a){console.error("Error saving profile:",a),M.error({title:"Error",description:"Failed to save profile"})}},F=t=>t?t>=1e6?`$${(t/1e6).toFixed(1)}M`:t>=1e3?`$${(t/1e3).toFixed(0)}K`:`$${t}`:"";return e.jsxs("form",{onSubmit:n,className:"space-y-6",children:[e.jsxs(T,{children:[e.jsxs($,{className:"pb-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Se,{className:"h-5 w-5 text-primary"}),e.jsx(R,{className:"text-lg",children:"Investment Thesis"})]}),e.jsx(Me,{status:r.status||"Draft",visibility:r.visibility||"Public"})]}),e.jsx(W,{children:"Describe your investment philosophy and what you look for in startups"})]}),e.jsx(z,{children:e.jsx(je,{value:r.bio||"",onChange:t=>m("bio",t.target.value),placeholder:"Share your investment philosophy, what excites you about startups, and what founders can expect when working with you...",rows:4,className:"bg-background border-border"})})]}),e.jsxs(T,{children:[e.jsxs($,{className:"pb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ne,{className:"h-5 w-5 text-primary"}),e.jsx(R,{className:"text-lg",children:"Investment Parameters"})]}),e.jsx(W,{children:"Define your typical check size and geographic preferences"})]}),e.jsx(z,{className:"space-y-4",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(C,{htmlFor:"ticket_size_min",children:"Min Ticket Size ($)"}),e.jsx(B,{id:"ticket_size_min",type:"number",value:r.ticket_size_min||"",onChange:t=>m("ticket_size_min",parseInt(t.target.value)||void 0),placeholder:"e.g., 25000",className:"bg-background border-border"}),r.ticket_size_min&&e.jsx("p",{className:"text-xs text-muted-foreground",children:F(r.ticket_size_min)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(C,{htmlFor:"ticket_size_max",children:"Max Ticket Size ($)"}),e.jsx(B,{id:"ticket_size_max",type:"number",value:r.ticket_size_max||"",onChange:t=>m("ticket_size_max",parseInt(t.target.value)||void 0),placeholder:"e.g., 1000000",className:"bg-background border-border"}),r.ticket_size_max&&e.jsx("p",{className:"text-xs text-muted-foreground",children:F(r.ticket_size_max)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(C,{htmlFor:"geographic_focus",children:"Geographic Focus"}),e.jsx(B,{id:"geographic_focus",value:r.geographic_focus||"",onChange:t=>m("geographic_focus",t.target.value),placeholder:"e.g., Europe, Global",className:"bg-background border-border"})]})]})})]}),e.jsxs(T,{children:[e.jsxs($,{className:"pb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ke,{className:"h-5 w-5 text-primary"}),e.jsx(R,{className:"text-lg",children:"Focus Areas & Stages"})]}),e.jsx(W,{children:"Select industries and stages you typically invest in"})]}),e.jsxs(z,{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx(C,{className:"text-sm font-medium",children:"Investment Focus"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(q,{onValueChange:t=>x("investment_focus",t,u),children:[e.jsx(K,{className:"bg-background border-border flex-1",children:e.jsx(H,{placeholder:"Select focus areas"})}),e.jsx(Y,{children:P.filter(t=>!(r.investment_focus||[]).includes(t)).map(t=>e.jsx(L,{value:t,children:t},t))})]}),e.jsx(B,{value:i,onChange:t=>u(t.target.value),placeholder:"Or type custom",onKeyPress:t=>t.key==="Enter"&&(t.preventDefault(),x("investment_focus",i,u)),className:"bg-background border-border flex-1"}),e.jsx(S,{type:"button",variant:"outline",size:"icon",onClick:()=>x("investment_focus",i,u),children:e.jsx(X,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[(r.investment_focus||[]).map((t,a)=>e.jsxs(A,{variant:"secondary",className:"flex items-center gap-1 py-1",children:[t,e.jsx(O,{className:"h-3 w-3 cursor-pointer hover:text-destructive",onClick:()=>o("investment_focus",t)})]},a)),(r.investment_focus||[]).length===0&&e.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No focu
1s areas selected"})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(C,{className:"text-sm font-medium",children:"Investment Stage"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:j.map(t=>{const a=(r.investment_stage||[]).includes(t);return e.jsx(A,{variant:a?"default":"outline",className:"cursor-pointer hover:bg-primary/80 transition-colors",onClick:()=>{a?o("investment_stage",t):m("investment_stage",[...r.investment_stage||[],t])},children:t},t)})})]})]})]}),e.jsxs(T,{children:[e.jsxs($,{className:"pb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Pe,{className:"h-5 w-5 text-primary"}),e.jsx(R,{className:"text-lg",children:"Portfolio & Track Record"})]}),e.jsx(W,{children:"Showcase your investment history"})]}),e.jsxs(z,{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx(C,{className:"text-sm font-medium",children:"Portfolio Companies"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(B,{value:w,onChange:t=>N(t.target.value),placeholder:"Add a portfolio company",onKeyPress:t=>t.key==="Enter"&&(t.preventDefault(),x("portfolio_companies",w,N)),className:"bg-background border-border"}),e.jsx(S,{type:"button",variant:"outline",size:"icon",onClick:()=>x("portfolio_companies",w,N),children:e.jsx(X,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[(r.portfolio_companies||[]).map((t,a)=>e.jsxs(A,{variant:"secondary",className:"flex items-center gap-1 py-1",children:[t,e.jsx(O,{className:"h-3 w-3 cursor-pointer hover:text-destructive",onClick:()=>o("portfolio_companies",t)})]},a)),(r.portfolio_companies||[]).length===0&&e.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No portfolio companies added"})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(C,{className:"text-sm font-medium",children:"Notable Investments"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(B,{value:y,onChange:t=>_(t.target.value),placeholder:"Add a notable investment or exit",onKeyPress:t=>t.key==="Enter"&&(t.preventDefault(),x("previous_investments",y,_)),className:"bg-background border-border"}),e.jsx(S,{type:"button",variant:"outline",size:"icon",onClick:()=>x("previous_investments",y,_),children:e.jsx(X,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[(r.previous_investments||[]).map((t,a)=>e.jsxs(A,{variant:"secondary",className:"flex items-center gap-1 py-1",children:[t,e.jsx(O,{className:"h-3 w-3 cursor-pointer hover:text-destructive",onClick:()=>o("previous_investments",t)})]},a)),(r.previous_investments||[]).length===0&&e.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No notable investments added"})]})]})]})]}),e.jsxs(T,{children:[e.jsx($,{className:"pb-3",children:e.jsx(R,{className:"text-lg",children:"Profile Settings"})}),e.jsx(z,{children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(C,{children:"Status"}),e.jsxs(q,{value:r.status||"Draft",onValueChange:t=>m("status",t),children:[e.jsx(K,{className:"bg-background border-border",children:e.jsx(H,{})}),e.jsxs(Y,{children:[e.jsx(L,{value:"Draft",children:"Draft"}),e.jsx(L,{value:"Live",children:"Live"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(C,{children:"Visibility"}),e.jsxs(q,{value:r.visibility||"Public",onValueChange:t=>m("visibility",t),children:[e.jsx(K,{className:"bg-background border-border",children:e.jsx(H,{})}),e.jsxs(Y,{children:[e.jsx(L,{value:"Public",children:"Public"}),e.jsx(L,{value:"Protected",children:"Members Only"}),e.jsx(L,{value:"Private",children:"Private"})]})]})]})]})})]}),e.jsxs("div",{className:"flex justify-end gap-3",children:[d&&e.jsx(S,{type:"button",variant:"outline",onClick:d,children:"Cancel"}),e.jsx(S,{type:"submit",disabled:c,children:c?"Saving...":"Save Investor Profile"})]})]})},Ue=()=>{var x;const{investorProfile:s,loading:h,completionStatus:d,createInvestorProfile:c,updateInvestorProfile:r,refetchProfiles:g}=ge(),[i,u]=b.useState("overview"),w=()=>d.investor?{completion:d.investor.completion,missing:d.investor.missing}:{completion:0,missing:[]},N=()=>{u("edit")},y=async o=>{console.log("handleSaveInvestorProfile called with:",o),console.log("Existing investorProfile:",s);try{s?(console.log("Updating existing profile"),await r(o),M.success({title:"Success",description:"Profile updated successfully"})):(console.log("Creating new profile"),await c(o),M.success({title:"Success",description:"Profile created successfully"})),await g(),u("overview")}catch(n){throw console.error("Error saving investor profile:",n),M.error({title:"Error",description:"Failed to save profile: "+n.message}),n}},_=()=>{u("overview")},P=(o,n)=>
1!o&&!n?"Not specified":o&&n?`$${o.toLocaleString()} - $${n.toLocaleString()}`:o?`$${o.toLocaleString()}+`:n?`Up to $${n.toLocaleString()}`:"Not specified";if(i==="edit")return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs(S,{variant:"outline",size:"sm",onClick:_,className:"flex items-center gap-2",children:[e.jsx(Te,{className:"h-4 w-4"}),"Back to Profile"]}),e.jsxs("h1",{className:"text-2xl font-bold text-foreground",children:[s?"Edit":"Create"," Investor Profile"]})]}),e.jsx(Fe,{profile:s||void 0,onSave:y,onCancel:_,loading:h})]});const{completion:j,missing:m}=w();return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold text-foreground",children:"My Investor Profile"}),e.jsx("p",{className:"text-muted-foreground mt-1",children:"Showcase your investment focus and connect with startups"})]}),s&&e.jsxs(S,{onClick:N,className:"flex items-center gap-2",children:[e.jsx(J,{className:"h-4 w-4"}),"Edit Profile"]})]}),s&&e.jsx(T,{children:e.jsxs(z,{className:"pt-6",children:[e.jsx("div",{className:"flex items-center justify-between mb-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[j===100?e.jsx(ue,{className:"h-5 w-5 text-green-600"}):e.jsx(te,{className:"h-5 w-5 text-yellow-600"}),e.jsx("span",{className:"font-medium text-foreground",children:"Profile Completion"})]}),e.jsxs(A,{variant:j===100?"default":"secondary",children:[j,"% Complete"]})]})}),e.jsx(Ee,{value:j,className:"h-2 mb-4"}),j<100&&m.length>0&&e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(te,{className:"h-4 w-4"}),"Missing: ",m.slice(0,3).join(", "),m.length>3&&` +${m.length-3} more`]})]})}),e.jsxs(T,{children:[e.jsx($,{children:e.jsxs(R,{className:"flex items-center gap-2",children:[e.jsx(ze,{className:"h-5 h-5"}),"Profile Details"]})}),e.jsx(z,{children:s?e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium text-foreground mb-1",children:"Company/Fund"}),e.jsx("p",{className:"text-muted-foreground",children:s.company||"Not specified"})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium text-foreground mb-1",children:"Position"}),e.jsx("p",{className:"text-muted-foreground",children:s.position||"Not specified"})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium text-foreground mb-1",children:"Experience Level"}),e.jsx("p",{className:"text-muted-foreground capitalize",children:((x=s.experience_level)==null?void 0:x.replace("_"," "))||"Not specified"})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium text-foreground mb-1",children:"Location"}),e.jsx("p",{className:"text-muted-foreground",children:s.location||"Not specified"})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium text-foreground mb-1",children:"Geographic Focus"}),e.jsx("p",{className:"text-muted-foreground",children:s.geographic_focus||"Not specified"})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium text-foreground mb-1",children:"Ticket Size"}),e.jsx("p",{className:"text-muted-foreground",children:P(s.ticket_size_min,s.ticket_size_max)})]})]}),s.bio&&e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium text-foreground mb-2",children:"Bio"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:s.bio})]}),s.investment_focus&&s.investment_focus.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium text-foreground mb-2",children:"Investment Focus"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:s.investment_focus.map((o,n)=>e.jsx("span",{className:"px-3 py-1 bg-blue-100 text-blue-800 rounded-full text-sm",children:o},n))})]}),s.investment_stage&&s.investment_stage.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium text-foreground mb-2",children:"Investment Stage"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:s.investment_stage.map((o,n)=>e.jsx("span",{className:"px-3 py-1 bg-green-100 text-green-800 rounded-full text-sm",children:o},n))})]}),s.portfolio_companies&&s.portfolio_companies.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium text-foreground mb-2",children:"Portfolio Companies"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:s.portfolio_companies.map((o,n)=>e.jsx("span",{className:"px-3 py-1 bg-purple-100 text-purple-800 rounded-full text-sm",children:o},n))})]}),s.previous_investments&&s.previous_investments.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium text-foreground mb-2",children:"Notable Investments"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:s.previous_investments.map((o,n)=>e.jsx("span",{className:"px-3 py-1 bg-yellow-100 text-yellow-800 rounded-full text-sm",children:o},n))})]}),(s.linkedin||s.twitter||s.website)&&e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium text-foreground mb-2",children:"Social Links"}),e.jsxs("div",{className:"flex flex-wrap gap-4",children:[s.linkedin&&e.jsx("a",{href:s.linkedin,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-700 text-sm flex items-center gap-1",children:"LinkedIn"}),s.twitter&&e.jsx("a",{href:s.twitter,target:"_blank",rel:"noopener noreferrer",className:"text-blue-400 hover:text-blue-500 text-sm flex items-center gap-1",children:"Twitter"}),s.website&&e.jsx("a",{href:s.website,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:text-primary/80 text-sm flex items-center gap-1",children:"Website"})]})]})]}):e.jsxs("div",{className:"text-center py-12",children:[e.jsx(ne,{className:"h-16 w-16 text-muted-foreground mx-auto mb-4"}),e.jsx("h3",{className:"text-xl font-medium text-foreground mb-2",children:"No Investor Profile"}),e.jsx("p",{className:"text-muted-foreground mb-6 max-w-md mx-auto",children:"Create your investor profile to connect with startups and showcase your investment focus."}),e.jsx(S,{onClick:()=>u("edit"),size:"lg",children:"Create Investor Profile"})]})})]})]})},We=({eventId:s,startupId:h})=>{const{eventSlug:d}
1=se(),c=re(),{user:r}=ie(),{startup:g,teamMembers:i,crewMembers:u,isLoading:w,isBookmarked:N,isTogglingBookmark:y,isStartingChat:_,toggleBookmark:P,startTeamChat:j,crewCount:m,maxCrewSize:x,startupNumber:o}=Le({startupId:h,eventId:s,userId:r==null?void 0:r.id});return w?e.jsx("div",{className:"flex items-center justify-center min-h-96",children:e.jsx(oe,{size:64})}):g?e.jsx($e,{startup:g,startupId:h,userId:(r==null?void 0:r.id)||"",eventSlug:d||"",role:"investor",onBack:()=>c(`/dashboard/${d}/investor/startups`),teamMembers:i,crewMembers:u,isBookmarked:N,isTogglingBookmark:y,onToggleBookmark:P,isStartingChat:_,onStartChat:()=>j(g.name),crewCount:m,maxCrewSize:x,startupNumber:o,showBookmark:!0,showChat:!0,showTeam:!0,showResources:!0}):e.jsxs("div",{className:"flex flex-col items-center justify-center min-h-96 gap-4",children:[e.jsx(Re,{className:"h-16 w-16 text-muted-foreground"}),e.jsx("h2",{className:"text-2xl font-bold",children:"Startup not found"}),e.jsx(S,{onClick:()=>c(-1),children:"Go Back"})]})};function ar(){const{user:s}=ie(),{eventSlug:h}=se(),d=re(),c=xe(),[r,g]=b.useState(null),[i,u]=b.useState(null),[w,N]=b.useState(!0),[y,_]=b.useState([]),P=c.pathname.endsWith("/settings"),j=c.pathname.endsWith("/mentors"),m=c.pathname.endsWith("/profile"),x=c.pathname.endsWith("/schedule"),o=c.pathname.endsWith("/networking"),n=c.pathname.endsWith("/startups"),F=c.pathname.endsWith("/reviews"),t=c.pathname.endsWith("/media"),a=c.pathname.includes("/startups/"),k=c.pathname.match(/\/startups\/([^/]+)/),E=k?k[1]:null,ae=l=>{u(p=>p?{...p,...l}:null)};b.useEffect(()=>{s&&h&&le()},[s,h]);const le=async()=>{var l;try{N(!0);const{data:p,error:f}=await G.from("events").select("*");let v=null;if(p&&!f){const D=U=>U.toLowerCase().replace(/[^a-z0-9\s]/g,"").replace(/\s+/g,"-").substring(0,50);v=p.find(U=>D(U.title)===h)}if(f){console.error("Error fetching event:",f),d("/dashboard");return}u({id:v.id,title:v.title,description:v.description||"",location:v.location||"",start_date:v.start_date,end_date:v.end_date,max_participants:v.max_participants,event_type:v.event_type,status:v.status,visibility:v.visibility});const{data:I,error:Q}=await G.from("user_roles").select("event_id, role, status").eq("user_id",s==null?void 0:s.id).eq("event_id",v.id);if(Q){console.error("Error fetching user roles:",Q);return}if(_(I||[]),!(I==null?void 0:I.some(D=>D.role==="investor"))){d("/dashboard");return}const{data:V,error:Z}=await G.from("profiles").select("membership_level, name").eq("user_id",s==null?void 0:s.id).single();if(Z){console.error("Error fetching profile:",Z);return}const pe={id:(s==null?void 0:s.id)||"",name:(V==null?void 0:V.name)||((l=s==null?void 0:s.email)==null?void 0:l.split("@")[0])||"User",email:(s==null?void 0:s.email)||"",avatar:void 0,roles:(I==null?void 0:I.map(D=>({visitor:"visitor",attendee:"attendant",mentor:"mentor",startup:"startup_foun
1der",corporate:"corporate",investor:"investor",speaker:"speaker",program_manager:"program_manager",location:"location",jury_member:"jury_member"})[D.role]||D.role))||["investor"],primaryRole:"investor",currentEventId:v.id};g(pe)}catch(p){console.error("Error in fetchEventAndUserData:",p),d("/dashboard")}finally{N(!1)}},ce=()=>{const l=y.find(p=>p.role==="investor");return(l==null?void 0:l.status)||"pending"},me=l=>{const f={pending:{title:"Application Pending",message:"Your investor application is currently under review. You'll be notified once it's processed.",icon:e.jsx(Ae,{className:"h-12 w-12 text-yellow-500"}),bgColor:"bg-yellow-50 border-yellow-200",textColor:"text-yellow-800"},rejected:{title:"Application Not Approved",message:"Your investor application was not approved. Please contact the program manager for more information.",icon:e.jsx(O,{className:"h-12 w-12 text-red-500"}),bgColor:"bg-red-50 border-red-200",textColor:"text-red-800"}}[l];return f?e.jsx("div",{className:"min-h-screen flex items-center justify-center p-4",children:e.jsxs("div",{className:`max-w-md w-full ${f.bgColor} border rounded-lg p-8 text-center`,children:[e.jsx("div",{className:"flex justify-center mb-4",children:f.icon}),e.jsx("h2",{className:`text-xl font-semibold mb-3 ${f.textColor}`,children:f.title}),e.jsx("p",{className:`${f.textColor} mb-6`,children:f.message})]})}):null};if(w)return e.jsx("div",{className:"min-h-screen flex items-center justify-center",children:e.jsx(oe,{size:64})});if(!r||!i)return e.jsx("div",{className:"min-h-screen flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx("h2",{className:"text-xl font-semibold mb-2",children:"Access Denied"}),e.jsx("p",{className:"text-muted-foreground",children:"Unable to load dashboard data."})]})});const de=()=>{if(P)return e.jsx(fe,{currentEvent:{id:i.id,title:i.title,description:i.description||"",location:i.location||"",start_date:i.start_date||"",end_date:i.end_date||"",status:i.status||"Draft",visibility:i.visibility||"Private"},onEventUpdate:ae});if(j)return e.jsx(ve,{});if(m)return e.jsx(Ue,{});if(F)return e.jsx(Be,{eventId:i.id,eventTitle:i.title});if(t)return e.jsx(Ie,{});if(a&&E)return e.jsx(We,{eventId:i.id,startupId:E});const l=ce();if(l!=="accepted")return me(l);let p="overview";return x?p="schedule":o?p="networking":n&&(p="startups"),e.jsx(De,{eventId:i.id,eventStartDate:i.start_date,eventEndDate:i.end_date,activeTab:p,eventTimezone:i.timezone})};return e.jsx(he,{user:r,currentEvent:{id:i.id,title:i.title,description:i.description||"",location:i.location||"",start_date:i.start_date||"",end_date:i.end_date||"",status:i.status||"Draft",visibility:i.visibility||"Private"},userEventRoles:y.map(l=>({role:l.role,status:l.status,event_id:l.event_id})),currentRole:"investor",onRoleChange:l=>
1{const f={startup:"startups",startup_founder:"startups",program_manager:"manager",mentor:"mentor",jury_member:"jury",investor:"investor",corporate:"corporate",attendee:"attendant",visitor:"visitor"}[l]||l;d(`/dashboard/${h}/${f}/`)},children:de()})}export{ar 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.