import{a as _}from"./asyncComputed.6b1d4165.js";import{d as b,e4 as w,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.e310aebb.js";import"./gateway.4d0dc75b.js";import{a as N}from"./organization.be0aa541.js";import"./columns.b1346706.js";import{C as g}from"./router.2399bbbf.js";import{L as v}from"./LoadingContainer.3f93bcc6.js";import{A as B}from"./index.f0426301.js";import"./popupNotifcation.fa3e65fc.js";import"./record.d2935dfa.js";import"./string.a01d17aa.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]="9c3670c2-75b2-4750-9882-41646b7e381f",a._sentryDebugIdIdentifier="sentry-dbid-9c3670c2-75b2-4750-9882-41646b7e381f")}catch{}})();const D={key:1},U=["src"],O=b({__name:"Billing",setup(a){const p=w().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.32cd6bb8.js.map
