import{r as e}from"./rolldown-runtime-DCMCV6zW.js";import{Y as t,ct as n}from"./vendor-primevue-DxVRNMbC.js";import{D as r,Dt as i,F as a,I as o,It as s,O as c,R as l,S as u,Vt as d,et as f,gt as p,it as m,j as h,k as g,nt as _,o as v,q as y}from"./vendor-vue-core-X6q-rGJs.js";import"./vendor-other-CyG3qq8S.js";import{n as b}from"./useFeatureFlags-CxRWjdi1.js";import{s as x}from"./vendor-vueuse-B_IQhD9R.js";import"./api-DQLKc1Xa.js";import"./vendor-markdown-Cola12Wc.js";import"./colorUtil-Cth7eqhK.js";import"./i18n-DjV_9lZM.js";import"./vendor-reka-ui-CHPbCe4i.js";import{t as S}from"./Button-C7dWyQyS.js";import{t as C}from"./useErrorHandling-BFB8eSj5.js";import{n as w,t as T}from"./auth-C8aVxlew.js";var 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=l({__name:`CloudLoginViewSkeleton`,setup(e){return(e,t)=>(f(),h(`div`,E,[c(`div`,D,[c(`div`,O,[o(s(n),{width:`60%`,height:`1.125rem`,class:`mb-2`}),o(s(n),{width:`90%`,height:`1rem`,class:`mb-2`}),o(s(n),{width:`80%`,height:`1rem`})]),c(`div`,k,[o(s(n),{width:`45%`,height:`1.5rem`,class:`my-0`}),c(`div`,A,[o(s(n),{width:`25%`,height:`1rem`,class:`mr-1`}),o(s(n),{width:`20%`,height:`1rem`})])]),c(`div`,j,[o(s(n),{width:`20%`,height:`1rem`,class:`mb-2`}),o(s(n),{width:`100%`,height:`2.5rem`,class:`mb-4`}),o(s(n),{width:`25%`,height:`1rem`,class:`mb-4`}),o(s(n),{width:`100%`,height:`2.5rem`,class:`mb-6`}),o(s(n),{width:`80%`,height:`1rem`,class:`mb-4`}),o(s(n),{width:`100%`,height:`2.5rem`})]),c(`div`,M,[t[0]||=c(`div`,{class:`flex-1 border-t border-gray-300`},null,-1),o(s(n),{width:`30%`,height:`1rem`,class:`mx-4`}),t[1]||=c(`div`,{class:`flex-1 border-t border-gray-300`},null,-1)]),c(`div`,N,[o(s(n),{width:`100%`,height:`2.5rem`}),o(s(n),{width:`100%`,height:`2.5rem`})]),c(`div`,P,[o(s(n),{width:`70%`,height:`0.875rem`})])])]))}}),I={class:`flex min-h-[638px] min-w-[320px] flex-col`},L={class:`flex flex-1 flex-col p-0`},R={class:`flex min-h-full flex-1 flex-col justify-between`},z={class:`flex flex-col gap-6`},B={class:`flex justify-between pt-4`},V=l({__name:`CloudSurveyViewSkeleton`,setup(e){return(e,t)=>(f(),h(`div`,null,[c(`div`,I,[o(s(n),{width:`100%`,height:`0.5rem`,class:`mb-8`}),c(`div`,L,[c(`div`,R,[c(`div`,null,[o(s(n),{width:`70%`,height:`1.75rem`,class:`mb-8`}),c(`div`,z,[(f(),h(u,null,_(5,e=>c(`div`,{key:e,class:`flex items-center gap-3`},[o(s(n),{width:`1.25rem`,height:`1.25rem`,shape:`circle`}),o(s(n),{width:`85%`,height:`0.875rem`})])),64))])]),c(`div`,B,[t[0]||=c(`span`,null,null,-1),o(s(n),{width:`100%`,height:`2.5rem`})])])])])]))}}),H={key:3,class:`flex h-full items-center justify-center p-8`},U={class:`max-w-[100vw] p-2 text-center lg:w-96`},W={class:`mb-4 text-red-500`},G={key:4,class:`flex items-center justify-center`},K=l({__name:`UserCheckView`,setup(e){let n=v(),{wrapWithErrorHandlingAsync:l}=C(),{flags:u}=b(),_=r(()=>u.onboardingSurveyEnabled??!0),E=i(`loading`),{isLoading:D,error:O,execute:k}=x(l(async()=>{if(await y(),!_.value){await n.replace({path:`/`});return}let[e,t]=await Promise.all([w(),T()]);if(!e){E.value=`login`,await n.replace({name:`cloud-login`});return}if(!t){E.value=`survey`,await n.replace({name:`cloud-survey`});return}globalThis.location.href=`/`}),null,{resetOnExecute:!1}),A=r(()=>{if(!O.value)return``;let e=O.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.`}),j=r(()=>D.value&&!!O.value),handleRetry=async()=>{await k()};return(e,n)=>{let r=m(`CloudWaitlistViewSkeleton`);return E.value===`login`?(f(),g(F,{key:0})):E.value===`survey`?(f(),g(V,{key:1})):E.value===`waitlist`?(f(),g(r,{key:2})):s(O)?(f(),h(`div`,H,[c(`div`,U,[c(`p`,W,d(A.value),1),o(S,{loading:j.value,class:`w-full`,onClick:handleRetry},{default:p(()=>[a(d(j.value?e.$t(`cloudOnboarding.retrying`):e.$t(`cloudOnboarding.retry`)),1)]),_:1},8,[`loading`])])])):(f(),h(`div`,G,[o(s(t),{class:`h-8 w-8`})]))}}});export{K as default};
//# sourceMappingURL=UserCheckView-D9znGty7.js.map