1import{a as Ce}from"./chunk-5CCZHJLS.js";import{a as j}from"./chunk-ZMMM2NJV.js";import{a as ge}from"./chunk-5UXNYF7M.js";import{a as _e}from"./chunk-TFL7IPB2.js";import{i as z}from"./chunk-ZV7NG4F4.js";import"./chunk-DJ5AJG3T.js";import"./chunk-6EF6RNOO.js";import"./chunk-T3DWPM4S.js";import"./chunk-K6QYQNRN.js";import{b as pe}from"./chunk-G6MDBWTL.js";import{a as ue,b as me}from"./chunk-IRE2CVIC.js";import"./chunk-JS6LICOA.js";import{a as ce}from"./chunk-GQ2RX7RJ.js";import{a as X}from"./chunk-WF4KZOYP.js";import{b as de}from"./chunk-VRHU7RMY.js";import"./chunk-EB6TJ75L.js";import"./chunk-QI7CEGT6.js";import"./chunk-6ND7557V.js";import{D as oe,E as re,c as Q,e as x,g as K,h as $,i as Z,k as S,m as J,p as Y,q as ee,s as te,y as ie,z as ne}from"./chunk-FOJCKIWO.js";import"./chunk-6DXFCF2C.js";import{a as ae}from"./chunk-NBMUSEX4.js";import"./chunk-AB6CKZTE.js";import"./chunk-H66TAOKK.js";import"./chunk-Z64D265S.js";import"./chunk-K5O3OQFW.js";import"./chunk-2DRXLVRR.js";import"./chunk-RQJZECR4.js";import"./chunk-G3G5OK6Q.js";import{a as le,b as se}from"./chunk-AERMLNF3.js";import"./chunk-QHMYZ6SM.js";import"./chunk-PJPLTBJX.js";import"./chunk-DLIVM562.js";import"./chunk-CV2ZWZQE.js";import"./chunk-H4HD3LNW.js";import"./chunk-AQEWHUN5.js";import{d as q,e as W}from"./chunk-YQZAETCE.js";import{o as B,r as P,s as H,x as D}from"./chunk-EO42E46J.js";import"./chunk-3QVSKJ3X.js";import{I as M,L as G,p as R,s as N}from"./chunk-ERUCNOOT.js";import{$b as A,Fc as U,Gc as I,Hc as b,Jb as s,Mb as E,Qb as T,Qc as p,Rc as c,Vb as r,Wb as o,Xb as h,Yb as V,Zb as F,da as y,db as i,fc as f,gc as u,ib as w,la as _,ma as g,sb as k,tc as d,uc as v,vc as m,yb as C}from"./chunk-DBE7WQEG.js";import{a as O,g as L}from"./chunk-W7GRJBO5.js";var ve=()=>["/"],fe=t=>({"is-invalid":t}),xe=()=>["/forgot-password"],we=()=>["/signup"],Ae=t=>({returnUrl:t});function Te(t,n){if(t&1){let e=A();r(0,"div",10)(1,"p-inputotp",20),f("onComplete",function(){_(e);let l=u(3);return g(l.onTwoFactorSubmit())}),o()()}if(t&2){let e=u(3);i(),s("formControl",e.twoFactorCode)("length",6)("integerOnly",!0)("autofocus",!0)}}function Se(t,n){if(t&1){let e=A();r(0,"div",11)(1,"label",21),d(2),p(3,"translate"),o(),r(4,"input",22),f("keyup.enter",function(){_(e);let l=u(3);return g(l.onTwoFactorSubmit())}),o()()}if(t&2){let e=u(3);i(2),v(c(3,3,"AUTH.LOGIN.TWO_FACTOR_BACKUP_LABEL")),i(2),s("formControl",e.backupCode)("pAutoFocus",!0)}}function Le(t,n){if(t&1&&(r(0,"div",23),d(1),o()),t&2){let e=u(3);i(),m(" ",e.twoFactorError," ")}}function Ie(t,n){t&1&&(V(0),h(1,"i",24),d(2),p(3,"translate"),F()),t&2&&(i(2),v(c(3,1,"AUTH.LOGIN.TWO_FACTOR_SUBMIT")))}function be(t,n){t&1&&(d(0),p(1,"translate")),t&2&&m(" ",c(1,1,"AUTH.LOGIN.TWO_FACTOR_USE_BACKUP")," ")}function ye(t,n){t&1&&(d(0),p(1,"translate")),t&2&&m(" ",c(1,1,"AUTH.LOGIN.TWO_FACTOR_USE_APP")," ")}function Ee(t,n){if(t&1){let e=A();r(0,"div",5),f("keydown.enter",function(){_(e);let l=u(2);return g(l.onTwoFactorSubmit())}),r(1,"div",6),h(2,"i",7),o(),r(3,"h1",8),d(4),p(5,"translate"),o(),r(6,"p",9),d(7),p(8,"translate"),o(),C(9,Te,2,4,"div",10)(10,Se,5,5,"div",11)(11,Le,2,1,"div",12),r(12,"button",13),f("click",function(){_(e);let l=u(2);return g(l.onTwoFactorSubmit())}),C(13,Ie,4,3,"ng-container",14),h(14,"app-widget-loading",15),o(),r(15,"div",16)(16,"a",17),f("click",function(){_(e);let l=u(2);return g(l.toggleBackupCodeMode())}),C(17,be,2,3)(18,ye,2,3),o()(),r(19,"button",18),f("click",function(){_(e);let l=u(2);return g(l.backToLogin())}),h(20,"i",19),d(21),p(22,"translate"),o()()}if(t&2){let e=u(2);i(4),m(" ",c(5,11,"AUTH.LOGIN.TWO_FACTOR_TITLE")," "),i(3),m(" ",c(8,13,"AUTH.LOGIN.TWO_FACTOR_SUBTITLE")," "),i(2),T(e.backupCodeMode?10:9),i(2),s("ngIf",e.twoFactorError),i(),s("disabled",e.twoFactorLoading||(e.backupCodeMode?e.backupCode.invalid:e.twoFactorCode.invalid)),i(),s("ngIf",!e.twoFactorLoading),i(),E("white"),s("loading",e.twoFactorLoading),i(3),T(e.backupCodeMode?18:17),i(4),m("",c(22,15,"AUTH.LOGIN.TWO_FACTOR_BACK")," ")}}function Ve(t,n){t&1&&(r(0,"div"),d(1),p(2,"translate"),o()),t&2&&(i(),m(" ",c(2,1,"AUTH.LOGIN.ERROR_EMAIL_REQUIRED")," "))}function Fe(t,n){t&1&&(r(0,"div"),d(1),p(2,"translate"),o()),t&2&&(i(),m(" ",c(2,1,"AUTH.LOGIN.ERROR_EMAIL_INVALID")," "))}function Oe(t,n){if(t&1&&(r(0,"div",40),C(1,Ve,3,3,"div",14)(2,Fe,3,3,"div",14),o()),t&2){let e=u(3);i(),s("ngIf",e.f.email.errors.required),i(),s("ngIf",e.f.email.errors.email)}}function ke(t,n){t&1&&(r(0,"div"),d(1),p(2,"translate"),o()),t&2&&(i(),m(" ",c(2,1,"AUTH.LOGIN.ERROR_PASSWORD_REQUIRED")," "))}function Ue(t,n){if(t&1&&(r(0,"div",40),C(1,ke,3,3,"div",14),o()),t&2){let e=u(3);i(),s("ngIf",e.f.password.errors.required)}}function Re(t,n){t&1&&(r(0,"div",23),d(1),p(2,"translate"),o()),t&2&&(i(),m(" ",c(2,1,"AUTH.LOGIN.ERROR_CREDENTIALS")," "))}function Ne(t,n){if(t&1){let e=A();r(0,"div",41)(1,"p",42),d(2),p(3,"translate"),o(),r(4,"button",43),f("click",function(){_(e);let l=u(3);return g(l.goToSignup())}),h(5,"i",39),d(6),p(7,"translate"),o()()}t&2&&(i(2),m(" ",c(3,2,"AUTH.LOGIN.ERROR_NO_ACCOUNT_HINT")," "),i(4),m("",c(7,4,"AUTH.LOGIN.ERROR_CREATE_ACCOUNT")," "))}function Me(t,n){t&1&&(V(0),h(1,"i",44),d(2),p(3,"translate"),F()),t&2&&(i(2),v(c(3,1,"AUTH.LOGIN.SUBMIT")))}function Ge(t,n){if(t&1){let e=A();r(0,"div",45)(1,"span"),d(2),p(3,"translate"),o()(),r(4,"app-widget-google-signin-button",46),p(5,"translate"),f("googleSignIn",function(){_(e);let l=u(3);return g(l.onGoogleSignIn())}),o()}if(t&2){let e=u(3);i(2),v(c(3,4,"AUTH.LOGIN.DIVIDER_OR")),i(2),s("loading",e.googleLoading)("disabled",e.loading)("text",c(5,6,"AUTH.LOGIN.GOOGLE_SIGNIN"))}}function Be(t,n){if(t&1){let e=A();r(0,"div",25)(1,"h1",26),d(2),p(3,"translate"),o(),r(4,"p",27),d(5),p(6,"translate"),o(),r(7,"form",28),f("ngSubmit",function(){_(e);let l=u(2);return g(l.onSubmit())})("keyup.enter",function(){_(e);let l=u(2);return g(l.onSubmit())}),r(8,"div",11)(9,"label",29),d(10),p(11,"translate"),o(),r(12,"input",30),f("input",function(){_(e);let l=u(2);return g(l.error=null)}),o(),C(13,Oe,3,2,"div",31),o(),r(14,"div",11)(15,"label",32),d(16),p(17,"translate"),o(),r(18,"input",33),f("input",function(){_(e);let l=u(2);return g(l.error=null)}),o(),C(19,Ue,2,1,"div",31),o(),r(20,"a",34),d(21),p(22,"translate"),o(),C(23,Re,3,3,"div",12)(24,Ne,8,6,"div",35),r(25,"button",13),f("click",function(){_(e);let l=u(2);return g(l.onSubmit())}),C(26,Me,4,3,"ng-container",14),h(27,"app-widget-loading",15),o()(),C(28,Ge,6,8),o(),r(29,"div",36)(30,"p",37),d(31),p(32,"translate"),o(),r(33,"a",38),h(34,"i",39),d(35),p(36,"translate"),o()()}if(t&2){let e=u(2);i(2),m(" ",c(3,24,e.addAccountMode?"AUTH.ADD_ACCOUNT_TITLE":"AUTH.LOGIN.TITLE")," "),i(3),m(" ",c(6,26,e.addAccountMode?"AUTH.ADD_ACCOUNT_SUBTITLE":"AUTH.LOGIN.SUBTITLE")," "),i(2),s("formGroup",e.form),i(3),v(c(11,28,"AUTH.LOGIN.LABEL_EMAIL")),i(2),s("ngClass",b(38,fe,e.submitted&&e.f.email.errors))("pAutoFocus",!0),i(),s("ngIf",e.submitted&&e.f.email.errors),i(3),v(c(17,30,"AUTH.LOGIN.LABEL_PASSWORD")),i(2),s("ngClass",b(40,fe,e.submitted&&e.f.password.errors)),i(),s("ngIf",e.submitted&&e.f.password.errors),i(),s("routerLink",I(42,xe)),i(),v(c(22,32,"AUTH.LOGIN.FORGOT_PASSWORD")),i(2),s("ngIf",e.error),i(),s("ngIf",e.error),i(),s("disabled",e.loading),i(),s("ngIf",!e.loading),i(),E("white"),s("loading",e.loading),i(),T(e.hasGoogleAuth?28:-1),i(3),m(" ",c(32,34,"AUTH.LOGIN.NO_ACCOUNT")," "),i(2),s("routerLink",I(43,we))("queryParams",b(44,Ae,e.route.snapshot.queryParams.returnUrl)),i(2),m("",c(36,36,"AUTH.LOGIN.CREATE_ACCOUNT")," ")}}function Pe(t,n){if(t&1&&(r(0,"div",0)(1,"div",1)(2,"a",2),h(3,"img",3),o(),C(4,Ee,23,17,"div",4)(5,Be,37,46),o()()),t&2){let e=u();i(2),s("routerLink",I(3,ve)),i(),s("ngSrc","assets/images/hou.la-logo-light.svg"),i(),T(e.twoFactorStep?4:5)}}var he=class t{constructor(n,e,a,l,He,De){this.service=n;this.userService=e;this.router=a;this.route=l;this.$gaService=He;this.seoService=De}
1modalRef=y(pe,{optional:!0});finishLogin(n){if(this.modalRef){this.modalRef.close(!0);return}this.router.navigateByUrl(n||"/studio/home")}formHelper=y(ce);loading=!1;googleLoading=!1;error=null;submitted=!1;hasGoogleAuth=!0;twoFactorStep=!1;twoFactorToken="";twoFactorCode=new S("",[x.required,x.minLength(6)]);twoFactorLoading=!1;twoFactorError=null;backupCodeMode=!1;backupCode=new S("",[x.required,x.pattern(/^[A-Za-z0-9]{4}-?[A-Za-z0-9]{4}$/)]);form=new Z({email:new S("",[x.required,x.email]),password:new S("",[x.required])});bridge=me(this.form,{preset:ue()});get f(){return this.form.controls}onSubmit(){return L(this,null,function*(){this.submitted=!0;let n=this.formHelper.startSubmit(this.form);if(n){this.loading=!0,this.error=null;try{this.addAccountMode&&(yield this.service.ensureCurrentAccountStored());let e=yield this.service.login(n.email,n.password);if(e.requires2fa&&e.twoFactorToken){this.twoFactorStep=!0,this.twoFactorToken=e.twoFactorToken,this.loading=!1;return}let a=this.route.snapshot.queryParams.returnUrl;if(this.addAccountMode){window.location.href=a||"/studio/home";return}this.finishLogin(a)}catch(e){this.form.enable(),e?.error&&this.bridge.applyApiErrors(e.error),this.error=this.bridge.firstErrorSignal()?.message||e?.error?.message||e?.message||null,this.loading=!1}}})}onTwoFactorSubmit(){return L(this,null,function*(){let n=this.backupCodeMode?this.backupCode.value:this.twoFactorCode.value;if(!(!(this.backupCodeMode?this.backupCode.valid:this.twoFactorCode.valid)||!this.twoFactorToken||!n)&&!this.twoFactorLoading){this.twoFactorLoading=!0,this.twoFactorError=null;try{yield this.service.verifyTwoFactorLogin(this.twoFactorToken,n);let a=this.route.snapshot.queryParams.returnUrl;this.finishLogin(a)}catch(a){this.twoFactorError=a?.error?.message||a?.message||"Code invalide",this.twoFactorLoading=!1,this.twoFactorCode.reset(),this.backupCode.reset()}}})}toggleBackupCodeMode(){this.backupCodeMode=!this.backupCodeMode,this.twoFactorError=null,this.twoFactorCode.reset(),this.backupCode.reset()}backToLogin(){this.twoFactorStep=!1,this.twoFactorToken="",this.twoFactorCode.reset(),this.backupCode.reset(),this.backupCodeMode=!1,this.twoFactorError=null,this.form.enable()}prefillEmailFromQuery(){let n=this.route.snapshot.queryParams.email;n&&!this.form.get("email")?.value&&this.form.patchValue({email:n})}get addAccountMode(){return this.route.snapshot.queryParams.add==="1"}onGoogleSignIn(){return L(this,null,function*(){this.googleLoading=!0;let n=this.route.snapshot.queryParams.returnUrl;this.addAccountMode&&(yield this.service.ensureCurrentAccountStored()),this.service.loginWithGoogle(n,{addAccount:this.addAccountMode})})}goToSignup(){let n=this.form.get("email")?.value||"",e=this.form.get("password")?.value||"",a=this.route.snapshot.queryParams.returnUrl;this.router.navigate(["/signup"],O({state:{email:n,password:e}},a?{queryParams:{returnUrl:a}}:{}))}ngOnInit(){this.$gaService.pageView(this.router.url,"Se connecter"),this.seoService.setSeoFromSnapshop(this.route.snapshot),this.prefillEmailFromQuery()}static \u0275fac=function(e){return new(e||t)(w(z),w(X),w(P),w(B),w(_e),w(j))};static \u0275cmp=k({type:t,selectors:[["app-view-auth-login"]],features:[U([])],decls:1,vars:1,consts:[[1,"auth-page"],[1,"auth-wrapper"],[1,"auth-logo",3,"routerLink"],["width","907","height","390","alt","logo hou.la","priority","",2,"max-width","80px",3,"ngSrc"],[1,"auth-card",2,"text-align","center"],[1,"auth-card",2,"text-align","center",3,"keydown.enter"],[1,"auth-2fa-icon"],[1,"pi","pi-shield"],[1,"auth-title",2,"text-align","center"],[1,"auth-subtitle",2,"text-align","center"],[1,"auth-field",2,"display","flex","justify-content","center"],[1,"auth-field"],["class","auth-error-alert","role","alert",4,"ngIf"],[1,"auth-btn-primary",3,"click","disabled"],[4,"ngIf"],[3,"loading"],[1,"auth-2fa-toggle"],["href","javascript:void(0)",1,"auth-forgot-link",2,"text-align","center","display","block",3,"click"],[1,"auth-btn-secondary","mt-2",3,"click"],[1,"pi","pi-arrow-left","me-2"],[3,"onComplete","formControl","length","integerOnly","autofocus"],["for","backupCode",1,"auth-label",2,"text-align","center"],["type","text","id","backupCode","maxlength","9","placeholder","XXXX-XXXX","autocomplete","one-time-code",1,"auth-code-input",2,"letter-spacing","0.15em","max-width","220px",3,"keyup.enter","formControl","pAutoFocus"],["role","alert",1,"auth-error-alert"],[1,"pi","pi-check","me-2"],[1,"auth-card"],[1,"auth-title"],[1,"auth-subtitle"],[3,"ngSubmit","keyup.enter","formGroup"],["for","email",1,"auth-label"],["type","email","id","email","formControlName","email","required","",1,"auth-input",3,"input","ngClass","pAutoFocus"],["class","auth-error",4,"ngIf"],["for","password",1,"auth-label"],["type","password","id","password","formControlName","password","required","",1,"auth-input",3,"input","ngClass"],[1,"auth-forgot-link",3,"routerLink"],["class","auth-signup-suggestion",4,"ngIf"],[1,"auth-footer-cta"],[1,"auth-footer-cta__text"],[1,"auth-footer-cta__btn",3,"routerLink","queryParams"],[1,"pi","pi-user-plus","me-2"],[1,"auth-error"],[1,"auth-signup-suggestion"],[1,"auth-signup-suggestion__text"],["type","button",1,"auth-btn-success","auth-btn-success--sm",3,"click"],[1,"pi","pi-sign-in","me-2"],[1,"auth-divider"],[3,"googleSignIn","loading","disabled","text"]],template:function(e,a){e&1&&C(0,Pe,6,4,"div",0),e&2&&T(a.service.isLoggedIn===!1||a.addAccountMode?0:-1)},dependencies:[M,R,N,D,H,ae,re,J,Q,K,$,ie,ne,Y,ee,te,oe,de,G,se,le,ge,W,q,Ce],styles:['.aurora-blob-extra[_ngcontent-%COMP%]{position:absolute;width:400px;height:400px;background:linear-gradient(135deg,#2f8eef2e,#54a6f61f);border-radius:50%;filter:blur(80px);top:50%;left:50%;transform:translate(-50%,-50%);animation:_ngcontent-%COMP%_auroraFloat 25s ease-in-out infinite;animation-delay:-5s;pointer-events:none;z-index:0}@keyframes _ngcontent-%COMP%_auroraFloat{0%,to{transform:translate(0) scale(1)}25%{transform:translate(30px,-30px) scale(1.05)}50%{transform:translate(-20px,20px) scale(.95)}75%{transform:translate(-30px,-20px) scale(1.02)}}.aurora-content[_ngcontent-%COMP%]{position:relative;z-index:1}[_nghost-%COMP%]{display:block;min-height:100vh;position:relative;background:linear-gradient(160deg,#0a0a14,#12121e 55%,#0a0a14);overflow:hidden}[_nghost-%COMP%]:before, [_nghost-%COMP%]:after{content:"";position:absolute;border-radius:50%;filter:blur(80px);opacity:.5;animation:_ngcontent-%COMP%_auroraFloat 20s ease-in-out infinite;pointer-events:none;z-index:0}[_nghost-%COMP%]:before{width:600px;height:600px;background:linear-gradient(135deg,#2f8eef52,#2f8eef14);top:-200px;right:-150px}[_nghost-%COMP%]:after{width:500px;height:500px;background:linear-gradient(135deg,#54a6f642,#2f8eef0f);bottom:-150px;left:-100px;animation-delay:-10s}']})};export{he as ViewAuthLoginComponent};
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.