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