import{i as e,n as t}from"./rolldown-runtime-BKYq3fBv.js";import{Cr as n,Dr as ee,Gn as r,Gt as i,Kt as te,Nn as a,Qn as o,Rr as s,Tr as c,Xn as l,Xr as ne,Zn as u,ai as d,ar as f,er as p,gn as m,gr as h,hn as g,ir as _,sr as v,ui as y}from"./vendor-primevue-D50rA9nL.js";import{fn as b,hn as re,ln as ie,sn as x}from"./vendor-other-BnH5nyVX.js";import{i as ae,n as oe,r as se,t as ce}from"./useErrorHandling-Dt_X40fr.js";import{n as le,t as S}from"./Button-DzMg17Os.js";import{n as C,r as w,t as T}from"./auth-BpHxDBwh.js";var E,D,O,k,A,j,M,N,P,F,I=t((()=>{a(),g(),E={class:`flex h-full items-center justify-center p-8`},D={class:`max-w-[100vw] lg:w-96`},O={class:`rounded-lg bg-[#2d2e32] p-4`},k={class:`mt-6 mb-8 flex flex-col gap-4`},A={class:`flex items-center`},j={class:`mb-8`},M={class:`my-8 flex items-center`},N={class:`flex flex-col gap-6`},P={class:`mt-5`},F=v({__name:`CloudLoginViewSkeleton`,setup(e){return(e,t)=>(n(),p(`div`,E,[u(`div`,D,[u(`div`,O,[f(d(m),{width:`60%`,height:`1.125rem`,class:`mb-2`}),f(d(m),{width:`90%`,height:`1rem`,class:`mb-2`}),f(d(m),{width:`80%`,height:`1rem`})]),u(`div`,k,[f(d(m),{width:`45%`,height:`1.5rem`,class:`my-0`}),u(`div`,A,[f(d(m),{width:`25%`,height:`1rem`,class:`mr-1`}),f(d(m),{width:`20%`,height:`1rem`})])]),u(`div`,j,[f(d(m),{width:`20%`,height:`1rem`,class:`mb-2`}),f(d(m),{width:`100%`,height:`2.5rem`,class:`mb-4`}),f(d(m),{width:`25%`,height:`1rem`,class:`mb-4`}),f(d(m),{width:`100%`,height:`2.5rem`,class:`mb-6`}),f(d(m),{width:`80%`,height:`1rem`,class:`mb-4`}),f(d(m),{width:`100%`,height:`2.5rem`})]),u(`div`,M,[t[0]||=u(`div`,{class:`flex-1 border-t border-gray-300`},null,-1),f(d(m),{width:`30%`,height:`1rem`,class:`mx-4`}),t[1]||=u(`div`,{class:`flex-1 border-t border-gray-300`},null,-1)]),u(`div`,N,[f(d(m),{width:`100%`,height:`2.5rem`}),f(d(m),{width:`100%`,height:`2.5rem`})]),u(`div`,P,[f(d(m),{width:`70%`,height:`0.875rem`})])])]))}})})),L,R=t((()=>{I(),I(),L=F})),z,B,V,H,U,W,G=t((()=>{a(),g(),z={class:`flex min-h-[638px] min-w-[320px] flex-col`},B={class:`flex flex-1 flex-col p-0`},V={class:`flex min-h-full flex-1 flex-col justify-between`},H={class:`flex flex-col gap-6`},U={class:`flex justify-between pt-4`},W=v({__name:`CloudSurveyViewSkeleton`,setup(e){return(e,t)=>(n(),p(`div`,null,[u(`div`,z,[f(d(m),{width:`100%`,height:`0.5rem`,class:`mb-8`}),u(`div`,B,[u(`div`,V,[u(`div`,null,[f(d(m),{width:`70%`,height:`1.75rem`,class:`mb-8`}),u(`div`,H,[(n(),p(r,null,c(5,e=>u(`div`,{key:e,class:`flex items-center gap-3`},[f(d(m),{width:`1.25rem`,height:`1.25rem`,shape:`circle`}),f(d(m),{width:`85%`,height:`0.875rem`})])),64))])]),u(`div`,U,[t[0]||=u(`span`,null,null,-1),f(d(m),{width:`100%`,height:`2.5rem`})])])])])]))}})})),K,ue=t((()=>{G(),G(),K=W})),q,J,Y,X,Z,Q=t((()=>{a(),b(),i(),x(),le(),ce(),se(),w(),R(),ue(),q={key:3,class:`flex h-full items-center justify-center p-8`},J={class:`max-w-[100vw] p-2 text-center lg:w-96`},Y={class:`mb-4 text-red-500`},X={key:4,class:`flex items-center justify-center`},Z=v({__name:`UserCheckView`,setup(e){let t=ie(),{wrapWithErrorHandlingAsync:r}=oe(),{flags:i}=ae(),a=l(()=>i.onboardingSurveyEnabled??!0),c=ne(`loading`),{isLoading:m,error:g,execute:v}=re(r(async()=>{if(await h(),!a.value){await t.replace({path:`/`});return}let[e,n]=await Promise.all([C(),T()]);if(!e){c.value=`login`,await t.replace({name:`cloud-login`});return}if(!n){c.value=`survey`,await t.replace({name:`cloud-survey`});return}globalThis.location.href=`/`}),null,{resetOnExecute:!1}),b=l(()=>{if(!g.value)return``;let e=g.value.toString().toLowerCase();return e.includes(`network`)||e.includes(`fetch`)?`Connection problem. Please check your internet connection.`:e.includes(`timeout`)?`Request timed out. Please try again.`:`Unable to check account status. Please try again.`}),x=l(()=>m.value&&!!g.value),handleRetry=async()=>{await v()};return(e,t)=>{let r=ee(`CloudWaitlistViewSkeleton`);return c.value===`login`?(n(),o(L,{key:0})):c.value===`survey`?(n(),o(K,{key:1})):c.value===`waitlist`?(n(),o(r,{key:2})):d(g)?(n(),p(`div`,q,[u(`div`,J,[u(`p`,Y,y(b.value),1),f(S,{loading:x.value,class:`w-full`,onClick:handleRetry},{default:s(()=>[_(y(x.value?e.$t(`cloudOnboarding.retrying`):e.$t(`cloudOnboarding.retry`)),1)]),_:1},8,[`loading`])])])):(n(),p(`div`,X,[f(d(te),{class:`h-8 w-8`})]))}}})})),$;t((()=>{Q(),Q(),$=Z}))();export{$ as default};
//# sourceMappingURL=UserCheckView-DrDhVIAz.js.map