var d=Object.defineProperty;var c=(a,t,e)=>t in a?d(a,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[t]=e;var i=(a,t,e)=>(c(a,typeof t!="symbol"?t+"":t,e),e);import{h as s}from"./router.09c25b35.js";import"./jwt-decode.esm.95147216.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="4302fd4f-fae9-4fe9-a7d0-ebff71ea8482",a._sentryDebugIdIdentifier="sentry-dbid-4302fd4f-fae9-4fe9-a7d0-ebff71ea8482")}catch{}})();class l{constructor(){i(this,"urlPath","organizations")}async create(t){return s.post(`${this.urlPath}`,t)}async delete(t){await s.delete(`${this.urlPath}/${t}`)}async rename(t,e){await s.patch(`${this.urlPath}/${t}`,{name:e})}async list(){return s.get(`${this.urlPath}`)}async get(t){return s.get(`${this.urlPath}/${t}`)}async getUsageReportUrl(t){return s.get(`${this.urlPath}/${t}/usage-report`)}}const r=new l;class n{constructor(t){this.dto=t}static async list(){return(await r.list()).map(e=>new n(e))}static async create(t){const e=await r.create({name:t});return new n(e)}static async get(t){const e=await r.get(t);return new n(e)}static async rename(t,e){return r.rename(t,e)}get id(){return this.dto.id}get name(){return this.dto.name}get featureFlags(){return this.dto.featureFlags}get billingMetadata(){return this.dto.billingMetadata}get coalescedPlan(){var t;return(t=this.billingMetadata.plan)!=null?t:"No active plan"}get hasUsageReport(){return["Business","Abstra"].includes(this.coalescedPlan)}async getUsageReportUrl(){return r.getUsageReportUrl(this.id)}}export{l as O,n as a};
//# sourceMappingURL=organization.21f2f03d.js.map
