import{i as e,n as t}from"./rolldown-runtime-ConPGZeh.js";import{Nn as n,Rr as r,Sr as i,Un as a,Vn as o,Xn as s,Yr as c,Zn as l,er as u,hr as d,ii as f,ir as p,jr as m,m as h,oi as g,or as _,p as v,pr as y}from"./vendor-primevue-D1-E3-0M.js";import{n as b,t as x}from"./markdownRendererUtil-CsfE-fUn.js";var S,C,w=t((()=>{n(),v(),x(),S=[`innerHTML`],C=_({__name:`WidgetMarkdown`,props:y({widget:{}},{modelValue:{default:``},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=m(e,`modelValue`),n=c(!1),_=c(),v=s(()=>b(t.value||``)),startEditing=async()=>{n.value||e.widget.options?.read_only||(n.value=!0,await d(),_.value?.$el?.focus())},handleBlur=()=>{n.value=!1};return(e,s)=>(i(),u(`div`,{class:`widget-markdown relative w-full`,onDblclick:startEditing},[l(`div`,{class:g([`comfy-markdown-content size-full min-h-[60px] overflow-y-auto rounded-lg text-sm`,n.value===!1?`visible`:`invisible`]),innerHTML:v.value},null,10,S),r(p(f(h),{ref_key:`textareaRef`,ref:_,modelValue:t.value,"onUpdate:modelValue":s[0]||=e=>t.value=e,"aria-label":`${e.$t(`g.edit`)} ${e.widget.name||e.$t(`g.markdown`)} ${e.$t(`g.content`)}`,class:`absolute inset-0 min-h-[60px] w-full resize-none`,pt:{root:{class:`text-sm w-full h-full`,onBlur:handleBlur}},"data-capture-wheel":`true`,onClick:s[1]||=a(()=>{},[`stop`]),onKeydown:s[2]||=a(()=>{},[`stop`])},null,8,[`modelValue`,`aria-label`,`pt`]),[[o,n.value]])],32))}})})),T;t((()=>{w(),w(),T=C}))();export{T as default};
//# sourceMappingURL=WidgetMarkdown-vgVQJDhs.js.map