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