import{r as e}from"./rolldown-runtime-DCMCV6zW.js";import{Y as t,st as n}from"./vendor-primevue-7po8Zk9v.js";import{$ as r,A as i,Bt as a,D as o,E as s,Et as c,F as l,Ft as u,K as d,L as f,O as p,P as m,ht as h,o as g,rt as _,tt as v,x as y}from"./vendor-vue-core-D3IvUUeM.js";import"./vendor-other-CrvBxfcV.js";import"./types-0oh-UGWL.js";import"./remoteConfig-CNDr9CtS.js";import{s as b}from"./vendor-vueuse-ChSVzIZz.js";import"./api-3C7_IVZO.js";import"./colorUtil-C83P1Arv.js";import"./i18n-DjEVEIh2.js";import{n as x,t as S}from"./useErrorHandling-CBX3YQ5l.js";import"./vendor-reka-ui-Bm3o_ZTf.js";import{t as C}from"./Button-mG8zDgxj.js";import{n as w,t as T}from"./auth-CwHXDOkG.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=f({__name:`CloudLoginViewSkeleton`,setup(e){return(e,t)=>(r(),i(`div`,E,[o(`div`,D,[o(`div`,O,[l(u(n),{width:`60%`,height:`1.125rem`,class:`mb-2`}),l(u(n),{width:`90%`,height:`1rem`,class:`mb-2`}),l(u(n),{width:`80%`,height:`1rem`})]),o(`div`,k,[l(u(n),{width:`45%`,height:`1.5rem`,class:`my-0`}),o(`div`,A,[l(u(n),{width:`25%`,height:`1rem`,class:`mr-1`}),l(u(n),{width:`20%`,height:`1rem`})])]),o(`div`,j,[l(u(n),{width:`20%`,height:`1rem`,class:`mb-2`}),l(u(n),{width:`100%`,height:`2.5rem`,class:`mb-4`}),l(u(n),{width:`25%`,height:`1rem`,class:`mb-4`}),l(u(n),{width:`100%`,height:`2.5rem`,class:`mb-6`}),l(u(n),{width:`80%`,height:`1rem`,class:`mb-4`}),l(u(n),{width:`100%`,height:`2.5rem`})]),o(`div`,M,[t[0]||=o(`div`,{class:`flex-1 border-t border-gray-300`},null,-1),l(u(n),{width:`30%`,height:`1rem`,class:`mx-4`}),t[1]||=o(`div`,{class:`flex-1 border-t border-gray-300`},null,-1)]),o(`div`,N,[l(u(n),{width:`100%`,height:`2.5rem`}),l(u(n),{width:`100%`,height:`2.5rem`})]),o(`div`,P,[l(u(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=f({__name:`CloudSurveyViewSkeleton`,setup(e){return(e,t)=>(r(),i(`div`,null,[o(`div`,I,[l(u(n),{width:`100%`,height:`0.5rem`,class:`mb-8`}),o(`div`,L,[o(`div`,R,[o(`div`,null,[l(u(n),{width:`70%`,height:`1.75rem`,class:`mb-8`}),o(`div`,z,[(r(),i(y,null,v(5,e=>o(`div`,{key:e,class:`flex items-center gap-3`},[l(u(n),{width:`1.25rem`,height:`1.25rem`,shape:`circle`}),l(u(n),{width:`85%`,height:`0.875rem`})])),64))])]),o(`div`,B,[t[0]||=o(`span`,null,null,-1),l(u(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=f({__name:`UserCheckView`,setup(e){let n=g(),{wrapWithErrorHandlingAsync:f}=S(),{flags:v}=x(),y=s(()=>v.onboardingSurveyEnabled??!0),E=c(`loading`),{isLoading:D,error:O,execute:k}=b(f(async()=>{if(await d(),!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=s(()=>{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=s(()=>D.value&&!!O.value),handleRetry=async()=>{await k()};return(e,n)=>{let s=_(`CloudWaitlistViewSkeleton`);return E.value===`login`?(r(),p(F,{key:0})):E.value===`survey`?(r(),p(V,{key:1})):E.value===`waitlist`?(r(),p(s,{key:2})):u(O)?(r(),i(`div`,H,[o(`div`,U,[o(`p`,W,a(A.value),1),l(C,{loading:j.value,class:`w-full`,onClick:handleRetry},{default:h(()=>[m(a(j.value?e.$t(`cloudOnboarding.retrying`):e.$t(`cloudOnboarding.retry`)),1)]),_:1},8,[`loading`])])])):(r(),i(`div`,G,[l(u(t),{class:`h-8 w-8`})]))}}});export{K as default};
//# sourceMappingURL=UserCheckView-BW4v9KoA.js.map