import{b as o,a8 as N,M as O,P,_ as D,aA as $,af as x}from"./app-QjDgb7aF.js";import{M as T}from"./MkPagination-DzUgufpZ.js";import{M as H}from"./MkKeyValue-BeApKcpm.js";import{b as B,a as f,E as m,A as E,j as _,p as R,q as t,l as F,g as h,i as a,k as l,J as d,D as s,u as e,H as C,I as w,F as L,G as j,f as I}from"./vue-Cm77DuTi.js";import"./charts-3gEHPHRq.js";import"./media-DuCIZ-3n.js";const q={class:"bcekxzvu _gap _panel"},z={class:"target"},G={class:"names"},J={class:"detail"},K={key:0},W={class:"action"},X=B({__name:"MkAbuseReport",props:{report:{}},emits:["resolved"],setup(r,{emit:k}){const u=r,v=k,c=f(u.report.forwarded);function y(){P("admin/resolve-abuse-user-report",{forward:c.value,reportId:u.report.id}).then(()=>{v("resolved",u.report.id)})}return(S,p)=>{const V=m("MkAvatar"),g=m("MkUserName"),n=m("MkAcct"),A=m("MkA"),b=m("MkTime"),U=m("Mfm"),i=E("user-preview");return _(),R("div",q,[t("div",z,[F((_(),h(A,{class:"info",to:`/user-info/${r.report.targetUserId}`},{default:a(()=>[l(V,{class:"avatar",user:r.report.targetUser,"show-indicator":!0,"disable-link":!0},null,8,["user"]),t("div",G,[l(g,{class:"name",user:r.report.targetUser},null,8,["user"]),l(n,{class:"acct",user:r.report.targetUser,style:{display:"block"}},null,8,["user"])])]),_:1},8,["to"])),[[i,r.report.targetUserId]]),l(H,{class:"_formBlock"},{key:a(()=>[d(s(e(o).ts.registeredDate),1)]),value:a(()=>[d(s(new Date(r.report.targetUser.createdAt).toLocaleString())+" (",1),l(b,{time:r.report.targetUser.createdAt},null,8,["time"]),p[1]||(p[1]=d(")",-1))]),_:1})]),t("div",J,[t("div",null,[l(U,{text:r.report.comment},null,8,["text"])]),p[2]||(p[2]=t("hr",null,null,-1)),t("div",null,[d(s(e(o).ts.reporter)+": ",1),l(n,{user:r.report.reporter},null,8,["user"])]),r.report.assignee?(_(),R("div",K,[d(s(e(o).ts.moderator)+": ",1),l(n,{user:r.report.assignee},null,8,["user"])])):C("",!0),t("div",null,[l(b,{time:r.report.createdAt},null,8,["time"])]),t("div",W,[l(N,{modelValue:c.value,"onUpdate:modelValue":p[0]||(p[0]=M=>c.value=M),disabled:r.report.targetUser.host==null||r.report.resolved},{caption:a(()=>[d(s(e(o).ts.forwardReportIsAnonymous),1)]),default:a(()=>[d(s(e(o).ts.forwardReport)+" ",1)]),_:1},8,["modelValue","disabled"]),r.report.resolved?C("",!0):(_(),h(O,{key:0,primary:"",onClick:y},{default:a(()=>[d(s(e(o).ts.abuseMarkAsResolved),1)]),_:1}))])])])}}}),Q=D(X,[["__scopeId","data-v-3c1d1ad1"]]),Y={class:"lcixvhis"},Z={class:"_section reports"},ee={class:"_content"},te={class:"inputs",style:{display:"flex"}},oe={value:"all"},se={value:"unresolved"},re={value:"resolved"},ae={value:"combined"},le={value:"local"},ne={value:"remote"},ie={value:"combined"},de={value:"local"},ue={value:"remote"},ce=B({__name:"abuses",setup(r){let k=f(),u=f("unresolved"),v=f("combined"),c=f("combined");const y={endpoint:"admin/abuse-user-reports",limit:10,params:I(()=>({state:u.value,reporterOrigin:v.value,targetUserOrigin:c.value}))};function S(g){k.value.removeItem(n=>n.id===g)}const p=I(()=>[]),V=I(()=>[]);return $({title:o.ts.abuseReports,icon:"ph-warning-circle ph-bold ph-lg"}),(g,n)=>{const A=m("MkPageHeader"),b=m("MkSpacer"),U=m("MkStickyContainer");return _(),h(U,null,{header:a(()=>[l(A,{actions:p.value,tabs:V.value,"display-back-button":!0},null,8,["actions","tabs"])]),default:a(()=>[l(b,{"content-max":900},{default:a(()=>[t("div",Y,[t("div",Z,[t("div",ee,[t("div",te,[l(x,{modelValue:e(u),"onUpdate:modelValue":n[0]||(n[0]=i=>w(u)?u.value=i:u=i),style:{margin:"0",flex:"1"}},{label:a(()=>[d(s(e(o).ts.state),1)]),default:a(()=>[t("option",oe,s(e(o).ts.all),1),t("option",se,s(e(o).ts.unresolved),1),t("option",re,s(e(o).ts.resolved),1)]),_:1},8,["modelValue"]),l(x,{modelValue:e(c),"onUpdate:modelValue":n[1]||(n[1]=i=>w(c)?c.value=i:c=i),style:{margin:"0",flex:"1"}},{label:a(()=>[d(s(e(o).ts.reporteeOrigin),1)]),default:a(()=>[t("option",ae,s(e(o).ts.all),1),t("option",le,s(e(o).ts.local),1),t("option",ne,s(e(o).ts.remote),1)]),_:1},8,["modelValue"]),l(x,{modelValue:e(v),"onUpdate:modelValue":n[2]||(n[2]=i=>w(v)?v.value=i:v=i),style:{margin:"0",flex:"1"}},{label:a(()=>[d(s(e(o).ts.reporterOrigin),1)]),default:a(()=>[t("option",ie,s(e(o).ts.all),1),t("option",de,s(e(o).ts.local),1),t("option",ue,s(e(o).ts.remote),1)]),_:1},8,["modelValue"])]),l(T,{ref_key:"reports",ref:k,pagination:y,style:{"margin-top":"var(--margin)"}},{default:a(({items:i})=>[(_(!0),R(L,null,j(i,M=>(_(),h(Q,{key:M.id,report:M,onResolved:S},null,8,["report"]))),128))]),_:1},512)])])])]),_:1})]),_:1})}}}),ge=D(ce,[["__scopeId","data-v-bf194efb"]]);export{ge as default};
//# sourceMappingURL=abuses-DEomOvZb.js.map
