import{a as _}from"./asyncComputed.c1514d75.js";import{d as w,e4 as b,J as h,u as e,c as d,K as k,b as o,w as t,F as C,o as n,d6 as f,az as l,eb as I,bM as x,da as c,a as z}from"./index.fd66f361.js";import"./gateway.c8676992.js";import{a as N}from"./organization.21be1843.js";import"./columns.a93ffaa0.js";import{C as g}from"./router.26c95d47.js";import{L as v}from"./LoadingContainer.d5bd0812.js";import{A as B}from"./index.c2006748.js";import"./popupNotifcation.45eb3465.js";import"./record.8d6523fc.js";import"./string.973cdadd.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]="296adf95-39a4-4079-afb8-405992d9f088",a._sentryDebugIdIdentifier="sentry-dbid-296adf95-39a4-4079-afb8-405992d9f088")}catch{}})();const D={key:1},U=["src"],O=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",D,[o(e(c),{justify:"space-between",align:"center"},{default:t(()=>[o(e(f),{level:3},{default:t(()=>[l("Current plan: "+I(e(r).organization.coalescedPlan),1)]),_:1}),o(e(x),{type:"primary",onClick:y},{default:t(()=>[l("Upgrade")]),_:1})]),_:1}),o(e(B),{style:{"margin-top":"0"}}),e(r).organization.hasUsageReport?(n(),d(e(c),{key:0,align:"center",justify:"center"},{default:t(()=>[z("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}))])):C("",!0)}});export{O as default};
//# sourceMappingURL=Billing.d2da86e1.js.map
