1import{j as e,f as O,m as F,I as le,C as qe,B as Q,r as n,z as Re,A as Ee,t as oe}from"./index-deD-MQWq.js";import{m as G}from"./SpinnerGap.es-CbPiwv3w.js";import{R as Fe}from"./RecruitmentLayout-B60k4ScS.js";import{P as Ge}from"./page-heading-hkFKq4zJ.js";import{S as Le}from"./StepTabs-NwDa59B0.js";import{w as ie,t as y}from"./DefaultLayout-8gq-sAId.js";import{c as Ve}from"./CalendarBlank.es-BB5UchRk.js";import{s as Be}from"./FileText.es-Ch2FsrzW.js";import{a as re}from"./PencilSimple.es-DtRJJW7l.js";import{n as Je}from"./Trash.es-DXJ_gT0q.js";import{a as Oe}from"./avatar-Cr4FiiKs.js";import{C as X,c as Z,d as ce}from"./card-CFCMs6dP.js";import{T as Ue}from"./textarea-BF0wr0B1.js";import{C as He}from"./calendar-ByVlxGFy.js";import{P as Ye,a as Ke,b as Me}from"./popover-DrtEiKY2.js";import{f as We}from"./format-Dp3w_Y3x.js";import{Q as Xe}from"./QuestionsStep-BJ9E2gQf.js";import{n as Ze}from"./Pause.es-CwHJ30y5.js";import{n as _e}from"./Play.es-Dvp-zRvP.js";import{n as et}from"./Check.es-C6U-BaAQ.js";import{s as tt}from"./Copy.es-DRiXBt5j.js";import{n as st}from"./SealCheck.es-CZHY2NJJ.js";import{E as nt}from"./EditTemplateModal-hlxTEwTR.js";import{A as at,a as it,b as rt,c as lt,d as ot,e as ct,g as dt,f as ut}from"./alert-dialog-CZ6_8SyC.js";import{e as z,s as mt}from"./toast-eBCqBkbK.js";import"./index-B6lv9QEA.js";import"./index-DVXyD6bs.js";import"./chevron-right-DQoYBjlL.js";import"./UsersThree.es-JUjFgaeH.js";import"./Microphone.es-CaFhNS5g.js";import"./interviewService-CmwqmmaX.js";import"./appSumoService-B94vesdb.js";import"./alert-DOX-g5AY.js";import"./chevron-left-79XkxCri.js";import"./chevron-down-D8_LIOyk.js";import"./sortable.esm-D8T_1CFs.js";import"./AddQuestionPanel-CXtDaaPv.js";import"./Sparkle.es-C9U4Z8x0.js";import"./RowNumber-Dw9l7qys.js";import"./importance-levels-BnytoJiV.js";import"./Plus.es-D3N07tmx.js";function pt({specialism:g,onSpecialismChange:x,closeDate:c,onCloseDateChange:d,creationMethod:l,onCreationMethodChange:A,jobDescription:f,onJobDescriptionChange:C,onGenerate:T,onBuildManually:$,onCancel:L,isGenerating:h,templates:w,templatesLoading:I,onTemplateSelected:D,onEditTemplate:u,onDeleteTemplate:P,loadingTemplateId:V}){const q=w.length>0,B=[...q?[{value:"template",label:"From a template",description:"Reuse a saved question set",icon:ie}]:[],{value:"job-description",label:"From a job description",description:"Paste a JD and AI will generate questions",icon:Be},{value:"manual",label:"Input manually",description:"Write your own questions and rubrics",icon:re}];return e.jsx("div",{className:"animate-fade-in flex flex-col gap-6",children:e.jsxs(X,{className:"p-6",children:[e.jsxs(Z,{className:"!px-0 flex flex-col gap-6",children:[I?e.jsx("div",{className:"flex justify-center py-6",children:e.jsx(G,{weight:"duotone",className:"size-5 animate-spin text-muted-foreground"})}):e.jsx("div",{className:O("grid gap-3",q?"grid-cols-3":"grid-cols-2"),children:B.map(i=>{const m=l===i.value;return e.jsxs("button",{type:"button",onClick:()=>A(i.value),className:O("selectable-card flex items-center gap-3 p-4 text-left",m&&"selectable-card-selected"),children:[e.jsx(i.icon,{className:"size-4 shrink-0 text-muted-foreground",weight:"duotone"}),e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"text-sm font-medium",children:i.label}),e.jsx("span",{className:"text-xs text-muted-foreground-subtle",children:i.description})]})]},i.value)})}),e.jsx("div",{className:"grid transition-[grid-template-rows,margin] duration-300 ease-out",style:{gridTemplateRows:l==="template"?"1fr":"0fr",marginTop:l==="template"?void 0:"-20px"},children:e.jsx("div",{className:"overflow-hidden",children:e.jsxs("div",{children:[e.jsx(F,{children:"Choose a saved template"}),I?e.jsx("div",{className:"flex justify-center py-6 border border-border-clean rounded-md bg-white",children:e.jsx(G,{weight:"duotone",className:"size-5 animate-spin text-muted-foreground"})}):w.length===0?e.jsx("div",{className:"border border-border-clean rounded-md bg-white px-5 py-8 text-center",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"You don't have any templates yet."})}):e.jsx("div",{className:"grid grid-cols-3 gap-3",children:w.map(i=>{const m=V===i.id,N=V!==null;return e.jsxs("div",{className:"selectable-card group relative flex flex-col gap-1 p-4 text-left",children:[e.jsx("button",{type:"button",disabled:N,onClick:()=>D(i.id),"aria-label":`Use template ${i.name}`,className:"absolute inset-0 rounded-[inherit] cursor-pointer disabled:cursor-not-allowed"}),e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsx(ie,{weight:"duotone",className:"size-4 shrink-0 text-muted-foreground mt-0.5"}),e.jsx("div",{className:"relative z-10 flex items-center gap-0.5 shrink-0",children:m?e.jsx(G,{weight:"duotone",className:"size-4 animate-spin text-muted-foreground"}):e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",title:"Edit template",onClick:j=>{j.stopPropagation(),u(i.id)},className:"p-1 rounded-md text-muted-foreground-subtle hover:text-foreground hover:bg-muted transition-colors cursor-pointer opacity-0 group-hover:opacity-100",children:e.jsx(re,{weight:"duotone",className:"size-3.5"})}),e.jsx("button",{type:"button",title:"Delete template",onClick:j=>{j.stopPropagation(),P(i.id)},className:"p-1 rounded-md text-muted-foreground-subtle hover:text-destructive hover:bg-destructive/10 transition-colors cursor-pointer opacity-0 group-hover:opacity-100",children:e.jsx(Je,{weight:"duotone",className:"size-3.5"})})]})})]}),e.jsxs("div",{className:"flex flex-col gap-0.5 min-w-0",children:[e.jsx("span",{className:"text-sm font-medium truncate",children:i.name}),e.jsxs("span",{className:"text-xs text-muted-foreground-subtle",children:[i.questionCount," question",i.questionCount===1?"":"s"]})]})]},i.id)})})]})})}),e.jsx("div",{className:"grid transition-[grid-template-rows,margin] duration-300 ease-out",style:{gridTemplateRows:l==="job-description"||l==="manual"?"1fr":"0fr",marginTop:l==="job-description"||l==="manual"?void 0:"-20px"},children:e.jsx("div",{className:"overflow-hidden",children:e.jsxs("div",{children:[e.jsxs(F,{children:["Job title ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx(le,{value:g,onChange:i=>x(i.target.value),placeholder:"e.g. A&E Nurse, Paediatric Nurse"})]})})}),e.jsx("div",{className:"grid transition-[grid-template-rows,margin] duration-300 ease-out",style:{gridTemplateRows:l==="job-description"?"1fr":"0fr",marginTop:l==="job-description"?void 0:"-20px"},children:e.jsx("div",{className:"overflow-hidden",children:e.jsxs("div",{className:"flex flex-col",children:[e.jsx(F,{children:"Job description"}),e.jsx(Ue,{value:f,onChange:i=>C(i.target.value),placeholder:"Add the job description or details here, our AI will do the rest.",rows:5,className:"resize-none"})]})})}),e.jsx("div",{className:"grid transition-[grid-template-rows,margin] duration-300 ease-out",style:{gridTemplateRows:l==="job-description"||l==="manual"?"1fr":"0fr",marginTop:l==="job-description"||l==="manual"?void 0:"-20px"},children:e.jsx("div",{className:"overflow-hidden",children:e.jsxs("div",{children:[e.jsx(F,{children:"Closing date"}),e.jsxs(Ye,{children:[e.jsx(Ke,{asChild:!0,children:e.jsxs("button",{type:"button",className:O("flex h-9 w-full items-center rounded-md border border-border-clean bg-white px-3 py-1 text-sm shadow-clean transition-colors",c?"text-foreground":"text-muted-foreground-subtle"),children:[e.jsx(Ve,{className:"mr-2 size-4 text-muted-foreground-subtle",weight:"duotone"}),e.jsx("span",{className:"flex-1 text-left",children:c?We(c,"do MMMM yyyy"):"No close date"}),c&&e.jsx("span",{role:"button",tabIndex:0,onClick:i=>{i.stopPropagation(),d(void 0)},onKeyDown:i=>{(i.key==="Enter"||i.key===" ")&&(i.stopPropagation(),d(void 0))},className:"ml-1 rounded-sm p-0.5 hover:bg-muted transition-colors",children:e.jsx(Oe,{className:"size-3 text-muted-foreground-subtle"})})]})}),e.jsx(Me,{className:"w-auto p-0 rounded-md border-border-clean shadow-clean",style:{fontFamily:'"Inter", system-ui, sans-serif'},align:"start",children:e.jsx(He,{mode:"single",selected:c,onSelect:d,disabled:{before:new Date}})})]})]})})})]}),h&&e.jsx("div",{className:"mt-4",children:e.jsx(qe,{type:"info",message:"Generating questions from your job description â this could take up to a minute.",customIcon:"loading"})}),e.jsxs(ce,{className:"mt-6 flex w-full px-0 justify-between",children:[e.jsx(Q,{variant:"outline",size:"sm",onClick:L,children:"Cancel"}),l==="job-description"&&e.jsx(Q,{size:"sm",className:"w-fit",onClick:T,disabled:!g.trim()||!f.trim()||h,children:h?e.jsxs(e.Fragment,{children:[e.jsx(G,{weight:"duotone",className:"size-4 animate-spin mr-1.5"}),"Generatingâ¦"]}):"Generate questions"}),l==="manual"&&e.jsx(Q,{size:"sm",className:"w-fit",onClick:$,disabled:!g.trim(),children:"Continue"})]})]})})}function xt({selectedVoiceId:g,onVoiceChange:x,onBack:c,onContinue:d,isSubmitting:l,showTemplateSaveOptions:A,templateSaveMode:f,onTemplateSaveModeChange:C,templateName:T,onTemplateNameChange:$,defaultTemplateName:L,existingTemplateNames:h,sourceTemplateName:w}){const[I,D]=n.useState(null),u=n.useRef(null),[P,V]=n.useState([]),[q,B]=n.useState(!0),i=n.useMemo(()=>new Set((h??[]).map(r=>r.trim().toLowerCase())),[h]),[m,N]=n.useState("idle");n.useEffect(()=>{if(f!=="new"){N("idle");return}const r=T.trim();if(!r){N("idle");return}N("checking");const b=window.setTimeout(()=>{N(i.has(r.toLowerCase())?"unavailable":"available")},300);return()=>window.clearTimeout(b)},[f,T,i]),n.useEffect(()=>{y.getVoices().then(V).catch(()=>{}).finally(()=>B(!1))},[]);function j(r,b){if(u.current&&(u.current.pause(),u.current=null),I===r||!b){D(null);return}const S=new Audio(b);u.current=S,D(r),S.onended=()=>D(null),S.play().catch(()=>D(null))}return n.useEffect(()=>()=>{u.current&&(u.current.pause(),u.current=null)},[]),e.jsx("div",{className:"animate-fade-in flex flex-col gap-6",children:e.jsxs(X,{className:"p-6",children:[e.jsxs(Z,{className:"!px-0 flex flex-col gap-6",children:[e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs(F,{children:["Interviewer voice ",e.jsx("span",{className:"text-red-500",children:"*"})]}),q?e.jsx("div",{className:"flex justify-center py-6",children:e.jsx(G,{weight:"duotone",className:"size-5 animate-spin text-muted-foreground"})}):e.jsx("div",{className:"grid grid-cols-2 gap-3",children:P.map(r=>{const b=g===r.id,S=I===r.id;return e.jsxs("button",{type:"button",onClick:()=>x(r.id),className:O("selectable-card relative flex items-center gap-3 p-4 text-center justify-between",b&&"selectable-card-selected"),children:[e.jsxs("div",{className:"flex items-center gap-3",children:[r.avatarUrl&&e.jsx("img",{src:r.avatarUrl,alt:r.name,className:"size-8 rounded-full bg-muted"}),e.jsx("div",{className:"flex flex-col items-start",children:e.jsx("span",{className:"text-sm font-medium",children:r.name})})]}),r.demoUrl&&e.jsx("button",{type:"button",onClick:k=>{k.stopPropagation(),j(r.id,r.demoUrl)},className:"flex items-center rounded-full p-1 size-7 hover:bg-zinc-200 transition-colors bg-zinc-100 justify-center",children:S?e.jsx(Ze,{className:"size-3.5",weight:"duotone"}):e.jsx(_e,{className:"size-3.5",weight:"duotone"})})]},r.id)})})]}),A&&e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(F,{children:"Save as template"}),e.jsx("div",{className:"grid grid-cols-3 gap-2",children:[{value:"none",title:"Not required",description:"Questions will be used for this screening only."},...w?[{value:"update",title:`Update "${w}"`,description:"Apply your edits to the source template"}]:[],{value:"new",title:"Save as new template",description:"Create a reusable template for future use"}].map(r=>{const b=f===r.value;return e.jsxs("button",{type:"button",onClick:()=>{C(r.value),r.value==="new"&&!T&&L&&$(L)},className:O("selectable-card flex flex-col gap-0.5 p-3 text-left",b&&"selectable-card-selected"),children:[e.jsx("span",{className:"text-sm font-medium",children:r.title}),e.jsx("span",{className:"text-xs text-muted-foreground-subtle",children:r.description})]},r.value)})}),e.jsx("div",{className:"grid transition-[grid-template-rows,margin] duration-300 ease-out",style:{gridTemplateRows:f==="new"?"1fr":"0fr",marginTop:f==="new"?void 0:"-8px"},children:e.jsx("div",{className:"overflow-hidden",children:e.jsxs("div",{className:"pt-2",children:[e.jsxs(F,{htmlFor:"template-name",children:["Template name ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsxs("div",{className:"relative",children:[e.jsx(le,{id:"template-name",value:T,onChange:r=>$(r.target.value),placeholder:"e.g. A&E Nurse",className:O("pr-9",m==="unavailable"&&"border-red-500 focus-visible:ring-red-500")}),e.jsxs("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2.5",children:[m==="checking"&&e.jsx(G,{weight:"duotone",className:"size-4 animate-spin text-muted-foreground"}),m==="available"&&e.jsx(Re,{weight:"fill",className:"size-4 text-green-600"}),m==="unavailable"&&e.jsx(Ee,{weight:"fill",className:"size-4 text-red-500"})]})]}),m==="unavailable"&&e.jsx("p",{className:"mt-1 text-xs text-red-500",children:"A template with this name already exists."}),m==="available"&&e.jsx("p",{className:"mt-1 text-xs text-green-600",children:"Name is available."})]})})})]})]}),e.jsxs(ce,{className:"mt-6 flex w-full px-0 justify-between",children:[e.jsx(Q,{variant:"outline",size:"sm",onClick:c,children:"Back"}),e.jsx(Q,{size:"sm",onClick:d,disabled:!g||l||A&&!f||f==="new"&&!T.trim()||f==="new"&&(m==="checking"||m==="unavailable"),children:l?"Creating...":"Continue"})]})]})})}
1function gt({specialism:g,shareLink:x}){const c=oe(),[d,l]=n.useState(!1);function A(){navigator.clipboard.writeText(x),l(!0),setTimeout(()=>l(!1),2e3)}return e.jsx("div",{className:"animate-fade-in flex flex-col gap-6",children:e.jsx(X,{children:e.jsxs(Z,{className:"flex flex-col items-center text-center gap-6 py-8",children:[e.jsx(st,{className:"size-10 text-green-500",weight:"duotone"}),e.jsxs("div",{className:"flex flex-col gap-6 w-full items-center",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Assessment created"}),e.jsxs("p",{className:"text-sm text-muted-foreground-subtle max-w-md",children:[g," is ready to share with candidates."]})]}),e.jsxs("div",{className:"flex items-center w-full max-w-lg rounded-md border border-border-clean shadow-clean bg-white overflow-hidden",children:[e.jsx("input",{value:x,readOnly:!0,className:"flex-1 h-10 px-4 text-sm text-foreground bg-transparent outline-none truncate"}),e.jsx("div",{className:"w-px self-stretch bg-border-clean shrink-0"}),e.jsxs(Q,{variant:"outline",onClick:A,className:`flex items-center border-none gap-1.5 px-4 h-10 text-sm transition-colors shrink-0 cursor-pointer ${d?"text-success":"text-muted-foreground hover:text-foreground"}`,children:[d?e.jsx(et,{className:"size-3.5",weight:"bold"}):e.jsx(tt,{className:"size-3.5",weight:"duotone"}),d?"Copied!":"Copy"]})]})]}),e.jsxs("div",{className:"flex items-center gap-3 max-w-lg self-center w-full justify-center mt-4",children:[e.jsx(Q,{size:"sm",onClick:()=>c("/recruitment/screenings"),children:"View all assessments"}),e.jsx(Q,{variant:"outline",size:"sm",onClick:()=>c("/recruitment/screenings/create"),children:"Create another"})]})]})})})}const ft=[{step:1,label:"Details"},{step:2,label:"Questions & rubrics"},{step:3,label:"Voice & Template"},{step:4,label:"Share"}];function ht(g,x){if(g.length!==x.length)return!1;for(let c=0;c<g.length;c++){const d=g[c],l=x[c];if(d.question!==l.question||d.scorePoor!==l.scorePoor||d.scoreGreat!==l.scoreGreat||d.importance!==l.importance)return!1}return!0}function is(){const g=oe(),[x,c]=n.useState(1),[d,l]=n.useState(""),[A,f]=n.useState(null),[C,T]=n.useState(""),[$,L]=n.useState(void 0),[h,w]=n.useState([]),[I,D]=n.useState(!0),[u,P]=n.useState(null),[V,q]=n.useState(null),[B,i]=n.useState(null),[m,N]=n.useState(null),[j,r]=n.useState(!1),[b,S]=n.useState(null),[k,v]=n.useState([]),[H,J]=n.useState(null),[Y,de]=n.useState(null),[_,ue]=n.useState(null),[K,me]=n.useState(""),[ee,pe]=n.useState(null),[xe,te]=n.useState(!1),[ge,se]=n.useState(!1),[fe,U]=n.useState(null);n.useEffect(()=>{let t=!1;return y.getTemplates().then(s=>{t||w(s?.items??[])}).catch(()=>{}).finally(()=>{t||D(!1)}),()=>{t=!0}},[]);const ne=k.filter(t=>!t.question.trim()||!t.scorePoor.trim()||!t.scoreGreat.trim()||!t.importance),he=k.length>0&&ne.length===0;async function je(){te(!0);try{const s=(await y.generateQuestions({jobTitle:d,jobDescription:C})).questions.map((a,o)=>({id:`q-${Date.now()}-${o}`,question:a.question,scorePoor:a.poorAnswerRubric,scoreGreat:a.perfectAnswerRubric,importance:a.importance}));v(s),s.length>0&&J(s[0].id),P(null),S(null),c(2)}catch{z("Failed to generate questions. Please try again.")}finally{te(!1)}}function be(){v([]),P(null),S(null),c(2)}async function ve(t){q(t);try{const s=await y.getTemplateById(t),a=s.questions.map((o,p)=>({id:`q-${Date.now()}-${p}`,question:o.questionText,scorePoor:o.rubricPoor,scoreGreat:o.rubricGreat,importance:o.importance}));v(a),S(a),a.length>0&&J(a[0].id),d.trim()||l(s.name),P(s.id),c(2)}catch{z("Failed to load template. Please try again.")}finally{q(null)}}function we(t){const s=h.find(a=>a.id===t);s&&N(s)}async function Ne(){if(!(!m||j)){r(!0);try{await y.deleteTemplate(m.id),w(t=>t.filter(s=>s.id!==m.id)),u===m.id&&P(null),mt("Template deleted"),N(null)}catch{z("Failed to delete template. Please try again.")}finally{r(!1)}}}async function ye(){try{const t=await y.getTemplates();w(t?.items??[])}catch{}}async function Ce(){i(null),await ye()}function Te(){const t={id:`q-${Date.now()}`,question:"",scorePoor:"",scoreGreat:"",importance:null};v(s=>[...s,t]),J(t.id)}async function Se(t){const s=`q-${Date.now()}`,a={id:s,question:t,scorePoor:"",scoreGreat:"",importance:null};v(o=>[...o,a]),J(s),U(s);try{const o=k.filter(E=>E.question.trim()).map(E=>E.question.trim()),p=await y.generateSingleQuestion({jobTitle:d,jobDescription:C||void 0,existingQuestions:o.length>0?o:void 0,prompt:t});v(E=>E.map(W=>W.id===s?{...W,question:p.question,scorePoor:p.poorAnswerRubric,scoreGreat:p.perfectAnswerRubric,importance:p.importance}:W))}catch{v(o=>o.filter(p=>p.id!==s)),z("Failed to generate question. Please try again.")}finally{U(null)}}function ke(t){v(s=>s.map(a=>a.id===t.id?t:a))}function Ae(t){v(s=>s.filter(a=>a.id!==t)),H===t&&J(null)}function De(t){J(H===t?null:t)}async function Pe(t){U(t);try{const s=k.filter(o=>o.id!==t&&o.question.trim()).map(o=>o.question.trim()),a=await y.generateSingleQuestion({jobTitle:d,jobDescription:C||void 0,existingQuestions:s.length>0?s:void 0});v(o=>o.map(p=>p.id===t?{...p,question:a.question,scorePoor:a.poorAnswerRubric,scoreGreat:a.perfectAnswerRubric,importance:a.importance}:p))}catch{z("Failed to regenerate question. Please try again.")}finally{U(null)}}async function ze(){if(Y&&R&&!(R==="new"&&!K.trim())&&!(R==="update"&&!u)){se(!0);try{const t=k.map(a=>({questionText:a.question,rubricPoor:a.scorePoor,rubricGreat:a.scoreGreat,importance:a.importance??"Important"}));if(R==="update"&&u){const a=h.find(o=>o.id===u)?.name;if(!a){z("Template no longer exists.");return}try{await y.updateTemplate(u,{name:a,questions:t})}catch(o){const p=o?.response?.data?.detail??"Failed to update template. Please try again.";z(p);return}}const s=await y.createScreening({name:d,questions:t,voiceId:Y,locale:"en-US",jobDescription:C||void 0,closeDate:$?.toISOString(),createdFromTemplateId:u??void 0,saveAsTemplate:R==="new",templateName:R==="new"?K.trim():void 0});pe(`${window.location.origin}${s.shareLink}`),c(4)}catch(t){const s=t?.response?.data?.detail??"Failed to create screening. Please try again.";z(s)}finally{se(!1)}}}const Qe=u?h.find(t=>
1t.id===u)?.name:void 0,M=b!==null&&!ht(k,b),ae=u===null||M,R=ae?_==="update"&&!M?"none":_:"none",$e=n.useMemo(()=>{const t=d.trim();if(!u||!t)return t;const s=new Date,a=E=>String(E).padStart(2,"0"),o=["January","February","March","April","May","June","July","August","September","October","November","December"],p=`${s.getDate()} ${o[s.getMonth()]} ${s.getFullYear()} ${a(s.getHours())}:${a(s.getMinutes())}`;return`${t} (Copy ${p})`},[u,d]),Ie=n.useMemo(()=>h.map(t=>t.name),[h]);return e.jsxs(Fe,{children:[e.jsxs("div",{className:"max-w-3xl mx-auto w-full flex flex-col gap-6",children:[e.jsx(Ge,{title:"New screening assessment",description:"Set up questions and scoring rubrics, then share the link with candidates.",centered:!0}),e.jsx(Le,{steps:ft,currentStep:x,onStepClick:c}),x===1&&e.jsx(pt,{specialism:d,onSpecialismChange:l,closeDate:$,onCloseDateChange:L,creationMethod:A,onCreationMethodChange:f,jobDescription:C,onJobDescriptionChange:T,onGenerate:je,onBuildManually:be,onCancel:()=>g("/recruitment/screenings"),isGenerating:xe,templates:h,templatesLoading:I,onTemplateSelected:ve,onEditTemplate:t=>i(t),onDeleteTemplate:we,loadingTemplateId:V}),x===2&&e.jsx(Xe,{questions:k,expandedQuestionId:H,onToggleExpand:De,onChange:ke,onDelete:Ae,onReorder:v,onAddQuestion:Te,onAddAiQuestion:Se,onBack:()=>c(1),onContinue:()=>c(3),canContinue:he,incompleteCount:ne.length,regeneratingQuestionId:fe,onRegenerateQuestion:Pe}),x===3&&e.jsx(xt,{selectedVoiceId:Y,onVoiceChange:de,onBack:()=>c(2),onContinue:ze,isSubmitting:ge,showTemplateSaveOptions:ae,templateSaveMode:R,onTemplateSaveModeChange:ue,templateName:K,onTemplateNameChange:me,defaultTemplateName:$e,existingTemplateNames:Ie,sourceTemplateName:M?Qe:void 0}),x===4&&ee&&e.jsx(gt,{specialism:d,shareLink:ee})]}),B!==null&&e.jsx(nt,{templateId:B,onClose:()=>i(null),onSaved:Ce}),e.jsx(at,{open:m!==null,onOpenChange:t=>{!t&&!j&&N(null)},children:e.jsxs(it,{children:[e.jsxs(rt,{children:[e.jsx(lt,{children:"Delete template?"}),e.jsxs(ot,{children:["This will permanently remove"," ",e.jsx("span",{className:"font-medium text-foreground",children:m?.name}),". Existing screenings created from this template are unaffected."]})]}),e.jsxs(ct,{children:[e.jsx(dt,{disabled:j,children:"Cancel"}),e.jsxs(ut,{onClick:t=>{t.preventDefault(),Ne()},disabled:j,className:"!bg-red-600 hover:!bg-red-700 !border-red-700 !shadow-none hover:!shadow-none",children:[j&&e.jsx(G,{weight:"duotone",className:"mr-2 h-4 w-4 animate-spin"}),"Delete template"]})]})]})})]})}export{is 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.