1import{b as h,a6 as x,a4 as v,x as _,f as y,I as g,i as d,j as a,z as p,m as e,O as w,k,t as $,w as S,n as C,o as m,l as H}from"./DER69Mp3.js";import{u as N}from"./Co6joPRO.js";import"./DuGk2X12.js";import"./Bl6rneV8.js";import"./B623BiJ6.js";import"./D6f3uHta.js";const A={class:"dark min-h-screen flex items-center justify-center bg-[#0a0a0f] text-gray-100 relative overflow-hidden"},T={class:"absolute inset-0 opacity-20 pointer-events-none"},z={class:"relative z-10 max-w-md w-full mx-auto px-4 text-center"},M={key:0},V={key:1,class:"backdrop-blur-xl bg-gray-900/40 border border-red-500/30 rounded-3xl p-8"},B={class:"text-red-400"},F=h({__name:"portal",setup(I){const{appId:l,theme:o,platform:b}=N(),c=x(),f=v(),u=_(!1),n=_("");return y({title:`Manage Subscription - ${b.value} Translator`,meta:[{name:"robots",content:"noindex"}]}),g(async()=>{var i;if(await c.ensureInitialized(),!c.isAuthenticated.value){await f.push(`/translator/extension/auth?redirect=/translator/extension/portal?app=${l.value}`);return}const r=c.getAppAccess(l.value).value;if(!((r==null?void 0:r.has_active_access)&&["subscription","trialing","lifetime"].includes(r.access_type||""))){n.value=`No active ${b.value} Translator subscription found. Subscribe to access the billing portal.`;return}try{u.value=!0;const{url:t}=await $fetch("/api/stripe/customer-portal-auth",{method:"POST",body:{return_url:`${window.location.origin}/translator/dashboard?source=portal`}});if(t)window.location.href=t;else throw new Error("No portal URL returned")}catch(t){u.value=!1,n.value=((i=t==null?void 0:t.data)==null?void 0:i.statusMessage)||(t==null?void 0:t.message)||"Failed to open customer portal"}}),(r,s)=>{const i=C;return m(),d("div",A,[a("div",T,[a("div",{class:"absolute -top-40 -right-40 w-96 h-96 rounded-full blur-3xl",style:p({backgroundColor:`${e(o).primaryHex}55`})},null,4)]),a("div",z,[e(u)?(m(),d("div",M,[a("div",{class:"inline-block animate-spin rounded-full h-12 w-12 border-4 border-t-transparent",style:p({borderColor:`${e(o).primaryHex} transparent ${e(o).primaryHex} ${e(o).primaryHex}`})},null,4),s[0]||(s[0]=a("p",{class:"mt-4 text-lg font-bold"},"Opening Stripe customer portal...",-1))])):e(n)?(m(),d("div",V,[a("p",B,$(e(n)),1),k(i,{to:`/translator/billing?app=${e(l)}`,class:"mt-6 inline-block px-6 py-3 rounded-lg text-white font-semibold transition-opacity hover:opacity-90",style:p({backgroundColor:e(o).primaryHex})},{default:S(()=>s[1]||(s[1]=[H(" Go to billing ")])),_:1,__:[1]}
1,8,["to","style"])])):w("",!0)])])}}});export{F as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.