@nuxt/devtools 0.6.7 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. package/dist/chunks/module-main.mjs +126 -75
  2. package/dist/chunks/plugin-metrics.mjs +15 -12
  3. package/dist/chunks/timeline.mjs +69 -0
  4. package/dist/chunks/vscode.mjs +5 -5
  5. package/dist/client/200.html +2 -2
  6. package/dist/client/404.html +2 -2
  7. package/dist/client/__blank/index.html +2 -2
  8. package/dist/client/_nuxt/AuthRequiredPanel.vue.17c2a7bd.js +1 -0
  9. package/dist/client/_nuxt/Badge.8d650e3b.js +1 -0
  10. package/dist/client/_nuxt/CodeDiff.vue.cc3f76a7.js +3 -0
  11. package/dist/client/_nuxt/CodeSnippets.vue.b4698473.js +1 -0
  12. package/dist/client/_nuxt/ComposableItem.vue.6d7b799a.js +1 -0
  13. package/dist/client/_nuxt/DrawerRight.vue.3ab85e5b.js +1 -0
  14. package/dist/client/_nuxt/DurationDisplay.vue.aba5fa70.js +1 -0
  15. package/dist/client/_nuxt/FilepathItem.vue.84aa0a31.js +1 -0
  16. package/dist/client/_nuxt/HelpFab.vue.a8d95bd1.js +1 -0
  17. package/dist/client/_nuxt/LaunchPage.vue.00d3a484.js +1 -0
  18. package/dist/client/_nuxt/NCheckbox.vue.63949e52.js +1 -0
  19. package/dist/client/_nuxt/NCodeBlock.vue.77e54b2e.js +2 -0
  20. package/dist/client/_nuxt/NIconTitle.vue.0a904b99.js +1 -0
  21. package/dist/client/_nuxt/NLink.vue.ec1f69e3.js +1 -0
  22. package/dist/client/_nuxt/{NMarkdown.vue.31d61f61.js → NMarkdown.vue.a74698d6.js} +1 -1
  23. package/dist/client/_nuxt/NSectionBlock.b074e0b8.js +1 -0
  24. package/dist/client/_nuxt/NSelect.vue.9556d6e0.js +1 -0
  25. package/dist/client/_nuxt/NSwitch.vue.6c2556d0.js +1 -0
  26. package/dist/client/_nuxt/NTip.vue.861372f7.js +1 -0
  27. package/dist/client/_nuxt/Navbar.vue.1a2a587f.js +1 -0
  28. package/dist/client/_nuxt/StateEditor.vue.05c4fc16.js +1 -0
  29. package/dist/client/_nuxt/__blank.3f7b27a6.js +1 -0
  30. package/dist/client/_nuxt/analyze-build.c314de67.js +1 -0
  31. package/dist/client/_nuxt/assets.722939b7.js +16 -0
  32. package/dist/client/_nuxt/client.ece13385.js +1 -0
  33. package/dist/client/_nuxt/{components.3a437d73.js → components.27bdfae4.js} +6 -6
  34. package/dist/client/_nuxt/{constants.d7bcda3c.js → constants.4e5eba24.js} +1 -1
  35. package/dist/client/_nuxt/custom-_name_.95a8297c.js +1 -0
  36. package/dist/client/_nuxt/default.7e3f9818.js +1 -0
  37. package/dist/client/_nuxt/entry.6507cb32.js +21 -0
  38. package/dist/client/_nuxt/entry.6f7d64f9.css +1 -0
  39. package/dist/client/_nuxt/{error-404.eb07c617.js → error-404.66ff8897.js} +1 -1
  40. package/dist/client/_nuxt/{error-500.8214e786.js → error-500.34984f69.js} +1 -1
  41. package/dist/client/_nuxt/full.748a1c93.js +1 -0
  42. package/dist/client/_nuxt/hooks.3ec974a8.js +1 -0
  43. package/dist/client/_nuxt/imports.8485b75c.js +1 -0
  44. package/dist/client/_nuxt/{index.98d48447.js → index.5152a001.js} +1 -1
  45. package/dist/client/_nuxt/{index.6a0822c9.js → index.7ae8a638.js} +2 -2
  46. package/dist/client/_nuxt/{json-editor-vue.9acffc14.js → json-editor-vue.bbdad521.js} +1 -1
  47. package/dist/client/_nuxt/{middleware.c2f916df.js → middleware.3c73e553.js} +1 -1
  48. package/dist/client/_nuxt/modules.67fd6240.js +2 -0
  49. package/dist/client/_nuxt/none.2f8cf810.js +1 -0
  50. package/dist/client/_nuxt/open-graph.79a7c77c.js +3 -0
  51. package/dist/client/_nuxt/overview.d953fa7e.js +1 -0
  52. package/dist/client/_nuxt/pages.7b386c55.js +1 -0
  53. package/dist/client/_nuxt/payload.f36f4355.js +1 -0
  54. package/dist/client/_nuxt/plugins.1c37e55d.js +1 -0
  55. package/dist/client/_nuxt/runtime-configs.67f4f0b3.js +1 -0
  56. package/dist/client/_nuxt/server-routes.64373863.js +9 -0
  57. package/dist/client/_nuxt/settings.b7df1779.js +1 -0
  58. package/dist/client/_nuxt/{state-components.493c1b8d.js → state-components.cd34df16.js} +1 -1
  59. package/dist/client/_nuxt/state-modules.c2527930.js +1 -0
  60. package/dist/client/_nuxt/storage.13c667f3.js +1 -0
  61. package/dist/client/_nuxt/{terminals.714ad795.js → terminals.1c5a4ee9.js} +7 -7
  62. package/dist/client/_nuxt/timeline.1ad3a70f.css +1 -0
  63. package/dist/client/_nuxt/timeline.741d9e72.js +57 -0
  64. package/dist/client/_nuxt/{unocss-runtime.552cd61f.js → unocss-runtime.d07b0096.js} +2 -2
  65. package/dist/client/_nuxt/virtual-files.4e8316be.js +1 -0
  66. package/dist/client/index.html +2 -2
  67. package/dist/client/modules/analyze-build/index.html +2 -2
  68. package/dist/client/modules/assets/index.html +2 -2
  69. package/dist/client/modules/components/index.html +2 -2
  70. package/dist/client/modules/hooks/index.html +2 -2
  71. package/dist/client/modules/imports/index.html +2 -2
  72. package/dist/client/modules/middleware/index.html +2 -2
  73. package/dist/client/modules/modules/index.html +2 -2
  74. package/dist/client/modules/open-graph/index.html +2 -2
  75. package/dist/client/modules/overview/index.html +2 -2
  76. package/dist/client/modules/pages/index.html +2 -2
  77. package/dist/client/modules/payload/index.html +2 -2
  78. package/dist/client/modules/plugins/index.html +2 -2
  79. package/dist/client/modules/runtime-configs/index.html +2 -2
  80. package/dist/client/modules/server-routes/index.html +2 -2
  81. package/dist/client/modules/storage/index.html +2 -2
  82. package/dist/client/modules/terminals/index.html +2 -2
  83. package/dist/client/modules/timeline/index.html +7 -0
  84. package/dist/client/modules/virtual-files/index.html +2 -2
  85. package/dist/client/settings/index.html +2 -2
  86. package/dist/{global-20ccb74c.d.ts → global-ea55645c.d.ts} +7 -1
  87. package/dist/module.d.ts +1 -1
  88. package/dist/module.json +1 -1
  89. package/dist/module.mjs +1 -1
  90. package/dist/runtime/function-metrics-helpers.d.ts +3 -0
  91. package/dist/runtime/function-metrics-helpers.mjs +63 -0
  92. package/dist/runtime/plugins/devtools.client.mjs +2 -1
  93. package/dist/runtime/plugins/view/client.d.ts +3 -1
  94. package/dist/runtime/plugins/view/client.mjs +60 -23
  95. package/dist/runtime/plugins/view/state.mjs +1 -1
  96. package/dist/runtime/plugins/view/utils.d.ts +1 -1
  97. package/dist/runtime/plugins/view/utils.mjs +15 -15
  98. package/dist/shared/{devtools.ce3f2385.mjs → devtools.d198e7a9.mjs} +7 -1
  99. package/dist/types.d.ts +1 -1
  100. package/package.json +26 -25
  101. package/dist/client/_nuxt/AuthRequiredPanel.vue.fc7f2968.js +0 -1
  102. package/dist/client/_nuxt/Badge.e05fc69f.js +0 -1
  103. package/dist/client/_nuxt/CodeSnippets.vue.a1fe908d.js +0 -1
  104. package/dist/client/_nuxt/DrawerRight.vue.3adebf89.js +0 -1
  105. package/dist/client/_nuxt/DurationDisplay.vue.c6aa67b3.js +0 -1
  106. package/dist/client/_nuxt/FilepathItem.vue.7520a5eb.js +0 -1
  107. package/dist/client/_nuxt/HelpFab.vue.6c2e0089.js +0 -1
  108. package/dist/client/_nuxt/LaunchPage.vue.ace7e996.js +0 -1
  109. package/dist/client/_nuxt/NCheckbox.vue.660c8c34.js +0 -1
  110. package/dist/client/_nuxt/NCodeBlock.vue.12f6d4d2.js +0 -2
  111. package/dist/client/_nuxt/NIconButton.vue.9dc5b644.js +0 -1
  112. package/dist/client/_nuxt/NIconTitle.vue.0db956c8.js +0 -1
  113. package/dist/client/_nuxt/NLink.vue.f3f95732.js +0 -1
  114. package/dist/client/_nuxt/NPanelGrids.cfd60e85.js +0 -1
  115. package/dist/client/_nuxt/NSectionBlock.216523d8.js +0 -1
  116. package/dist/client/_nuxt/NSelect.vue.38f0d91b.js +0 -1
  117. package/dist/client/_nuxt/NSwitch.vue.4e114eb7.js +0 -1
  118. package/dist/client/_nuxt/NTip.vue.d602d31e.js +0 -1
  119. package/dist/client/_nuxt/Navbar.vue.72301b0e.js +0 -1
  120. package/dist/client/_nuxt/PanelLeftRight.vue.d1539d19.js +0 -1
  121. package/dist/client/_nuxt/StateEditor.vue.c8fd02b3.js +0 -1
  122. package/dist/client/_nuxt/__blank.58b4eaa9.js +0 -1
  123. package/dist/client/_nuxt/analyze-build.66f9bc20.js +0 -1
  124. package/dist/client/_nuxt/assets.b60a4d67.js +0 -16
  125. package/dist/client/_nuxt/client.1e3208e3.js +0 -1
  126. package/dist/client/_nuxt/custom-_name_.1614dd97.js +0 -1
  127. package/dist/client/_nuxt/default.a69a326f.js +0 -1
  128. package/dist/client/_nuxt/entry.559460ac.js +0 -21
  129. package/dist/client/_nuxt/entry.e49b0ddd.css +0 -1
  130. package/dist/client/_nuxt/full.1f3e7ba7.js +0 -1
  131. package/dist/client/_nuxt/hooks.7a294c4b.js +0 -1
  132. package/dist/client/_nuxt/imports.8b3c700a.js +0 -1
  133. package/dist/client/_nuxt/modules.a1aceff5.js +0 -4
  134. package/dist/client/_nuxt/none.bf6672f1.js +0 -1
  135. package/dist/client/_nuxt/open-graph.f68f3562.js +0 -3
  136. package/dist/client/_nuxt/overview.9fbd51a4.js +0 -1
  137. package/dist/client/_nuxt/pages.8b6a187c.js +0 -1
  138. package/dist/client/_nuxt/payload.5851379a.js +0 -1
  139. package/dist/client/_nuxt/plugins.20750545.js +0 -1
  140. package/dist/client/_nuxt/runtime-configs.ce330378.js +0 -1
  141. package/dist/client/_nuxt/server-routes.08ebdd45.js +0 -9
  142. package/dist/client/_nuxt/settings.63ba52d8.js +0 -1
  143. package/dist/client/_nuxt/state-modules.c72270b1.js +0 -1
  144. package/dist/client/_nuxt/storage.d37c76d1.js +0 -1
  145. package/dist/client/_nuxt/virtual-files.7bf5357c.js +0 -1
@@ -0,0 +1 @@
1
+ import{g as I,r as E,m as R,ae as j,s as t,o,c as s,a as e,t as $,h as v,w as k,a$ as q,F as h,n as B,v as y,b as p,d as V,q as L,M,k as W,Z as H,b0 as D,aN as J,aO as Q,a1 as Z,a9 as G,aP as X,aQ as A,al as Y,L as ee,aR as te,A as oe,B as ne}from"./entry.6507cb32.js";import{_ as S}from"./Badge.8d650e3b.js";import{_ as F}from"./FilepathItem.vue.84aa0a31.js";import{_ as ae}from"./NSectionBlock.b074e0b8.js";import{_ as se}from"./LaunchPage.vue.00d3a484.js";import{_ as re}from"./HelpFab.vue.a8d95bd1.js";import"./NIconTitle.vue.0a904b99.js";import"./NMarkdown.vue.a74698d6.js";import"./client.ece13385.js";const le={block:"","cursor-pointer":""},ie={p2:""},ue=["onSubmit"],ce=e("div",{px2:"","text-sm":"",op50:""}," Fill params and navigate: ",-1),de={flex:"~","items-center":"",p2:"","text-sm":"","font-mono":""},pe={key:1},_e=I({__name:"RoutePathItem",props:{route:{}},emits:["navigate"],setup(P,{emit:d}){const i=P,_=E([]),m=R(()=>{const u=b(i.route.path);return _.value=Array.from({length:u.length},()=>""),u});function b(u){return u.split(/(:\w+[\?\*]?(?:\(\))?)/).filter(Boolean).map(c=>c[0]===":"?c.replace(/\(\)$/,"?"):c)}const w=R(()=>m.value.map((u,c)=>u[0]===":"?_.value[c]:u).join("").replace(/\/+/g,"/")),r=R(()=>i.route.path.includes(":"));function a(){d("navigate",w.value)}return(u,c)=>{const C=M,n=W,l=j("VDropdown");return t(r)?(o(),v(l,{key:1},{popper:k(({hide:f})=>[e("div",ie,[e("form",{flex:"~ col",onSubmit:q(()=>{a(),f()},["prevent"])},[t(r)?(o(),s(h,{key:0},[ce,e("div",de,[(o(!0),s(h,null,B(t(m),(g,x)=>(o(),s(h,{key:x},[g[0]===":"?(o(),v(C,{key:0,modelValue:t(_)[x],"onUpdate:modelValue":T=>t(_)[x]=T,"w-20":"","n-sm":"",placeholder:g.slice(1)},null,8,["modelValue","onUpdate:modelValue","placeholder"])):(o(),s("span",pe,$(g),1))],64))),128))])],64)):y("",!0),p(n,{block:"",n:"primary"},{default:k(()=>[V(" Navigate ")]),_:1})],40,ue)])]),default:k(()=>[e("code",le,[(o(!0),s(h,null,B(t(m),(f,g)=>(o(),s("span",{key:g,class:L(f[0]===":"?"text-gray border border-dashed rounded border-gray:50 px1":"")},$(f[0]===":"?f.slice(1):f),3))),128))])]),_:1})):(o(),s("button",{key:0,onClick:a},[e("code",null,$(u.route.path),1)]))}}}),he={"w-full":""},me=e("thead",{border:"b base"},[e("tr",null,[e("th",{"text-left":""}),e("th",{"text-left":""}," Route Path "),e("th",{"text-left":""}," Name "),e("th",{"text-left":""}," Middleware "),e("th",null," Layout ")])],-1),fe={"w-20":"","pr-1":""},ge={flex:"","items-center":"","justify-end":""},ve={"text-sm":""},ye={flex:"inline gap3","items-center":""},be={op0:"","group-hover:op100":"",flex:"~ gap1"},xe=["onClick"],ke=e("div",{"i-carbon-script-reference":""},null,-1),$e=[ke],we={"w-0":"","ws-nowrap":"","pr-1":"","text-left":"","text-sm":"","font-mono":"",op50:""},Ce={"w-0":"","ws-nowrap":"","pr-1":"","text-center":"","text-sm":"","font-mono":"",op50:""},Ne={"w-0":"","ws-nowrap":"","text-center":"","text-sm":"","font-mono":""},Re={key:0},Pe=["onClick"],Ve=I({__name:"RoutesTable",props:{pages:{},layouts:{},matched:{},matchedPending:{}},emits:["navigate"],setup(P){const d=P,i=H(),_=D(),m=R(()=>[...d.pages].sort((r,a)=>r.path.localeCompare(a.path)));function b(r){const a=d.layouts.find(u=>u.name===r);a&&i(a.file)}function w(r){if(typeof r=="string")return _.value?.middleware.find(a=>a.name===r)?.path}return(r,a)=>{const u=S,c=_e,C=F;return o(),s("div",null,[e("table",he,[me,e("tbody",null,[(o(!0),s(h,null,B(t(m),n=>(o(),s("tr",{key:n.name,class:"group","h-7":"",border:"b dashed transparent hover:base"},[e("td",fe,[e("div",ge,[r.matched.find(l=>l.name===n.name)?(o(),v(u,{key:0,"bg-green-400:10":"","text-green-400":"",title:"active",textContent:"active"})):y("",!0),r.matchedPending.find(l=>l.name===n.name)?(o(),v(u,{key:1,"bg-teal-400:10":"","text-teal-400":"",title:"next",textContent:"next"})):y("",!0)])]),e("td",ve,[e("div",ye,[p(c,{route:n,class:L(r.matched.find(l=>l.name===n.name)?"text-primary":r.matchedPending.find(l=>l.name===n.name)?"text-teal":""),onNavigate:a[0]||(a[0]=l=>r.$emit("navigate",l))},null,8,["route","class"]),e("div",be,[n.file||n.meta?.file?(o(),s("button",{key:0,"text-sm":"",op40:"",hover:"op100 text-primary",title:"Open in editor",onClick:l=>t(i)(n.file||n.meta?.file)},$e,8,xe)):y("",!0)])])]),e("td",we,$(n.name),1),e("td",Ce,[p(C,{filepath:w(n.meta.middleware),override:`${n.meta.middleware||"-"}`},null,8,["filepath","override"])]),e("td",Ne,[n.meta.layout===!1?(o(),s("span",Re,"-")):n.meta.layout?(o(),s("button",{key:1,onClick:l=>b(n.meta.layout)},$(n.meta.layout),9,Pe)):(o(),s("button",{key:2,"text-sm":"",op15:"",onClick:a[1]||(a[1]=l=>b("default"))}," (default) "))])]))),128))])])])}}}),Be={class:"markdown-body"},Te=e("h1",null,"Pages",-1),Ie=e("p",null,[V("One core feature of Nuxt is the file system router. Every Vue file inside the "),e("code",null,"pages/"),V(" directory creates a corresponding URL (or route) that displays the contents of the file. By using dynamic imports for each page, Nuxt leverages code-splitting to ship the minimum amount of JavaScript for the requested route.")],-1),Le=e("p",null,[e("a",{href:"https://nuxt.com/docs/getting-started/routing",target:"_blank",rel:"noopener"},"Learn more on the documentation")],-1),Ae=e("hr",null,null,-1),Ee=e("h1",null,"Middlewares",-1),Me=e("p",null,"Nuxt provides a customizable route middleware framework you can use throughout your application, ideal for extracting code that you want to run before navigating to a particular route.",-1),De=e("p",null,[e("a",{href:"https://nuxt.com/docs/guide/directory-structure/middleware",target:"_blank",rel:"noopener"},"Learn more on the documentation")],-1),Se=[Te,Ie,Le,Ae,Ee,Me,De],Fe={__name:"pages",setup(P,{expose:d}){return d({frontmatter:{}}),(_,m)=>(o(),s("div",Be,Se))}},Oe={key:0,"h-full":"","of-auto":""},Ue={border:"b base",flex:"~ col gap1",px4:"",py3:"","navbar-glass":""},ze=e("span",{op50:""},"Navigate from ",-1),Ke={"font-mono":""},je=e("span",{op50:""}," to ",-1),qe={key:1,op50:""},We=e("span",null,[V("Press "),e("b",{"font-bold":""},"Enter"),V(" to navigate")],-1),He={key:0,"text-orange":"",op75:""},Je={key:1,op50:""},Qe={"w-full":""},Ze=e("thead",{border:"b base","h-7":""},[e("tr",null,[e("th",{"text-left":""}," Name "),e("th",{"text-left":""}," Path ")])],-1),Ge={mr1:""},lt=I({__name:"pages",setup(P){const d=J(),i=Q(),_=Z(),m=D(),b=G(),w=X(),r=R(()=>m.value?.middleware||[]),a=E("");A(i).toBeTruthy().then(n=>{a.value=n.path}),A(d).toBeTruthy().then(n=>{n.afterEach(()=>{Y(()=>{a.value=i.value.path})})});async function u(){a.value!==i.value.path&&d.value.push(a.value||"/")}const c=R(()=>a.value===i.value.path?[]:d.value.resolve(a.value||"/").matched);function C(n){d.value.push(n)}return(n,l)=>{const f=M,g=Ve,x=ae,T=S,O=F,U=se,z=Fe,K=re;return o(),s(h,null,[t(_)?.pages&&t(d)?(o(),s("div",Oe,[e("div",Ue,[e("div",null,[t(i).path!==t(a)?(o(),s(h,{key:0},[ze,e("span",Ke,$(t(i).path),1),je],64)):(o(),s("span",qe,"Current route"))]),p(f,{modelValue:t(a),"onUpdate:modelValue":l[0]||(l[0]=N=>ee(a)?a.value=N:null),"font-mono":"",icon:"carbon-direction-right-01 scale-y--100",class:L(t(i).path===t(a)?"":t(c).length?"text-green":"text-orange"),onKeydown:te(u,["enter"])},null,8,["modelValue","class","onKeydown"]),e("div",null,[t(i).path!==t(a)?(o(),s(h,{key:0},[We,t(c).length?y("",!0):(o(),s("span",He," (no match)"))],64)):(o(),s("span",Je,"Edit path above to navigate"))])]),t(c).length?(o(),v(x,{key:0,icon:"carbon-tree-view",text:"Matched Routes",padding:!1},{default:k(()=>[p(g,{pages:t(c),layouts:t(b)||[],matched:[],"matched-pending":t(c),onNavigate:C},null,8,["pages","layouts","matched-pending"])]),_:1})):y("",!0),p(x,{icon:"carbon-tree-view-alt",text:"All Routes",description:`${t(w).length} routes registered in your application`,padding:"pr5"},{default:k(()=>[p(g,{pages:t(w),layouts:t(b)||[],matched:t(i).matched,"matched-pending":t(c),onNavigate:C},null,8,["pages","layouts","matched","matched-pending"])]),_:1},8,["description"]),t(r).length?(o(),v(x,{key:1,icon:"carbon:ibm-watson-studio",text:"Middleware",description:`${t(r).length} middleware registered in your application`,padding:"px13"},{default:k(()=>[e("table",Qe,[Ze,(o(!0),s(h,null,B(t(r),N=>(o(),s("tr",{key:N.path,"h-7":""},[e("td",null,[e("span",Ge,$(N.name),1),N.global?(o(),v(T,{key:0,"bg-green-400:10":"","text-green-400":"",title:"Registered at runtime as a global component",textContent:"global"})):y("",!0)]),e("td",null,[p(O,{filepath:N.path},null,8,["filepath"])])]))),128))])]),_:1},8,["description"])):y("",!0)])):(o(),v(U,{key:1,icon:"carbon-tree-view-alt",title:"Nuxt Routing",description:"Create `./pages/index.vue` to enable routing",actions:[{label:"Learn more",src:"https://nuxt.com/docs/getting-started/routing",attrs:{n:"primary"}},{label:"Enable Routing",async handle(){return("rpc"in n?n.rpc:t(oe)).runWizard(await("ensureDevAuthToken"in n?n.ensureDevAuthToken:t(ne))(),"enablePages")}}]},null,8,["actions"])),p(K,null,{default:k(()=>[p(z)]),_:1})],64)}}});export{lt as default};
@@ -0,0 +1 @@
1
+ import{_ as y}from"./StateEditor.vue.05c4fc16.js";import{g as k,o as e,c,F as x,n as B,h as m,w as o,Y as C,aH as D,aI as w,a as $,ah as F,m as O,s as r,b as a,v as u,d as P,k as V,S as E}from"./entry.6507cb32.js";import{_ as H}from"./NSectionBlock.b074e0b8.js";import{_ as R}from"./HelpFab.vue.a8d95bd1.js";import"./json-editor-vue.bbdad521.js";import"./NIconTitle.vue.0a904b99.js";const j={key:0,flex:"~ col gap-1"},A={key:1,mt2:"",px4:"",italic:"",op35:""},G=k({__name:"StateGroup",props:{state:{},prefix:{default:""}},setup(f){return(t,n)=>{const i=y;return e(),c("div",null,[t.state&&Object.keys(t.state).length>0?(e(),c("div",j,[(e(!0),c(x,null,B(t.state,(l,s)=>(e(),m(i,{key:s,state:l,name:s.startsWith(t.prefix)?s.slice(t.prefix.length):s},{actions:o(_=>[C(t.$slots,"actions",D(w(_)))]),_:2},1032,["state","name"]))),128))])):(e(),c("div",A," No data "))])}}}),I={class:"markdown-body"},K=$("h1",null,"State & Async Data",-1),T=$("p",null,"// TODO",-1),z=[K,T],L={__name:"payload",setup(f,{expose:t}){return t({frontmatter:{}}),(i,l)=>(e(),c("div",I,z))}},W={key:0},Z=k({__name:"payload",setup(f){const t=F(),n=O(()=>t.value?.nuxt.payload);async function i(l){await t.value?.nuxt.hooks.callHookParallel("app:data:refresh",l)}return(l,s)=>{const _=G,p=H,b=V,v=E,S=y,g=L,N=R;return e(),c(x,null,[r(t)?(e(),c("div",W,[a(p,{icon:"carbon-data-set",text:"State",description:"Keyed state from `useState`",padding:!1},{default:o(()=>[a(_,{state:r(n).state,prefix:"$s"},null,8,["state"])]),_:1}),a(p,{icon:"carbon-data-blob",text:"Data",description:"Keyed state from `useAsyncData`",padding:!1},{actions:o(()=>[a(b,{n:"xs primary","self-start":"",icon:"i-carbon-recycle",onClick:s[0]||(s[0]=h=>i())},{default:o(()=>[P(" Re-fetch all data ")]),_:1})]),default:o(()=>[a(_,{state:r(n).data},{actions:o(({isOpen:h,name:d})=>[h&&d?(e(),m(v,{key:0,title:`Re-fetch '${d}'`,icon:"carbon-recycle",onClick:Y=>i([d])},null,8,["title","onClick"])):u("",!0)]),_:1},8,["state"])]),_:1}),r(n).functions&&Object.keys(r(n).functions).length?(e(),m(p,{key:0,icon:"carbon-function",text:"Functions",description:"State for functions (experimental)"},{default:o(()=>[a(S,{"ml--6":"",state:r(n).functions},null,8,["state"])]),_:1})):u("",!0)])):u("",!0),a(N,null,{default:o(()=>[a(g)]),_:1})],64)}}});export{Z as default};
@@ -0,0 +1 @@
1
+ import{_ as S}from"./FilepathItem.vue.84aa0a31.js";import{_ as D}from"./Badge.8d650e3b.js";import{_ as C}from"./DurationDisplay.vue.aba5fa70.js";import{g as v,a1 as B,m as x,a_ as V,o as n,c as m,a as t,t as P,b as l,s as f,h as u,v as d,ae as F,Y as T,T as H,_ as I,w as h,d as y,b0 as M,ah as E,F as k,n as W,q as L}from"./entry.6507cb32.js";import{_ as Y}from"./NSectionBlock.b074e0b8.js";import{_ as j}from"./HelpFab.vue.a8d95bd1.js";import"./NIconTitle.vue.0a904b99.js";const q={flex:"~ gap2","items-center":""},z={w8:"","text-right":"","text-sm":"",op25:""},A={key:0,"flex-auto":"","text-right":""},R=v({__name:"PluginItem",props:{plugin:{},index:{}},setup(p){const e=p,a=B(),r=x(()=>V(e.plugin.src,a.value?.rootDir||"").path);return(i,c)=>{const _=S,o=D,s=C;return n(),m("div",q,[t("div",z,P(i.index),1),l(_,{filepath:e.plugin.src,subpath:!0},null,8,["filepath"]),t("div",null,[f(r).startsWith("#")?(n(),u(o,{key:0,"bg-rose-400:10":"","text-rose":"",textContent:"virtual"})):f(r).startsWith(".")?d("",!0):(n(),u(o,{key:1,"bg-gray-400:10":"","text-gray":"",textContent:"module"})),i.plugin.mode==="server"?(n(),u(o,{key:2,"bg-teal-400:10":"","text-teal-400":"",textContent:"server"})):d("",!0),i.plugin.mode==="client"?(n(),u(o,{key:3,"bg-orange-400:10":"","text-orange-400":"",textContent:"client"})):d("",!0)]),i.plugin.metric?.duration!=null?(n(),m("div",A,[l(s,{duration:i.plugin.metric?.duration,factor:10},null,8,["duration"])])):d("",!0)])}}}),G={class:"n-tip n-tip-base",flex:"~ col items-start","mx--4":"",px4:"",py4:""},J={flex:"~ items-center gap-1","font-bold":""},K=v({__name:"HelpTip",props:{title:{},icon:{}},setup(p){return(e,a)=>{const r=H,i=F("ContentSlot");return n(),m("div",G,[t("div",J,[e.icon?(n(),u(r,{key:0,icon:e.icon,class:"n-tip-icon"},null,8,["icon"])):d("",!0),t("div",null,P(e.title),1)]),t("div",null,[T(e.$slots,"default",{},()=>[l(i,{use:e.$slots.default,unwrap:"p"},null,8,["use"])])])])}}}),O={};function Q(p,e){const a=K;return n(),u(a,{title:"Performance Tip",icon:"carbon-meter",n:"lime6 dark:lime5"},{default:h(()=>[T(p.$slots,"default")]),_:3})}const U=I(O,[["render",Q]]),X={class:"markdown-body"},Z=t("h1",null,"Plugins",-1),tt=t("p",null,[y("Nuxt plugins allows you to extend the functionality of Nuxt runtime and the Vue instance. You can add plugins to the "),t("code",null,"plugins/"),y(" directory and they will be automatically imported and registered.")],-1),et=t("p",null,[t("a",{href:"https://nuxt.com/docs/guide/directory-structure/plugins",target:"_blank",rel:"noopener"},"Learn more on the documentation")],-1),nt={__name:"plugins",setup(p,{expose:e}){return e({frontmatter:{}}),(r,i)=>{const c=U;return n(),m("div",X,[Z,tt,l(c,null,{default:h(()=>[y(" Plugins runs before your application at runtime, the time each plugin cost will directly affect your application's initial loading time. ")]),_:1}),et])}}},ot={pt4:""},st={class:"text-sm",flex:"~ gap-1 items-center justify-start","mt-3":""},it=t("div",{"i-carbon-timer":"","text-lg":"",op75:""},null,-1),at=t("span",{op50:""},"Total execution time:",-1),dt=v({__name:"plugins",setup(p){const e=M(),a=E(),r=x(()=>{const c=e.value?.plugins||[],_=a.value?.clientPluginMetrics||[];return c.map(o=>{const s=typeof o=="string"?{src:o}:o;return{...s,metric:_.find(g=>g.src===s.src||g.src.startsWith(s.src))}})}),i=x(()=>{const c=a.value?.clientPluginMetrics||[],_=Math.min(...c.map(s=>s.start));return Math.max(...c.map(s=>s.end))-_});return(c,_)=>{const o=R,s=C,g=Y,w=nt,N=j;return n(),m(k,null,[l(g,{icon:"carbon-plug",text:"Plugins",description:`Total plugins: ${f(r).length}`},{default:h(()=>[t("div",ot,[(n(!0),m(k,null,W(f(r),($,b)=>(n(),u(o,{key:$.src,plugin:$,index:b+1,"ml--4":"","border-base":"",py2:"",class:L(b?"border-t":"")},null,8,["plugin","index","class"]))),128)),t("div",st,[it,at,l(s,{duration:f(i),factor:10},null,8,["duration"])])])]),_:1},8,["description"]),l(N,null,{default:h(()=>[l(w)]),_:1})],64)}}});export{dt as default};
@@ -0,0 +1 @@
1
+ import{_ as C}from"./StateEditor.vue.05c4fc16.js";import{_ as h}from"./NSectionBlock.b074e0b8.js";import{o as c,c as r,a as m,g as v,ah as x,a1 as b,m as u,s as o,b as e,w as s,v as y,F as k}from"./entry.6507cb32.js";import{_ as R}from"./HelpFab.vue.a8d95bd1.js";import"./json-editor-vue.bbdad521.js";import"./NIconTitle.vue.0a904b99.js";const B={class:"markdown-body"},N=m("h1",null,"Runtime Configs",-1),$=m("p",null,"// TODO:",-1),w=[N,$],D={__name:"runtime-configs",setup(d,{expose:t}){return t({frontmatter:{}}),(l,p)=>(c(),r("div",B,w))}},F={key:0},H=v({__name:"runtime-configs",setup(d){const t=x(),_=b(),l=u(()=>t.value?.nuxt.payload),p=u(()=>{const n={..._.value?.runtimeConfig};return delete n.public,delete n.app,n});return(n,S)=>{const a=C,i=h,f=D,g=R;return c(),r(k,null,[o(t)?(c(),r("div",F,[e(i,{icon:"carbon-settings-services",text:"App Config",padding:!1},{default:s(()=>[e(a,{state:o(t).appConfig},null,8,["state"])]),_:1}),e(i,{icon:"carbon-settings",text:"Public Runtime Config",padding:!1},{default:s(()=>[e(a,{state:o(l).config?.public},null,8,["state"])]),_:1}),e(i,{icon:"i-carbon-code-signing-service",text:"Private Runtime Config",open:!1,padding:!1,description:"These values are not exposed to the client. Readonly in the DevTools."},{default:s(()=>[e(a,{state:o(p),readonly:""},null,8,["state"])]),_:1})])):y("",!0),e(g,null,{default:s(()=>[e(f)]),_:1})],64)}}});export{H as default};
@@ -0,0 +1,9 @@
1
+ import{r as O,b3 as Le,an as Be,al as Ae,ab as he,b4 as Me,b5 as Fe,b6 as We,g as le,b7 as ye,o as n,c as p,a as c,q as E,h as C,s as e,b8 as se,t as j,v as D,d as B,W as ze,Y,F as V,n as A,T as de,X as He,m as R,b as f,w as k,M as ge,k as _e,A as be,b9 as Je,ba as Ge,bb as Ke,a1 as Qe,aj as ie,Z as Xe,am as Ye,L as Z,aE as Ze,S as ke,i as xe,bc as et,bd as tt,a5 as ot,J as nt,be as st,ad as lt}from"./entry.6507cb32.js";import{_ as at}from"./Navbar.vue.1a2a587f.js";import{_ as Ce}from"./Badge.8d650e3b.js";import{_ as we}from"./NSelect.vue.9556d6e0.js";import{_ as rt}from"./NCheckbox.vue.63949e52.js";import{_ as ut}from"./CodeSnippets.vue.b4698473.js";import{_ as it}from"./NCodeBlock.vue.77e54b2e.js";import{C as me,S as $e}from"./constants.4e5eba24.js";import{U as dt}from"./json-editor-vue.bbdad521.js";import{_ as ct}from"./NSectionBlock.b074e0b8.js";import{_ as pt}from"./DrawerRight.vue.3ab85e5b.js";import"./client.ece13385.js";import"./NIconTitle.vue.0a904b99.js";const ne=/^[\u0009\u0020-\u007E\u0080-\u00FF]+$/;function ft(l,h){if(typeof l!="string")throw new TypeError("argument str must be a string");const m={},w=(h||{}).decode||ht;let _=0;for(;_<l.length;){const t=l.indexOf("=",_);if(t===-1)break;let y=l.indexOf(";",_);if(y===-1)y=l.length;else if(y<t){_=l.lastIndexOf(";",t-1)+1;continue}const r=l.slice(_,t).trim();if(m[r]===void 0){let a=l.slice(t+1,y).trim();a.codePointAt(0)===34&&(a=a.slice(1,-1)),m[r]=vt(a,w)}_=y+1}return m}function ve(l,h,m){const o=m||{},w=o.encode||yt;if(typeof w!="function")throw new TypeError("option encode is invalid");if(!ne.test(l))throw new TypeError("argument name is invalid");const _=w(h);if(_&&!ne.test(_))throw new TypeError("argument val is invalid");let t=l+"="+_;if(o.maxAge!==void 0&&o.maxAge!==null){const y=o.maxAge-0;if(Number.isNaN(y)||!Number.isFinite(y))throw new TypeError("option maxAge is invalid");t+="; Max-Age="+Math.floor(y)}if(o.domain){if(!ne.test(o.domain))throw new TypeError("option domain is invalid");t+="; Domain="+o.domain}if(o.path){if(!ne.test(o.path))throw new TypeError("option path is invalid");t+="; Path="+o.path}if(o.expires){if(!mt(o.expires)||Number.isNaN(o.expires.valueOf()))throw new TypeError("option expires is invalid");t+="; Expires="+o.expires.toUTCString()}if(o.httpOnly&&(t+="; HttpOnly"),o.secure&&(t+="; Secure"),o.priority)switch(typeof o.priority=="string"?o.priority.toLowerCase():o.priority){case"low":t+="; Priority=Low";break;case"medium":t+="; Priority=Medium";break;case"high":t+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}if(o.sameSite)switch(typeof o.sameSite=="string"?o.sameSite.toLowerCase():o.sameSite){case!0:t+="; SameSite=Strict";break;case"lax":t+="; SameSite=Lax";break;case"strict":t+="; SameSite=Strict";break;case"none":t+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return t}function mt(l){return Object.prototype.toString.call(l)==="[object Date]"||l instanceof Date}function vt(l,h){try{return h(l)}catch{return l}}function ht(l){return l.includes("%")?decodeURIComponent(l):l}function yt(l){return encodeURIComponent(l)}const gt={path:"/",watch:!0,decode:l=>Fe(decodeURIComponent(l)),encode:l=>encodeURIComponent(typeof l=="string"?l:JSON.stringify(l))};function _t(l,h){const m={...gt,...h},o=bt(m)||{},w=O(o[l]??m.default?.());{const _=typeof BroadcastChannel>"u"?null:new BroadcastChannel(`nuxt:cookies:${l}`);Le()&&Be(()=>{_?.close()});const t=()=>{xt(l,w.value,m),_?.postMessage(We(w.value))};let y=!1;_&&(_.onmessage=r=>{y=!0,w.value=r.data,Ae(()=>{y=!1})}),m.watch?he(w,(r,a)=>{y||Me(r,a)||t()},{deep:m.watch!=="shallow"}):t()}return w}function bt(l={}){return ft(document.cookie,l)}function kt(l,h,m={}){return h==null?ve(l,h,{...m,maxAge:-1}):ve(l,h,m)}function xt(l,h,m={}){document.cookie=kt(l,h,m)}const Ct=c("div",{"x-divider":""},null,-1),Se=le({__name:"ServerRouteListItem",props:{item:{},index:{default:0}},setup(l){const h=O(!0),m=ye();return(o,w)=>{const _=de,t=Ce,y=Se;return n(),p("div",null,[c("button",{flex:"~ gap-2","w-full":"","items-start":"","items-center":"","hover-bg-active":"",px2:"",py1:"",class:E([{"bg-active":e(m)===o.item.filepath}]),style:ze({paddingLeft:`calc(0.5rem + ${o.index*1.5}em)`}),onClick:w[0]||(w[0]=r=>{h.value=!e(h),m.value=o.item.filepath})},[c("div",{class:E({"w-12":!o.item.routes}),"flex-none":"","text-left":""},[o.item.type==="collection"?(n(),C(_,{key:0,icon:"carbon:chevron-right","mb0.5":"","transform-rotate":e(h)?90:0,transition:""},null,8,["transform-rotate"])):(n(),C(t,{key:1,class:E(("getRequestMethodClass"in o?o.getRequestMethodClass:e(se))(o.item.method||"*")),textContent:j((o.item.method||"*").toUpperCase())},null,8,["class","textContent"]))],2),c("span",{class:E({"flex items-center":o.item.routes}),"text-sm":"","font-mono":""},[o.item.type==="collection"?(n(),C(_,{key:0,title:`${o.item.routes?.length} routes`,icon:"carbon:folder",mr1:""},null,8,["title"])):D("",!0),B(" "+j(o.item.route),1)],2)],6),Ct,e(h)?Y(o.$slots,"default",{key:0},()=>[(n(!0),p(V,null,A(o.item.routes,r=>(n(),C(y,{key:r.filepath,item:r,index:o.index+1},null,8,["item","index"]))),128))]):D("",!0)])}}}),wt={p4:"",flex:"~ col gap-4"},$t={key:1,ml2:"",flex:""},St=["value"],Tt={key:0,flex:"","gap-4":""},Rt=c("div",{"flex-auto":""},null,-1),Te=le({__name:"ServerRouteInputs",props:{modelValue:{},keys:{default:()=>[]},default:{default:()=>({})},disabled:{type:Boolean,default:!1}},setup(l,{emit:h}){const m=l,o=He(m,"modelValue",h,{passive:!0}),w=R(()=>[...m.keys,"key","value","type"]),_=R(()=>{const r={};for(const a of w.value)r[a]=m.default[a]||"";return r}),t=["string","number","boolean","file","date","time","datetime-local"];function y(r,a){const U=a.target;if(U.files&&U.files[0]){const J=U.files[0],M=new FileReader;M.readAsDataURL(J),M.onload=()=>{o.value[r].value=M.result}}}return he(()=>o,r=>{r.value.forEach(a=>{if(a.type==="number"&&typeof a.value!="number"){const U=Number.parseFloat(a.value);a.value=Number.isNaN(U)?0:U}else a.type==="boolean"&&typeof a.value!="boolean"?a.value=!0:a.type==="file"&&typeof a.value!="object"?a.value="":a.type==="date"&&typeof a.value=="string"&&!a.value.match(/^\d{4}-\d{2}-\d{2}$/)?a.value=new Date().toISOString().slice(0,10):a.type==="time"&&typeof a.value=="string"&&!a.value.match(/^\d{2}:\d{2}$/)?a.value=new Date().toISOString().slice(11,16):a.type==="datetime-local"&&typeof a.value=="string"&&!a.value.match(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}$/)?a.value=new Date().toISOString().slice(0,16):a.type==="string"&&(a.value=a.value.toString())})},{deep:!0,immediate:!0,flush:"sync"}),(r,a)=>{const U=ge,J=rt,M=we,z=de,v=_e;return n(),p("div",wt,[(n(!0),p(V,null,A(e(o),(d,x)=>(n(),p("div",{key:x,flex:"~ gap-2","justify-around":""},[Y(r.$slots,"input",{item:d}),(n(!0),p(V,null,A(e(w),$=>(n(),p(V,{key:$},[d.type!==null&&$==="key"?(n(),C(U,{key:0,modelValue:d[$],"onUpdate:modelValue":g=>d[$]=g,placeholder:$,"flex-1":"","font-mono":"",n:"sm primary",disabled:r.disabled,class:E(r.disabled?"op50":"")},null,8,["modelValue","onUpdate:modelValue","placeholder","disabled","class"])):$==="value"?(n(),p(V,{key:1},[d.type==="file"?(n(),C(U,{key:0,type:"file",disabled:r.disabled,class:E(r.disabled?"op75":""),onChange:g=>y(x,g)},null,8,["disabled","class","onChange"])):d.type==="boolean"?(n(),p("div",$t,[f(J,{modelValue:d.value,"onUpdate:modelValue":g=>d.value=g,placeholder:"Value",n:"green lg",disabled:r.disabled},null,8,["modelValue","onUpdate:modelValue","disabled"])])):(n(),C(U,{key:2,modelValue:d.value,"onUpdate:modelValue":g=>d.value=g,type:d.type,placeholder:"Value","flex-1":"","font-mono":"",n:"sm primary",disabled:r.disabled,class:E(r.disabled?"op75":"")},null,8,["modelValue","onUpdate:modelValue","type","disabled","class"]))],64)):$==="type"?(n(),C(M,{key:2,modelValue:d.type,"onUpdate:modelValue":g=>d.type=g,n:"sm green",class:E(r.disabled?"op75":""),disabled:r.disabled},{default:k(()=>[(n(),p(V,null,A(t,g=>c("option",{key:g,value:g},j(g),9,St)),64))]),_:2},1032,["modelValue","onUpdate:modelValue","class","disabled"])):D("",!0)],64))),128)),Y(r.$slots,"input-actions",{},()=>[f(v,{n:"red",disabled:r.disabled,class:E(r.disabled?"op0!":""),onClick:$=>e(o).splice(x,1)},{default:k(()=>[f(z,{icon:"carbon:delete"})]),_:2},1032,["disabled","class","onClick"])])]))),128)),r.disabled?D("",!0):(n(),p("div",Tt,[Y(r.$slots,"actions",{params:e(o)},()=>[f(v,{icon:"carbon-add",n:"sm primary",my1:"","px-3":"",onClick:a[0]||(a[0]=d=>e(o).push({...e(_)}))},{default:k(()=>[B(" Add ")]),_:1}),Rt,e(o).length?(n(),C(v,{key:0,icon:"carbon-trash-can",n:"sm red",my1:"","px-3":"",onClick:a[1]||(a[1]=d=>o.value=[])},{default:k(()=>[B(" Remove All ")]),_:1})):D("",!0)])])),Y(r.$slots,"default")])}}}),Re=O(await be.getOptions("serverRoutes")),Vt=Je(Re),Ut={serverRoutes:Vt};function Ve(l){return Ut[l]}Ge(Re,async l=>{be.updateOptions("serverRoutes",l)},{deep:!0,flush:"post",debounce:500,maxWait:1e3});const It={"h-full":"","w-full":"",flex:"~ col"},Nt={flex:"~ col gap-2","flex-none":"",p4:"","navbar-glass":""},Dt={flex:"~ gap2"},Et={flex:"~ gap2 wrap","w-full":"","items-center":"",px4:"",pb2:"","text-center":"","text-sm":"",border:"b base"},jt=c("div",{"flex-auto":""},null,-1),Ot={key:0,border:"b base","items-center":"",px4:"",py2:"",grid:"~ cols-[max-content_1fr] gap-2"},Pt={"text-right":"","font-mono":""},qt={key:1,border:"b base",p4:"",flex:"~ col gap-4","font-mono":""},Lt={flex:"~ gap-4"},Bt={flex:"~ gap2","mb--2":"","items-center":"",op50:""},At=c("div",{"w-5":"","x-divider":""},null,-1),Mt=c("div",{"flex-none":""}," Default Inputs ",-1),Ft=c("div",{"x-divider":""},null,-1),Wt={key:2},zt={key:3,border:"b base",relative:"","n-code-block":""},Ht={flex:"~ wrap","w-full":""},Jt=["onClick"],Gt=c("div",{border:"b base","flex-auto":""},null,-1),Kt={border:"b base",flex:"~ gap2","items-center":"",px4:"",py2:""},Qt=c("div",null,"Response",-1),Xt={key:1,"text-xs":"",op50:""},Yt=c("div",{"flex-auto":""},null,-1),Zt=c("div",{op50:""}," Request finished in ",-1),eo={key:0,"flex-auto":"","overflow-auto":""},to={border:"~ base","h-full":"","w-full":"",rounded:""},oo=["data"],no={key:2,"flex-auto":"","overflow-auto":"",p4:""},so={border:"~ base",rounded:""},lo=["src"],ao={key:1,controls:"",rounded:""},ro=["src"],uo=le({__name:"ServerRouteDetails",props:{route:{}},emits:["open-default-input"],setup(l,{emit:h}){const m=l,[o,w]=Ke(),_=Qe(),t=ie({contentType:"text/plain",data:"",statusCode:200,error:void 0,fetchTime:0}),y=R(()=>t.contentType.includes("application/json")?"json":t.contentType.includes("text/html")?"html":t.contentType.includes("text/css")?"css":t.contentType.includes("text/javascript")?"javascript":t.contentType.includes("image")||t.contentType.includes("video")?"media":t.contentType.includes("text/xml")||t.contentType.includes("application/xml")?"xml":t.contentType.includes("application/pdf")?"pdf":"text"),r=R(()=>{if(y.value==="json")return JSON.stringify(t.data,null,2);if(y.value==="media"||y.value==="pdf"){const s=new Blob([t.data],{type:t.contentType});return URL.createObjectURL(s)}return t.data}),a=O(!1),U=O(!1),J=Xe(),M=R(()=>m.route.route?.split(/((?:\*\*)?:[\w_]+)/g)),z=R(()=>M.value?.filter(s=>s.startsWith(":")||s.startsWith("**:"))||[]),v=O(m.route.method||"GET"),d=O({}),x=ie({query:[{key:"",value:"",type:"string"}],body:[{key:"",value:"",type:"string"}],headers:[{key:"Content-Type",value:"application/json",type:"string"}]}),$=O({}),{inputDefaults:g}=Ve("serverRoutes"),P=["GET","POST","PUT","PATCH","DELETE","HEAD"],q=["PATCH","POST","PUT","DELETE"],L=R(()=>q.includes(v.value.toUpperCase())),S=O(z.value.length?"params":"query"),ee=["input","json"],W=O(ee[0]),K=R({get:()=>x[S.value],set:s=>{x[S.value]=s}}),T=R(()=>({...G(g.value.query),...G(x.query)})),te=R(()=>({...G(g.value.headers),...G(x.headers)})),ae=R(()=>L.value?W.value==="json"?{...G(g.value.body),...$.value}:{...G(g.value.body),...G(x.body)}:void 0),Ue=R(()=>{let s=_.value?.devServer.url||"http://localhost";s.charAt(s.length-1)==="/"&&(s=s.slice(0,-1));const i=_.value?.devServer.port||3e3;return s.includes(`:${i}`)?s:`${s}:${i}`}),oe=R(()=>{let s=new URLSearchParams(T.value).toString();s&&(s=`?${s}`);const i=(M.value?.map(N=>(N.startsWith(":")||N.startsWith("**:"))&&d.value[N]||N).join("")||"")+s;let b=_.value?.app.baseURL||"";return(b==="./"||b===".")&&(b=""),b.endsWith("/")&&(b=b.slice(0,-1)),b+i}),Ie=R(()=>Ue.value+oe.value);function G(s){const i=Object.fromEntries(s.filter(({key:b,value:N})=>b&&N!==void 0).map(({key:b,value:N})=>[b,N]));return Object.entries(i).length?i:void 0}async function ce(){U.value=!0,a.value=!0;const s=Date.now();try{t.data=await $fetch(Ie.value,{method:v.value.toUpperCase(),headers:te.value,query:T.value,body:ae.value,onResponse({response:i}){t.contentType=(i.headers.get("content-type")||"").toString().toLowerCase().trim(),t.statusCode=i.status},onResponseError(i){t.error=i.response._data,t.data=i.response._data}})}catch{}a.value=!1,t.fetchTime=Date.now()-s}const pe=R(()=>{const s=[],i=[],b=Object.entries(te.value).filter(([I,F])=>I&&F&&!(I==="Content-Type"&&F==="application/json")).map(([I,F])=>` '${I}': '${F}'`).join(`,
2
+ `);v.value.toUpperCase()!=="GET"&&i.push(`method: '${v.value.toUpperCase()}'`),b&&i.push(`headers: {
3
+ ${b}
4
+ }`),ae.value&&i.push(`body: ${JSON.stringify(ae.value,null,2)}`);const N=i.length?`, {
5
+ ${i.join(`,
6
+ `).split(`
7
+ `).map(I=>` ${I}`).join(`
8
+ `)}
9
+ }`:"";return s.push({name:"useFetch",lang:"javascript",docs:me.nuxt.useFetch,code:`const { data, pending, error, refresh } = useFetch('${oe.value}'${N})`}),s.push({name:"$fetch",lang:"javascript",docs:me.nuxt.$fetch,code:`await $fetch('${oe.value}'${N})`}),s}),Ne=R(()=>{const s=[];return z.value.length&&s.push({name:"Params",slug:"params",length:z.value.length}),s.push({name:"Query",slug:"query",length:x.query.length}),L.value&&s.push({name:"Body",slug:"body",length:x.body.length}),s.push({name:"Headers",slug:"headers",length:x.headers.length}),s.push({name:"Cookies",slug:"cookies"}),s.push({name:"Snippets",slug:"snippet"}),s}),X=O(De());function De(){return document.cookie.split("; ").map(s=>{const[i,b]=s.split("=");return{key:i,value:b}})}const H=ie({key:"",value:""});function re(s,i){if(!s)return;const b=X.value.find(I=>I.key===s),N=_t(s);b!==void 0?i===void 0&&(X.value=X.value.filter(I=>I.key!==s)):(X.value.push({key:s,value:i}),H.key="",H.value=""),N.value=i}return Ye(()=>{W.value==="json"&&typeof $.value=="string"&&($.value=JSON.parse($.value))}),(s,i)=>{const b=_e,N=we,I=ge,F=de,Ee=ke,fe=Te,je=ut,Oe=xe,Pe=et,ue=Ce,qe=it;return n(),p("div",It,[c("div",Nt,[c("div",Dt,[s.route.method?(n(),C(b,{key:0,class:E(("getRequestMethodClass"in s?s.getRequestMethodClass:e(se))(e(v))),"pointer-events-none":"",tabindex:"-1"},{default:k(()=>[B(j(e(v).toUpperCase()),1)]),_:1},8,["class"])):(n(),C(N,{key:1,modelValue:e(v),"onUpdate:modelValue":i[0]||(i[0]=u=>Z(v)?v.value=u:null),class:E(("getRequestMethodClass"in s?s.getRequestMethodClass:e(se))(e(v)))},{default:k(()=>[(n(),p(V,null,A(P,u=>c("option",{key:u,class:E(("getRequestMethodClass"in s?s.getRequestMethodClass:e(se))(u))},j(u.toUpperCase()),3)),64))]),_:1},8,["modelValue","class"])),f(I,{"model-value":e(oe),disabled:"","flex-auto":"","font-mono":"",p:"x5 y2",n:"primary xs"},null,8,["model-value"]),f(b,{n:"primary solid",onClick:ce},{default:k(()=>[f(F,{icon:"carbon:send"})]),_:1})])]),c("div",Et,[(n(!0),p(V,null,A(e(Ne),u=>(n(),C(b,{key:u.slug,class:E(e(S)===u.slug?"text-primary n-primary":"border-transparent shadow-none"),onClick:Q=>S.value=u.slug},{default:k(()=>[f(F,{icon:("ServerRouteTabIcons"in s?s.ServerRouteTabIcons:e($e))[u.slug]},null,8,["icon"]),B(" "+j(u.name)+" "+j(u?.length?`(${u.length})`:"")+" ",1),c("span",null,j(e(g)[u.slug]?.length?`(${e(g)[u.slug].length})`:""),1)]),_:2},1032,["class","onClick"]))),128)),jt,f(b,{icon:"carbon-launch",onClick:i[1]||(i[1]=u=>e(J)(s.route.filepath))},{default:k(()=>[B(" Open in Editor ")]),_:1})]),e(S)==="params"?(n(),p("div",Ot,[(n(!0),p(V,null,A(e(z),u=>(n(),p(V,{key:u},[c("div",Pt,j(u),1),f(I,{modelValue:e(d)[u],"onUpdate:modelValue":Q=>e(d)[u]=Q,placeholder:u,"flex-1":""},null,8,["modelValue","onUpdate:modelValue","placeholder"])],64))),128))])):D("",!0),e(S)==="cookies"?(n(),p("div",qt,[(n(!0),p(V,null,A(e(X),u=>(n(),p("div",{key:u.key,flex:"~ gap-4 items-center"},[f(I,{placeholder:"Key...","model-value":u.key,disabled:"","op-70":""},null,8,["model-value"]),f(I,{placeholder:"Value...","model-value":u.value,"flex-1":"",n:"primary",onInput:Q=>re(u.key,Q.target?.value)},null,8,["model-value","onInput"]),f(b,{title:"Delete",n:"red",onClick:Q=>re(u.key,void 0)},{default:k(()=>[f(F,{icon:"i-carbon-delete"})]),_:2},1032,["onClick"])]))),128)),c("div",Lt,[f(I,{modelValue:e(H).key,"onUpdate:modelValue":i[2]||(i[2]=u=>e(H).key=u),placeholder:"Key",n:"primary","flex-1":""},null,8,["modelValue"]),f(I,{modelValue:e(H).value,"onUpdate:modelValue":i[3]||(i[3]=u=>e(H).value=u),placeholder:"Value",n:"primary","flex-1":""},null,8,["modelValue"]),f(b,{title:"Add",n:"primary",onClick:i[4]||(i[4]=u=>re(e(H).key,e(H).value))},{default:k(()=>[f(F,{icon:"i-carbon-save"})]),_:1})])])):D("",!0),f(e(o),null,{default:k(()=>[f(fe,{modelValue:e(K),"onUpdate:modelValue":i[7]||(i[7]=u=>Z(K)?K.value=u:null),default:{type:"string"},"max-h-xs":"","of-auto":""},{default:k(()=>[e(g)[e(S)]?.length?(n(),p(V,{key:0},[c("div",Bt,[At,Mt,f(Ee,{icon:"i-carbon-edit",onClick:i[5]||(i[5]=u=>h("open-default-input"))}),Ft]),f(fe,{modelValue:e(g)[e(S)],"onUpdate:modelValue":i[6]||(i[6]=u=>e(g)[e(S)]=u),disabled:"",p0:""},null,8,["modelValue"])],64)):D("",!0)]),_:1},8,["modelValue"])]),_:1}),e(S)==="snippet"?(n(),p("div",Wt,[e(pe).length?(n(),C(je,{key:0,"code-snippets":e(pe)},null,8,["code-snippets"])):D("",!0)])):e(K)?(n(),p("div",zt,[e(S)==="body"?(n(),p(V,{key:0},[c("div",Ht,[(n(),p(V,null,A(ee,u=>c("button",{key:u,px4:"",py2:"",border:"r base",hover:"bg-active",class:E({"border-b":u!==e(W)}),onClick:Q=>W.value=u},[c("div",{class:E({op30:u!==e(W)}),"font-mono":""},j(u),3)],10,Jt)),64)),Gt]),e(W)==="input"?(n(),C(e(w),{key:0})):e(W)==="json"?(n(),C(e(dt),Ze({key:1,modelValue:e($),"onUpdate:modelValue":i[8]||(i[8]=u=>Z($)?$.value=u:null),class:[[s.$colorMode.value==="dark"?"jse-theme-dark":"light"],"json-editor-vue of-auto text-sm outline-none"]},s.$attrs,{mode:"text","navigation-bar":!1,indentation:2,"tab-size":2}),null,16,["modelValue","class"])):D("",!0)],64)):(n(),C(e(w),{key:1}))])):D("",!0),e(U)?e(a)?(n(),C(Pe,{key:5,"z-10":"","flex-auto":"","backdrop-blur":""},{default:k(()=>[B(" Fetching... ")]),_:1})):(n(),p(V,{key:6},[c("div",Kt,[Qt,e(t).error?(n(),C(ue,{key:0,"bg-red-400:10":"","text-red-400":""},{default:k(()=>[B(" Error ")]),_:1})):D("",!0),f(ue,{class:E({"bg-orange-400:10 text-orange-400":e(t).error,"bg-green-400:10 text-green-400":!e(t).error})},{default:k(()=>[B(j(e(t).statusCode),1)]),_:1},8,["class"]),e(t).contentType?(n(),p("code",Xt,j(e(t).contentType),1)):D("",!0),Yt,Zt,f(ue,{"bg-green-400:10":"","text-green-400":""},{default:k(()=>[B(j(e(t).fetchTime)+" ms ",1)]),_:1})]),e(y)==="pdf"?(n(),p("div",eo,[c("div",to,[c("object",{data:e(r),type:"application/pdf","flex-auto":"",width:"100%",height:"100%",rounded:""},null,8,oo)])])):e(y)!=="media"?(n(),C(qe,{key:1,"flex-auto":"","overflow-auto":"","py-2":"",code:e(r),lang:e(y)},null,8,["code","lang"])):(n(),p("div",no,[c("div",so,[e(t).contentType.includes("image")?(n(),p("img",{key:0,rounded:"",src:e(r)},null,8,lo)):(n(),p("video",ao,[c("source",{src:e(r),type:"video/mp4"},null,8,ro)]))])]))],64)):(n(),C(Oe,{key:4},{default:k(()=>[f(b,{n:"primary",onClick:ce},{default:k(()=>[f(F,{icon:"carbon:send"}),B(" Send request ")]),_:1})]),_:1}))])}}}),io={flex:"~ gap1","text-sm":""},co={key:0,op50:""},po={op50:""},fo=c("span",{op75:""},"Select a route to start",-1),mo=c("div",{p4:"",border:"b base"},[c("span",{"text-lg":""},"Default Inputs"),c("br"),c("span",{"text-white":"",op50:""},"Merged as default for every request in DevTools")],-1),Ro=le({__name:"server-routes",setup(l){const h=O(!1),m=tt(),o=ye(),{selectedRoute:w,view:_,inputDefaults:t}=Ve("serverRoutes"),y=R(()=>{!o.value&&w.value&&(o.value=w.value.filepath);const v=m.value?.find(d=>d.filepath===o.value);return o.value!==w.value?.filepath&&v&&(w.value=v),v}),r=O(""),a=R(()=>new ot(m.value||[],{keys:["method","route"],shouldSort:!0})),U=R(()=>m.value?r.value?a.value.search(r.value).map(d=>d.item):m.value:[]),J=R(()=>{const v=[],d=(x,$)=>{x.routes=x.routes||[],x.routes.push($)};return U.value.forEach(x=>{const $=x.filepath.split("/"),g=$.slice($.indexOf("server")+1);g.length>0&&g[g.length-1].includes(".")&&g.pop();let P=null;if(g.forEach(q=>{const L=P?P.routes?.find(S=>S.route===q):v.find(S=>S.route===q);if(L)P=L;else{const S={route:q,filepath:q.replace(/\W/g,"-").toLowerCase(),type:"collection",routes:[]};P?d(P,S):v.push(S),P=S}}),x.type==="runtime"){const q=v.find(L=>L.route==="runtime");if(q)d(q,x);else{const L={route:"runtime",filepath:"runtime",type:"collection",routes:[x]};v.push(L)}}else P?d(P,x):v.push(x)}),v});function M(){_.value=_.value==="tree"?"list":"tree"}function z(v){return v.charAt(0).toUpperCase()+v.slice(1)}return(v,d)=>{const x=ke,$=at,g=Se,P=uo,q=lt,L=xe,S=nt,ee=Te,W=ct,K=pt;return n(),p(V,null,[f(S,{"storage-key":"tab-server-routes"},{left:k(()=>[f($,{search:e(r),"onUpdate:search":d[1]||(d[1]=T=>Z(r)?r.value=T:null),pb2:""},{actions:k(()=>[f(x,{"text-lg":"",icon:e(_)==="list"?"i-carbon-list":"i-carbon-tree-view-alt",title:"Toggle view",onClick:M},null,8,["icon"]),f(x,{"text-lg":"",icon:"i-carbon-cics-sit-overrides",title:"Default Inputs",onClick:d[0]||(d[0]=T=>h.value=!e(h))})]),default:k(()=>[c("div",io,[e(r)?(n(),p("span",co,j(e(U).length)+" matched · ",1)):D("",!0),c("span",po,j(e(m)?.length)+" routes in total",1)])]),_:1},8,["search"]),(n(!0),p(V,null,A(e(_)==="tree"?e(J):e(U),T=>(n(),C(g,{key:T.filepath,item:T},null,8,["item"]))),128))]),right:k(()=>[(n(),C(st,{max:10},[e(y)?(n(),C(P,{key:e(y).filepath,route:e(y),onOpenDefaultInput:d[2]||(d[2]=T=>h.value=!0)},null,8,["route"])):D("",!0)],1024)),e(y)?D("",!0):(n(),C(L,{key:0},{default:k(()=>[f(q,{px6:"",py2:""},{default:k(()=>[fo]),_:1})]),_:1}))]),_:1}),f(K,{modelValue:e(h),"onUpdate:modelValue":d[3]||(d[3]=T=>Z(h)?h.value=T:null),"auto-close":"","max-w-xl":"","min-w-xl":"",onClose:d[4]||(d[4]=T=>h.value=!1)},{default:k(()=>[c("div",null,[mo,(n(!0),p(V,null,A(Object.keys(e(t)),T=>(n(),C(W,{key:T,text:`${z(T)} ${e(t)[T].length?`(${e(t)[T].length})`:""}`,padding:!1,icon:("ServerRouteTabIcons"in v?v.ServerRouteTabIcons:e($e))[T]},{default:k(()=>[f(ee,{modelValue:e(t)[T],"onUpdate:modelValue":te=>e(t)[T]=te,py0:"",default:{type:"string"}},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["text","icon"]))),128))])]),_:1},8,["modelValue"])],64)}}});export{Ro as default};
@@ -0,0 +1 @@
1
+ import{_ as F}from"./NIconTitle.vue.0a904b99.js";import{_ as q}from"./NSwitch.vue.6c2556d0.js";import{g as A,bw as H,aq as P,c as u,b as i,a as e,F as v,n as T,s as a,w as r,L as V,ac as E,bx as M,o as d,q as $,t as h,h as R,v as U,d as G,br as J,S as K,k as Q}from"./entry.6507cb32.js";import{_ as W}from"./NSelect.vue.9556d6e0.js";import{_ as X}from"./NCheckbox.vue.63949e52.js";const Y={px6:"",py6:""},Z={grid:"~ md:cols-2 gap-x-10 gap-y-3","max-w-300":""},ee={flex:"~ col gap-1",py3:""},ne=e("h3",{mb1:"","text-lg":""}," Tabs ",-1),oe={flex:"~ gap-2","flex-auto":"","items-center":"","justify-start":""},le={capitalize:"",op75:""},te={flex:"~ col gap-1",border:"~ base rounded",py3:"",pl4:"",pr2:""},se=e("div",{"flex-auto":""},null,-1),ae={py3:"",flex:"~ col gap-1",border:"b base"},ie=e("h3",{mb1:"","text-lg":""}," Appearance ",-1),ce=e("div",{"carbon-sun":"","dark:carbon-moon":"","translate-y--1px":""},null,-1),de={py3:"",flex:"~ col gap-1",border:"b base"},ue=e("h3",{mb1:"","text-lg":""}," UI Scale ",-1),re=["value"],pe={py3:"",flex:"~ col gap-1"},_e=e("h3",{mb1:"","text-lg":""}," Features ",-1),me=e("span",null,"Close DevTools when clicking outside",-1),fe=e("span",null,"Show help buttons",-1),ke=A({__name:"settings",setup(ve){const{interactionCloseOnOutsideClick:b,showHelpButtons:y,scale:k,hiddenTabs:_,pinnedTabs:t,hiddenTabCategories:m}=E(),S=[["Tiny",12/15],["Small",14/15],["Normal",1],["Large",16/15],["Huge",18/15]],B=H(P());function O(s,l){l?_.value=_.value.filter(c=>c!==s):_.value.push(s)}function D(s,l){l?m.value=m.value.filter(c=>c!==s):m.value.push(s)}function I(s){t.value.includes(s)?t.value=t.value.filter(l=>l!==s):t.value.push(s)}function w(s,l){const c=t.value.indexOf(s);if(c===-1)return;const p=c+l;if(p<0||p>=t.value.length)return;const f=[...t.value];f.splice(c,1),f.splice(p,0,s),t.value=f}return(s,l)=>{const c=F,p=q,f=J,C=K,L=Q,j=M,z=W,N=X;return d(),u("div",Y,[i(c,{class:"mb-5 text-xl op75",icon:"i-carbon-settings-adjust",text:"DevTools Settings"}),e("div",Z,[e("div",ee,[ne,(d(!0),u(v,null,T(a(B),([n,g])=>(d(),u(v,{key:n},[g.length?(d(),u("div",{key:0,flex:"~ col gap-1","mx--1":"",class:$(a(m).includes(n)?"op50 grayscale":""),"pt-2":""},[i(p,{flex:"~ row-reverse",px2:"",py1:"","n-lime":"","model-value":!a(m).includes(n),"onUpdate:modelValue":o=>D(n,o)},{default:r(()=>[e("div",oe,[e("span",le,h(n),1)])]),_:2},1032,["model-value","onUpdate:modelValue"]),e("div",te,[(d(!0),u(v,null,T(g,o=>(d(),R(p,{key:o.name,flex:"~ row-reverse",py1:"",pl2:"",pr1:"","n-primary":"","model-value":!a(_).includes(o.name),"onUpdate:modelValue":x=>O(o.name,x)},{default:r(()=>[e("div",{flex:"~ gap-2","flex-auto":"","items-center":"","justify-start":"","pr-4":"",class:$(a(_).includes(o.name)?"op25":"")},[i(f,{"text-xl":"",icon:o.icon,title:o.title},null,8,["icon","title"]),e("span",null,h(o.title),1),se,a(t).includes(o.name)?(d(),u(v,{key:0},[i(C,{icon:"i-carbon-caret-up",disabled:a(t).indexOf(o.name)===0,onClick:x=>w(o.name,-1)},null,8,["disabled","onClick"]),i(C,{icon:"i-carbon-caret-down",disabled:a(t).indexOf(o.name)===a(t).length-1,onClick:x=>w(o.name,1)},null,8,["disabled","onClick"])],64)):U("",!0),i(C,{icon:a(t).includes(o.name)?" i-carbon-pin-filled rotate--45":" i-carbon-pin op50",onClick:x=>I(o.name)},null,8,["icon","onClick"])],2)]),_:2},1032,["model-value","onUpdate:modelValue"]))),128))])],2)):U("",!0)],64))),128))]),e("div",null,[e("div",ae,[ie,e("div",null,[i(j,null,{default:r(({toggle:n,isDark:g})=>[i(L,{n:"primary",onClick:n},{default:r(()=>[ce,G(" "+h(g.value?"Dark":"Light"),1)]),_:2},1032,["onClick"])]),_:1})])]),e("div",de,[ue,i(z,{modelValue:a(k),"onUpdate:modelValue":l[0]||(l[0]=n=>V(k)?k.value=n:null),n:"primary"},{default:r(()=>[(d(),u(v,null,T(S,n=>e("option",{key:n[0],value:n[1]},h(n[0]),9,re)),64))]),_:1},8,["modelValue"])]),e("div",pe,[_e,i(N,{modelValue:a(b),"onUpdate:modelValue":l[1]||(l[1]=n=>V(b)?b.value=n:null),"n-primary":""},{default:r(()=>[me]),_:1},8,["modelValue"]),i(N,{modelValue:a(y),"onUpdate:modelValue":l[2]||(l[2]=n=>V(y)?y.value=n:null),"n-primary":""},{default:r(()=>[fe]),_:1},8,["modelValue"])])])])])}}});export{ke as default};
@@ -1 +1 @@
1
- import{ac as c,aS as n,l as s,z as o}from"./entry.559460ac.js";function u(){const p=c(),t=n("getComponents",()=>o.getComponents()),l=s(()=>Object.entries(p.value?.nuxt?.vueApp._context.components||{}).map(([e])=>({pascalName:e,global:!0})).filter(e=>!/^Lazy[A-Z]/.test(e.pascalName)).filter(e=>!(t.value||[]).find(a=>a.pascalName===e.pascalName)));return s(()=>[...l.value,...t.value||[]].sort((e,a)=>e.pascalName.localeCompare(a.pascalName)))}function r(){return n("getComponentsRelationships",()=>o.getComponentsRelationships())}export{u as a,r as u};
1
+ import{ah as m,aW as n,m as s,A as o}from"./entry.6507cb32.js";function u(){const p=m(),t=n("getComponents",()=>o.getComponents()),l=s(()=>Object.entries(p.value?.nuxt?.vueApp._context.components||{}).map(([e])=>({pascalName:e,global:!0})).filter(e=>!/^Lazy[A-Z]/.test(e.pascalName)).filter(e=>!(t.value||[]).find(a=>a.pascalName===e.pascalName)));return s(()=>[...l.value,...t.value||[]].sort((e,a)=>e.pascalName.localeCompare(a.pascalName)))}function r(){return n("getComponentsRelationships",()=>o.getComponentsRelationships())}export{u as a,r as u};
@@ -0,0 +1 @@
1
+ import{_ as E}from"./Badge.8d650e3b.js";import{_ as F}from"./NCodeBlock.vue.77e54b2e.js";import{_ as L}from"./NCheckbox.vue.63949e52.js";import{_ as W}from"./NTip.vue.861372f7.js";import{g as Y,E as A,aX as G,r as V,aY as H,C as X,H as Z,o as m,c as v,Y as q,s as t,t as $,v as w,F as B,b as s,h as z,w as u,a as h,L as M,d as p,k as J,N as K,aZ as O,a1 as Q,m as ee,af as te,ag as ae,a_ as se,aW as ne}from"./entry.6507cb32.js";const oe={key:0},le={p4:"",flex:"~ col gap-1"},re={class:"text-lg font-medium leading-6"},ue=h("p",{op50:""}," The following command will be executed in your terminal: ",-1),ie={flex:"~ gap-3",mt2:"","justify-end":""},ge=Y({__name:"NpmVersionCheck",props:{packageName:{},options:{},showVersion:{type:Boolean,default:!0}},setup(l){const a=l,e=A(),{info:n,update:i,state:y,processId:k,restart:c}=G(a.packageName,a.options),f=V(!0),_=V(!0),U=H(),x=X(),R=Z();async function C(){const r=await i(async o=>x.start(o));r&&_.value&&U.value.push({id:r,message:`${a.packageName} has been updated. Do you want to restart the Nuxt server now?`}),r&&f.value&&(R.value=r,e.push("/modules/terminals"))}return(r,o)=>{const N=E,S=F,b=L,T=W,P=J,I=K;return m(),v(B,null,[q(r.$slots,"default",{id:t(k),info:t(n),update:C,state:t(y),restart:t(c)},()=>[t(n)&&r.showVersion?(m(),v("code",oe,$(`v${t(n).current}`),1)):w("",!0),t(n)?.latest?(m(),v(B,{key:1},[t(n).needsUpdate?(m(),v("button",{key:0,onClick:o[0]||(o[0]=g=>C())},[s(N,{"bg-green-400:10":"","text-green-400":"",title:"updates available",textContent:"updates available"})])):(m(),z(N,{key:1,"bg-gray-400:10":"","text-gray-400":"",title:"latest",textContent:"latest"}))],64)):w("",!0)]),s(t(x),null,{default:u(({resolve:g,args:j})=>[s(I,{"model-value":!0,onClose:d=>g(!1)},{default:u(()=>[h("div",le,[h("h3",re," Update "+$(a.packageName)+"? ",1),ue,s(S,{code:j[0],lang:"bash",my3:"",px4:"",py2:"",border:"~ base rounded",lines:!1},null,8,["code"]),s(b,{modelValue:t(f),"onUpdate:modelValue":o[1]||(o[1]=d=>M(f)?f.value=d:null),n:"primary"},{default:u(()=>[p(" Navigate to terminal ")]),_:1},8,["modelValue"]),s(b,{modelValue:t(_),"onUpdate:modelValue":o[2]||(o[2]=d=>M(_)?_.value=d:null),n:"primary"},{default:u(()=>[p(" Restart Nuxt server after update ")]),_:1},8,["modelValue"]),h("div",ie,[s(T,{n:"sm purple","flex-auto":"",icon:"carbon-chemistry"},{default:u(()=>[p(" Experimental feature. Please make sure to backup your project first. ")]),_:1}),s(P,{onClick:d=>g(!1)},{default:u(()=>[p(" Cancel ")]),_:2},1032,["onClick"]),s(P,{n:"solid primary",onClick:d=>g(!0)},{default:u(()=>[p(" Update ")]),_:2},1032,["onClick"])])])]),_:2},1032,["onClose"])]),_:1})],64)}}}),D=["pages","meta","components","imports","nuxt-config-schema","@nuxt/devtools","@nuxt/telemetry"];function de(){return ne("getModulesList",async()=>(await $fetch("https://cdn.jsdelivr.net/npm/@nuxt/modules@latest/modules.json")).filter(a=>!D.includes(a.npm)&&a.compatibility.nuxt.includes("^3")))}function ve(){return O("installed-modules",()=>{const l=Q(),a=de();return ee(()=>(l.value?._installedModules||[]).map(e=>{if(!e.entryPath)return;const n=e.entryPath&&te(e.entryPath),i=e.meta?.name?e.meta?.name:e.entryPath?n?ae(e.entryPath):l.value?.rootDir?se(e.entryPath,l.value?.rootDir).path:void 0:void 0,y=l.value?.modules?.includes(i),k=a.value?.find(c=>c.npm===i)||a.value?.find(c=>c.name===i);return{name:i,isPackageModule:n,isUninstallable:y,info:k,...e}}).filter(e=>e&&(!e.name||!D.includes(e.name))))})}export{ge as _,de as a,ve as u};
@@ -0,0 +1 @@
1
+ import{g as G,E as ae,r as j,G as R,bh as T,an as oe,ab as se,am as re,O as le,m as ue,A as f,B as k,s as t,o as r,h as _,w as u,a as l,b as d,L as U,c as i,F as w,n as D,t as b,q as P,aR as A,d as c,v as F,aE as ie,y as ce,a$ as de,bi as me,bj as _e,bk as z,S as pe,M as fe,T as ve,k as ye,ad as ge,i as he,J as ke}from"./entry.6507cb32.js";import{_ as be}from"./NSelect.vue.9556d6e0.js";import{_ as xe}from"./NLink.vue.ec1f69e3.js";import{_ as we}from"./FilepathItem.vue.84aa0a31.js";import{U as Ce}from"./json-editor-vue.bbdad521.js";import{_ as Ke}from"./AuthRequiredPanel.vue.17c2a7bd.js";const Se={class:"h-[48px] flex items-center justify-between gap1 px-3"},$e={class:"w-full text-sm"},Ve=["value"],Ne=["onClick"],Ie=l("div",{"x-divider":""},null,-1),je={key:0,"h-full":"","of-hidden":"",flex:"~ col"},Ue={border:"b base",class:"h-[49px] flex flex-none items-center justify-between px-4 text-sm"},De={class:"flex items-center gap-4"},Ae={key:1},Be=["onKeyup"],Le=l("br",null,null,-1),Me={key:0,op50:""},qe={key:1},Ee=l("code",null,"nitro.storage",-1),Re=l("br",null,null,-1),Te={"font-bold":""},Pe=l("br",null,null,-1),Fe={"text-sm":""},ze=l("br",null,null,-1),Ge=G({__name:"StorageDetails",async setup(O){let m,g;const C=_e(),h=ae(),x=j(""),v=j(""),s=R("storage:current",""),e=j(),y=R("storage:file:state",""),{data:K}=([m,g]=T(()=>z("storageMounts",()=>f.getStorageMounts())),m=await m,g(),m),{data:S,refresh:B}=([m,g]=T(async()=>z("storageKeys",async()=>s.value?await f.getStorageKeys(s.value):[])),m=await m,g(),m),J=C.hook("storage:key:update",async(n,a)=>{if(!(!s.value||n.split(":")[0]!==s.value)&&(await B(),y.value===n)){if(a==="remove")return h.replace({query:{storage:s.value}});await V(y.value)}});oe(J),se(s,()=>{B(),y.value=""}),re(async()=>{if(!y.value){e.value=null;return}V(y.value)}),le("keydown",n=>{n.key==="s"&&(n.ctrlKey||n.metaKey)&&(N(),n.preventDefault())});function $(n){return n.replace(`${s.value}:`,"")}const W=ue(()=>S.value?S.value.filter(n=>n.includes(x.value)):[]);async function V(n){const a=await f.getStorageItem(await k(),n);e.value={key:n,updatedKey:$(n),editingKey:!1,content:a,updatedContent:a}}async function H(){if(!v.value||!s.value)return;const n=`${s.value}:${v.value}`;S.value?.includes(n)||await f.setStorageItem(await k(),n,""),h.replace({query:{storage:s.value,key:n}}),v.value=""}async function N(){e.value&&(await f.setStorageItem(await k(),e.value.key,e.value.updatedContent),await V(e.value.key))}async function Q(){!e.value||!s.value||(await f.removeStorageItem(await k(),e.value.key),e.value=null)}async function X(){if(!e.value||!s.value)return;const n=`${s.value}:${e.value.updatedKey}`,a=await k();await f.setStorageItem(a,n,e.value.updatedContent),await f.removeStorageItem(a,e.value.key),h.replace({query:{storage:s.value,key:n}})}return(n,a)=>{const Y=pe,Z=be,I=fe,ee=ve,L=ye,M=xe,q=ge,E=he,te=ke,ne=we;return t(s)?(r(),_(te,{key:0,"storage-key":"tab-storage"},{left:u(()=>[l("div",Se,[d(Y,{icon:"carbon-chevron-left","ml--1":"",onClick:a[0]||(a[0]=o=>s.value="")}),l("div",$e,[d(Z,{modelValue:t(s),"onUpdate:modelValue":a[1]||(a[1]=o=>U(s)?s.value=o:null),n:"primary",icon:"carbon-data-base"},{default:u(()=>[(r(!0),i(w,null,D(t(K),(o,p)=>(r(),i("option",{key:p,value:p},b(p),9,Ve))),128))]),_:1},8,["modelValue"])])]),d(I,{modelValue:t(x),"onUpdate:modelValue":a[2]||(a[2]=o=>U(x)?x.value=o:null),icon:"carbon-search",placeholder:"Search...",n:"primary sm",border:"y x-none base! rounded-0",class:"w-full py2 ring-0!"},null,8,["modelValue"]),(r(!0),i(w,null,D(t(W),o=>(r(),i(w,{key:o},[l("button",{block:"","w-full":"",truncate:"",px2:"",py1:"","text-start":"","text-sm":"","font-mono":"",class:P(o===t(e)?.key?"text-primary n-bg-active":"text-secondary hover:n-bg-hover"),onClick:p=>y.value=o},b($(o)),11,Ne),Ie],64))),128)),d(I,{modelValue:t(v),"onUpdate:modelValue":a[3]||(a[3]=o=>U(v)?v.value=o:null),icon:"carbon-add",placeholder:"key",n:"sm",border:"t-none x-none base! rounded-0",class:"w-full py2 font-mono ring-0!",onKeyup:A(H,["enter"])},null,8,["modelValue","onKeyup"])]),right:u(()=>[t(e)?.key?(r(),i("div",je,[l("div",Ue,[l("div",De,[t(e).editingKey?(r(),_(I,{key:0,modelValue:t(e).updatedKey,"onUpdate:modelValue":a[4]||(a[4]=o=>t(e).updatedKey=o),onKeyup:A(X,["enter"])},null,8,["modelValue","onKeyup"])):(r(),i("code",Ae,[c(b($(t(e).key))+" ",1),d(ee,{icon:"carbon-edit",class:"cursor-pointer op50 hover:op100",onClick:a[5]||(a[5]=o=>t(e).editingKey=!0)})])),t(e).editingKey?F("",!0):(r(),_(L,{key:2,n:"green xs",disabled:t(e).content===t(e).updatedContent,class:P({"border-green":t(e).content!==t(e).updatedContent}),onClick:N},{default:u(()=>[c(" Save ")]),_:1},8,["disabled","class"]))]),l("div",null,[d(L,{n:"red xs",onClick:Q},{default:u(()=>[c(" Delete ")]),_:1})])]),typeof t(e).content=="object"?(r(),_(t(Ce),ie({key:0,modelValue:t(e).updatedContent,"onUpdate:modelValue":a[6]||(a[6]=o=>t(e).updatedContent=o),class:[[n.$colorMode.value==="dark"?"jse-theme-dark":"light"],"json-editor-vue h-full of-auto text-sm outline-none"]},n.$attrs,{mode:"text","navigation-bar":!1,indentation:2,"tab-size":2}),null,16,["modelValue","class"])):ce((r(),i("textarea",{key:1,"onUpdate:modelValue":a[7]||(a[7]=o=>t(e).updatedContent=o),placeholder:"Item value...",class:"h-full of-auto p-4 text-sm font-mono outline-none",onKeyup:A(de(N,["ctrl"]),["enter"])},null,40,Be)),[[me,t(e).updatedContent]])])):(r(),_(E,{key:1},{default:u(()=>[d(q,{px6:"",py4:""},{default:u(()=>[c(" Select one key to start."),Le,c("Learn more about "),d(M,{href:"https://nitro.unjs.io/guide/storage",n:"orange",target:"_blank"},{default:u(()=>[c(" Nitro storage ")]),_:1})]),_:1})]),_:1}))]),_:1})):(r(),_(E,{key:1},{default:u(()=>[Object.keys(t(K)).length?(r(),i("p",Me," Select one storage to start: ")):(r(),i("p",qe,[c(" No custom storage defined in "),Ee,c("."),Re,c(" Learn more about "),d(M,{href:"https://nitro.unjs.io/guide/storage",n:"orange",target:"_blank"},{default:u(()=>[c(" Nitro storage ")]),_:1})])),(r(!0),i(w,null,D(t(K),(o,p)=>(r(),_(q,{key:p,"min-w-80":"","cursor-pointer":"","p-4":"","text-left":"",hover:"border-green",onClick:Oe=>s.value=p},{default:u(()=>[l("span",Te,b(p),1),Pe,l("span",Fe,b(o.driver)+" driver",1),ze,o.base?(r(),_(ne,{key:0,"text-xs":"",filepath:o.base},null,8,["filepath"])):F("",!0)]),_:2},1032,["onClick"]))),128))]),_:1}))}}}),Ze=G({__name:"storage",setup(O){return(m,g)=>{const C=Ge,h=Ke;return r(),_(h,null,{default:u(()=>[d(C)]),_:1})}}});export{Ze as default};