import{B as o,Ge as d,Ng as L,Wc as E,Y as g,aa as p,jg as b,kf as m,lf as h,n as u,qe as v,r as l,wg as S}from"./chunk-XBTZE2EC.js";import{i as c,j as f}from"./chunk-WHYNGVB3.js";var e=class e{authHttp=p(E);restExtractor=p(b);markdownService=p(L);serverService=p(S);getAbout(){return this.authHttp.get(e.BASE_CONFIG_URL+"/about").pipe(o(r=>this.restExtractor.handleError(r)))}updateInstanceBanner(r){let t=e.BASE_CONFIG_URL+"/instance-banner/pick";return this.authHttp.post(t,r).pipe(o(a=>this.restExtractor.handleError(a)))}deleteInstanceBanner(){let r=e.BASE_CONFIG_URL+"/instance-banner";return this.authHttp.delete(r).pipe(o(t=>this.restExtractor.handleError(t)))}updateInstanceAvatar(r){let t=e.BASE_CONFIG_URL+"/instance-avatar/pick";return this.authHttp.post(t,r).pipe(o(a=>this.restExtractor.handleError(a)))}deleteInstanceAvatar(){let r=e.BASE_CONFIG_URL+"/instance-avatar";return this.authHttp.delete(r).pipe(o(t=>this.restExtractor.handleError(t)))}contactAdministrator(r,t,a,n){let i={fromEmail:r,fromName:t,subject:a,body:n};return this.authHttp.post(e.BASE_SERVER_URL+"/contact",i).pipe(o(s=>this.restExtractor.handleError(s)))}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 l([this.serverService.getVideoLanguages(),this.serverService.getServerLocale()]).pipe(u(([t,a])=>r.instance.languages.map(n=>{let i=t.find(s=>s.id===n);return i?d(i.label,a):(m.error(`Cannot find language ${n} in available languages`),"")})))}buildTranslatedCategories(r){return l([this.serverService.getVideoCategories(),this.serverService.getServerLocale()]).pipe(u(([t,a])=>r.instance.categories.map(n=>{let i=t.find(s=>s.id===n);return i?d(i.label,a):(m.error(`Cannot find instance category ${n} in available categories`),"")})))}};c(e,"BASE_CONFIG_URL",h.apiUrl+"/api/v1/config"),c(e,"BASE_SERVER_URL",h.apiUrl+"/api/v1/server"),c(e,"\u0275fac",function(t){return new(t||e)}),c(e,"\u0275prov",g({token:e,factory:e.\u0275fac}));var R=e;export{R as a};
/**i18n:56bde403ffba090cdb11aaac0f86ffb9ae7c2bab95df4b44d5dba510264fcf4f*/
//# sourceMappingURL=chunk-FBQIJQTS.js.map
