import{_ as V}from"./nnavbar-b4ap0r8w.js";import{_ as D}from"./ncode-block-pcw3yh3u.js";import{b as S,bl as B,bm as j,S as P,i as E,n as I,a8 as U}from"#entry";import{J as c,Y as l,a3 as n,p as W,k as f,w as q,q as p,a1 as s,$ as u,X as z,ab as v,F as d,ah as G,a7 as H}from"./vendor/json-editor-vue-ikjc812x.js";import{_ as J}from"./help-fab-chg6ox1v.js";import"./client-miiq4qin.js";import"./vendor/shiki-hpfujfi3.js";import"./vendor/unocss-hczpatch.js";const L={},R={class:"markdown-body"};function X(x,o){return l(),c("div",R,[...o[0]||(o[0]=[n("template",null,[n("div",{class:"markdown-body"},[n("h1",null,"Virtual Files"),n("p",null,"Virtual files are generated on the fly to support the conventions of the framework, and to provide a better developer experience.")])],-1)])])}const Y=S(L,[["render",X]]),A=["onClick"],K={key:0,"h-full":"","of-hidden":"",flex:"~ col"},M={border:"b base","flex-none":"",px4:"",py2:"","text-sm":"",op75:""},re=W({__name:"virtual-files",setup(x){const o=f(""),a=B(),_=j(),i=f();q(()=>{if(!_.value)return;const e=`/_vfs.json/${encodeURIComponent(_.value)}`;fetch(e,{headers:{accept:"application/json"}}).then(t=>t.json()).then(t=>i.value=t.current)});function h(e){if(a.value?.rootDir)return e.startsWith(a.value?.rootDir)?e.slice(a.value.rootDir.length):e}const m=p(()=>a.value?a.value.entries.filter(e=>!e.id.startsWith(`${a.value?.rootDir||""}/.nuxt/`)).sort((e,t)=>e.id.localeCompare(t.id)):[]),b=p(()=>new P(m.value,{keys:["id","path"]})),k=p(()=>o.value?b.value.search(o.value).map(e=>e.item):m.value);return(e,t)=>{const y=V,g=D,C=I,F=E,w=U,N=Y,$=J;return l(),c(d,null,[s(w,{class:"virtual-files","storage-key":"tab-virtual-files"},{left:u(()=>[s(y,{search:o.value,"onUpdate:search":t[0]||(t[0]=r=>o.value=r),"no-padding":"",p3:""},null,8,["search"]),(l(!0),c(d,null,G(k.value,r=>(l(),c(d,{key:r.id},[n("button",{block:"","w-full":"","select-none":"",truncate:"",px2:"",py1:"","text-start":"","text-sm":"","font-mono":"",class:H(r.id===i.value?.id?"text-primary n-bg-active":"text-secondary hover:n-bg-hover"),onClick:O=>_.value=r.id},v(h(r.id)),11,A),t[1]||(t[1]=n("div",{"x-divider":""},null,-1))],64))),128))]),right:u(()=>[i.value?.content?(l(),c("div",K,[n("div",M,[n("code",null,v(i.value.id),1)]),s(g,{"h-full":"","of-auto":"","text-sm":"",code:i.value.content,lang:"typescript"},null,8,["code"])])):(l(),z(F,{key:1},{default:u(()=>[s(C,{px6:"",py2:""},{default:u(()=>[...t[2]||(t[2]=[n("span",{op75:""},"Select a file to start",-1)])]),_:1})]),_:1}))]),_:1}),s($,null,{default:u(()=>[s(N)]),_:1})],64)}}});export{re as default};
