import{a as _}from"./asyncComputed.728c1605.js";import{d as w,ec as b,k as h,u as e,a as c,a4 as k,f as o,b as a,h as I,o as n,A as f,g as d,ea as C,bQ as x,db as l,e as N}from"./jwt-decode.esm.4aed0432.js";import{n as g,c as v}from"./router.8e8ef823.js";import{a as z}from"./organization.2a3edd07.js";import"./tables.1494ceeb.js";import{L as B}from"./LoadingContainer.139bc51e.js";import"./record.c1a2f873.js";import"./string.8136e838.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},s=new Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="32751a51-9ece-4af5-a13a-a37c9a33febc",t._sentryDebugIdIdentifier="sentry-dbid-32751a51-9ece-4af5-a13a-a37c9a33febc")}catch{}})();const D={key:1},U=["src"],F=w({__name:"Billing",setup(t){const u=b().params.organizationId,{loading:m,result:r}=_(async()=>{const i=await z.get(u),p=await i.getUsageReportUrl();return{organization:i,reportUrl:p}});h(()=>{location.search.includes("upgrade")&&g.showNewMessage("I want to upgrade my plan")});const y=()=>g.showNewMessage("I want to upgrade my plan");return(i,p)=>e(m)?(n(),c(B,{key:0})):e(r)?(n(),k("div",D,[o(e(l),{justify:"space-between",align:"center"},{default:a(()=>[o(e(f),{level:3},{default:a(()=>[d("Current plan: "+C(e(r).organization.coalescedPlan),1)]),_:1}),o(e(x),{type:"primary",onClick:y},{default:a(()=>[d("Upgrade")]),_:1})]),_:1}),o(e(v),{style:{"margin-top":"0"}}),e(r).organization.hasUsageReport?(n(),c(e(l),{key:0,align:"center",justify:"center"},{default:a(()=>[N("iframe",{src:e(r).reportUrl,frameborder:"0",style:{width:"1000px",height:"1700px"}},null,8,U)]),_:1})):(n(),c(e(l),{key:1,align:"center",justify:"center"},{default:a(()=>[o(e(f),{level:4},{default:a(()=>[d("No usage report available")]),_:1})]),_:1}))])):I("",!0)}});export{F as default};
//# sourceMappingURL=Billing.77f1f137.js.map
