import{a as g,b as oe}from"./chunk-IAWCTBTD.js";import{a as ne}from"./chunk-DN5K4BTU.js";import{a as R}from"./chunk-HLOOXAIQ.js";import{d as te}from"./chunk-L4LIEXUY.js";import{b as Q}from"./chunk-ZGZL4C6F.js";import{C as B,D as Z,c as w,g as z,h as K,o as W,r as H,u as j,z as J}from"./chunk-UR42IA56.js";import{$a as C,Aa as c,Bb as S,Cd as X,Eh as ee,Ka as A,Oa as U,Oc as k,Ph as T,Qb as Y,Rb as x,Sh as ie,_a as d,aa as s,eb as N,ec as D,fa as P,fb as _,ga as O,gb as o,hb as p,ii as M,nh as I,pa as y,r as v,rb as F,tb as L,ub as h,vb as l,wb as V,xb as $,xd as q,yc as b,zb as G}from"./chunk-CUA2BO3S.js";import{i as u}from"./chunk-75J4RO44.js";var le=e=>({"input-error":e});function ce(e,n){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,n){if(e&1){let r=F();_(0,"form",6),G("ngSubmit",function(){P(r);let t=S();return O(t.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,n){if(e&1&&(_(0,"div"),l(1,2),o()),e&2){let r=S();c(),V(r.instanceName),$(1);}}var _e=(()=>{let n=class n extends ne{formReactiveService=s(Q);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":te});}askSendVerifyEmail(){let i=this.form.value["verify-email-email"];v([this.userService.askSendVerifyEmail(i),this.signupService.askSendVerifyEmail(i)]).subscribe({next:()=>{this.notifier.success("Um email com um link de verifica\xE7\xE3o vai ser enviado para "+i+"."),this.redirectService.redirectToHomepage();},error:t=>this.notifier.error(t.message)});}};u(n,"\u0275fac",(()=>{let i;return function(a){return(i||(i=y(n)))(a||n);};})()),u(n,"\u0275cmp",A({type:n,selectors:[["my-verify-new-account-ask-send-email"]],features:[U],decls:5,vars:1,consts:()=>{let i;i="Solicitar e-mail para verifica\xE7\xE3o de conta";let t;t="Endere\xE7o de correio eletr\xF3nico";let a;a="Enviar email de verifica\xE7\xE3o";let f;f="Correio eletr\xF3nico";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",t,"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(t,a){t&1&&(_(0,"div",3)(1,"h1",4),l(2,0),o(),d(3,Ee,7,6,"form",5)(4,me,2,1,"div"),o()),t&2&&(c(3),C(a.requiresEmailVerification?3:4));},dependencies:[B,W,w,z,K,J,Z,H,j,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-HS6WZ6GX.css.map */`]}));let e=n;return e;})();function ue(e,n){e&1&&(_(0,"p"),l(1,1),o(),_(2,"p"),l(3,2),o());}function de(e,n){e&1&&(_(0,"p"),l(1,3),o(),_(2,"p"),L(3,4),p(4,"a",7),h(),o());}var ae=(()=>{let n=class n{requiresApproval=b(void 0);};u(n,"\u0275fac",function(t){return new(t||n)();}),u(n,"\u0275cmp",A({type:n,selectors:[["my-signup-success-after-email"]],inputs:{requiresApproval:[1,"requiresApproval"]},decls:6,vars:1,consts:()=>{let i;i="E-mail verificado!";let t;t="Seu e-mail foi verificado e sua solicita\xE7\xE3o de conta foi enviada!";let a;a="Um moderador verificar\xE1 sua solicita\xE7\xE3o de registro em breve e voc\xEA receber\xE1 um e-mail quando ela for aceita ou rejeitada.";let f;f="Seu e-mail foi verificado e sua conta foi criada!";let E;return E="Se precisar de ajuda para usar o PeerTube, voc\xEA pode dar uma olhada no "+"\uFFFD#4\uFFFD"+" documenta\xE7\xE3o"+"\uFFFD/#4\uFFFD"+" . ",[i,t,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(t,a){t&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()),t&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=n;return e;})();function Ce(e,n){if(e&1&&p(0,"my-signup-success-after-email",7),e&2){let r=S(3);N("requiresApproval",r.requiresApproval);}}function Se(e,n){e&1&&(_(0,"my-alert",8),l(1,1),o());}function fe(e,n){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,n){e&1&&(_(0,"my-alert",6)(1,"span"),l(2,2),o(),_(3,"a",9),l(4,3),o()());}function Ae(e,n){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 n=class n{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(t=>{this.requiresApproval=t.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("N\xE3o foi poss\xEDvel encontrar a sequ\xEAncia de verifica\xE7\xE3o na consulta de URL.");return;}if(!this.userId&&!this.registrationId){this.notifier.error("N\xE3o \xE9 poss\xEDvel encontrar o ID do usu\xE1rio ou o ID de registro na consulta de URL.");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:t=>{this.failed=!0,this.notifier.error(t.message);}});}verifyRegistrationEmail(){let i={registrationId:this.registrationId,verificationString:this.verificationString};this.signupService.verifyRegistrationEmail(i).subscribe({next:()=>{this.success=!0;},error:t=>{this.failed=!0,this.notifier.error(t.message);}});}};u(n,"\u0275fac",function(t){return new(t||n)();}),u(n,"\u0275cmp",A({type:n,selectors:[["my-verify-account-email"]],decls:1,vars:1,consts:()=>{let i;i="Verificar e-mail";let t;t="E-mail atualizado.";let a;a="Ocorreu um erro.";let f;return f="Solicitar um novo e-mail de verifica\xE7\xE3o",[i,t,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(t,a){t&1&&d(0,Ae,5,1,"div",4),t&2&&C(a.loaded?0:-1);},dependencies:[ae,X,R],encapsulation:2}));let e=n;return e;})();var Be=[{path:"",providers:[g],children:[{path:"email",component:se,data:{meta:{title:"Verificar conta via e-mail"}}},{path:"ask-send-email",component:_e,data:{meta:{title:"Pe\xE7a para enviar um e-mail para verificar sua conta"}}}]}];export{Be as default};/**i18n:42440f0a8726af1836b15b193adfd3f46a3ecd983a1ed2a1e05982c4f600c8a1*///# sourceMappingURL=chunk-6ISMLHP4.js.map