import{d as y,E as f,o as i,e as v,z as g,w as c,a as o,F,g as B,b as t,c as S,t as p,n as D,aa as u}from"./BvNnk7SS.js";import{_ as U}from"./BCnE2YRK.js";import h from"./BqNcruSh.js";import{_ as z}from"./DZKfetH0.js";import{u as A}from"./CIaRsw82.js";import"./CYKwSea8.js";import"./BOtdTvFK.js";import"./a7ZBoMfv.js";import"./BxD-9MY-.js";import"./9QyWfnsF.js";import"./eQq4h1B_.js";const N=u(U),O=u(h),P=u(z),j=["id"],I={px1:""},L={mb2:""},M={mr2:""},R={op80:""},et=y({__name:"BindingComponentEditor",props:{contentRef:{type:[String,Object,Function]},view:{},getPos:{type:Function},setAttrs:{type:Function},node:{},selected:{},decorations:{},innerDecorations:{}},setup(x){const V=x,{frontmatter:d,frontmatterDoc:_,getComponentProps:b}=A(),{model:e,mdcAttrs:s}=b(V,{value:{type:String},defaultValue:{type:String}}),l=f(()=>e.value?.replace("$doc.","")),w=f(()=>_.value[l.value]||d.value[l.value]||e.value?.defaultValue);function k(m){s.value=`$doc.${m}`}return(m,n)=>{const C=N,E=O,$=P;return i(),v("span",{id:t(e).id,class:D(["group relative",t(e).class]),contenteditable:"false"},[g($,{tooltip:`${t(e).value}`,"tooltip-classes":"pt1","bg-active":"",rounded:"","inline-block":""},{menu:c(()=>[o("div",L,[n[1]||(n[1]=o("label",{"text-sm":"","font-mono":"","first-letter:capitalize":"",op50:""},"Frontmatter value",-1)),(i(!0),v(F,null,B({...t(d),...t(_)},(r,a)=>(i(),S(C,{key:a,pressed:l.value===a,classes:"flex items-center text-sm [[data-state='on']]:bg-active",onClick:T=>k(a)},{default:c(()=>[o("span",M,p(a)+":",1),o("span",R,p(r),1)]),_:2},1032,["pressed","onClick"]))),128))]),g(E,{modelValue:t(s).defaultValue,"onUpdate:modelValue":n[0]||(n[0]=r=>t(s).defaultValue=r),label:"default value",classes:"flex-col items-start!","input-classes":"w-full max-w-full"},null,8,["modelValue"])]),default:c(()=>[o("span",I,p(w.value||t(e).defaultValue),1)]),_:1},8,["tooltip"])],10,j)}}});export{et as default};
