import{Af as P,C as s,D as c,De as f,E as h,Z as A,ba as u,hh as L,j as p,mh as I,nd as w,qd as E}from"./chunk-RKSLYOIW.js";import{i as d}from"./chunk-QQ7SJNXU.js";var l=class l{authHttp=u(E);restService=u(I);restExtractor=u(L);listSubscriptions(r){let{pagination:o,sort:t,search:a,state:i,actorType:n}=r,e=new w();return e=this.restService.addRestGetParams(e,o,t),a&&(e=e.append("search",a)),i&&(e=e.append("state",i)),n&&(e=e.append("actorType",n)),this.authHttp.get(l.BASE_APPLICATION_URL+"/following",{params:e}).pipe(s(m=>this.restExtractor.handleError(m)));}listFollowers(r){let{pagination:o,sort:t,search:a,state:i,actorType:n}=r,e=new w();return e=this.restService.addRestGetParams(e,o,t),a&&(e=e.append("search",a)),i&&(e=e.append("state",i)),n&&(e=e.append("actorType",n)),this.authHttp.get(l.BASE_APPLICATION_URL+"/followers",{params:e}).pipe(s(m=>this.restExtractor.handleError(m)));}follow(r){let o={handles:r.filter(t=>t.includes("@")),hosts:r.filter(t=>!t.includes("@"))};return this.authHttp.post(l.BASE_APPLICATION_URL+"/following",o).pipe(s(t=>this.restExtractor.handleError(t)));}unfollow(r){let o=f(r);return p(o).pipe(h(t=>{let a=t.following.name+"@"+t.following.host;return this.authHttp.delete(l.BASE_APPLICATION_URL+"/following/"+a);}),c(),s(t=>this.restExtractor.handleError(t)));}acceptFollower(r){let o=f(r);return p(o).pipe(h(t=>{let a=t.follower.name+"@"+t.follower.host;return this.authHttp.post(`${l.BASE_APPLICATION_URL}/followers/${a}/accept`,{});}),c(),s(t=>this.restExtractor.handleError(t)));}rejectFollower(r){let o=f(r);return p(o).pipe(h(t=>{let a=t.follower.name+"@"+t.follower.host;return this.authHttp.post(`${l.BASE_APPLICATION_URL}/followers/${a}/reject`,{});}),c(),s(t=>this.restExtractor.handleError(t)));}removeFollower(r){let o=f(r);return p(o).pipe(h(t=>{let a=t.follower.name+"@"+t.follower.host;return this.authHttp.delete(`${l.BASE_APPLICATION_URL}/followers/${a}`);}),c(),s(t=>this.restExtractor.handleError(t)));}buildFollowsListFilters(){return[{type:"options",key:"state",title:"Follow state",options:[{value:"all",label:"All follows"},{value:"accepted",label:"L\u01B0\u1EE3t theo d\xF5i \u0111\xE3 ch\u1EA5p nh\u1EADn"},{value:"rejected",label:"L\u01B0\u1EE3t theo d\xF5i \u0111\xE3 t\u1EEB ch\u1ED1i"},{value:"pending",label:"L\u01B0\u1EE3t theo d\xF5i \u0111ang ch\u1EDD"}]}];}};d(l,"BASE_APPLICATION_URL",P.apiUrl+"/api/v1/server"),d(l,"\u0275fac",function(o){return new(o||l)();}),d(l,"\u0275prov",A({token:l,factory:l.ɵfac}));var R=l;export{R as a};/**i18n:5a85df092a135682c90bae008e37ec28160e04e5f445e29af2927333ba91ffa1*///# sourceMappingURL=chunk-RCMVAG7F.js.map