1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7474],{17474:(e,l,t)=>{"use strict";t.r(l),t.d(l,{default:()=>_});var n=t(2550),a=t(93168),o=t(32833),i=t(24364),d=t(35316);let s=function(e){let{item:l,emptyForm:t,invalidForm:a}=e;return t?(null==t?void 0:t[null==l?void 0:l.name])&&(0,n.jsx)(d.A,{size:"text-14",className:"text-red-600 mt-2 md:mt-4",children:t[null==l?void 0:l.name]}):a?(null==a?void 0:a[null==l?void 0:l.name])&&(0,n.jsx)(d.A,{size:"text-14",className:"text-red-500 mt-2 md:mt-4",children:a[null==l?void 0:l.name]}):null};var r=t(15759),u=t(83382),c=t(35624),m=t(75615);function v(e){let{id:l,label:t,bottom:a,value:o,onChange:i,placeholder:d,onKeyDown:s,name:v,required:x}=e,h=(0,u.useRef)(null),[p,f]=(0,u.useState)("");return(0,n.jsx)(c.A,{label:t,id:l,name:v,bottom:a,required:x,children:(0,n.jsxs)("div",{className:"relative z-10",children:[(0,n.jsx)("input",{autoComplete:"off",className:m.R,placeholder:d,value:p,type:"text",onKeyDown:s,onClick:()=>{null==h||h.current.showPicker()}}),(0,n.jsx)("input",{autoComplete:"off",id:l,ref:h,className:"w-full h-full opacity-0 absolute top-0 left-0 -z-10",value:o,name:v,required:x,onChange:e=>{let l=e.target.value;if(i(e),l){let e=new Date(l),t=e.getDate(),n=e.getMonth(),a=e.getFullYear();f("".concat(t,"/").concat(n+1,"/").concat(a))}else f("")},type:"date"}),(0,n.jsxs)("div",{className:"absolute top-3 right-3 md:top-4 md:right-4 xl:top-6 xl:right-4 cursor-pointer hover:scale-110",onClick:()=>{var e;return null==h||null==(e=h.current)?void 0:e.showPicker()},children:[(0,n.jsx)("div",{className:"hidden xl:block",children:(0,n.jsx)(r.default,{src:"/calendar.png",alt:"icon",width:24,height:24})}),(0,n.jsx)("div",{className:"xl:hidden",children:(0,n.jsx)(r.default,{src:"/calendar.png",alt:"icon",width:20,height:20})})]})]})})}var x=t(73527),h=t.n(x);function p(e){let{id:l,label:t,bottom:a,value:o,onChange:i,onKeyDown:d,placeholder:s,name:v,required:x}=e,[p,f]=(0,u.useState)(!1),[g,j]=(0,u.useState)(["","","","","",""]),y=(0,u.useId)(),[N,b]=(0,u.useState)(!1);return(0,u.useEffect)(()=>{if(!N&&o){var e;b(!0);let l=null==(e=o.toString())?void 0:e.split(),t=[];g.forEach((e,n)=>{var a;t[n]=null!=(a=l[n])?a:g[n]}),j(t)}},[g,N,o]),(0,n.jsx)(c.A,{label:t,id:y+l,name:v,bottom:a,required:x,children:(0,n.jsxs)("div",{className:"relative z-10",children:[(0,n.jsx)("input",{id:y+l,className:"".concat(m.R," ").concat(h().password," ").concat(p?h().show:h().hide," ").concat((null==o?void 0:o.length)>0?h().letterSpacing:""," "),placeholder:p?s:"",name:v,required:x,type:"text",value:o,autoComplete:"off",inputMode:"numeric",maxLength:6,onChange:e=>{let l=e.target.value;if(!isNaN(Number(l))&&(null==l?void 0:l.length)<=6){let n=[],a=null==l?void 0:l.split("");for(let e=0;e<(null==g?void 0:g.length);e++){var t;n[e]=null!=(t=a[e])?t:""}j(n),i(e)}},pattern:"[0-9]*",onKeyDown:d}),(0,n.jsx)("div",{className:"".concat(h().dots," ").concat(p&&h().hidden),children:null==g?void 0:g.map((e,t)=>(0,n.jsx)("span",{className:"".concat(h().dot," ").concat(e?h().fill:"")},l+"-"+t))}),(0,n.jsx)("button",{className:h().eye,onClick:()=>f(!p),title:"Show/Hide password",children:(0,n.jsx)(r.default,{alt:"",src:p?"/Eye.svg":"/Eye Off.svg",width:24,height:24,style:{aspectRatio:1}})})]})})}t(49805);var f=t(67360),g=t(56753),j=t(56015),y=t(49055),N=t(44232),b=t(67767);function _(e){let{contact:l,data:t,setStep:r,setDataStep1:c,branchData:m}=e,x=(0,u.useMemo)(()=>null==t?void 0:t.fields,[null==t?void 0:t.fields]),[h,f]=(0,u.useState)({}),[_,k]=(0,u.useState)({}),[A,S]=(0,u.useState)({}),[F,E]=(0,u.useState)(!1),D=(0,y.c)(),z=(0,y.c)("Error"),I=(0,u.useCallback)(e=>{var l,t,n;let a=null==e||null==(l=e.target)?void 0:l.name,o=null==e||null==(t=e.target)?void 0:t.value;f({...h,[a]:o}),("contact"===a||"ref_code"===a)&&(null==(n=sessionStorage)||n.setItem(a,o))},[h]);(0,u.useEffect)(()=>{!l||(null==h?void 0:h.contact)||I({target:{name:"contact",value:l}})},[l,I,null==h?void 0:h.contact]);let q=(0,u.useCallback)(()=>{k(null),S(null);let e={},l={};for(let l=0;l<x.length;l++){let t=x[l];(null==t?void 0:t.required)&&(h[null==t?void 0:t.name]||(e.isNotNull=!0,e[null==t?void 0:t.name]=null==t?void 0:t.isEmpty))}if(null==e?void 0:e.isNotNull)return void k(e);if((null==h?void 0:h.password)!==(null==h?void 0:h.confirm_password)){let e=null==x?void 0:x.find(e=>(null==e?void 0:e.name)==="confirm_password");l.isNotNull=!0,l[e.name]=e.isInvalid,S(l);return}E(!0),c(h);let t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let l=16*Math.random()|0;return("x"==e?l:3&l|8).toString(16)});sessionStorage.setItem("MAI@deviceId",t),t&&N.A.post(b.wN.signup+"/register",h,{headers:{"Device-Id":t}}).then(e=>{e.error||r(1)}).catch(e=>{var l,t,n,a;let o=null==e||null==(t=e.response)||null==(l=t.data)?void 0:l.code,i=null==e||null==(a=e.response)||null==(n=a.data)?void 0:n.message,d={};for(let e=0;e<x.length;e++){let l=x[e];(null==i?void 0:i.includes("the field (".concat(null==l?void 0:l.name,")")))&&(d.isNotNull=!0,d[null==l?void 0:l.name]=null==l?void 0:l.isInvalid)}(null==d?void 0:d.isNotNull)?S(d):S({message:z(o)})}).finally(()=>{E(!1)})},[h,c,x,r,z]),M=(0,u.useCallback)(e=>{(null==e?void 0:e.key)==="Enter"&&q()},[q]);return(0,n.jsxs)("div",{children:[(0,n.jsx)(a.A,{}),(0,n.jsxs)(i.default,{className:"flex-col h-full justify-center",children:[(0,n.jsx)(d.A,{className:"whitespace-pre-wrap font-NewYork",size:{mobile:"text-32",desktop:"lg:text-60"},tag:"h3",children:(0,n.jsx)(j.A,{data:null==t?void 0:t.heading})}),(0,n.jsx)("div",{children:(0,n.jsxs)(i.default,{className:"flex-col gap-6 md:gap-11",children:[(0,n.jsx)("div",{className:"",children:null==x?void 0:x.map((e,t)=>{var a,o;let i=(null==e?void 0:e.name)+"-"+t;return(null==e?void 0:e.type)==="referral_code"?(0,n.jsx)(C,{id:i,item:e,dataSend:h,handleEnter:M,branchData:m,onChangeDataForm:I},(null==e?void 0:e.name)+"-input-"+t):(null==e?void 0:e.type)==="date"?(0,n.jsx)(v,{id:i,name:null==e?void 0:e.name,label:null==e?void 0:e.label,value:null!=(a=dataForm[e.name])?a:"",onCh
1ange:I,onKeyDown:M,placeholder:null==e?void 0:e.placeholder,required:!0,bottom:(0,n.jsx)(s,{item:e,emptyForm:_,invalidForm:A})},(null==e?void 0:e.name)+"-input-"+t):(null==e?void 0:e.type)==="password"?(0,n.jsx)(p,{id:i,name:null==e?void 0:e.name,label:null==e?void 0:e.label,value:null!=(o=h[e.name])?o:"",onKeyDown:M,onChange:I,placeholder:null==e?void 0:e.placeholder,required:!0,bottom:(0,n.jsx)(s,{item:e,emptyForm:_,invalidForm:A})},(null==e?void 0:e.name)+"-input-"+t):(0,n.jsx)(w,{id:i,contact:l,dataSend:h,emptyForm:_,handleEnter:M,invalidForm:A,item:e,onChangeDataForm:I},(null==e?void 0:e.name)+"-input-"+t)})}),(0,n.jsx)(o.A,{title:D("Register"),disabled:!h,onClick:q,variant:"Primary",className:"w-full rounded-full py-3 md:py-[22px]",children:F?(0,n.jsx)(g.A,{color:"white"}):(0,n.jsx)(d.A,{weight:"font-semibold",size:{mobile:"text-14",desktop:"lg:text-18"},children:D("Register")})}),(null==A?void 0:A.message)&&(0,n.jsx)(d.A,{size:"text-14",className:"text-red-500 mt-4 md:mt-6",children:A.message})]})})]})]})}function w(e){let{item:l,id:t,dataSend:a,onChangeDataForm:o,handleEnter:i,emptyForm:d,invalidForm:r}=e,c=(0,u.useMemo)(()=>{var e;return null!=(e=a[null==l?void 0:l.name])?e:""},[a,null==l?void 0:l.name]);return(0,n.jsx)(f.A,{id:t,name:null==l?void 0:l.name,label:null==l?void 0:l.label,value:null!=c?c:"",onCh
1ange:o,onKeyDown:i,placeholder:null==l?void 0:l.placeholder,required:null==l?void 0:l.required,type:null==l?void 0:l.type,bottom:(0,n.jsx)(s,{item:l,emptyForm:d,invalidForm:r})})}function C(e){let{item:l,id:t,dataSend:a,onChangeDataForm:o,handleEnter:i}=e,[d,s]=(0,u.useState)(!1),r=(0,u.useMemo)(()=>a[null==l?void 0:l.name],[a,null==l?void 0:l.name]);return(0,u.useEffect)(()=>{let e=sessionStorage.getItem("ref_code");setTimeout(()=>{d||r||!e||(s(!0),o({target:{name:"ref_code",value:null!=e?e:""}}))},400)},[d,o,r]),(0,n.jsx)(f.A,{id:t,name:null==l?void 0:l.name,label:null==l?void 0:l.label,value:null!=r?r:"",onChange:o,onKeyDown:i,placeholder:null==l?void 0:l.placeholder,type:null==l?void 0:l.type})}},56753:(e,l,t)=>{"use strict";t.d(l,{A:()=>i});var n=t(2550),a=t(94867),o=t.n(a);let i=function(e){let{color:l="default",size:t}=e;return(0,n.jsx)("span",{className:"".concat(o().main," ").concat(o()[l]),style:{width:null!=t?t:60,height:null!=t?t:60}})}},73527:e=>{e.exports={password:"Form_password__9QMdh",letterSpacing:"Form_letterSpacing__PNaby",hide:"Form_hide__puvhU",dots:"Form_dots__6XcKB",dot:"Form_dot__EvjoN",fill:"Form_fill__tbU9I",eye:"Form_eye__hp6Jh"}},93168:(e,l,t)=>{"use strict";t.d(l,{A:()=>r});var n=t(2550),a=t(49055),o=t(32833),i=t(2419),d=t(35316),s=t(82484);let r=function(e){let{className:l,backToHome:t}=e,r=(0,a.c)(),u=(0,s.useRouter)();return(0,n.jsx)(o.A,{title:r("back"),onClick:()=>{var e,l;t?t():(null==(l=window)||null==(e=l.history)?void 0:e.length)<=1?null==u||u.push("/"):null==u||u.back()},isCustomeRounded:!0,className:"py-[10px] px-[9px] rounded-lg ".concat(null!=l?l:"mb-4 lg:mb-6"," hover:bg-neutral-80 hover:bg-opacity-40"),children:(0,n.jsxs)(d.A,{tag:"span",size:"text-18",weight:"font-semibold",className:"flex justify-center items-center gap-1",children:[(0,n.jsx)(i.A,{size:"20px",color:"#0A0C10",className:"mt-px"}),(0,n.jsxs)("span",{children:["\xa0",r("back")]})]})})}},94867:e=>{e.exports={main:"Loading_main__TOQv_",loading:"Loading_loading__QnQa3"}}}]);
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.