1import{bC as Ke,j as t,G as S,as as K,X as Xe,O as Ve,e as Ye,u as Ze,r,H as I,ge as et,eF as fe,cD as ge,bK as tt,bz as we,c2 as st,a4 as ye,b0 as at,bT as je,$ as ve}from"./index-C-_Qp0pL.js";import{g as Ue,f as X,b as Ne,a as Se,c as ke,m as W,d as Ce,e as nt,p as it}from"./intakeMeetingUtils-DHYkDDnp.js";import{H as rt}from"./HiringManagerDossierEditor-B1ML429G.js";import{H as ot}from"./HtmlArtifactFrame-OfuerTch.js";import{P as lt}from"./PreparedBriefCard-5ZyYovun.js";import{A as dt}from"./arrow-down-up-C4UwBsHE.js";import{C as _e}from"./circle-check-big-DEIopdnn.js";import{L as ct}from"./link-2-DNOdglon.js";import{E as ut}from"./external-link-c8aIG85e.js";function mt({meeting:a,loading:c=!1,error:l="",deleting:u=!1,onClose:x,onDelete:p,children:b}){if(Ke({enabled:!!(a||c||l),onClose:x,disabled:u}),!a&&!c&&!l)return null;const y=Ue(a?.status,a?.confirmationStatus||a?.confirmation_status),U=a?.id||a?.meeting_id,A=`${a?.role_title||a?.output?.role_title||a?.brief?.requirements?.title||"Untitled Role"} â ${a?.company_name||a?.brief?.company?.name||"Unknown company"}`,M=X(a?.created_at),P=X(a?.updated_at),E=a?.artifact_html||a?.output?.html||"";return t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:x,className:"fixed inset-0 z-40 bg-slate-900/35 backdrop-blur-[1px]","aria-label":"Close calibration artifact"}),t.jsxs("aside",{className:"fixed inset-y-0 right-0 z-50 flex w-full max-w-[960px] flex-col border-l border-stone-200 bg-[#F8F7F4] shadow-2xl",children:[t.jsx("div",{className:"border-b border-stone-200 bg-white/95 px-5 py-4 backdrop-blur",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsx("span",{className:"rounded-full bg-stone-100 px-2.5 py-1 text-[11px] font-medium uppercase tracking-[0.18em] text-slate-600",children:"Artifact"}),t.jsx("span",{className:"rounded-full bg-white px-2.5 py-1 text-[11px] font-medium uppercase tracking-[0.18em] text-slate-500 ring-1 ring-inset ring-stone-200",children:"Calibration Notes"}),t.jsx("span",{className:`rounded-full px-2.5 py-1 text-[11px] font-medium uppercase tracking-[0.18em] ${y.className}`,children:y.label})]}),t.jsx("h3",{className:"mt-3 text-lg font-semibold text-slate-900",children:A}),t.jsxs("p",{className:"mt-1 text-sm leading-6 text-slate-500",children:[M?`Created ${M}`:"Saved calibration",P?` · Updated ${P}`:""]})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[U?t.jsxs("button",{type:"button",onClick:()=>p?.(U),disabled:u,className:"inline-flex h-10 items-center gap-2 rounded-2xl border border-red-200 bg-red-50 px-3 text-sm font-medium text-red-700 transition hover:bg-red-100 disabled:cursor-not-allowed disabled:opacity-60",children:[u?t.jsx(S,{size:14,className:"animate-spin"}):t.jsx(K,{size:14}),"Delete"]}):null,t.jsx("button",{type:"button",onClick:x,className:"inline-flex h-10 w-10 items-center justify-center rounded-2xl border border-stone-200 bg-white text-slate-600 transition hover:border-stone-300 hover:text-slate-900","aria-label":"Close calibration artifact drawer",children:t.jsx(Xe,{size:16})})]})]})}),t.jsx("div",{className:"flex-1 overflow-y-auto px-5 py-5",children:c?t.jsx("div",{className:"flex min-h-[260px] items-center justify-center rounded-[24px] border border-stone-200 bg-white px-6 text-center shadow-sm",children:t.jsxs("div",{className:"space-y-3",children:[t.jsx("div",{className:"mx-auto inline-flex h-11 w-11 items-center justify-center rounded-full bg-stone-100 text-slate-700",children:t.jsx(S,{size:18,className:"animate-spin"})}),t.jsxs("div",{children:[t.jsx("p",{className:"text-base font-medium text-slate-900",children:"Opening artifact"}),t.jsx("p",{className:"mt-1 text-sm text-slate-500",children:"Loading the saved calibration and formatting it for review."})]})]})}):l?t.jsx("div",{className:"rounded-[24px] border border-red-200 bg-red-50 px-6 py-5 text-sm text-red-700 shadow-sm",children:l}):b||(E?t.jsx(ot,{srcDoc:E,title:A,className:"min-h-[calc(100vh-180px)] w-full rounded-[26px] border border-stone-200 bg-white shadow-sm"}):t.jsxs("div",{className:"space-y-5",children:[t.jsx(lt,{brief:a?.brief,companyName:a?.company_name||a?.brief?.company?.name||"",meetingNotes:a?.notes||{},liveMode:a?.status==="active"}),a?.output?.summary?t.jsxs("div",{className:"rounded-[24px] border border-stone-200 bg-white p-6 shadow-sm",children:[t.jsx("h4",{className:"text-sm font-semibold uppercase tracking-[0.18em] text-slate-400",children:"Executive Summary"}),t.jsx("p",{className:"mt-3 whitespace-pre-wrap text-sm leading-7 text-slate-700",children:a.output.summary})]}):null]}))})]})]})}const Me=I("/services/findem-studio");function Ee(a){if(a?.result?.structuredContent&&typeof a.result.structuredContent=="object")return a.result.structuredContent;const l=(Array.isArray(a?.result?.content)?a.result.content:Array.isArray(a?.content)?a.content:[]).find(u=>typeof u?.text=="string"&&u.text.trim());if(typeof l?.text!="string")return null;try{return JSON.parse(l.text)}catch{return{success:!1,error:l.text.trim()||"Tool call returned an unreadable response."}}}function xt(a){if(typeof a!="string"||!a)throw new Error("The export file was empty.");const c=globalThis.atob(a),l=new Uint8Array(c.length);for(let u=0;u<c.length;u+=1)l[u]=c.charCodeAt(u);return l}function pt(a){if(!a||typeof a!="object")throw new Error("The candidate export did not include a file payload.");const c=typeof a.file_name=="string"&&a.file_name.trim()?a.file_name.trim():"findem_candidates.xlsx",l=typeof a.mime_type=="string"&&a.mime_type.trim()?a.mime_type.trim():"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",u=xt(a.content_base64),x=new Blob([u],{type:l}),p=URL.createObjectURL(x),b=document.createElement("a");b.href=p,b.download=c,document.body.appendChild(b),b.click(),document.body.removeChild(b),window.setTimeout(()=>URL.revokeObjectURL(p),1e3)}function bt(a){return a?[`${a.candidate_count||0} candidates`,typeof a.contact_candidate_count=="number"?`${a.contact_candidate_count} with contacts`:"",typeof a.non_contact_candidate_count=="number"?`${a.non_contact_candidate_count} without contacts`:"",typeof a.credits_required=="number"?`${a.credits_required}
1 credits`:""].filter(Boolean).join(" · "):""}function De(a){return Array.isArray(a?.candidates)?a.candidates.map(c=>String(c?.candidate_id||"").trim()).filter(Boolean):[]}function ht(a){return a.reduce((c,l)=>(c[l]="ExternalSource",c),{})}function D({label:a,icon:c,onClick:l,disabled:u=!1,loading:x=!1,tone:p="default",title:b}){const y=p==="primary"?"border-emerald-600 bg-emerald-600 text-white shadow-sm hover:border-emerald-700 hover:bg-emerald-700":p==="success"?"border-emerald-200 bg-emerald-50 text-emerald-700":p==="danger"?"border-stone-200 bg-white text-slate-500 hover:border-red-200 hover:bg-red-50 hover:text-red-700":"border-stone-200 bg-white text-slate-600 hover:border-slate-300 hover:bg-stone-50 hover:text-slate-900";return t.jsxs("button",{type:"button",onClick:l,disabled:u,title:b||a,"aria-label":a,className:`inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-full border transition ${y} ${p==="success"?"disabled:cursor-not-allowed disabled:opacity-100":"disabled:cursor-not-allowed disabled:opacity-60"}`,children:[x?t.jsx(S,{size:14,className:"animate-spin"}):t.jsx(c,{size:14}),t.jsx("span",{className:"sr-only",children:a})]})}function Ct(){const a=Ve(),c=Ye(),{user:l}=Ze(),[u,x]=r.useState(""),p=typeof l?.id=="string"?l.id.trim():"",[b,y]=r.useState([]),[U,A]=r.useState(!0),[M,P]=r.useState(""),E=r.useDeferredValue(M),[O,Ae]=r.useState("newest"),[d,k]=r.useState(null),[V,Y]=r.useState(!1),[Z,q]=r.useState(""),[ee,te]=r.useState(""),[Le,B]=r.useState(""),[Te,se]=r.useState(""),[Pe,ae]=r.useState(!1),[qe,ne]=r.useState(!1),[ie,Re]=r.useState({}),[ze,re]=r.useState(""),[$e,oe]=r.useState(""),[Fe,le]=r.useState(""),[Ie,de]=r.useState(""),[j,L]=r.useState(null),[Oe,Be]=r.useState({}),m=r.useCallback((e,s=null)=>{e&&Be(n=>{const i={...n};return s?.message?i[e]=s:delete i[e],i})},[]),ce=r.useCallback((e,s)=>{if(!e||!s||typeof s!="object")return null;const n={...s,id:s?.id||e};return Re(i=>({...i,[e]:n})),y(i=>i.map(o=>o.id===e?{...o,...n,id:n.id||e}:o)),k(i=>i&&(i.id===e||i.meeting_id===e)?{...i,...n,id:n.id||e}:i),n},[]),R=r.useCallback(async e=>{if(!e)throw new Error("Missing calibration id.");const s=await fetch(I(`/agentic/intake-meeting/${e}/state`),{credentials:"include"});if(!s.ok){const i=await s.json().catch(()=>({}));throw new Error(i.error||"Unable to open this calibration.")}const n=await s.json();return ce(e,n)},[ce]),v=r.useCallback(async()=>{A(!0);try{const e=new URLSearchParams,s=E.trim();s&&e.set("q",s),O==="oldest"&&e.set("sort","oldest");const n=e.toString(),i=await fetch(I(`/agentic/intake-meeting/list${n?`?${n}`:""}`),{credentials:"include"});if(i.ok){const o=await i.json();y(Array.isArray(o)?o:[])}}catch{y([])}finally{A(!1)}},[E,O]);r.useEffect(()=>{v()},[v]);const H=r.useCallback(async e=>{if(e?.id){k(e),Y(!0),q("");try{await R(e.id)}catch(s){q(s.message||"Unable to open this calibration.")}finally{Y(!1)}}},[R]),J=r.useCallback(e=>
1{if(!e?.id)return e;const s=ie[e.id];return s?{...e,...s,id:s.id||e.id}:e},[ie]),z=r.useCallback(async e=>{const s=J(e),n=Ne(s),i=Se(s);return n||i?s:R(e?.id)},[R,J]),ue=r.useCallback(async e=>{if(!e?.id)return;const s=e.confirmationStatus||e.confirmation_status||"pending";if(!(!!e.has_output&&s!=="confirmed")){await H(e);return}se(e.id);try{const i=await ke(e.id);y(o=>o.map(f=>f.id===e.id?W({...f,status:"ended",has_output:!0},i):f)),k(o=>o&&(o.id===e.id||o.meeting_id===e.id)?W(o,i):o),v()}catch(i){x(i.message||"Unable to generate interviews for this calibration.")}finally{se("")}},[H,v]),$=r.useCallback(async(e,{includeContacts:s=!0,persistQuote:n=!1}={})=>{const i=await z(e),o=Ne(i),f=Se(i),w=o?{...o,include_contacts:s}:null,h=f?{...f,include_contacts:s}:null;if(!w&&!h)throw new Error("This completed calibration does not have the search context needed for export.");const T=async C=>{const _=await ge.callTool(Me,"quote_people_excel_export",C),N=Ee(_);if(!N?.success||typeof N?.quote_ref!="string"||!N.quote_ref.trim())throw new Error(N?.error||"Unable to quote the candidate export.");return N};let g;try{g=await T(w||h)}catch(C){if(!!!(w&&h&&JSON.stringify(w)!==JSON.stringify(h)))throw C;g=await T(h)}return n&&L({meetingId:e.id,quote:g}),{meeting:i,quote:g}},[z]),He=r.useCallback(async e=>{if(e?.id){x(""),m(e.id),L(s=>s?.meetingId===e.id?null:s),oe(e.id);try{await $(e,{includeContacts:!0,persistQuote:!0})}catch(s){m(e.id,{tone:"error",message:s.message||"Unable to quote the candidate export."})}finally{oe("")}}},[$,m]),Je=r.useCallback(async e=>{if(e?.id){x(""),m(e.id),L(s=>s?.meetingId===e.id?null:s),re(e.id);try{const s=await z(e),n=Ce(s);if(!n)throw new Error("This completed calibration does not have a Findem project yet.");let i=j?.meetingId===e.id?j.quote:null,o=De(i);if(o.length||(i=(await $(e,{includeContacts:!1,persistQuote:!1})).quote,o=De(i)),!o.length)throw new Error("Unable to resolve candidates to shortlist for this calibration.");await et.shortlistCandidatesToProject({profileIds:o,icpId:n,...p?{icpJoid:p}:{},sourceChannel:"external",shortlistSourceMap:ht(o)});const f=fe(n,{...p?{joid:p,redirect_joid:p}:{},tab:"shortlist"}),w=!!window.open(f,"_blank","noopener,noreferrer");m(e.id,{tone:"success",message:`Shortlisted ${o.length} matching candidates${w?" and opened the shortlist tab.":" to the Findem project."}`})}catch(s){m(e.id,{tone:"error",message:s.message||"Unable to shortlist matching candidates."})}finally{re("")}}},[p,z,j,$,m]),Qe=r.useCallback(async e=>{if(!(!e||j?.meetingId!==e||!j?.quote?.quote_ref)){x(""),m(e),le(e);try{const s=await ge.callTool(Me,"download_people_excel",{quote_ref:j.quote.quote_ref,confirmed:!0}),n=Ee(s);if(!n?.success||!n?.file?.content_base64)throw new Error(n?.error||"Unable to download the candidate export.");pt(n.file),m(e,{tone:"success",message:`Downloaded ${n.candidate_count||j.quote.candidate_count||0} matching candidates.`}),L(i=>i?.meetingId===e?null:i)}catch(s){m(e,{tone:"error",message:s.message||"Unable to download the candidate export."})}finally{le("")}}},[j,m]),Ge=r.useCallback(async e=>{if(e?.id){x(""),m(e.id),de(e.id);try{const s=await nt(e.id),n=typeof s?.publicShareUrl=="string"&&s.publicShareUrl.trim()?s.publicShareUrl.trim():typeof s?.public_share_url=="string"&&s.public_share_url.trim()?s.public_share_url.trim():"";if(!n)throw new Error("The public dossier link was created, but no URL was returned.");typeof navigator?.clipboard?.writeText=="function"?(await navigator.clipboard.writeText(n),m(e.id,{tone:"success",message:"Copied the public HTML dossier link to your clipboard."})):(window.open(n,"_blank","noopener,noreferrer"),m(e.id,{tone:"success",message:"Opened the public HTML dossier link in a new tab."}))}catch(s){m(e.id,{tone:"error",message:s.message||"Unable to create a public dossier link."})}finally{de("")}}},[m]),me=r.useCallback(async e=>{if(e){B(""),te(e);try{const s=await fetch(I(`/agentic/intake-meeting/${e}`),{method:"DELETE",credentials:"include"});if(!s.ok){const n=await s.json().catch(()=>({}));throw new Error(n.error||"Unable to delete this calibration.")}y(n=>n.filter(i=>i.id!==e)),(d?.id||d?.meeting_id)===e&&(k(null),q(""))}catch(s){x(s.message||"Unable to delete this calibration.")}finally{te(""),v()}}},[v,d]),Q=r.useCallback(async e=>{const s=d?.id||d?.meeting_id;if(s){ae(!0);try{const n=await it(s,e);k(i=>i&&{...i,dossier:n.dossier,confirmationStatus:n.confirmationStatus||"pending",confirmation_status:n.confirmationStatus||"pending"}),v()}catch(n){throw x(n.message||"Unable to save the hiring-manager dossier."),n}finally{ae(!1)}}},[v,d?.id,d?.meeting_id]),We=r.useCallback(async e=>{const s=d?.id||d?.meeting_id;if(s){ne(!0);try{const n=d?.dossier?.sections||[];JSON.stringify(e||[])!==JSON.stringify(n)&&await Q(e);const i=await ke(s);k(o=>
1o&&W(o,i)),v()}catch(n){throw x(n.message||"Unable to submit the hiring-manager dossier for automation."),n}finally{ne(!1)}}},[Q,v,d?.dossier?.sections,d?.id,d?.meeting_id]);return t.jsxs("div",{className:"mx-auto max-w-6xl px-6 py-8 sm:px-8",children:[t.jsxs("div",{className:"mb-6 flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx("button",{onClick:()=>a("/agents"),className:"inline-flex items-center gap-2 rounded-full border border-stone-200 bg-white px-3 py-1.5 text-sm text-slate-600 transition hover:bg-stone-50 hover:text-slate-900",children:t.jsx(tt,{size:15})}),t.jsx("h1",{className:"text-2xl font-semibold tracking-tight text-slate-900",children:"Role Calibration"})]}),t.jsxs("button",{onClick:()=>a("/agents/intake-meeting/new"),className:"inline-flex items-center gap-2 rounded-full bg-slate-900 px-4 py-2 text-sm font-medium text-white transition hover:bg-slate-800",children:[t.jsx(we,{size:15}),"New calibration"]})]}),u&&t.jsx("div",{className:"mb-6 rounded-2xl border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-800",children:u}),t.jsxs("div",{className:"rounded-[20px] border border-stone-200 bg-white p-6 shadow-sm",children:[t.jsxs("div",{className:"mb-4 flex flex-col gap-4 lg:flex-row lg:items-end lg:justify-between",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-lg font-semibold text-slate-900",children:"Past calibrations"}),t.jsx("p",{className:"mt-1 text-sm text-slate-500",children:"Search role, company, and note content. Open any row as an artifact or delete it when you no longer need it."})]}),t.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row",children:[t.jsxs("label",{className:"relative block",children:[t.jsx(st,{size:15,className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-slate-400"}),t.jsx("input",{type:"search",value:M,onChange:e=>P(e.target.value),placeholder:"Search calibrations",className:"w-full min-w-[240px] rounded-xl border border-stone-200 bg-stone-50 py-2.5 pl-10 pr-10 text-sm outline-none transition focus:border-slate-900 focus:bg-white"}),U||M!==E?t.jsx(S,{size:15,className:"absolute right-3 top-1/2 -translate-y-1/2 animate-spin text-slate-400"}):null]}),t.jsxs("label",{className:"inline-flex items-center gap-2 rounded-xl border border-stone-200 bg-stone-50 px-3 py-2.5 text-sm text-slate-600",children:[t.jsx(dt,{size:15,className:"text-slate-400"}),t.jsxs("select",{value:O,onChange:e=>Ae(e.target.value),className:"bg-transparent outline-none",children:[t.jsx("option",{value:"newest",children:"Newest first"}),t.jsx("option",{value:"oldest",children:"Oldest first"})]})]})]})]}),U&&b.length===0?t.jsx("div",{className:"flex items-center justify-center rounded-2xl border border-dashed border-stone-200 bg-stone-50 px-6 py-10 text-sm text-slate-500",children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(S,{size:16,className:"animate-spin"}),"Loading saved calibrations..."]})}):b.length>0?t.jsx("div",{className:"space-y-3",children:b.map(e=>{const s=J(e),n=Ue(s.status,s.confirmationStatus||s.confirmation_status),i=ee===e.id,o=Te===e.id,f=ze===e.id,w=$e===e.id,h=Fe===e.id,T=Ie===e.id,g=s.confirmationStatus||s.confirmation_status||"pending",C=!!s.has_output||s.status==="ended",_=C&&g!=="confirmed",N=C,xe=_?"Start automation":g==="confirmed"?"Open calibration":s.status==="active"?"Resume calibration":"Review brief",pe=_?"Confirm the dossier and launch automation.":g==="confirmed"?"Open the saved calibration artifact.":s.status==="active"?"Jump back into the live calibration.":"Review the saved brief and notes.",be=j?.meetingId===e.id?j.quote:null,G=Oe[e.id],F=Ce(s);return t.jsxs("div",{className:"rounded-2xl border border-stone-200 bg-white px-5 py-4 transition hover:border-slate-300",children:[t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-3 xl:flex-row xl:items-start xl:justify-between",children:[t.jsxs("button",{type:"button",onClick:()=>a(`/agents/intake-meeting/${e.id}${c.search}`),className:"min-w-0 flex-1 text-left",children:[t.jsxs("p",{className:"text-[15px] font-medium text-slate-900",children:[e.role_title||"Untitled Role"," ",t.jsx("span",{className:"text-slate-400",children:"â"})," ",e.company_name]}),t.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-slate-500",children:[t.jsxs("span",{children:[X(e.created_at,{dateStyle:"medium"})," · ",e.reactions_count," reaction",e.reactions_count!==1?"s":""]}),C?t.jsxs("span",{className:"inline-flex items-center gap-1 text-emerald-600",children:[t.jsx(_e,{size:11}),"Dossier ready"]}):null]})]}),t.jsxs("div",{className:"flex flex-wrap items-center gap-2 xl:justify-end",children:[t.jsx("span",{className:`shrink-0 rounded-full px-2.5 py-1 text-xs font-medium ${n.className}`,children:n.label}),N?t.jsx(D,{label:"Copy public HTML link",icon:ct,onClick:()=>{Ge(e)},disabled:T||i,title:"Copy a public HTML link for this completed dossier",loading:T}):null,Le===e.id?t.jsxs("div",{className:"inline-flex shrink-0 items-center gap-1.5",children:[t.jsx("span",{className:"text-xs font-medium text-red-700",children:"Delete?"}),t.jsx("button",{type:"button",onClick:()=>B(""),className:"inline-flex h-8 items-center justify-center rounded-full border border-stone-200 bg-white px-3 text-xs font-medium text-slate-600 transition hover:bg-stone-50",children:"Cancel"}),t.jsxs("button",{type:"button",onClick:()=>{me(e.id)},className:"inline-flex h-8 items-center gap-1.5 rounded-full bg-red-600 px-3 text-xs font-medium text-white transition hover:bg-red-700",children:[t.jsx(K,{size:11}),"Delete"]})]}):t.jsx("button",{type:"button",onClick:()=>B(e.id),disabled:i,className:"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-full border border-stone-200 bg-white text-slate-500 transition hover:border-red-200 hover:bg-red-50 hover:text-red-700 disabled:cursor-not-allowed disabled:opacity-60","aria-label":`Delete ${e.role_title||"calibration"}`,children:i?t.jsx(S,{size:14,className:"animate-spin"}):t.jsx(K,{size:14})})]})]}),t.jsx("div",{className:"border-t border-stone-200 pt-3",children:N?t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsx(D,{label:"Review brief",icon:ye,onClick:()=>{H(e)},disabled:f||w||h||o,title:"Open this completed calibration as an artifact"}),t.jsx(D,{label:"Open in Findem",icon:ut,onClick:()=>{F&&window.open(fe(F),"_blank","noopener,noreferrer")},disabled:!F,title:F?"Open this ICP in Findem":"No Findem project linked yet"}),t.jsx(D,{label:"Shortlist 50 matching candidates",icon:at,onClick:()=>{Je(e)},disabled:f||w||h,loading:f,title:"Shortlist the top 50 matching candidates into the Findem project"}),t.jsx(D,{label:"Download 50 matching candidates",icon:je,onClick:()=>{He(e)},disabled:f||w||h,loading:w,title:"Quote the top-50 candidate export, then confirm the download"}),t.jsx(D,{label:g==="confirmed"?"5 interviews ready":"Generate 5 interviews",icon:g==="confirmed"?_e:ve,onClick:()=>{ue(e)},disabled:o||g==="confirmed",loading:o,tone:g==="confirmed"?"success":"primary",title:g==="confirmed"?"This calibration is already approved to generate interviews":"Generate 5 interviews from this completed calibration"})]}):t.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-[11px] font-medium uppercase tracking-[0.18em] text-slate-400",children:"Next step"}),t.jsx("p",{className:"mt-1 text-sm text-slate-500",children:pe})]}),t.jsxs("button",{type:"button",onClick:()=>{ue(e)},disabled:o,"aria-label":xe,title:pe,className:`inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-full border transition disabled:cursor-not-allowed disabled:opacity-60 ${_?"border-emerald-600 bg-emerald-600 text-white shadow-sm hover:border-emerald-700 hover:bg-emerald-700":"border-stone-200 bg-white text-slate-600 hover:border-slate-300 hover:bg-stone-50 hover:text-slate-900"}`,children:[o?t.jsx(S,{size:14,className:"animate-spin"}):_?t.jsx(ve,{size:14}):t.jsx(ye,{size:14}),t.jsx("span",{className:"sr-only",children:xe})]})]})})]}),be?t.jsxs("div",{className:"mt-3 rounded-2xl border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-900",children:[t.jsx("p",{className:"font-medium",children:"Confirm candidate export"}),t.jsx("p",{className:"mt-1 text-xs leading-5 text-amber-800",children:bt(be)||"This export will download the top matching candidates and spend credits."}),t.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[t.jsxs("button",{type:"button",onClick:()=>{Qe(e.id)},disabled:h,className:"inline-flex items-center gap-2 rounded-full bg-slate-900 px-4 py-2 text-xs font-medium text-white transition hover:bg-slate-800 disabled:cursor-not-allowed disabled:opacity-60",children:[h?t.jsx(S,{size:13,className:"animate-spin"}):t.jsx(je,{size:13}),h?"Downloading":"Confirm download"]}),t.jsx("button",{type:"button",onClick:()=>{L(he=>he?.meetingId===e.id?null:he),m(e.id)},disabled:h,className:"inline-flex items-center rounded-full border border-amber-200 bg-white px-4 py-2 text-xs font-medium text-amber-900 transition hover:bg-amber-100 disabled:cursor-not-allowed disabled:opacity-60",children:"Cancel"})]})]}):null,G?.message?t.jsx("p",{className:`mt-3 text-sm ${G.tone==="success"?"text-emerald-700":"text-red-700"}`,children:G.message}):null]},e.id)})}):t.jsxs("div",{className:"rounded-2xl border border-dashed border-stone-200 bg-stone-50 px-6 py-14 text-center",children:[t.jsx("p",{className:"text-base font-semibold text-slate-900",children:"Start your first calibration"}),t.jsx("p",{className:"mx-auto mt-2 max-w-md text-sm leading-6 text-slate-500",children:"Role Calibration pressure-tests the hiring manager's requirements against your candidate pool and produces a dossier ready for automation."}),t.jsxs("button",{onClick:()=>a("/agents/intake-meeting/new"),className:"mt-5 inline-flex items-center gap-2 rounded-full bg-slate-900 px-4 py-2 text-sm font-medium text-white transition hover:bg-slate-800",children:[t.jsx(we,{size:14}),"New calibration"]})]})]}),t.jsx(mt,{meeting:d,loading:V,error:Z,deleting:ee===(d?.id||d?.meeting_id),onClose:()=>{k(null),q("")},onDelete:()=>{me(d?.id||d?.meeting_id)},children:d&&!V&&!Z&&t.jsx(rt,{meeting:d,saving:Pe,confirming:qe,onSave:Q,onConfirm:We})})]})}export{Ct 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.