import{i as e,n as t}from"./rolldown-runtime-BKYq3fBv.js";import{$n as n,Cr as r,Gt as i,Kt as a,Nn as o,Qn as s,Xn as c,Xr as l,Xt as u,Yt as d,Zn as f,ai as p,br as m,er as h,sr as g,ui as _}from"./vendor-primevue-D50rA9nL.js";import{Xn as v,cn as y,fn as b,ln as x,ot as S,sn as C,st as w}from"./vendor-other-BnH5nyVX.js";import{n as T,t as E}from"./useErrorHandling-Dt_X40fr.js";import{Ao as D,Oo as O,b as k,jo as A,ko as j,x as M}from"./dialogService-Cr3DyAja.js";import{n as N,t as P}from"./subscriptionCheckoutUtil-DCWhQWaM.js";var F,I,L,R,z,B=t((()=>{o(),M(),b(),d(),i(),S(),C(),O(),E(),D(),P(),F={class:`flex h-full w-full items-center justify-center bg-comfy-menu-secondary-bg`},I={class:`flex flex-col items-center gap-4`},L=[`alt`],R={key:0,class:`font-inter text-base font-normal leading-normal text-base-foreground`},z=g({__name:`CloudSubscriptionRedirectView`,setup(e){let{t}=w(),i=y(),o=x(),{reportError:d,accessBillingPortal:g}=j(),{wrapWithErrorHandlingAsync:b}=T(),{isActiveSubscription:S,isInitialized:C}=A(),E=l(null),D=c(()=>E.value?{standard:t(`subscription.tiers.standard.name`),creator:t(`subscription.tiers.creator.name`),pro:t(`subscription.tiers.pro.name`),founder:t(`subscription.tiers.founder.name`)}[E.value]:``),O=b(async()=>{let e=i.query.tier,t=i.query.cycle,n=null,r=`monthly`;if(typeof e==`string`?n=e:Array.isArray(e)&&e[0]&&(n=e[0]),typeof t==`string`?r=t:Array.isArray(t)&&t[0]&&(r=t[0]),!n){await o.push(`/`);return}if(![`standard`,`creator`,`pro`,`founder`].includes(n)){await o.push(`/`);return}let a=n;E.value=a,(!r||![`monthly`,`yearly`].includes(r))&&(r=`monthly`),C.value||await v(C).toBe(!0),S.value?await g(void 0,!1):await N(a,r,!1)},d);return m(()=>{O()}),(e,i)=>(r(),h(`div`,F,[f(`div`,I,[f(`img`,{src:k,alt:p(t)(`g.comfyOrgLogoAlt`),class:`h-16 w-16`},null,8,L),E.value?(r(),h(`p`,R,_(p(t)(`subscription.subscribeTo`,{plan:D.value})),1)):n(``,!0),E.value?(r(),s(p(a),{key:1,class:`h-8 w-8`,"stroke-width":`4`})):n(``,!0),E.value?(r(),s(p(u),{key:2,as:`a`,href:`/`,link:``,label:p(t)(`cloudOnboarding.skipToCloudApp`)},null,8,[`label`])):n(``,!0)])]))}})})),V;t((()=>{B(),B(),V=z}))();export{V as default};
//# sourceMappingURL=CloudSubscriptionRedirectView-CFp7BqJh.js.map