1import{a as de}from"./chunk-FLQ7NVWK.js";import{$d as J,Aa as g,Ac as G,Ba as u,Bc as L,Bd as Z,Fe as re,Ga as M,Gc as j,Ha as o,He as ae,Ia as n,Ic as Q,Ja as f,Jf as me,M as m,N as d,Qa as C,Rb as k,Sa as p,Ua as c,Ya as V,Za as R,Zd as X,_a as T,_d as Y,ae as K,be as $,ca as F,ce as ee,db as l,e as v,fe as te,ga as s,he as ie,jb as h,jf as se,kb as w,kf as le,lb as x,le as ne,ma as b,oc as I,pa as D,pc as S,pe as oe,rc as O,rf as ce,sb as U,sc as W,tc as A,uc as B,wc as E,xc as N,xd as z,yc as q,zd as H}from"./chunk-CIBUGQLF.js";var _e=["passform"],ge=i=>({"full-width":i});function pe(i,_){i&1&&(o(0,"button",3),f(1,"mat-icon",13),n())}function fe(i,_){if(i&1&&f(0,"p",7),i&2){let e=c(2);M("innerHTML",e.popUpMessage,F)}}function Ce(i,_){if(i&1){let e=C();o(0,"button",14),p("click",function(){m(e);let t=c(2);return d(t.closeWindow())}),l(1,"Cancel"),n()}}function he(i,_){if(i&1){let e=C();o(0,"div",1)(1,"h3"),l(2,"Sign In"),n(),f(3,"div",2),g(4,pe,2,0,"button",3),n(),o(5,"mat-dialog-content")(6,"form",4)(7,"mat-form-field")(8,"mat-label"),l(9,"email address"),n(),o(10,"input",5),x("ngModelChange",function(t){m(e);let a=c();return w(a.signInForm.email,t)||(a.signInForm.email=t),d(t)}),n()(),o(11,"mat-form-field")(12,"mat-label"),l(13,"password"),n(),o(14,"mbnm-password-revealer")(15,"input",6),x("ngModelChange",function(t){m(e);let a=c();return w(a.signInForm.password,t)||(a.signInForm.password=t),d(t)}),n()()()(),g(16,fe,1,1,"p",7),n(),o(17,"mat-dialog-actions",8)(18,"div",9)(19,"button",10),p("click",function(){m(e);let t=c();return d(t.signIn())}),l(20,"Sign In"),n(),g(21,Ce,2,0,"button",11),n(),o(22,"div",9)(23,"a",12),p("click",function(){m(e);let t=c();return d(t.resetPassword())}),l(24,"Forgot Password"),n(),o(25,"a",12),p("click",function(){m(e);let t=c();return d(t.view="register")}),l(26,"Register"),n()()()}if(i&2){let e=c();s(4),u(e.configs.closeMethod=="x"&&!e.dialogRef.disableClose?4:-1),s(6),h("ngModel",e.signInForm.email),s(5),h("ngModel",e.signInForm.password),s(),u(e.popUpMessage?16:-1),s(3),M("ngClass",U(6,ge,e.dialogRef.disableClose)),s(2),u(e.dialogRef.disableClose?-1:21)}}function we(i,_){i&1&&(o(0,"button",3),f(1,"mat-icon",13),n())}function xe(i,_){if(i&1){let e=C();o(0,"mat-checkbox",20),x("ngModelChange",function(t){m(e);let a=c(2);return w(a.createAccount,t)||(a.createAccount=t),d(t)}),l(1,"Register for an account"),n()}if(i&2){let e=c(2);h("ngModel",e.createAccount)}}function be(i,_){if(i&1){let e=C();o(0,"mat-form-field")(1,"mat-label"),l(2,"password"),n(),o(3,"mbnm-password-revealer")(4,"input",21),x("ngModelChange",function(t){m(e);let a=c(2);return w(a.registerForm.password,t)||(a.registerForm.password=t),d(t)}),n()()()}if(i&2){let e=c(2);s(4),h("ngModel",e.registerForm.password)}}function Me(i,_){if(i&1){let e=C();o(0,"mat-form-field")(1,"mat-label"),l(2,"confirm password"),n(),o(3,"mbnm-password-revealer")(4,"input",22),x("ngModelChange",function(t){m(e);let a=c(2);return w(a.registerForm.confirmPassword,t)||(a.registerForm.confirmPassword=t),d(t)}),n()()()}if(i&2){let e=c(2);s(4),h("ngModel",e.registerForm.confirmPassword)}}function Se(i,_){i&1&&l(0," Register ")}function ye(i,_){i&1&&l(0," Checkout as Guest ")}function ve(i,_){if(i&1){let e=C();o(0,"button",14),p("click",function(){m(e);let t=c(2);return d(t.closeWindow())}),l(1,"Cancel"),n()}}function Ee(i,_){if(i&1){let e=C();o(0,"div",1)(1,"h3"),l(2,"Register"),n(),f(3,"div",2),g(4,we,2,0,"button",3),n(),o(5,"mat-dialog-content")(6,"form")(7,"mat-form-field")(8,"mat-label"),l(9,"full name"),n(),o(10,"input",15),x("ngModelChange",function(t){m(e);let a=c();return w(a.registerForm.fullname,t)||(a.registerForm.fullname=t),d(t)}),n()(),o(11,"mat-form-field")(12,"mat-label"),l(13,"phone number"),n(),o(14,"input",16),x("ngModelChange",function(t){m(e);let a=c();return w(a.registerForm.phonenumber,t)||(a.registerForm.phonenumber=t),d(t)}),n()(),o(15,"mat-form-field")(16,"mat-label"),l(17,"email address"),n(),o(18,"input",17),x("ngModelChange",function(t){m(e);let a=c();return w(a.registerForm.email,t)||(a.registerForm.email=t),d(t)}),n()(),g(19,xe,2,1,"mat-checkbox",18),g(20,be,5,1,"mat-form-field"),g(21,Me,5,1,"mat-form-field"),o(22,"mat-checkbox",19),p("ngModelChange",function(t){m(e);let a=c();return d(a.registerForm.subscriptions.newsletterEmailStatus=t?"SUBSCRIBE_REQUESTED":null)}),l(23," Email me news & promotions "),n()()(),o(24,"mat-dialog-actions",8)(25,"div",9)(26,"button",10),p("click",function(){m(e);let t=c();return d(t.register())}),g(27,Se,1,0),g(28,ye,1,0),n(),g(29,ve,2,0,"button",11),n(),o(30,"div",9)(31,"a",12),p("click",function(){m(e);let t=c();return d(t.resetPassword())}),l(32,"Forgot Password"),n(),o(33,"a",12),p("click",function(){m(e);let t=c();return d(t.view="sign in")}),l(34,"Sign In"),n()()()}if(i&2){let e=c();s(4),u(e.configs.closeMethod=="x"&&!e.dialogRef.disableClose?4:-1),s(6),h("ngModel",e.registerForm.fullname),s(4),h("ngModel",e.registerForm.phonenumber),s(4),h("ngModel",e.registerForm.email),s(),u(e.page==="checkout"?19:-1),s(),u(e.createAccount||e.page!=="checkout"?20:-1),s(),u(e.createAccount||e.page!=="checkout"?21:-1),s(),M("ngModel",e.registerForm.subscriptions.newsletterEmailStatus),s(4),M("ngClass",U(12,ge,e.dialogRef.disableClose)),s(),u(e.createAccount?27:-1),s(),u(e.createAccount?-1:28),s(),u(e.dialogRef.disableClose?-1:29)}}function Pe(i,_){i&1&&(o(0,"h3"),l(1,"Add Password to Register"),n())}function Ue(i,_){i&1&&(o(0,"h3"),l(1,"Account Security"),n())}function Fe(i,_){i&1&&(o(0,"button",3),f(1,"mat-icon",13),n())}function De(i,_){i&1&&(o(0,"mat-form-field")(1,"mat-label"),l(2,"old password"),n(),o(3,"mbnm-password-revealer"),f(4,"input",27),n()())}function Ve(i,_){if(i&1){let e=C();o(0,"button",28),l(1,"Update Password"),n(),o(2,"button",29),p("click",function(){m(e);let t=c(2);return d(t.resetPasswordForm())}),l(3,"Cancel"),n()}}function Re(i,_){if(i&1){let e=C();o(0,"button",28),l(1,"Create Account"),n(),o(2,"button",29),p("click",function(){m(e);let t=c(2);return d(t.closeWindow())}),l(3,"Cancel"),n()}}function Te(i,_){if(i&1){let e=C();o(0,"div",1),g(1,Pe,2,0,"h3"),g(2,Ue,2,0,"h3"),f(3,"div",2),g(4,Fe,2,0,"button",3),n(),o(5,"mat-dialog-content")(6,"form",23,0),p("submit",function(){m(e);let t=c();return d(t.savePasswordChange())}),g(8,De,5,0,"mat-form-field"),o(9,"mat-form-field")(10,"mat-label"),l(11,"new password"),n(),o(12,"mbnm-password-revealer"),f(13,"input",24),n()(),o(14,"mat-form-field")(15,"mat-label"),l(16,"confirm password"),n(),o(17,"mbnm-password-revealer"),f(18,"input",25),n()()()(),o(19,"mat-dialog-actions")(20,"form",26),p("submit",function(){m(e);let t=c();return d(t.savePasswordChange())}),g(21,Ve,4,0),g(22,Re,4,0),n()()}if(i&2){let e=c();s(),u(e.user!=null&&e.user.isGuest?1:-1),s(),u(e.user!=null&&e.user.isGuest?-1:2),s(2),u(e.configs.closeMethod=="x"&&!e.dialogRef.disableClose?4:-1),s(2),M("formGroup",e.passwordFormGroup),s(2),u(e.user!=null&&e.user.isGuest?-1:8),s(12),M("formGroup",e.passwordFormGroup),s(),u(e.user.isGuest?-1:21),s(),u(e.user.isGuest?22:-1)}}var Xe=(()=>
1{class i{sessionService;userService;router;notificationService;route;dialogRef;dialog;view="sign in";signInForm={};registerForm={subscriptions:{newsletterEmailStatus:"SUBSCRIBE_REQUESTED",smsMarketingStatus:null}};createAccount=!0;signinRedirect="/account";registerRedirect="/checkout";page;popUpMessage;editUser;passwordForm;user;configs;queryParamsSubRef;passwordFormGroup=new A({old:new E("",[S.required,S.minLength(6)]),new:new E("",[S.required,S.minLength(6)]),confirm:new E("",[S.required,S.minLength(6)])});constructor(e,r,t,a,P,y,ue){this.sessionService=e,this.userService=r,this.router=t,this.notificationService=a,this.route=P,this.dialogRef=y,this.dialog=ue}ngOnDestroy(){this.queryParamsSubRef&&!this.queryParamsSubRef.closed&&this.queryParamsSubRef.unsubscribe()}ngOnInit(){this.view=this.configs.view?this.configs.view:"sign in",this.router.url.includes("checkout")&&(this.page="checkout",this.view="register"),this.queryParamsSubRef=this.route.queryParams.subscribe(e=>{this.user=this.configs.user?this.configs.user:void 0,this.signinRedirect=this.configs.signinRedirect?this.configs.signinRedirect:e.redir?e.redir:void 0,this.registerRedirect=this.configs.registerRedirect,this.configs.page&&(this.page=this.configs.page),e.e&&(this.signInForm.email=e.e)})}signIn(){return v(this,null,function*(){try{let e=yield this.sessionService.signIn(this.signInForm.email,this.signInForm.password);this.dialogRef.close(e),!this.router.url.includes("checkout")&&!this.router.url.includes("buy")&&!this.router.url.includes("account")&&(this.signinRedirect&&this.router.navigateByUrl(this.signinRedirect),this.dialogRef.close(e))}catch(e){this.notificationService.createNotification("Email or password incorrect. Please check your login and try again.","warn")}})}closeWindow(){this.dialogRef.close()}register(){return v(this,null,function*(){if(this.isUserValid())try{let e=yield this.userService.register(this.registerForm);this.registerRedirect&&this.router.navigateByUrl(this.registerRedirect),this.dialogRef.close(e)}catch(e){e.error.ErrorCode==="USER_EXISTS"?(this.dialogRef.componentInstance.view="sign in",this.dialogRef.componentInstance.signinRedirect="/checkout",this.signInForm.email=this.registerForm.email,this.popUpMessage="That user already exists!<br /><b>Please sign in instead.</b>"):this.notificationService.createNotification(e.error.Message?e.error.Message:"Unknown Error Occured","error")}})}resetPassword(){this.router.navigateByUrl("/account/reset-password"),this.dialogRef.close()}isUserValid(){let e=!1;return this.registerForm.fullname&&this.registerForm.phonenumber&&this.registerForm.email&&(!this.createAccount||this.registerForm.password&&this.registerForm.password===this.registerForm.confirmPassword)?this.registerForm.phonenumber.match(/^\D?(\d{3})\D?\D?(\d{3})\D?(\d{4})$/)?this.registerForm.email.match(/^[a-zA-Z0-9_\-]([a-zA-Z0-9_\-\.]*)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/)?e=!0:this.notificationService.createNotification("Email address is not valid.","error"):this.notificationService.createNotification("Phone number is not in the correct format. Please use ### ####### (10 digits)","error"):this.registerForm.password!==this.registerForm.confirmPassword?this.notificationService.createNotification("Passwords do not match.","error"):this.notificationService.createNotification("All fields are required.","error"),e}savePasswordChange(){return v(this,null,function*(){let e=this.passwordFormGroup.get("old").value,r=this.passwordFormGroup.get("new").value,t=this.passwordFormGroup.get("confirm").value,a=this.configs.user;if((e||a.isGuest)&&r&&t)if(r!==t)this.notificationService.createNotification("Passwords do not match.","error");else if(r.length<6)this.notificationService.createNotification("Passwords must be at least 6 characters long.","error");else{let P=a.isGuest;try{let y=yield this.userService.updatePassword(a.email,e,r);this.setUser(y),this.notificationService.createNotification(P?"Account created successfully!":"User password successfully updated.","success")}catch(y){this.notificationService.createNotification('Invalid "Old Password"',"error")}finally{this.resetPasswordForm()}}else this.notificationService.createNotification("All password fields are required to update your password.","error")})}setUser(e=null){let r=e?e.subscribed:void 0;e=e||e.currentUser,e.subscribed=r,this.configs.user&&!this.configs.user.isAnonymous&&(this.editUser={fullname:this.configs.user.fullname,phonenumber:this.configs.user.phonenumber,email:this.configs.user.email,email2:"",subscriptions:this.configs.user.subscriptions})}resetPasswordForm(){this.passwordForm.nativeElement.reset(),this.dialogRef.close()}showSMSDisclaimer(e){if(e){let r=this.dialog.open(de,{}),t=r.componentInstance;t.data={closeMethod:null,title:"SMS Marketing Disclaimer",message:'By checking this box, you agree to re
1ceive recurring automated promotional and personalized marketing text messages (e.g. cart reminders) from Matboard & More at the cell number used when signing up. Consent is not a condition of any purchase. Reply HELP for help and STOP to cancel. Msg frequency varies. Msg & data rates may apply. View <a href="/terms-conditions">Terms</a> & <a href="/privacy-policy">Privacy Policy</a>.',yesButtonText:"Accept",noButtonText:"Decline"},r.afterClosed().subscribe(a=>{this.registerForm.subscriptions.smsMarketingStatus=a?"SUBSCRIBE_REQUESTED":null})}else this.registerForm.subscriptions.smsMarketingStatus=null}close=close;static \u0275fac=function(r){return new(r||i)(b(se),b(le),b(ae),b(ce),b(re),b(X),b(Y))};static \u0275cmp=D({type:i,selectors:[["mbnm-user-dialog"]],viewQuery:function(r,t){if(r&1&&V(_e,5),r&2){let a;R(a=T())&&(t.passwordForm=a.first)}},standalone:!1,decls:3,vars:3,consts:[["passform",""],["mat-dialog-title","",1,"fx-layout-row","fx-align--x-center"],[1,"fx-flex-grow"],["mat-icon-button","","mat-dialog-close","","tabindex","-1"],["name","signIn"],["name","email","matInput","","type","email",3,"ngModelChange","ngModel"],["name","password","matInput","","type","password",3,"ngModelChange","ngModel"],[1,"pop-up-message",3,"innerHTML"],[1,"fx-layout-column"],[1,"fx-layout-row","fx-align--space-between-x"],["mat-flat-button","","color","primary",3,"click","ngClass"],["mat-flat-button","","color","secondary"],["href","javascript:void(0);",3,"click"],["svgIcon","x"],["mat-flat-button","","color","secondary",3,"click"],["matInput","","name","fullname","required","",3,"ngModelChange","ngModel"],["matInput","","name","phone","minlength","10","required","",3,"ngModelChange","ngModel"],["matInput","","name","email","type","email","required","",3,"ngModelChange","ngModel"],["name","registerFlag",3,"ngModel"],["name","newsLetter","value","SUBSCRIBE_REQUESTED",3,"ngModelChange","ngModel"],["name","registerFlag",3,"ngModelChange","ngModel"],["matInput","","type","password","name","password","minlength","6","required","",3,"ngModelChange","ngModel"],["matInput","","type","password","name","confirmPassword","minlength","6","required","",3,"ngModelChange","ngModel"],[1,"fx-layout-column",3,"submit","formGroup"],["matInput","","type","password","required","","minlength","6","formControlName","new"],["matInput","","type","password","required","","minlength","6","formControlName","confirm"],[1,"fx-layout-row","fx-align--space-between-x",3,"submit","formGroup"],["matInput","","type","password","required","","minlength","6","formControlName","old"],["type","submit","mat-flat-button","","color","primary"],["type","button","mat-flat-button","","color","secondary",3,"click"]],template:function(r,t){r&1&&(g(0,he,27,8),g(1,Ee,35,14),g(2,Te,23,8)),r&2&&(u(t.view==="sign in"?0:-1),s(),u(t.view==="register"?1:-1),s(),u(t.view==="update password"?2:-1))},dependencies:[k,q,I,O,W,j,Q,N,B,Z,H,te,J,K,ee,$,oe,ne,ie,z,me,L,G],styles:[`[_nghost-%COMP%] .mat-mdc-dialog-title[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{white-space:nowrap;padding:10px 0;margin:0}[_nghost-%COMP%] .pop-up-message[_ngcontent-%COMP%]{color:#f57c00;text-align:center;font-size:medium}[_nghost-%COMP%] form[_ngcontent-%COMP%]{max-width:300px;width:100%}[_nghost-%COMP%] form[_ngcontent-%COMP%] .mat-mdc-form-field[_ngcontent-%COMP%]{width:100%}[_nghost-%COMP%] form[_ngcontent-%COMP%] .mat-mdc-checkbox[_ngcontent-%COMP%]{display:block;min-height:39px}[_nghost-%COMP%] .mat-mdc-dialog-actions[_ngcontent-%COMP%]{width:100%}[_nghost-%COMP%] .mat-mdc-dialog-actions[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{width:100%}@media screen and (max-width:599px){[_nghost-%COMP%] .mat-mdc-dialog-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}[_nghost-%COMP%] .mat-mdc-dialog-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{margin:0}}[_nghost-%COMP%] .mat-mdc-dialog-actions[_ngcontent-%COMP%] .full-width[_ngcontent-%COMP%]{width:100%} 2/*# sourceMappingURL=user-dialog.component-EXFWWCMY.css.map */`]})}return i})();export{Xe as a}; 3//# sourceMappingURL=chunk-AQ4I5CYK.js.map
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.