import{a as w}from"./asyncComputed-D5HqUDwR.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 a,aj as _,S as d,U as s,af as u,B,v as p,h as C}from"./jwt-decode.esm-DyyavT6h.js";import{a as m,A as D}from"./router-BhKBgDIv.js";import{O as z}from"./organization-74sGTG_j.js";import"./tables-sMYALme4.js";import{L as N}from"./LoadingContainer-BRwcRXny.js";import"./ts.worker-Do44s_XH.js";import"./record-Dva_8M1P.js";import"./string-C33uYcCb.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},i=new Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="b370cc83-b9e5-4cea-b5e1-0c2cad06aa47",t._sentryDebugIdIdentifier="sentry-dbid-b370cc83-b9e5-4cea-b5e1-0c2cad06aa47")}catch{}})();const U={key:1},j=["src"],T=h({__name:"Billing",setup(t){const g=k().params.organizationId,{loading:y,result:r}=w(async()=>{const l=await z.get(g),f=await l.getUsageReportUrl();return{organization:l,reportUrl:f}});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,f)=>e(y)?(o(),c(N,{key:0})):e(r)?(o(),v("div",U,[n(e(p),{justify:"space-between",align:"center"},{default:a(()=>[n(e(_),{level:3},{default:a(()=>[d(s(e(u).translate("i18n_billing_current_plan"))+" "+s(e(r).organization.coalescedPlan),1)]),_:1}),n(e(B),{type:"primary",onClick:b},{default:a(()=>[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:a(()=>[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:a(()=>[n(e(_),{level:4},{default:a(()=>[d(s(e(u).translate("i18n_billing_no_usage_report")),1)]),_:1})]),_:1}))])):x("",!0)}});export{T as default};
//# sourceMappingURL=Billing-q5F2yxvz.js.map
