import{aj as i,s,al as u,am as c,an as l,ao as d,ap as f,aq as m,ar as h,as as A,at as y,au as g,av as v,d as w,u as P,j as C,y as R,aw as _,ax as E,ay as b}from"./chunks/framework.3f630664.js";import{t as r}from"./chunks/theme.3359535a.js";const j={extends:r,Layout:()=>i(r.Layout,null,{})};function p(e){if(e.extends){const t=p(e.extends);return{...t,...e,async enhanceApp(a){t.enhanceApp&&await t.enhanceApp(a),e.enhanceApp&&await e.enhanceApp(a)}}}return e}const o=p(j),x=w({name:"VitePressApp",setup(){const{site:e}=P();return C(()=>{R(()=>{document.documentElement.lang=e.value.lang,document.documentElement.dir=e.value.dir})}),_(),E(),b(),o.setup&&o.setup(),()=>i(o.Layout)}});async function D(){const e=T(),t=L();t.provide(c,e);const a=l(e.route);return t.provide(d,a),t.component("Content",f),t.component("ClientOnly",m),Object.defineProperties(t.config.globalProperties,{$frontmatter:{get(){return a.frontmatter.value}},$params:{get(){return a.page.value.params}}}),o.enhanceApp&&await o.enhanceApp({app:t,router:e,siteData:h}),{app:t,router:e,data:a}}function L(){return A(x)}function T(){let e=s,t;return y(a=>{let n=g(a);return n?(e&&(t=n),(e||t===n)&&(n=n.replace(/\.js$/,".lean.js")),s&&(e=!1),v(()=>import(n),[])):null},o.NotFound)}s&&D().then(({app:e,router:t,data:a})=>{t.go().then(()=>{u(t.route,a.site),e.mount("#app")})});export{D as createApp};
