import{c as d}from"./chunk-KHRLI7AH.js";import{a as R}from"./chunk-7MB5OJWB.js";import{$ as a,B as s,Ic as m,Mc as u,R as H,Wf as f,Y as h,_f as S,af as l}from"./chunk-X3RCWQ3R.js";import{i as e}from"./chunk-SR6RTMQI.js";var p=class p{constructor(r,t,i,o){e(this,"authHttp");e(this,"restExtractor");e(this,"restService");e(this,"videoService");this.authHttp=r,this.restExtractor=t,this.restService=i,this.videoService=o}list(r,t){let i=this.restService.componentToRestPagination(r),o=new m;return o=this.restService.addRestGetParams(o,i),t&&(o=o.append("search",t)),this.authHttp.get(p.BASE_USER_VIDEOS_HISTORY_URL,{params:o}).pipe(H(n=>this.videoService.extractVideos(n)),s(n=>this.restExtractor.handleError(n)))}deleteElement(r){return this.authHttp.delete(p.BASE_USER_VIDEOS_HISTORY_URL+"/"+r.id).pipe(s(t=>this.restExtractor.handleError(t)))}clearAll(){return this.authHttp.post(p.BASE_USER_VIDEOS_HISTORY_URL+"/remove",{}).pipe(s(r=>this.restExtractor.handleError(r)))}};e(p,"BASE_USER_VIDEOS_HISTORY_URL",l.apiUrl+"/api/v1/users/me/history/videos"),e(p,"\u0275fac",function(t){return new(t||p)(a(u),a(f),a(S),a(d))}),e(p,"\u0275prov",h({token:p,factory:p.\u0275fac}));var v=p;var c=class c{constructor(r,t,i){e(this,"authHttp");e(this,"restService");e(this,"restExtractor");this.authHttp=r,this.restService=t,this.restExtractor=i}changeOwnership(r,t){let i=c.BASE_VIDEO_CHANGE_OWNERSHIP_URL+r+"/give-ownership",o={username:t};return this.authHttp.post(i,o).pipe(s(n=>this.restExtractor.handleError(n)))}getOwnershipChanges(r,t){let i=c.BASE_VIDEO_CHANGE_OWNERSHIP_URL+"ownership",o=new m;return o=this.restService.addRestGetParams(o,r,t),this.authHttp.get(i,{params:o}).pipe(s(n=>this.restExtractor.handleError(n)))}acceptOwnership(r,t){let i=c.BASE_VIDEO_CHANGE_OWNERSHIP_URL+"ownership/"+r+"/accept";return this.authHttp.post(i,t).pipe(s(o=>this.restExtractor.handleError(o)))}refuseOwnership(r){let t=c.BASE_VIDEO_CHANGE_OWNERSHIP_URL+"ownership/"+r+"/refuse";return this.authHttp.post(t,{}).pipe(s(i=>this.restExtractor.handleError(i)))}};e(c,"BASE_VIDEO_CHANGE_OWNERSHIP_URL",l.apiUrl+"/api/v1/videos/"),e(c,"\u0275fac",function(t){return new(t||c)(a(u),a(S),a(f))}),e(c,"\u0275prov",h({token:c,factory:c.\u0275fac}));var O=c;var E=class E{constructor(r,t,i){e(this,"authHttp");e(this,"restExtractor");e(this,"restService");this.authHttp=r,this.restExtractor=t,this.restService=i}listAccountVideoChannelsSyncs(r){let{pagination:t,sort:i,account:o}=r,n=new m;n=this.restService.addRestGetParams(n,t,i);let U=R.BASE_ACCOUNT_URL+o.nameWithHost+"/video-channel-syncs";return this.authHttp.get(U,{params:n}).pipe(s(N=>this.restExtractor.handleError(N)))}createSync(r){return this.authHttp.post(E.BASE_VIDEO_CHANNEL_URL,r).pipe(s(t=>this.restExtractor.handleError(t)))}deleteSync(r){let t=`${E.BASE_VIDEO_CHANNEL_URL}/${r}`;return this.authHttp.delete(t).pipe(s(i=>this.restExtractor.handleError(i)))}};e(E,"BASE_VIDEO_CHANNEL_URL",l.apiUrl+"/api/v1/video-channel-syncs"),e(E,"\u0275fac",function(t){return new(t||E)(a(u),a(f),a(S))}),e(E,"\u0275prov",h({token:E,factory:E.\u0275fac,providedIn:"root"}));var _=E;export{v as a,O as b,_ as c};
/**i18n:3d16453f213eb5db982e7e7dd90631843ac5d3f860726a614777c3e9e3f9b57e*/
//# sourceMappingURL=chunk-3V5WYYM7.js.map
