import{i as e,n as t}from"./rolldown-runtime-BKYq3fBv.js";import{Cr as n,Mr as r,Nn as i,Un as a,Vn as o,Xn as s,Xr as c,Zn as l,ai as u,ar as d,er as f,gr as p,m,mr as h,p as g,si as _,sr as v,zr as y}from"./vendor-primevue-D50rA9nL.js";import{n as b,t as x}from"./markdownRendererUtil-DUxQXDfQ.js";var S,C,w=t((()=>{i(),g(),x(),S=[`innerHTML`],C=v({__name:`WidgetMarkdown`,props:h({widget:{}},{modelValue:{default:``},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=r(e,`modelValue`),i=c(!1),h=c(),g=s(()=>b(t.value||``)),startEditing=async()=>{i.value||e.widget.options?.read_only||(i.value=!0,await p(),h.value?.$el?.focus())},handleBlur=()=>{i.value=!1};return(e,r)=>(n(),f(`div`,{class:`widget-markdown relative w-full`,onDblclick:startEditing},[l(`div`,{class:_([`comfy-markdown-content size-full min-h-[60px] overflow-y-auto rounded-lg text-sm`,i.value===!1?`visible`:`invisible`]),innerHTML:g.value},null,10,S),y(d(u(m),{ref_key:`textareaRef`,ref:h,modelValue:t.value,"onUpdate:modelValue":r[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`,onPointerdownCapture:r[1]||=a(()=>{},[`stop`]),onPointermoveCapture:r[2]||=a(()=>{},[`stop`]),onPointerupCapture:r[3]||=a(()=>{},[`stop`]),onClick:r[4]||=a(()=>{},[`stop`]),onKeydown:r[5]||=a(()=>{},[`stop`])},null,8,[`modelValue`,`aria-label`,`pt`]),[[o,i.value]])],32))}})})),T;t((()=>{w(),w(),T=C}))();export{T as default};
//# sourceMappingURL=WidgetMarkdown-BOF200Jh.js.map