import{__assign as e}from"../../node_modules/tslib/tslib.es6.js";import r,{useState as a}from"react";import{DEFAULT_BLOC_PROPERTIES as t}from"../Bloc/BlocProperties.js";import{useForm as l}from"../../node_modules/react-hook-form/dist/index.esm.js";import{PropsGeneratorForGivenComponent as m}from"../../prop-utils.js";var n,o=e({},t),s=(n=m({},[],[])).propsGenerator,i=n.propsParser;export default function(t){var m=a(!1),n=m[0],o=m[1],s=l(),i=s.register,c=s.handleSubmit,d=s.reset,u=s.errors,p=s.formState.isSubmitting,f=function(r,a,l){return function(m){var n;o(!0),dispatch(t.submitContactUs(r,e(e({},m),{emailProviderTo:a,accountEmail:l}))),(n=9500,new Promise((function(e){return setTimeout(e,n)}))).then((function(){return o(!1)})),d()}},E=t.account,N=E.email,v=E.domain,g=E.emailProviderTo;return r.createElement(r.Fragment,null,r.createElement("div",null,n&&r.createElement("div",{className:"Taking__overlay"},r.createElement("div",{className:"Taking__alert"},r.createElement("div",{className:"Taking__container"},r.createElement("h1",{className:"Taking__title"},"Message sent!"),r.createElement("br",null),r.createElement("p",{className:"Taking__information"},"Thank you, your message has been sent and we will respond to you as soon as possible.")))),r.createElement("form",{onSubmit:c(f(v,g,N)),className:"form"},r.createElement("div",{className:"form-group"},r.createElement("select",{required:!0,name:"title",ref:i({required:!0}),className:"custom-select my-1 mr-sm-2"},r.createElement("option",{value:"",disabled:!0},"Title*"),r.createElement("option",{value:"Mr"},"Mr."),r.createElement("option",{value:"Mrs"},"Mrs."),r.createElement("option",{value:"Miss"},"Miss"),r.createElement("option",{value:"Ms"},"Ms."),r.createElement("option",{value:"Dr"},"Dr."),r.createElement("option",{value:"Prof"},"Prof."),r.createElement("option",{value:"Rev"},"Rev.")),r.createElement("i",{className:"error"},u.title)),r.createElement("div",{className:"row"},r.createElement("div",{className:"col"},r.createElement("div",{className:"form-group"},r.createElement("input",{type:"text",name:"firstName",ref:i({required:!0}),className:"form-control",placeholder:"First Name*"}),u.firstName&&"required"===u.firstName.type&&r.createElement("i",{className:"error"},"First name is required"))),r.createElement("div",{className:"col"},r.createElement("div",{className:"form-group"},r.createElement("input",{type:"text",name:"surname",ref:i({required:!0}),className:"form-control",placeholder:"Surname*"}),u.surname&&"required"===u.surname.type&&r.createElement("i",{className:"error"},"Surname is required")))),r.createElement("div",{className:"row"},r.createElement("div",{className:"col"},r.createElement("div",{className:"form-group"},r.createElement("input",{type:"email",name:"email",ref:i({required:!0}),className:"form-control",placeholder:"Email*"}),u.email&&"required"===u.email.type&&r.createElement("i",{className:"error"},"Email is required"))),r.createElement("div",{className:"col"},r.createElement("div",{className:"form-group"},r.createElement("input",{type:"text",name:"telephone",ref:i({required:!0}),className:"form-control",placeholder:"Telephone*"}),u.telephone&&"required"===u.telephone.type&&r.createElement("i",{className:"error"},"Telephone is required")))),r.createElement("div",{className:"row"},r.createElement("div",{className:"col"},r.createElement("div",{className:"form-group"},r.createElement("input",{type:"text",name:"nameOfChild",ref:i({required:!0}),className:"form-control",placeholder:"Name of Child / Nickname*"}),u.nameOfChild&&"required"===u.nameOfChild.type&&r.createElement("i",{className:"error"},"Name of child is required"))),r.createElement("div",{className:"col"},r.createElement("div",{className:"form-group"},r.createElement("input",{type:"text",name:"ageOfChild",ref:i({required:!0}),className:"form-control",placeholder:"Age of Child*"}),u.ageOfChild&&"required"===u.ageOfChild.type&&r.createElement("i",{className:"error"},"Age of child is required")))),r.createElement("div",{className:"form-group"},r.createElement("textarea",{ref:i({required:!0}),name:"message",className:"form-control",placeholder:"Message*",rows:8}),u.message&&"required"===u.message.type&&r.createElement("i",{className:"error"},"Message is required")),r.createElement("div",{className:"mt-1"}),r.createElement("button",{type:"submit",onClick:function(){c(f(v,g,N))},className:"button-link red mt-3",disabled:p},r.createElement("span",{className:"chevron right"},"Submit")))),r.createElement("style",{jsx:!0},"\n        .btn-primary {\n          background-color: #ac1260;\n          border-color: #b72457;\n          color: #fff;\n          padding: 0.5rem 3rem;\n        }\n\n        .btn-primary:hover {\n          background-color: #810e48;\n          border-color: #810e48;\n        }\n      "))}export{o as DEFAULT_CONTACT_US,s as contactUsPropsGenerator,i as contactUsPropsParser};
//# sourceMappingURL=ContactUs.js.map
