import{C as e,Ct as t,Mt as n,T as r,W as i,Y as a,_ as o,dt as s,g as c,h as l,m as u,p as d,s as f,tn as p}from"./vendor/json-editor-vue-9tyg6b65.js";import{c as m,i as h,s as g,v as _,w as v}from"./utils-ivfwadyv.js";import{t as y}from"./_plugin-vue_export-helper-d9irwgla.js";import{t as b}from"./nicon-hgcqr03x.js";import{s as x}from"#entry";import{t as S}from"./pages-dm1j9w83.js";import{t as C}from"./filepath-item-evfn93g6.js";import{t as w}from"./help-fab-myoje00l.js";import{t as T}from"./nnavbar-eonyi8yr.js";import{t as E}from"./nsection-block-lfx32fn0.js";import{t as D}from"./nselect-tabs-x0ru7ijw.js";import{t as O}from"./composable-item-mzxa19xm.js";var k={flex:`~ wrap gap2`,p2:``,pl4:``},A=Object.assign(r({__name:`ComposableTree`,props:{map:{},root:{},metadata:{}},setup(t){return(n,r)=>{let s=C,c=O;return i(),o(`div`,null,[(i(!0),o(f,null,a(t.map.entries(),([n,r])=>(i(),o(`div`,{key:n},[e(s,{filepath:n,op50:``,"hover:underline":``},null,8,[`filepath`]),u(`div`,k,[(i(!0),o(f,null,a(r,e=>(i(),l(c,{key:e.as,item:e,metadata:t.metadata,"is-directive":e.meta?.vueDirective===!0,filepath:n.match(/^[\w@]/)?void 0:n},null,8,[`item`,`metadata`,`is-directive`,`filepath`]))),128))])]))),128))])}}}),{__name:`ComposableTree`}),j={key:0,flex:`~ col gap-2 items-start`},M=Object.assign(r({__name:`HelpImportsDirs`,setup(e){let t=_();return(e,r)=>{let s=C;return n(t)?.dirs?(i(),o(`div`,j,[(i(!0),o(f,null,a(n(t).dirs,e=>(i(),l(s,{key:e,filepath:e,"text-primary":``},null,8,[`filepath`]))),128))])):c(``,!0)}}}),{__name:`HelpImportsDirs`}),N={flex:`~ gap-2 wrap`,mb6:``},P=Object.assign(r({__name:`HelpImportsModules`,setup(e){let t=_(),n=d(()=>[...new Set(t.value?.imports.map(e=>h(e.from)).filter(e=>!!e&&!g(e)))]);return(e,t)=>(i(),o(`div`,N,[(i(!0),o(f,null,a(n.value,e=>(i(),o(`code`,{key:e,rounded:``,"bg-primary:5":``,p:`x2 y0.5`,"text-primary":``},p(e),1))),128))]))}}),{__name:`HelpImportsModules`}),F={},I={class:`markdown-body`},L={class:`markdown-body`};function R(t,n){let r=M,a=P;return i(),o(`div`,I,[u(`template`,null,[u(`div`,L,[n[0]||=u(`h1`,null,`Auto imports`,-1),n[1]||=u(`p`,null,`Nuxt auto-imports helper functions, composables and Vue APIs to be used across your application without explicitly importing them. Based on the directory structure, every Nuxt application can also use auto-imports for its own components, composables and plugins. Components, composables or plugins can use these functions.`,-1),n[2]||=u(`hr`,null,null,-1),n[3]||=u(`p`,null,`According to your config, exports of files under the following folders will be registed as auto-imports entry:`,-1),e(r),n[4]||=u(`p`,null,`Meanwhile, modules could also provide auto-imports for their own components. You have auto-imports from the following modules as well:`,-1),e(a),n[5]||=u(`hr`,null,null,-1),n[6]||=u(`p`,null,[u(`a`,{href:`https://nuxt.com/docs/guide/concepts/auto-imports`,target:`_blank`,rel:`noopener`},`Learn more in the documentation`)],-1),n[7]||=u(`h2`,null,`Directives`,-1),n[8]||=u(`p`,null,`Directives placed in the directives/ directory are automatically registered by Nuxt. They can be used in your templates without importing them.`,-1),n[9]||=u(`p`,null,[u(`a`,{href:`https://nuxt.com/docs/guide/directory-structure/directives`,target:`_blank`,rel:`noopener`},`Learn more in the documentation`)],-1)])])])}var z=y(F,[[`render`,R]]),B={key:0,relative:``,"h-full":``,"of-auto":``},V={key:0,flex:`~ gap-2 items-center lt-sm:col lt-sm:items-start`},H=r({__name:`imports`,setup(r){S({icon:`carbon-function`,title:`Imports`,order:4});let a=v(),u=t(`all`),p=t(`all`),y=t(``),C=_(),O=d(()=>C.value?.metadata),k=d(()=>C.value?.imports.filter(e=>e.as||e.name).sort((e,t)=>(e.as||e.name).localeCompare(t.as||t.name))||[]),j=d(()=>new x(k.value,{keys:[`from`,`as`,`name`]})),M=d(()=>{let e=new Map,t=new Map,n=new Map,r=y.value?j.value.search(y.value).map(e=>e.item):k.value,i=p.value;i===`composables`?r=r.filter(e=>e.meta?.vueDirective!==!0):i===`directives`&&(r=r.filter(e=>e.meta?.vueDirective===!0)),u.value===`using`&&O.value?r=r.filter(e=>(e.as||e.name)in O.value.injectionsUsageMap):u.value===`not-used`&&O.value&&(r=r.filter(e=>!((e.as||e.name)in O.value.injectionsUsageMap)));let a={user:0,lib:0,builtin:0};return r.forEach(r=>{let i=m(r.from)?g(h(r.from))?n:t:e;i.has(r.from)||i.set(r.from,[]),i.get(r.from).push(r),a[i===e?`user`:i===t?`lib`:`builtin`]++}),{user:e,lib:t,builtin:n,count:a}}),N=d(()=>p.value===`directives`?`${M.value.count.user} directives from ${M.value.user.size} modules`:`${M.value.count.user} composables from ${M.value.user.size} modules`),P=d(()=>p.value===`directives`?`${M.value.count.builtin} directives`:`${M.value.count.builtin} composables`),F=d(()=>p.value===`directives`?`${M.value.count.lib} directives from ${M.value.lib.size} packages`:`${M.value.count.lib} composables from ${M.value.lib.size} packages`);return(t,r)=>{let d=b,m=D,h=T,g=A,_=E,v=z,x=w;return i(),o(f,null,[n(a)?(i(),o(`div`,B,[e(h,{search:y.value,"onUpdate:search":r[2]||=e=>y.value=e,pb3:``},{default:s(()=>[O.value?(i(),o(`div`,V,[e(d,{icon:`carbon-filter`,op50:``}),e(m,{modelValue:u.value,"onUpdate:modelValue":r[0]||=e=>u.value=e,n:`primary sm`,options:[{label:`All`,value:`all`},{label:`Using`,value:`using`},{label:`Not used`,value:`not-used`}]},null,8,[`modelValue`]),e(m,{modelValue:p.value,"onUpdate:modelValue":r[1]||=e=>p.value=e,n:`primary sm`,options:[{label:`All`,value:`all`},{label:`Composables`,value:`composables`},{label:`Directives`,value:`directives`}]},null,8,[`modelValue`])])):c(``,!0)]),_:1},8,[`search`]),M.value.user.size?(i(),l(_,{key:0,open:M.value.count.user<=n(50),icon:p.value===`directives`?`tabler:hexagon-letter-d`:`carbon-function`,text:`User ${p.value===`directives`?`directives`:`composables`}`,description:N.value},{default:s(()=>[e(g,{map:M.value.user,root:n(a).rootDir,metadata:O.value},null,8,[`map`,`root`,`metadata`])]),_:1},8,[`open`,`icon`,`text`,`description`])):c(``,!0),M.value.builtin.size?(i(),l(_,{key:1,open:M.value.count.builtin<=n(50),icon:`simple-icons-nuxtdotjs`,text:`Built-in ${p.value===`directives`?`directives`:`composables`}`,description:P.value},{default:s(()=>[e(g,{map:M.value.builtin,root:n(a).rootDir,metadata:O.value},null,8,[`map`,`root`,`metadata`])]),_:1},8,[`open`,`text`,`description`])):c(``,!0),M.value.lib.size?(i(),l(_,{key:2,open:M.value.count.lib<=n(50),icon:`carbon-3d-mpr-toggle`,text:`${p.value===`directives`?`Directives`:`Composables`} from libraries`,description:F.value},{default:s(()=>[e(g,{map:M.value.lib,root:n(a).rootDir,metadata:O.value},null,8,[`map`,`root`,`metadata`])]),_:1},8,[`open`,`text`,`description`])):c(``,!0)])):c(``,!0),e(x,null,{default:s(()=>[e(v)]),_:1})],64)}}});export{H as default};