import"./registerWidgets.cbdb5b20.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=new Error().stack;e&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[e]="339c23eb-fec4-40aa-b7af-dcf458aa154c",n._sentryDebugIdIdentifier="sentry-dbid-339c23eb-fec4-40aa-b7af-dcf458aa154c")}catch{}})();class o{async get(){return(await fetch("/_editor/api/login")).json()}async create(e){return(await fetch("/_editor/api/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:e})})).json()}async delete(){await fetch("/_editor/api/login",{method:"DELETE"})}}const r=new o;class a{constructor(e,t){this.projectId=e,this.authorId=t}static async get(){const e=await r.get();return e.logged?new a(e.project_id,e.author_id):null}static async create(e){const t=await r.create(e);if(!t.logged)throw new Error("Failed to login");return new a(t.project_id,t.author_id)}async delete(){return r.delete()}}export{a as L};
//# sourceMappingURL=login.02aa36f0.js.map
