PageSourceSearch

https://careerlaunch.ai/assets/Networking-Cu23UDUg.js

js careerlaunch.ai collected 2026-10-05 11:54:24 UTC 70,485 bytes, 133 lines download raw bytes

1import{c as Ss,a as le,r as d,j as e,a1 as me,a2 as ue,a3 as he,a4 as pe,M as se,a5 as Ts,ay as Oe,ad as be,l as y,p as S,d as oe,I as $,T as Ce,B as D,z as ce,s as E,e as V,f as Se,h as Te,x as ge,i as as,k as W,cC as ts,X as _e,P as Es,J as rs,Y as Me,aO as is,ap as ne,A as fe,m as J,b as xe,G as As,ah as X,v as Ls,aj as K,aT as Ps,aV as ke,ai as Rs,Q as Ds,a0 as Us,E as $s,ao as Os,o as ie,am as Fe,F as Ye,aA as Ms,q as Fs,N as Ys,O as qs,V as Hs,ac as Z,cD as qe,n as Bs}from"./index-BIqWDMxQ.js";import{e as Vs}from"./exportUtils-DlvwQuc1.js";import{T as ns,a as ls,b as ae,c as te}from"./tabs-B3xt6REk.js";import{C as Gs,S as He,a as Be,b as Ve,c as Ge,d as We}from"./select-B9wxlFZh.js";import{W as Ws}from"./wand-sparkles-DciDjGoj.js";import{U as Ie}from"./user-plus-BuwxHxq9.js";import{M as zs}from"./message-square-D4HC8HHY.js";import{U as ze}from"./upload-jqXEC-hN.js";import{C as Js}from"./circle-check-big-CcU_x1rZ.js";import{M as Qs}from"./map-pin-Cz2r-7w0.js";import{G as Xs}from"./globe-BhVndIlK.js";import{H as Je}from"./heart-I-TcXhfh.js";import{S as Ks}from"./scale-B220Fqvn.js";import{L as Zs}from"./lightbulb-CsWAogSf.js";import{A as Qe}from"./award-BGmWP3EF.js";import{P as Xe}from"./plus-B4MPw1Xv.js";import{P as we}from"./pencil-BENeT_nE.js";import{G as ea}from"./grip-vertical-Zbyj0c2e.js";import{E as sa}from"./ellipsis-CI177oVG.js";import{T as aa}from"./tag-DW4RuSRc.js";import{T as Ke}from"./trash-2-bQ7EzArG.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 Ze=Ss("Newspaper",[["path",{d:"M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-2 2Zm0 0a2 2 0 0 1-2-2v-9c0-1.1.9-2 2-2h2",key:"7pis2x"}],["path",{d:"M18 14h-8",key:"sponae"}],["path",{d:"M15 18h-5",key:"95g1m2"}],["path",{d:"M10 6h8v4h-8V6Z",key:"smlsk5"}]]),ta=[{id:"job_support",name:"Request Job Support",description:"Ask for career guidance and warm introduction",icon:Ie},{id:"networking",name:"Networking Request",description:"Request a virtual coffee chat",icon:zs},{id:"coaching_request",name:"Coaching Request (Mentor Invite)",description:"Invite them to mentor (>$100/hr) because a client needs support",icon:ce},{id:"mentor_invite",name:"Mentor Invite",description:"Invite them to join Career Launch as a mentor",icon:ce}],ra=[{name:"LinkedIn Connection Request",template:"Hi [NAME]! I came across your profile and I'm really impressed by your work at [COMPANY]. I'm currently exploring opportunities in [INDUSTRY] and would love to connect and learn from your experience. Looking forward to connecting!"},{name:"LinkedIn DM - Career Advice",template:"Hi [NAME], I hope you don't mind me reaching out directly. I've been following your career journey and I'm really inspired by what you've accomplished at [COMPANY]. I'm currently looking for [TARGET_ROLE] opportunities and would really appreciate any insights or advice you could share. Would you be open to a 15-minute call sometime? Thank you!"},{name:"Cold Email - Warm Introduction",template:`Subject: Quick Question from a [YOUR_TITLE] in [YOUR_INDUSTRY]
7
8Hi [NAME],
9
10I hope this email finds you well! My name is [YOUR_NAME] and I'm currently a [YOUR_TITLE]. I came across your profile and was really impressed by your experience at [COMPANY].
11
12I'm reaching out because I'm exploring opportunities in [TARGET_ROLE] and I'd love to get your perspective on the industry. Would you be open to a brief 15-minute chat?
13
14I know your time is valuable, so even a quick email response would be incredibly helpful.
15
16Thanks so much for considering!
17
18Best,
19[YOUR_NAME]`},{name:"Referral Request",template:`Hi [NAME],
20
21I hope you're doing well! I noticed that you work at [COMPANY] and I wanted to reach out because I'm very interested in a [TARGET_ROLE] position there.
22
23I've been following the company's work on [SPECIFIC_PROJECT] and I'm really excited about the direction you're heading.
24
25Would you be open to chatting briefly about your experience there? And if you think I might be a good fit, I'd be grateful if you could refer me internally.
26
27I've attached my resume for reference. Thanks so much for your time!
28
29Best regards,
30[YOUR_NAME]`}];function ia({contact:l,isOpen:N,onClose:T,senderName:L,senderTitle:F,senderLinkedIn:r,senderTargetRole:w,initialTemplate:A}){const{toast:O}
30=le(),[q,P]=d.useState("email"),[Y,c]=d.useState("job_support"),[h,g]=d.useState(""),[b,f]=d.useState(""),[C,j]=d.useState(!1),[a,i]=d.useState(!1),[p,n]=d.useState(!1);d.useEffect(()=>{N&&A&&(c(A),P("email"),g(""),f(""),n(!1))},[N,A]);const R=async()=>{if(!(l!=null&&l.email)){O({title:"No Email",description:"This contact doesn't have an email address",variant:"destructive"});return}j(!0);try{const{data:u,error:M}=await E.functions.invoke("send-outreach-email",{body:{recipientEmail:l.email,recipientName:l.full_name||"there",senderName:L,senderLinkedIn:r,senderTitle:F,senderTargetRole:w,companyName:l.company_name,emailType:Y,customSubject:h||void 0,customBody:b||void 0}});if(M)throw M;O({title:"Email Sent!",description:`Your outreach email has been sent to ${l.full_name||l.email}`}),T()}catch(u){O({title:"Failed to Send",description:u.message||"Could not send the email. Please try again.",variant:"destructive"})}finally{j(!1)}},_=async()=>{if(!(l!=null&&l.email)){O({title:"No Email",description:"This contact doesn't have an email address",variant:"destructive"});return}i(!0);try{const{data:u,error:M}=await E.functions.invoke("draft-outreach-email",{body:{recipientName:l.full_name||"there",recipientEmail:l.email,recipientCompany:l.company_name||void 0,senderName:L,senderTitle:F,senderLinkedIn:r,senderTargetRole:w,emailType:Y}});if(M)throw M;if(!(u!=null&&u.subject)||!(u!=null&&u.body))throw new Error("Draft generation failed");g(u.subject),f(u.body),n(!0),O({title:"Draft ready",description:"Edit it if needed, then hit Send."})}catch(u){O({title:"Draft failed",description:u.message||"Could not generate draft. Please try again.",variant:"destructive"})}finally{i(!1)}},k=u=>{var m;const M=u.replace(/\[NAME\]/g,((m=l==null?void 0:l.full_name)==null?void 0:m.split(" ")[0])||"there").replace(/\[COMPANY\]/g,(l==null?void 0:l.company_name)||"[Company]").replace(/\[YOUR_NAME\]/g,L).replace(/\[YOUR_TITLE\]/g,F||"[Your Title]").replace(/\[YOUR_INDUSTRY\]/g,w||"[Your Industry]").replace(/\[TARGET_ROLE\]/g,w||"[Target Role]").replace(/\[INDUSTRY\]/g,w||"[Industry]");navigator.clipboard.writeText(M),O({title:"Copied!",description:"Template copied to clipboard with your details filled in"})};return l?e.jsx(me,{open:N,onOpenChange:T,children:e.jsxs(ue,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[e.jsxs(he,{children:[e.jsxs(pe,{className:"flex items-center gap-2",children:[e.jsx(se,{className:"h-5 w-5 text-primary"}),"Reach Out to ",l.full_name||"Contact"]}),e.jsx(Ts,{children:"Send an outreach email or use templates for other platforms"})]}),e.jsxs(ns,{value:q,onValueChange:P,className:"mt-4",children:[e.jsxs(ls,{className:"grid w-full grid-cols-2",children:[e.jsxs(ae,{value:"email",className:"gap-2",children:[e.jsx(Oe,{className:"h-4 w-4"}),"Send Email"]}),e.jsxs(ae,{value:"templates",className:"gap-2",children:[e.jsx(be,{className:"h-4 w-4"}),"Copy Templates"]})]}),e.jsxs(te,{value:"email",className:"space-y-4 mt-4",children:[e.jsxs("div",{className:"flex items-center gap-3 p-3 bg-muted/50 rounded-lg",children:[e.jsx("div",{className:"h-10 w-10 rounded-full bg-primary/10 flex items-center justify-center text-primary font-semibold",children:(l.full_name||"U")[0].toUpperCase()}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:l.full_name||"Unknown"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:l.email||"No email"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(y,{children:"Select Email Type"}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-2",children:ta.map(u=>{const M=u.icon,m=Y===u.id;return e.jsxs("button",{onClick:()=>c(u.id),className:`p-3 rounded-lg border text-left transition-all ${m?"border-primary bg-primary/5":"border-border hover:border-primary/50"}`,children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(M,{className:`h-4 w-4 ${m?"text-primary":"text-muted-foreground"}`}),e.jsx("span",{className:`text-sm font-medium ${m?"text-primary":""}`,children:u.name})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:u.description})]},u.id)})})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2",children:[e.jsx(y,{children:"Draft"}),e.jsxs(S,{type:"button",variant:"outline",size:"sm",className:"gap-2",onClick:_,disabled:a||!l.email,children:[a?e.jsx(oe,{className:"h-4 w-4 animate-spin"}):e.jsx(Ws,{className:"h-4 w-4"}),a?"Drafting…":"Draft with AI"]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(y,{children:"Custom Subject (optional)"}),e.jsx($,{placeholder:"Leave blank to use default subject",value:h,onChange:u=>g(u.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(y,{children:"Custom Message (optional)"}),e.jsx(Ce,{placeholder:"Leave blank to use the template. Add your own message to personalize.",value:b,onChange:u=>f(u.target.value),rows:4})]})]}),e.jsx("div",{className:"p-3 bg-primary/5 border border-primary/20 rounded-lg",children:e.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.jsx("span",{className:"font-medium text-foreground",children:"Tip:"})," The email will include your profile information and a link inviting them to join Career Launch as a mentor."]})}),e.jsxs(S,{onClick:R,disabled:C||!l.email,className:"w-full gap-2",children:[C?e.jsx(oe,{className:"h-4 w-4 animate-spin"}):e.jsx(Oe,{className:"h-4 w-4"}),C?"Sending...":"Send Email"]})]}
30),e.jsxs(te,{value:"templates",className:"space-y-4 mt-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Copy these templates for LinkedIn, email, or other platforms. Your details will be automatically filled in."}),e.jsx("div",{className:"space-y-3",children:ra.map((u,M)=>e.jsxs("div",{className:"border rounded-lg p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(D,{variant:"secondary",children:u.name}),e.jsxs(S,{size:"sm",variant:"outline",className:"gap-1",onClick:()=>k(u.template),children:[e.jsx(be,{className:"h-3 w-3"}),"Copy"]})]}),e.jsxs("pre",{className:"text-xs text-muted-foreground whitespace-pre-wrap font-sans bg-muted/50 p-3 rounded-lg",children:[u.template.substring(0,200),"..."]})]},M))})]})]})]})}):null}const na=()=>{const[l,N]=d.useState(!1),[T,L]=d.useState([]),[F,r]=d.useState(!1),[w,A]=d.useState(0),[O,q]=d.useState(""),{toast:P}=le(),Y=a=>{const i=[];let p="",n=!1;for(let R=0;R<a.length;R++){const _=a[R];_==='"'?n=!n:_===","&&!n?(i.push(p.trim().replace(/^"|"$/g,"")),p=""):p+=_}return i.push(p.trim().replace(/^"|"$/g,"")),i},c=a=>{var n,R;const i=a.trim().split(`
31`);if(i.length<2)return[];const p=[];for(let _=1;_<i.length;_++){const k=Y(i[_]),u={linkedin_url:k[1]||"",company_name:k[2]||"",full_name:k[3]||"",work_email:((n=(k[4]||"").split(",")[0])==null?void 0:n.trim())||"",personal_email:((R=(k[6]||"").split(",")[0])==null?void 0:R.trim())||"",phone:k[7]||"",title:k[9]||"",level:k[10]||"",department:k[11]||"",industry:k[12]||"",location:k[13]||"",company_domain:k[14]||""};(u.full_name||u.linkedin_url)&&p.push(u)}return p},h=d.useCallback(a=>{Array.from(a).forEach(i=>{if(!i.name.endsWith(".csv")){P({title:"Invalid file type",description:`${i.name} is not a CSV file`,variant:"destructive"});return}const p=new FileReader;p.onload=n=>{var k;const R=(k=n.target)==null?void 0:k.result,_=c(R);L(u=>[...u,{name:i.name,rows:_}]),P({title:"File parsed",description:`Found ${_.length.toLocaleString()} contacts in ${i.name}`})},p.readAsText(i)})},[P]),g=d.useCallback(a=>{a.preventDefault(),N(!1),a.dataTransfer.files.length>0&&h(a.dataTransfer.files)},[h]),b=a=>{a.target.files&&a.target.files.length>0&&h(a.target.files)},f=()=>T.reduce((a,i)=>a+i.rows.length,0),C=async()=>{if(T.length===0)return;r(!0),A(0);const a=T.flatMap(_=>_.rows),i=1e3,p=Math.ceil(a.length/i);let n=0,R=0;try{for(let _=0;_<a.length;_+=i){const k=a.slice(_,_+i),u=Math.floor(_/i)+1;q(`Processing batch ${u}/${p}...`);const{data:M,error:m}=await E.functions.invoke("import-contacts-csv",{body:{csvData:k,source:"csv-upload"}});if(m)throw console.error("Batch error:",m),m;n+=M.inserted||0,R+=M.skipped||0,A(Math.round((_+k.length)/a.length*100))}P({title:"Import complete! 🎉",description:`Added ${n.toLocaleString()} new contacts. ${R.toLocaleString()} duplicates skipped.`}),L([])}catch(_){console.error("Upload error:",_);const k=_ instanceof Error?_.message:"Unknown error";P({title:"Import failed",description:k,variant:"destructive"})}finally{r(!1),A(0),q("")}},j=a=>{L(i=>i.filter((p,n)=>n!==a))};return e.jsxs(V,{className:"glass-card",children:[e.jsxs(Se,{children:[e.jsxs(Te,{className:"flex items-center gap-2 text-foreground",children:[e.jsx(ge,{className:"w-5 h-5 text-primary"}),"Import Contacts from CSV"]}),e.jsx(as,{children:"Upload LinkedIn export CSV files to add contacts to your networking database"})]}),e.jsxs(W,{className:"space-y-4",children:[e.jsxs("div",{onDragOver:a=>{a.preventDefault(),N(!0)},onDragLeave:()=>N(!1),onDrop:g,className:`
32            border-2 border-dashed rounded-xl p-8 text-center transition-all cursor-pointer
33            ${l?"border-primary bg-primary/5":"border-border hover:border-primary/50 hover:bg-muted/50"}
34          `,children:[e.jsx("input",{type:"file",accept:".csv",multiple:!0,onChange:b,className:"hidden",id:"contacts-csv-upload"}),e.jsxs("label",{htmlFor:"contacts-csv-upload",className:"cursor-pointer",children:[e.jsx(ze,{className:"w-10 h-10 mx-auto mb-3 text-muted-foreground"}),e.jsx("p",{className:"font-medium text-foreground",children:"Drop your CSV files here"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"or click to browse (supports multiple files)"})]})]}),T.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"Files ready to import:"}),T.map((a,i)=>e.jsxs("div",{className:"flex items-center justify-between p-3 bg-muted rounded-lg",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(ts,{className:"w-6 h-6 text-primary"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-sm text-foreground",children:a.name}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[a.rows.length.toLocaleStr
34ing()," contacts"]})]})]}),e.jsx(S,{variant:"ghost",size:"icon",onClick:()=>j(i),disabled:F,children:e.jsx(_e,{className:"w-4 h-4"})})]},i)),e.jsxs("div",{className:"flex items-center gap-2 p-3 bg-success/10 rounded-lg",children:[e.jsx(Js,{className:"w-5 h-5 text-success"}),e.jsxs("span",{className:"text-sm font-medium text-success",children:["Total: ",f().toLocaleString()," contacts ready to import"]})]})]}),F&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(Es,{value:w}),e.jsx("p",{className:"text-xs text-center text-muted-foreground",children:O||`Uploading... ${w}%`})]}),T.length>0&&e.jsx(S,{onClick:C,disabled:F||T.length===0,className:"w-full",size:"lg",children:F?e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-4 h-4 mr-2 animate-spin"}),"Importing..."]}):e.jsxs(e.Fragment,{children:[e.jsx(ze,{className:"w-4 h-4 mr-2"}),"Import ",f().toLocaleString()," Contacts"]})}),e.jsx("div",{className:"pt-4 border-t border-border",children:e.jsx("p",{className:"text-xs text-muted-foreground",children:"Supported format: LinkedIn Sales Navigator / Apollo.io export CSV files with columns: LinkedIn URL, Company Name, Full Name, Work Emails, Personal Emails, Title, Industry, Location, etc."})})]})]})},B=[{id:"first_invite",name:"Connector",type:"referral",points:10,icon:"🔗",description:"Sent your first platform invite"},{id:"invite_5",name:"Networker",type:"referral",points:25,icon:"🌐",description:"Invited 5 people to the platform"},{id:"invite_10",name:"Ambassador",type:"referral",points:50,icon:"🏆",description:"Invited 10 people to the platform"},{id:"invite_25",name:"Growth Champion",type:"referral",points:100,icon:"👑",description:"Invited 25 people to the platform"},{id:"first_conversion",name:"Influencer",type:"referral",points:75,icon:"⭐",description:"Your first referral signed up"},{id:"conversion_5",name:"Talent Scout",type:"referral",points:150,icon:"🎯",description:"5 of your referrals signed up"},{id:"first_share",name:"Social Butterfly",type:"engagement",points:10,icon:"🦋",description:"Shared content on social media"},{id:"share_10",name:"Viral Voice",type:"engagement",points:50,icon:"📢",description:"Shared 10 times on social media"},{id:"first_contact",name:"Network Builder",type:"activity",points:10,icon:"👤",description:"Added your first networking contact"},{id:"contacts_10",name:"Connection Master",type:"activity",points:30,icon:"🤝",description:"Built a network of 10+ contacts"},{id:"resume_complete",name:"Resume Pro",type:"milestone",points:20,icon:"📄",description:"Completed your resume"},{id:"interview_ace",name:"Interview Ace",type:"milestone",points:30,icon:"🎤",description:"Scored 80%+ on a practice interview"},{id:"assessment_complete",name:"Skill Master",type:"activity",points:15,icon:"📊",description:"Completed a skills assessment"}];function la(){const{user:l,profile:N}
34=rs(),[T,L]=d.useState({invites:{totalSent:0,opened:0,clicked:0,signedUp:0,converted:0},achievements:[],totalPoints:0,shareCount:0,viralCoefficient:0}),[F,r]=d.useState(!0),w=d.useCallback(async()=>{if(!l){r(!1);return}try{const{data:c}=await E.from("platform_invites").select("status").eq("inviter_id",l.id),h={totalSent:(c==null?void 0:c.length)||0,opened:(c==null?void 0:c.filter(j=>j.status==="opened"||j.status==="clicked"||j.status==="signed_up"||j.status==="converted").length)||0,clicked:(c==null?void 0:c.filter(j=>j.status==="clicked"||j.status==="signed_up"||j.status==="converted").length)||0,signedUp:(c==null?void 0:c.filter(j=>j.status==="signed_up"||j.status==="converted").length)||0,converted:(c==null?void 0:c.filter(j=>j.status==="converted").length)||0},{data:g}=await E.from("user_achievements").select("*").eq("user_id",l.id),b=B.map(j=>{var a;return{...j,unlocked:(g==null?void 0:g.some(i=>i.achievement_id===j.id))||!1,earnedAt:(a=g==null?void 0:g.find(i=>i.achievement_id===j.id))==null?void 0:a.earned_at}}),{count:f}=await E.from("viral_shares").select("*",{count:"exact",head:!0}).eq("user_id",l.id),C=h.totalSent>0?h.signedUp/h.totalSent:0;L({invites:h,achievements:b,totalPoints:(g==null?void 0:g.reduce((j,a)=>j+(a.points||0),0))||0,shareCount:f||0,viralCoefficient:C})}catch(c){console.error("Error fetching growth stats:",c)}finally{r(!1)}},[l]);d.useEffect(()=>{w()},[w]);const A=async(c,h,g="both",b="manual",f)=>{if(l)try{await E.from("platform_invites").insert({inviter_id:l.id,inviter_email:l.email,recipient_email:c,recipient_name:h,invite_type:g,source:b,referral_code:f,status:"sent"}),await q()}catch(C){console.error("Error tracking invite:",C)}},O=async(c,h,g,b)=>{if(l)try{await E.from("viral_shares").insert({user_id:l.id,share_type:c,share_platform:h,content_id:g,share_url:b}),await E.from("growth_events").insert({user_id:l.id,event_type:"share",event_data:{share_type:c,platform:h}}),await q()}catch(f){console.error("Error tracking share:",f)}},q=async()=>{if(l)try{const{data:c}=await E.from("platform_invites").select("status").eq("inviter_id",l.id),{data:h}=await E.from("viral_shares").select("id").eq("user_id",l.id),{data:g}=await E.from("networking_contacts").select("id").eq("user_id",l.id),{data:b}=await E.from("user_achievements").select("achievement_id").eq("user_id",l.id),f=(b==null?void 0:b.map(n=>n.achievement_id))||[],C=(c==null?void 0:c.length)||0,j=(c==null?void 0:c.filter(n=>n.status==="signed_up"||n.status==="converted").length)||0,a=(h==null?void 0:h.length)||0,i=(g==null?void 0:g.length)||0,p=[];C>=1&&!f.includes("first_invite")&&p.push(B.find(n=>n.id==="first_invite")),C>=5&&!f.includes("invite_5")&&p.push(B.find(n=>n.id==="invite_5")),C>=10&&!f.includes("invite_10")&&p.push(B.find(n=>n.id==="invite_10")),C>=25&&!f.includes("invite_25")&&p.push(B.find(n=>n.id==="invite_25")),j>=1&&!f.includes("first_conversion")&&p.push(B.find(n=>n.id==="first_conversion")),j>=5&&!f.includes("conversion_5")&&p.push(B.find(n=>n.id==="conversion_5")),a>=1&&!f.includes("first_share")&&p.push(B.find(n=>n.id==="first_share")),a>=10&&!f.includes("share_10")&&p.push(B.find(n=>n.id==="share_10")),i>=1&&!f.includes("first_contact")&&p.push(B.find(n=>n.id==="first_contact")),i>=10&&!f.includes("contacts_10")&&p.push(B.find(n=>n.id==="contacts_10"));for(const n of p)n&&(await E.from("user_achievements").insert({user_id:l.id,achievement_id:n.id,achievement_name:n.name,achievement_type:n.type,points:n.points}),Me.success(`🏆 Achievement Unlocked: ${n.name}!`,{description:`+${n.points} points - ${n.description}`}));p.length>0&&w()}catch(c){console.error("Error checking achievements:",c)}},P=(c,h)=>{const g=window.location.origin;switch(c){case"achievement":return{text:`🎉 I just unlocked the "${h.name}" achievement on Career Launch! ${h.icon}
35
36Join me and accelerate your career with AI-powered tools.`,url:`${g}/auth`,hashtags:["CareerLaunch","CareerGrowth","JobSearch"]};case"interview_score":return{text:`🎤 Just scored ${h.score}% on my ${h.category} interview practice on Career Launch!
37
38Prepare for your interviews with AI-powered coaching.`,url:`${g}/auth`,hashtags:["InterviewPrep","CareerLaunch","JobInterview"]};case"referral":return{text:`I'm using Career Launch to accelerate my job search with AI! 🚀
39
40Join me and get access to:
41✨ AI resume optimization
42🎯 High-paying job matches
43🎤 Interview coaching
44👥 Expert mentorship`,url:h.referralUrl||`${g}/auth`,hashtags:["CareerLaunch","JobSearch","AI"]};case"job_posting":return{text:`Check out this opportunity: ${h.title} at ${h.company}! 💼
45
46Find more high-paying jobs on Career Launch.`,url:`${g}/job-board`,hashtags:["Jobs","Hiring","CareerOpportunity"]};default:return{text:"Accelerate your career with Career Launch - AI-powered job search, interview prep, and expert mentorship! 🚀",url:`${g}/auth`,hashtags:["CareerLaunch","CareerGrowth"]}}};return{stats:T,isLoading:F,trackInvite:A,trackShare:O,shareOnPlatform:async(c,h,g)=>{const b=P(h,g),f=encodeURIComponent(b.text),C=encodeURIComponent(b.url),j=b.hashtags.join(",");let a="";switch(c){case"twitter":a=`https://twitter.com/intent/tweet?text=${f}&url=${C}&hashtags=${j}`;break;case"linkedin":a=`https://www.linkedin.com/sharing/share-offsite/?url=${C}`;break;case"facebook":a=`https://www.facebook.com/sharer/sharer.php?u=${C}&quote=${f}`;break;case"whatsapp":a=`https://wa.me/?text=${f}%20${C}`;break;case"email":a=`mailto:?subject=${encodeURIComponent("Check out Career Launch!")}&body=${f}%20${C}`;break;case"copy_link":await navigator.clipboard.writeText(`${b.text}
47
48${b.url}`),Me.success("Link copied to clipboard!"),await O(h,c,g.id,b.url);return}a&&(window.open(a,"_blank","width=600,height=400"),await O(h,c,g.id,b.url))},checkAndAwardAchievements:q,generateShareContent:P,refreshStats:w,allAchievements:B}}function oa(){var c,h,g,b,f,C,j;const{toast:l}
48=le(),[N,T]=d.useState(""),[L,F]=d.useState(!1),[r,w]=d.useState(null),[A,O]=d.useState(new Set(["overview","culture","products","hiring"])),q=a=>{O(i=>{const p=new Set(i);return p.has(a)?p.delete(a):p.add(a),p})},P=async()=>{if(!N.trim()){l({title:"Input required",description:"Please enter a company name or website URL",variant:"destructive"});return}F(!0),w(null);try{const a=N.includes(".")||N.includes("://"),{data:i,error:p}=await E.functions.invoke("research-company",{body:a?{companyUrl:N}:{companyName:N}});if(p)throw p;if(!i.success)throw new Error(i.error||"Failed to research company");w({data:i.data,markdown:i.markdown,sourceUrl:i.sourceUrl}),l({title:"Research complete",description:`Found information about ${i.data.name}`})}catch(a){console.error("Error researching company:",a),l({title:"Research failed",description:a instanceof Error?a.message:"Could not research this company",variant:"destructive"})}finally{F(!1)}},Y=({id:a,icon:i,title:p,subtitle:n})=>e.jsxs(Rs,{className:"flex items-center justify-between w-full p-4 hover:bg-muted/50 rounded-lg transition-colors",onClick:()=>q(a),children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 rounded-lg bg-primary/10",children:e.jsx(i,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{className:"text-left",children:[e.jsx("h3",{className:"font-semibold",children:p}),n&&e.jsx("p",{className:"text-sm text-muted-foreground",children:n})]})]}),A.has(a)?e.jsx(Gs,{className:"h-5 w-5 text-muted-foreground"}):e.jsx(Ds,{className:"h-5 w-5 text-muted-foreground"})]});return e.jsxs("div",{className:"space-y-6",children:[e.jsxs(V,{children:[e.jsxs(Se,{className:"pb-4",children:[e.jsxs(Te,{className:"flex items-center gap-2",children:[e.jsx(is,{className:"h-5 w-5 text-primary"}),"Company Research"]}),e.jsx(as,{children:"Enter a company name or website URL to get deep insights about culture, products, and hiring"})]}),e.jsx(W,{children:e.jsxs("div",{className:"flex gap-3",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(ne,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx($,{placeholder:"e.g., stripe.com or Stripe",value:N,onChange:a=>T(a.target.value),onKeyDown:a=>a.key==="Enter"&&P(),className:"pl-10"})]}),e.jsx(S,{onClick:P,disabled:L,className:"gap-2",children:L?e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"h-4 w-4 animate-spin"}),"Researching..."]}):e.jsxs(e.Fragment,{children:[e.jsx(ce,{className:"h-4 w-4"}),"Research"]})})]})})]}),e.jsx(fe,{children:L&&e.jsx(J.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},children:e.jsx(V,{children:e.jsx(W,{className:"py-12",children:e.jsxs("div",{className:"flex flex-col items-center justify-center gap-4",children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute inset-0 rounded-full bg-primary/20 animate-ping"}),e.jsx("div",{className:"relative p-4 rounded-full bg-primary/10",children:e.jsx(ne,{className:"h-8 w-8 text-primary animate-pulse"})})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"font-medium",children:"Researching company..."}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Analyzing website, culture pages, and more"})]})]})})})})}),e.jsx(fe,{children:r&&!L&&e.jsxs(J.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"space-y-4",children:[e.jsx(V,{className:"overflow-hidden",children:e.jsxs("div",{className:"bg-gradient-to-r from-primary/10 via-primary/5 to-transparent p-6",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h2",{className:"text-2xl font-bold",children:r.data.name}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[r.data.industry&&e.jsxs(D,{variant:"secondary",className:"gap-1",children:[e.jsx(xe,{className:"h-3 w-3"}),r.data.industry]}),r.data.headquarters&&e.jsxs(D,{variant:"outline",className:"gap-1",children:[e.jsx(Qs,{className:"h-3 w-3"}),r.data.headquarters]}),r.data.employeeCount&&e.jsxs(D,{variant:"outline",className:"gap-1",children:[e.jsx(ge,{className:"h-3 w-3"}),r.data.employeeCount," employees"]}),r.data.founded&&e.jsxs(D,{variant:"outline",className:"gap-1",children:[e.jsx(As,{className:"h-3 w-3"}),"Founded ",r.data.founded]})]})]}),e.jsx(S,{variant:"outline",size:"sm",asChild:!0,children:e.jsxs("a",{href:r.sourceUrl,target:"_blank",rel:"noopener noreferrer",className:"gap-2",children:[e.jsx(Xs,{className:"h-4 w-4"}),"Visit Website"]})})]}),r.data.description&&e.jsx("p",{className:"mt-4 text-muted-foreground",children:r.data.description})]})}),e.jsx(X,{open:A.has("overview"),children:e.jsxs(V,{children:[e.jsx(Y,{id:"overview",icon:Ls,title:"Company Overview",subtitle:"Mission, values, and leadership"}),e.jsx(K,{children:e.jsxs(W,{className:"pt-0 space-y-4",children:[r.data.mission&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-muted-foreground mb-2",children:"Mission"}),e.jsx("p",{children:r.data.mission})]}),r.data.values&&r.data.values.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-muted-foreground mb-2",children:"Core Values"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:r.data.values.map((a,i)=>e.jsxs(D,{variant:"secondary",className:"gap-1",children:[e.jsx(Je,{className:"h-3 w-3"}),a]},i))})]}),r.data.leadership&&r.data.leadership.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-muted-foreground mb-2",children:"Leadership"}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-2",children:r.data.leadership.map((a,i)=>e.jsxs("div",{className:"p-3 rounded-lg bg-muted/50",children:[e.jsx("p",{className:"font-medium text-sm",children:a.name}),e.jsx("p",{className:"text-xs text-muted-foreground",children:a.title})]},i))})]})]})})]})}),e.jsx(X,{open:A.has("culture"),children:e.jsxs(V,{children:[e.jsx(Y,{id:"culture",icon:Je,title:"Culture & Work Environment",subtitle:"Benefits, work-life balance, and diversity"}),e.jsx(K,{children:e.jsxs(W,{className:"pt-0 space-y-4",children:[((c=r.data.culture)==null?void 0:c.workEnvironment)&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-muted-foreground mb-2",children:"Work Environment"}),e.jsx("p",{children:r.data.culture.workEnvironment})]}),((h=r.data.culture)==null?void 0:h.benefits)&&r.data.culture.benefits.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-muted-foreground mb-2",children:"Benefits"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:r.data.culture.benefits.map((a,i)=>e.jsxs(D,{variant:"outline",className:"gap-1",children:[e.jsx(Ps,{className:"h-3 w-3"}),a]},i))})]}),((g=r.data.culture)==null?void 0:g.workLifeBalance)&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-muted-foreground mb-2",children:"Work-Life Balance"}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(Ks,{className:"h-4 w-4 text-primary mt-1"}),e.jsx("p",{children:r.data.culture.workLifeBalance})]})]}),((b=r.data.culture)==null?void 0:b.diversity)&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-muted-foreground mb-2",children:"Diversity & Inclusion"}),e.jsx("p",{children:r.data.culture.diversity})]}),!r.data.culture&&e.jsx("p",{className:"text-muted-foreground text-sm italic",children:"Culture information not available. Try visiting their careers or about page directly."})]})})]})}),e.jsx(X,{open:A.has("products"),children:e.jsxs(V,{children:[e.jsx(Y,{id:"products",icon:Zs,title:"Products & Services",subtitle:"What the company offers"}),e.jsx(K,{children:e.jsxs(W,{className:"pt-0 space-y-4",children:[r.data.products&&r.data.products.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-muted-foreground mb-2",children:"Products"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:r.data.products.map((a,i)=>e.jsx(D,{variant:"secondary",children:a},i))})]}),r.data.services&&r.data.services.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-muted-foreground mb-2",children:"Services"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:r.data.services.map((a,i)=>e.jsx(D,{variant:"outline",children:a},i))})]}),(!r.data.products||r.data.products.length===0)&&(!r.data.services||r.data.services.length===0)&&e.jsx("p",{className:"text-muted-foreground text-sm italic",children:"Product and service information not available."})]})})]})}),e.jsx(X,{open:A.has("hiring"),children:e.jsxs(V,{children:[e.jsx(Y,{id:"hiring",icon:xe,title:"Hiring & Interview Info",subtitle:"Open roles and interview process"}),e.jsx(K,{children:e.jsxs(W,{className:"pt-0 space-y-4",children:[((f=r.data.hiringInfo)==null?void 0:f.openRoles)&&r.data.hiringInfo.openRoles.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-muted-foreground mb-2",children:"Open Roles"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:r.data.hiringInfo.openRoles.map((a,i)=>e.jsxs(D,{variant:"secondary",className:"gap-1",children:[e.jsx(xe,{className:"h-3 w-3"}),a]},i))})]}),((C=r.data.hiringInfo)==null?void 0:C.hiringProcess)&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-muted-foreground mb-2",children:"Hiring Process"}),e.jsx("p",{children:r.data.hiringInfo.hiringProcess})]}),((j=r.data.hiringInfo)==null?void 0:j.interviewTips)&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-muted-foreground mb-2",children:"Interview Tips"}),e.jsx("div",{className:"p-3 rounded-lg bg-primary/5 border border-primary/20",children:e.jsx("p",{className:"text-sm",children:r.data.hiringInfo.interviewTips})})]}),!r.data.hiringInfo&&e.jsx("p",{className:"text-muted-foreground text-sm italic",children:"Hiring information not available. Check their careers page for current openings."})]})})]})}),r.data.socialProof&&e.jsx(X,{open:A.has("social"),children:e.jsxs(V,{children:[e.jsx(Y,{id:"social",icon:Qe,title:"Recognition & Partnerships",subtitle:"Awards, partners, and notable clients"}),e.jsx(K,{children:e.jsxs(W,{className:"pt-0 space-y-4",children:[r.data.socialProof.awards&&r.data.socialProof.awards.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-muted-foreground mb-2",children:"Awards"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:r.data.socialProof.awards.map((a,i)=>e.jsxs(D,{variant:"secondary",className:"gap-1",children:[e.jsx(Qe,{className:"h-3 w-3"}),a]},i))})]}),r.data.socialProof.partnerships&&r.data.socialProof.partnerships.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-muted-foreground mb-2",children:"Partnerships"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:r.data.socialProof.partnerships.map((a,i)=>e.jsxs(D,{variant:"outline",className:"gap-1",children:[e.jsx(ke,{className:"h-3 w-3"}),a]},i))})]}),r.data.socialProof.clients&&r.data.socialProof.clients.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-muted-foreground mb-2",children:"Notable Clients"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:r.data.socialProof.clients.map((a,i)=>e.jsx(D,{variant:"outline",children:a},i))})]})]})})]})}),r.data.recentNews&&r.data.recentNews.length>0&&e.jsx(X,{open:A.has("news"),children:e.jsxs(V,{children:[e.jsx(Y,{id:"news",icon:Ze,title:"Recent News",subtitle:"Latest updates and announcements"}),e.jsx(K,{children:e.jsx(W,{className:"pt-0",children:e.jsx("ul",{className:"space-y-2",children:r.data.recentNews.map((a,i)=>e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(Ze,{className:"h-4 w-4 text-muted-foreground mt-0.5 shrink-0"}),e.jsx("span",{className:"text-sm",children:a})]},i))})})})]})})]})}),!r&&!L&&e.jsx(V,{children:e.jsx(W,{className:"py-12",children:e.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 text-center",children:[e.jsx("div",{className:"p-4 rounded-full bg-muted",children:e.jsx(ne,{className:"h-8 w-8 text-muted-foreground"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold mb-1",children:"Research Any Company"}),e.jsx("p",{className:"text-sm text-muted-foreground max-w-md",children:"Enter a company name or website URL above to get deep insights about their culture, products, hiring process, and more to help you prepare for outreach or interviews."})]})]})})})]})}const ee=[{id:"new",label:"New Contact",color:"bg-slate-500",bgColor:"bg-slate-500/10",borderColor:"border-slate-500/30"},{id:"reached_out",label:"Reached Out",color:"bg-blue-500",bgColor:"bg-blue-500/10",borderColor:"border-blue-500/30"}
48,{id:"in_conversation",label:"In Conversation",color:"bg-amber-500",bgColor:"bg-amber-500/10",borderColor:"border-amber-500/30"},{id:"connected",label:"Connected",color:"bg-emerald-500",bgColor:"bg-emerald-500/10",borderColor:"border-emerald-500/30"}],ca=[{id:"cold_intro",category:"Cold Outreach",title:"LinkedIn Connection Request",content:`Hi [Name],
49
50I came across your profile and was impressed by your work at [Company]. I'm currently exploring opportunities in [Industry/Role] and would love to connect and learn more about your experience.
51
52Looking forward to connecting!
53
54Best,
55[Your Name]`},{id:"mutual_connection",category:"Cold Outreach",title:"Mutual Connection Intro",content:`Hi [Name],
56
57[Mutual Connection] suggested I reach out to you. I'm currently exploring [Role/Industry] opportunities and they mentioned you'd be a great person to connect with given your experience at [Company].
58
59Would you be open to a brief 15-minute chat sometime?
60
61Thanks,
62[Your Name]`},{id:"coffee_chat",category:"Informational Interview",title:"Coffee Chat Request",content:`Hi [Name],
63
64I'm [Your Name], currently [your current role/situation]. I'm very interested in [specific area] and noticed your impressive background at [Company].
65
66Would you be open to a 20-minute virtual coffee chat? I'd love to hear about your career path and any advice you might have for someone looking to break into [field].
67
68I'm flexible with timing and happy to work around your schedule.
69
70Best regards,
71[Your Name]`},{id:"follow_up",category:"Follow Up",title:"Follow Up After Meeting",content:`Hi [Name],
72
73Thank you so much for taking the time to speak with me [today/yesterday/last week]. I really appreciated your insights about [specific topic discussed].
74
75Your advice about [specific advice] was particularly helpful, and I'm already [action you're taking based on their advice].
76
77Please let me know if there's anything I can do to return the favor. I'd love to stay in touch!
78
79Best,
80[Your Name]`},{id:"referral_ask",category:"Referral Request",title:"Asking for a Referral",content:`Hi [Name],
81
82I hope you're doing well! I noticed that [Company] has an opening for [Role] that aligns perfectly with my experience in [relevant skills].
83
84Given our previous conversations about my background, I was wondering if you'd feel comfortable referring me for this position? I've attached my updated resume for your reference.
85
86I completely understand if you're not able to, and I appreciate you considering it either way.
87
88Thanks so much,
89[Your Name]`},{id:"alumni_outreach",category:"Cold Outreach",title:"Alumni Network Outreach",content:`Hi [Name],
90
91I noticed we're both [University] alumni! I graduated in [Year] with a degree in [Major] and I'm currently [current situation].
92
93I've been following your career at [Company] and would love to learn more about your path from [University] to your current role. Would you have 15-20 minutes for a quick call sometime?
94
95Go [Mascot]!
96
97[Your Name]`},{id:"recruiter_response",category:"Recruiter",title:"Response to Recruiter",content:`Hi [Recruiter Name],
98
99Thank you for reaching out about the [Role] position at [Company]. I'm very interested in learning more about this opportunity.
100
101A bit about me: I have [X years] of experience in [field] with expertise in [key skills]. I'm particularly excited about [something specific about the role/company].
102
103I'm available for a call [provide 2-3 time slots]. Please let me know what works best for you.
104
105Looking forward to speaking with you,
106[Your Name]`},{id:"thank_you_interview",category:"Interview",title:"Thank You After Interview",content:`Dear [Interviewer Name],
107
108Thank you for taking the time to meet with me [today/yesterday] to discuss the [Role] position. I enjoyed learning more about [Company] and the team's work on [specific project/initiative discussed].
109
110Our conversation reinforced my enthusiasm for this role. I'm particularly excited about [specific aspect] and believe my experience in [relevant skill] would allow me to contribute meaningfully to the team.
111
112Please don't hesitate to reach out if you need any additional information. I look forward to hearing about next steps.
113
114Best regards,
115[Your Name]`},{id:"networking_event",category:"Follow Up",title:"Post-Networking Event",content:`Hi [Name],
116
117It was great meeting you at [Event Name] [yesterday/last week]. I really enjoyed our conversation about [topic discussed].
118
119As promised, here's [the resource/article/contact you mentioned]. I'd love to continue our conversation over coffee sometime if you're open to it.
120
121Looking forward to staying connected!
122
123Best,
124[Your Name]`},{id:"hiring_manager",category:"Cold Outreach",title:"Direct to Hiring Manager",content:`Hi [Name],
125
126I recently applied for the [Role] position at [Company] and wanted to reach out directly to express my strong interest in joining your team.
127
128With [X years] of experience in [field], I've [key accomplishment relevant to role]. I'm particularly drawn to [Company] because of [specific reason - company mission, product, culture].
129
130I'd welcome the opportunity to discuss how my background aligns with what you're looking for. Would you be open to a brief conversation?
131
132Thank you for your time,
133[Your Name]`}],da=["Cold Outreach","Informational Interview","Follow Up","Referral Request","Recruiter","Interview"],es=["Finance","Tech","Consulting","Healthcare","Startup","Enterprise","Priority","Follow-up","Hiring Manager","Recruiter","Referral"],ss=[{value:"recruiter",label:"Recruiter",description:"Internal or agency recruiter"},{value:"hiring_manager",label:"Hiring Manager",description:"Direct hiring authority"},{value:"working_professional",label:"Working Professional",description:"Peer or industry contact"},{value:"hr",label:"HR / People Ops",description:"Human resources contact"},{value:"executive",label:"Executive / Leadership",description:"C-suite or senior leader"},{value:"alumni",label:"Alumni Connection",description:"School or company alumni"},{value:"mentor",label:"Mentor / Advisor",description:"Career guidance contact"},{value:"referral",label:"Referral Source",description:"Can refer you to opportunities"},{value:"other",label:"Other",description:"General contact"}];function La(){const{pkg:l}=Us(),{toast:N}=le(),{user:T,profile:L}=rs(),{trackInvite:F,checkAndAwardAchievements:r}=la(),[w,A]=d.useState([]),[O,q]=d.useState(!0),[P,Y]=d.useState(""),[c,h]=d.useState(!1),[g,b]=d.useState("kanban"),[f,C]=d.useState(null),[j,a]=d.useState(null),[i,p]=d.useState(null),[n,R]=d.useState(!1),[_,k]=d.useState(!1),[u,M]=d.useState(null),[m,G]=d.useState({full_name:"",email:"",company_name:"",title:"",industry:"",linkedin_url:"",notes:"",category:"",phone:"",location:""}),[os,cs]=d.useState(null),[ds,Ee]=d.useState(!1),[ms,us]=d.useState(void 0),[v,z]=d.useState({full_name:"",email:"",company_name:"",title:"",industry:"",linkedin_url:"",notes:"",category:""}),[Ae,hs]=d.useState(null),[je,Le]=d.useState(""),[H,ps]=d.useState(null);d.useEffect(()=>{T&&(ve(),xs())},[T]);const xs=async()=>{if(!T)return;const{data:s}=await E.from("candidates").select("first_name, last_name, current_job_title, linkedin_url, target_role").eq("user_id",T.id).single();s&&ps({full_name:`${s.first_name||""} ${s.last_name||""}`.trim()||(L==null?void 0:L.full_name)||"User",title:s.current_job_title,linkedin_url:s.linkedin_url,target_role:s.target_role})},ve=async()=>{if(T)try{const{data:s,error:o}=await E.from("networking_contacts").select("*").eq("user_id",T.id).order("created_at",{ascending:!1});if(o)throw o;A(s||[])}catch(s){console.error("Error fetching contacts:",s),N({title:"Error",description:"Failed to load contacts",variant:"destructive"})}finally{q(!1)}},gs=async()=>{if(!T)return;if(!v.full_name){N({title:"Missing Information",description:"Please provide a name for the contact",variant:"destructive"});return}const s=v.full_name.trim().split(" "),o=s[0]||null,x=s.slice(1).join(" ")||null;try{const{error:t}=await E.from("networking_contacts").insert({user_id:T.id,first_name:o,last_name:x,full_name:v.full_name.trim()||null,email:v.email||null,linkedin_url:v.linkedin_url||null,company_name:v.company_name||null,title:v.title||null,company_industry:v.industry||null,notes:v.notes||null,status:"new",relationship_type:v.category||"other"});if(t)throw t;if(v.email){console.log("Attempting to send platform invite to:",v.email);try{const{data:I,error:U}=await E.functions.invoke("send-platform-invite",{body:{recipientEmail:v.email,recipientName:v.full_name.trim()||void 0,senderName:"Career Launch",inviteType:"both"}});await F(v.email,v.full_name.trim(),"contact","networking"),await r(),console.log("Platform invite response:",I,U),U?(console.error("Platform invite error:",U),N({title:"Contact Added!",description:"Contact saved (email invite failed)"})):N({title:"Contact Added & Invited!",description:"Contact saved and invitation email sent 🚀"})}catch(I){console.error("Error sending invite email:",I),N({title:"Contact Added!",description:"Contact saved (email invite failed)"})}}else N({title:"Contact Added!",description:"Contact saved to your networking pipeline"});ve(),z({full_name:"",email:"",company_name:"",title:"",industry:"",linkedin_url:"",notes:"",category:""}),h(!1)}catch(t){console.error("Error adding contact:",t),N({title:"Error",description:"Failed to add contact",variant:"destructive"})}},ye=async(s,o)=>{try{const{error:x}=await E.from("networking_contacts").update({status:o}).eq("id",s);if(x)throw x;A(w.map(I=>I.id===s?{...I,status:o}:I));const t=ee.find(I=>I.id===o);N({title:`Moved to ${(t==null?void 0:t.label)||o}
133`})}catch(x){console.error("Error updating stage:",x),N({title:"Failed to update stage",variant:"destructive"})}},de=async(s,o)=>{if(!o.trim())return;const x=w.find(U=>U.id===s);if(!x)return;const t=x.tags||[];if(t.includes(o))return;const I=[...t,o.trim()];try{const{error:U}=await E.from("networking_contacts").update({tags:I}).eq("id",s);if(U)throw U;A(w.map(Q=>Q.id===s?{...Q,tags:I}:Q)),Le("")}catch(U){console.error("Error adding tag:",U)}},Pe=async(s,o)=>{const x=w.find(I=>I.id===s);if(!x)return;const t=(x.tags||[]).filter(I=>I!==o);try{const{error:I}=await E.from("networking_contacts").update({tags:t}).eq("id",s);if(I)throw I;A(w.map(U=>U.id===s?{...U,tags:t}:U))}catch(I){console.error("Error removing tag:",I)}},Re=async s=>{try{const{error:o}=await E.from("networking_contacts").delete().eq("id",s);if(o)throw o;A(w.filter(x=>x.id!==s)),N({title:"Contact deleted"})}catch(o){console.error("Error deleting contact:",o),N({title:"Failed to delete contact",variant:"destructive"})}},De=s=>{M(s),G({full_name:s.full_name||`${s.first_name||""} ${s.last_name||""}`.trim(),email:s.email||"",company_name:s.company_name||"",title:s.title||"",industry:s.company_industry||"",linkedin_url:s.linkedin_url||"",notes:s.notes||"",category:s.relationship_type||"other",phone:s.phone||"",location:s.location||""}),k(!0)},fs=async()=>{if(!T||!u)return;if(!m.full_name){N({title:"Missing Information",description:"Please provide a name for the contact",variant:"destructive"});return}const s=m.full_name.trim().split(" "),o=s[0]||null,x=s.slice(1).join(" ")||null;try{const{error:t}=await E.from("networking_contacts").update({first_name:o,last_name:x,full_name:m.full_name.trim()||null,email:m.email||null,linkedin_url:m.linkedin_url||null,company_name:m.company_name||null,title:m.title||null,company_industry:m.industry||null,notes:m.notes||null,relationship_type:m.category||"other",phone:m.phone||null,location:m.location||null}).eq("id",u.id);if(t)throw t;N({title:"Contact Updated!",description:"Contact information saved"}),ve(),k(!1),M(null)}catch(t){console.error("Error updating contact:",t),N({title:"Error",description:"Failed to update contact",variant:"destructive"})}},re=(s,o)=>{cs(s),us(o),Ee(!0)},js=s=>{p(s),R(!0)},vs=s=>{C(s)},ys=(s,o)=>{s.preventDefault(),a(o)},Ns=()=>{a(null)},ws=(s,o)=>{s.preventDefault(),f&&f.status!==o&&ye(f.id,o),C(null),a(null)},bs=()=>{C(null),a(null)},Cs=s=>w.filter(o=>{var U,Q,Ue,$e;const t=(o.status||"new")===s,I=!P||((U=o.full_name)==null?void 0:U.toLowerCase().includes(P.toLowerCase()))||((Q=o.first_name)==null?void 0:Q.toLowerCase().includes(P.toLowerCase()))||((Ue=o.last_name)==null?void 0:Ue.toLowerCase().includes(P.toLowerCase()))||(($e=o.company_name)==null?void 0:$e.toLowerCase().includes(P.toLowerCase()));return t&&I}),Ne={total:w.length,withEmail:w.filter(s=>s.email).length,referred:w.filter(s=>s.status==="referred").length},_s=({contact:s})=>{var x;const o=s.full_name||`${s.first_name||""} ${s.last_name||""}`.trim()||((x=s.email)==null?void 0:x.split("@")[0])||"Unknown";return e.jsx(J.div,{layout:!0,initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,scale:.95},draggable:!0,onDragStart:()=>vs(s),onDragEnd:bs,onClick:()=>js(s),className:`bg-card border rounded-lg p-3 cursor-grab active:cursor-grabbing hover:shadow-md transition-all group ${(f==null?void 0:f.id)===s.id?"opacity-50 scale-95":""}`,children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(ea,{className:"h-4 w-4 text-muted-foreground/50 mt-0.5 shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"font-medium text-sm truncate",children:o}),s.title&&e.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s.title})]}),e.jsxs(Ys,{children:[e.jsx(qs,{asChild:!0,onClick:t=>t.stopPropagation(),children:e.jsx(S,{variant:"ghost",size:"icon",className:"h-6 w-6 opacity-0 group-hover:opacity-100 shrink-0",children:e.jsx(sa,{className:"h-3 w-3"})})}),e.jsxs(Hs,{align:"end",className:"w-48",children:[e.jsxs(Z,{onClick:t=>{t.stopPropagation(),De(s)},children:[e.jsx(we,{className:"h-4 w-4 mr-2"}),"Edit Contact"]}),e.jsxs(Z,{onClick:t=>{t.stopPropagation(),re(s)},disabled:!s.email,children:[e.jsx(se,{className:"h-4 w-4 mr-2"}),"Send Outreach"]}),e.jsxs(Z,{onClick:t=>{t.stopPropagation(),re(s,"coaching_request")},disabled:!s.email,children:[e.jsx(ke,{className:"h-4 w-4 mr-2"}
133),"Coaching Request"]}),e.jsxs(Z,{onClick:t=>{t.stopPropagation(),hs(Ae===s.id?null:s.id)},children:[e.jsx(aa,{className:"h-4 w-4 mr-2"}),"Manage Tags"]}),e.jsx(qe,{}),ee.filter(t=>t.id!==s.status).map(t=>e.jsxs(Z,{onClick:I=>{I.stopPropagation(),ye(s.id,t.id)},children:[e.jsx("div",{className:`h-2 w-2 rounded-full ${t.color} mr-2`}),"Move to ",t.label]},t.id)),e.jsx(qe,{}),e.jsxs(Z,{onClick:t=>{t.stopPropagation(),Re(s.id)},className:"text-destructive",children:[e.jsx(Ke,{className:"h-4 w-4 mr-2"}),"Delete"]})]})]})]}),s.company_name&&e.jsxs("div",{className:"flex items-center gap-1.5 mt-2 text-xs text-muted-foreground",children:[e.jsx(ne,{className:"h-3 w-3 shrink-0"}),e.jsx("span",{className:"truncate",children:s.company_name})]}),s.email&&e.jsxs("div",{className:"flex items-center gap-1.5 mt-1 text-xs text-emerald-600",children:[e.jsx(se,{className:"h-3 w-3 shrink-0"}),e.jsx("span",{className:"truncate",children:s.email})]}),s.tags&&s.tags.length>0&&e.jsxs("div",{className:"flex flex-wrap gap-1 mt-2",children:[s.tags.slice(0,3).map(t=>e.jsx(D,{variant:"secondary",className:"text-[9px] px-1.5 py-0",children:t},t)),s.tags.length>3&&e.jsxs(D,{variant:"outline",className:"text-[9px] px-1.5 py-0",children:["+",s.tags.length-3]})]}),e.jsx(fe,{children:Ae===s.id&&e.jsxs(J.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:"mt-2 pt-2 border-t space-y-2",onClick:t=>t.stopPropagation(),children:[e.jsxs("div",{className:"flex gap-1",children:[e.jsx($,{placeholder:"Add tag...",value:je,onChange:t=>Le(t.target.value),onKeyDown:t=>t.key==="Enter"&&de(s.id,je),className:"h-7 text-xs"}),e.jsx(S,{size:"sm",onClick:()=>de(s.id,je),className:"h-7 px-2 text-xs",children:"Add"})]}),e.jsx("div",{className:"flex flex-wrap gap-1",children:es.filter(t=>!(s.tags||[]).includes(t)).slice(0,3).map(t=>e.jsxs(S,{variant:"ghost",size:"sm",className:"h-5 text-[9px] px-1.5",onClick:()=>de(s.id,t),children:["+ ",t]},t))}),s.tags&&s.tags.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1",children:s.tags.map(t=>e.jsxs(D,{variant:"secondary",className:"text-[9px] gap-1",children:[t,e.jsx("button",{onClick:()=>Pe(s.id,t),className:"hover:text-destructive",children:e.jsx(_e,{className:"h-2 w-2"})})]},t))})]})}),e.jsxs("div",{className:"flex gap-1 mt-2",onClick:t=>t.stopPropagation(),children:[s.linkedin_url&&e.jsx("a",{href:s.linkedin_url.startsWith("http")?s.linkedin_url:`https://${s.linkedin_url}`,target:"_blank",rel:"noopener noreferrer",children:e.jsx(S,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0",children:e.jsx(ie,{className:"h-3 w-3 text-[#0077B5]"})})}),s.email&&e.jsx(S,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0",onClick:()=>re(s),children:e.jsx(se,{className:"h-3 w-3"})})]})]})]})})},ks=({template:s})=>{const[o,x]=d.useState(!1),{toast:t}=le(),I=async()=>{try{await navigator.clipboard.writeText(s.content),x(!0),t({title:"Copied!",description:"Template copied to clipboard"}),setTimeout(()=>x(!1),2e3)}catch{t({title:"Failed to copy",description:"Please try again",variant:"destructive"})}};return e.jsxs(V,{className:"hover:shadow-md transition-shadow",children:[e.jsx(Se,{className:"pb-2",children:e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{children:[e.jsx(Te,{className:"text-sm font-medium",children:s.title}),e.jsx(D,{variant:"secondary",className:"mt-1 text-xs",children:s.category})]}),e.jsx(S,{size:"sm",variant:"outline",onClick:I,className:"shrink-0 gap-1.5",children:o?e.jsxs(e.Fragment,{children:[e.jsx(Fe,{className:"h-3.5 w-3.5 text-emerald-600"}),"Copied"]}):e.jsxs(e.Fragment,{children:[e.jsx(be,{className:"h-3.5 w-3.5"}),"Copy"]})})]})}),e.jsx(W,{children:e.jsx("pre",{className:"text-xs text-muted-foreground whitespace-pre-wrap font-sans bg-muted/50 rounded-md p-3 max-h-48 overflow-y-auto",children:s.content})})]})},Is=({contact:s})=>{const o=s.full_name||`${s.first_name||""} ${s.last_name||""}`.trim()||"Unknown",x=ee.find(t=>t.id===s.status)||ee[0];return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("h3",{className:"text-xl font-semibold",children:o}),s.title&&e.jsx("p",{className:"text-muted-foreground",children:s.title}),s.company_name&&e.jsxs("p",{className:"text-sm text-muted-foreground flex items-center gap-1 mt-1",children:[e.jsx(ne,{className:"h-3 w-3"})," ",s.company_name]})]}),e.jsxs(D,{className:`${x.bgColor} ${x.borderColor} border`,children:[e.jsx("div",{className:`h-2 w-2 rounded-full ${x.color} mr-1.5`}),x.label]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx(y,{className:"text-xs text-muted-foreground",children:"Email"}),s.email?e.jsxs("p",{className:"text-sm flex items-center gap-2",children:[e.jsx(se,{className:"h-4 w-4 text-emerald-600"}),s.email]}):e.jsx("p",{className:"text-sm text-muted-foreground italic",children:"Not found"})]}),e.jsxs("div",{children:[e.jsx(y,{className:"text-xs text-muted-foreground",children:"Phone"}),s.phone?e.jsxs("p",{className:"text-sm flex items-center gap-2",children:[e.jsx(Bs,{className:"h-4 w-4"}),s.phone]}):e.jsx("p",{className:"text-sm text-muted-foreground italic",children:"Not available"})]}),e.jsxs("div",{children:[e.jsx(y,{className:"text-xs text-muted-foreground",children:"LinkedIn"}),s.linkedin_url?e.jsxs("a",{href:s.linkedin_url.startsWith("http")?s.linkedin_url:`https://${s.linkedin_url}`,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-primary hover:underline flex items-center gap-2",children:[e.jsx(ie,{className:"h-4 w-4"}),"View Profile"]}):e.jsx("p",{className:"text-sm text-muted-foreground italic",children:"Not available"})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx(y,{className:"text-xs text-muted-foreground",children:"Location"}),e.jsx("p",{className:"text-sm",children:s.location||"Unknown"})]}),e.jsxs("div",{children:[e.jsx(y,{className:"text-xs text-muted-foreground",children:"Industry"}),e.jsx("p",{className:"text-sm",children:s.company_industry||"Unknown"})]}),e.jsxs("div",{children:[e.jsx(y,{className:"text-xs text-muted-foreground",children:"Seniority"}),e.jsx("p",{className:"text-sm",children:s.seniority||"Unknown"})]})]})]}),s.notes&&e.jsxs("div",{children:[e.jsx(y,{className:"text-xs text-muted-foreground",children:"Notes"}),e.jsx("p",{className:"text-sm mt-1 p-3 bg-muted/50 rounded-lg",children:s.notes})]}),e.jsxs("div",{children:[e.jsx(y,{className:"text-xs text-muted-foreground",children:"Tags"}),e.jsxs("div",{className:"flex flex-wrap gap-2 mt-2",children:[(s.tags||[]).map(t=>e.jsxs(D,{variant:"secondary",className:"gap-1",children:[t,e.jsx("button",{onClick:()=>Pe(s.id,t),className:"hover:text-destructive",children:e.jsx(_e,{className:"h-3 w-3"})})]},t)),es.filter(t=>!(s.tags||[]).includes(t)).slice(0,4).map(t=>e.jsxs(S,{variant:"outline",size:"sm",className:"h-6 text-xs",onClick:()=>de(s.id,t),children:["+ ",t]},t))]})]}),e.jsxs("div",{className:"flex flex-wrap gap-2 pt-4 border-t",children:[e.jsxs(S,{onClick:()=>{R(!1),re(s)},disabled:!s.email,className:"gap-2",children:[e.jsx(se,{className:"h-4 w-4"}),"Send Outreach"]}),e.jsxs(S,{variant:"outline",onClick:()=>{R(!1),re(s,"coaching_request")},disabled:!s.email,className:"gap-2",children:[e.jsx(ke,{className:"h-4 w-4"}
133),"Coaching Request"]}),s.linkedin_url&&e.jsx("a",{href:s.linkedin_url.startsWith("http")?s.linkedin_url:`https://${s.linkedin_url}`,target:"_blank",rel:"noopener noreferrer",children:e.jsxs(S,{variant:"outline",className:"gap-2",children:[e.jsx(ie,{className:"h-4 w-4"}),"View LinkedIn"]})})]}),e.jsxs("div",{children:[e.jsx(y,{className:"text-xs text-muted-foreground mb-2 block",children:"Move to Stage"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:ee.filter(t=>t.id!==s.status).map(t=>e.jsxs(S,{variant:"outline",size:"sm",className:"gap-2",onClick:()=>{ye(s.id,t.id),p({...s,status:t.id})},children:[e.jsx("div",{className:`h-2 w-2 rounded-full ${t.color}`}),t.label]},t.id))})]}),e.jsxs("div",{className:"pt-4 border-t flex gap-2",children:[e.jsxs(S,{variant:"outline",size:"sm",className:"gap-2",onClick:()=>{R(!1),De(s)},children:[e.jsx(we,{className:"h-4 w-4"}),"Edit Contact"]}),e.jsxs(S,{variant:"destructive",size:"sm",className:"gap-2",onClick:()=>{Re(s.id),R(!1)},children:[e.jsx(Ke,{className:"h-4 w-4"}),"Delete Contact"]})]})]})};return e.jsxs("div",{className:"space-y-4 pb-8",children:[e.jsxs("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx(J.h1,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"text-2xl font-bold",children:"Networking Pipeline"}),e.jsx(J.p,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.1},className:"text-muted-foreground text-sm",children:"Track your networking conversations and move contacts through the pipeline."})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"flex items-center gap-3 text-sm text-muted-foreground",children:[e.jsxs("span",{children:[e.jsx("strong",{className:"text-foreground",children:Ne.total})," contacts"]}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-emerald-600",children:Ne.withEmail})," emails"]}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-purple-600",children:Ne.referred})," referrals"]})]}),e.jsxs(S,{variant:"outline",className:"gap-2",onClick:()=>Vs(w.map(s=>({id:s.id,name:s.full_name||`${s.first_name||""} ${s.last_name||""}`.trim(),email:s.email||void 0,company:s.company_name||void 0,title:s.title||void 0,linkedin_url:s.linkedin_url||void 0,phone:s.phone||void 0,status:s.status,notes:s.notes||void 0,tags:s.tags||void 0}))),disabled:w.length===0,children:[e.jsx($s,{className:"h-4 w-4"}),"Export"]}),e.jsxs(me,{open:c,onOpenChange:h,children:[e.jsx(Os,{asChild:!0,children:e.jsxs(S,{className:"gap-2",children:[e.jsx(Xe,{className:"h-4 w-4"}),"Add Contact"]})}),e.jsxs(ue,{className:"sm:max-w-md",children:[e.jsx(he,{children:e.jsxs(pe,{className:"flex items-center gap-2",children:[e.jsx(Ie,{className:"h-5 w-5 text-primary"}),"Add Networking Contact"]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(y,{children:"Full Name *"}),e.jsx($,{placeholder:"John Smith",value:v.full_name,onChange:s=>z({...v,full_name:s.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(y,{children:"Email"}),e.jsx($,{placeholder:"[email protected]",type:"email",value:v.email,onChange:s=>z({...v,email:s.target.value})})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(y,{children:"Company Name"}),e.jsx($,{placeholder:"Goldman Sachs",value:v.company_name,onChange:s=>z({...v,company_name:s.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(y,{children:"Title"}),e.jsx($,{placeholder:"VP, Recruiting",value:v.title,onChange:s=>z({...v,title:s.target.value})})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(y,{children:"Category *"}),e.jsxs(He,{value:v.category,onValueChange:s=>
133z({...v,category:s}),children:[e.jsx(Be,{children:e.jsx(Ve,{placeholder:"Select contact type..."})}),e.jsx(Ge,{children:ss.map(s=>e.jsx(We,{value:s.value,children:e.jsx("div",{className:"flex flex-col",children:e.jsx("span",{children:s.label})})},s.value))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(y,{children:"Industry"}),e.jsx($,{placeholder:"Finance, Technology...",value:v.industry,onChange:s=>z({...v,industry:s.target.value})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(y,{className:"flex items-center gap-2",children:[e.jsx(ie,{className:"h-4 w-4 text-[#0077B5]"}),"LinkedIn URL"]}),e.jsx($,{placeholder:"linkedin.com/in/johnsmith",value:v.linkedin_url,onChange:s=>z({...v,linkedin_url:s.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(y,{children:"Notes"}),e.jsx(Ce,{placeholder:"How do you know them? Any context...",value:v.notes,onChange:s=>z({...v,notes:s.target.value}),rows:2})]})]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(S,{variant:"outline",onClick:()=>h(!1),children:"Cancel"}),e.jsxs(S,{onClick:gs,className:"gap-2",children:[e.jsx(Ie,{className:"h-4 w-4"}),"Add Contact"]})]})]})]}),e.jsx(me,{open:_,onOpenChange:k,children:e.jsxs(ue,{className:"sm:max-w-md",children:[e.jsx(he,{children:e.jsxs(pe,{className:"flex items-center gap-2",children:[e.jsx(we,{className:"h-5 w-5 text-primary"}),"Edit Contact"]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(y,{children:"Full Name *"}),e.jsx($,{placeholder:"John Smith",value:m.full_name,onChange:s=>G({...m,full_name:s.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(y,{children:"Email"}),e.jsx($,{placeholder:"[email protected]",type:"email",value:m.email,onChange:s=>G({...m,email:s.target.value})})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(y,{children:"Company Name"}),e.jsx($,{placeholder:"Goldman Sachs",value:m.company_name,onChange:s=>G({...m,company_name:s.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(y,{children:"Title"}),e.jsx($,{placeholder:"VP, Recruiting",value:m.title,onChange:s=>G({...m,title:s.target.value})})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(y,{children:"Category"}),e.jsxs(He,{value:m.category,onValueChange:s=>G({...m,category:s}),children:[e.jsx(Be,{children:e.jsx(Ve,{placeholder:"Select contact type..."})}),e.jsx(Ge,{children:ss.map(s=>e.jsx(We,{value:s.value,children:e.jsx("span",{children:s.label})},s.value))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(y,{children:"Industry"}),e.jsx($,{placeholder:"Finance, Technology...",value:m.industry,onChange:s=>G({...m,industry:s.target.value})})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(y,{children:"Phone"}),e.jsx($,{placeholder:"+1 (555) 123-4567",value:m.phone,onChange:s=>G({...m,phone:s.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(y,{children:"Location"}),e.jsx($,{placeholder:"New York, NY",value:m.location,onChange:s=>G({...m,location:s.target.value})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(y,{className:"flex items-center gap-2",children:[e.jsx(ie,{className:"h-4 w-4 text-[#0077B5]"}),"LinkedIn URL"]}),e.jsx($,{placeholder:"linkedin.com/in/johnsmith",value:m.linkedin_url,onChange:s=>G({...m,linkedin_url:s.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(y,{children:"Notes"}),e.jsx(Ce,{placeholder:"How do you know them? Any context...",value:m.notes,onChange:s=>G({...m,notes:s.target.value}),rows:2})]})]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(S,{variant:"outline",onClick:()=>k(!1),children:"Cancel"}),e.jsxs(S,{onClick:fs,className:"gap-2",children:[e.jsx(Fe,{className:"h-4 w-4"}),"Save Changes"]})]})]})})]})]}),e.jsxs(ns,{value:g,onValueChange:b,className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs(ls,{children:[e.jsxs(ae,{value:"kanban",className:"gap-2",children:[e.jsx(xe,{className:"h-4 w-4"}),"Pipeline"]}),e.jsxs(ae,{value:"research",className:"gap-2",children:[e.jsx(ce,{className:"h-4 w-4"}),"Company Research"]}),e.jsxs(ae,{value:"templates",className:"gap-2",children:[e.jsx(Ye,{className:"h-4 w-4"}),"Templates"]}),e.jsxs(ae,{value:"import",className:"gap-2",children:[e.jsx(ts,{className:"h-4 w-4"}),"Import"]})]}
133),g==="kanban"&&e.jsxs("div",{className:"relative flex-1 max-w-sm",children:[e.jsx(is,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx($,{placeholder:"Search contacts...",value:P,onChange:s=>Y(s.target.value),className:"pl-10 h-9"})]})]}),e.jsx(te,{value:"kanban",className:"mt-0",children:O?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx(oe,{className:"h-8 w-8 animate-spin text-primary"})}):e.jsxs(e.Fragment,{children:[w.length===0&&e.jsxs(J.div,{initial:{opacity:0},animate:{opacity:1},className:"text-center py-6 mb-4 bg-muted/30 rounded-lg border border-dashed",children:[e.jsx(ge,{className:"h-10 w-10 text-muted-foreground mx-auto mb-3 opacity-50"}),e.jsx("h3",{className:"text-base font-semibold mb-1",children:"Start Your Networking Pipeline"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-3 max-w-md mx-auto",children:"Add contacts with their LinkedIn URL to automatically find their email"}),e.jsxs(S,{onClick:()=>h(!0),size:"sm",className:"gap-2",children:[e.jsx(Xe,{className:"h-4 w-4"}),"Add Your First Contact"]})]}),e.jsx("div",{className:"grid grid-cols-4 gap-3",children:ee.map(s=>{const o=Cs(s.id);return e.jsxs("div",{className:`rounded-lg border ${s.borderColor} ${s.bgColor} transition-all ${j===s.id?"ring-2 ring-primary ring-offset-2":""}`,onDragOver:x=>ys(x,s.id),onDragLeave:Ns,onDrop:x=>ws(x,s.id),children:[e.jsx("div",{className:"p-2 border-b border-border/50",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("div",{className:`h-2 w-2 rounded-full ${s.color}`}),e.jsx("h3",{className:"font-medium text-xs",children:s.label})]}),e.jsx(D,{variant:"secondary",className:"text-[10px] px-1.5 py-0",children:o.length})]})}),e.jsxs("div",{className:"p-2 space-y-2 min-h-[200px] max-h-[calc(100vh-350px)] overflow-y-auto",children:[e.jsx(fe,{mode:"popLayout",children:o.map(x=>e.jsx(_s,{contact:x},x.id))}),o.length===0&&e.jsx("div",{className:"text-center py-8 text-xs text-muted-foreground",children:s.id==="new"?"Add contacts":"Drag here"})]})]},s.id)})})]})}),e.jsx(te,{value:"research",className:"mt-0",children:e.jsx(oa,{})}),e.jsx(te,{value:"templates",className:"space-y-6",children:e.jsx(J.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},children:e.jsx("div",{className:"space-y-6",children:da.map(s=>{const o=ca.filter(x=>x.category===s);return o.length===0?null:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("h3",{className:"text-lg font-semibold flex items-center gap-2",children:[e.jsx(Ye,{className:"h-5 w-5 text-primary"}),s]}),e.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:o.map(x=>e.jsx(ks,{template:x},x.id))})]},s)})})})}),e.jsx(te,{value:"import",className:"space-y-6",children:e.jsx(J.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},children:e.jsx(na,{})})})]}),!l&&e.jsx("div",{className:"py-6 mt-6 border-t border-border/50",children:e.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-center gap-3 text-center",children:[e.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground text-sm",children:[e.jsx(ce,{className:"h-4 w-4 text-primary/60"}),e.jsx("span",{children:"Need help with outreach automation?"})]}),e.jsxs(Ms,{to:"/upgrade",className:"text-sm font-medium text-primary hover:text-primary/80 transition-colors flex items-center gap-1 group",children:["Explore our services",e.jsx(Fs,{className:"h-3.5 w-3.5 group-hover:translate-x-0.5 transition-transform"})]})]})}),e.jsx(ia,{contact:os,isOpen:ds,onClose:()=>Ee(!1),senderName:(H==null?void 0:H.full_name)||(L==null?void 0:L.full_name)||"User",senderTitle:(H==null?void 0:H.title)||void 0,senderLinkedIn:(H==null?void 0:H.linkedin_url)||void 0,senderTargetRole:(H==null?void 0:H.target_role)||void 0,initialTemplate:ms}),e.jsx(me,{open:n,onOpenChange:R,children:e.jsxs(ue,{className:"sm:max-w-xl max-h-[90vh] overflow-y-auto",children:[e.jsx(he,{children:e.jsxs(pe,{className:"flex items-center gap-2",children:[e.jsx(ge,{className:"h-5 w-5 text-primary"}),"Contact Details"]}
133)}),i&&e.jsx(Is,{contact:i})]})})]})}export{La 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.