import{Z}from'./chunk-uAC8t5Px.js';import{L as qp,bK as sn,b_ as vx,bR as ye,dK as sIe,g,a as rc,C as Cpe,aL as Ye,b as Pa,J as Jn,Z as Zn,a0 as $n,cn as rn,Q as Qn,s as sp,F as Fp,y as yV,u as ub,e as Pp,t as GH,z as zB,a3 as B0,W as WH}from'./main-sJAtkqeq.js';import{o as or,m as mn,f as fn,c as cn,g as gn,E as En}from'./chunk-z3i9wMnz.js';var c=(()=>{class r{myFormInputError=qp.required();hasError(){return this.myFormInputError().touched()&&this.myFormInputError().invalid();}static ɵfac=function(t){return new(t||r)();};static ɵdir=sn({type:r,selectors:[["","myFormInputError",""]],hostVars:2,hostBindings:function(t,m){t&2&&vx("input-error",m.hasError());},inputs:{myFormInputError:[1,"myFormInputError"]}});}return r;})();/**i18n:fad79908930cbb4c308e7550a5fe49bb3841dbb330066a6429aebaa006173605*/var Y={VALIDATORS:[ye.required,ye.minLength(1),ye.maxLength(120)],MESSAGES:{required:"N\xE4ytt\xF6nimi vaaditaan.",minlength:"N\xE4ytt\xF6nimess\xE4 pit\xE4\xE4 olla ainakin yksi kirjain.",maxlength:"N\xE4ytt\xF6nimi ei voi sis\xE4lt\xE4\xE4 enemm\xE4n kuin 120 kirjainta."}};function N(e){mn(e,{message:"N\xE4ytt\xF6nimi vaaditaan."}),fn(e,1,{message:"N\xE4ytt\xF6nimess\xE4 pit\xE4\xE4 olla ainakin yksi kirjain."}),cn(e,120,{message:"N\xE4ytt\xF6nimi ei voi sis\xE4lt\xE4\xE4 enemm\xE4n kuin 120 kirjainta."});}var H={VALIDATORS:[ye.required],MESSAGES:{required:"N\xE4kyvyys vaaditaan."}},q={VALIDATORS:[ye.minLength(3),ye.maxLength(1e3)],MESSAGES:{minlength:"Kuvauksen pit\xE4\xE4 olla v\xE4hint\xE4\xE4n kolme kirjainta pitk\xE4.",maxlength:"Kuvaus ei voi olla 1000 kirjainta pidempi."}},w={VALIDATORS:[],MESSAGES:{required:"Kanava tarvitaan, jos soittolista on julkinen."}};function G(e,V){V.toString()===sIe.PUBLIC.toString()?e.setValidators([ye.required]):e.setValidators(null),e.markAsDirty(),e.updateValueAndValidity();}var re=(()=>{class e{notifier=g(rc);videoPlaylistService=g(Z);playlistCreated=Cpe();playlistModel=Ye({displayName:""});playlistForm=or(this.playlistModel,r=>{N(r.displayName);});createPlaylist(){let t={displayName:this.playlistModel().displayName.trim(),privacy:sIe.PRIVATE};this.videoPlaylistService.createVideoPlaylist(t).subscribe({next:()=>{this.playlistCreated.emit();},error:i=>this.notifier.handleError(i)});}static ɵfac=function(t){return new(t||e)();};static ɵcmp=Pa({type:e,selectors:[["my-playlist-create-block"]],outputs:{playlistCreated:"playlistCreated"},decls:7,vars:4,consts:()=>{let r;r="Luo";let t;return t="N\xE4ytt\xF6nimi",[t,[3,"ngSubmit"],[1,"form-group"],["for","displayName"],["type","text","id","displayName",1,"form-control",3,"formField","myFormInputError"],[3,"field"],["type","submit","value",r,1,"peertube-button","primary-button",3,"disabled"]];},template:function(t,i){t&1&&(sp(0,"form",1),Fp("ngSubmit",function(){return i.createPlaylist();}),sp(1,"div",2)(2,"label",3),yV(3,0),ub(),Pp(4,"input",4),GH(),Pp(5,"my-form-error",5),ub(),Pp(6,"input",6),ub()),t&2&&(zB(4),B0("formField",i.playlistForm.displayName)("myFormInputError",i.playlistForm.displayName()),WH(),zB(),B0("field",i.playlistForm.displayName()),zB(),B0("disabled",!i.playlistForm().valid()));},dependencies:[Jn,Zn,$n,rn,Qn,c,gn,En],styles:["my-global-icon[_ngcontent-%COMP%]{position:relative;left:-1px;top:-1px;width:21px;height:21px;line-height:21px;display:inline-block;color:var(--fg-400);margin-inline-end:.8125rem}input[type=text][_ngcontent-%COMP%]{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:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}input[type=text][_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}input[type=text][readonly][_ngcontent-%COMP%]{color:var(--fg-300)}input[type=text][_ngcontent-%COMP%]:focus, input[type=text][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}input[type=text][disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width: calc(100% + 40px)){input[type=text][_ngcontent-%COMP%]{width:100%}}"],changeDetection:1});}return e;})();/**i18n:fad79908930cbb4c308e7550a5fe49bb3841dbb330066a6429aebaa006173605*/export{G,H,Y,c,q,re as r,w};//# sourceMappingURL=chunk-CAtwTmu8.js.map