1import{a as At}from"./chunk-EYZ45VU5.js";import{a as Tt,b as Nt,c as Dt}from"./chunk-3SZSFBQZ.js";import"./chunk-WH7HCV7Y.js";import{a as pt,b as mt,c as gt,d as St}from"./chunk-SXBVLCJF.js";import{a as st,b as dt,k as ut,l as Et}from"./chunk-NKAZMGCL.js";import{a as ue}from"./chunk-Q3D5PUAM.js";import{a as at}from"./chunk-N57YLHBF.js";import"./chunk-Y7Q577DU.js";import{a as Ft}from"./chunk-CLSEWCAF.js";import{a as Ct}from"./chunk-GZPJHEDD.js";import{a as ct}from"./chunk-2XSXSKOZ.js";import{a as _t}from"./chunk-LE3BFIWM.js";import"./chunk-3IJB6NNK.js";import{a as nn}from"./chunk-TLSMBXOV.js";import{a as lt}from"./chunk-PCNKN7TU.js";import"./chunk-7WRF56BE.js";import"./chunk-J3MTDSU3.js";import{a as rt}from"./chunk-5G7CLTD4.js";import"./chunk-SGCHCWLM.js";import{a as en}from"./chunk-76SWT53P.js";import"./chunk-ATXMW3M2.js";import{h as tt}from"./chunk-KYFYXE3K.js";import"./chunk-XSS37KCJ.js";import"./chunk-BJVL6ZJ5.js";import{b as Ke}from"./chunk-MBQWFBKS.js";import{b as Zn}from"./chunk-4GSKMGEL.js";import{a as Ze}from"./chunk-XU6VXSM7.js";import{a as fe}from"./chunk-WYO57RHC.js";import{a as et}from"./chunk-IYEWOREX.js";import{a as Je,b as nt}from"./chunk-DEGXQ3R2.js";import{b as Jn,d as H}from"./chunk-5TE7477A.js";import{c as Oe}from"./chunk-VQCVCUXF.js";import"./chunk-PR244PNT.js";import{b as ot}from"./chunk-MS2CS6MN.js";import{a as it}from"./chunk-KLZQNCJY.js";import{E as j,F as Fe,c as vn,g as he,h as Pn,o as Xe,p as $n,w as yn,x as Vn}from"./chunk-7JTNILXC.js";import{G as Un,H as Xn,n as wn,p as Hn,q as kn,r as Bn}from"./chunk-CUOYDGDO.js";import{a as W}from"./chunk-TTJW756Y.js";import{Aa as Tn,Af as qe,Bb as T,C as ve,Cb as N,Ch as Wn,Da as _,Db as E,Dc as ye,Eb as g,Ec as de,Ef as sn,Fb as S,Fc as Ve,Fe as Gn,Ga as rn,Gb as K,Gd as Be,Ge as xn,Hb as R,Hc as On,Hd as Rn,Ih as Qn,Jb as s,Kd as ce,L as pn,Lc as fn,Ld as Ae,Ma as Nn,Mc as Mn,Na as $,Oh as Qe,Pa as Dn,Qb as An,Qd as Ue,R as X,Rb as be,Sb as Ne,T as me,Tb as ln,Tg as w,Ua as se,Ug as zn,Vb as hn,Vg as Kn,Wc as ke,Yb as V,Yd as bn,Z as mn,Zb as q,Zg as xt,_b as ge,_c as Ln,ag as dn,ba as u,cc as Ye,d as Se,dc as Ge,ec as xe,fd as De,ga as Y,gb as C,ha as G,hb as p,jb as Pe,jh as U,k as Te,kb as Z,ke as Yn,kh as je,l as Re,lb as J,lc as In,le as ze,lh as qn,mb as F,mc as I,mh as We,nb as l,o as an,ob as r,pb as c,ph as Ie,ra as gn,s as Cn,sh as cn,tb as D,tc as we,ua as Sn,ub as A,uc as He,vb as _n,vh as jn,xc as $e,zb as z}from"./chunk-NY4TI4KT.js";import{a as le,b as on,g as Gt,i as h,j as pe}from"./chunk-IQVXR75E.js";var x=(()=>{let i=class i{formReactiveService=u(Ke);error="";videoChannelEdit;mode;formErrors=[];saveHook;storeChanges=new Se();setStore(t){this.videoChannelEdit=t,this.storeChanges.next();}getStore(){return this.videoChannelEdit;}getStoreChangesObs(){return this.storeChanges.asObservable();}getMode(){return this.mode;}setMode(t){this.mode=t;}setError(t){this.error=t;}resetError(){this.setError("");}getError(){return this.error;}setFormError(t,o,a){let d=this.formReactiveService.grabAllErrors(a);this.formErrors=this.formErrors.filter(m=>m.page!==t),d.length!==0&&this.formErrors.push({page:t,path:o,errors:d});}getFormErrors(){return this.formErrors;}hasFormErrors(){return this.formErrors.some(({errors:t})=>t.length!==0);}registerSaveHook(t){this.saveHook=t;}unregisterSaveHook(){this.saveHook=void 0;}runSaveHook(){return this.saveHook?this.saveHook():Promise.resolve();}};h(i,"\u0275fac",function(o){return new(o||i)();}),h(i,"\u0275prov",mn({token:i,factory:i.ɵfac}));let e=i;return e;})();function Ht(e,i){e&1&&c(0,"my-collaborator-state",21);}function kt(e,i){e&1&&c(0,"my-collaborator-state",22);}function Bt(e,i){if(e&1&&C(0,Ht,1,0,"my-collaborator-state",21)(1,kt,1,0,"my-collaborator-state",22),e&2){let n=s(3);p(n.user.isOwnerOfChannel(n.videoChannelEdit().apiInfo)?0:n.user.isEditorOfChannel(n.videoChannelEdit().apiInfo)?1:-1);}}function Ut(e,i){if(e&1&&C(0,Bt,2,1),e&2){let n=s(2);p(n.user.isCollaboratingToChannels()?0:-1);}}function Xt(e,i){e&1&&c(0,"my-collaborator-state",23);}function zt(e,i){e&1&&c(0,"my-collaborator-state",24);}function Kt(e,i){if(e&1&&C(0,Xt,1,0,"my-collaborator-state",23)(1,zt,1,0,"my-collaborator-state",24),e&2){let n=s().action;p(n.data.editor?0:n.data.owner?1:-1);}}function qt(e,i){if(e&1&&C(0,Kt,2,1),e&2){let n=i.action;p(n.data.collaborate?0:-1);}}function jt(e,i){if(e&1&&(l(0,"h2")(1,"my-action-dropdown",20),se(2,Ut,1,1,"ng-template",null,0,$e)(4,qt,1,1,"ng-template",null,1,$e),r()()),e&2){let n,t=s();_(),F("label",(n=t.videoChannelEdit())==null?null:n.channel.displayName)("actions",t.switchChannelActions);}}
1function Wt(e,i){e&1&&(l(0,"h2"),E(1,4),r());}function Qt(e,i){if(e&1&&(l(0,"my-button",15)(1,"span",25),E(2,5),r()()),e&2){let n=s();F("href",n.getChannelPublicUrl());}}function Zt(e,i){if(e&1&&(l(0,"my-alert",17),V(1),r()),e&2){let n=s();_(),ge(" ",n.getError()," ");}}function Jt(e,i){if(e&1&&(l(0,"li"),V(1),r()),e&2){let n=i.$implicit;_(),q(n);}}function ei(e,i){if(e&1&&(l(0,"div",19)(1,"a",26),E(2,7),r(),l(3,"ul",27),Z(4,Jt,2,1,"li",null,Pe),r()()),e&2){let n=i.$implicit;_(),F("routerLink",n.path),_(),g(n.page),S(2),_(2),J(n.errors);}}function ni(e,i){if(e&1&&(l(0,"my-alert",18)(1,"div"),E(2,6),r(),Z(3,ei,6,2,"div",19,Pe),r()),e&2){let n=s();_(3),J(n.getAllFormErrors());}}var tn=(()=>{let i=class i{authService=u(U);horizontalMenuService=u(rt);videoChannelEdit=de.required();saveFn=de.required();editControllerService=u(x);mode;menuConfig;displayFormErrorsMsg=!1;switchChannelActions=[];isSaving=!1;get user(){return this.authService.getUser();}ngOnInit(){this.mode=this.editControllerService.getMode(),this.menuConfig={title:this.mode==="create"?"Create channel":"Manage my channel",entries:[{type:"link",icon:"channel",label:"General",routerLink:"general"},{type:"link",icon:"users",label:"Editors",routerLink:"editors",isDisplayed:()=>this.mode==="update"},{type:"separator"},{type:"link",icon:"calendar",label:"Activity",routerLink:"activities",isDisplayed:()=>this.mode==="update"}]},this.buildSwitchChannelActions(),this.editControllerService.setStore(this.videoChannelEdit()),this.horizontalMenuService.setMenuHidden(!0);}ngOnDestroy(){this.horizontalMenuService.setMenuHidden(!1);}buildSwitchChannelActions(){let t=this.authService.getUser(),o=(d,{editor:m,owner:v,collaborate:L})=>({label:d.displayName,linkBuilder:()=>{let k=this.videoChannelEdit().channel.name,y=window.location.pathname.replace(`/my-library/video-channels/manage/${k}/`,"");return["/my-library/video-channels/manage",d.name,y];},actorAvatar:{actor:d,type:"channel"},data:{collaborate:L,editor:m,owner:v}}),a=t.isCollaboratingToChannels();this.switchChannelActions=[...t.videoChannels.map(d=>o(d,{editor:!1,owner:!0,collaborate:a})),...t.videoChannelCollaborations.map(d=>o(d,{editor:!0,owner:!1,collaborate:a}))];}getError(){return this.editControllerService.getError();}getAllFormErrors(){return this.editControllerService.getFormErrors();}getChannelPublicUrl(){return"/c/"+this.videoChannelEdit().channel.name;}cancelLink(){return"/my-library/video-channels";}canUpdate(){return this.videoChannelEdit().hasChanges()&&!this.editControllerService.hasFormErrors();}hasFormErrors(){return this.editControllerService.hasFormErrors();}onSaveClick(){return pe(this,null,function*(){if(this.displayFormErrorsMsg=!1,yield this.editControllerService.runSaveHook(),this.hasFormErrors()){this.displayFormErrorsMsg=!0;return;}if(!this.isSaving){this.isSaving=!0;try{yield this.saveFn()();}finally{this.isSaving=!1;}}});}};h(i,"\u0275fac",function(o){return new(o||i)();}),h(i,"\u0275cmp",$({type:i,selectors:[["my-video-channel-edit"]],inputs:{videoChannelEdit:[1,"videoChannelEdit"],saveFn:[1,"saveFn"]},decls:18,vars:6,consts:()=>{let t;t="Cancel";let o;o=" Save ";let a;a="Create a new channel";let d;d="Go to the public page";let m;m="There are errors in your channel settings.";let v;return v=""+"\uFFFD0\uFFFD"+" page",[["labelExtra",""],["dropdownItemExtra",""],t,o,a,d,m,v,[1,"d-flex"],[3,"config"],[1,"w-100","min-width-0"],[1,"actions-container"],[1,"actions","header-block"],["icon","arrow-left","theme","secondary",1,"cancel-button",3,"ptRouterLink"],[1,"go-public-page-save"],["icon","external-link","theme","secondary",1,"go-public-page",3,"href"],["theme","primary","icon","circle-tick","form","channel-manage-form",1,"save-button",3,"click","disabled"],["type","danger",1,"d-block","mt-2"],["type","warning",1,"d-block","mt-2"],[1,"mt-3"],["container","body","buttonStyled","false","buttonIcon","chevron-down",3,"label","actions"],["type","owner",1,"d-inline-flex"],["type","accepted",1,"d-inline-flex"],["small","true","type","accepted",1,"d-inline-flex","ms-2"],["small","true","type","owner",1,"d-inline-flex","ms-2"],[1,"go-public-page-label"],[1,"alert-link",3,"routerLink"],[1,"mb-0"]];},template:function(o,a){if(o&1&&(l(0,"div",8)(1,"div"),c(2,"my-lateral-menu",9),r(),l(3,"div",10)(4,"div",11)(5,"div",12)(6,"my-button",13),E(7,2),r(),C(8,jt,6,2,"h2")(9,Wt,2,0,"h2"),l(10,"div",14),C(11,Qt,3,1,"my-button",15),l(12,"my-button",16),R("click",function(){return a.onSaveClick();}),E(13,3),r()()(),C(14,Zt,2,1,"my-alert",17)(15,ni,5,0,"my-alert",18),r(),l(16,"div",19),c(17,"router-outlet"),r()()()),o&2){let d;_(2),F("config",a.menuConfig),_(4),F("ptRouterLink",a.cancelLink()),_(2),p(a.mode==="update"?8:9),_(3),p((d=a.videoChannelEdit())!=null&&d.apiInfo.id?11:-1),_(),F("disabled",!a.canU
1pdate()),_(2),p(a.getError()?14:a.displayFormErrorsMsg&&a.hasFormErrors()?15:-1);}},dependencies:[j,Fe,st,Rn,Oe,en,Ue,Ae,nn,fe],styles:[`.header-block[_ngcontent-%COMP%]{border-radius:14px;background-color:var(--bg-secondary-350)}h2[_ngcontent-%COMP%]{color:var(--fg-300);font-size:calc(1.2625rem + .15vw)}@media(min-width:1200px){h2[_ngcontent-%COMP%]{font-size:1.375rem}}.actions-container[_ngcontent-%COMP%]{position:sticky;top:var(--header-height);background-color:var(--bg);z-index:6}.actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;padding:1.5rem}.actions[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{flex-shrink:1;color:var(--fg-350);font-weight:700;margin-bottom:0;line-height:normal;font-size:calc(1.275rem + .3vw)}@media(min-width:1200px){.actions[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{font-size:1.5rem}}.actions[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.actions[_ngcontent-%COMP%] .go-public-page-save[_ngcontent-%COMP%]{display:flex;gap:1rem}@media screen and (max-width:1200px){.actions[_ngcontent-%COMP%]{flex-direction:column;text-align:center}.actions[_ngcontent-%COMP%] .cancel-button[_ngcontent-%COMP%]{display:none}.actions[_ngcontent-%COMP%] .go-public-page-save[_ngcontent-%COMP%]{justify-content:center}}@media screen and (max-width:800px){.actions[_ngcontent-%COMP%] .go-public-page[_ngcontent-%COMP%]{display:none}}@media screen and (max-width:500px){.actions[_ngcontent-%COMP%]{padding:.5rem;gap:.5rem}} 2/*# sourceMappingURL=video-channel-edit.component-65SLOJK6.css.map */`]}));let e=i;return e;})();var Me=class{avatar;banner;playerSettings;channel;collaborators;apiInfo;commonChanged=!1;avatarChanged=!1;bannerChanged=!1;loadFromCreate(i){let{playerSettings:n,user:t}=i;this.playerSettings={theme:n.theme},this.channel={name:"",displayName:"",description:"",support:"",bulkVideosSupportUpdate:!1},this.apiInfo={id:void 0,ownerAccount:t.account,avatars:[],videosCount:0,followersCount:0,bannerUrl:void 0,support:void 0},this.collaborators=[];}loadFromAPI(i){let{channel:n,playerSettings:t,collaborators:o}=i;this.playerSettings={theme:t.theme},this.channel={name:n.name,displayName:n.displayName,description:n.description,support:n.support,bulkVideosSupportUpdate:!1},this.collaborators=[...o],this.apiInfo={id:n.id,avatars:n.avatars,videosCount:n.videosCount,followersCount:n.followersCount,bannerUrl:n.bannerUrl,support:n.support,ownerAccount:n.ownerAccount};}hasChanges(){return this.commonChanged||this.avatarChanged||this.bannerChanged;}resetChanges(){this.commonChanged=!1,this.avatarChanged=!1,this.bannerChanged=!1,this.apiInfo.support=this.channel.support;}loadFromGeneralForm(i){this.playerSettings=i.playerSettings,this.channel=le(le({},this.channel),i.channel),this.commonChanged=!0;}updateAvatarFromGeneralForm(i){this.avatar=i,this.avatarChanged=!0;}updateBannerFromGeneralForm(i){this.banner=i,this.bannerChanged=!0;}resetAvatarFromAPI(){this.avatar=null,this.apiInfo.avatars=[];}resetBannerFromAPI(){this.apiInfo.bannerUrl=null;}updateAvatarsFromAPI(i){this.apiInfo.avatars=i;}updateBannerUrlFromAPI(i){this.apiInfo.bannerUrl=i;}};var ht=(()=>{let i=class i{authService=u(U);notifier=u(w);videoChannelService=u(H);hooks=u(Qe);playerSettingsService=u(ue);editControllerService=u(x);router=u(ce);videoChannelEdit=new Me();saveFn=this.save.bind(this);ngOnInit(){this.videoChannelEdit.loadFromCreate({user:this.authService.getUser(),playerSettings:{theme:"instance-default"}}),this.editControllerService.setStore(this.videoChannelEdit),this.editControllerService.setMode("create");}ngAfterViewInit(){this.hooks.runAction("action:video-channel-create.init","video-channel");}canDeactivate(){return{canDeactivate:!this.videoChannelEdit.hasChanges()};}save(){return this.editControllerService.resetError(),new Promise(t=>{this.videoChannelService.create(this.videoChannelEdit.channel).pipe(X(()=>this.playerSettingsService.updateChannelSettings({channelHandle:this.videoChannelEdit.channel.name,settings:{theme:this.videoChannelEdit.playerSettings.theme}})),X(()=>this.uploadAvatar(this.videoChannelEdit.channel.name,this.videoChannelEdit.avatar)),X(()=>this.uploadBanner(this.videoChannelEdit.channel.name,this.videoChannelEdit.banner))).subscribe({next:()=>{this.authService.refreshUserInformation(),this.notifier.success("Video channel "+this.videoChannelEdit.channel.displayName+" created."),this.videoChannelEdit.resetChanges(),this.router.navigate(["/my-library/video-channels/manage",this.videoChannelEdit.channel.name]),t();},error:o=>{let a=o.message;o.status===bn.CONFLICT_409&&(a="Channel name \""+this.videoChannelEdit.channel.name+"\" already exists on this platform."),this.editControllerService.setError(a),t();}});});}uploadAvatar(t,o){return o?this.videoChannelService.changeImage(t,o,"avatar"):Te(void 0);}uploadBanner(t,o){return o?this.videoChannelService.changeImage(t,o,"banner"):Te(void 0);}};h(i,"\u0275fac",function(o){return new(o||i)();}),h(i,"\u0275cmp",$({type:i,selectors:[["ng-component"]],decls:1,vars:2,consts:[[3,"videoChannelEdit","saveFn"]],template:function(o,a){o&1&&c(0,"my-video-channel-edit",0),o&2&&F("videoChannelEdit",a.videoChannelEdit)("saveFn",a.saveFn);},dependencies:[tn],encapsulation:2}));let e=i;return e;})();var It=(()=>{let i=class i{authService=u(U);notifier=u(w);route=u(Be);videoChannelService=u(H);playerSettingsService=u(ue);hooks=u(Qe);editControllerService=u(x);videoChannelEdit;saveFn=this.save.bind(this);runChannelInitHook=!0;routeSub;ngOnInit(){this.editControllerService.setMode("update"),this.routeSub=this.route.data.subscribe(t=>{let o=t.data;this.videoChannelEdit=new Me(),this.videoChannelEdit.loadFromAPI({channel:o.videoChannel,playerSettings:o.rawPlayerSettings,collaborators:o.collaborators}),this.editControllerService.setStore(this.videoChannelEdit),this.runChannelInitHook=!0;});}
2ngOnDestroy(){this.routeSub?.unsubscribe();}ngAfterViewChecked(){this.runChannelInitHook&&(this.hooks.runAction("action:video-channel-update.init","video-channel"),this.runChannelInitHook=!1);}canDeactivate(){return{canDeactivate:!this.videoChannelEdit.hasChanges()};}save(){this.editControllerService.resetError();let t={displayName:this.videoChannelEdit.channel.displayName,description:this.videoChannelEdit.channel.description,support:this.videoChannelEdit.channel.support,bulkVideosSupportUpdate:this.videoChannelEdit.channel.bulkVideosSupportUpdate};return new Promise(o=>{this.videoChannelService.update(this.videoChannelEdit.channel.name,t).pipe(X(()=>this.playerSettingsService.updateChannelSettings({channelHandle:this.videoChannelEdit.channel.name,settings:{theme:this.videoChannelEdit.playerSettings.theme}})),X(()=>this.videoChannelEdit.avatarChanged?this.updateOrDeleteAvatar(this.videoChannelEdit.avatar):Te(!0)),X(()=>this.videoChannelEdit.bannerChanged?this.updateOrDeleteBanner(this.videoChannelEdit.banner):Te(!0))).subscribe({next:()=>{this.authService.refreshUserInformation(),this.videoChannelEdit.resetChanges(),this.notifier.success("Video channel "+t.displayName+" updated."),o();},error:a=>{this.editControllerService.setError(a.message),o();}});});}updateOrDeleteAvatar(t){return t?this.videoChannelService.changeImage(this.videoChannelEdit.channel.name,t,"avatar").pipe(me(o=>this.videoChannelEdit.updateAvatarsFromAPI(o.avatars)),ve(o=>Re(()=>new Error(dn({err:o,name:"avatar",notifier:this.notifier}))))):this.videoChannelService.deleteImage(this.videoChannelEdit.channel.name,"avatar").pipe(me(()=>this.videoChannelEdit.resetAvatarFromAPI()));}updateOrDeleteBanner(t){return t?this.videoChannelService.changeImage(this.videoChannelEdit.channel.name,t,"banner").pipe(me(o=>this.videoChannelEdit.updateBannerUrlFromAPI(Jn.GET_ACTOR_BANNER_URL(o))),ve(o=>Re(()=>new Error(dn({err:o,name:"banner",notifier:this.notifier}))))):this.videoChannelService.deleteImage(this.videoChannelEdit.channel.name,"banner").pipe(me(()=>this.videoChannelEdit.resetBannerFromAPI()));}};h(i,"\u0275fac",function(o){return new(o||i)();}),h(i,"\u0275cmp",$({type:i,selectors:[["my-video-channel-manage"]],decls:1,vars:2,consts:[[3,"videoChannelEdit","saveFn"]],template:function(o,a){o&1&&c(0,"my-video-channel-edit",0),o&2&&F("videoChannelEdit",a.videoChannelEdit)("saveFn",a.saveFn);},dependencies:[tn],encapsulation:2}));let e=i;return e;})();var b=e=>["/w",e],Le=e=>["/my-library/video-playlists/",e];function ti(e,i){if(e&1&&(D(0),T(1,0),c(2,"strong")(3,"a",28),N(),A()),e&2){let n=s(2);_(3),F("routerLink",I(3,b,n.a.video.shortUUID)),g(n.account)(n.a.video.name),S(1);}}function ii(e,i){if(e&1&&(D(0),T(1,1),c(2,"strong")(3,"a",28),N(),A()),e&2){let n=s(2);_(3),F("routerLink",I(3,Le,n.a.playlist.shortUUID)),g(n.account)(n.a.playlist.name),S(1);}}function oi(e,i){if(e&1&&(D(0),T(1,2),c(2,"strong")(3,"a",29),N(),A()),e&2){let n=s(2);_(3),g(n.account)(n.a.channelSync.externalChannelUrl),S(1);}}function ai(e,i){if(e&1&&(D(0),T(1,3),c(2,"strong")(3,"a",28),N(),A()),e&2){let n=s(2);_(3),F("routerLink",I(4,b,n.a.videoImport.uuid)),g(n.account)(n.a.videoImport.name)(n.a.videoImport.targetUrl),S(1);}}function ri(e,i){if(e&1&&C(0,ti,4,5,"ng-container")(1,ii,4,5,"ng-container")(2,oi,4,2,"ng-container")(3,ai,4,6,"ng-container"),e&2){let n,t=s();p((n=t.a.targetType.id)===1?0:n===2?1:n===4?2:n===5?3:-1);}}function _i(e,i){if(e&1&&(D(0),T(1,4),c(2,"strong")(3,"a",28),N(),A()),e&2){let n=s(2);_(3),F("routerLink",I(3,b,n.a.video.shortUUID)),g(n.account)(n.a.video.name),S(1);}}function li(e,i){if(e&1&&(D(0),T(1,5),c(2,"strong")(3,"a",28),N(),A()),e&2){let n=s(2);_(3),F("routerLink",I(3,Le,n.a.playlist.shortUUID)),g(n.account)(n.a.playlist.name),S(1);}}function si(e,i){if(e&1&&(D(0),T(1,6),c(2,"strong"),N(),A()),e&2){let n=s(2);_(2),g(n.account),S(1);}}function di(e,i){if(e&1&&C(0,_i,4,5,"ng-container")(1,li,4,5,"ng-container")(2,si,3,1,"ng-container"),e&2){let n,t=s();p((n=t.a.targetType.id)===1?0:n===2?1:n===3?2:-1);}}function ci(e,i){if(e&1&&(D(0),T(1,7),c(2,"strong")(3,"a",28),N(),A()),e&2){let n=s(2);_(3),F("routerLink",I(3,b,n.a.video.shortUUID)),g(n.account)(n.a.video.name),S(1);}}function Fi(e,i){if(e&1&&(D(0),T(1,8),c(2,"strong")(3,"a",28),N(),A()),e&2){let n=s(2);_(3),F("routerLink",I(3,Le,n.a.playlist.shortUUID)),g(n.account)(n.a.playlist.name),S(1);}}function ui(e,i){if(e&1&&(D(0),T(1,9),c(2,"strong"),N(),A()),e&2){let n=s(2);_(2),g(n.account)(n.a.channelSync.externalChannelUrl),S(1);}}function Ei(e,i){if(e&1&&C(0,ci,4,5,"ng-container")(1,Fi,4,5,"ng-container")(2,ui,3,2,"ng-container"),e&2){let n,t=s();p((n=t.a.targetType.id)===1?0:n===2?1:n===4?2:-1);}}function Ci(e,i){if(e&1&&(D(0),T(1,10),c(2,"strong")(3,"a",28),N(),A()),e&2){let n=s(2);_(3),F("routerLink",I(3,b,n.a.video.shortUUID)),g(n.account)(n.a.video.name),S(1);}}function pi(e,i){if(e&1&&C(0,Ci,4,5,"ng-container"),e&2){let n,t=s();p((n=t.a.targetType.id)===1?0:-1);}}function mi(e,i){if(e&1&&(D(0),T(1,11),c(2,"strong")(3,"a",28),N(),A()),e&2){let n=s(2);_(3),F("routerLink",I(3,b,n.a.video.shortUUID)),g(n.account)(n.a.video.name),S(1);}}function gi(e,i){if(e&1&&C(0,mi,4,5,"ng-container"),e&2){let n,t=s();p((n=t.a.targetType.id)===1?0:-1);}}function Si(e,i){if(e&1&&(D(0),T(1,12),c(2,"strong")(3,"a",28),N(),A()),e&2){let n=s(2);_(3),F("routerLink",I(3,b,n.a.video.shortUUID)),g(n.account)(n.a.video.name),S(1);}}function Ti(e,i){if(e&1&&C(0,Si,4,5,"ng-container"),e&2){let n,t=s();p((n=t.a.targetType.id)===1?0:-1);}}function Ni(e,i){if(e&1&&(D(0),T(1,13),c(2,"strong")(3,"a",28),N(),A()),e&2){let n=s(2);_(3),F("routerLink",I(3,b,n.a.video.shortUUID)),g(n.account)(n.a.video.name),S(1);}}function Di(e,i){if(e&1&&C(0,Ni,4,5,"ng-container"),e&2){let n,t=s();p((n=t.a.targetType.id)===1?0:-1);}}function Ai(e,i){if(e&1&&(D(0),T(1,14),c(2,"strong")(3,"a",28),N(),A()),e&2){let n=s(2);_(3),F("routerLink",I(3,b,n.a.video.shortUUID)),g(n.account)(n.a.video.name),S(1);}}function hi(e,i){if(e&1&&C(0,Ai,4,5,"ng-container"),e&2){let n,t=s();p((n=t.a.targetType.id)===1?0:-1);}}function Ii(e,i){if(e&1&&(D(0),T(1,15),c(2,"strong")(3,"a",28),N(),A()),e&2){let n=s(2);_(3),F("routerLink",I(3,Le,n.a.playlist.shortUUID)),g(n.account)(n.a.playlist.name),S(1);}}function Oi(e,i){if(e&1&&C(0,Ii,4,5,"ng-container"),e&2){let n,t=s();p((n=t.a.targetType.id)===2?0:-1);}}function fi(e,i){if(e&1&&(D(0),T(1,16),c(2,"strong")(3,"a",28),N(),A()),e&2){let n=s(2);_(3),F("routerLink",I(3,b,n.a.video.shortUUID)),g(n.account)(n.a.video.name),S(1);}}function Mi(e,i){if(e&1&&(D(0),T(1,17),c(2,"strong")(3,"a",28),N(),A()),e&2){let n=s(2);_(3),F("routerLink",I(3,Le,n.a.playlist.shortUUID)),g(n.account)(n.a.playlist.name),S(1);}}function Li(e,i){if(e&1&&C(0,fi,4,5,"ng-container")(1,Mi,4,5,"ng-container"),e&2){let n,t=s();p((n=t.a.targetType.id)===1?0:n===2?1:-1);}}function Ri(e,i){if(e&1&&(D(0),T(1,18),c(2,"strong")(3,"a",28),N(),A()),e&2){let n=s(2);_(3),F("routerLink",I(3,b,n.a.video.shortUUID)),g(n.account)(n.a.video.name),S(1);}}function vi(e,i){if(e&1&&(D(0),T(1,19),c(2,"strong")(3,"a",28),N(),A()),e&2){let n=s(2);_(3),F("routerLink",I(3,Le,n.a.playlist.shortUUID)),g(n.account)(n.a.playlist.name),S(1);}}function Pi(e,i){if(e&1&&C(0,Ri,4,5,"ng-container")(1,vi,4,5,"ng-container"),e&2){let n,t=s();p((n=t.a.targetType.id)===1?0:n===2?1:-1);}}
2function $i(e,i){if(e&1&&(T(0,20,1),c(1,"strong")(2,"a",28),N()),e&2){let n=s(2);_(2),F("routerLink",I(4,b,n.a.video.shortUUID)),g(n.account)(n.a.targetAccount.displayName)(n.a.video.name),S(0);}}function yi(e,i){if(e&1&&(T(0,20,2),c(1,"strong"),N()),e&2){let n=s(2);_(),g(n.account)(n.a.targetAccount.displayName),S(0);}}function Vi(e,i){if(e&1&&(D(0),T(1,20),C(2,$i,3,6)(3,yi,2,2),N(),A()),e&2){let n=s();_(2),p(n.a.video?2:n.a.channel?3:-1);}}function bi(e,i){if(e&1&&(T(0,21,1),c(1,"strong")(2,"a",28),N()),e&2){let n=s(2);_(2),F("routerLink",I(3,b,n.a.video.shortUUID)),g(n.account)(n.a.video.name),S(0);}}function Yi(e,i){if(e&1&&(T(0,21,2),c(1,"strong"),N()),e&2){let n=s(2);_(),g(n.account),S(0);}}function Gi(e,i){if(e&1&&(D(0),T(1,21),C(2,bi,3,5)(3,Yi,2,1),N(),A()),e&2){let n=s();_(2),p(n.a.video?2:n.a.channel?3:-1);}}function xi(e,i){if(e&1&&(T(0,22,1),c(1,"strong")(2,"a",28),N()),e&2){let n=s(2);_(2),F("routerLink",I(3,b,n.a.video.shortUUID)),g(n.account)(n.a.video.name),S(0);}}function wi(e,i){if(e&1&&(T(0,22,2),c(1,"strong"),N()),e&2){let n=s(2);_(),g(n.account),S(0);}}function Hi(e,i){if(e&1&&(D(0),T(1,22),C(2,xi,3,5)(3,wi,2,1),N(),A()),e&2){let n=s();_(2),p(n.a.video?2:n.a.channel?3:-1);}}function ki(e,i){if(e&1&&(D(0),T(1,23),c(2,"strong")(3,"a",28),N(),A()),e&2){let n=s();_(3),F("routerLink",I(3,b,n.a.video.shortUUID)),g(n.account)(n.a.video.name),S(1);}}function Bi(e,i){if(e&1&&(D(0),T(1,24),c(2,"strong")(3,"a",28),N(),A()),e&2){let n=s();_(3),F("routerLink",I(3,b,n.a.video.shortUUID)),g(n.account)(n.a.video.name),S(1);}}var Ot=(()=>{let i=class i{activity=de();a;account;ngOnInit(){this.a=this.activity(),this.account=this.a.account?this.a.account.displayName:"Deleted account";}};h(i,"\u0275fac",function(o){return new(o||i)();}),h(i,"\u0275cmp",$({type:i,selectors:[["my-video-channel-activity"]],inputs:{activity:[1,"activity"]},decls:21,vars:4,consts:()=>{let t;t=""+"\uFFFD#2\uFFFD"+""+"\uFFFD0\uFFFD"+""+"\uFFFD/#2\uFFFD"+" created video "+"\uFFFD#3\uFFFD"+""+"\uFFFD1\uFFFD"+""+"\uFFFD/#3\uFFFD"+"";let o;o=""+"\uFFFD#2\uFFFD"+""+"\uFFFD0\uFFFD"+""+"\uFFFD/#2\uFFFD"+" created playlist "+"\uFFFD#3\uFFFD"+""+"\uFFFD1\uFFFD"+""+"\uFFFD/#3\uFFFD"+"";let a;a=""+"\uFFFD#2\uFFFD"+""+"\uFFFD0\uFFFD"+""+"\uFFFD/#2\uFFFD"+" created "+"\uFFFD#3\uFFFD"+"a channel synchronization"+"\uFFFD/#3\uFFFD"+": "+"\uFFFD1\uFFFD"+" ";let d;d=""+"\uFFFD#2\uFFFD"+""+"\uFFFD0\uFFFD"+""+"\uFFFD/#2\uFFFD"+" imported video "+"\uFFFD#3\uFFFD"+""+"\uFFFD1\uFFFD"+""+"\uFFFD/#3\uFFFD"+": "+"\uFFFD2\uFFFD"+" ";let m;m=""+"\uFFFD#2\uFFFD"+""+"\uFFFD0\uFFFD"+""+"\uFFFD/#2\uFFFD"+" updated video "+"\uFFFD#3\uFFFD"+""+"\uFFFD1\uFFFD"+""+"\uFFFD/#3\uFFFD"+"";let v;v=""+"\uFFFD#2\uFFFD"+""+"\uFFFD0\uFFFD"+""+"\uFFFD/#2\uFFFD"+" updated playlist "+"\uFFFD#3\uFFFD"+""+"\uFFFD1\uFFFD"+""+"\uFFFD/#3\uFFFD"+"";let L;L=""+"\uFFFD#2\uFFFD"+""+"\uFFFD0\uFFFD"+""+"\uFFFD/#2\uFFFD"+" updated the channel ";let k;k=""+"\uFFFD#2\uFFFD"+""+"\uFFFD0\uFFFD"+""+"\uFFFD/#2\uFFFD"+" deleted video "+"\uFFFD#3\uFFFD"+""+"\uFFFD1\uFFFD"+""+"\uFFFD/#3\uFFFD"+"";let y;y=""+"\uFFFD#2\uFFFD"+""+"\uFFFD0\uFFFD"+""+"\uFFFD/#2\uFFFD"+" deleted playlist "+"\uFFFD#3\uFFFD"+""+"\uFFFD1\uFFFD"+""+"\uFFFD/#3\uFFFD"+"";let B;B=""+"\uFFFD#2\uFFFD"+""+"\uFFFD0\uFFFD"+""+"\uFFFD/#2\uFFFD"+" delete channel synchronization "+"\uFFFD1\uFFFD"+" ";let P;P=""+"\uFFFD#2\uFFFD"+""+"\uFFFD0\uFFFD"+""+"\uFFFD/#2\uFFFD"+" updated captions of video "+"\uFFFD#3\uFFFD"+""+"\uFFFD1\uFFFD"+""+"\uFFFD/#3\uFFFD"+"";let ee;ee=""+"\uFFFD#2\uFFFD"+""+"\uFFFD0\uFFFD"+""+"\uFFFD/#2\uFFFD"+" updated chapters of video "+"\uFFFD#3\uFFFD"+""+"\uFFFD1\uFFFD"+""+"\uFFFD/#3\uFFFD"+"";let ne;ne=""+"\uFFFD#2\uFFFD"+""+"\uFFFD0\uFFFD"+""+"\uFFFD/#2\uFFFD"+" updated passwords of video "+"\uFFFD#3\uFFFD"+""+"\uFFFD1\uFFFD"+""+"\uFFFD/#3\uFFFD"+"";let te;te=""+"\uFFFD#2\uFFFD"+""+"\uFFFD0\uFFFD"+""+"\uFFFD/#2\uFFFD"+" created studio tasks of video "+"\uFFFD#3\uFFFD"+""+"\uFFFD1\uFFFD"+""+"\uFFFD/#3\uFFFD"+"";let ie;ie=""+"\uFFFD#2\uFFFD"+""+"\uFFFD0\uFFFD"+""+"\uFFFD/#2\uFFFD"+" updated source file of video "+"\uFFFD#3\uFFFD"+""+"\uFFFD1\uFFFD"+""+"\uFFFD/#3\uFFFD"+"";let oe;oe=""+"\uFFFD#2\uFFFD"+""+"\uFFFD0\uFFFD"+""+"\uFFFD/#2\uFFFD"+" updated elements of playlist "+"\uFFFD#3\uFFFD"+""+"\uFFFD1\uFFFD"+""+"\uFFFD/#3\uFFFD"+"";let ae;ae=""+"\uFFFD#2\uFFFD"+""+"\uFFFD0\uFFFD"+""+"\uFFFD/#2\uFFFD"+" removed video "+"\uFFFD#3\uFFFD"+""+"\uFFFD1\uFFFD"+""+"\uFFFD/#3\uFFFD"+" by updating its channel ";let re;re=""+"\uFFFD#2\uFFFD"+""+"\uFFFD0\uFFFD"+""+"\uFFFD/#2\uFFFD"+" removed playlist "+"\uFFFD#3\uFFFD"+""+"\uFFFD1\uFFFD"+""+"\uFFFD/#3\uFFFD"+" by updating its channel ";let _e;_e=""+"\uFFFD#2\uFFFD"+""+"\uFFFD0\uFFFD"+""+"\uFFFD/#2\uFFFD"+" created video "+"\uFFFD#3\uFFFD"+""+"\uFFFD1\uFFFD"+""+"\uFFFD/#3\uFFFD"+" by updating its channel ";let f;f=""+"\uFFFD#2\uFFFD"+""+"\uFFFD0\uFFFD"+""+"\uFFFD/#2\uFFFD"+" created playlist "+"\uFFFD#3\uFFFD"+""+"\uFFFD1\uFFFD"+""+"\uFFFD/#3\uFFFD"+" by updating its channel ";let Ee;Ee=""+"\uFFFD*2:1\uFFFD"+""+"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"+""+"[\uFFFD0:1\uFFFD|\uFFFD0:2\uFFFD]"+""+"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"+" sent an ownership change request to "+"[\uFFFD1:1\uFFFD|\uFFFD1:2\uFFFD]"+" for video "+"\uFFFD#2:1\uFFFD"+""+"\uFFFD2:1\uFFFD"+""+"\uFFFD/#2:1\uFFFD"+""+"\uFFFD/*2:1\uFFFD"+""+"\uFFFD*3:2\uFFFD"+""+"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"+""+"[\uFFFD0:1\uFFFD|\uFFFD0:2\uFFFD]"+""+"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"+" sent an ownership change request to "+"[\uFFFD1:1\uFFFD|\uFFFD1:2\uFFFD]"+" for this channel "+"\uFFFD/*3:2\uFFFD"+"",Ee=K(Ee);let Ce;Ce=""+"\uFFFD*2:1\uFFFD"+""+"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"+""+"[\uFFFD0:1\uFFFD|\uFFFD0:2\uFFFD]"+""+"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"+" accepted an ownership change request for video "+"\uFFFD#2:1\uFFFD"+""+"\uFFFD1:1\uFFFD"+""+"\uFFFD/#2:1\uFFFD"+""+"\uFFFD/*2:1\uFFFD"+""+"\uFFFD*3:2\uFFFD"+""+"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"+""+"[\uFFFD0:1\uFFFD|\uFFFD0:2\uFFFD]"+""+"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"+" accepted an ownership change request for this channel "+"\uFFFD/*3:2\uFFFD"+"",Ce=K(Ce);let O;O=""+"\uFFFD*2:1\uFFFD"+""+"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"+""+"[\uFFFD0:1\uFFFD|\uFFFD0:2\uFFFD]"+""+"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"+" refused an ownership change request for video "+"\uFFFD#2:1\uFFFD"+""+"\uFFFD1:1\uFFFD"+""+"\uFFFD/#2:1\uFFFD"+""+"\uFFFD/*2:1\uFFFD"+""+"\uFFFD*3:2\uFFFD"+""+"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"+""+"[\uFFFD0:1\uFFFD|\uFFFD0:2\uFFFD]"+""+"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"+" refused an ownership change request for this channel "+"\uFFFD/*3:2\uFFFD"+"",O=K(O);let un;un=""+"\uFFFD#2\uFFFD"+""+"\uFFFD0\uFFFD"+""+"\uFFFD/#2\uFFFD"+" updated embed policy of video "+"\uFFFD#3\uFFFD"+""+"\uFFFD1\uFFFD"+""+"\uFFFD/#3\uFFFD"+"";let En;return En=""+"\uFFFD#2\uFFFD"+""+"\uFFFD0\uFFFD"+""+"\uFFFD/#2\uFFFD"+" deleted an ownership request for video "+"\uFFFD#3\uFFFD"+""+"\uFFFD1\uFFFD"+""+"\uFFFD/#3\uFFFD"+"",[t,o,a,d,m,v,L,k,y,B,P,ee,ne,te,ie,oe,ae,re,_e,f,Ee,Ce,O,un,En,[1,"root"],[1,"message"],[1,"date"],[3,"routerLink"],["routerLink","/my-library/video-channel-syncs"]];},template:function(o,a){if(o&1&&(l(0,"div",25)(1,"div",26),C(2,ri,4,1)(3,di,3,1)(4,Ei,3,1)(5,pi,1,1)(6,gi,1,1)(7,Ti,1,1)(8,Di,1,1)(9,hi,1,1)(10,Oi,1,1)(11,Li,2,1)(12,Pi,2,1)(13,Vi,4,1,"ng-container")(14,Gi,4,1,"ng-container")(15,Hi,4,1,"ng-container")(16,ki,4,5,"ng-container")(17,Bi,4,5,"ng-container"),r(),l(18,"div",27),V(19),we(20,"myFromNow"),r()()),o&2){let d;_(2),p((d=a.a.action.id)===1?2:d===2?3:d===3?4:d===4?5:d===5?6:d===6?7:d===7?8:d===8?9:d===9?10:d===10?11:d===11?12:d===12?13:d===13?14:d===14?15:d===15?16:d===16?17:-1),_(17),ge(" ",He(20,2,a.a.createdAt)," ");}},dependencies:[Ue,Ae,nt],styles:[`.root[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.5rem}.message[_ngcontent-%COMP%]{color:var(--fg-300);word-break:break-word}.date[_ngcontent-%COMP%]{color:var(--fg-200);font-size:.875rem} 3/*# sourceMappingURL=video-channel-activity.component-JARDZOZO.css.map */`]}));let e=i;return e;})();var Ui=e=>({even:e}),Xi=(e,i)=>i.id;function zi(e,i){e&1&&(l(0,"div",4),E(1,1),r());}function Ki(e,i){if(e&1&&(c(0,"my-date-group-label",6),l(1,"div",7),c(2,"my-video-channel-activity",8),r()),e&2){let n=i.$implicit,t=i.$index,o=s();F("date",n.createdAt)("store",o.groupByDateStore),_(),F("ngClass",I(4,Ui,t%2===0)),_(),F("activity",n);}}var Mt=(()=>{let i=class i{notifier=u(w);channelService=u(H);editController=u(x);pagination={currentPage:1,itemsPerPage:20,totalItems:null};videoChannelEdit;activities=[];
3onDataSubject=new Se();groupByDateStore=new Set();storeSub;ngOnInit(){this.videoChannelEdit=this.editController.getStore(),this.reload(),this.storeSub=this.editController.getStoreChangesObs().subscribe(()=>{this.videoChannelEdit=this.editController.getStore(),this.reload();});}ngOnDestroy(){this.storeSub?.unsubscribe();}reload(){this.activities=[],We(this.pagination),this.loadMoreActivities();}onNearOfBottom(){je(this.pagination)&&(this.pagination.currentPage+=1,this.loadMoreActivities());}loadMoreActivities(){this.channelService.listActivities({channelName:this.videoChannelEdit.channel.name,componentPagination:this.pagination}).subscribe({next:t=>{this.activities=this.activities.concat(t.data),this.pagination.totalItems=t.total,this.onDataSubject.next(t.data);},error:t=>this.notifier.handleError(t)});}};h(i,"\u0275fac",function(o){return new(o||i)();}),h(i,"\u0275cmp",$({type:i,selectors:[["my-video-channel-activities"]],decls:9,vars:2,consts:()=>{let t;t="Activity";let o;return o=" No activity in the channel yet ",[t,o,[1,"form-title"],["iconName","calendar"],[1,"no-results"],["myInfiniteScroller","",1,"activities",3,"nearOfBottom","dataObservable"],[3,"date","store"],[1,"activity-container",3,"ngClass"],[3,"activity"]];},template:function(o,a){o&1&&(l(0,"div")(1,"h2",2),c(2,"my-global-icon",3),D(3),E(4,0),A(),r(),C(5,zi,2,0,"div",4),l(6,"div",5),R("nearOfBottom",function(){return a.onNearOfBottom();}),Z(7,Ki,3,6,null,null,Xi),r()()),o&2&&(_(5),p(a.pagination.totalItems===0?5:-1),_(),F("dataObservable",a.onDataSubject.asObservable()),_(),J(a.activities));},dependencies:[De,ke,j,Fe,W,Ze,Ot,Zn],styles:[`.activity-container[_ngcontent-%COMP%]{margin-bottom:.75rem;border-radius:24px;padding:1rem 1.5rem;background-color:var(--bg-secondary-350)}.activity-container.even[_ngcontent-%COMP%]{background-color:var(--bg-secondary-400)}my-date-group-label[_ngcontent-%COMP%]:not(.date-displayed){display:none}my-date-group-label.date-displayed[_ngcontent-%COMP%]{color:var(--fg-300);font-weight:700;display:block;padding-bottom:calc(1.275rem + .3vw)}@media(min-width:1200px){my-date-group-label.date-displayed[_ngcontent-%COMP%]{padding-bottom:1.5rem}}my-date-group-label.date-displayed[_ngcontent-%COMP%]{font-size:1.125rem}my-date-group-label.date-displayed[_ngcontent-%COMP%]:not(:first-child){border-top:1px solid var(--bg-secondary-500);padding-top:calc(1.275rem + .3vw)}@media(min-width:1200px){my-date-group-label.date-displayed[_ngcontent-%COMP%]:not(:first-child){padding-top:1.5rem}}my-date-group-label.date-displayed[_ngcontent-%COMP%]:not(:first-child){margin-top:calc(1.275rem + .3vw)}@media(min-width:1200px){my-date-group-label.date-displayed[_ngcontent-%COMP%]:not(:first-child){margin-top:1.5rem}} 4/*# sourceMappingURL=video-channel-activities.component-HKDVZWEM.css.map */`]}));let e=i;return e;})();var qi=["bannerfileInput"],ji=["bannerPopover"];function Wi(e,i){if(e&1&&c(0,"img",8),e&2){let n=s();F("src",n.getBannerUrl(),Tn);}}function Qi(e,i){e&1&&_n(0);}function Zi(e,i){if(e&1&&(l(0,"div",9),se(1,Qi,1,0,"ng-container",11),r()),e&2){let n=s(),t=ln(7);F("ngbTooltip",n.bannerFormat),_(),F("ngTemplateOutlet",t);}}function Ji(e,i){e&1&&_n(0);}function eo(e,i){if(e&1){let n=z();l(0,"div",10)(1,"button",12),c(2,"my-global-icon",13),l(3,"span"),E(4,2),r()(),l(5,"div",14)(6,"div",15),se(7,Ji,1,0,"ng-container",11),r(),l(8,"button",16),R("click",function(){Y(n);let o=s();return G(o.deleteBanner());}),c(9,"my-global-icon",17),l(10,"span"),E(11,3),r()()()();}if(e&2){let n=s(),t=ln(7);_(6),F("ngbTooltip",n.bannerFormat),_(),F("ngTemplateOutlet",t);}}function no(e,i){if(e&1){let n=z();c(0,"my-global-icon",18),l(1,"label",19),E(2,4),r(),l(3,"input",20,1),R("change",function(){Y(n);let o=s();return G(o.onBannerChange());}),r();}if(e&2){let n=s();_(3),F("accept",n.bannerExtensions);}}var Lt=(()=>{let i=class i{serverService=u(jn);notifier=u(w);bannerfileInput=Ve("bannerfileInput");bannerPopover=Ve("bannerPopover");bannerUrl=de();previewImage=de(!1,{transform:Mn});bannerChange=ye();bannerDelete=ye();bannerFormat="";maxBannerSize=0;bannerExtensions="";preview;ngOnInit(){let t=this.serverService.getHTMLConfig();this.maxBannerSize=t.banner.file.size.max,this.bannerExtensions=t.banner.file.extensions.join(", "),this.bannerFormat="ratio 6/1, recommended size: 1920x317, max size: "+zn(this.maxBannerSize)+", extensions: "+this.bannerExtensions+"";}ngOnChanges(){this.preview=void 0;}onBannerChange(){let t=this.bannerfileInput().nativeElement.files[0];if(t.size>this.maxBannerSize){this.notifier.error("Error","This image is too large.");return;}let o=new FormData();o.append("bannerfile",t),this.bannerPopover()?.close(),this.bannerChange.emit(o),this.previewImage()&&Kn(t).then(a=>this.preview=a);}deleteBanner(){this.previewImage()&&(this.preview=null),this.bannerDelete.emit();}hasBanner(){return this.preview===null?!1:!!this.preview||!!this.bannerUrl();}getBannerUrl(){return this.preview===null?"":this.preview||this.bannerUrl();}};h(i,"\u0275fac",function(o){return new(o||i)();}),h(i,"\u0275cmp",$({type:i,selectors:[["my-actor-banner-edit"]],viewQuery:function(o,a){o&1&&be(a.bannerfileInput,qi,5)(a.bannerPopover,ji,5),o&2&&Ne(2);},inputs:{bannerUrl:[1,"bannerUrl"],previewImage:[1,"previewImage"]},outputs:{bannerChange:"bannerChange",bannerDelete:"bannerDelete"},features:[gn],decls:8,vars:2,consts:()=>{let t;t="Change your banner";let o;o="Remove banner";let a;return a="Upload a new banner",[["uploadNewBanner",""],["bannerfileInput",""],t,o,a,[1,"actor"],[1,"actor-img-edit-container"],[1,"banner-placeholder"],["alt","Banner",3,"src"],["placement","right","container","body",1,"actor-img-edit-button","button-file","primary-button","button-focus-within",3,"ngbTooltip"],["ngbDropdown","","placement","right"],[4,"ngTemplateOutlet"],["type","button","ngbDropdownToggle","",1,"actor-img-edit-button","button-file","primary-button"],["
4iconName","edit"],["ngbDropdownMenu",""],[1,"dropdown-item","dropdown-file","button-focus-within",3,"ngbTooltip"],["type","button",1,"dropdown-item",3,"click"],["iconName","delete"],["iconName","upload"],["for","bannerfile"],["type","file","name","bannerfile","id","bannerfile",3,"change","accept"]];},template:function(o,a){o&1&&(l(0,"div",5)(1,"div",6)(2,"div",7),C(3,Wi,1,1,"img",8),r(),C(4,Zi,2,2,"div",9)(5,eo,12,2,"div",10),r()(),se(6,no,5,1,"ng-template",null,0,$e)),o&2&&(_(3),p(a.hasBanner()?3:-1),_(),p(a.hasBanner()?5:4));},dependencies:[De,Ln,Xn,Un,Bn,kn,Hn,wn,W],styles:[`.dropdown-file[_ngcontent-%COMP%]{position:relative;overflow:hidden;display:inline-block}.dropdown-file[_ngcontent-%COMP%] input[type=file][_ngcontent-%COMP%]{position:absolute;top:0;right:0;width:100%;height:100%;font-size:100px;text-align:end;filter:alpha(opacity=0);opacity:0;outline:none;background:var(--bg);cursor:inherit;display:block}.actor-img-edit-button[_ngcontent-%COMP%]{width:31px;cursor:pointer;display:flex;justify-content:center;align-items:center}.actor-img-edit-button[_ngcontent-%COMP%] my-global-icon[_ngcontent-%COMP%]{position:relative;top:-1px;right:0;display:inline-block;width:19px;height:19px;line-height:19px}.actor-img-edit-button[_ngcontent-%COMP%]:not(.icon-only) my-global-icon[_ngcontent-%COMP%]{margin-inline-end:0}label[_ngcontent-%COMP%]{font-weight:400;font-size:inherit;color:inherit;margin:0} 5/*# sourceMappingURL=actor-image-edit-LYW67ZPV.css.map */`,`.banner-placeholder[_ngcontent-%COMP%]{position:relative;height:0;width:100%;padding-top:16.6666666667%}.banner-placeholder[_ngcontent-%COMP%] > div[_ngcontent-%COMP%], .banner-placeholder[_ngcontent-%COMP%] > img[_ngcontent-%COMP%]{position:absolute;width:100%;height:100%;top:0}.banner-placeholder[_ngcontent-%COMP%]{background-color:var(--bg-secondary-500)}.actor-img-edit-container[_ngcontent-%COMP%]{position:relative;display:flex;justify-content:center;align-items:center}.dropdown[_ngcontent-%COMP%]{position:absolute}.dropdown[_ngcontent-%COMP%] > .actor-img-edit-button[_ngcontent-%COMP%]{position:relative}.actor-img-edit-button[_ngcontent-%COMP%]{width:auto;position:absolute}.actor-img-edit-button[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{font-weight:600;margin-bottom:0}.button-focus-within[_ngcontent-%COMP%]:focus-within{box-shadow:0 0 0 .2rem var(--fg-100)}.dropdown-item[_ngcontent-%COMP%]{padding:var(--input-y-padding) 1rem}.dropdown-item[_ngcontent-%COMP%] my-global-icon[_ngcontent-%COMP%]{width:22px;opacity:.7;position:relative;top:-2px;margin-inline-end:.5rem}.dropdown-item[_ngcontent-%COMP%] my-actor-avatar[_ngcontent-%COMP%]{margin-inline-end:.5rem}.dropdown-toggle[_ngcontent-%COMP%]:after{display:none} 6/*# sourceMappingURL=actor-banner-edit.component-PHNYWGSH.css.map */`]}));let e=i;return e;})();var to=["sendChangeOwnershipModal"],Rt=e=>({"input-error":e});function io(e,i){if(e&1&&(l(0,"div",34),V(1),r()),e&2){let n=s();_(),q(n.formErrors.name);}}function oo(e,i){if(e&1&&(l(0,"div",34),V(1),r()),e&2){let n=s();_(),ge(" ",n.formErrors.displayName," ");}}function ao(e,i){e&1&&(l(0,"div",35),c(1,"my-peertube-checkbox",49),r());}function ro(e,i){if(e&1){let n=z();l(0,"my-alert",52)(1,"div",56)(2,"div"),T(3,20),c(4,"strong"),N(),r(),l(5,"my-button",57),R("click",function(){Y(n);let o=s(2);return G(o.cancelOwnershipRequest());}),V(6,"Cancel request"),r()()();}if(e&2){let n=s(2);_(4),g(n.pendingOwnershipRequest.nextOwnerAccount.name),S(3);}}function _o(e,i){if(e&1){let n=z();l(0,"div",48)(1,"div",25)(2,"h3"),E(3,12),r()(),l(4,"div",26)(5,"div",35)(6,"label",50),E(7,13),r(),l(8,"div",43)(9,"div"),E(10,14),r(),l(11,"div"),E(12,15),r()(),l(13,"button",51),R("click",function(){Y(n);let o=s();return G(o.showChangeOwnershipModal());}),E(14,16),r(),C(15,ro,7,1,"my-alert",52),r(),l(16,"my-send-change-ownership",53,0),R("requestSent",function(o){Y(n);let a=s();return G(a.onChangeOwnershipRequest(o));}),r(),l(18,"div",35)(19,"label",54),E(20,17),r(),l(21,"div",43),E(22,18),r(),l(23,"button",55),R("click",function(){Y(n);let o=s();return G(o.deleteChannel());}),E(24,19),r()()()();}if(e&2){let n=s();_(13),F("disabled",!!n.pendingOwnershipRequest),_(2),p(n.pendingOwnershipRequest?15:-1),_(),F("channelName",n.videoChannelEdit.channel.name);}}var Pt=(()=>{let i=class i{formReactiveService=u(Ke);editController=u(x);authService=u(U);confirmService=u(Ie);notifier=u(w);changeOwnershipService=u(et);channelService=u(H);router=u(ce);sendChangeOwnershipModal=Ve("sendChangeOwnershipModal");form;formErrors={};validationMessages={};mode;videoChannelEdit;pendingOwnershipRequest;formSub;storeSub;get instanceHost(){return window.location.host;}ngOnInit(){this.mode=this.editController.getMode(),this.videoChannelEdit=this.editController.getStore(),this.loadOwnershipRequestIfNeeded(),this.buildForm(),this.storeSub=this.editController.getStoreChangesObs().subscribe(()=>{this.videoChannelEdit=this.editController.getStore(),this.loadOwnershipRequestIfNeeded(),this.buildForm();}),this.editController.registerSaveHook(()=>{this.formReactiveService.forceCheck(this.form,this.formErrors,this.validationMessages),this.editController.setFormError("General","general",this.formErrors);});}
6ngOnDestroy(){this.storeSub?.unsubscribe(),this.editController.unregisterSaveHook();}buildForm(){this.formSub?.unsubscribe();let t={name:this.mode==="create"?pt:null,displayName:mt,description:gt,support:St,bulkVideosSupportUpdate:null,playerTheme:null},o={name:this.videoChannelEdit.channel.name,displayName:this.videoChannelEdit.channel.displayName,description:this.videoChannelEdit.channel.description,support:this.videoChannelEdit.channel.support,playerTheme:this.videoChannelEdit.playerSettings.theme},{form:a,formErrors:d,validationMessages:m}=this.formReactiveService.buildForm(t,o);this.form=a,this.formErrors=d,this.validationMessages=m,this.subscribeToFormChanges();}getFormButtonTitle(){return this.mode==="update"?"Manage "+this.videoChannelEdit.channel.displayName+"":"Create your channel";}onAvatarChange(t){this.videoChannelEdit.updateAvatarFromGeneralForm(t);}onAvatarDelete(){this.videoChannelEdit.updateAvatarFromGeneralForm(null);}onBannerChange(t){this.videoChannelEdit.updateBannerFromGeneralForm(t);}onBannerDelete(){this.videoChannelEdit.updateBannerFromGeneralForm(null);}isBulkUpdateVideosDisplayed(){return this.mode==="create"||this.videoChannelEdit.apiInfo.support===void 0?!1:this.videoChannelEdit.apiInfo.support!==this.form.value.support;}subscribeToFormChanges(){this.formSub=this.form.valueChanges.subscribe(t=>{this.editController.setFormError("General","general",{}),this.videoChannelEdit.loadFromGeneralForm({playerSettings:{theme:t.playerTheme},channel:{name:t.name,displayName:t.displayName,description:t.description||null,support:t.support||null,bulkVideosSupportUpdate:this.mode==="update"?t.bulkVideosSupportUpdate||!1:void 0}});});}canBeDeletedOrTransferred(){return this.mode==="create"?!1:this.videoChannelEdit.apiInfo.ownerAccount.id===this.authService.getUser().account.id;}showChangeOwnershipModal(){this.sendChangeOwnershipModal().show();}onChangeOwnershipRequest(t){this.pendingOwnershipRequest=t;}cancelOwnershipRequest(){return pe(this,null,function*(){let t="Are you sure you want to cancel the ownership change request to \""+this.pendingOwnershipRequest.nextOwnerAccount.name+"\"?";(yield this.confirmService.confirm(t,"Cancel request"))!==!1&&this.changeOwnershipService.cancelChannel(this.pendingOwnershipRequest.id).subscribe({next:()=>{this.notifier.success("Ownership change request cancelled"),this.pendingOwnershipRequest=null;},error:a=>this.notifier.handleError(a)});});}loadOwnershipRequestIfNeeded(){this.mode==="update"&&this.changeOwnershipService.listFromChannel(this.videoChannelEdit.channel.name,Yn.PENDING).subscribe(({data:t})=>{t.length===0?this.pendingOwnershipRequest=void 0:this.pendingOwnershipRequest=t[0];});}deleteChannel(){let t=le({name:this.videoChannelEdit.channel.name,nameWithHost:this.videoChannelEdit.channel.name,displayName:this.videoChannelEdit.channel.displayName},this.videoChannelEdit.apiInfo);this.channelService.removeWithConfirmation(t).subscribe({next:({removed:o})=>{o&&(this.router.navigateByUrl("/my-library/video-channels"),this.notifier.success("Video channel "+t.displayName+" deleted."));},error:o=>this.notifier.handleError(o)});}};h(i,"\u0275fac",function(o){return new(o||i)();}),h(i,"\u0275cmp",$({type:i,selectors:[["my-video-channel-edit-general"]],viewQuery:function(o,a){o&1&&be(a.sendChangeOwnershipModal,to,5),o&2&&Ne();},decls:57,vars:19,consts:()=>{let t;t="Example: my_channel";let o;o="General";let a;a="IMAGES";let d;d="INFORMATION";let m;m="Name";let v;v="Display name";let L;L="Description";let k;k="Support";let y;y=" This is text that helps people visiting your channel page "+"[\uFFFD#40\uFFFD|\uFFFD#42\uFFFD]"+"understand how to support you"+"[\uFFFD/#40\uFFFD|\uFFFD/#42\uFFFD]"+". You can use "+"\uFFFD#41\uFFFD"+"Markdown Language"+"\uFFFD/#41\uFFFD"+", including "+"[\uFFFD#40\uFFFD|\uFFFD#42\uFFFD]"+"links to your fundraising tools"+"[\uFFFD/#40\uFFFD|\uFFFD/#42\uFFFD]"+". ",y=K(y);let B;B="VIDEOS";let P;P="Player Theme";let ee;ee="Only used by the web player";let ne;ne="Overwrite support field of all videos of this channel";let te;te="DANGER ZONE";let ie;ie="Change ownership of your channel";let oe;oe="A modal window will open for you to specify the local account to which you want to transfer your channel";let ae;ae="The collaborators of this channel will remain after the transfer";let re;re="Transfer ownership";let _e;_e="Delete your channel";let f;f="Warning: this is a definitive action!";let Ee;Ee="Delete";let Ce;return Ce="Ownership change request sent to "+"\uFFFD#4\uFFFD"+""+"\uFFFD0\uFFFD"+""+"\uFFFD/#4\uFFFD"+", awaiting its approval.",[["sendChangeOwnershipModal",""],o,a,d,m,v,L,k,y,B,P,ee,te,ie,oe,ae,re,_e,f,Ee,Ce,[1,"form-title"],["iconName","cog"],["id","channel-manage-form",3,"formGroup"],[1,"pt-two-cols"],[1,"title-col"],[1,"content-col"],["previewImage","true",1,"d-block","mb-4",3,"bannerChange","bannerDelete","bannerUrl"],["actorType","channel","previewImage","true",1,"d-block","mb-4",3,"avatarChange","avatarDelete","avatars","username","subscribers"],[1,"form-group",3,"hidden"],["for","name"],[1,"input-group"],["type","text","id","name","placeholder",t,"formControlName","name",1,"form-control","w-auto","flex-grow-1","d-block",3,"ngClass"],[1,"input-group-text"],["role","alert",1,"form-error"],[1,"form-group"],["for","displayName"],["type","text","id","displayName","formControlName","displayName",1,"form-control",3,"ngClass"],[1,"form-group","markdown-block"],["for","description"],["helpType","markdownText","supportRelMe","true"],["inputId","de
6scription","formControlName","description","markdownType","enhanced","withEmoji","true","withHtml","true",3,"formError"],["for","support"],[1,"form-group-description"],["helpType","markdownText"],["inputId","support","formControlName","support","markdownType","enhanced","withEmoji","true","withHtml","true",3,"formError"],["for","playerTheme"],["formControlName","playerTheme","inputId","playerTheme","mode","channel"],[1,"pt-two-cols","danger-zone","mt-5"],["inputName","bulkVideosSupportUpdate","formControlName","bulkVideosSupportUpdate","labelText",ne],["for","deleteVideo"],["type","button",1,"peertube-button","danger-button",3,"click","disabled"],["type","success",1,"d-block","mt-3","d-flex"],[3,"requestSent","channelName"],["for","delete-channel-button"],["type","button","id","delete-channel-button",1,"peertube-button","danger-button",3,"click"],[1,"d-flex","align-items-center","gap-2","flex-wrap"],["theme","secondary",3,"click"]];},template:function(o,a){o&1&&(l(0,"h2",21),c(1,"my-global-icon",22),D(2),E(3,1),A(),r(),l(4,"form",23)(5,"div",24)(6,"div",25)(7,"h3"),E(8,2),r()(),l(9,"div",26)(10,"my-actor-banner-edit",27),R("bannerChange",function(m){return a.onBannerChange(m);})("bannerDelete",function(){return a.onBannerDelete();}),r(),l(11,"my-actor-avatar-edit",28),R("avatarChange",function(m){return a.onAvatarChange(m);})("avatarDelete",function(){return a.onAvatarDelete();}),r()()(),l(12,"div",24)(13,"div",25)(14,"h3"),E(15,3),r()(),l(16,"div",26)(17,"div",29)(18,"label",30),E(19,4),r(),l(20,"div",31),c(21,"input",32),l(22,"div",33),V(23),r()(),C(24,io,2,1,"div",34),r(),l(25,"div",35)(26,"label",36),E(27,5),r(),c(28,"input",37),C(29,oo,2,1,"div",34),r(),l(30,"div",38)(31,"label",39),E(32,6),r(),c(33,"my-help",40)(34,"my-markdown-textarea",41),r(),l(35,"div",38)(36,"label",42),E(37,7),r(),l(38,"div",43),T(39,8),c(40,"strong")(41,"my-markdown-hint",44)(42,"strong"),N(),r(),c(43,"my-markdown-textarea",45),r(),C(44,ao,2,0,"div",35),r()(),l(45,"div",24)(46,"div",25)(47,"h3"),E(48,9),r()(),l(49,"div",26)(50,"div",35)(51,"label",46),E(52,10),r(),l(53,"div",43),E(54,11),r(),c(55,"my-select-player-theme",47),r()()(),C(56,_o,25,3,"div",48),r()),o&2&&(_(4),F("formGroup",a.form),_(6),F("bannerUrl",a.videoChannelEdit.apiInfo.bannerUrl),_(),F("avatars",a.videoChannelEdit.apiInfo.avatars)("username",a.mode==="update"&&a.videoChannelEdit.channel.name)("subscribers",a.mode==="update"&&a.videoChannelEdit.apiInfo.followersCount),_(6),F("hidden",a.mode!=="create"),_(4),F("ngClass",I(15,Rt,a.formErrors.name)),_(2),ge("@",a.instanceHost),_(),p(a.formErrors.name?24:-1),_(4),F("ngClass",I(17,Rt,a.formErrors.displayName)),_(),p(a.formErrors.displayName?29:-1),_(5),F("formError",a.formErrors.description),_(9),F("formError",a.formErrors.support),_(),p(a.isBulkUpdateVideosDisplayed()?44:-1),_(12),p(a.canBeDeletedOrTransferred()?56:-1));},dependencies:[De,ke,j,$n,vn,he,Pn,Fe,Vn,yn,Lt,Ct,it,_t,ot,Dt,dt,W,en,Oe,Nt],styles:[`my-actor-banner-edit[_ngcontent-%COMP%]{max-width:500px}input[type=text][_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:340px;max-width:340px;color:var(--input-fg);background-color:var(--input-bg);border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}input[type=text][_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}input[type=text][readonly][_ngcontent-%COMP%]{color:var(--fg-300)}input[type=text][_ngcontent-%COMP%]:focus, input[type=text][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}input[type=text][disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:380px){input[type=text][_ngcontent-%COMP%]{width:100%}}input[type=submit][_ngcontent-%COMP%]{margin-inline-start:auto}.markdown-block[_ngcontent-%COMP%]{max-width:500px}my-select-player-theme[_ngcontent-%COMP%]{display:block;width:340px}@media screen and (max-width:370px){my-select-player-theme[_ngcontent-%COMP%]{width:100%}}.danger-zone[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{color:var(--red);font-weight:700;font-size:1rem}
7/*# sourceMappingURL=video-channel-edit-general.component-YJQ463N2.css.map */`]}));let e=i;return e;})();var lo=(e,i)=>i.id;function so(e,i){e&1&&(l(0,"span",28),E(1,13),r());}function co(e,i){if(e&1&&c(0,"my-action-dropdown",37),e&2){let n=s().$implicit,t=s();F("actions",t.collaboratorActions)("entry",n);}}function Fo(e,i){if(e&1&&(l(0,"div",24),c(1,"my-actor-avatar",25),l(2,"div")(3,"div",34),E(4,14),r(),l(5,"div",35),c(6,"my-collaborator-state",36),C(7,co,1,2,"my-action-dropdown",37),r()()()),e&2){let n=i.$implicit,t=s();_(),F("actor",n.account),_(3),g(n.account.displayName),S(4),_(2),F("type",t.getCollaboratorState(n)),_(),p(t.isOwner()||t.isCollaborator(n)?7:-1);}}function uo(e,i){e&1&&(l(0,"div"),E(1,15),r());}function Eo(e,i){if(e&1){let n=z();l(0,"div",33)(1,"h4"),E(2,16),r(),l(3,"label",38),E(4,17),r(),l(5,"div",39)(6,"my-user-auto-complete",40),xe("ngModelChange",function(o){Y(n);let a=s();return Ge(a.newEditorUsername,o)||(a.newEditorUsername=o),G(o);}),r(),l(7,"my-button",41),R("click",function(){Y(n);let o=s();return G(o.addEditor());}),E(8,18),r()()();}if(e&2){let n=s();_(6),Ye("ngModel",n.newEditorUsername),_(),F("disabled",!n.newEditorUsername);}}var $t=(()=>{let i=class i{confirmService=u(Ie);notifier=u(w);channelService=u(H);editController=u(x);authService=u(U);router=u(ce);videoChannelEdit;newEditorUsername;collaboratorActions=[];storeSub;ngOnInit(){this.videoChannelEdit=this.editController.getStore(),this.storeSub=this.editController.getStoreChangesObs().subscribe(()=>{this.videoChannelEdit=this.editController.getStore();}),this.buildActions();}ngOnDestroy(){this.storeSub?.unsubscribe();}buildActions(){this.collaboratorActions=[{label:"Delete",iconName:"delete",handler:t=>pe(this,null,function*(){let o=t.state.id===ze.PENDING?"Are you sure you want to remove invitation of <strong>"+t.account.displayName+"</strong> to collaborate on your channel?":"Are you sure you want to remove <strong>"+t.account.displayName+"</strong> as a collaborator?";(yield this.confirmService.confirm(o,"Remove collaborator"))&&this.channelService.removeCollaborator(this.videoChannelEdit.channel.name,t.id).subscribe({next:()=>{this.videoChannelEdit.collaborators=this.videoChannelEdit.collaborators.filter(d=>d.id!==t.id),this.isCollaborator(t)&&(this.notifier.success("You have been removed as a collaborator from "+this.videoChannelEdit.channel.name+" channel"),this.router.navigate(["/my-library","video-channels"]));},error:d=>this.notifier.handleError(d)});})}];}getOwnerAccount(){return this.videoChannelEdit.apiInfo.ownerAccount;}getOwnerDisplayName(){return this.getOwnerAccount().displayName;}isOwner(){return this.getOwnerAccount().id===this.authService.getUser().account.id;}isCollaborator(t){return t.account.id===this.authService.getUser().account.id;}getCollaboratorState(t){if(t.state.id===ze.ACCEPTED)return"accepted";if(t.state.id===ze.PENDING)return"invited";qe.error("Cannot find collaborator state for "+t.state.id);}addEditor(){return pe(this,null,function*(){let t="Do you want to send an invitation to <strong>"+this.newEditorUsername+"</strong> to collaborate on <strong>"+this.videoChannelEdit.channel.name+"</strong>?";(yield this.confirmService.confirm(t,"Invite new editor"))&&this.channelService.inviteCollaborator(this.videoChannelEdit.channel.name,this.newEditorUsername).subscribe({next:a=>{this.videoChannelEdit.collaborators.push(a),this.newEditorUsername="";},error:a=>this.notifier.handleError(a)});});}};h(i,"\u0275fac",function(o){return new(o||i)();}),h(i,"\u0275cmp",$({type:i,selectors:[["my-video-channel-editors"]],decls:53,vars:5,consts:()=>{let t;t="Editors";let o;o="OWNER";let a;a="Current owner";let d;d="EDITORS";let m;m="Editors "+"\uFFFD#28\uFFFD"+"can:"+"\uFFFD/#28\uFFFD"+"";let v;v="Publish videos in this channel";let L;L="Manage, update, transfer or delete videos, comments, playlists of this channel";let k;k="Add or delete channel synchronization";let y;y="Update information of this channel (title, description, banner...)";let B;B="But editors "+"\uFFFD#40\uFFFD"+"cannot:"+"\uFFFD/#40\uFFFD"+"";let P;P="Delete the channel";let ee;ee="Add or remove other editors";let ne;ne="Current editors";let te;te="(you)";let ie;ie=""+"\uFFFD0\uFFFD"+"";let oe;oe="No editors at the moment";let ae;ae="New editor";let re;re="Editor handle";let _e;return _e="Invite",[t,o,a,d,m,v,L,k,y,B,P,ee,ne,te,ie,oe,ae,re,_e,[1,"form-title"],["iconName","users"],[1,"pt-two-cols"],[1,"title-col"],[1,"content-col"],[1,"collaborator-block"],["actorType","account","size","60",3,"actor"],[1,"collaborator-display-name"],[1,"fw-bold"],[1,"d-inline-block","ms-1"],["type","owner"],[1,"pt-two-cols","mt-4"],[1,"editor-explanation"],[1,"collaborators"],[1,"mt-4"],[1,"collaborator-display-name","fw-bold"],[1,"d-flex","gap-1"],[3,"type"],["container","body","buttonStyled","false","buttonIcon","chevron-down","buttonSize","small",3,"actions","entry"],["for","addEditor"],[1,"d-flex","flex-wrap","gap-3"],["inputName","addEditor",3,"ngModelChange","ngModel"],["theme","secondary",3,"click","disabled"]];},template:function(o,a){o&1&&(l(0,"div")(1,"h2",19),c(2,"my-global-icon",20),D(3),E(4,0),A(
7),r(),l(5,"div",21)(6,"div",22)(7,"h3"),E(8,1),r()(),l(9,"div",23)(10,"h4"),E(11,2),r(),l(12,"div",24),c(13,"my-actor-avatar",25),l(14,"div")(15,"div",26)(16,"span",27),V(17),r(),C(18,so,2,0,"span",28),r(),c(19,"my-collaborator-state",29),r()()()(),l(20,"div",30)(21,"div",22)(22,"h3"),E(23,3),r()(),l(24,"div",23)(25,"div",31)(26,"p"),T(27,4),c(28,"strong"),N(),r(),l(29,"ul")(30,"li"),E(31,5),r(),l(32,"li"),E(33,6),r(),l(34,"li"),E(35,7),r(),l(36,"li"),E(37,8),r()(),l(38,"p"),T(39,9),c(40,"strong"),N(),r(),l(41,"ul")(42,"li"),E(43,10),r(),l(44,"li"),E(45,11),r()()(),l(46,"h4"),E(47,12),r(),l(48,"div",32),Z(49,Fo,8,4,"div",24,lo,!1,uo,2,0,"div"),r(),C(52,Eo,9,2,"div",33),r()()()),o&2&&(_(13),F("actor",a.getOwnerAccount()),_(4),q(a.getOwnerDisplayName()),_(),p(a.isOwner()?18:-1),_(31),J(a.videoChannelEdit.collaborators),_(3),p(a.isOwner()?52:-1));},dependencies:[j,he,Xe,Fe,Je,Oe,nn,Tt,W,fe],styles:[`h4[_ngcontent-%COMP%]{margin-bottom:1rem;font-weight:700;color:var(--fg-300);font-size:1.25rem}.collaborators[_ngcontent-%COMP%]{display:flex;gap:1rem;flex-wrap:wrap}.collaborator-block[_ngcontent-%COMP%]{display:inline-block;padding:.5rem 1rem;background:var(--bg-secondary-400);gap:10px;display:flex;align-items:center;width:fit-content;border-radius:16px}.collaborator-block[_ngcontent-%COMP%] my-actor-avatar[_ngcontent-%COMP%]{display:block}my-user-auto-complete[_ngcontent-%COMP%]{display:block;width:450px}@media screen and (max-width:480px){my-user-auto-complete[_ngcontent-%COMP%]{width:100%}}my-action-dropdown[_ngcontent-%COMP%]{color:var(--fg-200)}.editor-explanation[_ngcontent-%COMP%]{color:var(--fg-200)} 8/*# sourceMappingURL=video-channel-editors.component-RZNK2ULL.css.map */`]}));let e=i;return e;})();var Fn=[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",component:Pt,data:{meta:{title:"General channel configuration"}}},{path:"editors",component:$t,data:{meta:{title:"Channel editors"}}},{path:"activities",component:Mt,data:{meta:{title:"Channel activities"}}}];var yt=Gt(xt());var Co=(0,yt.default)("peertube:main:DeferLoadingDirective"),Vt=(()=>{let i=class i{el=u(Sn);viewContainer=u(Nn);cd=u(fn);template=On(rn);loaded=ye();view;observer;ngAfterViewInit(){if(this.hasIncompatibleBrowser())return this.load();this.observer=new IntersectionObserver(t=>{let o=t[0];!o.isIntersecting||o.target!==this.el.nativeElement||(this.observer.unobserve(this.el.nativeElement),this.load());},{threshold:.1}),this.observer.observe(this.el.nativeElement);}load(){this.isLoaded()||(Co("Loading component"),this.viewContainer.clear(),this.view=this.viewContainer.createEmbeddedView(this.template(),{},0),this.loaded.emit(),this.cd.detectChanges());}isLoaded(){return this.view!=null;}ngOnDestroy(){this.view=null,this.observer&&this.observer.disconnect();}hasIncompatibleBrowser(){return!("IntersectionObserver"in window);}};h(i,"\u0275fac",function(o){return new(o||i)();}),h(i,"\u0275dir",Dn({type:i,selectors:[["","myDeferLoading",""]],contentQueries:function(o,a,d){o&1&&An(d,a.template,rn,5),o&2&&Ne();},outputs:{loaded:"loaded"}}));let e=i;return e;})();var bt=e=>["/c",e],po=()=>["/my-library","followers"],mo=e=>({channel:e}),go=e=>["/my-library/video-channels/manage",e];function So(e,i){if(e&1&&(l(0,"span",8),V(1),r()),e&2){let n=s();_(),q(n.getTotalTitle());}}function To(e,i){if(e&1){let n=z();l(0,"div",10)(1,"label",17),E(2,1),r(),l(3,"my-select-options",18),xe("ngModelChange",function(o){Y(n);let a=s();return Ge(a.displayFilter,o)||(a.displayFilter=o),G(o);}),R("ngModelChange",function(){Y(n);let o=s();return G(o.onDisplayFilterChanged());}),r()();}if(e&2){let n=s();_(3),F("items",n.displayFilterItems),Ye("ngModel",n.displayFilter);}}function No(e,i){e&1&&(l(0,"div",14),E(1,2),r());}function Do(e,i){e&1&&c(0,"my-collaborator-state",32);}function Ao(e,i){e&1&&c(0,"my-collaborator-state",33);}function ho(e,i){if(e&1&&C(0,Do,1,0,"my-collaborator-state",32)(1,Ao,1,0,"my-collaborator-state",33),e&2){let n=s().$implicit,t=s();p(t.user.isOwnerOfChannel(n)?0:t.user.isEditorOfChannel(n)?1:-1);}}function Io(e,i){if(e&1){let n=z();l(0,"my-delete-button",34),R("click",function(){Y(n);let o=s().$implicit,a=s();
8return G(a.deleteVideoChannel(o));}),r();}}function Oo(e,i){if(e&1&&c(0,"p-chart",36),e&2){let n=s(3).$index,t=s();F("data",t.videoChannelsChartData[n])("options",t.chartOptions)("ariaLabel",t.getChartAriaLabel(t.videoChannelsChartData[n]));}}function fo(e,i){if(e&1&&C(0,Oo,1,3,"p-chart",36),e&2){let n=s(2).$index,t=s();p(t.chartOptions&&t.videoChannelsChartData&&t.videoChannelsChartData[n]?0:-1);}}function Mo(e,i){e&1&&(l(0,"div",31)(1,"div",35),se(2,fo,1,1,"ng-template"),r()());}function Lo(e,i){if(e&1&&(l(0,"div",16)(1,"div",19),c(2,"my-actor-avatar",20),l(3,"div",21)(4,"div",22)(5,"a",23),V(6),r(),C(7,ho,2,1),r(),l(8,"span",24),V(9),r(),l(10,"a",25),E(11,3),r(),l(12,"div",26)(13,"span"),E(14,4),r(),l(15,"span",27),V(16,"\xB7"),r(),l(17,"span"),E(18,5),we(19,"myNumberFormatter"),r()()(),l(20,"div",28),c(21,"my-edit-button",29),C(22,Io,1,0,"my-delete-button",30),r()(),C(23,Mo,3,0,"div",31),r()),e&2){let n=i.$implicit,t=s();_(2),F("actor",n)("internalHref",I(21,bt,n.nameWithHost)),_(3),F("routerLink",I(23,bt,n.nameWithHost)),_(),q(n.displayName),_(),p(t.user.isCollaboratingToChannels()?7:-1),_(2),q(n.nameWithHost),_(),F("routerLink",In(25,po))("queryParams",I(26,mo,n.name)),_(),g(n.followersCount)(n.followersCount),S(11),_(),hn("opacity-0",n.totalViews===void 0),_(2),g(n.videosCount)(n.videosCount),S(14),_(5),g(n.totalViews)(He(19,19,n.totalViews)),S(18),_(2),F("ptRouterLink",I(28,go,n.nameWithHost)),_(),p(t.isOwned(n)?22:-1),_(),p(t.isInSmallView?-1:23);}}var Yt=(()=>{let i=class i{authService=u(U);notifier=u(w);confirmService=u(Ie);videoChannelService=u(H);screenService=u(Qn);route=u(Be);peertubeRouter=u(Wn);videoChannels=[];videoChannelsChartData;chartOptions;search;
8onChannelDataSubject=new Se();pagination={currentPage:1,itemsPerPage:10,totalItems:null};displayFilter="all";displayFilterItems=[{id:"all",label:"All channels"},{id:"owned",label:"Only channels owned by me"}];pagesDone=new Set();get isInSmallView(){return this.screenService.isInSmallView();}get user(){return this.authService.getUser();}ngOnInit(){this.route.snapshot.queryParamMap.get("displayFilter")==="owned"&&(this.displayFilter="owned");}isOwned(t){return t.ownerAccount.id===this.authService.getUser().account.id;}onDisplayFilterChanged(){this.peertubeRouter.silentNavigate([],on(le({},this.route.snapshot.queryParams),{displayFilter:this.displayFilter==="all"?null:this.displayFilter})),this.resetDataAndReload();}onSearch(t){this.search=t,this.resetDataAndReload();}resetDataAndReload(){We(this.pagination),this.videoChannels=[],this.pagesDone.clear(),this.loadMoreVideoChannels();}deleteVideoChannel(t){this.videoChannelService.removeWithConfirmation(t).subscribe({next:o=>{o&&(this.videoChannels=this.videoChannels.filter(a=>a.id!==t.id),this.notifier.success("Video channel "+t.displayName+" deleted."),qn(this.pagination));},error:o=>this.notifier.handleError(o)});}onNearOfBottom(){je(this.pagination)&&(this.pagination.currentPage+=1,this.loadMoreVideoChannels());}loadMoreVideoChannels(){if(this.pagesDone.has(this.pagination.currentPage))return;this.pagesDone.add(this.pagination.currentPage);let t={account:this.authService.getUser().account,search:this.search,componentPagination:this.pagination,includeCollaborations:this.displayFilter==="all",sort:"-updatedAt"};this.authService.userInformationLoaded.pipe(pn()).pipe(X(()=>this.videoChannelService.listAccountChannels(t)),me(a=>{this.videoChannels=this.videoChannels.concat(a.data),this.pagination.totalItems=a.total,this.onChannelDataSubject.next(a.data);}),X(()=>this.videoChannelService.listAccountChannels(on(le({},t),{withStats:!0})))).subscribe({next:a=>{for(let d of a.data){let m=this.videoChannels.find(v=>v.id===d.id);m.viewsPerDay=d.viewsPerDay,m.videosCount=d.videosCount,m.totalViews=d.totalViews;}this.videoChannelsChartData=this.videoChannels.map(d=>({labels:d.viewsPerDay.map(m=>m.date.toLocaleDateString()),datasets:[{label:"Views for the day",data:d.viewsPerDay.map(m=>m.views),fill:!1,borderColor:"#c6c6c6"}],total:d.viewsPerDay.map(m=>m.views).reduce((m,v)=>m+v,0),startDate:d.viewsPerDay.length!==0?d.viewsPerDay[0].date.toLocaleDateString():""})),this.buildChartOptions();},error:a=>this.notifier.handleError(a)});}buildChartOptions(){let t=Math.min(...this.videoChannels.map(a=>xn(a.viewsPerDay,"views").views)),o=Math.max(...this.videoChannels.map(a=>Gn(a.viewsPerDay,"views").views));this.chartOptions={plugins:{legend:{display:!1},tooltip:{mode:"index",intersect:!1,external:function({tooltip:a}){a&&(a.options.displayColors=!1);},callbacks:{label:a=>`${a.formattedValue} views`}}},scales:{x:{display:!1},y:{display:!1,min:Math.max(0,t-3*o/100),max:Math.max(1,o)}},layout:{padding:{left:15,right:15,top:10,bottom:0}},elements:{point:{radius:0}},hover:{mode:"index",intersect:!1}};}getChartAriaLabel(t){return t.startDate?sn(""+t.total+" {value, plural, =1 {view} other {views}} since "+t.startDate+"",{value:t.total}):"";}getTotalTitle(){return sn(""+this.pagination.totalItems+" {total, plural, =1 {channel} other {channels}}",{total:this.pagination.totalItems});}};h(i,"\u0275fac",function(o){return new(o||i)();}),h(i,"\u0275cmp",$({type:i,selectors:[["ng-component"]],decls:14,vars:5,consts:()=>{let t;t="Search a channel";let o;o="Create video channel";let a;a="Filter";let d;d="No channel found.";let m;m="Channel page";let v;v="Manage";let L;L="{VAR_PLURAL, plural, =0 {No subscribers} =1 {1 subscriber} other {{INTERPOLATION} subscribers}}",L=K(L,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let k;k=" "+L+" ";let y;y="{VAR_PLURAL, plural, =0 {No videos} =1 {1 video} other {{INTERPOLATION} videos}}",y=K(y,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let B;return B="{VAR_PLURAL, plural, =0 {No views} =1 {1 view} other {{INTERPOLATION} views}}",B=K(B,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"}),[o,a,d,k,y,B,[3,"hideLink"],[1,"d-flex","align-items-end","gap-2","flex-wrap","mb
8-4"],[1,"total-items"],["emitOnInit","true","placeholder",t,1,"d-block","ms-auto",3,"search"],[1,"d-flex","align-items-center"],["routerLink","/manage/create",1,"peertube-create-button"],["iconName","add","aria-hidden","true"],[1,"results-container"],[1,"no-results"],["myInfiniteScroller","",1,"video-channels",3,"nearOfBottom","dataObservable"],[1,"channel"],["for","display-filter",1,"label-inline"],["inputId","display-filter",3,"ngModelChange","items","ngModel"],[1,"channel-info"],["actorType","channel","size","120",3,"actor","internalHref"],[1,"metadata"],[1,"min-width-0","d-flex","flex-wrap","w-fit-content","align-items-center"],["title",m,1,"display-name",3,"routerLink"],[1,"handle"],[1,"followers",3,"routerLink","queryParams"],[1,"videos-info"],[1,"mx-1"],[1,"buttons"],["label",v,3,"ptRouterLink"],["label",""],[1,"w-100","d-flex","justify-content-end","chart-container"],["type","owner",1,"d-inline-block","ms-2"],["type","accepted",1,"d-inline-block","ms-2"],["label","",3,"click"],["myDeferLoading",""],["width","40vw","height","100px","type","line",3,"data","options","ariaLabel"]];},template:function(o,a){o&1&&(c(0,"my-channels-setup-message",6),l(1,"div",7),C(2,So,2,1,"span",8),l(3,"my-search-input",9),R("search",function(m){return a.onSearch(m);}),r(),C(4,To,4,2,"div",10),l(5,"a",11),c(6,"my-global-icon",12),D(7),E(8,0),A(),r()(),l(9,"div",13),C(10,No,2,0,"div",14),l(11,"div",15),R("nearOfBottom",function(){return a.onNearOfBottom();}),Z(12,Lo,24,30,"div",16,Pe),r()()),o&2&&(F("hideLink",!0),_(2),p(a.pagination.totalItems?2:-1),_(2),p(a.user.isCollaboratingToChannels()?4:-1),_(6),p(a.pagination.totalItems===0?10:-1),_(),F("dataObservable",a.onChannelDataSubject.asObservable()),_(),J(a.videoChannels));},dependencies:[W,j,he,Xe,Ae,At,ct,Ze,Je,Ft,at,Vt,Et,ut,tt,fe,lt],styles:[`.results-container[_ngcontent-%COMP%]{min-height:40vh}input[type=text][_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:300px;max-width:300px;color:var(--input-fg);background-color:var(--input-bg);border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}input[type=text][_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}input[type=text][readonly][_ngcontent-%COMP%]{color:var(--fg-300)}input[type=text][_ngcontent-%COMP%]:focus, input[type=text][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}input[type=text][disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:340px){input[type=text][_ngcontent-%COMP%]{width:100%}}.channel[_ngcontent-%COMP%]{margin-bottom:1.25rem;border-bottom:1px solid var(--input-border-color);min-height:130px}.channel-info[_ngcontent-%COMP%]{display:flex;gap:1rem}.metadata[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-self:flex-start;min-width:1px}.video-channel-names[_ngcontent-%COMP%]{width:fit-content;display:flex;align-items:baseline;color:var(--fg)}.video-channel-names[_ngcontent-%COMP%], .video-channel-names[_ngcontent-%COMP%]:hover, .video-channel-names[_ngcontent-%COMP%]:focus, .video-channel-names[_ngcontent-%COMP%]:active{text-decoration:none}.video-channel-names[_ngcontent-%COMP%]:focus:not(:focus-visible){outline:none}.display-name[_ngcontent-%COMP%]{font-weight:600;font-size:1.125rem}.handle[_ngcontent-%COMP%], .followers[_ngcontent-%COMP%], .videos-info[_ngcontent-%COMP%]{font-size:.875rem}.handle[_ngcontent-%COMP%]{color:var(--fg-300);margin-bottom:.5rem}.followers[_ngcontent-%COMP%]{color:var(--fg)}.buttons[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.5rem;margin-inline-start:auto}.chart-container[_ngcontent-%COMP%]{width:40vw;height:100px}@media screen and (max-width:800px){.channel-info[_ngcontent-%COMP%]{flex-direction:column;text-align:center;padding-bottom:1rem;align-items:center}.metadata[_ngcontent-%COMP%]{align-self:normal;align-items:center}.buttons[_ngcontent-%COMP%]{text-align:center;margin-inline-start:0}} 9/*# sourceMappingURL=my-video-channels.component-I6OBOWZA.css.map */`]}));let e=i;return e;})();var Ro=(e,i)=>{let n=e.params.videoChannelName,t=u(H),o=u(ce);return Cn([t.get(n),t.listCollaborators(n).pipe(an(({data:a})=>
9a)),u(ue).getChannelSettings({channelHandle:n,raw:!0})]).pipe(an(([a,d,m])=>({videoChannel:a,collaborators:d,rawPlayerSettings:m})),ve(a=>(qe.error("Cannot fetch channel information",a),o.navigate(["/401"],{state:{obj:a},skipLocationChange:!0}),Re(()=>a))));},Y_=[{path:"",component:Yt,data:{meta:{title:"My video channels"}}},{path:"create",component:ht,data:{meta:{title:"Create a new video channel"}},canDeactivate:[cn],providers:[ue,x],children:Fn},{path:"update/:videoChannelName",redirectTo:"manage/:videoChannelName"},{path:"manage/:videoChannelName",canDeactivate:[cn],component:It,data:{meta:{title:"Manage video channel"}},resolve:{data:Ro},providers:[ue,x],children:Fn}];export{Ro as channelManageResolver,Y_ as default};/**i18n:347eeb695970c32bc275618edc2e751c67145d9fc3012e70543c114a99b9e016*///# sourceMappingURL=chunk-DBDWQZBS.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.