1import{h as me,a as K,r as c,s as b,j as e,B as W,X as V,R as xe,T as he,e as ue,u as pe,d as je}from"./index-EuY_-FAY.js";import{C as I,a as F,b as O,c as A,d as fe}from"./card-CIFW0qNz.js";import{B as l}from"./button-DwzNqib_.js";import{B as C}from"./badge-BiGl0epm.js";import{A as q,b as H,a as ge}from"./avatar-DmtcMqZM.js";import{D as U}from"./DashboardLayout-Gw2TxiBJ.js";import{D as se,a as ae,b as re,c as te,d as ie}from"./dialog-BshpMbXa.js";import{I as X}from"./input-CwLsOgdz.js";import{L as J}from"./label-DHjRMKAW.js";import{S as ne,a as le,b as ce,c as oe,d as t}from"./select-Zkugu-mn.js";import{U as Q}from"./user-plus-tyTYVH-R.js";import{S as ve}from"./search-BN9ssjqw.js";import{U as G}from"./users-B7Eh8ycR.js";import{C as Y}from"./clock-C9pzXbgT.js";import{M as Ne}from"./mail-BVVKtkzs.js";import{C as ye}from"./check-BFBMQrmy.js";import{S as de}from"./square-pen-DgtJmqsG.js";import{U as be}from"./user-minus-UfNbG_DV.js";import{B as we}from"./shield-nL0KFzur.js";import{A as Z}from"./arrow-left-lIwOt_N5.js";import{M as ee}from"./map-pin-CiJS0zpt.js";import{C as $}from"./calendar-TeXraZ6Q.js";import{E as _e}from"./eye-DWMmm-eV.js";import{G as Ce}from"./globe-DmqLM4zl.js";import{E as z}from"./external-link-SoEG5yvx.js";import{L as ke}from"./linkedin-CHWP1gWB.js";import{T as Se}from"./twitter-7bv0L9_e.js";import"./index-BMKRCHpo.js";import"./index-BJKYc_OV.js";import"./list-checks-XjZkVVNc.js";import"./user-DuBvhp_O.js";import"./circle-user-C6EVL7I0.js";import"./target-Cm-J7PgS.js";import"./award-CK-g5_KF.js";import"./message-square-CX4ymtRO.js";import"./layout-dashboard-a4gKtYLw.js";import"./index-wQwPqDfP.js";import"./index-DKmrCAge.js";import"./chevron-down-D0i5abe3.js";import"./chevron-right-R-JJXQF-.js";import"./settings-DbY5cOJ-.js";import"./rocket-D93ZlqmD.js";import"./users-round-B278ejjI.js";import"./ChatSystem-4zb8rVWu.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"./building-2-AqdBhrS9.js";import"./plus-DP6EyEDe.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"./textarea-D6vuaKhs.js";import"./tabs-BkjaH3fl.js";import"./cityCoordinates-BF9Pw5Lr.js";import"./index-CCnnvLwg.js";import"./switch-C1fACMOm.js";import"./index-90AI2Mcq.js";import"./index-Byc0C5HR.js";import"./chevron-up-BGLh5JIr.js";/** 2 * @license lucide-react v0.462.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const R=me("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);function Ee({isOpen:g,onClose:u,companyId:x,companyName:k,onSuccess:B}){const{toast:h}=K(),[f,s]=c.useState(""),[o,m]=c.useState(null),[v,P]=c.useState(""),[p,N]=c.useState([]),[y,S]=c.useState(!1),[w,_]=c.useState(!1),[E,n]=c.useState(!1);c.useEffect(()=>{if(!f.trim()||o){N([]),n(!1);return}const i=setTimeout(()=>{r()},500);return()=>clearTimeout(i)},[f,o]);const r=async()=>{if(!f.trim()){N([]),n(!1);return}S(!0),n(!0);try{const{data:i,error:D}=await b.from("profiles").select("id, name, email").ilike("email",`%${f}%`).limit(5);if(D)throw D;N(i||[])}catch(i){console.error("Error searching users:",i),h.error({title:"Failed to search users",description:"Please try again later."})}finally{S(!1)}},M=i=>{m(i),s(i.email),N([])},j=()=>{m(null),s(""),N([])},L=async()=>{if(!o||!v.trim()){h.error({title:"Missing information",description:"Please select a user and enter a position."});return}_(!0);try{const{data:i,error:D}=await b.from("company_members").select("id").eq("profile_id",o.id).eq("company_id",x).single();if(i){h.error({title:"User already invited",description:"This user is already part of this company."});return}const{error:a}=await b.from("company_members").insert({profile_id:o.id,company_id:x,position:v,is_primary:!1,role:"member"});if(a)throw a;h.success({title:"Team member invited!",description:`${o.name} has been added to ${k}.`}),m(null),s(""),P(""),N([]),B==null||B(),u()}catch(i){console.error("Error inviting team member:",i),h.error({title:"Failed to invite team member",description:"Please try again later."})}finally{_(!1)}};return e.jsx(se,{open:g,onOpenChange:u,children:e.jsxs(ae,{className:"sm:max-w-md",children:[e.jsxs(re,{children:[e.jsxs(te,{className:"flex items-center gap-2",children:[e.jsx(Q,{className:"w-5 h-5"}),"Invite Team Member"]}),e.jsxs(ie,{children:["Add a team member to ",k," by searching for their email address."]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(J,{htmlFor:"email",children:"Search by Email"}),e.jsxs("div",{className:"relative",children:[e.jsx(X,{id:"email",type:"email",placeholder:"Enter email address...",value:f,onChange:i=>{s(i.target.value),o&&m(null)},onKeyDown:i=>{i.key==="Enter"&&r()}}),e.jsx(l,{type:"button",variant:"ghost",size:"sm",className:"absolute right-1 top-1 h-8 w-8 p-0",onClick:r,disabled:y||!f.trim(),children:y?e.jsx(W,{size:16}):e.jsx(ve,{className:"w-4 h-4"})})]}),y&&e.jsxs("div",{className:"mt-2 p-3 text-sm text-muted-foreground flex items-center gap-2",children:[e.jsx(W,{size:16}),"Searching..."]}),!y&&E&&p.length===0&&!o&&e.jsx("div",{className:"mt-2 p-3 text-sm text-muted-foreground border rounded-md bg-muted/50",children:"No users found with this email address."}),p.length>0&&e.jsx("div",{className:"mt-2 border rounded-md bg-background",children:p.map(i=>e.jsxs("div",{className:"flex items-center gap-3 p-3 hover:bg-muted cursor-pointer border-b last:border-b-0",onClick:()=>M(i),children:[e.jsx(q,{className:"h-8 w-8",children:e.jsx(H,{className:"text-xs",children:i.name.slice(0,2).toUpperCase()})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium truncate",children:i.name}),e.jsx("p",{className:"text-xs text-muted-foreground truncate",children:i.email})]})]},i.id))}),o&&e.jsxs("div",{className:"mt-2 flex items-center gap-2 p-2 bg-muted rounded-md",children:[e.jsx(q,{className:"h-8 w-8",children:e.jsx(H,{className:"text-xs",children:o.name.slice(0,2).toUpperCase()})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium truncate",children:o.name}),e.jsx("p",{className:"text-xs text-muted-foreground truncate",children:o.email})]}),e.jsx(l,{type:"button",variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:j,children:e.jsx(V,{className:"w-3 h-3"})})]})]}),e.jsxs("div",{children:[e.jsx(J,{htmlFor:"position",children:"Position"}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(ne,{value:v,onValueChange:P,children:[e.jsx(le,{children:e.jsx(ce,{placeholder:"Select or type a position"})}),e.jsxs(oe,{className:"bg-background border shadow-lg z-50",children:[e.jsx(t,{value:"CEO",children:"CEO"}),e.jsx(t,{value:"CTO",children:"CTO"}),e.jsx(t,{value:"CFO",children:"CFO"}),e.jsx(t,{value:"COO",children:"COO"}),e.jsx(t,{value:"Founder",children:"Founder"}),e.jsx(t,{value:"Co-Founder",children:"Co-Founder"}),e.jsx(t,{value:"Product Manager",children:"Product Manager"}),e.jsx(t,{value:"Engineering Manager",children:"Engineering Manager"}),e.jsx(t,{value:"Head of Marketing",children:"Head of Marketing"}),e.jsx(t,{value:"Head of Sales",children:"Head of Sales"}),e.jsx(t,{value:"Designer",children:"Designer"}),e.jsx(t,{value:"Developer",children:"Developer"}),e.jsx(t,{value:"Business Development",children:"Business Development"}
6),e.jsx(t,{value:"Advisor",children:"Advisor"}),e.jsx(t,{value:"Board Member",children:"Board Member"}),e.jsx(t,{value:"Intern",children:"Intern"}),e.jsx(t,{value:"custom",children:"Custom Position"})]})]}),v==="custom"&&e.jsx(X,{id:"custom-position",type:"text",placeholder:"Enter custom position...",value:v==="custom"?"":v,onChange:i=>P(i.target.value),autoFocus:!0})]})]}),e.jsxs("div",{className:"flex gap-2 pt-4",children:[e.jsx(l,{variant:"outline",onClick:u,className:"flex-1",children:"Cancel"}),e.jsx(l,{onClick:L,disabled:!o||!v.trim()||v==="custom"||w,className:"flex-1",children:w?"Inviting...":"Send Invitation"})]})]})]})})}function De({companyId:g,companyName:u,onTeamUpdate:x,onInviteClick:k,refreshTrigger:B}){const{toast:h}=K(),[f,s]=c.useState([]),[o,m]=c.useState([]),[v,P]=c.useState(!0),[p,N]=c.useState(null),[y,S]=c.useState(""),[w,_]=c.useState(null);xe.useEffect(()=>{E(),n()},[g,B]);const E=async()=>{try{const{data:a,error:d}=await b.from("company_members").select(` 7 id, 8 position, 9 is_primary, 10 start_date, 11 end_date, 12 description, 13 profile:profiles ( 14 id, 15 name, 16 email 17 ) 18 `).eq("company_id",g).order("is_primary",{ascending:!1}).order("start_date",{ascending:!0});if(d)throw d;s(a||[])}catch(a){console.error("Error fetching team members:",a),h.error({title:"Failed to load team members",description:"Please try again later."})}finally{P(!1)}},n=async()=>{try{const{data:a,error:d}=await b.from("startup_invitations").select("id, email, status, created_at, event_id").eq("company_id",g).eq("status","pending").order("created_at",{ascending:!1});if(d)throw d;m(a||[])}catch(a){console.error("Error fetching pending invitations:",a)}},r=async a=>{try{const{error:d}=await b.from("startup_invitations").delete().eq("id",a);if(d)throw d;h.success({title:"Invitation cancelled"}),n()}catch(d){console.error("Error cancelling invitation:",d),h.error({title:"Failed to cancel invitation"})}},M=async(a,d)=>{try{const{error:T}=await b.from("company_members").update({position:d}).eq("id",a);if(T)throw T;h.success({title:"Position updated successfully!"}),E(),x==null||x()}catch(T){console.error("Error updating position:",T),h.error({title:"Failed to update position",description:"Please try again later."})}},j=async a=>{try{const{error:d}=await b.from("company_members").delete().eq("id",a);if(d)throw d;h.success({title:"Team member removed successfully!"}),E(),x==null||x(),_(null)}catch(d){console.error("Error removing team member:",d),h.error({title:"Failed to remove team member",description:"Please try again later."})}},L=a=>{N(a),S(a.position)},i=()=>{p&&y.trim()&&(M(p.id,y.trim()),N(null),S(""))},D=()=>{N(null),S("")};return v?e.jsxs(I,{children:[e.jsx(F,{children:e.jsxs(O,{className:"flex items-center gap-2",children:[e.jsx(G,{className:"w-5 h-5"}),"Team"]})}),e.jsx(A,{children:e.jsx("div",{className:"space-y-3",children:[1,2,3].map(a=>e.jsxs("div",{className:"flex items-center gap-3 animate-pulse",children:[e.jsx("div",{className:"h-10 w-10 bg-muted rounded-full"}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx("div",{className:"h-4 bg-muted rounded w-24"}),e.jsx("div",{className:"h-3 bg-muted rounded w-32"})]})]},a))})})]}):e.jsxs(e.Fragment,{children:[e.jsxs(I,{children:[e.jsxs(F,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsxs(O,{className:"flex items-center gap-2",children:[e.jsx(G,{className:"w-5 h-5"}),"Team (",f.length,")"]}),k&&e.jsxs(l,{size:"sm",variant:"outline",onClick:k,children:[e.jsx(Q,{className:"w-4 h-4 mr-1"}),"Invite"]})]}),e.jsxs(A,{className:"space-y-4",children:[o.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("h4",{className:"text-sm font-medium text-muted-foreground flex items-center gap-2",children:[e.jsx(Y,{className:"w-4 h-4"}),"Pending Invitations (",o.length,")"]}),e.jsx("div",{className:"space-y-2",children:o.map(a=>e.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg border border-dashed bg-muted/30",children:[e.jsx(q,{className:"h-10 w-10 border-2 border-muted",children:e.jsx(H,{className:"bg-muted text-muted-foreground",children:e.jsx(Ne,{className:"w-4 h-4"})})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:a.email}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(C,{variant:"secondary",className:"text-xs",children:[e.jsx(Y,{className:"w-3 h-3 mr-1"}),"Pending"]}),e.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(a.created_at).toLocaleDateString()})]})]}),e.jsx(l,{size:"sm",variant:"ghost",onClick:()=>r(a.id),className:"h-8 w-8 p-0 text-muted-foreground hover:text-destructive hover:bg-destructive/10",children:e.jsx(V,{className:"w-4 h-4"})})]},a.id))})]}),f.length===0&&o.length===0?e.jsx("p",{className:"text-muted-foreground text-center py-4",children:"No team members yet. Invite someone to get started!"}):f.length===0?null:e.jsx("div",{className:"space-y-3",children:f.map(a=>e.jsxs("div",{className:"flex items-center gap-3 p-4 rounded-lg border bg-card hover:bg-muted/30 transition-colors",children:[e.jsx(q,{className:"h-12 w-12 border-2 border-muted",children:e.jsx(H,{className:"bg-primary/10 text-primary font-semibold",children:a.profile.name.slice(0,2).toUpperCase()})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("p",{className:"font-semibold text-foreground text-base truncate",children:a.profile.name}),a.is_primary&&e.jsx(C,{variant:"default",className:"text-xs font-medium",children:"Primary"})]}),(p==null?void 0:p.id)===a.id?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(ne,{value:y,onValueChange:S,children:[e.jsx(le,{className:"h-8 text-sm bg-background border-input",children:e.jsx(ce,{})}),e.jsxs(oe,{className:"bg-background border shadow-lg z-50 max-h-60",children:[e.jsx(t,{value:"CEO",children:"CEO"}),e.jsx(t,{value:"CTO",children:"CTO"}),e.jsx(t,{value:"CFO",children:"CFO"}),e.jsx(t,{value:"COO",children:"COO"}),e.jsx(t,{value:"Founder",children:"Founder"}),e.jsx(t,{value:"Co-Founder",children:"Co-Founder"}),e.jsx(t,{value:"Product Manager",children:"Product Manager"}),e.jsx(t,{value:"Engineering Manager",children:"Engineering Manager"}),e.jsx(t,{value:"Head of Marketing",children:"Head of Marketing"}),e.jsx(t,{value:"Head of Sales",children:"Head of Sales"}),e.jsx(t,{value:"Designer",children:"Designer"}),e.jsx(t,{value:"Developer",children:"Developer"}),e.jsx(t,{value:"Business Development",children:"Business Development"}
18),e.jsx(t,{value:"Advisor",children:"Advisor"}),e.jsx(t,{value:"Board Member",children:"Board Member"}),e.jsx(t,{value:"Intern",children:"Intern"}),e.jsx(t,{value:"Other",children:"Other"})]})]}),e.jsx(l,{size:"sm",variant:"ghost",onClick:i,className:"h-8 w-8 p-0 hover:bg-accent hover:text-accent-foreground",children:e.jsx(ye,{className:"w-4 h-4"})}),e.jsx(l,{size:"sm",variant:"ghost",onClick:D,className:"h-8 w-8 p-0 hover:bg-destructive/10 hover:text-destructive",children:e.jsx(V,{className:"w-4 h-4"})})]}):e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm font-medium text-primary",children:a.position}),e.jsx("p",{className:"text-xs text-muted-foreground",children:a.profile.email})]})]}),(p==null?void 0:p.id)!==a.id&&e.jsxs("div",{className:"flex gap-1",children:[e.jsx(l,{size:"sm",variant:"outline",onClick:()=>L(a),className:"h-9 w-9 p-0 hover:bg-accent hover:text-accent-foreground",children:e.jsx(de,{className:"w-4 h-4"})}),e.jsx(l,{size:"sm",variant:"outline",onClick:()=>_(a),className:"h-9 w-9 p-0 text-destructive hover:bg-destructive hover:text-destructive-foreground hover:border-destructive",children:e.jsx(be,{className:"w-4 h-4"})})]})]},a.id))})]})]}),e.jsx(se,{open:!!w,onOpenChange:()=>_(null),children:e.jsxs(ae,{className:"sm:max-w-md",children:[e.jsxs(re,{children:[e.jsxs(te,{className:"flex items-center gap-2",children:[e.jsx(he,{className:"w-5 h-5 text-destructive"}),"Remove Team Member"]}),e.jsxs(ie,{children:["Are you sure you want to remove ",w==null?void 0:w.profile.name," from ",u,"? This action cannot be undone."]})]}),e.jsxs("div",{className:"flex gap-2 pt-4",children:[e.jsx(l,{variant:"outline",onClick:()=>_(null),className:"flex-1",children:"Cancel"}),e.jsx(l,{variant:"destructive",onClick:()=>w&&j(w.id),className:"flex-1",children:"Remove Member"})]})]})})]})}function Gs(){const{companyId:g}=ue(),u=pe(),{user:x,profile:k}=je(),{toast:B}=K(),[h,f]=c.useState(!0),[s,o]=c.useState(null),[m,v]=c.useState(null),[P,p]=c.useState([]),[N,y]=c.useState(!1),[S,w]=c.useState(0);c.useEffect(()=>{if(!x){u("/login");return}if(!g){u("/dashboard/company");return}_()},[x,g,u]);const _=async()=>{var n;if(!(!(k!=null&&k.id)||!g))try{const{data:r,error:M}=await b.from("companies").select("*").eq("id",g).single();if(M)throw M;const{data:j,error:L}=await b.from("company_members").select(` 19 id, 20 position, 21 is_primary, 22 start_date, 23 end_date, 24 description, 25 company:companies (*) 26 `).eq("profile_id",k.id).eq("company_id",g).single();if(L&&L.code!=="PGRST116")throw L;const{data:i,error:D}=await b.from("user_roles").select(` 27 id, 28 role, 29 status, 30 created_at, 31 event:events ( 32 id, 33 title, 34 description, 35 location, 36 start_date, 37 end_date, 38 status, 39 visibility 40 ) 41 `).eq("company_id",g).order("created_at",{ascending:!1});D&&D.code!=="PGRST116"&&console.error("Error fetching events:",D);const a={...r,custom_links:Array.isArray(r.custom_links)?r.custom_links:[]};if(r.city_id){const{data:T}=await b.from("cities_with_countries").select("name, country").eq("id",r.city_id).single();T&&(a.city_display=`${T.name}, ${T.country}`)}const d=j?{id:j.id,position:j.position,is_primary:j.is_primary,start_date:j.start_date,end_date:j.end_date,description:j.description,company:{...j.company,custom_links:Array.isArray((n=j.company)==null?void 0:n.custom_links)?j.company.custom_links:[]}}:null;o(a),v(d),p(i||[])}catch(r){console.error("Error fetching company:",r),B.error({title:"Failed to load company",description:"Please try again later."}),u("/dashboard/company")}finally{f(!1)}};if(!x)return null;const E={id:x.id,name:x.name,email:x.email,avatar:void 0,roles:[],primaryRole:"visitor"};return h?e.jsx(U,{user:E,hideSidebar:!0,children:e.jsx("div",{className:"max-w-6xl mx-auto space-y-6",children:e.jsxs("div",{className:"animate-pulse",children:[e.jsx("div",{className:"h-8 bg-muted rounded w-64 mb-4"}),e.jsx("div",{className:"h-4 bg-muted rounded w-96 mb-8"}),e.jsxs("div",{className:"grid gap-6 md:grid-cols-3",children:[e.jsx("div",{className:"md:col-span-2",children:e.jsx("div",{className:"h-96 bg-muted rounded"})}),e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{className:"h-48 bg-muted rounded"}),e.jsx("div",{className:"h-32 bg-muted rounded"})]})]})]})})}
41):s?e.jsx(U,{user:E,hideSidebar:!0,children:e.jsxs("div",{className:"max-w-6xl mx-auto space-y-6",children:[e.jsx("div",{className:"flex items-center gap-4 mb-6",children:e.jsxs(l,{variant:"ghost",size:"sm",onClick:()=>u("/dashboard/company"),className:"flex items-center gap-2",children:[e.jsx(Z,{className:"w-4 h-4"}),"Back to Companies"]})}),e.jsxs("div",{className:"flex flex-col md:flex-row gap-6 items-start",children:[e.jsxs("div",{className:"flex items-start gap-4 flex-1",children:[e.jsxs(q,{className:"h-20 w-20 border-2",children:[e.jsx(ge,{src:s.logo||void 0,alt:s.name}),e.jsx(H,{className:"bg-primary/10 text-primary font-bold text-xl",children:s.name.slice(0,2).toUpperCase()})]}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("h1",{className:"text-3xl font-bold text-foreground",children:s.name}),e.jsx(C,{variant:"outline",className:"capitalize",children:s.status}),s.company_type&&e.jsx(C,{variant:"secondary",className:"capitalize",children:s.company_type.replace("_"," ")}),e.jsx(C,{variant:"secondary",className:"capitalize",children:s.visibility||"Public"})]}),s.tagline&&e.jsx("p",{className:"text-lg text-muted-foreground mb-3",children:s.tagline}),m&&e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsxs(C,{variant:"default",className:"text-sm",children:[m.position,m.is_primary&&" (Primary)"]}),(m.start_date||m.end_date)&&e.jsxs("span",{className:"text-sm text-muted-foreground",children:[m.start_date&&new Date(m.start_date).toLocaleDateString(),m.start_date&&!m.end_date&&" - Present",m.end_date&&` - ${new Date(m.end_date).toLocaleDateString()}`]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-4 text-sm text-muted-foreground",children:[s.city_display&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(ee,{className:"w-4 h-4"}),e.jsx("span",{children:s.city_display})]}),s.founded_year&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx($,{className:"w-4 h-4"}),e.jsxs("span",{children:["Founded ",s.founded_year]})]}),s.team_size&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(G,{className:"w-4 h-4"}),e.jsxs("span",{children:[s.team_size," team members"]})]})]})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(l,{variant:"outline",size:"sm",onClick:()=>y(!0),children:[e.jsx(Q,{className:"w-4 h-4 mr-2"}),"Invite Team Member"]}),e.jsxs(l,{variant:"outline",size:"sm",onClick:()=>u(`/dashboard/company/${s.id}/edit`),children:[e.jsx(de,{className:"w-4 h-4 mr-2"}),"Edit Company"]})]})]}),e.jsxs("div",{className:"grid gap-6 md:grid-cols-3",children:[e.jsxs("div",{className:"md:col-span-2 space-y-6",children:[e.jsxs(I,{children:[e.jsx(F,{children:e.jsx(O,{children:"About"})}),e.jsxs(A,{className:"space-y-4",children:[s.description?e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:s.description}):e.jsx("p",{className:"text-muted-foreground italic",children:"No description provided yet."}),s.problem&&e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold mb-2",children:"Problem"}),e.jsx("p",{className:"text-muted-foreground",children:s.problem})]}),s.solution&&e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold mb-2",children:"Solution"}),e.jsx("p",{className:"text-muted-foreground",children:s.solution})]})]})]}),e.jsxs(I,{children:[e.jsx(F,{children:e.jsx(O,{children:"Business Details"})}),e.jsx(A,{className:"space-y-4",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.business_model&&e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold mb-1",children:"Business Model"}),e.jsx("p",{className:"text-muted-foreground",children:s.business_model})]}),s.target_market&&e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold mb-1",children:"Target Market"}),e.jsx("p",{className:"text-muted-foreground",children:s.target_market})]}),s.funding_stage&&e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold mb-1",children:"Funding Stage"}),e.jsx("p",{className:"text-muted-foreground",children:s.funding_stage})]}),s.traction&&e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold mb-1",children:"Traction"}),e.jsx("p",{className:"text-muted-foreground",children:s.traction})]})]})})]}),e.jsxs(I,{children:[e.jsxs(F,{children:[e.jsx(O,{children:"Events & Participation"}),e.jsx(fe,{children:"Events where this company has user roles"})]}),e.jsx(A,{children:P.length>0?e.jsx("div",{className:"space-y-4",children:P.map(n=>{const r=n.event;return r?e.jsx("div",{className:"border rounded-lg p-4 hover:bg-muted/50 transition-colors",children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("h4",{className:"font-semibold text-foreground",children:r.title}),e.jsx(C,{variant:"outline",className:"capitalize text-xs",children:n.role.replace("_"," ")}),e.jsx(C,{variant:n.status==="accepted"?"default":n.status==="pending"?"secondary":"destructive",className:"text-xs",children:n.status})]}),r.description&&e.jsx("p",{className:"text-sm text-muted-foreground mb-2 line-clamp-2",children:r.description}),e.jsxs("div",{className:"flex items-center gap-4 text-xs text-muted-foreground",children:[r.location&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(ee,{className:"w-3 h-3"}),e.jsx("span",{children:r.location})]}),r.start_date&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx($,{className:"w-3 h-3"}),e.jsxs("span",{children:[new Date(r.start_date).toLocaleDateString(),r.end_date&&r.start_date!==r.end_date&&` - ${new Date(r.end_date).toLocaleDateString()}`]})]}),e.jsx(C,{variant:"outline",className:"text-xs",children:r.status})]})]}),e.jsxs(l,{variant:"outline",size:"sm",onClick:()=>{const M=r.title.toLowerCase().replace(/\s+/g,"-");u(`/dashboard/${M}/startups/profile`)},children:[e.jsx(_e,{className:"w-4 h-4 mr-1"}),"View"]}
41)]})},n.id):null})}):e.jsxs("div",{className:"text-center py-8",children:[e.jsx($,{className:"w-12 h-12 mx-auto text-muted-foreground mb-3"}),e.jsx("p",{className:"text-muted-foreground",children:"This company is not participating in any events yet."})]})})]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsx(De,{companyId:s.id,companyName:s.name,onTeamUpdate:_,onInviteClick:()=>y(!0),refreshTrigger:S}),e.jsxs(I,{children:[e.jsx(F,{children:e.jsx(O,{children:"Quick Links"})}),e.jsxs(A,{className:"space-y-3",children:[s.website&&e.jsx(l,{variant:"outline",size:"sm",className:"w-full justify-start",asChild:!0,children:e.jsxs("a",{href:s.website,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(Ce,{className:"w-4 h-4 mr-2"}),"Website",e.jsx(z,{className:"w-3 h-3 ml-auto"})]})}),s.linkedin&&e.jsx(l,{variant:"outline",size:"sm",className:"w-full justify-start",asChild:!0,children:e.jsxs("a",{href:s.linkedin,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(ke,{className:"w-4 h-4 mr-2"}),"LinkedIn",e.jsx(z,{className:"w-3 h-3 ml-auto"})]})}),s.twitter&&e.jsx(l,{variant:"outline",size:"sm",className:"w-full justify-start",asChild:!0,children:e.jsxs("a",{href:s.twitter,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(Se,{className:"w-4 h-4 mr-2"}),"Twitter",e.jsx(z,{className:"w-3 h-3 ml-auto"})]})}),s.facebook&&e.jsx(l,{variant:"outline",size:"sm",className:"w-full justify-start",asChild:!0,children:e.jsxs("a",{href:s.facebook,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(R,{className:"w-4 h-4 mr-2"}),"Facebook",e.jsx(z,{className:"w-3 h-3 ml-auto"})]})}),s.instagram&&e.jsx(l,{variant:"outline",size:"sm",className:"w-full justify-start",asChild:!0,children:e.jsxs("a",{href:s.instagram,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(R,{className:"w-4 h-4 mr-2"}),"Instagram",e.jsx(z,{className:"w-3 h-3 ml-auto"})]})}),s.custom_links&&s.custom_links.length>0&&e.jsx(e.Fragment,{children:s.custom_links.map((n,r)=>n.url&&e.jsx(l,{variant:"outline",size:"sm",className:"w-full justify-start",asChild:!0,children:e.jsxs("a",{href:n.url,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(R,{className:"w-4 h-4 mr-2"}),n.title,e.jsx(z,{className:"w-3 h-3 ml-auto"})]})},r))}),!s.website&&!s.linkedin&&!s.twitter&&!s.facebook&&!s.instagram&&(!s.custom_links||s.custom_links.length===0)&&e.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No links added yet"})]})]}),(s.industry||s.technologies)&&e.jsxs(I,{children:[e.jsx(F,{children:e.jsx(O,{children:"Industry & Tech"})}),e.jsxs(A,{className:"space-y-4",children:[s.industry&&s.industry.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold mb-2",children:"Industry"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:s.industry.map((n,r)=>e.jsx(C,{variant:"secondary",className:"text-xs",children:n},r))})]}),s.technologies&&s.technologies.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold mb-2",children:"Technologies"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:s.technologies.map((n,r)=>e.jsx(C,{variant:"outline",className:"text-xs",children:n},r))})]})]})]}),(s.demo_video||s.pitch_deck)&&e.jsxs(I,{children:[e.jsx(F,{children:e.jsx(O,{children:"Resources"})}),e.jsxs(A,{className:"space-y-3",children:[s.demo_video&&e.jsx(l,{variant:"outline",size:"sm",className:"w-full justify-start",asChild:!0,children:e.jsxs("a",{href:s.demo_video,target:"_blank",rel:"noopener noreferrer",children:["Demo Video",e.jsx(z,{className:"w-3 h-3 ml-auto"})]})}),s.pitch_deck&&e.jsx(l,{variant:"outline",size:"sm",className:"w-full justify-start",asChild:!0,children:e.jsxs("a",{href:s.pitch_deck,target:"_blank",rel:"noopener noreferrer",children:["Pitch Deck",e.jsx(z,{className:"w-3 h-3 ml-auto"})]})})]})]})]})]}),s&&e.jsx(Ee,{isOpen:N,onClose:()=>y(!1),companyId:s.id,companyName:s.name,onSuccess:()=>{_(),w(n=>n+1)}})]})}):e.jsx(U,{user:E,hideSidebar:!0,children:e.jsxs("div",{className:"max-w-6xl mx-auto text-center py-12",children:[e.jsx(we,{className:"w-16 h-16 mx-auto text-muted-foreground mb-4"}),e.jsx("h1",{className:"text-2xl font-bold mb-2",children:"Company not found"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:"The company you're looking for doesn't exist or you don't have access to it."}),e.jsxs(l,{onClick:()=>u("/dashboard/company"),children:[e.jsx(Z,{className:"w-4 h-4 mr-2"}),"Back to My Companies"]})]})})}export{Gs 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.