var c=Object.defineProperty;var i=(n,e,t)=>e in n?c(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var r=(n,e,t)=>(i(n,typeof e!="symbol"?e+"":e,t),t);import{a as d}from"./asyncComputed.a619212b.js";import"./outputWidgets.be3472c2.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]="356e928f-d565-49bc-b39f-f8f82c004c3c",n._sentryDebugIdIdentifier="sentry-dbid-356e928f-d565-49bc-b39f-f8f82c004c3c")}catch{}})();const a=class{async refreshIfChanged(e){var t,s;e.logged!==((s=(t=this.asyncComputed.result.value)==null?void 0:t.logged)!=null?s:!1)&&await this.asyncComputed.refetch()}async get(){return await(await fetch("/_editor/api/login")).json()}async create(e){const s=await(await fetch("/_editor/api/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:e})})).json();return await this.refreshIfChanged(s),s}async delete(){await fetch("/_editor/api/login",{method:"DELETE"}),this.asyncComputed.refetch()}async getProjectInfo(){return(await fetch("/_editor/api/login/info")).json()}get asyncComputed(){return a._asyncComputed===null&&(a._asyncComputed=d(()=>f.get())),a._asyncComputed}get loginUrl(){return"https://cloud.abstra.io/api-key?"+new URLSearchParams({redirect:location.href})}};let o=a;r(o,"_asyncComputed",null);const f=new o;export{f as l};
//# sourceMappingURL=login.57a02e8f.js.map
