1import{_ as re}from"./ClrA_iI3.js";import{q as ce,e as de,c as r,a as e,b as g,w,v as a,t as l,F,r as R,h as q,g as x,d as h,i as pe,M as z,l as Z,k as d,av as ue,U as _e,aW as xe,ah as me,m as ve,o as i,n as M,ax as he,I as fe,D as be,E as ye}from"./CJgdbCYG.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{_ as ge}from"./CBnIvcDs.js";import{c as A}from"./B2sHi2SD.js";import{_ as we}from"./DlAUqK2U.js";const ke={class:"min-h-screen py-6 px-4"},Ee={class:"app-container mx-auto"},Ce={class:"flex items-center gap-2 text-sm text-[#666666] mb-4"},Be={class:"ml-1 hover:text-[#00A0B5]"},Fe={class:"text-[#252525]"},Me={class:"text-[32px] font-[800] text-[#252525] mb-6"},Ve={class:"border-b border-[#E5E7EB] mb-6"},De={class:"flex gap-0"},$e=["onClick"],Re={class:"ml-1"},ze={class:"flex items-center justify-between mb-4"},Ae={class:"text-[20px] font-[700] text-[#252525]"},Ie={class:"flex items-center gap-3"},Ye={class:"bg-white rounded-[16px] border border-[#E5E7EB]"},Pe={key:0,class:"flex justify-center items-center py-16"},Ue={key:1,class:"flex flex-col items-center justify-center py-16 text-[#87898E]"},He={class:"text-[16px]"},Le={key:2,class:"w-full"},je={class:"border-b border-[#E5E7EB] bg-[#F8F8FA]"},Ne={class:"text-left text-[13px] text-[#87898E] font-medium px-4 py-3 w-10"},Te={class:"text-left text-[13px] text-[#87898E] font-medium px-4 py-3"},Se={class:"text-left text-[13px] text-[#87898E] font-medium px-4 py-3"},qe={class:"text-left text-[13px] text-[#87898E] font-medium px-4 py-3"},Ze={class:"text-left text-[13px] text-[#87898E] font-medium px-4 py-3"},Oe={class:"text-left text-[13px] text-[#87898E] font-medium px-4 py-3"},We={key:0,class:"text-left text-[13px] text-[#87898E] font-medium px-4 py-3"},Ge={class:"px-4 py-4 text-[14px] text-[#87898E]"},Je={class:"px-4 py-4"},Ke={class:"text-[14px] font-semibold text-[#252525] uppercase"},Qe={class:"text-[13px] text-[#87898E]"},Xe={class:"px-4 py-4 text-[14px] text-[#252525]"},et={class:"px-4 py-4"},tt={class:"text-[13px] text-[#87898E] truncate max-w-[200px]"},st={class:"px-4 py-4"},ot={class:"px-4 py-4 max-w-[260px]"},lt={class:"list-decimal list-inside space-y-0.5"},at={key:0,class:"text-[13px] text-[#666666] mt-1 italic"},nt={key:0,class:"px-4 py-4"},it={class:"text-[14px] text-[#252525]"},rt={class:"text-[13px] text-[#87898E]"},ct={class:"px-4 py-4 text-right relative"},dt={key:0,class:"relative inline-block"},pt=["onClick"],ut={key:0,class:"absolute right-0 top-8 bg-white border border-[#E5E7EB] rounded-[12px] shadow-lg z-20 min-w-[180px] py-1"},_t=["onClick"],xt=["onClick"],mt=["onClick"],vt={key:0,class:"flex items-center justify-between mt-4"},ht={class:"text-[13px] text-[#87898E]"},ft={class:"py-2"},bt={class:"text-[16px] text-[#252525] mb-3"},yt={class:"flex gap-3 mb-6"},gt={class:"text-[15px] text-[#252525] mb-2"},wt=["placeholder"],kt={class:"flex justify-between items-center border-t border-[#E5E7EB] pt-4"},Et=["disabled"],Ct={key:0,class:"py-2 space-y-3"},Bt={class:"text-[15px] text-[#252525]"},Ft={class:"font-semibold"},Mt={class:"text-[15px] text-[#252525]"},Vt={class:"font-semibold"},Dt={class:"text-[15px] font-semibold text-[#252525] mb-2"},$t={class:"text-[15px] text-[#252525] bg-[#F8F8FA] rounded-[10px] p-3"},Rt={key:0},zt={__name:"index",setup(At){const{t:o}=ce(),O=pe(),W=ve(),G=O.params.id,u=d("vacancy_open"),H=Z(()=>[{key:"vacancy_open",label:o("complaints_tabs.vacancy_open")},{key:"resume_open",label:o("complaints_tabs.resume_open")},{key:"closed",label:o("complaints_tabs.closed")}]),V=d({vacancy_open:0,resume_open:0,closed:0}),J=Z(()=>H.value.find(t=>t.key===u.value)?.label??""),I=d([]),Y=d(!1),c=d({current_page:1,last_page:1,per_page:20,total:0}),k=d(null),f=d(null),L=d([]),m=d(null),E=d(!1),j=d(null),D=d(!1),p=d({is_valid:null,note:""}),P=d(!1),v=d(null);async function b(n=1){Y.value=!0,m.value=null;try{const t={page:n,per_page:c.value.per_page};u.value==="vacancy_open"?(t.type="vacancy",t.status="open"):u.value==="resume_open"?(t.type="resume",t.status="open"):t.status="closed",k.value&&(t.reason_
1id=k.value),f.value?.[0]&&(t.from_date=f.value[0]),f.value?.[1]&&(t.to_date=f.value[1]);const _=(await A.getModeratorComplaints(t)).data;I.value=_.items||[],c.value=_.pagination||{current_page:1,last_page:1,per_page:20,total:0},_.meta?.tabs&&(V.value.vacancy_open=_.meta.tabs.vacancy_open??0,V.value.resume_open=_.meta.tabs.resume_open??0,V.value.closed=_.meta.tabs.closed??0)}catch(t){console.error(t),z.error(o("hr_complaints.error_load"))}finally{Y.value=!1}}async function K(){try{const[n,t]=await Promise.all([A.getVacancyReasons(),A.getResumeReasons()]),C=n.data?.[0]?.value?.uz||[],_=t.data?.[0]?.value?.uz||[],$=new Map;[...C,..._].forEach(y=>$.set(y.id,y)),L.value=[...$.values()].sort((y,U)=>y.sort-U.sort)}catch(n){console.error(n)}}function Q(n){u.value=n,c.value.current_page=1,k.value=null,f.value=null,b(1)}function X(n){b(n)}function ee(n){m.value=m.value===n?null:n}function N(n){return n.entity_type==="resume"?`/resumes/${n.entity?.id}`:`/vacancies/${n.entity?.id}`}function te(n){m.value=null,W.push(N(n))}function se(n){m.value=null,j.value=n,p.value={is_valid:null,note:""},E.value=!0}async function oe(){if(!(p.value.is_valid===null||!p.value.note.trim())){D.value=!0;try{await A.closeComplaint(j.value.id,{is_valid:p.value.is_valid,note:p.value.note.trim()}),z.success(o("hr_complaints.success_closed")),E.value=!1,b(c.value.current_page)}catch(n){z.error(n?.response?.data?.message||o("hr_complaints.error_generic"))}finally{D.value=!1}}}function le(n){v.value=n,P.value=!0}function ae(n){return{1:"bg-yellow-100 text-yellow-700",2:"bg-[#E8F5F8] text-[#0099B5]",3:"bg-gray-100 text-gray-600",4:"bg-red-100 text-red-600"}[n]??"bg-gray-100 text-gray-500"}function ne(){z.info(o("hr_complaints.download_soon"))}return de(async()=>{await Promise.all([K(),b(1)])}),(n,t)=>{const C=re,_=he,$=ue,y=_e,U=xe,T=me;return i(),r(F,null,[e("div",ke,[e("div",Ee,[e("nav",Ce,[g(C,{to:`/${a(G)}/hr/dashboard`,class:"flex gap-1"},{default:w(()=>[t[12]||(t[12]=e("img",{src:ge,alt:"Icon",class:"w-4 h-4"},null,-1)),e("span",Be,l(a(o)("complaints.breadcrumb_home")),1)]),_:1},8,["to"]),t[13]||(t[13]=e("span",null,"/",-1)),e("span",Fe,l(a(o)("complaints.title")),1)]),e("h1",Me,l(a(o)("complaints.title")),1),e("div",Ve,[e("div",De,[(i(!0),r(F,null,R(H.value,s=>(i(),r("button",{key:s.key,onClick:S=>Q(s.key),class:M(["px-4 py-3 text-[15px] font-medium transition-colors border-b-2 -mb-[2px]",u.value===s.key?"border-[#0099B5] text-[#0099B5]":"border-transparent text-[#666666] hover:text-[#252525]"])},[h(l(s.label)+" ",1),e("span",Re,l(V.value[s.key]??0),1)],10,$e))),128))])]),e("div",ze,[e("h2",Ae,l(J.value),1),e("div",Ie,[g($,{modelValue:k.value,"onUpdate:modelValue":t[0]||(t[0]=s=>k.value=s),placeholder:a(o)("complaints.filter_complaint_types"),clearable:"",class:"!w-[200px]",onChange:b},{default:w(()=>[(i(!0),r(F,null,R(L.value,s=>(i(),q(_,{key:s.id,label:s.name,value:s.id,style:{"font-size":"12px !important"}},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"]),u.value==="closed"?(i(),q(y,{key:0,modelValue:f.value,"onUpdate:modelValue":t[1]||(t[1]=s=>f.value=s),type:"daterange",format:"DD.MM.YYYY","value-format":"YYYY-MM-DD","start-placeholder":a(o)("complaints.filter_from"),"end-placeholder":a(o)("complaints.filter_to"),class:"!w-[260px] !h-[40px]",onChange:t[2]||(t[2]=s=>b(1)),onClear:t[3]||(t[3]=s=>b(1))},null,8,["modelValue","start-placeholder","end-placeholder"])):x("",!0),e("button",{class:"flex items-center gap-2 bg-[#0099B5] hover:bg-[#008299] text-white px-[24px] py-[6px] rounded-[12px] font-semibold text-sm transition-colors",onClick:ne},[t[14]||(t[14]=e("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e("path",{d:"M12 16L7 11H10V4H14V11H17L12 16Z",fill:"white"}),e("path",{d:"M5 18H19V20H5V18Z",fill:"white"})],-1)),h(" "+l(a(o)("complaints.download")),1)])])]),e("div",Ye,[Y.value?(i(),r("div",Pe,[...t[15]||(t[15]=[e("div",{class:"animate-spin rounded-full h-10 w-10 border-b-2 border-[#0099B5]"},null,-1)])])):I.value.length?(i(),r("table",Le,[e("thead",je,[e("tr",null,[e("th",Ne,l(a(o)("complaints.table.number")),1),e("th",Te,l(a(o)("complaints.table.complainant")),1),e("th",Se,l(a(o)("complaints.table.sent_date")),1),e("th",qe,l(u.value==="resume_open"?a(o)("complaints.table.resume"):a(o)("complaints.table.vacancy")),1
1),e("th",Ze,l(u.value==="resume_open"?a(o)("complaints.table.resume_status"):a(o)("complaints.table.vacancy_status")),1),e("th",Oe,l(a(o)("complaints.table.complaints")),1),u.value==="closed"?(i(),r("th",We,l(a(o)("complaints.table.moderator_close_date")),1)):x("",!0),t[17]||(t[17]=e("th",{class:"px-4 py-3 w-12"},null,-1))])]),e("tbody",null,[(i(!0),r(F,null,R(I.value,(s,S)=>(i(),r("tr",{key:s.id,class:"border-b border-[#F1F2F4] last:border-0 hover:bg-[#FAFAFA] transition-colors"},[e("td",Ge,l((c.value.current_page-1)*c.value.per_page+S+1),1),e("td",Je,[e("p",Ke,l(s.complainant?.full_name),1),e("p",Qe,"+998"+l(s.complainant?.phone),1)]),e("td",Xe,l(s.created_at),1),e("td",et,[g(C,{to:N(s),class:"text-[14px] font-medium text-[#0099B5] hover:underline block"},{default:w(()=>[h(l(s.entity?.title||s.entity?.full_name||"â"),1)]),_:2},1032,["to"]),e("p",tt,l(s.entity?.owner),1)]),e("td",st,[e("span",{class:M(["inline-flex px-2 py-1 rounded-[6px] text-[13px] font-medium",ae(s.entity_status)])},l(s.entity_status_label),3)]),e("td",ot,[e("ol",lt,[(i(!0),r(F,null,R(s.reasons,(B,ie)=>(i(),r("li",{key:ie,class:"text-[14px] text-[#252525]"},l(B)+"; ",1))),128))]),s.other_reason?(i(),r("p",at,l(s.other_reason),1)):x("",!0)]),u.value==="closed"?(i(),r("td",nt,[e("p",it,l(s.moderator?.full_name),1),e("p",rt,l(s.closed_at),1)])):x("",!0),e("td",ct,[u.value!=="closed"?(i(),r("div",dt,[e("button",{onClick:fe(B=>ee(s.id),["stop"]),class:"p-1 rounded hover:bg-gray-100 text-[#87898E]"},[...t[18]||(t[18]=[e("span",{class:"text-[20px] leading-none tracking-widest"},"···",-1)])],8,pt),m.value===s.id?(i(),r("div",ut,[e("button",{onClick:B=>te(s),class:"flex items-center gap-2 w-full px-4 py-2.5 text-[14px] text-[#252525] hover:bg-[#F8F8FA] transition-colors"},[t[19]||(t[19]=e("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none"},[e("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z",stroke:"#252525","stroke-width":"2"}),e("circle",{cx:"12",cy:"12",r:"3",stroke:"#252525","stroke-width":"2"})],-1)),h(" "+l(s.entity_type==="resume"?a(o)("complaints.view_resume"):a(o)("complaints.view_vacancy")),1)],8,_t),e("button",{onClick:B=>se(s),class:"flex items-center gap-2 w-full px-4 py-2.5 text-[14px] text-[#252525] hover:bg-[#F8F8FA] transition-colors"},[t[20]||(t[20]=e("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none"},[e("rect",{x:"3",y:"3",width:"18",height:"18",rx:"3",stroke:"#252525","stroke-width":"2"}),e("path",{d:"M9 12l2 2 4-4",stroke:"#252525","stroke-width":"2","stroke-linecap":"round"})],-1)),h(" "+l(a(o)("complaints.close_complaint")),1)],8,xt)])):x("",!0)])):(i(),r("button",{key:1,onClick:B=>le(s),class:"p-1.5 rounded-full hover:bg-gray-100 text-[#87898E] hover:text-[#0099B5] transition-colors"},[...t[21]||(t[21]=[e("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none"},[e("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z",stroke:"currentColor","stroke-width":"2"}),e("circle",{cx:"12",cy:"12",r:"3",stroke:"currentColor","stroke-width":"2"})],-1)])],8,mt))])]))),128))])])):(i(),r("div",Ue,[t[16]||(t[16]=e("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",class:"mb-3 opacity-40"},[e("path",{d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2",stroke:"#87898E","stroke-width":"2","stroke-linecap":"round"})],-1)),e("p",He,l(a(o)("complaints.empty")),1)]))]),c.value.last_page>1?(i(),r("div",vt,[e("p",ht,l(a(o)("hr_complaints.pagination_info",{from:(c.value.current_page-1)*c.value.per_page+1,to:Math.min(c.value.current_page*c.value.per_page,c.value.total),total:c.value.total})),1),g(U,{"current-page":c.value.current_page,"onUpdate:currentPage":t[4]||(t[4]=s=>c.value.current_page=s),"page-size":c.value.per_page,total:c.value.total,layout:"prev, pager, next",background:"",onCurrentChange:X},null,8,["current-page","page-size","total"])])):x("",!0)])]),g(T,{modelValue:E.value,"onUpdate:modelValue":t[9]||(t[9]=s=>E.value=s),title:a(o)("hr_complaints.close_modal_title"),width:"560px","show-close":!0,"align-center":"","close-on-click-modal":!1,style:{"border-radius":"16px"}},{footer:w(()=>[e("div",kt,[e("button",{onClick:t[8]||(t[8]=s=>E.value=!1),class:"text-[#E34D5E] font-medium text-[15px]"},l(a(o)("hr_complaints.cancel")),1),e("button",{onClick:oe,disabled:p.value.is_valid===null||!p.value.note.trim()||D.value,class:"bg-[#0099B5] hover:bg-[#008299] disabled:opacity-50 disabled:cursor-not-allowed text-white px-6 py-2 rounded-[10px] font-semibold transition-colors"},l(D.value?a(o)("hr_complaints.saving"):a(o)("hr_complaints.save")),9,Et)])]),default:w(()=>[e("div",ft,[e("p",bt,l(a(o)("hr_complaints.deactivate_question")),1),e("div",yt,[e("button",{onClick:t[5]||(t[5]=s=>p.value.is_valid=!0),class:M(["px-5 py-2 rounded-[10px] border text-[15px] font-medium transition-colors",p.value.is_valid===!0?"bg-[#0099B5] text-white border-[#0099B5]":"bg-white text-[#252525] border-[#
1E5E7EB] hover:border-[#0099B5]"])},l(a(o)("hr_complaints.yes_valid")),3),e("button",{onClick:t[6]||(t[6]=s=>p.value.is_valid=!1),class:M(["px-5 py-2 rounded-[10px] border text-[15px] font-medium transition-colors",p.value.is_valid===!1&&p.value.is_valid!==null?"bg-[#0099B5] text-white border-[#0099B5]":"bg-white text-[#252525] border-[#E5E7EB] hover:border-[#0099B5]"])},l(a(o)("hr_complaints.no_invalid")),3)]),e("p",gt,[h(l(a(o)("hr_complaints.close_note_label"))+" ",1),t[22]||(t[22]=e("span",{class:"text-red-500"},"*",-1))]),be(e("textarea",{"onUpdate:modelValue":t[7]||(t[7]=s=>p.value.note=s),rows:"5",placeholder:a(o)("hr_complaints.close_note_placeholder"),class:"w-full rounded-[12px] border border-[#E5E7EB] p-3 bg-[#F8F8FA] focus:outline-none focus:ring-2 focus:ring-[#0099B5] resize-none text-[15px]"},null,8,wt),[[ye,p.value.note]])])]),_:1},8,["modelValue","title"]),g(T,{modelValue:P.value,"onUpdate:modelValue":t[10]||(t[10]=s=>P.value=s),title:a(o)("hr_complaints.detail_modal_title"),width:"520px","show-close":!0,"align-center":"",style:{"border-radius":"16px"}},{default:w(()=>[v.value?(i(),r("div",Ct,[e("p",Bt,[h(l(a(o)("hr_complaints.moderator_label"))+" ",1),e("span",Ft,l(v.value.moderator?.full_name),1)]),e("p",Mt,[h(l(a(o)("hr_complaints.closed_date_label"))+" ",1),e("span",Vt,l(v.value.closed_at),1)]),e("div",null,[e("p",Dt,l(a(o)("hr_complaints.close_note_view_label")),1),e("p",$t,l(v.value.moderator_note||"â"),1)]),v.value.is_valid!==null?(i(),r("div",Rt,[e("span",{class:M(["inline-flex px-3 py-1 rounded-full text-[13px] font-medium",v.value.is_valid?"bg-green-100 text-green-700":"bg-red-100 text-red-600"])},l(v.value.is_valid?a(o)("hr_complaints.found_valid"):a(o)("hr_complaints.found_invalid")),3)])):x("",!0)])):x("",!0)]),_:1},8,["modelValue","title"]),m.value?(i(),r("div",{key:0,class:"fixed inset-0 z-10",onClick:t[11]||(t[11]=s=>m.value=null)})):x("",!0)],64)}}},Kt=we(zt,[["__scopeId","data-v-a73144ee"]]);export{Kt as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.