import{_ as w}from"./DBfC5ADX.js";import{_ as B}from"./E2XRodt7.js";import{o as c,m as _,k as r,d as S,r as v,cs as j,ct as P,aB as R,a as d,af as E,i as l,j as u,F as f,R as I,f as i,l as U,n as W,t as h,D as z,h as G,ar as H,y as L}from"./zEcrVex8.js";import{_ as q}from"./tPM_oRvF.js";import"./CCRhw9W4.js";const A={class:"markdown-body"},J={__name:"virtual-files",setup(x,{expose:o}){return o({frontmatter:{}}),(p,n)=>(c(),_("div",A,n[0]||(n[0]=[r("h1",null,"Virtual Files",-1),r("p",null,"Virtual files are generated on the fly to support the conventions of the framework, and to provide a better developer experience.",-1)])))}},K=J,M=["onClick"],O={key:0,"h-full":"","of-hidden":"",flex:"~ col"},Q={border:"b base","flex-none":"",px4:"",py2:"","text-sm":"",op75:""},ne=S({__name:"virtual-files",setup(x){const o=v(""),s=j(),p=P(),n=v();R(()=>{if(!p.value)return;const e=`/_vfs.json/${encodeURIComponent(p.value)}`;fetch(e,{headers:{accept:"application/json"}}).then(t=>t.json()).then(t=>n.value=t.current)});function k(e){if(s.value?.rootDir)return e.startsWith(s.value?.rootDir)?e.slice(s.value.rootDir.length):e}const m=d(()=>s.value?s.value.entries.filter(e=>!e.id.startsWith(`${s.value?.rootDir||""}/.nuxt/`)).sort((e,t)=>e.id.localeCompare(t.id)):[]),y=d(()=>new E(m.value,{keys:["id","path"]})),b=d(()=>o.value?y.value.search(o.value).map(e=>e.item):m.value);return(e,t)=>{const g=w,C=B,F=H,$=L,N=I,D=K,V=q;return c(),_(f,null,[l(N,{class:"virtual-files","storage-key":"tab-virtual-files"},{left:u(()=>[l(g,{search:i(o),"onUpdate:search":t[0]||(t[0]=a=>U(o)?o.value=a:null),"no-padding":"",p3:""},null,8,["search"]),(c(!0),_(f,null,W(i(b),a=>(c(),_(f,{key:a.id},[r("button",{block:"","w-full":"","select-none":"",truncate:"",px2:"",py1:"","text-start":"","text-sm":"","font-mono":"",class:z(a.id===i(n)?.id?"text-primary n-bg-active":"text-secondary hover:n-bg-hover"),onClick:T=>p.value=a.id},h(k(a.id)),11,M),t[1]||(t[1]=r("div",{"x-divider":""},null,-1))],64))),128))]),right:u(()=>[i(n)?.content?(c(),_("div",O,[r("div",Q,[r("code",null,h(i(n).id),1)]),l(C,{"h-full":"","of-auto":"","text-sm":"",code:i(n).content,lang:"typescript"},null,8,["code"])])):(c(),G($,{key:1},{default:u(()=>[l(F,{px6:"",py2:""},{default:u(()=>t[2]||(t[2]=[r("span",{op75:""},"Select a file to start",-1)])),_:1})]),_:1}))]),_:1}),l(V,null,{default:u(()=>[l(D)]),_:1})],64)}}});export{ne as default};
