import{t as d,p as n}from"./passwordlessManager.90d3a316.js";import"./registerWidgets.faec4901.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=new Error().stack;e&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[e]="ab7e6425-be2f-4de1-9f32-282de7eb8d70",o._sentryDebugIdIdentifier="sentry-dbid-ab7e6425-be2f-4de1-9f32-282de7eb8d70")}catch{}})();const i=d("cloud-api");class a extends Error{constructor(e,t){super(e),this.status=t}static async fromResponse(e){const t=await e.text();return new a(t,e.status)}}class u{static async get(e){const s=await(await fetch(`${i}/console/${e}`,{headers:{...n.getUserHeaders("Author-Authorization")}})).text();return s?JSON.parse(s):null}static async post(e,t){const s=await fetch(`${i}/console/${e}`,{method:"POST",headers:{"Content-Type":"application/json",...n.getUserHeaders("Author-Authorization")},body:JSON.stringify(t)});if(!s.ok)throw await a.fromResponse(s);const r=await s.text();return r?JSON.parse(r):null}static async patch(e,t){const s=await fetch(`${i}/console/${e}`,{method:"PATCH",headers:{"Content-Type":"application/json",...n.getUserHeaders("Author-Authorization")},body:JSON.stringify(t)});if(!s.ok)throw await a.fromResponse(s);const r=await s.text();return r?JSON.parse(r):null}static async delete(e){const t=await fetch(`${i}/console/${e}`,{method:"DELETE",headers:{"Content-Type":"application/json",...n.getUserHeaders("Author-Authorization")}});if(!t.ok)throw await a.fromResponse(t)}}export{u as C};
//# sourceMappingURL=gateway.241cb512.js.map
