import{o as F}from"./chunk-C6uGsfWa.js";import{Bc as zn,D as CF,H as Dm,Hr as V,Hs as se,Oi as Zt,Vo as lc,Wa as g,Wt as Jn,ci as Xc,fr as S,gt as G,hn as Mn,ro as he}from"./chunk-B_pj7Jpm.js";var E=class o{authHttp=g(zn);restExtractor=g(Jn);markdownService=g(Xc);serverService=g(Zt);static BASE_CONFIG_URL=se.apiUrl+`/api/v1/config`;static BASE_SERVER_URL=se.apiUrl+`/api/v1/server`;aboutCache$=null;getAboutWithCache(){return this.aboutCache$||(this.aboutCache$=this.authHttp.get(o.BASE_CONFIG_URL+`/about`).pipe(he(t=>this.restExtractor.handleError(t)),Mn(1)),setTimeout(()=>{this.aboutCache$=null},1e3)),this.aboutCache$}contactAdministrator(t,e,r,a){let i={fromEmail:t,fromName:e,subject:r,body:a};return this.authHttp.post(o.BASE_SERVER_URL+`/contact`,i).pipe(he(n=>this.restExtractor.handleError(n)))}buildHtml(t){return F(this,null,function*(){let e={terms:``,codeOfConduct:``,moderationInformation:``,administrator:``,creationReason:``,maintenanceLifetime:``,businessModel:``,hardwareInformation:``};for(let r of lc(e))e[r]=yield this.markdownService.enhancedMarkdownToHTML({markdown:t.instance[r]});return e})}buildTranslatedLanguages(t){return CF([this.serverService.getVideoLanguages(),this.serverService.getServerLocale()]).pipe(G(([e,r])=>t.instance.languages.map(a=>{let i=e.find(n=>n.id===a);return i?Dm(i.label,r):(V.error(`Cannot find language ${a} in available languages`),``)})))}buildTranslatedCategories(t){return CF([this.serverService.getVideoCategories(),this.serverService.getServerLocale()]).pipe(G(([e,r])=>t.instance.categories.map(a=>{let i=e.find(n=>n.id===a);return i?Dm(i.label,r):(V.error(`Cannot find instance category ${a} in available categories`),``)})))}static ɵfac=function(e){return new(e||o)};static ɵprov=S({token:o,factory:o.ɵfac})};export{E as t};
//# debugId=437fc4f9-2949-58b1-bfdc-80925480778e
//# sourceMappingURL=chunk-CdfINgvq.js.map