var w=Object.defineProperty;var f=Object.getOwnPropertySymbols;var x=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable;var h=(o,t,e)=>t in o?w(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,u=(o,t)=>{for(var e in t||(t={}))x.call(t,e)&&h(o,e,t[e]);if(f)for(var e of f(t))A.call(t,e)&&h(o,e,t[e]);return o};var p=(o,t,e)=>new Promise((c,s)=>{var n=r=>{try{i(e.next(r))}catch(a){s(a)}},m=r=>{try{i(e.throw(r))}catch(a){s(a)}},i=r=>r.done?c(r.value):Promise.resolve(r.value).then(n,m);i((e=e.apply(o,t)).next())});import"./element-plus-MdtkBKvq.js";import"./vxe-mp8c2cud.js";import{b as E,aC as v,a5 as y,aD as B,aE as I,O as U}from"./Editor-BuEQalqM-DucWgUTD.js";import{useRoute as $}from"./vue-router-BfFk43nw.js";import{d as C,az as b,c as g,o as k,L as q,P as L,u as _}from"./vue-CEtC17Vu.js";import{_ as O}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./lodash-es-BaeSyToa.js";import"./@vueuse-DmJSJ3Sc.js";import"./@element-plus-icons-vue-CtYczY4K.js";import"./shared-CiMZBXIr.js";import"./dayjs-C1e0w4cr.js";import"./monaco-editor-xcHgnT1C.js";import"./html2canvas-DNSjNh3_.js";import"./mockjs-B1eBEK5l.js";import"./marked-BQZxLJfc.js";const R={class:"loading"},S=C({__name:"Auth",props:{remote:{},access:{},baseUrl:{default:"/"}},setup(o){return p(this,null,function*(){let t,e;const c=o,s=E(u(u({alert:y},v),c.access)),n=$(),m=a=>p(null,null,function*(){const d=`${c.remote||B}/api/open/user/${a}`,l=yield I(d).catch(()=>null);return!l||!l.success?(yield y("登录失败"),null):l.data}),i=n.query.token,r=i?([t,e]=b(()=>m(i)),t=yield t,e(),t):null;if(r)try{s.login(r);const a=n.query.redirect;location.href=decodeURIComponent(a||c.baseUrl)}catch(a){location.reload()}return(a,d)=>(k(),g("div",R,"正在登录中..."))})}}),j=O(S,[["__scopeId","data-v-2674e98b"]]),Z=C({__name:"auth",setup(o){return p(this,null,function*(){let t,e;const c=new U,s=([t,e]=b(()=>c.getExtension().catch(()=>null)),t=yield t,e(),t),n=s==null?void 0:s.remote,m=s==null?void 0:s.__ACCESS__;return(i,r)=>_(n)?(k(),q(_(j),{key:0,remote:_(n),access:_(m)},null,8,["remote","access"])):L("",!0)})}});export{Z as default};
