import{i as e,n as t}from"./rolldown-runtime-ConPGZeh.js";import{Er as n,Gn as r,Gt as i,Kt as ee,Lr as te,Nn as a,Qn as o,Sr as s,Xn as c,Yr as l,Zn as u,er as d,gn as f,hn as p,hr as ne,ii as m,ir as h,li as g,or as _,rr as v,wr as y}from"./vendor-primevue-D1-E3-0M.js";import{an as b,cn as x,dn as S,rn as C}from"./vendor-other-CT05lTmi.js";import{i as re,n as ie,r as ae,t as oe}from"./useErrorHandling-DNVxJ2sn.js";import{n as se,t as ce}from"./Button-DXEyozJJ.js";import{n as le,r as w,t as T}from"./auth-OdEwi0LP.js";var E,D,O,k,A,j,M,N,P,F,I=t((()=>{a(),p(),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=_({__name:`CloudLoginViewSkeleton`,setup(e){return(e,t)=>(s(),d(`div`,E,[u(`div`,D,[u(`div`,O,[h(m(f),{width:`60%`,height:`1.125rem`,class:`mb-2`}),h(m(f),{width:`90%`,height:`1rem`,class:`mb-2`}),h(m(f),{width:`80%`,height:`1rem`})]),u(`div`,k,[h(m(f),{width:`45%`,height:`1.5rem`,class:`my-0`}),u(`div`,A,[h(m(f),{width:`25%`,height:`1rem`,class:`mr-1`}),h(m(f),{width:`20%`,height:`1rem`})])]),u(`div`,j,[h(m(f),{width:`20%`,height:`1rem`,class:`mb-2`}),h(m(f),{width:`100%`,height:`2.5rem`,class:`mb-4`}),h(m(f),{width:`25%`,height:`1rem`,class:`mb-4`}),h(m(f),{width:`100%`,height:`2.5rem`,class:`mb-6`}),h(m(f),{width:`80%`,height:`1rem`,class:`mb-4`}),h(m(f),{width:`100%`,height:`2.5rem`})]),u(`div`,M,[t[0]||=u(`div`,{class:`flex-1 border-t border-gray-300`},null,-1),h(m(f),{width:`30%`,height:`1rem`,class:`mx-4`}),t[1]||=u(`div`,{class:`flex-1 border-t border-gray-300`},null,-1)]),u(`div`,N,[h(m(f),{width:`100%`,height:`2.5rem`}),h(m(f),{width:`100%`,height:`2.5rem`})]),u(`div`,P,[h(m(f),{width:`70%`,height:`0.875rem`})])])]))}})})),L,R=t((()=>{I(),I(),L=F})),z,B,V,H,U,W,G=t((()=>{a(),p(),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=_({__name:`CloudSurveyViewSkeleton`,setup(e){return(e,t)=>(s(),d(`div`,null,[u(`div`,z,[h(m(f),{width:`100%`,height:`0.5rem`,class:`mb-8`}),u(`div`,B,[u(`div`,V,[u(`div`,null,[h(m(f),{width:`70%`,height:`1.75rem`,class:`mb-8`}),u(`div`,H,[(s(),d(r,null,y(5,e=>u(`div`,{key:e,class:`flex items-center gap-3`},[h(m(f),{width:`1.25rem`,height:`1.25rem`,shape:`circle`}),h(m(f),{width:`85%`,height:`0.875rem`})])),64))])]),u(`div`,U,[t[0]||=u(`span`,null,null,-1),h(m(f),{width:`100%`,height:`2.5rem`})])])])])]))}})})),K,ue=t((()=>{G(),G(),K=W})),q,J,Y,X,Z,Q=t((()=>{a(),x(),i(),C(),se(),oe(),ae(),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=_({__name:`UserCheckView`,setup(e){let t=b(),{wrapWithErrorHandlingAsync:r}=ie(),{flags:i}=re(),a=c(()=>i.onboardingSurveyEnabled??!0),f=l(`loading`),{isLoading:p,error:_,execute:y}=S(r(async()=>{if(await ne(),!a.value){await t.replace({path:`/`});return}let[e,n]=await Promise.all([le(),T()]);if(!e){f.value=`login`,await t.replace({name:`cloud-login`});return}if(!n){f.value=`survey`,await t.replace({name:`cloud-survey`});return}globalThis.location.href=`/`}),null,{resetOnExecute:!1}),x=c(()=>{if(!_.value)return``;let e=_.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.`}),C=c(()=>p.value&&!!_.value),handleRetry=async()=>{await y()};return(e,t)=>{let r=n(`CloudWaitlistViewSkeleton`);return f.value===`login`?(s(),o(L,{key:0})):f.value===`survey`?(s(),o(K,{key:1})):f.value===`waitlist`?(s(),o(r,{key:2})):m(_)?(s(),d(`div`,q,[u(`div`,J,[u(`p`,Y,g(x.value),1),h(ce,{loading:C.value,class:`w-full`,onClick:handleRetry},{default:te(()=>[v(g(C.value?e.$t(`cloudOnboarding.retrying`):e.$t(`cloudOnboarding.retry`)),1)]),_:1},8,[`loading`])])])):(s(),d(`div`,X,[h(m(ee),{class:`h-8 w-8`})]))}}})})),$;t((()=>{Q(),Q(),$=Z}))();export{$ as default};
//# sourceMappingURL=UserCheckView-BszJY2RQ.js.map