import{B as d,Eh as E,Je as h,Qh as S,Y as v,Ze as l,aa as c,fi as y,hd as b,n as m,of as u,pf as f,r as p}from"./chunk-THW6YIIG.js";import{i as s,l as g}from"./chunk-PTJGHD3V.js";var e=class e{authHttp=c(b);restExtractor=c(E);markdownService=c(y);serverService=c(S);getAbout(){return this.authHttp.get(e.BASE_CONFIG_URL+"/about").pipe(d(t=>this.restExtractor.handleError(t)))}contactAdministrator(t,r,a,o){let i={fromEmail:t,fromName:r,subject:a,body:o};return this.authHttp.post(e.BASE_SERVER_URL+"/contact",i).pipe(d(n=>this.restExtractor.handleError(n)))}buildHtml(t){return g(this,null,function*(){let r={terms:"",codeOfConduct:"",moderationInformation:"",administrator:"",creationReason:"",maintenanceLifetime:"",businessModel:"",hardwareInformation:""};for(let a of h(r))r[a]=yield this.markdownService.enhancedMarkdownToHTML({markdown:t.instance[a]});return r})}buildTranslatedLanguages(t){return p([this.serverService.getVideoLanguages(),this.serverService.getServerLocale()]).pipe(m(([r,a])=>t.instance.languages.map(o=>{let i=r.find(n=>n.id===o);return i?l(i.label,a):(u.error(`Cannot find language ${o} in available languages`),"")})))}buildTranslatedCategories(t){return p([this.serverService.getVideoCategories(),this.serverService.getServerLocale()]).pipe(m(([r,a])=>t.instance.categories.map(o=>{let i=r.find(n=>n.id===o);return i?l(i.label,a):(u.error(`Cannot find instance category ${o} in available categories`),"")})))}};s(e,"BASE_CONFIG_URL",f.apiUrl+"/api/v1/config"),s(e,"BASE_SERVER_URL",f.apiUrl+"/api/v1/server"),s(e,"\u0275fac",function(r){return new(r||e)}),s(e,"\u0275prov",v({token:e,factory:e.\u0275fac}));var L=e;export{L as a};
/**i18n:90f1dd82a779b57eddc91ef20913c88eecaa9632bba8ac04ad50f47ae2b82df7*/
//# sourceMappingURL=chunk-A4LUEHNC.js.map
