1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1518],{26019:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/email-digest",function(){return a(60672)}])},43765:function(e,t,a){"use strict";a.d(t,{Z:function(){return r}});let r=(0,a(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"}]])},23346:function(e,t,a){"use strict";a.d(t,{Z:function(){return r}});let r=(0,a(63759).Z)("Calendar",[["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",ry:"2",key:"eu3xkr"}],["line",{x1:"16",x2:"16",y1:"2",y2:"6",key:"m3sa8f"}],["line",{x1:"8",x2:"8",y1:"2",y2:"6",key:"18kwsl"}],["line",{x1:"3",x2:"21",y1:"10",y2:"10",key:"xt86sb"}]])},60493:function(e,t,a){"use strict";a.d(t,{Z:function(){return r}});let r=(0,a(63759).Z)("CheckCircle",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]])},61258:function(e,t,a){"use strict";a.d(t,{Z:function(){return r}});let r=(0,a(63759).Z)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},15928:function(e,t,a){"use strict";a.d(t,{Z:function(){return r}});let r=(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"}]])},86691:function(e,t,a){"use strict";a.d(t,{Z:function(){return r}});let r=(0,a(63759).Z)("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]])},3350:function(e,t,a){"use strict";a.d(t,{Z:function(){return r}});let r=(0,a(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"}]])},44976:function(e,t,a){"use strict";a.d(t,{Z:function(){return r}});let r=(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"}]])},36127:function(e,t,a){"use strict";a.d(t,{Z:function(){return r}});let r=(0,a(63759).Z)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},89176:function(e,t,a){"use strict";a.d(t,{Z:function(){return r}});let r=(0,a(63759).Z)("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]])},60672:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return T}});var r=a(85893),s=a(67294),l=a(9008),n=a.n(l),i=a(11163),d=a(85412),c=a(67694),o=a(61258),x=a(86691),m=a(44976),h=a(42020),g=a(89176),u=a(80893),b=a(8267),y=a(43765),p=a(60493),j=a(33058),f=a(36127),k=a(60641),N=a(63759);let w=(0,N.Z)("AtSign",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]]);var v=a(62190),F=a(3350),S=a(23346),C=a(15928),E=a(23603);let Z=(0,N.Z)("TestTube",[["path",{d:"M14.5 2v17.5c0 1.4-1.1 2.5-2.5 2.5h0c-1.4 0-2.5-1.1-2.5-2.5V2",key:"187lwq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M14.5 16h-5",key:"1ox875"}]]);function T(){let{theme:e}=(0,c.F)(),t=(0,i.useRouter)(),[a,l]=(0,s.useState)(""),[N,T]=(0,s.useState)("individual"),[M,A]=(0,s.useState)(null),[P,D]=(0,s.use
1State)(!0),[O,U]=(0,s.useState)(""),[_,J]=(0,s.useState)([]),[B,I]=(0,s.useState)(!1),[q,z]=(0,s.useState)(null),[L,R]=(0,s.useState)(""),[W,K]=(0,s.useState)(""),[H,V]=(0,s.useState)(""),[X,Q]=(0,s.useState)(""),[G,Y]=(0,s.useState)(""),[$,ee]=(0,s.useState)("all"),[et,ea]=(0,s.useState)(""),[er,es]=(0,s.useState)(0),[el,en]=(0,s.useState)("all"),[ei,ed]=(0,s.useState)(80),[ec,eo]=(0,s.useState)(100),[ex,em]=(0,s.useState)(5),[eh,eg]=(0,s.useState)(""),[eu,eb]=(0,s.useState)(0),[ey,ep]=(0,s.useState)(!1),[ej,ef]=(0,s.useState)(!1),[ek,eN]=(0,s.useState)(""),[ew,ev]=(0,s.useState)(""),[eF,eS]=(0,s.useState)(null),[eC,eE]=(0,s.useState)(!1),[eZ,eT]=(0,s.useState)(""),[eM,eA]=(0,s.useState)(!1);(0,s.useEffect)(()=>{let e=localStorage.getItem("admin_key");if(!e){t.push("/admin");return}l(e),eO(e)},[]),(0,s.useEffect)(()=>{if(!O||O.length<2){J([]);return}let e=setTimeout(()=>{eP(O)},300);return()=>clearTimeout(e)},[O,a]);let eP=async e=>{if(a)try{I(!0);let t=await fetch("/api/admin/email-digest",{method:"POST",headers:{"Content-Type":"application/json","x-admin-key":a},body:JSON.stringify({action:"search-users",query:e})});if(!t.ok)throw Error("Search failed");let r=await t.json();J(r.users||[])}catch(e){console.error("Search error:",e)}finally{I(!1)}},eD=async e=>{try{let t=await fetch("/api/admin/email-digest",{method:"POST",headers:{"Content-Type":"application/json","x-admin-key":a},body:JSON.stringify({action:"get-user",userId:e._id})});if(t.ok){let e=await t.json();z(e.user)}else z(e);U(""),J([])}catch(t){z(e)}},eO=async e=>{try{D(!0);let t=await fetch("/api/admin/email-digest",{method:"POST",headers:{"Content-Type":"application/json","x-admin-key":e},body:JSON.stringify({action:"stats"})});if(!t.ok)throw Error("Failed to fetch stats");let a=await t.json();A(a.stats)}catch(e){console.error("Stats error:",e)}finally{D(!1)}},eU=async()=>{if(!L.trim()||!W.trim()){eN("Please enter both subject and message");return}try{ef(!0),eN("");let e=await fetch("/api/admin/email-digest",{method:"POST",headers:{"Content-Type":"application/json","x-admin-key":a},body:JSON.stringify({action:"preview-individual",recipientName:(null==q?void 0:q.name)||"there",subject:L,message:W})});if(!e.ok){let t=await e.json();throw Error(t.error||"Preview failed")}let t=await e.json();V(t.preview.html)}catch(e){eN(e.message)}finally{ef(!1)}},e_=async()=>{if(!q){eN("Please select a recipient");return}if(!L.trim()||!W.trim()){eN("Please enter both subject and message");return}if(!eC){eE(!0);return}try{ep(!0),eN(""),ev("");let e=await fetch("/api/admin/email-digest",{method:"POST",headers:{"Content-Type":"application/json","x-admin-key":a},body:JSON.stringify({action:"send-individual",recipientEmail:q.email,recipientName:q.name,subject:L,message:W})}),t=await e.json();if(!e.ok)throw Error(t.error||"Send failed");ev("Email sent successfully to ".concat(q.email,"!")),eE(!1),R(""),K(""),V("")}catch(e){eN(e.message),eE(!1)}finally{ep(!1)}},eJ=async()=>{if(!X.trim()||!G.trim()){eN("Please enter both subject and message");return}try{ef(!0),eN("");let e=await fetch("/api/admin/email-digest",{method:"POST",headers:{"Content-Type":"application/json","x-admin-key":a},body:JSON.stringify({action:"preview-custom",country:$,subject:X,message:G})});if(!e.ok){let t=await e.json();throw Error(t.error||"Preview failed")}let t=await e.json();ea(t.preview.html),es(t.preview.recipientCount)}catch(e){eN(e.message)}finally{ef(!1)}},eB=async()=>{if(!eC&&!eM){eE(!0);return}try{ep(!0),eN(""),ev(""),eS(null);let e=await fetch("/api/admin/email-digest",{method:"POST",headers:{"Content-Type":"application/json","x-admin-key":a},body:JSON.stringify({action:"send-custom",country:$,subject:X,message:G,testEmail:eM?eZ:void 0})}),t=await e.json();if(!e.ok)throw Error(t.error||"Send failed");eS(t),ev("Successfully sent ".concat(t.sent," emails!")),eE(!1)}catch(e){eN(e.message)}finally{ep(!1)}},eI=async()=>{try{ef(!0),eN("");let e=await fetch("/api/admin/email-digest",{method:"POST",headers:{"Content-Type":"application/json","x-admin-key":a},body:JSON.stringify({action:"preview-digest",country:el,minMatch:ei,maxMatch:ec,limit:ex})});if(!e.ok){let t=await e.json();throw Error(t.error||"Preview failed")}let t=await e.json();eg(t.preview.html),eb(t.preview.recipientCount)}
1catch(e){eN(e.message)}finally{ef(!1)}},eq=async()=>{if(!eC&&!eM){eE(!0);return}try{ep(!0),eN(""),ev(""),eS(null);let e=await fetch("/api/admin/email-digest",{method:"POST",headers:{"Content-Type":"application/json","x-admin-key":a},body:JSON.stringify({action:"send-digest",country:el,minMatch:ei,maxMatch:ec,limit:ex,testEmail:eM?eZ:void 0,confirm:eC})}),t=await e.json();if(!e.ok)throw Error(t.error||"Send failed");eS(t),ev("Successfully sent ".concat(t.sent," emails!")),eE(!1)}catch(e){eN(e.message)}finally{ep(!1)}},ez=()=>{eN(""),ev(""),eS(null),eE(!1)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n(),{children:(0,r.jsx)("title",{children:"Email Digest - Admin | TrueResume"})}),(0,r.jsx)(d.Z,{}),(0,r.jsx)("div",{className:"min-h-screen pt-20 ".concat("dark"===e?"bg-[#030303]":"bg-gray-50"),children:(0,r.jsxs)("div",{className:"max-w-7xl mx-auto px-4 py-8",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-8",children:[(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)("button",{onClick:()=>t.push("/admin"),className:"p-2 rounded-lg transition-colors ".concat("dark"===e?"hover:bg-[#272729] text-gray-400":"hover:bg-gray-100 text-gray-600"),children:(0,r.jsx)(o.Z,{className:"w-5 h-5"})}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("h1",{className:"text-sharp text-2xl font-bold flex items-center gap-2",style:{fontFamily:"Rajdhani, sans-serif"},children:[(0,r.jsx)(x.Z,{className:"text-[#FF4500]"}),"Email Digest"]}),(0,r.jsx)("p",{className:"dark"===e?"text-gray-400":"text-gray-600",children:"Send custom emails and job digests to users"})]})]}),(0,r.jsxs)("button",{onClick:()=>eO(a),className:"flex items-center gap-2 px-4 py-2 rounded-lg transition-colors ".concat("dark"===e?"bg-[#272729] hover:bg-[#343536] text-gray-300":"bg-white hover:bg-gray-50 text-gray-700 border border-gray-200"),children:[(0,r.jsx)(m.Z,{className:"w-4 h-4 ".concat(P?"animate-spin":"")}),"Refresh Stats"]})]}),M&&(0,r.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-4 mb-8",children:[(0,r.jsxs)("div",{className:"p-4 rounded-xl ".concat("dark"===e?"bg-[#1A1A1B] border border-[#343536]":"bg-white border border-[#EDEFF1]"),children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,r.jsx)(h.Z,{className:"w-4 h-4 ".concat("dark"===e?"text-blue-400":"text-blue-600")}),(0,r.jsx)("span",{className:"dark"===e?"text-gray-400":"text-gray-600",children:"USA"})]}),(0,r.jsx)("p",{className:"text-2xl font-bold text-sharp",children:M.users.usa})]}),(0,r.jsxs)("div",{className:"p-4 rounded-xl ".concat("dark"===e?"bg-[#1A1A1B] border border-[#343536]":"bg-white border border-[#EDEFF1]"),children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,r.jsx)(h.Z,{className:"w-4 h-4 ".concat("dark"===e?"text-orange-400":"text-orange-600")}),(0,r.jsx)("span",{className:"dark"===e?"text-gray-400":"text-gray-600",children:"India"})]}),(0,r.jsx)("p",{className:"text-2xl font-bold text-sharp",children:M.users.india})]}),(0,r.jsxs)("div",{className:"p-4 rounded-xl ".concat("dark"===e?"bg-[#1A1A1B] border border-[#343536]":"bg-white border border-[#EDEFF1]"),children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,r.jsx)(h.Z,{className:"w-4 h-4 ".concat("dark"===e?"text-red-400":"text-red-600")}),(0,r.jsx)("span",{className:"dark"===e?"text-gray-400":"text-gray-600",children:"UK"})]}),(0,r.jsx)("p",{className:"text-2xl font-bold text-sharp",children:M.users.uk})]}),(0,r.jsxs)("div",{className:"p-4 rounded-xl ".concat("dark"===e?"bg-[#1A1A1B] border border-[#343536]":"bg-white border border-[#EDEFF1]"),children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,r.jsx)(g.Z,{className:"w-4 h-4 ".concat("dark"===e?"text-green-400":"text-green-600")}),(0,r.jsx)("span",{className:"dark"===e?"text-gray-400":"text-gray-600",children:"Total Users"})]}),(0,r.jsx)("p",{className:"text-2xl font-bold text-sharp",children:M.users.total})]}),(0,r.jsxs)("div",{className:"p-4 rounded-xl ".concat("dark"===e?"bg-[#1A1A1B] border border-[#343536]":"bg-white border border-[#
1EDEFF1]"),children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,r.jsx)(u.Z,{className:"w-4 h-4 ".concat("text-[#FF4500]")}),(0,r.jsx)("span",{className:"dark"===e?"text-gray-400":"text-gray-600",children:"Active Jobs"})]}),(0,r.jsx)("p",{className:"text-2xl font-bold text-sharp",children:M.jobs.total})]})]}),(0,r.jsxs)("div",{className:"flex flex-wrap gap-2 mb-6",children:[(0,r.jsxs)("button",{onClick:()=>{T("individual"),ez()},className:"px-6 py-3 rounded-xl font-medium transition-all ".concat("individual"===N?"bg-gradient-to-r from-[#FF4500] to-[#E03D00] text-white shadow-lg":"dark"===e?"bg-[#272729] text-gray-400 hover:bg-[#343536]":"bg-white text-gray-600 hover:bg-gray-50 border border-gray-200"),children:[(0,r.jsx)(b.Z,{className:"w-4 h-4 inline-block mr-2"}),"Individual Email"]}),(0,r.jsxs)("button",{onClick:()=>{T("custom"),ez()},className:"px-6 py-3 rounded-xl font-medium transition-all ".concat("custom"===N?"bg-[#FF4500] text-white":"dark"===e?"bg-[#272729] text-gray-400 hover:bg-[#343536]":"bg-white text-gray-600 hover:bg-gray-50 border border-gray-200"),children:[(0,r.jsx)(g.Z,{className:"w-4 h-4 inline-block mr-2"}),"Broadcast Message"]}),(0,r.jsxs)("button",{onClick:()=>{T("digest"),ez()},className:"px-6 py-3 rounded-xl font-medium transition-all ".concat("digest"===N?"bg-[#FF4500] text-white":"dark"===e?"bg-[#272729] text-gray-400 hover:bg-[#343536]":"bg-white text-gray-600 hover:bg-gray-50 border border-gray-200"),children:[(0,r.jsx)(u.Z,{className:"w-4 h-4 inline-block mr-2"}),"Job Digest"]})]}),ek&&(0,r.jsxs)("div",{className:"mb-6 p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-xl flex items-center gap-3",children:[(0,r.jsx)(y.Z,{className:"w-5 h-5 text-red-500"}),(0,r.jsx)("span",{className:"text-red-700 dark:text-red-400",children:ek})]}),ew&&(0,r.jsxs)("div",{className:"mb-6 p-4 bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-xl flex items-center gap-3",children:[(0,r.jsx)(p.Z,{className:"w-5 h-5 text-green-500"}),(0,r.jsx)("span",{className:"text-green-700 dark:text-green-400",children:ew})]}),eF&&(0,r.jsxs)("div",{className:"mb-6 p-4 rounded-xl ".concat("dark"===e?"bg-[#1A1A1B] border border-[#343536]":"bg-white border border-[#EDEFF1]"),children:[(0,r.jsx)("h3",{className:"text-sharp font-semibold mb-3",children:"Send Results"}),(0,r.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"dark"===e?"text-gray-400":"text-gray-600",children:"Total"}),(0,r.jsx)("p",{className:"text-xl font-bold text-sharp",children:eF.total})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-green-500",children:"Sent"}),(0,r.jsx)("p",{className:"text-xl font-bold text-green-500",children:eF.sent})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-red-500",children:"Failed"}),(0,r.jsx)("p",{className:"text-xl font-bold text-red-500",children:eF.failed})]}),void 0!==eF.usersWithSkills&&(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"dark"===e?"text-gray-400":"text-gray-600",children:"With Skills"}),(0,r.jsx)("p",{className:"text-xl font-bold text-sharp",children:eF.usersWithSkills})]})]}),eF.errors&&eF.errors.length>0&&(0,r.jsxs)("div",{className:"mt-4",children:[(0,r.jsx)("p",{className:"text-red-500 text-sm mb-2",children:"Errors (first 10):"}),(0,r.jsx)("div",{className:"text-xs p-3 rounded-lg ".concat("dark"===e?"bg-[#272729]":"bg-gray-100"),children:eF.errors.map((t,a)=>(0,r.jsx)("p",{className:"dark"===e?"text-gray-400":"text-gray-600",children:t},a))})]})]}),(0,r.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[(0,r.jsx)("div",{className:"p-6 rounded-2xl ".concat("dark"===e?"bg-[#1A1A1B] border border-[#343536]":"bg-white border border-[#EDEFF1]"),children:"individual"===N?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("h2",{className:"text-lg font-semibold text-sharp mb-4 flex items-center gap-2",children:[(0,r.jsx)(j.Z,{className:"w-5 h-5 text-[#FFF5F2]0"}),"Send Individual Email"]}),(0,r.jsxs)("div",{className:"mb-4",children:[(0,r.jsx)("label",{className:"block text-sm font-medium mb-2 ".concat("dark"===e?"text-gray-300":"text-gray-700"),children:"Search Customer"}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(f.Z,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 ".concat("dark"===e?"text-gray-500":"text-gray-400")}),(0,r.jsx)("input",{type:"text",value:O,onChange:e=>U(e.target.value),placeholder:"Search by email or name...",className:"w-full pl-10 pr-4 py-3 rounded-xl border transition-colors ".concat("dark"===e?"bg-[#272729] border-[#343536] text-white placeholder-gray-500":"bg-white border-gray-300 text-gray-900 placeholder-gray-400")}),B&&(0,r.jsx)(k.Z,{className:"absolute right-3 top-1/2 -translate-y-1/2 w-5 h-5 animate-spin text-[#FF4500]"})]}),_.length>0&&(0,r.jsx)("div",{className:"absolute z-50 mt-2 w-full max-w-md rounded-xl shadow-xl border overflow-hidden ".concat("dark"===e?"bg-[#272729] border-[#343536]":"bg-white border-[#
1EDEFF1]"),children:_.map(t=>(0,r.jsxs)("button",{onClick:()=>eD(t),className:"w-full px-4 py-3 text-left flex items-center gap-3 transition-colors ".concat("dark"===e?"hover:bg-[#343536] border-b border-[#343536] last:border-0":"hover:bg-gray-50 border-b border-gray-100 last:border-0"),children:[(0,r.jsx)("div",{className:"w-10 h-10 rounded-full flex items-center justify-center ".concat("dark"===e?"bg-[#FF4500]/20":"bg-[#FFE5DB]"),children:(0,r.jsx)(b.Z,{className:"w-5 h-5 text-[#FF4500]"})}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("p",{className:"font-medium text-sharp truncate",children:t.name}),(0,r.jsx)("p",{className:"text-sm truncate ".concat("dark"===e?"text-gray-400":"text-gray-500"),children:t.email})]}),(0,r.jsx)("span",{className:"text-xs px-2 py-1 rounded-full ".concat("dark"===e?"bg-[#343536] text-gray-400":"bg-gray-100 text-gray-600"),children:t.country})]},t._id))})]}),q&&(0,r.jsxs)("div",{className:"mb-4 p-4 rounded-xl border-2 ".concat("dark"===e?"bg-gradient-to-r from-[#FF4500]/15 to-[#FF4500]/15 border-[#FF4500]/30":"bg-gradient-to-r from-[#FFF1EE] to-[#FFF5F2] border-[#EDEFF1]"),children:[(0,r.jsxs)("div",{className:"flex items-start justify-between",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:"w-12 h-12 rounded-full flex items-center justify-center ".concat("dark"===e?"bg-[#FF4500]/30":"bg-[#FFE5DB]"),children:(0,r.jsx)(b.Z,{className:"w-6 h-6 text-[#FF4500]"})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"font-semibold text-sharp",children:q.name}),(0,r.jsxs)("p",{className:"text-sm flex items-center gap-1 ".concat("dark"===e?"text-gray-400":"text-gray-600"),children:[(0,r.jsx)(w,{className:"w-3 h-3"}),q.email]})]})]}),(0,r.jsx)("button",{onClick:()=>z(null),className:"p-1 rounded-lg transition-colors ".concat("dark"===e?"hover:bg-[#343536]":"hover:bg-gray-200"),children:(0,r.jsx)(v.Z,{className:"w-5 h-5 text-gray-500"})})]}),(0,r.jsxs)("div",{className:"mt-3 flex flex-wrap gap-2 text-xs",children:[(0,r.jsxs)("span",{className:"px-2 py-1 rounded-full flex items-center gap-1 ".concat("dark"===e?"bg-[#343536] text-gray-300":"bg-white text-gray-600"),children:[(0,r.jsx)(F.Z,{className:"w-3 h-3"})," ",q.country]}),(0,r.jsxs)("span",{className:"px-2 py-1 rounded-full flex items-center gap-1 ".concat("dark"===e?"bg-[#343536] text-gray-300":"bg-white text-gray-600"),children:[(0,r.jsx)(S.Z,{className:"w-3 h-3"})," Joined ",new Date(q.joinedAt).toLocaleDateString()]}),q.hasProfile&&(0,r.jsx)("span",{className:"px-2 py-1 rounded-full bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-400",children:"Has Profile"}),q.skills&&q.skills.length>0&&(0,r.jsxs)("span",{className:"px-2 py-1 rounded-full bg-blue-100 text-blue-700 dark:bg-blue-900/50 dark:text-blue-400",children:[q.skills.length," skills"]})]})]}),!q&&(0,r.jsxs)("div",{className:"mb-4 p-6 rounded-xl border-2 border-dashed text-center ".concat("dark"===e?"border-[#343536] bg-[#272729]":"border-gray-300 bg-gray-50"),children:[(0,r.jsx)(f.Z,{className:"w-10 h-10 mx-auto mb-2 ".concat("dark"===e?"text-gray-600":"text-gray-400")}),(0,r.jsx)("p",{className:"text-gray-500",children:"Search and select a customer above to send them a personalized email"})]}),(0,r.jsxs)("div",{className:"mb-4",children:[(0,r.jsx)("label",{className:"block text-sm font-medium mb-2 ".concat("dark"===e?"text-gray-300":"text-gray-700"),children:"Email Subject"}),(0,r.jsx)("input",{type:"text",value:L,onChange:e=>R(e.target.value),placeholder:"e.g., Quick question about your account",disabled:!q,className:"w-full px-4 py-3 rounded-xl border transition-colors ".concat("dark"===e?"bg-[#272729] border-[#343536] text-white placeholder-gray-500 disabled:opacity-50":"bg-white border-gray-300 text-gray-900 placeholder-gray-400 disabled:opacity-50")})]}),(0,r.jsxs)("div",{className:"mb-4",children:[(0,r.jsx)("label",{className:"block text-sm font-medium mb-2 ".concat("dark"===e?"text-gray-300":"text-gray-700"),children:"Message Content"}),(0,r.jsx)("textarea",{value:W,onChange:e=>K(e.target.value),placeholder:"Write your personalized message here...",rows:6,disabled:!q,className:"w-full px-4 py-3 rounded-xl border transition-colors resize-none ".concat("dark"===e?"bg-[#272729] border-[#343536] text-white placeholder-gray-500 disabled:opacity-50":"bg-white border-gray-300 text-gray-900 placeholder-gray-400 disabled:opacity-50")})]}),(0,r.jsxs)("div",{className:"flex gap-3",children:[(0,r.jsxs)("button",{onClick:eU,disabled:ej||!q||!L||!W,className:"flex-1 flex items-center justify-center gap-2 px-4 py-3 rounded-xl font-medium transition-colors ".concat("dark"===e?"bg-[#272729] hover:bg-[#343536] text-gray-300 disabled:opacity-50":"bg-gray-100 hover:bg-gray-200 text-gray-700 disabled:opacity-50"),children:[ej?(0,r.jsx)(k.Z,{className:"w-4 h-4 animate-spin"}):(0,r.jsx)(C.Z,{className:"w-4 h-4"}),"Preview"]}),(0,r.jsxs)("button",{onClick:e_,disabled:ey||!q||!L||!W,className:"flex-1 flex items-center justify-center gap-2 px-4 py-3 rounded-xl font-medium transition-colors ".concat(eC?"bg-gradient-to-r from-red-500 to-red-600 hover:from-red-600 hover:to-red-700 text-white":"bg-gradient-to-r from-[#FF4500] to-[#E03D00] hover:from-[#CC3700] hover:to-[#CC3700] text-white"," disabled:opacity-50 disabled:cursor-not-allowed"),children:[ey?(0,r.jsx)(k.Z,{className:"w-4 h-4 animate-spin"}):(0,r.jsx)(E.Z,{className:"w-4 h-4"}),eC?"Confirm Send?":"Send Email"]})]})]}):"custom"===N?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("h2",{className:"text-lg font-semibold text-sharp mb-4",children:"Broadcast Message"}),(0,r.jsxs)("div",{className:"mb-4",children:[(0,r.jsx)("label",{className:"block text-sm font-medium mb-2 ".concat("dark"===e?"text-gray-300":"text-gray-700"),children:"Target Country"}),(0,r.jsxs)("select",{value:$,onChange:e=>ee(e.target.value),className:"w-full px-4 py-3 rounded-xl border transition-colors ".concat("dark"===e?"bg-[#272729] border-[#343536] text-white":"bg-white border-gray-300 text-gray-900"),children:[(0,r.jsx)("option",{value:"all",children:"All Countries"}),(0,r.jsxs)("option",{value:"USA",children:["USA (",(null==M?void 0:M.users.usa)||0," users)"]}),(0,r.jsxs)("option",{value:"India",children:["India (",(null==M?void 0:M.users.india)||0," users)"]}),(0,r.jsxs)("option",{value:"UK",children:["UK (",(null==M?void 0:M.users.uk)||0," users)"]})]})]}),(0,r.jsxs)("div",{className:"mb-4",children:[(0,r.jsx)("label",{className:"block text-sm font-medium mb-2 ".concat("dark"===e?"text-gray-300":"text-gray-700"),children:"Email Subject"}),(0,r.jsx)("input",{type:"text",value:X,onChange:e=>Q(e.target.value),placeholder:"e.g., Important Update from TrueResume",className:"w-full px-4 py-3 rounded-xl border transition-colors ".concat("dark"===e?"bg-[#272729] border-[#343536] text-white placeholder-gray-500":"bg-white border-gray-300 text-gray-900 placeholder-gray-400")})]}),(0,r.jsxs)("div",{className:"mb-4",children:[(0,r.jsx)("label",{className:"block text-sm font-medium mb-2 ".concat("dark"===e?"text-gray-300":"text-gray-700"),children:"Message Content"}),(0,r.jsx)("textarea",{value:G,onChange:e=>Y(e.target.value),placeholder:"Enter your message here. Line breaks will be preserved.",rows:8,className:"w-full px-4 py-3 rounded-xl border transition-colors resize-none ".concat("dark"===e?"bg-[#272729] border-[#343536] text-white placeholder-gray-500":"bg-white border-gray-300 text-gray-900 placeholder-gray-400")})]}),(0,r.jsxs)("div",{className:"mb-4 p-4 rounded-xl border-2 border-dashed border-yellow-500/50 bg-[#FFF1EE]/10",children:[(0,r.jsxs)("label",{className:"flex items-center gap-3 cursor-pointer",children:[(0,r.jsx)("input",{type:"checkbox",checked:eM,onChange:e=>eA(e.target.checked),className:"w-5 h-5 rounded"}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(Z,{className:"w-4 h-4 text-[#FF4500]"}),(0,r.jsx)("span",{className:"font-medium ".concat("dark"===e?"text-yellow-400":"text-[#CC3700]"),children:"Test Mode"})]})]}),eM&&(0,r.jsx)("div",{className:"mt-3",children:(0,r.jsx)("input",{type:"email",value:eZ,onChange:e=>eT(e.target.value),placeholder:"Enter test email address",className:"w-full px-4 py-2 rounded-lg border ".concat("dark"===e?"bg-[#272729] border-[#343536] text-white":"bg-white border-gray-300 text-gray-900")})})]}),(0,r.jsxs)("div",{className:"flex gap-3",children:[(0,r.jsxs)("button",{onClick:eJ,disabled:ej,className:"flex-1 flex items-center justify-center gap-2 px-4 py-3 rounded-xl font-medium transition-colors ".concat("dark"===e?"bg-[#272729] hover:bg-[#343536] text-gray-300":"bg-gray-100 hover:bg-gray-200 text-gray-700"),children:[ej?(0,r.jsx)(k.Z,{className:"w-4 h-4 animate-spin"}):(0,r.jsx)(C.Z,{className:"w-4 h-4"}),"Preview"]}),(0,r.jsxs)("button",{onClick:eB,disabled:ey||!X||!G||eM&&!eZ,className:"flex-1 flex items-center justify-center gap-2 px-4 py-3 rounded-xl font-medium transition-colors ".concat(eC?"bg-red-600 hover:bg-red-700 text-white":"bg-[#FF4500] hover:bg-[#FF4500]/90 text-white"," disabled:opacity-50 disabled:cursor-not-allowed"),children:[ey?(0,r.jsx)(k.Z,{className:"w-4 h-4 animate-spin"}):(0,r.jsx)(E.Z,{className:"w-4 h-4"}),eC?"Confirm Send?":eM?"Send Test":"Send to All"]})]}),er>0&&!eM&&(0,r.jsxs)("p",{className:"mt-3 text-sm ".concat("dark"===e?"text-gray-400":"text-gray-600"),children:["Will send to ",(0,r.jsx)("strong",{children:er})," users"]})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("h2",{className:"text-lg font-semibold text-sharp mb-4",children:"Job Digest"}),(0,r.jsxs)("div",{className:"mb-4",children:[(0,r.jsx)("label",{className:"block text-sm font-medium mb-2 ".concat("dark"===e?"text-gray-300":"text-gray-700"),children:"Target Country"}),(0,r.jsxs)("select",{value:el,onChange:e=>en(e.target.value),className:"w-full px-4 py-3 rounded-xl border transition-colors ".concat("dark"===e?"bg-[#272729] border-[#343536] text-white":"bg-white border-gray-300 text-gray-900"),children:[(0,r.jsx)("option",{value:"all",children:"All Countries"}),(0,r.jsxs)("option",{value:"USA",children:["USA (",(null==M?void 0:M.users.usa)||0," users)"]}),(0,r.jsxs)("option",{value:"India",children:["India (",(null==M?void 0:M.users.india)||0," users)"]}),(0,r.jsxs)("option",{value:"UK",children:["UK (",(null==M?void 0:M.users.uk)||0," users)"]})]})]}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-sm font-medium mb-2 ".concat("dark"===e?"text-gray-300":"text-gray-700"),children:"Min Match %"}),(0,r.jsx)("input",{type:"number",value:ei,onChange:e=>ed(parseInt(e.target.value)||0),min:0,max:100,className:"w-full px-4 py-3 rounded-xl border transition-colors ".concat("dark"===e?"bg-[#272729] border-[#343536] text-white":"bg-white border-gray-300 text-gray-900")})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-sm font-medium mb-2 ".concat("dark"===e?"text-gray-300":"text-gray-700"),children:"Max Match %"}),(0,r.jsx)("input",{type:"number",value:ec,onChange:e=>eo(parseInt(e.target.value)||100),min:0,max:100,className:"w-full px-4 py-3 rounded-xl border transition-colors ".concat("dark"===e?"bg-[#272729] border-[#343536] text-white":"bg-white border-gray-300 text-gray-900")})]})]}),(0,r.jsxs)("div",{className:"mb-4",children:[(0,r.jsx)("label",{className:"block text-sm font-medium mb-2 ".concat("dark"===e?"text-gray-300":"text-gray-700"),children:"Jobs per Email"}),(0,r.jsx)("input",{type:"number",value:ex,onChange:e=>em(parseInt(e.target.value)||5),min:1,max:10,className:"w-full px-4 py-3 rounded-xl border transition-colors ".concat("dark"===e?"bg-[#272729] border-[#343536] text-white":"bg-white border-gray-300 text-gray-900")})]}),(0,r.jsxs)("div",{className:"mb-4 p-4 rounded-xl ".concat("dark"===e?"bg-[#272729]":"bg-blue-50"),children:[(0,r.jsx)("p",{className:"text-sm ".concat("dark"===e?"text-gray-300":"text-blue-700"),
1children:(0,r.jsx)("strong",{children:"How it works:"})}),(0,r.jsxs)("ul",{className:"text-sm mt-2 space-y-1 ".concat("dark"===e?"text-gray-400":"text-blue-600"),children:[(0,r.jsxs)("li",{children:["⢠Users with skills get jobs matching ",ei,"-",ec,"%"]}),(0,r.jsxs)("li",{children:["⢠Users without skills get latest ",ex," jobs"]}),(0,r.jsx)("li",{children:"⢠Different messaging for each group"})]})]}),(0,r.jsxs)("div",{className:"mb-4 p-4 rounded-xl border-2 border-dashed border-yellow-500/50 bg-[#FFF1EE]/10",children:[(0,r.jsxs)("label",{className:"flex items-center gap-3 cursor-pointer",children:[(0,r.jsx)("input",{type:"checkbox",checked:eM,onChange:e=>eA(e.target.checked),className:"w-5 h-5 rounded"}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(Z,{className:"w-4 h-4 text-[#FF4500]"}),(0,r.jsx)("span",{className:"font-medium ".concat("dark"===e?"text-yellow-400":"text-[#CC3700]"),children:"Test Mode"})]})]}),eM&&(0,r.jsx)("div",{className:"mt-3",children:(0,r.jsx)("input",{type:"email",value:eZ,onChange:e=>eT(e.target.value),placeholder:"Enter test email address",className:"w-full px-4 py-2 rounded-lg border ".concat("dark"===e?"bg-[#272729] border-[#343536] text-white":"bg-white border-gray-300 text-gray-900")})})]}),(0,r.jsxs)("div",{className:"flex gap-3",children:[(0,r.jsxs)("button",{onClick:eI,disabled:ej,className:"flex-1 flex items-center justify-center gap-2 px-4 py-3 rounded-xl font-medium transition-colors ".concat("dark"===e?"bg-[#272729] hover:bg-[#343536] text-gray-300":"bg-gray-100 hover:bg-gray-200 text-gray-700"),children:[ej?(0,r.jsx)(k.Z,{className:"w-4 h-4 animate-spin"}):(0,r.jsx)(C.Z,{className:"w-4 h-4"}),"Preview"]}),(0,r.jsxs)("button",{onClick:eq,disabled:ey||eM&&!eZ,className:"flex-1 flex items-center justify-center gap-2 px-4 py-3 rounded-xl font-medium transition-colors ".concat(eC?"bg-red-600 hover:bg-red-700 text-white":"bg-[#FF4500] hover:bg-[#FF4500]/90 text-white"," disabled:opacity-50 disabled:cursor-not-allowed"),children:[ey?(0,r.jsx)(k.Z,{className:"w-4 h-4 animate-spin"}):(0,r.jsx)(E.Z,{className:"w-4 h-4"}),eC?"Confirm Send?":eM?"Send Test":"Send Digest"]})]}),eu>0&&!eM&&(0,r.jsxs)("p",{className:"mt-3 text-sm ".concat("dark"===e?"text-gray-400":"text-gray-600"),children:["Will send to ",(0,r.jsx)("strong",{children:eu})," users"]})]})}),(0,r.jsxs)("div",{className:"p-6 rounded-2xl ".concat("dark"===e?"bg-[#1A1A1B] border border-[#343536]":"bg-white border border-[#EDEFF1]"),children:[(0,r.jsxs)("h2",{className:"text-lg font-semibold text-sharp mb-4 flex items-center gap-2",children:[(0,r.jsx)(C.Z,{className:"w-5 h-5"}),"Email Preview","individual"===N&&q&&(0,r.jsxs)("span",{className:"ml-2 text-sm font-normal px-2 py-1 rounded-full ".concat("dark"===e?"bg-[#FF4500]/20 text-[#FF4500]":"bg-[#FFE5DB] text-[#FF4500]"),children:["to: ",q.email]})]}),(0,r.jsx)("div",{className:"rounded-xl overflow-hidden border ".concat("dark"===e?"border-[#343536]":"border-gray-200"),children:("individual"===N?H:"custom"===N?et:eh)?(0,r.jsx)("iframe",{srcDoc:"individual"===N?H:"custom"===N?et:eh,className:"w-full h-[600px] bg-white",title:"Email Preview"}):(0,r.jsx)("div",{className:"h-[600px] flex items-center justify-center ".concat("dark"===e?"bg-[#272729]":"bg-gray-50"),children:(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)(C.Z,{className:"w-12 h-12 mx-auto mb-4 ".concat("dark"===e?"text-gray-600":"text-gray-400")}),(0,r.jsx)("p",{className:"text-gray-500",children:"individual"===N?'Select a customer and click "Preview" to see the email':'Click "Preview" to see the email template'})]})})})]})]})]})})]})}}},function(e){e.O(0,[4968,1296,5412,2888,9774,179],function(){return e(e.s=26019)}),_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.