@nuxt/devtools-nightly 2.0.0-beta.0-28940205.5b566fb → 2.0.0-beta.1-28945928.8db1f2a
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.
- package/dist/chunks/module-main.mjs +54 -51
- package/dist/chunks/vscode.mjs +1 -1
- package/dist/client/200.html +12 -12
- package/dist/client/404.html +12 -12
- package/dist/client/_nuxt/{analyze-build-kcwmvlyl.js → analyze-build-dhl902y9.js} +1 -1
- package/dist/client/_nuxt/{assets-ivvrbi3q.js → assets-tdu15xdh.js} +3 -3
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/d3cc6080-b1af-4518-8c18-051df89d9c28.json +1 -0
- package/dist/client/_nuxt/{code-diff.vue-bhijg81q.js → code-diff.vue-i6ai5lst.js} +1 -1
- package/dist/client/_nuxt/{code-snippets.vue-i4e657wf.js → code-snippets.vue-hvapgodh.js} +1 -1
- package/dist/client/_nuxt/{components-krpx1826.js → components-flcxjbpi.js} +1 -1
- package/dist/client/_nuxt/{composable-item.vue-kwpzi9u7.js → composable-item.vue-nf0lmc00.js} +1 -1
- package/dist/client/_nuxt/{custom-_name_-cepykbos.js → custom-_name_-gctvnum9.js} +1 -1
- package/dist/client/_nuxt/{default-mk5axw1k.js → default-etxkwzb2.js} +1 -1
- package/dist/client/_nuxt/{error-404-lp8coab3.js → error-404-n2bv7ov9.js} +1 -1
- package/dist/client/_nuxt/error-404.css-gakauvtn.css +1 -0
- package/dist/client/_nuxt/{error-500-d4b6gi3u.js → error-500-luh9fo24.js} +1 -1
- package/dist/client/_nuxt/error-500.css-nt5emrt3.css +1 -0
- package/dist/client/_nuxt/error-fut0s14b.js +9 -0
- package/dist/client/_nuxt/filepath-item.vue-ldc0cd59.js +1 -0
- package/dist/client/_nuxt/{full-j8mngb76.js → full-l6aaq3cv.js} +1 -1
- package/dist/client/_nuxt/{help-fab.vue-gtlaa6k2.js → help-fab.vue-hhv95xvg.js} +1 -1
- package/dist/client/_nuxt/{hooks-htmew7il.js → hooks-nnc2743y.js} +1 -1
- package/dist/client/_nuxt/imports-fknrz1re.js +1 -0
- package/dist/client/_nuxt/index-bbxva40i.js +1 -0
- package/dist/client/_nuxt/index-lty6c7e5.js +2 -0
- package/dist/client/_nuxt/launch-page.vue-n4iqorpj.js +1 -0
- package/dist/client/_nuxt/{modules-hdu1ikfi.js → modules-j9u2l2km.js} +1 -1
- package/dist/client/_nuxt/{nbadge-fktngirm.js → nbadge-ixgsh96g.js} +1 -1
- package/dist/client/_nuxt/{ncheckbox.vue-fs1yhvat.js → ncheckbox.vue-ktnsaj70.js} +1 -1
- package/dist/client/_nuxt/{ndrawer.vue-cjxfdzsk.js → ndrawer.vue-oeawm3h0.js} +1 -1
- package/dist/client/_nuxt/{ndropdown.vue-fe8ybtb0.js → ndropdown.vue-c5jsbp5v.js} +1 -1
- package/dist/client/_nuxt/{nlink.vue-jafnipxp.js → nlink.vue-k9k5hsy4.js} +1 -1
- package/dist/client/_nuxt/{nnavbar.vue-d5x8tq5w.js → nnavbar.vue-f0vufq5s.js} +1 -1
- package/dist/client/_nuxt/{none-i3w61o4x.js → none-liasomf8.js} +1 -1
- package/dist/client/_nuxt/{nsection-block-ivkmhmn9.js → nsection-block-lalufadl.js} +1 -1
- package/dist/client/_nuxt/{nselect-tabs.vue-sw71szzx.js → nselect-tabs.vue-kz2aw76p.js} +1 -1
- package/dist/client/_nuxt/{nselect.vue-mkp3umn0.js → nselect.vue-mgxbszb3.js} +1 -1
- package/dist/client/_nuxt/{open-graph-i5rptgvl.js → open-graph-i9tuqyq7.js} +2 -2
- package/dist/client/_nuxt/oqehn934.js +17 -0
- package/dist/client/_nuxt/{overview-jzek603r.js → overview-bn3nhi98.js} +1 -1
- package/dist/client/_nuxt/{pages-mhjzw1eo.js → pages-o7b83d0d.js} +1 -1
- package/dist/client/_nuxt/{payload-kjhui3c5.js → payload-hlgnscsj.js} +1 -1
- package/dist/client/_nuxt/{pinia-jy0feqo2.js → pinia-ds7jhuvv.js} +1 -1
- package/dist/client/_nuxt/plugins-n4on0a1j.js +1 -0
- package/dist/client/_nuxt/{render-tree-malxu5t7.js → render-tree-o6m99mru.js} +1 -1
- package/dist/client/_nuxt/{runtime-configs-c8u0cuv7.js → runtime-configs-k5mmw4ae.js} +1 -1
- package/dist/client/_nuxt/{server-route-inputs.vue-dfs3eezs.js → server-route-inputs.vue-c9toxo7z.js} +1 -1
- package/dist/client/_nuxt/{server-routes-ea89bftg.js → server-routes-oywm7hej.js} +2 -2
- package/dist/client/_nuxt/{server-tasks-guw0x7eh.js → server-tasks-y2pcd9w0.js} +1 -1
- package/dist/client/_nuxt/settings-l6ourgt3.js +1 -0
- package/dist/client/_nuxt/{stacktrace-list.vue-cfyme80n.js → stacktrace-list.vue-i6sjgftd.js} +1 -1
- package/dist/client/_nuxt/{state-components-f29eyhzi.js → state-components-h4h7ppgm.js} +1 -1
- package/dist/client/_nuxt/{state-editor.vue-nd6tb0dn.js → state-editor.vue-f0he07j5.js} +1 -1
- package/dist/client/_nuxt/state-modules-mgqjnewh.js +1 -0
- package/dist/client/_nuxt/storage-ihktoh6o.js +1 -0
- package/dist/client/_nuxt/{terminals-igsxvm6w.js → terminals-mm1zdy29.js} +1 -1
- package/dist/client/_nuxt/{timeline-lm6kcwsd.js → timeline-n6lmb3xx.js} +2 -2
- package/dist/client/_nuxt/{unocss-runtime-jzfgcoxk.js → unocss-runtime-lxpmsgjb.js} +1 -1
- package/dist/client/_nuxt/vendor/{unocss-3uirpnla.js → unocss-fae7bffg.js} +1 -1
- package/dist/client/_nuxt/{virtual-files-jzsbborg.js → virtual-files-mvim6jfj.js} +1 -1
- package/dist/client/index.html +12 -12
- package/dist/module.json +2 -2
- package/dist/module.mjs +1 -1
- package/dist/runtime/plugins/view/Main.vue +2 -9
- package/dist/shared/{devtools-nightly.5ac54dae.mjs → devtools-nightly.60b2ba4d.mjs} +3 -2
- package/package.json +19 -19
- package/dist/client/_nuxt/b6bfxrb8.js +0 -17
- package/dist/client/_nuxt/builds/meta/b8bbfd27-5704-4be8-a606-01af93c734ef.json +0 -1
- package/dist/client/_nuxt/error-404.css-b3x40x40.css +0 -1
- package/dist/client/_nuxt/error-500.css-hilpkhd4.css +0 -1
- package/dist/client/_nuxt/error-ojb7cn7v.js +0 -9
- package/dist/client/_nuxt/filepath-item.vue-b829sn9l.js +0 -1
- package/dist/client/_nuxt/imports-18kqq3am.js +0 -1
- package/dist/client/_nuxt/index-dl6nn7ct.js +0 -2
- package/dist/client/_nuxt/index-e7wrzeix.js +0 -1
- package/dist/client/_nuxt/launch-page.vue-iyi310zf.js +0 -1
- package/dist/client/_nuxt/plugins-d2vnj57a.js +0 -1
- package/dist/client/_nuxt/settings-nr7x6wel.js +0 -1
- package/dist/client/_nuxt/state-modules-gh2s62ky.js +0 -1
- package/dist/client/_nuxt/storage-d1qa6fff.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{b as T,I as $,a6 as z,am as O,an as P,m as E,d as F,ao as g,ap as k,aq as G,a1 as H,i as K,j as U,e as W,a as q,x as Q,f as J}from"./oqehn934.js";import{u as X,_ as Y}from"./state-modules-mgqjnewh.js";import{u as Z}from"./state-components-h4h7ppgm.js";import{k as h,l as A,M as v,$ as n,Q as s,u as o,S as p,U as e,a0 as i,a5 as r,W as u,F as f,a6 as l}from"./vendor/json-editor-vue-gi2fewby.js";import"./vendor/unocss-fae7bffg.js";import"./vendor/shiki-bnvxb5wv.js";import"./nbadge-ixgsh96g.js";import"./ncode-block.vue-gy1ero5j.js";import"./client-c9f80qsp.js";import"./ncheckbox.vue-ktnsaj70.js";const c="2.0.0-beta.1-28945928.8db1f2a",tt={key:0},et={key:1,flex:"~ col gap2",ma:"","h-full":"","max-w-300":"","w-full":"",p5:"",px5:"","md:px20":""},ot={flex:"~ col","mt-5":"","items-center":"","md:mt-20":""},nt={op40:""},st={flex:"~ gap2 wrap"},lt={key:5,"pointer-events-none":"","min-w-40":"",p4:"","theme-card-lime":"",flex:"~ auto gap-6"},it={grid:"~ cols-[auto_auto] gap-x-5 items-center"},ut={"text-right":""},at={"text-right":""},rt={"text-right":""},dt={"text-right":""},pt={flex:"~ col gap2"},mt={flex:"~ gap-6 wrap","mt-5":"","items-center":"","justify-center":""},xt={flex:"col gap-2",mxa:"",hidden:"","w-100":"","text-sm":"",op50:"","md:flex":""},vt={flex:"~ gap-1","items-center":""},ft={flex:"~ gap-1","items-center":""},jt=h({__name:"overview",setup(gt){const b=T(),m=$(),D=Z(),y=z(),j=X(),I=O(),w=P(),B=E();function V(){K.value=!0,B.push("/")}const S=A(()=>b.value?.nuxt.vueApp.version),a=A(()=>b.value?.metrics.loading());function L(){U()}return(C,t)=>{const M=W,x=q,_=Y,N=Q,d=J,R=F;return s(),v(R,{"h-screen":"","w-full":"",flex:""},{default:n(()=>[o(m)?(s(),p("div",et,[t[40]||(t[40]=e("div",{"flex-auto":""},null,-1)),e("div",ot,[i(x,{flex:"~","mt--10":"","items-center":"","justify-center":"",to:"https://devtools.nuxt.com/",target:"_blank"},{default:n(()=>[i(M,{"h-10":""})]),_:1}),e("button",{mb6:"",mt3:"","text-center":"","text-sm":"",flex:"~ gap-1 wrap",onClick:V},[t[0]||(t[0]=e("span",{op40:""}," Nuxt DevTools ",-1)),e("code",nt,"v"+r(o(c)),1),i(_,{"package-name":"@nuxt/devtools",options:{dev:!0},"show-version":!1})])]),e("div",st,[i(x,{to:"https://nuxt.com",target:"_blank",p4:"","theme-card-green":"",flex:"~ col auto"},{default:n(()=>[t[1]||(t[1]=e("div",{"logos-nuxt-icon":"","text-3xl":""},null,-1)),i(_,{"package-name":"nuxt",options:{dev:!0}})]),_:1}),S.value?(s(),v(x,{key:0,to:"https://vuejs.org",target:"_blank",p4:"","theme-card-green":"",flex:"~ col auto"},{default:n(()=>[t[2]||(t[2]=e("div",{"logos-vue":"","text-3xl":""},null,-1)),e("code",null,"v"+r(S.value),1)]),_:1})):u("",!0),o(m)?(s(),p(f,{key:1},[o(m)&&o(m).pages&&o(b)?(s(),v(x,{key:0,"min-w-40":"",p4:"","theme-card-lime":"",flex:"~ col auto",to:"/modules/pages"},{default:n(()=>[t[3]||(t[3]=e("div",{"carbon-tree-view-alt":"","text-3xl":""},null,-1)),e("div",null,r(o(g)(o(I).length,"page")),1)]),_:1})):u("",!0),o(m)?(s(),v(x,{key:1,"min-w-40":"",p4:"","theme-card-lime":"",flex:"~ col auto",to:"/modules/components"},{default:n(()=>[t[4]||(t[4]=e("div",{"i-carbon-assembly-cluster":"","text-3xl":""},null,-1)),e("div",null,r(o(g)(o(D).length,"component")),1)]),_:1})):u("",!0),o(m)&&o(y)?(s(),v(x,{key:2,"min-w-40":"",p4:"","theme-card-yellow":"",flex:"~ col auto",to:"/modules/imports"},{default:n(()=>[t[5]||(t[5]=e("div",{"carbon-function":"","text-3xl":""},null,-1)),e("div",null,r(o(g)(o(y).imports.length,"import")),1)]),_:1})):u("",!0),o(m)?(s(),v(x,{key:3,"min-w-40":"",p4:"","theme-card-purple":"",flex:"~ col auto",to:"/modules/modules"},{default:n(()=>[t[6]||(t[6]=e("div",{"carbon-3d-mpr-toggle":"","text-3xl":""},null,-1)),e("div",null,r(o(g)(o(j).length,"module")),1)]),_:1})):u("",!0),o(m)?(s(),v(x,{key:4,"min-w-40":"",p4:"","theme-card-teal":"",flex:"~ col auto",to:"/modules/plugins"},{default:n(()=>[t[7]||(t[7]=e("div",{"carbon-plug":"","text-3xl":""},null,-1)),e("div",null,r(o(g)(o(m).plugins.length,"plugin")),1)]),_:1})):u("",!0),a.value?(s(),p("div",lt,[t[12]||(t[12]=e("div",{"i-carbon-time-plot":"","flex-none":"","text-3xl":""},null,-1)),e("div",it,[a.value.ssrStart?(s(),p(f,{key:0},[t[8]||(t[8]=e("div",{"text-sm":""}," SSR to full load ",-1)),e("div",ut,r(o(k)(a.value.appLoad-a.value.ssrStart)),1)],64)):u("",!0),t[10]||(t[10]=e("div",{"text-sm":""}," Page load ",-1)),e("div",at,r(o(k)(a.value.appLoad-a.value.appInit)),1),t[11]||(t[11]=e("div",{"text-sm":""}," Navigation ",-1)),e("div",rt,r(o(k)(a.value.pageEnd-a.value.pageStart)),1),a.value.hmrStart?(s(),p(f,{key:1},[t[9]||(t[9]=e("div",{"text-sm":""}," HMR ",-1)),e("div",dt,r(o(k)(a.value.hmrEnd-a.value.hmrStart)),1)],64)):u("",!0)])])):u("",!0)],64)):u("",!0)]),e("div",pt,[o(G)?(s(),v(N,{key:0,n:"yellow5",icon:"carbon-unlink","justify-center":""},{default:n(()=>t[13]||(t[13]=[l(" Not connected to the client app, showing server-side data only. Use the embedded mode for full features. ")])),_:1})):u("",!0),e("button",{title:"Authorize",onClick:L},[("isDevAuthed"in C?C.isDevAuthed:o(H))?u("",!0):(s(),v(N,{key:0,n:"orange5",icon:"i-carbon-locked","justify-center":""},{default:n(()=>t[14]||(t[14]=[l(" Access from an untrusted browser, some features are limited. Click to authorize now. ")])),_:1}))])]),e("div",mt,[t[16]||(t[16]=e("a",{href:"https://github.com/nuxt/devtools",target:"_blank",flex:"~ gap1","items-center":"",op50:"",hover:"op100 text-blue",transition:""},[e("div",{"i-carbon-star":""}),l(" Star on GitHub ")],-1)),t[17]||(t[17]=e("a",{href:"https://github.com/nuxt/devtools/discussions/29",target:"_blank",flex:"~ gap1","items-center":"",op50:"",hover:"op100 text-yellow",transition:""},[e("div",{"i-carbon-data-enrichment":""}),l(" Ideas & Suggestions ")],-1)),t[18]||(t[18]=e("a",{href:"https://github.com/nuxt/devtools/discussions/31",target:"_blank",flex:"~ gap1","items-center":"",op50:"",hover:"op100 text-lime",transition:""},[e("div",{"i-carbon-plan":""}),l(" Project Roadmap ")],-1)),t[19]||(t[19]=e("a",{href:"https://github.com/nuxt/devtools/issues",target:"_blank",flex:"~ gap1","items-center":"",op50:"",hover:"op100 text-rose",transition:""},[e("div",{"i-carbon-debug":""}),l(" Bug Reports ")],-1)),i(x,{to:"/settings",flex:"~ gap1","inline-block":"","items-center":"",op50:"","hover:op80":""},{default:n(()=>t[15]||(t[15]=[e("div",{"i-carbon-settings-adjust":""},null,-1),l(" Settings ")])),_:1})]),t[41]||(t[41]=e("div",{"flex-auto":""},null,-1)),e("div",xt,[e("div",vt,[o(w)?(s(),p(f,{key:0},[i(d,{n:"xs",class:"px2"},{default:n(()=>t[20]||(t[20]=[l(" ⌘ Cmd ")])),_:1}),t[22]||(t[22]=e("span",null,"+",-1)),i(d,{n:"xs",class:"px2"},{default:n(()=>t[21]||(t[21]=[l(" K ")])),_:1})],64)):(s(),p(f,{key:1},[i(d,{n:"xs",class:"px2"},{default:n(()=>t[23]||(t[23]=[l(" Ctrl ")])),_:1}),t[25]||(t[25]=e("span",null,"+",-1)),i(d,{n:"xs",class:"px2"},{default:n(()=>t[24]||(t[24]=[l(" K ")])),_:1})],64)),t[26]||(t[26]=e("div",{"flex-auto":""},null,-1)),t[27]||(t[27]=l(" Open Command Palette "))]),e("div",ft,[o(w)?(s(),p(f,{key:0},[i(d,{n:"xs",class:"px2"},{default:n(()=>t[28]||(t[28]=[l(" ⇧ Shift ")])),_:1}),t[31]||(t[31]=e("span",null,"+",-1)),i(d,{n:"xs",class:"px2"},{default:n(()=>t[29]||(t[29]=[l(" ⌥ Option ")])),_:1}),t[32]||(t[32]=e("span",null,"+",-1)),i(d,{n:"xs",class:"px2"},{default:n(()=>t[30]||(t[30]=[l(" D ")])),_:1})],64)):(s(),p(f,{key:1},[i(d,{n:"xs",class:"px2"},{default:n(()=>t[33]||(t[33]=[l(" Shift ")])),_:1}),t[36]||(t[36]=e("span",null,"+",-1)),i(d,{n:"xs",class:"px2"},{default:n(()=>t[34]||(t[34]=[l(" Alt ")])),_:1}),t[37]||(t[37]=e("span",null,"+",-1)),i(d,{n:"xs",class:"px2"},{default:n(()=>t[35]||(t[35]=[l(" D ")])),_:1})],64)),t[38]||(t[38]=e("div",{"flex-auto":""},null,-1)),t[39]||(t[39]=e("div",null,"Toggle DevTools",-1))])])])):(s(),p("div",tt," Loading... "))]),_:1})}}});export{jt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{w as j,f as J,K as Q,aw as D,J as Y,ai as Z,aj as q,I as G,S as X,ak as ee,ax as te,r as oe,j as ne}from"./oqehn934.js";import{_ as F}from"./nbadge-ixgsh96g.js";import{k as L,b as E,l as x,R as ae,Q as t,S as a,U as e,a5 as C,M as k,$,ag as se,F as g,ab as M,W as N,a0 as f,a6 as I,Y as A,u as c,x as re,Z as le}from"./vendor/json-editor-vue-gi2fewby.js";import{_ as z}from"./filepath-item.vue-ldc0cd59.js";import{_ as ue}from"./nsection-block-lalufadl.js";import{_ as ie}from"./launch-page.vue-n4iqorpj.js";import{_ as pe}from"./help-fab.vue-hhv95xvg.js";import"./vendor/unocss-fae7bffg.js";import"./vendor/shiki-bnvxb5wv.js";import"./nicon-title.vue-ouqsubn7.js";import"./nmarkdown.vue-hygash5x.js";import"./client-c9f80qsp.js";const de={block:"","cursor-pointer":""},ce={p2:""},me=["onSubmit"],ve={flex:"~","items-center":"",p2:"","text-sm":"","font-mono":""},he={key:1},fe=L({__name:"RoutePathItem",props:{route:{}},emits:["navigate"],setup(V,{emit:i}){const v=V,R=i,m=E([]),_=x(()=>{const r=w(v.route.path);return m.value=Array.from({length:r.length},()=>""),r});function w(r){return r.split(/(:\w+[?*]?(?:\(\))?)/).filter(Boolean).map(d=>d[0]===":"?d.replace(/\(\)$/,"?"):d)}const y=x(()=>_.value.map((r,d)=>r[0]===":"?m.value[d]:r).join("").replace(/\/+/g,"/")),o=x(()=>v.route.path.includes(":"));function s(){R("navigate",y.value)}return(r,d)=>{const h=j,n=J,l=ae("VDropdown");return o.value?(t(),k(l,{key:1},{popper:$(({hide:b})=>[e("div",ce,[e("form",{flex:"~ col",onSubmit:se(()=>{s(),b()},["prevent"])},[o.value?(t(),a(g,{key:0},[d[0]||(d[0]=e("div",{px2:"","text-sm":"",op50:""}," Fill params and navigate: ",-1)),e("div",ve,[(t(!0),a(g,null,M(_.value,(u,p)=>(t(),a(g,{key:p},[u[0]===":"?(t(),k(h,{key:0,modelValue:m.value[p],"onUpdate:modelValue":T=>m.value[p]=T,"w-20":"","n-sm":"",placeholder:u.slice(1)},null,8,["modelValue","onUpdate:modelValue","placeholder"])):(t(),a("span",he,C(u),1))],64))),128))])],64)):N("",!0),f(n,{type:"submit",block:"",n:"primary"},{default:$(()=>d[1]||(d[1]=[I(" Navigate ")])),_:1})],40,me)])]),default:$(()=>[e("code",de,[(t(!0),a(g,null,M(_.value,(b,u)=>(t(),a("span",{key:u,class:A(b[0]===":"?"text-gray border border-dashed rounded border-gray:50 px1":"")},C(b[0]===":"?b.slice(1):b),3))),128))])]),_:1})):(t(),a("button",{key:0,onClick:s},[e("code",null,C(r.route.path),1)]))}}}),_e={"max-w-full":"","of-auto":""},ge={"w-full":""},ye={"w-20":"","pr-1":""},be={flex:"","items-center":"","justify-end":""},xe={"text-sm":""},ke={flex:"inline gap3","items-center":""},we={flex:"~ gap1",pr2:"",op0:"","group-hover:op100":""},$e=["onClick"],Ce=["onClick"],Ne={"w-0":"","ws-nowrap":"","pr-1":"","text-left":"","text-sm":"","font-mono":"",op50:""},Re={"w-0":"","ws-nowrap":"","pr-1":"","text-center":"","text-sm":"","font-mono":"",op50:""},Pe={"w-0":"","ws-nowrap":"","text-center":"","text-sm":"","font-mono":""},Ve={key:0},Ie=["onClick"],Me=L({__name:"RoutesTable",props:{pages:{},layouts:{},matched:{},matchedPending:{}},emits:["navigate"],setup(V){const i=V,v=Q(),R=D(),m=Y(),_=x(()=>[...i.pages].sort((o,s)=>o.path.localeCompare(s.path)));function w(o){const s=i.layouts.find(r=>r.name===o);s&&v(s.file)}function y(o){if(typeof o=="string")return R.value?.middleware.find(s=>s.name===o)?.path}return(o,s)=>{const r=F,d=fe,h=z;return t(),a("div",_e,[e("table",ge,[s[4]||(s[4]=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)),e("tbody",null,[(t(!0),a(g,null,M(_.value,n=>(t(),a("tr",{key:n.name,class:"group","h-7":"",border:"b dashed transparent hover:base"},[e("td",ye,[e("div",be,[o.matched.find(l=>l.name===n.name)?(t(),k(r,{key:0,n:"green",title:"active",textContent:"active"})):o.matchedPending.find(l=>l.name===n.name)?(t(),k(r,{key:1,n:"teal",title:"next",textContent:"next"})):N("",!0)])]),e("td",xe,[e("div",ke,[f(d,{route:n,class:A(o.matched.find(l=>l.name===n.name)?"text-primary":o.matchedPending.find(l=>l.name===n.name)?"text-teal":""),"ws-nowrap":"",onNavigate:s[0]||(s[0]=l=>o.$emit("navigate",l))},null,8,["route","class"]),e("div",we,[n.file||n.meta?.file?(t(),a("button",{key:0,"text-sm":"",op40:"",hover:"op100 text-primary",title:"Open in editor",onClick:l=>c(v)(n.file||n.meta?.file)},s[2]||(s[2]=[e("div",{"i-carbon-script-reference":""},null,-1)]),8,$e)):N("",!0),n.file||n.meta?.file?(t(),a("button",{key:1,"text-sm":"",op40:"",hover:"op100 text-primary",title:"Copy path",onClick:l=>c(m)(n.file||n.meta?.file)},s[3]||(s[3]=[e("div",{"i-carbon-copy":""},null,-1)]),8,Ce)):N("",!0)])])]),e("td",Ne,C(n.name),1),e("td",Re,[f(h,{filepath:y(n.meta.middleware),override:`${n.meta.middleware||"-"}`},null,8,["filepath","override"])]),e("td",Pe,[n.meta.layout===!1?(t(),a("span",Ve,"-")):n.meta.layout?(t(),a("button",{key:1,onClick:l=>w(n.meta.layout)},C(n.meta.layout),9,Ie)):(t(),a("button",{key:2,"text-sm":"",op15:"",onClick:s[1]||(s[1]=l=>w("default"))}," (default) "))])]))),128))])])])}}}),Te={class:"markdown-body"},Be={__name:"pages",setup(V,{expose:i}){return i({frontmatter:{}}),(R,m)=>(t(),a("div",Te,m[0]||(m[0]=[e("h1",null,"Pages",-1),e("p",null,[I("Nuxt provides a file-based routing to create routes within your web application using Vue Router under the hood. Pages are Vue components and can have any valid extension that Nuxt supports (by default .vue, .js, .jsx, .mjs, .ts or .tsx). Nuxt will automatically create a route for every page in your "),e("code",null,"~/pages/"),I(" directory.")],-1),e("p",null,[e("a",{href:"https://nuxt.com/docs/getting-started/routing",target:"_blank",rel:"noopener"},"Learn more in the documentation")],-1),e("hr",null,null,-1),e("h1",null,"Middlewares",-1),e("p",null,"Nuxt provides a customizable route middleware framework that can be used throughout the application. This is ideal for extracting code that needs to run before navigating to a particular route.",-1),e("p",null,[e("a",{href:"https://nuxt.com/docs/guide/directory-structure/middleware",target:"_blank",rel:"noopener"},"Learn more in the documentation")],-1)])))}},Ee={key:0,"h-full":"","of-auto":""},Le={border:"b base",flex:"~ col gap1",px4:"",py3:"","n-navbar-glass":""},Ae={"font-mono":""},Se={key:1,op50:""},je={key:0,"text-orange":"",op75:""},De={key:1,op50:""},Fe={"min-h-14":""},ze={key:1,class:"py-4 text-center"},Ue={"w-full":""},Ke={mr1:""},ot=L({__name:"pages",setup(V){const i=Z(),v=q(),R=G(),m=D(),_=X(),w=ee(),y=x(()=>m.value?.middleware||[]),o=E(""),s=E(0),r=x(()=>(y.value,o.value,_.value,s.value,i.value?.currentRoute?.value?.path));re(()=>{v.value&&(o.value=i.value?.currentRoute?.value?.path),i.value?.beforeEach(u=>{o.value=u.fullPath}),i.value?.afterEach(u=>{o.value=u.fullPath})});async function d(){o.value!==i.value?.currentRoute?.value?.path&&i.value.push(o.value||"/")}const h=x(()=>i.value.resolve(o.value||"/").matched);function n(u){i.value.push(u),o.value=u}const l=te(),b=x(()=>`./${l===4?"app/":""}pages/index.vue`);return(u,p)=>{const T=j,S=Me,B=ue,U=F,K=z,W=ie,O=Be,H=pe;return t(),a(g,null,[c(R)?.pages&&c(i)?(t(),a("div",Ee,[e("div",Le,[e("div",null,[r.value!==o.value?(t(),a(g,{key:0},[p[1]||(p[1]=e("span",{op50:""},"Navigate from ",-1)),e("span",Ae,C(r.value),1),p[2]||(p[2]=e("span",{op50:""}," to ",-1))],64)):(t(),a("span",Se,"Current route"))]),f(T,{modelValue:o.value,"onUpdate:modelValue":p[0]||(p[0]=P=>o.value=P),"font-mono":"",icon:"carbon-direction-right-01 scale-y--100",class:A(r.value===o.value?"":h.value.length?"text-green":"text-orange"),onKeydown:le(d,["enter"])},null,8,["modelValue","class"]),e("div",null,[r.value!==o.value?(t(),a(g,{key:0},[p[3]||(p[3]=e("span",null,[I("Press "),e("b",{"font-bold":""},"Enter"),I(" to navigate")],-1)),h.value.length?N("",!0):(t(),a("span",je," (no match)"))],64)):(t(),a("span",De,"Edit path above to navigate"))])]),f(B,{icon:"carbon-tree-view",text:"Matched Routes",padding:!1},{default:$(()=>[e("div",Fe,[h.value.length?(t(),k(S,{key:0,pages:h.value,layouts:c(_)||[],matched:c(v).matched,"matched-pending":h.value,onNavigate:n},null,8,["pages","layouts","matched","matched-pending"])):(t(),a("div",ze,p[4]||(p[4]=[e("span",{op50:""},"No routes matched",-1)])))])]),_:1}),f(B,{icon:"carbon-tree-view-alt",text:"All Routes",description:`${c(w).length} routes registered in your application`,padding:"pr5"},{default:$(()=>[f(S,{pages:c(w),layouts:c(_)||[],matched:c(v).matched,"matched-pending":h.value,onNavigate:n},null,8,["pages","layouts","matched","matched-pending"])]),_:1},8,["description"]),y.value.length?(t(),k(B,{key:0,icon:"carbon:ibm-watson-studio",text:"Middleware",description:`${y.value.length} middleware registered in your application`,padding:"px13"},{default:$(()=>[e("table",Ue,[p[5]||(p[5]=e("thead",{border:"b base","h-7":""},[e("tr",null,[e("th",{"text-left":""}," Name "),e("th",{"text-left":""}," Path ")])],-1)),(t(!0),a(g,null,M(y.value,P=>(t(),a("tr",{key:P.path,"h-7":""},[e("td",null,[e("span",Ke,C(P.name),1),P.global?(t(),k(U,{key:0,n:"green",title:"Registered at runtime as a global component",textContent:"global"})):N("",!0)]),e("td",null,[f(K,{filepath:P.path},null,8,["filepath"])])]))),128))])]),_:1},8,["description"])):N("",!0)])):(t(),k(W,{key:1,icon:"carbon-tree-view-alt",name:"wizard-pages",title:"Nuxt Routing",description:`Create ${b.value} 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 u?u.rpc:c(oe)).runWizard(await("ensureDevAuthToken"in u?u.ensureDevAuthToken:c(ne))(),"enablePages")}}]},null,8,["description","actions"])),f(H,null,{default:$(()=>[f(O)]),_:1})],64)}}});export{ot as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as h}from"./state-editor.vue-
|
|
1
|
+
import{_ as h}from"./state-editor.vue-f0he07j5.js";import{k as $,Q as e,S as i,F as x,ab as N,M as d,$ as a,V as B,a1 as V,U as b,l as k,ae as w,u as F,a0 as o,W as _,a6 as O,a8 as E}from"./vendor/json-editor-vue-gi2fewby.js";import{_ as P}from"./nsection-block-lalufadl.js";import{b as R,f as j}from"./oqehn934.js";import{_ as A}from"./help-fab.vue-hhv95xvg.js";import"./nicon-title.vue-ouqsubn7.js";import"./vendor/unocss-fae7bffg.js";import"./vendor/shiki-bnvxb5wv.js";const G={key:0,flex:"~ col gap-1"},H={key:1,mt2:"",px4:"",italic:"",op35:""},K=$({__name:"StateGroup",props:{state:{},revision:{},prefix:{default:""}},setup(f){return(t,n)=>{const c=h;return e(),i("div",null,[t.state&&Object.keys(t.state).length>0?(e(),i("div",G,[(e(!0),i(x,null,N(t.state,(s,r)=>(e(),d(c,{key:r,revision:t.revision,state:s,name:r.startsWith(t.prefix)?r.slice(t.prefix.length):r},{actions:a(l=>[B(t.$slots,"actions",V({ref_for:!0},l))]),_:2},1032,["revision","state","name"]))),128))])):(e(),i("div",H," No data "))])}}}),T={class:"markdown-body"},W={__name:"payload",setup(f,{expose:t}){return t({frontmatter:{}}),(c,s)=>(e(),i("div",T,s[0]||(s[0]=[b("h1",null,"State & Async Data",-1),b("p",null,"// TODO",-1)])))}},L={key:0},Z=$({__name:"payload",setup(f){const t=R(),n=k(()=>t.value?.nuxt.payload),c=k(()=>t.value?.revision.value);async function s(r){await t.value?.nuxt.hooks.callHookParallel("app:data:refresh",r)}return(r,l)=>{const m=K,p=P,v=j,S=h,g=W,D=A,C=w("tooltip");return e(),i(x,null,[F(t)?(e(),i("div",L,[o(p,{icon:"carbon-data-set",text:"State",description:"Keyed state from `useState`",padding:!1},{default:a(()=>[o(m,{state:n.value.state,revision:c.value,prefix:"$s"},null,8,["state","revision"])]),_:1}),o(p,{icon:"carbon-data-blob",text:"Data",description:"Keyed state from `useAsyncData`",padding:!1},{actions:a(()=>[o(v,{n:"xs primary","self-start":"",icon:"i-carbon-recycle",onClick:l[0]||(l[0]=y=>s())},{default:a(()=>l[1]||(l[1]=[O(" Re-fetch all data ")])),_:1})]),default:a(()=>[o(m,{state:n.value.data,revision:c.value},{actions:a(({isOpen:y,name:u})=>[y&&u?E((e(),d(v,{key:0,title:`Re-fetch '${u}'`,icon:"carbon-recycle",border:!1,onClick:M=>s([u])},null,8,["title","onClick"])),[[C,`Re-fetch '${u}'`,void 0,{bottom:!0}]]):_("",!0)]),_:1},8,["state","revision"])]),_:1}),n.value.functions&&Object.keys(n.value.functions).length?(e(),d(p,{key:0,icon:"carbon-function",text:"Functions",description:"State for functions"},{default:a(()=>[o(S,{"ml--6":"",state:n.value.functions,revision:c.value},null,8,["state","revision"])]),_:1})):_("",!0)])):_("",!0),o(D,null,{default:a(()=>[o(g)]),_:1})],64)}}});export{Z as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ay as r,az as c}from"./
|
|
1
|
+
import{ay as r,az as c}from"./oqehn934.js";import{v as i}from"./index-lty6c7e5.js";import{k as m,S as p,u as o,M as n,$ as _,Q as t,a6 as l}from"./vendor/json-editor-vue-gi2fewby.js";import"./vendor/unocss-fae7bffg.js";import"./vendor/shiki-bnvxb5wv.js";import"./vue-virtual-scroller.esm-hx1s7s1b.js";const u={class:"h-full w-full"},g=m({__name:"pinia",setup(f){const{connected:a}=r();return(d,e)=>{const s=c;return t(),p("div",u,[o(a)?(t(),n(o(i),{key:0})):(t(),n(s,{key:1},{default:_(()=>e[0]||(e[0]=[l(" Connecting.... ")])),_:1}))])}}});export{g as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as S}from"./nbadge-ixgsh96g.js";import{_ as T}from"./filepath-item.vue-ldc0cd59.js";import{_ as k}from"./duration-display.vue-kqe6a4wx.js";import{I as D,av as B,E as V,_ as I,aw as E,b as F}from"./oqehn934.js";import{k as v,l as h,Q as s,S as _,U as n,a5 as C,a0 as c,$ as f,M as p,W as d,R as H,V as P,a6 as x,F as b,ab as W,Y as M}from"./vendor/json-editor-vue-gi2fewby.js";import{_ as L}from"./nsection-block-lalufadl.js";import{_ as R}from"./help-fab.vue-hhv95xvg.js";import"./vendor/unocss-fae7bffg.js";import"./vendor/shiki-bnvxb5wv.js";import"./nicon-title.vue-ouqsubn7.js";const Y={flex:"~ gap2","items-center":""},j={w8:"","text-right":"","text-sm":"",op25:""},z={key:0,"flex-auto":"","text-right":""},A=v({__name:"PluginItem",props:{plugin:{},index:{}},setup(m){const e=m,r=D(),a=h(()=>B(e.plugin.src,r.value?.rootDir||"").path);return(t,l)=>{const o=S,u=T,i=k;return s(),_("div",Y,[n("div",j,C(t.index),1),c(u,{filepath:e.plugin.src,subpath:!0},{default:f(()=>[n("div",null,[a.value.startsWith("#")?(s(),p(o,{key:0,n:"rose",textContent:"virtual"})):a.value.startsWith(".")?d("",!0):(s(),p(o,{key:1,n:"gray",textContent:"module"})),t.plugin.mode==="server"?(s(),p(o,{key:2,n:"teal",textContent:"server"})):d("",!0),t.plugin.mode==="client"?(s(),p(o,{key:3,n:"orange",textContent:"client"})):d("",!0)])]),_:1},8,["filepath"]),t.plugin.metric?.duration!=null?(s(),_("div",z,[c(i,{duration:t.plugin.metric?.duration,factor:10},null,8,["duration"])])):d("",!0)])}}}),Q={class:"n-tip n-tip-base",flex:"~ col items-start","mx--4":"",px4:"",py4:""},U={flex:"~ items-center gap-1","font-bold":""},q=v({__name:"HelpTip",props:{title:{},icon:{}},setup(m){return(e,r)=>{const a=V,t=H("ContentSlot");return s(),_("div",Q,[n("div",U,[e.icon?(s(),p(a,{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",{},()=>[c(t,{use:e.$slots.default,unwrap:"p"},null,8,["use"])])])])}}}),G={};function J(m,e){const r=q;return s(),p(r,{title:"Performance Tip",icon:"carbon-meter",n:"lime6 dark:lime5"},{default:f(()=>[P(m.$slots,"default")]),_:3})}const K=I(G,[["render",J]]),O={class:"markdown-body"},X={__name:"plugins",setup(m,{expose:e}){return e({frontmatter:{}}),(a,t)=>{const l=K;return s(),_("div",O,[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)),c(l,null,{default:f(()=>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={pt4:""},tt={class:"text-sm",flex:"~ gap-1 items-center justify-start","mt-3":""},pt=v({__name:"plugins",setup(m){const e=E(),r=F(),a=h(()=>{const l=e.value?.plugins||[],o=r.value?.metrics.clientPlugins()||[];return l.map(u=>{const i=typeof u=="string"?{src:u}:u;return{...i,metric:o.find(g=>g.src===i.src||g.src.startsWith(i.src))}})}),t=h(()=>{const l=r.value?.metrics.clientPlugins()||[],o=Math.min(...l.map(i=>i.start));return Math.max(...l.map(i=>i.end))-o});return(l,o)=>{const u=A,i=k,g=L,w=X,N=R;return s(),_(b,null,[c(g,{icon:"carbon-plug",text:"Plugins",description:`Total plugins: ${a.value.length}`},{default:f(()=>[n("div",Z,[(s(!0),_(b,null,W(a.value,(y,$)=>(s(),p(u,{key:y.src,plugin:y,index:$+1,"ml--4":"","border-base":"",py2:"",class:M($?"border-t":"")},null,8,["plugin","index","class"]))),128)),n("div",tt,[o[0]||(o[0]=n("div",{"i-carbon-timer":"","text-lg":"",op75:""},null,-1)),o[1]||(o[1]=n("span",{op50:""},"Total execution time:",-1)),c(i,{duration:t.value,factor:10},null,8,["duration"])])])]),_:1},8,["description"]),c(N,null,{default:f(()=>[c(w)]),_:1})],64)}}});export{pt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ay as m,
|
|
1
|
+
import{ay as m,b as d,K as c,az as f}from"./oqehn934.js";import{p as _}from"./index-lty6c7e5.js";import{k as v,S as k,u as n,M as a,$ as C,Q as o,a6 as E}from"./vendor/json-editor-vue-gi2fewby.js";import"./vendor/unocss-fae7bffg.js";import"./vendor/shiki-bnvxb5wv.js";import"./vue-virtual-scroller.esm-hx1s7s1b.js";const I={class:"h-full w-full"},w=v({__name:"render-tree",setup(x){const{connected:l}=m(),t=d(),p=c();function s(r){r?t.value.devtools.open():t.value.devtools.close()}return(r,e)=>{const i=f;return o(),k("div",I,[n(l)?(o(),a(n(_),{key:0,onOnInspectComponentStart:e[0]||(e[0]=u=>s(!1)),onOnInspectComponentEnd:e[1]||(e[1]=u=>s(!0)),onOpenInEditor:n(p)},null,8,["onOpenInEditor"])):(o(),a(i,{key:1},{default:C(()=>e[2]||(e[2]=[E(" Connecting.... ")])),_:1}))])}}});export{w as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as x}from"./state-editor.vue-
|
|
1
|
+
import{_ as x}from"./state-editor.vue-f0he07j5.js";import{_ as y}from"./nsection-block-lalufadl.js";import{Q as u,S as l,U as o,a6 as d,k as b,l as c,u as f,a0 as e,$ as a,W as C,F as k}from"./vendor/json-editor-vue-gi2fewby.js";import{_ as w}from"./help-fab.vue-hhv95xvg.js";import{b as N,aZ as R}from"./oqehn934.js";import"./nicon-title.vue-ouqsubn7.js";import"./vendor/unocss-fae7bffg.js";import"./vendor/shiki-bnvxb5wv.js";const T={class:"markdown-body"},$={__name:"runtime-configs",setup(_,{expose:t}){return t({frontmatter:{}}),(m,n)=>(u(),l("div",T,n[0]||(n[0]=[o("h1",null,"Runtime Configs",-1),o("p",null,"Nuxt provides a runtime config API to expose configuration within your application and server routes, with the ability to update it at runtime by setting environment variables.",-1),o("p",null,[d("In Nuxt DevTools, the editor allows you to edit the runtime config temporarily to see how the changes affect your application. To update them, you might want to update your "),o("code",null,"nuxt.config.js"),d(" file, or check more details in the documentation.")],-1),o("p",null,[o("a",{href:"https://nuxt.com/docs/guide/going-further/runtime-config",target:"_blank",rel:"noopener"},"Learn more in the documentation")],-1)])))}},B={key:0},H=b({__name:"runtime-configs",setup(_){const t=N(),p=R(),m=c(()=>t.value?.nuxt.payload),n=c(()=>t.value?.revision.value),g=c(()=>{const i={...p.value};return delete i.public,delete i.app,i});return(i,S)=>{const s=x,r=y,v=$,h=w;return u(),l(k,null,[f(t)?(u(),l("div",B,[e(r,{icon:"carbon-settings-services",text:"App Config",padding:!1},{default:a(()=>[e(s,{state:f(t).app.appConfig,revision:n.value},null,8,["state","revision"])]),_:1}),e(r,{icon:"carbon-settings",text:"Public Runtime Config",padding:!1},{default:a(()=>[e(s,{state:m.value.config?.public,revision:n.value},null,8,["state","revision"])]),_:1}),e(r,{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:a(()=>[e(s,{state:g.value,revision:n.value,readonly:""},null,8,["state","revision"])]),_:1})])):C("",!0),e(h,null,{default:a(()=>[e(v)]),_:1})],64)}}});export{H as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as j}from"./ncheckbox.vue-
|
|
1
|
+
import{_ as j}from"./ncheckbox.vue-ktnsaj70.js";import{z as O,w as R,E as T,f as A}from"./oqehn934.js";import{_ as E}from"./nselect.vue-mgxbszb3.js";import{k as z,l as N,c as L,Q as s,S as u,F as c,ab as h,V as v,M as p,W as m,Y as b,a0 as y,$ as V,U as C,a5 as M,u as r,a6 as S}from"./vendor/json-editor-vue-gi2fewby.js";const K={p4:"",flex:"~ col gap-4"},Q={key:1,ml2:"",flex:""},W=["value"],Y={key:0,flex:"","gap-4":""},X=z({__name:"ServerRouteInputs",props:{modelValue:{},keys:{default:()=>[]},default:{default:()=>({})},disabled:{type:Boolean,default:!1}},setup(U,{emit:w}){const g=U,d=O(g,"modelValue",w,{passive:!0}),_=N(()=>[...g.keys,"active","key","value","type"]),B=N(()=>{const l={};for(const e of _.value)l[e]=g.default[e]||"";return l}),D=["string","number","boolean","file","date","time","datetime-local"];function F(l,e){const t=e.target;if(t.files&&t.files[0]){const i=t.files[0],f=new FileReader;f.readAsDataURL(i),f.onload=()=>{d.value[l].value=f.result}}}return L(()=>d,l=>{l.value.forEach(e=>{if(e.type==="number"&&typeof e.value!="number"){const t=Number.parseFloat(e.value);e.value=Number.isNaN(t)?0:t}else e.type==="boolean"&&typeof e.value!="boolean"?e.value=!0:e.type==="file"&&typeof e.value!="object"?e.value="":e.type==="date"&&typeof e.value=="string"&&!e.value.match(/^\d{4}-\d{2}-\d{2}$/)?e.value=new Date().toISOString().slice(0,10):e.type==="time"&&typeof e.value=="string"&&!e.value.match(/^\d{2}:\d{2}$/)?e.value=new Date().toISOString().slice(11,16):e.type==="datetime-local"&&typeof e.value=="string"&&!e.value.match(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}$/)?e.value=new Date().toISOString().slice(0,16):e.type==="string"&&(e.value=e.value.toString())})},{deep:!0,immediate:!0,flush:"sync"}),(l,e)=>{const t=j,i=R,f=E,I=T,k=A;return s(),u("div",K,[(s(!0),u(c,null,h(r(d),(a,$)=>(s(),u("div",{key:$,flex:"~ gap-2","justify-around":""},[v(l.$slots,"input",{item:a}),(s(!0),u(c,null,h(_.value,n=>(s(),u(c,{key:n},[a.type!==null&&n==="active"?(s(),p(t,{key:0,modelValue:a[n],"onUpdate:modelValue":o=>a[n]=o,n:"sm primary",disabled:l.disabled},null,8,["modelValue","onUpdate:modelValue","disabled"])):m("",!0),a.type!==null&&n==="key"?(s(),p(i,{key:1,modelValue:a[n],"onUpdate:modelValue":o=>a[n]=o,placeholder:n,"flex-1":"","font-mono":"",n:"sm primary",disabled:l.disabled,class:b(l.disabled?"op50":"")},null,8,["modelValue","onUpdate:modelValue","placeholder","disabled","class"])):n==="value"?(s(),u(c,{key:2},[a.type==="file"?(s(),p(i,{key:0,type:"file",disabled:l.disabled,class:b(l.disabled?"op75":""),onChange:o=>F($,o)},null,8,["disabled","class","onChange"])):a.type==="boolean"?(s(),u("div",Q,[y(t,{modelValue:a.value,"onUpdate:modelValue":o=>a.value=o,placeholder:"Value",n:"green lg",disabled:l.disabled},null,8,["modelValue","onUpdate:modelValue","disabled"])])):(s(),p(i,{key:2,modelValue:a.value,"onUpdate:modelValue":o=>a.value=o,type:a.type,placeholder:"Value","flex-1":"","font-mono":"",n:"sm primary",disabled:l.disabled,class:b(l.disabled?"op75":"")},null,8,["modelValue","onUpdate:modelValue","type","disabled","class"]))],64)):n==="type"?(s(),p(f,{key:3,modelValue:a.type,"onUpdate:modelValue":o=>a.type=o,n:"sm green",class:b(l.disabled?"op75":""),disabled:l.disabled},{default:V(()=>[(s(),u(c,null,h(D,o=>C("option",{key:o,value:o},M(o),9,W)),64))]),_:2},1032,["modelValue","onUpdate:modelValue","class","disabled"])):m("",!0)],64))),128)),v(l.$slots,"input-actions",{},()=>[y(k,{n:"red",disabled:l.disabled,class:b(l.disabled?"op0!":""),onClick:n=>r(d).splice($,1)},{default:V(()=>[y(I,{icon:"carbon:trash-can"})]),_:2},1032,["disabled","class","onClick"])])]))),128)),l.disabled?m("",!0):(s(),u("div",Y,[v(l.$slots,"actions",{params:r(d)},()=>[y(k,{icon:"carbon-add",n:"sm primary",my1:"","px-3":"",onClick:e[0]||(e[0]=a=>r(d).push({...B.value}))},{default:V(()=>e[2]||(e[2]=[S(" Add ")])),_:1}),e[4]||(e[4]=C("div",{"flex-auto":""},null,-1)),r(d).length?(s(),p(k,{key:0,icon:"carbon-trash-can",n:"sm red",my1:"","px-3":"",onClick:e[1]||(e[1]=a=>r(d).splice(0,r(d).length))},{default:V(()=>e[3]||(e[3]=[S(" Remove All ")])),_:1})):m("",!0)])])),v(l.$slots,"default")])}}});export{X as _};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b4 as $e,b5 as le,D as Ee,b6 as Ge,b7 as Ke,P as Qe,H as Xe,X as Ye,J as Ze,b as De,ag as et,b8 as tt,I as ot,q as nt,e as Re,v as at,c as Ve,az as st,b9 as lt,M as rt,p as it,T as ut}from"./b6bfxrb8.js";import{_ as dt}from"./nnavbar.vue-d5x8tq5w.js";import{_ as je}from"./nbadge-fktngirm.js";import{k as ye,b as L,Q as r,S as k,U as i,Y as M,M as $,u as b,a5 as U,W as P,a6 as K,X as ct,V as pt,F as N,ab as J,B as me,c as Ie,g as Ue,C as ft,n as vt,r as ve,l as V,w as mt,ae as Oe,$ as C,a0 as v,a8 as Z,a1 as yt,av as ht,K as gt}from"./vendor/json-editor-vue-gi2fewby.js";import{_ as bt}from"./nselect.vue-mkp3umn0.js";import{_ as Ne}from"./server-route-inputs.vue-dfs3eezs.js";import{_ as _t}from"./code-snippets.vue-i4e657wf.js";import{_ as kt}from"./ncode-block.vue-gy1ero5j.js";import{d as wt}from"./vendor/unocss-3uirpnla.js";import{C as xe,S as Le}from"./constants-b32h69zq.js";import{_ as xt}from"./nsection-block-ivkmhmn9.js";import{_ as Ct}from"./ndrawer.vue-cjxfdzsk.js";import"./vendor/shiki-bnvxb5wv.js";import"./ncheckbox.vue-fs1yhvat.js";import"./client-c9f80qsp.js";import"./nicon-title.vue-ouqsubn7.js";function St(e,l){if(typeof e!="string")throw new TypeError("argument str must be a string");const n={},o=l||{},y=o.decode||Tt;let f=0;for(;f<e.length;){const d=e.indexOf("=",f);if(d===-1)break;let m=e.indexOf(";",f);if(m===-1)m=e.length;else if(m<d){f=e.lastIndexOf(";",d-1)+1;continue}const g=e.slice(f,d).trim();if(o?.filter&&!o?.filter(g)){f=m+1;continue}if(n[g]===void 0){let u=e.slice(d+1,m).trim();u.codePointAt(0)===34&&(u=u.slice(1,-1)),n[g]=$t(u,y)}f=m+1}return n}function Tt(e){return e.includes("%")?decodeURIComponent(e):e}function $t(e,l){try{return l(e)}catch{return e}}const ae=/^[\u0009\u0020-\u007E\u0080-\u00FF]+$/;function Ce(e,l,n){const o=n||{},y=o.encode||encodeURIComponent;if(typeof y!="function")throw new TypeError("option encode is invalid");if(!ae.test(e))throw new TypeError("argument name is invalid");const f=y(l);if(f&&!ae.test(f))throw new TypeError("argument val is invalid");let d=e+"="+f;if(o.maxAge!==void 0&&o.maxAge!==null){const m=o.maxAge-0;if(Number.isNaN(m)||!Number.isFinite(m))throw new TypeError("option maxAge is invalid");d+="; Max-Age="+Math.floor(m)}if(o.domain){if(!ae.test(o.domain))throw new TypeError("option domain is invalid");d+="; Domain="+o.domain}if(o.path){if(!ae.test(o.path))throw new TypeError("option path is invalid");d+="; Path="+o.path}if(o.expires){if(!Et(o.expires)||Number.isNaN(o.expires.valueOf()))throw new TypeError("option expires is invalid");d+="; Expires="+o.expires.toUTCString()}if(o.httpOnly&&(d+="; HttpOnly"),o.secure&&(d+="; Secure"),o.priority)switch(typeof o.priority=="string"?o.priority.toLowerCase():o.priority){case"low":{d+="; Priority=Low";break}case"medium":{d+="; Priority=Medium";break}case"high":{d+="; 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:{d+="; SameSite=Strict";break}case"lax":{d+="; SameSite=Lax";break}case"strict":{d+="; SameSite=Strict";break}case"none":{d+="; SameSite=None";break}default:throw new TypeError("option sameSite is invalid")}return o.partitioned&&(d+="; Partitioned"),d}function Et(e){return Object.prototype.toString.call(e)==="[object Date]"||e instanceof Date}const Pe=ye({__name:"ServerRouteListItem",props:{item:{},index:{default:0}},setup(e){const l=L(!0),n=$e();return(o,y)=>{const f=Ee,d=je,m=Pe;return r(),k("div",null,[i("button",{flex:"~ gap-2","w-full":"","items-start":"","items-center":"","hover-bg-active":"",px2:"",py1:"",class:M([{"bg-active":b(n)===o.item.filepath}]),style:ct({paddingLeft:`calc(0.5rem + ${o.index*1.5}em)`}),onClick:y[0]||(y[0]=g=>{l.value=!l.value,n.value=o.item.filepath})},[i("div",{class:M({"w-12":!o.item.routes}),"flex-none":"","text-left":""},[o.item.type==="collection"?(r(),$(f,{key:0,icon:"carbon:chevron-right","mb0.5":"","transform-rotate":l.value?90:0,transition:""},null,8,["transform-rotate"])):(r(),$(d,{key:1,class:M(b(le)(o.item.method||"*")),textContent:U((o.item.method||"*").toUpperCase())},null,8,["class","textContent"]))],2),i("span",{class:M({"flex items-center":o.item.routes}),"text-sm":"","font-mono":""},[o.item.type==="collection"?(r(),$(f,{key:0,title:`${o.item.routes?.length} routes`,icon:"carbon:folder",mr1:""},null,8,["title"])):P("",!0),K(" "+U(o.item.route),1)],2)],6),y[1]||(y[1]=i("div",{"x-divider":""},null,-1)),l.value?pt(o.$slots,"default",{key:0},()=>[(r(!0),k(N,null,J(o.item.routes,g=>(r(),$(m,{key:g.filepath,item:g,index:o.index+1},null,8,["item","index"]))),128))]):P("",!0)])}}});function B(e){if(typeof e!="object")return e;var l,n,o=Object.prototype.toString.call(e);if(o==="[object Object]"){if(e.constructor!==Object&&typeof e.constructor=="function"){n=new e.constructor;for(l in e)e.hasOwnProperty(l)&&n[l]!==e[l]&&(n[l]=B(e[l]))}else{n={};for(l in e)l==="__proto__"?Object.defineProperty(n,l,{value:B(e[l]),configurable:!0,enumerable:!0,writable:!0}):n[l]=B(e[l])}return n}if(o==="[object Array]"){for(l=e.length,n=Array(l);l--;)n[l]=B(e[l]);return n}return o==="[object Set]"?(n=new Set,e.forEach(function(y){n.add(B(y))}),n):o==="[object Map]"?(n=new Map,e.forEach(function(y,f){n.set(B(f),B(y))}),n):o==="[object Date]"?new Date(+e):o==="[object RegExp]"?(n=new RegExp(e.source,e.flags),n.lastIndex=e.lastIndex,n):o==="[object DataView]"?new e.constructor(B(e.buffer)):o==="[object ArrayBuffer]"?e.slice(0):o.slice(-6)==="Array]"?new e.constructor(e):e}const Dt={path:"/",watch:!0,decode:e=>wt(decodeURIComponent(e)),encode:e=>encodeURIComponent(typeof e=="string"?e:JSON.stringify(e))},se=window.cookieStore;function Rt(e,l){const n={...Dt,...l};n.filter??=g=>g===e;const o=Se(n)||{};let y;n.maxAge!==void 0?y=n.maxAge*1e3:n.expires&&(y=n.expires.getTime()-Date.now());const f=y!==void 0&&y<=0,d=B(f?void 0:o[e]??n.default?.()),m=y&&!f?It(d,y,n.watch&&n.watch!=="shallow"):L(d);{let g=null;try{!se&&typeof BroadcastChannel<"u"&&(g=new BroadcastChannel(`nuxt:cookies:${e}`))}catch{}const u=()=>{n.readonly||Ge(m.value,o[e])||(jt(e,m.value,n),o[e]=B(m.value),g?.postMessage({value:n.encode(m.value)}))},E=A=>{const S=A.refresh?Se(n)?.[e]:n.decode(A.value);I=!0,m.value=S,o[e]=B(S),vt(()=>{I=!1})};let I=!1;const F=!!Ue();if(F&&me(()=>{I=!0,u(),g?.close()}),se){const A=S=>{const _=S.changed.find(h=>h.name===e),O=S.deleted.find(h=>h.name===e);_&&E({value:_.value}),O&&E({value:null})};se.addEventListener("change",A),F&&me(()=>se.removeEventListener("change",A))}else g&&(g.onmessage=({data:A})=>E(A));n.watch?Ie(m,()=>{I||u()},{deep:n.watch!=="shallow"}):u()}return m}function Se(e={}){return St(document.cookie,e)}function Vt(e,l,n={}){return l==null?Ce(e,l,{...n,maxAge:-1}):Ce(e,l,n)}function jt(e,l,n={}){document.cookie=Vt(e,l,n)}const Te=2147483647;function It(e,l,n){let o,y,f=0;const d=n?L(e):{value:e};return Ue()&&me(()=>{y?.(),clearTimeout(o)}),ft((m,g)=>{n&&(y=Ie(d,g));function u(){f=0,clearTimeout(o);const E=l-f,I=E<Te?E:Te;o=setTimeout(()=>{if(f+=I,f<l)return u();d.value=void 0,g()},I)}return{get(){return m(),d.value},set(E){u(),d.value=E,g()}}})}const Ut={"h-full":"","w-full":"",flex:"~ col"},Ot={flex:"~ col gap-2","flex-none":"",p4:"","n-navbar-glass":""},Nt={flex:"~ gap2 items-center"},Lt={relative:"","w-full":""},Pt={absolute:"","right-2":"","top-1.5":"",flex:"~ gap-1"},At={flex:"~ gap2 wrap","w-full":"","items-center":"",px4:"",pb2:"","text-center":"","text-sm":"",border:"b base"},Bt={class:"hidden md:block"},qt={key:0,border:"b base","items-center":"",px4:"",py2:"",grid:"~ cols-[max-content_1fr] gap-2"},Mt={"text-right":"","font-mono":""},Ft={key:1,border:"b base",p4:"",flex:"~ col gap-4","font-mono":""},Ht={flex:"~ gap-4"},zt={flex:"~ gap2","mb--2":"","items-center":"",op50:""},Jt={key:2},Wt={key:3,border:"b base",relative:"","n-code-block":""},Gt={flex:"~ wrap","w-full":""},Kt=["onClick"],Qt={border:"b base",flex:"~ gap2","items-center":"",px4:"",py2:""},Xt={key:1,"text-xs":"",op50:""},Yt={key:0,"flex-auto":"","overflow-auto":""},Zt={border:"~ base","h-full":"","w-full":"",rounded:""},eo=["data"],to={key:2,"flex-auto":"","overflow-auto":"",p4:""},oo={border:"~ base",rounded:""},no=["src"],ao={key:1,controls:"",rounded:""},so=["src"],lo=ye({__name:"ServerRouteDetails",props:{route:{}},emits:["openDefaultInput"],setup(e,{emit:l}){const n=e,o=l,[y,f]=Ke(),d=Qe(),m=Xe(),g=Ye(),u=ve({contentType:"text/plain",data:"",statusCode:200,error:void 0,fetchTime:0}),E=V(()=>u.contentType.includes("application/json")?"json":u.contentType.includes("text/html")?"html":u.contentType.includes("text/css")?"css":u.contentType.includes("text/javascript")?"javascript":u.contentType.includes("image")||u.contentType.includes("video")?"media":u.contentType.includes("text/xml")||u.contentType.includes("application/xml")?"xml":u.contentType.includes("application/pdf")?"pdf":"text"),I=V(()=>{if(E.value==="json")return JSON.stringify(u.data,null,2);if(E.value==="media"||E.value==="pdf"){const a=new Blob([u.data],{type:u.contentType});return URL.createObjectURL(a)}return u.data}),F=L(!1),A=L(!1),S=Ze(),_=V(()=>n.route.route?.split(/((?:\*\*)?:\w+)/g)),O=V(()=>_.value?.filter(a=>a.startsWith(":")||a.startsWith("**:"))||[]),h=L(n.route.method||"GET"),D=L({}),w=ve({query:[{active:!0,key:"",value:"",type:"string"}],body:[{active:!0,key:"",value:"",type:"string"}],headers:[{active:!0,key:"Content-Type",value:"application/json",type:"string"}]}),j=L({}),{inputDefaults:x,sendFrom:H}=De("serverRoutes"),Q=V(()=>g?.value?.app?.$fetch?H.value:"devtools"),re=["GET","POST","PUT","PATCH","DELETE","HEAD"],ie=["PATCH","POST","PUT","DELETE"],ee=V(()=>ie.includes(h.value.toUpperCase())),c=L(),te=["input","json"],W=L(te[0]),ue=V({get:()=>w[c.value],set:a=>{w[c.value]=a}}),he=V(()=>({...G(x.value.query),...G(w.query)})),ge=V(()=>({...G(x.value.headers),...G(w.headers)})),de=V(()=>ee.value?W.value==="json"?{...G(x.value.body),...j.value}:{...G(x.value.body),...G(w.body)}:void 0),Ae=V(()=>{let a=window?.location.origin;return a.charAt(a.length-1)==="/"&&(a=a.slice(0,-1)),a}),oe=V(()=>{let a=new URLSearchParams(he.value).toString();a&&(a=`?${a}`);const t=(_.value?.map(R=>(R.startsWith(":")||R.startsWith("**:"))&&D.value[R]||R).join("")||"")+a;let p=m.value?.app.baseURL||"";return(p==="./"||p===".")&&(p=""),p.endsWith("/")&&(p=p.slice(0,-1)),p+t}),be=V(()=>Ae.value+oe.value);function G(a){const t=Object.fromEntries(a.filter(({active:p,key:R,value:T})=>p&&R&&T!==void 0).map(({key:p,value:R})=>[p,R]));return Object.entries(t).length?t:void 0}async function _e(){A.value=!0,F.value=!0;const a=Date.now(),t=Q.value==="app"?g.value.app.$fetch:$fetch;nt("server-routes:fetch",{method:h.value,sendFrom:Q.value});try{u.data=await t(be.value,{method:h.value.toUpperCase(),headers:ge.value,query:he.value,body:de.value,onResponse({response:p}){u.contentType=(p.headers.get("content-type")||"").toString().toLowerCase().trim(),u.statusCode=p.status,u.error=void 0},onResponseError(p){u.error=p.response._data,u.data=p.response._data}})}catch{}F.value=!1,u.fetchTime=Date.now()-a}const ke=V(()=>{const a=[],t=[],p=Object.entries(ge.value).filter(([T,q])=>T&&q&&!(T==="Content-Type"&&q==="application/json")).map(([T,q])=>` '${T}': '${q}'`).join(`,
|
|
1
|
+
import{a_ as $e,a$ as le,E as Ee,b0 as Ge,b1 as Ke,Q as Qe,I as Xe,b as Ye,K as Ze,c as De,ag as et,b2 as tt,J as ot,s as nt,f as Re,w as at,d as Ve,az as st,b3 as lt,N as rt,q as it,U as ut}from"./oqehn934.js";import{_ as dt}from"./nnavbar.vue-f0vufq5s.js";import{_ as je}from"./nbadge-ixgsh96g.js";import{k as ye,b as L,Q as r,S as k,U as i,Y as M,M as $,u as b,a5 as U,W as P,a6 as K,X as ct,V as pt,F as O,ab as J,B as me,c as Ie,g as Ue,C as ft,n as vt,r as ve,l as V,w as mt,ae as Ne,$ as C,a0 as v,a8 as Z,a1 as yt,av as ht,K as gt}from"./vendor/json-editor-vue-gi2fewby.js";import{_ as bt}from"./nselect.vue-mgxbszb3.js";import{_ as Oe}from"./server-route-inputs.vue-c9toxo7z.js";import{_ as _t}from"./code-snippets.vue-hvapgodh.js";import{_ as kt}from"./ncode-block.vue-gy1ero5j.js";import{d as wt}from"./vendor/unocss-fae7bffg.js";import{C as xe,S as Le}from"./constants-b32h69zq.js";import{_ as xt}from"./nsection-block-lalufadl.js";import{_ as Ct}from"./ndrawer.vue-oeawm3h0.js";import"./vendor/shiki-bnvxb5wv.js";import"./ncheckbox.vue-ktnsaj70.js";import"./client-c9f80qsp.js";import"./nicon-title.vue-ouqsubn7.js";function St(e,l){if(typeof e!="string")throw new TypeError("argument str must be a string");const n={},o=l||{},y=o.decode||Tt;let f=0;for(;f<e.length;){const d=e.indexOf("=",f);if(d===-1)break;let m=e.indexOf(";",f);if(m===-1)m=e.length;else if(m<d){f=e.lastIndexOf(";",d-1)+1;continue}const g=e.slice(f,d).trim();if(o?.filter&&!o?.filter(g)){f=m+1;continue}if(n[g]===void 0){let u=e.slice(d+1,m).trim();u.codePointAt(0)===34&&(u=u.slice(1,-1)),n[g]=$t(u,y)}f=m+1}return n}function Tt(e){return e.includes("%")?decodeURIComponent(e):e}function $t(e,l){try{return l(e)}catch{return e}}const ae=/^[\u0009\u0020-\u007E\u0080-\u00FF]+$/;function Ce(e,l,n){const o=n||{},y=o.encode||encodeURIComponent;if(typeof y!="function")throw new TypeError("option encode is invalid");if(!ae.test(e))throw new TypeError("argument name is invalid");const f=y(l);if(f&&!ae.test(f))throw new TypeError("argument val is invalid");let d=e+"="+f;if(o.maxAge!==void 0&&o.maxAge!==null){const m=o.maxAge-0;if(Number.isNaN(m)||!Number.isFinite(m))throw new TypeError("option maxAge is invalid");d+="; Max-Age="+Math.floor(m)}if(o.domain){if(!ae.test(o.domain))throw new TypeError("option domain is invalid");d+="; Domain="+o.domain}if(o.path){if(!ae.test(o.path))throw new TypeError("option path is invalid");d+="; Path="+o.path}if(o.expires){if(!Et(o.expires)||Number.isNaN(o.expires.valueOf()))throw new TypeError("option expires is invalid");d+="; Expires="+o.expires.toUTCString()}if(o.httpOnly&&(d+="; HttpOnly"),o.secure&&(d+="; Secure"),o.priority)switch(typeof o.priority=="string"?o.priority.toLowerCase():o.priority){case"low":{d+="; Priority=Low";break}case"medium":{d+="; Priority=Medium";break}case"high":{d+="; 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:{d+="; SameSite=Strict";break}case"lax":{d+="; SameSite=Lax";break}case"strict":{d+="; SameSite=Strict";break}case"none":{d+="; SameSite=None";break}default:throw new TypeError("option sameSite is invalid")}return o.partitioned&&(d+="; Partitioned"),d}function Et(e){return Object.prototype.toString.call(e)==="[object Date]"||e instanceof Date}const Pe=ye({__name:"ServerRouteListItem",props:{item:{},index:{default:0}},setup(e){const l=L(!0),n=$e();return(o,y)=>{const f=Ee,d=je,m=Pe;return r(),k("div",null,[i("button",{flex:"~ gap-2","w-full":"","items-start":"","items-center":"","hover-bg-active":"",px2:"",py1:"",class:M([{"bg-active":b(n)===o.item.filepath}]),style:ct({paddingLeft:`calc(0.5rem + ${o.index*1.5}em)`}),onClick:y[0]||(y[0]=g=>{l.value=!l.value,n.value=o.item.filepath})},[i("div",{class:M({"w-12":!o.item.routes}),"flex-none":"","text-left":""},[o.item.type==="collection"?(r(),$(f,{key:0,icon:"carbon:chevron-right","mb0.5":"","transform-rotate":l.value?90:0,transition:""},null,8,["transform-rotate"])):(r(),$(d,{key:1,class:M(b(le)(o.item.method||"*")),textContent:U((o.item.method||"*").toUpperCase())},null,8,["class","textContent"]))],2),i("span",{class:M({"flex items-center":o.item.routes}),"text-sm":"","font-mono":""},[o.item.type==="collection"?(r(),$(f,{key:0,title:`${o.item.routes?.length} routes`,icon:"carbon:folder",mr1:""},null,8,["title"])):P("",!0),K(" "+U(o.item.route),1)],2)],6),y[1]||(y[1]=i("div",{"x-divider":""},null,-1)),l.value?pt(o.$slots,"default",{key:0},()=>[(r(!0),k(O,null,J(o.item.routes,g=>(r(),$(m,{key:g.filepath,item:g,index:o.index+1},null,8,["item","index"]))),128))]):P("",!0)])}}});function B(e){if(typeof e!="object")return e;var l,n,o=Object.prototype.toString.call(e);if(o==="[object Object]"){if(e.constructor!==Object&&typeof e.constructor=="function"){n=new e.constructor;for(l in e)e.hasOwnProperty(l)&&n[l]!==e[l]&&(n[l]=B(e[l]))}else{n={};for(l in e)l==="__proto__"?Object.defineProperty(n,l,{value:B(e[l]),configurable:!0,enumerable:!0,writable:!0}):n[l]=B(e[l])}return n}if(o==="[object Array]"){for(l=e.length,n=Array(l);l--;)n[l]=B(e[l]);return n}return o==="[object Set]"?(n=new Set,e.forEach(function(y){n.add(B(y))}),n):o==="[object Map]"?(n=new Map,e.forEach(function(y,f){n.set(B(f),B(y))}),n):o==="[object Date]"?new Date(+e):o==="[object RegExp]"?(n=new RegExp(e.source,e.flags),n.lastIndex=e.lastIndex,n):o==="[object DataView]"?new e.constructor(B(e.buffer)):o==="[object ArrayBuffer]"?e.slice(0):o.slice(-6)==="Array]"?new e.constructor(e):e}const Dt={path:"/",watch:!0,decode:e=>wt(decodeURIComponent(e)),encode:e=>encodeURIComponent(typeof e=="string"?e:JSON.stringify(e))},se=window.cookieStore;function Rt(e,l){const n={...Dt,...l};n.filter??=g=>g===e;const o=Se(n)||{};let y;n.maxAge!==void 0?y=n.maxAge*1e3:n.expires&&(y=n.expires.getTime()-Date.now());const f=y!==void 0&&y<=0,d=B(f?void 0:o[e]??n.default?.()),m=y&&!f?It(d,y,n.watch&&n.watch!=="shallow"):L(d);{let g=null;try{!se&&typeof BroadcastChannel<"u"&&(g=new BroadcastChannel(`nuxt:cookies:${e}`))}catch{}const u=()=>{n.readonly||Ge(m.value,o[e])||(jt(e,m.value,n),o[e]=B(m.value),g?.postMessage({value:n.encode(m.value)}))},E=A=>{const S=A.refresh?Se(n)?.[e]:n.decode(A.value);I=!0,m.value=S,o[e]=B(S),vt(()=>{I=!1})};let I=!1;const F=!!Ue();if(F&&me(()=>{I=!0,u(),g?.close()}),se){const A=S=>{const _=S.changed.find(h=>h.name===e),N=S.deleted.find(h=>h.name===e);_&&E({value:_.value}),N&&E({value:null})};se.addEventListener("change",A),F&&me(()=>se.removeEventListener("change",A))}else g&&(g.onmessage=({data:A})=>E(A));n.watch?Ie(m,()=>{I||u()},{deep:n.watch!=="shallow"}):u()}return m}function Se(e={}){return St(document.cookie,e)}function Vt(e,l,n={}){return l==null?Ce(e,l,{...n,maxAge:-1}):Ce(e,l,n)}function jt(e,l,n={}){document.cookie=Vt(e,l,n)}const Te=2147483647;function It(e,l,n){let o,y,f=0;const d=n?L(e):{value:e};return Ue()&&me(()=>{y?.(),clearTimeout(o)}),ft((m,g)=>{n&&(y=Ie(d,g));function u(){f=0,clearTimeout(o);const E=l-f,I=E<Te?E:Te;o=setTimeout(()=>{if(f+=I,f<l)return u();d.value=void 0,g()},I)}return{get(){return m(),d.value},set(E){u(),d.value=E,g()}}})}const Ut={"h-full":"","w-full":"",flex:"~ col"},Nt={flex:"~ col gap-2","flex-none":"",p4:"","n-navbar-glass":""},Ot={flex:"~ gap2 items-center"},Lt={relative:"","w-full":""},Pt={absolute:"","right-2":"","top-1.5":"",flex:"~ gap-1"},At={flex:"~ gap2 wrap","w-full":"","items-center":"",px4:"",pb2:"","text-center":"","text-sm":"",border:"b base"},Bt={class:"hidden md:block"},qt={key:0,border:"b base","items-center":"",px4:"",py2:"",grid:"~ cols-[max-content_1fr] gap-2"},Mt={"text-right":"","font-mono":""},Ft={key:1,border:"b base",p4:"",flex:"~ col gap-4","font-mono":""},zt={flex:"~ gap-4"},Ht={flex:"~ gap2","mb--2":"","items-center":"",op50:""},Jt={key:2},Wt={key:3,border:"b base",relative:"","n-code-block":""},Gt={flex:"~ wrap","w-full":""},Kt=["onClick"],Qt={border:"b base",flex:"~ gap2","items-center":"",px4:"",py2:""},Xt={key:1,"text-xs":"",op50:""},Yt={key:0,"flex-auto":"","overflow-auto":""},Zt={border:"~ base","h-full":"","w-full":"",rounded:""},eo=["data"],to={key:2,"flex-auto":"","overflow-auto":"",p4:""},oo={border:"~ base",rounded:""},no=["src"],ao={key:1,controls:"",rounded:""},so=["src"],lo=ye({__name:"ServerRouteDetails",props:{route:{}},emits:["openDefaultInput"],setup(e,{emit:l}){const n=e,o=l,[y,f]=Ke(),d=Qe(),m=Xe(),g=Ye(),u=ve({contentType:"text/plain",data:"",statusCode:200,error:void 0,fetchTime:0}),E=V(()=>u.contentType.includes("application/json")?"json":u.contentType.includes("text/html")?"html":u.contentType.includes("text/css")?"css":u.contentType.includes("text/javascript")?"javascript":u.contentType.includes("image")||u.contentType.includes("video")?"media":u.contentType.includes("text/xml")||u.contentType.includes("application/xml")?"xml":u.contentType.includes("application/pdf")?"pdf":"text"),I=V(()=>{if(E.value==="json")return JSON.stringify(u.data,null,2);if(E.value==="media"||E.value==="pdf"){const a=new Blob([u.data],{type:u.contentType});return URL.createObjectURL(a)}return u.data}),F=L(!1),A=L(!1),S=Ze(),_=V(()=>n.route.route?.split(/((?:\*\*)?:\w+)/g)),N=V(()=>_.value?.filter(a=>a.startsWith(":")||a.startsWith("**:"))||[]),h=L(n.route.method||"GET"),D=L({}),w=ve({query:[{active:!0,key:"",value:"",type:"string"}],body:[{active:!0,key:"",value:"",type:"string"}],headers:[{active:!0,key:"Content-Type",value:"application/json",type:"string"}]}),j=L({}),{inputDefaults:x,sendFrom:z}=De("serverRoutes"),Q=V(()=>g?.value?.app?.$fetch?z.value:"devtools"),re=["GET","POST","PUT","PATCH","DELETE","HEAD"],ie=["PATCH","POST","PUT","DELETE"],ee=V(()=>ie.includes(h.value.toUpperCase())),c=L(),te=["input","json"],W=L(te[0]),ue=V({get:()=>w[c.value],set:a=>{w[c.value]=a}}),he=V(()=>({...G(x.value.query),...G(w.query)})),ge=V(()=>({...G(x.value.headers),...G(w.headers)})),de=V(()=>ee.value?W.value==="json"?{...G(x.value.body),...j.value}:{...G(x.value.body),...G(w.body)}:void 0),Ae=V(()=>{let a=window?.location.origin;return a.charAt(a.length-1)==="/"&&(a=a.slice(0,-1)),a}),oe=V(()=>{let a=new URLSearchParams(he.value).toString();a&&(a=`?${a}`);const t=(_.value?.map(R=>(R.startsWith(":")||R.startsWith("**:"))&&D.value[R]||R).join("")||"")+a;let p=m.value?.app.baseURL||"";return(p==="./"||p===".")&&(p=""),p.endsWith("/")&&(p=p.slice(0,-1)),p+t}),be=V(()=>Ae.value+oe.value);function G(a){const t=Object.fromEntries(a.filter(({active:p,key:R,value:T})=>p&&R&&T!==void 0).map(({key:p,value:R})=>[p,R]));return Object.entries(t).length?t:void 0}async function _e(){A.value=!0,F.value=!0;const a=Date.now(),t=Q.value==="app"?g.value.app.$fetch:$fetch;nt("server-routes:fetch",{method:h.value,sendFrom:Q.value});try{u.data=await t(be.value,{method:h.value.toUpperCase(),headers:ge.value,query:he.value,body:de.value,onResponse({response:p}){u.contentType=(p.headers.get("content-type")||"").toString().toLowerCase().trim(),u.statusCode=p.status,u.error=void 0},onResponseError(p){u.error=p.response._data,u.data=p.response._data}})}catch{}F.value=!1,u.fetchTime=Date.now()-a}const ke=V(()=>{const a=[],t=[],p=Object.entries(ge.value).filter(([T,q])=>T&&q&&!(T==="Content-Type"&&q==="application/json")).map(([T,q])=>` '${T}': '${q}'`).join(`,
|
|
2
2
|
`);h.value.toUpperCase()!=="GET"&&t.push(`method: '${h.value.toUpperCase()}'`),p&&t.push(`headers: {
|
|
3
3
|
${p}
|
|
4
4
|
}`),de.value&&t.push(`body: ${JSON.stringify(de.value,null,2)}`);const R=t.length?`, {
|
|
@@ -6,4 +6,4 @@ ${t.join(`,
|
|
|
6
6
|
`).split(`
|
|
7
7
|
`).map(T=>` ${T}`).join(`
|
|
8
8
|
`)}
|
|
9
|
-
}`:"";return a.push({name:"useFetch",lang:"javascript",docs:xe.nuxt.useFetch,code:`const { data, pending, error, refresh } = useFetch('${oe.value}'${R})`}),a.push({name:"$fetch",lang:"javascript",docs:xe.nuxt.$fetch,code:`await $fetch('${oe.value}'${R})`}),a}),X=L(qe()),z=ve({key:"",value:""}),Be=V(()=>{const a=[];return O.value.length&&a.push({name:"Params",slug:"params",length:O.value.length}),a.push({name:"Query",slug:"query",length:w.query.length}),ee.value&&a.push({name:"Body",slug:"body",length:w.body.length}),a.push({name:"Headers",slug:"headers",length:w.headers.length}),a.push({name:"Cookies",slug:"cookies",length:X.value.length}),a.push({name:"Snippets",slug:"snippet"}),a});function qe(){return document.cookie.split("; ").map(a=>{const[t,p]=a.split("=");return{key:t,value:p}}).filter(a=>a.key)}function ce(a,t){if(!a)return;const p=X.value.find(T=>T.key===a),R=Rt(a);p!==void 0?t===void 0&&(X.value=X.value.filter(T=>T.key!==a)):(X.value.push({key:a,value:t}),z.key="",z.value=""),R.value=t}mt(()=>{W.value==="json"&&typeof j.value=="string"&&(j.value=JSON.parse(j.value))});const pe=et("nuxt-devtools:server-routes:inputs",()=>[],{window:window.parent});tt([w,c],()=>{const a=pe.value?.find(t=>t.path===n.route.filepath);if(a){c.value||(c.value=a.tab),a.tab!==c.value&&(a.tab=c.value);const{body:t,query:p,headers:R,params:T}=a.inputs;Object.assign(w,{body:t,query:p,headers:R}),D.value=T}else{const t={path:n.route.filepath,tab:O.value.length?"params":"query",inputs:{...w,...O.value.length?{params:D.value}:{}}};pe.value.push(t),c.value||(c.value=t.tab)}},{immediate:!0,deep:!0,debounce:500});function Me(){pe.value=[],w.body=[],w.query=[],w.headers=[],D.value={},c.value=O.value.length?"params":"query"}const Fe=ot();return(a,t)=>{const p=Re,R=bt,T=at,q=Ee,we=Ne,He=_t,ze=Ve,Je=st,fe=je,We=kt,ne=Oe("tooltip");return r(),k("div",Ut,[i("div",Ot,[i("div",Nt,[a.route.method?(r(),$(p,{key:0,class:M(["n-badge-base n-sm",b(le)(h.value)]),"pointer-events-none":"","font-mono":"",tabindex:"-1"},{default:C(()=>[K(U(h.value.toUpperCase()),1)]),_:1},8,["class"])):(r(),$(R,{key:1,modelValue:h.value,"onUpdate:modelValue":t[0]||(t[0]=s=>h.value=s),class:M(["n-badge-base n-sm",b(le)(h.value)])},{default:C(()=>[(r(),k(N,null,J(re,s=>i("option",{key:s,class:M(b(le)(s))},U(s.toUpperCase()),3)),64))]),_:1},8,["modelValue","class"])),i("div",Lt,[v(T,{"model-value":oe.value,readonly:"","flex-auto":"","font-mono":"",p:"x5 y2",n:"sm"},null,8,["model-value"]),i("div",Pt,[Z(v(p,{title:"Copy URL",n:"xs blue",icon:"carbon:copy",border:!1,onClick:t[1]||(t[1]=s=>b(Fe)(be.value,"server-route-url"))},null,512),[[ne,"Copy URL"]]),Z(v(p,{title:"Open in Editor",icon:"carbon-launch",n:"xs blue",border:!1,onClick:t[2]||(t[2]=s=>b(S)(a.route.filepath))},null,512),[[ne,"Open in Editor"]])])]),v(p,{"h-full":"",n:"primary solid",onClick:_e},{default:C(()=>[v(q,{icon:"carbon:send"})]),_:1})])]),i("div",At,[(r(!0),k(N,null,J(Be.value,s=>Z((r(),$(p,{key:s.slug,class:M(c.value===s.slug?"text-primary n-primary":"border-transparent shadow-none"),onClick:Y=>c.value=s.slug},{default:C(()=>[v(q,{icon:b(Le)[s.slug]},null,8,["icon"]),i("div",Bt,[K(U(s.name)+" "+U(s?.length?`(${s.length})`:"")+" ",1),i("span",null,U(b(x)[s.slug]?.length?`(${b(x)[s.slug].length})`:""),1)])]),_:2},1032,["class","onClick"])),[[ne,s.name]])),128)),t[12]||(t[12]=i("div",{"flex-auto":""},null,-1)),t[13]||(t[13]=i("div",{"text-xs":"",op50:""}," Send from ",-1)),v(R,{modelValue:Q.value,"onUpdate:modelValue":t[3]||(t[3]=s=>Q.value=s),class:"n-xs",disabled:!b(g)?.app?.$fetch},{default:C(()=>t[11]||(t[11]=[i("option",{value:"app"}," App ",-1),i("option",{value:"devtools"}," DevTools ",-1)])),_:1},8,["modelValue","disabled"]),Z(v(p,{n:"orange",class:"p-3",icon:"i-carbon-clean",onClick:Me},null,512),[[ne,"Clear Inputs Saved Cache"]])]),c.value==="params"?(r(),k("div",qt,[(r(!0),k(N,null,J(O.value,s=>(r(),k(N,{key:s},[i("div",Mt,U(s),1),v(T,{modelValue:D.value[s],"onUpdate:modelValue":Y=>D.value[s]=Y,placeholder:s,"flex-1":""},null,8,["modelValue","onUpdate:modelValue","placeholder"])],64))),128))])):P("",!0),c.value==="cookies"?(r(),k("div",Ft,[(r(!0),k(N,null,J(X.value,s=>(r(),k("div",{key:s.key,flex:"~ gap-4 items-center"},[v(T,{placeholder:"Key...","model-value":s.key,disabled:"","op-70":""},null,8,["model-value"]),v(T,{placeholder:"Value...","model-value":s.value,"flex-1":"",n:"primary",onInput:Y=>ce(s.key,Y.target?.value)},null,8,["model-value","onInput"]),v(p,{title:"Delete",n:"red",onClick:Y=>ce(s.key,void 0)},{default:C(()=>[v(q,{icon:"i-carbon-trash-can"})]),_:2},1032,["onClick"])]))),128)),i("div",Ht,[v(T,{modelValue:z.key,"onUpdate:modelValue":t[4]||(t[4]=s=>z.key=s),placeholder:"Key",n:"primary","flex-1":""},null,8,["modelValue"]),v(T,{modelValue:z.value,"onUpdate:modelValue":t[5]||(t[5]=s=>z.value=s),placeholder:"Value",n:"primary","flex-1":""},null,8,["modelValue"]),v(p,{title:"Add",n:"primary",onClick:t[6]||(t[6]=s=>ce(z.key,z.value))},{default:C(()=>[v(q,{icon:"i-carbon-save"})]),_:1})])])):P("",!0),v(b(y),null,{default:C(()=>[v(we,{modelValue:ue.value,"onUpdate:modelValue":t[9]||(t[9]=s=>ue.value=s),default:{active:!0,type:"string"},"max-h-xs":"","of-auto":""},{default:C(()=>[b(x)[c.value]?.length?(r(),k(N,{key:0},[i("div",zt,[t[14]||(t[14]=i("div",{"w-5":"","x-divider":""},null,-1)),t[15]||(t[15]=i("div",{"flex-none":""}," Default Inputs ",-1)),v(p,{icon:"i-carbon-edit",border:!1,onClick:t[7]||(t[7]=s=>o("openDefaultInput"))}),t[16]||(t[16]=i("div",{"x-divider":""},null,-1))]),v(we,{modelValue:b(x)[c.value],"onUpdate:modelValue":t[8]||(t[8]=s=>b(x)[c.value]=s),disabled:"",p0:""},null,8,["modelValue"])],64)):P("",!0)]),_:1},8,["modelValue"])]),_:1}),c.value==="snippet"?(r(),k("div",Jt,[ke.value.length?(r(),$(He,{key:0,"code-snippets":ke.value},null,8,["code-snippets"])):P("",!0)])):ue.value?(r(),k("div",Wt,[c.value==="body"?(r(),k(N,{key:0},[i("div",Gt,[(r(),k(N,null,J(te,s=>i("button",{key:s,px4:"",py2:"",border:"r base",hover:"bg-active",class:M({"border-b":s!==W.value}),onClick:Y=>W.value=s},[i("div",{class:M({op30:s!==W.value}),"font-mono":""},U(s),3)],10,Kt)),64)),t[17]||(t[17]=i("div",{border:"b base","flex-auto":""},null,-1))]),W.value==="input"?(r(),$(b(f),{key:0})):W.value==="json"?(r(),$(b(ht),yt({key:1,modelValue:j.value,"onUpdate:modelValue":t[10]||(t[10]=s=>j.value=s),class:[b(d)==="dark"?"jse-theme-dark":"light","json-editor-vue of-auto text-sm outline-none"]},a.$attrs,{mode:"text","navigation-bar":!1,indentation:2,"tab-size":2}),null,16,["modelValue","class"])):P("",!0)],64)):(r(),$(b(f),{key:1}))])):P("",!0),A.value?F.value?(r(),$(Je,{key:5,"z-10":"","flex-auto":"","backdrop-blur":""},{default:C(()=>t[19]||(t[19]=[K(" Fetching... ")])),_:1})):(r(),k(N,{key:6},[i("div",Qt,[t[21]||(t[21]=i("div",null,"Response",-1)),u.error?(r(),$(fe,{key:0,n:"red"},{default:C(()=>t[20]||(t[20]=[K(" Error ")])),_:1})):P("",!0),v(fe,{n:u.error?"orange":"green",textContent:U(u.statusCode)},null,8,["n","textContent"]),u.contentType?(r(),k("code",Xt,U(u.contentType),1)):P("",!0),t[22]||(t[22]=i("div",{"flex-auto":""},null,-1)),t[23]||(t[23]=i("div",{op50:""}," Request finished in ",-1)),v(fe,{n:"green"},{default:C(()=>[K(U(u.fetchTime)+" ms ",1)]),_:1})]),E.value==="pdf"?(r(),k("div",Yt,[i("div",Zt,[i("object",{data:I.value,type:"application/pdf","flex-auto":"",width:"100%",height:"100%",rounded:""},null,8,eo)])])):E.value!=="media"?(r(),$(We,{key:1,"flex-auto":"","overflow-auto":"","py-2":"",code:I.value,lang:E.value},null,8,["code","lang"])):(r(),k("div",to,[i("div",oo,[u.contentType.includes("image")?(r(),k("img",{key:0,rounded:"",src:I.value},null,8,no)):(r(),k("video",ao,[i("source",{src:I.value,type:"video/mp4"},null,8,so)]))])]))],64)):(r(),$(ze,{key:4},{default:C(()=>[v(p,{n:"primary",onClick:_e},{default:C(()=>[v(q,{icon:"carbon:send"}),t[18]||(t[18]=K(" Send request "))]),_:1})]),_:1}))])}}}),ro={flex:"~ gap1","text-sm":""},io={key:0,op50:""},uo={op50:""},$o=ye({__name:"server-routes",setup(e){const l=L(!1),n=lt(),o=$e(),{selectedRoute:y,view:f,inputDefaults:d}=De("serverRoutes"),m=V(()=>{!o.value&&y.value&&(o.value=y.value.filepath);const S=n.value?.find(_=>_.filepath===o.value);return o.value!==y.value?.filepath&&S&&(y.value=S),S}),g=L(""),u=V(()=>new rt(n.value||[],{keys:["method","route"],shouldSort:!0})),E=V(()=>n.value?g.value?u.value.search(g.value).map(_=>_.item):n.value:[]),I=V(()=>{const S=[],_=(h,D)=>{h.routes=h.routes||[],h.routes.push(D)},O=(h,D)=>{const w=D?D.routes?.find(x=>x.route===h):S.find(x=>x.route===h);if(w)return w;const j={route:h,filepath:h.replace(/\W/g,"-").toLowerCase(),type:"collection",routes:[]};return D?_(D,j):S.push(j),j};return E.value.forEach(h=>{let D,w;const j=h.filepath.split("/"),x=j.slice(j.indexOf("server")+1);if(h.type==="runtime"){x[0]="runtime";const H=j.indexOf("dist");H!==-1&&(D=j[H-1],D&&x.splice(1,0,D))}x.length>0&&x[x.length-1].includes(".")&&x.pop(),x.forEach(H=>{w=O(H,w)}),w?_(w,h):S.push(h)}),S});function F(){f.value=f.value==="tree"?"list":"tree"}function A(S){return S.charAt(0).toUpperCase()+S.slice(1)}return(S,_)=>{const O=Re,h=dt,D=Pe,w=lo,j=ut,x=Ve,H=it,Q=Ne,re=xt,ie=Ct,ee=Oe("tooltip");return r(),k(N,null,[v(H,{"storage-key":"tab-server-routes"},{left:C(()=>[v(h,{search:g.value,"onUpdate:search":_[1]||(_[1]=c=>g.value=c),pb2:""},{actions:C(()=>[Z(v(O,{"text-lg":"",icon:b(f)==="list"?"i-carbon-list":"i-carbon-tree-view-alt",title:"Toggle view",border:!1,onClick:F},null,8,["icon"]),[[ee,"Toggle View"]]),Z(v(O,{"text-lg":"",icon:"i-carbon-cics-sit-overrides",title:"Default Inputs",border:!1,onClick:_[0]||(_[0]=c=>l.value=!l.value)},null,512),[[ee,"Default Inputs"]])]),default:C(()=>[i("div",ro,[g.value?(r(),k("span",io,U(E.value.length)+" matched · ",1)):P("",!0),i("span",uo,U(b(n)?.length)+" routes in total",1)])]),_:1},8,["search"]),(r(!0),k(N,null,J(b(f)==="tree"?I.value:E.value,c=>(r(),$(D,{key:c.filepath,item:c},null,8,["item"]))),128))]),right:C(()=>[(r(),$(gt,{max:10},[m.value?(r(),$(w,{key:m.value.filepath,route:m.value,onOpenDefaultInput:_[2]||(_[2]=c=>l.value=!0)},null,8,["route"])):P("",!0)],1024)),m.value?P("",!0):(r(),$(x,{key:0},{default:C(()=>[v(j,{px6:"",py2:""},{default:C(()=>_[5]||(_[5]=[i("span",{op75:""},"Select a route to start",-1)])),_:1})]),_:1}))]),_:1}),v(ie,{modelValue:l.value,"onUpdate:modelValue":_[3]||(_[3]=c=>l.value=c),"auto-close":"","max-w-xl":"","min-w-xl":"",onClose:_[4]||(_[4]=c=>l.value=!1)},{default:C(()=>[i("div",null,[_[6]||(_[6]=i("div",{p4:"",border:"b base"},[i("span",{"text-lg":""},"Default Inputs"),i("br"),i("span",{"text-white":"",op50:""},"Merged as default for every request in DevTools")],-1)),(r(!0),k(N,null,J(Object.keys(b(d)),c=>(r(),$(re,{key:c,text:`${A(c)} ${b(d)[c].length?`(${b(d)[c].length})`:""}`,padding:!1,icon:b(Le)[c]},{default:C(()=>[v(Q,{modelValue:b(d)[c],"onUpdate:modelValue":te=>b(d)[c]=te,py0:"",default:{active:!0,type:"string"}},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["text","icon"]))),128))])]),_:1},8,["modelValue"])],64)}}});export{$o as default};
|
|
9
|
+
}`:"";return a.push({name:"useFetch",lang:"javascript",docs:xe.nuxt.useFetch,code:`const { data, pending, error, refresh } = useFetch('${oe.value}'${R})`}),a.push({name:"$fetch",lang:"javascript",docs:xe.nuxt.$fetch,code:`await $fetch('${oe.value}'${R})`}),a}),X=L(qe()),H=ve({key:"",value:""}),Be=V(()=>{const a=[];return N.value.length&&a.push({name:"Params",slug:"params",length:N.value.length}),a.push({name:"Query",slug:"query",length:w.query.length}),ee.value&&a.push({name:"Body",slug:"body",length:w.body.length}),a.push({name:"Headers",slug:"headers",length:w.headers.length}),a.push({name:"Cookies",slug:"cookies",length:X.value.length}),a.push({name:"Snippets",slug:"snippet"}),a});function qe(){return document.cookie.split("; ").map(a=>{const[t,p]=a.split("=");return{key:t,value:p}}).filter(a=>a.key)}function ce(a,t){if(!a)return;const p=X.value.find(T=>T.key===a),R=Rt(a);p!==void 0?t===void 0&&(X.value=X.value.filter(T=>T.key!==a)):(X.value.push({key:a,value:t}),H.key="",H.value=""),R.value=t}mt(()=>{W.value==="json"&&typeof j.value=="string"&&(j.value=JSON.parse(j.value))});const pe=et("nuxt-devtools:server-routes:inputs",()=>[],{window:window.parent});tt([w,c],()=>{const a=pe.value?.find(t=>t.path===n.route.filepath);if(a){c.value||(c.value=a.tab),a.tab!==c.value&&(a.tab=c.value);const{body:t,query:p,headers:R,params:T}=a.inputs;Object.assign(w,{body:t,query:p,headers:R}),D.value=T}else{const t={path:n.route.filepath,tab:N.value.length?"params":"query",inputs:{...w,...N.value.length?{params:D.value}:{}}};pe.value.push(t),c.value||(c.value=t.tab)}},{immediate:!0,deep:!0,debounce:500});function Me(){pe.value=[],w.body=[],w.query=[],w.headers=[],D.value={},c.value=N.value.length?"params":"query"}const Fe=ot();return(a,t)=>{const p=Re,R=bt,T=at,q=Ee,we=Oe,ze=_t,He=Ve,Je=st,fe=je,We=kt,ne=Ne("tooltip");return r(),k("div",Ut,[i("div",Nt,[i("div",Ot,[a.route.method?(r(),$(p,{key:0,class:M(["n-badge-base n-sm",b(le)(h.value)]),"pointer-events-none":"","font-mono":"",tabindex:"-1"},{default:C(()=>[K(U(h.value.toUpperCase()),1)]),_:1},8,["class"])):(r(),$(R,{key:1,modelValue:h.value,"onUpdate:modelValue":t[0]||(t[0]=s=>h.value=s),class:M(["n-badge-base n-sm",b(le)(h.value)])},{default:C(()=>[(r(),k(O,null,J(re,s=>i("option",{key:s,class:M(b(le)(s))},U(s.toUpperCase()),3)),64))]),_:1},8,["modelValue","class"])),i("div",Lt,[v(T,{"model-value":oe.value,readonly:"","flex-auto":"","font-mono":"",p:"x5 y2",n:"sm"},null,8,["model-value"]),i("div",Pt,[Z(v(p,{title:"Copy URL",n:"xs blue",icon:"carbon:copy",border:!1,onClick:t[1]||(t[1]=s=>b(Fe)(be.value,"server-route-url"))},null,512),[[ne,"Copy URL"]]),Z(v(p,{title:"Open in Editor",icon:"carbon-launch",n:"xs blue",border:!1,onClick:t[2]||(t[2]=s=>b(S)(a.route.filepath))},null,512),[[ne,"Open in Editor"]])])]),v(p,{"h-full":"",n:"primary solid",onClick:_e},{default:C(()=>[v(q,{icon:"carbon:send"})]),_:1})])]),i("div",At,[(r(!0),k(O,null,J(Be.value,s=>Z((r(),$(p,{key:s.slug,class:M(c.value===s.slug?"text-primary n-primary":"border-transparent shadow-none"),onClick:Y=>c.value=s.slug},{default:C(()=>[v(q,{icon:b(Le)[s.slug]},null,8,["icon"]),i("div",Bt,[K(U(s.name)+" "+U(s?.length?`(${s.length})`:"")+" ",1),i("span",null,U(b(x)[s.slug]?.length?`(${b(x)[s.slug].length})`:""),1)])]),_:2},1032,["class","onClick"])),[[ne,s.name]])),128)),t[12]||(t[12]=i("div",{"flex-auto":""},null,-1)),t[13]||(t[13]=i("div",{"text-xs":"",op50:""}," Send from ",-1)),v(R,{modelValue:Q.value,"onUpdate:modelValue":t[3]||(t[3]=s=>Q.value=s),class:"n-xs",disabled:!b(g)?.app?.$fetch},{default:C(()=>t[11]||(t[11]=[i("option",{value:"app"}," App ",-1),i("option",{value:"devtools"}," DevTools ",-1)])),_:1},8,["modelValue","disabled"]),Z(v(p,{n:"orange",class:"p-3",icon:"i-carbon-clean",onClick:Me},null,512),[[ne,"Clear Inputs Saved Cache"]])]),c.value==="params"?(r(),k("div",qt,[(r(!0),k(O,null,J(N.value,s=>(r(),k(O,{key:s},[i("div",Mt,U(s),1),v(T,{modelValue:D.value[s],"onUpdate:modelValue":Y=>D.value[s]=Y,placeholder:s,"flex-1":""},null,8,["modelValue","onUpdate:modelValue","placeholder"])],64))),128))])):P("",!0),c.value==="cookies"?(r(),k("div",Ft,[(r(!0),k(O,null,J(X.value,s=>(r(),k("div",{key:s.key,flex:"~ gap-4 items-center"},[v(T,{placeholder:"Key...","model-value":s.key,disabled:"","op-70":""},null,8,["model-value"]),v(T,{placeholder:"Value...","model-value":s.value,"flex-1":"",n:"primary",onInput:Y=>ce(s.key,Y.target?.value)},null,8,["model-value","onInput"]),v(p,{title:"Delete",n:"red",onClick:Y=>ce(s.key,void 0)},{default:C(()=>[v(q,{icon:"i-carbon-trash-can"})]),_:2},1032,["onClick"])]))),128)),i("div",zt,[v(T,{modelValue:H.key,"onUpdate:modelValue":t[4]||(t[4]=s=>H.key=s),placeholder:"Key",n:"primary","flex-1":""},null,8,["modelValue"]),v(T,{modelValue:H.value,"onUpdate:modelValue":t[5]||(t[5]=s=>H.value=s),placeholder:"Value",n:"primary","flex-1":""},null,8,["modelValue"]),v(p,{title:"Add",n:"primary",onClick:t[6]||(t[6]=s=>ce(H.key,H.value))},{default:C(()=>[v(q,{icon:"i-carbon-save"})]),_:1})])])):P("",!0),v(b(y),null,{default:C(()=>[v(we,{modelValue:ue.value,"onUpdate:modelValue":t[9]||(t[9]=s=>ue.value=s),default:{active:!0,type:"string"},"max-h-xs":"","of-auto":""},{default:C(()=>[b(x)[c.value]?.length?(r(),k(O,{key:0},[i("div",Ht,[t[14]||(t[14]=i("div",{"w-5":"","x-divider":""},null,-1)),t[15]||(t[15]=i("div",{"flex-none":""}," Default Inputs ",-1)),v(p,{icon:"i-carbon-edit",border:!1,onClick:t[7]||(t[7]=s=>o("openDefaultInput"))}),t[16]||(t[16]=i("div",{"x-divider":""},null,-1))]),v(we,{modelValue:b(x)[c.value],"onUpdate:modelValue":t[8]||(t[8]=s=>b(x)[c.value]=s),disabled:"",p0:""},null,8,["modelValue"])],64)):P("",!0)]),_:1},8,["modelValue"])]),_:1}),c.value==="snippet"?(r(),k("div",Jt,[ke.value.length?(r(),$(ze,{key:0,"code-snippets":ke.value},null,8,["code-snippets"])):P("",!0)])):ue.value?(r(),k("div",Wt,[c.value==="body"?(r(),k(O,{key:0},[i("div",Gt,[(r(),k(O,null,J(te,s=>i("button",{key:s,px4:"",py2:"",border:"r base",hover:"bg-active",class:M({"border-b":s!==W.value}),onClick:Y=>W.value=s},[i("div",{class:M({op30:s!==W.value}),"font-mono":""},U(s),3)],10,Kt)),64)),t[17]||(t[17]=i("div",{border:"b base","flex-auto":""},null,-1))]),W.value==="input"?(r(),$(b(f),{key:0})):W.value==="json"?(r(),$(b(ht),yt({key:1,modelValue:j.value,"onUpdate:modelValue":t[10]||(t[10]=s=>j.value=s),class:[b(d)==="dark"?"jse-theme-dark":"light","json-editor-vue of-auto text-sm outline-none"]},a.$attrs,{mode:"text","navigation-bar":!1,indentation:2,"tab-size":2}),null,16,["modelValue","class"])):P("",!0)],64)):(r(),$(b(f),{key:1}))])):P("",!0),A.value?F.value?(r(),$(Je,{key:5,"z-10":"","flex-auto":"","backdrop-blur":""},{default:C(()=>t[19]||(t[19]=[K(" Fetching... ")])),_:1})):(r(),k(O,{key:6},[i("div",Qt,[t[21]||(t[21]=i("div",null,"Response",-1)),u.error?(r(),$(fe,{key:0,n:"red"},{default:C(()=>t[20]||(t[20]=[K(" Error ")])),_:1})):P("",!0),v(fe,{n:u.error?"orange":"green",textContent:U(u.statusCode)},null,8,["n","textContent"]),u.contentType?(r(),k("code",Xt,U(u.contentType),1)):P("",!0),t[22]||(t[22]=i("div",{"flex-auto":""},null,-1)),t[23]||(t[23]=i("div",{op50:""}," Request finished in ",-1)),v(fe,{n:"green"},{default:C(()=>[K(U(u.fetchTime)+" ms ",1)]),_:1})]),E.value==="pdf"?(r(),k("div",Yt,[i("div",Zt,[i("object",{data:I.value,type:"application/pdf","flex-auto":"",width:"100%",height:"100%",rounded:""},null,8,eo)])])):E.value!=="media"?(r(),$(We,{key:1,"flex-auto":"","overflow-auto":"","py-2":"",code:I.value,lang:E.value},null,8,["code","lang"])):(r(),k("div",to,[i("div",oo,[u.contentType.includes("image")?(r(),k("img",{key:0,rounded:"",src:I.value},null,8,no)):(r(),k("video",ao,[i("source",{src:I.value,type:"video/mp4"},null,8,so)]))])]))],64)):(r(),$(He,{key:4},{default:C(()=>[v(p,{n:"primary",onClick:_e},{default:C(()=>[v(q,{icon:"carbon:send"}),t[18]||(t[18]=K(" Send request "))]),_:1})]),_:1}))])}}}),ro={flex:"~ gap1","text-sm":""},io={key:0,op50:""},uo={op50:""},$o=ye({__name:"server-routes",setup(e){const l=L(!1),n=lt(),o=$e(),{selectedRoute:y,view:f,inputDefaults:d}=De("serverRoutes"),m=V(()=>{!o.value&&y.value&&(o.value=y.value.filepath);const S=n.value?.find(_=>_.filepath===o.value);return o.value!==y.value?.filepath&&S&&(y.value=S),S}),g=L(""),u=V(()=>new rt(n.value||[],{keys:["method","route"],shouldSort:!0})),E=V(()=>n.value?g.value?u.value.search(g.value).map(_=>_.item):n.value:[]),I=V(()=>{const S=[],_=(h,D)=>{h.routes=h.routes||[],h.routes.push(D)},N=(h,D)=>{const w=D?D.routes?.find(x=>x.route===h):S.find(x=>x.route===h);if(w)return w;const j={route:h,filepath:h.replace(/\W/g,"-").toLowerCase(),type:"collection",routes:[]};return D?_(D,j):S.push(j),j};return E.value.forEach(h=>{let D,w;const j=h.filepath.split("/"),x=j.slice(j.indexOf("server")+1);if(h.type==="runtime"){x[0]="runtime";const z=j.indexOf("dist");z!==-1&&(D=j[z-1],D&&x.splice(1,0,D))}x.length>0&&x[x.length-1].includes(".")&&x.pop(),x.forEach(z=>{w=N(z,w)}),w?_(w,h):S.push(h)}),S});function F(){f.value=f.value==="tree"?"list":"tree"}function A(S){return S.charAt(0).toUpperCase()+S.slice(1)}return(S,_)=>{const N=Re,h=dt,D=Pe,w=lo,j=ut,x=Ve,z=it,Q=Oe,re=xt,ie=Ct,ee=Ne("tooltip");return r(),k(O,null,[v(z,{"storage-key":"tab-server-routes"},{left:C(()=>[v(h,{search:g.value,"onUpdate:search":_[1]||(_[1]=c=>g.value=c),pb2:""},{actions:C(()=>[Z(v(N,{"text-lg":"",icon:b(f)==="list"?"i-carbon-list":"i-carbon-tree-view-alt",title:"Toggle view",border:!1,onClick:F},null,8,["icon"]),[[ee,"Toggle View"]]),Z(v(N,{"text-lg":"",icon:"i-carbon-cics-sit-overrides",title:"Default Inputs",border:!1,onClick:_[0]||(_[0]=c=>l.value=!l.value)},null,512),[[ee,"Default Inputs"]])]),default:C(()=>[i("div",ro,[g.value?(r(),k("span",io,U(E.value.length)+" matched · ",1)):P("",!0),i("span",uo,U(b(n)?.length)+" routes in total",1)])]),_:1},8,["search"]),(r(!0),k(O,null,J(b(f)==="tree"?I.value:E.value,c=>(r(),$(D,{key:c.filepath,item:c},null,8,["item"]))),128))]),right:C(()=>[(r(),$(gt,{max:10},[m.value?(r(),$(w,{key:m.value.filepath,route:m.value,onOpenDefaultInput:_[2]||(_[2]=c=>l.value=!0)},null,8,["route"])):P("",!0)],1024)),m.value?P("",!0):(r(),$(x,{key:0},{default:C(()=>[v(j,{px6:"",py2:""},{default:C(()=>_[5]||(_[5]=[i("span",{op75:""},"Select a route to start",-1)])),_:1})]),_:1}))]),_:1}),v(ie,{modelValue:l.value,"onUpdate:modelValue":_[3]||(_[3]=c=>l.value=c),"auto-close":"","max-w-xl":"","min-w-xl":"",onClose:_[4]||(_[4]=c=>l.value=!1)},{default:C(()=>[i("div",null,[_[6]||(_[6]=i("div",{p4:"",border:"b base"},[i("span",{"text-lg":""},"Default Inputs"),i("br"),i("span",{"text-white":"",op50:""},"Merged as default for every request in DevTools")],-1)),(r(!0),k(O,null,J(Object.keys(b(d)),c=>(r(),$(re,{key:c,text:`${A(c)} ${b(d)[c].length?`(${b(d)[c].length})`:""}`,padding:!1,icon:b(Le)[c]},{default:C(()=>[v(Q,{modelValue:b(d)[c],"onUpdate:modelValue":te=>b(d)[c]=te,py0:"",default:{active:!0,type:"string"}},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["text","icon"]))),128))])]),_:1},8,["modelValue"])],64)}}});export{$o as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ba as re,D as oe,b as le,b7 as Oe,P as xe,H as Te,J as Se,ag as we,b8 as Xe,I as De,b5 as Ee,q as Me,e as ce,v as Ce,c as fe,az as Ie,bb as $e,M as Ue,p as Le,T as Ne}from"./b6bfxrb8.js";import{_ as Ae}from"./nnavbar.vue-d5x8tq5w.js";import{_ as pe}from"./nbadge-fktngirm.js";import{q as Re,k as K,b as H,l as U,Q as g,S as $,U as v,a0 as O,a5 as A,F as W,ab as Z,Y as F,u as E,W as j,r as se,w as Ve,ae as de,a8 as G,$ as I,a6 as Y,M as R,a1 as je,av as We,X as Be,V as He,K as ze}from"./vendor/json-editor-vue-gi2fewby.js";import{_ as ve}from"./server-route-inputs.vue-dfs3eezs.js";import{_ as qe}from"./ncode-block.vue-gy1ero5j.js";import{S as he}from"./constants-b32h69zq.js";import{_ as Pe}from"./nsection-block-ivkmhmn9.js";import{_ as Ye}from"./ndrawer.vue-cjxfdzsk.js";import"./vendor/unocss-3uirpnla.js";import"./vendor/shiki-bnvxb5wv.js";import"./ncheckbox.vue-fs1yhvat.js";import"./nselect.vue-mkp3umn0.js";import"./client-c9f80qsp.js";import"./nicon-title.vue-ouqsubn7.js";var ne={exports:{}},ue;function Fe(){return ue||(ue=1,function(q,L){(function(x,w){q.exports=w()})(globalThis,()=>(()=>{var N={949:(b,p,_)=>{Object.defineProperty(p,"__esModule",{value:!0}),p.CronParser=void 0;var o=_(515),d=function(){function y(t,e,a){e===void 0&&(e=!0),a===void 0&&(a=!1),this.expression=t,this.dayOfWeekStartIndexZero=e,this.monthStartIndexZero=a}return y.prototype.parse=function(){var t,e,a=(t=this.expression)!==null&&t!==void 0?t:"";if(a.startsWith("@")){var r=this.parseSpecial(this.expression);e=this.extractParts(r)}else e=this.extractParts(this.expression);return this.normalize(e),this.validate(e),e},y.prototype.parseSpecial=function(t){var e={"@yearly":"0 0 1 1 *","@annually":"0 0 1 1 *","@monthly":"0 0 1 * *","@weekly":"0 0 * * 0","@daily":"0 0 * * *","@midnight":"0 0 * * *","@hourly":"0 * * * *"},a=e[t];if(!a)throw new Error("Unknown special expression.");return a},y.prototype.extractParts=function(t){if(!this.expression)throw new Error("cron expression is empty");for(var e=t.trim().split(/[ ]+/),a=0;a<e.length;a++)if(e[a].includes(",")){var r=e[a].split(",").map(function(s){return s.trim()}).filter(function(s){return s!==""}).map(function(s){return isNaN(Number(s))?s:Number(s)}).filter(function(s){return s!==null&&s!==""});r.length===0&&r.push("*"),r.sort(function(s,i){return s!==null&&i!==null?s-i:0}),e[a]=r.map(function(s){return s!==null?s.toString():""}).join(",")}if(e.length<5)throw new Error("Expression has only ".concat(e.length," part").concat(e.length==1?"":"s",". At least 5 parts are required."));if(e.length==5)e.unshift(""),e.push("");else if(e.length==6){var n=/\d{4}$/.test(e[5])||e[4]=="?"||e[2]=="?";n?e.unshift(""):e.push("")}else if(e.length>7)throw new Error("Expression has ".concat(e.length," parts; too many!"));return e},y.prototype.normalize=function(t){var e=this;if(t[3]=t[3].replace("?","*"),t[5]=t[5].replace("?","*"),t[2]=t[2].replace("?","*"),t[0].indexOf("0/")==0&&(t[0]=t[0].replace("0/","*/")),t[1].indexOf("0/")==0&&(t[1]=t[1].replace("0/","*/")),t[2].indexOf("0/")==0&&(t[2]=t[2].replace("0/","*/")),t[3].indexOf("1/")==0&&(t[3]=t[3].replace("1/","*/")),t[4].indexOf("1/")==0&&(t[4]=t[4].replace("1/","*/")),t[6].indexOf("1/")==0&&(t[6]=t[6].replace("1/","*/")),t[5]=t[5].replace(/(^\d)|([^#/\s]\d)/g,function(c){var m=c.replace(/\D/,""),f=m;return e.dayOfWeekStartIndexZero?m=="7"&&(f="0"):f=(parseInt(m)-1).toString(),c.replace(m,f)}),t[5]=="L"&&(t[5]="6"),t[3]=="?"&&(t[3]="*"),t[3].indexOf("W")>-1&&(t[3].indexOf(",")>-1||t[3].indexOf("-")>-1))throw new Error("The 'W' character can be specified only when the day-of-month is a single day, not a range or list of days.");var a={SUN:0,MON:1,TUE:2,WED:3,THU:4,FRI:5,SAT:6};for(var r in a)t[5]=t[5].replace(new RegExp(r,"gi"),a[r].toString());t[4]=t[4].replace(/(^\d{1,2})|([^#/\s]\d{1,2})/g,function(c){var m=c.replace(/\D/,""),f=m;return e.monthStartIndexZero&&(f=(parseInt(m)+1).toString()),c.replace(m,f)});var n={JAN:1,FEB:2,MAR:3,APR:4,MAY:5,JUN:6,JUL:7,AUG:8,SEP:9,OCT:10,NOV:11,DEC:12};for(var s in n)t[4]=t[4].replace(new RegExp(s,"gi"),n[s].toString());t[0]=="0"&&(t[0]=""),!/\*|\-|\,|\//.test(t[2])&&(/\*|\//.test(t[1])||/\*|\//.test(t[0]))&&(t[2]+="-".concat(t[2]));for(var i=0;i<t.length;i++)if(t[i].indexOf(",")!=-1&&(t[i]=t[i].split(",").filter(function(c){return c!==""}).join(",")||"*"),t[i]=="*/1"&&(t[i]="*"),t[i].indexOf("/")>-1&&!/^\*|\-|\,/.test(t[i])){var u=null;switch(i){case 4:u="12";break;case 5:u="6";break;case 6:u="9999";break;default:u=null;break}if(u!==null){var h=t[i].split("/");t[i]="".concat(h[0],"-").concat(u,"/").concat(h[1])}}},y.prototype.validate=function(t){this.assertNoInvalidCharacters("DOW",t[5]),this.assertNoInvalidCharacters("DOM",t[3]),this.validateRange(t)},y.prototype.validateRange=function(t){o.default.secondRange(t[0]),o.default.minuteRange(t[1]),o.default.hourRange(t[2]),o.default.dayOfMonthRange(t[3]),o.default.monthRange(t[4],this.monthStartIndexZero),o.default.dayOfWeekRange(t[5],this.dayOfWeekStartIndexZero)},y.prototype.assertNoInvalidCharacters=function(t,e){var a=e.match(/[A-KM-VX-Z]+/gi);if(a&&a.length)throw new Error("".concat(t," part contains invalid values: '").concat(a.toString(),"'"))},y}();p.CronParser=d},333:(b,p,_)=>{Object.defineProperty(p,"__esModule",{value:!0}),p.ExpressionDescriptor=void 0;var o=_(823),d=_(949),y=function(){function t(e,a){if(this.expression=e,this.options=a,this.expressionParts=new Array(5),!this.options.locale&&t.defaultLocale&&(this.options.locale=t.defaultLocale),!t.locales[this.options.locale]){var r=Object.keys(t.locales)[0];console.warn("Locale '".concat(this.options.locale,"' could not be found; falling back to '").concat(r,"'.")),this.options.locale=r}this.i18n=t.locales[this.options.locale],a.use24HourTimeFormat===void 0&&(a.use24HourTimeFormat=this.i18n.use24HourTimeFormatByDefault())}return t.toString=function(e,a){var r=a===void 0?{}:a,n=r.throwExceptionOnParseError,s=n===void 0?!0:n,i=r.verbose,u=i===void 0?!1:i,h=r.dayOfWeekStartIndexZero,c=h===void 0?!0:h,m=r.monthStartIndexZero,f=m===void 0?!1:m,C=r.use24HourTimeFormat,T=r.locale,B=T===void 0?null:T,V=r.tzOffset,D=V===void 0?0:V,z={throwExceptionOnParseError:s,verbose:u,dayOfWeekStartIndexZero:c,monthStartIndexZero:f,use24HourTimeFormat:C,locale:B,tzOffset:D},ee=new t(e,z);return ee.getFullDescription()},t.initialize=function(e,a){a===void 0&&(a="en"),t.specialCharacters=["/","-",",","*"],t.defaultLocale=a,e.load(t.locales)},t.prototype.getFullDescription=function(){var e="";try{var a=new d.CronParser(this.expression,this.options.dayOfWeekStartIndexZero,this.options.monthStartIndexZero);this.expressionParts=a.parse();var r=this.getTimeOfDayDescription(),n=this.getDayOfMonthDescription(),s=this.getMonthDescription(),i=this.getDayOfWeekDescription(),u=this.getYearDescription();e+=r+n+i+s+u,e=this.transformVerbosity(e,!!this.options.verbose),e=e.charAt(0).toLocaleUpperCase()+e.substr(1)}catch(h){if(!this.options.throwExceptionOnParseError)e=this.i18n.anErrorOccuredWhenGeneratingTheExpressionD();else throw"".concat(h)}return e},t.prototype.getTimeOfDayDescription=function(){var e=this.expressionParts[0],a=this.expressionParts[1],r=this.expressionParts[2],n="";if(!o.StringUtilities.containsAny(a,t.specialCharacters)&&!o.StringUtilities.containsAny(r,t.specialCharacters)&&!o.StringUtilities.containsAny(e,t.specialCharacters))n+=this.i18n.atSpace()+this.formatTime(r,a,e);else if(!e&&a.indexOf("-")>-1&&!(a.indexOf(",")>-1)&&!(a.indexOf("/")>-1)&&!o.StringUtilities.containsAny(r,t.specialCharacters)){var s=a.split("-");n+=o.StringUtilities.format(this.i18n.everyMinuteBetweenX0AndX1(),this.formatTime(r,s[0],""),this.formatTime(r,s[1],""))}else if(!e&&r.indexOf(",")>-1&&r.indexOf("-")==-1&&r.indexOf("/")==-1&&!o.StringUtilities.containsAny(a,t.specialCharacters)){var i=r.split(",");n+=this.i18n.at();for(var u=0;u<i.length;u++)n+=" ",n+=this.formatTime(i[u],a,""),u<i.length-2&&(n+=","),u==i.length-2&&(n+=this.i18n.spaceAnd())}else{var h=this.getSecondsDescription(),c=this.getMinutesDescription(),m=this.getHoursDescription();if(n+=h,n&&c&&(n+=", "),n+=c,c===m)return n;n&&m&&(n+=", "),n+=m}return n},t.prototype.getSecondsDescription=function(){var e=this,a=this.getSegmentDescription(this.expressionParts[0],this.i18n.everySecond(),function(r){return r},function(r){return o.StringUtilities.format(e.i18n.everyX0Seconds(r),r)},function(r){return e.i18n.secondsX0ThroughX1PastTheMinute()},function(r){return r=="0"?"":parseInt(r)<20?e.i18n.atX0SecondsPastTheMinute(r):e.i18n.atX0SecondsPastTheMinuteGt20()||e.i18n.atX0SecondsPastTheMinute(r)});return a},t.prototype.getMinutesDescription=function(){var e=this,a=this.expressionParts[0],r=this.expressionParts[2],n=this.getSegmentDescription(this.expressionParts[1],this.i18n.everyMinute(),function(s){return s},function(s){return o.StringUtilities.format(e.i18n.everyX0Minutes(s),s)},function(s){return e.i18n.minutesX0ThroughX1PastTheHour()},function(s){try{return s=="0"&&r.indexOf("/")==-1&&a==""?e.i18n.everyHour():parseInt(s)<20?e.i18n.atX0MinutesPastTheHour(s):e.i18n.atX0MinutesPastTheHourGt20()||e.i18n.atX0MinutesPastTheHour(s)}catch{return e.i18n.atX0MinutesPastTheHour(s)}});return n},t.prototype.getHoursDescription=function(){var e=this,a=this.expressionParts[2],r=this.getSegmentDescription(a,this.i18n.everyHour(),function(i){return e.formatTime(i,"0","")},function(i){return o.StringUtilities.format(e.i18n.everyX0Hours(i),i)},function(i){return e.i18n.betweenX0AndX1()},function(i){return e.i18n.atX0()});if(r&&a.includes("-")&&this.expressionParts[1]!="0"){var n=Array.from(r.matchAll(/:00/g));if(n.length>1){var s=n[n.length-1].index;r=r.substring(0,s)+":59"+r.substring(s+3)}}return r},t.prototype.getDayOfWeekDescription=function(){var e=this,a=this.i18n.daysOfTheWeek(),r=null;return this.expressionParts[5]=="*"?r="":r=this.getSegmentDescription(this.expressionParts[5],this.i18n.commaEveryDay(),function(n,s){var i=n;n.indexOf("#")>-1?i=n.substring(0,n.indexOf("#")):n.indexOf("L")>-1&&(i=i.replace("L",""));var u=parseInt(i);if(e.options.tzOffset){var h=e.expressionParts[2],c=parseInt(h)+(e.options.tzOffset?e.options.tzOffset:0);c>=24?u++:c<0&&u--,u>6?u=0:u<0&&(u=6)}var m=e.i18n.daysOfTheWeekInCase?e.i18n.daysOfTheWeekInCase(s)[u]:a[u];if(n.indexOf("#")>-1){var f=null,C=n.substring(n.indexOf("#")+1),T=n.substring(0,n.indexOf("#"));switch(C){case"1":f=e.i18n.first(T);break;case"2":f=e.i18n.second(T);break;case"3":f=e.i18n.third(T);break;case"4":f=e.i18n.fourth(T);break;case"5":f=e.i18n.fifth(T);break}m=f+" "+m}return m},function(n){return parseInt(n)==1?"":o.StringUtilities.format(e.i18n.commaEveryX0DaysOfTheWeek(n),n)},function(n){var s=n.substring(0,n.indexOf("-")),i=e.expressionParts[3]!="*";return i?e.i18n.commaAndX0ThroughX1(s):e.i18n.commaX0ThroughX1(s)},function(n){var s=null;if(n.indexOf("#")>-1){var i=n.substring(n.indexOf("#")+1),u=n.substring(0,n.indexOf("#"));s=e.i18n.commaOnThe(i,u).trim()+e.i18n.spaceX0OfTheMonth()}else if(n.indexOf("L")>-1)s=e.i18n.commaOnTheLastX0OfTheMonth(n.replace("L",""));else{var h=e.expressionParts[3]!="*";s=h?e.i18n.commaAndOnX0():e.i18n.commaOnlyOnX0(n)}return s}),r},t.prototype.getMonthDescription=function(){var e=this,a=this.i18n.monthsOfTheYear(),r=this.getSegmentDescription(this.expressionParts[4],"",function(n,s){return s&&e.i18n.monthsOfTheYearInCase?e.i18n.monthsOfTheYearInCase(s)[parseInt(n)-1]:a[parseInt(n)-1]},function(n){return parseInt(n)==1?"":o.StringUtilities.format(e.i18n.commaEveryX0Months(n),n)},function(n){return e.i18n.commaMonthX0ThroughMonthX1()||e.i18n.commaX0ThroughX1()},function(n){return e.i18n.commaOnlyInMonthX0?e.i18n.commaOnlyInMonthX0():e.i18n.commaOnlyInX0()});return r},t.prototype.getDayOfMonthDescription=function(){var e=this,a=null,r=this.expressionParts[3];switch(r){case"L":a=this.i18n.commaOnTheLastDayOfTheMonth();break;case"WL":case"LW":a=this.i18n.commaOnTheLastWeekdayOfTheMonth();break;default:var n=r.match(/(\d{1,2}W)|(W\d{1,2})/);if(n){var s=parseInt(n[0].replace("W","")),i=s==1?this.i18n.firstWeekday():o.StringUtilities.format(this.i18n.weekdayNearestDayX0(),s.toString());a=o.StringUtilities.format(this.i18n.commaOnTheX0OfTheMonth(),i);break}else{var u=r.match(/L-(\d{1,2})/);if(u){var h=u[1];a=o.StringUtilities.format(this.i18n.commaDaysBeforeTheLastDayOfTheMonth(h),h);break}else{if(r=="*"&&this.expressionParts[5]!="*")return"";a=this.getSegmentDescription(r,this.i18n.commaEveryDay(),function(c){return c=="L"?e.i18n.lastDay():e.i18n.dayX0?o.StringUtilities.format(e.i18n.dayX0(),c):c},function(c){return c=="1"?e.i18n.commaEveryDay():e.i18n.commaEveryX0Days(c)},function(c){return e.i18n.commaBetweenDayX0AndX1OfTheMonth(c)},function(c){return e.i18n.commaOnDayX0OfTheMonth(c)})}break}}return a},t.prototype.getYearDescription=function(){var e=this,a=this.getSegmentDescription(this.expressionParts[6],"",function(r){return/^\d+$/.test(r)?new Date(parseInt(r),1).getFullYear().toString():r},function(r){return o.StringUtilities.format(e.i18n.commaEveryX0Years(r),r)},function(r){return e.i18n.commaYearX0ThroughYearX1()||e.i18n.commaX0ThroughX1()},function(r){return e.i18n.commaOnlyInYearX0?e.i18n.commaOnlyInYearX0():e.i18n.commaOnlyInX0()});return a},t.prototype.getSegmentDescription=function(e,a,r,n,s,i){var u=null,h=e.indexOf("/")>-1,c=e.indexOf("-")>-1,m=e.indexOf(",")>-1;if(!e)u="";else if(e==="*")u=a;else if(!h&&!c&&!m)u=o.StringUtilities.format(i(e),r(e));else if(m){for(var f=e.split(","),C="",T=0;T<f.length;T++)if(T>0&&f.length>2&&(C+=",",T<f.length-1&&(C+=" ")),T>0&&f.length>1&&(T==f.length-1||f.length==2)&&(C+="".concat(this.i18n.spaceAnd()," ")),f[T].indexOf("/")>-1||f[T].indexOf("-")>-1){var B=f[T].indexOf("-")>-1&&f[T].indexOf("/")==-1,V=this.getSegmentDescription(f[T],a,r,n,B?this.i18n.commaX0ThroughX1:s,i);B&&(V=V.replace(", ","")),C+=V}else h?C+=this.getSegmentDescription(f[T],a,r,n,s,i):C+=r(f[T]);h?u=C:u=o.StringUtilities.format(i(e),C)}else if(h){var f=e.split("/");if(u=o.StringUtilities.format(n(f[1]),f[1]),f[0].indexOf("-")>-1){var D=this.generateRangeSegmentDescription(f[0],s,r);D.indexOf(", ")!=0&&(u+=", "),u+=D}else if(f[0].indexOf("*")==-1){var z=o.StringUtilities.format(i(f[0]),r(f[0]));z=z.replace(", ",""),u+=o.StringUtilities.format(this.i18n.commaStartingX0(),z)}}else c&&(u=this.generateRangeSegmentDescription(e,s,r));return u},t.prototype.generateRangeSegmentDescription=function(e,a,r){var n="",s=e.split("-"),i=r(s[0],1),u=r(s[1],2),h=a(e);return n+=o.StringUtilities.format(h,i,u),n},t.prototype.formatTime=function(e,a,r){var n=0,s=0;this.options.tzOffset&&(n=this.options.tzOffset>0?Math.floor(this.options.tzOffset):Math.ceil(this.options.tzOffset),s=parseFloat((this.options.tzOffset%1).toFixed(2)),s!=0&&(s*=60));var i=parseInt(e)+n,u=parseInt(a)+s;u>=60?(u-=60,i+=1):u<0&&(u+=60,i-=1),i>=24?i=i-24:i<0&&(i=24+i);var h="",c=!1;this.options.use24HourTimeFormat||(c=!!(this.i18n.setPeriodBeforeTime&&this.i18n.setPeriodBeforeTime()),h=c?"".concat(this.getPeriod(i)," "):" ".concat(this.getPeriod(i)),i>12&&(i-=12),i===0&&(i=12));var m="";return r&&(m=":".concat(("00"+r).substring(r.length))),"".concat(c?h:"").concat(("00"+i.toString()).substring(i.toString().length),":").concat(("00"+u.toString()).substring(u.toString().length)).concat(m).concat(c?"":h)},t.prototype.transformVerbosity=function(e,a){return a||(e=e.replace(new RegExp(", ".concat(this.i18n.everyMinute()),"g"),""),e=e.replace(new RegExp(", ".concat(this.i18n.everyHour()),"g"),""),e=e.replace(new RegExp(this.i18n.commaEveryDay(),"g"),""),e=e.replace(/\, ?$/,"")),e},t.prototype.getPeriod=function(e){return e>=12?this.i18n.pm&&this.i18n.pm()||"PM":this.i18n.am&&this.i18n.am()||"AM"},t.locales={},t}();p.ExpressionDescriptor=y},747:(b,p,_)=>{Object.defineProperty(p,"__esModule",{value:!0}),p.enLocaleLoader=void 0;var o=_(486),d=function(){function y(){}return y.prototype.load=function(t){t.en=new o.en},y}();p.enLocaleLoader=d},486:(b,p)=>{Object.defineProperty(p,"__esModule",{value:!0}),p.en=void 0;var _=function(){function o(){}return o.prototype.atX0SecondsPastTheMinuteGt20=function(){return null},o.prototype.atX0MinutesPastTheHourGt20=function(){return null},o.prototype.commaMonthX0ThroughMonthX1=function(){return null},o.prototype.commaYearX0ThroughYearX1=function(){return null},o.prototype.use24HourTimeFormatByDefault=function(){return!1},o.prototype.anErrorOccuredWhenGeneratingTheExpressionD=function(){return"An error occured when generating the expression description. Check the cron expression syntax."},o.prototype.everyMinute=function(){return"every minute"},o.prototype.everyHour=function(){return"every hour"},o.prototype.atSpace=function(){return"At "},o.prototype.everyMinuteBetweenX0AndX1=function(){return"Every minute between %s and %s"},o.prototype.at=function(){return"At"},o.prototype.spaceAnd=function(){return" and"},o.prototype.everySecond=function(){return"every second"},o.prototype.everyX0Seconds=function(){return"every %s seconds"},o.prototype.secondsX0ThroughX1PastTheMinute=function(){return"seconds %s through %s past the minute"},o.prototype.atX0SecondsPastTheMinute=function(){return"at %s seconds past the minute"},o.prototype.everyX0Minutes=function(){return"every %s minutes"},o.prototype.minutesX0ThroughX1PastTheHour=function(){return"minutes %s through %s past the hour"},o.prototype.atX0MinutesPastTheHour=function(){return"at %s minutes past the hour"},o.prototype.everyX0Hours=function(){return"every %s hours"},o.prototype.betweenX0AndX1=function(){return"between %s and %s"},o.prototype.atX0=function(){return"at %s"},o.prototype.commaEveryDay=function(){return", every day"},o.prototype.commaEveryX0DaysOfTheWeek=function(){return", every %s days of the week"},o.prototype.commaX0ThroughX1=function(){return", %s through %s"},o.prototype.commaAndX0ThroughX1=function(){return", %s through %s"},o.prototype.first=function(){return"first"},o.prototype.second=function(){return"second"},o.prototype.third=function(){return"third"},o.prototype.fourth=function(){return"fourth"},o.prototype.fifth=function(){return"fifth"},o.prototype.commaOnThe=function(){return", on the "},o.prototype.spaceX0OfTheMonth=function(){return" %s of the month"},o.prototype.lastDay=function(){return"the last day"},o.prototype.commaOnTheLastX0OfTheMonth=function(){return", on the last %s of the month"},o.prototype.commaOnlyOnX0=function(){return", only on %s"},o.prototype.commaAndOnX0=function(){return", and on %s"},o.prototype.commaEveryX0Months=function(){return", every %s months"},o.prototype.commaOnlyInX0=function(){return", only in %s"},o.prototype.commaOnTheLastDayOfTheMonth=function(){return", on the last day of the month"},o.prototype.commaOnTheLastWeekdayOfTheMonth=function(){return", on the last weekday of the month"},o.prototype.commaDaysBeforeTheLastDayOfTheMonth=function(){return", %s days before the last day of the month"},o.prototype.firstWeekday=function(){return"first weekday"},o.prototype.weekdayNearestDayX0=function(){return"weekday nearest day %s"},o.prototype.commaOnTheX0OfTheMonth=function(){return", on the %s of the month"},o.prototype.commaEveryX0Days=function(){return", every %s days"},o.prototype.commaBetweenDayX0AndX1OfTheMonth=function(){return", between day %s and %s of the month"},o.prototype.commaOnDayX0OfTheMonth=function(){return", on day %s of the month"},o.prototype.commaEveryHour=function(){return", every hour"},o.prototype.commaEveryX0Years=function(){return", every %s years"},o.prototype.commaStartingX0=function(){return", starting %s"},o.prototype.daysOfTheWeek=function(){return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},o.prototype.monthsOfTheYear=function(){return["January","February","March","April","May","June","July","August","September","October","November","December"]},o}();p.en=_},515:(b,p)=>{Object.defineProperty(p,"__esModule",{value:!0});function _(d,y){if(!d)throw new Error(y)}var o=function(){function d(){}return d.secondRange=function(y){for(var t=y.split(","),e=0;e<t.length;e++)if(!isNaN(parseInt(t[e],10))){var a=parseInt(t[e],10);_(a>=0&&a<=59,"seconds part must be >= 0 and <= 59")}},d.minuteRange=function(y){for(var t=y.split(","),e=0;e<t.length;e++)if(!isNaN(parseInt(t[e],10))){var a=parseInt(t[e],10);_(a>=0&&a<=59,"minutes part must be >= 0 and <= 59")}},d.hourRange=function(y){for(var t=y.split(","),e=0;e<t.length;e++)if(!isNaN(parseInt(t[e],10))){var a=parseInt(t[e],10);_(a>=0&&a<=23,"hours part must be >= 0 and <= 23")}},d.dayOfMonthRange=function(y){for(var t=y.split(","),e=0;e<t.length;e++)if(!isNaN(parseInt(t[e],10))){var a=parseInt(t[e],10);_(a>=1&&a<=31,"DOM part must be >= 1 and <= 31")}},d.monthRange=function(y,t){for(var e=y.split(","),a=0;a<e.length;a++)if(!isNaN(parseInt(e[a],10))){var r=parseInt(e[a],10);_(r>=1&&r<=12,t?"month part must be >= 0 and <= 11":"month part must be >= 1 and <= 12")}},d.dayOfWeekRange=function(y,t){for(var e=y.split(","),a=0;a<e.length;a++)if(!isNaN(parseInt(e[a],10))){var r=parseInt(e[a],10);_(r>=0&&r<=6,t?"DOW part must be >= 0 and <= 6":"DOW part must be >= 1 and <= 7")}},d}();p.default=o},823:(b,p)=>{Object.defineProperty(p,"__esModule",{value:!0}),p.StringUtilities=void 0;var _=function(){function o(){}return o.format=function(d){for(var y=[],t=1;t<arguments.length;t++)y[t-1]=arguments[t];return d.replace(/%s/g,function(e){return y.shift()})},o.containsAny=function(d,y){return y.some(function(t){return d.indexOf(t)>-1})},o}();p.StringUtilities=_}},x={};function w(b){var p=x[b];if(p!==void 0)return p.exports;var _=x[b]={exports:{}};return N[b](_,_.exports,w),_.exports}var X={};return(()=>{var b=X;Object.defineProperty(b,"__esModule",{value:!0}),b.toString=void 0;var p=w(333),_=w(747);p.ExpressionDescriptor.initialize(new _.enLocaleLoader),b.default=p.ExpressionDescriptor;var o=p.ExpressionDescriptor.toString;b.toString=o})(),X})())}(ne)),ne.exports}var Ge=Fe();const Ze=Re(Ge),Je=["title"],Qe={"flex-none":"","text-left":""},Ke={flex:"~ gap-2","min-w-0":"","items-center":"","text-sm":""},et={class:"truncate"},tt={"text-xs":"",op50:""},nt={key:0},rt=["onClick"],ot=K({__name:"CronCollection",props:{collection:{}},setup(q){const L=q,N=re(),x=H(!0),w=U(()=>Ze.toString(L.collection.cron));return(X,b)=>{const p=oe,_=pe;return g(),$("div",null,[v("button",{flex:"~ gap-2","w-full":"","items-start":"","items-center":"","hover-bg-active":"",p2:"",title:w.value,onClick:b[0]||(b[0]=o=>x.value=!x.value)},[v("div",Qe,[O(p,{icon:"carbon:chevron-right","mb0.5":"","transform-rotate":x.value?90:0,transition:""},null,8,["transform-rotate"])]),v("span",Ke,[O(_,{class:"font-mono n-primary",textContent:A(X.collection.cron)},null,8,["textContent"]),v("span",et,A(w.value),1),v("span",tt,"("+A(X.collection.tasks.length)+")",1)])],8,Je),b[2]||(b[2]=v("div",{"x-divider":""},null,-1)),x.value?(g(),$("ul",nt,[(g(!0),$(W,null,Z(X.collection.tasks,o=>(g(),$("li",{key:o},[v("button",{flex:"~ gap-2","w-full":"","items-start":"","items-center":"","hover-bg-active":"",px2:"",py1:"","pl-9":"","font-mono":"",class:F([{"bg-active":E(N)===o}]),onClick:d=>N.value=o},A(o),11,rt),b[1]||(b[1]=v("div",{"x-divider":""},null,-1))]))),128))])):j("",!0)])}}}),at={"h-full":"","w-full":"",flex:"~ col"},it={flex:"~ col gap-2","flex-none":"",p4:"","n-navbar-glass":""},st={flex:"~ gap2 items-center"},ut={relative:"","w-full":""},lt={absolute:"","right-2":"","top-1.5":"",flex:"~ gap-1"},ct={flex:"~ gap2 wrap","w-full":"","items-center":"",px4:"",pb2:"","text-center":"","text-sm":"",border:"b base"},ft={class:"hidden md:block"},pt={flex:"~ gap2","mb--2":"","items-center":"",op50:""},dt={key:0,border:"b base",relative:"","n-code-block":""},vt={flex:"~ wrap","w-full":""},ht=["onClick"],mt={border:"b base",flex:"~ gap2","items-center":"",px4:"",py2:""},yt={key:1,"text-xs":"",op50:""},gt=K({__name:"ServerTaskDetails",props:{task:{}},emits:["openDefaultInput"],setup(q,{emit:L}){const N=q,x=L,w=H({payload:{}}),{inputDefaults:X}=le("serverRoutes"),[b,p]=Oe(),_=xe(),o=Te(),d=se({contentType:"text/plain",data:"",statusCode:200,error:void 0,fetchTime:0}),y=U(()=>JSON.stringify(d.data,null,2)),t=U(()=>d.contentType.includes("application/json")?"json":"text"),e=H(!1),a=H(!1),r=Se(),n=H(),s=["json"],i=H(s[0]),u=se({query:[{active:!0,key:"",value:"",type:"string"}],body:[{active:!0,key:"",value:"",type:"string"}],headers:[]}),h=U({get:()=>u[n.value],set:k=>{u[n.value]=k}}),c=U(()=>({...D(X.value.query),...D(u.query)})),m=U(()=>({...D(X.value.headers)})),f=U(()=>Object.keys(w.value?.payload??{}).length?{...w.value}:void 0),C=U(()=>f.value?"POST":"GET"),T=U(()=>{let k=window?.location.origin;return k.charAt(k.length-1)==="/"&&(k=k.slice(0,-1)),k}),B=U(()=>{let k=new URLSearchParams(c.value).toString();k&&(k=`?${k}`);const l=`/_nitro/tasks/${N.task.name}${k}`;let M=o.value?.app.baseURL||"";return(M==="./"||M===".")&&(M=""),M.endsWith("/")&&(M=M.slice(0,-1)),M+l}),V=U(()=>T.value+B.value);function D(k){const l=Object.fromEntries(k.filter(({active:M,key:P,value:J})=>M&&P&&J!==void 0).map(({key:M,value:P})=>[M,P]));return Object.entries(l).length?l:void 0}async function z(){a.value=!0,e.value=!0;const k=Date.now();Me("server-tasks:run",{method:C.value});try{d.data=await $fetch(V.value,{method:"POST",headers:m.value,query:c.value,body:f.value,onResponse({response:l}){d.contentType=(l.headers.get("content-type")||"").toString().toLowerCase().trim(),d.statusCode=l.status,d.error=void 0},onResponseError(l){d.error=l.response._data,d.data=l.response._data}})}catch{}e.value=!1,d.fetchTime=Date.now()-k}const ee=U(()=>{const k=[];return k.push({name:"Query",slug:"query",length:u.query.length}),k.push({name:"Body",slug:"body",length:u.body.length}),k});Ve(()=>{if(i.value==="json"&&typeof w.value=="string")try{w.value=JSON.parse(w.value)}catch{}});const ae=we("nuxt-devtools:server-tasks:inputs",()=>[],{window:window.parent});Xe([u,n],()=>{const k=ae.value?.find(l=>l.task===N.task.name);if(k){n.value||(n.value=k.tab),k.tab!==n.value&&(k.tab=n.value);const{body:l,query:M,headers:P}=k.inputs;Object.assign(u,{body:l,query:M,headers:P})}else{const l={task:N.task.name,tab:"query",inputs:u};ae.value.push(l),n.value||(n.value=l.tab)}},{immediate:!0,deep:!0,debounce:500});const ye=De();return(k,l)=>{const M=ce,P=Ce,J=oe,ie=ve,ge=fe,_e=Ie,te=pe,be=qe,Q=de("tooltip");return g(),$("div",at,[v("div",it,[v("div",st,[G((g(),$("div",null,[O(M,{class:F(["n-badge-base n-sm",E(Ee)(C.value)]),"pointer-events-none":"","font-mono":"",tabindex:"-1"},{default:I(()=>[Y(A(C.value),1)]),_:1},8,["class"])])),[[Q,`Method is ${C.value} as ${C.value==="GET"?"no":""} json body is sent`]]),v("div",ut,[O(P,{"model-value":B.value,readonly:"","flex-auto":"","font-mono":"",p:"x5 y2",n:"sm"},null,8,["model-value"]),v("div",lt,[G(O(M,{title:"Copy URL",n:"xs blue",icon:"carbon:copy",border:!1,onClick:l[0]||(l[0]=S=>E(ye)(V.value,"server-task-url"))},null,512),[[Q,"Copy URL"]]),G(O(M,{title:"Open in Editor",icon:"carbon-launch",n:"xs blue",border:!1,onClick:l[1]||(l[1]=S=>E(r)(k.task.handler))},null,512),[[Q,"Open in Editor"]])])]),O(M,{"h-full":"",n:"primary solid",onClick:z},{default:I(()=>[O(J,{icon:"carbon:send"})]),_:1})])]),v("div",ct,[(g(!0),$(W,null,Z(ee.value,S=>G((g(),R(M,{key:S.slug,class:F(n.value===S.slug?"text-primary n-primary":"border-transparent shadow-none"),onClick:ke=>n.value=S.slug},{default:I(()=>[O(J,{icon:E(he)[S.slug]},null,8,["icon"]),v("div",ft,[Y(A(S.name)+" "+A(S?.length?`(${S.length})`:"")+" ",1),v("span",null,A(E(X)[S.slug]?.length?`(${E(X)[S.slug].length})`:""),1)])]),_:2},1032,["class","onClick"])),[[Q,S.name]])),128))]),O(E(b),null,{default:I(()=>[O(ie,{modelValue:h.value,"onUpdate:modelValue":l[4]||(l[4]=S=>h.value=S),default:{active:!0,type:"string"},"max-h-xs":"","of-auto":""},{default:I(()=>[E(X)[n.value]?.length?(g(),$(W,{key:0},[v("div",pt,[l[6]||(l[6]=v("div",{"w-5":"","x-divider":""},null,-1)),l[7]||(l[7]=v("div",{"flex-none":""}," Default Inputs ",-1)),O(M,{icon:"i-carbon-edit",border:!1,onClick:l[2]||(l[2]=S=>x("openDefaultInput"))}),l[8]||(l[8]=v("div",{"x-divider":""},null,-1))]),O(ie,{modelValue:E(X)[n.value],"onUpdate:modelValue":l[3]||(l[3]=S=>E(X)[n.value]=S),disabled:"",p0:""},null,8,["modelValue"])],64)):j("",!0)]),_:1},8,["modelValue"])]),_:1}),h.value?(g(),$("div",dt,[n.value==="body"?(g(),$(W,{key:0},[v("div",vt,[(g(),$(W,null,Z(s,S=>v("button",{key:S,px4:"",py2:"",border:"r base",hover:"bg-active",class:F({"border-b":S!==i.value}),onClick:ke=>i.value=S},[v("div",{class:F({op30:S!==i.value}),"font-mono":""},A(S),3)],10,ht)),64)),l[9]||(l[9]=v("div",{border:"b base","flex-auto":""},null,-1))]),i.value==="input"?(g(),R(E(p),{key:0})):i.value==="json"?(g(),R(E(We),je({key:1,modelValue:w.value,"onUpdate:modelValue":l[5]||(l[5]=S=>w.value=S),class:[E(_)==="dark"?"jse-theme-dark":"light","json-editor-vue of-auto text-sm outline-none"]},k.$attrs,{mode:"text","navigation-bar":!1,indentation:2,"tab-size":2}),null,16,["modelValue","class"])):j("",!0)],64)):(g(),R(E(p),{key:1}))])):j("",!0),a.value?e.value?(g(),R(_e,{key:2,"z-10":"","flex-auto":"","backdrop-blur":""},{default:I(()=>l[11]||(l[11]=[Y(" Running... ")])),_:1})):(g(),$(W,{key:3},[v("div",mt,[l[13]||(l[13]=v("div",null,"Result",-1)),d.error?(g(),R(te,{key:0,n:"red"},{default:I(()=>l[12]||(l[12]=[Y(" Error ")])),_:1})):j("",!0),O(te,{n:d.error?"orange":"green",textContent:A(d.statusCode)},null,8,["n","textContent"]),d.contentType?(g(),$("code",yt,A(d.contentType),1)):j("",!0),l[14]||(l[14]=v("div",{"flex-auto":""},null,-1)),l[15]||(l[15]=v("div",{op50:""}," Tasks finished in ",-1)),O(te,{n:"green"},{default:I(()=>[Y(A(d.fetchTime)+" ms ",1)]),_:1})]),O(be,{"flex-auto":"","overflow-auto":"","py-2":"",code:y.value,lang:t.value},null,8,["code","lang"])],64)):(g(),R(ge,{key:1},{default:I(()=>[O(M,{n:"primary",onClick:z},{default:I(()=>[O(J,{icon:"carbon:send"}),l[10]||(l[10]=Y(" Run task "))]),_:1})]),_:1}))])}}}),_t={"flex-none":"","text-left":""},bt={flex:"","items-center":"","text-sm":"","font-mono":""},me=K({__name:"ServerTaskListItem",props:{item:{},index:{default:0}},setup(q){const L=H(!0),N=re();return(x,w)=>{const X=oe,b=me;return g(),$("div",null,[v("button",{flex:"~ gap-2","w-full":"","items-start":"","items-center":"","hover-bg-active":"",px2:"",py1:"",class:F([{"bg-active":E(N)===x.item.name}]),style:Be({paddingLeft:`calc(0.5rem + ${x.index*1.5}em)`}),onClick:w[0]||(w[0]=p=>{L.value=!L.value,N.value=x.item.name})},[v("div",_t,[x.item.type==="collection"?(g(),R(X,{key:0,icon:"carbon:chevron-right","mb0.5":"","transform-rotate":L.value?90:0,transition:""},null,8,["transform-rotate"])):j("",!0)]),v("span",bt,[x.item.type==="collection"?(g(),R(X,{key:0,title:`${x.item.tasks?.length} tasks`,icon:"carbon:folder",mr1:""},null,8,["title"])):(g(),R(X,{key:1,icon:"carbon:play",ml3:"",mr1:""})),Y(" "+A(x.item.name),1)])],6),w[1]||(w[1]=v("div",{"x-divider":""},null,-1)),L.value?He(x.$slots,"default",{key:0},()=>[(g(!0),$(W,null,Z(x.item.tasks,p=>(g(),R(b,{key:p.name,item:p,index:x.index+1},null,8,["item","index"]))),128))]):j("",!0)])}}}),kt={flex:"~ gap1","text-sm":""},Ot={key:0,op50:""},xt={op50:""},Vt=K({__name:"server-tasks",setup(q){const L=H(!1),N=$e(),x=U(()=>Object.keys(N.value?.tasks??{}).map(r=>({name:r,...N.value.tasks[r],type:"task"}))),w=U(()=>Object.entries(N.value?.scheduledTasks??{}).map(([r,n])=>({cron:r,tasks:n}))),X=re(),{view:b,selectedTask:p,inputDefaults:_}=le("serverTasks"),o=U(()=>{!X.value&&p.value&&(X.value=p.value.name);const r=x.value.find(n=>n.name===X.value);return X.value!==p.value?.name&&r&&(p.value=r),r}),d=H(""),y=U(()=>new Ue(x.value,{keys:["key","description"],shouldSort:!0})),t=U(()=>d.value?y.value.search(d.value).map(n=>n.item):x.value),e=U(()=>{const r=[],n=(i,u)=>{i.tasks||=[],i.tasks.push(u)},s=(i,u)=>{const h=u?u.tasks?.find(m=>m.name===i):r.find(m=>m.name===i);if(h)return{...h,type:"collection"};const c={name:i,handler:i,description:"",type:"collection",tasks:[]};return u?n(u,c):r.push(c),c};return t.value.forEach(i=>{let u;const h={...i,type:"task"},m=i.name.split(":").concat();m.length>0&&m[m.length-1].includes(".")&&m.pop(),m.forEach(f=>{u=s(f,u)}),u?n(u,h):r.push(h)}),r});function a(){b.value=b.value==="tree"?"list":"tree"}return(r,n)=>{const s=ce,i=Ae,u=ot,h=Le,c=gt,m=Ne,f=fe,C=ve,T=Pe,B=Ye,V=de("tooltip");return g(),$(W,null,[O(h,{"storage-key":"tab-server-tasks"},{left:I(()=>[O(h,{horizontal:"","storage-key":"tab-server-tasks-split"},{left:I(()=>[O(i,{search:d.value,"onUpdate:search":n[1]||(n[1]=D=>d.value=D),pb2:""},{actions:I(()=>[G(O(s,{"text-lg":"",icon:E(b)==="list"?"i-carbon-list":"i-carbon-tree-view-alt",title:"Toggle view",border:!1,onClick:a},null,8,["icon"]),[[V,"Toggle View"]]),G(O(s,{"text-lg":"",icon:"i-carbon-cics-sit-overrides",title:"Default Inputs",border:!1,onClick:n[0]||(n[0]=D=>L.value=!L.value)},null,512),[[V,"Default Inputs"]])]),default:I(()=>[v("div",kt,[d.value?(g(),$("span",Ot,A(t.value.length)+" matched · ",1)):j("",!0),v("span",xt,A(x.value?.length)+" tasks in total",1)])]),_:1},8,["search"]),(g(!0),$(W,null,Z(E(b)==="tree"?e.value:t.value,D=>(g(),R(me,{key:D.name,item:D},null,8,["item"]))),128))]),right:I(()=>[n[6]||(n[6]=v("div",{px4:"",py2:"",border:"b base"}," Cron groups ",-1)),v("div",null,[v("ul",null,[(g(!0),$(W,null,Z(w.value,D=>(g(),$("li",{key:D.cron},[O(u,{collection:D},null,8,["collection"])]))),128))])])]),_:1})]),right:I(()=>[(g(),R(ze,{max:10},[o.value?(g(),R(c,{key:o.value.name,task:o.value,onOpenDefaultInput:n[2]||(n[2]=D=>L.value=!0)},null,8,["task"])):j("",!0)],1024)),o.value?j("",!0):(g(),R(f,{key:0},{default:I(()=>[O(m,{px6:"",py2:""},{default:I(()=>n[7]||(n[7]=[v("span",{op75:""},"Select a task to start",-1)])),_:1})]),_:1}))]),_:1}),O(B,{modelValue:L.value,"onUpdate:modelValue":n[4]||(n[4]=D=>L.value=D),"auto-close":"","max-w-xl":"","min-w-xl":"",onClose:n[5]||(n[5]=D=>L.value=!1)},{default:I(()=>[v("div",null,[n[8]||(n[8]=v("div",{p4:"",border:"b base"},[v("span",{"text-lg":""},"Default Inputs"),v("br"),v("span",{"text-white":"",op50:""},"Merged as default for every task in DevTools")],-1)),O(T,{text:`Query ${E(_).query.length?`(${E(_).query.length})`:""}`,padding:!1,icon:E(he).query},{default:I(()=>[O(C,{modelValue:E(_).query,"onUpdate:modelValue":n[3]||(n[3]=D=>E(_).query=D),py0:"",default:{active:!0,type:"string"}},null,8,["modelValue"])]),_:1},8,["text","icon"])])]),_:1},8,["modelValue"])],64)}}});export{Vt as default};
|
|
1
|
+
import{b4 as re,E as oe,c as le,b1 as Oe,Q as xe,I as Te,K as Se,ag as we,b2 as Xe,J as De,a$ as Ee,s as Me,f as ce,w as Ce,d as fe,az as Ie,b5 as $e,N as Ue,q as Ne,U as Le}from"./oqehn934.js";import{_ as Ae}from"./nnavbar.vue-f0vufq5s.js";import{_ as pe}from"./nbadge-ixgsh96g.js";import{q as Re,k as K,b as H,l as U,Q as g,S as $,U as v,a0 as O,a5 as A,F as W,ab as Z,Y as F,u as E,W as j,r as se,w as Ve,ae as de,a8 as G,$ as I,a6 as P,M as R,a1 as je,av as We,X as Be,V as He,K as ze}from"./vendor/json-editor-vue-gi2fewby.js";import{_ as ve}from"./server-route-inputs.vue-c9toxo7z.js";import{_ as qe}from"./ncode-block.vue-gy1ero5j.js";import{S as he}from"./constants-b32h69zq.js";import{_ as Ye}from"./nsection-block-lalufadl.js";import{_ as Pe}from"./ndrawer.vue-oeawm3h0.js";import"./vendor/unocss-fae7bffg.js";import"./vendor/shiki-bnvxb5wv.js";import"./ncheckbox.vue-ktnsaj70.js";import"./nselect.vue-mgxbszb3.js";import"./client-c9f80qsp.js";import"./nicon-title.vue-ouqsubn7.js";var ne={exports:{}},ue;function Fe(){return ue||(ue=1,function(q,N){(function(x,w){q.exports=w()})(globalThis,()=>(()=>{var L={949:(b,p,_)=>{Object.defineProperty(p,"__esModule",{value:!0}),p.CronParser=void 0;var o=_(515),d=function(){function y(t,e,a){e===void 0&&(e=!0),a===void 0&&(a=!1),this.expression=t,this.dayOfWeekStartIndexZero=e,this.monthStartIndexZero=a}return y.prototype.parse=function(){var t,e,a=(t=this.expression)!==null&&t!==void 0?t:"";if(a.startsWith("@")){var r=this.parseSpecial(this.expression);e=this.extractParts(r)}else e=this.extractParts(this.expression);return this.normalize(e),this.validate(e),e},y.prototype.parseSpecial=function(t){var e={"@yearly":"0 0 1 1 *","@annually":"0 0 1 1 *","@monthly":"0 0 1 * *","@weekly":"0 0 * * 0","@daily":"0 0 * * *","@midnight":"0 0 * * *","@hourly":"0 * * * *"},a=e[t];if(!a)throw new Error("Unknown special expression.");return a},y.prototype.extractParts=function(t){if(!this.expression)throw new Error("cron expression is empty");for(var e=t.trim().split(/[ ]+/),a=0;a<e.length;a++)if(e[a].includes(",")){var r=e[a].split(",").map(function(s){return s.trim()}).filter(function(s){return s!==""}).map(function(s){return isNaN(Number(s))?s:Number(s)}).filter(function(s){return s!==null&&s!==""});r.length===0&&r.push("*"),r.sort(function(s,i){return s!==null&&i!==null?s-i:0}),e[a]=r.map(function(s){return s!==null?s.toString():""}).join(",")}if(e.length<5)throw new Error("Expression has only ".concat(e.length," part").concat(e.length==1?"":"s",". At least 5 parts are required."));if(e.length==5)e.unshift(""),e.push("");else if(e.length==6){var n=/\d{4}$/.test(e[5])||e[4]=="?"||e[2]=="?";n?e.unshift(""):e.push("")}else if(e.length>7)throw new Error("Expression has ".concat(e.length," parts; too many!"));return e},y.prototype.normalize=function(t){var e=this;if(t[3]=t[3].replace("?","*"),t[5]=t[5].replace("?","*"),t[2]=t[2].replace("?","*"),t[0].indexOf("0/")==0&&(t[0]=t[0].replace("0/","*/")),t[1].indexOf("0/")==0&&(t[1]=t[1].replace("0/","*/")),t[2].indexOf("0/")==0&&(t[2]=t[2].replace("0/","*/")),t[3].indexOf("1/")==0&&(t[3]=t[3].replace("1/","*/")),t[4].indexOf("1/")==0&&(t[4]=t[4].replace("1/","*/")),t[6].indexOf("1/")==0&&(t[6]=t[6].replace("1/","*/")),t[5]=t[5].replace(/(^\d)|([^#/\s]\d)/g,function(c){var m=c.replace(/\D/,""),f=m;return e.dayOfWeekStartIndexZero?m=="7"&&(f="0"):f=(parseInt(m)-1).toString(),c.replace(m,f)}),t[5]=="L"&&(t[5]="6"),t[3]=="?"&&(t[3]="*"),t[3].indexOf("W")>-1&&(t[3].indexOf(",")>-1||t[3].indexOf("-")>-1))throw new Error("The 'W' character can be specified only when the day-of-month is a single day, not a range or list of days.");var a={SUN:0,MON:1,TUE:2,WED:3,THU:4,FRI:5,SAT:6};for(var r in a)t[5]=t[5].replace(new RegExp(r,"gi"),a[r].toString());t[4]=t[4].replace(/(^\d{1,2})|([^#/\s]\d{1,2})/g,function(c){var m=c.replace(/\D/,""),f=m;return e.monthStartIndexZero&&(f=(parseInt(m)+1).toString()),c.replace(m,f)});var n={JAN:1,FEB:2,MAR:3,APR:4,MAY:5,JUN:6,JUL:7,AUG:8,SEP:9,OCT:10,NOV:11,DEC:12};for(var s in n)t[4]=t[4].replace(new RegExp(s,"gi"),n[s].toString());t[0]=="0"&&(t[0]=""),!/\*|\-|\,|\//.test(t[2])&&(/\*|\//.test(t[1])||/\*|\//.test(t[0]))&&(t[2]+="-".concat(t[2]));for(var i=0;i<t.length;i++)if(t[i].indexOf(",")!=-1&&(t[i]=t[i].split(",").filter(function(c){return c!==""}).join(",")||"*"),t[i]=="*/1"&&(t[i]="*"),t[i].indexOf("/")>-1&&!/^\*|\-|\,/.test(t[i])){var u=null;switch(i){case 4:u="12";break;case 5:u="6";break;case 6:u="9999";break;default:u=null;break}if(u!==null){var h=t[i].split("/");t[i]="".concat(h[0],"-").concat(u,"/").concat(h[1])}}},y.prototype.validate=function(t){this.assertNoInvalidCharacters("DOW",t[5]),this.assertNoInvalidCharacters("DOM",t[3]),this.validateRange(t)},y.prototype.validateRange=function(t){o.default.secondRange(t[0]),o.default.minuteRange(t[1]),o.default.hourRange(t[2]),o.default.dayOfMonthRange(t[3]),o.default.monthRange(t[4],this.monthStartIndexZero),o.default.dayOfWeekRange(t[5],this.dayOfWeekStartIndexZero)},y.prototype.assertNoInvalidCharacters=function(t,e){var a=e.match(/[A-KM-VX-Z]+/gi);if(a&&a.length)throw new Error("".concat(t," part contains invalid values: '").concat(a.toString(),"'"))},y}();p.CronParser=d},333:(b,p,_)=>{Object.defineProperty(p,"__esModule",{value:!0}),p.ExpressionDescriptor=void 0;var o=_(823),d=_(949),y=function(){function t(e,a){if(this.expression=e,this.options=a,this.expressionParts=new Array(5),!this.options.locale&&t.defaultLocale&&(this.options.locale=t.defaultLocale),!t.locales[this.options.locale]){var r=Object.keys(t.locales)[0];console.warn("Locale '".concat(this.options.locale,"' could not be found; falling back to '").concat(r,"'.")),this.options.locale=r}this.i18n=t.locales[this.options.locale],a.use24HourTimeFormat===void 0&&(a.use24HourTimeFormat=this.i18n.use24HourTimeFormatByDefault())}return t.toString=function(e,a){var r=a===void 0?{}:a,n=r.throwExceptionOnParseError,s=n===void 0?!0:n,i=r.verbose,u=i===void 0?!1:i,h=r.dayOfWeekStartIndexZero,c=h===void 0?!0:h,m=r.monthStartIndexZero,f=m===void 0?!1:m,C=r.use24HourTimeFormat,T=r.locale,B=T===void 0?null:T,V=r.tzOffset,D=V===void 0?0:V,z={throwExceptionOnParseError:s,verbose:u,dayOfWeekStartIndexZero:c,monthStartIndexZero:f,use24HourTimeFormat:C,locale:B,tzOffset:D},ee=new t(e,z);return ee.getFullDescription()},t.initialize=function(e,a){a===void 0&&(a="en"),t.specialCharacters=["/","-",",","*"],t.defaultLocale=a,e.load(t.locales)},t.prototype.getFullDescription=function(){var e="";try{var a=new d.CronParser(this.expression,this.options.dayOfWeekStartIndexZero,this.options.monthStartIndexZero);this.expressionParts=a.parse();var r=this.getTimeOfDayDescription(),n=this.getDayOfMonthDescription(),s=this.getMonthDescription(),i=this.getDayOfWeekDescription(),u=this.getYearDescription();e+=r+n+i+s+u,e=this.transformVerbosity(e,!!this.options.verbose),e=e.charAt(0).toLocaleUpperCase()+e.substr(1)}catch(h){if(!this.options.throwExceptionOnParseError)e=this.i18n.anErrorOccuredWhenGeneratingTheExpressionD();else throw"".concat(h)}return e},t.prototype.getTimeOfDayDescription=function(){var e=this.expressionParts[0],a=this.expressionParts[1],r=this.expressionParts[2],n="";if(!o.StringUtilities.containsAny(a,t.specialCharacters)&&!o.StringUtilities.containsAny(r,t.specialCharacters)&&!o.StringUtilities.containsAny(e,t.specialCharacters))n+=this.i18n.atSpace()+this.formatTime(r,a,e);else if(!e&&a.indexOf("-")>-1&&!(a.indexOf(",")>-1)&&!(a.indexOf("/")>-1)&&!o.StringUtilities.containsAny(r,t.specialCharacters)){var s=a.split("-");n+=o.StringUtilities.format(this.i18n.everyMinuteBetweenX0AndX1(),this.formatTime(r,s[0],""),this.formatTime(r,s[1],""))}else if(!e&&r.indexOf(",")>-1&&r.indexOf("-")==-1&&r.indexOf("/")==-1&&!o.StringUtilities.containsAny(a,t.specialCharacters)){var i=r.split(",");n+=this.i18n.at();for(var u=0;u<i.length;u++)n+=" ",n+=this.formatTime(i[u],a,""),u<i.length-2&&(n+=","),u==i.length-2&&(n+=this.i18n.spaceAnd())}else{var h=this.getSecondsDescription(),c=this.getMinutesDescription(),m=this.getHoursDescription();if(n+=h,n&&c&&(n+=", "),n+=c,c===m)return n;n&&m&&(n+=", "),n+=m}return n},t.prototype.getSecondsDescription=function(){var e=this,a=this.getSegmentDescription(this.expressionParts[0],this.i18n.everySecond(),function(r){return r},function(r){return o.StringUtilities.format(e.i18n.everyX0Seconds(r),r)},function(r){return e.i18n.secondsX0ThroughX1PastTheMinute()},function(r){return r=="0"?"":parseInt(r)<20?e.i18n.atX0SecondsPastTheMinute(r):e.i18n.atX0SecondsPastTheMinuteGt20()||e.i18n.atX0SecondsPastTheMinute(r)});return a},t.prototype.getMinutesDescription=function(){var e=this,a=this.expressionParts[0],r=this.expressionParts[2],n=this.getSegmentDescription(this.expressionParts[1],this.i18n.everyMinute(),function(s){return s},function(s){return o.StringUtilities.format(e.i18n.everyX0Minutes(s),s)},function(s){return e.i18n.minutesX0ThroughX1PastTheHour()},function(s){try{return s=="0"&&r.indexOf("/")==-1&&a==""?e.i18n.everyHour():parseInt(s)<20?e.i18n.atX0MinutesPastTheHour(s):e.i18n.atX0MinutesPastTheHourGt20()||e.i18n.atX0MinutesPastTheHour(s)}catch{return e.i18n.atX0MinutesPastTheHour(s)}});return n},t.prototype.getHoursDescription=function(){var e=this,a=this.expressionParts[2],r=this.getSegmentDescription(a,this.i18n.everyHour(),function(i){return e.formatTime(i,"0","")},function(i){return o.StringUtilities.format(e.i18n.everyX0Hours(i),i)},function(i){return e.i18n.betweenX0AndX1()},function(i){return e.i18n.atX0()});if(r&&a.includes("-")&&this.expressionParts[1]!="0"){var n=Array.from(r.matchAll(/:00/g));if(n.length>1){var s=n[n.length-1].index;r=r.substring(0,s)+":59"+r.substring(s+3)}}return r},t.prototype.getDayOfWeekDescription=function(){var e=this,a=this.i18n.daysOfTheWeek(),r=null;return this.expressionParts[5]=="*"?r="":r=this.getSegmentDescription(this.expressionParts[5],this.i18n.commaEveryDay(),function(n,s){var i=n;n.indexOf("#")>-1?i=n.substring(0,n.indexOf("#")):n.indexOf("L")>-1&&(i=i.replace("L",""));var u=parseInt(i);if(e.options.tzOffset){var h=e.expressionParts[2],c=parseInt(h)+(e.options.tzOffset?e.options.tzOffset:0);c>=24?u++:c<0&&u--,u>6?u=0:u<0&&(u=6)}var m=e.i18n.daysOfTheWeekInCase?e.i18n.daysOfTheWeekInCase(s)[u]:a[u];if(n.indexOf("#")>-1){var f=null,C=n.substring(n.indexOf("#")+1),T=n.substring(0,n.indexOf("#"));switch(C){case"1":f=e.i18n.first(T);break;case"2":f=e.i18n.second(T);break;case"3":f=e.i18n.third(T);break;case"4":f=e.i18n.fourth(T);break;case"5":f=e.i18n.fifth(T);break}m=f+" "+m}return m},function(n){return parseInt(n)==1?"":o.StringUtilities.format(e.i18n.commaEveryX0DaysOfTheWeek(n),n)},function(n){var s=n.substring(0,n.indexOf("-")),i=e.expressionParts[3]!="*";return i?e.i18n.commaAndX0ThroughX1(s):e.i18n.commaX0ThroughX1(s)},function(n){var s=null;if(n.indexOf("#")>-1){var i=n.substring(n.indexOf("#")+1),u=n.substring(0,n.indexOf("#"));s=e.i18n.commaOnThe(i,u).trim()+e.i18n.spaceX0OfTheMonth()}else if(n.indexOf("L")>-1)s=e.i18n.commaOnTheLastX0OfTheMonth(n.replace("L",""));else{var h=e.expressionParts[3]!="*";s=h?e.i18n.commaAndOnX0():e.i18n.commaOnlyOnX0(n)}return s}),r},t.prototype.getMonthDescription=function(){var e=this,a=this.i18n.monthsOfTheYear(),r=this.getSegmentDescription(this.expressionParts[4],"",function(n,s){return s&&e.i18n.monthsOfTheYearInCase?e.i18n.monthsOfTheYearInCase(s)[parseInt(n)-1]:a[parseInt(n)-1]},function(n){return parseInt(n)==1?"":o.StringUtilities.format(e.i18n.commaEveryX0Months(n),n)},function(n){return e.i18n.commaMonthX0ThroughMonthX1()||e.i18n.commaX0ThroughX1()},function(n){return e.i18n.commaOnlyInMonthX0?e.i18n.commaOnlyInMonthX0():e.i18n.commaOnlyInX0()});return r},t.prototype.getDayOfMonthDescription=function(){var e=this,a=null,r=this.expressionParts[3];switch(r){case"L":a=this.i18n.commaOnTheLastDayOfTheMonth();break;case"WL":case"LW":a=this.i18n.commaOnTheLastWeekdayOfTheMonth();break;default:var n=r.match(/(\d{1,2}W)|(W\d{1,2})/);if(n){var s=parseInt(n[0].replace("W","")),i=s==1?this.i18n.firstWeekday():o.StringUtilities.format(this.i18n.weekdayNearestDayX0(),s.toString());a=o.StringUtilities.format(this.i18n.commaOnTheX0OfTheMonth(),i);break}else{var u=r.match(/L-(\d{1,2})/);if(u){var h=u[1];a=o.StringUtilities.format(this.i18n.commaDaysBeforeTheLastDayOfTheMonth(h),h);break}else{if(r=="*"&&this.expressionParts[5]!="*")return"";a=this.getSegmentDescription(r,this.i18n.commaEveryDay(),function(c){return c=="L"?e.i18n.lastDay():e.i18n.dayX0?o.StringUtilities.format(e.i18n.dayX0(),c):c},function(c){return c=="1"?e.i18n.commaEveryDay():e.i18n.commaEveryX0Days(c)},function(c){return e.i18n.commaBetweenDayX0AndX1OfTheMonth(c)},function(c){return e.i18n.commaOnDayX0OfTheMonth(c)})}break}}return a},t.prototype.getYearDescription=function(){var e=this,a=this.getSegmentDescription(this.expressionParts[6],"",function(r){return/^\d+$/.test(r)?new Date(parseInt(r),1).getFullYear().toString():r},function(r){return o.StringUtilities.format(e.i18n.commaEveryX0Years(r),r)},function(r){return e.i18n.commaYearX0ThroughYearX1()||e.i18n.commaX0ThroughX1()},function(r){return e.i18n.commaOnlyInYearX0?e.i18n.commaOnlyInYearX0():e.i18n.commaOnlyInX0()});return a},t.prototype.getSegmentDescription=function(e,a,r,n,s,i){var u=null,h=e.indexOf("/")>-1,c=e.indexOf("-")>-1,m=e.indexOf(",")>-1;if(!e)u="";else if(e==="*")u=a;else if(!h&&!c&&!m)u=o.StringUtilities.format(i(e),r(e));else if(m){for(var f=e.split(","),C="",T=0;T<f.length;T++)if(T>0&&f.length>2&&(C+=",",T<f.length-1&&(C+=" ")),T>0&&f.length>1&&(T==f.length-1||f.length==2)&&(C+="".concat(this.i18n.spaceAnd()," ")),f[T].indexOf("/")>-1||f[T].indexOf("-")>-1){var B=f[T].indexOf("-")>-1&&f[T].indexOf("/")==-1,V=this.getSegmentDescription(f[T],a,r,n,B?this.i18n.commaX0ThroughX1:s,i);B&&(V=V.replace(", ","")),C+=V}else h?C+=this.getSegmentDescription(f[T],a,r,n,s,i):C+=r(f[T]);h?u=C:u=o.StringUtilities.format(i(e),C)}else if(h){var f=e.split("/");if(u=o.StringUtilities.format(n(f[1]),f[1]),f[0].indexOf("-")>-1){var D=this.generateRangeSegmentDescription(f[0],s,r);D.indexOf(", ")!=0&&(u+=", "),u+=D}else if(f[0].indexOf("*")==-1){var z=o.StringUtilities.format(i(f[0]),r(f[0]));z=z.replace(", ",""),u+=o.StringUtilities.format(this.i18n.commaStartingX0(),z)}}else c&&(u=this.generateRangeSegmentDescription(e,s,r));return u},t.prototype.generateRangeSegmentDescription=function(e,a,r){var n="",s=e.split("-"),i=r(s[0],1),u=r(s[1],2),h=a(e);return n+=o.StringUtilities.format(h,i,u),n},t.prototype.formatTime=function(e,a,r){var n=0,s=0;this.options.tzOffset&&(n=this.options.tzOffset>0?Math.floor(this.options.tzOffset):Math.ceil(this.options.tzOffset),s=parseFloat((this.options.tzOffset%1).toFixed(2)),s!=0&&(s*=60));var i=parseInt(e)+n,u=parseInt(a)+s;u>=60?(u-=60,i+=1):u<0&&(u+=60,i-=1),i>=24?i=i-24:i<0&&(i=24+i);var h="",c=!1;this.options.use24HourTimeFormat||(c=!!(this.i18n.setPeriodBeforeTime&&this.i18n.setPeriodBeforeTime()),h=c?"".concat(this.getPeriod(i)," "):" ".concat(this.getPeriod(i)),i>12&&(i-=12),i===0&&(i=12));var m="";return r&&(m=":".concat(("00"+r).substring(r.length))),"".concat(c?h:"").concat(("00"+i.toString()).substring(i.toString().length),":").concat(("00"+u.toString()).substring(u.toString().length)).concat(m).concat(c?"":h)},t.prototype.transformVerbosity=function(e,a){return a||(e=e.replace(new RegExp(", ".concat(this.i18n.everyMinute()),"g"),""),e=e.replace(new RegExp(", ".concat(this.i18n.everyHour()),"g"),""),e=e.replace(new RegExp(this.i18n.commaEveryDay(),"g"),""),e=e.replace(/\, ?$/,"")),e},t.prototype.getPeriod=function(e){return e>=12?this.i18n.pm&&this.i18n.pm()||"PM":this.i18n.am&&this.i18n.am()||"AM"},t.locales={},t}();p.ExpressionDescriptor=y},747:(b,p,_)=>{Object.defineProperty(p,"__esModule",{value:!0}),p.enLocaleLoader=void 0;var o=_(486),d=function(){function y(){}return y.prototype.load=function(t){t.en=new o.en},y}();p.enLocaleLoader=d},486:(b,p)=>{Object.defineProperty(p,"__esModule",{value:!0}),p.en=void 0;var _=function(){function o(){}return o.prototype.atX0SecondsPastTheMinuteGt20=function(){return null},o.prototype.atX0MinutesPastTheHourGt20=function(){return null},o.prototype.commaMonthX0ThroughMonthX1=function(){return null},o.prototype.commaYearX0ThroughYearX1=function(){return null},o.prototype.use24HourTimeFormatByDefault=function(){return!1},o.prototype.anErrorOccuredWhenGeneratingTheExpressionD=function(){return"An error occured when generating the expression description. Check the cron expression syntax."},o.prototype.everyMinute=function(){return"every minute"},o.prototype.everyHour=function(){return"every hour"},o.prototype.atSpace=function(){return"At "},o.prototype.everyMinuteBetweenX0AndX1=function(){return"Every minute between %s and %s"},o.prototype.at=function(){return"At"},o.prototype.spaceAnd=function(){return" and"},o.prototype.everySecond=function(){return"every second"},o.prototype.everyX0Seconds=function(){return"every %s seconds"},o.prototype.secondsX0ThroughX1PastTheMinute=function(){return"seconds %s through %s past the minute"},o.prototype.atX0SecondsPastTheMinute=function(){return"at %s seconds past the minute"},o.prototype.everyX0Minutes=function(){return"every %s minutes"},o.prototype.minutesX0ThroughX1PastTheHour=function(){return"minutes %s through %s past the hour"},o.prototype.atX0MinutesPastTheHour=function(){return"at %s minutes past the hour"},o.prototype.everyX0Hours=function(){return"every %s hours"},o.prototype.betweenX0AndX1=function(){return"between %s and %s"},o.prototype.atX0=function(){return"at %s"},o.prototype.commaEveryDay=function(){return", every day"},o.prototype.commaEveryX0DaysOfTheWeek=function(){return", every %s days of the week"},o.prototype.commaX0ThroughX1=function(){return", %s through %s"},o.prototype.commaAndX0ThroughX1=function(){return", %s through %s"},o.prototype.first=function(){return"first"},o.prototype.second=function(){return"second"},o.prototype.third=function(){return"third"},o.prototype.fourth=function(){return"fourth"},o.prototype.fifth=function(){return"fifth"},o.prototype.commaOnThe=function(){return", on the "},o.prototype.spaceX0OfTheMonth=function(){return" %s of the month"},o.prototype.lastDay=function(){return"the last day"},o.prototype.commaOnTheLastX0OfTheMonth=function(){return", on the last %s of the month"},o.prototype.commaOnlyOnX0=function(){return", only on %s"},o.prototype.commaAndOnX0=function(){return", and on %s"},o.prototype.commaEveryX0Months=function(){return", every %s months"},o.prototype.commaOnlyInX0=function(){return", only in %s"},o.prototype.commaOnTheLastDayOfTheMonth=function(){return", on the last day of the month"},o.prototype.commaOnTheLastWeekdayOfTheMonth=function(){return", on the last weekday of the month"},o.prototype.commaDaysBeforeTheLastDayOfTheMonth=function(){return", %s days before the last day of the month"},o.prototype.firstWeekday=function(){return"first weekday"},o.prototype.weekdayNearestDayX0=function(){return"weekday nearest day %s"},o.prototype.commaOnTheX0OfTheMonth=function(){return", on the %s of the month"},o.prototype.commaEveryX0Days=function(){return", every %s days"},o.prototype.commaBetweenDayX0AndX1OfTheMonth=function(){return", between day %s and %s of the month"},o.prototype.commaOnDayX0OfTheMonth=function(){return", on day %s of the month"},o.prototype.commaEveryHour=function(){return", every hour"},o.prototype.commaEveryX0Years=function(){return", every %s years"},o.prototype.commaStartingX0=function(){return", starting %s"},o.prototype.daysOfTheWeek=function(){return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},o.prototype.monthsOfTheYear=function(){return["January","February","March","April","May","June","July","August","September","October","November","December"]},o}();p.en=_},515:(b,p)=>{Object.defineProperty(p,"__esModule",{value:!0});function _(d,y){if(!d)throw new Error(y)}var o=function(){function d(){}return d.secondRange=function(y){for(var t=y.split(","),e=0;e<t.length;e++)if(!isNaN(parseInt(t[e],10))){var a=parseInt(t[e],10);_(a>=0&&a<=59,"seconds part must be >= 0 and <= 59")}},d.minuteRange=function(y){for(var t=y.split(","),e=0;e<t.length;e++)if(!isNaN(parseInt(t[e],10))){var a=parseInt(t[e],10);_(a>=0&&a<=59,"minutes part must be >= 0 and <= 59")}},d.hourRange=function(y){for(var t=y.split(","),e=0;e<t.length;e++)if(!isNaN(parseInt(t[e],10))){var a=parseInt(t[e],10);_(a>=0&&a<=23,"hours part must be >= 0 and <= 23")}},d.dayOfMonthRange=function(y){for(var t=y.split(","),e=0;e<t.length;e++)if(!isNaN(parseInt(t[e],10))){var a=parseInt(t[e],10);_(a>=1&&a<=31,"DOM part must be >= 1 and <= 31")}},d.monthRange=function(y,t){for(var e=y.split(","),a=0;a<e.length;a++)if(!isNaN(parseInt(e[a],10))){var r=parseInt(e[a],10);_(r>=1&&r<=12,t?"month part must be >= 0 and <= 11":"month part must be >= 1 and <= 12")}},d.dayOfWeekRange=function(y,t){for(var e=y.split(","),a=0;a<e.length;a++)if(!isNaN(parseInt(e[a],10))){var r=parseInt(e[a],10);_(r>=0&&r<=6,t?"DOW part must be >= 0 and <= 6":"DOW part must be >= 1 and <= 7")}},d}();p.default=o},823:(b,p)=>{Object.defineProperty(p,"__esModule",{value:!0}),p.StringUtilities=void 0;var _=function(){function o(){}return o.format=function(d){for(var y=[],t=1;t<arguments.length;t++)y[t-1]=arguments[t];return d.replace(/%s/g,function(e){return y.shift()})},o.containsAny=function(d,y){return y.some(function(t){return d.indexOf(t)>-1})},o}();p.StringUtilities=_}},x={};function w(b){var p=x[b];if(p!==void 0)return p.exports;var _=x[b]={exports:{}};return L[b](_,_.exports,w),_.exports}var X={};return(()=>{var b=X;Object.defineProperty(b,"__esModule",{value:!0}),b.toString=void 0;var p=w(333),_=w(747);p.ExpressionDescriptor.initialize(new _.enLocaleLoader),b.default=p.ExpressionDescriptor;var o=p.ExpressionDescriptor.toString;b.toString=o})(),X})())}(ne)),ne.exports}var Ge=Fe();const Ze=Re(Ge),Je=["title"],Qe={"flex-none":"","text-left":""},Ke={flex:"~ gap-2","min-w-0":"","items-center":"","text-sm":""},et={class:"truncate"},tt={"text-xs":"",op50:""},nt={key:0},rt=["onClick"],ot=K({__name:"CronCollection",props:{collection:{}},setup(q){const N=q,L=re(),x=H(!0),w=U(()=>Ze.toString(N.collection.cron));return(X,b)=>{const p=oe,_=pe;return g(),$("div",null,[v("button",{flex:"~ gap-2","w-full":"","items-start":"","items-center":"","hover-bg-active":"",p2:"",title:w.value,onClick:b[0]||(b[0]=o=>x.value=!x.value)},[v("div",Qe,[O(p,{icon:"carbon:chevron-right","mb0.5":"","transform-rotate":x.value?90:0,transition:""},null,8,["transform-rotate"])]),v("span",Ke,[O(_,{class:"font-mono n-primary",textContent:A(X.collection.cron)},null,8,["textContent"]),v("span",et,A(w.value),1),v("span",tt,"("+A(X.collection.tasks.length)+")",1)])],8,Je),b[2]||(b[2]=v("div",{"x-divider":""},null,-1)),x.value?(g(),$("ul",nt,[(g(!0),$(W,null,Z(X.collection.tasks,o=>(g(),$("li",{key:o},[v("button",{flex:"~ gap-2","w-full":"","items-start":"","items-center":"","hover-bg-active":"",px2:"",py1:"","pl-9":"","font-mono":"",class:F([{"bg-active":E(L)===o}]),onClick:d=>L.value=o},A(o),11,rt),b[1]||(b[1]=v("div",{"x-divider":""},null,-1))]))),128))])):j("",!0)])}}}),at={"h-full":"","w-full":"",flex:"~ col"},it={flex:"~ col gap-2","flex-none":"",p4:"","n-navbar-glass":""},st={flex:"~ gap2 items-center"},ut={relative:"","w-full":""},lt={absolute:"","right-2":"","top-1.5":"",flex:"~ gap-1"},ct={flex:"~ gap2 wrap","w-full":"","items-center":"",px4:"",pb2:"","text-center":"","text-sm":"",border:"b base"},ft={class:"hidden md:block"},pt={flex:"~ gap2","mb--2":"","items-center":"",op50:""},dt={key:0,border:"b base",relative:"","n-code-block":""},vt={flex:"~ wrap","w-full":""},ht=["onClick"],mt={border:"b base",flex:"~ gap2","items-center":"",px4:"",py2:""},yt={key:1,"text-xs":"",op50:""},gt=K({__name:"ServerTaskDetails",props:{task:{}},emits:["openDefaultInput"],setup(q,{emit:N}){const L=q,x=N,w=H({payload:{}}),{inputDefaults:X}=le("serverRoutes"),[b,p]=Oe(),_=xe(),o=Te(),d=se({contentType:"text/plain",data:"",statusCode:200,error:void 0,fetchTime:0}),y=U(()=>JSON.stringify(d.data,null,2)),t=U(()=>d.contentType.includes("application/json")?"json":"text"),e=H(!1),a=H(!1),r=Se(),n=H(),s=["json"],i=H(s[0]),u=se({query:[{active:!0,key:"",value:"",type:"string"}],body:[{active:!0,key:"",value:"",type:"string"}],headers:[]}),h=U({get:()=>u[n.value],set:k=>{u[n.value]=k}}),c=U(()=>({...D(X.value.query),...D(u.query)})),m=U(()=>({...D(X.value.headers)})),f=U(()=>Object.keys(w.value?.payload??{}).length?{...w.value}:void 0),C=U(()=>f.value?"POST":"GET"),T=U(()=>{let k=window?.location.origin;return k.charAt(k.length-1)==="/"&&(k=k.slice(0,-1)),k}),B=U(()=>{let k=new URLSearchParams(c.value).toString();k&&(k=`?${k}`);const l=`/_nitro/tasks/${L.task.name}${k}`;let M=o.value?.app.baseURL||"";return(M==="./"||M===".")&&(M=""),M.endsWith("/")&&(M=M.slice(0,-1)),M+l}),V=U(()=>T.value+B.value);function D(k){const l=Object.fromEntries(k.filter(({active:M,key:Y,value:J})=>M&&Y&&J!==void 0).map(({key:M,value:Y})=>[M,Y]));return Object.entries(l).length?l:void 0}async function z(){a.value=!0,e.value=!0;const k=Date.now();Me("server-tasks:run",{method:C.value});try{d.data=await $fetch(V.value,{method:"POST",headers:m.value,query:c.value,body:f.value,onResponse({response:l}){d.contentType=(l.headers.get("content-type")||"").toString().toLowerCase().trim(),d.statusCode=l.status,d.error=void 0},onResponseError(l){d.error=l.response._data,d.data=l.response._data}})}catch{}e.value=!1,d.fetchTime=Date.now()-k}const ee=U(()=>{const k=[];return k.push({name:"Query",slug:"query",length:u.query.length}),k.push({name:"Body",slug:"body",length:u.body.length}),k});Ve(()=>{if(i.value==="json"&&typeof w.value=="string")try{w.value=JSON.parse(w.value)}catch{}});const ae=we("nuxt-devtools:server-tasks:inputs",()=>[],{window:window.parent});Xe([u,n],()=>{const k=ae.value?.find(l=>l.task===L.task.name);if(k){n.value||(n.value=k.tab),k.tab!==n.value&&(k.tab=n.value);const{body:l,query:M,headers:Y}=k.inputs;Object.assign(u,{body:l,query:M,headers:Y})}else{const l={task:L.task.name,tab:"query",inputs:u};ae.value.push(l),n.value||(n.value=l.tab)}},{immediate:!0,deep:!0,debounce:500});const ye=De();return(k,l)=>{const M=ce,Y=Ce,J=oe,ie=ve,ge=fe,_e=Ie,te=pe,be=qe,Q=de("tooltip");return g(),$("div",at,[v("div",it,[v("div",st,[G((g(),$("div",null,[O(M,{class:F(["n-badge-base n-sm",E(Ee)(C.value)]),"pointer-events-none":"","font-mono":"",tabindex:"-1"},{default:I(()=>[P(A(C.value),1)]),_:1},8,["class"])])),[[Q,`Method is ${C.value} as ${C.value==="GET"?"no":""} json body is sent`]]),v("div",ut,[O(Y,{"model-value":B.value,readonly:"","flex-auto":"","font-mono":"",p:"x5 y2",n:"sm"},null,8,["model-value"]),v("div",lt,[G(O(M,{title:"Copy URL",n:"xs blue",icon:"carbon:copy",border:!1,onClick:l[0]||(l[0]=S=>E(ye)(V.value,"server-task-url"))},null,512),[[Q,"Copy URL"]]),G(O(M,{title:"Open in Editor",icon:"carbon-launch",n:"xs blue",border:!1,onClick:l[1]||(l[1]=S=>E(r)(k.task.handler))},null,512),[[Q,"Open in Editor"]])])]),O(M,{"h-full":"",n:"primary solid",onClick:z},{default:I(()=>[O(J,{icon:"carbon:send"})]),_:1})])]),v("div",ct,[(g(!0),$(W,null,Z(ee.value,S=>G((g(),R(M,{key:S.slug,class:F(n.value===S.slug?"text-primary n-primary":"border-transparent shadow-none"),onClick:ke=>n.value=S.slug},{default:I(()=>[O(J,{icon:E(he)[S.slug]},null,8,["icon"]),v("div",ft,[P(A(S.name)+" "+A(S?.length?`(${S.length})`:"")+" ",1),v("span",null,A(E(X)[S.slug]?.length?`(${E(X)[S.slug].length})`:""),1)])]),_:2},1032,["class","onClick"])),[[Q,S.name]])),128))]),O(E(b),null,{default:I(()=>[O(ie,{modelValue:h.value,"onUpdate:modelValue":l[4]||(l[4]=S=>h.value=S),default:{active:!0,type:"string"},"max-h-xs":"","of-auto":""},{default:I(()=>[E(X)[n.value]?.length?(g(),$(W,{key:0},[v("div",pt,[l[6]||(l[6]=v("div",{"w-5":"","x-divider":""},null,-1)),l[7]||(l[7]=v("div",{"flex-none":""}," Default Inputs ",-1)),O(M,{icon:"i-carbon-edit",border:!1,onClick:l[2]||(l[2]=S=>x("openDefaultInput"))}),l[8]||(l[8]=v("div",{"x-divider":""},null,-1))]),O(ie,{modelValue:E(X)[n.value],"onUpdate:modelValue":l[3]||(l[3]=S=>E(X)[n.value]=S),disabled:"",p0:""},null,8,["modelValue"])],64)):j("",!0)]),_:1},8,["modelValue"])]),_:1}),h.value?(g(),$("div",dt,[n.value==="body"?(g(),$(W,{key:0},[v("div",vt,[(g(),$(W,null,Z(s,S=>v("button",{key:S,px4:"",py2:"",border:"r base",hover:"bg-active",class:F({"border-b":S!==i.value}),onClick:ke=>i.value=S},[v("div",{class:F({op30:S!==i.value}),"font-mono":""},A(S),3)],10,ht)),64)),l[9]||(l[9]=v("div",{border:"b base","flex-auto":""},null,-1))]),i.value==="input"?(g(),R(E(p),{key:0})):i.value==="json"?(g(),R(E(We),je({key:1,modelValue:w.value,"onUpdate:modelValue":l[5]||(l[5]=S=>w.value=S),class:[E(_)==="dark"?"jse-theme-dark":"light","json-editor-vue of-auto text-sm outline-none"]},k.$attrs,{mode:"text","navigation-bar":!1,indentation:2,"tab-size":2}),null,16,["modelValue","class"])):j("",!0)],64)):(g(),R(E(p),{key:1}))])):j("",!0),a.value?e.value?(g(),R(_e,{key:2,"z-10":"","flex-auto":"","backdrop-blur":""},{default:I(()=>l[11]||(l[11]=[P(" Running... ")])),_:1})):(g(),$(W,{key:3},[v("div",mt,[l[13]||(l[13]=v("div",null,"Result",-1)),d.error?(g(),R(te,{key:0,n:"red"},{default:I(()=>l[12]||(l[12]=[P(" Error ")])),_:1})):j("",!0),O(te,{n:d.error?"orange":"green",textContent:A(d.statusCode)},null,8,["n","textContent"]),d.contentType?(g(),$("code",yt,A(d.contentType),1)):j("",!0),l[14]||(l[14]=v("div",{"flex-auto":""},null,-1)),l[15]||(l[15]=v("div",{op50:""}," Tasks finished in ",-1)),O(te,{n:"green"},{default:I(()=>[P(A(d.fetchTime)+" ms ",1)]),_:1})]),O(be,{"flex-auto":"","overflow-auto":"","py-2":"",code:y.value,lang:t.value},null,8,["code","lang"])],64)):(g(),R(ge,{key:1},{default:I(()=>[O(M,{n:"primary",onClick:z},{default:I(()=>[O(J,{icon:"carbon:send"}),l[10]||(l[10]=P(" Run task "))]),_:1})]),_:1}))])}}}),_t={"flex-none":"","text-left":""},bt={flex:"","items-center":"","text-sm":"","font-mono":""},me=K({__name:"ServerTaskListItem",props:{item:{},index:{default:0}},setup(q){const N=H(!0),L=re();return(x,w)=>{const X=oe,b=me;return g(),$("div",null,[v("button",{flex:"~ gap-2","w-full":"","items-start":"","items-center":"","hover-bg-active":"",px2:"",py1:"",class:F([{"bg-active":E(L)===x.item.name}]),style:Be({paddingLeft:`calc(0.5rem + ${x.index*1.5}em)`}),onClick:w[0]||(w[0]=p=>{N.value=!N.value,L.value=x.item.name})},[v("div",_t,[x.item.type==="collection"?(g(),R(X,{key:0,icon:"carbon:chevron-right","mb0.5":"","transform-rotate":N.value?90:0,transition:""},null,8,["transform-rotate"])):j("",!0)]),v("span",bt,[x.item.type==="collection"?(g(),R(X,{key:0,title:`${x.item.tasks?.length} tasks`,icon:"carbon:folder",mr1:""},null,8,["title"])):(g(),R(X,{key:1,icon:"carbon:play",ml3:"",mr1:""})),P(" "+A(x.item.name),1)])],6),w[1]||(w[1]=v("div",{"x-divider":""},null,-1)),N.value?He(x.$slots,"default",{key:0},()=>[(g(!0),$(W,null,Z(x.item.tasks,p=>(g(),R(b,{key:p.name,item:p,index:x.index+1},null,8,["item","index"]))),128))]):j("",!0)])}}}),kt={flex:"~ gap1","text-sm":""},Ot={key:0,op50:""},xt={op50:""},Vt=K({__name:"server-tasks",setup(q){const N=H(!1),L=$e(),x=U(()=>Object.keys(L.value?.tasks??{}).map(r=>({name:r,...L.value.tasks[r],type:"task"}))),w=U(()=>Object.entries(L.value?.scheduledTasks??{}).map(([r,n])=>({cron:r,tasks:n}))),X=re(),{view:b,selectedTask:p,inputDefaults:_}=le("serverTasks"),o=U(()=>{!X.value&&p.value&&(X.value=p.value.name);const r=x.value.find(n=>n.name===X.value);return X.value!==p.value?.name&&r&&(p.value=r),r}),d=H(""),y=U(()=>new Ue(x.value,{keys:["key","description"],shouldSort:!0})),t=U(()=>d.value?y.value.search(d.value).map(n=>n.item):x.value),e=U(()=>{const r=[],n=(i,u)=>{i.tasks||=[],i.tasks.push(u)},s=(i,u)=>{const h=u?u.tasks?.find(m=>m.name===i):r.find(m=>m.name===i);if(h)return{...h,type:"collection"};const c={name:i,handler:i,description:"",type:"collection",tasks:[]};return u?n(u,c):r.push(c),c};return t.value.forEach(i=>{let u;const h={...i,type:"task"},m=i.name.split(":").concat();m.length>0&&m[m.length-1].includes(".")&&m.pop(),m.forEach(f=>{u=s(f,u)}),u?n(u,h):r.push(h)}),r});function a(){b.value=b.value==="tree"?"list":"tree"}return(r,n)=>{const s=ce,i=Ae,u=ot,h=Ne,c=gt,m=Le,f=fe,C=ve,T=Ye,B=Pe,V=de("tooltip");return g(),$(W,null,[O(h,{"storage-key":"tab-server-tasks"},{left:I(()=>[O(h,{horizontal:"","storage-key":"tab-server-tasks-split"},{left:I(()=>[O(i,{search:d.value,"onUpdate:search":n[1]||(n[1]=D=>d.value=D),pb2:""},{actions:I(()=>[G(O(s,{"text-lg":"",icon:E(b)==="list"?"i-carbon-list":"i-carbon-tree-view-alt",title:"Toggle view",border:!1,onClick:a},null,8,["icon"]),[[V,"Toggle View"]]),G(O(s,{"text-lg":"",icon:"i-carbon-cics-sit-overrides",title:"Default Inputs",border:!1,onClick:n[0]||(n[0]=D=>N.value=!N.value)},null,512),[[V,"Default Inputs"]])]),default:I(()=>[v("div",kt,[d.value?(g(),$("span",Ot,A(t.value.length)+" matched · ",1)):j("",!0),v("span",xt,A(x.value?.length)+" tasks in total",1)])]),_:1},8,["search"]),(g(!0),$(W,null,Z(E(b)==="tree"?e.value:t.value,D=>(g(),R(me,{key:D.name,item:D},null,8,["item"]))),128))]),right:I(()=>[n[6]||(n[6]=v("div",{px4:"",py2:"",border:"b base"}," Cron groups ",-1)),v("div",null,[v("ul",null,[(g(!0),$(W,null,Z(w.value,D=>(g(),$("li",{key:D.cron},[O(u,{collection:D},null,8,["collection"])]))),128))])])]),_:1})]),right:I(()=>[(g(),R(ze,{max:10},[o.value?(g(),R(c,{key:o.value.name,task:o.value,onOpenDefaultInput:n[2]||(n[2]=D=>N.value=!0)},null,8,["task"])):j("",!0)],1024)),o.value?j("",!0):(g(),R(f,{key:0},{default:I(()=>[O(m,{px6:"",py2:""},{default:I(()=>n[7]||(n[7]=[v("span",{op75:""},"Select a task to start",-1)])),_:1})]),_:1}))]),_:1}),O(B,{modelValue:N.value,"onUpdate:modelValue":n[4]||(n[4]=D=>N.value=D),"auto-close":"","max-w-xl":"","min-w-xl":"",onClose:n[5]||(n[5]=D=>N.value=!1)},{default:I(()=>[v("div",null,[n[8]||(n[8]=v("div",{p4:"",border:"b base"},[v("span",{"text-lg":""},"Default Inputs"),v("br"),v("span",{"text-white":"",op50:""},"Merged as default for every task in DevTools")],-1)),O(T,{text:`Query ${E(_).query.length?`(${E(_).query.length})`:""}`,padding:!1,icon:E(he).query},{default:I(()=>[O(C,{modelValue:E(_).query,"onUpdate:modelValue":n[3]||(n[3]=D=>E(_).query=D),py0:"",default:{active:!0,type:"string"}},null,8,["modelValue"])]),_:1},8,["text","icon"])])]),_:1},8,["modelValue"])],64)}}});export{Vt as default};
|