1import{u as b,r as c,b3 as v,j as e,B as h,F as S,az as k,S as U}from"./elements-DVh2jUIM.js";import{u as A,x as C,A as R,aa as q,j as m}from"./index-DeQvL4I7.js";import"./grids-DXrfAsUA.js";import"./startOfDay-AazlW55I.js";const E=["/community/requests/upload"];function L(){const{t:r}=b(),N=A(),n=C(),[u]=R(),{setEmail:p,setRedirect:f}=q(),s=m(t=>t.user),y=m(t=>t.isLoggedIn),j=m(t=>t.refreshing),w=m(t=>t.logout),[i,o]=c.useState("loading"),x=u.get("userId"),l=u.get("email"),a=u.get("redirect")||"/dashboard",d=c.useMemo(()=>{const t=decodeURIComponent(a);return E.some(I=>t.startsWith(I))},[a]),g=c.useMemo(()=>`/public?${new URLSearchParams({modal:"login",redirect:a}).toString()}`,[a]);return c.useEffect(()=>{if(j||i!=="loading")return;if(!x||!l||!v(l)){o("error");return}const t=parseInt(x,10);if(!Number.isInteger(t)){o("error");return}if(p(l),f(a),!d&&!y&&!s){o("complete"),n(g);return}if(d||(s==null?void 0:s.userId)===t&&(s==null?void 0:s.email)===l){o("complete"),n(a);return}o("loggedInWithDifferentUser")},[y,j,s,l,a,n,p,i,f,x,g,d]),i==="loggedInWithDifferentUser"?e.jsx("div",{className:"w-full h-full bg-zinc-100",children:e.jsxs("div",{className:"max-w-2xl mx-auto py-16 px-4 sm:py-24 sm:px-6 lg:px-8 text-center flex flex-col space-y-4",children:[e.jsxs("h2",{className:"text-2xl text-gray-500 pt-40",children:[r("auth.login.loggedInDifferentUser"),":"]}),e.jsx("label",{className:"text-red-500",children:s==null?void 0:s.email}),e.jsxs("h3",{className:"text-lg text-gray-500 pt-10",children:[r("auth.login.switchUserInstructions"),":"]}),e.jsx("label",{className:"text-green-800",children:l}),e.jsxs("div",{className:"flex flex-row items-center justify-center space-x-6 pt-6",children:[e.jsx(h,{className:"min-w-[32%] pr-8",onClick:()=>{w({keepAuthFlowState:!0}),N.clear(),n(g)},variant:"primary",startIcon:e.jsx(S,{className:"text-primary-fg",icon:k}),children:r("main.header.links.logOut")}),e.jsx(h,{className:"min-w-[30%]",onClick:()=>n("/dashboard"),variant:"primaryOutline",children:r("auth.login.backToDashboard")})]})]})}):i==="error"?e.jsx("div",{className:"w-full h-full bg-zinc-100",children:e.jsxs("div",{className:"max-w-2xl mx-auto py-16 px-4 sm:py-24 sm:px-6 lg:px-8 text-center flex flex-col space-y-12",children:[e.jsx("h2",{className:"text-2xl text-gray-500 pt-40",children:r("auth.login.somethingWentWrong")}),e.jsx(h,{onClick:()=>n("/public?modal=login"),className:"w-60 m-auto",variant:"primary",children:r("auth.login.backToLogin")})]})}):e.jsx("div",{className:"w-full h-full py-16 flex items-center justify-center",children:e.jsx(U,{})})}export{L as Component};
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.