import{$e as f,$f as v,B as o,Kh as I,Ph as S,Q as l,Xh as R,Y as h,aa as p,fd as m,id as E,n as d,qi as x,sf as u}from"./chunk-4SQIIPGX.js";import{i as n}from"./chunk-PVXKA76F.js";var e=class e{authHttp=p(E);restService=p(S);restExtractor=p(I);serverService=p(R);importVideo(t){let r=e.BASE_VIDEO_IMPORT_URL,a=v(t);return this.authHttp.post(r,a).pipe(o(c=>this.restExtractor.handleError(c)))}listMyVideoImports(t){let{pagination:r,sort:a,search:c,includeCollaborations:U}=t,i=new m;if(i=this.restService.addRestGetParams(i,r,a),U&&(i=i.append("includeCollaborations","true")),c){let s=this.restService.parseQueryStringFilter(c,{id:{prefix:"id:"},videoId:{prefix:"videoId:"},videoChannelSyncId:{prefix:"videoChannelSyncId:"},targetUrl:{prefix:"targetUrl:"}});i=this.restService.addObjectParams(i,s)}return this.authHttp.get(x.BASE_USERS_URL+"me/videos/imports",{params:i}).pipe(l(s=>this.extractVideoImports(s)),o(s=>this.restExtractor.handleError(s)))}deleteVideoImport(t){return this.authHttp.delete(e.BASE_VIDEO_IMPORT_URL+t.id).pipe(o(r=>this.restExtractor.handleError(r)))}cancelVideoImport(t){return this.authHttp.post(e.BASE_VIDEO_IMPORT_URL+t.id+"/cancel",{}).pipe(o(r=>this.restExtractor.handleError(r)))}retryVideoImport(t){return this.authHttp.post(e.BASE_VIDEO_IMPORT_URL+t.id+"/retry",{}).pipe(o(r=>this.restExtractor.handleError(r)))}extractVideoImports(t){return this.serverService.getServerLocale().pipe(d(r=>(t.data.forEach(a=>a.state.label=f(a.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 O=e;export{O as a};
/**i18n:c36872b108225e22fdb1f8f6f623d1b8958602fe2a49f49507ac6a06e578d8cc*/
//# sourceMappingURL=chunk-MTAKPOSO.js.map
