import{l as x}from"./index-8HslT92O.js";import{aA as B,b as t,M as S,d as j,j as w,P as K}from"./app-QjDgb7aF.js";import{F as V}from"./link-DQNFdX6e.js";import{F as N}from"./section-Dbg05qO2.js";import{M as g}from"./MkKeyValue-BeApKcpm.js";import{F as P}from"./split-B5EOpoau.js";import{b as D,w as H,E as y,j as c,g as _,i as e,k as i,J as a,D as s,u as r,q as L,p as A,F as E,G as T,H as $,f,a as q}from"./vue-Cm77DuTi.js";import"./charts-3gEHPHRq.js";import"./media-DuCIZ-3n.js";const G={class:"_formLinks"},Y=D({__name:"registry.keys",props:{path:{}},setup(h){const d=h,n=f(()=>d.path.split("/"));let p=q(null);function k(){j("i/registry/keys-with-type",{scope:n.value}).then(l=>{p.value=Object.entries(l).sort((o,m)=>o[0].localeCompare(m[0]))})}async function v(){const{canceled:l,result:o}=await w(t.ts._registry.createKey,{key:{type:"string",label:t.ts._registry.key},value:{type:"string",multiline:!0,label:t.ts.value},scope:{type:"string",label:t.ts._registry.scope,default:n.value.join("/")}});l||K("i/registry/set",{scope:o.scope.split("/"),key:o.key,value:x.parse(o.value)}).then(()=>{k()})}H(()=>d.path,k,{immediate:!0});const b=f(()=>[]),M=f(()=>[]);return B({title:t.ts.registry,icon:"ph-gear-six ph-bold ph-lg"}),(l,o)=>{const m=y("MkPageHeader"),C=y("MkSpacer"),F=y("MkStickyContainer");return c(),_(F,null,{header:e(()=>[i(m,{actions:b.value,tabs:M.value},null,8,["actions","tabs"])]),default:e(()=>[i(C,{"content-max":600,"margin-min":16},{default:e(()=>[i(P,null,{default:e(()=>[i(g,{class:"_formBlock"},{key:e(()=>[a(s(r(t).ts._registry.domain),1)]),value:e(()=>[a(s(r(t).ts.system),1)]),_:1}),i(g,{class:"_formBlock"},{key:e(()=>[a(s(r(t).ts._registry.scope),1)]),value:e(()=>[a(s(n.value.join("/")),1)]),_:1})]),_:1}),i(S,{primary:"",onClick:v},{default:e(()=>[a(s(r(t).ts._registry.createKey),1)]),_:1}),r(p)?(c(),_(N,{key:0},{label:e(()=>[a(s(r(t).ts.keys),1)]),default:e(()=>[L("div",G,[(c(!0),A(E,null,T(r(p),u=>(c(),_(V,{to:`/registry/value/system/${n.value.join("/")}/${u[0]}`,class:"_monospace"},{suffix:e(()=>[a(s(u[1].toUpperCase()),1)]),default:e(()=>[a(s(u[0]),1)]),_:2},1032,["to"]))),256))])]),_:1})):$("",!0)]),_:1})]),_:1})}}});export{Y as default};
//# sourceMappingURL=registry.keys-CNTq1Jle.js.map
