import{C as o,He as d,Kg as L,Yc as E,Z as g,ba as p,fg as b,lf as m,mf as h,n as u,re as v,rg as S,s as l}from"./chunk-3MFSOWAK.js";import{i as c,j as f}from"./chunk-ASXIZBWV.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:a80de7963c3a1ee38e5afb7317b8dafa5dd6a0c8b3d465be96b90b317d6167e1*/
//# sourceMappingURL=chunk-J77KRD2I.js.map
