import{a as ee,b as ie,c as te,d as _,f as re,g as ae,h as ne}from"./chunk-5O2CSSSC.js";import{a as Z}from"./chunk-HBIQWSRE.js";import"./chunk-CNJ3GTC4.js";import{a as p}from"./chunk-56XIN6JQ.js";import"./chunk-KBE24UE7.js";import"./chunk-CF6YWA5Z.js";import"./chunk-N233L32B.js";import"./chunk-5GSL7KQK.js";import"./chunk-VNGAAXGL.js";import"./chunk-7W2BTQ7G.js";import"./chunk-ZPB5XW7M.js";import"./chunk-DB7CGSBP.js";import"./chunk-Y27JC4RP.js";import"./chunk-SVVPH7EA.js";import"./chunk-TKOCVRW4.js";import"./chunk-CZXWDFPQ.js";import"./chunk-POMUYCNP.js";import"./chunk-ZYJPIGJG.js";import"./chunk-S7ECN5JJ.js";import"./chunk-DUFNITWK.js";import"./chunk-FWHL545W.js";import{a as oe}from"./chunk-7CPAQMPP.js";import"./chunk-YXEQLTL6.js";import{a as X}from"./chunk-JFKFZOAL.js";import"./chunk-5AD6GLX2.js";import"./chunk-SB3DDGXB.js";import"./chunk-4YI6M52T.js";import{b as q,c as K}from"./chunk-CD6LKOJX.js";import"./chunk-NNPNYAL2.js";import"./chunk-575M5XIS.js";import"./chunk-VTWEWKDW.js";import"./chunk-SGGHB2SK.js";import"./chunk-UXUNYBCM.js";import"./chunk-VMNZR6KW.js";import"./chunk-DEP2WUV6.js";import"./chunk-PGFP7J7F.js";import"./chunk-WEFHHX6T.js";import"./chunk-EVSP32E6.js";import"./chunk-GT4XZXGJ.js";import"./chunk-PIPCW6JA.js";import"./chunk-BNT47SCO.js";import"./chunk-URVKOLVP.js";import"./chunk-CHNQDHBM.js";import"./chunk-XKS44PWE.js";import{C as W,D as B}from"./chunk-Q77MC6OX.js";import"./chunk-BAXSUHKY.js";import{Bb as y,Cb as H,Ch as $,Eh as v,Fa as L,Gc as R,Ha as x,Ig as z,Ih as J,Q as D,Rc as j,Sa as T,Y as P,Ya as F,Zh as Y,_b as O,aa as t,ch as G,de as N,eb as A,ha as b,ia as I,j as c,n as m,nb as C,ob as V,pd as k,r as w,tb as E,th as Q}from"./chunk-GM43ZGTR.js";import{i as n,j as M}from"./chunk-SLIYHYWC.js";function ve(a,o){if(a&1){let se=E();C(0,"my-video-manage-container",2),y("videoUpdated",function(){b(se);let e=H();return I(e.onVideoUpdated());}),V();}}var de=(()=>{let o=class o{route=t(k);serverService=t(v);notifier=t(G);manageController=t(_);isUpdatingVideo=!1;loaded=!1;ngOnInit(){return M(this,null,function*(){let i=this.route.snapshot.data.resolverData,{video:e,userChannels:r,captions:s,chapters:d,videoSource:l,live:u,videoPasswords:f,userQuota:g,privacies:S}=i,h=yield re.createFromAPI(this.serverService.getHTMLConfig(),{video:e,captions:s,chapters:d,live:u,videoSource:l,videoPasswords:f.map(ce=>ce.password)});this.manageController.setStore({videoEdit:h,userQuota:g,userChannels:r,privacies:S}),this.manageController.setConfig({manageType:"update",serverConfig:this.serverService.getHTMLConfig()}),this.loaded=!0;});}ngOnDestroy(){this.manageController.cancelUploadIfNeeded();}onVideoUpdated(){this.notifier.success("Vide\xF3 friss\xEDtve.");}onUnload(i){let{text:e,canDeactivate:r}=this.canDeactivate();if(!r)return i.returnValue=e,e;}canDeactivate(){return{canDeactivate:!this.manageController.hasPendingChanges(),text:"You have unsaved changes. Are you sure you want to leave?"};}};n(o,"\u0275fac",function(e){return new(e||o)();}),n(o,"\u0275cmp",T({type:o,selectors:[["my-video-manage"]],hostBindings:function(e,r){e&1&&y("beforeunload",function(d){return r.onUnload(d);},!1,L);},features:[O([_])],decls:2,vars:1,consts:[[1,"margin-content"],["canUpdate","true","canWatch","true","cancelLink","/my-library/videos",3,"videoUpdated",4,"ngIf"],["canUpdate","true","canWatch","true","cancelLink","/my-library/videos",3,"videoUpdated"]],template:function(e,r){e&1&&(C(0,"div",0),F(1,ve,1,0,"my-video-manage-container",1),V()),e&2&&(x(),A("ngIf",r.loaded));},dependencies:[j,R,W,B,ne],encapsulation:2}));let a=o;return a;})();var U=(()=>{let o=class o{videoService=t(K);liveVideoService=t(p);authService=t(Q);videoCaptionService=t(X);videoChapterService=t(oe);videoPasswordService=t(q);userService=t(Y);serverService=t(v);resolve(i){let e=i.params.uuid;return this.videoService.getVideo({videoId:e}).pipe(D(r=>w(this.buildObservables(r))),m(([r,s,d,l,u,f,g,S,h])=>({video:r,userChannels:d,captions:l,chapters:u,videoSource:s,live:f,videoPasswords:g,userQuota:S,privacies:h})));}buildObservables(i){return[c(i),this.videoService.getSource(i.id),z(this.authService),this.videoCaptionService.listCaptions(i.uuid).pipe(m(e=>e.data)),this.videoChapterService.getChapters({videoId:i.uuid}).pipe(m(({chapters:e})=>e)),i.isLive?this.liveVideoService.getVideoLive(i.id):c(void 0),i.privacy.id===N.PASSWORD_PROTECTED?this.videoPasswordService.getVideoPasswords({videoUUID:i.uuid}):c([]),this.userService.getMyVideoQuotaUsed(),this.serverService.getVideoPrivacies()];}};n(o,"\u0275fac",function(e){return new(e||o)();}),n(o,"\u0275prov",P({token:o,factory:o.ɵfac}));let a=o;return a;})();var Je=[{path:"",component:de,canActivate:[J],canDeactivate:[$],providers:[U,p,ee,ie,te,Z],resolve:{resolverData:U},children:ae}];export{Je as default};/**i18n:aa38438cfc6bb6877c9985433629bf5f310ba8cfd6183982ad2c0c8f601d3935*///# sourceMappingURL=chunk-TAAWSBLS.js.map