1import{a as We}from"./chunk-OMDIXYMV.js";import{a as Be,b as ze}from"./chunk-6OIFCUE5.js";import{a as Ye}from"./chunk-K4VU2IUA.js";import{a as qe}from"./chunk-PETNHAAL.js";import{a as me}from"./chunk-EZIJAJWZ.js";import{a as De,c as ye}from"./chunk-Z3UQ2S7R.js";import{f as Ne,i as Re}from"./chunk-WRFSAVPV.js";import{a as Ke}from"./chunk-RWIW3KNR.js";import{b as Ve}from"./chunk-2DPPRFQO.js";import{a as Le}from"./chunk-TLX6BUAL.js";import{a as Xe}from"./chunk-QAKFDRSA.js";import{a as d}from"./chunk-LGR6W33P.js";import{b as $e,c as ve}from"./chunk-2DAJGVHH.js";import{i as Te,p as de}from"./chunk-DSEEUQIK.js";import{w as Ee}from"./chunk-NEYTDBXA.js";import{a as P}from"./chunk-PNMUIG77.js";import{e as ke,f as Ge,h as we,i as Ue,j as He}from"./chunk-JZ32ZR6S.js";import{b as Pe,c as be,h as Ie,i as xe}from"./chunk-HXVQK7NY.js";import{b as Ce,d as m,f as Me,g as fe,k as pe,n as Se,q as Ae,u as ge,w as Fe,x as he,y as Oe}from"./chunk-36ET2K5D.js";import{h as ce,k as se}from"./chunk-5RW3NH5Z.js";import{h as le,i as ue}from"./chunk-XZ73AILB.js";import{x as _e}from"./chunk-K3H6HK5I.js";import{Ab as K,Ca as Y,Ec as O,Fc as oe,G as q,Gb as W,Gc as N,Ic as ie,Kc as u,Lc as ae,Mc as C,Q as B,Xb as A,Zb as g,ac as Q,bc as j,cc as M,dc as t,ec as n,fc as T,jd as re,kc as J,ob as _,oc as F,pa as l,pc as h,qc as s,rc as Z,sc as ee,tc as te,uc as ne,ud as p,vd as R,wa as z,wc as f,xa as V}from"./chunk-7TO3YRUY.js";var Qe=["thankYouDialogTemplate"],je=["contactFormDirective"],Je=(i,E)=>E.key;function Ze(i,E){if(i&1&&(t(0,"mat-option",29),u(1),n()),i&2){let e=E.$implicit;M("value",e.key),_(),C(" ",e.label);}}function et(i,E){i&1&&(t(0,"button",46),s(1,12),n());}function tt(i,E){if(i&1){let e=J();t(0,"form",19,1),ne("ngSubmit",function(){z(e);let c=f();return V(c.submit());}),t(2,"div",20)(3,"div",21)(4,"label",22),s(5,3),n(),t(6,"mat-form-field",23),T(7,"input",24),t(8,"mat-error"),u(9),n()()(),t(10,"div",21)(11,"label",25),s(12,4),n(),t(13,"mat-form-field",23),T(14,"input",26),t(15,"mat-error"),u(16),n()()(),t(17,"div",21)(18,"label",27),s(19,5),n(),t(20,"mat-form-field",23)(21,"mat-select",28),Q(22,Ze,2,2,"mat-option",29,Je),n()()(),t(24,"div",30)(25,"label",31),s(26,6),n(),t(27,"mat-form-field",23),T(28,"input",32),t(29,"mat-error"),u(30),n()()(),t(31,"div",30)(32,"label",33),s(33,7),n(),t(34,"mat-form-field",23),T(35,"xo-mat-intl-tel-input",34),t(36,"mat-error"),u(37),n()()(),t(38,"div",35)(39,"label",36),s(40,8),n(),t(41,"mat-form-field",23),T(42,"textarea",37,2),t(44,"mat-error"),u(45),n(),t(46,"mat-hint",38),u(47),t(48,"strong"),u(49),n()()()()(),t(50,"mat-checkbox",39)(51,"div",40),F(52,9),T(53,"span")(54,"a",41)(55,"span",42)(56,"a",43),h(),n()(),t(57,"mat-error",44),s(58,10),n(),t(59,"div",45),A(60,et,2,0,"button",46),t(61,"button",47),s(62,11),n()()();}if(i&2){let e,o=N(1),c=N(43),a=f();M("formGroup",a.contactForm),_(9),C(" ",a.getErrorMessage(a.contactForm.get("name"))," "),_(7),C(" ",a.getErrorMessage(a.contactForm.get("surname"))," "),_(6),j(a.preferredContactOptions),_(8),C(" ",a.getErrorMessage(a.contactForm.get("email"))," "),_(7),C(" ",a.getErrorMessage(a.contactForm.get("phoneNumber"))," "),_(5),M("maxLength",a.MAX_MEMO_LENGTH),_(3),C(" ",a.getErrorMessage(a.contactForm.get("message"))," "),_(2),C(" ",c.value.length," / "),_(2),ae(a.MAX_MEMO_LENGTH),_(),M("required",!0),_(7),ie("invisible",!(o!=null&&o.submitted)||!((e=a.contactForm.get("contactMeAgreement"))!=null&&e.errors)),_(3),g(a.hasCancelButton()?60:-1),_(),M("xoOverlayLoading",a.loading);}}function nt(i,E){i&1&&(t(0,"div",52),s(1,16),n());}function ot(i,E){if(i&1&&(t(0,"div",52),s(1,17),n()),i&2){let e=f(2);_(),Z(e.websiteOwner==null||e.websiteOwner.office==null?null:e.websiteOwner.office.name),ee(1);}}function it(i,E){if(i&1&&(t(0,"mat-dialog-content")(1,"div",48),T(2,"img",49),n(),t(3,"div",50)(4,"span"),s(5,13),n(),u(6,"! "),n(),t(7,"div",51),F(8,14),T(9,"br"),h(),n(),A(10,nt,2,0,"div",52)(11,ot,2,1,"div",52),n(),t(12,"mat-dialog-actions",53)(13,"button",54),s(14,15),n()()),i&2){let e=f();_(10),g(e.websiteOwner!=null&&e.websiteOwner.isAgentWebsite?10:11);}}var Ut=(()=>{class i{formBuilder=l(Fe);alert=l(Xe);userAccountService=l(We);dialog=l(ke);store=l(Ee);analyticsService=l(me);route=l(ce);recaptchaV3Service=l(Ve);destroyRef=l(Y);MAX_MEMO_LENGTH=d.LIMITATIONS.MAX_MEMO_LENGTH;getErrorMessage=d.getErrorMessage;contactForm;loading=!1;preferredContactOptions=Te;endUserAccount;websiteOwner;thankYouDialogTemplate=R.required("thankYouDialogTemplate");contactFormDirective=R.required("contactFormDirective");hasCancelButton=p(!1);recipient=p("WEBSITE_OWNER");recipientAgent=p();recipientOffice=p();constructor(){this.fillFormWithUserData();let{blockAggregator:e}
1=this.route.snapshot.data,{websiteOwner:o}=e??{};this.websiteOwner=o;}fillFormWithUserData(){this.initForm(),this.store.select(de).pipe(P(this.destroyRef)).subscribe(e=>{this.initForm(e),this.endUserAccount=e;});}initForm(e){this.contactForm=this.formBuilder.group({type:["GENERAL",[m.required]],name:[e?.firstName,[m.required,m.maxLength(d.LIMITATIONS.MAX_TEXT_LENGTH)]],surname:[e?.lastName,[m.maxLength(d.LIMITATIONS.MAX_TEXT_LENGTH)]],email:[e?.email,[m.required,m.email,m.maxLength(d.LIMITATIONS.MAX_EMAIL_LENGTH)]],phoneNumber:[e?.phoneNumber],message:[null,[m.required,m.maxLength(this.MAX_MEMO_LENGTH)]],contactMeAgreement:[!1,[m.requiredTrue]],preferredContactOption:["EMAIL",[m.required]]}),this.handleContactMethodOptionChanges();}handleContactMethodOptionChanges(){let e=this.contactForm?.get("phoneNumber");this.contactForm?.get("preferredContactOption")?.valueChanges.subscribe(o=>{let c=o==="EMAIL"?[d.phone]:[d.phone,m.required,d.noWhitespace];e?.setValidators(c),e?.updateValueAndValidity();});}submit(){if(this.contactForm?.invalid||this.loading){this.contactForm?.markAllAsTouched();return;}let e=this.contactForm?.value;switch(this.loading=!0,this.recaptchaV3Service.execute(Ke.CONTACT_REQUEST).pipe(q(o=>{let c={name:e.name,surname:e.surname,message:e.message,preferredContactOption:e.preferredContactOption,phoneNumber:e.phoneNumber,email:e.email,recipient:this.recipient(),agentId:this.recipient()==="AGENT"?this.recipientAgent()?.id:void 0,officeId:this.recipient()==="OFFICE"?this.recipientOffice()?.id:void 0,country:(this.recipient()==="AGENT"?this.recipientAgent()?.address?.country:this.recipientOffice()?.realAddress?.country)??null};return this.userAccountService.sendContactRequest(c,o);}),B(()=>this.loading=!1),P(this.destroyRef)).subscribe(()=>{this.store.dispatch(qe()),this.resetContactForm(),this.openThankYouDialog();},o=>{this.alert.snack(o?.error?.errorMessage||o.message);}),this.recipient()){case"AGENT":this.analyticsService.sendAgentContactRequestEvent(this.recipientAgent());break;case"OFFICE":this.analyticsService.sendOfficeContactRequestEvent(this.recipientOffice());break;default:this.analyticsService.sendGeneralContactRequestEvent();}}resetContactForm(){this.contactFormDirective()?.resetForm({type:"GENERAL",name:this.endUserAccount?.firstName,phoneNumber:this.endUserAccount?.phoneNumber,email:this.endUserAccount?.email,message:null});}openThankYouDialog(){this.dialog.open(this.thankYouDialogTemplate(),{width:"500px"});}static ɵfac=function(o){return new(o||i)();};static ɵcmp=K({type:i,selectors:[["site-contact-me-form"]],viewQuery:function(o,c){o&1&&(O(c.thankYouDialogTemplate,Qe,5),O(c.contactFormDirective,je,5)),o&2&&oe(2);},inputs:{hasCancelButton:[1,"hasCancelButton"],recipient:[1,"recipient"],recipientAgent:[1,"recipientAgent"],recipientOffice:[1,"recipientOffice"]},decls:3,vars:1,consts:()=>{let e;e="First name";let o;o="Last name";let c;c="Email";let a;a="Enter your message";let b;b=" First name ";let I;I=" Last name ";let x;x=" Preferred communication method ";let D;D=" Email ";let y;y=" Phone ";let $;$=" Message ";let S;S=""+"\uFFFD#53\uFFFD"+" By clicking SEND, I agree THAT: a real estate professional may contact me by phone or text message including by automated means about real estate services, and that I can access real estate services without providing my phone number. I acknowledge that I have read and agree to the "+"[\uFFFD/#53\uFFFD|\uFFFD/#55\uFFFD]"+""+"\uFFFD#54\uFFFD"+"Terms of Use"+"[\uFFFD/#54\uFFFD|\uFFFD/#56\uFFFD]"+""+"\uFFFD#55\uFFFD"+"and"+"[\uFFFD/#53\uFFFD|\uFFFD/#55\uFFFD]"+""+"\uFFFD#56\uFFFD"+"Privacy Policy"+"[\uFFFD/#54\uFFFD|\uFFFD/#56\uFFFD]"+". ",S=te(S);let v;v=" Please read and agree to our Terms of use and Privacy policies ";let L;L=" Send ";let k;k=" Cancel ";let G;G=" Thank You ";let w;w=" Message sent. "+"\uFFFD#9\uFFFD\uFFFD/#9\uFFFD"+" Thanks for getting in touch! ";let U;U=" OK ";let H;H=" Look out for an email from Xomio confirming your registration. ";let X;return X=" Look out for an email from "+"\uFFFD0\uFFFD"+" confirming your registration. ",[["thankYouDialogTemplate",""],["contactFormDirective","ngForm"],["messageInput",""],b,I,x,D,y,$,S,v,L,k,G,w,U,H,X,[3,"formGroup"],[3,"ngSubmit","formGroup"],[1,"grid","grid-cols-12","gap-x-4"],[1,"col-span-full","sm:col-span-4"],["for","contactFirstName",1,"text-xs"],[1,"w-full"],["id","contactFirstName","matInput","","formControlName","name","required","","placeholder",e],["for","contactLastName",1,"text-xs"],["id","contactLastName","matInput","","formControlName","surname","placeholder",o],["for","preferredContactOption",1,"inline-block","w-full","truncate","text-xs"],["id","preferredContactOption","formControlName","preferredContactOption"],[3,"value"],[1,"col-span-full","sm:col-span-6"],["for","email",1,"text-xs"],["id","email","formControlName","email","matInput","","type","email","placeholder",c],["id","phoneNumberLabel","for","phoneNumber",1,"text-xs"],["id","phoneNumber","aria-describedby","phoneNumberLabel","formControlName","phoneNumber"],[1,"col-span-full"],["for","message",1,"text-xs"],["id","message","formControlName","message","matInput","","rows","4","placeholder",a,3,"maxLength"],[1,"text-end"],["formControlName","contactMeAgreement","color","primary",1,"mat-checkbox-long",3,"required"],[1,"terms-condition-content","text-xs","text-wrap"],["routerLink","/r/terms-and-conditions","target","_blank",1,"text-primary"],[1,"mx-1"],["routerLink","/r/privacy-policy","target","_blank",1,"text-primary"],[1,"mb-2","text-xs"],[1,"flex","flex-nowrap","gap-2"],["mat-dialog-close","","type","submit","color","primary","mat-stroked-button","",1,"col-span-full"],["type","submit","color","primary","mat-flat-button","",1,"col-span-full",3,"xoOverlayLoading"],[1,"flex","justify-center","pt-4"],["ngSrc","./images/bird-home.svg","alt","Bird Home Image","width","240","height","194",1,"icon-bird-home","-mt-1"],[1,"mat-headline-large","mb-6!","text-center"],[1,"text-center"],[1,"mb-2","text-center","font-medium"],["align","center"],["mat-dialog-close","","mat-flat-button","","color","primary",1,"px-12"]];},template:function(o,c){o&1&&(A(0,tt,63,14,"form",18),W(1,it,15,1,"ng-template",null,0,re)),o&2&&g(c.contactForm?0:-1);},dependencies:[he,pe,Ce,Me,fe,ge,Oe,Se,Ae,xe,Ie,be,Pe,ve,$e,ye,De,Ne,Re,ze,Be,se,ue,le,He,Ge,Ue,we,Le,_e,Ye],encapsulation:2,changeDetection:0});}return i;})();export{Ut as a};
1/**i18n:3863e90172e9fd3c04c0dbbe3fd9c8612275b9268b9b4280ab0bb679a7810333*/
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.