import{a as g,b as oe}from"./chunk-SYM5X4PF.js";import{a as te}from"./chunk-7WRF56BE.js";import{a as R}from"./chunk-4AW7XUEV.js";import{d as ne}from"./chunk-44MGGBMP.js";import{b as Z}from"./chunk-4KR5QHBK.js";import{C as J,E as B,F as Q,c as X,g as z,h as K,p as W,w as H,x as j}from"./chunk-U7YDHGE3.js";import{Bb as h,Cb as L,Da as c,Db as l,Eb as V,Ec as b,Fb as $,Gd as q,Hb as G,Jb as S,Ld as w,Na as A,Rh as M,Ta as U,Ug as I,Wc as k,Yb as Y,Zb as x,ba as s,ga as P,gb as d,ha as O,hb as C,kh as ee,mb as N,mc as D,nb as _,ob as o,pb as p,s as v,sa as y,wh as T,zb as F,zh as ie}from"./chunk-DZBHF6HI.js";import{i as u}from"./chunk-IQVXR75E.js";var le=e=>({"input-error":e});function ce(e,t){if(e&1&&(_(0,"div",10),Y(1),o()),e&2){let r=S(2);c(),x(r.formErrors["verify-email-email"]);}}function Ee(e,t){if(e&1){let r=F();_(0,"form",6),G("ngSubmit",function(){P(r);let n=S();return O(n.askSendVerifyEmail());}),_(1,"div",7)(2,"label",8),l(3,1),o(),p(4,"input",9),d(5,ce,2,1,"div",10),o(),p(6,"input",11),o();}if(e&2){let r=S();N("formGroup",r.form),c(4),N("ngClass",D(4,le,r.formErrors["verify-email-email"])),c(),C(r.formErrors["verify-email-email"]?5:-1),c(),N("disabled",!r.form.valid);}}function me(e,t){if(e&1&&(_(0,"div"),l(1,2),o()),e&2){let r=S();c(),V(r.instanceName),$(1);}}var _e=(()=>{let t=class t extends te{formReactiveService=s(Z);userService=s(M);signupService=s(g);serverService=s(T);notifier=s(I);redirectService=s(ie);requiresEmailVerification=!1;get instanceName(){return this.serverService.getHTMLConfig().instance.name;}ngOnInit(){this.serverService.getConfig().subscribe(i=>{this.requiresEmailVerification=i.signup.requiresEmailVerification;}),this.buildForm({"verify-email-email":ne});}askSendVerifyEmail(){let i=this.form.value["verify-email-email"];v([this.userService.askSendVerifyEmail(i),this.signupService.askSendVerifyEmail(i)]).subscribe({next:()=>{this.notifier.success("\u0415\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u0438\u0439 \u043B\u0438\u0441\u0442 \u0437 \u043F\u043E\u0441\u0438\u043B\u0430\u043D\u043D\u044F\u043C \u0434\u043B\u044F \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u043A\u0438 \u0431\u0443\u0434\u0435 \u043D\u0430\u0434\u0456\u0441\u043B\u0430\u043D\u043E \u0434\u043E "+i+"."),this.redirectService.redirectToHomepage();},error:n=>this.notifier.handleError(n)});}};u(t,"\u0275fac",(()=>{let i;return function(a){return(i||(i=y(t)))(a||t);};})()),u(t,"\u0275cmp",A({type:t,selectors:[["my-verify-new-account-ask-send-email"]],features:[U],decls:5,vars:1,consts:()=>{let i;i="\u0417\u0430\u043F\u0438\u0442 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u044E \u043F\u043E\u0448\u0442\u043E\u044E \u0434\u043B\u044F \u043F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0436\u0435\u043D\u043D\u044F \u043E\u0431\u043B\u0456\u043A\u043E\u0432\u043E\u0433\u043E \u0437\u0430\u043F\u0438\u0441\u0443";let n;n="\u0410\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438";let a;a="\u041D\u0430\u0434\u0456\u0441\u043B\u0430\u0442\u0438 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u0438\u0439 \u043B\u0438\u0441\u0442 \u0434\u043B\u044F \u043F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0436\u0435\u043D\u043D\u044F";let f;f="Email";let E;return E=""+"\uFFFD0\uFFFD"+" does not require email verification.",[i,f,E,[1,"margin-content"],[1,"title-page"],[3,"formGroup"],[3,"ngSubmit","formGroup"],[1,"form-group"],["for","verify-email-email"],["type","email","id","verify-email-email","placeholder",n,"required","","formControlName","verify-email-email",1,"form-control",3,"ngClass"],["role","alert",1,"form-error"],["type","submit","value",a,1,"peertube-button","primary-button",3,"disabled"]];},template:function(n,a){n&1&&(_(0,"div",3)(1,"h1",4),l(2,0),o(),d(3,Ee,7,6,"form",5)(4,me,2,1,"div"),o()),n&2&&(c(3),C(a.requiresEmailVerification?3:4));},dependencies:[B,W,X,z,K,J,Q,j,H,k],styles:[`input[type=email][_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:340px;max-width:340px;color:var(--input-fg);background-color:var(--input-bg);border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}input[type=email][_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}input[type=email][readonly][_ngcontent-%COMP%]{color:var(--fg-300)}input[type=email][_ngcontent-%COMP%]:focus, input[type=email][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}input[type=email][disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:380px){input[type=email][_ngcontent-%COMP%]{width:100%}}
/*# sourceMappingURL=verify-new-account-ask-send-email.component-ONRGILG2.css.map */`]}));let e=t;return e;})();function ue(e,t){e&1&&(_(0,"p"),l(1,1),o(),_(2,"p"),l(3,2),o());}function de(e,t){e&1&&(_(0,"p"),l(1,3),o(),_(2,"p"),h(3,4),p(4,"a",7),L(),o());}var ae=(()=>{let t=class t{requiresApproval=b(void 0);};u(t,"\u0275fac",function(n){return new(n||t)();}),u(t,"\u0275cmp",A({type:t,selectors:[["my-signup-success-after-email"]],inputs:{requiresApproval:[1,"requiresApproval"]},decls:6,vars:1,consts:()=>{let i;i="\u0415\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u0430 \u043F\u043E\u0448\u0442\u0430 \u043F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0436\u0435\u043D\u0430!";let n;n="\u0412\u0430\u0448\u0443 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u0443 \u043F\u043E\u0448\u0442\u0443 \u043F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0436\u0435\u043D\u043E \u0442\u0430 \u0432\u0456\u0434\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u043E \u0437\u0430\u043F\u0438\u0442 \u043D\u0430 \u0441\u0442\u0432\u043E\u0440\u0435\u043D\u043D\u044F \u043E\u0431\u043B\u0456\u043A\u043E\u0432\u043E\u0433\u043E \u0437\u0430\u043F\u0438\u0441\u0443!";let a;a=" A moderator will check your registration request soon and you'll receive an email when it is accepted or rejected. ";let f;f="\u0412\u0430\u0448\u0443 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u0443 \u043F\u043E\u0448\u0442\u0443 \u043F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0436\u0435\u043D\u043E, \u0430 \u0432\u0430\u0448 \u043E\u0431\u043B\u0456\u043A\u043E\u0432\u0438\u0439 \u0437\u0430\u043F\u0438\u0441 \u0441\u0442\u0432\u043E\u0440\u0435\u043D\u043E!";let E;return E=" If you need help using PeerTube, you can have a look at the "+"\uFFFD#4\uFFFD"+"documentation"+"\uFFFD/#4\uFFFD"+". ",[i,n,a,f,E,["mascotImageName","success"],["type","primary"],["href","https://docs.joinpeertube.org/use/setup-account","target","_blank","rel","noopener noreferrer",1,"link-primary"]];},template:function(n,a){n&1&&(_(0,"my-signup-step-title",5)(1,"strong"),l(2,0),o()(),_(3,"my-alert",6),d(4,ue,4,0)(5,de,5,0),o()),n&2&&(c(4),C(a.requiresApproval()?4:5));},dependencies:[oe,R],styles:[`my-alert[_ngcontent-%COMP%]{display:block;font-size:18px;max-width:900px;text-align:center;margin:auto}
/*# sourceMappingURL=signup-success.component-LNJKY4EL.css.map */`]}));let e=t;return e;})();function Ce(e,t){if(e&1&&p(0,"my-signup-success-after-email",7),e&2){let r=S(3);N("requiresApproval",r.requiresApproval);}}function Se(e,t){e&1&&(_(0,"my-alert",8),l(1,1),o());}function fe(e,t){if(e&1&&d(0,Ce,1,1,"my-signup-success-after-email",7)(1,Se,2,0,"my-alert",8),e&2){let r=S(2);C(r.isRegistration()||r.isRegistrationRequest()?0:1);}}function pe(e,t){e&1&&(_(0,"my-alert",6)(1,"span"),l(2,2),o(),_(3,"a",9),l(4,3),o()());}function Ae(e,t){if(e&1&&(_(0,"div",4)(1,"h1",5),l(2,0),o(),d(3,fe,2,1)(4,pe,5,0,"my-alert",6),o()),e&2){let r=S();c(3),C(r.success?3:r.failed?4:-1);}}var se=(()=>{let t=class t{signupService=s(g);userService=s(M);server=s(T);authService=s(ee);notifier=s(I);route=s(q);success=!1;failed=!1;isPendingEmail=!1;requiresApproval;loaded=!1;userId;registrationId;verificationString;get instanceName(){return this.server.getHTMLConfig().instance.name;}ngOnInit(){let i=this.route.snapshot.queryParams;if(this.server.getConfig().subscribe(n=>{this.requiresApproval=n.signup.requiresApproval,this.loaded=!0;}),this.userId=i.userId,this.registrationId=i.registrationId,this.verificationString=i.verificationString,this.isPendingEmail=i.isPendingEmail==="true",!this.verificationString){this.notifier.error("\u041D\u0435 \u0432\u0434\u0430\u043B\u043E\u0441\u044F \u0437\u043D\u0430\u0439\u0442\u0438 \u0440\u044F\u0434\u043E\u043A \u043F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0436\u0435\u043D\u043D\u044F \u0432 URL-\u0437\u0430\u043F\u0438\u0442\u0456.");return;}if(!this.userId&&!this.registrationId){this.notifier.error("\u041D\u0435 \u0432\u0434\u0430\u043B\u043E\u0441\u044F \u0437\u043D\u0430\u0439\u0442\u0438 id \u043A\u043E\u0440\u0438\u0441\u0442\u0443\u0432\u0430\u0447\u0430 \u0430\u0431\u043E \u0440\u0435\u0454\u0441\u0442\u0440\u0430\u0446\u0456\u0439\u043D\u0438\u0439 \u0456\u0434\u0435\u043D\u0442\u0438\u0444\u0456\u043A\u0430\u0442\u043E\u0440 \u0432 URL-\u0437\u0430\u043F\u0438\u0442\u0456.");return;}this.verifyEmail();}isRegistration(){return!this.isPendingEmail;}isRegistrationRequest(){return!!this.registrationId;}verifyEmail(){return this.isRegistrationRequest()?this.verifyRegistrationEmail():this.verifyUserEmail();}verifyUserEmail(){let i={userId:this.userId,verificationString:this.verificationString,isPendingEmail:this.isPendingEmail};this.userService.verifyUserEmail(i).subscribe({next:()=>{this.authService.isLoggedIn()&&this.authService.refreshUserInformation(),this.success=!0;},error:n=>{this.failed=!0,this.notifier.handleError(n);}});}verifyRegistrationEmail(){let i={registrationId:this.registrationId,verificationString:this.verificationString};this.signupService.verifyRegistrationEmail(i).subscribe({next:()=>{this.success=!0;},error:n=>{this.failed=!0,this.notifier.handleError(n);}});}};u(t,"\u0275fac",function(n){return new(n||t)();}),u(t,"\u0275cmp",A({type:t,selectors:[["my-verify-account-email"]],decls:1,vars:1,consts:()=>{let i;i="\u041F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0438 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u0443 \u043F\u043E\u0448\u0442\u0443";let n;n="\u0415\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u0443 \u0430\u0434\u0440\u0435\u0441\u0443 \u043E\u043D\u043E\u0432\u043B\u0435\u043D\u043E.";let a;a="\u0421\u0442\u0430\u043B\u0430\u0441\u044F \u043F\u043E\u043C\u0438\u043B\u043A\u0430.";let f;return f="\u0417\u0430\u043F\u0438\u0442\u0430\u0442\u0438 \u043D\u043E\u0432\u0438\u0439 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u0438\u0439 \u043B\u0438\u0441\u0442 \u0434\u043B\u044F \u043F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0436\u0435\u043D\u043D\u044F",[i,n,a,f,[1,"margin-content"],[1,"title-page"],["type","danger"],[3,"requiresApproval"],["type","success"],["routerLink","/verify-account/ask-send-email",1,"ms-1","link-primary"]];},template:function(n,a){n&1&&d(0,Ae,5,1,"div",4),n&2&&C(a.loaded?0:-1);},dependencies:[ae,w,R],encapsulation:2}));let e=t;return e;})();var Be=[{path:"",providers:[g],children:[{path:"email",component:se,data:{meta:{title:"\u041F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0438 \u043E\u0431\u043B\u0456\u043A\u043E\u0432\u0438\u0439 \u0437\u0430\u043F\u0438\u0441 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u044E \u043F\u043E\u0448\u0442\u043E\u044E"}}},{path:"ask-send-email",component:_e,data:{meta:{title:"\u041F\u043E\u043F\u0440\u043E\u0441\u0438\u0442\u0438 \u043D\u0430\u0434\u0456\u0441\u043B\u0430\u0442\u0438 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u0438\u0439 \u043B\u0438\u0441\u0442, \u0449\u043E\u0431 \u043F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0438 \u0441\u0432\u0456\u0439 \u043E\u0431\u043B\u0456\u043A\u043E\u0432\u0438\u0439 \u0437\u0430\u043F\u0438\u0441"}}}]}];export{Be as default};/**i18n:347eeb695970c32bc275618edc2e751c67145d9fc3012e70543c114a99b9e016*///# sourceMappingURL=chunk-MMVSBDI3.js.map