1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7055],{17445:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/auto-apply",function(){return a(29806)}])},39200:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(63759).Z)("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},83989:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(63759).Z)("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]])},3192:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(63759).Z)("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]])},50039:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(63759).Z)("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]])},12779:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(63759).Z)("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]])},15928:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(63759).Z)("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},53488:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(63759).Z)("FileSearch",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7.5L14.5 2H6a2 2 0 0 0-2 2v3",key:"am10z3"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["path",{d:"M5 17a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",key:"ychnub"}],["path",{d:"m9 18-1.5-1.5",key:"1j6qii"}]])},45544:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(63759).Z)("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]])},82126:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(63759).Z)("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]])},44976:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(63759).Z)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},72278:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(63759).Z)("ShieldCheck",[["path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10",key:"1irkt0"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},9475:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(63759).Z)("XCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},46611:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(63759).Z)("Zap",[["polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2",key:"45s27k"}]])},29806:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return z}});var s=a(85893),n=a(67294),i=a(9008),r=a.n(i),o=a(41664),l=a.n(o),c=a(11163),d=a(33299),p=a(86501),m=a(87542),u=a(89508),x=a(85412),h=a(67694),g=a(50039),b=a(33058),y=a(60641),f=a(22954),j=a(9475),v=a(39200),w=a(3192),N=a(72278),k=a(83989);let F=(0,a(63759).Z)("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);var A=a(46611),Z=a(15928),C=a(53488),S=a(2553),E=a(23603),T=a(12779),D=a(44976),R=a(71707),_=a(45544),B=a(82126);let M={idle:"",scraping:"Reading the job postingâ¦",generating:"Writing a tailored resumeâ¦",s
1aving:"Saving resumeâ¦",rendering:"Rendering PDFâ¦",uploading:"Uploading to ATSâ¦",submitting:"Handing off to the agentâ¦",polling:"Agent is workingâ¦",done:"Done",error:"Stopped"},q={queued:{label:"Queued",icon:g.Z,tint:"text-amber-500",ring:"ring-amber-500/30"},preparing:{label:"Preparing",icon:b.Z,tint:"text-sky-500",ring:"ring-sky-500/30"},submitting:{label:"Submitting",icon:y.Z,tint:"text-blue-500",ring:"ring-blue-500/30"},submitted:{label:"Submitted",icon:f.Z,tint:"text-emerald-500",ring:"ring-emerald-500/30"},failed:{label:"Failed",icon:j.Z,tint:"text-rose-500",ring:"ring-rose-500/30"},needs_human:{label:"Needs you",icon:v.Z,tint:"text-orange-500",ring:"ring-orange-500/30"},cancelled:{label:"Cancelled",icon:j.Z,tint:"text-slate-400",ring:"ring-slate-400/30"}},P={unsupported_ats:{title:"This job board is not supported yet",hint:"Auto Apply currently works on Greenhouse. Lever, Ashby and Workday are next."},jd_extraction_failed:{title:"Could not read the job description",hint:"The page blocked automated fetches. Open the posting manually and paste the JD into the Resume Builder."},resume_pdf_missing:{title:"Resume PDF missing",hint:"The agent needs a PDF to upload. We tried to export one but it failed â try Review & Apply."},policy_blocked:{title:"Rate limit reached",hint:"You've hit the daily auto-apply cap. Try again tomorrow."},duplicate:{title:"Already applied recently",hint:"You auto-applied to this URL in the last 7 days."},consent_required:{title:"Consent required",hint:"Tick the consent box â the agent will not submit without your authorization."},invalid_request:{title:"Invalid request",hint:"Check the job URL."}};function z(){var e,t,i,o,g,b,z;let L=(0,c.useRouter)(),{data:O,status:U}=(0,d.useSession)(),{theme:I}=(0,h.F)(),J="dark"===I,[H,W]=(0,n.useState)(""),[Y,$]=(0,n.useState)(!1),[G,V]=(0,n.useState)(!1),[X,Q]=(0,n.useState)("idle"),[K,ee]=(0,n.use
1State)(null),[et,ea]=(0,n.useState)(null),[es,en]=(0,n.useState)(null),[ei,er]=(0,n.useState)(null),[eo,el]=(0,n.useState)([]),[ec,ed]=(0,n.useState)(!1),[ep,em]=(0,n.useState)(null),eu=(0,n.useRef)(null);(0,n.useEffect)(()=>{if(!L.isReady)return;let e=L.query.jobUrl;"string"==typeof e&&e&&!H&&W(e)},[L.isReady]);let ex=(0,n.useCallback)(async()=>{ed(!0);try{let e=await fetch("/api/jobs/auto-apply/list?limit=25");if(e.ok){let t=await e.json();el(t.submissions||[])}}catch(e){}finally{ed(!1)}},[]);(0,n.useEffect)(()=>{"authenticated"===U&&ex()},[U,ex]),(0,n.useEffect)(()=>{if(!(null==ei?void 0:ei.id))return;if(["submitted","failed","cancelled"].includes(ei.status)){ex();return}let e=ei.id,t=setInterval(async()=>{try{let t=await fetch("/api/jobs/auto-apply/".concat(e));if(t.ok){let a=await t.json();er({...a,id:a.id||e})}}catch(e){}},2500);return()=>clearInterval(t)},[null==ei?void 0:ei.id,null==ei?void 0:ei.status,ex]);let eh=(0,n.useMemo)(()=>(function(e){if(!e)return null;try{let t=new URL(e);if(/greenhouse\.io$/.test(t.hostname)||/\/jobs\/\d{6,10}/.test(t.pathname))return"greenhouse";if(/lever\.co$/.test(t.hostname))return"lever";if(/ashbyhq\.com$/.test(t.hostname))return"ashby";if(/myworkdayjobs\.com$/.test(t.hostname))return"workday";if(/smartrecruiters\.com$/.test(t.hostname))return"smartrecruiters";if(/linkedin\.com$/.test(t.hostname))return"linkedin-easyapply";return"unknown"}catch(e){return null}})(H),[H]),eg="greenhouse"===eh,eb=async()=>{Q("scraping");let e=await fetch("/api/jobs/auto-apply/scrape-jd",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jobUrl:H.trim()})}),t=await e.json();if(!e.ok||!t.success)throw Object.assign(Error(t.message||t.error),{code:t.error});let a={ats:t.ats,jobTitle:t.jobTitle,companyName:t.companyName,location:t.location,description:t.description,canonicalUrl:t.canonicalUrl};return ee(a),a},ey=async e=>{Q("generating");let t=await fetch("/api/ai/generate-resume-from-jd",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jobDescription:e.description,template:"ats-professional",forceNewGeneration:!0})}),a=await t.json();if(!t.ok||!a.success||!a.resume)throw Object.assign(Error(a.message||a.error||"Resume generation failed"),{code:a.error||"generation_failed"});return en(a.resume),a.resume},ef=async(e,t)=>{var a,s,n,i;Q("saving");let r=await fetch("/api/resumes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jobTitle:e.jobTitle||(null==t?void 0:null===(a=t.personalInfo)||void 0===a?void 0:a.targetRole)||"Auto-apply resume",companyName:e.companyName,jobDescription:e.description,content:t,template:"ats-professional",matchScore:(null==t?void 0:t.matchScore)||(null==t?void 0:null===(s=t._meta)||void 0===s?void 0:s.matchScore)||0,suggestions:[]})}),o=await r.json();if(!r.ok||!o.success)throw Error(o.error||"Failed to save resume");let l=(null===(n=o.resume)||void 0===n?void 0:n.id)||(null===(i=o.resume)||void 0===i?void 0:i._id);if(!l)throw Error("No resume id returned");return ea(l),l},ej=async(e,t)=>{Q("rendering");let s=(await Promise.all([a.e(5443),a.e(7847),a.e(6432),a.e(3842),a.e(6650)]).then(a.t.bind(a,80599,23))).default;if(!eu.current)throw Error("PDF host not mounted");let n=e=>null==e?"":String(e).replace(/[<>]/g,e=>({"<":"<",">":">"})[e]),i=(null==t?void 0:t.personalInfo)||{},r=(null==t?void 0:t.experiences)||(null==t?void 0:t.experience)||[],o=(null==t?void 0:t.education)||[],l=(null==t?void 0:t.skills)||[],c='\n <div style="font-family: Arial, Helvetica, sans-serif; color: #111827; font-size: 11pt; line-height: 1.45; padding: 32px 40px;">\n <h1 style="margin:0 0 2px; font-size: 20pt; font-weight: 700; letter-spacing: -0.01em;">'.concat(n(i.name||i.fullName||"Your Name"),'</h1>\n <div style="color:#374151; font-size: 10.5pt; margin-bottom: 4px;">').concat(n(i.targetRole||i.title||""),'</div>\n <div style="color:#4b5563; font-size: 10pt; margin-bottom: 16px;">\n ').concat([i.email,i.phone,i.location].filter(Boolean).map(n).join(" \xb7 "),"\n </div>\n ").concat((null==t?void 0:t.summary)?'\n <h2 style="font-size: 11pt; text-transform: uppercase; letter-spacing: 0.08em; border-bottom: 1px solid #e5e7eb; padding-bottom:4px; margin: 18px 0 8px;">Summary</h2>\n <div style="margin-bottom: 8px;">'.concat(n(t.summary),"</div>\n "):"","\n ").concat(r.length?'\n <h2 style="font-size: 11pt; text-transform: uppercase; letter-spacing: 0.08em; border-bottom: 1px solid #e5e7eb; padding-bottom:4px; margin: 18px 0 8px;">Experience</h2>\n '.concat(r.map(e=>'\n <div style="margin-bottom: 10px;">\n <div style="display:flex; justify-content: space-between; font-weight: 600;">
1\n <span>'.concat(n(e.title||e.role)).concat(e.company?" â "+n(e.company):"",'</span>\n <span style="font-weight: 400; color:#6b7280;">').concat(n(e.duration||e.dates||""),"</span>\n </div>\n ").concat((e.bullets||e.achievements||[]).slice(0,8).map(e=>'<div style="margin-left: 14px;">⢠'.concat(n(e),"</div>")).join(""),"\n </div>")).join(""),"\n "):"","\n ").concat(l.length?'\n <h2 style="font-size: 11pt; text-transform: uppercase; letter-spacing: 0.08em; border-bottom: 1px solid #e5e7eb; padding-bottom:4px; margin: 18px 0 8px;">Skills</h2>\n <div>'.concat(l.map(e=>n("string"==typeof e?e:e.name||e.skill)).filter(Boolean).join(" \xb7 "),"</div>\n "):"","\n ").concat(o.length?'\n <h2 style="font-size: 11pt; text-transform: uppercase; letter-spacing: 0.08em; border-bottom: 1px solid #e5e7eb; padding-bottom:4px; margin: 18px 0 8px;">Education</h2>\n '.concat(o.map(e=>'\n <div style="margin-bottom: 6px;"><span style="font-weight:600;">'.concat(n(e.degree||e.qualification),"</span>").concat(e.school?" â "+n(e.school):"",' <span style="color:#6b7280; font-size: 10pt;">').concat(n(e.year||e.dates||""),"</span></div>\n ")).join(""),"\n "):"","\n </div>");eu.current.innerHTML=c;let d=await s().set({margin:0,filename:"resume-".concat(e,".pdf"),image:{type:"jpeg",quality:.96},html2canvas:{scale:2,useCORS:!0,letterRendering:!0},jsPDF:{unit:"pt",format:"letter",orientation:"portrait"}}).from(eu.current).outputPdf("blob");Q("uploading");let p=await new Promise((e,t)=>{let a=new FileReader;a.onload=()=>e(a.result),a.onerror=()=>t(Error("Could not read generated PDF")),a.readAsDataURL(d)}),m=await fetch("/api/resumes/".concat(e,"/pdf"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({pdfBase64:p})}),u=await m.json();if(!m.ok||!u.success)throw Error(u.message||u.error||"PDF upload failed");return u.pdfUrl},ev=async(e,t)=>{Q("submitting");let a=await fetch("/api/jobs/auto-apply",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jobUrl:H.trim(),resumeId:e,jobTitle:t.jobTitle,companyName:t.companyName,consent:!0})}),s=await a.json();if(!a.ok)throw Object.assign(Error(s.message||s.error),{code:s.error});return er({id:s.submissionId,jobUrl:H.trim(),jobTitle:t.jobTitle,companyName:t.companyName,status:"queued",ats:s.ats}),Q("polling"),ex(),s.submissionId},ew=()=>H.trim()?Y?eg?null:"Only Greenhouse-hosted postings are supported today":"Tick the consent box to authorize the agent":"Paste a job URL first",eN=async()=>{let e=ew();if(e){p.default.error(e);return}V(!0),em(null),er(null);try{let e=await eb(),t=await ey(e),a=await ef(e,t);await ej(a,t),await ev(a,e),p.default.success("Auto-apply launched. Watch the trace on the right.")}catch(s){var t;let e=null==s?void 0:s.code,a=null==s?void 0:s.message;Q("error"),em({code:e,message:a}),p.default.error((null===(t=P[e||""])||void 0===t?void 0:t.title)||a||"Auto-apply failed")}finally{V(!1)}},ek=async()=>{let e=ew();if(e){p.default.error(e);return}V(!0),em(null),er(null);try{let e=await eb();await ey(e),Q("idle"),p.default.success('Preview ready â review below then click "Confirm & Apply".')}catch(s){var t;let e=null==s?void 0:s.code,a=null==s?void 0:s.message;Q("error"),em({code:e,message:a}),p.default.error((null===(t=P[e||""])||void 0===t?void 0:t.title)||a||"Preview generation failed")}finally{V(!1)}},eF=async()=>{if(K&&es){V(!0),em(null);try{let e=et||await ef(K,es);await ej(e,es),await ev(e,K),p.default.success("Auto-apply launched.")}catch(s){var e;let t=null==s?void 0:s.code,a=null==s?void 0:s.message;Q("error"),em({code:t,message:a}),p.default.error((null===(e=P[t||""])||void 0===e?void 0:e.title)||a||"Auto-apply failed")}finally{V(!1)}}},eA=J?"bg-[#1A1A1B] border-[#343536] text-white":"bg-white border-[#E5E7EB] text-[#0F172A] shadow-[0_4px_24px_-8px_rgba(15,23,42,0.08)]",eZ=J?"text-[#9CA3AF]":"text-[#475569]",eC=J?"text-[#6B6D70]":"text-[#64748B]";return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(r(),{children:[(0,s.jsx)("title",{children:"Auto Apply Agent â TrueResume"}),(0,s.jsx)("meta",{name:"description",content:"Paste a job URL â we scrape it, tailor a resume, and submit to the ATS on your behalf."})]}),(0,s.jsx)(x.Z,{}),(0,s.jsxs)("div",{"data-testid":"auto-apply-page",className:"min-h-screen pt-14 sm:pt-20 pb-24 md:pb-12 transition-colors duration-300 ".concat(J?"bg-[#030303] text-white":"bg-[#F7F8FA] text-[#0F172A]"),children:[(0,s.jsxs)("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8",children:[(0,s.jsxs)(m.E.div,{initial:{opacity:0,y:10}
1,animate:{opacity:1,y:0},transition:{duration:.3},className:"mb-6",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 mb-1",children:[(0,s.jsx)("div",{className:"w-11 h-11 rounded-xl flex items-center justify-center",style:{background:"linear-gradient(135deg,#FF4500,#CC3700)"},children:(0,s.jsx)(w.Z,{className:"w-5 h-5 text-white"})}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("h1",{className:"text-2xl sm:text-3xl font-bold tracking-tight",children:["Auto Apply Agent",(0,s.jsx)("span",{className:"ml-2 align-middle text-[10px] px-2 py-0.5 rounded-full bg-amber-500/15 text-amber-600 font-bold uppercase tracking-wider",children:"Beta"})]}),(0,s.jsx)("p",{className:"text-sm ".concat(eZ),children:"Paste any career-page job URL â we'll scrape the JD, tailor a resume, and submit it for you."})]})]}),(0,s.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-2 text-[11px]",children:[(0,s.jsx)("span",{className:eZ,children:"Supports:"}),[{ats:"workday",label:"Workday"},{ats:"greenhouse",label:"Greenhouse"},{ats:"lever",label:"Lever"},{ats:"ashby",label:"Ashby"},{ats:"smartrecruiters",label:"SmartRecruiters"}].map(e=>{let{ats:t,label:a}=e;return(0,s.jsxs)("span",{"data-testid":"auto-apply-ats-".concat(t),className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full font-semibold ".concat(J?"bg-emerald-500/15 text-emerald-300":"bg-emerald-100 text-emerald-700"),children:[(0,s.jsx)(f.Z,{className:"w-3 h-3"})," ",a]},t)})]})]}),"authenticated"!==U?(0,s.jsxs)("div",{"data-testid":"auto-apply-signin-required",className:"rounded-xl border-2 p-10 text-center ".concat(eA),children:[(0,s.jsx)(N.Z,{className:"w-12 h-12 mx-auto mb-4 text-[#FF4500]"}),(0,s.jsx)("p",{className:"text-xl font-semibold mb-1",children:"Sign in to use Auto Apply"}),(0,s.jsx)("p",{className:"text-sm mb-5 ".concat(eZ),children:"Your resumes and application history live in your account."}),(0,s.jsxs)(l(),{href:"/login","data-testid":"auto-apply-signin-link",className:"inline-flex items-center gap-2 px-5 py-2.5 rounded-lg font-semibold text-white",style:{background:"linear-gradient(135deg,#FF4500,#CC3700)"},children:["Sign in ",(0,s.jsx)(k.Z,{className:"w-4 h-4"})]})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-[1.25fr_1fr] gap-6",children:[(0,s.jsxs)(m.E.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.35,delay:.05},"data-testid":"auto-apply-form",className:"rounded-xl border-2 p-5 sm:p-6 space-y-5 ".concat(eA),children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-sm font-semibold mb-1.5 flex items-center gap-1.5",children:[(0,s.jsx)(F,{className:"w-4 h-4 text-[#FF4500]"})," Job posting URL"]}),(0,s.jsx)("input",{"data-testid":"auto-apply-url-input",type:"url",value:H,onChange:e=>W(e.target.value),placeholder:"https://boards.greenhouse.io/company/jobs/1234567",className:"w-full px-3.5 py-2.5 rounded-lg border-2 text-sm outline-none transition-colors ".concat(J?"bg-[#0F0F10] border-[#343536] text-white placeholder:text-[#6B6D70] focus:border-[#FF4500]":"bg-white border-[#D1D5DB] text-[#0F172A] placeholder:text-[#94A3B8] focus:border-[#FF4500]"),disabled:G}),eh&&(0,s.jsxs)("div",{"data-testid":"ats-detection",className:"mt-2 inline-flex items-center gap-1.5 text-xs px-2 py-0.5 rounded-full ".concat(eg?J?"bg-emerald-500/10 text-emerald-400":"bg-emerald-50 text-emerald-700":J?"bg-rose-500/10 text-rose-400":"bg-rose-50 text-rose-700"),children:[eg?(0,s.jsx)(f.Z,{className:"w-3 h-3"}):(0,s.jsx)(v.Z,{className:"w-3 h-3"}),eg?"Detected ".concat(eh):"".concat(eh," not yet supported")]})]}),(0,s.jsxs)("label",{className:"flex items-start gap-2.5 p-3 rounded-lg border-2 cursor-pointer transition-colors ".concat(J?"border-[#343536] bg-[#0F0F10] hover:border-[#FF4500]/60":"border-[#D1D5DB] bg-[#F9FAFB] hover:border-[#FF4500]/60"),children:[(0,s.jsx)("input",{"data-testid":"auto-apply-consent",type:"checkbox",checked:Y,onChange:e=>$(e.target.checked),className:"mt-0.5 w-4 h-4 accent-[#FF4500]"}),(0,s.jsx)("span",{className:"text-xs leading-relaxed ".concat(J?"text-[#D1D5DB]":"text-[#334155]"),children:"I authorize TrueResume to scrape the posting, generate a tailored resume on my profile, and submit it to the ATS on my behalf. I understand this is a BETA feature."})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[(0,s.jsxs)("button",{"data-testid":"quick-apply-btn",disabled:G||!Y||!H,onClick:eN,className:"inline-flex items-center justify-center gap-2 px-4 py-3 rounded-lg font-semibold text-white disabled:opacity-50 disabled:cursor-not-allowed transition-transform active:scale-[0.99]",style:{background:"linear-gradient(135deg,#FF4500,#CC3700)"},children:[G&&("scraping"===X||"generating"===X||"saving"===X||"rendering"===X||"uploading"===X||"submitting"===X)?(0,s.jsx)(y.Z,{className:"w-4 h-4 animate-spin"}):(0,s.jsx)(A.Z,{className:"w-4 h-4"}),"Quick Apply"]}),(0,s.jsxs)("button",{"data-testid":"review-apply-btn",disabled:G||!Y||!H,onClick:ek,className:"inline-flex items-center justify-center gap-2 px-4 py-3 rounded-lg font-semibold border-2 transition-colors disabled:opacity-50 disabled:cursor-not-allowed ".concat(J?"border-[#343536] text-white hover:bg-[#272729]":"border-[#CBD5E1] text-[#0F172A] hover:bg-[#F1F5F9]"),children:[(0,s.jsx)(Z.Z,{className:"w-4 h-4"}),"Review & Apply"]})]}),G&&"idle"!==X&&"polling"!==X&&"done"!==X&&"error"!==X&&(0,s.jsxs)("div",{"data-testid":"pi
1peline-progress",className:"rounded-lg border p-3 text-sm flex items-center gap-2 ".concat(J?"border-[#343536] bg-[#0F0F10]":"border-[#E5E7EB] bg-[#F8FAFC]"),children:[(0,s.jsx)(y.Z,{className:"w-4 h-4 animate-spin text-[#FF4500]"}),(0,s.jsx)("span",{className:"font-semibold",children:M[X]})]}),ep&&(0,s.jsxs)("div",{"data-testid":"auto-apply-error",className:"rounded-lg border p-3 text-sm ".concat(J?"border-rose-500/40 bg-rose-500/10 text-rose-200":"border-rose-200 bg-rose-50 text-rose-800"),children:[(0,s.jsxs)("div",{className:"font-semibold flex items-center gap-1.5",children:[(0,s.jsx)(j.Z,{className:"w-4 h-4"}),(null===(e=P[ep.code||""])||void 0===e?void 0:e.title)||ep.message||"Request rejected"]}),(0,s.jsx)("div",{className:"text-xs mt-1 opacity-90",children:(null===(t=P[ep.code||""])||void 0===t?void 0:t.hint)||ep.message}),(null===(i=P[ep.code||""])||void 0===i?void 0:i.cta)&&(0,s.jsxs)(l(),{href:P[ep.code||""].cta.href,className:"inline-flex items-center gap-1 mt-2 text-xs font-semibold underline",children:[P[ep.code||""].cta.label," ",(0,s.jsx)(k.Z,{className:"w-3 h-3"})]})]}),K&&!ei&&(0,s.jsxs)("div",{"data-testid":"jd-preview",className:"rounded-lg border-2 p-4 ".concat(J?"border-[#343536] bg-[#0F0F10]":"border-[#E5E7EB] bg-[#F8FAFC]"),children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5 mb-2 text-xs uppercase tracking-wider font-semibold text-[#FF4500]",children:[(0,s.jsx)(C.Z,{className:"w-3.5 h-3.5"})," Scraped job description"]}),(0,s.jsx)("div",{className:"font-bold text-base",children:K.jobTitle||"(no title)"}),(0,s.jsx)("div",{className:"text-xs mb-2 ".concat(eZ),children:[K.companyName,K.location].filter(Boolean).join(" \xb7 ")}),(0,s.jsxs)("div",{className:"text-xs leading-relaxed max-h-40 overflow-y-auto whitespace-pre-wrap ".concat(J?"text-[#D1D5DB]":"text-[#334155]"),children:[K.description.slice(0,1500),K.description.length>1500?"â¦":""]})]}),es&&!ei&&(0,s.jsxs)("div",{"data-testid":"resume-preview",className:"rounded-lg border-2 p-4 ".concat(J?"border-[#343536] bg-[#0F0F10]":"border-[#E5E7EB] bg-[#F8FAFC]"),children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5 mb-2 text-xs uppercase tracking-wider font-semibold text-[#FF4500]",children:[(0,s.jsx)(S.Z,{className:"w-3.5 h-3.5"})," Generated resume"]}),(0,s.jsx)("div",{className:"text-sm font-bold",children:(null==es?void 0:null===(o=es.personalInfo)||void 0===o?void 0:o.name)||"Your Name"}),(0,s.jsx)("div",{className:"text-xs ".concat(eZ," mb-2"),children:(null==es?void 0:null===(g=es.personalInfo)||void 0===g?void 0:g.targetRole)||""}),(null==es?void 0:es.summary)&&(0,s.jsxs)("div",{className:"text-xs mb-2 ".concat(J?"text-[#D1D5DB]":"text-[#334155]"),children:[String(es.summary).slice(0,320),String(es.summary).length>320?"â¦":""]}),(0,s.jsxs)("div",{className:"text-[11px] ".concat(eC),children:[((null==es?void 0:es.experiences)||[]).length," experience entries \xb7 ",((null==es?void 0:es.skills)||[]).length," skills"]}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-2 mt-3",children:[(0,s.jsxs)("button",{"data-testid":"confirm-reviewed-apply-btn",disabled:G,onClick:eF,className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-semibold text-white disabled:opacity-50",style:{background:"linear-gradient(135deg,#FF4500,#CC3700)"},children:[G?(0,s.jsx)(y.Z,{className:"w-3 h-3 animate-spin"}):(0,s.jsx)(E.Z,{className:"w-3 h-3"})," Confirm & Apply"]}),(0,s.jsxs)(l(),{href:"/create-resume?resumeId=".concat(et||""),className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-semibold border ".concat(J?"border-[#343536] text-white":"border-[#CBD5E1] text-[#0F172A]"),children:[(0,s.jsx)(T.Z,{className:"w-3 h-3"})," Edit in Builder"]}),(0,s.jsxs)("button",{onClick:()=>{ee(null),en(null),ea(null),em(null)},className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-semibold ".concat(J?"text-[#9CA3AF] hover:text-white":"text-[#475569] hover:text-[#0F172A]"),children:[(0,s.jsx)(D.Z,{className:"w-3 h-3"})," Start over"]})]})]})]}),(0,s.jsxs)(m.E.div,{initial:{opacity:0,y:10}
1,animate:{opacity:1,y:0},transition:{duration:.35,delay:.1},"data-testid":"auto-apply-status-panel",className:"rounded-xl border-2 p-5 sm:p-6 ".concat(eA),children:[(0,s.jsxs)("h2",{className:"text-lg font-bold mb-3 flex items-center gap-2",children:[(0,s.jsx)(w.Z,{className:"w-4 h-4 text-[#FF4500]"})," Live status"]}),(0,s.jsx)(u.M,{mode:"wait",children:ei?(0,s.jsxs)(m.E.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},className:"space-y-4",children:[(0,s.jsx)("div",{className:"flex items-center gap-2",children:(()=>{let e=q[ei.status]||q.queued,t=e.icon,a="submitting"===ei.status||"preparing"===ei.status;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"w-9 h-9 rounded-full ring-4 flex items-center justify-center ".concat(e.ring," ").concat(J?"bg-white/5":"bg-black/5"),children:(0,s.jsx)(t,{className:"w-5 h-5 ".concat(e.tint," ").concat(a?"animate-spin":"")})}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("div",{className:"font-semibold",children:e.label}),ei.step&&(0,s.jsx)("div",{className:"text-[11px] ".concat(eC),children:ei.step})]}),ei.ats&&(0,s.jsx)("span",{className:"text-[11px] px-2 py-0.5 rounded-full ".concat(J?"bg-[#0F0F10] text-[#9CA3AF]":"bg-[#F1F5F9] text-[#475569]"),children:ei.ats})]})})()}),(0,s.jsxs)("a",{href:ei.jobUrl,target:"_blank",rel:"noopener noreferrer",className:"text-xs break-all inline-flex items-start gap-1 ".concat(J?"text-[#9CA3AF] hover:text-white":"text-[#475569] hover:text-[#0F172A]"),children:[(0,s.jsx)(R.Z,{className:"w-3 h-3 mt-0.5 shrink-0"})," ",ei.jobUrl]}),ei.confirmationId&&(0,s.jsxs)("div",{"data-testid":"auto-apply-confirmation",className:"rounded-lg p-3 border text-sm ".concat(J?"border-emerald-500/30 bg-emerald-500/10 text-emerald-200":"border-emerald-200 bg-emerald-50 text-emerald-800"),children:[(0,s.jsxs)("div",{className:"font-semibold flex items-center gap-1.5",children:[(0,s.jsx)(f.Z,{className:"w-4 h-4"})," Confirmation"]}),(0,s.jsx)("div",{className:"text-xs mt-1 font-mono",children:ei.confirmationId}),ei.confirmationText&&(0,s.jsx)("div",{className:"text-xs mt-1 opacity-90",children:ei.confirmationText})]}),(ei.errorMessage||ei.errorCode)&&(0,s.jsxs)("div",{className:"rounded-lg p-3 border text-sm ".concat(J?"border-rose-500/40 bg-rose-500/10 text-rose-200":"border-rose-200 bg-rose-50 text-rose-800"),children:[(0,s.jsxs)("div",{className:"font-semibold flex items-center gap-1.5",children:[(0,s.jsx)(j.Z,{className:"w-4 h-4"}),(null===(b=P[ei.errorCode||""])||void 0===b?void 0:b.title)||"Agent stopped"]}),(0,s.jsx)("div",{className:"text-xs mt-1 opacity-90",children:ei.errorMessage||(null===(z=P[ei.errorCode||""])||void 0===z?void 0:z.hint)})]}),ei.trace&&ei.trace.length>0&&(0,s.jsxs)("div",{className:"space-y-1.5 max-h-72 overflow-y-auto pr-1",children:[(0,s.jsx)("div",{className:"text-[11px] uppercase tracking-wider font-semibold ".concat(eC),children:"Agent trace"}),ei.trace.map((e,t)=>(0,s.jsxs)("div",{className:"text-xs px-2.5 py-1.5 rounded-md ".concat(J?"bg-[#0F0F10] text-[#D1D5DB]":"bg-[#F1F5F9] text-[#334155]"),children:[(0,s.jsx)("span",{className:"font-mono text-[10px] mr-2 ".concat(eC),children:(e.at||"").toString().slice(11,19)}),(0,s.jsx)("span",{className:"font-semibold mr-1",children:e.kind}),(0,s.jsx)("span",{children:e.message})]},t))]})]},ei.id):(0,s.jsx)(m.E.div,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},className:"text-sm ".concat(eZ),children:G?M[X]:"Launch an auto-apply and the agent's real-time trace will appear here."},"empty")})]})]}),(0,s.jsxs)(m.E.section,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.35,delay:.15},"data-testid":"auto-apply-history",className:"rounded-xl border-2 p-5 sm:p-6 mt-6 ".concat(eA),children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,s.jsxs)("h2",{className:"text-lg font-bold flex items-center gap-2",children:[(0,s.jsx)(_.Z,{className:"w-4 h-4 text-[#FF4500]"})," Recent auto-applies"]}),(0,s.jsx)("button",{"data-testid":"refresh-history-btn",onClick:ex,disabled:ec,className:"text-xs font-semibold ".concat(J?"text-[#9CA3AF] hover:text-white":"text-[#475569] hover:text-[#0F172A]"," ").concat(ec?"opacity-50":""),children:ec?"Refreshingâ¦":"Refresh"})]}),0===eo.length?(0,s.jsx)("div",{className:"text-sm ".concat(eZ),children:"No auto-applies yet. Your submitted jobs will appear here."}):(0,s.jsx)("div",{className:"overflow-x-auto",children:(0,s.jsxs)("table",{className:"w-full text-sm",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{className:"text-[11px] uppercase tracking-wider ".concat(eC," text-left"),children:[(0,s.jsx)("th",{className:"font-semibold py-2 pr-3",children:"Job"}),(0,s.jsx)("th",{className:"font-semibold py-2 pr-3",children:"ATS"}),(0,s.jsx)("th",{className:"font-semibold py-2 pr-3",children:"Status"}),(0,s.jsx)("th",{className:"font-semibold py-2 pr-3",children:"When"}),(0,s.jsx)("th",{className:"font-semibold py-2 pr-3"})]})}),(0,s.jsx)("tbody",{children:eo.map(e=>{let t=q[e.status]||q.queued,a=t.icon;return(0,s.jsxs)("tr",{"data-testid":"history-row-".concat(e.id),className:"border-t ".concat(J?"border-[#2A2A2C]":"border-[#E5E7EB]"," cursor-pointer ").concat(J?"hover:bg-[#0F0F10]":"hover:bg-[#F8FAFC]"),onClick:()=>er({...e}),children:[(0,s.jsxs)("td",{className:"py-2.5 pr-3",children:[(0,s.jsx)("div",{className:"font-semibold truncate max-w-[260px]",children:e.jobTitle||"(no title)"}),e.companyName&&(0,s.jsx)("div",{className:"text-xs truncate max-w-[260px] ".concat(eC),children:e.companyName})]}),(0,s.jsx)("td",{className:"py-2.5 pr-3",children:(0,s.jsx)("span",{className:"text-[11px] px-2 py-0.5 rounded-full ".concat(J?"bg-[#0F0F10] text-[#9CA3AF]":"bg-[#F1F5F9] text-[#475569]"),children:e.ats||"unknown"})}),(0,s.jsx)("td",{className:"py-2.5 pr-3",children:(0,s.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-xs font-semibold ".concat(t.tint),children:[(0,s.jsx)(a,{className:"w-3.5 h-3.5"})," ",t.label]})}),(0,s.jsx)("td",{className:"py-2.5 pr-3 text-xs ".concat(eC),children:e.createdAt?new Date(e.createdAt).toLocaleString():"â"}),(0,s.jsx)("td",{className:"py-2.5 pr-3",children:(0,s.jsxs)("a",{href:e.jobUrl,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),className:"inline-flex items-center gap-1 text-xs ".concat(J?"text-[#9CA3AF] hover:text-white":"text-[#475569] hover:text-[#0F172A]"),children:[(0,s.jsx)(R.Z,{className:"w-3 h-3"})," Open"]})})]},e.id)})})]})})]}),(0,s.jsxs)("div",{className:"mt-6 rounded-lg border p-4 text-xs flex items-start gap-2 ".concat(J?"border-[#2A2A2C] bg-[#0F0F10] text-[#9CA3AF]":"border-[#E5E7EB] bg-white text-[#475569]"),children:[(0,s.jsx)(B.Z,{className:"w-4 h-4 mt-0.5 shrink-0"}),(0,s.jsxs)("div",{children:["We record every field the agent submits on your behalf so you can audit it later. No credentials are stored. Captchas, logins and multi-step forms require you â the agent will stop and flag ",(0,s.jsx)("span",{className:"font-semibold",children:"needs_human"}),"."]})]})]})]}),(0,s.jsx)("div",{ref:eu,style:{position:"fixed",left:-99999,top:0,width:794,pointerEvents:"none",opacity:0},"aria-hidden":!0})]})]})}}},function(e){e.O(0,[4968,1296,5412,2888,9774,179],function(){return e(e.s=17445)}),_N_E=e.O()}]);
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.