1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[340],{34053:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(52808).A)("circle-alert",[["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"}]])},92443:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(52808).A)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},63517:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(52808).A)("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]])},60269:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(52808).A)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},67558:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(52808).A)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]])},27678:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(52808).A)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},1246:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(52808).A)("refresh-cw",[["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"}]])},56314:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(52808).A)("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]])},72217:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(52808).A)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]])},17778:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/candidate/my-reviews",function(){return s(1936)}])},18344:(e,t,s)=>{"use strict";s.d(t,{A:()=>l});var a=s(68001);s(58757);let l=e=>{let{className:t="",...s}=e;return(0,a.jsx)("textarea",{className:"\n w-full rounded-lg p-3 \n bg-[#f0f5f7] border border-gray-200\n focus:bg-white focus:border-[1.5px] focus:border-blue-500 \n focus:outline-none transition-colors\n ".concat(t,"\n "),...s})}},1936:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>k});var a=s(68001),l=s(13658),r=s(58757),i=s(67910),c=s(57514),n=s(56314),d=s(30269),o=s(27678),x=s(90795),m=s(60269),u=s(1246),h=s(72217),y=s(94868),p=s(73830),g=s(7484),v=s(47956),f=s(18344);let b=e=>{let{status:t}=e;return(0,a.jsx)("span",{className:"px-2.5 py-0.5 rounded-full text-xs font-medium capitalize ".concat({pending:"bg-yellow-100 text-yellow-700",resent:"bg-blue-100 text-blue-700",done:"bg-green-100 text-green-700"}[t]||"bg-gray-100 text-gray-600"),children:t})},j=e=>{let{label:t,value:s}=e;return(0,a.jsxs)("div",{className:"flex items-center justify-between py-1.5",children:[(0,a.jsx)("span",{className:"text-sm text-gray-600 capitalize",children:t.replace(/([A-Z])/g," $1").trim()}),(0,a.jsxs)("div",{className:"flex gap-0.5",children:[[1,2,3,4,5].map(e=>(0,a.jsx)(n.A,{className:"w-4 h-4 ".concat(e<=s?"fill-yellow-400 text-yellow-400":"text-gray-300")},e)),(0,a.jsxs)("span",{className:"text-xs text-gray-500 ml-1",children:[s,"/5"]})]})]})},w=()=>{let[e,t]=(0,r.useState)([]),[s,l]=(0,r.useState)(!0),[w,N]=(0,r.useState)(!1),[k,A]=(0,r.useState)(null),[C,M]=(0,r.useState)(!1),[R,_]=(0,r.useState)(null),[q,E]=(0,r.useState)({receiverName:"",receiver
1Email:"",receiverDesg:"",companyName:"",message:""}),P=(0,r.useCallback)(async()=>{try{var e;l(!0);let s=await i.default.get("/candidate/reviews");(null===(e=s.data)||void 0===e?void 0:e.success)&&t(s.data.data||[])}catch(e){c.toast.error("Failed to load reviews")}finally{l(!1)}},[]),O=async(e,s)=>{try{var a;_(e);let l=!s,r=await i.default.put("/candidate/reviews/".concat(e,"/visibility"),{showOnProfile:l});(null===(a=r.data)||void 0===a?void 0:a.success)&&(t(t=>t.map(t=>t._id===e?{...t,showOnProfile:l}:t)),c.toast.success(l?"Review visible on profile":"Review hidden from profile"))}catch(e){c.toast.error("Failed to update visibility")}finally{_(null)}};(0,r.useEffect)(()=>{P()},[P]);let D=async e=>{var t,s,a;if(e.preventDefault(),!q.receiverName||!q.receiverEmail||!q.receiverDesg||!q.companyName){c.toast.error("Please fill all required fields");return}if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(q.receiverEmail)){c.toast.error("Please enter a valid email address");return}try{M(!0);let e=await i.default.post("/candidate/reviews",q);(null===(t=e.data)||void 0===t?void 0:t.success)&&(c.toast.success("Review request sent!"),N(!1),E({receiverName:"",receiverEmail:"",receiverDesg:"",companyName:"",message:""}),P())}catch(e){c.toast.error((null===(a=e.response)||void 0===a?void 0:null===(s=a.data)||void 0===s?void 0:s.message)||"Failed to send request")}finally{M(!1)}},F=async e=>{try{await i.default.put("/candidate/reviews/".concat(e,"/resend")),c.toast.success("Review request resent"),P()}catch(e){var t,s;c.toast.error((null===(s=e.response)||void 0===s?void 0:null===(t=s.data)||void 0===t?void 0:t.message)||"Failed to resend")}},S=async e=>{if(confirm("Are you sure you want to delete this review request?"))try{await i.default.delete("/candidate/reviews/".concat(e)),c.toast.success("Review deleted"),P()}catch(e){c.toast.error("Failed to delete")}},z=e=>{let t=Object.values(e||{}).filter(e=>"number"==typeof e);return t.length?(t.reduce((e,t)=>e+t,0)/t.length).toFixed(1):0};return s?(0,a.jsx)("div",{className:"flex-1 flex items-center justify-center py-20",children:(0,a.jsx)(d.A,{className:"w-6 h-6 animate-spin text-blue-600"})}):(0,a.jsxs)("div",{className:"flex-1 overflow-y-auto p-4 sm:p-6 space-y-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-2xl font-bold text-gray-800",children:"My Reviews"}),(0,a.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:"Request and manage peer reviews to strengthen your profile"})]}),(0,a.jsxs)("button",{onClick:()=>N(!0),className:"flex items-center gap-2 bg-blue-600 text-white px-4 py-2.5 rounded-lg hover:bg-blue-700 transition-colors text-sm font-medium",children:[(0,a.jsx)(o.A,{className:"w-4 h-4"})," Request Review"]})]}),0===e.length?(0,a.jsxs)("div",{className:"bg-white rounded-xl border p-12 text-center",children:[(0,a.jsx)(x.A,{className:"w-12 h-12 text-gray-300 mx-auto mb-4"}),(0,a.jsx)("h3",{className:"text-lg font-medium text-gray-700 mb-2",children:"No Reviews Yet"}),(0,a.jsx)("p",{className:"text-sm text-gray-500 mb-6",children:"Request reviews from colleagues to boost your profile credibility"}),(0,a.jsx)("button",{onClick:()=>N(!0),className:"bg-blue-600 text-white px-6 py-2.5 rounded-lg hover:bg-blue-700 transition-colors text-sm font-medium",children:"Request Your First Review"})]}):(0,a.jsx)("div",{className:"bg-white rounded-xl border overflow-hidden",children:(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"w-full text-sm",children:[(0,a.jsx)("thead",{className:"bg-gray-50 border-b",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"text-left px-4 py-3 font-medium text-gray-600",children:"Reviewer"}),(0,a.jsx)("th",{className:"text-left px-4 py-3 font-medium text-gray-600",children:"Email"}),(0,a.jsx)("th",{className:"text-left px-4 py-3 font-medium text-gray-600",children:"Company"}),(0,a.jsx)("th",{className:"text-left px-4 py-3 font-medium text-gray-600",children:"Designation"}),(0,a.jsx)("th",{className:"text-left px-4 py-3 font-medium text-gray-600",children:"Status"}),(0,a.jsx)("th",{className:"text-left px-4 py-3 font-medium text-gray-600",children:"Rating"}),(0,a.jsx)("th",{className:"text-right px-4 py-3 font-medium text-gray-600",children:"Actions"})]})}),(0,a.jsx)("tbody",{className:"divide-y",children:e.map(e=>(0,a.jsxs)("tr",{className:"hover:bg-gray-50 transition-colors",children:[(0,a.jsx)("td",{className:"px-4 py-3 font-medium text-gray-800",children:e.receiverName}),(0,a.jsx)("td",{className:"px-4 py-3 text-gray-600",children:e.receiver
1Email}),(0,a.jsx)("td",{className:"px-4 py-3 text-gray-600",children:e.companyName}),(0,a.jsx)("td",{className:"px-4 py-3 text-gray-600",children:e.receiverDesg}),(0,a.jsx)("td",{className:"px-4 py-3",children:(0,a.jsx)(b,{status:e.status})}),(0,a.jsx)("td",{className:"px-4 py-3",children:"done"===e.status?(0,a.jsxs)("span",{className:"flex items-center gap-1 text-yellow-600 font-medium",children:[(0,a.jsx)(n.A,{className:"w-3.5 h-3.5 fill-yellow-400"})," ",z(e.rateParams)]}):(0,a.jsx)("span",{className:"text-gray-400",children:"-"})}),(0,a.jsx)("td",{className:"px-4 py-3",children:(0,a.jsxs)("div",{className:"flex items-center justify-end gap-2",children:["done"===e.status&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{type:"button",role:"switch","aria-checked":!1!==e.showOnProfile,disabled:R===e._id,onClick:()=>O(e._id,!1!==e.showOnProfile),title:!1!==e.showOnProfile?"Visible on profile":"Hidden from profile",className:"relative inline-flex h-5 w-9 items-center rounded-full transition-colors flex-shrink-0 ".concat(!1!==e.showOnProfile?"bg-blue-600":"bg-gray-300"," ").concat(R===e._id?"opacity-50":""),children:(0,a.jsx)("span",{className:"inline-block h-3.5 w-3.5 transform rounded-full bg-white transition-transform ".concat(!1!==e.showOnProfile?"translate-x-4":"translate-x-0.5")})}),(0,a.jsx)("button",{onClick:()=>A(e),className:"p-1.5 text-blue-600 hover:bg-blue-50 rounded-md",title:"View Feedback",children:(0,a.jsx)(m.A,{className:"w-4 h-4"})})]}),"pending"===e.status&&(0,a.jsx)("button",{onClick:()=>F(e._id),className:"p-1.5 text-blue-600 hover:bg-blue-50 rounded-md",title:"Resend",children:(0,a.jsx)(u.A,{className:"w-4 h-4"})}),"done"!==e.status&&(0,a.jsx)("button",{onClick:()=>S(e._id),className:"p-1.5 text-red-500 hover:bg-red-50 rounded-md",title:"Delete",children:(0,a.jsx)(h.A,{className:"w-4 h-4"})})]})})]},e._id))})]})})}),w&&(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm p-4",children:(0,a.jsxs)("div",{className:"bg-white rounded-2xl shadow-2xl w-full max-w-lg overflow-hidden",children:[(0,a.jsxs)("div",{className:"bg-gradient-to-r from-blue-600 to-indigo-600 px-6 py-5 relative",children:[(0,a.jsx)("button",{onClick:()=>N(!1),className:"absolute top-4 right-4 p-1 hover:bg-white/20 rounded-md text-white/90 hover:text-white transition-colors",children:(0,a.jsx)(y.A,{className:"w-5 h-5"})}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"w-11 h-11 bg-white/20 rounded-full flex items-center justify-center flex-shrink-0",children:(0,a.jsx)(p.A,{className:"w-5 h-5 text-white"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-lg font-semibold text-white",children:"Request a Review"}),(0,a.jsx)("p",{className:"text-xs text-blue-100 mt-0.5",children:"Ask a colleague to review your professional skills"})]})]})]}),(0,a.jsxs)("form",{onSubmit:D,className:"space-y-4 p-6",children:[(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,a.jsx)(v.A,{label:"Name",type:"text",value:q.receiverName,onChange:e=>E({...q,receiverName:e.target.value}),placeholder:"John Doe",required:!0}),(0,a.jsx)(v.A,{label:"Email",type:"email",value:q.receiverEmail,onChange:e=>E({...q,receiverEmail:e.target.value}),placeholder:"[email protected]",required:!0})]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,a.jsx)(v.A,{label:"Company",type:"text",value:q.companyName,onChange:e=>E({...q,companyName:e.target.value}),placeholder:"Acme Corp",required:!0}),(0,a.jsx)(v.A,{label:"Designation",type:"text",value:q.receiverDesg,onChange:e=>E({...q,receiverDesg:e.target.value}),placeholder:"Engineering Manager",required:!0})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Message (optional)"}),(0,a.jsx)(f.A,{value:q.message,onChange:e=>E({...q,message:e.target.value}),className:"w-full border rounded-lg px-3 py-2 text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500 outline-none resize-none",rows:3,placeholder:"Hi, I'd appreciate if you could review my professional skills..."})]}),(0,a.jsxs)("div",{className:"flex justify-end gap-3 pt-2",children:[(0,a.jsx)("button",{type:"button",onClick:()=>N(!1),className:"px-4 py-2 text-sm text-gray-600 hover:bg-gray-100 rounded-lg",children:"Cancel"}),(0,a.jsxs)("button",{type:"submit",disabled:C,className:"flex items-center gap-2 bg-blue-600 text-white px-5 py-2 rounded-lg hover:bg-blue-700 disabled:opacity-50 text-sm font-medium",children:[C?(0,a.jsx)(d.A,{className:"w-4 h-4 animate-spin"}):(0,a.jsx)(g.A,{className:"w-4 h-4"}),"Send Request"]})]})]})]})}),k&&(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",children:(0,a.jsxs)("div",{className:"bg-white rounded-xl shadow-xl w-full max-w-md mx-4 p-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-5",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-lg font-semibold text-gray-800",children:"Review Feedback"}),(0,a.jsxs)("p",{className:"text-sm text-gray-500",children:["From ",k.receiverName," at"," ",k.companyName]})]}),(0,a.jsx)("button",{onClick:()=>A(null),className:"p-1 hover:bg-gray-100 rounded-md",children:(0,a.jsx)(y.A,{className:"w-5 h-5 text-gray-500"})})]}),(0,a.jsx)("div",{className:"space-y-1 mb-4",children:k.rateParams&&Object.entries(k.rateParams).map(e=>{let[t,s]=e;return(0,a.jsx)(j,{label:t,value:s},t)}
1)}),(0,a.jsxs)("div",{className:"bg-blue-50 rounded-lg p-3 flex items-center gap-2 mb-4",children:[(0,a.jsx)(n.A,{className:"w-5 h-5 fill-yellow-400 text-yellow-400"}),(0,a.jsxs)("span",{className:"text-sm font-medium text-gray-700",children:["Average Rating: ",z(k.rateParams),"/5"]})]}),k.comment&&(0,a.jsxs)("div",{children:[(0,a.jsx)("h4",{className:"text-sm font-medium text-gray-700 mb-1",children:"Comment"}),(0,a.jsx)("p",{className:"text-sm text-gray-600 bg-gray-50 rounded-lg p-3",children:k.comment})]}),(0,a.jsx)("div",{className:"flex justify-end pt-4",children:(0,a.jsx)("button",{onClick:()=>A(null),className:"px-4 py-2 text-sm bg-gray-100 hover:bg-gray-200 rounded-lg text-gray-700",children:"Close"})})]})})]})};var N=s(51318);let k=()=>(0,a.jsxs)(l.A,{children:[(0,a.jsx)(N.bV,{title:"My Reviews",description:"Employer reviews and feedback on your Olibr profile."}),(0,a.jsx)(w,{})]})}},e=>{var t=t=>e(e.s=t);e.O(0,[6551,7717,5553,6410,8926,9588,5876,4960,2024,3658,7956,636,6593,8792],()=>t(17778)),_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.