import{E as r,a as d}from"./console.9b12928f.js";import"./outputWidgets.17392370.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]="a19c96de-4172-4d31-ad4e-679ddfc8cefd",o._sentryDebugIdIdentifier="sentry-dbid-a19c96de-4172-4d31-ad4e-679ddfc8cefd")}catch{}})();class n extends Error{constructor(e,t){super(e),this.status=t}static async fromResponse(e){const t=await e.text();return new n(t,e.status)}}class p{static async get(e){const s=await(await fetch(`${r.cloudApi}/console/${e}`,{headers:{...d.headers}})).text();return s?JSON.parse(s):null}static async post(e,t){const s=await fetch(`${r.cloudApi}/console/${e}`,{method:"POST",headers:{"Content-Type":"application/json",...d.headers},body:JSON.stringify(t)});if(!s.ok)throw await n.fromResponse(s);const a=await s.text();return a?JSON.parse(a):null}static async patch(e,t){const s=await fetch(`${r.cloudApi}/console/${e}`,{method:"PATCH",headers:{"Content-Type":"application/json",...d.headers},body:JSON.stringify(t)});if(!s.ok)throw await n.fromResponse(s);const a=await s.text();return a?JSON.parse(a):null}static async delete(e){const t=await fetch(`${r.cloudApi}/console/${e}`,{method:"DELETE",headers:{"Content-Type":"application/json",...d.headers}});if(!t.ok)throw await n.fromResponse(t)}}export{p as C};
//# sourceMappingURL=gateway.ee06b706.js.map
