1import{M as Se,N as Be}from"./chunk-PG76D7NN.js";import{$a as s,$b as K,$d as ne,Aa as g,Ba as _,Ca as S,Cf as fe,Df as ye,Dh as he,Eh as Ie,Fh as we,Ha as y,Hc as ie,Ia as M,Ic as ge,Ja as F,La as a,Ma as R,Mf as Me,N as Oe,Na as m,Ne,Q as D,Rb as z,T as q,Tb as X,U as j,Vb as Y,Wb as J,X as h,Y as I,_b as $,ab as l,ac as W,ae as v,af as ve,be as re,bg as Te,ce as oe,cg as Fe,dc as Z,de as w,dh as Ce,eh as Pe,fb as Q,fc as ee,fe as u,gc as te,gi as Ve,ha as i,he as ae,ia as f,ie as se,k as B,le,mb as k,mc as P,me,na as G,ne as de,oc as Ae,pa as c,re as pe,ri as _e,se as ce,si as Le,ua as n,ub as U,va as r,vb as H,wa as N,we as ue,xe as Ee,ye as V}from"./chunk-GTGHS4QZ.js";import{e as A}from"./chunk-J4XOFOAH.js";var x,Re=A(()=>{x=class{constructor(E){this.firstName=E.firstName,this.lastName=E.lastName,this.companyName=E.companyName,this.job=E.job,this.phoneNumber=E.phoneNumber,this.email=E.email,this.cardsQuantity=E.cardsQuantity,this.additionalInformation=E.additionalInformation}}});function Ge(p,E){p&1&&(n(0,"div",12),a(1),s(2,"translate"),r()),p&2&&(i(),m(" ",l(2,1,"APP.IS_LOADING")," "))}function Qe(p,E){if(p&1){let e=g();n(0,"div",9)(1,"div",13)(2,"div",14),a(3),s(4,"translate"),r(),n(5,"div",14),a(6),s(7,"translate"),r(),n(8,"div",15),a(9),s(10,"translate"),r(),n(11,"form",16),_("ngSubmit",function(){h(e);let o=S();return I(o.onSubmit())}),n(12,"div",9)(13,"div",17)(14,"div",18),N(15,"input",19),n(16,"label",20),a(17),s(18,"translate"),r()()(),n(19,"div",17)(20,"div",18),N(21,"input",21),n(22,"label",22),a(23),s(24,"translate"),r()()(),n(25,"small",23),a(26),s(27,"translate"),r()(),n(28,"div",24),N(29,"input",25),n(30,"label",26),a(31),s(32,"translate"),r(),n(33,"small",27),a(34),s(35,"translate"),r()(),n(36,"div",24),N(37,"input",28),n(38,"label",29),a(39),s(40,"translate"),r(),n(41,"small",27),a(42),s(43,"translate"),r()(),N(44,"br"),n(45,"div",24)(46,"vls-input-phone",30),_("inputChange",function(o){h(e);let d=S();return I(d.onPhoneInputChange(o))}),r()(),n(47,"div",24),N(48,"input",31),n(49,"label",32),a(50),s(51,"translate"),r(),n(52,"small",27),a(53),s(54,"translate"),r()(),n(55,"div",24),N(56,"input",33),n(57,"label",34),a(58),s(59,"translate"),r(),n(60,"small",27),a(61),s(62,"translate"),r()(),n(63,"div",24)(64,"textarea",35),a(65," "),r(),n(66,"label",36),a(67),s(68,"translate"),r()(),n(69,"div",37,1)(71,"button",38),_("click",function(){h(e);let o=S();return I(o.closeAlert())}),n(72,"span",39),a(73,"\xD7"),r()(),n(74,"strong"),a(75),s(76,"translate"),r(),a(77),s(78,"translate"),r(),n(79,"div",40)(80,"button",41),a(81),s(82,"translate"),r()()()()()}if(p&2){let e=S();i(3),R(l(4,27,"CONTACT.ENTERPRISE.FORM.TEXT_INFORMATION_L1")),i(3),R(l(7,29,"CONTACT.ENTERPRISE.FORM.TEXT_INFORMATION_L2")),i(3),m("* ",l(10,31,"CONTACT.ENTERPRISE.FORM.TEXT_MANDATORY_INFORMATION"),""),i(2),c("formGroup",e.enterpriseContactForm),i(6),m(" ",l(18,33,"CONTACT.ENTERPRISE.FIRST_NAME")," * "),i(6),m(" ",l(24,35,"CONTACT.ENTERPRISE.LAST_NAME")," * "),i(2),c("hidden",e.isErrorTextToHide("name.firstName")&&e.isErrorTextToHide("name.lastName")),i(),m(" ",l(27,37,"CONTACT.ENTERPRISE.INVALID.NAME")," "),i(5),m(" ",l(32,39,"CONTACT.ENTERPRISE.ENTERPRISE_NAME")," * "),i(2),c("hidden",e.isErrorTextToHide("enterpriseName")),i(),m(" ",l(35,41,"CONTACT.ENTERPRISE.INVALID.ENTERPRISE_NAME")," "),i(5),m(" ",l(40,43,"CONTACT.ENTERPRISE.JOB")," * "),i(2),c("hidden",e.isErrorTextToHide("job")),i(),m(" ",l(43,45,"CONTACT.ENTERPRISE.INVALID.JOB")," "),i(4),c("value",e.enterpriseContactForm.controls.phoneNumber.value)("label","CONTACT.ENTERPRISE.TELEPHONE"),i(4),m(" ",l(51,47,"CONTACT.ENTERPRISE.EMAIL")," * "),i(2),c("hidden",e.isErrorTextToHide("email")),i(),m(" ",l(54,49,"CONTACT.ENTERPRISE.INVALID.EMAIL")," "),i(5),m(" ",l(59,51,"CONTACT.ENTERPRISE.CARDS_QUANTITY")," * "),i(2),c("hidden",e.isErrorTextToHide("cardsQuantity")),i(),m(" ",l(62,53,"CONTACT.ENTERPRISE.INVALID.CARDS-QUANTITY")," "),i(6),m(" ",l(68,55,"CONTACT.ENTERPRISE.ADDITIONAL_INFORMATION")," "),i(8),R(l(76,57,"CONTACT.ENTERPRISE.FORM.FAIL_TO_SEND")),i(2),m(" ",l(78,59,"CONTACT.ENTERPRISE.FORM.TRY_AGAIN_LATER")," "),i(3),c("disabled",!e.isFormValid(e.enterpriseContactForm)),i(),m(" ",l(82,61,"BUTTON.SEND")," ")}}var qe,je,ke,Ue,b,L,be=A(()=>{V();Oe();Re();Ae();Q();Me();ye();
1J();Ve();te();H();V();Le();we();Fe();W();qe=["alert"],je=["redirectionValidationModal"];ke={title:"CONTACT.ENTERPRISE.FORM.TITLE"},Ue={"name.firstName":["required","trimIsEmpty"],"name.lastName":["required","trimIsEmpty"],enterpriseName:["required","trimIsEmpty"],job:["required","trimIsEmpty"],email:["required","pattern"],cardsQuantity:["pattern"]},b=[v.required,P.minTrimmedLength()],L=(()=>{class p{constructor(e,t,o,d,T,O,C){this._userService=e,this._accountService=t,this._reportsApiService=o,this._router=d,this._phoneNumberService=T,this._route=O,this._localize=C,this.isSendingForm=!1,this.pageInfo=ke}ngOnInit(){let e="",t=new u(e,b),o=new u(e,b),d=new u(e,b,this._phoneNumberValidator.bind(this));if(this._userService.isLoggedIn){let T=C=>{t.patchValue(C.firstName),t.markAsTouched(),o.patchValue(C.lastName),o.markAsTouched(),d.patchValue(C.phoneNumber),this.buildEnterpriseFormGroup.bind(this)(e,{firstNameFormControl:t,lastNameFormControl:o,phoneNumberFormControl:d})},O=()=>this.buildEnterpriseFormGroup(e);this._accountService.currentUserAccount().subscribe(T.bind(this),O.bind(this))}else this.buildEnterpriseFormGroup(e)}onSubmit(){let e=this.enterpriseContactForm.controls,t=e.name,o=new x({additionalInformation:e.additionalInformation.value,cardsQuantity:e.cardsQuantity.value,companyName:e.enterpriseName.value,email:e.email.value,job:e.job.value,firstName:t.controls.firstName.value,lastName:t.controls.lastName.value,phoneNumber:e.phoneNumber.value});this.isSendingForm=!0,this._reportsApiService.sendContractOfferReport(this._route.snapshot.params.offerId,o).subscribe(()=>this.redirectionValidationModal.openModal(),d=>{let T=this.alert.nativeElement.classList;this.isSendingForm=!1,console.error("Error while sending form content",d),T.remove("hidden-alert"),T.add("show")})}onPhoneInputChange(e){this.enterpriseContactForm.controls.phoneNumber.patchValue(e.E164)}isErrorTextToHide(e){let t=this.enterpriseContactForm.get(e),o;return Ue[e].forEach(d=>o=o||t.hasError(d)),!o||t.untouched}closeAlert(){let e=this.alert.nativeElement.classList;e.remove("show"),e.add("hidden-alert")}isFormValid(e){let t=e.controls.name;return!this.isSendingForm&&t.controls.firstName.valid&&t.controls.lastName.valid&&e.controls.enterpriseName.valid&&e.controls.job.valid&&e.controls.phoneNumber.valid&&e.controls.email.valid&&e.controls.cardsQuantity.valid}closeAndRedirect(){this.redirectionValidationModal.closeModal(),this._router.navigate([this._localize.translateRoute("/home")])}buildEnterpriseFormGroup(e,t){this.enterpriseContactForm=new w({additionalInformation:new u(e,v.nullValidator),cardsQuantity:new u(e,v.pattern(/^\d*$/)),email:new u(e,[v.required,v.pattern(P.EMAIL_REGEX)]),enterpriseName:new u(e,b),job:new u(e,b),name:new w({firstName:t?t.firstNameFormControl:new u(e,v.required),lastName:t?t.lastNameFormControl:new u(e,v.required)}),phoneNumber:t?t.phoneNumberFormControl:new u(e,v.required)})}_phoneNumberValidator(e){return this._phoneNumberService.$isValidPhoneNumber(e.value).pipe(B(t=>t?null:{valid:!1}))}static{this.\u0275fac=function(t){return new(t||p)(f(Ne),f(ve),f(fe),f(X),f(he),f(z),f(Z))}}static{this.\u0275cmp=q({type:p,selectors:[["vls-enterprise-form"]],viewQuery:function(t,o){if(t&1&&(y(qe,5),y(je,5)),t&2){let d;M(d=F())&&(o.alert=d.first),M(d=F())&&(o.redirectionValidationModal=d.first)}},decls:19,vars:15,consts:[["redirectionValidationModal",""],["alert",""],["id","enterprise-contact-content",1,"container"],[1,"container-title","fw-bolder","black-normal","l1-responsive"],["class","text-muted",4,"ngIf"],["class","row",4,"ngIf"],[3,"classes","title","closeOnClickOutside","displayCloseButton"],[1,"modal-body","mt-2"],[1,"container-fluid","col"],[1,"row"],["data-test-id","ok-btn",1,"col-12","d-flex","justify-content-center"],[1,"btn","btn-primary","btn-vls",3,"click"],[1,"text-muted"],[1,"col-lg-6","col-md-8","col-sm12"],[1,"fw-bolder"],[1,"text-italic"],["novalidate","",1,"container",3,"ngSubmit","formGroup"],[1,"col-lg-6","col-md-6","col-sm12"],["formGroupName","name",1,"form-floating","form-group"],["id","enterprise-contact-first-name","data-test-id","enterprise-contact-first-name","type","text","required","","formControlName","firstName",1,"mt-5"],["for","enterprise-contact-first-name"],["id","enterprise-contact-last-name","data-test-id","enterprise-contact-last-name","type","text","required","","formControlName","lastName",1,"mt-5"],["for","enterprise-contact-last-name"],["data-test-id","text-error",1,"col-12","text-danger",3,"hidden"],[1,"form-floating","form-group"],["id","enterprise-contact-enterprise-name","data-test-id","enterprise-contact-enterprise-name","type","text","required","","maxLength","38","formControlName","enterpriseName",1,"mt-5"],["for","enterprise-contact-enterprise-name"],["data-test-id","text-error",1,"text-danger",3,"hidden"],["id","enterprise-contact-job","data-test-id","enterprise-contact-job","type","text","required","","maxLength","38","formControlName","job",1,"mt-5"],["for","enterprise-contact-job"],[3,"inputChange","value","label"],["id","enterprise-contact-email","data-test-id","enterprise-contact-email","type","email","required","","formControlName","email",1,"mt-5"],["for","enterprise-contact-email"],["id","enterprise-contact-cards-quantity","data-test-id","enterprise-contact-cards-quantity","type","number","min","0","required","","formControlName","cardsQuantity",1,"mt-5"],["for","enterprise-contact-cards-quantity",1,""],["id","enterprise-contact-cards-additional-information","data-test-id","enterprise-contact-cards-additional-information","formControlName","additionalInformation",1,"md-textarea","mt-5"],["for","enterprise-contact-cards-additional-information"],["role","alert",1,"alert","alert-danger","alert-dismissible","fade","hidden-alert"],["type","button","aria-label","Close",1,"close",3,"click"],["aria-hidden","true"],[1,"col-12"],["type","submit","data-test-id","submit-compagny-form",1,"btn","btn-primary","btn-vls","rounded-3","mt-3","mb-3","p-3","px-5",3,"disabled"]],template:function(t,o){if(t&1){let d=g();n(0,"div",2)(1,"h1",3),a(2),s(3,"translate"),r(),G(4,Ge,3,3,"div",4)(5,Qe,83,63,"div",5),r(),N(6,"vls-footer-section"),n(7,"vls-modal",6,0)(9,"div",7)(10,"div",8)(11,"div",9)(12,"label"),a(13),s(14,"translate"),r()(),n(15,"div",10)(16,"button",11),_("click",function(){return h(d),I(o.closeAndRedirect())}),a(17),s(18,"translate"),r()()()()()}t&2&&(i(2),m(" ",l(3,9,o.pageInfo.title)," "),i(2),c("ngIf",!o.enterpriseContactForm),i(),c("ngIf",o.enterpriseContactForm),i(2),c("classes","modal-md")("title","CONTACT.ENTERPRISE.MODAL_REDIRECTION.TITLE")("closeOnClickOutside",!1)("displayCloseButton",!1),i(6),R(l(14,11,"CONTACT.ENTERPRISE.MODAL_REDIRECTION.MESSAGE")),i(4),m(" ",l(18,13,"CONTACT.ENTERPRISE.MODAL_REDIRECTION.BUTTON")," "))},dependencies:[k,ae,ne,se,re,oe,ce,pe,le,de,me,_e,Ie,Te,$],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] form[_ngcontent-%COMP%]{margin-top:2em}[_nghost-%COMP%] #enterprise-contact-content[_ngcontent-%COMP%]{margin-top:4em}[_nghost-%COMP%] div.container-title[_ngcontent-%COMP%] + div[_ngcontent-%COMP%]{margin-top:2em}[_nghost-%COMP%] div[role=alert].hidden-alert[_ngcontent-%COMP%]{border:0;height:0;margin:0;padding:0}[_nghost-%COMP%] .text-italic[_ngcontent-%COMP%]{font-style:italic}[_nghost-%COMP%] .footer-section[_ngcontent-%COMP%]{margin-top:4em}.l4-responsive[_ngcontent-%COMP%]{font-size:1rem;clear:both;text-overflow:ellipsis}.form[_ngcontent-%COMP%]{position:relative}.form[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{transition:.2s ease-out;color:#757575;position:absolute;top:80px;left:0;font-size:1rem;cursor:text}"]})}}return p})()});var xe,Tt,He=A(()=>{H();V();J();W();te();ge();Pe();Be();be();Q();xe=[{path:"",component:L},{path:ie.CONTACT_ENTERPRISE+"/:offerId",component:L}],Tt=(()=>{class p{static{this.\u0275fac=function(t){return new(t||p)}}static{this.\u0275mod=j({type:p})}static{this.\u0275inj=D({imports:[U,Ee,ue,Y.forChild(xe),ee.forChild(xe),K,Se,Ce]})}}return p})()});He();export{Tt as ContactModule};
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.