1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2233],{47432:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/agents",function(){return s(61555)}])},52217:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(63759).Z)("Activity",[["path",{d:"M22 12h-4l-3 9L9 3l-3 9H2",key:"d5dnw9"}]])},43765:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(63759).Z)("AlertCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},3192:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(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,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(63759).Z)("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]])},15928:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(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"}]])},3350:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(63759).Z)("MapPin",[["path",{d:"M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z",key:"2oe9fu"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]])},45062:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(63759).Z)("Play",[["polygon",{points:"5 3 19 12 5 21 5 3",key:"191637"}]])},44976:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(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"}]])},90437:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(63759).Z)("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]])},9475:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(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,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(63759).Z)("Zap",[["polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2",key:"45s27k"}]])},61555:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return _}});var a=s(85893),l=s(67294),c=s(9008),n=s.n(c),r=s(41664),i=s.n(r),d=s(11163),o=s(67694),x=s(85412),m=s(92761),u=s(3192),p=s(44976),h=s(52217),g=s(80893),b=s(43765),y=s(22954),j=s(9475),N=s(46611),f=s(90437),v=s(2553),k=s(15928),w=s(71707);let F=(0,s(63759).Z)("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);var Z=s(39889),A=s(3350),S=s(50039),C=s(45062);function M(e){return null==e?"0":e>=1e6?(e/1e6).toFixed(1).replace(/\.0$/,"")+"M":e>=1e3?(e/1e3).toFixed(1).replace(/\.0$/,"")+"K":String(e)}function T(e){let t=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(t<1)return"just now";if(t<60)return"".concat(t,"m ago");let s=Math.floor(t/60);return s<24?"".concat(s,"h ago"):"".concat(Math.floor(s/24),"d ago")}function _(){var e,t,s,c,r,C,_,P;let{theme:z}=(0,o.F)(),Q=(0,d.useRouter)(),q="dark"===z,[O,E]=(0,l.useState)("marketing"),[J,L]=(0,l.useState)(null),[H,B]=(0,l.useState)(!0),[I,U]=(0,l.useState)(null),[V,X]=(0,l.useState)(null),[G,$]=(0,l.useState)(null),K=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/admin/agents/overview",{credentials:"include"});if(401===e.status){Q.replace("/admin");return}let t=await e.json();if(!t.success){U(t.error||"Failed");return}L(t.data),U(null)}catch(e){U((null==e?void 0:e.message)||"Failed to load")}finally{B(!1)}},[Q]);async function W(e){X(e),$(null);try{let t;let s=await fetch("/api/admin/agents/trigger",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({agent:e})}),a=await s.text();try{t=JSON.parse(a)}
1catch(e){t={success:!1,error:s.ok?"Non-JSON response from server (status ".concat(s.status,"): ").concat(a.slice(0,300)):"HTTP ".concat(s.status," â ").concat(a.slice(0,200))}}$(t),await K()}catch(e){$({success:!1,error:null==e?void 0:e.message})}finally{X(null)}}(0,l.useEffect)(()=>{K();let e=setInterval(K,3e4);return()=>clearInterval(e)},[K]);let Y=q?"bg-[#0b0d10]":"bg-gray-50",ee=q?"text-gray-100":"text-gray-900",et=q?"text-gray-400":"text-gray-500",es=q?"bg-[#15171b] border border-white/10":"bg-white border border-gray-200 shadow-sm",ea="px-4 py-2 rounded-full text-sm font-semibold transition-colors",el="bg-[#FF4500] text-white",ec=q?"bg-white/5 text-gray-300 hover:bg-white/10":"bg-gray-100 text-gray-700 hover:bg-gray-200";return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(n(),{children:[(0,a.jsx)("title",{children:"Agent Dashboard \xb7 Admin \xb7 TrueResume"}),(0,a.jsx)("meta",{name:"robots",content:"noindex,nofollow"})]}),(0,a.jsx)(x.Z,{}),(0,a.jsx)("main",{className:"min-h-screen pt-20 ".concat(Y," ").concat(ee),children:(0,a.jsxs)("div",{className:"max-w-7xl mx-auto px-4 py-8",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3 min-w-0",children:[(0,a.jsx)("button",{type:"button",onClick:()=>Q.push("/admin"),className:"shrink-0 p-2 rounded-xl mt-1 transition-colors ".concat(q?"bg-white/5 hover:bg-white/10 text-[#F4F7F9]":"bg-gray-100 hover:bg-gray-200 text-gray-900"),title:"Back to admin home",children:(0,a.jsx)(m.Z,{className:"w-5 h-5"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("h1",{className:"text-3xl font-extrabold tracking-tight flex flex-wrap items-center gap-2 ".concat(q?"text-white":"text-gray-900"),"data-testid":"agents-dashboard-title",children:[(0,a.jsx)(u.Z,{className:"w-7 h-7 text-[#FF4500]"}),"Agent Dashboard"]}),(0,a.jsxs)("p",{className:"mt-1 text-sm ".concat(et),children:["Live state of every autonomous agent. Auto-refresh every 30 sec.",J&&(0,a.jsxs)("span",{className:"ml-2 text-xs",children:["\xb7 last sync ",T(J.asOf)]})]})]})]}),(0,a.jsxs)("button",{onClick:K,className:"inline-flex items-center gap-2 px-4 py-2 rounded-full font-semibold ".concat(q?"bg-white/5 hover:bg-white/10 text-[#F4F7F9]":"bg-white border border-gray-200 hover:bg-gray-50 text-gray-900"),"data-testid":"agents-refresh-btn",children:[(0,a.jsx)(p.Z,{className:"w-4 h-4"})," Refresh"]})]}),(0,a.jsxs)("nav",{className:"mt-6 flex flex-wrap gap-2",role:"tablist",children:[(0,a.jsxs)("button",{"data-testid":"tab-marketing",onClick:()=>E("marketing"),className:"".concat(ea," ").concat("marketing"===O?el:ec),children:[(0,a.jsx)(h.Z,{className:"w-3.5 h-3.5 inline mr-1.5"}),"Marketing"]}),(0,a.jsxs)("button",{"data-testid":"tab-scrapers",onClick:()=>E("scrapers"),className:"".concat(ea," ").concat("scrapers"===O?el:ec),children:[(0,a.jsx)(g.Z,{className:"w-3.5 h-3.5 inline mr-1.5"}),"Scrapers"]}),(0,a.jsxs)("button",{"data-testid":"tab-auto-apply",onClick:()=>E("auto-apply"),className:"".concat(ea," ").concat("auto-apply"===O?el:ec),children:[(0,a.jsx)(u.Z,{className:"w-3.5 h-3.5 inline mr-1.5"}),"AutoApply"]})]}),I&&(0,a.jsxs)("div",{className:"mt-6 p-4 rounded-xl bg-red-500/15 border border-red-500/30 text-red-700",children:[(0,a.jsx)(b.Z,{className:"w-4 h-4 inline mr-2"}),I]}),H&&!J&&(0,a.jsx)("div",{className:"mt-12 text-center ".concat(et),children:"Loading dashboardâ¦"}),J&&(0,a.jsxs)(a.Fragment,{children:[G&&(0,a.jsx)("div",{className:"mt-6 p-4 rounded-xl border ".concat(G.success?"bg-emerald-500/10 border-emerald-500/30":"bg-red-500/10 border-red-500/30"),"data-testid":"agent-run-result",children:(0,a.jsxs)("div",{className:"flex items-start gap-2",children:[G.success?(0,a.jsx)(y.Z,{className:"w-4 h-4 text-emerald-500 mt-0.5"}):(0,a.jsx)(j.Z,{className:"w-4 h-4 text-red-500 mt-0.5"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsxs)("div",{className:"font-semibold text-sm ".concat(q?"text-[#F4F7F9]":"text-gray-900"),children:[G.agent||"Agent"," ",G.success?"completed":"failed"]}),(0,a.jsx)("pre",{className:"mt-2 text-[11px] overflow-x-auto p-2 rounded ".concat(q?"bg-black/30":"bg-gray-100"),children:null===(e=JSON.stringify(G.result||G.error,null,2))||void 0===e?void 0:e.slice(0,1200)})]})]})}),"marketing"===O&&(0,a.jsxs)("section",{className:"mt-6 grid gap-6",children:[(0,a.jsxs)("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-4",children:[(0,a.jsx)(D,{icon:(0,a.jsx)(N.Z,{className:"w-4 h-4 text-[#FF4500]"}),label:"Jobs scraped today",value:null===(t=J.marketing.metricsToday)||void 0===t?void 0:t.jobsScraped,card:es,subtle:et,isDark:q}),(0,a.jsx)(D,{icon:(0,a.jsx)(f.Z,{className:"w-4 h-4 text-emerald-500"}),label:"Cumulative apps",value:null===(c=J.marketing.metricsToday)||void 0===c?void 0:null===(s=c.cumulative)||void 0===s?void 0:s.applications,card:es,subtle:et,isDark:q}),(0,a.jsx)(D,{icon:(0,a.jsx)(v.Z,{className:"w-4 h-4 text-violet-500"}),label:"Cumulative resumes",value:null===(C=J.marketing.metricsToday)||void 0===C?void 0:null===(r=C.cumulative)||void 0===r?void 0:r.resumes,card:es,subtle:et,isDark:q}),(0,a.jsx)(D,{icon:(0,a.jsx)(h.Z,{className:"w-4 h-4 text-sky-500"}),label:"Cumulative users",value:null===(P=J.marketing.metricsToday)||void 0===P?void 0:null===(_=P.cumulative)||void 0===_?void 0:_.users,card:es,subtle:et,isDark:q})]}),(0,a.jsxs)("div",{className:"p-4 rounded-2xl ".concat(es," flex items-center gap-2 flex-wrap"),children:[(0,a.jsx)("span",{className:"text-sm font-semibold mr-2 ".concat(et),children:"Run agent:"}),(0,a.jsx)(R,{agent:"marketing",label:"Full marketing engine",running:V,onClick:W}),(0,a.jsx)(R,{agent:"blog",label:"Generate blog post",running:V,onClick:W}),(0,a.jsx)(R,{agent:"social-jobs",label:"Queue social posts",running:V,onClick:W}),(0,a.jsx)(R,{agent:"social-flush",label:"Flush social queue",running:V,onClick:W})]}),(0,a.jsxs)("div",{className:"p-5 rounded-2xl ".concat(es),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,a.jsxs)("h2",{className:"font-bold text-lg flex items-center gap-2 ".concat(q?"text-white":"text-gray-900"),children:[(0,a.jsx)(v.Z,{className:"w-4 h-4"})," Blog (",J.marketing.blog.total," posts \xb7 ",M(J.marketing.blog.totalViews)," total views)"]}),(0,a.jsx)(i(),{href:"/blog",target:"_blank",className:"text-xs text-[#FF4500] font-semibold hover:underline",children:"Visit blog â"})]}),0===J.marketing.blog.recent.length?(0,a.jsx)("p",{className:"text-sm ".concat(et),children:'No blog posts yet. Click "Generate blog post" to create one.'}):(0,a.jsx)("ul",{className:"divide-y divide-gray-200/10",children:J.marketing.blog.recent.map(e=>(0,a.jsxs)("li",{className:"py-2.5 flex items-center justify-between gap-3","data-testid":"blog-row-".concat(e.slug),children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("div",{className:"font-semibold text-sm line-clamp-1",children:e.title}),(0,a.jsxs)("div",{className:"text-xs ".concat(et," flex items-center gap-2 mt-0.5"),children:[(0,a.jsx)("span",{className:"px-1.5 py-0.5 rounded bg-[#FF4500]/15 text-[#FF4500] text-[9px] uppercase font-bold",children:e.category}),(0,a.jsx)("span",{children:T(e.publishedAt)}),"llm"===e.generatedBy&&e.llmModel&&(0,a.jsxs)("span",{className:"text-[10px]",children:["\xb7 ",e.llmModel]}),(0,a.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,a.jsx)(k.Z,{className:"w-3 h-3"})," ",e.views||0]})]})]}),(0,a.jsx)(i(),{href:"/blog/".concat(e.slug),target:"_blank",className:"text-xs ".concat(et," hover:text-[#FF4500] inline-flex items-center gap-1"),children:(0,a.jsx)(w.Z,{className:"w-3 h-3"})})]},e.slug))})]}),(0,a.jsxs)("div",{className:"p-5 rounded-2xl ".concat(es),children:[(0,a.jsxs)("h2",{className:"font-bold text-lg flex items-center gap-2 mb-3 ".concat(q?"text-white":"text-gray-900"),children:[(0,a.jsx)(F,{className:"w-4 h-4"})," Social queue"]}),(0,a.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 mb-4",children:["twitter","linkedin"].map(e=>{let t=J.marketing.social.byPlatform[e]||{pending:0,posted:0,failed:0,skipped:0};return(0,a.jsxs)("div",{className:"p-3 rounded-xl ".concat(q?"bg-black/20":"bg-gray-50"),"data-testid":"social-".concat(e),children:[(0,a.jsx)("div",{className:"text-[10px] uppercase tracking-widest font-bold ".concat(et),children:e}),(0,a.jsxs)("div",{className:"mt-1 text-lg font-extrabold tabular-nums ".concat(q?"text-white":"text-gray-950"),children:[t.pending," ",(0,a.jsx)("span",{className:"text-xs font-normal ".concat(et),children:"pending"})]}),(0,a.jsxs)("div",{className:"text-[11px] ".concat(et," mt-0.5"),children:[t.posted," posted \xb7 ",t.failed," failed"]})]},e)})}),0===J.marketing.social.recent.length?(0,a.jsx)("p",{className:"text-sm ".concat(et),children:'Queue is empty. Click "Queue social posts" or wait for the next marketing run.'}):(0,a.jsx)("ul",{className:"divide-y divide-gray-200/10",children:J.marketing.social.recent.slice(0,8).map((e,t)=>(0,a.jsxs)("li",{className:"py-2.5",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-[11px]",children:[(0,a.jsx)("span",{className:"px-1.5 py-0.5 rounded font-bold ".concat("posted"===e.status?"bg-emerald-500/15 text-emerald-600":"failed"===e.status?"bg-red-500/15 text-red-600":"skipped"===e.status?"bg-gray-500/15 text-gray-500":"bg-amber-500/15 text-amber-600"),children:e.status}),(0,a.jsx)("span",{className:"uppercase tracking-widest font-bold ".concat(et),children:e.platform}),(0,a.jsxs)("span",{className:"".concat(et),children:["\xb7 ",e.category," \xb7 ",T(e.scheduledAt)]})]}),(0,a.jsx)("p",{className:"text-xs mt-1 line-clamp-2",children:e.text})]},t))})]})]}),"scrapers"===O&&(0,a.jsxs)("section",{className:"mt-6 grid gap-6",children:[(0,a.jsxs)("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-4",children:[(0,a.jsx)(D,{icon:(0,a.jsx)(g.Z,{className:"w-4 h-4 text-sky-500"}),label:"Active jobs",value:J.scrapers.activeJobs,card:es,subtle:et,isDark:q}),(0,a.jsx)(D,{icon:(0,a.jsx)(y.Z,{className:"w-4 h-4 text-emerald-500"}),label:"Career-page only",value:J.scrapers.careerPageJobs,card:es,subtle:et,isDark:q}),(0,a.jsx)(D,{icon:(0,a.jsx)(f.Z,{className:"w-4 h-4 text-[#FF4500]"}),label:"Career-page ratio",value:"".concat(J.scrapers.careerPageRatio,"%"),card:es,subtle:et,isDark:q})]}),(0,a.jsxs)("div",{className:"p-4 rounded-2xl ".concat(es," flex items-center gap-2 flex-wrap"),children:[(0,a.jsx)("span",{className:"text-sm font-semibold mr-2 ".concat(et),children:"Run agent:"}),(0,a.jsx)(R,{agent:"scrape-priority",label:"Quick scrape (high priority)",running:V,onClick:W}),(0,a.jsx)(R,{agent:"scrape",label:"Full scrape (all 5 ATSes)",running:V,onClick:W})]}),(0,a.jsxs)("div",{className:"p-5 rounded-2xl ".concat(es),children:[(0,a.jsx)("h2",{className:"font-bold text-lg mb-3 ".concat(q?"text-white":"text-gray-900"),children:"Per-ATS breakdown"}),(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"w-full text-sm","data-testid":"scraper-ats-table",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"text-left ".concat(et," text-[11px] uppercase tracking-widest"),children:[(0,a.jsx)("th",{className:"py-2",children:"ATS"}),(0,a.jsx)("th",{className:"py-2 text-right",children:"Updated today (UTC)"}),(0,a.jsx)("th",{className:"py-2 text-right",children:"Total active"})]})}),(0,a.jsx)("tbody",{children:J.scrapers.byAts.map(e=>(0,a.jsxs)("tr",{className:"border-t border-gray-200/10",children:[(0,a.jsx)("td",{className:"py-2.5 font-semibold capitalize ".concat(q?"text-[#F4F
17F9]":"text-gray-900"),children:e.ats}),(0,a.jsx)("td",{className:"py-2.5 text-right tabular-nums ".concat(q?"text-[#F4F7F9]":"text-gray-950"),children:M(e.today)}),(0,a.jsx)("td",{className:"py-2.5 text-right tabular-nums ".concat(q?"text-[#F4F7F9]":"text-gray-950"),children:M(e.total)})]},e.ats))})]})})]}),(0,a.jsxs)("div",{className:"p-5 rounded-2xl ".concat(es),children:[(0,a.jsx)("h2",{className:"font-bold text-lg mb-3 ".concat(q?"text-white":"text-gray-900"),children:"Recently updated jobs"}),(0,a.jsx)("ul",{className:"divide-y divide-gray-200/10",children:J.scrapers.recent.slice(0,12).map(e=>{var t,s;return(0,a.jsxs)("li",{className:"py-2.5 flex items-center justify-between gap-3",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("div",{className:"font-semibold text-sm line-clamp-1",children:e.title}),(0,a.jsxs)("div",{className:"text-xs ".concat(et," mt-0.5 flex items-center gap-2"),children:[(0,a.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,a.jsx)(Z.Z,{className:"w-3 h-3"})," ",e.companyName]}),e.location&&(0,a.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,a.jsx)(A.Z,{className:"w-3 h-3"})," ",e.location]}),(0,a.jsx)("span",{className:"px-1.5 py-0.5 rounded text-[9px] uppercase font-bold ".concat(q?"bg-white/10":"bg-gray-100"),children:e.atsSystem}),(0,a.jsxs)("span",{children:["\xb7 ",T(e.scrapedAt||e.updatedAt)]})]})]}),(0,a.jsx)("div",{className:"text-xs font-bold ".concat((null!==(t=e.importQualityScore)&&void 0!==t?t:0)>=70?"text-emerald-500":(null!==(s=e.importQualityScore)&&void 0!==s?s:0)>=40?"text-amber-500":"text-gray-400"),title:"importQualityScore (0â100)",children:null!=e.importQualityScore?e.importQualityScore:"â"})]},e.jobId)})})]})]}),"auto-apply"===O&&(0,a.jsxs)("section",{className:"mt-6 grid gap-6",children:[(0,a.jsxs)("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-4",children:[(0,a.jsx)(D,{icon:(0,a.jsx)(y.Z,{className:"w-4 h-4 text-emerald-500"}),label:"Submitted today",value:J.autoApply.today.submitted,card:es,subtle:et,isDark:q}),(0,a.jsx)(D,{icon:(0,a.jsx)(b.Z,{className:"w-4 h-4 text-amber-500"}),label:"Needs human",value:J.autoApply.today.needs_human,card:es,subtle:et,isDark:q}),(0,a.jsx)(D,{icon:(0,a.jsx)(j.Z,{className:"w-4 h-4 text-red-500"}),label:"Failed today",value:J.autoApply.today.failed,card:es,subtle:et,isDark:q}),(0,a.jsx)(D,{icon:(0,a.jsx)(S.Z,{className:"w-4 h-4 text-sky-500"}),label:"In progress",value:J.autoApply.today.in_progress||J.autoApply.today.pending,card:es,subtle:et,isDark:q})]}),(0,a.jsxs)("div",{className:"p-5 rounded-2xl ".concat(es),children:[(0,a.jsx)("h2",{className:"font-bold text-lg mb-3 ".concat(q?"text-white":"text-gray-900"),children:"Per-ATS success rate (7d)"}),0===J.autoApply.byAts.length?(0,a.jsx)("p",{className:"text-sm ".concat(et),children:"No AutoApply submissions yet."}):(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"w-full text-sm","data-testid":"auto-apply-ats-table",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"text-left ".concat(et," text-[11px] uppercase tracking-widest"),children:[(0,a.jsx)("th",{className:"py-2",children:"ATS"}),(0,a.jsx)("th",{className:"py-2 text-right",children:"Submitted"}),(0,a.jsx)("th",{className:"py-2 text-right",children:"Needs human"}),(0,a.jsx)("th",{className:"py-2 text-right",children:"Failed"}),(0,a.jsx)("th",{className:"py-2 text-right",children:"Total"}),(0,a.jsx)("th",{className:"py-2 text-right",children:"Success rate"})]})}),(0,a.jsx)("tbody",{children:J.autoApply.byAts.map(e=>(0,a.jsxs)("tr",{className:"border-t border-gray-200/10",children:[(0,a.jsx)("td",{className:"py-2.5 font-semibold capitalize ".concat(q?"text-[#F4F7F9]":"text-gray-900"),children:e.ats}),(0,a.jsx)("td",{className:"py-2.5 text-right text-emerald-600 font-semibold tabular-nums",children:e.submitted}),(0,a.jsx)("td",{className:"py-2.5 text-right text-amber-600 tabular-nums",children:e.needs_human}),(0,a.jsx)("td",{className:"py-2.5 text-right text-red-600 tabular-nums",children:e.failed}),(0,a.jsx)("td",{className:"py-2.5 text-right tabular-nums ".concat(q?"text-[#F4F
17F9]":"text-gray-950"),children:e.total}),(0,a.jsx)("td",{className:"py-2.5 text-right",children:(0,a.jsxs)("span",{className:"font-bold ".concat(e.successRate>=80?"text-emerald-500":e.successRate>=50?"text-amber-500":"text-red-500"),children:[e.successRate,"%"]})})]},e.ats))})]})})]}),(0,a.jsxs)("div",{className:"p-5 rounded-2xl ".concat(es),children:[(0,a.jsx)("h2",{className:"font-bold text-lg mb-3 ".concat(q?"text-white":"text-gray-900"),children:"Recent submissions"}),0===J.autoApply.recent.length?(0,a.jsx)("p",{className:"text-sm ".concat(et),children:"No recent AutoApply attempts."}):(0,a.jsx)("ul",{className:"divide-y divide-gray-200/10",children:J.autoApply.recent.slice(0,10).map((e,t)=>(0,a.jsxs)("li",{className:"py-2.5",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-[11px]",children:[(0,a.jsx)("span",{className:"px-1.5 py-0.5 rounded font-bold ".concat("submitted"===e.status?"bg-emerald-500/15 text-emerald-600":"needs_human"===e.status?"bg-amber-500/15 text-amber-600":"failed"===e.status?"bg-red-500/15 text-red-600":"bg-sky-500/15 text-sky-600"),children:e.status}),(0,a.jsx)("span",{className:"uppercase tracking-widest font-bold ".concat(et),children:e.ats}),(0,a.jsxs)("span",{className:et,children:["\xb7 ",T(e.createdAt)]})]}),(0,a.jsx)("div",{className:"text-sm font-semibold mt-1",children:e.jobTitle||e.jobUrl}),e.companyName&&(0,a.jsx)("div",{className:"text-xs ".concat(et),children:e.companyName}),e.errorMessage&&(0,a.jsxs)("div",{className:"text-xs text-red-500 mt-1 line-clamp-2",children:["â ",e.errorMessage]})]},t))})]})]})]})]})})]})}let D=e=>{let{icon:t,label:s,value:l,card:c,subtle:n,isDark:r}=e;return(0,a.jsxs)("div",{className:"p-4 rounded-2xl ".concat(c),"data-testid":"stat-".concat(s.toLowerCase().replace(/\s+/g,"-")),children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[t,(0,a.jsx)("span",{className:"text-[10px] uppercase tracking-widest font-bold ".concat(n),children:s})]}),(0,a.jsx)("div",{className:"mt-1 text-2xl font-extrabold tracking-tight tabular-nums ".concat(r?"text-white":"text-gray-950"),children:"string"==typeof l?l:M(l)})]})},R=e=>{let{agent:t,label:s,running:l,onClick:c}=e,n=l===t,r=null!=l;return(0,a.jsxs)("button",{onClick:()=>c(t),disabled:r,"data-testid":"run-".concat(t),className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full text-sm font-semibold transition-colors\n ".concat(n?"bg-amber-500/20 text-amber-600":"bg-[#FF4500] text-white hover:opacity-90","\n ").concat(r&&!n?"opacity-50 cursor-not-allowed":""),children:[n?(0,a.jsx)(p.Z,{className:"w-3.5 h-3.5 animate-spin"}):(0,a.jsx)(C.Z,{className:"w-3.5 h-3.5"}),s]})}}},function(e){e.O(0,[4968,1296,5412,2888,9774,179],function(){return e(e.s=47432)}),_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.