import{a as _}from"./asyncComputed.29b8437b.js";import{d as b,ea as w,X as h,u as e,o as n,c as d,Y as k,b as o,w as t,S as C,dd as g,aG as l,e9 as I,bT as x,dh as c,a as N}from"./index.494ee3d6.js";import"./gateway.833b1a3f.js";import{a as v}from"./organization.c4f91415.js";import"./tables.dfb44168.js";import{C as m}from"./router.cf865cb1.js";import{L as z}from"./LoadingContainer.15a7d983.js";import{A as B}from"./index.c1c6186c.js";import"./popupNotifcation.a3d22dad.js";import"./record.0afa2e2f.js";import"./string.c25cb15f.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]="70e12589-51b1-4372-96bd-ea923db0509c",a._sentryDebugIdIdentifier="sentry-dbid-70e12589-51b1-4372-96bd-ea923db0509c")}catch{}})();const D={key:1},U=["src"],O=b({__name:"Billing",setup(a){const p=w().params.organizationId,{loading:f,result:r}=_(async()=>{const i=await v.get(p),u=await i.getUsageReportUrl();return{organization:i,reportUrl:u}});h(()=>{location.search.includes("upgrade")&&m.showNewMessage("I want to upgrade my plan")});const y=()=>m.showNewMessage("I want to upgrade my plan");return(i,u)=>e(f)?(n(),d(z,{key:0})):e(r)?(n(),k("div",D,[o(e(c),{justify:"space-between",align:"center"},{default:t(()=>[o(e(g),{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(()=>[N("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(g),{level:4},{default:t(()=>[l("No usage report available")]),_:1})]),_:1}))])):C("",!0)}});export{O as default};
//# sourceMappingURL=Billing.f0d36137.js.map
