1 2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="bd8086a8-d6a0-584a-a24b-92bfd63b9514")}catch(e){}}(); 3import{B as e,G as t,M as n,t as r}from"./jsx-runtime-BBg2aEpo.js";import{t as i}from"./useMutation-DUEOH82E.js";import{n as a,t as o}from"./esm-unFe2RCL.js";import{m as s,s as c}from"./api.client-CgWk5DJA.js";import{t as l}from"./axios-eytGeEhX.js";import{n as u}from"./react-Bdet2sty.js";import{t as d}from"./button-BQe8pNfq.js";import{t as f}from"./useAuth-BZkq1-Uh.js";import{u as p}from"./api-Cywjy4kX.js";import{t as m}from"./input-DWqBBtK1.js";import{a as h,n as g,o as _,r as v,t as y}from"./dialog-cn_5ATpW.js";import{o as b,r as x}from"./resolvers-DLzEFzWo.js";import{Rn as S,Tn as C,wr as w}from"./schemas-2qQHvS9w.js";import{t as T}from"./onFormError-CRl2EYGm.js";var E=t(e(),1),D=r(),O=({afterSuccess:e,onError:t,closeModal:r})=>{let a=u(),o=C({email:S().min(1,a(`Email is required`)),password:S().min(1,a(`Password is required`))}),h=n(),[g,_]=(0,E.useState)(!1),{control:v,handleSubmit:y,formState:O}=b({resolver:w(o),defaultValues:{email:``,password:``}}),{signIn:k,refetchUser:A}=f(),j=i({mutationFn:k,onSuccess:async()=>{let{data:e}=await A(),t=e?.features.isGuest,n=e?.subscriptions?.some(e=>e.subscription.key===`member-b2b`);(e?.subscriptions?.length===0||e?.subscriptions?.every(e=>!e.isActive&&!e.isGrace))&&t||h(n?`/dashboard`:`/member`)}}),M=async n=>{try{_(!0),await j.mutateAsync({data:{email:n.email,password:n.password}}),s.success(a(`Signed in successfully`)),e&&e()}catch(e){if(e instanceof l){let i=e.response?.data;if(i||s.error(a(`An unexpected error occurred. Please try again.`),{position:`top-center`}),i&&i.errors.length>0){let e=i.errors[0];if(s.error(e.message,{position:`top-center`}),e.code===`Application.Auth.PasswordResetRequired`){let e=await p({email:n.email});t&&t(),h(`/password-setup?twoFactorId=${e.twoFactorId}`),r&&r()}}}}finally{_(!1)}},N=()=>{location.replace(`https://${c()?`join`:`staging-join`}.brytelyfe.com/`)},P=t=>{e&&e(),h(t)};return(0,D.jsx)(D.Fragment,{children:(0,D.jsxs)(`form`,{onSubmit:y(M,T),className:`space-y-2`,children:[(0,D.jsx)(x,{control:v,name:`email`,render:({field:{onChange:e,value:t}})=>(0,D.jsx)(m,{label:a(`Email`),type:`email`,placeholder:a(`Enter email address`),value:t,onChange:e,error:O.errors.email}),"data-sentry-element":`Controller`,"data-sentry-source-file":`SignInForm.tsx`}),(0,D.jsx)(x,{control:v,name:`password`,render:({field:{onChange:e,value:t}})=>(0,D.jsx)(m,{label:a(`Password`),type:`password`,placeholder:a(`Enter password`),value:t,onChange:e,error:O.errors.password}),"data-sentry-element":`Controller`,"data-sentry-source-file":`SignInForm.tsx`}),(0,D.jsxs)(`button`,{type:`button`,onClick:()=>P(`/forgot-password`),className:`underline font-medium text-sm float-right relative -top-2`,children:[a(`Forgot Password`),`?`]}),(0,D.jsx)(d,{type:`submit`,className:`w-full mt-8 md:mt-3`,size:`xl`,variant:`primary`,isLoading:g,"data-sentry-element":`Button`,"data-sentry-source-file":`SignInForm.tsx`,children:a(`Sign in`)}),(0,D.jsxs)(`div`,{className:`flex items-center md:py-0`,children:[(0,D.jsx)(`div`,{className:`grow h-px bg-gray-200`}),(0,D.jsx)(`p`,{className:`mx-6 text-gray-700 text-sm font-medium mb-1`,children:a(`or`)}),(0,D.jsx)(`div`,{className:`grow h-px bg-gray-200`})]}),(0,D.jsx)(d,{type:`button`,variant:`outline`,className:`w-full`,size:`xl`,onClick:()=>N(),"data-sentry-element":`Button`,"data-sentry-source-file":`SignInForm.tsx`,children:a(`Sign up`)})]})})},k=o.create(()=>{let e=u(),t=a();return(0,D.jsx)(y,{open:t.visible,onOpenChange:t.hide,children:(0,D.jsxs)(g,{className:`gap-10 md:gap-2 h-full sm:h-auto flex flex-col`,children:[(0,D.jsxs)(h,{className:`mb-3`,children:[(0,D.jsx)(_,{children:e(`Sign in`)}),(0,D.jsx)(v,{className:`sr-only`,children:e(`Enter your sign in credentials`)})]}),(0,D.jsx)(O,{afterSuccess:t.hide,onError:t.hide,closeModal:t.hide})]})})});export{O as n,k as t}; 4//# debugId=bd8086a8-d6a0-584a-a24b-92bfd63b9514
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.