1import{r as u,j as e}from"./vendor-react-EKpbQ58x.js";import{b as k,u as E,a as w}from"./vendor-query-Cy-95fCG.js";import{B as p,c as y,d as N,b,I as q,T}from"./index-DSiBKyF6.js";import{P as se}from"./PageHeader-Dff73aen.js";import{L as v}from"./label-BeENAcCB.js";import{B as C}from"./badge-Cm0J9pKt.js";import{S as K,a as B,b as D,c as J,d as P}from"./select-Pyi2N7ZV.js";import{B as A,aZ as $,aA as O,r as te,x as Q,ak as z,j as U,a$ as _,n as I,X as Y,w as S,au as ae,b7 as re,b6 as ne,q as ie,U as V,t as L,an as le,b2 as ce,i as X,s as oe,g as H,u as de,ch as me}from"./icons-Dx8Iaodt.js";import"./vendor-D5X0EH2b.js";import"./ui-radix-DiOYaS2U.js";import"./vendor-routing-DfDPPI-Y.js";const F=[{key:"matched",label:"Matched",icon:te,color:"bg-blue-100 text-blue-700"},{key:"prereqs_sent",label:"Pre-reqs Sent",icon:Q,color:"bg-amber-100 text-amber-700"},{key:"screened",label:"Screened",icon:z,color:"bg-violet-100 text-violet-700"},{key:"approved",label:"Approved",icon:U,color:"bg-green-100 text-green-700"},{key:"rejected",label:"Rejected",icon:_,color:"bg-red-100 text-red-700"},{key:"hired",label:"Hired",icon:I,color:"bg-emerald-100 text-emerald-700"}],W={remote:"Remote",hybrid:"Hybrid",onsite:"On-site"},xe={permanent:"Permanent",contract:"Contract"};function ue(s){return s>=80?"text-emerald-600 bg-emerald-50":s>=65?"text-blue-600 bg-blue-50":s>=50?"text-amber-600 bg-amber-50":"text-red-600 bg-red-50"}function he({onClose:s,onCreated:l}){const[r,d]=u.useState(""),[i,m]=u.useState(""),[o,n]=u.useState(""),[t,x]=u.useState(""),[h,a]=u.useState(""),[f,j]=u.useState(""),[c,M]=u.useState(""),[G,Z]=u.useState(""),ee=k(),R=w({mutationFn:()=>b("POST","/hiring",{jobTitle:r,company:i,location:o,environment:t,jobType:h,description:f,requirements:c,salaryRange:G}),onSuccess:()=>{ee.invalidateQueries({queryKey:["hiring-posts"]}),l(),N({title:"Job posting created!"})},onError:g=>N({title:"Failed to create posting",description:g.message,variant:"destructive"})});return e.jsxs("div",{className:"bg-card border rounded-xl p-6 mb-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-5",children:[e.jsx("h2",{className:"font-semibold text-foreground",children:"New Job Posting"}),e.jsx("button",{onClick:s,className:"text-muted-foreground hover:text-foreground",children:e.jsx(Y,{className:"w-4 h-4"})})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 mb-4",children:[e.jsxs("div",{children:[e.jsx(v,{className:"text-xs mb-1 block",children:"Job Title *"}),e.jsx(q,{placeholder:"e.g. Senior Software Engineer",value:r,onChange:g=>d(g.target.value)})]}),e.jsxs("div",{children:[e.jsx(v,{className:"text-xs mb-1 block",children:"Company *"}),e.jsx(q,{placeholder:"e.g. Acme Corp",value:i,onChange:g=>m(g.target.value)})]}),e.jsxs("div",{children:[e.jsx(v,{className:"text-xs mb-1 block",children:"Location *"}),e.jsx(q,{placeholder:"e.g. Toronto, ON",value:o,onChange:g=>n(g.target.value)})]}),e.jsxs("div",{children:[e.jsx(v,{className:"text-xs mb-1 block",children:"Salary Range"}),e.jsx(q,{placeholder:"e.g. $120kâ$150k",value:G,onChange:g=>Z(g.target.value)})]}),e.jsxs("div",{children:[e.jsx(v,{className:"text-xs mb-1 block",children:"Environment"}),e.jsxs(K,{value:t,onValueChange:x,children:[e.jsx(B,{children:e.jsx(D,{placeholder:"Select..."})}),e.jsxs(J,{children:[e.jsx(P,{value:"remote",children:"Remote"}),e.jsx(P,{value:"hybrid",children:"Hybrid"}),e.jsx(P,{value:"onsite",children:"On-site"})]})]})]}),e.jsxs("div",{children:[e.jsx(v,{className:"text-xs mb-1 block",children:"Job Type"}),e.jsxs(K,{value:h,onValueChange:a,children:[e.jsx(B,{children:e.jsx(D,{placeholder:"Select..."})}),e.jsxs(J,{children:[e.jsx(P,{value:"permanent",children:"Permanent / Full-time"}),e.jsx(P,{value:"contract",children:"Contract"})]})]})]})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx(v,{className:"text-xs mb-1 block",children:"Job Description *"}),e.jsx(T,{placeholder:"Describe the role, responsibilities, and team context...",value:f,onChange:g=>j(g.target.value),rows:4})]}),e.jsxs("div",{className:"mb-5",children:[e.jsx(v,{className:"text-xs mb-1 block",children:"Key Requirements"}),e.jsx(T,{placeholder:"List must-have skills, qualifications, and experience...",value:c,onChange:g=>M(g.target.value),rows:3})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(p,{onClick:()=>R.mutate(),disabled:R.isPending||!r||!i||!o||!f,className:"gap-2",children:[R.isPending?e.jsx(S,{className:"w-4 h-4 animate-spin"}):e.jsx($,{className:"w-4 h-4"})," Create Posting"]}),e.jsx(p,{variant:"outline",onClick:s,children:"Cancel"})]})]})}function ge({candidate:s,postId:l,onClose:r,onSent:d}){const[i,m]=u.useState(s.prereqMessage??""),o=k(),n=w({mutationFn:()=>b("POST",`/hiring/${l}/candidates/${s.id}/prereqs`,{message:i}),onSuccess:()=>{o.invalidateQueries({queryKey:["hiring-candidates",l]}),d(),N({title:"Pre-requisites sent!",description:`${s.firstName} has been notified.`})},onError:t=>N({title:"Failed to send",description:t.message,variant:"destructive"})});return e.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:e.jsxs("div",{className:"bg-card border rounded-xl p-6 max-w-lg w-full shadow-xl",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("h3",{className:"font-semibold",children:["Send Pre-requisites to ",s.firstName]}),e.jsx("button",{onClick:r,children:e.jsx(Y,{className:"w-4 h-4 text-muted-foreground"})})]}),e.jsxs("p",{className:"text-sm text-muted-foreground mb-4",children:["This message will be sent as a notification to ",s.firstName," ",s.lastName,". Include any screening requirements, assessments, or next steps."]}),e.jsx(T,{value:i,onChange:t=>m(t.target.value),rows:5,placeholder:`Hi ${s.firstName}, 2 3Thank you for your interest. Before moving forward, we'd like you to complete... 4 5Please respond within 5 business days.`,className:"mb-4"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(p,{onClick:()=>n.mutate(),disabled:n.isPending||!i.trim(),className:"gap-2",children:[n.isPending?e.jsx(S,{className:"w-4 h-4 animate-spin"}):e.jsx(Q,{className:"w-4 h-4"})," Send"]}),e.jsx(p,{variant:"outline",onClick:r,children:"Cancel"})]})]})})}function pe({candidate:s,postId:l,onUpdated:r}){const[d,i]=u.useState(!1),[m,o]=u.useState(!1),[n,t]=u.useState(s.hiringManagerNotes??""),x=k(),h=w({mutationFn:c=>b("PUT",`/hiring/${l}/candidates/${s.id}`,c),onSuccess:()=>{x.invalidateQueries({queryKey:["hiring-candidates",l]}),x.invalidateQueries({queryKey:["hiring-posts"]}),r()},onError:c=>N({title:"Failed to update",description:c.message,variant:"destructive"})}),a=F.find(c=>c.key===s.status),f=[s.resumeSkillDetail,s.resumeSkills,s.resumeCerts].filter(
5Boolean).join(", ").split(/[,;]/).map(c=>c.trim()).filter(Boolean).slice(0,6);["hired","rejected"].includes(s.status);const j=[];return s.status==="matched"&&j.push({label:"Send Pre-reqs",value:"prereqs_action",icon:Q}),["matched","prereqs_sent"].includes(s.status)&&j.push({label:"Mark Screened",value:"screened",icon:z}),s.status==="screened"&&(j.push({label:"Approve",value:"approved",icon:U}),j.push({label:"Reject",value:"rejected",icon:_})),s.status==="approved"&&j.push({label:"Mark Hired",value:"hired",icon:I}),e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"bg-card border rounded-xl p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsxs("div",{className:"w-10 h-10 rounded-full bg-gradient-to-br from-primary/20 to-primary/10 flex items-center justify-center text-primary font-bold text-sm flex-shrink-0",children:[s.firstName[0],s.lastName[0]]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap mb-1",children:[e.jsxs("span",{className:"font-semibold text-foreground",children:[s.firstName," ",s.lastName]}),a&&e.jsxs(C,{className:y(a.color,"border-0 text-xs gap-1"),children:[e.jsx(a.icon,{className:"w-3 h-3"}),a.label]}),s.matchScore!==null&&s.matchScore!==void 0&&e.jsxs("span",{className:y("text-xs font-bold px-2 py-0.5 rounded-full",ue(s.matchScore)),children:[s.matchScore,"% match"]})]}),s.resumeYearsExp&&e.jsxs("p",{className:"text-xs text-muted-foreground mb-1",children:[s.resumeYearsExp," years experience"]}),s.matchReason&&e.jsx("p",{className:"text-sm text-muted-foreground mb-2 leading-relaxed",children:s.matchReason}),f.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1 mb-3",children:f.map((c,M)=>e.jsx("span",{className:"text-xs bg-muted text-muted-foreground px-2 py-0.5 rounded-full",children:c},M))}),s.prereqMessage&&s.status!=="matched"&&e.jsxs("div",{className:"bg-amber-50 dark:bg-amber-950/20 border border-amber-200 dark:border-amber-800 rounded-lg p-2.5 mb-3 text-xs text-amber-800 dark:text-amber-200",children:[e.jsxs("p",{className:"font-semibold mb-0.5",children:["Pre-requisites sent ",s.prereqSentAt?`· ${new Date(s.prereqSentAt).toLocaleDateString()}`:""]}),e.jsx("p",{className:"text-amber-700 dark:text-amber-300",children:s.prereqMessage})]}),m&&e.jsxs("div",{className:"mb-3",children:[e.jsx(T,{value:n,onChange:c=>t(c.target.value),rows:2,placeholder:"Private notes on this candidate...",className:"text-sm mb-2"}),e.jsx(p,{size:"sm",variant:"outline",className:"h-7 text-xs",onClick:()=>{h.mutate({status:s.status,hiringManagerNotes:n}),o(!1)},children:"Save Notes"})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[j.map(c=>e.jsxs(p,{size:"sm",variant:c.value==="rejected"?"outline":"default",className:y("h-7 text-xs gap-1",c.value==="rejected"&&"text-red-600 border-red-200 hover:bg-red-50"),disabled:h.isPending,onClick:()=>{if(c.value==="prereqs_action"){i(!0);return}h.mutate({status:c.value})},children:[h.isPending?e.jsx(S,{className:"w-3 h-3 animate-spin"}):e.jsx(c.icon,{className:"w-3 h-3"}),c.label]},c.value)),e.jsxs("button",{onClick:()=>o(!m),className:"text-xs text-muted-foreground hover:text-foreground flex items-center gap-1",children:[e.jsx(me,{className:"w-3 h-3"})," Notes"]})]})]})]})}),d&&e.jsx(ge,{candidate:s,postId:l,onClose:()=>i(!1),onSent:()=>i(!1)})]})}function be({postId:s,hasCoaching:l,onGenerated:r}){const d=k(),{data:i,isLoading:m}=E({queryKey:["hiring-coaching",s],queryFn:()=>b("GET",`/hiring/${s}/coaching`),enabled:l}),o=w({mutationFn:()=>b("POST",`/hiring/${s}/coaching`),onSuccess:t=>{d.setQueryData(["hiring-coaching",s],t),d.invalidateQueries({queryKey:["hiring-posts"]}),r()},onError:t=>N({title:"Failed to generate coaching",description:t.message,variant:"destructive"})}),n=i?.coaching;return!l&&!o.isPending?e.jsxs("div",{className:"text-center py-10",children:[e.jsx(L,{className:"w-10 h-10 text-muted-foreground mx-auto mb-3"}),e.jsx("h3",{className:"font-semibold mb-1",children:"Interview Coaching Guide"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4 max-w-sm mx-auto",children:"Generate a personalized guide with screening criteria, interview questions, red flags, and an assessment rubric â all tailored to this specific role."}),e.jsxs(p,{onClick:()=>o.mutate(),className:"gap-2",children:[e.jsx(X,{className:"w-4 h-4"})," Generate Coaching Guide"]})]}):m||o.isPending?e.jsxs("div",{className:"flex items-center justify-center py-12 gap-2 text-muted-foreground",children:[e.jsx(S,{className:"w-5 h-5 animate-spin"})," ",o.isPending?"Generating coaching guideâ¦":"Loadingâ¦"]}):n?e.jsxs("div",{className:"space-y-6",children:[n.hiringPhilosophy&&e.jsx("div",{className:"bg-primary/5 border border-primary/20 rounded-xl p-4",children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(O,{className:"w-4 h-4 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("p",{className:"text-sm text-foreground leading-relaxed",children:[e.jsx("span",{className:"font-semibold",children:"Coach's Take: "}),n.hiringPhilosophy]})]})}),n.screeningCriteria&&n.screeningCriteria.length>0&&e.jsxs("div",{children:[e.jsxs("h4",{className:"font-semibold text-sm mb-3 flex items-center gap-2",children:[e.jsx(oe,{className:"w-4 h-4 text-primary"})," Screening Criteria"]}),e.jsx("div",{className:"space-y-2",children:n.screeningCriteria.map((t,x)=>e.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg bg-muted/40",children:[e.jsx(C,{className:y("text-xs border-0 flex-shrink-0 mt-0.5",t.weight==="must-have"?"bg-red-100 text-red-700":"bg-blue-100 text-blue-700"),
5children:t.weight}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-sm",children:t.title}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t.description})]})]},x))})]}),n.interviewQuestions&&n.interviewQuestions.length>0&&e.jsxs("div",{children:[e.jsxs("h4",{className:"font-semibold text-sm mb-3 flex items-center gap-2",children:[e.jsx(L,{className:"w-4 h-4 text-primary"})," Interview Questions"]}),e.jsx("div",{className:"space-y-3",children:n.interviewQuestions.map((t,x)=>e.jsxs("div",{className:"border rounded-xl p-4",children:[e.jsxs("p",{className:"font-semibold text-sm mb-1",children:['"',t.question,'"']}),e.jsx("p",{className:"text-xs text-muted-foreground mb-2 italic",children:t.purpose}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:[e.jsxs("div",{className:"bg-green-50 dark:bg-green-950/20 rounded-lg p-2.5",children:[e.jsx("p",{className:"text-xs font-semibold text-green-700 dark:text-green-400 mb-1",children:"Green flag"}),e.jsx("p",{className:"text-xs text-green-800 dark:text-green-300",children:t.greenFlag})]}),e.jsxs("div",{className:"bg-red-50 dark:bg-red-950/20 rounded-lg p-2.5",children:[e.jsx("p",{className:"text-xs font-semibold text-red-700 dark:text-red-400 mb-1",children:"Red flag"}),e.jsx("p",{className:"text-xs text-red-800 dark:text-red-300",children:t.redFlag})]})]})]},x))})]}),n.redFlags&&n.redFlags.length>0&&e.jsxs("div",{children:[e.jsxs("h4",{className:"font-semibold text-sm mb-3 flex items-center gap-2",children:[e.jsx(H,{className:"w-4 h-4 text-amber-500"})," Behavioral Red Flags to Watch For"]}),e.jsx("ul",{className:"space-y-1.5",children:n.redFlags.map((t,x)=>e.jsxs("li",{className:"flex items-start gap-2 text-sm text-muted-foreground",children:[e.jsx(H,{className:"w-3.5 h-3.5 text-amber-400 flex-shrink-0 mt-0.5"}),t]},x))})]}),n.assessmentRubric&&n.assessmentRubric.length>0&&e.jsxs("div",{children:[e.jsxs("h4",{className:"font-semibold text-sm mb-3 flex items-center gap-2",children:[e.jsx(de,{className:"w-4 h-4 text-primary"})," Assessment Rubric"]}),e.jsx("div",{className:"overflow-x-auto rounded-xl border",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{className:"bg-muted/60",children:e.jsxs("tr",{children:[e.jsx("th",{className:"text-left p-3 font-semibold",children:"Dimension"}),e.jsx("th",{className:"text-left p-3 font-semibold text-red-600",children:"Poor"}),e.jsx("th",{className:"text-left p-3 font-semibold text-blue-600",children:"Good"}),e.jsx("th",{className:"text-left p-3 font-semibold text-emerald-600",children:"Excellent"})]})}),e.jsx("tbody",{children:n.assessmentRubric.map((t,x)=>e.jsxs("tr",{className:"border-t",children:[e.jsx("td",{className:"p-3 font-medium",children:t.dimension}),e.jsx("td",{className:"p-3 text-muted-foreground",children:t.poor}),e.jsx("td",{className:"p-3 text-muted-foreground",children:t.good}),e.jsx("td",{className:"p-3 text-muted-foreground",children:t.excellent})]},x))})]})})]})]}):null}function je({postId:s,postStatus:l}){const[r,d]=u.useState(null),i=k(),{data:m,isLoading:o}=E({queryKey:["hiring-candidates",s],queryFn:()=>b("GET",`/hiring/${s}/candidates`)}),n=w({mutationFn:()=>b("POST",`/hiring/${s}/match`),onSuccess:a=>{i.invalidateQueries({queryKey:["hiring-candidates",s]}),i.invalidateQueries({queryKey:["hiring-posts"]}),N({title:a.matched>0?`${a.matched} candidates matched!`:"No new matches found",description:a.matched>0?"AI has found platform members that fit your role.":a.message})},onError:a=>N({title:"Matching failed",description:a.message,variant:"destructive"})}),t=m?.candidates??[],x=F.reduce((a,f)=>(a[f.key]=t.filter(j=>j.status===f.key).length,a),{}),h=r?t.filter(a=>a.status===r):t;return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs(p,{size:"sm",variant:r===null?"default":"outline",className:"h-7 text-xs",onClick:()=>d(null),children:["All (",t.length,")"]}),F.filter(a=>x[a.key]>0).map(a=>e.jsxs("button",{onClick:()=>d(r===a.key?null:a.key),className:y("inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-medium border transition-all",r===a.key?a.color+" border-transparent shadow-sm":"bg-card border-border text-muted-foreground hover:border-border/80"),children:[e.jsx(a.icon,{className:"w-3 h-3"}),a.label," (",x[a.key],")"]},a.key)),e.jsx("div",{className:"ml-auto",children:e.jsxs(p,{size:"sm",onClick:()=>n.mutate(),disabled:n.isPending||l==="closed",className:"h-7 text-xs gap-1.5",children:[n.isPending?e.jsx(S,{className:"w-3 h-3 animate-spin"}):e.jsx(X,{className:"w-3 h-3"}),"Find Candidates"]})})]}),o&&e.jsx("div",{className:"flex justify-center py-8",children:e.jsx(S,{className:"w-5 h-5 animate-spin text-muted-foreground"})}),!o&&t.length===0&&e.jsxs("div",{className:"text-center py-10",children:[e.jsx(V,{className:"w-10 h-10 text-muted-foreground mx-auto mb-3"}),e.jsx("h3",{className:"font-semibold mb-1",children:"No candidates yet"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:'Click "Find Candidates" to let AI match platform members against your job description.'})]}),!o&&h.length===0&&t.length>0&&e.jsx("p",{className:"text-sm text-muted-foreground text-center py-6",children:"No candidates in this stage."}),e.jsx("div",{className:"space-y-3",children:h.map(a=>e.jsx(pe,{candidate:a,postId:s,onUpdated:()=>{}},a.id))})]})}function fe({post:s}){const[l,r]=u.useState(!1),[d,i]=u.useState("candidates"),[m,o]=u.useState(!!s.interviewCoaching),n=k(),t=w({mutationFn:()=>b("DELETE",`/hiring/${s.id}`),onSuccess:()=>{n.invalidateQueries({queryKey:["hiring-posts"]}),N({title:"Posting removed."})}}),x=w({mutationFn:()=>b("PUT",`/hiring/${s.id}`,{...s,status:"closed"}),onSuccess:()=>n.invalidateQueries({queryKey:["hiring-posts"]})});return e.jsxs("div",{className:"bg-card border rounded-xl overflow-hidden shadow-sm",children:[e.jsxs("div",{className:"flex items-start gap-4 p-5 cursor-pointer hover:bg-muted/20 transition-colors",onClick:()=>r(!l),children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-gradient-to-br from-primary/20 to-primary/10 flex items-center justify-center flex-shrink-0",children:e.jsx(A,{className:"w-5 h-5 text-primary"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap mb-1",children:[e.jsx("h3",{className:"font-semibold text-foreground",children:s.jobTitle}),e.jsx(C,{className:y("border-0 text-xs",s.status==="active"?"bg-green-100 text-green-700":"bg-muted text-muted-foreground"),children:s.status})]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground flex-wrap",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(ae,{className:"w-3.5 h-3.5"}),s.company]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(re,{className:"w-3.5 h-3.5"}),s.location]}),s.environment&&e.jsx(C,{className:"bg-muted text-muted-foreground border-0 text-xs",children:W[s.environment]??s.environment}),s.jobType&&e.jsx(C,{className:"bg-muted text-muted-foreground border-0 text-xs",children:xe[s.jobType]??s.jobType})]})]}),e.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[e.jsxs("div",{className:"text-right",children:[e.jsx("div",{className:"text-lg font-bold text-foreground",children:s.candidateCount}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"candidates"})]}),l?e.jsx(ne,{className:"w-4 h-4 text-muted-foreground"}):e.jsx(ie,{className:"w-4 h-4 text-muted-foreground"})]})]}),l&&e.jsxs("div",{className:"border-t",children:[e.jsxs("div",{className:"flex items-center gap-1 px-5 pt-4 border-b",children:[[{key:"candidates",label:"Candidate Pipeline",icon:V},{key:"coaching",label:"Interview Coaching",icon:L}].map(h=>e.jsxs("button",{onClick:()=>i(h.key),className:y("flex items-center gap-1.5 px-3 py-2 text-sm font-medium border-b-2 -mb-px transition-colors",d===h.key?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"),children:[e.jsx(h.icon,{className:"w-3.5 h-3.5"}),h.label]},h.key)),e.jsxs("div",{className:"ml-auto flex items-center gap-2 pb-2",children:[s.status==="active"&&e.jsxs(p,{size:"sm",variant:"outline",className:"h-7 text-xs gap-1 text-muted-foreground",onClick:()=>x.mutate(),children:[e.jsx(le,{className:"w-3 h-3"})," Close Posting"]}),e.jsxs(p,{size:"sm",variant:"ghost",className:"h-7 text-xs gap-1 text-red-500 hover:text-red-600 hover:bg-red-50",onClick:()=>{confirm("Delete this posting?")&&t.mutate()},children:[e.jsx(ce,{className:"w-3 h-3"})," Delete"]})]})]}
5),e.jsxs("div",{className:"p-5",children:[d==="candidates"&&e.jsx(je,{postId:s.id,postStatus:s.status}),d==="coaching"&&e.jsx(be,{postId:s.id,hasCoaching:m,onGenerated:()=>o(!0)})]})]})]})}function Ne(){const{data:s}=E({queryKey:["my-hiring-opportunities"],queryFn:()=>b("GET","/hiring/my-opportunities")}),l=s?.opportunities??[];return l.length?e.jsxs("div",{className:"mb-8 bg-blue-50 dark:bg-blue-950/20 border border-blue-200 dark:border-blue-800 rounded-xl p-5",children:[e.jsxs("h3",{className:"font-semibold text-blue-900 dark:text-blue-100 mb-1 flex items-center gap-2",children:[e.jsx(O,{className:"w-4 h-4"})," You've been matched to ",l.length," hiring opportunity",l.length!==1?"ies":""]}),e.jsx("p",{className:"text-sm text-blue-700 dark:text-blue-300 mb-3",children:"A hiring manager found your profile. Here's what's waiting for you:"}),e.jsx("div",{className:"space-y-2",children:l.map((r,d)=>{const i=F.find(m=>m.key===r.status);return e.jsxs("div",{className:"bg-white dark:bg-blue-950/40 rounded-lg p-3 flex items-center gap-3",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("p",{className:"font-medium text-sm",children:[r.jobTitle," ",e.jsx("span",{className:"text-muted-foreground",children:"at"})," ",r.company]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[r.location,r.environment?` · ${W[r.environment]??r.environment}`:""]}),r.prereqMessage&&r.status==="prereqs_sent"&&e.jsx("div",{className:"mt-2 bg-amber-50 rounded p-2 text-xs text-amber-800",children:r.prereqMessage})]}),i&&e.jsxs(C,{className:y(i.color,"border-0 text-xs gap-1"),children:[e.jsx(i.icon,{className:"w-3 h-3"}),i.label]})]},d)})})]}):null}function Me(){const[s,l]=u.useState(!1);k();const{data:r,isLoading:d}=E({queryKey:["hiring-posts"],queryFn:()=>b("GET","/hiring")}),i=r?.posts??[];return e.jsxs("div",{className:"p-4 sm:p-6 max-w-5xl mx-auto",children:[e.jsx(se,{icon:A,title:"Are You Hiring?",description:"Post a job, let AI match platform-ready candidates against your description, coach them through screening, and manage your full hiring pipeline â all in one place."}),e.jsx(Ne,{}),e.jsxs("div",{className:"flex items-center justify-between mb-5",children:[e.jsxs("h2",{className:"font-semibold text-foreground",children:["My Job Postings ",i.length>0&&e.jsxs("span",{className:"text-muted-foreground font-normal",children:["(",i.length,")"]})]}),e.jsxs(p,{onClick:()=>l(!s),className:"gap-2",children:[e.jsx($,{className:"w-4 h-4"})," Post a Job"]})]}),s&&e.jsx(he,{onClose:()=>l(!1),onCreated:()=>l(!1)}),d?e.jsx("div",{className:"space-y-3 animate-pulse",children:[...Array(3)].map((m,o)=>e.jsx("div",{className:"h-20 bg-muted rounded-xl"},o))}):i.length===0&&!s?e.jsxs("div",{className:"text-center py-16",children:[e.jsx(A,{className:"w-12 h-12 text-muted-foreground mx-auto mb-4"}),e.jsx("h3",{className:"font-semibold text-lg mb-2",children:"No job postings yet"}),e.jsx("p",{className:"text-sm text-muted-foreground max-w-sm mx-auto mb-5",children:"Post your first role and let AI find job-ready candidates from the platform â people who've been coached to succeed."}),e.jsxs(p,{onClick:()=>l(!0),className:"gap-2",children:[e.jsx($,{className:"w-4 h-4"})," Post Your First Job"]})]}):e.jsx("div",{className:"space-y-4",children:i.map(m=>e.jsx(fe,{post:m},m.id))})]})}export{Me 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.