import{$c as E,$h as x,B as s,Gh as R,Q as m,Qe as f,Xc as d,Y as h,aa as c,ah as S,n as l,uh as v,vg as u,zh as I}from"./chunk-GKQGDBUU.js";import{i as n}from"./chunk-QVFSZZWQ.js";var e=class e{authHttp=c(E);restService=c(I);restExtractor=c(v);serverService=c(R);importVideo(t){let r=e.BASE_VIDEO_IMPORT_URL,i=S(t);return this.authHttp.post(r,i).pipe(s(p=>this.restExtractor.handleError(p)))}listMyVideoImports(t){let{pagination:r,sort:i,search:p,includeCollaborations:b}=t,a=new d;if(a=this.restService.addRestGetParams(a,r,i),b&&(a=a.append("includeCollaborations","true")),p){let o=this.restService.parseQueryStringFilter(p,{videoChannelSyncId:{prefix:"videoChannelSyncId:"},targetUrl:{prefix:"targetUrl:"}});a=this.restService.addObjectParams(a,o)}return this.authHttp.get(x.BASE_USERS_URL+"me/videos/imports",{params:a}).pipe(m(o=>this.extractVideoImports(o)),s(o=>this.restExtractor.handleError(o)))}deleteVideoImport(t){return this.authHttp.delete(e.BASE_VIDEO_IMPORT_URL+t.id).pipe(s(r=>this.restExtractor.handleError(r)))}cancelVideoImport(t){return this.authHttp.post(e.BASE_VIDEO_IMPORT_URL+t.id+"/cancel",{}).pipe(s(r=>this.restExtractor.handleError(r)))}extractVideoImports(t){return this.serverService.getServerLocale().pipe(l(r=>(t.data.forEach(i=>i.state.label=f(i.state.label,r)),t)))}};n(e,"BASE_VIDEO_IMPORT_URL",u.apiUrl+"/api/v1/videos/imports/"),n(e,"\u0275fac",function(r){return new(r||e)}),n(e,"\u0275prov",h({token:e,factory:e.\u0275fac}));var U=e;export{U as a};
/**i18n:42345378061bf3c93df67acfa161b751a7b03cc91f3ede7c1f1cdf2bba62fe26*/
//# sourceMappingURL=chunk-4BZTBLNW.js.map
