import{C as o,Fe as d,Yc as E,Z as g,ba as p,dg as b,if as m,jf as h,n as u,qe as v,s as l,ug as S,vg as L}from"./chunk-OX24XL2F.js";import{i as c,j as f}from"./chunk-FQ4ILEWG.js";var e=class e{authHttp=p(E);restExtractor=p(b);markdownService=p(S);serverService=p(L);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:93ef1b86561141301263c1f349fa8abb749523958c3a6dfaf46ed36d22b0a506*/
//# sourceMappingURL=chunk-QDE3Z3JM.js.map
