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-ddj4xtqm.js";import"./vendor/shiki-kunkft64.js";import{It as _,N as v,k as y}from"#entry";import{t as b}from"./composables-g8w9dpc0.js";import{t as x}from"./help-fab-bhtk9hzf.js";import"./nicon-title-hrj2h1mn.js";import{t as S}from"./nsection-block-kp1wt3o4.js";import"./data-schema-button-j6fxaw99.js";import{t as C}from"./state-editor-gc0bkewv.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){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};