import{J as Je,m as mt,P as P$1}from'./chunk-CbGTXeVV.js';import{J as Ji}from'./chunk-DiW2V9uJ.js';import{B}from'./chunk-C7leSDo_.js';import'./chunk-CoFxqtb1.js';import'./chunk-DklgiaH9.js';import'./chunk-Nvvh024_.js';import'./chunk-BcSizZT_.js';import'./chunk-DmY7bGyL.js';import{H as Ht,D as Dt,N as Nt}from'./chunk-BrVO-2dI.js';import'./chunk-DHVyyAtU.js';import'./chunk-nfSA6zwi.js';import{d7 as ck,g,dm as Oi,aQ as Ze,a_ as Pk,aC as x,dd as ag,av as E,ao as D,dG as ze,a9 as Oe,br as lt,fB as Xn,b as Pa,s as sp,v as vV,d as lb,f as Pp,W as WB,a3 as H0}from'./main-DEZ5cZzu.js';import'./chunk-CmWePYi_.js';import'./chunk-CifDxe6s.js';import'./chunk-DZVj2nmI.js';var P=(()=>{class r{authService=g(Ze);userSubscription=g(B);hooks=g(Pk);videoService=g(x);scopedTokensService=g(ag);getVideosObservableFunction=this.getVideosObservable.bind(this);getSyndicationItemsFunction=this.getSyndicationItems.bind(this);defaultSort="-publishedAt";actions=[{routerLink:"/my-library/subscriptions",label:"Manage",iconName:"cog"}];disabled=false;feedToken;getVideosObservable(e,i){let t=E(D({},i.toVideosAPIObject()),{videoPagination:e,skipCount:true});return this.hooks.wrapObsFun(this.userSubscription.getUserSubscriptionVideos.bind(this.userSubscription),t,"common","filter:api.user-subscriptions-videos.videos.list.params","filter:api.user-subscriptions-videos.videos.list.result");}getSyndicationItems(){return this.loadFeedToken().then(()=>{let e=this.authService.getUser();return this.videoService.getVideoSubscriptionFeedUrls(e.account.id,this.feedToken);});}disableForReuse(){this.disabled=true;}enabledForReuse(){this.disabled=false;}loadFeedToken(){if(this.feedToken)return Promise.resolve(this.feedToken);let e=this.authService.userInformationLoaded.pipe(ze(),Oe(()=>this.scopedTokensService.getScopedTokens()),lt(i=>this.feedToken=i.feedToken));return Xn(e);}static ɵfac=function(i){return new(i||r)();};static ɵcmp=Pa({type:r,selectors:[["my-videos-user-subscriptions"]],decls:3,vars:5,consts:()=>{let e;return e="Vid\xE8os de v\xF2stres abonaments",[e,[1,"visually-hidden"],["displayFilters","false","loadUserVideoPreferences","false","groupByDate","true","highlightLives","false",3,"getVideosObservableFunction","getSyndicationItemsFunction","defaultSort","disabled","headerActions"]];},template:function(i,t){i&1&&(sp(0,"h1",1),vV(1,0),lb(),Pp(2,"my-videos-list",2)),i&2&&(WB(2),H0("getVideosObservableFunction",t.getVideosObservableFunction)("getSyndicationItemsFunction",t.getSyndicationItemsFunction)("defaultSort",t.defaultSort)("disabled",t.disabled)("headerActions",t.actions));},dependencies:[Ji],encapsulation:2,changeDetection:1});}return r;})();var oe=[{path:"",providers:[P$1,B,Ht,Dt,Nt],children:[{path:"overview",component:Je,data:{meta:{title:"Discover videos"},reuse:{enabled:true,key:"videos-discover"}}},{path:"most-liked",redirectTo:"browse?scope=federated&sort=-likes"},{path:"trending",redirectTo:()=>"browse?scope=federated&sort=-"+g(Oi).getDefaultTrendingSort()},{path:"recently-added",redirectTo:"browse?scope=federated&sort=-publishedAt"},{path:"local",redirectTo:"browse?scope=local&sort=-publishedAt"},{path:"browse",component:mt,data:{reuse:{enabled:true,key:"videos-list"}}},{path:"subscriptions",canActivate:[ck],component:P,data:{meta:{title:"Subscriptions"},reuse:{enabled:true,key:"subscription-videos-list"}}}]}];/**i18n:c8855ca17fb20171aa9dd43d012e42547cb1f0cfd9c21d4dc05679bbbdf5ccb8*/export{oe as default};//# sourceMappingURL=chunk-aayxEfgj.js.map