@ngageoint/mage.web-app
Version:
The Mage web-app is the UI for interacting with the Mage service in a web browser.
1 lines • 86.6 kB
JavaScript
"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[24],{46605:(Qt,st,C)=>{C.d(st,{O:()=>q});class t{constructor(_,x,D){this._statusMessage=_,this._identifier=x,this._strategy=D,this._subject="",this._body=""}get subject(){return this._subject}get body(){return this._body}build(){const _=this._statusMessage.toUpperCase();this._subject=_.includes("DEVICE")?_.includes("REGISTER")?"Please approve my device":"Device ID issue":_.includes("APPROVED")||_.includes("ACTIVATE")?"Please activate my Mage account":_.includes("DISABLED")?"Please enable my Mage account":_.includes("LOCKED")?"Please unlock my Mage account":_.includes("CAPTCHA")?"Mage CAPTCHA issue":_.includes("EVENT")?"Please add me to a Mage event":"Mage signin issue",this._identifier&&(this._subject+=" - "+this._identifier,this._body+="Identifier (username or device id): "+this._identifier+"\n"),this._body+="Error Message Received: "+this._statusMessage}}class q{static emailLink(_,x,D,at){let I;if(_&&_.email){const k=new t(x,D,at);k.build(),I="mailto:"+encodeURIComponent(_.email),I+="?subject="+encodeURIComponent(k.subject),I+="&body="+encodeURIComponent(k.body)}return I}static phoneLink(_){let x;return _&&_.phone&&(x="tel:"+_.phone),x}}},19241:(Qt,st,C)=>{C.d(st,{t:()=>yt});var t=C(94650),q=C(4859),L=(()=>{return(i=L||(L={}))[i.ACCEPT=0]="ACCEPT",i[i.REJECT=1]="REJECT",L;var i})();let _=(()=>{class i{constructor(){this.close=new t.vpe}onAccept(){this.close.emit({reason:L.ACCEPT})}onReject(){this.close.emit({reason:L.REJECT})}}return i.\u0275fac=function(r){return new(r||i)},i.\u0275cmp=t.Xpm({type:i,selectors:[["disclaimer"]],inputs:{title:"title",text:"text"},outputs:{close:"close"},decls:12,vars:2,consts:[[1,"container"],[1,"header"],[1,"header__title"],[1,"disclaimer"],[1,"disclaimer__text"],[1,"actions"],["mat-stroked-button","",1,"actions__button",3,"click"],["mat-flat-button","","color","primary",1,"actions__button",3,"click"]],template:function(r,a){1&r&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2),t._uU(3),t.qZA()(),t.TgZ(4,"div",3)(5,"div",4),t._uU(6),t.qZA()(),t.TgZ(7,"div",5)(8,"button",6),t.NdJ("click",function(){return a.onReject()}),t._uU(9,"Exit"),t.qZA(),t.TgZ(10,"button",7),t.NdJ("click",function(){return a.onAccept()}),t._uU(11,"Accept"),t.qZA()()()),2&r&&(t.xp6(3),t.Oqu(a.title),t.xp6(3),t.Oqu(a.text))},dependencies:[q.lW],styles:[".container[_ngcontent-%COMP%]{height:100%;display:flex;flex-direction:column;gap:48px}.header[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:end;height:30vh}.header__title[_ngcontent-%COMP%]{font:400 34px/40px Roboto,Helvetica Neue,sans-serif;color:#1e88e5;margin-bottom:16px}.disclaimer[_ngcontent-%COMP%]{overflow-y:scroll}.disclaimer__text[_ngcontent-%COMP%]{font:400 16px/20px Roboto,Helvetica Neue,sans-serif;margin-bottom:32px;opacity:60%}.actions[_ngcontent-%COMP%]{display:flex;flex-direction:row;justify-content:start;width:100%;gap:16px}.actions__button[_ngcontent-%COMP%]{flex:1}"]}),i})();var x=C(37340),D=C(1584),at=C(38159),I=C(36895);let k=(()=>{class i{constructor(){this.complete=new t.vpe}ngOnChanges(r){!0===r.active.currentValue?(this.icon="check_circle",this.color="#4CAF50",this.title="Account Created",this.message="Your account has been successfully created."):!1===r.active.currentValue&&(this.icon="preliminary",this.color="#FFA000",this.title="Account Pending",this.message="Your account has been successfully created. A Mage administrator will need to activate your account before you can log in.")}onDone(){this.complete.emit()}}return i.\u0275fac=function(r){return new(r||i)},i.\u0275cmp=t.Xpm({type:i,selectors:[["account-status"]],inputs:{active:"active"},outputs:{complete:"complete"},features:[t.TTD],decls:10,vars:5,consts:[[1,"content"],[1,"material-symbols-outlined","icon"],[1,"title"],[1,"actions"],["mat-flat-button","","color","primary",1,"actions__button",3,"click"]],template:function(r,a){1&r&&(t.TgZ(0,"div",0)(1,"span",1),t._uU(2),t.qZA(),t.TgZ(3,"div",2),t._uU(4),t.qZA(),t.TgZ(5,"p"),t._uU(6),t.qZA()(),t.TgZ(7,"div",3)(8,"button",4),t.NdJ("click",function(){return a.onDone()}),t._uU(9,"Return to Login"),t.qZA()()),2&r&&(t.xp6(1),t.Udp("color",a.color),t.xp6(1),t.Oqu(a.icon),t.xp6(2),t.Oqu(a.title),t.xp6(2),t.Oqu(a.message))},dependencies:[q.lW],styles:['.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;text-align:center;width:500px}.title[_ngcontent-%COMP%]{font:400 20px/32px Roboto,Helvetica Neue,sans-serif}.icon[_ngcontent-%COMP%]{font-size:96px;font-variation-settings:"fill" 0,"wght" 200,"grad" 0,"opsz" 96;margin-bottom:32px}.icon--active[_ngcontent-%COMP%]{color:#4caf50}.icon-inactive[_ngcontent-%COMP%]{color:red}.actions[_ngcontent-%COMP%]{width:100%;display:flex;flex-direction:row;margin-top:32px}.actions__button[_ngcontent-%COMP%]{flex:1}']}),i})();var ct=C(86349);function K(i,d){if(1&i&&(t.TgZ(0,"div",5),t._UZ(1,"img",6),t.qZA()),2&i){const r=t.oxw();t.xp6(1),t.Q6J("src","data:image/png;base64,"+r.icon,t.LSH)}}function mt(i,d){1&i&&t._UZ(0,"div",7)}const pt=function(i){return{"background-color":i}},P=function(i){return{color:i}};let X=(()=>{class i{constructor(){this.click=new t.vpe}onClick(){this.click.emit()}}return i.\u0275fac=function(r){return new(r||i)},i.\u0275cmp=t.Xpm({type:i,selectors:[["authentication-button"]],inputs:{icon:"icon",color:"color",text:"text",textColor:"textColor"},outputs:{click:"click"},decls:6,vars:10,consts:[["mat-flat-button","","color","primary",1,"authentication-button",3,"click"],[1,"authentication-button-container"],["class","authentication-button__icon",4,"ngIf"],[1,"authentication-button__text",3,"ngStyle"],["class","spacer",4,"ngIf"],[1,"authentication-button__icon"],[1,"authentication-button__image",3,"src"],[1,"spacer"]],template:function(r,a){1&r&&(t.TgZ(0,"button",0),t.NdJ("click",function(){return a.onClick()}),t.TgZ(1,"div",1),t.YNc(2,K,2,1,"div",2),t.TgZ(3,"div",3),t._uU(4),t.qZA(),t.YNc(5,mt,1,0,"div",4),t.qZA()()),2&r&&(t.Akn(t.VKq(6,pt,a.color)),t.xp6(2),t.Q6J("ngIf",a.icon),t.xp6(1),t.Q6J("ngStyle",t.VKq(8,P,a.textColor)),t.xp6(1),t.hij("Continue with ",a.text,""),t.xp6(1),t.Q6J("ngIf",a.icon))},dependencies:[I.O5,I.PC,q.lW],styles:[".authentication-button[_ngcontent-%COMP%]{width:100%}.authentication-button-container[_ngcontent-%COMP%]{display:flex;flex-direction:row;gap:8px;margin:0 -16px}.authentication-button__icon[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;margin:2px;width:36px;border-radius:2px;background-color:#fff}.authentication-button__image[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;margin:2px;height:28px;border-radius:2px;background-color:#fff}.authentication-button__text[_ngcontent-%COMP%]{flex:1;width:250px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.spacer[_ngcontent-%COMP%]{margin:2px;width:36px}"]}),i})(),E=(()=>{class i{constructor(r){this.userService=r,this.authenticated=new t.vpe}signin(){this.userService.idpSignin(this.strategy.name).subscribe({next:r=>{if(!r.token||!r.user){let a="There was a problem signing in, Please contact a Mage administrator for assistance.";return r.user&&(r.user.active?r.user.enabled||(a="Your account has been disabled, please contact a Mage administrator for assistance."):a="Your account has been created but it is not active. A Mage administrator needs to activate your account before you can log in."),this.error.title="Signin Failed",void(this.error.message=a)}this.authenticated.emit(r)},error:r=>{this.error={title:"Error signing in",message:r.data||"Please check your username and password and try again."}}})}}return i.\u0275fac=function(r){return new(r||i)(t.Y36(D.K))},i.\u0275cmp=t.Xpm({type:i,selectors:[["idp-authentication"]],inputs:{strategy:"strategy"},outputs:{authenticated:"authenticated"},decls:1,vars:4,consts:[[3,"text","textColor","color","icon","click"]],template:function(r,a){1&r&&(t.TgZ(0,"authentication-button",0),t.NdJ("click",function(){return a.signin()}),t.qZA()),2&r&&t.Q6J("text",a.strategy.title)("textColor",a.strategy.textColor)("color",a.strategy.buttonColor)("icon",a.strategy.icon)},dependencies:[X]}),i})();var g=C(24006),ht=C(46605),b=C(59549),j=C(44144);function Tt(i,d){if(1&i&&t._UZ(0,"span",11),2&i){const r=t.oxw(2);t.Q6J("innerHTML",r.contact,t.oJD)}}function R(i,d){if(1&i&&(t.TgZ(0,"div",6)(1,"div",7)(2,"span",8),t._uU(3,"sentiment_dissatisfied"),t.qZA(),t.TgZ(4,"div",9)(5,"div"),t._uU(6),t.YNc(7,Tt,1,1,"span",10),t.qZA()()()()),2&i){const r=t.oxw();t.Q6J("@slide",void 0),t.xp6(6),t.hij("",null==r.error?null:r.error.message," "),t.xp6(1),t.Q6J("ngIf",r.contact)}}let nt=(()=>{class i{constructor(r){this.userService=r,this.authenticated=new t.vpe,this.authenticationForm=new g.cw({username:new g.NI("",[g.kI.required]),password:new g.NI("",[g.kI.required])})}onSignin(){if(this.authenticationForm.invalid)return;const{username:r,password:a}=this.authenticationForm.value;this.userService.ldapSignin(r,a).subscribe({next:p=>{this.authenticated.emit(p)},error:p=>{this.error={title:"Error Signing In",message:p.error||"Please check your username and password and try again."};const y=ht.O.emailLink(this.api.contactInfo,p.error,r,this.strategy),Q=ht.O.phoneLink(this.api.contactInfo);this.contact=`Should you need futher assistance you may contact your Mage administrator via ${[`<a href=${y}>email</a>`,`<a href=${Q}>phone</a>`].join(" or ")}.`}})}}return i.\u0275fac=function(r){return new(r||i)(t.Y36(D.K))},i.\u0275cmp=t.Xpm({type:i,selectors:[["ldap-authentication"]],inputs:{api:"api",strategy:"strategy"},outputs:{authenticated:"authenticated"},decls:17,vars:10,consts:[[3,"formGroup","ngSubmit"],["appearance","fill"],["matInput","","formControlName","username","required","",3,"placeholder"],["matInput","","type","password","formControlName","password","required","",3,"placeholder"],[3,"text","textColor","color","icon","click"],["class","error-container",4,"ngIf"],[1,"error-container"],[1,"error"],[1,"material-symbols-outlined","error__icon"],[1,"error__message"],["class","contact",3,"innerHTML",4,"ngIf"],[1,"contact",3,"innerHTML"]],template:function(r,a){1&r&&(t.TgZ(0,"form",0),t.NdJ("ngSubmit",function(){return a.onSignin()}),t.TgZ(1,"div")(2,"mat-form-field",1)(3,"mat-label"),t._uU(4),t.qZA(),t._UZ(5,"input",2),t.TgZ(6,"mat-error"),t._uU(7,"Username is required"),t.qZA()()(),t.TgZ(8,"div")(9,"mat-form-field",1)(10,"mat-label"),t._uU(11),t.qZA(),t._UZ(12,"input",3),t.TgZ(13,"mat-error"),t._uU(14,"Password is required"),t.qZA()()(),t.TgZ(15,"authentication-button",4),t.NdJ("click",function(){return a.onSignin()}),t.qZA(),t.YNc(16,R,8,3,"div",5),t.qZA()),2&r&&(t.Q6J("formGroup",a.authenticationForm),t.xp6(4),t.hij("",a.strategy.title," Username"),t.xp6(1),t.MGl("placeholder","",a.strategy.title," Username"),t.xp6(6),t.hij("",a.strategy.title," Password"),t.xp6(1),t.MGl("placeholder","",a.strategy.title," Password"),t.xp6(3),t.Q6J("text",a.strategy.title)("textColor",a.strategy.textColor)("color",a.strategy.buttonColor)("icon",a.strategy.icon),t.xp6(1),t.Q6J("ngIf",a.error))},dependencies:[I.O5,b.TO,b.KE,b.hX,j.Nt,g._Y,g.Fj,g.JJ,g.JL,g.Q7,g.sg,g.u,X],styles:['[_nghost-%COMP%] a{color:#e53935;cursor:pointer;text-decoration:underline}mat-form-field[_ngcontent-%COMP%]{width:100%;margin-bottom:8px}.auth-button[_ngcontent-%COMP%]{width:100%}.signup[_ngcontent-%COMP%]{display:flex;margin-top:32px;justify-content:center;gap:8px}.signup-text[_ngcontent-%COMP%]{opacity:60%}.signup-button[_ngcontent-%COMP%]{cursor:pointer;color:#1e88e5}.error-container[_ngcontent-%COMP%]{overflow:hidden}.error[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:8px;margin-top:24px;color:#e53935;border-radius:4px;padding:0 16px}.error__icon[_ngcontent-%COMP%]{font-size:48px;font-variation-settings:"fill" 0,"wght" 400,"grad" 0,"opsz" 48}.error__message[_ngcontent-%COMP%]{flex:1;text-align:center}']}),i})();var xt=C(19132),_t=C(82524),At=C(11481);const bt=["errorElement"];function S(i,d){1&i&&(t.TgZ(0,"mat-error"),t._uU(1," Username is required "),t.qZA())}function gt(i,d){1&i&&(t.TgZ(0,"mat-error"),t._uU(1," Password is required "),t.qZA())}function Mt(i,d){if(1&i){const r=t.EpF();t.TgZ(0,"div",8,9),t.NdJ("@slide.done",function(){t.CHM(r);const p=t.oxw();return t.KtG(p.scrollToError())}),t.TgZ(2,"span",10),t._uU(3,"sentiment_dissatisfied"),t.qZA(),t._UZ(4,"div",11),t.qZA()}if(2&i){const r=t.oxw();t.Q6J("@slide",void 0),t.xp6(4),t.Q6J("innerHTML",r.error.message,t.oJD)}}function St(i,d){if(1&i){const r=t.EpF();t.TgZ(0,"div",12)(1,"div")(2,"span",13),t._uU(3,"New to Mage?"),t.qZA(),t.TgZ(4,"a",14),t.NdJ("click",function(){t.CHM(r);const p=t.oxw();return t.KtG(p.onSignup())}),t._uU(5,"Sign Up Now"),t.qZA()(),t.TgZ(6,"div")(7,"span",13),t._uU(8,"Need More Info?"),t.qZA(),t.TgZ(9,"a",14),t.NdJ("click",function(){t.CHM(r);const p=t.oxw();return t.KtG(p.onAboutClick())}),t._uU(10,"About Mage."),t.qZA()()()}}let Nt=(()=>{class i{constructor(r,a,p,y){this.router=r,this.apiService=a,this.userService=p,this.sanitizer=y,this.signup=new t.vpe,this.authenticated=new t.vpe,this.authenticationForm=new g.cw({username:new g.NI("",[g.kI.required]),password:new g.NI("",[g.kI.required])})}ngOnInit(){this.userService.myself&&this.router.navigate(["home"]),this.apiService.getApi().subscribe(r=>{this.api=r})}onSignin(){if(this.authenticationForm.invalid)return;const{username:r,password:a}=this.authenticationForm.value;this.userService.signin(r,a).subscribe({next:p=>{this.authenticated.emit(p)},error:p=>{let y=p.error||"Please check your username and password and try again.";(this.api.contactInfo.email||this.api.contactInfo.phone)&&(y=`${y} Should you need futher assistance you may contact your Mage administrator via ${[`<a href=${ht.O.emailLink(this.api.contactInfo,p.error,r,this.strategy)}>email</a>`,`<a href=${ht.O.phoneLink(this.api.contactInfo)}>phone</a>`].join(" or ")}.`),this.error={title:"Error Signing In",message:this.sanitizer.sanitize(t.q3G.HTML,y)},this.scrollToError()}})}onSignup(){this.signup.emit()}onAboutClick(){this.router.navigate(["about"])}scrollToError(){try{this.errorElement.nativeElement.scrollIntoView({behavior:"smooth"})}catch{}}}return i.\u0275fac=function(r){return new(r||i)(t.Y36(xt.F0),t.Y36(_t.s),t.Y36(D.K),t.Y36(At.H7))},i.\u0275cmp=t.Xpm({type:i,selectors:[["local-authentication"]],viewQuery:function(r,a){if(1&r&&t.Gf(bt,5),2&r){let p;t.iGM(p=t.CRH())&&(a.errorElement=p.first)}},inputs:{api:"api",strategy:"strategy",landing:"landing"},outputs:{signup:"signup",authenticated:"authenticated"},decls:15,vars:5,consts:[[1,"auth-form",3,"formGroup","ngSubmit"],["appearance","fill",1,"auth-form__field"],["matInput","","formControlName","username","required","","placeholder","Enter your username"],[4,"ngIf"],["matInput","","type","password","formControlName","password","required","","placeholder","Enter your password"],["mat-flat-button","","color","primary","type","submit",1,"auth-form__button"],["class","auth-form__error",4,"ngIf"],["class","auth-form__footer",4,"ngIf"],[1,"auth-form__error"],["errorElement",""],[1,"material-symbols-outlined","auth-form__error-icon"],[1,"auth-form__error-message",3,"innerHTML"],[1,"auth-form__footer"],[1,"auth-form__footer-text"],[1,"auth-form__footer-link",3,"click"]],template:function(r,a){if(1&r&&(t.TgZ(0,"form",0),t.NdJ("ngSubmit",function(){return a.onSignin()}),t.TgZ(1,"mat-form-field",1)(2,"mat-label"),t._uU(3,"Username"),t.qZA(),t._UZ(4,"input",2),t.YNc(5,S,2,0,"mat-error",3),t.qZA(),t.TgZ(6,"mat-form-field",1)(7,"mat-label"),t._uU(8,"Password"),t.qZA(),t._UZ(9,"input",4),t.YNc(10,gt,2,0,"mat-error",3),t.qZA(),t.TgZ(11,"button",5),t._uU(12," Sign In "),t.qZA(),t.YNc(13,Mt,5,2,"div",6),t.YNc(14,St,11,0,"div",7),t.qZA()),2&r){let p,y;t.Q6J("formGroup",a.authenticationForm),t.xp6(5),t.Q6J("ngIf",null==(p=a.authenticationForm.get("username"))?null:p.hasError("required")),t.xp6(5),t.Q6J("ngIf",null==(y=a.authenticationForm.get("password"))?null:y.hasError("required")),t.xp6(3),t.Q6J("ngIf",a.error),t.xp6(1),t.Q6J("ngIf",a.landing)}},dependencies:[I.O5,q.lW,b.TO,b.KE,b.hX,j.Nt,g._Y,g.Fj,g.JJ,g.JL,g.Q7,g.sg,g.u],styles:['.auth-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px}.auth-form__field[_ngcontent-%COMP%], .auth-form__button[_ngcontent-%COMP%]{width:100%}.auth-form__error[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:12px;margin:24px 0;padding:16px;border-radius:4px;background-color:#ffebee;color:#b71c1c;overflow:hidden}.auth-form__error-icon[_ngcontent-%COMP%]{font-size:48px;font-variation-settings:"fill" 0,"wght" 400,"grad" 0,"opsz" 48}.auth-form__error-message[_ngcontent-%COMP%]{text-align:center}.auth-form__footer[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;gap:100px;margin-top:32px;flex-wrap:wrap;text-align:center}.auth-form__footer[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{display:flex;gap:15px}.auth-form__footer-text[_ngcontent-%COMP%]{opacity:.6}.auth-form__footer-link[_ngcontent-%COMP%]{color:#1e88e5;cursor:pointer;text-decoration:underline;font-weight:500}.auth-form__footer-link[_ngcontent-%COMP%]:hover{text-decoration:none}[_nghost-%COMP%] a{color:#e53935;cursor:pointer;text-decoration:underline}'],data:{animation:[(0,x.X$)("slide",[(0,x.eR)(":enter",[(0,x.oB)({height:"0px",opacity:0}),(0,x.jt)("250ms ease-out",(0,x.oB)({height:"*",opacity:1}))]),(0,x.eR)(":leave",[(0,x.jt)("250ms ease-out",(0,x.oB)({height:"0px",opacity:0}))])])]}}),i})();function Dt(i,d){1&i&&(t.TgZ(0,"div",7)(1,"div",8),t._uU(2,"Welcome to Mage"),t.qZA(),t.TgZ(3,"div",9),t._uU(4,"Sign in to your account"),t.qZA()())}function Ut(i,d){if(1&i){const r=t.EpF();t.TgZ(0,"local-authentication",10),t.NdJ("signup",function(){t.CHM(r);const p=t.oxw();return t.KtG(p.onSignup())})("authenticated",function(p){t.CHM(r);const y=t.oxw();return t.KtG(y.signin(p))}),t.qZA()}if(2&i){const r=t.oxw();t.Q6J("landing",r.landing)}}function A(i,d){1&i&&(t.TgZ(0,"div")(1,"div",11),t._UZ(2,"div",12),t.TgZ(3,"div",13),t._uU(4,"or"),t.qZA(),t._UZ(5,"div",12),t.qZA()())}function F(i,d){if(1&i){const r=t.EpF();t.TgZ(0,"idp-authentication",16),t.NdJ("authenticated",function(p){t.CHM(r);const y=t.oxw(2);return t.KtG(y.signin(p))}),t.qZA()}if(2&i){const r=t.oxw().$implicit;t.Q6J("strategy",r)}}function h(i,d){if(1&i){const r=t.EpF();t.TgZ(0,"idp-authentication",16),t.NdJ("authenticated",function(p){t.CHM(r);const y=t.oxw(2);return t.KtG(y.signin(p))}),t.qZA()}if(2&i){const r=t.oxw().$implicit;t.Q6J("strategy",r)}}function f(i,d){if(1&i){const r=t.EpF();t.TgZ(0,"idp-authentication",16),t.NdJ("authenticated",function(p){t.CHM(r);const y=t.oxw(2);return t.KtG(y.signin(p))}),t.qZA()}if(2&i){const r=t.oxw().$implicit;t.Q6J("strategy",r)}}function v(i,d){if(1&i){const r=t.EpF();t.TgZ(0,"ldap-authentication",16),t.NdJ("authenticated",function(p){t.CHM(r);const y=t.oxw(2);return t.KtG(y.signin(p))}),t.qZA()}if(2&i){const r=t.oxw().$implicit;t.Q6J("strategy",r)}}function O(i,d){if(1&i&&(t.TgZ(0,"div"),t.ynx(1,14),t.YNc(2,F,1,1,"idp-authentication",15),t.YNc(3,h,1,1,"idp-authentication",15),t.YNc(4,f,1,1,"idp-authentication",15),t.YNc(5,v,1,1,"ldap-authentication",15),t.BQk(),t.qZA()),2&i){const r=d.$implicit;t.xp6(1),t.Q6J("ngSwitch",null==r?null:r.type),t.xp6(1),t.Q6J("ngSwitchCase","oauth"),t.xp6(1),t.Q6J("ngSwitchCase","saml"),t.xp6(1),t.Q6J("ngSwitchCase","openidconnect"),t.xp6(1),t.Q6J("ngSwitchCase","ldap")}}let Z=(()=>{class i{constructor(){this.landing=!1,this.signup=new t.vpe,this.authenticated=new t.vpe}ngOnChanges(r){r.api&&(this.api=r.api.currentValue,this.localAuthenticationStrategy=this.api?.authenticationStrategies.local,this.localAuthenticationStrategy&&(this.localAuthenticationStrategy.name="local"),this.thirdPartyStrategies=ct.UI(ct.CE(this.api?.authenticationStrategies,this.localStrategyFilter),function(a,p){return a.name=p,a}))}localStrategyFilter(r,a){return"local"===a}signin(r){this.authenticated.emit(r)}onSignup(){this.signup.emit()}}return i.\u0275fac=function(r){return new(r||i)},i.\u0275cmp=t.Xpm({type:i,selectors:[["authentication"]],inputs:{api:"api",landing:"landing"},outputs:{signup:"signup",authenticated:"authenticated"},features:[t.TTD],decls:7,vars:4,consts:[[1,"signin-container"],["class","welcome",4,"ngIf"],[1,"authentications"],["strategy","localAuthenticationStrategy",3,"landing","signup","authenticated",4,"ngIf"],[4,"ngIf"],[1,"strategies"],[4,"ngFor","ngForOf"],[1,"welcome"],[1,"welcome__title"],[1,"welcome__message"],["strategy","localAuthenticationStrategy",3,"landing","signup","authenticated"],[1,"or"],[1,"or__divider"],[1,"or__text"],[3,"ngSwitch"],[3,"strategy","authenticated",4,"ngSwitchCase"],[3,"strategy","authenticated"]],template:function(r,a){1&r&&(t.TgZ(0,"div",0),t.YNc(1,Dt,5,0,"div",1),t.TgZ(2,"div",2),t.YNc(3,Ut,1,1,"local-authentication",3),t.YNc(4,A,6,0,"div",4),t.TgZ(5,"div",5),t.YNc(6,O,6,5,"div",6),t.qZA()()()),2&r&&(t.xp6(1),t.Q6J("ngIf",a.landing),t.xp6(2),t.Q6J("ngIf",a.localAuthenticationStrategy),t.xp6(1),t.Q6J("ngIf",a.localAuthenticationStrategy&&a.thirdPartyStrategies.length),t.xp6(2),t.Q6J("ngForOf",a.thirdPartyStrategies))},dependencies:[I.sg,I.O5,I.RF,I.n9,E,nt,Nt],styles:["[_nghost-%COMP%]{height:100%;width:100%}.authentications[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:start}.signin-container[_ngcontent-%COMP%]{height:100%;display:flex;flex-direction:column;gap:48px}.welcome[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:end;color:#1e88e5;height:30vh}.welcome__title[_ngcontent-%COMP%]{margin-bottom:16px;font:400 45px/48px Roboto,Helvetica Neue,sans-serif}.welcome__message[_ngcontent-%COMP%]{font:500 20px/32px Roboto,Helvetica Neue,sans-serif}.or[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:center;gap:8px;margin:36px 0}.or__text[_ngcontent-%COMP%]{opacity:.6}.or__divider[_ngcontent-%COMP%]{flex:1;height:2px;background-color:#00000026;border-radius:1px}.strategies[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px}"]}),i})();function tt(i,d){1&i&&(t.TgZ(0,"mat-error"),t._uU(1,"Invalid access code"),t.qZA())}let it=(()=>{class i{constructor(r){this.userService=r,this.authorized=new t.vpe,this.deviceId=new g.NI("",[g.kI.required])}authorize(){this.deviceId.setErrors(null),this.userService.authorize(this.token,this.deviceId.value).subscribe({next:r=>{this.authorized.emit({token:r.token})},error:()=>{this.deviceId.setErrors({invalid:!0})}})}}return i.\u0275fac=function(r){return new(r||i)(t.Y36(D.K))},i.\u0275cmp=t.Xpm({type:i,selectors:[["authorization"]],inputs:{token:"token"},outputs:{authorized:"authorized"},decls:15,vars:2,consts:[[1,"authorization"],[1,"header"],[1,"header__title"],[1,"header__message"],["appearance","fill"],["matInput","","placeholder","Access Code","type","deviceId","required","",3,"formControl","keydown.enter"],[4,"ngIf"],[1,"authorize"],["mat-flat-button","","color","primary",3,"click"]],template:function(r,a){1&r&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2),t._uU(3,"Access Code"),t.qZA(),t.TgZ(4,"div",3),t._uU(5,"Please enter your Mage access code. If you do not have an access code please ask you Mage administrator to provide you with one."),t.qZA()(),t.TgZ(6,"div")(7,"mat-form-field",4)(8,"mat-label"),t._uU(9,"Access Code"),t.qZA(),t.TgZ(10,"input",5),t.NdJ("keydown.enter",function(){return a.authorize()}),t.qZA(),t.YNc(11,tt,2,0,"mat-error",6),t.qZA()(),t.TgZ(12,"div",7)(13,"button",8),t.NdJ("click",function(){return a.authorize()}),t._uU(14,"Continue to Mage"),t.qZA()()()),2&r&&(t.xp6(10),t.Q6J("formControl",a.deviceId),t.xp6(1),t.Q6J("ngIf",a.deviceId.hasError("invalid")))},dependencies:[I.O5,q.lW,b.TO,b.KE,b.hX,j.Nt,g.Fj,g.JJ,g.Q7,g.oH],styles:["[_nghost-%COMP%]{width:100%}.authorization[_ngcontent-%COMP%]{height:100%;display:flex;flex-direction:column;gap:48px}.header[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:end;height:30vh}.header__title[_ngcontent-%COMP%]{font:400 34px/40px Roboto,Helvetica Neue,sans-serif;color:#1e88e5;margin-bottom:16px}.header__message[_ngcontent-%COMP%]{font:400 16px/20px Roboto,Helvetica Neue,sans-serif;margin-bottom:32px;opacity:60%}.authorize[_ngcontent-%COMP%]{display:flex;justify-content:flex-end}mat-form-field[_ngcontent-%COMP%]{width:100%}"]}),i})();var $=C(25022),Y=C(34726),J=C(93935),B=C(66088),ot=C(64979),Ht=C(80529),Kt=C(96213);let Gt=(()=>{class i{constructor(r){this.httpClient=r}initialize(r,a,p){return this.httpClient.post("/api/setup",{username:r,password:a,passwordconfirm:a,uid:p},{context:(new Ht.qT).set(Kt.h,!0)})}}return i.\u0275fac=function(r){return new(r||i)(t.LFG(Ht.eN))},i.\u0275prov=t.Yz7({token:i,factory:i.\u0275fac,providedIn:"root"}),i})();var qt=C(73162);function Vt(i,d){1&i&&(t.TgZ(0,"mat-error"),t._uU(1,"Password is required"),t.qZA())}function It(i,d){1&i&&(t.TgZ(0,"mat-error"),t._uU(1,"Passwords must match"),t.qZA())}function _e(i,d){1&i&&(t.TgZ(0,"mat-error"),t._uU(1,"Password confirmation is required"),t.qZA())}function ge(i,d){if(1&i&&(t.TgZ(0,"div",19)(1,"div",20)(2,"span",21),t._uU(3,"sentiment_dissatisfied"),t.qZA(),t.TgZ(4,"div",22)(5,"div"),t._uU(6),t.qZA(),t.TgZ(7,"div"),t._uU(8),t.qZA()()()()),2&i){const r=t.oxw();t.Q6J("@slide",void 0),t.xp6(6),t.Oqu(null==r.error?null:r.error.title),t.xp6(2),t.Oqu(null==r.error?null:r.error.message)}}let ve=(()=>{class i{constructor(r,a){this.userService=r,this.initializeService=a,this.initialized=new t.vpe,this.accountForm=new g.cw({username:new g.NI("",[g.kI.required]),password:new g.NI("",[g.kI.required]),passwordconfirm:new g.NI("",[g.kI.required]),accessCode:new g.NI("",[g.kI.required])}),this.accountForm.controls.password.valueChanges.subscribe(p=>{this.onPasswordChanged(p)})}ngOnInit(){Y.Mu.setOptions({dictionary:{...J.F,...B.F},graphs:J.x,translations:ot.Z})}onPasswordChanged(r){if(r&&r.length>0){const a=r&&r.length?(0,Y.tu)(r,[this.accountForm.value.username]).score:0;this.passwordStrength=$.A[a]}else this.passwordStrength=$.A[0]}onInitialize(){const{username:r,password:a,passwordconfirm:p,accessCode:y}=this.accountForm.value;this.accountForm.controls.password.setErrors(a!==p?{match:!0}:a.length<1?{required:!0}:null),this.accountForm.markAllAsTouched(),!this.accountForm.invalid&&this.initializeService.initialize(r,a,y).subscribe({next:()=>{this.userService.signin(r,a).subscribe({next:Q=>{this.userService.authorize(Q.token,y).subscribe({next:et=>{this.initialized.emit({token:et.token})}})}})},error:Q=>{this.error={title:"Could not create account",message:Q.error}}})}}return i.\u0275fac=function(r){return new(r||i)(t.Y36(D.K),t.Y36(Gt))},i.\u0275cmp=t.Xpm({type:i,selectors:[["initialize"]],outputs:{initialized:"initialized"},decls:47,vars:7,consts:[[1,"container"],[1,"welcome"],[1,"welcome__title"],[1,"welcome__message"],[1,"form",3,"formGroup","ngSubmit"],["appearance","fill"],["matInput","","placeholder","Username","formControlName","username","required",""],["matInput","","placeholder","Password","type","password","formControlName","password","required",""],[4,"ngIf"],["matInput","","placeholder","Confirm Password","type","password","formControlName","passwordconfirm","required",""],[1,"password-strength"],[1,"password-strength__text"],[1,"mat-body-1"],[1,"mat-body-2"],["mode","determinate",3,"value"],["matInput","","placeholder","Access Code","type","text","formControlName","accessCode","required",""],[1,"actions"],["mat-flat-button","","color","primary",1,"actions__button"],["class","error-container",4,"ngIf"],[1,"error-container"],[1,"error"],[1,"material-symbols-outlined","error__icon"],[1,"error__message"]],template:function(r,a){1&r&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2),t._uU(3,"Admin Account Creation"),t.qZA(),t.TgZ(4,"div",3),t._uU(5,"Create an account to access and administor Mage"),t.qZA()(),t.TgZ(6,"form",4),t.NdJ("ngSubmit",function(){return a.onInitialize()}),t.TgZ(7,"div")(8,"mat-form-field",5)(9,"mat-label"),t._uU(10,"Username"),t.qZA(),t._UZ(11,"input",6),t.TgZ(12,"mat-error"),t._uU(13,"Username is required"),t.qZA()()(),t.TgZ(14,"div")(15,"mat-form-field",5)(16,"mat-label"),t._uU(17,"Password"),t.qZA(),t._UZ(18,"input",7),t.YNc(19,Vt,2,0,"mat-error",8),t.YNc(20,It,2,0,"mat-error",8),t.qZA()(),t.TgZ(21,"div")(22,"mat-form-field",5)(23,"mat-label"),t._uU(24,"Confirm Password"),t.qZA(),t._UZ(25,"input",9),t.YNc(26,_e,2,0,"mat-error",8),t.qZA()(),t.TgZ(27,"div",10)(28,"div",11)(29,"div",12),t._uU(30,"Password Strengh"),t.qZA(),t.TgZ(31,"div",13),t._uU(32),t.qZA()(),t._UZ(33,"mat-progress-bar",14),t.qZA(),t.TgZ(34,"div")(35,"mat-form-field",5)(36,"mat-label"),t._uU(37,"Access Code"),t.qZA(),t._UZ(38,"input",15),t.TgZ(39,"mat-hint"),t._uU(40,"This code will allow users to access Mage via the web client"),t.qZA(),t.TgZ(41,"mat-error"),t._uU(42,"Access code is required"),t.qZA()()(),t.TgZ(43,"div",16)(44,"button",17),t._uU(45,"Create Account"),t.qZA()(),t.YNc(46,ge,9,3,"div",18),t.qZA()()),2&r&&(t.xp6(6),t.Q6J("formGroup",a.accountForm),t.xp6(13),t.Q6J("ngIf",a.accountForm.controls.password.hasError("required")),t.xp6(1),t.Q6J("ngIf",a.accountForm.controls.password.hasError("match")),t.xp6(6),t.Q6J("ngIf",a.accountForm.controls.passwordconfirm.hasError("required")),t.xp6(6),t.Oqu(null==a.passwordStrength?null:a.passwordStrength.text),t.xp6(1),t.Q6J("value",null==a.passwordStrength?null:a.passwordStrength.value),t.xp6(13),t.Q6J("ngIf",a.error))},dependencies:[I.O5,q.lW,b.TO,b.KE,b.bx,b.hX,j.Nt,qt.pW,g._Y,g.Fj,g.JJ,g.JL,g.Q7,g.sg,g.u],styles:['[_nghost-%COMP%]{width:100%;height:100%}[_nghost-%COMP%] a{color:#e53935;cursor:pointer;text-decoration:underline}mat-form-field[_ngcontent-%COMP%]{width:100%;margin-bottom:16px}.container[_ngcontent-%COMP%]{height:100%;display:flex;flex-direction:column;gap:48px;padding-top:32px}.form[_ngcontent-%COMP%]{padding-bottom:16px}.welcome[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:end;color:#1e88e5;height:30vh}.welcome__title[_ngcontent-%COMP%]{margin-bottom:16px;font:400 45px/48px Roboto,Helvetica Neue,sans-serif}.welcome__message[_ngcontent-%COMP%]{font:500 20px/32px Roboto,Helvetica Neue,sans-serif}.password-strength[_ngcontent-%COMP%]{margin-bottom:32px}.password-strength__text[_ngcontent-%COMP%]{margin-bottom:8px}.actions[_ngcontent-%COMP%]{width:100%;display:flex;flex-direction:row;align-items:center;gap:16px;margin-top:16px}.actions__button[_ngcontent-%COMP%]{flex:1}.error-container[_ngcontent-%COMP%]{overflow:hidden}.error[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:8px;margin-top:24px;color:#e53935;border-radius:4px;padding:0 16px}.error__icon[_ngcontent-%COMP%]{font-size:48px;font-variation-settings:"fill" 0,"wght" 400,"grad" 0,"opsz" 48}.error__message[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1;text-align:center;gap:4px}'],data:{animation:[(0,x.X$)("slide",[(0,x.eR)(":enter",[(0,x.oB)({height:"0px",opacity:0}),(0,x.jt)("250ms ease-out",(0,x.oB)({height:"*",opacity:1}))]),(0,x.eR)(":leave",[(0,x.jt)("250ms ease-out",(0,x.oB)({height:"0px",opacity:0}))])])]}}),i})();var $t=C(77579),U=C(82722);function Ce(i,d,r){return a=>{const p=a.value;if(!p)return null;const y=i.helpTextTemplate,Q=[],et={},be=[{enabled:i.passwordMinLengthEnabled,valid:p.length>=i.passwordMinLength,key:"passwordMinLength",template:y.passwordMinLength,value:i.passwordMinLength},{enabled:i.lowLettersEnabled,valid:(p.match(/[a-z]/g)||[]).length>=i.lowLetters,key:"lowLetters",template:y.lowLetters,value:i.lowLetters},{enabled:i.minCharsEnabled,valid:(p.match(/[a-z]/gi)||[]).length>=i.minChars,key:"minChars",template:y.minChars,value:i.minChars},{enabled:i.highLettersEnabled,valid:(p.match(/[A-Z]/g)||[]).length>=i.highLetters,key:"highLetters",template:y.highLetters,value:i.highLetters},{enabled:i.numbersEnabled,valid:(p.match(/[0-9]/g)||[]).length>=i.numbers,key:"numbers",template:y.numbers,value:i.numbers},{enabled:i.specialCharsEnabled,valid:(p.match(/[^a-zA-Z0-9]/g)||[]).length>=i.specialChars,key:"specialChars",template:y.specialChars,value:i.specialChars}];for(const W of be)W.enabled&&!W.valid&&(et[W.key]=!0,Q.push(`Must ${W.template?.replace("#",W.value.toString())}`));if(i.maxConCharsEnabled&&new RegExp(`[a-zA-Z]{${i.maxConChars+1},}`).test(p)&&(et.maxConChars=!0,Q.push(`Must ${y.maxConChars?.replace("#",i.maxConChars.toString())}`)),i.restrictSpecialCharsEnabled){const W=i.restrictSpecialChars.split("");(p.match(/[^a-zA-Z0-9]/g)||[]).some(pe=>!W.includes(pe))&&(et.restrictSpecialChars=!0,Q.push(`Must ${y.restrictSpecialChars?.replace("#",i.restrictSpecialChars)}`))}return d(Q),Object.keys(et).length?et:null}}function Wt(i){return d=>d.value!==i()?{match:!0}:null}var Xt=C(97392),M=C(10266);function jt(i,d){1&i&&(t.TgZ(0,"mat-error"),t._uU(1," Username is required "),t.qZA())}function te(i,d){1&i&&(t.TgZ(0,"mat-error"),t._uU(1," Username already exists "),t.qZA())}function Lt(i,d){if(1&i&&(t.TgZ(0,"div",27),t.YNc(1,jt,2,0,"mat-error",28),t.YNc(2,te,2,0,"mat-error",28),t.qZA()),2&i){const r=t.oxw();t.xp6(1),t.Q6J("ngIf",r.signup.controls.username.hasError("required")),t.xp6(1),t.Q6J("ngIf",r.signup.controls.username.hasError("exists"))}}function ee(i,d){1&i&&(t.TgZ(0,"mat-error"),t._uU(1," Display name is required "),t.qZA())}function we(i,d){if(1&i&&(t.TgZ(0,"div",27),t.YNc(1,ee,2,0,"mat-error",28),t.qZA()),2&i){const r=t.oxw();t.xp6(1),t.Q6J("ngIf",r.signup.controls.displayName.hasError("required"))}}function vt(i,d){1&i&&(t.TgZ(0,"mat-error"),t._uU(1," Must be a valid email address "),t.qZA())}function Rt(i,d){if(1&i&&(t.TgZ(0,"div",27),t.YNc(1,vt,2,0,"mat-error",28),t.qZA()),2&i){const r=t.oxw();t.xp6(1),t.Q6J("ngIf",r.signup.controls.email.hasError("email"))}}function Jt(i,d){if(1&i&&(t.TgZ(0,"div"),t._uU(1),t.qZA()),2&i){const r=d.$implicit;t.xp6(1),t.hij(" ",r," ")}}function ne(i,d){if(1&i&&(t.TgZ(0,"mat-error"),t.YNc(1,Jt,2,1,"div",29),t.qZA()),2&i){const r=d.ngIf,a=t.oxw(2);t.xp6(1),t.Q6J("ngForOf",a.getPasswordErrorMessages(r))}}function zt(i,d){if(1&i&&(t.TgZ(0,"div",27),t.YNc(1,ne,2,1,"mat-error",28),t.qZA()),2&i){const r=t.oxw();t.xp6(1),t.Q6J("ngIf",r.signup.controls.password.errors)}}function ie(i,d){1&i&&(t.TgZ(0,"mat-error"),t._uU(1," Password confirmation is required "),t.qZA())}function Te(i,d){1&i&&(t.TgZ(0,"mat-error"),t._uU(1," Passwords must match "),t.qZA())}function oe(i,d){if(1&i&&(t.TgZ(0,"div",27),t.YNc(1,ie,2,0,"mat-error",28),t.YNc(2,Te,2,0,"mat-error",28),t.qZA()),2&i){const r=t.oxw();t.xp6(1),t.Q6J("ngIf",r.signup.controls.passwordconfirm.hasError("required")),t.xp6(1),t.Q6J("ngIf",r.signup.controls.passwordconfirm.hasError("match"))}}function xe(i,d){1&i&&(t.TgZ(0,"div",30)(1,"div",31)(2,"div",32),t._uU(3,"Generating Captcha..."),t.qZA(),t._UZ(4,"mat-progress-bar",33),t.qZA()())}function Ae(i,d){if(1&i&&(t.TgZ(0,"div",34),t._UZ(1,"img",35),t.qZA()),2&i){const r=t.oxw();t.xp6(1),t.Q6J("src",r.captcha.uri,t.LSH)}}function Me(i,d){if(1&i){const r=t.EpF();t.TgZ(0,"div",36)(1,"button",37),t.NdJ("click",function(){t.CHM(r);const p=t.oxw();return t.KtG(p.getCaptcha())}),t.TgZ(2,"mat-icon"),t._uU(3,"refresh"),t.qZA()()()}}function Ie(i,d){1&i&&(t.TgZ(0,"mat-error"),t._uU(1,"Captcha is required"),t.qZA())}function Pe(i,d){1&i&&(t.TgZ(0,"mat-error"),t._uU(1,"Invalid captcha"),t.qZA())}function dt(i,d){if(1&i&&(t.TgZ(0,"div",27),t.YNc(1,Ie,2,0,"mat-error",28),t.YNc(2,Pe,2,0,"mat-error",28),t.qZA()),2&i){const r=t.oxw();t.xp6(1),t.Q6J("ngIf",r.signup.controls.captchaText.hasError("required")),t.xp6(1),t.Q6J("ngIf",r.signup.controls.captchaText.hasError("invalid"))}}const Oe=function(i){return{"--password-bar-color":i}};let re=(()=>{class i{constructor(r,a){this.apiService=r,this.userService=a,this.complete=new t.vpe,this.showPassword=!1,this.showConfirmPassword=!1,this.passwordErrorMessages=[],this.signup=new g.cw({username:new g.NI("",[g.kI.required]),displayName:new g.NI("",[g.kI.required]),email:new g.NI("",[g.kI.email]),phone:new g.NI(""),password:new g.NI("",[g.kI.required]),passwordconfirm:new g.NI("",[g.kI.required]),captchaText:new g.NI("",[g.kI.required])}),this.loadingCaptcha=!1,this.captcha={},this.destroy$=new $t.x}ngOnInit(){Y.Mu.setOptions({dictionary:{...J.F,...B.F},graphs:J.x,translations:ot.Z}),this.apiService.getApi().pipe((0,U.R)(this.destroy$)).subscribe(r=>{this.passwordPolicy=r.authenticationStrategies.local.settings.passwordPolicy,this.signup.setControl("password",new g.NI("",{validators:[g.kI.required,Ce(this.passwordPolicy,p=>this.passwordErrorMessages=p)]})),this.signup.setControl("passwordconfirm",new g.NI("",{validators:[g.kI.required,Wt(()=>this.signup.controls.password.value??"")]})),this.signup.controls.password.valueChanges.pipe((0,U.R)(this.destroy$)).subscribe(p=>{this.onPasswordChanged(p??"")})})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}onPasswordChanged(r){this.passwordStrength=function N(i,d){const r=i?(0,Y.tu)(i,d?[d]:[]).score:0;return $.A[r]}(r,this.signup.controls.username.value??"")}get passwordTooltipText(){return this.passwordPolicy?function ye(i){const d=[];return i.passwordMinLengthEnabled&&d.push(`\u2022 At least ${i.passwordMinLength} characters`),i.minCharsEnabled&&d.push(`\u2022 At least ${i.minChars} letters`),i.lowLettersEnabled&&d.push(`\u2022 Minimum ${i.lowLetters} lowercase letter(s)`),i.highLettersEnabled&&d.push(`\u2022 Minimum ${i.highLetters} uppercase letter(s)`),i.numbersEnabled&&d.push(`\u2022 Minimum ${i.numbers} number(s)`),i.specialCharsEnabled&&d.push(`\u2022 Minimum ${i.specialChars} special character(s)`),i.maxConCharsEnabled&&d.push(`\u2022 Max ${i.maxConChars} repeated characters`),i.restrictSpecialCharsEnabled&&d.push(`\u2022 Allowed: ${i.restrictSpecialChars}`),d.join("\n")}(this.passwordPolicy):""}getCaptcha(){this.loadingCaptcha=!0;const r=this.signup.controls.username.value;r?this.userService.signup(r).pipe((0,U.R)(this.destroy$)).subscribe(a=>{this.captcha={uri:a.captcha,token:a.token},this.loadingCaptcha=!1}):this.loadingCaptcha=!1}onCancel(){this.complete.emit({reason:"cancel"})}onSignup(){if((this.signup.controls.password.value??"")!==(this.signup.controls.passwordconfirm.value??""))this.signup.controls.passwordconfirm.setErrors({match:!0});else{const p=this.signup.controls.passwordconfirm,y=p.errors;y?.match&&(delete y.match,p.setErrors(Object.keys(y).length?y:null))}this.signup.markAllAsTouched(),this.signup.valid&&this.userService.signupVerify(this.signup.value,this.captcha.token).pipe((0,U.R)(this.destroy$)).subscribe({next:p=>{this.complete.emit({reason:"signup",user:p})},error:p=>{401===p.status?this.getCaptcha():403===p.status?this.signup.controls.captchaText.setErrors({invalid:!0}):409===p.status&&(this.captcha={},this.signup.controls.username.setErrors({exists:!0}))}})}getPasswordErrorMessages(r){return r?.required?["Password is required"]:this.passwordErrorMessages}}return i.\u0275fac=function(r){return new(r||i)(t.Y36(_t.s),t.Y36(D.K))},i.\u0275cmp=t.Xpm({type:i,selectors:[["signup"]],outputs:{complete:"complete"},decls:65,vars:21,consts:[[1,"signup-container"],[1,"welcome"],[1,"welcome__title"],[1,"welcome__message"],[1,"signup",3,"formGroup"],["appearance","fill"],["matInput","","placeholder","Username","formControlName","username","required","",3,"blur"],["class","password-error-popover",4,"ngIf"],["matInput","","placeholder","Display Name","formControlName","displayName","required",""],["matInput","","placeholder","Email","formControlName","email"],["matInput","","placeholder","Phone","formControlName","phone"],["matInput","","placeholder","Password","formControlName","password","required","",3,"type"],["mat-icon-button","","type","button","matSuffix","",3,"click"],["mat-icon-button","","matTooltipClass","tooltip-wide","matSuffix","",3,"matTooltip"],["matInput","","placeholder","Confirm Password","formControlName","passwordconfirm","required","",3,"type"],[1,"password-strength"],[1,"mat-body-1"],[1,"mat-body-2"],["mode","determinate",1,"custom-password-bar",3,"value","ngStyle"],[1,"auth-captcha-container"],["class","auth-captcha-progress",4,"ngIf"],["class","auth-captcha",4,"ngIf"],["class","auth-captcha-refresh",4,"ngIf"],["matInput","","placeholder","Captcha","formControlName","captchaText","required",""],[1,"actions"],["mat-stroked-button","","type","button",1,"actions__button",3,"click"],["mat-flat-button","","color","primary","type","submit",1,"actions__button",3,"disabled","click"],[1,"password-error-popover"],[4,"ngIf"],[4,"ngFor","ngForOf"],[1,"auth-captcha-progress"],[1,"auth-captcha-progress__container"],[1,"auth-captcha-progress-text"],["mode","indeterminate",1,"auth-captcha-progressbar"],[1,"auth-captcha"],["alt","captcha image","width","100%","height","100%",3,"src"],[1,"auth-captcha-refresh"],["mat-icon-button","",3,"click"]],template:function(r,a){1&r&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2),t._uU(3,"New to Mage?"),t.qZA(),t.TgZ(4,"div",3),t._uU(5,"Let's set up your account."),t.qZA()(),t.TgZ(6,"form",4)(7,"mat-form-field",5)(8,"mat-label"),t._uU(9,"Username"),t.qZA(),t.TgZ(10,"input",6),t.NdJ("blur",function(){return a.getCaptcha()}),t.qZA(),t.YNc(11,Lt,3,2,"div",7),t.qZA(),t.TgZ(12,"mat-form-field",5)(13,"mat-label"),t._uU(14,"Display Name"),t.qZA(),t._UZ(15,"input",8),t.YNc(16,we,2,1,"div",7),t.qZA(),t.TgZ(17,"mat-form-field",5)(18,"mat-label"),t._uU(19,"Email"),t.qZA(),t._UZ(20,"input",9),t.YNc(21,Rt,2,1,"div",7),t.qZA(),t.TgZ(22,"mat-form-field",5)(23,"mat-label"),t._uU(24,"Phone"),t.qZA(),t._UZ(25,"input",10),t.qZA(),t.TgZ(26,"mat-form-field",5)(27,"mat-label"),t._uU(28,"Password"),t.qZA(),t._UZ(29,"input",11),t.TgZ(30,"button",12),t.NdJ("click",function(){return a.showPassword=!a.showPassword}),t.TgZ(31,"mat-icon"),t._uU(32),t.qZA()(),t.TgZ(33,"button",13)(34,"mat-icon"),t._uU(35,"info"),t.qZA()(),t.YNc(36,zt,2,1,"div",7),t.qZA(),t.TgZ(37,"mat-form-field",5)(38,"mat-label"),t._uU(39,"Confirm Password"),t.qZA(),t._UZ(40,"input",14),t.TgZ(41,"button",12),t.NdJ("click",function(){return a.showConfirmPassword=!a.showConfirmPassword}),t.TgZ(42,"mat-icon"),t._uU(43),t.qZA()(),t.YNc(44,oe,3,2,"div",7),t.qZA(),t.TgZ(45,"div",15)(46,"div",16),t._uU(47,"Password Strength"),t.qZA(),t.TgZ(48,"div",17),t._uU(49),t.qZA(),t._UZ(50,"mat-progress-bar",18),t.qZA(),t.TgZ(51,"div",19),t.YNc(52,xe,5,0,"div",20),t.YNc(53,Ae,2,1,"div",21),t.YNc(54,Me,4,0,"div",22),t.qZA(),t.TgZ(55,"mat-form-field",5)(56,"mat-label"),t._uU(57,"Captcha"),t.qZA(),t._UZ(58,"input",23),t.YNc(59,dt,3,2,"div",7),t.qZA(),t.TgZ(60,"div",24)(61,"button",25),t.NdJ("click",function(){return a.onCancel()}),t._uU(62," Cancel "),t.qZA(),t.TgZ(63,"button",26),t.NdJ("click",function(){return a.onSignup()}),t._uU(64," Signup "),t.qZA()()()()),2&r&&(t.xp6(6),t.Q6J("formGroup",a.signup),t.xp6(5),t.Q6J("ngIf",a.signup.controls.username.invalid&&a.signup.controls.username.touched),t.xp6(5),t.Q6J("ngIf",a.signup.controls.displayName.invalid&&a.signup.controls.displayName.touched),t.xp6(5),t.Q6J("ngIf",a.signup.controls.email.invalid&&a.signup.controls.email.touched),t.xp6(8),t.Q6J("type",a.showPassword?"text":"password"),t.xp6(3),t.Oqu(a.showPassword?"visibility_off":"visibility"),t.xp6(1),t.s9C("matTooltip",a.passwordTooltipText),t.xp6(3),t.Q6J("ngIf",a.signup.controls.password.invalid&&a.signup.controls.password.touched),t.xp6(4),t.Q6J("type",a.showConfirmPassword?"text":"password"),t.xp6(3),t.Oqu(a.showConfirmPassword?"visibility_off":"visibility"),t.xp6(1),t.Q6J("ngIf",a.signup.controls.passwordconfirm.invalid&&a.signup.controls.passwordconfirm.touched),t.xp6(5),t.Oqu(null==a.passwordStrength?null:a.passwordStrength.text),t.xp6(1),t.Q6J("value",null==a.passwordStrength?null:a.passwordStrength.value)("ngStyle",t.VKq(19,Oe,null==a.passwordStrength?null:a.passwordStrength.color)),t.xp6(2),t.Q6J("ngIf",a.loadingCaptcha),t.xp6(1),t.Q6J("ngIf",a.captcha.uri&&!a.loadingCaptcha),t.xp6(1),t.Q6J("ngIf",a.captcha.uri),t.xp6(5),t.Q6J("ngIf",a.signup.controls.captchaText.invalid&&a.signup.controls.captchaText.touched),t.xp6(4),t.Q6J("disabled",a.signup.invalid))},dependencies:[I.sg,I.O5,I.PC,q.lW,Xt.Hw,b.TO,b.KE,b.hX,b.R9,j.Nt,qt.pW,g._Y,g.Fj,g.JJ,g.JL,g.Q7,g.sg,g.u,M.gM],styles:["[_nghost-%COMP%]{width:100%;height:100%}mat-form-field[_ngcontent-%COMP%]{width:100%;margin-bottom:8px}.signup-container[_ngcontent-%COMP%]{height:100%;display:flex;flex-direction:column;gap:48px;padding-top:32px}.signup[_ngcontent-%COMP%]{padding-bottom:16px}.welcome[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:end;color:#1e88e5}.welcome__title[_ngcontent-%COMP%]{margin-bottom:16px;font:400 45px/48px Roboto,Helvetica Neue,sans-serif}.welcome__message[_ngcontent-%COMP%]{font:500 20px/32px Roboto,Helvetica Neue,sans-serif}.auth-captcha-container[_ngcontent-%COMP%]{position:relative;border:1px solid rgba(0,0,0,.4);border-radius:4px;padding:4px;width:100%;height:80px;margin:16px 0}.auth-captcha[_ngcontent-%COMP%]{position:absolute;inset:4px 56px}.auth-captcha-progress[_ngcontent-%COMP%]{display:flex;flex-direction:row;justify-content:center;align-items:center;height:100%}.auth-captcha-progress__container[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;margin:0 64px;width:100%}.auth-captcha-progress-text[_ngcontent-%COMP%]{color:#0009;font-size:24px}.auth-captcha-progressbar[_ngcontent-%COMP%]{margin-top:8px}.auth-captcha-refresh[_ngcontent-%COMP%]{position:absolute;right:8px;top:24px}.actions[_ngcontent-%COMP%]{width:100%;display:flex;flex-direction:row;align-items:center;gap:16px;margin-top:16px}.actions__button[_ngcontent-%COMP%]{flex:1}.tooltip-wide[_ngcontent-%COMP%]{white-space:pre-line;max-width:300px}.password-error-popover[_ngcontent-%COMP%]{position:absolute;background:#fff0f0;border:1px solid #f44336;color:#b71c1c;border-radius:4px;padding:8px 12px;font-size:13px;z-index:10;box-shadow:0 2px 6px #00000026;margin-top:4px;width:100%}.error-item[_ngcontent-%COMP%]{margin-bottom:4px}.error-item[_ngcontent-%COMP%]:last-child{margin-bottom:0} .custom-password-bar .mat-progress-bar-fill:after{background-color:var(--password-bar-color)!important}"]}),i})();function Ft(i,d){if(1&i){const r=t.EpF();t.TgZ(0,"div",2)(1,"authentication",3),t.NdJ("authenticated",function(p){t.CHM(r);const y=t.oxw();return t.KtG(y.onAuthenticated(p))})("signup",function(){t.CHM(r);const p=t.oxw();return t.KtG(p.onSignup())}),t.qZA()()}if(2&i){const r=t.oxw();t.Q6J("@slide",void 0),t.xp6(1),t.Q6J("landing",r.landing)("api",r.api)}}function Yt(i,d){if(1&i){const r=t.EpF();t.TgZ(0,"div",2)(1,"authorization",4),t.NdJ("authorized",function(p){t.CHM(r);const y=t.oxw();return t.KtG(y.onAuthorized(p))}),t.qZA()()}if(2&i){const r=t.oxw();t.Q6J("@slide",void 0),t.xp6(1),t.Q6J("token",r.getAuthenticationToken())}}function se(i,d){if(1&i){const r=t.EpF();t.TgZ(0,"div",2)(1,"disclaimer",5),t.NdJ("close",function(p){t.CHM(r);const y=t.oxw();return t.KtG(y.onDisclaimer(p))}),t.qZA()()}if(2&i){const r=t.oxw();t.Q6J("@slide",void 0),t.xp6(1),t.Q6J("title",null==r.api||null==r.api.disclaimer?null:r.api.disclaimer.title)("text",null==r.api||null==r.api.disclaimer?null:r.api.disclaimer.text)}}function Pt(i,d){if(1&i){const r=t.EpF();t.TgZ(0,"div",2)(1,"signup",6),t.NdJ("complete",function(p){t.CHM(r);const y=t.oxw();return t.KtG(y.signup(p))}),t.qZA()()}2&i&&t.Q6J("@slide",void 0)}function ae(i,d){if(1&i){const r=t.EpF();t.TgZ(0,"div",2)(1,"account-status",7),t.NdJ("complete",function(){t.CHM(r);const p=t.oxw();return t.KtG(p.onAccountStatus())}),t.qZA()()}2&i&&(t.Q6J("@slide",void 0),t.xp6(1),t.Q6J("active",!0))}function Ee(i,d){if(1&i){const r=t.EpF();t.TgZ(0,"div",2)(1,"account-status",7),t.NdJ("complete",function(){t.CHM(r);const p=t.oxw();return t.KtG(p.onAccountStatus())}),t.qZA()()}2&i&&(t.Q6J("@slide",void 0),t.xp6(1),t.Q6J("active",!1))}function ce(i,d){if(1&i){const r=t.EpF();t.TgZ(0,"div",2)(1,"initialize",8),t.NdJ("initialized",function(p){t.CHM(r);const y=t.oxw();return t.KtG(y.onInitialized(p))}),t.qZA()()}2&i&&t.Q6J("@slide",void 0)}var G=(()=>{return(i=G||(G={}))[i.Initialize=0]="Initialize",i[i.Signin=1]="Signin",i[i.Signup=2]="Signup",i[i.Authorization=3]="Authorization",i[i.Disclaimer=4]="Disclaimer",i[i.ActiveAccount=5]="ActiveAccount",i[i.DisabledAccount=6]="DisabledAccount",i[i.InactiveAccount=7]="InactiveAccount",G;var i})();class lt{}class Ot extends lt{constructor(){super(...arguments),this.state=G.Signin}}class le extends lt{constructor(){super(...arguments),this.state=G.Signup}}class Ct extends lt{constructor(d){super(),this.state=G.Authorization,this.authenticationToken=d}}class kt extends lt{constructor(d){super(),this.state=G.Disclaimer,this.apiToken=d}}class ue extends lt{constructor(){super(...arguments),this.state=G.ActiveAccount}}class Ze extends lt{constructor(){super(...arguments),this.state=G.InactiveAccount}}class Bt extends lt{constructor(){super(...arguments),this.state=G.Initialize}}let yt=(()=>{class i{constructor(r,a){this.userService=r,this.localStorageService=a,this.complete=new t.vpe,this.IngressState=G,this.ingress=new Ot}ngOnChanges(r){!0===r.api?.currentValue?.initial&&(this.ingress=new Bt)}localStrategyFilter(r,a){return"local"===a}getAuthenticationToken(){return this.ingress?.authenticationToken}onSignup(){this.ingress=new le}signup(r){this.ingress="signup"===r.reason?r.user.active?new ue:new Ze:new Ot}onAuthenticated(r){this.userService.authorize(r.token,"refresh").subscribe({next:a=>{this.authorized(a.token)},error:()=>{this.ingress=new Ct(r.token)}})}onAuthorized(r){this.authorized(r.token)}authorized(r){!0===this.api.disclaimer?.show?this.ingress=new kt(r):(this.localStorageService.setToken(r),this.complete.emit())}onDisclaimer(r){r.reason===L.ACCEPT?(this.localStorageService.setToken(this.ingress.apiToken),this.complete.emit()):this.ingress=new Ot}onAccountStatus(){this.ingress=new Ot}onInitialized(r){this.localStorageService.setToken(r.token),this.complete.emit()}}return i.\u0275fac=function(r){return new(r||i)(t.Y36(D.K),t.Y36(at.n))},i.\u0275cmp=t.Xpm({t