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