1import{u as H,j as e}from"./index-KW9f5qZK.js";import{c as q,r as a}from"./react-vendor-CXY-VoH6.js";import{C as K,b as N}from"./CareerSuitePageLayout-Dkk7DpHc.js";import{ak as X,bQ as Z,T as ee,U as te,L as D,ah as se,a1 as O,ab as C,b1 as B,E as ae,A as re}from"./ui-vendor-Dook0VI8.js";import"./supabase-vendor-D3UcZGaq.js";import"./SectionTabs-CZvt-TvX.js";const le=[{code:"NCOER",name:"NCO Evaluation Report",branch:"Army"},{code:"OER",name:"Officer Evaluation Report",branch:"Army"},{code:"FITREP",name:"Fitness Report",branch:"Navy / Marines"},{code:"EPR",name:"Enlisted Performance Report",branch:"Air Force / Space Force"},{code:"OPR",name:"Officer Performance Report",branch:"Air Force / Space Force"},{code:"ACA",name:"Airman Comprehensive Assessment",branch:"Air Force"},{code:"EVAL",name:"Enlisted Evaluation",branch:"Navy"},{code:"CHIEFEVAL",name:"Chief Evaluation",branch:"Coast Guard"}],f=2;function xe(){const g=q(),{tier:v,getAuthToken:d}=H(),r=v==="plus"||v==="premium"||v==="bypass",[m,I]=a.useState(""),[c,j]=a.useState(null),[z,y]=a.useState(!1),[i,k]=a.useState([]),[n,x]=a.useState(new Set),[S,E]=a.useState(!1),[P,h]=a.useState(null),[L,A]=a.useState(null),[F,T]=a.useState(!1),l=a.useMemo(()=>i.length?r?i:i.slice(0,f):[],[i,r]),R=i.length-l.length,U=a.useCallback(async()=>{if(!m.trim()&&!c){h("Please paste evaluation text or upload a file.");return}E(!0),h(null),k([]),x(new Set);try{let t=m.trim();if(r&&c){const u=new FormData;u.append("file",c);const b=typeof d=="function"?await d():null,w=await fetch("/api/evals/ocr",{method:"POST",body:u,headers:b?{Authorization:`Bearer ${b}`}:{}});if(!w.ok){const Y=await w.json().catch(()=>({}));throw new Error(Y.error||"Failed to extract text from file.")}const{extractedText:Q}=await w.json();t=[t,Q].filter(Boolean).join(` 2 3`)}if(!t.trim()){h("No text to convert. Please paste eval text or upload a document.");return}const s=typeof d=="function"?await d():null,o=await fetch("/api/evals/to-bullets",{method:"POST",headers:{"Content-Type":"application/json",...s?{Authorization:`Bearer ${s}`}:{}},body:JSON.stringify({text:t})});if(!o.ok){const u=await o.json().catch(()=>({}));throw new Error(u.error||"Translation failed. Please try again.")}const p=await o.json();p.bullets&&p.bullets.length>0?(k(p.bullets),r&&x(new Set(p.bullets.map((u,b)=>b)))):h("No bullets generated. Try providing more performance statement detail.")}catch(t){h(t.message||"Failed to convert evaluation. Please try again.")}finally{E(!1)}},[m,c,r,d]),G=a.useCallback((t,s)=>{navigator.clipboard.writeText(t).then(()=>{A(s),setTimeout(()=>A(null),2e3)})},[]),_=a.useCallback(()=>{const t=l.join(` 4 5`);navigator.clipboard.writeText(t).then(()=>{T(!0),setTimeout(()=>T(!1),2e3)})},[l]),M=a.useCallback(t=>{x(s=>{const o=new Set(s);return o.has(t)?o.delete(t):o.add(t),o})},[]),V=a.useCallback(()=>{n.size===l.length?x(new Set):x(new Set(l.map((t,s)=>s)))},[n,l]),$=a.useCallback(()=>{const t=l.filter((s,o)=>n.has(o));t.length!==0&&g("/career-suite/resume",{state:{evalBullets:t}})},[l,n,g]),W=a.useCallback(t=>{if(t.preventDefault(),y(!1),!r)return;const s=t.dataTransfer.files?.[0];s&&j(s)},[r]),J=a.useCallback(t=>{t.preventDefault(),r&&y(!0)},[r]);return e.jsxs(K,{title:"Eval Translator",subtitle:"Convert military performance evaluations into ATS-optimized civilian cybersecurity resume bullets",icon:X,activeTab:"Eval Translator",tips:["Copy performance bullet text directly from your evaluation PDF","Focus on achievements with numbers: team sizes, budgets, percentages, timelines","Our AI translates military jargon (comms, intel, ops) into cyber-specific language",'Generated bullets follow the "Action Verb + What You Did + Quantified Impact" format'],children:[e.jsxs(N,{children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx(Z,{className:"w-5 h-5 text-cyan-400"}),e.jsx("h2",{className:"text-lg font-semibold text-white",children:"Supported Evaluation Types"})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:le.map(t=>e.jsxs("div",{className:"bg-cyan-900/30 border border-cyan-500/30 rounded-lg px-3 py-2 flex items-center gap-2",children:[e.jsx("span",{className:"text-cyan-300 font-bold text-sm",children:t.code}),e.jsx("span",{className:"text-slate-400 text-xs hidden sm:inline",children:t.branch})]},t.code))}),e.jsx("p",{className:"text-slate-400 text-sm mt-3",children:"Paste the performance statements and achievement sections from any of these evaluation formats. Our AI understands all branches and translates military jargon into cybersecurity-focused resume bullets."})]}),e.jsxs("div",{className:"bg-red-900/20 border border-red-500/30 rounded-xl p-4 flex items-start gap-3",children:[e.jsx(ee,{className:"w-5 h-5 text-red-400 flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-red-200 text-sm font-medium",children:"Remove all PII before pasting"}),e.jsx("p",{className:"text-red-300/70 text-xs mt-1",children:"Names, SSNs, addresses, dates of birth, and unit designations should be removed or redacted. Paste only performance statements, achievements, and duty descriptions."})]})]}),e.jsx(N,{children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"eval-raw-text",className:"block text-white text-sm font-medium mb-2",children:"Paste Evaluation Text"}),e.jsx("textarea",{id:"eval-raw-text",value:m,onChange:t=>I(t.target.value),placeholder:`Paste your eval bullets here (PII removed)... 6 7Example: 8Led 12 Marines maintaining 45 comms assets; reduced downtime 32% through preventive maintenance program 9Coordinated 15 security audits across 3 facilities; identified 47 vulnerabilities, implemented fixes within 30 days 10Trained 8 junior personnel on defensive cyber operations; achieved 100% certification pass rate`,rows:10,className:"w-full px-4 py-3 text-sm bg-black/30 border border-white/20 rounded-xl text-white placeholder-slate-500 focus:outline-none focus-visible:ring-2 focus-visible:ring-cyan-500/50 focus-visible:border-cyan-500/50 font-mono resize-y transition-colors"})]}),r?e.jsxs("div",{onDrop:W,onDragOver:J,onDragLeave:()=>y(!1),className:`border-2 border-dashed rounded-xl p-6 text-center transition-all cursor-pointer ${z?"border-cyan-400 bg-cyan-500/10":"border-white/20 hover:border-cyan-400/50 hover:bg-cyan-500/5"}`,children:[e.jsx("input",{type:"file",accept:".pdf,image/*",onChange:t=>
10j(t.target.files?.[0]??null),className:"hidden",id:"eval-file-upload-standalone"}),e.jsxs("label",{htmlFor:"eval-file-upload-standalone",className:"cursor-pointer flex flex-col items-center gap-2",children:[e.jsx(te,{className:"w-6 h-6 text-cyan-400"}),c?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-cyan-300 text-sm font-medium",children:c.name}),e.jsx("button",{onClick:t=>{t.preventDefault(),j(null)},className:"text-red-400 text-xs hover:text-red-300 transition-colors",children:"Remove file"})]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-cyan-300 text-sm font-medium",children:"Upload PDF or Image (optional)"}),e.jsx("span",{className:"text-slate-400 text-xs",children:"Drag and drop or click to select. We'll extract text using OCR."}),e.jsx("span",{className:"text-slate-500 text-xs",children:"Supports PDF, JPG, PNG, WEBP (max 5MB)"})]})]})]}):e.jsxs("div",{className:"bg-purple-900/20 border border-purple-500/30 rounded-xl p-4 flex items-center gap-3",children:[e.jsx(D,{className:"w-5 h-5 text-purple-400 flex-shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-purple-200 text-sm font-medium",children:"File upload available with Plus & Premium"}),e.jsx("p",{className:"text-purple-300/60 text-xs mt-0.5",children:"Upload PDFs or photos of your evaluations for automatic OCR extraction"})]})]}),e.jsx("button",{onClick:U,disabled:S||!m.trim()&&!c,className:"w-full sm:w-auto bg-gradient-to-r from-cyan-600 to-blue-600 hover:from-cyan-500 hover:to-blue-500 disabled:opacity-50 disabled:cursor-not-allowed text-white px-8 py-3 rounded-xl text-sm font-semibold flex items-center justify-center gap-2.5 transition-all shadow-lg shadow-cyan-500/20 hover:shadow-cyan-500/30",children:S?e.jsxs(e.Fragment,{children:[e.jsx(se,{className:"w-5 h-5 animate-spin"}),"Converting... This may take a few seconds"]}):e.jsxs(e.Fragment,{children:[e.jsx(O,{className:"w-5 h-5"}),"Convert to Civilian Cyber Bullets"]})})]})}),P&&e.jsx("div",{className:"bg-red-900/20 border border-red-500/30 rounded-xl p-4",children:e.jsx("p",{className:"text-red-200 text-sm",children:P})}),l.length>0&&e.jsxs(N,{children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(O,{className:"w-5 h-5 text-cyan-400"}),e.jsx("h2",{className:"text-lg font-semibold text-white",children:r?e.jsxs(e.Fragment,{children:["Generated ",e.jsx("span",{className:"text-cyan-400",children:i.length})," Bullets"]}):e.jsxs(e.Fragment,{children:["Preview (",f," of ",i.length,")"]})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[r&&l.length>1&&e.jsx("button",{onClick:V,className:"text-xs text-cyan-400 hover:text-cyan-300 transition-colors px-2 py-1",children:n.size===l.length?"Deselect All":"Select All"}),e.jsxs("button",{onClick:_,className:"flex items-center gap-1.5 text-xs text-slate-400 hover:text-white transition-colors px-3 py-1.5 rounded-lg border border-white/10 hover:border-white/30",children:[F?e.jsx(C,{className:"w-3.5 h-3.5 text-green-400"}):e.jsx(B,{className:"w-3.5 h-3.5"}),F?"Copied!":"Copy All"]})]})]}),e.jsx("div",{className:"space-y-3",children:l.map((t,s)=>e.jsx("div",{className:`group relative bg-black/30 border rounded-xl p-4 transition-all ${n.has(s)?"border-cyan-500/50 bg-cyan-900/10":"border-white/10 hover:border-white/20"}`,children:e.jsxs("div",{className:"flex items-start gap-3",children:[r&&e.jsx("button",{onClick:()=>M(s),className:`mt-0.5 w-5 h-5 rounded border-2 flex items-center justify-center flex-shrink-0 transition-all ${n.has(s)?"bg-cyan-500 border-cyan-500":"border-white/30 hover:border-cyan-400"}`,children:n.has(s)&&e.jsx(C,{className:"w-3 h-3 text-white"})}),e.jsx("p",{className:"text-white text-sm leading-relaxed flex-1",children:t}),e.jsx("button",{onClick:()=>G(t,s),className:"opacity-0 group-hover:opacity-100 flex-shrink-0 p-1.5 rounded-lg hover:bg-white/10 transition-all",title:"Copy bullet",children:L===s?e.jsx(C,{className:"w-4 h-4 text-green-400"}):e.jsx(B,{className:"w-4 h-4 text-slate-400"})})]})},s))}),!r&&R>0&&e.jsxs("div",{className:"mt-4 relative",children:[e.jsx("div",{className:"space-y-3 blur-sm pointer-events-none select-none","aria-hidden":"true",children:i.slice(f,f+2).map((t,s)=>e.jsx("div",{className:"bg-black/30 border border-white/10 rounded-xl p-4",children:e.jsx("p",{className:"text-white text-sm",children:t})},s))}),e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsxs("div",{className:"bg-gradient-to-r from-purple-900/90 to-cyan-900/90 border border-purple-500/50 rounded-2xl p-6 text-center max-w-sm backdrop-blur-sm shadow-2xl",children:[e.jsx(D,{className:"w-8 h-8 text-purple-400 mx-auto mb-3"}),e.jsxs("h3",{className:"text-white font-bold text-lg mb-1",children:["+",R," More Bullets"]}),e.jsx("p",{className:"text-slate-300 text-sm mb-4",children:"Upgrade to unlock all generated bullets, file upload, and direct resume integration."}),e.jsx("button",{onClick:()=>g("/pricing"),className:"w-full py-2.5 bg-gradient-to-r from-purple-600 to-cyan-600 hover:from-purple-500 hover:to-cyan-500 rounded-xl font-semibold text-sm text-white transition-all shadow-lg",children:"Upgrade to Plus"})]})})]}),r&&l.length>0&&e.jsxs("div",{className:"mt-6 flex flex-col sm:flex-row items-stretch sm:items-center gap-3 pt-4 border-t border-white/10",children:[e.jsxs("button",{onClick:$,disabled:n.size===0,className:"flex-1 sm:flex-initial bg-gradient-to-r from-green-600 to-emerald-600 hover:from-green-500 hover:to-emerald-500 disabled:opacity-50 disabled:cursor-not-allowed text-white px-6 py-3 rounded-xl text-sm font-semibold flex items-center justify-center gap-2.5 transition-all shadow-lg shadow-green-500/20",children:[e.jsx(ae,{className:"w-4 h-4"}),"Send ",n.size," Bullet",n.size!==1?"s":""," to Resume Builder",e.jsx(re,{className:"w-4 h-4"})]}),e.jsxs("span",{className:"text-slate-500 text-xs text-center sm:text-left",children:[n.size," of ",l.length," selected"]})]})]})]})}export{xe 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.