var O=Object.defineProperty;var E=Object.getOwnPropertySymbols;var V=Object.prototype.hasOwnProperty,W=Object.prototype.propertyIsEnumerable;var P=(o,e,t)=>e in o?O(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,y=(o,e)=>{for(var t in e||(e={}))V.call(e,t)&&P(o,t,e[t]);if(E)for(var t of E(e))W.call(e,t)&&P(o,t,e[t]);return o};var f=(o,e,t)=>new Promise((_,r)=>{var l=n=>{try{i(t.next(n))}catch(c){r(c)}},s=n=>{try{i(t.throw(n))}catch(c){r(c)}},i=n=>n.done?_(n.value):Promise.resolve(n.value).then(l,s);i((t=t.apply(o,e)).next())});import{useRoute as Z}from"./vue-router-CwSAuTE4.js";import{x as j}from"./@vueuse-CFu7Lllw.js";import{O as z,k as I,E as J,R as D,Z as C,U as G,d as k}from"./Editor-CrAfk7jY-Cd4xhKAl.js";import"./element-plus-BCa6Zci8.js";import"./vxe-CiIRgvGK.js";import{E as K,a as v,n as S,l as L}from"./utils-Bu28oKnh.js";import{d as M,b as Q,az as A,e as X,c as Y,o as ee}from"./vue-CAMRmZ-8.js";import{_ as te}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./monaco-editor-BnTtZo-x.js";import"./@element-plus-icons-vue-BKci8WR4.js";import"./html2canvas-DNSjNh3_.js";import"./mockjs-D1skojwT.js";import"./dayjs-BGdj-UA2.js";import"./marked-BQZxLJfc.js";import"./lodash-es-DyZ5XK_i.js";import"./shared-CcA2kMdO.js";const ae=M({__name:"index",setup(o){return f(this,null,function*(){let e,t;const _=Z(),r=Q(),l=new z(I(S)),s=([e,t]=A(()=>l.getExtension().catch(()=>null)),e=yield e,t(),e||{}),i=J({loading:L,notify:S,useTitle:j,alert:v,access:s==null?void 0:s.access}),n=D(y({alert:v},s==null?void 0:s.__ACCESS__)),c=s?([e,t]=A(()=>new K(s).load()),e=yield e,t(),e):{},{__BASE_PATH__:h="/",history:B="hash",base:w="/",pageRouteName:g="page",remote:R,auth:b,checkVersion:T=!0,enhance:F,platform:U="web"}=s||{},q=()=>B==="hash",H=a=>a==="/"?"":(a.startsWith("/")&&(a=a.substring(1)),a.endsWith("/")||(a=a+"/"),a);C.set("Switcher",{props:{onClick:a=>{const u=a.platform==="uniapp",p=location.pathname;let m=p===`${h}__vtj__/`?h:p;const d=a.currentFile;if(d&&d.type==="page"&&a.homepage!==d.id){const N=s.pageBasePath?`/${g}`:"",x=`${H(w)}${u?`pages${N}`:g}/${d.id}`;m=q()?`${m}#/${x}`:`${m}${x}`}window.open(m,"VTJProject")}}}),C.set("Previewer",{props:{path:(a,u)=>{const p=location.pathname;return u.platform==="uniapp"?`${p}uni/#/pages/${a.id}`:`${p}#/preview/${a.id}`}}});const $=new G(y({container:r,service:l,materialPath:h,pageBasePath:w==="/"?"":w,adapter:i,access:n,remote:R,auth:b,checkVersion:T,enhance:F,project:{platform:U}},c));return $.ready(()=>f(null,null,function*(){yield k(300),$.openFile(_.query.id)})),X(()=>_.query.id,a=>f(null,null,function*(){yield k(300),$.openFile(a)})),(a,u)=>(ee(),Y("div",{class:"designer",ref_key:"container",ref:r},null,512))})}}),ge=te(ae,[["__scopeId","data-v-b20f3eda"]]);export{ge as default};
