import{a as _}from"./asyncComputed-IJY6wgme.js";import{d as w,S as b,X as h,B as d,l as k,p as I,D as e,m as n,g as o,G as t,Y as f,$ as l,V as C,H as x,M as c,q as B}from"./jwt-decode.esm-Dca5fHH5.js";import{a as g,A as D}from"./router-D5wfdag3.js";import{O as N}from"./organization-DepCCxnV.js";import"./tables-BsqTY_wE.js";import{L as v}from"./LoadingContainer-CAp61bup.js";import"./index-Cyx2lZTa.js";import"./record-BZIfMWML.js";import"./string-BYR4BIXr.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},s=new Error().stack;s&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[s]="6fcaafc8-dedb-4c6d-9646-06937062b2f1",a._sentryDebugIdIdentifier="sentry-dbid-6fcaafc8-dedb-4c6d-9646-06937062b2f1")}catch{}})();const z={key:1},U=["src"],T=w({__name:"Billing",setup(a){const p=b().params.organizationId,{loading:m,result:r}=_(async()=>{const i=await N.get(p),u=await i.getUsageReportUrl();return{organization:i,reportUrl:u}});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,u)=>e(m)?(n(),d(v,{key:0})):e(r)?(n(),k("div",z,[o(e(c),{justify:"space-between",align:"center"},{default:t(()=>[o(e(f),{level:3},{default:t(()=>[l("Current plan: "+C(e(r).organization.coalescedPlan),1)]),_:1}),o(e(x),{type:"primary",onClick:y},{default:t(()=>[l("Upgrade")]),_:1})]),_:1}),o(e(D),{style:{"margin-top":"0"}}),e(r).organization.hasUsageReport?(n(),d(e(c),{key:0,align:"center",justify:"center"},{default:t(()=>[B("iframe",{src:e(r).reportUrl,frameborder:"0",style:{width:"1000px",height:"1700px"}},null,8,U)]),_:1})):(n(),d(e(c),{key:1,align:"center",justify:"center"},{default:t(()=>[o(e(f),{level:4},{default:t(()=>[l("No usage report available")]),_:1})]),_:1}))])):I("",!0)}});export{T as default};
//# sourceMappingURL=Billing-DDCCtIXx.js.map
