import{d as r,b as c,c as i,t as d}from"./registerWidgets.6f5be576.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=new Error().stack;e&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[e]="7e00779a-6f4e-4b4b-abe8-1c93671a8eba",s._sentryDebugIdIdentifier="sentry-dbid-7e00779a-6f4e-4b4b-abe8-1c93671a8eba")}catch{}})();class p{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 n=new p;class o{constructor(e,t){this.projectId=e,this.authorId=t}static async get(){const e=await n.get();return e.logged?new o(e.project_id,e.author_id):null}static async create(e){const t=await n.create(e);if(!t.logged)throw new Error("Failed to login");return new o(t.project_id,t.author_id)}async delete(){return n.delete()}}const _=["href"],u=r({__name:"DocsButton",props:{path:{}},setup(s){return(e,t)=>{var a;return c(),i("a",{class:"docs-button",href:`https://docs.abstra.io/${(a=e.path)!=null?a:""}`,target:"_blank"}," Docs ",8,_)}}});const f=d(u,[["__scopeId","data-v-9fec5678"]]);export{f as D,o as L};
//# sourceMappingURL=DocsButton.2fd09a1b.js.map
