import{$ as p,$e as h,B as s,Mc as g,Wf as b,Y as E,af as m,fe as v,jg as S,kg as L,m as u,r as d,we as l}from"./chunk-X3RCWQ3R.js";import{i as n,j as f}from"./chunk-SR6RTMQI.js";var e=class e{constructor(r,t,a,i){n(this,"authHttp");n(this,"restExtractor");n(this,"markdownService");n(this,"serverService");this.authHttp=r,this.restExtractor=t,this.markdownService=a,this.serverService=i}getAbout(){return this.authHttp.get(e.BASE_CONFIG_URL+"/about").pipe(s(r=>this.restExtractor.handleError(r)))}updateInstanceBanner(r){let t=e.BASE_CONFIG_URL+"/instance-banner/pick";return this.authHttp.post(t,r).pipe(s(a=>this.restExtractor.handleError(a)))}deleteInstanceBanner(){let r=e.BASE_CONFIG_URL+"/instance-banner";return this.authHttp.delete(r).pipe(s(t=>this.restExtractor.handleError(t)))}updateInstanceAvatar(r){let t=e.BASE_CONFIG_URL+"/instance-avatar/pick";return this.authHttp.post(t,r).pipe(s(a=>this.restExtractor.handleError(a)))}deleteInstanceAvatar(){let r=e.BASE_CONFIG_URL+"/instance-avatar";return this.authHttp.delete(r).pipe(s(t=>this.restExtractor.handleError(t)))}contactAdministrator(r,t,a,i){let o={fromEmail:r,fromName:t,subject:a,body:i};return this.authHttp.post(e.BASE_SERVER_URL+"/contact",o).pipe(s(c=>this.restExtractor.handleError(c)))}buildHtml(r){return f(this,null,function*(){let t={terms:"",codeOfConduct:"",moderationInformation:"",administrator:"",creationReason:"",maintenanceLifetime:"",businessModel:"",hardwareInformation:""};for(let a of v(t))t[a]=yield this.markdownService.enhancedMarkdownToHTML({markdown:r.instance[a]});return t})}buildTranslatedLanguages(r){return d([this.serverService.getVideoLanguages(),this.serverService.getServerLocale()]).pipe(u(([t,a])=>r.instance.languages.map(i=>{let o=t.find(c=>c.id===i);return o?l(o.label,a):(h.error(`Cannot find language ${i} in available languages`),"")})))}buildTranslatedCategories(r){return d([this.serverService.getVideoCategories(),this.serverService.getServerLocale()]).pipe(u(([t,a])=>r.instance.categories.map(i=>{let o=t.find(c=>c.id===i);return o?l(o.label,a):(h.error(`Cannot find instance category ${i} in available categories`),"")})))}};n(e,"BASE_CONFIG_URL",m.apiUrl+"/api/v1/config"),n(e,"BASE_SERVER_URL",m.apiUrl+"/api/v1/server"),n(e,"\u0275fac",function(t){return new(t||e)(p(g),p(b),p(S),p(L))}),n(e,"\u0275prov",E({token:e,factory:e.\u0275fac}));var R=e;export{R as a};
/**i18n:3d16453f213eb5db982e7e7dd90631843ac5d3f860726a614777c3e9e3f9b57e*/
//# sourceMappingURL=chunk-R4W3GVRV.js.map
