1"use strict";(self.webpackChunkfarath=self.webpackChunkfarath||[]).push([[9266],{82172:(n,e,r)=>{r.d(e,{r:()=>o});const o=n=>{const e={};if(n.response&&n.response.data){const r=n.response.data.error;Object.keys(r).forEach((n=>{e[n]=r[n][0]}))}else e.general="An error occurred. Please try again later.";return e}},39311:(n,e,r)=>{r.d(e,{E:()=>a,S:()=>t});var o=r(50421);const t=n=>e=>e.theme[n],a=(0,o.Zz)((()=>({boxSizing:"border-box"})),o.xe,o.VL,o.bV,o.JX,o.uJ,o.yO,o.Kr,o.J,o.yW,o.Uu,o.fq,o.i4,o.sJ,o.Cz,o.Vy);a.propTypes={...o.Vy.propTypes,...o.xe.propTypes,...o.sJ.propTypes,...o.Cz.propTypes,...o.VL.propTypes,...o.uJ.propTypes,...o.J.propTypes,...o.yW.propTypes,...o.Uu.propTypes,...o.fq.propTypes,...o.i4.propTypes}},86758:(n,e,r)=>{r.d(e,{A:()=>p});r(65043);var o,t=r(35931),a=r(57528),i=r(87871),s=r(51528);const d=i.Ay.div(o||(o=(0,a.A)(["\n margin-bottom: 24px;\n\n .ant-btn-primary {\n &:hover {\n background: ",";\n opacity: 0.9;\n }\n }\n\n .field-label {\n display: block;\n color: ",";\n font-size: 15px;\n line-height: 18px;\n font-weight: 600;\n margin-bottom: 15px;\n }\n\n .ant-input,\n .ant-picker,\n .ant-input-number,\n .ant-input-password {\n width: 100%;\n min-height: 48px;\n border-radius: 3px;\n border-color: ",";\n &:focus,\n &.ant-input-focused,\n &.ant-picker-focused,\n &.ant-input-number-focused,\n &.ant-input-password-focused {\n box-shadow: 0 0 0 1px rgba(0, 132, 137, 0.2);\n }\n }\n\n .ant-checkbox-wrapper {\n .ant-checkbox {\n + span {\n font-size: 15px;\n font-weight: 700;\n color: ",";\n line-height: 1;\n }\n .ant-checkbox-inner {\n border-radius: 0;\n border-color: ",";\n }\n &.ant-checkbox-checked {\n .ant-checkbox-inner {\n border-color: ",";\n background-color: ",";\n }\n }\n }\n }\n\n .ant-input-number {\n max-width: 100px;\n .ant-input-number-input {\n min-height: 48px;\n }\n &:hover {\n border-color: ",";\n }\n }\n .ant-input-number-handler:hover {\n .ant-input-number-handler-up-inner,\n .ant-input-number-handler-down-inner {\n color: ",";\n }\n }\n\n .ant-picker {\n &:hover {\n border-color: ",";\n }\n }\n\n .ant-select {\n &.ant-select-single:not(.ant-select-customize-input) {\n width: 100%;\n .ant-select-selector {\n border-radius: 3px;\n border-color: ",";\n min-height: 48px;\n .ant-select-selection-search-input {\n min-height: 48px;\n }\n .ant-select-selection-item {\n display: flex;\n align-items: center;\n }\n }\n }\n &.ant-select-focused {\n &.ant-select-single:not(.ant-select-customize-input) {\n .ant-select-selector {\n box-shadow: 0 0 0 1px rgba(0, 132, 137, 0.2);\n }\n }\n }\n }\n\n &.has-error {\n .ant-input,\n .ant-input-password {\n border-color: ",";\n }\n .feedback {\n color: ",";\n }\n .ant-input-password {\n .ant-input {\n border-color: transparent;\n }\n }\n }\n\n .ant-input-password {\n .ant-input {\n min-height: auto;\n border-radius: initial;\n border-color: transparent;\n &:focus {\n box-shadow: none;\n }\n }\n }\n\n .ant-radio-group-solid {\n .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled) {\n border-color: ",";\n background-color: ",";\n &::before {\n content: none;\n }\n &:hover {\n color: #fff;\n &::before {\n content: none;\n }\n }\n }\n .ant-radio-button-wrapper {\n &:hover {\n color: ",';\n }\n }\n }\n\n button[type="submit"] {\n border-radius: 3px;\n height: 47px;\n border-color: ',";\n background-color: ",";\n font-size: 15px;\n font-weight: 700;\n text-transform: capitalize;\n padding-left: 28px;\n padding-right: 28px;\n line-height: 1;\n\n &::after {\n content: none;\n }\n }\n"])),(0,s.y)("primary.0","#008489"),(0,s.y)("text.0","#2C2C2C"),(0,s.y)("border.3","#E6E6E6"),(0,s.y)("text.0","#2C2C2C"),(0,s.y)("text.1","#909090"),(0,s.y)("primary.0","#008489"),(0,s.y)("primary.0","#008489"),(0,s.y)("border.3","#E6E6E6"),(0,s.y)("primary.0","#008489"),(0,s.y)("border.3","#E6E6E6"),(0,s.y)("border.3","#E6E6E6"),(0,s.y)("error.0","#F9503D"),(0,s.y)("error.0","#F9503D"),(0,s.y)("primary.0","#008489"),(0,s.y)("primary.0","#008489"),(0,s.y)("primary.0","#008489"),(0,s.y)("primary.0","#008489"),(0,s.y)("primary.0","#008489"));var l=r(70579);const p=n=>{let{className:e,label:r,labelTag:o,htmlFor:a,children:i,error:s}=n;const p=["form-control"];return s&&p.push("has-error"),e&&p.push(e),(0,l.jsxs)(d,{className:p.join(" "),children:[r&&(0,l.jsx)(t.A,{className:"field-label",as:o,htmlFor:a,c
1ontent:r}),i,s&&(0,l.jsx)("div",{className:"feedback",children:s})]})}},35931:(n,e,r)=>{r.d(e,{A:()=>d});r(65043);var o=r(87871),t=r(50421),a=r(39311),i=r(70579);const s=(0,o.Ay)("label")(a.E,t.mw,t.Wy,t.Jh,t.K_,t.oU,(0,a.S)("Heading")),d=n=>{let{htmlFor:e,content:r,...o}=n;return(0,i.jsx)(s,{htmlFor:e,...o,children:r})}},67519:(n,e,r)=>{r.d(e,{Ay:()=>F,EY:()=>k,F5:()=>b,JU:()=>v,MJ:()=>w,QS:()=>C,_H:()=>f,cm:()=>y,ff:()=>A,hE:()=>j});var o,t,a,i,s,d,l,p,c,h,x=r(57528),m=r(87871),u=r(51528);const g=m.Ay.div(o||(o=(0,x.A)(["\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n"]))),b=m.Ay.div(t||(t=(0,x.A)(["\n width: 43%;\n padding: 81px;\n // padding-right: 81px;\n // padding-top: 25px;\n @media (min-width: 1441px) {\n padding-left: 130px;\n padding-right: 130px;\n height: 100vh;\n margin-top: -55px;\n }\n @media (max-width: 1200px) {\n width: 50%;\n }\n @media (max-width: 991px) {\n padding: 56px;\n width: 80%;\n margin: 0 auto;\n }\n @media (max-width: 767px) {\n width: 100%;\n }\n @media (max-width: 480px) {\n padding: 30px;\n }\n\n .signin-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 3px;\n height: 57px;\n font-size: 17px;\n font-weight: 700;\n border-color: #eba14c;\n background-color: #eba14c;\n @media (max-width: 1536px) {\n height: 54px;\n font-size: 16px;\n font-weight: 600;\n }\n svg {\n width: 18px;\n height: 18px;\n margin-right: 2px;\n }\n &::after {\n content: none;\n }\n &:hover,\n &:focus {\n border-color: #eba14c;\n background-color: #eba14c;\n }\n }\n\n .ant-divider {\n margin: 41px 0 !important;\n .ant-divider-inner-text {\n font-size: 15px;\n font-weight: 700;\n color: ",";\n }\n }\n\n .ant-btn {\n &.facebook-btn,\n &.github-btn,\n &.firebase-btn,\n &.google-btn {\n height: 57px;\n border-radius: 3px;\n font-size: 15px;\n font-weight: 700;\n @media (max-width: 1536px) {\n height: 54px;\n font-weight: 600;\n }\n &::after {\n content: none;\n }\n }\n &.facebook-btn {\n border-color: ",";\n background-color: ",";\n }\n &.github-btn {\n border-color: ",";\n background-color: ",";\n }\n &.firebase-btn {\n border-color: ",";\n background-color: ",";\n }\n &.google-btn {\n border-color: ",";\n background-color: ",";\n }\n }\n"])),(0,u.y)("text.2","#777777"),(0,u.y)("color.7","#3b5998"),(0,u.y)("color.7","#3b5998"),(0,u.y)("color.14","#00ACEE"),(0,u.y)("color.14","#00ACEE"),(0,u.y)("color","#FFCB2B"),(0,u.y)("color","#FFCB2B"),(0,u.y)("color.10","#dd4b39"),(0,u.y)("color.10","#dd4b39")),f=m.Ay.div(a||(a=(0,x.A)(["\n width: 43%;\n padding: 81px;\n @media (min-width: 1441px) {\n padding: 130px;\n }\n @media (max-width: 1200px) {\n width: 50%;\n }\n @media (max-width: 991px) {\n padding: 56px;\n width: 80%;\n margin: 0 auto;\n }\n @media (max-width: 767px) {\n width: 100%;\n }\n @media (max-width: 480px) {\n padding: 30px;\n }\n\n .signin-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 3px;\n height: 57px;\n font-size: 17px;\n font-weight: 700;\n border-color: #eba14c;\n background-color: #eba14c;\n @media (max-width: 1536px) {\n height: 54px;\n font-size: 16px;\n font-weight: 600;\n }\n svg {\n width: 18px;\n height: 18px;\n margin-right: 2px;\n }\n &::after {\n content: none;\n }\n &:hover,\n &:focus {\n border-color: #eba14c;\n background-color: #eba14c;\n }\n }\n\n .ant-divider {\n margin: 41px 0 !important;\n .ant-divider-inner-text {\n font-size: 15px;\n font-weight: 700;\n color: ",";\n }\n }\n\n .ant-btn {\n &.facebook-btn,\n &.github-btn,\n &.firebase-btn,\n &.google-btn {\n height: 57px;\n border-radius: 3px;\n font-size: 15px;\n font-weight: 700;\n @media (max-width: 1536px) {\n height: 54px;\n font-weight: 600;\n }\n &::after {\n content: none;\n }\n }\n &.facebook-btn {\n border-color: ",";\n background-color: ",";\n }\n &.github-btn {\n border-color: ",";\n background-color: ",";\n }\n &.firebase-btn {\n border-color: ",";\n background-color: ",";\n }\n &.google-btn {\n border-color: ",";\n background-color: ",";\n }\n }\n"])),(0,u.y)("text.2","#777777"),(0,u.y)("color.7","#3b5998"),(0,u.y)("color.7","#3b5998"),(0,u.y)("color.14","#00ACEE"),(0,u.y)("color.14","#00ACEE"),(0,u.y)("color","#FFCB2B"),(0,u.y)("color","#FFCB2B"),(0,u.y)("color.10","#dd4b39"),(0,u.y)("color.10","#dd4b39")),y=m.Ay.div(i||(i=(0,x.A)(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-top: 40px;\n margin-bottom: 40px;\n\n @media (max-width: 575px) {\n flex-direction: column;
1\n align-items: flex-start;\n gap: 20px;\n }\n\n > a {\n color: ",";\n font-size: 15px;\n font-weight: 700;\n line-height: 1;\n &:hover,\n &:focus {\n outline: none;\n color: #008489d1;\n text-decoration: none;\n }\n }\n"])),(0,u.y)("primary.0","#008489")),w=m.Ay.div(s||(s=(0,x.A)(["\n display: flex;\n align-items: center;\n\n .field-container {\n .ant-form-item {\n margin-bottom: 0;\n margin-right: 10px;\n }\n }\n\n .ant-switch {\n min-width: 36px;\n height: 21px;\n &.ant-switch-checked {\n background-color: ",";\n &:hover {\n background-color: ",";\n }\n }\n &::after {\n width: 17px;\n height: 17px;\n }\n &:hover {\n background-color: ",";\n }\n &:focus {\n box-shadow: none;\n }\n .ant-click-animating-node {\n display: none;\n }\n }\n"])),(0,u.y)("primary.0","#008489"),(0,u.y)("primary.0","#008489"),(0,u.y)("color.5","rgba(0, 0, 0, 0.25)")),v=m.Ay.span(d||(d=(0,x.A)(["\n font-size: 15px;\n line-height: 1;\n font-weight: 700;\n color: ",";\n padding: 0 8px;\n"])),(0,u.y)("text.0","#2C2C2C")),j=m.Ay.h2(l||(l=(0,x.A)(["\n color: ",";\n font-size: 45px;\n line-height: 54px;\n font-weight: 700;\n margin-bottom: 0;\n margin-top: 58px;\n @media (max-width: 1600px) {\n font-size: 38px;\n line-height: 48px;\n }\n @media (max-width: 1440px) {\n font-size: 32px;\n line-height: 42px;\n }\n @media (max-width: 1200px) {\n font-size: 28px;\n line-height: 32px;\n }\n"])),(0,u.y)("text.0","#2C2C2C")),A=m.Ay.p(p||(p=(0,x.A)(["\n color: ",";\n font-size: 25px;\n line-height: 30px;\n margin-bottom: 45px;\n margin-top: 10px;\n @media (max-width: 1600px) {\n font-size: 22px;\n }\n @media (max-width: 1440px) {\n font-size: 20px;\n }\n @media (max-width: 1440px) {\n font-size: 18px;\n }\n"])),(0,u.y)("text.2","#777777")),k=m.Ay.p(c||(c=(0,x.A)(["\n text-align: center;\n font-size: 15px;\n font-weight: 700;\n color: ",";\n line-height: 1;\n a {\n color: #eba14c;\n &:hover,\n &:focus {\n outline: none;\n color: #eba14c;\n text-decoration: none;\n }\n }\n"])),(0,u.y)("text.2","#777777")),C=m.Ay.div(h||(h=(0,x.A)(["\n width: 57%;\n height: 100%;\n position: fixed;\n top: 0;\n right: 0;\n @media (max-width: 1200px) {\n width: 50%;\n }\n @media (max-width: 991px) {\n display: none;\n }\n img {\n position: absolute;\n top: 0;\n right: 0;\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n"]))),F=g},69266:(n,e,r)=>{r.r(e),r.d(e,{default:()=>v});var o=r(65043),t=r(35475),a=r(14893),i=r(50856),s=r(48114),d=r(23292),l=r(24858),p=r(40426),c=r(60521),h=r(87021),x=r(86758),m=r(88169),u=r(35874),g=r(73216),b=r(82172),f=r(70579);const y=()=>{var n,e,r,t,a,i,s,d,y,w,v,j;const{signUp:A,loggedIn:k}=(0,o.useContext)(m.c),[C,F]=(0,o.useState)(""),[z,E]=(0,o.useState)({username:null}),[N,T]=(0,o.useState)("register"),[B,_]=(0,o.useState)(!1),{control:q,watch:P,formState:{errors:S},handleSubmit:L}=((0,g.Zp)(),(0,l.mN)({mode:"onChange"})),V=P("password"),I=P("confirmPassword");if("success"===N)return(0,f.jsx)(p.A,{message:C||"Registration successful. Verification email sent.",type:"success"});const J=n=>/^[^0-9]*$/.test(n)||"This field should not contain digits!";return(0,f.jsxs)(f.Fragment,{children:["failure"===N&&(0,f.jsx)("div",{style:{marginBottom:"20px"},children:(0,f.jsx)(p.A,{message:C||"Registration failed. Please try again.",type:"error"})}),(0,f.jsxs)("form",{onSubmit:L((async n=>{try{const e=new FormData;e.append("username",n.email),e.append("password",n.password),e.append("confirmPassword",n.confirmPassword),e.append("first_name",n.first_name),e.append("last_name",n.last_name),e.append("phone",n.phone),e.append("termsAndConditions",String(n.termsAndConditions)),_(!0);const r=await(0,u.DY)(e);200===r.status?(F(r.data.msg),T("success")):(F(r.data.msg||"Something went wrong, please try again later"),E(r.data.error),T("failure"),_(!1))}catch(e){console.error("Registration failed:",e);const n=(0,b.r)(e);T("failure"),_(!1),E(n),console.log(n)}})),children:[(0,f.jsx)(x.A,{label:"First Name",htmlFor:"first_name",error:S.first_name&&(0,f.jsxs)(f.Fragment,{children:["required"===(null===(n=S.first_name)||void 0===n?void 0:n.type)&&(0,f.jsx)("span",{children:"This field is required!"}),"validate"===(null===(e=S.first_name)||void 0===e?void 0:e.type)&&(0,f.jsx)("span",{children:S.first_name.message})]}),children:(0,f.jsx)(l.xI,{name:"first_name",defaultValue:"",control:q,rules:{required:!0,validate:J},render:n=>
1{let{field:{onChange:e,onBlur:r,value:o}}=n;return(0,f.jsx)(c.A,{onChange:e,onBlur:r,value:o})}})}),(0,f.jsx)(x.A,{label:"Last Name",htmlFor:"last_name",error:S.last_name&&(0,f.jsxs)(f.Fragment,{children:["required"===(null===(r=S.last_name)||void 0===r?void 0:r.type)&&(0,f.jsx)("span",{children:"This field is required!"}),"validate"===(null===(t=S.last_name)||void 0===t?void 0:t.type)&&(0,f.jsx)("span",{children:S.last_name.message})]}),children:(0,f.jsx)(l.xI,{name:"last_name",defaultValue:"",control:q,rules:{required:!0,validate:J},render:n=>{let{field:{onChange:e,onBlur:r,value:o}}=n;return(0,f.jsx)(c.A,{onChange:e,onBlur:r,value:o})}})}),(0,f.jsxs)(x.A,{label:"Email",htmlFor:"email",error:S.email&&(0,f.jsxs)(f.Fragment,{children:["required"===(null===(a=S.email)||void 0===a?void 0:a.type)&&(0,f.jsx)("span",{children:"This field is required!"}),"pattern"===(null===(i=S.email)||void 0===i?void 0:i.type)&&(0,f.jsx)("span",{children:"Please enter a valid email address"})]}),children:[(0,f.jsx)(l.xI,{name:"email",defaultValue:"",control:q,rules:{required:!0,pattern:/^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/},render:n=>{let{field:{onChange:e,onBlur:r,value:o}}=n;return(0,f.jsx)(c.A,{type:"email",onChange:e,onBlur:r,value:o})}}),z.username&&(0,f.jsx)(p.A,{message:z.username,showIcon:!0,type:"error"})]}),(0,f.jsxs)(x.A,{label:"Phone Number",htmlFor:"phoneNumber",error:S.phone&&(0,f.jsxs)(f.Fragment,{children:["required"===(null===(s=S.phone)||void 0===s?void 0:s.type)&&(0,f.jsx)("span",{children:"This field is required!"}),"minLength"===(null===(d=S.phone)||void 0===d?void 0:d.type)&&(0,f.jsx)("span",{children:"Phone Number must be at lest 11 characters!"}),"maxLength"===(null===(y=S.phone)||void 0===y?void 0:y.type)&&(0,f.jsx)("span",{children:"Phone Number must not be longer than 11 characters!"})]}),children:[(0,f.jsx)(l.xI,{name:"phone",defaultValue:"",control:q,rules:{required:!0,minLength:11,maxLength:11},render:n=>{let{field:{onChange:e,onBlur:r,value:o}}=n;return(0,f.jsx)(c.A,{type:"number",onChange:e,onBlur:r,value:o})}}),z.username&&(0,f.jsx)(p.A,{message:z.username,showIcon:!0,type:"error"})]}),(0,f.jsx)(x.A,{label:"Password",htmlFor:"password",error:S.password&&(0,f.jsxs)(f.Fragment,{children:["required"===(null===(w=S.password)||void 0===w?void 0:w.type)&&(0,f.jsx)("span",{children:"This field is required!"}),"minLength"===(null===(v=S.password)||void 0===v?void 0:v.type)&&(0,f.jsx)("span",{children:"Password must be at lest 6 characters!"}),"maxLength"===(null===(j=S.password)||void 0===j?void 0:j.type)&&(0,f.jsx)("span",{children:"Password must not be longer than 20 characters!"})]}),children:(0,f.jsx)(l.xI,{name:"password",defaultValue:"",control:q,rules:{required:!0,minLength:6,maxLength:20},render:n=>{let{field:{onChange:e,onBlur:r,value:o}}=n;return(0,f.jsx)(c.A.Password,{onChange:e,onBlur:r,value:o,autoComplete:"new-password"})}})}),(0,f.jsx)(x.A,{label:"Confirm password",htmlFor:"confirmPassword",error:I&&V!==I&&(0,f.jsx)("span",{children:"Your password is not same!"}),children:(0,f.jsx)(l.xI,{name:"confirmPassword",defaultValue:"",control:q,rules:{required:!0},render:n=>{let{field:{onChange:e,onBlur:r,value:o}}=n;return(0,f.jsx)(c.A.Password,{onChange:e,onBlur:r,value:o})}})}),(0,f.jsx)(h.Ay,{className:"signin-btn bg",type:"primary",htmlType:"submit",size:"large",style:{width:"100%"},children:B?(0,f.jsxs)("div",{className:"loader",children:[(0,f.jsx)("div",{className:"bar1"}),(0,f.jsx)("div",{className:"bar2"}),(0,f.jsx)("div",{className:"bar3"}),(0,f.jsx)("div",{className:"bar4"}),(0,f.jsx)("div",{className:"bar5"}),(0,f.jsx)("div",{className:"bar6"}),(0,f.jsx)("div",{className:"bar7"}),(0,f.jsx)("div",{className:"bar8"}),(0,f.jsx)("div",{className:"bar9"}),(0,f.jsx)("div",{className:"bar10"}),(0,f.jsx)("div",{className:"bar11"}),(0,f.jsx)("div",{className:"bar12"})]}):(0,f.jsx)("div",{className:"email",children:"Sign Up"})})]})]})};var w=r(67519);const v=()=>(0,f.jsxs)(w.Ay,{children:[(0,f.jsxs)(w._H,{children:[(0,f.jsx)(a.A,{withLink:!0,linkTo:"/",src:i,title:"Farath Holdings."}),(0,f.jsx)(w.hE,{children:"Welcome To Farath Holdings."}),(0,f.jsx)(w.ff,{children:"Please create your account"}),(0,f.jsx)(y,{}),(0,f.jsxs)(w.EY,{style:{marginTop:"20px"},children:["Already have an account?\xa0",(0,f.jsx)(t.N_,{to:d.m0,children:"Sign In"})]})]}),(0,f.jsx)(w.QS,{children:(0,f.jsx)("img",{src:s,alt:"Auth page banner"})})]})}
1,48114:(n,e,r)=>{n.exports=r.p+"static/media/auth-banner.d1995c6809c3d25b2d76.png"}}]); 2//# sourceMappingURL=9266.69d22cac.chunk.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.