import{C as a}from"./router-KqhyGitc.js";import"./jwt-decode.esm-C7p7KYmD.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[t]="f9571919-9e23-4cc5-8ad3-71b7a9b644d2",s._sentryDebugIdIdentifier="sentry-dbid-f9571919-9e23-4cc5-8ad3-71b7a9b644d2")}catch{}})();class c{urlPath="organizations";async create(t){return a.post(`${this.urlPath}`,t)}async delete(t){await a.delete(`${this.urlPath}/${t}`)}async rename(t,e){await a.patch(`${this.urlPath}/${t}`,{name:e})}async list(){return a.get(`${this.urlPath}`)}async get(t){return a.get(`${this.urlPath}/${t}`)}async getUsageReportUrl(t){return a.get(`${this.urlPath}/${t}/usage-report`)}async getConsumption(t,e,i,o={}){return a.get(`${this.urlPath}/${t}/consumption`,{month:e.toString(),year:i.toString(),endDate:o.endDate?.toISOString()})}}const n=new c;class r{constructor(t){this.dto=t}static async list(){return(await n.list()).map(e=>new r(e))}static async create(t){const e=await n.create({name:t});return new r(e)}static async get(t){const e=await n.get(t);return new r(e)}static async rename(t,e){return n.rename(t,e)}get id(){return this.dto.id}get name(){return this.dto.name}set name(t){this.dto.name=t}get featureFlags(){return this.dto.featureFlags}get billingMetadata(){return this.dto.billingMetadata}get coalescedPlan(){return this.billingMetadata.plan??"No active plan"}get hasUsageReport(){return["Business","Abstra"].includes(this.coalescedPlan)}async getUsageReportUrl(){return n.getUsageReportUrl(this.id)}static async getConsumption(t,e,i,o={}){return n.getConsumption(t,e,i,o)}}export{r as O,c as a};
//# sourceMappingURL=organization-C1Ar5sAZ.js.map
