1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="987d965f-ff5f-402c-809f-7a016a59f7d9",e._sentryDebugIdIdentifier="sentry-dbid-987d965f-ff5f-402c-809f-7a016a59f7d9")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8295],{14829:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>C});var a=n(37876),i=n(65776),s=n(14232),l=n(57283),r=n(48230),o=n.n(r),c=n(80954),d=n(77328),u=n.n(d),m=n(89099),h=n(97284),x=n(78909),f=n(41160),g=n(79281),p=n(86087),y=n(12188),w=n(42273),v=n(97293),b=n(26884),j=n(5732),N=n(34550),k=n(66634);let E=new Set(["auth/too-many-requests","auth/invalid-email","auth/missing-email","auth/user-not-found","auth/network-request-failed"]),S=async e=>{let t=await (0,p.kF)(e,{timeout:y.xS});return(null==t?void 0:t.accountStatus)==="not_found"?null:t},z=async e=>{let t=await i.Ay.auth().fetchSignInMethodsForEmail(e);return!(t.indexOf("emailLink")>-1)&&(t.indexOf("password"),!0)};function C(){var e;let{push:t}
1=(0,w.E$)(),[n,r]=(0,s.useState)(""),[d,p]=(0,s.useState)(!1),[y,C]=(0,s.useState)(""),[A,_]=(0,s.useState)(!1),[q,B]=(0,s.useState)(!1),[I,F]=(0,s.useState)(!1),[P,T]=(0,s.useState)(!1),[W,D]=(0,s.useState)(!1),[R,O]=(0,s.useState)(!1),X=(0,s.useRef)(null),G=(0,x.A)(),H=(0,m.useRouter)(),L=(0,v.Dh)(H.query),M=(0,j.Yd)(H.query,b.xG),Y=(0,b.OC)((0,b.tU)(H.query),M,n),U=e=>(0,b.Hq)(e,{externalAuthId:L,inviteId:Y,invitedEmail:M||n.trim()});(0,s.useEffect)(()=>{var e;(null==H||null==(e=H.query)?void 0:e.invitedEmail)&&r(H.query.invitedEmail)},[null==H||null==(e=H.query)?void 0:e.invitedEmail]);let V={url:U("".concat(G,"/verify")),handleCodeInApp:!0},Z={url:U("".concat(G,"/login")),handleCodeInApp:!0},$=async()=>{await i.Ay.auth().sendSignInLinkToEmail(n,V),F(!0),window.localStorage.setItem("emailForSignIn",n)},J=async()=>{try{await i.Ay.auth().signInWithEmailAndPassword(n,y),window.open(U("/fetchUser"),"_self")}catch(e){if((0,N.y7)(e))return void _(!0);throw e}};async function K(){B(!0),T(!1),_(!1);let e=h.n.onboarding;try{let o=await S(n);if(e=h.n.login,o){if((null==o?void 0:o.accountStatus)==="invited"){var a,s,l,r;let e=await i.Ay.auth().fetchSignInMethodsForEmail(null!=(s=null==n||null==(a=n.toLowerCase())?void 0:a.trim())?s:"");if(0===e.length)return void H.push(Y?(0,b.Hx)("/invitation",Y):"/invitation?email=".concat(encodeURIComponent(null!=(r=null==n||null==(l=n.toLowerCase())?void 0:l.trim())?r:"")))}}else{t({title:"The email address ".concat(n," is not associated with an XBuild account."),variant:"error"}),T(!0);return}d?await J():await z(n)?p(!0):await $()}catch(a){(0,N.lF)(a)||(0,h.P)({error:a,featureGroup:e,additionalData:{email:n,currentUrl:G}}),t({title:(0,N.YA)(a),variant:"error"})}finally{B(!1)}}(0,s.useEffect)(()=>()=>clearTimeout(X.current),[]);let Q=(0,s.useRef)(!1),[ee,et]=(0,k.R)({executer:()=>i.Ay.auth().sendPasswordResetEmail(n,Z),onSuccess:()=>{D(!0),O(!0),clearTimeout(X.current),X.current=setTimeout(()=>O(!1),5e3),t({title:"A password reset email has been sent to ".concat(n,"."),variant:"success"})},onError:e=>{E.has(null==e?void 0:e.code)||(0,h.P)({error:e,featureGroup:h.n.login,additionalData:{email:n,currentUrl:G}}),t({title:"".concat(e),variant:"error"})},onFinally:()=>{Q.current=!1}});return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(u(),{children:(0,a.jsx)("title",{children:"XBuild | Login"})}),(0,a.jsx)(g.A,{children:(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"mt-6 text-3xl font-bold tracking-tight text-gray-900",children:I?"Email link sent!":"Sign in to XBuild"}),(0,a.jsx)("p",{className:(0,c.xW)(I&&"hidden","mt-2 text-sm text-gray-600"),children:L?(0,a.jsxs)(a.Fragment,{children:["Connecting an app requires an existing XBuild account."," ",(0,a.jsx)(o(),{href:"https://x.build",legacyBehavior:!0,children:(0,a.jsx)("a",{target:"_blank",rel:"noopener noreferrer",className:"font-medium text-yellow-600 hover:text-yellow-500 cursor-pointer",children:"Sign up at x.build"})}),", then start the connection again from the app you were linking."]}):(0,a.jsxs)(a.Fragment,{children:["Or"," ",(0,a.jsx)(o(),{href:"/signup",legacyBehavior:!0,children:(0,a.jsx)("a",{className:"font-medium text-yellow-600 hover:text-yellow-500 cursor-pointer",children:"sign up for an account"})})]})})]}),(0,a.jsxs)("div",{className:"mt-6",children:[(0,a.jsxs)("div",{className:(0,c.xW)(I?"block":"hidden"),children:[(0,a.jsxs)("p",{className:"text-base text-zinc-900",children:["A sign-in email with additional instructions has been sent to"," ",(0,a.jsx)("span",{className:"font-bold",children:n}),". Please check your email on this device to complete sign-in."]}),(0,a.jsx)("p",{className:"w-fit mt-6 text-base font-medium text-indigo-600 hover:text-indigo-500 cursor-pointer",onClick:()=>{F(!1)},children:"Go back to login"})]}),(0,a.jsxs)("div",{className:(0,c.xW)(I?"hidden":"space-y-4"),children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"email",className:"block text-sm font-medium leading-6 text-zinc-900",children:"Email address"}),(0,a.jsxs)("div",{className:"mt-2 relative",children:[(0,a.jsx)("input",{id:"email",name:"email",type:"email",value:n,autoComplete:"email",autoFocus:!0,onChange:e=>{r(e.target.value),T(!1)},disabled:d,required:!0,className:" block w-full rounded-md border-0 py-1.5
1shadow-sm ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-inset focus:ring-zinc-600 text-zinc-900 placeholder:text-zinc-400 disabled:text-zinc-400 disabled:placeholder:text-zinc-300 disabled:pr-10 sm:text-sm sm:leading-6"}),d&&(0,a.jsx)("button",{className:"absolute inset-y-0 right-2",onClick:()=>{clearTimeout(X.current),O(!1),r(""),p(!1),C(""),_(!1),B(!1),F(!1),T(!1),D(!1)},children:(0,a.jsx)(f.A,{className:"w-6 h-6 text-zinc-500"})})]})]}),P&&(0,a.jsxs)("p",{className:"text-sm text-zinc-700",role:"status",children:["Already have an account?"," ",(0,a.jsx)(o(),{href:{pathname:"/forgotPassword",query:Y?{email:n,inviteId:Y}:{email:n}},legacyBehavior:!0,children:(0,a.jsx)("a",{className:"font-medium text-yellow-600 hover:text-yellow-500 cursor-pointer",children:"Reset your password"})})]}),d&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("label",{htmlFor:"password",className:"block text-sm font-medium leading-6 text-zinc-900",children:"Password"}),(0,a.jsx)("button",{type:"button",className:"text-sm font-medium leading-6 text-yellow-600 enabled:hover:text-yellow-500 disabled:cursor-not-allowed disabled:opacity-50",onClick:()=>void(!Q.current&&(Q.current=!0,et())),disabled:ee||R,children:ee?"Sending reset emailâ¦":R?"Sent!":W?"Sent! Click here to send again":"Forgot password?"})]}),(0,a.jsxs)("div",{className:"mt-2",children:[(0,a.jsx)("input",{id:"password",name:"password",type:"password",value:y,onChange:e=>{C(e.target.value)},required:!0,className:(0,c.xW)("block w-full rounded-md border-0 py-1.5 shadow-sm ring-1 ring-inset ring-gray-300 text-zinc-900 placeholder:text-zinc-400 focus:ring-2 focus:ring-inset focus:ring-zinc-600 sm:text-sm sm:leading-6",A&&"ring-red-600")}),A&&(0,a.jsx)("span",{className:"text-sm text-red-600",children:"Invalid email and/or password"})]})]}),(0,a.jsx)(l.A,{label:"Next",submitting:q,fullWidth:!0,narrow:!0,onClick:K,className:"py-2 px-3 font-bold !mt-6",disabled:!n||d&&!y}),(0,a.jsxs)("p",{className:"w-full text-sm font-normal text-zinc-500 text-center",children:["By clicking Next, I agree to XBuild's"," ",(0,a.jsx)(o(),{href:"https://x.build/terms",legacyBehavior:!0,children:(0,a.jsx)("a",{className:"text-sm font-medium text-zinc-800 cursor-pointer",children:"Terms of Service"})})," ","and"," ",(0,a.jsx)(o(),{href:"https://x.build/privacy",legacyBehavior:!0,children:(0,a.jsx)("a",{className:"text-sm font-medium text-zinc-800 cursor-pointer",children:"Privacy Policy"})}),"."]})]})]})]})})]})}},15794:(e,t,n)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/login",function(){return n(14829)}])},34550:(e,t,n)=>{"use strict";n.d(t,{NZ:()=>s,YA:()=>h,lF:()=>m,y7:()=>u});var a=n(78028),i=n(99611);let s="We couldn't reach XBuild. Check your internet connection and try again.",l=new Set(["auth/wrong-password","auth/invalid-credential","auth/invalid-login-credentials","auth/user-not-found","auth/invalid-email"]),r={"auth/too-many-requests":"Too many sign-in attempts. Please wait a few minutes, then try again or reset your password.","auth/user-disabled":"This account has been disabled. Please contact your company admin.","auth/network-request-failed":s},o=new Set(Object.keys(r)),c=e=>"object"==typeof e&&null!==e?e.code:void 0,d=e=>{var t;return a.A.isAxiosError(e)&&(null==(t=e.response)?void 0:t.status)===422};function u(e){let t=c(e);return"string"==typeof t&&l.has(t)}function m(e){let t=c(e);return d(e)||"string"==typeof t&&o.has(t)}function h(e){return d(e)?"Enter a valid email address.":a.A.isAxiosError(e)&&!e.response&&"ERR_CANCELED"!==e.code?s:(0,i.z)(r,c(e),"Something went wrong signing in. Please try again.")}},57283:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var a=n(37876),i=n(80954);let s={primary:{textColor:"text-white dark:text-zinc-100 dark:hover:text-zinc-200",bgColor:"bg-zinc-900 hover:bg-zinc-800 dark:bg-zinc-900 dark:hover:bg-zinc-950"},secondary:{textColor:"text-zinc-700",bgColor:"bg-zinc-100 hover:bg-zinc-200"}};function l(e){let{id:t,label:n,disabled:l,submitting:r,submittingLabel:o,onClick:c,fullWidth:d,narrow:u,className:m,colorClassName:h,variant:x="primary"}=e,{textColor:f,bgColor:g}=s[x];return(0,a.jsxs)("button",{id:t,type:"button",onClick:c,disabled:l||r,className:(0,i.xW)(l&&!r&&"opacity-10",l&&r&&"bg-zinc-800",d?"w-full rounded-md":"w-auto rounded-full",u?"py-2 text-sm":"py-3 text-base","inline-flex justify-center border border-transparent px-6 sm:text-sm font-medium ".concat(f," shadow-sm ").concat(g," ").concat(h),m),children:[r&&(0,a.jsxs)("svg",{className:"animate-spin -ml-1 mr-3 h-5 w-5 ".concat(f),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,a.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,a.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),r?o||"Submitting...":n]})}},66634:(e,t,n)=>{"use strict";n.d(t,{R:()=>i});var a=n(14232);let i=e=>{let{executer:t,onError:n,onSuccess:i,onFinally:s}=e,[l,r]=(0,a.useState)(!1),[o,c]=(0,a.useState)(null);return[l,(0,a.useCallback)(async function(){for(var e=arguments.length,a=Array(e),l=0;l<e;l++)a[l]=arguments[l];r(!0);try{c(a);let e=await t(...a);null==i||i(e,...a)}catch(e){null==n||n(e,...a)}finally{r(!1),null==s||s()}},[t,i,n,s,r]),o]}},78909:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var a=n(14232);let i=()=>{let[e,t]=(0,a.useState)("");return(0,a.useEffect)(()=>{let e=window.location.protocol,n=window.location.hostname,a=window.location.port;t("".concat(e,"//").concat(n).concat(a?":"+a:""))},[]),e}},79281:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});var a=n(37876),i=n(54587),s=n.n(i),l=n(80954);let r=e=>{let{className:t,children:n}=e;return(0,a.jsxs)("div",{className:(0,l.xW)("flex min-h-screen bg-white",t),children:[(0,a.jsx)("div",{className:"flex flex-1 flex-col justify-center py-12 px-4 sm:px-6 lg:flex-none lg:px-20 xl:px-24",children:(0,a.jsxs)("div",{className:"mx-auto w-full h-full max-w-sm lg:w-96 flex flex-col",children:[(0,a.jsx)("div",{className:"flex hidden",children:(0,a.jsx)(s(),{src:"/logo_transparent.png",alt:"XBuild",height:20,width:78})}),(0,a.jsx)("div",{className:"flex flex-col flex-auto justify-center",children:n}),(0,a.jsx)("div",{className:"flex w-full h-10"})]})}),(0,a.jsx)("div",{className:"relative hidden w-0 flex-1 lg:block",children:(0,a.jsx)("img",{className:"absolute inset-0 h-full w-full object-cover ",src:"https://images.unsplash.com/photo-1518736346281-76873166a64a?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1548&q=80",alt:""})})]})}},86087:(e,t,n)=>{"use strict";n.d(t,{E_:()=>s,e:()=>l,kF:()=>i});var a=n(12188);let i=async function(e){let{timeout:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{data:n}=await a.uE.post("/api/users/account_status",{email:e},t?{timeout:t}:void 0);return n},s=async e=>{let{data:t}=await a.uE.post("/api/users/signup",e);return t},l=async()=>{var e;let{data:t}=await a.uE.get("/api/users/primary_trades");return null!=(e=null==t?void 0:t.trades)?e:[]}},99611:(e,t,n)=>{"use strict";function a(e,t,n){let a="string"==typeof t?t.trim():"";if(!a||!Object.hasOwn(e,a))return n;let i=e[a];return"string"==typeof i&&i?i:n}n.d(t,{z:()=>a})}},e=>{e.O(0,[636,6593,8792],()=>e(e.s=15794)),_N_E=e.O()}]);
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.