import{_ as T}from"./filepath-item.vue-9q388r59.js";import{_ as w}from"./nbadge-oebgir67.js";import{_ as k}from"./duration-display.vue-h3qa2740.js";import{H as D,ax as B,D as V,_ as H,ay as F,Q as I}from"./ixdlms3l.js";import{k as v,l as h,Q as o,S as _,U as n,a5 as C,a0 as u,O as p,W as d,R as W,V as P,$ as g,a6 as x,F as b,ab as E,Y as L}from"./vendor/json-editor-vue-mdfcgt41.js";import{_ as M}from"./nsection-block-dyz9ib8t.js";import{_ as Q}from"./help-fab.vue-lsyamqmo.js";import"./vendor/unocss-mnpxkox6.js";import"./vendor/shiki-fpe2sz4h.js";import"./nicon-title.vue-g9trlv29.js";const R={flex:"~ gap2","items-center":""},Y={w8:"","text-right":"","text-sm":"",op25:""},j={key:0,"flex-auto":"","text-right":""},z=v({__name:"PluginItem",props:{plugin:{},index:{}},setup(m){const e=m,a=D(),l=h(()=>B(e.plugin.src,a.value?.rootDir||"").path);return(t,c)=>{const r=T,s=w,i=k;return o(),_("div",R,[n("div",Y,C(t.index),1),u(r,{filepath:e.plugin.src,subpath:!0},null,8,["filepath"]),n("div",null,[l.value.startsWith("#")?(o(),p(s,{key:0,n:"rose",textContent:"virtual"})):l.value.startsWith(".")?d("",!0):(o(),p(s,{key:1,n:"gray",textContent:"module"})),t.plugin.mode==="server"?(o(),p(s,{key:2,n:"teal",textContent:"server"})):d("",!0),t.plugin.mode==="client"?(o(),p(s,{key:3,n:"orange",textContent:"client"})):d("",!0)]),t.plugin.metric?.duration!=null?(o(),_("div",j,[u(i,{duration:t.plugin.metric?.duration,factor:10},null,8,["duration"])])):d("",!0)])}}}),A={class:"n-tip n-tip-base",flex:"~ col items-start","mx--4":"",px4:"",py4:""},O={flex:"~ items-center gap-1","font-bold":""},U=v({__name:"HelpTip",props:{title:{},icon:{}},setup(m){return(e,a)=>{const l=V,t=W("ContentSlot");return o(),_("div",A,[n("div",O,[e.icon?(o(),p(l,{key:0,icon:e.icon,class:"n-tip-icon"},null,8,["icon"])):d("",!0),n("div",null,C(e.title),1)]),n("div",null,[P(e.$slots,"default",{},()=>[u(t,{use:e.$slots.default,unwrap:"p"},null,8,["use"])])])])}}}),q={};function G(m,e){const a=U;return o(),p(a,{title:"Performance Tip",icon:"carbon-meter",n:"lime6 dark:lime5"},{default:g(()=>[P(m.$slots,"default")]),_:3})}const J=H(q,[["render",G]]),K={class:"markdown-body"},X={__name:"plugins",setup(m,{expose:e}){return e({frontmatter:{}}),(l,t)=>{const c=J;return o(),_("div",K,[t[1]||(t[1]=n("h1",null,"Plugins",-1)),t[2]||(t[2]=n("p",null,[x("Nuxt plugins allow you to extend the functionality of the Nuxt runtime and the Vue instance. You can add plugins to the "),n("code",null,"plugins/"),x(" directory and they will be automatically imported and registered.")],-1)),u(c,null,{default:g(()=>t[0]||(t[0]=[x(" Plugins always run before your application's runtime. The loading time of each plugin will directly impact your application's initial loading time. ")])),_:1}),t[3]||(t[3]=n("p",null,[n("a",{href:"https://nuxt.com/docs/guide/directory-structure/plugins",target:"_blank",rel:"noopener"},"Learn more in the documentation")],-1))])}}},Z=X,tt={pt4:""},nt={class:"text-sm",flex:"~ gap-1 items-center justify-start","mt-3":""},mt=v({__name:"plugins",setup(m){const e=F(),a=I(),l=h(()=>{const c=e.value?.plugins||[],r=a.value?.metrics.clientPlugins()||[];return c.map(s=>{const i=typeof s=="string"?{src:s}:s;return{...i,metric:r.find(f=>f.src===i.src||f.src.startsWith(i.src))}})}),t=h(()=>{const c=a.value?.metrics.clientPlugins()||[],r=Math.min(...c.map(i=>i.start));return Math.max(...c.map(i=>i.end))-r});return(c,r)=>{const s=z,i=k,f=M,N=Z,S=Q;return o(),_(b,null,[u(f,{icon:"carbon-plug",text:"Plugins",description:`Total plugins: ${l.value.length}`},{default:g(()=>[n("div",tt,[(o(!0),_(b,null,E(l.value,(y,$)=>(o(),p(s,{key:y.src,plugin:y,index:$+1,"ml--4":"","border-base":"",py2:"",class:L($?"border-t":"")},null,8,["plugin","index","class"]))),128)),n("div",nt,[r[0]||(r[0]=n("div",{"i-carbon-timer":"","text-lg":"",op75:""},null,-1)),r[1]||(r[1]=n("span",{op50:""},"Total execution time:",-1)),u(i,{duration:t.value,factor:10},null,8,["duration"])])])]),_:1},8,["description"]),u(S,null,{default:g(()=>[u(N)]),_:1})],64)}}});export{mt as default};
