PageSourceSearch

https://smartmentor.ai/assets/CorporateReports.BFdoVKoH.js

js smartmentor.ai collected 2026-10-05 16:21:23 UTC 37,389 bytes, 1 lines download raw bytes

1import{j as e,P as t}from"./vendor-ui-core.DP8knyZn.js";import{r as i,k as r}from"./vendor-react.BBoGJFYM.js";import{k as n,s as a,D as l,o,V as s,q as d,r as c,B as g,v as u,a as m,d as b,S as h,J as _,t as p,C as x,E as v,F as f,G as j}from"./index.CdjOtu-m.js";import{C as w,d as y,a as k,b as S}from"./card.XsCnmSQ7.js";import{P as B}from"./progress.D-6ZFe_H.js";import{a5 as N,a6 as T,U as I,g as C,L as R,M as A,aY as O,an as M,bz as z,bN as H,R as $,x as q,aP as P,b4 as D}from"./vendor-icons.BjAWwE8z.js";import"./vendor-supabase.DS-aP8MZ.js";import"./vendor-ui-forms.CjLBxE3d.js";import"./vendor-utils.BlEnRQrd.js";import"./vendor-ui-display.BT2Z6Vpo.js";import"./vendor-query.CfjDb5WU.js";import"./vendor-media.DY6E_qVO.js";import"./vendor-charts.RWeJ_I16.js";import"./vendor-motion.DCvbjL6b.js";var E="horizontal",W=["horizontal","vertical"],L=i.forwardRef((i,r)=>{const{decorative:n,orientation:a=E,...l}=i,o=function(e){return W.includes(e)}(a)?a:E,s=n?{role:"none"}:{"aria-orientation":"vertical"===o?o:void 0,role:"separator"};return e.jsx(t.div,{"data-orientation":o,...s,...l,ref:r})});L.displayName="Separator";var G=L;const V=i.forwardRef(({className:t,orientation:i="horizontal",decorative:r=!0,...a},l)=>e.jsx(G,{ref:l,decorative:r,orientation:i,className:n("shrink-0 bg-border","horizontal"===i?"h-[1px] w-full":"h-full w-[1px]",t),...a}));V.displayName=G.displayName;const J=e=>null==e?"text-muted-foreground":0===e?"text-red-600 dark:text-red-400":e>=75?"text-green-600 dark:text-green-400":e>=50?"text-yellow-600 dark:text-yellow-400":"text-red-600 dark:text-red-400",F=({open:t,onOpenChange:r,interviewId:n,candidateName:m,jobRoleTitle:b})=>{const[h,_]=i.useState(!0),[p,x]=i.useState(null),[v,f]=i.useState([]),[j,H]=i.useState(null),[$,q]=i.useState([]),[P,D]=i.useState("");i.useState(""),i.useEffect(()=>{t&&n&&E()},[t,n]);const E=async()=>{var e;_(!0);try{const[t,i,r,l,o,s,d,c]=await Promise.all([a.from("interviews").select("*").eq("id",n).single(),a.from("overall_interview_scores").select("*").eq("interview_id",n).maybeSingle(),a.from("technical_interview_scores").select("*").eq("interview_id",n).maybeSingle(),a.from("behavioral_interview_scores").select("*").eq("interview_id",n).maybeSingle(),a.from("interview_sessions").select("question_order, question, user_response").eq("interview_id",n).eq("message_type","ai_question").order("question_order",{ascending:!0}),a.from("technical_sub_parameter_feedback").select("*").eq("interview_id",n),a.from("behavioral_sub_parameter_feedback").select("*").eq("interview_id",n),a.from("overall_sub_parameter_feedback").select("*").eq("interview_id",n)]);x(t.data),D((null==(e=t.data)?void 0:e.interview_type)||""),q(o.data||[]);const g={};(s.data||[]).forEach(e=>{g[`${e.block_name}_${e.sub_parameter_id}`]=e});const u={};(d.data||[]).forEach(e=>{u[`${e.block_name}_${e.sub_parameter_id}`]=e});const m={};(c.data||[]).forEach(e=>{m[`${e.block_name}_${e.sub_parameter_id}`]=e});const b=i.data||r.data||l.data;if(!b)return f([]),H(null),void _(!1);const h=[];h.push({label:"Communication",total:b.communication_block_total,subParams:[{label:"Fluency",score:b.communication_fluency_score,weight:b.communication_fluency_weight,...W("communication","fluency",g,u,m)},{label:"Pronunciation",score:b.communication_pronunciation_score,weight:b.communication_pronunciation_weight,...W("communication","pronunciation",g,u,m)},{label:"Voice Quality",score:b.communication_voice_quality_score,weight:b.communication_voice_quality_weight,...W("communication","voice_quality",g,u,m)},{label:"Language Proficiency",score:b.communication_language_proficiency_score,weight:b.communication_language_proficiency_weight,...W("communication","language_proficiency",g,u,m)},{label:"Listening & Interpersonal",score:b.communication_listening_interpersonal_score,weight:b.communication_listening_interpersonal_weight,...W("communication","listening_interpersonal",g,u,m)}]}),void 0!==b.domain_skills_block_total&&null!==b.domain_skills_block_total&&h.push({label:"Domain Skills",total:b.domain_skills_block_total,subParams:[{label:"Fundamental C
1oncepts",score:b.domain_skills_fundamental_concepts_score,weight:b.domain_skills_fundamental_concepts_weight,...W("domain_skills","fundamental_concepts",g,u,m)},{label:"In-depth Concepts",score:b.domain_skills_indepth_concepts_score,weight:b.domain_skills_indepth_concepts_weight,...W("domain_skills","indepth_concepts",g,u,m)},{label:"Practical Application",score:b.domain_skills_practical_application_ability_score,weight:b.domain_skills_practical_application_ability_weight,...W("domain_skills","practical_application_ability",g,u,m)},{label:"Problem Solving",score:b.domain_skills_problem_solving_expertise_score,weight:b.domain_skills_problem_solving_expertise_weight,...W("domain_skills","problem_solving_expertise",g,u,m)},{label:"Industry Awareness",score:b.domain_skills_industry_awareness_score,weight:b.domain_skills_industry_awareness_weight,...W("domain_skills","industry_awareness",g,u,m)}]}),void 0!==b.structural_thinking_block_total&&null!==b.structural_thinking_block_total&&h.push({label:"Structural Thinking",total:b.structural_thinking_block_total,subParams:[{label:"Storytelling",score:b.structural_thinking_storytelling_score,weight:b.structural_thinking_storytelling_weight,...W("structural_thinking","storytelling",g,u,m)},{label:"Answering Framework",score:b.structural_thinking_answering_framework_score,weight:b.structural_thinking_answering_framework_weight,...W("structural_thinking","answering_framework",g,u,m)},{label:"Logical Sequencing",score:b.structural_thinking_logical_sequencing_score,weight:b.structural_thinking_logical_sequencing_weight,...W("structural_thinking","logical_sequencing",g,u,m)},{label:"Clarity & Brevity",score:b.structural_thinking_clarity_brevity_score,weight:b.structural_thinking_clarity_brevity_weight,...W("structural_thinking","clarity_brevity",g,u,m)},{label:"Conclusion & Takeaways",score:b.structural_thinking_conclusion_takeaways_score,weight:b.structural_thinking_conclusion_takeaways_weight,...W("structural_thinking","conclusion_takeaways",g,u,m)}]}),h.push({label:"Job Alignment",total:b.job_alignment_block_total,subParams:[{label:"Role-Specific Behaviors",score:b.job_alignment_role_specific_behaviors_score,weight:b.job_alignment_role_specific_behaviors_weight,...W("job_alignment","role_specific_behaviors",g,u,m)},{label:"Cultural & Values Alignment",score:b.job_alignment_cultural_values_alignment_score,weight:b.job_alignment_cultural_values_alignment_weight,...W("job_alignment","cultural_values_alignment",g,u,m)},{label:"Motivational Alignment",score:b.job_alignment_motivational_alignment_score,weight:b.job_alignment_motivational_alignment_weight,...W("job_alignment","motivational_alignment",g,u,m)},{label:"Interpersonal Alignment",score:b.job_alignment_interpersonal_alignment_score,weight:b.job_alignment_interpersonal_alignment_weight,...W("job_alignment","interpersonal_alignment",g,u,m)},{label:"Adaptability & Change",score:b.job_alignment_adaptability_change_score,weight:b.job_alignment_adaptability_change_weight,...W("job_alignment","adaptability_change",g,u,m)}]}),f(h),H(b.overall_overall_score??b.overall_technical_score??b.overall_behavioral_score??null)}catch(t){}finally{_(!1)}},W=(e,t,i,r,n)=>{const a=`${e}_${t}`,l=(null==n?void 0:n[a])||i[a]||r[a];return l?{strengths:l.strengths,weaknesses:l.weaknesses,reasoning:l.reasoning}:{}};return e.jsx(l,{open:t,onOpenChange:r,children:e.jsxs(o,{className:"max-w-5xl max-h-[90vh] p-0 print:max-w-none print:max-h-none print:h-auto print:overflow-visible print:shadow-none",children:[e.jsx("style",{children:"\n          .corp-report-root, .corp-report-root * {\n            --primary: 160 84% 39%;\n            --primary-foreground: 0 0% 100%;\n            --ring: 160 84% 39%;\n          }\n        "}),e.jsx(s,{className:"max-h-[90vh] print:max-h-none print:overflow-visible print:[&>div]:!overflow-visible",children:e.jsxs("div",{className:"corp-report-root p-6 space-y-6 print:p-4",id:"corporate-report",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs(d,{className:"text-left",children:[e.jsxs(c,{className:"text-xl font-bold flex items-center gap-2",children:[e.jsx(N,{className:"h-5 w-5",style:{color:"#10b981"}}),"AI Screening Report"]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Confidential — For Recruitment Use Only"})]}),e.jsxs(g,{variant:"outline",size:"sm",onClick:()=>{window.print()},className:"print:hidden",children:[e.jsx(T,{className:"h-4 w-4 mr-2"}),"Print"]})]}),e.jsx(w,{className:"border-emerald-500/20 bg-emerald-500/5",children:e.jsx(y,{className:"pt-4 pb-4",children:e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(I,{className:"h-4 w-4 text-muted-foreground"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"Candidate"}),e.jsx("p",{className:"font-semibold",children:m})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(C,{className:"h-4 w-4 text-muted-foreground"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"Role Applied"}),e.jsx("p",{className:"font-semibold",children:b})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(N,{className:"h-4 w-4 text-muted-foreground"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"Interview Type"}),e.jsx("p",{className:"font-semibold capitalize",children:P||"—"})]})]})]})})}),h?e.jsxs("div",{className:"flex items-center justify-center py-16",children:[e.jsx(R,{className:"h-8 w-8 animate-spin text-primary"}),e.jsx("span",{className:"ml-3 text-muted-foreground",children:"Loading report..."})]}):0===v.length?e.jsx(w,{children:e.jsx(y,{className:"py-12 text-center text-muted-foreground",children:e.jsx("p",{children:"No evaluation data available for this candidate yet."})})}):e.jsxs(e.Fragment,{children:[e.jsx(w,{children:e.jsx(y,{className:"pt-4 pb-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-muted-foreground font-medium",children:"Overall AI Score"}),e.jsxs("p",{className:`text-4xl font-bold ${J(j)}`,children:[null!==j?Math.round(j):"—",e.jsx("span",{className:"text-lg text-muted-foreground font-normal",children:"/100"})]})]}),e.jsxs("div",{className:"text-right",children:[e.jsx("p",{className:"text-sm text-muted-foreground font-medium",children:"HR Recommendation"}),(()=>{const t=null===(i=j)?{label:"N/A",icon:O,color:"text-muted-foreground"}:i>=75?{label:"Strong",icon:M,color:"text-green-600"}:i>=50?{label:"Average",icon:O,color:"text-yellow-600"}:{label:"Needs Improvement",icon:z,color:"text-red-600"};var i;const r=t.icon;return e.jsxs("div",{className:`flex items-center gap-2 ${t.color}`,children:[e.jsx(r,{className:"h-5 w-5"}),e.jsx("span",{className:"text-lg font-semibold",children:t.label})]})})()]})]})})}),e.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:v.map(t=>{return e.jsxs(w,{className:"print:break-inside-avoid",children:[e.jsxs(k,{className:"pb-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(S,{className:"text-base",children:t.label}),e.jsxs(u,{variant:"outline",className:J(t.total),children:[null!==t.total?Math.round(t.total):"—","/100"]})]}),e.jsx(B,{value:t.total??0,className:"h-2 "+(i=t.total,null===i?"":i>=75?"[&>div]:bg-green-500":i>=50?"[&>div]:bg-yellow-500":"[&>div]:bg-red-500")})]}),e.jsx(y,{className:"space-y-3",children:t.subParams.map(t=>e.jsxs("div",{className:"space-y-1 py-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:t.label}),e.jsx("span",{className:`font-semibold ${J(t.score)}`,children:null!==t.score&&void 0!==t.score?`${Math.round(t.score)}/5`:"—"})]}),t.reasoning&&e.jsx("p",{className:"text-xs text-muted-foreground
1/80 italic pl-2 border-l-2 border-muted",children:t.reasoning})]},t.label))})]},t.label);var i})}),$.length>0&&e.jsxs(w,{className:"print:break-inside-avoid",children:[e.jsxs(k,{className:"pb-3",children:[e.jsxs(S,{className:"text-base flex items-center gap-2",children:[e.jsx(A,{className:"h-4 w-4 text-primary"}),"Interview Transcript"]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[$.length," questions answered"]})]}),e.jsx(y,{className:"space-y-4",children:$.map((t,i)=>e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsxs(u,{variant:"outline",className:"text-xs shrink-0 mt-0.5",children:["Q",t.question_order]}),e.jsx("p",{className:"text-sm font-medium",children:t.question||"—"})]}),e.jsx("div",{className:"ml-8 p-3 bg-muted/50 rounded-md",children:e.jsx("p",{className:"text-sm text-foreground whitespace-pre-wrap",children:t.user_response||e.jsx("span",{className:"text-muted-foreground italic",children:"No response recorded"})})}),i<$.length-1&&e.jsx(V,{className:"mt-2"})]},i))})]})]}),e.jsxs("div",{className:"text-center text-xs text-muted-foreground pt-2 pb-4 print:pb-0",children:[e.jsx("p",{children:"Generated by SmartMentor.ai — AI-Powered Interview Screening Platform"}),e.jsxs("p",{children:["Report generated on ",(new Date).toLocaleDateString("en-IN",{day:"numeric",month:"long",year:"numeric"})]})]})]})})]})})},U=[{value:"screening",label:"AI Screened"},{value:"interviewed",label:"Interviewed"},{value:"shortlisted",label:"Shortlisted"},{value:"rejected",label:"Rejected"},{value:"hired",label:"Hired"}],Y=e=>{var t;return"screening"===e||"ai_screened"===e?"AI Screened":(null==(t=U.find(t=>t.value===e))?void 0:t.label)||e||"Invited"},X={dark:{tableBg:"rgba(255,255,255,0.03)",tableBorder:"rgba(255,255,255,0.07)",tableHeadBg:"rgba(255,255,255,0.05)",tableRowHoverBg:"rgba(16,185,129,0.06)",tableRowBorder:"rgba(255,255,255,0.05)",colDivider:"rgba(255,255,255,0.06)",titleText:"rgba(255,255,255,0.92)",subText:"rgba(255,255,255,0.40)",headText:"rgba(255,255,255,0.55)",cellText:"rgba(255,255,255,0.82)",mutedText:"rgba(255,255,255,0.35)",nameText:"rgba(255,255,255,0.88)",emailSubText:"rgba(255,255,255,0.35)",scoreGood:"#34d399",scoreMid:"#fbbf24",scoreBad:"#f87171",scoreMuted:"rgba(255,255,255,0.25)",badgeHiredBg:"rgba(16,185,129,0.18)",badgeHiredText:"#10b981",badgeHiredBorder:"rgba(16,185,129,0.35)",badgeShortlistBg:"rgba(96,165,250,0.14)",badgeShortlistText:"#60a5fa",badgeShortlistBorder:"rgba(96,165,250,0.28)",badgeRejectedBg:"rgba(248,113,113,0.12)",badgeRejectedText:"#f87171",badgeRejectedBorder:"rgba(248,113,113,0.28)",badgeInterviewedBg:"rgba(129,140,248,0.14)",badgeInterviewedText:"#818cf8",badgeInterviewedBorder:"rgba(129,140,248,0.28)",badgeScreenedBg:"rgba(45,212,191,0.12)",badgeScreenedText:"#2dd4bf",badgeScreenedBorder:"rgba(45,212,191,0.25)",badgeInvitedBg:"rgba(255,255,255,0.07)",badgeInvitedText:"rgba(255,255,255,0.55)",badgeInvitedBorder:"rgba(255,255,255,0.14)",cellSelectBg:"rgba(255,255,255,0.04)",cellSelectBorder:"rgba(255,255,255,0.10)",selectBg:"rgba(255,255,255,0.06)",selectBorder:"rgba(16,185,129,0.20)",selectText:"rgba(255,255,255,0.80)",btnOutlineBg:"rgba(255,255,255,0.05)",btnOutlineBorder:"rgba(255,255,255,0.14)",btnOutlineText:"rgba(255,255,255,0.70)",btnOutlineHoverBg:"rgba(255,255,255,0.09)",btnOutlineHoverText:"rgba(255,255,255,0.92)",btnGhostText:"rgba(255,255,255,0.40)",btnGhostHoverBg:"rgba(255,255,255,0.07)",btnGhostHoverText:"rgba(255,255,255,0.82)",divider:"rgba(255,255,255,0.06)",emptyIconColor:"rgba(255,255,255,0.18)",countBadgeBg:"rgba(16,185,129,0.14)",countBadgeText:"#10b981",inputBg:"rgba(255,255,255,0.05)",inputBorder:"rgba(255,255,255,0.12)",inputText:"rgba(255,255,255,0.88)",shimmerBase:"rgba(255,255,255,0.04)"},light:{tableBg:"rgba(16,185,129,0.04)",tableBorder:"rgba(16,185,129,0.18)",tableHeadBg:"rgba(16,185,129,0.10)",tableRowHoverBg:"rgba(16,185,129,0.10)",tableRowBorder:"rgba(16,185,129,0.10)",colDivider:"rgba(16,185,129,0.14)",titleText:"rgba(255,255,255,0.96)",subText:"rgba(255,255,255,0.55)",headText:"rgba(255,255,255,0.72)",cellText:"rgba(255,255,255,0.90)",mutedText:"rgba(255,255,255,0.50)",nameText:"rgba(255,255,255,0.95)",emailSubText:"rgba(255,255,255,0.50)",scoreGood:"#10b981",scoreMid:"#f59e0b",scoreBad:"#ef4444",scoreMuted:"rgba(255,255,255,0.35)",badgeHiredBg:"rgba(16,185,129,0.25)",badgeHiredText:"#10b981",badgeHiredBorder:"rgba(16,185,129,0.50)",badgeShortlistBg:"rgba(96,165,250,0.20)",badgeShortlistText:"#60a5fa",badgeShortlistBorder:"rgba(96,165,250,0.40)",badgeRejectedBg:"rgba(248,113,113,0.18)",badgeRejectedText:"#f87171",badgeRejectedBorder:"rgba(248,113,113,0.38)",badgeInterviewedBg:"rgba(129,140,248,0.20)",badgeInterviewedText:"#818cf8",badgeInterviewedBorder:"rgba(129,140,248,0.38)",badgeScreenedBg:"rgba(45,212,191,0.18)",badgeScreenedText:"#2dd4bf",badgeScreenedBorder:"rgba(45,212,191,0.35)",badgeInvitedBg:"rgba(255,255,255,0.12)",badgeInvitedText:"rgba(255,255,255,0.70)",badgeInvitedBorder:"rgba(255,255,255,0.22)",cellSelectBg:"rgba(16,185,129,0.08)",cellSelectBorder:"rgba(16,185,129,0.22)",selectBg:"rgba(16,185,129,0.12)",selectBorder:"rgba(16,185,129,0.35)",selectText:"rgba(255,255,255,0.90)",btnOutlineBg:"rgba(16,185,129,0.10)",btnOutlineBorder:"rgba(16,185,129,0.28)",btnOutlineText:"rgba(255,255,255,0.75)",btnOutlineHoverBg:"rgba(16,185,129,0.18)",btnOutlineHoverText:"rgba(255,255,255,0.95)",btnGhostText:"rgba(255,255,255,0.55)",btnGhostHoverBg:"rgba(16,185,129,0.12)",btnGhostHoverText:"rgba(255,255,255,0.95)",divider:"rgba(16,185,129,0.18)",emptyIconColor:"rgba(255,255,255,0.30)",countBadgeBg:"rgba(16,185,129,0.20)",countBadgeText:"#10b981",inputBg:"rgba(16,185,129,0.08)",inputBorder:"rgba(16,185,129,0.28)",inputText:"rgba(255,255,255,0.95)",shimmerBase:"rgba(255,255,255,0.06)"}},Q="#10b981";const Z=({value:t,onValueChange:i,p:r,placeholder:n,children:a,width:l=190})=>e.jsxs(x,{value:t,onValueChange:i,children:[e.jsx(v,{style:{width:l,background:r.selectBg,border:`1px solid ${r.selectBorder}`,color:r.selectText,borderRadius:9,fontSize:12,height:34,paddingLeft:10,paddingRight:8,boxShadow:"none"},children:e.jsx(f,{placeholder:n})}),e.jsx(j,{children:a})]}),K=({onClick:t,children:r,variant:n="outline",p:a,disabled:l=!1,style:o={}})=>{const[s,d]=i.useState(!1),c={outline:{background:s?a.btnOutlineHoverBg:a.btnOutlineBg,color:s?a.btnOutlineHoverText:a.btnOutlineText,border:`1px solid ${a.btnOutlineBorder}`},ghost:{background:s?a.btnGhostHoverBg:"transparent",color:s?a.btnGhostHoverText:a.btnGhostText,border:"1px solid transparent"}};return e.jsx("button",{onClick:l?void 0:t,disabled:l,style:{display:"inline-flex",alignItems:"center",gap:5,height:32,padding:"0 10px",borderRadius:8,fontSize:12,fontWeight:600,cursor:l?"not-allowed":"pointer",opacity:l?.45:1,transition:"background 160ms, color 160ms",outline:"none",flexShrink:0,...c[n],...o},onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),children:r})},ee=(e,t)=>
1e>=75?t.scoreGood:e>=50?t.scoreMid:t.scoreBad,te=({score:t,p:i,isOverall:r})=>{if(null==t)return e.jsx("span",{style:{color:i.scoreMuted,fontSize:11},children:"—"});const n=Math.round(t);return e.jsx("span",{style:{fontSize:r?13:12,fontWeight:700,color:ee(n,i)},children:n})},ie=({status:t,p:i})=>{const r={hired:{bg:i.badgeHiredBg,text:i.badgeHiredText,border:i.badgeHiredBorder},shortlisted:{bg:i.badgeShortlistBg,text:i.badgeShortlistText,border:i.badgeShortlistBorder},rejected:{bg:i.badgeRejectedBg,text:i.badgeRejectedText,border:i.badgeRejectedBorder},interviewed:{bg:i.badgeInterviewedBg,text:i.badgeInterviewedText,border:i.badgeInterviewedBorder},screening:{bg:i.badgeScreenedBg,text:i.badgeScreenedText,border:i.badgeScreenedBorder},ai_screened:{bg:i.badgeScreenedBg,text:i.badgeScreenedText,border:i.badgeScreenedBorder},invited:{bg:i.badgeInvitedBg,text:i.badgeInvitedText,border:i.badgeInvitedBorder}},n=r[t??"invited"]??r.invited;return e.jsx("span",{style:{display:"inline-flex",alignItems:"center",fontSize:9.5,fontWeight:700,padding:"2px 7px",borderRadius:6,background:n.bg,color:n.text,border:`1px solid ${n.border}`,textTransform:"capitalize",lineHeight:1.5,whiteSpace:"nowrap"},children:Y(t)})},re=({onClick:t,children:r,p:n,title:a})=>{const[l,o]=i.useState(!1);return e.jsx("button",{onClick:t,title:a,style:{display:"inline-flex",alignItems:"center",gap:4,height:26,padding:"0 7px",borderRadius:7,fontSize:11,fontWeight:600,cursor:"pointer",border:"none",background:l?n.btnGhostHoverBg:"transparent",color:l?n.btnGhostHoverText:n.btnGhostText,transition:"background 150ms, color 150ms",outline:"none"},onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),children:r})},ne=({value:t,onChange:i,p:r})=>e.jsxs(x,{value:t,onValueChange:i,children:[e.jsx(v,{style:{height:28,minWidth:118,maxWidth:140,background:r.cellSelectBg,border:`1px solid ${r.cellSelectBorder}`,borderRadius:7,fontSize:11,paddingLeft:7,paddingRight:6,boxShadow:"none",color:r.cellText},children:e.jsx(f,{})}),e.jsx(j,{children:U.map(t=>e.jsx(_,{value:t.value,children:t.label},t.value))})]}),ae=({p:t,...i})=>e.jsx("textarea",{...i,style:{width:"100%",padding:"8px 10px",borderRadius:8,background:t.inputBg,border:`1px solid ${t.inputBorder}`,color:t.inputText,fontSize:13,outline:"none",resize:"vertical",lineHeight:1.5,transition:"border-color 180ms",...i.style||{}},onFocus:e=>{e.currentTarget.style.borderColor=Q},onBlur:e=>{e.currentTarget.style.borderColor=t.inputBorder}}),le=({children:t,align:i="left",p:r,bordered:n})=>e.jsx("th",{style:{textAlign:i,padding:"9px 10px",fontSize:10,fontWeight:700,color:r.headText,whiteSpace:"normal",borderBottom:`1px solid ${r.tableRowBorder}`,borderLeft:n?`1px solid ${r.colDivider}`:void 0,background:r.tableHeadBg,userSelect:"none"},children:t}),oe=()=>{var t;const{user:n}=m(),{corporateId:s}=b(),g=function(){const e=i.useCallback(()=>{var e;if("undefined"!=typeof document){const e=document.documentElement.getAttribute("data-theme")??document.documentElement.getAttribute("class")??"";if(e.includes("light"))return"light";if(e.includes("dark"))return"dark"}return"undefined"!=typeof window&&(null==(e=window.matchMedia)?void 0:e.call(window,"(prefers-color-scheme: light)").matches)?"light":"dark"},[]),[t,r]=i.useState(e);return i.useEffect(()=>{const t=new MutationObserver(()=>r(e()));return t.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme","class"]}),()=>t.disconnect()},[e]),t}(),u=X[g],[x,v]=r(),[f,j]=i.useState([]),[w,y]=i.useState([]),[k,S]=i.useState([]),[B,T]=i.useState(!0),[I,C]=i.useState({}),[R,A]=i.useState({}),[O,M]=i.useState({}),[z,E]=i.useState(!1),[W,L]=i.useState(null),[G,V]=i.useState(""),[J,ee]=i.useState(!1),[oe,se]=i.useState(""),[de,ce]=i.useState(""),[ge,ue]=i.useState(""),[me,be]=i.useState("all"),[he,_e]=i.useState("all"),[pe,xe]=i.useState(null),ve=x.get("job_role_id")||"all";i.useEffect(()=>{s&&fe()},[s,ve]);const fe=async()=>{if(!s)return;T(!0);const e="all"!==ve?a.from("candidate_profiles").select("*, job_role:job_roles(title)").eq("corporate_id",s).eq("job_role_id",ve).order("created_at",{ascending:!1}):a.from("candidate_profiles").select("*, job_role:job_roles(title)").eq("corporate_id",s).order("created_at",{ascending:!1}),[t,i,r]=await Promise.all([a.from("job_roles").select("id, title, hiring_manager").eq("corporate_id",s),e,a.from("candidate_invitations").select("*").eq("corporate_id",s)]),n=t.data||[],l=i.data||[],o=r.data||[];S(n),j(l),y(o),T(!1);const d=l.map(e=>
1e.user_id).filter(Boolean);if(d.length>0){const{data:e}=await a.from("profiles").select("user_id, full_name, resume_content, resume_filename, resume_file_path").in("user_id",d);if(e){const t={},i={};e.forEach(e=>{e.full_name&&(t[e.user_id]=e.full_name),(e.resume_content||e.resume_filename||e.resume_file_path)&&(i[e.user_id]={content:e.resume_content,filename:e.resume_filename,filePath:e.resume_file_path})}),A(t),M(i)}}const c=l.filter(e=>e.interview_id);c.length>0&&je(c)},je=async e=>{const t=e.map(e=>e.interview_id).filter(Boolean);if(!t.length)return;const[i,r,n]=await Promise.all([a.from("technical_interview_scores").select("interview_id, communication_block_total, domain_skills_block_total, job_alignment_block_total, overall_technical_score").in("interview_id",t),a.from("behavioral_interview_scores").select("interview_id, communication_block_total, structural_thinking_block_total, job_alignment_block_total, overall_behavioral_score").in("interview_id",t),a.from("overall_interview_scores").select("interview_id, communication_block_total, domain_skills_block_total, structural_thinking_block_total, job_alignment_block_total, overall_overall_score").in("interview_id",t)]),l={};for(const a of n.data||[])l[a.interview_id]={communication:a.communication_block_total,domain_skills:a.domain_skills_block_total,structural_thinking:a.structural_thinking_block_total,job_alignment:a.job_alignment_block_total,overall:a.overall_overall_score};for(const a of i.data||[])l[a.interview_id]||(l[a.interview_id]={communication:a.communication_block_total,domain_skills:a.domain_skills_block_total,structural_thinking:null,job_alignment:a.job_alignment_block_total,overall:a.overall_technical_score});for(const a of r.data||[])l[a.interview_id]||(l[a.interview_id]={communication:a.communication_block_total,domain_skills:null,structural_thinking:a.structural_thinking_block_total,job_alignment:a.job_alignment_block_total,overall:a.overall_behavioral_score});const o={};for(const a of e)a.interview_id&&l[a.interview_id]&&(o[a.id]=l[a.interview_id]);C(o)},we=(e,t)=>{const i=URL.createObjectURL(e),r=document.createElement("a");r.href=i,r.download=t,r.click(),URL.revokeObjectURL(i)},ye=w.filter(e=>"accepted"!==e.status).filter(e=>!f.some(t=>t.invitation_id===e.id)).filter(e=>"all"===ve||e.job_role_id===ve).map(e=>{const t=k.find(t=>t.id===e.job_role_id);return{id:`inv-${e.id}`,user_id:e.email,job_role_id:e.job_role_id,pipeline_status:"invited",recruiter_notes:null,rating:null,created_at:e.created_at,updated_at:null,invitation_id:e.id,interview_id:null,job_role:t?{title:t.title}:null,_isInvitation:!0,_fullName:e.full_name}}),ke=[...f,...ye],Se=[...new Set(k.map(e=>e.hiring_manager).filter(Boolean))],Be=ke.filter(e=>{if("all"!==me&&e.pipeline_status!==me&&("screening"!==me||"ai_screened"!==e.pipeline_status))return!1;if("all"!==he){const t=k.find(t=>t.id===e.job_role_id);if((null==t?void 0:t.hiring_manager)!==he)return!1}return!0}),Ne="all"!==ve?null==(t=k.find(e=>e.id===ve))?void 0:t.title:null;return e.jsxs(e.Fragment,{children:[e.jsx(h,{title:"Pipeline Management | Corporate Portal",description:"Manage your hiring pipeline."}),e.jsx("style",{children:"\n        @keyframes cr-spin { from{transform:rotate(0)} to{transform:rotate(360deg)} }\n        @keyframes cr-shimmer { 0%{opacity:.5} 50%{opacity:1} 100%{opacity:.5} }\n        .cr-spin { animation: cr-spin 1s linear infinite; }\n        .cr-shimmer { animation: cr-shimmer 1.5s ease-in-out infinite; }\n      "}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:0,width:"100%"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"flex-end",justifyContent:"space-between",flexWrap:"wrap",gap:12,marginBottom:18},children:[e.jsxs("div",{children:[e.jsxs("h1",{style:{fontSize:17,fontWeight:800,color:"rgba(255,255,255,0.92)",margin:0,letterSpacing:"-0.3px"},children:["Pipeline"," ",e.jsx("span",{style:{color:Q,fontWeight:700},children:" Management"})]}),e.jsx("p",{style:{fontSize:11.5,color:u.subText,marginTop:2,marginBottom:0},children:Ne?`Showing data for: ${Ne}`:`${f.length} candidates · ${w.length} invitations`})]}),e.jsxs("div",{style:{display:"flex",gap:8,flexWrap:"wrap",alignItems:"center"},children:[Se.length>0&&e.jsxs(Z,{value:he,onValueChange:_e,p:u,placeholder:"Hiring Manager",width:190,children:[e.jsx(_,{value:"all",children:"All Hiring Managers"}),Se.map(t=>e.jsx(_,{value:t,children:t},t))]}),e.jsxs(Z,{value:ve,onValueChange:e=>{"all"===e?x.delete("job_role_id"):x.set("job_role_id",e),v(x)},p:u,placeholder:"All Job Roles",width:200,children:[e.jsx(_,{value:"all",children:"All Job Roles"}),k.map(t=>e.jsx(_,{value:t.id,children:t.title},t.id))]}),e.jsxs(Z,{value:me,onValueChange:be,p:u,placeholder:"Status",width:150,children:[e.jsx(_,{value:"all",children:"All Statuses"}),U.map(t=>e.jsx(_,{value:t.value,children:t.label},t.value))]}),Be.length>0&&e.jsxs(K,{variant:"outline",p:u,onClick:()=>{const e=Be.map(e=>{var t;const i=e._fullName||R[e.user_id]||e.user_id,r=(null==(t=e.job_role)?void 0:t.t
1itle)||"—",n=I[e.id];return[i,r,null!=(null==n?void 0:n.communication)?Math.round(n.communication):"",null!=(null==n?void 0:n.domain_skills)?Math.round(n.domain_skills):"",null!=(null==n?void 0:n.structural_thinking)?Math.round(n.structural_thinking):"",null!=(null==n?void 0:n.job_alignment)?Math.round(n.job_alignment):"",null!=(null==n?void 0:n.overall)?Math.round(n.overall):"",Y(e.pipeline_status),(e.recruiter_notes||"").replace(/"/g,'""')].map(e=>`"${e}"`).join(",")}),t=[["Candidate Name","Job Role","Communication","Domain Skills","Structural Thinking","Job Alignment","Overall Score","Status","Notes"].join(","),...e].join("\n");we(new Blob([t],{type:"text/csv"}),`pipeline-report-${(new Date).toISOString().split("T")[0]}.csv`),p({title:"CSV exported",description:`${e.length} candidates exported.`})},children:[e.jsx(H,{style:{width:12,height:12}})," Export CSV"]}),e.jsxs(K,{variant:"outline",p:u,onClick:fe,disabled:B,children:[e.jsx($,{style:{width:12,height:12,...B?{animation:"cr-spin 1s linear infinite"}:{}}}),"Refresh"]})]})]}),e.jsx("div",{style:{height:1,background:u.divider,marginBottom:20}}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:12},children:[e.jsx(q,{style:{width:15,height:15,color:u.countBadgeText}}),e.jsx("span",{style:{fontSize:14,fontWeight:700,color:"rgba(255,255,255,0.80)"},children:"Candidates"}),e.jsx("span",{style:{display:"inline-flex",alignItems:"center",fontSize:10,fontWeight:700,padding:"1px 8px",borderRadius:20,background:u.countBadgeBg,color:u.countBadgeText},children:Be.length})]}),B?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[1,2,3,4,5].map(t=>e.jsx("div",{className:"cr-shimmer",style:{height:38,borderRadius:8,background:u.shimmerBase}},t))}):0===Be.length?e.jsxs("div",{style:{background:u.tableBg,border:`1px solid ${u.tableBorder}`,borderRadius:14,padding:"48px 24px",textAlign:"center"},children:[e.jsx(q,{style:{width:36,height:36,color:u.emptyIconColor,margin:"0 auto 12px"}}),e.jsx("p",{style:{fontSize:15,fontWeight:700,color:"rgba(255,255,255,0.70)",margin:0},children:"No candidates yet"}),e.jsx("p",{style:{fontSize:12.5,color:u.mutedText,marginTop:4},children:"Invite candidates from the Candidates page to see them here."})]}):e.jsx("div",{style:{width:"100%",overflowX:"auto",background:u.tableBg,border:`1px solid ${u.tableBorder}`,borderRadius:14},children:e.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",minWidth:900},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx(le,{p:u,children:"Candidate"}),e.jsx(le,{p:u,children:"Job Role"}),e.jsx(le,{p:u,align:"center",bordered:!0,children:"Comm."}),e.jsx(le,{p:u,align:"center",bordered:!0,children:"Domain"}),e.jsx(le,{p:u,align:"center",bordered:!0,children:"Structural"}),e.jsx(le,{p:u,align:"center",bordered:!0,children:"Job Align."}),e.jsx(le,{p:u,align:"center",bordered:!0,children:"Overall"}),e.jsx(le,{p:u,align:"center",bordered:!0,children:"Resume"}),e.jsx(le,{p:u,align:"center",bordered:!0,children:"Report"}),e.jsx(le,{p:u,bordered:!0,children:"Status"}),e.jsx(le,{p:u,children:"Notes"})]})}),e.jsx("tbody",{children:Be.map(t=>{var i;const r=O[t.user_id],n=I[t.id],l=pe===t.id,o=t._fullName||R[t.user_id]||(t.id.startsWith("inv-")?t.user_id:`${t.user_id.substring(0,8)}…`),s=t._isInvitation;return e.jsxs("tr",{onMouseEnter:()=>xe(t.id),onMouseLeave:()=>xe(null),style:{background:l?u.tableRowHoverBg:"transparent",borderBottom:`1px solid ${u.tableRowBorder}`,transition:"background 140ms"},children:[e.jsxs("td",{style:{padding:"8px 10px",verticalAlign:"middle",minWidth:130},children:[e.jsx("span",{style:{fontSize:12,fontWeight:600,color:u.nameText,display:"block",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:160},children:o}),s&&e.jsx("span",{style:{fontSize:10,color:u.emailSubText,display:"block",overflow:"hidden",textOverflow:"ellipsis",maxWidth:160},children:t.user_id})]}),e.jsx("td",{style:{padding:"8px 10px",verticalAlign:"middle",maxWidth:170},children:e.jsx("span",{style:{fontSize:11.5,color:u.cellText,wordBreak:"break-word"},children:(null==(i=t.job_role)?void 0:i.title)||"—"})}),["communication","domain_skills","structural_thinking","job_alignment"].map(t=>e.jsx("td",{style:{padding:"8px 10px",textAlign:"center",verticalAlign:"middle",borderLeft:`1px solid ${u.colDivider}`},children:e.jsx(te,{score:null==n?void 0:n[t],p:u})},t)),e.jsx("td",{style:{padding:"8px 10px",textAlign:"center",verticalAlign:"middle",borderLeft:`1px solid ${u.colDivider}`},children:e.jsx(te,{score:null==n?void 0:n.overall,p:u,isOverall:!0})}),e.jsx("td",{style:{padding:"8px 10px",textAlign:"center",verticalAlign:"middle",borderLeft:`1px solid ${u.colDivider}`},children:(null==r?void 0:r.filePath)||(null==r?void 0:r.content)?e.jsxs(re,{p:u,title:"Download resume",onClick:async()=>{var e;try{const i=await(async(e,t)=>{const{data:{session:i}}=await a.auth.getSession();if(!(null==i?void 0:i.access_token))throw new Error("Session expired.");const r=await fetch("https://qzsjapqjvrpoctacudud.supabase.co/functions/v1/corporate-download-resume",{method:"POST",headers:{Authorization:`Bearer ${i.access_token}`,apikey:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InF6c2phcHFqdnJwb2N0YWN1ZHVkIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NTcyMzY5MTAsImV4cCI6MjA3MjgxMjkxMH0.n_hYgnmNEek1O1uzPUFXq1oJEVIpMnkq6acXsYP4SVQ","Content-Type":"application/json"},body:JSON.stringify({candidate_user_id:e,resume_file_path:null==t?void 0:t.filePath,resume_filename:null==t?void 0:t.filename})});if(r.ok){const e=await r.blob(),i=(r.headers.get("content-disposition")||"").match(/filename\*=UTF-8''([^;]+)|filename="?([^";]+)"?/i);return we(e,(null==i?void 0:i[1])?decodeURIComponent(i[1]):(null==i?void 0:i[2])||(null==t?void 0:t.filename)||"resume.pdf"),!0}let n={};try{n=await r.json()}catch{}
1if(404===r.status&&"ORIGINAL_NOT_FOUND"===n.code)return!1;throw new Error(n.error||"Failed to download")})(t.user_id,r);!i&&(null==r?void 0:r.content)?(we(new Blob([r.content],{type:"text/plain"}),((null==(e=r.filename)?void 0:e.replace(/\.[^.]+$/,""))||"resume")+"-parsed.txt"),p({title:"Note",description:"Original unavailable. Downloaded parsed version.",variant:"default"})):i||p({title:"Download failed",description:"Resume file unavailable.",variant:"destructive"})}catch(i){p({title:"Download failed",description:i.message,variant:"destructive"})}},children:[e.jsx(P,{style:{width:11,height:11}})," CV"]}):e.jsx("span",{style:{color:u.mutedText,fontSize:11},children:"—"})}),e.jsx("td",{style:{padding:"8px 10px",textAlign:"center",verticalAlign:"middle",borderLeft:`1px solid ${u.colDivider}`},children:t.interview_id?e.jsxs(re,{p:u,title:"View report",onClick:()=>{var e;se(t.interview_id),ce(t._fullName||R[t.user_id]||"Candidate"),ue((null==(e=t.job_role)?void 0:e.title)||"—"),ee(!0)},children:[e.jsx(N,{style:{width:11,height:11}})," View"]}):e.jsx("span",{style:{color:u.mutedText,fontSize:11},children:"—"})}),e.jsx("td",{style:{padding:"8px 10px",verticalAlign:"middle",borderLeft:`1px solid ${u.colDivider}`},children:s?e.jsx(ie,{status:"invited",p:u}):e.jsx(ne,{value:t.pipeline_status||"invited",onChange:e=>(async(e,t)=>{const{error:i}=await a.from("candidate_profiles").update({pipeline_status:t}).eq("id",e);i?p({title:"Error",description:i.message,variant:"destructive"}):fe()})(t.id,e),p:u})}),e.jsx("td",{style:{padding:"8px 10px",verticalAlign:"middle",minWidth:180},children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[e.jsx("span",{style:{fontSize:11,color:u.mutedText,flex:1,wordBreak:"break-word",whiteSpace:"normal"},children:t.recruiter_notes||"—"}),!s&&e.jsx(re,{p:u,title:"Edit notes",onClick:()=>{L(t),V(t.recruiter_notes||""),E(!0)},children:e.jsx(D,{style:{width:11,height:11}})})]})})]},t.id)})})]})}),e.jsx("div",{style:{height:16}})]}),e.jsx(l,{open:z,onOpenChange:E,children:e.jsxs(o,{children:[e.jsx(d,{children:e.jsx(c,{children:"Recruiter Notes"})}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:14,marginTop:12},children:[e.jsx(ae,{p:u,rows:6,placeholder:"Add notes about this candidate…",value:G,onChange:e=>V(e.target.value)}),e.jsx("button",{onClick:async()=>{if(!W)return;const{error:e}=await a.from("candidate_profiles").update({recruiter_notes:G,feedback_by:null==n?void 0:n.id,feedback_at:(new Date).toISOString()}).eq("id",W.id);e?p({title:"Error",description:e.message,variant:"destructive"}):(p({title:"Notes saved"}),E(!1),fe())},style:{height:38,borderRadius:9,background:Q,color:"#fff",border:`1px solid ${Q}`,fontSize:13,fontWeight:700,cursor:"pointer",width:"100%"},children:"Save Notes"})]})]})}),e.jsx(F,{open:J,onOpenChange:ee,interviewId:oe,candidateName:de,jobRoleTitle:ge})]})};export{oe 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.