import{a as w}from"./asyncComputed-_0zTJceu.js";import{a as h,ac as k,D as I,p as c,b as v,g as x,u as e,e as o,j as n,w as t,aj as _,S as d,U as s,ae as u,B,v as p,h as C}from"./jwt-decode.esm-CQm3LY6y.js";import{a as m,A as D}from"./router-iclNQ3sb.js";import{O as z}from"./organization-BmOGzVGx.js";import"./tables-D9fKw_fk.js";import{L as N}from"./LoadingContainer-sWI2CMQh.js";import"./ts.worker-BIIJMa7D.js";import"./record-Dzon-Vi8.js";import"./string-W5Qb0ZHU.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},i=new Error().stack;i&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[i]="28888f3f-5dd9-4e1c-bc71-67e7efcbefca",a._sentryDebugIdIdentifier="sentry-dbid-28888f3f-5dd9-4e1c-bc71-67e7efcbefca")}catch{}})();const U={key:1},j=["src"],T=h({__name:"Billing",setup(a){const f=k().params.organizationId,{loading:y,result:r}=w(async()=>{const l=await z.get(f),g=await l.getUsageReportUrl();return{organization:l,reportUrl:g}});I(()=>{location.search.includes("upgrade")&&m.showNewMessage("I want to upgrade my plan")});const b=()=>m.showNewMessage("I want to upgrade my plan");return(l,g)=>e(y)?(o(),c(N,{key:0})):e(r)?(o(),v("div",U,[n(e(p),{justify:"space-between",align:"center"},{default:t(()=>[n(e(_),{level:3},{default:t(()=>[d(s(e(u).translate("i18n_billing_current_plan"))+" "+s(e(r).organization.coalescedPlan),1)]),_:1}),n(e(B),{type:"primary",onClick:b},{default:t(()=>[d(s(e(u).translate("i18n_billing_upgrade")),1)]),_:1})]),_:1}),n(e(D),{style:{"margin-top":"0"}}),e(r).organization.hasUsageReport?(o(),c(e(p),{key:0,align:"center",justify:"center"},{default:t(()=>[C("iframe",{src:e(r).reportUrl,frameborder:"0",style:{width:"1000px",height:"1700px"}},null,8,j)]),_:1})):(o(),c(e(p),{key:1,align:"center",justify:"center"},{default:t(()=>[n(e(_),{level:4},{default:t(()=>[d(s(e(u).translate("i18n_billing_no_usage_report")),1)]),_:1})]),_:1}))])):x("",!0)}});export{T as default};
//# sourceMappingURL=Billing-Bw__xTJW.js.map
