import{d as r,b as c,c as i,w as d,b0 as p,u,cb as f}from"./registerWidgets.ca57da3e.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=new Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="29ae4367-834b-46a2-9dfa-3baa317fc7e9",a._sentryDebugIdIdentifier="sentry-dbid-29ae4367-834b-46a2-9dfa-3baa317fc7e9")}catch{}})();class l{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 l;class s{constructor(e,t){this.projectId=e,this.authorId=t}static async get(){const e=await n.get();return e.logged?new s(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 s(t.project_id,t.author_id)}async delete(){return n.delete()}}const g=r({__name:"DocsButton",props:{path:{}},setup(a){return(e,t)=>{var o;return c(),i(u(f),{class:"docs-button",href:`https://docs.abstra.io/${(o=e.path)!=null?o:""}`,target:"_blank"},{default:d(()=>[p(" Docs ")]),_:1},8,["href"])}}});export{s as L,g as _};
//# sourceMappingURL=DocsButton.vue_vue_type_script_setup_true_lang.e215c49e.js.map
