PageSourceSearch

https://nastub.cz/client/en-US/chunk-IGQCNJRI.js

js nastub.cz collected 2026-09-26 03:41:50 UTC 96,908 bytes, 4 lines download raw bytes

1import{a as Oe,b as Wt,c as ve,d as qt,e as Ye,f as Ke}from"./chunk-XLZ2JEQS.js";import{a as Qt}from"./chunk-YSLUQBJG.js";import"./chunk-ST7YIQM5.js";import{a as jt}from"./chunk-BKXTNSK3.js";import{a as Ce}from"./chunk-RMA7H62S.js";import"./chunk-XLUHOXTY.js";import"./chunk-PAWTCKCC.js";import"./chunk-EBJRLIKG.js";import"./chunk-QAFKDTKU.js";import"./chunk-HSXFONFM.js";import{a as We}from"./chunk-ON2WJCB6.js";import"./chunk-BLK2LKKQ.js";import{a as Bt}from"./chunk-SUV5AWFV.js";import{c as zt,d as Xt}from"./chunk-E34ZYBMW.js";import"./chunk-QR2N7THX.js";import"./chunk-CGNPG6KA.js";import"./chunk-CHIACMRH.js";import"./chunk-K476KKJZ.js";import"./chunk-NLS2ZAU2.js";import"./chunk-JNJVSAX4.js";import{a as Ht}from"./chunk-MAGFQ6SX.js";import"./chunk-XMWPGOIX.js";import"./chunk-CDOBGTEI.js";import"./chunk-6EIZPDDM.js";import{a as fe}from"./chunk-TIZHTC6H.js";import{a as qe}from"./chunk-PVLLGUIK.js";import{a as ue}from"./chunk-WRXOH4RF.js";import"./chunk-KR6TB3W3.js";import{B as ge}from"./chunk-VD7KW2AX.js";import"./chunk-N7CTCF2D.js";import{c as me}from"./chunk-PMI2WQAS.js";import"./chunk-WCZC7D6F.js";import"./chunk-KUQLWNHJ.js";import{a as Q}from"./chunk-PL4XQJ5R.js";import"./chunk-2OURCR3L.js";import{b as ae,c as Gt}from"./chunk-LQJB4OYZ.js";import{a as _e}from"./chunk-C7Y6RABB.js";import"./chunk-S5FXQJQU.js";import{a as ce}from"./chunk-ACXLTRWN.js";import{a as je}from"./chunk-SX5E4KPZ.js";import"./chunk-YTA6444Z.js";import"./chunk-UXUARPKD.js";import{a as He,b as Qe}from"./chunk-IZIWCFWH.js";import{A as wt,D as Xe,t as Dt,v as Vt,w as Tt,x as Nt,z as xt}from"./chunk-6UUAXWY5.js";import{A as ie,B as re,c as Se,g as Z,h as ee,l as te,m as ne,o as It,p as oe}from"./chunk-ILKNWOFZ.js";import{a as pe}from"./chunk-NVBWSSMM.js";import{A as ut,Ab as A,Af as Lt,Ag as Be,Ba as s,Bb as Pe,Ca as p,Cb as be,Fb as S,Fd as yt,Gb as I,Hb as y,Ja as $,Jb as G,Lb as Mt,Ma as v,Md as ze,Q as Me,S as Ct,Tb as Pt,Tf as de,Ua as d,Ub as ht,Vf as B,Wa as ft,Xb as Et,Za as Fe,Ze as se,_c as $e,aa as F,bb as a,bd as X,ca as Ue,cb as c,cd as Ge,db as P,eb as T,fb as N,hb as V,i as gt,jb as q,jf as At,ka as u,kb as Y,kg as j,l as mt,la as C,lb as g,mb as K,mg as H,na as Ot,nb as J,nf as Rt,ng as Ut,pb as f,pd as at,q as Le,qb as _,qc as bt,ra as x,rg as Ft,sc as z,sg as $t,td as Ae,vf as le,wb as k,xb as L,xc as St,yb as U,yf as kt,za as vt,zb as Ee}from"./chunk-NI3LE45J.js";import{a as Re,b as ke,j as r,k as w}from"./chunk-7AP3UAUQ.js";var he=class he extends Gt{constructor(){super(...arguments);r(this,"userVideoChannels",[]);r(this,"videoPrivacies",[]);r(this,"videoCaptions",[]);r(this,"chaptersEdit",new qt());r(this,"firstStepPrivacyId");r(this,"firstStepChannelId");r(this,"loadingBar");r(this,"notifier");r(this,"authService");r(this,"serverService");r(this,"videoService");r(this,"videoCaptionService");r(this,"videoChapterService");r(this,"serverConfig");r(this,"highestPrivacy");}ngOnInit(){this.buildForm({}),Rt(this.authService).subscribe(e=>{this.userVideoChannels=e,this.firstStepChannelId=this.userVideoChannels[0].id;}),this.serverConfig=this.serverService.getHTMLConfig(),this.serverService.getVideoPrivacies().subscribe(e=>{let n=this.serverConfig.defaults.publish.privacy,{videoPrivacies:t,defaultPrivacyId:o}=this.videoService.explainedPrivacyLabels(e,n);this.videoPrivacies=t,this.firstStepPrivacyId=o,this.highestPrivacy=this.videoService.getHighestAvailablePrivacy(e);});}updateVideoAndCaptionsAndChapters(e){let{video:n,captions:t,chapters:o}=e;return this.loadingBar.useRef().start(),this.videoService.updateVideo(n).pipe(Me(()=>this.videoCaptionService.updateCaptions(n.uuid,t)),Me(()=>o?this.videoChapterService.updateChapters(n.uuid,o):gt(!0)),Ct(()=>this.loadingBar.useRef().complete()),ut(O=>{throw this.loadingBar.useRef().complete(),O;}));}isFormValid(){return w(this,null,function*(){return yield this.waitPendingCheck(),this.forceCheck(),this.form.valid;});}};r(he,"\u0275fac",(()=>{let e;return function(t){return(e||(e=Ot(he)))(t||he);};})()),r(he,"\u0275dir",Ue({type:he,features:[$]}));var W=he;function Yt(i,l){if(i&1){let e=V();a(0,"div",14)(1,"div",15),P(2,"my-global-icon",16),a(3,"div",17)(4,"label",18),g(5,0),c(),a(6,"my-select-channel",19),y("ngModelChange",function(t){u(e);let o=_();
1return I(o.firstStepChannelId,t)||(o.firstStepChannelId=t),C(t);}),c()(),a(7,"div",17)(8,"label",20),g(9,1),c(),a(10,"my-select-options",21),y("ngModelChange",function(t){u(e);let o=_();return I(o.firstStepPrivacyId,t)||(o.firstStepPrivacyId=t),C(t);}),c()(),a(11,"div",22)(12,"div",23)(13,"input",24),y("ngModelChange",function(t){u(e);let o=_();return I(o.firstStepPermanentLive,t)||(o.firstStepPermanentLive=t),C(t);}),c(),a(14,"label",25),g(15,2),c(),a(16,"span",26),A(17),c()(),a(18,"div",23)(19,"input",27),y("ngModelChange",function(t){u(e);let o=_();return I(o.firstStepPermanentLive,t)||(o.firstStepPermanentLive=t),C(t);}),c(),a(20,"label",28),g(21,3),c(),a(22,"span",26),g(23,4),c()()(),a(24,"input",29),f("click",function(){u(e);let t=_();return C(t.goLive());}),c()()();}if(i&2){let e=_();s(6),d("items",e.userVideoChannels),S("ngModel",e.firstStepChannelId),s(4),d("items",e.videoPrivacies),S("ngModel",e.firstStepPrivacyId),s(3),S("ngModel",e.firstStepPermanentLive),d("value",!1),s(4),Pe(e.getNormalLiveDescription()),s(2),S("ngModel",e.firstStepPermanentLive),d("value",!0),s(4),K(e.getPermanentLiveDescription()),J(23),s(),d("disabled",e.firstStepPermanentLive!==!0&&e.firstStepPermanentLive!==!1);}}function Kt(i,l){if(i&1&&(a(0,"my-alert",30)(1,"div"),g(2,5),c(),A(3),c()),i&2){let e=_();s(3),be(" ",e.error,`
2`);}}function Jt(i,l){if(i&1&&(a(0,"my-alert",31),g(1,6),Pt(2,"myTimeDurationFormatter"),c()),i&2){let e=_();s(2),K(ht(2,1,e.getMaxLiveDuration())),J(1);}}var ye=class ye extends W{constructor(e,n,t,o,O,M,h,E,b,m,D){super();this.formReactiveService=e;this.loadingBar=n;this.notifier=t;this.authService=o;this.serverService=O;this.videoService=M;this.videoCaptionService=h;this.videoChapterService=E;this.liveVideoService=b;this.router=m;this.hooks=D;r(this,"firstStepDone",new x());r(this,"firstStepError",new x());r(this,"firstStepPermanentLive");r(this,"isInUpdateForm",!1);r(this,"isUpdatingVideo",!1);r(this,"isOrHasGoingLive",!1);r(this,"liveVideo");r(this,"videoId");r(this,"videoUUID");r(this,"videoShortUUID");r(this,"error");}ngOnInit(){super.ngOnInit();}ngAfterViewInit(){this.hooks.runAction("action:go-live.init","video-edit");}canDeactivate(){return{canDeactivate:!0};}goLive(){if(this.isOrHasGoingLive)return;this.isOrHasGoingLive=!0;let e="Live",n={name:e,privacy:this.firstStepPrivacyId===ze.PASSWORD_PROTECTED?ze.PRIVATE:this.highestPrivacy,nsfw:this.serverConfig.instance.isNSFW,waitTranscoding:!0,permanentLive:this.firstStepPermanentLive,latencyMode:yt.DEFAULT,saveReplay:this.isReplayAllowed(),replaySettings:{privacy:ze.PRIVATE},channelId:this.firstStepChannelId},t=ke(Re({},n),{privacy:this.firstStepPrivacyId,replayPrivacy:n.replaySettings.privacy});this.form.patchValue(t),this.liveVideoService.goLive(n).subscribe({next:o=>{this.videoId=o.video.id,this.videoUUID=o.video.uuid,this.videoShortUUID=o.video.shortUUID,this.isInUpdateForm=!0,this.firstStepDone.emit(e),this.fetchVideoLive();},error:o=>{this.firstStepError.emit();let O=o.message,M=o.body;(M==null?void 0:M.code)===Ae.MAX_INSTANCE_LIVES_LIMIT_REACHED?O="Cannot create live because this instance have too many created lives":(M==null?void 0:M.code)===Ae.MAX_USER_LIVES_LIMIT_REACHED&&(O="Cannot create live because you created too many lives"),this.notifier.error(O);}});}updateSecondStep(){return w(this,null,function*(){if(!(yield this.isFormValid()))return;this.isUpdatingVideo=!0;let e=new Oe();e.patch(this.form.value),e.id=this.videoId,e.uuid=this.videoUUID,e.shortUUID=this.videoShortUUID,this.chaptersEdit.patch(this.form.value);let n=this.form.value.saveReplay,t=n?{privacy:this.form.value.replayPrivacy}:void 0,o={saveReplay:n,replaySettings:t,latencyMode:this.form.value.latencyMode,permanentLive:this.form.value.permanentLive};Le([this.updateVideoAndCaptionsAndChapters({video:e,captions:this.videoCaptions}),this.liveVideoService.updateLive(this.videoId,o)]).subscribe({next:()=>{this.isUpdatingVideo=!1,this.notifier.success("Live published."),this.router.navigateByUrl(je.buildWatchUrl(e));},error:O=>{this.error=O.message,le(),se.error(O);}});});}getMaxLiveDuration(){return this.serverConfig.live.maxDuration/1e3;}getNormalLiveDescription(){return this.isReplayAllowed()?"Stream only once, replay will replace your live":"Stream only once";}getPermanentLiveDescription(){return this.isReplayAllowed()?"Stream multiple times, replays will be separate videos":"Stream multiple times using the same URL";}isReplayAllowed(){return this.serverConfig.live.allowReplay;}fetchVideoLive(){this.liveVideoService.getVideoLive(this.videoId).subscribe({next:e=>{this.liveVideo=e;},error:e=>{this.firstStepError.emit(),this.notifier.error(e.message);}});}};r(ye,"\u0275fac",function(n){return new(n||ye)(p(ae),p(ce),p(de),p(B),p(j),p(me),p(ue),p(fe),p(We),p(X),p(H));}),r(ye,"\u0275cmp",F({type:ye,selectors:[["my-video-go-live"]],outputs:{firstStepDone:"firstStepDone",firstStepError:"firstStepError"},standalone:!0,features:[$,G],decls:7,vars:12,consts:()=>{let e;e="Update";let n;n="Go Live";let t;t="Channel";let o;o="Privacy";let O;O="Normal live";let M;M="Permanent/recurring live";let h;h=""+"\uFFFD0\uFFFD"+"";let E;E="Sorry, but something went wrong";let b;return b=" Max live duration is "+"\uFFFD0\uFFFD"+". If your live reaches this limit, it will be automatically terminated.\n",[t,o,O,M,h,E,b,["class","upload-video-container",4,"ngIf"],["type","danger",4,"ngIf"],["type","primary",4,"ngIf"],["novalidate","",3,"hidden","formGroup"],["forbidScheduledPublication","true","hideWaitTranscoding","true","displayTranscriptionInfo","false","type","go-live",3,"form","formErrors","videoCaptions","validationMessages","userVideoChannels","liveVideo"],[1,"submit-container"],["theme","primary","label",e,"icon","circle-tick",3,"click","disabled"],[1,"upload-video-container"],[1,"first-step-block"],["iconName","upload","aria-hidden","true",1,"upload-icon"],[1,"form-group"],["for","first-step-channel"],["inputId","first-step-channel",3,"ngModelChange","items","ngModel"],["for","first-step-privacy"],["
2inputId","first-step-privacy",3,"ngModelChange","items","ngModel"],[1,"form-group","live-type"],[1,"peertube-radio-container"],["type","radio","id","permanentLiveFalse",3,"ngModelChange","ngModel","value"],["for","permanentLiveFalse",1,"radio"],[1,"form-group-description"],["type","radio","id","permanentLiveTrue",3,"ngModelChange","ngModel","value"],["for","permanentLiveTrue",1,"radio"],["type","button","value",n,1,"peertube-button","primary-button",3,"click","disabled"],["type","danger"],["type","primary"]];},template:function(n,t){n&1&&(v(0,Yt,25,11,"div",7)(1,Kt,4,1,"my-alert",8)(2,Jt,3,3,"my-alert",9),a(3,"form",10),P(4,"my-video-edit",11),a(5,"div",12)(6,"my-button",13),f("click",function(){return t.updateSecondStep();}),c()()()),n&2&&(d("ngIf",!t.isInUpdateForm),s(),d("ngIf",t.error),s(),d("ngIf",t.isInUpdateForm&&t.getMaxLiveDuration()>=0),s(),d("hidden",!t.isInUpdateForm)("formGroup",t.form),s(),d("form",t.form)("formErrors",t.formErrors)("videoCaptions",t.videoCaptions)("validationMessages",t.validationMessages)("userVideoChannels",t.userVideoChannels)("liveVideo",t.liveVideo),s(2),d("disabled",!t.form.valid||t.isUpdatingVideo===!0));},dependencies:[z,pe,Ce,ie,ne,Se,It,Z,ee,te,ge,re,oe,ve,_e,Qt,Q],styles:['.peertube-select-container[_ngcontent-%COMP%]{padding:0;margin:0;width:auto;position:relative;height:min-content}@media screen and (max-width: auto){.peertube-select-container[_ngcontent-%COMP%]{width:100%}}.peertube-select-container[_ngcontent-%COMP%]:after{top:50%;right:calc(0% + 15px);content:" ";height:0;width:0;position:absolute;pointer-events:none;border:5px solid rgba(0,0,0,0);border-top-color:var(--fg-300);margin-top:-2px;z-index:100}.peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]{line-height:24px}.peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]{color:inherit;background-color:transparent;border:1px solid var(--bg-secondary-500)!important}.peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:active, .peertube-select-container[_ngcontent-%COMP%]   select.active[_ngcontent-%COMP%], .peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:focus, .peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:focus-visible{color:inherit;background-color:var(--bg-secondary-500);border-color:var(--bg-secondary-500)}.peertube-select-container[_ngcontent-%COMP%]   select.btn[_ngcontent-%COMP%]:active, .peertube-select-container[_ngcontent-%COMP%]   select.btn[_ngcontent-%COMP%]:focus-visible, .peertube-select-container[_ngcontent-%COMP%]   select.btn.show[_ngcontent-%COMP%]{color:inherit!important;background-color:var(--bg-secondary-500)!important;border-color:var(--bg-secondary-500)!important}.peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:hover{color:inherit;background-color:var(--bg-secondary-450)}.peertube-select-container[_ngcontent-%COMP%]   select[disabled][_ngcontent-%COMP%]{pointer-events:none;opacity:.8}.peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:not(.icon-only)   my-global-icon[_ngcontent-%COMP%]{color:var(--secondary-icon-color)}.peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) calc(var(--input-x-padding) + 23px) var(--input-y-padding) var(--input-x-padding);position:relative;border:1px solid var(--input-border-color)!important;-webkit-appearance:none;appearance:none;text-overflow:ellipsis;color:var(--input-fg);background:var(--input-bg);border-radius:var(--input-border-radius)}.peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:focus, .peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100)}.peertube-select-container[_ngcontent-%COMP%]   select[disabled][_ngcontent-%COMP%]{opacity:.4}my-peertube-checkbox[_ngcontent-%COMP%]{display:block;margin-bottom:1rem}my-timestamp-input[_ngcontent-%COMP%]{width:100px}.nav-tabs[_ngcontent-%COMP%]{margin-bottom:15px}.video-edit[_ngcontent-%COMP%]{height:100%;min-height:300px}.video-edit[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]{display:block;font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:100%;max-width:100%;color:var(--input-fg);background-color:var(--input-bg);border:1px solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}.video-edit[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder);font-size:14px}.video-edit[_ngcontent-%COMP%]   input[readonly][_ngcontent-%COMP%]{color:var(--fg-300)}.video-edit[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]:focus, .video-edit[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}.video-edit[_ngcontent-%COMP%]   input[disabled][_ngcontent-%COMP%]{opacity:.4}@media screen and (max-width: calc(100% + 40px)){.video-edit[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]{width:100%}}.caption-entry[_ngcontent-%COMP%]{display:flex;min-height:40px;align-items:center;flex-wrap:wrap}.caption-entry[_ngcontent-%COMP%]   a.caption-entry-label[_ngcontent-%COMP%]{color:var(--fg)}.caption-entry[_ngcontent-%COMP%]   a.caption-entry-label[_ngcontent-%COMP%], .caption-entry[_ngcontent-%COMP%]   a.caption-entry-label[_ngcontent-%COMP%]:hover, .caption-entry[_ngcontent-%COMP%]   a.caption-entry-label[_ngcontent-%COMP%]:focus, .caption-entry[_ngcontent-%COMP%]   a.caption-entry-label[_ngcontent-%COMP%]:active{text-decoration:none}.caption-entry[_ngcontent-%COMP%]   a.caption-entry-label[_ngcontent-%COMP%]:focus:not(:focus-visible){outline:none}.caption-entry[_ngcontent-%COMP%]   a.caption-entry-label[_ngcontent-%COMP%]:hover{opacity:.8}.caption-entry[_ngcontent-%COMP%]   .caption-entry-label[_ngcontent-%COMP%]{font-weight:700;min-width:100px;margin-inline-end:1.25rem}.caption-entry[_ngcontent-%COMP%]   .caption-entry-state[_ngcontent-%COMP%]{min-width:250px;margin-inline-end:.9375rem}.no-caption[_ngcontent-%COMP%]{text-align:center}.submit-container[_ngcontent-%COMP%]{text-align:end}.submit-container[_ngcontent-%COMP%]   .message-submit[_ngcontent-%COMP%]{display:inline-block;color:var(--fg-300);margin-inline-end:calc(1.28125rem + .375vw)}@media (min-width: 1200px){.submit-container[_ngcontent-%COMP%]   .message-submit[_ngcontent-%COMP%]{margin-inline-end:1.5625rem}}p-calendar[_ngcontent-%COMP%]{display:block}p-calendar[_ngcontent-%COMP%]     .p-calendar{width:100%}.form-columns[_ngcontent-%COMP%]{display:grid;grid-template-columns:66% 1fr;grid-gap:30px}.col-video-edit[_ngcontent-%COMP%]{max-width:100%;min-width:1px}.hide-chapter-label[_ngcontent-%COMP%]{height:0;opacity:0}
2.chapter[_ngcontent-%COMP%]{display:grid;grid-template-columns:auto auto minmax(150px,350px) 1fr;grid-template-rows:auto auto;column-gap:1rem}.chapter[_ngcontent-%COMP%]   .position[_ngcontent-%COMP%]{height:38px;min-width:16px;display:flex;align-items:center}.chapter[_ngcontent-%COMP%]   my-delete-button[_ngcontent-%COMP%]{width:fit-content}.chapter[_ngcontent-%COMP%]   .form-error[_ngcontent-%COMP%]{margin-top:0}@media screen and (max-width: 800px){.form-columns[_ngcontent-%COMP%]{grid-template-columns:1fr}}',".live-type[_ngcontent-%COMP%]{margin-top:15px}",'.alert.alert-danger[_ngcontent-%COMP%]{text-align:center}.alert.alert-danger[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{font-weight:600}.first-step-block[_ngcontent-%COMP%]{--input-bg: var(--bg-secondary-500);display:flex;flex-direction:column;align-items:center}.first-step-block[_ngcontent-%COMP%]   .upload-icon[_ngcontent-%COMP%]{width:90px;margin-bottom:25px;color:var(--fg-300)}.first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]{padding:0;margin:0;width:275px;position:relative;height:min-content}@media screen and (max-width: 275px){.first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]{width:100%}}.first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]:after{top:50%;right:calc(0% + 15px);content:" ";height:0;width:0;position:absolute;pointer-events:none;border:5px solid rgba(0,0,0,0);border-top-color:var(--fg-300);margin-top:-2px;z-index:100}.first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]{line-height:24px}.first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]{color:inherit;background-color:transparent;border:1px solid var(--bg-secondary-500)!important}.first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:active, .first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select.active[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:focus, .first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:focus-visible{color:inherit;background-color:var(--bg-secondary-500);border-color:var(--bg-secondary-500)}.first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select.btn[_ngcontent-%COMP%]:active, .first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select.btn[_ngcontent-%COMP%]:focus-visible, .first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select.btn.show[_ngcontent-%COMP%]{color:inherit!important;background-color:var(--bg-secondary-500)!important;border-color:var(--bg-secondary-500)!important}.first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:hover{color:inherit;background-color:var(--bg-secondary-450)}.first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select[disabled][_ngcontent-%COMP%]{pointer-events:none;opacity:.8}.first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:not(.icon-only)   my-global-icon[_ngcontent-%COMP%]{color:var(--secondary-icon-color)}.first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) calc(var(--input-x-padding) + 23px) var(--input-y-padding) var(--input-x-padding);position:relative;border:1px solid var(--input-border-color)!important;-webkit-appearance:none;appearance:none;text-overflow:ellipsis;color:var(--input-fg);background:var(--input-bg);border-radius:var(--input-border-radius)}.first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:focus, .first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100)}.first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select[disabled][_ngcontent-%COMP%]{opacity:.4}.first-step-block[_ngcontent-%COMP%]   my-select-channel[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%]   my-select-options[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%]   .peertube-radio-container[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%]   .form-group-description[_ngcontent-%COMP%]{display:block;width:275px}@media screen and (max-width: 275px){.first-step-block[_ngcontent-%COMP%]   my-select-channel[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%]   my-select-options[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%]   .peertube-radio-container[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%]   .form-group-description[_ngcontent-%COMP%]{width:100%}}.first-step-block[_ngcontent-%COMP%]   .form-group-description[_ngcontent-%COMP%]{white-space:nowrap}.first-step-block[_ngcontent-%COMP%]   input[type=text][_ngcontent-%COMP%]{display:block;font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:275px;max-width:275px;color:var(--input-fg);background-color:var(--input-bg);border:1px solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}.first-step-block[_ngcontent-%COMP%]   input[type=text][_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder);font-size:14px}.first-step-block[_ngcontent-%COMP%]   input[type=text][readonly][_ngcontent-%COMP%]{color:var(--fg-300)}.first-step-block[_ngcontent-%COMP%]   input[type=text][_ngcontent-%COMP%]:focus, .first-step-block[_ngcontent-%COMP%]   input[type=text][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}.first-step-block[_ngcontent-%COMP%]   input[type=text][disabled][_ngcontent-%COMP%]{opacity:.4}@media screen and (max-width: 315px){.first-step-block[_ngcontent-%COMP%]   input[type=text][_ngcontent-%COMP%]{width:100%}}.first-step-block[_ngcontent-%COMP%]   .button-file[_ngcontent-%COMP%]{width:max-content}']}));var Je=ye;var De=class De{constructor(){r(this,"fileDropped",new x());r(this,"dragover",!1);}onDragOver(l){l.preventDefault(),l.stopPropagation(),this.dragover=!0;}onDragLeave(l){l.preventDefault(),l.stopPropagation(),this.dragover=!1;}ondrop(l){l.preventDefault(),l.stopPropagation(),this.dragover=!1;let e=l.dataTransfer.files;e.length>0&&this.fileDropped.emit(e);}};r(De,"\u0275fac",function(e){return new(e||De)();}),r(De,"\u0275dir",Ue({type:De,selectors:[["","myDragDrop",""]],hostVars:2,hostBindings:function(e,n){e&1&&f("dragover",function(o){return n.onDragOver(o);})("dragleave",function(o){return n.onDragLeave(o);})("drop",function(o){return n.ondrop(o);}),e&2&&ft("dragover",n.dragover);},outputs:{fileDropped:"fileDropped"},standalone:!0}));var Ve=De;var en=["torrentfileInput"];function tn(i,l){i&1&&(T(0),g(1,5),N());}function nn(i,l){if(i&1){let e=V();a(0,"div",15),f("fileDropped",function(t){u(e);let o=_();return C(o.setTorrentFile(t));}),a(1,"div",16),P(2,"my-global-icon",17),a(3,"div",18)(4,"span"),g(5,1),c(),a(6,"input",19,0),f("change",function(){u(e);let t=_();return C(t.fileChange());}),c()(),P(8,"div",20),a(9,"div",21)(10,"label",22),g(11,2),c(),a(12,"my-help"),v(13,tn,2,0,"ng-template",23),c(),a(14,"input",24),y("ngModelChange",function(t){u(e);let o=_();return I(o.magnetUri,t)||(o.magnetUri=t),C(t);}),c()(),a(15,"div",25)(16,"label",26),g(17,3),c(),a(18,"my-select-channel",27),y("ngModelChange",function(t){u(e);let o=_();
2return I(o.firstStepChannelId,t)||(o.firstStepChannelId=t),C(t);}),c()(),a(19,"div",25)(20,"label",28),g(21,4),c(),a(22,"my-select-options",29),y("ngModelChange",function(t){u(e);let o=_();return I(o.firstStepPrivacyId,t)||(o.firstStepPrivacyId=t),C(t);}),c()(),a(23,"input",30),f("click",function(){u(e);let t=_();return C(t.importVideo());}),c()()();}if(i&2){let e=_();s(3),d("ngbTooltip","(extensions: .torrent)"),s(11),S("ngModel",e.magnetUri),s(4),d("items",e.userVideoChannels),S("ngModel",e.firstStepChannelId),s(4),d("items",e.videoPrivacies),S("ngModel",e.firstStepPrivacyId),s(),d("disabled",!e.isMagnetUrlValid()||e.isImportingVideo);}}function on(i,l){if(i&1&&(a(0,"my-alert",31)(1,"div"),g(2,6),c(),A(3),c()),i&2){let e=_();s(3),be(" ",e.error,`
3`);}}function rn(i,l){i&1&&(a(0,"my-alert",32),g(1,7),c());}var Te=class Te extends W{constructor(e,n,t,o,O,M,h,E,b,m,D){super();this.formReactiveService=e;this.loadingBar=n;this.notifier=t;this.authService=o;this.serverService=O;this.videoService=M;this.videoCaptionService=h;this.videoChapterService=E;this.router=b;this.videoImportService=m;this.hooks=D;r(this,"firstStepDone",new x());r(this,"firstStepError",new x());r(this,"torrentfileInput");r(this,"magnetUri","");r(this,"isImportingVideo",!1);r(this,"hasImportedVideo",!1);r(this,"isUpdatingVideo",!1);r(this,"video");r(this,"error");}ngOnInit(){super.ngOnInit();}ngAfterViewInit(){this.hooks.runAction("action:video-torrent-import.init","video-edit");}canDeactivate(){return{canDeactivate:!0};}isMagnetUrlValid(){return!!this.magnetUri;}fileChange(){let e=this.torrentfileInput.nativeElement.files[0];e&&this.importVideo(e);}setTorrentFile(e){this.torrentfileInput.nativeElement.files=e,this.fileChange();}importVideo(e){this.isImportingVideo=!0;let n={privacy:this.highestPrivacy,waitTranscoding:!1,channelId:this.firstStepChannelId};this.loadingBar.useRef().start(),this.videoImportService.importVideoTorrent(e||this.magnetUri,n).pipe(Me(({video:t})=>this.videoService.getVideo({videoId:t.uuid}))).subscribe({next:t=>{this.loadingBar.useRef().complete(),this.firstStepDone.emit(t.name),this.isImportingVideo=!1,this.hasImportedVideo=!0,this.video=new Oe(t),this.video.patch({privacy:this.firstStepPrivacyId}),Ye(this.form,this.video,!1);},error:t=>{this.loadingBar.useRef().complete(),this.isImportingVideo=!1,this.firstStepError.emit();let o=t.message,O=t.body;(O==null?void 0:O.code)===Ae.INCORRECT_FILES_IN_TORRENT&&(o="Torrents with only 1 file are supported."),this.notifier.error(o);}});}updateSecondStep(){return w(this,null,function*(){(yield this.isFormValid())&&(this.video.patch(this.form.value),this.chaptersEdit.patch(this.form.value),this.isUpdatingVideo=!0,this.updateVideoAndCaptionsAndChapters({video:this.video,captions:this.videoCaptions,chapters:this.chaptersEdit}).subscribe({next:()=>{this.isUpdatingVideo=!1,this.notifier.success("Video to import updated."),this.router.navigate(["/my-library","video-imports"]);},error:e=>{this.error=e.message,le(),se.error(e);}}));});}};r(Te,"\u0275fac",function(n){return new(n||Te)(p(ae),p(ce),p(de),p(B),p(j),p(me),p(ue),p(fe),p(X),p(qe),p(H));}),r(Te,"\u0275cmp",F({type:Te,selectors:[["my-video-import-torrent"]],viewQuery:function(n,t){if(n&1&&k(en,5),n&2){let o;L(o=U())&&(t.torrentfileInput=o.first);}},outputs:{firstStepDone:"firstStepDone",firstStepError:"firstStepError"},standalone:!0,features:[$,G],decls:7,vars:11,consts:()=>{let e;e="Update";let n;n="Select the torrent to import";let t;t="OR";let o;o="Import";let O;O="Select the torrent to import";let M;M="Paste magnet URI";let h;h="Channel";let E;E="Privacy";let b;b=" You can import any torrent file that points to a media file. You should make sure you have diffusion rights over the content it points to, otherwise it could cause legal trouble to yourself and your instance. ";let m;m="Sorry, but something went wrong";let D;return D=" Congratulations, the video will be imported with BitTorrent! You can already add information about this video.\n",[["torrentfileInput",""],O,M,h,E,b,m,D,["class","upload-video-container","myDragDrop","",3,"fileDropped",4,"ngIf"],["type","danger",4,"ngIf"],["type","primary",4,"ngIf"],["novalidate","",3,"hidden","formGroup"],["forbidScheduledPublication","true","type","import-torrent",3,"form","formErrors","videoCaptions","validationMessages","userVideoChannels"],[1,"submit-container"],["theme","primary","label",e,"icon","circle-tick",3,"click","disabled"],["myDragDrop","",1,"upload-video-container",3,"fileDropped"],[1,"first-step-block"],["iconName","upload","aria-hidden","true",1,"upload-icon"],[1,"button-file","primary-button","form-control",3,"ngbTooltip"],["aria-label",n,"type","file","name","torrentfile","id","torrentfile","accept",".torrent",3,"change"],["data-content",t,1,"torrent-or-magnet"],[1,"form-group","form-group-magnet-uri"],["for","magnetUri"],["ptTemplate","customHtml"],["type","text","id","magnetUri",1,"form-control",3,"ngModelChange","ngModel"],[1,"form-group"],["for","first-step-channel"],["inputId","first-step-channel",3,"ngModelChange","items","ngModel"],["for","first-step-privacy"],["
3inputId","first-step-privacy",3,"ngModelChange","items","ngModel"],["type","button","value",o,1,"peertube-button","primary-button",3,"click","disabled"],["type","danger"],["type","primary"]];},template:function(n,t){n&1&&(v(0,nn,24,7,"div",8)(1,on,4,1,"my-alert",9)(2,rn,2,0,"my-alert",10),a(3,"form",11),P(4,"my-video-edit",12),a(5,"div",13)(6,"my-button",14),f("click",function(){return t.updateSecondStep();}),c()()()),n&2&&(d("ngIf",!t.hasImportedVideo),s(),d("ngIf",t.error),s(),d("ngIf",t.hasImportedVideo&&!t.error),s(),d("hidden",!t.hasImportedVideo)("formGroup",t.form),s(),d("form",t.form)("formErrors",t.formErrors)("videoCaptions",t.videoCaptions)("validationMessages",t.validationMessages)("userVideoChannels",t.userVideoChannels),s(2),d("disabled",!t.form.valid||t.isUpdatingVideo===!0));},dependencies:[z,Ve,pe,Xe,Qe,He,ie,ne,Se,Z,ee,te,Ce,ge,re,oe,ve,_e,Q],styles:['.peertube-select-container[_ngcontent-%COMP%]{padding:0;margin:0;width:auto;position:relative;height:min-content}@media screen and (max-width: auto){.peertube-select-container[_ngcontent-%COMP%]{width:100%}}.peertube-select-container[_ngcontent-%COMP%]:after{top:50%;right:calc(0% + 15px);content:" ";height:0;width:0;position:absolute;pointer-events:none;border:5px solid rgba(0,0,0,0);border-top-color:var(--fg-300);margin-top:-2px;z-index:100}.peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]{line-height:24px}.peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]{color:inherit;background-color:transparent;border:1px solid var(--bg-secondary-500)!important}.peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:active, .peertube-select-container[_ngcontent-%COMP%]   select.active[_ngcontent-%COMP%], .peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:focus, .peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:focus-visible{color:inherit;background-color:var(--bg-secondary-500);border-color:var(--bg-secondary-500)}.peertube-select-container[_ngcontent-%COMP%]   select.btn[_ngcontent-%COMP%]:active, .peertube-select-container[_ngcontent-%COMP%]   select.btn[_ngcontent-%COMP%]:focus-visible, .peertube-select-container[_ngcontent-%COMP%]   select.btn.show[_ngcontent-%COMP%]{color:inherit!important;background-color:var(--bg-secondary-500)!important;border-color:var(--bg-secondary-500)!important}.peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:hover{color:inherit;background-color:var(--bg-secondary-450)}.peertube-select-container[_ngcontent-%COMP%]   select[disabled][_ngcontent-%COMP%]{pointer-events:none;opacity:.8}.peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:not(.icon-only)   my-global-icon[_ngcontent-%COMP%]{color:var(--secondary-icon-color)}.peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) calc(var(--input-x-padding) + 23px) var(--input-y-padding) var(--input-x-padding);position:relative;border:1px solid var(--input-border-color)!important;-webkit-appearance:none;appearance:none;text-overflow:ellipsis;color:var(--input-fg);background:var(--input-bg);border-radius:var(--input-border-radius)}.peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:focus, .peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100)}.peertube-select-container[_ngcontent-%COMP%]   select[disabled][_ngcontent-%COMP%]{opacity:.4}my-peertube-checkbox[_ngcontent-%COMP%]{display:block;margin-bottom:1rem}my-timestamp-input[_ngcontent-%COMP%]{width:100px}.nav-tabs[_ngcontent-%COMP%]{margin-bottom:15px}.video-edit[_ngcontent-%COMP%]{height:100%;min-height:300px}.video-edit[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]{display:block;font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:100%;max-width:100%;color:var(--input-fg);background-color:var(--input-bg);border:1px solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}.video-edit[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder);font-size:14px}.video-edit[_ngcontent-%COMP%]   input[readonly][_ngcontent-%COMP%]{color:var(--fg-300)}.video-edit[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]:focus, .video-edit[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}.video-edit[_ngcontent-%COMP%]   input[disabled][_ngcontent-%COMP%]{opacity:.4}@media screen and (max-width: calc(100% + 40px)){.video-edit[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]{width:100%}}.caption-entry[_ngcontent-%COMP%]{display:flex;min-height:40px;align-items:center;flex-wrap:wrap}.caption-entry[_ngcontent-%COMP%]   a.caption-entry-label[_ngcontent-%COMP%]{color:var(--fg)}.caption-entry[_ngcontent-%COMP%]   a.caption-entry-label[_ngcontent-%COMP%], .caption-entry[_ngcontent-%COMP%]   a.caption-entry-label[_ngcontent-%COMP%]:hover, .caption-entry[_ngcontent-%COMP%]   a.caption-entry-label[_ngcontent-%COMP%]:focus, .caption-entry[_ngcontent-%COMP%]   a.caption-entry-label[_ngcontent-%COMP%]:active{text-decoration:none}.caption-entry[_ngcontent-%COMP%]   a.caption-entry-label[_ngcontent-%COMP%]:focus:not(:focus-visible){outline:none}.caption-entry[_ngcontent-%COMP%]   a.caption-entry-label[_ngcontent-%COMP%]:hover{opacity:.8}.caption-entry[_ngcontent-%COMP%]   .caption-entry-label[_ngcontent-%COMP%]{font-weight:700;min-width:100px;margin-inline-end:1.25rem}.caption-entry[_ngcontent-%COMP%]   .caption-entry-state[_ngcontent-%COMP%]{min-width:250px;margin-inline-end:.9375rem}.no-caption[_ngcontent-%COMP%]{text-align:center}.submit-container[_ngcontent-%COMP%]{text-align:end}.submit-container[_ngcontent-%COMP%]   .message-submit[_ngcontent-%COMP%]{display:inline-block;color:var(--fg-300);margin-inline-end:calc(1.28125rem + .375vw)}@media (min-width: 1200px){.submit-container[_ngcontent-%COMP%]   .message-submit[_ngcontent-%COMP%]{margin-inline-end:1.5625rem}}p-calendar[_ngcontent-%COMP%]{display:block}p-calendar[_ngcontent-%COMP%]     .p-calendar{width:100%}.form-columns[_ngcontent-%COMP%]{display:grid;grid-template-columns:66% 1fr;grid-gap:30px}.col-video-edit[_ngcontent-%COMP%]{max-width:100%;min-width:1px}.hide-chapter-label[_ngcontent-%COMP%]{height:0;opacity:0}
3.chapter[_ngcontent-%COMP%]{display:grid;grid-template-columns:auto auto minmax(150px,350px) 1fr;grid-template-rows:auto auto;column-gap:1rem}.chapter[_ngcontent-%COMP%]   .position[_ngcontent-%COMP%]{height:38px;min-width:16px;display:flex;align-items:center}.chapter[_ngcontent-%COMP%]   my-delete-button[_ngcontent-%COMP%]{width:fit-content}.chapter[_ngcontent-%COMP%]   .form-error[_ngcontent-%COMP%]{margin-top:0}@media screen and (max-width: 800px){.form-columns[_ngcontent-%COMP%]{grid-template-columns:1fr}}',".first-step-block[_ngcontent-%COMP%]   .torrent-or-magnet[_ngcontent-%COMP%]{width:95%;border-top:.05rem solid var(--secondary-icon-color);height:.05rem;text-align:center;display:block;position:relative}.first-step-block[_ngcontent-%COMP%]   .torrent-or-magnet[data-content][_ngcontent-%COMP%]{margin:.8rem 0}.first-step-block[_ngcontent-%COMP%]   .torrent-or-magnet[data-content][_ngcontent-%COMP%]:after{background:var(--bg-secondary-400);color:var(--secondary-icon-color);content:attr(data-content);display:inline-block;font-size:.7rem;padding:0 .4rem;transform:translateY(-.65rem)}.first-step-block[_ngcontent-%COMP%]   .torrent-or-magnet[data-content][_ngcontent-%COMP%]{margin:1.5rem 0}.first-step-block[_ngcontent-%COMP%]   .form-group-magnet-uri[_ngcontent-%COMP%]{margin-bottom:40px}",'.alert.alert-danger[_ngcontent-%COMP%]{text-align:center}.alert.alert-danger[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{font-weight:600}.first-step-block[_ngcontent-%COMP%]{--input-bg: var(--bg-secondary-500);display:flex;flex-direction:column;align-items:center}.first-step-block[_ngcontent-%COMP%]   .upload-icon[_ngcontent-%COMP%]{width:90px;margin-bottom:25px;color:var(--fg-300)}.first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]{padding:0;margin:0;width:275px;position:relative;height:min-content}@media screen and (max-width: 275px){.first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]{width:100%}}.first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]:after{top:50%;right:calc(0% + 15px);content:" ";height:0;width:0;position:absolute;pointer-events:none;border:5px solid rgba(0,0,0,0);border-top-color:var(--fg-300);margin-top:-2px;z-index:100}.first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]{line-height:24px}.first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]{color:inherit;background-color:transparent;border:1px solid var(--bg-secondary-500)!important}.first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:active, .first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select.active[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:focus, .first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:focus-visible{color:inherit;background-color:var(--bg-secondary-500);border-color:var(--bg-secondary-500)}.first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select.btn[_ngcontent-%COMP%]:active, .first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select.btn[_ngcontent-%COMP%]:focus-visible, .first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select.btn.show[_ngcontent-%COMP%]{color:inherit!important;background-color:var(--bg-secondary-500)!important;border-color:var(--bg-secondary-500)!important}.first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:hover{color:inherit;background-color:var(--bg-secondary-450)}.first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select[disabled][_ngcontent-%COMP%]{pointer-events:none;opacity:.8}.first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:not(.icon-only)   my-global-icon[_ngcontent-%COMP%]{color:var(--secondary-icon-color)}.first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) calc(var(--input-x-padding) + 23px) var(--input-y-padding) var(--input-x-padding);position:relative;border:1px solid var(--input-border-color)!important;-webkit-appearance:none;appearance:none;text-overflow:ellipsis;color:var(--input-fg);background:var(--input-bg);border-radius:var(--input-border-radius)}.first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:focus, .first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100)}.first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select[disabled][_ngcontent-%COMP%]{opacity:.4}.first-step-block[_ngcontent-%COMP%]   my-select-channel[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%]   my-select-options[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%]   .peertube-radio-container[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%]   .form-group-description[_ngcontent-%COMP%]{display:block;width:275px}@media screen and (max-width: 275px){.first-step-block[_ngcontent-%COMP%]   my-select-channel[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%]   my-select-options[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%]   .peertube-radio-container[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%]   .form-group-description[_ngcontent-%COMP%]{width:100%}}.first-step-block[_ngcontent-%COMP%]   .form-group-description[_ngcontent-%COMP%]{white-space:nowrap}.first-step-block[_ngcontent-%COMP%]   input[type=text][_ngcontent-%COMP%]{display:block;font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:275px;max-width:275px;color:var(--input-fg);background-color:var(--input-bg);border:1px solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}.first-step-block[_ngcontent-%COMP%]   input[type=text][_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder);font-size:14px}.first-step-block[_ngcontent-%COMP%]   input[type=text][readonly][_ngcontent-%COMP%]{color:var(--fg-300)}.first-step-block[_ngcontent-%COMP%]   input[type=text][_ngcontent-%COMP%]:focus, .first-step-block[_ngcontent-%COMP%]   input[type=text][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}.first-step-block[_ngcontent-%COMP%]   input[type=text][disabled][_ngcontent-%COMP%]{opacity:.4}@media screen and (max-width: 315px){.first-step-block[_ngcontent-%COMP%]   input[type=text][_ngcontent-%COMP%]{width:100%}}.first-step-block[_ngcontent-%COMP%]   .button-file[_ngcontent-%COMP%]{width:max-content}']}));var nt=Te;var an=["videoEdit"];function cn(i,l){i&1&&(T(0),q(1,4),P(2,"a",28),Y(),N());}function sn(i,l){i&1&&(a(0,"div",29),q(1,5),P(2,"a",30),Y(),c());}function ln(i,l){if(i&1){let e=V();a(0,"div",15)(1,"div",16),P(2,"my-global-icon",17),a(3,"div",18)(4,"label",19),g(5,1),c(),a(6,"my-help"),v(7,cn,3,0,"ng-template",20),c(),a(8,"input",21),y("ngModelChange",function(t){u(e);let o=_();return I(o.targetUrl,t)||(o.targetUrl=t),C(t);}),c(),v(9,sn,3,0,"div",22),c(),a(10,"div",18)(11,"label",23),g(12,2),c(),a(13,"my-select-channel",24),y("ngModelChange",function(t){u(e);let o=_();
3return I(o.firstStepChannelId,t)||(o.firstStepChannelId=t),C(t);}),c()(),a(14,"div",18)(15,"label",25),g(16,3),c(),a(17,"my-select-options",26),y("ngModelChange",function(t){u(e);let o=_();return I(o.firstStepPrivacyId,t)||(o.firstStepPrivacyId=t),C(t);}),c()(),a(18,"input",27),f("click",function(){u(e);let t=_();return C(t.importVideo());}),c()()();}if(i&2){let e=_();s(8),S("ngModel",e.targetUrl),s(),d("ngIf",e.isChannelSyncEnabled()),s(4),d("items",e.userVideoChannels),S("ngModel",e.firstStepChannelId),s(4),d("items",e.videoPrivacies),S("ngModel",e.firstStepPrivacyId),s(),d("disabled",!e.isTargetUrlValid()||e.isImportingVideo);}}function dn(i,l){if(i&1&&(a(0,"my-alert",31)(1,"div"),g(2,6),c(),A(3),c()),i&2){let e=_();s(3),be(" ",e.error,`
4`);}}function pn(i,l){if(i&1&&(a(0,"my-alert",32),g(1,7),c()),i&2){let e=_();s(),K(e.targetUrl),J(1);}}var Ne=class Ne extends W{constructor(e,n,t,o,O,M,h,E,b,m,D){super();this.formReactiveService=e;this.loadingBar=n;this.notifier=t;this.authService=o;this.serverService=O;this.videoService=M;this.videoCaptionService=h;this.videoChapterService=E;this.router=b;this.videoImportService=m;this.hooks=D;r(this,"videoEditComponent");r(this,"firstStepDone",new x());r(this,"firstStepError",new x());r(this,"targetUrl","");r(this,"isImportingVideo",!1);r(this,"hasImportedVideo",!1);r(this,"isUpdatingVideo",!1);r(this,"video");r(this,"error");}ngOnInit(){super.ngOnInit();}ngAfterViewInit(){this.hooks.runAction("action:video-url-import.init","video-edit");}canDeactivate(){return{canDeactivate:!0};}isTargetUrlValid(){var e;return(e=this.targetUrl)==null?void 0:e.match(/https?:\/\//);}isChannelSyncEnabled(){return this.serverConfig.import.videoChannelSynchronization.enabled;}importVideo(){this.isImportingVideo=!0;let e={privacy:this.highestPrivacy,waitTranscoding:!1,channelId:this.firstStepChannelId};this.loadingBar.useRef().start(),this.videoImportService.importVideoUrl(this.targetUrl,e).pipe(Me(n=>Le([this.videoCaptionService.listCaptions(n.video.uuid),this.videoChapterService.getChapters({videoId:n.video.uuid}),this.videoService.getVideo({videoId:n.video.uuid})]).pipe(mt(([t,{chapters:o},O])=>({videoCaptions:t.data,chapters:o,video:O}))))).subscribe({next:({video:n,videoCaptions:t,chapters:o})=>{this.loadingBar.useRef().complete(),this.firstStepDone.emit(n.name),this.isImportingVideo=!1,this.hasImportedVideo=!0,this.video=new Oe(n),this.video.patch({privacy:this.firstStepPrivacyId}),this.chaptersEdit.loadFromAPI(o),this.videoCaptions=t,Ye(this.form,this.video,!0),setTimeout(()=>
4this.videoEditComponent.patchChapters(this.chaptersEdit));},error:n=>{this.loadingBar.useRef().complete(),this.isImportingVideo=!1,this.firstStepError.emit(),this.notifier.error(n.message);}});}updateSecondStep(){return w(this,null,function*(){(yield this.isFormValid())&&(this.video.patch(this.form.value),this.chaptersEdit.patch(this.form.value),this.isUpdatingVideo=!0,this.updateVideoAndCaptionsAndChapters({video:this.video,captions:this.videoCaptions,chapters:this.chaptersEdit}).subscribe({next:()=>{this.isUpdatingVideo=!1,this.notifier.success("Video to import updated."),this.router.navigate(["/my-library","video-imports"]);},error:e=>{this.error=e.message,le(),se.error(e);}}));});}};r(Ne,"\u0275fac",function(n){return new(n||Ne)(p(ae),p(ce),p(de),p(B),p(j),p(me),p(ue),p(fe),p(X),p(qe),p(H));}),r(Ne,"\u0275cmp",F({type:Ne,selectors:[["my-video-import-url"]],viewQuery:function(n,t){if(n&1&&k(an,5),n&2){let o;L(o=U())&&(t.videoEditComponent=o.first);}},outputs:{firstStepDone:"firstStepDone",firstStepError:"firstStepError"},standalone:!0,features:[$,G],decls:8,vars:11,consts:()=>{let e;e="Update";let n;n="Import";let t;t="URL";let o;o="Channel";let O;O="Privacy";let M;M=" You can import any URL "+"\uFFFD#2\uFFFD"+"supported by youtube-dl"+"\uFFFD/#2\uFFFD"+" or URL that points to a media file. You should make sure you have diffusion rights over the content it points to, otherwise it could cause legal trouble to yourself and your instance. ";let h;h=" You can also synchronize a remote channel in "+"\uFFFD#2\uFFFD"+"your library"+"\uFFFD/#2\uFFFD"+"";let E;E="Sorry, but something went wrong";let b;return b=" Congratulations, the video behind "+"\uFFFD0\uFFFD"+" will be imported! You can already add information about this video.\n",[["videoEdit",""],t,o,O,M,h,E,b,["class","upload-video-container",4,"ngIf"],["type","danger",4,"ngIf"],["type","primary",4,"ngIf"],["novalidate","",3,"hidden","formGroup"],["forbidScheduledPublication","true","type","import-url",3,"form","formErrors","videoCaptions","validationMessages","userVideoChannels"],[1,"submit-container"],["theme","primary","label",e,"icon","circle-tick",3,"click","disabled"],[1,"upload-video-container"],[1,"first-step-block"],["iconName","upload","aria-hidden","true",1,"upload-icon"],[1,"form-group"],["for","targetUrl"],["ptTemplate","customHtml"],["type","text","id","targetUrl",1,"form-control",3,"ngModelChange","ngModel"],["class","form-group-description",4,"ngIf"],["for","first-step-channel"],["inputId","first-step-channel",3,"ngModelChange","items","ngModel"],["for","first-step-privacy"],["inputId","first-step-privacy",3,"ngModelChange","items","ngModel"],["type","button","value",n,1,"peertube-button","primary-button",3,"click","disabled"],["href","https://rg3.github.io/youtube-dl/supportedsites.html","target","_blank","rel","noopener noreferrer"],[1,"form-group-description"],["routerLink","/my-library/video-channel-syncs",1,"text-decoration-underline"],["type","danger"],["type","primary"]];},template:function(n,t){if(n&1){let o=V();v(0,ln,19,7,"div",8)(1,dn,4,1,"my-alert",9)(2,pn,2,1,"my-alert",10),a(3,"form",11),P(4,"my-video-edit",12,0),a(6,"div",13)(7,"my-button",14),f("click",function(){return u(o),C(t.updateSecondStep());}),c()()();}n&2&&(d("ngIf",!t.hasImportedVideo),s(),d("ngIf",t.error),s(),d("ngIf",!t.error&&t.hasImportedVideo),s(),d("hidden",!t.hasImportedVideo)("formGroup",t.form),s(),d("form",t.form)("formErrors",t.formErrors)("videoCaptions",t.videoCaptions)("validationMessages",t.validationMessages)("userVideoChannels",t.userVideoChannels),s(3),d("disabled",!t.form.valid||t.isUpdatingVideo===!0));},dependencies:[z,pe,Qe,He,ie,ne,Se,Z,ee,te,Ge,Ce,ge,re,oe,ve,_e,Q],styles:['.peertube-select-container[_ngcontent-%COMP%]{padding:0;margin:0;width:auto;position:relative;height:min-content}@media screen and (max-width: auto){.peertube-select-container[_ngcontent-%COMP%]{width:100%}}.peertube-select-container[_ngcontent-%COMP%]:after{top:50%;right:calc(0% + 15px);content:" ";height:0;width:0;position:absolute;pointer-events:none;border:5px solid rgba(0,0,0,0);border-top-color:var(--fg-300);margin-top:-2px;z-index:100}.peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]{line-height:24px}.peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]{color:inherit;background-color:transparent;border:1px solid var(--bg-secondary-500)!important}.peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:active, .peertube-select-container[_ngcontent-%COMP%]   select.active[_ngcontent-%COMP%], .peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:focus, .peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:focus-visible{color:inherit;background-color:var(--bg-secondary-500);border-color:var(--bg-secondary-500)}.peertube-select-container[_ngcontent-%COMP%]   select.btn[_ngcontent-%COMP%]:active, .peertube-select-container[_ngcontent-%COMP%]   select.btn[_ngcontent-%COMP%]:focus-visible, .peertube-select-container[_ngcontent-%COMP%]   select.btn.show[_ngcontent-%COMP%]{color:inherit!important;background-color:var(--bg-secondary-500)!important;border-color:var(--bg-secondary-500)!important}.peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:hover{color:inherit;background-color:var(--bg-secondary-450)}.peertube-select-container[_ngcontent-%COMP%]   select[disabled][_ngcontent-%COMP%]{pointer-events:none;opacity:.8}.peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:not(.icon-only)   my-global-icon[_ngcontent-%COMP%]{color:var(--secondary-icon-color)}.peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) calc(var(--input-x-padding) + 23px) var(--input-y-padding) var(--input-x-padding);position:relative;border:1px solid var(--input-border-color)!important;-webkit-appearance:none;appearance:none;text-overflow:ellipsis;color:var(--input-fg);background:var(--input-bg);border-radius:var(--input-border-radius)}.peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:focus, .peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100)}.peertube-select-container[_ngcontent-%COMP%]   select[disabled][_ngcontent-%COMP%]{opacity:.4}my-peertube-checkbox[_ngcontent-%COMP%]{display:block;margin-bottom:1rem}my-timestamp-input[_ngcontent-%COMP%]{width:100px}.nav-tabs[_ngcontent-%COMP%]{margin-bottom:15px}.video-edit[_ngcontent-%COMP%]{height:100%;min-height:300px}.video-edit[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]{display:block;font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:100%;max-width:100%;color:var(--input-fg);background-color:var(--input-bg);border:1px solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}.video-edit[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder);font-size:14px}.video-edit[_ngcontent-%COMP%]   input[readonly][_ngcontent-%COMP%]{color:var(--fg-300)}.video-edit[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]:focus, .video-edit[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}.video-edit[_ngcontent-%COMP%]   input[disabled][_ngcontent-%COMP%]{opacity:.4}@media screen and (max-width: calc(100% + 40px)){.video-edit[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]{width:100%}}.caption-entry[_ngcontent-%COMP%]{display:flex;min-height:40px;align-items:center;flex-wrap:wrap}.caption-entry[_ngcontent-%COMP%]   a.caption-entry-label[_ngcontent-%COMP%]{color:var(--fg)}.caption-entry[_ngcontent-%COMP%]   a.caption-entry-label[_ngcontent-%COMP%], .caption-entry[_ngcontent-%COMP%]   a.caption-entry-label[_ngcontent-%COMP%]:hover, .caption-entry[_ngcontent-%COMP%]   a.caption-entry-label[_ngcontent-%COMP%]:focus, .caption-entry[_ngcontent-%COMP%]   a.caption-entry-label[_ngcontent-%COMP%]:active{text-decoration:none}.caption-entry[_ngcontent-%COMP%]   a.caption-entry-label[_ngcontent-%COMP%]:focus:not(:focus-visible){outline:none}.caption-entry[_ngcontent-%COMP%]   a.caption-entry-label[_ngcontent-%COMP%]:hover{opacity:.8}.caption-entry[_ngcontent-%COMP%]   .caption-entry-label[_ngcontent-%COMP%]{font-weight:700;min-width:100px;margin-inline-end:1.25rem}.caption-entry[_ngcontent-%COMP%]   .caption-entry-state[_ngcontent-%COMP%]{min-width:250px;margin-inline-end:.9375rem}.no-caption[_ngcontent-%COMP%]{text-align:center}.submit-container[_ngcontent-%COMP%]{text-align:end}.submit-container[_ngcontent-%COMP%]   .message-submit[_ngcontent-%COMP%]{display:inline-block;color:var(--fg-300);margin-inline-end:calc(1.28125rem + .375vw)}@media (min-width: 1200px){.submit-container[_ngcontent-%COMP%]   .message-submit[_ngcontent-%COMP%]{margin-inline-end:1.5625rem}}p-calendar[_ngcontent-%COMP%]{display:block}p-calendar[_ngcontent-%COMP%]     .p-calendar{width:100%}.form-columns[_ngcontent-%COMP%]{display:grid;grid-template-columns:66% 1fr;grid-gap:30px}.col-video-edit[_ngcontent-%COMP%]{max-width:100%;min-width:1px}.hide-chapter-label[_ngcontent-%COMP%]{height:0;opacity:0}
4.chapter[_ngcontent-%COMP%]{display:grid;grid-template-columns:auto auto minmax(150px,350px) 1fr;grid-template-rows:auto auto;column-gap:1rem}.chapter[_ngcontent-%COMP%]   .position[_ngcontent-%COMP%]{height:38px;min-width:16px;display:flex;align-items:center}.chapter[_ngcontent-%COMP%]   my-delete-button[_ngcontent-%COMP%]{width:fit-content}.chapter[_ngcontent-%COMP%]   .form-error[_ngcontent-%COMP%]{margin-top:0}@media screen and (max-width: 800px){.form-columns[_ngcontent-%COMP%]{grid-template-columns:1fr}}','.alert.alert-danger[_ngcontent-%COMP%]{text-align:center}.alert.alert-danger[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{font-weight:600}.first-step-block[_ngcontent-%COMP%]{--input-bg: var(--bg-secondary-500);display:flex;flex-direction:column;align-items:center}.first-step-block[_ngcontent-%COMP%]   .upload-icon[_ngcontent-%COMP%]{width:90px;margin-bottom:25px;color:var(--fg-300)}.first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]{padding:0;margin:0;width:275px;position:relative;height:min-content}@media screen and (max-width: 275px){.first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]{width:100%}}.first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]:after{top:50%;right:calc(0% + 15px);content:" ";height:0;width:0;position:absolute;pointer-events:none;border:5px solid rgba(0,0,0,0);border-top-color:var(--fg-300);margin-top:-2px;z-index:100}.first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]{line-height:24px}.first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]{color:inherit;background-color:transparent;border:1px solid var(--bg-secondary-500)!important}.first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:active, .first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select.active[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:focus, .first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:focus-visible{color:inherit;background-color:var(--bg-secondary-500);border-color:var(--bg-secondary-500)}.first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select.btn[_ngcontent-%COMP%]:active, .first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select.btn[_ngcontent-%COMP%]:focus-visible, .first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select.btn.show[_ngcontent-%COMP%]{color:inherit!important;background-color:var(--bg-secondary-500)!important;border-color:var(--bg-secondary-500)!important}.first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:hover{color:inherit;background-color:var(--bg-secondary-450)}.first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select[disabled][_ngcontent-%COMP%]{pointer-events:none;opacity:.8}.first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:not(.icon-only)   my-global-icon[_ngcontent-%COMP%]{color:var(--secondary-icon-color)}.first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) calc(var(--input-x-padding) + 23px) var(--input-y-padding) var(--input-x-padding);position:relative;border:1px solid var(--input-border-color)!important;-webkit-appearance:none;appearance:none;text-overflow:ellipsis;color:var(--input-fg);background:var(--input-bg);border-radius:var(--input-border-radius)}.first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:focus, .first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100)}.first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select[disabled][_ngcontent-%COMP%]{opacity:.4}.first-step-block[_ngcontent-%COMP%]   my-select-channel[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%]   my-select-options[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%]   .peertube-radio-container[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%]   .form-group-description[_ngcontent-%COMP%]{display:block;width:275px}@media screen and (max-width: 275px){.first-step-block[_ngcontent-%COMP%]   my-select-channel[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%]   my-select-options[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%]   .peertube-radio-container[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%]   .form-group-description[_ngcontent-%COMP%]{width:100%}}.first-step-block[_ngcontent-%COMP%]   .form-group-description[_ngcontent-%COMP%]{white-space:nowrap}.first-step-block[_ngcontent-%COMP%]   input[type=text][_ngcontent-%COMP%]{display:block;font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:275px;max-width:275px;color:var(--input-fg);background-color:var(--input-bg);border:1px solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}.first-step-block[_ngcontent-%COMP%]   input[type=text][_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder);font-size:14px}.first-step-block[_ngcontent-%COMP%]   input[type=text][readonly][_ngcontent-%COMP%]{color:var(--fg-300)}.first-step-block[_ngcontent-%COMP%]   input[type=text][_ngcontent-%COMP%]:focus, .first-step-block[_ngcontent-%COMP%]   input[type=text][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}.first-step-block[_ngcontent-%COMP%]   input[type=text][disabled][_ngcontent-%COMP%]{opacity:.4}@media screen and (max-width: 315px){.first-step-block[_ngcontent-%COMP%]   input[type=text][_ngcontent-%COMP%]{width:100%}}.first-step-block[_ngcontent-%COMP%]   .button-file[_ngcontent-%COMP%]{width:max-content}']}));var ot=Ne;var _n=["videofileInput"];function gn(i,l){if(i&1){let e=V();T(0),a(1,"div",28)(2,"label",29),g(3,4),c(),a(4,"div",30),q(5,5),P(6,"br"),Y(),c(),a(7,"my-preview-upload",31),y("ngModelChange",function(t){u(e);let o=_(2);return I(o.previewfileUpload,t)||(o.previewfileUpload=t),C(t);}),c()(),a(8,"div",32)(9,"my-button",33),f("click",function(){u(e);let t=_(2);return C(t.uploadAudio());}),c()(),N();}if(i&2){let e=_(2);s(7),S("ngModel",e.previewfileUpload),s(2),d("label",e.getAudioUploadLabel());}}function mn(i,l){if(i&1){let e=V();a(0,"div",16),f("fileDropped",function(t){u(e);let o=_();return C(o.onFileDropped(t));}),a(1,"div",17),P(2,"my-global-icon",18),a(3,"div",19)(4,"span"),g(5,1),c(),a(6,"input",20,0),f("change",function(t){u(e);let o=_();return C(o.onFileChange(t));}),c()(),a(8,"div",21)(9,"label",22),g(10,2),c(),a(11,"my-select-channel",23),y("ngModelChange",function(t){u(e);let o=_();
4return I(o.firstStepChannelId,t)||(o.firstStepChannelId=t),C(t);}),c()(),a(12,"div",24)(13,"label",25),g(14,3),c(),a(15,"my-select-options",26),y("ngModelChange",function(t){u(e);let o=_();return I(o.firstStepPrivacyId,t)||(o.firstStepPrivacyId=t),C(t);}),c()(),v(16,gn,10,2,"ng-container",27),c()();}if(i&2){let e=_();s(3),d("ngbTooltip","(extensions: "+e.getVideoExtensions()+")"),s(3),d("accept",e.getVideoExtensions()),s(5),d("items",e.userVideoChannels),S("ngModel",e.firstStepChannelId),s(4),d("items",e.videoPrivacies),S("ngModel",e.firstStepPrivacyId),s(),d("ngIf",e.isUploadingAudioFile);}}function un(i,l){i&1&&(a(0,"my-alert",34),g(1,6),c());}function Cn(i,l){i&1&&(a(0,"div",35),g(1,7),c());}var xe=class xe extends W{constructor(e,n,t,o,O,M,h,E,b,m,D,R,Wn,qn,Yn){super();this.formReactiveService=e;this.loadingBar=n;this.notifier=t;this.authService=o;this.serverService=O;this.videoService=M;this.videoCaptionService=h;this.videoChapterService=E;this.userService=b;this.router=m;this.hooks=D;this.resumableUploadService=R;this.metaService=Wn;this.route=qn;this.videoUploadService=Yn;r(this,"firstStepDone",new x());r(this,"firstStepError",new x());r(this,"videofileInput");r(this,"userVideoQuotaUsed",0);r(this,"userVideoQuotaUsedDaily",0);r(this,"isUploadingAudioFile",!1);r(this,"isUploadingVideo",!1);r(this,"videoUploaded",!1);r(this,"videoUploadPercents",0);r(this,"videoUploadedIds",{id:0,uuid:"",shortUUID:""});r(this,"formData");r(this,"previewfileUpload");r(this,"error");r(this,"enableRetryAfterError");r(this,"isUpdatingVideo",!1);r(this,"fileToUpload");r(this,"alreadyRefreshedToken",!1);r(this,"uploadServiceSubscription");}ngOnInit(){super.ngOnInit(),this.userService.getMyVideoQuotaUsed().subscribe(e=>{this.userVideoQuotaUsed=e.videoQuotaUsed,this.userVideoQuotaUsedDaily=e.videoQuotaUsedDaily;}),this.uploadServiceSubscription=this.resumableUploadService.events.subscribe(e=>this.onUploadVideoOngoing(e));}ngAfterViewInit(){this.hooks.runAction("action:video-upload.init","video-edit");}ngOnDestroy(){this.resumableUploadService.disconnect(),this.uploadServiceSubscription&&this.uploadServiceSubscription.unsubscribe();}canDeactivate(){let e="";return this.videoUploaded===!0?e="Your video was uploaded to your account and is private."+" "+"But associated data (tags, description...) will be lost, are you sure you want to leave this page?":e="Your video is not uploaded yet, are you sure you want to leave this page?",{canDeactivate:!this.isUploadingVideo,text:e};}updateTitle(){let e=this.form.get("name").value;this.videoUploaded?this.metaService.setTitle("Publish "+e+""):this.isUploadingAudioFile||this.isUploadingVideo?this.metaService.setTitle(`${this.videoUploadPercents}% - ${e}`):this.metaService.update(this.route.snapshot.data.meta);}getVideoExtensions(){return this.videoUploadService.getVideoExtensions().join(", ");}onUploadVideoOngoing(e){switch(e.status){case"error":{if(!this.alreadyRefreshedToken&&e.responseStatus===at.UNAUTHORIZED_401)return this.alreadyRefreshedToken=!0,this.refreshTokenAndRetryUpload();this.handleUploadError(Lt(e));break;}case"cancelled":this.isUploadingVideo=!1,this.videoUploadPercents=0,this.firstStepError.emit(),this.enableRetryAfterError=!1,this.error="",this.isUploadingAudioFile=!1;break;case"queue":this.closeFirstStep(e.name);break;case"uploading":this.videoUploadPercents=e.progress;break;case"paused":this.notifier.info("Upload on hold");break;case"complete":this.videoUploaded=!0,this.videoUploadPercents=100,this.videoUploadedIds=e==null?void 0:e.response.video;break;}this.updateTitle();}onFileDropped(e){this.videofileInput.nativeElement.files=e,this.onFileChange({target:this.videofileInput.nativeElement});}onFileChange(e){let n=e.target.files[0];if(!n)return;let t=this.authService.getUser();if(this.videoUploadService.checkQuotaAndNotify(n,t.videoQuota,this.userVideoQuotaUsed)&&this.videoUploadService.checkQuotaAndNotify(n,t.videoQuotaDaily,this.userVideoQuotaUsedDaily)){if(this.videoUploadService.isAudioFile(n.name)){this.isUploadingAudioFile=!0;return;}this.isUploadingVideo=!0,this.fileToUpload=n,this.uploadFile(n);}}uploadAudio(){this.uploadFile(this.getInputVideoFile(),this.previewfileUpload);}retryUpload(){this.enableRetryAfterError=!1,this.error="",this.uploadFile(this.fileToUpload);}cancelUpload(){this.resumableUploadService.control({action:"cancel"});}isPublishingButtonDisabled(){return!this.form.valid||this.isUpdatingVideo===!0||this.videoUploaded!==!0||!this.videoUploadedIds.id;}getAudioUploadLabel(){let e=this.getInputVideoFile();
4return e?"Upload "+e.name+"":"Upload";}updateSecondStep(){return w(this,null,function*(){if(!(yield this.isFormValid())||this.isPublishingButtonDisabled())return;let e=new Oe();e.patch(this.form.value),e.id=this.videoUploadedIds.id,e.uuid=this.videoUploadedIds.uuid,e.shortUUID=this.videoUploadedIds.shortUUID,this.chaptersEdit.patch(this.form.value),this.isUpdatingVideo=!0,this.updateVideoAndCaptionsAndChapters({video:e,captions:this.videoCaptions,chapters:this.chaptersEdit}).subscribe({next:()=>{this.isUpdatingVideo=!1,this.isUploadingVideo=!1,this.notifier.success("Video published."),this.router.navigateByUrl(je.buildWatchUrl(e));},error:n=>{this.error=n.message,le(),se.error(n);}});});}getInputVideoFile(){return this.videofileInput.nativeElement.files[0];}uploadFile(e,n){let t={waitTranscoding:!0,channelId:this.firstStepChannelId,nsfw:this.serverConfig.instance.isNSFW,privacy:this.highestPrivacy.toString(),name:this.buildVideoFilename(e.name),filename:e.name,previewfile:n};this.resumableUploadService.handleFiles(e,ke(Re({},this.videoUploadService.getNewUploadxOptions()),{metadata:t})),this.isUploadingVideo=!0;}handleUploadError(e){this.videoUploadPercents=0,this.enableRetryAfterError=!0,this.error=kt({err:e,name:"video",notifier:this.notifier,sticky:!1}),e.status===at.UNSUPPORTED_MEDIA_TYPE_415&&this.cancelUpload();}closeFirstStep(e){let n=this.buildVideoFilename(e);this.form.patchValue({name:n,privacy:this.firstStepPrivacyId,nsfw:this.serverConfig.instance.isNSFW,channelId:this.firstStepChannelId,previewfile:this.previewfileUpload}),this.firstStepDone.emit(n),this.updateTitle();}buildVideoFilename(e){let n=e.replace(/\.[^/.]+$/,""),t=n.length<3?e:n,o=110;return t.length>o&&(t=At(t,{length:o,omission:""})),t;}refreshTokenAndRetryUpload(){this.authService.refreshAccessToken().subscribe(()=>this.retryUpload());}};r(xe,"\u0275fac",function(n){return new(n||xe)(p(ae),p(ce),p(de),p(B),p(j),p(me),p(ue),p(fe),p(Be),p(X),p(H),p(zt),p($t),p($e),p(Ke));}),r(xe,"\u0275cmp",F({type:xe,selectors:[["my-video-upload"]],viewQuery:function(n,t){if(n&1&&k(_n,5),n&2){let o;L(o=U())&&(t.videofileInput=o.first);}},outputs:{firstStepDone:"firstStepDone",firstStepError:"firstStepError"},standalone:!0,features:[$,G],decls:8,vars:16,consts:()=>{let e;e="Publish";let n;n="Select the file to upload";let t;t="Select the file to upload";let o;o="Channel";let O;O="Privacy";let M;M="Edit";let h;h="Video background image";let E;E=" Image that will be merged with your audio file. "+"\uFFFD#6\uFFFD\uFFFD/#6\uFFFD"+" The chosen image will be definitive and cannot be modified. ";let b;b=" Congratulations! Your video is now available in your private library.\n";let m;return m="Publish will be available when upload is finished",[["videofileInput",""],t,o,O,h,E,b,m,["class","upload-video-container","myDragDrop","",3,"fileDropped",4,"ngIf"],[3,"cancelUpload","retry","isUploading","uploadPercents","error","uploaded","enableRetryAfterError"],["type","primary",4,"ngIf"],["novalidate","",1,"mb-3",3,"hidden","formGroup"],["forbidScheduledPublication","false","type","upload",3,"form","formErrors","videoCaptions","validationMessages","userVideoChannels"],[1,"submit-container"],["class","message-submit",4,"ngIf"],["theme","primary","label",e,"icon","circle-tick",3,"click","keydown.enter","disabled"],["myDragDrop","",1,"upload-video-container",3,"fileDropped"],[1,"first-step-block"],["iconName","upload","aria-hidden","true",1,"upload-icon"],[1,"button-file","primary-button","form-control",3,"ngbTooltip"],["aria-label",n,"id","videofile","type","file",3,"change","accept"],[1,"form-group","form-group-channel"],["for","first-step-channel"],["inputId","first-step-channel",3,"ngModelChange","items","ngModel"],[1,"form-group"],["for","first-step-privacy"],["inputId","first-step-privacy",3,"ngModelChange","items","ngModel"],[4,"ngIf"],[1,"form-group","audio-preview"],["for","previewfileUpload"],[1,"audio-image-info"],["inputLabel",M,"inputName","previewfileUpload","previewWidth","360px","previewHeight","200px",3,"ngModelChange","ngModel"],[1,"form-group","upload-audio-button"],["theme","primary","icon","upload",3,"click","label"],["type","primary"],[1,"message-submit"]];},template:function(n,t){n&1&&(v(0,mn,17,7,"div",8),a(1,"my-upload-progress",9),f("cancelUpload",function(){return t.cancelUpload();})("retry",function(){return t.retryUpload();}),c(),v(2,un,2,0,"my-alert",10),a(3,"form",11),P(4,"my-video-edit",12),a(5,"div",13),v(6,Cn,2,0,"div",14),a(7,"my-button",15),f("click",function(){return t.updateSecondStep();})("keydown.enter",function(){return t.updateSecondStep();}),c()()()),n&2&&(d("ngIf",!t.isUploadingVideo),s(),d("isUploading",t.isUploadingVideo)("uploadPercents",t.videoUploadPercents)("error",t.error)("uploaded",t.videoUploaded)("enableRetryAfterError",t.enableRetryAfterError),s(),d("ngIf",t.videoUploaded&&!t.error),s(),d("hidden",!t.isUploadingVideo)("formGroup",t.form),s(),d("form",t.form)("formErrors",t.formErrors)("videoCaptions",t.videoCaptions)("validationMessages",t.validationMessages)("userVideoChannels",t.userVideoChannels),s(2),d("ngIf",t.videoUploaded===!1),s(),d("disabled",t.isPublishingButtonDisabled()));},dependencies:[z,Ve,pe,Xe,Ce,ie,ne,Z,ee,te,ge,jt,_e,Xt,re,oe,ve,Q],styles:['.peertube-select-container[_ngcontent-%COMP%]{padding:0;margin:0;width:auto;position:relative;height:min-content}@media screen and (max-width: auto){.peertube-select-container[_ngcontent-%COMP%]{width:100%}}.peertube-select-container[_ngcontent-%COMP%]:after{top:50%;right:calc(0% + 15px);content:" ";height:0;width:0;position:absolute;pointer-events:none;border:5px solid rgba(0,0,0,0);border-top-color:var(--fg-300);margin-top:-2px;z-index:100}.peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]{line-height:24px}.peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]{color:inherit;background-color:transparent;border:1px solid var(--bg-secondary-500)!important}.peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:active, .peertube-select-container[_ngcontent-%COMP%]   select.active[_ngcontent-%COMP%], .peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:focus, .peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:focus-visible{color:inherit;background-color:var(--bg-secondary-500);border-color:var(--bg-secondary-500)}.peertube-select-container[_ngcontent-%COMP%]   select.btn[_ngcontent-%COMP%]:active, .peertube-select-container[_ngcontent-%COMP%]   select.btn[_ngcontent-%COMP%]:focus-visible, .peertube-select-container[_ngcontent-%COMP%]   select.btn.show[_ngcontent-%COMP%]{color:inherit!important;background-color:var(--bg-secondary-500)!important;border-color:var(--bg-secondary-500)!important}.peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:hover{color:inherit;background-color:var(--bg-secondary-450)}.peertube-select-container[_ngcontent-%COMP%]   select[disabled][_ngcontent-%COMP%]{pointer-events:none;opacity:.8}.peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:not(.icon-only)   my-global-icon[_ngcontent-%COMP%]{color:var(--secondary-icon-color)}.peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) calc(var(--input-x-padding) + 23px) var(--input-y-padding) var(--input-x-padding);position:relative;border:1px solid var(--input-border-color)!important;-webkit-appearance:none;appearance:none;text-overflow:ellipsis;color:var(--input-fg);background:var(--input-bg);border-radius:var(--input-border-radius)}.peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:focus, .peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100)}.peertube-select-container[_ngcontent-%COMP%]   select[disabled][_ngcontent-%COMP%]{opacity:.4}my-peertube-checkbox[_ngcontent-%COMP%]{display:block;margin-bottom:1rem}my-timestamp-input[_ngcontent-%COMP%]{width:100px}.nav-tabs[_ngcontent-%COMP%]{margin-bottom:15px}.video-edit[_ngcontent-%COMP%]{height:100%;min-height:300px}.video-edit[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]{display:block;font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:100%;max-width:100%;color:var(--input-fg);background-color:var(--input-bg);border:1px solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}.video-edit[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder);font-size:14px}.video-edit[_ngcontent-%COMP%]   input[readonly][_ngcontent-%COMP%]{color:var(--fg-300)}.video-edit[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]:focus, .video-edit[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}.video-edit[_ngcontent-%COMP%]   input[disabled][_ngcontent-%COMP%]{opacity:.4}@media screen and (max-width: calc(100% + 40px)){.video-edit[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]{width:100%}}.caption-entry[_ngcontent-%COMP%]{display:flex;min-height:40px;align-items:center;flex-wrap:wrap}.caption-entry[_ngcontent-%COMP%]   a.caption-entry-label[_ngcontent-%COMP%]{color:var(--fg)}.caption-entry[_ngcontent-%COMP%]   a.caption-entry-label[_ngcontent-%COMP%], .caption-entry[_ngcontent-%COMP%]   a.caption-entry-label[_ngcontent-%COMP%]:hover, .caption-entry[_ngcontent-%COMP%]   a.caption-entry-label[_ngcontent-%COMP%]:focus, .caption-entry[_ngcontent-%COMP%]   a.caption-entry-label[_ngcontent-%COMP%]:active{text-decoration:none}.caption-entry[_ngcontent-%COMP%]   a.caption-entry-label[_ngcontent-%COMP%]:focus:not(:focus-visible){outline:none}.caption-entry[_ngcontent-%COMP%]   a.caption-entry-label[_ngcontent-%COMP%]:hover{opacity:.8}.caption-entry[_ngcontent-%COMP%]   .caption-entry-label[_ngcontent-%COMP%]{font-weight:700;min-width:100px;margin-inline-end:1.25rem}.caption-entry[_ngcontent-%COMP%]   .caption-entry-state[_ngcontent-%COMP%]{min-width:250px;margin-inline-end:.9375rem}.no-caption[_ngcontent-%COMP%]{text-align:center}.submit-container[_ngcontent-%COMP%]{text-align:end}.submit-container[_ngcontent-%COMP%]   .message-submit[_ngcontent-%COMP%]{display:inline-block;color:var(--fg-300);margin-inline-end:calc(1.28125rem + .375vw)}@media (min-width: 1200px){.submit-container[_ngcontent-%COMP%]   .message-submit[_ngcontent-%COMP%]{margin-inline-end:1.5625rem}}p-calendar[_ngcontent-%COMP%]{display:block}p-calendar[_ngcontent-%COMP%]     .p-calendar{width:100%}.form-columns[_ngcontent-%COMP%]{display:grid;grid-template-columns:66% 1fr;grid-gap:30px}.col-video-edit[_ngcontent-%COMP%]{max-width:100%;min-width:1px}.hide-chapter-label[_ngcontent-%COMP%]{height:0;opacity:0}
4.chapter[_ngcontent-%COMP%]{display:grid;grid-template-columns:auto auto minmax(150px,350px) 1fr;grid-template-rows:auto auto;column-gap:1rem}.chapter[_ngcontent-%COMP%]   .position[_ngcontent-%COMP%]{height:38px;min-width:16px;display:flex;align-items:center}.chapter[_ngcontent-%COMP%]   my-delete-button[_ngcontent-%COMP%]{width:fit-content}.chapter[_ngcontent-%COMP%]   .form-error[_ngcontent-%COMP%]{margin-top:0}@media screen and (max-width: 800px){.form-columns[_ngcontent-%COMP%]{grid-template-columns:1fr}}',".first-step-block[_ngcontent-%COMP%]   .form-group-channel[_ngcontent-%COMP%]{margin-bottom:20px;margin-top:35px}.first-step-block[_ngcontent-%COMP%]   .audio-image-info[_ngcontent-%COMP%]{margin-bottom:10px}.first-step-block[_ngcontent-%COMP%]   .audio-preview[_ngcontent-%COMP%]{margin:30px 0}",'.alert.alert-danger[_ngcontent-%COMP%]{text-align:center}.alert.alert-danger[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{font-weight:600}.first-step-block[_ngcontent-%COMP%]{--input-bg: var(--bg-secondary-500);display:flex;flex-direction:column;align-items:center}.first-step-block[_ngcontent-%COMP%]   .upload-icon[_ngcontent-%COMP%]{width:90px;margin-bottom:25px;color:var(--fg-300)}.first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]{padding:0;margin:0;width:275px;position:relative;height:min-content}@media screen and (max-width: 275px){.first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]{width:100%}}.first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]:after{top:50%;right:calc(0% + 15px);content:" ";height:0;width:0;position:absolute;pointer-events:none;border:5px solid rgba(0,0,0,0);border-top-color:var(--fg-300);margin-top:-2px;z-index:100}.first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]{line-height:24px}.first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]{color:inherit;background-color:transparent;border:1px solid var(--bg-secondary-500)!important}.first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:active, .first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select.active[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:focus, .first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:focus-visible{color:inherit;background-color:var(--bg-secondary-500);border-color:var(--bg-secondary-500)}.first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select.btn[_ngcontent-%COMP%]:active, .first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select.btn[_ngcontent-%COMP%]:focus-visible, .first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select.btn.show[_ngcontent-%COMP%]{color:inherit!important;background-color:var(--bg-secondary-500)!important;border-color:var(--bg-secondary-500)!important}.first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:hover{color:inherit;background-color:var(--bg-secondary-450)}.first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select[disabled][_ngcontent-%COMP%]{pointer-events:none;opacity:.8}.first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:not(.icon-only)   my-global-icon[_ngcontent-%COMP%]{color:var(--secondary-icon-color)}.first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) calc(var(--input-x-padding) + 23px) var(--input-y-padding) var(--input-x-padding);position:relative;border:1px solid var(--input-border-color)!important;-webkit-appearance:none;appearance:none;text-overflow:ellipsis;color:var(--input-fg);background:var(--input-bg);border-radius:var(--input-border-radius)}.first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:focus, .first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100)}.first-step-block[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]   select[disabled][_ngcontent-%COMP%]{opacity:.4}.first-step-block[_ngcontent-%COMP%]   my-select-channel[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%]   my-select-options[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%]   .peertube-radio-container[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%]   .form-group-description[_ngcontent-%COMP%]{display:block;width:275px}@media screen and (max-width: 275px){.first-step-block[_ngcontent-%COMP%]   my-select-channel[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%]   my-select-options[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%]   .peertube-radio-container[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%]   .form-group-description[_ngcontent-%COMP%]{width:100%}}.first-step-block[_ngcontent-%COMP%]   .form-group-description[_ngcontent-%COMP%]{white-space:nowrap}.first-step-block[_ngcontent-%COMP%]   input[type=text][_ngcontent-%COMP%]{display:block;font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:275px;max-width:275px;color:var(--input-fg);background-color:var(--input-bg);border:1px solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}.first-step-block[_ngcontent-%COMP%]   input[type=text][_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder);font-size:14px}.first-step-block[_ngcontent-%COMP%]   input[type=text][readonly][_ngcontent-%COMP%]{color:var(--fg-300)}.first-step-block[_ngcontent-%COMP%]   input[type=text][_ngcontent-%COMP%]:focus, .first-step-block[_ngcontent-%COMP%]   input[type=text][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}.first-step-block[_ngcontent-%COMP%]   input[type=text][disabled][_ngcontent-%COMP%]{opacity:.4}@media screen and (max-width: 315px){.first-step-block[_ngcontent-%COMP%]   input[type=text][_ngcontent-%COMP%]{width:100%}}.first-step-block[_ngcontent-%COMP%]   .button-file[_ngcontent-%COMP%]{width:max-content}']}));var it=xe;var On=["videoUpload"],vn=["videoImportUrl"],fn=["videoImportTorrent"],Mn=["videoGoLive"],Pn=i=>({"hide-nav":i});function hn(i,l){i&1&&(a(0,"a",17),g(1,6),c());}function En(i,l){i&1&&(a(0,"a",18),g(1,7),c());}function bn(i,l){if(i&1&&v(0,hn,2,0,"a",17)(1,En,2,0,"a",18),i&2){let e=_();Fe(e.isContactFormEnabled?0:1);}}function Sn(i,l){}function In(i,l){if(i&1&&(a(0,"div",16)(1,"my-alert",19)(2,"div"),A(3),c(),v(4,Sn,0,0,"ng-template",20),c(),a(5,"div",21),P(6,"img",22),c()()),i&2){let e=_(),n=Ee(1);s(3),Pe(e.uploadMessages==null?null:e.uploadMessages.noQuota),s(),d("ngTemplateOutlet",n);}}function yn(i,l){}function Dn(i,l){if(i&1&&v(0,yn,0,0,"ng-template",20),i&2){_(3);let e=Ee(1);d("ngTemplateOutlet",e);}}function Vn(i,l){if(i&1&&(a(0,"my-alert",37)(1,"div"),A(2),c(),v(3,Dn,1,1,null,27),c()),i&2){let e=_(2);s(2),Pe(e.uploadMessages==null?null:e.uploadMessages.autoBlock),s(),d("ngIf",!e.hasNoQuotaLeft&&!e.hasNoQuotaLeftDaily);}}function Tn(i,l){}function Nn(i,l){if(i&1&&v(0,Tn,0,0,"ng-template",20),i&2){_(3);let e=Ee(1);d("ngTemplateOutlet",e);}}function xn(i,l){if(i&1&&(a(0,"my-alert",38)(1,"div"),A(2),c(),v(3,Nn,1,1,null,27),c()),i&2){let e=_(2);s(2),Pe(e.uploadMessages==null?null:e.uploadMessages.quotaLeftDaily),s(),d("ngIf",!e.hasNoQuotaLeft);}}function wn(i,l){}function An(i,l){if(i&1&&(a(0,"my-alert",39)(1,"div"),A(2),c(),v(3,wn,0,0,"ng-template",20),c()),i&2){let e=_(2),n=Ee(1);s(2),Pe(e.uploadMessages==null?null:e.uploadMessages.quotaLeft),s(),d("ngTemplateOutlet",n);}}function Rn(i,l){i&1&&(a(0,"my-alert",40),T(1),q(2,9),P(3,"strong"),Y(),N(),P(4,"br"),T(5),q(6,10),P(7,"a",41),Y(),N(),c());}function kn(i,l){i&1&&P(0,"my-user-quota");}function Ln(i,l){if(i&1&&(T(0),g(1,11),N()),i&2){let e=_(3);s(),K(e.videoName),J(1);}}function Un(i,l){if(i&1&&(T(0),g(1,12),N()),i&2){let e=_(3);s(),K(e.videoName),J(1);}}function Fn(i,l){if(i&1&&(a(0,"div",42),v(1,Ln,2,1,"ng-container")(2,Un,2,1,"ng-container"),c()),i&2){let e=_(2);s(),Fe(e.secondStepType==="import-url"||e.secondStepType==="import-torrent"?
41:e.secondStepType==="upload"?2:-1);}}function $n(i,l){if(i&1){let e=V();a(0,"my-video-upload",43,2),f("firstStepDone",function(t){u(e);let o=_(2);return C(o.onFirstStepDone("upload",t));})("firstStepError",function(){u(e);let t=_(2);return C(t.onError());}),c();}}function Gn(i,l){if(i&1){let e=V();a(0,"my-video-import-url",43,3),f("firstStepDone",function(t){u(e);let o=_(3);return C(o.onFirstStepDone("import-url",t));})("firstStepError",function(){u(e);let t=_(3);return C(t.onError());}),c();}}function zn(i,l){i&1&&(T(0,44),a(1,"a",31)(2,"span"),g(3,13),c()(),v(4,Gn,2,0,"ng-template",32),N());}function Xn(i,l){if(i&1){let e=V();a(0,"my-video-import-torrent",43,4),f("firstStepDone",function(t){u(e);let o=_(3);return C(o.onFirstStepDone("import-torrent",t));})("firstStepError",function(){u(e);let t=_(3);return C(t.onError());}),c();}}function Bn(i,l){i&1&&(T(0,45),a(1,"a",31)(2,"span"),g(3,14),c()(),v(4,Xn,2,0,"ng-template",32),N());}function jn(i,l){if(i&1){let e=V();a(0,"my-video-go-live",43,5),f("firstStepDone",function(t){u(e);let o=_(3);return C(o.onFirstStepDone("go-live",t));})("firstStepError",function(){u(e);let t=_(3);return C(t.onError());}),c();}}function Hn(i,l){i&1&&(T(0,46),a(1,"a",31)(2,"span"),g(3,15),c()(),v(4,jn,2,0,"ng-template",32),N());}function Qn(i,l){if(i&1){let e=V();a(0,"div",16),v(1,Vn,4,2,"my-alert",23)(2,xn,4,2,"my-alert",24)(3,An,4,2,"my-alert",25)(4,Rn,8,0,"my-alert",26),P(5,"my-channels-setup-message"),v(6,kn,1,0,"my-user-quota",27)(7,Fn,3,1,"div",28),a(8,"div",29,1),f("activeIdChange",function(t){u(e);let o=_();return C(o.onNavChange(t));}),T(10,30),a(11,"a",31)(12,"span"),g(13,8),c()(),v(14,$n,2,0,"ng-template",32),N(),v(15,zn,5,0,"ng-container",33)(16,Bn,5,0,"ng-container",34)(17,Hn,5,0,"ng-container",35),c(),P(18,"div",36),c();}if(i&2){let e=Ee(9),n=_();s(),d("ngIf",n.user.isAutoBlocked(n.serverConfig)),s(),d("ngIf",n.hasNoQuotaLeftDaily),s(),d("ngIf",n.hasNoQuotaLeft),s(),d("ngIf",n.isRootUser()),s(2),d("ngIf",!n.isInSecondStep()||n.secondStepType==="go-live"),s(),d("ngIf",n.isInSecondStep()),s(),d("activeId",n.activeNav)("ngClass",Mt(12,Pn,!!n.secondStepType)),s(7),d("ngIf",n.isVideoImportHttpEnabled()),s(),d("ngIf",n.isVideoImportTorrentEnabled()),s(),d("ngIf",n.isVideoLiveEnabled()),s(),d("ngbNavOutlet",e);}}var we=class we{constructor(l,e,n,t,o,O){this.auth=l;this.userService=e;this.hooks=n;this.serverService=t;this.route=o;this.router=O;r(this,"videoUpload");r(this,"videoImportUrl");r(this,"videoImportTorrent");r(this,"videoGoLive");r(this,"user",null);r(this,"secondStepType");r(this,"videoName");r(this,"activeNav");r(this,"uploadMessages");r(this,"hasNoQuotaLeft",!1);r(this,"hasNoQuotaLeftDaily",!1);r(this,"serverConfig");}get isContactFormEnabled(){return this.serverConfig.email.enabled&&this.serverConfig.contactForm.enabled;}get userInformationLoaded(){return this.auth.userInformationLoaded;}ngOnInit(){this.user=this.auth.getUser(),this.serverConfig=this.serverService.getHTMLConfig(),this.route.snapshot.fragment&&this.onNavChange(this.route.snapshot.fragment),this.buildUploadMessages(),this.userService.getMyVideoQuotaUsed().subscribe(l=>{l.videoQuotaUsed>this.user.videoQuota*.9&&(this.hasNoQuotaLeft=!0),this.user.videoQuota===-1&&(this.hasNoQuotaLeft=!1),l.videoQuotaUsedDaily>this.user.videoQuotaDaily*.9&&(this.hasNoQuotaLeftDaily=!0),this.user.videoQuotaDaily===-1&&(this.hasNoQuotaLeftDaily=!1);});}buildUploadMessages(){return w(this,null,function*(){let l="Sorry, the upload feature is disabled for your account. If you want to add videos, an admin must unlock your quota.",e="Uploaded videos are reviewed before publishing for your account. If you want to add videos without moderation review, an admin must turn off your videos auto-block.",n="Your daily video quota is insufficient. If you want to add more videos, you must wait for 24 hours or an admin must increase your daily quota.",t="Your video quota is insufficient. If you want to add more videos, an admin must increase your quota.",o={noQuota:l,autoBlock:e,quotaLeftDaily:n,quotaLeft:t};this.uploadMessages=yield this.hooks.wrapObject(o,"common","filter:upload.messages.create.result");});}onNavChange(l){this.activeNav=l,this.router.navigate([],{fragment:this.activeNav});}onFirstStepDone(l,e){this.secondStepType=l,this.videoName=e;}onError(){this.videoName=void 0,this.secondStepType=void 0;}onUnload(l){let{text:e,canDeactivate:n}=this.canDeactivate();if(!n)return l.returnValue=e,e;}canDeactivate(){return this.secondStepType==="upload"?this.videoUpload.canDeactivate():this.secondStepType==="import-url"?this.videoImportUrl.canDeactivate():this.secondStepType==="import-torrent"?this.videoImportTorrent.canDeactivate():this.secondStepType==="go-live"?this.videoGoLive.canDeactivate():{canDeactivate:!0};}isVideoImportHttpEnabled(){return this.serverConfig.import.videos.http.enabled;}isVideoImportTorrentEnabled(){return this.serverConfig.import.videos.torrent.enabled;}isVideoLiveEnabled(){return this.serverConfig.live.enabled;}isInSecondStep(){return!!this.secondStepType;}isRootUser(){return this.user.username==="root";}};r(we,"\u0275fac",function(e){return new(e||we)(p(B),p(Be),p(H),p(j),p($e),p(X));}),r(we,"\u0275cmp",F({type:we,selectors:[["my-videos-add"]],viewQuery:function(e,n){if(e&1&&(k(On,5),k(vn,5),k(fn,5),k(Mn,5)),e&2){let t;L(t=U())&&(n.videoUpload=t.first),L(t=U())&&(n.videoImportUrl=t.first),L(t=U())&&(n.videoImportTorrent=t.first),L(t=U())&&(n.videoGoLive=t.first);}},hostBindings:function(e,n){e&1&&f("beforeunload",function(o){return n.onUnload(o);},!1,vt);},standalone:!0,features:[G],decls:4,vars:1,consts:()=>{let l;l="Contact us";let e;e="Read instance rules for help";let n;n="Upload a file";let t;t="We recommend you to not use the "+"\uFFFD#3\uFFFD"+"root"+"\uFFFD/#3\uFFFD"+" user to publish your videos, since it's the super-admin account of your instance.";let o;o="Instead, "+"\uFFFD#7\uFFFD"+"create a dedicated account"+"\uFFFD/#7\uFFFD"+" to upload your videos.";let O;O="Import "+"\uFFFD0\uFFFD"+"";let M;M="Upload "+"\uFFFD0\uFFFD"+"";let h;h="Import with URL";let E;E="Import with torrent";let b;return b="Go live",[["AlertButtons",""],["nav","ngbNav"],["videoUpload",""],["videoImportUrl",""],["videoImportTorrent",""],["videoGoLive",""],l,e,n,t,o,O,M,h,E,b,[1,"margin-content"],["routerLink","/about/contact",1,"peertube-button-link","primary-button","mt-2"],["routerLink","/about/instance",1,"peertube-button-link","primary-button","mt-2"],["type","warning",1,"upload-message","upload-disabled"],[3,"ngTemplateOutlet"],[1,"upload-image"],["src","/client/assets/images/mascot/defeated.svg","alt","defeated mascot"],["class","upload-message auto-blocked","type","warning",4,"ngIf"],["class","upload-message quota-daily-left","type","warning",4,"ngIf"],["class","upload-message quota-left","type","warning",4,"ngIf"],["class","upload-message root-user root-user root-user","type","warning",4,"ngIf"],[4,"ngIf"],["class","title-page",4,"ngIf"],["ngbNav","",1,"nav-tabs","video-add-nav",3,"activeIdChange","activeId","ngClass"],["ngbNavItem","upload"],["ngbNavLink",""],["ngbNavContent",""],["ngbNavItem","import-url",4,"ngIf"],["ngbNavItem","import-torrent",4,"ngIf"],["ngbNavItem","go-live",4,"ngIf"],[1,"nav-content",3,"ngbNavOutlet"],["type","warning",1,"upload-message","auto-blocked"],["type","warning",1,"upload-message","quota-daily-left"],["type","warning",1,"upload-message","quota-left"],["type","warning",1,"upload-message","root-user","root-user","root-user"],["routerLink","/admin/overview/users",1,"text-decoration-underline","alert-link"],[1,"title-page"],[3,"firstStepDone","firstStepError"],["ngbNavItem","import-url"],["ngbNavItem","import-torrent"],["ngbNavItem","go-live"]];},template:function(e,n){e&1&&v(0,bn,2,1,"ng-template",null,0,Et)(2,In,7,2,"div",16)(3,Qn,19,14,"div",16),e&2&&(s(2),Fe(n.user.hasUploadDisabled()?2:3));},dependencies:[z,Ge,St,Bt,Ht,Tt,bt,Vt,xt,Nt,Dt,it,ot,nt,Je,wt,Q],styles:[".upload-message[_ngcontent-%COMP%]{display:block;width:100%;text-align:center;margin-bottom:0}.upload-message[_ngcontent-%COMP%]:last-child{margin-bottom:1rem}.upload-image[_ngcontent-%COMP%]{width:100%;text-align:center}.upload-image[_ngcontent-%COMP%]   img[_ngcontent-%COMP%]{margin-top:10px;margin-bottom:75px;width:220px;height:auto}@media screen and (max-height: 600px){.upload-image[_ngcontent-%COMP%]   img[_ngcontent-%COMP%]{margin-top:5px;width:160px}}[_nghost-%COMP%]     .video-add-nav{border-bottom:0 solid #fff;margin:20px 0 0!important}[_nghost-%COMP%]     .video-add-nav.hide-nav{display:none!important}
4[_nghost-%COMP%]     .video-add-nav a.nav-link{margin-bottom:0;height:40px!important;padding:0 30px!important;border:0 solid transparent}[_nghost-%COMP%]     .video-add-nav a.nav-link, [_nghost-%COMP%]     .video-add-nav a.nav-link:hover, [_nghost-%COMP%]     .video-add-nav a.nav-link:focus, [_nghost-%COMP%]     .video-add-nav a.nav-link:active{text-decoration:none}[_nghost-%COMP%]     .video-add-nav a.nav-link:focus:not(:focus-visible){outline:none}[_nghost-%COMP%]     .video-add-nav a.nav-link span{border-bottom:2px solid transparent}[_nghost-%COMP%]     .video-add-nav a.nav-link.active{border-color:#fff;border-bottom-color:transparent}[_nghost-%COMP%]     .video-add-nav a.nav-link.active span{border-bottom-color:var(--border-primary)}[_nghost-%COMP%]     .video-add-nav a.nav-link:hover:not(.active){border-color:transparent}[_nghost-%COMP%]     .video-add-nav a.nav-link.active{background-color:var(--bg-secondary-400)!important}[_nghost-%COMP%]     .upload-video-container{border:0 solid #fff;border-top:transparent;background-color:var(--bg-secondary-400);border-bottom-left-radius:3px;border-bottom-right-radius:3px;width:100%;min-height:440px;padding-bottom:20px;display:flex;justify-content:center;padding-top:20px}[_nghost-%COMP%]     .upload-video-container.dragover{border:3px dashed var(--primary)}@media screen and (max-width: 800px){  .video-add-nav{height:40px;overflow-x:auto;white-space:nowrap;flex-wrap:unset}  .video-add-nav a.nav-link.active{border-color:transparent;background-color:var(--bg)!important}}"]}));var rt=we;var $r=[{path:"",component:rt,canActivate:[Ft],canDeactivate:[Ut],providers:[We,Wt,Ke]}];export{$r as default};/**i18n:224bcada6943fe8b17ea60808c2d370cec9507c3bd670ebe71692d099a3befa1*/

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.