import{t as c,p as n}from"./passwordlessManager.50ecc1b4.js";import"./registerWidgets.2031932d.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]="583c7b86-8fc9-472f-ba7c-89b76a2d8f14",o._sentryDebugIdIdentifier="sentry-dbid-583c7b86-8fc9-472f-ba7c-89b76a2d8f14")}catch{}})();const i=c("cloud-api");class a extends Error{constructor(t,e){super(t),this.status=e}static async fromResponse(t){const e=await t.text();return new a(e,t.status)}}class p{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 a.fromResponse(s);const r=await s.text();return r?JSON.parse(r):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 a.fromResponse(s);const r=await s.text();return r?JSON.parse(r):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 a.fromResponse(e)}}export{p as C};
//# sourceMappingURL=gateway.5ec242d0.js.map
