1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./48jw0fg7.production.bundle.min.js","./CZzrexQa.production.bundle.min.js","./BUfVhS43.production.css","./E6csxmgU.production.bundle.min.js","./9eHdvLN4.production.bundle.min.js","./CHClG9UV.production.bundle.min.js","./CiD4UJCU.production.bundle.min.js"])))=>i.map(i=>d[i]); 2import{r as o,b as ee,a as te,j as a,R as ae,_ as re}from"./CZzrexQa.production.bundle.min.js";import{B as se}from"./YCM_kEyP.production.bundle.min.js";import{F as ne}from"./DFn2u8qh.production.bundle.min.js";import{F as k}from"./CpVN2k6O.production.bundle.min.js";import{F as E}from"./B0uEge7d.production.bundle.min.js";import{i as b,g as oe,s as ie}from"./DtpVAsok.production.bundle.min.js";import{u as le,s as ce}from"./9eHdvLN4.production.bundle.min.js";import{L as me}from"./Ch78CD0x.production.bundle.min.js";import{b as ue}from"./JMY7hIGQ.production.bundle.min.js";import{u as de}from"./D1TNtnEv.production.bundle.min.js";import{A as pe}from"./BWOzg60F.production.bundle.min.js";import{O as he}from"./C82vNmiz.production.bundle.min.js";import{v as fe,e as V}from"./CBIXpEo7.production.bundle.min.js";import{G as ge,a as _e}from"./CICBwEbx.production.bundle.min.js";import"./DGYQp8fe.production.bundle.min.js";import"./D4lvmK5r.production.bundle.min.js";import"./Bm1LOIPR.production.bundle.min.js";import"./kkIr59yR.production.bundle.min.js";import"./BmBjCq8D.production.bundle.min.js";import"./CHClG9UV.production.bundle.min.js";import"./Dsqj8S3w.production.bundle.min.js";import"./2mZBARql.production.bundle.min.js";import"./vhNSgALD.production.bundle.min.js";import"./CiD4UJCU.production.bundle.min.js";import"./CXT9N8xZ.production.bundle.min.js";function we(m){const l=o.useRef(m);l.current=m,o.useEffect(()=>{if(typeof window>"u")return;let u=!1;const s=()=>{u||(u=!0,l.current(),window.removeEventListener("scroll",s),window.removeEventListener("mousemove",s),window.removeEventListener("touchstart",s),window.removeEventListener("click",s),window.removeEventListener("keydown",s))};return window.addEventListener("scroll",s,{once:!0,passive:!0}),window.addEventListener("mousemove",s,{once:!0,passive:!0}),window.addEventListener("touchstart",s,{once:!0,passive:!0}),window.addEventListener("click",s,{once:!0,passive:!0}),window.addEventListener("keydown",s,{once:!0}),()=>{window.removeEventListener("scroll",s),window.removeEventListener("mousemove",s),window.removeEventListener("touchstart",s),window.removeEventListener("click",s),window.removeEventListener("keydown",s)}},[])}const ve=ae.lazy(()=>re(()=>import("./48jw0fg7.production.bundle.min.js"),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url));let K=!0;const Me=()=>{const m=ee(),l=te(),u=le(),s=l.get("register_with"),g=l.get("aws_token"),_=l.get("gcp_token"),[ye,$]=o.useState(null),[N,S]=o.useState(!1),d=o.useRef(!1),p=o.useRef(null);we(()=>S(!0));const q=o.useMemo(()=>g?`/auth/login?aws_token=${g}`:_?`/auth/login?gcp_token=${_}`:"/auth/login",[g,_,b()]),[e,w]=o.useState({full_name:"",password:"",email:"",company_name:"",calling_code:"+1",phone:"",inflight:!1,status:!1,message:"",isTermsChecked:!1,full_name_error:!1,email_error:!1,company_name_error:!1,password_error:!1,calling_code_error:!1,phone_error:!1,terms_error:!1,selectedCountry:"USA",registerWithEmail:!s,aws_token:g,gcp_token:_}),c=de(),v=(r,h)=>{w(f=>({...f,[r]:h,message:"",status:!1,inflight:!1}))},n=(r,h)=>{w(f=>({...f,[r]:h}))};o.useEffect(()=>{n("registerWithEmail",!s)},[s]);const W=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,B=/^[+]?[(]?[0-9]{3}[)]?[-\s.]?[0-9]{3}[-\s.]?[0-9]{4,6}$/im,T=e.full_name.trim(),j=e.email,D=e.company_name.trim(),M=e.phone;e.password;const A=T.length<1,R=j.length<1||!W.test(String(j).toLowerCase()),Z=e.phone.length>0&&!B.test(String(M).toLowerCase()),U=fe(e.password),C=!U.isValid,I=U.error,H=()=>{A&&n("full_name_error",!0),R&&n("email_error",!0),Z&&n("phone_error",!0),e.isTermsChecked||n("terms_error",!0),C&&n("password_error",!0),K=!A&&!R&&e.isTermsChecked&&!C},y=()=>{T.length>0&&n("full_name_error",!1),j.length>0&&n("email_error",!1),D.length>0&&n("company_name_error",!1),C||n("password_error",!1)},Q=async r=>{$(r);const h=await V(e.password),f=await V(e.email.toLowerCase());u(ue({full_name:e.full_name,password:h,email:f,company_name:e.company_name,calling_code:e.calling_code,ph
2one:e.phone,cca:e.selectedCountry,captcha:r,ga:b()?"blocked":"enabled",aws_token:e.aws_token,gcp_token:e.gcp_token},(xe,P,t)=>{var O,z,x,F;const i=(t==null?void 0:t.status)||!1,G=(t==null?void 0:t.mail_sent)||!1;(i||G)&&(ie(!1),c("signup successful",{email:e.email.toLowerCase(),user_name:e.full_name})),(O=t==null?void 0:t.redirect_url)!=null&&O.length&&((z=t==null?void 0:t.redirect_url)==null?void 0:z.length)>0&&(window.location.href=t==null?void 0:t.redirect_url),t!=null&&t.message&&u(ce(t!=null&&t.status?"success":"error",t.message,{duration:t!=null&&t.status?3e3:12e3})),w(L=>({...L,inflight:typeof P<"u"?P:!1,status:(t==null?void 0:t.status)||!1,message:(t==null?void 0:t.message)||"",full_name:i?"":e.full_name,email:i?"":e.email,company_name:i?"":e.company_name,calling_code:i?"":e.calling_code,phone:i?"":e.phone})),(F=(x=window==null?void 0:window.grecaptcha)==null?void 0:x.reset)==null||F.call(x),i&&(w(L=>({...L,inflight:!1,status:!0,message:(t==null?void 0:t.message)||"",full_name:"",email:"",company_name:"",calling_code:"",phone:""})),G?setTimeout(()=>m("/auth/thankyou"),300):setTimeout(()=>m("/auth/login"),900))}))},X=async r=>{if(r.preventDefault(),c("click - signup button",{email:e.email.toLowerCase(),user_name:e.full_name}),H(),!!K){if(!N){S(!0),d.current=!0;return}if(!p.current){d.current=!0;return}d.current=!1,await p.current.executeAsync()}},Y=()=>{window.setTimeout(async()=>{!d.current||!p.current||(d.current=!1,await p.current.executeAsync())},0)},J=()=>a.jsxs("div",{children:["I agree to the"," ",a.jsx("a",{href:"https://middleware.io/master-subscription-agreement/",target:"_blank",rel:"noreferrer",children:"Terms of service"})," ","and"," ",a.jsx("a",{href:"https://middleware.io/privacy-policy/",target:"_blank",rel:"noreferrer",children:"Privacy Policy"}),"."]});return o.useEffect(()=>{const r={last_page_visit:oe()};c("open signup page",r),c("open signup page - unique user",r,!1,!0)},[]),a.jsx("div",{className:"auth__register__context register_or_login_WithEmail auth_signup",children:a.jsxs(pe,{type:"sign-up",title:"Sign Up",subTitle:"Get started with Middleware",children:[a.jsxs(he,{signUp:!0,className:"register-with-email",children:[a.jsx("div",{className:"other-sign-in-button",children:a.jsxs("div",{onClick:()=>{c("click - signup with google"),window.location.href="https://"+window.location.host+`/api/v1/auth/login-with-google?ga=${b()?"blocked":"enabled"}`},children:[a.jsx(ge,{size:16}),"Google"]})}),a.jsx("div",{className:"other-sign-in-button",children:a.jsxs("div",{onClick:()=>{c("click - signup with github"),window.location.href="https://"+window.location.host+`/api/v1/auth/login-with-github?ga=${b()?"blocked":"enabled"}`},children:[a.jsx(_e,{size:16}),"Github"]})})]}),a.jsx("div",{className:"or-divider",children:"or"}),a.jsxs("form",{method:"post",className:"register__form",onSubmit:r=>X(r),children:[a.jsxs("div",{className:"first-name inline-input",children:[a.jsx(E,{id:"fname",placeholder:"Enter your full name",className:"signup-firstname",value:e.full_name,isError:e.full_name_error,label:"Username*",onKeyUp:y,onChange:r=>v("full_name",r),allowedSpecialChars:[]}),e.full_name_error&&a.jsx(k,{isError:!0,text:"Name is required"})]}),a.jsxs("div",{className:"email inline-input",children:[a.jsx(E,{id:"email",placeholder:"Enter your email address",className:"email",label:"Email Address*",value:e.email,isError:e.email_error,onKeyUp:y,onChange:r=>v("email",r.replace(/\s/g,"")),allowedSpecialChars:["@","+",".","-","_"]}),e.email_error&&a.jsx(k,{isError:!0,text:"Please use your business email address to signup."})]}),a.jsxs("div",{className:"password inline-input",children:[a.jsx(E,{type:"password",id:"password",label:"Password*",placeholder:"Set a strong password to protect your profile",value:e.password,isError:e.password_error,onKeyUp:y,onChange:r=>v("password",r)}),e.password_error&&I&&a.jsx(k,{isError:!0,text:I})]}),a.jsx("div",{className:"company inline-input",children:a.jsx(E,{id:"company",placeholder:"Your Company Name",label:"Company Name (Optional)",className:"company",value:e.company_name,isError:e.company_name_error,onKeyUp:y,onChange:r=>v("company_name",r),allowedSpecialChars:["."]})}),a.jsxs("div",{className:"terms-check inline-input",children:[a.jsx(ne,{className:"checkbox terms-service-checkbox",id:"terms-service-checkbox",label:J(),checked:e.isTermsChecked,onChange:r=>{r?(n("terms_error",!1),n("isTermsChecked",!0)):(n("terms_error",!0),n("isTermsChecked",!1))}}
2),e.terms_error&&a.jsx(k,{isError:!0,text:"Kindly agree to the Privacy Policy and Subscription Terms to Sign Up."})]}),N&&a.jsx(o.Suspense,{fallback:null,children:a.jsx(ve,{ref:p,sitekey:"6Lfray0tAAAAAG6vXCuteKwl3xf8dzt86N2OLVfU",onChange:Q,size:"invisible",asyncScriptOnLoad:Y})}),a.jsx(se,{className:"sign-up-login-btn",loading:e.inflight,disabled:e.inflight,primary:!0,children:"Sign Up Now"})]}),a.jsx("div",{className:"or-seperator already-account",children:a.jsxs("div",{className:"divider login-text",children:["Already have an account? ",a.jsx(me,{to:q,children:"Login"})]})})]})})};export{Me as default};
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.