import{C as e,E as t,Mt as n,P as r,Q as i,W as a,X as o,Y as s,_ as c,c as l,dt as u,ft as d,g as f,h as p,m,v as h,w as g}from"./vendor/json-editor-vue-eojr4v24.js";import"./ready-dadbdj5i.js";import"./utils-jupbrzo6.js";import{r as _}from"./client-nwyjxodt.js";import"./vendor/shiki-lqo1hg2n.js";import"./storage-options-nzog3hhp.js";import"./nuxt-link-bumooa9d.js";import{t as v}from"./_plugin-vue_export-helper-n58akrbk.js";import"./nicon-m1crov2l.js";import{t as y}from"./nbutton-gygn07c2.js";import{t as b}from"./composables-b2ccklz4.js";import{t as x}from"./help-fab-oeo4c53s.js";import"./nicon-title-kbrt9te7.js";import{t as S}from"./nsection-block-ibsk9arc.js";import"./data-schema-button-n0xmsouw.js";import{t as C}from"./state-editor-m7poh4fc.js";var w={key:0,flex:`~ col gap-1`},T={key:1,mt2:``,px4:``,italic:``,op35:``},E=t({__name:`StateGroup`,props:{state:{},revision:{},prefix:{default:``}},setup(e){return(t,n)=>{let i=C;return a(),h(`div`,null,[e.state&&Object.keys(e.state).length>0?(a(),h(`div`,w,[(a(!0),h(l,null,s(e.state,(n,s)=>(a(),f(i,{key:s,revision:e.revision,state:n,name:s.startsWith(e.prefix)?s.slice(e.prefix.length):s},{actions:u(e=>[o(t.$slots,`actions`,r({ref_for:!0},e))]),_:3},8,[`revision`,`state`,`name`]))),128))])):(a(),h(`div`,T,` No data `))])}}}),D=Object.assign(E,{__name:`StateGroup`}),O={},k={class:`markdown-body`};function A(e,t){return a(),h(`div`,k,[...t[0]||=[p(`template`,null,[p(`div`,{class:`markdown-body`},[p(`h1`,null,`State & Async Data`),p(`p`,null,`// TODO`)])],-1)]])}var j=v(O,[[`render`,A]]),M={key:0},N=t({__name:`payload`,setup(t){b({icon:`carbon-data-set`,title:`Payload`,category:`analyze`,show:()=>{let e=_();return()=>!!e.value},order:7});let r=_(),o=m(()=>r.value?.nuxt.payload),s=m(()=>r.value?.revision.value);async function p(e){await r.value?.nuxt.hooks.callHookParallel(`app:data:refresh`,e)}return(t,m)=>{let _=D,v=S,b=y,w=C,T=j,E=x,O=i(`tooltip`);return a(),h(l,null,[n(r)?(a(),h(`div`,M,[g(v,{icon:`carbon-data-set`,text:`State`,description:"Keyed state from `useState`",padding:!1},{default:u(()=>[g(_,{state:o.value.state,revision:s.value,prefix:`$s`},null,8,[`state`,`revision`])]),_:1}),g(v,{icon:`carbon-data-blob`,text:`Data`,description:"Keyed state from `useAsyncData`",padding:!1},{actions:u(()=>[g(b,{n:`xs primary`,"self-start":``,icon:`i-carbon-recycle`,onClick:m[0]||=e=>p()},{default:u(()=>[...m[1]||=[e(` Re-fetch all data `,-1)]]),_:1})]),default:u(()=>[g(_,{state:o.value.data,revision:s.value},{actions:u(({isOpen:e,name:t})=>[e&&t?d((a(),f(b,{key:0,title:`Re-fetch '${t}'`,icon:`carbon-recycle`,border:!1,onClick:e=>p([t])},null,8,[`title`,`onClick`])),[[O,`Re-fetch '${t}'`,void 0,{bottom:!0}]]):c(``,!0)]),_:1},8,[`state`,`revision`])]),_:1}),o.value.functions&&Object.keys(o.value.functions).length?(a(),f(v,{key:0,icon:`carbon-function`,text:`Functions`,description:`State for functions`},{default:u(()=>[g(w,{"ml--6":``,state:o.value.functions,revision:s.value},null,8,[`state`,`revision`])]),_:1})):c(``,!0)])):c(``,!0),g(E,null,{default:u(()=>[g(T)]),_:1})],64)}}});export{N as default};