@nuxt/devtools-nightly 2.1.0-28994893.66d2743 → 2.1.0-29010833.15dbe6d
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 +27 -6787
- package/dist/chunks/vscode.mjs +0 -6
- package/dist/client/200.html +17 -17
- package/dist/client/404.html +17 -17
- package/dist/client/_nuxt/__blank-iu6fjs04.js +1 -0
- package/dist/client/_nuxt/{analyze-build-bbw1j0bw.js → analyze-build-cvjhkvjo.js} +1 -1
- package/dist/client/_nuxt/assets-oulv8p46.js +16 -0
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/bd03726f-7c3f-41c8-b19c-af4bfadbf82a.json +1 -0
- package/dist/client/_nuxt/{code-diff.vue-g3avq04d.js → code-diff.vue-eocc41pr.js} +1 -1
- package/dist/client/_nuxt/{code-snippets.vue-pb1tfwrq.js → code-snippets.vue-efpsav7c.js} +1 -1
- package/dist/client/_nuxt/{components-jj59wik2.js → components-oyyjeqiw.js} +1 -1
- package/dist/client/_nuxt/composable-item.vue-bzp63wwm.js +1 -0
- package/dist/client/_nuxt/custom-_name_-onqw9a1n.js +1 -0
- package/dist/client/_nuxt/{data-schema-button.vue-ln7d6h5v.js → data-schema-button.vue-ko85hw9e.js} +1 -1
- package/dist/client/_nuxt/{data-schema-drawer-jso1cuzu.js → data-schema-drawer-ntv77byl.js} +1 -1
- package/dist/client/_nuxt/{default-e26uk9yr.js → default-nzbz0bgu.js} +1 -1
- package/dist/client/_nuxt/{error-404-fr7rmvj2.js → error-404-dvmb5336.js} +1 -1
- package/dist/client/_nuxt/error-404.css-c4cbwrmc.css +1 -0
- package/dist/client/_nuxt/{error-500-jkjkadzh.js → error-500-o51aqv1s.js} +1 -1
- package/dist/client/_nuxt/error-500.css-k70rrah0.css +1 -0
- package/dist/client/_nuxt/{error-b4db6oh7.js → error-mqef7iny.js} +1 -1
- package/dist/client/_nuxt/{filepath-item.vue-g22bjf3y.js → filepath-item.vue-fwhfa43n.js} +1 -1
- package/dist/client/_nuxt/{full-l2nep87m.js → full-h80bx6fj.js} +1 -1
- package/dist/client/_nuxt/{help-fab.vue-g6r95f4a.js → help-fab.vue-k4u5ofw5.js} +1 -1
- package/dist/client/_nuxt/{hooks-f19zeth2.js → hooks-m9epcuu3.js} +1 -1
- package/dist/client/_nuxt/imports-i5m6ftnd.js +1 -0
- package/dist/client/_nuxt/{index-o5ob665o.js → index-dw5mno77.js} +1 -1
- package/dist/client/_nuxt/{launch-page.vue-nu5zj08b.js → launch-page.vue-fnrp7zjb.js} +1 -1
- package/dist/client/_nuxt/{modules-da941xpo.js → modules-k8csdlt3.js} +1 -1
- package/dist/client/_nuxt/{nbadge-frtnezb1.js → nbadge-jvyvrl6c.js} +1 -1
- package/dist/client/_nuxt/{ncheckbox.vue-ig2h3zb6.js → ncheckbox.vue-n785sfxh.js} +1 -1
- package/dist/client/_nuxt/{ndrawer.vue-k29v8tvh.js → ndrawer.vue-ng1vhz5m.js} +1 -1
- package/dist/client/_nuxt/{ndropdown.vue-e8lbf8tw.js → ndropdown.vue-i86w14q7.js} +1 -1
- package/dist/client/_nuxt/{nlink.vue-g66yr6dr.js → nlink.vue-n73b3eoz.js} +1 -1
- package/dist/client/_nuxt/{nnavbar.vue-ni09o3gk.js → nnavbar.vue-d4wh5lbd.js} +1 -1
- package/dist/client/_nuxt/{none-gde59ngk.js → none-g70n6zpj.js} +1 -1
- package/dist/client/_nuxt/{nsection-block-d3wydn3r.js → nsection-block-ik5hcxqh.js} +1 -1
- package/dist/client/_nuxt/{nselect-tabs.vue-df8z3fh5.js → nselect-tabs.vue-bwz4zr04.js} +1 -1
- package/dist/client/_nuxt/{nselect.vue-oz295hvu.js → nselect.vue-i09woppj.js} +1 -1
- package/dist/client/_nuxt/{open-graph-nmk7o6qa.js → open-graph-ho93jk1q.js} +2 -2
- package/dist/client/_nuxt/{overview-i50bin0e.js → overview-kvjom2ds.js} +1 -1
- package/dist/client/_nuxt/{nsxgpy6n.js → oxe0udya.js} +7 -7
- package/dist/client/_nuxt/{pages-keqq3uu3.js → pages-nsitpxjt.js} +1 -1
- package/dist/client/_nuxt/{payload-bcazh2dd.js → payload-m8p9k3e3.js} +1 -1
- package/dist/client/_nuxt/pinia-nfun5kzp.js +1 -0
- package/dist/client/_nuxt/{plugins-dp3odh07.js → plugins-mzggz2zj.js} +1 -1
- package/dist/client/_nuxt/{render-tree-my7wf4ar.js → render-tree-44oocbyu.js} +1 -1
- package/dist/client/_nuxt/{runtime-configs-htj9sk5u.js → runtime-configs-h0bsh63y.js} +1 -1
- package/dist/client/_nuxt/{server-discovery-o4v1gv64.js → server-discovery-ovd1pv67.js} +1 -1
- package/dist/client/_nuxt/{server-route-inputs.vue-eoisa322.js → server-route-inputs.vue-f0ahq663.js} +1 -1
- package/dist/client/_nuxt/{server-routes-m3zy6o3n.js → server-routes-bolyneid.js} +3 -3
- package/dist/client/_nuxt/server-tasks-fdjd81oh.js +1 -0
- package/dist/client/_nuxt/{settings-ocsdlkok.js → settings-g56571ih.js} +1 -1
- package/dist/client/_nuxt/{stacktrace-list.vue-fnbs7811.js → stacktrace-list.vue-oszdbwzk.js} +1 -1
- package/dist/client/_nuxt/{state-components-ir9sclpw.js → state-components-l0zza8bb.js} +1 -1
- package/dist/client/_nuxt/state-editor.vue-mm3xn7gr.js +1 -0
- package/dist/client/_nuxt/{state-modules-iferti41.js → state-modules-ckye4bx5.js} +1 -1
- package/dist/client/_nuxt/{storage-lc8pnxkn.js → storage-pelwsm4v.js} +1 -1
- package/dist/client/_nuxt/{terminals-ngo4bh3b.js → terminals-ml3snjy6.js} +1 -1
- package/dist/client/_nuxt/{timeline-b5t9f6n1.js → timeline-ea4st38p.js} +2 -2
- package/dist/client/_nuxt/{unocss-runtime-gc1hqonm.js → unocss-runtime-fzjefjlm.js} +1 -1
- package/dist/client/_nuxt/vendor/shiki-ej2em068.js +296 -0
- package/dist/client/_nuxt/vendor/{unocss-hjqyvvq7.js → unocss-jzxuon8q.js} +1 -1
- package/dist/client/_nuxt/{virtual-files-j3rhkqmq.js → virtual-files-hoy68su3.js} +1 -1
- package/dist/client/_nuxt/{vue-devtools-lrln5ymm.js → vue-devtools-esjf7vau.js} +1 -1
- package/dist/client/index.html +17 -17
- package/dist/module.json +2 -2
- package/package.json +31 -31
- package/dist/client/_nuxt/__blank-ld6vcstp.js +0 -1
- package/dist/client/_nuxt/assets-bi7gxmg8.js +0 -16
- package/dist/client/_nuxt/builds/meta/e0e21221-5c8e-43a8-8f88-1af9f45bb798.json +0 -1
- package/dist/client/_nuxt/composable-item.vue-mk5d6ui8.js +0 -1
- package/dist/client/_nuxt/custom-_name_-dhzxcwaa.js +0 -1
- package/dist/client/_nuxt/error-404.css-fsdpg4tp.css +0 -1
- package/dist/client/_nuxt/error-500.css-bernuda7.css +0 -1
- package/dist/client/_nuxt/imports-cmpiiypv.js +0 -1
- package/dist/client/_nuxt/pinia-ljqe092p.js +0 -1
- package/dist/client/_nuxt/server-tasks-e6qb7ohx.js +0 -1
- package/dist/client/_nuxt/state-editor.vue-o2zmurug.js +0 -1
- package/dist/client/_nuxt/vendor/shiki-ian6uf3s.js +0 -282
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z as
|
|
1
|
+
import{z as S,_ as H,K as J,aw as j,a as X,ai as Z,aj as G,J as Q,S as Y,ak as ee,ax as te,r as oe,m as ne}from"./oxe0udya.js";import{_ as z}from"./nbadge-jvyvrl6c.js";import{p as M,f as L,q as x,V as ae,U as t,W as a,X as e,a8 as C,P as k,a2 as $,ai as se,F as g,ae as T,Z as N,a3 as _,a9 as I,a0 as A,u as c,z as re,a1 as le}from"./vendor/json-editor-vue-npezbdce.js";import{_ as F}from"./filepath-item.vue-fwhfa43n.js";import{_ as ue}from"./nsection-block-ik5hcxqh.js";import{_ as ie}from"./launch-page.vue-fnrp7zjb.js";import{_ as pe}from"./help-fab.vue-k4u5ofw5.js";import"./vendor/unocss-jzxuon8q.js";import"./vendor/shiki-ej2em068.js";import"./nicon-title.vue-j1ceohu1.js";import"./nmarkdown.vue-oxfi26vk.js";import"./client-edufhzwa.js";const de={block:"","cursor-pointer":""},ce={p2:""},me=["onSubmit"],ve={flex:"~","items-center":"",p2:"","text-sm":"","font-mono":""},he={key:1},_e=M({__name:"RoutePathItem",props:{route:{}},emits:["navigate"],setup(V,{emit:i}){const v=V,R=i,m=L([]),f=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(()=>f.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=S,n=H,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,T(f.value,(u,p)=>(t(),a(g,{key:p},[u[0]===":"?(t(),k(h,{key:0,modelValue:m.value[p],"onUpdate:modelValue":B=>m.value[p]=B,"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),_(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,T(f.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)]))}}}),fe={"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"],Te=M({__name:"RoutesTable",props:{pages:{},layouts:{},matched:{},matchedPending:{}},emits:["navigate"],setup(V){const i=V,v=J(),R=j(),m=X(),f=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=z,d=_e,h=F;return t(),a("div",fe,[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,T(f.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,[_(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,[_(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))])])])}}}),Be={class:"markdown-body"},Ee={__name:"pages",setup(V,{expose:i}){return i({frontmatter:{}}),(R,m)=>(t(),a("div",Be,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)])))}},Le={key:0,"h-full":"","of-auto":""},Me={border:"b base",flex:"~ col gap1",px4:"",py3:"","n-navbar-glass":""},Ae={"font-mono":""},De={key:1,op50:""},Se={key:0,"text-orange":"",op75:""},je={key:1,op50:""},ze={"min-h-14":""},Fe={key:1,class:"py-4 text-center"},Ue={"w-full":""},Ke={mr1:""},ot=M({__name:"pages",setup(V){const i=Z(),v=G(),R=Q(),m=j(),f=Y(),w=ee(),y=x(()=>m.value?.middleware||[]),o=L(""),s=L(0),r=x(()=>(y.value,o.value,f.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 B=S,D=Te,E=ue,U=z,K=F,W=ie,O=Ee,q=pe;return t(),a(g,null,[c(R)?.pages&&c(i)?(t(),a("div",Le,[e("div",Me,[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",De,"Current route"))]),_(B,{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",Se," (no match)"))],64)):(t(),a("span",je,"Edit path above to navigate"))])]),_(E,{icon:"carbon-tree-view",text:"Matched Routes",padding:!1},{default:$(()=>[e("div",ze,[h.value.length?(t(),k(D,{key:0,pages:h.value,layouts:c(f)||[],matched:c(v).matched,"matched-pending":h.value,onNavigate:n},null,8,["pages","layouts","matched","matched-pending"])):(t(),a("div",Fe,p[4]||(p[4]=[e("span",{op50:""},"No routes matched",-1)])))])]),_:1}),_(E,{icon:"carbon-tree-view-alt",text:"All Routes",description:`${c(w).length} routes registered in your application`,padding:"pr5"},{default:$(()=>[_(D,{pages:c(w),layouts:c(f)||[],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(E,{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,T(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,[_(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"])),_(q,null,{default:$(()=>[_(O)]),_:1})],64)}}});export{ot as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as x}from"./state-editor.vue-
|
|
1
|
+
import{_ as x}from"./state-editor.vue-mm3xn7gr.js";import{p as b,U as e,W as i,F as $,ae as N,P as d,a2 as a,Y as B,a4 as w,X as h,q as k,ag as F,u as O,a3 as o,Z as _,a9 as P,aa as V}from"./vendor/json-editor-vue-npezbdce.js";import{_ as E}from"./nsection-block-ik5hcxqh.js";import{f as R,_ as j}from"./oxe0udya.js";import{_ as A}from"./help-fab.vue-k4u5ofw5.js";import"./data-schema-button.vue-ko85hw9e.js";import"./nicon-title.vue-j1ceohu1.js";import"./vendor/unocss-jzxuon8q.js";import"./vendor/shiki-ej2em068.js";const G={key:0,flex:"~ col gap-1"},H={key:1,mt2:"",px4:"",italic:"",op35:""},K=b({__name:"StateGroup",props:{state:{},revision:{},prefix:{default:""}},setup(f){return(t,n)=>{const c=x;return e(),i("div",null,[t.state&&Object.keys(t.state).length>0?(e(),i("div",G,[(e(!0),i($,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",w({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]=[h("h1",null,"State & Async Data",-1),h("p",null,"// TODO",-1)])))}},q={key:0},tt=b({__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=E,v=j,S=x,g=W,D=A,C=F("tooltip");return e(),i($,null,[O(t)?(e(),i("div",q,[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]=[P(" Re-fetch all data ")])),_:1})]),default:a(()=>[o(m,{state:n.value.data,revision:c.value},{actions:a(({isOpen:y,name:u})=>[y&&u?V((e(),d(v,{key:0,title:`Re-fetch '${u}'`,icon:"carbon-recycle",border:!1,onClick:L=>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{tt as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ay as r}from"./oxe0udya.js";import{u as c,v as p}from"./vue-devtools-esjf7vau.js";import{p as i,W as m,u as o,P as n,a2 as _,U as e,a9 as u}from"./vendor/json-editor-vue-npezbdce.js";import"./vendor/unocss-jzxuon8q.js";import"./vendor/shiki-ej2em068.js";import"./vue-virtual-scroller.esm-guzt9iin.js";const l={class:"h-full w-full"},g=i({__name:"pinia",setup(f){const{connected:a}=c();return(d,t)=>{const s=r;return e(),m("div",l,[o(a)?(e(),n(o(p),{key:0})):(e(),n(s,{key:1},{default:_(()=>t[0]||(t[0]=[u(" Connecting.... ")])),_:1}))])}}});export{g as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as T}from"./nbadge-
|
|
1
|
+
import{_ as T}from"./nbadge-jvyvrl6c.js";import{_ as S}from"./filepath-item.vue-fwhfa43n.js";import{_ as k}from"./duration-display.vue-gu7el5x3.js";import{J as D,av as B,H as V,b as H,aw as F,f as I}from"./oxe0udya.js";import{p as v,q as h,U as s,W as _,X as e,a8 as C,a3 as c,a2 as f,P as p,Z as d,V as W,Y as P,a9 as x,F as b,ae as E,a0 as L}from"./vendor/json-editor-vue-npezbdce.js";import{_ as M}from"./nsection-block-ik5hcxqh.js";import{_ as Y}from"./help-fab.vue-k4u5ofw5.js";import"./vendor/unocss-jzxuon8q.js";import"./vendor/shiki-ej2em068.js";import"./nicon-title.vue-j1ceohu1.js";const j={flex:"~ gap2","items-center":""},q={w8:"","text-right":"","text-sm":"",op25:""},z={key:0,"flex-auto":"","text-right":""},A=v({__name:"PluginItem",props:{plugin:{},index:{}},setup(m){const n=m,r=D(),a=h(()=>B(n.plugin.src,r.value?.rootDir||"").path);return(t,l)=>{const o=T,u=S,i=k;return s(),_("div",j,[e("div",q,C(t.index),1),c(u,{filepath:n.plugin.src,subpath:!0},{default:f(()=>[e("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)])}}}),J={class:"n-tip n-tip-base",flex:"~ col items-start","mx--4":"",px4:"",py4:""},R={flex:"~ items-center gap-1","font-bold":""},U=v({__name:"HelpTip",props:{title:{},icon:{}},setup(m){return(n,r)=>{const a=V,t=W("ContentSlot");return s(),_("div",J,[e("div",R,[n.icon?(s(),p(a,{key:0,icon:n.icon,class:"n-tip-icon"},null,8,["icon"])):d("",!0),e("div",null,C(n.title),1)]),e("div",null,[P(n.$slots,"default",{},()=>[c(t,{use:n.$slots.default,unwrap:"p"},null,8,["use"])])])])}}}),X={};function Z(m,n){const r=U;return s(),p(r,{title:"Performance Tip",icon:"carbon-meter",n:"lime6 dark:lime5"},{default:f(()=>[P(m.$slots,"default")]),_:3})}const G=H(X,[["render",Z]]),K={class:"markdown-body"},O={__name:"plugins",setup(m,{expose:n}){return n({frontmatter:{}}),(a,t)=>{const l=G;return s(),_("div",K,[t[1]||(t[1]=e("h1",null,"Plugins",-1)),t[2]||(t[2]=e("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 "),e("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]=e("p",null,[e("a",{href:"https://nuxt.com/docs/guide/directory-structure/plugins",target:"_blank",rel:"noopener"},"Learn more in the documentation")],-1))])}}},Q={pt4:""},tt={class:"text-sm",flex:"~ gap-1 items-center justify-start","mt-3":""},pt=v({__name:"plugins",setup(m){const n=F(),r=I(),a=h(()=>{const l=n.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=M,w=O,N=Y;return s(),_(b,null,[c(g,{icon:"carbon-plug",text:"Plugins",description:`Total plugins: ${a.value.length}`},{default:f(()=>[e("div",Q,[(s(!0),_(b,null,E(a.value,(y,$)=>(s(),p(u,{key:y.src,plugin:y,index:$+1,"ml--4":"","border-base":"",py2:"",class:L($?"border-t":"")},null,8,["plugin","index","class"]))),128)),e("div",tt,[o[0]||(o[0]=e("div",{"i-carbon-timer":"","text-lg":"",op75:""},null,-1)),o[1]||(o[1]=e("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{f as m,
|
|
1
|
+
import{f as m,K as d,ay as c}from"./oxe0udya.js";import{u as f,p as _}from"./vue-devtools-esjf7vau.js";import{p as v,W as C,u as n,P as a,a2 as E,U as o,a9 as I}from"./vendor/json-editor-vue-npezbdce.js";import"./vendor/unocss-jzxuon8q.js";import"./vendor/shiki-ej2em068.js";import"./vue-virtual-scroller.esm-guzt9iin.js";const k={class:"h-full w-full"},P=v({__name:"render-tree",setup(x){const{connected:p}=f(),t=m(),l=d();function s(r){r?t.value.devtools.open():t.value.devtools.close()}return(r,e)=>{const i=c;return o(),C("div",k,[n(p)?(o(),a(n(_),{key:0,onOnInspectComponentStart:e[0]||(e[0]=u=>s(!1)),onOnInspectComponentEnd:e[1]||(e[1]=u=>s(!0)),onOpenInEditor:n(l)},null,8,["onOpenInEditor"])):(o(),a(i,{key:1},{default:E(()=>e[2]||(e[2]=[I(" Connecting.... ")])),_:1}))])}}});export{P as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as x}from"./state-editor.vue-
|
|
1
|
+
import{_ as x}from"./state-editor.vue-mm3xn7gr.js";import{_ as y}from"./nsection-block-ik5hcxqh.js";import{U as u,W as l,X as o,a9 as d,p as b,q as c,u as f,a3 as e,a2 as a,Z as C,F as k}from"./vendor/json-editor-vue-npezbdce.js";import{_ as w}from"./help-fab.vue-k4u5ofw5.js";import{f as N,b6 as R}from"./oxe0udya.js";import"./data-schema-button.vue-ko85hw9e.js";import"./nicon-title.vue-j1ceohu1.js";import"./vendor/unocss-jzxuon8q.js";import"./vendor/shiki-ej2em068.js";const T={class:"markdown-body"},B={__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)])))}},V={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,$)=>{const s=x,r=y,v=B,h=w;return u(),l(k,null,[f(t)?(u(),l("div",V,[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{l as v,r as k,m as M,b8 as P}from"./nsxgpy6n.js";import{p as A,ay as R,z as L,I as C,W as U,u as T,U as x}from"./vendor/json-editor-vue-npezbdce.js";import"./vendor/unocss-hjqyvvq7.js";import"./vendor/shiki-ian6uf3s.js";var H=class{listeners;constructor(){this.listeners=Object.create(null)}on(t,e){return this.listeners[t]={callback:e,next:this.listeners[t]||null},this}once(t,e){return this.on(t,function s(...a){e.apply(this,a),this.off(t,s)})}off(t,e){let s=this.listeners[t]||null,a=null;for(;s!==null;){if(s.callback===e){s.callback=null,a?a.next=s.next:this.listeners[t]=s.next;break}a=s,s=s.next}return this}emit(t,...e){let s=this.listeners[t]||null,a=!1;for(;s!==null;)typeof s.callback=="function"&&s.callback.apply(this,e),a=!0,s=s.next;return a}},u=class{subscriber;value;constructor(t,e){this.subscriber=null,this.value=t,this.shouldUpdate=typeof e=="function"?e:this.shouldUpdate}get readonly(){let t=this;return{subscribe:this.subscribe.bind(this),subscribeSync:this.subscribeSync.bind(this),unsubscribe:this.unsubscribe.bind(this),get value(){return t.value}}}subscribe(t){return this.subscriber={callback:t,subscriber:this.subscriber},()=>this.unsubscribe(t)}subscribeSync(t){let e=this.subscribe(t);return t(this.value,e),e}unsubscribe(t){let e=this,s=this.subscriber;for(;s!==null;){if(s.callback===t){s.callback=null,e.subscriber=s.subscriber;break}e=s,s=s.subscriber}}shouldUpdate(t,e){return t!==e}set(t){return this.#e(t)!==!1}asyncSet(t){let e=this.#e(t);return e===!1?Promise.resolve(!1):Promise.all(e).then(()=>!0)}#e(t){if(!this.shouldUpdate(t,this.value))return!1;let e=[],s=this.subscriber;for(this.value=t;s!==null;){let{callback:a}=s;a!==null&&e.push(a(t,()=>this.unsubscribe(a))),s=s.subscriber}return e}};function b(){return[performance.timeOrigin.toString(16),(1e4*performance.now()).toString(16),Math.random().toString(16).slice(2)].join("-")}new TextDecoder;var B=typeof Object.hasOwn=="function"?Object.hasOwn:(t,e)=>Object.hasOwnProperty.call(t,e),O={8:"\\b",9:"\\t",10:"\\n",12:"\\f",13:"\\r",34:'\\"',92:"\\\\"};Uint8Array.from({length:2048},(t,e)=>B(O,e)?2:e<32?6:e<128?1:2);new Uint8Array(256).map((t,e)=>{for(let s=0;s<8;s++)t+=e>>s&1;return t});new TextDecoder("utf8",{ignoreBOM:!0});function j(t){try{return new URL(t,location.origin).origin===location.origin}catch{return!1}}function z(t){return t.ok}function D(t){return t.headers.get("x-file-encoded-size")||t.headers.get("content-length")}function I(t){return t.headers.get("x-file-size")||(j(t.url)&&!t.headers.get("content-encoding")?t.headers.get("content-length"):void 0)}function N(t){return t.headers.get("x-file-created-at")||t.headers.get("last-modified")||void 0}function E(t,e){if(t instanceof Response){let s=e?.isResponseOk||z,a=e?.getContentSize||I,n=e?.getContentEncodedSize||D,r=e?.getContentCreatedAt||N;if(s(t))return{type:"url",name:t.url,size:Number(a(t))||null,encodedSize:Number(n(t)),createdAt:r(t)}}if(t instanceof File)return{type:"file",name:t.name,size:t.size,createdAt:t.lastModified};if(t instanceof Blob)return{size:t.size};if(ArrayBuffer.isView(t))return{size:t.byteLength};if(typeof t=="string")return{size:t.length}}function $(t){let e=t;return(typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e&&!(Symbol.iterator in e)&&!(Symbol.asyncIterator in e))&&(e=[e]),e&&Symbol.iterator in e?new Blob(e):t}function _(t){if(t instanceof ReadableStream)return t;if(t instanceof Response){if(t.body===null)throw new Error("Response has no body");return t.body}return t=$(t),t instanceof Blob?t.stream():new ReadableStream({start(){let e=t!==null&&typeof t=="object"&&Symbol.asyncIterator in t?t[Symbol.asyncIterator]:void 0;if(typeof e!="function")throw new Error("Bad value type (can't convert to a stream)");this.iterator=e()},async pull(e){let{value:s,done:a}=await this.iterator.next();a?(this.iterator=null,e.close()):e.enqueue(s)},cancel(){this.iterator=null}})}function W(t,e){let s=globalThis.location,a=[],n=({newURL:r,oldURL:i})=>{let o=new URL(r).hash||"#",c=new URL(i).hash||"#";o!==a.shift()&&(a.length=0,t(o,c))};return addEventListener("hashchange",n),{set(r,i){let o=r||"#";(s.hash||"#")!==o&&(a.push(r),i?s.replace(r):s.hash=r)},dispose(){removeEventListener("hashchange",n)}}}var p="[Discovery/embed-host]",g=()=>{},V=(()=>{try{let t=new ReadableStream;return new MessageChannel().port1.postMessage(t,[t]),!0}catch{return!1}})(),m=class extends H{window;id;actions;dataLoadToken;constructor(t,e,s){super(),this.window=t,this.id=e,this.actions=s,this.dataLoadToken=null}sendMessage(t,e,s){let a={id:this.id,from:"discoveryjs-app",type:t,payload:e||null};this.window.postMessage(a,"*",s)}destroy(){this.destroy=g,this.emit("destroy"),this.dataLoadToken=null,this.window=null,this.sendMessage=g}},q=class y extends m{publicApi;static createPublicApi(e){return Object.freeze({on:e.on.bind(e),once:e.once.bind(e),off:e.off.bind(e),defineAction(s,a){e.actions.set(s,a),e.sendMessage("defineAction",s)},setPageHash(s,a=!1){e.sendMessage("setPageHash",{hash:s,replace:a})},setRouterPreventLocationUpdate(s=!0){e.sendMessage("setRouterPreventLocationUpdate",s)}})}constructor(e,s,a){super(e,s,a),this.publicApi=y.createPublicApi(this)}processMessage(e){switch(e.type){case"loadingState":{this.emit("loadingStateChanged",e.payload);break}}}},J=class w extends m{commandMap;dataLoadToken;pageHash;pageId;pageRef;pageParams;pageAnchor;locationSync;colorScheme;publicApi;static createPublicApi(e){let s={primary:f("primary",e.sendMessage.bind(e),e.commandMap),secondary:f("secondary",e.sendMessage.bind(e),e.commandMap),menu:f("menu",e.sendMessage.bind(e),e.commandMap)};return Object.freeze({pageHash:e.pageHash.readonly,pageId:e.pageId.readonly,pageRef:e.pageRef.readonly,pageAnchor:e.pageAnchor.readonly,pageParams:e.pageParams.readonly,colorScheme:e.colorScheme.readonly,on:e.on.bind(e),once:e.once.bind(e),off:e.off.bind(e),nav:Object.assign(s.secondary,s),notify(a,n){e.sendMessage("notification",{name:a,details:n})},defineAction(a,n){e.actions.set(a,n),e.sendMessage("defineAction",a)},setPageHash(a,n=!1){e.sendMessage("setPageHash",{hash:a,replace:n})},setPageHashState(a,n=!1){e.sendMessage("setPageHashState",{...a,replace:n})},setPageHashStateWithAnchor(a,n=!1){e.sendMessage("setPageHashStateWithAnchor",{...a,replace:n})},setPage(a,n,r,i=!1){e.sendMessage("setPage",{id:a,ref:n,params:r,replace:i})},setPageRef(a,n=!1){e.sendMessage("setPageRef",{ref:a,replace:n})},setPageParams(a,n=!1){e.sendMessage("setPageParams",{params:a,replace:n})},setPageAnchor(a,n=!1){e.sendMessage("setPageAnchor",{anchor:a,replace:n})},setColorSchemeState(a){e.sendMessage("setColorSchemeState",a)},setRouterPreventLocationUpdate(a=!0){e.sendMessage("setRouterPreventLocationUpdate",a)},setLocationSync(a=!0){a&&!e.locationSync?(e.locationSync=W(n=>e.publicApi.setPageHash(n)),e.on("pageHashChanged",e.locationSync.set)):!a&&e.locationSync&&(e.off("pageHashChanged",e.locationSync.set),e.locationSync.dispose(),e.locationSync=null)},unloadData(){e.sendMessage("unloadData",null)},async uploadData(a,n){let r=b();e.dataLoadToken=r;try{return await G(e,a,n)}finally{e.dataLoadToken===r&&(e.dataLoadToken=null)}}})}constructor(e,s,a){super(e,s,a),this.commandMap=new Map,this.dataLoadToken=null,this.pageHash=new u("#"),this.pageId=new u(""),this.pageRef=new u(null),this.pageParams=new u({}),this.pageAnchor=new u(null),this.locationSync=null,this.colorScheme=new u({state:"unknown",value:"unknown"},(n,r)=>n.state!==r.state||n.value!==r.value),this.publicApi=w.createPublicApi(this)}async processMessage(e){switch(e.type){case"destroy":{this.destroy();break}case"action":{let{callId:s,name:a,args:n}=e.payload,r=this.actions.get(a);if(typeof r=="function")try{this.sendMessage("actionResult",{callId:s,value:await r(...n)})}catch(i){this.sendMessage("actionResult",{callId:s,error:i})}else console.warn(`${p} Action "${a}" was not found`);break}case"navMethod":{let s=this.commandMap.get(e.payload);typeof s=="function"?s():console.warn(`${p} Nav command "${e.payload}" was not found`);break}case"pageHashChanged":{let{replace:s,hash:a,id:n,ref:r,params:i,anchor:o}=e.payload||{},c=String(a).startsWith("#")?a:"#"+a;this.pageHash.set(c),this.pageId.set(n),this.pageRef.set(r),this.pageParams.set(i),this.pageAnchor.set(o),this.emit("pageHashChanged",c,s);break}case"colorSchemeChanged":{let s=e.payload;this.colorScheme.set(s),this.emit("colorSchemeChanged",s);break}case"unloadData":{this.emit("unloadData");break}case"data":{this.emit("data");break}case"loadingState":{this.emit("loadingStateChanged",e.payload);break}default:console.error(`${p} Unknown embed message type "${e.type}"`)}}destroy(){this.locationSync&&(this.locationSync.dispose(),this.locationSync=null),super.destroy()}};function F(t,e,s){let a=Object.assign(new Map,{id:""}),n=null,r,i=typeof e=="function"?{onPreinit:void 0,onConnect:e}:{onPreinit:e,onConnect:s};return addEventListener("message",c),()=>{removeEventListener("message",c),o()};function o(){n!==null&&(n.destroy(),typeof r=="function"&&r(),n=null,r=void 0)}async function c(d){let l=d.data||{};if(d.isTrusted&&(d.source===t.contentWindow||d.source===null)&&l.from==="discoveryjs-app"){if(l.type==="ready"){o(),a.id!==l.id&&(a.clear(),a.id=l.id);let{colorScheme:S,page:h}=l.payload;n=new J(t.contentWindow,l.id,a),n.pageHash.set(h.hash),n.pageId.set(h.id),n.pageRef.set(h.ref),n.pageParams.set(h.params),n.pageAnchor.set(h.anchor),n.colorScheme.set(S),n.once("destroy",o),r=i.onConnect(n.publicApi);return}if(l.type==="preinit"){o(),typeof i.onPreinit=="function"&&(a.id!==l.id&&(a.clear(),a.id=l.id),n=new q(t.contentWindow,l.id,a),n.once("destroy",o),r=i.onPreinit(n.publicApi));return}if(n?.id===l.id){n.processMessage(l);return}}}}async function G(t,e,s=E){let a=t.dataLoadToken,n=()=>{if(t?.dataLoadToken!==a)throw new Error("Data upload aborted")};if(!a)throw new Error("No acceptToken specified");let r=typeof e=="function"?await e():await e;n();let i=typeof s=="function"?s(r)||{}:{},o=_(r);if(V)t.sendMessage("dataStream",{stream:o,resource:i},[o]);else{let c=o.getReader();t.sendMessage("startChunkedDataUpload",{acceptToken:a,resource:i});try{for(;;){let{value:d,done:l}=await c.read();if(n(),t.sendMessage("dataChunk",{acceptToken:a,value:d,done:l},typeof d!="string"&&d?.buffer?[d.buffer]:void 0),l)break}}catch(d){throw t.sendMessage("cancelChunkedDataUpload",{acceptToken:a,error:d}),d}finally{c.releaseLock()}}}function f(t,e,s){function a(n){let r=[];return{commands:r,config:JSON.parse(JSON.stringify(n,(i,o)=>{if(typeof o=="function"){let c="nav-command-"+b();return r.push(c),s.set(c,o),c}return o}))}}return{insert(n,r,i){e("changeNavButtons",{section:t,action:"insert",name:i,position:r,...a(n)})},prepend(n){e("changeNavButtons",{section:t,action:"prepend",...a(n)})},append(n){e("changeNavButtons",{section:t,action:"append",...a(n)})},before(n,r){e("changeNavButtons",{section:t,action:"before",name:n,...a(r)})},after(n,r){e("changeNavButtons",{section:t,action:"after",name:n,...a(r)})},replace(n,r){e("changeNavButtons",{section:t,action:"replace",name:n,...a(r)})},remove(n){e("changeNavButtons",{section:t,action:"remove",name:n})}}}const Z=["src"],ee=A({__name:"server-discovery",setup(t){const s=v().app.baseURL,a=R("iframe");return L(()=>{const n=F(a.value,r=>((async()=>{const i=await k.getServerData(await M()),o=`{${Object.entries(i).map(([c,d])=>`"${c}": ${P(d)}`).join(",")}}`;r.uploadData(o)})(),()=>{}));C(()=>{n()})}),(n,r)=>(x(),U("iframe",{ref_key:"iframe",ref:a,src:`${T(s)}discovery/index.html`,"h-full":"","w-full":""},null,8,Z))}});export{ee as default};
|
|
1
|
+
import{l as v,r as k,m as M,b7 as P}from"./oxe0udya.js";import{p as A,ay as R,z as L,I as C,W as U,u as T,U as x}from"./vendor/json-editor-vue-npezbdce.js";import"./vendor/unocss-jzxuon8q.js";import"./vendor/shiki-ej2em068.js";var H=class{listeners;constructor(){this.listeners=Object.create(null)}on(t,e){return this.listeners[t]={callback:e,next:this.listeners[t]||null},this}once(t,e){return this.on(t,function s(...a){e.apply(this,a),this.off(t,s)})}off(t,e){let s=this.listeners[t]||null,a=null;for(;s!==null;){if(s.callback===e){s.callback=null,a?a.next=s.next:this.listeners[t]=s.next;break}a=s,s=s.next}return this}emit(t,...e){let s=this.listeners[t]||null,a=!1;for(;s!==null;)typeof s.callback=="function"&&s.callback.apply(this,e),a=!0,s=s.next;return a}},u=class{subscriber;value;constructor(t,e){this.subscriber=null,this.value=t,this.shouldUpdate=typeof e=="function"?e:this.shouldUpdate}get readonly(){let t=this;return{subscribe:this.subscribe.bind(this),subscribeSync:this.subscribeSync.bind(this),unsubscribe:this.unsubscribe.bind(this),get value(){return t.value}}}subscribe(t){return this.subscriber={callback:t,subscriber:this.subscriber},()=>this.unsubscribe(t)}subscribeSync(t){let e=this.subscribe(t);return t(this.value,e),e}unsubscribe(t){let e=this,s=this.subscriber;for(;s!==null;){if(s.callback===t){s.callback=null,e.subscriber=s.subscriber;break}e=s,s=s.subscriber}}shouldUpdate(t,e){return t!==e}set(t){return this.#e(t)!==!1}asyncSet(t){let e=this.#e(t);return e===!1?Promise.resolve(!1):Promise.all(e).then(()=>!0)}#e(t){if(!this.shouldUpdate(t,this.value))return!1;let e=[],s=this.subscriber;for(this.value=t;s!==null;){let{callback:a}=s;a!==null&&e.push(a(t,()=>this.unsubscribe(a))),s=s.subscriber}return e}};function b(){return[performance.timeOrigin.toString(16),(1e4*performance.now()).toString(16),Math.random().toString(16).slice(2)].join("-")}new TextDecoder;var B=typeof Object.hasOwn=="function"?Object.hasOwn:(t,e)=>Object.hasOwnProperty.call(t,e),O={8:"\\b",9:"\\t",10:"\\n",12:"\\f",13:"\\r",34:'\\"',92:"\\\\"};Uint8Array.from({length:2048},(t,e)=>B(O,e)?2:e<32?6:e<128?1:2);new Uint8Array(256).map((t,e)=>{for(let s=0;s<8;s++)t+=e>>s&1;return t});new TextDecoder("utf8",{ignoreBOM:!0});function j(t){try{return new URL(t,location.origin).origin===location.origin}catch{return!1}}function z(t){return t.ok}function D(t){return t.headers.get("x-file-encoded-size")||t.headers.get("content-length")}function I(t){return t.headers.get("x-file-size")||(j(t.url)&&!t.headers.get("content-encoding")?t.headers.get("content-length"):void 0)}function N(t){return t.headers.get("x-file-created-at")||t.headers.get("last-modified")||void 0}function E(t,e){if(t instanceof Response){let s=e?.isResponseOk||z,a=e?.getContentSize||I,n=e?.getContentEncodedSize||D,r=e?.getContentCreatedAt||N;if(s(t))return{type:"url",name:t.url,size:Number(a(t))||null,encodedSize:Number(n(t)),createdAt:r(t)}}if(t instanceof File)return{type:"file",name:t.name,size:t.size,createdAt:t.lastModified};if(t instanceof Blob)return{size:t.size};if(ArrayBuffer.isView(t))return{size:t.byteLength};if(typeof t=="string")return{size:t.length}}function $(t){let e=t;return(typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e&&!(Symbol.iterator in e)&&!(Symbol.asyncIterator in e))&&(e=[e]),e&&Symbol.iterator in e?new Blob(e):t}function _(t){if(t instanceof ReadableStream)return t;if(t instanceof Response){if(t.body===null)throw new Error("Response has no body");return t.body}return t=$(t),t instanceof Blob?t.stream():new ReadableStream({start(){let e=t!==null&&typeof t=="object"&&Symbol.asyncIterator in t?t[Symbol.asyncIterator]:void 0;if(typeof e!="function")throw new Error("Bad value type (can't convert to a stream)");this.iterator=e()},async pull(e){let{value:s,done:a}=await this.iterator.next();a?(this.iterator=null,e.close()):e.enqueue(s)},cancel(){this.iterator=null}})}function W(t,e){let s=globalThis.location,a=[],n=({newURL:r,oldURL:i})=>{let o=new URL(r).hash||"#",c=new URL(i).hash||"#";o!==a.shift()&&(a.length=0,t(o,c))};return addEventListener("hashchange",n),{set(r,i){let o=r||"#";(s.hash||"#")!==o&&(a.push(r),i?s.replace(r):s.hash=r)},dispose(){removeEventListener("hashchange",n)}}}var p="[Discovery/embed-host]",g=()=>{},V=(()=>{try{let t=new ReadableStream;return new MessageChannel().port1.postMessage(t,[t]),!0}catch{return!1}})(),m=class extends H{window;id;actions;dataLoadToken;constructor(t,e,s){super(),this.window=t,this.id=e,this.actions=s,this.dataLoadToken=null}sendMessage(t,e,s){let a={id:this.id,from:"discoveryjs-app",type:t,payload:e||null};this.window.postMessage(a,"*",s)}destroy(){this.destroy=g,this.emit("destroy"),this.dataLoadToken=null,this.window=null,this.sendMessage=g}},q=class y extends m{publicApi;static createPublicApi(e){return Object.freeze({on:e.on.bind(e),once:e.once.bind(e),off:e.off.bind(e),defineAction(s,a){e.actions.set(s,a),e.sendMessage("defineAction",s)},setPageHash(s,a=!1){e.sendMessage("setPageHash",{hash:s,replace:a})},setRouterPreventLocationUpdate(s=!0){e.sendMessage("setRouterPreventLocationUpdate",s)}})}constructor(e,s,a){super(e,s,a),this.publicApi=y.createPublicApi(this)}processMessage(e){switch(e.type){case"loadingState":{this.emit("loadingStateChanged",e.payload);break}}}},J=class w extends m{commandMap;dataLoadToken;pageHash;pageId;pageRef;pageParams;pageAnchor;locationSync;colorScheme;publicApi;static createPublicApi(e){let s={primary:f("primary",e.sendMessage.bind(e),e.commandMap),secondary:f("secondary",e.sendMessage.bind(e),e.commandMap),menu:f("menu",e.sendMessage.bind(e),e.commandMap)};return Object.freeze({pageHash:e.pageHash.readonly,pageId:e.pageId.readonly,pageRef:e.pageRef.readonly,pageAnchor:e.pageAnchor.readonly,pageParams:e.pageParams.readonly,colorScheme:e.colorScheme.readonly,on:e.on.bind(e),once:e.once.bind(e),off:e.off.bind(e),nav:Object.assign(s.secondary,s),notify(a,n){e.sendMessage("notification",{name:a,details:n})},defineAction(a,n){e.actions.set(a,n),e.sendMessage("defineAction",a)},setPageHash(a,n=!1){e.sendMessage("setPageHash",{hash:a,replace:n})},setPageHashState(a,n=!1){e.sendMessage("setPageHashState",{...a,replace:n})},setPageHashStateWithAnchor(a,n=!1){e.sendMessage("setPageHashStateWithAnchor",{...a,replace:n})},setPage(a,n,r,i=!1){e.sendMessage("setPage",{id:a,ref:n,params:r,replace:i})},setPageRef(a,n=!1){e.sendMessage("setPageRef",{ref:a,replace:n})},setPageParams(a,n=!1){e.sendMessage("setPageParams",{params:a,replace:n})},setPageAnchor(a,n=!1){e.sendMessage("setPageAnchor",{anchor:a,replace:n})},setColorSchemeState(a){e.sendMessage("setColorSchemeState",a)},setRouterPreventLocationUpdate(a=!0){e.sendMessage("setRouterPreventLocationUpdate",a)},setLocationSync(a=!0){a&&!e.locationSync?(e.locationSync=W(n=>e.publicApi.setPageHash(n)),e.on("pageHashChanged",e.locationSync.set)):!a&&e.locationSync&&(e.off("pageHashChanged",e.locationSync.set),e.locationSync.dispose(),e.locationSync=null)},unloadData(){e.sendMessage("unloadData",null)},async uploadData(a,n){let r=b();e.dataLoadToken=r;try{return await G(e,a,n)}finally{e.dataLoadToken===r&&(e.dataLoadToken=null)}}})}constructor(e,s,a){super(e,s,a),this.commandMap=new Map,this.dataLoadToken=null,this.pageHash=new u("#"),this.pageId=new u(""),this.pageRef=new u(null),this.pageParams=new u({}),this.pageAnchor=new u(null),this.locationSync=null,this.colorScheme=new u({state:"unknown",value:"unknown"},(n,r)=>n.state!==r.state||n.value!==r.value),this.publicApi=w.createPublicApi(this)}async processMessage(e){switch(e.type){case"destroy":{this.destroy();break}case"action":{let{callId:s,name:a,args:n}=e.payload,r=this.actions.get(a);if(typeof r=="function")try{this.sendMessage("actionResult",{callId:s,value:await r(...n)})}catch(i){this.sendMessage("actionResult",{callId:s,error:i})}else console.warn(`${p} Action "${a}" was not found`);break}case"navMethod":{let s=this.commandMap.get(e.payload);typeof s=="function"?s():console.warn(`${p} Nav command "${e.payload}" was not found`);break}case"pageHashChanged":{let{replace:s,hash:a,id:n,ref:r,params:i,anchor:o}=e.payload||{},c=String(a).startsWith("#")?a:"#"+a;this.pageHash.set(c),this.pageId.set(n),this.pageRef.set(r),this.pageParams.set(i),this.pageAnchor.set(o),this.emit("pageHashChanged",c,s);break}case"colorSchemeChanged":{let s=e.payload;this.colorScheme.set(s),this.emit("colorSchemeChanged",s);break}case"unloadData":{this.emit("unloadData");break}case"data":{this.emit("data");break}case"loadingState":{this.emit("loadingStateChanged",e.payload);break}default:console.error(`${p} Unknown embed message type "${e.type}"`)}}destroy(){this.locationSync&&(this.locationSync.dispose(),this.locationSync=null),super.destroy()}};function F(t,e,s){let a=Object.assign(new Map,{id:""}),n=null,r,i=typeof e=="function"?{onPreinit:void 0,onConnect:e}:{onPreinit:e,onConnect:s};return addEventListener("message",c),()=>{removeEventListener("message",c),o()};function o(){n!==null&&(n.destroy(),typeof r=="function"&&r(),n=null,r=void 0)}async function c(d){let l=d.data||{};if(d.isTrusted&&(d.source===t.contentWindow||d.source===null)&&l.from==="discoveryjs-app"){if(l.type==="ready"){o(),a.id!==l.id&&(a.clear(),a.id=l.id);let{colorScheme:S,page:h}=l.payload;n=new J(t.contentWindow,l.id,a),n.pageHash.set(h.hash),n.pageId.set(h.id),n.pageRef.set(h.ref),n.pageParams.set(h.params),n.pageAnchor.set(h.anchor),n.colorScheme.set(S),n.once("destroy",o),r=i.onConnect(n.publicApi);return}if(l.type==="preinit"){o(),typeof i.onPreinit=="function"&&(a.id!==l.id&&(a.clear(),a.id=l.id),n=new q(t.contentWindow,l.id,a),n.once("destroy",o),r=i.onPreinit(n.publicApi));return}if(n?.id===l.id){n.processMessage(l);return}}}}async function G(t,e,s=E){let a=t.dataLoadToken,n=()=>{if(t?.dataLoadToken!==a)throw new Error("Data upload aborted")};if(!a)throw new Error("No acceptToken specified");let r=typeof e=="function"?await e():await e;n();let i=typeof s=="function"?s(r)||{}:{},o=_(r);if(V)t.sendMessage("dataStream",{stream:o,resource:i},[o]);else{let c=o.getReader();t.sendMessage("startChunkedDataUpload",{acceptToken:a,resource:i});try{for(;;){let{value:d,done:l}=await c.read();if(n(),t.sendMessage("dataChunk",{acceptToken:a,value:d,done:l},typeof d!="string"&&d?.buffer?[d.buffer]:void 0),l)break}}catch(d){throw t.sendMessage("cancelChunkedDataUpload",{acceptToken:a,error:d}),d}finally{c.releaseLock()}}}function f(t,e,s){function a(n){let r=[];return{commands:r,config:JSON.parse(JSON.stringify(n,(i,o)=>{if(typeof o=="function"){let c="nav-command-"+b();return r.push(c),s.set(c,o),c}return o}))}}return{insert(n,r,i){e("changeNavButtons",{section:t,action:"insert",name:i,position:r,...a(n)})},prepend(n){e("changeNavButtons",{section:t,action:"prepend",...a(n)})},append(n){e("changeNavButtons",{section:t,action:"append",...a(n)})},before(n,r){e("changeNavButtons",{section:t,action:"before",name:n,...a(r)})},after(n,r){e("changeNavButtons",{section:t,action:"after",name:n,...a(r)})},replace(n,r){e("changeNavButtons",{section:t,action:"replace",name:n,...a(r)})},remove(n){e("changeNavButtons",{section:t,action:"remove",name:n})}}}const Z=["src"],ee=A({__name:"server-discovery",setup(t){const s=v().app.baseURL,a=R("iframe");return L(()=>{const n=F(a.value,r=>((async()=>{const i=await k.getServerData(await M()),o=`{${Object.entries(i).map(([c,d])=>`"${c}": ${P(d)}`).join(",")}}`;r.uploadData(o)})(),()=>{}));C(()=>{n()})}),(n,r)=>(x(),U("iframe",{ref_key:"iframe",ref:a,src:`${T(s)}discovery/index.html`,"h-full":"","w-full":""},null,8,Z))}});export{ee as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as I}from"./ncheckbox.vue-
|
|
1
|
+
import{_ as I}from"./ncheckbox.vue-n785sfxh.js";import{C as O,z as R,H as T,_ as A}from"./oxe0udya.js";import{_ as z}from"./nselect.vue-i09woppj.js";import{p as E,q as C,j as L,U as s,W as u,F as c,ae as h,Y as b,P as p,Z as m,a0 as v,a3 as y,a2 as V,X as N,a8 as q,u as r,a9 as U}from"./vendor/json-editor-vue-npezbdce.js";const H={p4:"",flex:"~ col gap-4"},K={key:1,ml2:"",flex:""},M=["value"],P={key:0,flex:"","gap-4":""},J=E({__name:"ServerRouteInputs",props:{modelValue:{},keys:{default:()=>[]},default:{default:()=>({})},disabled:{type:Boolean,default:!1}},setup(S,{emit:w}){const g=S,d=O(g,"modelValue",w,{passive:!0}),$=C(()=>[...g.keys,"active","key","value","type"]),B=C(()=>{const l={};for(const e of $.value)l[e]=g.default[e]||"";return l}),j=["string","number","boolean","file","date","time","datetime-local"];function D(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=I,i=R,f=z,F=T,_=A;return s(),u("div",H,[(s(!0),u(c,null,h(r(d),(a,k)=>(s(),u("div",{key:k,flex:"~ gap-2","justify-around":""},[b(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:v(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:v(l.disabled?"op75":""),onChange:o=>D(k,o)},null,8,["disabled","class","onChange"])):a.type==="boolean"?(s(),u("div",K,[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:v(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:v(l.disabled?"op75":""),disabled:l.disabled},{default:V(()=>[(s(),u(c,null,h(j,o=>N("option",{key:o,value:o},q(o),9,M)),64))]),_:2},1032,["modelValue","onUpdate:modelValue","class","disabled"])):m("",!0)],64))),128)),b(l.$slots,"input-actions",{},()=>[y(_,{n:"red",disabled:l.disabled,class:v(l.disabled?"op0!":""),onClick:n=>r(d).splice(k,1)},{default:V(()=>[y(F,{icon:"carbon:trash-can"})]),_:2},1032,["disabled","class","onClick"])])]))),128)),l.disabled?m("",!0):(s(),u("div",P,[b(l.$slots,"actions",{params:r(d)},()=>[y(_,{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]=[U(" Add ")])),_:1}),e[4]||(e[4]=N("div",{"flex-auto":""},null,-1)),r(d).length?(s(),p(_,{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]=[U(" Remove All ")])),_:1})):m("",!0)])])),b(l.$slots,"default")])}}});export{J as _};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{b9 as $e,ba as le,H as Ee,bb as Ke,bc as Qe,R as Xe,K as Ye,f as Ze,L as et,g as De,ah as tt,bd as nt,a as ot,x as at,_ as Re,z as st,h as je,az as lt,be as rt,O as it,w as ut,V as dt}from"./nsxgpy6n.js";import{_ as ct}from"./nnavbar.vue-ni09o3gk.js";import{_ as Ve}from"./nbadge-frtnezb1.js";import{p as ye,f as P,U as r,W as k,X as u,a0 as M,P as $,u as b,a8 as U,Z as O,a9 as K,$ as pt,Y as ft,F as L,ae as W,E as me,j as Ie,d as Ue,D as vt,n as mt,r as ve,q as j,w as yt,ag as Oe,a2 as C,a3 as v,aa as Z,a4 as ht,ax as gt,K as bt}from"./vendor/json-editor-vue-npezbdce.js";import{_ as _t}from"./nselect.vue-oz295hvu.js";import{_ as Ne}from"./server-route-inputs.vue-eoisa322.js";import{_ as kt}from"./code-snippets.vue-pb1tfwrq.js";import{_ as xt}from"./data-schema-button.vue-ln7d6h5v.js";import{_ as wt}from"./ncode-block.vue-msaaoy71.js";import{d as Ct}from"./vendor/unocss-hjqyvvq7.js";import{C as we,S as Le}from"./constants-b32h69zq.js";import{_ as St}from"./nsection-block-d3wydn3r.js";import{_ as Tt}from"./ndrawer.vue-k29v8tvh.js";import"./vendor/shiki-ian6uf3s.js";import"./ncheckbox.vue-ig2h3zb6.js";import"./client-edufhzwa.js";import"./nicon-title.vue-j1ceohu1.js";function $t(e,l){if(typeof e!="string")throw new TypeError("argument str must be a string");const o={},n=l||{},y=n.decode||Et;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(n?.filter&&!n?.filter(g)){f=m+1;continue}if(o[g]===void 0){let i=e.slice(d+1,m).trim();i.codePointAt(0)===34&&(i=i.slice(1,-1)),o[g]=Dt(i,y)}f=m+1}return o}function Et(e){return e.includes("%")?decodeURIComponent(e):e}function Dt(e,l){try{return l(e)}catch{return e}}const ae=/^[\u0009\u0020-\u007E\u0080-\u00FF]+$/;function Ce(e,l,o){const n=o||{},y=n.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(n.maxAge!==void 0&&n.maxAge!==null){const m=n.maxAge-0;if(Number.isNaN(m)||!Number.isFinite(m))throw new TypeError("option maxAge is invalid");d+="; Max-Age="+Math.floor(m)}if(n.domain){if(!ae.test(n.domain))throw new TypeError("option domain is invalid");d+="; Domain="+n.domain}if(n.path){if(!ae.test(n.path))throw new TypeError("option path is invalid");d+="; Path="+n.path}if(n.expires){if(!Rt(n.expires)||Number.isNaN(n.expires.valueOf()))throw new TypeError("option expires is invalid");d+="; Expires="+n.expires.toUTCString()}if(n.httpOnly&&(d+="; HttpOnly"),n.secure&&(d+="; Secure"),n.priority)switch(typeof n.priority=="string"?n.priority.toLowerCase():n.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(n.sameSite)switch(typeof n.sameSite=="string"?n.sameSite.toLowerCase():n.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 n.partitioned&&(d+="; Partitioned"),d}function Rt(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=P(!0),o=$e();return(n,y)=>{const f=Ee,d=Ve,m=Pe;return r(),k("div",null,[u("button",{flex:"~ gap-2","w-full":"","items-start":"","items-center":"","hover-bg-active":"",px2:"",py1:"",class:M([{"bg-active":b(o)===n.item.filepath}]),style:pt({paddingLeft:`calc(0.5rem + ${n.index*1.5}em)`}),onClick:y[0]||(y[0]=g=>{l.value=!l.value,o.value=n.item.filepath})},[u("div",{class:M({"w-12":!n.item.routes}),"flex-none":"","text-left":""},[n.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)(n.item.method||"*")),textContent:U((n.item.method||"*").toUpperCase())},null,8,["class","textContent"]))],2),u("span",{class:M({"flex items-center":n.item.routes}),"text-sm":"","font-mono":""},[n.item.type==="collection"?(r(),$(f,{key:0,title:`${n.item.routes?.length} routes`,icon:"carbon:folder",mr1:""},null,8,["title"])):O("",!0),K(" "+U(n.item.route),1)],2)],6),y[1]||(y[1]=u("div",{"x-divider":""},null,-1)),l.value?ft(n.$slots,"default",{key:0},()=>[(r(!0),k(L,null,W(n.item.routes,g=>(r(),$(m,{key:g.filepath,item:g,index:n.index+1},null,8,["item","index"]))),128))]):O("",!0)])}}});function B(e){if(typeof e!="object")return e;var l,o,n=Object.prototype.toString.call(e);if(n==="[object Object]"){if(e.constructor!==Object&&typeof e.constructor=="function"){o=new e.constructor;for(l in e)e.hasOwnProperty(l)&&o[l]!==e[l]&&(o[l]=B(e[l]))}else{o={};for(l in e)l==="__proto__"?Object.defineProperty(o,l,{value:B(e[l]),configurable:!0,enumerable:!0,writable:!0}):o[l]=B(e[l])}return o}if(n==="[object Array]"){for(l=e.length,o=Array(l);l--;)o[l]=B(e[l]);return o}return n==="[object Set]"?(o=new Set,e.forEach(function(y){o.add(B(y))}),o):n==="[object Map]"?(o=new Map,e.forEach(function(y,f){o.set(B(f),B(y))}),o):n==="[object Date]"?new Date(+e):n==="[object RegExp]"?(o=new RegExp(e.source,e.flags),o.lastIndex=e.lastIndex,o):n==="[object DataView]"?new e.constructor(B(e.buffer)):n==="[object ArrayBuffer]"?e.slice(0):n.slice(-6)==="Array]"?new e.constructor(e):e}const jt={path:"/",watch:!0,decode:e=>Ct(decodeURIComponent(e)),encode:e=>encodeURIComponent(typeof e=="string"?e:JSON.stringify(e))},se=window.cookieStore;function Vt(e,l){const o={...jt,...l};o.filter??=g=>g===e;const n=Se(o)||{};let y;o.maxAge!==void 0?y=o.maxAge*1e3:o.expires&&(y=o.expires.getTime()-Date.now());const f=y!==void 0&&y<=0,d=B(f?void 0:n[e]??o.default?.()),m=y&&!f?Ot(d,y,o.watch&&o.watch!=="shallow"):P(d);{let g=null;try{!se&&typeof BroadcastChannel<"u"&&(g=new BroadcastChannel(`nuxt:cookies:${e}`))}catch{}const i=()=>{o.readonly||Ke(m.value,n[e])||(Ut(e,m.value,o),n[e]=B(m.value),g?.postMessage({value:o.encode(m.value)}))},E=A=>{const S=A.refresh?Se(o)?.[e]:o.decode(A.value);I=!0,m.value=S,n[e]=B(S),mt(()=>{I=!1})};let I=!1;const F=!!Ue();if(F&&me(()=>{I=!0,i(),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));o.watch?Ie(m,()=>{I||i()},{deep:o.watch!=="shallow"}):i()}return m}function Se(e={}){return $t(document.cookie,e)}function It(e,l,o={}){return l==null?Ce(e,l,{...o,maxAge:-1}):Ce(e,l,o)}function Ut(e,l,o={}){document.cookie=It(e,l,o)}const Te=2147483647;function Ot(e,l,o){let n,y,f=0;const d=o?P(e):{value:e};return Ue()&&me(()=>{y?.(),clearTimeout(n)}),vt((m,g)=>{o&&(y=Ie(d,g));function i(){f=0,clearTimeout(n);const E=l-f,I=E<Te?E:Te;n=setTimeout(()=>{if(f+=I,f<l)return i();d.value=void 0,g()},I)}return{get(){return m(),d.value},set(E){i(),d.value=E,g()}}})}const Nt={"h-full":"","w-full":"",flex:"~ col"},Lt={flex:"~ col gap-2","flex-none":"",p4:"","n-navbar-glass":""},Pt={flex:"~ gap2 items-center"},At={relative:"","w-full":""},Bt={absolute:"","right-2":"","top-1.5":"",flex:"~ gap-1"},qt={flex:"~ gap2 wrap","w-full":"","items-center":"",px4:"",pb2:"","text-center":"","text-sm":"",border:"b base"},Mt={class:"hidden md:block"},Ft={key:0,border:"b base","items-center":"",px4:"",py2:"",grid:"~ cols-[max-content_1fr] gap-2"},zt={"text-right":"","font-mono":""},Ht={key:1,border:"b base",p4:"",flex:"~ col gap-4","font-mono":""},Wt={flex:"~ gap-4"},Gt={flex:"~ gap2","mb--2":"","items-center":"",op50:""},Jt={key:2},Kt={key:3,border:"b base",relative:"","n-code-block":""},Qt={flex:"~ wrap","w-full":""},Xt=["onClick"],Yt={border:"b base",flex:"~ gap2","items-center":"",px4:"",py2:""},Zt={key:1,"text-xs":"",op50:""},en={key:0,"flex-auto":"","overflow-auto":""},tn={border:"~ base","h-full":"","w-full":"",rounded:""},nn=["data"],on={key:2,"flex-auto":"","overflow-auto":"",p4:""},an={border:"~ base",rounded:""},sn=["src"],ln={key:1,controls:"",rounded:""},rn=["src"],un=ye({__name:"ServerRouteDetails",props:{route:{}},emits:["openDefaultInput"],setup(e,{emit:l}){const o=e,n=l,[y,f]=Qe(),d=Xe(),m=Ye(),g=Ze(),i=ve({contentType:"text/plain",data:"",statusCode:200,error:void 0,fetchTime:0}),E=j(()=>i.contentType.includes("application/json")?"json":i.contentType.includes("text/html")?"html":i.contentType.includes("text/css")?"css":i.contentType.includes("text/javascript")?"javascript":i.contentType.includes("image")||i.contentType.includes("video")?"media":i.contentType.includes("text/xml")||i.contentType.includes("application/xml")?"xml":i.contentType.includes("application/pdf")?"pdf":"text"),I=j(()=>{if(E.value==="json")return JSON.stringify(i.data,null,2);if(E.value==="media"||E.value==="pdf"){const a=new Blob([i.data],{type:i.contentType});return URL.createObjectURL(a)}return i.data}),F=P(!1),A=P(!1),S=et(),_=j(()=>o.route.route?.split(/((?:\*\*)?:\w+)/g)),N=j(()=>_.value?.filter(a=>a.startsWith(":")||a.startsWith("**:"))||[]),h=P(o.route.method||"GET"),D=P({}),x=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"}]}),V=P({}),{inputDefaults:w,sendFrom:z}=De("serverRoutes"),Q=j(()=>g?.value?.app?.$fetch?z.value:"devtools"),re=["GET","POST","PUT","PATCH","DELETE","HEAD"],ie=["PATCH","POST","PUT","DELETE"],ee=j(()=>ie.includes(h.value.toUpperCase())),c=P(),te=["input","json"],G=P(te[0]),ue=j({get:()=>x[c.value],set:a=>{x[c.value]=a}}),he=j(()=>({...J(w.value.query),...J(x.query)})),ge=j(()=>({...J(w.value.headers),...J(x.headers)})),de=j(()=>ee.value?G.value==="json"?{...J(w.value.body),...V.value}:{...J(w.value.body),...J(x.body)}:void 0),Ae=j(()=>{let a=window?.location.origin;return a.charAt(a.length-1)==="/"&&(a=a.slice(0,-1)),a}),ne=j(()=>{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=j(()=>Ae.value+ne.value);function J(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;at("server-routes:fetch",{method:h.value,sendFrom:Q.value});try{i.data=await t(be.value,{method:h.value.toUpperCase(),headers:ge.value,query:he.value,body:de.value,onResponse({response:p}){i.contentType=(p.headers.get("content-type")||"").toString().toLowerCase().trim(),i.statusCode=p.status,i.error=void 0},onResponseError(p){i.error=p.response._data,i.data=p.response._data}})}catch{}F.value=!1,i.fetchTime=Date.now()-a}const ke=j(()=>{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{b8 as $e,b9 as le,H as Ee,ba as Ke,bb as Qe,Q as Xe,J as Ye,f as Ze,K as et,g as De,ag as tt,bc as nt,a as ot,x as at,_ as je,z as st,h as Re,ay as lt,bd as rt,N as it,w as ut,U as dt}from"./oxe0udya.js";import{_ as ct}from"./nnavbar.vue-d4wh5lbd.js";import{_ as Ve}from"./nbadge-jvyvrl6c.js";import{p as ye,f as P,U as r,W as k,X as u,a0 as M,P as $,u as b,a8 as I,Z as N,a9 as K,$ as pt,Y as ft,F as L,ae as J,E as me,j as Ue,d as Ie,D as vt,n as mt,r as ve,q as R,w as yt,ag as Ne,a2 as C,a3 as v,aa as Z,a4 as ht,ax as gt,K as bt}from"./vendor/json-editor-vue-npezbdce.js";import{_ as _t}from"./nselect.vue-i09woppj.js";import{_ as Oe}from"./server-route-inputs.vue-f0ahq663.js";import{_ as kt}from"./code-snippets.vue-efpsav7c.js";import{_ as xt}from"./data-schema-button.vue-ko85hw9e.js";import{_ as wt}from"./ncode-block.vue-msaaoy71.js";import{d as Ct}from"./vendor/unocss-jzxuon8q.js";import{C as we,S as Le}from"./constants-b32h69zq.js";import{_ as St}from"./nsection-block-ik5hcxqh.js";import{_ as Tt}from"./ndrawer.vue-ng1vhz5m.js";import"./vendor/shiki-ej2em068.js";import"./ncheckbox.vue-n785sfxh.js";import"./client-edufhzwa.js";import"./nicon-title.vue-j1ceohu1.js";function $t(e,l){if(typeof e!="string")throw new TypeError("argument str must be a string");const o={},n=l||{},y=n.decode||Et;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(n?.filter&&!n?.filter(g)){f=m+1;continue}if(o[g]===void 0){let i=e.slice(d+1,m).trim();i.codePointAt(0)===34&&(i=i.slice(1,-1)),o[g]=Dt(i,y)}f=m+1}return o}function Et(e){return e.includes("%")?decodeURIComponent(e):e}function Dt(e,l){try{return l(e)}catch{return e}}const ae=/^[\u0009\u0020-\u007E\u0080-\u00FF]+$/;function Ce(e,l,o){const n=o||{},y=n.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(n.maxAge!==void 0&&n.maxAge!==null){const m=n.maxAge-0;if(Number.isNaN(m)||!Number.isFinite(m))throw new TypeError("option maxAge is invalid");d+="; Max-Age="+Math.floor(m)}if(n.domain){if(!ae.test(n.domain))throw new TypeError("option domain is invalid");d+="; Domain="+n.domain}if(n.path){if(!ae.test(n.path))throw new TypeError("option path is invalid");d+="; Path="+n.path}if(n.expires){if(!jt(n.expires)||Number.isNaN(n.expires.valueOf()))throw new TypeError("option expires is invalid");d+="; Expires="+n.expires.toUTCString()}if(n.httpOnly&&(d+="; HttpOnly"),n.secure&&(d+="; Secure"),n.priority)switch(typeof n.priority=="string"?n.priority.toLowerCase():n.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(n.sameSite)switch(typeof n.sameSite=="string"?n.sameSite.toLowerCase():n.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 n.partitioned&&(d+="; Partitioned"),d}function jt(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=P(!0),o=$e();return(n,y)=>{const f=Ee,d=Ve,m=Pe;return r(),k("div",null,[u("button",{flex:"~ gap-2","w-full":"","items-start":"","items-center":"","hover-bg-active":"",px2:"",py1:"",class:M([{"bg-active":b(o)===n.item.filepath}]),style:pt({paddingLeft:`calc(0.5rem + ${n.index*1.5}em)`}),onClick:y[0]||(y[0]=g=>{l.value=!l.value,o.value=n.item.filepath})},[u("div",{class:M({"w-12":!n.item.routes}),"flex-none":"","text-left":""},[n.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)(n.item.method||"*")),textContent:I((n.item.method||"*").toUpperCase())},null,8,["class","textContent"]))],2),u("span",{class:M({"flex items-center":n.item.routes}),"text-sm":"","font-mono":""},[n.item.type==="collection"?(r(),$(f,{key:0,title:`${n.item.routes?.length} routes`,icon:"carbon:folder",mr1:""},null,8,["title"])):N("",!0),K(" "+I(n.item.route),1)],2)],6),y[1]||(y[1]=u("div",{"x-divider":""},null,-1)),l.value?ft(n.$slots,"default",{key:0},()=>[(r(!0),k(L,null,J(n.item.routes,g=>(r(),$(m,{key:g.filepath,item:g,index:n.index+1},null,8,["item","index"]))),128))]):N("",!0)])}}});function B(e){if(typeof e!="object")return e;var l,o,n=Object.prototype.toString.call(e);if(n==="[object Object]"){if(e.constructor!==Object&&typeof e.constructor=="function"){o=new e.constructor;for(l in e)e.hasOwnProperty(l)&&o[l]!==e[l]&&(o[l]=B(e[l]))}else{o={};for(l in e)l==="__proto__"?Object.defineProperty(o,l,{value:B(e[l]),configurable:!0,enumerable:!0,writable:!0}):o[l]=B(e[l])}return o}if(n==="[object Array]"){for(l=e.length,o=Array(l);l--;)o[l]=B(e[l]);return o}return n==="[object Set]"?(o=new Set,e.forEach(function(y){o.add(B(y))}),o):n==="[object Map]"?(o=new Map,e.forEach(function(y,f){o.set(B(f),B(y))}),o):n==="[object Date]"?new Date(+e):n==="[object RegExp]"?(o=new RegExp(e.source,e.flags),o.lastIndex=e.lastIndex,o):n==="[object DataView]"?new e.constructor(B(e.buffer)):n==="[object ArrayBuffer]"?e.slice(0):n.slice(-6)==="Array]"?new e.constructor(e):e}const Rt={path:"/",watch:!0,decode:e=>Ct(decodeURIComponent(e)),encode:e=>encodeURIComponent(typeof e=="string"?e:JSON.stringify(e))},se=window.cookieStore;function Vt(e,l){const o={...Rt,...l};o.filter??=g=>g===e;const n=Se(o)||{};let y;o.maxAge!==void 0?y=o.maxAge*1e3:o.expires&&(y=o.expires.getTime()-Date.now());const f=y!==void 0&&y<=0,d=B(f?void 0:n[e]??o.default?.()),m=y&&!f?Nt(d,y,o.watch&&o.watch!=="shallow"):P(d);{let g=null;try{!se&&typeof BroadcastChannel<"u"&&(g=new BroadcastChannel(`nuxt:cookies:${e}`))}catch{}const i=()=>{o.readonly||Ke(m.value,n[e])||(It(e,m.value,o),n[e]=B(m.value),g?.postMessage({value:o.encode(m.value)}))},E=A=>{const S=A.refresh?Se(o)?.[e]:o.decode(A.value);U=!0,m.value=S,n[e]=B(S),mt(()=>{U=!1})};let U=!1;const F=!!Ie();if(F&&me(()=>{U=!0,i(),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));o.watch?Ue(m,()=>{U||i()},{deep:o.watch!=="shallow"}):i()}return m}function Se(e={}){return $t(document.cookie,e)}function Ut(e,l,o={}){return l==null?Ce(e,l,{...o,maxAge:-1}):Ce(e,l,o)}function It(e,l,o={}){document.cookie=Ut(e,l,o)}const Te=2147483647;function Nt(e,l,o){let n,y,f=0;const d=o?P(e):{value:e};return Ie()&&me(()=>{y?.(),clearTimeout(n)}),vt((m,g)=>{o&&(y=Ue(d,g));function i(){f=0,clearTimeout(n);const E=l-f,U=E<Te?E:Te;n=setTimeout(()=>{if(f+=U,f<l)return i();d.value=void 0,g()},U)}return{get(){return m(),d.value},set(E){i(),d.value=E,g()}}})}const Ot={"h-full":"","w-full":"",flex:"~ col"},Lt={flex:"~ col gap-2","flex-none":"",p4:"","n-navbar-glass":""},Pt={flex:"~ gap2 items-center"},At={relative:"","w-full":""},Bt={absolute:"","right-2":"","top-1.5":"",flex:"~ gap-1"},qt={flex:"~ gap2 wrap","w-full":"","items-center":"",px4:"",pb2:"","text-center":"","text-sm":"",border:"b base"},Mt={class:"hidden md:block"},Ft={key:0,border:"b base","items-center":"",px4:"",py2:"",grid:"~ cols-[max-content_1fr] gap-2"},Ht={"text-right":"","font-mono":""},zt={key:1,border:"b base",p4:"",flex:"~ col gap-4","font-mono":""},Jt={flex:"~ gap-4"},Wt={flex:"~ gap2","mb--2":"","items-center":"",op50:""},Gt={key:2},Kt={key:3,border:"b base",relative:"","n-code-block":""},Qt={flex:"~ wrap","w-full":""},Xt=["onClick"],Yt={border:"b base",flex:"~ gap2","items-center":"",px4:"",py2:""},Zt={key:1,"text-xs":"",op50:""},en={key:0,"flex-auto":"","overflow-auto":""},tn={border:"~ base","h-full":"","w-full":"",rounded:""},nn=["data"],on={key:2,"flex-auto":"","overflow-auto":"",p4:""},an={border:"~ base",rounded:""},sn=["src"],ln={key:1,controls:"",rounded:""},rn=["src"],un=ye({__name:"ServerRouteDetails",props:{route:{}},emits:["openDefaultInput"],setup(e,{emit:l}){const o=e,n=l,[y,f]=Qe(),d=Xe(),m=Ye(),g=Ze(),i=ve({contentType:"text/plain",data:"",statusCode:200,error:void 0,fetchTime:0}),E=R(()=>i.contentType.includes("application/json")?"json":i.contentType.includes("text/html")?"html":i.contentType.includes("text/css")?"css":i.contentType.includes("text/javascript")?"javascript":i.contentType.includes("image")||i.contentType.includes("video")?"media":i.contentType.includes("text/xml")||i.contentType.includes("application/xml")?"xml":i.contentType.includes("application/pdf")?"pdf":"text"),U=R(()=>{if(E.value==="json")return JSON.stringify(i.data,null,2);if(E.value==="media"||E.value==="pdf"){const a=new Blob([i.data],{type:i.contentType});return URL.createObjectURL(a)}return i.data}),F=P(!1),A=P(!1),S=et(),_=R(()=>o.route.route?.split(/((?:\*\*)?:\w+)/g)),O=R(()=>_.value?.filter(a=>a.startsWith(":")||a.startsWith("**:"))||[]),h=P(o.route.method||"GET"),D=P({}),x=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"}]}),V=P({}),{inputDefaults:w,sendFrom:H}=De("serverRoutes"),Q=R(()=>g?.value?.app?.$fetch?H.value:"devtools"),re=["GET","POST","PUT","PATCH","DELETE","HEAD"],ie=["PATCH","POST","PUT","DELETE"],ee=R(()=>ie.includes(h.value.toUpperCase())),c=P(),te=["input","json"],W=P(te[0]),ue=R({get:()=>x[c.value],set:a=>{x[c.value]=a}}),he=R(()=>({...G(w.value.query),...G(x.query)})),ge=R(()=>({...G(w.value.headers),...G(x.headers)})),de=R(()=>ee.value?W.value==="json"?{...G(w.value.body),...V.value}:{...G(w.value.body),...G(x.body)}:void 0),Ae=R(()=>{let a=window?.location.origin;return a.charAt(a.length-1)==="/"&&(a=a.slice(0,-1)),a}),ne=R(()=>{let a=new URLSearchParams(he.value).toString();a&&(a=`?${a}`);const t=(_.value?.map(j=>(j.startsWith(":")||j.startsWith("**:"))&&D.value[j]||j).join("")||"")+a;let p=m.value?.app.baseURL||"";return(p==="./"||p===".")&&(p=""),p.endsWith("/")&&(p=p.slice(0,-1)),p+t}),be=R(()=>Ae.value+ne.value);function G(a){const t=Object.fromEntries(a.filter(({active:p,key:j,value:T})=>p&&j&&T!==void 0).map(({key:p,value:j})=>[p,j]));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;at("server-routes:fetch",{method:h.value,sendFrom:Q.value});try{i.data=await t(be.value,{method:h.value.toUpperCase(),headers:ge.value,query:he.value,body:de.value,onResponse({response:p}){i.contentType=(p.headers.get("content-type")||"").toString().toLowerCase().trim(),i.statusCode=p.status,i.error=void 0},onResponseError(p){i.error=p.response._data,i.data=p.response._data}})}catch{}F.value=!1,i.fetchTime=Date.now()-a}const ke=R(()=>{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
|
-
}`),de.value&&t.push(`body: ${JSON.stringify(de.value,null,2)}`);const
|
|
4
|
+
}`),de.value&&t.push(`body: ${JSON.stringify(de.value,null,2)}`);const j=t.length?`, {
|
|
5
5
|
${t.join(`,
|
|
6
6
|
`).split(`
|
|
7
7
|
`).map(T=>` ${T}`).join(`
|
|
8
8
|
`)}
|
|
9
|
-
}`:"";return a.push({name:"useFetch",lang:"javascript",docs:we.nuxt.useFetch,code:`const { data, pending, error, refresh } = useFetch('${ne.value}'${R})`}),a.push({name:"$fetch",lang:"javascript",docs:we.nuxt.$fetch,code:`await $fetch('${ne.value}'${R})`}),a}),X=P(qe()),H=ve({key:"",value:""}),Be=j(()=>{const a=[];return N.value.length&&a.push({name:"Params",slug:"params",length:N.value.length}),a.push({name:"Query",slug:"query",length:x.query.length}),ee.value&&a.push({name:"Body",slug:"body",length:x.body.length}),a.push({name:"Headers",slug:"headers",length:x.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=Vt(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}yt(()=>{G.value==="json"&&typeof V.value=="string"&&(V.value=JSON.parse(V.value))});const pe=tt("nuxt-devtools:server-routes:inputs",()=>[],{window:window.parent});nt([x,c],()=>{const a=pe.value?.find(t=>t.path===o.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(x,{body:t,query:p,headers:R}),D.value=T}else{const t={path:o.route.filepath,tab:N.value.length?"params":"query",inputs:{...x,...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=[],x.body=[],x.query=[],x.headers=[],D.value={},c.value=N.value.length?"params":"query"}const Fe=ot();return(a,t)=>{const p=Re,R=_t,T=st,q=Ee,xe=Ne,ze=kt,He=je,We=lt,fe=Ve,Ge=xt,Je=wt,oe=Oe("tooltip");return r(),k("div",Nt,[u("div",Lt,[u("div",Pt,[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(L,null,W(re,s=>u("option",{key:s,class:M(b(le)(s))},U(s.toUpperCase()),3)),64))]),_:1},8,["modelValue","class"])),u("div",At,[v(T,{"model-value":ne.value,readonly:"","flex-auto":"","font-mono":"",p:"x5 y2",n:"sm"},null,8,["model-value"]),u("div",Bt,[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),[[oe,"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),[[oe,"Open in Editor"]])])]),v(p,{"h-full":"",n:"primary solid",onClick:_e},{default:C(()=>[v(q,{icon:"carbon:send"})]),_:1})])]),u("div",qt,[(r(!0),k(L,null,W(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"]),u("div",Mt,[K(U(s.name)+" "+U(s?.length?`(${s.length})`:"")+" ",1),u("span",null,U(b(w)[s.slug]?.length?`(${b(w)[s.slug].length})`:""),1)])]),_:2},1032,["class","onClick"])),[[oe,s.name]])),128)),t[12]||(t[12]=u("div",{"flex-auto":""},null,-1)),t[13]||(t[13]=u("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]=[u("option",{value:"app"}," App ",-1),u("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),[[oe,"Clear Inputs Saved Cache"]])]),c.value==="params"?(r(),k("div",Ft,[(r(!0),k(L,null,W(N.value,s=>(r(),k(L,{key:s},[u("div",zt,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))])):O("",!0),c.value==="cookies"?(r(),k("div",Ht,[(r(!0),k(L,null,W(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)),u("div",Wt,[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})])])):O("",!0),v(b(y),null,{default:C(()=>[v(xe,{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(w)[c.value]?.length?(r(),k(L,{key:0},[u("div",Gt,[t[14]||(t[14]=u("div",{"w-5":"","x-divider":""},null,-1)),t[15]||(t[15]=u("div",{"flex-none":""}," Default Inputs ",-1)),v(p,{icon:"i-carbon-edit",border:!1,onClick:t[7]||(t[7]=s=>n("openDefaultInput"))}),t[16]||(t[16]=u("div",{"x-divider":""},null,-1))]),v(xe,{modelValue:b(w)[c.value],"onUpdate:modelValue":t[8]||(t[8]=s=>b(w)[c.value]=s),disabled:"",p0:""},null,8,["modelValue"])],64)):O("",!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"])):O("",!0)])):ue.value?(r(),k("div",Kt,[c.value==="body"?(r(),k(L,{key:0},[u("div",Qt,[(r(),k(L,null,W(te,s=>u("button",{key:s,px4:"",py2:"",border:"r base",hover:"bg-active",class:M({"border-b":s!==G.value}),onClick:Y=>G.value=s},[u("div",{class:M({op30:s!==G.value}),"font-mono":""},U(s),3)],10,Xt)),64)),t[17]||(t[17]=u("div",{border:"b base","flex-auto":""},null,-1))]),G.value==="input"?(r(),$(b(f),{key:0})):G.value==="json"?(r(),$(b(gt),ht({key:1,modelValue:V.value,"onUpdate:modelValue":t[10]||(t[10]=s=>V.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"])):O("",!0)],64)):(r(),$(b(f),{key:1}))])):O("",!0),A.value?F.value?(r(),$(We,{key:5,"z-10":"","flex-auto":"","backdrop-blur":""},{default:C(()=>t[19]||(t[19]=[K(" Fetching... ")])),_:1})):(r(),k(L,{key:6},[u("div",Yt,[t[21]||(t[21]=u("div",null,"Response",-1)),i.error?(r(),$(fe,{key:0,n:"red"},{default:C(()=>t[20]||(t[20]=[K(" Error ")])),_:1})):O("",!0),v(fe,{n:i.error?"orange":"green",textContent:U(i.statusCode)},null,8,["n","textContent"]),i.contentType?(r(),k("code",Zt,U(i.contentType),1)):O("",!0),i.contentType==="application/json"?(r(),$(Ge,{key:2,getter:()=>({input:I.value})},null,8,["getter"])):O("",!0),t[22]||(t[22]=u("div",{"flex-auto":""},null,-1)),t[23]||(t[23]=u("div",{op50:""}," Request finished in ",-1)),v(fe,{n:"green"},{default:C(()=>[K(U(i.fetchTime)+" ms ",1)]),_:1})]),E.value==="pdf"?(r(),k("div",en,[u("div",tn,[u("object",{data:I.value,type:"application/pdf","flex-auto":"",width:"100%",height:"100%",rounded:""},null,8,nn)])])):E.value!=="media"?(r(),$(Je,{key:1,"flex-auto":"","overflow-auto":"","py-2":"",code:I.value,lang:E.value},null,8,["code","lang"])):(r(),k("div",on,[u("div",an,[i.contentType.includes("image")?(r(),k("img",{key:0,rounded:"",src:I.value},null,8,sn)):(r(),k("video",ln,[u("source",{src:I.value,type:"video/mp4"},null,8,rn)]))])]))],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}))])}}}),dn={flex:"~ gap1","text-sm":""},cn={key:0,op50:""},pn={op50:""},Rn=ye({__name:"server-routes",setup(e){const l=P(!1),o=rt(),n=$e(),{selectedRoute:y,view:f,inputDefaults:d}=De("serverRoutes"),m=j(()=>{!n.value&&y.value&&(n.value=y.value.filepath);const S=o.value?.find(_=>_.filepath===n.value);return n.value!==y.value?.filepath&&S&&(y.value=S),S}),g=P(""),i=j(()=>new it(o.value||[],{keys:["method","route"],shouldSort:!0})),E=j(()=>o.value?g.value?i.value.search(g.value).map(_=>_.item):o.value:[]),I=j(()=>{const S=[],_=(h,D)=>{h.routes=h.routes||[],h.routes.push(D)},N=(h,D)=>{const x=D?D.routes?.find(w=>w.route===h):S.find(w=>w.route===h);if(x)return x;const V={route:h,filepath:h.replace(/\W/g,"-").toLowerCase(),type:"collection",routes:[]};return D?_(D,V):S.push(V),V};return E.value.forEach(h=>{let D,x;const V=h.filepath.split("/"),w=V.slice(V.indexOf("server")+1);if(h.type==="runtime"){w[0]="runtime";const z=V.indexOf("dist");z!==-1&&(D=V[z-1],D&&w.splice(1,0,D))}w.length>0&&w[w.length-1].includes(".")&&w.pop(),w.forEach(z=>{x=N(z,x)}),x?_(x,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=ct,D=Pe,x=un,V=dt,w=je,z=ut,Q=Ne,re=St,ie=Tt,ee=Oe("tooltip");return r(),k(L,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(()=>[u("div",dn,[g.value?(r(),k("span",cn,U(E.value.length)+" matched · ",1)):O("",!0),u("span",pn,U(b(o)?.length)+" routes in total",1)])]),_:1},8,["search"]),(r(!0),k(L,null,W(b(f)==="tree"?I.value:E.value,c=>(r(),$(D,{key:c.filepath,item:c},null,8,["item"]))),128))]),right:C(()=>[(r(),$(bt,{max:10},[m.value?(r(),$(x,{key:m.value.filepath,route:m.value,onOpenDefaultInput:_[2]||(_[2]=c=>l.value=!0)},null,8,["route"])):O("",!0)],1024)),m.value?O("",!0):(r(),$(w,{key:0},{default:C(()=>[v(V,{px6:"",py2:""},{default:C(()=>_[5]||(_[5]=[u("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(()=>[u("div",null,[_[6]||(_[6]=u("div",{p4:"",border:"b base"},[u("span",{"text-lg":""},"Default Inputs"),u("br"),u("span",{"text-white":"",op50:""},"Merged as default for every request in DevTools")],-1)),(r(!0),k(L,null,W(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{Rn as default};
|
|
9
|
+
}`:"";return a.push({name:"useFetch",lang:"javascript",docs:we.nuxt.useFetch,code:`const { data, pending, error, refresh } = useFetch('${ne.value}'${j})`}),a.push({name:"$fetch",lang:"javascript",docs:we.nuxt.$fetch,code:`await $fetch('${ne.value}'${j})`}),a}),X=P(qe()),z=ve({key:"",value:""}),Be=R(()=>{const a=[];return O.value.length&&a.push({name:"Params",slug:"params",length:O.value.length}),a.push({name:"Query",slug:"query",length:x.query.length}),ee.value&&a.push({name:"Body",slug:"body",length:x.body.length}),a.push({name:"Headers",slug:"headers",length:x.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),j=Vt(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=""),j.value=t}yt(()=>{W.value==="json"&&typeof V.value=="string"&&(V.value=JSON.parse(V.value))});const pe=tt("nuxt-devtools:server-routes:inputs",()=>[],{window:window.parent});nt([x,c],()=>{const a=pe.value?.find(t=>t.path===o.route.filepath);if(a){c.value||(c.value=a.tab),a.tab!==c.value&&(a.tab=c.value);const{body:t,query:p,headers:j,params:T}=a.inputs;Object.assign(x,{body:t,query:p,headers:j}),D.value=T}else{const t={path:o.route.filepath,tab:O.value.length?"params":"query",inputs:{...x,...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=[],x.body=[],x.query=[],x.headers=[],D.value={},c.value=O.value.length?"params":"query"}const Fe=ot();return(a,t)=>{const p=je,j=_t,T=st,q=Ee,xe=Oe,He=kt,ze=Re,Je=lt,fe=Ve,We=xt,Ge=wt,oe=Ne("tooltip");return r(),k("div",Ot,[u("div",Lt,[u("div",Pt,[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(I(h.value.toUpperCase()),1)]),_:1},8,["class"])):(r(),$(j,{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(L,null,J(re,s=>u("option",{key:s,class:M(b(le)(s))},I(s.toUpperCase()),3)),64))]),_:1},8,["modelValue","class"])),u("div",At,[v(T,{"model-value":ne.value,readonly:"","flex-auto":"","font-mono":"",p:"x5 y2",n:"sm"},null,8,["model-value"]),u("div",Bt,[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),[[oe,"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),[[oe,"Open in Editor"]])])]),v(p,{"h-full":"",n:"primary solid",onClick:_e},{default:C(()=>[v(q,{icon:"carbon:send"})]),_:1})])]),u("div",qt,[(r(!0),k(L,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"]),u("div",Mt,[K(I(s.name)+" "+I(s?.length?`(${s.length})`:"")+" ",1),u("span",null,I(b(w)[s.slug]?.length?`(${b(w)[s.slug].length})`:""),1)])]),_:2},1032,["class","onClick"])),[[oe,s.name]])),128)),t[12]||(t[12]=u("div",{"flex-auto":""},null,-1)),t[13]||(t[13]=u("div",{"text-xs":"",op50:""}," Send from ",-1)),v(j,{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]=[u("option",{value:"app"}," App ",-1),u("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),[[oe,"Clear Inputs Saved Cache"]])]),c.value==="params"?(r(),k("div",Ft,[(r(!0),k(L,null,J(O.value,s=>(r(),k(L,{key:s},[u("div",Ht,I(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))])):N("",!0),c.value==="cookies"?(r(),k("div",zt,[(r(!0),k(L,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)),u("div",Jt,[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})])])):N("",!0),v(b(y),null,{default:C(()=>[v(xe,{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(w)[c.value]?.length?(r(),k(L,{key:0},[u("div",Wt,[t[14]||(t[14]=u("div",{"w-5":"","x-divider":""},null,-1)),t[15]||(t[15]=u("div",{"flex-none":""}," Default Inputs ",-1)),v(p,{icon:"i-carbon-edit",border:!1,onClick:t[7]||(t[7]=s=>n("openDefaultInput"))}),t[16]||(t[16]=u("div",{"x-divider":""},null,-1))]),v(xe,{modelValue:b(w)[c.value],"onUpdate:modelValue":t[8]||(t[8]=s=>b(w)[c.value]=s),disabled:"",p0:""},null,8,["modelValue"])],64)):N("",!0)]),_:1},8,["modelValue"])]),_:1}),c.value==="snippet"?(r(),k("div",Gt,[ke.value.length?(r(),$(He,{key:0,"code-snippets":ke.value},null,8,["code-snippets"])):N("",!0)])):ue.value?(r(),k("div",Kt,[c.value==="body"?(r(),k(L,{key:0},[u("div",Qt,[(r(),k(L,null,J(te,s=>u("button",{key:s,px4:"",py2:"",border:"r base",hover:"bg-active",class:M({"border-b":s!==W.value}),onClick:Y=>W.value=s},[u("div",{class:M({op30:s!==W.value}),"font-mono":""},I(s),3)],10,Xt)),64)),t[17]||(t[17]=u("div",{border:"b base","flex-auto":""},null,-1))]),W.value==="input"?(r(),$(b(f),{key:0})):W.value==="json"?(r(),$(b(gt),ht({key:1,modelValue:V.value,"onUpdate:modelValue":t[10]||(t[10]=s=>V.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"])):N("",!0)],64)):(r(),$(b(f),{key:1}))])):N("",!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(L,{key:6},[u("div",Yt,[t[21]||(t[21]=u("div",null,"Response",-1)),i.error?(r(),$(fe,{key:0,n:"red"},{default:C(()=>t[20]||(t[20]=[K(" Error ")])),_:1})):N("",!0),v(fe,{n:i.error?"orange":"green",textContent:I(i.statusCode)},null,8,["n","textContent"]),i.contentType?(r(),k("code",Zt,I(i.contentType),1)):N("",!0),i.contentType==="application/json"?(r(),$(We,{key:2,getter:()=>({input:U.value})},null,8,["getter"])):N("",!0),t[22]||(t[22]=u("div",{"flex-auto":""},null,-1)),t[23]||(t[23]=u("div",{op50:""}," Request finished in ",-1)),v(fe,{n:"green"},{default:C(()=>[K(I(i.fetchTime)+" ms ",1)]),_:1})]),E.value==="pdf"?(r(),k("div",en,[u("div",tn,[u("object",{data:U.value,type:"application/pdf","flex-auto":"",width:"100%",height:"100%",rounded:""},null,8,nn)])])):E.value!=="media"?(r(),$(Ge,{key:1,"flex-auto":"","overflow-auto":"","py-2":"",code:U.value,lang:E.value},null,8,["code","lang"])):(r(),k("div",on,[u("div",an,[i.contentType.includes("image")?(r(),k("img",{key:0,rounded:"",src:U.value},null,8,sn)):(r(),k("video",ln,[u("source",{src:U.value,type:"video/mp4"},null,8,rn)]))])]))],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}))])}}}),dn={flex:"~ gap1","text-sm":""},cn={key:0,op50:""},pn={op50:""},jn=ye({__name:"server-routes",setup(e){const l=P(!1),o=rt(),n=$e(),{selectedRoute:y,view:f,inputDefaults:d}=De("serverRoutes"),m=R(()=>{!n.value&&y.value&&(n.value=y.value.filepath);const S=o.value?.find(_=>_.filepath===n.value);return n.value!==y.value?.filepath&&S&&(y.value=S),S}),g=P(""),i=R(()=>new it(o.value||[],{keys:["method","route"],shouldSort:!0})),E=R(()=>o.value?g.value?i.value.search(g.value).map(_=>_.item):o.value:[]),U=R(()=>{const S=[],_=(h,D)=>{h.routes=h.routes||[],h.routes.push(D)},O=(h,D)=>{const x=D?D.routes?.find(w=>w.route===h):S.find(w=>w.route===h);if(x)return x;const V={route:h,filepath:h.replace(/\W/g,"-").toLowerCase(),type:"collection",routes:[]};return D?_(D,V):S.push(V),V};return E.value.forEach(h=>{let D,x;const V=h.filepath.split("/"),w=V.slice(V.indexOf("server")+1);if(h.type==="runtime"){w[0]="runtime";const H=V.indexOf("dist");H!==-1&&(D=V[H-1],D&&w.splice(1,0,D))}w.length>0&&w[w.length-1].includes(".")&&w.pop(),w.forEach(H=>{x=O(H,x)}),x?_(x,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=je,h=ct,D=Pe,x=un,V=dt,w=Re,H=ut,Q=Oe,re=St,ie=Tt,ee=Ne("tooltip");return r(),k(L,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(()=>[u("div",dn,[g.value?(r(),k("span",cn,I(E.value.length)+" matched · ",1)):N("",!0),u("span",pn,I(b(o)?.length)+" routes in total",1)])]),_:1},8,["search"]),(r(!0),k(L,null,J(b(f)==="tree"?U.value:E.value,c=>(r(),$(D,{key:c.filepath,item:c},null,8,["item"]))),128))]),right:C(()=>[(r(),$(bt,{max:10},[m.value?(r(),$(x,{key:m.value.filepath,route:m.value,onOpenDefaultInput:_[2]||(_[2]=c=>l.value=!0)},null,8,["route"])):N("",!0)],1024)),m.value?N("",!0):(r(),$(w,{key:0},{default:C(()=>[v(V,{px6:"",py2:""},{default:C(()=>_[5]||(_[5]=[u("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(()=>[u("div",null,[_[6]||(_[6]=u("div",{p4:"",border:"b base"},[u("span",{"text-lg":""},"Default Inputs"),u("br"),u("span",{"text-white":"",op50:""},"Merged as default for every request in DevTools")],-1)),(r(!0),k(L,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{jn as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{be as re,H as oe,g as le,bb as ke,Q as xe,J as Te,K as we,ag as Se,bc as Xe,a as Ee,b9 as De,x as Ce,_ as ce,z as Me,h as fe,ay as Ie,bf as $e,N as Ue,w as Le,U as Ne}from"./oxe0udya.js";import{_ as Ae}from"./nnavbar.vue-d4wh5lbd.js";import{_ as de}from"./nbadge-jvyvrl6c.js";import{a as Re,p as K,f as z,q as U,U as g,W as $,X as v,a3 as k,a8 as A,F as W,ae as Z,a0 as Y,u as D,Z as j,r as se,w as Ve,ag as pe,aa as G,a2 as I,a9 as P,P as R,a4 as je,ax as We,$ as Be,Y as He,K as ze}from"./vendor/json-editor-vue-npezbdce.js";import{_ as ve}from"./server-route-inputs.vue-f0ahq663.js";import{_ as Fe}from"./ncode-block.vue-msaaoy71.js";import{S as he}from"./constants-b32h69zq.js";import{_ as qe}from"./nsection-block-ik5hcxqh.js";import{_ as Pe}from"./ndrawer.vue-ng1vhz5m.js";import"./vendor/unocss-jzxuon8q.js";import"./vendor/shiki-ej2em068.js";import"./ncheckbox.vue-n785sfxh.js";import"./nselect.vue-i09woppj.js";import"./client-edufhzwa.js";import"./nicon-title.vue-j1ceohu1.js";var ne={exports:{}},ue;function Ye(){return ue||(ue=1,function(F,L){(function(x,S){F.exports=S()})(globalThis,()=>(()=>{var N={949:(b,d,_)=>{Object.defineProperty(d,"__esModule",{value:!0}),d.CronParser=void 0;var o=_(515),p=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){var e="0-9,\\-*/";this.validateOnlyExpectedCharactersFound(t[0],e),this.validateOnlyExpectedCharactersFound(t[1],e),this.validateOnlyExpectedCharactersFound(t[2],e),this.validateOnlyExpectedCharactersFound(t[3],"0-9,\\-*/LW"),this.validateOnlyExpectedCharactersFound(t[4],e),this.validateOnlyExpectedCharactersFound(t[5],"0-9,\\-*/L#"),this.validateOnlyExpectedCharactersFound(t[6],e),this.validateAnyRanges(t)},y.prototype.validateAnyRanges=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.validateOnlyExpectedCharactersFound=function(t,e){var a=t.match(new RegExp("[^".concat(e,"]+"),"gi"));if(a&&a.length)throw new Error("Expression contains invalid values: '".concat(a.toString(),"'"))},y}();d.CronParser=p},333:(b,d,_)=>{Object.defineProperty(d,"__esModule",{value:!0}),d.ExpressionDescriptor=void 0;var o=_(823),p=_(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,M=r.use24HourTimeFormat,T=r.locale,B=T===void 0?null:T,V=r.tzOffset,E=V===void 0?0:V,H={throwExceptionOnParseError:s,verbose:u,dayOfWeekStartIndexZero:c,monthStartIndexZero:f,use24HourTimeFormat:M,locale:B,tzOffset:E};H.tzOffset&&console.warn("'tzOffset' option has been deprecated and will be removed in a future release.");var ee=new t(e,H);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 p.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,M=n.substring(n.indexOf("#")+1),T=n.substring(0,n.indexOf("#"));switch(M){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(","),M="",T=0;T<f.length;T++)if(T>0&&f.length>2&&(M+=",",T<f.length-1&&(M+=" ")),T>0&&f.length>1&&(T==f.length-1||f.length==2)&&(M+="".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(", ","")),M+=V}else h?M+=this.getSegmentDescription(f[T],a,r,n,s,i):M+=r(f[T]);h?u=M:u=o.StringUtilities.format(i(e),M)}else if(h){var f=e.split("/");if(u=o.StringUtilities.format(n(f[1]),f[1]),f[0].indexOf("-")>-1){var E=this.generateRangeSegmentDescription(f[0],s,r);E.indexOf(", ")!=0&&(u+=", "),u+=E}else if(f[0].indexOf("*")==-1){var H=o.StringUtilities.format(i(f[0]),r(f[0]));H=H.replace(", ",""),u+=o.StringUtilities.format(this.i18n.commaStartingX0(),H)}}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}();d.ExpressionDescriptor=y},747:(b,d,_)=>{Object.defineProperty(d,"__esModule",{value:!0}),d.enLocaleLoader=void 0;var o=_(486),p=function(){function y(){}return y.prototype.load=function(t){t.en=new o.en},y}();d.enLocaleLoader=p},486:(b,d)=>{Object.defineProperty(d,"__esModule",{value:!0}),d.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}();d.en=_},515:(b,d)=>{Object.defineProperty(d,"__esModule",{value:!0});function _(p,y){if(!p)throw new Error(y)}var o=function(){function p(){}return p.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")}},p.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")}},p.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")}},p.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")}},p.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")}},p.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")}},p}();d.default=o},823:(b,d)=>{Object.defineProperty(d,"__esModule",{value:!0}),d.StringUtilities=void 0;var _=function(){function o(){}return o.format=function(p){for(var y=[],t=1;t<arguments.length;t++)y[t-1]=arguments[t];return p.replace(/%s/g,function(e){return y.shift()})},o.containsAny=function(p,y){return y.some(function(t){return p.indexOf(t)>-1})},o}();d.StringUtilities=_}},x={};function S(b){var d=x[b];if(d!==void 0)return d.exports;var _=x[b]={exports:{}};return N[b](_,_.exports,S),_.exports}var X={};return(()=>{var b=X;Object.defineProperty(b,"__esModule",{value:!0}),b.toString=void 0;var d=S(333),_=S(747);d.ExpressionDescriptor.initialize(new _.enLocaleLoader),b.default=d.ExpressionDescriptor;var o=d.ExpressionDescriptor.toString;b.toString=o})(),X})())}(ne)),ne.exports}var Ge=Ye();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(F){const L=F,N=re(),x=z(!0),S=U(()=>Ze.toString(L.collection.cron));return(X,b)=>{const d=oe,_=de;return g(),$("div",null,[v("button",{flex:"~ gap-2","w-full":"","items-start":"","items-center":"","hover-bg-active":"",p2:"",title:S.value,onClick:b[0]||(b[0]=o=>x.value=!x.value)},[v("div",Qe,[k(d,{icon:"carbon:chevron-right","mb0.5":"","transform-rotate":x.value?90:0,transition:""},null,8,["transform-rotate"])]),v("span",Ke,[k(_,{class:"font-mono n-primary",textContent:A(X.collection.cron)},null,8,["textContent"]),v("span",et,A(S.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:Y([{"bg-active":D(N)===o}]),onClick:p=>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"},dt={flex:"~ gap2","mb--2":"","items-center":"",op50:""},pt={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(F,{emit:L}){const N=F,x=L,S=z({payload:{}}),{inputDefaults:X}=le("serverRoutes"),[b,d]=ke(),_=xe(),o=Te(),p=se({contentType:"text/plain",data:"",statusCode:200,error:void 0,fetchTime:0}),y=U(()=>JSON.stringify(p.data,null,2)),t=U(()=>p.contentType.includes("application/json")?"json":"text"),e=z(!1),a=z(!1),r=we(),n=z(),s=["json"],i=z(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:O=>{u[n.value]=O}}),c=U(()=>({...E(X.value.query),...E(u.query)})),m=U(()=>({...E(X.value.headers)})),f=U(()=>Object.keys(S.value?.payload??{}).length?{...S.value}:void 0),M=U(()=>f.value?"POST":"GET"),T=U(()=>{let O=window?.location.origin;return O.charAt(O.length-1)==="/"&&(O=O.slice(0,-1)),O}),B=U(()=>{let O=new URLSearchParams(c.value).toString();O&&(O=`?${O}`);const l=`/_nitro/tasks/${N.task.name}${O}`;let C=o.value?.app.baseURL||"";return(C==="./"||C===".")&&(C=""),C.endsWith("/")&&(C=C.slice(0,-1)),C+l}),V=U(()=>T.value+B.value);function E(O){const l=Object.fromEntries(O.filter(({active:C,key:q,value:J})=>C&&q&&J!==void 0).map(({key:C,value:q})=>[C,q]));return Object.entries(l).length?l:void 0}async function H(){a.value=!0,e.value=!0;const O=Date.now();Ce("server-tasks:run",{method:M.value});try{p.data=await $fetch(V.value,{method:"POST",headers:m.value,query:c.value,body:f.value,onResponse({response:l}){p.contentType=(l.headers.get("content-type")||"").toString().toLowerCase().trim(),p.statusCode=l.status,p.error=void 0},onResponseError(l){p.error=l.response._data,p.data=l.response._data}})}catch{}e.value=!1,p.fetchTime=Date.now()-O}const ee=U(()=>{const O=[];return O.push({name:"Query",slug:"query",length:u.query.length}),O.push({name:"Body",slug:"body",length:u.body.length}),O});Ve(()=>{if(i.value==="json"&&typeof S.value=="string")try{S.value=JSON.parse(S.value)}catch{}});const ae=Se("nuxt-devtools:server-tasks:inputs",()=>[],{window:window.parent});Xe([u,n],()=>{const O=ae.value?.find(l=>l.task===N.task.name);if(O){n.value||(n.value=O.tab),O.tab!==n.value&&(O.tab=n.value);const{body:l,query:C,headers:q}=O.inputs;Object.assign(u,{body:l,query:C,headers:q})}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=Ee();return(O,l)=>{const C=ce,q=Me,J=oe,ie=ve,ge=fe,_e=Ie,te=de,be=Fe,Q=pe("tooltip");return g(),$("div",at,[v("div",it,[v("div",st,[G((g(),$("div",null,[k(C,{class:Y(["n-badge-base n-sm",D(De)(M.value)]),"pointer-events-none":"","font-mono":"",tabindex:"-1"},{default:I(()=>[P(A(M.value),1)]),_:1},8,["class"])])),[[Q,`Method is ${M.value} as ${M.value==="GET"?"no":""} json body is sent`]]),v("div",ut,[k(q,{"model-value":B.value,readonly:"","flex-auto":"","font-mono":"",p:"x5 y2",n:"sm"},null,8,["model-value"]),v("div",lt,[G(k(C,{title:"Copy URL",n:"xs blue",icon:"carbon:copy",border:!1,onClick:l[0]||(l[0]=w=>D(ye)(V.value,"server-task-url"))},null,512),[[Q,"Copy URL"]]),G(k(C,{title:"Open in Editor",icon:"carbon-launch",n:"xs blue",border:!1,onClick:l[1]||(l[1]=w=>D(r)(O.task.handler))},null,512),[[Q,"Open in Editor"]])])]),k(C,{"h-full":"",n:"primary solid",onClick:H},{default:I(()=>[k(J,{icon:"carbon:send"})]),_:1})])]),v("div",ct,[(g(!0),$(W,null,Z(ee.value,w=>G((g(),R(C,{key:w.slug,class:Y(n.value===w.slug?"text-primary n-primary":"border-transparent shadow-none"),onClick:Oe=>n.value=w.slug},{default:I(()=>[k(J,{icon:D(he)[w.slug]},null,8,["icon"]),v("div",ft,[P(A(w.name)+" "+A(w?.length?`(${w.length})`:"")+" ",1),v("span",null,A(D(X)[w.slug]?.length?`(${D(X)[w.slug].length})`:""),1)])]),_:2},1032,["class","onClick"])),[[Q,w.name]])),128))]),k(D(b),null,{default:I(()=>[k(ie,{modelValue:h.value,"onUpdate:modelValue":l[4]||(l[4]=w=>h.value=w),default:{active:!0,type:"string"},"max-h-xs":"","of-auto":""},{default:I(()=>[D(X)[n.value]?.length?(g(),$(W,{key:0},[v("div",dt,[l[6]||(l[6]=v("div",{"w-5":"","x-divider":""},null,-1)),l[7]||(l[7]=v("div",{"flex-none":""}," Default Inputs ",-1)),k(C,{icon:"i-carbon-edit",border:!1,onClick:l[2]||(l[2]=w=>x("openDefaultInput"))}),l[8]||(l[8]=v("div",{"x-divider":""},null,-1))]),k(ie,{modelValue:D(X)[n.value],"onUpdate:modelValue":l[3]||(l[3]=w=>D(X)[n.value]=w),disabled:"",p0:""},null,8,["modelValue"])],64)):j("",!0)]),_:1},8,["modelValue"])]),_:1}),h.value?(g(),$("div",pt,[n.value==="body"?(g(),$(W,{key:0},[v("div",vt,[(g(),$(W,null,Z(s,w=>v("button",{key:w,px4:"",py2:"",border:"r base",hover:"bg-active",class:Y({"border-b":w!==i.value}),onClick:Oe=>i.value=w},[v("div",{class:Y({op30:w!==i.value}),"font-mono":""},A(w),3)],10,ht)),64)),l[9]||(l[9]=v("div",{border:"b base","flex-auto":""},null,-1))]),i.value==="input"?(g(),R(D(d),{key:0})):i.value==="json"?(g(),R(D(We),je({key:1,modelValue:S.value,"onUpdate:modelValue":l[5]||(l[5]=w=>S.value=w),class:[D(_)==="dark"?"jse-theme-dark":"light","json-editor-vue of-auto text-sm outline-none"]},O.$attrs,{mode:"text","navigation-bar":!1,indentation:2,"tab-size":2}),null,16,["modelValue","class"])):j("",!0)],64)):(g(),R(D(d),{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)),p.error?(g(),R(te,{key:0,n:"red"},{default:I(()=>l[12]||(l[12]=[P(" Error ")])),_:1})):j("",!0),k(te,{n:p.error?"orange":"green",textContent:A(p.statusCode)},null,8,["n","textContent"]),p.contentType?(g(),$("code",yt,A(p.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)),k(te,{n:"green"},{default:I(()=>[P(A(p.fetchTime)+" ms ",1)]),_:1})]),k(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(()=>[k(C,{n:"primary",onClick:H},{default:I(()=>[k(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(F){const L=z(!0),N=re();return(x,S)=>{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:Y([{"bg-active":D(N)===x.item.name}]),style:Be({paddingLeft:`calc(0.5rem + ${x.index*1.5}em)`}),onClick:S[0]||(S[0]=d=>{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:""})),P(" "+A(x.item.name),1)])],6),S[1]||(S[1]=v("div",{"x-divider":""},null,-1)),L.value?He(x.$slots,"default",{key:0},()=>[(g(!0),$(W,null,Z(x.item.tasks,d=>(g(),R(b,{key:d.name,item:d,index:x.index+1},null,8,["item","index"]))),128))]):j("",!0)])}}}),Ot={flex:"~ gap1","text-sm":""},kt={key:0,op50:""},xt={op50:""},Vt=K({__name:"server-tasks",setup(F){const L=z(!1),N=$e(),x=U(()=>Object.keys(N.value?.tasks??{}).map(r=>({name:r,...N.value.tasks[r],type:"task"}))),S=U(()=>Object.entries(N.value?.scheduledTasks??{}).map(([r,n])=>({cron:r,tasks:n}))),X=re(),{view:b,selectedTask:d,inputDefaults:_}=le("serverTasks"),o=U(()=>{!X.value&&d.value&&(X.value=d.value.name);const r=x.value.find(n=>n.name===X.value);return X.value!==d.value?.name&&r&&(d.value=r),r}),p=z(""),y=U(()=>new Ue(x.value,{keys:["key","description"],shouldSort:!0})),t=U(()=>p.value?y.value.search(p.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,M=ve,T=qe,B=Pe,V=pe("tooltip");return g(),$(W,null,[k(h,{"storage-key":"tab-server-tasks"},{left:I(()=>[k(h,{horizontal:"","storage-key":"tab-server-tasks-split"},{left:I(()=>[k(i,{search:p.value,"onUpdate:search":n[1]||(n[1]=E=>p.value=E),pb2:""},{actions:I(()=>[G(k(s,{"text-lg":"",icon:D(b)==="list"?"i-carbon-list":"i-carbon-tree-view-alt",title:"Toggle view",border:!1,onClick:a},null,8,["icon"]),[[V,"Toggle View"]]),G(k(s,{"text-lg":"",icon:"i-carbon-cics-sit-overrides",title:"Default Inputs",border:!1,onClick:n[0]||(n[0]=E=>L.value=!L.value)},null,512),[[V,"Default Inputs"]])]),default:I(()=>[v("div",Ot,[p.value?(g(),$("span",kt,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(D(b)==="tree"?e.value:t.value,E=>(g(),R(me,{key:E.name,item:E},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(S.value,E=>(g(),$("li",{key:E.cron},[k(u,{collection:E},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]=E=>L.value=!0)},null,8,["task"])):j("",!0)],1024)),o.value?j("",!0):(g(),R(f,{key:0},{default:I(()=>[k(m,{px6:"",py2:""},{default:I(()=>n[7]||(n[7]=[v("span",{op75:""},"Select a task to start",-1)])),_:1})]),_:1}))]),_:1}),k(B,{modelValue:L.value,"onUpdate:modelValue":n[4]||(n[4]=E=>L.value=E),"auto-close":"","max-w-xl":"","min-w-xl":"",onClose:n[5]||(n[5]=E=>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)),k(T,{text:`Query ${D(_).query.length?`(${D(_).query.length})`:""}`,padding:!1,icon:D(he).query},{default:I(()=>[k(M,{modelValue:D(_).query,"onUpdate:modelValue":n[3]||(n[3]=E=>D(_).query=E),py0:"",default:{active:!0,type:"string"}},null,8,["modelValue"])]),_:1},8,["text","icon"])])]),_:1},8,["modelValue"])],64)}}});export{Vt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as h}from"./nicon-title.vue-j1ceohu1.js";import{_ as ee}from"./nswitch.vue-l8xqfho0.js";import{g as P,f as le,
|
|
1
|
+
import{_ as h}from"./nicon-title.vue-j1ceohu1.js";import{_ as ee}from"./nswitch.vue-l8xqfho0.js";import{g as P,f as le,bq as oe,a0 as ne,r as te,_ as ae,U as se,t as B,bm as ie,br as ue}from"./oxe0udya.js";import{_ as de}from"./nselect.vue-i09woppj.js";import{_ as re}from"./ncheckbox.vue-n785sfxh.js";import{_ as pe}from"./nlink.vue-n73b3eoz.js";import{p as me,w as j,W as m,a3 as n,X as o,F as v,ae as k,u as t,a2 as a,U as d,P as F,a8 as x,a0 as M,Z as R,a9 as N,A as p}from"./vendor/json-editor-vue-npezbdce.js";import"./vendor/unocss-jzxuon8q.js";import"./vendor/shiki-ej2em068.js";const fe={px8:"",py6:""},ve={grid:"~ lg:cols-2 gap-x-10 gap-y-3","max-w-300":""},ge={flex:"~ col gap-2"},be={flex:"~ gap-2","flex-auto":"","items-center":"","justify-start":""},xe={capitalize:"",op75:""},ye={"flex-auto":"","overflow-hidden":"","text-ellipsis":"","ws-nowrap":""},ce={flex:"~ col gap-2"},Ve=["value"],_e=["value"],ke=["value"],Ce={flex:"~ gap-2"},we={flex:"~ gap-2"},Ae=me({__name:"settings",setup(Se){const{interactionCloseOnOutsideClick:C,showPanel:I,showHelpButtons:$,scale:z,hiddenTabs:y,pinnedTabs:u,hiddenTabCategories:c,minimizePanelInactive:w,sidebarExpanded:S,sidebarScrollable:D}=P("ui"),{openInEditor:E}=P("behavior"),V=le(),W=[["Auto",void 0],["VS Code","vscode"],["VS Code Insider","vscode-insider"],["Cursor","cursor"],["Zed","zed"],["WebStorm","webstorm"],["Sublime Text","sublime"],["Atom","atom"]],H=[["Tiny",12/15],["Small",14/15],["Normal",1],["Large",16/15],["Huge",18/15]],Z=[["Always",0],["1s",1e3],["2s",2e3],["5s",5e3],["10s",1e4],["Never",-1]],q=oe(ne());function X(s,e){e?y.value=y.value.filter(r=>r!==s):y.value.push(s)}function G(s,e){e?c.value=c.value.filter(r=>r!==s):c.value.push(s)}function J(s){u.value.includes(s)?u.value=u.value.filter(e=>e!==s):u.value.push(s)}function L(s,e){const r=u.value.indexOf(s);if(r===-1)return;const g=r+e;if(g<0||g>=u.value.length)return;const _=[...u.value];_.splice(r,1),_.splice(g,0,s),u.value=_}async function K(){confirm("Are you sure you to reset all local settings & state? The app will reload.")&&(Object.keys(localStorage).forEach(s=>{s.startsWith("nuxt-devtools-")&&localStorage.removeItem(s)}),await te.clearOptions(),V.value?.app?.reload?.(),window.location.reload())}return j(()=>{V.value&&(V.value.app.frameState.value.closeOnOutsideClick=C.value)}),j(()=>{V.value&&(V.value.app.frameState.value.minimizePanelInactive=w.value)}),(s,e)=>{const r=h,g=ee,_=ie,f=ae,T=se,Q=ue,A=de,b=re,Y=pe;return d(),m("div",fe,[n(r,{class:"mb-5 text-xl op75",icon:"i-carbon-settings-adjust",text:"DevTools Settings"}),o("div",ve,[o("div",ge,[e[10]||(e[10]=o("h3",{"text-lg":""}," Tabs ",-1)),(d(!0),m(v,null,k(t(q),([l,U])=>(d(),m(v,{key:l},[U.length?(d(),F(T,{key:0,p3:"",flex:"~ col gap-1",class:M(t(c).includes(l)?"op50 grayscale":"")},{default:a(()=>[n(g,{flex:"~ row-reverse",py1:"",pl2:"",pr1:"","n-lime":"","model-value":!t(c).includes(l),"onUpdate:modelValue":i=>G(l,i)},{default:a(()=>[o("div",be,[o("span",xe,x(l),1)])]),_:2},1032,["model-value","onUpdate:modelValue"]),e[9]||(e[9]=o("div",{"mx--1":"",my1:"","h-1px":"",border:"b base",op75:""},null,-1)),(d(!0),m(v,null,k(U,i=>(d(),F(g,{key:i.name,flex:"~ row-reverse",py1:"",pl2:"",pr1:"","n-primary":"","model-value":!t(y).includes(i.name),"onUpdate:modelValue":O=>X(i.name,O)},{default:a(()=>[o("div",{flex:"~ gap-2","flex-auto":"","items-center":"","justify-start":"","of-hidden":"","pr-4":"",class:M(t(y).includes(i.name)?"op25":"")},[n(_,{"text-xl":"",icon:i.icon,title:i.title},null,8,["icon","title"]),o("span",ye,x(i.title),1),t(u).includes(i.name)?(d(),m(v,{key:0},[n(f,{icon:"i-carbon-caret-up",disabled:t(u).indexOf(i.name)===0,border:!1,onClick:O=>L(i.name,-1)},null,8,["disabled","onClick"]),n(f,{icon:"i-carbon-caret-down",disabled:t(u).indexOf(i.name)===t(u).length-1,border:!1,onClick:O=>L(i.name,1)},null,8,["disabled","onClick"])],64)):R("",!0),n(f,{icon:t(u).includes(i.name)?" i-carbon-pin-filled rotate--45":" i-carbon-pin op50",border:!1,onClick:O=>J(i.name)},null,8,["icon","onClick"])],2)]),_:2},1032,["model-value","onUpdate:modelValue"]))),128))]),_:2},1032,["class"])):R("",!0)],64))),128))]),o("div",ce,[e[29]||(e[29]=o("h3",{"text-lg":""}," Appearance ",-1)),n(T,{p4:"",flex:"~ col gap-2"},{default:a(()=>[o("div",null,[n(Q,null,{default:a(({toggle:l,isDark:U})=>[n(f,{n:"primary",onClick:l},{default:a(()=>[e[11]||(e[11]=o("div",{"i-carbon-sun":"","dark:i-carbon-moon":"","translate-y--1px":""},null,-1)),N(" "+x(U.value?"Dark":"Light"),1)]),_:2},1032,["onClick"])]),_:1})]),e[14]||(e[14]=o("div",{"mx--2":"",my1:"","h-1px":"",border:"b base",op75:""},null,-1)),e[15]||(e[15]=o("p",null,"UI Scale",-1)),n(A,{modelValue:t(z),"onUpdate:modelValue":e[0]||(e[0]=l=>p(z)?z.value=l:null),n:"primary"},{default:a(()=>[(d(),m(v,null,k(H,l=>o("option",{key:l[0],value:l[1]},x(l[0]),9,Ve)),64))]),_:1},8,["modelValue"]),e[16]||(e[16]=o("div",{"mx--2":"",my1:"","h-1px":"",border:"b base",op75:""},null,-1)),n(b,{modelValue:t(S),"onUpdate:modelValue":e[1]||(e[1]=l=>p(S)?S.value=l:null),"n-primary":""},{default:a(()=>e[12]||(e[12]=[o("span",null," Expand Sidebar ",-1)])),_:1},8,["modelValue"]),n(b,{modelValue:t(D),"onUpdate:modelValue":e[2]||(e[2]=l=>p(D)?D.value=l:null),disabled:t(S),"n-primary":""},{default:a(()=>e[13]||(e[13]=[o("span",null," Scrollable Sidebar ",-1)])),_:1},8,["modelValue","disabled"])]),_:1}),e[30]||(e[30]=o("h3",{mt2:"","text-lg":""}," Features ",-1)),n(T,{p4:"",flex:"~ col gap-2"},{default:a(()=>[n(b,{modelValue:t(C),"onUpdate:modelValue":e[3]||(e[3]=l=>p(C)?C.value=l:null),"n-primary":""},{default:a(()=>e[17]||(e[17]=[o("span",null,"Close DevTools when clicking outside",-1)])),_:1},8,["modelValue"]),n(b,{modelValue:t($),"onUpdate:modelValue":e[4]||(e[4]=l=>p($)?$.value=l:null),"n-primary":""},{default:a(()=>e[18]||(e[18]=[o("span",null,"Show help buttons",-1)])),_:1},8,["modelValue"]),n(b,{modelValue:t(I),"onUpdate:modelValue":e[5]||(e[5]=l=>p(I)?I.value=l:null),"n-primary":""},{default:a(()=>e[19]||(e[19]=[o("span",null,"Show the floating panel",-1)])),_:1},8,["modelValue"]),e[20]||(e[20]=o("div",{"mx--2":"",my1:"","h-1px":"",border:"b base",op75:""},null,-1)),e[21]||(e[21]=o("p",null,"Minimize floating panel on inactive",-1)),n(A,{modelValue:t(w),"onUpdate:modelValue":e[6]||(e[6]=l=>p(w)?w.value=l:null),modelModifiers:{number:!0},"n-primary":""},{default:a(()=>[(d(),m(v,null,k(Z,l=>o("option",{key:l[0],value:l[1]},x(l[0]),9,_e)),64))]),_:1},8,["modelValue"]),e[22]||(e[22]=o("div",{"mx--2":"",my1:"","h-1px":"",border:"b base",op75:""},null,-1)),e[23]||(e[23]=o("p",null,"Open In Editor",-1)),n(A,{modelValue:t(E),"onUpdate:modelValue":e[7]||(e[7]=l=>p(E)?E.value=l:null),"n-primary":""},{default:a(()=>[(d(),m(v,null,k(W,l=>o("option",{key:l[0],value:l[1]},x(l[0]),9,ke)),64))]),_:1},8,["modelValue"])]),_:1}),e[31]||(e[31]=o("h3",{mt2:"","text-lg":""}," Feedback ",-1)),n(T,{p4:"",flex:"~ col gap-2"},{default:a(()=>[n(b,{modelValue:t(B),"onUpdate:modelValue":e[8]||(e[8]=l=>p(B)?B.value=l:null),"n-primary":""},{default:a(()=>[e[24]||(e[24]=o("span",null,"Send anonymous statistics, help us improving DevTools",-1)),n(Y,{href:"https://github.com/nuxt/devtools#anonymous-usage-analytics",target:"_blank",ml1:"",op50:"",textContent:"Learn more"})]),_:1},8,["modelValue"]),e[27]||(e[27]=o("div",{"mx--2":"",my1:"","h-1px":"",border:"b base",op75:""},null,-1)),o("div",Ce,[n(f,{n:"blue",to:"https://github.com/nuxt/devtools/discussions/29",target:"_blank"},{default:a(()=>e[25]||(e[25]=[o("div",{"i-carbon-data-enrichment":""},null,-1),N(" Ideas & Suggestions ")])),_:1}),n(f,{n:"orange",to:"https://github.com/nuxt/devtools/issues",target:"_blank"},{default:a(()=>e[26]||(e[26]=[o("div",{"i-carbon-debug":""},null,-1),N(" Bug Reports ")])),_:1})])]),_:1}),e[32]||(e[32]=o("h3",{mt2:"","text-lg":""}," Debug ",-1)),o("div",we,[n(f,{n:"orange",onClick:K},{default:a(()=>e[28]||(e[28]=[o("div",{"i-carbon-breaking-change":""},null,-1),N(" Reset Local Settings & State ")])),_:1})])])])])}}});export{Ae as default};
|
package/dist/client/_nuxt/{stacktrace-list.vue-fnbs7811.js → stacktrace-list.vue-oszdbwzk.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as p}from"./filepath-item.vue-
|
|
1
|
+
import{_ as p}from"./filepath-item.vue-fwhfa43n.js";import{J as m}from"./oxe0udya.js";import{p as f,W as r,F as s,ae as _,U as n,X as o,a8 as h,P as d,Z as k}from"./vendor/json-editor-vue-npezbdce.js";const g={mt2:"",grid:"~ cols-[max-content_1fr] gap-x-4","font-mono":""},x={"text-right":""},N={"ws-nowrap":""},B=f({__name:"StacktraceList",props:{stacktrace:{}},setup($){const i=m();function c(a){try{let t=new URL(a).pathname;return t.startsWith("/_nuxt/")&&(t=t.slice(6)),t.startsWith("/@id/virtual:nuxt:")?`#build/${t.split("/.nuxt/")[1]}`.replace(/\.m?js$/,""):t.includes("/@fs/")?`/${t.split("/@fs/")[1]}`:(i.value?.rootDir||"")+t}catch{return a}}return(a,t)=>{const l=p;return n(),r("div",g,[(n(!0),r(s,null,_(a.stacktrace,(e,u)=>(n(),r(s,{key:u},[o("div",x,h(e.functionName||"(anonymous)"),1),o("div",N,[e.fileName?(n(),d(l,{key:0,filepath:`${c(e.fileName)}:${e.lineNumber}:${e.columnNumber}`,subpath:""},null,8,["filepath"])):k("",!0)])],64))),128))])}}});export{B as _};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as m,
|
|
1
|
+
import{f as m,ar as o,r as n}from"./oxe0udya.js";import{q as s}from"./vendor/json-editor-vue-npezbdce.js";function u(){const p=m(),a=o("getComponents",()=>n.getComponents()),l=s(()=>Object.entries(p.value?.nuxt?.vueApp._context.components||{}).map(([e])=>({pascalName:e,global:!0})).filter(e=>!/^Lazy[A-Z]/.test(e.pascalName)).filter(e=>!(a.value||[]).find(t=>t.pascalName===e.pascalName)));return s(()=>[...l.value,...a.value||[]].sort((e,t)=>e.pascalName.localeCompare(t.pascalName)))}function i(){return o("getComponentsRelationships",()=>n.getComponentsRelationships())}export{i as a,u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C,Q as N,_ as O}from"./oxe0udya.js";import{_ as j}from"./data-schema-button.vue-ko85hw9e.js";import{p as z,m as g,z as D,j as M,ag as P,U as l,W as c,X as m,a0 as d,u as o,a8 as b,Z as p,Y as R,a5 as $,a6 as E,F as k,aa as J,a3 as x,P as _,a4 as A,ax as F,n as U}from"./vendor/json-editor-vue-npezbdce.js";const Q=["open"],T={flex:"~ gap2","select-none":"","items-center":"",px4:""},W={key:0,class:"bg-red:10 px5 py3 text-red"},G=z({__name:"StateEditor",props:{name:{},open:{type:Boolean},revision:{},state:{},readonly:{type:Boolean}},emits:["update:open"],setup(h,{emit:V}){const t=h,s=C(t,"open",V,{passive:!0}),B=N(),i=g(),u=g();function f(){u.value=void 0;try{t.state?i.value=JSON.parse(JSON.stringify(t.state||{})):(typeof t.state=="number"||typeof t.state!="string")&&(i.value=t.state)}catch(e){console.error(e),u.value=e}}D(()=>{f(),M(()=>[t.revision,t.state],e=>{typeof e!="number"&&typeof e!="string"?v(e,t.state):i.value=t.state},{deep:!0})});function v(e,r){const n=e[1];for(const a in n)Array.isArray(n[a])?r[a]=n[a].slice():typeof n[a]=="object"&&n[a]!==null?v(n[a],r[a]):r[a]=n[a]}async function S(){f(),await U()}return(e,r)=>{const n=O,a=j,w=P("tooltip");return l(),c("div",{class:"state-editor-details",open:e.name?o(s):!0},[m("div",T,[e.name?(l(),c("button",{key:0,flex:"~","cursor-pointer":"","items-center":"",class:d(o(s)?"":"op50"),onClick:r[0]||(r[0]=y=>s.value=!o(s))},[m("div",{"i-carbon-chevron-right":"",transition:"",class:d(o(s)?"rotate-90 op0":"")},null,2),m("code",{px3:"",py1:"","font-mono":"",class:d(o(s)?"bg-[#8881] rounded-t":"rounded hover:bg-active")},b(e.name),3)],2)):p("",!0),R(e.$slots,"actions",$(E({isOpen:o(s),name:e.name,state:e.state}))),o(s)?(l(),c(k,{key:1},[J(x(n,{title:"Refresh View",icon:"carbon-renew",border:!1,onClick:S},null,512),[[w,"Refresh View",void 0,{bottom:!0}]]),i.value&&!u.value?(l(),_(a,{key:0,getter:()=>({name:e.name,input:JSON.stringify(i.value)})},null,8,["getter"])):p("",!0)],64)):p("",!0)]),o(s)||!e.name?(l(),c(k,{key:0},[u.value?(l(),c("div",W," Error: "+b(u.value),1)):(l(),_(o(F),A({key:1,modelValue:i.value,"onUpdate:modelValue":r[1]||(r[1]=y=>i.value=y)},e.$attrs,{class:["json-editor-vue",[o(B)==="dark"?"jse-theme-dark":"",(e.name,"")]],"main-menu-bar":!1,"navigation-bar":!1,"status-bar":!1,"read-only":t.readonly,indentation:2,"tab-size":2}),null,16,["modelValue","class","read-only"]))],64)):p("",!0)],8,Q)}}});export{G as _};
|